@cntrl-site/components 1.0.100 → 1.0.101
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.
- package/dist/index.js +12 -16
- package/dist/index.mjs +74 -78
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5280,7 +5280,7 @@ type TestimonialsSettings = {
|
|
|
5280
5280
|
left: 50%;
|
|
5281
5281
|
transform: translate(-50%, -50%);
|
|
5282
5282
|
}
|
|
5283
|
-
`}function Vy(){return Math.random()<.5?"ltr":"ttb"}function Gy(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function Xy(e){const t=Vy();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Gy(e)})})}const Fn=500,Uy=750,hi="cubic-bezier(0.22, 1, 0.36, 1)",qy=72,Yy=50;function Ky(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function Qy(e){const[t,n]=e.media;return n!=null&&n.assetId?n:t!=null&&t.assetId?t:null}function Zy(e){const[t]=e.media;return t!=null&&t.assetId?t:null}function tp(e){return!Array.isArray(e)||e.length===0?[]:Ky(e)?e.flatMap(t=>{const n=Qy(t);if(!n)return[];const i=Zy(t);return[{displayMedia:n,lightboxMedia:i!=null&&i.assetId?i:null}]}):e.filter(t=>t==null?void 0:t.assetId).map(t=>({displayMedia:t,lightboxMedia:t}))}function Yi(e){return e.type==="video"}function Jy(e){const t=new Set,n=[];for(const i of e){const o=tp(i.gallery);for(const r of o){const l=r.lightboxMedia;l!=null&&l.assetId&&!t.has(l.assetId)&&(t.add(l.assetId),n.push(l))}}return n}function ev({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Yi(t)?a.jsx("video",{src:t.assetId,preload:"auto",muted:!0,playsInline:!0},t.assetId):a.jsx("img",{src:t.assetId,alt:""},t.assetId))})}function tv(e){e.pause(),e.removeAttribute("src"),e.load()}function Pc({media:e,className:t,style:n,onMediaClick:i}){return Yi(e)?a.jsx("video",{src:e.assetId,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):a.jsx("img",{src:e.assetId,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function Mc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function nv(e,t){if(!t||!t.width||!t.height||!e.width||!e.height)return e;const n=t.width/t.height,i=e.width/e.height;if(n>i){const r=e.width/n;return{width:e.width,height:r,left:e.left,top:e.top+(e.height-r)/2}}const o=e.height*n;return{width:o,height:e.height,left:e.left+(e.width-o)/2,top:e.top}}function iv({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const c=n.current;if(c)return()=>{tv(c)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,style:i})}const ov="https://cdn.cntrl.site/component-assets/defaultCloseIcon.svg",rv=.004;function av({prefix:e,closeIcon:t=ov,closeIconMaxWidth:n=.0125,closeIconColor:i="#FFFFFF",closeIconHoverColor:o="#999999",iconMarginRight:r=.01,contentMarginTop:l=.01,isEditor:c,isPreviewMode:d,isEditMode:u,visible:p,onClose:y}){if(!t)return null;const x=E.scalingValue(n,c),g=E.scalingValue(r,c),h=E.scalingValue(l,c),b=E.scalingValue(Math.max(l,rv),c);return a.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,zIndex:1e4,display:"flex",flexDirection:"column",alignItems:"flex-end",pointerEvents:"none",opacity:p?1:0,transition:"opacity 500ms cubic-bezier(0.22, 1, 0.36, 1)"},children:[a.jsx("div",{style:{position:"relative",width:"100%",height:h,flexShrink:0},children:u&&a.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${e}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:b,pointerEvents:p?"auto":"none"}})}),a.jsxs("div",{className:`${e}-close-icon`,style:{width:x,height:x,marginRight:g,pointerEvents:p?"auto":"none"},onClick:S=>S.stopPropagation(),children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,"aria-label":"Close",onClick:S=>{S.stopPropagation(),y()},children:a.jsx(gn,{url:t,fill:i,hoverFill:c&&!d?i:o,className:`${e}-close-icon-img`})}),u&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:g,height:"100%",pointerEvents:p?"auto":"none"}})]})]})}function sv({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,isPreviewMode:r,isEditMode:l,onClose:c,onPrev:d,onNext:u,counterClassName:p,counterStyle:y,closeIcon:x,closeIconMaxWidth:g,closeIconColor:h,closeIconHoverColor:b,iconMarginRight:S,contentMarginTop:_}){const v=i==="cover",L=s.useRef(null),P=s.useRef(null),q=s.useRef(null),X=s.useRef(null),B=s.useRef(0),H=s.useRef(0),O=s.useRef("none"),C=s.useRef(!1),$=s.useRef(!1),Q=s.useRef(null),R=s.useRef(0),T=s.useRef(null),w=s.useRef(!1),V=s.useRef(null),z=s.useRef(null),U=s.useRef(null),M=s.useRef(()=>{}),[f,K]=s.useState(null),[G,ge]=s.useState(null),[k,ce]=s.useState("opening"),[I,ue]=s.useState(0),[ee,xe]=s.useState(0),[Le,se]=s.useState(null),[de,Z]=s.useState(!1),[pe,ie]=s.useState(!1),[me,ve]=s.useState(!1),[Ee,Re]=s.useState(null),Ce=s.useRef(n),$e=s.useRef(void 0),m=t[n],Y=m?Yi(m):!1,te=ee!==0||de,oe=Le!==null,fe=s.useCallback(Ne=>{const be=Ne.currentTarget,He=be instanceof HTMLVideoElement?{width:be.videoWidth,height:be.videoHeight}:{width:be.naturalWidth,height:be.naturalHeight};!He.width||!He.height||Re(He)},[]);s.useEffect(()=>{Q.current=G},[G]),s.useEffect(()=>{const Ne=L.current;if(!Ne)return;const be=()=>ge(Mc(Ne));be();const He=new ResizeObserver(be);return He.observe(Ne),()=>He.disconnect()},[]);const N=s.useCallback(()=>{V.current!==null&&(window.clearTimeout(V.current),V.current=null)},[]),F=s.useCallback(()=>{const Ne=z.current;z.current=null,N(),T.current=null,w.current=!1,se(null),Z(!1),xe(0),R.current=0,ie(!1),C.current=!1,H.current=0,O.current="none",Ne===1?u():Ne===-1&&d()},[N,u,d]),ne=s.useCallback(()=>{N(),z.current=null,T.current=null,w.current=!1,se(null),Z(!1),xe(0),R.current=0},[N]),re=s.useCallback(()=>{N(),V.current=window.setTimeout(()=>{z.current!==null&&F()},Fn+32)},[N,F]),J=s.useCallback((Ne,be)=>{var Xe;const He=((Xe=Q.current)==null?void 0:Xe.width)??0;if(N(),T.current=Ne,se(Ne),w.current=!0,Z(!0),be){z.current=Ne;const ct=-Ne*He;R.current=ct,xe(ct),re();return}R.current=0,xe(0),V.current=window.setTimeout(()=>{V.current=null,ne()},Fn+32)},[N,ne,re]),W=s.useCallback(Ne=>{if(!(t.length<=1)){if(w.current){if(z.current===Ne){U.current=Ne,F();return}ne()}N(),T.current=Ne,se(Ne),w.current=!1,Z(!1),R.current=0,xe(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{J(Ne,!0)})})}},[t.length,J,F,ne,N]);M.current=W;const Se=s.useCallback(Ne=>{Ne.propertyName!=="transform"||!w.current||z.current!==null&&F()},[F]),le=s.useCallback(()=>{const Ne=P.current;if(!Ne)return;const be=Mc(Ne);!be.width||!be.height||K(be)},[]);s.useEffect(()=>{le();const Ne=P.current;if(!Ne)return;const be=new ResizeObserver(()=>le());return be.observe(Ne),()=>be.disconnect()},[le]),s.useEffect(()=>{k==="opening"&&f&&ce("open")},[k,f]),s.useEffect(()=>{if(k!=="closing")return;const Ne=setTimeout(()=>c(),Fn);return()=>clearTimeout(Ne)},[k,c]),s.useEffect(()=>()=>{N()},[N]),s.useLayoutEffect(()=>{Ce.current===n&&$e.current===(m==null?void 0:m.assetId)||(N(),z.current=null,se(null),ue(0),xe(0),Z(!1),ve(!1),ie(!1),Re(null),B.current=0,H.current=0,O.current="none",C.current=!1,w.current=!1,R.current=0,T.current=null,X.current=null,$.current=!1,Ce.current=n,$e.current=m==null?void 0:m.assetId)},[n,m==null?void 0:m.assetId,N]),s.useLayoutEffect(()=>{const Ne=U.current;Ne!==null&&(U.current=null,requestAnimationFrame(()=>{M.current(Ne)}))},[n,m==null?void 0:m.assetId]),s.useEffect(()=>{if(k!=="open")return;let Ne=null;const be=()=>{Ne&&(document.removeEventListener("click",Ne,!0),Ne=null)},He=()=>{be(),Ne=pt=>{pt.stopPropagation(),pt.preventDefault(),be()},document.addEventListener("click",Ne,!0)},Xe=pt=>{const It=pt<0?1:-1;if(Math.abs(pt)>Yy&&t.length>1){J(It,!0);return}J(It,!1)},ct=pt=>{if(pt.touches.length!==1||w.current)return;const It=pt.touches[0];$.current=!0,X.current={x:It.clientX,y:It.clientY},O.current="none",H.current=0,C.current=!1},rt=pt=>{if(!X.current||pt.touches.length!==1||w.current)return;const It=pt.touches[0],nt=It.clientX-X.current.x,bt=It.clientY-X.current.y;if(O.current==="none"){if(Math.abs(nt)<10&&Math.abs(bt)<10)return;if(Math.abs(nt)>Math.abs(bt)){if(t.length<=1)return;O.current="horizontal"}else if(bt>0)O.current="vertical";else return}if(O.current==="horizontal"){C.current=!0,ie(!0),H.current=nt;const Lt=nt<0?1:-1;T.current!==Lt&&(T.current=Lt,se(Lt)),R.current=nt,xe(nt),pt.preventDefault();return}O.current==="vertical"&&(C.current=!0,ie(!0),B.current=bt,ue(bt),pt.preventDefault())},xt=()=>{if(!X.current)return;const pt=O.current,It=C.current;if(It&&pt==="horizontal")Xe(H.current),He();else if(It&&pt==="vertical")if(B.current>qy){const bt=window.innerHeight;B.current=bt,ve(!0),ue(bt),ce("closing")}else B.current=0,ue(0),He();else pt==="horizontal"&&Math.abs(H.current)>0&&(Xe(H.current),He());X.current=null,O.current="none",H.current=0,C.current=!1,ie(!1)};return document.addEventListener("touchstart",ct,{passive:!0}),document.addEventListener("touchmove",rt,{passive:!1}),document.addEventListener("touchend",xt),document.addEventListener("touchcancel",xt),()=>{document.removeEventListener("touchstart",ct),document.removeEventListener("touchmove",rt),document.removeEventListener("touchend",xt),document.removeEventListener("touchcancel",xt),be()}},[k,t.length,J]),s.useEffect(()=>{const Ne=be=>{be.key==="Escape"&&(be.preventDefault(),be.stopPropagation(),k!=="closing"&&ce("closing"))};return window.addEventListener("keydown",Ne,!0),()=>window.removeEventListener("keydown",Ne,!0)},[k]);const j=()=>{k!=="closing"&&ce("closing")},Te=k==="open",Fe=k==="closing",Ye=I>0?Math.max(0,1-I/500):1,De=I>0?Math.max(.35,1-I/500):1,ze=f?v?f:nv(f,Ee):null,Ze=Ne=>{if(Ne.stopPropagation(),$.current){$.current=!1;return}if(t.length<=1)return;const be=ze??Ne.currentTarget.getBoundingClientRect(),He=Ne.clientY-be.top,Xe=Math.min(52,be.height*.2);if(!(He>be.height-Xe)){if(Ne.clientX-be.left<be.width/2){W(-1);return}W(1)}},Ue=Ne=>{if(t.length<=1)return;const be=ze??Ne.currentTarget.getBoundingClientRect(),He=Ne.clientX-be.left,Xe=Ne.clientY-be.top,ct=Math.min(52,be.height*.2);if(Xe>be.height-ct){Ne.currentTarget.style.cursor="default";return}Ne.currentTarget.style.cursor=He<be.width/2?"w-resize":"e-resize"},ye={position:"fixed",top:G==null?void 0:G.top,left:G==null?void 0:G.left,width:G==null?void 0:G.width,height:G==null?void 0:G.height,zIndex:9998},_e=v?"cover":"contain",Ve=ee!==0||I>0?`translate(${ee}px, ${I}px)`:void 0,Je=pe&&!de?"none":de?`transform ${Fn}ms ${hi}`:me?`transform ${Fn}ms ${hi}, opacity ${Fn}ms ${hi}`:k==="opening"||Fe?`opacity ${Fn}ms ${hi}`:"none",et={...ye,transform:Ve,opacity:I>0?De:k==="opening"||Fe?0:1,transition:Je,pointerEvents:"none"},ot={position:"absolute",top:((ze==null?void 0:ze.top)??0)-((G==null?void 0:G.top)??0),left:((ze==null?void 0:ze.left)??0)-((G==null?void 0:G.left)??0),width:ze==null?void 0:ze.width,height:ze==null?void 0:ze.height,objectFit:_e,pointerEvents:Y&&Te&&!te?"auto":"none",touchAction:Y&&Te?"none":void 0},lt=(G==null?void 0:G.width)??0,Ke=oe?(n+Le+t.length)%t.length:null,ht=Ke!==null?t[Ke]:null,tt={...ye,transform:oe?`translateX(${Le*lt+ee}px)`:void 0,opacity:1,transition:de?`transform ${Fn}ms ${hi}`:"none",pointerEvents:"none"},Ge={position:"absolute",top:((f==null?void 0:f.top)??0)-((G==null?void 0:G.top)??0),left:((f==null?void 0:f.left)??0)-((G==null?void 0:G.left)??0),width:f==null?void 0:f.width,height:f==null?void 0:f.height,objectFit:_e,pointerEvents:"none"},We=ze?{position:"fixed",top:ze.top,height:ze.height,width:ze.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:L,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:k==="open"?"none":void 0},onClick:j,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:Te?Ye:0,transition:pe?"none":`opacity ${Fn}ms ${hi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:v?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:P,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:Te?1:0,transition:`opacity ${Fn}ms ${hi}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:p,style:y,children:[n+1," / ",t.length]})})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:P,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:Te?1:0,transition:`opacity ${Fn}ms ${hi}`},children:t.length>1&&a.jsxs("p",{className:p,style:y,children:[n+1," / ",t.length]})})]})}),f&&G&&ht&&a.jsx("div",{style:tt,onTransitionEnd:Se,children:Yi(ht)?a.jsx("video",{src:ht.assetId,muted:!0,playsInline:!0,preload:"auto",style:Ge},`neighbor-${Ke}-${ht.assetId}`):a.jsx("img",{src:ht.assetId,alt:ht.name,style:Ge},`neighbor-${Ke}-${ht.assetId}`)}),f&&G&&m&&a.jsx("div",{style:et,onTransitionEnd:Se,children:Y?a.jsx(iv,{src:m.assetId,phase:k,mediaRef:q,mediaStyle:ot,onLoadedMetadata:fe,onClick:Ze,onMouseMove:Ue},`${n}-${m.assetId}`):a.jsx("img",{ref:q,src:m.assetId,alt:m.name,onLoad:fe,style:ot},`${n}-${m.assetId}`)}),Te&&We&&t.length>1&&!Y&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...We,left:ze.left,cursor:"w-resize",pointerEvents:pe?"none":"auto"},onClick:Ne=>{if($.current){$.current=!1;return}Ne.stopPropagation(),W(-1)}}),a.jsx("div",{style:{...We,left:ze.left+ze.width/2,cursor:"e-resize",pointerEvents:pe?"none":"auto"},onClick:Ne=>{if($.current){$.current=!1;return}Ne.stopPropagation(),W(1)}})]}),a.jsx(av,{prefix:e,closeIcon:x,closeIconMaxWidth:g,closeIconColor:h,closeIconHoverColor:b,iconMarginRight:S,contentMarginTop:_,isEditor:o,isPreviewMode:r,isEditMode:l,visible:Te,onClose:j})]})}function lv(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function cv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:c,portalId:d}){const{prefix:u}=E.useScopedStyles(),{type:p="a",gridLayout:y,textBoxWidth:x=100,verticalGap:g,entriesCount:h,lightbox:b,imageDisplay:S,imageCorners:_,lightboxImageDisplay:v,slider:L,sliderTiming:P,direction:q,transition:X,titleMarginTop:B,subtitleMarginTop:H,titleColor:O,subtitleColor:C,lightboxCounterColor:$,titleFontFamily:Q,titleFontSettings:R,titleFontSize:T,titleLineHeight:w,titleLetterSpacing:V,titleWordSpacing:z,titleTextAppearance:U,subtitleFontFamily:M,subtitleFontSettings:f,subtitleFontSize:K,subtitleLineHeight:G,subtitleLetterSpacing:ge,subtitleWordSpacing:k,subtitleTextAppearance:ce,lightboxCounterFontFamily:I,lightboxCounterFontSettings:ue,lightboxCounterFontSize:ee,lightboxCounterLineHeight:xe,lightboxCounterLetterSpacing:Le,lightboxCounterWordSpacing:se,lightboxCounterTextAppearance:de,closeIcon:Z,closeIconMaxWidth:pe,closeIconColor:ie,closeIconHoverColor:me,iconMarginRight:ve,contentMarginTop:Ee,showText:Re="always",alignEntries:Ce="off",align:$e="top"}=e,m={fontSettings:{fontFamily:Q,fontWeight:(R==null?void 0:R.fontWeight)??400,fontStyle:(R==null?void 0:R.fontStyle)??"normal"},fontSize:T??.01,lineHeight:w,letterSpacing:V??0,wordSpacing:z??0,textAppearance:U,color:O},te={...pn(nn(m,n))},oe={fontSettings:{fontFamily:M,fontWeight:(f==null?void 0:f.fontWeight)??400,fontStyle:(f==null?void 0:f.fontStyle)??"normal"},fontSize:K??.01,lineHeight:G,letterSpacing:ge??0,wordSpacing:k??0,textAppearance:ce,color:C},N={...pn(nn(oe,n))},F={fontSettings:{fontFamily:I,fontWeight:(ue==null?void 0:ue.fontWeight)??400,fontStyle:(ue==null?void 0:ue.fontStyle)??"normal"},fontSize:ee??.01,lineHeight:xe,letterSpacing:Le??0,wordSpacing:se??0,textAppearance:de,color:$},re={...pn(nn(F,n)),...os(ee,xe,u,n)},J=is(T,w,`${u}-item-title`,`${u}-text-tight-leading`),W=is(K,G,`${u}-item-subtitle`,`${u}-text-tight-leading`),Se=os(T,w,u,n),le=os(K,G,u,n),j=is(ee,xe,`${u}-lightbox-counter`,`${u}-text-tight-leading`),Te=E.buildColorVars(u,{titleColor:O,subtitleColor:C,lightboxCounterColor:$},dv,uv),De=`${l&&l!=="default"?`${u}-state-${l}`:""}${Re==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),ze=h===0?1/0:h,Ze=(t??[]).slice(0,ze),Ue=s.useMemo(()=>b==="on"?Jy(Ze):[],[Ze,b]),ye=y.entryWidth??.2,_e=(S==null?void 0:S.display)==="cover",Ve=(S==null?void 0:S.ratioValue)??"1:1",Je=(S==null?void 0:S.reversed)??!1,[et,ot]=Ve.split(":").map(Number),ht=`${Je?ot:et} / ${Je?et:ot}`,tt=y.columnsCount,Ge=E.scalingValue(ye??0,n),We=Ge,Ne=!_e&&L!=="off",be=Ze.length%tt||tt,He=be<tt&&Ze.length>0,Xe=Ze.length-be,ct=He?Math.floor((tt-be)/2)+1:1,rt=_?E.scalingValue(_,n):void 0,xt={width:We,..._e?{aspectRatio:ht,height:"auto",overflow:"hidden"}:{height:"auto"},...rt?{borderRadius:rt,overflow:"hidden"}:{}},pt=`${u}-item-image-wrapper${Ne?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),It=p==="d"||p==="e"||p==="f",nt=Ce==="on",bt=`calc(${E.scalingValue(ye??0,n)} * (${x} / 100))`,Lt=E.scalingValue(ye*x/100,n),Ut=_e?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...rt?{borderRadius:rt}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...rt?{borderRadius:rt}:{}},[Ft,Me]=s.useState(0),Oe=s.useRef(null),St=X==="fade"||q==="horizontal"?"ltr":q==="vertical"?"ttb":"ltr";s.useEffect(()=>{const yt=Oe.current;if(!yt)return;const ut=new ResizeObserver(it=>{Me(Math.round(it[0].contentRect.width))});return ut.observe(yt),()=>ut.disconnect()},[]);const Mt=(()=>{const yt={...Te},ut=Oe.current?getComputedStyle(Oe.current).getPropertyValue("--cntrl-article-width").trim():"";return ut&&(yt["--cntrl-article-width"]=ut),yt})(),[Qe,kt]=s.useState(!1),[Bt,Wt]=s.useState([]),[At,Ae]=s.useState(0),ft=b==="on"&&(!n||i),gt=(yt,ut)=>{n&&!i||b!=="off"&&(Wt(yt),Ae(ut),kt(!0))};s.useEffect(()=>{if(!Qe||b!=="on"||typeof document>"u")return;const yt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=yt}},[Qe,b]),s.useEffect(()=>{!n||i||kt(!1)},[n,i]);const dt=s.useMemo(()=>jy(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:dt}}),b==="on"&&a.jsx(ev,{mediaList:Ue}),a.jsx("div",{style:Te,children:a.jsx("div",{ref:Oe,className:`${u}-wrapper ${u}-type-${p}${nt?` ${u}-align-entries`:""} ${u}-image-align-${$e} ${De}`.trim(),style:{gridTemplateColumns:`repeat(${tt}, ${Ge})`,rowGap:nt?0:E.scalingValue(g??0,n),columnGap:E.scalingValue(y.horizontalGap??0,n),width:E.scalingValue(y.wrapperWidth??0,n),...nt?{[`--${u}-align-entries-row-gap`]:E.scalingValue(g??0,n)}:{}},children:Ze.map((yt,ut)=>{var vt;const it=Lc(yt.title),Nt=Lc(yt.subtitle),$t=(((vt=yt.link)==null?void 0:vt.length)??0)>0&&b==="off"?yt.link:void 0,Qt=Math.floor(ut/tt)===Math.ceil(Ze.length/tt)-1,Xt=He&&ut>=Xe?`${ct+(ut-Xe)}`:void 0,Ot=It?a.jsxs("div",{className:`${u}-item-text-block`,children:[it&&a.jsx("p",{className:J,style:{width:bt,...te,...Se},children:yt.title}),it&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:E.scalingValue(B??0,n),width:Lt}}),Nt&&a.jsx("p",{className:W,style:{width:bt,...N,...le},children:yt.subtitle}),Nt&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:E.scalingValue(H??0,n),width:Lt}})]}):null,jt=nt?a.jsxs("div",{className:`${u}-item-title-row`,children:[!It&&a.jsx("div",{"data-controls":o&&it?"titleMarginTop":void 0,className:o&&it?`${u}-control`:void 0,style:{height:it?E.scalingValue(B??0,n):0,width:Lt}}),it&&a.jsx("p",{className:J,style:{width:bt,...te,...Se},children:yt.title}),It&&it&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:E.scalingValue(B??0,n),width:Lt}})]}):null,Dt=nt?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!It&&a.jsx("div",{"data-controls":o&&Nt?"subtitleMarginTop":void 0,className:o&&Nt?`${u}-control`:void 0,style:{height:Nt?E.scalingValue(H??0,n):0,width:Lt}}),Nt&&a.jsx("p",{className:W,style:{width:bt,...N,...le},children:yt.subtitle}),It&&Nt&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:E.scalingValue(H??0,n),width:Lt}})]}):null,zt=$t?a.jsxs("a",{href:$t,target:"_blank",className:`${u}-item-text-link`,children:[jt,Dt]}):a.jsxs(a.Fragment,{children:[jt,Dt]}),D=tp(yt.gallery),Ie=D.filter(Ct=>Ct.lightboxMedia).map(Ct=>Ct.lightboxMedia),Be=a.jsx("div",{className:pt,style:xt,children:D.length===0?null:L==="off"?(()=>{const{displayMedia:Ct,lightboxMedia:at}=D[0],Tt=at?Ie.findIndex(Vt=>Vt.assetId===at.assetId):-1;return a.jsx(Pc,{media:Ct,className:`${u}-item-${Yi(Ct)?"video":"image"}`.trim(),style:Ut,onMediaClick:ft&&Tt>=0?()=>gt(Ie,Tt):void 0})})():a.jsxs(a.Fragment,{children:[Ne&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:D.map(({displayMedia:Ct})=>Yi(Ct)?a.jsx("video",{src:Ct.assetId,muted:!0,playsInline:!0},`sizer-${Ct.assetId}`):a.jsx("img",{src:Ct.assetId,alt:""},`sizer-${Ct.assetId}`))}),a.jsx(El,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:P*1e3,width:"100%",height:"100%",speed:Uy,type:X==="fade"?"fade":"loop",rewind:X==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:St},onMoved:Ct=>{q!=="random"||X==="fade"||Xy(Ct)},children:D.map(({displayMedia:Ct,lightboxMedia:at},Tt)=>{const Vt=at?Ie.findIndex(Pt=>Pt.assetId===at.assetId):-1;return a.jsx(kl,{children:a.jsx(Pc,{media:Ct,className:`${u}-item-${Yi(Ct)?"video":"image"}`.trim(),style:Ut,onMediaClick:ft&&Vt>=0?()=>gt(Ie,Vt):void 0})},Tt)})},`${X}-${ye}-${q}-${P}-${Ft}-${c}`)]})}),ke=It?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&it?"titleMarginTop":void 0,className:o&&it?`${u}-control`:void 0,style:{height:it?E.scalingValue(B??0,n):0,width:Lt}}),a.jsx("p",{className:J,style:{width:bt,...te,...Se},children:yt.title}),a.jsx("div",{"data-controls":o&&Nt?"subtitleMarginTop":void 0,className:o&&Nt?`${u}-control`:void 0,style:{height:Nt?E.scalingValue(H??0,n):0,width:Lt}}),a.jsx("p",{className:W,style:{width:bt,...N,...le},children:yt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:Xt&&!nt?{gridColumn:Xt}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${nt&&Qt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(x??0)>100?`calc(${Ge} * (${x} / 100))`:Ge,...Xt&&nt?{gridColumn:Xt}:{}},children:nt?a.jsx(a.Fragment,{children:It?a.jsxs(a.Fragment,{children:[zt,a.jsx("a",{href:$t,target:"_blank",className:`${u}-item-image-link`,children:Be})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:$t,target:"_blank",className:`${u}-item-image-link`,children:Be}),zt]})}):$t?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:$t,target:"_blank",className:`${u}-item-image-link`,children:[Ot,Be]}),!It&&a.jsx("a",{href:$t,target:"_blank",className:`${u}-item-text-link`,children:ke})]}):a.jsxs(a.Fragment,{children:[Ot,Be,ke]})})},ut)})})}),(!n||i)&&Qe&&typeof document<"u"&&b==="on"&&(()=>{const yt=(d?document.getElementById(d):null)??document.body;return qn.createPortal(a.jsx("div",{style:Mt,"data-selection":"none",children:a.jsx(sv,{prefix:u,items:Bt,index:At,imageDisplay:lv(v),isEditor:n,isPreviewMode:i,isEditMode:o,closeIcon:Z,closeIconMaxWidth:pe,closeIconColor:ie,closeIconHoverColor:me,iconMarginRight:ve,contentMarginTop:Ee,onClose:()=>kt(!1),onPrev:()=>Ae(ut=>(ut-1+Bt.length)%Bt.length),onNext:()=>Ae(ut=>(ut+1)%Bt.length),counterClassName:j,counterStyle:re})}),yt)})()]})}const dv={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},uv=["hover","focus","filled","success","error"],pv=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
5283
|
+
`}function Vy(){return Math.random()<.5?"ltr":"ttb"}function Gy(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function Xy(e){const t=Vy();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Gy(e)})})}const Fn=500,Uy=750,hi="cubic-bezier(0.22, 1, 0.36, 1)",qy=72,Yy=50;function Ky(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function Qy(e){const[t,n]=e.media;return n!=null&&n.assetId?n:t!=null&&t.assetId?t:null}function Zy(e){const[t]=e.media;return t!=null&&t.assetId?t:null}function tp(e){return!Array.isArray(e)||e.length===0?[]:Ky(e)?e.flatMap(t=>{const n=Qy(t);if(!n)return[];const i=Zy(t);return[{displayMedia:n,lightboxMedia:i!=null&&i.assetId?i:null}]}):e.filter(t=>t==null?void 0:t.assetId).map(t=>({displayMedia:t,lightboxMedia:t}))}function Yi(e){return e.type==="video"}function Jy(e){const t=new Set,n=[];for(const i of e){const o=tp(i.gallery);for(const r of o){const l=r.lightboxMedia;l!=null&&l.assetId&&!t.has(l.assetId)&&(t.add(l.assetId),n.push(l))}}return n}function ev({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Yi(t)?a.jsx("video",{src:t.assetId,preload:"auto",muted:!0,playsInline:!0},t.assetId):a.jsx("img",{src:t.assetId,alt:""},t.assetId))})}function tv(e){e.pause(),e.removeAttribute("src"),e.load()}function Pc({media:e,className:t,style:n,onMediaClick:i}){return Yi(e)?a.jsx("video",{src:e.assetId,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):a.jsx("img",{src:e.assetId,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function Mc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function nv(e,t){if(!t||!t.width||!t.height||!e.width||!e.height)return e;const n=t.width/t.height,i=e.width/e.height;if(n>i){const r=e.width/n;return{width:e.width,height:r,left:e.left,top:e.top+(e.height-r)/2}}const o=e.height*n;return{width:o,height:e.height,left:e.left+(e.width-o)/2,top:e.top}}function iv({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const c=n.current;if(c)return()=>{tv(c)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,style:i})}const ov="https://cdn.cntrl.site/component-assets/defaultCloseIcon.svg",rv=.004;function av({prefix:e,closeIcon:t=ov,closeIconMaxWidth:n=.0125,closeIconColor:i="#FFFFFF",closeIconHoverColor:o="#999999",iconMarginRight:r=.01,contentMarginTop:l=.01,isEditor:c,isPreviewMode:d,isEditMode:u,visible:p,onClose:y}){if(!t)return null;const x=E.scalingValue(n,c),g=E.scalingValue(r,c),h=E.scalingValue(l,c),b=E.scalingValue(Math.max(l,rv),c);return a.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,zIndex:1e4,display:"flex",flexDirection:"column",alignItems:"flex-end",pointerEvents:"none",opacity:p?1:0,transition:"opacity 500ms cubic-bezier(0.22, 1, 0.36, 1)"},children:[a.jsx("div",{style:{position:"relative",width:"100%",height:h,flexShrink:0},children:u&&a.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${e}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:b,pointerEvents:p?"auto":"none"}})}),a.jsxs("div",{className:`${e}-close-icon`,style:{width:x,height:x,marginRight:g,pointerEvents:p?"auto":"none"},onClick:S=>S.stopPropagation(),children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,"aria-label":"Close",onClick:S=>{S.stopPropagation(),y()},children:a.jsx(gn,{url:t,fill:i,hoverFill:c&&!d?i:o,className:`${e}-close-icon-img`})}),u&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:g,height:"100%",pointerEvents:p?"auto":"none"}})]})]})}function sv({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,isPreviewMode:r,isEditMode:l,onClose:c,onPrev:d,onNext:u,counterClassName:p,counterStyle:y,closeIcon:x,closeIconMaxWidth:g,closeIconColor:h,closeIconHoverColor:b,iconMarginRight:S,contentMarginTop:_}){const v=i==="cover",L=s.useRef(null),P=s.useRef(null),q=s.useRef(null),X=s.useRef(null),B=s.useRef(0),H=s.useRef(0),O=s.useRef("none"),C=s.useRef(!1),$=s.useRef(!1),Q=s.useRef(null),R=s.useRef(0),T=s.useRef(null),w=s.useRef(!1),V=s.useRef(null),z=s.useRef(null),U=s.useRef(null),M=s.useRef(()=>{}),[f,K]=s.useState(null),[G,ge]=s.useState(null),[k,ce]=s.useState("opening"),[I,ue]=s.useState(0),[ee,xe]=s.useState(0),[Le,se]=s.useState(null),[de,Z]=s.useState(!1),[pe,ie]=s.useState(!1),[me,ve]=s.useState(!1),[Ee,Re]=s.useState(null),Ce=s.useRef(n),$e=s.useRef(void 0),m=t[n],Y=m?Yi(m):!1,te=ee!==0||de,oe=Le!==null,fe=s.useCallback(Ne=>{const be=Ne.currentTarget,He=be instanceof HTMLVideoElement?{width:be.videoWidth,height:be.videoHeight}:{width:be.naturalWidth,height:be.naturalHeight};!He.width||!He.height||Re(He)},[]);s.useEffect(()=>{Q.current=G},[G]),s.useEffect(()=>{const Ne=L.current;if(!Ne)return;const be=()=>ge(Mc(Ne));be();const He=new ResizeObserver(be);return He.observe(Ne),()=>He.disconnect()},[]);const N=s.useCallback(()=>{V.current!==null&&(window.clearTimeout(V.current),V.current=null)},[]),F=s.useCallback(()=>{const Ne=z.current;z.current=null,N(),T.current=null,w.current=!1,se(null),Z(!1),xe(0),R.current=0,ie(!1),C.current=!1,H.current=0,O.current="none",Ne===1?u():Ne===-1&&d()},[N,u,d]),ne=s.useCallback(()=>{N(),z.current=null,T.current=null,w.current=!1,se(null),Z(!1),xe(0),R.current=0},[N]),re=s.useCallback(()=>{N(),V.current=window.setTimeout(()=>{z.current!==null&&F()},Fn+32)},[N,F]),J=s.useCallback((Ne,be)=>{var Xe;const He=((Xe=Q.current)==null?void 0:Xe.width)??0;if(N(),T.current=Ne,se(Ne),w.current=!0,Z(!0),be){z.current=Ne;const ct=-Ne*He;R.current=ct,xe(ct),re();return}R.current=0,xe(0),V.current=window.setTimeout(()=>{V.current=null,ne()},Fn+32)},[N,ne,re]),W=s.useCallback(Ne=>{if(!(t.length<=1)){if(w.current){if(z.current===Ne){U.current=Ne,F();return}ne()}N(),T.current=Ne,se(Ne),w.current=!1,Z(!1),R.current=0,xe(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{J(Ne,!0)})})}},[t.length,J,F,ne,N]);M.current=W;const Se=s.useCallback(Ne=>{Ne.propertyName!=="transform"||!w.current||z.current!==null&&F()},[F]),le=s.useCallback(()=>{const Ne=P.current;if(!Ne)return;const be=Mc(Ne);!be.width||!be.height||K(be)},[]);s.useEffect(()=>{le();const Ne=P.current;if(!Ne)return;const be=new ResizeObserver(()=>le());return be.observe(Ne),()=>be.disconnect()},[le]),s.useEffect(()=>{k==="opening"&&f&&ce("open")},[k,f]),s.useEffect(()=>{if(k!=="closing")return;const Ne=setTimeout(()=>c(),Fn);return()=>clearTimeout(Ne)},[k,c]),s.useEffect(()=>()=>{N()},[N]),s.useLayoutEffect(()=>{Ce.current===n&&$e.current===(m==null?void 0:m.assetId)||(N(),z.current=null,se(null),ue(0),xe(0),Z(!1),ve(!1),ie(!1),Re(null),B.current=0,H.current=0,O.current="none",C.current=!1,w.current=!1,R.current=0,T.current=null,X.current=null,$.current=!1,Ce.current=n,$e.current=m==null?void 0:m.assetId)},[n,m==null?void 0:m.assetId,N]),s.useLayoutEffect(()=>{const Ne=U.current;Ne!==null&&(U.current=null,requestAnimationFrame(()=>{M.current(Ne)}))},[n,m==null?void 0:m.assetId]),s.useEffect(()=>{if(k!=="open")return;let Ne=null;const be=()=>{Ne&&(document.removeEventListener("click",Ne,!0),Ne=null)},He=()=>{be(),Ne=pt=>{pt.stopPropagation(),pt.preventDefault(),be()},document.addEventListener("click",Ne,!0)},Xe=pt=>{const It=pt<0?1:-1;if(Math.abs(pt)>Yy&&t.length>1){J(It,!0);return}J(It,!1)},ct=pt=>{if(pt.touches.length!==1||w.current)return;const It=pt.touches[0];$.current=!0,X.current={x:It.clientX,y:It.clientY},O.current="none",H.current=0,C.current=!1},rt=pt=>{if(!X.current||pt.touches.length!==1||w.current)return;const It=pt.touches[0],nt=It.clientX-X.current.x,bt=It.clientY-X.current.y;if(O.current==="none"){if(Math.abs(nt)<10&&Math.abs(bt)<10)return;if(Math.abs(nt)>Math.abs(bt)){if(t.length<=1)return;O.current="horizontal"}else if(bt>0)O.current="vertical";else return}if(O.current==="horizontal"){C.current=!0,ie(!0),H.current=nt;const Lt=nt<0?1:-1;T.current!==Lt&&(T.current=Lt,se(Lt)),R.current=nt,xe(nt),pt.preventDefault();return}O.current==="vertical"&&(C.current=!0,ie(!0),B.current=bt,ue(bt),pt.preventDefault())},xt=()=>{if(!X.current)return;const pt=O.current,It=C.current;if(It&&pt==="horizontal")Xe(H.current),He();else if(It&&pt==="vertical")if(B.current>qy){const bt=window.innerHeight;B.current=bt,ve(!0),ue(bt),ce("closing")}else B.current=0,ue(0),He();else pt==="horizontal"&&Math.abs(H.current)>0&&(Xe(H.current),He());X.current=null,O.current="none",H.current=0,C.current=!1,ie(!1)};return document.addEventListener("touchstart",ct,{passive:!0}),document.addEventListener("touchmove",rt,{passive:!1}),document.addEventListener("touchend",xt),document.addEventListener("touchcancel",xt),()=>{document.removeEventListener("touchstart",ct),document.removeEventListener("touchmove",rt),document.removeEventListener("touchend",xt),document.removeEventListener("touchcancel",xt),be()}},[k,t.length,J]),s.useEffect(()=>{const Ne=be=>{be.key==="Escape"&&(be.preventDefault(),be.stopPropagation(),k!=="closing"&&ce("closing"))};return window.addEventListener("keydown",Ne,!0),()=>window.removeEventListener("keydown",Ne,!0)},[k]);const j=()=>{k!=="closing"&&ce("closing")},Te=k==="open",Fe=k==="closing",Ye=I>0?Math.max(0,1-I/500):1,De=I>0?Math.max(.35,1-I/500):1,ze=f?v?f:nv(f,Ee):null,Ze=Ne=>{if(Ne.stopPropagation(),$.current){$.current=!1;return}if(t.length<=1)return;const be=ze??Ne.currentTarget.getBoundingClientRect(),He=Ne.clientY-be.top,Xe=Math.min(52,be.height*.2);if(!(He>be.height-Xe)){if(Ne.clientX-be.left<be.width/2){W(-1);return}W(1)}},Ue=Ne=>{if(t.length<=1)return;const be=ze??Ne.currentTarget.getBoundingClientRect(),He=Ne.clientX-be.left,Xe=Ne.clientY-be.top,ct=Math.min(52,be.height*.2);if(Xe>be.height-ct){Ne.currentTarget.style.cursor="default";return}Ne.currentTarget.style.cursor=He<be.width/2?"w-resize":"e-resize"},ye={position:"fixed",top:G==null?void 0:G.top,left:G==null?void 0:G.left,width:G==null?void 0:G.width,height:G==null?void 0:G.height,zIndex:9998},_e=v?"cover":"contain",Ve=ee!==0||I>0?`translate(${ee}px, ${I}px)`:void 0,Je=pe&&!de?"none":de?`transform ${Fn}ms ${hi}`:me?`transform ${Fn}ms ${hi}, opacity ${Fn}ms ${hi}`:k==="opening"||Fe?`opacity ${Fn}ms ${hi}`:"none",et={...ye,transform:Ve,opacity:I>0?De:k==="opening"||Fe?0:1,transition:Je,pointerEvents:"none"},ot={position:"absolute",top:((ze==null?void 0:ze.top)??0)-((G==null?void 0:G.top)??0),left:((ze==null?void 0:ze.left)??0)-((G==null?void 0:G.left)??0),width:ze==null?void 0:ze.width,height:ze==null?void 0:ze.height,objectFit:_e,pointerEvents:Y&&Te&&!te?"auto":"none",touchAction:Y&&Te?"none":void 0},lt=(G==null?void 0:G.width)??0,Ke=oe?(n+Le+t.length)%t.length:null,ht=Ke!==null?t[Ke]:null,tt={...ye,transform:oe?`translateX(${Le*lt+ee}px)`:void 0,opacity:1,transition:de?`transform ${Fn}ms ${hi}`:"none",pointerEvents:"none"},Ge={position:"absolute",top:((f==null?void 0:f.top)??0)-((G==null?void 0:G.top)??0),left:((f==null?void 0:f.left)??0)-((G==null?void 0:G.left)??0),width:f==null?void 0:f.width,height:f==null?void 0:f.height,objectFit:_e,pointerEvents:"none"},We=ze?{position:"fixed",top:ze.top,height:ze.height,width:ze.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:L,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:k==="open"?"none":void 0},onClick:j,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:Te?Ye:0,transition:pe?"none":`opacity ${Fn}ms ${hi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:v?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:P,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:Te?1:0,transition:`opacity ${Fn}ms ${hi}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:p,style:y,children:[n+1," / ",t.length]})})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:P,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:Te?1:0,transition:`opacity ${Fn}ms ${hi}`},children:t.length>1&&a.jsxs("p",{className:p,style:y,children:[n+1," / ",t.length]})})]})}),f&&G&&ht&&a.jsx("div",{style:tt,onTransitionEnd:Se,children:Yi(ht)?a.jsx("video",{src:ht.assetId,muted:!0,playsInline:!0,preload:"auto",style:Ge},`neighbor-${Ke}-${ht.assetId}`):a.jsx("img",{src:ht.assetId,alt:ht.name,style:Ge},`neighbor-${Ke}-${ht.assetId}`)}),f&&G&&m&&a.jsx("div",{style:et,onTransitionEnd:Se,children:Y?a.jsx(iv,{src:m.assetId,phase:k,mediaRef:q,mediaStyle:ot,onLoadedMetadata:fe,onClick:Ze,onMouseMove:Ue},`${n}-${m.assetId}`):a.jsx("img",{ref:q,src:m.assetId,alt:m.name,onLoad:fe,style:ot},`${n}-${m.assetId}`)}),Te&&We&&t.length>1&&!Y&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...We,left:ze.left,cursor:"w-resize",pointerEvents:pe?"none":"auto"},onClick:Ne=>{if($.current){$.current=!1;return}Ne.stopPropagation(),W(-1)}}),a.jsx("div",{style:{...We,left:ze.left+ze.width/2,cursor:"e-resize",pointerEvents:pe?"none":"auto"},onClick:Ne=>{if($.current){$.current=!1;return}Ne.stopPropagation(),W(1)}})]}),a.jsx(av,{prefix:e,closeIcon:x,closeIconMaxWidth:g,closeIconColor:h,closeIconHoverColor:b,iconMarginRight:S,contentMarginTop:_,isEditor:o,isPreviewMode:r,isEditMode:l,visible:Te,onClose:j})]})}function lv(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function cv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:c,portalId:d}){const{prefix:u}=E.useScopedStyles(),{type:p="a",gridLayout:y,textBoxWidth:x=100,verticalGap:g,entriesCount:h,lightbox:b,imageDisplay:S,imageCorners:_,lightboxImageDisplay:v,slider:L,sliderTiming:P,direction:q,transition:X,titleMarginTop:B,subtitleMarginTop:H,titleColor:O,subtitleColor:C,lightboxCounterColor:$,titleFontFamily:Q,titleFontSettings:R,titleFontSize:T,titleLineHeight:w,titleLetterSpacing:V,titleWordSpacing:z,titleTextAppearance:U,subtitleFontFamily:M,subtitleFontSettings:f,subtitleFontSize:K,subtitleLineHeight:G,subtitleLetterSpacing:ge,subtitleWordSpacing:k,subtitleTextAppearance:ce,lightboxCounterFontFamily:I,lightboxCounterFontSettings:ue,lightboxCounterFontSize:ee,lightboxCounterLineHeight:xe,lightboxCounterLetterSpacing:Le,lightboxCounterWordSpacing:se,lightboxCounterTextAppearance:de,closeIcon:Z,closeIconMaxWidth:pe,closeIconColor:ie,closeIconHoverColor:me,iconMarginRight:ve,contentMarginTop:Ee,showText:Re="always",alignEntries:Ce="off",align:$e="top"}=e,m={fontSettings:{fontFamily:Q,fontWeight:(R==null?void 0:R.fontWeight)??400,fontStyle:(R==null?void 0:R.fontStyle)??"normal"},fontSize:T??.01,lineHeight:w,letterSpacing:V??0,wordSpacing:z??0,textAppearance:U,color:O},te={...pn(nn(m,n))},oe={fontSettings:{fontFamily:M,fontWeight:(f==null?void 0:f.fontWeight)??400,fontStyle:(f==null?void 0:f.fontStyle)??"normal"},fontSize:K??.01,lineHeight:G,letterSpacing:ge??0,wordSpacing:k??0,textAppearance:ce,color:C},N={...pn(nn(oe,n))},F={fontSettings:{fontFamily:I,fontWeight:(ue==null?void 0:ue.fontWeight)??400,fontStyle:(ue==null?void 0:ue.fontStyle)??"normal"},fontSize:ee??.01,lineHeight:xe,letterSpacing:Le??0,wordSpacing:se??0,textAppearance:de,color:$},re={...pn(nn(F,n)),...os(ee,xe,u,n)},J=is(T,w,`${u}-item-title`,`${u}-text-tight-leading`),W=is(K,G,`${u}-item-subtitle`,`${u}-text-tight-leading`),Se=os(T,w,u,n),le=os(K,G,u,n),j=is(ee,xe,`${u}-lightbox-counter`,`${u}-text-tight-leading`),Te=E.buildColorVars(u,{titleColor:O,subtitleColor:C,lightboxCounterColor:$},dv,uv),De=`${l&&l!=="default"?`${u}-state-${l}`:""}${Re==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),ze=h===0?1/0:h,Ze=(t??[]).slice(0,ze),Ue=s.useMemo(()=>b==="on"?Jy(Ze):[],[Ze,b]),ye=y.entryWidth??.2,_e=(S==null?void 0:S.display)==="cover",Ve=(S==null?void 0:S.ratioValue)??"1:1",Je=(S==null?void 0:S.reversed)??!1,[et,ot]=Ve.split(":").map(Number),ht=`${Je?ot:et} / ${Je?et:ot}`,tt=y.columnsCount,Ge=E.scalingValue(ye??0,n),We=Ge,Ne=!_e&&L!=="off",be=Ze.length%tt||tt,He=be<tt&&Ze.length>0,Xe=Ze.length-be,ct=He?Math.floor((tt-be)/2)+1:1,rt=_?E.scalingValue(_,n):void 0,xt={width:We,..._e?{aspectRatio:ht,height:"auto",overflow:"hidden"}:{height:"auto"},...rt?{borderRadius:rt,overflow:"hidden"}:{}},pt=`${u}-item-image-wrapper${Ne?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),It=p==="d"||p==="e"||p==="f",nt=Ce==="on",bt=`calc(${E.scalingValue(ye??0,n)} * (${x} / 100))`,Lt=E.scalingValue(ye*x/100,n),Ut=_e?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...rt?{borderRadius:rt}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...rt?{borderRadius:rt}:{}},[Ft,Me]=s.useState(0),Oe=s.useRef(null),St=X==="fade"||q==="horizontal"?"ltr":q==="vertical"?"ttb":"ltr";s.useEffect(()=>{const yt=Oe.current;if(!yt)return;const ut=new ResizeObserver(it=>{Me(Math.round(it[0].contentRect.width))});return ut.observe(yt),()=>ut.disconnect()},[]);const Mt=(()=>{const yt={...Te},ut=Oe.current?getComputedStyle(Oe.current).getPropertyValue("--cntrl-article-width").trim():"";return ut&&(yt["--cntrl-article-width"]=ut),yt})(),[Qe,kt]=s.useState(!1),[Bt,Wt]=s.useState([]),[At,Ae]=s.useState(0),ft=b==="on"&&(!n||i),gt=(yt,ut)=>{n&&!i||b!=="off"&&(Wt(yt),Ae(ut),kt(!0))};s.useEffect(()=>{if(!Qe||b!=="on"||typeof document>"u")return;const yt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=yt}},[Qe,b]),s.useEffect(()=>{!n||i||kt(!1)},[n,i]);const dt=s.useMemo(()=>jy(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:dt}}),b==="on"&&a.jsx(ev,{mediaList:Ue}),a.jsx("div",{style:Te,children:a.jsx("div",{ref:Oe,className:`${u}-wrapper ${u}-type-${p}${nt?` ${u}-align-entries`:""} ${u}-image-align-${$e} ${De}`.trim(),style:{gridTemplateColumns:`repeat(${tt}, ${Ge})`,rowGap:nt?0:E.scalingValue(g??0,n),columnGap:E.scalingValue(y.horizontalGap??0,n),width:E.scalingValue(y.wrapperWidth??0,n),...nt?{[`--${u}-align-entries-row-gap`]:E.scalingValue(g??0,n)}:{}},children:Ze.map((yt,ut)=>{var vt;const it=Lc(yt.title),Nt=Lc(yt.subtitle),$t=(((vt=yt.link)==null?void 0:vt.length)??0)>0&&b==="off"?yt.link:void 0,Qt=Math.floor(ut/tt)===Math.ceil(Ze.length/tt)-1,Xt=He&&ut>=Xe?`${ct+(ut-Xe)}`:void 0,Dt=It?a.jsxs("div",{className:`${u}-item-text-block`,children:[it&&a.jsx("p",{className:J,style:{width:bt,...te,...Se},children:yt.title}),it&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:E.scalingValue(B??0,n),width:Lt}}),Nt&&a.jsx("p",{className:W,style:{width:bt,...N,...le},children:yt.subtitle}),Nt&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:E.scalingValue(H??0,n),width:Lt}})]}):null,jt=nt?a.jsxs("div",{className:`${u}-item-title-row`,children:[!It&&a.jsx("div",{"data-controls":o&&it?"titleMarginTop":void 0,className:o&&it?`${u}-control`:void 0,style:{height:it?E.scalingValue(B??0,n):0,width:Lt}}),it&&a.jsx("p",{className:J,style:{width:bt,...te,...Se},children:yt.title}),It&&it&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:E.scalingValue(B??0,n),width:Lt}})]}):null,Ot=nt?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!It&&a.jsx("div",{"data-controls":o&&Nt?"subtitleMarginTop":void 0,className:o&&Nt?`${u}-control`:void 0,style:{height:Nt?E.scalingValue(H??0,n):0,width:Lt}}),Nt&&a.jsx("p",{className:W,style:{width:bt,...N,...le},children:yt.subtitle}),It&&Nt&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:E.scalingValue(H??0,n),width:Lt}})]}):null,zt=$t?a.jsxs("a",{href:$t,target:"_blank",className:`${u}-item-text-link`,children:[jt,Ot]}):a.jsxs(a.Fragment,{children:[jt,Ot]}),D=tp(yt.gallery),Ie=D.filter(Ct=>Ct.lightboxMedia).map(Ct=>Ct.lightboxMedia),Be=a.jsx("div",{className:pt,style:xt,children:D.length===0?null:L==="off"?(()=>{const{displayMedia:Ct,lightboxMedia:at}=D[0],Tt=at?Ie.findIndex(Vt=>Vt.assetId===at.assetId):-1;return a.jsx(Pc,{media:Ct,className:`${u}-item-${Yi(Ct)?"video":"image"}`.trim(),style:Ut,onMediaClick:ft&&Tt>=0?()=>gt(Ie,Tt):void 0})})():a.jsxs(a.Fragment,{children:[Ne&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:D.map(({displayMedia:Ct})=>Yi(Ct)?a.jsx("video",{src:Ct.assetId,muted:!0,playsInline:!0},`sizer-${Ct.assetId}`):a.jsx("img",{src:Ct.assetId,alt:""},`sizer-${Ct.assetId}`))}),a.jsx(El,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:P*1e3,width:"100%",height:"100%",speed:Uy,type:X==="fade"?"fade":"loop",rewind:X==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:St},onMoved:Ct=>{q!=="random"||X==="fade"||Xy(Ct)},children:D.map(({displayMedia:Ct,lightboxMedia:at},Tt)=>{const Vt=at?Ie.findIndex(Pt=>Pt.assetId===at.assetId):-1;return a.jsx(kl,{children:a.jsx(Pc,{media:Ct,className:`${u}-item-${Yi(Ct)?"video":"image"}`.trim(),style:Ut,onMediaClick:ft&&Vt>=0?()=>gt(Ie,Vt):void 0})},Tt)})},`${X}-${ye}-${q}-${P}-${Ft}-${c}`)]})}),ke=It?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&it?"titleMarginTop":void 0,className:o&&it?`${u}-control`:void 0,style:{height:it?E.scalingValue(B??0,n):0,width:Lt}}),a.jsx("p",{className:J,style:{width:bt,...te,...Se},children:yt.title}),a.jsx("div",{"data-controls":o&&Nt?"subtitleMarginTop":void 0,className:o&&Nt?`${u}-control`:void 0,style:{height:Nt?E.scalingValue(H??0,n):0,width:Lt}}),a.jsx("p",{className:W,style:{width:bt,...N,...le},children:yt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:Xt&&!nt?{gridColumn:Xt}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${nt&&Qt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(x??0)>100?`calc(${Ge} * (${x} / 100))`:Ge,...Xt&&nt?{gridColumn:Xt}:{}},children:nt?a.jsx(a.Fragment,{children:It?a.jsxs(a.Fragment,{children:[zt,a.jsx("a",{href:$t,target:"_blank",className:`${u}-item-image-link`,children:Be})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:$t,target:"_blank",className:`${u}-item-image-link`,children:Be}),zt]})}):$t?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:$t,target:"_blank",className:`${u}-item-image-link`,children:[Dt,Be]}),!It&&a.jsx("a",{href:$t,target:"_blank",className:`${u}-item-text-link`,children:ke})]}):a.jsxs(a.Fragment,{children:[Dt,Be,ke]})})},ut)})})}),(!n||i)&&Qe&&typeof document<"u"&&b==="on"&&(()=>{const yt=(d?document.getElementById(d):null)??document.body;return qn.createPortal(a.jsx("div",{style:Mt,"data-selection":"none",children:a.jsx(sv,{prefix:u,items:Bt,index:At,imageDisplay:lv(v),isEditor:n,isPreviewMode:i,isEditMode:o,closeIcon:Z,closeIconMaxWidth:pe,closeIconColor:ie,closeIconHoverColor:me,iconMarginRight:ve,contentMarginTop:Ee,onClose:()=>kt(!1),onPrev:()=>Ae(ut=>(ut-1+Bt.length)%Bt.length),onNext:()=>Ae(ut=>(ut+1)%Bt.length),counterClassName:j,counterStyle:re})}),yt)})()]})}const dv={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},uv=["hover","focus","filled","success","error"],pv=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
5284
5284
|
import '@splidejs/react-splide/css/core';
|
|
5285
5285
|
import { CommonComponentProps } from '../props';
|
|
5286
5286
|
import {
|
|
@@ -7868,7 +7868,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
7868
7868
|
pointer-events: auto;
|
|
7869
7869
|
flex-shrink: 0;
|
|
7870
7870
|
}
|
|
7871
|
-
`}const Nc={assetId:"",name:"",objectFit:"cover"},On=500,qo=650,$n="cubic-bezier(0.22, 1, 0.36, 1)",Ev=72,kv=50,Av=1e4,Fv=650,Nv=500;function _v(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,r=e.top-t.top;return`translate(${o}px, ${r}px) scale(${n}, ${i})`}function lp(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=Sa(e);return{left:i.x,top:i.y,width:i.width,height:i.height}}const n=e.getBoundingClientRect();return{left:n.left,top:n.top,width:n.width,height:n.height}}function Hv(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?lp(i,n):null}function Wv(e){return e.reduce((t,n,i)=>{const o=Hl(n.gallery),l=Wl(o).filter(c=>c.lightboxMedia).map(c=>c.lightboxMedia);return l.length===0||t.push({gridIndex:i,items:l,entry:{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}),t},[])}function ir(e,t,n){var o;if(e.length<=1)return null;const i=(t+n+e.length)%e.length;return((o=e[i])==null?void 0:o.items[0])??null}function _c(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return ir(e,i,n)}const Ov=.03;function cp(e){return e.width*Ov}const ss={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Br(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Hc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Dv(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Gs(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,c=o/r;if(l>c){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const d=r*l;return{width:d,height:r,left:i.left+(o-d)/2,top:i.top}}function zv(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Gs(e,t.width,t.height)}function Bv(e,t){if(jo(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.assetId,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.assetId,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.assetId,n.naturalWidth,n.naturalHeight)},n.src=e.assetId}function jv(e){const t=new Set,n=[];for(const i of e){const o=Hl(i.gallery),r=Wl(o);for(const l of r)for(const c of[l.displayMedia,l.lightboxMedia])c!=null&&c.assetId&&!t.has(c.assetId)&&(t.add(c.assetId),n.push(c))}return n}function Vv({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>jo(t)?a.jsx("video",{src:t.assetId,preload:"auto",muted:!0,playsInline:!0},t.assetId):a.jsx("img",{src:t.assetId,alt:""},t.assetId))})}function Ro(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:c}=n,d=cp(n);return t==="left"?{left:l+d-i,top:r,width:i,height:o}:{left:l+c-d,top:r,width:i,height:o}}function wa(e,t,n){const i=Ro(e,t,n);return{...i,left:2*i.left-e.left}}function Gv(e,t,n){const{left:i,width:o}=n,r=cp(n);return t==="left"?{left:i,top:e.top,width:r,height:e.height}:{left:i+o-r,top:e.top,width:r,height:e.height}}function dp(e,t,n,i){const o=Ro(e,"left",i),r=Ro(e,"right",i),l=wa(e,"left",i),c=wa(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:r,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:c,end:r};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:r};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:r,end:c};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function Xv(e,t,n,i){const{start:o,end:r}=dp(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function Uv(e,t,n){const i=Ro(e,t,n),o=wa(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function up(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function Hl(e){if(!e)return;if(up(e))return e;if(!Array.isArray(e))return;const[t,n]=e,i=t!=null&&t.assetId?t:void 0,o=n!=null&&n.assetId?n:void 0;if(!(!i&&!o))return[{media:[o??i??Nc,i??o??Nc]}]}function qv(e){const[t,n]=e.media;return n!=null&&n.assetId?n:t!=null&&t.assetId?t:null}function Yv(e){const[t]=e.media;return t!=null&&t.assetId?t:null}function Wl(e){if(!Array.isArray(e)||e.length===0)return[];if(up(e)){const t=[];for(const n of e){const i=qv(n);if(!i)continue;const o=Yv(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.assetId?o:null})}return t}return e.filter(t=>t==null?void 0:t.assetId).map(t=>({displayMedia:t,lightboxMedia:t}))}function jo(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.assetId)}function Kv({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return jo(e)?a.jsx("video",{src:e.assetId,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onClick:o}):a.jsx("img",{src:e.assetId,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function Qv({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const c=s.useRef(null);return s.useEffect(()=>{const d=c.current;return n==null||n(d??null),()=>{d==null||d.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:c,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:d=>d.stopPropagation(),style:o},e)})}function jr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return jo(e)?a.jsx("video",{src:e.assetId,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.assetId,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.assetId,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.assetId,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function Zv({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,canNavigate:d,lightboxEntries:u,entryIdx:p,layoutId:y,sourceRect:x,resolveCloseSourceRect:g,onClose:h,onPrev:b,onNext:S}){const _=s.useRef(null),v=s.useRef(null),L=s.useRef(null),P=s.useRef(new Map),[q,X]=s.useState(0),B=s.useRef(null),H=s.useRef(0),O=s.useRef(0),C=s.useRef("none"),$=s.useRef(!1),Q=s.useRef(!1),R=s.useRef(!1),T=s.useRef(null),w=s.useRef(null),V=s.useRef(null),z=s.useRef(()=>{}),U=s.useRef(null),M=s.useRef(null),f=s.useRef(null),K=s.useRef(!1),[G,ge]=s.useState(null),[k,ce]=s.useState(ss),[I,ue]=s.useState(0),[ee,xe]=s.useState("opening"),[Le,se]=s.useState(0),[de,Z]=s.useState(0),[pe,ie]=s.useState(!1),[me,ve]=s.useState(null),[Ee,Re]=s.useState(null),[Ce,$e]=s.useState(null),[m,Y]=s.useState(!1),[te,oe]=s.useState(null),[fe,N]=s.useState(!1),F=s.useRef(!1),[ne,re]=s.useState(!1),[J,W]=s.useState(!1),Se=s.useRef(n),le=s.useRef(void 0),j=t[n],Te=j?jo(j):!1,Fe=de!==0||pe,Ye=!l&&(!r||!!c),De=d&&!l,ze=u.length>1,Ze=s.useCallback((D,Ie)=>t.length<=1?null:t[(D+Ie+t.length)%t.length]??null,[t]),Ue=ze?ir(u,p,-1):Ze(n,-1),ye=ze?ir(u,p,1):Ze(n,1),_e=me===-1&&Fe?ze&&Ee!==null?ir(u,Ee,-1):Ce!==null?Ze(Ce,-1):null:null,Ve=me===1&&Fe?ze&&Ee!==null?ir(u,Ee,1):Ce!==null?Ze(Ce,1):null:null,Je=_e&&_e.assetId!==(Ue==null?void 0:Ue.assetId)?_e:null,et=Ve&&Ve.assetId!==(ye==null?void 0:ye.assetId)?Ve:null,ot=Ue&&De?(()=>{const D=ze?_c(u,p,-1):t.length>2?Ze((n-1+t.length)%t.length,-1):null;return D&&D.assetId!==Ue.assetId?D:null})():null,lt=ye&&De?(()=>{const D=ze?_c(u,p,1):t.length>2?Ze((n+1)%t.length,1):null;return D&&D.assetId!==ye.assetId?D:null})():null,Ke=Je??ot,ht=et??lt,tt=s.useCallback((D,Ie,Be)=>{if(!D||!Ie||!Be)return;const ke=P.current,vt=ke.get(D);(vt==null?void 0:vt.width)===Ie&&(vt==null?void 0:vt.height)===Be||(ke.set(D,{width:Ie,height:Be}),X(Ct=>Ct+1))},[]),Ge=s.useCallback(D=>{if(!(D!=null&&D.assetId))return null;const Ie=P.current.get(D.assetId);return zv(v.current,Ie)},[q,I]),We=s.useCallback(()=>{if(!j)return;const D=Ge(j);if(D){ge(D);return}const Ie=v.current;Ie&&ge(Hc(Ie))},[j,Ge]),Ne=s.useCallback(D=>{if(ze){const Ie=u.length;Re((p+D+Ie)%Ie),$e(null);return}t.length>1&&($e((n+D+t.length)%t.length),Re(null))},[ze,u.length,p,t.length,n]),be=s.useCallback(D=>{R.current=D,ie(D)},[]),He=s.useCallback(()=>{T.current!==null&&(window.clearTimeout(T.current),T.current=null)},[]),Xe=s.useCallback(()=>{He(),T.current=window.setTimeout(()=>{He(),be(!1)},qo+32)},[He,be]),ct=s.useCallback(()=>{const D=_.current;if(!D){ce({left:0,top:0,width:typeof window<"u"?window.innerWidth:ss.width,height:typeof window<"u"?window.innerHeight:ss.height});return}const Ie=D.getBoundingClientRect();ce({left:Ie.left,top:Ie.top,width:Ie.width,height:Ie.height})},[]),rt=s.useCallback((D,Ie)=>{if(Fe){if(ne&&!pe)return`translate(${de}px, 0px)`;if(pe&&me!==null){const Be=Ge(D);if(!Be)return;const{x:ke,y:vt}=Xv(Be,Ie,me,k);return`translate(${ke}px, ${vt}px)`}if(pe)return"translate(0px, 0px)"}},[Fe,ne,pe,de,me,k,Ge]),xt=s.useCallback(()=>{const D=w.current;w.current=null,He(),be(!1),ve(null),Re(null),$e(null),Z(0),re(!1),$.current=!1,O.current=0,C.current="none",D===-1?b():D===1&&S()},[He,be,b,S]),pt=s.useCallback(()=>{He(),T.current=window.setTimeout(()=>{w.current!==null&&xt()},qo+32)},[He,xt]),It=s.useCallback(()=>{He(),w.current=null,be(!1),ve(null),Re(null),$e(null),Z(0),re(!1),$.current=!1,O.current=0,C.current="none"},[He,be]),nt=s.useCallback(D=>{if(!(!De||!G)){if(R.current){if(w.current===D){V.current=D,xt();return}It()}He(),Ne(D),w.current=D,ve(D),be(!0),pt()}},[De,G,xt,It,He,Ne,be,pt]);z.current=nt;const bt=s.useCallback(()=>{U.current=null,K.current=!1,M.current!==null&&(window.clearInterval(M.current),M.current=null),f.current!==null&&(window.clearTimeout(f.current),f.current=null)},[]),Lt=s.useCallback(D=>{M.current!==null&&window.clearInterval(M.current);const Ie=K.current?Nv:Fv;M.current=window.setInterval(()=>{z.current(D)},Ie)},[]),Ut=s.useCallback(D=>{U.current!==D&&(bt(),U.current=D,K.current=!1,z.current(D),Lt(D),f.current=window.setTimeout(()=>{f.current=null,U.current===D&&(K.current=!0,Lt(D))},Av))},[bt,Lt]),Ft=s.useCallback(()=>{const D=v.current;if(!D)return;const Ie=j==null?void 0:j.assetId,Be=Ie?P.current.get(Ie):void 0;if(Be!=null&&Be.width&&(Be!=null&&Be.height)){ge(Gs(D,Be.width,Be.height));return}const ke=L.current;if(ke&&Ie&&(ke.src===Ie||ke.currentSrc===Ie)){const{width:Ct,height:at}=Dv(ke);if(Ct&&at){tt(Ie,Ct,at),ge(Gs(D,Ct,at));return}}const vt=Hc(D);!vt.width||!vt.height||ge(vt)},[j==null?void 0:j.assetId,tt]),Me=s.useCallback(D=>{if(L.current=D,!!D){if(D instanceof HTMLVideoElement){D.readyState>=1&&D.videoWidth>0&&Ft();return}D.complete&&D.naturalWidth>0&&Ft()}},[Ft]),Oe=s.useCallback(()=>{ct(),Ft(),ue(D=>D+1)},[ct,Ft]);s.useEffect(()=>{Oe();const D=v.current,Ie=_.current,Be=new ResizeObserver(()=>Oe());return D&&Be.observe(D),Ie&&Be.observe(Ie),window.addEventListener("resize",Oe),()=>{Be.disconnect(),window.removeEventListener("resize",Oe)}},[Oe,n,y]),s.useLayoutEffect(()=>{if(!j)return;const D=L.current;if(D){if(D instanceof HTMLImageElement&&D.complete&&D.naturalWidth>0){Ft();return}D instanceof HTMLVideoElement&&D.readyState>=1&&D.videoWidth>0&&Ft()}},[j==null?void 0:j.assetId,n,Ft]),s.useEffect(()=>{We()},[We,q]),s.useEffect(()=>{const D=new Set,Ie=[],Be=ke=>{!(ke!=null&&ke.assetId)||D.has(ke.assetId)||(D.add(ke.assetId),Ie.push(ke))};t.forEach(Be),u.forEach(ke=>ke.items.forEach(Be)),Ie.forEach(ke=>{P.current.has(ke.assetId)||Bv(ke,tt)})},[t,u,tt]),s.useEffect(()=>{if(ee!=="opening"||!G)return;if(!x){xe("open");return}Y(!1);const D=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Y(!0),xe("open")})});return()=>cancelAnimationFrame(D)},[ee,G,x]),s.useEffect(()=>{if(ee!=="closing")return;const D=setTimeout(()=>h(),On);return()=>clearTimeout(D)},[ee,h]),s.useEffect(()=>()=>{He()},[He]),s.useLayoutEffect(()=>{Se.current===n&&le.current===(j==null?void 0:j.assetId)||(He(),w.current=null,ve(null),Re(null),$e(null),se(0),Z(0),be(!1),W(!1),re(!1),H.current=0,O.current=0,C.current="none",$.current=!1,B.current=null,Q.current=!1,L.current=null,We(),Se.current=n,le.current=j==null?void 0:j.assetId)},[n,j==null?void 0:j.assetId,be,He,We]),s.useLayoutEffect(()=>{const D=V.current;D!==null&&(V.current=null,requestAnimationFrame(()=>{z.current(D)}))},[n,p,j==null?void 0:j.assetId]),s.useLayoutEffect(()=>{if(ee==="opening"){F.current=!1,N(!1);return}if(ee!=="open"||F.current)return;if(!Ue&&!ye){F.current=!0;return}N(!1);const D=requestAnimationFrame(()=>{requestAnimationFrame(()=>{N(!0),F.current=!0})});return()=>cancelAnimationFrame(D)},[ee,Ue==null?void 0:Ue.assetId,ye==null?void 0:ye.assetId]),s.useEffect(()=>{if(ee!=="open")return;const D=()=>{const at=Tt=>{Tt.stopPropagation(),Tt.preventDefault(),document.removeEventListener("click",at,!0)};document.addEventListener("click",at,!0)},Ie=at=>{const Tt=at<0?1:-1;He(),Ne(Tt),w.current=Tt,ve(Tt),be(!0),pt()},Be=at=>{if(Math.abs(at)>kv&&De){Ie(at);return}w.current=null,ve(null),Re(null),$e(null),be(!0),Z(0),Xe()},ke=at=>{if(at.touches.length!==1||R.current)return;const Tt=at.touches[0];Q.current=!0,B.current={x:Tt.clientX,y:Tt.clientY},C.current="none",O.current=0,$.current=!1},vt=at=>{if(!B.current||at.touches.length!==1||R.current)return;const Tt=at.touches[0],Vt=Tt.clientX-B.current.x,Pt=Tt.clientY-B.current.y;if(C.current==="none"){if(Math.abs(Vt)<10&&Math.abs(Pt)<10)return;if(Math.abs(Vt)>Math.abs(Pt)){if(!De)return;C.current="horizontal"}else if(Pt>0){if(!Ye)return;C.current="vertical"}else return}if(C.current==="horizontal"){$.current=!0,re(!0),O.current=Vt,Z(Vt),at.preventDefault();return}C.current==="vertical"&&($.current=!0,re(!0),H.current=Pt,se(Pt),at.preventDefault())},Ct=()=>{if(!B.current)return;const at=C.current,Tt=$.current;if(Tt&&at==="horizontal")Be(O.current),D();else if(Tt&&at==="vertical"){const Vt=H.current;if(Ye&&Vt>Ev){const Pt=window.innerHeight;H.current=Pt,W(!0),se(Pt),xe("closing")}else H.current=0,se(0);D()}else at==="horizontal"&&Math.abs(O.current)>0&&(Be(O.current),D());B.current=null,C.current="none",O.current=0,$.current=!1,re(!1)};return document.addEventListener("touchstart",ke,{passive:!0}),document.addEventListener("touchmove",vt,{passive:!1}),document.addEventListener("touchend",Ct),document.addEventListener("touchcancel",Ct),()=>{document.removeEventListener("touchstart",ke),document.removeEventListener("touchmove",vt),document.removeEventListener("touchend",Ct),document.removeEventListener("touchcancel",Ct)}},[ee,De,be,Xe,He,Ye,pt,Ne]);const St=s.useCallback(()=>{const D=(g==null?void 0:g())??x??null;D&&G&&(oe(D),Y(!0)),xe("closing")},[g,x,G]);s.useEffect(()=>{const D=ke=>{if(ke.key==="Escape"){if(r&&c||ee==="closing")return;bt(),St();return}if(ke.key!=="ArrowLeft"&&ke.key!=="ArrowRight"||ee!=="open"||!De)return;ke.preventDefault();const vt=ke.key==="ArrowLeft"?-1:1;ke.repeat&&U.current===vt||Ut(vt)},Ie=ke=>{if(ke.key!=="ArrowLeft"&&ke.key!=="ArrowRight")return;const vt=ke.key==="ArrowLeft"?-1:1;U.current===vt&&bt()},Be=()=>{bt()};return window.addEventListener("keydown",D),window.addEventListener("keyup",Ie),window.addEventListener("blur",Be),()=>{window.removeEventListener("keydown",D),window.removeEventListener("keyup",Ie),window.removeEventListener("blur",Be),bt()}},[ee,r,c,St,De,Ut,bt]),s.useEffect(()=>{ee!=="open"&&bt()},[ee,bt]);const Mt=()=>{ee==="closing"||l||St()},Qe=ee==="open",kt=ee==="closing",Bt=Le>0?Math.max(0,1-Le/500):1,Wt=Le>0?Math.max(.35,1-Le/500):1,At=s.useCallback(D=>{if(!(D.propertyName!=="transform"||!R.current)){if(w.current!==null){xt();return}He(),be(!1)}},[He,be,xt]),Ae=ee==="closing"?te??x:x,ft=Ae&&G&&(ee==="opening"||kt)?_v(Ae,G):void 0,gt=Fe&&j?rt(j,"center"):Le>0?`translateY(${Le}px)`:ft,dt=G?Br(G,k):null,yt=!!(Ae&&G),ut=yt&&(ee==="closing"||ee==="open"&&m),it={position:"absolute",top:dt==null?void 0:dt.top,left:dt==null?void 0:dt.left,width:dt==null?void 0:dt.width,height:dt==null?void 0:dt.height,objectFit:"contain",transformOrigin:"top left",transform:gt,opacity:Le>0?Wt:yt?1:ee==="opening"||kt?0:1,transition:ne&&!pe?"none":pe?`transform ${qo}ms ${$n}`:J?`transform ${On}ms ${$n}, opacity ${On}ms ${$n}`:ut?`transform ${On}ms ${$n}`:ee==="opening"||kt?`opacity ${On}ms ${$n}`:"none",pointerEvents:Te&&Qe&&!Fe?"auto":"none",touchAction:Te&&Qe?"none":void 0,zIndex:1,overflow:Te?"hidden":void 0},Nt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Qe&&!Fe?"auto":"none"},$t=(D,Ie,Be="adjacent")=>{const ke=Ge(D);if(!ke)return{display:"none"};const vt=Be==="far"?Ie==="left"?"far-left":"far-right":Ie==="left"?"left-adjacent":"right-adjacent",{start:Ct}=me!==null?dp(ke,vt,me,k):{start:Be==="far"?wa(ke,Ie,k):Ro(ke,Ie,k)},at=Br(Ct,k),Tt=rt(D,vt),Vt=!Fe&&Be==="adjacent"&&Qe&&!fe?Uv(ke,Ie,k):null,Pt=Be==="far"&&Fe&&me===(Ie==="left"?-1:1),Zt=ne&&!pe?!1:pe,on=Be==="adjacent"&&Qe&&fe&&!Fe;return{position:"absolute",top:at.top,left:at.left,width:at.width,height:at.height,objectFit:"contain",transform:Tt??(Vt?`translate(${Vt.x}px, ${Vt.y}px)`:void 0),opacity:Be==="far"?Qe&&Pt?1:0:Qe?1:0,transition:Zt?Be==="far"?`transform ${qo}ms ${$n}`:`transform ${qo}ms ${$n}, opacity ${On}ms ${$n}`:on?`transform ${On}ms ${$n}`:ee==="opening"||kt?`opacity ${On}ms ${$n}`:"none",pointerEvents:"none",zIndex:1}},Qt=(D,Ie)=>{const Be=Ge(D);return Be?Gv(Ro(Be,Ie,k),Ie,k):null},Xt=D=>Ie=>{if(!l){if(Q.current){Q.current=!1;return}Ie.stopPropagation(),nt(D)}},Ot=Ue?Qt(Ue,"left"):null,jt=ye?Qt(ye,"right"):null,Dt=Ot?Br(Ot,k):null,zt=jt?Br(jt,k):null;return a.jsxs("div",{ref:_,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:ee==="open"?"none":void 0},onClick:Mt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Qe?Bt:0,transition:ne?"none":`opacity ${On}ms ${$n}`,pointerEvents:"none"}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[a.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:v,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Qe?1:0,transition:ne?"none":`opacity ${On}ms ${$n}`,pointerEvents:"none"},children:a.jsx(sp,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,onClose:Mt})})]}),Qe&&Ke&&a.jsx(jr,{media:Ke,style:$t(Ke,"left","far"),onMeasure:tt,onTransitionEnd:At},`far-prev-${Ke.assetId}`),Qe&&Ue&&a.jsxs(a.Fragment,{children:[a.jsx(jr,{media:Ue,style:$t(Ue,"left"),onMeasure:tt,onTransitionEnd:At},`prev-${Ue.assetId}`),Dt&&a.jsx("div",{style:{position:"absolute",top:Dt.top,left:Dt.left,width:Dt.width,height:Dt.height,cursor:l||ne?"default":"pointer",pointerEvents:l||ne?"none":"auto",zIndex:3},onClick:Xt(-1)})]}),Qe&&ye&&a.jsxs(a.Fragment,{children:[a.jsx(jr,{media:ye,style:$t(ye,"right"),onMeasure:tt,onTransitionEnd:At},`next-${ye.assetId}`),zt&&a.jsx("div",{style:{position:"absolute",top:zt.top,left:zt.left,width:zt.width,height:zt.height,cursor:l||ne?"default":"pointer",pointerEvents:l||ne?"none":"auto",zIndex:3},onClick:Xt(1)})]}),Qe&&ht&&a.jsx(jr,{media:ht,style:$t(ht,"right","far"),onMeasure:tt,onTransitionEnd:At},`far-next-${ht.assetId}`),G&&j&&(Te?a.jsx(Qv,{src:j.assetId,phase:ee,onMediaElement:Me,wrapperStyle:it,videoStyle:Nt,onLoadedMetadata:Ft,onTransitionEnd:At},`${n}-${j.assetId}`):a.jsx("img",{ref:Me,src:j.assetId,alt:j.name,onLoad:Ft,onTransitionEnd:At,style:it},`${n}-${j.assetId}`))]})}function Jv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:c}=E.useScopedStyles(),{gridLayout:d,verticalGap:u,align:p="top",imageDisplay:y}=e,x=(y==null?void 0:y.display)==="cover",g=(y==null?void 0:y.ratioValue)??"1:1",h=(y==null?void 0:y.reversed)??!1,[b,S]=g.split(":").map(Number),L=`${h?S:b} / ${h?b:S}`,P=d.entryWidth??.2,q=d.columnsCount,X=E.scalingValue(P,n),B=E.scalingValue(d.horizontalGap??0,n),H=X,O=X,C={width:H,...x?{aspectRatio:L,height:"auto",overflow:"hidden"}:{height:"auto"}},$=x?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},Q=s.useRef(null),[R,T]=s.useState(!1),[w,V]=s.useState([]),[z,U]=s.useState(0),[M,f]=s.useState(0),[K,G]=s.useState(null),[ge,k]=s.useState({title1:"",title2:"",title3:""}),ce=(()=>{const Ce={},$e=Q.current?getComputedStyle(Q.current).getPropertyValue("--cntrl-article-width").trim():"";return $e&&(Ce["--cntrl-article-width"]=$e),Ce})(),I=!n||i||o,ue=s.useMemo(()=>Rv(c),[c]),ee=t??[],xe=ee.length%q||q,Le=xe<q&&ee.length>0,se=ee.length-xe,de=Le?Math.floor((q-xe)/2)+1:1,Z=s.useMemo(()=>Wv(ee),[ee]),pe=s.useMemo(()=>jv(ee),[ee]),ie=(Ce,$e,m)=>{if(n&&!o&&!i)return;const Y=Z.findIndex(oe=>oe.gridIndex===Ce);if(Y<0)return;const te=Z[Y];f(Y),V(te.items),U($e),k(te.entry),G(m??null),T(!0)},me=s.useCallback(()=>{T(!1),G(null)},[]),ve=s.useCallback(()=>{const Ce=Z[M];return!Ce||!Q.current?K:Hv(Q.current,Ce.gridIndex,x?"cover":"contain")??K},[Z,M,K,x]),Ee=s.useCallback(Ce=>{if(Z.length>1){const $e=Z.length,m=(M+Ce+$e)%$e,Y=Z[m],te=Math.min(z,Y.items.length-1);f(m),V(Y.items),U(te),k(Y.entry);return}U($e=>($e+Ce+w.length)%w.length)},[Z,M,z,w.length]),Re=Z.length>1||w.length>1;return s.useEffect(()=>{if(!R||typeof document>"u")return;const Ce=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Ce}},[R]),s.useEffect(()=>{!n||o||i||T(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ue}}),a.jsx(Vv,{mediaList:pe}),a.jsx("div",{ref:Q,className:`${c}-wrapper ${c}-align-entries ${c}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${q}, ${X})`,rowGap:0,columnGap:B,width:E.scalingValue(d.wrapperWidth??0,n),[`--${c}-align-entries-row-gap`]:E.scalingValue(u??0,n)},children:ee.map((Ce,$e)=>{const m=Hl(Ce.gallery),Y=Wl(m),te=Y.filter(re=>re.lightboxMedia).map(re=>re.lightboxMedia),oe=Math.floor($e/q)===Math.ceil(ee.length/q)-1,fe=Le&&$e>=se?`${de+($e-se)}`:void 0,N=Y[0],F=N!=null&&N.lightboxMedia?te.findIndex(re=>re.assetId===N.lightboxMedia.assetId):-1,ne=a.jsx("div",{className:`${c}-item-image-wrapper`,style:C,children:Y.length>0&&a.jsx(Kv,{media:N.displayMedia,gridIndex:$e,className:`${c}-item-${jo(N.displayMedia)?"video":"image"}`.trim(),style:$,onMediaClick:I&&F>=0?re=>ie($e,F,lp(re.currentTarget,x?"cover":"contain")):void 0})});return a.jsx("div",{className:`${c}-item`,children:a.jsxs("div",{className:[o?`${c}-item-inner`:`${c}-item-inner-hidden`,oe?`${c}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:X,...fe?{gridColumn:fe}:{}},children:[a.jsx("div",{className:`${c}-item-title-row`,children:a.jsx("div",{style:{height:0,width:O}})}),a.jsx("a",{className:`${c}-item-image-link`,children:ne}),a.jsx("div",{className:`${c}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:O}})})]})},$e)})}),R&&typeof document<"u"&&(()=>{const Ce=(l?document.getElementById(l):null)??document.body;return qn.createPortal(a.jsx("div",{style:ce,"data-selection":"none",children:a.jsx(Zv,{prefix:c,items:w,index:z,entry:ge,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:Re,lightboxEntries:Z,entryIdx:M,layoutId:r,sourceRect:K,resolveCloseSourceRect:ve,onClose:me,onPrev:()=>Ee(-1),onNext:()=>Ee(1)})}),Ce)})()]})}const e0=`import { CommonComponentProps } from '../props';
|
|
7871
|
+
`}const Nc={assetId:"",name:"",objectFit:"cover"},On=500,qo=650,$n="cubic-bezier(0.22, 1, 0.36, 1)",Ev=72,kv=50,Av=1e4,Fv=650,Nv=500;function _v(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,r=e.top-t.top;return`translate(${o}px, ${r}px) scale(${n}, ${i})`}function lp(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=Sa(e);return{left:i.x,top:i.y,width:i.width,height:i.height}}const n=e.getBoundingClientRect();return{left:n.left,top:n.top,width:n.width,height:n.height}}function Hv(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?lp(i,n):null}function Wv(e){return e.reduce((t,n,i)=>{const o=Hl(n.gallery),l=Wl(o).filter(c=>c.lightboxMedia).map(c=>c.lightboxMedia);return l.length===0||t.push({gridIndex:i,items:l,entry:{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}),t},[])}function ir(e,t,n){var o;if(e.length<=1)return null;const i=(t+n+e.length)%e.length;return((o=e[i])==null?void 0:o.items[0])??null}function _c(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return ir(e,i,n)}const Ov=.03;function cp(e){return e.width*Ov}const ss={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Br(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Hc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Dv(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Gs(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,c=o/r;if(l>c){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const d=r*l;return{width:d,height:r,left:i.left+(o-d)/2,top:i.top}}function zv(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Gs(e,t.width,t.height)}function Bv(e,t){if(jo(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.assetId,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.assetId,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.assetId,n.naturalWidth,n.naturalHeight)},n.src=e.assetId}function jv(e){const t=new Set,n=[];for(const i of e){const o=Hl(i.gallery),r=Wl(o);for(const l of r)for(const c of[l.displayMedia,l.lightboxMedia])c!=null&&c.assetId&&!t.has(c.assetId)&&(t.add(c.assetId),n.push(c))}return n}function Vv({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>jo(t)?a.jsx("video",{src:t.assetId,preload:"auto",muted:!0,playsInline:!0},t.assetId):a.jsx("img",{src:t.assetId,alt:""},t.assetId))})}function Ro(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:c}=n,d=cp(n);return t==="left"?{left:l+d-i,top:r,width:i,height:o}:{left:l+c-d,top:r,width:i,height:o}}function wa(e,t,n){const i=Ro(e,t,n);return{...i,left:2*i.left-e.left}}function Gv(e,t,n){const{left:i,width:o}=n,r=cp(n);return t==="left"?{left:i,top:e.top,width:r,height:e.height}:{left:i+o-r,top:e.top,width:r,height:e.height}}function dp(e,t,n,i){const o=Ro(e,"left",i),r=Ro(e,"right",i),l=wa(e,"left",i),c=wa(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:r,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:c,end:r};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:r};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:r,end:c};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function Xv(e,t,n,i){const{start:o,end:r}=dp(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function Uv(e,t,n){const i=Ro(e,t,n),o=wa(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function up(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function Hl(e){if(!e)return;if(up(e))return e;if(!Array.isArray(e))return;const[t,n]=e,i=t!=null&&t.assetId?t:void 0,o=n!=null&&n.assetId?n:void 0;if(!(!i&&!o))return[{media:[o??i??Nc,i??o??Nc]}]}function qv(e){const[t,n]=e.media;return n!=null&&n.assetId?n:t!=null&&t.assetId?t:null}function Yv(e){const[t]=e.media;return t!=null&&t.assetId?t:null}function Wl(e){if(!Array.isArray(e)||e.length===0)return[];if(up(e)){const t=[];for(const n of e){const i=qv(n);if(!i)continue;const o=Yv(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.assetId?o:null})}return t}return e.filter(t=>t==null?void 0:t.assetId).map(t=>({displayMedia:t,lightboxMedia:t}))}function jo(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.assetId)}function Kv({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return jo(e)?a.jsx("video",{src:e.assetId,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onClick:o}):a.jsx("img",{src:e.assetId,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function Qv({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const c=s.useRef(null);return s.useEffect(()=>{const d=c.current;return n==null||n(d??null),()=>{d==null||d.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:c,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:d=>d.stopPropagation(),style:o},e)})}function jr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return jo(e)?a.jsx("video",{src:e.assetId,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.assetId,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.assetId,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.assetId,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function Zv({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,canNavigate:d,lightboxEntries:u,entryIdx:p,layoutId:y,sourceRect:x,resolveCloseSourceRect:g,onClose:h,onPrev:b,onNext:S}){const _=s.useRef(null),v=s.useRef(null),L=s.useRef(null),P=s.useRef(new Map),[q,X]=s.useState(0),B=s.useRef(null),H=s.useRef(0),O=s.useRef(0),C=s.useRef("none"),$=s.useRef(!1),Q=s.useRef(!1),R=s.useRef(!1),T=s.useRef(null),w=s.useRef(null),V=s.useRef(null),z=s.useRef(()=>{}),U=s.useRef(null),M=s.useRef(null),f=s.useRef(null),K=s.useRef(!1),[G,ge]=s.useState(null),[k,ce]=s.useState(ss),[I,ue]=s.useState(0),[ee,xe]=s.useState("opening"),[Le,se]=s.useState(0),[de,Z]=s.useState(0),[pe,ie]=s.useState(!1),[me,ve]=s.useState(null),[Ee,Re]=s.useState(null),[Ce,$e]=s.useState(null),[m,Y]=s.useState(!1),[te,oe]=s.useState(null),[fe,N]=s.useState(!1),F=s.useRef(!1),[ne,re]=s.useState(!1),[J,W]=s.useState(!1),Se=s.useRef(n),le=s.useRef(void 0),j=t[n],Te=j?jo(j):!1,Fe=de!==0||pe,Ye=!l&&(!r||!!c),De=d&&!l,ze=u.length>1,Ze=s.useCallback((D,Ie)=>t.length<=1?null:t[(D+Ie+t.length)%t.length]??null,[t]),Ue=ze?ir(u,p,-1):Ze(n,-1),ye=ze?ir(u,p,1):Ze(n,1),_e=me===-1&&Fe?ze&&Ee!==null?ir(u,Ee,-1):Ce!==null?Ze(Ce,-1):null:null,Ve=me===1&&Fe?ze&&Ee!==null?ir(u,Ee,1):Ce!==null?Ze(Ce,1):null:null,Je=_e&&_e.assetId!==(Ue==null?void 0:Ue.assetId)?_e:null,et=Ve&&Ve.assetId!==(ye==null?void 0:ye.assetId)?Ve:null,ot=Ue&&De?(()=>{const D=ze?_c(u,p,-1):t.length>2?Ze((n-1+t.length)%t.length,-1):null;return D&&D.assetId!==Ue.assetId?D:null})():null,lt=ye&&De?(()=>{const D=ze?_c(u,p,1):t.length>2?Ze((n+1)%t.length,1):null;return D&&D.assetId!==ye.assetId?D:null})():null,Ke=Je??ot,ht=et??lt,tt=s.useCallback((D,Ie,Be)=>{if(!D||!Ie||!Be)return;const ke=P.current,vt=ke.get(D);(vt==null?void 0:vt.width)===Ie&&(vt==null?void 0:vt.height)===Be||(ke.set(D,{width:Ie,height:Be}),X(Ct=>Ct+1))},[]),Ge=s.useCallback(D=>{if(!(D!=null&&D.assetId))return null;const Ie=P.current.get(D.assetId);return zv(v.current,Ie)},[q,I]),We=s.useCallback(()=>{if(!j)return;const D=Ge(j);if(D){ge(D);return}const Ie=v.current;Ie&&ge(Hc(Ie))},[j,Ge]),Ne=s.useCallback(D=>{if(ze){const Ie=u.length;Re((p+D+Ie)%Ie),$e(null);return}t.length>1&&($e((n+D+t.length)%t.length),Re(null))},[ze,u.length,p,t.length,n]),be=s.useCallback(D=>{R.current=D,ie(D)},[]),He=s.useCallback(()=>{T.current!==null&&(window.clearTimeout(T.current),T.current=null)},[]),Xe=s.useCallback(()=>{He(),T.current=window.setTimeout(()=>{He(),be(!1)},qo+32)},[He,be]),ct=s.useCallback(()=>{const D=_.current;if(!D){ce({left:0,top:0,width:typeof window<"u"?window.innerWidth:ss.width,height:typeof window<"u"?window.innerHeight:ss.height});return}const Ie=D.getBoundingClientRect();ce({left:Ie.left,top:Ie.top,width:Ie.width,height:Ie.height})},[]),rt=s.useCallback((D,Ie)=>{if(Fe){if(ne&&!pe)return`translate(${de}px, 0px)`;if(pe&&me!==null){const Be=Ge(D);if(!Be)return;const{x:ke,y:vt}=Xv(Be,Ie,me,k);return`translate(${ke}px, ${vt}px)`}if(pe)return"translate(0px, 0px)"}},[Fe,ne,pe,de,me,k,Ge]),xt=s.useCallback(()=>{const D=w.current;w.current=null,He(),be(!1),ve(null),Re(null),$e(null),Z(0),re(!1),$.current=!1,O.current=0,C.current="none",D===-1?b():D===1&&S()},[He,be,b,S]),pt=s.useCallback(()=>{He(),T.current=window.setTimeout(()=>{w.current!==null&&xt()},qo+32)},[He,xt]),It=s.useCallback(()=>{He(),w.current=null,be(!1),ve(null),Re(null),$e(null),Z(0),re(!1),$.current=!1,O.current=0,C.current="none"},[He,be]),nt=s.useCallback(D=>{if(!(!De||!G)){if(R.current){if(w.current===D){V.current=D,xt();return}It()}He(),Ne(D),w.current=D,ve(D),be(!0),pt()}},[De,G,xt,It,He,Ne,be,pt]);z.current=nt;const bt=s.useCallback(()=>{U.current=null,K.current=!1,M.current!==null&&(window.clearInterval(M.current),M.current=null),f.current!==null&&(window.clearTimeout(f.current),f.current=null)},[]),Lt=s.useCallback(D=>{M.current!==null&&window.clearInterval(M.current);const Ie=K.current?Nv:Fv;M.current=window.setInterval(()=>{z.current(D)},Ie)},[]),Ut=s.useCallback(D=>{U.current!==D&&(bt(),U.current=D,K.current=!1,z.current(D),Lt(D),f.current=window.setTimeout(()=>{f.current=null,U.current===D&&(K.current=!0,Lt(D))},Av))},[bt,Lt]),Ft=s.useCallback(()=>{const D=v.current;if(!D)return;const Ie=j==null?void 0:j.assetId,Be=Ie?P.current.get(Ie):void 0;if(Be!=null&&Be.width&&(Be!=null&&Be.height)){ge(Gs(D,Be.width,Be.height));return}const ke=L.current;if(ke&&Ie&&(ke.src===Ie||ke.currentSrc===Ie)){const{width:Ct,height:at}=Dv(ke);if(Ct&&at){tt(Ie,Ct,at),ge(Gs(D,Ct,at));return}}const vt=Hc(D);!vt.width||!vt.height||ge(vt)},[j==null?void 0:j.assetId,tt]),Me=s.useCallback(D=>{if(L.current=D,!!D){if(D instanceof HTMLVideoElement){D.readyState>=1&&D.videoWidth>0&&Ft();return}D.complete&&D.naturalWidth>0&&Ft()}},[Ft]),Oe=s.useCallback(()=>{ct(),Ft(),ue(D=>D+1)},[ct,Ft]);s.useEffect(()=>{Oe();const D=v.current,Ie=_.current,Be=new ResizeObserver(()=>Oe());return D&&Be.observe(D),Ie&&Be.observe(Ie),window.addEventListener("resize",Oe),()=>{Be.disconnect(),window.removeEventListener("resize",Oe)}},[Oe,n,y]),s.useLayoutEffect(()=>{if(!j)return;const D=L.current;if(D){if(D instanceof HTMLImageElement&&D.complete&&D.naturalWidth>0){Ft();return}D instanceof HTMLVideoElement&&D.readyState>=1&&D.videoWidth>0&&Ft()}},[j==null?void 0:j.assetId,n,Ft]),s.useEffect(()=>{We()},[We,q]),s.useEffect(()=>{const D=new Set,Ie=[],Be=ke=>{!(ke!=null&&ke.assetId)||D.has(ke.assetId)||(D.add(ke.assetId),Ie.push(ke))};t.forEach(Be),u.forEach(ke=>ke.items.forEach(Be)),Ie.forEach(ke=>{P.current.has(ke.assetId)||Bv(ke,tt)})},[t,u,tt]),s.useEffect(()=>{if(ee!=="opening"||!G)return;if(!x){xe("open");return}Y(!1);const D=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Y(!0),xe("open")})});return()=>cancelAnimationFrame(D)},[ee,G,x]),s.useEffect(()=>{if(ee!=="closing")return;const D=setTimeout(()=>h(),On);return()=>clearTimeout(D)},[ee,h]),s.useEffect(()=>()=>{He()},[He]),s.useLayoutEffect(()=>{Se.current===n&&le.current===(j==null?void 0:j.assetId)||(He(),w.current=null,ve(null),Re(null),$e(null),se(0),Z(0),be(!1),W(!1),re(!1),H.current=0,O.current=0,C.current="none",$.current=!1,B.current=null,Q.current=!1,L.current=null,We(),Se.current=n,le.current=j==null?void 0:j.assetId)},[n,j==null?void 0:j.assetId,be,He,We]),s.useLayoutEffect(()=>{const D=V.current;D!==null&&(V.current=null,requestAnimationFrame(()=>{z.current(D)}))},[n,p,j==null?void 0:j.assetId]),s.useLayoutEffect(()=>{if(ee==="opening"){F.current=!1,N(!1);return}if(ee!=="open"||F.current)return;if(!Ue&&!ye){F.current=!0;return}N(!1);const D=requestAnimationFrame(()=>{requestAnimationFrame(()=>{N(!0),F.current=!0})});return()=>cancelAnimationFrame(D)},[ee,Ue==null?void 0:Ue.assetId,ye==null?void 0:ye.assetId]),s.useEffect(()=>{if(ee!=="open")return;const D=()=>{const at=Tt=>{Tt.stopPropagation(),Tt.preventDefault(),document.removeEventListener("click",at,!0)};document.addEventListener("click",at,!0)},Ie=at=>{const Tt=at<0?1:-1;He(),Ne(Tt),w.current=Tt,ve(Tt),be(!0),pt()},Be=at=>{if(Math.abs(at)>kv&&De){Ie(at);return}w.current=null,ve(null),Re(null),$e(null),be(!0),Z(0),Xe()},ke=at=>{if(at.touches.length!==1||R.current)return;const Tt=at.touches[0];Q.current=!0,B.current={x:Tt.clientX,y:Tt.clientY},C.current="none",O.current=0,$.current=!1},vt=at=>{if(!B.current||at.touches.length!==1||R.current)return;const Tt=at.touches[0],Vt=Tt.clientX-B.current.x,Pt=Tt.clientY-B.current.y;if(C.current==="none"){if(Math.abs(Vt)<10&&Math.abs(Pt)<10)return;if(Math.abs(Vt)>Math.abs(Pt)){if(!De)return;C.current="horizontal"}else if(Pt>0){if(!Ye)return;C.current="vertical"}else return}if(C.current==="horizontal"){$.current=!0,re(!0),O.current=Vt,Z(Vt),at.preventDefault();return}C.current==="vertical"&&($.current=!0,re(!0),H.current=Pt,se(Pt),at.preventDefault())},Ct=()=>{if(!B.current)return;const at=C.current,Tt=$.current;if(Tt&&at==="horizontal")Be(O.current),D();else if(Tt&&at==="vertical"){const Vt=H.current;if(Ye&&Vt>Ev){const Pt=window.innerHeight;H.current=Pt,W(!0),se(Pt),xe("closing")}else H.current=0,se(0);D()}else at==="horizontal"&&Math.abs(O.current)>0&&(Be(O.current),D());B.current=null,C.current="none",O.current=0,$.current=!1,re(!1)};return document.addEventListener("touchstart",ke,{passive:!0}),document.addEventListener("touchmove",vt,{passive:!1}),document.addEventListener("touchend",Ct),document.addEventListener("touchcancel",Ct),()=>{document.removeEventListener("touchstart",ke),document.removeEventListener("touchmove",vt),document.removeEventListener("touchend",Ct),document.removeEventListener("touchcancel",Ct)}},[ee,De,be,Xe,He,Ye,pt,Ne]);const St=s.useCallback(()=>{const D=(g==null?void 0:g())??x??null;D&&G&&(oe(D),Y(!0)),xe("closing")},[g,x,G]);s.useEffect(()=>{const D=ke=>{if(ke.key==="Escape"){if(r&&c||ee==="closing")return;bt(),St();return}if(ke.key!=="ArrowLeft"&&ke.key!=="ArrowRight"||ee!=="open"||!De)return;ke.preventDefault();const vt=ke.key==="ArrowLeft"?-1:1;ke.repeat&&U.current===vt||Ut(vt)},Ie=ke=>{if(ke.key!=="ArrowLeft"&&ke.key!=="ArrowRight")return;const vt=ke.key==="ArrowLeft"?-1:1;U.current===vt&&bt()},Be=()=>{bt()};return window.addEventListener("keydown",D),window.addEventListener("keyup",Ie),window.addEventListener("blur",Be),()=>{window.removeEventListener("keydown",D),window.removeEventListener("keyup",Ie),window.removeEventListener("blur",Be),bt()}},[ee,r,c,St,De,Ut,bt]),s.useEffect(()=>{ee!=="open"&&bt()},[ee,bt]);const Mt=()=>{ee==="closing"||l||St()},Qe=ee==="open",kt=ee==="closing",Bt=Le>0?Math.max(0,1-Le/500):1,Wt=Le>0?Math.max(.35,1-Le/500):1,At=s.useCallback(D=>{if(!(D.propertyName!=="transform"||!R.current)){if(w.current!==null){xt();return}He(),be(!1)}},[He,be,xt]),Ae=ee==="closing"?te??x:x,ft=Ae&&G&&(ee==="opening"||kt)?_v(Ae,G):void 0,gt=Fe&&j?rt(j,"center"):Le>0?`translateY(${Le}px)`:ft,dt=G?Br(G,k):null,yt=!!(Ae&&G),ut=yt&&(ee==="closing"||ee==="open"&&m),it={position:"absolute",top:dt==null?void 0:dt.top,left:dt==null?void 0:dt.left,width:dt==null?void 0:dt.width,height:dt==null?void 0:dt.height,objectFit:"contain",transformOrigin:"top left",transform:gt,opacity:Le>0?Wt:yt?1:ee==="opening"||kt?0:1,transition:ne&&!pe?"none":pe?`transform ${qo}ms ${$n}`:J?`transform ${On}ms ${$n}, opacity ${On}ms ${$n}`:ut?`transform ${On}ms ${$n}`:ee==="opening"||kt?`opacity ${On}ms ${$n}`:"none",pointerEvents:Te&&Qe&&!Fe?"auto":"none",touchAction:Te&&Qe?"none":void 0,zIndex:1,overflow:Te?"hidden":void 0},Nt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Qe&&!Fe?"auto":"none"},$t=(D,Ie,Be="adjacent")=>{const ke=Ge(D);if(!ke)return{display:"none"};const vt=Be==="far"?Ie==="left"?"far-left":"far-right":Ie==="left"?"left-adjacent":"right-adjacent",{start:Ct}=me!==null?dp(ke,vt,me,k):{start:Be==="far"?wa(ke,Ie,k):Ro(ke,Ie,k)},at=Br(Ct,k),Tt=rt(D,vt),Vt=!Fe&&Be==="adjacent"&&Qe&&!fe?Uv(ke,Ie,k):null,Pt=Be==="far"&&Fe&&me===(Ie==="left"?-1:1),Zt=ne&&!pe?!1:pe,on=Be==="adjacent"&&Qe&&fe&&!Fe;return{position:"absolute",top:at.top,left:at.left,width:at.width,height:at.height,objectFit:"contain",transform:Tt??(Vt?`translate(${Vt.x}px, ${Vt.y}px)`:void 0),opacity:Be==="far"?Qe&&Pt?1:0:Qe?1:0,transition:Zt?Be==="far"?`transform ${qo}ms ${$n}`:`transform ${qo}ms ${$n}, opacity ${On}ms ${$n}`:on?`transform ${On}ms ${$n}`:ee==="opening"||kt?`opacity ${On}ms ${$n}`:"none",pointerEvents:"none",zIndex:1}},Qt=(D,Ie)=>{const Be=Ge(D);return Be?Gv(Ro(Be,Ie,k),Ie,k):null},Xt=D=>Ie=>{if(!l){if(Q.current){Q.current=!1;return}Ie.stopPropagation(),nt(D)}},Dt=Ue?Qt(Ue,"left"):null,jt=ye?Qt(ye,"right"):null,Ot=Dt?Br(Dt,k):null,zt=jt?Br(jt,k):null;return a.jsxs("div",{ref:_,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:ee==="open"?"none":void 0},onClick:Mt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Qe?Bt:0,transition:ne?"none":`opacity ${On}ms ${$n}`,pointerEvents:"none"}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[a.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:v,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Qe?1:0,transition:ne?"none":`opacity ${On}ms ${$n}`,pointerEvents:"none"},children:a.jsx(sp,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,onClose:Mt})})]}),Qe&&Ke&&a.jsx(jr,{media:Ke,style:$t(Ke,"left","far"),onMeasure:tt,onTransitionEnd:At},`far-prev-${Ke.assetId}`),Qe&&Ue&&a.jsxs(a.Fragment,{children:[a.jsx(jr,{media:Ue,style:$t(Ue,"left"),onMeasure:tt,onTransitionEnd:At},`prev-${Ue.assetId}`),Ot&&a.jsx("div",{style:{position:"absolute",top:Ot.top,left:Ot.left,width:Ot.width,height:Ot.height,cursor:l||ne?"default":"pointer",pointerEvents:l||ne?"none":"auto",zIndex:3},onClick:Xt(-1)})]}),Qe&&ye&&a.jsxs(a.Fragment,{children:[a.jsx(jr,{media:ye,style:$t(ye,"right"),onMeasure:tt,onTransitionEnd:At},`next-${ye.assetId}`),zt&&a.jsx("div",{style:{position:"absolute",top:zt.top,left:zt.left,width:zt.width,height:zt.height,cursor:l||ne?"default":"pointer",pointerEvents:l||ne?"none":"auto",zIndex:3},onClick:Xt(1)})]}),Qe&&ht&&a.jsx(jr,{media:ht,style:$t(ht,"right","far"),onMeasure:tt,onTransitionEnd:At},`far-next-${ht.assetId}`),G&&j&&(Te?a.jsx(Qv,{src:j.assetId,phase:ee,onMediaElement:Me,wrapperStyle:it,videoStyle:Nt,onLoadedMetadata:Ft,onTransitionEnd:At},`${n}-${j.assetId}`):a.jsx("img",{ref:Me,src:j.assetId,alt:j.name,onLoad:Ft,onTransitionEnd:At,style:it},`${n}-${j.assetId}`))]})}function Jv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:c}=E.useScopedStyles(),{gridLayout:d,verticalGap:u,align:p="top",imageDisplay:y}=e,x=(y==null?void 0:y.display)==="cover",g=(y==null?void 0:y.ratioValue)??"1:1",h=(y==null?void 0:y.reversed)??!1,[b,S]=g.split(":").map(Number),L=`${h?S:b} / ${h?b:S}`,P=d.entryWidth??.2,q=d.columnsCount,X=E.scalingValue(P,n),B=E.scalingValue(d.horizontalGap??0,n),H=X,O=X,C={width:H,...x?{aspectRatio:L,height:"auto",overflow:"hidden"}:{height:"auto"}},$=x?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},Q=s.useRef(null),[R,T]=s.useState(!1),[w,V]=s.useState([]),[z,U]=s.useState(0),[M,f]=s.useState(0),[K,G]=s.useState(null),[ge,k]=s.useState({title1:"",title2:"",title3:""}),ce=(()=>{const Ce={},$e=Q.current?getComputedStyle(Q.current).getPropertyValue("--cntrl-article-width").trim():"";return $e&&(Ce["--cntrl-article-width"]=$e),Ce})(),I=!n||i||o,ue=s.useMemo(()=>Rv(c),[c]),ee=t??[],xe=ee.length%q||q,Le=xe<q&&ee.length>0,se=ee.length-xe,de=Le?Math.floor((q-xe)/2)+1:1,Z=s.useMemo(()=>Wv(ee),[ee]),pe=s.useMemo(()=>jv(ee),[ee]),ie=(Ce,$e,m)=>{if(n&&!o&&!i)return;const Y=Z.findIndex(oe=>oe.gridIndex===Ce);if(Y<0)return;const te=Z[Y];f(Y),V(te.items),U($e),k(te.entry),G(m??null),T(!0)},me=s.useCallback(()=>{T(!1),G(null)},[]),ve=s.useCallback(()=>{const Ce=Z[M];return!Ce||!Q.current?K:Hv(Q.current,Ce.gridIndex,x?"cover":"contain")??K},[Z,M,K,x]),Ee=s.useCallback(Ce=>{if(Z.length>1){const $e=Z.length,m=(M+Ce+$e)%$e,Y=Z[m],te=Math.min(z,Y.items.length-1);f(m),V(Y.items),U(te),k(Y.entry);return}U($e=>($e+Ce+w.length)%w.length)},[Z,M,z,w.length]),Re=Z.length>1||w.length>1;return s.useEffect(()=>{if(!R||typeof document>"u")return;const Ce=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Ce}},[R]),s.useEffect(()=>{!n||o||i||T(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ue}}),a.jsx(Vv,{mediaList:pe}),a.jsx("div",{ref:Q,className:`${c}-wrapper ${c}-align-entries ${c}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${q}, ${X})`,rowGap:0,columnGap:B,width:E.scalingValue(d.wrapperWidth??0,n),[`--${c}-align-entries-row-gap`]:E.scalingValue(u??0,n)},children:ee.map((Ce,$e)=>{const m=Hl(Ce.gallery),Y=Wl(m),te=Y.filter(re=>re.lightboxMedia).map(re=>re.lightboxMedia),oe=Math.floor($e/q)===Math.ceil(ee.length/q)-1,fe=Le&&$e>=se?`${de+($e-se)}`:void 0,N=Y[0],F=N!=null&&N.lightboxMedia?te.findIndex(re=>re.assetId===N.lightboxMedia.assetId):-1,ne=a.jsx("div",{className:`${c}-item-image-wrapper`,style:C,children:Y.length>0&&a.jsx(Kv,{media:N.displayMedia,gridIndex:$e,className:`${c}-item-${jo(N.displayMedia)?"video":"image"}`.trim(),style:$,onMediaClick:I&&F>=0?re=>ie($e,F,lp(re.currentTarget,x?"cover":"contain")):void 0})});return a.jsx("div",{className:`${c}-item`,children:a.jsxs("div",{className:[o?`${c}-item-inner`:`${c}-item-inner-hidden`,oe?`${c}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:X,...fe?{gridColumn:fe}:{}},children:[a.jsx("div",{className:`${c}-item-title-row`,children:a.jsx("div",{style:{height:0,width:O}})}),a.jsx("a",{className:`${c}-item-image-link`,children:ne}),a.jsx("div",{className:`${c}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:O}})})]})},$e)})}),R&&typeof document<"u"&&(()=>{const Ce=(l?document.getElementById(l):null)??document.body;return qn.createPortal(a.jsx("div",{style:ce,"data-selection":"none",children:a.jsx(Zv,{prefix:c,items:w,index:z,entry:ge,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:Re,lightboxEntries:Z,entryIdx:M,layoutId:r,sourceRect:K,resolveCloseSourceRect:ve,onClose:me,onPrev:()=>Ee(-1),onNext:()=>Ee(1)})}),Ce)})()]})}const e0=`import { CommonComponentProps } from '../props';
|
|
7872
7872
|
import { scalingValue, useScopedStyles } from '../utils/index';
|
|
7873
7873
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
7874
7874
|
import { createPortal } from 'react-dom';
|
|
@@ -10587,7 +10587,7 @@ a.${e}-list-item {
|
|
|
10587
10587
|
overflow-wrap: anywhere;
|
|
10588
10588
|
word-break: break-word;
|
|
10589
10589
|
}
|
|
10590
|
-
`}const Ei=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Ol=["AColumn","BColumn","CColumn","DColumn","EColumn"],si="cutLabel",xr=[...Ol,si],Ba=["A","B","C","D","E"];function pp(e){return`${e}ColumnVerticalAlign`}const Xs=["Top","Center","Bottom"];function Dl(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Ba.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function x0(e){const t=Dl(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function b0(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Ba.includes(n)?n:null}function gp(e,t,n){const i=b0(e);return i?i===t?!1:x0(n[pp(i)]):!0}function br(e){const t=Dl(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Ba.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function S0(e,t,n){if(mp(e,t,n))return br(e);const i=br(e);return i.kind==="baseline"?{kind:"top"}:i}function w0(e){const t=br(e);return t.kind==="baseline"?{kind:"top"}:t}function mp(e,t,n){return gp(e,n,t)?br(e).kind==="baseline":!1}function $0(e){const t={};let n=!1;for(const i of Ba){const o=pp(i),r=e[o];if(e.type==="b"){const l=String(r??"Top").trim();l!=="Top"&&l!=="Center"&&l!=="Bottom"&&(t[o]="Top",n=!0);continue}gp(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function C0(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function T0(e){const t=br(e).kind;return t==="baseline"?"center":t}function I0(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function jc(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function L0(e,t){const n=document.createElement("i");n.className=t,n.setAttribute("aria-hidden","true"),e.prepend(n);const{top:i}=e.getBoundingClientRect(),{bottom:o}=n.getBoundingClientRect(),r=o-i;return n.remove(),r}function us(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=L0(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const c=r.getBoundingClientRect(),d=o.getBoundingClientRect().height;let u=0;return e.kind==="center"?u=(c.height-d)/2:e.kind==="bottom"&&(u=c.height-d),c.top-t+u+l}function P0(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const r=o.querySelector(`.${n}`);r&&(r.style.minHeight=`${i}px`,r.style.height=`${i}px`)}),i)}function M0(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const R0={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Kt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const E0={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function k0(e){return[Kt(e,"textFontFamily"),Kt(e,"textFontSettings"),{type:"row",items:[Kt(e,"textFontSize"),Kt(e,"textLineHeight"),Kt(e,"textLetterSpacing"),Kt(e,"textWordSpacing")]},Kt(e,"textTextAlign"),Kt(e,"textTextAppearance"),`${e}VerticalAlign`]}function A0(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(xr.map(e=>[E0[e],k0(e)]))}}function $a(e,t){const n=i=>{const o=Kt(t,i);return e[o]};return{textFontFamily:n("textFontFamily")??"Arial",textFontSettings:n("textFontSettings")??{fontWeight:400,fontStyle:"normal"},textFontSize:n("textFontSize"),textLineHeight:n("textLineHeight"),textLetterSpacing:n("textLetterSpacing")??0,textWordSpacing:n("textWordSpacing")??0,textTextAlign:n("textTextAlign")??(t===si?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Vc(e,t){var i,o;const n={fontSettings:{fontFamily:e.textFontFamily,fontWeight:((i=e.textFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e.textFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:e.textFontSize??.01,lineHeight:e.textLineHeight,letterSpacing:e.textLetterSpacing,wordSpacing:e.textWordSpacing,textAlign:e.textTextAlign,textAppearance:e.textTextAppearance,color:e.textColor??"#767676"};return pn(nn(n,t))}function Gc(e,t,n,i){const o=$a(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function Xc(e,t,n,i){const o=$a(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:E.scalingValue((r-l)/2,i)}}const Rn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],ko=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Ao=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Fo=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],F0={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},N0=["hover","focus","filled","success","error"],Uc=.004,go=.004,ps=go,zl=50,Sr=1440,wr=zl/Sr;function hp(e){const t=typeof e=="number"&&e>0?e:Sr;return zl/t}function _0(e){let t=e??null;for(;t;){const n=t.style.getPropertyValue("--cntrl-article-width").trim();if(n){const o=parseFloat(n);if(Number.isFinite(o)&&o>0)return o}const i=getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim();if(i){const o=parseFloat(i);if(Number.isFinite(o)&&o>0)return o}t=t.parentElement}return Sr}const fp={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function lr(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function H0(e,t=1){const n=t/e;return Object.fromEntries(Rn.map(i=>[i,n]))}function W0(){return Object.fromEntries([...ko.map(e=>[e,0]),...Ao.map(e=>[e,0])])}function O0(){return Object.fromEntries(Fo.map(e=>[e,0]))}function Vr(e){return Object.fromEntries(Rn.map(t=>[t,typeof e[t]=="number"?e[t]:fp[t]]))}function yp(e,t,n){const i=e-wr,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const r=i/o;return{paddingLeft:t*r,paddingRight:n*r}}function ga(e,t,n){const i=Bl(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((r,l)=>r+l,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function D0(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=ko[o],l=Ao[o],c=typeof n[r]=="number"?n[r]:0,d=typeof n[l]=="number"?n[l]:0,u=yp(t[o]??0,c,d);u.paddingLeft!==c&&(i[r]=u.paddingLeft),u.paddingRight!==d&&(i[l]=u.paddingRight)}return i}function Bl(e,t,n){if(e<=0)return[];const i=Rn.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),l=o.reduce((u,p)=>u+p,0)+wr;if(t>=l)return i;const c=[...o];let d=l-t;for(let u=c.length-1;u>=0&&d>0;u-=1){const p=c[u]-wr;if(p<=0)continue;const y=Math.min(d,p);c[u]-=y,d-=y}return[...c,i[e-1]]}function z0(e,t,n){if(e<=1)return{};const i=Bl(e,t,n),o={};for(let r=0;r<e-1;r+=1){const l=Rn[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function qc(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Ei]}function B0(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function j0(e,t,n,i){const o=Math.min(i,e.length,Rn.length),r={};for(let l=0;l<o;l+=1){const c=e[l],d=t.indexOf(c);if(d===-1)continue;const u=Rn[d],p=ko[d],y=Ao[d],x=Fo[d],g=Rn[l],h=ko[l],b=Ao[l],S=Fo[l],_=n[u],v=n[p],L=n[y],P=n[x];typeof _=="number"&&(r[g]=_),typeof v=="number"&&(r[h]=v),typeof L=="number"&&(r[b]=L),typeof P=="number"&&(r[S]=P)}return r}function vp(e,t){const n=new Set([...Object.keys(e),...Object.keys(t)]);for(const i of n)if(e[i]!==t[i])return!0;return!1}function V0(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=lr(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...H0(n,o),...W0()};if(r)for(const c of Fo)typeof t[c]=="number"&&(l[c]=t[c]);else Object.assign(l,O0());return vp(e,l)?l:e}function G0(e,t,n){const i=$0(e);i&&(e={...e,...i});const o=hp(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,c=lr(e),d=lr(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:Ei.length,y=L=>{if(u)return L;const P=Vr({...t,...L}),q=lr(L),X=ga(p,q,P),B=D0(p,X,{...t,...L});return Object.keys(B).length===0?L:{...L,...B}};if(typeof r=="number"&&r!==l)return e;const x=qc(e),g=qc(t);if(!B0(x,g))return y({...e,...j0(x,g,t,p)});if(c<d&&typeof p=="number"&&!u){const L=Vr({...t,...e});return y({...e,...z0(p,c,L)})}if(u){const L=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,P=Math.max(0,(c-o)/2);return L>P?{...e,textPaddingLR:P}:e}const h=Vr({...t,...e}),b=ga(p,d,Vr(t)),_=ga(p,c,h).some((L,P)=>L<(b[P]??L)),v=Rn.some(L=>{const P=e[L],q=t[L];return typeof P=="number"&&typeof q=="number"&&P!==q});return _||v?y(e):e}function X0(e,t,n,i){const o=t.slice(0,e).reduce((l,c)=>l+c,0),r=n.slice(e+1,t.length-1).reduce((l,c)=>l+c,0);return Math.max(wr,i-o-r-wr)}function U0(e,t){return Math.random()*(t-e)+e}function q0(e){return Object.fromEntries(Rn.map(t=>[t,typeof e[t]=="number"?e[t]:fp[t]]))}function gs(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function Y0(e,t,n,i,o,r){return e.slice(0,t).map((l,c)=>{const d=ko[c],u=Ao[c],p=Fo[c];return{key:l,textPrefix:R0[l],widthKey:Rn[c],width:n[Rn[c]],paddingLeftKey:d,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[d],paddingRight:o[u],paddingBottom:r[p]}})}function K0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,portalId:c,onUpdateSettings:d}){const{prefix:u}=E.useScopedStyles(),p=!!o,{columns:y,type:x,wrapperWidth:g,entriesCount:h,cellMinHeight:b,dividerWidth:S,showVisibility:_,cut:v,showCut:L,cutCellMinHeight:P,cutLabel:q,imageSize:X,imageOnHover:B,imagePosition:H="cursor",imageInterpolation:O="on",entryHoverEffect:C,entryHoverShowOption:$,rowPaddingTop:Q,rowPaddingBottom:R,rowPaddingTopB:T,columnsOrder:w,textPaddingLR:V,textColor:z,backgroundColor:U,dividerColor:M,textHoverColor:f,backgroundHoverColor:K,dividerHoverColor:G}=e,[ge,k]=s.useState(void 0),[ce,I]=s.useState(null),ue=s.useRef(null),ee=B==="on"&&(!n||i),xe=H==="cursor",Le=xe&&O==="on",{anchorRef:se,onShow:de,onCursorMove:Z,exit:pe}=y0(!!(ee&&ce!==null),Le),ie=(v??0)>0,me=x==="b",ve=s.useRef(null),Ee=s.useRef(null),[Re,Ce]=s.useState(null),[$e,m]=s.useState(Sr),Y=hp($e),te=Math.max(0,((g??0)-Y)/2),oe=Math.min(V??0,te),fe=Math.max(oe,go),N=((g??0)+Y)/2;s.useLayoutEffect(()=>{if(!n){m(Sr);return}const Ae=()=>{m(_0(ve.current))};Ae();const ft=ve.current;if(!ft)return;const gt=new ResizeObserver(Ae);gt.observe(ft);let dt=ft;for(;dt&&!dt.style.getPropertyValue("--cntrl-article-width");)dt=dt.parentElement;return dt&>.observe(dt),()=>gt.disconnect()},[n,l]),s.useEffect(()=>{k(void 0)},[v,L,t,h]),s.useEffect(()=>{n&&!i&&k(void 0)},[n,i]);const F=E.buildColorVars(u,{textColor:z,backgroundColor:U,dividerColor:M,textHoverColor:f,backgroundHoverColor:K,dividerHoverColor:G},F0,N0),ne=r&&r!=="default"?`${u}-state-${r}`:"",J=`${!n||i?C==="default"?`${u}-entry-hover-default`:C==="blinds"?`${u}-entry-hover-blinds`:C==="reveal"?`${u}-entry-hover-reveal`:"":""} ${ne}`.trim(),W=C==="reveal"&&(!n||i),Se=(_==null?void 0:_[0])??!1,le=(_==null?void 0:_[1])??!1,j=s.useRef(e),Te=s.useRef(l);s.useEffect(()=>{if(!d||!n){j.current=e,Te.current=l;return}if(Te.current!==l){j.current=e,Te.current=l;return}const Ae=j.current;if(!(Ae!==e))return;if(typeof Ae.columns=="number"&&typeof e.columns=="number"&&Ae.columns!==e.columns){j.current=e;return}const gt=G0(e,Ae,{designWidth:$e});j.current=e,vp(e,gt)&&d(gt)},[e,d,n,l,$e]);const Fe=s.useMemo(()=>q0(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Ye=s.useMemo(()=>gs(e,ko),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),De=s.useMemo(()=>gs(e,Ao),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),ze=s.useMemo(()=>gs(e,Fo),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),Ze=s.useMemo(()=>Array.isArray(w)&&w.length>0?w:[...Ei],[w]),Ue=s.useMemo(()=>Y0(Ze,y,Fe,Ye,De,ze),[Ze,y,Fe,Ye,De,ze]),ye=lr(e),_e=s.useMemo(()=>Rn.slice(0,y).map(Ae=>Fe[Ae]),[y,Fe]),Ve=s.useMemo(()=>Bl(y,ye,Fe),[y,ye,Fe]),Je=s.useMemo(()=>ga(y,ye,Fe),[y,ye,Fe]),et=s.useMemo(()=>Ue.map((Ae,ft)=>yp(Je[ft]??0,Ae.paddingLeft,Ae.paddingRight)),[Ue,Je]),ot=s.useMemo(()=>{const Ae=h===0?1/0:h;return(t??[]).slice(0,Ae).map((gt,dt)=>({id:dt,cells:Object.fromEntries(Ei.map(yt=>[yt,gt[yt]??""])),image:gt.image,link:gt.link}))},[t,h]),lt=ie?ge??v:ot.length,Ke=s.useMemo(()=>ie?ot.slice(0,lt):ot,[ot,ie,lt]),ht=ie&<<ot.length,tt=Ke.length>1||ht,Ge=[Se?`${u}-divider-top`:"",le||tt?`${u}-divider-bottom`:""].filter(Boolean).join(" "),We=!n||i,Ne=()=>{if(!We)return;const Ae=ge??v;if(!L){k(ot.length);return}k(Math.min(Ae+L,ot.length))},be=Ae=>E.scalingValue(Ae,n??!1),He=me?T??0:Q??0,Xe=R??0,ct=b??0,rt=Math.max(Xe,ps),xt=Dc(0,Ke.length,Se,le,ht,S??0,n??!1).borderTopWidth,pt=me?"rowPaddingTopB":"rowPaddingTop",It=Ue[0],nt=Ue[Ue.length-1],bt=et[0],Lt=et[et.length-1],Ut=It&&bt?Math.max(bt.paddingLeft,go):0,Ft=nt&&Lt?Math.max(Lt.paddingRight,go):0,Me=ye,Oe=(Ae,ft)=>f0(H,ve.current,xe?Ae:null,ft),St=(Ae,ft)=>{if(!ee)return;const gt=Ae.image;if(!(gt!=null&>.assetId)){pe(()=>I(null));return}const dt=(X==null?void 0:X.min)??80,yt=(X==null?void 0:X.max)??320,ut=(ce==null?void 0:ce.rowId)===Ae.id,it=ut?ce.widthPx:U0(dt,yt),{x:Nt,y:$t}=Oe(ft,it);if(ut&&xe){Z(Nt,$t);return}I({rowId:Ae.id,assetId:gt.assetId,objectFit:"contain",isVideo:u0(gt),widthPx:it}),ue.current={x:Nt,y:$t}},Mt=Ae=>{if(!ee||!ce||!xe)return;const{x:ft,y:gt}=Oe(Ae,ce.widthPx);Z(ft,gt)},Qe=()=>{ce&&pe(()=>I(null))},kt=Ae=>{W&&Wc(Ae,u),!(!ee||!ce)&&pe(()=>I(null))},Bt=Ae=>{W&&Oc(Ae,u)};s.useLayoutEffect(()=>{if(!ce||!ue.current)return;const{x:Ae,y:ft}=ue.current;ue.current=null,de(Ae,ft)},[ce==null?void 0:ce.rowId,ce==null?void 0:ce.assetId,de]),s.useLayoutEffect(()=>{if(!p||me){Ce(null);return}const Ae=Ee.current,ft=Ae==null?void 0:Ae.parentElement;if(!Ae||!ft){Ce(null);return}const gt=()=>{const yt=Ae.querySelector("[data-list-row]");if(!yt){Ce(null);return}const ut=ft.getBoundingClientRect(),it=yt.getBoundingClientRect();Ce(it.top-ut.top+it.height/2)};gt();const dt=new ResizeObserver(gt);return dt.observe(Ae),dt.observe(ft),()=>dt.disconnect()},[p,me,Ke,He,Xe,ct,t,e,Ue,Je,$e,S,Se,le,ht]);const Wt=s.useMemo(()=>!me&&Ol.some(Ae=>{const ft=Ae.charAt(0),gt=e[`${Ae}VerticalAlign`];return mp(gt,e,ft)}),[me,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var Nt;const Ae=ve.current;if(!Ae)return;const ft=()=>{Ae.querySelectorAll("[data-list-col]").forEach($t=>{$t.style.transform="";const Qt=$t.querySelector(`.${u}-list-col`);Qt&&(Qt.style.minHeight="",Qt.style.height="");const Xt=$t.querySelector(`.${u}-list-col-title`);Xt&&(Xt.style.transform="")})};if(me||!Wt){ft();return}const gt=()=>{const $t=Array.from(Ae.querySelectorAll("[data-list-row]")),Qt=`${u}-list-col`,Xt=`${u}-baseline-probe`;$t.forEach(Ot=>{Ot.querySelectorAll("[data-list-col]").forEach(jt=>{jt.style.transform="";const Dt=jt.querySelector(`.${Qt}`);Dt&&(Dt.style.minHeight="",Dt.style.height="");const zt=jt.querySelector(`.${u}-list-col-title`);zt&&(zt.style.transform="")})}),$t.forEach(Ot=>{const jt=Array.from(Ot.querySelectorAll("[data-list-col]"));P0(Ot,jt,Qt)}),Ae.offsetHeight,$t.forEach(Ot=>{const jt=Array.from(Ot.querySelectorAll("[data-list-col]")),Dt=Ot.getBoundingClientRect().top,zt=new Map,D=jt.map(ke=>{const vt=ke.querySelector(`.${u}-list-col-title`),Ct={el:ke,titleEl:vt,letter:ke.getAttribute("data-col-letter")??"",kind:ke.getAttribute("data-valign")??"top",anchor:ke.getAttribute("data-valign-anchor")};return zt.set(Ct.letter,Ct),Ct}),Ie=new Map,Be=(ke,vt)=>{const Ct=Ie.get(ke.letter);if(Ct!==void 0)return Ct;const at=ke.anchor?zt.get(ke.anchor):void 0;if(ke.kind!=="baseline"||!at||vt.has(ke.letter)){const on=us(ke,Dt,Qt,Xt);return Ie.set(ke.letter,on),on}vt.add(ke.letter);const Tt=Be(at,vt);vt.delete(ke.letter);const Vt=us(ke,Dt,Qt,Xt),Pt=Tt-Vt;M0(ke.titleEl,Pt);const Zt=us(ke,Dt,Qt,Xt);return Ie.set(ke.letter,Zt),Zt};D.forEach(ke=>Be(ke,new Set))})};let dt=null;const yt=()=>{dt===null&&(dt=requestAnimationFrame(()=>{dt=null,gt()}))};gt();const ut=new ResizeObserver(()=>yt());ut.observe(Ae);let it=!1;return typeof document<"u"&&((Nt=document.fonts)!=null&&Nt.ready)&&document.fonts.ready.then(()=>{it||yt()}),()=>{it=!0,dt!==null&&(cancelAnimationFrame(dt),dt=null),ut.disconnect(),ft()}},[Wt,me,e,t,$e,Ke,Je]);const At=s.useMemo(()=>v0(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:At}}),a.jsx("div",{style:F,children:a.jsxs("div",{ref:ve,className:`${u}-wrapper ${J}${Ge?` ${Ge}`:""}${me?` ${u}-type-b`:""}`.trim(),style:{width:E.scalingValue(g??0,n)},onMouseMove:ee?Mt:void 0,onMouseLeave:ee?Qe:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[Ke.map((Ae,ft)=>{var ut;const gt=(((ut=Ae.link)==null?void 0:ut.length)??0)>0,dt=gt&&(!n||i)?"a":"div",yt=Dc(ft,Ke.length,Se,le,ht,S??0,n??!1);return a.jsxs(dt,{ref:ft===0?it=>{Ee.current=it}:void 0,className:`${u}-list-item${gt||$==="always"?` ${u}-list-item-has-link`:""}${ht&&ft===Ke.length-1?` ${u}-list-item-before-cut`:""}`,...gt?{href:Ae.link,target:"_blank"}:{},style:yt,onMouseEnter:it=>{W&&(gt||$==="always")&&Wc(it,u),ee&&St(Ae,it)},onMouseLeave:it=>{W&&(gt||$==="always")&&Oc(it,u)},children:[He>0&&a.jsx("div",{className:`${u}-row-padding-handle`,style:{height:be(He)}}),a.jsxs("div",{className:`${u}-list-cols-row${me?"":` ${u}-list-cols-row-h`}${p&&ft===0&&me?` ${u}-list-cols-row-controls`:""}`,...me?{}:{"data-list-row":""},style:me?void 0:{minHeight:be(ct)},children:[Ue.map((it,Nt)=>{const $t=Nt===Ue.length-1,Qt=et[Nt],Xt=it.paddingBottom,Ot=g0(Ae.cells[it.key]),jt=me&&Ot&&Xt>0,Dt=me?{minHeight:be(ct)}:{width:be(Je[Nt])},zt=me?{paddingLeft:be(oe),paddingRight:be(oe)}:{paddingLeft:be(Qt.paddingLeft),paddingRight:be(Qt.paddingRight)},D=it.textPrefix.charAt(0),Ie=me?w0(e[`${it.textPrefix}VerticalAlign`]):S0(e[`${it.textPrefix}VerticalAlign`],e,D),Be=me&&Ot&&p&&ft===0;return me&&!Ot?null:a.jsxs("div",{className:me?`${u}-list-col-wrap`:void 0,...me?{}:{"data-list-col":"","data-col-letter":D,"data-valign":Ie.kind,...Ie.kind==="baseline"?{"data-valign-anchor":Ie.anchorLetter}:{}},children:[a.jsx("div",{className:`${u}-list-col${$t?` ${u}-list-col-last`:""}`,style:{...zt,...Dt,...me?{justifyContent:jc(Ie.kind)}:{}},"data-test":it.width,children:a.jsx("span",{className:Gc(e,it.textPrefix,`${u}-list-col-title`,`${u}-text-tight-leading`),style:{...Vc($a(e,it.textPrefix),n),...Xc(e,it.textPrefix,u,n),...me?{}:C0(Ie.kind)},children:Ae.cells[it.key]??null})}),jt&&a.jsx("div",{className:`${u}-row-padding-handle`,style:{height:be(Xt)}}),Be&&a.jsx("div",{"data-controls":it.paddingBottomKey,"data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${u}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:be(Math.max(Xt,ps))}})]},it.key)}),p&&ft===0&&me&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(N),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${u}-control-anchor`,style:{top:0,left:0,width:be(fe),height:"100%"}}),a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(N),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${u}-control-anchor`,style:{top:0,left:be(Math.max(fe,ye-fe)),width:be(fe),height:"100%"}})]})]}),!me&&Xe>0&&a.jsx("div",{className:`${u}-row-padding-handle`,style:{height:be(Xe)}}),p&&ft===0&&!me&&a.jsx("div",{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${u}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:be(rt)}})]},Ae.id)}),p&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":pt,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":me?"center":"left-y",className:`${u}-control-anchor`,style:{top:xt,left:0,width:"100%",height:be(Math.max(He,ps))}})},"row-padding-handles"),p&&!me&&It&&nt&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":It.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Je[0]-((bt==null?void 0:bt.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Re??void 0,className:`${u}-control-anchor`,style:{top:0,left:0,width:be(Ut),height:"100%"}}),a.jsx("div",{"data-controls":nt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Je[Ue.length-1]-((Lt==null?void 0:Lt.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Re??void 0,className:`${u}-control-anchor`,style:{top:0,left:be(Me-Ft),width:be(Ft),height:"100%"}})]},"column-edge-padding-handles"),p&&!me&&Ue.slice(0,-1).map((Ae,ft)=>{const gt=Ue[ft+1],dt=Ve.slice(0,ft+1).reduce(($t,Qt)=>$t+Qt,0),yt=et[ft],ut=et[ft+1],it=Math.max(yt.paddingRight,go),Nt=Math.max(ut.paddingLeft,go);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Ae.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Je[ft]-yt.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Re??void 0,className:`${u}-control-anchor`,style:{top:0,left:be(dt-it),width:be(it),height:"100%"}}),a.jsx("div",{"data-controls":gt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Je[ft+1]-ut.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Re??void 0,className:`${u}-control-anchor`,style:{top:0,left:be(dt),width:be(Nt),height:"100%"}})]},`${Ae.paddingRightKey}-padding`)}),p&&!me&&Ue.slice(0,-1).map((Ae,ft)=>{const gt=X0(ft,Ve,_e,ye),yt=Ve.slice(0,ft+1).reduce((ut,it)=>ut+it,0)-Uc/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Ae.widthKey,"data-controls-axis":"x","data-controls-min":String(zl),"data-controls-max-fraction":String(gt),"data-controls-variant":"column-width",className:`${u}-col-resize-handle`,style:{position:"absolute",top:"0px",left:be(yt),width:be(Uc),height:"calc(100%)",pointerEvents:"auto"}})},`${Ae.widthKey}-junction`)})]}),ht&&(()=>{const Ae=$a(e,si),ft=T0(e.cutLabelVerticalAlign),gt=Ae.textTextAlign==="justify"||me;return a.jsx("button",{type:"button",className:`${u}-cut-item`,style:{minHeight:be(P??0),cursor:We?"pointer":"default",...m0(le,S??0,n??!1)},onClick:We?Ne:void 0,onMouseEnter:W||ee?kt:void 0,onMouseLeave:W?Bt:void 0,children:a.jsx("div",{className:`${u}-list-cols-row`,style:{...me?{paddingLeft:be(oe),paddingRight:be(oe)}:{},justifyContent:I0(Ae.textTextAlign),alignItems:jc(ft)},children:a.jsx("span",{className:Gc(e,si,`${u}-cut-label`,`${u}-text-tight-leading`),style:{...Vc(Ae,n),...Xc(e,si,u,n),...gt?{width:"100%"}:{}},children:q})})})})(),ee&&ce&&typeof document<"u"&&(()=>{const Ae=`${ce.widthPx}px`,ft={width:Ae,height:"auto",maxHeight:Ae,objectFit:"contain"},gt=(c?document.getElementById(c):null)??document.body;return qn.createPortal(a.jsx("div",{ref:se,className:`${u}-hover-media-anchor`,"data-selection":"none",children:a.jsx(p0,{media:ce,className:ce.isVideo?`${u}-hover-video`:`${u}-hover-image`,style:ft},`${ce.rowId}-${ce.assetId}`)}),gt)})()]})})]})}const Q0=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
10590
|
+
`}const Ei=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Ol=["AColumn","BColumn","CColumn","DColumn","EColumn"],si="cutLabel",xr=[...Ol,si],Ba=["A","B","C","D","E"];function pp(e){return`${e}ColumnVerticalAlign`}const Xs=["Top","Center","Bottom"];function Dl(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Ba.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function x0(e){const t=Dl(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function b0(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Ba.includes(n)?n:null}function gp(e,t,n){const i=b0(e);return i?i===t?!1:x0(n[pp(i)]):!0}function br(e){const t=Dl(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Ba.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function S0(e,t,n){if(mp(e,t,n))return br(e);const i=br(e);return i.kind==="baseline"?{kind:"top"}:i}function w0(e){const t=br(e);return t.kind==="baseline"?{kind:"top"}:t}function mp(e,t,n){return gp(e,n,t)?br(e).kind==="baseline":!1}function $0(e){const t={};let n=!1;for(const i of Ba){const o=pp(i),r=e[o];if(e.type==="b"){const l=String(r??"Top").trim();l!=="Top"&&l!=="Center"&&l!=="Bottom"&&(t[o]="Top",n=!0);continue}gp(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function C0(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function T0(e){const t=br(e).kind;return t==="baseline"?"center":t}function I0(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function jc(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function L0(e,t){const n=document.createElement("i");n.className=t,n.setAttribute("aria-hidden","true"),e.prepend(n);const{top:i}=e.getBoundingClientRect(),{bottom:o}=n.getBoundingClientRect(),r=o-i;return n.remove(),r}function us(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=L0(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const c=r.getBoundingClientRect(),d=o.getBoundingClientRect().height;let u=0;return e.kind==="center"?u=(c.height-d)/2:e.kind==="bottom"&&(u=c.height-d),c.top-t+u+l}function P0(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const r=o.querySelector(`.${n}`);r&&(r.style.minHeight=`${i}px`,r.style.height=`${i}px`)}),i)}function M0(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const R0={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Kt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const E0={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function k0(e){return[Kt(e,"textFontFamily"),Kt(e,"textFontSettings"),{type:"row",items:[Kt(e,"textFontSize"),Kt(e,"textLineHeight"),Kt(e,"textLetterSpacing"),Kt(e,"textWordSpacing")]},Kt(e,"textTextAlign"),Kt(e,"textTextAppearance"),`${e}VerticalAlign`]}function A0(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(xr.map(e=>[E0[e],k0(e)]))}}function $a(e,t){const n=i=>{const o=Kt(t,i);return e[o]};return{textFontFamily:n("textFontFamily")??"Arial",textFontSettings:n("textFontSettings")??{fontWeight:400,fontStyle:"normal"},textFontSize:n("textFontSize"),textLineHeight:n("textLineHeight"),textLetterSpacing:n("textLetterSpacing")??0,textWordSpacing:n("textWordSpacing")??0,textTextAlign:n("textTextAlign")??(t===si?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Vc(e,t){var i,o;const n={fontSettings:{fontFamily:e.textFontFamily,fontWeight:((i=e.textFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e.textFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:e.textFontSize??.01,lineHeight:e.textLineHeight,letterSpacing:e.textLetterSpacing,wordSpacing:e.textWordSpacing,textAlign:e.textTextAlign,textAppearance:e.textTextAppearance,color:e.textColor??"#767676"};return pn(nn(n,t))}function Gc(e,t,n,i){const o=$a(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function Xc(e,t,n,i){const o=$a(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:E.scalingValue((r-l)/2,i)}}const Rn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],ko=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Ao=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Fo=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],F0={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},N0=["hover","focus","filled","success","error"],Uc=.004,go=.004,ps=go,zl=50,Sr=1440,wr=zl/Sr;function hp(e){const t=typeof e=="number"&&e>0?e:Sr;return zl/t}function _0(e){let t=e??null;for(;t;){const n=t.style.getPropertyValue("--cntrl-article-width").trim();if(n){const o=parseFloat(n);if(Number.isFinite(o)&&o>0)return o}const i=getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim();if(i){const o=parseFloat(i);if(Number.isFinite(o)&&o>0)return o}t=t.parentElement}return Sr}const fp={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function lr(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function H0(e,t=1){const n=t/e;return Object.fromEntries(Rn.map(i=>[i,n]))}function W0(){return Object.fromEntries([...ko.map(e=>[e,0]),...Ao.map(e=>[e,0])])}function O0(){return Object.fromEntries(Fo.map(e=>[e,0]))}function Vr(e){return Object.fromEntries(Rn.map(t=>[t,typeof e[t]=="number"?e[t]:fp[t]]))}function yp(e,t,n){const i=e-wr,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const r=i/o;return{paddingLeft:t*r,paddingRight:n*r}}function ga(e,t,n){const i=Bl(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((r,l)=>r+l,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function D0(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=ko[o],l=Ao[o],c=typeof n[r]=="number"?n[r]:0,d=typeof n[l]=="number"?n[l]:0,u=yp(t[o]??0,c,d);u.paddingLeft!==c&&(i[r]=u.paddingLeft),u.paddingRight!==d&&(i[l]=u.paddingRight)}return i}function Bl(e,t,n){if(e<=0)return[];const i=Rn.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),l=o.reduce((u,p)=>u+p,0)+wr;if(t>=l)return i;const c=[...o];let d=l-t;for(let u=c.length-1;u>=0&&d>0;u-=1){const p=c[u]-wr;if(p<=0)continue;const y=Math.min(d,p);c[u]-=y,d-=y}return[...c,i[e-1]]}function z0(e,t,n){if(e<=1)return{};const i=Bl(e,t,n),o={};for(let r=0;r<e-1;r+=1){const l=Rn[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function qc(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Ei]}function B0(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function j0(e,t,n,i){const o=Math.min(i,e.length,Rn.length),r={};for(let l=0;l<o;l+=1){const c=e[l],d=t.indexOf(c);if(d===-1)continue;const u=Rn[d],p=ko[d],y=Ao[d],x=Fo[d],g=Rn[l],h=ko[l],b=Ao[l],S=Fo[l],_=n[u],v=n[p],L=n[y],P=n[x];typeof _=="number"&&(r[g]=_),typeof v=="number"&&(r[h]=v),typeof L=="number"&&(r[b]=L),typeof P=="number"&&(r[S]=P)}return r}function vp(e,t){const n=new Set([...Object.keys(e),...Object.keys(t)]);for(const i of n)if(e[i]!==t[i])return!0;return!1}function V0(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=lr(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...H0(n,o),...W0()};if(r)for(const c of Fo)typeof t[c]=="number"&&(l[c]=t[c]);else Object.assign(l,O0());return vp(e,l)?l:e}function G0(e,t,n){const i=$0(e);i&&(e={...e,...i});const o=hp(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,c=lr(e),d=lr(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:Ei.length,y=L=>{if(u)return L;const P=Vr({...t,...L}),q=lr(L),X=ga(p,q,P),B=D0(p,X,{...t,...L});return Object.keys(B).length===0?L:{...L,...B}};if(typeof r=="number"&&r!==l)return e;const x=qc(e),g=qc(t);if(!B0(x,g))return y({...e,...j0(x,g,t,p)});if(c<d&&typeof p=="number"&&!u){const L=Vr({...t,...e});return y({...e,...z0(p,c,L)})}if(u){const L=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,P=Math.max(0,(c-o)/2);return L>P?{...e,textPaddingLR:P}:e}const h=Vr({...t,...e}),b=ga(p,d,Vr(t)),_=ga(p,c,h).some((L,P)=>L<(b[P]??L)),v=Rn.some(L=>{const P=e[L],q=t[L];return typeof P=="number"&&typeof q=="number"&&P!==q});return _||v?y(e):e}function X0(e,t,n,i){const o=t.slice(0,e).reduce((l,c)=>l+c,0),r=n.slice(e+1,t.length-1).reduce((l,c)=>l+c,0);return Math.max(wr,i-o-r-wr)}function U0(e,t){return Math.random()*(t-e)+e}function q0(e){return Object.fromEntries(Rn.map(t=>[t,typeof e[t]=="number"?e[t]:fp[t]]))}function gs(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function Y0(e,t,n,i,o,r){return e.slice(0,t).map((l,c)=>{const d=ko[c],u=Ao[c],p=Fo[c];return{key:l,textPrefix:R0[l],widthKey:Rn[c],width:n[Rn[c]],paddingLeftKey:d,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[d],paddingRight:o[u],paddingBottom:r[p]}})}function K0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,portalId:c,onUpdateSettings:d}){const{prefix:u}=E.useScopedStyles(),p=!!o,{columns:y,type:x,wrapperWidth:g,entriesCount:h,cellMinHeight:b,dividerWidth:S,showVisibility:_,cut:v,showCut:L,cutCellMinHeight:P,cutLabel:q,imageSize:X,imageOnHover:B,imagePosition:H="cursor",imageInterpolation:O="on",entryHoverEffect:C,entryHoverShowOption:$,rowPaddingTop:Q,rowPaddingBottom:R,rowPaddingTopB:T,columnsOrder:w,textPaddingLR:V,textColor:z,backgroundColor:U,dividerColor:M,textHoverColor:f,backgroundHoverColor:K,dividerHoverColor:G}=e,[ge,k]=s.useState(void 0),[ce,I]=s.useState(null),ue=s.useRef(null),ee=B==="on"&&(!n||i),xe=H==="cursor",Le=xe&&O==="on",{anchorRef:se,onShow:de,onCursorMove:Z,exit:pe}=y0(!!(ee&&ce!==null),Le),ie=(v??0)>0,me=x==="b",ve=s.useRef(null),Ee=s.useRef(null),[Re,Ce]=s.useState(null),[$e,m]=s.useState(Sr),Y=hp($e),te=Math.max(0,((g??0)-Y)/2),oe=Math.min(V??0,te),fe=Math.max(oe,go),N=((g??0)+Y)/2;s.useLayoutEffect(()=>{if(!n){m(Sr);return}const Ae=()=>{m(_0(ve.current))};Ae();const ft=ve.current;if(!ft)return;const gt=new ResizeObserver(Ae);gt.observe(ft);let dt=ft;for(;dt&&!dt.style.getPropertyValue("--cntrl-article-width");)dt=dt.parentElement;return dt&>.observe(dt),()=>gt.disconnect()},[n,l]),s.useEffect(()=>{k(void 0)},[v,L,t,h]),s.useEffect(()=>{n&&!i&&k(void 0)},[n,i]);const F=E.buildColorVars(u,{textColor:z,backgroundColor:U,dividerColor:M,textHoverColor:f,backgroundHoverColor:K,dividerHoverColor:G},F0,N0),ne=r&&r!=="default"?`${u}-state-${r}`:"",J=`${!n||i?C==="default"?`${u}-entry-hover-default`:C==="blinds"?`${u}-entry-hover-blinds`:C==="reveal"?`${u}-entry-hover-reveal`:"":""} ${ne}`.trim(),W=C==="reveal"&&(!n||i),Se=(_==null?void 0:_[0])??!1,le=(_==null?void 0:_[1])??!1,j=s.useRef(e),Te=s.useRef(l);s.useEffect(()=>{if(!d||!n){j.current=e,Te.current=l;return}if(Te.current!==l){j.current=e,Te.current=l;return}const Ae=j.current;if(!(Ae!==e))return;if(typeof Ae.columns=="number"&&typeof e.columns=="number"&&Ae.columns!==e.columns){j.current=e;return}const gt=G0(e,Ae,{designWidth:$e});j.current=e,vp(e,gt)&&d(gt)},[e,d,n,l,$e]);const Fe=s.useMemo(()=>q0(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Ye=s.useMemo(()=>gs(e,ko),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),De=s.useMemo(()=>gs(e,Ao),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),ze=s.useMemo(()=>gs(e,Fo),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),Ze=s.useMemo(()=>Array.isArray(w)&&w.length>0?w:[...Ei],[w]),Ue=s.useMemo(()=>Y0(Ze,y,Fe,Ye,De,ze),[Ze,y,Fe,Ye,De,ze]),ye=lr(e),_e=s.useMemo(()=>Rn.slice(0,y).map(Ae=>Fe[Ae]),[y,Fe]),Ve=s.useMemo(()=>Bl(y,ye,Fe),[y,ye,Fe]),Je=s.useMemo(()=>ga(y,ye,Fe),[y,ye,Fe]),et=s.useMemo(()=>Ue.map((Ae,ft)=>yp(Je[ft]??0,Ae.paddingLeft,Ae.paddingRight)),[Ue,Je]),ot=s.useMemo(()=>{const Ae=h===0?1/0:h;return(t??[]).slice(0,Ae).map((gt,dt)=>({id:dt,cells:Object.fromEntries(Ei.map(yt=>[yt,gt[yt]??""])),image:gt.image,link:gt.link}))},[t,h]),lt=ie?ge??v:ot.length,Ke=s.useMemo(()=>ie?ot.slice(0,lt):ot,[ot,ie,lt]),ht=ie&<<ot.length,tt=Ke.length>1||ht,Ge=[Se?`${u}-divider-top`:"",le||tt?`${u}-divider-bottom`:""].filter(Boolean).join(" "),We=!n||i,Ne=()=>{if(!We)return;const Ae=ge??v;if(!L){k(ot.length);return}k(Math.min(Ae+L,ot.length))},be=Ae=>E.scalingValue(Ae,n??!1),He=me?T??0:Q??0,Xe=R??0,ct=b??0,rt=Math.max(Xe,ps),xt=Dc(0,Ke.length,Se,le,ht,S??0,n??!1).borderTopWidth,pt=me?"rowPaddingTopB":"rowPaddingTop",It=Ue[0],nt=Ue[Ue.length-1],bt=et[0],Lt=et[et.length-1],Ut=It&&bt?Math.max(bt.paddingLeft,go):0,Ft=nt&&Lt?Math.max(Lt.paddingRight,go):0,Me=ye,Oe=(Ae,ft)=>f0(H,ve.current,xe?Ae:null,ft),St=(Ae,ft)=>{if(!ee)return;const gt=Ae.image;if(!(gt!=null&>.assetId)){pe(()=>I(null));return}const dt=(X==null?void 0:X.min)??80,yt=(X==null?void 0:X.max)??320,ut=(ce==null?void 0:ce.rowId)===Ae.id,it=ut?ce.widthPx:U0(dt,yt),{x:Nt,y:$t}=Oe(ft,it);if(ut&&xe){Z(Nt,$t);return}I({rowId:Ae.id,assetId:gt.assetId,objectFit:"contain",isVideo:u0(gt),widthPx:it}),ue.current={x:Nt,y:$t}},Mt=Ae=>{if(!ee||!ce||!xe)return;const{x:ft,y:gt}=Oe(Ae,ce.widthPx);Z(ft,gt)},Qe=()=>{ce&&pe(()=>I(null))},kt=Ae=>{W&&Wc(Ae,u),!(!ee||!ce)&&pe(()=>I(null))},Bt=Ae=>{W&&Oc(Ae,u)};s.useLayoutEffect(()=>{if(!ce||!ue.current)return;const{x:Ae,y:ft}=ue.current;ue.current=null,de(Ae,ft)},[ce==null?void 0:ce.rowId,ce==null?void 0:ce.assetId,de]),s.useLayoutEffect(()=>{if(!p||me){Ce(null);return}const Ae=Ee.current,ft=Ae==null?void 0:Ae.parentElement;if(!Ae||!ft){Ce(null);return}const gt=()=>{const yt=Ae.querySelector("[data-list-row]");if(!yt){Ce(null);return}const ut=ft.getBoundingClientRect(),it=yt.getBoundingClientRect();Ce(it.top-ut.top+it.height/2)};gt();const dt=new ResizeObserver(gt);return dt.observe(Ae),dt.observe(ft),()=>dt.disconnect()},[p,me,Ke,He,Xe,ct,t,e,Ue,Je,$e,S,Se,le,ht]);const Wt=s.useMemo(()=>!me&&Ol.some(Ae=>{const ft=Ae.charAt(0),gt=e[`${Ae}VerticalAlign`];return mp(gt,e,ft)}),[me,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var Nt;const Ae=ve.current;if(!Ae)return;const ft=()=>{Ae.querySelectorAll("[data-list-col]").forEach($t=>{$t.style.transform="";const Qt=$t.querySelector(`.${u}-list-col`);Qt&&(Qt.style.minHeight="",Qt.style.height="");const Xt=$t.querySelector(`.${u}-list-col-title`);Xt&&(Xt.style.transform="")})};if(me||!Wt){ft();return}const gt=()=>{const $t=Array.from(Ae.querySelectorAll("[data-list-row]")),Qt=`${u}-list-col`,Xt=`${u}-baseline-probe`;$t.forEach(Dt=>{Dt.querySelectorAll("[data-list-col]").forEach(jt=>{jt.style.transform="";const Ot=jt.querySelector(`.${Qt}`);Ot&&(Ot.style.minHeight="",Ot.style.height="");const zt=jt.querySelector(`.${u}-list-col-title`);zt&&(zt.style.transform="")})}),$t.forEach(Dt=>{const jt=Array.from(Dt.querySelectorAll("[data-list-col]"));P0(Dt,jt,Qt)}),Ae.offsetHeight,$t.forEach(Dt=>{const jt=Array.from(Dt.querySelectorAll("[data-list-col]")),Ot=Dt.getBoundingClientRect().top,zt=new Map,D=jt.map(ke=>{const vt=ke.querySelector(`.${u}-list-col-title`),Ct={el:ke,titleEl:vt,letter:ke.getAttribute("data-col-letter")??"",kind:ke.getAttribute("data-valign")??"top",anchor:ke.getAttribute("data-valign-anchor")};return zt.set(Ct.letter,Ct),Ct}),Ie=new Map,Be=(ke,vt)=>{const Ct=Ie.get(ke.letter);if(Ct!==void 0)return Ct;const at=ke.anchor?zt.get(ke.anchor):void 0;if(ke.kind!=="baseline"||!at||vt.has(ke.letter)){const on=us(ke,Ot,Qt,Xt);return Ie.set(ke.letter,on),on}vt.add(ke.letter);const Tt=Be(at,vt);vt.delete(ke.letter);const Vt=us(ke,Ot,Qt,Xt),Pt=Tt-Vt;M0(ke.titleEl,Pt);const Zt=us(ke,Ot,Qt,Xt);return Ie.set(ke.letter,Zt),Zt};D.forEach(ke=>Be(ke,new Set))})};let dt=null;const yt=()=>{dt===null&&(dt=requestAnimationFrame(()=>{dt=null,gt()}))};gt();const ut=new ResizeObserver(()=>yt());ut.observe(Ae);let it=!1;return typeof document<"u"&&((Nt=document.fonts)!=null&&Nt.ready)&&document.fonts.ready.then(()=>{it||yt()}),()=>{it=!0,dt!==null&&(cancelAnimationFrame(dt),dt=null),ut.disconnect(),ft()}},[Wt,me,e,t,$e,Ke,Je]);const At=s.useMemo(()=>v0(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:At}}),a.jsx("div",{style:F,children:a.jsxs("div",{ref:ve,className:`${u}-wrapper ${J}${Ge?` ${Ge}`:""}${me?` ${u}-type-b`:""}`.trim(),style:{width:E.scalingValue(g??0,n)},onMouseMove:ee?Mt:void 0,onMouseLeave:ee?Qe:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[Ke.map((Ae,ft)=>{var ut;const gt=(((ut=Ae.link)==null?void 0:ut.length)??0)>0,dt=gt&&(!n||i)?"a":"div",yt=Dc(ft,Ke.length,Se,le,ht,S??0,n??!1);return a.jsxs(dt,{ref:ft===0?it=>{Ee.current=it}:void 0,className:`${u}-list-item${gt||$==="always"?` ${u}-list-item-has-link`:""}${ht&&ft===Ke.length-1?` ${u}-list-item-before-cut`:""}`,...gt?{href:Ae.link,target:"_blank"}:{},style:yt,onMouseEnter:it=>{W&&(gt||$==="always")&&Wc(it,u),ee&&St(Ae,it)},onMouseLeave:it=>{W&&(gt||$==="always")&&Oc(it,u)},children:[He>0&&a.jsx("div",{className:`${u}-row-padding-handle`,style:{height:be(He)}}),a.jsxs("div",{className:`${u}-list-cols-row${me?"":` ${u}-list-cols-row-h`}${p&&ft===0&&me?` ${u}-list-cols-row-controls`:""}`,...me?{}:{"data-list-row":""},style:me?void 0:{minHeight:be(ct)},children:[Ue.map((it,Nt)=>{const $t=Nt===Ue.length-1,Qt=et[Nt],Xt=it.paddingBottom,Dt=g0(Ae.cells[it.key]),jt=me&&Xt>0,Ot=me?{minHeight:be(ct)}:{width:be(Je[Nt])},zt=me?{paddingLeft:be(oe),paddingRight:be(oe)}:{paddingLeft:be(Qt.paddingLeft),paddingRight:be(Qt.paddingRight)},D=it.textPrefix.charAt(0),Ie=me?w0(e[`${it.textPrefix}VerticalAlign`]):S0(e[`${it.textPrefix}VerticalAlign`],e,D),Be=me&&p&&ft===0;return a.jsxs("div",{className:me?`${u}-list-col-wrap`:void 0,...me?{}:{"data-list-col":"","data-col-letter":D,"data-valign":Ie.kind,...Ie.kind==="baseline"?{"data-valign-anchor":Ie.anchorLetter}:{}},children:[a.jsx("div",{className:`${u}-list-col${$t?` ${u}-list-col-last`:""}`,style:{...zt,...Ot,...me?{justifyContent:jc(Ie.kind)}:{}},"data-test":it.width,children:a.jsx("span",{className:Gc(e,it.textPrefix,`${u}-list-col-title`,`${u}-text-tight-leading`),style:{...Vc($a(e,it.textPrefix),n),...Xc(e,it.textPrefix,u,n),...me?{}:C0(Ie.kind)},children:Dt?Ae.cells[it.key]??null:me?" ":null})}),jt&&a.jsx("div",{className:`${u}-row-padding-handle`,style:{height:be(Xt)}}),Be&&a.jsx("div",{"data-controls":it.paddingBottomKey,"data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${u}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:be(Math.max(Xt,ps))}})]},it.key)}),p&&ft===0&&me&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(N),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${u}-control-anchor`,style:{top:0,left:0,width:be(fe),height:"100%"}}),a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(N),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${u}-control-anchor`,style:{top:0,left:be(Math.max(fe,ye-fe)),width:be(fe),height:"100%"}})]})]}),!me&&Xe>0&&a.jsx("div",{className:`${u}-row-padding-handle`,style:{height:be(Xe)}}),p&&ft===0&&!me&&a.jsx("div",{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${u}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:be(rt)}})]},Ae.id)}),p&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":pt,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":me?"center":"left-y",className:`${u}-control-anchor`,style:{top:xt,left:0,width:"100%",height:be(Math.max(He,ps))}})},"row-padding-handles"),p&&!me&&It&&nt&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":It.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Je[0]-((bt==null?void 0:bt.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Re??void 0,className:`${u}-control-anchor`,style:{top:0,left:0,width:be(Ut),height:"100%"}}),a.jsx("div",{"data-controls":nt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Je[Ue.length-1]-((Lt==null?void 0:Lt.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Re??void 0,className:`${u}-control-anchor`,style:{top:0,left:be(Me-Ft),width:be(Ft),height:"100%"}})]},"column-edge-padding-handles"),p&&!me&&Ue.slice(0,-1).map((Ae,ft)=>{const gt=Ue[ft+1],dt=Ve.slice(0,ft+1).reduce(($t,Qt)=>$t+Qt,0),yt=et[ft],ut=et[ft+1],it=Math.max(yt.paddingRight,go),Nt=Math.max(ut.paddingLeft,go);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Ae.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Je[ft]-yt.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Re??void 0,className:`${u}-control-anchor`,style:{top:0,left:be(dt-it),width:be(it),height:"100%"}}),a.jsx("div",{"data-controls":gt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Je[ft+1]-ut.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Re??void 0,className:`${u}-control-anchor`,style:{top:0,left:be(dt),width:be(Nt),height:"100%"}})]},`${Ae.paddingRightKey}-padding`)}),p&&!me&&Ue.slice(0,-1).map((Ae,ft)=>{const gt=X0(ft,Ve,_e,ye),yt=Ve.slice(0,ft+1).reduce((ut,it)=>ut+it,0)-Uc/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Ae.widthKey,"data-controls-axis":"x","data-controls-min":String(zl),"data-controls-max-fraction":String(gt),"data-controls-variant":"column-width",className:`${u}-col-resize-handle`,style:{position:"absolute",top:"0px",left:be(yt),width:be(Uc),height:"calc(100%)",pointerEvents:"auto"}})},`${Ae.widthKey}-junction`)})]}),ht&&(()=>{const Ae=$a(e,si),ft=T0(e.cutLabelVerticalAlign),gt=Ae.textTextAlign==="justify"||me;return a.jsx("button",{type:"button",className:`${u}-cut-item`,style:{minHeight:be(P??0),cursor:We?"pointer":"default",...m0(le,S??0,n??!1)},onClick:We?Ne:void 0,onMouseEnter:W||ee?kt:void 0,onMouseLeave:W?Bt:void 0,children:a.jsx("div",{className:`${u}-list-cols-row`,style:{...me?{paddingLeft:be(oe),paddingRight:be(oe)}:{},justifyContent:I0(Ae.textTextAlign),alignItems:jc(ft)},children:a.jsx("span",{className:Gc(e,si,`${u}-cut-label`,`${u}-text-tight-leading`),style:{...Vc(Ae,n),...Xc(e,si,u,n),...gt?{width:"100%"}:{}},children:q})})})})(),ee&&ce&&typeof document<"u"&&(()=>{const Ae=`${ce.widthPx}px`,ft={width:Ae,height:"auto",maxHeight:Ae,objectFit:"contain"},gt=(c?document.getElementById(c):null)??document.body;return qn.createPortal(a.jsx("div",{ref:se,className:`${u}-hover-media-anchor`,"data-selection":"none",children:a.jsx(p0,{media:ce,className:ce.isVideo?`${u}-hover-video`:`${u}-hover-image`,style:ft},`${ce.rowId}-${ce.assetId}`)}),gt)})()]})})]})}const Q0=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
10591
10591
|
import { createPortal } from 'react-dom';
|
|
10592
10592
|
import { CommonComponentProps } from '../props';
|
|
10593
10593
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -13275,7 +13275,6 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13275
13275
|
const columnPaddingBottom = col.paddingBottom;
|
|
13276
13276
|
const hasColumnText = hasListColumnText(row.cells[col.key]);
|
|
13277
13277
|
const showColumnPaddingBottom = isVerticalLayout
|
|
13278
|
-
&& hasColumnText
|
|
13279
13278
|
&& columnPaddingBottom > 0;
|
|
13280
13279
|
const columnSizeStyle = isVerticalLayout
|
|
13281
13280
|
? { minHeight: scaled(resolvedCellMinHeight) }
|
|
@@ -13301,14 +13300,9 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13301
13300
|
);
|
|
13302
13301
|
|
|
13303
13302
|
const columnPaddingBottomOverlay = isVerticalLayout
|
|
13304
|
-
&& hasColumnText
|
|
13305
13303
|
&& showControls
|
|
13306
13304
|
&& rowIdx === 0;
|
|
13307
13305
|
|
|
13308
|
-
if (isVerticalLayout && !hasColumnText) {
|
|
13309
|
-
return null;
|
|
13310
|
-
}
|
|
13311
|
-
|
|
13312
13306
|
return (
|
|
13313
13307
|
<div
|
|
13314
13308
|
key={col.key}
|
|
@@ -13348,7 +13342,9 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13348
13342
|
...(!isVerticalLayout ? vAlignToTitleStyle(vAlign.kind) : {}),
|
|
13349
13343
|
}}
|
|
13350
13344
|
>
|
|
13351
|
-
{
|
|
13345
|
+
{hasColumnText
|
|
13346
|
+
? (row.cells[col.key] ?? null)
|
|
13347
|
+
: (isVerticalLayout ? '\\u00a0' : null)}
|
|
13352
13348
|
</span>
|
|
13353
13349
|
</div>
|
|
13354
13350
|
{showColumnPaddingBottom && (
|
|
@@ -14590,7 +14586,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
14590
14586
|
</>
|
|
14591
14587
|
);
|
|
14592
14588
|
}
|
|
14593
|
-
`;function yi(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const nd={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Sx=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],wx={type:"object",version:1,content:{type:"array",display:{type:"array"},items:{type:"object",properties:{question:{type:"string",label:"Question",placeholder:"Add question...",display:{type:"text-input"}},answer:{label:"Answer",placeholder:"Add answer...",display:{type:"rich-text"}}}},default:[{question:"What are the three main parts of The Divine Comedy?",answer:[{type:"paragraph",children:[{text:"The poem is divided into Inferno, Purgatorio, and Paradiso. These three sections follow Dante’s journey through Hell, Purgatory, and Heaven."}]}]},{question:"Who guides Dante through Hell and most of Purgatory?",answer:[{type:"paragraph",children:[{text:"Dante is guided by Virgil, the ancient Roman poet. Virgil represents human reason and wisdom, but because he lived before Christianity, he cannot guide Dante all the way into Heaven."}]}]},{question:"What does the dark wood at the beginning of the poem symbolize?",answer:[{type:"paragraph",children:[{text:"The dark wood symbolizes Dante’s spiritual confusion and moral crisis. It shows that he has lost the “straight way” in life and needs guidance to return to truth and salvation."}]}]},{question:"What is “contrapasso” in Inferno?",answer:[{type:"paragraph",children:[{text:"“Contrapasso” is the principle that punishments in Hell reflect the sins committed during life. For example, people who caused division are themselves physically divided, showing how their punishment mirrors their wrongdoing."}]}]},{question:"Who guides Dante through Heaven?",answer:[{type:"paragraph",children:[{text:"Beatrice guides Dante through Paradiso. She represents divine love, grace, and spiritual understanding, helping Dante move beyond human reason toward a vision of God."}]}]},{question:"Why is The Divine Comedy important in literary history?",answer:[{type:"paragraph",children:[{text:"The Divine Comedy is important because it is one of the greatest works of world literature and helped shape the Italian language. Dante wrote it in the Tuscan dialect rather than Latin, making serious literature more accessible to ordinary readers."}]}]},{question:"What is the overall journey of The Divine Comedy about?",answer:[{type:"paragraph",children:[{text:"The poem is about Dante’s spiritual journey from sin and despair toward repentance, wisdom, and union with God. On a deeper level, it represents the soul’s path from confusion to divine truth."}]}]}]},settings:{sizing:"auto",properties:{wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},cellMinHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},dividerWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},dividerStyle:{type:"string",scope:"common",title:"Style",display:{type:"toggle-cycle",enum:["solid","dashed","dotted"]}},entryHoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["none","default"]}},autoclose:{type:"string",scope:"common",title:"Autoclose",display:{type:"toggle-cycle",enum:["on","off"]}},icon:{type:["string","null"],scope:"common",display:{type:"settings-image-input"}},iconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"numeric-input"},min:0,max:9999},iconPaddingRight:yi("Icon Padding Right"),iconAnimation:{type:"string",scope:"common",title:"Icon Animation",display:{type:"toggle-cycle",enum:["rotate 180","rotate 90","rotate 45"]}},questionColor:{type:"string",scope:"common",title:"Question Default",display:{type:"palette-color-picker"}},answerColor:{type:"string",scope:"common",title:"Answer Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"palette-color-picker"}},questionHoverColor:{type:"string",scope:"common",title:"Question Hover",display:{type:"palette-color-picker"}},iconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"palette-color-picker"}},iconActiveColor:{type:"string",scope:"common",title:"Icon Active",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}},questionFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},questionFontSettings:{...nd.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},questionFontSize:{type:"number",scope:"layout",title:"Question Font Size",display:{type:"font-size"}},questionLineHeight:{type:"number",scope:"layout",title:"Question Line Height",display:{type:"line-height-input"}},questionLetterSpacing:{type:"number",scope:"layout",title:"Question Letter Spacing",display:{type:"letter-spacing-input"}},questionWordSpacing:{type:"number",scope:"layout",title:"Question Word Spacing",display:{type:"word-spacing-input"}},questionTextAppearance:{type:"object",scope:"layout",title:"Question Text Appearance",display:{type:"text-appearance"}},answerFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},answerFontSettings:{...nd.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},answerFontSize:{type:"number",scope:"layout",title:"Answer Font Size",display:{type:"font-size"}},answerLineHeight:{type:"number",scope:"layout",title:"Answer Line Height",display:{type:"line-height-input"}},answerLetterSpacing:{type:"number",scope:"layout",title:"Answer Letter Spacing",display:{type:"letter-spacing-input"}},answerWordSpacing:{type:"number",scope:"layout",title:"Answer Word Spacing",display:{type:"word-spacing-input"}},answerTextAppearance:{type:"object",scope:"layout",title:"Answer Text Appearance",display:{type:"text-appearance"}},questionPaddingLeft:yi("Question Padding Left"),questionPaddingTop:yi("Question Padding Top"),questionPaddingBottom:yi("Question Padding Bottom"),answerPaddingLeft:yi("Answer Padding Left"),answerPaddingRight:yi("Answer Padding Right"),answerPaddingTop:yi("Answer Padding Top"),answerPaddingBottom:yi("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"01M3QM74XGFBPMXNEQB1BXSD9E",iconAnimation:"rotate 45",questionColor:"#000000",answerColor:"#000000",dividerColor:"#000000",iconColor:"#000000",questionHoverColor:"#A60239",iconHoverColor:"#A60239",iconActiveColor:"#000000",dividerHoverColor:"#A60239",questionFontFamily:"Goudy Bookletter 1911",questionFontSettings:{fontWeight:400,fontStyle:"normal"},questionLetterSpacing:0,questionWordSpacing:0,questionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},answerFontFamily:"Goudy Bookletter 1911",answerFontSettings:{fontWeight:400,fontStyle:"normal"},answerLetterSpacing:0,answerWordSpacing:0,answerTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{wrapperWidth:1,cellMinHeight:0,dividerWidth:.008,iconMaxWidth:.0533,iconPaddingRight:.08,questionFontSize:.09066,questionLineHeight:.10133,questionLetterSpacing:-.00266,answerFontSize:.0533,answerLineHeight:.064,questionPaddingLeft:.0533,questionPaddingTop:.0533,questionPaddingBottom:.0533,answerPaddingLeft:.0533,answerPaddingRight:.16,answerPaddingTop:.0533,answerPaddingBottom:.0533},t:{wrapperWidth:.651041,cellMinHeight:0,dividerWidth:.00390625,iconMaxWidth:.02604166,iconPaddingRight:.0130208,questionFontSize:.0390625,questionLineHeight:.04427,questionLetterSpacing:-.00091145833,answerFontSize:.0234375,answerLineHeight:.026041,questionPaddingLeft:0,questionPaddingTop:.01302,questionPaddingBottom:.01302,answerPaddingLeft:.065104,answerPaddingRight:.09765625,answerPaddingTop:.026041,answerPaddingBottom:.026041},d:{wrapperWidth:.6388,cellMinHeight:0,dividerWidth:.002083,iconMaxWidth:.01388,iconPaddingRight:.01388,questionFontSize:.0333,questionLineHeight:.0333,questionLetterSpacing:-9e-4,answerFontSize:.01111,answerLineHeight:.01388,questionPaddingLeft:0,questionPaddingTop:.01111,questionPaddingBottom:.01111,answerPaddingLeft:.0625,answerPaddingRight:.1625,answerPaddingTop:0,answerPaddingBottom:.01111}},layout:["__componentName__","wrapperWidth","cellMinHeight","dividerWidth","dividerStyle","entryHoverEffect","autoclose","icon","iconMaxWidth","iconAnimation"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["wrapperWidth","cellMinHeight"]},{type:"row",title:"",items:["entryHoverEffect","autoclose"]},{type:"row",title:"Divider",items:["dividerWidth","dividerStyle"]},{type:"row",title:"Icon",items:["icon","iconMaxWidth"]},{type:"row",title:"",items:["iconAnimation"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Question",items:["questionFontFamily","questionFontSettings",{type:"row",items:["questionFontSize","questionLineHeight","questionLetterSpacing","questionWordSpacing"]},"questionTextAppearance"]},{type:"group",title:"Answer",items:["answerFontFamily","answerFontSettings",{type:"row",items:["answerFontSize","answerLineHeight","answerLetterSpacing","answerWordSpacing"]},"answerTextAppearance"]}]}],paletteBookmark:{items:[...Sx],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},$x={element:xx,id:"faq",name:"FAQ",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/FAQ_List.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"questionFontFamily"},{path:"answerFontFamily"}]},fontRelations:{questionFontSettings:"questionFontFamily",answerFontSettings:"answerFontFamily"},schema:wx,sourceCode:bx},li=e=>e.display==="cover",ja=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},id=100,Cx=.2,od=8,bp=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,r]=s.useState(0),[l,c]=s.useState(!1),d=s.useRef(null),u=s.useRef(0);u.current=o;const p=s.useMemo(()=>typeof window>"u"?id:Math.max(id,window.innerHeight*Cx),[]),y=s.useCallback(C=>Math.max(0,1-C/(p*1.5)),[p]),x=s.useCallback(C=>Math.max(0,1-C/(p*.45)),[p]),g=s.useCallback(C=>{const $=typeof window<"u"?window.innerHeight:800,Q=Math.max(.88,1-C/$*.12);return`translateY(${C}px) scale(${Q})`},[]),h=s.useCallback(()=>{d.current=null},[]),b=s.useCallback(()=>{c(!0),r(0),window.setTimeout(()=>c(!1),n),h()},[n,h]),S=s.useCallback(()=>{const C=typeof window<"u"?window.innerHeight:800;c(!0),r(C),window.setTimeout(()=>{t(),h(),c(!1)},Math.min(n,200))},[n,t,h]),_=s.useCallback(C=>{!e||l||C.pointerType==="touch"&&(i!=null&&i(C.target)||(d.current={startX:C.clientX,startY:C.clientY,isLocked:null,pointerId:C.pointerId}))},[e,l,i]),v=s.useCallback(C=>{const $=d.current;if(!e||!$||C.pointerType!=="touch"||$.pointerId!==C.pointerId)return;const Q=C.clientX-$.startX,R=C.clientY-$.startY;if($.isLocked===null){if(Math.abs(Q)<od&&Math.abs(R)<od)return;if(R>0&&R>Math.abs(Q))$.isLocked=!0,C.currentTarget.setPointerCapture(C.pointerId);else{$.isLocked=!1,h();return}}if(!$.isLocked)return;C.preventDefault();const T=Math.max(0,R);u.current=T,r(T)},[e,h]),L=s.useCallback(C=>{const $=d.current;if(!e||!$||C.pointerType!=="touch"||$.pointerId!==C.pointerId)return;const Q=$.isLocked===!0;if(C.currentTarget.hasPointerCapture(C.pointerId)&&C.currentTarget.releasePointerCapture(C.pointerId),!Q){h();return}C.clientY-$.startY>=p?S():b()},[p,S,e,h,b]),P=s.useCallback(C=>{L(C)},[L]),q=s.useCallback(C=>{L(C)},[L]),X=o>0,B=l?`transform ${n}ms ease`:"none",H=l?`opacity ${n}ms ease`:"none",O=o>0||l;return{isSwipeDragging:X,backdropStyle:{opacity:y(o),transition:H},mediaAreaStyle:{transform:g(o),transition:B,touchAction:X?"none":void 0,willChange:X?"transform":void 0},overlayContentStyle:O?{opacity:x(o),transition:H}:void 0,swipeHandlers:e?{onPointerDown:_,onPointerMove:v,onPointerUp:P,onPointerCancel:q}:{},dismissAreaStyle:e?{touchAction:X?"none":"pan-x"}:void 0}},Tx="[data-lightbox-scrollable]",jl=(e=!0)=>{s.useEffect(()=>{if(!e)return;const t=window.scrollY,n=document.body.style.overflow,i=document.body.style.position,o=document.body.style.top,r=document.body.style.width,l=document.documentElement.style.overflow;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${t}px`,document.body.style.width="100%",document.documentElement.style.overflow="hidden";const c=d=>{const u=d.target;u instanceof Element&&u.closest(Tx)||d.preventDefault()};return document.addEventListener("touchmove",c,{passive:!1}),()=>{document.removeEventListener("touchmove",c),document.body.style.overflow=n,document.body.style.position=i,document.body.style.top=o,document.body.style.width=r,document.documentElement.style.overflow=l,window.scrollTo({top:t,left:0,behavior:"instant"})}},[e])},Ix=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Lx=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Px=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Mx=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,c=n-l,d=l-n,u=(h,b)=>{Lx(t),e.scrollLeft=h,b&&(r==null||r())};if(Math.abs(c)<.5)return u(n,!0),()=>{};let p=!1,y=0;const x=()=>{t.removeEventListener("transitionend",g),clearTimeout(y)},g=h=>{h.target!==t||h.propertyName!=="transform"||p||(p=!0,x(),u(n,!0))};return t.addEventListener("transitionend",g),t.style.willChange="transform",t.style.transition="none",t.style.transform="translate3d(0, 0, 0)",t.offsetHeight,t.style.transition=`transform ${i}ms ${o}`,t.style.transform=`translate3d(${d}px, 0, 0)`,y=window.setTimeout(()=>{p||(p=!0,x(),u(n,!0))},i+64),()=>{p||(p=!0,x(),u(l-Px(t),!1))}},cr=300,Rx=900,Ex=1500,kx="cubic-bezier(0.16, 1, 0.3, 1)",Ax=3e3,Fx=2,Nx=16,_x=.05,Hx=1,Xr=.3,Wx=50,Ox=20,ao=.004,No=["title1","title2","title3"],Dx={title1:"1",title2:"2",title3:"3"},zx={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Bx={title1:.02,title2:.02,title3:.02},Ur=e=>`max(${e}, ${Ox}px)`,jx=e=>{if(!Array.isArray(e)||e.length===0)return{};const t=e.find(o=>(o==null?void 0:o.type)==="paragraph")??e[0],n=t==null?void 0:t.children;if(!Array.isArray(n))return{};const i=n.map(o=>typeof(o==null?void 0:o.text)=="string"?o.text.trim():"").filter(Boolean);return{title1:i[0],title2:i[1],title3:i[2]}},Vx=e=>{if(!e)return{title1:"",title2:"",title3:""};if(e.title1||e.title2||e.title3)return{title1:e.title1??"",title2:e.title2??"",title3:e.title3??""};const t=jx(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Jt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Gx=e=>[Jt(e,"fontFamily"),Jt(e,"fontSettings"),{type:"row",items:[Jt(e,"fontSize"),Jt(e,"lineHeight"),Jt(e,"letterSpacing"),Jt(e,"wordSpacing")]},Jt(e,"textAlign"),Jt(e,"textAppearance")],Xx=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(No.map(e=>[Dx[e],Gx(e)]))}),Vl=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((r,l)=>r+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:r,widths:l},c)=>{if(r<=0||c<=0)return{overflow:r,widths:[c,...l]};const d=Math.min(r,c);return{overflow:r-d,widths:[c-d,...l]}},{overflow:i-1,widths:[]});return o},Sp=(e,t)=>Vl(e,t),qr=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},rd=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Vl(e.length,n),effective:Sp(e.length,n)}},Ux=(e,t,n,i,o,r,l)=>{const c=[];return t&&c.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:o,text:t}),n&&c.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:r,text:n}),i&&c.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:l,text:i}),c},ms=(e,t)=>{const n=i=>{const o=Jt(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[zx[t]]}},qx=(e,t,n,i)=>e.slice(0,i).reduce((o,r,l)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[l]??0),0),hs=(e,t,n)=>{var o,r;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((r=t.fontSettings)==null?void 0:r.fontStyle)??"normal"},fontSize:t.fontSize??Bx[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return nn(i,n)},Yx=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:c,thumbnailSize:d,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:y,closeIcon:x,closeIconMaxWidth:g,closeIconColor:h,closeIconHoverColor:b,thumbnailTrigger:S,thumbnailVisibility:_,thumbnailObjectFit:v,thumbnailActive:L,thumbnailActiveColor:P,title1Width:q,title2Width:X,title3Width:B,title1MarginLeft:H=0,title2MarginLeft:O=0,title3MarginLeft:C=0,titleRowMarginBottom:$=0,titleHeaderLayout:Q="desktop",contentMarginTop:R,iconMarginLeft:T}=n,w=A=>E.scalingValue(A,i??!1),V=d??n.thumnailSize??.03,z=w(V),U=w(u),M=w(p??.02),f=w(y??0),K=w(R??0),G=Ur(K),ge=w(T??0),[k,ce]=s.useState(0),I=s.useRef(k);I.current=k;const ue=t[k],{title1:ee,title2:xe,title3:Le}=Vx(ue),se=hs("title1",ms(n,"title1"),i),de=hs("title2",ms(n,"title2"),i),Z=hs("title3",ms(n,"title3"),i),pe=Q==="mobile",ie=!o&&(!i||r),me=ie,ve=ie,Ee=ie,Re=li(v),Ce=Re?{"--image-aspect-ratio":ja(v)}:void 0,$e=!!(ee||xe||Le),m=s.useMemo(()=>Ux(e,ee,xe,Le,se,de,Z),[e,k,ee,xe,Le,se,de,Z]),Y=s.useMemo(()=>({title1Width:q,title2Width:X,title3Width:B}),[q,X,B]),te=s.useMemo(()=>m.map(A=>Y[A.widthKey]),[m,Y]),oe=s.useMemo(()=>Vl(m.length,te),[m.length,te]),fe=s.useMemo(()=>Sp(m.length,te),[m.length,te]),N=s.useMemo(()=>m.filter(A=>A.prefix==="title1"),[m]),F=s.useMemo(()=>m.filter(A=>A.prefix==="title2"||A.prefix==="title3"),[m]),ne=s.useMemo(()=>rd(N,Y),[N,Y]),re=s.useMemo(()=>rd(F,Y),[F,Y]),J=s.useCallback((A,ae)=>{const he=m.indexOf(A);if(!pe||ae==="single-row")return{effectiveWidth:fe[he]??0,resolvedWidth:oe[he]??0,maxWidth:qr(he,oe)};if(ae==="two-row-top"){const je=N.indexOf(A);return{effectiveWidth:ne.effective[je]??0,resolvedWidth:ne.resolved[je]??0,maxWidth:qr(je,ne.resolved)}}const Pe=F.indexOf(A);return{effectiveWidth:re.effective[Pe]??0,resolvedWidth:re.resolved[Pe]??0,maxWidth:qr(Pe,re.resolved)}},[F,re,fe,oe,m,N,ne,pe]),W=s.useCallback(A=>E.scalingValue(A,i??!1),[i]),Se=W($??0),le=s.useMemo(()=>({title1MarginLeft:H,title2MarginLeft:O,title3MarginLeft:C}),[H,O,C]),j=s.useCallback(A=>m.slice(0,A+1).reduce((ae,he,Pe)=>ae+(he!=null&&he.marginLeftKey?le[he.marginLeftKey]??0:0)+(oe[Pe]??0),0)+(pe?0:H??0),[m,le,oe,pe,H]),Te=s.useCallback(()=>pe?0:H??0,[pe,H]),Fe=s.useCallback(A=>F.slice(0,A).reduce((ae,he,Pe)=>ae+(he.marginLeftKey?le[he.marginLeftKey]??0:0)+(re.resolved[Pe]??0),0),[F,re.resolved,le]),Ye=s.useCallback(A=>{const ae=F[A];return Fe(A)+(ae.marginLeftKey?le[ae.marginLeftKey]??0:0)+(re.resolved[A]??0)},[F,re.resolved,Fe,le]),De=(A,ae)=>{const he=A.marginLeftKey?le[A.marginLeftKey]??0:0,{effectiveWidth:Pe,resolvedWidth:je,maxWidth:mt}=J(A,ae),Ht=o&&ae==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":A.prefix,style:{...ae==="single-row"?{gridArea:A.prefix}:{},width:W(Pe),...he>0?{marginLeft:W(he)}:{}},children:[a.jsx("p",{className:A.className,style:A.style,children:A.text}),Ht&&A.marginLeftKey&&a.jsx("div",{"data-controls":A.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:W(-he),width:`max(${W(he)}, 10px)`,height:"100%",pointerEvents:"auto"}}),Ht&&a.jsx("div",{"data-controls":A.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(mt),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:W(-ao/2),width:W(ao),height:"100%",pointerEvents:"auto"}})]},A.className)},ze=()=>{const A=pe?-1:m.findIndex(Pe=>Pe.prefix==="title1"),ae=!pe&&(o||(H??0)>0)?(()=>{const Pe=H??0,je=A>=0?oe[A]:q??0;return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:0,width:`max(${W(Pe)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,he=m.flatMap((Pe,je)=>{if(!Pe.marginLeftKey)return[];const mt=le[Pe.marginLeftKey]??0,Ht=qx(m,oe,le,je)+Te();return a.jsx("div",{"data-controls":Pe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(oe[je]),style:{position:"absolute",top:0,left:W(Ht),width:`max(${W(mt)}, 10px)`,height:"100%",pointerEvents:"auto"}},Pe.marginLeftKey)});return ae?[ae,...he]:he},Ze=()=>m.map((A,ae)=>{const he=qr(ae,oe),je=j(ae)-ao/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":A.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(he),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:W(je),width:W(ao),height:"100%",pointerEvents:"auto"}})},`${A.widthKey}-junction`)}),Ue=()=>F.flatMap((A,ae)=>{if(!A.marginLeftKey)return[];const he=le[A.marginLeftKey]??0,Pe=Fe(ae),{resolvedWidth:je}=J(A,"two-row-bottom");return a.jsx("div",{"data-controls":A.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:W(Pe),width:`max(${W(he)}, 10px)`,height:"100%",pointerEvents:"auto"}},A.marginLeftKey)}),ye=()=>F.map((A,ae)=>{const{maxWidth:he}=J(A,"two-row-bottom"),je=Ye(ae)-ao/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":A.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(he),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:W(je),width:W(ao),height:"100%",pointerEvents:"auto"}})},`${A.widthKey}-junction`)}),_e=s.useRef(null),Ve=s.useRef(null),Je=s.useRef(null),et=s.useRef(null),ot=s.useRef([]),lt=s.useRef([]),Ke=s.useRef(0),ht=s.useRef(null),tt=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),Ge=s.useRef(null),We=s.useRef(null),Ne=s.useRef(0),be=s.useRef("forward"),He=s.useRef(0),Xe=s.useRef(null),ct=s.useRef(!1),rt=t.length>1&&(!o||!!r),xt=rt?3:1,pt=s.useMemo(()=>Array.from({length:xt},()=>t).flat(),[t,xt]),[It,nt]=s.useState(!1),[bt,Lt]=s.useState(!1),[Ut,Ft]=s.useState(!0),Me=s.useRef(null),Oe=s.useRef(null),St=s.useRef(!1),Mt=s.useRef(!1),Qe=s.useRef(null),kt=s.useRef(null),Bt=me&&!Ut,Wt=s.useCallback(()=>{me&&(Ft(!0),kt.current&&clearTimeout(kt.current),kt.current=setTimeout(()=>{tt.current.isActive||Ft(!1)},Ax))},[me]),At=s.useCallback(()=>{o||Mt.current||(Mt.current=!0,Lt(!1),Qe.current=setTimeout(()=>{l()},cr))},[o,l]),Ae=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":Bt?"true":"false",style:{width:E.scalingValue(g??0,i),height:E.scalingValue(g??0,i),marginRight:ge,"--close-icon-hover-color":b},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:At,"aria-label":"Close",children:a.jsx(gn,{url:x,fill:h,hoverFill:i&&!r?h:b,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ge,height:"100%",pointerEvents:"auto"}})]}),ft=(A="two-row")=>a.jsx("div",{...A==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:W(H??0),flexShrink:0,...A==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...A==="two-row"&&o?{pointerEvents:"auto"}:{}}}),gt=()=>{const A=m.find(Pe=>Pe.prefix==="title1"),ae=m.filter(Pe=>Pe.prefix==="title2"||Pe.prefix==="title3"),he=ae.length>0||o||($??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(H??0)>0||o?ft():null,A&&De(A,"two-row-top"),x&&Ae()]}),he?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[ae.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[ae.map(Pe=>De(Pe,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[Ue(),ye()]})]}):null,a.jsx("div",{"data-controls":o?"titleRowMarginBottom":void 0,"data-controls-axis":o?"y":void 0,"data-controls-reverse":o?"":void 0,className:o?`${e}-control`:void 0,style:{height:Se,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},dt=()=>a.jsxs(a.Fragment,{children:[(H??0)>0||o?ft("single-row"):null,m.map(A=>De(A,"single-row")),o?a.jsxs(a.Fragment,{children:[ze(),Ze()]}):null,x?Ae():null]}),yt=s.useCallback(A=>!!(A.closest("[data-controls]")||A.closest(`.${e}-thumbnails`)||A.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ut,backdropStyle:it,mediaAreaStyle:Nt,overlayContentStyle:$t,swipeHandlers:Qt,dismissAreaStyle:Xt}=bp({enabled:ie??!1,onClose:At,animMs:cr,isBlockedTarget:yt}),Ot=()=>{if(!rt||t.length===0)return Ke.current=0,0;const A=lt.current[0],ae=lt.current[t.length];if(!A||!ae)return Ke.current;const he=ae.offsetLeft-A.offsetLeft;return he>0&&(Ke.current=he),Ke.current},jt=(A=!1)=>{if(!rt)return;const ae=Ve.current,he=Ot();!ae||he<=0||he<ae.clientWidth*.25||(ae.scrollLeft<=0?(ae.scrollLeft+=he,A&&(tt.current.scrollLeft+=he),ct.current&&(He.current+=he)):ae.scrollLeft>=he*2&&(ae.scrollLeft-=he,A&&(tt.current.scrollLeft-=he),ct.current&&(He.current-=he)))},Dt=(A,ae=(he=>(he=Ve.current)==null?void 0:he.scrollLeft)()??0)=>{if(!rt)return A;let Pe=t.length+A,je=1/0;for(let mt=0;mt<xt;mt++){const Ht=mt*t.length+A,qt=lt.current[Ht];if(!qt)continue;const sn=Math.abs(qt.offsetLeft-ae);sn<je&&(je=sn,Pe=Ht)}return Pe},zt=A=>{const ae=Ve.current;return!A||!ae?!1:A.offsetWidth>ae.clientWidth+1},D=A=>{const ae=Ve.current;if(!A||!ae||!zt(A))return!1;const he=A.offsetLeft,Pe=he+A.offsetWidth;return ae.scrollLeft>=he-1&&ae.scrollLeft+ae.clientWidth<=Pe+1},Ie=(A=(ae=>(ae=Ve.current)==null?void 0:ae.scrollLeft)()??0)=>{for(let Pe=0;Pe<lt.current.length;Pe+=1){const je=lt.current[Pe];if(je&&D(je))return Pe}let he={flatIndex:0,distance:1/0};return lt.current.forEach((Pe,je)=>{if(!Pe)return;const mt=Math.abs(Pe.offsetLeft-A);mt<he.distance&&(he={flatIndex:je,distance:mt})}),he.flatIndex},Be=A=>{Ve.current&<.current.forEach(ae=>{ae&&(ae.style.scrollSnapAlign=zt(ae)&&A==="backward"?"end":"start")})},ke=(A,ae,he)=>{const Pe=A-ae,je=Ie(ae),mt=lt.current[je];if(D(mt))return Ie(A)%t.length;const Ht=lt.current[je+1],qt=mt?Ht?Ht.offsetLeft-mt.offsetLeft:mt.offsetWidth:0,sn=qt>0?Pe>qt*Xr?1:Pe<-qt*Xr?-1:0:0;return sn===0?he:rt?(he+sn+t.length)%t.length:Math.max(0,Math.min(t.length-1,he+sn))},vt=s.useCallback((A=!1)=>{if(_!=="on"||o)return;const ae=et.current,he=I.current,Pe=ot.current[he];if(!ae||!Pe||ae.scrollWidth<=ae.clientWidth)return;const je=ae.scrollLeft,mt=je+ae.clientWidth,Ht=Pe.offsetLeft,qt=Ht+Pe.offsetWidth;if(Ht>=je&&qt<=mt)return;const sn=ae.scrollWidth-ae.clientWidth;let en=je;if(!A&&Me.current===null){const mi=ot.current[he-1],kn=ot.current[he+1],Zn=mi?Pe.offsetLeft-mi.offsetLeft:kn?kn.offsetLeft-Pe.offsetLeft:Pe.offsetWidth;qt>mt?en+=Zn:Ht<je&&(en-=Zn)}else qt>mt?en=qt-ae.clientWidth:en=Ht;ae.scrollLeft=Math.max(0,Math.min(sn,en))},[o,_]),Ct=s.useCallback((A=!1)=>{A&&(St.current=!0),Oe.current===null&&(Oe.current=requestAnimationFrame(()=>{Oe.current=null;const ae=St.current;St.current=!1,vt(ae)}))},[vt]),at=s.useCallback(A=>{if(A===I.current)return;const ae=I.current;I.current=A;const he=Math.abs(A-ae)>1,Pe=rt&&t.length>1&&(ae===t.length-1&&A===0||ae===0&&A===t.length-1);ce(A),Ct(he||Pe)},[t.length,rt,Ct]),Tt=()=>{if(!Ve.current||t.length===0||Me.current!==null||tt.current.isActive&&tt.current.hasMoved)return;const A=Ve.current.scrollLeft,ae=Ie(A)%t.length;ae!==I.current&&at(ae)},Vt=()=>{Me.current=null},Pt=A=>{const ae=Ve.current;ae&&(ae.style.scrollSnapType=A?"":"none")},Zt=()=>{var A;(A=We.current)==null||A.call(We),We.current=null},on=()=>{Xe.current!==null&&(cancelAnimationFrame(Xe.current),Xe.current=null),ct.current=!1},Wn=()=>{const A=Ve.current;if(!A){Xe.current=null,ct.current=!1;return}const ae=He.current-A.scrollLeft;if(Math.abs(ae)<.5){A.scrollLeft=He.current,jt(),Tt(),Xe.current=null,ct.current=!1;return}A.scrollLeft+=ae*_x,jt(),Tt(),Wt(),Xe.current=requestAnimationFrame(Wn)},xn=()=>{const A=Je.current;A&&(A.style.transition="",A.style.transform="",A.style.willChange="")},ui=(A,ae,he,Pe)=>{xn(),A.scrollLeft=ae,Ne.current=A.scrollLeft,jt(),he!==void 0?(I.current=he,ce(he)):Tt(),Pt(!0),Pe==null||Pe()},dn=(A,{behavior:ae="smooth",activeIndex:he,onComplete:Pe}={})=>{const je=Ve.current,mt=Je.current;if(!je||!mt)return;if(on(),Zt(),Pt(!1),ae==="auto"){ui(je,A,he,Pe);return}const Ht=Math.abs(A-je.scrollLeft),qt=Ix(Ht,Rx,Ex,je.clientWidth*.55);We.current=Mx(je,mt,A,{duration:qt,easing:kx,onComplete:()=>{We.current=null,ui(je,A,he,Pe)}})},pi=(A="smooth")=>{const ae=Ve.current;if(!ae||t.length===0)return;const he=Ie()%t.length,Pe=Dt(he,ae.scrollLeft),je=lt.current[Pe];je&&dn(je.offsetLeft,{behavior:A,activeIndex:he})},Kn=(A,ae="smooth",he,Pe)=>{const je=Ve.current;if(!je||t.length===0)return;const mt=(Pe??je.scrollLeft)-A,Ht=Ie(A),qt=lt.current[Ht];if(D(qt)){Pt(!0),Tt();return}const sn=lt.current[Ht+1],en=qt?sn?sn.offsetLeft-qt.offsetLeft:qt.offsetWidth:0;if((en>0?mt>en*Xr?1:mt<-en*Xr?-1:0:0)!==0){const Kl=he??Ht%t.length,Xo=ke(Pe??je.scrollLeft,A,Kl);bn(Xo,ae);return}const kn=Pe??je.scrollLeft,Zn=Ie(kn),kr=lt.current[Zn];if(kr&&Math.abs(kr.offsetLeft-kn)<1){Pt(!0),Tt();return}pi("auto")},bn=(A,ae="smooth")=>{const he=Ve.current;if(!he||t.length===0)return;const Pe=Dt(A,he.scrollLeft),je=lt.current[Pe];je&&(ae==="smooth"?Me.current=A:Me.current=null,I.current=A,ce(A),Ct(!0),dn(je.offsetLeft,{behavior:ae,activeIndex:A,onComplete:ae==="smooth"?Vt:void 0}))},gi=()=>{Ge.current&&(window.removeEventListener("pointerup",Ge.current),window.removeEventListener("pointercancel",Ge.current),Ge.current=null)},eo=(A,ae,he,Pe,je)=>{const mt=he-A,Ht=Pe-ae,qt=Math.abs(mt),sn=Math.abs(Ht);if(qt<Wx||qt<=sn)return!1;const en=mt<0?1:-1,mi=rt?(je+en+t.length)%t.length:Math.max(0,Math.min(t.length-1,je+en));return mi===je?!1:(bn(mi),!0)},Sn=A=>{if(!tt.current.isActive)return;gi();const ae=Ve.current;if(!ae)return;const{scrollLeft:he,startActiveIndex:Pe,hasMoved:je}=tt.current,mt=ae.scrollLeft;jt(!0),tt.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},nt(!1),A!==void 0&&ae.hasPointerCapture(A)&&ae.releasePointerCapture(A),je?Kn(he,"smooth",Pe,mt):(Pt(!0),Tt()),Wt()},Qn=(A,ae)=>{const he=ht.current;ht.current=null,he&&(eo(he.startX,he.startY,A,ae,he.startActiveIndex),Wt())},to=A=>{if(!ve)return;if(A.pointerType==="touch"){if(on(),Pt(!0),yt(A.target))return;ht.current={startX:A.clientX,startY:A.clientY,startActiveIndex:I.current};return}if(A.pointerType!=="mouse"||A.button!==0||yt(A.target))return;const ae=Ve.current;if(!ae)return;on(),Zt(),xn(),Me.current=null,tt.current={isActive:!0,startX:A.clientX,scrollLeft:ae.scrollLeft,startActiveIndex:I.current,hasMoved:!1},Pt(!1),Wt(),ae.setPointerCapture(A.pointerId),gi();const he=Pe=>{Pe.pointerType==="mouse"&&Sn(Pe.pointerId)};Ge.current=he,window.addEventListener("pointerup",he),window.addEventListener("pointercancel",he)},no=A=>{if(!ve||A.pointerType!=="mouse")return;const ae=Ve.current;if(!ae||!tt.current.isActive)return;if(A.buttons===0){Sn(A.pointerId);return}const he=A.clientX-tt.current.startX;Math.abs(he)>Hx&&(tt.current.hasMoved=!0,nt(!0)),tt.current.hasMoved&&(A.preventDefault(),ae.scrollLeft=tt.current.scrollLeft-he,jt(!0),Tt(),Wt())},we=A=>{if(ve){if(A.pointerType==="touch"){A.type==="pointerup"?Qn(A.clientX,A.clientY):ht.current=null;return}A.pointerType==="mouse"&&Sn(A.pointerId)}},qe=A=>{!ve||A.pointerType!=="mouse"||Sn(A.pointerId)};return jl(),s.useEffect(()=>{const A=requestAnimationFrame(()=>Lt(!0));return()=>{cancelAnimationFrame(A),Zt(),gi(),Oe.current!==null&&(cancelAnimationFrame(Oe.current),Oe.current=null),Qe.current&&clearTimeout(Qe.current),kt.current&&clearTimeout(kt.current)}},[]),s.useEffect(()=>{if(!me){Ft(!0);return}Wt();const A=()=>Wt();return document.addEventListener("pointermove",A,{passive:!0}),document.addEventListener("pointerdown",A,{passive:!0}),()=>{document.removeEventListener("pointermove",A),document.removeEventListener("pointerdown",A),kt.current&&clearTimeout(kt.current)}},[me,Wt]),s.useEffect(()=>{const A=ae=>{ae.key==="Escape"&&At()};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[At]),s.useLayoutEffect(()=>{Ot()},[f,t.length,rt]),s.useLayoutEffect(()=>{o||bn(I.current,"auto")},[f,o]),s.useLayoutEffect(()=>{bn(0,"auto")},[t.length,rt]),s.useEffect(()=>{const A=Ve.current;if(!A||o||!ie)return;const ae=he=>{if(he.preventDefault(),Math.abs(he.deltaY)<=Math.abs(he.deltaX))return;const Pe=he.deltaMode===1?Nx:he.deltaMode===2?A.clientHeight:1,je=he.deltaY*Pe*Fx;if(je!==0){if(Zt(),ct.current||(ct.current=!0,He.current=A.scrollLeft,Me.current=null,Pt(!1)),He.current+=je,!rt){const mt=A.scrollWidth-A.clientWidth;He.current=Math.max(0,Math.min(mt,He.current))}Wt(),Xe.current===null&&(Xe.current=requestAnimationFrame(Wn))}};return A.addEventListener("wheel",ae,{passive:!1}),()=>{A.removeEventListener("wheel",ae),on()}},[o,ie,rt]),s.useEffect(()=>{const A=Ve.current;if(!A)return;const ae=()=>{jt(tt.current.isActive);const Pe=A.scrollLeft,je=Pe-Ne.current;Ne.current=Pe;const mt=Ke.current>0?Ke.current*.5:1/0;if(je!==0&&Math.abs(je)<mt){const Ht=je>0?"forward":"backward";Ht!==be.current&&(be.current=Ht,Be(Ht))}tt.current.isActive&&tt.current.hasMoved||Tt()};A.addEventListener("scroll",ae,{passive:!0});const he=new ResizeObserver(()=>{Ot(),jt(tt.current.isActive),Be(be.current),Tt()});return he.observe(A),()=>{Zt(),A.removeEventListener("scroll",ae),he.disconnect()}},[t.length,rt]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ut||At()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:bt?1:0,transition:`opacity ${cr}ms ease`,pointerEvents:bt?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:c,...it}}),a.jsxs("div",{ref:_e,className:`${e}-lightbox-dismiss-area`,style:Xt,...Qt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Nt,onClick:A=>A.stopPropagation(),children:a.jsx("div",{ref:Ve,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":ve&&t.length>0?"true":"false","data-mouse-dragging":It?"true":"false",onPointerDown:to,onPointerMove:no,onPointerUp:we,onPointerCancel:we,onLostPointerCapture:qe,children:a.jsx("div",{ref:Je,className:`${e}-lightbox-strip-track`,style:{gap:f},children:pt.map((A,ae)=>{const he=A.image.objectFit??"contain",Pe=ae%t.length,je=Math.floor(ae/t.length),mt=Ur(f),Ht=`calc(-0.5 * (${mt} + ${f}))`;return a.jsxs("div",{ref:qt=>lt.current[ae]=qt,className:`${e}-strip-item`,style:{height:Q==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:A.image.assetId,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:he}}),o&&Pe<t.length-1&&je===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Ht,width:mt,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${je}-${A.image.assetId}-${Pe}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":Bt?"true":"false",style:$t,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:K,flexShrink:0,pointerEvents:"none"},children:o&&a.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-handle-left-fraction":"0.05",style:{position:"absolute",left:0,right:0,top:0,height:G,pointerEvents:"auto",zIndex:3}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:a.jsx("div",{className:`${e}-lightbox-content-area${pe?` ${e}-lightbox-content-area-stacked`:""}`,children:($e||x)&&a.jsx("div",{className:`${e}-header ${pe?`${e}-header-two-row`:`${e}-header-single-row`}`,children:pe?gt():$e||x?dt():null})})})]}),t.length>1&&_==="on"&&(()=>{const A=Ur(M),ae=`calc(-0.5 * (${M} + ${A}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:M},children:a.jsx("div",{ref:et,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:he=>he.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":L,style:{gap:U,"--thumbnail-active-color":P},children:[t.map((he,Pe)=>{const je=Ur(U),mt=`calc(-0.5 * (${je} + ${U}))`;return a.jsxs("div",{ref:Ht=>{ot.current[Pe]=Ht},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":k===Pe?"true":"false",onClick:()=>ie&&S==="click"&&bn(Pe),onMouseEnter:()=>Ee&&S==="hover"&&bn(Pe),"aria-label":he.image.name?`View ${he.image.name}`:`View image ${Pe+1}`,"aria-current":k===Pe?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${Re?` ${e}-thumb-image-cover`:""}`,src:he.image.assetId,alt:"",draggable:!1,style:{...Ce,maxWidth:z,maxHeight:z,width:v.display==="cover"?"auto":"100%",height:"auto",objectFit:v.display==="cover"?"cover":"contain"}})}),o&&Pe<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:mt,width:je,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${he.image.assetId}-${Pe}`)}),o&&a.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:ae,height:A,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function Kx(e){return`
|
|
14589
|
+
`;function yi(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const nd={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Sx=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],wx={type:"object",version:1,content:{type:"array",display:{type:"array"},items:{type:"object",properties:{question:{type:"string",label:"Question",placeholder:"Add question...",display:{type:"text-input"}},answer:{label:"Answer",placeholder:"Add answer...",display:{type:"rich-text"}}}},default:[{question:"What are the three main parts of The Divine Comedy?",answer:[{type:"paragraph",children:[{text:"The poem is divided into Inferno, Purgatorio, and Paradiso. These three sections follow Dante’s journey through Hell, Purgatory, and Heaven."}]}]},{question:"Who guides Dante through Hell and most of Purgatory?",answer:[{type:"paragraph",children:[{text:"Dante is guided by Virgil, the ancient Roman poet. Virgil represents human reason and wisdom, but because he lived before Christianity, he cannot guide Dante all the way into Heaven."}]}]},{question:"What does the dark wood at the beginning of the poem symbolize?",answer:[{type:"paragraph",children:[{text:"The dark wood symbolizes Dante’s spiritual confusion and moral crisis. It shows that he has lost the “straight way” in life and needs guidance to return to truth and salvation."}]}]},{question:"What is “contrapasso” in Inferno?",answer:[{type:"paragraph",children:[{text:"“Contrapasso” is the principle that punishments in Hell reflect the sins committed during life. For example, people who caused division are themselves physically divided, showing how their punishment mirrors their wrongdoing."}]}]},{question:"Who guides Dante through Heaven?",answer:[{type:"paragraph",children:[{text:"Beatrice guides Dante through Paradiso. She represents divine love, grace, and spiritual understanding, helping Dante move beyond human reason toward a vision of God."}]}]},{question:"Why is The Divine Comedy important in literary history?",answer:[{type:"paragraph",children:[{text:"The Divine Comedy is important because it is one of the greatest works of world literature and helped shape the Italian language. Dante wrote it in the Tuscan dialect rather than Latin, making serious literature more accessible to ordinary readers."}]}]},{question:"What is the overall journey of The Divine Comedy about?",answer:[{type:"paragraph",children:[{text:"The poem is about Dante’s spiritual journey from sin and despair toward repentance, wisdom, and union with God. On a deeper level, it represents the soul’s path from confusion to divine truth."}]}]}]},settings:{sizing:"auto",properties:{wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},cellMinHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},dividerWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},dividerStyle:{type:"string",scope:"common",title:"Style",display:{type:"toggle-cycle",enum:["solid","dashed","dotted"]}},entryHoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["none","default"]}},autoclose:{type:"string",scope:"common",title:"Autoclose",display:{type:"toggle-cycle",enum:["on","off"]}},icon:{type:["string","null"],scope:"common",display:{type:"settings-image-input"}},iconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"numeric-input"},min:0,max:9999},iconPaddingRight:yi("Icon Padding Right"),iconAnimation:{type:"string",scope:"common",title:"Icon Animation",display:{type:"toggle-cycle",enum:["rotate 180","rotate 90","rotate 45"]}},questionColor:{type:"string",scope:"common",title:"Question Default",display:{type:"palette-color-picker"}},answerColor:{type:"string",scope:"common",title:"Answer Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"palette-color-picker"}},questionHoverColor:{type:"string",scope:"common",title:"Question Hover",display:{type:"palette-color-picker"}},iconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"palette-color-picker"}},iconActiveColor:{type:"string",scope:"common",title:"Icon Active",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}},questionFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},questionFontSettings:{...nd.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},questionFontSize:{type:"number",scope:"layout",title:"Question Font Size",display:{type:"font-size"}},questionLineHeight:{type:"number",scope:"layout",title:"Question Line Height",display:{type:"line-height-input"}},questionLetterSpacing:{type:"number",scope:"layout",title:"Question Letter Spacing",display:{type:"letter-spacing-input"}},questionWordSpacing:{type:"number",scope:"layout",title:"Question Word Spacing",display:{type:"word-spacing-input"}},questionTextAppearance:{type:"object",scope:"layout",title:"Question Text Appearance",display:{type:"text-appearance"}},answerFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},answerFontSettings:{...nd.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},answerFontSize:{type:"number",scope:"layout",title:"Answer Font Size",display:{type:"font-size"}},answerLineHeight:{type:"number",scope:"layout",title:"Answer Line Height",display:{type:"line-height-input"}},answerLetterSpacing:{type:"number",scope:"layout",title:"Answer Letter Spacing",display:{type:"letter-spacing-input"}},answerWordSpacing:{type:"number",scope:"layout",title:"Answer Word Spacing",display:{type:"word-spacing-input"}},answerTextAppearance:{type:"object",scope:"layout",title:"Answer Text Appearance",display:{type:"text-appearance"}},questionPaddingLeft:yi("Question Padding Left"),questionPaddingTop:yi("Question Padding Top"),questionPaddingBottom:yi("Question Padding Bottom"),answerPaddingLeft:yi("Answer Padding Left"),answerPaddingRight:yi("Answer Padding Right"),answerPaddingTop:yi("Answer Padding Top"),answerPaddingBottom:yi("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"01M3QM74XGFBPMXNEQB1BXSD9E",iconAnimation:"rotate 45",questionColor:"#000000",answerColor:"#000000",dividerColor:"#000000",iconColor:"#000000",questionHoverColor:"#A60239",iconHoverColor:"#A60239",iconActiveColor:"#000000",dividerHoverColor:"#A60239",questionFontFamily:"Goudy Bookletter 1911",questionFontSettings:{fontWeight:400,fontStyle:"normal"},questionLetterSpacing:0,questionWordSpacing:0,questionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},answerFontFamily:"Goudy Bookletter 1911",answerFontSettings:{fontWeight:400,fontStyle:"normal"},answerLetterSpacing:0,answerWordSpacing:0,answerTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{wrapperWidth:1,cellMinHeight:0,dividerWidth:.008,iconMaxWidth:.0533,iconPaddingRight:.08,questionFontSize:.09066,questionLineHeight:.10133,questionLetterSpacing:-.00266,answerFontSize:.0533,answerLineHeight:.064,questionPaddingLeft:.0533,questionPaddingTop:.0533,questionPaddingBottom:.0533,answerPaddingLeft:.0533,answerPaddingRight:.16,answerPaddingTop:.0533,answerPaddingBottom:.0533},t:{wrapperWidth:.651041,cellMinHeight:0,dividerWidth:.00390625,iconMaxWidth:.02604166,iconPaddingRight:.0130208,questionFontSize:.0390625,questionLineHeight:.04427,questionLetterSpacing:-.00091145833,answerFontSize:.0234375,answerLineHeight:.026041,questionPaddingLeft:0,questionPaddingTop:.01302,questionPaddingBottom:.01302,answerPaddingLeft:.065104,answerPaddingRight:.09765625,answerPaddingTop:.026041,answerPaddingBottom:.026041},d:{wrapperWidth:.6388,cellMinHeight:0,dividerWidth:.002083,iconMaxWidth:.01388,iconPaddingRight:.01388,questionFontSize:.0333,questionLineHeight:.0333,questionLetterSpacing:-9e-4,answerFontSize:.01111,answerLineHeight:.01388,questionPaddingLeft:0,questionPaddingTop:.01111,questionPaddingBottom:.01111,answerPaddingLeft:.0625,answerPaddingRight:.1625,answerPaddingTop:0,answerPaddingBottom:.01111}},layout:["__componentName__","wrapperWidth","cellMinHeight","dividerWidth","dividerStyle","entryHoverEffect","autoclose","icon","iconMaxWidth","iconAnimation"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["wrapperWidth","cellMinHeight"]},{type:"row",title:"",items:["entryHoverEffect","autoclose"]},{type:"row",title:"Divider",items:["dividerWidth","dividerStyle"]},{type:"row",title:"Icon",items:["icon","iconMaxWidth"]},{type:"row",title:"",items:["iconAnimation"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Question",items:["questionFontFamily","questionFontSettings",{type:"row",items:["questionFontSize","questionLineHeight","questionLetterSpacing","questionWordSpacing"]},"questionTextAppearance"]},{type:"group",title:"Answer",items:["answerFontFamily","answerFontSettings",{type:"row",items:["answerFontSize","answerLineHeight","answerLetterSpacing","answerWordSpacing"]},"answerTextAppearance"]}]}],paletteBookmark:{items:[...Sx],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},$x={element:xx,id:"faq",name:"FAQ",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/FAQ_List.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"questionFontFamily"},{path:"answerFontFamily"}]},fontRelations:{questionFontSettings:"questionFontFamily",answerFontSettings:"answerFontFamily"},schema:wx,sourceCode:bx},li=e=>e.display==="cover",ja=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},id=100,Cx=.2,od=8,bp=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,r]=s.useState(0),[l,c]=s.useState(!1),d=s.useRef(null),u=s.useRef(0);u.current=o;const p=s.useMemo(()=>typeof window>"u"?id:Math.max(id,window.innerHeight*Cx),[]),y=s.useCallback(C=>Math.max(0,1-C/(p*1.5)),[p]),x=s.useCallback(C=>Math.max(0,1-C/(p*.45)),[p]),g=s.useCallback(C=>{const $=typeof window<"u"?window.innerHeight:800,Q=Math.max(.88,1-C/$*.12);return`translateY(${C}px) scale(${Q})`},[]),h=s.useCallback(()=>{d.current=null},[]),b=s.useCallback(()=>{c(!0),r(0),window.setTimeout(()=>c(!1),n),h()},[n,h]),S=s.useCallback(()=>{const C=typeof window<"u"?window.innerHeight:800;c(!0),r(C),window.setTimeout(()=>{t(),h(),c(!1)},Math.min(n,200))},[n,t,h]),_=s.useCallback(C=>{!e||l||C.pointerType==="touch"&&(i!=null&&i(C.target)||(d.current={startX:C.clientX,startY:C.clientY,isLocked:null,pointerId:C.pointerId}))},[e,l,i]),v=s.useCallback(C=>{const $=d.current;if(!e||!$||C.pointerType!=="touch"||$.pointerId!==C.pointerId)return;const Q=C.clientX-$.startX,R=C.clientY-$.startY;if($.isLocked===null){if(Math.abs(Q)<od&&Math.abs(R)<od)return;if(R>0&&R>Math.abs(Q))$.isLocked=!0,C.currentTarget.setPointerCapture(C.pointerId);else{$.isLocked=!1,h();return}}if(!$.isLocked)return;C.preventDefault();const T=Math.max(0,R);u.current=T,r(T)},[e,h]),L=s.useCallback(C=>{const $=d.current;if(!e||!$||C.pointerType!=="touch"||$.pointerId!==C.pointerId)return;const Q=$.isLocked===!0;if(C.currentTarget.hasPointerCapture(C.pointerId)&&C.currentTarget.releasePointerCapture(C.pointerId),!Q){h();return}C.clientY-$.startY>=p?S():b()},[p,S,e,h,b]),P=s.useCallback(C=>{L(C)},[L]),q=s.useCallback(C=>{L(C)},[L]),X=o>0,B=l?`transform ${n}ms ease`:"none",H=l?`opacity ${n}ms ease`:"none",O=o>0||l;return{isSwipeDragging:X,backdropStyle:{opacity:y(o),transition:H},mediaAreaStyle:{transform:g(o),transition:B,touchAction:X?"none":void 0,willChange:X?"transform":void 0},overlayContentStyle:O?{opacity:x(o),transition:H}:void 0,swipeHandlers:e?{onPointerDown:_,onPointerMove:v,onPointerUp:P,onPointerCancel:q}:{},dismissAreaStyle:e?{touchAction:X?"none":"pan-x"}:void 0}},Tx="[data-lightbox-scrollable]",jl=(e=!0)=>{s.useEffect(()=>{if(!e)return;const t=window.scrollY,n=document.body.style.overflow,i=document.body.style.position,o=document.body.style.top,r=document.body.style.width,l=document.documentElement.style.overflow;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${t}px`,document.body.style.width="100%",document.documentElement.style.overflow="hidden";const c=d=>{const u=d.target;u instanceof Element&&u.closest(Tx)||d.preventDefault()};return document.addEventListener("touchmove",c,{passive:!1}),()=>{document.removeEventListener("touchmove",c),document.body.style.overflow=n,document.body.style.position=i,document.body.style.top=o,document.body.style.width=r,document.documentElement.style.overflow=l,window.scrollTo({top:t,left:0,behavior:"instant"})}},[e])},Ix=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Lx=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Px=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Mx=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,c=n-l,d=l-n,u=(h,b)=>{Lx(t),e.scrollLeft=h,b&&(r==null||r())};if(Math.abs(c)<.5)return u(n,!0),()=>{};let p=!1,y=0;const x=()=>{t.removeEventListener("transitionend",g),clearTimeout(y)},g=h=>{h.target!==t||h.propertyName!=="transform"||p||(p=!0,x(),u(n,!0))};return t.addEventListener("transitionend",g),t.style.willChange="transform",t.style.transition="none",t.style.transform="translate3d(0, 0, 0)",t.offsetHeight,t.style.transition=`transform ${i}ms ${o}`,t.style.transform=`translate3d(${d}px, 0, 0)`,y=window.setTimeout(()=>{p||(p=!0,x(),u(n,!0))},i+64),()=>{p||(p=!0,x(),u(l-Px(t),!1))}},cr=300,Rx=900,Ex=1500,kx="cubic-bezier(0.16, 1, 0.3, 1)",Ax=3e3,Fx=2,Nx=16,_x=.05,Hx=1,Xr=.3,Wx=50,Ox=20,ao=.004,No=["title1","title2","title3"],Dx={title1:"1",title2:"2",title3:"3"},zx={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Bx={title1:.02,title2:.02,title3:.02},Ur=e=>`max(${e}, ${Ox}px)`,jx=e=>{if(!Array.isArray(e)||e.length===0)return{};const t=e.find(o=>(o==null?void 0:o.type)==="paragraph")??e[0],n=t==null?void 0:t.children;if(!Array.isArray(n))return{};const i=n.map(o=>typeof(o==null?void 0:o.text)=="string"?o.text.trim():"").filter(Boolean);return{title1:i[0],title2:i[1],title3:i[2]}},Vx=e=>{if(!e)return{title1:"",title2:"",title3:""};if(e.title1||e.title2||e.title3)return{title1:e.title1??"",title2:e.title2??"",title3:e.title3??""};const t=jx(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Jt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Gx=e=>[Jt(e,"fontFamily"),Jt(e,"fontSettings"),{type:"row",items:[Jt(e,"fontSize"),Jt(e,"lineHeight"),Jt(e,"letterSpacing"),Jt(e,"wordSpacing")]},Jt(e,"textAlign"),Jt(e,"textAppearance")],Xx=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(No.map(e=>[Dx[e],Gx(e)]))}),Vl=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((r,l)=>r+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:r,widths:l},c)=>{if(r<=0||c<=0)return{overflow:r,widths:[c,...l]};const d=Math.min(r,c);return{overflow:r-d,widths:[c-d,...l]}},{overflow:i-1,widths:[]});return o},Sp=(e,t)=>Vl(e,t),qr=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},rd=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Vl(e.length,n),effective:Sp(e.length,n)}},Ux=(e,t,n,i,o,r,l)=>{const c=[];return t&&c.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:o,text:t}),n&&c.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:r,text:n}),i&&c.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:l,text:i}),c},ms=(e,t)=>{const n=i=>{const o=Jt(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[zx[t]]}},qx=(e,t,n,i)=>e.slice(0,i).reduce((o,r,l)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[l]??0),0),hs=(e,t,n)=>{var o,r;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((r=t.fontSettings)==null?void 0:r.fontStyle)??"normal"},fontSize:t.fontSize??Bx[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return nn(i,n)},Yx=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:c,thumbnailSize:d,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:y,closeIcon:x,closeIconMaxWidth:g,closeIconColor:h,closeIconHoverColor:b,thumbnailTrigger:S,thumbnailVisibility:_,thumbnailObjectFit:v,thumbnailActive:L,thumbnailActiveColor:P,title1Width:q,title2Width:X,title3Width:B,title1MarginLeft:H=0,title2MarginLeft:O=0,title3MarginLeft:C=0,titleRowMarginBottom:$=0,titleHeaderLayout:Q="desktop",contentMarginTop:R,iconMarginLeft:T}=n,w=A=>E.scalingValue(A,i??!1),V=d??n.thumnailSize??.03,z=w(V),U=w(u),M=w(p??.02),f=w(y??0),K=w(R??0),G=Ur(K),ge=w(T??0),[k,ce]=s.useState(0),I=s.useRef(k);I.current=k;const ue=t[k],{title1:ee,title2:xe,title3:Le}=Vx(ue),se=hs("title1",ms(n,"title1"),i),de=hs("title2",ms(n,"title2"),i),Z=hs("title3",ms(n,"title3"),i),pe=Q==="mobile",ie=!o&&(!i||r),me=ie,ve=ie,Ee=ie,Re=li(v),Ce=Re?{"--image-aspect-ratio":ja(v)}:void 0,$e=!!(ee||xe||Le),m=s.useMemo(()=>Ux(e,ee,xe,Le,se,de,Z),[e,k,ee,xe,Le,se,de,Z]),Y=s.useMemo(()=>({title1Width:q,title2Width:X,title3Width:B}),[q,X,B]),te=s.useMemo(()=>m.map(A=>Y[A.widthKey]),[m,Y]),oe=s.useMemo(()=>Vl(m.length,te),[m.length,te]),fe=s.useMemo(()=>Sp(m.length,te),[m.length,te]),N=s.useMemo(()=>m.filter(A=>A.prefix==="title1"),[m]),F=s.useMemo(()=>m.filter(A=>A.prefix==="title2"||A.prefix==="title3"),[m]),ne=s.useMemo(()=>rd(N,Y),[N,Y]),re=s.useMemo(()=>rd(F,Y),[F,Y]),J=s.useCallback((A,ae)=>{const he=m.indexOf(A);if(!pe||ae==="single-row")return{effectiveWidth:fe[he]??0,resolvedWidth:oe[he]??0,maxWidth:qr(he,oe)};if(ae==="two-row-top"){const je=N.indexOf(A);return{effectiveWidth:ne.effective[je]??0,resolvedWidth:ne.resolved[je]??0,maxWidth:qr(je,ne.resolved)}}const Pe=F.indexOf(A);return{effectiveWidth:re.effective[Pe]??0,resolvedWidth:re.resolved[Pe]??0,maxWidth:qr(Pe,re.resolved)}},[F,re,fe,oe,m,N,ne,pe]),W=s.useCallback(A=>E.scalingValue(A,i??!1),[i]),Se=W($??0),le=s.useMemo(()=>({title1MarginLeft:H,title2MarginLeft:O,title3MarginLeft:C}),[H,O,C]),j=s.useCallback(A=>m.slice(0,A+1).reduce((ae,he,Pe)=>ae+(he!=null&&he.marginLeftKey?le[he.marginLeftKey]??0:0)+(oe[Pe]??0),0)+(pe?0:H??0),[m,le,oe,pe,H]),Te=s.useCallback(()=>pe?0:H??0,[pe,H]),Fe=s.useCallback(A=>F.slice(0,A).reduce((ae,he,Pe)=>ae+(he.marginLeftKey?le[he.marginLeftKey]??0:0)+(re.resolved[Pe]??0),0),[F,re.resolved,le]),Ye=s.useCallback(A=>{const ae=F[A];return Fe(A)+(ae.marginLeftKey?le[ae.marginLeftKey]??0:0)+(re.resolved[A]??0)},[F,re.resolved,Fe,le]),De=(A,ae)=>{const he=A.marginLeftKey?le[A.marginLeftKey]??0:0,{effectiveWidth:Pe,resolvedWidth:je,maxWidth:mt}=J(A,ae),Ht=o&&ae==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":A.prefix,style:{...ae==="single-row"?{gridArea:A.prefix}:{},width:W(Pe),...he>0?{marginLeft:W(he)}:{}},children:[a.jsx("p",{className:A.className,style:A.style,children:A.text}),Ht&&A.marginLeftKey&&a.jsx("div",{"data-controls":A.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:W(-he),width:`max(${W(he)}, 10px)`,height:"100%",pointerEvents:"auto"}}),Ht&&a.jsx("div",{"data-controls":A.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(mt),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:W(-ao/2),width:W(ao),height:"100%",pointerEvents:"auto"}})]},A.className)},ze=()=>{const A=pe?-1:m.findIndex(Pe=>Pe.prefix==="title1"),ae=!pe&&(o||(H??0)>0)?(()=>{const Pe=H??0,je=A>=0?oe[A]:q??0;return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:0,width:`max(${W(Pe)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,he=m.flatMap((Pe,je)=>{if(!Pe.marginLeftKey)return[];const mt=le[Pe.marginLeftKey]??0,Ht=qx(m,oe,le,je)+Te();return a.jsx("div",{"data-controls":Pe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(oe[je]),style:{position:"absolute",top:0,left:W(Ht),width:`max(${W(mt)}, 10px)`,height:"100%",pointerEvents:"auto"}},Pe.marginLeftKey)});return ae?[ae,...he]:he},Ze=()=>m.map((A,ae)=>{const he=qr(ae,oe),je=j(ae)-ao/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":A.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(he),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:W(je),width:W(ao),height:"100%",pointerEvents:"auto"}})},`${A.widthKey}-junction`)}),Ue=()=>F.flatMap((A,ae)=>{if(!A.marginLeftKey)return[];const he=le[A.marginLeftKey]??0,Pe=Fe(ae),{resolvedWidth:je}=J(A,"two-row-bottom");return a.jsx("div",{"data-controls":A.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:W(Pe),width:`max(${W(he)}, 10px)`,height:"100%",pointerEvents:"auto"}},A.marginLeftKey)}),ye=()=>F.map((A,ae)=>{const{maxWidth:he}=J(A,"two-row-bottom"),je=Ye(ae)-ao/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":A.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(he),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:W(je),width:W(ao),height:"100%",pointerEvents:"auto"}})},`${A.widthKey}-junction`)}),_e=s.useRef(null),Ve=s.useRef(null),Je=s.useRef(null),et=s.useRef(null),ot=s.useRef([]),lt=s.useRef([]),Ke=s.useRef(0),ht=s.useRef(null),tt=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),Ge=s.useRef(null),We=s.useRef(null),Ne=s.useRef(0),be=s.useRef("forward"),He=s.useRef(0),Xe=s.useRef(null),ct=s.useRef(!1),rt=t.length>1&&(!o||!!r),xt=rt?3:1,pt=s.useMemo(()=>Array.from({length:xt},()=>t).flat(),[t,xt]),[It,nt]=s.useState(!1),[bt,Lt]=s.useState(!1),[Ut,Ft]=s.useState(!0),Me=s.useRef(null),Oe=s.useRef(null),St=s.useRef(!1),Mt=s.useRef(!1),Qe=s.useRef(null),kt=s.useRef(null),Bt=me&&!Ut,Wt=s.useCallback(()=>{me&&(Ft(!0),kt.current&&clearTimeout(kt.current),kt.current=setTimeout(()=>{tt.current.isActive||Ft(!1)},Ax))},[me]),At=s.useCallback(()=>{o||Mt.current||(Mt.current=!0,Lt(!1),Qe.current=setTimeout(()=>{l()},cr))},[o,l]),Ae=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":Bt?"true":"false",style:{width:E.scalingValue(g??0,i),height:E.scalingValue(g??0,i),marginRight:ge,"--close-icon-hover-color":b},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:At,"aria-label":"Close",children:a.jsx(gn,{url:x,fill:h,hoverFill:i&&!r?h:b,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ge,height:"100%",pointerEvents:"auto"}})]}),ft=(A="two-row")=>a.jsx("div",{...A==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:W(H??0),flexShrink:0,...A==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...A==="two-row"&&o?{pointerEvents:"auto"}:{}}}),gt=()=>{const A=m.find(Pe=>Pe.prefix==="title1"),ae=m.filter(Pe=>Pe.prefix==="title2"||Pe.prefix==="title3"),he=ae.length>0||o||($??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(H??0)>0||o?ft():null,A&&De(A,"two-row-top"),x&&Ae()]}),he?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[ae.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[ae.map(Pe=>De(Pe,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[Ue(),ye()]})]}):null,a.jsx("div",{"data-controls":o?"titleRowMarginBottom":void 0,"data-controls-axis":o?"y":void 0,"data-controls-reverse":o?"":void 0,className:o?`${e}-control`:void 0,style:{height:Se,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},dt=()=>a.jsxs(a.Fragment,{children:[(H??0)>0||o?ft("single-row"):null,m.map(A=>De(A,"single-row")),o?a.jsxs(a.Fragment,{children:[ze(),Ze()]}):null,x?Ae():null]}),yt=s.useCallback(A=>!!(A.closest("[data-controls]")||A.closest(`.${e}-thumbnails`)||A.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ut,backdropStyle:it,mediaAreaStyle:Nt,overlayContentStyle:$t,swipeHandlers:Qt,dismissAreaStyle:Xt}=bp({enabled:ie??!1,onClose:At,animMs:cr,isBlockedTarget:yt}),Dt=()=>{if(!rt||t.length===0)return Ke.current=0,0;const A=lt.current[0],ae=lt.current[t.length];if(!A||!ae)return Ke.current;const he=ae.offsetLeft-A.offsetLeft;return he>0&&(Ke.current=he),Ke.current},jt=(A=!1)=>{if(!rt)return;const ae=Ve.current,he=Dt();!ae||he<=0||he<ae.clientWidth*.25||(ae.scrollLeft<=0?(ae.scrollLeft+=he,A&&(tt.current.scrollLeft+=he),ct.current&&(He.current+=he)):ae.scrollLeft>=he*2&&(ae.scrollLeft-=he,A&&(tt.current.scrollLeft-=he),ct.current&&(He.current-=he)))},Ot=(A,ae=(he=>(he=Ve.current)==null?void 0:he.scrollLeft)()??0)=>{if(!rt)return A;let Pe=t.length+A,je=1/0;for(let mt=0;mt<xt;mt++){const Ht=mt*t.length+A,qt=lt.current[Ht];if(!qt)continue;const sn=Math.abs(qt.offsetLeft-ae);sn<je&&(je=sn,Pe=Ht)}return Pe},zt=A=>{const ae=Ve.current;return!A||!ae?!1:A.offsetWidth>ae.clientWidth+1},D=A=>{const ae=Ve.current;if(!A||!ae||!zt(A))return!1;const he=A.offsetLeft,Pe=he+A.offsetWidth;return ae.scrollLeft>=he-1&&ae.scrollLeft+ae.clientWidth<=Pe+1},Ie=(A=(ae=>(ae=Ve.current)==null?void 0:ae.scrollLeft)()??0)=>{for(let Pe=0;Pe<lt.current.length;Pe+=1){const je=lt.current[Pe];if(je&&D(je))return Pe}let he={flatIndex:0,distance:1/0};return lt.current.forEach((Pe,je)=>{if(!Pe)return;const mt=Math.abs(Pe.offsetLeft-A);mt<he.distance&&(he={flatIndex:je,distance:mt})}),he.flatIndex},Be=A=>{Ve.current&<.current.forEach(ae=>{ae&&(ae.style.scrollSnapAlign=zt(ae)&&A==="backward"?"end":"start")})},ke=(A,ae,he)=>{const Pe=A-ae,je=Ie(ae),mt=lt.current[je];if(D(mt))return Ie(A)%t.length;const Ht=lt.current[je+1],qt=mt?Ht?Ht.offsetLeft-mt.offsetLeft:mt.offsetWidth:0,sn=qt>0?Pe>qt*Xr?1:Pe<-qt*Xr?-1:0:0;return sn===0?he:rt?(he+sn+t.length)%t.length:Math.max(0,Math.min(t.length-1,he+sn))},vt=s.useCallback((A=!1)=>{if(_!=="on"||o)return;const ae=et.current,he=I.current,Pe=ot.current[he];if(!ae||!Pe||ae.scrollWidth<=ae.clientWidth)return;const je=ae.scrollLeft,mt=je+ae.clientWidth,Ht=Pe.offsetLeft,qt=Ht+Pe.offsetWidth;if(Ht>=je&&qt<=mt)return;const sn=ae.scrollWidth-ae.clientWidth;let en=je;if(!A&&Me.current===null){const mi=ot.current[he-1],kn=ot.current[he+1],Zn=mi?Pe.offsetLeft-mi.offsetLeft:kn?kn.offsetLeft-Pe.offsetLeft:Pe.offsetWidth;qt>mt?en+=Zn:Ht<je&&(en-=Zn)}else qt>mt?en=qt-ae.clientWidth:en=Ht;ae.scrollLeft=Math.max(0,Math.min(sn,en))},[o,_]),Ct=s.useCallback((A=!1)=>{A&&(St.current=!0),Oe.current===null&&(Oe.current=requestAnimationFrame(()=>{Oe.current=null;const ae=St.current;St.current=!1,vt(ae)}))},[vt]),at=s.useCallback(A=>{if(A===I.current)return;const ae=I.current;I.current=A;const he=Math.abs(A-ae)>1,Pe=rt&&t.length>1&&(ae===t.length-1&&A===0||ae===0&&A===t.length-1);ce(A),Ct(he||Pe)},[t.length,rt,Ct]),Tt=()=>{if(!Ve.current||t.length===0||Me.current!==null||tt.current.isActive&&tt.current.hasMoved)return;const A=Ve.current.scrollLeft,ae=Ie(A)%t.length;ae!==I.current&&at(ae)},Vt=()=>{Me.current=null},Pt=A=>{const ae=Ve.current;ae&&(ae.style.scrollSnapType=A?"":"none")},Zt=()=>{var A;(A=We.current)==null||A.call(We),We.current=null},on=()=>{Xe.current!==null&&(cancelAnimationFrame(Xe.current),Xe.current=null),ct.current=!1},Wn=()=>{const A=Ve.current;if(!A){Xe.current=null,ct.current=!1;return}const ae=He.current-A.scrollLeft;if(Math.abs(ae)<.5){A.scrollLeft=He.current,jt(),Tt(),Xe.current=null,ct.current=!1;return}A.scrollLeft+=ae*_x,jt(),Tt(),Wt(),Xe.current=requestAnimationFrame(Wn)},xn=()=>{const A=Je.current;A&&(A.style.transition="",A.style.transform="",A.style.willChange="")},ui=(A,ae,he,Pe)=>{xn(),A.scrollLeft=ae,Ne.current=A.scrollLeft,jt(),he!==void 0?(I.current=he,ce(he)):Tt(),Pt(!0),Pe==null||Pe()},dn=(A,{behavior:ae="smooth",activeIndex:he,onComplete:Pe}={})=>{const je=Ve.current,mt=Je.current;if(!je||!mt)return;if(on(),Zt(),Pt(!1),ae==="auto"){ui(je,A,he,Pe);return}const Ht=Math.abs(A-je.scrollLeft),qt=Ix(Ht,Rx,Ex,je.clientWidth*.55);We.current=Mx(je,mt,A,{duration:qt,easing:kx,onComplete:()=>{We.current=null,ui(je,A,he,Pe)}})},pi=(A="smooth")=>{const ae=Ve.current;if(!ae||t.length===0)return;const he=Ie()%t.length,Pe=Ot(he,ae.scrollLeft),je=lt.current[Pe];je&&dn(je.offsetLeft,{behavior:A,activeIndex:he})},Kn=(A,ae="smooth",he,Pe)=>{const je=Ve.current;if(!je||t.length===0)return;const mt=(Pe??je.scrollLeft)-A,Ht=Ie(A),qt=lt.current[Ht];if(D(qt)){Pt(!0),Tt();return}const sn=lt.current[Ht+1],en=qt?sn?sn.offsetLeft-qt.offsetLeft:qt.offsetWidth:0;if((en>0?mt>en*Xr?1:mt<-en*Xr?-1:0:0)!==0){const Kl=he??Ht%t.length,Xo=ke(Pe??je.scrollLeft,A,Kl);bn(Xo,ae);return}const kn=Pe??je.scrollLeft,Zn=Ie(kn),kr=lt.current[Zn];if(kr&&Math.abs(kr.offsetLeft-kn)<1){Pt(!0),Tt();return}pi("auto")},bn=(A,ae="smooth")=>{const he=Ve.current;if(!he||t.length===0)return;const Pe=Ot(A,he.scrollLeft),je=lt.current[Pe];je&&(ae==="smooth"?Me.current=A:Me.current=null,I.current=A,ce(A),Ct(!0),dn(je.offsetLeft,{behavior:ae,activeIndex:A,onComplete:ae==="smooth"?Vt:void 0}))},gi=()=>{Ge.current&&(window.removeEventListener("pointerup",Ge.current),window.removeEventListener("pointercancel",Ge.current),Ge.current=null)},eo=(A,ae,he,Pe,je)=>{const mt=he-A,Ht=Pe-ae,qt=Math.abs(mt),sn=Math.abs(Ht);if(qt<Wx||qt<=sn)return!1;const en=mt<0?1:-1,mi=rt?(je+en+t.length)%t.length:Math.max(0,Math.min(t.length-1,je+en));return mi===je?!1:(bn(mi),!0)},Sn=A=>{if(!tt.current.isActive)return;gi();const ae=Ve.current;if(!ae)return;const{scrollLeft:he,startActiveIndex:Pe,hasMoved:je}=tt.current,mt=ae.scrollLeft;jt(!0),tt.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},nt(!1),A!==void 0&&ae.hasPointerCapture(A)&&ae.releasePointerCapture(A),je?Kn(he,"smooth",Pe,mt):(Pt(!0),Tt()),Wt()},Qn=(A,ae)=>{const he=ht.current;ht.current=null,he&&(eo(he.startX,he.startY,A,ae,he.startActiveIndex),Wt())},to=A=>{if(!ve)return;if(A.pointerType==="touch"){if(on(),Pt(!0),yt(A.target))return;ht.current={startX:A.clientX,startY:A.clientY,startActiveIndex:I.current};return}if(A.pointerType!=="mouse"||A.button!==0||yt(A.target))return;const ae=Ve.current;if(!ae)return;on(),Zt(),xn(),Me.current=null,tt.current={isActive:!0,startX:A.clientX,scrollLeft:ae.scrollLeft,startActiveIndex:I.current,hasMoved:!1},Pt(!1),Wt(),ae.setPointerCapture(A.pointerId),gi();const he=Pe=>{Pe.pointerType==="mouse"&&Sn(Pe.pointerId)};Ge.current=he,window.addEventListener("pointerup",he),window.addEventListener("pointercancel",he)},no=A=>{if(!ve||A.pointerType!=="mouse")return;const ae=Ve.current;if(!ae||!tt.current.isActive)return;if(A.buttons===0){Sn(A.pointerId);return}const he=A.clientX-tt.current.startX;Math.abs(he)>Hx&&(tt.current.hasMoved=!0,nt(!0)),tt.current.hasMoved&&(A.preventDefault(),ae.scrollLeft=tt.current.scrollLeft-he,jt(!0),Tt(),Wt())},we=A=>{if(ve){if(A.pointerType==="touch"){A.type==="pointerup"?Qn(A.clientX,A.clientY):ht.current=null;return}A.pointerType==="mouse"&&Sn(A.pointerId)}},qe=A=>{!ve||A.pointerType!=="mouse"||Sn(A.pointerId)};return jl(),s.useEffect(()=>{const A=requestAnimationFrame(()=>Lt(!0));return()=>{cancelAnimationFrame(A),Zt(),gi(),Oe.current!==null&&(cancelAnimationFrame(Oe.current),Oe.current=null),Qe.current&&clearTimeout(Qe.current),kt.current&&clearTimeout(kt.current)}},[]),s.useEffect(()=>{if(!me){Ft(!0);return}Wt();const A=()=>Wt();return document.addEventListener("pointermove",A,{passive:!0}),document.addEventListener("pointerdown",A,{passive:!0}),()=>{document.removeEventListener("pointermove",A),document.removeEventListener("pointerdown",A),kt.current&&clearTimeout(kt.current)}},[me,Wt]),s.useEffect(()=>{const A=ae=>{ae.key==="Escape"&&At()};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[At]),s.useLayoutEffect(()=>{Dt()},[f,t.length,rt]),s.useLayoutEffect(()=>{o||bn(I.current,"auto")},[f,o]),s.useLayoutEffect(()=>{bn(0,"auto")},[t.length,rt]),s.useEffect(()=>{const A=Ve.current;if(!A||o||!ie)return;const ae=he=>{if(he.preventDefault(),Math.abs(he.deltaY)<=Math.abs(he.deltaX))return;const Pe=he.deltaMode===1?Nx:he.deltaMode===2?A.clientHeight:1,je=he.deltaY*Pe*Fx;if(je!==0){if(Zt(),ct.current||(ct.current=!0,He.current=A.scrollLeft,Me.current=null,Pt(!1)),He.current+=je,!rt){const mt=A.scrollWidth-A.clientWidth;He.current=Math.max(0,Math.min(mt,He.current))}Wt(),Xe.current===null&&(Xe.current=requestAnimationFrame(Wn))}};return A.addEventListener("wheel",ae,{passive:!1}),()=>{A.removeEventListener("wheel",ae),on()}},[o,ie,rt]),s.useEffect(()=>{const A=Ve.current;if(!A)return;const ae=()=>{jt(tt.current.isActive);const Pe=A.scrollLeft,je=Pe-Ne.current;Ne.current=Pe;const mt=Ke.current>0?Ke.current*.5:1/0;if(je!==0&&Math.abs(je)<mt){const Ht=je>0?"forward":"backward";Ht!==be.current&&(be.current=Ht,Be(Ht))}tt.current.isActive&&tt.current.hasMoved||Tt()};A.addEventListener("scroll",ae,{passive:!0});const he=new ResizeObserver(()=>{Dt(),jt(tt.current.isActive),Be(be.current),Tt()});return he.observe(A),()=>{Zt(),A.removeEventListener("scroll",ae),he.disconnect()}},[t.length,rt]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ut||At()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:bt?1:0,transition:`opacity ${cr}ms ease`,pointerEvents:bt?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:c,...it}}),a.jsxs("div",{ref:_e,className:`${e}-lightbox-dismiss-area`,style:Xt,...Qt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Nt,onClick:A=>A.stopPropagation(),children:a.jsx("div",{ref:Ve,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":ve&&t.length>0?"true":"false","data-mouse-dragging":It?"true":"false",onPointerDown:to,onPointerMove:no,onPointerUp:we,onPointerCancel:we,onLostPointerCapture:qe,children:a.jsx("div",{ref:Je,className:`${e}-lightbox-strip-track`,style:{gap:f},children:pt.map((A,ae)=>{const he=A.image.objectFit??"contain",Pe=ae%t.length,je=Math.floor(ae/t.length),mt=Ur(f),Ht=`calc(-0.5 * (${mt} + ${f}))`;return a.jsxs("div",{ref:qt=>lt.current[ae]=qt,className:`${e}-strip-item`,style:{height:Q==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:A.image.assetId,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:he}}),o&&Pe<t.length-1&&je===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Ht,width:mt,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${je}-${A.image.assetId}-${Pe}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":Bt?"true":"false",style:$t,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:K,flexShrink:0,pointerEvents:"none"},children:o&&a.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-handle-left-fraction":"0.05",style:{position:"absolute",left:0,right:0,top:0,height:G,pointerEvents:"auto",zIndex:3}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:a.jsx("div",{className:`${e}-lightbox-content-area${pe?` ${e}-lightbox-content-area-stacked`:""}`,children:($e||x)&&a.jsx("div",{className:`${e}-header ${pe?`${e}-header-two-row`:`${e}-header-single-row`}`,children:pe?gt():$e||x?dt():null})})})]}),t.length>1&&_==="on"&&(()=>{const A=Ur(M),ae=`calc(-0.5 * (${M} + ${A}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:M},children:a.jsx("div",{ref:et,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:he=>he.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":L,style:{gap:U,"--thumbnail-active-color":P},children:[t.map((he,Pe)=>{const je=Ur(U),mt=`calc(-0.5 * (${je} + ${U}))`;return a.jsxs("div",{ref:Ht=>{ot.current[Pe]=Ht},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":k===Pe?"true":"false",onClick:()=>ie&&S==="click"&&bn(Pe),onMouseEnter:()=>Ee&&S==="hover"&&bn(Pe),"aria-label":he.image.name?`View ${he.image.name}`:`View image ${Pe+1}`,"aria-current":k===Pe?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${Re?` ${e}-thumb-image-cover`:""}`,src:he.image.assetId,alt:"",draggable:!1,style:{...Ce,maxWidth:z,maxHeight:z,width:v.display==="cover"?"auto":"100%",height:"auto",objectFit:v.display==="cover"?"cover":"contain"}})}),o&&Pe<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:mt,width:je,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${he.image.assetId}-${Pe}`)}),o&&a.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:ae,height:A,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function Kx(e){return`
|
|
14594
14590
|
.${e}-wrapper {
|
|
14595
14591
|
position: relative;
|
|
14596
14592
|
width: 100%;
|
|
@@ -15521,7 +15517,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
15521
15517
|
</>
|
|
15522
15518
|
);
|
|
15523
15519
|
};
|
|
15524
|
-
`,Jx="01M3SBP3P8CMVMM1ZZ0QVD2PPF",Di={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function eb(e){const t={};return t[Jt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Jt(e,"fontSettings")]={...Di.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Jt(e,"fontSize")]={...Di.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Jt(e,"lineHeight")]={...Di.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Jt(e,"letterSpacing")]={...Di.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Jt(e,"wordSpacing")]={...Di.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Jt(e,"textAlign")]={...Di.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Jt(e,"textAppearance")]={...Di.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const tb=No.reduce((e,t)=>({...e,...eb(t)}),{}),nb=No.reduce((e,t)=>({...e,[Jt(t,"fontFamily")]:"Goudy Bookletter 1911",[Jt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Jt(t,"letterSpacing")]:0,[Jt(t,"wordSpacing")]:0,[Jt(t,"textAlign")]:"left",[Jt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function fs(e){return No.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Jt(n,"fontSize")]=i),o!==void 0&&(t[Jt(n,"lineHeight")]=o),t},{})}const ib=Xx(),ob={type:"object",version:1,settings:{sizing:"auto manual",properties:{cover:{type:"string",scope:"common",title:"",display:{type:"settings-image-input"}},coverFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailSize:{type:"number",scope:"layout",title:"Thumbnail Size",min:0,display:{type:"range-control"}},thumbnailGap:{type:"number",scope:"layout",title:"Thumbnail Gap",min:0,display:{type:"range-control"}},thumbnailMarginBottom:{type:"number",scope:"layout",title:"Thumbnail Margin Bottom",min:0,display:{type:"range-control"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"layout",title:"BG Default",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"layout",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"layout",title:"Icon Hover",display:{type:"settings-color-picker"}},thumbnailVisibility:{type:"boolean",scope:"layout",title:"Visibility",display:{type:"toggle-cycle",enum:["on","off"]}},thumbnailObjectFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailTrigger:{type:"string",scope:"common",title:"Trigger",display:{type:"toggle-cycle",enum:["click","hover"]}},thumbnailActive:{type:"boolean",scope:"common",title:"Active",display:{type:"toggle-cycle",enum:["outline","color","scale-up","none"]}},thumbnailActiveColor:{type:"string",scope:"layout",title:"Outline Active",display:{type:"palette-color-picker",visible:!1}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1Color:{type:"string",scope:"layout",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"layout",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"layout",title:"Caption Default",display:{type:"palette-color-picker"}},...tb,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},iconMarginLeft:{type:"number",scope:"layout",title:"Icon margin left",min:0,display:{type:"range-control"}}},defaults:{cover:"01M3QM74XESYN1HRYH9VRTZ5CK",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:Jx,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...nb},layoutDefaults:{m:{thumbnailSize:.1,thumbnailVisibility:"off",titleHeaderLayout:"mobile",thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",title1Width:.25,title2Width:.6,title3Width:.25,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.04,titleRowMarginBottom:.08,closeIconMaxWidth:.04,contentMarginTop:.08,iconMarginLeft:.02,...fs({title1FontSize:.042,title1LineHeight:.042,title2FontSize:.042,title2LineHeight:.042,title3FontSize:.042,title3LineHeight:.042})},t:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.039,contentMarginTop:.015,iconMarginLeft:.02,...fs({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208})},d:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.02,contentMarginTop:.015,iconMarginLeft:.02,...fs({title1FontSize:.011,title1LineHeight:.02,title2FontSize:.011,title2LineHeight:.02,title3FontSize:.011,title3LineHeight:.02})}},displayRules:[{if:{name:"thumbnailActive",value:"outline"},then:{name:"properties.thumbnailActiveColor.display.visible",value:!0}}],layout:["__componentName__","thumbnailGap","thumbnailMarginBottom","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","contentMarginTop","title1MarginLeft","iconMarginLeft"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",title:"Thumbnails",items:["thumbnailVisibility","thumbnailObjectFit"]},{type:"row",items:["thumbnailTrigger","thumbnailActive"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[ib]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor","thumbnailActiveColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"}},title1:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}}}},default:[{image:{assetId:"01M3QM74XEVZ9F59FC7M9BA63Q",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XEE2101QD8PM6E4JSA",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XE20C38X4NND20C5R4",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XEGBJMJ7Q63KMZY6NA",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XEBS5231QA4355P4VQ",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XEWT5YM43KF6PEYRCV",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"}]}},rb={element:Qx,id:"lightbox-strip",name:"Strip",category:"galleries",version:1,defaultSize:{d:{width:350},t:{width:300},m:{width:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Strip.mp4"},schema:ob,sourceCode:Zx,assetsPaths:{content:[{path:"image.assetId",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0},{path:"closeIcon"}]},fontSettingsPaths:{content:[],parameters:[...No.map(e=>({path:`${Jt(e,"fontFamily")}`}))]},fontRelations:{...No.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Jt(t,"fontFamily")}`}),{})}},ab=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,initialSlideIndex:l=0,enableUrlSync:c=!1,journalItemId:d=null,onBeforeClose:u,onClose:p})=>{const{type:y,coverFit:x,backgroundColor:g,imageGap:h,maxWidth:b,maxHeight:S,textTransition:_,title1Width:v,title2Width:L,title3Width:P,title1MarginLeft:q=0,title2MarginLeft:X=0,title3MarginLeft:B=0,titleRowMarginBottom:H=0,titleHeaderLayout:O="single-row",countCloseGap:C=0,closeIcon:$,closeIconMaxWidth:Q,closeIconColor:R,closeIconHoverColor:T,contentMarginTop:w=0,iconMarginRight:V=0}=n,z=s.useCallback(we=>E.scalingValue(we,i??!1),[i]),U=z(h??0),M=`${b}%`,f=`${S}%`,K=z(C),G=z(w),ge=z(V),k=Gi("title1",Vi(n,"title1"),i),ce=Gi("title2",Vi(n,"title2"),i),I=Gi("title3",Vi(n,"title3"),i),ue=Gi("count",Vi(n,"count"),i),ee=O==="mobile",xe=!i||!!r,Le=!o&&(!i||!!r),se=s.useMemo(()=>pa(t,y),[t,y]),[de,Z]=s.useState(l),pe=se[de],ie=pe==null?void 0:pe.entry,[me,ve]=s.useState(!1),[Ee,Re]=s.useState(null),[Ce,$e]=s.useState(!1),[m,Y]=s.useState(null),[te,oe]=s.useState(!1),[fe,N]=s.useState(0),[F,ne]=s.useState(),[re,J]=s.useState(),[W,Se]=s.useState(null),le=s.useRef(null),j=s.useRef(0),Te=s.useRef(0),Fe=s.useRef(0),Ye=s.useRef(!1),De=s.useRef(null),ze=s.useRef(null),Ze=s.useRef(null),Ue=s.useRef(null),ye=s.useRef(null),_e=s.useRef(null),Ve=s.useRef(null),Je=s.useCallback(()=>{const we=ze.current;if(!we)return;const qe=we.closest(`.${e}-lightbox-content-area`);if(!qe)return we.getBoundingClientRect().width;const A=Array.from(qe.children).reduce((ae,he)=>!(he instanceof HTMLElement)||he.contains(we)?ae:ae+he.getBoundingClientRect().width,0);return qe.getBoundingClientRect().width-A},[e]),et=s.useCallback(()=>{le.current&&(clearTimeout(le.current),le.current=null)},[]),ot=s.useCallback(we=>{we===j.current&&(Y(null),oe(!1))},[]),lt=s.useCallback(()=>{o||Ye.current||(Ye.current=!0,u==null||u(),ve(!1),De.current=setTimeout(()=>{p()},300))},[o,u,p]),Ke=s.useCallback(we=>!!(we.closest("[data-controls]")||we.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ht,backdropStyle:tt,mediaAreaStyle:Ge,overlayContentStyle:We,swipeHandlers:Ne,dismissAreaStyle:be}=bp({enabled:Le,onClose:lt,animMs:300,isBlockedTarget:Ke}),He=s.useCallback(we=>{c&&np(we+1,d,!0)},[c,d]),Xe=s.useCallback(we=>{if(we)return we.getBoundingClientRect().height},[]),ct=s.useCallback(we=>{if(se.length===0)return;const qe=(we%se.length+se.length)%se.length;if(qe===de)return;const A=se[de],ae=se[qe];j.current+=1;const he=j.current,Pe=_==="fade"&&Fc(A==null?void 0:A.entry)!==Fc(ae==null?void 0:ae.entry),je=Xe(Ze.current),mt=Pe?(()=>{const qt=Je();qn.flushSync(()=>{Se(ae.entry)}),Ze.current&&qt&&(Ze.current.style.width=`${qt}px`);const sn=Xe(Ze.current);return Ze.current&&(Ze.current.style.width=""),{measuredIncomingTitlesHeight:sn,incomingTitlesMeasureWidth:qt}})():void 0,Ht=Math.max(je??0,(mt==null?void 0:mt.measuredIncomingTitlesHeight)??0)||void 0;N(he),Y(de),oe(!0),Z(qe),He(qe),Fe.current=qe,Pe?(et(),Ht&&ne(Ht),mt!=null&&mt.incomingTitlesMeasureWidth&&J(mt.incomingTitlesMeasureWidth),Re((A==null?void 0:A.entryIndex)??null),$e(!0),Te.current=ae.entryIndex,le.current=setTimeout(()=>{Re(null),$e(!1),ne(void 0),J(void 0),Se(null),le.current=null},400)):(et(),Re(null),$e(!1),ne(void 0),J(void 0),Se(null),Te.current=ae.entryIndex)},[de,et,Je,Xe,se,He,_]),rt=s.useCallback(()=>{Ve.current=null},[]),xt=s.useCallback(we=>{!xe||se.length<=1||we.pointerType==="mouse"&&we.button!==0||we.target.closest("[data-controls]")||(Ve.current={startX:we.clientX,startY:we.clientY,pointerId:we.pointerId})},[xe,se.length]),pt=s.useCallback(we=>{var qt;if(!xe||se.length<=1||we.pointerType==="mouse"&&we.button!==0)return;if(ht){rt();return}const qe=Ve.current;if(!qe||qe.pointerId!==we.pointerId||(rt(),we.target.closest("[data-controls]")))return;const ae=we.clientX-qe.startX,he=we.clientY-qe.startY,Pe=Math.abs(ae),je=Math.abs(he);if(Pe>=yv&&Pe>je){ct(ae>0?de-1:de+1);return}if(Pe>Rc||je>Rc)return;const mt=(qt=Ue.current)==null?void 0:qt.getBoundingClientRect(),Ht=mt?mt.left+mt.width/2:window.innerWidth/2;ct(we.clientX<Ht?de-1:de+1)},[de,xe,ct,ht,rt,se.length]),It=s.useCallback(we=>{const qe=Ve.current;(qe==null?void 0:qe.pointerId)===we.pointerId&&rt()},[rt]);jl(),s.useEffect(()=>{_e.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const we=requestAnimationFrame(()=>{ve(!0),requestAnimationFrame(()=>{ye.current?ye.current.focus():Ue.current&&Ue.current.focus()})});return()=>{cancelAnimationFrame(we),De.current&&clearTimeout(De.current),le.current&&clearTimeout(le.current);const qe=_e.current;qe&&document.contains(qe)&&qe.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var we;_!=="fade"&&(Te.current=((we=se[de])==null?void 0:we.entryIndex)??0,et(),Re(null),$e(!1),ne(void 0),J(void 0))},[de,et,se,_]),s.useEffect(()=>{const we=qe=>{if(qe.key==="Escape"){lt();return}if(qe.key==="ArrowLeft"&&se.length>1){ct(de-1);return}if(qe.key==="ArrowRight"&&se.length>1){ct(de+1);return}if(qe.key==="Tab"&&Ue.current){const A=Ue.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),ae=Array.from(A).filter(mt=>!mt.closest('[aria-hidden="true"]'));if(ae.length===0)return;const he=ae[0],Pe=ae[ae.length-1],je=document.activeElement;qe.shiftKey?(je===he||!Ue.current.contains(je))&&(qe.preventDefault(),Pe.focus()):(je===Pe||!Ue.current.contains(je))&&(qe.preventDefault(),he.focus())}};return window.addEventListener("keydown",we),()=>window.removeEventListener("keydown",we)},[ct,lt,de,se.length]),s.useLayoutEffect(()=>{et(),j.current=0,N(0),Y(null),oe(!1),Re(null),$e(!1),ne(void 0),J(void 0),Se(null),Z(we=>{const qe=Math.max(0,se.length-1);return Math.min(we,qe)})},[et,t.length,y,se.length]),s.useLayoutEffect(()=>{var A;const we=Math.max(0,se.length-1),qe=Math.min(Math.max(0,l),we);Fe.current=qe,Te.current=((A=se[qe])==null?void 0:A.entryIndex)??0,Z(qe)},[l]);const nt=Ee!==null?t[Ee]:null,bt=m!==null?se[m]:null,Lt=(ie==null?void 0:ie.title1)||(ie==null?void 0:ie.title2)||(ie==null?void 0:ie.title3)||(nt==null?void 0:nt.title1)||(nt==null?void 0:nt.title2)||(nt==null?void 0:nt.title3),Ut=Tv(y,se,t),Ft=$!==null,Me=Lt||Ut||Ft,Oe=Ut&&Ft?{gap:K}:void 0,St=`${e}-titles-stack${ee?` ${e}-titles-stack-stacked`:""}`,Mt=`${e}-titles-layer-out${ee?` ${e}-titles-layer-out-stacked`:""}`,Qe=`${e}-titles-layer-out`,kt=(q??0)>0||o,Bt=z(H),Wt=s.useMemo(()=>({title1Width:v??wo.title1Width,title2Width:L??wo.title2Width,title3Width:P??wo.title3Width}),[v,L,P]),At=s.useMemo(()=>({title2MarginLeft:X,title3MarginLeft:B}),[X,B]),Ae=s.useMemo(()=>ie?Ti(e,ie,k,ce,I):[],[e,ie,k,ce,I]),ft=s.useMemo(()=>Ae.map(we=>Wt[we.widthKey]),[Ae,Wt]),gt=s.useMemo(()=>Mo(Ae.length,ft),[Ae.length,ft]),dt=s.useMemo(()=>vr(Ae.length,ft),[Ae.length,ft]),yt=s.useMemo(()=>Ae.filter(we=>we.prefix==="title1"),[Ae]),ut=s.useMemo(()=>Ae.filter(we=>we.prefix==="title2"||we.prefix==="title3"),[Ae]),it=s.useMemo(()=>Ii(yt,Wt),[yt,Wt]),Nt=s.useMemo(()=>Ii(ut,Wt),[ut,Wt]),$t=s.useCallback((we,qe)=>{const A=Ae.findIndex(he=>he.prefix===we.prefix);if(!ee||qe==="single-row")return{effectiveWidth:dt[A]??0,resolvedWidth:gt[A]??0,maxWidth:yn(A,gt)};if(qe==="two-row-top"){const he=yt.findIndex(Pe=>Pe.prefix===we.prefix);return{effectiveWidth:it.effective[he]??0,resolvedWidth:it.resolved[he]??0,maxWidth:yn(he,it.resolved)}}const ae=ut.findIndex(he=>he.prefix===we.prefix);return{effectiveWidth:Nt.effective[ae]??0,resolvedWidth:Nt.resolved[ae]??0,maxWidth:yn(ae,Nt.resolved)}},[Ae,ut,Nt,dt,gt,yt,it,ee]),Qt=s.useCallback(we=>ap(Ae,gt,At,we)+(ee?0:q??0),[Ae,gt,At,ee,q]),Xt=s.useCallback(()=>ee?0:q??0,[ee,q]),Ot=s.useCallback(we=>ut.slice(0,we).reduce((qe,A,ae)=>qe+(A.marginLeftKey?At[A.marginLeftKey]??0:0)+(Nt.resolved[ae]??0),0),[ut,Nt.resolved,At]),jt=s.useCallback(we=>{const qe=ut[we];return Ot(we)+(qe.marginLeftKey?At[qe.marginLeftKey]??0:0)+(Nt.resolved[we]??0)},[ut,Nt.resolved,Ot,At]),Dt=s.useCallback((we,qe,A)=>{if(!ee||A==="single-row"){const mt=we.findIndex(en=>en.prefix===qe.prefix),Ht=we.map(en=>Wt[en.widthKey]),qt=Mo(we.length,Ht);return{effectiveWidth:vr(we.length,Ht)[mt]??0,resolvedWidth:qt[mt]??0,maxWidth:yn(mt,qt)}}if(A==="two-row-top"){const mt=we.filter(en=>en.prefix==="title1"),Ht=mt.findIndex(en=>en.prefix===qe.prefix),{resolved:qt,effective:sn}=Ii(mt,Wt);return{effectiveWidth:sn[Ht]??0,resolvedWidth:qt[Ht]??0,maxWidth:yn(Ht,qt)}}const ae=we.filter(mt=>mt.prefix==="title2"||mt.prefix==="title3"),he=ae.findIndex(mt=>mt.prefix===qe.prefix),{resolved:Pe,effective:je}=Ii(ae,Wt);return{effectiveWidth:je[he]??0,resolvedWidth:Pe[he]??0,maxWidth:yn(he,Pe)}},[Wt,ee]),zt=(we,qe,A)=>{const ae=we.marginLeftKey?At[we.marginLeftKey]??0:0,{effectiveWidth:he,resolvedWidth:Pe,maxWidth:je}=A??$t(we,qe),mt=Math.max(ae,ii),Ht=o&&qe==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":we.prefix,style:{width:z(he),...ae>0?{marginLeft:z(ae)}:{}},children:[a.jsx("p",{className:we.className,style:we.style,children:we.text}),Ht&&we.marginLeftKey?a.jsx("div",{"data-controls":we.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Pe),style:{position:"absolute",top:0,left:z(-ae),width:z(mt),height:"100%",pointerEvents:"auto"}}):null,Ht?a.jsx("div",{"data-controls":we.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(je),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:z(-Pn/2),width:z(Pn),height:"100%",pointerEvents:"auto"}}):null]},we.className)},D=(we="two-row")=>{const qe=Ae.findIndex(he=>he.prefix==="title1"),A=qe>=0?gt[qe]:Wt.title1Width,ae=we==="two-row"&&o;return a.jsx("div",{...ae?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(A)}:{},style:{width:z(q??0),flexShrink:0,alignSelf:"stretch",...ae?{pointerEvents:"auto"}:{}}})},Ie=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:k,"aria-hidden":"true",children:" "}),Be=()=>a.jsx("span",{className:`${e}-entry-counter`,style:ue,"aria-live":"polite","aria-atomic":"true",children:Cv(se,de,y,t)}),ke=()=>Ut?o&&Ft?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Be(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${as(K)} + ${K}))`,width:as(K),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Be():null,vt=()=>!Ut&&!Ft?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Oe,children:[ke(),Ft?Tt():null]}),Ct=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ut||Lt?Ie():null,kt?D("single-row"):null,Pt(ie),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),vt(),bn()]}),at=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ut||Lt?Ie():null,kt?D("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:Ce&&F?{minHeight:F}:void 0,children:[a.jsx("div",{ref:Ze,className:St,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:xn(W||ie)}),a.jsxs("div",{ref:ze,className:St,style:{position:Ce?"absolute":"relative",inset:Ce?0:void 0,width:"100%",...Ce&&re?{width:re,maxWidth:"100%"}:void 0},children:[nt&&Ce?a.jsx("div",{className:`${Mt} ${e}-titles-fade-out`,children:xn(nt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${Ce?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:xn(ie)})]})]}),vt(),bn()]}),Tt=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:E.scalingValue(Q??0,i),height:E.scalingValue(Q??0,i),marginRight:ge,"--close-icon-hover-color":T},children:[a.jsx("button",{ref:ye,type:"button",className:`${e}-close-icon-inner`,onClick:lt,"aria-label":"Close",children:a.jsx(gn,{url:$??"",fill:R,hoverFill:i&&!r?R:T,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ge,height:"100%",pointerEvents:"auto"}})]}),Vt=(we,qe)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[Ut||Lt?Ie():null,kt?D("two-row"):null,qe!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:qe},children:we}):a.jsxs(a.Fragment,{children:[we,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),vt()]}),Pt=we=>{if(!we)return null;const qe=Ti(e,we,k,ce,I);return a.jsx(a.Fragment,{children:qe.map(A=>zt(A,"single-row",Dt(qe,A,"single-row")))})},Zt=we=>{if(!we)return null;const qe=Ti(e,we,k,ce,I),A=qe.find(ae=>ae.prefix==="title1");return A?zt(A,"two-row-top",Dt(qe,A,"two-row-top")):null},on=(we,qe=!1)=>{const A=we?Ti(e,we,k,ce,I):[],ae=A.filter(je=>je.prefix==="title2"||je.prefix==="title3"),he=o&&qe;return ae.length>0||he||(H??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[ae.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[ae.map(je=>zt(je,"two-row-bottom",Dt(A,je,"two-row-bottom"))),qe&&o?a.jsxs(a.Fragment,{children:[pi(),Kn()]}):null]}):null,(H??0)>0||he?a.jsx("div",{"data-controls":he?"titleRowMarginBottom":void 0,"data-controls-axis":he?"y":void 0,"data-controls-reverse":he?"":void 0,className:he?`${e}-control`:void 0,style:{height:Bt,width:"100%",flexShrink:0,pointerEvents:he?"auto":"none"}}):null]}):null},Wn=(we,qe=!1)=>a.jsxs(a.Fragment,{children:[Vt(Zt(we)),on(we,qe)]}),xn=we=>ee?a.jsx("div",{className:`${e}-titles-row-two-row`,children:Wn(we)}):we?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Pt(we)}):null,ui=()=>{const we=ee?-1:Ae.findIndex(ae=>ae.prefix==="title1"),qe=!ee&&(o||(q??0)>0)?(()=>{const ae=q??0,he=we>=0?gt[we]:Wt.title1Width,Pe=Math.max(ae,ii);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(he),style:{position:"absolute",top:0,left:0,width:z(Pe),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,A=Ae.flatMap((ae,he)=>{if(!ae.marginLeftKey)return[];const Pe=At[ae.marginLeftKey]??0,je=rp(Ae,gt,At,he)+Xt(),mt=Math.max(Pe,ii);return a.jsx("div",{"data-controls":ae.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(gt[he]),style:{position:"absolute",top:0,left:z(je),width:z(mt),height:"100%",pointerEvents:"auto"}},ae.marginLeftKey)});return qe?[qe,...A]:A},dn=()=>Ae.map((we,qe)=>{const A=yn(qe,gt),he=Qt(qe)-Pn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":we.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(A),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:z(he),width:z(Pn),height:"100%",pointerEvents:"auto"}})},`${we.widthKey}-junction`)}),pi=()=>ut.flatMap((we,qe)=>{if(!we.marginLeftKey)return[];const A=At[we.marginLeftKey]??0,ae=Ot(qe),he=Math.max(A,ii),{resolvedWidth:Pe}=$t(we,"two-row-bottom");return a.jsx("div",{"data-controls":we.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Pe),style:{position:"absolute",top:0,left:z(ae),width:z(he),height:"100%",pointerEvents:"auto"}},we.marginLeftKey)}),Kn=()=>ut.map((we,qe)=>{const{maxWidth:A}=$t(we,"two-row-bottom"),he=jt(qe)-Pn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":we.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(A),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:z(he),width:z(Pn),height:"100%",pointerEvents:"auto"}})},`${we.widthKey}-junction`)}),bn=()=>!o||ee?null:a.jsxs(a.Fragment,{children:[ui(),dn()]}),gi=we=>{const qe=!we.objectFit&&li(x);return{className:`${e}-slide-image-cell${qe?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:M,maxHeight:f,...qe?{"--image-aspect-ratio":ja(x)}:{}}}},eo=we=>we.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":we.objectFit}}:li(x)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},Sn=we=>{if(we.length===0)return null;const qe=we.length>1,A=as(U),ae=`calc(-0.5 * (${A} + ${U}))`;if(we.length===1){const he=we[0];return a.jsx("div",{...gi(he),children:a.jsx("img",{...eo(he),src:he.assetId,alt:he.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:qe?{gap:U}:void 0,children:we.map((he,Pe)=>a.jsxs("div",{...gi(he),children:[a.jsx("img",{...eo(he),src:he.assetId,alt:he.name??"",draggable:!1}),o&&qe&&Pe<we.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:ae,width:A,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${he.assetId}-${Pe}`))})},Qn=!!(ie!=null&&ie.title2||ie!=null&&ie.title3||nt!=null&&nt.title2||nt!=null&&nt.title3||(H??0)>0||o),to=()=>a.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[a.jsx("div",{ref:Ze,className:St,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Wn(W||ie)}),a.jsxs("div",{ref:ze,className:`${e}-titles-row-two-row`,style:{...Ce&&F?{minHeight:F}:void 0,...Ce&&re?{width:re,maxWidth:"100%"}:void 0},children:[Vt(a.jsxs("div",{className:St,style:{position:Ce?"absolute":"relative",inset:Ce?0:void 0,width:"100%"},children:[nt&&Ce?a.jsx("div",{className:`${Qe} ${e}-titles-fade-out`,children:Zt(nt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${Ce?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:Zt(ie)})]}),Ce&&F?F:void 0),Qn?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[nt&&Ce?a.jsx("div",{className:`${Mt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:on(nt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${Ce?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${ee?` ${e}-titles-layer-in-stacked`:""}`,children:on(ie,!0)})]}):null]})]}),no=()=>{const we=Qn;return a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...we?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:we?void 0:{flex:"0 0 auto",height:"auto"},children:Wn(ie,!0)}),bn()]})};return a.jsxs("div",{ref:Ue,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ht||lt()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:Ft?void 0:-1,style:{opacity:me?1:0,transition:"opacity 300ms ease",pointerEvents:me?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:g,...tt}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:be,...Ne,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Ge,onClick:we=>we.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":xe&&se.length>1?"true":"false",onPointerDown:xe?xt:void 0,onPointerUp:xe?pt:void 0,onPointerCancel:xe?It:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[bt&&te?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:we=>{we.target===we.currentTarget&&ot(fe)},children:a.jsx("div",{className:`${e}-slide-area`,children:Sn(bt.images)})},`slide-out-${fe}`):null,a.jsx("div",{className:`${e}-slide-layer-in${te?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:pe?Sn(pe.images):null})},`slide-in-${fe}-${de}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:We,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:G,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...ee?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${ee?` ${e}-lightbox-content-area-stacked`:""}`,children:Me&&a.jsx("div",{className:`${e}-text-bar-cell${ee?` ${e}-text-bar-cell-stacked`:""}`,style:ee?void 0:{flex:1,minWidth:0,width:"100%"},children:ee?_==="fade"?to():no():_==="fade"?at():Ct()})})})]})]})]})};function sb(e){return`
|
|
15520
|
+
`,Jx="01M3SBP3P8CMVMM1ZZ0QVD2PPF",Di={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function eb(e){const t={};return t[Jt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Jt(e,"fontSettings")]={...Di.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Jt(e,"fontSize")]={...Di.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Jt(e,"lineHeight")]={...Di.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Jt(e,"letterSpacing")]={...Di.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Jt(e,"wordSpacing")]={...Di.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Jt(e,"textAlign")]={...Di.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Jt(e,"textAppearance")]={...Di.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const tb=No.reduce((e,t)=>({...e,...eb(t)}),{}),nb=No.reduce((e,t)=>({...e,[Jt(t,"fontFamily")]:"Goudy Bookletter 1911",[Jt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Jt(t,"letterSpacing")]:0,[Jt(t,"wordSpacing")]:0,[Jt(t,"textAlign")]:"left",[Jt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function fs(e){return No.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Jt(n,"fontSize")]=i),o!==void 0&&(t[Jt(n,"lineHeight")]=o),t},{})}const ib=Xx(),ob={type:"object",version:1,settings:{sizing:"auto manual",properties:{cover:{type:"string",scope:"common",title:"",display:{type:"settings-image-input"}},coverFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailSize:{type:"number",scope:"layout",title:"Thumbnail Size",min:0,display:{type:"range-control"}},thumbnailGap:{type:"number",scope:"layout",title:"Thumbnail Gap",min:0,display:{type:"range-control"}},thumbnailMarginBottom:{type:"number",scope:"layout",title:"Thumbnail Margin Bottom",min:0,display:{type:"range-control"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"layout",title:"BG Default",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"layout",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"layout",title:"Icon Hover",display:{type:"settings-color-picker"}},thumbnailVisibility:{type:"boolean",scope:"layout",title:"Visibility",display:{type:"toggle-cycle",enum:["on","off"]}},thumbnailObjectFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailTrigger:{type:"string",scope:"common",title:"Trigger",display:{type:"toggle-cycle",enum:["click","hover"]}},thumbnailActive:{type:"boolean",scope:"common",title:"Active",display:{type:"toggle-cycle",enum:["outline","color","scale-up","none"]}},thumbnailActiveColor:{type:"string",scope:"layout",title:"Outline Active",display:{type:"palette-color-picker",visible:!1}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1Color:{type:"string",scope:"layout",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"layout",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"layout",title:"Caption Default",display:{type:"palette-color-picker"}},...tb,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},iconMarginLeft:{type:"number",scope:"layout",title:"Icon margin left",min:0,display:{type:"range-control"}}},defaults:{cover:"01M3QM74XESYN1HRYH9VRTZ5CK",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:Jx,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...nb},layoutDefaults:{m:{thumbnailSize:.1,thumbnailVisibility:"off",titleHeaderLayout:"mobile",thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",title1Width:.25,title2Width:.6,title3Width:.25,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.04,titleRowMarginBottom:.08,closeIconMaxWidth:.04,contentMarginTop:.08,iconMarginLeft:.02,...fs({title1FontSize:.042,title1LineHeight:.042,title2FontSize:.042,title2LineHeight:.042,title3FontSize:.042,title3LineHeight:.042})},t:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.039,contentMarginTop:.015,iconMarginLeft:.02,...fs({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208})},d:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.02,contentMarginTop:.015,iconMarginLeft:.02,...fs({title1FontSize:.011,title1LineHeight:.02,title2FontSize:.011,title2LineHeight:.02,title3FontSize:.011,title3LineHeight:.02})}},displayRules:[{if:{name:"thumbnailActive",value:"outline"},then:{name:"properties.thumbnailActiveColor.display.visible",value:!0}}],layout:["__componentName__","thumbnailGap","thumbnailMarginBottom","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","contentMarginTop","title1MarginLeft","iconMarginLeft"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",title:"Thumbnails",items:["thumbnailVisibility","thumbnailObjectFit"]},{type:"row",items:["thumbnailTrigger","thumbnailActive"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[ib]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor","thumbnailActiveColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"}},title1:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}}}},default:[{image:{assetId:"01M3QM74XEVZ9F59FC7M9BA63Q",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XEE2101QD8PM6E4JSA",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XE20C38X4NND20C5R4",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XEGBJMJ7Q63KMZY6NA",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XEBS5231QA4355P4VQ",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{assetId:"01M3QM74XEWT5YM43KF6PEYRCV",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"}]}},rb={element:Qx,id:"lightbox-strip",name:"Strip",category:"galleries",version:1,defaultSize:{d:{width:350},t:{width:300},m:{width:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Strip.mp4"},schema:ob,sourceCode:Zx,assetsPaths:{content:[{path:"image.assetId",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0},{path:"closeIcon"}]},fontSettingsPaths:{content:[],parameters:[...No.map(e=>({path:`${Jt(e,"fontFamily")}`}))]},fontRelations:{...No.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Jt(t,"fontFamily")}`}),{})}},ab=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,initialSlideIndex:l=0,enableUrlSync:c=!1,journalItemId:d=null,onBeforeClose:u,onClose:p})=>{const{type:y,coverFit:x,backgroundColor:g,imageGap:h,maxWidth:b,maxHeight:S,textTransition:_,title1Width:v,title2Width:L,title3Width:P,title1MarginLeft:q=0,title2MarginLeft:X=0,title3MarginLeft:B=0,titleRowMarginBottom:H=0,titleHeaderLayout:O="single-row",countCloseGap:C=0,closeIcon:$,closeIconMaxWidth:Q,closeIconColor:R,closeIconHoverColor:T,contentMarginTop:w=0,iconMarginRight:V=0}=n,z=s.useCallback(we=>E.scalingValue(we,i??!1),[i]),U=z(h??0),M=`${b}%`,f=`${S}%`,K=z(C),G=z(w),ge=z(V),k=Gi("title1",Vi(n,"title1"),i),ce=Gi("title2",Vi(n,"title2"),i),I=Gi("title3",Vi(n,"title3"),i),ue=Gi("count",Vi(n,"count"),i),ee=O==="mobile",xe=!i||!!r,Le=!o&&(!i||!!r),se=s.useMemo(()=>pa(t,y),[t,y]),[de,Z]=s.useState(l),pe=se[de],ie=pe==null?void 0:pe.entry,[me,ve]=s.useState(!1),[Ee,Re]=s.useState(null),[Ce,$e]=s.useState(!1),[m,Y]=s.useState(null),[te,oe]=s.useState(!1),[fe,N]=s.useState(0),[F,ne]=s.useState(),[re,J]=s.useState(),[W,Se]=s.useState(null),le=s.useRef(null),j=s.useRef(0),Te=s.useRef(0),Fe=s.useRef(0),Ye=s.useRef(!1),De=s.useRef(null),ze=s.useRef(null),Ze=s.useRef(null),Ue=s.useRef(null),ye=s.useRef(null),_e=s.useRef(null),Ve=s.useRef(null),Je=s.useCallback(()=>{const we=ze.current;if(!we)return;const qe=we.closest(`.${e}-lightbox-content-area`);if(!qe)return we.getBoundingClientRect().width;const A=Array.from(qe.children).reduce((ae,he)=>!(he instanceof HTMLElement)||he.contains(we)?ae:ae+he.getBoundingClientRect().width,0);return qe.getBoundingClientRect().width-A},[e]),et=s.useCallback(()=>{le.current&&(clearTimeout(le.current),le.current=null)},[]),ot=s.useCallback(we=>{we===j.current&&(Y(null),oe(!1))},[]),lt=s.useCallback(()=>{o||Ye.current||(Ye.current=!0,u==null||u(),ve(!1),De.current=setTimeout(()=>{p()},300))},[o,u,p]),Ke=s.useCallback(we=>!!(we.closest("[data-controls]")||we.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ht,backdropStyle:tt,mediaAreaStyle:Ge,overlayContentStyle:We,swipeHandlers:Ne,dismissAreaStyle:be}=bp({enabled:Le,onClose:lt,animMs:300,isBlockedTarget:Ke}),He=s.useCallback(we=>{c&&np(we+1,d,!0)},[c,d]),Xe=s.useCallback(we=>{if(we)return we.getBoundingClientRect().height},[]),ct=s.useCallback(we=>{if(se.length===0)return;const qe=(we%se.length+se.length)%se.length;if(qe===de)return;const A=se[de],ae=se[qe];j.current+=1;const he=j.current,Pe=_==="fade"&&Fc(A==null?void 0:A.entry)!==Fc(ae==null?void 0:ae.entry),je=Xe(Ze.current),mt=Pe?(()=>{const qt=Je();qn.flushSync(()=>{Se(ae.entry)}),Ze.current&&qt&&(Ze.current.style.width=`${qt}px`);const sn=Xe(Ze.current);return Ze.current&&(Ze.current.style.width=""),{measuredIncomingTitlesHeight:sn,incomingTitlesMeasureWidth:qt}})():void 0,Ht=Math.max(je??0,(mt==null?void 0:mt.measuredIncomingTitlesHeight)??0)||void 0;N(he),Y(de),oe(!0),Z(qe),He(qe),Fe.current=qe,Pe?(et(),Ht&&ne(Ht),mt!=null&&mt.incomingTitlesMeasureWidth&&J(mt.incomingTitlesMeasureWidth),Re((A==null?void 0:A.entryIndex)??null),$e(!0),Te.current=ae.entryIndex,le.current=setTimeout(()=>{Re(null),$e(!1),ne(void 0),J(void 0),Se(null),le.current=null},400)):(et(),Re(null),$e(!1),ne(void 0),J(void 0),Se(null),Te.current=ae.entryIndex)},[de,et,Je,Xe,se,He,_]),rt=s.useCallback(()=>{Ve.current=null},[]),xt=s.useCallback(we=>{!xe||se.length<=1||we.pointerType==="mouse"&&we.button!==0||we.target.closest("[data-controls]")||(Ve.current={startX:we.clientX,startY:we.clientY,pointerId:we.pointerId})},[xe,se.length]),pt=s.useCallback(we=>{var qt;if(!xe||se.length<=1||we.pointerType==="mouse"&&we.button!==0)return;if(ht){rt();return}const qe=Ve.current;if(!qe||qe.pointerId!==we.pointerId||(rt(),we.target.closest("[data-controls]")))return;const ae=we.clientX-qe.startX,he=we.clientY-qe.startY,Pe=Math.abs(ae),je=Math.abs(he);if(Pe>=yv&&Pe>je){ct(ae>0?de-1:de+1);return}if(Pe>Rc||je>Rc)return;const mt=(qt=Ue.current)==null?void 0:qt.getBoundingClientRect(),Ht=mt?mt.left+mt.width/2:window.innerWidth/2;ct(we.clientX<Ht?de-1:de+1)},[de,xe,ct,ht,rt,se.length]),It=s.useCallback(we=>{const qe=Ve.current;(qe==null?void 0:qe.pointerId)===we.pointerId&&rt()},[rt]);jl(),s.useEffect(()=>{_e.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const we=requestAnimationFrame(()=>{ve(!0),requestAnimationFrame(()=>{ye.current?ye.current.focus():Ue.current&&Ue.current.focus()})});return()=>{cancelAnimationFrame(we),De.current&&clearTimeout(De.current),le.current&&clearTimeout(le.current);const qe=_e.current;qe&&document.contains(qe)&&qe.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var we;_!=="fade"&&(Te.current=((we=se[de])==null?void 0:we.entryIndex)??0,et(),Re(null),$e(!1),ne(void 0),J(void 0))},[de,et,se,_]),s.useEffect(()=>{const we=qe=>{if(qe.key==="Escape"){lt();return}if(qe.key==="ArrowLeft"&&se.length>1){ct(de-1);return}if(qe.key==="ArrowRight"&&se.length>1){ct(de+1);return}if(qe.key==="Tab"&&Ue.current){const A=Ue.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),ae=Array.from(A).filter(mt=>!mt.closest('[aria-hidden="true"]'));if(ae.length===0)return;const he=ae[0],Pe=ae[ae.length-1],je=document.activeElement;qe.shiftKey?(je===he||!Ue.current.contains(je))&&(qe.preventDefault(),Pe.focus()):(je===Pe||!Ue.current.contains(je))&&(qe.preventDefault(),he.focus())}};return window.addEventListener("keydown",we),()=>window.removeEventListener("keydown",we)},[ct,lt,de,se.length]),s.useLayoutEffect(()=>{et(),j.current=0,N(0),Y(null),oe(!1),Re(null),$e(!1),ne(void 0),J(void 0),Se(null),Z(we=>{const qe=Math.max(0,se.length-1);return Math.min(we,qe)})},[et,t.length,y,se.length]),s.useLayoutEffect(()=>{var A;const we=Math.max(0,se.length-1),qe=Math.min(Math.max(0,l),we);Fe.current=qe,Te.current=((A=se[qe])==null?void 0:A.entryIndex)??0,Z(qe)},[l]);const nt=Ee!==null?t[Ee]:null,bt=m!==null?se[m]:null,Lt=(ie==null?void 0:ie.title1)||(ie==null?void 0:ie.title2)||(ie==null?void 0:ie.title3)||(nt==null?void 0:nt.title1)||(nt==null?void 0:nt.title2)||(nt==null?void 0:nt.title3),Ut=Tv(y,se,t),Ft=$!==null,Me=Lt||Ut||Ft,Oe=Ut&&Ft?{gap:K}:void 0,St=`${e}-titles-stack${ee?` ${e}-titles-stack-stacked`:""}`,Mt=`${e}-titles-layer-out${ee?` ${e}-titles-layer-out-stacked`:""}`,Qe=`${e}-titles-layer-out`,kt=(q??0)>0||o,Bt=z(H),Wt=s.useMemo(()=>({title1Width:v??wo.title1Width,title2Width:L??wo.title2Width,title3Width:P??wo.title3Width}),[v,L,P]),At=s.useMemo(()=>({title2MarginLeft:X,title3MarginLeft:B}),[X,B]),Ae=s.useMemo(()=>ie?Ti(e,ie,k,ce,I):[],[e,ie,k,ce,I]),ft=s.useMemo(()=>Ae.map(we=>Wt[we.widthKey]),[Ae,Wt]),gt=s.useMemo(()=>Mo(Ae.length,ft),[Ae.length,ft]),dt=s.useMemo(()=>vr(Ae.length,ft),[Ae.length,ft]),yt=s.useMemo(()=>Ae.filter(we=>we.prefix==="title1"),[Ae]),ut=s.useMemo(()=>Ae.filter(we=>we.prefix==="title2"||we.prefix==="title3"),[Ae]),it=s.useMemo(()=>Ii(yt,Wt),[yt,Wt]),Nt=s.useMemo(()=>Ii(ut,Wt),[ut,Wt]),$t=s.useCallback((we,qe)=>{const A=Ae.findIndex(he=>he.prefix===we.prefix);if(!ee||qe==="single-row")return{effectiveWidth:dt[A]??0,resolvedWidth:gt[A]??0,maxWidth:yn(A,gt)};if(qe==="two-row-top"){const he=yt.findIndex(Pe=>Pe.prefix===we.prefix);return{effectiveWidth:it.effective[he]??0,resolvedWidth:it.resolved[he]??0,maxWidth:yn(he,it.resolved)}}const ae=ut.findIndex(he=>he.prefix===we.prefix);return{effectiveWidth:Nt.effective[ae]??0,resolvedWidth:Nt.resolved[ae]??0,maxWidth:yn(ae,Nt.resolved)}},[Ae,ut,Nt,dt,gt,yt,it,ee]),Qt=s.useCallback(we=>ap(Ae,gt,At,we)+(ee?0:q??0),[Ae,gt,At,ee,q]),Xt=s.useCallback(()=>ee?0:q??0,[ee,q]),Dt=s.useCallback(we=>ut.slice(0,we).reduce((qe,A,ae)=>qe+(A.marginLeftKey?At[A.marginLeftKey]??0:0)+(Nt.resolved[ae]??0),0),[ut,Nt.resolved,At]),jt=s.useCallback(we=>{const qe=ut[we];return Dt(we)+(qe.marginLeftKey?At[qe.marginLeftKey]??0:0)+(Nt.resolved[we]??0)},[ut,Nt.resolved,Dt,At]),Ot=s.useCallback((we,qe,A)=>{if(!ee||A==="single-row"){const mt=we.findIndex(en=>en.prefix===qe.prefix),Ht=we.map(en=>Wt[en.widthKey]),qt=Mo(we.length,Ht);return{effectiveWidth:vr(we.length,Ht)[mt]??0,resolvedWidth:qt[mt]??0,maxWidth:yn(mt,qt)}}if(A==="two-row-top"){const mt=we.filter(en=>en.prefix==="title1"),Ht=mt.findIndex(en=>en.prefix===qe.prefix),{resolved:qt,effective:sn}=Ii(mt,Wt);return{effectiveWidth:sn[Ht]??0,resolvedWidth:qt[Ht]??0,maxWidth:yn(Ht,qt)}}const ae=we.filter(mt=>mt.prefix==="title2"||mt.prefix==="title3"),he=ae.findIndex(mt=>mt.prefix===qe.prefix),{resolved:Pe,effective:je}=Ii(ae,Wt);return{effectiveWidth:je[he]??0,resolvedWidth:Pe[he]??0,maxWidth:yn(he,Pe)}},[Wt,ee]),zt=(we,qe,A)=>{const ae=we.marginLeftKey?At[we.marginLeftKey]??0:0,{effectiveWidth:he,resolvedWidth:Pe,maxWidth:je}=A??$t(we,qe),mt=Math.max(ae,ii),Ht=o&&qe==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":we.prefix,style:{width:z(he),...ae>0?{marginLeft:z(ae)}:{}},children:[a.jsx("p",{className:we.className,style:we.style,children:we.text}),Ht&&we.marginLeftKey?a.jsx("div",{"data-controls":we.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Pe),style:{position:"absolute",top:0,left:z(-ae),width:z(mt),height:"100%",pointerEvents:"auto"}}):null,Ht?a.jsx("div",{"data-controls":we.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(je),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:z(-Pn/2),width:z(Pn),height:"100%",pointerEvents:"auto"}}):null]},we.className)},D=(we="two-row")=>{const qe=Ae.findIndex(he=>he.prefix==="title1"),A=qe>=0?gt[qe]:Wt.title1Width,ae=we==="two-row"&&o;return a.jsx("div",{...ae?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(A)}:{},style:{width:z(q??0),flexShrink:0,alignSelf:"stretch",...ae?{pointerEvents:"auto"}:{}}})},Ie=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:k,"aria-hidden":"true",children:" "}),Be=()=>a.jsx("span",{className:`${e}-entry-counter`,style:ue,"aria-live":"polite","aria-atomic":"true",children:Cv(se,de,y,t)}),ke=()=>Ut?o&&Ft?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Be(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${as(K)} + ${K}))`,width:as(K),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Be():null,vt=()=>!Ut&&!Ft?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Oe,children:[ke(),Ft?Tt():null]}),Ct=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ut||Lt?Ie():null,kt?D("single-row"):null,Pt(ie),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),vt(),bn()]}),at=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ut||Lt?Ie():null,kt?D("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:Ce&&F?{minHeight:F}:void 0,children:[a.jsx("div",{ref:Ze,className:St,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:xn(W||ie)}),a.jsxs("div",{ref:ze,className:St,style:{position:Ce?"absolute":"relative",inset:Ce?0:void 0,width:"100%",...Ce&&re?{width:re,maxWidth:"100%"}:void 0},children:[nt&&Ce?a.jsx("div",{className:`${Mt} ${e}-titles-fade-out`,children:xn(nt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${Ce?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:xn(ie)})]})]}),vt(),bn()]}),Tt=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:E.scalingValue(Q??0,i),height:E.scalingValue(Q??0,i),marginRight:ge,"--close-icon-hover-color":T},children:[a.jsx("button",{ref:ye,type:"button",className:`${e}-close-icon-inner`,onClick:lt,"aria-label":"Close",children:a.jsx(gn,{url:$??"",fill:R,hoverFill:i&&!r?R:T,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ge,height:"100%",pointerEvents:"auto"}})]}),Vt=(we,qe)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[Ut||Lt?Ie():null,kt?D("two-row"):null,qe!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:qe},children:we}):a.jsxs(a.Fragment,{children:[we,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),vt()]}),Pt=we=>{if(!we)return null;const qe=Ti(e,we,k,ce,I);return a.jsx(a.Fragment,{children:qe.map(A=>zt(A,"single-row",Ot(qe,A,"single-row")))})},Zt=we=>{if(!we)return null;const qe=Ti(e,we,k,ce,I),A=qe.find(ae=>ae.prefix==="title1");return A?zt(A,"two-row-top",Ot(qe,A,"two-row-top")):null},on=(we,qe=!1)=>{const A=we?Ti(e,we,k,ce,I):[],ae=A.filter(je=>je.prefix==="title2"||je.prefix==="title3"),he=o&&qe;return ae.length>0||he||(H??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[ae.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[ae.map(je=>zt(je,"two-row-bottom",Ot(A,je,"two-row-bottom"))),qe&&o?a.jsxs(a.Fragment,{children:[pi(),Kn()]}):null]}):null,(H??0)>0||he?a.jsx("div",{"data-controls":he?"titleRowMarginBottom":void 0,"data-controls-axis":he?"y":void 0,"data-controls-reverse":he?"":void 0,className:he?`${e}-control`:void 0,style:{height:Bt,width:"100%",flexShrink:0,pointerEvents:he?"auto":"none"}}):null]}):null},Wn=(we,qe=!1)=>a.jsxs(a.Fragment,{children:[Vt(Zt(we)),on(we,qe)]}),xn=we=>ee?a.jsx("div",{className:`${e}-titles-row-two-row`,children:Wn(we)}):we?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Pt(we)}):null,ui=()=>{const we=ee?-1:Ae.findIndex(ae=>ae.prefix==="title1"),qe=!ee&&(o||(q??0)>0)?(()=>{const ae=q??0,he=we>=0?gt[we]:Wt.title1Width,Pe=Math.max(ae,ii);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(he),style:{position:"absolute",top:0,left:0,width:z(Pe),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,A=Ae.flatMap((ae,he)=>{if(!ae.marginLeftKey)return[];const Pe=At[ae.marginLeftKey]??0,je=rp(Ae,gt,At,he)+Xt(),mt=Math.max(Pe,ii);return a.jsx("div",{"data-controls":ae.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(gt[he]),style:{position:"absolute",top:0,left:z(je),width:z(mt),height:"100%",pointerEvents:"auto"}},ae.marginLeftKey)});return qe?[qe,...A]:A},dn=()=>Ae.map((we,qe)=>{const A=yn(qe,gt),he=Qt(qe)-Pn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":we.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(A),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:z(he),width:z(Pn),height:"100%",pointerEvents:"auto"}})},`${we.widthKey}-junction`)}),pi=()=>ut.flatMap((we,qe)=>{if(!we.marginLeftKey)return[];const A=At[we.marginLeftKey]??0,ae=Dt(qe),he=Math.max(A,ii),{resolvedWidth:Pe}=$t(we,"two-row-bottom");return a.jsx("div",{"data-controls":we.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Pe),style:{position:"absolute",top:0,left:z(ae),width:z(he),height:"100%",pointerEvents:"auto"}},we.marginLeftKey)}),Kn=()=>ut.map((we,qe)=>{const{maxWidth:A}=$t(we,"two-row-bottom"),he=jt(qe)-Pn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":we.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(A),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:z(he),width:z(Pn),height:"100%",pointerEvents:"auto"}})},`${we.widthKey}-junction`)}),bn=()=>!o||ee?null:a.jsxs(a.Fragment,{children:[ui(),dn()]}),gi=we=>{const qe=!we.objectFit&&li(x);return{className:`${e}-slide-image-cell${qe?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:M,maxHeight:f,...qe?{"--image-aspect-ratio":ja(x)}:{}}}},eo=we=>we.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":we.objectFit}}:li(x)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},Sn=we=>{if(we.length===0)return null;const qe=we.length>1,A=as(U),ae=`calc(-0.5 * (${A} + ${U}))`;if(we.length===1){const he=we[0];return a.jsx("div",{...gi(he),children:a.jsx("img",{...eo(he),src:he.assetId,alt:he.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:qe?{gap:U}:void 0,children:we.map((he,Pe)=>a.jsxs("div",{...gi(he),children:[a.jsx("img",{...eo(he),src:he.assetId,alt:he.name??"",draggable:!1}),o&&qe&&Pe<we.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:ae,width:A,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${he.assetId}-${Pe}`))})},Qn=!!(ie!=null&&ie.title2||ie!=null&&ie.title3||nt!=null&&nt.title2||nt!=null&&nt.title3||(H??0)>0||o),to=()=>a.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[a.jsx("div",{ref:Ze,className:St,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Wn(W||ie)}),a.jsxs("div",{ref:ze,className:`${e}-titles-row-two-row`,style:{...Ce&&F?{minHeight:F}:void 0,...Ce&&re?{width:re,maxWidth:"100%"}:void 0},children:[Vt(a.jsxs("div",{className:St,style:{position:Ce?"absolute":"relative",inset:Ce?0:void 0,width:"100%"},children:[nt&&Ce?a.jsx("div",{className:`${Qe} ${e}-titles-fade-out`,children:Zt(nt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${Ce?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:Zt(ie)})]}),Ce&&F?F:void 0),Qn?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[nt&&Ce?a.jsx("div",{className:`${Mt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:on(nt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${Ce?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${ee?` ${e}-titles-layer-in-stacked`:""}`,children:on(ie,!0)})]}):null]})]}),no=()=>{const we=Qn;return a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...we?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:we?void 0:{flex:"0 0 auto",height:"auto"},children:Wn(ie,!0)}),bn()]})};return a.jsxs("div",{ref:Ue,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ht||lt()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:Ft?void 0:-1,style:{opacity:me?1:0,transition:"opacity 300ms ease",pointerEvents:me?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:g,...tt}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:be,...Ne,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Ge,onClick:we=>we.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":xe&&se.length>1?"true":"false",onPointerDown:xe?xt:void 0,onPointerUp:xe?pt:void 0,onPointerCancel:xe?It:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[bt&&te?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:we=>{we.target===we.currentTarget&&ot(fe)},children:a.jsx("div",{className:`${e}-slide-area`,children:Sn(bt.images)})},`slide-out-${fe}`):null,a.jsx("div",{className:`${e}-slide-layer-in${te?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:pe?Sn(pe.images):null})},`slide-in-${fe}-${de}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:We,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:G,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...ee?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${ee?` ${e}-lightbox-content-area-stacked`:""}`,children:Me&&a.jsx("div",{className:`${e}-text-bar-cell${ee?` ${e}-text-bar-cell-stacked`:""}`,style:ee?void 0:{flex:1,minWidth:0,width:"100%"},children:ee?_==="fade"?to():no():_==="fade"?at():Ct()})})})]})]})]})};function sb(e){return`
|
|
15525
15521
|
.${e}-wrapper {
|
|
15526
15522
|
position: relative;
|
|
15527
15523
|
width: 100%;
|
|
@@ -19074,7 +19070,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
19074
19070
|
pointer-events: auto;
|
|
19075
19071
|
flex-shrink: 0;
|
|
19076
19072
|
}
|
|
19077
|
-
`}const Dn=500,Qo=650,Cn="cubic-bezier(0.22, 1, 0.36, 1)",Kb=72,Qb=50,Zb=1e4,Jb=650,eS=500;function tS(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,r=e.top-t.top;return`translate(${o}px, ${r}px) scale(${n}, ${i})`}function Cp(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=Sa(e);return{left:i.x,top:i.y,width:i.width,height:i.height}}const n=e.getBoundingClientRect();return{left:n.left,top:n.top,width:n.width,height:n.height}}function nS(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Cp(i,n):null}function iS(e){return e.reduce((t,n,i)=>{var o;return(o=n.image)!=null&&o.assetId&&t.push({gridIndex:i,items:[n.image],entry:{title1:n.title??"",title2:n.subtitle??"",title3:n.caption??""}}),t},[])}function or(e,t,n){var o;if(e.length<=1)return null;const i=(t+n+e.length)%e.length;return((o=e[i])==null?void 0:o.items[0])??null}function pd(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return or(e,i,n)}const oS=.03;function Tp(e){return e.width*oS}const bs={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Yr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function gd(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function rS(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function qs(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,c=o/r;if(l>c){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const d=r*l;return{width:d,height:r,left:i.left+(o-d)/2,top:i.top}}function aS(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:qs(e,t.width,t.height)}function sS(e,t){if(Va(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.assetId,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.assetId,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.assetId,n.naturalWidth,n.naturalHeight)},n.src=e.assetId}function lS(e){const t=new Set,n=[];for(const i of e){const o=i.image;!(o!=null&&o.assetId)||t.has(o.assetId)||(t.add(o.assetId),n.push(o))}return n}function cS({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Va(t)?a.jsx("video",{src:t.assetId,preload:"auto",muted:!0,playsInline:!0},t.assetId):a.jsx("img",{src:t.assetId,alt:""},t.assetId))})}function _o(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:c}=n,d=Tp(n);return t==="left"?{left:l+d-i,top:r,width:i,height:o}:{left:l+c-d,top:r,width:i,height:o}}function Ta(e,t,n){const i=_o(e,t,n);return{...i,left:2*i.left-e.left}}function dS(e,t,n){const{left:i,width:o}=n,r=Tp(n);return t==="left"?{left:i,top:e.top,width:r,height:e.height}:{left:i+o-r,top:e.top,width:r,height:e.height}}function Ip(e,t,n,i){const o=_o(e,"left",i),r=_o(e,"right",i),l=Ta(e,"left",i),c=Ta(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:r,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:c,end:r};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:r};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:r,end:c};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function uS(e,t,n,i){const{start:o,end:r}=Ip(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function pS(e,t,n){const i=_o(e,t,n),o=Ta(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Va(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.assetId)}function gS({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const c=s.useRef(null);return s.useEffect(()=>{const d=c.current;return n==null||n(d??null),()=>{d==null||d.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:c,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:d=>d.stopPropagation(),style:o},e)})}function Kr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Va(e)?a.jsx("video",{src:e.assetId,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.assetId,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.assetId,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.assetId,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function mS({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,canNavigate:d,lightboxEntries:u,entryIdx:p,layoutId:y,sourceRect:x,resolveCloseSourceRect:g,onClose:h,onPrev:b,onNext:S}){const _=s.useRef(null),v=s.useRef(null),L=s.useRef(null),P=s.useRef(new Map),[q,X]=s.useState(0),B=s.useRef(null),H=s.useRef(0),O=s.useRef(0),C=s.useRef("none"),$=s.useRef(!1),Q=s.useRef(!1),R=s.useRef(!1),T=s.useRef(null),w=s.useRef(null),V=s.useRef(null),z=s.useRef(()=>{}),U=s.useRef(null),M=s.useRef(null),f=s.useRef(null),K=s.useRef(!1),[G,ge]=s.useState(null),[k,ce]=s.useState(bs),[I,ue]=s.useState(0),[ee,xe]=s.useState("opening"),[Le,se]=s.useState(0),[de,Z]=s.useState(0),[pe,ie]=s.useState(!1),[me,ve]=s.useState(null),[Ee,Re]=s.useState(null),[Ce,$e]=s.useState(null),[m,Y]=s.useState(!1),[te,oe]=s.useState(null),[fe,N]=s.useState(!1),F=s.useRef(!1),[ne,re]=s.useState(!1),[J,W]=s.useState(!1),Se=s.useRef(n),le=s.useRef(void 0),j=t[n],Te=j?Va(j):!1,Fe=de!==0||pe,Ye=!l&&(!r||!!c),De=d&&!l,ze=u.length>1,Ze=s.useCallback((D,Ie)=>t.length<=1?null:t[(D+Ie+t.length)%t.length]??null,[t]),Ue=ze?or(u,p,-1):Ze(n,-1),ye=ze?or(u,p,1):Ze(n,1),_e=me===-1&&Fe?ze&&Ee!==null?or(u,Ee,-1):Ce!==null?Ze(Ce,-1):null:null,Ve=me===1&&Fe?ze&&Ee!==null?or(u,Ee,1):Ce!==null?Ze(Ce,1):null:null,Je=_e&&_e.assetId!==(Ue==null?void 0:Ue.assetId)?_e:null,et=Ve&&Ve.assetId!==(ye==null?void 0:ye.assetId)?Ve:null,ot=Ue&&De?(()=>{const D=ze?pd(u,p,-1):t.length>2?Ze((n-1+t.length)%t.length,-1):null;return D&&D.assetId!==Ue.assetId?D:null})():null,lt=ye&&De?(()=>{const D=ze?pd(u,p,1):t.length>2?Ze((n+1)%t.length,1):null;return D&&D.assetId!==ye.assetId?D:null})():null,Ke=Je??ot,ht=et??lt,tt=s.useCallback((D,Ie,Be)=>{if(!D||!Ie||!Be)return;const ke=P.current,vt=ke.get(D);(vt==null?void 0:vt.width)===Ie&&(vt==null?void 0:vt.height)===Be||(ke.set(D,{width:Ie,height:Be}),X(Ct=>Ct+1))},[]),Ge=s.useCallback(D=>{if(!(D!=null&&D.assetId))return null;const Ie=P.current.get(D.assetId);return aS(v.current,Ie)},[q,I]),We=s.useCallback(()=>{if(!j)return;const D=Ge(j);if(D){ge(D);return}const Ie=v.current;Ie&&ge(gd(Ie))},[j,Ge]),Ne=s.useCallback(D=>{if(ze){const Ie=u.length;Re((p+D+Ie)%Ie),$e(null);return}t.length>1&&($e((n+D+t.length)%t.length),Re(null))},[ze,u.length,p,t.length,n]),be=s.useCallback(D=>{R.current=D,ie(D)},[]),He=s.useCallback(()=>{T.current!==null&&(window.clearTimeout(T.current),T.current=null)},[]),Xe=s.useCallback(()=>{He(),T.current=window.setTimeout(()=>{He(),be(!1)},Qo+32)},[He,be]),ct=s.useCallback(()=>{const D=_.current;if(!D){ce({left:0,top:0,width:typeof window<"u"?window.innerWidth:bs.width,height:typeof window<"u"?window.innerHeight:bs.height});return}const Ie=D.getBoundingClientRect();ce({left:Ie.left,top:Ie.top,width:Ie.width,height:Ie.height})},[]),rt=s.useCallback((D,Ie)=>{if(Fe){if(ne&&!pe)return`translate(${de}px, 0px)`;if(pe&&me!==null){const Be=Ge(D);if(!Be)return;const{x:ke,y:vt}=uS(Be,Ie,me,k);return`translate(${ke}px, ${vt}px)`}if(pe)return"translate(0px, 0px)"}},[Fe,ne,pe,de,me,k,Ge]),xt=s.useCallback(()=>{const D=w.current;w.current=null,He(),be(!1),ve(null),Re(null),$e(null),Z(0),re(!1),$.current=!1,O.current=0,C.current="none",D===-1?b():D===1&&S()},[He,be,b,S]),pt=s.useCallback(()=>{He(),T.current=window.setTimeout(()=>{w.current!==null&&xt()},Qo+32)},[He,xt]),It=s.useCallback(()=>{He(),w.current=null,be(!1),ve(null),Re(null),$e(null),Z(0),re(!1),$.current=!1,O.current=0,C.current="none"},[He,be]),nt=s.useCallback(D=>{if(!(!De||!G)){if(R.current){if(w.current===D){V.current=D,xt();return}It()}He(),Ne(D),w.current=D,ve(D),be(!0),pt()}},[De,G,xt,It,He,Ne,be,pt]);z.current=nt;const bt=s.useCallback(()=>{U.current=null,K.current=!1,M.current!==null&&(window.clearInterval(M.current),M.current=null),f.current!==null&&(window.clearTimeout(f.current),f.current=null)},[]),Lt=s.useCallback(D=>{M.current!==null&&window.clearInterval(M.current);const Ie=K.current?eS:Jb;M.current=window.setInterval(()=>{z.current(D)},Ie)},[]),Ut=s.useCallback(D=>{U.current!==D&&(bt(),U.current=D,K.current=!1,z.current(D),Lt(D),f.current=window.setTimeout(()=>{f.current=null,U.current===D&&(K.current=!0,Lt(D))},Zb))},[bt,Lt]),Ft=s.useCallback(()=>{const D=v.current;if(!D)return;const Ie=j==null?void 0:j.assetId,Be=Ie?P.current.get(Ie):void 0;if(Be!=null&&Be.width&&(Be!=null&&Be.height)){ge(qs(D,Be.width,Be.height));return}const ke=L.current;if(ke&&Ie&&(ke.src===Ie||ke.currentSrc===Ie)){const{width:Ct,height:at}=rS(ke);if(Ct&&at){tt(Ie,Ct,at),ge(qs(D,Ct,at));return}}const vt=gd(D);!vt.width||!vt.height||ge(vt)},[j==null?void 0:j.assetId,tt]),Me=s.useCallback(D=>{if(L.current=D,!!D){if(D instanceof HTMLVideoElement){D.readyState>=1&&D.videoWidth>0&&Ft();return}D.complete&&D.naturalWidth>0&&Ft()}},[Ft]),Oe=s.useCallback(()=>{ct(),Ft(),ue(D=>D+1)},[ct,Ft]);s.useEffect(()=>{Oe();const D=v.current,Ie=_.current,Be=new ResizeObserver(()=>Oe());return D&&Be.observe(D),Ie&&Be.observe(Ie),window.addEventListener("resize",Oe),()=>{Be.disconnect(),window.removeEventListener("resize",Oe)}},[Oe,n,y]),s.useLayoutEffect(()=>{if(!j)return;const D=L.current;if(D){if(D instanceof HTMLImageElement&&D.complete&&D.naturalWidth>0){Ft();return}D instanceof HTMLVideoElement&&D.readyState>=1&&D.videoWidth>0&&Ft()}},[j==null?void 0:j.assetId,n,Ft]),s.useEffect(()=>{We()},[We,q]),s.useEffect(()=>{const D=new Set,Ie=[],Be=ke=>{!(ke!=null&&ke.assetId)||D.has(ke.assetId)||(D.add(ke.assetId),Ie.push(ke))};t.forEach(Be),u.forEach(ke=>ke.items.forEach(Be)),Ie.forEach(ke=>{P.current.has(ke.assetId)||sS(ke,tt)})},[t,u,tt]),s.useEffect(()=>{if(ee!=="opening"||!G)return;if(!x){xe("open");return}Y(!1);const D=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Y(!0),xe("open")})});return()=>cancelAnimationFrame(D)},[ee,G,x]),s.useEffect(()=>{if(ee!=="closing")return;const D=setTimeout(()=>h(),Dn);return()=>clearTimeout(D)},[ee,h]),s.useEffect(()=>()=>{He()},[He]),s.useLayoutEffect(()=>{Se.current===n&&le.current===(j==null?void 0:j.assetId)||(He(),w.current=null,ve(null),Re(null),$e(null),se(0),Z(0),be(!1),W(!1),re(!1),H.current=0,O.current=0,C.current="none",$.current=!1,B.current=null,Q.current=!1,L.current=null,We(),Se.current=n,le.current=j==null?void 0:j.assetId)},[n,j==null?void 0:j.assetId,be,He,We]),s.useLayoutEffect(()=>{const D=V.current;D!==null&&(V.current=null,requestAnimationFrame(()=>{z.current(D)}))},[n,p,j==null?void 0:j.assetId]),s.useLayoutEffect(()=>{if(ee==="opening"){F.current=!1,N(!1);return}if(ee!=="open"||F.current)return;if(!Ue&&!ye){F.current=!0;return}N(!1);const D=requestAnimationFrame(()=>{requestAnimationFrame(()=>{N(!0),F.current=!0})});return()=>cancelAnimationFrame(D)},[ee,Ue==null?void 0:Ue.assetId,ye==null?void 0:ye.assetId]),s.useEffect(()=>{if(ee!=="open")return;const D=()=>{const at=Tt=>{Tt.stopPropagation(),Tt.preventDefault(),document.removeEventListener("click",at,!0)};document.addEventListener("click",at,!0)},Ie=at=>{const Tt=at<0?1:-1;He(),Ne(Tt),w.current=Tt,ve(Tt),be(!0),pt()},Be=at=>{if(Math.abs(at)>Qb&&De){Ie(at);return}w.current=null,ve(null),Re(null),$e(null),be(!0),Z(0),Xe()},ke=at=>{if(at.touches.length!==1||R.current)return;const Tt=at.touches[0];Q.current=!0,B.current={x:Tt.clientX,y:Tt.clientY},C.current="none",O.current=0,$.current=!1},vt=at=>{if(!B.current||at.touches.length!==1||R.current)return;const Tt=at.touches[0],Vt=Tt.clientX-B.current.x,Pt=Tt.clientY-B.current.y;if(C.current==="none"){if(Math.abs(Vt)<10&&Math.abs(Pt)<10)return;if(Math.abs(Vt)>Math.abs(Pt)){if(!De)return;C.current="horizontal"}else if(Pt>0){if(!Ye)return;C.current="vertical"}else return}if(C.current==="horizontal"){$.current=!0,re(!0),O.current=Vt,Z(Vt),at.preventDefault();return}C.current==="vertical"&&($.current=!0,re(!0),H.current=Pt,se(Pt),at.preventDefault())},Ct=()=>{if(!B.current)return;const at=C.current,Tt=$.current;if(Tt&&at==="horizontal")Be(O.current),D();else if(Tt&&at==="vertical"){const Vt=H.current;if(Ye&&Vt>Kb){const Pt=window.innerHeight;H.current=Pt,W(!0),se(Pt),xe("closing")}else H.current=0,se(0);D()}else at==="horizontal"&&Math.abs(O.current)>0&&(Be(O.current),D());B.current=null,C.current="none",O.current=0,$.current=!1,re(!1)};return document.addEventListener("touchstart",ke,{passive:!0}),document.addEventListener("touchmove",vt,{passive:!1}),document.addEventListener("touchend",Ct),document.addEventListener("touchcancel",Ct),()=>{document.removeEventListener("touchstart",ke),document.removeEventListener("touchmove",vt),document.removeEventListener("touchend",Ct),document.removeEventListener("touchcancel",Ct)}},[ee,De,be,Xe,He,Ye,pt,Ne]);const St=s.useCallback(()=>{const D=(g==null?void 0:g())??x??null;D&&G&&(oe(D),Y(!0)),xe("closing")},[g,x,G]);s.useEffect(()=>{const D=ke=>{if(ke.key==="Escape"){if(r&&c||ee==="closing")return;bt(),St();return}if(ke.key!=="ArrowLeft"&&ke.key!=="ArrowRight"||ee!=="open"||!De)return;ke.preventDefault();const vt=ke.key==="ArrowLeft"?-1:1;ke.repeat&&U.current===vt||Ut(vt)},Ie=ke=>{if(ke.key!=="ArrowLeft"&&ke.key!=="ArrowRight")return;const vt=ke.key==="ArrowLeft"?-1:1;U.current===vt&&bt()},Be=()=>{bt()};return window.addEventListener("keydown",D),window.addEventListener("keyup",Ie),window.addEventListener("blur",Be),()=>{window.removeEventListener("keydown",D),window.removeEventListener("keyup",Ie),window.removeEventListener("blur",Be),bt()}},[ee,r,c,St,De,Ut,bt]),s.useEffect(()=>{ee!=="open"&&bt()},[ee,bt]);const Mt=()=>{ee==="closing"||l||St()},Qe=ee==="open",kt=ee==="closing",Bt=Le>0?Math.max(0,1-Le/500):1,Wt=Le>0?Math.max(.35,1-Le/500):1,At=s.useCallback(D=>{if(!(D.propertyName!=="transform"||!R.current)){if(w.current!==null){xt();return}He(),be(!1)}},[He,be,xt]),Ae=ee==="closing"?te??x:x,ft=Ae&&G&&(ee==="opening"||kt)?tS(Ae,G):void 0,gt=Fe&&j?rt(j,"center"):Le>0?`translateY(${Le}px)`:ft,dt=G?Yr(G,k):null,yt=!!(Ae&&G),ut=yt&&(ee==="closing"||ee==="open"&&m),it={position:"absolute",top:dt==null?void 0:dt.top,left:dt==null?void 0:dt.left,width:dt==null?void 0:dt.width,height:dt==null?void 0:dt.height,objectFit:"contain",transformOrigin:"top left",transform:gt,opacity:Le>0?Wt:yt?1:ee==="opening"||kt?0:1,transition:ne&&!pe?"none":pe?`transform ${Qo}ms ${Cn}`:J?`transform ${Dn}ms ${Cn}, opacity ${Dn}ms ${Cn}`:ut?`transform ${Dn}ms ${Cn}`:ee==="opening"||kt?`opacity ${Dn}ms ${Cn}`:"none",pointerEvents:Te&&Qe&&!Fe?"auto":"none",touchAction:Te&&Qe?"none":void 0,zIndex:1,overflow:Te?"hidden":void 0},Nt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Qe&&!Fe?"auto":"none"},$t=(D,Ie,Be="adjacent")=>{const ke=Ge(D);if(!ke)return{display:"none"};const vt=Be==="far"?Ie==="left"?"far-left":"far-right":Ie==="left"?"left-adjacent":"right-adjacent",{start:Ct}=me!==null?Ip(ke,vt,me,k):{start:Be==="far"?Ta(ke,Ie,k):_o(ke,Ie,k)},at=Yr(Ct,k),Tt=rt(D,vt),Vt=!Fe&&Be==="adjacent"&&Qe&&!fe?pS(ke,Ie,k):null,Pt=Be==="far"&&Fe&&me===(Ie==="left"?-1:1),Zt=ne&&!pe?!1:pe,on=Be==="adjacent"&&Qe&&fe&&!Fe;return{position:"absolute",top:at.top,left:at.left,width:at.width,height:at.height,objectFit:"contain",transform:Tt??(Vt?`translate(${Vt.x}px, ${Vt.y}px)`:void 0),opacity:Be==="far"?Qe&&Pt?1:0:Qe?1:0,transition:Zt?Be==="far"?`transform ${Qo}ms ${Cn}`:`transform ${Qo}ms ${Cn}, opacity ${Dn}ms ${Cn}`:on?`transform ${Dn}ms ${Cn}`:ee==="opening"||kt?`opacity ${Dn}ms ${Cn}`:"none",pointerEvents:"none",zIndex:1}},Qt=(D,Ie)=>{const Be=Ge(D);return Be?dS(_o(Be,Ie,k),Ie,k):null},Xt=D=>Ie=>{if(!l){if(Q.current){Q.current=!1;return}Ie.stopPropagation(),nt(D)}},Ot=Ue?Qt(Ue,"left"):null,jt=ye?Qt(ye,"right"):null,Dt=Ot?Yr(Ot,k):null,zt=jt?Yr(jt,k):null;return a.jsxs("div",{ref:_,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:ee==="open"?"none":void 0},onClick:Mt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Qe?Bt:0,transition:ne?"none":`opacity ${Dn}ms ${Cn}`,pointerEvents:"none"}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[a.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:v,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Qe?1:0,transition:ne?"none":`opacity ${Dn}ms ${Cn}`,pointerEvents:"none"},children:a.jsx(sp,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,onClose:Mt})})]}),Qe&&Ke&&a.jsx(Kr,{media:Ke,style:$t(Ke,"left","far"),onMeasure:tt,onTransitionEnd:At},`far-prev-${Ke.assetId}`),Qe&&Ue&&a.jsxs(a.Fragment,{children:[a.jsx(Kr,{media:Ue,style:$t(Ue,"left"),onMeasure:tt,onTransitionEnd:At},`prev-${Ue.assetId}`),Dt&&a.jsx("div",{style:{position:"absolute",top:Dt.top,left:Dt.left,width:Dt.width,height:Dt.height,cursor:l||ne?"default":"pointer",pointerEvents:l||ne?"none":"auto",zIndex:3},onClick:Xt(-1)})]}),Qe&&ye&&a.jsxs(a.Fragment,{children:[a.jsx(Kr,{media:ye,style:$t(ye,"right"),onMeasure:tt,onTransitionEnd:At},`next-${ye.assetId}`),zt&&a.jsx("div",{style:{position:"absolute",top:zt.top,left:zt.left,width:zt.width,height:zt.height,cursor:l||ne?"default":"pointer",pointerEvents:l||ne?"none":"auto",zIndex:3},onClick:Xt(1)})]}),Qe&&ht&&a.jsx(Kr,{media:ht,style:$t(ht,"right","far"),onMeasure:tt,onTransitionEnd:At},`far-next-${ht.assetId}`),G&&j&&(Te?a.jsx(gS,{src:j.assetId,phase:ee,onMediaElement:Me,wrapperStyle:it,videoStyle:Nt,onLoadedMetadata:Ft,onTransitionEnd:At},`${n}-${j.assetId}`):a.jsx("img",{ref:Me,src:j.assetId,alt:j.name,onLoad:Ft,onTransitionEnd:At,style:it},`${n}-${j.assetId}`))]})}const hS=20,fS=.18;function yS(e){return`
|
|
19073
|
+
`}const Dn=500,Qo=650,Cn="cubic-bezier(0.22, 1, 0.36, 1)",Kb=72,Qb=50,Zb=1e4,Jb=650,eS=500;function tS(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,r=e.top-t.top;return`translate(${o}px, ${r}px) scale(${n}, ${i})`}function Cp(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=Sa(e);return{left:i.x,top:i.y,width:i.width,height:i.height}}const n=e.getBoundingClientRect();return{left:n.left,top:n.top,width:n.width,height:n.height}}function nS(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Cp(i,n):null}function iS(e){return e.reduce((t,n,i)=>{var o;return(o=n.image)!=null&&o.assetId&&t.push({gridIndex:i,items:[n.image],entry:{title1:n.title??"",title2:n.subtitle??"",title3:n.caption??""}}),t},[])}function or(e,t,n){var o;if(e.length<=1)return null;const i=(t+n+e.length)%e.length;return((o=e[i])==null?void 0:o.items[0])??null}function pd(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return or(e,i,n)}const oS=.03;function Tp(e){return e.width*oS}const bs={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Yr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function gd(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function rS(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function qs(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,c=o/r;if(l>c){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const d=r*l;return{width:d,height:r,left:i.left+(o-d)/2,top:i.top}}function aS(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:qs(e,t.width,t.height)}function sS(e,t){if(Va(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.assetId,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.assetId,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.assetId,n.naturalWidth,n.naturalHeight)},n.src=e.assetId}function lS(e){const t=new Set,n=[];for(const i of e){const o=i.image;!(o!=null&&o.assetId)||t.has(o.assetId)||(t.add(o.assetId),n.push(o))}return n}function cS({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Va(t)?a.jsx("video",{src:t.assetId,preload:"auto",muted:!0,playsInline:!0},t.assetId):a.jsx("img",{src:t.assetId,alt:""},t.assetId))})}function _o(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:c}=n,d=Tp(n);return t==="left"?{left:l+d-i,top:r,width:i,height:o}:{left:l+c-d,top:r,width:i,height:o}}function Ta(e,t,n){const i=_o(e,t,n);return{...i,left:2*i.left-e.left}}function dS(e,t,n){const{left:i,width:o}=n,r=Tp(n);return t==="left"?{left:i,top:e.top,width:r,height:e.height}:{left:i+o-r,top:e.top,width:r,height:e.height}}function Ip(e,t,n,i){const o=_o(e,"left",i),r=_o(e,"right",i),l=Ta(e,"left",i),c=Ta(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:r,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:c,end:r};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:r};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:r,end:c};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function uS(e,t,n,i){const{start:o,end:r}=Ip(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function pS(e,t,n){const i=_o(e,t,n),o=Ta(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Va(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.assetId)}function gS({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const c=s.useRef(null);return s.useEffect(()=>{const d=c.current;return n==null||n(d??null),()=>{d==null||d.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:c,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:d=>d.stopPropagation(),style:o},e)})}function Kr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Va(e)?a.jsx("video",{src:e.assetId,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.assetId,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.assetId,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.assetId,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function mS({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,canNavigate:d,lightboxEntries:u,entryIdx:p,layoutId:y,sourceRect:x,resolveCloseSourceRect:g,onClose:h,onPrev:b,onNext:S}){const _=s.useRef(null),v=s.useRef(null),L=s.useRef(null),P=s.useRef(new Map),[q,X]=s.useState(0),B=s.useRef(null),H=s.useRef(0),O=s.useRef(0),C=s.useRef("none"),$=s.useRef(!1),Q=s.useRef(!1),R=s.useRef(!1),T=s.useRef(null),w=s.useRef(null),V=s.useRef(null),z=s.useRef(()=>{}),U=s.useRef(null),M=s.useRef(null),f=s.useRef(null),K=s.useRef(!1),[G,ge]=s.useState(null),[k,ce]=s.useState(bs),[I,ue]=s.useState(0),[ee,xe]=s.useState("opening"),[Le,se]=s.useState(0),[de,Z]=s.useState(0),[pe,ie]=s.useState(!1),[me,ve]=s.useState(null),[Ee,Re]=s.useState(null),[Ce,$e]=s.useState(null),[m,Y]=s.useState(!1),[te,oe]=s.useState(null),[fe,N]=s.useState(!1),F=s.useRef(!1),[ne,re]=s.useState(!1),[J,W]=s.useState(!1),Se=s.useRef(n),le=s.useRef(void 0),j=t[n],Te=j?Va(j):!1,Fe=de!==0||pe,Ye=!l&&(!r||!!c),De=d&&!l,ze=u.length>1,Ze=s.useCallback((D,Ie)=>t.length<=1?null:t[(D+Ie+t.length)%t.length]??null,[t]),Ue=ze?or(u,p,-1):Ze(n,-1),ye=ze?or(u,p,1):Ze(n,1),_e=me===-1&&Fe?ze&&Ee!==null?or(u,Ee,-1):Ce!==null?Ze(Ce,-1):null:null,Ve=me===1&&Fe?ze&&Ee!==null?or(u,Ee,1):Ce!==null?Ze(Ce,1):null:null,Je=_e&&_e.assetId!==(Ue==null?void 0:Ue.assetId)?_e:null,et=Ve&&Ve.assetId!==(ye==null?void 0:ye.assetId)?Ve:null,ot=Ue&&De?(()=>{const D=ze?pd(u,p,-1):t.length>2?Ze((n-1+t.length)%t.length,-1):null;return D&&D.assetId!==Ue.assetId?D:null})():null,lt=ye&&De?(()=>{const D=ze?pd(u,p,1):t.length>2?Ze((n+1)%t.length,1):null;return D&&D.assetId!==ye.assetId?D:null})():null,Ke=Je??ot,ht=et??lt,tt=s.useCallback((D,Ie,Be)=>{if(!D||!Ie||!Be)return;const ke=P.current,vt=ke.get(D);(vt==null?void 0:vt.width)===Ie&&(vt==null?void 0:vt.height)===Be||(ke.set(D,{width:Ie,height:Be}),X(Ct=>Ct+1))},[]),Ge=s.useCallback(D=>{if(!(D!=null&&D.assetId))return null;const Ie=P.current.get(D.assetId);return aS(v.current,Ie)},[q,I]),We=s.useCallback(()=>{if(!j)return;const D=Ge(j);if(D){ge(D);return}const Ie=v.current;Ie&&ge(gd(Ie))},[j,Ge]),Ne=s.useCallback(D=>{if(ze){const Ie=u.length;Re((p+D+Ie)%Ie),$e(null);return}t.length>1&&($e((n+D+t.length)%t.length),Re(null))},[ze,u.length,p,t.length,n]),be=s.useCallback(D=>{R.current=D,ie(D)},[]),He=s.useCallback(()=>{T.current!==null&&(window.clearTimeout(T.current),T.current=null)},[]),Xe=s.useCallback(()=>{He(),T.current=window.setTimeout(()=>{He(),be(!1)},Qo+32)},[He,be]),ct=s.useCallback(()=>{const D=_.current;if(!D){ce({left:0,top:0,width:typeof window<"u"?window.innerWidth:bs.width,height:typeof window<"u"?window.innerHeight:bs.height});return}const Ie=D.getBoundingClientRect();ce({left:Ie.left,top:Ie.top,width:Ie.width,height:Ie.height})},[]),rt=s.useCallback((D,Ie)=>{if(Fe){if(ne&&!pe)return`translate(${de}px, 0px)`;if(pe&&me!==null){const Be=Ge(D);if(!Be)return;const{x:ke,y:vt}=uS(Be,Ie,me,k);return`translate(${ke}px, ${vt}px)`}if(pe)return"translate(0px, 0px)"}},[Fe,ne,pe,de,me,k,Ge]),xt=s.useCallback(()=>{const D=w.current;w.current=null,He(),be(!1),ve(null),Re(null),$e(null),Z(0),re(!1),$.current=!1,O.current=0,C.current="none",D===-1?b():D===1&&S()},[He,be,b,S]),pt=s.useCallback(()=>{He(),T.current=window.setTimeout(()=>{w.current!==null&&xt()},Qo+32)},[He,xt]),It=s.useCallback(()=>{He(),w.current=null,be(!1),ve(null),Re(null),$e(null),Z(0),re(!1),$.current=!1,O.current=0,C.current="none"},[He,be]),nt=s.useCallback(D=>{if(!(!De||!G)){if(R.current){if(w.current===D){V.current=D,xt();return}It()}He(),Ne(D),w.current=D,ve(D),be(!0),pt()}},[De,G,xt,It,He,Ne,be,pt]);z.current=nt;const bt=s.useCallback(()=>{U.current=null,K.current=!1,M.current!==null&&(window.clearInterval(M.current),M.current=null),f.current!==null&&(window.clearTimeout(f.current),f.current=null)},[]),Lt=s.useCallback(D=>{M.current!==null&&window.clearInterval(M.current);const Ie=K.current?eS:Jb;M.current=window.setInterval(()=>{z.current(D)},Ie)},[]),Ut=s.useCallback(D=>{U.current!==D&&(bt(),U.current=D,K.current=!1,z.current(D),Lt(D),f.current=window.setTimeout(()=>{f.current=null,U.current===D&&(K.current=!0,Lt(D))},Zb))},[bt,Lt]),Ft=s.useCallback(()=>{const D=v.current;if(!D)return;const Ie=j==null?void 0:j.assetId,Be=Ie?P.current.get(Ie):void 0;if(Be!=null&&Be.width&&(Be!=null&&Be.height)){ge(qs(D,Be.width,Be.height));return}const ke=L.current;if(ke&&Ie&&(ke.src===Ie||ke.currentSrc===Ie)){const{width:Ct,height:at}=rS(ke);if(Ct&&at){tt(Ie,Ct,at),ge(qs(D,Ct,at));return}}const vt=gd(D);!vt.width||!vt.height||ge(vt)},[j==null?void 0:j.assetId,tt]),Me=s.useCallback(D=>{if(L.current=D,!!D){if(D instanceof HTMLVideoElement){D.readyState>=1&&D.videoWidth>0&&Ft();return}D.complete&&D.naturalWidth>0&&Ft()}},[Ft]),Oe=s.useCallback(()=>{ct(),Ft(),ue(D=>D+1)},[ct,Ft]);s.useEffect(()=>{Oe();const D=v.current,Ie=_.current,Be=new ResizeObserver(()=>Oe());return D&&Be.observe(D),Ie&&Be.observe(Ie),window.addEventListener("resize",Oe),()=>{Be.disconnect(),window.removeEventListener("resize",Oe)}},[Oe,n,y]),s.useLayoutEffect(()=>{if(!j)return;const D=L.current;if(D){if(D instanceof HTMLImageElement&&D.complete&&D.naturalWidth>0){Ft();return}D instanceof HTMLVideoElement&&D.readyState>=1&&D.videoWidth>0&&Ft()}},[j==null?void 0:j.assetId,n,Ft]),s.useEffect(()=>{We()},[We,q]),s.useEffect(()=>{const D=new Set,Ie=[],Be=ke=>{!(ke!=null&&ke.assetId)||D.has(ke.assetId)||(D.add(ke.assetId),Ie.push(ke))};t.forEach(Be),u.forEach(ke=>ke.items.forEach(Be)),Ie.forEach(ke=>{P.current.has(ke.assetId)||sS(ke,tt)})},[t,u,tt]),s.useEffect(()=>{if(ee!=="opening"||!G)return;if(!x){xe("open");return}Y(!1);const D=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Y(!0),xe("open")})});return()=>cancelAnimationFrame(D)},[ee,G,x]),s.useEffect(()=>{if(ee!=="closing")return;const D=setTimeout(()=>h(),Dn);return()=>clearTimeout(D)},[ee,h]),s.useEffect(()=>()=>{He()},[He]),s.useLayoutEffect(()=>{Se.current===n&&le.current===(j==null?void 0:j.assetId)||(He(),w.current=null,ve(null),Re(null),$e(null),se(0),Z(0),be(!1),W(!1),re(!1),H.current=0,O.current=0,C.current="none",$.current=!1,B.current=null,Q.current=!1,L.current=null,We(),Se.current=n,le.current=j==null?void 0:j.assetId)},[n,j==null?void 0:j.assetId,be,He,We]),s.useLayoutEffect(()=>{const D=V.current;D!==null&&(V.current=null,requestAnimationFrame(()=>{z.current(D)}))},[n,p,j==null?void 0:j.assetId]),s.useLayoutEffect(()=>{if(ee==="opening"){F.current=!1,N(!1);return}if(ee!=="open"||F.current)return;if(!Ue&&!ye){F.current=!0;return}N(!1);const D=requestAnimationFrame(()=>{requestAnimationFrame(()=>{N(!0),F.current=!0})});return()=>cancelAnimationFrame(D)},[ee,Ue==null?void 0:Ue.assetId,ye==null?void 0:ye.assetId]),s.useEffect(()=>{if(ee!=="open")return;const D=()=>{const at=Tt=>{Tt.stopPropagation(),Tt.preventDefault(),document.removeEventListener("click",at,!0)};document.addEventListener("click",at,!0)},Ie=at=>{const Tt=at<0?1:-1;He(),Ne(Tt),w.current=Tt,ve(Tt),be(!0),pt()},Be=at=>{if(Math.abs(at)>Qb&&De){Ie(at);return}w.current=null,ve(null),Re(null),$e(null),be(!0),Z(0),Xe()},ke=at=>{if(at.touches.length!==1||R.current)return;const Tt=at.touches[0];Q.current=!0,B.current={x:Tt.clientX,y:Tt.clientY},C.current="none",O.current=0,$.current=!1},vt=at=>{if(!B.current||at.touches.length!==1||R.current)return;const Tt=at.touches[0],Vt=Tt.clientX-B.current.x,Pt=Tt.clientY-B.current.y;if(C.current==="none"){if(Math.abs(Vt)<10&&Math.abs(Pt)<10)return;if(Math.abs(Vt)>Math.abs(Pt)){if(!De)return;C.current="horizontal"}else if(Pt>0){if(!Ye)return;C.current="vertical"}else return}if(C.current==="horizontal"){$.current=!0,re(!0),O.current=Vt,Z(Vt),at.preventDefault();return}C.current==="vertical"&&($.current=!0,re(!0),H.current=Pt,se(Pt),at.preventDefault())},Ct=()=>{if(!B.current)return;const at=C.current,Tt=$.current;if(Tt&&at==="horizontal")Be(O.current),D();else if(Tt&&at==="vertical"){const Vt=H.current;if(Ye&&Vt>Kb){const Pt=window.innerHeight;H.current=Pt,W(!0),se(Pt),xe("closing")}else H.current=0,se(0);D()}else at==="horizontal"&&Math.abs(O.current)>0&&(Be(O.current),D());B.current=null,C.current="none",O.current=0,$.current=!1,re(!1)};return document.addEventListener("touchstart",ke,{passive:!0}),document.addEventListener("touchmove",vt,{passive:!1}),document.addEventListener("touchend",Ct),document.addEventListener("touchcancel",Ct),()=>{document.removeEventListener("touchstart",ke),document.removeEventListener("touchmove",vt),document.removeEventListener("touchend",Ct),document.removeEventListener("touchcancel",Ct)}},[ee,De,be,Xe,He,Ye,pt,Ne]);const St=s.useCallback(()=>{const D=(g==null?void 0:g())??x??null;D&&G&&(oe(D),Y(!0)),xe("closing")},[g,x,G]);s.useEffect(()=>{const D=ke=>{if(ke.key==="Escape"){if(r&&c||ee==="closing")return;bt(),St();return}if(ke.key!=="ArrowLeft"&&ke.key!=="ArrowRight"||ee!=="open"||!De)return;ke.preventDefault();const vt=ke.key==="ArrowLeft"?-1:1;ke.repeat&&U.current===vt||Ut(vt)},Ie=ke=>{if(ke.key!=="ArrowLeft"&&ke.key!=="ArrowRight")return;const vt=ke.key==="ArrowLeft"?-1:1;U.current===vt&&bt()},Be=()=>{bt()};return window.addEventListener("keydown",D),window.addEventListener("keyup",Ie),window.addEventListener("blur",Be),()=>{window.removeEventListener("keydown",D),window.removeEventListener("keyup",Ie),window.removeEventListener("blur",Be),bt()}},[ee,r,c,St,De,Ut,bt]),s.useEffect(()=>{ee!=="open"&&bt()},[ee,bt]);const Mt=()=>{ee==="closing"||l||St()},Qe=ee==="open",kt=ee==="closing",Bt=Le>0?Math.max(0,1-Le/500):1,Wt=Le>0?Math.max(.35,1-Le/500):1,At=s.useCallback(D=>{if(!(D.propertyName!=="transform"||!R.current)){if(w.current!==null){xt();return}He(),be(!1)}},[He,be,xt]),Ae=ee==="closing"?te??x:x,ft=Ae&&G&&(ee==="opening"||kt)?tS(Ae,G):void 0,gt=Fe&&j?rt(j,"center"):Le>0?`translateY(${Le}px)`:ft,dt=G?Yr(G,k):null,yt=!!(Ae&&G),ut=yt&&(ee==="closing"||ee==="open"&&m),it={position:"absolute",top:dt==null?void 0:dt.top,left:dt==null?void 0:dt.left,width:dt==null?void 0:dt.width,height:dt==null?void 0:dt.height,objectFit:"contain",transformOrigin:"top left",transform:gt,opacity:Le>0?Wt:yt?1:ee==="opening"||kt?0:1,transition:ne&&!pe?"none":pe?`transform ${Qo}ms ${Cn}`:J?`transform ${Dn}ms ${Cn}, opacity ${Dn}ms ${Cn}`:ut?`transform ${Dn}ms ${Cn}`:ee==="opening"||kt?`opacity ${Dn}ms ${Cn}`:"none",pointerEvents:Te&&Qe&&!Fe?"auto":"none",touchAction:Te&&Qe?"none":void 0,zIndex:1,overflow:Te?"hidden":void 0},Nt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Qe&&!Fe?"auto":"none"},$t=(D,Ie,Be="adjacent")=>{const ke=Ge(D);if(!ke)return{display:"none"};const vt=Be==="far"?Ie==="left"?"far-left":"far-right":Ie==="left"?"left-adjacent":"right-adjacent",{start:Ct}=me!==null?Ip(ke,vt,me,k):{start:Be==="far"?Ta(ke,Ie,k):_o(ke,Ie,k)},at=Yr(Ct,k),Tt=rt(D,vt),Vt=!Fe&&Be==="adjacent"&&Qe&&!fe?pS(ke,Ie,k):null,Pt=Be==="far"&&Fe&&me===(Ie==="left"?-1:1),Zt=ne&&!pe?!1:pe,on=Be==="adjacent"&&Qe&&fe&&!Fe;return{position:"absolute",top:at.top,left:at.left,width:at.width,height:at.height,objectFit:"contain",transform:Tt??(Vt?`translate(${Vt.x}px, ${Vt.y}px)`:void 0),opacity:Be==="far"?Qe&&Pt?1:0:Qe?1:0,transition:Zt?Be==="far"?`transform ${Qo}ms ${Cn}`:`transform ${Qo}ms ${Cn}, opacity ${Dn}ms ${Cn}`:on?`transform ${Dn}ms ${Cn}`:ee==="opening"||kt?`opacity ${Dn}ms ${Cn}`:"none",pointerEvents:"none",zIndex:1}},Qt=(D,Ie)=>{const Be=Ge(D);return Be?dS(_o(Be,Ie,k),Ie,k):null},Xt=D=>Ie=>{if(!l){if(Q.current){Q.current=!1;return}Ie.stopPropagation(),nt(D)}},Dt=Ue?Qt(Ue,"left"):null,jt=ye?Qt(ye,"right"):null,Ot=Dt?Yr(Dt,k):null,zt=jt?Yr(jt,k):null;return a.jsxs("div",{ref:_,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:ee==="open"?"none":void 0},onClick:Mt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Qe?Bt:0,transition:ne?"none":`opacity ${Dn}ms ${Cn}`,pointerEvents:"none"}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[a.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:v,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Qe?1:0,transition:ne?"none":`opacity ${Dn}ms ${Cn}`,pointerEvents:"none"},children:a.jsx(sp,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,onClose:Mt})})]}),Qe&&Ke&&a.jsx(Kr,{media:Ke,style:$t(Ke,"left","far"),onMeasure:tt,onTransitionEnd:At},`far-prev-${Ke.assetId}`),Qe&&Ue&&a.jsxs(a.Fragment,{children:[a.jsx(Kr,{media:Ue,style:$t(Ue,"left"),onMeasure:tt,onTransitionEnd:At},`prev-${Ue.assetId}`),Ot&&a.jsx("div",{style:{position:"absolute",top:Ot.top,left:Ot.left,width:Ot.width,height:Ot.height,cursor:l||ne?"default":"pointer",pointerEvents:l||ne?"none":"auto",zIndex:3},onClick:Xt(-1)})]}),Qe&&ye&&a.jsxs(a.Fragment,{children:[a.jsx(Kr,{media:ye,style:$t(ye,"right"),onMeasure:tt,onTransitionEnd:At},`next-${ye.assetId}`),zt&&a.jsx("div",{style:{position:"absolute",top:zt.top,left:zt.left,width:zt.width,height:zt.height,cursor:l||ne?"default":"pointer",pointerEvents:l||ne?"none":"auto",zIndex:3},onClick:Xt(1)})]}),Qe&&ht&&a.jsx(Kr,{media:ht,style:$t(ht,"right","far"),onMeasure:tt,onTransitionEnd:At},`far-next-${ht.assetId}`),G&&j&&(Te?a.jsx(gS,{src:j.assetId,phase:ee,onMediaElement:Me,wrapperStyle:it,videoStyle:Nt,onLoadedMetadata:Ft,onTransitionEnd:At},`${n}-${j.assetId}`):a.jsx("img",{ref:Me,src:j.assetId,alt:j.name,onLoad:Ft,onTransitionEnd:At,style:it},`${n}-${j.assetId}`))]})}const hS=20,fS=.18;function yS(e){return`
|
|
19078
19074
|
.${e}-wrapper {
|
|
19079
19075
|
box-sizing: border-box;
|
|
19080
19076
|
max-width: 100%;
|
|
@@ -21395,7 +21391,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
21395
21391
|
left: 50%;
|
|
21396
21392
|
transform: translate(-50%, -50%);
|
|
21397
21393
|
}
|
|
21398
|
-
`}const Pp={"left-top":{horizontal:"left",vertical:"top"},"top-center":{horizontal:"center",vertical:"top"},"top-right":{horizontal:"right",vertical:"top"},"left-center":{horizontal:"left",vertical:"center"},center:{horizontal:"center",vertical:"center"},"right-center":{horizontal:"right",vertical:"center"},"left-bottom":{horizontal:"left",vertical:"bottom"},"bottom-center":{horizontal:"center",vertical:"bottom"},"right-bottom":{horizontal:"right",vertical:"bottom"}};function ew(e){return e in Pp}function tw(e){if(e&&ew(e))return e;switch(e){case"center-top":return"top-center";case"right-top":return"top-right";case"top-left":return"left-top";case"center-bottom":return"bottom-center";case"bottom-left":return"left-bottom";case"bottom-right":return"right-bottom";case"center-center":return"center";case"left":return"left-center";case"right":return"right-center";case"top":return"left-top";default:return"center"}}function Gl(e){return Pp[e]}const nw="rgba(28,31,34,0.9)",Jn=500,Bi="cubic-bezier(0.22, 1, 0.36, 1)",iw=72,ow=50,rw={titleColor:"title-color",descriptionColor:"description-color",lightboxCounterColor:"lightbox-counter-color"},aw=[];function sw(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function lw(e){const[t,n]=e.media;return n!=null&&n.assetId?n:t!=null&&t.assetId?t:null}function cw(e){const[t]=e.media;return t!=null&&t.assetId?t:null}function dw(e){if(!Array.isArray(e)||e.length===0)return[];if(sw(e)){const t=[];for(const n of e){const i=lw(n);if(!i)continue;const o=cw(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.assetId?o:null})}return t}return e.filter(t=>t==null?void 0:t.assetId).map(t=>({displayMedia:t,lightboxMedia:t}))}function Ys(e){return e.type==="video"}function uw(e){e.pause(),e.removeAttribute("src"),e.load()}function Zr(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function pw(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const gw=1140/1440;function mw(e){return typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"2:3",reversed:(e==null?void 0:e.reversed)??!1}}function hw(e){const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`}function fw(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function yw({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:c}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{uw(d)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:c,style:i})}const vw="https://cdn.cntrl.site/component-assets/defaultCloseIcon.svg",xw=.004;function bw({prefix:e,closeIcon:t=vw,closeIconMaxWidth:n=.0125,closeIconColor:i="#FFFFFF",closeIconHoverColor:o="#999999",iconMarginRight:r=.01,contentMarginTop:l=.01,isEditor:c,isPreviewMode:d,isEditMode:u,visible:p,onClose:y}){if(!t)return null;const x=E.scalingValue(n,c),g=E.scalingValue(r,c),h=E.scalingValue(l,c),b=E.scalingValue(Math.max(l,xw),c);return a.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,zIndex:1e4,display:"flex",flexDirection:"column",alignItems:"flex-end",pointerEvents:"none",opacity:p?1:0,transition:"opacity 500ms cubic-bezier(0.22, 1, 0.36, 1)"},children:[a.jsx("div",{style:{position:"relative",width:"100%",height:h,flexShrink:0},children:u&&a.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${e}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:b,pointerEvents:p?"auto":"none"}})}),a.jsxs("div",{className:`${e}-close-icon`,style:{width:x,height:x,marginRight:g,pointerEvents:p?"auto":"none"},onClick:S=>S.stopPropagation(),children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,"aria-label":"Close",onClick:S=>{S.stopPropagation(),y()},children:a.jsx(gn,{url:t,fill:i,hoverFill:c&&!d?i:o,className:`${e}-close-icon-img`})}),u&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:g,height:"100%",pointerEvents:p?"auto":"none"}})]})]})}function Sw({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,isPreviewMode:r,isEditMode:l,onClose:c,onPrev:d,onNext:u,counterClassName:p,counterStyle:y,backgroundColor:x,closeIcon:g,closeIconMaxWidth:h,closeIconColor:b,closeIconHoverColor:S,iconMarginRight:_,contentMarginTop:v}){const L=i==="cover",P=s.useRef(null),q=s.useRef(null),X=s.useRef(null),B=s.useRef(0),H=s.useRef(0),O=s.useRef("none"),C=s.useRef(!1),$=s.useRef(!1),Q=s.useRef(!1),R=s.useRef(null),[T,w]=s.useState(null),[V,z]=s.useState("opening"),[U,M]=s.useState(0),[f,K]=s.useState(0),[G,ge]=s.useState(!1),[k,ce]=s.useState(!1),[I,ue]=s.useState(!1),ee=s.useRef(n),xe=t[n],Le=xe?Ys(xe):!1,se=f!==0||G,de=s.useCallback(N=>{Q.current=N,ge(N)},[]),Z=s.useCallback(()=>{R.current!==null&&(window.clearTimeout(R.current),R.current=null)},[]),pe=s.useCallback(()=>{Z(),R.current=window.setTimeout(()=>{Z(),de(!1)},Jn+32)},[Z,de]),ie=s.useCallback(()=>{const N=P.current,F=q.current;if(!N)return;const ne=N.getBoundingClientRect(),re=ne.width,J=ne.height;if(!re||!J)return;if(i==="cover"){w({width:re,height:J,left:ne.left,top:ne.top});return}if(!F){w(Zr(N));return}const{width:W,height:Se}=pw(F);if(!W||!Se){w(Zr(N));return}const le=W/Se,j=re/J;if(le>j){const Te=re/le;w({width:re,height:Te,left:ne.left,top:ne.top+(J-Te)/2})}else{const Te=J*le;w({width:Te,height:J,left:ne.left+(re-Te)/2,top:ne.top})}},[i]);s.useEffect(()=>{ie();const N=P.current;if(!N)return;const F=new ResizeObserver(()=>ie());return F.observe(N),()=>F.disconnect()},[ie,n]),s.useEffect(()=>{V==="opening"&&T&&z("open")},[V,T]),s.useEffect(()=>{if(V!=="closing")return;const N=setTimeout(()=>c(),Jn);return()=>clearTimeout(N)},[V,c]),s.useEffect(()=>()=>{Z()},[Z]),s.useLayoutEffect(()=>{if(ee.current===n)return;Z(),M(0),K(0),de(!1),ue(!1),ce(!1),B.current=0,H.current=0,O.current="none",C.current=!1,X.current=null,$.current=!1;const N=P.current;N&&w(Zr(N)),ee.current=n},[n,de,Z]),s.useEffect(()=>{if(V!=="open")return;let N=null;const F=()=>{N&&(document.removeEventListener("click",N,!0),N=null)},ne=()=>{F(),N=j=>{j.stopPropagation(),j.preventDefault(),F()},document.addEventListener("click",N,!0)},re=j=>{Z(),Q.current=!1,ge(!1),K(0),ce(!1),C.current=!1,H.current=0,O.current="none";const Te=P.current;Te&&w(Zr(Te)),j<0?u():d()},J=j=>{if(Math.abs(j)>ow&&t.length>1){re(j);return}de(!0),K(0),pe()},W=j=>{if(j.touches.length!==1||Q.current)return;const Te=j.touches[0];$.current=!0,X.current={x:Te.clientX,y:Te.clientY},O.current="none",H.current=0,C.current=!1},Se=j=>{if(!X.current||j.touches.length!==1||Q.current)return;const Te=j.touches[0],Fe=Te.clientX-X.current.x,Ye=Te.clientY-X.current.y;if(O.current==="none"){if(Math.abs(Fe)<10&&Math.abs(Ye)<10)return;if(Math.abs(Fe)>Math.abs(Ye)){if(t.length<=1)return;O.current="horizontal"}else if(Ye>0)O.current="vertical";else return}if(O.current==="horizontal"){C.current=!0,ce(!0),H.current=Fe,K(Fe),j.preventDefault();return}O.current==="vertical"&&(C.current=!0,ce(!0),B.current=Ye,M(Ye),j.preventDefault())},le=()=>{if(!X.current)return;const j=O.current,Te=C.current;if(Te&&j==="horizontal")J(H.current),ne();else if(Te&&j==="vertical")if(B.current>iw){const Ye=window.innerHeight;B.current=Ye,ue(!0),M(Ye),z("closing")}else B.current=0,M(0),ne();else j==="horizontal"&&Math.abs(H.current)>0&&(J(H.current),ne());X.current=null,O.current="none",H.current=0,C.current=!1,ce(!1)};return document.addEventListener("touchstart",W,{passive:!0}),document.addEventListener("touchmove",Se,{passive:!1}),document.addEventListener("touchend",le),document.addEventListener("touchcancel",le),()=>{document.removeEventListener("touchstart",W),document.removeEventListener("touchmove",Se),document.removeEventListener("touchend",le),document.removeEventListener("touchcancel",le),F()}},[V,t.length,u,d,de,pe,Z]),s.useEffect(()=>{const N=F=>{F.key==="Escape"&&(F.preventDefault(),F.stopPropagation(),V!=="closing"&&z("closing"))};return window.addEventListener("keydown",N,!0),()=>window.removeEventListener("keydown",N,!0)},[V]);const me=()=>{V!=="closing"&&z("closing")},ve=V==="open",Ee=V==="closing",Re=U>0?Math.max(0,1-U/500):1,Ce=U>0?Math.max(.35,1-U/500):1,$e=N=>{if(N.stopPropagation(),$.current){$.current=!1;return}if(t.length<=1)return;const F=N.currentTarget.getBoundingClientRect(),ne=N.clientY-F.top,re=Math.min(52,F.height*.2);if(!(ne>F.height-re)){if(N.clientX-F.left<F.width/2){d();return}u()}},m=N=>{if(t.length<=1)return;const F=N.currentTarget.getBoundingClientRect(),ne=N.clientX-F.left,re=N.clientY-F.top,J=Math.min(52,F.height*.2);if(re>F.height-J){N.currentTarget.style.cursor="default";return}N.currentTarget.style.cursor=ne<F.width/2?"w-resize":"e-resize"},Y=s.useCallback(N=>{N.propertyName!=="transform"||!Q.current||(Z(),de(!1))},[Z,de]),te=se?`translateX(${f}px)`:U>0?`translateY(${U}px)`:void 0,oe={position:"fixed",top:T==null?void 0:T.top,left:T==null?void 0:T.left,width:T==null?void 0:T.width,height:T==null?void 0:T.height,objectFit:i==="cover"?"cover":"contain",transform:te,opacity:U>0?Ce:V==="opening"||Ee?0:1,transition:k&&!G?"none":G?`transform ${Jn}ms ${Bi}`:I?`transform ${Jn}ms ${Bi}, opacity ${Jn}ms ${Bi}`:V==="opening"||Ee?`opacity ${Jn}ms ${Bi}`:"none",pointerEvents:Le&&ve&&!se?"auto":"none",touchAction:Le&&ve?"none":void 0,zIndex:9998},fe=T?{position:"fixed",top:T.top,height:T.height,width:T.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:V==="open"?"none":void 0},onClick:me,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:x,opacity:ve?Re:0,transition:k?"none":`opacity ${Jn}ms ${Bi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:L?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:P,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ve?1:0,transition:`opacity ${Jn}ms ${Bi}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:p,style:y,children:[n+1," / ",t.length]})})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:P,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ve?1:0,transition:`opacity ${Jn}ms ${Bi}`},children:t.length>1&&a.jsxs("p",{className:p,style:y,children:[n+1," / ",t.length]})})]})}),T&&xe&&(Le?a.jsx(yw,{src:xe.assetId,phase:V,mediaRef:q,mediaStyle:oe,onLoadedMetadata:ie,onClick:$e,onMouseMove:m,onTransitionEnd:Y},`${n}-${xe.assetId}`):a.jsx("img",{ref:q,src:xe.assetId,alt:xe.name,onLoad:ie,onTransitionEnd:Y,style:oe},`${n}-${xe.assetId}`)),ve&&fe&&t.length>1&&!Le&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...fe,left:T.left,cursor:"w-resize",pointerEvents:se?"none":"auto"},onClick:N=>{if($.current){$.current=!1;return}N.stopPropagation(),d()}}),a.jsx("div",{style:{...fe,left:T.left+T.width/2,cursor:"e-resize",pointerEvents:se?"none":"auto"},onClick:N=>{if($.current){$.current=!1;return}N.stopPropagation(),u()}})]}),a.jsx(bw,{prefix:e,closeIcon:g,closeIconMaxWidth:h,closeIconColor:b,closeIconHoverColor:S,iconMarginRight:_,contentMarginTop:v,isEditor:o,isPreviewMode:r,isEditMode:l,visible:ve,onClose:me})]})}function yd({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:r,isEditor:l,galleryPaddingBetween:c=0,showPaddingAfter:d=!1,showControls:u=!1,onMediaClick:p}){const y=`${e}-gallery-${Ys(t)?"video":"image"}`,x=r.display==="cover",g=hw(r),h=H=>E.scalingValue(H,l??!1),b=n??mo,S=o?{width:"100%",maxWidth:"100%"}:{width:h(b),maxWidth:"100%"},_=i?{borderRadius:h(i)}:{},v={...S,...x?{aspectRatio:g,height:"auto",overflow:"hidden"}:{},..._},L={...x?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":h(b)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...x?{}:_},q={className:y,style:L,onClick:p?H=>{H.stopPropagation(),p()}:void 0},X=Math.max(c,ti),B=Ys(t)?a.jsx("video",{...q,src:t.assetId,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...q,src:t.assetId,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[x?a.jsx("div",{style:v,children:B}):B,d&&c>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:h(c)},"aria-hidden":"true"}),u&&d&&a.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:h(X)}})]})}function ww({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:c,showControls:d,scaled:u,children:p}){const y=t==="a"?i:t==="c"?o:0,x=y>0||d;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&x&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(y)},"aria-hidden":"true"}),d&&t==="c"&&a.jsx("div",{"data-controls":"galleryPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(c),className:`${e}-control-anchor`,style:{top:0,left:0,width:u(l),height:"100%"}}),a.jsx("div",{className:`${e}-gallery`,style:n,children:p}),t==="a"&&x&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(y)},"aria-hidden":"true"}),d&&t==="a"&&a.jsx("div",{"data-controls":"galleryPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(c),className:`${e}-control-anchor`,style:{top:0,right:0,width:u(r),height:"100%"}})]})}function $w(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function Jr({P:e,controlKey:t,scaled:n,height:i,paired:o,side:r}){return a.jsx("div",{"data-controls":t,...o?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{...r==="top"?{top:0}:{bottom:0},left:0,width:"100%",height:n(i)}})}function vd({P:e,controlKey:t,scaled:n,width:i,maxFraction:o,side:r,paired:l,anchorStyle:c}){return a.jsx("div",{"data-controls":t,...l?{"data-controls-paired":""}:{},"data-controls-axis":"x","data-controls-variant":"column-padding",...r==="right"?{"data-controls-reverse":""}:{},"data-controls-min":"0","data-controls-max-fraction":String(o),className:`${e}-control-anchor`,style:{top:0,...r==="left"?{left:0}:{right:0},width:n(i),height:"100%",...c}})}function Ts({P:e,title:t,description:n,position:i,titleRef:o,titleClassName:r,titleContainerStyle:l,titleTextBoxStyle:c,titleStyle:d,descriptionClassName:u,descriptionStyle:p,descriptionPadding:y,showTextBoxOutline:x=!1,showDescriptionPaddingControl:g=!1,descriptionPaddingPaired:h=!1,topPaddingControl:b,bottomPaddingControl:S}){const _=s.useRef(null),[v,L]=s.useState(0),P=t??"",q=n??"",X=q.length>0,{horizontal:B,vertical:H}=Gl(i),O=H==="center"||H==="bottom",C=H==="bottom";s.useLayoutEffect(()=>{if(!O)return;const T=_.current;if(!T||typeof ResizeObserver>"u")return;const w=()=>L(T.offsetHeight);w();const V=new ResizeObserver(w);return V.observe(T),()=>V.disconnect()},[P,q,O]);const $=a.jsx("span",{className:`${e}-title-text`,style:d,children:P}),Q=X?a.jsx("span",{className:u,style:p,children:q}):null,R=X?a.jsx("div",{className:`${e}-title-texts-gap`,style:{height:y},children:g&&a.jsx("div",{"data-controls":"titleDescriptionPadding",...h?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{top:0,left:0,width:"100%",height:"100%"}})}):null;return a.jsx("div",{ref:T=>{_.current=T,o(T)},className:[r,`${e}-title-h-${B}`,`${e}-title-v-${H}`].join(" "),style:{...O?{[`--${e}-title-height`]:`${v}px`}:{},...l},children:a.jsxs("div",{className:`${e}-title-text-stack`,style:c,children:[b,a.jsx("div",{className:x?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:a.jsx("div",{className:`${e}-title-texts`,children:C?a.jsxs(a.Fragment,{children:[Q,R,$]}):a.jsxs(a.Fragment,{children:[$,R,Q]})})}),S]})})}const xd=45;function bd(e,t,n){let i=e;for(;i;){const o=getComputedStyle(i).getPropertyValue(t).trim();if(o){const r=parseFloat(o);if(!Number.isNaN(r))return r}i=i.parentElement}return n}function Cw(e){const t=bd(e,"--cntrl-viewport-height",window.innerHeight),n=bd(e,"--cntrl-article-top",0);return{top:n,height:t,centerY:n+t/2}}function Tw(e,t,n){const{vertical:i}=Gl(t),{top:o,height:r,centerY:l}=Cw(n);if(i==="top"){const d=n&&parseFloat(getComputedStyle(n).top)||o;return Math.abs(e.top-d)}if(i==="bottom")return Math.abs(e.bottom-(o+r));const c=e.top+e.height/2;return Math.abs(c-l)}function Iw(e,t,n){const i=Array.from({length:t},(l,c)=>{const d=e.current[c];if(!d)return 0;const u=d.getBoundingClientRect(),p=Tw(u,n,d);return Math.exp(-(p*p)/(2*xd*xd))});let o=0,r=-1;return i.forEach((l,c)=>{l>r&&(r=l,o=c)}),{opacities:i,dominantIndex:o}}function Lw(e,t,n){const i=s.useRef([]),[{opacities:o,dominantIndex:r},l]=s.useState(()=>({opacities:Array.from({length:e},(d,u)=>u===0?1:0),dominantIndex:0}));return s.useLayoutEffect(()=>{if(!t||e===0){l({opacities:Array.from({length:e},()=>1),dominantIndex:0});return}let d=0;const u=()=>{l(Iw(i,e,n))},p=()=>{d||(d=window.requestAnimationFrame(()=>{d=0,u()}))};return u(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p,{passive:!0}),()=>{d&&window.cancelAnimationFrame(d),window.removeEventListener("scroll",p),window.removeEventListener("resize",p)}},[t,e,n]),{setTitleRef:d=>u=>{i.current[d]=u},opacities:o,dominantIndex:r}}function Sd(e,t){const[n,i]=s.useState(e),o=s.useRef(e);return s.useEffect(()=>{if(!t){o.current=e,i(e);return}const r=Array.from(o.current),l=Array.from(e),c=Math.max(r.length,l.length);if(c===0||o.current===e)return;let d=0;const u=window.setInterval(()=>{d+=1;const p=[...l.slice(0,d),...r.slice(d)].join("");o.current=p,i(p),d>=c&&window.clearInterval(u)},70);return()=>window.clearInterval(u)},[t,e]),n}function Pw({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var dt,yt;const{prefix:l}=E.useScopedStyles(),c=s.useMemo(()=>JS(l),[l]),d=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",y=(e==null?void 0:e.imgWidth)??mo,x=(e==null?void 0:e.titleWidth)??gw,g=mw(e==null?void 0:e.imageDisplay),h=(e==null?void 0:e.cornerRadius)??QS,b=tw(e==null?void 0:e.position),{horizontal:S,vertical:_}=Gl(b),v=(e==null?void 0:e.titleTopPadding)??0,L=(e==null?void 0:e.titleBottomPadding)??0,P=(e==null?void 0:e.titleLeftPadding)??0,q=(e==null?void 0:e.titleRightPadding)??0,X=(e==null?void 0:e.titleDescriptionPadding)??0,B=$w(e==null?void 0:e.transition),H=(e==null?void 0:e.lightbox)??"on",O=p==="b",C=B==="fade"||B==="retype",{setTitleRef:$,dominantIndex:Q}=Lw(d.length,C,b),R=((dt=d[Q])==null?void 0:dt.title)??"",T=((yt=d[Q])==null?void 0:yt.description)??"",w=Sd(R,B==="retype"),V=Sd(T,B==="retype"),z=B==="fade"||B==="retype",U=B==="retype"?w:R,M=B==="retype"?V:T,f=O?void 0:{width:E.scalingValue(y,n??!1)},K=H==="on"&&(!n||i||o),G=o??!1,ge=(e==null?void 0:e.galleryPaddingRight)??0,k=(e==null?void 0:e.galleryPaddingLeft)??0,ce=(e==null?void 0:e.galleryPaddingBetween)??0,I=ut=>E.scalingValue(ut,n??!1),ee={width:I(x)},xe=p==="a"?ge:k,Le=O?{width:"100%"}:{width:`calc(100% - ${I(y)} - ${I(xe)})`,...p==="c"?{marginLeft:"auto"}:{}},se=Math.max(ge,ti),de=Math.max(k,ti),Z=Math.max(ce,ti),pe=Math.max(v,ti),ie=Math.max(L,ti),me=Math.max(P,ti),ve=Math.max(q,ti),Ee=Math.max(X,ti),Re=Math.max(0,(u??1)-(y??mo)),Ce=p==="a"?Math.max(0,(u??1)-(y??mo)-ge):p==="c"?Math.max(0,(u??1)-(y??mo)-k):p==="b"?u??1:1,$e=G&&_==="top",m=G&&_==="bottom",Y=G&&S==="left",te=G&&S==="right",oe=d.length>1,fe=O?void 0:I((p==="c"?k:ge)+(y??mo)),N=p==="c"&&fe?{left:fe}:void 0,F=p==="a"&&fe?{right:fe}:void 0,ne=O?{left:0,width:"100%"}:p==="a"?{right:I(ge),width:I(y)}:{left:I(k),width:I(y)},{titleColor:re,titleFontFamily:J,titleFontSettings:W,titleFontSize:Se,titleLineHeight:le,titleLetterSpacing:j,titleWordSpacing:Te,titleAlign:Fe,titleTextAppearance:Ye,descriptionColor:De,descriptionFontFamily:ze,descriptionFontSettings:Ze,descriptionFontSize:Ue,descriptionLineHeight:ye,descriptionLetterSpacing:_e,descriptionWordSpacing:Ve,descriptionAlign:Je,descriptionTextAppearance:et,lightboxCounterColor:ot,lightboxCounterFontFamily:lt,lightboxCounterFontSettings:Ke,lightboxCounterFontSize:ht,lightboxCounterLineHeight:tt,lightboxCounterLetterSpacing:Ge,lightboxCounterWordSpacing:We,lightboxCounterTextAppearance:Ne}=e??{},be={fontSettings:{fontFamily:J,fontWeight:(W==null?void 0:W.fontWeight)??400,fontStyle:(W==null?void 0:W.fontStyle)??"normal"},fontSize:Se??.01,lineHeight:le,letterSpacing:j??0,wordSpacing:Te??0,textAlign:Fe??"left",textAppearance:Ye,color:re??"#000000"},Xe=pn(nn(be,n)),ct=ee,rt={...Cs(Se,le,l,n),...Cs(Ue,ye,l,n,"description-leading-gap")},xt=$s(Se,le,`${l}-title`,`${l}-text-tight-leading`),pt={fontSettings:{fontFamily:ze,fontWeight:(Ze==null?void 0:Ze.fontWeight)??400,fontStyle:(Ze==null?void 0:Ze.fontStyle)??"normal"},fontSize:Ue??.01,lineHeight:ye,letterSpacing:_e??0,wordSpacing:Ve??0,textAlign:Je??"left",textAppearance:et,color:De??"#000000"},It=pn(nn(pt,n)),nt=$s(Ue,ye,`${l}-description-text`,`${l}-description-tight-leading`),bt=I(G?Ee:X),Lt={fontSettings:{fontFamily:lt,fontWeight:(Ke==null?void 0:Ke.fontWeight)??400,fontStyle:(Ke==null?void 0:Ke.fontStyle)??"normal"},fontSize:ht??.01,lineHeight:tt,letterSpacing:Ge??0,wordSpacing:We??0,textAppearance:Ne,color:ot??"#DEDDDD"},Ft={...pn(nn(Lt,n)),...Cs(ht,tt,l,n)},Me=$s(ht,tt,`${l}-lightbox-counter`,`${l}-text-tight-leading`),Oe=E.buildColorVars(l,{titleColor:re??"#000000",descriptionColor:De??"#000000",lightboxCounterColor:ot??"#DEDDDD"},rw,aw),St=s.useRef(null),[Mt,Qe]=s.useState(!1),[kt,Bt]=s.useState([]),[Wt,At]=s.useState(0),Ae=s.useCallback((ut,it)=>{K&&(Bt(ut),At(it),Qe(!0))},[K]),ft=s.useCallback(()=>{Qe(!1)},[]),gt=s.useMemo(()=>{const ut={...Oe},it=St.current?getComputedStyle(St.current).getPropertyValue("--cntrl-article-width").trim():"";return it&&(ut["--cntrl-article-width"]=it),ut},[Oe,Mt]);return s.useEffect(()=>{if(!Mt||H!=="on"||typeof document>"u")return;const ut=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ut}},[Mt,H]),s.useEffect(()=>{!n||o||i||Qe(!1)},[n,o,i]),s.useEffect(()=>{H==="off"&&Qe(!1)},[H]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx("div",{style:Oe,children:a.jsxs("div",{ref:St,className:`${l}-wrapper`,style:{width:E.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:_==="top"?I(v):void 0,[`--${l}-title-bottom-padding`]:_==="bottom"?I(L):void 0,[`--${l}-title-left-padding`]:S==="left"?I(P):void 0,[`--${l}-title-right-padding`]:S==="right"?I(q):void 0},children:[z&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(Ts,{P:l,title:U,description:M,position:b,titleRef:()=>{},titleClassName:`${xt} ${l}-single-title`,titleContainerStyle:{...rt,...Le},titleTextBoxStyle:ct,titleStyle:Xe,descriptionClassName:nt,descriptionStyle:It,descriptionPadding:bt,showTextBoxOutline:G,showDescriptionPaddingControl:G,topPaddingControl:$e?Jr({P:l,controlKey:"titleTopPadding",scaled:I,height:pe,paired:!1,side:"top"}):void 0,bottomPaddingControl:m?Jr({P:l,controlKey:"titleBottomPadding",scaled:I,height:ie,paired:!1,side:"bottom"}):void 0})}),d.map((ut,it)=>{const Nt=dw(ut.gallery),$t=it<d.length-1,Qt=Nt.filter(Ot=>Ot.lightboxMedia).map(Ot=>Ot.lightboxMedia),Xt={P:l,position:b,titleRef:$(it),titleClassName:xt,titleContainerStyle:rt,titleTextBoxStyle:z?{maxWidth:"100%"}:ct,titleStyle:Xe,descriptionClassName:nt,descriptionStyle:It,descriptionPadding:bt,showTextBoxOutline:G&&!z,showDescriptionPaddingControl:G&&!z,descriptionPaddingPaired:oe,topPaddingControl:$e&&!z?Jr({P:l,controlKey:"titleTopPadding",scaled:I,height:pe,paired:oe,side:"top"}):void 0,bottomPaddingControl:m&&!z?Jr({P:l,controlKey:"titleBottomPadding",scaled:I,height:ie,paired:oe,side:"bottom"}):void 0};return a.jsxs("div",{"data-item-index":it,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:$t?I(ce):void 0},children:[Y&&vd({P:l,controlKey:"titleLeftPadding",scaled:I,width:me,maxFraction:Ce,side:"left",paired:oe,anchorStyle:N}),te&&vd({P:l,controlKey:"titleRightPadding",scaled:I,width:ve,maxFraction:Ce,side:"right",paired:oe,anchorStyle:F}),G&&$t&&a.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${l}-control-anchor`,style:{bottom:0,height:I(Z),...ne}}),O?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:Nt.map(({displayMedia:Ot,lightboxMedia:jt},Dt)=>{const zt=jt?Qt.findIndex(D=>D.assetId===jt.assetId):-1;return a.jsx(yd,{P:l,media:Ot,imgWidth:y||void 0,cornerRadius:h||void 0,imageDisplay:g,isEditor:n,galleryPaddingBetween:ce,showPaddingAfter:Dt<Nt.length-1,showControls:G,onMediaClick:K&&zt>=0?()=>Ae(Qt,zt):void 0},`${Ot.assetId}-${Dt}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(Ts,{...Xt,title:z?"":ut.title,description:z?"":ut.description})})]}):a.jsxs(a.Fragment,{children:[a.jsx(Ts,{...Xt,title:z?"":ut.title,description:z?"":ut.description}),Nt.length>0&&a.jsx(ww,{P:l,layoutType:p,galleryWidthStyle:f,galleryPaddingRight:ge,galleryPaddingLeft:k,galleryPaddingRightWidth:se,galleryPaddingLeftWidth:de,galleryPaddingMaxFraction:Re,showControls:G,scaled:I,children:Nt.map(({displayMedia:Ot,lightboxMedia:jt},Dt)=>{const zt=jt?Qt.findIndex(D=>D.assetId===jt.assetId):-1;return a.jsx(yd,{P:l,media:Ot,cornerRadius:h||void 0,fillGalleryWidth:!0,imageDisplay:g,isEditor:n,galleryPaddingBetween:ce,showPaddingAfter:Dt<Nt.length-1,showControls:G,onMediaClick:K&&zt>=0?()=>Ae(Qt,zt):void 0},`${Ot.assetId}-${Dt}`)})})]})]},it)})]})}),Mt&&H==="on"&&typeof document<"u"&&e&&(()=>{const ut=(r?document.getElementById(r):null)??document.body;return qn.createPortal(a.jsx("div",{style:gt,"data-selection":"none",children:a.jsx(Sw,{prefix:l,items:kt,index:Wt,imageDisplay:fw(e.lightboxImageDisplay),isEditor:n,isPreviewMode:i,isEditMode:o,closeIcon:e.closeIcon,closeIconMaxWidth:e.closeIconMaxWidth,closeIconColor:e.closeIconColor,closeIconHoverColor:e.closeIconHoverColor,iconMarginRight:e.iconMarginRight,contentMarginTop:e.contentMarginTop,onClose:ft,onPrev:()=>At(it=>(it-1+kt.length)%kt.length),onNext:()=>At(it=>(it+1)%kt.length),counterClassName:Me,counterStyle:Ft,backgroundColor:e.backgroundColor??nw})}),ut)})()]})}const Mw=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
21394
|
+
`}const Pp={"left-top":{horizontal:"left",vertical:"top"},"top-center":{horizontal:"center",vertical:"top"},"top-right":{horizontal:"right",vertical:"top"},"left-center":{horizontal:"left",vertical:"center"},center:{horizontal:"center",vertical:"center"},"right-center":{horizontal:"right",vertical:"center"},"left-bottom":{horizontal:"left",vertical:"bottom"},"bottom-center":{horizontal:"center",vertical:"bottom"},"right-bottom":{horizontal:"right",vertical:"bottom"}};function ew(e){return e in Pp}function tw(e){if(e&&ew(e))return e;switch(e){case"center-top":return"top-center";case"right-top":return"top-right";case"top-left":return"left-top";case"center-bottom":return"bottom-center";case"bottom-left":return"left-bottom";case"bottom-right":return"right-bottom";case"center-center":return"center";case"left":return"left-center";case"right":return"right-center";case"top":return"left-top";default:return"center"}}function Gl(e){return Pp[e]}const nw="rgba(28,31,34,0.9)",Jn=500,Bi="cubic-bezier(0.22, 1, 0.36, 1)",iw=72,ow=50,rw={titleColor:"title-color",descriptionColor:"description-color",lightboxCounterColor:"lightbox-counter-color"},aw=[];function sw(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function lw(e){const[t,n]=e.media;return n!=null&&n.assetId?n:t!=null&&t.assetId?t:null}function cw(e){const[t]=e.media;return t!=null&&t.assetId?t:null}function dw(e){if(!Array.isArray(e)||e.length===0)return[];if(sw(e)){const t=[];for(const n of e){const i=lw(n);if(!i)continue;const o=cw(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.assetId?o:null})}return t}return e.filter(t=>t==null?void 0:t.assetId).map(t=>({displayMedia:t,lightboxMedia:t}))}function Ys(e){return e.type==="video"}function uw(e){e.pause(),e.removeAttribute("src"),e.load()}function Zr(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function pw(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const gw=1140/1440;function mw(e){return typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"2:3",reversed:(e==null?void 0:e.reversed)??!1}}function hw(e){const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`}function fw(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function yw({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:c}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{uw(d)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:c,style:i})}const vw="https://cdn.cntrl.site/component-assets/defaultCloseIcon.svg",xw=.004;function bw({prefix:e,closeIcon:t=vw,closeIconMaxWidth:n=.0125,closeIconColor:i="#FFFFFF",closeIconHoverColor:o="#999999",iconMarginRight:r=.01,contentMarginTop:l=.01,isEditor:c,isPreviewMode:d,isEditMode:u,visible:p,onClose:y}){if(!t)return null;const x=E.scalingValue(n,c),g=E.scalingValue(r,c),h=E.scalingValue(l,c),b=E.scalingValue(Math.max(l,xw),c);return a.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,zIndex:1e4,display:"flex",flexDirection:"column",alignItems:"flex-end",pointerEvents:"none",opacity:p?1:0,transition:"opacity 500ms cubic-bezier(0.22, 1, 0.36, 1)"},children:[a.jsx("div",{style:{position:"relative",width:"100%",height:h,flexShrink:0},children:u&&a.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${e}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:b,pointerEvents:p?"auto":"none"}})}),a.jsxs("div",{className:`${e}-close-icon`,style:{width:x,height:x,marginRight:g,pointerEvents:p?"auto":"none"},onClick:S=>S.stopPropagation(),children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,"aria-label":"Close",onClick:S=>{S.stopPropagation(),y()},children:a.jsx(gn,{url:t,fill:i,hoverFill:c&&!d?i:o,className:`${e}-close-icon-img`})}),u&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:g,height:"100%",pointerEvents:p?"auto":"none"}})]})]})}function Sw({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,isPreviewMode:r,isEditMode:l,onClose:c,onPrev:d,onNext:u,counterClassName:p,counterStyle:y,backgroundColor:x,closeIcon:g,closeIconMaxWidth:h,closeIconColor:b,closeIconHoverColor:S,iconMarginRight:_,contentMarginTop:v}){const L=i==="cover",P=s.useRef(null),q=s.useRef(null),X=s.useRef(null),B=s.useRef(0),H=s.useRef(0),O=s.useRef("none"),C=s.useRef(!1),$=s.useRef(!1),Q=s.useRef(!1),R=s.useRef(null),[T,w]=s.useState(null),[V,z]=s.useState("opening"),[U,M]=s.useState(0),[f,K]=s.useState(0),[G,ge]=s.useState(!1),[k,ce]=s.useState(!1),[I,ue]=s.useState(!1),ee=s.useRef(n),xe=t[n],Le=xe?Ys(xe):!1,se=f!==0||G,de=s.useCallback(N=>{Q.current=N,ge(N)},[]),Z=s.useCallback(()=>{R.current!==null&&(window.clearTimeout(R.current),R.current=null)},[]),pe=s.useCallback(()=>{Z(),R.current=window.setTimeout(()=>{Z(),de(!1)},Jn+32)},[Z,de]),ie=s.useCallback(()=>{const N=P.current,F=q.current;if(!N)return;const ne=N.getBoundingClientRect(),re=ne.width,J=ne.height;if(!re||!J)return;if(i==="cover"){w({width:re,height:J,left:ne.left,top:ne.top});return}if(!F){w(Zr(N));return}const{width:W,height:Se}=pw(F);if(!W||!Se){w(Zr(N));return}const le=W/Se,j=re/J;if(le>j){const Te=re/le;w({width:re,height:Te,left:ne.left,top:ne.top+(J-Te)/2})}else{const Te=J*le;w({width:Te,height:J,left:ne.left+(re-Te)/2,top:ne.top})}},[i]);s.useEffect(()=>{ie();const N=P.current;if(!N)return;const F=new ResizeObserver(()=>ie());return F.observe(N),()=>F.disconnect()},[ie,n]),s.useEffect(()=>{V==="opening"&&T&&z("open")},[V,T]),s.useEffect(()=>{if(V!=="closing")return;const N=setTimeout(()=>c(),Jn);return()=>clearTimeout(N)},[V,c]),s.useEffect(()=>()=>{Z()},[Z]),s.useLayoutEffect(()=>{if(ee.current===n)return;Z(),M(0),K(0),de(!1),ue(!1),ce(!1),B.current=0,H.current=0,O.current="none",C.current=!1,X.current=null,$.current=!1;const N=P.current;N&&w(Zr(N)),ee.current=n},[n,de,Z]),s.useEffect(()=>{if(V!=="open")return;let N=null;const F=()=>{N&&(document.removeEventListener("click",N,!0),N=null)},ne=()=>{F(),N=j=>{j.stopPropagation(),j.preventDefault(),F()},document.addEventListener("click",N,!0)},re=j=>{Z(),Q.current=!1,ge(!1),K(0),ce(!1),C.current=!1,H.current=0,O.current="none";const Te=P.current;Te&&w(Zr(Te)),j<0?u():d()},J=j=>{if(Math.abs(j)>ow&&t.length>1){re(j);return}de(!0),K(0),pe()},W=j=>{if(j.touches.length!==1||Q.current)return;const Te=j.touches[0];$.current=!0,X.current={x:Te.clientX,y:Te.clientY},O.current="none",H.current=0,C.current=!1},Se=j=>{if(!X.current||j.touches.length!==1||Q.current)return;const Te=j.touches[0],Fe=Te.clientX-X.current.x,Ye=Te.clientY-X.current.y;if(O.current==="none"){if(Math.abs(Fe)<10&&Math.abs(Ye)<10)return;if(Math.abs(Fe)>Math.abs(Ye)){if(t.length<=1)return;O.current="horizontal"}else if(Ye>0)O.current="vertical";else return}if(O.current==="horizontal"){C.current=!0,ce(!0),H.current=Fe,K(Fe),j.preventDefault();return}O.current==="vertical"&&(C.current=!0,ce(!0),B.current=Ye,M(Ye),j.preventDefault())},le=()=>{if(!X.current)return;const j=O.current,Te=C.current;if(Te&&j==="horizontal")J(H.current),ne();else if(Te&&j==="vertical")if(B.current>iw){const Ye=window.innerHeight;B.current=Ye,ue(!0),M(Ye),z("closing")}else B.current=0,M(0),ne();else j==="horizontal"&&Math.abs(H.current)>0&&(J(H.current),ne());X.current=null,O.current="none",H.current=0,C.current=!1,ce(!1)};return document.addEventListener("touchstart",W,{passive:!0}),document.addEventListener("touchmove",Se,{passive:!1}),document.addEventListener("touchend",le),document.addEventListener("touchcancel",le),()=>{document.removeEventListener("touchstart",W),document.removeEventListener("touchmove",Se),document.removeEventListener("touchend",le),document.removeEventListener("touchcancel",le),F()}},[V,t.length,u,d,de,pe,Z]),s.useEffect(()=>{const N=F=>{F.key==="Escape"&&(F.preventDefault(),F.stopPropagation(),V!=="closing"&&z("closing"))};return window.addEventListener("keydown",N,!0),()=>window.removeEventListener("keydown",N,!0)},[V]);const me=()=>{V!=="closing"&&z("closing")},ve=V==="open",Ee=V==="closing",Re=U>0?Math.max(0,1-U/500):1,Ce=U>0?Math.max(.35,1-U/500):1,$e=N=>{if(N.stopPropagation(),$.current){$.current=!1;return}if(t.length<=1)return;const F=N.currentTarget.getBoundingClientRect(),ne=N.clientY-F.top,re=Math.min(52,F.height*.2);if(!(ne>F.height-re)){if(N.clientX-F.left<F.width/2){d();return}u()}},m=N=>{if(t.length<=1)return;const F=N.currentTarget.getBoundingClientRect(),ne=N.clientX-F.left,re=N.clientY-F.top,J=Math.min(52,F.height*.2);if(re>F.height-J){N.currentTarget.style.cursor="default";return}N.currentTarget.style.cursor=ne<F.width/2?"w-resize":"e-resize"},Y=s.useCallback(N=>{N.propertyName!=="transform"||!Q.current||(Z(),de(!1))},[Z,de]),te=se?`translateX(${f}px)`:U>0?`translateY(${U}px)`:void 0,oe={position:"fixed",top:T==null?void 0:T.top,left:T==null?void 0:T.left,width:T==null?void 0:T.width,height:T==null?void 0:T.height,objectFit:i==="cover"?"cover":"contain",transform:te,opacity:U>0?Ce:V==="opening"||Ee?0:1,transition:k&&!G?"none":G?`transform ${Jn}ms ${Bi}`:I?`transform ${Jn}ms ${Bi}, opacity ${Jn}ms ${Bi}`:V==="opening"||Ee?`opacity ${Jn}ms ${Bi}`:"none",pointerEvents:Le&&ve&&!se?"auto":"none",touchAction:Le&&ve?"none":void 0,zIndex:9998},fe=T?{position:"fixed",top:T.top,height:T.height,width:T.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:V==="open"?"none":void 0},onClick:me,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:x,opacity:ve?Re:0,transition:k?"none":`opacity ${Jn}ms ${Bi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:L?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:P,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ve?1:0,transition:`opacity ${Jn}ms ${Bi}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:p,style:y,children:[n+1," / ",t.length]})})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:P,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ve?1:0,transition:`opacity ${Jn}ms ${Bi}`},children:t.length>1&&a.jsxs("p",{className:p,style:y,children:[n+1," / ",t.length]})})]})}),T&&xe&&(Le?a.jsx(yw,{src:xe.assetId,phase:V,mediaRef:q,mediaStyle:oe,onLoadedMetadata:ie,onClick:$e,onMouseMove:m,onTransitionEnd:Y},`${n}-${xe.assetId}`):a.jsx("img",{ref:q,src:xe.assetId,alt:xe.name,onLoad:ie,onTransitionEnd:Y,style:oe},`${n}-${xe.assetId}`)),ve&&fe&&t.length>1&&!Le&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...fe,left:T.left,cursor:"w-resize",pointerEvents:se?"none":"auto"},onClick:N=>{if($.current){$.current=!1;return}N.stopPropagation(),d()}}),a.jsx("div",{style:{...fe,left:T.left+T.width/2,cursor:"e-resize",pointerEvents:se?"none":"auto"},onClick:N=>{if($.current){$.current=!1;return}N.stopPropagation(),u()}})]}),a.jsx(bw,{prefix:e,closeIcon:g,closeIconMaxWidth:h,closeIconColor:b,closeIconHoverColor:S,iconMarginRight:_,contentMarginTop:v,isEditor:o,isPreviewMode:r,isEditMode:l,visible:ve,onClose:me})]})}function yd({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:r,isEditor:l,galleryPaddingBetween:c=0,showPaddingAfter:d=!1,showControls:u=!1,onMediaClick:p}){const y=`${e}-gallery-${Ys(t)?"video":"image"}`,x=r.display==="cover",g=hw(r),h=H=>E.scalingValue(H,l??!1),b=n??mo,S=o?{width:"100%",maxWidth:"100%"}:{width:h(b),maxWidth:"100%"},_=i?{borderRadius:h(i)}:{},v={...S,...x?{aspectRatio:g,height:"auto",overflow:"hidden"}:{},..._},L={...x?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":h(b)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...x?{}:_},q={className:y,style:L,onClick:p?H=>{H.stopPropagation(),p()}:void 0},X=Math.max(c,ti),B=Ys(t)?a.jsx("video",{...q,src:t.assetId,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...q,src:t.assetId,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[x?a.jsx("div",{style:v,children:B}):B,d&&c>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:h(c)},"aria-hidden":"true"}),u&&d&&a.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:h(X)}})]})}function ww({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:c,showControls:d,scaled:u,children:p}){const y=t==="a"?i:t==="c"?o:0,x=y>0||d;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&x&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(y)},"aria-hidden":"true"}),d&&t==="c"&&a.jsx("div",{"data-controls":"galleryPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(c),className:`${e}-control-anchor`,style:{top:0,left:0,width:u(l),height:"100%"}}),a.jsx("div",{className:`${e}-gallery`,style:n,children:p}),t==="a"&&x&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(y)},"aria-hidden":"true"}),d&&t==="a"&&a.jsx("div",{"data-controls":"galleryPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(c),className:`${e}-control-anchor`,style:{top:0,right:0,width:u(r),height:"100%"}})]})}function $w(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function Jr({P:e,controlKey:t,scaled:n,height:i,paired:o,side:r}){return a.jsx("div",{"data-controls":t,...o?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{...r==="top"?{top:0}:{bottom:0},left:0,width:"100%",height:n(i)}})}function vd({P:e,controlKey:t,scaled:n,width:i,maxFraction:o,side:r,paired:l,anchorStyle:c}){return a.jsx("div",{"data-controls":t,...l?{"data-controls-paired":""}:{},"data-controls-axis":"x","data-controls-variant":"column-padding",...r==="right"?{"data-controls-reverse":""}:{},"data-controls-min":"0","data-controls-max-fraction":String(o),className:`${e}-control-anchor`,style:{top:0,...r==="left"?{left:0}:{right:0},width:n(i),height:"100%",...c}})}function Ts({P:e,title:t,description:n,position:i,titleRef:o,titleClassName:r,titleContainerStyle:l,titleTextBoxStyle:c,titleStyle:d,descriptionClassName:u,descriptionStyle:p,descriptionPadding:y,showTextBoxOutline:x=!1,showDescriptionPaddingControl:g=!1,descriptionPaddingPaired:h=!1,topPaddingControl:b,bottomPaddingControl:S}){const _=s.useRef(null),[v,L]=s.useState(0),P=t??"",q=n??"",X=q.length>0,{horizontal:B,vertical:H}=Gl(i),O=H==="center"||H==="bottom",C=H==="bottom";s.useLayoutEffect(()=>{if(!O)return;const T=_.current;if(!T||typeof ResizeObserver>"u")return;const w=()=>L(T.offsetHeight);w();const V=new ResizeObserver(w);return V.observe(T),()=>V.disconnect()},[P,q,O]);const $=a.jsx("span",{className:`${e}-title-text`,style:d,children:P}),Q=X?a.jsx("span",{className:u,style:p,children:q}):null,R=X?a.jsx("div",{className:`${e}-title-texts-gap`,style:{height:y},children:g&&a.jsx("div",{"data-controls":"titleDescriptionPadding",...h?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{top:0,left:0,width:"100%",height:"100%"}})}):null;return a.jsx("div",{ref:T=>{_.current=T,o(T)},className:[r,`${e}-title-h-${B}`,`${e}-title-v-${H}`].join(" "),style:{...O?{[`--${e}-title-height`]:`${v}px`}:{},...l},children:a.jsxs("div",{className:`${e}-title-text-stack`,style:c,children:[b,a.jsx("div",{className:x?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:a.jsx("div",{className:`${e}-title-texts`,children:C?a.jsxs(a.Fragment,{children:[Q,R,$]}):a.jsxs(a.Fragment,{children:[$,R,Q]})})}),S]})})}const xd=45;function bd(e,t,n){let i=e;for(;i;){const o=getComputedStyle(i).getPropertyValue(t).trim();if(o){const r=parseFloat(o);if(!Number.isNaN(r))return r}i=i.parentElement}return n}function Cw(e){const t=bd(e,"--cntrl-viewport-height",window.innerHeight),n=bd(e,"--cntrl-article-top",0);return{top:n,height:t,centerY:n+t/2}}function Tw(e,t,n){const{vertical:i}=Gl(t),{top:o,height:r,centerY:l}=Cw(n);if(i==="top"){const d=n&&parseFloat(getComputedStyle(n).top)||o;return Math.abs(e.top-d)}if(i==="bottom")return Math.abs(e.bottom-(o+r));const c=e.top+e.height/2;return Math.abs(c-l)}function Iw(e,t,n){const i=Array.from({length:t},(l,c)=>{const d=e.current[c];if(!d)return 0;const u=d.getBoundingClientRect(),p=Tw(u,n,d);return Math.exp(-(p*p)/(2*xd*xd))});let o=0,r=-1;return i.forEach((l,c)=>{l>r&&(r=l,o=c)}),{opacities:i,dominantIndex:o}}function Lw(e,t,n){const i=s.useRef([]),[{opacities:o,dominantIndex:r},l]=s.useState(()=>({opacities:Array.from({length:e},(d,u)=>u===0?1:0),dominantIndex:0}));return s.useLayoutEffect(()=>{if(!t||e===0){l({opacities:Array.from({length:e},()=>1),dominantIndex:0});return}let d=0;const u=()=>{l(Iw(i,e,n))},p=()=>{d||(d=window.requestAnimationFrame(()=>{d=0,u()}))};return u(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p,{passive:!0}),()=>{d&&window.cancelAnimationFrame(d),window.removeEventListener("scroll",p),window.removeEventListener("resize",p)}},[t,e,n]),{setTitleRef:d=>u=>{i.current[d]=u},opacities:o,dominantIndex:r}}function Sd(e,t){const[n,i]=s.useState(e),o=s.useRef(e);return s.useEffect(()=>{if(!t){o.current=e,i(e);return}const r=Array.from(o.current),l=Array.from(e),c=Math.max(r.length,l.length);if(c===0||o.current===e)return;let d=0;const u=window.setInterval(()=>{d+=1;const p=[...l.slice(0,d),...r.slice(d)].join("");o.current=p,i(p),d>=c&&window.clearInterval(u)},70);return()=>window.clearInterval(u)},[t,e]),n}function Pw({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var dt,yt;const{prefix:l}=E.useScopedStyles(),c=s.useMemo(()=>JS(l),[l]),d=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",y=(e==null?void 0:e.imgWidth)??mo,x=(e==null?void 0:e.titleWidth)??gw,g=mw(e==null?void 0:e.imageDisplay),h=(e==null?void 0:e.cornerRadius)??QS,b=tw(e==null?void 0:e.position),{horizontal:S,vertical:_}=Gl(b),v=(e==null?void 0:e.titleTopPadding)??0,L=(e==null?void 0:e.titleBottomPadding)??0,P=(e==null?void 0:e.titleLeftPadding)??0,q=(e==null?void 0:e.titleRightPadding)??0,X=(e==null?void 0:e.titleDescriptionPadding)??0,B=$w(e==null?void 0:e.transition),H=(e==null?void 0:e.lightbox)??"on",O=p==="b",C=B==="fade"||B==="retype",{setTitleRef:$,dominantIndex:Q}=Lw(d.length,C,b),R=((dt=d[Q])==null?void 0:dt.title)??"",T=((yt=d[Q])==null?void 0:yt.description)??"",w=Sd(R,B==="retype"),V=Sd(T,B==="retype"),z=B==="fade"||B==="retype",U=B==="retype"?w:R,M=B==="retype"?V:T,f=O?void 0:{width:E.scalingValue(y,n??!1)},K=H==="on"&&(!n||i||o),G=o??!1,ge=(e==null?void 0:e.galleryPaddingRight)??0,k=(e==null?void 0:e.galleryPaddingLeft)??0,ce=(e==null?void 0:e.galleryPaddingBetween)??0,I=ut=>E.scalingValue(ut,n??!1),ee={width:I(x)},xe=p==="a"?ge:k,Le=O?{width:"100%"}:{width:`calc(100% - ${I(y)} - ${I(xe)})`,...p==="c"?{marginLeft:"auto"}:{}},se=Math.max(ge,ti),de=Math.max(k,ti),Z=Math.max(ce,ti),pe=Math.max(v,ti),ie=Math.max(L,ti),me=Math.max(P,ti),ve=Math.max(q,ti),Ee=Math.max(X,ti),Re=Math.max(0,(u??1)-(y??mo)),Ce=p==="a"?Math.max(0,(u??1)-(y??mo)-ge):p==="c"?Math.max(0,(u??1)-(y??mo)-k):p==="b"?u??1:1,$e=G&&_==="top",m=G&&_==="bottom",Y=G&&S==="left",te=G&&S==="right",oe=d.length>1,fe=O?void 0:I((p==="c"?k:ge)+(y??mo)),N=p==="c"&&fe?{left:fe}:void 0,F=p==="a"&&fe?{right:fe}:void 0,ne=O?{left:0,width:"100%"}:p==="a"?{right:I(ge),width:I(y)}:{left:I(k),width:I(y)},{titleColor:re,titleFontFamily:J,titleFontSettings:W,titleFontSize:Se,titleLineHeight:le,titleLetterSpacing:j,titleWordSpacing:Te,titleAlign:Fe,titleTextAppearance:Ye,descriptionColor:De,descriptionFontFamily:ze,descriptionFontSettings:Ze,descriptionFontSize:Ue,descriptionLineHeight:ye,descriptionLetterSpacing:_e,descriptionWordSpacing:Ve,descriptionAlign:Je,descriptionTextAppearance:et,lightboxCounterColor:ot,lightboxCounterFontFamily:lt,lightboxCounterFontSettings:Ke,lightboxCounterFontSize:ht,lightboxCounterLineHeight:tt,lightboxCounterLetterSpacing:Ge,lightboxCounterWordSpacing:We,lightboxCounterTextAppearance:Ne}=e??{},be={fontSettings:{fontFamily:J,fontWeight:(W==null?void 0:W.fontWeight)??400,fontStyle:(W==null?void 0:W.fontStyle)??"normal"},fontSize:Se??.01,lineHeight:le,letterSpacing:j??0,wordSpacing:Te??0,textAlign:Fe??"left",textAppearance:Ye,color:re??"#000000"},Xe=pn(nn(be,n)),ct=ee,rt={...Cs(Se,le,l,n),...Cs(Ue,ye,l,n,"description-leading-gap")},xt=$s(Se,le,`${l}-title`,`${l}-text-tight-leading`),pt={fontSettings:{fontFamily:ze,fontWeight:(Ze==null?void 0:Ze.fontWeight)??400,fontStyle:(Ze==null?void 0:Ze.fontStyle)??"normal"},fontSize:Ue??.01,lineHeight:ye,letterSpacing:_e??0,wordSpacing:Ve??0,textAlign:Je??"left",textAppearance:et,color:De??"#000000"},It=pn(nn(pt,n)),nt=$s(Ue,ye,`${l}-description-text`,`${l}-description-tight-leading`),bt=I(G?Ee:X),Lt={fontSettings:{fontFamily:lt,fontWeight:(Ke==null?void 0:Ke.fontWeight)??400,fontStyle:(Ke==null?void 0:Ke.fontStyle)??"normal"},fontSize:ht??.01,lineHeight:tt,letterSpacing:Ge??0,wordSpacing:We??0,textAppearance:Ne,color:ot??"#DEDDDD"},Ft={...pn(nn(Lt,n)),...Cs(ht,tt,l,n)},Me=$s(ht,tt,`${l}-lightbox-counter`,`${l}-text-tight-leading`),Oe=E.buildColorVars(l,{titleColor:re??"#000000",descriptionColor:De??"#000000",lightboxCounterColor:ot??"#DEDDDD"},rw,aw),St=s.useRef(null),[Mt,Qe]=s.useState(!1),[kt,Bt]=s.useState([]),[Wt,At]=s.useState(0),Ae=s.useCallback((ut,it)=>{K&&(Bt(ut),At(it),Qe(!0))},[K]),ft=s.useCallback(()=>{Qe(!1)},[]),gt=s.useMemo(()=>{const ut={...Oe},it=St.current?getComputedStyle(St.current).getPropertyValue("--cntrl-article-width").trim():"";return it&&(ut["--cntrl-article-width"]=it),ut},[Oe,Mt]);return s.useEffect(()=>{if(!Mt||H!=="on"||typeof document>"u")return;const ut=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ut}},[Mt,H]),s.useEffect(()=>{!n||o||i||Qe(!1)},[n,o,i]),s.useEffect(()=>{H==="off"&&Qe(!1)},[H]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx("div",{style:Oe,children:a.jsxs("div",{ref:St,className:`${l}-wrapper`,style:{width:E.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:_==="top"?I(v):void 0,[`--${l}-title-bottom-padding`]:_==="bottom"?I(L):void 0,[`--${l}-title-left-padding`]:S==="left"?I(P):void 0,[`--${l}-title-right-padding`]:S==="right"?I(q):void 0},children:[z&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(Ts,{P:l,title:U,description:M,position:b,titleRef:()=>{},titleClassName:`${xt} ${l}-single-title`,titleContainerStyle:{...rt,...Le},titleTextBoxStyle:ct,titleStyle:Xe,descriptionClassName:nt,descriptionStyle:It,descriptionPadding:bt,showTextBoxOutline:G,showDescriptionPaddingControl:G,topPaddingControl:$e?Jr({P:l,controlKey:"titleTopPadding",scaled:I,height:pe,paired:!1,side:"top"}):void 0,bottomPaddingControl:m?Jr({P:l,controlKey:"titleBottomPadding",scaled:I,height:ie,paired:!1,side:"bottom"}):void 0})}),d.map((ut,it)=>{const Nt=dw(ut.gallery),$t=it<d.length-1,Qt=Nt.filter(Dt=>Dt.lightboxMedia).map(Dt=>Dt.lightboxMedia),Xt={P:l,position:b,titleRef:$(it),titleClassName:xt,titleContainerStyle:rt,titleTextBoxStyle:z?{maxWidth:"100%"}:ct,titleStyle:Xe,descriptionClassName:nt,descriptionStyle:It,descriptionPadding:bt,showTextBoxOutline:G&&!z,showDescriptionPaddingControl:G&&!z,descriptionPaddingPaired:oe,topPaddingControl:$e&&!z?Jr({P:l,controlKey:"titleTopPadding",scaled:I,height:pe,paired:oe,side:"top"}):void 0,bottomPaddingControl:m&&!z?Jr({P:l,controlKey:"titleBottomPadding",scaled:I,height:ie,paired:oe,side:"bottom"}):void 0};return a.jsxs("div",{"data-item-index":it,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:$t?I(ce):void 0},children:[Y&&vd({P:l,controlKey:"titleLeftPadding",scaled:I,width:me,maxFraction:Ce,side:"left",paired:oe,anchorStyle:N}),te&&vd({P:l,controlKey:"titleRightPadding",scaled:I,width:ve,maxFraction:Ce,side:"right",paired:oe,anchorStyle:F}),G&&$t&&a.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${l}-control-anchor`,style:{bottom:0,height:I(Z),...ne}}),O?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:Nt.map(({displayMedia:Dt,lightboxMedia:jt},Ot)=>{const zt=jt?Qt.findIndex(D=>D.assetId===jt.assetId):-1;return a.jsx(yd,{P:l,media:Dt,imgWidth:y||void 0,cornerRadius:h||void 0,imageDisplay:g,isEditor:n,galleryPaddingBetween:ce,showPaddingAfter:Ot<Nt.length-1,showControls:G,onMediaClick:K&&zt>=0?()=>Ae(Qt,zt):void 0},`${Dt.assetId}-${Ot}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(Ts,{...Xt,title:z?"":ut.title,description:z?"":ut.description})})]}):a.jsxs(a.Fragment,{children:[a.jsx(Ts,{...Xt,title:z?"":ut.title,description:z?"":ut.description}),Nt.length>0&&a.jsx(ww,{P:l,layoutType:p,galleryWidthStyle:f,galleryPaddingRight:ge,galleryPaddingLeft:k,galleryPaddingRightWidth:se,galleryPaddingLeftWidth:de,galleryPaddingMaxFraction:Re,showControls:G,scaled:I,children:Nt.map(({displayMedia:Dt,lightboxMedia:jt},Ot)=>{const zt=jt?Qt.findIndex(D=>D.assetId===jt.assetId):-1;return a.jsx(yd,{P:l,media:Dt,cornerRadius:h||void 0,fillGalleryWidth:!0,imageDisplay:g,isEditor:n,galleryPaddingBetween:ce,showPaddingAfter:Ot<Nt.length-1,showControls:G,onMediaClick:K&&zt>=0?()=>Ae(Qt,zt):void 0},`${Dt.assetId}-${Ot}`)})})]})]},it)})]})}),Mt&&H==="on"&&typeof document<"u"&&e&&(()=>{const ut=(r?document.getElementById(r):null)??document.body;return qn.createPortal(a.jsx("div",{style:gt,"data-selection":"none",children:a.jsx(Sw,{prefix:l,items:kt,index:Wt,imageDisplay:fw(e.lightboxImageDisplay),isEditor:n,isPreviewMode:i,isEditMode:o,closeIcon:e.closeIcon,closeIconMaxWidth:e.closeIconMaxWidth,closeIconColor:e.closeIconColor,closeIconHoverColor:e.closeIconHoverColor,iconMarginRight:e.iconMarginRight,contentMarginTop:e.contentMarginTop,onClose:ft,onPrev:()=>At(it=>(it-1+kt.length)%kt.length),onNext:()=>At(it=>(it+1)%kt.length),counterClassName:Me,counterStyle:Ft,backgroundColor:e.backgroundColor??nw})}),ut)})()]})}const Mw=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
21399
21395
|
import { createPortal } from 'react-dom';
|
|
21400
21396
|
import type React from 'react';
|
|
21401
21397
|
import { CommonComponentProps } from '../props';
|
|
@@ -25153,7 +25149,7 @@ export function Helix({
|
|
|
25153
25149
|
word-spacing ${rn}ms ease,
|
|
25154
25150
|
padding ${rn}ms ease;
|
|
25155
25151
|
}
|
|
25156
|
-
`}function Qs(e){return e?!e.startsWith("http://")&&!e.startsWith("https://")&&!e.startsWith("blob:")&&!e.startsWith("data:"):!1}function U$(e,t){var i;const n=(i=e.logo)==null?void 0:i.icon;return!e.logo||Qs(n)||!t?e:{...e,logo:{...e.logo,icon:t}}}function q$(e){return`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`}function Y$(e){const t=e.trim().toLowerCase();return t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")?!0:t.includes(".svg")}function K$(e){const t=Y$(e),[n,i]=s.useState(!1);return s.useEffect(()=>{if(t||!e.startsWith("blob:")){i(!1);return}let o=!1;return fetch(e).then(r=>r.blob()).then(async r=>{if(o)return;if(r.type.includes("svg")){i(!0);return}if(r.type.startsWith("image/")&&!r.type.includes("svg")){i(!1);return}const l=await r.text();o||i(/<svg[\s>]/i.test(l.trim()))}).catch(()=>{o||i(!1)}),()=>{o=!0}},[t,e]),t||n}function Q$(e,t){const[n,i]=s.useState(yr(e)?e:null);return s.useEffect(()=>{if(!t||!e){i(null);return}if(yr(e)){i(e);return}let o=!1;return qu(e).then(r=>{o||i(r)}).catch(()=>{o||i(null)}),()=>{o=!0}},[t,e]),t?n:null}function Z$(e){const t=e.indexOf("#");if(t===-1)return"";try{return decodeURIComponent(e.slice(t+1))}catch{return e.slice(t+1)}}function J$(e){if(!e||e.startsWith("#"))return!0;try{return new URL(e,window.location.href).pathname===window.location.pathname}catch{return!1}}function zp(e){if(!e)return null;const t=document.getElementById(e),n=document.querySelector(`[data-section-id="${CSS.escape(e)}"]`),i=t??n;return i instanceof HTMLElement?i:null}function _d(e){const t=zp(e);return t?(t.scrollIntoView({behavior:"smooth",block:"start"}),!0):!1}function eC(e,t,n={}){const{isEditor:i,isPreviewMode:o,item:r,pages:l,onLinkNavigate:c}=n,d=n.runAfterClose??(x=>x()),u=e.currentTarget.getAttribute("href")??"",p=Z$(u),y=e.currentTarget.target==="_blank";if(r&&c){e.preventDefault(),e.stopPropagation();const x=Ks(r,l),g=_p(r),h={mode:g.type==="url"?"url":"page",href:x.href||u,page:g.type==="page"?g.value:void 0,url:g.type==="url"?g.value:void 0,anchor:g.type==="anchor"?g.value.replace(/^#/,""):(g.anchor??"").replace(/^#/,""),target:x.target};h.target==="_blank"?c(h):d(()=>c(h)),t();return}if(i){e.preventDefault(),d(()=>_d(p)),t();return}!y&&p&&J$(u)&&zp(p)&&(e.preventDefault(),d(()=>_d(p))),t()}const tC=["--cntrl-article-width","--cntrl-article-top","--cntrl-article-left","--cntrl-viewport-height"];function nC(e){let t=e;for(;t;){if(getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim())return t;t=t.parentElement}return e}function iC(e){const t={},n=nC(e);if(!n)return t;const i=getComputedStyle(n);for(const o of tC){const r=i.getPropertyValue(o).trim();r&&(t[o]=r)}return t}function Hd(e,t,n,i,o){return a.jsx("span",{className:`${e}-link-text-box`,style:{width:o(n),maxWidth:"100%"},children:a.jsx("span",{className:i?`${e}-link-text-inner`:`${e}-link-text-inner-hidden`,style:{width:"100%"},children:t})})}function oC({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,activeEvent:o,currentState:r,isSwitchClone:l=!1,unavailableStates:c=[],layoutId:d,pages:u,onLinkNavigate:p,onUpdateSettings:y,onOpenChange:x}){var tc;const{prefix:g}=E.useScopedStyles(),h=s.useRef(null),b=s.useRef(null),S=s.useRef(null),_=s.useRef(null),v=s.useRef(null),L=s.useRef(0),P=s.useRef(null),q=s.useRef(null),X=s.useRef(d),B=s.useMemo(()=>X$(g),[g]),[H,O]=s.useState(!1),[C,$]=s.useState(!1),[Q,R]=s.useState(!1),T=S$(r),w=s.useMemo(()=>new Set(c),[c]),V=_t=>!!(_t&&w.has(_t)),U=!!(t&&!i&&T==="open"&&!V("open"))||!(t&&!i)&&H,M=!!(t&&!i),f=U&&!M;jl(f),s.useEffect(()=>{if(!U||!M)return;const _t=document.documentElement,Yt=_t.style.overflow;return _t.style.overflow="hidden",()=>{_t.style.overflow=Yt}},[U,M]);const K=!V("compact")&&!V("onScroll"),G=!t||!!i&&!n,ge=o&&o!=="default"?o:void 0,k=K&&T==="compact"?"compact":"default",[ce,I]=s.useState(k),[ue,ee]=s.useState(!1),xe=!n;k!==ce&&(I(k),xe&&ee(!0));const Le=Dp(e),{logo:se,logoMaxHeight:de=120/1440,logoPosition:Z="left",panelHeight:pe=60/1440,backgroundColor:ie="#b3b3b3",logoColor:me="#000000",position:ve,horizontalAlign:Ee,verticalAlign:Re,iconColor:Ce="#000000",showIcon:$e="on",iconSize:m=16/1440,linkColor:Y="#000000",openLinkColor:te="#000000",compactIconColor:oe="#000000",compactLinkColor:fe="#000000",compactLogoColor:N="#000000",compactBackgroundColor:F="#ffffff",compactLogoMaxHeight:ne=120/1440,compactLogoPosition:re,compactPanelHeight:J=60/1440,compactShowIcon:W="on",compactIconSize:Se=16/1440,compactNavTextWidth:le,compactNavTextPosition:j,compactNavTextOffset:Te,compactNavGap:Fe,compactNavPaddingLeft:Ye=10/1440,compactNavPaddingRight:De=10/1440,compactFontFamily:ze,compactFontSettings:Ze,compactFontSize:Ue,compactLineHeight:ye,compactLetterSpacing:_e=0,compactWordSpacing:Ve=0,compactTextAlign:Je="left",compactTextAppearance:et,openLogoColor:ot="#000000",menuBackgroundColor:lt="#ffffff",overlayColor:Ke="rgba(0, 0, 0, 0.45)",closeButtonColor:ht="#000000",effect:tt="fade",openPanelSize:Ge=100,textWidth:We=280/1440,navTextWidth:Ne,navTextPosition:be="center",navTextOffset:He=0,gap:Xe=0,navGap:ct,navPaddingLeft:rt=10/1440,navPaddingRight:xt=10/1440,textPaddingLeft:pt=10/1440,textPaddingRight:It=10/1440,textPaddingTop:nt=10/1440,textPaddingBottom:bt=10/1440,fontFamily:Lt,fontSettings:Ut,fontSize:Ft,lineHeight:Me,letterSpacing:Oe=0,wordSpacing:St=0,textAlign:Mt="left",textAppearance:Qe,openFontFamily:kt,openFontSettings:Bt,openFontSize:Wt,openLineHeight:At,openLetterSpacing:Ae,openWordSpacing:ft,openTextAlign:gt,openTextAppearance:dt,stateOverrides:yt,link:ut}=Le,{horizontalAlign:it,verticalAlign:Nt}=_$({position:ve,horizontalAlign:Ee,verticalAlign:Re}),$t=k==="compact",Qt=$t?ne:de,Xt=w$($t?re:Z),Ot=$t?J:pe,jt=$t?Se:m,Dt=$t?le:Ne,zt=$$($t?j:be),D=($t?Te:He)??0,Ie=$t?Fe:ct,Be=$t?Ye:rt,ke=$t?De:xt,vt=Dt??We,Ct=U||($t?W:$e)!=="off",at=E.buildColorVars(g,{iconColor:Ce,closeButtonColor:ht,linkColor:Y,openLinkColor:te,compactIconColor:oe,compactLinkColor:fe,compactLogoColor:N,compactBackgroundColor:F,openLogoColor:ot,menuBackgroundColor:lt,overlayColor:Ke,backgroundColor:ie,logoColor:me},B$,j$,yt),Tt=Ed($t?{fontFamily:ze,fontSettings:Ze,fontSize:Ue,lineHeight:ye,letterSpacing:_e,wordSpacing:Ve,textAlign:Je,textAppearance:et}:{fontFamily:Lt,fontSettings:Ut,fontSize:Ft,lineHeight:Me,letterSpacing:Oe,wordSpacing:St,textAlign:Mt,textAppearance:Qe}),Vt=Ed({fontFamily:kt,fontSettings:Bt,fontSize:Wt,lineHeight:At,letterSpacing:Ae,wordSpacing:ft,textAlign:gt,textAppearance:dt},Tt),Pt=kd(g,Tt,t),Zt=kd(g,Vt,t),on=Ld(S,Md(Tt)),Wn=Ld(_,Md(Vt)),xn={...Zt.css,whiteSpace:"pre-wrap",transform:Pd(Wn)},ui=Zt.className,dn=_t=>E.scalingValue(_t,t),pi=Ie??Xe,Kn=Math.max(Be,fo),bn=Math.max(ke,fo),gi=Math.max(0,1-jt),eo=Math.max(0,1-jt),Sn=n??!1,Qn=Sn&&!U,to=s.useMemo(()=>Op({textPaddingLeft:pt,textPaddingRight:It,textPaddingTop:nt,textPaddingBottom:bt,fontSize:Vt.fontSize}),[pt,It,nt,bt,Vt.fontSize]),no=_t=>{const Yt=a.jsx("span",{className:ui,style:xn,children:Ad(_t)});return Hd(g,Yt,We,Sn,dn)},qe=tt==="left"||tt==="right"?{width:`${Ge}%`}:{height:`${Ge}%`},A={...D$(to,t),...qe,alignItems:G$[it],justifyContent:V$[Nt]},ae=s.useRef(e),he=s.useRef(d),Pe=s.useRef(null);Qs((tc=e.logo)==null?void 0:tc.icon)&&(Pe.current=e.logo.icon),s.useEffect(()=>{var Nr;if(!y||!t){ae.current=e,he.current=d;return}const _t=(Nr=e.logo)==null?void 0:Nr.icon;if(e.logo&&!Qs(_t)&&!Pe.current){ae.current=e,he.current=d;return}const Yt=_r=>{y(U$(_r,Pe.current))};if(he.current!==d){ae.current=e,he.current=d;const _r=Nd(e);_r!==e&&Yt(_r);return}const cn=Nd(e),fn=ae.current,wn=fn!==e,An=wn?O$(cn,fn):cn;ae.current=e;const io=cn!==e,Uo=wn&&H$(cn,An);!io&&!Uo||Yt(An)},[e,y,t,d]);const je=E.scalingValue(jt,t),mt={width:je,height:je,minWidth:je,minHeight:je,maxWidth:je,maxHeight:je},Ht={...Pt.css,textDecoration:"none",transform:Pd(on)},qt=Pt.className,sn=(se==null?void 0:se.mode)!=="Off",en=(se==null?void 0:se.icon)??"",mi=K$(en),kn=Q$(en,mi),Zn=!!kn,kr=dn(Math.min(Qt,Ot)),Xo=!!(sn&&en&&Xt==="right")?"left":"right",Ql=Array.isArray(ut)?ut:[],Ga=[k!=="default"?`${g}-state-${k}`:"",U||T==="open"?`${g}-state-open`:"",ge&&ge!==k&&ge!==T?`${g}-state-${ge}`:""].filter(Boolean).join(" "),Zp=t&&!i?`${g}-editor`:"",Zl=G?`${g}-interactive`:"",Jp=xe&&(k!==ce||ue)?`${g}-nav-state-anim`:"",eg=U?`${g}-open`:"",tg=s.useMemo(()=>iC(h.current),[C,U,d]),Xa=()=>{O(!1)},Ua=!t||i,ng=_t=>{if(f){q.current=_t;return}_t()};s.useEffect(()=>{if(U)return;const _t=q.current;q.current=null,_t==null||_t()},[U]);const Jl=(_t,Yt)=>{eC(_t,Xa,{isEditor:t,isPreviewMode:i,item:Yt,pages:u,onLinkNavigate:p,runAfterClose:ng})},ig=()=>{t&&!i||O(_t=>!_t)},og=_t=>{_t.pointerType==="touch"&&_t.currentTarget.blur()},Ar=()=>{P.current!==null&&(window.clearTimeout(P.current),P.current=null)};s.useEffect(()=>{if(!ue)return;const _t=window.setTimeout(()=>{ee(!1)},rn);return()=>window.clearTimeout(_t)},[ue,k]),s.useEffect(()=>{if(U){Ar(),$(!0);return}return L.current+=1,R(!1),Ar(),P.current=window.setTimeout(()=>{P.current=null,$(!1)},Tn),Ar},[U]),s.useLayoutEffect(()=>{X.current!==d&&(X.current=d,L.current+=1,Ar(),O(!1),R(!1),$(!1))},[d]),s.useLayoutEffect(()=>{var cn;if(!C||!U)return;const _t=L.current+1;L.current=_t,R(!1),(cn=b.current)==null||cn.offsetHeight;const Yt=requestAnimationFrame(()=>{L.current===_t&&R(!0)});return()=>{cancelAnimationFrame(Yt)}},[C,U]),s.useLayoutEffect(()=>{if(!f||!C)return;const _t=v.current;if(!_t)return;const Yt=getComputedStyle(_t).backgroundColor;if(!Yt)return;const cn=document.documentElement,{body:fn}=document,wn=cn.style.backgroundColor,An=fn.style.backgroundColor;return cn.style.backgroundColor=Yt,fn.style.backgroundColor=Yt,()=>{cn.style.backgroundColor=wn,fn.style.backgroundColor=An}},[f,C,Ga,lt,yt]),s.useEffect(()=>{x==null||x(U)},[U,x]),s.useEffect(()=>{if(!U)return;const _t=Yt=>{Yt.key==="Escape"&&(t&&i||Xa())};return window.addEventListener("keydown",_t),()=>window.removeEventListener("keydown",_t)},[U,t,i]),s.useEffect(()=>{t&&!i&&T!=="open"&&O(!1)},[t,i,T]),s.useEffect(()=>{i&&O(!1)},[i]);const ec=Sn&&U,rg=_t=>Ql.filter(Yt=>L$(Yt,d)).map((Yt,cn)=>{const{label:fn,href:wn,target:An}=Ks(Yt,u),io=wn?a.jsx("a",{href:wn,target:An,rel:An==="_blank"?"noopener noreferrer":void 0,className:`${_t} ${g}-has-href`,onClick:Uo=>Jl(Uo,Yt),children:no(fn)}):a.jsx("span",{className:_t,children:no(fn)});return a.jsxs(s.Fragment,{children:[cn>0&&a.jsx("div",{"data-controls":ec?"gap":void 0,"data-controls-axis":"y",className:ec?`${g}-gap-control`:void 0,style:{height:dn(Xe)}}),io]},cn)}),ag=C?a.jsxs("div",{ref:b,"data-selection":"none",className:[`${g}-lightbox`,`${g}-full-lightbox ${g}-effect-${tt}`,Q?`${g}-lightbox-active`:"",`${g}-lightbox-editor`,n?`${g}-lightbox-edit-mode`:"",Zl,Ga].filter(Boolean).join(" "),style:{...at,...tg},"aria-hidden":!Q,children:[a.jsx("div",{className:[`${g}-backdrop`,Ua?`${g}-backdrop-clickable`:""].filter(Boolean).join(" "),"aria-hidden":"true",onClick:Ua?Xa:void 0}),a.jsxs("nav",{className:[`${g}-panel`,Ua?`${g}-panel-blocking`:""].filter(Boolean).join(" "),style:A,"aria-label":"Menu","data-lightbox-scrollable":"",children:[Sn&&z$(g,to,Vt.fontSize,dn),rg(`${g}-link`)]}),f?a.jsx("div",{ref:v,className:`${g}-safari-tint`,"aria-hidden":"true"}):null]}):null,sg=()=>a.jsx("button",{type:"button",className:`${g}-toggle`,onClick:ig,onPointerUp:og,"aria-expanded":U,"aria-label":U?"Close menu":"Open menu",children:a.jsx(R$,{className:`${g}-icon`,lineClassName:`${g}-icon-line`})}),Fr=_t=>{const Yt=_t==="left",cn=Yt?Be:ke,fn=Yt?Kn:bn,wn=Yt?gi:eo,An=$t?Yt?"compactNavPaddingLeft":"compactNavPaddingRight":Yt?"navPaddingLeft":"navPaddingRight";return a.jsx("div",{className:Yt?`${g}-nav-padding-left`:`${g}-nav-padding-right`,style:{width:dn(cn),flexShrink:0},children:Qn?a.jsx("div",{"data-controls":An,"data-controls-axis":"x","data-controls-variant":"column-padding",...Yt?{}:{"data-controls-reverse":""},"data-controls-min":"0","data-controls-max-fraction":String(wn),className:`${g}-control-anchor`,style:{top:0,[Yt?"left":"right"]:0,width:dn(fn),height:"100%"}}):null})},lg=(_t,Yt)=>{const{label:cn,href:fn,target:wn}=Ks(_t,u),An=a.jsx("span",{className:qt,style:Ht,children:Ad(cn)}),io=Hd(g,An,vt,Qn,dn),Uo=fn?a.jsx("a",{href:fn,target:wn,rel:wn==="_blank"?"noopener noreferrer":void 0,className:`${g}-nav-link ${g}-has-href`,onClick:Nr=>Jl(Nr,_t),children:io}):a.jsx("span",{className:`${g}-nav-link`,children:io});return a.jsxs(s.Fragment,{children:[Yt>0&&a.jsx("div",{"data-controls":Qn?$t?"compactNavGap":"navGap":void 0,"data-controls-axis":"x",className:Qn?`${g}-gap-control ${g}-nav-gap-control`:`${g}-nav-gap-control}`,style:{width:dn(pi),flexShrink:0}}),Uo]},Yt)},cg={...at,height:E.scalingValue(Ot,t),minHeight:E.scalingValue(Ot,t),[`--${g}-panel-height`]:E.scalingValue(Ot,t)},dg=l&&k==="default"&&T!=="open"&&!i?dn(pe+v$):"0px";return a.jsxs("div",{ref:h,className:`${g}-root ${Ga} ${Zp} ${Zl} ${Jp}`.trim(),style:{width:"100%",height:"100%",lineHeight:0,fontSize:0,marginTop:dg,...at},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:B}}),a.jsx("span",{ref:S,"aria-hidden":!0,style:Rd(Pt.css),children:"H"}),a.jsx("span",{ref:_,"aria-hidden":!0,style:Rd(Zt.css),children:"H"}),a.jsx("div",{className:`${g}-nav-slide`,children:a.jsxs("div",{className:`${g}-nav-bar`,style:cg,children:[sn&&en?a.jsxs("div",{className:`${g}-nav-logo ${g}-nav-logo-${Xt}`,children:[Xt==="left"?Fr("left"):null,a.jsxs("div",{className:`${g}-nav-logo-inner${Zn?` ${g}-nav-logo-tinted`:""}`,style:{height:kr,...Zn&&kn?{[`--${g}-logo-image`]:q$(kn)}:{}},children:[a.jsx("img",{src:Zn&&kn?kn:en,alt:"",className:`${g}-nav-logo-img`}),Zn?a.jsx("span",{className:`${g}-nav-logo-tint`,"aria-hidden":"true"}):null]}),Xt==="right"?Fr("right"):null]}):null,a.jsx("nav",{className:`${g}-nav-links ${g}-nav-links-${zt}`,style:{transform:C$(zt,D,t)},"aria-label":"Navigation",children:a.jsx("div",{className:`${g}-nav-links-inner`,children:Ql.filter(_t=>I$(_t,k,d)).map((_t,Yt)=>lg(_t,Yt))})})]})}),ag,a.jsxs("div",{className:`${g}-nav-toggle-wrap ${g}-nav-toggle-wrap-${Xo}`,children:[Xo==="left"?Fr("left"):null,Ct?a.jsx("div",{className:`${g}-root ${eg}`.trim(),style:mt,children:sg()}):null,Xo==="right"?Fr("right"):null]})]})}const rC=`import { Fragment, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type MouseEvent, type PointerEvent, type ReactNode } from 'react';
|
|
25152
|
+
`}function Qs(e){return e?!e.startsWith("http://")&&!e.startsWith("https://")&&!e.startsWith("blob:")&&!e.startsWith("data:"):!1}function U$(e,t){var i;const n=(i=e.logo)==null?void 0:i.icon;return!e.logo||Qs(n)||!t?e:{...e,logo:{...e.logo,icon:t}}}function q$(e){return`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`}function Y$(e){const t=e.trim().toLowerCase();return t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")?!0:t.includes(".svg")}function K$(e){const t=Y$(e),[n,i]=s.useState(!1);return s.useEffect(()=>{if(t||!e.startsWith("blob:")){i(!1);return}let o=!1;return fetch(e).then(r=>r.blob()).then(async r=>{if(o)return;if(r.type.includes("svg")){i(!0);return}if(r.type.startsWith("image/")&&!r.type.includes("svg")){i(!1);return}const l=await r.text();o||i(/<svg[\s>]/i.test(l.trim()))}).catch(()=>{o||i(!1)}),()=>{o=!0}},[t,e]),t||n}function Q$(e,t){const[n,i]=s.useState(yr(e)?e:null);return s.useEffect(()=>{if(!t||!e){i(null);return}if(yr(e)){i(e);return}let o=!1;return qu(e).then(r=>{o||i(r)}).catch(()=>{o||i(null)}),()=>{o=!0}},[t,e]),t?n:null}function Z$(e){const t=e.indexOf("#");if(t===-1)return"";try{return decodeURIComponent(e.slice(t+1))}catch{return e.slice(t+1)}}function J$(e){if(!e||e.startsWith("#"))return!0;try{return new URL(e,window.location.href).pathname===window.location.pathname}catch{return!1}}function zp(e){if(!e)return null;const t=document.getElementById(e),n=document.querySelector(`[data-section-id="${CSS.escape(e)}"]`),i=t??n;return i instanceof HTMLElement?i:null}function _d(e){const t=zp(e);return t?(t.scrollIntoView({behavior:"smooth",block:"start"}),!0):!1}function eC(e,t,n={}){const{isEditor:i,isPreviewMode:o,item:r,pages:l,onLinkNavigate:c}=n,d=n.runAfterClose??(x=>x()),u=e.currentTarget.getAttribute("href")??"",p=Z$(u),y=e.currentTarget.target==="_blank";if(r&&c){e.preventDefault(),e.stopPropagation();const x=Ks(r,l),g=_p(r),h={mode:g.type==="url"?"url":"page",href:x.href||u,page:g.type==="page"?g.value:void 0,url:g.type==="url"?g.value:void 0,anchor:g.type==="anchor"?g.value.replace(/^#/,""):(g.anchor??"").replace(/^#/,""),target:x.target};h.target==="_blank"?c(h):d(()=>c(h)),t();return}if(i){e.preventDefault(),d(()=>_d(p)),t();return}!y&&p&&J$(u)&&zp(p)&&(e.preventDefault(),d(()=>_d(p))),t()}const tC=["--cntrl-article-width","--cntrl-article-top","--cntrl-article-left","--cntrl-viewport-height"];function nC(e){let t=e;for(;t;){if(getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim())return t;t=t.parentElement}return e}function iC(e){const t={},n=nC(e);if(!n)return t;const i=getComputedStyle(n);for(const o of tC){const r=i.getPropertyValue(o).trim();r&&(t[o]=r)}return t}function Hd(e,t,n,i,o){return a.jsx("span",{className:`${e}-link-text-box`,style:{width:o(n),maxWidth:"100%"},children:a.jsx("span",{className:i?`${e}-link-text-inner`:`${e}-link-text-inner-hidden`,style:{width:"100%"},children:t})})}function oC({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,activeEvent:o,currentState:r,isSwitchClone:l=!1,unavailableStates:c=[],layoutId:d,pages:u,onLinkNavigate:p,onUpdateSettings:y,onOpenChange:x}){var tc;const{prefix:g}=E.useScopedStyles(),h=s.useRef(null),b=s.useRef(null),S=s.useRef(null),_=s.useRef(null),v=s.useRef(null),L=s.useRef(0),P=s.useRef(null),q=s.useRef(null),X=s.useRef(d),B=s.useMemo(()=>X$(g),[g]),[H,O]=s.useState(!1),[C,$]=s.useState(!1),[Q,R]=s.useState(!1),T=S$(r),w=s.useMemo(()=>new Set(c),[c]),V=_t=>!!(_t&&w.has(_t)),U=!!(t&&!i&&T==="open"&&!V("open"))||!(t&&!i)&&H,M=!!(t&&!i),f=U&&!M;jl(f),s.useEffect(()=>{if(!U||!M)return;const _t=document.documentElement,Yt=_t.style.overflow;return _t.style.overflow="hidden",()=>{_t.style.overflow=Yt}},[U,M]);const K=!V("compact")&&!V("onScroll"),G=!t||!!i&&!n,ge=o&&o!=="default"?o:void 0,k=K&&T==="compact"?"compact":"default",[ce,I]=s.useState(k),[ue,ee]=s.useState(!1),xe=!n;k!==ce&&(I(k),xe&&ee(!0));const Le=Dp(e),{logo:se,logoMaxHeight:de=120/1440,logoPosition:Z="left",panelHeight:pe=60/1440,backgroundColor:ie="#b3b3b3",logoColor:me="#000000",position:ve,horizontalAlign:Ee,verticalAlign:Re,iconColor:Ce="#000000",showIcon:$e="on",iconSize:m=16/1440,linkColor:Y="#000000",openLinkColor:te="#000000",compactIconColor:oe="#000000",compactLinkColor:fe="#000000",compactLogoColor:N="#000000",compactBackgroundColor:F="#ffffff",compactLogoMaxHeight:ne=120/1440,compactLogoPosition:re,compactPanelHeight:J=60/1440,compactShowIcon:W="on",compactIconSize:Se=16/1440,compactNavTextWidth:le,compactNavTextPosition:j,compactNavTextOffset:Te,compactNavGap:Fe,compactNavPaddingLeft:Ye=10/1440,compactNavPaddingRight:De=10/1440,compactFontFamily:ze,compactFontSettings:Ze,compactFontSize:Ue,compactLineHeight:ye,compactLetterSpacing:_e=0,compactWordSpacing:Ve=0,compactTextAlign:Je="left",compactTextAppearance:et,openLogoColor:ot="#000000",menuBackgroundColor:lt="#ffffff",overlayColor:Ke="rgba(0, 0, 0, 0.45)",closeButtonColor:ht="#000000",effect:tt="fade",openPanelSize:Ge=100,textWidth:We=280/1440,navTextWidth:Ne,navTextPosition:be="center",navTextOffset:He=0,gap:Xe=0,navGap:ct,navPaddingLeft:rt=10/1440,navPaddingRight:xt=10/1440,textPaddingLeft:pt=10/1440,textPaddingRight:It=10/1440,textPaddingTop:nt=10/1440,textPaddingBottom:bt=10/1440,fontFamily:Lt,fontSettings:Ut,fontSize:Ft,lineHeight:Me,letterSpacing:Oe=0,wordSpacing:St=0,textAlign:Mt="left",textAppearance:Qe,openFontFamily:kt,openFontSettings:Bt,openFontSize:Wt,openLineHeight:At,openLetterSpacing:Ae,openWordSpacing:ft,openTextAlign:gt,openTextAppearance:dt,stateOverrides:yt,link:ut}=Le,{horizontalAlign:it,verticalAlign:Nt}=_$({position:ve,horizontalAlign:Ee,verticalAlign:Re}),$t=k==="compact",Qt=$t?ne:de,Xt=w$($t?re:Z),Dt=$t?J:pe,jt=$t?Se:m,Ot=$t?le:Ne,zt=$$($t?j:be),D=($t?Te:He)??0,Ie=$t?Fe:ct,Be=$t?Ye:rt,ke=$t?De:xt,vt=Ot??We,Ct=U||($t?W:$e)!=="off",at=E.buildColorVars(g,{iconColor:Ce,closeButtonColor:ht,linkColor:Y,openLinkColor:te,compactIconColor:oe,compactLinkColor:fe,compactLogoColor:N,compactBackgroundColor:F,openLogoColor:ot,menuBackgroundColor:lt,overlayColor:Ke,backgroundColor:ie,logoColor:me},B$,j$,yt),Tt=Ed($t?{fontFamily:ze,fontSettings:Ze,fontSize:Ue,lineHeight:ye,letterSpacing:_e,wordSpacing:Ve,textAlign:Je,textAppearance:et}:{fontFamily:Lt,fontSettings:Ut,fontSize:Ft,lineHeight:Me,letterSpacing:Oe,wordSpacing:St,textAlign:Mt,textAppearance:Qe}),Vt=Ed({fontFamily:kt,fontSettings:Bt,fontSize:Wt,lineHeight:At,letterSpacing:Ae,wordSpacing:ft,textAlign:gt,textAppearance:dt},Tt),Pt=kd(g,Tt,t),Zt=kd(g,Vt,t),on=Ld(S,Md(Tt)),Wn=Ld(_,Md(Vt)),xn={...Zt.css,whiteSpace:"pre-wrap",transform:Pd(Wn)},ui=Zt.className,dn=_t=>E.scalingValue(_t,t),pi=Ie??Xe,Kn=Math.max(Be,fo),bn=Math.max(ke,fo),gi=Math.max(0,1-jt),eo=Math.max(0,1-jt),Sn=n??!1,Qn=Sn&&!U,to=s.useMemo(()=>Op({textPaddingLeft:pt,textPaddingRight:It,textPaddingTop:nt,textPaddingBottom:bt,fontSize:Vt.fontSize}),[pt,It,nt,bt,Vt.fontSize]),no=_t=>{const Yt=a.jsx("span",{className:ui,style:xn,children:Ad(_t)});return Hd(g,Yt,We,Sn,dn)},qe=tt==="left"||tt==="right"?{width:`${Ge}%`}:{height:`${Ge}%`},A={...D$(to,t),...qe,alignItems:G$[it],justifyContent:V$[Nt]},ae=s.useRef(e),he=s.useRef(d),Pe=s.useRef(null);Qs((tc=e.logo)==null?void 0:tc.icon)&&(Pe.current=e.logo.icon),s.useEffect(()=>{var Nr;if(!y||!t){ae.current=e,he.current=d;return}const _t=(Nr=e.logo)==null?void 0:Nr.icon;if(e.logo&&!Qs(_t)&&!Pe.current){ae.current=e,he.current=d;return}const Yt=_r=>{y(U$(_r,Pe.current))};if(he.current!==d){ae.current=e,he.current=d;const _r=Nd(e);_r!==e&&Yt(_r);return}const cn=Nd(e),fn=ae.current,wn=fn!==e,An=wn?O$(cn,fn):cn;ae.current=e;const io=cn!==e,Uo=wn&&H$(cn,An);!io&&!Uo||Yt(An)},[e,y,t,d]);const je=E.scalingValue(jt,t),mt={width:je,height:je,minWidth:je,minHeight:je,maxWidth:je,maxHeight:je},Ht={...Pt.css,textDecoration:"none",transform:Pd(on)},qt=Pt.className,sn=(se==null?void 0:se.mode)!=="Off",en=(se==null?void 0:se.icon)??"",mi=K$(en),kn=Q$(en,mi),Zn=!!kn,kr=dn(Math.min(Qt,Dt)),Xo=!!(sn&&en&&Xt==="right")?"left":"right",Ql=Array.isArray(ut)?ut:[],Ga=[k!=="default"?`${g}-state-${k}`:"",U||T==="open"?`${g}-state-open`:"",ge&&ge!==k&&ge!==T?`${g}-state-${ge}`:""].filter(Boolean).join(" "),Zp=t&&!i?`${g}-editor`:"",Zl=G?`${g}-interactive`:"",Jp=xe&&(k!==ce||ue)?`${g}-nav-state-anim`:"",eg=U?`${g}-open`:"",tg=s.useMemo(()=>iC(h.current),[C,U,d]),Xa=()=>{O(!1)},Ua=!t||i,ng=_t=>{if(f){q.current=_t;return}_t()};s.useEffect(()=>{if(U)return;const _t=q.current;q.current=null,_t==null||_t()},[U]);const Jl=(_t,Yt)=>{eC(_t,Xa,{isEditor:t,isPreviewMode:i,item:Yt,pages:u,onLinkNavigate:p,runAfterClose:ng})},ig=()=>{t&&!i||O(_t=>!_t)},og=_t=>{_t.pointerType==="touch"&&_t.currentTarget.blur()},Ar=()=>{P.current!==null&&(window.clearTimeout(P.current),P.current=null)};s.useEffect(()=>{if(!ue)return;const _t=window.setTimeout(()=>{ee(!1)},rn);return()=>window.clearTimeout(_t)},[ue,k]),s.useEffect(()=>{if(U){Ar(),$(!0);return}return L.current+=1,R(!1),Ar(),P.current=window.setTimeout(()=>{P.current=null,$(!1)},Tn),Ar},[U]),s.useLayoutEffect(()=>{X.current!==d&&(X.current=d,L.current+=1,Ar(),O(!1),R(!1),$(!1))},[d]),s.useLayoutEffect(()=>{var cn;if(!C||!U)return;const _t=L.current+1;L.current=_t,R(!1),(cn=b.current)==null||cn.offsetHeight;const Yt=requestAnimationFrame(()=>{L.current===_t&&R(!0)});return()=>{cancelAnimationFrame(Yt)}},[C,U]),s.useLayoutEffect(()=>{if(!f||!C)return;const _t=v.current;if(!_t)return;const Yt=getComputedStyle(_t).backgroundColor;if(!Yt)return;const cn=document.documentElement,{body:fn}=document,wn=cn.style.backgroundColor,An=fn.style.backgroundColor;return cn.style.backgroundColor=Yt,fn.style.backgroundColor=Yt,()=>{cn.style.backgroundColor=wn,fn.style.backgroundColor=An}},[f,C,Ga,lt,yt]),s.useEffect(()=>{x==null||x(U)},[U,x]),s.useEffect(()=>{if(!U)return;const _t=Yt=>{Yt.key==="Escape"&&(t&&i||Xa())};return window.addEventListener("keydown",_t),()=>window.removeEventListener("keydown",_t)},[U,t,i]),s.useEffect(()=>{t&&!i&&T!=="open"&&O(!1)},[t,i,T]),s.useEffect(()=>{i&&O(!1)},[i]);const ec=Sn&&U,rg=_t=>Ql.filter(Yt=>L$(Yt,d)).map((Yt,cn)=>{const{label:fn,href:wn,target:An}=Ks(Yt,u),io=wn?a.jsx("a",{href:wn,target:An,rel:An==="_blank"?"noopener noreferrer":void 0,className:`${_t} ${g}-has-href`,onClick:Uo=>Jl(Uo,Yt),children:no(fn)}):a.jsx("span",{className:_t,children:no(fn)});return a.jsxs(s.Fragment,{children:[cn>0&&a.jsx("div",{"data-controls":ec?"gap":void 0,"data-controls-axis":"y",className:ec?`${g}-gap-control`:void 0,style:{height:dn(Xe)}}),io]},cn)}),ag=C?a.jsxs("div",{ref:b,"data-selection":"none",className:[`${g}-lightbox`,`${g}-full-lightbox ${g}-effect-${tt}`,Q?`${g}-lightbox-active`:"",`${g}-lightbox-editor`,n?`${g}-lightbox-edit-mode`:"",Zl,Ga].filter(Boolean).join(" "),style:{...at,...tg},"aria-hidden":!Q,children:[a.jsx("div",{className:[`${g}-backdrop`,Ua?`${g}-backdrop-clickable`:""].filter(Boolean).join(" "),"aria-hidden":"true",onClick:Ua?Xa:void 0}),a.jsxs("nav",{className:[`${g}-panel`,Ua?`${g}-panel-blocking`:""].filter(Boolean).join(" "),style:A,"aria-label":"Menu","data-lightbox-scrollable":"",children:[Sn&&z$(g,to,Vt.fontSize,dn),rg(`${g}-link`)]}),f?a.jsx("div",{ref:v,className:`${g}-safari-tint`,"aria-hidden":"true"}):null]}):null,sg=()=>a.jsx("button",{type:"button",className:`${g}-toggle`,onClick:ig,onPointerUp:og,"aria-expanded":U,"aria-label":U?"Close menu":"Open menu",children:a.jsx(R$,{className:`${g}-icon`,lineClassName:`${g}-icon-line`})}),Fr=_t=>{const Yt=_t==="left",cn=Yt?Be:ke,fn=Yt?Kn:bn,wn=Yt?gi:eo,An=$t?Yt?"compactNavPaddingLeft":"compactNavPaddingRight":Yt?"navPaddingLeft":"navPaddingRight";return a.jsx("div",{className:Yt?`${g}-nav-padding-left`:`${g}-nav-padding-right`,style:{width:dn(cn),flexShrink:0},children:Qn?a.jsx("div",{"data-controls":An,"data-controls-axis":"x","data-controls-variant":"column-padding",...Yt?{}:{"data-controls-reverse":""},"data-controls-min":"0","data-controls-max-fraction":String(wn),className:`${g}-control-anchor`,style:{top:0,[Yt?"left":"right"]:0,width:dn(fn),height:"100%"}}):null})},lg=(_t,Yt)=>{const{label:cn,href:fn,target:wn}=Ks(_t,u),An=a.jsx("span",{className:qt,style:Ht,children:Ad(cn)}),io=Hd(g,An,vt,Qn,dn),Uo=fn?a.jsx("a",{href:fn,target:wn,rel:wn==="_blank"?"noopener noreferrer":void 0,className:`${g}-nav-link ${g}-has-href`,onClick:Nr=>Jl(Nr,_t),children:io}):a.jsx("span",{className:`${g}-nav-link`,children:io});return a.jsxs(s.Fragment,{children:[Yt>0&&a.jsx("div",{"data-controls":Qn?$t?"compactNavGap":"navGap":void 0,"data-controls-axis":"x",className:Qn?`${g}-gap-control ${g}-nav-gap-control`:`${g}-nav-gap-control}`,style:{width:dn(pi),flexShrink:0}}),Uo]},Yt)},cg={...at,height:E.scalingValue(Dt,t),minHeight:E.scalingValue(Dt,t),[`--${g}-panel-height`]:E.scalingValue(Dt,t)},dg=l&&k==="default"&&T!=="open"&&!i?dn(pe+v$):"0px";return a.jsxs("div",{ref:h,className:`${g}-root ${Ga} ${Zp} ${Zl} ${Jp}`.trim(),style:{width:"100%",height:"100%",lineHeight:0,fontSize:0,marginTop:dg,...at},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:B}}),a.jsx("span",{ref:S,"aria-hidden":!0,style:Rd(Pt.css),children:"H"}),a.jsx("span",{ref:_,"aria-hidden":!0,style:Rd(Zt.css),children:"H"}),a.jsx("div",{className:`${g}-nav-slide`,children:a.jsxs("div",{className:`${g}-nav-bar`,style:cg,children:[sn&&en?a.jsxs("div",{className:`${g}-nav-logo ${g}-nav-logo-${Xt}`,children:[Xt==="left"?Fr("left"):null,a.jsxs("div",{className:`${g}-nav-logo-inner${Zn?` ${g}-nav-logo-tinted`:""}`,style:{height:kr,...Zn&&kn?{[`--${g}-logo-image`]:q$(kn)}:{}},children:[a.jsx("img",{src:Zn&&kn?kn:en,alt:"",className:`${g}-nav-logo-img`}),Zn?a.jsx("span",{className:`${g}-nav-logo-tint`,"aria-hidden":"true"}):null]}),Xt==="right"?Fr("right"):null]}):null,a.jsx("nav",{className:`${g}-nav-links ${g}-nav-links-${zt}`,style:{transform:C$(zt,D,t)},"aria-label":"Navigation",children:a.jsx("div",{className:`${g}-nav-links-inner`,children:Ql.filter(_t=>I$(_t,k,d)).map((_t,Yt)=>lg(_t,Yt))})})]})}),ag,a.jsxs("div",{className:`${g}-nav-toggle-wrap ${g}-nav-toggle-wrap-${Xo}`,children:[Xo==="left"?Fr("left"):null,Ct?a.jsx("div",{className:`${g}-root ${eg}`.trim(),style:mt,children:sg()}):null,Xo==="right"?Fr("right"):null]})]})}const rC=`import { Fragment, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type MouseEvent, type PointerEvent, type ReactNode } from 'react';
|
|
25157
25153
|
import { CommonComponentProps } from '../props';
|
|
25158
25154
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
|
|
25159
25155
|
import { useLightboxScrollLock } from '../utils/useLightboxScrollLock';
|
|
@@ -27795,7 +27791,7 @@ export function Burger({
|
|
|
27795
27791
|
);
|
|
27796
27792
|
}
|
|
27797
27793
|
`;function tr(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const ji={fontSettings:{type:"object",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function bi(e,t){return e?`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`:t}function Ul(e){return{[bi(e,"fontFamily")]:{type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},[bi(e,"fontSettings")]:{...ji.fontSettings,scope:"common",title:""},[bi(e,"fontSize")]:{...ji.fontSize,scope:"layout",title:""},[bi(e,"lineHeight")]:{...ji.lineHeight,scope:"layout",title:""},[bi(e,"letterSpacing")]:{...ji.letterSpacing,scope:"layout",title:""},[bi(e,"wordSpacing")]:{...ji.wordSpacing,scope:"layout",title:""},[bi(e,"textAlign")]:{...ji.textAlign,scope:"layout",title:""},[bi(e,"textAppearance")]:{...ji.textAppearance,scope:"layout",title:""}}}const aC=Ul(""),sC=Ul("open"),lC=Ul("compact"),cC=["__componentName__",{type:"row",items:["panelHeight","navTextWidth"]},{type:"row",title:"",items:["navTextPosition","navTextOffset"]},{type:"row",title:"Logo",items:["logoMaxHeight","logoPosition"]},{type:"row",title:"Hamburger",items:["iconSize","showIcon"]},"fontFamily","fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAlign","textAppearance","navGap","navPaddingLeft","navPaddingRight"],dC=["__componentName__",{type:"row",items:["compactPanelHeight","compactNavTextWidth"]},{type:"row",title:"",items:["compactNavTextPosition","compactNavTextOffset"]},{type:"row",title:"Logo",items:["compactLogoMaxHeight","compactLogoPosition"]},{type:"row",title:"Hamburger",items:["compactIconSize","compactShowIcon"]},"compactFontFamily","compactFontSettings",{type:"row",items:["compactFontSize","compactLineHeight","compactLetterSpacing","compactWordSpacing"]},"compactTextAlign","compactTextAppearance","compactNavGap","compactNavPaddingLeft","compactNavPaddingRight"],uC=["__componentName__",{type:"row",title:"Text",items:["textWidth","position"]},{type:"row",title:"Menu",items:["openPanelSize","effect"]},"openFontFamily","openFontSettings",{type:"row",items:["openFontSize","openLineHeight","openLetterSpacing","openWordSpacing"]},"openTextAlign","openTextAppearance"],ei={textTransform:"none",textDecoration:"none",fontVariant:"normal"},Ps={fontWeight:400,fontStyle:"normal"},ea={d:"Always",t:"Open Only",m:"Open Only"},pC=["left-top","center-top","right-top","left-center","center","right-center","left-bottom","center-bottom","right-bottom"],gC=["iconColor","logoColor","linkColor","backgroundColor"],mC={type:"object",version:1,settings:{sizing:"auto manual",properties:{link:{type:"array",scope:"common",display:{type:"page-url-link"},items:{type:"object",properties:{link:{type:"object",properties:{type:{type:"string",enum:["url","page","anchor"]},value:{type:"string",message:"Paste URL here..."},target:{type:"string",enum:["blank","self"]},anchor:{type:"string"}}},label:{type:"string"},showIn:{type:"string",scope:"layout",enum:["Always","Open Only","Open and Compact","Default and Open","Default and Compact"]}}}},logo:{type:"object",scope:"common",title:"Logo",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Logo",display:{type:"settings-image-input"}}}},logoMaxHeight:{type:"number",scope:"layout",title:"Max Height",display:{type:"numeric-input"},min:0,max:9999},logoPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},compactLogoPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},logoColor:{type:"string",scope:"common",title:"Logo Default",titleByState:{default:"Logo Default",hover:"Logo Hover"},display:{type:"palette-color-picker"}},panelHeight:{type:"number",scope:"layout",title:"Menu Height",display:{type:"numeric-input"},min:0,max:9999},backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{default:"Icon Default",hover:"Icon Hover"},display:{type:"palette-color-picker"}},showIcon:{type:"string",scope:"layout",title:"Show",display:{type:"toggle-cycle",enum:["on","off"]}},iconSize:{type:"number",scope:"layout",title:"Size",display:{type:"numeric-input"},min:0,max:9999},linkColor:{type:"string",scope:"common",title:"Text Default",titleByState:{default:"Text Default",hover:"Text Hover"},display:{type:"palette-color-picker"}},compactShowIcon:{type:"string",scope:"layout",title:"Show",display:{type:"toggle-cycle",enum:["on","off"]}},compactIconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{compact:"Icon Default","compact-hover":"Icon Hover"},display:{type:"palette-color-picker"}},compactLinkColor:{type:"string",scope:"common",title:"Text Default",titleByState:{compact:"Text Default","compact-hover":"Text Hover"},display:{type:"palette-color-picker"}},compactLogoColor:{type:"string",scope:"common",title:"Logo Default",titleByState:{compact:"Logo Default","compact-hover":"Logo Hover"},display:{type:"palette-color-picker"}},compactBackgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},openLinkColor:{type:"string",scope:"common",title:"Text Default",titleByState:{open:"Text Default","open-hover":"Text Hover"},display:{type:"palette-color-picker"}},openLogoColor:{type:"string",scope:"common",title:"Logo Default",titleByState:{open:"Logo Default","open-hover":"Logo Hover"},display:{type:"palette-color-picker"}},menuBackgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},overlayColor:{type:"string",scope:"common",title:"Overlay Default",display:{type:"palette-color-picker"}},closeButtonColor:{type:"string",scope:"common",title:"Close Default",titleByState:{open:"Close Default","open-hover":"Close Hover"},display:{type:"palette-color-picker"}},effect:{type:"string",scope:"layout",title:"Effect",display:{type:"toggle-cycle",enum:["fade","left","top","right","bottom"]}},openPanelSize:{type:"number",scope:"layout",title:"Height",display:{type:"percentage-input"},min:0,max:100},textWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},navTextWidth:{type:"number",scope:"layout",title:"Text width",display:{type:"numeric-input"},min:0,max:9999},navTextPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},navTextOffset:{type:"number",scope:"layout",title:"Offset",display:{type:"numeric-input"},min:-9999,max:9999},position:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:[...pC]}},stateOverrides:{type:"object",scope:"common"},gap:tr("Gap"),navGap:{type:"number",scope:"layout",title:"Nav gap",min:0,max:100,display:{type:"range-control",visible:!1}},navPaddingLeft:{type:"number",scope:"layout",title:"Nav padding left",min:0,max:100,display:{type:"range-control",visible:!1}},navPaddingRight:{type:"number",scope:"layout",title:"Nav padding right",min:0,max:100,display:{type:"range-control",visible:!1}},textPaddingLeft:tr("Text padding left"),textPaddingRight:tr("Text padding right"),textPaddingTop:tr("Text padding top"),textPaddingBottom:tr("Text padding bottom"),compactLogoMaxHeight:{type:"number",scope:"layout",title:"Max Height",display:{type:"numeric-input"},min:0,max:9999},compactPanelHeight:{type:"number",scope:"layout",title:"Menu Height",display:{type:"numeric-input"},min:0,max:9999},compactIconSize:{type:"number",scope:"layout",title:"Size",display:{type:"numeric-input"},min:0,max:9999},compactNavTextWidth:{type:"number",scope:"layout",title:"Text width",display:{type:"numeric-input"},min:0,max:9999},compactNavTextPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},compactNavTextOffset:{type:"number",scope:"layout",title:"Offset",display:{type:"numeric-input"},min:-9999,max:9999},compactNavGap:{type:"number",scope:"layout",title:"Nav gap",min:0,max:100,display:{type:"range-control",visible:!1}},compactNavPaddingLeft:{type:"number",scope:"layout",title:"Nav padding left",min:0,max:100,display:{type:"range-control",visible:!1}},compactNavPaddingRight:{type:"number",scope:"layout",title:"Nav padding right",min:0,max:100,display:{type:"range-control",visible:!1}},...aC,...sC,...lC},defaults:{link:[{link:{type:"page",value:"",target:"self"},label:"Home",showIn:ea},{link:{type:"page",value:"",target:"self"},label:"Works",showIn:ea},{link:{type:"page",value:"",target:"self"},label:"About",showIn:ea},{link:{type:"page",value:"",target:"self"},label:"Contact",showIn:ea}],logo:{mode:"On",icon:"01M3QM74XE09DSJCWGD1XM6Y45"},backgroundColor:"#ffffff",logoColor:"#000000",iconColor:"#000000",linkColor:"#000000",openLinkColor:"#000000",compactIconColor:"#000000",compactLinkColor:"#000000",compactLogoColor:"#000000",compactBackgroundColor:"#ffffff",openLogoColor:"#000000",menuBackgroundColor:"#ffffff",overlayColor:"rgba(0, 0, 0, 0.45)",closeButtonColor:"#000000",effect:"fade",showIcon:"on",compactShowIcon:"on",logoPosition:"left",compactLogoPosition:"left",navTextPosition:"center",compactNavTextPosition:"center",navTextOffset:0,compactNavTextOffset:0,position:"left-top",fontFamily:"Goudy Bookletter 1911",fontSettings:Ps,textAlign:"left",openFontFamily:"Goudy Bookletter 1911",openFontSettings:Ps,openTextAlign:"left",compactFontFamily:"Goudy Bookletter 1911",compactFontSettings:Ps,compactTextAlign:"left",stateOverrides:{hover:{linkColor:"#666666",iconColor:"#666666",logoColor:"#666666"},"open-hover":{closeButtonColor:"#666666"}}},displayRules:[{if:{name:"logo.mode",value:"Off"},then:{name:"properties.logoMaxHeight.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.logoPosition.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.compactLogoMaxHeight.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.compactLogoPosition.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.logoColor.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.compactLogoColor.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.openLogoColor.display.visible",value:!1}},{if:{name:"effect",value:"left"},then:{name:"properties.openPanelSize.title",value:"Width"}},{if:{name:"effect",value:"right"},then:{name:"properties.openPanelSize.title",value:"Width"}},{if:{name:"showIcon",value:"off"},then:{name:"properties.iconSize.display.visible",value:!1}},{if:{name:"showIcon",value:"off"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"compactShowIcon",value:"off"},then:{name:"properties.compactIconSize.display.visible",value:!1}},{if:{name:"compactShowIcon",value:"off"},then:{name:"properties.compactIconColor.display.visible",value:!1}}],layoutDefaults:{m:{position:"center",panelHeight:50/375,logoMaxHeight:30/375,logoPosition:"center",compactLogoPosition:"left",navTextPosition:"center",navTextOffset:0,compactNavTextPosition:"center",compactNavTextOffset:0,showIcon:"on",iconSize:30/375,textWidth:240/375,openPanelSize:100,navTextWidth:120/375,gap:24/375,navGap:24/375,navPaddingLeft:20/375,navPaddingRight:20/375,textPaddingLeft:10/375,textPaddingRight:10/375,textPaddingTop:10/375,textPaddingBottom:10/375,fontSize:16/375,lineHeight:20/375,letterSpacing:0,wordSpacing:0,textAppearance:ei,openFontSize:34/375,openLineHeight:20/375,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:ei,openTextAlign:"center",compactPanelHeight:40/375,compactLogoMaxHeight:20/375,compactShowIcon:"on",compactIconSize:16/375,compactNavTextWidth:80/375,compactNavGap:24/375,compactNavPaddingLeft:20/375,compactNavPaddingRight:20/375,compactFontSize:16/375,compactLineHeight:20/375,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:ei},t:{textAlign:"center",position:"center",panelHeight:60/768,logoMaxHeight:30/768,logoPosition:"left",compactLogoPosition:"left",navTextPosition:"center",navTextOffset:0,compactNavTextPosition:"center",compactNavTextOffset:0,showIcon:"on",iconSize:16/768,textWidth:300/768,openPanelSize:100,navTextWidth:90/768,gap:32/768,navGap:32/768,navPaddingLeft:20/768,navPaddingRight:20/768,textPaddingLeft:10/768,textPaddingRight:10/768,textPaddingTop:10/768,textPaddingBottom:10/768,fontSize:18/768,lineHeight:20/768,letterSpacing:0,wordSpacing:0,textAppearance:ei,openFontSize:75/768,openLineHeight:20/768,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:ei,openTextAlign:"center",compactTextAlign:"center",compactPanelHeight:40/768,compactLogoMaxHeight:20/768,compactShowIcon:"on",compactIconSize:16/768,compactNavTextWidth:80/768,compactNavGap:32/768,compactNavPaddingLeft:20/768,compactNavPaddingRight:20/768,compactFontSize:16/768,compactLineHeight:20/768,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:ei},d:{position:"center",panelHeight:50/1440,logoMaxHeight:30/1440,logoPosition:"left",compactLogoPosition:"left",navTextPosition:"center",navTextOffset:0,compactNavTextPosition:"center",compactNavTextOffset:0,showIcon:"on",iconSize:20/1440,textWidth:300/1440,openPanelSize:100,navTextWidth:60/1440,gap:12/1440,navGap:64/1440,navPaddingLeft:10/1440,navPaddingRight:10/1440,textPaddingLeft:10/1440,textPaddingRight:10/1440,textPaddingTop:10/1440,textPaddingBottom:10/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:ei,textAlign:"center",openFontSize:90/1440,openLineHeight:16/1440,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:ei,openTextAlign:"center",compactPanelHeight:30/1440,compactLogoMaxHeight:20/1440,compactShowIcon:"on",compactIconSize:20/1440,compactNavTextWidth:60/1440,compactNavGap:20/1440,compactNavPaddingLeft:10/1440,compactNavPaddingRight:10/1440,compactFontSize:16/1440,compactLineHeight:16/1440,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:ei,compactTextAlign:"center"}},layout:["__componentName__","link","logo","logoMaxHeight","logoPosition","panelHeight","backgroundColor","logoColor","iconColor","showIcon","iconSize","linkColor","openLinkColor","compactShowIcon","compactIconColor","compactLinkColor","compactLogoColor","compactBackgroundColor","compactLogoMaxHeight","compactLogoPosition","compactPanelHeight","compactIconSize","compactNavTextWidth","compactNavTextPosition","compactNavTextOffset","compactNavGap","compactNavPaddingLeft","compactNavPaddingRight","compactFontFamily","compactFontSettings","compactFontSize","compactLineHeight","compactLetterSpacing","compactWordSpacing","compactTextAlign","compactTextAppearance","openLogoColor","menuBackgroundColor","overlayColor","closeButtonColor","effect","textWidth","navTextWidth","navTextPosition","navTextOffset","position","gap","navGap","navPaddingLeft","navPaddingRight","textPaddingLeft","textPaddingRight","textPaddingTop","textPaddingBottom","fontFamily","fontSettings","fontSize","lineHeight","letterSpacing","wordSpacing","textAlign","textAppearance","openFontFamily","openFontSettings","openFontSize","openLineHeight","openLetterSpacing","openWordSpacing","openTextAlign","openTextAppearance"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","logo"]},{id:"default",icon:"default",title:"Default",tooltip:"Default State",layout:cC},{id:"compact",icon:"compact",title:"Compact",tooltip:"Compact State",layout:dC,availableWhen:{navigationPosition:["switch"]}},{id:"open",icon:"open",title:"Open",tooltip:"Open State",layout:uC},{id:"links",icon:"content",title:"Links",tooltip:"Link Settings",layout:["__componentName__","link"]}],paletteBookmark:{items:[...gC],panelIds:["default","compact","open"],stateItems:{default:["iconColor","logoColor","linkColor","backgroundColor"],hover:["iconColor","logoColor","linkColor"],compact:["compactIconColor","compactLogoColor","compactLinkColor","compactBackgroundColor"],"compact-hover":["compactIconColor","compactLogoColor","compactLinkColor"],open:["closeButtonColor","openLogoColor","openLinkColor","menuBackgroundColor","overlayColor"],"open-hover":["closeButtonColor","openLogoColor","openLinkColor"]}},states:["default","hover"],statePanels:["default","compact","open"]},hC={element:oC,id:"basic-burger",name:"Basic Burger",category:"navigation",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple Burger.png"},layoutMode:"navigation",defaultSize:{d:{width:"100%",height:60/1440},t:{width:"100%",height:60/768},m:{width:"100%",height:56/375}},defaultNavigationPosition:{d:"switch",t:"switch",m:"stickyTop"},schema:mC,sourceCode:rC,assetsPaths:{content:[],parameters:[{path:"logo.icon",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"},{path:"openFontFamily"},{path:"compactFontFamily"}]},fontRelations:{fontSettings:"fontFamily",openFontSettings:"openFontFamily",compactFontSettings:"compactFontFamily"}},Wd=120,Od=3,fC=.12,ql={x:0,y:0,width:100,height:100};function Co(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}function Ia(e){return e<0?0:e>1?1:e}function Dd(e,t){return e.filter(n=>n.length>0).map(n=>`M ${n.map(i=>`${i.x*t.width} ${i.y*t.height}`).join(" L ")} Z`).join(" ")}function yC(e,t){let n=1/0,i=1/0,o=-1/0,r=-1/0;for(const d of e)for(const u of d){const p=u.x*t.width,y=u.y*t.height;p<n&&(n=p),p>o&&(o=p),y<i&&(i=y),y>r&&(r=y)}const l=o-n,c=r-i;return!isFinite(l)||!isFinite(c)||l<=0||c<=0?null:{x:n,y:i,width:l,height:c}}function vC(e){return e.map(([t,n])=>({x:t,y:n}))}function Ms(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const c of e)for(const d of c)d.x<t&&(t=d.x),d.x>i&&(i=d.x),d.y<n&&(n=d.y),d.y>o&&(o=d.y);const r=i-t,l=o-n;return!isFinite(r)||!isFinite(l)||r<=0||l<=0?e:e.map(c=>c.map(d=>({x:(d.x-t)/r,y:(d.y-n)/l})))}function xC(e,t){const n=[];for(const o of e)for(let r=0;r<o.length;r+=1){const l=o[r],c=o[(r+1)%o.length];(l.y<=t&&c.y>t||c.y<=t&&l.y>t)&&n.push(l.x+(t-l.y)/(c.y-l.y)*(c.x-l.x))}n.sort((o,r)=>o-r);const i=[];for(let o=0;o+1<n.length;o+=2){const r=Ia(n[o]),l=Ia(n[o+1]);l>r&&i.push({x0:r,x1:l})}return bC(i)}function bC(e){if(e.length<2)return e;const t=[...e].sort((i,o)=>i.x0-o.x0),n=[t[0]];for(let i=1;i<t.length;i+=1){const o=n[n.length-1],r=t[i];r.x0<=o.x1?o.x1=Math.max(o.x1,r.x1):n.push({...r})}return n}function SC(e,t){const n=[];let i=0,o=0;for(;i<e.length&&o<t.length;){const r=Math.max(e[i].x0,t[o].x0),l=Math.min(e[i].x1,t[o].x1);l>r&&n.push({x0:r,x1:l}),e[i].x1<t[o].x1?i+=1:o+=1}return n}function wC(e){const t=[];let n=0;for(const i of e)i.x0>n&&t.push({x0:n,x1:i.x0}),n=Math.max(n,i.x1);return n<1&&t.push({x0:n,x1:1}),t}function $C(e,t){const n=[];for(const i of e){if(t.x1<=i.x0||t.x0>=i.x1){n.push(i);continue}t.x0>i.x0&&n.push({x0:i.x0,x1:t.x0}),t.x1<i.x1&&n.push({x0:t.x1,x1:i.x1})}return n}function CC(e,t,n,i){let o=null;for(let r=0;r<Od;r+=1){const l=Ia(t+(n-t)*r/Math.max(1,Od-1)),c=xC(e,l),d=i==="avoid"?wC(c):c;if(o=o===null?d:SC(o,d),o.length===0)return[]}return o??[]}function zd(e,t="stretch",n=ql){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=ki(i),c=$r(l);if(c.length)return t==="viewbox"?Co(c,n):Ms(c);if(typeof document>"u")return null;const d=i.split(/(?=[Mm])/).map(y=>y.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const y of d){const x=document.createElementNS("http://www.w3.org/2000/svg","path");x.setAttribute("d",y),u.appendChild(x);let g=0;try{g=x.getTotalLength()}catch{g=0}if(!g)continue;const h=[];for(let b=0;b<Wd;b+=1){const S=x.getPointAtLength(b/Wd*g);h.push({x:S.x,y:S.y})}p.push(h)}return p.length?t==="viewbox"?Co(p,n):Ms(p):null}const o=i.split(/[\s,]+/).map(Number).filter(l=>!Number.isNaN(l));if(o.length<6)return null;const r=[];for(let l=0;l+1<o.length;l+=2)r.push({x:o[l],y:o[l+1]});return t==="viewbox"?Co([r],n):Ms([r])}const Yl={bobbin:"M57.63,0 L57.63,37.24 L74.66,37.24 L74.66,56.07 L57.63,100 L33.84,100 L16.81,56.07 L16.81,37.24 L33.84,37.24 L33.84,0 Z",circle:"M50,0 C77.61,0 100,22.39 100,50 C100,77.61 77.61,100 50,100 C22.39,100 0,77.61 0,50 C0,22.39 22.39,0 50,0 Z",shield:"M0,0 L100,0 L100,50 L50,100 L0,50 Z",vase:"M25.37,0 L91.55,0 C91.55,0 74.8,25.14 83.07,50.03 C91.34,74.92 74.61,100 74.61,100 L8.43,100 C8.43,100 32.3,75.08 23.9,50 C15.5,24.92 25.37,0 25.37,0 Z",parallelogram:"M25.37,0 L91.55,0 L74.61,100 L8.43,100 Z",diamond:"M50,0 L80,50 L50,100 L20,50 Z"},Zs="0 0 100 100",La=100,Js=16,TC=12,IC=16,Rs=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,LC=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g,Bd=Math.PI/4,PC=8,MC=Math.PI/18,RC=8,yo=24,vo=[];function EC(){return[{closed:!0,nodes:[{p:{x:0,y:0},in:null,out:null},{p:{x:1,y:0},in:null,out:null},{p:{x:1,y:1},in:null,out:null},{p:{x:0,y:1},in:null,out:null}]}]}function Es(e,t){return un(e,n=>({x:(n.x-t.x)/t.width,y:(n.y-t.y)/t.height}))}function kC(e){const t=Li(e),n=t.maxX-t.minX,i=t.maxY-t.minY;return!isFinite(n)||!isFinite(i)||n<=0||i<=0?e:un(e,o=>({x:(o.x-t.minX)/n,y:(o.y-t.minY)/i}))}function AC(e,t){if(!(t.width>0)||!(t.height>0))return e;const n=Math.min(t.width,t.height),i=(t.width-n)/2,o=(t.height-n)/2;return un(e,r=>({x:(i+r.x*n)/t.width,y:(o+r.y*n)/t.height}))}function jd(e,t,n,i,o,r){let l=[];if(t&&t.length)l=Es(t,i);else{const c=e.trim();if(c&&/^[Mm]/.test(c)){const d=ki(c);d.length&&(l=n==="viewbox"?Es(d,i):kC(d))}if(!l.length){const d=o!=="custom"?Yl[o]:void 0;d?l=Es(ki(d),ql):l=EC()}}return o==="circle"?AC(l,r):l}function Vd(e,t){return!(t.width>0)||!(t.height>0)||!e.length?"":Wo(un(e,n=>({x:n.x*t.width,y:n.y*t.height})))}function el(e){const t=e==="rectangle"||e==="custom"?void 0:Yl[e];return t?Co($r(ki(t)),ql):[vC([[0,0],[1,0],[1,1],[0,1]])]}function FC(e){const t=e.match(LC);return t?t.map(Number).filter(n=>!Number.isNaN(n)):[]}function In(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function tl(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function mn(e){return{x:e.x,y:e.y}}function NC(e){return{p:mn(e.p),in:e.in?mn(e.in):null,out:e.out?mn(e.out):null}}function Vn(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(NC)}))}function un(e,t){return e.map(n=>({closed:n.closed,nodes:n.nodes.map(i=>({p:t(i.p),in:i.in?t(i.in):null,out:i.out?t(i.out):null}))}))}function Gd(e,t,n,i=n){return un(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function _C(e,t,n,i,o,r,l){let c=Math.abs(t),d=Math.abs(n);if(!c||!d||e.x===l.x&&e.y===l.y)return[{c1:mn(e),c2:mn(l),p:mn(l)}];const u=i*Math.PI/180,p=Math.cos(u),y=Math.sin(u),x=(e.x-l.x)/2,g=(e.y-l.y)/2,h=p*x+y*g,b=-y*x+p*g,S=h*h/(c*c)+b*b/(d*d);if(S>1){const U=Math.sqrt(S);c*=U,d*=U}const _=o===r?-1:1,v=c*c*b*b+d*d*h*h,L=Math.max(0,c*c*d*d-v),P=v===0?0:_*Math.sqrt(L/v),q=P*c*b/d,X=-P*d*h/c,B=p*q-y*X+(e.x+l.x)/2,H=y*q+p*X+(e.y+l.y)/2,O=Math.atan2((b-X)/d,(h-q)/c);let $=Math.atan2((-b-X)/d,(-h-q)/c)-O;!r&&$>0&&($-=Math.PI*2),r&&$<0&&($+=Math.PI*2);const Q=Math.max(1,Math.ceil(Math.abs($)/(Math.PI/2))),R=$/Q,T=4/3*Math.tan(R/4),w=(U,M)=>({x:B+p*c*U-y*d*M,y:H+y*c*U+p*d*M}),V=[];let z=O;for(let U=0;U<Q;U+=1){const M=z+R,f=Math.cos(z),K=Math.sin(z),G=Math.cos(M),ge=Math.sin(M);V.push({c1:w(f-T*K,K+T*f),c2:w(G+T*ge,ge-T*G),p:U===Q-1?mn(l):w(G,ge)}),z=M}return V}function ki(e){const t=(e??"").trim();if(!t)return[];const n=[];let i=[],o=!1,r={x:0,y:0},l={x:0,y:0},c=null,d=null;const u=()=>{if(o&&i.length>2){const g=i[0],h=i[i.length-1];Math.abs(g.p.x-h.p.x)<1e-6&&Math.abs(g.p.y-h.p.y)<1e-6&&(g.in=h.in??g.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(g,h)=>{i.push({p:g,in:Un(h??null,g),out:null}),r=g},y=g=>{if(!i.length)return;const h=i[i.length-1];h.out=Un(g,h.p)};Rs.lastIndex=0;let x=Rs.exec(t);for(;x!==null;){const g=x[1],h=g.toUpperCase(),b=g!==h,S=FC(x[2]),_=v=>b?{x:r.x+S[v],y:r.y+S[v+1]}:{x:S[v],y:S[v+1]};if(h==="Z")o=!0,u(),r=mn(l),c=null,d=null;else if(h==="M"){for(let v=0;v+1<S.length;v+=2){const L=_(v);v===0&&(u(),l=mn(L)),p(L)}c=null,d=null}else if(h==="L"){for(let v=0;v+1<S.length;v+=2)p(_(v));c=null,d=null}else if(h==="H"){for(const v of S)p({x:b?r.x+v:v,y:r.y});c=null,d=null}else if(h==="V"){for(const v of S)p({x:r.x,y:b?r.y+v:v});c=null,d=null}else if(h==="C"){for(let v=0;v+5<S.length;v+=6){const L=_(v),P=_(v+2),q=_(v+4);y(L),p(q,P),c=P}d=null}else if(h==="S"){for(let v=0;v+3<S.length;v+=4){const L=c?tl(c,r):mn(r),P=_(v),q=_(v+2);y(L),p(q,P),c=P}d=null}else if(h==="Q")for(let v=0;v+3<S.length;v+=4){const L=_(v),P=_(v+2);y(In(r,L,2/3)),p(P,In(P,L,2/3)),d=L,c=null}else if(h==="T")for(let v=0;v+1<S.length;v+=2){const L=d?tl(d,r):mn(r),P=_(v);y(In(r,L,2/3)),p(P,In(P,L,2/3)),d=L,c=null}else if(h==="A")for(let v=0;v+6<S.length;v+=7){const L=b?{x:r.x+S[v+5],y:r.y+S[v+6]}:{x:S[v+5],y:S[v+6]};for(const P of _C(r,S[v],S[v+1],S[v+2],S[v+3]!==0,S[v+4]!==0,L))y(P.c1),p(P.p,P.c2);c=null,d=null}x=Rs.exec(t)}return u(),n}function Bn(e){return`${Number(e.toFixed(2))}`}function Un(e,t){return!e||Math.abs(e.x-t.x)<1e-6&&Math.abs(e.y-t.y)<1e-6?null:e}function Bp(e){return!!(Un(e.in,e.p)||Un(e.out,e.p))}function Go(e,t){return!Un(e.out,e.p)&&!Un(t.in,t.p)}function Xd(e,t){if(Go(e,t))return`L${Bn(t.p.x)},${Bn(t.p.y)}`;const n=Un(e.out,e.p)??e.p,i=Un(t.in,t.p)??t.p;return`C${Bn(n.x)},${Bn(n.y)} ${Bn(i.x)},${Bn(i.y)} ${Bn(t.p.x)},${Bn(t.p.y)}`}function Wo(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const[i,...o]=n.nodes;t.push(`M${Bn(i.p.x)},${Bn(i.p.y)}`);let r=i;for(const l of o)t.push(Xd(r,l)),r=l;if(n.closed){const l=Xd(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function jp(e){const t=[];for(let n=0;n+1<e.nodes.length;n+=1)t.push({from:e.nodes[n],to:e.nodes[n+1],index:n});if(e.closed&&e.nodes.length>2){const n=e.nodes.length-1;t.push({from:e.nodes[n],to:e.nodes[0],index:n})}return t}function nl(e,t,n){if(Go(e,t))return In(e.p,t.p,n);const i=e.out??e.p,o=t.in??t.p,r=1-n,l=r*r*r,c=3*r*r*n,d=3*r*n*n,u=n*n*n;return{x:l*e.p.x+c*i.x+d*o.x+u*t.p.x,y:l*e.p.y+c*i.y+d*o.y+u*t.p.y}}function $r(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of jp(n)){if(Go(o.from,o.to)){i.push(mn(o.from.p));continue}for(let r=0;r<Js;r+=1)i.push(nl(o.from,o.to,r/Js))}n.closed||i.push(mn(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function Li(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of $r(e))for(const l of r)l.x<t&&(t=l.x),l.x>i&&(i=l.x),l.y<n&&(n=l.y),l.y>o&&(o=l.y);return{minX:t,minY:n,maxX:i,maxY:o}}function HC(e){const t=Li(e);return!isFinite(t.minX)||!isFinite(t.maxX)||!isFinite(t.minY)||!isFinite(t.maxY)?null:{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}}function Vp(e,t,n){const i={x:(n.x-e.x)/6,y:(n.y-e.y)/6};return{in:{x:t.x-i.x,y:t.y-i.y},out:{x:t.x+i.x,y:t.y+i.y}}}function Gp(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=TC)return{closed:!0,nodes:t.map(r=>({p:mn(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/IC)),i=[];for(let r=0;r<t.length;r+=n)i.push(t[r]);const o=i.length;return{closed:!0,nodes:i.map((r,l)=>({p:mn(r),...Vp(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function Xp(e,t,n=1){if(!e.length)return!1;const i=Li(e);if(!isFinite(i.minX)||!isFinite(i.maxX))return!1;const o=i.maxX-i.minX,r=i.maxY-i.minY;if(o<=t.width*2.5&&r<=t.height*2.5)return!1;const l=Math.max(n,t.width*.5),c=Math.max(n,t.height*.5);return i.minX<t.x-l||i.minY<t.y-c||i.maxX>t.x+t.width+l||i.maxY>t.y+t.height+c}function WC(e,t,n,i,o,r,l){const c=t.width>0?n.width/t.width:1,d=t.height>0?n.height/t.height:1;return!(r>0)||!(l>0)||!(c>0)||!(d>0)?e:un(e,u=>{const p=i+(u.x-t.x)*r,y=o+(u.y-t.y)*l;return{x:t.x+p/c,y:t.y+y/d}})}function OC(e,t){if(!e.length)return e;const n=Li(e),i=n.maxX-n.minX,o=n.maxY-n.minY;if(!(i>0)||!(o>0)||n.minX>=t.x-1e-6&&n.minY>=t.y-1e-6&&n.maxX<=t.x+t.width+1e-6&&n.maxY<=t.y+t.height+1e-6)return e;const l=Math.min(t.width/i,t.height/o),c=t.x+(t.width-i*l)/2,d=t.y+(t.height-o*l)/2;return un(e,u=>({x:c+(u.x-n.minX)*l,y:d+(u.y-n.minY)*l}))}function Up(e){const t={x:0,y:0,width:La,height:La},n=e!=="custom"?Yl[e]:void 0,i=n?un(ki(n),r=>({x:r.x/100*t.width+t.x,y:r.y/100*t.height+t.y})):un(Gp(el("rectangle")),r=>({x:r.x*t.width+t.x,y:r.y*t.height+t.y})),o=OC(i,t);return{shape:e,customPath:Wo(o),pathFit:"viewbox",pathViewBox:Zs}}function ta(e,t){return t>0?Math.round(e/t)*t:e}function DC(e,t,n,i){var u;const o=(u=e[t])==null?void 0:u.nodes[n];if(!o)return e;const r=i.x-o.p.x,l=i.y-o.p.y,c=Vn(e),d=c[t].nodes[n];return d.p={x:o.p.x+r,y:o.p.y+l},d.in&&(d.in={x:d.in.x+r,y:d.in.y+l}),d.out&&(d.out={x:d.out.x+r,y:d.out.y+l}),c}function Ud(e,t,n,i){var r;if(!t.length)return e;const o=Vn(e);for(const{contour:l,node:c}of t){const d=(r=o[l])==null?void 0:r.nodes[c];d&&(d.p={x:d.p.x+n,y:d.p.y+i},d.in&&(d.in={x:d.in.x+n,y:d.in.y+i}),d.out&&(d.out={x:d.out.x+n,y:d.out.y+i}))}return o}function zC(e,t){const n=new Map;for(const{contour:o,node:r}of t){const l=n.get(o)??[];l.push(r),n.set(o,l)}let i=e;return n.forEach((o,r)=>{const l=[...o].sort((c,d)=>d-c);for(const c of l)i=qp(i,r,c)}),i}function BC(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const c=Vn(e),d=c[t].nodes[n];if(d[i]=mn(o),r){const p=i==="in"?"out":"in";d[p]=tl(o,d.p)}return c}function jC(e,t,n,i){var l;const o=(l=e[t])==null?void 0:l.nodes[n];if(!o||!o[i])return e;const r=Vn(e);return r[t].nodes[n][i]=null,r}function VC(e,t,n,i){const o=e[t];if(!o)return{contours:e,nodeIndex:-1};const r=o.nodes[n],l=o.nodes[(n+1)%o.nodes.length];if(!r||!l)return{contours:e,nodeIndex:-1};const c=Vn(e),d=c[t].nodes,u=n+1;if(Go(r,l))return d.splice(u,0,{p:In(r.p,l.p,i),in:null,out:null}),{contours:c,nodeIndex:u};const p=r.out??r.p,y=l.in??l.p,x=In(r.p,p,i),g=In(p,y,i),h=In(y,l.p,i),b=In(x,g,i),S=In(g,h,i),_=In(b,S,i),v=(n+1)%o.nodes.length;return d[n].out=x,d[v].in=h,d.splice(u,0,{p:_,in:b,out:S}),{contours:c,nodeIndex:u}}function qp(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=Vn(e);return o[t].nodes.splice(n,1),o}function qd(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=Vn(e),l=r[t].nodes,c=l[n],d=l.length,u=(n-1+d)%d,p=(n+1)%d,y=!!Un(l[u].out,l[u].p),x=!!Un(l[p].in,l[p].p);if(Bp(c)||y||x)return c.in=null,c.out=null,l[u].out=null,l[p].in=null,r;const g=Vp(l[u].p,c.p,l[p].p);return c.in=g.in,c.out=g.out,r}function GC(e,t,n){const i=n.x-t.x,o=n.y-t.y,r=i*i+o*o,l=r===0?0:Math.max(0,Math.min(1,((e.x-t.x)*i+(e.y-t.y)*o)/r)),c={x:t.x+i*l,y:t.y+o*l};return{t:l,distance:Math.hypot(e.x-c.x,e.y-c.y),point:c}}function Yd(e,t){let n=null;return e.forEach((i,o)=>{for(const r of jp(i)){const l=Go(r.from,r.to)?1:Js;for(let c=0;c<l;c+=1){const d=c/l,u=(c+1)/l,p=GC(t,nl(r.from,r.to,d),nl(r.from,r.to,u));(!n||p.distance<n.distance)&&(n={contour:o,segment:r.index,t:d+(u-d)*p.t,distance:p.distance,point:p.point})}}}),n}function XC(e,t){const n=[];return e.forEach((i,o)=>{i.nodes.forEach((r,l)=>{o===t.contour&&l===t.node||n.push(r.p)})}),n}function Kd(e,t,n){const i=t.filter((r,l)=>isFinite(r)&&t.findIndex(c=>Math.abs(c-r)<1e-6)===l),o=i.map(r=>({value:r,axis:r,from:null}));for(const r of e)o.push({value:r[n],axis:null,from:r});for(const r of i)for(const l of e)o.push({value:r*2-l[n],axis:r,from:l});return o}function Qd(e,t,n,i,o){const r=i(t)[n];let l=null,c=1/0;for(const d of e){const u=n==="x"?{x:d.value,y:t.y}:{x:t.x,y:d.value},p=Math.abs(i(u)[n]-r);p>o||l&&p>=c||(l=d,c=p)}return l}function UC(e,t){return e.length===t.length&&e.every((n,i)=>n.kind===t[i].kind&&n.a.x===t[i].a.x&&n.a.y===t[i].a.y&&n.b.x===t[i].b.x&&n.b.y===t[i].b.y)}function qC(e){const t=Math.PI*2;return((e+Math.PI)%t+t)%t-Math.PI}function il(e,t){const n=t.x-e.x,i=t.y-e.y,o=Math.hypot(n,i);return o<1e-6?null:{x:n/o,y:i/o}}function YC(e,t){const n=il(e,t);return n?{kind:"align",a:{x:e.x-n.x*yo,y:e.y-n.y*yo},b:{x:t.x+n.x*yo,y:t.y+n.y*yo}}:{kind:"align",a:e,b:t}}function ol(e,t,n){return t==="x"?{kind:"center",a:{x:e,y:0},b:{x:e,y:n.height}}:{kind:"center",a:{x:0,y:e},b:{x:n.width,y:e}}}function Zd(e,t,n,i,o){if(e.axis===null)return YC(n,o(e.from??n));const r=t==="x"?{x:e.axis,y:0}:{x:0,y:e.axis};return ol(o(r)[t],t,i)}function KC(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(Zd(t,"x",l,i,o)),n&&e.y===n.value&&r.push(Zd(n,"y",l,i,o)),r}function QC(e,t,n,i){const o=e==null?void 0:e.nodes[t];if(!e||!o)return null;const r=i(o.p),l=n==="in"?o.out:o.in;if(l)return il(i(l),r);const c=e.nodes.length,d=t+(n==="in"?1:-1);if(!e.closed&&(d<0||d>=c))return null;const u=e.nodes[(d+c)%c];if(!u)return null;const p=(n==="in"?u.in:u.out)??u.p;return il(i(p),r)}function ZC(e,t,n,i,o,r,l){const c=r(t),d=r(e),u=d.x-c.x,p=d.y-c.y,y=Math.hypot(u,p);if(y<1e-6)return{point:e,guides:vo};const x=Math.atan2(p,u),g=Math.round(x/Bd)*Bd;let h=o?g:null,b=!1;if(!o){const X=[];n&&X.push({angle:Math.atan2(n.y,n.x),smooth:!0}),X.push({angle:g,smooth:!1});for(const B of X){const H=qC(B.angle-x);if(!(Math.abs(H)>MC)&&!(Math.abs(Math.sin(H))*y>PC)){h=B.angle,b=B.smooth;break}}}const S=i!==null&&i>0&&Math.abs(y-i)<=RC;if(h===null&&!S)return{point:e,guides:vo};const _=h??x,v=S?i:y,L={x:Math.cos(_),y:Math.sin(_)},P=v+(h===null?0:yo),q=S?v:b?yo:0;return{point:l({x:c.x+L.x*v,y:c.y+L.y*v}),guides:[{kind:"angle",a:{x:c.x-L.x*q,y:c.y-L.y*q},b:{x:c.x+L.x*P,y:c.y+L.y*P}}]}}const rl=.1,al=8,JC=4,Jd=10,Pa=(e,t)=>{switch(t){case"nw":return{x:e.minX,y:e.minY};case"ne":return{x:e.maxX,y:e.minY};case"se":return{x:e.maxX,y:e.maxY};case"sw":return{x:e.minX,y:e.maxY}}},Yp=e=>{switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}},sl=(e,t)=>{const n=Pa(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*Jd,y:n.y+o*Jd}},ll=(e,t)=>!(t.width>0)||!(t.height>0)||!(e.width>0)||!(e.height>0)?1:Math.max(e.width/t.width,e.height/t.height),Ui=(e,t,n)=>{const i=ll(e,t)*n;return{width:t.width*i,height:t.height*i}},jn=(e,t,n)=>(e-t)*n,xo=(e,t,n,i)=>{const o=e-t;if(Math.abs(o)<1e-6)return .5;const r=n/o;return(i==null?void 0:i.clamp)===!1?r:Math.abs(o)<JC?.5:Ia(r)},eT=(e,t,n,i,o,r)=>{const l=Ui(e,n,r),c=e.x+jn(e.width,l.width,i),d=e.y+jn(e.height,l.height,o),u=ll(e,n),p=ll(t,n),y=Math.min(al,Math.max(rl,p>0?r*(u/p):r)),x=Ui(t,n,y);return{focalX:xo(t.width,x.width,c-t.x,{clamp:!1}),focalY:xo(t.height,x.height,d-t.y,{clamp:!1}),scale:y}},tT=6,nT=3,iT=2,ks="",oT=new RegExp("\\p{L}","gu"),eu=20,rT={arb:"ar",azj:"az",bel:"be",bos:"bs",bul:"bg",ces:"cs",deu:"de",eng:"en",fas:"fa",fra:"fr",hau:"ha",hin:"hi",hrv:"hr",hun:"hu",ibo:"ig",ind:"id",ita:"it",jav:"jv",kaz:"kk",kin:"rw",lin:"ln",mar:"mr",nep:"ne",nld:"nl",nya:"ny",pol:"pl",por:"pt",ron:"ro",run:"rn",rus:"ru",som:"so",spa:"es",srp:"sr",sun:"su",swe:"sv",swh:"sw",tgl:"tl",tur:"tr",ukr:"uk",urd:"ur",uzn:"uz",vie:"vi",yor:"yo",zlm:"ms",zul:"zu"},cl={be:()=>Promise.resolve().then(()=>require("./index-B1vNL0m-.js")).then(e=>e.index),bg:()=>Promise.resolve().then(()=>require("./index-kFrlcZxC.js")).then(e=>e.index),cs:()=>Promise.resolve().then(()=>require("./index-B6E31HBG.js")).then(e=>e.index),de:()=>Promise.resolve().then(()=>require("./index-CNFsG2yO.js")).then(e=>e.index),en:()=>Promise.resolve().then(()=>require("./index-x_p4zv7D.js")).then(e=>e.index),"en-gb":()=>Promise.resolve().then(()=>require("./index-BkmSPu6z.js")).then(e=>e.index),es:()=>Promise.resolve().then(()=>require("./index-CADju5Cy.js")).then(e=>e.index),fr:()=>Promise.resolve().then(()=>require("./index-Rwqfce2n.js")).then(e=>e.index),hi:()=>Promise.resolve().then(()=>require("./index-HhE2sJlU.js")).then(e=>e.index),hr:()=>Promise.resolve().then(()=>require("./index-DapMA5nM.js")).then(e=>e.index),hu:()=>Promise.resolve().then(()=>require("./index-kjKI70JX.js")).then(e=>e.index),id:()=>Promise.resolve().then(()=>require("./index-BlAuAthm.js")).then(e=>e.index),it:()=>Promise.resolve().then(()=>require("./index-BK-G0i5L.js")).then(e=>e.index),mr:()=>Promise.resolve().then(()=>require("./index-CIgabTwE.js")).then(e=>e.index),nl:()=>Promise.resolve().then(()=>require("./index-BrL2zv3x.js")).then(e=>e.index),pl:()=>Promise.resolve().then(()=>require("./index-DehKWXGA.js")).then(e=>e.index),pt:()=>Promise.resolve().then(()=>require("./index-C0cxTf5o.js")).then(e=>e.index),ro:()=>Promise.resolve().then(()=>require("./index-CJ0NMfJ3.js")).then(e=>e.index),ru:()=>Promise.resolve().then(()=>require("./index-gBhj9Tcu.js")).then(e=>e.index),sr:()=>Promise.resolve().then(()=>require("./index-1HMblVmZ.js")).then(e=>e.index),sv:()=>Promise.resolve().then(()=>require("./index-CDO1-R3j.js")).then(e=>e.index),tr:()=>Promise.resolve().then(()=>require("./index-CG_43X7q.js")).then(e=>e.index),uk:()=>Promise.resolve().then(()=>require("./index-Ypt3vHbi.js")).then(e=>e.index)},aT=(e,t)=>{const n=e;return t(n)??t(n.default)??null};let tu=null;const sT=()=>(tu??(tu=Promise.resolve().then(()=>require("./index-2JTNRDR1.js")).then(e=>e.franc).catch(()=>null)),tu),nu=new Map,lT=e=>{let t=nu.get(e);return t||(t=cl[e]().then(n=>aT(n,i=>i==null?void 0:i.hyphenateSync)).catch(()=>null),nu.set(e,t)),t},iu=e=>{if(!e)return null;const t=e.toLowerCase();if(cl[t])return t;const n=t.split("-")[0];return cl[n]?n:null},cT=(e,t)=>{const n=t.trim();if(n.length<eu)return;const i=e(n,{minLength:eu});if(i!=="und")return rT[i]??i},dT={hyphenateSync:null};function uT(e,t){const[n,i]=s.useState(null);return s.useEffect(()=>{if(!e)return;let o=!1;return sT().then(async r=>{const l=r?cT(r,t):void 0,c=typeof document<"u"?document.documentElement.lang:"",d=iu(l)??iu(c)??"en",u=await lT(d);o||i({lang:l,hyphenateSync:u})}),()=>{o=!0}},[e,t]),e&&n?n:dT}const ou=e=>{var t;return((t=e.match(oT))==null?void 0:t.length)??0};function pT(e,t){if(e.length<2||e.includes(ks))return;const n=new Set;if(t){const o=t(e,{hyphenChar:ks,minWordLength:tT});let r=0;for(let l=0;l<o.length;l+=1)o[l]===ks?n.add(r):r+=1}for(let o=1;o<e.length-1;o+=1)e[o-1]==="-"&&n.add(o);const i=[...n].filter(o=>{const r=e[o-1]==="-";return o>0&&o<e.length&&ou(e.slice(0,o))>=(r?1:nT)&&ou(e.slice(o))>=(r?1:iT)}).sort((o,r)=>o-r);return i.length?i:void 0}const ru=1.08,na=14,ia=8;function gT({P:e,box:t,bounds:n,natural:i,imageUrl:o,maskPath:r,stage:l,onStageChange:c,focalX:d,focalY:u,scale:p,onChange:y,onCommit:x}){const g=s.useRef(null),h=`pretext-image-ghost-${s.useId().replace(/:/g,"")}`,b=s.useRef(null),S=s.useRef(null),_=s.useRef({focalX:d,focalY:u,scale:p});_.current={focalX:d,focalY:u,scale:p};const v=l==="image";s.useEffect(()=>{var R;v&&((R=g.current)==null||R.focus({preventScroll:!0}))},[v]);const L=s.useCallback((R,T)=>{var V;const w=(V=g.current)==null?void 0:V.getBoundingClientRect();return!w||w.width<=0||w.height<=0?{x:0,y:0}:{x:(R-w.left)/w.width*t.width,y:(T-w.top)/w.height*t.height}},[t.width,t.height]),P=R=>{var w,V;if(!i)return;R.stopPropagation(),R.preventDefault(),(w=g.current)==null||w.focus({preventScroll:!0});const T=Ui(n,i,p);b.current={pointerId:R.pointerId,origin:L(R.clientX,R.clientY),startX:jn(n.width,T.width,d),startY:jn(n.height,T.height,u),width:T.width,height:T.height,moved:!1},(V=g.current)==null||V.setPointerCapture(R.pointerId)},q=(R,T)=>{var G,ge;if(!i)return;R.stopPropagation(),R.preventDefault(),(G=g.current)==null||G.focus({preventScroll:!0});const w=Ui(n,i,p),V=jn(n.width,w.width,d),z=jn(n.height,w.height,u),U={minX:V,minY:z,maxX:V+w.width,maxY:z+w.height},M=Pa(U,Yp(T)),f=Pa(U,T),K=Math.hypot(f.x-M.x,f.y-M.y);!isFinite(K)||K<=0||(S.current={pointerId:R.pointerId,anchor:M,startDistance:K,startScale:p,startX:V,startY:z,moved:!1},(ge=g.current)==null||ge.setPointerCapture(R.pointerId))},X=R=>{if(!i)return;const T=S.current;if(T&&R.pointerId===T.pointerId){R.stopPropagation(),R.preventDefault();const V=L(R.clientX,R.clientY),z={x:V.x-n.x,y:V.y-n.y},U=Math.hypot(z.x-T.anchor.x,z.y-T.anchor.y),M=Math.min(al,Math.max(rl,T.startScale*(U/T.startDistance)));if(!T.moved&&Math.abs(M-T.startScale)<1e-4)return;T.moved=!0;const f=M/T.startScale,K=T.anchor.x+(T.startX-T.anchor.x)*f,G=T.anchor.y+(T.startY-T.anchor.y)*f,ge=Ui(n,i,M);y({focalX:xo(n.width,ge.width,K),focalY:xo(n.height,ge.height,G),scale:M});return}const w=b.current;if(w&&R.pointerId===w.pointerId){R.stopPropagation(),R.preventDefault();const V=L(R.clientX,R.clientY),z=V.x-w.origin.x,U=V.y-w.origin.y;if(!w.moved&&z===0&&U===0)return;w.moved=!0,y({focalX:xo(n.width,w.width,w.startX+z),focalY:xo(n.height,w.height,w.startY+U),scale:p})}},B=R=>{var V,z;const T=b.current;if(T&&R.pointerId===T.pointerId){b.current=null,R.stopPropagation(),(V=g.current)!=null&&V.hasPointerCapture(T.pointerId)&&g.current.releasePointerCapture(T.pointerId),T.moved&&x(_.current);return}const w=S.current;w&&R.pointerId===w.pointerId&&(S.current=null,R.stopPropagation(),(z=g.current)!=null&&z.hasPointerCapture(w.pointerId)&&g.current.releasePointerCapture(w.pointerId),w.moved&&x(_.current))},H=R=>{if(R.key==="Escape"){R.stopPropagation(),c("none");return}if(R.key==="="||R.key==="+"||R.key==="-"||R.key==="_"){R.preventDefault(),R.stopPropagation();const T=R.key==="="||R.key==="+",w=Math.min(al,Math.max(rl,p*(T?ru:1/ru))),V={focalX:d,focalY:u,scale:w};y(V),x(V)}},O=["nw","ne","se","sw"],C={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},$=s.useMemo(()=>{const R=i??{width:n.width,height:n.height},T=Ui(n,R,p);return!(T.width>0)||!(T.height>0)?null:{x:n.x+jn(n.width,T.width,d),y:n.y+jn(n.height,T.height,u),width:T.width,height:T.height}},[i,n.x,n.y,n.width,n.height,d,u,p]),Q=$?{minX:$.x,minY:$.y,maxX:$.x+$.width,maxY:$.y+$.height}:C;return a.jsxs("svg",{ref:g,className:`${e}-editor${v?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:H,onPointerMove:X,onPointerUp:B,onPointerCancel:B,onLostPointerCapture:B,"data-pretext-image-editor":!0,children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>c("none")}),v&&o&&$&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:h,maskUnits:"userSpaceOnUse",x:$.x,y:$.y,width:$.width,height:$.height,children:[a.jsx("rect",{x:$.x,y:$.y,width:$.width,height:$.height,fill:"#FFFFFF"}),a.jsx("path",{d:r,fillRule:"evenodd",fill:"#000000"})]})}),a.jsx("image",{className:`${e}-editor-ghost`,href:o??void 0,x:$.x,y:$.y,width:$.width,height:$.height,preserveAspectRatio:"none",mask:`url(#${h})`}),a.jsx("rect",{className:`${e}-editor-image-bounds`,x:$.x,y:$.y,width:$.width,height:$.height})]}),v&&a.jsxs(a.Fragment,{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:n.x,y:n.y,width:n.width,height:n.height}),a.jsx("rect",{className:`${e}-editor-body`,x:n.x,y:n.y,width:n.width,height:n.height,onPointerDown:P}),O.map(R=>{const T=sl(Q,R),w=R==="ne"||R==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:T.x-ia/2,y:T.y-ia/2,width:ia,height:ia}),a.jsx("rect",{className:`${e}-editor-scale-grab${w?` ${e}-editor-scale-grab-nesw`:""}`,x:T.x-na/2,y:T.y-na/2,width:na,height:na,onPointerDown:V=>q(V,R)})]},R)})]})]})}const dl=10,mT=dl*2,zn=7,hT=4,co=9,fT=3.5,au=1.08,yT=.05,oa=14,vT=1,ra=14,aa=8;function xT({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,uniformStretch:l=!1,stage:c,onStageChange:d,onSelectionChange:u,onChange:p,onCommit:y}){const x=s.useRef(null),g=s.useRef(null),h=s.useRef(i);h.current=i;const b=s.useRef(null),S=s.useRef(null),_=s.useRef(null),v=s.useRef(null),[L,P]=s.useState([]),[q,X]=s.useState(vo),[B,H]=s.useState(null),O=s.useCallback(m=>{X(Y=>UC(Y,m)?Y:m)},[]),C=c==="shape";s.useEffect(()=>{var m;C&&((m=x.current)==null||m.focus({preventScroll:!0}))},[C]),s.useEffect(()=>{C||P(m=>m.length?[]:m)},[C]);const $=L.length>0;s.useEffect(()=>{u==null||u($)},[$,u]),s.useEffect(()=>()=>u==null?void 0:u(!1),[u]);const Q=n.width>0?t.width/n.width:1,R=n.height>0?t.height/n.height:1,T=Math.min(Q,R),w=r&&l?T:Q,V=r&&l?T:R,z=r&&l?(t.width-n.width*T)/2:0,U=r&&l?(t.height-n.height*T)/2:0,M=s.useCallback(m=>r?{x:z+(m.x-n.x)*w,y:U+(m.y-n.y)*V}:{x:m.x-n.x,y:m.y-n.y},[r,n,w,V,z,U]),f=s.useCallback(m=>r?{x:n.x+(w>0?(m.x-z)/w:0),y:n.y+(V>0?(m.y-U)/V:0)}:{x:n.x+m.x,y:n.y+m.y},[r,n,w,V,z,U]),K=s.useMemo(()=>f({x:t.width/2,y:t.height/2}),[f,t.width,t.height]),G=s.useCallback((m,Y)=>{var oe;const te=(oe=x.current)==null?void 0:oe.getBoundingClientRect();if(!te||te.width<=0||te.height<=0)return{x:0,y:0};if(r){const fe=(m-te.left)/te.width*t.width,N=(Y-te.top)/te.height*t.height;return{x:n.x+(w>0?(fe-z)/w:0),y:n.y+(V>0?(N-U)/V:0)}}return{x:n.x+(m-te.left),y:n.y+(Y-te.top)}},[r,n,t.width,t.height,w,V,z,U]),ge=s.useCallback((m,Y)=>{var oe;const te=(oe=x.current)==null?void 0:oe.getBoundingClientRect();return!te||te.width<=0||te.height<=0?{x:0,y:0}:{x:(m-te.left)/te.width*t.width,y:(Y-te.top)/te.height*t.height}},[t.width,t.height]),k=s.useCallback((m,Y)=>{const te=l&&!(Y!=null&&Y.preserveShape)?WC(m,n,t,z,U,w,V):m;y(te,Y)},[y,l,n,t,z,U,w,V]),ce=s.useCallback(()=>{H(null)},[]),I=s.useCallback((m,Y,te)=>{if(!te||b.current||S.current||_.current||v.current){ce();return}const oe=ge(m,Y),fe=un(h.current,M);for(const W of fe)for(const Se of W.nodes)if(Math.hypot(Se.p.x-oe.x,Se.p.y-oe.y)<=co){ce();return}const N=Yd(fe,oe);if(!N||N.distance>dl){ce();return}const F=fe[N.contour],ne=F==null?void 0:F.nodes[N.segment],re=F==null?void 0:F.nodes[(N.segment+1)%((F==null?void 0:F.nodes.length)??1)],J=!!(ne&&re&&!Go(ne,re));H(W=>W&&W.curved===J&&Math.hypot(W.point.x-N.point.x,W.point.y-N.point.y)<.25?W:{point:N.point,curved:J})},[ge,M,ce]),ue=m=>{var Fe;const Y=m.metaKey||m.ctrlKey,te=_.current;if(te&&m.pointerId===te.pointerId){if(m.stopPropagation(),m.preventDefault(),te.startDistance<=0)return;const Ye=G(m.clientX,m.clientY),De=Math.hypot(Ye.x-te.origin.x,Ye.y-te.origin.y),ze=Math.max(yT,De/te.startDistance);if(!te.moved&&Math.abs(ze-1)<1e-4)return;te.moved=!0,p(Gd(te.startContours,te.origin,ze));return}const oe=S.current;if(oe&&m.pointerId===oe.pointerId){m.stopPropagation(),m.preventDefault();const Ye=G(m.clientX,m.clientY),{bbox:De}=oe,ze=De.maxX-De.minX,Ze=De.maxY-De.minY,Ue=Ye.x-oe.origin.x,ye=Ye.y-oe.origin.y;let _e=Ue,Ve=ye;if(isFinite(ze)&&isFinite(Ze))if(r){let et=n.x,ot=n.x+n.width,lt=n.y,Ke=n.y+n.height;l&&(w>0&&(et=n.x+(0-z)/w,ot=n.x+(t.width-z)/w),V>0&&(lt=n.y+(0-U)/V,Ke=n.y+(t.height-U)/V));const ht=Math.min(et,ot-ze),tt=Math.max(et,ot-ze),Ge=Math.min(lt,Ke-Ze),We=Math.max(lt,Ke-Ze),Ne=Math.min(tt,Math.max(ht,De.minX+Ue)),be=Math.min(We,Math.max(Ge,De.minY+ye));_e=Ne-De.minX,Ve=be-De.minY}else{const et=De.minX-n.x,ot=De.minY-n.y,lt=Math.min(0,t.width-ze),Ke=Math.max(0,t.width-ze),ht=Math.min(0,t.height-Ze),tt=Math.max(0,t.height-Ze),Ge=Math.min(Ke,Math.max(lt,et+Ue)),We=Math.min(tt,Math.max(ht,ot+ye));_e=Ge-et,Ve=We-ot}const Je=[];if(!Y&&isFinite(ze)&&isFinite(Ze)){const et=M({x:De.minX+ze/2+_e,y:De.minY+Ze/2+Ve}),ot={x:t.width/2,y:t.height/2};Math.abs(et.x-ot.x)<=oa&&(_e=K.x-De.minX-ze/2,Je.push(ol(ot.x,"x",t))),Math.abs(et.y-ot.y)<=oa&&(Ve=K.y-De.minY-Ze/2,Je.push(ol(ot.y,"y",t)))}if(!oe.moved&&_e===0&&Ve===0)return;oe.moved=!0,O(Je.length?Je:vo),p(un(oe.startContours,et=>({x:et.x+_e,y:et.y+Ve})),{carryImage:!0});return}const fe=v.current;if(fe&&m.pointerId===fe.pointerId){m.stopPropagation(),m.preventDefault();const Ye=G(m.clientX,m.clientY);let De=Ye.x-fe.origin.x,ze=Ye.y-fe.origin.y;if(m.shiftKey&&(Math.abs(De)>Math.abs(ze)?ze=0:De=0),!fe.moved&&De===0&&ze===0)return;fe.moved=!0,p(Ud(fe.startContours,fe.selection,De,ze));return}const N=b.current;if(!N||m.pointerId!==N.pointerId){I(m.clientX,m.clientY,L.length>0||C);return}ce(),m.stopPropagation(),m.preventDefault();const F=G(m.clientX,m.clientY);if(N.kind==="anchor"){const Ye={x:N.anchor.x+(F.x-N.origin.x),y:N.anchor.y+(F.y-N.origin.y)},De=Y?[]:XC(h.current,{contour:N.contour,node:N.node}),ze=Y||!N.center?[]:[N.center],Ze=Qd(Kd(De,ze.map(_e=>_e.x),"x"),Ye,"x",M,oa),Ue=Qd(Kd(De,ze.map(_e=>_e.y),"y"),Ye,"y",M,oa),ye=Y?Ye:{x:(Ze==null?void 0:Ze.value)??ta(Ye.x,o),y:(Ue==null?void 0:Ue.value)??ta(Ye.y,o)};if(m.shiftKey&&(Math.abs(ye.x-N.anchor.x)>Math.abs(ye.y-N.anchor.y)?ye.y=N.anchor.y:ye.x=N.anchor.x),!N.moved&&ye.x===N.anchor.x&&ye.y===N.anchor.y)return;N.moved=!0,O(KC(ye,Ze,Ue,t,M)),p(DC(h.current,N.contour,N.node,ye));return}const ne=(Fe=h.current[N.contour])==null?void 0:Fe.nodes[N.node],re=N.mirror&&!m.altKey,J=re||Y?null:N.kind==="in"?ne==null?void 0:ne.out:ne==null?void 0:ne.in,W=ne?M(ne.p):null,Se=J?M(J):null,le=ne&&(!Y||m.shiftKey)?ZC(F,ne.p,re||Y?null:QC(h.current[N.contour],N.node,N.kind,M),W&&Se?Math.hypot(Se.x-W.x,Se.y-W.y):null,m.shiftKey,M,f):{point:F,guides:vo},j=le.guides.length?le.point:Y?F:{x:ta(F.x,o),y:ta(F.y,o)},Te=N.kind==="in"?ne==null?void 0:ne.in:ne==null?void 0:ne.out;!N.moved&&Te&&j.x===Te.x&&j.y===Te.y||(N.moved=!0,O(le.guides),p(BC(h.current,N.contour,N.node,N.kind,j,re)))},ee=m=>{O(vo);const Y=_.current;if(Y&&m.pointerId===Y.pointerId){_.current=null,m.stopPropagation();const J=x.current;J!=null&&J.hasPointerCapture(Y.pointerId)&&J.releasePointerCapture(Y.pointerId),Y.moved&&k(h.current,{preserveShape:!0});return}const te=S.current;if(te&&m.pointerId===te.pointerId){S.current=null,m.stopPropagation();const J=x.current;J!=null&&J.hasPointerCapture(te.pointerId)&&J.releasePointerCapture(te.pointerId),te.moved?k(h.current,{preserveShape:!0}):P([]);return}const oe=v.current;if(oe&&m.pointerId===oe.pointerId){v.current=null,m.stopPropagation();const J=x.current;J!=null&&J.hasPointerCapture(oe.pointerId)&&J.releasePointerCapture(oe.pointerId),oe.moved&&k(h.current);return}const fe=b.current;if(!fe||m.pointerId!==fe.pointerId)return;b.current=null,m.stopPropagation();const N=x.current;N!=null&&N.hasPointerCapture(fe.pointerId)&&N.releasePointerCapture(fe.pointerId);const F=Math.hypot(m.clientX-fe.clientOrigin.x,m.clientY-fe.clientOrigin.y);if(fe.moved||F>hT){fe.moved&&k(h.current);return}if(!fe.toggleOnRelease||m.type!=="pointerup")return;const re=qd(h.current,fe.contour,fe.node);re!==h.current&&(p(re),k(re))},xe=m=>{m.stopPropagation()},Le=m=>{var Y,te;m.stopPropagation(),m.preventDefault(),ce(),(Y=x.current)==null||Y.focus({preventScroll:!0}),S.current={pointerId:m.pointerId,origin:G(m.clientX,m.clientY),startContours:Vn(i),bbox:Li(i),moved:!1},(te=x.current)==null||te.setPointerCapture(m.pointerId)},se=(m,Y)=>{var F,ne;m.stopPropagation(),m.preventDefault(),ce(),(F=x.current)==null||F.focus({preventScroll:!0}),P([]),d("shape");const te=Li(i),oe=Pa(te,Yp(Y)),fe=sl(te,Y),N=Math.hypot(fe.x-oe.x,fe.y-oe.y);!isFinite(N)||N<=0||(_.current={pointerId:m.pointerId,corner:Y,origin:oe,startDistance:N,startContours:Vn(i),moved:!1},(ne=x.current)==null||ne.setPointerCapture(m.pointerId))},de=(m,Y,te,oe)=>{var F,ne,re,J;m.stopPropagation(),m.preventDefault(),ce(),(F=x.current)==null||F.focus({preventScroll:!0});const fe=(ne=i[te])==null?void 0:ne.nodes[oe];if(!fe)return;if(m.altKey){const W=Y==="anchor"?qp(i,te,oe):jC(i,te,oe,Y);if(W===i)return;P(Y==="anchor"?[]:[{contour:te,node:oe}]),p(W),k(W);return}const N=m.metaKey||m.ctrlKey;if(Y==="anchor"&&m.shiftKey&&!N){P(W=>W.some(Se=>Se.contour===te&&Se.node===oe)?W.filter(Se=>!(Se.contour===te&&Se.node===oe)):[...W,{contour:te,node:oe}]);return}if(Y==="anchor"&&!N&&L.length>1&&L.some(W=>W.contour===te&&W.node===oe)){v.current={pointerId:m.pointerId,origin:G(m.clientX,m.clientY),startContours:Vn(i),selection:L,moved:!1},(re=x.current)==null||re.setPointerCapture(m.pointerId);return}P([{contour:te,node:oe}]),b.current={kind:Y,contour:te,node:oe,pointerId:m.pointerId,origin:G(m.clientX,m.clientY),clientOrigin:{x:m.clientX,y:m.clientY},anchor:fe.p,center:HC(i),mirror:Y!=="anchor"&&!!(fe.in&&fe.out),toggleOnRelease:N,moved:!1},(J=x.current)==null||J.setPointerCapture(m.pointerId)},Z=m=>{m.stopPropagation(),m.preventDefault(),ce();const Y=un(i,M),te=Yd(Y,ge(m.clientX,m.clientY));if(!te||te.distance>dl)return;const{contours:oe,nodeIndex:fe}=VC(i,te.contour,te.segment,te.t);fe<0||(P([{contour:te.contour,node:fe}]),p(oe),k(oe))},pe=m=>{if(m.key==="="||m.key==="+"||m.key==="-"||m.key==="_"){m.preventDefault(),m.stopPropagation();const N=Li(i);if(!isFinite(N.minX)||!isFinite(N.maxX))return;const F={x:(N.minX+N.maxX)/2,y:(N.minY+N.maxY)/2},re=m.key==="="||m.key==="+"?au:1/au,J=Gd(i,F,re);p(J),k(J,{preserveShape:!0});return}if(m.key==="Escape"){m.stopPropagation(),P([]),d("none");return}if(!L.length)return;if(m.key==="Backspace"||m.key==="Delete"){m.preventDefault(),m.stopPropagation();const N=zC(i,L);if(N===i)return;P([]),p(N),k(N);return}const Y=o>0?o:vT,te=m.shiftKey?Y*10:Y,oe={ArrowLeft:[-te,0],ArrowRight:[te,0],ArrowUp:[0,-te],ArrowDown:[0,te]}[m.key];if(!oe)return;m.preventDefault(),m.stopPropagation();const fe=Ud(i,L,oe[0],oe[1]);p(fe),k(fe)},ie=s.useMemo(()=>Wo(un(i,M)),[i,M]),me=s.useMemo(()=>Li(i),[i]),ve=M({x:me.minX,y:me.minY}),Ee={width:M({x:me.maxX,y:me.minY}).x-ve.x,height:M({x:me.minX,y:me.maxY}).y-ve.y},Re=C&&L.length===0&&isFinite(me.minX)&&isFinite(me.maxX)&&me.maxX>me.minX&&me.maxY>me.minY,Ce=L.length>0||C,$e=Ce;return a.jsxs("svg",{ref:x,className:`${e}-editor${Ce?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:pe,onPointerDown:()=>{var m;return(m=x.current)==null?void 0:m.focus({preventScroll:!0})},onPointerMove:ue,onPointerLeave:ce,onPointerUp:ee,onPointerCancel:ee,onLostPointerCapture:ee,onContextMenu:m=>{m.preventDefault()},"data-pretext-path-editor":!0,"data-selection":"none",children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>{P([]),d("none")},onClick:Z}),$e&&a.jsx("path",{className:`${e}-editor-outline`,d:ie}),$e&&q.map((m,Y)=>a.jsx("line",{className:`${e}-editor-snap ${e}-editor-snap-${m.kind}`,x1:m.a.x,y1:m.a.y,x2:m.b.x,y2:m.b.y},`${m.kind}-${Y}`)),a.jsx("path",{ref:g,className:`${e}-editor-body`,d:ie,fillRule:"evenodd",onPointerDown:Le,onClick:Z}),$e&&a.jsx("path",{className:`${e}-editor-hit`,d:ie,style:{strokeWidth:mT},onClick:Z}),$e&&B&&a.jsx("rect",{className:`${e}-editor-add-preview`,x:B.point.x-zn/2,y:B.point.y-zn/2,width:zn,height:zn,rx:B.curved?zn/2:0}),$e&&i.map((m,Y)=>m.nodes.map((te,oe)=>{const fe=L.some(F=>F.contour===Y&&F.node===oe),N=M(te.p);return a.jsxs("g",{children:[fe&&L.length===1&&["in","out"].map(F=>{const ne=te[F];if(!ne)return null;const re=M(ne);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:N.x,y1:N.y,x2:re.x,y2:re.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:re.x,cy:re.y,r:fT}),a.jsx("circle",{className:`${e}-editor-grab`,cx:re.x,cy:re.y,r:co,onPointerDown:J=>de(J,F,Y,oe),onClick:xe})]},F)}),a.jsx("rect",{className:`${e}-editor-anchor${fe?` ${e}-editor-anchor-selected`:""}`,x:N.x-zn/2,y:N.y-zn/2,width:zn,height:zn,rx:Bp(te)?zn/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:N.x-co,y:N.y-co,width:co*2,height:co*2,onPointerDown:F=>de(F,"anchor",Y,oe),onClick:xe,onDoubleClick:F=>{F.stopPropagation(),F.preventDefault();const ne=qd(i,Y,oe);p(ne),k(ne)}})]},`${Y}-${oe}`)})),Re&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:ve.x,y:ve.y,width:Ee.width,height:Ee.height}),["nw","ne","se","sw"].map(m=>{const Y=M(sl(me,m)),te=m==="ne"||m==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:Y.x-aa/2,y:Y.y-aa/2,width:aa,height:aa}),a.jsx("rect",{className:`${e}-editor-scale-grab${te?` ${e}-editor-scale-grab-nesw`:""}`,x:Y.x-ra/2,y:Y.y-ra/2,width:ra,height:ra,onPointerDown:oe=>se(oe,m),onClick:xe})]},m)})]})]})}const bT=4e3,ST=/^(?:https?:|mailto:|tel:)/i;function Kp(e){return!!e&&typeof e=="object"&&e.type==="link"}function wT(e){if(!e)return;const t=e.replace(/\s+/g,"");if(!(/^[a-z][a-z0-9+.-]*:/i.test(t)&&!ST.test(t)))return t}function $T(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,c)=>{for(const d of r){if(Kp(d)){o(d.children??[],wT(d.value),d.target);continue}const u=d,p=(u==null?void 0:u.text)??"";if(p.trim())for(const y of p.split(/\s+/))y&&t.push({text:y,leaf:u,href:l,target:c,para:i})}};o((n==null?void 0:n.children)??[])}),t}function su(e){return{...e.fontFamily&&{fontFamily:Bo(e.fontFamily)},...e.fontWeight&&{fontWeight:e.fontWeight},...e.fontStyle&&{fontStyle:e.fontStyle},...e.textDecoration&&{textDecoration:e.textDecoration},...e.textTransform&&{textTransform:e.textTransform},...e.fontVariant&&{fontVariant:e.fontVariant},...e.verticalAlign&&{verticalAlign:e.verticalAlign,lineHeight:"0px"}}}function CT(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(Kp(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function TT(e,t,n,i,o){if(t<=0||!e.length||n<=0||i<=0)return e;const r=o==="avoid"?1:-1;return e.map(l=>{if(!l.length)return l;let c=1/0,d=-1/0,u=1/0,p=-1/0;for(const g of l){const h=g.x*n,b=g.y*i;h<c&&(c=h),h>d&&(d=h),b<u&&(u=b),b>p&&(p=b)}const y=(c+d)/2,x=(u+p)/2;return l.map(g=>{const h=g.x*n,b=g.y*i,S=h-y,_=b-x,v=Math.sqrt(S*S+_*_);if(v<1e-6)return g;const P=Math.max(0,v+r*t)/v;return{x:(y+S*P)/n,y:(x+_*P)/i}})})}const IT=.75;function lu(e,t,n,i,o,r){if(e.kind==="fragment"||!t)return null;const l=e.token.text,c=e.offset>0?t[e.offset-1]:0,d=n?n.map(u=>u-e.offset).filter(u=>u>=(e.offset>0?2:1)&&u<l.length):Array.from({length:l.length-1},(u,p)=>p+1);for(let u=d.length-1;u>=0;u-=1){const p=d[u];if(e.offset+p>t.length)continue;const y=!!n&&l[p-1]!=="-",x=t[e.offset+p-1]-c,g=x+(y?r:0);if(!(g*o>i))return{chars:p,fragmentText:y?`${l.slice(0,p)}-`:l.slice(0,p),remainderText:l.slice(p),fragmentWidth:g,remainderWidth:Math.max(0,e.width-x)}}return null}function cu(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:c,height:d,allowOverflow:u,capInset:p,capLines:y}=e,x=!!e.hyphenate,g=e.charWidths??[],h=e.hyphenPoints??[],b=e.hyphenWidth??0,S=e.lineHeight*l,_=e.spaceWidth*l,v=Math.max(0,e.shapeMargin??0),L=[],P=t.map((M,f)=>({token:M,originalIndex:f,width:n[f],kind:"whole",offset:0}));if(!P.length||c<=0||S<=0)return{segments:L,placed:0,height:0,capLeft:0,capTop:0,renderTokens:t};const q=Math.max(1,_*.5),X=S*fC,B=TT(i,v,c,d,o),H=Math.max(1,Math.floor(e.columns??1)),O=H>1?Math.max(0,e.columnGap??0):0,C=(c-O*(H-1))/H;let $=0,Q=0,R=0,T=0,w=0,V=null;const z=(M,f,K)=>CC(B,(M+X)/d,(M+S-X)/d,o).map(G=>({x0:Math.max(f,G.x0*c),x1:Math.min(K,G.x1*c)})).filter(G=>G.x1>G.x0);for(let M=0;M<H&&$<P.length&&C>0;M+=1){const f=M*(C+O),K=f+C,G=u&&M===H-1;let ge=0;for(let I=0;I+S<=d;I+=S)for(const ue of z(I,f,K))ge=Math.max(ge,ue.x1-ue.x0);let k=P[$].token.para,ce=0;for(;$<P.length&&R<bT;){const I=ce+S>d;if(I&&!G)break;const ue=P[$].token.para;if(ue>k+1){ce+=S*(ue-k-1),k=ue-1,R+=1;continue}let ee=I?[{x0:f,x1:K}]:z(ce,f,K);p>0&&y>0&&M===0&&!I&&ee.length&&(V===null&&(V=R,T=ee[0].x0,w=ce),R-V<y&&(ee=$C(ee,{x0:T,x1:T+p})));const xe=ee.reduce((Le,se)=>Math.max(Le,se.x1-se.x0),0);for(const Le of ee){const se=Le.x1-Le.x0;if(se<q)continue;if($>=P.length||P[$].token.para!==ue)break;const de=$;let Z=0;for(;$<P.length&&P[$].token.para===ue;){const pe=P[$],ie=$===de,me=pe.width*l,ve=ie?me:_+me;if(Z+ve<=se){Z+=ve,$+=1;continue}const Ee=se-Z-(ie?0:_),Re=ie&&me>C-.5,Ce=se>=xe-.5&&se>=ge*IT,$e=g[pe.originalIndex],m=h[pe.originalIndex],Y=(x&&m?lu(pe,$e,m,Ee,l,b):null)??(Re&&Ce?lu(pe,$e,void 0,Ee,l,b):null);if(Y){const te={token:{...pe.token,text:Y.fragmentText},originalIndex:pe.originalIndex,width:Y.fragmentWidth,kind:"fragment",offset:pe.offset},oe={token:{...pe.token,text:Y.remainderText},originalIndex:pe.originalIndex,width:Y.remainderWidth,kind:"remainder",offset:pe.offset+Y.chars};P.splice($,1,te,oe),Z+=(ie?0:_)+Y.fragmentWidth*l,$+=1;break}if(Re&&H===1&&se>=ge-.5){Z+=ve,$+=1;continue}break}if($>de){const pe=$>=P.length||P[$].token.para!==ue;L.push({top:ce,left:Le.x0,width:se,from:de,to:$,justify:r==="justify"&&!pe})}if($>=P.length||P[$].token.para!==ue)break}k=ue,ce+=S,R+=1}Q=Math.max(Q,ce)}let U=0;if($>0){const M=P[$-1];U=M.kind==="fragment"?M.originalIndex:M.originalIndex+1}return{segments:L,placed:U,height:L.length?Q:0,capLeft:T,capTop:w,renderTokens:P.map(M=>M.token)}}const LT=.12,PT=2,MT=10,As=.25,RT=e=>{const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}},ET=(e,t)=>Math.abs(e.top-t.top)<.5&&Math.abs(e.left-t.left)<.5&&Math.abs(e.width-t.width)<.5&&Math.abs(e.height-t.height)<.5,kT=(e,t)=>{const[n,i]=s.useState(null);return s.useEffect(()=>{if(!e||!t){i(null);return}let o=0,r=null;const l=()=>{const c=RT(e);(!r||!ET(r,c))&&(r=c,i(c)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n},Fs=(e,t)=>{if(!(t.width>0)||!(t.height>0))return e;const n=Math.min(t.width,t.height),i=(t.width-n)/2,o=(t.height-n)/2;return e.map(r=>r.map(l=>({x:(i+l.x*n)/t.width,y:(o+l.y*n)/t.height})))},nr=typeof window>"u"?s.useEffect:s.useLayoutEffect;function AT(){return typeof document>"u"?null:document.body}function FT({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:c,allowOverflow:d,fitEnabled:u,scale:p,onFitScale:y,padding:x,columns:g,gutter:h,hyphenate:b,showOverflowIndicator:S,dropCapLines:_,dropCapSize:v,showGuides:L,typography:P,imageUrl:q,imageFocalX:X,imageFocalY:B,imageScale:H,imageCustomPath:O,imagePathEdited:C,pathDragActive:$,pathCarryImage:Q,onCarryImageConsumed:R,pathEditor:T,imageEditor:w}){var Ut,Ft;const V=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[z,U]=s.useState(null),M=s.useRef(null),[f,K]=s.useState({width:0,height:0}),[G,ge]=s.useState(0),[k,ce]=s.useState(0),[I,ue]=s.useState(null),[ee,xe]=s.useState(0),[Le,se]=s.useState("none");s.useEffect(()=>{!T&&!w&&se("none")},[T,w]);const[de,Z]=s.useState(null);s.useEffect(()=>{if(!q||typeof Image>"u"){Z(null);return}let Me=!1;const Oe=new Image;return Oe.onload=()=>{Me||Z({width:Oe.naturalWidth,height:Oe.naturalHeight})},Oe.src=q,()=>{Me=!0}},[q]);const pe=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),ie=s.useMemo(()=>$T(pe),[pe]),me=s.useMemo(()=>CT(pe),[pe]),ve=s.useMemo(()=>me.join(`
|
|
27798
|
-
`),[me]),{lang:Ee,hyphenateSync:Re}=uT(b,ve),Ce=s.useMemo(()=>b?ie.map(Me=>pT(Me.text,Re)):[],[b,ie,Re]),$e=_>0&&v>1?((Ft=(Ut=ie[0])==null?void 0:Ut.text)==null?void 0:Ft.charAt(0))??"":"",m=(T==null?void 0:T.contours)??null,Y=s.useMemo(()=>{let Me=[];if(m){const Oe=$r(m);Oe.length&&(Me=Co(Oe,r))}if(!Me.length){const Oe=i.trim(),St=Oe?zd(Oe,o,r):null;St&&St.length?Me=St:Me=el(n==="custom"?"rectangle":n)}return n==="circle"?Fs(Me,f):Me},[m,n,i,o,r,f.width,f.height]),te=T==null?void 0:T.onConvert,oe=(T==null?void 0:T.needsConversion)??!1,fe=s.useMemo(()=>{if(n==="circle")return!1;const Me=m??(i.trim()?ki(i):null);return!!(Me&&Xp(Me,r))},[m,i,r,n]),[N,F]=s.useState(null);nr(()=>{if(!fe){N&&F(null);return}!N&&f.width>0&&f.height>0&&F({width:f.width,height:f.height})},[fe,f.width,f.height,N]);const ne=s.useMemo(()=>{if(!fe||f.width<=0||f.height<=0)return Y;const Me=N??f,Oe=r.width/Me.width,St=r.height/Me.height;return Y.map(Mt=>Mt.map(Qe=>({x:Qe.x*Oe,y:Qe.y*St})))},[Y,fe,N,r.width,r.height,f.width,f.height]),re=s.useMemo(()=>{if(m){const Mt=$r(m);if(Mt.length){const Qe=Co(Mt,r);return n==="circle"?Fs(Qe,f):Qe}}const Me=O.trim(),Oe=Me?zd(Me,o,r):null,St=Oe&&Oe.length?Oe:el(n==="custom"?"rectangle":n);return n==="circle"?Fs(St,f):St},[m,n,O,o,r,f.width,f.height]),J=s.useMemo(()=>{if(!fe||f.width<=0||f.height<=0)return re;const Me=N??f,Oe=r.width/Me.width,St=r.height/Me.height;return re.map(Mt=>Mt.map(Qe=>({x:Qe.x*Oe,y:Qe.y*St})))},[re,fe,N,r.width,r.height,f.width,f.height]),W=s.useRef(null),Se=s.useRef(!1);s.useEffect(()=>{if(!(!te||f.width<=0||f.height<=0)){if(fe){if(W.current===i)return;const Me=m??(i.trim()?ki(i):null);if(!(Me!=null&&Me.length))return;const Oe=un(Me,St=>({x:r.x+(St.x-r.x)/f.width*r.width,y:r.y+(St.y-r.y)/f.height*r.height}));W.current=Wo(Oe),te(Oe);return}!oe||!Y.length||Se.current||(Se.current=!0,te(un(Gp(Y),Me=>({x:Me.x*La,y:Me.y*La}))))}},[oe,fe,te,Y,m,i,r,f.width,f.height]);const le=s.useCallback(()=>{const Me=z;if(!Me)return;const Oe=Me.getBoundingClientRect(),St=window.getComputedStyle(Me),Mt=parseFloat(St.paddingTop)||0;ge(Bt=>Math.abs(Bt-Mt)<.5?Bt:Mt);const Qe=parseFloat(St.columnGap)||0;ce(Bt=>Math.abs(Bt-Qe)<.5?Bt:Qe);const kt={width:Oe.width,height:Oe.height};K(Bt=>Math.abs(Bt.width-kt.width)<.5&&Math.abs(Bt.height-kt.height)<.5?Bt:kt)},[z]);nr(()=>{const Me=z;if(!Me||typeof ResizeObserver>"u")return;le();const Oe=new ResizeObserver(le);return Oe.observe(Me),()=>Oe.disconnect()},[z,le]),nr(()=>{le()},[x,h,le]),s.useEffect(()=>{const Me=typeof document<"u"?document.fonts:void 0;Me!=null&&Me.ready&&Me.ready.then(()=>{xe(Oe=>Oe+1)})},[]),nr(()=>{const Me=M.current;if(!Me)return;if(!ie.length){ue(null);return}const Oe=[],St=document.createDocumentFragment();for(const Pt of ie){const Zt=document.createElement("span");Object.assign(Zt.style,su(Pt.leaf)),Zt.textContent=Pt.text,St.appendChild(Zt),Oe.push(Zt)}const Mt=document.createElement("span");Mt.textContent=" ",St.appendChild(Mt);const Qe=document.createElement("span");Qe.textContent="-",St.appendChild(Qe);const kt=$e||"H",Bt=document.createElement("span");Bt.textContent=kt,Bt.style.lineHeight="1",St.appendChild(Bt),Me.replaceChildren(St);const Wt=window.getComputedStyle(Me),At=parseFloat(Wt.fontSize)||16,Ae=parseFloat(Wt.lineHeight),ft=Number.isNaN(Ae)?At*1.2:Ae,gt=Math.max(ft,At),dt=document.createElement("span");dt.textContent=kt,dt.style.lineHeight=`${gt}px`;const yt=document.createElement("span");yt.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",dt.appendChild(yt),Me.appendChild(dt);const ut=dt.getBoundingClientRect().top,it=yt.getBoundingClientRect().top,Nt=Math.max(1,it-ut);dt.remove();let $t=Nt*.8;const Xt=document.createElement("canvas").getContext("2d"),Ot=Pt=>`${Wt.fontStyle} ${Wt.fontWeight} ${Pt}px ${Wt.fontFamily}`;if(Xt){Xt.font=Ot(At);const Pt=Xt.measureText(kt).actualBoundingBoxAscent;Pt>0&&($t=Pt)}const jt=v>1?(v-1)*gt+$t:$t;let Dt=At*(jt/$t);if(Xt){Xt.font=Ot(Dt);const Pt=Xt.measureText(kt).actualBoundingBoxAscent;Pt>0&&(Dt=Dt*(jt/Pt))}Bt.style.fontSize=`${Dt}px`,Bt.style.lineHeight=`${Dt}px`;const zt=document.createElement("span");zt.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",Bt.appendChild(zt);const D=Math.max(1,zt.getBoundingClientRect().top-Bt.getBoundingClientRect().top);zt.remove();const Be=(v-1)*gt+Nt-D,ke=Oe.map(Pt=>Pt.getBoundingClientRect().width),vt=Mt.getBoundingClientRect().width,Ct=Qe.getBoundingClientRect().width,at=$e?Bt.getBoundingClientRect().width:0,Tt=(f.width-k*(g-1))/g,Vt=Oe.map((Pt,Zt)=>{var pi;const on=Pt.firstChild;if(!(on instanceof Text)||on.data.length<2||!(ke[Zt]>Tt-.5)&&!((pi=Ce[Zt])!=null&&pi.length))return;const xn=document.createRange(),ui=Pt.getBoundingClientRect().left,dn=[];for(let Kn=1;Kn<=on.data.length;Kn+=1)xn.setStart(on,0),xn.setEnd(on,Kn),dn.push(xn.getBoundingClientRect().right-ui);return dn});Me.replaceChildren(),ue({widths:ke,spaceWidth:vt,dashWidth:Ct,charWidths:Vt,lineHeight:gt,capWidth:at,dropCapFontSize:Dt,dropCapTopAdjust:Be})},[ie,P,$e,_,v,ee,f.width,b,Ce,g,k]);const j=I&&$e?I.capWidth+I.lineHeight*LT:0,Te=Math.max(_,Math.ceil(v)),Fe=s.useMemo(()=>{if(!I||!ie.length||f.width<=0||f.height<=0||!u)return 1;const Me=Mt=>cu({tokens:ie,widths:I.widths,spaceWidth:I.spaceWidth,lineHeight:I.lineHeight,width:f.width,height:f.height,rings:ne,mode:l,align:c,scale:Mt,allowOverflow:!1,capInset:j*Mt,capLines:$e?Te:0,hyphenate:b,charWidths:I.charWidths,hyphenPoints:Ce,hyphenWidth:I.dashWidth,shapeMargin:G,columns:g,columnGap:k});if(Me(1).placed>=ie.length)return 1;if(Me(As).placed<ie.length)return As;let Oe=As,St=1;for(let Mt=0;Mt<MT;Mt+=1){const Qe=(Oe+St)/2;Me(Qe).placed>=ie.length?Oe=Qe:St=Qe}return Oe},[I,ie,f.width,f.height,ne,l,c,u,j,$e,Te,b,Ce,G,g,k]);s.useEffect(()=>{y(Fe)},[Fe,y]);const Ye=u?Math.min(p,Fe):1,De=s.useMemo(()=>!I||!ie.length||f.width<=0||f.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0,renderTokens:ie}:cu({tokens:ie,widths:I.widths,spaceWidth:I.spaceWidth,lineHeight:I.lineHeight,width:f.width,height:f.height,rings:ne,mode:l,align:c,scale:Ye,allowOverflow:d,capInset:j*Ye,capLines:$e?Te:0,hyphenate:b,charWidths:I.charWidths,hyphenPoints:Ce,hyphenWidth:I.dashWidth,shapeMargin:G,columns:g,columnGap:k}),[I,ie,f.width,f.height,ne,l,c,Ye,d,j,$e,Te,b,Ce,G,g,k]),ze=S&&ie.length>0&&De.placed<ie.length,Ze=I?I.dropCapFontSize*Ye:0,Ue=I?I.dropCapTopAdjust*Ye:0,ye=c==="justify"?"left":c,_e=I?I.lineHeight*Ye:0,Ve=De.segments.length?De.segments[De.segments.length-1]:null,Je=Ve?{top:Ve.top+_e,left:Ve.left+Ve.width/2}:{top:f.height,left:f.width/2},et=!!(T&&m&&f.width>0&&f.height>0),ot=!!w,lt=(et||ot)&&f.width>0&&f.height>0,Ke=kT(z,lt),ht=lt&&Ke?AT():null,tt=s.useRef(!1),Ge=s.useCallback(Me=>{tt.current=Me},[]);s.useEffect(()=>{if(!et&&!ot)return;const Me=Oe=>{const St=z;if(!St)return;const Mt=St.getBoundingClientRect();Oe.clientX>=Mt.left&&Oe.clientX<=Mt.right&&Oe.clientY>=Mt.top&&Oe.clientY<=Mt.bottom&&(Oe.preventDefault(),Oe.stopPropagation(),se(kt=>kt==="shape"&&tt.current?kt:kt==="shape"&&ot?"image":et?"shape":"image"))};return document.addEventListener("dblclick",Me,!0),()=>document.removeEventListener("dblclick",Me,!0)},[et,ot,z]);const We=s.useMemo(()=>q&&f.width>0&&f.height>0?yC(J,f):null,[q,J,f.width,f.height]),Ne=s.useRef(null),be=(()=>{const Me=Ne.current;return Q||!C||!w||!de||!We||!Me||O===Me.customPath||Me.shape!==n&&n!=="custom"?null:eT(Me.bounds,We,de,Me.focalX,Me.focalY,Me.scale)})();nr(()=>{if(!w){Ne.current=null;return}if($||!de||!We)return;const Me=Ne.current,Oe=!!(Me&&O!==Me.customPath);Oe&&be&&w.onCommit(be),Oe&&Q&&(R==null||R()),Ne.current={rings:J,bounds:We,focalX:(be==null?void 0:be.focalX)??X,focalY:(be==null?void 0:be.focalY)??B,scale:(be==null?void 0:be.scale)??H,customPath:O,shape:n}},[$,Q,O,n,J,We,w,de,X,B,H,be,R]);const He=Ne.current,Xe=!!($&&!Q&&He&&!be),ct=Xe&&He?He.focalX:(be==null?void 0:be.focalX)??X,rt=Xe&&He?He.focalY:(be==null?void 0:be.focalY)??B,xt=Xe&&He?He.scale:(be==null?void 0:be.scale)??H,pt=Xe&&He?He.bounds:We,It=s.useMemo(()=>{if(!(f.width>0)||!(f.height>0))return"";let Me=jd(i,m,o,r,n,f);if(fe){const Oe=N??f,St=r.width/Oe.width,Mt=r.height/Oe.height;Me=un(Me,Qe=>({x:Qe.x*St,y:Qe.y*Mt}))}return Vd(Me,f)||Dd(ne,f)},[i,m,o,r,n,f.width,f.height,fe,N,ne]),nt=s.useMemo(()=>{if(!q||!(f.width>0)||!(f.height>0))return"";let Me=jd(O,m,o,r,n,f);if(fe){const Oe=N??f,St=r.width/Oe.width,Mt=r.height/Oe.height;Me=un(Me,Qe=>({x:Qe.x*St,y:Qe.y*Mt}))}return Vd(Me,f)||Dd(J,f)},[q,O,m,o,r,n,f.width,f.height,fe,N,J]),bt=`${V}-clip`,Lt=s.useMemo(()=>{if(!pt)return null;const Me=de??{width:pt.width,height:pt.height},Oe=Ui(pt,Me,xt);return{x:jn(pt.width,Oe.width,ct),y:jn(pt.height,Oe.height,rt),width:Oe.width,height:Oe.height}},[pt,de,ct,rt,xt]);return a.jsxs("div",{className:`${e}-column`,style:{padding:x,columnGap:h},lang:Ee,ref:U,children:[It?a.jsxs("svg",{className:`${e}-shape-fill`,style:{top:0,left:0,width:f.width,height:f.height},viewBox:`0 0 ${f.width} ${f.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("path",{className:`${e}-shape-fill-path`,d:It,fillRule:"evenodd"}),q&&nt&&pt&&Lt?a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsx("clipPath",{id:bt,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:nt,fillRule:"evenodd"})})}),a.jsx("image",{href:q,x:pt.x+Lt.x,y:pt.y+Lt.y,width:Lt.width,height:Lt.height,preserveAspectRatio:"none",clipPath:`url(#${bt})`})]}):null]}):null,a.jsxs("div",{className:`${e}-flow${d?"":` ${e}-clip`}`,style:{...P,["--"+e+"-fit"]:Ye,top:0,left:0,width:f.width,height:f.height},children:[a.jsx("div",{className:`${e}-measure`,ref:M,style:P,"aria-hidden":!0}),De.segments.map((Me,Oe)=>{const St=De.renderTokens.slice(Me.from,Me.to),Mt=Oe===0;return a.jsx("div",{className:`${e}-line${Me.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${Me.top}px`,left:`${Me.left}px`,width:`${Me.width}px`,textAlign:Me.justify?void 0:ye},children:St.map((Qe,kt)=>{const Wt=$e&&Mt&&Me.from===0&&kt===0?Qe.text.slice(1):Qe.text,At=su(Qe.leaf),Ae=Qe.href?a.jsx("a",{className:`${e}-link`,href:Qe.href,target:Qe.target,rel:Qe.target?"noopener noreferrer":void 0,style:At,children:Wt}):a.jsx("span",{style:At,children:Wt});return a.jsxs("span",{children:[!Me.justify&&kt>0?" ":null,Ae]},kt)})},`${Me.from}-${Me.to}-${Oe}`)}),L&&!m&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:ne.map((Me,Oe)=>a.jsx("polygon",{points:Me.map(St=>`${St.x},${St.y}`).join(" ")},Oe))})]}),$e&&I&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...P,top:`${De.capTop+Ue}px`,left:`${De.capLeft}px`,fontSize:`${Ze}px`,lineHeight:`${Ze}px`},children:$e}),ht&&Ke&&(m&&T||w)&&qn.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:Ke.top,left:Ke.left,width:Ke.width,height:Ke.height,zIndex:PT,pointerEvents:"none"},children:[m&&T&&a.jsx(xT,{P:e,box:{width:Ke.width,height:Ke.height},viewBox:r,contours:m,snap:T.snap,stretchToBox:!fe,uniformStretch:n==="circle",stage:Le,onStageChange:se,onSelectionChange:Ge,onChange:T.onChange,onCommit:T.onCommit}),w&&pt&&a.jsx(gT,{P:e,box:{width:Ke.width,height:Ke.height},bounds:pt,natural:de,imageUrl:q,maskPath:nt,stage:Le,onStageChange:se,focalX:ct,focalY:rt,scale:xt,onChange:w.onChange,onCommit:w.onCommit})]}),ht),a.jsx("div",{className:`${e}-a11y`,children:me.map((Me,Oe)=>a.jsx("p",{children:Me},Oe))}),ze&&a.jsxs("svg",{className:`${e}-overflow-icon`,width:"33",height:"24",viewBox:"0 0 33 24",style:{top:Je.top,left:Je.left},"aria-hidden":!0,children:[a.jsx("path",{d:"M12.8,4 L20.2,4 C24.68042,4 26.9206301,4 28.631924,4.87194781 C31.3123488,6.23769248 33,8.99168887 33,12 C33,15.0083111 31.3123488,17.7623075 28.631924,19.1280522 C26.9206301,20 24.68042,20 20.2,20 L12.8,20 C8.31957995,20 6.07936993,20 4.368076,19.1280522 C1.68765116,17.7623075 0,15.0083111 0,12 C0,8.99168887 1.68765116,6.23769248 4.368076,4.87194781 C6.07936993,4 8.31957995,4 12.8,4 Z",fill:"#FF4400"}),a.jsx("path",{transform:"translate(5, 0)",fill:"#FFFFFF",d:"M12,5.625 C12.3846269,5.625 12.7016304,5.91453014 12.7449542,6.28753416 L12.75,6.375 L12.75,11.25 L17.625,11.25 C18.0392136,11.25 18.375,11.5857864 18.375,12 C18.375,12.3846269 18.0854699,12.7016304 17.7124658,12.7449542 L17.625,12.75 L12.75,12.75 L12.75,17.625 C12.75,18.0392136 12.4142136,18.375 12,18.375 C11.6153731,18.375 11.2983696,18.0854699 11.2550458,17.7124658 L11.25,17.625 L11.25,12.75 L6.375,12.75 C5.96078644,12.75 5.625,12.4142136 5.625,12 C5.625,11.6153731 5.91453014,11.2983696 6.28753416,11.2550458 L6.375,11.25 L11.25,11.25 L11.25,6.375 C11.25,5.96078644 11.5857864,5.625 12,5.625 Z"})]})]})}const Qp=["diamond","parallelogram","vase","circle","shield","bobbin","custom"],NT={x:0,y:0,width:100,height:100},_T=e=>{const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?NT:{x:t[0],y:t[1],width:t[2],height:t[3]}},HT=e=>`
|
|
27794
|
+
`),[me]),{lang:Ee,hyphenateSync:Re}=uT(b,ve),Ce=s.useMemo(()=>b?ie.map(Me=>pT(Me.text,Re)):[],[b,ie,Re]),$e=_>0&&v>1?((Ft=(Ut=ie[0])==null?void 0:Ut.text)==null?void 0:Ft.charAt(0))??"":"",m=(T==null?void 0:T.contours)??null,Y=s.useMemo(()=>{let Me=[];if(m){const Oe=$r(m);Oe.length&&(Me=Co(Oe,r))}if(!Me.length){const Oe=i.trim(),St=Oe?zd(Oe,o,r):null;St&&St.length?Me=St:Me=el(n==="custom"?"rectangle":n)}return n==="circle"?Fs(Me,f):Me},[m,n,i,o,r,f.width,f.height]),te=T==null?void 0:T.onConvert,oe=(T==null?void 0:T.needsConversion)??!1,fe=s.useMemo(()=>{if(n==="circle")return!1;const Me=m??(i.trim()?ki(i):null);return!!(Me&&Xp(Me,r))},[m,i,r,n]),[N,F]=s.useState(null);nr(()=>{if(!fe){N&&F(null);return}!N&&f.width>0&&f.height>0&&F({width:f.width,height:f.height})},[fe,f.width,f.height,N]);const ne=s.useMemo(()=>{if(!fe||f.width<=0||f.height<=0)return Y;const Me=N??f,Oe=r.width/Me.width,St=r.height/Me.height;return Y.map(Mt=>Mt.map(Qe=>({x:Qe.x*Oe,y:Qe.y*St})))},[Y,fe,N,r.width,r.height,f.width,f.height]),re=s.useMemo(()=>{if(m){const Mt=$r(m);if(Mt.length){const Qe=Co(Mt,r);return n==="circle"?Fs(Qe,f):Qe}}const Me=O.trim(),Oe=Me?zd(Me,o,r):null,St=Oe&&Oe.length?Oe:el(n==="custom"?"rectangle":n);return n==="circle"?Fs(St,f):St},[m,n,O,o,r,f.width,f.height]),J=s.useMemo(()=>{if(!fe||f.width<=0||f.height<=0)return re;const Me=N??f,Oe=r.width/Me.width,St=r.height/Me.height;return re.map(Mt=>Mt.map(Qe=>({x:Qe.x*Oe,y:Qe.y*St})))},[re,fe,N,r.width,r.height,f.width,f.height]),W=s.useRef(null),Se=s.useRef(!1);s.useEffect(()=>{if(!(!te||f.width<=0||f.height<=0)){if(fe){if(W.current===i)return;const Me=m??(i.trim()?ki(i):null);if(!(Me!=null&&Me.length))return;const Oe=un(Me,St=>({x:r.x+(St.x-r.x)/f.width*r.width,y:r.y+(St.y-r.y)/f.height*r.height}));W.current=Wo(Oe),te(Oe);return}!oe||!Y.length||Se.current||(Se.current=!0,te(un(Gp(Y),Me=>({x:Me.x*La,y:Me.y*La}))))}},[oe,fe,te,Y,m,i,r,f.width,f.height]);const le=s.useCallback(()=>{const Me=z;if(!Me)return;const Oe=Me.getBoundingClientRect(),St=window.getComputedStyle(Me),Mt=parseFloat(St.paddingTop)||0;ge(Bt=>Math.abs(Bt-Mt)<.5?Bt:Mt);const Qe=parseFloat(St.columnGap)||0;ce(Bt=>Math.abs(Bt-Qe)<.5?Bt:Qe);const kt={width:Oe.width,height:Oe.height};K(Bt=>Math.abs(Bt.width-kt.width)<.5&&Math.abs(Bt.height-kt.height)<.5?Bt:kt)},[z]);nr(()=>{const Me=z;if(!Me||typeof ResizeObserver>"u")return;le();const Oe=new ResizeObserver(le);return Oe.observe(Me),()=>Oe.disconnect()},[z,le]),nr(()=>{le()},[x,h,le]),s.useEffect(()=>{const Me=typeof document<"u"?document.fonts:void 0;Me!=null&&Me.ready&&Me.ready.then(()=>{xe(Oe=>Oe+1)})},[]),nr(()=>{const Me=M.current;if(!Me)return;if(!ie.length){ue(null);return}const Oe=[],St=document.createDocumentFragment();for(const Pt of ie){const Zt=document.createElement("span");Object.assign(Zt.style,su(Pt.leaf)),Zt.textContent=Pt.text,St.appendChild(Zt),Oe.push(Zt)}const Mt=document.createElement("span");Mt.textContent=" ",St.appendChild(Mt);const Qe=document.createElement("span");Qe.textContent="-",St.appendChild(Qe);const kt=$e||"H",Bt=document.createElement("span");Bt.textContent=kt,Bt.style.lineHeight="1",St.appendChild(Bt),Me.replaceChildren(St);const Wt=window.getComputedStyle(Me),At=parseFloat(Wt.fontSize)||16,Ae=parseFloat(Wt.lineHeight),ft=Number.isNaN(Ae)?At*1.2:Ae,gt=Math.max(ft,At),dt=document.createElement("span");dt.textContent=kt,dt.style.lineHeight=`${gt}px`;const yt=document.createElement("span");yt.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",dt.appendChild(yt),Me.appendChild(dt);const ut=dt.getBoundingClientRect().top,it=yt.getBoundingClientRect().top,Nt=Math.max(1,it-ut);dt.remove();let $t=Nt*.8;const Xt=document.createElement("canvas").getContext("2d"),Dt=Pt=>`${Wt.fontStyle} ${Wt.fontWeight} ${Pt}px ${Wt.fontFamily}`;if(Xt){Xt.font=Dt(At);const Pt=Xt.measureText(kt).actualBoundingBoxAscent;Pt>0&&($t=Pt)}const jt=v>1?(v-1)*gt+$t:$t;let Ot=At*(jt/$t);if(Xt){Xt.font=Dt(Ot);const Pt=Xt.measureText(kt).actualBoundingBoxAscent;Pt>0&&(Ot=Ot*(jt/Pt))}Bt.style.fontSize=`${Ot}px`,Bt.style.lineHeight=`${Ot}px`;const zt=document.createElement("span");zt.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",Bt.appendChild(zt);const D=Math.max(1,zt.getBoundingClientRect().top-Bt.getBoundingClientRect().top);zt.remove();const Be=(v-1)*gt+Nt-D,ke=Oe.map(Pt=>Pt.getBoundingClientRect().width),vt=Mt.getBoundingClientRect().width,Ct=Qe.getBoundingClientRect().width,at=$e?Bt.getBoundingClientRect().width:0,Tt=(f.width-k*(g-1))/g,Vt=Oe.map((Pt,Zt)=>{var pi;const on=Pt.firstChild;if(!(on instanceof Text)||on.data.length<2||!(ke[Zt]>Tt-.5)&&!((pi=Ce[Zt])!=null&&pi.length))return;const xn=document.createRange(),ui=Pt.getBoundingClientRect().left,dn=[];for(let Kn=1;Kn<=on.data.length;Kn+=1)xn.setStart(on,0),xn.setEnd(on,Kn),dn.push(xn.getBoundingClientRect().right-ui);return dn});Me.replaceChildren(),ue({widths:ke,spaceWidth:vt,dashWidth:Ct,charWidths:Vt,lineHeight:gt,capWidth:at,dropCapFontSize:Ot,dropCapTopAdjust:Be})},[ie,P,$e,_,v,ee,f.width,b,Ce,g,k]);const j=I&&$e?I.capWidth+I.lineHeight*LT:0,Te=Math.max(_,Math.ceil(v)),Fe=s.useMemo(()=>{if(!I||!ie.length||f.width<=0||f.height<=0||!u)return 1;const Me=Mt=>cu({tokens:ie,widths:I.widths,spaceWidth:I.spaceWidth,lineHeight:I.lineHeight,width:f.width,height:f.height,rings:ne,mode:l,align:c,scale:Mt,allowOverflow:!1,capInset:j*Mt,capLines:$e?Te:0,hyphenate:b,charWidths:I.charWidths,hyphenPoints:Ce,hyphenWidth:I.dashWidth,shapeMargin:G,columns:g,columnGap:k});if(Me(1).placed>=ie.length)return 1;if(Me(As).placed<ie.length)return As;let Oe=As,St=1;for(let Mt=0;Mt<MT;Mt+=1){const Qe=(Oe+St)/2;Me(Qe).placed>=ie.length?Oe=Qe:St=Qe}return Oe},[I,ie,f.width,f.height,ne,l,c,u,j,$e,Te,b,Ce,G,g,k]);s.useEffect(()=>{y(Fe)},[Fe,y]);const Ye=u?Math.min(p,Fe):1,De=s.useMemo(()=>!I||!ie.length||f.width<=0||f.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0,renderTokens:ie}:cu({tokens:ie,widths:I.widths,spaceWidth:I.spaceWidth,lineHeight:I.lineHeight,width:f.width,height:f.height,rings:ne,mode:l,align:c,scale:Ye,allowOverflow:d,capInset:j*Ye,capLines:$e?Te:0,hyphenate:b,charWidths:I.charWidths,hyphenPoints:Ce,hyphenWidth:I.dashWidth,shapeMargin:G,columns:g,columnGap:k}),[I,ie,f.width,f.height,ne,l,c,Ye,d,j,$e,Te,b,Ce,G,g,k]),ze=S&&ie.length>0&&De.placed<ie.length,Ze=I?I.dropCapFontSize*Ye:0,Ue=I?I.dropCapTopAdjust*Ye:0,ye=c==="justify"?"left":c,_e=I?I.lineHeight*Ye:0,Ve=De.segments.length?De.segments[De.segments.length-1]:null,Je=Ve?{top:Ve.top+_e,left:Ve.left+Ve.width/2}:{top:f.height,left:f.width/2},et=!!(T&&m&&f.width>0&&f.height>0),ot=!!w,lt=(et||ot)&&f.width>0&&f.height>0,Ke=kT(z,lt),ht=lt&&Ke?AT():null,tt=s.useRef(!1),Ge=s.useCallback(Me=>{tt.current=Me},[]);s.useEffect(()=>{if(!et&&!ot)return;const Me=Oe=>{const St=z;if(!St)return;const Mt=St.getBoundingClientRect();Oe.clientX>=Mt.left&&Oe.clientX<=Mt.right&&Oe.clientY>=Mt.top&&Oe.clientY<=Mt.bottom&&(Oe.preventDefault(),Oe.stopPropagation(),se(kt=>kt==="shape"&&tt.current?kt:kt==="shape"&&ot?"image":et?"shape":"image"))};return document.addEventListener("dblclick",Me,!0),()=>document.removeEventListener("dblclick",Me,!0)},[et,ot,z]);const We=s.useMemo(()=>q&&f.width>0&&f.height>0?yC(J,f):null,[q,J,f.width,f.height]),Ne=s.useRef(null),be=(()=>{const Me=Ne.current;return Q||!C||!w||!de||!We||!Me||O===Me.customPath||Me.shape!==n&&n!=="custom"?null:eT(Me.bounds,We,de,Me.focalX,Me.focalY,Me.scale)})();nr(()=>{if(!w){Ne.current=null;return}if($||!de||!We)return;const Me=Ne.current,Oe=!!(Me&&O!==Me.customPath);Oe&&be&&w.onCommit(be),Oe&&Q&&(R==null||R()),Ne.current={rings:J,bounds:We,focalX:(be==null?void 0:be.focalX)??X,focalY:(be==null?void 0:be.focalY)??B,scale:(be==null?void 0:be.scale)??H,customPath:O,shape:n}},[$,Q,O,n,J,We,w,de,X,B,H,be,R]);const He=Ne.current,Xe=!!($&&!Q&&He&&!be),ct=Xe&&He?He.focalX:(be==null?void 0:be.focalX)??X,rt=Xe&&He?He.focalY:(be==null?void 0:be.focalY)??B,xt=Xe&&He?He.scale:(be==null?void 0:be.scale)??H,pt=Xe&&He?He.bounds:We,It=s.useMemo(()=>{if(!(f.width>0)||!(f.height>0))return"";let Me=jd(i,m,o,r,n,f);if(fe){const Oe=N??f,St=r.width/Oe.width,Mt=r.height/Oe.height;Me=un(Me,Qe=>({x:Qe.x*St,y:Qe.y*Mt}))}return Vd(Me,f)||Dd(ne,f)},[i,m,o,r,n,f.width,f.height,fe,N,ne]),nt=s.useMemo(()=>{if(!q||!(f.width>0)||!(f.height>0))return"";let Me=jd(O,m,o,r,n,f);if(fe){const Oe=N??f,St=r.width/Oe.width,Mt=r.height/Oe.height;Me=un(Me,Qe=>({x:Qe.x*St,y:Qe.y*Mt}))}return Vd(Me,f)||Dd(J,f)},[q,O,m,o,r,n,f.width,f.height,fe,N,J]),bt=`${V}-clip`,Lt=s.useMemo(()=>{if(!pt)return null;const Me=de??{width:pt.width,height:pt.height},Oe=Ui(pt,Me,xt);return{x:jn(pt.width,Oe.width,ct),y:jn(pt.height,Oe.height,rt),width:Oe.width,height:Oe.height}},[pt,de,ct,rt,xt]);return a.jsxs("div",{className:`${e}-column`,style:{padding:x,columnGap:h},lang:Ee,ref:U,children:[It?a.jsxs("svg",{className:`${e}-shape-fill`,style:{top:0,left:0,width:f.width,height:f.height},viewBox:`0 0 ${f.width} ${f.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("path",{className:`${e}-shape-fill-path`,d:It,fillRule:"evenodd"}),q&&nt&&pt&&Lt?a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsx("clipPath",{id:bt,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:nt,fillRule:"evenodd"})})}),a.jsx("image",{href:q,x:pt.x+Lt.x,y:pt.y+Lt.y,width:Lt.width,height:Lt.height,preserveAspectRatio:"none",clipPath:`url(#${bt})`})]}):null]}):null,a.jsxs("div",{className:`${e}-flow${d?"":` ${e}-clip`}`,style:{...P,["--"+e+"-fit"]:Ye,top:0,left:0,width:f.width,height:f.height},children:[a.jsx("div",{className:`${e}-measure`,ref:M,style:P,"aria-hidden":!0}),De.segments.map((Me,Oe)=>{const St=De.renderTokens.slice(Me.from,Me.to),Mt=Oe===0;return a.jsx("div",{className:`${e}-line${Me.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${Me.top}px`,left:`${Me.left}px`,width:`${Me.width}px`,textAlign:Me.justify?void 0:ye},children:St.map((Qe,kt)=>{const Wt=$e&&Mt&&Me.from===0&&kt===0?Qe.text.slice(1):Qe.text,At=su(Qe.leaf),Ae=Qe.href?a.jsx("a",{className:`${e}-link`,href:Qe.href,target:Qe.target,rel:Qe.target?"noopener noreferrer":void 0,style:At,children:Wt}):a.jsx("span",{style:At,children:Wt});return a.jsxs("span",{children:[!Me.justify&&kt>0?" ":null,Ae]},kt)})},`${Me.from}-${Me.to}-${Oe}`)}),L&&!m&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:ne.map((Me,Oe)=>a.jsx("polygon",{points:Me.map(St=>`${St.x},${St.y}`).join(" ")},Oe))})]}),$e&&I&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...P,top:`${De.capTop+Ue}px`,left:`${De.capLeft}px`,fontSize:`${Ze}px`,lineHeight:`${Ze}px`},children:$e}),ht&&Ke&&(m&&T||w)&&qn.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:Ke.top,left:Ke.left,width:Ke.width,height:Ke.height,zIndex:PT,pointerEvents:"none"},children:[m&&T&&a.jsx(xT,{P:e,box:{width:Ke.width,height:Ke.height},viewBox:r,contours:m,snap:T.snap,stretchToBox:!fe,uniformStretch:n==="circle",stage:Le,onStageChange:se,onSelectionChange:Ge,onChange:T.onChange,onCommit:T.onCommit}),w&&pt&&a.jsx(gT,{P:e,box:{width:Ke.width,height:Ke.height},bounds:pt,natural:de,imageUrl:q,maskPath:nt,stage:Le,onStageChange:se,focalX:ct,focalY:rt,scale:xt,onChange:w.onChange,onCommit:w.onCommit})]}),ht),a.jsx("div",{className:`${e}-a11y`,children:me.map((Me,Oe)=>a.jsx("p",{children:Me},Oe))}),ze&&a.jsxs("svg",{className:`${e}-overflow-icon`,width:"33",height:"24",viewBox:"0 0 33 24",style:{top:Je.top,left:Je.left},"aria-hidden":!0,children:[a.jsx("path",{d:"M12.8,4 L20.2,4 C24.68042,4 26.9206301,4 28.631924,4.87194781 C31.3123488,6.23769248 33,8.99168887 33,12 C33,15.0083111 31.3123488,17.7623075 28.631924,19.1280522 C26.9206301,20 24.68042,20 20.2,20 L12.8,20 C8.31957995,20 6.07936993,20 4.368076,19.1280522 C1.68765116,17.7623075 0,15.0083111 0,12 C0,8.99168887 1.68765116,6.23769248 4.368076,4.87194781 C6.07936993,4 8.31957995,4 12.8,4 Z",fill:"#FF4400"}),a.jsx("path",{transform:"translate(5, 0)",fill:"#FFFFFF",d:"M12,5.625 C12.3846269,5.625 12.7016304,5.91453014 12.7449542,6.28753416 L12.75,6.375 L12.75,11.25 L17.625,11.25 C18.0392136,11.25 18.375,11.5857864 18.375,12 C18.375,12.3846269 18.0854699,12.7016304 17.7124658,12.7449542 L17.625,12.75 L12.75,12.75 L12.75,17.625 C12.75,18.0392136 12.4142136,18.375 12,18.375 C11.6153731,18.375 11.2983696,18.0854699 11.2550458,17.7124658 L11.25,17.625 L11.25,12.75 L6.375,12.75 C5.96078644,12.75 5.625,12.4142136 5.625,12 C5.625,11.6153731 5.91453014,11.2983696 6.28753416,11.2550458 L6.375,11.25 L11.25,11.25 L11.25,6.375 C11.25,5.96078644 11.5857864,5.625 12,5.625 Z"})]})]})}const Qp=["diamond","parallelogram","vase","circle","shield","bobbin","custom"],NT={x:0,y:0,width:100,height:100},_T=e=>{const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?NT:{x:t[0],y:t[1],width:t[2],height:t[3]}},HT=e=>`
|
|
27799
27795
|
.${e}-wrapper {
|
|
27800
27796
|
box-sizing: border-box;
|
|
27801
27797
|
display: flex;
|