@cntrl-site/components 1.0.75 → 1.0.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.js +35 -26
  2. package/dist/index.mjs +367 -352
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),yt=require("classnames"),D=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Vn=require("react-dom");function Hu(e){return e.type==="object"&&e.version===1}const Ou="ControlSlider-module__wrapper___sHEkd",Du="ControlSlider-module__hoverArrow___A-dOH",ju="ControlSlider-module__sliderItem___QQSkR",zu="ControlSlider-module__sliderImage___9hRl-",Bu="ControlSlider-module__arrow___05ghY",Vu="ControlSlider-module__arrowVertical___tBfVN",Gu="ControlSlider-module__nextArrow___-30Yc",qu="ControlSlider-module__arrowInner___aEra3",Xu="ControlSlider-module__arrowIcon___S4ztF",Uu="ControlSlider-module__arrowImg___2dwJW",Yu="ControlSlider-module__mirror___brd6U",Ku="ControlSlider-module__pagination___bicLF",Zu="ControlSlider-module__paginationInner___bT-P-",Ju="ControlSlider-module__paginationVertical___zYqKw",Qu="ControlSlider-module__paginationItem___nTRbk",ep="ControlSlider-module__dot___p1Qun",tp="ControlSlider-module__activeDot___LHFaj",np="ControlSlider-module__paginationInsideBottom___R3FWn",ip="ControlSlider-module__paginationInsideTop___V-qb-",op="ControlSlider-module__paginationOutsideBottom___14w8D",rp="ControlSlider-module__paginationOutsideTop___SCLqB",ap="ControlSlider-module__paginationInsideLeft___yOBRZ",sp="ControlSlider-module__paginationInsideRight___Rtt3o",lp="ControlSlider-module__paginationOutsideLeft___lahaw",cp="ControlSlider-module__paginationOutsideRight___EtuQa",dp="ControlSlider-module__imgWrapper___UjEgB",up="ControlSlider-module__captionBlock___dJ6-j",pp="ControlSlider-module__captionTextWrapper___HFlpf",mp="ControlSlider-module__captionText___uGBVc",gp="ControlSlider-module__active___WZK4G",hp="ControlSlider-module__withPointerEvents___t-18M",fp="ControlSlider-module__topLeftAlignment___zjnGM",yp="ControlSlider-module__topCenterAlignment___gD1xW",vp="ControlSlider-module__topRightAlignment___NMapS",xp="ControlSlider-module__middleLeftAlignment___OnUrY",bp="ControlSlider-module__middleCenterAlignment___Tdkl0",wp="ControlSlider-module__middleRightAlignment___wEbfX",Sp="ControlSlider-module__bottomLeftAlignment___cTP2-",$p="ControlSlider-module__bottomCenterAlignment___c54fB",Cp="ControlSlider-module__bottomRightAlignment___kEwrz",Tp="ControlSlider-module__clickOverlay___DZA28",Lp="ControlSlider-module__contain___pLyq7",Rp="ControlSlider-module__cover___KdDat",ht={wrapper:Ou,hoverArrow:Du,sliderItem:ju,sliderImage:zu,arrow:Bu,arrowVertical:Vu,nextArrow:Gu,arrowInner:qu,arrowIcon:Xu,arrowImg:Uu,mirror:Yu,pagination:Ku,paginationInner:Zu,paginationVertical:Ju,paginationItem:Qu,dot:ep,activeDot:tp,paginationInsideBottom:np,paginationInsideTop:ip,paginationOutsideBottom:op,paginationOutsideTop:rp,paginationInsideLeft:ap,paginationInsideRight:sp,paginationOutsideLeft:lp,paginationOutsideRight:cp,imgWrapper:dp,captionBlock:up,captionTextWrapper:pp,captionText:mp,active:gp,withPointerEvents:hp,topLeftAlignment:fp,topCenterAlignment:yp,topRightAlignment:vp,middleLeftAlignment:xp,middleCenterAlignment:bp,middleRightAlignment:wp,bottomLeftAlignment:Sp,bottomCenterAlignment:$p,bottomRightAlignment:Cp,clickOverlay:Tp,contain:Lp,cover:Rp};function Ip(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Ep(e,t,n){return t&&Ip(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var sl="(prefers-reduced-motion: reduce)",ji=1,Mp=2,Ki=3,uo=4,Go=5,Er=6,Wr=7,Pp={CREATED:ji,MOUNTED:Mp,IDLE:Ki,MOVING:uo,SCROLLING:Go,DRAGGING:Er,DESTROYED:Wr};function zn(e){e.length=0}function ai(e,t,n){return Array.prototype.slice.call(e,t,n)}function Ut(e){return e.bind.apply(e,[null].concat(ai(arguments,1)))}var Qc=setTimeout,Za=function(){};function ll(e){return requestAnimationFrame(e)}function Yr(e,t){return typeof t===e}function ko(e){return!Ts(e)&&Yr("object",e)}var Cs=Array.isArray,ed=Ut(Yr,"function"),ti=Ut(Yr,"string"),qo=Ut(Yr,"undefined");function Ts(e){return e===null}function td(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Xo(e){return Cs(e)?e:[e]}function bn(e,t){Xo(e).forEach(t)}function Ls(e,t){return e.indexOf(t)>-1}function Mr(e,t){return e.push.apply(e,Xo(t)),e}function Nn(e,t,n){e&&bn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Pn(e,t){Nn(e,ti(t)?t.split(" "):t,!0)}function Uo(e,t){bn(t,e.appendChild.bind(e))}function Rs(e,t){bn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function Ao(e,t){return td(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function nd(e,t){var n=e?ai(e.children):[];return t?n.filter(function(i){return Ao(i,t)}):n}function Yo(e,t){return t?nd(e,t)[0]:e.firstElementChild}var Fo=Object.keys;function $i(e,t,n){return e&&(n?Fo(e).reverse():Fo(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function _o(e){return ai(arguments,1).forEach(function(t){$i(t,function(n,i){e[i]=t[i]})}),e}function Kn(e){return ai(arguments,1).forEach(function(t){$i(t,function(n,i){Cs(n)?e[i]=n.slice():ko(n)?e[i]=Kn({},ko(e[i])?e[i]:{},n):e[i]=n})}),e}function cl(e,t){bn(t||Fo(e),function(n){delete e[n]})}function kn(e,t){bn(e,function(n){bn(t,function(i){n&&n.removeAttribute(i)})})}function Ct(e,t,n){ko(t)?$i(t,function(i,o){Ct(e,o,i)}):bn(e,function(i){Ts(n)||n===""?kn(i,t):i.setAttribute(t,String(n))})}function Gi(e,t,n){var i=document.createElement(e);return t&&(ti(t)?Pn(i,t):Ct(i,t)),n&&Uo(n,i),i}function Sn(e,t,n){if(qo(n))return getComputedStyle(e)[t];Ts(n)||(e.style[t]=""+n)}function Wo(e,t){Sn(e,"display",t)}function id(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function $n(e,t){return e.getAttribute(t)}function dl(e,t){return e&&e.classList.contains(t)}function fn(e){return e.getBoundingClientRect()}function Ti(e){bn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function od(e){return Yo(new DOMParser().parseFromString(e,"text/html").body)}function Wn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function rd(e,t){return e&&e.querySelector(t)}function Is(e,t){return t?ai(e.querySelectorAll(t)):[]}function Hn(e,t){Nn(e,t,!1)}function Ja(e){return e.timeStamp}function pi(e){return ti(e)?e:e?e+"px":""}var Ko="splide",Es="data-"+Ko;function Io(e,t){if(!e)throw new Error("["+Ko+"] "+(t||""))}var ni=Math.min,Nr=Math.max,Hr=Math.floor,No=Math.ceil,un=Math.abs;function ad(e,t,n){return un(e-t)<n}function Pr(e,t,n,i){var o=ni(t,n),r=Nr(t,n);return i?o<e&&e<r:o<=e&&e<=r}function Ni(e,t,n){var i=ni(t,n),o=Nr(t,n);return ni(Nr(i,e),o)}function Qa(e){return+(e>0)-+(e<0)}function es(e,t){return bn(t,function(n){e=e.replace("%s",""+n)}),e}function Ms(e){return e<10?"0"+e:""+e}var ul={};function kp(e){return""+e+Ms(ul[e]=(ul[e]||0)+1)}function sd(){var e=[];function t(l,d,c,u){o(l,d,function(p,b,v){var g="addEventListener"in p,h=g?p.removeEventListener.bind(p,b,c,u):p.removeListener.bind(p,c);g?p.addEventListener(b,c,u):p.addListener(c),e.push([p,b,v,c,h])})}function n(l,d,c){o(l,d,function(u,p,b){e=e.filter(function(v){return v[0]===u&&v[1]===p&&v[2]===b&&(!c||v[3]===c)?(v[4](),!1):!0})})}function i(l,d,c){var u,p=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:p,detail:c}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,p,!1,c)),l.dispatchEvent(u),u}function o(l,d,c){bn(l,function(u){u&&bn(d,function(p){p.split(" ").forEach(function(b){var v=b.split(".");c(u,v[0],v[1])})})})}function r(){e.forEach(function(l){l[4]()}),zn(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var si="mounted",ts="ready",Bn="move",po="moved",Ps="click",ld="active",cd="inactive",dd="visible",ud="hidden",Qt="refresh",cn="updated",Zi="resize",Kr="resized",pd="drag",md="dragging",gd="dragged",Zr="scroll",Ii="scrolled",Ap="overflow",ks="destroy",hd="arrows:mounted",fd="arrows:updated",yd="pagination:mounted",vd="pagination:updated",As="navigation:mounted",Fs="autoplay:play",xd="autoplay:playing",_s="autoplay:pause",Ws="lazyload:loaded",bd="sk",wd="sh",Or="ei";function Kt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=sd();function i(r,l){n.bind(t,Xo(r).join(" "),function(d){l.apply(l,Cs(d.detail)?d.detail:[])})}function o(r){n.dispatch(t,r,ai(arguments,1))}return e&&e.event.on(ks,n.destroy),_o(n,{bus:t,on:i,off:Ut(n.unbind,t),emit:o})}function Jr(e,t,n,i){var o=Date.now,r,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?ni((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return v();d=ll(p)}}function b(S){S||h(),r=o()-(S?l*e:0),c=!1,d=ll(p)}function v(){c=!0}function g(){r=o(),l=0,n&&n(l)}function h(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function f(S){e=S}function x(){return c}return{start:b,rewind:g,pause:v,cancel:h,set:f,isPaused:x}}function Fp(e){var t=e;function n(o){t=o}function i(o){return Ls(Xo(o),t)}return{set:n,is:i}}function _p(e,t){var n=Jr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Wp(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=sd(),d=[];function c(){var h=n.mediaQuery==="min";Fo(o).sort(function(f,x){return h?+f-+x:+x-+f}).forEach(function(f){p(o[f],"("+(h?"min":"max")+"-width:"+f+"px)")}),p(r,sl),b()}function u(h){h&&l.destroy()}function p(h,f){var x=matchMedia(f);l.bind(x,"change",b),d.push([h,x])}function b(){var h=i.is(Wr),f=n.direction,x=d.reduce(function(S,y){return Kn(S,y[1].matches?y[0]:{})},{});cl(n),g(x),n.destroy?e.destroy(n.destroy==="completely"):h?(u(!0),e.mount()):f!==n.direction&&e.refresh()}function v(h){matchMedia(sl).matches&&(h?Kn(n,r):cl(n,Fo(r)))}function g(h,f,x){Kn(n,h),f&&Kn(Object.getPrototypeOf(n),h),(x||!i.is(ji))&&e.emit(cn,n)}return{setup:c,destroy:u,reduce:v,set:g}}var Qr="Arrow",ea=Qr+"Left",ta=Qr+"Right",Sd=Qr+"Up",$d=Qr+"Down",pl="rtl",na="ttb",ha={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Sd,ta],ArrowRight:[$d,ea]};function Np(e,t,n){function i(r,l,d){d=d||n.direction;var c=d===pl&&!l?1:d===na?0:-1;return ha[r]&&ha[r][c]||r.replace(/width|left|right/i,function(u,p){var b=ha[u.toLowerCase()][c]||u;return p>0?b.charAt(0).toUpperCase()+b.slice(1):b})}function o(r){return r*(n.direction===pl?1:-1)}return{resolve:i,orient:o}}var On="role",qi="tabindex",Hp="disabled",Cn="aria-",Zo=Cn+"controls",Cd=Cn+"current",ml=Cn+"selected",vn=Cn+"label",Ns=Cn+"labelledby",Td=Cn+"hidden",Hs=Cn+"orientation",Ho=Cn+"roledescription",gl=Cn+"live",hl=Cn+"busy",fl=Cn+"atomic",Os=[On,qi,Hp,Zo,Cd,vn,Ns,Td,Hs,Ho],Fn=Ko+"__",li="is-",fa=Ko,yl=Fn+"track",Op=Fn+"list",ia=Fn+"slide",Ld=ia+"--clone",Dp=ia+"__container",Ds=Fn+"arrows",oa=Fn+"arrow",Rd=oa+"--prev",Id=oa+"--next",ra=Fn+"pagination",Ed=ra+"__page",jp=Fn+"progress",zp=jp+"__bar",Bp=Fn+"toggle",Vp=Fn+"spinner",Gp=Fn+"sr",qp=li+"initialized",Li=li+"active",Md=li+"prev",Pd=li+"next",ns=li+"visible",is=li+"loading",kd=li+"focus-in",Ad=li+"overflow",Xp=[Li,ns,Md,Pd,is,kd,Ad],Up={slide:ia,clone:Ld,arrows:Ds,arrow:oa,prev:Rd,next:Id,pagination:ra,page:Ed,spinner:Vp};function Yp(e,t){if(ed(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!Ao(n,t);)n=n.parentElement;return n}var Kp=5,vl=200,Fd="touchstart mousedown",ya="touchmove mousemove",va="touchend touchcancel mouseup click";function Zp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],b=[],v,g,h;function f(){w(),H(),y()}function x(){o(Qt,S),o(Qt,f),o(cn,y),r(document,Fd+" keydown",function(O){h=O.type==="keydown"},{capture:!0}),r(l,"focusin",function(){Nn(l,kd,!!h)})}function S(O){var C=Os.concat("style");zn(u),Hn(l,p),Hn(v,b),kn([v,g],C),kn(l,O?C:["style",Ho])}function y(){Hn(l,p),Hn(v,b),p=Y(fa),b=Y(yl),Pn(l,p),Pn(v,b),Ct(l,vn,n.label),Ct(l,Ns,n.labelledby)}function w(){v=N("."+yl),g=Yo(v,"."+Op),Io(v&&g,"A track/list element is missing."),Mr(u,nd(g,"."+ia+":not(."+Ld+")")),$i({arrows:Ds,pagination:ra,prev:Rd,next:Id,bar:zp,toggle:Bp},function(O,C){c[C]=N("."+O)}),_o(c,{root:l,track:v,list:g,slides:u})}function H(){var O=l.id||kp(Ko),C=n.role;l.id=O,v.id=v.id||O+"-track",g.id=g.id||O+"-list",!$n(l,On)&&l.tagName!=="SECTION"&&C&&Ct(l,On,C),Ct(l,Ho,d.carousel),Ct(g,On,"presentation")}function N(O){var C=rd(l,O);return C&&Yp(C,"."+fa)===l?C:void 0}function Y(O){return[O+"--"+n.type,O+"--"+n.direction,n.drag&&O+"--draggable",n.isNavigation&&O+"--nav",O===fa&&Li]}return _o(c,{setup:f,mount:x,destroy:S})}var Ji="slide",mo="loop",Jo="fade";function Jp(e,t,n,i){var o=Kt(e),r=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,b=p.isNavigation,v=p.updateOnMove,g=p.i18n,h=p.pagination,f=p.slideFocus,x=c.Direction.resolve,S=$n(i,"style"),y=$n(i,vn),w=n>-1,H=Yo(i,"."+Dp),N;function Y(){w||(i.id=u.id+"-slide"+Ms(t+1),Ct(i,On,h?"tabpanel":"group"),Ct(i,Ho,g.slide),Ct(i,vn,y||es(g.slideLabel,[t+1,e.length]))),O()}function O(){d(i,"click",Ut(l,Ps,ne)),d(i,"keydown",Ut(l,bd,ne)),r([po,wd,Ii],R),r(As,V),v&&r(Bn,$)}function C(){N=!0,o.destroy(),Hn(i,Xp),kn(i,Os),Ct(i,"style",S),Ct(i,vn,y||"")}function V(){var I=e.splides.map(function(W){var K=W.splide.Components.Slides.getAt(t);return K?K.slide.id:""}).join(" ");Ct(i,vn,es(g.slideX,(w?n:t)+1)),Ct(i,Zo,I),Ct(i,On,f?"button":""),f&&kn(i,Ho)}function $(){N||R()}function R(){if(!N){var I=e.index;k(),T(),Nn(i,Md,t===I-1),Nn(i,Pd,t===I+1)}}function k(){var I=M();I!==dl(i,Li)&&(Nn(i,Li,I),Ct(i,Cd,b&&I||""),l(I?ld:cd,ne))}function T(){var I=E(),W=!I&&(!M()||w);if(e.state.is([uo,Go])||Ct(i,Td,W||""),Ct(Is(i,p.focusableNodes||""),qi,W?-1:""),f&&Ct(i,qi,W?-1:0),I!==dl(i,ns)&&(Nn(i,ns,I),l(I?dd:ud,ne)),!I&&document.activeElement===i){var K=c.Slides.getAt(e.index);K&&id(K.slide)}}function m(I,W,K){Sn(K&&H||i,I,W)}function M(){var I=e.index;return I===t||p.cloneStatus&&I===n}function E(){if(e.is(Jo))return M();var I=fn(c.Elements.track),W=fn(i),K=x("left",!0),ae=x("right",!0);return Hr(I[K])<=No(W[K])&&Hr(W[ae])<=No(I[ae])}function z(I,W){var K=un(I-t);return!w&&(p.rewind||e.is(mo))&&(K=ni(K,e.length-K)),K<=W}var ne={index:t,slideIndex:n,slide:i,container:H,isClone:w,mount:Y,destroy:C,update:R,style:m,isWithin:z};return ne}function Qp(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function b(){v(),o(Qt,g),o(Qt,v)}function v(){c.forEach(function(R,k){f(R,k,-1)})}function g(){N(function(R){R.destroy()}),zn(p)}function h(){N(function(R){R.update()})}function f(R,k,T){var m=Jp(e,k,T,R);m.mount(),p.push(m),p.sort(function(M,E){return M.index-E.index})}function x(R){return R?Y(function(k){return!k.isClone}):p}function S(R){var k=t.Controller,T=k.toIndex(R),m=k.hasFocus()?1:n.perPage;return Y(function(M){return Pr(M.index,T,T+m-1)})}function y(R){return Y(R)[0]}function w(R,k){bn(R,function(T){if(ti(T)&&(T=od(T)),td(T)){var m=c[k];m?Rs(T,m):Uo(u,T),Pn(T,n.classes.slide),C(T,Ut(r,Zi))}}),r(Qt)}function H(R){Ti(Y(R).map(function(k){return k.slide})),r(Qt)}function N(R,k){x(k).forEach(R)}function Y(R){return p.filter(ed(R)?R:function(k){return ti(R)?Ao(k.slide,R):Ls(Xo(R),k.index)})}function O(R,k,T){N(function(m){m.style(R,k,T)})}function C(R,k){var T=Is(R,"img"),m=T.length;m?T.forEach(function(M){l(M,"load error",function(){--m||k()})}):k()}function V(R){return R?c.length:p.length}function $(){return p.length>n.perPage}return{mount:b,destroy:g,update:h,register:f,get:x,getIn:S,getAt:y,add:w,remove:H,forEach:N,filter:Y,style:O,getLength:V,isEnough:$}}function em(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,b=u.track,v=u.list,g=d.getAt,h=d.style,f,x,S;function y(){w(),r(window,"resize load",_p(Ut(l,Zi))),o([cn,Qt],w),o(Zi,H)}function w(){f=n.direction===na,Sn(p,"maxWidth",pi(n.width)),Sn(b,c("paddingLeft"),N(!1)),Sn(b,c("paddingRight"),N(!0)),H(!0)}function H(ne){var I=fn(p);(ne||x.width!==I.width||x.height!==I.height)&&(Sn(b,"height",Y()),h(c("marginRight"),pi(n.gap)),h("width",C()),h("height",V(),!0),x=I,l(Kr),S!==(S=z())&&(Nn(p,Ad,S),l(Ap,S)))}function N(ne){var I=n.padding,W=c(ne?"right":"left");return I&&pi(I[W]||(ko(I)?0:I))||"0px"}function Y(){var ne="";return f&&(ne=O(),Io(ne,"height or heightRatio is missing."),ne="calc("+ne+" - "+N(!1)+" - "+N(!0)+")"),ne}function O(){return pi(n.height||fn(v).width*n.heightRatio)}function C(){return n.autoWidth?null:pi(n.fixedWidth)||(f?"":$())}function V(){return pi(n.fixedHeight)||(f?n.autoHeight?null:$():O())}function $(){var ne=pi(n.gap);return"calc((100%"+(ne&&" + "+ne)+")/"+(n.perPage||1)+(ne&&" - "+ne)+")"}function R(){return fn(v)[c("width")]}function k(ne,I){var W=g(ne||0);return W?fn(W.slide)[c("width")]+(I?0:M()):0}function T(ne,I){var W=g(ne);if(W){var K=fn(W.slide)[c("right")],ae=fn(v)[c("left")];return un(K-ae)+(I?0:M())}return 0}function m(ne){return T(e.length-1)-T(0)+k(0,ne)}function M(){var ne=g(0);return ne&&parseFloat(Sn(ne.slide,c("marginRight")))||0}function E(ne){return parseFloat(Sn(b,c("padding"+(ne?"Right":"Left"))))||0}function z(){return e.is(Jo)||m(!0)>R()}return{mount:y,resize:H,listSize:R,slideSize:k,sliderSize:m,totalSize:T,getPadding:E,isOverflow:z}}var tm=2;function nm(e,t,n){var i=Kt(e),o=i.on,r=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(Qt,b),o([cn,Zi],g),(u=x())&&(h(u),t.Layout.resize(!0))}function b(){v(),p()}function v(){Ti(c),zn(c),i.destroy()}function g(){var S=x();u!==S&&(u<S||!S)&&i.emit(Qt)}function h(S){var y=l.get().slice(),w=y.length;if(w){for(;y.length<S;)Mr(y,y);Mr(y.slice(-S),y.slice(0,S)).forEach(function(H,N){var Y=N<S,O=f(H.slide,N);Y?Rs(O,y[0].slide):Uo(r.list,O),Mr(c,O),l.register(O,N-S+(Y?0:w),H.index)})}}function f(S,y){var w=S.cloneNode(!0);return Pn(w,n.classes.clone),w.id=e.root.id+"-clone"+Ms(y+1),w}function x(){var S=n.clones;if(!e.is(mo))S=0;else if(qo(S)){var y=n[d("fixedWidth")]&&t.Layout.slideSize(0),w=y&&No(fn(r.track)[d("width")]/y);S=w||n[d("autoWidth")]&&e.length||n.perPage*tm}return S}return{mount:p,destroy:v}}function im(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,b=d.listSize,v=d.sliderSize,g=t.Direction,h=g.resolve,f=g.orient,x=t.Elements,S=x.list,y=x.track,w;function H(){w=t.Transition,o([si,Kr,cn,Qt],N)}function N(){t.Controller.isBusy()||(t.Scroll.cancel(),O(e.index),t.Slides.update())}function Y(W,K,ae,de){W!==K&&ne(W>ae)&&(R(),C($(m(),W>ae),!0)),l(uo),r(Bn,K,ae,W),w.start(K,function(){l(Ki),r(po,K,ae,W),de&&de()})}function O(W){C(T(W,!0))}function C(W,K){if(!e.is(Jo)){var ae=K?W:V(W);Sn(S,"transform","translate"+h("X")+"("+ae+"px)"),W!==ae&&r(wd)}}function V(W){if(e.is(mo)){var K=k(W),ae=K>t.Controller.getEnd(),de=K<0;(de||ae)&&(W=$(W,ae))}return W}function $(W,K){var ae=W-z(K),de=v();return W-=f(de*(No(un(ae)/de)||1))*(K?1:-1),W}function R(){C(m(),!0),w.cancel()}function k(W){for(var K=t.Slides.get(),ae=0,de=1/0,A=0;A<K.length;A++){var he=K[A].index,q=un(T(he,!0)-W);if(q<=de)de=q,ae=he;else break}return ae}function T(W,K){var ae=f(p(W-1)-E(W));return K?M(ae):ae}function m(){var W=h("left");return fn(S)[W]-fn(y)[W]+f(u(!1))}function M(W){return n.trimSpace&&e.is(Ji)&&(W=Ni(W,0,f(v(!0)-b()))),W}function E(W){var K=n.focus;return K==="center"?(b()-c(W,!0))/2:+K*c(W)||0}function z(W){return T(W?t.Controller.getEnd():0,!!n.trimSpace)}function ne(W){var K=f($(m(),W));return W?K>=0:K<=S[h("scrollWidth")]-fn(y)[h("width")]}function I(W,K){K=qo(K)?m():K;var ae=W!==!0&&f(K)<f(z(!1)),de=W!==!1&&f(K)>f(z(!0));return ae||de}return{mount:H,move:Y,jump:O,translate:C,shift:$,cancel:R,toIndex:k,toPosition:T,getPosition:m,getLimit:z,exceededLimit:I,reposition:N}}function om(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,b=p.isEnough,v=p.getLength,g=n.omitEnd,h=e.is(mo),f=e.is(Ji),x=Ut(m,!1),S=Ut(m,!0),y=n.start||0,w,H=y,N,Y,O;function C(){V(),o([cn,Qt,Or],V),o(Kr,$)}function V(){N=v(!0),Y=n.perMove,O=n.perPage,w=ne();var q=Ni(y,0,g?w:N-1);q!==y&&(y=q,l.reposition())}function $(){w!==ne()&&r(Or)}function R(q,ce,Q){if(!he()){var be=T(q),He=z(be);He>-1&&(ce||He!==y)&&(ae(He),l.move(be,He,H,Q))}}function k(q,ce,Q,be){t.Scroll.scroll(q,ce,Q,function(){var He=z(l.toIndex(d()));ae(g?ni(He,w):He),be&&be()})}function T(q){var ce=y;if(ti(q)){var Q=q.match(/([+\-<>])(\d+)?/)||[],be=Q[1],He=Q[2];be==="+"||be==="-"?ce=M(y+ +(""+be+(+He||1)),y):be===">"?ce=He?I(+He):x(!0):be==="<"&&(ce=S(!0))}else ce=h?q:Ni(q,0,w);return ce}function m(q,ce){var Q=Y||(A()?1:O),be=M(y+Q*(q?-1:1),y,!(Y||A()));return be===-1&&f&&!ad(d(),c(!q),1)?q?0:w:ce?be:z(be)}function M(q,ce,Q){if(b()||A()){var be=E(q);be!==q&&(ce=q,q=be,Q=!1),q<0||q>w?!Y&&(Pr(0,q,ce,!0)||Pr(w,ce,q,!0))?q=I(W(q)):h?q=Q?q<0?-(N%O||O):N:q:n.rewind?q=q<0?w:0:q=-1:Q&&q!==ce&&(q=I(W(ce)+(q<ce?-1:1)))}else q=-1;return q}function E(q){if(f&&n.trimSpace==="move"&&q!==y)for(var ce=d();ce===u(q,!0)&&Pr(q,0,e.length-1,!n.rewind);)q<y?--q:++q;return q}function z(q){return h?(q+N)%N||0:q}function ne(){for(var q=N-(A()||h&&Y?1:O);g&&q-- >0;)if(u(N-1,!0)!==u(q,!0)){q++;break}return Ni(q,0,N-1)}function I(q){return Ni(A()?q:O*q,0,w)}function W(q){return A()?ni(q,w):Hr((q>=w?N-1:q)/O)}function K(q){var ce=l.toIndex(q);return f?Ni(ce,0,w):ce}function ae(q){q!==y&&(H=y,y=q)}function de(q){return q?H:y}function A(){return!qo(n.focus)||n.isNavigation}function he(){return e.state.is([uo,Go])&&!!n.waitForTransition}return{mount:C,go:R,scroll:k,getNext:x,getPrev:S,getAdjacent:m,getEnd:ne,setIndex:ae,getIndex:de,toIndex:I,toPage:W,toDest:K,hasFocus:A,isBusy:he}}var rm="http://www.w3.org/2000/svg",am="m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z",ar=40;function sm(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,b=u.arrows,v=u.track,g=b,h=u.prev,f=u.next,x,S,y={};function w(){N(),o(cn,H)}function H(){Y(),w()}function N(){var k=n.arrows;k&&!(h&&f)&&V(),h&&f&&(_o(y,{prev:h,next:f}),Wo(g,k?"":"none"),Pn(g,S=Ds+"--"+n.direction),k&&(O(),R(),Ct([h,f],Zo,v.id),l(hd,h,f)))}function Y(){i.destroy(),Hn(g,S),x?(Ti(b?[h,f]:g),h=f=null):kn([h,f],Os)}function O(){o([si,po,Qt,Ii,Or],R),r(f,"click",Ut(C,">")),r(h,"click",Ut(C,"<"))}function C(k){p.go(k,!0)}function V(){g=b||Gi("div",d.arrows),h=$(!0),f=$(!1),x=!0,Uo(g,[h,f]),!b&&Rs(g,v)}function $(k){var T='<button class="'+d.arrow+" "+(k?d.prev:d.next)+'" type="button"><svg xmlns="'+rm+'" viewBox="0 0 '+ar+" "+ar+'" width="'+ar+'" height="'+ar+'" focusable="false"><path d="'+(n.arrowPath||am)+'" />';return od(T)}function R(){if(h&&f){var k=e.index,T=p.getPrev(),m=p.getNext(),M=T>-1&&k<T?c.last:c.prev,E=m>-1&&k>m?c.first:c.next;h.disabled=T<0,f.disabled=m<0,Ct(h,vn,M),Ct(f,vn,E),l(fd,h,f,T,m)}}return{arrows:y,mount:w,destroy:Y,update:R}}var lm=Es+"-interval";function cm(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=Jr(n.interval,e.go.bind(e,">"),O),c=d.isPaused,u=t.Elements,p=t.Elements,b=p.root,v=p.toggle,g=n.autoplay,h,f,x=g==="pause";function S(){g&&(y(),v&&Ct(v,Zo,u.track.id),x||w(),Y())}function y(){n.pauseOnHover&&r(b,"mouseenter mouseleave",function(V){h=V.type==="mouseenter",N()}),n.pauseOnFocus&&r(b,"focusin focusout",function(V){f=V.type==="focusin",N()}),v&&r(v,"click",function(){x?w():H(!0)}),o([Bn,Zr,Qt],d.rewind),o(Bn,C)}function w(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),f=h=x=!1,Y(),l(Fs))}function H(V){V===void 0&&(V=!0),x=!!V,Y(),c()||(d.pause(),l(_s))}function N(){x||(h||f?H(!1):w())}function Y(){v&&(Nn(v,Li,!x),Ct(v,vn,n.i18n[x?"play":"pause"]))}function O(V){var $=u.bar;$&&Sn($,"width",V*100+"%"),l(xd,V)}function C(V){var $=t.Slides.getAt(V);d.set($&&+$n($.slide,lm)||n.interval)}return{mount:S,destroy:d.cancel,play:w,pause:H,isPaused:c}}function dm(e,t,n){var i=Kt(e),o=i.on;function r(){n.cover&&(o(Ws,Ut(d,!0)),o([si,cn,Qt],Ut(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Yo(u.container||u.slide,"img");p&&p.src&&d(c,p,u)})}function d(c,u,p){p.style("background",c?'center/cover no-repeat url("'+u.src+'")':"",!0),Wo(u,c?"none":"")}return{mount:r,destroy:Ut(l,!1)}}var um=10,pm=600,mm=.6,gm=1.5,hm=800;function fm(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,b=d.translate,v=e.is(Ji),g,h,f=1;function x(){o(Bn,H),o([cn,Qt],N)}function S(O,C,V,$,R){var k=c();if(H(),V&&(!v||!p())){var T=t.Layout.sliderSize(),m=Qa(O)*T*Hr(un(O)/T)||0;O=d.toPosition(t.Controller.toDest(O%T))+m}var M=ad(k,O,1);f=1,C=M?0:C||Nr(un(O-k)/gm,hm),h=$,g=Jr(C,y,Ut(w,k,O,R),1),l(Go),r(Zr),g.start()}function y(){l(Ki),h&&h(),r(Ii)}function w(O,C,V,$){var R=c(),k=O+(C-O)*Y($),T=(k-R)*f;b(R+T),v&&!V&&p()&&(f*=mm,un(T)<um&&S(u(p(!0)),pm,!1,h,!0))}function H(){g&&g.cancel()}function N(){g&&!g.isPaused()&&(H(),y())}function Y(O){var C=n.easingFunc;return C?C(O):1-Math.pow(1-O,4)}return{mount:x,destroy:H,scroll:S,cancel:N}}var Hi={passive:!1,capture:!0};function ym(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,b=t.Controller,v=t.Elements.track,g=t.Media.reduce,h=t.Direction,f=h.resolve,x=h.orient,S=u.getPosition,y=u.exceededLimit,w,H,N,Y,O,C=!1,V,$,R;function k(){l(v,ya,Za,Hi),l(v,va,Za,Hi),l(v,Fd,m,Hi),l(v,"click",z,{capture:!0}),l(v,"dragstart",Wn),o([si,cn],T)}function T(){var ee=n.drag;le(!ee),Y=ee==="free"}function m(ee){if(V=!1,!$){var ue=He(ee);be(ee.target)&&(ue||!ee.button)&&(b.isBusy()?Wn(ee,!0):(R=ue?v:window,O=c.is([uo,Go]),N=null,l(R,ya,M,Hi),l(R,va,E,Hi),u.cancel(),p.cancel(),ne(ee)))}}function M(ee){if(c.is(Er)||(c.set(Er),r(pd)),ee.cancelable)if(O){u.translate(w+Q(A(ee)));var ue=he(ee)>vl,oe=C!==(C=y());(ue||oe)&&ne(ee),V=!0,r(md),Wn(ee)}else K(ee)&&(O=W(ee),Wn(ee))}function E(ee){c.is(Er)&&(c.set(Ki),r(gd)),O&&(I(ee),Wn(ee)),d(R,ya,M),d(R,va,E),O=!1}function z(ee){!$&&V&&Wn(ee,!0)}function ne(ee){N=H,H=ee,w=S()}function I(ee){var ue=ae(ee),oe=de(ue),Fe=n.rewind&&n.rewindByDrag;g(!1),Y?b.scroll(oe,0,n.snap):e.is(Jo)?b.go(x(Qa(ue))<0?Fe?"<":"-":Fe?">":"+"):e.is(Ji)&&C&&Fe?b.go(y(!0)?">":"<"):b.go(b.toDest(oe),!0),g(!0)}function W(ee){var ue=n.dragMinThreshold,oe=ko(ue),Fe=oe&&ue.mouse||0,Ce=(oe?ue.touch:+ue)||10;return un(A(ee))>(He(ee)?Ce:Fe)}function K(ee){return un(A(ee))>un(A(ee,!0))}function ae(ee){if(e.is(mo)||!C){var ue=he(ee);if(ue&&ue<vl)return A(ee)/ue}return 0}function de(ee){return S()+Qa(ee)*ni(un(ee)*(n.flickPower||600),Y?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function A(ee,ue){return ce(ee,ue)-ce(q(ee),ue)}function he(ee){return Ja(ee)-Ja(q(ee))}function q(ee){return H===ee&&N||H}function ce(ee,ue){return(He(ee)?ee.changedTouches[0]:ee)["page"+f(ue?"Y":"X")]}function Q(ee){return ee/(C&&e.is(Ji)?Kp:1)}function be(ee){var ue=n.noDrag;return!Ao(ee,"."+Ed+", ."+oa)&&(!ue||!Ao(ee,ue))}function He(ee){return typeof TouchEvent<"u"&&ee instanceof TouchEvent}function xe(){return O}function le(ee){$=ee}return{mount:k,disable:le,isDragging:xe}}var vm={Spacebar:" ",Right:ta,Left:ea,Up:Sd,Down:$d};function js(e){return e=ti(e)?e:e.key,vm[e]||e}var xl="keydown";function xm(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function b(){v(),o(cn,g),o(cn,v),o(Bn,f)}function v(){var S=n.keyboard;S&&(u=S==="global"?window:d,r(u,xl,x))}function g(){l(u,xl)}function h(S){p=S}function f(){var S=p;p=!0,Qc(function(){p=S})}function x(S){if(!p){var y=js(S);y===c(ea)?e.go("<"):y===c(ta)&&e.go(">")}}return{mount:b,destroy:g,disable:h}}var Eo=Es+"-lazy",kr=Eo+"-srcset",bm="["+Eo+"], ["+kr+"]";function wm(e,t,n){var i=Kt(e),o=i.on,r=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[po,Ii],p=[];function b(){n.lazyLoad&&(v(),o(Qt,v))}function v(){zn(p),g(),c?S():(r(u),o(u,h),h())}function g(){t.Slides.forEach(function(y){Is(y.slide,bm).forEach(function(w){var H=$n(w,Eo),N=$n(w,kr);if(H!==w.src||N!==w.srcset){var Y=n.classes.spinner,O=w.parentElement,C=Yo(O,"."+Y)||Gi("span",Y,O);p.push([w,y,C]),w.src||Wo(w,"none")}})})}function h(){p=p.filter(function(y){var w=n.perPage*((n.preloadPages||1)+1)-1;return y[1].isWithin(e.index,w)?f(y):!0}),p.length||r(u)}function f(y){var w=y[0];Pn(y[1].slide,is),l(w,"load error",Ut(x,y)),Ct(w,"src",$n(w,Eo)),Ct(w,"srcset",$n(w,kr)),kn(w,Eo),kn(w,kr)}function x(y,w){var H=y[0],N=y[1];Hn(N.slide,is),w.type!=="error"&&(Ti(y[2]),Wo(H,""),d(Ws,H,N),d(Zi)),c&&S()}function S(){p.length&&f(p.shift())}return{mount:b,destroy:Ut(zn,p),check:h}}function Sm(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,b=u.getIndex,v=u.go,g=t.Direction.resolve,h=c.pagination,f=[],x,S;function y(){w(),o([cn,Qt,Or],y);var $=n.pagination;h&&Wo(h,$?"":"none"),$&&(o([Bn,Zr,Ii],V),H(),V(),r(yd,{list:x,items:f},C(e.index)))}function w(){x&&(Ti(h?ai(x.children):x),Hn(x,S),zn(f),x=null),i.destroy()}function H(){var $=e.length,R=n.classes,k=n.i18n,T=n.perPage,m=p()?u.getEnd()+1:No($/T);x=h||Gi("ul",R.pagination,c.track.parentElement),Pn(x,S=ra+"--"+O()),Ct(x,On,"tablist"),Ct(x,vn,k.select),Ct(x,Hs,O()===na?"vertical":"");for(var M=0;M<m;M++){var E=Gi("li",null,x),z=Gi("button",{class:R.page,type:"button"},E),ne=d.getIn(M).map(function(W){return W.slide.id}),I=!p()&&T>1?k.pageX:k.slideX;l(z,"click",Ut(N,M)),n.paginationKeyboard&&l(z,"keydown",Ut(Y,M)),Ct(E,On,"presentation"),Ct(z,On,"tab"),Ct(z,Zo,ne.join(" ")),Ct(z,vn,es(I,M+1)),Ct(z,qi,-1),f.push({li:E,button:z,page:M})}}function N($){v(">"+$,!0)}function Y($,R){var k=f.length,T=js(R),m=O(),M=-1;T===g(ta,!1,m)?M=++$%k:T===g(ea,!1,m)?M=(--$+k)%k:T==="Home"?M=0:T==="End"&&(M=k-1);var E=f[M];E&&(id(E.button),v(">"+M),Wn(R,!0))}function O(){return n.paginationDirection||n.direction}function C($){return f[u.toPage($)]}function V(){var $=C(b(!0)),R=C(b());if($){var k=$.button;Hn(k,Li),kn(k,ml),Ct(k,qi,-1)}if(R){var T=R.button;Pn(T,Li),Ct(T,ml,!0),Ct(T,qi,"")}r(vd,{list:x,items:f},$,R)}return{items:f,mount:y,destroy:w,getAt:C,update:V}}var $m=[" ","Enter"];function Cm(e,t,n){var i=n.isNavigation,o=n.slideFocus,r=[];function l(){e.splides.forEach(function(h){h.isParent||(u(e,h.splide),u(h.splide,e))}),i&&p()}function d(){r.forEach(function(h){h.destroy()}),zn(r)}function c(){d(),l()}function u(h,f){var x=Kt(h);x.on(Bn,function(S,y,w){f.go(f.is(mo)?w:S)}),r.push(x)}function p(){var h=Kt(e),f=h.on;f(Ps,v),f(bd,g),f([si,cn],b),r.push(h),h.emit(As,e.splides)}function b(){Ct(t.Elements.list,Hs,n.direction===na?"vertical":"")}function v(h){e.go(h.index)}function g(h,f){Ls($m,js(f))&&(v(h),Wn(f))}return{setup:Ut(t.Media.set,{slideFocus:qo(o)?i:o},!0),mount:l,destroy:d,remount:c}}function Tm(e,t,n){var i=Kt(e),o=i.bind,r=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,Hi)}function d(u){if(u.cancelable){var p=u.deltaY,b=p<0,v=Ja(u),g=n.wheelMinThreshold||0,h=n.wheelSleep||0;un(p)>g&&v-r>h&&(e.go(b?"<":">"),r=v),c(b)&&Wn(u)}}function c(u){return!n.releaseWheel||e.state.is(uo)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var Lm=90;function Rm(e,t,n){var i=Kt(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,d=Gi("span",Gp),c=Jr(Lm,Ut(p,!1));function u(){l&&(v(!t.Autoplay.isPaused()),Ct(r,fl,!0),d.textContent="…",o(Fs,Ut(v,!0)),o(_s,Ut(v,!1)),o([po,Ii],Ut(p,!0)))}function p(g){Ct(r,hl,g),g?(Uo(r,d),c.start()):(Ti(d),c.cancel())}function b(){kn(r,[gl,fl,hl]),Ti(d)}function v(g){l&&Ct(r,gl,g?"off":"polite")}return{mount:u,disable:v,destroy:b}}var Im=Object.freeze({__proto__:null,Media:Wp,Direction:Np,Elements:Zp,Slides:Qp,Layout:em,Clones:nm,Move:im,Controller:om,Arrows:sm,Autoplay:cm,Cover:dm,Scroll:fm,Drag:ym,Keyboard:xm,LazyLoad:wm,Pagination:Sm,Sync:Cm,Wheel:Tm,Live:Rm}),Em={prev:"Previous slide",next:"Next slide",first:"Go to first slide",last:"Go to last slide",slideX:"Go to slide %s",pageX:"Go to page %s",play:"Start autoplay",pause:"Pause autoplay",carousel:"carousel",slide:"slide",select:"Select a slide to show",slideLabel:"%s of %s"},Mm={type:"slide",role:"region",speed:400,perPage:1,cloneStatus:!0,arrows:!0,pagination:!0,paginationKeyboard:!0,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,resetProgress:!0,easing:"cubic-bezier(0.25, 1, 0.5, 1)",drag:!0,direction:"ltr",trimSpace:!0,focusableNodes:"a, button, textarea, input, select, iframe",live:!0,classes:Up,i18n:Em,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Pm(e,t,n){var i=t.Slides;function o(){Kt(e).on([si,Qt],r)}function r(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function l(d,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),Qc(c)}return{mount:o,start:l,cancel:Za}}function km(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,d=Ut(Sn,l,"transition"),c;function u(){Kt(e).bind(l,"transitionend",function(g){g.target===l&&c&&(b(),c())})}function p(g,h){var f=i.toPosition(g,!0),x=i.getPosition(),S=v(g);un(f-x)>=1&&S>=1?n.useScroll?r.scroll(f,S,!1,h):(d("transform "+S+"ms "+n.easing),i.translate(f,!0),c=h):(i.jump(g),h())}function b(){d(""),r.cancel()}function v(g){var h=n.rewindSpeed;if(e.is(Ji)&&h){var f=o.getIndex(!0),x=o.getEnd();if(f===0&&g>=x||f>=x&&g===0)return h}return n.speed}return{mount:u,start:p,cancel:b}}var Am=(function(){function e(n,i){this.event=Kt(),this.Components={},this.state=Fp(ji),this.splides=[],this._o={},this._E={};var o=ti(n)?rd(document,n):n;Io(o,o+" is invalid."),this.root=o,i=Kn({label:$n(o,vn)||"",labelledby:$n(o,Ns)||""},Mm,e.defaults,i||{});try{Kn(i,JSON.parse($n(o,Es)))}catch{Io(!1,"Invalid JSON")}this._o=Object.create(Kn({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,d=this.Components;Io(l.is([ji,Wr]),"Already mounted!"),l.set(ji),this._C=d,this._T=o||this._T||(this.is(Jo)?Pm:km),this._E=i||this._E;var c=_o({},Im,this._E,{Transition:this._T});return $i(c,function(u,p){var b=u(r,d,r._o);d[p]=b,b.setup&&b.setup()}),$i(d,function(u){u.mount&&u.mount()}),this.emit(si),Pn(this.root,qp),l.set(Ki),this.emit(ts),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Ki)&&(this._C.Sync.remount(),i.Components.Sync.remount()),this},t.go=function(i){return this._C.Controller.go(i),this},t.on=function(i,o){return this.event.on(i,o),this},t.off=function(i){return this.event.off(i),this},t.emit=function(i){var o;return(o=this.event).emit.apply(o,[i].concat(ai(arguments,1))),this},t.add=function(i,o){return this._C.Slides.add(i,o),this},t.remove=function(i){return this._C.Slides.remove(i),this},t.is=function(i){return this._o.type===i},t.refresh=function(){return this.emit(Qt),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,r=this.state;return r.is(ji)?Kt(this).on(ts,this.destroy.bind(this,i)):($i(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(ks),o.destroy(),i&&zn(this.splides),r.set(Wr)),this},Ep(e,[{key:"options",get:function(){return this._o},set:function(i){this._C.Media.set(i,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),zs=Am;zs.defaults={};zs.STATES=Pp;var bl=[[si,"onMounted"],[ts,"onReady"],[Bn,"onMove"],[po,"onMoved"],[Ps,"onClick"],[ld,"onActive"],[cd,"onInactive"],[dd,"onVisible"],[ud,"onHidden"],[Qt,"onRefresh"],[cn,"onUpdated"],[Zi,"onResize"],[Kr,"onResized"],[pd,"onDrag"],[md,"onDragging"],[gd,"onDragged"],[Zr,"onScroll"],[Ii,"onScrolled"],[ks,"onDestroy"],[hd,"onArrowsMounted"],[fd,"onArrowsUpdated"],[yd,"onPaginationMounted"],[vd,"onPaginationUpdated"],[As,"onNavigationMounted"],[Fs,"onAutoplayPlay"],[xd,"onAutoplayPlaying"],[_s,"onAutoplayPause"],[Ws,"onLazyLoadLoaded"]];function Bs(...e){return e.filter(Boolean).join(" ")}function Dr(e){return e!==null&&typeof e=="object"}function os(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!os(n,t[i]));if(Dr(e)&&Dr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!os(e[o],t[o]))}return e===t}function Fm(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function _m(e,t){if(e){const n=Object.keys(e);for(let i=0;i<n.length;i++){const o=n[i];if(o!=="__proto__"&&t(e[o],o)===!1)break}}return e}function rs(e,t){const n=e;return _m(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Dr(i)?n[o]=rs(Dr(n[o])?n[o]:{},i):n[o]=i}),n}var Wm=({children:e,className:t,...n})=>s.createElement("div",{className:Bs("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),Vs=class extends s.Component{constructor(){super(...arguments),this.splideRef=s.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new zs(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=rs({},e||{}),this.slides=this.getSlides())}componentWillUnmount(){this.splide&&(this.splide.destroy(),this.splide=void 0),this.options=void 0,this.slides.length=0}componentDidUpdate(){if(!this.splide)return;const{options:e}=this.props;e&&!os(this.options,e)&&(this.splide.options=e,this.options=rs({},e));const t=this.getSlides();Fm(this.slides,t)||(this.splide.refresh(),this.slides=t)}sync(e){var t;(t=this.splide)==null||t.sync(e)}go(e){var t;(t=this.splide)==null||t.go(e)}getSlides(){var e;if(this.splide){const t=(e=this.splide.Components.Elements)==null?void 0:e.list.children;return t&&Array.prototype.slice.call(t)||[]}return[]}bind(e){bl.forEach(([t,n])=>{const i=this.props[n];typeof i=="function"&&e.on(t,(...o)=>{i(e,...o)})})}omit(e,t){return t.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}),e}render(){const{className:e,tag:t="div",hasTrack:n=!0,children:i,...o}=this.props;return s.createElement(t,{className:Bs("splide",e),ref:this.splideRef,...this.omit(o,["options",...bl.map(r=>r[1])])},n?s.createElement(Wm,null,i):i)}},Gs=({children:e,className:t,...n})=>s.createElement("li",{className:Bs("splide__slide",t),...n},e);/*!
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),yt=require("classnames"),D=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Vn=require("react-dom");function Hu(e){return e.type==="object"&&e.version===1}const Ou="ControlSlider-module__wrapper___sHEkd",Du="ControlSlider-module__hoverArrow___A-dOH",ju="ControlSlider-module__sliderItem___QQSkR",zu="ControlSlider-module__sliderImage___9hRl-",Bu="ControlSlider-module__arrow___05ghY",Vu="ControlSlider-module__arrowVertical___tBfVN",Gu="ControlSlider-module__nextArrow___-30Yc",qu="ControlSlider-module__arrowInner___aEra3",Xu="ControlSlider-module__arrowIcon___S4ztF",Uu="ControlSlider-module__arrowImg___2dwJW",Yu="ControlSlider-module__mirror___brd6U",Ku="ControlSlider-module__pagination___bicLF",Zu="ControlSlider-module__paginationInner___bT-P-",Ju="ControlSlider-module__paginationVertical___zYqKw",Qu="ControlSlider-module__paginationItem___nTRbk",ep="ControlSlider-module__dot___p1Qun",tp="ControlSlider-module__activeDot___LHFaj",np="ControlSlider-module__paginationInsideBottom___R3FWn",ip="ControlSlider-module__paginationInsideTop___V-qb-",op="ControlSlider-module__paginationOutsideBottom___14w8D",rp="ControlSlider-module__paginationOutsideTop___SCLqB",ap="ControlSlider-module__paginationInsideLeft___yOBRZ",sp="ControlSlider-module__paginationInsideRight___Rtt3o",lp="ControlSlider-module__paginationOutsideLeft___lahaw",cp="ControlSlider-module__paginationOutsideRight___EtuQa",dp="ControlSlider-module__imgWrapper___UjEgB",up="ControlSlider-module__captionBlock___dJ6-j",pp="ControlSlider-module__captionTextWrapper___HFlpf",mp="ControlSlider-module__captionText___uGBVc",gp="ControlSlider-module__active___WZK4G",hp="ControlSlider-module__withPointerEvents___t-18M",fp="ControlSlider-module__topLeftAlignment___zjnGM",yp="ControlSlider-module__topCenterAlignment___gD1xW",vp="ControlSlider-module__topRightAlignment___NMapS",xp="ControlSlider-module__middleLeftAlignment___OnUrY",bp="ControlSlider-module__middleCenterAlignment___Tdkl0",wp="ControlSlider-module__middleRightAlignment___wEbfX",Sp="ControlSlider-module__bottomLeftAlignment___cTP2-",$p="ControlSlider-module__bottomCenterAlignment___c54fB",Cp="ControlSlider-module__bottomRightAlignment___kEwrz",Tp="ControlSlider-module__clickOverlay___DZA28",Lp="ControlSlider-module__contain___pLyq7",Rp="ControlSlider-module__cover___KdDat",ht={wrapper:Ou,hoverArrow:Du,sliderItem:ju,sliderImage:zu,arrow:Bu,arrowVertical:Vu,nextArrow:Gu,arrowInner:qu,arrowIcon:Xu,arrowImg:Uu,mirror:Yu,pagination:Ku,paginationInner:Zu,paginationVertical:Ju,paginationItem:Qu,dot:ep,activeDot:tp,paginationInsideBottom:np,paginationInsideTop:ip,paginationOutsideBottom:op,paginationOutsideTop:rp,paginationInsideLeft:ap,paginationInsideRight:sp,paginationOutsideLeft:lp,paginationOutsideRight:cp,imgWrapper:dp,captionBlock:up,captionTextWrapper:pp,captionText:mp,active:gp,withPointerEvents:hp,topLeftAlignment:fp,topCenterAlignment:yp,topRightAlignment:vp,middleLeftAlignment:xp,middleCenterAlignment:bp,middleRightAlignment:wp,bottomLeftAlignment:Sp,bottomCenterAlignment:$p,bottomRightAlignment:Cp,clickOverlay:Tp,contain:Lp,cover:Rp};function Ip(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Ep(e,t,n){return t&&Ip(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var sl="(prefers-reduced-motion: reduce)",ji=1,Mp=2,Ki=3,uo=4,Go=5,Er=6,Wr=7,Pp={CREATED:ji,MOUNTED:Mp,IDLE:Ki,MOVING:uo,SCROLLING:Go,DRAGGING:Er,DESTROYED:Wr};function zn(e){e.length=0}function ai(e,t,n){return Array.prototype.slice.call(e,t,n)}function Ut(e){return e.bind.apply(e,[null].concat(ai(arguments,1)))}var Qc=setTimeout,Za=function(){};function ll(e){return requestAnimationFrame(e)}function Yr(e,t){return typeof t===e}function ko(e){return!Ts(e)&&Yr("object",e)}var Cs=Array.isArray,ed=Ut(Yr,"function"),ti=Ut(Yr,"string"),qo=Ut(Yr,"undefined");function Ts(e){return e===null}function td(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Xo(e){return Cs(e)?e:[e]}function bn(e,t){Xo(e).forEach(t)}function Ls(e,t){return e.indexOf(t)>-1}function Mr(e,t){return e.push.apply(e,Xo(t)),e}function Nn(e,t,n){e&&bn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Pn(e,t){Nn(e,ti(t)?t.split(" "):t,!0)}function Uo(e,t){bn(t,e.appendChild.bind(e))}function Rs(e,t){bn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function Ao(e,t){return td(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function nd(e,t){var n=e?ai(e.children):[];return t?n.filter(function(i){return Ao(i,t)}):n}function Yo(e,t){return t?nd(e,t)[0]:e.firstElementChild}var Fo=Object.keys;function $i(e,t,n){return e&&(n?Fo(e).reverse():Fo(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function _o(e){return ai(arguments,1).forEach(function(t){$i(t,function(n,i){e[i]=t[i]})}),e}function Kn(e){return ai(arguments,1).forEach(function(t){$i(t,function(n,i){Cs(n)?e[i]=n.slice():ko(n)?e[i]=Kn({},ko(e[i])?e[i]:{},n):e[i]=n})}),e}function cl(e,t){bn(t||Fo(e),function(n){delete e[n]})}function kn(e,t){bn(e,function(n){bn(t,function(i){n&&n.removeAttribute(i)})})}function Ct(e,t,n){ko(t)?$i(t,function(i,o){Ct(e,o,i)}):bn(e,function(i){Ts(n)||n===""?kn(i,t):i.setAttribute(t,String(n))})}function Gi(e,t,n){var i=document.createElement(e);return t&&(ti(t)?Pn(i,t):Ct(i,t)),n&&Uo(n,i),i}function Sn(e,t,n){if(qo(n))return getComputedStyle(e)[t];Ts(n)||(e.style[t]=""+n)}function Wo(e,t){Sn(e,"display",t)}function id(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function $n(e,t){return e.getAttribute(t)}function dl(e,t){return e&&e.classList.contains(t)}function fn(e){return e.getBoundingClientRect()}function Ti(e){bn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function od(e){return Yo(new DOMParser().parseFromString(e,"text/html").body)}function Wn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function rd(e,t){return e&&e.querySelector(t)}function Is(e,t){return t?ai(e.querySelectorAll(t)):[]}function Hn(e,t){Nn(e,t,!1)}function Ja(e){return e.timeStamp}function pi(e){return ti(e)?e:e?e+"px":""}var Ko="splide",Es="data-"+Ko;function Io(e,t){if(!e)throw new Error("["+Ko+"] "+(t||""))}var ni=Math.min,Nr=Math.max,Hr=Math.floor,No=Math.ceil,un=Math.abs;function ad(e,t,n){return un(e-t)<n}function Pr(e,t,n,i){var o=ni(t,n),r=Nr(t,n);return i?o<e&&e<r:o<=e&&e<=r}function Ni(e,t,n){var i=ni(t,n),o=Nr(t,n);return ni(Nr(i,e),o)}function Qa(e){return+(e>0)-+(e<0)}function es(e,t){return bn(t,function(n){e=e.replace("%s",""+n)}),e}function Ms(e){return e<10?"0"+e:""+e}var ul={};function kp(e){return""+e+Ms(ul[e]=(ul[e]||0)+1)}function sd(){var e=[];function t(l,d,c,u){o(l,d,function(p,b,v){var g="addEventListener"in p,h=g?p.removeEventListener.bind(p,b,c,u):p.removeListener.bind(p,c);g?p.addEventListener(b,c,u):p.addListener(c),e.push([p,b,v,c,h])})}function n(l,d,c){o(l,d,function(u,p,b){e=e.filter(function(v){return v[0]===u&&v[1]===p&&v[2]===b&&(!c||v[3]===c)?(v[4](),!1):!0})})}function i(l,d,c){var u,p=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:p,detail:c}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,p,!1,c)),l.dispatchEvent(u),u}function o(l,d,c){bn(l,function(u){u&&bn(d,function(p){p.split(" ").forEach(function(b){var v=b.split(".");c(u,v[0],v[1])})})})}function r(){e.forEach(function(l){l[4]()}),zn(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var si="mounted",ts="ready",Bn="move",po="moved",Ps="click",ld="active",cd="inactive",dd="visible",ud="hidden",Qt="refresh",cn="updated",Zi="resize",Kr="resized",pd="drag",md="dragging",gd="dragged",Zr="scroll",Ii="scrolled",Ap="overflow",ks="destroy",hd="arrows:mounted",fd="arrows:updated",yd="pagination:mounted",vd="pagination:updated",As="navigation:mounted",Fs="autoplay:play",xd="autoplay:playing",_s="autoplay:pause",Ws="lazyload:loaded",bd="sk",wd="sh",Or="ei";function Kt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=sd();function i(r,l){n.bind(t,Xo(r).join(" "),function(d){l.apply(l,Cs(d.detail)?d.detail:[])})}function o(r){n.dispatch(t,r,ai(arguments,1))}return e&&e.event.on(ks,n.destroy),_o(n,{bus:t,on:i,off:Ut(n.unbind,t),emit:o})}function Jr(e,t,n,i){var o=Date.now,r,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?ni((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return v();d=ll(p)}}function b(S){S||h(),r=o()-(S?l*e:0),c=!1,d=ll(p)}function v(){c=!0}function g(){r=o(),l=0,n&&n(l)}function h(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function f(S){e=S}function x(){return c}return{start:b,rewind:g,pause:v,cancel:h,set:f,isPaused:x}}function Fp(e){var t=e;function n(o){t=o}function i(o){return Ls(Xo(o),t)}return{set:n,is:i}}function _p(e,t){var n=Jr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Wp(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=sd(),d=[];function c(){var h=n.mediaQuery==="min";Fo(o).sort(function(f,x){return h?+f-+x:+x-+f}).forEach(function(f){p(o[f],"("+(h?"min":"max")+"-width:"+f+"px)")}),p(r,sl),b()}function u(h){h&&l.destroy()}function p(h,f){var x=matchMedia(f);l.bind(x,"change",b),d.push([h,x])}function b(){var h=i.is(Wr),f=n.direction,x=d.reduce(function(S,y){return Kn(S,y[1].matches?y[0]:{})},{});cl(n),g(x),n.destroy?e.destroy(n.destroy==="completely"):h?(u(!0),e.mount()):f!==n.direction&&e.refresh()}function v(h){matchMedia(sl).matches&&(h?Kn(n,r):cl(n,Fo(r)))}function g(h,f,x){Kn(n,h),f&&Kn(Object.getPrototypeOf(n),h),(x||!i.is(ji))&&e.emit(cn,n)}return{setup:c,destroy:u,reduce:v,set:g}}var Qr="Arrow",ea=Qr+"Left",ta=Qr+"Right",Sd=Qr+"Up",$d=Qr+"Down",pl="rtl",na="ttb",ha={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Sd,ta],ArrowRight:[$d,ea]};function Np(e,t,n){function i(r,l,d){d=d||n.direction;var c=d===pl&&!l?1:d===na?0:-1;return ha[r]&&ha[r][c]||r.replace(/width|left|right/i,function(u,p){var b=ha[u.toLowerCase()][c]||u;return p>0?b.charAt(0).toUpperCase()+b.slice(1):b})}function o(r){return r*(n.direction===pl?1:-1)}return{resolve:i,orient:o}}var On="role",qi="tabindex",Hp="disabled",Cn="aria-",Zo=Cn+"controls",Cd=Cn+"current",ml=Cn+"selected",vn=Cn+"label",Ns=Cn+"labelledby",Td=Cn+"hidden",Hs=Cn+"orientation",Ho=Cn+"roledescription",gl=Cn+"live",hl=Cn+"busy",fl=Cn+"atomic",Os=[On,qi,Hp,Zo,Cd,vn,Ns,Td,Hs,Ho],Fn=Ko+"__",li="is-",fa=Ko,yl=Fn+"track",Op=Fn+"list",ia=Fn+"slide",Ld=ia+"--clone",Dp=ia+"__container",Ds=Fn+"arrows",oa=Fn+"arrow",Rd=oa+"--prev",Id=oa+"--next",ra=Fn+"pagination",Ed=ra+"__page",jp=Fn+"progress",zp=jp+"__bar",Bp=Fn+"toggle",Vp=Fn+"spinner",Gp=Fn+"sr",qp=li+"initialized",Li=li+"active",Md=li+"prev",Pd=li+"next",ns=li+"visible",is=li+"loading",kd=li+"focus-in",Ad=li+"overflow",Xp=[Li,ns,Md,Pd,is,kd,Ad],Up={slide:ia,clone:Ld,arrows:Ds,arrow:oa,prev:Rd,next:Id,pagination:ra,page:Ed,spinner:Vp};function Yp(e,t){if(ed(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!Ao(n,t);)n=n.parentElement;return n}var Kp=5,vl=200,Fd="touchstart mousedown",ya="touchmove mousemove",va="touchend touchcancel mouseup click";function Zp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],b=[],v,g,h;function f(){w(),H(),y()}function x(){o(Qt,S),o(Qt,f),o(cn,y),r(document,Fd+" keydown",function(O){h=O.type==="keydown"},{capture:!0}),r(l,"focusin",function(){Nn(l,kd,!!h)})}function S(O){var C=Os.concat("style");zn(u),Hn(l,p),Hn(v,b),kn([v,g],C),kn(l,O?C:["style",Ho])}function y(){Hn(l,p),Hn(v,b),p=U(fa),b=U(yl),Pn(l,p),Pn(v,b),Ct(l,vn,n.label),Ct(l,Ns,n.labelledby)}function w(){v=N("."+yl),g=Yo(v,"."+Op),Io(v&&g,"A track/list element is missing."),Mr(u,nd(g,"."+ia+":not(."+Ld+")")),$i({arrows:Ds,pagination:ra,prev:Rd,next:Id,bar:zp,toggle:Bp},function(O,C){c[C]=N("."+O)}),_o(c,{root:l,track:v,list:g,slides:u})}function H(){var O=l.id||kp(Ko),C=n.role;l.id=O,v.id=v.id||O+"-track",g.id=g.id||O+"-list",!$n(l,On)&&l.tagName!=="SECTION"&&C&&Ct(l,On,C),Ct(l,Ho,d.carousel),Ct(g,On,"presentation")}function N(O){var C=rd(l,O);return C&&Yp(C,"."+fa)===l?C:void 0}function U(O){return[O+"--"+n.type,O+"--"+n.direction,n.drag&&O+"--draggable",n.isNavigation&&O+"--nav",O===fa&&Li]}return _o(c,{setup:f,mount:x,destroy:S})}var Ji="slide",mo="loop",Jo="fade";function Jp(e,t,n,i){var o=Kt(e),r=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,b=p.isNavigation,v=p.updateOnMove,g=p.i18n,h=p.pagination,f=p.slideFocus,x=c.Direction.resolve,S=$n(i,"style"),y=$n(i,vn),w=n>-1,H=Yo(i,"."+Dp),N;function U(){w||(i.id=u.id+"-slide"+Ms(t+1),Ct(i,On,h?"tabpanel":"group"),Ct(i,Ho,g.slide),Ct(i,vn,y||es(g.slideLabel,[t+1,e.length]))),O()}function O(){d(i,"click",Ut(l,Ps,ne)),d(i,"keydown",Ut(l,bd,ne)),r([po,wd,Ii],R),r(As,V),v&&r(Bn,$)}function C(){N=!0,o.destroy(),Hn(i,Xp),kn(i,Os),Ct(i,"style",S),Ct(i,vn,y||"")}function V(){var I=e.splides.map(function(W){var K=W.splide.Components.Slides.getAt(t);return K?K.slide.id:""}).join(" ");Ct(i,vn,es(g.slideX,(w?n:t)+1)),Ct(i,Zo,I),Ct(i,On,f?"button":""),f&&kn(i,Ho)}function $(){N||R()}function R(){if(!N){var I=e.index;k(),T(),Nn(i,Md,t===I-1),Nn(i,Pd,t===I+1)}}function k(){var I=M();I!==dl(i,Li)&&(Nn(i,Li,I),Ct(i,Cd,b&&I||""),l(I?ld:cd,ne))}function T(){var I=E(),W=!I&&(!M()||w);if(e.state.is([uo,Go])||Ct(i,Td,W||""),Ct(Is(i,p.focusableNodes||""),qi,W?-1:""),f&&Ct(i,qi,W?-1:0),I!==dl(i,ns)&&(Nn(i,ns,I),l(I?dd:ud,ne)),!I&&document.activeElement===i){var K=c.Slides.getAt(e.index);K&&id(K.slide)}}function m(I,W,K){Sn(K&&H||i,I,W)}function M(){var I=e.index;return I===t||p.cloneStatus&&I===n}function E(){if(e.is(Jo))return M();var I=fn(c.Elements.track),W=fn(i),K=x("left",!0),ae=x("right",!0);return Hr(I[K])<=No(W[K])&&Hr(W[ae])<=No(I[ae])}function z(I,W){var K=un(I-t);return!w&&(p.rewind||e.is(mo))&&(K=ni(K,e.length-K)),K<=W}var ne={index:t,slideIndex:n,slide:i,container:H,isClone:w,mount:U,destroy:C,update:R,style:m,isWithin:z};return ne}function Qp(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function b(){v(),o(Qt,g),o(Qt,v)}function v(){c.forEach(function(R,k){f(R,k,-1)})}function g(){N(function(R){R.destroy()}),zn(p)}function h(){N(function(R){R.update()})}function f(R,k,T){var m=Jp(e,k,T,R);m.mount(),p.push(m),p.sort(function(M,E){return M.index-E.index})}function x(R){return R?U(function(k){return!k.isClone}):p}function S(R){var k=t.Controller,T=k.toIndex(R),m=k.hasFocus()?1:n.perPage;return U(function(M){return Pr(M.index,T,T+m-1)})}function y(R){return U(R)[0]}function w(R,k){bn(R,function(T){if(ti(T)&&(T=od(T)),td(T)){var m=c[k];m?Rs(T,m):Uo(u,T),Pn(T,n.classes.slide),C(T,Ut(r,Zi))}}),r(Qt)}function H(R){Ti(U(R).map(function(k){return k.slide})),r(Qt)}function N(R,k){x(k).forEach(R)}function U(R){return p.filter(ed(R)?R:function(k){return ti(R)?Ao(k.slide,R):Ls(Xo(R),k.index)})}function O(R,k,T){N(function(m){m.style(R,k,T)})}function C(R,k){var T=Is(R,"img"),m=T.length;m?T.forEach(function(M){l(M,"load error",function(){--m||k()})}):k()}function V(R){return R?c.length:p.length}function $(){return p.length>n.perPage}return{mount:b,destroy:g,update:h,register:f,get:x,getIn:S,getAt:y,add:w,remove:H,forEach:N,filter:U,style:O,getLength:V,isEnough:$}}function em(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,b=u.track,v=u.list,g=d.getAt,h=d.style,f,x,S;function y(){w(),r(window,"resize load",_p(Ut(l,Zi))),o([cn,Qt],w),o(Zi,H)}function w(){f=n.direction===na,Sn(p,"maxWidth",pi(n.width)),Sn(b,c("paddingLeft"),N(!1)),Sn(b,c("paddingRight"),N(!0)),H(!0)}function H(ne){var I=fn(p);(ne||x.width!==I.width||x.height!==I.height)&&(Sn(b,"height",U()),h(c("marginRight"),pi(n.gap)),h("width",C()),h("height",V(),!0),x=I,l(Kr),S!==(S=z())&&(Nn(p,Ad,S),l(Ap,S)))}function N(ne){var I=n.padding,W=c(ne?"right":"left");return I&&pi(I[W]||(ko(I)?0:I))||"0px"}function U(){var ne="";return f&&(ne=O(),Io(ne,"height or heightRatio is missing."),ne="calc("+ne+" - "+N(!1)+" - "+N(!0)+")"),ne}function O(){return pi(n.height||fn(v).width*n.heightRatio)}function C(){return n.autoWidth?null:pi(n.fixedWidth)||(f?"":$())}function V(){return pi(n.fixedHeight)||(f?n.autoHeight?null:$():O())}function $(){var ne=pi(n.gap);return"calc((100%"+(ne&&" + "+ne)+")/"+(n.perPage||1)+(ne&&" - "+ne)+")"}function R(){return fn(v)[c("width")]}function k(ne,I){var W=g(ne||0);return W?fn(W.slide)[c("width")]+(I?0:M()):0}function T(ne,I){var W=g(ne);if(W){var K=fn(W.slide)[c("right")],ae=fn(v)[c("left")];return un(K-ae)+(I?0:M())}return 0}function m(ne){return T(e.length-1)-T(0)+k(0,ne)}function M(){var ne=g(0);return ne&&parseFloat(Sn(ne.slide,c("marginRight")))||0}function E(ne){return parseFloat(Sn(b,c("padding"+(ne?"Right":"Left"))))||0}function z(){return e.is(Jo)||m(!0)>R()}return{mount:y,resize:H,listSize:R,slideSize:k,sliderSize:m,totalSize:T,getPadding:E,isOverflow:z}}var tm=2;function nm(e,t,n){var i=Kt(e),o=i.on,r=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(Qt,b),o([cn,Zi],g),(u=x())&&(h(u),t.Layout.resize(!0))}function b(){v(),p()}function v(){Ti(c),zn(c),i.destroy()}function g(){var S=x();u!==S&&(u<S||!S)&&i.emit(Qt)}function h(S){var y=l.get().slice(),w=y.length;if(w){for(;y.length<S;)Mr(y,y);Mr(y.slice(-S),y.slice(0,S)).forEach(function(H,N){var U=N<S,O=f(H.slide,N);U?Rs(O,y[0].slide):Uo(r.list,O),Mr(c,O),l.register(O,N-S+(U?0:w),H.index)})}}function f(S,y){var w=S.cloneNode(!0);return Pn(w,n.classes.clone),w.id=e.root.id+"-clone"+Ms(y+1),w}function x(){var S=n.clones;if(!e.is(mo))S=0;else if(qo(S)){var y=n[d("fixedWidth")]&&t.Layout.slideSize(0),w=y&&No(fn(r.track)[d("width")]/y);S=w||n[d("autoWidth")]&&e.length||n.perPage*tm}return S}return{mount:p,destroy:v}}function im(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,b=d.listSize,v=d.sliderSize,g=t.Direction,h=g.resolve,f=g.orient,x=t.Elements,S=x.list,y=x.track,w;function H(){w=t.Transition,o([si,Kr,cn,Qt],N)}function N(){t.Controller.isBusy()||(t.Scroll.cancel(),O(e.index),t.Slides.update())}function U(W,K,ae,de){W!==K&&ne(W>ae)&&(R(),C($(m(),W>ae),!0)),l(uo),r(Bn,K,ae,W),w.start(K,function(){l(Ki),r(po,K,ae,W),de&&de()})}function O(W){C(T(W,!0))}function C(W,K){if(!e.is(Jo)){var ae=K?W:V(W);Sn(S,"transform","translate"+h("X")+"("+ae+"px)"),W!==ae&&r(wd)}}function V(W){if(e.is(mo)){var K=k(W),ae=K>t.Controller.getEnd(),de=K<0;(de||ae)&&(W=$(W,ae))}return W}function $(W,K){var ae=W-z(K),de=v();return W-=f(de*(No(un(ae)/de)||1))*(K?1:-1),W}function R(){C(m(),!0),w.cancel()}function k(W){for(var K=t.Slides.get(),ae=0,de=1/0,A=0;A<K.length;A++){var he=K[A].index,q=un(T(he,!0)-W);if(q<=de)de=q,ae=he;else break}return ae}function T(W,K){var ae=f(p(W-1)-E(W));return K?M(ae):ae}function m(){var W=h("left");return fn(S)[W]-fn(y)[W]+f(u(!1))}function M(W){return n.trimSpace&&e.is(Ji)&&(W=Ni(W,0,f(v(!0)-b()))),W}function E(W){var K=n.focus;return K==="center"?(b()-c(W,!0))/2:+K*c(W)||0}function z(W){return T(W?t.Controller.getEnd():0,!!n.trimSpace)}function ne(W){var K=f($(m(),W));return W?K>=0:K<=S[h("scrollWidth")]-fn(y)[h("width")]}function I(W,K){K=qo(K)?m():K;var ae=W!==!0&&f(K)<f(z(!1)),de=W!==!1&&f(K)>f(z(!0));return ae||de}return{mount:H,move:U,jump:O,translate:C,shift:$,cancel:R,toIndex:k,toPosition:T,getPosition:m,getLimit:z,exceededLimit:I,reposition:N}}function om(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,b=p.isEnough,v=p.getLength,g=n.omitEnd,h=e.is(mo),f=e.is(Ji),x=Ut(m,!1),S=Ut(m,!0),y=n.start||0,w,H=y,N,U,O;function C(){V(),o([cn,Qt,Or],V),o(Kr,$)}function V(){N=v(!0),U=n.perMove,O=n.perPage,w=ne();var q=Ni(y,0,g?w:N-1);q!==y&&(y=q,l.reposition())}function $(){w!==ne()&&r(Or)}function R(q,ce,Q){if(!he()){var be=T(q),He=z(be);He>-1&&(ce||He!==y)&&(ae(He),l.move(be,He,H,Q))}}function k(q,ce,Q,be){t.Scroll.scroll(q,ce,Q,function(){var He=z(l.toIndex(d()));ae(g?ni(He,w):He),be&&be()})}function T(q){var ce=y;if(ti(q)){var Q=q.match(/([+\-<>])(\d+)?/)||[],be=Q[1],He=Q[2];be==="+"||be==="-"?ce=M(y+ +(""+be+(+He||1)),y):be===">"?ce=He?I(+He):x(!0):be==="<"&&(ce=S(!0))}else ce=h?q:Ni(q,0,w);return ce}function m(q,ce){var Q=U||(A()?1:O),be=M(y+Q*(q?-1:1),y,!(U||A()));return be===-1&&f&&!ad(d(),c(!q),1)?q?0:w:ce?be:z(be)}function M(q,ce,Q){if(b()||A()){var be=E(q);be!==q&&(ce=q,q=be,Q=!1),q<0||q>w?!U&&(Pr(0,q,ce,!0)||Pr(w,ce,q,!0))?q=I(W(q)):h?q=Q?q<0?-(N%O||O):N:q:n.rewind?q=q<0?w:0:q=-1:Q&&q!==ce&&(q=I(W(ce)+(q<ce?-1:1)))}else q=-1;return q}function E(q){if(f&&n.trimSpace==="move"&&q!==y)for(var ce=d();ce===u(q,!0)&&Pr(q,0,e.length-1,!n.rewind);)q<y?--q:++q;return q}function z(q){return h?(q+N)%N||0:q}function ne(){for(var q=N-(A()||h&&U?1:O);g&&q-- >0;)if(u(N-1,!0)!==u(q,!0)){q++;break}return Ni(q,0,N-1)}function I(q){return Ni(A()?q:O*q,0,w)}function W(q){return A()?ni(q,w):Hr((q>=w?N-1:q)/O)}function K(q){var ce=l.toIndex(q);return f?Ni(ce,0,w):ce}function ae(q){q!==y&&(H=y,y=q)}function de(q){return q?H:y}function A(){return!qo(n.focus)||n.isNavigation}function he(){return e.state.is([uo,Go])&&!!n.waitForTransition}return{mount:C,go:R,scroll:k,getNext:x,getPrev:S,getAdjacent:m,getEnd:ne,setIndex:ae,getIndex:de,toIndex:I,toPage:W,toDest:K,hasFocus:A,isBusy:he}}var rm="http://www.w3.org/2000/svg",am="m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z",ar=40;function sm(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,b=u.arrows,v=u.track,g=b,h=u.prev,f=u.next,x,S,y={};function w(){N(),o(cn,H)}function H(){U(),w()}function N(){var k=n.arrows;k&&!(h&&f)&&V(),h&&f&&(_o(y,{prev:h,next:f}),Wo(g,k?"":"none"),Pn(g,S=Ds+"--"+n.direction),k&&(O(),R(),Ct([h,f],Zo,v.id),l(hd,h,f)))}function U(){i.destroy(),Hn(g,S),x?(Ti(b?[h,f]:g),h=f=null):kn([h,f],Os)}function O(){o([si,po,Qt,Ii,Or],R),r(f,"click",Ut(C,">")),r(h,"click",Ut(C,"<"))}function C(k){p.go(k,!0)}function V(){g=b||Gi("div",d.arrows),h=$(!0),f=$(!1),x=!0,Uo(g,[h,f]),!b&&Rs(g,v)}function $(k){var T='<button class="'+d.arrow+" "+(k?d.prev:d.next)+'" type="button"><svg xmlns="'+rm+'" viewBox="0 0 '+ar+" "+ar+'" width="'+ar+'" height="'+ar+'" focusable="false"><path d="'+(n.arrowPath||am)+'" />';return od(T)}function R(){if(h&&f){var k=e.index,T=p.getPrev(),m=p.getNext(),M=T>-1&&k<T?c.last:c.prev,E=m>-1&&k>m?c.first:c.next;h.disabled=T<0,f.disabled=m<0,Ct(h,vn,M),Ct(f,vn,E),l(fd,h,f,T,m)}}return{arrows:y,mount:w,destroy:U,update:R}}var lm=Es+"-interval";function cm(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=Jr(n.interval,e.go.bind(e,">"),O),c=d.isPaused,u=t.Elements,p=t.Elements,b=p.root,v=p.toggle,g=n.autoplay,h,f,x=g==="pause";function S(){g&&(y(),v&&Ct(v,Zo,u.track.id),x||w(),U())}function y(){n.pauseOnHover&&r(b,"mouseenter mouseleave",function(V){h=V.type==="mouseenter",N()}),n.pauseOnFocus&&r(b,"focusin focusout",function(V){f=V.type==="focusin",N()}),v&&r(v,"click",function(){x?w():H(!0)}),o([Bn,Zr,Qt],d.rewind),o(Bn,C)}function w(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),f=h=x=!1,U(),l(Fs))}function H(V){V===void 0&&(V=!0),x=!!V,U(),c()||(d.pause(),l(_s))}function N(){x||(h||f?H(!1):w())}function U(){v&&(Nn(v,Li,!x),Ct(v,vn,n.i18n[x?"play":"pause"]))}function O(V){var $=u.bar;$&&Sn($,"width",V*100+"%"),l(xd,V)}function C(V){var $=t.Slides.getAt(V);d.set($&&+$n($.slide,lm)||n.interval)}return{mount:S,destroy:d.cancel,play:w,pause:H,isPaused:c}}function dm(e,t,n){var i=Kt(e),o=i.on;function r(){n.cover&&(o(Ws,Ut(d,!0)),o([si,cn,Qt],Ut(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Yo(u.container||u.slide,"img");p&&p.src&&d(c,p,u)})}function d(c,u,p){p.style("background",c?'center/cover no-repeat url("'+u.src+'")':"",!0),Wo(u,c?"none":"")}return{mount:r,destroy:Ut(l,!1)}}var um=10,pm=600,mm=.6,gm=1.5,hm=800;function fm(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,b=d.translate,v=e.is(Ji),g,h,f=1;function x(){o(Bn,H),o([cn,Qt],N)}function S(O,C,V,$,R){var k=c();if(H(),V&&(!v||!p())){var T=t.Layout.sliderSize(),m=Qa(O)*T*Hr(un(O)/T)||0;O=d.toPosition(t.Controller.toDest(O%T))+m}var M=ad(k,O,1);f=1,C=M?0:C||Nr(un(O-k)/gm,hm),h=$,g=Jr(C,y,Ut(w,k,O,R),1),l(Go),r(Zr),g.start()}function y(){l(Ki),h&&h(),r(Ii)}function w(O,C,V,$){var R=c(),k=O+(C-O)*U($),T=(k-R)*f;b(R+T),v&&!V&&p()&&(f*=mm,un(T)<um&&S(u(p(!0)),pm,!1,h,!0))}function H(){g&&g.cancel()}function N(){g&&!g.isPaused()&&(H(),y())}function U(O){var C=n.easingFunc;return C?C(O):1-Math.pow(1-O,4)}return{mount:x,destroy:H,scroll:S,cancel:N}}var Hi={passive:!1,capture:!0};function ym(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,b=t.Controller,v=t.Elements.track,g=t.Media.reduce,h=t.Direction,f=h.resolve,x=h.orient,S=u.getPosition,y=u.exceededLimit,w,H,N,U,O,C=!1,V,$,R;function k(){l(v,ya,Za,Hi),l(v,va,Za,Hi),l(v,Fd,m,Hi),l(v,"click",z,{capture:!0}),l(v,"dragstart",Wn),o([si,cn],T)}function T(){var ee=n.drag;le(!ee),U=ee==="free"}function m(ee){if(V=!1,!$){var ue=He(ee);be(ee.target)&&(ue||!ee.button)&&(b.isBusy()?Wn(ee,!0):(R=ue?v:window,O=c.is([uo,Go]),N=null,l(R,ya,M,Hi),l(R,va,E,Hi),u.cancel(),p.cancel(),ne(ee)))}}function M(ee){if(c.is(Er)||(c.set(Er),r(pd)),ee.cancelable)if(O){u.translate(w+Q(A(ee)));var ue=he(ee)>vl,oe=C!==(C=y());(ue||oe)&&ne(ee),V=!0,r(md),Wn(ee)}else K(ee)&&(O=W(ee),Wn(ee))}function E(ee){c.is(Er)&&(c.set(Ki),r(gd)),O&&(I(ee),Wn(ee)),d(R,ya,M),d(R,va,E),O=!1}function z(ee){!$&&V&&Wn(ee,!0)}function ne(ee){N=H,H=ee,w=S()}function I(ee){var ue=ae(ee),oe=de(ue),Fe=n.rewind&&n.rewindByDrag;g(!1),U?b.scroll(oe,0,n.snap):e.is(Jo)?b.go(x(Qa(ue))<0?Fe?"<":"-":Fe?">":"+"):e.is(Ji)&&C&&Fe?b.go(y(!0)?">":"<"):b.go(b.toDest(oe),!0),g(!0)}function W(ee){var ue=n.dragMinThreshold,oe=ko(ue),Fe=oe&&ue.mouse||0,Ce=(oe?ue.touch:+ue)||10;return un(A(ee))>(He(ee)?Ce:Fe)}function K(ee){return un(A(ee))>un(A(ee,!0))}function ae(ee){if(e.is(mo)||!C){var ue=he(ee);if(ue&&ue<vl)return A(ee)/ue}return 0}function de(ee){return S()+Qa(ee)*ni(un(ee)*(n.flickPower||600),U?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function A(ee,ue){return ce(ee,ue)-ce(q(ee),ue)}function he(ee){return Ja(ee)-Ja(q(ee))}function q(ee){return H===ee&&N||H}function ce(ee,ue){return(He(ee)?ee.changedTouches[0]:ee)["page"+f(ue?"Y":"X")]}function Q(ee){return ee/(C&&e.is(Ji)?Kp:1)}function be(ee){var ue=n.noDrag;return!Ao(ee,"."+Ed+", ."+oa)&&(!ue||!Ao(ee,ue))}function He(ee){return typeof TouchEvent<"u"&&ee instanceof TouchEvent}function xe(){return O}function le(ee){$=ee}return{mount:k,disable:le,isDragging:xe}}var vm={Spacebar:" ",Right:ta,Left:ea,Up:Sd,Down:$d};function js(e){return e=ti(e)?e:e.key,vm[e]||e}var xl="keydown";function xm(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function b(){v(),o(cn,g),o(cn,v),o(Bn,f)}function v(){var S=n.keyboard;S&&(u=S==="global"?window:d,r(u,xl,x))}function g(){l(u,xl)}function h(S){p=S}function f(){var S=p;p=!0,Qc(function(){p=S})}function x(S){if(!p){var y=js(S);y===c(ea)?e.go("<"):y===c(ta)&&e.go(">")}}return{mount:b,destroy:g,disable:h}}var Eo=Es+"-lazy",kr=Eo+"-srcset",bm="["+Eo+"], ["+kr+"]";function wm(e,t,n){var i=Kt(e),o=i.on,r=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[po,Ii],p=[];function b(){n.lazyLoad&&(v(),o(Qt,v))}function v(){zn(p),g(),c?S():(r(u),o(u,h),h())}function g(){t.Slides.forEach(function(y){Is(y.slide,bm).forEach(function(w){var H=$n(w,Eo),N=$n(w,kr);if(H!==w.src||N!==w.srcset){var U=n.classes.spinner,O=w.parentElement,C=Yo(O,"."+U)||Gi("span",U,O);p.push([w,y,C]),w.src||Wo(w,"none")}})})}function h(){p=p.filter(function(y){var w=n.perPage*((n.preloadPages||1)+1)-1;return y[1].isWithin(e.index,w)?f(y):!0}),p.length||r(u)}function f(y){var w=y[0];Pn(y[1].slide,is),l(w,"load error",Ut(x,y)),Ct(w,"src",$n(w,Eo)),Ct(w,"srcset",$n(w,kr)),kn(w,Eo),kn(w,kr)}function x(y,w){var H=y[0],N=y[1];Hn(N.slide,is),w.type!=="error"&&(Ti(y[2]),Wo(H,""),d(Ws,H,N),d(Zi)),c&&S()}function S(){p.length&&f(p.shift())}return{mount:b,destroy:Ut(zn,p),check:h}}function Sm(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,b=u.getIndex,v=u.go,g=t.Direction.resolve,h=c.pagination,f=[],x,S;function y(){w(),o([cn,Qt,Or],y);var $=n.pagination;h&&Wo(h,$?"":"none"),$&&(o([Bn,Zr,Ii],V),H(),V(),r(yd,{list:x,items:f},C(e.index)))}function w(){x&&(Ti(h?ai(x.children):x),Hn(x,S),zn(f),x=null),i.destroy()}function H(){var $=e.length,R=n.classes,k=n.i18n,T=n.perPage,m=p()?u.getEnd()+1:No($/T);x=h||Gi("ul",R.pagination,c.track.parentElement),Pn(x,S=ra+"--"+O()),Ct(x,On,"tablist"),Ct(x,vn,k.select),Ct(x,Hs,O()===na?"vertical":"");for(var M=0;M<m;M++){var E=Gi("li",null,x),z=Gi("button",{class:R.page,type:"button"},E),ne=d.getIn(M).map(function(W){return W.slide.id}),I=!p()&&T>1?k.pageX:k.slideX;l(z,"click",Ut(N,M)),n.paginationKeyboard&&l(z,"keydown",Ut(U,M)),Ct(E,On,"presentation"),Ct(z,On,"tab"),Ct(z,Zo,ne.join(" ")),Ct(z,vn,es(I,M+1)),Ct(z,qi,-1),f.push({li:E,button:z,page:M})}}function N($){v(">"+$,!0)}function U($,R){var k=f.length,T=js(R),m=O(),M=-1;T===g(ta,!1,m)?M=++$%k:T===g(ea,!1,m)?M=(--$+k)%k:T==="Home"?M=0:T==="End"&&(M=k-1);var E=f[M];E&&(id(E.button),v(">"+M),Wn(R,!0))}function O(){return n.paginationDirection||n.direction}function C($){return f[u.toPage($)]}function V(){var $=C(b(!0)),R=C(b());if($){var k=$.button;Hn(k,Li),kn(k,ml),Ct(k,qi,-1)}if(R){var T=R.button;Pn(T,Li),Ct(T,ml,!0),Ct(T,qi,"")}r(vd,{list:x,items:f},$,R)}return{items:f,mount:y,destroy:w,getAt:C,update:V}}var $m=[" ","Enter"];function Cm(e,t,n){var i=n.isNavigation,o=n.slideFocus,r=[];function l(){e.splides.forEach(function(h){h.isParent||(u(e,h.splide),u(h.splide,e))}),i&&p()}function d(){r.forEach(function(h){h.destroy()}),zn(r)}function c(){d(),l()}function u(h,f){var x=Kt(h);x.on(Bn,function(S,y,w){f.go(f.is(mo)?w:S)}),r.push(x)}function p(){var h=Kt(e),f=h.on;f(Ps,v),f(bd,g),f([si,cn],b),r.push(h),h.emit(As,e.splides)}function b(){Ct(t.Elements.list,Hs,n.direction===na?"vertical":"")}function v(h){e.go(h.index)}function g(h,f){Ls($m,js(f))&&(v(h),Wn(f))}return{setup:Ut(t.Media.set,{slideFocus:qo(o)?i:o},!0),mount:l,destroy:d,remount:c}}function Tm(e,t,n){var i=Kt(e),o=i.bind,r=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,Hi)}function d(u){if(u.cancelable){var p=u.deltaY,b=p<0,v=Ja(u),g=n.wheelMinThreshold||0,h=n.wheelSleep||0;un(p)>g&&v-r>h&&(e.go(b?"<":">"),r=v),c(b)&&Wn(u)}}function c(u){return!n.releaseWheel||e.state.is(uo)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var Lm=90;function Rm(e,t,n){var i=Kt(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,d=Gi("span",Gp),c=Jr(Lm,Ut(p,!1));function u(){l&&(v(!t.Autoplay.isPaused()),Ct(r,fl,!0),d.textContent="…",o(Fs,Ut(v,!0)),o(_s,Ut(v,!1)),o([po,Ii],Ut(p,!0)))}function p(g){Ct(r,hl,g),g?(Uo(r,d),c.start()):(Ti(d),c.cancel())}function b(){kn(r,[gl,fl,hl]),Ti(d)}function v(g){l&&Ct(r,gl,g?"off":"polite")}return{mount:u,disable:v,destroy:b}}var Im=Object.freeze({__proto__:null,Media:Wp,Direction:Np,Elements:Zp,Slides:Qp,Layout:em,Clones:nm,Move:im,Controller:om,Arrows:sm,Autoplay:cm,Cover:dm,Scroll:fm,Drag:ym,Keyboard:xm,LazyLoad:wm,Pagination:Sm,Sync:Cm,Wheel:Tm,Live:Rm}),Em={prev:"Previous slide",next:"Next slide",first:"Go to first slide",last:"Go to last slide",slideX:"Go to slide %s",pageX:"Go to page %s",play:"Start autoplay",pause:"Pause autoplay",carousel:"carousel",slide:"slide",select:"Select a slide to show",slideLabel:"%s of %s"},Mm={type:"slide",role:"region",speed:400,perPage:1,cloneStatus:!0,arrows:!0,pagination:!0,paginationKeyboard:!0,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,resetProgress:!0,easing:"cubic-bezier(0.25, 1, 0.5, 1)",drag:!0,direction:"ltr",trimSpace:!0,focusableNodes:"a, button, textarea, input, select, iframe",live:!0,classes:Up,i18n:Em,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Pm(e,t,n){var i=t.Slides;function o(){Kt(e).on([si,Qt],r)}function r(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function l(d,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),Qc(c)}return{mount:o,start:l,cancel:Za}}function km(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,d=Ut(Sn,l,"transition"),c;function u(){Kt(e).bind(l,"transitionend",function(g){g.target===l&&c&&(b(),c())})}function p(g,h){var f=i.toPosition(g,!0),x=i.getPosition(),S=v(g);un(f-x)>=1&&S>=1?n.useScroll?r.scroll(f,S,!1,h):(d("transform "+S+"ms "+n.easing),i.translate(f,!0),c=h):(i.jump(g),h())}function b(){d(""),r.cancel()}function v(g){var h=n.rewindSpeed;if(e.is(Ji)&&h){var f=o.getIndex(!0),x=o.getEnd();if(f===0&&g>=x||f>=x&&g===0)return h}return n.speed}return{mount:u,start:p,cancel:b}}var Am=(function(){function e(n,i){this.event=Kt(),this.Components={},this.state=Fp(ji),this.splides=[],this._o={},this._E={};var o=ti(n)?rd(document,n):n;Io(o,o+" is invalid."),this.root=o,i=Kn({label:$n(o,vn)||"",labelledby:$n(o,Ns)||""},Mm,e.defaults,i||{});try{Kn(i,JSON.parse($n(o,Es)))}catch{Io(!1,"Invalid JSON")}this._o=Object.create(Kn({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,d=this.Components;Io(l.is([ji,Wr]),"Already mounted!"),l.set(ji),this._C=d,this._T=o||this._T||(this.is(Jo)?Pm:km),this._E=i||this._E;var c=_o({},Im,this._E,{Transition:this._T});return $i(c,function(u,p){var b=u(r,d,r._o);d[p]=b,b.setup&&b.setup()}),$i(d,function(u){u.mount&&u.mount()}),this.emit(si),Pn(this.root,qp),l.set(Ki),this.emit(ts),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Ki)&&(this._C.Sync.remount(),i.Components.Sync.remount()),this},t.go=function(i){return this._C.Controller.go(i),this},t.on=function(i,o){return this.event.on(i,o),this},t.off=function(i){return this.event.off(i),this},t.emit=function(i){var o;return(o=this.event).emit.apply(o,[i].concat(ai(arguments,1))),this},t.add=function(i,o){return this._C.Slides.add(i,o),this},t.remove=function(i){return this._C.Slides.remove(i),this},t.is=function(i){return this._o.type===i},t.refresh=function(){return this.emit(Qt),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,r=this.state;return r.is(ji)?Kt(this).on(ts,this.destroy.bind(this,i)):($i(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(ks),o.destroy(),i&&zn(this.splides),r.set(Wr)),this},Ep(e,[{key:"options",get:function(){return this._o},set:function(i){this._C.Media.set(i,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),zs=Am;zs.defaults={};zs.STATES=Pp;var bl=[[si,"onMounted"],[ts,"onReady"],[Bn,"onMove"],[po,"onMoved"],[Ps,"onClick"],[ld,"onActive"],[cd,"onInactive"],[dd,"onVisible"],[ud,"onHidden"],[Qt,"onRefresh"],[cn,"onUpdated"],[Zi,"onResize"],[Kr,"onResized"],[pd,"onDrag"],[md,"onDragging"],[gd,"onDragged"],[Zr,"onScroll"],[Ii,"onScrolled"],[ks,"onDestroy"],[hd,"onArrowsMounted"],[fd,"onArrowsUpdated"],[yd,"onPaginationMounted"],[vd,"onPaginationUpdated"],[As,"onNavigationMounted"],[Fs,"onAutoplayPlay"],[xd,"onAutoplayPlaying"],[_s,"onAutoplayPause"],[Ws,"onLazyLoadLoaded"]];function Bs(...e){return e.filter(Boolean).join(" ")}function Dr(e){return e!==null&&typeof e=="object"}function os(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!os(n,t[i]));if(Dr(e)&&Dr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!os(e[o],t[o]))}return e===t}function Fm(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function _m(e,t){if(e){const n=Object.keys(e);for(let i=0;i<n.length;i++){const o=n[i];if(o!=="__proto__"&&t(e[o],o)===!1)break}}return e}function rs(e,t){const n=e;return _m(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Dr(i)?n[o]=rs(Dr(n[o])?n[o]:{},i):n[o]=i}),n}var Wm=({children:e,className:t,...n})=>s.createElement("div",{className:Bs("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),Vs=class extends s.Component{constructor(){super(...arguments),this.splideRef=s.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new zs(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=rs({},e||{}),this.slides=this.getSlides())}componentWillUnmount(){this.splide&&(this.splide.destroy(),this.splide=void 0),this.options=void 0,this.slides.length=0}componentDidUpdate(){if(!this.splide)return;const{options:e}=this.props;e&&!os(this.options,e)&&(this.splide.options=e,this.options=rs({},e));const t=this.getSlides();Fm(this.slides,t)||(this.splide.refresh(),this.slides=t)}sync(e){var t;(t=this.splide)==null||t.sync(e)}go(e){var t;(t=this.splide)==null||t.go(e)}getSlides(){var e;if(this.splide){const t=(e=this.splide.Components.Elements)==null?void 0:e.list.children;return t&&Array.prototype.slice.call(t)||[]}return[]}bind(e){bl.forEach(([t,n])=>{const i=this.props[n];typeof i=="function"&&e.on(t,(...o)=>{i(e,...o)})})}omit(e,t){return t.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}),e}render(){const{className:e,tag:t="div",hasTrack:n=!0,children:i,...o}=this.props;return s.createElement(t,{className:Bs("splide",e),ref:this.splideRef,...this.omit(o,["options",...bl.map(r=>r[1])])},n?s.createElement(Wm,null,i):i)}},Gs=({children:e,className:t,...n})=>s.createElement("li",{className:Bs("splide__slide",t),...n},e);/*!
2
2
  * Splide.js
3
3
  * Version : 4.1.3
4
4
  * License : MIT
5
5
  * Copyright: 2022 Naotoshi Fujita
6
- */const Nm="RichTextRenderer-module__link___BWeZ2",Hm={link:Nm},Om=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(i=>/^\d/.test(i))},go=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Om(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function sn(e){const{color:t,...n}=e;return n}function Yt(e,t){var o,r,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:go(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:D.scalingValue(e.letterSpacing,t),wordSpacing:D.scalingValue(e.wordSpacing,t),fontSize:D.scalingValue(n,t),lineHeight:i!==void 0?D.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(r=e.textAppearance)==null?void 0:r.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}const Ri=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:Hm.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:Dm(i),children:i.text},o));return a.jsx(a.Fragment,{children:e.map((n,i)=>{const o=n.children;return a.jsx("div",{children:t(o)},i)})})};function Dm(e){return{...e.fontFamily&&{fontFamily:go(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"}}}const jm="SvgImage-module__svg___q3xE-",zm="SvgImage-module__img___VsTm-",wl={svg:jm,img:zm},Bm=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},Vm=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,ln=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[r,l]=s.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return s.useEffect(()=>{if(typeof window<"u"&&window.CSS){const d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');l(d)}},[]),!Bm(e)||!r?a.jsx("img",{src:e,alt:"",className:yt(wl.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:yt(wl.svg,i),style:{"--svg":Vm(e),"--fill":t,"--hover-fill":n,...o??{}}})},Gm={"top-left":ht.topLeftAlignment,"top-center":ht.topCenterAlignment,"top-right":ht.topRightAlignment,"middle-left":ht.middleLeftAlignment,"middle-center":ht.middleCenterAlignment,"middle-right":ht.middleRightAlignment,"bottom-left":ht.bottomLeftAlignment,"bottom-center":ht.bottomCenterAlignment,"bottom-right":ht.bottomRightAlignment};function qm({settings:e,content:t,styles:n,isEditor:i}){const[o,r]=s.useState(null),{widthSettings:l,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:p,fontSizeLineHeight:b,textAppearance:v,color:g}=n.imageCaption??{},[h,f]=s.useState(void 0),[x,S]=s.useState(null),[y,w]=s.useState(0),[H,N]=s.useState(0),{direction:Y,transition:O,controls:C,pagination:V,imageCaption:$,triggers:R}=e,k=s.useRef(O.type),{x:T,y:m}=e.controls.offset,M=E=>{o&&o.go(E)};return s.useEffect(()=>{if(!x)return;const E=new ResizeObserver(z=>{if(!o)return;const[ne]=z;f({width:Math.round(ne.contentRect.width),height:Math.round(ne.contentRect.height)})});return E.observe(x),()=>E.unobserve(x)},[x]),s.useEffect(()=>{!o||k.current===O.type||(N(E=>E+1),k.current=O.type)},[O.type]),a.jsx("div",{className:yt(ht.wrapper,{[ht.editor]:i}),ref:S,children:a.jsxs("div",{className:ht.sliderInner,style:{width:h?h.width:"100%",height:h?h.height:"100%",backgroundColor:O.backgroundColor&&O.type==="fade in"?O.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:yt(ht.captionBlock),children:a.jsx("div",{className:ht.captionTextWrapper,children:t.map((E,z)=>a.jsx("div",{className:yt(ht.captionText,Gm[$.alignment],{[ht.withPointerEvents]:z===y&&i,[ht.active]:z===y}),style:{fontFamily:go(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":D.scalingValue(l.width,i),letterSpacing:D.scalingValue(c,i),wordSpacing:D.scalingValue(p,i),textAlign:u,fontSize:D.scalingValue(b.fontSize,i),lineHeight:D.scalingValue(b.lineHeight,i),textTransform:v.textTransform??"none",textDecoration:v.textDecoration??"none",fontVariant:v.fontVariant??"normal",color:g,transitionDuration:O.duration?`${Math.round(parseInt(O.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:ht.captionTextInner,style:{"--link-hover-color":$.linkHoverColor,"--link-color":$.linkColor,position:"relative",top:D.scalingValue($.offset.y,i),left:D.scalingValue($.offset.x,i)},children:a.jsx(Ri,{content:E.imageCaption})})},z))})}),a.jsx(Vs,{onMove:E=>{w(E.index)},ref:r,options:{arrows:!1,speed:O.duration?parseInt(O.duration):500,autoplay:R.autoPlay!==null,...R.autoPlay!==null&&{interval:parseInt(R.autoPlay)*1e3},direction:Y==="horiz"||O.type==="fade in"?"ltr":"ttb",pagination:!1,drag:R.triggersList.drag,perPage:1,width:h?h.width:"100%",height:h?h.height:"100%",type:O.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((E,z)=>a.jsx(Gs,{children:a.jsx("div",{className:ht.sliderItem,children:a.jsx("div",{className:ht.imgWrapper,children:a.jsx("img",{className:yt(ht.sliderImage,{[ht.contain]:E.image.objectFit==="contain",[ht.cover]:E.image.objectFit==="cover"}),src:E.image.url,alt:E.image.name??""})})})},z))},H),C.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:yt(ht.arrow,{[ht.arrowVertical]:Y==="vert",[ht.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:a.jsxs("button",{onClick:()=>{M("-1")},className:ht.arrowInner,style:{transform:`translate(${D.scalingValue(T,i)}, ${D.scalingValue(m*(Y==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${Y==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&a.jsx(ln,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:yt(ht.arrowImg,ht.mirror)}),!C.arrowsImgUrl&&a.jsx(Sl,{color:C.color,className:yt(ht.arrowIcon,ht.arrowImg,ht.mirror)})]})}),a.jsx("div",{className:yt(ht.arrow,ht.nextArrow,{[ht.arrowVertical]:Y==="vert",[ht.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:a.jsxs("button",{className:ht.arrowInner,onClick:()=>M("+1"),style:{transform:`translate(${D.scalingValue(T*(Y==="horiz"?-1:1),i)}, ${D.scalingValue(m,i)}) scale(${e.controls.scale/100}) rotate(${Y==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&a.jsx(ln,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:ht.arrowImg}),!C.arrowsImgUrl&&a.jsx(Sl,{color:C.color,className:yt(ht.arrowIcon,ht.arrowImg)})]})})]}),R.triggersList.click&&a.jsx("div",{className:ht.clickOverlay,onClick:()=>{o&&o.go("+1")}}),V.isActive&&a.jsx("div",{className:yt(ht.pagination,{[ht.paginationInsideBottom]:V.position==="inside-1"&&Y==="horiz",[ht.paginationInsideTop]:V.position==="inside-2"&&Y==="horiz",[ht.paginationOutsideBottom]:V.position==="outside-1"&&Y==="horiz",[ht.paginationOutsideTop]:V.position==="outside-2"&&Y==="horiz",[ht.paginationInsideLeft]:V.position==="inside-1"&&Y==="vert",[ht.paginationInsideRight]:V.position==="inside-2"&&Y==="vert",[ht.paginationOutsideLeft]:V.position==="outside-1"&&Y==="vert",[ht.paginationOutsideRight]:V.position==="outside-2"&&Y==="vert",[ht.paginationVertical]:Y==="vert"}),children:a.jsx("div",{className:ht.paginationInner,style:{backgroundColor:V.colors[2],transform:`scale(${V.scale/100}) translate(${D.scalingValue(V.offset.x,i)}, ${D.scalingValue(V.offset.y,i)}) rotate(${Y==="horiz"?"0deg":"90deg"})`},children:t.map((E,z)=>a.jsx("button",{onClick:()=>{o&&o.go(z)},className:yt(ht.paginationItem),children:a.jsx("div",{className:yt(ht.dot,{[ht.activeDot]:z===y}),style:{backgroundColor:z===y?V.colors[0]:V.colors[1],"--pagination-hover-color":V.hover}})},z))})})]})})}function Sl({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Xm={element:qm,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Slider.mp4"},defaultSize:{d:{width:400,height:400},t:{width:400,height:400},m:{width:300,height:300}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.arrowsImgUrl"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{triggers:{title:"triggers",icon:"target",tooltip:"Triggers",type:"object",properties:{triggersList:{type:"object",display:{type:"toggle-ratio-group"},properties:{click:{type:"boolean"},drag:{type:"boolean"}}},autoPlay:{type:["string","null"],label:"Auto",display:{type:"step-selector"},enum:[null,"1s","2s","3s","4s","5s"]}}},direction:{icon:"horizontal-resize",tooltip:"Direction",type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},transition:{title:"transit",icon:"transition",tooltip:"Transition",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade in"]},backgroundColor:{type:["string","null"],title:"BG Color",display:{visible:!1,type:"settings-color-picker",format:"single"}},duration:{type:"string",label:"icon:hourglass",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},controls:{title:"controls",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:50,max:600,display:{type:"range-control"}},color:{title:"color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}},show:{title:"Show",type:"string",display:{type:"ratio-group"},enum:["always","on hover"]}}},pagination:{title:"nav",icon:"pagination",tooltip:"Navigation",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"socket",direction:"horizontal"},type:"string",enum:["outside-1","outside-2","inside-1","inside-2"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:10,max:400,display:{type:"range-control"}},colors:{display:{type:"settings-color-picker",format:"multiple"},title:"color",type:"array",items:{type:"string"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},imageCaption:{title:"Caption",icon:"text-icon",tooltip:"Caption",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}},default:{triggers:{triggersList:{click:!1,drag:!0},autoPlay:null},controls:{isActive:!0,arrowsImgUrl:null,offset:{x:0,y:0},scale:100,color:"#000000",hover:"#cccccc",show:"always"},transition:{type:"slide",duration:"500ms",backgroundColor:null},pagination:{isActive:!0,scale:50,position:"inside-1",offset:{x:0,y:0},colors:["#cccccc","#cccccc","#000000"],hover:"#cccccc"},direction:"horiz",imageCaption:{offset:{x:0,y:0},isActive:!0,alignment:"middle-center",linkColor:"#cccccc",linkHoverColor:"#cccccc"}},displayRules:[{if:{name:"direction",value:"vert"},then:{name:"properties.pagination.properties.position.display.direction",value:"vertical"}},{if:{name:"transition.type",value:"fade in"},then:{name:"properties.transition.properties.backgroundColor.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{placeholder:"Add Caption...",label:"Description",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}},Um="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Ym="ImageRevealSlider-module__image___Qjt-e",Km="ImageRevealSlider-module__link___N-iLG",Zm="ImageRevealSlider-module__cursor___2U03d",Pi={imageRevealSlider:Um,image:Ym,link:Km,cursor:Zm};function $l(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const r=i.width?Number.parseFloat(i.width):o.naturalWidth,l=o.naturalHeight/o.naturalWidth*r,d=r/2,c=l/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-c&&t<=i.y+c)return!0}return!1}function xa(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Jm(e,t,n,i){let o,r;if(t==="custom"){o=n;const l=await xa(e);r=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await xa(e);r=l.height/l.width*o}else{const l=await xa(e);o=l.width,r=l.height}return{width:o,height:r,finalWidth:`${o}px`}}function Qm({settings:e,content:t,isEditor:n}){const[i,o]=s.useState(null),[r,l]=s.useState([]),[d,c]=s.useState(0),u=s.useRef(0),[p,b]=s.useState({x:0,y:0}),[v,g]=s.useState(1),[h,f]=s.useState("none"),x=s.useRef({x:0,y:0}),[S,y]=s.useState(!1),{sizeType:w,imageWidth:H,randomRangeImageWidth:N}=e.imageSize,{revealPosition:Y,visible:O}=e.position,{cursorType:C,target:V,defaultCursorScale:$,defaultCursor:R,hoverCursorScale:k,hoverCursor:T}=e.cursor;s.useEffect(()=>{if(!i)return;const E=(I,W)=>{const K=i.getBoundingClientRect(),ae=I-K.left,de=W-K.top;if(b({x:ae,y:de}),C==="system"){f("none"),g(1);return}const A=ae,he=de,q=document.elementFromPoint(K.left+A,K.top+he);if(q&&q.closest("a")){f("none"),g(1);return}const ce=$l(A,he,r)||V==="area"?{img:T??"none",scale:k}:{img:R??"none",scale:$};f(ce.img),g(ce.scale)},z=I=>{I.stopPropagation(),x.current={x:I.clientX,y:I.clientY},E(I.clientX,I.clientY)},ne=()=>{S&&E(x.current.x,x.current.y)};return i.addEventListener("mousemove",z),window.addEventListener("scroll",ne,!0),()=>{i.removeEventListener("mousemove",z),window.removeEventListener("scroll",ne,!0)}},[i,S,p,C,V,T,R,k,$,r]),s.useEffect(()=>{S||(f("none"),g(0))},[S]);const m=async(E,z,ne,I={})=>{const{width:W,height:K,finalWidth:ae}=await Jm(E.image.url,w,H,N);let de=0,A=0;Y==="same"?(de=z/2,A=ne/2):(de=I.x??Math.random()*z,A=I.y??Math.random()*ne);const he=Math.min(Math.max(de,W/2),z-W/2),q=Math.min(Math.max(A,K/2),ne-K/2);return{id:u.current++,url:E.image.url,link:E.link,name:E.image.name,x:he,y:q,width:ae}};s.useEffect(()=>{if(!i||t.length===0)return;const E=i.getBoundingClientRect(),z=E.width,ne=E.height,I=[];(async()=>{const K=t[0],ae=await m(K,z,ne);I.push(ae),l(I),c(1)})()},[w,H,N,Y,i]),s.useEffect(()=>{O==="last One"&&l(E=>E.length>0?[E[E.length-1]]:[])},[O]);const M=async E=>{if(!i)return;const z=i.getBoundingClientRect(),ne=E.clientX-z.left,I=E.clientY-z.top;if(V==="image"&&!$l(ne,I,r))return;let W=0,K=0;Y==="on Click"?(W=ne,K=I):Y==="same"?(W=z.width/2,K=z.height/2):(W=Math.random()*z.width,K=Math.random()*z.height);const ae=t[d],de=await m(ae,z.width,z.height,{x:W,y:K});l(A=>O==="all"?[...A,de]:[de]),c(A=>A>=t.length-1?0:A+1)};return a.jsxs("div",{ref:o,onClick:M,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),className:Pi.imageRevealSlider,style:{cursor:h==="none"?"default":"none"},children:[r.map(E=>a.jsx("div",{className:Pi.wrapper,style:{top:`${E.y}px`,left:`${E.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:E.width??"auto",height:"auto",cursor:h==="none"?"default":"none"},children:V==="area"&&E.link?a.jsx("a",{href:E.link,target:"_blank",className:Pi.link,children:a.jsx("img",{src:E.url,alt:E.name,className:Pi.image},E.id)}):a.jsx("img",{src:E.url,alt:E.name,className:Pi.image},E.id)},E.id)),S&&a.jsx("div",{className:Pi.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${v})`,backgroundImage:`url('${h}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const eg={element:Qm,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Click_Gallery.mp4"},defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.cursor.defaultCursor"},{path:"settings.cursor.hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{imageSize:{title:"IMG SIZE",icon:"size",tooltip:"IMG SIZE",type:"object",properties:{sizeType:{type:"string",display:{type:"ratio-group"},enum:["as Is","custom","random"]},imageWidth:{type:"number",label:"W",display:{type:"numeric-input",visible:!1}},randomRangeImageWidth:{type:"object",display:{type:"random-range-controls",visible:!1},properties:{min:{type:"number"},max:{type:"number"}}}}},cursor:{title:"cursor",icon:"cursor",tooltip:"cursor",type:"object",properties:{cursorType:{type:"string",display:{type:"ratio-group"},enum:["system","custom"]},target:{type:"string",title:"Target",display:{type:"ratio-group"},enum:["area","image"]},defaultCursor:{type:["string","null"],title:"Default",display:{type:"settings-image-input",visible:!1}},defaultCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}},hoverCursor:{type:["string","null"],title:"Hover",display:{type:"settings-image-input",visible:!1}},hoverCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}}}},position:{title:"position",icon:"transition",tooltip:"Position",type:"object",properties:{revealPosition:{type:"string",display:{type:"ratio-group"},enum:["random","same","on Click"]},visible:{type:"string",title:"Visible",display:{type:"ratio-group"},enum:["all","last One"]}}}},default:{imageSize:{sizeType:"custom",imageWidth:500,randomRangeImageWidth:{min:100,max:1e3}},cursor:{cursorType:"system",target:"area",defaultCursor:null,defaultCursorScale:2,hoverCursor:null,hoverCursorScale:2},position:{revealPosition:"random",visible:"all"}},displayRules:[{if:{name:"imageSize.sizeType",value:"custom"},then:{name:"properties.imageSize.properties.imageWidth.display.visible",value:!0}},{if:{name:"imageSize.sizeType",value:"random"},then:{name:"properties.imageSize.properties.randomRangeImageWidth.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"}],then:{name:"properties.cursor.properties.defaultCursor.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"},{name:"cursor.defaultCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.defaultCursorScale.display.visible",value:!0}},{if:{name:"cursor.cursorType",value:"custom"},then:{name:"properties.cursor.properties.hoverCursor.display.visible",value:!0}},{if:[{name:"cursor.cursorType",value:"custom"},{name:"cursor.hoverCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.hoverCursorScale.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQP84JKRDT7WNWDQZR4Y9.png",name:"Slider-4.png"},link:""}]}}}},tg="LightBox-module__hidden___9s-9x",ng="LightBox-module__heroImage___sTxNF",ig="LightBox-module__background___rm9ml",og="LightBox-module__editor___4ACaY",rg="LightBox-module__contentStyle___Bgnsq",ag="LightBox-module__imageStyle___tLIlB",sg="LightBox-module__imgWrapper___LuFUp",lg="LightBox-module__contain___8-yaS",cg="LightBox-module__cover___hNvOG",dg="LightBox-module__caption___b6L2I",ug="LightBox-module__captionTextInner___rCGNH",pg="LightBox-module__lightboxSplide___XFuWC",mg="LightBox-module__arrow___iz38X",gg="LightBox-module__arrowVertical___Zfz81",hg="LightBox-module__nextArrow___zkAQN",fg="LightBox-module__arrowInner___p48sW",yg="LightBox-module__arrowIcon___3VaFf",vg="LightBox-module__arrowImg___pNV88",xg="LightBox-module__mirror___pjeXc",bg="LightBox-module__thumbsWrapper___GB-nU",wg="LightBox-module__thumbsContainerVertical___wttk5",Sg="LightBox-module__thumbsContainer___osSma",$g="LightBox-module__thumbsAlignStart___MO6tY",Cg="LightBox-module__thumbsAlignCenter___Q4sUx",Tg="LightBox-module__thumbsAlignEnd___p4y9R",Lg="LightBox-module__thumbItem___HvnF3",Rg="LightBox-module__closeButton___g2khP",Ig="LightBox-module__fadeIn___0m5GW",Eg="LightBox-module__slideInLeft___gPYwC",Mg="LightBox-module__slideInRight___S-pPp",Pg="LightBox-module__slideInTop___DFdAj",kg="LightBox-module__slideInBottom___m27kZ",Ag="LightBox-module__fadeOut___55qBR",Fg="LightBox-module__slideOutLeft___NvU7P",_g="LightBox-module__slideOutRight___SK7eC",Wg="LightBox-module__slideOutTop___Vgg0z",Ng="LightBox-module__slideOutBottom___nJ0Ef",Hg="LightBox-module__scaleSlide___vZriG",et={hidden:tg,heroImage:ng,background:ig,editor:og,contentStyle:rg,imageStyle:ag,imgWrapper:sg,contain:lg,cover:cg,caption:dg,captionTextInner:ug,lightboxSplide:pg,arrow:mg,arrowVertical:gg,nextArrow:hg,arrowInner:fg,arrowIcon:yg,arrowImg:vg,mirror:xg,thumbsWrapper:bg,thumbsContainerVertical:wg,thumbsContainer:Sg,thumbsAlignStart:$g,thumbsAlignCenter:Cg,thumbsAlignEnd:Tg,thumbItem:Lg,closeButton:Rg,fadeIn:Ig,slideInLeft:Eg,slideInRight:Mg,slideInTop:Pg,slideInBottom:kg,fadeOut:Ag,slideOutLeft:Fg,slideOutRight:_g,slideOutTop:Wg,slideOutBottom:Ng,scaleSlide:Hg},sr=(e,t,n)=>{const i={},[o,r]=e.split("-");return o==="top"?(i.top="0",i.bottom="auto"):o==="middle"?(i.top="50%",i.bottom="auto"):o==="bottom"&&(i.top="auto",i.bottom="0"),r==="left"?(i.left="0",i.right="auto"):r==="center"?(i.left="50%",i.right="auto"):r==="right"&&(i.left="auto",i.right="0"),o==="middle"&&r==="center"?i.transform=`translate(calc(-50% + ${D.scalingValue(t.x,n)}), calc(-50% + ${D.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${D.scalingValue(t.x,n)}, calc(-50% + ${D.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${D.scalingValue(t.x,n)}), ${D.scalingValue(t.y,n)})`:i.transform=`translate(${D.scalingValue(t.x,n)}, ${D.scalingValue(t.y,n)})`,i};function _d(e){const t=window.getComputedStyle(e);return{top:parseFloat(t.paddingTop)||0,right:parseFloat(t.paddingRight)||0,bottom:parseFloat(t.paddingBottom)||0,left:parseFloat(t.paddingLeft)||0}}function Og(e){const t=e.trim().split(/\s+/),n=i=>{if(i.endsWith("%"))return parseFloat(i)/100;switch(i){case"left":case"top":return 0;case"right":case"bottom":return 1;case"center":return .5;default:return .5}};if(t.length===1){const i=t[0];return i==="center"?{x:.5,y:.5}:i==="top"||i==="bottom"?{x:.5,y:n(i)}:i==="left"||i==="right"?{x:n(i),y:.5}:{x:n(i),y:.5}}return{x:n(t[0]),y:n(t[1])}}function Wd(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,r=n/i;if(r>o){const d=e;return{renderedW:d,renderedH:d/r}}const l=t;return{renderedW:l*r,renderedH:l}}function Dg(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,r=n/i;if(r>o){const d=t;return{renderedW:d*r,renderedH:d}}const l=e;return{renderedW:l,renderedH:l/r}}function Nd(e,t,n,i,o){const{x:r,y:l}=Og(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function jg(e){const t=e.getBoundingClientRect(),n=t.width,i=t.height;if(!n||!i)return"center center";const o=e instanceof HTMLVideoElement?e.videoWidth:e.naturalWidth,r=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight,{objectFit:l,objectPosition:d}=window.getComputedStyle(e),c=l==="cover"?Dg:Wd,{renderedW:u,renderedH:p}=c(n,i,o,r),{offsetX:b,offsetY:v}=Nd(n,i,u,p,d),g=(b+u/2)/n*100,h=(v+p/2)/i*100;return`${g}% ${h}%`}function zg(e){return jg(e)}function jr(e){const t=e.getBoundingClientRect(),n=_d(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),r=e.naturalWidth,l=e.naturalHeight,{renderedW:d,renderedH:c}=Wd(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:b}=Nd(i,o,d,c,u),v=t.left+n.left,g=t.top+n.top;return{x:p+v,y:b+g,width:d,height:c}}function Cl(e){const t=e.getBoundingClientRect(),n=_d(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Tl(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const i=t[1].split(",").map(o=>parseFloat(o.trim()));return i.length===4?i[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const i=n[1].substring(6,8);return parseInt(i,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function Bg(e,t){const n=(()=>{if(e==="fade in")return et.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return et.slideInLeft;case"right":return et.slideInRight;case"top":return et.slideInTop;case"bottom":return et.slideInBottom;default:return et.slideInRight}return et.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return et.fadeIn;if(e==="slide in")switch(t){case"left":return et.slideInLeft;case"right":return et.slideInRight;case"top":return et.slideInTop;case"bottom":return et.slideInBottom;default:return et.slideInRight}return et.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return et.fadeOut;if(e==="slide in")switch(t){case"left":return et.slideOutLeft;case"right":return et.slideOutRight;case"top":return et.slideOutTop;case"bottom":return et.slideOutBottom;default:return et.slideOutRight}return et.fadeOut})(),r=(()=>{if(e==="fade in")return et.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return et.slideOutLeft;case"right":return et.slideOutRight;case"top":return et.slideOutTop;case"bottom":return et.slideOutBottom;default:return et.slideOutRight}return et.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:r}}const Vg=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:r,isPreviewMode:l})=>{const[d,c]=s.useState(!1),{url:u}=e.thumbnailBlock.cover;return s.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:u,alt:"Cover",className:et.heroImage,onClick:()=>c(!0)}),a.jsx(Gg,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},Gg=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:d})=>{var ie;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:b,wordSpacing:v,fontSizeLineHeight:g,textAppearance:h,color:f}=i.imageCaption??{},[x,S]=s.useState(0),[y,w]=s.useState(0),[H,N]=s.useState(!1),[Y,O]=s.useState(!1),[C,V]=s.useState({}),$=s.useRef(null),R=s.useRef(null),k=s.useRef(null),T=s.useRef(!1),m=s.useRef(null),M=s.useRef(null),E=s.useRef(null),z=s.useRef(null),ne=s.useRef(!1),I=s.useRef(null),[W,K]=s.useState(!1),{appear:ae,triggers:de,slider:A,thumbnail:he,controls:q,area:ce,caption:Q,layout:be}=o.lightboxBlock,{appearClass:He,backdropAppearClass:xe,backdropDisappearClass:le,disappearClass:ee}=Bg(ae.type,ae.direction),ue=(d==null?void 0:d.itemId)??null;s.useEffect(()=>{const j=()=>{setTimeout(()=>{var J,te;(te=(J=$.current)==null?void 0:J.splide)==null||te.refresh()},16)},B=()=>{w(J=>J+1)};return window.addEventListener("ArticleEditor.Layout:change",j),window.addEventListener("ArticleEditor.ComponentContent:change",B),()=>{window.removeEventListener("ArticleEditor.Layout:change",j),window.removeEventListener("ArticleEditor.ComponentContent:change",B)}},[]),s.useEffect(()=>{if(!e||!he.isActive){K(!1);return}const j=I.current;if(!j)return;const B=()=>{A.direction==="horiz"?K(j.scrollWidth>j.clientWidth):K(j.scrollHeight>j.clientHeight)};B();const J=new ResizeObserver(B);return J.observe(j),()=>J.disconnect()},[e,he.isActive,n.length,C,A.direction]);const oe=s.useCallback(()=>{const j=window.matchMedia("(max-width: 768px)").matches,B=Tl(ce.color);j&&!l&&B>.9&&(document.body.style.backgroundColor=""),N(!0),T.current=!0;const J=te=>{te.target===m.current&&te.animationName&&(m.current&&M.current&&m.current.removeEventListener("animationend",M.current),M.current=null,T.current&&(T.current=!1,t()),N(!1))};m.current&&(M.current=J,m.current.addEventListener("animationend",J))},[t,ce.color,l]),Fe=(j,B,J)=>{var te,$e;if(j){if(de.type==="click"&&de.switch==="image")de.repeat==="close"&&x===n.length-1?oe():(te=$.current)==null||te.go("+1");else if(de.type==="click"&&de.switch==="50/50"){const ye=j.getBoundingClientRect(),F=B-ye.left,ve=J-ye.top,pe=ye.width,Z=ye.height;let me;A.direction==="horiz"?me=F<pe/2?"-1":"+1":me=ve<Z/2?"-1":"+1",($e=$.current)==null||$e.go(me)}}},Ce=j=>{if(ne.current){ne.current=!1;return}const B=n[x],J=(B==null?void 0:B.image.objectFit)==="cover";let te,$e;if("changedTouches"in j&&j.changedTouches.length>0)te=j.changedTouches[0].clientX,$e=j.changedTouches[0].clientY;else if("clientX"in j)te=j.clientX,$e=j.clientY;else return;let ye;if(J&&k.current){const F=Cl(k.current);ye=te>=F.left&&te<=F.right&&$e>=F.top&&$e<=F.bottom}else{const F=k.current?jr(k.current):null;if(!F){j.target===j.currentTarget&&oe();return}ye=te>=F.x&&te<=F.x+F.width&&$e>=F.y&&$e<=F.y+F.height}ye?Fe(k.current,te,$e):oe()},P=j=>{const B=j.target;(B.classList.contains(et.thumbsWrapper)||B.classList.contains(et.thumbsContainer))&&Ce(j)};s.useEffect(()=>{if(!e)return;const j=B=>{var J,te;if(B.key==="Escape"){oe();return}if(B.key==="ArrowRight"){S($e=>($e+1)%Math.max(n.length,1)),(J=$.current)==null||J.go("+1");return}B.key==="ArrowLeft"&&(S($e=>($e-1+Math.max(n.length,1))%Math.max(n.length,1)),(te=$.current)==null||te.go("-1"))};return window.addEventListener("keydown",j),()=>{window.removeEventListener("keydown",j)}},[e,oe,n.length]),s.useEffect(()=>{if(e){if(S(0),w(B=>B+1),T.current=!1,N(!1),O(!1),V({}),!ue)return;const j=new CustomEvent("page-overlay",{detail:{itemId:ue}});window.dispatchEvent(j)}return()=>{m.current&&M.current&&(m.current.removeEventListener("animationend",M.current),M.current=null),O(!1)}},[e,ue]),s.useEffect(()=>{R.current!==null&&R.current!==A.type&&w(j=>j+1),R.current=A.type},[A.type]),s.useEffect(()=>{if(!e)return;const j=document.body.style.overflow,B=window.matchMedia("(max-width: 768px)").matches,J=Tl(ce.color);document.body.style.overflow="hidden",O(!1);const te=ye=>{ye.target===m.current&&!T.current&&ye.animationName&&(B&&!l&&J>.9&&(document.body.style.backgroundColor=ce.color),O(!0),m.current&&E.current&&m.current.removeEventListener("animationend",E.current),E.current=null)};m.current&&(E.current=te,m.current.addEventListener("animationend",te));const $e=ye=>{const F=ye.target;F&&(F.closest(`.${et.thumbsWrapper}`)||F.closest(`.${et.thumbsContainer}`))||A.type!=="slide"&&ye.preventDefault()};return document.addEventListener("touchmove",$e,{passive:!1}),()=>{document.body.style.overflow=j,document.removeEventListener("touchmove",$e),m.current&&E.current&&(m.current.removeEventListener("animationend",E.current),E.current=null),O(!1)}},[e,l,ce.color,A.type]),s.useEffect(()=>{if(!e)return;const j=B=>{var te,$e;if(T.current){B.stopPropagation();return}if(ne.current){ne.current=!1;return}const J=B.target;if(!(J&&(J.closest(`.${et.thumbsContainer}`)||J.closest(`.${et.thumbItem}`)||J.closest(`.${et.arrow}`)||J.closest(`.${et.closeButton}`)||J.closest(`.${et.caption}`)))){if(A.type==="slide"&&de.type==="drag"&&(($e=(te=$.current)==null?void 0:te.splide)!=null&&$e.root)){const ye=$.current.splide.root;if(J&&(ye.contains(J)||ye===J))return}if(B.touches.length===0&&B.changedTouches.length>0){const ye=n[x],F=(ye==null?void 0:ye.image.objectFit)==="cover",ve=B.changedTouches[0];let pe;if(F&&k.current){const Z=Cl(k.current);pe=ve.clientX>=Z.left&&ve.clientX<=Z.right&&ve.clientY>=Z.top&&ve.clientY<=Z.bottom}else{const Z=k.current?jr(k.current):null;if(!Z)return;pe=ve.clientX>=Z.x&&ve.clientX<=Z.x+Z.width&&ve.clientY>=Z.y&&ve.clientY<=Z.y+Z.height}if(!pe){B.stopPropagation(),T.current=!0;const Z=me=>{me.stopPropagation(),me.preventDefault(),document.removeEventListener("click",Z,!0)};document.addEventListener("click",Z,!0),oe()}}}};return document.addEventListener("touchend",j,{passive:!0}),()=>{document.removeEventListener("touchend",j)}},[e,oe,x,n]);const U=(A.type==="scale"||A.type==="fade")&&A.direction==="vert"&&de.type==="drag";s.useEffect(()=>{var me,De;if(!e||!U||!((De=(me=$.current)==null?void 0:me.splide)!=null&&De.root))return;const j=$.current.splide.root,B=30,J=(ge,G)=>{if(z.current){const Me=Math.abs(ge-z.current.x),_e=Math.abs(G-z.current.y);(Me>0||_e>0)&&(ne.current=!0)}},te=ge=>{z.current&&(ge.preventDefault(),J(ge.clientX,ge.clientY))},$e=ge=>{z.current&&ge.touches.length>0&&(ge.preventDefault(),J(ge.touches[0].clientX,ge.touches[0].clientY))},ye=(ge,G)=>{if(!z.current||!$.current){z.current=null;return}const Me=Math.abs(ge-z.current.x),_e=Math.abs(G-z.current.y);_e>B&&_e>Me&&$.current.go(G<z.current.y?"+1":"-1"),z.current=null},F=ge=>{z.current&&ye(ge.clientX,ge.clientY),document.removeEventListener("pointerup",F),document.removeEventListener("pointercancel",F),document.removeEventListener("pointermove",te)},ve=ge=>{if(z.current){if(ge.changedTouches.length>0){const G=ge.changedTouches[0];ye(G.clientX,G.clientY)}document.removeEventListener("touchend",ve),document.removeEventListener("touchcancel",ve),document.removeEventListener("touchmove",$e)}},pe=ge=>{z.current={x:ge.clientX,y:ge.clientY},ne.current=!1,document.addEventListener("pointermove",te,{passive:!1}),document.addEventListener("pointerup",F),document.addEventListener("pointercancel",F)},Z=ge=>{ge.touches.length>0&&(z.current={x:ge.touches[0].clientX,y:ge.touches[0].clientY},ne.current=!1,document.addEventListener("touchmove",$e,{passive:!1}),document.addEventListener("touchend",ve),document.addEventListener("touchcancel",ve))};return j.addEventListener("pointerdown",pe),j.addEventListener("touchstart",Z),()=>{j.removeEventListener("pointerdown",pe),j.removeEventListener("touchstart",Z),document.removeEventListener("pointermove",te),document.removeEventListener("pointerup",F),document.removeEventListener("pointercancel",F),document.removeEventListener("touchmove",$e),document.removeEventListener("touchend",ve),document.removeEventListener("touchcancel",ve),z.current=null,ne.current=!1}},[e,U,y]);const X={backgroundColor:ce.color,backdropFilter:`blur(${ce.blur}px)`,animationDuration:`${parseInt(ae.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(r)?null:Vn.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:l?null:m,className:yt(et.background,H?le:xe,{[et.editor]:l},{[et.hidden]:!e}),style:{...X,...Y&&!l&&!H?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?m:null,className:yt(et.contentStyle,H?ee:He,{[et.editor]:l},{[et.hidden]:!e}),style:{animationDuration:`${parseInt(ae.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(Vs,{onMove:j=>S(j.index),ref:$,className:et.lightboxSplide,options:{arrows:!1,speed:A.duration?parseInt(A.duration):500,direction:A.direction==="horiz"||A.type==="fade"||A.type==="scale"?"ltr":"ttb",pagination:!1,drag:de.type==="drag"&&!U,perPage:1,width:"100%",height:"100%",type:A.type==="fade"||A.type==="scale"?"fade":"loop",padding:0,rewind:de.repeat!=="close",start:0},style:{"--splide-speed":A.duration},children:n.map((j,B)=>{const J=sr(be.position,be.offset,l),te=`${D.scalingValue(be.padding.top,l)} ${D.scalingValue(be.padding.right,l)} ${D.scalingValue(be.padding.bottom,l)} ${D.scalingValue(be.padding.left,l)}`,$e=A.type==="scale"?(()=>{const{transform:ye,...F}=J;return{...F,position:"absolute",padding:te,boxSizing:"border-box","--position-transform":ye||"none"}})():{...J,position:"absolute",padding:te,boxSizing:"border-box"};return a.jsx(Gs,{children:a.jsx("div",{className:et.imgWrapper,onClick:Ce,children:a.jsx("img",{ref:B===x?k:null,className:yt(et.imageStyle,{[et.contain]:j.image.objectFit==="contain",[et.cover]:j.image.objectFit==="cover",[et.scaleSlide]:A.type==="scale"}),src:j.image.url,alt:j.image.name??"",style:{...$e,pointerEvents:j.image.objectFit==="contain"?"none":"auto"}})})},B)})},y),q.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:yt(et.arrow,{[et.arrowVertical]:A.direction==="vert"}),style:{color:q.color,"--arrow-hover-color":q.hover},children:a.jsxs("button",{className:et.arrowInner,style:{transform:`translate(${D.scalingValue(q.offset.x,l)}, ${D.scalingValue(q.offset.y*(A.direction==="horiz"?1:-1),l)}) scale(${q.scale}) rotate(${A.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var j;return(j=$.current)==null?void 0:j.go("-1")},"aria-label":"Previous",children:[q.arrowsImgUrl&&a.jsx(ln,{url:q.arrowsImgUrl,fill:q.color,hoverFill:q.hover,className:yt(et.arrowImg,et.mirror)}),!q.arrowsImgUrl&&a.jsx(Ll,{color:q.color,className:yt(et.arrowIcon,et.arrowImg,et.mirror)})]})}),a.jsx("div",{className:yt(et.arrow,et.nextArrow,{[et.arrowVertical]:A.direction==="vert"}),style:{color:q.color,"--arrow-hover-color":q.hover},children:a.jsxs("button",{className:et.arrowInner,style:{transform:`translate(${D.scalingValue(q.offset.x*(A.direction==="horiz"?-1:1),l)}, ${D.scalingValue(q.offset.y,l)}) scale(${q.scale}) rotate(${A.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var j;return(j=$.current)==null?void 0:j.go("+1")},"aria-label":"Next",children:[q.arrowsImgUrl&&a.jsx(ln,{url:q.arrowsImgUrl,fill:q.color,hoverFill:q.hover,className:et.arrowImg}),!q.arrowsImgUrl&&a.jsx(Ll,{color:q.color,className:yt(et.arrowIcon,et.arrowImg)})]})})]}),ce.closeIconUrl&&(()=>{const j=sr(ce.closeIconAlign,ce.closeIconOffset,l),B=`scale(${ce.closeIconScale})`,J=j.transform?`${j.transform} ${B}`:B;return a.jsx("button",{className:et.closeButton,style:{...j,transform:J},onClick:oe,"aria-label":"Close lightbox",children:a.jsx(ln,{url:ce.closeIconUrl,fill:ce.closeIconColor??"#000000",hoverFill:ce.closeIconHover??"#cccccc"})})})(),Q&&Q.isActive&&i.imageCaption&&((ie=n[x])==null?void 0:ie.imageCaption)&&a.jsx("div",{className:et.caption,style:{...sr(Q.alignment,Q.offset,l),fontFamily:go(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":D.scalingValue(c.width,l),letterSpacing:D.scalingValue(p,l),wordSpacing:D.scalingValue(v,l),textAlign:b,fontSize:D.scalingValue(g.fontSize,l),lineHeight:D.scalingValue(g.lineHeight,l),textTransform:h.textTransform??"none",textDecoration:h.textDecoration??"none",fontVariant:h.fontVariant??"normal",color:f},onClick:j=>j.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:et.captionTextInner,style:{"--link-color":Q.linkColor,"--link-hover-color":Q.linkHoverColor},children:a.jsx(Ri,{content:n[x].imageCaption})})}),he.isActive&&(()=>{const[j,B]=he.position.split("-"),J=A.direction==="horiz"?`${j}-left`:he.position,te=sr(J,he.offset,l),$e=()=>{if(A.direction==="horiz"){if(B==="left")return"flex-start";if(B==="center")return"center";if(B==="right")return"flex-end"}else{if(j==="top")return"flex-start";if(j==="middle")return"center";if(j==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:I,className:et.thumbsWrapper,onClick:ye=>P(ye),style:{position:l?"absolute":"fixed",...te,...A.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:yt(et.thumbsContainer,{[et.thumbsContainerVertical]:A.direction==="vert",[et.thumbsAlignStart]:he.align==="start",[et.thumbsAlignCenter]:he.align==="center",[et.thumbsAlignEnd]:he.align==="end"}),style:{gap:D.scalingValue(he.grid.gap,l),justifyContent:W?"flex-start":$e()},children:n.map((ye,F)=>{const ve=F===x,pe=C[F],me=he.grid.size*(ve?he.activeState.scale:1),De=()=>{if(he.fit!=="fit")return{};if(!pe)return A.direction==="horiz"?{height:D.scalingValue(me,l)}:{width:D.scalingValue(me,l)};const ge=pe.width/pe.height;if(A.direction==="horiz"){const G=me,Me=G*ge;return{width:D.scalingValue(Me,l),height:D.scalingValue(G,l)}}else{const G=me,Me=G/ge;return{width:D.scalingValue(G,l),height:D.scalingValue(Me,l)}}};return a.jsx("button",{className:et.thumbItem,style:{...A.direction==="horiz"&&he.fit!=="fit"?{height:D.scalingValue(me,l)}:{},...A.direction==="vert"&&he.fit!=="fit"?{width:D.scalingValue(me,l)}:{},...he.fit==="cover"?{width:D.scalingValue(me,l),height:D.scalingValue(me,l)}:{},...De(),transition:ve?"all 0.25s ease-out":"none",opacity:ve?he.activeState.opacity/100:he.opacity/100,"--thumb-hover":he.activeState.opacity/100},onClick:ge=>{var G;ge.stopPropagation(),S(F),(G=$.current)==null||G.go(F)},onMouseEnter:()=>{var ge;he.triggers==="hov"&&((ge=$.current)==null||ge.go(F))},children:a.jsx("img",{src:ye.image.url,alt:ye.image.name??"",onLoad:ge=>{const G=ge.currentTarget;G.naturalWidth&&G.naturalHeight&&V(Me=>({...Me,[F]:{width:G.naturalWidth,height:G.naturalHeight}}))},style:{objectFit:he.fit==="cover"?"cover":"contain",...he.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...he.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${ye.image.name}-${F}`)})})})})()]})]}),document.getElementById(r))};function Ll({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const qg={element:Vg,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Lightbox.png"},defaultSize:{d:{width:440,height:550},t:{width:235,height:293},m:{width:265,height:331}},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.thumbnailBlock.cover.url",placeholderEnabled:!0},{path:"settings.controls.arrowsImgUrl"},{path:"settings.area.closeIconUrl"}]},schema:{type:"object",properties:{settings:{type:"object",properties:{thumbnailBlock:{display:{type:"settings-block",triggerEvent:"close"},type:"object",properties:{cover:{title:"COVER",icon:"cover",tooltip:"Cover Image",type:"object",properties:{url:{type:"string",display:{type:"cover-image-input"}}}}}},lightboxBlock:{display:{type:"settings-block",triggerEvent:"open"},type:"object",properties:{appear:{title:"APPEAR",icon:"transition",tooltip:"Appearance",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide in","fade in","mix"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]},direction:{type:"string",title:"From",display:{type:"direction-control"},enum:["top","left","right","bottom"]}}},triggers:{title:"TRIGGERS",icon:"target",tooltip:"Triggers",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["click","drag"]},switch:{type:"string",display:{type:"ratio-group"},enum:["image","50/50"]},repeat:{type:"string",title:"Repeat",display:{visible:!1,type:"ratio-group"},enum:["close","loop"]}}},slider:{title:"SLIDER",icon:"horizontal-resize",tooltip:"Slider",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade","scale"]},direction:{type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},thumbnail:{title:"THUMB",icon:"thumbnail",tooltip:"Thumbnail",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},fit:{type:"string",display:{type:"ratio-group"},enum:["cover","fit"]},align:{type:"string",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},triggers:{type:"string",title:"Triggers",display:{type:"ratio-group",direction:"horizontal"},enum:["clk","hov"]},grid:{type:"object",title:"Grid",display:{type:"group"},properties:{size:{type:"number",label:"Box",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},gap:{type:"number",label:"Gap",scalingEnabled:!0,min:0,display:{type:"numeric-input"}}}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}},activeState:{type:"object",title:"ACTIVE",display:{type:"group"},properties:{scale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control"}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}}}}}},layout:{title:"LAYOUT",icon:"layout",tooltip:"Layout",type:"object",properties:{position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},padding:{type:"object",title:"Padding",display:{type:"padding-controls"},properties:{top:{min:0,step:1,type:"number"},left:{min:0,step:1,type:"number"},right:{min:0,step:1,type:"number"},bottom:{min:0,step:1,type:"number"}}}}},controls:{title:"CONTROLS",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},color:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},area:{title:"AREA",icon:"area",tooltip:"Area",type:"object",properties:{color:{type:"string",display:{type:"settings-color-picker",format:"single"}},blur:{type:"number",label:"icon:blur",display:{type:"numeric-input"}},closeIconUrl:{type:["string","null"],title:"Close Icon",display:{type:"settings-image-input"}},closeIconAlign:{display:{type:"align-grid",direction:"horizontal"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},closeIconScale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},closeIconOffset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},closeIconColor:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},closeIconHover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},caption:{title:"DESC",icon:"text-icon",tooltip:"Description",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}}}},default:{d:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"slide in",duration:"1000ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.01,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:0,bottom:.06,left:0}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},linkColor:"#cccccc",linkHoverColor:"#cccccc"}}},m:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"horiz",duration:"1000ms"},thumbnail:{isActive:!0,position:"bottom-center",fit:"fit",align:"start",triggers:"hov",grid:{size:.1,gap:.05},offset:{x:.01,y:-.05},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.05,bottom:.06,left:.05}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}},t:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.03,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.1,bottom:.06,left:.1}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}}},displayRules:[{if:{name:"lightboxBlock.appear.type",value:"slide in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.slider.direction",value:"vert"},then:{name:"properties.lightboxBlock.properties.thumbnail.properties.align.display.direction",value:"vertical"}},{if:{name:"lightboxBlock.appear.type",value:"mix"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.appear.type",value:"fade in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!1}},{if:[{name:"lightboxBlock.triggers.type",value:"click"},{name:"lightboxBlock.triggers.switch",value:"image"}],then:{name:"properties.lightboxBlock.properties.triggers.properties.repeat.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{label:"Description",placeholder:"Add Caption...",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/2.jpg",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/3.jpg",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/4.jpg",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}};function lr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Xg(e){return`
6
+ */const Nm="RichTextRenderer-module__link___BWeZ2",Hm={link:Nm},Om=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(i=>/^\d/.test(i))},go=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Om(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function sn(e){const{color:t,...n}=e;return n}function Yt(e,t){var o,r,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:go(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:D.scalingValue(e.letterSpacing,t),wordSpacing:D.scalingValue(e.wordSpacing,t),fontSize:D.scalingValue(n,t),lineHeight:i!==void 0?D.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(r=e.textAppearance)==null?void 0:r.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}const Ri=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:Hm.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:Dm(i),children:i.text},o));return a.jsx(a.Fragment,{children:e.map((n,i)=>{const o=n.children;return a.jsx("div",{children:t(o)},i)})})};function Dm(e){return{...e.fontFamily&&{fontFamily:go(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"}}}const jm="SvgImage-module__svg___q3xE-",zm="SvgImage-module__img___VsTm-",wl={svg:jm,img:zm},Bm=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},Vm=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,ln=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[r,l]=s.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return s.useEffect(()=>{if(typeof window<"u"&&window.CSS){const d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');l(d)}},[]),!Bm(e)||!r?a.jsx("img",{src:e,alt:"",className:yt(wl.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:yt(wl.svg,i),style:{"--svg":Vm(e),"--fill":t,"--hover-fill":n,...o??{}}})},Gm={"top-left":ht.topLeftAlignment,"top-center":ht.topCenterAlignment,"top-right":ht.topRightAlignment,"middle-left":ht.middleLeftAlignment,"middle-center":ht.middleCenterAlignment,"middle-right":ht.middleRightAlignment,"bottom-left":ht.bottomLeftAlignment,"bottom-center":ht.bottomCenterAlignment,"bottom-right":ht.bottomRightAlignment};function qm({settings:e,content:t,styles:n,isEditor:i}){const[o,r]=s.useState(null),{widthSettings:l,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:p,fontSizeLineHeight:b,textAppearance:v,color:g}=n.imageCaption??{},[h,f]=s.useState(void 0),[x,S]=s.useState(null),[y,w]=s.useState(0),[H,N]=s.useState(0),{direction:U,transition:O,controls:C,pagination:V,imageCaption:$,triggers:R}=e,k=s.useRef(O.type),{x:T,y:m}=e.controls.offset,M=E=>{o&&o.go(E)};return s.useEffect(()=>{if(!x)return;const E=new ResizeObserver(z=>{if(!o)return;const[ne]=z;f({width:Math.round(ne.contentRect.width),height:Math.round(ne.contentRect.height)})});return E.observe(x),()=>E.unobserve(x)},[x]),s.useEffect(()=>{!o||k.current===O.type||(N(E=>E+1),k.current=O.type)},[O.type]),a.jsx("div",{className:yt(ht.wrapper,{[ht.editor]:i}),ref:S,children:a.jsxs("div",{className:ht.sliderInner,style:{width:h?h.width:"100%",height:h?h.height:"100%",backgroundColor:O.backgroundColor&&O.type==="fade in"?O.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:yt(ht.captionBlock),children:a.jsx("div",{className:ht.captionTextWrapper,children:t.map((E,z)=>a.jsx("div",{className:yt(ht.captionText,Gm[$.alignment],{[ht.withPointerEvents]:z===y&&i,[ht.active]:z===y}),style:{fontFamily:go(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":D.scalingValue(l.width,i),letterSpacing:D.scalingValue(c,i),wordSpacing:D.scalingValue(p,i),textAlign:u,fontSize:D.scalingValue(b.fontSize,i),lineHeight:D.scalingValue(b.lineHeight,i),textTransform:v.textTransform??"none",textDecoration:v.textDecoration??"none",fontVariant:v.fontVariant??"normal",color:g,transitionDuration:O.duration?`${Math.round(parseInt(O.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:ht.captionTextInner,style:{"--link-hover-color":$.linkHoverColor,"--link-color":$.linkColor,position:"relative",top:D.scalingValue($.offset.y,i),left:D.scalingValue($.offset.x,i)},children:a.jsx(Ri,{content:E.imageCaption})})},z))})}),a.jsx(Vs,{onMove:E=>{w(E.index)},ref:r,options:{arrows:!1,speed:O.duration?parseInt(O.duration):500,autoplay:R.autoPlay!==null,...R.autoPlay!==null&&{interval:parseInt(R.autoPlay)*1e3},direction:U==="horiz"||O.type==="fade in"?"ltr":"ttb",pagination:!1,drag:R.triggersList.drag,perPage:1,width:h?h.width:"100%",height:h?h.height:"100%",type:O.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((E,z)=>a.jsx(Gs,{children:a.jsx("div",{className:ht.sliderItem,children:a.jsx("div",{className:ht.imgWrapper,children:a.jsx("img",{className:yt(ht.sliderImage,{[ht.contain]:E.image.objectFit==="contain",[ht.cover]:E.image.objectFit==="cover"}),src:E.image.url,alt:E.image.name??""})})})},z))},H),C.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:yt(ht.arrow,{[ht.arrowVertical]:U==="vert",[ht.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:a.jsxs("button",{onClick:()=>{M("-1")},className:ht.arrowInner,style:{transform:`translate(${D.scalingValue(T,i)}, ${D.scalingValue(m*(U==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&a.jsx(ln,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:yt(ht.arrowImg,ht.mirror)}),!C.arrowsImgUrl&&a.jsx(Sl,{color:C.color,className:yt(ht.arrowIcon,ht.arrowImg,ht.mirror)})]})}),a.jsx("div",{className:yt(ht.arrow,ht.nextArrow,{[ht.arrowVertical]:U==="vert",[ht.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:a.jsxs("button",{className:ht.arrowInner,onClick:()=>M("+1"),style:{transform:`translate(${D.scalingValue(T*(U==="horiz"?-1:1),i)}, ${D.scalingValue(m,i)}) scale(${e.controls.scale/100}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&a.jsx(ln,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:ht.arrowImg}),!C.arrowsImgUrl&&a.jsx(Sl,{color:C.color,className:yt(ht.arrowIcon,ht.arrowImg)})]})})]}),R.triggersList.click&&a.jsx("div",{className:ht.clickOverlay,onClick:()=>{o&&o.go("+1")}}),V.isActive&&a.jsx("div",{className:yt(ht.pagination,{[ht.paginationInsideBottom]:V.position==="inside-1"&&U==="horiz",[ht.paginationInsideTop]:V.position==="inside-2"&&U==="horiz",[ht.paginationOutsideBottom]:V.position==="outside-1"&&U==="horiz",[ht.paginationOutsideTop]:V.position==="outside-2"&&U==="horiz",[ht.paginationInsideLeft]:V.position==="inside-1"&&U==="vert",[ht.paginationInsideRight]:V.position==="inside-2"&&U==="vert",[ht.paginationOutsideLeft]:V.position==="outside-1"&&U==="vert",[ht.paginationOutsideRight]:V.position==="outside-2"&&U==="vert",[ht.paginationVertical]:U==="vert"}),children:a.jsx("div",{className:ht.paginationInner,style:{backgroundColor:V.colors[2],transform:`scale(${V.scale/100}) translate(${D.scalingValue(V.offset.x,i)}, ${D.scalingValue(V.offset.y,i)}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:t.map((E,z)=>a.jsx("button",{onClick:()=>{o&&o.go(z)},className:yt(ht.paginationItem),children:a.jsx("div",{className:yt(ht.dot,{[ht.activeDot]:z===y}),style:{backgroundColor:z===y?V.colors[0]:V.colors[1],"--pagination-hover-color":V.hover}})},z))})})]})})}function Sl({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Xm={element:qm,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Slider.mp4"},defaultSize:{d:{width:400,height:400},t:{width:400,height:400},m:{width:300,height:300}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.arrowsImgUrl"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{triggers:{title:"triggers",icon:"target",tooltip:"Triggers",type:"object",properties:{triggersList:{type:"object",display:{type:"toggle-ratio-group"},properties:{click:{type:"boolean"},drag:{type:"boolean"}}},autoPlay:{type:["string","null"],label:"Auto",display:{type:"step-selector"},enum:[null,"1s","2s","3s","4s","5s"]}}},direction:{icon:"horizontal-resize",tooltip:"Direction",type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},transition:{title:"transit",icon:"transition",tooltip:"Transition",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade in"]},backgroundColor:{type:["string","null"],title:"BG Color",display:{visible:!1,type:"settings-color-picker",format:"single"}},duration:{type:"string",label:"icon:hourglass",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},controls:{title:"controls",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:50,max:600,display:{type:"range-control"}},color:{title:"color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}},show:{title:"Show",type:"string",display:{type:"ratio-group"},enum:["always","on hover"]}}},pagination:{title:"nav",icon:"pagination",tooltip:"Navigation",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"socket",direction:"horizontal"},type:"string",enum:["outside-1","outside-2","inside-1","inside-2"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:10,max:400,display:{type:"range-control"}},colors:{display:{type:"settings-color-picker",format:"multiple"},title:"color",type:"array",items:{type:"string"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},imageCaption:{title:"Caption",icon:"text-icon",tooltip:"Caption",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}},default:{triggers:{triggersList:{click:!1,drag:!0},autoPlay:null},controls:{isActive:!0,arrowsImgUrl:null,offset:{x:0,y:0},scale:100,color:"#000000",hover:"#cccccc",show:"always"},transition:{type:"slide",duration:"500ms",backgroundColor:null},pagination:{isActive:!0,scale:50,position:"inside-1",offset:{x:0,y:0},colors:["#cccccc","#cccccc","#000000"],hover:"#cccccc"},direction:"horiz",imageCaption:{offset:{x:0,y:0},isActive:!0,alignment:"middle-center",linkColor:"#cccccc",linkHoverColor:"#cccccc"}},displayRules:[{if:{name:"direction",value:"vert"},then:{name:"properties.pagination.properties.position.display.direction",value:"vertical"}},{if:{name:"transition.type",value:"fade in"},then:{name:"properties.transition.properties.backgroundColor.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{placeholder:"Add Caption...",label:"Description",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}},Um="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Ym="ImageRevealSlider-module__image___Qjt-e",Km="ImageRevealSlider-module__link___N-iLG",Zm="ImageRevealSlider-module__cursor___2U03d",Pi={imageRevealSlider:Um,image:Ym,link:Km,cursor:Zm};function $l(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const r=i.width?Number.parseFloat(i.width):o.naturalWidth,l=o.naturalHeight/o.naturalWidth*r,d=r/2,c=l/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-c&&t<=i.y+c)return!0}return!1}function xa(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Jm(e,t,n,i){let o,r;if(t==="custom"){o=n;const l=await xa(e);r=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await xa(e);r=l.height/l.width*o}else{const l=await xa(e);o=l.width,r=l.height}return{width:o,height:r,finalWidth:`${o}px`}}function Qm({settings:e,content:t,isEditor:n}){const[i,o]=s.useState(null),[r,l]=s.useState([]),[d,c]=s.useState(0),u=s.useRef(0),[p,b]=s.useState({x:0,y:0}),[v,g]=s.useState(1),[h,f]=s.useState("none"),x=s.useRef({x:0,y:0}),[S,y]=s.useState(!1),{sizeType:w,imageWidth:H,randomRangeImageWidth:N}=e.imageSize,{revealPosition:U,visible:O}=e.position,{cursorType:C,target:V,defaultCursorScale:$,defaultCursor:R,hoverCursorScale:k,hoverCursor:T}=e.cursor;s.useEffect(()=>{if(!i)return;const E=(I,W)=>{const K=i.getBoundingClientRect(),ae=I-K.left,de=W-K.top;if(b({x:ae,y:de}),C==="system"){f("none"),g(1);return}const A=ae,he=de,q=document.elementFromPoint(K.left+A,K.top+he);if(q&&q.closest("a")){f("none"),g(1);return}const ce=$l(A,he,r)||V==="area"?{img:T??"none",scale:k}:{img:R??"none",scale:$};f(ce.img),g(ce.scale)},z=I=>{I.stopPropagation(),x.current={x:I.clientX,y:I.clientY},E(I.clientX,I.clientY)},ne=()=>{S&&E(x.current.x,x.current.y)};return i.addEventListener("mousemove",z),window.addEventListener("scroll",ne,!0),()=>{i.removeEventListener("mousemove",z),window.removeEventListener("scroll",ne,!0)}},[i,S,p,C,V,T,R,k,$,r]),s.useEffect(()=>{S||(f("none"),g(0))},[S]);const m=async(E,z,ne,I={})=>{const{width:W,height:K,finalWidth:ae}=await Jm(E.image.url,w,H,N);let de=0,A=0;U==="same"?(de=z/2,A=ne/2):(de=I.x??Math.random()*z,A=I.y??Math.random()*ne);const he=Math.min(Math.max(de,W/2),z-W/2),q=Math.min(Math.max(A,K/2),ne-K/2);return{id:u.current++,url:E.image.url,link:E.link,name:E.image.name,x:he,y:q,width:ae}};s.useEffect(()=>{if(!i||t.length===0)return;const E=i.getBoundingClientRect(),z=E.width,ne=E.height,I=[];(async()=>{const K=t[0],ae=await m(K,z,ne);I.push(ae),l(I),c(1)})()},[w,H,N,U,i]),s.useEffect(()=>{O==="last One"&&l(E=>E.length>0?[E[E.length-1]]:[])},[O]);const M=async E=>{if(!i)return;const z=i.getBoundingClientRect(),ne=E.clientX-z.left,I=E.clientY-z.top;if(V==="image"&&!$l(ne,I,r))return;let W=0,K=0;U==="on Click"?(W=ne,K=I):U==="same"?(W=z.width/2,K=z.height/2):(W=Math.random()*z.width,K=Math.random()*z.height);const ae=t[d],de=await m(ae,z.width,z.height,{x:W,y:K});l(A=>O==="all"?[...A,de]:[de]),c(A=>A>=t.length-1?0:A+1)};return a.jsxs("div",{ref:o,onClick:M,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),className:Pi.imageRevealSlider,style:{cursor:h==="none"?"default":"none"},children:[r.map(E=>a.jsx("div",{className:Pi.wrapper,style:{top:`${E.y}px`,left:`${E.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:E.width??"auto",height:"auto",cursor:h==="none"?"default":"none"},children:V==="area"&&E.link?a.jsx("a",{href:E.link,target:"_blank",className:Pi.link,children:a.jsx("img",{src:E.url,alt:E.name,className:Pi.image},E.id)}):a.jsx("img",{src:E.url,alt:E.name,className:Pi.image},E.id)},E.id)),S&&a.jsx("div",{className:Pi.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${v})`,backgroundImage:`url('${h}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const eg={element:Qm,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Click_Gallery.mp4"},defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.cursor.defaultCursor"},{path:"settings.cursor.hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{imageSize:{title:"IMG SIZE",icon:"size",tooltip:"IMG SIZE",type:"object",properties:{sizeType:{type:"string",display:{type:"ratio-group"},enum:["as Is","custom","random"]},imageWidth:{type:"number",label:"W",display:{type:"numeric-input",visible:!1}},randomRangeImageWidth:{type:"object",display:{type:"random-range-controls",visible:!1},properties:{min:{type:"number"},max:{type:"number"}}}}},cursor:{title:"cursor",icon:"cursor",tooltip:"cursor",type:"object",properties:{cursorType:{type:"string",display:{type:"ratio-group"},enum:["system","custom"]},target:{type:"string",title:"Target",display:{type:"ratio-group"},enum:["area","image"]},defaultCursor:{type:["string","null"],title:"Default",display:{type:"settings-image-input",visible:!1}},defaultCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}},hoverCursor:{type:["string","null"],title:"Hover",display:{type:"settings-image-input",visible:!1}},hoverCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}}}},position:{title:"position",icon:"transition",tooltip:"Position",type:"object",properties:{revealPosition:{type:"string",display:{type:"ratio-group"},enum:["random","same","on Click"]},visible:{type:"string",title:"Visible",display:{type:"ratio-group"},enum:["all","last One"]}}}},default:{imageSize:{sizeType:"custom",imageWidth:500,randomRangeImageWidth:{min:100,max:1e3}},cursor:{cursorType:"system",target:"area",defaultCursor:null,defaultCursorScale:2,hoverCursor:null,hoverCursorScale:2},position:{revealPosition:"random",visible:"all"}},displayRules:[{if:{name:"imageSize.sizeType",value:"custom"},then:{name:"properties.imageSize.properties.imageWidth.display.visible",value:!0}},{if:{name:"imageSize.sizeType",value:"random"},then:{name:"properties.imageSize.properties.randomRangeImageWidth.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"}],then:{name:"properties.cursor.properties.defaultCursor.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"},{name:"cursor.defaultCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.defaultCursorScale.display.visible",value:!0}},{if:{name:"cursor.cursorType",value:"custom"},then:{name:"properties.cursor.properties.hoverCursor.display.visible",value:!0}},{if:[{name:"cursor.cursorType",value:"custom"},{name:"cursor.hoverCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.hoverCursorScale.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQP84JKRDT7WNWDQZR4Y9.png",name:"Slider-4.png"},link:""}]}}}},tg="LightBox-module__hidden___9s-9x",ng="LightBox-module__heroImage___sTxNF",ig="LightBox-module__background___rm9ml",og="LightBox-module__editor___4ACaY",rg="LightBox-module__contentStyle___Bgnsq",ag="LightBox-module__imageStyle___tLIlB",sg="LightBox-module__imgWrapper___LuFUp",lg="LightBox-module__contain___8-yaS",cg="LightBox-module__cover___hNvOG",dg="LightBox-module__caption___b6L2I",ug="LightBox-module__captionTextInner___rCGNH",pg="LightBox-module__lightboxSplide___XFuWC",mg="LightBox-module__arrow___iz38X",gg="LightBox-module__arrowVertical___Zfz81",hg="LightBox-module__nextArrow___zkAQN",fg="LightBox-module__arrowInner___p48sW",yg="LightBox-module__arrowIcon___3VaFf",vg="LightBox-module__arrowImg___pNV88",xg="LightBox-module__mirror___pjeXc",bg="LightBox-module__thumbsWrapper___GB-nU",wg="LightBox-module__thumbsContainerVertical___wttk5",Sg="LightBox-module__thumbsContainer___osSma",$g="LightBox-module__thumbsAlignStart___MO6tY",Cg="LightBox-module__thumbsAlignCenter___Q4sUx",Tg="LightBox-module__thumbsAlignEnd___p4y9R",Lg="LightBox-module__thumbItem___HvnF3",Rg="LightBox-module__closeButton___g2khP",Ig="LightBox-module__fadeIn___0m5GW",Eg="LightBox-module__slideInLeft___gPYwC",Mg="LightBox-module__slideInRight___S-pPp",Pg="LightBox-module__slideInTop___DFdAj",kg="LightBox-module__slideInBottom___m27kZ",Ag="LightBox-module__fadeOut___55qBR",Fg="LightBox-module__slideOutLeft___NvU7P",_g="LightBox-module__slideOutRight___SK7eC",Wg="LightBox-module__slideOutTop___Vgg0z",Ng="LightBox-module__slideOutBottom___nJ0Ef",Hg="LightBox-module__scaleSlide___vZriG",et={hidden:tg,heroImage:ng,background:ig,editor:og,contentStyle:rg,imageStyle:ag,imgWrapper:sg,contain:lg,cover:cg,caption:dg,captionTextInner:ug,lightboxSplide:pg,arrow:mg,arrowVertical:gg,nextArrow:hg,arrowInner:fg,arrowIcon:yg,arrowImg:vg,mirror:xg,thumbsWrapper:bg,thumbsContainerVertical:wg,thumbsContainer:Sg,thumbsAlignStart:$g,thumbsAlignCenter:Cg,thumbsAlignEnd:Tg,thumbItem:Lg,closeButton:Rg,fadeIn:Ig,slideInLeft:Eg,slideInRight:Mg,slideInTop:Pg,slideInBottom:kg,fadeOut:Ag,slideOutLeft:Fg,slideOutRight:_g,slideOutTop:Wg,slideOutBottom:Ng,scaleSlide:Hg},sr=(e,t,n)=>{const i={},[o,r]=e.split("-");return o==="top"?(i.top="0",i.bottom="auto"):o==="middle"?(i.top="50%",i.bottom="auto"):o==="bottom"&&(i.top="auto",i.bottom="0"),r==="left"?(i.left="0",i.right="auto"):r==="center"?(i.left="50%",i.right="auto"):r==="right"&&(i.left="auto",i.right="0"),o==="middle"&&r==="center"?i.transform=`translate(calc(-50% + ${D.scalingValue(t.x,n)}), calc(-50% + ${D.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${D.scalingValue(t.x,n)}, calc(-50% + ${D.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${D.scalingValue(t.x,n)}), ${D.scalingValue(t.y,n)})`:i.transform=`translate(${D.scalingValue(t.x,n)}, ${D.scalingValue(t.y,n)})`,i};function _d(e){const t=window.getComputedStyle(e);return{top:parseFloat(t.paddingTop)||0,right:parseFloat(t.paddingRight)||0,bottom:parseFloat(t.paddingBottom)||0,left:parseFloat(t.paddingLeft)||0}}function Og(e){const t=e.trim().split(/\s+/),n=i=>{if(i.endsWith("%"))return parseFloat(i)/100;switch(i){case"left":case"top":return 0;case"right":case"bottom":return 1;case"center":return .5;default:return .5}};if(t.length===1){const i=t[0];return i==="center"?{x:.5,y:.5}:i==="top"||i==="bottom"?{x:.5,y:n(i)}:i==="left"||i==="right"?{x:n(i),y:.5}:{x:n(i),y:.5}}return{x:n(t[0]),y:n(t[1])}}function Wd(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,r=n/i;if(r>o){const d=e;return{renderedW:d,renderedH:d/r}}const l=t;return{renderedW:l*r,renderedH:l}}function Dg(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,r=n/i;if(r>o){const d=t;return{renderedW:d*r,renderedH:d}}const l=e;return{renderedW:l,renderedH:l/r}}function Nd(e,t,n,i,o){const{x:r,y:l}=Og(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function jg(e){const t=e.getBoundingClientRect(),n=t.width,i=t.height;if(!n||!i)return"center center";const o=e instanceof HTMLVideoElement?e.videoWidth:e.naturalWidth,r=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight,{objectFit:l,objectPosition:d}=window.getComputedStyle(e),c=l==="cover"?Dg:Wd,{renderedW:u,renderedH:p}=c(n,i,o,r),{offsetX:b,offsetY:v}=Nd(n,i,u,p,d),g=(b+u/2)/n*100,h=(v+p/2)/i*100;return`${g}% ${h}%`}function zg(e){return jg(e)}function jr(e){const t=e.getBoundingClientRect(),n=_d(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),r=e.naturalWidth,l=e.naturalHeight,{renderedW:d,renderedH:c}=Wd(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:b}=Nd(i,o,d,c,u),v=t.left+n.left,g=t.top+n.top;return{x:p+v,y:b+g,width:d,height:c}}function Cl(e){const t=e.getBoundingClientRect(),n=_d(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Tl(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const i=t[1].split(",").map(o=>parseFloat(o.trim()));return i.length===4?i[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const i=n[1].substring(6,8);return parseInt(i,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function Bg(e,t){const n=(()=>{if(e==="fade in")return et.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return et.slideInLeft;case"right":return et.slideInRight;case"top":return et.slideInTop;case"bottom":return et.slideInBottom;default:return et.slideInRight}return et.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return et.fadeIn;if(e==="slide in")switch(t){case"left":return et.slideInLeft;case"right":return et.slideInRight;case"top":return et.slideInTop;case"bottom":return et.slideInBottom;default:return et.slideInRight}return et.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return et.fadeOut;if(e==="slide in")switch(t){case"left":return et.slideOutLeft;case"right":return et.slideOutRight;case"top":return et.slideOutTop;case"bottom":return et.slideOutBottom;default:return et.slideOutRight}return et.fadeOut})(),r=(()=>{if(e==="fade in")return et.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return et.slideOutLeft;case"right":return et.slideOutRight;case"top":return et.slideOutTop;case"bottom":return et.slideOutBottom;default:return et.slideOutRight}return et.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:r}}const Vg=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:r,isPreviewMode:l})=>{const[d,c]=s.useState(!1),{url:u}=e.thumbnailBlock.cover;return s.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:u,alt:"Cover",className:et.heroImage,onClick:()=>c(!0)}),a.jsx(Gg,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},Gg=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:d})=>{var ie;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:b,wordSpacing:v,fontSizeLineHeight:g,textAppearance:h,color:f}=i.imageCaption??{},[x,S]=s.useState(0),[y,w]=s.useState(0),[H,N]=s.useState(!1),[U,O]=s.useState(!1),[C,V]=s.useState({}),$=s.useRef(null),R=s.useRef(null),k=s.useRef(null),T=s.useRef(!1),m=s.useRef(null),M=s.useRef(null),E=s.useRef(null),z=s.useRef(null),ne=s.useRef(!1),I=s.useRef(null),[W,K]=s.useState(!1),{appear:ae,triggers:de,slider:A,thumbnail:he,controls:q,area:ce,caption:Q,layout:be}=o.lightboxBlock,{appearClass:He,backdropAppearClass:xe,backdropDisappearClass:le,disappearClass:ee}=Bg(ae.type,ae.direction),ue=(d==null?void 0:d.itemId)??null;s.useEffect(()=>{const j=()=>{setTimeout(()=>{var J,te;(te=(J=$.current)==null?void 0:J.splide)==null||te.refresh()},16)},B=()=>{w(J=>J+1)};return window.addEventListener("ArticleEditor.Layout:change",j),window.addEventListener("ArticleEditor.ComponentContent:change",B),()=>{window.removeEventListener("ArticleEditor.Layout:change",j),window.removeEventListener("ArticleEditor.ComponentContent:change",B)}},[]),s.useEffect(()=>{if(!e||!he.isActive){K(!1);return}const j=I.current;if(!j)return;const B=()=>{A.direction==="horiz"?K(j.scrollWidth>j.clientWidth):K(j.scrollHeight>j.clientHeight)};B();const J=new ResizeObserver(B);return J.observe(j),()=>J.disconnect()},[e,he.isActive,n.length,C,A.direction]);const oe=s.useCallback(()=>{const j=window.matchMedia("(max-width: 768px)").matches,B=Tl(ce.color);j&&!l&&B>.9&&(document.body.style.backgroundColor=""),N(!0),T.current=!0;const J=te=>{te.target===m.current&&te.animationName&&(m.current&&M.current&&m.current.removeEventListener("animationend",M.current),M.current=null,T.current&&(T.current=!1,t()),N(!1))};m.current&&(M.current=J,m.current.addEventListener("animationend",J))},[t,ce.color,l]),Fe=(j,B,J)=>{var te,$e;if(j){if(de.type==="click"&&de.switch==="image")de.repeat==="close"&&x===n.length-1?oe():(te=$.current)==null||te.go("+1");else if(de.type==="click"&&de.switch==="50/50"){const ye=j.getBoundingClientRect(),F=B-ye.left,ve=J-ye.top,pe=ye.width,Z=ye.height;let me;A.direction==="horiz"?me=F<pe/2?"-1":"+1":me=ve<Z/2?"-1":"+1",($e=$.current)==null||$e.go(me)}}},Ce=j=>{if(ne.current){ne.current=!1;return}const B=n[x],J=(B==null?void 0:B.image.objectFit)==="cover";let te,$e;if("changedTouches"in j&&j.changedTouches.length>0)te=j.changedTouches[0].clientX,$e=j.changedTouches[0].clientY;else if("clientX"in j)te=j.clientX,$e=j.clientY;else return;let ye;if(J&&k.current){const F=Cl(k.current);ye=te>=F.left&&te<=F.right&&$e>=F.top&&$e<=F.bottom}else{const F=k.current?jr(k.current):null;if(!F){j.target===j.currentTarget&&oe();return}ye=te>=F.x&&te<=F.x+F.width&&$e>=F.y&&$e<=F.y+F.height}ye?Fe(k.current,te,$e):oe()},P=j=>{const B=j.target;(B.classList.contains(et.thumbsWrapper)||B.classList.contains(et.thumbsContainer))&&Ce(j)};s.useEffect(()=>{if(!e)return;const j=B=>{var J,te;if(B.key==="Escape"){oe();return}if(B.key==="ArrowRight"){S($e=>($e+1)%Math.max(n.length,1)),(J=$.current)==null||J.go("+1");return}B.key==="ArrowLeft"&&(S($e=>($e-1+Math.max(n.length,1))%Math.max(n.length,1)),(te=$.current)==null||te.go("-1"))};return window.addEventListener("keydown",j),()=>{window.removeEventListener("keydown",j)}},[e,oe,n.length]),s.useEffect(()=>{if(e){if(S(0),w(B=>B+1),T.current=!1,N(!1),O(!1),V({}),!ue)return;const j=new CustomEvent("page-overlay",{detail:{itemId:ue}});window.dispatchEvent(j)}return()=>{m.current&&M.current&&(m.current.removeEventListener("animationend",M.current),M.current=null),O(!1)}},[e,ue]),s.useEffect(()=>{R.current!==null&&R.current!==A.type&&w(j=>j+1),R.current=A.type},[A.type]),s.useEffect(()=>{if(!e)return;const j=document.body.style.overflow,B=window.matchMedia("(max-width: 768px)").matches,J=Tl(ce.color);document.body.style.overflow="hidden",O(!1);const te=ye=>{ye.target===m.current&&!T.current&&ye.animationName&&(B&&!l&&J>.9&&(document.body.style.backgroundColor=ce.color),O(!0),m.current&&E.current&&m.current.removeEventListener("animationend",E.current),E.current=null)};m.current&&(E.current=te,m.current.addEventListener("animationend",te));const $e=ye=>{const F=ye.target;F&&(F.closest(`.${et.thumbsWrapper}`)||F.closest(`.${et.thumbsContainer}`))||A.type!=="slide"&&ye.preventDefault()};return document.addEventListener("touchmove",$e,{passive:!1}),()=>{document.body.style.overflow=j,document.removeEventListener("touchmove",$e),m.current&&E.current&&(m.current.removeEventListener("animationend",E.current),E.current=null),O(!1)}},[e,l,ce.color,A.type]),s.useEffect(()=>{if(!e)return;const j=B=>{var te,$e;if(T.current){B.stopPropagation();return}if(ne.current){ne.current=!1;return}const J=B.target;if(!(J&&(J.closest(`.${et.thumbsContainer}`)||J.closest(`.${et.thumbItem}`)||J.closest(`.${et.arrow}`)||J.closest(`.${et.closeButton}`)||J.closest(`.${et.caption}`)))){if(A.type==="slide"&&de.type==="drag"&&(($e=(te=$.current)==null?void 0:te.splide)!=null&&$e.root)){const ye=$.current.splide.root;if(J&&(ye.contains(J)||ye===J))return}if(B.touches.length===0&&B.changedTouches.length>0){const ye=n[x],F=(ye==null?void 0:ye.image.objectFit)==="cover",ve=B.changedTouches[0];let pe;if(F&&k.current){const Z=Cl(k.current);pe=ve.clientX>=Z.left&&ve.clientX<=Z.right&&ve.clientY>=Z.top&&ve.clientY<=Z.bottom}else{const Z=k.current?jr(k.current):null;if(!Z)return;pe=ve.clientX>=Z.x&&ve.clientX<=Z.x+Z.width&&ve.clientY>=Z.y&&ve.clientY<=Z.y+Z.height}if(!pe){B.stopPropagation(),T.current=!0;const Z=me=>{me.stopPropagation(),me.preventDefault(),document.removeEventListener("click",Z,!0)};document.addEventListener("click",Z,!0),oe()}}}};return document.addEventListener("touchend",j,{passive:!0}),()=>{document.removeEventListener("touchend",j)}},[e,oe,x,n]);const Y=(A.type==="scale"||A.type==="fade")&&A.direction==="vert"&&de.type==="drag";s.useEffect(()=>{var me,De;if(!e||!Y||!((De=(me=$.current)==null?void 0:me.splide)!=null&&De.root))return;const j=$.current.splide.root,B=30,J=(ge,G)=>{if(z.current){const Me=Math.abs(ge-z.current.x),_e=Math.abs(G-z.current.y);(Me>0||_e>0)&&(ne.current=!0)}},te=ge=>{z.current&&(ge.preventDefault(),J(ge.clientX,ge.clientY))},$e=ge=>{z.current&&ge.touches.length>0&&(ge.preventDefault(),J(ge.touches[0].clientX,ge.touches[0].clientY))},ye=(ge,G)=>{if(!z.current||!$.current){z.current=null;return}const Me=Math.abs(ge-z.current.x),_e=Math.abs(G-z.current.y);_e>B&&_e>Me&&$.current.go(G<z.current.y?"+1":"-1"),z.current=null},F=ge=>{z.current&&ye(ge.clientX,ge.clientY),document.removeEventListener("pointerup",F),document.removeEventListener("pointercancel",F),document.removeEventListener("pointermove",te)},ve=ge=>{if(z.current){if(ge.changedTouches.length>0){const G=ge.changedTouches[0];ye(G.clientX,G.clientY)}document.removeEventListener("touchend",ve),document.removeEventListener("touchcancel",ve),document.removeEventListener("touchmove",$e)}},pe=ge=>{z.current={x:ge.clientX,y:ge.clientY},ne.current=!1,document.addEventListener("pointermove",te,{passive:!1}),document.addEventListener("pointerup",F),document.addEventListener("pointercancel",F)},Z=ge=>{ge.touches.length>0&&(z.current={x:ge.touches[0].clientX,y:ge.touches[0].clientY},ne.current=!1,document.addEventListener("touchmove",$e,{passive:!1}),document.addEventListener("touchend",ve),document.addEventListener("touchcancel",ve))};return j.addEventListener("pointerdown",pe),j.addEventListener("touchstart",Z),()=>{j.removeEventListener("pointerdown",pe),j.removeEventListener("touchstart",Z),document.removeEventListener("pointermove",te),document.removeEventListener("pointerup",F),document.removeEventListener("pointercancel",F),document.removeEventListener("touchmove",$e),document.removeEventListener("touchend",ve),document.removeEventListener("touchcancel",ve),z.current=null,ne.current=!1}},[e,Y,y]);const X={backgroundColor:ce.color,backdropFilter:`blur(${ce.blur}px)`,animationDuration:`${parseInt(ae.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(r)?null:Vn.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:l?null:m,className:yt(et.background,H?le:xe,{[et.editor]:l},{[et.hidden]:!e}),style:{...X,...U&&!l&&!H?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?m:null,className:yt(et.contentStyle,H?ee:He,{[et.editor]:l},{[et.hidden]:!e}),style:{animationDuration:`${parseInt(ae.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(Vs,{onMove:j=>S(j.index),ref:$,className:et.lightboxSplide,options:{arrows:!1,speed:A.duration?parseInt(A.duration):500,direction:A.direction==="horiz"||A.type==="fade"||A.type==="scale"?"ltr":"ttb",pagination:!1,drag:de.type==="drag"&&!Y,perPage:1,width:"100%",height:"100%",type:A.type==="fade"||A.type==="scale"?"fade":"loop",padding:0,rewind:de.repeat!=="close",start:0},style:{"--splide-speed":A.duration},children:n.map((j,B)=>{const J=sr(be.position,be.offset,l),te=`${D.scalingValue(be.padding.top,l)} ${D.scalingValue(be.padding.right,l)} ${D.scalingValue(be.padding.bottom,l)} ${D.scalingValue(be.padding.left,l)}`,$e=A.type==="scale"?(()=>{const{transform:ye,...F}=J;return{...F,position:"absolute",padding:te,boxSizing:"border-box","--position-transform":ye||"none"}})():{...J,position:"absolute",padding:te,boxSizing:"border-box"};return a.jsx(Gs,{children:a.jsx("div",{className:et.imgWrapper,onClick:Ce,children:a.jsx("img",{ref:B===x?k:null,className:yt(et.imageStyle,{[et.contain]:j.image.objectFit==="contain",[et.cover]:j.image.objectFit==="cover",[et.scaleSlide]:A.type==="scale"}),src:j.image.url,alt:j.image.name??"",style:{...$e,pointerEvents:j.image.objectFit==="contain"?"none":"auto"}})})},B)})},y),q.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:yt(et.arrow,{[et.arrowVertical]:A.direction==="vert"}),style:{color:q.color,"--arrow-hover-color":q.hover},children:a.jsxs("button",{className:et.arrowInner,style:{transform:`translate(${D.scalingValue(q.offset.x,l)}, ${D.scalingValue(q.offset.y*(A.direction==="horiz"?1:-1),l)}) scale(${q.scale}) rotate(${A.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var j;return(j=$.current)==null?void 0:j.go("-1")},"aria-label":"Previous",children:[q.arrowsImgUrl&&a.jsx(ln,{url:q.arrowsImgUrl,fill:q.color,hoverFill:q.hover,className:yt(et.arrowImg,et.mirror)}),!q.arrowsImgUrl&&a.jsx(Ll,{color:q.color,className:yt(et.arrowIcon,et.arrowImg,et.mirror)})]})}),a.jsx("div",{className:yt(et.arrow,et.nextArrow,{[et.arrowVertical]:A.direction==="vert"}),style:{color:q.color,"--arrow-hover-color":q.hover},children:a.jsxs("button",{className:et.arrowInner,style:{transform:`translate(${D.scalingValue(q.offset.x*(A.direction==="horiz"?-1:1),l)}, ${D.scalingValue(q.offset.y,l)}) scale(${q.scale}) rotate(${A.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var j;return(j=$.current)==null?void 0:j.go("+1")},"aria-label":"Next",children:[q.arrowsImgUrl&&a.jsx(ln,{url:q.arrowsImgUrl,fill:q.color,hoverFill:q.hover,className:et.arrowImg}),!q.arrowsImgUrl&&a.jsx(Ll,{color:q.color,className:yt(et.arrowIcon,et.arrowImg)})]})})]}),ce.closeIconUrl&&(()=>{const j=sr(ce.closeIconAlign,ce.closeIconOffset,l),B=`scale(${ce.closeIconScale})`,J=j.transform?`${j.transform} ${B}`:B;return a.jsx("button",{className:et.closeButton,style:{...j,transform:J},onClick:oe,"aria-label":"Close lightbox",children:a.jsx(ln,{url:ce.closeIconUrl,fill:ce.closeIconColor??"#000000",hoverFill:ce.closeIconHover??"#cccccc"})})})(),Q&&Q.isActive&&i.imageCaption&&((ie=n[x])==null?void 0:ie.imageCaption)&&a.jsx("div",{className:et.caption,style:{...sr(Q.alignment,Q.offset,l),fontFamily:go(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":D.scalingValue(c.width,l),letterSpacing:D.scalingValue(p,l),wordSpacing:D.scalingValue(v,l),textAlign:b,fontSize:D.scalingValue(g.fontSize,l),lineHeight:D.scalingValue(g.lineHeight,l),textTransform:h.textTransform??"none",textDecoration:h.textDecoration??"none",fontVariant:h.fontVariant??"normal",color:f},onClick:j=>j.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:et.captionTextInner,style:{"--link-color":Q.linkColor,"--link-hover-color":Q.linkHoverColor},children:a.jsx(Ri,{content:n[x].imageCaption})})}),he.isActive&&(()=>{const[j,B]=he.position.split("-"),J=A.direction==="horiz"?`${j}-left`:he.position,te=sr(J,he.offset,l),$e=()=>{if(A.direction==="horiz"){if(B==="left")return"flex-start";if(B==="center")return"center";if(B==="right")return"flex-end"}else{if(j==="top")return"flex-start";if(j==="middle")return"center";if(j==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:I,className:et.thumbsWrapper,onClick:ye=>P(ye),style:{position:l?"absolute":"fixed",...te,...A.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:yt(et.thumbsContainer,{[et.thumbsContainerVertical]:A.direction==="vert",[et.thumbsAlignStart]:he.align==="start",[et.thumbsAlignCenter]:he.align==="center",[et.thumbsAlignEnd]:he.align==="end"}),style:{gap:D.scalingValue(he.grid.gap,l),justifyContent:W?"flex-start":$e()},children:n.map((ye,F)=>{const ve=F===x,pe=C[F],me=he.grid.size*(ve?he.activeState.scale:1),De=()=>{if(he.fit!=="fit")return{};if(!pe)return A.direction==="horiz"?{height:D.scalingValue(me,l)}:{width:D.scalingValue(me,l)};const ge=pe.width/pe.height;if(A.direction==="horiz"){const G=me,Me=G*ge;return{width:D.scalingValue(Me,l),height:D.scalingValue(G,l)}}else{const G=me,Me=G/ge;return{width:D.scalingValue(G,l),height:D.scalingValue(Me,l)}}};return a.jsx("button",{className:et.thumbItem,style:{...A.direction==="horiz"&&he.fit!=="fit"?{height:D.scalingValue(me,l)}:{},...A.direction==="vert"&&he.fit!=="fit"?{width:D.scalingValue(me,l)}:{},...he.fit==="cover"?{width:D.scalingValue(me,l),height:D.scalingValue(me,l)}:{},...De(),transition:ve?"all 0.25s ease-out":"none",opacity:ve?he.activeState.opacity/100:he.opacity/100,"--thumb-hover":he.activeState.opacity/100},onClick:ge=>{var G;ge.stopPropagation(),S(F),(G=$.current)==null||G.go(F)},onMouseEnter:()=>{var ge;he.triggers==="hov"&&((ge=$.current)==null||ge.go(F))},children:a.jsx("img",{src:ye.image.url,alt:ye.image.name??"",onLoad:ge=>{const G=ge.currentTarget;G.naturalWidth&&G.naturalHeight&&V(Me=>({...Me,[F]:{width:G.naturalWidth,height:G.naturalHeight}}))},style:{objectFit:he.fit==="cover"?"cover":"contain",...he.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...he.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${ye.image.name}-${F}`)})})})})()]})]}),document.getElementById(r))};function Ll({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const qg={element:Vg,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Lightbox.png"},defaultSize:{d:{width:440,height:550},t:{width:235,height:293},m:{width:265,height:331}},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.thumbnailBlock.cover.url",placeholderEnabled:!0},{path:"settings.controls.arrowsImgUrl"},{path:"settings.area.closeIconUrl"}]},schema:{type:"object",properties:{settings:{type:"object",properties:{thumbnailBlock:{display:{type:"settings-block",triggerEvent:"close"},type:"object",properties:{cover:{title:"COVER",icon:"cover",tooltip:"Cover Image",type:"object",properties:{url:{type:"string",display:{type:"cover-image-input"}}}}}},lightboxBlock:{display:{type:"settings-block",triggerEvent:"open"},type:"object",properties:{appear:{title:"APPEAR",icon:"transition",tooltip:"Appearance",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide in","fade in","mix"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]},direction:{type:"string",title:"From",display:{type:"direction-control"},enum:["top","left","right","bottom"]}}},triggers:{title:"TRIGGERS",icon:"target",tooltip:"Triggers",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["click","drag"]},switch:{type:"string",display:{type:"ratio-group"},enum:["image","50/50"]},repeat:{type:"string",title:"Repeat",display:{visible:!1,type:"ratio-group"},enum:["close","loop"]}}},slider:{title:"SLIDER",icon:"horizontal-resize",tooltip:"Slider",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade","scale"]},direction:{type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},thumbnail:{title:"THUMB",icon:"thumbnail",tooltip:"Thumbnail",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},fit:{type:"string",display:{type:"ratio-group"},enum:["cover","fit"]},align:{type:"string",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},triggers:{type:"string",title:"Triggers",display:{type:"ratio-group",direction:"horizontal"},enum:["clk","hov"]},grid:{type:"object",title:"Grid",display:{type:"group"},properties:{size:{type:"number",label:"Box",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},gap:{type:"number",label:"Gap",scalingEnabled:!0,min:0,display:{type:"numeric-input"}}}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}},activeState:{type:"object",title:"ACTIVE",display:{type:"group"},properties:{scale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control"}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}}}}}},layout:{title:"LAYOUT",icon:"layout",tooltip:"Layout",type:"object",properties:{position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},padding:{type:"object",title:"Padding",display:{type:"padding-controls"},properties:{top:{min:0,step:1,type:"number"},left:{min:0,step:1,type:"number"},right:{min:0,step:1,type:"number"},bottom:{min:0,step:1,type:"number"}}}}},controls:{title:"CONTROLS",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},color:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},area:{title:"AREA",icon:"area",tooltip:"Area",type:"object",properties:{color:{type:"string",display:{type:"settings-color-picker",format:"single"}},blur:{type:"number",label:"icon:blur",display:{type:"numeric-input"}},closeIconUrl:{type:["string","null"],title:"Close Icon",display:{type:"settings-image-input"}},closeIconAlign:{display:{type:"align-grid",direction:"horizontal"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},closeIconScale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},closeIconOffset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},closeIconColor:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},closeIconHover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},caption:{title:"DESC",icon:"text-icon",tooltip:"Description",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}}}},default:{d:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"slide in",duration:"1000ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.01,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:0,bottom:.06,left:0}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},linkColor:"#cccccc",linkHoverColor:"#cccccc"}}},m:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"horiz",duration:"1000ms"},thumbnail:{isActive:!0,position:"bottom-center",fit:"fit",align:"start",triggers:"hov",grid:{size:.1,gap:.05},offset:{x:.01,y:-.05},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.05,bottom:.06,left:.05}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}},t:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.03,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.1,bottom:.06,left:.1}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}}},displayRules:[{if:{name:"lightboxBlock.appear.type",value:"slide in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.slider.direction",value:"vert"},then:{name:"properties.lightboxBlock.properties.thumbnail.properties.align.display.direction",value:"vertical"}},{if:{name:"lightboxBlock.appear.type",value:"mix"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.appear.type",value:"fade in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!1}},{if:[{name:"lightboxBlock.triggers.type",value:"click"},{name:"lightboxBlock.triggers.switch",value:"image"}],then:{name:"properties.lightboxBlock.properties.triggers.properties.repeat.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{label:"Description",placeholder:"Add Caption...",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/2.jpg",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/3.jpg",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/4.jpg",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}};function lr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Xg(e){return`
7
7
  .${e}-wrapper {
8
8
  display: flex;
9
9
  flex-direction: column;
@@ -155,7 +155,7 @@
155
155
  pointer-events: auto;
156
156
  z-index: 10;
157
157
  }
158
- `}function Ug({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:r}){const l=!!n,d=i&&t||!t,{prefix:c}=D.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:b=[],buttonLabel:v,gap:g,fieldsGap:h,buttonCorners:f,buttonStroke:x,buttonPadding:S,isButtonFullWidth:y,inputCorners:w,inputStroke:H,inputPadding:N,inputColor:Y,inputTextColor:O,inputBorderColor:C,placeholderColor:V,buttonColor:$,buttonTextColor:R,buttonBorderColor:k,labelTextColor:T,successColor:m,errorColor:M,fontFamily:E,inputFontSettings:z,inputFontSize:ne,inputLineHeight:I,inputLetterSpacing:W,inputWordSpacing:K,inputTextAppearance:ae,buttonFontSettings:de,buttonFontSize:A,buttonLineHeight:he,buttonLetterSpacing:q,buttonWordSpacing:ce,buttonTextAppearance:Q,labelFontSettings:be,labelFontSize:He,labelLineHeight:xe,labelLetterSpacing:le,labelWordSpacing:ee,labelTextAppearance:ue,statusFontSettings:oe,statusFontSize:Fe,statusLineHeight:Ce,statusLetterSpacing:P,statusWordSpacing:U,statusTextAppearance:X,successMessage:ie,errorMessage:j,stateOverrides:B}=e,J=u==="B",te=b.slice(0,Math.min(p,b.length)),$e={fontSettings:{fontFamily:E,fontWeight:(z==null?void 0:z.fontWeight)??400,fontStyle:(z==null?void 0:z.fontStyle)??"normal"},fontSize:ne??.01,lineHeight:I,letterSpacing:W??0,wordSpacing:K??0,textAppearance:ae,color:O},ye=sn(Yt($e,t)),F=D.scalingValue(H??0,t),ve=D.scalingValue((I??ne??.01)+((N==null?void 0:N.top)??0)+((N==null?void 0:N.bottom)??0)+(u==="C"?H??0:(H??0)*2),t),pe={...ye,borderStyle:"solid",borderRadius:u==="C"?0:D.scalingValue(w??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:F,borderLeftWidth:0}:{borderWidth:F},paddingTop:D.scalingValue((N==null?void 0:N.top)??0,t),paddingRight:D.scalingValue((N==null?void 0:N.right)??0,t),paddingBottom:D.scalingValue((N==null?void 0:N.bottom)??0,t),paddingLeft:D.scalingValue((N==null?void 0:N.left)??0,t),height:ve,minHeight:ve},Z={fontSettings:{fontFamily:E,fontWeight:(de==null?void 0:de.fontWeight)??400,fontStyle:(de==null?void 0:de.fontStyle)??"normal"},fontSize:A??.01,lineHeight:he,letterSpacing:q??0,wordSpacing:ce??0,textAppearance:Q,color:R},me=sn(Yt(Z,t)),De=D.scalingValue(x??0,t),ge={fontSettings:{fontFamily:E,fontWeight:(be==null?void 0:be.fontWeight)??400,fontStyle:(be==null?void 0:be.fontStyle)??"normal"},fontSize:He??.01,lineHeight:xe,letterSpacing:le??0,wordSpacing:ee??0,textAppearance:ue,color:T},G=Yt(ge,t),Me={fontSettings:{fontFamily:E,fontWeight:(oe==null?void 0:oe.fontWeight)??400,fontStyle:(oe==null?void 0:oe.fontStyle)??"normal"},fontSize:Fe??.01,lineHeight:Ce,letterSpacing:P??0,wordSpacing:U??0,textAppearance:X,color:m},_e=sn(Yt(Me,t)),rt=D.buildColorVars(c,{inputColor:Y,inputTextColor:O,inputBorderColor:C,placeholderColor:V!=null&&V.trim()?V:"#cccccc",buttonColor:$,buttonTextColor:R,buttonBorderColor:k,labelTextColor:T,successColor:m,errorColor:M},Yg,Kg,B),[Je,at]=s.useState(()=>Object.fromEntries(te.map(Ae=>[Ae.name,""]))),[it,je]=s.useState("idle"),[Se,We]=s.useState(null),Be=r==="success"?"success":r==="error"?"error":it,Ze=r==="error"?j:Se,Le=r==="filled",Ve=s.useMemo(()=>{if(!Le)return Je;let Ae=null;for(const Ke of te)(Je[Ke.name]??"").trim().length>0||(Ae=Ae??{...Je},Ae[Ke.name]="Filled");return Ae??Je},[Je,Le,te]),se=Be==="error"?D.getFormFieldValidationError(te,Ve):null,Xe=`${r&&r!=="default"?`${c}-state-${r}`:""}`.trim(),ze=o==null?void 0:o.submitUrl,Re=(Ae,Ke)=>{at(Oe=>({...Oe,[Ae]:Ke}))},Pe=async Ae=>{if(Ae.preventDefault(),!d)return;const Ke=Object.fromEntries(te.map(Qe=>{var tt;return[Qe.name,((tt=Je[Qe.name])==null?void 0:tt.trim())??""]}).filter(([,Qe])=>Qe));if(!ze){je("error"),We("No integrations were found for this form.");return}if(Object.keys(Ke).length===0)return;const Oe=D.getFormFieldValidationError(te,Je);if(Oe){je("error"),We(Oe);return}je("submitting"),We(null);try{const Qe=await fetch(ze,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ke)});if(!Qe.ok){const tt=await Qe.text();throw new Error(tt||`Request failed: ${Qe.status}`)}je("success"),at(Object.fromEntries(te.map(tt=>[tt.name,""])))}catch(Qe){je("error"),We(Qe instanceof Error?Qe.message:"Something went wrong")}};return a.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${Xe}`.trim(),style:rt,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Xg(c)}}),a.jsxs("form",{onSubmit:Pe,className:`${c}-form`,children:[a.jsx("div",{className:`${c}-fields`,children:te.map((Ae,Ke)=>a.jsxs(s.Fragment,{children:[Ke>0&&a.jsx("div",{"data-controls":l?"fieldsGap":void 0,className:l?`${c}-control`:void 0,style:{height:D.scalingValue(h??0,t)}}),a.jsxs("div",{className:`${c}-field-group${J?` ${c}-labeled`:""}`,children:[J&&a.jsx("span",{className:`${c}-field-label`,style:G?{...G,lineHeight:G.fontSize}:void 0,children:Ae.label||Ae.name}),Ae.type==="textarea"?a.jsx("textarea",{name:Ae.name,autoComplete:"off",value:Ve[Ae.name]??"",onChange:Oe=>Re(Ae.name,Oe.target.value),placeholder:Ae.placeholder,className:`${c}-input`,style:pe,rows:1,"data-filled":Le||(Ve[Ae.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:Ae.type==="phone"?"tel":Ae.type==="email"?"email":"text",name:Ae.name,autoComplete:"off",value:Ve[Ae.name]??"",onChange:Oe=>Re(Ae.name,Oe.target.value),placeholder:Ae.placeholder,required:Ae.isRequired??Ae.type==="email",className:`${c}-input`,style:pe,"data-filled":Le||(Ve[Ae.name]??"").trim().length>0})]})]},Ke))}),a.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${c}-control`:void 0,style:{height:D.scalingValue(g??0,t)}}),a.jsx("div",{className:`${c}-overlay-anchor`,children:a.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:D.scalingValue(f??0,t),borderWidth:De,paddingTop:D.scalingValue((S==null?void 0:S.top)??0,t),paddingRight:D.scalingValue((S==null?void 0:S.right)??0,t),paddingBottom:D.scalingValue((S==null?void 0:S.bottom)??0,t),paddingLeft:D.scalingValue((S==null?void 0:S.left)??0,t),pointerEvents:d?"auto":void 0,...me,...y?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:a.jsx("span",{className:`${c}-overlay-anchor`,style:y?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:it==="submitting"?"...":v})})})]}),Be==="success"&&a.jsx("p",{className:`${c}-success`,style:{..._e},children:ie}),Be==="error"&&a.jsx("p",{className:`${c}-error`,style:{..._e},role:"alert",children:se??Ze??j})]})}const Yg={inputColor:"input-color",inputTextColor:"input-text-color",inputBorderColor:"input-border-color",placeholderColor:"placeholder-color",buttonColor:"button-color",buttonTextColor:"button-text-color",buttonBorderColor:"button-border-color",labelTextColor:"label-text-color",successColor:"success-color",errorColor:"error-color"},Kg=["hover","focus","filled","success","error"],Zg=`import React, { useMemo, useState } from 'react';
158
+ `}function Ug({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:r}){const l=!!n,d=i&&t||!t,{prefix:c}=D.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:b=[],buttonLabel:v,gap:g,fieldsGap:h,buttonCorners:f,buttonStroke:x,buttonPadding:S,isButtonFullWidth:y,inputCorners:w,inputStroke:H,inputPadding:N,inputColor:U,inputTextColor:O,inputBorderColor:C,placeholderColor:V,buttonColor:$,buttonTextColor:R,buttonBorderColor:k,labelTextColor:T,successColor:m,errorColor:M,fontFamily:E,inputFontSettings:z,inputFontSize:ne,inputLineHeight:I,inputLetterSpacing:W,inputWordSpacing:K,inputTextAppearance:ae,buttonFontSettings:de,buttonFontSize:A,buttonLineHeight:he,buttonLetterSpacing:q,buttonWordSpacing:ce,buttonTextAppearance:Q,labelFontSettings:be,labelFontSize:He,labelLineHeight:xe,labelLetterSpacing:le,labelWordSpacing:ee,labelTextAppearance:ue,statusFontSettings:oe,statusFontSize:Fe,statusLineHeight:Ce,statusLetterSpacing:P,statusWordSpacing:Y,statusTextAppearance:X,successMessage:ie,errorMessage:j,stateOverrides:B}=e,J=u==="B",te=b.slice(0,Math.min(p,b.length)),$e={fontSettings:{fontFamily:E,fontWeight:(z==null?void 0:z.fontWeight)??400,fontStyle:(z==null?void 0:z.fontStyle)??"normal"},fontSize:ne??.01,lineHeight:I,letterSpacing:W??0,wordSpacing:K??0,textAppearance:ae,color:O},ye=sn(Yt($e,t)),F=D.scalingValue(H??0,t),ve=D.scalingValue((I??ne??.01)+((N==null?void 0:N.top)??0)+((N==null?void 0:N.bottom)??0)+(u==="C"?H??0:(H??0)*2),t),pe={...ye,borderStyle:"solid",borderRadius:u==="C"?0:D.scalingValue(w??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:F,borderLeftWidth:0}:{borderWidth:F},paddingTop:D.scalingValue((N==null?void 0:N.top)??0,t),paddingRight:D.scalingValue((N==null?void 0:N.right)??0,t),paddingBottom:D.scalingValue((N==null?void 0:N.bottom)??0,t),paddingLeft:D.scalingValue((N==null?void 0:N.left)??0,t),height:ve,minHeight:ve},Z={fontSettings:{fontFamily:E,fontWeight:(de==null?void 0:de.fontWeight)??400,fontStyle:(de==null?void 0:de.fontStyle)??"normal"},fontSize:A??.01,lineHeight:he,letterSpacing:q??0,wordSpacing:ce??0,textAppearance:Q,color:R},me=sn(Yt(Z,t)),De=D.scalingValue(x??0,t),ge={fontSettings:{fontFamily:E,fontWeight:(be==null?void 0:be.fontWeight)??400,fontStyle:(be==null?void 0:be.fontStyle)??"normal"},fontSize:He??.01,lineHeight:xe,letterSpacing:le??0,wordSpacing:ee??0,textAppearance:ue,color:T},G=Yt(ge,t),Me={fontSettings:{fontFamily:E,fontWeight:(oe==null?void 0:oe.fontWeight)??400,fontStyle:(oe==null?void 0:oe.fontStyle)??"normal"},fontSize:Fe??.01,lineHeight:Ce,letterSpacing:P??0,wordSpacing:Y??0,textAppearance:X,color:m},_e=sn(Yt(Me,t)),rt=D.buildColorVars(c,{inputColor:U,inputTextColor:O,inputBorderColor:C,placeholderColor:V!=null&&V.trim()?V:"#cccccc",buttonColor:$,buttonTextColor:R,buttonBorderColor:k,labelTextColor:T,successColor:m,errorColor:M},Yg,Kg,B),[Je,at]=s.useState(()=>Object.fromEntries(te.map(Ae=>[Ae.name,""]))),[it,je]=s.useState("idle"),[Se,We]=s.useState(null),Be=r==="success"?"success":r==="error"?"error":it,Ze=r==="error"?j:Se,Le=r==="filled",Ve=s.useMemo(()=>{if(!Le)return Je;let Ae=null;for(const Ke of te)(Je[Ke.name]??"").trim().length>0||(Ae=Ae??{...Je},Ae[Ke.name]="Filled");return Ae??Je},[Je,Le,te]),se=Be==="error"?D.getFormFieldValidationError(te,Ve):null,Xe=`${r&&r!=="default"?`${c}-state-${r}`:""}`.trim(),ze=o==null?void 0:o.submitUrl,Re=(Ae,Ke)=>{at(Oe=>({...Oe,[Ae]:Ke}))},Pe=async Ae=>{if(Ae.preventDefault(),!d)return;const Ke=Object.fromEntries(te.map(Qe=>{var tt;return[Qe.name,((tt=Je[Qe.name])==null?void 0:tt.trim())??""]}).filter(([,Qe])=>Qe));if(!ze){je("error"),We("No integrations were found for this form.");return}if(Object.keys(Ke).length===0)return;const Oe=D.getFormFieldValidationError(te,Je);if(Oe){je("error"),We(Oe);return}je("submitting"),We(null);try{const Qe=await fetch(ze,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ke)});if(!Qe.ok){const tt=await Qe.text();throw new Error(tt||`Request failed: ${Qe.status}`)}je("success"),at(Object.fromEntries(te.map(tt=>[tt.name,""])))}catch(Qe){je("error"),We(Qe instanceof Error?Qe.message:"Something went wrong")}};return a.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${Xe}`.trim(),style:rt,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Xg(c)}}),a.jsxs("form",{onSubmit:Pe,className:`${c}-form`,children:[a.jsx("div",{className:`${c}-fields`,children:te.map((Ae,Ke)=>a.jsxs(s.Fragment,{children:[Ke>0&&a.jsx("div",{"data-controls":l?"fieldsGap":void 0,className:l?`${c}-control`:void 0,style:{height:D.scalingValue(h??0,t)}}),a.jsxs("div",{className:`${c}-field-group${J?` ${c}-labeled`:""}`,children:[J&&a.jsx("span",{className:`${c}-field-label`,style:G?{...G,lineHeight:G.fontSize}:void 0,children:Ae.label||Ae.name}),Ae.type==="textarea"?a.jsx("textarea",{name:Ae.name,autoComplete:"off",value:Ve[Ae.name]??"",onChange:Oe=>Re(Ae.name,Oe.target.value),placeholder:Ae.placeholder,className:`${c}-input`,style:pe,rows:1,"data-filled":Le||(Ve[Ae.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:Ae.type==="phone"?"tel":Ae.type==="email"?"email":"text",name:Ae.name,autoComplete:"off",value:Ve[Ae.name]??"",onChange:Oe=>Re(Ae.name,Oe.target.value),placeholder:Ae.placeholder,required:Ae.isRequired??Ae.type==="email",className:`${c}-input`,style:pe,"data-filled":Le||(Ve[Ae.name]??"").trim().length>0})]})]},Ke))}),a.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${c}-control`:void 0,style:{height:D.scalingValue(g??0,t)}}),a.jsx("div",{className:`${c}-overlay-anchor`,children:a.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:D.scalingValue(f??0,t),borderWidth:De,paddingTop:D.scalingValue((S==null?void 0:S.top)??0,t),paddingRight:D.scalingValue((S==null?void 0:S.right)??0,t),paddingBottom:D.scalingValue((S==null?void 0:S.bottom)??0,t),paddingLeft:D.scalingValue((S==null?void 0:S.left)??0,t),pointerEvents:d?"auto":void 0,...me,...y?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:a.jsx("span",{className:`${c}-overlay-anchor`,style:y?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:it==="submitting"?"...":v})})})]}),Be==="success"&&a.jsx("p",{className:`${c}-success`,style:{..._e},children:ie}),Be==="error"&&a.jsx("p",{className:`${c}-error`,style:{..._e},role:"alert",children:se??Ze??j})]})}const Yg={inputColor:"input-color",inputTextColor:"input-text-color",inputBorderColor:"input-border-color",placeholderColor:"placeholder-color",buttonColor:"button-color",buttonTextColor:"button-text-color",buttonBorderColor:"button-border-color",labelTextColor:"label-text-color",successColor:"success-color",errorColor:"error-color"},Kg=["hover","focus","filled","success","error"],Zg=`import React, { useMemo, useState } from 'react';
159
159
  import { CommonComponentProps } from '../props';
160
160
  import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
161
161
  import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
@@ -982,7 +982,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
982
982
  font-size: ${dr(14)};
983
983
  color: var(--${e}-error-error-color, var(--${e}-error-color));
984
984
  }
985
- `}const ih=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:r}=D.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:b,inputFontSettings:v,inputFontSize:g,inputLineHeight:h,inputLetterSpacing:f,inputWordSpacing:x,inputTextAppearance:S,buttonFontSettings:y,buttonFontSize:w,buttonLineHeight:H,buttonLetterSpacing:N,buttonWordSpacing:Y,buttonTextAppearance:O,statusFontSettings:C,statusFontSize:V,statusLineHeight:$,statusLetterSpacing:R,statusWordSpacing:k,statusTextAppearance:T,iconMaxWidth:m,minHeight:M,corners:E,stroke:z,stateOverrides:ne,inputPadding:I,buttonPadding:W,successMessage:K="Thanks for subscribing!",errorMessage:ae="Please, fill all required fields."}=e,de=d.slice(0,Math.min(p,d.length)),[A,he]=s.useState(()=>Object.fromEntries(de.map(ge=>[ge.name,""]))),[q,ce]=s.useState("idle"),[Q,be]=s.useState(null),He=o==="success"?"success":o==="error"?"error":q,xe=o==="error"?ae:Q,le=o==="filled",ee=s.useMemo(()=>{if(!le)return A;let ge=null;for(const G of de)(A[G.name]??"").trim().length>0||(ge=ge??{...A},ge[G.name]="Filled");return ge??A},[le,A,de]),ue=He==="error"?D.getFormFieldValidationError(de,ee):null,oe=o&&o!=="default"?`${r}-state-${o}`:"",Fe=de.some(ge=>(ee[ge.name]??"").trim().length>0),Ce=oe!==`${r}-state-filled`&&Fe?`${r}-state-filled`:"",P=`${oe} ${Ce}`.trim(),U=i==null?void 0:i.submitUrl,X=u??"",ie=(c==null?void 0:c.icon)??"",j=(c==null?void 0:c.mode)==="On",B=X||"Submit",J={fontSettings:{fontFamily:b,fontWeight:(v==null?void 0:v.fontWeight)??400,fontStyle:(v==null?void 0:v.fontStyle)??"normal"},fontSize:g??.01,lineHeight:h,letterSpacing:f??0,wordSpacing:x??0,textAppearance:S,color:e.inputTextColor??"#111111"},te={fontSettings:{fontFamily:b,fontWeight:(y==null?void 0:y.fontWeight)??400,fontStyle:(y==null?void 0:y.fontStyle)??"normal"},fontSize:w??.01,lineHeight:H,letterSpacing:N??0,wordSpacing:Y??0,textAppearance:O,color:e.buttonTextColor??"#ffffff"},$e={fontSettings:{fontFamily:b,fontWeight:(C==null?void 0:C.fontWeight)??400,fontStyle:(C==null?void 0:C.fontStyle)??"normal"},fontSize:V??.01,lineHeight:$,letterSpacing:R??0,wordSpacing:k??0,textAppearance:T,color:e.successColor??"#22c55e"},ye=sn(Yt(J,t)),F=sn(Yt(te,t)),ve=sn(Yt($e,t)),pe=D.buildColorVars(r,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(J==null?void 0:J.color)??"#111111",buttonTextColor:e.buttonTextColor??(te==null?void 0:te.color)??"#ffffff"},oh,rh,ne),Z={borderRadius:D.scalingValue(E,t),borderWidth:D.scalingValue(z,t),borderStyle:"solid"},me={borderLeftWidth:D.scalingValue(z,t)},De=async ge=>{if(ge.preventDefault(),!l)return;const G=Object.fromEntries(de.map(_e=>{var rt;return[_e.name,((rt=A[_e.name])==null?void 0:rt.trim())??""]}).filter(([,_e])=>_e));if(!U){ce("error"),be("No integrations were found for this form.");return}if(Object.keys(G).length===0)return;const Me=D.getFormFieldValidationError(de,A);if(Me){ce("error"),be(Me);return}ce("submitting"),be(null);try{const _e=await fetch(U,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(G)});if(!_e.ok){const rt=await _e.text();throw new Error(rt||`Request failed: ${_e.status}`)}ce("success"),he(Object.fromEntries(de.map(rt=>[rt.name,""])))}catch(_e){ce("error"),be(_e instanceof Error?_e.message:"Something went wrong")}};return a.jsxs("div",{className:`${r}-wrapper ${P}`.trim(),style:pe,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:nh(r)}}),a.jsxs("form",{onSubmit:De,className:`${r}-form`,style:{...Z,height:D.scalingValue(M,t),minHeight:D.scalingValue(M,t)},children:[a.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:de.map(ge=>a.jsx("input",{type:ge.type==="email"?"email":ge.type==="phone"?"tel":"text",name:ge.name,autoComplete:"off",value:ee[ge.name]??"",onChange:G=>he(Me=>({...Me,[ge.name]:G.target.value})),placeholder:ge.placeholder,required:ge.isRequired??ge.type==="email",className:`${r}-input`,style:{...ye,paddingRight:D.scalingValue(I.right,t),paddingLeft:D.scalingValue(I.left,t),paddingTop:D.scalingValue(I.top,t),paddingBottom:D.scalingValue(I.bottom,t)}},ge.name))}),a.jsx("div",{className:`${r}-overlayAnchor`,children:a.jsx("button",{type:l?"submit":"button",className:`${r}-submitBtn`,"aria-label":B,style:{...F,...me,paddingRight:D.scalingValue(W.right,t),paddingLeft:D.scalingValue(W.left,t),paddingTop:D.scalingValue(W.top,t),paddingBottom:D.scalingValue(W.bottom,t),pointerEvents:l?"auto":void 0},children:q==="submitting"?"...":j?ie&&a.jsx(ln,{url:ie,className:`${r}-submitBtnIcon`,style:{maxWidth:D.scalingValue(m??0,t)},fill:`var(--${r}-button-text-color)`,hoverFill:`var(--${r}-button-text-color)`}):X})})]}),He==="success"&&a.jsx("p",{className:`${r}-success`,style:{...ve},children:K}),He==="error"&&a.jsx("p",{className:`${r}-error`,style:{...ve},role:"alert",children:ue??xe??ae})]})},oh={strokeColor:"stroke-color",inputColor:"input-color",placeholderColor:"placeholder-color",buttonColor:"button-color",inputTextColor:"input-text-color",buttonTextColor:"button-text-color",successColor:"success-color",errorColor:"error-color"},rh=["hover","focus","filled","success","error"],ah=`import React, { useMemo, useState } from 'react';
985
+ `}const ih=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:r}=D.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:b,inputFontSettings:v,inputFontSize:g,inputLineHeight:h,inputLetterSpacing:f,inputWordSpacing:x,inputTextAppearance:S,buttonFontSettings:y,buttonFontSize:w,buttonLineHeight:H,buttonLetterSpacing:N,buttonWordSpacing:U,buttonTextAppearance:O,statusFontSettings:C,statusFontSize:V,statusLineHeight:$,statusLetterSpacing:R,statusWordSpacing:k,statusTextAppearance:T,iconMaxWidth:m,minHeight:M,corners:E,stroke:z,stateOverrides:ne,inputPadding:I,buttonPadding:W,successMessage:K="Thanks for subscribing!",errorMessage:ae="Please, fill all required fields."}=e,de=d.slice(0,Math.min(p,d.length)),[A,he]=s.useState(()=>Object.fromEntries(de.map(ge=>[ge.name,""]))),[q,ce]=s.useState("idle"),[Q,be]=s.useState(null),He=o==="success"?"success":o==="error"?"error":q,xe=o==="error"?ae:Q,le=o==="filled",ee=s.useMemo(()=>{if(!le)return A;let ge=null;for(const G of de)(A[G.name]??"").trim().length>0||(ge=ge??{...A},ge[G.name]="Filled");return ge??A},[le,A,de]),ue=He==="error"?D.getFormFieldValidationError(de,ee):null,oe=o&&o!=="default"?`${r}-state-${o}`:"",Fe=de.some(ge=>(ee[ge.name]??"").trim().length>0),Ce=oe!==`${r}-state-filled`&&Fe?`${r}-state-filled`:"",P=`${oe} ${Ce}`.trim(),Y=i==null?void 0:i.submitUrl,X=u??"",ie=(c==null?void 0:c.icon)??"",j=(c==null?void 0:c.mode)==="On",B=X||"Submit",J={fontSettings:{fontFamily:b,fontWeight:(v==null?void 0:v.fontWeight)??400,fontStyle:(v==null?void 0:v.fontStyle)??"normal"},fontSize:g??.01,lineHeight:h,letterSpacing:f??0,wordSpacing:x??0,textAppearance:S,color:e.inputTextColor??"#111111"},te={fontSettings:{fontFamily:b,fontWeight:(y==null?void 0:y.fontWeight)??400,fontStyle:(y==null?void 0:y.fontStyle)??"normal"},fontSize:w??.01,lineHeight:H,letterSpacing:N??0,wordSpacing:U??0,textAppearance:O,color:e.buttonTextColor??"#ffffff"},$e={fontSettings:{fontFamily:b,fontWeight:(C==null?void 0:C.fontWeight)??400,fontStyle:(C==null?void 0:C.fontStyle)??"normal"},fontSize:V??.01,lineHeight:$,letterSpacing:R??0,wordSpacing:k??0,textAppearance:T,color:e.successColor??"#22c55e"},ye=sn(Yt(J,t)),F=sn(Yt(te,t)),ve=sn(Yt($e,t)),pe=D.buildColorVars(r,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(J==null?void 0:J.color)??"#111111",buttonTextColor:e.buttonTextColor??(te==null?void 0:te.color)??"#ffffff"},oh,rh,ne),Z={borderRadius:D.scalingValue(E,t),borderWidth:D.scalingValue(z,t),borderStyle:"solid"},me={borderLeftWidth:D.scalingValue(z,t)},De=async ge=>{if(ge.preventDefault(),!l)return;const G=Object.fromEntries(de.map(_e=>{var rt;return[_e.name,((rt=A[_e.name])==null?void 0:rt.trim())??""]}).filter(([,_e])=>_e));if(!Y){ce("error"),be("No integrations were found for this form.");return}if(Object.keys(G).length===0)return;const Me=D.getFormFieldValidationError(de,A);if(Me){ce("error"),be(Me);return}ce("submitting"),be(null);try{const _e=await fetch(Y,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(G)});if(!_e.ok){const rt=await _e.text();throw new Error(rt||`Request failed: ${_e.status}`)}ce("success"),he(Object.fromEntries(de.map(rt=>[rt.name,""])))}catch(_e){ce("error"),be(_e instanceof Error?_e.message:"Something went wrong")}};return a.jsxs("div",{className:`${r}-wrapper ${P}`.trim(),style:pe,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:nh(r)}}),a.jsxs("form",{onSubmit:De,className:`${r}-form`,style:{...Z,height:D.scalingValue(M,t),minHeight:D.scalingValue(M,t)},children:[a.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:de.map(ge=>a.jsx("input",{type:ge.type==="email"?"email":ge.type==="phone"?"tel":"text",name:ge.name,autoComplete:"off",value:ee[ge.name]??"",onChange:G=>he(Me=>({...Me,[ge.name]:G.target.value})),placeholder:ge.placeholder,required:ge.isRequired??ge.type==="email",className:`${r}-input`,style:{...ye,paddingRight:D.scalingValue(I.right,t),paddingLeft:D.scalingValue(I.left,t),paddingTop:D.scalingValue(I.top,t),paddingBottom:D.scalingValue(I.bottom,t)}},ge.name))}),a.jsx("div",{className:`${r}-overlayAnchor`,children:a.jsx("button",{type:l?"submit":"button",className:`${r}-submitBtn`,"aria-label":B,style:{...F,...me,paddingRight:D.scalingValue(W.right,t),paddingLeft:D.scalingValue(W.left,t),paddingTop:D.scalingValue(W.top,t),paddingBottom:D.scalingValue(W.bottom,t),pointerEvents:l?"auto":void 0},children:q==="submitting"?"...":j?ie&&a.jsx(ln,{url:ie,className:`${r}-submitBtnIcon`,style:{maxWidth:D.scalingValue(m??0,t)},fill:`var(--${r}-button-text-color)`,hoverFill:`var(--${r}-button-text-color)`}):X})})]}),He==="success"&&a.jsx("p",{className:`${r}-success`,style:{...ve},children:K}),He==="error"&&a.jsx("p",{className:`${r}-error`,style:{...ve},role:"alert",children:ue??xe??ae})]})},oh={strokeColor:"stroke-color",inputColor:"input-color",placeholderColor:"placeholder-color",buttonColor:"button-color",inputTextColor:"input-text-color",buttonTextColor:"button-text-color",successColor:"success-color",errorColor:"error-color"},rh=["hover","focus","filled","success","error"],ah=`import React, { useMemo, useState } from 'react';
986
986
  import { CommonComponentProps } from '../props';
987
987
  import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
988
988
  import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
@@ -1693,7 +1693,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
1693
1693
  .${e}-image-hover-grayscale:hover video {
1694
1694
  filter: grayscale(100%);
1695
1695
  }
1696
- `}const mh=30,gh=20,wa=3,hh=12,fh=32,yh=3,vh=e=>{e.style.setProperty("animation-name","none"),e.style.setProperty("-webkit-animation-name","none"),e.offsetHeight,e.style.removeProperty("animation-name"),e.style.removeProperty("-webkit-animation-name")},xh=(e,t)=>Array.from({length:t},()=>e).flat(),bh=e=>typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"16:9",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"16:9",reversed:(e==null?void 0:e.reversed)??!1},Hd=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),Rl=(e,t)=>{if(t<=0||e.children.length<t)return 0;const n=e.children[0],i=e.children[t-1];if(!n||!i)return 0;const o=getComputedStyle(e),r=Number.parseFloat(o.columnGap||o.gap||"0")||0,l=i.getBoundingClientRect().right-n.getBoundingClientRect().left;if(l>0)return l;const d=Array.from({length:t},(u,p)=>e.children[p]),c=Hd(d);return c<=0?0:c+r*Math.max(0,t-1)},wh=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=Hd(Array.from(e.children));if(i<=0)return 0;const o=getComputedStyle(e),r=Number.parseFloat(o.columnGap||o.gap||"0")||0,l=Number.parseFloat(o.paddingRight)||0;return i+r*Math.max(0,e.children.length-1)+l},Sh=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},$h=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>Sh(i,e))},Ch=e=>{if(e.type==="video")return!0;if(e.type==="image")return!1;const t=e.name??"";return/\.(mp4|webm|ogg|mov)(\?|$)/i.test(t)?!0:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url??"")},Th=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,Lh=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:r,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var k,T,m,M;const p=s.useRef(null),b=!!((k=e.image)!=null&&k.url&&Ch(e.image));s.useLayoutEffect(()=>{d&&Th(p.current)&&(u==null||u())},[d,(T=e.image)==null?void 0:T.url,u]);const v=n.display==="cover",g=n.ratioValue??"1:1",h=n.reversed??!1,[f,x]=g.split(":").map(Number),w=(h?x:f)/(h?f:x),H=i/w,N=H>o?o:H,Y=H>o?o*w:i,O=c(Y),C=c(N),V={borderRadius:c(r)},$=v?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...V}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:c(i),maxHeight:c(o),objectFit:"contain",...V},R=((m=e.image)==null?void 0:m.url)&&(b?a.jsx("video",{ref:E=>{p.current=E},src:e.image.url,style:$,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:d?u:void 0,onError:d?u:void 0}):a.jsx("img",{ref:E=>{p.current=E},src:e.image.url,alt:((M=e.image)==null?void 0:M.name)??"",style:$,onLoad:d?u:void 0,onError:d?u:void 0}));return a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...v?{width:O}:{width:"max-content",maxWidth:c(i),minWidth:0}},children:a.jsx("div",{className:l,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...v?{width:O,height:C,overflow:"hidden",...V}:{width:"max-content",maxWidth:c(i),height:c(o)}},children:R&&e.link?a.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:yt(`${t}-marquee-link`,!v&&`${t}-marquee-link-contain`),children:R}):R})})},Rh=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=D.useScopedStyles(),[l,d]=s.useState(0),c=l>0?Math.round(l):0,u=s.useMemo(()=>ph(r,c),[r,c]),{speed:p,direction:b,pauseOnHover:v,gap:g,imageMaxWidth:h,imageMaxHeight:f,hoverEffect:x,cornerRadius:S=0}=e,y=s.useMemo(()=>bh(e.imageFit),[e.imageFit]),w=(t==null?void 0:t.length)??0,H=!!o,N=!n||!!i,Y=N&&x!=="off"&&x!=="randomize"?`${r}-image-hover-${x}`:void 0,O=n?!!i:!0,V=((t==null?void 0:t.length)??0)>0&&(O||!!n),$=Math.max(0,p)*mh,R=Ce=>D.scalingValue(Ce,n??!1),k=s.useRef(null),T=s.useRef(null),m=s.useRef(null),[M,E]=s.useState(0),z=O&&v==="on",[ne,I]=s.useState(!1),[W,K]=s.useState({}),ae=s.useRef(W);ae.current=W;const de=s.useRef(null),A=s.useRef(0),he=s.useRef(null),q=s.useMemo(()=>(t??[]).map(Ce=>{var P;return((P=Ce.image)==null?void 0:P.url)??""}).join("\0"),[t]),[ce,Q]=s.useState(wa),be=s.useMemo(()=>{const Ce=t??[];return Ce.length===0||!(O||!!n)?Ce:xh(Ce,ce)},[t,O,ce,n]),He=s.useMemo(()=>(t??[]).filter(Ce=>{var P;return!!((P=Ce.image)!=null&&P.url)}).length,[t]),xe=V?yh:1;s.useLayoutEffect(()=>{A.current=0,K({}),de.current=null,Q(wa),d(0)},[q]),s.useEffect(()=>{if(!N||x!=="randomize")return;const Ce=k.current;if(!Ce)return;const P=j=>{K(B=>{const J=Array.from(j).filter($e=>$e in B&&!$h(Ce,$e));if(J.length===0)return B;const te={...B};return J.forEach($e=>{delete te[$e]}),te})},U=new IntersectionObserver(j=>{const B=new Set;for(const J of j){const te=J.target.dataset.marqueeItemIndex,$e=te!==void 0?Number(te):NaN;Number.isNaN($e)||B.add($e)}B.size>0&&P(B)},{root:Ce,threshold:0});Object.keys(W).forEach(j=>{const B=Number(j);Ce.querySelectorAll(`[data-marquee-item-index="${B}"]`).forEach(J=>U.observe(J))});const X={current:0},ie=()=>{const j=Object.keys(ae.current);j.length!==0&&(P(j.map(Number)),X.current=requestAnimationFrame(ie))};return Object.keys(ae.current).length>0&&(X.current=requestAnimationFrame(ie)),()=>{cancelAnimationFrame(X.current),U.disconnect()}},[x,W,N]),s.useLayoutEffect(()=>{if(!V)return;const Ce=k.current,P=m.current;if(!Ce||!P)return;const U={current:0},X=()=>{const B=Ce.getBoundingClientRect().width||Ce.offsetWidth,J=wh(P),te=de.current,$e=typeof te=="number"&&Math.abs(te-J)<=.25;de.current=J;let ye=ce,F=0;if((O||n)&&w>0&&B>0){const Z=Rl(P,w);if(Z>=fh){F=Z;const me=Math.min(hh,Math.max(wa,Math.ceil(B/Z)+1));ye=me,me!==ce&&Q(me)}}const pe=ye!==ce&&F>0?F*ye:J>0?J:F>0?F*ye:(()=>{const Z=Rl(P,w);return Z>0?Z*ye:0})();pe>0?d(Z=>Z<=0?pe:!$e||Math.round(Z)===Math.round(pe)?Z:pe):!$e&&l<=0&&(cancelAnimationFrame(U.current),U.current=requestAnimationFrame(X))},ie=()=>{cancelAnimationFrame(U.current),U.current=requestAnimationFrame(X)};he.current=ie,ie();const j=new ResizeObserver(ie);return j.observe(Ce),j.observe(P),()=>{he.current=null,cancelAnimationFrame(U.current),j.disconnect()}},[O,V,l,q,ce,w,n]),s.useLayoutEffect(()=>{if(!V||c<=0)return;const Ce=T.current;Ce&&vh(Ce)},[V,c,b,$]),s.useLayoutEffect(()=>{if(!V||l<=0){E(0);return}const Ce=T.current,P=m.current;if(!Ce||!P)return;const U=()=>{const ie=Ce.offsetHeight||Ce.getBoundingClientRect().height,j=Array.from(P.children).reduce((J,te)=>Math.max(J,te.offsetHeight||te.getBoundingClientRect().height),0),B=ie>0?ie:j;E(B>0?B:0)};U();const X=new ResizeObserver(U);return X.observe(Ce),X.observe(P),()=>X.disconnect()},[V,xe,be,n,g,h,f,l,y,W]),s.useLayoutEffect(()=>{if(!n||!H||!V||typeof window>"u")return;const Ce=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(Ce)},[n,H,V,b,l,M,g,be]);const le=()=>{z&&I(!0)},ee=()=>{z&&I(!1)},ue=s.useCallback(()=>{var Ce;A.current=Math.min(He,A.current+1),(Ce=he.current)==null||Ce.call(he)},[He]),oe=s.useCallback((Ce,P)=>{K(U=>{const X=U[Ce]??P,ie=(t??[]).filter(B=>B!==X);if(ie.length===0)return U;const j=ie[Math.floor(Math.random()*ie.length)];return{...U,[Ce]:j}})},[t]),Fe=(Ce,P,U,X)=>{const ie=N&&x==="randomize"&&y.display==="cover"?W[U]??Ce:Ce,j=`max(${R(g)}, ${gh}px)`,B=`calc(-0.5 * (${j} + ${R(g)}))`;return a.jsxs("div",{className:`${r}-marquee-card`,"data-marquee-item-index":U,onMouseEnter:N&&x==="randomize"&&y.display==="cover"?()=>oe(U,Ce):void 0,children:[a.jsx(Lh,{item:ie,prefix:r,imageFit:y,imageMaxWidth:h,imageMaxHeight:f,cornerRadius:S,imageHoverClass:Y,isEditor:n,isFirstSet:X,scaled:R,onFirstSetImageDone:ue}),H&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${r}-gap-control`,style:{position:"absolute",top:0,right:B,width:j,height:"100%"}})]},`${P}-${U}`)};if(V){const Ce=O?z&&ne?"paused":"running":"paused",P=c>0&&$>0?c/$*1e3:0,U=`${Math.max(0,P)/1e3}s`;return a.jsxs("div",{ref:k,className:yt(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Marquee",style:M>0?{height:M}:void 0,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{ref:T,className:`${r}-marquee-track`,"data-direction":b,onMouseEnter:le,onMouseLeave:ee,style:{WebkitAnimationDuration:U,animationDuration:U,WebkitAnimationPlayState:Ce,animationPlayState:Ce},children:Array.from({length:xe},(X,ie)=>a.jsx("div",{ref:ie===0?m:void 0,className:yt(`${r}-marquee-row`,`${r}-marquee-set`),style:{gap:R(g),paddingRight:R(g)},"aria-hidden":ie>0,children:be.map((j,B)=>Fe(j,ie,B,ie===0&&B<w))},`set-${ie}`))})]})}return a.jsxs("div",{ref:k,className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{className:yt(`${r}-marquee-row`,`${r}-marquee-static`),style:{gap:R(g),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((Ce,P)=>Fe(Ce,0,P))},"marquee-static")]})},Ih=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
1696
+ `}const mh=30,gh=20,wa=3,hh=12,fh=32,yh=3,vh=e=>{e.style.setProperty("animation-name","none"),e.style.setProperty("-webkit-animation-name","none"),e.offsetHeight,e.style.removeProperty("animation-name"),e.style.removeProperty("-webkit-animation-name")},xh=(e,t)=>Array.from({length:t},()=>e).flat(),bh=e=>typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"16:9",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"16:9",reversed:(e==null?void 0:e.reversed)??!1},Hd=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),Rl=(e,t)=>{if(t<=0||e.children.length<t)return 0;const n=e.children[0],i=e.children[t-1];if(!n||!i)return 0;const o=getComputedStyle(e),r=Number.parseFloat(o.columnGap||o.gap||"0")||0,l=i.getBoundingClientRect().right-n.getBoundingClientRect().left;if(l>0)return l;const d=Array.from({length:t},(u,p)=>e.children[p]),c=Hd(d);return c<=0?0:c+r*Math.max(0,t-1)},wh=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=Hd(Array.from(e.children));if(i<=0)return 0;const o=getComputedStyle(e),r=Number.parseFloat(o.columnGap||o.gap||"0")||0,l=Number.parseFloat(o.paddingRight)||0;return i+r*Math.max(0,e.children.length-1)+l},Sh=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},$h=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>Sh(i,e))},Ch=e=>{if(e.type==="video")return!0;if(e.type==="image")return!1;const t=e.name??"";return/\.(mp4|webm|ogg|mov)(\?|$)/i.test(t)?!0:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url??"")},Th=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,Lh=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:r,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var k,T,m,M;const p=s.useRef(null),b=!!((k=e.image)!=null&&k.url&&Ch(e.image));s.useLayoutEffect(()=>{d&&Th(p.current)&&(u==null||u())},[d,(T=e.image)==null?void 0:T.url,u]);const v=n.display==="cover",g=n.ratioValue??"1:1",h=n.reversed??!1,[f,x]=g.split(":").map(Number),w=(h?x:f)/(h?f:x),H=i/w,N=H>o?o:H,U=H>o?o*w:i,O=c(U),C=c(N),V={borderRadius:c(r)},$=v?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...V}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:c(i),maxHeight:c(o),objectFit:"contain",...V},R=((m=e.image)==null?void 0:m.url)&&(b?a.jsx("video",{ref:E=>{p.current=E},src:e.image.url,style:$,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:d?u:void 0,onError:d?u:void 0}):a.jsx("img",{ref:E=>{p.current=E},src:e.image.url,alt:((M=e.image)==null?void 0:M.name)??"",style:$,onLoad:d?u:void 0,onError:d?u:void 0}));return a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...v?{width:O}:{width:"max-content",maxWidth:c(i),minWidth:0}},children:a.jsx("div",{className:l,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...v?{width:O,height:C,overflow:"hidden",...V}:{width:"max-content",maxWidth:c(i),height:c(o)}},children:R&&e.link?a.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:yt(`${t}-marquee-link`,!v&&`${t}-marquee-link-contain`),children:R}):R})})},Rh=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=D.useScopedStyles(),[l,d]=s.useState(0),c=l>0?Math.round(l):0,u=s.useMemo(()=>ph(r,c),[r,c]),{speed:p,direction:b,pauseOnHover:v,gap:g,imageMaxWidth:h,imageMaxHeight:f,hoverEffect:x,cornerRadius:S=0}=e,y=s.useMemo(()=>bh(e.imageFit),[e.imageFit]),w=(t==null?void 0:t.length)??0,H=!!o,N=!n||!!i,U=N&&x!=="off"&&x!=="randomize"?`${r}-image-hover-${x}`:void 0,O=n?!!i:!0,V=((t==null?void 0:t.length)??0)>0&&(O||!!n),$=Math.max(0,p)*mh,R=Ce=>D.scalingValue(Ce,n??!1),k=s.useRef(null),T=s.useRef(null),m=s.useRef(null),[M,E]=s.useState(0),z=O&&v==="on",[ne,I]=s.useState(!1),[W,K]=s.useState({}),ae=s.useRef(W);ae.current=W;const de=s.useRef(null),A=s.useRef(0),he=s.useRef(null),q=s.useMemo(()=>(t??[]).map(Ce=>{var P;return((P=Ce.image)==null?void 0:P.url)??""}).join("\0"),[t]),[ce,Q]=s.useState(wa),be=s.useMemo(()=>{const Ce=t??[];return Ce.length===0||!(O||!!n)?Ce:xh(Ce,ce)},[t,O,ce,n]),He=s.useMemo(()=>(t??[]).filter(Ce=>{var P;return!!((P=Ce.image)!=null&&P.url)}).length,[t]),xe=V?yh:1;s.useLayoutEffect(()=>{A.current=0,K({}),de.current=null,Q(wa),d(0)},[q]),s.useEffect(()=>{if(!N||x!=="randomize")return;const Ce=k.current;if(!Ce)return;const P=j=>{K(B=>{const J=Array.from(j).filter($e=>$e in B&&!$h(Ce,$e));if(J.length===0)return B;const te={...B};return J.forEach($e=>{delete te[$e]}),te})},Y=new IntersectionObserver(j=>{const B=new Set;for(const J of j){const te=J.target.dataset.marqueeItemIndex,$e=te!==void 0?Number(te):NaN;Number.isNaN($e)||B.add($e)}B.size>0&&P(B)},{root:Ce,threshold:0});Object.keys(W).forEach(j=>{const B=Number(j);Ce.querySelectorAll(`[data-marquee-item-index="${B}"]`).forEach(J=>Y.observe(J))});const X={current:0},ie=()=>{const j=Object.keys(ae.current);j.length!==0&&(P(j.map(Number)),X.current=requestAnimationFrame(ie))};return Object.keys(ae.current).length>0&&(X.current=requestAnimationFrame(ie)),()=>{cancelAnimationFrame(X.current),Y.disconnect()}},[x,W,N]),s.useLayoutEffect(()=>{if(!V)return;const Ce=k.current,P=m.current;if(!Ce||!P)return;const Y={current:0},X=()=>{const B=Ce.getBoundingClientRect().width||Ce.offsetWidth,J=wh(P),te=de.current,$e=typeof te=="number"&&Math.abs(te-J)<=.25;de.current=J;let ye=ce,F=0;if((O||n)&&w>0&&B>0){const Z=Rl(P,w);if(Z>=fh){F=Z;const me=Math.min(hh,Math.max(wa,Math.ceil(B/Z)+1));ye=me,me!==ce&&Q(me)}}const pe=ye!==ce&&F>0?F*ye:J>0?J:F>0?F*ye:(()=>{const Z=Rl(P,w);return Z>0?Z*ye:0})();pe>0?d(Z=>Z<=0?pe:!$e||Math.round(Z)===Math.round(pe)?Z:pe):!$e&&l<=0&&(cancelAnimationFrame(Y.current),Y.current=requestAnimationFrame(X))},ie=()=>{cancelAnimationFrame(Y.current),Y.current=requestAnimationFrame(X)};he.current=ie,ie();const j=new ResizeObserver(ie);return j.observe(Ce),j.observe(P),()=>{he.current=null,cancelAnimationFrame(Y.current),j.disconnect()}},[O,V,l,q,ce,w,n]),s.useLayoutEffect(()=>{if(!V||c<=0)return;const Ce=T.current;Ce&&vh(Ce)},[V,c,b,$]),s.useLayoutEffect(()=>{if(!V||l<=0){E(0);return}const Ce=T.current,P=m.current;if(!Ce||!P)return;const Y=()=>{const ie=Ce.offsetHeight||Ce.getBoundingClientRect().height,j=Array.from(P.children).reduce((J,te)=>Math.max(J,te.offsetHeight||te.getBoundingClientRect().height),0),B=ie>0?ie:j;E(B>0?B:0)};Y();const X=new ResizeObserver(Y);return X.observe(Ce),X.observe(P),()=>X.disconnect()},[V,xe,be,n,g,h,f,l,y,W]),s.useLayoutEffect(()=>{if(!n||!H||!V||typeof window>"u")return;const Ce=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(Ce)},[n,H,V,b,l,M,g,be]);const le=()=>{z&&I(!0)},ee=()=>{z&&I(!1)},ue=s.useCallback(()=>{var Ce;A.current=Math.min(He,A.current+1),(Ce=he.current)==null||Ce.call(he)},[He]),oe=s.useCallback((Ce,P)=>{K(Y=>{const X=Y[Ce]??P,ie=(t??[]).filter(B=>B!==X);if(ie.length===0)return Y;const j=ie[Math.floor(Math.random()*ie.length)];return{...Y,[Ce]:j}})},[t]),Fe=(Ce,P,Y,X)=>{const ie=N&&x==="randomize"&&y.display==="cover"?W[Y]??Ce:Ce,j=`max(${R(g)}, ${gh}px)`,B=`calc(-0.5 * (${j} + ${R(g)}))`;return a.jsxs("div",{className:`${r}-marquee-card`,"data-marquee-item-index":Y,onMouseEnter:N&&x==="randomize"&&y.display==="cover"?()=>oe(Y,Ce):void 0,children:[a.jsx(Lh,{item:ie,prefix:r,imageFit:y,imageMaxWidth:h,imageMaxHeight:f,cornerRadius:S,imageHoverClass:U,isEditor:n,isFirstSet:X,scaled:R,onFirstSetImageDone:ue}),H&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${r}-gap-control`,style:{position:"absolute",top:0,right:B,width:j,height:"100%"}})]},`${P}-${Y}`)};if(V){const Ce=O?z&&ne?"paused":"running":"paused",P=c>0&&$>0?c/$*1e3:0,Y=`${Math.max(0,P)/1e3}s`;return a.jsxs("div",{ref:k,className:yt(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Marquee",style:M>0?{height:M}:void 0,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{ref:T,className:`${r}-marquee-track`,"data-direction":b,onMouseEnter:le,onMouseLeave:ee,style:{WebkitAnimationDuration:Y,animationDuration:Y,WebkitAnimationPlayState:Ce,animationPlayState:Ce},children:Array.from({length:xe},(X,ie)=>a.jsx("div",{ref:ie===0?m:void 0,className:yt(`${r}-marquee-row`,`${r}-marquee-set`),style:{gap:R(g),paddingRight:R(g)},"aria-hidden":ie>0,children:be.map((j,B)=>Fe(j,ie,B,ie===0&&B<w))},`set-${ie}`))})]})}return a.jsxs("div",{ref:k,className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{className:yt(`${r}-marquee-row`,`${r}-marquee-static`),style:{gap:R(g),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((Ce,P)=>Fe(Ce,0,P))},"marquee-static")]})},Ih=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
1697
1697
  import cn from 'classnames';
1698
1698
  import { CommonComponentProps } from '../props';
1699
1699
  import { scalingValue } from '../utils/scalingValue';
@@ -2605,7 +2605,7 @@ ${o}
2605
2605
  left: -9999px;
2606
2606
  top: 0;
2607
2607
  }
2608
- `}const kh=30,Sa=3,Ah=12,Fh=96,Il=3,as=.72,_h=100,Wh=10,Nh=e=>e/_h,Hh=e=>Math.max(0,e)/Wh,Oh=e=>{e.style.setProperty("animation-name","none"),e.style.setProperty("-webkit-animation-name","none"),e.offsetHeight,e.style.removeProperty("animation-name"),e.style.removeProperty("-webkit-animation-name")},Dh=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),ki={ctx:void 0},jh=()=>ki.ctx!==void 0?ki.ctx:typeof document>"u"?(ki.ctx=null,ki.ctx):(ki.ctx=document.createElement("canvas").getContext("2d"),ki.ctx),zh=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},El=e=>{e.style.transform=""},Bh=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},Vh=(e,t)=>{const n=(i,o)=>{if(!i||i===t)return o;const r=o+i.offsetLeft,l=i.offsetParent;return!l||l===i?r:n(l,r)};return n(e,e.offsetWidth/2)},Od=96,Dd=(e,t,n)=>{if(t<=0||Math.abs(e)<=0||n<2)return null;const i=2*Math.PI/t,o=new Float64Array(n+1),r=new Float64Array(n+1),l=e*t,d=u=>Math.sqrt(1+(l*Math.cos(t*u))**2),c=i/n;return Array.from({length:n},(u,p)=>{const b=p*c,v=b+c;o[p+1]=v,r[p+1]=r[p]+(d(b)+d(v))*.5*c}),{wavelength:i,periodArc:r[n],x:o,s:r}},Gh=(e,t)=>{const n=Dd(e,t,Od);return!n||n.wavelength<=0?1:n.periodArc/n.wavelength},qh=(e,t)=>{if(e.periodArc<=0)return t;const n=t<0?-1:1,i=Math.abs(t),o=Math.floor(i/e.periodArc),r=i-o*e.periodArc,{s:l,x:d}=e,c=(g,h)=>{if(h-g<=1)return[g,h];const f=g+h>>1;return l[f]<=r?c(f,h):c(g,f)},[u,p]=c(0,l.length-1),b=l[p]-l[u],v=b>0?(r-l[u])/b:0;return n*(o*e.wavelength+d[u]+(d[p]-d[u])*v)},Xh=(e,t,n,i,o=0)=>{const r=Math.max(0,n),l=e>0?2*Math.PI*r/e:0,d=h=>i+t*Math.sin(l*h),c=h=>t*l*Math.cos(l*h),u=-o,b=e+o-u,v=Math.max(4,Math.ceil(r*4*(b/Math.max(e,1)))),g=Array.from({length:v},(h,f)=>{const x=u+f/v*b,S=u+(f+1)/v*b,y=S-x,w=d(x),H=d(S),N=x+y/3,Y=w+c(x)*y/3,O=S-y/3,C=H-c(S)*y/3;return`C${N.toFixed(2)} ${Y.toFixed(2)} ${O.toFixed(2)} ${C.toFixed(2)} ${S.toFixed(2)} ${H.toFixed(2)}`});return[`M${u.toFixed(2)} ${d(u).toFixed(2)}`,...g].join(" ")},Uh=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:r,isCurve:l})=>{var g;const d=o!==0?{...n,transform:`translateY(${o}px)`}:n,c=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${as}em`},u=((g=e.image)==null?void 0:g.url)&&a.jsx("img",{src:e.image.url,alt:e.image.name??"",className:`${t}-item-image`,style:c}),p=u&&(l?a.jsx("span",{className:`${t}-item-image-wrap`,"data-marquee-wave-node":!0,children:u}):u),b=l?a.jsx("span",{className:`${t}-text`,style:d,children:Array.from(e.text).map((h,f)=>a.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:a.jsx("span",{className:`${t}-glyph-inner`,children:h===" "?" ":h})},f))}):a.jsx("span",{className:`${t}-text`,style:d,children:e.text}),v=a.jsxs(a.Fragment,{children:[p,b]});return a.jsx("div",{className:`${t}-item`,"data-marquee-text-item":!0,style:{gap:r},children:e.link?a.jsx("a",{href:e.link,className:`${t}-item-link`,style:{gap:r},children:v}):v})},Yh=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=D.useScopedStyles(),[r,l]=s.useState(0),d=r>0?Math.round(r):0,{speed:c,direction:u,pauseOnHover:p,gap:b,layoutType:v,curveAmplitude:g,curveFrequency:h,textFontFamily:f,textFontSettings:x,textFontSize:S,textLineHeight:y,textLetterSpacing:w,textWordSpacing:H,textTextAppearance:N,textColor:Y,backgroundColor:O,ribbonWidth:C}=e,V=C??y,$=v==="curve",R=Nh(g),k=Hh(h),T=s.useMemo(()=>Ph(o,d,$),[o,d,$]),m=s.useMemo(()=>Yt({fontSettings:{fontFamily:f,fontWeight:x.fontWeight,fontStyle:x.fontStyle},letterSpacing:w,wordSpacing:H,fontSize:S,lineHeight:y,textAppearance:N,color:Y},n),[f,x,w,H,S,y,N,Y,n]),M=Re=>D.scalingValue(Re,n??!1),E=((t==null?void 0:t.length)??0)>0,z=n?!!i:!0,ne=E&&(z||!!n),I=Math.max(0,c)*kh,W=z&&p==="on",[K,ae]=s.useState(!1),de=z?W&&K?"paused":"running":"paused",A=de==="running"&&I>0&&d>0,he=d>0&&I>0?d/I*1e3:0,q=s.useRef(null),ce=s.useRef(null),Q=s.useRef(null),be=s.useRef(null),He=s.useRef(null),xe=s.useRef(null),le=s.useRef(A),ee=s.useRef(null),ue=s.useRef(null),oe=s.useRef(R),Fe=s.useRef(k);le.current=A,oe.current=R,Fe.current=k;const[Ce,P]=s.useState(0),[U,X]=s.useState(0),[ie,j]=s.useState(0),[B,J]=s.useState(0),[te,$e]=s.useState(0),ye=s.useMemo(()=>(t??[]).map(Re=>{var Pe;return`${Re.text}\0${((Pe=Re.image)==null?void 0:Pe.url)??""}\0${Re.link??""}`}).join("\0"),[t]),[F,ve]=s.useState(Sa),pe=s.useMemo(()=>{const Re=t??[];return Re.length===0||!(z||n)?Re:Dh(Re,F)},[t,z,F,n]),Z=ne?Il:1;s.useLayoutEffect(()=>{ve(Sa),l(0)},[ye]),s.useLayoutEffect(()=>{var Oe;const Re=xe.current;if(!Re)return;const Pe=()=>{const Qe=getComputedStyle(Re),tt=parseFloat(Qe.fontSize)||0;if(tt<=0)return;const nt=jh();if(!nt){P(tt*as),X(0);return}nt.font=`${Qe.fontStyle} ${Qe.fontWeight} ${tt}px ${Qe.fontFamily}`;const xt=nt.measureText("H"),It=xt.actualBoundingBoxAscent>0?xt.actualBoundingBoxAscent:tt*as,Tt=Math.max(0,xt.actualBoundingBoxDescent||0),ut=xt.fontBoundingBoxAscent||0,ft=xt.fontBoundingBoxDescent||0;P(Lt=>Math.abs(Lt-It)>.5?It:Lt);const Et=ut>0||ft>0?(ft-Tt-(ut-It))/2:0;X(Lt=>Math.abs(Lt-Et)>.25?Et:Lt)};Pe();const Ae=typeof document<"u"?document.fonts:void 0;(Oe=Ae==null?void 0:Ae.ready)==null||Oe.then(Pe).catch(()=>{});const Ke=new ResizeObserver(Pe);return Ke.observe(Re),()=>Ke.disconnect()},[m.fontFamily,m.fontWeight,m.fontStyle,m.fontSize,m.lineHeight]),s.useLayoutEffect(()=>{if(!ne)return;const Re=q.current,Pe=be.current;if(!Re||!Pe)return;const Ae={id:0},Ke=()=>{const nt=Re.offsetWidth||Re.getBoundingClientRect().width,xt=Pe.offsetWidth||Pe.getBoundingClientRect().width;if(E&&nt>0&&xt>0){const It=xt/F;if(It>0){let Tt=nt,ut=Ah;if($){const Et=nt*oe.current,Lt=Fe.current,bt=Lt>0?2*Math.PI*Lt/nt:0,Nt=Gh(Et,bt);Tt=Math.max(nt,Nt*nt/(Il-1)),ut=Fh}const ft=Math.min(ut,Math.max(Sa,Math.ceil(Tt/It)+1));if(ft!==F){ve(ft);return}}}xt>0&&l(xt)},Oe=()=>{cancelAnimationFrame(Ae.id),Ae.id=requestAnimationFrame(Ke)};Oe();const Qe=new ResizeObserver(Oe);Qe.observe(Re),Qe.observe(Pe);const tt=()=>{document.hidden||Oe()};return document.addEventListener("visibilitychange",tt),window.addEventListener("pageshow",tt),window.addEventListener("focus",tt),()=>{cancelAnimationFrame(Ae.id),Qe.disconnect(),document.removeEventListener("visibilitychange",tt),window.removeEventListener("pageshow",tt),window.removeEventListener("focus",tt)}},[ne,ye,F,E,Ce,$,R,k]),s.useLayoutEffect(()=>{const Re=He.current;if(!Re)return;const Pe={id:0},Ae=()=>{const Oe=Re.offsetHeight;Oe>0&&$e(Qe=>Math.abs(Qe-Oe)>.5?Oe:Qe)};Pe.id=requestAnimationFrame(Ae);const Ke=new ResizeObserver(()=>{cancelAnimationFrame(Pe.id),Pe.id=requestAnimationFrame(Ae)});return Ke.observe(Re),()=>{cancelAnimationFrame(Pe.id),Ke.disconnect()}},[V,n]),s.useLayoutEffect(()=>{if(!$){j(0),J(0);return}const Re=q.current,Pe=be.current;if(!Re||!Pe)return;const Ae={id:0},Ke=()=>{const Qe=Re.offsetWidth,tt=Pe.offsetHeight;Qe>0&&J(nt=>Math.abs(nt-Qe)>.5?Qe:nt),tt>0&&j(nt=>Math.abs(nt-tt)>.5?tt:nt)};Ae.id=requestAnimationFrame(Ke);const Oe=new ResizeObserver(()=>{cancelAnimationFrame(Ae.id),Ae.id=requestAnimationFrame(Ke)});return Oe.observe(Re),Oe.observe(Pe),()=>{cancelAnimationFrame(Ae.id),Oe.disconnect()}},[$,ye,Ce,y,S,ne]),s.useLayoutEffect(()=>{if(!ne||d<=0)return;const Re=Q.current;Re&&Oh(Re)},[ne,d,u,I]),s.useLayoutEffect(()=>{if(!$||!E)return;const Re=q.current;if(!Re)return;const Pe={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},Ae=()=>{for(const It of Pe.itemsCache)for(const Tt of It.glyphs)El(Tt.inner)},Ke=()=>{const It=ce.current??Re;Pe.itemsCache=Array.from(Re.querySelectorAll("[data-marquee-text-item]"),Tt=>{const ut=[];return Tt.querySelectorAll("[data-marquee-wave-node]").forEach(ft=>{const Et=ft.firstElementChild;Et&&ut.push({inner:Et,layoutLocalX:Vh(ft,It)})}),{item:Tt,glyphs:ut}}),Pe.cacheDirty=!1},Oe=()=>{Pe.cacheDirty&&Ke();const Tt=(ce.current??Re).offsetWidth||1,ut=Tt*oe.current,ft=Fe.current,Et=2*Math.PI*ft/Tt,Lt=`${Tt}|${ut}|${Et}`;if(Lt!==Pe.lutKey&&(Pe.lutKey=Lt,Pe.lut=Dd(ut,Et,Od)),Math.abs(ut)<=0||Et<=0){Ae();return}const bt=Q.current,Nt=bt?Bh(getComputedStyle(bt).transform):0,Bt=Re.getBoundingClientRect(),Zt=Bt.left,en=Bt.right,Rt=Pe.lut&&Pe.lut.wavelength>0?Math.max(0,(Pe.lut.periodArc/Pe.lut.wavelength-1)*Tt):0;for(const{item:Ot,glyphs:nn}of Pe.itemsCache){const pt=Ot.getBoundingClientRect();if(pt.right<Zt||pt.left>en+Rt){for(const Ee of nn)El(Ee.inner);continue}for(const Ee of nn){const qe=Ee.layoutLocalX+Nt,st=Pe.lut?qh(Pe.lut,qe):qe,mt=Et*st,vt=ut*Math.sin(mt),Mt=ut*Et*Math.cos(mt),gt=Math.atan(Mt)*(180/Math.PI);zh(Ee.inner,st-qe,vt,gt)}}},Qe=()=>{Pe.cancelled||(Pe.raf=0,Oe(),le.current&&!document.hidden&&(Pe.raf=requestAnimationFrame(Qe)))},tt=()=>{Pe.cancelled||Pe.raf||(Pe.raf=requestAnimationFrame(Qe))},nt=()=>{Pe.cacheDirty=!0,Oe(),tt()};ee.current=tt,ue.current=nt,Oe(),tt();const xt=()=>{if(document.hidden){cancelAnimationFrame(Pe.raf),Pe.raf=0;return}cancelAnimationFrame(Pe.raf),Pe.raf=0,nt()};return document.addEventListener("visibilitychange",xt),window.addEventListener("pageshow",xt),window.addEventListener("focus",xt),()=>{Pe.cancelled=!0,ee.current=null,ue.current=null,cancelAnimationFrame(Pe.raf),document.removeEventListener("visibilitychange",xt),window.removeEventListener("pageshow",xt),window.removeEventListener("focus",xt),Ae()}},[$,E]),s.useLayoutEffect(()=>{var Re;!$||!E||(Re=ue.current)==null||Re.call(ue)},[$,E,r,ye,F,Ce,R,k,B]),s.useLayoutEffect(()=>{var Re;(Re=ee.current)==null||Re.call(ee)},[A,u]);const me=()=>{W&&ae(!0)},De=()=>{W&&ae(!1)},ge=$?Math.abs(R)*100:0,G=M(V),Me={minHeight:G,...$?{paddingTop:`${ge}%`,paddingBottom:`${ge}%`}:{}},_e={height:G,...$?{visibility:"hidden"}:{backgroundColor:O}},rt={gap:M(b),minHeight:G},Je=B*R,at=Math.abs(Je),it=te>0?te:ie,je=Math.max(ie,it),Se=at+je/2,We=Math.max(it,1),Be=$&&B>0&&je>0?Xh(B,Je,k,Se,We):"",Ze=at*2+je,Le=Be?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${B} ${Ze}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:Be,fill:"none",stroke:O,strokeWidth:it,strokeLinecap:"butt",strokeLinejoin:"round"})}):null,Ve=a.jsx("div",{ref:He,className:`${o}-ribbon`,style:_e,"aria-hidden":!0}),se=(Re,Pe,Ae)=>a.jsx(Uh,{item:Re,prefix:o,textCss:m,capHeightPx:Ce,opticalOffsetY:U,imageGapPx:M(b),isCurve:$},`${Pe}-${Ae}`),Te=a.jsx("span",{ref:xe,"aria-hidden":!0,className:`${o}-cap-ref`,style:m,children:"H"}),Xe=`${Math.max(0,he)/1e3}s`,ze=ne?a.jsx("div",{ref:Q,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:me,onMouseLeave:De,style:{WebkitAnimationDuration:Xe,animationDuration:Xe,WebkitAnimationPlayState:de,animationPlayState:de},children:Array.from({length:Z},(Re,Pe)=>a.jsx("div",{ref:Pe===0?be:void 0,className:`${o}-marquee-set`,style:{...rt,paddingRight:M(b)},"aria-hidden":Pe>0,children:pe.map((Ae,Ke)=>se(Ae,Pe,Ke))},`set-${Pe}`))}):a.jsx("div",{ref:be,className:yt(`${o}-marquee-set`,`${o}-marquee-static`),style:rt,children:t==null?void 0:t.map((Re,Pe)=>se(Re,0,Pe))});return a.jsxs("div",{ref:q,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:T}}),Te,a.jsxs("div",{ref:ce,className:`${o}-marquee-wrapper`,style:Me,children:[Ve,Le,ze]})]})},Kh=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
2608
+ `}const kh=30,Sa=3,Ah=12,Fh=96,Il=3,as=.72,_h=100,Wh=10,Nh=e=>e/_h,Hh=e=>Math.max(0,e)/Wh,Oh=e=>{e.style.setProperty("animation-name","none"),e.style.setProperty("-webkit-animation-name","none"),e.offsetHeight,e.style.removeProperty("animation-name"),e.style.removeProperty("-webkit-animation-name")},Dh=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),ki={ctx:void 0},jh=()=>ki.ctx!==void 0?ki.ctx:typeof document>"u"?(ki.ctx=null,ki.ctx):(ki.ctx=document.createElement("canvas").getContext("2d"),ki.ctx),zh=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},El=e=>{e.style.transform=""},Bh=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},Vh=(e,t)=>{const n=(i,o)=>{if(!i||i===t)return o;const r=o+i.offsetLeft,l=i.offsetParent;return!l||l===i?r:n(l,r)};return n(e,e.offsetWidth/2)},Od=96,Dd=(e,t,n)=>{if(t<=0||Math.abs(e)<=0||n<2)return null;const i=2*Math.PI/t,o=new Float64Array(n+1),r=new Float64Array(n+1),l=e*t,d=u=>Math.sqrt(1+(l*Math.cos(t*u))**2),c=i/n;return Array.from({length:n},(u,p)=>{const b=p*c,v=b+c;o[p+1]=v,r[p+1]=r[p]+(d(b)+d(v))*.5*c}),{wavelength:i,periodArc:r[n],x:o,s:r}},Gh=(e,t)=>{const n=Dd(e,t,Od);return!n||n.wavelength<=0?1:n.periodArc/n.wavelength},qh=(e,t)=>{if(e.periodArc<=0)return t;const n=t<0?-1:1,i=Math.abs(t),o=Math.floor(i/e.periodArc),r=i-o*e.periodArc,{s:l,x:d}=e,c=(g,h)=>{if(h-g<=1)return[g,h];const f=g+h>>1;return l[f]<=r?c(f,h):c(g,f)},[u,p]=c(0,l.length-1),b=l[p]-l[u],v=b>0?(r-l[u])/b:0;return n*(o*e.wavelength+d[u]+(d[p]-d[u])*v)},Xh=(e,t,n,i,o=0)=>{const r=Math.max(0,n),l=e>0?2*Math.PI*r/e:0,d=h=>i+t*Math.sin(l*h),c=h=>t*l*Math.cos(l*h),u=-o,b=e+o-u,v=Math.max(4,Math.ceil(r*4*(b/Math.max(e,1)))),g=Array.from({length:v},(h,f)=>{const x=u+f/v*b,S=u+(f+1)/v*b,y=S-x,w=d(x),H=d(S),N=x+y/3,U=w+c(x)*y/3,O=S-y/3,C=H-c(S)*y/3;return`C${N.toFixed(2)} ${U.toFixed(2)} ${O.toFixed(2)} ${C.toFixed(2)} ${S.toFixed(2)} ${H.toFixed(2)}`});return[`M${u.toFixed(2)} ${d(u).toFixed(2)}`,...g].join(" ")},Uh=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:r,isCurve:l})=>{var g;const d=o!==0?{...n,transform:`translateY(${o}px)`}:n,c=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${as}em`},u=((g=e.image)==null?void 0:g.url)&&a.jsx("img",{src:e.image.url,alt:e.image.name??"",className:`${t}-item-image`,style:c}),p=u&&(l?a.jsx("span",{className:`${t}-item-image-wrap`,"data-marquee-wave-node":!0,children:u}):u),b=l?a.jsx("span",{className:`${t}-text`,style:d,children:Array.from(e.text).map((h,f)=>a.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:a.jsx("span",{className:`${t}-glyph-inner`,children:h===" "?" ":h})},f))}):a.jsx("span",{className:`${t}-text`,style:d,children:e.text}),v=a.jsxs(a.Fragment,{children:[p,b]});return a.jsx("div",{className:`${t}-item`,"data-marquee-text-item":!0,style:{gap:r},children:e.link?a.jsx("a",{href:e.link,className:`${t}-item-link`,style:{gap:r},children:v}):v})},Yh=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=D.useScopedStyles(),[r,l]=s.useState(0),d=r>0?Math.round(r):0,{speed:c,direction:u,pauseOnHover:p,gap:b,layoutType:v,curveAmplitude:g,curveFrequency:h,textFontFamily:f,textFontSettings:x,textFontSize:S,textLineHeight:y,textLetterSpacing:w,textWordSpacing:H,textTextAppearance:N,textColor:U,backgroundColor:O,ribbonWidth:C}=e,V=C??y,$=v==="curve",R=Nh(g),k=Hh(h),T=s.useMemo(()=>Ph(o,d,$),[o,d,$]),m=s.useMemo(()=>Yt({fontSettings:{fontFamily:f,fontWeight:x.fontWeight,fontStyle:x.fontStyle},letterSpacing:w,wordSpacing:H,fontSize:S,lineHeight:y,textAppearance:N,color:U},n),[f,x,w,H,S,y,N,U,n]),M=Re=>D.scalingValue(Re,n??!1),E=((t==null?void 0:t.length)??0)>0,z=n?!!i:!0,ne=E&&(z||!!n),I=Math.max(0,c)*kh,W=z&&p==="on",[K,ae]=s.useState(!1),de=z?W&&K?"paused":"running":"paused",A=de==="running"&&I>0&&d>0,he=d>0&&I>0?d/I*1e3:0,q=s.useRef(null),ce=s.useRef(null),Q=s.useRef(null),be=s.useRef(null),He=s.useRef(null),xe=s.useRef(null),le=s.useRef(A),ee=s.useRef(null),ue=s.useRef(null),oe=s.useRef(R),Fe=s.useRef(k);le.current=A,oe.current=R,Fe.current=k;const[Ce,P]=s.useState(0),[Y,X]=s.useState(0),[ie,j]=s.useState(0),[B,J]=s.useState(0),[te,$e]=s.useState(0),ye=s.useMemo(()=>(t??[]).map(Re=>{var Pe;return`${Re.text}\0${((Pe=Re.image)==null?void 0:Pe.url)??""}\0${Re.link??""}`}).join("\0"),[t]),[F,ve]=s.useState(Sa),pe=s.useMemo(()=>{const Re=t??[];return Re.length===0||!(z||n)?Re:Dh(Re,F)},[t,z,F,n]),Z=ne?Il:1;s.useLayoutEffect(()=>{ve(Sa),l(0)},[ye]),s.useLayoutEffect(()=>{var Oe;const Re=xe.current;if(!Re)return;const Pe=()=>{const Qe=getComputedStyle(Re),tt=parseFloat(Qe.fontSize)||0;if(tt<=0)return;const nt=jh();if(!nt){P(tt*as),X(0);return}nt.font=`${Qe.fontStyle} ${Qe.fontWeight} ${tt}px ${Qe.fontFamily}`;const xt=nt.measureText("H"),It=xt.actualBoundingBoxAscent>0?xt.actualBoundingBoxAscent:tt*as,Tt=Math.max(0,xt.actualBoundingBoxDescent||0),ut=xt.fontBoundingBoxAscent||0,ft=xt.fontBoundingBoxDescent||0;P(Lt=>Math.abs(Lt-It)>.5?It:Lt);const Et=ut>0||ft>0?(ft-Tt-(ut-It))/2:0;X(Lt=>Math.abs(Lt-Et)>.25?Et:Lt)};Pe();const Ae=typeof document<"u"?document.fonts:void 0;(Oe=Ae==null?void 0:Ae.ready)==null||Oe.then(Pe).catch(()=>{});const Ke=new ResizeObserver(Pe);return Ke.observe(Re),()=>Ke.disconnect()},[m.fontFamily,m.fontWeight,m.fontStyle,m.fontSize,m.lineHeight]),s.useLayoutEffect(()=>{if(!ne)return;const Re=q.current,Pe=be.current;if(!Re||!Pe)return;const Ae={id:0},Ke=()=>{const nt=Re.offsetWidth||Re.getBoundingClientRect().width,xt=Pe.offsetWidth||Pe.getBoundingClientRect().width;if(E&&nt>0&&xt>0){const It=xt/F;if(It>0){let Tt=nt,ut=Ah;if($){const Et=nt*oe.current,Lt=Fe.current,bt=Lt>0?2*Math.PI*Lt/nt:0,Nt=Gh(Et,bt);Tt=Math.max(nt,Nt*nt/(Il-1)),ut=Fh}const ft=Math.min(ut,Math.max(Sa,Math.ceil(Tt/It)+1));if(ft!==F){ve(ft);return}}}xt>0&&l(xt)},Oe=()=>{cancelAnimationFrame(Ae.id),Ae.id=requestAnimationFrame(Ke)};Oe();const Qe=new ResizeObserver(Oe);Qe.observe(Re),Qe.observe(Pe);const tt=()=>{document.hidden||Oe()};return document.addEventListener("visibilitychange",tt),window.addEventListener("pageshow",tt),window.addEventListener("focus",tt),()=>{cancelAnimationFrame(Ae.id),Qe.disconnect(),document.removeEventListener("visibilitychange",tt),window.removeEventListener("pageshow",tt),window.removeEventListener("focus",tt)}},[ne,ye,F,E,Ce,$,R,k]),s.useLayoutEffect(()=>{const Re=He.current;if(!Re)return;const Pe={id:0},Ae=()=>{const Oe=Re.offsetHeight;Oe>0&&$e(Qe=>Math.abs(Qe-Oe)>.5?Oe:Qe)};Pe.id=requestAnimationFrame(Ae);const Ke=new ResizeObserver(()=>{cancelAnimationFrame(Pe.id),Pe.id=requestAnimationFrame(Ae)});return Ke.observe(Re),()=>{cancelAnimationFrame(Pe.id),Ke.disconnect()}},[V,n]),s.useLayoutEffect(()=>{if(!$){j(0),J(0);return}const Re=q.current,Pe=be.current;if(!Re||!Pe)return;const Ae={id:0},Ke=()=>{const Qe=Re.offsetWidth,tt=Pe.offsetHeight;Qe>0&&J(nt=>Math.abs(nt-Qe)>.5?Qe:nt),tt>0&&j(nt=>Math.abs(nt-tt)>.5?tt:nt)};Ae.id=requestAnimationFrame(Ke);const Oe=new ResizeObserver(()=>{cancelAnimationFrame(Ae.id),Ae.id=requestAnimationFrame(Ke)});return Oe.observe(Re),Oe.observe(Pe),()=>{cancelAnimationFrame(Ae.id),Oe.disconnect()}},[$,ye,Ce,y,S,ne]),s.useLayoutEffect(()=>{if(!ne||d<=0)return;const Re=Q.current;Re&&Oh(Re)},[ne,d,u,I]),s.useLayoutEffect(()=>{if(!$||!E)return;const Re=q.current;if(!Re)return;const Pe={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},Ae=()=>{for(const It of Pe.itemsCache)for(const Tt of It.glyphs)El(Tt.inner)},Ke=()=>{const It=ce.current??Re;Pe.itemsCache=Array.from(Re.querySelectorAll("[data-marquee-text-item]"),Tt=>{const ut=[];return Tt.querySelectorAll("[data-marquee-wave-node]").forEach(ft=>{const Et=ft.firstElementChild;Et&&ut.push({inner:Et,layoutLocalX:Vh(ft,It)})}),{item:Tt,glyphs:ut}}),Pe.cacheDirty=!1},Oe=()=>{Pe.cacheDirty&&Ke();const Tt=(ce.current??Re).offsetWidth||1,ut=Tt*oe.current,ft=Fe.current,Et=2*Math.PI*ft/Tt,Lt=`${Tt}|${ut}|${Et}`;if(Lt!==Pe.lutKey&&(Pe.lutKey=Lt,Pe.lut=Dd(ut,Et,Od)),Math.abs(ut)<=0||Et<=0){Ae();return}const bt=Q.current,Nt=bt?Bh(getComputedStyle(bt).transform):0,Bt=Re.getBoundingClientRect(),Zt=Bt.left,en=Bt.right,Rt=Pe.lut&&Pe.lut.wavelength>0?Math.max(0,(Pe.lut.periodArc/Pe.lut.wavelength-1)*Tt):0;for(const{item:Ot,glyphs:nn}of Pe.itemsCache){const pt=Ot.getBoundingClientRect();if(pt.right<Zt||pt.left>en+Rt){for(const Ee of nn)El(Ee.inner);continue}for(const Ee of nn){const qe=Ee.layoutLocalX+Nt,st=Pe.lut?qh(Pe.lut,qe):qe,mt=Et*st,vt=ut*Math.sin(mt),Mt=ut*Et*Math.cos(mt),gt=Math.atan(Mt)*(180/Math.PI);zh(Ee.inner,st-qe,vt,gt)}}},Qe=()=>{Pe.cancelled||(Pe.raf=0,Oe(),le.current&&!document.hidden&&(Pe.raf=requestAnimationFrame(Qe)))},tt=()=>{Pe.cancelled||Pe.raf||(Pe.raf=requestAnimationFrame(Qe))},nt=()=>{Pe.cacheDirty=!0,Oe(),tt()};ee.current=tt,ue.current=nt,Oe(),tt();const xt=()=>{if(document.hidden){cancelAnimationFrame(Pe.raf),Pe.raf=0;return}cancelAnimationFrame(Pe.raf),Pe.raf=0,nt()};return document.addEventListener("visibilitychange",xt),window.addEventListener("pageshow",xt),window.addEventListener("focus",xt),()=>{Pe.cancelled=!0,ee.current=null,ue.current=null,cancelAnimationFrame(Pe.raf),document.removeEventListener("visibilitychange",xt),window.removeEventListener("pageshow",xt),window.removeEventListener("focus",xt),Ae()}},[$,E]),s.useLayoutEffect(()=>{var Re;!$||!E||(Re=ue.current)==null||Re.call(ue)},[$,E,r,ye,F,Ce,R,k,B]),s.useLayoutEffect(()=>{var Re;(Re=ee.current)==null||Re.call(ee)},[A,u]);const me=()=>{W&&ae(!0)},De=()=>{W&&ae(!1)},ge=$?Math.abs(R)*100:0,G=M(V),Me={minHeight:G,...$?{paddingTop:`${ge}%`,paddingBottom:`${ge}%`}:{}},_e={height:G,...$?{visibility:"hidden"}:{backgroundColor:O}},rt={gap:M(b),minHeight:G},Je=B*R,at=Math.abs(Je),it=te>0?te:ie,je=Math.max(ie,it),Se=at+je/2,We=Math.max(it,1),Be=$&&B>0&&je>0?Xh(B,Je,k,Se,We):"",Ze=at*2+je,Le=Be?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${B} ${Ze}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:Be,fill:"none",stroke:O,strokeWidth:it,strokeLinecap:"butt",strokeLinejoin:"round"})}):null,Ve=a.jsx("div",{ref:He,className:`${o}-ribbon`,style:_e,"aria-hidden":!0}),se=(Re,Pe,Ae)=>a.jsx(Uh,{item:Re,prefix:o,textCss:m,capHeightPx:Ce,opticalOffsetY:Y,imageGapPx:M(b),isCurve:$},`${Pe}-${Ae}`),Te=a.jsx("span",{ref:xe,"aria-hidden":!0,className:`${o}-cap-ref`,style:m,children:"H"}),Xe=`${Math.max(0,he)/1e3}s`,ze=ne?a.jsx("div",{ref:Q,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:me,onMouseLeave:De,style:{WebkitAnimationDuration:Xe,animationDuration:Xe,WebkitAnimationPlayState:de,animationPlayState:de},children:Array.from({length:Z},(Re,Pe)=>a.jsx("div",{ref:Pe===0?be:void 0,className:`${o}-marquee-set`,style:{...rt,paddingRight:M(b)},"aria-hidden":Pe>0,children:pe.map((Ae,Ke)=>se(Ae,Pe,Ke))},`set-${Pe}`))}):a.jsx("div",{ref:be,className:yt(`${o}-marquee-set`,`${o}-marquee-static`),style:rt,children:t==null?void 0:t.map((Re,Pe)=>se(Re,0,Pe))});return a.jsxs("div",{ref:q,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:T}}),Te,a.jsxs("div",{ref:ce,className:`${o}-marquee-wrapper`,style:Me,children:[Ve,Le,ze]})]})},Kh=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
2609
2609
  import cn from 'classnames';
2610
2610
  import { CommonComponentProps } from '../props';
2611
2611
  import { scalingValue } from '../utils/scalingValue';
@@ -3624,7 +3624,7 @@ type MarqueeTextProps = {
3624
3624
  pointer-events: auto;
3625
3625
  z-index: 10;
3626
3626
  }
3627
- `}const tf=30,Ml=2,nf=e=>{e.style.setProperty("animation-name","none"),e.style.setProperty("-webkit-animation-name","none"),e.offsetHeight,e.style.removeProperty("animation-name"),e.style.removeProperty("-webkit-animation-name")},of=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=D.useScopedStyles(),{align:l,speed:d,direction:c,pauseOnHover:u,gap:p,cardWidth:b,corners:v,stroke:g,strokeColor:h,bgColor:f,padding:x,logoMarginTop:S,logoWidth:y,logoHeight:w,captionMarginTop:H}=e,N=!!o,Y=((t==null?void 0:t.length)??0)>0,O=d>0&&(!n||i),C=Y&&(O||n),V=Math.max(0,d)*tf,$=F=>D.scalingValue(F,n??!1),R=s.useRef(null),k=s.useRef(null),T=s.useRef(null),[m,M]=s.useState(0),[E,z]=s.useState(0),ne=E>0?E:0,I=s.useMemo(()=>ef(r,ne),[r,ne]),[W,K]=s.useState(0),ae=O&&u==="on",[de,A]=s.useState(!1),he=s.useRef(null),[q,ce]=s.useState(0),[Q,be]=s.useState(0),He=s.useRef(null),xe=F=>{var pe,Z,me,De,ge;return{fontSettings:{fontFamily:(e==null?void 0:e[`${F}FontFamily`])??"Arial",fontWeight:((pe=e==null?void 0:e[`${F}FontSettings`])==null?void 0:pe.fontWeight)??400,fontStyle:((Z=e==null?void 0:e[`${F}FontSettings`])==null?void 0:Z.fontStyle)??"normal"},textAppearance:{textTransform:((me=e==null?void 0:e[`${F}TextAppearance`])==null?void 0:me.textTransform)??"none",textDecoration:((De=e==null?void 0:e[`${F}TextAppearance`])==null?void 0:De.textDecoration)??"none",fontVariant:((ge=e==null?void 0:e[`${F}TextAppearance`])==null?void 0:ge.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${F}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${F}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${F}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${F}LineHeight`])??.01,color:(e==null?void 0:e[`${F}Color`])??"#000000"}},le=xe("text"),ee=xe("caption"),ue=s.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(F=>{var ve,pe;return(((ve=F.text)==null?void 0:ve.length)??0)>0||(((pe=F.caption)==null?void 0:pe.length)??0)>0}),[t]),oe=s.useMemo(()=>!C||(t==null?void 0:t.length)===0?1:E<=0||m<=0?Ml:Math.max(Ml,Math.ceil(m/E)+1),[C,t==null?void 0:t.length,E,m]);s.useLayoutEffect(()=>{if(!C)return;const F=R.current,ve=T.current;if(!F||!ve)return;let pe=0;const Z=()=>{const ge=F.getBoundingClientRect().width,G=ve.getBoundingClientRect().width,Me=He.current,_e=typeof Me=="number"&&Math.abs(Me-G)<=.25;if(He.current=G,M(ge),typeof G=="number"&&G>0&&E<=0){z(G);return}_e&&G!==E?z(G):!_e&&E<=0&&(cancelAnimationFrame(pe),pe=requestAnimationFrame(Z))},me=()=>{cancelAnimationFrame(pe),pe=requestAnimationFrame(Z)};me();const De=new ResizeObserver(me);return De.observe(F),De.observe(ve),()=>{cancelAnimationFrame(pe),De.disconnect()}},[O,C,E]);const Fe=ne>0&&V>0?ne/V*1e3:0,Ce=`${Math.max(0,Fe)/1e3}s`;s.useLayoutEffect(()=>{if(!C||ne<=0)return;const F=k.current;F&&nf(F)},[C,ne,c]),s.useLayoutEffect(()=>{if(!C){K(0);return}const F=T.current,ve=k.current;if(!F||!ve)return;const pe=()=>{let me=0;for(let De=0;De<F.children.length;De++){const G=F.children[De].firstElementChild;G&&(me=Math.max(me,G.offsetHeight))}me<=0&&(me=ve.offsetHeight),K(me>0?me:0)};pe();const Z=new ResizeObserver(pe);return Z.observe(F),Z.observe(ve),()=>{Z.disconnect()}},[C,oe,t,n,p,b,x,g,v,y,w,q,Q]);const P=()=>{ae&&A(!0)},U=()=>{ae&&A(!1)},X=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),ie=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]),j=s.useCallback((F,ve,pe,Z)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:X,width:"100%"},children:[a.jsx("div",{"data-controls":N?Z==null?void 0:Z.controlsName:void 0,"data-controls-axis":N?"y":void 0,className:N?`${r}-control`:void 0,style:{height:$((Z==null?void 0:Z.marginTop)??0)}}),a.jsx("div",{...Z!=null&&Z.dataMeasureKind?{"data-testimonial-measure":Z.dataMeasureKind}:{},style:{...Yt(F,n),textAlign:ie,pointerEvents:"auto",...typeof(Z==null?void 0:Z.minHeightPx)=="number"&&Z.minHeightPx>0?{minHeight:Z.minHeightPx}:{}},children:a.jsx(Ri,{content:ve})})]},pe),[X,ie,n,N,r,$]),B=s.useCallback((F,ve,pe)=>{var Z,me,De;return a.jsxs("div",{style:{padding:`${$(x.top)} ${$(x.right)} ${$(x.bottom)} ${$(x.left)}`,width:$(b+g*2),height:"100%",borderRadius:$(v),border:`${$(g)} solid ${h}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[a.jsx("div",{className:`${r}-cover`,style:{background:f}}),a.jsxs("div",{className:`${r}-elements-overlay`,style:{alignItems:X,textAlign:ie},children:[F.text&&j(le,F.text,"text",pe!=null&&pe.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(pe==null?void 0:pe.textMinHeightPx)=="number"&&pe.textMinHeightPx>0?{minHeightPx:pe.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:X,width:"100%"},children:[a.jsx("div",{"data-controls":N&&!(pe!=null&&pe.dataMeasureAttrs)?"logoMarginTop":void 0,className:N&&!(pe!=null&&pe.dataMeasureAttrs)?`${r}-control`:void 0,style:{height:$(S)}}),a.jsx("div",{style:{width:$(y),height:$(w)},children:((Z=F.logo)==null?void 0:Z.url)&&a.jsx("img",{src:F.logo.url,alt:((me=F.logo)==null?void 0:me.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((De=F.logo)==null?void 0:De.objectFit)||"contain"}})})]}),F.caption&&j(ee,F.caption,"caption",{...pe!=null&&pe.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:H,...pe!=null&&pe.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(pe==null?void 0:pe.captionMinHeightPx)=="number"&&pe.captionMinHeightPx>0?{minHeightPx:pe.captionMinHeightPx}:{}})]})]},ve)},[f,H,ee,b,v,w,S,y,X,ie,x.bottom,x.left,x.right,x.top,j,g,h,le,n,N,r]),J=s.useCallback(F=>{ce(F.maxTextPx),be(F.maxCaptionPx)},[]);s.useLayoutEffect(()=>{if(!ue){J({maxTextPx:0,maxCaptionPx:0});return}const F=he.current;if(!F)return;const ve=()=>{D.readTestimonialTextMeasure(F,J)};ve();const pe=new ResizeObserver(ve);return pe.observe(F),()=>{pe.disconnect()}},[ue,J,t,B]);const te=ue?{textMinHeightPx:q,captionMinHeightPx:Q}:void 0,$e=ue?a.jsx("div",{ref:he,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((F,ve)=>B(F,`measure-${ve}`,{dataMeasureAttrs:!0}))}):null,ye=(F,ve)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[B(F,`card-${ve}`,te),N&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${$(p)})`,width:$(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},ve);if(C){const F=O?ae&&de?"paused":"running":"paused";return a.jsxs("div",{ref:R,className:yt(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...W>0?{height:W}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:I}}),$e,a.jsx("div",{ref:k,className:`${r}-marquee-track`,"data-direction":c,onMouseEnter:P,onMouseLeave:U,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px",animationDuration:Ce,WebkitAnimationDuration:Ce,animationPlayState:F,WebkitAnimationPlayState:F},children:Array.from({length:oe},(ve,pe)=>a.jsx("div",{ref:pe===0?T:void 0,className:`${r}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:$(p),paddingRight:$(p)},"aria-hidden":pe>0,children:t==null?void 0:t.map((Z,me)=>ye(Z,`${pe}-${me}`))},`set-${pe}`))})]})}return a.jsxs("div",{className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:I}}),$e,a.jsx("div",{style:{gap:$(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((F,ve)=>ye(F,ve))})]})},rf=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
3627
+ `}const tf=30,Ml=2,nf=e=>{e.style.setProperty("animation-name","none"),e.style.setProperty("-webkit-animation-name","none"),e.offsetHeight,e.style.removeProperty("animation-name"),e.style.removeProperty("-webkit-animation-name")},of=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=D.useScopedStyles(),{align:l,speed:d,direction:c,pauseOnHover:u,gap:p,cardWidth:b,corners:v,stroke:g,strokeColor:h,bgColor:f,padding:x,logoMarginTop:S,logoWidth:y,logoHeight:w,captionMarginTop:H}=e,N=!!o,U=((t==null?void 0:t.length)??0)>0,O=d>0&&(!n||i),C=U&&(O||n),V=Math.max(0,d)*tf,$=F=>D.scalingValue(F,n??!1),R=s.useRef(null),k=s.useRef(null),T=s.useRef(null),[m,M]=s.useState(0),[E,z]=s.useState(0),ne=E>0?E:0,I=s.useMemo(()=>ef(r,ne),[r,ne]),[W,K]=s.useState(0),ae=O&&u==="on",[de,A]=s.useState(!1),he=s.useRef(null),[q,ce]=s.useState(0),[Q,be]=s.useState(0),He=s.useRef(null),xe=F=>{var pe,Z,me,De,ge;return{fontSettings:{fontFamily:(e==null?void 0:e[`${F}FontFamily`])??"Arial",fontWeight:((pe=e==null?void 0:e[`${F}FontSettings`])==null?void 0:pe.fontWeight)??400,fontStyle:((Z=e==null?void 0:e[`${F}FontSettings`])==null?void 0:Z.fontStyle)??"normal"},textAppearance:{textTransform:((me=e==null?void 0:e[`${F}TextAppearance`])==null?void 0:me.textTransform)??"none",textDecoration:((De=e==null?void 0:e[`${F}TextAppearance`])==null?void 0:De.textDecoration)??"none",fontVariant:((ge=e==null?void 0:e[`${F}TextAppearance`])==null?void 0:ge.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${F}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${F}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${F}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${F}LineHeight`])??.01,color:(e==null?void 0:e[`${F}Color`])??"#000000"}},le=xe("text"),ee=xe("caption"),ue=s.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(F=>{var ve,pe;return(((ve=F.text)==null?void 0:ve.length)??0)>0||(((pe=F.caption)==null?void 0:pe.length)??0)>0}),[t]),oe=s.useMemo(()=>!C||(t==null?void 0:t.length)===0?1:E<=0||m<=0?Ml:Math.max(Ml,Math.ceil(m/E)+1),[C,t==null?void 0:t.length,E,m]);s.useLayoutEffect(()=>{if(!C)return;const F=R.current,ve=T.current;if(!F||!ve)return;let pe=0;const Z=()=>{const ge=F.getBoundingClientRect().width,G=ve.getBoundingClientRect().width,Me=He.current,_e=typeof Me=="number"&&Math.abs(Me-G)<=.25;if(He.current=G,M(ge),typeof G=="number"&&G>0&&E<=0){z(G);return}_e&&G!==E?z(G):!_e&&E<=0&&(cancelAnimationFrame(pe),pe=requestAnimationFrame(Z))},me=()=>{cancelAnimationFrame(pe),pe=requestAnimationFrame(Z)};me();const De=new ResizeObserver(me);return De.observe(F),De.observe(ve),()=>{cancelAnimationFrame(pe),De.disconnect()}},[O,C,E]);const Fe=ne>0&&V>0?ne/V*1e3:0,Ce=`${Math.max(0,Fe)/1e3}s`;s.useLayoutEffect(()=>{if(!C||ne<=0)return;const F=k.current;F&&nf(F)},[C,ne,c]),s.useLayoutEffect(()=>{if(!C){K(0);return}const F=T.current,ve=k.current;if(!F||!ve)return;const pe=()=>{let me=0;for(let De=0;De<F.children.length;De++){const G=F.children[De].firstElementChild;G&&(me=Math.max(me,G.offsetHeight))}me<=0&&(me=ve.offsetHeight),K(me>0?me:0)};pe();const Z=new ResizeObserver(pe);return Z.observe(F),Z.observe(ve),()=>{Z.disconnect()}},[C,oe,t,n,p,b,x,g,v,y,w,q,Q]);const P=()=>{ae&&A(!0)},Y=()=>{ae&&A(!1)},X=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),ie=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]),j=s.useCallback((F,ve,pe,Z)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:X,width:"100%"},children:[a.jsx("div",{"data-controls":N?Z==null?void 0:Z.controlsName:void 0,"data-controls-axis":N?"y":void 0,className:N?`${r}-control`:void 0,style:{height:$((Z==null?void 0:Z.marginTop)??0)}}),a.jsx("div",{...Z!=null&&Z.dataMeasureKind?{"data-testimonial-measure":Z.dataMeasureKind}:{},style:{...Yt(F,n),textAlign:ie,pointerEvents:"auto",...typeof(Z==null?void 0:Z.minHeightPx)=="number"&&Z.minHeightPx>0?{minHeight:Z.minHeightPx}:{}},children:a.jsx(Ri,{content:ve})})]},pe),[X,ie,n,N,r,$]),B=s.useCallback((F,ve,pe)=>{var Z,me,De;return a.jsxs("div",{style:{padding:`${$(x.top)} ${$(x.right)} ${$(x.bottom)} ${$(x.left)}`,width:$(b+g*2),height:"100%",borderRadius:$(v),border:`${$(g)} solid ${h}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[a.jsx("div",{className:`${r}-cover`,style:{background:f}}),a.jsxs("div",{className:`${r}-elements-overlay`,style:{alignItems:X,textAlign:ie},children:[F.text&&j(le,F.text,"text",pe!=null&&pe.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(pe==null?void 0:pe.textMinHeightPx)=="number"&&pe.textMinHeightPx>0?{minHeightPx:pe.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:X,width:"100%"},children:[a.jsx("div",{"data-controls":N&&!(pe!=null&&pe.dataMeasureAttrs)?"logoMarginTop":void 0,className:N&&!(pe!=null&&pe.dataMeasureAttrs)?`${r}-control`:void 0,style:{height:$(S)}}),a.jsx("div",{style:{width:$(y),height:$(w)},children:((Z=F.logo)==null?void 0:Z.url)&&a.jsx("img",{src:F.logo.url,alt:((me=F.logo)==null?void 0:me.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((De=F.logo)==null?void 0:De.objectFit)||"contain"}})})]}),F.caption&&j(ee,F.caption,"caption",{...pe!=null&&pe.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:H,...pe!=null&&pe.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(pe==null?void 0:pe.captionMinHeightPx)=="number"&&pe.captionMinHeightPx>0?{minHeightPx:pe.captionMinHeightPx}:{}})]})]},ve)},[f,H,ee,b,v,w,S,y,X,ie,x.bottom,x.left,x.right,x.top,j,g,h,le,n,N,r]),J=s.useCallback(F=>{ce(F.maxTextPx),be(F.maxCaptionPx)},[]);s.useLayoutEffect(()=>{if(!ue){J({maxTextPx:0,maxCaptionPx:0});return}const F=he.current;if(!F)return;const ve=()=>{D.readTestimonialTextMeasure(F,J)};ve();const pe=new ResizeObserver(ve);return pe.observe(F),()=>{pe.disconnect()}},[ue,J,t,B]);const te=ue?{textMinHeightPx:q,captionMinHeightPx:Q}:void 0,$e=ue?a.jsx("div",{ref:he,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((F,ve)=>B(F,`measure-${ve}`,{dataMeasureAttrs:!0}))}):null,ye=(F,ve)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[B(F,`card-${ve}`,te),N&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${$(p)})`,width:$(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},ve);if(C){const F=O?ae&&de?"paused":"running":"paused";return a.jsxs("div",{ref:R,className:yt(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...W>0?{height:W}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:I}}),$e,a.jsx("div",{ref:k,className:`${r}-marquee-track`,"data-direction":c,onMouseEnter:P,onMouseLeave:Y,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px",animationDuration:Ce,WebkitAnimationDuration:Ce,animationPlayState:F,WebkitAnimationPlayState:F},children:Array.from({length:oe},(ve,pe)=>a.jsx("div",{ref:pe===0?T:void 0,className:`${r}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:$(p),paddingRight:$(p)},"aria-hidden":pe>0,children:t==null?void 0:t.map((Z,me)=>ye(Z,`${pe}-${me}`))},`set-${pe}`))})]})}return a.jsxs("div",{className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:I}}),$e,a.jsx("div",{style:{gap:$(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((F,ve)=>ye(F,ve))})]})},rf=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
3628
3628
  import cn from 'classnames';
3629
3629
  import { CommonComponentProps } from '../props';
3630
3630
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
@@ -4379,7 +4379,7 @@ type TestimonialsSettings = {
4379
4379
  width: 100%;
4380
4380
  height: 100%;
4381
4381
  }
4382
- `}const cf=3e3,df=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=D.useScopedStyles(),l=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:b,captionMarginTop:v,imageWidth:g,imageHeight:h,controlsWidth:f,controlsColor:x,controlsHoverColor:S}=e,y=d>0&&(!n||!!i),[w,H]=s.useState(0),[N,Y]=s.useState(null),[O,C]=s.useState(!1),V=s.useRef(null),$=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),R=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);s.useEffect(()=>{H(0),Y(null),C(!1)},[l.length]);const k=l[w],T=N===null?null:l[N],m=xe=>{var ee,ue,oe,Fe,Ce;return{fontSettings:{fontFamily:(e==null?void 0:e[`${xe}FontFamily`])??"Arial",fontWeight:((ee=e==null?void 0:e[`${xe}FontSettings`])==null?void 0:ee.fontWeight)??400,fontStyle:((ue=e==null?void 0:e[`${xe}FontSettings`])==null?void 0:ue.fontStyle)??"normal"},textAppearance:{textTransform:((oe=e==null?void 0:e[`${xe}TextAppearance`])==null?void 0:oe.textTransform)??"none",textDecoration:((Fe=e==null?void 0:e[`${xe}TextAppearance`])==null?void 0:Fe.textDecoration)??"none",fontVariant:((Ce=e==null?void 0:e[`${xe}TextAppearance`])==null?void 0:Ce.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${xe}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${xe}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${xe}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${xe}WordSpacing`])??0,color:(e==null?void 0:e[`${xe}Color`])??"#000000"}},M=m("text"),E=m("caption"),z=l.length>1&&l.some(xe=>{var le,ee;return(((le=xe.text)==null?void 0:le.length)??0)>0||(((ee=xe.caption)==null?void 0:ee.length)??0)>0}),ne=s.useRef(null),[I,W]=s.useState(0),[K,ae]=s.useState(0),de=e.controls??{mode:"Off",icon:null},A=l.length>1,he=s.useCallback((xe,le)=>!A||le===xe?xe:(V.current&&window.clearTimeout(V.current),Y(xe),C(!0),V.current=window.setTimeout(()=>{Y(null),C(!1),V.current=null},300),le),[A]),q=s.useCallback(()=>{A&&H(xe=>he(xe,(xe-1+l.length)%l.length))},[A,he,l.length]),ce=s.useCallback(()=>{A&&H(xe=>he(xe,(xe+1)%l.length))},[A,he,l.length]);s.useEffect(()=>{if(!y||!A)return;const xe=Math.max(300,cf/d),le=window.setInterval(()=>{H(ee=>he(ee,(ee+1)%l.length))},xe);return()=>{window.clearInterval(le)}},[y,A,he,l.length,d]),s.useEffect(()=>()=>{V.current&&window.clearTimeout(V.current)},[]);const Q=(xe,le)=>{var Ce,P,U,X;const ee=le==null?void 0:le.textMinHeightPx,ue=le==null?void 0:le.captionMinHeightPx,oe=le==null?void 0:le.dataMeasureAttrs,Fe=o&&!(le!=null&&le.dataMeasureAttrs)&&!(le!=null&&le.hideControls);return a.jsxs(a.Fragment,{children:[xe.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Fe?"textMarginTop":void 0,className:Fe?`${r}-control`:void 0,style:{height:D.scalingValue(b??0,n??!1)}}),a.jsx("div",{...oe&&{"data-testimonial-measure":"text"},style:{...Yt(M,n),...ee&&ee>0?{minHeight:ee}:{},textAlign:R,pointerEvents:"auto"},children:a.jsx(Ri,{content:xe.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Fe?"imageMarginTop":void 0,className:Fe?`${r}-control`:void 0,style:{height:D.scalingValue(p??0,n??!1)}}),a.jsx("div",{style:{width:D.scalingValue(g??0,n??!1),height:D.scalingValue(h??0,n??!1)},children:((Ce=xe.image)==null?void 0:Ce.url)&&a.jsx("img",{src:(P=xe.image)==null?void 0:P.url,alt:((U=xe.image)==null?void 0:U.name)??"",className:`${r}-icon`,style:{objectFit:((X=xe.image)==null?void 0:X.objectFit)||"contain"}})})]}),xe.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Fe?"captionMarginTop":void 0,className:Fe?`${r}-control`:void 0,style:{height:D.scalingValue(v??0,n??!1)}}),a.jsx("div",{...oe?{"data-testimonial-measure":"caption"}:{},style:{...Yt(E,n),...ue&&ue>0?{minHeight:ue}:{},textAlign:R,pointerEvents:"auto"},children:a.jsx(Ri,{content:xe.caption})})]})]})},be=s.useCallback(xe=>{W(xe.maxTextPx),ae(xe.maxCaptionPx)},[]);if(s.useLayoutEffect(()=>{if(!z){be({maxTextPx:0,maxCaptionPx:0});return}const xe=ne.current;if(!xe)return;const le=()=>{D.readTestimonialTextMeasure(xe,be)};le();const ee=new ResizeObserver(le);return ee.observe(xe),()=>{ee.disconnect()}},[z,be,t]),!k)return a.jsx(a.Fragment,{});const He=z?{textMinHeightPx:I,captionMinHeightPx:K}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${r}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:lf(r)}}),a.jsxs("div",{className:`${r}-wrapper`,style:{width:D.scalingValue(u??0,n??!1),alignItems:$},children:[z&&a.jsx("div",{ref:ne,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((xe,le)=>a.jsx("div",{style:{width:"100%"},children:Q(xe,{dataMeasureAttrs:!0})},le))}),a.jsxs("div",{className:`${r}-fade-stack`,children:[T&&O&&a.jsx("div",{className:yt(`${r}-fade-item-prev`,`${r}-fade-out`),children:Q(T,{...He,hideControls:!0})}),a.jsx("div",{className:yt(`${r}-fade-item-current`,O?`${r}-fade-in`:void 0),children:Q(k,He)})]})]}),de.mode==="On"&&a.jsxs("div",{className:`${r}-controls`,children:[a.jsx("div",{className:`${r}-arrow`,style:{width:D.scalingValue(f??.02,n??!1),height:D.scalingValue(f??.02,n??!1),"--arrow-hover-color":S},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:q,disabled:!A,"aria-label":"Previous testimonial",children:de.icon&&a.jsx(ln,{url:de.icon,fill:x,hoverFill:S,className:yt(`${r}-arrow-img`,`${r}-mirror`)})})}),a.jsx("div",{className:yt(`${r}-arrow`,`${r}-next-arrow`),style:{width:D.scalingValue(f??.02,n??!1),height:D.scalingValue(f??.02,n??!1),"--arrow-hover-color":S},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:ce,disabled:!A,"aria-label":"Next testimonial",children:de.icon&&a.jsx(ln,{url:de.icon,fill:x,hoverFill:S,className:`${r}-arrow-img`})})})]})]})})},uf=`import cn from 'classnames';
4382
+ `}const cf=3e3,df=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=D.useScopedStyles(),l=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:b,captionMarginTop:v,imageWidth:g,imageHeight:h,controlsWidth:f,controlsColor:x,controlsHoverColor:S}=e,y=d>0&&(!n||!!i),[w,H]=s.useState(0),[N,U]=s.useState(null),[O,C]=s.useState(!1),V=s.useRef(null),$=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),R=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);s.useEffect(()=>{H(0),U(null),C(!1)},[l.length]);const k=l[w],T=N===null?null:l[N],m=xe=>{var ee,ue,oe,Fe,Ce;return{fontSettings:{fontFamily:(e==null?void 0:e[`${xe}FontFamily`])??"Arial",fontWeight:((ee=e==null?void 0:e[`${xe}FontSettings`])==null?void 0:ee.fontWeight)??400,fontStyle:((ue=e==null?void 0:e[`${xe}FontSettings`])==null?void 0:ue.fontStyle)??"normal"},textAppearance:{textTransform:((oe=e==null?void 0:e[`${xe}TextAppearance`])==null?void 0:oe.textTransform)??"none",textDecoration:((Fe=e==null?void 0:e[`${xe}TextAppearance`])==null?void 0:Fe.textDecoration)??"none",fontVariant:((Ce=e==null?void 0:e[`${xe}TextAppearance`])==null?void 0:Ce.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${xe}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${xe}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${xe}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${xe}WordSpacing`])??0,color:(e==null?void 0:e[`${xe}Color`])??"#000000"}},M=m("text"),E=m("caption"),z=l.length>1&&l.some(xe=>{var le,ee;return(((le=xe.text)==null?void 0:le.length)??0)>0||(((ee=xe.caption)==null?void 0:ee.length)??0)>0}),ne=s.useRef(null),[I,W]=s.useState(0),[K,ae]=s.useState(0),de=e.controls??{mode:"Off",icon:null},A=l.length>1,he=s.useCallback((xe,le)=>!A||le===xe?xe:(V.current&&window.clearTimeout(V.current),U(xe),C(!0),V.current=window.setTimeout(()=>{U(null),C(!1),V.current=null},300),le),[A]),q=s.useCallback(()=>{A&&H(xe=>he(xe,(xe-1+l.length)%l.length))},[A,he,l.length]),ce=s.useCallback(()=>{A&&H(xe=>he(xe,(xe+1)%l.length))},[A,he,l.length]);s.useEffect(()=>{if(!y||!A)return;const xe=Math.max(300,cf/d),le=window.setInterval(()=>{H(ee=>he(ee,(ee+1)%l.length))},xe);return()=>{window.clearInterval(le)}},[y,A,he,l.length,d]),s.useEffect(()=>()=>{V.current&&window.clearTimeout(V.current)},[]);const Q=(xe,le)=>{var Ce,P,Y,X;const ee=le==null?void 0:le.textMinHeightPx,ue=le==null?void 0:le.captionMinHeightPx,oe=le==null?void 0:le.dataMeasureAttrs,Fe=o&&!(le!=null&&le.dataMeasureAttrs)&&!(le!=null&&le.hideControls);return a.jsxs(a.Fragment,{children:[xe.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Fe?"textMarginTop":void 0,className:Fe?`${r}-control`:void 0,style:{height:D.scalingValue(b??0,n??!1)}}),a.jsx("div",{...oe&&{"data-testimonial-measure":"text"},style:{...Yt(M,n),...ee&&ee>0?{minHeight:ee}:{},textAlign:R,pointerEvents:"auto"},children:a.jsx(Ri,{content:xe.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Fe?"imageMarginTop":void 0,className:Fe?`${r}-control`:void 0,style:{height:D.scalingValue(p??0,n??!1)}}),a.jsx("div",{style:{width:D.scalingValue(g??0,n??!1),height:D.scalingValue(h??0,n??!1)},children:((Ce=xe.image)==null?void 0:Ce.url)&&a.jsx("img",{src:(P=xe.image)==null?void 0:P.url,alt:((Y=xe.image)==null?void 0:Y.name)??"",className:`${r}-icon`,style:{objectFit:((X=xe.image)==null?void 0:X.objectFit)||"contain"}})})]}),xe.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Fe?"captionMarginTop":void 0,className:Fe?`${r}-control`:void 0,style:{height:D.scalingValue(v??0,n??!1)}}),a.jsx("div",{...oe?{"data-testimonial-measure":"caption"}:{},style:{...Yt(E,n),...ue&&ue>0?{minHeight:ue}:{},textAlign:R,pointerEvents:"auto"},children:a.jsx(Ri,{content:xe.caption})})]})]})},be=s.useCallback(xe=>{W(xe.maxTextPx),ae(xe.maxCaptionPx)},[]);if(s.useLayoutEffect(()=>{if(!z){be({maxTextPx:0,maxCaptionPx:0});return}const xe=ne.current;if(!xe)return;const le=()=>{D.readTestimonialTextMeasure(xe,be)};le();const ee=new ResizeObserver(le);return ee.observe(xe),()=>{ee.disconnect()}},[z,be,t]),!k)return a.jsx(a.Fragment,{});const He=z?{textMinHeightPx:I,captionMinHeightPx:K}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${r}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:lf(r)}}),a.jsxs("div",{className:`${r}-wrapper`,style:{width:D.scalingValue(u??0,n??!1),alignItems:$},children:[z&&a.jsx("div",{ref:ne,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((xe,le)=>a.jsx("div",{style:{width:"100%"},children:Q(xe,{dataMeasureAttrs:!0})},le))}),a.jsxs("div",{className:`${r}-fade-stack`,children:[T&&O&&a.jsx("div",{className:yt(`${r}-fade-item-prev`,`${r}-fade-out`),children:Q(T,{...He,hideControls:!0})}),a.jsx("div",{className:yt(`${r}-fade-item-current`,O?`${r}-fade-in`:void 0),children:Q(k,He)})]})]}),de.mode==="On"&&a.jsxs("div",{className:`${r}-controls`,children:[a.jsx("div",{className:`${r}-arrow`,style:{width:D.scalingValue(f??.02,n??!1),height:D.scalingValue(f??.02,n??!1),"--arrow-hover-color":S},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:q,disabled:!A,"aria-label":"Previous testimonial",children:de.icon&&a.jsx(ln,{url:de.icon,fill:x,hoverFill:S,className:yt(`${r}-arrow-img`,`${r}-mirror`)})})}),a.jsx("div",{className:yt(`${r}-arrow`,`${r}-next-arrow`),style:{width:D.scalingValue(f??.02,n??!1),height:D.scalingValue(f??.02,n??!1),"--arrow-hover-color":S},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:ce,disabled:!A,"aria-label":"Next testimonial",children:de.icon&&a.jsx(ln,{url:de.icon,fill:x,hoverFill:S,className:`${r}-arrow-img`})})})]})]})})},uf=`import cn from 'classnames';
4383
4383
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
4384
4384
  import { CommonComponentProps } from '../props';
4385
4385
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
@@ -5222,7 +5222,7 @@ type TestimonialsSettings = {
5222
5222
  z-index: 2;
5223
5223
  width: 100%;
5224
5224
  }
5225
- `}function yf(){return Math.random()<.5?"ltr":"ttb"}function vf(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function xf(e){const t=yf();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{vf(e)})})}const wn=500,bf=750,Gn="cubic-bezier(0.22, 1, 0.36, 1)",wf=72,Sf=50;function $f(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 Cf(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Tf(e){const[t]=e.media;return t!=null&&t.url?t:null}function jd(e){return!Array.isArray(e)||e.length===0?[]:$f(e)?e.flatMap(t=>{const n=Cf(t);if(!n)return[];const i=Tf(t);return[{displayMedia:n,lightboxMedia:i!=null&&i.url?i:null}]}):e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function Ci(e){return e.type==="video"}function Lf(e){const t=new Set,n=[];for(const i of e){const o=jd(i.gallery);for(const r of o){const l=r.lightboxMedia;l!=null&&l.url&&!t.has(l.url)&&(t.add(l.url),n.push(l))}}return n}function Rf({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=>Ci(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function If(e){e.pause(),e.removeAttribute("src"),e.load()}function Fl({media:e,className:t,style:n,onMediaClick:i}){return Ci(e)?a.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):a.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function _l(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Ef(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 Mf({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{If(d)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,style:i})}function Pf({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",b=s.useRef(null),v=s.useRef(null),g=s.useRef(null),h=s.useRef(null),f=s.useRef(0),x=s.useRef(0),S=s.useRef("none"),y=s.useRef(!1),w=s.useRef(!1),H=s.useRef(null),N=s.useRef(0),Y=s.useRef(null),O=s.useRef(!1),C=s.useRef(null),V=s.useRef(null),$=s.useRef(null),R=s.useRef(()=>{}),[k,T]=s.useState(null),[m,M]=s.useState(null),[E,z]=s.useState("opening"),[ne,I]=s.useState(0),[W,K]=s.useState(0),[ae,de]=s.useState(null),[A,he]=s.useState(!1),[q,ce]=s.useState(!1),[Q,be]=s.useState(!1),[He,xe]=s.useState(null),le=s.useRef(n),ee=s.useRef(void 0),ue=t[n],oe=ue?Ci(ue):!1,Fe=W!==0||A,Ce=ae!==null,P=s.useCallback(Le=>{const Ve=Le.currentTarget,se=Ve instanceof HTMLVideoElement?{width:Ve.videoWidth,height:Ve.videoHeight}:{width:Ve.naturalWidth,height:Ve.naturalHeight};!se.width||!se.height||xe(se)},[]);s.useEffect(()=>{H.current=m},[m]),s.useEffect(()=>{const Le=b.current;if(!Le)return;const Ve=()=>M(_l(Le));Ve();const se=new ResizeObserver(Ve);return se.observe(Le),()=>se.disconnect()},[]);const U=s.useCallback(()=>{C.current!==null&&(window.clearTimeout(C.current),C.current=null)},[]),X=s.useCallback(()=>{const Le=V.current;V.current=null,U(),Y.current=null,O.current=!1,de(null),he(!1),K(0),N.current=0,ce(!1),y.current=!1,x.current=0,S.current="none",Le===1?d():Le===-1&&l()},[U,d,l]),ie=s.useCallback(()=>{U(),V.current=null,Y.current=null,O.current=!1,de(null),he(!1),K(0),N.current=0},[U]),j=s.useCallback(()=>{U(),C.current=window.setTimeout(()=>{V.current!==null&&X()},wn+32)},[U,X]),B=s.useCallback((Le,Ve)=>{var Te;const se=((Te=H.current)==null?void 0:Te.width)??0;if(U(),Y.current=Le,de(Le),O.current=!0,he(!0),Ve){V.current=Le;const Xe=-Le*se;N.current=Xe,K(Xe),j();return}N.current=0,K(0),C.current=window.setTimeout(()=>{C.current=null,ie()},wn+32)},[U,ie,j]),J=s.useCallback(Le=>{if(!(t.length<=1)){if(O.current){if(V.current===Le){$.current=Le,X();return}ie()}U(),Y.current=Le,de(Le),O.current=!1,he(!1),N.current=0,K(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{B(Le,!0)})})}},[t.length,B,X,ie,U]);R.current=J;const te=s.useCallback(Le=>{Le.propertyName!=="transform"||!O.current||V.current!==null&&X()},[X]),$e=s.useCallback(()=>{const Le=v.current;if(!Le)return;const Ve=_l(Le);!Ve.width||!Ve.height||T(Ve)},[]);s.useEffect(()=>{$e();const Le=v.current;if(!Le)return;const Ve=new ResizeObserver(()=>$e());return Ve.observe(Le),()=>Ve.disconnect()},[$e]),s.useEffect(()=>{E==="opening"&&k&&z("open")},[E,k]),s.useEffect(()=>{if(E!=="closing")return;const Le=setTimeout(()=>r(),wn);return()=>clearTimeout(Le)},[E,r]),s.useEffect(()=>()=>{U()},[U]),s.useLayoutEffect(()=>{le.current===n&&ee.current===(ue==null?void 0:ue.url)||(U(),V.current=null,de(null),I(0),K(0),he(!1),be(!1),ce(!1),xe(null),f.current=0,x.current=0,S.current="none",y.current=!1,O.current=!1,N.current=0,Y.current=null,h.current=null,w.current=!1,le.current=n,ee.current=ue==null?void 0:ue.url)},[n,ue==null?void 0:ue.url,U]),s.useLayoutEffect(()=>{const Le=$.current;Le!==null&&($.current=null,requestAnimationFrame(()=>{R.current(Le)}))},[n,ue==null?void 0:ue.url]),s.useEffect(()=>{if(E!=="open")return;let Le=null;const Ve=()=>{Le&&(document.removeEventListener("click",Le,!0),Le=null)},se=()=>{Ve(),Le=Pe=>{Pe.stopPropagation(),Pe.preventDefault(),Ve()},document.addEventListener("click",Le,!0)},Te=Pe=>{const Ae=Pe<0?1:-1;if(Math.abs(Pe)>Sf&&t.length>1){B(Ae,!0);return}B(Ae,!1)},Xe=Pe=>{if(Pe.touches.length!==1||O.current)return;const Ae=Pe.touches[0];w.current=!0,h.current={x:Ae.clientX,y:Ae.clientY},S.current="none",x.current=0,y.current=!1},ze=Pe=>{if(!h.current||Pe.touches.length!==1||O.current)return;const Ae=Pe.touches[0],Ke=Ae.clientX-h.current.x,Oe=Ae.clientY-h.current.y;if(S.current==="none"){if(Math.abs(Ke)<10&&Math.abs(Oe)<10)return;if(Math.abs(Ke)>Math.abs(Oe)){if(t.length<=1)return;S.current="horizontal"}else if(Oe>0)S.current="vertical";else return}if(S.current==="horizontal"){y.current=!0,ce(!0),x.current=Ke;const Qe=Ke<0?1:-1;Y.current!==Qe&&(Y.current=Qe,de(Qe)),N.current=Ke,K(Ke),Pe.preventDefault();return}S.current==="vertical"&&(y.current=!0,ce(!0),f.current=Oe,I(Oe),Pe.preventDefault())},Re=()=>{if(!h.current)return;const Pe=S.current,Ae=y.current;if(Ae&&Pe==="horizontal")Te(x.current),se();else if(Ae&&Pe==="vertical")if(f.current>wf){const Oe=window.innerHeight;f.current=Oe,be(!0),I(Oe),z("closing")}else f.current=0,I(0),se();else Pe==="horizontal"&&Math.abs(x.current)>0&&(Te(x.current),se());h.current=null,S.current="none",x.current=0,y.current=!1,ce(!1)};return document.addEventListener("touchstart",Xe,{passive:!0}),document.addEventListener("touchmove",ze,{passive:!1}),document.addEventListener("touchend",Re),document.addEventListener("touchcancel",Re),()=>{document.removeEventListener("touchstart",Xe),document.removeEventListener("touchmove",ze),document.removeEventListener("touchend",Re),document.removeEventListener("touchcancel",Re),Ve()}},[E,t.length,B]),s.useEffect(()=>{const Le=Ve=>{Ve.key==="Escape"&&(Ve.preventDefault(),Ve.stopPropagation(),E!=="closing"&&z("closing"))};return window.addEventListener("keydown",Le,!0),()=>window.removeEventListener("keydown",Le,!0)},[E]);const ye=()=>{E!=="closing"&&z("closing")},F=E==="open",ve=E==="closing",pe=ne>0?Math.max(0,1-ne/500):1,Z=ne>0?Math.max(.35,1-ne/500):1,me=k?p?k:Ef(k,He):null,De=Le=>{if(Le.stopPropagation(),w.current){w.current=!1;return}if(t.length<=1)return;const Ve=me??Le.currentTarget.getBoundingClientRect(),se=Le.clientY-Ve.top,Te=Math.min(52,Ve.height*.2);if(!(se>Ve.height-Te)){if(Le.clientX-Ve.left<Ve.width/2){J(-1);return}J(1)}},ge=Le=>{if(t.length<=1)return;const Ve=me??Le.currentTarget.getBoundingClientRect(),se=Le.clientX-Ve.left,Te=Le.clientY-Ve.top,Xe=Math.min(52,Ve.height*.2);if(Te>Ve.height-Xe){Le.currentTarget.style.cursor="default";return}Le.currentTarget.style.cursor=se<Ve.width/2?"w-resize":"e-resize"},G={position:"fixed",top:m==null?void 0:m.top,left:m==null?void 0:m.left,width:m==null?void 0:m.width,height:m==null?void 0:m.height,zIndex:9998},Me=p?"cover":"contain",_e=W!==0||ne>0?`translate(${W}px, ${ne}px)`:void 0,rt=q&&!A?"none":A?`transform ${wn}ms ${Gn}`:Q?`transform ${wn}ms ${Gn}, opacity ${wn}ms ${Gn}`:E==="opening"||ve?`opacity ${wn}ms ${Gn}`:"none",Je={...G,transform:_e,opacity:ne>0?Z:E==="opening"||ve?0:1,transition:rt,pointerEvents:"none"},at={position:"absolute",top:((me==null?void 0:me.top)??0)-((m==null?void 0:m.top)??0),left:((me==null?void 0:me.left)??0)-((m==null?void 0:m.left)??0),width:me==null?void 0:me.width,height:me==null?void 0:me.height,objectFit:Me,pointerEvents:oe&&F&&!Fe?"auto":"none",touchAction:oe&&F?"none":void 0},it=(m==null?void 0:m.width)??0,je=Ce?(n+ae+t.length)%t.length:null,Se=je!==null?t[je]:null,We={...G,transform:Ce?`translateX(${ae*it+W}px)`:void 0,opacity:1,transition:A?`transform ${wn}ms ${Gn}`:"none",pointerEvents:"none"},Be={position:"absolute",top:((k==null?void 0:k.top)??0)-((m==null?void 0:m.top)??0),left:((k==null?void 0:k.left)??0)-((m==null?void 0:m.left)??0),width:k==null?void 0:k.width,height:k==null?void 0:k.height,objectFit:Me,pointerEvents:"none"},Ze=me?{position:"fixed",top:me.top,height:me.height,width:me.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:b,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:E==="open"?"none":void 0},onClick:ye,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:F?pe:0,transition:q?"none":`opacity ${wn}ms ${Gn}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:p?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:v,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:F?1:0,transition:`opacity ${wn}ms ${Gn}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:c,style:u,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:v,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:F?1:0,transition:`opacity ${wn}ms ${Gn}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),k&&m&&Se&&a.jsx("div",{style:We,onTransitionEnd:te,children:Ci(Se)?a.jsx("video",{src:Se.url,muted:!0,playsInline:!0,preload:"auto",style:Be},`neighbor-${je}-${Se.url}`):a.jsx("img",{src:Se.url,alt:Se.name,style:Be},`neighbor-${je}-${Se.url}`)}),k&&m&&ue&&a.jsx("div",{style:Je,onTransitionEnd:te,children:oe?a.jsx(Mf,{src:ue.url,phase:E,mediaRef:g,mediaStyle:at,onLoadedMetadata:P,onClick:De,onMouseMove:ge},`${n}-${ue.url}`):a.jsx("img",{ref:g,src:ue.url,alt:ue.name,onLoad:P,style:at},`${n}-${ue.url}`)}),F&&Ze&&t.length>1&&!oe&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ze,left:me.left,cursor:"w-resize",pointerEvents:q?"none":"auto"},onClick:Le=>{if(w.current){w.current=!1;return}Le.stopPropagation(),J(-1)}}),a.jsx("div",{style:{...Ze,left:me.left+me.width/2,cursor:"e-resize",pointerEvents:q?"none":"auto"},onClick:Le=>{if(w.current){w.current=!1;return}Le.stopPropagation(),J(1)}})]})]})}function kf(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Af({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=D.useScopedStyles(),{type:p="a",gridLayout:b,textBoxWidth:v=100,verticalGap:g,entriesCount:h,lightbox:f,imageDisplay:x,imageCorners:S,lightboxImageDisplay:y,slider:w,sliderTiming:H,direction:N,transition:Y,titleMarginTop:O,subtitleMarginTop:C,titleColor:V,subtitleColor:$,lightboxCounterColor:R,titleFontFamily:k,titleFontSettings:T,titleFontSize:m,titleLineHeight:M,titleLetterSpacing:E,titleWordSpacing:z,titleTextAppearance:ne,subtitleFontFamily:I,subtitleFontSettings:W,subtitleFontSize:K,subtitleLineHeight:ae,subtitleLetterSpacing:de,subtitleWordSpacing:A,subtitleTextAppearance:he,lightboxCounterFontFamily:q,lightboxCounterFontSettings:ce,lightboxCounterFontSize:Q,lightboxCounterLineHeight:be,lightboxCounterLetterSpacing:He,lightboxCounterWordSpacing:xe,lightboxCounterTextAppearance:le,showText:ee="always",alignEntries:ue="off",align:oe="top"}=e,Fe={fontSettings:{fontFamily:k,fontWeight:(T==null?void 0:T.fontWeight)??400,fontStyle:(T==null?void 0:T.fontStyle)??"normal"},fontSize:m??.01,lineHeight:M,letterSpacing:E??0,wordSpacing:z??0,textAppearance:ne,color:V},P={...sn(Yt(Fe,n))},U={fontSettings:{fontFamily:I,fontWeight:(W==null?void 0:W.fontWeight)??400,fontStyle:(W==null?void 0:W.fontStyle)??"normal"},fontSize:K??.01,lineHeight:ae,letterSpacing:de??0,wordSpacing:A??0,textAppearance:he,color:$},ie={...sn(Yt(U,n))},j={fontSettings:{fontFamily:q,fontWeight:(ce==null?void 0:ce.fontWeight)??400,fontStyle:(ce==null?void 0:ce.fontStyle)??"normal"},fontSize:Q??.01,lineHeight:be,letterSpacing:He??0,wordSpacing:xe??0,textAppearance:le,color:R},J={...sn(Yt(j,n)),...Ca(Q,be,u,n)},te=$a(m,M,`${u}-item-title`,`${u}-text-tight-leading`),$e=$a(K,ae,`${u}-item-subtitle`,`${u}-text-tight-leading`),ye=Ca(m,M,u,n),F=Ca(K,ae,u,n),ve=$a(Q,be,`${u}-lightbox-counter`,`${u}-text-tight-leading`),pe=D.buildColorVars(u,{titleColor:V,subtitleColor:$,lightboxCounterColor:R},Ff,_f),De=`${l&&l!=="default"?`${u}-state-${l}`:""}${ee==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),ge=h===0?1/0:h,G=(t??[]).slice(0,ge),Me=s.useMemo(()=>f==="on"?Lf(G):[],[G,f]),_e=b.entryWidth??.2,rt=(x==null?void 0:x.display)==="cover",Je=(x==null?void 0:x.ratioValue)??"1:1",at=(x==null?void 0:x.reversed)??!1,[it,je]=Je.split(":").map(Number),Be=`${at?je:it} / ${at?it:je}`,Ze=b.columnsCount,Le=D.scalingValue(_e??0,n),Ve=Le,se=!rt&&w!=="off",Te=G.length%Ze||Ze,Xe=Te<Ze&&G.length>0,ze=G.length-Te,Re=Xe?Math.floor((Ze-Te)/2)+1:1,Pe=S?D.scalingValue(S,n):void 0,Ae={width:Ve,...rt?{aspectRatio:Be,height:"auto",overflow:"hidden"}:{height:"auto"},...Pe?{borderRadius:Pe,overflow:"hidden"}:{}},Ke=`${u}-item-image-wrapper${se?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),Oe=p==="d"||p==="e"||p==="f",Qe=ue==="on",tt=`calc(${D.scalingValue(_e??0,n)} * (${v} / 100))`,nt=D.scalingValue(_e*v/100,n),xt=rt?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...Pe?{borderRadius:Pe}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...Pe?{borderRadius:Pe}:{}},[It,Tt]=s.useState(0),ut=s.useRef(null),ft=Y==="fade"||N==="horizontal"?"ltr":N==="vertical"?"ttb":"ltr";s.useEffect(()=>{const pt=ut.current;if(!pt)return;const Ee=new ResizeObserver(qe=>{Tt(Math.round(qe[0].contentRect.width))});return Ee.observe(pt),()=>Ee.disconnect()},[]);const Et=(()=>{const pt={...pe},Ee=ut.current?getComputedStyle(ut.current).getPropertyValue("--cntrl-article-width").trim():"";return Ee&&(pt["--cntrl-article-width"]=Ee),pt})(),[Lt,bt]=s.useState(!1),[Nt,Bt]=s.useState([]),[Zt,en]=s.useState(0),Rt=f==="on"&&(!n||i),Ot=(pt,Ee)=>{n&&!i||f!=="off"&&(Bt(pt),en(Ee),bt(!0))};s.useEffect(()=>{if(!Lt||f!=="on"||typeof document>"u")return;const pt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=pt}},[Lt,f]),s.useEffect(()=>{!n||i||bt(!1)},[n,i]);const nn=s.useMemo(()=>ff(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:nn}}),f==="on"&&a.jsx(Rf,{mediaList:Me}),a.jsx("div",{style:pe,children:a.jsx("div",{ref:ut,className:`${u}-wrapper ${u}-type-${p}${Qe?` ${u}-align-entries`:""} ${u}-image-align-${oe} ${De}`.trim(),style:{gridTemplateColumns:`repeat(${Ze}, ${Le})`,rowGap:Qe?0:D.scalingValue(g??0,n),columnGap:D.scalingValue(b.horizontalGap??0,n),width:D.scalingValue(b.wrapperWidth??0,n),...Qe?{[`--${u}-align-entries-row-gap`]:D.scalingValue(g??0,n)}:{}},children:G.map((pt,Ee)=>{var Ht;const qe=Al(pt.title),st=Al(pt.subtitle),mt=(((Ht=pt.link)==null?void 0:Ht.length)??0)>0&&f==="off"?pt.link:void 0,vt=Math.floor(Ee/Ze)===Math.ceil(G.length/Ze)-1,Mt=Xe&&Ee>=ze?`${Re+(Ee-ze)}`:void 0,gt=Oe?a.jsxs("div",{className:`${u}-item-text-block`,children:[qe&&a.jsx("p",{className:te,style:{width:tt,...P,...ye},children:pt.title}),qe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(O??0,n),width:nt}}),st&&a.jsx("p",{className:$e,style:{width:tt,...ie,...F},children:pt.subtitle}),st&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(C??0,n),width:nt}})]}):null,Vt=Qe?a.jsxs("div",{className:`${u}-item-title-row`,children:[!Oe&&a.jsx("div",{"data-controls":o&&qe?"titleMarginTop":void 0,className:o&&qe?`${u}-control`:void 0,style:{height:qe?D.scalingValue(O??0,n):0,width:nt}}),qe&&a.jsx("p",{className:te,style:{width:tt,...P,...ye},children:pt.title}),Oe&&qe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(O??0,n),width:nt}})]}):null,Wt=Qe?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!Oe&&a.jsx("div",{"data-controls":o&&st?"subtitleMarginTop":void 0,className:o&&st?`${u}-control`:void 0,style:{height:st?D.scalingValue(C??0,n):0,width:nt}}),st&&a.jsx("p",{className:$e,style:{width:tt,...ie,...F},children:pt.subtitle}),Oe&&st&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(C??0,n),width:nt}})]}):null,_t=mt?a.jsxs("a",{href:mt,target:"_blank",className:`${u}-item-text-link`,children:[Vt,Wt]}):a.jsxs(a.Fragment,{children:[Vt,Wt]}),qt=jd(pt.gallery),Xt=qt.filter($t=>$t.lightboxMedia).map($t=>$t.lightboxMedia),Dt=a.jsx("div",{className:Ke,style:Ae,children:qt.length===0?null:w==="off"?(()=>{const{displayMedia:$t,lightboxMedia:_}=qt[0],Ie=_?Xt.findIndex(Ne=>Ne.url===_.url):-1;return a.jsx(Fl,{media:$t,className:`${u}-item-${Ci($t)?"video":"image"}`.trim(),style:xt,onMediaClick:Rt&&Ie>=0?()=>Ot(Xt,Ie):void 0})})():a.jsxs(a.Fragment,{children:[se&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:qt.map(({displayMedia:$t})=>Ci($t)?a.jsx("video",{src:$t.url,muted:!0,playsInline:!0},`sizer-${$t.url}`):a.jsx("img",{src:$t.url,alt:""},`sizer-${$t.url}`))}),a.jsx(Vs,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:H*1e3,width:"100%",height:"100%",speed:bf,type:Y==="fade"?"fade":"loop",rewind:Y==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:ft},onMoved:$t=>{N!=="random"||Y==="fade"||xf($t)},children:qt.map(({displayMedia:$t,lightboxMedia:_},Ie)=>{const Ne=_?Xt.findIndex(Ge=>Ge.url===_.url):-1;return a.jsx(Gs,{children:a.jsx(Fl,{media:$t,className:`${u}-item-${Ci($t)?"video":"image"}`.trim(),style:xt,onMediaClick:Rt&&Ne>=0?()=>Ot(Xt,Ne):void 0})},Ie)})},`${Y}-${_e}-${N}-${H}-${It}-${d}`)]})}),jt=Oe?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&qe?"titleMarginTop":void 0,className:o&&qe?`${u}-control`:void 0,style:{height:qe?D.scalingValue(O??0,n):0,width:nt}}),a.jsx("p",{className:te,style:{width:tt,...P,...ye},children:pt.title}),a.jsx("div",{"data-controls":o&&st?"subtitleMarginTop":void 0,className:o&&st?`${u}-control`:void 0,style:{height:st?D.scalingValue(C??0,n):0,width:nt}}),a.jsx("p",{className:$e,style:{width:tt,...ie,...F},children:pt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:Mt&&!Qe?{gridColumn:Mt}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${Qe&&vt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(v??0)>100?`calc(${Le} * (${v} / 100))`:Le,...Mt&&Qe?{gridColumn:Mt}:{}},children:Qe?a.jsx(a.Fragment,{children:Oe?a.jsxs(a.Fragment,{children:[_t,a.jsx("a",{href:mt,target:"_blank",className:`${u}-item-image-link`,children:Dt})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:mt,target:"_blank",className:`${u}-item-image-link`,children:Dt}),_t]})}):mt?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:mt,target:"_blank",className:`${u}-item-image-link`,children:[gt,Dt]}),!Oe&&a.jsx("a",{href:mt,target:"_blank",className:`${u}-item-text-link`,children:jt})]}):a.jsxs(a.Fragment,{children:[gt,Dt,jt]})})},Ee)})})}),(!n||i)&&Lt&&typeof document<"u"&&f==="on"&&(()=>{const pt=(c?document.getElementById(c):null)??document.body;return Vn.createPortal(a.jsx("div",{style:Et,"data-selection":"none",children:a.jsx(Pf,{prefix:u,items:Nt,index:Zt,imageDisplay:kf(y),isEditor:n,onClose:()=>bt(!1),onPrev:()=>en(Ee=>(Ee-1+Nt.length)%Nt.length),onNext:()=>en(Ee=>(Ee+1)%Nt.length),counterClassName:ve,counterStyle:J})}),pt)})()]})}const Ff={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},_f=["hover","focus","filled","success","error"],Wf=`import { Splide, SplideSlide } from '@splidejs/react-splide';
5225
+ `}function yf(){return Math.random()<.5?"ltr":"ttb"}function vf(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function xf(e){const t=yf();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{vf(e)})})}const wn=500,bf=750,Gn="cubic-bezier(0.22, 1, 0.36, 1)",wf=72,Sf=50;function $f(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 Cf(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Tf(e){const[t]=e.media;return t!=null&&t.url?t:null}function jd(e){return!Array.isArray(e)||e.length===0?[]:$f(e)?e.flatMap(t=>{const n=Cf(t);if(!n)return[];const i=Tf(t);return[{displayMedia:n,lightboxMedia:i!=null&&i.url?i:null}]}):e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function Ci(e){return e.type==="video"}function Lf(e){const t=new Set,n=[];for(const i of e){const o=jd(i.gallery);for(const r of o){const l=r.lightboxMedia;l!=null&&l.url&&!t.has(l.url)&&(t.add(l.url),n.push(l))}}return n}function Rf({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=>Ci(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function If(e){e.pause(),e.removeAttribute("src"),e.load()}function Fl({media:e,className:t,style:n,onMediaClick:i}){return Ci(e)?a.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):a.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function _l(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Ef(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 Mf({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{If(d)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,style:i})}function Pf({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",b=s.useRef(null),v=s.useRef(null),g=s.useRef(null),h=s.useRef(null),f=s.useRef(0),x=s.useRef(0),S=s.useRef("none"),y=s.useRef(!1),w=s.useRef(!1),H=s.useRef(null),N=s.useRef(0),U=s.useRef(null),O=s.useRef(!1),C=s.useRef(null),V=s.useRef(null),$=s.useRef(null),R=s.useRef(()=>{}),[k,T]=s.useState(null),[m,M]=s.useState(null),[E,z]=s.useState("opening"),[ne,I]=s.useState(0),[W,K]=s.useState(0),[ae,de]=s.useState(null),[A,he]=s.useState(!1),[q,ce]=s.useState(!1),[Q,be]=s.useState(!1),[He,xe]=s.useState(null),le=s.useRef(n),ee=s.useRef(void 0),ue=t[n],oe=ue?Ci(ue):!1,Fe=W!==0||A,Ce=ae!==null,P=s.useCallback(Le=>{const Ve=Le.currentTarget,se=Ve instanceof HTMLVideoElement?{width:Ve.videoWidth,height:Ve.videoHeight}:{width:Ve.naturalWidth,height:Ve.naturalHeight};!se.width||!se.height||xe(se)},[]);s.useEffect(()=>{H.current=m},[m]),s.useEffect(()=>{const Le=b.current;if(!Le)return;const Ve=()=>M(_l(Le));Ve();const se=new ResizeObserver(Ve);return se.observe(Le),()=>se.disconnect()},[]);const Y=s.useCallback(()=>{C.current!==null&&(window.clearTimeout(C.current),C.current=null)},[]),X=s.useCallback(()=>{const Le=V.current;V.current=null,Y(),U.current=null,O.current=!1,de(null),he(!1),K(0),N.current=0,ce(!1),y.current=!1,x.current=0,S.current="none",Le===1?d():Le===-1&&l()},[Y,d,l]),ie=s.useCallback(()=>{Y(),V.current=null,U.current=null,O.current=!1,de(null),he(!1),K(0),N.current=0},[Y]),j=s.useCallback(()=>{Y(),C.current=window.setTimeout(()=>{V.current!==null&&X()},wn+32)},[Y,X]),B=s.useCallback((Le,Ve)=>{var Te;const se=((Te=H.current)==null?void 0:Te.width)??0;if(Y(),U.current=Le,de(Le),O.current=!0,he(!0),Ve){V.current=Le;const Xe=-Le*se;N.current=Xe,K(Xe),j();return}N.current=0,K(0),C.current=window.setTimeout(()=>{C.current=null,ie()},wn+32)},[Y,ie,j]),J=s.useCallback(Le=>{if(!(t.length<=1)){if(O.current){if(V.current===Le){$.current=Le,X();return}ie()}Y(),U.current=Le,de(Le),O.current=!1,he(!1),N.current=0,K(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{B(Le,!0)})})}},[t.length,B,X,ie,Y]);R.current=J;const te=s.useCallback(Le=>{Le.propertyName!=="transform"||!O.current||V.current!==null&&X()},[X]),$e=s.useCallback(()=>{const Le=v.current;if(!Le)return;const Ve=_l(Le);!Ve.width||!Ve.height||T(Ve)},[]);s.useEffect(()=>{$e();const Le=v.current;if(!Le)return;const Ve=new ResizeObserver(()=>$e());return Ve.observe(Le),()=>Ve.disconnect()},[$e]),s.useEffect(()=>{E==="opening"&&k&&z("open")},[E,k]),s.useEffect(()=>{if(E!=="closing")return;const Le=setTimeout(()=>r(),wn);return()=>clearTimeout(Le)},[E,r]),s.useEffect(()=>()=>{Y()},[Y]),s.useLayoutEffect(()=>{le.current===n&&ee.current===(ue==null?void 0:ue.url)||(Y(),V.current=null,de(null),I(0),K(0),he(!1),be(!1),ce(!1),xe(null),f.current=0,x.current=0,S.current="none",y.current=!1,O.current=!1,N.current=0,U.current=null,h.current=null,w.current=!1,le.current=n,ee.current=ue==null?void 0:ue.url)},[n,ue==null?void 0:ue.url,Y]),s.useLayoutEffect(()=>{const Le=$.current;Le!==null&&($.current=null,requestAnimationFrame(()=>{R.current(Le)}))},[n,ue==null?void 0:ue.url]),s.useEffect(()=>{if(E!=="open")return;let Le=null;const Ve=()=>{Le&&(document.removeEventListener("click",Le,!0),Le=null)},se=()=>{Ve(),Le=Pe=>{Pe.stopPropagation(),Pe.preventDefault(),Ve()},document.addEventListener("click",Le,!0)},Te=Pe=>{const Ae=Pe<0?1:-1;if(Math.abs(Pe)>Sf&&t.length>1){B(Ae,!0);return}B(Ae,!1)},Xe=Pe=>{if(Pe.touches.length!==1||O.current)return;const Ae=Pe.touches[0];w.current=!0,h.current={x:Ae.clientX,y:Ae.clientY},S.current="none",x.current=0,y.current=!1},ze=Pe=>{if(!h.current||Pe.touches.length!==1||O.current)return;const Ae=Pe.touches[0],Ke=Ae.clientX-h.current.x,Oe=Ae.clientY-h.current.y;if(S.current==="none"){if(Math.abs(Ke)<10&&Math.abs(Oe)<10)return;if(Math.abs(Ke)>Math.abs(Oe)){if(t.length<=1)return;S.current="horizontal"}else if(Oe>0)S.current="vertical";else return}if(S.current==="horizontal"){y.current=!0,ce(!0),x.current=Ke;const Qe=Ke<0?1:-1;U.current!==Qe&&(U.current=Qe,de(Qe)),N.current=Ke,K(Ke),Pe.preventDefault();return}S.current==="vertical"&&(y.current=!0,ce(!0),f.current=Oe,I(Oe),Pe.preventDefault())},Re=()=>{if(!h.current)return;const Pe=S.current,Ae=y.current;if(Ae&&Pe==="horizontal")Te(x.current),se();else if(Ae&&Pe==="vertical")if(f.current>wf){const Oe=window.innerHeight;f.current=Oe,be(!0),I(Oe),z("closing")}else f.current=0,I(0),se();else Pe==="horizontal"&&Math.abs(x.current)>0&&(Te(x.current),se());h.current=null,S.current="none",x.current=0,y.current=!1,ce(!1)};return document.addEventListener("touchstart",Xe,{passive:!0}),document.addEventListener("touchmove",ze,{passive:!1}),document.addEventListener("touchend",Re),document.addEventListener("touchcancel",Re),()=>{document.removeEventListener("touchstart",Xe),document.removeEventListener("touchmove",ze),document.removeEventListener("touchend",Re),document.removeEventListener("touchcancel",Re),Ve()}},[E,t.length,B]),s.useEffect(()=>{const Le=Ve=>{Ve.key==="Escape"&&(Ve.preventDefault(),Ve.stopPropagation(),E!=="closing"&&z("closing"))};return window.addEventListener("keydown",Le,!0),()=>window.removeEventListener("keydown",Le,!0)},[E]);const ye=()=>{E!=="closing"&&z("closing")},F=E==="open",ve=E==="closing",pe=ne>0?Math.max(0,1-ne/500):1,Z=ne>0?Math.max(.35,1-ne/500):1,me=k?p?k:Ef(k,He):null,De=Le=>{if(Le.stopPropagation(),w.current){w.current=!1;return}if(t.length<=1)return;const Ve=me??Le.currentTarget.getBoundingClientRect(),se=Le.clientY-Ve.top,Te=Math.min(52,Ve.height*.2);if(!(se>Ve.height-Te)){if(Le.clientX-Ve.left<Ve.width/2){J(-1);return}J(1)}},ge=Le=>{if(t.length<=1)return;const Ve=me??Le.currentTarget.getBoundingClientRect(),se=Le.clientX-Ve.left,Te=Le.clientY-Ve.top,Xe=Math.min(52,Ve.height*.2);if(Te>Ve.height-Xe){Le.currentTarget.style.cursor="default";return}Le.currentTarget.style.cursor=se<Ve.width/2?"w-resize":"e-resize"},G={position:"fixed",top:m==null?void 0:m.top,left:m==null?void 0:m.left,width:m==null?void 0:m.width,height:m==null?void 0:m.height,zIndex:9998},Me=p?"cover":"contain",_e=W!==0||ne>0?`translate(${W}px, ${ne}px)`:void 0,rt=q&&!A?"none":A?`transform ${wn}ms ${Gn}`:Q?`transform ${wn}ms ${Gn}, opacity ${wn}ms ${Gn}`:E==="opening"||ve?`opacity ${wn}ms ${Gn}`:"none",Je={...G,transform:_e,opacity:ne>0?Z:E==="opening"||ve?0:1,transition:rt,pointerEvents:"none"},at={position:"absolute",top:((me==null?void 0:me.top)??0)-((m==null?void 0:m.top)??0),left:((me==null?void 0:me.left)??0)-((m==null?void 0:m.left)??0),width:me==null?void 0:me.width,height:me==null?void 0:me.height,objectFit:Me,pointerEvents:oe&&F&&!Fe?"auto":"none",touchAction:oe&&F?"none":void 0},it=(m==null?void 0:m.width)??0,je=Ce?(n+ae+t.length)%t.length:null,Se=je!==null?t[je]:null,We={...G,transform:Ce?`translateX(${ae*it+W}px)`:void 0,opacity:1,transition:A?`transform ${wn}ms ${Gn}`:"none",pointerEvents:"none"},Be={position:"absolute",top:((k==null?void 0:k.top)??0)-((m==null?void 0:m.top)??0),left:((k==null?void 0:k.left)??0)-((m==null?void 0:m.left)??0),width:k==null?void 0:k.width,height:k==null?void 0:k.height,objectFit:Me,pointerEvents:"none"},Ze=me?{position:"fixed",top:me.top,height:me.height,width:me.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:b,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:E==="open"?"none":void 0},onClick:ye,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:F?pe:0,transition:q?"none":`opacity ${wn}ms ${Gn}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:p?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:v,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:F?1:0,transition:`opacity ${wn}ms ${Gn}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:c,style:u,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:v,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:F?1:0,transition:`opacity ${wn}ms ${Gn}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),k&&m&&Se&&a.jsx("div",{style:We,onTransitionEnd:te,children:Ci(Se)?a.jsx("video",{src:Se.url,muted:!0,playsInline:!0,preload:"auto",style:Be},`neighbor-${je}-${Se.url}`):a.jsx("img",{src:Se.url,alt:Se.name,style:Be},`neighbor-${je}-${Se.url}`)}),k&&m&&ue&&a.jsx("div",{style:Je,onTransitionEnd:te,children:oe?a.jsx(Mf,{src:ue.url,phase:E,mediaRef:g,mediaStyle:at,onLoadedMetadata:P,onClick:De,onMouseMove:ge},`${n}-${ue.url}`):a.jsx("img",{ref:g,src:ue.url,alt:ue.name,onLoad:P,style:at},`${n}-${ue.url}`)}),F&&Ze&&t.length>1&&!oe&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ze,left:me.left,cursor:"w-resize",pointerEvents:q?"none":"auto"},onClick:Le=>{if(w.current){w.current=!1;return}Le.stopPropagation(),J(-1)}}),a.jsx("div",{style:{...Ze,left:me.left+me.width/2,cursor:"e-resize",pointerEvents:q?"none":"auto"},onClick:Le=>{if(w.current){w.current=!1;return}Le.stopPropagation(),J(1)}})]})]})}function kf(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Af({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=D.useScopedStyles(),{type:p="a",gridLayout:b,textBoxWidth:v=100,verticalGap:g,entriesCount:h,lightbox:f,imageDisplay:x,imageCorners:S,lightboxImageDisplay:y,slider:w,sliderTiming:H,direction:N,transition:U,titleMarginTop:O,subtitleMarginTop:C,titleColor:V,subtitleColor:$,lightboxCounterColor:R,titleFontFamily:k,titleFontSettings:T,titleFontSize:m,titleLineHeight:M,titleLetterSpacing:E,titleWordSpacing:z,titleTextAppearance:ne,subtitleFontFamily:I,subtitleFontSettings:W,subtitleFontSize:K,subtitleLineHeight:ae,subtitleLetterSpacing:de,subtitleWordSpacing:A,subtitleTextAppearance:he,lightboxCounterFontFamily:q,lightboxCounterFontSettings:ce,lightboxCounterFontSize:Q,lightboxCounterLineHeight:be,lightboxCounterLetterSpacing:He,lightboxCounterWordSpacing:xe,lightboxCounterTextAppearance:le,showText:ee="always",alignEntries:ue="off",align:oe="top"}=e,Fe={fontSettings:{fontFamily:k,fontWeight:(T==null?void 0:T.fontWeight)??400,fontStyle:(T==null?void 0:T.fontStyle)??"normal"},fontSize:m??.01,lineHeight:M,letterSpacing:E??0,wordSpacing:z??0,textAppearance:ne,color:V},P={...sn(Yt(Fe,n))},Y={fontSettings:{fontFamily:I,fontWeight:(W==null?void 0:W.fontWeight)??400,fontStyle:(W==null?void 0:W.fontStyle)??"normal"},fontSize:K??.01,lineHeight:ae,letterSpacing:de??0,wordSpacing:A??0,textAppearance:he,color:$},ie={...sn(Yt(Y,n))},j={fontSettings:{fontFamily:q,fontWeight:(ce==null?void 0:ce.fontWeight)??400,fontStyle:(ce==null?void 0:ce.fontStyle)??"normal"},fontSize:Q??.01,lineHeight:be,letterSpacing:He??0,wordSpacing:xe??0,textAppearance:le,color:R},J={...sn(Yt(j,n)),...Ca(Q,be,u,n)},te=$a(m,M,`${u}-item-title`,`${u}-text-tight-leading`),$e=$a(K,ae,`${u}-item-subtitle`,`${u}-text-tight-leading`),ye=Ca(m,M,u,n),F=Ca(K,ae,u,n),ve=$a(Q,be,`${u}-lightbox-counter`,`${u}-text-tight-leading`),pe=D.buildColorVars(u,{titleColor:V,subtitleColor:$,lightboxCounterColor:R},Ff,_f),De=`${l&&l!=="default"?`${u}-state-${l}`:""}${ee==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),ge=h===0?1/0:h,G=(t??[]).slice(0,ge),Me=s.useMemo(()=>f==="on"?Lf(G):[],[G,f]),_e=b.entryWidth??.2,rt=(x==null?void 0:x.display)==="cover",Je=(x==null?void 0:x.ratioValue)??"1:1",at=(x==null?void 0:x.reversed)??!1,[it,je]=Je.split(":").map(Number),Be=`${at?je:it} / ${at?it:je}`,Ze=b.columnsCount,Le=D.scalingValue(_e??0,n),Ve=Le,se=!rt&&w!=="off",Te=G.length%Ze||Ze,Xe=Te<Ze&&G.length>0,ze=G.length-Te,Re=Xe?Math.floor((Ze-Te)/2)+1:1,Pe=S?D.scalingValue(S,n):void 0,Ae={width:Ve,...rt?{aspectRatio:Be,height:"auto",overflow:"hidden"}:{height:"auto"},...Pe?{borderRadius:Pe,overflow:"hidden"}:{}},Ke=`${u}-item-image-wrapper${se?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),Oe=p==="d"||p==="e"||p==="f",Qe=ue==="on",tt=`calc(${D.scalingValue(_e??0,n)} * (${v} / 100))`,nt=D.scalingValue(_e*v/100,n),xt=rt?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...Pe?{borderRadius:Pe}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...Pe?{borderRadius:Pe}:{}},[It,Tt]=s.useState(0),ut=s.useRef(null),ft=U==="fade"||N==="horizontal"?"ltr":N==="vertical"?"ttb":"ltr";s.useEffect(()=>{const pt=ut.current;if(!pt)return;const Ee=new ResizeObserver(qe=>{Tt(Math.round(qe[0].contentRect.width))});return Ee.observe(pt),()=>Ee.disconnect()},[]);const Et=(()=>{const pt={...pe},Ee=ut.current?getComputedStyle(ut.current).getPropertyValue("--cntrl-article-width").trim():"";return Ee&&(pt["--cntrl-article-width"]=Ee),pt})(),[Lt,bt]=s.useState(!1),[Nt,Bt]=s.useState([]),[Zt,en]=s.useState(0),Rt=f==="on"&&(!n||i),Ot=(pt,Ee)=>{n&&!i||f!=="off"&&(Bt(pt),en(Ee),bt(!0))};s.useEffect(()=>{if(!Lt||f!=="on"||typeof document>"u")return;const pt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=pt}},[Lt,f]),s.useEffect(()=>{!n||i||bt(!1)},[n,i]);const nn=s.useMemo(()=>ff(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:nn}}),f==="on"&&a.jsx(Rf,{mediaList:Me}),a.jsx("div",{style:pe,children:a.jsx("div",{ref:ut,className:`${u}-wrapper ${u}-type-${p}${Qe?` ${u}-align-entries`:""} ${u}-image-align-${oe} ${De}`.trim(),style:{gridTemplateColumns:`repeat(${Ze}, ${Le})`,rowGap:Qe?0:D.scalingValue(g??0,n),columnGap:D.scalingValue(b.horizontalGap??0,n),width:D.scalingValue(b.wrapperWidth??0,n),...Qe?{[`--${u}-align-entries-row-gap`]:D.scalingValue(g??0,n)}:{}},children:G.map((pt,Ee)=>{var Ht;const qe=Al(pt.title),st=Al(pt.subtitle),mt=(((Ht=pt.link)==null?void 0:Ht.length)??0)>0&&f==="off"?pt.link:void 0,vt=Math.floor(Ee/Ze)===Math.ceil(G.length/Ze)-1,Mt=Xe&&Ee>=ze?`${Re+(Ee-ze)}`:void 0,gt=Oe?a.jsxs("div",{className:`${u}-item-text-block`,children:[qe&&a.jsx("p",{className:te,style:{width:tt,...P,...ye},children:pt.title}),qe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(O??0,n),width:nt}}),st&&a.jsx("p",{className:$e,style:{width:tt,...ie,...F},children:pt.subtitle}),st&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(C??0,n),width:nt}})]}):null,Vt=Qe?a.jsxs("div",{className:`${u}-item-title-row`,children:[!Oe&&a.jsx("div",{"data-controls":o&&qe?"titleMarginTop":void 0,className:o&&qe?`${u}-control`:void 0,style:{height:qe?D.scalingValue(O??0,n):0,width:nt}}),qe&&a.jsx("p",{className:te,style:{width:tt,...P,...ye},children:pt.title}),Oe&&qe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(O??0,n),width:nt}})]}):null,Wt=Qe?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!Oe&&a.jsx("div",{"data-controls":o&&st?"subtitleMarginTop":void 0,className:o&&st?`${u}-control`:void 0,style:{height:st?D.scalingValue(C??0,n):0,width:nt}}),st&&a.jsx("p",{className:$e,style:{width:tt,...ie,...F},children:pt.subtitle}),Oe&&st&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(C??0,n),width:nt}})]}):null,_t=mt?a.jsxs("a",{href:mt,target:"_blank",className:`${u}-item-text-link`,children:[Vt,Wt]}):a.jsxs(a.Fragment,{children:[Vt,Wt]}),qt=jd(pt.gallery),Xt=qt.filter($t=>$t.lightboxMedia).map($t=>$t.lightboxMedia),Dt=a.jsx("div",{className:Ke,style:Ae,children:qt.length===0?null:w==="off"?(()=>{const{displayMedia:$t,lightboxMedia:_}=qt[0],Ie=_?Xt.findIndex(Ne=>Ne.url===_.url):-1;return a.jsx(Fl,{media:$t,className:`${u}-item-${Ci($t)?"video":"image"}`.trim(),style:xt,onMediaClick:Rt&&Ie>=0?()=>Ot(Xt,Ie):void 0})})():a.jsxs(a.Fragment,{children:[se&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:qt.map(({displayMedia:$t})=>Ci($t)?a.jsx("video",{src:$t.url,muted:!0,playsInline:!0},`sizer-${$t.url}`):a.jsx("img",{src:$t.url,alt:""},`sizer-${$t.url}`))}),a.jsx(Vs,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:H*1e3,width:"100%",height:"100%",speed:bf,type:U==="fade"?"fade":"loop",rewind:U==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:ft},onMoved:$t=>{N!=="random"||U==="fade"||xf($t)},children:qt.map(({displayMedia:$t,lightboxMedia:_},Ie)=>{const Ne=_?Xt.findIndex(Ge=>Ge.url===_.url):-1;return a.jsx(Gs,{children:a.jsx(Fl,{media:$t,className:`${u}-item-${Ci($t)?"video":"image"}`.trim(),style:xt,onMediaClick:Rt&&Ne>=0?()=>Ot(Xt,Ne):void 0})},Ie)})},`${U}-${_e}-${N}-${H}-${It}-${d}`)]})}),jt=Oe?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&qe?"titleMarginTop":void 0,className:o&&qe?`${u}-control`:void 0,style:{height:qe?D.scalingValue(O??0,n):0,width:nt}}),a.jsx("p",{className:te,style:{width:tt,...P,...ye},children:pt.title}),a.jsx("div",{"data-controls":o&&st?"subtitleMarginTop":void 0,className:o&&st?`${u}-control`:void 0,style:{height:st?D.scalingValue(C??0,n):0,width:nt}}),a.jsx("p",{className:$e,style:{width:tt,...ie,...F},children:pt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:Mt&&!Qe?{gridColumn:Mt}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${Qe&&vt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(v??0)>100?`calc(${Le} * (${v} / 100))`:Le,...Mt&&Qe?{gridColumn:Mt}:{}},children:Qe?a.jsx(a.Fragment,{children:Oe?a.jsxs(a.Fragment,{children:[_t,a.jsx("a",{href:mt,target:"_blank",className:`${u}-item-image-link`,children:Dt})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:mt,target:"_blank",className:`${u}-item-image-link`,children:Dt}),_t]})}):mt?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:mt,target:"_blank",className:`${u}-item-image-link`,children:[gt,Dt]}),!Oe&&a.jsx("a",{href:mt,target:"_blank",className:`${u}-item-text-link`,children:jt})]}):a.jsxs(a.Fragment,{children:[gt,Dt,jt]})})},Ee)})})}),(!n||i)&&Lt&&typeof document<"u"&&f==="on"&&(()=>{const pt=(c?document.getElementById(c):null)??document.body;return Vn.createPortal(a.jsx("div",{style:Et,"data-selection":"none",children:a.jsx(Pf,{prefix:u,items:Nt,index:Zt,imageDisplay:kf(y),isEditor:n,onClose:()=>bt(!1),onPrev:()=>en(Ee=>(Ee-1+Nt.length)%Nt.length),onNext:()=>en(Ee=>(Ee+1)%Nt.length),counterClassName:ve,counterStyle:J})}),pt)})()]})}const Ff={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},_f=["hover","focus","filled","success","error"],Wf=`import { Splide, SplideSlide } from '@splidejs/react-splide';
5226
5226
  import '@splidejs/react-splide/css/core';
5227
5227
  import { CommonComponentProps } from '../props';
5228
5228
  import {
@@ -7275,7 +7275,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
7275
7275
  };
7276
7276
 
7277
7277
  const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
7278
- `,Ta={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Nf=["titleColor","subtitleColor","lightboxCounterColor"],Hf={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},subtitle:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},gallery:{type:"array",label:"Gallery",display:{type:"media-pair-list-input"},items:{type:"object",properties:{media:{type:"array",items:{type:"object",properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["gallery"]},default:[{title:"Earth-orbital mission",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Salton Sea from Above",subtitle:"Hasselblad 500 EL / Zeiss Sonnar 250 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module Pilot",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module 3 porch",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Command Module",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-10.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"CSM and Lunar Module LM",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"David R. Scott during EVA",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Fourth day of the mission",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-8.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Landing of the Spider1",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-9.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""}]},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c","d","e","f"]},gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:4},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gutter",min:0}}}},textBoxWidth:{type:"number",scope:"layout",title:"Text Width (%)",display:{type:"percentage-input"},min:0},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},showText:{type:"boolean",scope:"common",title:"Show text",display:{type:"toggle-cycle",enum:["always","on hover"]}},alignEntries:{type:"boolean",scope:"layout",title:"Align entries",display:{type:"toggle-cycle",enum:["on","off"]}},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageDisplay:{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"}}},imageCorners:{type:"number",scope:"layout",title:"Round corners",min:0,display:{type:"numeric-input"}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},slider:{type:"boolean",scope:"common",title:"Slider",display:{type:"toggle-cycle",enum:["on","off"]}},sliderTiming:{type:"number",scope:"common",title:"Timing (Sec)",display:{type:"common-numeric-input"},min:1,max:10},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical","random"],enabled:!0}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","slide"]}},titleMarginTop:{type:"number",scope:"layout",title:"Title margin top",min:0,max:100,display:{type:"range-control"}},subtitleMarginTop:{type:"number",scope:"layout",title:"Subtitle margin top",min:0,max:100,display:{type:"range-control"}},titleColor:{type:"string",scope:"common",title:"Title Entry",display:{type:"palette-color-picker"}},subtitleColor:{type:"string",scope:"common",title:"Subtitle Entry",display:{type:"palette-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Ta.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},subtitleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},subtitleFontSettings:{...Ta.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},subtitleFontSize:{type:"number",scope:"layout",title:"Subtitle Font Size",display:{type:"font-size"}},subtitleLineHeight:{type:"number",scope:"layout",title:"Subtitle Line Height",display:{type:"line-height-input"}},subtitleLetterSpacing:{type:"number",scope:"layout",title:"Subtitle Letter Spacing",display:{type:"letter-spacing-input"}},subtitleWordSpacing:{type:"number",scope:"layout",title:"Subtitle Word Spacing",display:{type:"word-spacing-input"}},subtitleTextAppearance:{type:"object",scope:"layout",title:"Subtitle Text Appearance",display:{type:"text-appearance"}},lightboxCounterFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},lightboxCounterFontSettings:{...Ta.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},lightboxCounterFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},lightboxCounterLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},lightboxCounterLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},lightboxCounterWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},lightboxCounterTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}}},defaults:{lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",slider:"on",sliderTiming:3,direction:"horizontal",transition:"fade",showText:"always",alignEntries:"off",align:"top",titleColor:"#000000",subtitleColor:"#000000",lightboxCounterColor:"#DEDDDD",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},subtitleFontFamily:"Goudy Bookletter 1911",subtitleFontSettings:{fontWeight:400,fontStyle:"normal"},subtitleLetterSpacing:0,subtitleWordSpacing:0,subtitleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{type:"b",gridLayout:{entryWidth:.8,horizontalGap:.0533,wrapperWidth:1,columnsCount:1,lockedParam:null},textBoxWidth:100,verticalGap:.266,entriesCount:0,titleMarginTop:.02,subtitleMarginTop:.02,titleStroke:.003,titleCorners:.192,imageCorners:0,subtitlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titleFontSize:.1066,titleLineHeight:.0853,subtitleFontSize:.056,subtitleLineHeight:.064,lightboxCounterFontSize:.0373,lightboxCounterLineHeight:.0373},t:{type:"b",gridLayout:{entryWidth:.1041,horizontalGap:.26041,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:250,verticalGap:.09722,entriesCount:0,titleMarginTop:.01953125,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,imageCorners:0,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.03255,titleLineHeight:.03255,titleLetterSpacing:-.00118,subtitleFontSize:.01822,subtitleLineHeight:.02083,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},d:{type:"b",gridLayout:{entryWidth:.0833,horizontalGap:.25,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:200,verticalGap:.09722,entriesCount:0,titleMarginTop:.008,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,imageCorners:0,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.027,titleLineHeight:.0222,titleLetterSpacing:-.00118,subtitleFontSize:.01,subtitleLineHeight:.01,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01}},displayRules:[{if:{name:"transition",value:"fade"},then:{name:"properties.direction.display.enabled",value:!1}},{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}},{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","showText","alignEntries","align","entriesCount","lightbox","imageDisplay","imageCorners","lightboxImageDisplay","slider","sliderTiming","direction","transition","transition","titleMarginTop","subtitleMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"Grid",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["textBoxWidth","verticalGap"]},{type:"row",title:"",items:["entriesCount","showText"]},{type:"row",title:"",items:["alignEntries","align"]}]},{id:"imageSettings",icon:"cover",title:"Image settings",tooltip:"Image settings",layout:["__componentName__",{type:"row",title:"Image",items:["imageDisplay","imageCorners"]},{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",title:"Slider",items:[{type:"group",title:"",items:["slider","direction"]},{type:"group",title:"",items:["sliderTiming","transition"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Subtitle",items:["subtitleFontFamily","subtitleFontSettings",{type:"row",items:["subtitleFontSize","subtitleLineHeight","subtitleLetterSpacing","subtitleWordSpacing"]},"subtitleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:[...Nf],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Of={element:Af,id:"grid",name:"Neptune",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Neptune_Grid.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"subtitleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",subtitleFontSettings:"subtitleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"},schema:Hf,sourceCode:Wf},Df=50,Wl=10,qs="cntrl-lightbox-journal",aa=qs,ss=`${qs}-`,sa=e=>`${qs}-${e}`,Xs=e=>e===aa||e.startsWith(ss),Nl=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Hl=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Nl(t.get(sa(e)));if(i)return i}const n=Nl(t.get(aa));if(n)return n;for(const[i]of t){if(!i.startsWith(ss))continue;const o=i.slice(ss.length);if(!/^\d+$/.test(o))continue;const r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}return null},Ol=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},zd=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{Xs(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(sa(t),String(e)):i.searchParams.set(aa,String(e));const o=n?"replaceState":"pushState",r=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",r)},jf=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===sa(e)||i===aa:Xs(i));if(n.forEach(i=>t.searchParams.delete(i)),n.length>0){const i=`${t.pathname}${t.search}${t.hash}`;window.history.replaceState(window.history.state,"",i)}},Bd=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(sa(e)):[...t.keys()].some(n=>Xs(n))},zf=(e,t)=>{if(Bd(t)){if(e){window.history.back();return}jf(t)}},Bf=20,Vf=2,La=e=>`max(${e}, ${Bf}px)`,Qi=e=>((e==null?void 0:e.image)??[]).slice(0,Vf),Vd=e=>e.reduce((t,n)=>t+Qi(n).length,0),Gf=(e,t)=>{const n=e.slice(0,t).reduce((o,r)=>o+Qi(r).length,1),i=Qi(e[t]).length;return{start:n,end:n+i-1}},qf=(e,t)=>{const n=Vd(e),{start:i,end:o}=Gf(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Ar=(e,t)=>t==="B"?e.flatMap((n,i)=>Qi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Qi(n)})),Xf=(e,t,n,i)=>{var r;if(n==="B")return`${t+1} / ${e.length}`;const o=((r=e[t])==null?void 0:r.entryIndex)??0;return qf(i,o)},Dl=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Uf=(e,t,n)=>e==="B"?t.length>1:Vd(n)>1,yn=.004,Zn=.004,Xi={title1Width:.13,title2Width:.13,title3Width:.14},Jn=(e,t,n,i,o)=>{const r=[];return t.title1&&r.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&r.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&r.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),r},eo=(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},d)=>{if(r<=0||d<=0)return{overflow:r,widths:[d,...l]};const c=Math.min(r,d);return{overflow:r-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},Oo=(e,t)=>eo(e,t),dn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Qn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:eo(e.length,n),effective:Oo(e.length,n)}},Gd=(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),qd=(e,t,n,i)=>e.slice(0,i+1).reduce((o,r,l)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[l]??0),0),ii=["title1","title2","title3","count"],ct=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Us={title1:"1",title2:"2",title3:"3",count:"Count"},Ys=e=>[ct(e,"fontFamily"),ct(e,"fontSettings"),{type:"row",items:[ct(e,"fontSize"),ct(e,"lineHeight"),ct(e,"letterSpacing"),ct(e,"wordSpacing")]},ct(e,"textAlign"),ct(e,"textAppearance")],Yf=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(ii.map(e=>[Us[e],Ys(e)]))}),Kf={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Zf={title1:.02,title2:.02,title3:.02,count:.017},bi=(e,t)=>{const n=i=>{const o=ct(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[Kf[t]]}},wi=(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??Zf[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Yt(i,n)};function Xd({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:p=0,title2MarginLeft:b=0,title3MarginLeft:v=0,titleRowMarginBottom:g=0,titleHeaderLayout:h="desktop",contentMarginTop:f=0,iconMarginRight:x=0,closeIcon:S=null,closeIconMaxWidth:y=0,closeIconColor:w="#000000",closeIconHoverColor:H="#cccccc"}=n,N=D.scalingValue(f,i),Y=D.scalingValue(x,i),O=D.scalingValue(g,i),C=h==="mobile",V=wi("title1",bi(n,"title1"),i),$=wi("title2",bi(n,"title2"),i),R=wi("title3",bi(n,"title3"),i),k=s.useMemo(()=>({title1Width:d??Xi.title1Width,title2Width:c??Xi.title2Width,title3Width:u??Xi.title3Width}),[d,c,u]),T=s.useMemo(()=>({title2MarginLeft:b,title3MarginLeft:v}),[b,v]),m=s.useMemo(()=>Jn(e,t,V,$,R),[e,t,V,$,R]),M=s.useMemo(()=>m.map(Z=>k[Z.widthKey]),[m,k]),E=s.useMemo(()=>eo(m.length,M),[m.length,M]),z=s.useMemo(()=>Oo(m.length,M),[m.length,M]),ne=s.useMemo(()=>m.filter(Z=>Z.prefix==="title1"),[m]),I=s.useMemo(()=>m.filter(Z=>Z.prefix==="title2"||Z.prefix==="title3"),[m]),W=s.useMemo(()=>Qn(ne,k),[ne,k]),K=s.useMemo(()=>Qn(I,k),[I,k]),ae=!!(t.title1||t.title2||t.title3),de=S!==null;if(!(ae||de))return null;const he=(p??0)>0||o,q=(Z,me)=>{const De=m.findIndex(G=>G.prefix===Z.prefix);if(!C||me==="single-row")return{effectiveWidth:z[De]??0,resolvedWidth:E[De]??0,maxWidth:dn(De,E)};if(me==="two-row-top"){const G=ne.findIndex(Me=>Me.prefix===Z.prefix);return{effectiveWidth:W.effective[G]??0,resolvedWidth:W.resolved[G]??0,maxWidth:dn(G,W.resolved)}}const ge=I.findIndex(G=>G.prefix===Z.prefix);return{effectiveWidth:K.effective[ge]??0,resolvedWidth:K.resolved[ge]??0,maxWidth:dn(ge,K.resolved)}},ce=(Z,me,De)=>{if(!C||De==="single-row"){const rt=Z.findIndex(je=>je.prefix===me.prefix),Je=Z.map(je=>k[je.widthKey]),at=eo(Z.length,Je);return{effectiveWidth:Oo(Z.length,Je)[rt]??0,resolvedWidth:at[rt]??0,maxWidth:dn(rt,at)}}if(De==="two-row-top"){const rt=Z.filter(je=>je.prefix==="title1"),Je=rt.findIndex(je=>je.prefix===me.prefix),{resolved:at,effective:it}=Qn(rt,k);return{effectiveWidth:it[Je]??0,resolvedWidth:at[Je]??0,maxWidth:dn(Je,at)}}const ge=Z.filter(rt=>rt.prefix==="title2"||rt.prefix==="title3"),G=ge.findIndex(rt=>rt.prefix===me.prefix),{resolved:Me,effective:_e}=Qn(ge,k);return{effectiveWidth:_e[G]??0,resolvedWidth:Me[G]??0,maxWidth:dn(G,Me)}},Q=Z=>qd(m,E,T,Z)+(C?0:p??0),be=()=>C?0:p??0,He=Z=>I.slice(0,Z).reduce((me,De,ge)=>me+(De.marginLeftKey?T[De.marginLeftKey]??0:0)+(K.resolved[ge]??0),0),xe=Z=>{const me=I[Z];return He(Z)+(me.marginLeftKey?T[me.marginLeftKey]??0:0)+(K.resolved[Z]??0)},le=(Z,me,De)=>{const ge=Z.marginLeftKey?T[Z.marginLeftKey]??0:0,{effectiveWidth:G,resolvedWidth:Me,maxWidth:_e}=De??q(Z,me),rt=Math.max(ge,Zn),Je=o&&me==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":Z.prefix,style:{width:D.scalingValue(G,i),...ge>0?{marginLeft:D.scalingValue(ge,i)}:{}},children:[a.jsx("p",{className:Z.className,style:Z.style,children:Z.text}),Je&&Z.marginLeftKey?a.jsx("div",{"data-controls":Z.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Me),style:{position:"absolute",top:0,left:D.scalingValue(-ge,i),width:D.scalingValue(rt,i),height:"100%",pointerEvents:"auto"}}):null,Je?a.jsx("div",{"data-controls":Z.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(_e),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:D.scalingValue(-yn/2,i),width:D.scalingValue(yn,i),height:"100%",pointerEvents:"auto"}}):null]},Z.className)},ee=(Z="two-row")=>{const me=m.findIndex(G=>G.prefix==="title1"),De=me>=0?E[me]:k.title1Width,ge=Z==="two-row"&&o;return a.jsx("div",{...ge?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(De)}:{},style:{width:D.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...ge?{pointerEvents:"auto"}:{}}})},ue=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:V,"aria-hidden":"true",children:" "}),oe=Z=>{const me=Jn(e,Z,V,$,R);return a.jsx(a.Fragment,{children:me.map(De=>le(De,"single-row",ce(me,De,"single-row")))})},Fe=Z=>{const me=Jn(e,Z,V,$,R),De=me.find(ge=>ge.prefix==="title1");return De?le(De,"two-row-top",ce(me,De,"two-row-top")):null},Ce=(Z,me=!1)=>{const De=Jn(e,Z,V,$,R),ge=De.filter(_e=>_e.prefix==="title2"||_e.prefix==="title3"),G=o&&me;return ge.length>0||G||(g??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[ge.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[a.jsx("div",{className:`${e}-titles-stack`,children:ge.map(_e=>le(_e,"two-row-bottom",ce(De,_e,"two-row-bottom")))}),me&&o?a.jsxs(a.Fragment,{children:[te(),$e()]}):null]}):null,(g??0)>0||G?a.jsx("div",{"data-controls":G?"titleRowMarginBottom":void 0,"data-controls-axis":G?"y":void 0,"data-controls-reverse":G?"":void 0,className:G?`${e}-control`:void 0,style:{height:O,width:"100%",flexShrink:0,pointerEvents:G?"auto":"none"}}):null]}):null},P=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:D.scalingValue(y??0,i),height:D.scalingValue(y??0,i),marginRight:Y,"--close-icon-hover-color":H},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Z=>{Z.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(ln,{url:S??"",fill:w,hoverFill:i&&!r?w:H,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:Y,height:"100%",pointerEvents:"auto"}})]}),U=()=>de?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:P()}):null,X=Z=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:Z})}),ie=Z=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[de||ae?ue():null,he?ee("two-row"):null,X(Z),U()]}),j=(Z,me=!1)=>a.jsxs(a.Fragment,{children:[ie(Fe(Z)),Ce(Z,me)]}),B=()=>{const Z=C?-1:m.findIndex(ge=>ge.prefix==="title1"),me=!C&&(o||(p??0)>0)?(()=>{const ge=p??0,G=Z>=0?E[Z]:k.title1Width,Me=Math.max(ge,Zn);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(G),style:{position:"absolute",top:0,left:0,width:D.scalingValue(Me,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,De=m.flatMap((ge,G)=>{if(!ge.marginLeftKey)return[];const Me=T[ge.marginLeftKey]??0,_e=Gd(m,E,T,G)+be(),rt=Math.max(Me,Zn);return a.jsx("div",{"data-controls":ge.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(E[G]),style:{position:"absolute",top:0,left:D.scalingValue(_e,i),width:D.scalingValue(rt,i),height:"100%",pointerEvents:"auto"}},ge.marginLeftKey)});return me?[me,...De]:De},J=()=>m.map((Z,me)=>{const De=dn(me,E),G=Q(me)-yn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Z.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(De),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D.scalingValue(G,i),width:D.scalingValue(yn,i),height:"100%",pointerEvents:"auto"}})},`${Z.widthKey}-junction`)}),te=()=>I.flatMap((Z,me)=>{if(!Z.marginLeftKey)return[];const De=T[Z.marginLeftKey]??0,ge=He(me),G=Math.max(De,Zn),{resolvedWidth:Me}=q(Z,"two-row-bottom");return a.jsx("div",{"data-controls":Z.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Me),style:{position:"absolute",top:0,left:D.scalingValue(ge,i),width:D.scalingValue(G,i),height:"100%",pointerEvents:"auto"}},Z.marginLeftKey)}),$e=()=>I.map((Z,me)=>{const{maxWidth:De}=q(Z,"two-row-bottom"),G=xe(me)-yn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Z.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(De),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D.scalingValue(G,i),width:D.scalingValue(yn,i),height:"100%",pointerEvents:"auto"}})},`${Z.widthKey}-junction`)}),ye=()=>!o||C?null:a.jsxs(a.Fragment,{children:[B(),J()]}),F=!!(t.title2||t.title3||(g??0)>0||o),ve=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[de||ae?ue():null,he?ee("single-row"):null,ae?X(oe(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),U(),ye()]}),pe=()=>a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...F?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:F?void 0:{flex:"0 0 auto",height:"auto"},children:j(t,!0)}),ye()]});return a.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:N,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...C?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${C?` ${e}-lightbox-content-area-stacked`:""}`,children:a.jsx("div",{className:`${e}-text-bar-cell${C?` ${e}-text-bar-cell-stacked`:""}`,style:C?void 0:{flex:1,minWidth:0,width:"100%"},children:C?pe():ve()})})})]})}function Jf(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Qf(e){return`
7278
+ `,Ta={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Nf=["titleColor","subtitleColor","lightboxCounterColor"],Hf={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},subtitle:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},gallery:{type:"array",label:"Gallery",display:{type:"media-pair-list-input"},items:{type:"object",properties:{media:{type:"array",items:{type:"object",properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["gallery"]},default:[{title:"Earth-orbital mission",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Salton Sea from Above",subtitle:"Hasselblad 500 EL / Zeiss Sonnar 250 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module Pilot",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module 3 porch",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Command Module",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-10.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"CSM and Lunar Module LM",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"David R. Scott during EVA",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Fourth day of the mission",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-8.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Landing of the Spider1",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-9.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""}]},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c","d","e","f"]},gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:4},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gutter",min:0}}}},textBoxWidth:{type:"number",scope:"layout",title:"Text Width (%)",display:{type:"percentage-input"},min:0},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},showText:{type:"boolean",scope:"common",title:"Show text",display:{type:"toggle-cycle",enum:["always","on hover"]}},alignEntries:{type:"boolean",scope:"layout",title:"Align entries",display:{type:"toggle-cycle",enum:["on","off"]}},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageDisplay:{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"}}},imageCorners:{type:"number",scope:"layout",title:"Round corners",min:0,display:{type:"numeric-input"}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},slider:{type:"boolean",scope:"common",title:"Slider",display:{type:"toggle-cycle",enum:["on","off"]}},sliderTiming:{type:"number",scope:"common",title:"Timing (Sec)",display:{type:"common-numeric-input"},min:1,max:10},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical","random"],enabled:!0}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","slide"]}},titleMarginTop:{type:"number",scope:"layout",title:"Title margin top",min:0,max:100,display:{type:"range-control"}},subtitleMarginTop:{type:"number",scope:"layout",title:"Subtitle margin top",min:0,max:100,display:{type:"range-control"}},titleColor:{type:"string",scope:"common",title:"Title Entry",display:{type:"palette-color-picker"}},subtitleColor:{type:"string",scope:"common",title:"Subtitle Entry",display:{type:"palette-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Ta.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},subtitleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},subtitleFontSettings:{...Ta.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},subtitleFontSize:{type:"number",scope:"layout",title:"Subtitle Font Size",display:{type:"font-size"}},subtitleLineHeight:{type:"number",scope:"layout",title:"Subtitle Line Height",display:{type:"line-height-input"}},subtitleLetterSpacing:{type:"number",scope:"layout",title:"Subtitle Letter Spacing",display:{type:"letter-spacing-input"}},subtitleWordSpacing:{type:"number",scope:"layout",title:"Subtitle Word Spacing",display:{type:"word-spacing-input"}},subtitleTextAppearance:{type:"object",scope:"layout",title:"Subtitle Text Appearance",display:{type:"text-appearance"}},lightboxCounterFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},lightboxCounterFontSettings:{...Ta.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},lightboxCounterFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},lightboxCounterLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},lightboxCounterLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},lightboxCounterWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},lightboxCounterTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}}},defaults:{lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",slider:"on",sliderTiming:3,direction:"horizontal",transition:"fade",showText:"always",alignEntries:"off",align:"top",titleColor:"#000000",subtitleColor:"#000000",lightboxCounterColor:"#DEDDDD",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},subtitleFontFamily:"Goudy Bookletter 1911",subtitleFontSettings:{fontWeight:400,fontStyle:"normal"},subtitleLetterSpacing:0,subtitleWordSpacing:0,subtitleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{type:"b",gridLayout:{entryWidth:.8,horizontalGap:.0533,wrapperWidth:1,columnsCount:1,lockedParam:null},textBoxWidth:100,verticalGap:.266,entriesCount:0,titleMarginTop:.02,subtitleMarginTop:.02,titleStroke:.003,titleCorners:.192,imageCorners:0,subtitlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titleFontSize:.1066,titleLineHeight:.0853,subtitleFontSize:.056,subtitleLineHeight:.064,lightboxCounterFontSize:.0373,lightboxCounterLineHeight:.0373},t:{type:"b",gridLayout:{entryWidth:.1041,horizontalGap:.26041,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:250,verticalGap:.09722,entriesCount:0,titleMarginTop:.01953125,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,imageCorners:0,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.03255,titleLineHeight:.03255,titleLetterSpacing:-.00118,subtitleFontSize:.01822,subtitleLineHeight:.02083,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},d:{type:"b",gridLayout:{entryWidth:.0833,horizontalGap:.25,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:200,verticalGap:.09722,entriesCount:0,titleMarginTop:.008,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,imageCorners:0,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.027,titleLineHeight:.0222,titleLetterSpacing:-.00118,subtitleFontSize:.01,subtitleLineHeight:.01,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01}},displayRules:[{if:{name:"transition",value:"fade"},then:{name:"properties.direction.display.enabled",value:!1}},{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}},{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","showText","alignEntries","align","entriesCount","lightbox","imageDisplay","imageCorners","lightboxImageDisplay","slider","sliderTiming","direction","transition","transition","titleMarginTop","subtitleMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"Grid",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["textBoxWidth","verticalGap"]},{type:"row",title:"",items:["entriesCount","showText"]},{type:"row",title:"",items:["alignEntries","align"]}]},{id:"imageSettings",icon:"cover",title:"Image settings",tooltip:"Image settings",layout:["__componentName__",{type:"row",title:"Image",items:["imageDisplay","imageCorners"]},{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",title:"Slider",items:[{type:"group",title:"",items:["slider","direction"]},{type:"group",title:"",items:["sliderTiming","transition"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Subtitle",items:["subtitleFontFamily","subtitleFontSettings",{type:"row",items:["subtitleFontSize","subtitleLineHeight","subtitleLetterSpacing","subtitleWordSpacing"]},"subtitleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:[...Nf],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Of={element:Af,id:"grid",name:"Neptune",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Neptune_Grid.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"subtitleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",subtitleFontSettings:"subtitleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"},schema:Hf,sourceCode:Wf},Df=50,Wl=10,qs="cntrl-lightbox-journal",aa=qs,ss=`${qs}-`,sa=e=>`${qs}-${e}`,Xs=e=>e===aa||e.startsWith(ss),Nl=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Hl=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Nl(t.get(sa(e)));if(i)return i}const n=Nl(t.get(aa));if(n)return n;for(const[i]of t){if(!i.startsWith(ss))continue;const o=i.slice(ss.length);if(!/^\d+$/.test(o))continue;const r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}return null},Ol=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},zd=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{Xs(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(sa(t),String(e)):i.searchParams.set(aa,String(e));const o=n?"replaceState":"pushState",r=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",r)},jf=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===sa(e)||i===aa:Xs(i));if(n.forEach(i=>t.searchParams.delete(i)),n.length>0){const i=`${t.pathname}${t.search}${t.hash}`;window.history.replaceState(window.history.state,"",i)}},Bd=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(sa(e)):[...t.keys()].some(n=>Xs(n))},zf=(e,t)=>{if(Bd(t)){if(e){window.history.back();return}jf(t)}},Bf=20,Vf=2,La=e=>`max(${e}, ${Bf}px)`,Qi=e=>((e==null?void 0:e.image)??[]).slice(0,Vf),Vd=e=>e.reduce((t,n)=>t+Qi(n).length,0),Gf=(e,t)=>{const n=e.slice(0,t).reduce((o,r)=>o+Qi(r).length,1),i=Qi(e[t]).length;return{start:n,end:n+i-1}},qf=(e,t)=>{const n=Vd(e),{start:i,end:o}=Gf(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Ar=(e,t)=>t==="B"?e.flatMap((n,i)=>Qi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Qi(n)})),Xf=(e,t,n,i)=>{var r;if(n==="B")return`${t+1} / ${e.length}`;const o=((r=e[t])==null?void 0:r.entryIndex)??0;return qf(i,o)},Dl=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Uf=(e,t,n)=>e==="B"?t.length>1:Vd(n)>1,yn=.004,Zn=.004,Xi={title1Width:.13,title2Width:.13,title3Width:.14},Jn=(e,t,n,i,o)=>{const r=[];return t.title1&&r.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&r.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&r.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),r},eo=(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},d)=>{if(r<=0||d<=0)return{overflow:r,widths:[d,...l]};const c=Math.min(r,d);return{overflow:r-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},Oo=(e,t)=>eo(e,t),dn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Qn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:eo(e.length,n),effective:Oo(e.length,n)}},Gd=(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),qd=(e,t,n,i)=>e.slice(0,i+1).reduce((o,r,l)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[l]??0),0),ii=["title1","title2","title3","count"],ct=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Us={title1:"1",title2:"2",title3:"3",count:"Count"},Ys=e=>[ct(e,"fontFamily"),ct(e,"fontSettings"),{type:"row",items:[ct(e,"fontSize"),ct(e,"lineHeight"),ct(e,"letterSpacing"),ct(e,"wordSpacing")]},ct(e,"textAlign"),ct(e,"textAppearance")],Yf=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(ii.map(e=>[Us[e],Ys(e)]))}),Kf={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Zf={title1:.02,title2:.02,title3:.02,count:.017},bi=(e,t)=>{const n=i=>{const o=ct(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[Kf[t]]}},wi=(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??Zf[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Yt(i,n)};function Xd({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:p=0,title2MarginLeft:b=0,title3MarginLeft:v=0,titleRowMarginBottom:g=0,titleHeaderLayout:h="desktop",contentMarginTop:f=0,iconMarginRight:x=0,closeIcon:S=null,closeIconMaxWidth:y=0,closeIconColor:w="#000000",closeIconHoverColor:H="#cccccc"}=n,N=D.scalingValue(f,i),U=D.scalingValue(x,i),O=D.scalingValue(g,i),C=h==="mobile",V=wi("title1",bi(n,"title1"),i),$=wi("title2",bi(n,"title2"),i),R=wi("title3",bi(n,"title3"),i),k=s.useMemo(()=>({title1Width:d??Xi.title1Width,title2Width:c??Xi.title2Width,title3Width:u??Xi.title3Width}),[d,c,u]),T=s.useMemo(()=>({title2MarginLeft:b,title3MarginLeft:v}),[b,v]),m=s.useMemo(()=>Jn(e,t,V,$,R),[e,t,V,$,R]),M=s.useMemo(()=>m.map(Z=>k[Z.widthKey]),[m,k]),E=s.useMemo(()=>eo(m.length,M),[m.length,M]),z=s.useMemo(()=>Oo(m.length,M),[m.length,M]),ne=s.useMemo(()=>m.filter(Z=>Z.prefix==="title1"),[m]),I=s.useMemo(()=>m.filter(Z=>Z.prefix==="title2"||Z.prefix==="title3"),[m]),W=s.useMemo(()=>Qn(ne,k),[ne,k]),K=s.useMemo(()=>Qn(I,k),[I,k]),ae=!!(t.title1||t.title2||t.title3),de=S!==null;if(!(ae||de))return null;const he=(p??0)>0||o,q=(Z,me)=>{const De=m.findIndex(G=>G.prefix===Z.prefix);if(!C||me==="single-row")return{effectiveWidth:z[De]??0,resolvedWidth:E[De]??0,maxWidth:dn(De,E)};if(me==="two-row-top"){const G=ne.findIndex(Me=>Me.prefix===Z.prefix);return{effectiveWidth:W.effective[G]??0,resolvedWidth:W.resolved[G]??0,maxWidth:dn(G,W.resolved)}}const ge=I.findIndex(G=>G.prefix===Z.prefix);return{effectiveWidth:K.effective[ge]??0,resolvedWidth:K.resolved[ge]??0,maxWidth:dn(ge,K.resolved)}},ce=(Z,me,De)=>{if(!C||De==="single-row"){const rt=Z.findIndex(je=>je.prefix===me.prefix),Je=Z.map(je=>k[je.widthKey]),at=eo(Z.length,Je);return{effectiveWidth:Oo(Z.length,Je)[rt]??0,resolvedWidth:at[rt]??0,maxWidth:dn(rt,at)}}if(De==="two-row-top"){const rt=Z.filter(je=>je.prefix==="title1"),Je=rt.findIndex(je=>je.prefix===me.prefix),{resolved:at,effective:it}=Qn(rt,k);return{effectiveWidth:it[Je]??0,resolvedWidth:at[Je]??0,maxWidth:dn(Je,at)}}const ge=Z.filter(rt=>rt.prefix==="title2"||rt.prefix==="title3"),G=ge.findIndex(rt=>rt.prefix===me.prefix),{resolved:Me,effective:_e}=Qn(ge,k);return{effectiveWidth:_e[G]??0,resolvedWidth:Me[G]??0,maxWidth:dn(G,Me)}},Q=Z=>qd(m,E,T,Z)+(C?0:p??0),be=()=>C?0:p??0,He=Z=>I.slice(0,Z).reduce((me,De,ge)=>me+(De.marginLeftKey?T[De.marginLeftKey]??0:0)+(K.resolved[ge]??0),0),xe=Z=>{const me=I[Z];return He(Z)+(me.marginLeftKey?T[me.marginLeftKey]??0:0)+(K.resolved[Z]??0)},le=(Z,me,De)=>{const ge=Z.marginLeftKey?T[Z.marginLeftKey]??0:0,{effectiveWidth:G,resolvedWidth:Me,maxWidth:_e}=De??q(Z,me),rt=Math.max(ge,Zn),Je=o&&me==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":Z.prefix,style:{width:D.scalingValue(G,i),...ge>0?{marginLeft:D.scalingValue(ge,i)}:{}},children:[a.jsx("p",{className:Z.className,style:Z.style,children:Z.text}),Je&&Z.marginLeftKey?a.jsx("div",{"data-controls":Z.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Me),style:{position:"absolute",top:0,left:D.scalingValue(-ge,i),width:D.scalingValue(rt,i),height:"100%",pointerEvents:"auto"}}):null,Je?a.jsx("div",{"data-controls":Z.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(_e),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:D.scalingValue(-yn/2,i),width:D.scalingValue(yn,i),height:"100%",pointerEvents:"auto"}}):null]},Z.className)},ee=(Z="two-row")=>{const me=m.findIndex(G=>G.prefix==="title1"),De=me>=0?E[me]:k.title1Width,ge=Z==="two-row"&&o;return a.jsx("div",{...ge?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(De)}:{},style:{width:D.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...ge?{pointerEvents:"auto"}:{}}})},ue=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:V,"aria-hidden":"true",children:" "}),oe=Z=>{const me=Jn(e,Z,V,$,R);return a.jsx(a.Fragment,{children:me.map(De=>le(De,"single-row",ce(me,De,"single-row")))})},Fe=Z=>{const me=Jn(e,Z,V,$,R),De=me.find(ge=>ge.prefix==="title1");return De?le(De,"two-row-top",ce(me,De,"two-row-top")):null},Ce=(Z,me=!1)=>{const De=Jn(e,Z,V,$,R),ge=De.filter(_e=>_e.prefix==="title2"||_e.prefix==="title3"),G=o&&me;return ge.length>0||G||(g??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[ge.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[a.jsx("div",{className:`${e}-titles-stack`,children:ge.map(_e=>le(_e,"two-row-bottom",ce(De,_e,"two-row-bottom")))}),me&&o?a.jsxs(a.Fragment,{children:[te(),$e()]}):null]}):null,(g??0)>0||G?a.jsx("div",{"data-controls":G?"titleRowMarginBottom":void 0,"data-controls-axis":G?"y":void 0,"data-controls-reverse":G?"":void 0,className:G?`${e}-control`:void 0,style:{height:O,width:"100%",flexShrink:0,pointerEvents:G?"auto":"none"}}):null]}):null},P=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:D.scalingValue(y??0,i),height:D.scalingValue(y??0,i),marginRight:U,"--close-icon-hover-color":H},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Z=>{Z.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(ln,{url:S??"",fill:w,hoverFill:i&&!r?w:H,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:U,height:"100%",pointerEvents:"auto"}})]}),Y=()=>de?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:P()}):null,X=Z=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:Z})}),ie=Z=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[de||ae?ue():null,he?ee("two-row"):null,X(Z),Y()]}),j=(Z,me=!1)=>a.jsxs(a.Fragment,{children:[ie(Fe(Z)),Ce(Z,me)]}),B=()=>{const Z=C?-1:m.findIndex(ge=>ge.prefix==="title1"),me=!C&&(o||(p??0)>0)?(()=>{const ge=p??0,G=Z>=0?E[Z]:k.title1Width,Me=Math.max(ge,Zn);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(G),style:{position:"absolute",top:0,left:0,width:D.scalingValue(Me,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,De=m.flatMap((ge,G)=>{if(!ge.marginLeftKey)return[];const Me=T[ge.marginLeftKey]??0,_e=Gd(m,E,T,G)+be(),rt=Math.max(Me,Zn);return a.jsx("div",{"data-controls":ge.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(E[G]),style:{position:"absolute",top:0,left:D.scalingValue(_e,i),width:D.scalingValue(rt,i),height:"100%",pointerEvents:"auto"}},ge.marginLeftKey)});return me?[me,...De]:De},J=()=>m.map((Z,me)=>{const De=dn(me,E),G=Q(me)-yn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Z.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(De),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D.scalingValue(G,i),width:D.scalingValue(yn,i),height:"100%",pointerEvents:"auto"}})},`${Z.widthKey}-junction`)}),te=()=>I.flatMap((Z,me)=>{if(!Z.marginLeftKey)return[];const De=T[Z.marginLeftKey]??0,ge=He(me),G=Math.max(De,Zn),{resolvedWidth:Me}=q(Z,"two-row-bottom");return a.jsx("div",{"data-controls":Z.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Me),style:{position:"absolute",top:0,left:D.scalingValue(ge,i),width:D.scalingValue(G,i),height:"100%",pointerEvents:"auto"}},Z.marginLeftKey)}),$e=()=>I.map((Z,me)=>{const{maxWidth:De}=q(Z,"two-row-bottom"),G=xe(me)-yn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Z.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(De),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D.scalingValue(G,i),width:D.scalingValue(yn,i),height:"100%",pointerEvents:"auto"}})},`${Z.widthKey}-junction`)}),ye=()=>!o||C?null:a.jsxs(a.Fragment,{children:[B(),J()]}),F=!!(t.title2||t.title3||(g??0)>0||o),ve=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[de||ae?ue():null,he?ee("single-row"):null,ae?X(oe(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),Y(),ye()]}),pe=()=>a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...F?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:F?void 0:{flex:"0 0 auto",height:"auto"},children:j(t,!0)}),ye()]});return a.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:N,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...C?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${C?` ${e}-lightbox-content-area-stacked`:""}`,children:a.jsx("div",{className:`${e}-text-bar-cell${C?` ${e}-text-bar-cell-stacked`:""}`,style:C?void 0:{flex:1,minWidth:0,width:"100%"},children:C?pe():ve()})})})]})}function Jf(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Qf(e){return`
7279
7279
  .${e}-wrapper {
7280
7280
  display: grid;
7281
7281
  align-items: start;
@@ -7595,7 +7595,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
7595
7595
  pointer-events: auto;
7596
7596
  flex-shrink: 0;
7597
7597
  }
7598
- `}const jl={url:"",name:"",objectFit:"cover"},Ln=500,vo=650,mn="cubic-bezier(0.22, 1, 0.36, 1)",ey=72,ty=50,ny=1e4,iy=650,oy=500;function ry(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 Ud(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=jr(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 ay(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Ud(i,n):null}function sy(e){return e.reduce((t,n,i)=>{const o=Ks(n.gallery),l=Zs(o).filter(d=>d.lightboxMedia).map(d=>d.lightboxMedia);return l.length===0||t.push({gridIndex:i,items:l,entry:{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}),t},[])}function To(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 zl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return To(e,i,n)}const ly=.03;function Yd(e){return e.width*ly}const Ra={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function ur(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Bl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function cy(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ls(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,d=o/r;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const c=r*l;return{width:c,height:r,left:i.left+(o-c)/2,top:i.top}}function dy(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ls(e,t.width,t.height)}function uy(e,t){if(ho(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function py(e){const t=new Set,n=[];for(const i of e){const o=Ks(i.gallery),r=Zs(o);for(const l of r)for(const d of[l.displayMedia,l.lightboxMedia])d!=null&&d.url&&!t.has(d.url)&&(t.add(d.url),n.push(d))}return n}function my({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=>ho(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function to(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=Yd(n);return t==="left"?{left:l+c-i,top:r,width:i,height:o}:{left:l+d-c,top:r,width:i,height:o}}function zr(e,t,n){const i=to(e,t,n);return{...i,left:2*i.left-e.left}}function gy(e,t,n){const{left:i,width:o}=n,r=Yd(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 Kd(e,t,n,i){const o=to(e,"left",i),r=to(e,"right",i),l=zr(e,"left",i),d=zr(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:d,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:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function hy(e,t,n,i){const{start:o,end:r}=Kd(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function fy(e,t,n){const i=to(e,t,n),o=zr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Zd(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 Ks(e){if(!e)return;if(Zd(e))return e;if(!Array.isArray(e))return;const[t,n]=e,i=t!=null&&t.url?t:void 0,o=n!=null&&n.url?n:void 0;if(!(!i&&!o))return[{media:[o??i??jl,i??o??jl]}]}function yy(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function vy(e){const[t]=e.media;return t!=null&&t.url?t:null}function Zs(e){if(!Array.isArray(e)||e.length===0)return[];if(Zd(e)){const t=[];for(const n of e){const i=yy(n);if(!i)continue;const o=vy(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.url?o:null})}return t}return e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function ho(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function xy({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return ho(e)?a.jsx("video",{src:e.url,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.url,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function by({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const d=s.useRef(null);return s.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:c=>c.stopPropagation(),style:o},e)})}function pr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return ho(e)?a.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.url,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.url,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function wy({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:b,sourceRect:v,resolveCloseSourceRect:g,onClose:h,onPrev:f,onNext:x}){const S=s.useRef(null),y=s.useRef(null),w=s.useRef(null),H=s.useRef(new Map),[N,Y]=s.useState(0),O=s.useRef(null),C=s.useRef(0),V=s.useRef(0),$=s.useRef("none"),R=s.useRef(!1),k=s.useRef(!1),T=s.useRef(!1),m=s.useRef(null),M=s.useRef(null),E=s.useRef(null),z=s.useRef(()=>{}),ne=s.useRef(null),I=s.useRef(null),W=s.useRef(null),K=s.useRef(!1),[ae,de]=s.useState(null),[A,he]=s.useState(Ra),[q,ce]=s.useState(0),[Q,be]=s.useState("opening"),[He,xe]=s.useState(0),[le,ee]=s.useState(0),[ue,oe]=s.useState(!1),[Fe,Ce]=s.useState(null),[P,U]=s.useState(null),[X,ie]=s.useState(null),[j,B]=s.useState(!1),[J,te]=s.useState(null),[$e,ye]=s.useState(!1),F=s.useRef(!1),[ve,pe]=s.useState(!1),[Z,me]=s.useState(!1),De=s.useRef(n),ge=s.useRef(void 0),G=t[n],Me=G?ho(G):!1,_e=le!==0||ue,rt=!l&&(!r||!!d),Je=c&&!l,at=u.length>1,it=s.useCallback((_,Ie)=>t.length<=1?null:t[(_+Ie+t.length)%t.length]??null,[t]),je=at?To(u,p,-1):it(n,-1),Se=at?To(u,p,1):it(n,1),We=Fe===-1&&_e?at&&P!==null?To(u,P,-1):X!==null?it(X,-1):null:null,Be=Fe===1&&_e?at&&P!==null?To(u,P,1):X!==null?it(X,1):null:null,Ze=We&&We.url!==(je==null?void 0:je.url)?We:null,Le=Be&&Be.url!==(Se==null?void 0:Se.url)?Be:null,Ve=je&&Je?(()=>{const _=at?zl(u,p,-1):t.length>2?it((n-1+t.length)%t.length,-1):null;return _&&_.url!==je.url?_:null})():null,se=Se&&Je?(()=>{const _=at?zl(u,p,1):t.length>2?it((n+1)%t.length,1):null;return _&&_.url!==Se.url?_:null})():null,Te=Ze??Ve,Xe=Le??se,ze=s.useCallback((_,Ie,Ne)=>{if(!_||!Ie||!Ne)return;const Ge=H.current,dt=Ge.get(_);(dt==null?void 0:dt.width)===Ie&&(dt==null?void 0:dt.height)===Ne||(Ge.set(_,{width:Ie,height:Ne}),Y(Ft=>Ft+1))},[]),Re=s.useCallback(_=>{if(!(_!=null&&_.url))return null;const Ie=H.current.get(_.url);return dy(y.current,Ie)},[N,q]),Pe=s.useCallback(()=>{if(!G)return;const _=Re(G);if(_){de(_);return}const Ie=y.current;Ie&&de(Bl(Ie))},[G,Re]),Ae=s.useCallback(_=>{if(at){const Ie=u.length;U((p+_+Ie)%Ie),ie(null);return}t.length>1&&(ie((n+_+t.length)%t.length),U(null))},[at,u.length,p,t.length,n]),Ke=s.useCallback(_=>{T.current=_,oe(_)},[]),Oe=s.useCallback(()=>{m.current!==null&&(window.clearTimeout(m.current),m.current=null)},[]),Qe=s.useCallback(()=>{Oe(),m.current=window.setTimeout(()=>{Oe(),Ke(!1)},vo+32)},[Oe,Ke]),tt=s.useCallback(()=>{const _=S.current;if(!_){he({left:0,top:0,width:typeof window<"u"?window.innerWidth:Ra.width,height:typeof window<"u"?window.innerHeight:Ra.height});return}const Ie=_.getBoundingClientRect();he({left:Ie.left,top:Ie.top,width:Ie.width,height:Ie.height})},[]),nt=s.useCallback((_,Ie)=>{if(_e){if(ve&&!ue)return`translate(${le}px, 0px)`;if(ue&&Fe!==null){const Ne=Re(_);if(!Ne)return;const{x:Ge,y:dt}=hy(Ne,Ie,Fe,A);return`translate(${Ge}px, ${dt}px)`}if(ue)return"translate(0px, 0px)"}},[_e,ve,ue,le,Fe,A,Re]),xt=s.useCallback(()=>{const _=M.current;M.current=null,Oe(),Ke(!1),Ce(null),U(null),ie(null),ee(0),pe(!1),R.current=!1,V.current=0,$.current="none",_===-1?f():_===1&&x()},[Oe,Ke,f,x]),It=s.useCallback(()=>{Oe(),m.current=window.setTimeout(()=>{M.current!==null&&xt()},vo+32)},[Oe,xt]),Tt=s.useCallback(()=>{Oe(),M.current=null,Ke(!1),Ce(null),U(null),ie(null),ee(0),pe(!1),R.current=!1,V.current=0,$.current="none"},[Oe,Ke]),ut=s.useCallback(_=>{if(!(!Je||!ae)){if(T.current){if(M.current===_){E.current=_,xt();return}Tt()}Oe(),Ae(_),M.current=_,Ce(_),Ke(!0),It()}},[Je,ae,xt,Tt,Oe,Ae,Ke,It]);z.current=ut;const ft=s.useCallback(()=>{ne.current=null,K.current=!1,I.current!==null&&(window.clearInterval(I.current),I.current=null),W.current!==null&&(window.clearTimeout(W.current),W.current=null)},[]),Et=s.useCallback(_=>{I.current!==null&&window.clearInterval(I.current);const Ie=K.current?oy:iy;I.current=window.setInterval(()=>{z.current(_)},Ie)},[]),Lt=s.useCallback(_=>{ne.current!==_&&(ft(),ne.current=_,K.current=!1,z.current(_),Et(_),W.current=window.setTimeout(()=>{W.current=null,ne.current===_&&(K.current=!0,Et(_))},ny))},[ft,Et]),bt=s.useCallback(()=>{const _=y.current;if(!_)return;const Ie=G==null?void 0:G.url,Ne=Ie?H.current.get(Ie):void 0;if(Ne!=null&&Ne.width&&(Ne!=null&&Ne.height)){de(ls(_,Ne.width,Ne.height));return}const Ge=w.current;if(Ge&&Ie&&(Ge.src===Ie||Ge.currentSrc===Ie)){const{width:Ft,height:lt}=cy(Ge);if(Ft&&lt){ze(Ie,Ft,lt),de(ls(_,Ft,lt));return}}const dt=Bl(_);!dt.width||!dt.height||de(dt)},[G==null?void 0:G.url,ze]),Nt=s.useCallback(_=>{if(w.current=_,!!_){if(_ instanceof HTMLVideoElement){_.readyState>=1&&_.videoWidth>0&&bt();return}_.complete&&_.naturalWidth>0&&bt()}},[bt]),Bt=s.useCallback(()=>{tt(),bt(),ce(_=>_+1)},[tt,bt]);s.useEffect(()=>{Bt();const _=y.current,Ie=S.current,Ne=new ResizeObserver(()=>Bt());return _&&Ne.observe(_),Ie&&Ne.observe(Ie),window.addEventListener("resize",Bt),()=>{Ne.disconnect(),window.removeEventListener("resize",Bt)}},[Bt,n,b]),s.useLayoutEffect(()=>{if(!G)return;const _=w.current;if(_){if(_ instanceof HTMLImageElement&&_.complete&&_.naturalWidth>0){bt();return}_ instanceof HTMLVideoElement&&_.readyState>=1&&_.videoWidth>0&&bt()}},[G==null?void 0:G.url,n,bt]),s.useEffect(()=>{Pe()},[Pe,N]),s.useEffect(()=>{const _=new Set,Ie=[],Ne=Ge=>{!(Ge!=null&&Ge.url)||_.has(Ge.url)||(_.add(Ge.url),Ie.push(Ge))};t.forEach(Ne),u.forEach(Ge=>Ge.items.forEach(Ne)),Ie.forEach(Ge=>{H.current.has(Ge.url)||uy(Ge,ze)})},[t,u,ze]),s.useEffect(()=>{if(Q!=="opening"||!ae)return;if(!v){be("open");return}B(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{B(!0),be("open")})});return()=>cancelAnimationFrame(_)},[Q,ae,v]),s.useEffect(()=>{if(Q!=="closing")return;const _=setTimeout(()=>h(),Ln);return()=>clearTimeout(_)},[Q,h]),s.useEffect(()=>()=>{Oe()},[Oe]),s.useLayoutEffect(()=>{De.current===n&&ge.current===(G==null?void 0:G.url)||(Oe(),M.current=null,Ce(null),U(null),ie(null),xe(0),ee(0),Ke(!1),me(!1),pe(!1),C.current=0,V.current=0,$.current="none",R.current=!1,O.current=null,k.current=!1,w.current=null,Pe(),De.current=n,ge.current=G==null?void 0:G.url)},[n,G==null?void 0:G.url,Ke,Oe,Pe]),s.useLayoutEffect(()=>{const _=E.current;_!==null&&(E.current=null,requestAnimationFrame(()=>{z.current(_)}))},[n,p,G==null?void 0:G.url]),s.useLayoutEffect(()=>{if(Q==="opening"){F.current=!1,ye(!1);return}if(Q!=="open"||F.current)return;if(!je&&!Se){F.current=!0;return}ye(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ye(!0),F.current=!0})});return()=>cancelAnimationFrame(_)},[Q,je==null?void 0:je.url,Se==null?void 0:Se.url]),s.useEffect(()=>{if(Q!=="open")return;const _=()=>{const lt=wt=>{wt.stopPropagation(),wt.preventDefault(),document.removeEventListener("click",lt,!0)};document.addEventListener("click",lt,!0)},Ie=lt=>{const wt=lt<0?1:-1;Oe(),Ae(wt),M.current=wt,Ce(wt),Ke(!0),It()},Ne=lt=>{if(Math.abs(lt)>ty&&Je){Ie(lt);return}M.current=null,Ce(null),U(null),ie(null),Ke(!0),ee(0),Qe()},Ge=lt=>{if(lt.touches.length!==1||T.current)return;const wt=lt.touches[0];k.current=!0,O.current={x:wt.clientX,y:wt.clientY},$.current="none",V.current=0,R.current=!1},dt=lt=>{if(!O.current||lt.touches.length!==1||T.current)return;const wt=lt.touches[0],zt=wt.clientX-O.current.x,Pt=wt.clientY-O.current.y;if($.current==="none"){if(Math.abs(zt)<10&&Math.abs(Pt)<10)return;if(Math.abs(zt)>Math.abs(Pt)){if(!Je)return;$.current="horizontal"}else if(Pt>0){if(!rt)return;$.current="vertical"}else return}if($.current==="horizontal"){R.current=!0,pe(!0),V.current=zt,ee(zt),lt.preventDefault();return}$.current==="vertical"&&(R.current=!0,pe(!0),C.current=Pt,xe(Pt),lt.preventDefault())},Ft=()=>{if(!O.current)return;const lt=$.current,wt=R.current;if(wt&&lt==="horizontal")Ne(V.current),_();else if(wt&&lt==="vertical"){const zt=C.current;if(rt&&zt>ey){const Pt=window.innerHeight;C.current=Pt,me(!0),xe(Pt),be("closing")}else C.current=0,xe(0);_()}else lt==="horizontal"&&Math.abs(V.current)>0&&(Ne(V.current),_());O.current=null,$.current="none",V.current=0,R.current=!1,pe(!1)};return document.addEventListener("touchstart",Ge,{passive:!0}),document.addEventListener("touchmove",dt,{passive:!1}),document.addEventListener("touchend",Ft),document.addEventListener("touchcancel",Ft),()=>{document.removeEventListener("touchstart",Ge),document.removeEventListener("touchmove",dt),document.removeEventListener("touchend",Ft),document.removeEventListener("touchcancel",Ft)}},[Q,Je,Ke,Qe,Oe,rt,It,Ae]);const Zt=s.useCallback(()=>{const _=(g==null?void 0:g())??v??null;_&&ae&&(te(_),B(!0)),be("closing")},[g,v,ae]);s.useEffect(()=>{const _=Ge=>{if(Ge.key==="Escape"){if(r&&d||Q==="closing")return;ft(),Zt();return}if(Ge.key!=="ArrowLeft"&&Ge.key!=="ArrowRight"||Q!=="open"||!Je)return;Ge.preventDefault();const dt=Ge.key==="ArrowLeft"?-1:1;Ge.repeat&&ne.current===dt||Lt(dt)},Ie=Ge=>{if(Ge.key!=="ArrowLeft"&&Ge.key!=="ArrowRight")return;const dt=Ge.key==="ArrowLeft"?-1:1;ne.current===dt&&ft()},Ne=()=>{ft()};return window.addEventListener("keydown",_),window.addEventListener("keyup",Ie),window.addEventListener("blur",Ne),()=>{window.removeEventListener("keydown",_),window.removeEventListener("keyup",Ie),window.removeEventListener("blur",Ne),ft()}},[Q,r,d,Zt,Je,Lt,ft]),s.useEffect(()=>{Q!=="open"&&ft()},[Q,ft]);const en=()=>{Q==="closing"||l||Zt()},Rt=Q==="open",Ot=Q==="closing",nn=He>0?Math.max(0,1-He/500):1,pt=He>0?Math.max(.35,1-He/500):1,Ee=s.useCallback(_=>{if(!(_.propertyName!=="transform"||!T.current)){if(M.current!==null){xt();return}Oe(),Ke(!1)}},[Oe,Ke,xt]),qe=Q==="closing"?J??v:v,st=qe&&ae&&(Q==="opening"||Ot)?ry(qe,ae):void 0,mt=_e&&G?nt(G,"center"):He>0?`translateY(${He}px)`:st,vt=ae?ur(ae,A):null,Mt=!!(qe&&ae),gt=Mt&&(Q==="closing"||Q==="open"&&j),Vt={position:"absolute",top:vt==null?void 0:vt.top,left:vt==null?void 0:vt.left,width:vt==null?void 0:vt.width,height:vt==null?void 0:vt.height,objectFit:"contain",transformOrigin:"top left",transform:mt,opacity:He>0?pt:Mt?1:Q==="opening"||Ot?0:1,transition:ve&&!ue?"none":ue?`transform ${vo}ms ${mn}`:Z?`transform ${Ln}ms ${mn}, opacity ${Ln}ms ${mn}`:gt?`transform ${Ln}ms ${mn}`:Q==="opening"||Ot?`opacity ${Ln}ms ${mn}`:"none",pointerEvents:Me&&Rt&&!_e?"auto":"none",touchAction:Me&&Rt?"none":void 0,zIndex:1,overflow:Me?"hidden":void 0},Wt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Rt&&!_e?"auto":"none"},_t=(_,Ie,Ne="adjacent")=>{const Ge=Re(_);if(!Ge)return{display:"none"};const dt=Ne==="far"?Ie==="left"?"far-left":"far-right":Ie==="left"?"left-adjacent":"right-adjacent",{start:Ft}=Fe!==null?Kd(Ge,dt,Fe,A):{start:Ne==="far"?zr(Ge,Ie,A):to(Ge,Ie,A)},lt=ur(Ft,A),wt=nt(_,dt),zt=!_e&&Ne==="adjacent"&&Rt&&!$e?fy(Ge,Ie,A):null,Pt=Ne==="far"&&_e&&Fe===(Ie==="left"?-1:1),on=ve&&!ue?!1:ue,pn=Ne==="adjacent"&&Rt&&$e&&!_e;return{position:"absolute",top:lt.top,left:lt.left,width:lt.width,height:lt.height,objectFit:"contain",transform:wt??(zt?`translate(${zt.x}px, ${zt.y}px)`:void 0),opacity:Ne==="far"?Rt&&Pt?1:0:Rt?1:0,transition:on?Ne==="far"?`transform ${vo}ms ${mn}`:`transform ${vo}ms ${mn}, opacity ${Ln}ms ${mn}`:pn?`transform ${Ln}ms ${mn}`:Q==="opening"||Ot?`opacity ${Ln}ms ${mn}`:"none",pointerEvents:"none",zIndex:1}},qt=(_,Ie)=>{const Ne=Re(_);return Ne?gy(to(Ne,Ie,A),Ie,A):null},Xt=_=>Ie=>{if(!l){if(k.current){k.current=!1;return}Ie.stopPropagation(),ut(_)}},Dt=je?qt(je,"left"):null,jt=Se?qt(Se,"right"):null,Ht=Dt?ur(Dt,A):null,$t=jt?ur(jt,A):null;return a.jsxs("div",{ref:S,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:Q==="open"?"none":void 0},onClick:en,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Rt?nn:0,transition:ve?"none":`opacity ${Ln}ms ${mn}`,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:y,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Rt?1:0,transition:ve?"none":`opacity ${Ln}ms ${mn}`,pointerEvents:"none"},children:a.jsx(Xd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:en})})]}),Rt&&Te&&a.jsx(pr,{media:Te,style:_t(Te,"left","far"),onMeasure:ze,onTransitionEnd:Ee},`far-prev-${Te.url}`),Rt&&je&&a.jsxs(a.Fragment,{children:[a.jsx(pr,{media:je,style:_t(je,"left"),onMeasure:ze,onTransitionEnd:Ee},`prev-${je.url}`),Ht&&a.jsx("div",{style:{position:"absolute",top:Ht.top,left:Ht.left,width:Ht.width,height:Ht.height,cursor:l||ve?"default":"pointer",pointerEvents:l||ve?"none":"auto",zIndex:3},onClick:Xt(-1)})]}),Rt&&Se&&a.jsxs(a.Fragment,{children:[a.jsx(pr,{media:Se,style:_t(Se,"right"),onMeasure:ze,onTransitionEnd:Ee},`next-${Se.url}`),$t&&a.jsx("div",{style:{position:"absolute",top:$t.top,left:$t.left,width:$t.width,height:$t.height,cursor:l||ve?"default":"pointer",pointerEvents:l||ve?"none":"auto",zIndex:3},onClick:Xt(1)})]}),Rt&&Xe&&a.jsx(pr,{media:Xe,style:_t(Xe,"right","far"),onMeasure:ze,onTransitionEnd:Ee},`far-next-${Xe.url}`),ae&&G&&(Me?a.jsx(by,{src:G.url,phase:Q,onMediaElement:Nt,wrapperStyle:Vt,videoStyle:Wt,onLoadedMetadata:bt,onTransitionEnd:Ee},`${n}-${G.url}`):a.jsx("img",{ref:Nt,src:G.url,alt:G.name,onLoad:bt,onTransitionEnd:Ee,style:Vt},`${n}-${G.url}`))]})}function Sy({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=D.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:b}=e,v=(b==null?void 0:b.display)==="cover",g=(b==null?void 0:b.ratioValue)??"1:1",h=(b==null?void 0:b.reversed)??!1,[f,x]=g.split(":").map(Number),w=`${h?x:f} / ${h?f:x}`,H=c.entryWidth??.2,N=c.columnsCount,Y=D.scalingValue(H,n),O=D.scalingValue(c.horizontalGap??0,n),C=Y,V=Y,$={width:C,...v?{aspectRatio:w,height:"auto",overflow:"hidden"}:{height:"auto"}},R=v?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},k=s.useRef(null),[T,m]=s.useState(!1),[M,E]=s.useState([]),[z,ne]=s.useState(0),[I,W]=s.useState(0),[K,ae]=s.useState(null),[de,A]=s.useState({title1:"",title2:"",title3:""}),he=(()=>{const X={},ie=k.current?getComputedStyle(k.current).getPropertyValue("--cntrl-article-width").trim():"";return ie&&(X["--cntrl-article-width"]=ie),X})(),q=!n||i||o,ce=s.useMemo(()=>Qf(d),[d]),Q=t??[],be=Q.length%N||N,He=be<N&&Q.length>0,xe=Q.length-be,le=He?Math.floor((N-be)/2)+1:1,ee=s.useMemo(()=>sy(Q),[Q]),ue=s.useMemo(()=>py(Q),[Q]),oe=(X,ie,j)=>{if(n&&!o&&!i)return;const B=ee.findIndex(te=>te.gridIndex===X);if(B<0)return;const J=ee[B];W(B),E(J.items),ne(ie),A(J.entry),ae(j??null),m(!0)},Fe=s.useCallback(()=>{m(!1),ae(null)},[]),Ce=s.useCallback(()=>{const X=ee[I];return!X||!k.current?K:ay(k.current,X.gridIndex,v?"cover":"contain")??K},[ee,I,K,v]),P=s.useCallback(X=>{if(ee.length>1){const ie=ee.length,j=(I+X+ie)%ie,B=ee[j],J=Math.min(z,B.items.length-1);W(j),E(B.items),ne(J),A(B.entry);return}ne(ie=>(ie+X+M.length)%M.length)},[ee,I,z,M.length]),U=ee.length>1||M.length>1;return s.useEffect(()=>{if(!T||typeof document>"u")return;const X=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=X}},[T]),s.useEffect(()=>{!n||o||i||m(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ce}}),a.jsx(my,{mediaList:ue}),a.jsx("div",{ref:k,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${N}, ${Y})`,rowGap:0,columnGap:O,width:D.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:D.scalingValue(u??0,n)},children:Q.map((X,ie)=>{const j=Ks(X.gallery),B=Zs(j),J=B.filter(pe=>pe.lightboxMedia).map(pe=>pe.lightboxMedia),te=Math.floor(ie/N)===Math.ceil(Q.length/N)-1,$e=He&&ie>=xe?`${le+(ie-xe)}`:void 0,ye=B[0],F=ye!=null&&ye.lightboxMedia?J.findIndex(pe=>pe.url===ye.lightboxMedia.url):-1,ve=a.jsx("div",{className:`${d}-item-image-wrapper`,style:$,children:B.length>0&&a.jsx(xy,{media:ye.displayMedia,gridIndex:ie,className:`${d}-item-${ho(ye.displayMedia)?"video":"image"}`.trim(),style:R,onMediaClick:q&&F>=0?pe=>oe(ie,F,Ud(pe.currentTarget,v?"cover":"contain")):void 0})});return a.jsx("div",{className:`${d}-item`,children:a.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,te?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:Y,...$e?{gridColumn:$e}:{}},children:[a.jsx("div",{className:`${d}-item-title-row`,children:a.jsx("div",{style:{height:0,width:V}})}),a.jsx("a",{className:`${d}-item-image-link`,children:ve}),a.jsx("div",{className:`${d}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:V}})})]})},ie)})}),T&&typeof document<"u"&&(()=>{const X=(l?document.getElementById(l):null)??document.body;return Vn.createPortal(a.jsx("div",{style:he,"data-selection":"none",children:a.jsx(wy,{prefix:d,items:M,index:z,entry:de,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:U,lightboxEntries:ee,entryIdx:I,layoutId:r,sourceRect:K,resolveCloseSourceRect:Ce,onClose:Fe,onPrev:()=>P(-1),onNext:()=>P(1)})}),X)})()]})}const $y=`import { CommonComponentProps } from '../props';
7598
+ `}const jl={url:"",name:"",objectFit:"cover"},Ln=500,vo=650,mn="cubic-bezier(0.22, 1, 0.36, 1)",ey=72,ty=50,ny=1e4,iy=650,oy=500;function ry(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 Ud(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=jr(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 ay(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Ud(i,n):null}function sy(e){return e.reduce((t,n,i)=>{const o=Ks(n.gallery),l=Zs(o).filter(d=>d.lightboxMedia).map(d=>d.lightboxMedia);return l.length===0||t.push({gridIndex:i,items:l,entry:{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}),t},[])}function To(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 zl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return To(e,i,n)}const ly=.03;function Yd(e){return e.width*ly}const Ra={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function ur(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Bl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function cy(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ls(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,d=o/r;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const c=r*l;return{width:c,height:r,left:i.left+(o-c)/2,top:i.top}}function dy(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ls(e,t.width,t.height)}function uy(e,t){if(ho(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function py(e){const t=new Set,n=[];for(const i of e){const o=Ks(i.gallery),r=Zs(o);for(const l of r)for(const d of[l.displayMedia,l.lightboxMedia])d!=null&&d.url&&!t.has(d.url)&&(t.add(d.url),n.push(d))}return n}function my({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=>ho(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function to(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=Yd(n);return t==="left"?{left:l+c-i,top:r,width:i,height:o}:{left:l+d-c,top:r,width:i,height:o}}function zr(e,t,n){const i=to(e,t,n);return{...i,left:2*i.left-e.left}}function gy(e,t,n){const{left:i,width:o}=n,r=Yd(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 Kd(e,t,n,i){const o=to(e,"left",i),r=to(e,"right",i),l=zr(e,"left",i),d=zr(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:d,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:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function hy(e,t,n,i){const{start:o,end:r}=Kd(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function fy(e,t,n){const i=to(e,t,n),o=zr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Zd(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 Ks(e){if(!e)return;if(Zd(e))return e;if(!Array.isArray(e))return;const[t,n]=e,i=t!=null&&t.url?t:void 0,o=n!=null&&n.url?n:void 0;if(!(!i&&!o))return[{media:[o??i??jl,i??o??jl]}]}function yy(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function vy(e){const[t]=e.media;return t!=null&&t.url?t:null}function Zs(e){if(!Array.isArray(e)||e.length===0)return[];if(Zd(e)){const t=[];for(const n of e){const i=yy(n);if(!i)continue;const o=vy(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.url?o:null})}return t}return e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function ho(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function xy({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return ho(e)?a.jsx("video",{src:e.url,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.url,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function by({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const d=s.useRef(null);return s.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:c=>c.stopPropagation(),style:o},e)})}function pr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return ho(e)?a.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.url,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.url,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function wy({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:b,sourceRect:v,resolveCloseSourceRect:g,onClose:h,onPrev:f,onNext:x}){const S=s.useRef(null),y=s.useRef(null),w=s.useRef(null),H=s.useRef(new Map),[N,U]=s.useState(0),O=s.useRef(null),C=s.useRef(0),V=s.useRef(0),$=s.useRef("none"),R=s.useRef(!1),k=s.useRef(!1),T=s.useRef(!1),m=s.useRef(null),M=s.useRef(null),E=s.useRef(null),z=s.useRef(()=>{}),ne=s.useRef(null),I=s.useRef(null),W=s.useRef(null),K=s.useRef(!1),[ae,de]=s.useState(null),[A,he]=s.useState(Ra),[q,ce]=s.useState(0),[Q,be]=s.useState("opening"),[He,xe]=s.useState(0),[le,ee]=s.useState(0),[ue,oe]=s.useState(!1),[Fe,Ce]=s.useState(null),[P,Y]=s.useState(null),[X,ie]=s.useState(null),[j,B]=s.useState(!1),[J,te]=s.useState(null),[$e,ye]=s.useState(!1),F=s.useRef(!1),[ve,pe]=s.useState(!1),[Z,me]=s.useState(!1),De=s.useRef(n),ge=s.useRef(void 0),G=t[n],Me=G?ho(G):!1,_e=le!==0||ue,rt=!l&&(!r||!!d),Je=c&&!l,at=u.length>1,it=s.useCallback((_,Ie)=>t.length<=1?null:t[(_+Ie+t.length)%t.length]??null,[t]),je=at?To(u,p,-1):it(n,-1),Se=at?To(u,p,1):it(n,1),We=Fe===-1&&_e?at&&P!==null?To(u,P,-1):X!==null?it(X,-1):null:null,Be=Fe===1&&_e?at&&P!==null?To(u,P,1):X!==null?it(X,1):null:null,Ze=We&&We.url!==(je==null?void 0:je.url)?We:null,Le=Be&&Be.url!==(Se==null?void 0:Se.url)?Be:null,Ve=je&&Je?(()=>{const _=at?zl(u,p,-1):t.length>2?it((n-1+t.length)%t.length,-1):null;return _&&_.url!==je.url?_:null})():null,se=Se&&Je?(()=>{const _=at?zl(u,p,1):t.length>2?it((n+1)%t.length,1):null;return _&&_.url!==Se.url?_:null})():null,Te=Ze??Ve,Xe=Le??se,ze=s.useCallback((_,Ie,Ne)=>{if(!_||!Ie||!Ne)return;const Ge=H.current,dt=Ge.get(_);(dt==null?void 0:dt.width)===Ie&&(dt==null?void 0:dt.height)===Ne||(Ge.set(_,{width:Ie,height:Ne}),U(Ft=>Ft+1))},[]),Re=s.useCallback(_=>{if(!(_!=null&&_.url))return null;const Ie=H.current.get(_.url);return dy(y.current,Ie)},[N,q]),Pe=s.useCallback(()=>{if(!G)return;const _=Re(G);if(_){de(_);return}const Ie=y.current;Ie&&de(Bl(Ie))},[G,Re]),Ae=s.useCallback(_=>{if(at){const Ie=u.length;Y((p+_+Ie)%Ie),ie(null);return}t.length>1&&(ie((n+_+t.length)%t.length),Y(null))},[at,u.length,p,t.length,n]),Ke=s.useCallback(_=>{T.current=_,oe(_)},[]),Oe=s.useCallback(()=>{m.current!==null&&(window.clearTimeout(m.current),m.current=null)},[]),Qe=s.useCallback(()=>{Oe(),m.current=window.setTimeout(()=>{Oe(),Ke(!1)},vo+32)},[Oe,Ke]),tt=s.useCallback(()=>{const _=S.current;if(!_){he({left:0,top:0,width:typeof window<"u"?window.innerWidth:Ra.width,height:typeof window<"u"?window.innerHeight:Ra.height});return}const Ie=_.getBoundingClientRect();he({left:Ie.left,top:Ie.top,width:Ie.width,height:Ie.height})},[]),nt=s.useCallback((_,Ie)=>{if(_e){if(ve&&!ue)return`translate(${le}px, 0px)`;if(ue&&Fe!==null){const Ne=Re(_);if(!Ne)return;const{x:Ge,y:dt}=hy(Ne,Ie,Fe,A);return`translate(${Ge}px, ${dt}px)`}if(ue)return"translate(0px, 0px)"}},[_e,ve,ue,le,Fe,A,Re]),xt=s.useCallback(()=>{const _=M.current;M.current=null,Oe(),Ke(!1),Ce(null),Y(null),ie(null),ee(0),pe(!1),R.current=!1,V.current=0,$.current="none",_===-1?f():_===1&&x()},[Oe,Ke,f,x]),It=s.useCallback(()=>{Oe(),m.current=window.setTimeout(()=>{M.current!==null&&xt()},vo+32)},[Oe,xt]),Tt=s.useCallback(()=>{Oe(),M.current=null,Ke(!1),Ce(null),Y(null),ie(null),ee(0),pe(!1),R.current=!1,V.current=0,$.current="none"},[Oe,Ke]),ut=s.useCallback(_=>{if(!(!Je||!ae)){if(T.current){if(M.current===_){E.current=_,xt();return}Tt()}Oe(),Ae(_),M.current=_,Ce(_),Ke(!0),It()}},[Je,ae,xt,Tt,Oe,Ae,Ke,It]);z.current=ut;const ft=s.useCallback(()=>{ne.current=null,K.current=!1,I.current!==null&&(window.clearInterval(I.current),I.current=null),W.current!==null&&(window.clearTimeout(W.current),W.current=null)},[]),Et=s.useCallback(_=>{I.current!==null&&window.clearInterval(I.current);const Ie=K.current?oy:iy;I.current=window.setInterval(()=>{z.current(_)},Ie)},[]),Lt=s.useCallback(_=>{ne.current!==_&&(ft(),ne.current=_,K.current=!1,z.current(_),Et(_),W.current=window.setTimeout(()=>{W.current=null,ne.current===_&&(K.current=!0,Et(_))},ny))},[ft,Et]),bt=s.useCallback(()=>{const _=y.current;if(!_)return;const Ie=G==null?void 0:G.url,Ne=Ie?H.current.get(Ie):void 0;if(Ne!=null&&Ne.width&&(Ne!=null&&Ne.height)){de(ls(_,Ne.width,Ne.height));return}const Ge=w.current;if(Ge&&Ie&&(Ge.src===Ie||Ge.currentSrc===Ie)){const{width:Ft,height:lt}=cy(Ge);if(Ft&&lt){ze(Ie,Ft,lt),de(ls(_,Ft,lt));return}}const dt=Bl(_);!dt.width||!dt.height||de(dt)},[G==null?void 0:G.url,ze]),Nt=s.useCallback(_=>{if(w.current=_,!!_){if(_ instanceof HTMLVideoElement){_.readyState>=1&&_.videoWidth>0&&bt();return}_.complete&&_.naturalWidth>0&&bt()}},[bt]),Bt=s.useCallback(()=>{tt(),bt(),ce(_=>_+1)},[tt,bt]);s.useEffect(()=>{Bt();const _=y.current,Ie=S.current,Ne=new ResizeObserver(()=>Bt());return _&&Ne.observe(_),Ie&&Ne.observe(Ie),window.addEventListener("resize",Bt),()=>{Ne.disconnect(),window.removeEventListener("resize",Bt)}},[Bt,n,b]),s.useLayoutEffect(()=>{if(!G)return;const _=w.current;if(_){if(_ instanceof HTMLImageElement&&_.complete&&_.naturalWidth>0){bt();return}_ instanceof HTMLVideoElement&&_.readyState>=1&&_.videoWidth>0&&bt()}},[G==null?void 0:G.url,n,bt]),s.useEffect(()=>{Pe()},[Pe,N]),s.useEffect(()=>{const _=new Set,Ie=[],Ne=Ge=>{!(Ge!=null&&Ge.url)||_.has(Ge.url)||(_.add(Ge.url),Ie.push(Ge))};t.forEach(Ne),u.forEach(Ge=>Ge.items.forEach(Ne)),Ie.forEach(Ge=>{H.current.has(Ge.url)||uy(Ge,ze)})},[t,u,ze]),s.useEffect(()=>{if(Q!=="opening"||!ae)return;if(!v){be("open");return}B(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{B(!0),be("open")})});return()=>cancelAnimationFrame(_)},[Q,ae,v]),s.useEffect(()=>{if(Q!=="closing")return;const _=setTimeout(()=>h(),Ln);return()=>clearTimeout(_)},[Q,h]),s.useEffect(()=>()=>{Oe()},[Oe]),s.useLayoutEffect(()=>{De.current===n&&ge.current===(G==null?void 0:G.url)||(Oe(),M.current=null,Ce(null),Y(null),ie(null),xe(0),ee(0),Ke(!1),me(!1),pe(!1),C.current=0,V.current=0,$.current="none",R.current=!1,O.current=null,k.current=!1,w.current=null,Pe(),De.current=n,ge.current=G==null?void 0:G.url)},[n,G==null?void 0:G.url,Ke,Oe,Pe]),s.useLayoutEffect(()=>{const _=E.current;_!==null&&(E.current=null,requestAnimationFrame(()=>{z.current(_)}))},[n,p,G==null?void 0:G.url]),s.useLayoutEffect(()=>{if(Q==="opening"){F.current=!1,ye(!1);return}if(Q!=="open"||F.current)return;if(!je&&!Se){F.current=!0;return}ye(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ye(!0),F.current=!0})});return()=>cancelAnimationFrame(_)},[Q,je==null?void 0:je.url,Se==null?void 0:Se.url]),s.useEffect(()=>{if(Q!=="open")return;const _=()=>{const lt=wt=>{wt.stopPropagation(),wt.preventDefault(),document.removeEventListener("click",lt,!0)};document.addEventListener("click",lt,!0)},Ie=lt=>{const wt=lt<0?1:-1;Oe(),Ae(wt),M.current=wt,Ce(wt),Ke(!0),It()},Ne=lt=>{if(Math.abs(lt)>ty&&Je){Ie(lt);return}M.current=null,Ce(null),Y(null),ie(null),Ke(!0),ee(0),Qe()},Ge=lt=>{if(lt.touches.length!==1||T.current)return;const wt=lt.touches[0];k.current=!0,O.current={x:wt.clientX,y:wt.clientY},$.current="none",V.current=0,R.current=!1},dt=lt=>{if(!O.current||lt.touches.length!==1||T.current)return;const wt=lt.touches[0],zt=wt.clientX-O.current.x,Pt=wt.clientY-O.current.y;if($.current==="none"){if(Math.abs(zt)<10&&Math.abs(Pt)<10)return;if(Math.abs(zt)>Math.abs(Pt)){if(!Je)return;$.current="horizontal"}else if(Pt>0){if(!rt)return;$.current="vertical"}else return}if($.current==="horizontal"){R.current=!0,pe(!0),V.current=zt,ee(zt),lt.preventDefault();return}$.current==="vertical"&&(R.current=!0,pe(!0),C.current=Pt,xe(Pt),lt.preventDefault())},Ft=()=>{if(!O.current)return;const lt=$.current,wt=R.current;if(wt&&lt==="horizontal")Ne(V.current),_();else if(wt&&lt==="vertical"){const zt=C.current;if(rt&&zt>ey){const Pt=window.innerHeight;C.current=Pt,me(!0),xe(Pt),be("closing")}else C.current=0,xe(0);_()}else lt==="horizontal"&&Math.abs(V.current)>0&&(Ne(V.current),_());O.current=null,$.current="none",V.current=0,R.current=!1,pe(!1)};return document.addEventListener("touchstart",Ge,{passive:!0}),document.addEventListener("touchmove",dt,{passive:!1}),document.addEventListener("touchend",Ft),document.addEventListener("touchcancel",Ft),()=>{document.removeEventListener("touchstart",Ge),document.removeEventListener("touchmove",dt),document.removeEventListener("touchend",Ft),document.removeEventListener("touchcancel",Ft)}},[Q,Je,Ke,Qe,Oe,rt,It,Ae]);const Zt=s.useCallback(()=>{const _=(g==null?void 0:g())??v??null;_&&ae&&(te(_),B(!0)),be("closing")},[g,v,ae]);s.useEffect(()=>{const _=Ge=>{if(Ge.key==="Escape"){if(r&&d||Q==="closing")return;ft(),Zt();return}if(Ge.key!=="ArrowLeft"&&Ge.key!=="ArrowRight"||Q!=="open"||!Je)return;Ge.preventDefault();const dt=Ge.key==="ArrowLeft"?-1:1;Ge.repeat&&ne.current===dt||Lt(dt)},Ie=Ge=>{if(Ge.key!=="ArrowLeft"&&Ge.key!=="ArrowRight")return;const dt=Ge.key==="ArrowLeft"?-1:1;ne.current===dt&&ft()},Ne=()=>{ft()};return window.addEventListener("keydown",_),window.addEventListener("keyup",Ie),window.addEventListener("blur",Ne),()=>{window.removeEventListener("keydown",_),window.removeEventListener("keyup",Ie),window.removeEventListener("blur",Ne),ft()}},[Q,r,d,Zt,Je,Lt,ft]),s.useEffect(()=>{Q!=="open"&&ft()},[Q,ft]);const en=()=>{Q==="closing"||l||Zt()},Rt=Q==="open",Ot=Q==="closing",nn=He>0?Math.max(0,1-He/500):1,pt=He>0?Math.max(.35,1-He/500):1,Ee=s.useCallback(_=>{if(!(_.propertyName!=="transform"||!T.current)){if(M.current!==null){xt();return}Oe(),Ke(!1)}},[Oe,Ke,xt]),qe=Q==="closing"?J??v:v,st=qe&&ae&&(Q==="opening"||Ot)?ry(qe,ae):void 0,mt=_e&&G?nt(G,"center"):He>0?`translateY(${He}px)`:st,vt=ae?ur(ae,A):null,Mt=!!(qe&&ae),gt=Mt&&(Q==="closing"||Q==="open"&&j),Vt={position:"absolute",top:vt==null?void 0:vt.top,left:vt==null?void 0:vt.left,width:vt==null?void 0:vt.width,height:vt==null?void 0:vt.height,objectFit:"contain",transformOrigin:"top left",transform:mt,opacity:He>0?pt:Mt?1:Q==="opening"||Ot?0:1,transition:ve&&!ue?"none":ue?`transform ${vo}ms ${mn}`:Z?`transform ${Ln}ms ${mn}, opacity ${Ln}ms ${mn}`:gt?`transform ${Ln}ms ${mn}`:Q==="opening"||Ot?`opacity ${Ln}ms ${mn}`:"none",pointerEvents:Me&&Rt&&!_e?"auto":"none",touchAction:Me&&Rt?"none":void 0,zIndex:1,overflow:Me?"hidden":void 0},Wt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Rt&&!_e?"auto":"none"},_t=(_,Ie,Ne="adjacent")=>{const Ge=Re(_);if(!Ge)return{display:"none"};const dt=Ne==="far"?Ie==="left"?"far-left":"far-right":Ie==="left"?"left-adjacent":"right-adjacent",{start:Ft}=Fe!==null?Kd(Ge,dt,Fe,A):{start:Ne==="far"?zr(Ge,Ie,A):to(Ge,Ie,A)},lt=ur(Ft,A),wt=nt(_,dt),zt=!_e&&Ne==="adjacent"&&Rt&&!$e?fy(Ge,Ie,A):null,Pt=Ne==="far"&&_e&&Fe===(Ie==="left"?-1:1),on=ve&&!ue?!1:ue,pn=Ne==="adjacent"&&Rt&&$e&&!_e;return{position:"absolute",top:lt.top,left:lt.left,width:lt.width,height:lt.height,objectFit:"contain",transform:wt??(zt?`translate(${zt.x}px, ${zt.y}px)`:void 0),opacity:Ne==="far"?Rt&&Pt?1:0:Rt?1:0,transition:on?Ne==="far"?`transform ${vo}ms ${mn}`:`transform ${vo}ms ${mn}, opacity ${Ln}ms ${mn}`:pn?`transform ${Ln}ms ${mn}`:Q==="opening"||Ot?`opacity ${Ln}ms ${mn}`:"none",pointerEvents:"none",zIndex:1}},qt=(_,Ie)=>{const Ne=Re(_);return Ne?gy(to(Ne,Ie,A),Ie,A):null},Xt=_=>Ie=>{if(!l){if(k.current){k.current=!1;return}Ie.stopPropagation(),ut(_)}},Dt=je?qt(je,"left"):null,jt=Se?qt(Se,"right"):null,Ht=Dt?ur(Dt,A):null,$t=jt?ur(jt,A):null;return a.jsxs("div",{ref:S,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:Q==="open"?"none":void 0},onClick:en,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Rt?nn:0,transition:ve?"none":`opacity ${Ln}ms ${mn}`,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:y,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Rt?1:0,transition:ve?"none":`opacity ${Ln}ms ${mn}`,pointerEvents:"none"},children:a.jsx(Xd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:en})})]}),Rt&&Te&&a.jsx(pr,{media:Te,style:_t(Te,"left","far"),onMeasure:ze,onTransitionEnd:Ee},`far-prev-${Te.url}`),Rt&&je&&a.jsxs(a.Fragment,{children:[a.jsx(pr,{media:je,style:_t(je,"left"),onMeasure:ze,onTransitionEnd:Ee},`prev-${je.url}`),Ht&&a.jsx("div",{style:{position:"absolute",top:Ht.top,left:Ht.left,width:Ht.width,height:Ht.height,cursor:l||ve?"default":"pointer",pointerEvents:l||ve?"none":"auto",zIndex:3},onClick:Xt(-1)})]}),Rt&&Se&&a.jsxs(a.Fragment,{children:[a.jsx(pr,{media:Se,style:_t(Se,"right"),onMeasure:ze,onTransitionEnd:Ee},`next-${Se.url}`),$t&&a.jsx("div",{style:{position:"absolute",top:$t.top,left:$t.left,width:$t.width,height:$t.height,cursor:l||ve?"default":"pointer",pointerEvents:l||ve?"none":"auto",zIndex:3},onClick:Xt(1)})]}),Rt&&Xe&&a.jsx(pr,{media:Xe,style:_t(Xe,"right","far"),onMeasure:ze,onTransitionEnd:Ee},`far-next-${Xe.url}`),ae&&G&&(Me?a.jsx(by,{src:G.url,phase:Q,onMediaElement:Nt,wrapperStyle:Vt,videoStyle:Wt,onLoadedMetadata:bt,onTransitionEnd:Ee},`${n}-${G.url}`):a.jsx("img",{ref:Nt,src:G.url,alt:G.name,onLoad:bt,onTransitionEnd:Ee,style:Vt},`${n}-${G.url}`))]})}function Sy({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=D.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:b}=e,v=(b==null?void 0:b.display)==="cover",g=(b==null?void 0:b.ratioValue)??"1:1",h=(b==null?void 0:b.reversed)??!1,[f,x]=g.split(":").map(Number),w=`${h?x:f} / ${h?f:x}`,H=c.entryWidth??.2,N=c.columnsCount,U=D.scalingValue(H,n),O=D.scalingValue(c.horizontalGap??0,n),C=U,V=U,$={width:C,...v?{aspectRatio:w,height:"auto",overflow:"hidden"}:{height:"auto"}},R=v?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},k=s.useRef(null),[T,m]=s.useState(!1),[M,E]=s.useState([]),[z,ne]=s.useState(0),[I,W]=s.useState(0),[K,ae]=s.useState(null),[de,A]=s.useState({title1:"",title2:"",title3:""}),he=(()=>{const X={},ie=k.current?getComputedStyle(k.current).getPropertyValue("--cntrl-article-width").trim():"";return ie&&(X["--cntrl-article-width"]=ie),X})(),q=!n||i||o,ce=s.useMemo(()=>Qf(d),[d]),Q=t??[],be=Q.length%N||N,He=be<N&&Q.length>0,xe=Q.length-be,le=He?Math.floor((N-be)/2)+1:1,ee=s.useMemo(()=>sy(Q),[Q]),ue=s.useMemo(()=>py(Q),[Q]),oe=(X,ie,j)=>{if(n&&!o&&!i)return;const B=ee.findIndex(te=>te.gridIndex===X);if(B<0)return;const J=ee[B];W(B),E(J.items),ne(ie),A(J.entry),ae(j??null),m(!0)},Fe=s.useCallback(()=>{m(!1),ae(null)},[]),Ce=s.useCallback(()=>{const X=ee[I];return!X||!k.current?K:ay(k.current,X.gridIndex,v?"cover":"contain")??K},[ee,I,K,v]),P=s.useCallback(X=>{if(ee.length>1){const ie=ee.length,j=(I+X+ie)%ie,B=ee[j],J=Math.min(z,B.items.length-1);W(j),E(B.items),ne(J),A(B.entry);return}ne(ie=>(ie+X+M.length)%M.length)},[ee,I,z,M.length]),Y=ee.length>1||M.length>1;return s.useEffect(()=>{if(!T||typeof document>"u")return;const X=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=X}},[T]),s.useEffect(()=>{!n||o||i||m(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ce}}),a.jsx(my,{mediaList:ue}),a.jsx("div",{ref:k,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${N}, ${U})`,rowGap:0,columnGap:O,width:D.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:D.scalingValue(u??0,n)},children:Q.map((X,ie)=>{const j=Ks(X.gallery),B=Zs(j),J=B.filter(pe=>pe.lightboxMedia).map(pe=>pe.lightboxMedia),te=Math.floor(ie/N)===Math.ceil(Q.length/N)-1,$e=He&&ie>=xe?`${le+(ie-xe)}`:void 0,ye=B[0],F=ye!=null&&ye.lightboxMedia?J.findIndex(pe=>pe.url===ye.lightboxMedia.url):-1,ve=a.jsx("div",{className:`${d}-item-image-wrapper`,style:$,children:B.length>0&&a.jsx(xy,{media:ye.displayMedia,gridIndex:ie,className:`${d}-item-${ho(ye.displayMedia)?"video":"image"}`.trim(),style:R,onMediaClick:q&&F>=0?pe=>oe(ie,F,Ud(pe.currentTarget,v?"cover":"contain")):void 0})});return a.jsx("div",{className:`${d}-item`,children:a.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,te?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:U,...$e?{gridColumn:$e}:{}},children:[a.jsx("div",{className:`${d}-item-title-row`,children:a.jsx("div",{style:{height:0,width:V}})}),a.jsx("a",{className:`${d}-item-image-link`,children:ve}),a.jsx("div",{className:`${d}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:V}})})]})},ie)})}),T&&typeof document<"u"&&(()=>{const X=(l?document.getElementById(l):null)??document.body;return Vn.createPortal(a.jsx("div",{style:he,"data-selection":"none",children:a.jsx(wy,{prefix:d,items:M,index:z,entry:de,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:Y,lightboxEntries:ee,entryIdx:I,layoutId:r,sourceRect:K,resolveCloseSourceRect:Ce,onClose:Fe,onPrev:()=>P(-1),onNext:()=>P(1)})}),X)})()]})}const $y=`import { CommonComponentProps } from '../props';
7599
7599
  import { scalingValue, useScopedStyles } from '../utils/index';
7600
7600
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
7601
7601
  import { createPortal } from 'react-dom';
@@ -10314,7 +10314,7 @@ a.${e}-list-item {
10314
10314
  overflow-wrap: anywhere;
10315
10315
  word-break: break-word;
10316
10316
  }
10317
- `}const oi=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Js=["AColumn","BColumn","CColumn","DColumn","EColumn"],Dn="cutLabel",Do=[...Js,Dn],la=["A","B","C","D","E"];function Jd(e){return`${e}ColumnVerticalAlign`}const cs=["Top","Center","Bottom"];function Qs(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return la.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function jy(e){const t=Qs(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function zy(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return la.includes(n)?n:null}function Qd(e,t,n){const i=zy(e);return i?i===t?!1:jy(n[Jd(i)]):!0}function jo(e){const t=Qs(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return la.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function By(e,t,n){if(eu(e,t,n))return jo(e);const i=jo(e);return i.kind==="baseline"?{kind:"top"}:i}function Vy(e){const t=jo(e);return t.kind==="baseline"?{kind:"top"}:t}function eu(e,t,n){return Qd(e,n,t)?jo(e).kind==="baseline":!1}function Gy(e){const t={};let n=!1;for(const i of la){const o=Jd(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}Qd(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function qy(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Xy(e){const t=jo(e).kind;return t==="baseline"?"center":t}function Uy(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Yl(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Yy(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 Pa(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=Yy(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const d=r.getBoundingClientRect(),c=o.getBoundingClientRect().height;let u=0;return e.kind==="center"?u=(d.height-c)/2:e.kind==="bottom"&&(u=d.height-c),d.top-t+u+l}function Ky(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 Zy(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Jy={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function At(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Qy={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function ev(e){return[At(e,"textFontFamily"),At(e,"textFontSettings"),{type:"row",items:[At(e,"textFontSize"),At(e,"textLineHeight"),At(e,"textLetterSpacing"),At(e,"textWordSpacing")]},At(e,"textTextAlign"),At(e,"textTextAppearance"),`${e}VerticalAlign`]}function tv(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Do.map(e=>[Qy[e],ev(e)]))}}function Br(e,t){const n=i=>{const o=At(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===Dn?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Kl(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 sn(Yt(n,t))}function Zl(e,t,n,i){const o=Br(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function Jl(e,t,n,i){const o=Br(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:D.scalingValue((r-l)/2,i)}}const xn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],io=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],oo=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],ro=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],nv={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},iv=["hover","focus","filled","success","error"],Ql=.004,Oi=.004,ka=Oi,el=50,zo=1440,Bo=el/zo;function tu(e){const t=typeof e=="number"&&e>0?e:zo;return el/t}function ov(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 zo}const nu={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function Mo(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function rv(e,t=1){const n=t/e;return Object.fromEntries(xn.map(i=>[i,n]))}function av(){return Object.fromEntries([...io.map(e=>[e,0]),...oo.map(e=>[e,0])])}function sv(){return Object.fromEntries(ro.map(e=>[e,0]))}function mr(e){return Object.fromEntries(xn.map(t=>[t,typeof e[t]=="number"?e[t]:nu[t]]))}function iu(e,t,n){const i=e-Bo,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 Fr(e,t,n){const i=tl(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 lv(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=io[o],l=oo[o],d=typeof n[r]=="number"?n[r]:0,c=typeof n[l]=="number"?n[l]:0,u=iu(t[o]??0,d,c);u.paddingLeft!==d&&(i[r]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function tl(e,t,n){if(e<=0)return[];const i=xn.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)+Bo;if(t>=l)return i;const d=[...o];let c=l-t;for(let u=d.length-1;u>=0&&c>0;u-=1){const p=d[u]-Bo;if(p<=0)continue;const b=Math.min(c,p);d[u]-=b,c-=b}return[...d,i[e-1]]}function cv(e,t,n){if(e<=1)return{};const i=tl(e,t,n),o={};for(let r=0;r<e-1;r+=1){const l=xn[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function ec(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...oi]}function dv(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function uv(e,t,n,i){const o=Math.min(i,e.length,xn.length),r={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=xn[c],p=io[c],b=oo[c],v=ro[c],g=xn[l],h=io[l],f=oo[l],x=ro[l],S=n[u],y=n[p],w=n[b],H=n[v];typeof S=="number"&&(r[g]=S),typeof y=="number"&&(r[h]=y),typeof w=="number"&&(r[f]=w),typeof H=="number"&&(r[x]=H)}return r}function ou(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 pv(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=Mo(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...rv(n,o),...av()};if(r)for(const d of ro)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,sv());return ou(e,l)?l:e}function mv(e,t,n){const i=Gy(e);i&&(e={...e,...i});const o=tu(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,d=Mo(e),c=Mo(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:oi.length,b=w=>{if(u)return w;const H=mr({...t,...w}),N=Mo(w),Y=Fr(p,N,H),O=lv(p,Y,{...t,...w});return Object.keys(O).length===0?w:{...w,...O}};if(typeof r=="number"&&r!==l)return e;const v=ec(e),g=ec(t);if(!dv(v,g))return b({...e,...uv(v,g,t,p)});if(d<c&&typeof p=="number"&&!u){const w=mr({...t,...e});return b({...e,...cv(p,d,w)})}if(u){const w=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,H=Math.max(0,(d-o)/2);return w>H?{...e,textPaddingLR:H}:e}const h=mr({...t,...e}),f=Fr(p,c,mr(t)),S=Fr(p,d,h).some((w,H)=>w<(f[H]??w)),y=xn.some(w=>{const H=e[w],N=t[w];return typeof H=="number"&&typeof N=="number"&&H!==N});return S||y?b(e):e}function gv(e,t,n,i){const o=t.slice(0,e).reduce((l,d)=>l+d,0),r=n.slice(e+1,t.length-1).reduce((l,d)=>l+d,0);return Math.max(Bo,i-o-r-Bo)}function hv(e,t){return Math.random()*(t-e)+e}function fv(e){return Object.fromEntries(xn.map(t=>[t,typeof e[t]=="number"?e[t]:nu[t]]))}function Aa(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function yv(e,t,n,i,o,r){return e.slice(0,t).map((l,d)=>{const c=io[d],u=oo[d],p=ro[d];return{key:l,textPrefix:Jy[l],widthKey:xn[d],width:n[xn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:r[p]}})}function vv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,onUpdateSettings:d}){const{prefix:c}=D.useScopedStyles(),u=!!o,{columns:p,type:b,wrapperWidth:v,entriesCount:g,cellMinHeight:h,dividerWidth:f,showVisibility:x,cut:S,showCut:y,cutCellMinHeight:w,cutLabel:H,imageSize:N,imageOnHover:Y,imagePosition:O="cursor",imageInterpolation:C="on",entryHoverEffect:V,entryHoverShowOption:$,rowPaddingTop:R,rowPaddingBottom:k,rowPaddingTopB:T,columnsOrder:m,textPaddingLR:M,textColor:E,backgroundColor:z,dividerColor:ne,textHoverColor:I,backgroundHoverColor:W,dividerHoverColor:K}=e,[ae,de]=s.useState(void 0),[A,he]=s.useState(null),q=s.useRef(null),ce=Y==="on"&&(!n||i),Q=O==="cursor",be=Q&&C==="on",{anchorRef:He,onShow:xe,onCursorMove:le,exit:ee}=Oy(!!(ce&&A!==null),be),ue=(S??0)>0,oe=b==="b",Fe=s.useRef(null),Ce=s.useRef(null),[P,U]=s.useState(null),[X,ie]=s.useState(zo),j=tu(X),B=Math.max(0,((v??0)-j)/2),J=Math.min(M??0,B),te=Math.max(J,Oi),$e=((v??0)+j)/2;s.useLayoutEffect(()=>{if(!n){ie(zo);return}const Ee=()=>{ie(ov(Fe.current))};Ee();const qe=Fe.current;if(!qe)return;const st=new ResizeObserver(Ee);st.observe(qe);let mt=qe;for(;mt&&!mt.style.getPropertyValue("--cntrl-article-width");)mt=mt.parentElement;return mt&&st.observe(mt),()=>st.disconnect()},[n,l]),s.useEffect(()=>{de(void 0)},[S,y,t,g]),s.useEffect(()=>{n&&!i&&de(void 0)},[n,i]);const ye=D.buildColorVars(c,{textColor:E,backgroundColor:z,dividerColor:ne,textHoverColor:I,backgroundHoverColor:W,dividerHoverColor:K},nv,iv),F=r&&r!=="default"?`${c}-state-${r}`:"",pe=`${!n||i?V==="default"?`${c}-entry-hover-default`:V==="blinds"?`${c}-entry-hover-blinds`:V==="reveal"?`${c}-entry-hover-reveal`:"":""} ${F}`.trim(),Z=V==="reveal"&&(!n||i),me=(x==null?void 0:x[0])??!1,De=(x==null?void 0:x[1])??!1,ge=s.useRef(e),G=s.useRef(l);s.useEffect(()=>{if(!d||!n){ge.current=e,G.current=l;return}if(G.current!==l){ge.current=e,G.current=l;return}const Ee=ge.current;if(!(Ee!==e))return;if(typeof Ee.columns=="number"&&typeof e.columns=="number"&&Ee.columns!==e.columns){ge.current=e;return}const st=mv(e,Ee,{designWidth:X});ge.current=e,ou(e,st)&&d(st)},[e,d,n,l,X]);const Me=s.useMemo(()=>fv(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),_e=s.useMemo(()=>Aa(e,io),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),rt=s.useMemo(()=>Aa(e,oo),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Je=s.useMemo(()=>Aa(e,ro),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),at=s.useMemo(()=>Array.isArray(m)&&m.length>0?m:[...oi],[m]),it=s.useMemo(()=>yv(at,p,Me,_e,rt,Je),[at,p,Me,_e,rt,Je]),je=Mo(e),Se=s.useMemo(()=>xn.slice(0,p).map(Ee=>Me[Ee]),[p,Me]),We=s.useMemo(()=>tl(p,je,Me),[p,je,Me]),Be=s.useMemo(()=>Fr(p,je,Me),[p,je,Me]),Ze=s.useMemo(()=>it.map((Ee,qe)=>iu(Be[qe]??0,Ee.paddingLeft,Ee.paddingRight)),[it,Be]),Le=s.useMemo(()=>{const Ee=g===0?1/0:g;return(t??[]).slice(0,Ee).map((st,mt)=>({id:mt,cells:Object.fromEntries(oi.map(vt=>[vt,st[vt]??""])),image:st.image,link:st.link}))},[t,g]),Ve=ue?ae??S:Le.length,se=s.useMemo(()=>ue?Le.slice(0,Ve):Le,[Le,ue,Ve]),Te=ue&&Ve<Le.length,Xe=se.length>1||Te,ze=[me?`${c}-divider-top`:"",De||Xe?`${c}-divider-bottom`:""].filter(Boolean).join(" "),Re=!n||i,Pe=()=>{if(!Re)return;const Ee=ae??S;if(!y){de(Le.length);return}de(Math.min(Ee+y,Le.length))},Ae=Ee=>D.scalingValue(Ee,n??!1),Ke=oe?T??0:R??0,Oe=k??0,Qe=h??0,tt=Math.max(Oe,ka),nt=ql(0,se.length,me,De,Te,f??0,n??!1).borderTopWidth,xt=oe?"rowPaddingTopB":"rowPaddingTop",It=it[0],Tt=it[it.length-1],ut=Ze[0],ft=Ze[Ze.length-1],Et=It&&ut?Math.max(ut.paddingLeft,Oi):0,Lt=Tt&&ft?Math.max(ft.paddingRight,Oi):0,bt=je,Nt=(Ee,qe)=>Hy(O,Fe.current,Q?Ee:null,qe),Bt=(Ee,qe)=>{if(!ce)return;const st=Ee.image;if(!(st!=null&&st.url)){ee(()=>he(null));return}const mt=(N==null?void 0:N.min)??80,vt=(N==null?void 0:N.max)??320,Mt=(A==null?void 0:A.rowId)===Ee.id,gt=Mt?A.widthPx:hv(mt,vt),{x:Vt,y:Wt}=Nt(qe,gt);if(Mt&&Q){le(Vt,Wt);return}he({rowId:Ee.id,url:st.url,objectFit:"contain",isVideo:Ay(st),widthPx:gt}),q.current={x:Vt,y:Wt}},Zt=Ee=>{if(!ce||!A||!Q)return;const{x:qe,y:st}=Nt(Ee,A.widthPx);le(qe,st)},en=()=>{A&&ee(()=>he(null))},Rt=Ee=>{Z&&Vl(Ee,c),!(!ce||!A)&&ee(()=>he(null))},Ot=Ee=>{Z&&Gl(Ee,c)};s.useLayoutEffect(()=>{if(!A||!q.current)return;const{x:Ee,y:qe}=q.current;q.current=null,xe(Ee,qe)},[A==null?void 0:A.rowId,A==null?void 0:A.url,xe]),s.useLayoutEffect(()=>{if(!u||oe){U(null);return}const Ee=Ce.current,qe=Ee==null?void 0:Ee.parentElement;if(!Ee||!qe){U(null);return}const st=()=>{const vt=Ee.querySelector("[data-list-row]");if(!vt){U(null);return}const Mt=qe.getBoundingClientRect(),gt=vt.getBoundingClientRect();U(gt.top-Mt.top+gt.height/2)};st();const mt=new ResizeObserver(st);return mt.observe(Ee),mt.observe(qe),()=>mt.disconnect()},[u,oe,se,Ke,Oe,Qe,t,e,it,Be,X,f,me,De,Te]);const nn=s.useMemo(()=>!oe&&Js.some(Ee=>{const qe=Ee.charAt(0),st=e[`${Ee}VerticalAlign`];return eu(st,e,qe)}),[oe,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var Vt;const Ee=Fe.current;if(!Ee)return;const qe=()=>{Ee.querySelectorAll("[data-list-col]").forEach(Wt=>{Wt.style.transform="";const _t=Wt.querySelector(`.${c}-list-col`);_t&&(_t.style.minHeight="",_t.style.height="");const qt=Wt.querySelector(`.${c}-list-col-title`);qt&&(qt.style.transform="")})};if(oe||!nn){qe();return}const st=()=>{const Wt=Array.from(Ee.querySelectorAll("[data-list-row]")),_t=`${c}-list-col`,qt=`${c}-baseline-probe`;Wt.forEach(Xt=>{Xt.querySelectorAll("[data-list-col]").forEach(Dt=>{Dt.style.transform="";const jt=Dt.querySelector(`.${_t}`);jt&&(jt.style.minHeight="",jt.style.height="");const Ht=Dt.querySelector(`.${c}-list-col-title`);Ht&&(Ht.style.transform="")})}),Wt.forEach(Xt=>{const Dt=Array.from(Xt.querySelectorAll("[data-list-col]"));Ky(Xt,Dt,_t)}),Ee.offsetHeight,Wt.forEach(Xt=>{const Dt=Array.from(Xt.querySelectorAll("[data-list-col]")),jt=Xt.getBoundingClientRect().top,Ht=new Map,$t=Dt.map(Ne=>{const Ge=Ne.querySelector(`.${c}-list-col-title`),dt={el:Ne,titleEl:Ge,letter:Ne.getAttribute("data-col-letter")??"",kind:Ne.getAttribute("data-valign")??"top",anchor:Ne.getAttribute("data-valign-anchor")};return Ht.set(dt.letter,dt),dt}),_=new Map,Ie=(Ne,Ge)=>{const dt=_.get(Ne.letter);if(dt!==void 0)return dt;const Ft=Ne.anchor?Ht.get(Ne.anchor):void 0;if(Ne.kind!=="baseline"||!Ft||Ge.has(Ne.letter)){const on=Pa(Ne,jt,_t,qt);return _.set(Ne.letter,on),on}Ge.add(Ne.letter);const lt=Ie(Ft,Ge);Ge.delete(Ne.letter);const wt=Pa(Ne,jt,_t,qt),zt=lt-wt;Zy(Ne.titleEl,zt);const Pt=Pa(Ne,jt,_t,qt);return _.set(Ne.letter,Pt),Pt};$t.forEach(Ne=>Ie(Ne,new Set))})};let mt=null;const vt=()=>{mt===null&&(mt=requestAnimationFrame(()=>{mt=null,st()}))};st();const Mt=new ResizeObserver(()=>vt());Mt.observe(Ee);let gt=!1;return typeof document<"u"&&((Vt=document.fonts)!=null&&Vt.ready)&&document.fonts.ready.then(()=>{gt||vt()}),()=>{gt=!0,mt!==null&&(cancelAnimationFrame(mt),mt=null),Mt.disconnect(),qe()}},[nn,oe,e,t,X,se,Be]);const pt=s.useMemo(()=>Dy(c),[c]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:pt}}),a.jsx("div",{style:ye,children:a.jsxs("div",{ref:Fe,className:`${c}-wrapper ${pe}${ze?` ${ze}`:""}${oe?` ${c}-type-b`:""}`.trim(),style:{width:D.scalingValue(v??0,n)},onMouseMove:ce?Zt:void 0,onMouseLeave:ce?en:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[se.map((Ee,qe)=>{var Mt;const st=(((Mt=Ee.link)==null?void 0:Mt.length)??0)>0,mt=st&&(!n||i)?"a":"div",vt=ql(qe,se.length,me,De,Te,f??0,n??!1);return a.jsxs(mt,{ref:qe===0?gt=>{Ce.current=gt}:void 0,className:`${c}-list-item${st||$==="always"?` ${c}-list-item-has-link`:""}${Te&&qe===se.length-1?` ${c}-list-item-before-cut`:""}`,...st?{href:Ee.link,target:"_blank"}:{},style:vt,onMouseEnter:gt=>{Z&&(st||$==="always")&&Vl(gt,c),ce&&Bt(Ee,gt)},onMouseLeave:gt=>{Z&&(st||$==="always")&&Gl(gt,c)},children:[Ke>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ae(Ke)}}),a.jsxs("div",{className:`${c}-list-cols-row${oe?"":` ${c}-list-cols-row-h`}${u&&qe===0&&oe?` ${c}-list-cols-row-controls`:""}`,...oe?{}:{"data-list-row":""},style:oe?void 0:{minHeight:Ae(Qe)},children:[it.map((gt,Vt)=>{const Wt=Vt===it.length-1,_t=Ze[Vt],qt=gt.paddingBottom,Xt=_y(Ee.cells[gt.key]),Dt=oe&&Xt&&qt>0,jt=oe?{minHeight:Ae(Qe)}:{width:Ae(Be[Vt])},Ht=oe?{paddingLeft:Ae(J),paddingRight:Ae(J)}:{paddingLeft:Ae(_t.paddingLeft),paddingRight:Ae(_t.paddingRight)},$t=gt.textPrefix.charAt(0),_=oe?Vy(e[`${gt.textPrefix}VerticalAlign`]):By(e[`${gt.textPrefix}VerticalAlign`],e,$t),Ie=oe&&Xt&&u&&qe===0;return oe&&!Xt?null:a.jsxs("div",{className:oe?`${c}-list-col-wrap`:void 0,...oe?{}:{"data-list-col":"","data-col-letter":$t,"data-valign":_.kind,..._.kind==="baseline"?{"data-valign-anchor":_.anchorLetter}:{}},children:[a.jsx("div",{className:`${c}-list-col${Wt?` ${c}-list-col-last`:""}`,style:{...Ht,...jt,...oe?{justifyContent:Yl(_.kind)}:{}},"data-test":gt.width,children:a.jsx("span",{className:Zl(e,gt.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Kl(Br(e,gt.textPrefix),n),...Jl(e,gt.textPrefix,c,n),...oe?{}:qy(_.kind)},children:Ee.cells[gt.key]??null})}),Dt&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ae(qt)}}),Ie&&a.jsx("div",{"data-controls":gt.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:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Ae(Math.max(qt,ka))}})]},gt.key)}),u&&qe===0&&oe&&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($e),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:Ae(te),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($e),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:Ae(Math.max(te,je-te)),width:Ae(te),height:"100%"}})]})]}),!oe&&Oe>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ae(Oe)}}),u&&qe===0&&!oe&&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:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Ae(tt)}})]},Ee.id)}),u&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":xt,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":oe?"center":"left-y",className:`${c}-control-anchor`,style:{top:nt,left:0,width:"100%",height:Ae(Math.max(Ke,ka))}})},"row-padding-handles"),u&&!oe&&It&&Tt&&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(Be[0]-((ut==null?void 0:ut.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":P??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:Ae(Et),height:"100%"}}),a.jsx("div",{"data-controls":Tt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Be[it.length-1]-((ft==null?void 0:ft.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":P??void 0,className:`${c}-control-anchor`,style:{top:0,left:Ae(bt-Lt),width:Ae(Lt),height:"100%"}})]},"column-edge-padding-handles"),u&&!oe&&it.slice(0,-1).map((Ee,qe)=>{const st=it[qe+1],mt=We.slice(0,qe+1).reduce((Wt,_t)=>Wt+_t,0),vt=Ze[qe],Mt=Ze[qe+1],gt=Math.max(vt.paddingRight,Oi),Vt=Math.max(Mt.paddingLeft,Oi);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Ee.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Be[qe]-vt.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":P??void 0,className:`${c}-control-anchor`,style:{top:0,left:Ae(mt-gt),width:Ae(gt),height:"100%"}}),a.jsx("div",{"data-controls":st.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Be[qe+1]-Mt.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":P??void 0,className:`${c}-control-anchor`,style:{top:0,left:Ae(mt),width:Ae(Vt),height:"100%"}})]},`${Ee.paddingRightKey}-padding`)}),u&&!oe&&it.slice(0,-1).map((Ee,qe)=>{const st=gv(qe,We,Se,je),vt=We.slice(0,qe+1).reduce((Mt,gt)=>Mt+gt,0)-Ql/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Ee.widthKey,"data-controls-axis":"x","data-controls-min":String(el),"data-controls-max-fraction":String(st),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Ae(vt),width:Ae(Ql),height:"calc(100%)",pointerEvents:"auto"}})},`${Ee.widthKey}-junction`)})]}),Te&&(()=>{const Ee=Br(e,Dn),qe=Xy(e.cutLabelVerticalAlign),st=Ee.textTextAlign==="justify"||oe;return a.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Ae(w??0),cursor:Re?"pointer":"default",...Wy(De,f??0,n??!1)},onClick:Re?Pe:void 0,onMouseEnter:Z||ce?Rt:void 0,onMouseLeave:Z?Ot:void 0,children:a.jsx("div",{className:`${c}-list-cols-row`,style:{...oe?{paddingLeft:Ae(J),paddingRight:Ae(J)}:{},justifyContent:Uy(Ee.textTextAlign),alignItems:Yl(qe)},children:a.jsx("span",{className:Zl(e,Dn,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Kl(Ee,n),...Jl(e,Dn,c,n),...st?{width:"100%"}:{}},children:H})})})})(),ce&&A&&(()=>{const Ee=`${A.widthPx}px`,qe={width:Ee,height:"auto",maxHeight:Ee,objectFit:"contain"};return a.jsx("div",{ref:He,className:`${c}-hover-media-anchor`,children:a.jsx(Fy,{media:A,className:A.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:qe},`${A.rowId}-${A.url}`)})})()]})})]})}const xv=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
10317
+ `}const oi=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Js=["AColumn","BColumn","CColumn","DColumn","EColumn"],Dn="cutLabel",Do=[...Js,Dn],la=["A","B","C","D","E"];function Jd(e){return`${e}ColumnVerticalAlign`}const cs=["Top","Center","Bottom"];function Qs(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return la.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function jy(e){const t=Qs(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function zy(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return la.includes(n)?n:null}function Qd(e,t,n){const i=zy(e);return i?i===t?!1:jy(n[Jd(i)]):!0}function jo(e){const t=Qs(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return la.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function By(e,t,n){if(eu(e,t,n))return jo(e);const i=jo(e);return i.kind==="baseline"?{kind:"top"}:i}function Vy(e){const t=jo(e);return t.kind==="baseline"?{kind:"top"}:t}function eu(e,t,n){return Qd(e,n,t)?jo(e).kind==="baseline":!1}function Gy(e){const t={};let n=!1;for(const i of la){const o=Jd(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}Qd(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function qy(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Xy(e){const t=jo(e).kind;return t==="baseline"?"center":t}function Uy(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Yl(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Yy(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 Pa(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=Yy(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const d=r.getBoundingClientRect(),c=o.getBoundingClientRect().height;let u=0;return e.kind==="center"?u=(d.height-c)/2:e.kind==="bottom"&&(u=d.height-c),d.top-t+u+l}function Ky(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 Zy(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Jy={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function At(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Qy={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function ev(e){return[At(e,"textFontFamily"),At(e,"textFontSettings"),{type:"row",items:[At(e,"textFontSize"),At(e,"textLineHeight"),At(e,"textLetterSpacing"),At(e,"textWordSpacing")]},At(e,"textTextAlign"),At(e,"textTextAppearance"),`${e}VerticalAlign`]}function tv(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Do.map(e=>[Qy[e],ev(e)]))}}function Br(e,t){const n=i=>{const o=At(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===Dn?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Kl(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 sn(Yt(n,t))}function Zl(e,t,n,i){const o=Br(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function Jl(e,t,n,i){const o=Br(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:D.scalingValue((r-l)/2,i)}}const xn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],io=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],oo=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],ro=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],nv={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},iv=["hover","focus","filled","success","error"],Ql=.004,Oi=.004,ka=Oi,el=50,zo=1440,Bo=el/zo;function tu(e){const t=typeof e=="number"&&e>0?e:zo;return el/t}function ov(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 zo}const nu={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function Mo(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function rv(e,t=1){const n=t/e;return Object.fromEntries(xn.map(i=>[i,n]))}function av(){return Object.fromEntries([...io.map(e=>[e,0]),...oo.map(e=>[e,0])])}function sv(){return Object.fromEntries(ro.map(e=>[e,0]))}function mr(e){return Object.fromEntries(xn.map(t=>[t,typeof e[t]=="number"?e[t]:nu[t]]))}function iu(e,t,n){const i=e-Bo,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 Fr(e,t,n){const i=tl(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 lv(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=io[o],l=oo[o],d=typeof n[r]=="number"?n[r]:0,c=typeof n[l]=="number"?n[l]:0,u=iu(t[o]??0,d,c);u.paddingLeft!==d&&(i[r]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function tl(e,t,n){if(e<=0)return[];const i=xn.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)+Bo;if(t>=l)return i;const d=[...o];let c=l-t;for(let u=d.length-1;u>=0&&c>0;u-=1){const p=d[u]-Bo;if(p<=0)continue;const b=Math.min(c,p);d[u]-=b,c-=b}return[...d,i[e-1]]}function cv(e,t,n){if(e<=1)return{};const i=tl(e,t,n),o={};for(let r=0;r<e-1;r+=1){const l=xn[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function ec(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...oi]}function dv(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function uv(e,t,n,i){const o=Math.min(i,e.length,xn.length),r={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=xn[c],p=io[c],b=oo[c],v=ro[c],g=xn[l],h=io[l],f=oo[l],x=ro[l],S=n[u],y=n[p],w=n[b],H=n[v];typeof S=="number"&&(r[g]=S),typeof y=="number"&&(r[h]=y),typeof w=="number"&&(r[f]=w),typeof H=="number"&&(r[x]=H)}return r}function ou(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 pv(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=Mo(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...rv(n,o),...av()};if(r)for(const d of ro)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,sv());return ou(e,l)?l:e}function mv(e,t,n){const i=Gy(e);i&&(e={...e,...i});const o=tu(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,d=Mo(e),c=Mo(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:oi.length,b=w=>{if(u)return w;const H=mr({...t,...w}),N=Mo(w),U=Fr(p,N,H),O=lv(p,U,{...t,...w});return Object.keys(O).length===0?w:{...w,...O}};if(typeof r=="number"&&r!==l)return e;const v=ec(e),g=ec(t);if(!dv(v,g))return b({...e,...uv(v,g,t,p)});if(d<c&&typeof p=="number"&&!u){const w=mr({...t,...e});return b({...e,...cv(p,d,w)})}if(u){const w=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,H=Math.max(0,(d-o)/2);return w>H?{...e,textPaddingLR:H}:e}const h=mr({...t,...e}),f=Fr(p,c,mr(t)),S=Fr(p,d,h).some((w,H)=>w<(f[H]??w)),y=xn.some(w=>{const H=e[w],N=t[w];return typeof H=="number"&&typeof N=="number"&&H!==N});return S||y?b(e):e}function gv(e,t,n,i){const o=t.slice(0,e).reduce((l,d)=>l+d,0),r=n.slice(e+1,t.length-1).reduce((l,d)=>l+d,0);return Math.max(Bo,i-o-r-Bo)}function hv(e,t){return Math.random()*(t-e)+e}function fv(e){return Object.fromEntries(xn.map(t=>[t,typeof e[t]=="number"?e[t]:nu[t]]))}function Aa(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function yv(e,t,n,i,o,r){return e.slice(0,t).map((l,d)=>{const c=io[d],u=oo[d],p=ro[d];return{key:l,textPrefix:Jy[l],widthKey:xn[d],width:n[xn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:r[p]}})}function vv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,onUpdateSettings:d}){const{prefix:c}=D.useScopedStyles(),u=!!o,{columns:p,type:b,wrapperWidth:v,entriesCount:g,cellMinHeight:h,dividerWidth:f,showVisibility:x,cut:S,showCut:y,cutCellMinHeight:w,cutLabel:H,imageSize:N,imageOnHover:U,imagePosition:O="cursor",imageInterpolation:C="on",entryHoverEffect:V,entryHoverShowOption:$,rowPaddingTop:R,rowPaddingBottom:k,rowPaddingTopB:T,columnsOrder:m,textPaddingLR:M,textColor:E,backgroundColor:z,dividerColor:ne,textHoverColor:I,backgroundHoverColor:W,dividerHoverColor:K}=e,[ae,de]=s.useState(void 0),[A,he]=s.useState(null),q=s.useRef(null),ce=U==="on"&&(!n||i),Q=O==="cursor",be=Q&&C==="on",{anchorRef:He,onShow:xe,onCursorMove:le,exit:ee}=Oy(!!(ce&&A!==null),be),ue=(S??0)>0,oe=b==="b",Fe=s.useRef(null),Ce=s.useRef(null),[P,Y]=s.useState(null),[X,ie]=s.useState(zo),j=tu(X),B=Math.max(0,((v??0)-j)/2),J=Math.min(M??0,B),te=Math.max(J,Oi),$e=((v??0)+j)/2;s.useLayoutEffect(()=>{if(!n){ie(zo);return}const Ee=()=>{ie(ov(Fe.current))};Ee();const qe=Fe.current;if(!qe)return;const st=new ResizeObserver(Ee);st.observe(qe);let mt=qe;for(;mt&&!mt.style.getPropertyValue("--cntrl-article-width");)mt=mt.parentElement;return mt&&st.observe(mt),()=>st.disconnect()},[n,l]),s.useEffect(()=>{de(void 0)},[S,y,t,g]),s.useEffect(()=>{n&&!i&&de(void 0)},[n,i]);const ye=D.buildColorVars(c,{textColor:E,backgroundColor:z,dividerColor:ne,textHoverColor:I,backgroundHoverColor:W,dividerHoverColor:K},nv,iv),F=r&&r!=="default"?`${c}-state-${r}`:"",pe=`${!n||i?V==="default"?`${c}-entry-hover-default`:V==="blinds"?`${c}-entry-hover-blinds`:V==="reveal"?`${c}-entry-hover-reveal`:"":""} ${F}`.trim(),Z=V==="reveal"&&(!n||i),me=(x==null?void 0:x[0])??!1,De=(x==null?void 0:x[1])??!1,ge=s.useRef(e),G=s.useRef(l);s.useEffect(()=>{if(!d||!n){ge.current=e,G.current=l;return}if(G.current!==l){ge.current=e,G.current=l;return}const Ee=ge.current;if(!(Ee!==e))return;if(typeof Ee.columns=="number"&&typeof e.columns=="number"&&Ee.columns!==e.columns){ge.current=e;return}const st=mv(e,Ee,{designWidth:X});ge.current=e,ou(e,st)&&d(st)},[e,d,n,l,X]);const Me=s.useMemo(()=>fv(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),_e=s.useMemo(()=>Aa(e,io),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),rt=s.useMemo(()=>Aa(e,oo),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Je=s.useMemo(()=>Aa(e,ro),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),at=s.useMemo(()=>Array.isArray(m)&&m.length>0?m:[...oi],[m]),it=s.useMemo(()=>yv(at,p,Me,_e,rt,Je),[at,p,Me,_e,rt,Je]),je=Mo(e),Se=s.useMemo(()=>xn.slice(0,p).map(Ee=>Me[Ee]),[p,Me]),We=s.useMemo(()=>tl(p,je,Me),[p,je,Me]),Be=s.useMemo(()=>Fr(p,je,Me),[p,je,Me]),Ze=s.useMemo(()=>it.map((Ee,qe)=>iu(Be[qe]??0,Ee.paddingLeft,Ee.paddingRight)),[it,Be]),Le=s.useMemo(()=>{const Ee=g===0?1/0:g;return(t??[]).slice(0,Ee).map((st,mt)=>({id:mt,cells:Object.fromEntries(oi.map(vt=>[vt,st[vt]??""])),image:st.image,link:st.link}))},[t,g]),Ve=ue?ae??S:Le.length,se=s.useMemo(()=>ue?Le.slice(0,Ve):Le,[Le,ue,Ve]),Te=ue&&Ve<Le.length,Xe=se.length>1||Te,ze=[me?`${c}-divider-top`:"",De||Xe?`${c}-divider-bottom`:""].filter(Boolean).join(" "),Re=!n||i,Pe=()=>{if(!Re)return;const Ee=ae??S;if(!y){de(Le.length);return}de(Math.min(Ee+y,Le.length))},Ae=Ee=>D.scalingValue(Ee,n??!1),Ke=oe?T??0:R??0,Oe=k??0,Qe=h??0,tt=Math.max(Oe,ka),nt=ql(0,se.length,me,De,Te,f??0,n??!1).borderTopWidth,xt=oe?"rowPaddingTopB":"rowPaddingTop",It=it[0],Tt=it[it.length-1],ut=Ze[0],ft=Ze[Ze.length-1],Et=It&&ut?Math.max(ut.paddingLeft,Oi):0,Lt=Tt&&ft?Math.max(ft.paddingRight,Oi):0,bt=je,Nt=(Ee,qe)=>Hy(O,Fe.current,Q?Ee:null,qe),Bt=(Ee,qe)=>{if(!ce)return;const st=Ee.image;if(!(st!=null&&st.url)){ee(()=>he(null));return}const mt=(N==null?void 0:N.min)??80,vt=(N==null?void 0:N.max)??320,Mt=(A==null?void 0:A.rowId)===Ee.id,gt=Mt?A.widthPx:hv(mt,vt),{x:Vt,y:Wt}=Nt(qe,gt);if(Mt&&Q){le(Vt,Wt);return}he({rowId:Ee.id,url:st.url,objectFit:"contain",isVideo:Ay(st),widthPx:gt}),q.current={x:Vt,y:Wt}},Zt=Ee=>{if(!ce||!A||!Q)return;const{x:qe,y:st}=Nt(Ee,A.widthPx);le(qe,st)},en=()=>{A&&ee(()=>he(null))},Rt=Ee=>{Z&&Vl(Ee,c),!(!ce||!A)&&ee(()=>he(null))},Ot=Ee=>{Z&&Gl(Ee,c)};s.useLayoutEffect(()=>{if(!A||!q.current)return;const{x:Ee,y:qe}=q.current;q.current=null,xe(Ee,qe)},[A==null?void 0:A.rowId,A==null?void 0:A.url,xe]),s.useLayoutEffect(()=>{if(!u||oe){Y(null);return}const Ee=Ce.current,qe=Ee==null?void 0:Ee.parentElement;if(!Ee||!qe){Y(null);return}const st=()=>{const vt=Ee.querySelector("[data-list-row]");if(!vt){Y(null);return}const Mt=qe.getBoundingClientRect(),gt=vt.getBoundingClientRect();Y(gt.top-Mt.top+gt.height/2)};st();const mt=new ResizeObserver(st);return mt.observe(Ee),mt.observe(qe),()=>mt.disconnect()},[u,oe,se,Ke,Oe,Qe,t,e,it,Be,X,f,me,De,Te]);const nn=s.useMemo(()=>!oe&&Js.some(Ee=>{const qe=Ee.charAt(0),st=e[`${Ee}VerticalAlign`];return eu(st,e,qe)}),[oe,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var Vt;const Ee=Fe.current;if(!Ee)return;const qe=()=>{Ee.querySelectorAll("[data-list-col]").forEach(Wt=>{Wt.style.transform="";const _t=Wt.querySelector(`.${c}-list-col`);_t&&(_t.style.minHeight="",_t.style.height="");const qt=Wt.querySelector(`.${c}-list-col-title`);qt&&(qt.style.transform="")})};if(oe||!nn){qe();return}const st=()=>{const Wt=Array.from(Ee.querySelectorAll("[data-list-row]")),_t=`${c}-list-col`,qt=`${c}-baseline-probe`;Wt.forEach(Xt=>{Xt.querySelectorAll("[data-list-col]").forEach(Dt=>{Dt.style.transform="";const jt=Dt.querySelector(`.${_t}`);jt&&(jt.style.minHeight="",jt.style.height="");const Ht=Dt.querySelector(`.${c}-list-col-title`);Ht&&(Ht.style.transform="")})}),Wt.forEach(Xt=>{const Dt=Array.from(Xt.querySelectorAll("[data-list-col]"));Ky(Xt,Dt,_t)}),Ee.offsetHeight,Wt.forEach(Xt=>{const Dt=Array.from(Xt.querySelectorAll("[data-list-col]")),jt=Xt.getBoundingClientRect().top,Ht=new Map,$t=Dt.map(Ne=>{const Ge=Ne.querySelector(`.${c}-list-col-title`),dt={el:Ne,titleEl:Ge,letter:Ne.getAttribute("data-col-letter")??"",kind:Ne.getAttribute("data-valign")??"top",anchor:Ne.getAttribute("data-valign-anchor")};return Ht.set(dt.letter,dt),dt}),_=new Map,Ie=(Ne,Ge)=>{const dt=_.get(Ne.letter);if(dt!==void 0)return dt;const Ft=Ne.anchor?Ht.get(Ne.anchor):void 0;if(Ne.kind!=="baseline"||!Ft||Ge.has(Ne.letter)){const on=Pa(Ne,jt,_t,qt);return _.set(Ne.letter,on),on}Ge.add(Ne.letter);const lt=Ie(Ft,Ge);Ge.delete(Ne.letter);const wt=Pa(Ne,jt,_t,qt),zt=lt-wt;Zy(Ne.titleEl,zt);const Pt=Pa(Ne,jt,_t,qt);return _.set(Ne.letter,Pt),Pt};$t.forEach(Ne=>Ie(Ne,new Set))})};let mt=null;const vt=()=>{mt===null&&(mt=requestAnimationFrame(()=>{mt=null,st()}))};st();const Mt=new ResizeObserver(()=>vt());Mt.observe(Ee);let gt=!1;return typeof document<"u"&&((Vt=document.fonts)!=null&&Vt.ready)&&document.fonts.ready.then(()=>{gt||vt()}),()=>{gt=!0,mt!==null&&(cancelAnimationFrame(mt),mt=null),Mt.disconnect(),qe()}},[nn,oe,e,t,X,se,Be]);const pt=s.useMemo(()=>Dy(c),[c]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:pt}}),a.jsx("div",{style:ye,children:a.jsxs("div",{ref:Fe,className:`${c}-wrapper ${pe}${ze?` ${ze}`:""}${oe?` ${c}-type-b`:""}`.trim(),style:{width:D.scalingValue(v??0,n)},onMouseMove:ce?Zt:void 0,onMouseLeave:ce?en:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[se.map((Ee,qe)=>{var Mt;const st=(((Mt=Ee.link)==null?void 0:Mt.length)??0)>0,mt=st&&(!n||i)?"a":"div",vt=ql(qe,se.length,me,De,Te,f??0,n??!1);return a.jsxs(mt,{ref:qe===0?gt=>{Ce.current=gt}:void 0,className:`${c}-list-item${st||$==="always"?` ${c}-list-item-has-link`:""}${Te&&qe===se.length-1?` ${c}-list-item-before-cut`:""}`,...st?{href:Ee.link,target:"_blank"}:{},style:vt,onMouseEnter:gt=>{Z&&(st||$==="always")&&Vl(gt,c),ce&&Bt(Ee,gt)},onMouseLeave:gt=>{Z&&(st||$==="always")&&Gl(gt,c)},children:[Ke>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ae(Ke)}}),a.jsxs("div",{className:`${c}-list-cols-row${oe?"":` ${c}-list-cols-row-h`}${u&&qe===0&&oe?` ${c}-list-cols-row-controls`:""}`,...oe?{}:{"data-list-row":""},style:oe?void 0:{minHeight:Ae(Qe)},children:[it.map((gt,Vt)=>{const Wt=Vt===it.length-1,_t=Ze[Vt],qt=gt.paddingBottom,Xt=_y(Ee.cells[gt.key]),Dt=oe&&Xt&&qt>0,jt=oe?{minHeight:Ae(Qe)}:{width:Ae(Be[Vt])},Ht=oe?{paddingLeft:Ae(J),paddingRight:Ae(J)}:{paddingLeft:Ae(_t.paddingLeft),paddingRight:Ae(_t.paddingRight)},$t=gt.textPrefix.charAt(0),_=oe?Vy(e[`${gt.textPrefix}VerticalAlign`]):By(e[`${gt.textPrefix}VerticalAlign`],e,$t),Ie=oe&&Xt&&u&&qe===0;return oe&&!Xt?null:a.jsxs("div",{className:oe?`${c}-list-col-wrap`:void 0,...oe?{}:{"data-list-col":"","data-col-letter":$t,"data-valign":_.kind,..._.kind==="baseline"?{"data-valign-anchor":_.anchorLetter}:{}},children:[a.jsx("div",{className:`${c}-list-col${Wt?` ${c}-list-col-last`:""}`,style:{...Ht,...jt,...oe?{justifyContent:Yl(_.kind)}:{}},"data-test":gt.width,children:a.jsx("span",{className:Zl(e,gt.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Kl(Br(e,gt.textPrefix),n),...Jl(e,gt.textPrefix,c,n),...oe?{}:qy(_.kind)},children:Ee.cells[gt.key]??null})}),Dt&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ae(qt)}}),Ie&&a.jsx("div",{"data-controls":gt.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:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Ae(Math.max(qt,ka))}})]},gt.key)}),u&&qe===0&&oe&&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($e),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:Ae(te),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($e),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:Ae(Math.max(te,je-te)),width:Ae(te),height:"100%"}})]})]}),!oe&&Oe>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ae(Oe)}}),u&&qe===0&&!oe&&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:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Ae(tt)}})]},Ee.id)}),u&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":xt,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":oe?"center":"left-y",className:`${c}-control-anchor`,style:{top:nt,left:0,width:"100%",height:Ae(Math.max(Ke,ka))}})},"row-padding-handles"),u&&!oe&&It&&Tt&&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(Be[0]-((ut==null?void 0:ut.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":P??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:Ae(Et),height:"100%"}}),a.jsx("div",{"data-controls":Tt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Be[it.length-1]-((ft==null?void 0:ft.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":P??void 0,className:`${c}-control-anchor`,style:{top:0,left:Ae(bt-Lt),width:Ae(Lt),height:"100%"}})]},"column-edge-padding-handles"),u&&!oe&&it.slice(0,-1).map((Ee,qe)=>{const st=it[qe+1],mt=We.slice(0,qe+1).reduce((Wt,_t)=>Wt+_t,0),vt=Ze[qe],Mt=Ze[qe+1],gt=Math.max(vt.paddingRight,Oi),Vt=Math.max(Mt.paddingLeft,Oi);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Ee.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Be[qe]-vt.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":P??void 0,className:`${c}-control-anchor`,style:{top:0,left:Ae(mt-gt),width:Ae(gt),height:"100%"}}),a.jsx("div",{"data-controls":st.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Be[qe+1]-Mt.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":P??void 0,className:`${c}-control-anchor`,style:{top:0,left:Ae(mt),width:Ae(Vt),height:"100%"}})]},`${Ee.paddingRightKey}-padding`)}),u&&!oe&&it.slice(0,-1).map((Ee,qe)=>{const st=gv(qe,We,Se,je),vt=We.slice(0,qe+1).reduce((Mt,gt)=>Mt+gt,0)-Ql/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Ee.widthKey,"data-controls-axis":"x","data-controls-min":String(el),"data-controls-max-fraction":String(st),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Ae(vt),width:Ae(Ql),height:"calc(100%)",pointerEvents:"auto"}})},`${Ee.widthKey}-junction`)})]}),Te&&(()=>{const Ee=Br(e,Dn),qe=Xy(e.cutLabelVerticalAlign),st=Ee.textTextAlign==="justify"||oe;return a.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Ae(w??0),cursor:Re?"pointer":"default",...Wy(De,f??0,n??!1)},onClick:Re?Pe:void 0,onMouseEnter:Z||ce?Rt:void 0,onMouseLeave:Z?Ot:void 0,children:a.jsx("div",{className:`${c}-list-cols-row`,style:{...oe?{paddingLeft:Ae(J),paddingRight:Ae(J)}:{},justifyContent:Uy(Ee.textTextAlign),alignItems:Yl(qe)},children:a.jsx("span",{className:Zl(e,Dn,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Kl(Ee,n),...Jl(e,Dn,c,n),...st?{width:"100%"}:{}},children:H})})})})(),ce&&A&&(()=>{const Ee=`${A.widthPx}px`,qe={width:Ee,height:"auto",maxHeight:Ee,objectFit:"contain"};return a.jsx("div",{ref:He,className:`${c}-hover-media-anchor`,children:a.jsx(Fy,{media:A,className:A.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:qe},`${A.rowId}-${A.url}`)})})()]})})]})}const xv=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
10318
10318
  import { CommonComponentProps } from '../props';
10319
10319
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
10320
10320
  import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
@@ -13567,7 +13567,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
13567
13567
  pointer-events: none;
13568
13568
  z-index: 2;
13569
13569
  }
13570
- `}function sc(e,t,n,i,o,r,l,d){return{fontSettings:{fontFamily:e,fontWeight:(t==null?void 0:t.fontWeight)??400,fontStyle:(t==null?void 0:t.fontStyle)??"normal"},fontSize:n??.01,lineHeight:i,letterSpacing:o??0,wordSpacing:r??0,textAppearance:l,color:d??"#000000"}}function jv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r}){const{prefix:l}=D.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:b="solid",entryHoverEffect:v="default",autoclose:g="off",icon:h,iconMaxWidth:f=.00833,iconPaddingRight:x=0,iconAnimation:S="rotate 45",questionColor:y="#000000",answerColor:w="#000000",dividerColor:H="#0000001F",iconColor:N="#000000",questionHoverColor:Y="#666666",iconHoverColor:O="#666666",iconActiveColor:C="#000000",dividerHoverColor:V="#000000",questionFontFamily:$,questionFontSettings:R,questionFontSize:k,questionLineHeight:T,questionLetterSpacing:m,questionWordSpacing:M,questionTextAppearance:E,answerFontFamily:z,answerFontSettings:ne,answerFontSize:I,answerLineHeight:W,answerLetterSpacing:K,answerWordSpacing:ae,answerTextAppearance:de,questionPaddingLeft:A=0,questionPaddingTop:he=0,questionPaddingBottom:q=0,answerPaddingLeft:ce=0,answerPaddingRight:Q=0,answerPaddingTop:be=0,answerPaddingBottom:He=0}=e,xe=t??[],[le,ee]=s.useState(()=>new Set),ue=!n||i;s.useEffect(()=>{ee(new Set)},[g]),s.useEffect(()=>{n&&!o&&!i&&ee(new Set)},[n,o,i]);const oe=Ze=>D.scalingValue(Ze,n??!1),Fe=Math.max(A,qn),Ce=Math.max(he,qn),P=Math.max(q,qn),U=Math.max(ce,qn),X=Math.max(Q,qn),ie=Math.max(be,qn),j=Math.max(He,qn),B=Math.max(0,(c??1)-x-f),J=Math.max(0,(c??1)-Q),te=Math.max(0,(c??1)-ce),$e=Math.max(x,qn),ye=Math.max(0,(c??1)-A-f),F=s.useMemo(()=>le.size===0?0:Math.min(...le),[le]),ve=s.useCallback(Ze=>le.has(Ze),[le]),pe=ue&&v==="default"?`${l}-entry-hover-default`:"",Z=h??"",me=Z!=="",De=S.replace(/^rotate /,""),ge=`${l}-icon-anim-${De}`,G=sn(Yt(sc($,R,k,T,m,M,E,y),n)),Me=sn(Yt(sc(z,ne,I,W,K,ae,de,w),n)),_e=rc(k,T,`${l}-question`,`${l}-text-tight-leading`),rt=rc(I,W,`${l}-answer-text`,`${l}-text-tight-leading`),Je=ac(k,T,l,n),at=ac(I,W,l,n),it=D.buildColorVars(l,{questionColor:y,answerColor:w,dividerColor:H,iconColor:N,questionHoverColor:Y,iconHoverColor:O,iconActiveColor:C,dividerHoverColor:V},Nv,Hv),je=r&&r!=="default"?`${l}-state-${r}`:"",Se=s.useCallback(Ze=>{ue&&ee(Le=>{if(Le.has(Ze)){const se=new Set(Le);return se.delete(Ze),se}if(g==="on")return new Set([Ze]);const Ve=new Set(Le);return Ve.add(Ze),Ve})},[ue,g]),We=s.useMemo(()=>Dv(l),[l]),Be={[`--${l}-divider-width`]:D.scalingValue(p,n??!1),[`--${l}-divider-style`]:b,[`--${l}-icon-max-width`]:D.scalingValue(f,n??!1),...u>0?{[`--${l}-question-min-height`]:D.scalingValue(u,n??!1)}:{}};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:We}}),a.jsx("div",{style:it,children:a.jsx("div",{className:yt(`${l}-wrapper`,n&&!i&&`${l}-editor`,pe,je),style:{width:D.scalingValue(c,n??!1),maxWidth:"100%",...Be},children:xe.map((Ze,Le)=>{var Re;const Ve=ve(Le),se=((Re=Ze.question)==null?void 0:Re.trim())??"",Te=Ze.answer,Xe=((Te==null?void 0:Te.length)??0)>0,ze=d&&Le===F;return a.jsxs("div",{className:yt(`${l}-item`,Ve&&`${l}-item-open`),"data-faq-item":"",children:[a.jsxs("div",{className:`${l}-question-controls`,children:[ze&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"questionPaddingTop","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:`${l}-control-anchor`,style:{top:0,left:0,width:"100%",height:oe(Ce)}}),a.jsx("div",{"data-controls":"questionPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(B),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:oe(Fe),height:"100%"}}),a.jsx("div",{"data-controls":"iconPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(ye),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:oe($e),height:"100%"}})]}),a.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":Ve,style:{...G,...Je,paddingLeft:oe(A),paddingRight:oe(x)},onClick:()=>Se(Le),children:[he>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:oe(he)},"aria-hidden":"true"}),a.jsxs("span",{className:`${l}-question-row`,children:[a.jsx("span",{className:_e,children:se}),Xe&&(me?a.jsx("span",{className:`${l}-icon ${l}-icon-custom ${ge}`,"aria-hidden":"true",children:a.jsx(ln,{url:Z,fill:`var(--${l}-icon-color)`,hoverFill:`var(--${l}-icon-hover-color, var(--${l}-icon-color))`,className:`${l}-icon-image`})}):a.jsx("span",{className:`${l}-icon ${l}-icon-default ${ge}`,"aria-hidden":"true"}))]}),q>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:oe(q)},"aria-hidden":"true"})]}),ze&&a.jsx("div",{"data-controls":"questionPaddingBottom","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:`${l}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:oe(P)}})]}),Xe&&Te&&a.jsx("div",{className:`${l}-panel`,"aria-hidden":!Ve,children:a.jsx("div",{className:`${l}-panel-inner`,children:a.jsxs("div",{className:`${l}-answer-controls`,children:[ze&&Ve&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"answerPaddingTop","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:`${l}-control-anchor`,style:{top:0,left:0,width:"100%",height:oe(ie)}}),a.jsx("div",{"data-controls":"answerPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(J),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:oe(U),height:"100%"}}),a.jsx("div",{"data-controls":"answerPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(te),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:oe(X),height:"100%"}})]}),be>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:oe(be)}}),a.jsx("div",{className:`${l}-answer`,style:{...Me,...at,paddingLeft:oe(ce),paddingRight:oe(Q)},children:a.jsx("div",{className:rt,children:a.jsx(Ri,{content:Te})})}),He>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:oe(He)}}),ze&&Ve&&a.jsx("div",{"data-controls":"answerPaddingBottom","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:`${l}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:oe(j)}})]})})})]},Le)})})})]})}const zv=`import { useCallback, useEffect, useMemo, useState } from 'react';
13570
+ `}function sc(e,t,n,i,o,r,l,d){return{fontSettings:{fontFamily:e,fontWeight:(t==null?void 0:t.fontWeight)??400,fontStyle:(t==null?void 0:t.fontStyle)??"normal"},fontSize:n??.01,lineHeight:i,letterSpacing:o??0,wordSpacing:r??0,textAppearance:l,color:d??"#000000"}}function jv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r}){const{prefix:l}=D.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:b="solid",entryHoverEffect:v="default",autoclose:g="off",icon:h,iconMaxWidth:f=.00833,iconPaddingRight:x=0,iconAnimation:S="rotate 45",questionColor:y="#000000",answerColor:w="#000000",dividerColor:H="#0000001F",iconColor:N="#000000",questionHoverColor:U="#666666",iconHoverColor:O="#666666",iconActiveColor:C="#000000",dividerHoverColor:V="#000000",questionFontFamily:$,questionFontSettings:R,questionFontSize:k,questionLineHeight:T,questionLetterSpacing:m,questionWordSpacing:M,questionTextAppearance:E,answerFontFamily:z,answerFontSettings:ne,answerFontSize:I,answerLineHeight:W,answerLetterSpacing:K,answerWordSpacing:ae,answerTextAppearance:de,questionPaddingLeft:A=0,questionPaddingTop:he=0,questionPaddingBottom:q=0,answerPaddingLeft:ce=0,answerPaddingRight:Q=0,answerPaddingTop:be=0,answerPaddingBottom:He=0}=e,xe=t??[],[le,ee]=s.useState(()=>new Set),ue=!n||i;s.useEffect(()=>{ee(new Set)},[g]),s.useEffect(()=>{n&&!o&&!i&&ee(new Set)},[n,o,i]);const oe=Ze=>D.scalingValue(Ze,n??!1),Fe=Math.max(A,qn),Ce=Math.max(he,qn),P=Math.max(q,qn),Y=Math.max(ce,qn),X=Math.max(Q,qn),ie=Math.max(be,qn),j=Math.max(He,qn),B=Math.max(0,(c??1)-x-f),J=Math.max(0,(c??1)-Q),te=Math.max(0,(c??1)-ce),$e=Math.max(x,qn),ye=Math.max(0,(c??1)-A-f),F=s.useMemo(()=>le.size===0?0:Math.min(...le),[le]),ve=s.useCallback(Ze=>le.has(Ze),[le]),pe=ue&&v==="default"?`${l}-entry-hover-default`:"",Z=h??"",me=Z!=="",De=S.replace(/^rotate /,""),ge=`${l}-icon-anim-${De}`,G=sn(Yt(sc($,R,k,T,m,M,E,y),n)),Me=sn(Yt(sc(z,ne,I,W,K,ae,de,w),n)),_e=rc(k,T,`${l}-question`,`${l}-text-tight-leading`),rt=rc(I,W,`${l}-answer-text`,`${l}-text-tight-leading`),Je=ac(k,T,l,n),at=ac(I,W,l,n),it=D.buildColorVars(l,{questionColor:y,answerColor:w,dividerColor:H,iconColor:N,questionHoverColor:U,iconHoverColor:O,iconActiveColor:C,dividerHoverColor:V},Nv,Hv),je=r&&r!=="default"?`${l}-state-${r}`:"",Se=s.useCallback(Ze=>{ue&&ee(Le=>{if(Le.has(Ze)){const se=new Set(Le);return se.delete(Ze),se}if(g==="on")return new Set([Ze]);const Ve=new Set(Le);return Ve.add(Ze),Ve})},[ue,g]),We=s.useMemo(()=>Dv(l),[l]),Be={[`--${l}-divider-width`]:D.scalingValue(p,n??!1),[`--${l}-divider-style`]:b,[`--${l}-icon-max-width`]:D.scalingValue(f,n??!1),...u>0?{[`--${l}-question-min-height`]:D.scalingValue(u,n??!1)}:{}};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:We}}),a.jsx("div",{style:it,children:a.jsx("div",{className:yt(`${l}-wrapper`,n&&!i&&`${l}-editor`,pe,je),style:{width:D.scalingValue(c,n??!1),maxWidth:"100%",...Be},children:xe.map((Ze,Le)=>{var Re;const Ve=ve(Le),se=((Re=Ze.question)==null?void 0:Re.trim())??"",Te=Ze.answer,Xe=((Te==null?void 0:Te.length)??0)>0,ze=d&&Le===F;return a.jsxs("div",{className:yt(`${l}-item`,Ve&&`${l}-item-open`),"data-faq-item":"",children:[a.jsxs("div",{className:`${l}-question-controls`,children:[ze&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"questionPaddingTop","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:`${l}-control-anchor`,style:{top:0,left:0,width:"100%",height:oe(Ce)}}),a.jsx("div",{"data-controls":"questionPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(B),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:oe(Fe),height:"100%"}}),a.jsx("div",{"data-controls":"iconPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(ye),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:oe($e),height:"100%"}})]}),a.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":Ve,style:{...G,...Je,paddingLeft:oe(A),paddingRight:oe(x)},onClick:()=>Se(Le),children:[he>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:oe(he)},"aria-hidden":"true"}),a.jsxs("span",{className:`${l}-question-row`,children:[a.jsx("span",{className:_e,children:se}),Xe&&(me?a.jsx("span",{className:`${l}-icon ${l}-icon-custom ${ge}`,"aria-hidden":"true",children:a.jsx(ln,{url:Z,fill:`var(--${l}-icon-color)`,hoverFill:`var(--${l}-icon-hover-color, var(--${l}-icon-color))`,className:`${l}-icon-image`})}):a.jsx("span",{className:`${l}-icon ${l}-icon-default ${ge}`,"aria-hidden":"true"}))]}),q>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:oe(q)},"aria-hidden":"true"})]}),ze&&a.jsx("div",{"data-controls":"questionPaddingBottom","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:`${l}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:oe(P)}})]}),Xe&&Te&&a.jsx("div",{className:`${l}-panel`,"aria-hidden":!Ve,children:a.jsx("div",{className:`${l}-panel-inner`,children:a.jsxs("div",{className:`${l}-answer-controls`,children:[ze&&Ve&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"answerPaddingTop","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:`${l}-control-anchor`,style:{top:0,left:0,width:"100%",height:oe(ie)}}),a.jsx("div",{"data-controls":"answerPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(J),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:oe(Y),height:"100%"}}),a.jsx("div",{"data-controls":"answerPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(te),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:oe(X),height:"100%"}})]}),be>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:oe(be)}}),a.jsx("div",{className:`${l}-answer`,style:{...Me,...at,paddingLeft:oe(ce),paddingRight:oe(Q)},children:a.jsx("div",{className:rt,children:a.jsx(Ri,{content:Te})})}),He>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:oe(He)}}),ze&&Ve&&a.jsx("div",{"data-controls":"answerPaddingBottom","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:`${l}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:oe(j)}})]})})})]},Le)})})})]})}const zv=`import { useCallback, useEffect, useMemo, useState } from 'react';
13571
13571
  import cn from 'classnames';
13572
13572
  import { CommonComponentProps } from '../props';
13573
13573
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
@@ -14315,7 +14315,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
14315
14315
  </>
14316
14316
  );
14317
14317
  }
14318
- `;function Xn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const lc={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Bv=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Vv={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:Xn("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:{...lc.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:{...lc.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:Xn("Question Padding Left"),questionPaddingTop:Xn("Question Padding Top"),questionPaddingBottom:Xn("Question Padding Bottom"),answerPaddingLeft:Xn("Answer Padding Left"),answerPaddingRight:Xn("Answer Padding Right"),answerPaddingTop:Xn("Answer Padding Top"),answerPaddingBottom:Xn("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01M0GB8Z9EQFMGYA20F2J0ACA8.svg",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:[...Bv],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Gv={element:jv,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:Vv,sourceCode:zv},jn=e=>e.display==="cover",ca=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},cc=100,qv=.2,dc=8,au=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,r]=s.useState(0),[l,d]=s.useState(!1),c=s.useRef(null),u=s.useRef(0);u.current=o;const p=s.useMemo(()=>typeof window>"u"?cc:Math.max(cc,window.innerHeight*qv),[]),b=s.useCallback($=>Math.max(0,1-$/(p*1.5)),[p]),v=s.useCallback($=>Math.max(0,1-$/(p*.45)),[p]),g=s.useCallback($=>{const R=typeof window<"u"?window.innerHeight:800,k=Math.max(.88,1-$/R*.12);return`translateY(${$}px) scale(${k})`},[]),h=s.useCallback(()=>{c.current=null},[]),f=s.useCallback(()=>{d(!0),r(0),window.setTimeout(()=>d(!1),n),h()},[n,h]),x=s.useCallback(()=>{const $=typeof window<"u"?window.innerHeight:800;d(!0),r($),window.setTimeout(()=>{t(),h(),d(!1)},Math.min(n,200))},[n,t,h]),S=s.useCallback($=>{!e||l||$.pointerType==="touch"&&(i!=null&&i($.target)||(c.current={startX:$.clientX,startY:$.clientY,isLocked:null,pointerId:$.pointerId}))},[e,l,i]),y=s.useCallback($=>{const R=c.current;if(!e||!R||$.pointerType!=="touch"||R.pointerId!==$.pointerId)return;const k=$.clientX-R.startX,T=$.clientY-R.startY;if(R.isLocked===null){if(Math.abs(k)<dc&&Math.abs(T)<dc)return;if(T>0&&T>Math.abs(k))R.isLocked=!0,$.currentTarget.setPointerCapture($.pointerId);else{R.isLocked=!1,h();return}}if(!R.isLocked)return;$.preventDefault();const m=Math.max(0,T);u.current=m,r(m)},[e,h]),w=s.useCallback($=>{const R=c.current;if(!e||!R||$.pointerType!=="touch"||R.pointerId!==$.pointerId)return;const k=R.isLocked===!0;if($.currentTarget.hasPointerCapture($.pointerId)&&$.currentTarget.releasePointerCapture($.pointerId),!k){h();return}$.clientY-R.startY>=p?x():f()},[p,x,e,h,f]),H=s.useCallback($=>{w($)},[w]),N=s.useCallback($=>{w($)},[w]),Y=o>0,O=l?`transform ${n}ms ease`:"none",C=l?`opacity ${n}ms ease`:"none",V=o>0||l;return{isSwipeDragging:Y,backdropStyle:{opacity:b(o),transition:C},mediaAreaStyle:{transform:g(o),transition:O,touchAction:Y?"none":void 0,willChange:Y?"transform":void 0},overlayContentStyle:V?{opacity:v(o),transition:C}:void 0,swipeHandlers:e?{onPointerDown:S,onPointerMove:y,onPointerUp:H,onPointerCancel:N}:{},dismissAreaStyle:e?{touchAction:Y?"none":"pan-x"}:void 0}},Xv="[data-lightbox-scrollable]",su=()=>{s.useEffect(()=>{const e=window.scrollY,t=document.body.style.overflow,n=document.body.style.position,i=document.body.style.top,o=document.body.style.width,r=document.documentElement.style.overflow;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${e}px`,document.body.style.width="100%",document.documentElement.style.overflow="hidden";const l=d=>{const c=d.target;c instanceof Element&&c.closest(Xv)||d.preventDefault()};return document.addEventListener("touchmove",l,{passive:!1}),()=>{document.removeEventListener("touchmove",l),document.body.style.overflow=t,document.body.style.position=n,document.body.style.top=i,document.body.style.width=o,document.documentElement.style.overflow=r,window.scrollTo({top:e,left:0,behavior:"instant"})}},[])},Uv=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Yv=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Kv=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Zv=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(h,f)=>{Yv(t),e.scrollLeft=h,f&&(r==null||r())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,b=0;const v=()=>{t.removeEventListener("transitionend",g),clearTimeout(b)},g=h=>{h.target!==t||h.propertyName!=="transform"||p||(p=!0,v(),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(${c}px, 0, 0)`,b=window.setTimeout(()=>{p||(p=!0,v(),u(n,!0))},i+64),()=>{p||(p=!0,v(),u(l-Kv(t),!1))}},Po=300,Jv=900,Qv=1500,e0="cubic-bezier(0.16, 1, 0.3, 1)",t0=3e3,n0=2,i0=16,o0=.05,r0=1,hr=.3,a0=50,s0=20,Ai=.004,ao=["title1","title2","title3"],l0={title1:"1",title2:"2",title3:"3"},c0={title1:"title1Color",title2:"title2Color",title3:"title3Color"},d0={title1:.02,title2:.02,title3:.02},fr=e=>`max(${e}, ${s0}px)`,u0=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]}},p0=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=u0(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Gt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,m0=e=>[Gt(e,"fontFamily"),Gt(e,"fontSettings"),{type:"row",items:[Gt(e,"fontSize"),Gt(e,"lineHeight"),Gt(e,"letterSpacing"),Gt(e,"wordSpacing")]},Gt(e,"textAlign"),Gt(e,"textAppearance")],g0=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(ao.map(e=>[l0[e],m0(e)]))}),nl=(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},d)=>{if(r<=0||d<=0)return{overflow:r,widths:[d,...l]};const c=Math.min(r,d);return{overflow:r-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},lu=(e,t)=>nl(e,t),yr=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},uc=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:nl(e.length,n),effective:lu(e.length,n)}},h0=(e,t,n,i,o,r,l)=>{const d=[];return t&&d.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:o,text:t}),n&&d.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:r,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:l,text:i}),d},Fa=(e,t)=>{const n=i=>{const o=Gt(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[c0[t]]}},f0=(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),_a=(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??d0[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Yt(i,n)},y0=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:b,closeIcon:v,closeIconMaxWidth:g,closeIconColor:h,closeIconHoverColor:f,thumbnailTrigger:x,thumbnailVisibility:S,thumbnailObjectFit:y,thumbnailActive:w,thumbnailActiveColor:H,title1Width:N,title2Width:Y,title3Width:O,title1MarginLeft:C=0,title2MarginLeft:V=0,title3MarginLeft:$=0,titleRowMarginBottom:R=0,titleHeaderLayout:k="desktop",contentMarginTop:T,iconMarginLeft:m}=n,M=L=>D.scalingValue(L,i??!1),E=c??n.thumnailSize??.03,z=M(E),ne=M(u),I=M(p??.02),W=M(b??0),K=M(T??0),ae=fr(K),de=M(m??0),[A,he]=s.useState(0),q=s.useRef(A);q.current=A;const ce=t[A],{title1:Q,title2:be,title3:He}=p0(ce),xe=_a("title1",Fa(n,"title1"),i),le=_a("title2",Fa(n,"title2"),i),ee=_a("title3",Fa(n,"title3"),i),ue=k==="mobile",oe=!o&&(!i||r),Fe=oe,Ce=oe,P=oe,U=jn(y),X=U?{"--image-aspect-ratio":ca(y)}:void 0,ie=!!(Q||be||He),j=s.useMemo(()=>h0(e,Q,be,He,xe,le,ee),[e,A,Q,be,He,xe,le,ee]),B=s.useMemo(()=>({title1Width:N,title2Width:Y,title3Width:O}),[N,Y,O]),J=s.useMemo(()=>j.map(L=>B[L.widthKey]),[j,B]),te=s.useMemo(()=>nl(j.length,J),[j.length,J]),$e=s.useMemo(()=>lu(j.length,J),[j.length,J]),ye=s.useMemo(()=>j.filter(L=>L.prefix==="title1"),[j]),F=s.useMemo(()=>j.filter(L=>L.prefix==="title2"||L.prefix==="title3"),[j]),ve=s.useMemo(()=>uc(ye,B),[ye,B]),pe=s.useMemo(()=>uc(F,B),[F,B]),Z=s.useCallback((L,re)=>{const fe=j.indexOf(L);if(!ue||re==="single-row")return{effectiveWidth:$e[fe]??0,resolvedWidth:te[fe]??0,maxWidth:yr(fe,te)};if(re==="two-row-top"){const Ue=ye.indexOf(L);return{effectiveWidth:ve.effective[Ue]??0,resolvedWidth:ve.resolved[Ue]??0,maxWidth:yr(Ue,ve.resolved)}}const ke=F.indexOf(L);return{effectiveWidth:pe.effective[ke]??0,resolvedWidth:pe.resolved[ke]??0,maxWidth:yr(ke,pe.resolved)}},[F,pe,$e,te,j,ye,ve,ue]),me=s.useCallback(L=>D.scalingValue(L,i??!1),[i]),De=me(R??0),ge=s.useMemo(()=>({title1MarginLeft:C,title2MarginLeft:V,title3MarginLeft:$}),[C,V,$]),G=s.useCallback(L=>j.slice(0,L+1).reduce((re,fe,ke)=>re+(fe!=null&&fe.marginLeftKey?ge[fe.marginLeftKey]??0:0)+(te[ke]??0),0)+(ue?0:C??0),[j,ge,te,ue,C]),Me=s.useCallback(()=>ue?0:C??0,[ue,C]),_e=s.useCallback(L=>F.slice(0,L).reduce((re,fe,ke)=>re+(fe.marginLeftKey?ge[fe.marginLeftKey]??0:0)+(pe.resolved[ke]??0),0),[F,pe.resolved,ge]),rt=s.useCallback(L=>{const re=F[L];return _e(L)+(re.marginLeftKey?ge[re.marginLeftKey]??0:0)+(pe.resolved[L]??0)},[F,pe.resolved,_e,ge]),Je=(L,re)=>{const fe=L.marginLeftKey?ge[L.marginLeftKey]??0:0,{effectiveWidth:ke,resolvedWidth:Ue,maxWidth:ot}=Z(L,re),St=o&&re==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":L.prefix,style:{...re==="single-row"?{gridArea:L.prefix}:{},width:me(ke),...fe>0?{marginLeft:me(fe)}:{}},children:[a.jsx("p",{className:L.className,style:L.style,children:L.text}),St&&L.marginLeftKey&&a.jsx("div",{"data-controls":L.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ue),style:{position:"absolute",top:0,left:me(-fe),width:`max(${me(fe)}, 10px)`,height:"100%",pointerEvents:"auto"}}),St&&a.jsx("div",{"data-controls":L.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ot),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:me(-Ai/2),width:me(Ai),height:"100%",pointerEvents:"auto"}})]},L.className)},at=()=>{const L=ue?-1:j.findIndex(ke=>ke.prefix==="title1"),re=!ue&&(o||(C??0)>0)?(()=>{const ke=C??0,Ue=L>=0?te[L]:N??0;return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ue),style:{position:"absolute",top:0,left:0,width:`max(${me(ke)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,fe=j.flatMap((ke,Ue)=>{if(!ke.marginLeftKey)return[];const ot=ge[ke.marginLeftKey]??0,St=f0(j,te,ge,Ue)+Me();return a.jsx("div",{"data-controls":ke.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(te[Ue]),style:{position:"absolute",top:0,left:me(St),width:`max(${me(ot)}, 10px)`,height:"100%",pointerEvents:"auto"}},ke.marginLeftKey)});return re?[re,...fe]:fe},it=()=>j.map((L,re)=>{const fe=yr(re,te),Ue=G(re)-Ai/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":L.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(fe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:me(Ue),width:me(Ai),height:"100%",pointerEvents:"auto"}})},`${L.widthKey}-junction`)}),je=()=>F.flatMap((L,re)=>{if(!L.marginLeftKey)return[];const fe=ge[L.marginLeftKey]??0,ke=_e(re),{resolvedWidth:Ue}=Z(L,"two-row-bottom");return a.jsx("div",{"data-controls":L.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ue),style:{position:"absolute",top:0,left:me(ke),width:`max(${me(fe)}, 10px)`,height:"100%",pointerEvents:"auto"}},L.marginLeftKey)}),Se=()=>F.map((L,re)=>{const{maxWidth:fe}=Z(L,"two-row-bottom"),Ue=rt(re)-Ai/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":L.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(fe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:me(Ue),width:me(Ai),height:"100%",pointerEvents:"auto"}})},`${L.widthKey}-junction`)}),We=s.useRef(null),Be=s.useRef(null),Ze=s.useRef(null),Le=s.useRef(null),Ve=s.useRef([]),se=s.useRef([]),Te=s.useRef(0),Xe=s.useRef(null),ze=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),Re=s.useRef(null),Pe=s.useRef(null),Ae=s.useRef(0),Ke=s.useRef("forward"),Oe=s.useRef(0),Qe=s.useRef(null),tt=s.useRef(!1),nt=t.length>1&&(!o||!!r),xt=nt?3:1,It=s.useMemo(()=>Array.from({length:xt},()=>t).flat(),[t,xt]),[Tt,ut]=s.useState(!1),[ft,Et]=s.useState(!1),[Lt,bt]=s.useState(!0),Nt=s.useRef(null),Bt=s.useRef(null),Zt=s.useRef(!1),en=s.useRef(!1),Rt=s.useRef(null),Ot=s.useRef(null),nn=Fe&&!Lt,pt=s.useCallback(()=>{Fe&&(bt(!0),Ot.current&&clearTimeout(Ot.current),Ot.current=setTimeout(()=>{ze.current.isActive||bt(!1)},t0))},[Fe]),Ee=s.useCallback(()=>{o||en.current||(en.current=!0,Et(!1),Rt.current=setTimeout(()=>{l()},Po))},[o,l]),qe=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":nn?"true":"false",style:{width:D.scalingValue(g??0,i),height:D.scalingValue(g??0,i),marginRight:de,"--close-icon-hover-color":f},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Ee,"aria-label":"Close",children:a.jsx(ln,{url:v,fill:h,hoverFill:i&&!r?h:f,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:de,height:"100%",pointerEvents:"auto"}})]}),st=(L="two-row")=>a.jsx("div",{...L==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:me(C??0),flexShrink:0,...L==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...L==="two-row"&&o?{pointerEvents:"auto"}:{}}}),mt=()=>{const L=j.find(ke=>ke.prefix==="title1"),re=j.filter(ke=>ke.prefix==="title2"||ke.prefix==="title3"),fe=re.length>0||o||(R??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(C??0)>0||o?st():null,L&&Je(L,"two-row-top"),v&&qe()]}),fe?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[re.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[re.map(ke=>Je(ke,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[je(),Se()]})]}):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:De,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},vt=()=>a.jsxs(a.Fragment,{children:[(C??0)>0||o?st("single-row"):null,j.map(L=>Je(L,"single-row")),o?a.jsxs(a.Fragment,{children:[at(),it()]}):null,v?qe():null]}),Mt=s.useCallback(L=>!!(L.closest("[data-controls]")||L.closest(`.${e}-thumbnails`)||L.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:gt,backdropStyle:Vt,mediaAreaStyle:Wt,overlayContentStyle:_t,swipeHandlers:qt,dismissAreaStyle:Xt}=au({enabled:oe??!1,onClose:Ee,animMs:Po,isBlockedTarget:Mt}),Dt=()=>{if(!nt||t.length===0)return Te.current=0,0;const L=se.current[0],re=se.current[t.length];if(!L||!re)return Te.current;const fe=re.offsetLeft-L.offsetLeft;return fe>0&&(Te.current=fe),Te.current},jt=(L=!1)=>{if(!nt)return;const re=Be.current,fe=Dt();!re||fe<=0||fe<re.clientWidth*.25||(re.scrollLeft<=0?(re.scrollLeft+=fe,L&&(ze.current.scrollLeft+=fe),tt.current&&(Oe.current+=fe)):re.scrollLeft>=fe*2&&(re.scrollLeft-=fe,L&&(ze.current.scrollLeft-=fe),tt.current&&(Oe.current-=fe)))},Ht=(L,re=(fe=>(fe=Be.current)==null?void 0:fe.scrollLeft)()??0)=>{if(!nt)return L;let ke=t.length+L,Ue=1/0;for(let ot=0;ot<xt;ot++){const St=ot*t.length+L,kt=se.current[St];if(!kt)continue;const tn=Math.abs(kt.offsetLeft-re);tn<Ue&&(Ue=tn,ke=St)}return ke},$t=L=>{const re=Be.current;return!L||!re?!1:L.offsetWidth>re.clientWidth+1},_=L=>{const re=Be.current;if(!L||!re||!$t(L))return!1;const fe=L.offsetLeft,ke=fe+L.offsetWidth;return re.scrollLeft>=fe-1&&re.scrollLeft+re.clientWidth<=ke+1},Ie=(L=(re=>(re=Be.current)==null?void 0:re.scrollLeft)()??0)=>{for(let ke=0;ke<se.current.length;ke+=1){const Ue=se.current[ke];if(Ue&&_(Ue))return ke}let fe={flatIndex:0,distance:1/0};return se.current.forEach((ke,Ue)=>{if(!ke)return;const ot=Math.abs(ke.offsetLeft-L);ot<fe.distance&&(fe={flatIndex:Ue,distance:ot})}),fe.flatIndex},Ne=L=>{Be.current&&se.current.forEach(re=>{re&&(re.style.scrollSnapAlign=$t(re)&&L==="backward"?"end":"start")})},Ge=(L,re,fe)=>{const ke=L-re,Ue=Ie(re),ot=se.current[Ue];if(_(ot))return Ie(L)%t.length;const St=se.current[Ue+1],kt=ot?St?St.offsetLeft-ot.offsetLeft:ot.offsetWidth:0,tn=kt>0?ke>kt*hr?1:ke<-kt*hr?-1:0:0;return tn===0?fe:nt?(fe+tn+t.length)%t.length:Math.max(0,Math.min(t.length-1,fe+tn))},dt=s.useCallback((L=!1)=>{if(S!=="on"||o)return;const re=Le.current,fe=q.current,ke=Ve.current[fe];if(!re||!ke||re.scrollWidth<=re.clientWidth)return;const Ue=re.scrollLeft,ot=Ue+re.clientWidth,St=ke.offsetLeft,kt=St+ke.offsetWidth;if(St>=Ue&&kt<=ot)return;const tn=re.scrollWidth-re.clientWidth;let Jt=Ue;if(!L&&Nt.current===null){const Mi=Ve.current[fe-1],yo=Ve.current[fe+1],rr=Mi?ke.offsetLeft-Mi.offsetLeft:yo?yo.offsetLeft-ke.offsetLeft:ke.offsetWidth;kt>ot?Jt+=rr:St<Ue&&(Jt-=rr)}else kt>ot?Jt=kt-re.clientWidth:Jt=St;re.scrollLeft=Math.max(0,Math.min(tn,Jt))},[o,S]),Ft=s.useCallback((L=!1)=>{L&&(Zt.current=!0),Bt.current===null&&(Bt.current=requestAnimationFrame(()=>{Bt.current=null;const re=Zt.current;Zt.current=!1,dt(re)}))},[dt]),lt=s.useCallback(L=>{if(L===q.current)return;const re=q.current;q.current=L;const fe=Math.abs(L-re)>1,ke=nt&&t.length>1&&(re===t.length-1&&L===0||re===0&&L===t.length-1);he(L),Ft(fe||ke)},[t.length,nt,Ft]),wt=()=>{if(!Be.current||t.length===0||Nt.current!==null||ze.current.isActive&&ze.current.hasMoved)return;const L=Be.current.scrollLeft,re=Ie(L)%t.length;re!==q.current&&lt(re)},zt=()=>{Nt.current=null},Pt=L=>{const re=Be.current;re&&(re.style.scrollSnapType=L?"":"none")},on=()=>{var L;(L=Pe.current)==null||L.call(Pe),Pe.current=null},pn=()=>{Qe.current!==null&&(cancelAnimationFrame(Qe.current),Qe.current=null),tt.current=!1},ci=()=>{const L=Be.current;if(!L){Qe.current=null,tt.current=!1;return}const re=Oe.current-L.scrollLeft;if(Math.abs(re)<.5){L.scrollLeft=Oe.current,jt(),wt(),Qe.current=null,tt.current=!1;return}L.scrollLeft+=re*o0,jt(),wt(),pt(),Qe.current=requestAnimationFrame(ci)},di=()=>{const L=Ze.current;L&&(L.style.transition="",L.style.transform="",L.style.willChange="")},tr=(L,re,fe,ke)=>{di(),L.scrollLeft=re,Ae.current=L.scrollLeft,jt(),fe!==void 0?(q.current=fe,he(fe)):wt(),Pt(!0),ke==null||ke()},nr=(L,{behavior:re="smooth",activeIndex:fe,onComplete:ke}={})=>{const Ue=Be.current,ot=Ze.current;if(!Ue||!ot)return;if(pn(),on(),Pt(!1),re==="auto"){tr(Ue,L,fe,ke);return}const St=Math.abs(L-Ue.scrollLeft),kt=Uv(St,Jv,Qv,Ue.clientWidth*.55);Pe.current=Zv(Ue,ot,L,{duration:kt,easing:e0,onComplete:()=>{Pe.current=null,tr(Ue,L,fe,ke)}})},ua=(L="smooth")=>{const re=Be.current;if(!re||t.length===0)return;const fe=Ie()%t.length,ke=Ht(fe,re.scrollLeft),Ue=se.current[ke];Ue&&nr(Ue.offsetLeft,{behavior:L,activeIndex:fe})},pa=(L,re="smooth",fe,ke)=>{const Ue=Be.current;if(!Ue||t.length===0)return;const ot=(ke??Ue.scrollLeft)-L,St=Ie(L),kt=se.current[St];if(_(kt)){Pt(!0),wt();return}const tn=se.current[St+1],Jt=kt?tn?tn.offsetLeft-kt.offsetLeft:kt.offsetWidth:0;if((Jt>0?ot>Jt*hr?1:ot<-Jt*hr?-1:0:0)!==0){const Wu=fe??St%t.length,Nu=Ge(ke??Ue.scrollLeft,L,Wu);Tn(Nu,re);return}const yo=ke??Ue.scrollLeft,rr=Ie(yo),al=se.current[rr];if(al&&Math.abs(al.offsetLeft-yo)<1){Pt(!0),wt();return}ua("auto")},Tn=(L,re="smooth")=>{const fe=Be.current;if(!fe||t.length===0)return;const ke=Ht(L,fe.scrollLeft),Ue=se.current[ke];Ue&&(re==="smooth"?Nt.current=L:Nt.current=null,q.current=L,he(L),Ft(!0),nr(Ue.offsetLeft,{behavior:re,activeIndex:L,onComplete:re==="smooth"?zt:void 0}))},Ei=()=>{Re.current&&(window.removeEventListener("pointerup",Re.current),window.removeEventListener("pointercancel",Re.current),Re.current=null)},ir=(L,re,fe,ke,Ue)=>{const ot=fe-L,St=ke-re,kt=Math.abs(ot),tn=Math.abs(St);if(kt<a0||kt<=tn)return!1;const Jt=ot<0?1:-1,Mi=nt?(Ue+Jt+t.length)%t.length:Math.max(0,Math.min(t.length-1,Ue+Jt));return Mi===Ue?!1:(Tn(Mi),!0)},ui=L=>{if(!ze.current.isActive)return;Ei();const re=Be.current;if(!re)return;const{scrollLeft:fe,startActiveIndex:ke,hasMoved:Ue}=ze.current,ot=re.scrollLeft;jt(!0),ze.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},ut(!1),L!==void 0&&re.hasPointerCapture(L)&&re.releasePointerCapture(L),Ue?pa(fe,"smooth",ke,ot):(Pt(!0),wt()),pt()},or=(L,re)=>{const fe=Xe.current;Xe.current=null,fe&&(ir(fe.startX,fe.startY,L,re,fe.startActiveIndex),pt())},ma=L=>{if(!Ce)return;if(L.pointerType==="touch"){if(pn(),Pt(!0),Mt(L.target))return;Xe.current={startX:L.clientX,startY:L.clientY,startActiveIndex:q.current};return}if(L.pointerType!=="mouse"||L.button!==0||Mt(L.target))return;const re=Be.current;if(!re)return;pn(),on(),di(),Nt.current=null,ze.current={isActive:!0,startX:L.clientX,scrollLeft:re.scrollLeft,startActiveIndex:q.current,hasMoved:!1},Pt(!1),pt(),re.setPointerCapture(L.pointerId),Ei();const fe=ke=>{ke.pointerType==="mouse"&&ui(ke.pointerId)};Re.current=fe,window.addEventListener("pointerup",fe),window.addEventListener("pointercancel",fe)},ga=L=>{if(!Ce||L.pointerType!=="mouse")return;const re=Be.current;if(!re||!ze.current.isActive)return;if(L.buttons===0){ui(L.pointerId);return}const fe=L.clientX-ze.current.startX;Math.abs(fe)>r0&&(ze.current.hasMoved=!0,ut(!0)),ze.current.hasMoved&&(L.preventDefault(),re.scrollLeft=ze.current.scrollLeft-fe,jt(!0),wt(),pt())},we=L=>{if(Ce){if(L.pointerType==="touch"){L.type==="pointerup"?or(L.clientX,L.clientY):Xe.current=null;return}L.pointerType==="mouse"&&ui(L.pointerId)}},Ye=L=>{!Ce||L.pointerType!=="mouse"||ui(L.pointerId)};return su(),s.useEffect(()=>{const L=requestAnimationFrame(()=>Et(!0));return()=>{cancelAnimationFrame(L),on(),Ei(),Bt.current!==null&&(cancelAnimationFrame(Bt.current),Bt.current=null),Rt.current&&clearTimeout(Rt.current),Ot.current&&clearTimeout(Ot.current)}},[]),s.useEffect(()=>{if(!Fe){bt(!0);return}pt();const L=()=>pt();return document.addEventListener("pointermove",L,{passive:!0}),document.addEventListener("pointerdown",L,{passive:!0}),()=>{document.removeEventListener("pointermove",L),document.removeEventListener("pointerdown",L),Ot.current&&clearTimeout(Ot.current)}},[Fe,pt]),s.useEffect(()=>{const L=re=>{re.key==="Escape"&&Ee()};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[Ee]),s.useLayoutEffect(()=>{Dt()},[W,t.length,nt]),s.useLayoutEffect(()=>{o||Tn(q.current,"auto")},[W,o]),s.useLayoutEffect(()=>{Tn(0,"auto")},[t.length,nt]),s.useEffect(()=>{const L=Be.current;if(!L||o||!oe)return;const re=fe=>{if(fe.preventDefault(),Math.abs(fe.deltaY)<=Math.abs(fe.deltaX))return;const ke=fe.deltaMode===1?i0:fe.deltaMode===2?L.clientHeight:1,Ue=fe.deltaY*ke*n0;if(Ue!==0){if(on(),tt.current||(tt.current=!0,Oe.current=L.scrollLeft,Nt.current=null,Pt(!1)),Oe.current+=Ue,!nt){const ot=L.scrollWidth-L.clientWidth;Oe.current=Math.max(0,Math.min(ot,Oe.current))}pt(),Qe.current===null&&(Qe.current=requestAnimationFrame(ci))}};return L.addEventListener("wheel",re,{passive:!1}),()=>{L.removeEventListener("wheel",re),pn()}},[o,oe,nt]),s.useEffect(()=>{const L=Be.current;if(!L)return;const re=()=>{jt(ze.current.isActive);const ke=L.scrollLeft,Ue=ke-Ae.current;Ae.current=ke;const ot=Te.current>0?Te.current*.5:1/0;if(Ue!==0&&Math.abs(Ue)<ot){const St=Ue>0?"forward":"backward";St!==Ke.current&&(Ke.current=St,Ne(St))}ze.current.isActive&&ze.current.hasMoved||wt()};L.addEventListener("scroll",re,{passive:!0});const fe=new ResizeObserver(()=>{Dt(),jt(ze.current.isActive),Ne(Ke.current),wt()});return fe.observe(L),()=>{on(),L.removeEventListener("scroll",re),fe.disconnect()}},[t.length,nt]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{gt||Ee()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:ft?1:0,transition:`opacity ${Po}ms ease`,pointerEvents:ft?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Vt}}),a.jsxs("div",{ref:We,className:`${e}-lightbox-dismiss-area`,style:Xt,...qt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Wt,onClick:L=>L.stopPropagation(),children:a.jsx("div",{ref:Be,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":Ce&&t.length>0?"true":"false","data-mouse-dragging":Tt?"true":"false",onPointerDown:ma,onPointerMove:ga,onPointerUp:we,onPointerCancel:we,onLostPointerCapture:Ye,children:a.jsx("div",{ref:Ze,className:`${e}-lightbox-strip-track`,style:{gap:W},children:It.map((L,re)=>{const fe=L.image.objectFit??"contain",ke=re%t.length,Ue=Math.floor(re/t.length),ot=fr(W),St=`calc(-0.5 * (${ot} + ${W}))`;return a.jsxs("div",{ref:kt=>se.current[re]=kt,className:`${e}-strip-item`,style:{height:k==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:L.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:fe}}),o&&ke<t.length-1&&Ue===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:St,width:ot,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ue}-${L.image.url}-${ke}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":nn?"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:ae,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${ue?` ${e}-lightbox-content-area-stacked`:""}`,children:(ie||v)&&a.jsx("div",{className:`${e}-header ${ue?`${e}-header-two-row`:`${e}-header-single-row`}`,children:ue?mt():ie||v?vt():null})})})]}),t.length>1&&S==="on"&&(()=>{const L=fr(I),re=`calc(-0.5 * (${I} + ${L}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:I},children:a.jsx("div",{ref:Le,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:fe=>fe.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":w,style:{gap:ne,"--thumbnail-active-color":H},children:[t.map((fe,ke)=>{const Ue=fr(ne),ot=`calc(-0.5 * (${Ue} + ${ne}))`;return a.jsxs("div",{ref:St=>{Ve.current[ke]=St},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":A===ke?"true":"false",onClick:()=>oe&&x==="click"&&Tn(ke),onMouseEnter:()=>P&&x==="hover"&&Tn(ke),"aria-label":fe.image.name?`View ${fe.image.name}`:`View image ${ke+1}`,"aria-current":A===ke?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${U?` ${e}-thumb-image-cover`:""}`,src:fe.image.url,alt:"",draggable:!1,style:{...X,maxWidth:z,maxHeight:z,width:y.display==="cover"?"auto":"100%",height:"auto",objectFit:y.display==="cover"?"cover":"contain"}})}),o&&ke<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:ot,width:Ue,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${fe.image.url}-${ke}`)}),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:re,height:L,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function v0(e){return`
14318
+ `;function Xn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const lc={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Bv=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Vv={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:Xn("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:{...lc.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:{...lc.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:Xn("Question Padding Left"),questionPaddingTop:Xn("Question Padding Top"),questionPaddingBottom:Xn("Question Padding Bottom"),answerPaddingLeft:Xn("Answer Padding Left"),answerPaddingRight:Xn("Answer Padding Right"),answerPaddingTop:Xn("Answer Padding Top"),answerPaddingBottom:Xn("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01M0GB8Z9EQFMGYA20F2J0ACA8.svg",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:[...Bv],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Gv={element:jv,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:Vv,sourceCode:zv},jn=e=>e.display==="cover",ca=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},cc=100,qv=.2,dc=8,au=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,r]=s.useState(0),[l,d]=s.useState(!1),c=s.useRef(null),u=s.useRef(0);u.current=o;const p=s.useMemo(()=>typeof window>"u"?cc:Math.max(cc,window.innerHeight*qv),[]),b=s.useCallback($=>Math.max(0,1-$/(p*1.5)),[p]),v=s.useCallback($=>Math.max(0,1-$/(p*.45)),[p]),g=s.useCallback($=>{const R=typeof window<"u"?window.innerHeight:800,k=Math.max(.88,1-$/R*.12);return`translateY(${$}px) scale(${k})`},[]),h=s.useCallback(()=>{c.current=null},[]),f=s.useCallback(()=>{d(!0),r(0),window.setTimeout(()=>d(!1),n),h()},[n,h]),x=s.useCallback(()=>{const $=typeof window<"u"?window.innerHeight:800;d(!0),r($),window.setTimeout(()=>{t(),h(),d(!1)},Math.min(n,200))},[n,t,h]),S=s.useCallback($=>{!e||l||$.pointerType==="touch"&&(i!=null&&i($.target)||(c.current={startX:$.clientX,startY:$.clientY,isLocked:null,pointerId:$.pointerId}))},[e,l,i]),y=s.useCallback($=>{const R=c.current;if(!e||!R||$.pointerType!=="touch"||R.pointerId!==$.pointerId)return;const k=$.clientX-R.startX,T=$.clientY-R.startY;if(R.isLocked===null){if(Math.abs(k)<dc&&Math.abs(T)<dc)return;if(T>0&&T>Math.abs(k))R.isLocked=!0,$.currentTarget.setPointerCapture($.pointerId);else{R.isLocked=!1,h();return}}if(!R.isLocked)return;$.preventDefault();const m=Math.max(0,T);u.current=m,r(m)},[e,h]),w=s.useCallback($=>{const R=c.current;if(!e||!R||$.pointerType!=="touch"||R.pointerId!==$.pointerId)return;const k=R.isLocked===!0;if($.currentTarget.hasPointerCapture($.pointerId)&&$.currentTarget.releasePointerCapture($.pointerId),!k){h();return}$.clientY-R.startY>=p?x():f()},[p,x,e,h,f]),H=s.useCallback($=>{w($)},[w]),N=s.useCallback($=>{w($)},[w]),U=o>0,O=l?`transform ${n}ms ease`:"none",C=l?`opacity ${n}ms ease`:"none",V=o>0||l;return{isSwipeDragging:U,backdropStyle:{opacity:b(o),transition:C},mediaAreaStyle:{transform:g(o),transition:O,touchAction:U?"none":void 0,willChange:U?"transform":void 0},overlayContentStyle:V?{opacity:v(o),transition:C}:void 0,swipeHandlers:e?{onPointerDown:S,onPointerMove:y,onPointerUp:H,onPointerCancel:N}:{},dismissAreaStyle:e?{touchAction:U?"none":"pan-x"}:void 0}},Xv="[data-lightbox-scrollable]",su=()=>{s.useEffect(()=>{const e=window.scrollY,t=document.body.style.overflow,n=document.body.style.position,i=document.body.style.top,o=document.body.style.width,r=document.documentElement.style.overflow;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${e}px`,document.body.style.width="100%",document.documentElement.style.overflow="hidden";const l=d=>{const c=d.target;c instanceof Element&&c.closest(Xv)||d.preventDefault()};return document.addEventListener("touchmove",l,{passive:!1}),()=>{document.removeEventListener("touchmove",l),document.body.style.overflow=t,document.body.style.position=n,document.body.style.top=i,document.body.style.width=o,document.documentElement.style.overflow=r,window.scrollTo({top:e,left:0,behavior:"instant"})}},[])},Uv=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Yv=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Kv=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Zv=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(h,f)=>{Yv(t),e.scrollLeft=h,f&&(r==null||r())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,b=0;const v=()=>{t.removeEventListener("transitionend",g),clearTimeout(b)},g=h=>{h.target!==t||h.propertyName!=="transform"||p||(p=!0,v(),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(${c}px, 0, 0)`,b=window.setTimeout(()=>{p||(p=!0,v(),u(n,!0))},i+64),()=>{p||(p=!0,v(),u(l-Kv(t),!1))}},Po=300,Jv=900,Qv=1500,e0="cubic-bezier(0.16, 1, 0.3, 1)",t0=3e3,n0=2,i0=16,o0=.05,r0=1,hr=.3,a0=50,s0=20,Ai=.004,ao=["title1","title2","title3"],l0={title1:"1",title2:"2",title3:"3"},c0={title1:"title1Color",title2:"title2Color",title3:"title3Color"},d0={title1:.02,title2:.02,title3:.02},fr=e=>`max(${e}, ${s0}px)`,u0=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]}},p0=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=u0(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Gt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,m0=e=>[Gt(e,"fontFamily"),Gt(e,"fontSettings"),{type:"row",items:[Gt(e,"fontSize"),Gt(e,"lineHeight"),Gt(e,"letterSpacing"),Gt(e,"wordSpacing")]},Gt(e,"textAlign"),Gt(e,"textAppearance")],g0=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(ao.map(e=>[l0[e],m0(e)]))}),nl=(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},d)=>{if(r<=0||d<=0)return{overflow:r,widths:[d,...l]};const c=Math.min(r,d);return{overflow:r-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},lu=(e,t)=>nl(e,t),yr=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},uc=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:nl(e.length,n),effective:lu(e.length,n)}},h0=(e,t,n,i,o,r,l)=>{const d=[];return t&&d.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:o,text:t}),n&&d.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:r,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:l,text:i}),d},Fa=(e,t)=>{const n=i=>{const o=Gt(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[c0[t]]}},f0=(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),_a=(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??d0[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Yt(i,n)},y0=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:b,closeIcon:v,closeIconMaxWidth:g,closeIconColor:h,closeIconHoverColor:f,thumbnailTrigger:x,thumbnailVisibility:S,thumbnailObjectFit:y,thumbnailActive:w,thumbnailActiveColor:H,title1Width:N,title2Width:U,title3Width:O,title1MarginLeft:C=0,title2MarginLeft:V=0,title3MarginLeft:$=0,titleRowMarginBottom:R=0,titleHeaderLayout:k="desktop",contentMarginTop:T,iconMarginLeft:m}=n,M=L=>D.scalingValue(L,i??!1),E=c??n.thumnailSize??.03,z=M(E),ne=M(u),I=M(p??.02),W=M(b??0),K=M(T??0),ae=fr(K),de=M(m??0),[A,he]=s.useState(0),q=s.useRef(A);q.current=A;const ce=t[A],{title1:Q,title2:be,title3:He}=p0(ce),xe=_a("title1",Fa(n,"title1"),i),le=_a("title2",Fa(n,"title2"),i),ee=_a("title3",Fa(n,"title3"),i),ue=k==="mobile",oe=!o&&(!i||r),Fe=oe,Ce=oe,P=oe,Y=jn(y),X=Y?{"--image-aspect-ratio":ca(y)}:void 0,ie=!!(Q||be||He),j=s.useMemo(()=>h0(e,Q,be,He,xe,le,ee),[e,A,Q,be,He,xe,le,ee]),B=s.useMemo(()=>({title1Width:N,title2Width:U,title3Width:O}),[N,U,O]),J=s.useMemo(()=>j.map(L=>B[L.widthKey]),[j,B]),te=s.useMemo(()=>nl(j.length,J),[j.length,J]),$e=s.useMemo(()=>lu(j.length,J),[j.length,J]),ye=s.useMemo(()=>j.filter(L=>L.prefix==="title1"),[j]),F=s.useMemo(()=>j.filter(L=>L.prefix==="title2"||L.prefix==="title3"),[j]),ve=s.useMemo(()=>uc(ye,B),[ye,B]),pe=s.useMemo(()=>uc(F,B),[F,B]),Z=s.useCallback((L,re)=>{const fe=j.indexOf(L);if(!ue||re==="single-row")return{effectiveWidth:$e[fe]??0,resolvedWidth:te[fe]??0,maxWidth:yr(fe,te)};if(re==="two-row-top"){const Ue=ye.indexOf(L);return{effectiveWidth:ve.effective[Ue]??0,resolvedWidth:ve.resolved[Ue]??0,maxWidth:yr(Ue,ve.resolved)}}const ke=F.indexOf(L);return{effectiveWidth:pe.effective[ke]??0,resolvedWidth:pe.resolved[ke]??0,maxWidth:yr(ke,pe.resolved)}},[F,pe,$e,te,j,ye,ve,ue]),me=s.useCallback(L=>D.scalingValue(L,i??!1),[i]),De=me(R??0),ge=s.useMemo(()=>({title1MarginLeft:C,title2MarginLeft:V,title3MarginLeft:$}),[C,V,$]),G=s.useCallback(L=>j.slice(0,L+1).reduce((re,fe,ke)=>re+(fe!=null&&fe.marginLeftKey?ge[fe.marginLeftKey]??0:0)+(te[ke]??0),0)+(ue?0:C??0),[j,ge,te,ue,C]),Me=s.useCallback(()=>ue?0:C??0,[ue,C]),_e=s.useCallback(L=>F.slice(0,L).reduce((re,fe,ke)=>re+(fe.marginLeftKey?ge[fe.marginLeftKey]??0:0)+(pe.resolved[ke]??0),0),[F,pe.resolved,ge]),rt=s.useCallback(L=>{const re=F[L];return _e(L)+(re.marginLeftKey?ge[re.marginLeftKey]??0:0)+(pe.resolved[L]??0)},[F,pe.resolved,_e,ge]),Je=(L,re)=>{const fe=L.marginLeftKey?ge[L.marginLeftKey]??0:0,{effectiveWidth:ke,resolvedWidth:Ue,maxWidth:ot}=Z(L,re),St=o&&re==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":L.prefix,style:{...re==="single-row"?{gridArea:L.prefix}:{},width:me(ke),...fe>0?{marginLeft:me(fe)}:{}},children:[a.jsx("p",{className:L.className,style:L.style,children:L.text}),St&&L.marginLeftKey&&a.jsx("div",{"data-controls":L.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ue),style:{position:"absolute",top:0,left:me(-fe),width:`max(${me(fe)}, 10px)`,height:"100%",pointerEvents:"auto"}}),St&&a.jsx("div",{"data-controls":L.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ot),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:me(-Ai/2),width:me(Ai),height:"100%",pointerEvents:"auto"}})]},L.className)},at=()=>{const L=ue?-1:j.findIndex(ke=>ke.prefix==="title1"),re=!ue&&(o||(C??0)>0)?(()=>{const ke=C??0,Ue=L>=0?te[L]:N??0;return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ue),style:{position:"absolute",top:0,left:0,width:`max(${me(ke)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,fe=j.flatMap((ke,Ue)=>{if(!ke.marginLeftKey)return[];const ot=ge[ke.marginLeftKey]??0,St=f0(j,te,ge,Ue)+Me();return a.jsx("div",{"data-controls":ke.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(te[Ue]),style:{position:"absolute",top:0,left:me(St),width:`max(${me(ot)}, 10px)`,height:"100%",pointerEvents:"auto"}},ke.marginLeftKey)});return re?[re,...fe]:fe},it=()=>j.map((L,re)=>{const fe=yr(re,te),Ue=G(re)-Ai/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":L.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(fe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:me(Ue),width:me(Ai),height:"100%",pointerEvents:"auto"}})},`${L.widthKey}-junction`)}),je=()=>F.flatMap((L,re)=>{if(!L.marginLeftKey)return[];const fe=ge[L.marginLeftKey]??0,ke=_e(re),{resolvedWidth:Ue}=Z(L,"two-row-bottom");return a.jsx("div",{"data-controls":L.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ue),style:{position:"absolute",top:0,left:me(ke),width:`max(${me(fe)}, 10px)`,height:"100%",pointerEvents:"auto"}},L.marginLeftKey)}),Se=()=>F.map((L,re)=>{const{maxWidth:fe}=Z(L,"two-row-bottom"),Ue=rt(re)-Ai/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":L.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(fe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:me(Ue),width:me(Ai),height:"100%",pointerEvents:"auto"}})},`${L.widthKey}-junction`)}),We=s.useRef(null),Be=s.useRef(null),Ze=s.useRef(null),Le=s.useRef(null),Ve=s.useRef([]),se=s.useRef([]),Te=s.useRef(0),Xe=s.useRef(null),ze=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),Re=s.useRef(null),Pe=s.useRef(null),Ae=s.useRef(0),Ke=s.useRef("forward"),Oe=s.useRef(0),Qe=s.useRef(null),tt=s.useRef(!1),nt=t.length>1&&(!o||!!r),xt=nt?3:1,It=s.useMemo(()=>Array.from({length:xt},()=>t).flat(),[t,xt]),[Tt,ut]=s.useState(!1),[ft,Et]=s.useState(!1),[Lt,bt]=s.useState(!0),Nt=s.useRef(null),Bt=s.useRef(null),Zt=s.useRef(!1),en=s.useRef(!1),Rt=s.useRef(null),Ot=s.useRef(null),nn=Fe&&!Lt,pt=s.useCallback(()=>{Fe&&(bt(!0),Ot.current&&clearTimeout(Ot.current),Ot.current=setTimeout(()=>{ze.current.isActive||bt(!1)},t0))},[Fe]),Ee=s.useCallback(()=>{o||en.current||(en.current=!0,Et(!1),Rt.current=setTimeout(()=>{l()},Po))},[o,l]),qe=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":nn?"true":"false",style:{width:D.scalingValue(g??0,i),height:D.scalingValue(g??0,i),marginRight:de,"--close-icon-hover-color":f},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Ee,"aria-label":"Close",children:a.jsx(ln,{url:v,fill:h,hoverFill:i&&!r?h:f,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:de,height:"100%",pointerEvents:"auto"}})]}),st=(L="two-row")=>a.jsx("div",{...L==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:me(C??0),flexShrink:0,...L==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...L==="two-row"&&o?{pointerEvents:"auto"}:{}}}),mt=()=>{const L=j.find(ke=>ke.prefix==="title1"),re=j.filter(ke=>ke.prefix==="title2"||ke.prefix==="title3"),fe=re.length>0||o||(R??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(C??0)>0||o?st():null,L&&Je(L,"two-row-top"),v&&qe()]}),fe?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[re.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[re.map(ke=>Je(ke,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[je(),Se()]})]}):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:De,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},vt=()=>a.jsxs(a.Fragment,{children:[(C??0)>0||o?st("single-row"):null,j.map(L=>Je(L,"single-row")),o?a.jsxs(a.Fragment,{children:[at(),it()]}):null,v?qe():null]}),Mt=s.useCallback(L=>!!(L.closest("[data-controls]")||L.closest(`.${e}-thumbnails`)||L.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:gt,backdropStyle:Vt,mediaAreaStyle:Wt,overlayContentStyle:_t,swipeHandlers:qt,dismissAreaStyle:Xt}=au({enabled:oe??!1,onClose:Ee,animMs:Po,isBlockedTarget:Mt}),Dt=()=>{if(!nt||t.length===0)return Te.current=0,0;const L=se.current[0],re=se.current[t.length];if(!L||!re)return Te.current;const fe=re.offsetLeft-L.offsetLeft;return fe>0&&(Te.current=fe),Te.current},jt=(L=!1)=>{if(!nt)return;const re=Be.current,fe=Dt();!re||fe<=0||fe<re.clientWidth*.25||(re.scrollLeft<=0?(re.scrollLeft+=fe,L&&(ze.current.scrollLeft+=fe),tt.current&&(Oe.current+=fe)):re.scrollLeft>=fe*2&&(re.scrollLeft-=fe,L&&(ze.current.scrollLeft-=fe),tt.current&&(Oe.current-=fe)))},Ht=(L,re=(fe=>(fe=Be.current)==null?void 0:fe.scrollLeft)()??0)=>{if(!nt)return L;let ke=t.length+L,Ue=1/0;for(let ot=0;ot<xt;ot++){const St=ot*t.length+L,kt=se.current[St];if(!kt)continue;const tn=Math.abs(kt.offsetLeft-re);tn<Ue&&(Ue=tn,ke=St)}return ke},$t=L=>{const re=Be.current;return!L||!re?!1:L.offsetWidth>re.clientWidth+1},_=L=>{const re=Be.current;if(!L||!re||!$t(L))return!1;const fe=L.offsetLeft,ke=fe+L.offsetWidth;return re.scrollLeft>=fe-1&&re.scrollLeft+re.clientWidth<=ke+1},Ie=(L=(re=>(re=Be.current)==null?void 0:re.scrollLeft)()??0)=>{for(let ke=0;ke<se.current.length;ke+=1){const Ue=se.current[ke];if(Ue&&_(Ue))return ke}let fe={flatIndex:0,distance:1/0};return se.current.forEach((ke,Ue)=>{if(!ke)return;const ot=Math.abs(ke.offsetLeft-L);ot<fe.distance&&(fe={flatIndex:Ue,distance:ot})}),fe.flatIndex},Ne=L=>{Be.current&&se.current.forEach(re=>{re&&(re.style.scrollSnapAlign=$t(re)&&L==="backward"?"end":"start")})},Ge=(L,re,fe)=>{const ke=L-re,Ue=Ie(re),ot=se.current[Ue];if(_(ot))return Ie(L)%t.length;const St=se.current[Ue+1],kt=ot?St?St.offsetLeft-ot.offsetLeft:ot.offsetWidth:0,tn=kt>0?ke>kt*hr?1:ke<-kt*hr?-1:0:0;return tn===0?fe:nt?(fe+tn+t.length)%t.length:Math.max(0,Math.min(t.length-1,fe+tn))},dt=s.useCallback((L=!1)=>{if(S!=="on"||o)return;const re=Le.current,fe=q.current,ke=Ve.current[fe];if(!re||!ke||re.scrollWidth<=re.clientWidth)return;const Ue=re.scrollLeft,ot=Ue+re.clientWidth,St=ke.offsetLeft,kt=St+ke.offsetWidth;if(St>=Ue&&kt<=ot)return;const tn=re.scrollWidth-re.clientWidth;let Jt=Ue;if(!L&&Nt.current===null){const Mi=Ve.current[fe-1],yo=Ve.current[fe+1],rr=Mi?ke.offsetLeft-Mi.offsetLeft:yo?yo.offsetLeft-ke.offsetLeft:ke.offsetWidth;kt>ot?Jt+=rr:St<Ue&&(Jt-=rr)}else kt>ot?Jt=kt-re.clientWidth:Jt=St;re.scrollLeft=Math.max(0,Math.min(tn,Jt))},[o,S]),Ft=s.useCallback((L=!1)=>{L&&(Zt.current=!0),Bt.current===null&&(Bt.current=requestAnimationFrame(()=>{Bt.current=null;const re=Zt.current;Zt.current=!1,dt(re)}))},[dt]),lt=s.useCallback(L=>{if(L===q.current)return;const re=q.current;q.current=L;const fe=Math.abs(L-re)>1,ke=nt&&t.length>1&&(re===t.length-1&&L===0||re===0&&L===t.length-1);he(L),Ft(fe||ke)},[t.length,nt,Ft]),wt=()=>{if(!Be.current||t.length===0||Nt.current!==null||ze.current.isActive&&ze.current.hasMoved)return;const L=Be.current.scrollLeft,re=Ie(L)%t.length;re!==q.current&&lt(re)},zt=()=>{Nt.current=null},Pt=L=>{const re=Be.current;re&&(re.style.scrollSnapType=L?"":"none")},on=()=>{var L;(L=Pe.current)==null||L.call(Pe),Pe.current=null},pn=()=>{Qe.current!==null&&(cancelAnimationFrame(Qe.current),Qe.current=null),tt.current=!1},ci=()=>{const L=Be.current;if(!L){Qe.current=null,tt.current=!1;return}const re=Oe.current-L.scrollLeft;if(Math.abs(re)<.5){L.scrollLeft=Oe.current,jt(),wt(),Qe.current=null,tt.current=!1;return}L.scrollLeft+=re*o0,jt(),wt(),pt(),Qe.current=requestAnimationFrame(ci)},di=()=>{const L=Ze.current;L&&(L.style.transition="",L.style.transform="",L.style.willChange="")},tr=(L,re,fe,ke)=>{di(),L.scrollLeft=re,Ae.current=L.scrollLeft,jt(),fe!==void 0?(q.current=fe,he(fe)):wt(),Pt(!0),ke==null||ke()},nr=(L,{behavior:re="smooth",activeIndex:fe,onComplete:ke}={})=>{const Ue=Be.current,ot=Ze.current;if(!Ue||!ot)return;if(pn(),on(),Pt(!1),re==="auto"){tr(Ue,L,fe,ke);return}const St=Math.abs(L-Ue.scrollLeft),kt=Uv(St,Jv,Qv,Ue.clientWidth*.55);Pe.current=Zv(Ue,ot,L,{duration:kt,easing:e0,onComplete:()=>{Pe.current=null,tr(Ue,L,fe,ke)}})},ua=(L="smooth")=>{const re=Be.current;if(!re||t.length===0)return;const fe=Ie()%t.length,ke=Ht(fe,re.scrollLeft),Ue=se.current[ke];Ue&&nr(Ue.offsetLeft,{behavior:L,activeIndex:fe})},pa=(L,re="smooth",fe,ke)=>{const Ue=Be.current;if(!Ue||t.length===0)return;const ot=(ke??Ue.scrollLeft)-L,St=Ie(L),kt=se.current[St];if(_(kt)){Pt(!0),wt();return}const tn=se.current[St+1],Jt=kt?tn?tn.offsetLeft-kt.offsetLeft:kt.offsetWidth:0;if((Jt>0?ot>Jt*hr?1:ot<-Jt*hr?-1:0:0)!==0){const Wu=fe??St%t.length,Nu=Ge(ke??Ue.scrollLeft,L,Wu);Tn(Nu,re);return}const yo=ke??Ue.scrollLeft,rr=Ie(yo),al=se.current[rr];if(al&&Math.abs(al.offsetLeft-yo)<1){Pt(!0),wt();return}ua("auto")},Tn=(L,re="smooth")=>{const fe=Be.current;if(!fe||t.length===0)return;const ke=Ht(L,fe.scrollLeft),Ue=se.current[ke];Ue&&(re==="smooth"?Nt.current=L:Nt.current=null,q.current=L,he(L),Ft(!0),nr(Ue.offsetLeft,{behavior:re,activeIndex:L,onComplete:re==="smooth"?zt:void 0}))},Ei=()=>{Re.current&&(window.removeEventListener("pointerup",Re.current),window.removeEventListener("pointercancel",Re.current),Re.current=null)},ir=(L,re,fe,ke,Ue)=>{const ot=fe-L,St=ke-re,kt=Math.abs(ot),tn=Math.abs(St);if(kt<a0||kt<=tn)return!1;const Jt=ot<0?1:-1,Mi=nt?(Ue+Jt+t.length)%t.length:Math.max(0,Math.min(t.length-1,Ue+Jt));return Mi===Ue?!1:(Tn(Mi),!0)},ui=L=>{if(!ze.current.isActive)return;Ei();const re=Be.current;if(!re)return;const{scrollLeft:fe,startActiveIndex:ke,hasMoved:Ue}=ze.current,ot=re.scrollLeft;jt(!0),ze.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},ut(!1),L!==void 0&&re.hasPointerCapture(L)&&re.releasePointerCapture(L),Ue?pa(fe,"smooth",ke,ot):(Pt(!0),wt()),pt()},or=(L,re)=>{const fe=Xe.current;Xe.current=null,fe&&(ir(fe.startX,fe.startY,L,re,fe.startActiveIndex),pt())},ma=L=>{if(!Ce)return;if(L.pointerType==="touch"){if(pn(),Pt(!0),Mt(L.target))return;Xe.current={startX:L.clientX,startY:L.clientY,startActiveIndex:q.current};return}if(L.pointerType!=="mouse"||L.button!==0||Mt(L.target))return;const re=Be.current;if(!re)return;pn(),on(),di(),Nt.current=null,ze.current={isActive:!0,startX:L.clientX,scrollLeft:re.scrollLeft,startActiveIndex:q.current,hasMoved:!1},Pt(!1),pt(),re.setPointerCapture(L.pointerId),Ei();const fe=ke=>{ke.pointerType==="mouse"&&ui(ke.pointerId)};Re.current=fe,window.addEventListener("pointerup",fe),window.addEventListener("pointercancel",fe)},ga=L=>{if(!Ce||L.pointerType!=="mouse")return;const re=Be.current;if(!re||!ze.current.isActive)return;if(L.buttons===0){ui(L.pointerId);return}const fe=L.clientX-ze.current.startX;Math.abs(fe)>r0&&(ze.current.hasMoved=!0,ut(!0)),ze.current.hasMoved&&(L.preventDefault(),re.scrollLeft=ze.current.scrollLeft-fe,jt(!0),wt(),pt())},we=L=>{if(Ce){if(L.pointerType==="touch"){L.type==="pointerup"?or(L.clientX,L.clientY):Xe.current=null;return}L.pointerType==="mouse"&&ui(L.pointerId)}},Ye=L=>{!Ce||L.pointerType!=="mouse"||ui(L.pointerId)};return su(),s.useEffect(()=>{const L=requestAnimationFrame(()=>Et(!0));return()=>{cancelAnimationFrame(L),on(),Ei(),Bt.current!==null&&(cancelAnimationFrame(Bt.current),Bt.current=null),Rt.current&&clearTimeout(Rt.current),Ot.current&&clearTimeout(Ot.current)}},[]),s.useEffect(()=>{if(!Fe){bt(!0);return}pt();const L=()=>pt();return document.addEventListener("pointermove",L,{passive:!0}),document.addEventListener("pointerdown",L,{passive:!0}),()=>{document.removeEventListener("pointermove",L),document.removeEventListener("pointerdown",L),Ot.current&&clearTimeout(Ot.current)}},[Fe,pt]),s.useEffect(()=>{const L=re=>{re.key==="Escape"&&Ee()};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[Ee]),s.useLayoutEffect(()=>{Dt()},[W,t.length,nt]),s.useLayoutEffect(()=>{o||Tn(q.current,"auto")},[W,o]),s.useLayoutEffect(()=>{Tn(0,"auto")},[t.length,nt]),s.useEffect(()=>{const L=Be.current;if(!L||o||!oe)return;const re=fe=>{if(fe.preventDefault(),Math.abs(fe.deltaY)<=Math.abs(fe.deltaX))return;const ke=fe.deltaMode===1?i0:fe.deltaMode===2?L.clientHeight:1,Ue=fe.deltaY*ke*n0;if(Ue!==0){if(on(),tt.current||(tt.current=!0,Oe.current=L.scrollLeft,Nt.current=null,Pt(!1)),Oe.current+=Ue,!nt){const ot=L.scrollWidth-L.clientWidth;Oe.current=Math.max(0,Math.min(ot,Oe.current))}pt(),Qe.current===null&&(Qe.current=requestAnimationFrame(ci))}};return L.addEventListener("wheel",re,{passive:!1}),()=>{L.removeEventListener("wheel",re),pn()}},[o,oe,nt]),s.useEffect(()=>{const L=Be.current;if(!L)return;const re=()=>{jt(ze.current.isActive);const ke=L.scrollLeft,Ue=ke-Ae.current;Ae.current=ke;const ot=Te.current>0?Te.current*.5:1/0;if(Ue!==0&&Math.abs(Ue)<ot){const St=Ue>0?"forward":"backward";St!==Ke.current&&(Ke.current=St,Ne(St))}ze.current.isActive&&ze.current.hasMoved||wt()};L.addEventListener("scroll",re,{passive:!0});const fe=new ResizeObserver(()=>{Dt(),jt(ze.current.isActive),Ne(Ke.current),wt()});return fe.observe(L),()=>{on(),L.removeEventListener("scroll",re),fe.disconnect()}},[t.length,nt]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{gt||Ee()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:ft?1:0,transition:`opacity ${Po}ms ease`,pointerEvents:ft?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Vt}}),a.jsxs("div",{ref:We,className:`${e}-lightbox-dismiss-area`,style:Xt,...qt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Wt,onClick:L=>L.stopPropagation(),children:a.jsx("div",{ref:Be,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":Ce&&t.length>0?"true":"false","data-mouse-dragging":Tt?"true":"false",onPointerDown:ma,onPointerMove:ga,onPointerUp:we,onPointerCancel:we,onLostPointerCapture:Ye,children:a.jsx("div",{ref:Ze,className:`${e}-lightbox-strip-track`,style:{gap:W},children:It.map((L,re)=>{const fe=L.image.objectFit??"contain",ke=re%t.length,Ue=Math.floor(re/t.length),ot=fr(W),St=`calc(-0.5 * (${ot} + ${W}))`;return a.jsxs("div",{ref:kt=>se.current[re]=kt,className:`${e}-strip-item`,style:{height:k==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:L.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:fe}}),o&&ke<t.length-1&&Ue===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:St,width:ot,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ue}-${L.image.url}-${ke}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":nn?"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:ae,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${ue?` ${e}-lightbox-content-area-stacked`:""}`,children:(ie||v)&&a.jsx("div",{className:`${e}-header ${ue?`${e}-header-two-row`:`${e}-header-single-row`}`,children:ue?mt():ie||v?vt():null})})})]}),t.length>1&&S==="on"&&(()=>{const L=fr(I),re=`calc(-0.5 * (${I} + ${L}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:I},children:a.jsx("div",{ref:Le,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:fe=>fe.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":w,style:{gap:ne,"--thumbnail-active-color":H},children:[t.map((fe,ke)=>{const Ue=fr(ne),ot=`calc(-0.5 * (${Ue} + ${ne}))`;return a.jsxs("div",{ref:St=>{Ve.current[ke]=St},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":A===ke?"true":"false",onClick:()=>oe&&x==="click"&&Tn(ke),onMouseEnter:()=>P&&x==="hover"&&Tn(ke),"aria-label":fe.image.name?`View ${fe.image.name}`:`View image ${ke+1}`,"aria-current":A===ke?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${Y?` ${e}-thumb-image-cover`:""}`,src:fe.image.url,alt:"",draggable:!1,style:{...X,maxWidth:z,maxHeight:z,width:y.display==="cover"?"auto":"100%",height:"auto",objectFit:y.display==="cover"?"cover":"contain"}})}),o&&ke<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:ot,width:Ue,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${fe.image.url}-${ke}`)}),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:re,height:L,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function v0(e){return`
14319
14319
  .${e}-wrapper {
14320
14320
  position: relative;
14321
14321
  width: 100%;
@@ -15246,7 +15246,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
15246
15246
  </>
15247
15247
  );
15248
15248
  };
15249
- `,w0="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),fi={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 S0(e){const t={};return t[Gt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Gt(e,"fontSettings")]={...fi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Gt(e,"fontSize")]={...fi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Gt(e,"lineHeight")]={...fi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Gt(e,"letterSpacing")]={...fi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Gt(e,"wordSpacing")]={...fi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Gt(e,"textAlign")]={...fi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Gt(e,"textAppearance")]={...fi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const $0=ao.reduce((e,t)=>({...e,...S0(t)}),{}),C0=ao.reduce((e,t)=>({...e,[Gt(t,"fontFamily")]:"Goudy Bookletter 1911",[Gt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Gt(t,"letterSpacing")]:0,[Gt(t,"wordSpacing")]:0,[Gt(t,"textAlign")]:"left",[Gt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Wa(e){return ao.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Gt(n,"fontSize")]=i),o!==void 0&&(t[Gt(n,"lineHeight")]=o),t},{})}const T0=g0(),L0={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"}},...$0,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:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:w0,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...C0},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,...Wa({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,...Wa({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,...Wa({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:[T0]}],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:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"}]}},R0={element:x0,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:L0,sourceCode:b0,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...ao.map(e=>({path:`${Gt(e,"fontFamily")}`}))]},fontRelations:{...ao.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Gt(t,"fontFamily")}`}),{})}},I0=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,initialSlideIndex:l=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:p})=>{const{type:b,coverFit:v,backgroundColor:g,imageGap:h,maxWidth:f,maxHeight:x,textTransition:S,title1Width:y,title2Width:w,title3Width:H,title1MarginLeft:N=0,title2MarginLeft:Y=0,title3MarginLeft:O=0,titleRowMarginBottom:C=0,titleHeaderLayout:V="single-row",countCloseGap:$=0,closeIcon:R,closeIconMaxWidth:k,closeIconColor:T,closeIconHoverColor:m,contentMarginTop:M=0,iconMarginRight:E=0}=n,z=s.useCallback(we=>D.scalingValue(we,i??!1),[i]),ne=z(h??0),I=`${f}%`,W=`${x}%`,K=z($),ae=z(M),de=z(E),A=wi("title1",bi(n,"title1"),i),he=wi("title2",bi(n,"title2"),i),q=wi("title3",bi(n,"title3"),i),ce=wi("count",bi(n,"count"),i),Q=V==="mobile",be=!i||!!r,He=!o&&(!i||!!r),xe=s.useMemo(()=>Ar(t,b),[t,b]),[le,ee]=s.useState(l),ue=xe[le],oe=ue==null?void 0:ue.entry,[Fe,Ce]=s.useState(!1),[P,U]=s.useState(null),[X,ie]=s.useState(!1),[j,B]=s.useState(null),[J,te]=s.useState(!1),[$e,ye]=s.useState(0),[F,ve]=s.useState(),[pe,Z]=s.useState(),[me,De]=s.useState(null),ge=s.useRef(null),G=s.useRef(0),Me=s.useRef(0),_e=s.useRef(0),rt=s.useRef(!1),Je=s.useRef(null),at=s.useRef(null),it=s.useRef(null),je=s.useRef(null),Se=s.useRef(null),We=s.useRef(null),Be=s.useRef(null),Ze=s.useCallback(()=>{const we=at.current;if(!we)return;const Ye=we.closest(`.${e}-lightbox-content-area`);if(!Ye)return we.getBoundingClientRect().width;const L=Array.from(Ye.children).reduce((re,fe)=>!(fe instanceof HTMLElement)||fe.contains(we)?re:re+fe.getBoundingClientRect().width,0);return Ye.getBoundingClientRect().width-L},[e]),Le=s.useCallback(()=>{ge.current&&(clearTimeout(ge.current),ge.current=null)},[]),Ve=s.useCallback(we=>{we===G.current&&(B(null),te(!1))},[]),se=s.useCallback(()=>{o||rt.current||(rt.current=!0,u==null||u(),Ce(!1),Je.current=setTimeout(()=>{p()},300))},[o,u,p]),Te=s.useCallback(we=>!!(we.closest("[data-controls]")||we.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:Xe,backdropStyle:ze,mediaAreaStyle:Re,overlayContentStyle:Pe,swipeHandlers:Ae,dismissAreaStyle:Ke}=au({enabled:He,onClose:se,animMs:300,isBlockedTarget:Te}),Oe=s.useCallback(we=>{d&&zd(we+1,c,!0)},[d,c]),Qe=s.useCallback(we=>{if(we)return we.getBoundingClientRect().height},[]),tt=s.useCallback(we=>{if(xe.length===0)return;const Ye=(we%xe.length+xe.length)%xe.length;if(Ye===le)return;const L=xe[le],re=xe[Ye];G.current+=1;const fe=G.current,ke=S==="fade"&&Dl(L==null?void 0:L.entry)!==Dl(re==null?void 0:re.entry),Ue=Qe(it.current),ot=ke?(()=>{const kt=Ze();Vn.flushSync(()=>{De(re.entry)}),it.current&&kt&&(it.current.style.width=`${kt}px`);const tn=Qe(it.current);return it.current&&(it.current.style.width=""),{measuredIncomingTitlesHeight:tn,incomingTitlesMeasureWidth:kt}})():void 0,St=Math.max(Ue??0,(ot==null?void 0:ot.measuredIncomingTitlesHeight)??0)||void 0;ye(fe),B(le),te(!0),ee(Ye),Oe(Ye),_e.current=Ye,ke?(Le(),St&&ve(St),ot!=null&&ot.incomingTitlesMeasureWidth&&Z(ot.incomingTitlesMeasureWidth),U((L==null?void 0:L.entryIndex)??null),ie(!0),Me.current=re.entryIndex,ge.current=setTimeout(()=>{U(null),ie(!1),ve(void 0),Z(void 0),De(null),ge.current=null},400)):(Le(),U(null),ie(!1),ve(void 0),Z(void 0),De(null),Me.current=re.entryIndex)},[le,Le,Ze,Qe,xe,Oe,S]),nt=s.useCallback(()=>{Be.current=null},[]),xt=s.useCallback(we=>{!be||xe.length<=1||we.pointerType==="mouse"&&we.button!==0||we.target.closest("[data-controls]")||(Be.current={startX:we.clientX,startY:we.clientY,pointerId:we.pointerId})},[be,xe.length]),It=s.useCallback(we=>{var kt;if(!be||xe.length<=1||we.pointerType==="mouse"&&we.button!==0)return;if(Xe){nt();return}const Ye=Be.current;if(!Ye||Ye.pointerId!==we.pointerId||(nt(),we.target.closest("[data-controls]")))return;const re=we.clientX-Ye.startX,fe=we.clientY-Ye.startY,ke=Math.abs(re),Ue=Math.abs(fe);if(ke>=Df&&ke>Ue){tt(re>0?le-1:le+1);return}if(ke>Wl||Ue>Wl)return;const ot=(kt=je.current)==null?void 0:kt.getBoundingClientRect(),St=ot?ot.left+ot.width/2:window.innerWidth/2;tt(we.clientX<St?le-1:le+1)},[le,be,tt,Xe,nt,xe.length]),Tt=s.useCallback(we=>{const Ye=Be.current;(Ye==null?void 0:Ye.pointerId)===we.pointerId&&nt()},[nt]);su(),s.useEffect(()=>{We.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const we=requestAnimationFrame(()=>{Ce(!0),requestAnimationFrame(()=>{Se.current?Se.current.focus():je.current&&je.current.focus()})});return()=>{cancelAnimationFrame(we),Je.current&&clearTimeout(Je.current),ge.current&&clearTimeout(ge.current);const Ye=We.current;Ye&&document.contains(Ye)&&Ye.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var we;S!=="fade"&&(Me.current=((we=xe[le])==null?void 0:we.entryIndex)??0,Le(),U(null),ie(!1),ve(void 0),Z(void 0))},[le,Le,xe,S]),s.useEffect(()=>{const we=Ye=>{if(Ye.key==="Escape"){se();return}if(Ye.key==="ArrowLeft"&&xe.length>1){tt(le-1);return}if(Ye.key==="ArrowRight"&&xe.length>1){tt(le+1);return}if(Ye.key==="Tab"&&je.current){const L=je.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),re=Array.from(L).filter(ot=>!ot.closest('[aria-hidden="true"]'));if(re.length===0)return;const fe=re[0],ke=re[re.length-1],Ue=document.activeElement;Ye.shiftKey?(Ue===fe||!je.current.contains(Ue))&&(Ye.preventDefault(),ke.focus()):(Ue===ke||!je.current.contains(Ue))&&(Ye.preventDefault(),fe.focus())}};return window.addEventListener("keydown",we),()=>window.removeEventListener("keydown",we)},[tt,se,le,xe.length]),s.useLayoutEffect(()=>{Le(),G.current=0,ye(0),B(null),te(!1),U(null),ie(!1),ve(void 0),Z(void 0),De(null),ee(we=>{const Ye=Math.max(0,xe.length-1);return Math.min(we,Ye)})},[Le,t.length,b,xe.length]),s.useLayoutEffect(()=>{var L;const we=Math.max(0,xe.length-1),Ye=Math.min(Math.max(0,l),we);_e.current=Ye,Me.current=((L=xe[Ye])==null?void 0:L.entryIndex)??0,ee(Ye)},[l]);const ut=P!==null?t[P]:null,ft=j!==null?xe[j]:null,Et=(oe==null?void 0:oe.title1)||(oe==null?void 0:oe.title2)||(oe==null?void 0:oe.title3)||(ut==null?void 0:ut.title1)||(ut==null?void 0:ut.title2)||(ut==null?void 0:ut.title3),Lt=Uf(b,xe,t),bt=R!==null,Nt=Et||Lt||bt,Bt=Lt&&bt?{gap:K}:void 0,Zt=`${e}-titles-stack${Q?` ${e}-titles-stack-stacked`:""}`,en=`${e}-titles-layer-out${Q?` ${e}-titles-layer-out-stacked`:""}`,Rt=`${e}-titles-layer-out`,Ot=(N??0)>0||o,nn=z(C),pt=s.useMemo(()=>({title1Width:y??Xi.title1Width,title2Width:w??Xi.title2Width,title3Width:H??Xi.title3Width}),[y,w,H]),Ee=s.useMemo(()=>({title2MarginLeft:Y,title3MarginLeft:O}),[Y,O]),qe=s.useMemo(()=>oe?Jn(e,oe,A,he,q):[],[e,oe,A,he,q]),st=s.useMemo(()=>qe.map(we=>pt[we.widthKey]),[qe,pt]),mt=s.useMemo(()=>eo(qe.length,st),[qe.length,st]),vt=s.useMemo(()=>Oo(qe.length,st),[qe.length,st]),Mt=s.useMemo(()=>qe.filter(we=>we.prefix==="title1"),[qe]),gt=s.useMemo(()=>qe.filter(we=>we.prefix==="title2"||we.prefix==="title3"),[qe]),Vt=s.useMemo(()=>Qn(Mt,pt),[Mt,pt]),Wt=s.useMemo(()=>Qn(gt,pt),[gt,pt]),_t=s.useCallback((we,Ye)=>{const L=qe.findIndex(fe=>fe.prefix===we.prefix);if(!Q||Ye==="single-row")return{effectiveWidth:vt[L]??0,resolvedWidth:mt[L]??0,maxWidth:dn(L,mt)};if(Ye==="two-row-top"){const fe=Mt.findIndex(ke=>ke.prefix===we.prefix);return{effectiveWidth:Vt.effective[fe]??0,resolvedWidth:Vt.resolved[fe]??0,maxWidth:dn(fe,Vt.resolved)}}const re=gt.findIndex(fe=>fe.prefix===we.prefix);return{effectiveWidth:Wt.effective[re]??0,resolvedWidth:Wt.resolved[re]??0,maxWidth:dn(re,Wt.resolved)}},[qe,gt,Wt,vt,mt,Mt,Vt,Q]),qt=s.useCallback(we=>qd(qe,mt,Ee,we)+(Q?0:N??0),[qe,mt,Ee,Q,N]),Xt=s.useCallback(()=>Q?0:N??0,[Q,N]),Dt=s.useCallback(we=>gt.slice(0,we).reduce((Ye,L,re)=>Ye+(L.marginLeftKey?Ee[L.marginLeftKey]??0:0)+(Wt.resolved[re]??0),0),[gt,Wt.resolved,Ee]),jt=s.useCallback(we=>{const Ye=gt[we];return Dt(we)+(Ye.marginLeftKey?Ee[Ye.marginLeftKey]??0:0)+(Wt.resolved[we]??0)},[gt,Wt.resolved,Dt,Ee]),Ht=s.useCallback((we,Ye,L)=>{if(!Q||L==="single-row"){const ot=we.findIndex(Jt=>Jt.prefix===Ye.prefix),St=we.map(Jt=>pt[Jt.widthKey]),kt=eo(we.length,St);return{effectiveWidth:Oo(we.length,St)[ot]??0,resolvedWidth:kt[ot]??0,maxWidth:dn(ot,kt)}}if(L==="two-row-top"){const ot=we.filter(Jt=>Jt.prefix==="title1"),St=ot.findIndex(Jt=>Jt.prefix===Ye.prefix),{resolved:kt,effective:tn}=Qn(ot,pt);return{effectiveWidth:tn[St]??0,resolvedWidth:kt[St]??0,maxWidth:dn(St,kt)}}const re=we.filter(ot=>ot.prefix==="title2"||ot.prefix==="title3"),fe=re.findIndex(ot=>ot.prefix===Ye.prefix),{resolved:ke,effective:Ue}=Qn(re,pt);return{effectiveWidth:Ue[fe]??0,resolvedWidth:ke[fe]??0,maxWidth:dn(fe,ke)}},[pt,Q]),$t=(we,Ye,L)=>{const re=we.marginLeftKey?Ee[we.marginLeftKey]??0:0,{effectiveWidth:fe,resolvedWidth:ke,maxWidth:Ue}=L??_t(we,Ye),ot=Math.max(re,Zn),St=o&&Ye==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":we.prefix,style:{width:z(fe),...re>0?{marginLeft:z(re)}:{}},children:[a.jsx("p",{className:we.className,style:we.style,children:we.text}),St&&we.marginLeftKey?a.jsx("div",{"data-controls":we.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ke),style:{position:"absolute",top:0,left:z(-re),width:z(ot),height:"100%",pointerEvents:"auto"}}):null,St?a.jsx("div",{"data-controls":we.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ue),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:z(-yn/2),width:z(yn),height:"100%",pointerEvents:"auto"}}):null]},we.className)},_=(we="two-row")=>{const Ye=qe.findIndex(fe=>fe.prefix==="title1"),L=Ye>=0?mt[Ye]:pt.title1Width,re=we==="two-row"&&o;return a.jsx("div",{...re?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(L)}:{},style:{width:z(N??0),flexShrink:0,alignSelf:"stretch",...re?{pointerEvents:"auto"}:{}}})},Ie=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:A,"aria-hidden":"true",children:" "}),Ne=()=>a.jsx("span",{className:`${e}-entry-counter`,style:ce,"aria-live":"polite","aria-atomic":"true",children:Xf(xe,le,b,t)}),Ge=()=>Lt?o&&bt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Ne(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${La(K)} + ${K}))`,width:La(K),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Ne():null,dt=()=>!Lt&&!bt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Bt,children:[Ge(),bt?wt():null]}),Ft=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Lt||Et?Ie():null,Ot?_("single-row"):null,Pt(oe),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),dt(),Tn()]}),lt=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Lt||Et?Ie():null,Ot?_("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:X&&F?{minHeight:F}:void 0,children:[a.jsx("div",{ref:it,className:Zt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:di(me||oe)}),a.jsxs("div",{ref:at,className:Zt,style:{position:X?"absolute":"relative",inset:X?0:void 0,width:"100%",...X&&pe?{width:pe,maxWidth:"100%"}:void 0},children:[ut&&X?a.jsx("div",{className:`${en} ${e}-titles-fade-out`,children:di(ut)}):null,a.jsx("div",{className:`${e}-titles-layer-in${X?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:di(oe)})]})]}),dt(),Tn()]}),wt=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:D.scalingValue(k??0,i),height:D.scalingValue(k??0,i),marginRight:de,"--close-icon-hover-color":m},children:[a.jsx("button",{ref:Se,type:"button",className:`${e}-close-icon-inner`,onClick:se,"aria-label":"Close",children:a.jsx(ln,{url:R??"",fill:T,hoverFill:i&&!r?T:m,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:de,height:"100%",pointerEvents:"auto"}})]}),zt=(we,Ye)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[Lt||Et?Ie():null,Ot?_("two-row"):null,Ye!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Ye},children:we}):a.jsxs(a.Fragment,{children:[we,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),dt()]}),Pt=we=>{if(!we)return null;const Ye=Jn(e,we,A,he,q);return a.jsx(a.Fragment,{children:Ye.map(L=>$t(L,"single-row",Ht(Ye,L,"single-row")))})},on=we=>{if(!we)return null;const Ye=Jn(e,we,A,he,q),L=Ye.find(re=>re.prefix==="title1");return L?$t(L,"two-row-top",Ht(Ye,L,"two-row-top")):null},pn=(we,Ye=!1)=>{const L=we?Jn(e,we,A,he,q):[],re=L.filter(Ue=>Ue.prefix==="title2"||Ue.prefix==="title3"),fe=o&&Ye;return re.length>0||fe||(C??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[re.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[re.map(Ue=>$t(Ue,"two-row-bottom",Ht(L,Ue,"two-row-bottom"))),Ye&&o?a.jsxs(a.Fragment,{children:[ua(),pa()]}):null]}):null,(C??0)>0||fe?a.jsx("div",{"data-controls":fe?"titleRowMarginBottom":void 0,"data-controls-axis":fe?"y":void 0,"data-controls-reverse":fe?"":void 0,className:fe?`${e}-control`:void 0,style:{height:nn,width:"100%",flexShrink:0,pointerEvents:fe?"auto":"none"}}):null]}):null},ci=(we,Ye=!1)=>a.jsxs(a.Fragment,{children:[zt(on(we)),pn(we,Ye)]}),di=we=>Q?a.jsx("div",{className:`${e}-titles-row-two-row`,children:ci(we)}):we?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Pt(we)}):null,tr=()=>{const we=Q?-1:qe.findIndex(re=>re.prefix==="title1"),Ye=!Q&&(o||(N??0)>0)?(()=>{const re=N??0,fe=we>=0?mt[we]:pt.title1Width,ke=Math.max(re,Zn);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(fe),style:{position:"absolute",top:0,left:0,width:z(ke),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,L=qe.flatMap((re,fe)=>{if(!re.marginLeftKey)return[];const ke=Ee[re.marginLeftKey]??0,Ue=Gd(qe,mt,Ee,fe)+Xt(),ot=Math.max(ke,Zn);return a.jsx("div",{"data-controls":re.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(mt[fe]),style:{position:"absolute",top:0,left:z(Ue),width:z(ot),height:"100%",pointerEvents:"auto"}},re.marginLeftKey)});return Ye?[Ye,...L]:L},nr=()=>qe.map((we,Ye)=>{const L=dn(Ye,mt),fe=qt(Ye)-yn/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(L),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:z(fe),width:z(yn),height:"100%",pointerEvents:"auto"}})},`${we.widthKey}-junction`)}),ua=()=>gt.flatMap((we,Ye)=>{if(!we.marginLeftKey)return[];const L=Ee[we.marginLeftKey]??0,re=Dt(Ye),fe=Math.max(L,Zn),{resolvedWidth:ke}=_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(ke),style:{position:"absolute",top:0,left:z(re),width:z(fe),height:"100%",pointerEvents:"auto"}},we.marginLeftKey)}),pa=()=>gt.map((we,Ye)=>{const{maxWidth:L}=_t(we,"two-row-bottom"),fe=jt(Ye)-yn/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(L),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:z(fe),width:z(yn),height:"100%",pointerEvents:"auto"}})},`${we.widthKey}-junction`)}),Tn=()=>!o||Q?null:a.jsxs(a.Fragment,{children:[tr(),nr()]}),Ei=we=>{const Ye=!we.objectFit&&jn(v);return{className:`${e}-slide-image-cell${Ye?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:I,maxHeight:W,...Ye?{"--image-aspect-ratio":ca(v)}:{}}}},ir=we=>we.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":we.objectFit}}:jn(v)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ui=we=>{if(we.length===0)return null;const Ye=we.length>1,L=La(ne),re=`calc(-0.5 * (${L} + ${ne}))`;if(we.length===1){const fe=we[0];return a.jsx("div",{...Ei(fe),children:a.jsx("img",{...ir(fe),src:fe.url,alt:fe.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:Ye?{gap:ne}:void 0,children:we.map((fe,ke)=>a.jsxs("div",{...Ei(fe),children:[a.jsx("img",{...ir(fe),src:fe.url,alt:fe.name??"",draggable:!1}),o&&Ye&&ke<we.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:re,width:L,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${fe.url}-${ke}`))})},or=!!(oe!=null&&oe.title2||oe!=null&&oe.title3||ut!=null&&ut.title2||ut!=null&&ut.title3||(C??0)>0||o),ma=()=>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:it,className:Zt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ci(me||oe)}),a.jsxs("div",{ref:at,className:`${e}-titles-row-two-row`,style:{...X&&F?{minHeight:F}:void 0,...X&&pe?{width:pe,maxWidth:"100%"}:void 0},children:[zt(a.jsxs("div",{className:Zt,style:{position:X?"absolute":"relative",inset:X?0:void 0,width:"100%"},children:[ut&&X?a.jsx("div",{className:`${Rt} ${e}-titles-fade-out`,children:on(ut)}):null,a.jsx("div",{className:`${e}-titles-layer-in${X?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:on(oe)})]}),X&&F?F:void 0),or?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[ut&&X?a.jsx("div",{className:`${en} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:pn(ut)}):null,a.jsx("div",{className:`${e}-titles-layer-in${X?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${Q?` ${e}-titles-layer-in-stacked`:""}`,children:pn(oe,!0)})]}):null]})]}),ga=()=>{const we=or;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:ci(oe,!0)}),Tn()]})};return a.jsxs("div",{ref:je,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{Xe||se()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:bt?void 0:-1,style:{opacity:Fe?1:0,transition:"opacity 300ms ease",pointerEvents:Fe?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:g,...ze}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Ke,...Ae,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Re,onClick:we=>we.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":be&&xe.length>1?"true":"false",onPointerDown:be?xt:void 0,onPointerUp:be?It:void 0,onPointerCancel:be?Tt:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[ft&&J?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:we=>{we.target===we.currentTarget&&Ve($e)},children:a.jsx("div",{className:`${e}-slide-area`,children:ui(ft.images)})},`slide-out-${$e}`):null,a.jsx("div",{className:`${e}-slide-layer-in${J?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:ue?ui(ue.images):null})},`slide-in-${$e}-${le}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Pe,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:ae,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...Q?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${Q?` ${e}-lightbox-content-area-stacked`:""}`,children:Nt&&a.jsx("div",{className:`${e}-text-bar-cell${Q?` ${e}-text-bar-cell-stacked`:""}`,style:Q?void 0:{flex:1,minWidth:0,width:"100%"},children:Q?S==="fade"?ma():ga():S==="fade"?lt():Ft()})})})]})]})]})};function E0(e){return`
15249
+ `,w0="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),fi={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 S0(e){const t={};return t[Gt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Gt(e,"fontSettings")]={...fi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Gt(e,"fontSize")]={...fi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Gt(e,"lineHeight")]={...fi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Gt(e,"letterSpacing")]={...fi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Gt(e,"wordSpacing")]={...fi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Gt(e,"textAlign")]={...fi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Gt(e,"textAppearance")]={...fi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const $0=ao.reduce((e,t)=>({...e,...S0(t)}),{}),C0=ao.reduce((e,t)=>({...e,[Gt(t,"fontFamily")]:"Goudy Bookletter 1911",[Gt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Gt(t,"letterSpacing")]:0,[Gt(t,"wordSpacing")]:0,[Gt(t,"textAlign")]:"left",[Gt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Wa(e){return ao.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Gt(n,"fontSize")]=i),o!==void 0&&(t[Gt(n,"lineHeight")]=o),t},{})}const T0=g0(),L0={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"}},...$0,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:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:w0,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...C0},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,...Wa({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,...Wa({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,...Wa({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:[T0]}],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:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"}]}},R0={element:x0,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:L0,sourceCode:b0,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...ao.map(e=>({path:`${Gt(e,"fontFamily")}`}))]},fontRelations:{...ao.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Gt(t,"fontFamily")}`}),{})}},I0=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,initialSlideIndex:l=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:p})=>{const{type:b,coverFit:v,backgroundColor:g,imageGap:h,maxWidth:f,maxHeight:x,textTransition:S,title1Width:y,title2Width:w,title3Width:H,title1MarginLeft:N=0,title2MarginLeft:U=0,title3MarginLeft:O=0,titleRowMarginBottom:C=0,titleHeaderLayout:V="single-row",countCloseGap:$=0,closeIcon:R,closeIconMaxWidth:k,closeIconColor:T,closeIconHoverColor:m,contentMarginTop:M=0,iconMarginRight:E=0}=n,z=s.useCallback(we=>D.scalingValue(we,i??!1),[i]),ne=z(h??0),I=`${f}%`,W=`${x}%`,K=z($),ae=z(M),de=z(E),A=wi("title1",bi(n,"title1"),i),he=wi("title2",bi(n,"title2"),i),q=wi("title3",bi(n,"title3"),i),ce=wi("count",bi(n,"count"),i),Q=V==="mobile",be=!i||!!r,He=!o&&(!i||!!r),xe=s.useMemo(()=>Ar(t,b),[t,b]),[le,ee]=s.useState(l),ue=xe[le],oe=ue==null?void 0:ue.entry,[Fe,Ce]=s.useState(!1),[P,Y]=s.useState(null),[X,ie]=s.useState(!1),[j,B]=s.useState(null),[J,te]=s.useState(!1),[$e,ye]=s.useState(0),[F,ve]=s.useState(),[pe,Z]=s.useState(),[me,De]=s.useState(null),ge=s.useRef(null),G=s.useRef(0),Me=s.useRef(0),_e=s.useRef(0),rt=s.useRef(!1),Je=s.useRef(null),at=s.useRef(null),it=s.useRef(null),je=s.useRef(null),Se=s.useRef(null),We=s.useRef(null),Be=s.useRef(null),Ze=s.useCallback(()=>{const we=at.current;if(!we)return;const Ye=we.closest(`.${e}-lightbox-content-area`);if(!Ye)return we.getBoundingClientRect().width;const L=Array.from(Ye.children).reduce((re,fe)=>!(fe instanceof HTMLElement)||fe.contains(we)?re:re+fe.getBoundingClientRect().width,0);return Ye.getBoundingClientRect().width-L},[e]),Le=s.useCallback(()=>{ge.current&&(clearTimeout(ge.current),ge.current=null)},[]),Ve=s.useCallback(we=>{we===G.current&&(B(null),te(!1))},[]),se=s.useCallback(()=>{o||rt.current||(rt.current=!0,u==null||u(),Ce(!1),Je.current=setTimeout(()=>{p()},300))},[o,u,p]),Te=s.useCallback(we=>!!(we.closest("[data-controls]")||we.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:Xe,backdropStyle:ze,mediaAreaStyle:Re,overlayContentStyle:Pe,swipeHandlers:Ae,dismissAreaStyle:Ke}=au({enabled:He,onClose:se,animMs:300,isBlockedTarget:Te}),Oe=s.useCallback(we=>{d&&zd(we+1,c,!0)},[d,c]),Qe=s.useCallback(we=>{if(we)return we.getBoundingClientRect().height},[]),tt=s.useCallback(we=>{if(xe.length===0)return;const Ye=(we%xe.length+xe.length)%xe.length;if(Ye===le)return;const L=xe[le],re=xe[Ye];G.current+=1;const fe=G.current,ke=S==="fade"&&Dl(L==null?void 0:L.entry)!==Dl(re==null?void 0:re.entry),Ue=Qe(it.current),ot=ke?(()=>{const kt=Ze();Vn.flushSync(()=>{De(re.entry)}),it.current&&kt&&(it.current.style.width=`${kt}px`);const tn=Qe(it.current);return it.current&&(it.current.style.width=""),{measuredIncomingTitlesHeight:tn,incomingTitlesMeasureWidth:kt}})():void 0,St=Math.max(Ue??0,(ot==null?void 0:ot.measuredIncomingTitlesHeight)??0)||void 0;ye(fe),B(le),te(!0),ee(Ye),Oe(Ye),_e.current=Ye,ke?(Le(),St&&ve(St),ot!=null&&ot.incomingTitlesMeasureWidth&&Z(ot.incomingTitlesMeasureWidth),Y((L==null?void 0:L.entryIndex)??null),ie(!0),Me.current=re.entryIndex,ge.current=setTimeout(()=>{Y(null),ie(!1),ve(void 0),Z(void 0),De(null),ge.current=null},400)):(Le(),Y(null),ie(!1),ve(void 0),Z(void 0),De(null),Me.current=re.entryIndex)},[le,Le,Ze,Qe,xe,Oe,S]),nt=s.useCallback(()=>{Be.current=null},[]),xt=s.useCallback(we=>{!be||xe.length<=1||we.pointerType==="mouse"&&we.button!==0||we.target.closest("[data-controls]")||(Be.current={startX:we.clientX,startY:we.clientY,pointerId:we.pointerId})},[be,xe.length]),It=s.useCallback(we=>{var kt;if(!be||xe.length<=1||we.pointerType==="mouse"&&we.button!==0)return;if(Xe){nt();return}const Ye=Be.current;if(!Ye||Ye.pointerId!==we.pointerId||(nt(),we.target.closest("[data-controls]")))return;const re=we.clientX-Ye.startX,fe=we.clientY-Ye.startY,ke=Math.abs(re),Ue=Math.abs(fe);if(ke>=Df&&ke>Ue){tt(re>0?le-1:le+1);return}if(ke>Wl||Ue>Wl)return;const ot=(kt=je.current)==null?void 0:kt.getBoundingClientRect(),St=ot?ot.left+ot.width/2:window.innerWidth/2;tt(we.clientX<St?le-1:le+1)},[le,be,tt,Xe,nt,xe.length]),Tt=s.useCallback(we=>{const Ye=Be.current;(Ye==null?void 0:Ye.pointerId)===we.pointerId&&nt()},[nt]);su(),s.useEffect(()=>{We.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const we=requestAnimationFrame(()=>{Ce(!0),requestAnimationFrame(()=>{Se.current?Se.current.focus():je.current&&je.current.focus()})});return()=>{cancelAnimationFrame(we),Je.current&&clearTimeout(Je.current),ge.current&&clearTimeout(ge.current);const Ye=We.current;Ye&&document.contains(Ye)&&Ye.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var we;S!=="fade"&&(Me.current=((we=xe[le])==null?void 0:we.entryIndex)??0,Le(),Y(null),ie(!1),ve(void 0),Z(void 0))},[le,Le,xe,S]),s.useEffect(()=>{const we=Ye=>{if(Ye.key==="Escape"){se();return}if(Ye.key==="ArrowLeft"&&xe.length>1){tt(le-1);return}if(Ye.key==="ArrowRight"&&xe.length>1){tt(le+1);return}if(Ye.key==="Tab"&&je.current){const L=je.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),re=Array.from(L).filter(ot=>!ot.closest('[aria-hidden="true"]'));if(re.length===0)return;const fe=re[0],ke=re[re.length-1],Ue=document.activeElement;Ye.shiftKey?(Ue===fe||!je.current.contains(Ue))&&(Ye.preventDefault(),ke.focus()):(Ue===ke||!je.current.contains(Ue))&&(Ye.preventDefault(),fe.focus())}};return window.addEventListener("keydown",we),()=>window.removeEventListener("keydown",we)},[tt,se,le,xe.length]),s.useLayoutEffect(()=>{Le(),G.current=0,ye(0),B(null),te(!1),Y(null),ie(!1),ve(void 0),Z(void 0),De(null),ee(we=>{const Ye=Math.max(0,xe.length-1);return Math.min(we,Ye)})},[Le,t.length,b,xe.length]),s.useLayoutEffect(()=>{var L;const we=Math.max(0,xe.length-1),Ye=Math.min(Math.max(0,l),we);_e.current=Ye,Me.current=((L=xe[Ye])==null?void 0:L.entryIndex)??0,ee(Ye)},[l]);const ut=P!==null?t[P]:null,ft=j!==null?xe[j]:null,Et=(oe==null?void 0:oe.title1)||(oe==null?void 0:oe.title2)||(oe==null?void 0:oe.title3)||(ut==null?void 0:ut.title1)||(ut==null?void 0:ut.title2)||(ut==null?void 0:ut.title3),Lt=Uf(b,xe,t),bt=R!==null,Nt=Et||Lt||bt,Bt=Lt&&bt?{gap:K}:void 0,Zt=`${e}-titles-stack${Q?` ${e}-titles-stack-stacked`:""}`,en=`${e}-titles-layer-out${Q?` ${e}-titles-layer-out-stacked`:""}`,Rt=`${e}-titles-layer-out`,Ot=(N??0)>0||o,nn=z(C),pt=s.useMemo(()=>({title1Width:y??Xi.title1Width,title2Width:w??Xi.title2Width,title3Width:H??Xi.title3Width}),[y,w,H]),Ee=s.useMemo(()=>({title2MarginLeft:U,title3MarginLeft:O}),[U,O]),qe=s.useMemo(()=>oe?Jn(e,oe,A,he,q):[],[e,oe,A,he,q]),st=s.useMemo(()=>qe.map(we=>pt[we.widthKey]),[qe,pt]),mt=s.useMemo(()=>eo(qe.length,st),[qe.length,st]),vt=s.useMemo(()=>Oo(qe.length,st),[qe.length,st]),Mt=s.useMemo(()=>qe.filter(we=>we.prefix==="title1"),[qe]),gt=s.useMemo(()=>qe.filter(we=>we.prefix==="title2"||we.prefix==="title3"),[qe]),Vt=s.useMemo(()=>Qn(Mt,pt),[Mt,pt]),Wt=s.useMemo(()=>Qn(gt,pt),[gt,pt]),_t=s.useCallback((we,Ye)=>{const L=qe.findIndex(fe=>fe.prefix===we.prefix);if(!Q||Ye==="single-row")return{effectiveWidth:vt[L]??0,resolvedWidth:mt[L]??0,maxWidth:dn(L,mt)};if(Ye==="two-row-top"){const fe=Mt.findIndex(ke=>ke.prefix===we.prefix);return{effectiveWidth:Vt.effective[fe]??0,resolvedWidth:Vt.resolved[fe]??0,maxWidth:dn(fe,Vt.resolved)}}const re=gt.findIndex(fe=>fe.prefix===we.prefix);return{effectiveWidth:Wt.effective[re]??0,resolvedWidth:Wt.resolved[re]??0,maxWidth:dn(re,Wt.resolved)}},[qe,gt,Wt,vt,mt,Mt,Vt,Q]),qt=s.useCallback(we=>qd(qe,mt,Ee,we)+(Q?0:N??0),[qe,mt,Ee,Q,N]),Xt=s.useCallback(()=>Q?0:N??0,[Q,N]),Dt=s.useCallback(we=>gt.slice(0,we).reduce((Ye,L,re)=>Ye+(L.marginLeftKey?Ee[L.marginLeftKey]??0:0)+(Wt.resolved[re]??0),0),[gt,Wt.resolved,Ee]),jt=s.useCallback(we=>{const Ye=gt[we];return Dt(we)+(Ye.marginLeftKey?Ee[Ye.marginLeftKey]??0:0)+(Wt.resolved[we]??0)},[gt,Wt.resolved,Dt,Ee]),Ht=s.useCallback((we,Ye,L)=>{if(!Q||L==="single-row"){const ot=we.findIndex(Jt=>Jt.prefix===Ye.prefix),St=we.map(Jt=>pt[Jt.widthKey]),kt=eo(we.length,St);return{effectiveWidth:Oo(we.length,St)[ot]??0,resolvedWidth:kt[ot]??0,maxWidth:dn(ot,kt)}}if(L==="two-row-top"){const ot=we.filter(Jt=>Jt.prefix==="title1"),St=ot.findIndex(Jt=>Jt.prefix===Ye.prefix),{resolved:kt,effective:tn}=Qn(ot,pt);return{effectiveWidth:tn[St]??0,resolvedWidth:kt[St]??0,maxWidth:dn(St,kt)}}const re=we.filter(ot=>ot.prefix==="title2"||ot.prefix==="title3"),fe=re.findIndex(ot=>ot.prefix===Ye.prefix),{resolved:ke,effective:Ue}=Qn(re,pt);return{effectiveWidth:Ue[fe]??0,resolvedWidth:ke[fe]??0,maxWidth:dn(fe,ke)}},[pt,Q]),$t=(we,Ye,L)=>{const re=we.marginLeftKey?Ee[we.marginLeftKey]??0:0,{effectiveWidth:fe,resolvedWidth:ke,maxWidth:Ue}=L??_t(we,Ye),ot=Math.max(re,Zn),St=o&&Ye==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":we.prefix,style:{width:z(fe),...re>0?{marginLeft:z(re)}:{}},children:[a.jsx("p",{className:we.className,style:we.style,children:we.text}),St&&we.marginLeftKey?a.jsx("div",{"data-controls":we.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ke),style:{position:"absolute",top:0,left:z(-re),width:z(ot),height:"100%",pointerEvents:"auto"}}):null,St?a.jsx("div",{"data-controls":we.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ue),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:z(-yn/2),width:z(yn),height:"100%",pointerEvents:"auto"}}):null]},we.className)},_=(we="two-row")=>{const Ye=qe.findIndex(fe=>fe.prefix==="title1"),L=Ye>=0?mt[Ye]:pt.title1Width,re=we==="two-row"&&o;return a.jsx("div",{...re?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(L)}:{},style:{width:z(N??0),flexShrink:0,alignSelf:"stretch",...re?{pointerEvents:"auto"}:{}}})},Ie=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:A,"aria-hidden":"true",children:" "}),Ne=()=>a.jsx("span",{className:`${e}-entry-counter`,style:ce,"aria-live":"polite","aria-atomic":"true",children:Xf(xe,le,b,t)}),Ge=()=>Lt?o&&bt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Ne(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${La(K)} + ${K}))`,width:La(K),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Ne():null,dt=()=>!Lt&&!bt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Bt,children:[Ge(),bt?wt():null]}),Ft=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Lt||Et?Ie():null,Ot?_("single-row"):null,Pt(oe),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),dt(),Tn()]}),lt=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Lt||Et?Ie():null,Ot?_("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:X&&F?{minHeight:F}:void 0,children:[a.jsx("div",{ref:it,className:Zt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:di(me||oe)}),a.jsxs("div",{ref:at,className:Zt,style:{position:X?"absolute":"relative",inset:X?0:void 0,width:"100%",...X&&pe?{width:pe,maxWidth:"100%"}:void 0},children:[ut&&X?a.jsx("div",{className:`${en} ${e}-titles-fade-out`,children:di(ut)}):null,a.jsx("div",{className:`${e}-titles-layer-in${X?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:di(oe)})]})]}),dt(),Tn()]}),wt=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:D.scalingValue(k??0,i),height:D.scalingValue(k??0,i),marginRight:de,"--close-icon-hover-color":m},children:[a.jsx("button",{ref:Se,type:"button",className:`${e}-close-icon-inner`,onClick:se,"aria-label":"Close",children:a.jsx(ln,{url:R??"",fill:T,hoverFill:i&&!r?T:m,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:de,height:"100%",pointerEvents:"auto"}})]}),zt=(we,Ye)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[Lt||Et?Ie():null,Ot?_("two-row"):null,Ye!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Ye},children:we}):a.jsxs(a.Fragment,{children:[we,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),dt()]}),Pt=we=>{if(!we)return null;const Ye=Jn(e,we,A,he,q);return a.jsx(a.Fragment,{children:Ye.map(L=>$t(L,"single-row",Ht(Ye,L,"single-row")))})},on=we=>{if(!we)return null;const Ye=Jn(e,we,A,he,q),L=Ye.find(re=>re.prefix==="title1");return L?$t(L,"two-row-top",Ht(Ye,L,"two-row-top")):null},pn=(we,Ye=!1)=>{const L=we?Jn(e,we,A,he,q):[],re=L.filter(Ue=>Ue.prefix==="title2"||Ue.prefix==="title3"),fe=o&&Ye;return re.length>0||fe||(C??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[re.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[re.map(Ue=>$t(Ue,"two-row-bottom",Ht(L,Ue,"two-row-bottom"))),Ye&&o?a.jsxs(a.Fragment,{children:[ua(),pa()]}):null]}):null,(C??0)>0||fe?a.jsx("div",{"data-controls":fe?"titleRowMarginBottom":void 0,"data-controls-axis":fe?"y":void 0,"data-controls-reverse":fe?"":void 0,className:fe?`${e}-control`:void 0,style:{height:nn,width:"100%",flexShrink:0,pointerEvents:fe?"auto":"none"}}):null]}):null},ci=(we,Ye=!1)=>a.jsxs(a.Fragment,{children:[zt(on(we)),pn(we,Ye)]}),di=we=>Q?a.jsx("div",{className:`${e}-titles-row-two-row`,children:ci(we)}):we?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Pt(we)}):null,tr=()=>{const we=Q?-1:qe.findIndex(re=>re.prefix==="title1"),Ye=!Q&&(o||(N??0)>0)?(()=>{const re=N??0,fe=we>=0?mt[we]:pt.title1Width,ke=Math.max(re,Zn);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(fe),style:{position:"absolute",top:0,left:0,width:z(ke),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,L=qe.flatMap((re,fe)=>{if(!re.marginLeftKey)return[];const ke=Ee[re.marginLeftKey]??0,Ue=Gd(qe,mt,Ee,fe)+Xt(),ot=Math.max(ke,Zn);return a.jsx("div",{"data-controls":re.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(mt[fe]),style:{position:"absolute",top:0,left:z(Ue),width:z(ot),height:"100%",pointerEvents:"auto"}},re.marginLeftKey)});return Ye?[Ye,...L]:L},nr=()=>qe.map((we,Ye)=>{const L=dn(Ye,mt),fe=qt(Ye)-yn/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(L),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:z(fe),width:z(yn),height:"100%",pointerEvents:"auto"}})},`${we.widthKey}-junction`)}),ua=()=>gt.flatMap((we,Ye)=>{if(!we.marginLeftKey)return[];const L=Ee[we.marginLeftKey]??0,re=Dt(Ye),fe=Math.max(L,Zn),{resolvedWidth:ke}=_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(ke),style:{position:"absolute",top:0,left:z(re),width:z(fe),height:"100%",pointerEvents:"auto"}},we.marginLeftKey)}),pa=()=>gt.map((we,Ye)=>{const{maxWidth:L}=_t(we,"two-row-bottom"),fe=jt(Ye)-yn/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(L),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:z(fe),width:z(yn),height:"100%",pointerEvents:"auto"}})},`${we.widthKey}-junction`)}),Tn=()=>!o||Q?null:a.jsxs(a.Fragment,{children:[tr(),nr()]}),Ei=we=>{const Ye=!we.objectFit&&jn(v);return{className:`${e}-slide-image-cell${Ye?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:I,maxHeight:W,...Ye?{"--image-aspect-ratio":ca(v)}:{}}}},ir=we=>we.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":we.objectFit}}:jn(v)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ui=we=>{if(we.length===0)return null;const Ye=we.length>1,L=La(ne),re=`calc(-0.5 * (${L} + ${ne}))`;if(we.length===1){const fe=we[0];return a.jsx("div",{...Ei(fe),children:a.jsx("img",{...ir(fe),src:fe.url,alt:fe.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:Ye?{gap:ne}:void 0,children:we.map((fe,ke)=>a.jsxs("div",{...Ei(fe),children:[a.jsx("img",{...ir(fe),src:fe.url,alt:fe.name??"",draggable:!1}),o&&Ye&&ke<we.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:re,width:L,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${fe.url}-${ke}`))})},or=!!(oe!=null&&oe.title2||oe!=null&&oe.title3||ut!=null&&ut.title2||ut!=null&&ut.title3||(C??0)>0||o),ma=()=>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:it,className:Zt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ci(me||oe)}),a.jsxs("div",{ref:at,className:`${e}-titles-row-two-row`,style:{...X&&F?{minHeight:F}:void 0,...X&&pe?{width:pe,maxWidth:"100%"}:void 0},children:[zt(a.jsxs("div",{className:Zt,style:{position:X?"absolute":"relative",inset:X?0:void 0,width:"100%"},children:[ut&&X?a.jsx("div",{className:`${Rt} ${e}-titles-fade-out`,children:on(ut)}):null,a.jsx("div",{className:`${e}-titles-layer-in${X?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:on(oe)})]}),X&&F?F:void 0),or?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[ut&&X?a.jsx("div",{className:`${en} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:pn(ut)}):null,a.jsx("div",{className:`${e}-titles-layer-in${X?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${Q?` ${e}-titles-layer-in-stacked`:""}`,children:pn(oe,!0)})]}):null]})]}),ga=()=>{const we=or;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:ci(oe,!0)}),Tn()]})};return a.jsxs("div",{ref:je,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{Xe||se()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:bt?void 0:-1,style:{opacity:Fe?1:0,transition:"opacity 300ms ease",pointerEvents:Fe?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:g,...ze}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Ke,...Ae,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Re,onClick:we=>we.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":be&&xe.length>1?"true":"false",onPointerDown:be?xt:void 0,onPointerUp:be?It:void 0,onPointerCancel:be?Tt:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[ft&&J?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:we=>{we.target===we.currentTarget&&Ve($e)},children:a.jsx("div",{className:`${e}-slide-area`,children:ui(ft.images)})},`slide-out-${$e}`):null,a.jsx("div",{className:`${e}-slide-layer-in${J?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:ue?ui(ue.images):null})},`slide-in-${$e}-${le}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Pe,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:ae,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...Q?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${Q?` ${e}-lightbox-content-area-stacked`:""}`,children:Nt&&a.jsx("div",{className:`${e}-text-bar-cell${Q?` ${e}-text-bar-cell-stacked`:""}`,style:Q?void 0:{flex:1,minWidth:0,width:"100%"},children:Q?S==="fade"?ma():ga():S==="fade"?lt():Ft()})})})]})]})]})};function E0(e){return`
15250
15250
  .${e}-wrapper {
15251
15251
  position: relative;
15252
15252
  width: 100%;
@@ -15768,7 +15768,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
15768
15768
  pointer-events: auto;
15769
15769
  z-index: 10;
15770
15770
  }
15771
- `}const M0=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r,metadata:l})=>{const{prefix:d}=D.useScopedStyles(),c=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:b}=e,v=s.useRef(null),[g,h]=s.useState(!1),[f,x]=s.useState(0),S=s.useRef(!1),y=s.useRef(!1),w=s.useRef(!1),H=s.useMemo(()=>(t??[]).filter($=>Qi($).length>0),[t]),N=g&&H.length>0,Y=!n,O=s.useCallback(()=>{Y&&(w.current=!0,zf(y.current,c),y.current=!1)},[Y,c]),C=($=0)=>{if(H.length===0||n&&!i&&!o)return;const R=Ar(H,b),k=Math.max(0,Math.min($,R.length-1));if(x(k),Y){const T=Bd();zd(k+1,c,T),y.current=!T}h(!0)},V=s.useCallback(()=>{h(!1),w.current=!1},[]);return s.useEffect(()=>{!n||i||o||h(!1)},[n,i,o]),s.useEffect(()=>{if(!Y||S.current)return;S.current=!0;const $=Hl(c);if(!$)return;const R=Ol($,Ar(H,b).length);R<0||(x(R),h(!0))},[H,c,Y,b]),s.useEffect(()=>{if(!Y)return;const $=()=>{if(w.current){w.current=!1,h(!1);return}const R=Hl(c);if(!R){h(!1);return}const k=Ol(R,Ar(H,b).length);if(k<0){h(!1);return}y.current=!1,x(k),h(!0)};return window.addEventListener("popstate",$),()=>window.removeEventListener("popstate",$)},[H,c,Y,b]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:v,className:`${d}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:E0(d)}}),u?a.jsx("button",{type:"button",className:`${d}-cover ${jn(p)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>C(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...jn(p)?{"--image-aspect-ratio":ca(p)}:{}},"aria-label":"Open journal gallery",children:a.jsx("img",{className:`${d}-cover-image ${jn(p)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),N&&typeof document<"u"&&(()=>{const $=(r?document.getElementById(r):null)??document.body;return Vn.createPortal(a.jsx(I0,{prefix:d,entries:H,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:f,enableUrlSync:Y,journalItemId:c,onBeforeClose:O,onClose:V}),$)})()]})},P0=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
15771
+ `}const M0=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r,metadata:l})=>{const{prefix:d}=D.useScopedStyles(),c=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:b}=e,v=s.useRef(null),[g,h]=s.useState(!1),[f,x]=s.useState(0),S=s.useRef(!1),y=s.useRef(!1),w=s.useRef(!1),H=s.useMemo(()=>(t??[]).filter($=>Qi($).length>0),[t]),N=g&&H.length>0,U=!n,O=s.useCallback(()=>{U&&(w.current=!0,zf(y.current,c),y.current=!1)},[U,c]),C=($=0)=>{if(H.length===0||n&&!i&&!o)return;const R=Ar(H,b),k=Math.max(0,Math.min($,R.length-1));if(x(k),U){const T=Bd();zd(k+1,c,T),y.current=!T}h(!0)},V=s.useCallback(()=>{h(!1),w.current=!1},[]);return s.useEffect(()=>{!n||i||o||h(!1)},[n,i,o]),s.useEffect(()=>{if(!U||typeof window>"u")return;const $=window.history.scrollRestoration;return window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration=$}},[U]),s.useEffect(()=>{if(!U||S.current)return;S.current=!0;const $=Hl(c);if(!$)return;const R=Ol($,Ar(H,b).length);R<0||(x(R),h(!0))},[H,c,U,b]),s.useEffect(()=>{if(!U)return;const $=()=>{if(w.current){w.current=!1,h(!1);return}const R=Hl(c);if(!R){h(!1);return}const k=Ol(R,Ar(H,b).length);if(k<0){h(!1);return}y.current=!1,x(k),h(!0)};return window.addEventListener("popstate",$),()=>window.removeEventListener("popstate",$)},[H,c,U,b]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:v,className:`${d}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:E0(d)}}),u?a.jsx("button",{type:"button",className:`${d}-cover ${jn(p)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>C(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...jn(p)?{"--image-aspect-ratio":ca(p)}:{}},"aria-label":"Open journal gallery",children:a.jsx("img",{className:`${d}-cover-image ${jn(p)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),N&&typeof document<"u"&&(()=>{const $=(r?document.getElementById(r):null)??document.body;return Vn.createPortal(a.jsx(I0,{prefix:d,entries:H,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:f,enableUrlSync:U,journalItemId:c,onBeforeClose:O,onClose:V}),$)})()]})},P0=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
15772
15772
  import { createPortal } from 'react-dom';
15773
15773
  import { CommonComponentProps } from '../props';
15774
15774
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -16373,6 +16373,15 @@ export const LightboxJournal = ({ settings, content, isEditor, isEditMode, isPre
16373
16373
  setLightboxOpen(false);
16374
16374
  }, [isEditor, isEditMode, isPreviewMode]);
16375
16375
 
16376
+ useEffect(() => {
16377
+ if (!shouldSyncUrl || typeof window === 'undefined') return;
16378
+ const originalScrollRestoration = window.history.scrollRestoration;
16379
+ window.history.scrollRestoration = 'manual';
16380
+ return () => {
16381
+ window.history.scrollRestoration = originalScrollRestoration;
16382
+ };
16383
+ }, [shouldSyncUrl]);
16384
+
16376
16385
  useEffect(() => {
16377
16386
  if (!shouldSyncUrl || didApplyInitialUrlRef.current) return;
16378
16387
  didApplyInitialUrlRef.current = true;
@@ -16559,7 +16568,7 @@ export type LightboxJournalSettings = {
16559
16568
  width: 32px;
16560
16569
  height: 32px;
16561
16570
  }
16562
- `}function z0(e){return new Promise(t=>{const n=new Image;n.onload=()=>{t({aspectRatio:n.naturalHeight/n.naturalWidth,naturalWidth:n.naturalWidth})},n.onerror=()=>{t({aspectRatio:1,naturalWidth:700})},n.src=e})}async function B0(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await z0(i)]));return new Map(n)}function V0({settings:e,content:t=[],isEditor:n}){const{prefix:i}=D.useScopedStyles(),[o,r]=s.useState(null),[l,d]=s.useState([]),[c,u]=s.useState(0),p=s.useRef(0),[b,v]=s.useState({x:0,y:0}),[g,h]=s.useState("none"),f=s.useRef({x:0,y:0}),[x,S]=s.useState(!1),[y,w]=s.useState(!1),H=s.useRef(new Map),{imageSize:N=O0,cursor:Y="system",target:O="area",position:C="random",visible:V="all",defaultCursor:$=null,hoverCursor:R=null}=e,k=t.filter(I=>{var W;return!!((W=I==null?void 0:I.image)!=null&&W.url)}),T=s.useMemo(()=>j0(i),[i]),m=s.useCallback((I,W,K=l)=>{if(!o)return;const ae=o.getBoundingClientRect(),de=I-ae.left,A=W-ae.top;v({x:de,y:A}),h(D0(de,A,K,o,Y,O,R,$))},[o,l,Y,O,R,$]);s.useEffect(()=>{const I=[...k.map(K=>K.image.url),$,R].filter(K=>!!K);if(I.length===0){H.current=new Map,w(!0);return}let W=!1;return w(!1),B0(I).then(K=>{W||(H.current=K,w(!0))}),()=>{W=!0}},[t,$,R]),s.useEffect(()=>{if(!o)return;const I=K=>{K.stopPropagation(),f.current={x:K.clientX,y:K.clientY},m(K.clientX,K.clientY)},W=()=>{x&&m(f.current.x,f.current.y)};return o.addEventListener("mousemove",I),window.addEventListener("scroll",W,!0),()=>{o.removeEventListener("mousemove",I),window.removeEventListener("scroll",W,!0)}},[o,x,m]),s.useEffect(()=>{!o||!x||m(f.current.x,f.current.y)},[l,o,x,m]),s.useEffect(()=>{x||h("none")},[x]);const M=(I,W,K,ae={})=>{var Q,be;if(!((Q=I==null?void 0:I.image)!=null&&Q.url))return null;const de=((be=H.current.get(I.image.url))==null?void 0:be.aspectRatio)??1,A=mc(I.image.url,N,H.current),{heightPx:he}=Vr(A,de);let q=0,ce=0;return C==="same"?{x:q,y:ce}=pc(W,K,A,de):(q=ae.x??Math.random()*W,ce=ae.y??Math.random()*K,{x:q,y:ce}=ds(q,ce,W,K,A,he)),{id:p.current++,url:I.image.url,link:I.link,name:I.image.name,x:q,y:ce,xRatio:q/W,yRatio:ce/K,aspectRatio:de,widthPx:A}},E=()=>{if(!o)return;const I=o.getBoundingClientRect(),W=I.width,K=I.height;W===0||K===0||d(ae=>ae.length===0?ae:ae.map(de=>{const A=N.sizeType==="random"?de.widthPx:mc(de.url,N,H.current),{heightPx:he}=Vr(A,de.aspectRatio);if(C==="same"){const{x:Q,y:be}=pc(W,K,A,de.aspectRatio);return{...de,x:Q,y:be,widthPx:A}}const{x:q,y:ce}=ds(de.xRatio*W,de.yRatio*K,W,K,A,he);return{...de,x:q,y:ce,widthPx:A}}))};s.useEffect(()=>{if(!o||k.length===0||!y)return;const I=o.getBoundingClientRect(),W=I.width,K=I.height,ae=M(k[0],W,K);ae&&(d([ae]),u(k.length>1?1:0))},[N,C,o,t,y]),s.useEffect(()=>{if(!o)return;E();const I=new ResizeObserver(E);return I.observe(o),window.addEventListener("resize",E),()=>{I.disconnect(),window.removeEventListener("resize",E)}},[o,C,N,l.length]),s.useEffect(()=>{V==="last One"&&d(I=>I.length>0?[I[I.length-1]]:[])},[V]);const z=I=>{if(!o||k.length===0||!y)return;const W=o.getBoundingClientRect(),K=I.clientX-W.left,ae=I.clientY-W.top;if(O==="image"&&!cu(K,ae,l))return;let de=0,A=0;C==="on Click"?(de=K,A=ae):C==="same"?(de=W.width/2,A=W.height/2):(de=Math.random()*W.width,A=Math.random()*W.height);const he=k[c%k.length],q=M(he,W.width,W.height,{x:de,y:A});if(!q)return;const ce=V==="all"?[...l,q]:[q];d(ce),u(Q=>(Q+1)%k.length),m(I.clientX,I.clientY,ce)},ne=Y==="custom"&&g!=="none";return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:T}}),a.jsxs("div",{ref:r,onClick:z,onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),className:`${i}-root`,style:{cursor:ne?"none":"default"},children:[l.map(I=>a.jsx("div",{className:`${i}-wrapper`,style:{top:`${I.y}px`,left:`${I.x}px`,width:`${I.widthPx}px`,cursor:ne?"none":"default"},children:O==="area"&&I.link?a.jsx("a",{href:I.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:a.jsx("img",{src:I.url,alt:I.name,className:`${i}-image`})}):a.jsx("img",{src:I.url,alt:I.name,className:`${i}-image`})},I.id)),x&&ne&&a.jsx("div",{className:`${i}-cursor`,style:{left:`${b.x}px`,top:`${b.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const G0=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
16571
+ `}function z0(e){return new Promise(t=>{const n=new Image;n.onload=()=>{t({aspectRatio:n.naturalHeight/n.naturalWidth,naturalWidth:n.naturalWidth})},n.onerror=()=>{t({aspectRatio:1,naturalWidth:700})},n.src=e})}async function B0(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await z0(i)]));return new Map(n)}function V0({settings:e,content:t=[],isEditor:n}){const{prefix:i}=D.useScopedStyles(),[o,r]=s.useState(null),[l,d]=s.useState([]),[c,u]=s.useState(0),p=s.useRef(0),[b,v]=s.useState({x:0,y:0}),[g,h]=s.useState("none"),f=s.useRef({x:0,y:0}),[x,S]=s.useState(!1),[y,w]=s.useState(!1),H=s.useRef(new Map),{imageSize:N=O0,cursor:U="system",target:O="area",position:C="random",visible:V="all",defaultCursor:$=null,hoverCursor:R=null}=e,k=t.filter(I=>{var W;return!!((W=I==null?void 0:I.image)!=null&&W.url)}),T=s.useMemo(()=>j0(i),[i]),m=s.useCallback((I,W,K=l)=>{if(!o)return;const ae=o.getBoundingClientRect(),de=I-ae.left,A=W-ae.top;v({x:de,y:A}),h(D0(de,A,K,o,U,O,R,$))},[o,l,U,O,R,$]);s.useEffect(()=>{const I=[...k.map(K=>K.image.url),$,R].filter(K=>!!K);if(I.length===0){H.current=new Map,w(!0);return}let W=!1;return w(!1),B0(I).then(K=>{W||(H.current=K,w(!0))}),()=>{W=!0}},[t,$,R]),s.useEffect(()=>{if(!o)return;const I=K=>{K.stopPropagation(),f.current={x:K.clientX,y:K.clientY},m(K.clientX,K.clientY)},W=()=>{x&&m(f.current.x,f.current.y)};return o.addEventListener("mousemove",I),window.addEventListener("scroll",W,!0),()=>{o.removeEventListener("mousemove",I),window.removeEventListener("scroll",W,!0)}},[o,x,m]),s.useEffect(()=>{!o||!x||m(f.current.x,f.current.y)},[l,o,x,m]),s.useEffect(()=>{x||h("none")},[x]);const M=(I,W,K,ae={})=>{var Q,be;if(!((Q=I==null?void 0:I.image)!=null&&Q.url))return null;const de=((be=H.current.get(I.image.url))==null?void 0:be.aspectRatio)??1,A=mc(I.image.url,N,H.current),{heightPx:he}=Vr(A,de);let q=0,ce=0;return C==="same"?{x:q,y:ce}=pc(W,K,A,de):(q=ae.x??Math.random()*W,ce=ae.y??Math.random()*K,{x:q,y:ce}=ds(q,ce,W,K,A,he)),{id:p.current++,url:I.image.url,link:I.link,name:I.image.name,x:q,y:ce,xRatio:q/W,yRatio:ce/K,aspectRatio:de,widthPx:A}},E=()=>{if(!o)return;const I=o.getBoundingClientRect(),W=I.width,K=I.height;W===0||K===0||d(ae=>ae.length===0?ae:ae.map(de=>{const A=N.sizeType==="random"?de.widthPx:mc(de.url,N,H.current),{heightPx:he}=Vr(A,de.aspectRatio);if(C==="same"){const{x:Q,y:be}=pc(W,K,A,de.aspectRatio);return{...de,x:Q,y:be,widthPx:A}}const{x:q,y:ce}=ds(de.xRatio*W,de.yRatio*K,W,K,A,he);return{...de,x:q,y:ce,widthPx:A}}))};s.useEffect(()=>{if(!o||k.length===0||!y)return;const I=o.getBoundingClientRect(),W=I.width,K=I.height,ae=M(k[0],W,K);ae&&(d([ae]),u(k.length>1?1:0))},[N,C,o,t,y]),s.useEffect(()=>{if(!o)return;E();const I=new ResizeObserver(E);return I.observe(o),window.addEventListener("resize",E),()=>{I.disconnect(),window.removeEventListener("resize",E)}},[o,C,N,l.length]),s.useEffect(()=>{V==="last One"&&d(I=>I.length>0?[I[I.length-1]]:[])},[V]);const z=I=>{if(!o||k.length===0||!y)return;const W=o.getBoundingClientRect(),K=I.clientX-W.left,ae=I.clientY-W.top;if(O==="image"&&!cu(K,ae,l))return;let de=0,A=0;C==="on Click"?(de=K,A=ae):C==="same"?(de=W.width/2,A=W.height/2):(de=Math.random()*W.width,A=Math.random()*W.height);const he=k[c%k.length],q=M(he,W.width,W.height,{x:de,y:A});if(!q)return;const ce=V==="all"?[...l,q]:[q];d(ce),u(Q=>(Q+1)%k.length),m(I.clientX,I.clientY,ce)},ne=U==="custom"&&g!=="none";return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:T}}),a.jsxs("div",{ref:r,onClick:z,onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),className:`${i}-root`,style:{cursor:ne?"none":"default"},children:[l.map(I=>a.jsx("div",{className:`${i}-wrapper`,style:{top:`${I.y}px`,left:`${I.x}px`,width:`${I.widthPx}px`,cursor:ne?"none":"default"},children:O==="area"&&I.link?a.jsx("a",{href:I.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:a.jsx("img",{src:I.url,alt:I.name,className:`${i}-image`})}):a.jsx("img",{src:I.url,alt:I.name,className:`${i}-image`})},I.id)),x&&ne&&a.jsx("div",{className:`${i}-cursor`,style:{left:`${b.x}px`,top:`${b.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const G0=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
16563
16572
  import { CommonComponentProps } from '../props';
16564
16573
  import { useScopedStyles } from '../utils/index';
16565
16574
 
@@ -17199,7 +17208,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
17199
17208
  display: block;
17200
17209
  pointer-events: none;
17201
17210
  }
17202
- `}function Z0(e){return e==="blur"?Y0:e==="greyscale"?U0:0}function bo(e,t=1,n=1){const i=Z0(e)*Math.max(0,Math.min(1,t));if(e==="greyscale")return`grayscale(${i}%)`;if(e==="blur"){const o=i/4;return o<=0?"none":`blur(${o/Math.max(n,1)}px)`}return"none"}function gc(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function J0(e,t){return t<=1?0:(e-1+t)%t}function Q0(e,t=1){return!e||e.height===0?t:e.width/e.height}function ex(e,t,n,i,o){if(e<=0||t<=0)return{widthPercent:i,heightPercent:o};const r=e*i/100,l=t*o/100;let d=r,c=d/n;return c>l&&(c=l,d=c*n),{widthPercent:d/e*100,heightPercent:c/t*100}}function hc(e,t,n){if(e<=0||t<=0)return 1;const i=e*n.widthPercent/100,o=t*n.heightPercent/100;return i<=0||o<=0?1:Math.max(e/i,t/o)}function du(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function fc(e,t,n){return{...du(e),[`--${n}-stage-scale`]:t}}function tx(e,t){[...new Set(e.filter(Boolean))].forEach(i=>{const o=new Image;o.onload=()=>{o.naturalWidth>0&&o.naturalHeight>0&&t(i,{width:o.naturalWidth,height:o.naturalHeight})},o.src=i})}function nx({settings:e,content:t,isEditor:n,isPreviewMode:i}){var ie,j,B,J,te,$e,ye;const{prefix:o}=D.useScopedStyles(),r=s.useMemo(()=>K0(o),[o]),{imageSize:l,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:p="greyscale"}=e,b=t??[],v=gc(b.length),[g,h]=s.useState(v.activeIndex),[f,x]=s.useState(v.backgroundIndex),[S,y]=s.useState(!1),[w,H]=s.useState(!1),[N,Y]=s.useState(null),[O,C]=s.useState(null),[V,$]=s.useState(0),[R,k]=s.useState(1),[T,m]=s.useState("none"),[M,E]=s.useState("next"),[z,ne]=s.useState({}),[I,W]=s.useState({width:0,height:0}),K=s.useRef(null),ae=s.useRef(null),de=!n||!!i,A=l??60,he=Math.max(10,Math.min(100,d??A)),q=Math.max(10,Math.min(100,c??A)),ce=Math.max(100,u),Q=bo(p),be=s.useCallback(F=>{const ve=Q0(F?z[F]:void 0);return ex(I.width,I.height,ve,he,q)},[I.height,I.width,z,q,he]);s.useEffect(()=>{const F=ae.current;if(!F)return;const ve=new ResizeObserver(([pe])=>{const{width:Z,height:me}=pe.contentRect;W({width:Z,height:me})});return ve.observe(F),()=>ve.disconnect()},[]),s.useEffect(()=>{const F=(t??[]).map(ve=>{var pe;return(pe=ve.image)==null?void 0:pe.url}).filter(ve=>!!ve);tx(F,(ve,pe)=>{ne(Z=>{var me,De;return((me=Z[ve])==null?void 0:me.width)===pe.width&&((De=Z[ve])==null?void 0:De.height)===pe.height?Z:{...Z,[ve]:pe}})})},[t]),s.useEffect(()=>{const{backgroundIndex:F,activeIndex:ve}=gc(b.length);h(ve),x(F),y(!1),H(!1),Y(null),C(null),$(0),k(1),m("none"),E("next")},[b.length,t]),s.useEffect(()=>()=>{K.current&&clearTimeout(K.current)},[]);const He=s.useCallback(F=>{var ge,G,Me,_e;if(!de||S||b.length<=1)return;const ve=F==="next"?(g+1)%b.length:(g-1+b.length)%b.length,pe=be((G=(ge=b[g])==null?void 0:ge.image)==null?void 0:G.url),Z=be((_e=(Me=b[ve])==null?void 0:Me.image)==null?void 0:_e.url),me=hc(I.width,I.height,pe),De=hc(I.width,I.height,Z);K.current&&clearTimeout(K.current),E(F),H(!0),y(!0),F==="next"?(Y(g),C(ve),$(0),k(1),m(bo(p,0,1))):(x(J0(ve,b.length)),Y(ve),C(g),$(1),k(De),m(bo(p,1,De))),requestAnimationFrame(()=>{H(!1),requestAnimationFrame(()=>{F==="next"?($(1),k(me),m(bo(p,1,me))):($(0),k(1),m(bo(p,0,1)))})}),K.current=setTimeout(()=>{F==="next"&&x(g),h(ve),Y(null),C(null),y(!1)},ce)},[g,p,I.height,I.width,be,S,de,b,ce]),xe=b[g],le=f!==null?b[f]:null,ee=N!==null?b[N]:null,ue=O!==null?b[O]:null,oe=b.length<=1?0:(g-1+b.length)%b.length,Fe=b.length<=1?0:(g+1)%b.length,Ce=be((ie=xe==null?void 0:xe.image)==null?void 0:ie.url),P=be((j=ee==null?void 0:ee.image)==null?void 0:j.url),U=be((B=ue==null?void 0:ue.image)==null?void 0:B.url),X={[`--${o}-transition-ms`]:`${ce}ms`};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:r}}),a.jsxs("div",{ref:ae,className:yt(`${o}-wrapper`,w&&`${o}-snap`,n&&!i&&`${o}-editor`),style:X,"aria-label":"Zoom gallery",children:[((J=le==null?void 0:le.image)==null?void 0:J.url)&&a.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:le.image.url,alt:"",style:{filter:Q}})}),S&&((te=ee==null?void 0:ee.image)==null?void 0:te.url)&&a.jsx("div",{className:yt(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${M}`),style:fc(P,R,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:ee.image.url,alt:"",style:{filter:T}})}),S&&(($e=ue==null?void 0:ue.image)==null?void 0:$e.url)&&a.jsx("div",{className:yt(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${M}`),style:fc(U,V,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-image`,src:ue.image.url,alt:""})}),!S&&((ye=xe==null?void 0:xe.image)==null?void 0:ye.url)&&a.jsx("div",{className:yt(`${o}-stage`,`${o}-foreground`),style:du(Ce),children:a.jsx("img",{className:`${o}-image`,src:xe.image.url,alt:xe.image.name??""})}),de&&b.length>1&&!S&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:yt(`${o}-nav`,`${o}-nav-prev`),onClick:()=>He("prev"),"aria-label":`Show previous image (${oe+1} of ${b.length})`}),a.jsx("button",{type:"button",className:yt(`${o}-nav`,`${o}-nav-next`),onClick:()=>He("next"),"aria-label":`Show next image (${Fe+1} of ${b.length})`})]})]})]})}const ix=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
17211
+ `}function Z0(e){return e==="blur"?Y0:e==="greyscale"?U0:0}function bo(e,t=1,n=1){const i=Z0(e)*Math.max(0,Math.min(1,t));if(e==="greyscale")return`grayscale(${i}%)`;if(e==="blur"){const o=i/4;return o<=0?"none":`blur(${o/Math.max(n,1)}px)`}return"none"}function gc(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function J0(e,t){return t<=1?0:(e-1+t)%t}function Q0(e,t=1){return!e||e.height===0?t:e.width/e.height}function ex(e,t,n,i,o){if(e<=0||t<=0)return{widthPercent:i,heightPercent:o};const r=e*i/100,l=t*o/100;let d=r,c=d/n;return c>l&&(c=l,d=c*n),{widthPercent:d/e*100,heightPercent:c/t*100}}function hc(e,t,n){if(e<=0||t<=0)return 1;const i=e*n.widthPercent/100,o=t*n.heightPercent/100;return i<=0||o<=0?1:Math.max(e/i,t/o)}function du(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function fc(e,t,n){return{...du(e),[`--${n}-stage-scale`]:t}}function tx(e,t){[...new Set(e.filter(Boolean))].forEach(i=>{const o=new Image;o.onload=()=>{o.naturalWidth>0&&o.naturalHeight>0&&t(i,{width:o.naturalWidth,height:o.naturalHeight})},o.src=i})}function nx({settings:e,content:t,isEditor:n,isPreviewMode:i}){var ie,j,B,J,te,$e,ye;const{prefix:o}=D.useScopedStyles(),r=s.useMemo(()=>K0(o),[o]),{imageSize:l,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:p="greyscale"}=e,b=t??[],v=gc(b.length),[g,h]=s.useState(v.activeIndex),[f,x]=s.useState(v.backgroundIndex),[S,y]=s.useState(!1),[w,H]=s.useState(!1),[N,U]=s.useState(null),[O,C]=s.useState(null),[V,$]=s.useState(0),[R,k]=s.useState(1),[T,m]=s.useState("none"),[M,E]=s.useState("next"),[z,ne]=s.useState({}),[I,W]=s.useState({width:0,height:0}),K=s.useRef(null),ae=s.useRef(null),de=!n||!!i,A=l??60,he=Math.max(10,Math.min(100,d??A)),q=Math.max(10,Math.min(100,c??A)),ce=Math.max(100,u),Q=bo(p),be=s.useCallback(F=>{const ve=Q0(F?z[F]:void 0);return ex(I.width,I.height,ve,he,q)},[I.height,I.width,z,q,he]);s.useEffect(()=>{const F=ae.current;if(!F)return;const ve=new ResizeObserver(([pe])=>{const{width:Z,height:me}=pe.contentRect;W({width:Z,height:me})});return ve.observe(F),()=>ve.disconnect()},[]),s.useEffect(()=>{const F=(t??[]).map(ve=>{var pe;return(pe=ve.image)==null?void 0:pe.url}).filter(ve=>!!ve);tx(F,(ve,pe)=>{ne(Z=>{var me,De;return((me=Z[ve])==null?void 0:me.width)===pe.width&&((De=Z[ve])==null?void 0:De.height)===pe.height?Z:{...Z,[ve]:pe}})})},[t]),s.useEffect(()=>{const{backgroundIndex:F,activeIndex:ve}=gc(b.length);h(ve),x(F),y(!1),H(!1),U(null),C(null),$(0),k(1),m("none"),E("next")},[b.length,t]),s.useEffect(()=>()=>{K.current&&clearTimeout(K.current)},[]);const He=s.useCallback(F=>{var ge,G,Me,_e;if(!de||S||b.length<=1)return;const ve=F==="next"?(g+1)%b.length:(g-1+b.length)%b.length,pe=be((G=(ge=b[g])==null?void 0:ge.image)==null?void 0:G.url),Z=be((_e=(Me=b[ve])==null?void 0:Me.image)==null?void 0:_e.url),me=hc(I.width,I.height,pe),De=hc(I.width,I.height,Z);K.current&&clearTimeout(K.current),E(F),H(!0),y(!0),F==="next"?(U(g),C(ve),$(0),k(1),m(bo(p,0,1))):(x(J0(ve,b.length)),U(ve),C(g),$(1),k(De),m(bo(p,1,De))),requestAnimationFrame(()=>{H(!1),requestAnimationFrame(()=>{F==="next"?($(1),k(me),m(bo(p,1,me))):($(0),k(1),m(bo(p,0,1)))})}),K.current=setTimeout(()=>{F==="next"&&x(g),h(ve),U(null),C(null),y(!1)},ce)},[g,p,I.height,I.width,be,S,de,b,ce]),xe=b[g],le=f!==null?b[f]:null,ee=N!==null?b[N]:null,ue=O!==null?b[O]:null,oe=b.length<=1?0:(g-1+b.length)%b.length,Fe=b.length<=1?0:(g+1)%b.length,Ce=be((ie=xe==null?void 0:xe.image)==null?void 0:ie.url),P=be((j=ee==null?void 0:ee.image)==null?void 0:j.url),Y=be((B=ue==null?void 0:ue.image)==null?void 0:B.url),X={[`--${o}-transition-ms`]:`${ce}ms`};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:r}}),a.jsxs("div",{ref:ae,className:yt(`${o}-wrapper`,w&&`${o}-snap`,n&&!i&&`${o}-editor`),style:X,"aria-label":"Zoom gallery",children:[((J=le==null?void 0:le.image)==null?void 0:J.url)&&a.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:le.image.url,alt:"",style:{filter:Q}})}),S&&((te=ee==null?void 0:ee.image)==null?void 0:te.url)&&a.jsx("div",{className:yt(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${M}`),style:fc(P,R,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:ee.image.url,alt:"",style:{filter:T}})}),S&&(($e=ue==null?void 0:ue.image)==null?void 0:$e.url)&&a.jsx("div",{className:yt(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${M}`),style:fc(Y,V,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-image`,src:ue.image.url,alt:""})}),!S&&((ye=xe==null?void 0:xe.image)==null?void 0:ye.url)&&a.jsx("div",{className:yt(`${o}-stage`,`${o}-foreground`),style:du(Ce),children:a.jsx("img",{className:`${o}-image`,src:xe.image.url,alt:xe.image.name??""})}),de&&b.length>1&&!S&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:yt(`${o}-nav`,`${o}-nav-prev`),onClick:()=>He("prev"),"aria-label":`Show previous image (${oe+1} of ${b.length})`}),a.jsx("button",{type:"button",className:yt(`${o}-nav`,`${o}-nav-next`),onClick:()=>He("next"),"aria-label":`Show next image (${Fe+1} of ${b.length})`})]})]})]})}const ix=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
17203
17212
  import cn from 'classnames';
17204
17213
  import { CommonComponentProps } from '../props';
17205
17214
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -17960,7 +17969,7 @@ a:active .${e}-button .${e}-icon-image,
17960
17969
  height: calc(1em * var(--${e}-icon-scale, 1));
17961
17970
  width: calc(1em * var(--${e}-icon-scale, 1));
17962
17971
  }
17963
- `}function Oa(e,t,n="",i,o){const r=t();return a.jsxs("span",{className:`${e}-content-roll-wrap ${n}`.trim(),style:i,children:[a.jsx("span",{className:`${e}-content-roll-spacer`,"aria-hidden":"true",style:o,children:r}),a.jsxs("span",{className:`${e}-content-roll-viewport`,children:[a.jsx("span",{className:`${e}-content-roll-layer`,style:o,children:t()}),a.jsx("span",{className:`${e}-content-roll-layer ${e}-content-roll-layer-hover`,"aria-hidden":"true",style:o,children:t()})]})]})}function yc(e,t,n="fill",i=100,o=0,r){if(!t)return null;const l=a.jsx(ln,{url:t,fill:`var(--${e}-icon-color)`,hoverFill:`var(--${e}-icon-color)`,className:`${e}-icon-image`});if(n==="inline")return a.jsx("span",{className:`${e}-icon ${e}-icon-inline`,style:{[`--${e}-icon-scale`]:i/100},"aria-hidden":"true",children:l});if(n==="fixed"&&o>0){const d=D.scalingValue(o,r);return a.jsx("span",{className:`${e}-icon`,style:{width:d,height:d},"aria-hidden":"true",children:l})}return a.jsx("span",{className:`${e}-icon ${e}-icon-fill`,"aria-hidden":"true",children:l})}function ux({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:r}=D.useScopedStyles(),l=s.useMemo(()=>dx(r),[r]),{type:d="a",label:c="Button",icon:u,alignment:p="center",alignA:b,order:v="text-icon",gap:g=0,iconSize:h=0,iconWidthC:f=0,dimensions:x=!1,padding:S={top:0,right:0,bottom:0,left:0},cornerRadius:y=0,boxShadow:w={top:0,left:0,right:0,bottom:0},boxShadowColor:H="rgba(0, 0, 0, 0)",innerBoxShadow:N={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:Y="rgba(0, 0, 0, 0)",stroke:O=0,blur:C=0,backgroundColor:V="#000000",textColor:$="#ffffff",borderColor:R="#ffffff",iconColor:k="#ffffff",hoverEffect:T="none",fontFamily:m,fontSettings:M,fontSize:E,lineHeight:z,letterSpacing:ne=0,wordSpacing:I=0,textAppearance:W,stateOverrides:K,minWidth:ae=0,minHeight:de=0,width:A=0,height:he=0}=e,q=D.buildColorVars(r,{backgroundColor:V,textColor:$,borderColor:R,iconColor:k,boxShadowColor:H,innerBoxShadowColor:Y},ax,sx,K),ce=i&&i!=="default"?`${r}-state-${i}`:"",Q=t&&!n?`${r}-editing`:"",be=T!=="none"&&(!t||n||i==="hover")?`${r}-hover-effect-${T}`:"",He=T==="reveal"||T==="swipe",xe=T==="content-roll",le=T==="reveal"&&(!t||n),ee=x===!0,oe=d==="a"?b??p:p,Fe=d==="c",Ce=d!=="b",P={fontSettings:{fontFamily:m,fontWeight:(M==null?void 0:M.fontWeight)??400,fontStyle:(M==null?void 0:M.fontStyle)??"normal"},fontSize:E??.01,lineHeight:z,letterSpacing:ne,wordSpacing:I,textAppearance:W,color:$},X={...Ce?sn(Yt(P,t)):{},[`--${r}-box-shadow-x`]:D.scalingValue(w.left,t),[`--${r}-box-shadow-y`]:D.scalingValue(w.top,t),[`--${r}-box-shadow-blur`]:D.scalingValue(w.right,t),[`--${r}-box-shadow-spread`]:D.scalingValue(w.bottom,t),[`--${r}-inner-box-shadow-x`]:D.scalingValue(N.left,t),[`--${r}-inner-box-shadow-y`]:D.scalingValue(N.top,t),[`--${r}-inner-box-shadow-blur`]:D.scalingValue(N.right,t),[`--${r}-inner-box-shadow-spread`]:D.scalingValue(N.bottom,t),[`--${r}-backdrop-blur`]:C>0?`blur(${D.scalingValue(C,t)})`:void 0,paddingTop:D.scalingValue(S.top,t),paddingRight:D.scalingValue(S.right,t),paddingBottom:D.scalingValue(S.bottom,t),paddingLeft:D.scalingValue(S.left,t),borderRadius:D.scalingValue(y,t),borderWidth:D.scalingValue(O,t),...Fe?{}:{justifyContent:Ha[oe],textAlign:oe},...Fe&&!xe?{gap:D.scalingValue(g,t)}:{},...ee?{width:D.scalingValue(A,t),height:D.scalingValue(he,t)}:{minWidth:D.scalingValue(ae,t),minHeight:D.scalingValue(de,t),...Fe?{width:"100%"}:{}}};let ie;const j={display:"inline-flex",alignItems:"center",justifyContent:Fe?Ha[oe]:Ha[d==="a"?oe:"center"],gap:Fe?D.scalingValue(g,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:oe}:{}};if(d==="b"){const te=()=>yc(r,u,h>0?"fixed":"fill",100,h,t);ie=xe?Oa(r,te,`${r}-icon-roll`,void 0,j):te()}else if(d==="c"){const te=()=>{const $e=a.jsx("span",{className:`${r}-text`,style:{textAlign:oe},children:c}),ye=yc(r,u,f>0?"fixed":"fill",100,f,t);return v==="icon-text"?a.jsxs(a.Fragment,{children:[ye,$e]}):a.jsxs(a.Fragment,{children:[$e,ye]})};ie=xe?Oa(r,te,`${r}-icon-text-roll`,void 0,j):te()}else ie=xe?Oa(r,()=>c,`${r}-label-roll`,void 0,j):He?a.jsx("span",{className:`${r}-button-inner`,children:c}):c;const B=le?te=>lx(te,r):void 0,J=le?te=>cx(te,r):void 0;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),a.jsx("div",{className:`${r}-root`,style:q,children:a.jsx("div",{className:`${r}-wrapper ${ce} ${Q}`.trim(),children:a.jsx("div",{className:`${r}-button ${be}`.trim(),style:X,onMouseEnter:B,onMouseLeave:J,role:"button",tabIndex:o||t&&!n?void 0:0,children:ie})})})]})}const px=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
17972
+ `}function Oa(e,t,n="",i,o){const r=t();return a.jsxs("span",{className:`${e}-content-roll-wrap ${n}`.trim(),style:i,children:[a.jsx("span",{className:`${e}-content-roll-spacer`,"aria-hidden":"true",style:o,children:r}),a.jsxs("span",{className:`${e}-content-roll-viewport`,children:[a.jsx("span",{className:`${e}-content-roll-layer`,style:o,children:t()}),a.jsx("span",{className:`${e}-content-roll-layer ${e}-content-roll-layer-hover`,"aria-hidden":"true",style:o,children:t()})]})]})}function yc(e,t,n="fill",i=100,o=0,r){if(!t)return null;const l=a.jsx(ln,{url:t,fill:`var(--${e}-icon-color)`,hoverFill:`var(--${e}-icon-color)`,className:`${e}-icon-image`});if(n==="inline")return a.jsx("span",{className:`${e}-icon ${e}-icon-inline`,style:{[`--${e}-icon-scale`]:i/100},"aria-hidden":"true",children:l});if(n==="fixed"&&o>0){const d=D.scalingValue(o,r);return a.jsx("span",{className:`${e}-icon`,style:{width:d,height:d},"aria-hidden":"true",children:l})}return a.jsx("span",{className:`${e}-icon ${e}-icon-fill`,"aria-hidden":"true",children:l})}function ux({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:r}=D.useScopedStyles(),l=s.useMemo(()=>dx(r),[r]),{type:d="a",label:c="Button",icon:u,alignment:p="center",alignA:b,order:v="text-icon",gap:g=0,iconSize:h=0,iconWidthC:f=0,dimensions:x=!1,padding:S={top:0,right:0,bottom:0,left:0},cornerRadius:y=0,boxShadow:w={top:0,left:0,right:0,bottom:0},boxShadowColor:H="rgba(0, 0, 0, 0)",innerBoxShadow:N={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:U="rgba(0, 0, 0, 0)",stroke:O=0,blur:C=0,backgroundColor:V="#000000",textColor:$="#ffffff",borderColor:R="#ffffff",iconColor:k="#ffffff",hoverEffect:T="none",fontFamily:m,fontSettings:M,fontSize:E,lineHeight:z,letterSpacing:ne=0,wordSpacing:I=0,textAppearance:W,stateOverrides:K,minWidth:ae=0,minHeight:de=0,width:A=0,height:he=0}=e,q=D.buildColorVars(r,{backgroundColor:V,textColor:$,borderColor:R,iconColor:k,boxShadowColor:H,innerBoxShadowColor:U},ax,sx,K),ce=i&&i!=="default"?`${r}-state-${i}`:"",Q=t&&!n?`${r}-editing`:"",be=T!=="none"&&(!t||n||i==="hover")?`${r}-hover-effect-${T}`:"",He=T==="reveal"||T==="swipe",xe=T==="content-roll",le=T==="reveal"&&(!t||n),ee=x===!0,oe=d==="a"?b??p:p,Fe=d==="c",Ce=d!=="b",P={fontSettings:{fontFamily:m,fontWeight:(M==null?void 0:M.fontWeight)??400,fontStyle:(M==null?void 0:M.fontStyle)??"normal"},fontSize:E??.01,lineHeight:z,letterSpacing:ne,wordSpacing:I,textAppearance:W,color:$},X={...Ce?sn(Yt(P,t)):{},[`--${r}-box-shadow-x`]:D.scalingValue(w.left,t),[`--${r}-box-shadow-y`]:D.scalingValue(w.top,t),[`--${r}-box-shadow-blur`]:D.scalingValue(w.right,t),[`--${r}-box-shadow-spread`]:D.scalingValue(w.bottom,t),[`--${r}-inner-box-shadow-x`]:D.scalingValue(N.left,t),[`--${r}-inner-box-shadow-y`]:D.scalingValue(N.top,t),[`--${r}-inner-box-shadow-blur`]:D.scalingValue(N.right,t),[`--${r}-inner-box-shadow-spread`]:D.scalingValue(N.bottom,t),[`--${r}-backdrop-blur`]:C>0?`blur(${D.scalingValue(C,t)})`:void 0,paddingTop:D.scalingValue(S.top,t),paddingRight:D.scalingValue(S.right,t),paddingBottom:D.scalingValue(S.bottom,t),paddingLeft:D.scalingValue(S.left,t),borderRadius:D.scalingValue(y,t),borderWidth:D.scalingValue(O,t),...Fe?{}:{justifyContent:Ha[oe],textAlign:oe},...Fe&&!xe?{gap:D.scalingValue(g,t)}:{},...ee?{width:D.scalingValue(A,t),height:D.scalingValue(he,t)}:{minWidth:D.scalingValue(ae,t),minHeight:D.scalingValue(de,t),...Fe?{width:"100%"}:{}}};let ie;const j={display:"inline-flex",alignItems:"center",justifyContent:Fe?Ha[oe]:Ha[d==="a"?oe:"center"],gap:Fe?D.scalingValue(g,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:oe}:{}};if(d==="b"){const te=()=>yc(r,u,h>0?"fixed":"fill",100,h,t);ie=xe?Oa(r,te,`${r}-icon-roll`,void 0,j):te()}else if(d==="c"){const te=()=>{const $e=a.jsx("span",{className:`${r}-text`,style:{textAlign:oe},children:c}),ye=yc(r,u,f>0?"fixed":"fill",100,f,t);return v==="icon-text"?a.jsxs(a.Fragment,{children:[ye,$e]}):a.jsxs(a.Fragment,{children:[$e,ye]})};ie=xe?Oa(r,te,`${r}-icon-text-roll`,void 0,j):te()}else ie=xe?Oa(r,()=>c,`${r}-label-roll`,void 0,j):He?a.jsx("span",{className:`${r}-button-inner`,children:c}):c;const B=le?te=>lx(te,r):void 0,J=le?te=>cx(te,r):void 0;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),a.jsx("div",{className:`${r}-root`,style:q,children:a.jsx("div",{className:`${r}-wrapper ${ce} ${Q}`.trim(),children:a.jsx("div",{className:`${r}-button ${be}`.trim(),style:X,onMouseEnter:B,onMouseLeave:J,role:"button",tabIndex:o||t&&!n?void 0:0,children:ie})})})]})}const px=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
17964
17973
  import { SvgImage } from '../helpers/SvgImage/SvgImage';
17965
17974
  import { CommonComponentProps } from '../props';
17966
17975
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
@@ -18790,7 +18799,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
18790
18799
  pointer-events: auto;
18791
18800
  flex-shrink: 0;
18792
18801
  }
18793
- `}const Rn=500,wo=650,gn="cubic-bezier(0.22, 1, 0.36, 1)",vx=72,xx=50,bx=1e4,wx=650,Sx=500;function $x(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 uu(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=jr(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 Cx(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?uu(i,n):null}function Tx(e){return e.reduce((t,n,i)=>{var o;return(o=n.image)!=null&&o.url&&t.push({gridIndex:i,items:[n.image],entry:{title1:n.title??"",title2:n.subtitle??"",title3:n.caption??""}}),t},[])}function Lo(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 vc(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return Lo(e,i,n)}const Lx=.03;function pu(e){return e.width*Lx}const Da={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function vr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function xc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Rx(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function us(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,d=o/r;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const c=r*l;return{width:c,height:r,left:i.left+(o-c)/2,top:i.top}}function Ix(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:us(e,t.width,t.height)}function Ex(e,t){if(da(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function Mx(e){const t=new Set,n=[];for(const i of e){const o=i.image;!(o!=null&&o.url)||t.has(o.url)||(t.add(o.url),n.push(o))}return n}function Px({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=>da(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function so(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=pu(n);return t==="left"?{left:l+c-i,top:r,width:i,height:o}:{left:l+d-c,top:r,width:i,height:o}}function Gr(e,t,n){const i=so(e,t,n);return{...i,left:2*i.left-e.left}}function kx(e,t,n){const{left:i,width:o}=n,r=pu(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 mu(e,t,n,i){const o=so(e,"left",i),r=so(e,"right",i),l=Gr(e,"left",i),d=Gr(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:d,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:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function Ax(e,t,n,i){const{start:o,end:r}=mu(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function Fx(e,t,n){const i=so(e,t,n),o=Gr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function da(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function _x({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const d=s.useRef(null);return s.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:c=>c.stopPropagation(),style:o},e)})}function xr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return da(e)?a.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.url,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.url,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function Wx({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:b,sourceRect:v,resolveCloseSourceRect:g,onClose:h,onPrev:f,onNext:x}){const S=s.useRef(null),y=s.useRef(null),w=s.useRef(null),H=s.useRef(new Map),[N,Y]=s.useState(0),O=s.useRef(null),C=s.useRef(0),V=s.useRef(0),$=s.useRef("none"),R=s.useRef(!1),k=s.useRef(!1),T=s.useRef(!1),m=s.useRef(null),M=s.useRef(null),E=s.useRef(null),z=s.useRef(()=>{}),ne=s.useRef(null),I=s.useRef(null),W=s.useRef(null),K=s.useRef(!1),[ae,de]=s.useState(null),[A,he]=s.useState(Da),[q,ce]=s.useState(0),[Q,be]=s.useState("opening"),[He,xe]=s.useState(0),[le,ee]=s.useState(0),[ue,oe]=s.useState(!1),[Fe,Ce]=s.useState(null),[P,U]=s.useState(null),[X,ie]=s.useState(null),[j,B]=s.useState(!1),[J,te]=s.useState(null),[$e,ye]=s.useState(!1),F=s.useRef(!1),[ve,pe]=s.useState(!1),[Z,me]=s.useState(!1),De=s.useRef(n),ge=s.useRef(void 0),G=t[n],Me=G?da(G):!1,_e=le!==0||ue,rt=!l&&(!r||!!d),Je=c&&!l,at=u.length>1,it=s.useCallback((_,Ie)=>t.length<=1?null:t[(_+Ie+t.length)%t.length]??null,[t]),je=at?Lo(u,p,-1):it(n,-1),Se=at?Lo(u,p,1):it(n,1),We=Fe===-1&&_e?at&&P!==null?Lo(u,P,-1):X!==null?it(X,-1):null:null,Be=Fe===1&&_e?at&&P!==null?Lo(u,P,1):X!==null?it(X,1):null:null,Ze=We&&We.url!==(je==null?void 0:je.url)?We:null,Le=Be&&Be.url!==(Se==null?void 0:Se.url)?Be:null,Ve=je&&Je?(()=>{const _=at?vc(u,p,-1):t.length>2?it((n-1+t.length)%t.length,-1):null;return _&&_.url!==je.url?_:null})():null,se=Se&&Je?(()=>{const _=at?vc(u,p,1):t.length>2?it((n+1)%t.length,1):null;return _&&_.url!==Se.url?_:null})():null,Te=Ze??Ve,Xe=Le??se,ze=s.useCallback((_,Ie,Ne)=>{if(!_||!Ie||!Ne)return;const Ge=H.current,dt=Ge.get(_);(dt==null?void 0:dt.width)===Ie&&(dt==null?void 0:dt.height)===Ne||(Ge.set(_,{width:Ie,height:Ne}),Y(Ft=>Ft+1))},[]),Re=s.useCallback(_=>{if(!(_!=null&&_.url))return null;const Ie=H.current.get(_.url);return Ix(y.current,Ie)},[N,q]),Pe=s.useCallback(()=>{if(!G)return;const _=Re(G);if(_){de(_);return}const Ie=y.current;Ie&&de(xc(Ie))},[G,Re]),Ae=s.useCallback(_=>{if(at){const Ie=u.length;U((p+_+Ie)%Ie),ie(null);return}t.length>1&&(ie((n+_+t.length)%t.length),U(null))},[at,u.length,p,t.length,n]),Ke=s.useCallback(_=>{T.current=_,oe(_)},[]),Oe=s.useCallback(()=>{m.current!==null&&(window.clearTimeout(m.current),m.current=null)},[]),Qe=s.useCallback(()=>{Oe(),m.current=window.setTimeout(()=>{Oe(),Ke(!1)},wo+32)},[Oe,Ke]),tt=s.useCallback(()=>{const _=S.current;if(!_){he({left:0,top:0,width:typeof window<"u"?window.innerWidth:Da.width,height:typeof window<"u"?window.innerHeight:Da.height});return}const Ie=_.getBoundingClientRect();he({left:Ie.left,top:Ie.top,width:Ie.width,height:Ie.height})},[]),nt=s.useCallback((_,Ie)=>{if(_e){if(ve&&!ue)return`translate(${le}px, 0px)`;if(ue&&Fe!==null){const Ne=Re(_);if(!Ne)return;const{x:Ge,y:dt}=Ax(Ne,Ie,Fe,A);return`translate(${Ge}px, ${dt}px)`}if(ue)return"translate(0px, 0px)"}},[_e,ve,ue,le,Fe,A,Re]),xt=s.useCallback(()=>{const _=M.current;M.current=null,Oe(),Ke(!1),Ce(null),U(null),ie(null),ee(0),pe(!1),R.current=!1,V.current=0,$.current="none",_===-1?f():_===1&&x()},[Oe,Ke,f,x]),It=s.useCallback(()=>{Oe(),m.current=window.setTimeout(()=>{M.current!==null&&xt()},wo+32)},[Oe,xt]),Tt=s.useCallback(()=>{Oe(),M.current=null,Ke(!1),Ce(null),U(null),ie(null),ee(0),pe(!1),R.current=!1,V.current=0,$.current="none"},[Oe,Ke]),ut=s.useCallback(_=>{if(!(!Je||!ae)){if(T.current){if(M.current===_){E.current=_,xt();return}Tt()}Oe(),Ae(_),M.current=_,Ce(_),Ke(!0),It()}},[Je,ae,xt,Tt,Oe,Ae,Ke,It]);z.current=ut;const ft=s.useCallback(()=>{ne.current=null,K.current=!1,I.current!==null&&(window.clearInterval(I.current),I.current=null),W.current!==null&&(window.clearTimeout(W.current),W.current=null)},[]),Et=s.useCallback(_=>{I.current!==null&&window.clearInterval(I.current);const Ie=K.current?Sx:wx;I.current=window.setInterval(()=>{z.current(_)},Ie)},[]),Lt=s.useCallback(_=>{ne.current!==_&&(ft(),ne.current=_,K.current=!1,z.current(_),Et(_),W.current=window.setTimeout(()=>{W.current=null,ne.current===_&&(K.current=!0,Et(_))},bx))},[ft,Et]),bt=s.useCallback(()=>{const _=y.current;if(!_)return;const Ie=G==null?void 0:G.url,Ne=Ie?H.current.get(Ie):void 0;if(Ne!=null&&Ne.width&&(Ne!=null&&Ne.height)){de(us(_,Ne.width,Ne.height));return}const Ge=w.current;if(Ge&&Ie&&(Ge.src===Ie||Ge.currentSrc===Ie)){const{width:Ft,height:lt}=Rx(Ge);if(Ft&&lt){ze(Ie,Ft,lt),de(us(_,Ft,lt));return}}const dt=xc(_);!dt.width||!dt.height||de(dt)},[G==null?void 0:G.url,ze]),Nt=s.useCallback(_=>{if(w.current=_,!!_){if(_ instanceof HTMLVideoElement){_.readyState>=1&&_.videoWidth>0&&bt();return}_.complete&&_.naturalWidth>0&&bt()}},[bt]),Bt=s.useCallback(()=>{tt(),bt(),ce(_=>_+1)},[tt,bt]);s.useEffect(()=>{Bt();const _=y.current,Ie=S.current,Ne=new ResizeObserver(()=>Bt());return _&&Ne.observe(_),Ie&&Ne.observe(Ie),window.addEventListener("resize",Bt),()=>{Ne.disconnect(),window.removeEventListener("resize",Bt)}},[Bt,n,b]),s.useLayoutEffect(()=>{if(!G)return;const _=w.current;if(_){if(_ instanceof HTMLImageElement&&_.complete&&_.naturalWidth>0){bt();return}_ instanceof HTMLVideoElement&&_.readyState>=1&&_.videoWidth>0&&bt()}},[G==null?void 0:G.url,n,bt]),s.useEffect(()=>{Pe()},[Pe,N]),s.useEffect(()=>{const _=new Set,Ie=[],Ne=Ge=>{!(Ge!=null&&Ge.url)||_.has(Ge.url)||(_.add(Ge.url),Ie.push(Ge))};t.forEach(Ne),u.forEach(Ge=>Ge.items.forEach(Ne)),Ie.forEach(Ge=>{H.current.has(Ge.url)||Ex(Ge,ze)})},[t,u,ze]),s.useEffect(()=>{if(Q!=="opening"||!ae)return;if(!v){be("open");return}B(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{B(!0),be("open")})});return()=>cancelAnimationFrame(_)},[Q,ae,v]),s.useEffect(()=>{if(Q!=="closing")return;const _=setTimeout(()=>h(),Rn);return()=>clearTimeout(_)},[Q,h]),s.useEffect(()=>()=>{Oe()},[Oe]),s.useLayoutEffect(()=>{De.current===n&&ge.current===(G==null?void 0:G.url)||(Oe(),M.current=null,Ce(null),U(null),ie(null),xe(0),ee(0),Ke(!1),me(!1),pe(!1),C.current=0,V.current=0,$.current="none",R.current=!1,O.current=null,k.current=!1,w.current=null,Pe(),De.current=n,ge.current=G==null?void 0:G.url)},[n,G==null?void 0:G.url,Ke,Oe,Pe]),s.useLayoutEffect(()=>{const _=E.current;_!==null&&(E.current=null,requestAnimationFrame(()=>{z.current(_)}))},[n,p,G==null?void 0:G.url]),s.useLayoutEffect(()=>{if(Q==="opening"){F.current=!1,ye(!1);return}if(Q!=="open"||F.current)return;if(!je&&!Se){F.current=!0;return}ye(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ye(!0),F.current=!0})});return()=>cancelAnimationFrame(_)},[Q,je==null?void 0:je.url,Se==null?void 0:Se.url]),s.useEffect(()=>{if(Q!=="open")return;const _=()=>{const lt=wt=>{wt.stopPropagation(),wt.preventDefault(),document.removeEventListener("click",lt,!0)};document.addEventListener("click",lt,!0)},Ie=lt=>{const wt=lt<0?1:-1;Oe(),Ae(wt),M.current=wt,Ce(wt),Ke(!0),It()},Ne=lt=>{if(Math.abs(lt)>xx&&Je){Ie(lt);return}M.current=null,Ce(null),U(null),ie(null),Ke(!0),ee(0),Qe()},Ge=lt=>{if(lt.touches.length!==1||T.current)return;const wt=lt.touches[0];k.current=!0,O.current={x:wt.clientX,y:wt.clientY},$.current="none",V.current=0,R.current=!1},dt=lt=>{if(!O.current||lt.touches.length!==1||T.current)return;const wt=lt.touches[0],zt=wt.clientX-O.current.x,Pt=wt.clientY-O.current.y;if($.current==="none"){if(Math.abs(zt)<10&&Math.abs(Pt)<10)return;if(Math.abs(zt)>Math.abs(Pt)){if(!Je)return;$.current="horizontal"}else if(Pt>0){if(!rt)return;$.current="vertical"}else return}if($.current==="horizontal"){R.current=!0,pe(!0),V.current=zt,ee(zt),lt.preventDefault();return}$.current==="vertical"&&(R.current=!0,pe(!0),C.current=Pt,xe(Pt),lt.preventDefault())},Ft=()=>{if(!O.current)return;const lt=$.current,wt=R.current;if(wt&&lt==="horizontal")Ne(V.current),_();else if(wt&&lt==="vertical"){const zt=C.current;if(rt&&zt>vx){const Pt=window.innerHeight;C.current=Pt,me(!0),xe(Pt),be("closing")}else C.current=0,xe(0);_()}else lt==="horizontal"&&Math.abs(V.current)>0&&(Ne(V.current),_());O.current=null,$.current="none",V.current=0,R.current=!1,pe(!1)};return document.addEventListener("touchstart",Ge,{passive:!0}),document.addEventListener("touchmove",dt,{passive:!1}),document.addEventListener("touchend",Ft),document.addEventListener("touchcancel",Ft),()=>{document.removeEventListener("touchstart",Ge),document.removeEventListener("touchmove",dt),document.removeEventListener("touchend",Ft),document.removeEventListener("touchcancel",Ft)}},[Q,Je,Ke,Qe,Oe,rt,It,Ae]);const Zt=s.useCallback(()=>{const _=(g==null?void 0:g())??v??null;_&&ae&&(te(_),B(!0)),be("closing")},[g,v,ae]);s.useEffect(()=>{const _=Ge=>{if(Ge.key==="Escape"){if(r&&d||Q==="closing")return;ft(),Zt();return}if(Ge.key!=="ArrowLeft"&&Ge.key!=="ArrowRight"||Q!=="open"||!Je)return;Ge.preventDefault();const dt=Ge.key==="ArrowLeft"?-1:1;Ge.repeat&&ne.current===dt||Lt(dt)},Ie=Ge=>{if(Ge.key!=="ArrowLeft"&&Ge.key!=="ArrowRight")return;const dt=Ge.key==="ArrowLeft"?-1:1;ne.current===dt&&ft()},Ne=()=>{ft()};return window.addEventListener("keydown",_),window.addEventListener("keyup",Ie),window.addEventListener("blur",Ne),()=>{window.removeEventListener("keydown",_),window.removeEventListener("keyup",Ie),window.removeEventListener("blur",Ne),ft()}},[Q,r,d,Zt,Je,Lt,ft]),s.useEffect(()=>{Q!=="open"&&ft()},[Q,ft]);const en=()=>{Q==="closing"||l||Zt()},Rt=Q==="open",Ot=Q==="closing",nn=He>0?Math.max(0,1-He/500):1,pt=He>0?Math.max(.35,1-He/500):1,Ee=s.useCallback(_=>{if(!(_.propertyName!=="transform"||!T.current)){if(M.current!==null){xt();return}Oe(),Ke(!1)}},[Oe,Ke,xt]),qe=Q==="closing"?J??v:v,st=qe&&ae&&(Q==="opening"||Ot)?$x(qe,ae):void 0,mt=_e&&G?nt(G,"center"):He>0?`translateY(${He}px)`:st,vt=ae?vr(ae,A):null,Mt=!!(qe&&ae),gt=Mt&&(Q==="closing"||Q==="open"&&j),Vt={position:"absolute",top:vt==null?void 0:vt.top,left:vt==null?void 0:vt.left,width:vt==null?void 0:vt.width,height:vt==null?void 0:vt.height,objectFit:"contain",transformOrigin:"top left",transform:mt,opacity:He>0?pt:Mt?1:Q==="opening"||Ot?0:1,transition:ve&&!ue?"none":ue?`transform ${wo}ms ${gn}`:Z?`transform ${Rn}ms ${gn}, opacity ${Rn}ms ${gn}`:gt?`transform ${Rn}ms ${gn}`:Q==="opening"||Ot?`opacity ${Rn}ms ${gn}`:"none",pointerEvents:Me&&Rt&&!_e?"auto":"none",touchAction:Me&&Rt?"none":void 0,zIndex:1,overflow:Me?"hidden":void 0},Wt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Rt&&!_e?"auto":"none"},_t=(_,Ie,Ne="adjacent")=>{const Ge=Re(_);if(!Ge)return{display:"none"};const dt=Ne==="far"?Ie==="left"?"far-left":"far-right":Ie==="left"?"left-adjacent":"right-adjacent",{start:Ft}=Fe!==null?mu(Ge,dt,Fe,A):{start:Ne==="far"?Gr(Ge,Ie,A):so(Ge,Ie,A)},lt=vr(Ft,A),wt=nt(_,dt),zt=!_e&&Ne==="adjacent"&&Rt&&!$e?Fx(Ge,Ie,A):null,Pt=Ne==="far"&&_e&&Fe===(Ie==="left"?-1:1),on=ve&&!ue?!1:ue,pn=Ne==="adjacent"&&Rt&&$e&&!_e;return{position:"absolute",top:lt.top,left:lt.left,width:lt.width,height:lt.height,objectFit:"contain",transform:wt??(zt?`translate(${zt.x}px, ${zt.y}px)`:void 0),opacity:Ne==="far"?Rt&&Pt?1:0:Rt?1:0,transition:on?Ne==="far"?`transform ${wo}ms ${gn}`:`transform ${wo}ms ${gn}, opacity ${Rn}ms ${gn}`:pn?`transform ${Rn}ms ${gn}`:Q==="opening"||Ot?`opacity ${Rn}ms ${gn}`:"none",pointerEvents:"none",zIndex:1}},qt=(_,Ie)=>{const Ne=Re(_);return Ne?kx(so(Ne,Ie,A),Ie,A):null},Xt=_=>Ie=>{if(!l){if(k.current){k.current=!1;return}Ie.stopPropagation(),ut(_)}},Dt=je?qt(je,"left"):null,jt=Se?qt(Se,"right"):null,Ht=Dt?vr(Dt,A):null,$t=jt?vr(jt,A):null;return a.jsxs("div",{ref:S,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:Q==="open"?"none":void 0},onClick:en,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Rt?nn:0,transition:ve?"none":`opacity ${Rn}ms ${gn}`,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:y,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Rt?1:0,transition:ve?"none":`opacity ${Rn}ms ${gn}`,pointerEvents:"none"},children:a.jsx(Xd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:en})})]}),Rt&&Te&&a.jsx(xr,{media:Te,style:_t(Te,"left","far"),onMeasure:ze,onTransitionEnd:Ee},`far-prev-${Te.url}`),Rt&&je&&a.jsxs(a.Fragment,{children:[a.jsx(xr,{media:je,style:_t(je,"left"),onMeasure:ze,onTransitionEnd:Ee},`prev-${je.url}`),Ht&&a.jsx("div",{style:{position:"absolute",top:Ht.top,left:Ht.left,width:Ht.width,height:Ht.height,cursor:l||ve?"default":"pointer",pointerEvents:l||ve?"none":"auto",zIndex:3},onClick:Xt(-1)})]}),Rt&&Se&&a.jsxs(a.Fragment,{children:[a.jsx(xr,{media:Se,style:_t(Se,"right"),onMeasure:ze,onTransitionEnd:Ee},`next-${Se.url}`),$t&&a.jsx("div",{style:{position:"absolute",top:$t.top,left:$t.left,width:$t.width,height:$t.height,cursor:l||ve?"default":"pointer",pointerEvents:l||ve?"none":"auto",zIndex:3},onClick:Xt(1)})]}),Rt&&Xe&&a.jsx(xr,{media:Xe,style:_t(Xe,"right","far"),onMeasure:ze,onTransitionEnd:Ee},`far-next-${Xe.url}`),ae&&G&&(Me?a.jsx(_x,{src:G.url,phase:Q,onMediaElement:Nt,wrapperStyle:Vt,videoStyle:Wt,onLoadedMetadata:bt,onTransitionEnd:Ee},`${n}-${G.url}`):a.jsx("img",{ref:Nt,src:G.url,alt:G.name,onLoad:bt,onTransitionEnd:Ee,style:Vt},`${n}-${G.url}`))]})}const Nx=20,Hx=.18;function Ox(e){return`
18802
+ `}const Rn=500,wo=650,gn="cubic-bezier(0.22, 1, 0.36, 1)",vx=72,xx=50,bx=1e4,wx=650,Sx=500;function $x(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 uu(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=jr(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 Cx(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?uu(i,n):null}function Tx(e){return e.reduce((t,n,i)=>{var o;return(o=n.image)!=null&&o.url&&t.push({gridIndex:i,items:[n.image],entry:{title1:n.title??"",title2:n.subtitle??"",title3:n.caption??""}}),t},[])}function Lo(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 vc(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return Lo(e,i,n)}const Lx=.03;function pu(e){return e.width*Lx}const Da={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function vr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function xc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Rx(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function us(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,d=o/r;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const c=r*l;return{width:c,height:r,left:i.left+(o-c)/2,top:i.top}}function Ix(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:us(e,t.width,t.height)}function Ex(e,t){if(da(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function Mx(e){const t=new Set,n=[];for(const i of e){const o=i.image;!(o!=null&&o.url)||t.has(o.url)||(t.add(o.url),n.push(o))}return n}function Px({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=>da(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function so(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=pu(n);return t==="left"?{left:l+c-i,top:r,width:i,height:o}:{left:l+d-c,top:r,width:i,height:o}}function Gr(e,t,n){const i=so(e,t,n);return{...i,left:2*i.left-e.left}}function kx(e,t,n){const{left:i,width:o}=n,r=pu(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 mu(e,t,n,i){const o=so(e,"left",i),r=so(e,"right",i),l=Gr(e,"left",i),d=Gr(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:d,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:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function Ax(e,t,n,i){const{start:o,end:r}=mu(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function Fx(e,t,n){const i=so(e,t,n),o=Gr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function da(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function _x({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const d=s.useRef(null);return s.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:c=>c.stopPropagation(),style:o},e)})}function xr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return da(e)?a.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.url,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.url,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function Wx({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:b,sourceRect:v,resolveCloseSourceRect:g,onClose:h,onPrev:f,onNext:x}){const S=s.useRef(null),y=s.useRef(null),w=s.useRef(null),H=s.useRef(new Map),[N,U]=s.useState(0),O=s.useRef(null),C=s.useRef(0),V=s.useRef(0),$=s.useRef("none"),R=s.useRef(!1),k=s.useRef(!1),T=s.useRef(!1),m=s.useRef(null),M=s.useRef(null),E=s.useRef(null),z=s.useRef(()=>{}),ne=s.useRef(null),I=s.useRef(null),W=s.useRef(null),K=s.useRef(!1),[ae,de]=s.useState(null),[A,he]=s.useState(Da),[q,ce]=s.useState(0),[Q,be]=s.useState("opening"),[He,xe]=s.useState(0),[le,ee]=s.useState(0),[ue,oe]=s.useState(!1),[Fe,Ce]=s.useState(null),[P,Y]=s.useState(null),[X,ie]=s.useState(null),[j,B]=s.useState(!1),[J,te]=s.useState(null),[$e,ye]=s.useState(!1),F=s.useRef(!1),[ve,pe]=s.useState(!1),[Z,me]=s.useState(!1),De=s.useRef(n),ge=s.useRef(void 0),G=t[n],Me=G?da(G):!1,_e=le!==0||ue,rt=!l&&(!r||!!d),Je=c&&!l,at=u.length>1,it=s.useCallback((_,Ie)=>t.length<=1?null:t[(_+Ie+t.length)%t.length]??null,[t]),je=at?Lo(u,p,-1):it(n,-1),Se=at?Lo(u,p,1):it(n,1),We=Fe===-1&&_e?at&&P!==null?Lo(u,P,-1):X!==null?it(X,-1):null:null,Be=Fe===1&&_e?at&&P!==null?Lo(u,P,1):X!==null?it(X,1):null:null,Ze=We&&We.url!==(je==null?void 0:je.url)?We:null,Le=Be&&Be.url!==(Se==null?void 0:Se.url)?Be:null,Ve=je&&Je?(()=>{const _=at?vc(u,p,-1):t.length>2?it((n-1+t.length)%t.length,-1):null;return _&&_.url!==je.url?_:null})():null,se=Se&&Je?(()=>{const _=at?vc(u,p,1):t.length>2?it((n+1)%t.length,1):null;return _&&_.url!==Se.url?_:null})():null,Te=Ze??Ve,Xe=Le??se,ze=s.useCallback((_,Ie,Ne)=>{if(!_||!Ie||!Ne)return;const Ge=H.current,dt=Ge.get(_);(dt==null?void 0:dt.width)===Ie&&(dt==null?void 0:dt.height)===Ne||(Ge.set(_,{width:Ie,height:Ne}),U(Ft=>Ft+1))},[]),Re=s.useCallback(_=>{if(!(_!=null&&_.url))return null;const Ie=H.current.get(_.url);return Ix(y.current,Ie)},[N,q]),Pe=s.useCallback(()=>{if(!G)return;const _=Re(G);if(_){de(_);return}const Ie=y.current;Ie&&de(xc(Ie))},[G,Re]),Ae=s.useCallback(_=>{if(at){const Ie=u.length;Y((p+_+Ie)%Ie),ie(null);return}t.length>1&&(ie((n+_+t.length)%t.length),Y(null))},[at,u.length,p,t.length,n]),Ke=s.useCallback(_=>{T.current=_,oe(_)},[]),Oe=s.useCallback(()=>{m.current!==null&&(window.clearTimeout(m.current),m.current=null)},[]),Qe=s.useCallback(()=>{Oe(),m.current=window.setTimeout(()=>{Oe(),Ke(!1)},wo+32)},[Oe,Ke]),tt=s.useCallback(()=>{const _=S.current;if(!_){he({left:0,top:0,width:typeof window<"u"?window.innerWidth:Da.width,height:typeof window<"u"?window.innerHeight:Da.height});return}const Ie=_.getBoundingClientRect();he({left:Ie.left,top:Ie.top,width:Ie.width,height:Ie.height})},[]),nt=s.useCallback((_,Ie)=>{if(_e){if(ve&&!ue)return`translate(${le}px, 0px)`;if(ue&&Fe!==null){const Ne=Re(_);if(!Ne)return;const{x:Ge,y:dt}=Ax(Ne,Ie,Fe,A);return`translate(${Ge}px, ${dt}px)`}if(ue)return"translate(0px, 0px)"}},[_e,ve,ue,le,Fe,A,Re]),xt=s.useCallback(()=>{const _=M.current;M.current=null,Oe(),Ke(!1),Ce(null),Y(null),ie(null),ee(0),pe(!1),R.current=!1,V.current=0,$.current="none",_===-1?f():_===1&&x()},[Oe,Ke,f,x]),It=s.useCallback(()=>{Oe(),m.current=window.setTimeout(()=>{M.current!==null&&xt()},wo+32)},[Oe,xt]),Tt=s.useCallback(()=>{Oe(),M.current=null,Ke(!1),Ce(null),Y(null),ie(null),ee(0),pe(!1),R.current=!1,V.current=0,$.current="none"},[Oe,Ke]),ut=s.useCallback(_=>{if(!(!Je||!ae)){if(T.current){if(M.current===_){E.current=_,xt();return}Tt()}Oe(),Ae(_),M.current=_,Ce(_),Ke(!0),It()}},[Je,ae,xt,Tt,Oe,Ae,Ke,It]);z.current=ut;const ft=s.useCallback(()=>{ne.current=null,K.current=!1,I.current!==null&&(window.clearInterval(I.current),I.current=null),W.current!==null&&(window.clearTimeout(W.current),W.current=null)},[]),Et=s.useCallback(_=>{I.current!==null&&window.clearInterval(I.current);const Ie=K.current?Sx:wx;I.current=window.setInterval(()=>{z.current(_)},Ie)},[]),Lt=s.useCallback(_=>{ne.current!==_&&(ft(),ne.current=_,K.current=!1,z.current(_),Et(_),W.current=window.setTimeout(()=>{W.current=null,ne.current===_&&(K.current=!0,Et(_))},bx))},[ft,Et]),bt=s.useCallback(()=>{const _=y.current;if(!_)return;const Ie=G==null?void 0:G.url,Ne=Ie?H.current.get(Ie):void 0;if(Ne!=null&&Ne.width&&(Ne!=null&&Ne.height)){de(us(_,Ne.width,Ne.height));return}const Ge=w.current;if(Ge&&Ie&&(Ge.src===Ie||Ge.currentSrc===Ie)){const{width:Ft,height:lt}=Rx(Ge);if(Ft&&lt){ze(Ie,Ft,lt),de(us(_,Ft,lt));return}}const dt=xc(_);!dt.width||!dt.height||de(dt)},[G==null?void 0:G.url,ze]),Nt=s.useCallback(_=>{if(w.current=_,!!_){if(_ instanceof HTMLVideoElement){_.readyState>=1&&_.videoWidth>0&&bt();return}_.complete&&_.naturalWidth>0&&bt()}},[bt]),Bt=s.useCallback(()=>{tt(),bt(),ce(_=>_+1)},[tt,bt]);s.useEffect(()=>{Bt();const _=y.current,Ie=S.current,Ne=new ResizeObserver(()=>Bt());return _&&Ne.observe(_),Ie&&Ne.observe(Ie),window.addEventListener("resize",Bt),()=>{Ne.disconnect(),window.removeEventListener("resize",Bt)}},[Bt,n,b]),s.useLayoutEffect(()=>{if(!G)return;const _=w.current;if(_){if(_ instanceof HTMLImageElement&&_.complete&&_.naturalWidth>0){bt();return}_ instanceof HTMLVideoElement&&_.readyState>=1&&_.videoWidth>0&&bt()}},[G==null?void 0:G.url,n,bt]),s.useEffect(()=>{Pe()},[Pe,N]),s.useEffect(()=>{const _=new Set,Ie=[],Ne=Ge=>{!(Ge!=null&&Ge.url)||_.has(Ge.url)||(_.add(Ge.url),Ie.push(Ge))};t.forEach(Ne),u.forEach(Ge=>Ge.items.forEach(Ne)),Ie.forEach(Ge=>{H.current.has(Ge.url)||Ex(Ge,ze)})},[t,u,ze]),s.useEffect(()=>{if(Q!=="opening"||!ae)return;if(!v){be("open");return}B(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{B(!0),be("open")})});return()=>cancelAnimationFrame(_)},[Q,ae,v]),s.useEffect(()=>{if(Q!=="closing")return;const _=setTimeout(()=>h(),Rn);return()=>clearTimeout(_)},[Q,h]),s.useEffect(()=>()=>{Oe()},[Oe]),s.useLayoutEffect(()=>{De.current===n&&ge.current===(G==null?void 0:G.url)||(Oe(),M.current=null,Ce(null),Y(null),ie(null),xe(0),ee(0),Ke(!1),me(!1),pe(!1),C.current=0,V.current=0,$.current="none",R.current=!1,O.current=null,k.current=!1,w.current=null,Pe(),De.current=n,ge.current=G==null?void 0:G.url)},[n,G==null?void 0:G.url,Ke,Oe,Pe]),s.useLayoutEffect(()=>{const _=E.current;_!==null&&(E.current=null,requestAnimationFrame(()=>{z.current(_)}))},[n,p,G==null?void 0:G.url]),s.useLayoutEffect(()=>{if(Q==="opening"){F.current=!1,ye(!1);return}if(Q!=="open"||F.current)return;if(!je&&!Se){F.current=!0;return}ye(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ye(!0),F.current=!0})});return()=>cancelAnimationFrame(_)},[Q,je==null?void 0:je.url,Se==null?void 0:Se.url]),s.useEffect(()=>{if(Q!=="open")return;const _=()=>{const lt=wt=>{wt.stopPropagation(),wt.preventDefault(),document.removeEventListener("click",lt,!0)};document.addEventListener("click",lt,!0)},Ie=lt=>{const wt=lt<0?1:-1;Oe(),Ae(wt),M.current=wt,Ce(wt),Ke(!0),It()},Ne=lt=>{if(Math.abs(lt)>xx&&Je){Ie(lt);return}M.current=null,Ce(null),Y(null),ie(null),Ke(!0),ee(0),Qe()},Ge=lt=>{if(lt.touches.length!==1||T.current)return;const wt=lt.touches[0];k.current=!0,O.current={x:wt.clientX,y:wt.clientY},$.current="none",V.current=0,R.current=!1},dt=lt=>{if(!O.current||lt.touches.length!==1||T.current)return;const wt=lt.touches[0],zt=wt.clientX-O.current.x,Pt=wt.clientY-O.current.y;if($.current==="none"){if(Math.abs(zt)<10&&Math.abs(Pt)<10)return;if(Math.abs(zt)>Math.abs(Pt)){if(!Je)return;$.current="horizontal"}else if(Pt>0){if(!rt)return;$.current="vertical"}else return}if($.current==="horizontal"){R.current=!0,pe(!0),V.current=zt,ee(zt),lt.preventDefault();return}$.current==="vertical"&&(R.current=!0,pe(!0),C.current=Pt,xe(Pt),lt.preventDefault())},Ft=()=>{if(!O.current)return;const lt=$.current,wt=R.current;if(wt&&lt==="horizontal")Ne(V.current),_();else if(wt&&lt==="vertical"){const zt=C.current;if(rt&&zt>vx){const Pt=window.innerHeight;C.current=Pt,me(!0),xe(Pt),be("closing")}else C.current=0,xe(0);_()}else lt==="horizontal"&&Math.abs(V.current)>0&&(Ne(V.current),_());O.current=null,$.current="none",V.current=0,R.current=!1,pe(!1)};return document.addEventListener("touchstart",Ge,{passive:!0}),document.addEventListener("touchmove",dt,{passive:!1}),document.addEventListener("touchend",Ft),document.addEventListener("touchcancel",Ft),()=>{document.removeEventListener("touchstart",Ge),document.removeEventListener("touchmove",dt),document.removeEventListener("touchend",Ft),document.removeEventListener("touchcancel",Ft)}},[Q,Je,Ke,Qe,Oe,rt,It,Ae]);const Zt=s.useCallback(()=>{const _=(g==null?void 0:g())??v??null;_&&ae&&(te(_),B(!0)),be("closing")},[g,v,ae]);s.useEffect(()=>{const _=Ge=>{if(Ge.key==="Escape"){if(r&&d||Q==="closing")return;ft(),Zt();return}if(Ge.key!=="ArrowLeft"&&Ge.key!=="ArrowRight"||Q!=="open"||!Je)return;Ge.preventDefault();const dt=Ge.key==="ArrowLeft"?-1:1;Ge.repeat&&ne.current===dt||Lt(dt)},Ie=Ge=>{if(Ge.key!=="ArrowLeft"&&Ge.key!=="ArrowRight")return;const dt=Ge.key==="ArrowLeft"?-1:1;ne.current===dt&&ft()},Ne=()=>{ft()};return window.addEventListener("keydown",_),window.addEventListener("keyup",Ie),window.addEventListener("blur",Ne),()=>{window.removeEventListener("keydown",_),window.removeEventListener("keyup",Ie),window.removeEventListener("blur",Ne),ft()}},[Q,r,d,Zt,Je,Lt,ft]),s.useEffect(()=>{Q!=="open"&&ft()},[Q,ft]);const en=()=>{Q==="closing"||l||Zt()},Rt=Q==="open",Ot=Q==="closing",nn=He>0?Math.max(0,1-He/500):1,pt=He>0?Math.max(.35,1-He/500):1,Ee=s.useCallback(_=>{if(!(_.propertyName!=="transform"||!T.current)){if(M.current!==null){xt();return}Oe(),Ke(!1)}},[Oe,Ke,xt]),qe=Q==="closing"?J??v:v,st=qe&&ae&&(Q==="opening"||Ot)?$x(qe,ae):void 0,mt=_e&&G?nt(G,"center"):He>0?`translateY(${He}px)`:st,vt=ae?vr(ae,A):null,Mt=!!(qe&&ae),gt=Mt&&(Q==="closing"||Q==="open"&&j),Vt={position:"absolute",top:vt==null?void 0:vt.top,left:vt==null?void 0:vt.left,width:vt==null?void 0:vt.width,height:vt==null?void 0:vt.height,objectFit:"contain",transformOrigin:"top left",transform:mt,opacity:He>0?pt:Mt?1:Q==="opening"||Ot?0:1,transition:ve&&!ue?"none":ue?`transform ${wo}ms ${gn}`:Z?`transform ${Rn}ms ${gn}, opacity ${Rn}ms ${gn}`:gt?`transform ${Rn}ms ${gn}`:Q==="opening"||Ot?`opacity ${Rn}ms ${gn}`:"none",pointerEvents:Me&&Rt&&!_e?"auto":"none",touchAction:Me&&Rt?"none":void 0,zIndex:1,overflow:Me?"hidden":void 0},Wt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Rt&&!_e?"auto":"none"},_t=(_,Ie,Ne="adjacent")=>{const Ge=Re(_);if(!Ge)return{display:"none"};const dt=Ne==="far"?Ie==="left"?"far-left":"far-right":Ie==="left"?"left-adjacent":"right-adjacent",{start:Ft}=Fe!==null?mu(Ge,dt,Fe,A):{start:Ne==="far"?Gr(Ge,Ie,A):so(Ge,Ie,A)},lt=vr(Ft,A),wt=nt(_,dt),zt=!_e&&Ne==="adjacent"&&Rt&&!$e?Fx(Ge,Ie,A):null,Pt=Ne==="far"&&_e&&Fe===(Ie==="left"?-1:1),on=ve&&!ue?!1:ue,pn=Ne==="adjacent"&&Rt&&$e&&!_e;return{position:"absolute",top:lt.top,left:lt.left,width:lt.width,height:lt.height,objectFit:"contain",transform:wt??(zt?`translate(${zt.x}px, ${zt.y}px)`:void 0),opacity:Ne==="far"?Rt&&Pt?1:0:Rt?1:0,transition:on?Ne==="far"?`transform ${wo}ms ${gn}`:`transform ${wo}ms ${gn}, opacity ${Rn}ms ${gn}`:pn?`transform ${Rn}ms ${gn}`:Q==="opening"||Ot?`opacity ${Rn}ms ${gn}`:"none",pointerEvents:"none",zIndex:1}},qt=(_,Ie)=>{const Ne=Re(_);return Ne?kx(so(Ne,Ie,A),Ie,A):null},Xt=_=>Ie=>{if(!l){if(k.current){k.current=!1;return}Ie.stopPropagation(),ut(_)}},Dt=je?qt(je,"left"):null,jt=Se?qt(Se,"right"):null,Ht=Dt?vr(Dt,A):null,$t=jt?vr(jt,A):null;return a.jsxs("div",{ref:S,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:Q==="open"?"none":void 0},onClick:en,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Rt?nn:0,transition:ve?"none":`opacity ${Rn}ms ${gn}`,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:y,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Rt?1:0,transition:ve?"none":`opacity ${Rn}ms ${gn}`,pointerEvents:"none"},children:a.jsx(Xd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:en})})]}),Rt&&Te&&a.jsx(xr,{media:Te,style:_t(Te,"left","far"),onMeasure:ze,onTransitionEnd:Ee},`far-prev-${Te.url}`),Rt&&je&&a.jsxs(a.Fragment,{children:[a.jsx(xr,{media:je,style:_t(je,"left"),onMeasure:ze,onTransitionEnd:Ee},`prev-${je.url}`),Ht&&a.jsx("div",{style:{position:"absolute",top:Ht.top,left:Ht.left,width:Ht.width,height:Ht.height,cursor:l||ve?"default":"pointer",pointerEvents:l||ve?"none":"auto",zIndex:3},onClick:Xt(-1)})]}),Rt&&Se&&a.jsxs(a.Fragment,{children:[a.jsx(xr,{media:Se,style:_t(Se,"right"),onMeasure:ze,onTransitionEnd:Ee},`next-${Se.url}`),$t&&a.jsx("div",{style:{position:"absolute",top:$t.top,left:$t.left,width:$t.width,height:$t.height,cursor:l||ve?"default":"pointer",pointerEvents:l||ve?"none":"auto",zIndex:3},onClick:Xt(1)})]}),Rt&&Xe&&a.jsx(xr,{media:Xe,style:_t(Xe,"right","far"),onMeasure:ze,onTransitionEnd:Ee},`far-next-${Xe.url}`),ae&&G&&(Me?a.jsx(_x,{src:G.url,phase:Q,onMediaElement:Nt,wrapperStyle:Vt,videoStyle:Wt,onLoadedMetadata:bt,onTransitionEnd:Ee},`${n}-${G.url}`):a.jsx("img",{ref:Nt,src:G.url,alt:G.name,onLoad:bt,onTransitionEnd:Ee,style:Vt},`${n}-${G.url}`))]})}const Nx=20,Hx=.18;function Ox(e){return`
18794
18803
  .${e}-wrapper {
18795
18804
  box-sizing: border-box;
18796
18805
  max-width: 100%;
@@ -18878,7 +18887,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
18878
18887
  pointer-events: auto;
18879
18888
  }
18880
18889
  ${yx(e)}
18881
- `}function Dx(e){const{imageDisplay:t}=e??{},n=(t==null?void 0:t.ratioValue)??"1:1",i=(t==null?void 0:t.reversed)??!1,[o,r]=n.split(":").map(Number),l=i?r:o,d=i?o:r;return d>0?l/d:1}function jx(e){const t=e instanceof HTMLVideoElement?e.videoWidth:e.naturalWidth,n=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight;return!t||!n?null:t/n}function zx(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:D.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:D.scalingValue(i*Hx,n??!1),[`--${t}-image-aspect`]:Dx(e)}}function Bx(e,t){var i,o;const n={fontSettings:{fontFamily:(e==null?void 0:e.titleFontFamily)??"Arial",fontWeight:((i=e==null?void 0:e.titleFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e==null?void 0:e.titleFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:(e==null?void 0:e.titleFontSize)??.07,lineHeight:e==null?void 0:e.titleLineHeight,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,color:(e==null?void 0:e.titleColor)??"#000000"};return Yt(n,t)}function Vx(e){var o;const t=((o=e==null?void 0:e.imageDisplay)==null?void 0:o.display)==="cover",n=((e==null?void 0:e.lightbox)??"on")==="on",i={objectFit:t?"cover":"contain",pointerEvents:"auto",...n?{cursor:"pointer"}:null};return{objectFitMode:t?"cover":"contain",imageStyle:i}}function Gx(e,t,n,i,o,r){if(!(!e||!t))return l=>{var c;const d=((c=l.currentTarget.closest(`.${i}-item`))==null?void 0:c.querySelector(`[data-waterfall-index="${n}"]`))??(l.currentTarget instanceof HTMLImageElement||l.currentTarget instanceof HTMLVideoElement?l.currentTarget:null);r(n,d?uu(d,o):void 0)}}function qx({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=D.useScopedStyles(),c=s.useMemo(()=>Ox(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",b=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,v=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,g=D.scalingValue(v,n??!1),h=`max(${g}, ${Nx}px)`,{objectFitMode:f,imageStyle:x}=Vx(e),S=Bx(e,n),y=s.useRef(null),[w,H]=s.useState(!1),[N,Y]=s.useState([]),[O,C]=s.useState(0),[V,$]=s.useState(0),[R,k]=s.useState(null),[T,m]=s.useState({title1:"",title2:"",title3:""}),M=(!n||i)&&!w,E=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},z=E.sizeType??"none",ne=M&&z!=="none"?`${d}-item-image-hover-${z}`:void 0,I=(E.value??120)/100,W=s.useCallback(le=>{!le||z!=="scale"||(le.style.transformOrigin=zg(le))},[z]),K=s.useCallback(le=>{if(le){if(f==="contain"){const ee=jx(le);if(ee){const ue=le.closest(`.${d}-item-image`);ue instanceof HTMLElement&&ue.style.setProperty(`--${d}-item-media-aspect`,String(ee))}}W(le)}},[d,W,f]),ae={width:D.scalingValue(b,n??!1),...S,...zx(e,d,n),[`--${d}-image-hover-scale`]:String(I)},de=(()=>{const le={},ee=y.current?getComputedStyle(y.current).getPropertyValue("--cntrl-article-width").trim():"";return ee&&(le["--cntrl-article-width"]=ee),le})(),A=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),he=s.useMemo(()=>Tx(u),[u]),q=s.useMemo(()=>Mx(u),[u]),ce=(le,ee)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const ue=he.findIndex(Fe=>Fe.gridIndex===le);if(ue<0)return;const oe=he[ue];$(ue),Y(oe.items),C(0),m(oe.entry),k(ee??null),H(!0)},Q=s.useCallback(()=>{H(!1),k(null)},[]),be=s.useCallback(()=>{const le=he[V];return!le||!y.current?R:Cx(y.current,le.gridIndex,f)??R},[he,V,R,f]),He=s.useCallback(le=>{if(he.length>1){const ee=he.length,ue=(V+le+ee)%ee,oe=he[ue];$(ue),Y(oe.items),C(0),m(oe.entry);return}C(ee=>(ee+le+N.length)%N.length)},[he,V,N.length]),xe=he.length>1||N.length>1;return s.useEffect(()=>{if(!w||typeof document>"u")return;const le=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=le}},[w]),s.useEffect(()=>{!n||o||i||H(!1)},[n,o,i]),s.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&H(!1)},[e==null?void 0:e.lightbox]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx(Px,{mediaList:q}),a.jsx("div",{ref:y,className:`${d}-wrapper ${d}-type-${p}`,style:ae,children:u.map((le,ee)=>{var Fe,Ce;const ue=!!((Fe=le.image)!=null&&Fe.url),oe=Gx(!!A,ue,ee,d,f,ce);return a.jsxs("div",{className:`${d}-item`,children:[le.title?a.jsx("span",{className:`${d}-item-title`,onClick:oe,style:oe?{cursor:"pointer"}:void 0,children:le.title}):null,(Ce=le.image)!=null&&Ce.url?a.jsx("span",{className:[`${d}-item-image`,f==="contain"?`${d}-item-image-fit`:void 0,ne].filter(Boolean).join(" "),children:le.image.type==="video"?a.jsx("video",{ref:K,src:le.image.url,"data-waterfall-index":ee,style:x,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:oe,onLoadedData:P=>K(P.currentTarget)}):a.jsx("img",{ref:K,src:le.image.url,alt:le.image.name??"","data-waterfall-index":ee,style:x,onClick:oe,onLoad:P=>K(P.currentTarget)})}):null,ee<u.length-1&&a.jsx("div",{className:`${d}-item-gap-host`,style:{width:g},children:o&&!w&&a.jsx("div",{"data-controls":"horizontalGap","data-controls-axis":"x","data-controls-min":"0",className:`${d}-item-gap-control`,style:{left:"50%",transform:"translateX(-50%)",width:h,height:"100%"}})})]},ee)})}),w&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const le=(l?document.getElementById(l):null)??document.body;return Vn.createPortal(a.jsx("div",{style:de,"data-selection":"none",children:a.jsx(Wx,{prefix:d,items:N,index:O,entry:T,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:xe,lightboxEntries:he,entryIdx:V,layoutId:r,sourceRect:R,resolveCloseSourceRect:be,onClose:Q,onPrev:()=>He(-1),onNext:()=>He(1)})}),le)})()]})}const Xx=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
18890
+ `}function Dx(e){const{imageDisplay:t}=e??{},n=(t==null?void 0:t.ratioValue)??"1:1",i=(t==null?void 0:t.reversed)??!1,[o,r]=n.split(":").map(Number),l=i?r:o,d=i?o:r;return d>0?l/d:1}function jx(e){const t=e instanceof HTMLVideoElement?e.videoWidth:e.naturalWidth,n=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight;return!t||!n?null:t/n}function zx(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:D.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:D.scalingValue(i*Hx,n??!1),[`--${t}-image-aspect`]:Dx(e)}}function Bx(e,t){var i,o;const n={fontSettings:{fontFamily:(e==null?void 0:e.titleFontFamily)??"Arial",fontWeight:((i=e==null?void 0:e.titleFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e==null?void 0:e.titleFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:(e==null?void 0:e.titleFontSize)??.07,lineHeight:e==null?void 0:e.titleLineHeight,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,color:(e==null?void 0:e.titleColor)??"#000000"};return Yt(n,t)}function Vx(e){var o;const t=((o=e==null?void 0:e.imageDisplay)==null?void 0:o.display)==="cover",n=((e==null?void 0:e.lightbox)??"on")==="on",i={objectFit:t?"cover":"contain",pointerEvents:"auto",...n?{cursor:"pointer"}:null};return{objectFitMode:t?"cover":"contain",imageStyle:i}}function Gx(e,t,n,i,o,r){if(!(!e||!t))return l=>{var c;const d=((c=l.currentTarget.closest(`.${i}-item`))==null?void 0:c.querySelector(`[data-waterfall-index="${n}"]`))??(l.currentTarget instanceof HTMLImageElement||l.currentTarget instanceof HTMLVideoElement?l.currentTarget:null);r(n,d?uu(d,o):void 0)}}function qx({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=D.useScopedStyles(),c=s.useMemo(()=>Ox(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",b=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,v=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,g=D.scalingValue(v,n??!1),h=`max(${g}, ${Nx}px)`,{objectFitMode:f,imageStyle:x}=Vx(e),S=Bx(e,n),y=s.useRef(null),[w,H]=s.useState(!1),[N,U]=s.useState([]),[O,C]=s.useState(0),[V,$]=s.useState(0),[R,k]=s.useState(null),[T,m]=s.useState({title1:"",title2:"",title3:""}),M=(!n||i)&&!w,E=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},z=E.sizeType??"none",ne=M&&z!=="none"?`${d}-item-image-hover-${z}`:void 0,I=(E.value??120)/100,W=s.useCallback(le=>{!le||z!=="scale"||(le.style.transformOrigin=zg(le))},[z]),K=s.useCallback(le=>{if(le){if(f==="contain"){const ee=jx(le);if(ee){const ue=le.closest(`.${d}-item-image`);ue instanceof HTMLElement&&ue.style.setProperty(`--${d}-item-media-aspect`,String(ee))}}W(le)}},[d,W,f]),ae={width:D.scalingValue(b,n??!1),...S,...zx(e,d,n),[`--${d}-image-hover-scale`]:String(I)},de=(()=>{const le={},ee=y.current?getComputedStyle(y.current).getPropertyValue("--cntrl-article-width").trim():"";return ee&&(le["--cntrl-article-width"]=ee),le})(),A=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),he=s.useMemo(()=>Tx(u),[u]),q=s.useMemo(()=>Mx(u),[u]),ce=(le,ee)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const ue=he.findIndex(Fe=>Fe.gridIndex===le);if(ue<0)return;const oe=he[ue];$(ue),U(oe.items),C(0),m(oe.entry),k(ee??null),H(!0)},Q=s.useCallback(()=>{H(!1),k(null)},[]),be=s.useCallback(()=>{const le=he[V];return!le||!y.current?R:Cx(y.current,le.gridIndex,f)??R},[he,V,R,f]),He=s.useCallback(le=>{if(he.length>1){const ee=he.length,ue=(V+le+ee)%ee,oe=he[ue];$(ue),U(oe.items),C(0),m(oe.entry);return}C(ee=>(ee+le+N.length)%N.length)},[he,V,N.length]),xe=he.length>1||N.length>1;return s.useEffect(()=>{if(!w||typeof document>"u")return;const le=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=le}},[w]),s.useEffect(()=>{!n||o||i||H(!1)},[n,o,i]),s.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&H(!1)},[e==null?void 0:e.lightbox]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx(Px,{mediaList:q}),a.jsx("div",{ref:y,className:`${d}-wrapper ${d}-type-${p}`,style:ae,children:u.map((le,ee)=>{var Fe,Ce;const ue=!!((Fe=le.image)!=null&&Fe.url),oe=Gx(!!A,ue,ee,d,f,ce);return a.jsxs("div",{className:`${d}-item`,children:[le.title?a.jsx("span",{className:`${d}-item-title`,onClick:oe,style:oe?{cursor:"pointer"}:void 0,children:le.title}):null,(Ce=le.image)!=null&&Ce.url?a.jsx("span",{className:[`${d}-item-image`,f==="contain"?`${d}-item-image-fit`:void 0,ne].filter(Boolean).join(" "),children:le.image.type==="video"?a.jsx("video",{ref:K,src:le.image.url,"data-waterfall-index":ee,style:x,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:oe,onLoadedData:P=>K(P.currentTarget)}):a.jsx("img",{ref:K,src:le.image.url,alt:le.image.name??"","data-waterfall-index":ee,style:x,onClick:oe,onLoad:P=>K(P.currentTarget)})}):null,ee<u.length-1&&a.jsx("div",{className:`${d}-item-gap-host`,style:{width:g},children:o&&!w&&a.jsx("div",{"data-controls":"horizontalGap","data-controls-axis":"x","data-controls-min":"0",className:`${d}-item-gap-control`,style:{left:"50%",transform:"translateX(-50%)",width:h,height:"100%"}})})]},ee)})}),w&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const le=(l?document.getElementById(l):null)??document.body;return Vn.createPortal(a.jsx("div",{style:de,"data-selection":"none",children:a.jsx(Wx,{prefix:d,items:N,index:O,entry:T,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:xe,lightboxEntries:he,entryIdx:V,layoutId:r,sourceRect:R,resolveCloseSourceRect:be,onClose:Q,onPrev:()=>He(-1),onNext:()=>He(1)})}),le)})()]})}const Xx=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
18882
18891
  import type React from 'react';
18883
18892
  import { createPortal } from 'react-dom';
18884
18893
  import { CommonComponentProps } from '../props';
@@ -19662,7 +19671,7 @@ export function Waterfall({
19662
19671
  from { clip-path: inset(100% 0 0 0); }
19663
19672
  to { clip-path: inset(0 0 0 0); }
19664
19673
  }
19665
- `}function hb({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=D.useScopedStyles(),l=cb(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??wc,p=u.sizeType??"drag",b=u.value??wc.value,v=(e==null?void 0:e.direction)??"horizontal",g=(e==null?void 0:e.transition)??"slide",h=(e==null?void 0:e.nav)??"classic",f=(e==null?void 0:e.navSize)??"m",x=sb[f],S=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,y=Se=>D.scalingValue(Se*S,n),w=(e==null?void 0:e.show)??"always",H=(e==null?void 0:e.controls)??null,N=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,Y=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,O=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,C=(e==null?void 0:e.controlsColor)??bc.color,V=(e==null?void 0:e.controlsHoverColor)??bc.hover,$=(e==null?void 0:e.navColor)??So.colors.inactive,R=(e==null?void 0:e.navPaginationColor)??So.colors.pagination,k=(e==null?void 0:e.navBackgroundColor)??So.colors.background,T=(e==null?void 0:e.linkColor)??za.linkColor,m=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,M=v==="horizontal",E=p==="click",z=p==="drag",ne=p==="auto"&&(!n||!!i),I=!n,W=g==="slide",K=h==="classic",ae=w!=="never"&&N>0,de=w==="on hover",A=D.scalingValue(N,n),he={width:A,height:A,maxWidth:A},q=W&&c>1,[ce,Q]=s.useState(0),[be,He]=s.useState(q?1:0),[xe,le]=s.useState(!1),[ee,ue]=s.useState(!1),[oe,Fe]=s.useState(!1),[Ce,P]=s.useState(0),[U,X]=s.useState(!1),[ie,j]=s.useState(!1),B=s.useRef(!1),J=s.useRef(be);J.current=be;const te=s.useRef(null),$e=s.useRef(0),ye=s.useRef(null),F=s.useRef(null),ve=s.useRef(null),pe=s.useRef(null),Z=s.useCallback(Se=>{B.current=Se,le(Se)},[]),me=s.useCallback(Se=>{if(c<2||Se===0)return;const We=Se>0?1:-1,Be=Math.abs(Se);if(X(!0),Z(!0),!W){Q(Xe=>Ro(Xe+Se,c));return}let Ze=J.current;const Le=q&&(Ze===0||Ze===c+1),Ve=Le?ce+1:null;Le&&(Ze=ce+1);let se=Be;for(;se>0;){const Xe=db(Ze,We,c,q);if(Ze=Xe.position,se-=1,Xe.hitBoundary){$e.current=se*We;break}}const Te=Be-se;if(Te>0&&Q(Xe=>Ro(Xe+Te*We,c)),J.current=Ze,Ve!==null){if(J.current=Ve,Ze===Ve){ue(!0),He(Ze);return}te.current=Ze,ue(!0),He(Ve);return}ue(!1),He(Ze)},[ce,c,q,W,Z]),De=s.useCallback(Se=>{me(Se)},[me]),ge=s.useCallback(Se=>{if(c<2)return;const We=Ro(Se,c);if(!(We===ce&&!B.current)&&(X(!0),Z(!0),Q(We),W)){const Be=We+(q?1:0);te.current=null,$e.current=0,J.current=Be,ue(!1),He(Be)}},[ce,c,q,W,Z]);s.useEffect(()=>{if(!xe)return;const Se=window.setTimeout(()=>{if(q&&(be===0||be===c+1)){te.current=null,ue(!0),He(ce+1);return}Z(!1)},Ui);return()=>window.clearTimeout(Se)},[ce,c,q,xe,Z,be]),s.useEffect(()=>{if(!ee)return;let Se=0;const We=requestAnimationFrame(()=>{Se=requestAnimationFrame(()=>{const Be=te.current;te.current=null;const Ze=$e.current;if($e.current=0,ue(!1),Be!==null){J.current=Be,He(Be);return}if(Ze!==0){me(Ze);return}Z(!1)})});return()=>{cancelAnimationFrame(We),cancelAnimationFrame(Se)}},[me,Z,ee]);const G=`${q}:${c}`,Me=s.useRef(G);s.useEffect(()=>{if(Me.current===G)return;Me.current=G;const Se=c>0?Math.min(ce,c-1):0;ve.current=null,pe.current=null,Fe(!1),P(0),Q(Se),ue(!0),He(Se+(q?1:0))},[ce,c,q,G]),s.useEffect(()=>{if(!U)return;const Se=window.setTimeout(()=>X(!1),nb);return()=>window.clearTimeout(Se)},[U,ce]),s.useEffect(()=>{if(!ne||c<2)return;const Se=Math.max(b,.1)*1e3,We=window.setInterval(()=>{I&&ie||De(1)},Se);return()=>window.clearInterval(We)},[b,c,De,ne,ie,I]);const _e=s.useCallback(Se=>{const We=ve.current;if(!We||We.pointerId!==Se.pointerId)return;ve.current=null,pe.current=null;const Be=ye.current;if(Be!=null&&Be.hasPointerCapture(Se.pointerId)&&Be.releasePointerCapture(Se.pointerId),!We.isActive){W&&P(0);return}const Le=!(Se.timeStamp-We.lastTime>ab)&&Math.abs(We.velocity)>rb,Ve=We.size>0&&Math.abs(We.offset-We.baseOffset)>We.size*ob;if(Fe(!1),!Le&&!Ve){P(0);return}const se=Ve?We.offset-We.baseOffset:We.velocity;let Te=1;Ve&&We.size>0&&(Te=Math.max(1,Math.round(Math.abs(se)/We.size))),P(0),me(se<0?Te:-Te)},[me,W]);s.useEffect(()=>{const Se=We=>{pe.current===null||We.pointerId!==pe.current||_e(We)};return window.addEventListener("pointerup",Se),window.addEventListener("pointercancel",Se),()=>{window.removeEventListener("pointerup",Se),window.removeEventListener("pointercancel",Se)}},[_e]);const rt=Se=>{const We=ye.current;if(!z||c<2||!We||Se.pointerType==="mouse"&&Se.button!==0)return;te.current=null,$e.current=0,B.current&&Z(!1);let Be=0;const Ze=F.current;if(W&&Ze){const Le=M?Ze.offsetWidth:Ze.offsetHeight;if(Le>0){const Ve=ub(Ze,M);let se=J.current;q&&(se===0||se===c+1)?(se=ce+1,J.current=se,ue(!0),He(se),Be=0):Be=Ve+se*Le,P(Be)}}We.setPointerCapture(Se.pointerId),pe.current=Se.pointerId,ve.current={pointerId:Se.pointerId,startClientX:Se.clientX,startClientY:Se.clientY,axes:pb(We,`${r}-axis-probe`),size:M?We.offsetWidth:We.offsetHeight,isActive:!1,baseOffset:Be,offset:Be,lastTime:Se.timeStamp,velocity:0}},Je=Se=>{const We=ve.current;if(!We||We.pointerId!==Se.pointerId)return;if(Se.pointerType==="mouse"&&Se.buttons===0){_e(Se);return}const Be=Se.clientX-We.startClientX,Ze=Se.clientY-We.startClientY,Le=We.axes?mb(We.axes,Be,Ze):{x:Be,y:Ze},Ve=M?Le.x:Le.y,se=M?Le.y:Le.x,Te=We.baseOffset+Ve;if(!We.isActive){if(Math.max(Math.abs(Ve),Math.abs(se))<ib)return;if(Math.abs(se)>Math.abs(Ve)){const ze=ye.current;ze!=null&&ze.hasPointerCapture(We.pointerId)&&ze.releasePointerCapture(We.pointerId),ve.current=null,pe.current=null,W&&P(0);return}We.isActive=!0,Fe(!0)}const Xe=Se.timeStamp-We.lastTime;Xe>0&&(We.velocity=(Te-We.offset)/Xe,We.lastTime=Se.timeStamp),We.offset=Te,W&&P(Te)},at=Se=>{_e(Se)},it=M?`translate3d(calc(${-be*100}% + ${Ce}px), 0, 0)`:`translate3d(0, calc(${-be*100}% + ${Ce}px), 0)`,je=q?[d[c-1],...d,d[0]]:d;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:gb(r,n)}}),a.jsxs("div",{className:yt(`${r}-wrapper`,{[`${r}-transition-reveal`]:g==="reveal",[`${r}-transition-reveal-vertical`]:g==="reveal"&&!M}),onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),children:[a.jsxs("div",{className:`${r}-slider-inner`,style:{backgroundColor:"transparent"},children:[a.jsx("div",{ref:ye,className:yt(`${r}-track`,{[`${r}-track-draggable`]:z,[`${r}-track-draggable-vertical`]:z&&!M}),onPointerDown:rt,onPointerMove:Je,onPointerUp:at,onPointerCancel:at,onLostPointerCapture:Se=>{pe.current===Se.pointerId&&_e(Se)},children:a.jsx("div",{ref:F,className:yt(`${r}-list`,{[`${r}-list-slide`]:W,[`${r}-list-slide-vertical`]:W&&!M,[`${r}-list-fade`]:!W}),style:W?{transform:it,transition:oe||ee?"none":`transform ${Ui}ms ${gu}`}:void 0,children:je.map((Se,We)=>{const Be=q?Ro(We-1,c):We,Le=q&&(We===0||We===c+1)?`clone-${We===0?"start":"end"}`:`slide-${Be}`;return a.jsx("div",{className:yt(`${r}-slide`,{[`${r}-is-active`]:!W&&Be===ce}),children:a.jsx("div",{className:`${r}-slider-item`,children:a.jsx("div",{className:`${r}-img-wrapper`,children:a.jsx("img",{className:yt(`${r}-slider-image`,{[`${r}-contain`]:Se.image.objectFit==="contain",[`${r}-cover`]:Se.image.objectFit==="cover"}),src:Se.image.url,alt:Se.image.name??"",draggable:!1})})})},Le)})})}),ae&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:yt(`${r}-arrow`,{[`${r}-arrow-prev`]:M,[`${r}-arrow-prev-vertical`]:!M,[`${r}-hover-arrow`]:de}),style:{color:C,"--arrow-hover-color":V,...he},children:a.jsxs("button",{onClick:Se=>{Se.stopPropagation(),De(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${D.scalingValue(Y,n)}, ${D.scalingValue(O*(M?1:-1),n)}) rotate(${M?"0deg":"90deg"})`},children:[H&&a.jsx(ln,{url:H,fill:C,hoverFill:V,className:yt(`${r}-arrow-img`,`${r}-mirror`),style:he}),!H&&a.jsx(Sc,{color:C,className:yt(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:yt(`${r}-arrow`,{[`${r}-arrow-next`]:M,[`${r}-arrow-next-vertical`]:!M,[`${r}-hover-arrow`]:de}),style:{color:C,"--arrow-hover-color":V,...he},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:Se=>{Se.stopPropagation(),De(1)},style:{transform:`translate(${D.scalingValue(Y*(M?-1:1),n)}, ${D.scalingValue(O,n)}) rotate(${M?"0deg":"90deg"})`},children:[H&&a.jsx(ln,{url:H,fill:C,hoverFill:V,className:`${r}-arrow-img`,style:he}),!H&&a.jsx(Sc,{color:C,className:yt(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),E&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>De(1)}),K&&a.jsx("div",{className:yt(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:M,[`${r}-pagination-inside-left`]:!M}),style:M?{bottom:y(x.inset)}:{left:y(x.inset)},children:a.jsx("div",{className:yt(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!M,[`${r}-animate-dots`]:U}),style:{backgroundColor:k,gap:y(x.gapInactive-x.activeDot+x.dot),...M?{height:y(x.activeDot+x.paddingY*2),paddingTop:y(x.paddingY),paddingBottom:y(x.paddingY),paddingLeft:y(x.paddingActive),paddingRight:y(x.paddingActive)}:{width:y(x.activeDot+x.paddingY*2),paddingLeft:y(x.paddingY),paddingRight:y(x.paddingY),paddingTop:y(x.paddingActive),paddingBottom:y(x.paddingActive)},borderRadius:y(x.borderRadius),transform:`translate(${D.scalingValue(So.offset.x,n)}, ${D.scalingValue(So.offset.y,n)})`},children:d.map((Se,We)=>{const Be=We===ce,Ze=Be?x.activeDot:x.dot;return a.jsx("button",{onClick:()=>ge(We),className:`${r}-pagination-item`,style:{width:y(x.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:Be?R:$,width:y(Ze)}})},We)})},`${f}-${v}`)})]}),a.jsxs("div",{className:`${r}-caption-block`,children:[a.jsx("div",{"data-controls":o?"captionMarginTop":void 0,className:o?`${r}-control`:void 0,style:{height:D.scalingValue(m,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:d.map((Se,We)=>a.jsx("div",{className:yt(`${r}-caption-text`,{[`${r}-with-pointer-events`]:We===ce&&n,[`${r}-active`]:We===ce}),style:{...l,width:"max-content",transitionDuration:`${Math.round(Ui/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":T,"--link-hover-color":T,position:"relative",top:D.scalingValue(za.offset.y,n),left:D.scalingValue(za.offset.x,n)},children:a.jsx(Ri,{content:Se.imageCaption})})},We))})]})]})]})}function Sc({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const fb=`import React, { useCallback, useEffect, useRef, useState } from 'react';
19674
+ `}function hb({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=D.useScopedStyles(),l=cb(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??wc,p=u.sizeType??"drag",b=u.value??wc.value,v=(e==null?void 0:e.direction)??"horizontal",g=(e==null?void 0:e.transition)??"slide",h=(e==null?void 0:e.nav)??"classic",f=(e==null?void 0:e.navSize)??"m",x=sb[f],S=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,y=Se=>D.scalingValue(Se*S,n),w=(e==null?void 0:e.show)??"always",H=(e==null?void 0:e.controls)??null,N=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,U=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,O=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,C=(e==null?void 0:e.controlsColor)??bc.color,V=(e==null?void 0:e.controlsHoverColor)??bc.hover,$=(e==null?void 0:e.navColor)??So.colors.inactive,R=(e==null?void 0:e.navPaginationColor)??So.colors.pagination,k=(e==null?void 0:e.navBackgroundColor)??So.colors.background,T=(e==null?void 0:e.linkColor)??za.linkColor,m=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,M=v==="horizontal",E=p==="click",z=p==="drag",ne=p==="auto"&&(!n||!!i),I=!n,W=g==="slide",K=h==="classic",ae=w!=="never"&&N>0,de=w==="on hover",A=D.scalingValue(N,n),he={width:A,height:A,maxWidth:A},q=W&&c>1,[ce,Q]=s.useState(0),[be,He]=s.useState(q?1:0),[xe,le]=s.useState(!1),[ee,ue]=s.useState(!1),[oe,Fe]=s.useState(!1),[Ce,P]=s.useState(0),[Y,X]=s.useState(!1),[ie,j]=s.useState(!1),B=s.useRef(!1),J=s.useRef(be);J.current=be;const te=s.useRef(null),$e=s.useRef(0),ye=s.useRef(null),F=s.useRef(null),ve=s.useRef(null),pe=s.useRef(null),Z=s.useCallback(Se=>{B.current=Se,le(Se)},[]),me=s.useCallback(Se=>{if(c<2||Se===0)return;const We=Se>0?1:-1,Be=Math.abs(Se);if(X(!0),Z(!0),!W){Q(Xe=>Ro(Xe+Se,c));return}let Ze=J.current;const Le=q&&(Ze===0||Ze===c+1),Ve=Le?ce+1:null;Le&&(Ze=ce+1);let se=Be;for(;se>0;){const Xe=db(Ze,We,c,q);if(Ze=Xe.position,se-=1,Xe.hitBoundary){$e.current=se*We;break}}const Te=Be-se;if(Te>0&&Q(Xe=>Ro(Xe+Te*We,c)),J.current=Ze,Ve!==null){if(J.current=Ve,Ze===Ve){ue(!0),He(Ze);return}te.current=Ze,ue(!0),He(Ve);return}ue(!1),He(Ze)},[ce,c,q,W,Z]),De=s.useCallback(Se=>{me(Se)},[me]),ge=s.useCallback(Se=>{if(c<2)return;const We=Ro(Se,c);if(!(We===ce&&!B.current)&&(X(!0),Z(!0),Q(We),W)){const Be=We+(q?1:0);te.current=null,$e.current=0,J.current=Be,ue(!1),He(Be)}},[ce,c,q,W,Z]);s.useEffect(()=>{if(!xe)return;const Se=window.setTimeout(()=>{if(q&&(be===0||be===c+1)){te.current=null,ue(!0),He(ce+1);return}Z(!1)},Ui);return()=>window.clearTimeout(Se)},[ce,c,q,xe,Z,be]),s.useEffect(()=>{if(!ee)return;let Se=0;const We=requestAnimationFrame(()=>{Se=requestAnimationFrame(()=>{const Be=te.current;te.current=null;const Ze=$e.current;if($e.current=0,ue(!1),Be!==null){J.current=Be,He(Be);return}if(Ze!==0){me(Ze);return}Z(!1)})});return()=>{cancelAnimationFrame(We),cancelAnimationFrame(Se)}},[me,Z,ee]);const G=`${q}:${c}`,Me=s.useRef(G);s.useEffect(()=>{if(Me.current===G)return;Me.current=G;const Se=c>0?Math.min(ce,c-1):0;ve.current=null,pe.current=null,Fe(!1),P(0),Q(Se),ue(!0),He(Se+(q?1:0))},[ce,c,q,G]),s.useEffect(()=>{if(!Y)return;const Se=window.setTimeout(()=>X(!1),nb);return()=>window.clearTimeout(Se)},[Y,ce]),s.useEffect(()=>{if(!ne||c<2)return;const Se=Math.max(b,.1)*1e3,We=window.setInterval(()=>{I&&ie||De(1)},Se);return()=>window.clearInterval(We)},[b,c,De,ne,ie,I]);const _e=s.useCallback(Se=>{const We=ve.current;if(!We||We.pointerId!==Se.pointerId)return;ve.current=null,pe.current=null;const Be=ye.current;if(Be!=null&&Be.hasPointerCapture(Se.pointerId)&&Be.releasePointerCapture(Se.pointerId),!We.isActive){W&&P(0);return}const Le=!(Se.timeStamp-We.lastTime>ab)&&Math.abs(We.velocity)>rb,Ve=We.size>0&&Math.abs(We.offset-We.baseOffset)>We.size*ob;if(Fe(!1),!Le&&!Ve){P(0);return}const se=Ve?We.offset-We.baseOffset:We.velocity;let Te=1;Ve&&We.size>0&&(Te=Math.max(1,Math.round(Math.abs(se)/We.size))),P(0),me(se<0?Te:-Te)},[me,W]);s.useEffect(()=>{const Se=We=>{pe.current===null||We.pointerId!==pe.current||_e(We)};return window.addEventListener("pointerup",Se),window.addEventListener("pointercancel",Se),()=>{window.removeEventListener("pointerup",Se),window.removeEventListener("pointercancel",Se)}},[_e]);const rt=Se=>{const We=ye.current;if(!z||c<2||!We||Se.pointerType==="mouse"&&Se.button!==0)return;te.current=null,$e.current=0,B.current&&Z(!1);let Be=0;const Ze=F.current;if(W&&Ze){const Le=M?Ze.offsetWidth:Ze.offsetHeight;if(Le>0){const Ve=ub(Ze,M);let se=J.current;q&&(se===0||se===c+1)?(se=ce+1,J.current=se,ue(!0),He(se),Be=0):Be=Ve+se*Le,P(Be)}}We.setPointerCapture(Se.pointerId),pe.current=Se.pointerId,ve.current={pointerId:Se.pointerId,startClientX:Se.clientX,startClientY:Se.clientY,axes:pb(We,`${r}-axis-probe`),size:M?We.offsetWidth:We.offsetHeight,isActive:!1,baseOffset:Be,offset:Be,lastTime:Se.timeStamp,velocity:0}},Je=Se=>{const We=ve.current;if(!We||We.pointerId!==Se.pointerId)return;if(Se.pointerType==="mouse"&&Se.buttons===0){_e(Se);return}const Be=Se.clientX-We.startClientX,Ze=Se.clientY-We.startClientY,Le=We.axes?mb(We.axes,Be,Ze):{x:Be,y:Ze},Ve=M?Le.x:Le.y,se=M?Le.y:Le.x,Te=We.baseOffset+Ve;if(!We.isActive){if(Math.max(Math.abs(Ve),Math.abs(se))<ib)return;if(Math.abs(se)>Math.abs(Ve)){const ze=ye.current;ze!=null&&ze.hasPointerCapture(We.pointerId)&&ze.releasePointerCapture(We.pointerId),ve.current=null,pe.current=null,W&&P(0);return}We.isActive=!0,Fe(!0)}const Xe=Se.timeStamp-We.lastTime;Xe>0&&(We.velocity=(Te-We.offset)/Xe,We.lastTime=Se.timeStamp),We.offset=Te,W&&P(Te)},at=Se=>{_e(Se)},it=M?`translate3d(calc(${-be*100}% + ${Ce}px), 0, 0)`:`translate3d(0, calc(${-be*100}% + ${Ce}px), 0)`,je=q?[d[c-1],...d,d[0]]:d;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:gb(r,n)}}),a.jsxs("div",{className:yt(`${r}-wrapper`,{[`${r}-transition-reveal`]:g==="reveal",[`${r}-transition-reveal-vertical`]:g==="reveal"&&!M}),onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),children:[a.jsxs("div",{className:`${r}-slider-inner`,style:{backgroundColor:"transparent"},children:[a.jsx("div",{ref:ye,className:yt(`${r}-track`,{[`${r}-track-draggable`]:z,[`${r}-track-draggable-vertical`]:z&&!M}),onPointerDown:rt,onPointerMove:Je,onPointerUp:at,onPointerCancel:at,onLostPointerCapture:Se=>{pe.current===Se.pointerId&&_e(Se)},children:a.jsx("div",{ref:F,className:yt(`${r}-list`,{[`${r}-list-slide`]:W,[`${r}-list-slide-vertical`]:W&&!M,[`${r}-list-fade`]:!W}),style:W?{transform:it,transition:oe||ee?"none":`transform ${Ui}ms ${gu}`}:void 0,children:je.map((Se,We)=>{const Be=q?Ro(We-1,c):We,Le=q&&(We===0||We===c+1)?`clone-${We===0?"start":"end"}`:`slide-${Be}`;return a.jsx("div",{className:yt(`${r}-slide`,{[`${r}-is-active`]:!W&&Be===ce}),children:a.jsx("div",{className:`${r}-slider-item`,children:a.jsx("div",{className:`${r}-img-wrapper`,children:a.jsx("img",{className:yt(`${r}-slider-image`,{[`${r}-contain`]:Se.image.objectFit==="contain",[`${r}-cover`]:Se.image.objectFit==="cover"}),src:Se.image.url,alt:Se.image.name??"",draggable:!1})})})},Le)})})}),ae&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:yt(`${r}-arrow`,{[`${r}-arrow-prev`]:M,[`${r}-arrow-prev-vertical`]:!M,[`${r}-hover-arrow`]:de}),style:{color:C,"--arrow-hover-color":V,...he},children:a.jsxs("button",{onClick:Se=>{Se.stopPropagation(),De(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${D.scalingValue(U,n)}, ${D.scalingValue(O*(M?1:-1),n)}) rotate(${M?"0deg":"90deg"})`},children:[H&&a.jsx(ln,{url:H,fill:C,hoverFill:V,className:yt(`${r}-arrow-img`,`${r}-mirror`),style:he}),!H&&a.jsx(Sc,{color:C,className:yt(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:yt(`${r}-arrow`,{[`${r}-arrow-next`]:M,[`${r}-arrow-next-vertical`]:!M,[`${r}-hover-arrow`]:de}),style:{color:C,"--arrow-hover-color":V,...he},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:Se=>{Se.stopPropagation(),De(1)},style:{transform:`translate(${D.scalingValue(U*(M?-1:1),n)}, ${D.scalingValue(O,n)}) rotate(${M?"0deg":"90deg"})`},children:[H&&a.jsx(ln,{url:H,fill:C,hoverFill:V,className:`${r}-arrow-img`,style:he}),!H&&a.jsx(Sc,{color:C,className:yt(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),E&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>De(1)}),K&&a.jsx("div",{className:yt(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:M,[`${r}-pagination-inside-left`]:!M}),style:M?{bottom:y(x.inset)}:{left:y(x.inset)},children:a.jsx("div",{className:yt(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!M,[`${r}-animate-dots`]:Y}),style:{backgroundColor:k,gap:y(x.gapInactive-x.activeDot+x.dot),...M?{height:y(x.activeDot+x.paddingY*2),paddingTop:y(x.paddingY),paddingBottom:y(x.paddingY),paddingLeft:y(x.paddingActive),paddingRight:y(x.paddingActive)}:{width:y(x.activeDot+x.paddingY*2),paddingLeft:y(x.paddingY),paddingRight:y(x.paddingY),paddingTop:y(x.paddingActive),paddingBottom:y(x.paddingActive)},borderRadius:y(x.borderRadius),transform:`translate(${D.scalingValue(So.offset.x,n)}, ${D.scalingValue(So.offset.y,n)})`},children:d.map((Se,We)=>{const Be=We===ce,Ze=Be?x.activeDot:x.dot;return a.jsx("button",{onClick:()=>ge(We),className:`${r}-pagination-item`,style:{width:y(x.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:Be?R:$,width:y(Ze)}})},We)})},`${f}-${v}`)})]}),a.jsxs("div",{className:`${r}-caption-block`,children:[a.jsx("div",{"data-controls":o?"captionMarginTop":void 0,className:o?`${r}-control`:void 0,style:{height:D.scalingValue(m,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:d.map((Se,We)=>a.jsx("div",{className:yt(`${r}-caption-text`,{[`${r}-with-pointer-events`]:We===ce&&n,[`${r}-active`]:We===ce}),style:{...l,width:"max-content",transitionDuration:`${Math.round(Ui/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":T,"--link-hover-color":T,position:"relative",top:D.scalingValue(za.offset.y,n),left:D.scalingValue(za.offset.x,n)},children:a.jsx(Ri,{content:Se.imageCaption})})},We))})]})]})]})}function Sc({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const fb=`import React, { useCallback, useEffect, useRef, useState } from 'react';
19666
19675
  import cn from 'classnames';
19667
19676
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
19668
19677
  import { scalingValue } from '../utils/scalingValue';
@@ -21060,7 +21069,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
21060
21069
  width: var(--cntrl-article-width, 100vw) !important;
21061
21070
  height: var(--cntrl-viewport-height, 100vh) !important;
21062
21071
  }
21063
- `}const Sb="rgba(28,31,34,0.9)",_n=500,vi="cubic-bezier(0.22, 1, 0.36, 1)",$b=72,Cb=50,Tb={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},Lb=[];function Rb(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 Ib(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Eb(e){const[t]=e.media;return t!=null&&t.url?t:null}function Mb(e){if(!Array.isArray(e)||e.length===0)return[];if(Rb(e)){const t=[];for(const n of e){const i=Ib(n);if(!i)continue;const o=Eb(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.url?o:null})}return t}return e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function ps(e){return e.type==="video"}function Pb(e){e.pause(),e.removeAttribute("src"),e.load()}function wr(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function kb(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const Ab=1140/1440;function Fb(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 _b(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 Wb(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Nb({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:d}){return s.useEffect(()=>{const c=n.current;if(c)return()=>{Pb(c)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:d,style:i})}function Hb({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const b=i==="cover",v=s.useRef(null),g=s.useRef(null),h=s.useRef(null),f=s.useRef(0),x=s.useRef(0),S=s.useRef("none"),y=s.useRef(!1),w=s.useRef(!1),H=s.useRef(!1),N=s.useRef(null),[Y,O]=s.useState(null),[C,V]=s.useState("opening"),[$,R]=s.useState(0),[k,T]=s.useState(0),[m,M]=s.useState(!1),[E,z]=s.useState(!1),[ne,I]=s.useState(!1),W=s.useRef(n),K=t[n],ae=K?ps(K):!1,de=k!==0||m,A=s.useCallback(U=>{H.current=U,M(U)},[]),he=s.useCallback(()=>{N.current!==null&&(window.clearTimeout(N.current),N.current=null)},[]),q=s.useCallback(()=>{he(),N.current=window.setTimeout(()=>{he(),A(!1)},_n+32)},[he,A]),ce=s.useCallback(()=>{const U=v.current,X=g.current;if(!U)return;const ie=U.getBoundingClientRect(),j=ie.width,B=ie.height;if(!j||!B)return;if(i==="cover"){O({width:j,height:B,left:ie.left,top:ie.top});return}if(!X){O(wr(U));return}const{width:J,height:te}=kb(X);if(!J||!te){O(wr(U));return}const $e=J/te,ye=j/B;if($e>ye){const F=j/$e;O({width:j,height:F,left:ie.left,top:ie.top+(B-F)/2})}else{const F=B*$e;O({width:F,height:B,left:ie.left+(j-F)/2,top:ie.top})}},[i]);s.useEffect(()=>{ce();const U=v.current;if(!U)return;const X=new ResizeObserver(()=>ce());return X.observe(U),()=>X.disconnect()},[ce,n]),s.useEffect(()=>{C==="opening"&&Y&&V("open")},[C,Y]),s.useEffect(()=>{if(C!=="closing")return;const U=setTimeout(()=>r(),_n);return()=>clearTimeout(U)},[C,r]),s.useEffect(()=>()=>{he()},[he]),s.useLayoutEffect(()=>{if(W.current===n)return;he(),R(0),T(0),A(!1),I(!1),z(!1),f.current=0,x.current=0,S.current="none",y.current=!1,h.current=null,w.current=!1;const U=v.current;U&&O(wr(U)),W.current=n},[n,A,he]),s.useEffect(()=>{if(C!=="open")return;let U=null;const X=()=>{U&&(document.removeEventListener("click",U,!0),U=null)},ie=()=>{X(),U=ye=>{ye.stopPropagation(),ye.preventDefault(),X()},document.addEventListener("click",U,!0)},j=ye=>{he(),H.current=!1,M(!1),T(0),z(!1),y.current=!1,x.current=0,S.current="none";const F=v.current;F&&O(wr(F)),ye<0?d():l()},B=ye=>{if(Math.abs(ye)>Cb&&t.length>1){j(ye);return}A(!0),T(0),q()},J=ye=>{if(ye.touches.length!==1||H.current)return;const F=ye.touches[0];w.current=!0,h.current={x:F.clientX,y:F.clientY},S.current="none",x.current=0,y.current=!1},te=ye=>{if(!h.current||ye.touches.length!==1||H.current)return;const F=ye.touches[0],ve=F.clientX-h.current.x,pe=F.clientY-h.current.y;if(S.current==="none"){if(Math.abs(ve)<10&&Math.abs(pe)<10)return;if(Math.abs(ve)>Math.abs(pe)){if(t.length<=1)return;S.current="horizontal"}else if(pe>0)S.current="vertical";else return}if(S.current==="horizontal"){y.current=!0,z(!0),x.current=ve,T(ve),ye.preventDefault();return}S.current==="vertical"&&(y.current=!0,z(!0),f.current=pe,R(pe),ye.preventDefault())},$e=()=>{if(!h.current)return;const ye=S.current,F=y.current;if(F&&ye==="horizontal")B(x.current),ie();else if(F&&ye==="vertical")if(f.current>$b){const pe=window.innerHeight;f.current=pe,I(!0),R(pe),V("closing")}else f.current=0,R(0),ie();else ye==="horizontal"&&Math.abs(x.current)>0&&(B(x.current),ie());h.current=null,S.current="none",x.current=0,y.current=!1,z(!1)};return document.addEventListener("touchstart",J,{passive:!0}),document.addEventListener("touchmove",te,{passive:!1}),document.addEventListener("touchend",$e),document.addEventListener("touchcancel",$e),()=>{document.removeEventListener("touchstart",J),document.removeEventListener("touchmove",te),document.removeEventListener("touchend",$e),document.removeEventListener("touchcancel",$e),X()}},[C,t.length,d,l,A,q,he]),s.useEffect(()=>{const U=X=>{X.key==="Escape"&&(X.preventDefault(),X.stopPropagation(),C!=="closing"&&V("closing"))};return window.addEventListener("keydown",U,!0),()=>window.removeEventListener("keydown",U,!0)},[C]);const Q=()=>{C!=="closing"&&V("closing")},be=C==="open",He=C==="closing",xe=$>0?Math.max(0,1-$/500):1,le=$>0?Math.max(.35,1-$/500):1,ee=U=>{if(U.stopPropagation(),w.current){w.current=!1;return}if(t.length<=1)return;const X=U.currentTarget.getBoundingClientRect(),ie=U.clientY-X.top,j=Math.min(52,X.height*.2);if(!(ie>X.height-j)){if(U.clientX-X.left<X.width/2){l();return}d()}},ue=U=>{if(t.length<=1)return;const X=U.currentTarget.getBoundingClientRect(),ie=U.clientX-X.left,j=U.clientY-X.top,B=Math.min(52,X.height*.2);if(j>X.height-B){U.currentTarget.style.cursor="default";return}U.currentTarget.style.cursor=ie<X.width/2?"w-resize":"e-resize"},oe=s.useCallback(U=>{U.propertyName!=="transform"||!H.current||(he(),A(!1))},[he,A]),Fe=de?`translateX(${k}px)`:$>0?`translateY(${$}px)`:void 0,Ce={position:"fixed",top:Y==null?void 0:Y.top,left:Y==null?void 0:Y.left,width:Y==null?void 0:Y.width,height:Y==null?void 0:Y.height,objectFit:i==="cover"?"cover":"contain",transform:Fe,opacity:$>0?le:C==="opening"||He?0:1,transition:E&&!m?"none":m?`transform ${_n}ms ${vi}`:ne?`transform ${_n}ms ${vi}, opacity ${_n}ms ${vi}`:C==="opening"||He?`opacity ${_n}ms ${vi}`:"none",pointerEvents:ae&&be&&!de?"auto":"none",touchAction:ae&&be?"none":void 0,zIndex:9998},P=Y?{position:"fixed",top:Y.top,height:Y.height,width:Y.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:C==="open"?"none":void 0},onClick:Q,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:be?xe:0,transition:E?"none":`opacity ${_n}ms ${vi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:b?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:v,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:be?1:0,transition:`opacity ${_n}ms ${vi}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:c,style:u,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:v,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:be?1:0,transition:`opacity ${_n}ms ${vi}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),Y&&K&&(ae?a.jsx(Nb,{src:K.url,phase:C,mediaRef:g,mediaStyle:Ce,onLoadedMetadata:ce,onClick:ee,onMouseMove:ue,onTransitionEnd:oe},`${n}-${K.url}`):a.jsx("img",{ref:g,src:K.url,alt:K.name,onLoad:ce,onTransitionEnd:oe,style:Ce},`${n}-${K.url}`)),be&&P&&t.length>1&&!ae&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...P,left:Y.left,cursor:"w-resize",pointerEvents:de?"none":"auto"},onClick:U=>{if(w.current){w.current=!1;return}U.stopPropagation(),l()}}),a.jsx("div",{style:{...P,left:Y.left+Y.width/2,cursor:"e-resize",pointerEvents:de?"none":"auto"},onClick:U=>{if(w.current){w.current=!1;return}U.stopPropagation(),d()}})]})]})}function Tc({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:r,isEditor:l,galleryPaddingBetween:d=0,showPaddingAfter:c=!1,showControls:u=!1,onMediaClick:p}){const b=`${e}-gallery-${ps(t)?"video":"image"}`,v=r.display==="cover",g=_b(r),h=C=>D.scalingValue(C,l??!1),f=n??Di,x=o?{width:"100%",maxWidth:"100%"}:{width:h(f),maxWidth:"100%"},S=i?{borderRadius:h(i)}:{},y={...x,...v?{aspectRatio:g,height:"auto",overflow:"hidden"}:{},...S},w={...v?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":h(f)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...v?{}:S},N={className:b,style:w,onClick:p?C=>{C.stopPropagation(),p()}:void 0},Y=Math.max(d,xi),O=ps(t)?a.jsx("video",{...N,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...N,src:t.url,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[v?a.jsx("div",{style:y,children:O}):O,c&&d>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:h(d)},"aria-hidden":"true"}),u&&c&&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(Y)}})]})}function Ob({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const b=t==="a"?i:t==="c"?o:0,v=b>0||c;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&v&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(b)},"aria-hidden":"true"}),c&&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(d),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"&&v&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(b)},"aria-hidden":"true"}),c&&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(d),className:`${e}-control-anchor`,style:{top:0,right:0,width:u(r),height:"100%"}})]})}function Db(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function Lc({P:e,scaled:t,height:n,paired:i}){return a.jsx("div",{"data-controls":"titleTopPadding",...i?{"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:t(n)}})}function Rc({P:e,controlKey:t,scaled:n,width:i,maxFraction:o,side:r,paired:l,anchorStyle:d}){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%",...d}})}function Ba({P:e,title:t,position:n,titleRef:i,titleClassName:o,titleContainerStyle:r,titleTextBoxStyle:l,titleStyle:d,showTextBoxOutline:c=!1,topPaddingControl:u}){const p=s.useRef(null),[b,v]=s.useState(0),g=t??"",h=n==="left"||n==="center"||n==="right";return s.useLayoutEffect(()=>{if(!h)return;const f=p.current;if(!f||typeof ResizeObserver>"u")return;const x=()=>v(f.offsetHeight);x();const S=new ResizeObserver(x);return S.observe(f),()=>S.disconnect()},[g,h]),a.jsx("div",{ref:f=>{p.current=f,i(f)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...h?{[`--${e}-title-height`]:`${b}px`}:{},...r},children:a.jsxs("div",{className:`${e}-title-text-stack`,style:l,children:[u,a.jsx("div",{className:c?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:a.jsx("span",{className:`${e}-title-text`,style:d,children:g})})]})})}const Ic=45;function Ec(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 jb(e){const t=Ec(e,"--cntrl-viewport-height",window.innerHeight),n=Ec(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function zb(e,t,n){const{top:i,centerY:o}=jb(n);if(t==="top"){const l=n&&parseFloat(getComputedStyle(n).top)||i;return Math.abs(e.top-l)}const r=e.top+e.height/2;return Math.abs(r-o)}function Bb(e,t,n){const i=Array.from({length:t},(l,d)=>{const c=e.current[d];if(!c)return 0;const u=c.getBoundingClientRect(),p=zb(u,n,c);return Math.exp(-(p*p)/(2*Ic*Ic))});let o=0,r=-1;return i.forEach((l,d)=>{l>r&&(r=l,o=d)}),{opacities:i,dominantIndex:o}}function Vb(e,t,n){const i=s.useRef([]),[{opacities:o,dominantIndex:r},l]=s.useState(()=>({opacities:Array.from({length:e},(c,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 c=0;const u=()=>{l(Bb(i,e,n))},p=()=>{c||(c=window.requestAnimationFrame(()=>{c=0,u()}))};return u(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p,{passive:!0}),()=>{c&&window.cancelAnimationFrame(c),window.removeEventListener("scroll",p),window.removeEventListener("resize",p)}},[t,e,n]),{setTitleRef:c=>u=>{i.current[c]=u},opacities:o,dominantIndex:r}}function Gb(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),d=Math.max(r.length,l.length);if(d===0||o.current===e)return;let c=0;const u=window.setInterval(()=>{c+=1;const p=[...l.slice(0,c),...r.slice(c)].join("");o.current=p,i(p),c>=d&&window.clearInterval(u)},35);return()=>window.clearInterval(u)},[t,e]),n}function qb({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var Qe;const{prefix:l}=D.useScopedStyles(),d=s.useMemo(()=>wb(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",b=(e==null?void 0:e.imgWidth)??Di,v=(e==null?void 0:e.titleWidth)??Ab,g=Fb(e==null?void 0:e.imageDisplay),h=(e==null?void 0:e.cornerRadius)??xb,f=(e==null?void 0:e.position)??"center",x=(e==null?void 0:e.titleTopPadding)??0,S=(e==null?void 0:e.titleLeftPadding)??0,y=(e==null?void 0:e.titleRightPadding)??0,w=Db(e==null?void 0:e.transition),H=(e==null?void 0:e.lightbox)??"on",N=p==="b",Y=w==="fade"||w==="retype",{setTitleRef:O,dominantIndex:C}=Vb(c.length,Y,f),V=((Qe=c[C])==null?void 0:Qe.title)??"",$=Gb(V,w==="retype"),R=w==="fade"||w==="retype",k=w==="retype"?$:V,T=N?void 0:{width:D.scalingValue(b,n??!1)},m=H==="on"&&(!n||i||o),M=o??!1,E=(e==null?void 0:e.galleryPaddingRight)??0,z=(e==null?void 0:e.galleryPaddingLeft)??0,ne=(e==null?void 0:e.galleryPaddingBetween)??0,I=tt=>D.scalingValue(tt,n??!1),K={width:I(v)},ae=p==="a"?E:z,de=N?{width:"100%"}:{width:`calc(100% - ${I(b)} - ${I(ae)})`,...p==="c"?{marginLeft:"auto"}:{}},A=Math.max(E,xi),he=Math.max(z,xi),q=Math.max(ne,xi),ce=Math.max(x,xi),Q=Math.max(S,xi),be=Math.max(y,xi),He=Math.max(0,(u??1)-(b??Di)),xe=p==="a"?Math.max(0,(u??1)-(b??Di)-E):p==="c"?Math.max(0,(u??1)-(b??Di)-z):p==="b"?u??1:1,le=M&&(p==="a"||p==="b"||p==="c")&&f==="top",ee=M&&((p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")),ue=M&&((p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"),oe=c.length>1,Fe=N?void 0:I((p==="c"?z:E)+(b??Di)),Ce=p==="c"&&Fe?{left:Fe}:void 0,P=p==="a"&&Fe?{right:Fe}:void 0,U=N?{left:0,width:"100%"}:p==="a"?{right:I(E),width:I(b)}:{left:I(z),width:I(b)},{titleColor:X,titleFontFamily:ie,titleFontSettings:j,titleFontSize:B,titleLineHeight:J,titleLetterSpacing:te,titleWordSpacing:$e,titleAlign:ye,titleTextAppearance:F,lightboxCounterColor:ve,lightboxCounterFontFamily:pe,lightboxCounterFontSettings:Z,lightboxCounterFontSize:me,lightboxCounterLineHeight:De,lightboxCounterLetterSpacing:ge,lightboxCounterWordSpacing:G,lightboxCounterTextAppearance:Me}=e??{},_e={fontSettings:{fontFamily:ie,fontWeight:(j==null?void 0:j.fontWeight)??400,fontStyle:(j==null?void 0:j.fontStyle)??"normal"},fontSize:B??.01,lineHeight:J,letterSpacing:te??0,wordSpacing:$e??0,textAlign:ye??"left",textAppearance:F,color:X??"#000000"},Je=sn(Yt(_e,n)),at=K,it=Cc(B,J,l,n),je=$c(B,J,`${l}-title`,`${l}-text-tight-leading`),Se={fontSettings:{fontFamily:pe,fontWeight:(Z==null?void 0:Z.fontWeight)??400,fontStyle:(Z==null?void 0:Z.fontStyle)??"normal"},fontSize:me??.01,lineHeight:De,letterSpacing:ge??0,wordSpacing:G??0,textAppearance:Me,color:ve??"#DEDDDD"},Be={...sn(Yt(Se,n)),...Cc(me,De,l,n)},Ze=$c(me,De,`${l}-lightbox-counter`,`${l}-text-tight-leading`),Le=D.buildColorVars(l,{titleColor:X??"#000000",lightboxCounterColor:ve??"#DEDDDD"},Tb,Lb),Ve=s.useRef(null),[se,Te]=s.useState(!1),[Xe,ze]=s.useState([]),[Re,Pe]=s.useState(0),Ae=s.useCallback((tt,nt)=>{m&&(ze(tt),Pe(nt),Te(!0))},[m]),Ke=s.useCallback(()=>{Te(!1)},[]),Oe=s.useMemo(()=>{const tt={...Le},nt=Ve.current?getComputedStyle(Ve.current).getPropertyValue("--cntrl-article-width").trim():"";return nt&&(tt["--cntrl-article-width"]=nt),tt},[Le,se]);return s.useEffect(()=>{if(!se||H!=="on"||typeof document>"u")return;const tt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=tt}},[se,H]),s.useEffect(()=>{!n||o||i||Te(!1)},[n,o,i]),s.useEffect(()=>{H==="off"&&Te(!1)},[H]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx("div",{style:Le,children:a.jsxs("div",{ref:Ve,className:`${l}-wrapper`,style:{width:D.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&f==="top"?I(x):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")?I(S):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"?I(y):void 0},children:[R&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(Ba,{P:l,title:k,position:f,titleRef:()=>{},titleClassName:`${je} ${l}-single-title`,titleContainerStyle:{...it,...de},titleTextBoxStyle:at,titleStyle:Je,showTextBoxOutline:M,topPaddingControl:le?Lc({P:l,scaled:I,height:ce,paired:!1}):void 0})}),c.map((tt,nt)=>{const xt=Mb(tt.gallery),It=nt<c.length-1,Tt=xt.filter(ft=>ft.lightboxMedia).map(ft=>ft.lightboxMedia),ut={P:l,position:f,titleRef:O(nt),titleClassName:je,titleContainerStyle:it,titleTextBoxStyle:R?{maxWidth:"100%"}:at,titleStyle:Je,showTextBoxOutline:M&&!R,topPaddingControl:le&&!R?Lc({P:l,scaled:I,height:ce,paired:oe}):void 0};return a.jsxs("div",{"data-item-index":nt,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:It?I(ne):void 0},children:[ee&&Rc({P:l,controlKey:"titleLeftPadding",scaled:I,width:Q,maxFraction:xe,side:"left",paired:oe,anchorStyle:Ce}),ue&&Rc({P:l,controlKey:"titleRightPadding",scaled:I,width:be,maxFraction:xe,side:"right",paired:oe,anchorStyle:P}),M&&It&&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(q),...U}}),N?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:xt.map(({displayMedia:ft,lightboxMedia:Et},Lt)=>{const bt=Et?Tt.findIndex(Nt=>Nt.url===Et.url):-1;return a.jsx(Tc,{P:l,media:ft,imgWidth:b||void 0,cornerRadius:h||void 0,imageDisplay:g,isEditor:n,galleryPaddingBetween:ne,showPaddingAfter:Lt<xt.length-1,showControls:M,onMediaClick:m&&bt>=0?()=>Ae(Tt,bt):void 0},`${ft.url}-${Lt}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(Ba,{...ut,title:R?"":tt.title})})]}):a.jsxs(a.Fragment,{children:[a.jsx(Ba,{...ut,title:R?"":tt.title}),xt.length>0&&a.jsx(Ob,{P:l,layoutType:p,galleryWidthStyle:T,galleryPaddingRight:E,galleryPaddingLeft:z,galleryPaddingRightWidth:A,galleryPaddingLeftWidth:he,galleryPaddingMaxFraction:He,showControls:M,scaled:I,children:xt.map(({displayMedia:ft,lightboxMedia:Et},Lt)=>{const bt=Et?Tt.findIndex(Nt=>Nt.url===Et.url):-1;return a.jsx(Tc,{P:l,media:ft,cornerRadius:h||void 0,fillGalleryWidth:!0,imageDisplay:g,isEditor:n,galleryPaddingBetween:ne,showPaddingAfter:Lt<xt.length-1,showControls:M,onMediaClick:m&&bt>=0?()=>Ae(Tt,bt):void 0},`${ft.url}-${Lt}`)})})]})]},nt)})]})}),se&&H==="on"&&typeof document<"u"&&e&&(()=>{const tt=(r?document.getElementById(r):null)??document.body;return Vn.createPortal(a.jsx("div",{style:Oe,"data-selection":"none",children:a.jsx(Hb,{prefix:l,items:Xe,index:Re,imageDisplay:Wb(e.lightboxImageDisplay),isEditor:n,onClose:Ke,onPrev:()=>Pe(nt=>(nt-1+Xe.length)%Xe.length),onNext:()=>Pe(nt=>(nt+1)%Xe.length),counterClassName:Ze,counterStyle:Be,backgroundColor:e.backgroundColor??Sb})}),tt)})()]})}const Xb=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
21072
+ `}const Sb="rgba(28,31,34,0.9)",_n=500,vi="cubic-bezier(0.22, 1, 0.36, 1)",$b=72,Cb=50,Tb={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},Lb=[];function Rb(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 Ib(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Eb(e){const[t]=e.media;return t!=null&&t.url?t:null}function Mb(e){if(!Array.isArray(e)||e.length===0)return[];if(Rb(e)){const t=[];for(const n of e){const i=Ib(n);if(!i)continue;const o=Eb(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.url?o:null})}return t}return e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function ps(e){return e.type==="video"}function Pb(e){e.pause(),e.removeAttribute("src"),e.load()}function wr(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function kb(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const Ab=1140/1440;function Fb(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 _b(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 Wb(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Nb({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:d}){return s.useEffect(()=>{const c=n.current;if(c)return()=>{Pb(c)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:d,style:i})}function Hb({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const b=i==="cover",v=s.useRef(null),g=s.useRef(null),h=s.useRef(null),f=s.useRef(0),x=s.useRef(0),S=s.useRef("none"),y=s.useRef(!1),w=s.useRef(!1),H=s.useRef(!1),N=s.useRef(null),[U,O]=s.useState(null),[C,V]=s.useState("opening"),[$,R]=s.useState(0),[k,T]=s.useState(0),[m,M]=s.useState(!1),[E,z]=s.useState(!1),[ne,I]=s.useState(!1),W=s.useRef(n),K=t[n],ae=K?ps(K):!1,de=k!==0||m,A=s.useCallback(Y=>{H.current=Y,M(Y)},[]),he=s.useCallback(()=>{N.current!==null&&(window.clearTimeout(N.current),N.current=null)},[]),q=s.useCallback(()=>{he(),N.current=window.setTimeout(()=>{he(),A(!1)},_n+32)},[he,A]),ce=s.useCallback(()=>{const Y=v.current,X=g.current;if(!Y)return;const ie=Y.getBoundingClientRect(),j=ie.width,B=ie.height;if(!j||!B)return;if(i==="cover"){O({width:j,height:B,left:ie.left,top:ie.top});return}if(!X){O(wr(Y));return}const{width:J,height:te}=kb(X);if(!J||!te){O(wr(Y));return}const $e=J/te,ye=j/B;if($e>ye){const F=j/$e;O({width:j,height:F,left:ie.left,top:ie.top+(B-F)/2})}else{const F=B*$e;O({width:F,height:B,left:ie.left+(j-F)/2,top:ie.top})}},[i]);s.useEffect(()=>{ce();const Y=v.current;if(!Y)return;const X=new ResizeObserver(()=>ce());return X.observe(Y),()=>X.disconnect()},[ce,n]),s.useEffect(()=>{C==="opening"&&U&&V("open")},[C,U]),s.useEffect(()=>{if(C!=="closing")return;const Y=setTimeout(()=>r(),_n);return()=>clearTimeout(Y)},[C,r]),s.useEffect(()=>()=>{he()},[he]),s.useLayoutEffect(()=>{if(W.current===n)return;he(),R(0),T(0),A(!1),I(!1),z(!1),f.current=0,x.current=0,S.current="none",y.current=!1,h.current=null,w.current=!1;const Y=v.current;Y&&O(wr(Y)),W.current=n},[n,A,he]),s.useEffect(()=>{if(C!=="open")return;let Y=null;const X=()=>{Y&&(document.removeEventListener("click",Y,!0),Y=null)},ie=()=>{X(),Y=ye=>{ye.stopPropagation(),ye.preventDefault(),X()},document.addEventListener("click",Y,!0)},j=ye=>{he(),H.current=!1,M(!1),T(0),z(!1),y.current=!1,x.current=0,S.current="none";const F=v.current;F&&O(wr(F)),ye<0?d():l()},B=ye=>{if(Math.abs(ye)>Cb&&t.length>1){j(ye);return}A(!0),T(0),q()},J=ye=>{if(ye.touches.length!==1||H.current)return;const F=ye.touches[0];w.current=!0,h.current={x:F.clientX,y:F.clientY},S.current="none",x.current=0,y.current=!1},te=ye=>{if(!h.current||ye.touches.length!==1||H.current)return;const F=ye.touches[0],ve=F.clientX-h.current.x,pe=F.clientY-h.current.y;if(S.current==="none"){if(Math.abs(ve)<10&&Math.abs(pe)<10)return;if(Math.abs(ve)>Math.abs(pe)){if(t.length<=1)return;S.current="horizontal"}else if(pe>0)S.current="vertical";else return}if(S.current==="horizontal"){y.current=!0,z(!0),x.current=ve,T(ve),ye.preventDefault();return}S.current==="vertical"&&(y.current=!0,z(!0),f.current=pe,R(pe),ye.preventDefault())},$e=()=>{if(!h.current)return;const ye=S.current,F=y.current;if(F&&ye==="horizontal")B(x.current),ie();else if(F&&ye==="vertical")if(f.current>$b){const pe=window.innerHeight;f.current=pe,I(!0),R(pe),V("closing")}else f.current=0,R(0),ie();else ye==="horizontal"&&Math.abs(x.current)>0&&(B(x.current),ie());h.current=null,S.current="none",x.current=0,y.current=!1,z(!1)};return document.addEventListener("touchstart",J,{passive:!0}),document.addEventListener("touchmove",te,{passive:!1}),document.addEventListener("touchend",$e),document.addEventListener("touchcancel",$e),()=>{document.removeEventListener("touchstart",J),document.removeEventListener("touchmove",te),document.removeEventListener("touchend",$e),document.removeEventListener("touchcancel",$e),X()}},[C,t.length,d,l,A,q,he]),s.useEffect(()=>{const Y=X=>{X.key==="Escape"&&(X.preventDefault(),X.stopPropagation(),C!=="closing"&&V("closing"))};return window.addEventListener("keydown",Y,!0),()=>window.removeEventListener("keydown",Y,!0)},[C]);const Q=()=>{C!=="closing"&&V("closing")},be=C==="open",He=C==="closing",xe=$>0?Math.max(0,1-$/500):1,le=$>0?Math.max(.35,1-$/500):1,ee=Y=>{if(Y.stopPropagation(),w.current){w.current=!1;return}if(t.length<=1)return;const X=Y.currentTarget.getBoundingClientRect(),ie=Y.clientY-X.top,j=Math.min(52,X.height*.2);if(!(ie>X.height-j)){if(Y.clientX-X.left<X.width/2){l();return}d()}},ue=Y=>{if(t.length<=1)return;const X=Y.currentTarget.getBoundingClientRect(),ie=Y.clientX-X.left,j=Y.clientY-X.top,B=Math.min(52,X.height*.2);if(j>X.height-B){Y.currentTarget.style.cursor="default";return}Y.currentTarget.style.cursor=ie<X.width/2?"w-resize":"e-resize"},oe=s.useCallback(Y=>{Y.propertyName!=="transform"||!H.current||(he(),A(!1))},[he,A]),Fe=de?`translateX(${k}px)`:$>0?`translateY(${$}px)`:void 0,Ce={position:"fixed",top:U==null?void 0:U.top,left:U==null?void 0:U.left,width:U==null?void 0:U.width,height:U==null?void 0:U.height,objectFit:i==="cover"?"cover":"contain",transform:Fe,opacity:$>0?le:C==="opening"||He?0:1,transition:E&&!m?"none":m?`transform ${_n}ms ${vi}`:ne?`transform ${_n}ms ${vi}, opacity ${_n}ms ${vi}`:C==="opening"||He?`opacity ${_n}ms ${vi}`:"none",pointerEvents:ae&&be&&!de?"auto":"none",touchAction:ae&&be?"none":void 0,zIndex:9998},P=U?{position:"fixed",top:U.top,height:U.height,width:U.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:C==="open"?"none":void 0},onClick:Q,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:be?xe:0,transition:E?"none":`opacity ${_n}ms ${vi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:b?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:v,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:be?1:0,transition:`opacity ${_n}ms ${vi}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:c,style:u,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:v,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:be?1:0,transition:`opacity ${_n}ms ${vi}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),U&&K&&(ae?a.jsx(Nb,{src:K.url,phase:C,mediaRef:g,mediaStyle:Ce,onLoadedMetadata:ce,onClick:ee,onMouseMove:ue,onTransitionEnd:oe},`${n}-${K.url}`):a.jsx("img",{ref:g,src:K.url,alt:K.name,onLoad:ce,onTransitionEnd:oe,style:Ce},`${n}-${K.url}`)),be&&P&&t.length>1&&!ae&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...P,left:U.left,cursor:"w-resize",pointerEvents:de?"none":"auto"},onClick:Y=>{if(w.current){w.current=!1;return}Y.stopPropagation(),l()}}),a.jsx("div",{style:{...P,left:U.left+U.width/2,cursor:"e-resize",pointerEvents:de?"none":"auto"},onClick:Y=>{if(w.current){w.current=!1;return}Y.stopPropagation(),d()}})]})]})}function Tc({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:r,isEditor:l,galleryPaddingBetween:d=0,showPaddingAfter:c=!1,showControls:u=!1,onMediaClick:p}){const b=`${e}-gallery-${ps(t)?"video":"image"}`,v=r.display==="cover",g=_b(r),h=C=>D.scalingValue(C,l??!1),f=n??Di,x=o?{width:"100%",maxWidth:"100%"}:{width:h(f),maxWidth:"100%"},S=i?{borderRadius:h(i)}:{},y={...x,...v?{aspectRatio:g,height:"auto",overflow:"hidden"}:{},...S},w={...v?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":h(f)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...v?{}:S},N={className:b,style:w,onClick:p?C=>{C.stopPropagation(),p()}:void 0},U=Math.max(d,xi),O=ps(t)?a.jsx("video",{...N,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...N,src:t.url,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[v?a.jsx("div",{style:y,children:O}):O,c&&d>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:h(d)},"aria-hidden":"true"}),u&&c&&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(U)}})]})}function Ob({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const b=t==="a"?i:t==="c"?o:0,v=b>0||c;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&v&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(b)},"aria-hidden":"true"}),c&&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(d),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"&&v&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(b)},"aria-hidden":"true"}),c&&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(d),className:`${e}-control-anchor`,style:{top:0,right:0,width:u(r),height:"100%"}})]})}function Db(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function Lc({P:e,scaled:t,height:n,paired:i}){return a.jsx("div",{"data-controls":"titleTopPadding",...i?{"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:t(n)}})}function Rc({P:e,controlKey:t,scaled:n,width:i,maxFraction:o,side:r,paired:l,anchorStyle:d}){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%",...d}})}function Ba({P:e,title:t,position:n,titleRef:i,titleClassName:o,titleContainerStyle:r,titleTextBoxStyle:l,titleStyle:d,showTextBoxOutline:c=!1,topPaddingControl:u}){const p=s.useRef(null),[b,v]=s.useState(0),g=t??"",h=n==="left"||n==="center"||n==="right";return s.useLayoutEffect(()=>{if(!h)return;const f=p.current;if(!f||typeof ResizeObserver>"u")return;const x=()=>v(f.offsetHeight);x();const S=new ResizeObserver(x);return S.observe(f),()=>S.disconnect()},[g,h]),a.jsx("div",{ref:f=>{p.current=f,i(f)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...h?{[`--${e}-title-height`]:`${b}px`}:{},...r},children:a.jsxs("div",{className:`${e}-title-text-stack`,style:l,children:[u,a.jsx("div",{className:c?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:a.jsx("span",{className:`${e}-title-text`,style:d,children:g})})]})})}const Ic=45;function Ec(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 jb(e){const t=Ec(e,"--cntrl-viewport-height",window.innerHeight),n=Ec(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function zb(e,t,n){const{top:i,centerY:o}=jb(n);if(t==="top"){const l=n&&parseFloat(getComputedStyle(n).top)||i;return Math.abs(e.top-l)}const r=e.top+e.height/2;return Math.abs(r-o)}function Bb(e,t,n){const i=Array.from({length:t},(l,d)=>{const c=e.current[d];if(!c)return 0;const u=c.getBoundingClientRect(),p=zb(u,n,c);return Math.exp(-(p*p)/(2*Ic*Ic))});let o=0,r=-1;return i.forEach((l,d)=>{l>r&&(r=l,o=d)}),{opacities:i,dominantIndex:o}}function Vb(e,t,n){const i=s.useRef([]),[{opacities:o,dominantIndex:r},l]=s.useState(()=>({opacities:Array.from({length:e},(c,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 c=0;const u=()=>{l(Bb(i,e,n))},p=()=>{c||(c=window.requestAnimationFrame(()=>{c=0,u()}))};return u(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p,{passive:!0}),()=>{c&&window.cancelAnimationFrame(c),window.removeEventListener("scroll",p),window.removeEventListener("resize",p)}},[t,e,n]),{setTitleRef:c=>u=>{i.current[c]=u},opacities:o,dominantIndex:r}}function Gb(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),d=Math.max(r.length,l.length);if(d===0||o.current===e)return;let c=0;const u=window.setInterval(()=>{c+=1;const p=[...l.slice(0,c),...r.slice(c)].join("");o.current=p,i(p),c>=d&&window.clearInterval(u)},35);return()=>window.clearInterval(u)},[t,e]),n}function qb({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var Qe;const{prefix:l}=D.useScopedStyles(),d=s.useMemo(()=>wb(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",b=(e==null?void 0:e.imgWidth)??Di,v=(e==null?void 0:e.titleWidth)??Ab,g=Fb(e==null?void 0:e.imageDisplay),h=(e==null?void 0:e.cornerRadius)??xb,f=(e==null?void 0:e.position)??"center",x=(e==null?void 0:e.titleTopPadding)??0,S=(e==null?void 0:e.titleLeftPadding)??0,y=(e==null?void 0:e.titleRightPadding)??0,w=Db(e==null?void 0:e.transition),H=(e==null?void 0:e.lightbox)??"on",N=p==="b",U=w==="fade"||w==="retype",{setTitleRef:O,dominantIndex:C}=Vb(c.length,U,f),V=((Qe=c[C])==null?void 0:Qe.title)??"",$=Gb(V,w==="retype"),R=w==="fade"||w==="retype",k=w==="retype"?$:V,T=N?void 0:{width:D.scalingValue(b,n??!1)},m=H==="on"&&(!n||i||o),M=o??!1,E=(e==null?void 0:e.galleryPaddingRight)??0,z=(e==null?void 0:e.galleryPaddingLeft)??0,ne=(e==null?void 0:e.galleryPaddingBetween)??0,I=tt=>D.scalingValue(tt,n??!1),K={width:I(v)},ae=p==="a"?E:z,de=N?{width:"100%"}:{width:`calc(100% - ${I(b)} - ${I(ae)})`,...p==="c"?{marginLeft:"auto"}:{}},A=Math.max(E,xi),he=Math.max(z,xi),q=Math.max(ne,xi),ce=Math.max(x,xi),Q=Math.max(S,xi),be=Math.max(y,xi),He=Math.max(0,(u??1)-(b??Di)),xe=p==="a"?Math.max(0,(u??1)-(b??Di)-E):p==="c"?Math.max(0,(u??1)-(b??Di)-z):p==="b"?u??1:1,le=M&&(p==="a"||p==="b"||p==="c")&&f==="top",ee=M&&((p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")),ue=M&&((p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"),oe=c.length>1,Fe=N?void 0:I((p==="c"?z:E)+(b??Di)),Ce=p==="c"&&Fe?{left:Fe}:void 0,P=p==="a"&&Fe?{right:Fe}:void 0,Y=N?{left:0,width:"100%"}:p==="a"?{right:I(E),width:I(b)}:{left:I(z),width:I(b)},{titleColor:X,titleFontFamily:ie,titleFontSettings:j,titleFontSize:B,titleLineHeight:J,titleLetterSpacing:te,titleWordSpacing:$e,titleAlign:ye,titleTextAppearance:F,lightboxCounterColor:ve,lightboxCounterFontFamily:pe,lightboxCounterFontSettings:Z,lightboxCounterFontSize:me,lightboxCounterLineHeight:De,lightboxCounterLetterSpacing:ge,lightboxCounterWordSpacing:G,lightboxCounterTextAppearance:Me}=e??{},_e={fontSettings:{fontFamily:ie,fontWeight:(j==null?void 0:j.fontWeight)??400,fontStyle:(j==null?void 0:j.fontStyle)??"normal"},fontSize:B??.01,lineHeight:J,letterSpacing:te??0,wordSpacing:$e??0,textAlign:ye??"left",textAppearance:F,color:X??"#000000"},Je=sn(Yt(_e,n)),at=K,it=Cc(B,J,l,n),je=$c(B,J,`${l}-title`,`${l}-text-tight-leading`),Se={fontSettings:{fontFamily:pe,fontWeight:(Z==null?void 0:Z.fontWeight)??400,fontStyle:(Z==null?void 0:Z.fontStyle)??"normal"},fontSize:me??.01,lineHeight:De,letterSpacing:ge??0,wordSpacing:G??0,textAppearance:Me,color:ve??"#DEDDDD"},Be={...sn(Yt(Se,n)),...Cc(me,De,l,n)},Ze=$c(me,De,`${l}-lightbox-counter`,`${l}-text-tight-leading`),Le=D.buildColorVars(l,{titleColor:X??"#000000",lightboxCounterColor:ve??"#DEDDDD"},Tb,Lb),Ve=s.useRef(null),[se,Te]=s.useState(!1),[Xe,ze]=s.useState([]),[Re,Pe]=s.useState(0),Ae=s.useCallback((tt,nt)=>{m&&(ze(tt),Pe(nt),Te(!0))},[m]),Ke=s.useCallback(()=>{Te(!1)},[]),Oe=s.useMemo(()=>{const tt={...Le},nt=Ve.current?getComputedStyle(Ve.current).getPropertyValue("--cntrl-article-width").trim():"";return nt&&(tt["--cntrl-article-width"]=nt),tt},[Le,se]);return s.useEffect(()=>{if(!se||H!=="on"||typeof document>"u")return;const tt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=tt}},[se,H]),s.useEffect(()=>{!n||o||i||Te(!1)},[n,o,i]),s.useEffect(()=>{H==="off"&&Te(!1)},[H]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx("div",{style:Le,children:a.jsxs("div",{ref:Ve,className:`${l}-wrapper`,style:{width:D.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&f==="top"?I(x):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")?I(S):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"?I(y):void 0},children:[R&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(Ba,{P:l,title:k,position:f,titleRef:()=>{},titleClassName:`${je} ${l}-single-title`,titleContainerStyle:{...it,...de},titleTextBoxStyle:at,titleStyle:Je,showTextBoxOutline:M,topPaddingControl:le?Lc({P:l,scaled:I,height:ce,paired:!1}):void 0})}),c.map((tt,nt)=>{const xt=Mb(tt.gallery),It=nt<c.length-1,Tt=xt.filter(ft=>ft.lightboxMedia).map(ft=>ft.lightboxMedia),ut={P:l,position:f,titleRef:O(nt),titleClassName:je,titleContainerStyle:it,titleTextBoxStyle:R?{maxWidth:"100%"}:at,titleStyle:Je,showTextBoxOutline:M&&!R,topPaddingControl:le&&!R?Lc({P:l,scaled:I,height:ce,paired:oe}):void 0};return a.jsxs("div",{"data-item-index":nt,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:It?I(ne):void 0},children:[ee&&Rc({P:l,controlKey:"titleLeftPadding",scaled:I,width:Q,maxFraction:xe,side:"left",paired:oe,anchorStyle:Ce}),ue&&Rc({P:l,controlKey:"titleRightPadding",scaled:I,width:be,maxFraction:xe,side:"right",paired:oe,anchorStyle:P}),M&&It&&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(q),...Y}}),N?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:xt.map(({displayMedia:ft,lightboxMedia:Et},Lt)=>{const bt=Et?Tt.findIndex(Nt=>Nt.url===Et.url):-1;return a.jsx(Tc,{P:l,media:ft,imgWidth:b||void 0,cornerRadius:h||void 0,imageDisplay:g,isEditor:n,galleryPaddingBetween:ne,showPaddingAfter:Lt<xt.length-1,showControls:M,onMediaClick:m&&bt>=0?()=>Ae(Tt,bt):void 0},`${ft.url}-${Lt}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(Ba,{...ut,title:R?"":tt.title})})]}):a.jsxs(a.Fragment,{children:[a.jsx(Ba,{...ut,title:R?"":tt.title}),xt.length>0&&a.jsx(Ob,{P:l,layoutType:p,galleryWidthStyle:T,galleryPaddingRight:E,galleryPaddingLeft:z,galleryPaddingRightWidth:A,galleryPaddingLeftWidth:he,galleryPaddingMaxFraction:He,showControls:M,scaled:I,children:xt.map(({displayMedia:ft,lightboxMedia:Et},Lt)=>{const bt=Et?Tt.findIndex(Nt=>Nt.url===Et.url):-1;return a.jsx(Tc,{P:l,media:ft,cornerRadius:h||void 0,fillGalleryWidth:!0,imageDisplay:g,isEditor:n,galleryPaddingBetween:ne,showPaddingAfter:Lt<xt.length-1,showControls:M,onMediaClick:m&&bt>=0?()=>Ae(Tt,bt):void 0},`${ft.url}-${Lt}`)})})]})]},nt)})]})}),se&&H==="on"&&typeof document<"u"&&e&&(()=>{const tt=(r?document.getElementById(r):null)??document.body;return Vn.createPortal(a.jsx("div",{style:Oe,"data-selection":"none",children:a.jsx(Hb,{prefix:l,items:Xe,index:Re,imageDisplay:Wb(e.lightboxImageDisplay),isEditor:n,onClose:Ke,onPrev:()=>Pe(nt=>(nt-1+Xe.length)%Xe.length),onNext:()=>Pe(nt=>(nt+1)%Xe.length),counterClassName:Ze,counterStyle:Be,backgroundColor:e.backgroundColor??Sb})}),tt)})()]})}const Xb=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
21064
21073
  import { createPortal } from 'react-dom';
21065
21074
  import type React from 'react';
21066
21075
  import { CommonComponentProps } from '../props';
@@ -23158,7 +23167,7 @@ ${t}
23158
23167
  `}function Qo(e){return Number(e.toFixed(4))}function Pc(e,t,n,i){const r=(typeof e=="string"?Number(e):e)??t;return Number.isFinite(r)?Math.min(i,Math.max(n,Math.round(r))):t}function Ga(e,t,n=0,i=9999){const r=(typeof e=="string"?Number(e):e)??t;return Number.isFinite(r)?Math.min(i,Math.max(n,r)):t}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 gw(e){const[t,n]=e.ratioValue.split(":").map(Number),i=e.reversed?n:t;return(e.reversed?t:n)/i}function hw(e){return e.type==="video"?!0:e.type==="image"?!1:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.name??"")||/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url??"")}function yu(e,t){return(1-e)/(1-e*Math.cos(t))}function fw(e){let t=0;for(let n=0;n<360;n+=1){const i=n*Math.PI/180;t=Math.max(t,Math.abs(Math.sin(i)*yu(e,i)))}return t||1}function yw(e,t){return e?1:1+fu*(.35+t)}function vw(e,t,n,i){const o=t*yw(n,i);return Math.max(0,(e-o)/2)}function vu(e,t,n){const i=yu(e,n);return{offset:Math.sin(n)*i/t,scale:i}}function xu(e,t,n){return e/2+t*n}function xw(e,t,n){return e(t-n/2)}function bw(e,t){return e*t}function bu(e){return Math.round(e*1e3)}function wu(e,t,n){const i=Math.cos(e),o=Math.cos(uw*Math.PI/2);if(i>=o)return n;const r=(i+1)/(o+1);return Qo(t+(n-t)*r)}function Su(e){return wu(e,sw,lw)}function ww(e){return wu(e,cw,dw)}function $u(e,t){if(!t)return"none";const n=ww(e);return n<=0?"none":`blur(${n}px)`}function Sw(e,t,n,i,o,r,l,d){const{offset:c,scale:u}=vu(i,o,r*Math.PI*2),p=r*Math.PI*2,b=xu(t,n,c),v=Qo(u),g=`calc(${e(b)} - var(--helix-base-w) * ${v} / 2)`,h=`calc(var(--helix-base-w) * ${v})`,f=l?`height: calc(var(--helix-base-h) * ${v});`:"";return`left: ${g}; width: ${h}; ${f} z-index: ${bu(u)}; transform: translateY(-50%); opacity: ${Su(p)}; filter: ${$u(p,d)};`}function $w(e,t,n,i,o,r,l,d){const c=[];for(let u=0;u<=Mc;u+=1){const p=u/Mc;c.push(` ${Qo(p*100)}% { ${Sw(t,n,i,o,r,p,l,d)} }`)}return`@keyframes ${e}-orbit {
23159
23168
  ${c.join(`
23160
23169
  `)}
23161
- }`}function Cu(e,t){return(e%t+t)%t}function Cw(e,t){return il(e,t)/t}function il(e,t){return Cu(e,t)}function Tw(e,t){return Math.floor(e/t)}function Lw(e,t,n,i){return Tw(e,t)*n+il(e,t)*i}function Rw(e,t,n){const i=n==="left"?1-e:e;return`${Qo(-i*t)}s`}function kc(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function Tu(e){const t=e%1;return t<0?t+1:t}function Iw(e,t,n){const i=t/hu,o=n==="left"?-e*i:e*i;return Tu(o)}function Ew({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=D.useScopedStyles(),r=s.useRef(null),l=Ga((e==null?void 0:e.width)??(e==null?void 0:e.spread)??(e==null?void 0:e.wrapperWidth),Qb),d=Ga(e==null?void 0:e.imageWidth,ew),c=Ga(e==null?void 0:e.turnHeight,tw),u=Pc(e==null?void 0:e.itemsPerTurn,nw,3,40),p=Pc(e==null?void 0:e.turns,iw,1,30),b=Math.min(aw,Math.max(0,ow)),v=Math.min(1,Math.max(0,rw)),g=Math.max(0,(e==null?void 0:e.speed)??hu),h=(e==null?void 0:e.direction)==="left"?"left":"right",f=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",x=(e==null?void 0:e.cornerRadius)??0,S=(e==null?void 0:e.blur)!=="off",y=s.useMemo(()=>mw(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),w=y.display==="cover",H=de=>D.scalingValue(de,n??!1),N=s.useMemo(()=>fw(b),[b]),Y=s.useMemo(()=>vw(l,d,w,v),[l,d,w,v]),O=s.useMemo(()=>pw(o,$w(o,H,l,Y,b,N,w,S)),[o,l,Y,b,N,w,S,n]),C=s.useMemo(()=>(t??[]).filter(de=>{var A;return!!((A=de.image)!=null&&A.url)}),[t]),V=c/u,$=d*gw(y),R=Math.min(Zb,p*u),k=Jb*u,T=R+k*2,M=Math.max(0,p-1)*c+(u-1)*V,E=g>0,z=f==="scroll"&&E,ne=f==="autoplay"&&E&&(n?!!i:!0),[I,W]=s.useState(0);s.useEffect(()=>{if(!z)return;const de=r.current;if(!de)return;const A=()=>{const q=de.getBoundingClientRect(),ce=window.innerHeight||document.documentElement.clientHeight,Q=ce+q.height;Q<=0||W(Math.min(1,Math.max(0,(ce-q.top)/Q)))};A(),window.addEventListener("scroll",A,{passive:!0}),window.addEventListener("resize",A);const he=new ResizeObserver(A);return he.observe(de),()=>{window.removeEventListener("scroll",A),window.removeEventListener("resize",A),he.disconnect()}},[z]);const K=z?Iw(I,g,h):0,ae=E&&f==="autoplay"?360/(g*Kb):0;return C.length===0?a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:O}}),a.jsx("div",{className:`${o}-wrapper`,style:{width:H(l),marginInline:"auto"}})]}):a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:O}}),a.jsx("div",{ref:r,className:`${o}-wrapper`,style:{width:H(l),height:H(M),marginInline:"auto"},children:Array.from({length:T},(de,A)=>{const he=A-k,ce=C[Cu(he,C.length)].image,Q=il(he,u),be=Cw(he,u),He=z?Tu(be+K):be,xe=Lw(he,u,c,V),le=v===0?0:(kc(Q+7.3)-.5)*v*V,ee=w?1:1+(kc(Q+3.1)-.5)*2*fu*(.35+v),ue=He*Math.PI*2,{offset:oe,scale:Fe}=vu(b,N,ue),Ce=d*ee,P=bw(Ce,Fe),U=xu(l,Y,oe),X={"--helix-base-w":H(Ce),...w?{"--helix-base-h":H($)}:{}},ie={top:H(xe+le),transform:"translateY(-50%)",...X,...ne?{animationDuration:`${Qo(ae)}s`,animationDelay:Rw(be,ae,h),animationDirection:h==="left"?"reverse":"normal"}:{left:xw(H,U,P),width:H(P),...w?{height:H($*Fe)}:{},zIndex:bu(Fe),opacity:Su(ue),filter:$u(ue,S)}},j=x>0?{borderRadius:H(x)}:{},B=w?{...j,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}:j,J=hw(ce)?a.jsx("video",{className:`${o}-media`,style:B,src:ce.url,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:`${o}-media`,style:B,src:ce.url,alt:ce.name??"",loading:"lazy",decoding:"async"});return a.jsx("div",{className:ne?`${o}-item`:`${o}-item ${o}-item-static`,style:ie,children:w?a.jsx("div",{className:`${o}-cover`,style:j,children:J}):J},`${p}-${u}-${he}`)})})]})}const Mw=`import { useEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
23170
+ }`}function Cu(e,t){return(e%t+t)%t}function Cw(e,t){return il(e,t)/t}function il(e,t){return Cu(e,t)}function Tw(e,t){return Math.floor(e/t)}function Lw(e,t,n,i){return Tw(e,t)*n+il(e,t)*i}function Rw(e,t,n){const i=n==="left"?1-e:e;return`${Qo(-i*t)}s`}function kc(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function Tu(e){const t=e%1;return t<0?t+1:t}function Iw(e,t,n){const i=t/hu,o=n==="left"?-e*i:e*i;return Tu(o)}function Ew({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=D.useScopedStyles(),r=s.useRef(null),l=Ga((e==null?void 0:e.width)??(e==null?void 0:e.spread)??(e==null?void 0:e.wrapperWidth),Qb),d=Ga(e==null?void 0:e.imageWidth,ew),c=Ga(e==null?void 0:e.turnHeight,tw),u=Pc(e==null?void 0:e.itemsPerTurn,nw,3,40),p=Pc(e==null?void 0:e.turns,iw,1,30),b=Math.min(aw,Math.max(0,ow)),v=Math.min(1,Math.max(0,rw)),g=Math.max(0,(e==null?void 0:e.speed)??hu),h=(e==null?void 0:e.direction)==="left"?"left":"right",f=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",x=(e==null?void 0:e.cornerRadius)??0,S=(e==null?void 0:e.blur)!=="off",y=s.useMemo(()=>mw(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),w=y.display==="cover",H=de=>D.scalingValue(de,n??!1),N=s.useMemo(()=>fw(b),[b]),U=s.useMemo(()=>vw(l,d,w,v),[l,d,w,v]),O=s.useMemo(()=>pw(o,$w(o,H,l,U,b,N,w,S)),[o,l,U,b,N,w,S,n]),C=s.useMemo(()=>(t??[]).filter(de=>{var A;return!!((A=de.image)!=null&&A.url)}),[t]),V=c/u,$=d*gw(y),R=Math.min(Zb,p*u),k=Jb*u,T=R+k*2,M=Math.max(0,p-1)*c+(u-1)*V,E=g>0,z=f==="scroll"&&E,ne=f==="autoplay"&&E&&(n?!!i:!0),[I,W]=s.useState(0);s.useEffect(()=>{if(!z)return;const de=r.current;if(!de)return;const A=()=>{const q=de.getBoundingClientRect(),ce=window.innerHeight||document.documentElement.clientHeight,Q=ce+q.height;Q<=0||W(Math.min(1,Math.max(0,(ce-q.top)/Q)))};A(),window.addEventListener("scroll",A,{passive:!0}),window.addEventListener("resize",A);const he=new ResizeObserver(A);return he.observe(de),()=>{window.removeEventListener("scroll",A),window.removeEventListener("resize",A),he.disconnect()}},[z]);const K=z?Iw(I,g,h):0,ae=E&&f==="autoplay"?360/(g*Kb):0;return C.length===0?a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:O}}),a.jsx("div",{className:`${o}-wrapper`,style:{width:H(l),marginInline:"auto"}})]}):a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:O}}),a.jsx("div",{ref:r,className:`${o}-wrapper`,style:{width:H(l),height:H(M),marginInline:"auto"},children:Array.from({length:T},(de,A)=>{const he=A-k,ce=C[Cu(he,C.length)].image,Q=il(he,u),be=Cw(he,u),He=z?Tu(be+K):be,xe=Lw(he,u,c,V),le=v===0?0:(kc(Q+7.3)-.5)*v*V,ee=w?1:1+(kc(Q+3.1)-.5)*2*fu*(.35+v),ue=He*Math.PI*2,{offset:oe,scale:Fe}=vu(b,N,ue),Ce=d*ee,P=bw(Ce,Fe),Y=xu(l,U,oe),X={"--helix-base-w":H(Ce),...w?{"--helix-base-h":H($)}:{}},ie={top:H(xe+le),transform:"translateY(-50%)",...X,...ne?{animationDuration:`${Qo(ae)}s`,animationDelay:Rw(be,ae,h),animationDirection:h==="left"?"reverse":"normal"}:{left:xw(H,Y,P),width:H(P),...w?{height:H($*Fe)}:{},zIndex:bu(Fe),opacity:Su(ue),filter:$u(ue,S)}},j=x>0?{borderRadius:H(x)}:{},B=w?{...j,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}:j,J=hw(ce)?a.jsx("video",{className:`${o}-media`,style:B,src:ce.url,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:`${o}-media`,style:B,src:ce.url,alt:ce.name??"",loading:"lazy",decoding:"async"});return a.jsx("div",{className:ne?`${o}-item`:`${o}-item ${o}-item-static`,style:ie,children:w?a.jsx("div",{className:`${o}-cover`,style:j,children:J}):J},`${p}-${u}-${he}`)})})]})}const Mw=`import { useEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
23162
23171
  import { CommonComponentProps } from '../props';
23163
23172
  import { scalingValue } from '../utils/scalingValue';
23164
23173
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -23696,7 +23705,7 @@ export function Helix({
23696
23705
  </>
23697
23706
  );
23698
23707
  }
23699
- `,Pw=["https://cdn.cntrl.site/component-assets/Helix-default-1.png","https://cdn.cntrl.site/component-assets/Helix-default-2.png","https://cdn.cntrl.site/component-assets/Helix-default-3.png","https://cdn.cntrl.site/component-assets/Helix-default-4.png","https://cdn.cntrl.site/component-assets/Helix-default-5.png"],kw={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,deleteImageDeletesEntry:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]}}}}},default:Pw.map(e=>({image:{url:e,name:""}}))},settings:{sizing:"auto auto",properties:{width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},imageWidth:{type:"number",scope:"layout",title:"Img width",display:{type:"numeric-input"},min:0,max:9999},turnHeight:{type:"number",scope:"layout",title:"Turn height",display:{type:"numeric-input"},min:0,max:9999},itemsPerTurn:{type:"number",scope:"common",title:"Per turn",display:{type:"common-numeric-input"},min:3,max:40},turns:{type:"number",scope:"common",title:"Turns",display:{type:"common-numeric-input"},min:1,max:30},speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:7},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},playback:{type:"string",scope:"common",title:"Playback",display:{type:"toggle-cycle",enum:["autoplay","scroll"]}},imageDisplay:{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"}}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",display:{type:"numeric-input"},min:0,max:9999},blur:{type:"string",scope:"common",title:"Blur",display:{type:"toggle-cycle",enum:["on","off"]}}},defaults:{itemsPerTurn:14,turns:3,direction:"right",playback:"autoplay",blur:"off",imageDisplay:{display:"cover",ratioValue:"2:3",reversed:!1}},layoutDefaults:{d:{defaultPaddingTop:30/1440,width:800/1440,imageWidth:160/1440,turnHeight:380/1440,speed:2.2,cornerRadius:0},m:{defaultPaddingTop:10/375,width:320/375,imageWidth:75/375,turnHeight:310/375,speed:2.8,cornerRadius:0},t:{defaultPaddingTop:20/768,width:620/768,imageWidth:100/768,turnHeight:280/768,speed:2.8,cornerRadius:0}},layout:["__componentName__","width","imageWidth","turnHeight","itemsPerTurn","turns","playback","speed","direction","imageDisplay","cornerRadius","blur"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",items:["direction","speed"]},{type:"row",items:["width"]},{type:"row",items:["imageWidth","turnHeight"]},{type:"row",items:["cornerRadius","imageDisplay"]},{type:"row",items:["itemsPerTurn","turns"]},{type:"row",items:["playback","blur"]}]}]},Aw={element:Ew,id:"helix",name:"Helix",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Helix.mp4"},version:1,defaultSize:{d:{width:720,height:540}},schema:kw,sourceCode:Mw,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Ac=120,Fc=3,Fw=.12,ol={x:0,y:0,width:100,height:100};function Yi(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}function qr(e){return e<0?0:e>1?1:e}function _c(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 _w(e,t){let n=1/0,i=1/0,o=-1/0,r=-1/0;for(const c of e)for(const u of c){const p=u.x*t.width,b=u.y*t.height;p<n&&(n=p),p>o&&(o=p),b<i&&(i=b),b>r&&(r=b)}const l=o-n,d=r-i;return!isFinite(l)||!isFinite(d)||l<=0||d<=0?null:{x:n,y:i,width:l,height:d}}function Ww(e){return e.map(([t,n])=>({x:t,y:n}))}function qa(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const d of e)for(const c of d)c.x<t&&(t=c.x),c.x>i&&(i=c.x),c.y<n&&(n=c.y),c.y>o&&(o=c.y);const r=i-t,l=o-n;return!isFinite(r)||!isFinite(l)||r<=0||l<=0?e:e.map(d=>d.map(c=>({x:(c.x-t)/r,y:(c.y-n)/l})))}function Nw(e,t){const n=[];for(const o of e)for(let r=0;r<o.length;r+=1){const l=o[r],d=o[(r+1)%o.length];(l.y<=t&&d.y>t||d.y<=t&&l.y>t)&&n.push(l.x+(t-l.y)/(d.y-l.y)*(d.x-l.x))}n.sort((o,r)=>o-r);const i=[];for(let o=0;o+1<n.length;o+=2){const r=qr(n[o]),l=qr(n[o+1]);l>r&&i.push({x0:r,x1:l})}return Hw(i)}function Hw(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 Ow(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 Dw(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 jw(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 zw(e,t,n,i){let o=null;for(let r=0;r<Fc;r+=1){const l=qr(t+(n-t)*r/Math.max(1,Fc-1)),d=Nw(e,l),c=i==="avoid"?Dw(d):d;if(o=o===null?c:Ow(o,c),o.length===0)return[]}return o??[]}function Wc(e,t="stretch",n=ol){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=ri(i),d=Vo(l);if(d.length)return t==="viewbox"?Yi(d,n):qa(d);if(typeof document>"u")return null;const c=i.split(/(?=[Mm])/).map(b=>b.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const b of c){const v=document.createElementNS("http://www.w3.org/2000/svg","path");v.setAttribute("d",b),u.appendChild(v);let g=0;try{g=v.getTotalLength()}catch{g=0}if(!g)continue;const h=[];for(let f=0;f<Ac;f+=1){const x=v.getPointAtLength(f/Ac*g);h.push({x:x.x,y:x.y})}p.push(h)}return p.length?t==="viewbox"?Yi(p,n):qa(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"?Yi([r],n):qa([r])}const rl={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"},ms="0 0 100 100",Xr=100,gs=16,Bw=12,Vw=16,Xa=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,Gw=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g,Nc=Math.PI/4,qw=8,Xw=Math.PI/18,Uw=8,zi=24,Bi=[];function Yw(){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 Ua(e,t){return an(e,n=>({x:(n.x-t.x)/t.width,y:(n.y-t.y)/t.height}))}function Kw(e){const t=ei(e),n=t.maxX-t.minX,i=t.maxY-t.minY;return!isFinite(n)||!isFinite(i)||n<=0||i<=0?e:an(e,o=>({x:(o.x-t.minX)/n,y:(o.y-t.minY)/i}))}function Zw(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 an(e,r=>({x:(i+r.x*n)/t.width,y:(o+r.y*n)/t.height}))}function Hc(e,t,n,i,o,r){let l=[];if(t&&t.length)l=Ua(t,i);else{const d=e.trim();if(d&&/^[Mm]/.test(d)){const c=ri(d);c.length&&(l=n==="viewbox"?Ua(c,i):Kw(c))}if(!l.length){const c=o!=="custom"?rl[o]:void 0;c?l=Ua(ri(c),ol):l=Yw()}}return o==="circle"?Zw(l,r):l}function Oc(e,t){return!(t.width>0)||!(t.height>0)||!e.length?"":co(an(e,n=>({x:n.x*t.width,y:n.y*t.height})))}function hs(e){const t=e==="rectangle"||e==="custom"?void 0:rl[e];return t?Yi(Vo(ri(t)),ol):[Ww([[0,0],[1,0],[1,1],[0,1]])]}function Jw(e){const t=e.match(Gw);return t?t.map(Number).filter(n=>!Number.isNaN(n)):[]}function hn(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function fs(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function rn(e){return{x:e.x,y:e.y}}function Qw(e){return{p:rn(e.p),in:e.in?rn(e.in):null,out:e.out?rn(e.out):null}}function Mn(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(Qw)}))}function an(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 Dc(e,t,n,i=n){return an(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function eS(e,t,n,i,o,r,l){let d=Math.abs(t),c=Math.abs(n);if(!d||!c||e.x===l.x&&e.y===l.y)return[{c1:rn(e),c2:rn(l),p:rn(l)}];const u=i*Math.PI/180,p=Math.cos(u),b=Math.sin(u),v=(e.x-l.x)/2,g=(e.y-l.y)/2,h=p*v+b*g,f=-b*v+p*g,x=h*h/(d*d)+f*f/(c*c);if(x>1){const ne=Math.sqrt(x);d*=ne,c*=ne}const S=o===r?-1:1,y=d*d*f*f+c*c*h*h,w=Math.max(0,d*d*c*c-y),H=y===0?0:S*Math.sqrt(w/y),N=H*d*f/c,Y=-H*c*h/d,O=p*N-b*Y+(e.x+l.x)/2,C=b*N+p*Y+(e.y+l.y)/2,V=Math.atan2((f-Y)/c,(h-N)/d);let R=Math.atan2((-f-Y)/c,(-h-N)/d)-V;!r&&R>0&&(R-=Math.PI*2),r&&R<0&&(R+=Math.PI*2);const k=Math.max(1,Math.ceil(Math.abs(R)/(Math.PI/2))),T=R/k,m=4/3*Math.tan(T/4),M=(ne,I)=>({x:O+p*d*ne-b*c*I,y:C+b*d*ne+p*c*I}),E=[];let z=V;for(let ne=0;ne<k;ne+=1){const I=z+T,W=Math.cos(z),K=Math.sin(z),ae=Math.cos(I),de=Math.sin(I);E.push({c1:M(W-m*K,K+m*W),c2:M(ae+m*de,de-m*ae),p:ne===k-1?rn(l):M(ae,de)}),z=I}return E}function ri(e){const t=(e??"").trim();if(!t)return[];const n=[];let i=[],o=!1,r={x:0,y:0},l={x:0,y:0},d=null,c=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:An(h??null,g),out:null}),r=g},b=g=>{if(!i.length)return;const h=i[i.length-1];h.out=An(g,h.p)};Xa.lastIndex=0;let v=Xa.exec(t);for(;v!==null;){const g=v[1],h=g.toUpperCase(),f=g!==h,x=Jw(v[2]),S=y=>f?{x:r.x+x[y],y:r.y+x[y+1]}:{x:x[y],y:x[y+1]};if(h==="Z")o=!0,u(),r=rn(l),d=null,c=null;else if(h==="M"){for(let y=0;y+1<x.length;y+=2){const w=S(y);y===0&&(u(),l=rn(w)),p(w)}d=null,c=null}else if(h==="L"){for(let y=0;y+1<x.length;y+=2)p(S(y));d=null,c=null}else if(h==="H"){for(const y of x)p({x:f?r.x+y:y,y:r.y});d=null,c=null}else if(h==="V"){for(const y of x)p({x:r.x,y:f?r.y+y:y});d=null,c=null}else if(h==="C"){for(let y=0;y+5<x.length;y+=6){const w=S(y),H=S(y+2),N=S(y+4);b(w),p(N,H),d=H}c=null}else if(h==="S"){for(let y=0;y+3<x.length;y+=4){const w=d?fs(d,r):rn(r),H=S(y),N=S(y+2);b(w),p(N,H),d=H}c=null}else if(h==="Q")for(let y=0;y+3<x.length;y+=4){const w=S(y),H=S(y+2);b(hn(r,w,2/3)),p(H,hn(H,w,2/3)),c=w,d=null}else if(h==="T")for(let y=0;y+1<x.length;y+=2){const w=c?fs(c,r):rn(r),H=S(y);b(hn(r,w,2/3)),p(H,hn(H,w,2/3)),c=w,d=null}else if(h==="A")for(let y=0;y+6<x.length;y+=7){const w=f?{x:r.x+x[y+5],y:r.y+x[y+6]}:{x:x[y+5],y:x[y+6]};for(const H of eS(r,x[y],x[y+1],x[y+2],x[y+3]!==0,x[y+4]!==0,w))b(H.c1),p(H.p,H.c2);d=null,c=null}v=Xa.exec(t)}return u(),n}function In(e){return`${Number(e.toFixed(2))}`}function An(e,t){return!e||Math.abs(e.x-t.x)<1e-6&&Math.abs(e.y-t.y)<1e-6?null:e}function Lu(e){return!!(An(e.in,e.p)||An(e.out,e.p))}function er(e,t){return!An(e.out,e.p)&&!An(t.in,t.p)}function jc(e,t){if(er(e,t))return`L${In(t.p.x)},${In(t.p.y)}`;const n=An(e.out,e.p)??e.p,i=An(t.in,t.p)??t.p;return`C${In(n.x)},${In(n.y)} ${In(i.x)},${In(i.y)} ${In(t.p.x)},${In(t.p.y)}`}function co(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const[i,...o]=n.nodes;t.push(`M${In(i.p.x)},${In(i.p.y)}`);let r=i;for(const l of o)t.push(jc(r,l)),r=l;if(n.closed){const l=jc(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function Ru(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 ys(e,t,n){if(er(e,t))return hn(e.p,t.p,n);const i=e.out??e.p,o=t.in??t.p,r=1-n,l=r*r*r,d=3*r*r*n,c=3*r*n*n,u=n*n*n;return{x:l*e.p.x+d*i.x+c*o.x+u*t.p.x,y:l*e.p.y+d*i.y+c*o.y+u*t.p.y}}function Vo(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of Ru(n)){if(er(o.from,o.to)){i.push(rn(o.from.p));continue}for(let r=0;r<gs;r+=1)i.push(ys(o.from,o.to,r/gs))}n.closed||i.push(rn(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function ei(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of Vo(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 tS(e){const t=ei(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 Iu(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 Eu(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=Bw)return{closed:!0,nodes:t.map(r=>({p:rn(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/Vw)),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:rn(r),...Iu(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function Mu(e,t,n=1){if(!e.length)return!1;const i=ei(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),d=Math.max(n,t.height*.5);return i.minX<t.x-l||i.minY<t.y-d||i.maxX>t.x+t.width+l||i.maxY>t.y+t.height+d}function nS(e,t,n,i,o,r,l){const d=t.width>0?n.width/t.width:1,c=t.height>0?n.height/t.height:1;return!(r>0)||!(l>0)||!(d>0)||!(c>0)?e:an(e,u=>{const p=i+(u.x-t.x)*r,b=o+(u.y-t.y)*l;return{x:t.x+p/d,y:t.y+b/c}})}function iS(e,t){if(!e.length)return e;const n=ei(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),d=t.x+(t.width-i*l)/2,c=t.y+(t.height-o*l)/2;return an(e,u=>({x:d+(u.x-n.minX)*l,y:c+(u.y-n.minY)*l}))}function Pu(e){const t={x:0,y:0,width:Xr,height:Xr},n=e!=="custom"?rl[e]:void 0,i=n?an(ri(n),r=>({x:r.x/100*t.width+t.x,y:r.y/100*t.height+t.y})):an(Eu(hs("rectangle")),r=>({x:r.x*t.width+t.x,y:r.y*t.height+t.y})),o=iS(i,t);return{shape:e,customPath:co(o),pathFit:"viewbox",pathViewBox:ms}}function Sr(e,t){return t>0?Math.round(e/t)*t:e}function oS(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,d=Mn(e),c=d[t].nodes[n];return c.p={x:o.p.x+r,y:o.p.y+l},c.in&&(c.in={x:c.in.x+r,y:c.in.y+l}),c.out&&(c.out={x:c.out.x+r,y:c.out.y+l}),d}function zc(e,t,n,i){var r;if(!t.length)return e;const o=Mn(e);for(const{contour:l,node:d}of t){const c=(r=o[l])==null?void 0:r.nodes[d];c&&(c.p={x:c.p.x+n,y:c.p.y+i},c.in&&(c.in={x:c.in.x+n,y:c.in.y+i}),c.out&&(c.out={x:c.out.x+n,y:c.out.y+i}))}return o}function rS(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((d,c)=>c-d);for(const d of l)i=ku(i,r,d)}),i}function aS(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const d=Mn(e),c=d[t].nodes[n];if(c[i]=rn(o),r){const p=i==="in"?"out":"in";c[p]=fs(o,c.p)}return d}function sS(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=Mn(e);return r[t].nodes[n][i]=null,r}function lS(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 d=Mn(e),c=d[t].nodes,u=n+1;if(er(r,l))return c.splice(u,0,{p:hn(r.p,l.p,i),in:null,out:null}),{contours:d,nodeIndex:u};const p=r.out??r.p,b=l.in??l.p,v=hn(r.p,p,i),g=hn(p,b,i),h=hn(b,l.p,i),f=hn(v,g,i),x=hn(g,h,i),S=hn(f,x,i),y=(n+1)%o.nodes.length;return c[n].out=v,c[y].in=h,c.splice(u,0,{p:S,in:f,out:x}),{contours:d,nodeIndex:u}}function ku(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=Mn(e);return o[t].nodes.splice(n,1),o}function Bc(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=Mn(e),l=r[t].nodes,d=l[n],c=l.length,u=(n-1+c)%c,p=(n+1)%c,b=!!An(l[u].out,l[u].p),v=!!An(l[p].in,l[p].p);if(Lu(d)||b||v)return d.in=null,d.out=null,l[u].out=null,l[p].in=null,r;const g=Iu(l[u].p,d.p,l[p].p);return d.in=g.in,d.out=g.out,r}function cS(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)),d={x:t.x+i*l,y:t.y+o*l};return{t:l,distance:Math.hypot(e.x-d.x,e.y-d.y)}}function dS(e,t){let n=null;return e.forEach((i,o)=>{for(const r of Ru(i)){const l=er(r.from,r.to)?1:gs;for(let d=0;d<l;d+=1){const c=d/l,u=(d+1)/l,p=cS(t,ys(r.from,r.to,c),ys(r.from,r.to,u));(!n||p.distance<n.distance)&&(n={contour:o,segment:r.index,t:c+(u-c)*p.t,distance:p.distance})}}}),n}function uS(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 Vc(e,t,n){const i=t.filter((r,l)=>isFinite(r)&&t.findIndex(d=>Math.abs(d-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 Gc(e,t,n,i,o){const r=i(t)[n];let l=null,d=1/0;for(const c of e){const u=n==="x"?{x:c.value,y:t.y}:{x:t.x,y:c.value},p=Math.abs(i(u)[n]-r);p>o||l&&p>=d||(l=c,d=p)}return l}function pS(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 mS(e){const t=Math.PI*2;return((e+Math.PI)%t+t)%t-Math.PI}function vs(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 gS(e,t){const n=vs(e,t);return n?{kind:"align",a:{x:e.x-n.x*zi,y:e.y-n.y*zi},b:{x:t.x+n.x*zi,y:t.y+n.y*zi}}:{kind:"align",a:e,b:t}}function xs(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 qc(e,t,n,i,o){if(e.axis===null)return gS(n,o(e.from??n));const r=t==="x"?{x:e.axis,y:0}:{x:0,y:e.axis};return xs(o(r)[t],t,i)}function hS(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(qc(t,"x",l,i,o)),n&&e.y===n.value&&r.push(qc(n,"y",l,i,o)),r}function fS(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 vs(i(l),r);const d=e.nodes.length,c=t+(n==="in"?1:-1);if(!e.closed&&(c<0||c>=d))return null;const u=e.nodes[(c+d)%d];if(!u)return null;const p=(n==="in"?u.in:u.out)??u.p;return vs(i(p),r)}function yS(e,t,n,i,o,r,l){const d=r(t),c=r(e),u=c.x-d.x,p=c.y-d.y,b=Math.hypot(u,p);if(b<1e-6)return{point:e,guides:Bi};const v=Math.atan2(p,u),g=Math.round(v/Nc)*Nc;let h=o?g:null,f=!1;if(!o){const Y=[];n&&Y.push({angle:Math.atan2(n.y,n.x),smooth:!0}),Y.push({angle:g,smooth:!1});for(const O of Y){const C=mS(O.angle-v);if(!(Math.abs(C)>Xw)&&!(Math.abs(Math.sin(C))*b>qw)){h=O.angle,f=O.smooth;break}}}const x=i!==null&&i>0&&Math.abs(b-i)<=Uw;if(h===null&&!x)return{point:e,guides:Bi};const S=h??v,y=x?i:b,w={x:Math.cos(S),y:Math.sin(S)},H=y+(h===null?0:zi),N=x?y:f?zi:0;return{point:l({x:d.x+w.x*y,y:d.y+w.y*y}),guides:[{kind:"angle",a:{x:d.x-w.x*N,y:d.y-w.y*N},b:{x:d.x+w.x*H,y:d.y+w.y*H}}]}}const bs=.1,ws=8,vS=4,Xc=10,Ur=(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}}},Au=e=>{switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}},Ss=(e,t)=>{const n=Ur(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*Xc,y:n.y+o*Xc}},$s=(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),Si=(e,t,n)=>{const i=$s(e,t)*n;return{width:t.width*i,height:t.height*i}},En=(e,t,n)=>(e-t)*n,Vi=(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)<vS?.5:qr(r)},xS=(e,t,n,i,o,r)=>{const l=Si(e,n,r),d=e.x+En(e.width,l.width,i),c=e.y+En(e.height,l.height,o),u=$s(e,n),p=$s(t,n),b=Math.min(ws,Math.max(bs,p>0?r*(u/p):r)),v=Si(t,n,b);return{focalX:Vi(t.width,v.width,d-t.x,{clamp:!1}),focalY:Vi(t.height,v.height,c-t.y,{clamp:!1}),scale:b}},Uc=1.08,$r=14,Cr=8;function bS({P:e,box:t,bounds:n,natural:i,imageUrl:o,maskPath:r,stage:l,onStageChange:d,focalX:c,focalY:u,scale:p,onChange:b,onCommit:v}){const g=s.useRef(null),h=`pretext-image-ghost-${s.useId().replace(/:/g,"")}`,f=s.useRef(null),x=s.useRef(null),S=s.useRef({focalX:c,focalY:u,scale:p});S.current={focalX:c,focalY:u,scale:p};const y=l==="image";s.useEffect(()=>{var T;y&&((T=g.current)==null||T.focus({preventScroll:!0}))},[y]);const w=s.useCallback((T,m)=>{var E;const M=(E=g.current)==null?void 0:E.getBoundingClientRect();return!M||M.width<=0||M.height<=0?{x:0,y:0}:{x:(T-M.left)/M.width*t.width,y:(m-M.top)/M.height*t.height}},[t.width,t.height]),H=T=>{var M,E;if(!i)return;T.stopPropagation(),T.preventDefault(),(M=g.current)==null||M.focus({preventScroll:!0});const m=Si(n,i,p);f.current={pointerId:T.pointerId,origin:w(T.clientX,T.clientY),startX:En(n.width,m.width,c),startY:En(n.height,m.height,u),width:m.width,height:m.height,moved:!1},(E=g.current)==null||E.setPointerCapture(T.pointerId)},N=(T,m)=>{var ae,de;if(!i)return;T.stopPropagation(),T.preventDefault(),(ae=g.current)==null||ae.focus({preventScroll:!0});const M=Si(n,i,p),E=En(n.width,M.width,c),z=En(n.height,M.height,u),ne={minX:E,minY:z,maxX:E+M.width,maxY:z+M.height},I=Ur(ne,Au(m)),W=Ur(ne,m),K=Math.hypot(W.x-I.x,W.y-I.y);!isFinite(K)||K<=0||(x.current={pointerId:T.pointerId,anchor:I,startDistance:K,startScale:p,startX:E,startY:z,moved:!1},(de=g.current)==null||de.setPointerCapture(T.pointerId))},Y=T=>{if(!i)return;const m=x.current;if(m&&T.pointerId===m.pointerId){T.stopPropagation(),T.preventDefault();const E=w(T.clientX,T.clientY),z={x:E.x-n.x,y:E.y-n.y},ne=Math.hypot(z.x-m.anchor.x,z.y-m.anchor.y),I=Math.min(ws,Math.max(bs,m.startScale*(ne/m.startDistance)));if(!m.moved&&Math.abs(I-m.startScale)<1e-4)return;m.moved=!0;const W=I/m.startScale,K=m.anchor.x+(m.startX-m.anchor.x)*W,ae=m.anchor.y+(m.startY-m.anchor.y)*W,de=Si(n,i,I);b({focalX:Vi(n.width,de.width,K),focalY:Vi(n.height,de.height,ae),scale:I});return}const M=f.current;if(M&&T.pointerId===M.pointerId){T.stopPropagation(),T.preventDefault();const E=w(T.clientX,T.clientY),z=E.x-M.origin.x,ne=E.y-M.origin.y;if(!M.moved&&z===0&&ne===0)return;M.moved=!0,b({focalX:Vi(n.width,M.width,M.startX+z),focalY:Vi(n.height,M.height,M.startY+ne),scale:p})}},O=T=>{var E,z;const m=f.current;if(m&&T.pointerId===m.pointerId){f.current=null,T.stopPropagation(),(E=g.current)!=null&&E.hasPointerCapture(m.pointerId)&&g.current.releasePointerCapture(m.pointerId),m.moved&&v(S.current);return}const M=x.current;M&&T.pointerId===M.pointerId&&(x.current=null,T.stopPropagation(),(z=g.current)!=null&&z.hasPointerCapture(M.pointerId)&&g.current.releasePointerCapture(M.pointerId),M.moved&&v(S.current))},C=T=>{if(T.key==="Escape"){T.stopPropagation(),d("none");return}if(T.key==="="||T.key==="+"||T.key==="-"||T.key==="_"){T.preventDefault(),T.stopPropagation();const m=T.key==="="||T.key==="+",M=Math.min(ws,Math.max(bs,p*(m?Uc:1/Uc))),E={focalX:c,focalY:u,scale:M};b(E),v(E)}},V=["nw","ne","se","sw"],$={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},R=s.useMemo(()=>{const T=i??{width:n.width,height:n.height},m=Si(n,T,p);return!(m.width>0)||!(m.height>0)?null:{x:n.x+En(n.width,m.width,c),y:n.y+En(n.height,m.height,u),width:m.width,height:m.height}},[i,n.x,n.y,n.width,n.height,c,u,p]),k=R?{minX:R.x,minY:R.y,maxX:R.x+R.width,maxY:R.y+R.height}:$;return a.jsxs("svg",{ref:g,className:`${e}-editor${y?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:C,onPointerMove:Y,onPointerUp:O,onPointerCancel:O,onLostPointerCapture:O,"data-pretext-image-editor":!0,children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>d("none")}),y&&o&&R&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:h,maskUnits:"userSpaceOnUse",x:R.x,y:R.y,width:R.width,height:R.height,children:[a.jsx("rect",{x:R.x,y:R.y,width:R.width,height:R.height,fill:"#FFFFFF"}),a.jsx("path",{d:r,fillRule:"evenodd",fill:"#000000"})]})}),a.jsx("image",{className:`${e}-editor-ghost`,href:o??void 0,x:R.x,y:R.y,width:R.width,height:R.height,preserveAspectRatio:"none",mask:`url(#${h})`}),a.jsx("rect",{className:`${e}-editor-image-bounds`,x:R.x,y:R.y,width:R.width,height:R.height})]}),y&&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:H}),V.map(T=>{const m=Ss(k,T),M=T==="ne"||T==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:m.x-Cr/2,y:m.y-Cr/2,width:Cr,height:Cr}),a.jsx("rect",{className:`${e}-editor-scale-grab${M?` ${e}-editor-scale-grab-nesw`:""}`,x:m.x-$r/2,y:m.y-$r/2,width:$r,height:$r,onPointerDown:E=>N(E,T)})]},T)})]})]})}const wS=36,$o=7,SS=4,Co=9,$S=3.5,Yc=1.08,CS=.05,Tr=14,TS=1,Lr=14,Rr=8;function LS({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,uniformStretch:l=!1,stage:d,onStageChange:c,onSelectionChange:u,onChange:p,onCommit:b}){const v=s.useRef(null),g=s.useRef(null),h=s.useRef(i);h.current=i;const f=s.useRef(null),x=s.useRef(null),S=s.useRef(null),y=s.useRef(null),[w,H]=s.useState([]),[N,Y]=s.useState(Bi),O=s.useCallback(P=>{Y(U=>pS(U,P)?U:P)},[]),C=d==="shape";s.useEffect(()=>{var P;C&&((P=v.current)==null||P.focus({preventScroll:!0}))},[C]),s.useEffect(()=>{C||H(P=>P.length?[]:P)},[C]);const V=w.length>0;s.useEffect(()=>{u==null||u(V)},[V,u]),s.useEffect(()=>()=>u==null?void 0:u(!1),[u]);const $=n.width>0?t.width/n.width:1,R=n.height>0?t.height/n.height:1,k=Math.min($,R),T=r&&l?k:$,m=r&&l?k:R,M=r&&l?(t.width-n.width*k)/2:0,E=r&&l?(t.height-n.height*k)/2:0,z=s.useCallback(P=>r?{x:M+(P.x-n.x)*T,y:E+(P.y-n.y)*m}:{x:P.x-n.x,y:P.y-n.y},[r,n,T,m,M,E]),ne=s.useCallback(P=>r?{x:n.x+(T>0?(P.x-M)/T:0),y:n.y+(m>0?(P.y-E)/m:0)}:{x:n.x+P.x,y:n.y+P.y},[r,n,T,m,M,E]),I=s.useMemo(()=>ne({x:t.width/2,y:t.height/2}),[ne,t.width,t.height]),W=s.useCallback((P,U)=>{var ie;const X=(ie=v.current)==null?void 0:ie.getBoundingClientRect();if(!X||X.width<=0||X.height<=0)return{x:0,y:0};if(r){const j=(P-X.left)/X.width*t.width,B=(U-X.top)/X.height*t.height;return{x:n.x+(T>0?(j-M)/T:0),y:n.y+(m>0?(B-E)/m:0)}}return{x:n.x+(P-X.left),y:n.y+(U-X.top)}},[r,n,t.width,t.height,T,m,M,E]),K=s.useCallback((P,U)=>{var ie;const X=(ie=v.current)==null?void 0:ie.getBoundingClientRect();return!X||X.width<=0||X.height<=0?{x:0,y:0}:{x:(P-X.left)/X.width*t.width,y:(U-X.top)/X.height*t.height}},[t.width,t.height]),ae=s.useCallback((P,U)=>{const X=l&&!(U!=null&&U.preserveShape)?nS(P,n,t,M,E,T,m):P;b(X,U)},[b,l,n,t,M,E,T,m]),de=P=>{var De;const U=P.metaKey||P.ctrlKey,X=S.current;if(X&&P.pointerId===X.pointerId){if(P.stopPropagation(),P.preventDefault(),X.startDistance<=0)return;const ge=W(P.clientX,P.clientY),G=Math.hypot(ge.x-X.origin.x,ge.y-X.origin.y),Me=Math.max(CS,G/X.startDistance);if(!X.moved&&Math.abs(Me-1)<1e-4)return;X.moved=!0,p(Dc(X.startContours,X.origin,Me));return}const ie=x.current;if(ie&&P.pointerId===ie.pointerId){P.stopPropagation(),P.preventDefault();const ge=W(P.clientX,P.clientY),{bbox:G}=ie,Me=G.maxX-G.minX,_e=G.maxY-G.minY,rt=ge.x-ie.origin.x,Je=ge.y-ie.origin.y;let at=rt,it=Je;if(isFinite(Me)&&isFinite(_e))if(r){let Se=n.x,We=n.x+n.width,Be=n.y,Ze=n.y+n.height;l&&(T>0&&(Se=n.x+(0-M)/T,We=n.x+(t.width-M)/T),m>0&&(Be=n.y+(0-E)/m,Ze=n.y+(t.height-E)/m));const Le=Math.min(Se,We-Me),Ve=Math.max(Se,We-Me),se=Math.min(Be,Ze-_e),Te=Math.max(Be,Ze-_e),Xe=Math.min(Ve,Math.max(Le,G.minX+rt)),ze=Math.min(Te,Math.max(se,G.minY+Je));at=Xe-G.minX,it=ze-G.minY}else{const Se=G.minX-n.x,We=G.minY-n.y,Be=Math.min(0,t.width-Me),Ze=Math.max(0,t.width-Me),Le=Math.min(0,t.height-_e),Ve=Math.max(0,t.height-_e),se=Math.min(Ze,Math.max(Be,Se+rt)),Te=Math.min(Ve,Math.max(Le,We+Je));at=se-Se,it=Te-We}const je=[];if(!U&&isFinite(Me)&&isFinite(_e)){const Se=z({x:G.minX+Me/2+at,y:G.minY+_e/2+it}),We={x:t.width/2,y:t.height/2};Math.abs(Se.x-We.x)<=Tr&&(at=I.x-G.minX-Me/2,je.push(xs(We.x,"x",t))),Math.abs(Se.y-We.y)<=Tr&&(it=I.y-G.minY-_e/2,je.push(xs(We.y,"y",t)))}if(!ie.moved&&at===0&&it===0)return;ie.moved=!0,O(je.length?je:Bi),p(an(ie.startContours,Se=>({x:Se.x+at,y:Se.y+it})),{carryImage:!0});return}const j=y.current;if(j&&P.pointerId===j.pointerId){P.stopPropagation(),P.preventDefault();const ge=W(P.clientX,P.clientY);let G=ge.x-j.origin.x,Me=ge.y-j.origin.y;if(P.shiftKey&&(Math.abs(G)>Math.abs(Me)?Me=0:G=0),!j.moved&&G===0&&Me===0)return;j.moved=!0,p(zc(j.startContours,j.selection,G,Me));return}const B=f.current;if(!B||P.pointerId!==B.pointerId)return;P.stopPropagation(),P.preventDefault();const J=W(P.clientX,P.clientY);if(B.kind==="anchor"){const ge={x:B.anchor.x+(J.x-B.origin.x),y:B.anchor.y+(J.y-B.origin.y)},G=U?[]:uS(h.current,{contour:B.contour,node:B.node}),Me=U||!B.center?[]:[B.center],_e=Gc(Vc(G,Me.map(at=>at.x),"x"),ge,"x",z,Tr),rt=Gc(Vc(G,Me.map(at=>at.y),"y"),ge,"y",z,Tr),Je=U?ge:{x:(_e==null?void 0:_e.value)??Sr(ge.x,o),y:(rt==null?void 0:rt.value)??Sr(ge.y,o)};if(P.shiftKey&&(Math.abs(Je.x-B.anchor.x)>Math.abs(Je.y-B.anchor.y)?Je.y=B.anchor.y:Je.x=B.anchor.x),!B.moved&&Je.x===B.anchor.x&&Je.y===B.anchor.y)return;B.moved=!0,O(hS(Je,_e,rt,t,z)),p(oS(h.current,B.contour,B.node,Je));return}const te=(De=h.current[B.contour])==null?void 0:De.nodes[B.node],$e=B.mirror&&!P.altKey,ye=$e||U?null:B.kind==="in"?te==null?void 0:te.out:te==null?void 0:te.in,F=te?z(te.p):null,ve=ye?z(ye):null,pe=te&&(!U||P.shiftKey)?yS(J,te.p,$e||U?null:fS(h.current[B.contour],B.node,B.kind,z),F&&ve?Math.hypot(ve.x-F.x,ve.y-F.y):null,P.shiftKey,z,ne):{point:J,guides:Bi},Z=pe.guides.length?pe.point:U?J:{x:Sr(J.x,o),y:Sr(J.y,o)},me=B.kind==="in"?te==null?void 0:te.in:te==null?void 0:te.out;!B.moved&&me&&Z.x===me.x&&Z.y===me.y||(B.moved=!0,O(pe.guides),p(aS(h.current,B.contour,B.node,B.kind,Z,$e)))},A=P=>{O(Bi);const U=S.current;if(U&&P.pointerId===U.pointerId){S.current=null,P.stopPropagation();const ye=v.current;ye!=null&&ye.hasPointerCapture(U.pointerId)&&ye.releasePointerCapture(U.pointerId),U.moved&&ae(h.current,{preserveShape:!0});return}const X=x.current;if(X&&P.pointerId===X.pointerId){x.current=null,P.stopPropagation();const ye=v.current;ye!=null&&ye.hasPointerCapture(X.pointerId)&&ye.releasePointerCapture(X.pointerId),X.moved?ae(h.current,{preserveShape:!0}):H([]);return}const ie=y.current;if(ie&&P.pointerId===ie.pointerId){y.current=null,P.stopPropagation();const ye=v.current;ye!=null&&ye.hasPointerCapture(ie.pointerId)&&ye.releasePointerCapture(ie.pointerId),ie.moved&&ae(h.current);return}const j=f.current;if(!j||P.pointerId!==j.pointerId)return;f.current=null,P.stopPropagation();const B=v.current;B!=null&&B.hasPointerCapture(j.pointerId)&&B.releasePointerCapture(j.pointerId);const J=Math.hypot(P.clientX-j.clientOrigin.x,P.clientY-j.clientOrigin.y);if(j.moved||J>SS){j.moved&&ae(h.current);return}if(!j.toggleOnRelease||P.type!=="pointerup")return;const $e=Bc(h.current,j.contour,j.node);$e!==h.current&&(p($e),ae($e))},he=P=>{P.stopPropagation()},q=P=>{var U,X;P.stopPropagation(),P.preventDefault(),(U=v.current)==null||U.focus({preventScroll:!0}),x.current={pointerId:P.pointerId,origin:W(P.clientX,P.clientY),startContours:Mn(i),bbox:ei(i),moved:!1},(X=v.current)==null||X.setPointerCapture(P.pointerId)},ce=(P,U)=>{var J,te;P.stopPropagation(),P.preventDefault(),(J=v.current)==null||J.focus({preventScroll:!0}),H([]),c("shape");const X=ei(i),ie=Ur(X,Au(U)),j=Ss(X,U),B=Math.hypot(j.x-ie.x,j.y-ie.y);!isFinite(B)||B<=0||(S.current={pointerId:P.pointerId,corner:U,origin:ie,startDistance:B,startContours:Mn(i),moved:!1},(te=v.current)==null||te.setPointerCapture(P.pointerId))},Q=(P,U,X,ie)=>{var J,te,$e,ye;P.stopPropagation(),P.preventDefault(),(J=v.current)==null||J.focus({preventScroll:!0});const j=(te=i[X])==null?void 0:te.nodes[ie];if(!j)return;if(P.altKey){const F=U==="anchor"?ku(i,X,ie):sS(i,X,ie,U);if(F===i)return;H(U==="anchor"?[]:[{contour:X,node:ie}]),p(F),ae(F);return}const B=P.metaKey||P.ctrlKey;if(U==="anchor"&&P.shiftKey&&!B){H(F=>F.some(ve=>ve.contour===X&&ve.node===ie)?F.filter(ve=>!(ve.contour===X&&ve.node===ie)):[...F,{contour:X,node:ie}]);return}if(U==="anchor"&&!B&&w.length>1&&w.some(F=>F.contour===X&&F.node===ie)){y.current={pointerId:P.pointerId,origin:W(P.clientX,P.clientY),startContours:Mn(i),selection:w,moved:!1},($e=v.current)==null||$e.setPointerCapture(P.pointerId);return}H([{contour:X,node:ie}]),f.current={kind:U,contour:X,node:ie,pointerId:P.pointerId,origin:W(P.clientX,P.clientY),clientOrigin:{x:P.clientX,y:P.clientY},anchor:j.p,center:tS(i),mirror:U!=="anchor"&&!!(j.in&&j.out),toggleOnRelease:B,moved:!1},(ye=v.current)==null||ye.setPointerCapture(P.pointerId)},be=P=>{P.stopPropagation(),P.preventDefault();const U=an(i,z),X=dS(U,K(P.clientX,P.clientY));if(!X||X.distance>wS)return;const{contours:ie,nodeIndex:j}=lS(i,X.contour,X.segment,X.t);j<0||(H([{contour:X.contour,node:j}]),p(ie),ae(ie))},He=P=>{if(P.key==="="||P.key==="+"||P.key==="-"||P.key==="_"){P.preventDefault(),P.stopPropagation();const B=ei(i);if(!isFinite(B.minX)||!isFinite(B.maxX))return;const J={x:(B.minX+B.maxX)/2,y:(B.minY+B.maxY)/2},$e=P.key==="="||P.key==="+"?Yc:1/Yc,ye=Dc(i,J,$e);p(ye),ae(ye,{preserveShape:!0});return}if(P.key==="Escape"){P.stopPropagation(),H([]),c("none");return}if(!w.length)return;if(P.key==="Backspace"||P.key==="Delete"){P.preventDefault(),P.stopPropagation();const B=rS(i,w);if(B===i)return;H([]),p(B),ae(B);return}const U=o>0?o:TS,X=P.shiftKey?U*10:U,ie={ArrowLeft:[-X,0],ArrowRight:[X,0],ArrowUp:[0,-X],ArrowDown:[0,X]}[P.key];if(!ie)return;P.preventDefault(),P.stopPropagation();const j=zc(i,w,ie[0],ie[1]);p(j),ae(j)},xe=s.useMemo(()=>co(an(i,z)),[i,z]),le=s.useMemo(()=>ei(i),[i]),ee=z({x:le.minX,y:le.minY}),ue={width:z({x:le.maxX,y:le.minY}).x-ee.x,height:z({x:le.minX,y:le.maxY}).y-ee.y},oe=C&&w.length===0&&isFinite(le.minX)&&isFinite(le.maxX)&&le.maxX>le.minX&&le.maxY>le.minY,Fe=w.length>0||C,Ce=Fe;return a.jsxs("svg",{ref:v,className:`${e}-editor${Fe?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:He,onPointerDown:()=>{var P;return(P=v.current)==null?void 0:P.focus({preventScroll:!0})},onPointerMove:de,onPointerUp:A,onPointerCancel:A,onLostPointerCapture:A,onContextMenu:P=>{P.preventDefault()},"data-pretext-path-editor":!0,"data-selection":"none",children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>{H([]),c("none")},onClick:be}),Ce&&a.jsx("path",{className:`${e}-editor-hit`,d:xe,onClick:be}),Ce&&a.jsx("path",{className:`${e}-editor-outline`,d:xe}),Ce&&N.map((P,U)=>a.jsx("line",{className:`${e}-editor-snap ${e}-editor-snap-${P.kind}`,x1:P.a.x,y1:P.a.y,x2:P.b.x,y2:P.b.y},`${P.kind}-${U}`)),a.jsx("path",{ref:g,className:`${e}-editor-body`,d:xe,fillRule:"evenodd",onPointerDown:q,onClick:be}),Ce&&i.map((P,U)=>P.nodes.map((X,ie)=>{const j=w.some(J=>J.contour===U&&J.node===ie),B=z(X.p);return a.jsxs("g",{children:[j&&w.length===1&&["in","out"].map(J=>{const te=X[J];if(!te)return null;const $e=z(te);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:B.x,y1:B.y,x2:$e.x,y2:$e.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:$e.x,cy:$e.y,r:$S}),a.jsx("circle",{className:`${e}-editor-grab`,cx:$e.x,cy:$e.y,r:Co,onPointerDown:ye=>Q(ye,J,U,ie),onClick:he})]},J)}),a.jsx("rect",{className:`${e}-editor-anchor${j?` ${e}-editor-anchor-selected`:""}`,x:B.x-$o/2,y:B.y-$o/2,width:$o,height:$o,rx:Lu(X)?$o/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:B.x-Co,y:B.y-Co,width:Co*2,height:Co*2,onPointerDown:J=>Q(J,"anchor",U,ie),onClick:he,onDoubleClick:J=>{J.stopPropagation(),J.preventDefault();const te=Bc(i,U,ie);p(te),ae(te)}})]},`${U}-${ie}`)})),oe&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:ee.x,y:ee.y,width:ue.width,height:ue.height}),["nw","ne","se","sw"].map(P=>{const U=z(Ss(le,P)),X=P==="ne"||P==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:U.x-Rr/2,y:U.y-Rr/2,width:Rr,height:Rr}),a.jsx("rect",{className:`${e}-editor-scale-grab${X?` ${e}-editor-scale-grab-nesw`:""}`,x:U.x-Lr/2,y:U.y-Lr/2,width:Lr,height:Lr,onPointerDown:ie=>ce(ie,P),onClick:he})]},P)})]})]})}const RS=4e3,IS=/^(?:https?:|mailto:|tel:)/i;function Fu(e){return!!e&&typeof e=="object"&&e.type==="link"}function ES(e){if(!e)return;const t=e.replace(/\s+/g,"");if(!(/^[a-z][a-z0-9+.-]*:/i.test(t)&&!IS.test(t)))return t}function MS(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if(Fu(c)){o(c.children??[],ES(c.value),c.target);continue}const u=c,p=(u==null?void 0:u.text)??"";if(p.trim())for(const b of p.split(/\s+/))b&&t.push({text:b,leaf:u,href:l,target:d,para:i})}};o((n==null?void 0:n.children)??[])}),t}function Kc(e){return{...e.fontFamily&&{fontFamily:go(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 PS(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(Fu(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function Zc(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:d,height:c,allowOverflow:u,capInset:p,capLines:b}=e,v=e.lineHeight*l,g=e.spaceWidth*l,h=[];if(!t.length||d<=0||v<=0)return{segments:h,placed:0,height:0,capLeft:0,capTop:0};const f=Math.max(1,g*.5),x=v*Fw;let S=0,y=0,w=0,H=t[0].para,N=0,Y=0,O=null;for(;S<t.length&&w<RS;){const C=y+v>c;if(C&&!u)break;const V=t[S].para;if(V>H+1){y+=v*(V-H-1),H=V-1,w+=1;continue}let $=C?[{x0:0,x1:d}]:zw(i,(y+x)/c,(y+v-x)/c,o).map(k=>({x0:k.x0*d,x1:k.x1*d}));p>0&&b>0&&!C&&$.length&&(O===null&&(O=w,N=$[0].x0,Y=y),w-O<b&&($=jw($,{x0:N,x1:N+p})));const R=$.reduce((k,T)=>Math.max(k,T.x1-T.x0),0);for(const k of $){const T=k.x1-k.x0;if(T<f)continue;if(S>=t.length||t[S].para!==V)break;const m=S;let M=0;for(;S<t.length&&t[S].para===V;){const E=n[S]*l,z=S===m?E:g+E;if(M+z>T&&!(S===m&&T>=R-.5&&E>d-.5))break;M+=z,S+=1}if(S>m){const E=S>=t.length||t[S].para!==V;h.push({top:y,left:k.x0,width:T,from:m,to:S,justify:r==="justify"&&!E})}if(S>=t.length||t[S].para!==V)break}H=V,y+=v,w+=1}return{segments:h,placed:S,height:h.length?y:0,capLeft:N,capTop:Y}}const kS=.12,AS=2,FS=10,Ya=.25,_S=e=>{const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}},WS=(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,NS=(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 d=_S(e);(!r||!WS(r,d))&&(r=d,i(d)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n},Ka=(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})))},Ir=typeof window>"u"?s.useEffect:s.useLayoutEffect;function HS(){return typeof document>"u"?null:document.body}function OS({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:d,allowOverflow:c,fitEnabled:u,scale:p,onFitScale:b,dropCapLines:v,dropCapSize:g,showGuides:h,typography:f,imageUrl:x,imageFocalX:S,imageFocalY:y,imageScale:w,imageCustomPath:H,pathDragActive:N,pathCarryImage:Y,onCarryImageConsumed:O,pathEditor:C,imageEditor:V}){var Le,Ve;const $=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[R,k]=s.useState(null),T=s.useRef(null),[m,M]=s.useState({width:0,height:0}),[E,z]=s.useState(null),[ne,I]=s.useState(0),[W,K]=s.useState("none");s.useEffect(()=>{!C&&!V&&K("none")},[C,V]);const[ae,de]=s.useState(null);s.useEffect(()=>{if(!x||typeof Image>"u"){de(null);return}let se=!1;const Te=new Image;return Te.onload=()=>{se||de({width:Te.naturalWidth,height:Te.naturalHeight})},Te.src=x,()=>{se=!0}},[x]);const A=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),he=s.useMemo(()=>MS(A),[A]),q=s.useMemo(()=>PS(A),[A]),ce=v>0&&g>1?((Ve=(Le=he[0])==null?void 0:Le.text)==null?void 0:Ve.charAt(0))??"":"",Q=(C==null?void 0:C.contours)??null,be=s.useMemo(()=>{let se=[];if(Q){const Te=Vo(Q);Te.length&&(se=Yi(Te,r))}if(!se.length){const Te=i.trim(),Xe=Te?Wc(Te,o,r):null;Xe&&Xe.length?se=Xe:se=hs(n==="custom"?"rectangle":n)}return n==="circle"?Ka(se,m):se},[Q,n,i,o,r,m.width,m.height]),He=C==null?void 0:C.onConvert,xe=(C==null?void 0:C.needsConversion)??!1,le=s.useMemo(()=>{if(n==="circle")return!1;const se=Q??(i.trim()?ri(i):null);return!!(se&&Mu(se,r))},[Q,i,r,n]),[ee,ue]=s.useState(null);Ir(()=>{if(!le){ee&&ue(null);return}!ee&&m.width>0&&m.height>0&&ue({width:m.width,height:m.height})},[le,m.width,m.height,ee]);const oe=s.useMemo(()=>{if(!le||m.width<=0||m.height<=0)return be;const se=ee??m,Te=r.width/se.width,Xe=r.height/se.height;return be.map(ze=>ze.map(Re=>({x:Re.x*Te,y:Re.y*Xe})))},[be,le,ee,r.width,r.height,m.width,m.height]),Fe=s.useMemo(()=>{if(Q){const ze=Vo(Q);if(ze.length){const Re=Yi(ze,r);return n==="circle"?Ka(Re,m):Re}}const se=H.trim(),Te=se?Wc(se,o,r):null,Xe=Te&&Te.length?Te:hs(n==="custom"?"rectangle":n);return n==="circle"?Ka(Xe,m):Xe},[Q,n,H,o,r,m.width,m.height]),Ce=s.useMemo(()=>{if(!le||m.width<=0||m.height<=0)return Fe;const se=ee??m,Te=r.width/se.width,Xe=r.height/se.height;return Fe.map(ze=>ze.map(Re=>({x:Re.x*Te,y:Re.y*Xe})))},[Fe,le,ee,r.width,r.height,m.width,m.height]),P=s.useRef(null),U=s.useRef(!1);s.useEffect(()=>{if(!(!He||m.width<=0||m.height<=0)){if(le){if(P.current===i)return;const se=Q??(i.trim()?ri(i):null);if(!(se!=null&&se.length))return;const Te=an(se,Xe=>({x:r.x+(Xe.x-r.x)/m.width*r.width,y:r.y+(Xe.y-r.y)/m.height*r.height}));P.current=co(Te),He(Te);return}!xe||!be.length||U.current||(U.current=!0,He(an(Eu(be),se=>({x:se.x*Xr,y:se.y*Xr}))))}},[xe,le,He,be,Q,i,r,m.width,m.height]),Ir(()=>{const se=R;if(!se||typeof ResizeObserver>"u")return;const Te=()=>{const ze=se.getBoundingClientRect();M(Re=>Math.abs(Re.width-ze.width)<.5&&Math.abs(Re.height-ze.height)<.5?Re:{width:ze.width,height:ze.height})};Te();const Xe=new ResizeObserver(Te);return Xe.observe(se),()=>Xe.disconnect()},[R]),s.useEffect(()=>{const se=typeof document<"u"?document.fonts:void 0;se!=null&&se.ready&&se.ready.then(()=>{I(Te=>Te+1)})},[]),Ir(()=>{const se=T.current;if(!se)return;if(!he.length){z(null);return}const Te=[],Xe=document.createDocumentFragment();for(const It of he){const Tt=document.createElement("span");Object.assign(Tt.style,Kc(It.leaf)),Tt.textContent=It.text,Xe.appendChild(Tt),Te.push(Tt)}const ze=document.createElement("span");ze.textContent=" ",Xe.appendChild(ze);const Re=document.createElement("span");Re.textContent=ce||"H",Re.style.lineHeight="1",Xe.appendChild(Re),se.replaceChildren(Xe);const Pe=window.getComputedStyle(se),Ae=parseFloat(Pe.fontSize)||16,Ke=parseFloat(Pe.lineHeight),Oe=Number.isNaN(Ke)?Ae*1.2:Ke,Qe=Math.max(Oe,Ae);Re.style.fontSize=`${Qe*g}px`;const tt=Te.map(It=>It.getBoundingClientRect().width),nt=ze.getBoundingClientRect().width,xt=ce?Re.getBoundingClientRect().width:0;se.replaceChildren(),z({widths:tt,spaceWidth:nt,lineHeight:Qe,capWidth:xt})},[he,f,ce,v,g,ne,m.width]);const X=E&&ce?E.capWidth+E.lineHeight*kS:0,ie=Math.max(v,Math.ceil(g)),j=s.useMemo(()=>{if(!E||!he.length||m.width<=0||m.height<=0||!u)return 1;const se=ze=>Zc({tokens:he,widths:E.widths,spaceWidth:E.spaceWidth,lineHeight:E.lineHeight,width:m.width,height:m.height,rings:oe,mode:l,align:d,scale:ze,allowOverflow:!1,capInset:X*ze,capLines:ce?ie:0});if(se(1).placed>=he.length)return 1;if(se(Ya).placed<he.length)return Ya;let Te=Ya,Xe=1;for(let ze=0;ze<FS;ze+=1){const Re=(Te+Xe)/2;se(Re).placed>=he.length?Te=Re:Xe=Re}return Te},[E,he,m.width,m.height,oe,l,d,u,X,ce,ie]);s.useEffect(()=>{b(j)},[j,b]);const B=u?Math.min(p,j):1,J=s.useMemo(()=>!E||!he.length||m.width<=0||m.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0}:Zc({tokens:he,widths:E.widths,spaceWidth:E.spaceWidth,lineHeight:E.lineHeight,width:m.width,height:m.height,rings:oe,mode:l,align:d,scale:B,allowOverflow:c,capInset:X*B,capLines:ce?ie:0}),[E,he,m.width,m.height,oe,l,d,B,c,X,ce,ie]),te=E?E.lineHeight*B:0,$e=d==="justify"?"left":d,ye=!!(C&&Q&&m.width>0&&m.height>0),F=!!V,ve=(ye||F)&&m.width>0&&m.height>0,pe=NS(R,ve),Z=ve&&pe?HS():null,me=s.useRef(!1),De=s.useCallback(se=>{me.current=se},[]);s.useEffect(()=>{if(!ye&&!F)return;const se=Te=>{const Xe=R;if(!Xe)return;const ze=Xe.getBoundingClientRect();Te.clientX>=ze.left&&Te.clientX<=ze.right&&Te.clientY>=ze.top&&Te.clientY<=ze.bottom&&(Te.preventDefault(),Te.stopPropagation(),K(Pe=>Pe==="shape"&&me.current?Pe:Pe==="shape"&&F?"image":ye?"shape":"image"))};return document.addEventListener("dblclick",se,!0),()=>document.removeEventListener("dblclick",se,!0)},[ye,F,R]);const ge=s.useMemo(()=>x&&m.width>0&&m.height>0?_w(Ce,m):null,[x,Ce,m.width,m.height]),G=s.useRef(null),Me=(()=>{const se=G.current;return Y||!V||!ae||!ge||!se||H===se.customPath||se.shape!==n&&n!=="custom"?null:xS(se.bounds,ge,ae,se.focalX,se.focalY,se.scale)})();Ir(()=>{if(N||!V||!ae||!ge)return;const se=G.current,Te=!!(se&&H!==se.customPath);Te&&Me&&V.onCommit(Me),Te&&Y&&(O==null||O()),G.current={rings:Ce,bounds:ge,focalX:(Me==null?void 0:Me.focalX)??S,focalY:(Me==null?void 0:Me.focalY)??y,scale:(Me==null?void 0:Me.scale)??w,customPath:H,shape:n}},[N,Y,H,n,Ce,ge,V,ae,S,y,w,Me,O]);const _e=G.current,rt=!!(N&&!Y&&_e&&!Me),Je=rt&&_e?_e.focalX:(Me==null?void 0:Me.focalX)??S,at=rt&&_e?_e.focalY:(Me==null?void 0:Me.focalY)??y,it=rt&&_e?_e.scale:(Me==null?void 0:Me.scale)??w,je=rt&&_e?_e.bounds:ge,Se=s.useMemo(()=>{if(!(m.width>0)||!(m.height>0))return"";let se=Hc(i,Q,o,r,n,m);if(le){const Te=ee??m,Xe=r.width/Te.width,ze=r.height/Te.height;se=an(se,Re=>({x:Re.x*Xe,y:Re.y*ze}))}return Oc(se,m)||_c(oe,m)},[i,Q,o,r,n,m.width,m.height,le,ee,oe]),We=s.useMemo(()=>{if(!x||!(m.width>0)||!(m.height>0))return"";let se=Hc(H,Q,o,r,n,m);if(le){const Te=ee??m,Xe=r.width/Te.width,ze=r.height/Te.height;se=an(se,Re=>({x:Re.x*Xe,y:Re.y*ze}))}return Oc(se,m)||_c(Ce,m)},[x,H,Q,o,r,n,m.width,m.height,le,ee,Ce]),Be=`${$}-clip`,Ze=s.useMemo(()=>{if(!je)return null;const se=ae??{width:je.width,height:je.height},Te=Si(je,se,it);return{x:En(je.width,Te.width,Je),y:En(je.height,Te.height,at),width:Te.width,height:Te.height}},[je,ae,Je,at,it]);return a.jsxs("div",{className:`${e}-column`,ref:k,children:[Se?a.jsxs("svg",{className:`${e}-shape-fill`,viewBox:`0 0 ${m.width} ${m.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("path",{className:`${e}-shape-fill-path`,d:Se,fillRule:"evenodd"}),x&&We&&je&&Ze?a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsx("clipPath",{id:Be,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:We,fillRule:"evenodd"})})}),a.jsx("image",{href:x,x:je.x+Ze.x,y:je.y+Ze.y,width:Ze.width,height:Ze.height,preserveAspectRatio:"none",clipPath:`url(#${Be})`})]}):null]}):null,a.jsxs("div",{className:`${e}-flow${c?"":` ${e}-clip`}`,style:{...f,["--"+e+"-fit"]:B},children:[a.jsx("div",{className:`${e}-measure`,ref:T,style:f,"aria-hidden":!0}),J.segments.map((se,Te)=>{const Xe=he.slice(se.from,se.to),ze=Te===0;return a.jsx("div",{className:`${e}-line${se.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${se.top}px`,left:`${se.left}px`,width:`${se.width}px`,textAlign:se.justify?void 0:$e},children:Xe.map((Re,Pe)=>{const Ke=ce&&ze&&se.from===0&&Pe===0?Re.text.slice(1):Re.text,Oe=Kc(Re.leaf),Qe=Re.href?a.jsx("a",{className:`${e}-link`,href:Re.href,target:Re.target,rel:Re.target?"noopener noreferrer":void 0,style:Oe,children:Ke}):a.jsx("span",{style:Oe,children:Ke});return a.jsxs("span",{children:[!se.justify&&Pe>0?" ":null,Qe]},Pe)})},`${se.from}-${se.to}-${Te}`)}),h&&!Q&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:oe.map((se,Te)=>a.jsx("polygon",{points:se.map(Xe=>`${Xe.x},${Xe.y}`).join(" ")},Te))})]}),ce&&E&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...f,top:`${J.capTop}px`,left:`${J.capLeft}px`,fontSize:`${te*g}px`,lineHeight:`${te*g}px`},children:ce}),Z&&pe&&(Q&&C||V)&&Vn.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:pe.top,left:pe.left,width:pe.width,height:pe.height,zIndex:AS,pointerEvents:"none"},children:[Q&&C&&a.jsx(LS,{P:e,box:{width:pe.width,height:pe.height},viewBox:r,contours:Q,snap:C.snap,stretchToBox:!le,uniformStretch:n==="circle",stage:W,onStageChange:K,onSelectionChange:De,onChange:C.onChange,onCommit:C.onCommit}),V&&je&&a.jsx(bS,{P:e,box:{width:pe.width,height:pe.height},bounds:je,natural:ae,imageUrl:x,maskPath:We,stage:W,onStageChange:K,focalX:Je,focalY:at,scale:it,onChange:V.onChange,onCommit:V.onCommit})]}),Z),a.jsx("div",{className:`${e}-a11y`,children:q.map((se,Te)=>a.jsx("p",{children:se},Te))})]})}const _u=["diamond","parallelogram","vase","circle","shield","bobbin","custom"],DS={x:0,y:0,width:100,height:100},jS=e=>{const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?DS:{x:t[0],y:t[1],width:t[2],height:t[3]}},zS=e=>`
23708
+ `,Pw=["https://cdn.cntrl.site/component-assets/Helix-default-1.png","https://cdn.cntrl.site/component-assets/Helix-default-2.png","https://cdn.cntrl.site/component-assets/Helix-default-3.png","https://cdn.cntrl.site/component-assets/Helix-default-4.png","https://cdn.cntrl.site/component-assets/Helix-default-5.png"],kw={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,deleteImageDeletesEntry:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]}}}}},default:Pw.map(e=>({image:{url:e,name:""}}))},settings:{sizing:"auto auto",properties:{width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},imageWidth:{type:"number",scope:"layout",title:"Img width",display:{type:"numeric-input"},min:0,max:9999},turnHeight:{type:"number",scope:"layout",title:"Turn height",display:{type:"numeric-input"},min:0,max:9999},itemsPerTurn:{type:"number",scope:"common",title:"Per turn",display:{type:"common-numeric-input"},min:3,max:40},turns:{type:"number",scope:"common",title:"Turns",display:{type:"common-numeric-input"},min:1,max:30},speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:7},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},playback:{type:"string",scope:"common",title:"Playback",display:{type:"toggle-cycle",enum:["autoplay","scroll"]}},imageDisplay:{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"}}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",display:{type:"numeric-input"},min:0,max:9999},blur:{type:"string",scope:"common",title:"Blur",display:{type:"toggle-cycle",enum:["on","off"]}}},defaults:{itemsPerTurn:14,turns:3,direction:"right",playback:"autoplay",blur:"off",imageDisplay:{display:"cover",ratioValue:"2:3",reversed:!1}},layoutDefaults:{d:{defaultPaddingTop:30/1440,width:800/1440,imageWidth:160/1440,turnHeight:380/1440,speed:2.2,cornerRadius:0},m:{defaultPaddingTop:10/375,width:320/375,imageWidth:75/375,turnHeight:310/375,speed:2.8,cornerRadius:0},t:{defaultPaddingTop:20/768,width:620/768,imageWidth:100/768,turnHeight:280/768,speed:2.8,cornerRadius:0}},layout:["__componentName__","width","imageWidth","turnHeight","itemsPerTurn","turns","playback","speed","direction","imageDisplay","cornerRadius","blur"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",items:["direction","speed"]},{type:"row",items:["width"]},{type:"row",items:["imageWidth","turnHeight"]},{type:"row",items:["cornerRadius","imageDisplay"]},{type:"row",items:["itemsPerTurn","turns"]},{type:"row",items:["playback","blur"]}]}]},Aw={element:Ew,id:"helix",name:"Helix",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Helix.mp4"},version:1,defaultSize:{d:{width:720,height:540}},schema:kw,sourceCode:Mw,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Ac=120,Fc=3,Fw=.12,ol={x:0,y:0,width:100,height:100};function Yi(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}function qr(e){return e<0?0:e>1?1:e}function _c(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 _w(e,t){let n=1/0,i=1/0,o=-1/0,r=-1/0;for(const c of e)for(const u of c){const p=u.x*t.width,b=u.y*t.height;p<n&&(n=p),p>o&&(o=p),b<i&&(i=b),b>r&&(r=b)}const l=o-n,d=r-i;return!isFinite(l)||!isFinite(d)||l<=0||d<=0?null:{x:n,y:i,width:l,height:d}}function Ww(e){return e.map(([t,n])=>({x:t,y:n}))}function qa(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const d of e)for(const c of d)c.x<t&&(t=c.x),c.x>i&&(i=c.x),c.y<n&&(n=c.y),c.y>o&&(o=c.y);const r=i-t,l=o-n;return!isFinite(r)||!isFinite(l)||r<=0||l<=0?e:e.map(d=>d.map(c=>({x:(c.x-t)/r,y:(c.y-n)/l})))}function Nw(e,t){const n=[];for(const o of e)for(let r=0;r<o.length;r+=1){const l=o[r],d=o[(r+1)%o.length];(l.y<=t&&d.y>t||d.y<=t&&l.y>t)&&n.push(l.x+(t-l.y)/(d.y-l.y)*(d.x-l.x))}n.sort((o,r)=>o-r);const i=[];for(let o=0;o+1<n.length;o+=2){const r=qr(n[o]),l=qr(n[o+1]);l>r&&i.push({x0:r,x1:l})}return Hw(i)}function Hw(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 Ow(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 Dw(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 jw(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 zw(e,t,n,i){let o=null;for(let r=0;r<Fc;r+=1){const l=qr(t+(n-t)*r/Math.max(1,Fc-1)),d=Nw(e,l),c=i==="avoid"?Dw(d):d;if(o=o===null?c:Ow(o,c),o.length===0)return[]}return o??[]}function Wc(e,t="stretch",n=ol){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=ri(i),d=Vo(l);if(d.length)return t==="viewbox"?Yi(d,n):qa(d);if(typeof document>"u")return null;const c=i.split(/(?=[Mm])/).map(b=>b.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const b of c){const v=document.createElementNS("http://www.w3.org/2000/svg","path");v.setAttribute("d",b),u.appendChild(v);let g=0;try{g=v.getTotalLength()}catch{g=0}if(!g)continue;const h=[];for(let f=0;f<Ac;f+=1){const x=v.getPointAtLength(f/Ac*g);h.push({x:x.x,y:x.y})}p.push(h)}return p.length?t==="viewbox"?Yi(p,n):qa(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"?Yi([r],n):qa([r])}const rl={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"},ms="0 0 100 100",Xr=100,gs=16,Bw=12,Vw=16,Xa=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,Gw=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g,Nc=Math.PI/4,qw=8,Xw=Math.PI/18,Uw=8,zi=24,Bi=[];function Yw(){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 Ua(e,t){return an(e,n=>({x:(n.x-t.x)/t.width,y:(n.y-t.y)/t.height}))}function Kw(e){const t=ei(e),n=t.maxX-t.minX,i=t.maxY-t.minY;return!isFinite(n)||!isFinite(i)||n<=0||i<=0?e:an(e,o=>({x:(o.x-t.minX)/n,y:(o.y-t.minY)/i}))}function Zw(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 an(e,r=>({x:(i+r.x*n)/t.width,y:(o+r.y*n)/t.height}))}function Hc(e,t,n,i,o,r){let l=[];if(t&&t.length)l=Ua(t,i);else{const d=e.trim();if(d&&/^[Mm]/.test(d)){const c=ri(d);c.length&&(l=n==="viewbox"?Ua(c,i):Kw(c))}if(!l.length){const c=o!=="custom"?rl[o]:void 0;c?l=Ua(ri(c),ol):l=Yw()}}return o==="circle"?Zw(l,r):l}function Oc(e,t){return!(t.width>0)||!(t.height>0)||!e.length?"":co(an(e,n=>({x:n.x*t.width,y:n.y*t.height})))}function hs(e){const t=e==="rectangle"||e==="custom"?void 0:rl[e];return t?Yi(Vo(ri(t)),ol):[Ww([[0,0],[1,0],[1,1],[0,1]])]}function Jw(e){const t=e.match(Gw);return t?t.map(Number).filter(n=>!Number.isNaN(n)):[]}function hn(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function fs(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function rn(e){return{x:e.x,y:e.y}}function Qw(e){return{p:rn(e.p),in:e.in?rn(e.in):null,out:e.out?rn(e.out):null}}function Mn(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(Qw)}))}function an(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 Dc(e,t,n,i=n){return an(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function eS(e,t,n,i,o,r,l){let d=Math.abs(t),c=Math.abs(n);if(!d||!c||e.x===l.x&&e.y===l.y)return[{c1:rn(e),c2:rn(l),p:rn(l)}];const u=i*Math.PI/180,p=Math.cos(u),b=Math.sin(u),v=(e.x-l.x)/2,g=(e.y-l.y)/2,h=p*v+b*g,f=-b*v+p*g,x=h*h/(d*d)+f*f/(c*c);if(x>1){const ne=Math.sqrt(x);d*=ne,c*=ne}const S=o===r?-1:1,y=d*d*f*f+c*c*h*h,w=Math.max(0,d*d*c*c-y),H=y===0?0:S*Math.sqrt(w/y),N=H*d*f/c,U=-H*c*h/d,O=p*N-b*U+(e.x+l.x)/2,C=b*N+p*U+(e.y+l.y)/2,V=Math.atan2((f-U)/c,(h-N)/d);let R=Math.atan2((-f-U)/c,(-h-N)/d)-V;!r&&R>0&&(R-=Math.PI*2),r&&R<0&&(R+=Math.PI*2);const k=Math.max(1,Math.ceil(Math.abs(R)/(Math.PI/2))),T=R/k,m=4/3*Math.tan(T/4),M=(ne,I)=>({x:O+p*d*ne-b*c*I,y:C+b*d*ne+p*c*I}),E=[];let z=V;for(let ne=0;ne<k;ne+=1){const I=z+T,W=Math.cos(z),K=Math.sin(z),ae=Math.cos(I),de=Math.sin(I);E.push({c1:M(W-m*K,K+m*W),c2:M(ae+m*de,de-m*ae),p:ne===k-1?rn(l):M(ae,de)}),z=I}return E}function ri(e){const t=(e??"").trim();if(!t)return[];const n=[];let i=[],o=!1,r={x:0,y:0},l={x:0,y:0},d=null,c=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:An(h??null,g),out:null}),r=g},b=g=>{if(!i.length)return;const h=i[i.length-1];h.out=An(g,h.p)};Xa.lastIndex=0;let v=Xa.exec(t);for(;v!==null;){const g=v[1],h=g.toUpperCase(),f=g!==h,x=Jw(v[2]),S=y=>f?{x:r.x+x[y],y:r.y+x[y+1]}:{x:x[y],y:x[y+1]};if(h==="Z")o=!0,u(),r=rn(l),d=null,c=null;else if(h==="M"){for(let y=0;y+1<x.length;y+=2){const w=S(y);y===0&&(u(),l=rn(w)),p(w)}d=null,c=null}else if(h==="L"){for(let y=0;y+1<x.length;y+=2)p(S(y));d=null,c=null}else if(h==="H"){for(const y of x)p({x:f?r.x+y:y,y:r.y});d=null,c=null}else if(h==="V"){for(const y of x)p({x:r.x,y:f?r.y+y:y});d=null,c=null}else if(h==="C"){for(let y=0;y+5<x.length;y+=6){const w=S(y),H=S(y+2),N=S(y+4);b(w),p(N,H),d=H}c=null}else if(h==="S"){for(let y=0;y+3<x.length;y+=4){const w=d?fs(d,r):rn(r),H=S(y),N=S(y+2);b(w),p(N,H),d=H}c=null}else if(h==="Q")for(let y=0;y+3<x.length;y+=4){const w=S(y),H=S(y+2);b(hn(r,w,2/3)),p(H,hn(H,w,2/3)),c=w,d=null}else if(h==="T")for(let y=0;y+1<x.length;y+=2){const w=c?fs(c,r):rn(r),H=S(y);b(hn(r,w,2/3)),p(H,hn(H,w,2/3)),c=w,d=null}else if(h==="A")for(let y=0;y+6<x.length;y+=7){const w=f?{x:r.x+x[y+5],y:r.y+x[y+6]}:{x:x[y+5],y:x[y+6]};for(const H of eS(r,x[y],x[y+1],x[y+2],x[y+3]!==0,x[y+4]!==0,w))b(H.c1),p(H.p,H.c2);d=null,c=null}v=Xa.exec(t)}return u(),n}function In(e){return`${Number(e.toFixed(2))}`}function An(e,t){return!e||Math.abs(e.x-t.x)<1e-6&&Math.abs(e.y-t.y)<1e-6?null:e}function Lu(e){return!!(An(e.in,e.p)||An(e.out,e.p))}function er(e,t){return!An(e.out,e.p)&&!An(t.in,t.p)}function jc(e,t){if(er(e,t))return`L${In(t.p.x)},${In(t.p.y)}`;const n=An(e.out,e.p)??e.p,i=An(t.in,t.p)??t.p;return`C${In(n.x)},${In(n.y)} ${In(i.x)},${In(i.y)} ${In(t.p.x)},${In(t.p.y)}`}function co(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const[i,...o]=n.nodes;t.push(`M${In(i.p.x)},${In(i.p.y)}`);let r=i;for(const l of o)t.push(jc(r,l)),r=l;if(n.closed){const l=jc(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function Ru(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 ys(e,t,n){if(er(e,t))return hn(e.p,t.p,n);const i=e.out??e.p,o=t.in??t.p,r=1-n,l=r*r*r,d=3*r*r*n,c=3*r*n*n,u=n*n*n;return{x:l*e.p.x+d*i.x+c*o.x+u*t.p.x,y:l*e.p.y+d*i.y+c*o.y+u*t.p.y}}function Vo(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of Ru(n)){if(er(o.from,o.to)){i.push(rn(o.from.p));continue}for(let r=0;r<gs;r+=1)i.push(ys(o.from,o.to,r/gs))}n.closed||i.push(rn(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function ei(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of Vo(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 tS(e){const t=ei(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 Iu(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 Eu(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=Bw)return{closed:!0,nodes:t.map(r=>({p:rn(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/Vw)),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:rn(r),...Iu(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function Mu(e,t,n=1){if(!e.length)return!1;const i=ei(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),d=Math.max(n,t.height*.5);return i.minX<t.x-l||i.minY<t.y-d||i.maxX>t.x+t.width+l||i.maxY>t.y+t.height+d}function nS(e,t,n,i,o,r,l){const d=t.width>0?n.width/t.width:1,c=t.height>0?n.height/t.height:1;return!(r>0)||!(l>0)||!(d>0)||!(c>0)?e:an(e,u=>{const p=i+(u.x-t.x)*r,b=o+(u.y-t.y)*l;return{x:t.x+p/d,y:t.y+b/c}})}function iS(e,t){if(!e.length)return e;const n=ei(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),d=t.x+(t.width-i*l)/2,c=t.y+(t.height-o*l)/2;return an(e,u=>({x:d+(u.x-n.minX)*l,y:c+(u.y-n.minY)*l}))}function Pu(e){const t={x:0,y:0,width:Xr,height:Xr},n=e!=="custom"?rl[e]:void 0,i=n?an(ri(n),r=>({x:r.x/100*t.width+t.x,y:r.y/100*t.height+t.y})):an(Eu(hs("rectangle")),r=>({x:r.x*t.width+t.x,y:r.y*t.height+t.y})),o=iS(i,t);return{shape:e,customPath:co(o),pathFit:"viewbox",pathViewBox:ms}}function Sr(e,t){return t>0?Math.round(e/t)*t:e}function oS(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,d=Mn(e),c=d[t].nodes[n];return c.p={x:o.p.x+r,y:o.p.y+l},c.in&&(c.in={x:c.in.x+r,y:c.in.y+l}),c.out&&(c.out={x:c.out.x+r,y:c.out.y+l}),d}function zc(e,t,n,i){var r;if(!t.length)return e;const o=Mn(e);for(const{contour:l,node:d}of t){const c=(r=o[l])==null?void 0:r.nodes[d];c&&(c.p={x:c.p.x+n,y:c.p.y+i},c.in&&(c.in={x:c.in.x+n,y:c.in.y+i}),c.out&&(c.out={x:c.out.x+n,y:c.out.y+i}))}return o}function rS(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((d,c)=>c-d);for(const d of l)i=ku(i,r,d)}),i}function aS(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const d=Mn(e),c=d[t].nodes[n];if(c[i]=rn(o),r){const p=i==="in"?"out":"in";c[p]=fs(o,c.p)}return d}function sS(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=Mn(e);return r[t].nodes[n][i]=null,r}function lS(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 d=Mn(e),c=d[t].nodes,u=n+1;if(er(r,l))return c.splice(u,0,{p:hn(r.p,l.p,i),in:null,out:null}),{contours:d,nodeIndex:u};const p=r.out??r.p,b=l.in??l.p,v=hn(r.p,p,i),g=hn(p,b,i),h=hn(b,l.p,i),f=hn(v,g,i),x=hn(g,h,i),S=hn(f,x,i),y=(n+1)%o.nodes.length;return c[n].out=v,c[y].in=h,c.splice(u,0,{p:S,in:f,out:x}),{contours:d,nodeIndex:u}}function ku(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=Mn(e);return o[t].nodes.splice(n,1),o}function Bc(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=Mn(e),l=r[t].nodes,d=l[n],c=l.length,u=(n-1+c)%c,p=(n+1)%c,b=!!An(l[u].out,l[u].p),v=!!An(l[p].in,l[p].p);if(Lu(d)||b||v)return d.in=null,d.out=null,l[u].out=null,l[p].in=null,r;const g=Iu(l[u].p,d.p,l[p].p);return d.in=g.in,d.out=g.out,r}function cS(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)),d={x:t.x+i*l,y:t.y+o*l};return{t:l,distance:Math.hypot(e.x-d.x,e.y-d.y)}}function dS(e,t){let n=null;return e.forEach((i,o)=>{for(const r of Ru(i)){const l=er(r.from,r.to)?1:gs;for(let d=0;d<l;d+=1){const c=d/l,u=(d+1)/l,p=cS(t,ys(r.from,r.to,c),ys(r.from,r.to,u));(!n||p.distance<n.distance)&&(n={contour:o,segment:r.index,t:c+(u-c)*p.t,distance:p.distance})}}}),n}function uS(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 Vc(e,t,n){const i=t.filter((r,l)=>isFinite(r)&&t.findIndex(d=>Math.abs(d-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 Gc(e,t,n,i,o){const r=i(t)[n];let l=null,d=1/0;for(const c of e){const u=n==="x"?{x:c.value,y:t.y}:{x:t.x,y:c.value},p=Math.abs(i(u)[n]-r);p>o||l&&p>=d||(l=c,d=p)}return l}function pS(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 mS(e){const t=Math.PI*2;return((e+Math.PI)%t+t)%t-Math.PI}function vs(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 gS(e,t){const n=vs(e,t);return n?{kind:"align",a:{x:e.x-n.x*zi,y:e.y-n.y*zi},b:{x:t.x+n.x*zi,y:t.y+n.y*zi}}:{kind:"align",a:e,b:t}}function xs(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 qc(e,t,n,i,o){if(e.axis===null)return gS(n,o(e.from??n));const r=t==="x"?{x:e.axis,y:0}:{x:0,y:e.axis};return xs(o(r)[t],t,i)}function hS(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(qc(t,"x",l,i,o)),n&&e.y===n.value&&r.push(qc(n,"y",l,i,o)),r}function fS(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 vs(i(l),r);const d=e.nodes.length,c=t+(n==="in"?1:-1);if(!e.closed&&(c<0||c>=d))return null;const u=e.nodes[(c+d)%d];if(!u)return null;const p=(n==="in"?u.in:u.out)??u.p;return vs(i(p),r)}function yS(e,t,n,i,o,r,l){const d=r(t),c=r(e),u=c.x-d.x,p=c.y-d.y,b=Math.hypot(u,p);if(b<1e-6)return{point:e,guides:Bi};const v=Math.atan2(p,u),g=Math.round(v/Nc)*Nc;let h=o?g:null,f=!1;if(!o){const U=[];n&&U.push({angle:Math.atan2(n.y,n.x),smooth:!0}),U.push({angle:g,smooth:!1});for(const O of U){const C=mS(O.angle-v);if(!(Math.abs(C)>Xw)&&!(Math.abs(Math.sin(C))*b>qw)){h=O.angle,f=O.smooth;break}}}const x=i!==null&&i>0&&Math.abs(b-i)<=Uw;if(h===null&&!x)return{point:e,guides:Bi};const S=h??v,y=x?i:b,w={x:Math.cos(S),y:Math.sin(S)},H=y+(h===null?0:zi),N=x?y:f?zi:0;return{point:l({x:d.x+w.x*y,y:d.y+w.y*y}),guides:[{kind:"angle",a:{x:d.x-w.x*N,y:d.y-w.y*N},b:{x:d.x+w.x*H,y:d.y+w.y*H}}]}}const bs=.1,ws=8,vS=4,Xc=10,Ur=(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}}},Au=e=>{switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}},Ss=(e,t)=>{const n=Ur(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*Xc,y:n.y+o*Xc}},$s=(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),Si=(e,t,n)=>{const i=$s(e,t)*n;return{width:t.width*i,height:t.height*i}},En=(e,t,n)=>(e-t)*n,Vi=(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)<vS?.5:qr(r)},xS=(e,t,n,i,o,r)=>{const l=Si(e,n,r),d=e.x+En(e.width,l.width,i),c=e.y+En(e.height,l.height,o),u=$s(e,n),p=$s(t,n),b=Math.min(ws,Math.max(bs,p>0?r*(u/p):r)),v=Si(t,n,b);return{focalX:Vi(t.width,v.width,d-t.x,{clamp:!1}),focalY:Vi(t.height,v.height,c-t.y,{clamp:!1}),scale:b}},Uc=1.08,$r=14,Cr=8;function bS({P:e,box:t,bounds:n,natural:i,imageUrl:o,maskPath:r,stage:l,onStageChange:d,focalX:c,focalY:u,scale:p,onChange:b,onCommit:v}){const g=s.useRef(null),h=`pretext-image-ghost-${s.useId().replace(/:/g,"")}`,f=s.useRef(null),x=s.useRef(null),S=s.useRef({focalX:c,focalY:u,scale:p});S.current={focalX:c,focalY:u,scale:p};const y=l==="image";s.useEffect(()=>{var T;y&&((T=g.current)==null||T.focus({preventScroll:!0}))},[y]);const w=s.useCallback((T,m)=>{var E;const M=(E=g.current)==null?void 0:E.getBoundingClientRect();return!M||M.width<=0||M.height<=0?{x:0,y:0}:{x:(T-M.left)/M.width*t.width,y:(m-M.top)/M.height*t.height}},[t.width,t.height]),H=T=>{var M,E;if(!i)return;T.stopPropagation(),T.preventDefault(),(M=g.current)==null||M.focus({preventScroll:!0});const m=Si(n,i,p);f.current={pointerId:T.pointerId,origin:w(T.clientX,T.clientY),startX:En(n.width,m.width,c),startY:En(n.height,m.height,u),width:m.width,height:m.height,moved:!1},(E=g.current)==null||E.setPointerCapture(T.pointerId)},N=(T,m)=>{var ae,de;if(!i)return;T.stopPropagation(),T.preventDefault(),(ae=g.current)==null||ae.focus({preventScroll:!0});const M=Si(n,i,p),E=En(n.width,M.width,c),z=En(n.height,M.height,u),ne={minX:E,minY:z,maxX:E+M.width,maxY:z+M.height},I=Ur(ne,Au(m)),W=Ur(ne,m),K=Math.hypot(W.x-I.x,W.y-I.y);!isFinite(K)||K<=0||(x.current={pointerId:T.pointerId,anchor:I,startDistance:K,startScale:p,startX:E,startY:z,moved:!1},(de=g.current)==null||de.setPointerCapture(T.pointerId))},U=T=>{if(!i)return;const m=x.current;if(m&&T.pointerId===m.pointerId){T.stopPropagation(),T.preventDefault();const E=w(T.clientX,T.clientY),z={x:E.x-n.x,y:E.y-n.y},ne=Math.hypot(z.x-m.anchor.x,z.y-m.anchor.y),I=Math.min(ws,Math.max(bs,m.startScale*(ne/m.startDistance)));if(!m.moved&&Math.abs(I-m.startScale)<1e-4)return;m.moved=!0;const W=I/m.startScale,K=m.anchor.x+(m.startX-m.anchor.x)*W,ae=m.anchor.y+(m.startY-m.anchor.y)*W,de=Si(n,i,I);b({focalX:Vi(n.width,de.width,K),focalY:Vi(n.height,de.height,ae),scale:I});return}const M=f.current;if(M&&T.pointerId===M.pointerId){T.stopPropagation(),T.preventDefault();const E=w(T.clientX,T.clientY),z=E.x-M.origin.x,ne=E.y-M.origin.y;if(!M.moved&&z===0&&ne===0)return;M.moved=!0,b({focalX:Vi(n.width,M.width,M.startX+z),focalY:Vi(n.height,M.height,M.startY+ne),scale:p})}},O=T=>{var E,z;const m=f.current;if(m&&T.pointerId===m.pointerId){f.current=null,T.stopPropagation(),(E=g.current)!=null&&E.hasPointerCapture(m.pointerId)&&g.current.releasePointerCapture(m.pointerId),m.moved&&v(S.current);return}const M=x.current;M&&T.pointerId===M.pointerId&&(x.current=null,T.stopPropagation(),(z=g.current)!=null&&z.hasPointerCapture(M.pointerId)&&g.current.releasePointerCapture(M.pointerId),M.moved&&v(S.current))},C=T=>{if(T.key==="Escape"){T.stopPropagation(),d("none");return}if(T.key==="="||T.key==="+"||T.key==="-"||T.key==="_"){T.preventDefault(),T.stopPropagation();const m=T.key==="="||T.key==="+",M=Math.min(ws,Math.max(bs,p*(m?Uc:1/Uc))),E={focalX:c,focalY:u,scale:M};b(E),v(E)}},V=["nw","ne","se","sw"],$={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},R=s.useMemo(()=>{const T=i??{width:n.width,height:n.height},m=Si(n,T,p);return!(m.width>0)||!(m.height>0)?null:{x:n.x+En(n.width,m.width,c),y:n.y+En(n.height,m.height,u),width:m.width,height:m.height}},[i,n.x,n.y,n.width,n.height,c,u,p]),k=R?{minX:R.x,minY:R.y,maxX:R.x+R.width,maxY:R.y+R.height}:$;return a.jsxs("svg",{ref:g,className:`${e}-editor${y?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:C,onPointerMove:U,onPointerUp:O,onPointerCancel:O,onLostPointerCapture:O,"data-pretext-image-editor":!0,children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>d("none")}),y&&o&&R&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:h,maskUnits:"userSpaceOnUse",x:R.x,y:R.y,width:R.width,height:R.height,children:[a.jsx("rect",{x:R.x,y:R.y,width:R.width,height:R.height,fill:"#FFFFFF"}),a.jsx("path",{d:r,fillRule:"evenodd",fill:"#000000"})]})}),a.jsx("image",{className:`${e}-editor-ghost`,href:o??void 0,x:R.x,y:R.y,width:R.width,height:R.height,preserveAspectRatio:"none",mask:`url(#${h})`}),a.jsx("rect",{className:`${e}-editor-image-bounds`,x:R.x,y:R.y,width:R.width,height:R.height})]}),y&&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:H}),V.map(T=>{const m=Ss(k,T),M=T==="ne"||T==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:m.x-Cr/2,y:m.y-Cr/2,width:Cr,height:Cr}),a.jsx("rect",{className:`${e}-editor-scale-grab${M?` ${e}-editor-scale-grab-nesw`:""}`,x:m.x-$r/2,y:m.y-$r/2,width:$r,height:$r,onPointerDown:E=>N(E,T)})]},T)})]})]})}const wS=36,$o=7,SS=4,Co=9,$S=3.5,Yc=1.08,CS=.05,Tr=14,TS=1,Lr=14,Rr=8;function LS({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,uniformStretch:l=!1,stage:d,onStageChange:c,onSelectionChange:u,onChange:p,onCommit:b}){const v=s.useRef(null),g=s.useRef(null),h=s.useRef(i);h.current=i;const f=s.useRef(null),x=s.useRef(null),S=s.useRef(null),y=s.useRef(null),[w,H]=s.useState([]),[N,U]=s.useState(Bi),O=s.useCallback(P=>{U(Y=>pS(Y,P)?Y:P)},[]),C=d==="shape";s.useEffect(()=>{var P;C&&((P=v.current)==null||P.focus({preventScroll:!0}))},[C]),s.useEffect(()=>{C||H(P=>P.length?[]:P)},[C]);const V=w.length>0;s.useEffect(()=>{u==null||u(V)},[V,u]),s.useEffect(()=>()=>u==null?void 0:u(!1),[u]);const $=n.width>0?t.width/n.width:1,R=n.height>0?t.height/n.height:1,k=Math.min($,R),T=r&&l?k:$,m=r&&l?k:R,M=r&&l?(t.width-n.width*k)/2:0,E=r&&l?(t.height-n.height*k)/2:0,z=s.useCallback(P=>r?{x:M+(P.x-n.x)*T,y:E+(P.y-n.y)*m}:{x:P.x-n.x,y:P.y-n.y},[r,n,T,m,M,E]),ne=s.useCallback(P=>r?{x:n.x+(T>0?(P.x-M)/T:0),y:n.y+(m>0?(P.y-E)/m:0)}:{x:n.x+P.x,y:n.y+P.y},[r,n,T,m,M,E]),I=s.useMemo(()=>ne({x:t.width/2,y:t.height/2}),[ne,t.width,t.height]),W=s.useCallback((P,Y)=>{var ie;const X=(ie=v.current)==null?void 0:ie.getBoundingClientRect();if(!X||X.width<=0||X.height<=0)return{x:0,y:0};if(r){const j=(P-X.left)/X.width*t.width,B=(Y-X.top)/X.height*t.height;return{x:n.x+(T>0?(j-M)/T:0),y:n.y+(m>0?(B-E)/m:0)}}return{x:n.x+(P-X.left),y:n.y+(Y-X.top)}},[r,n,t.width,t.height,T,m,M,E]),K=s.useCallback((P,Y)=>{var ie;const X=(ie=v.current)==null?void 0:ie.getBoundingClientRect();return!X||X.width<=0||X.height<=0?{x:0,y:0}:{x:(P-X.left)/X.width*t.width,y:(Y-X.top)/X.height*t.height}},[t.width,t.height]),ae=s.useCallback((P,Y)=>{const X=l&&!(Y!=null&&Y.preserveShape)?nS(P,n,t,M,E,T,m):P;b(X,Y)},[b,l,n,t,M,E,T,m]),de=P=>{var De;const Y=P.metaKey||P.ctrlKey,X=S.current;if(X&&P.pointerId===X.pointerId){if(P.stopPropagation(),P.preventDefault(),X.startDistance<=0)return;const ge=W(P.clientX,P.clientY),G=Math.hypot(ge.x-X.origin.x,ge.y-X.origin.y),Me=Math.max(CS,G/X.startDistance);if(!X.moved&&Math.abs(Me-1)<1e-4)return;X.moved=!0,p(Dc(X.startContours,X.origin,Me));return}const ie=x.current;if(ie&&P.pointerId===ie.pointerId){P.stopPropagation(),P.preventDefault();const ge=W(P.clientX,P.clientY),{bbox:G}=ie,Me=G.maxX-G.minX,_e=G.maxY-G.minY,rt=ge.x-ie.origin.x,Je=ge.y-ie.origin.y;let at=rt,it=Je;if(isFinite(Me)&&isFinite(_e))if(r){let Se=n.x,We=n.x+n.width,Be=n.y,Ze=n.y+n.height;l&&(T>0&&(Se=n.x+(0-M)/T,We=n.x+(t.width-M)/T),m>0&&(Be=n.y+(0-E)/m,Ze=n.y+(t.height-E)/m));const Le=Math.min(Se,We-Me),Ve=Math.max(Se,We-Me),se=Math.min(Be,Ze-_e),Te=Math.max(Be,Ze-_e),Xe=Math.min(Ve,Math.max(Le,G.minX+rt)),ze=Math.min(Te,Math.max(se,G.minY+Je));at=Xe-G.minX,it=ze-G.minY}else{const Se=G.minX-n.x,We=G.minY-n.y,Be=Math.min(0,t.width-Me),Ze=Math.max(0,t.width-Me),Le=Math.min(0,t.height-_e),Ve=Math.max(0,t.height-_e),se=Math.min(Ze,Math.max(Be,Se+rt)),Te=Math.min(Ve,Math.max(Le,We+Je));at=se-Se,it=Te-We}const je=[];if(!Y&&isFinite(Me)&&isFinite(_e)){const Se=z({x:G.minX+Me/2+at,y:G.minY+_e/2+it}),We={x:t.width/2,y:t.height/2};Math.abs(Se.x-We.x)<=Tr&&(at=I.x-G.minX-Me/2,je.push(xs(We.x,"x",t))),Math.abs(Se.y-We.y)<=Tr&&(it=I.y-G.minY-_e/2,je.push(xs(We.y,"y",t)))}if(!ie.moved&&at===0&&it===0)return;ie.moved=!0,O(je.length?je:Bi),p(an(ie.startContours,Se=>({x:Se.x+at,y:Se.y+it})),{carryImage:!0});return}const j=y.current;if(j&&P.pointerId===j.pointerId){P.stopPropagation(),P.preventDefault();const ge=W(P.clientX,P.clientY);let G=ge.x-j.origin.x,Me=ge.y-j.origin.y;if(P.shiftKey&&(Math.abs(G)>Math.abs(Me)?Me=0:G=0),!j.moved&&G===0&&Me===0)return;j.moved=!0,p(zc(j.startContours,j.selection,G,Me));return}const B=f.current;if(!B||P.pointerId!==B.pointerId)return;P.stopPropagation(),P.preventDefault();const J=W(P.clientX,P.clientY);if(B.kind==="anchor"){const ge={x:B.anchor.x+(J.x-B.origin.x),y:B.anchor.y+(J.y-B.origin.y)},G=Y?[]:uS(h.current,{contour:B.contour,node:B.node}),Me=Y||!B.center?[]:[B.center],_e=Gc(Vc(G,Me.map(at=>at.x),"x"),ge,"x",z,Tr),rt=Gc(Vc(G,Me.map(at=>at.y),"y"),ge,"y",z,Tr),Je=Y?ge:{x:(_e==null?void 0:_e.value)??Sr(ge.x,o),y:(rt==null?void 0:rt.value)??Sr(ge.y,o)};if(P.shiftKey&&(Math.abs(Je.x-B.anchor.x)>Math.abs(Je.y-B.anchor.y)?Je.y=B.anchor.y:Je.x=B.anchor.x),!B.moved&&Je.x===B.anchor.x&&Je.y===B.anchor.y)return;B.moved=!0,O(hS(Je,_e,rt,t,z)),p(oS(h.current,B.contour,B.node,Je));return}const te=(De=h.current[B.contour])==null?void 0:De.nodes[B.node],$e=B.mirror&&!P.altKey,ye=$e||Y?null:B.kind==="in"?te==null?void 0:te.out:te==null?void 0:te.in,F=te?z(te.p):null,ve=ye?z(ye):null,pe=te&&(!Y||P.shiftKey)?yS(J,te.p,$e||Y?null:fS(h.current[B.contour],B.node,B.kind,z),F&&ve?Math.hypot(ve.x-F.x,ve.y-F.y):null,P.shiftKey,z,ne):{point:J,guides:Bi},Z=pe.guides.length?pe.point:Y?J:{x:Sr(J.x,o),y:Sr(J.y,o)},me=B.kind==="in"?te==null?void 0:te.in:te==null?void 0:te.out;!B.moved&&me&&Z.x===me.x&&Z.y===me.y||(B.moved=!0,O(pe.guides),p(aS(h.current,B.contour,B.node,B.kind,Z,$e)))},A=P=>{O(Bi);const Y=S.current;if(Y&&P.pointerId===Y.pointerId){S.current=null,P.stopPropagation();const ye=v.current;ye!=null&&ye.hasPointerCapture(Y.pointerId)&&ye.releasePointerCapture(Y.pointerId),Y.moved&&ae(h.current,{preserveShape:!0});return}const X=x.current;if(X&&P.pointerId===X.pointerId){x.current=null,P.stopPropagation();const ye=v.current;ye!=null&&ye.hasPointerCapture(X.pointerId)&&ye.releasePointerCapture(X.pointerId),X.moved?ae(h.current,{preserveShape:!0}):H([]);return}const ie=y.current;if(ie&&P.pointerId===ie.pointerId){y.current=null,P.stopPropagation();const ye=v.current;ye!=null&&ye.hasPointerCapture(ie.pointerId)&&ye.releasePointerCapture(ie.pointerId),ie.moved&&ae(h.current);return}const j=f.current;if(!j||P.pointerId!==j.pointerId)return;f.current=null,P.stopPropagation();const B=v.current;B!=null&&B.hasPointerCapture(j.pointerId)&&B.releasePointerCapture(j.pointerId);const J=Math.hypot(P.clientX-j.clientOrigin.x,P.clientY-j.clientOrigin.y);if(j.moved||J>SS){j.moved&&ae(h.current);return}if(!j.toggleOnRelease||P.type!=="pointerup")return;const $e=Bc(h.current,j.contour,j.node);$e!==h.current&&(p($e),ae($e))},he=P=>{P.stopPropagation()},q=P=>{var Y,X;P.stopPropagation(),P.preventDefault(),(Y=v.current)==null||Y.focus({preventScroll:!0}),x.current={pointerId:P.pointerId,origin:W(P.clientX,P.clientY),startContours:Mn(i),bbox:ei(i),moved:!1},(X=v.current)==null||X.setPointerCapture(P.pointerId)},ce=(P,Y)=>{var J,te;P.stopPropagation(),P.preventDefault(),(J=v.current)==null||J.focus({preventScroll:!0}),H([]),c("shape");const X=ei(i),ie=Ur(X,Au(Y)),j=Ss(X,Y),B=Math.hypot(j.x-ie.x,j.y-ie.y);!isFinite(B)||B<=0||(S.current={pointerId:P.pointerId,corner:Y,origin:ie,startDistance:B,startContours:Mn(i),moved:!1},(te=v.current)==null||te.setPointerCapture(P.pointerId))},Q=(P,Y,X,ie)=>{var J,te,$e,ye;P.stopPropagation(),P.preventDefault(),(J=v.current)==null||J.focus({preventScroll:!0});const j=(te=i[X])==null?void 0:te.nodes[ie];if(!j)return;if(P.altKey){const F=Y==="anchor"?ku(i,X,ie):sS(i,X,ie,Y);if(F===i)return;H(Y==="anchor"?[]:[{contour:X,node:ie}]),p(F),ae(F);return}const B=P.metaKey||P.ctrlKey;if(Y==="anchor"&&P.shiftKey&&!B){H(F=>F.some(ve=>ve.contour===X&&ve.node===ie)?F.filter(ve=>!(ve.contour===X&&ve.node===ie)):[...F,{contour:X,node:ie}]);return}if(Y==="anchor"&&!B&&w.length>1&&w.some(F=>F.contour===X&&F.node===ie)){y.current={pointerId:P.pointerId,origin:W(P.clientX,P.clientY),startContours:Mn(i),selection:w,moved:!1},($e=v.current)==null||$e.setPointerCapture(P.pointerId);return}H([{contour:X,node:ie}]),f.current={kind:Y,contour:X,node:ie,pointerId:P.pointerId,origin:W(P.clientX,P.clientY),clientOrigin:{x:P.clientX,y:P.clientY},anchor:j.p,center:tS(i),mirror:Y!=="anchor"&&!!(j.in&&j.out),toggleOnRelease:B,moved:!1},(ye=v.current)==null||ye.setPointerCapture(P.pointerId)},be=P=>{P.stopPropagation(),P.preventDefault();const Y=an(i,z),X=dS(Y,K(P.clientX,P.clientY));if(!X||X.distance>wS)return;const{contours:ie,nodeIndex:j}=lS(i,X.contour,X.segment,X.t);j<0||(H([{contour:X.contour,node:j}]),p(ie),ae(ie))},He=P=>{if(P.key==="="||P.key==="+"||P.key==="-"||P.key==="_"){P.preventDefault(),P.stopPropagation();const B=ei(i);if(!isFinite(B.minX)||!isFinite(B.maxX))return;const J={x:(B.minX+B.maxX)/2,y:(B.minY+B.maxY)/2},$e=P.key==="="||P.key==="+"?Yc:1/Yc,ye=Dc(i,J,$e);p(ye),ae(ye,{preserveShape:!0});return}if(P.key==="Escape"){P.stopPropagation(),H([]),c("none");return}if(!w.length)return;if(P.key==="Backspace"||P.key==="Delete"){P.preventDefault(),P.stopPropagation();const B=rS(i,w);if(B===i)return;H([]),p(B),ae(B);return}const Y=o>0?o:TS,X=P.shiftKey?Y*10:Y,ie={ArrowLeft:[-X,0],ArrowRight:[X,0],ArrowUp:[0,-X],ArrowDown:[0,X]}[P.key];if(!ie)return;P.preventDefault(),P.stopPropagation();const j=zc(i,w,ie[0],ie[1]);p(j),ae(j)},xe=s.useMemo(()=>co(an(i,z)),[i,z]),le=s.useMemo(()=>ei(i),[i]),ee=z({x:le.minX,y:le.minY}),ue={width:z({x:le.maxX,y:le.minY}).x-ee.x,height:z({x:le.minX,y:le.maxY}).y-ee.y},oe=C&&w.length===0&&isFinite(le.minX)&&isFinite(le.maxX)&&le.maxX>le.minX&&le.maxY>le.minY,Fe=w.length>0||C,Ce=Fe;return a.jsxs("svg",{ref:v,className:`${e}-editor${Fe?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:He,onPointerDown:()=>{var P;return(P=v.current)==null?void 0:P.focus({preventScroll:!0})},onPointerMove:de,onPointerUp:A,onPointerCancel:A,onLostPointerCapture:A,onContextMenu:P=>{P.preventDefault()},"data-pretext-path-editor":!0,"data-selection":"none",children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>{H([]),c("none")},onClick:be}),Ce&&a.jsx("path",{className:`${e}-editor-hit`,d:xe,onClick:be}),Ce&&a.jsx("path",{className:`${e}-editor-outline`,d:xe}),Ce&&N.map((P,Y)=>a.jsx("line",{className:`${e}-editor-snap ${e}-editor-snap-${P.kind}`,x1:P.a.x,y1:P.a.y,x2:P.b.x,y2:P.b.y},`${P.kind}-${Y}`)),a.jsx("path",{ref:g,className:`${e}-editor-body`,d:xe,fillRule:"evenodd",onPointerDown:q,onClick:be}),Ce&&i.map((P,Y)=>P.nodes.map((X,ie)=>{const j=w.some(J=>J.contour===Y&&J.node===ie),B=z(X.p);return a.jsxs("g",{children:[j&&w.length===1&&["in","out"].map(J=>{const te=X[J];if(!te)return null;const $e=z(te);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:B.x,y1:B.y,x2:$e.x,y2:$e.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:$e.x,cy:$e.y,r:$S}),a.jsx("circle",{className:`${e}-editor-grab`,cx:$e.x,cy:$e.y,r:Co,onPointerDown:ye=>Q(ye,J,Y,ie),onClick:he})]},J)}),a.jsx("rect",{className:`${e}-editor-anchor${j?` ${e}-editor-anchor-selected`:""}`,x:B.x-$o/2,y:B.y-$o/2,width:$o,height:$o,rx:Lu(X)?$o/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:B.x-Co,y:B.y-Co,width:Co*2,height:Co*2,onPointerDown:J=>Q(J,"anchor",Y,ie),onClick:he,onDoubleClick:J=>{J.stopPropagation(),J.preventDefault();const te=Bc(i,Y,ie);p(te),ae(te)}})]},`${Y}-${ie}`)})),oe&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:ee.x,y:ee.y,width:ue.width,height:ue.height}),["nw","ne","se","sw"].map(P=>{const Y=z(Ss(le,P)),X=P==="ne"||P==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:Y.x-Rr/2,y:Y.y-Rr/2,width:Rr,height:Rr}),a.jsx("rect",{className:`${e}-editor-scale-grab${X?` ${e}-editor-scale-grab-nesw`:""}`,x:Y.x-Lr/2,y:Y.y-Lr/2,width:Lr,height:Lr,onPointerDown:ie=>ce(ie,P),onClick:he})]},P)})]})]})}const RS=4e3,IS=/^(?:https?:|mailto:|tel:)/i;function Fu(e){return!!e&&typeof e=="object"&&e.type==="link"}function ES(e){if(!e)return;const t=e.replace(/\s+/g,"");if(!(/^[a-z][a-z0-9+.-]*:/i.test(t)&&!IS.test(t)))return t}function MS(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if(Fu(c)){o(c.children??[],ES(c.value),c.target);continue}const u=c,p=(u==null?void 0:u.text)??"";if(p.trim())for(const b of p.split(/\s+/))b&&t.push({text:b,leaf:u,href:l,target:d,para:i})}};o((n==null?void 0:n.children)??[])}),t}function Kc(e){return{...e.fontFamily&&{fontFamily:go(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 PS(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(Fu(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function Zc(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:d,height:c,allowOverflow:u,capInset:p,capLines:b}=e,v=e.lineHeight*l,g=e.spaceWidth*l,h=[];if(!t.length||d<=0||v<=0)return{segments:h,placed:0,height:0,capLeft:0,capTop:0};const f=Math.max(1,g*.5),x=v*Fw;let S=0,y=0,w=0,H=t[0].para,N=0,U=0,O=null;for(;S<t.length&&w<RS;){const C=y+v>c;if(C&&!u)break;const V=t[S].para;if(V>H+1){y+=v*(V-H-1),H=V-1,w+=1;continue}let $=C?[{x0:0,x1:d}]:zw(i,(y+x)/c,(y+v-x)/c,o).map(k=>({x0:k.x0*d,x1:k.x1*d}));p>0&&b>0&&!C&&$.length&&(O===null&&(O=w,N=$[0].x0,U=y),w-O<b&&($=jw($,{x0:N,x1:N+p})));const R=$.reduce((k,T)=>Math.max(k,T.x1-T.x0),0);for(const k of $){const T=k.x1-k.x0;if(T<f)continue;if(S>=t.length||t[S].para!==V)break;const m=S;let M=0;for(;S<t.length&&t[S].para===V;){const E=n[S]*l,z=S===m?E:g+E;if(M+z>T&&!(S===m&&T>=R-.5&&E>d-.5))break;M+=z,S+=1}if(S>m){const E=S>=t.length||t[S].para!==V;h.push({top:y,left:k.x0,width:T,from:m,to:S,justify:r==="justify"&&!E})}if(S>=t.length||t[S].para!==V)break}H=V,y+=v,w+=1}return{segments:h,placed:S,height:h.length?y:0,capLeft:N,capTop:U}}const kS=.12,AS=2,FS=10,Ya=.25,_S=e=>{const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}},WS=(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,NS=(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 d=_S(e);(!r||!WS(r,d))&&(r=d,i(d)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n},Ka=(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})))},Ir=typeof window>"u"?s.useEffect:s.useLayoutEffect;function HS(){return typeof document>"u"?null:document.body}function OS({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:d,allowOverflow:c,fitEnabled:u,scale:p,onFitScale:b,dropCapLines:v,dropCapSize:g,showGuides:h,typography:f,imageUrl:x,imageFocalX:S,imageFocalY:y,imageScale:w,imageCustomPath:H,pathDragActive:N,pathCarryImage:U,onCarryImageConsumed:O,pathEditor:C,imageEditor:V}){var Le,Ve;const $=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[R,k]=s.useState(null),T=s.useRef(null),[m,M]=s.useState({width:0,height:0}),[E,z]=s.useState(null),[ne,I]=s.useState(0),[W,K]=s.useState("none");s.useEffect(()=>{!C&&!V&&K("none")},[C,V]);const[ae,de]=s.useState(null);s.useEffect(()=>{if(!x||typeof Image>"u"){de(null);return}let se=!1;const Te=new Image;return Te.onload=()=>{se||de({width:Te.naturalWidth,height:Te.naturalHeight})},Te.src=x,()=>{se=!0}},[x]);const A=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),he=s.useMemo(()=>MS(A),[A]),q=s.useMemo(()=>PS(A),[A]),ce=v>0&&g>1?((Ve=(Le=he[0])==null?void 0:Le.text)==null?void 0:Ve.charAt(0))??"":"",Q=(C==null?void 0:C.contours)??null,be=s.useMemo(()=>{let se=[];if(Q){const Te=Vo(Q);Te.length&&(se=Yi(Te,r))}if(!se.length){const Te=i.trim(),Xe=Te?Wc(Te,o,r):null;Xe&&Xe.length?se=Xe:se=hs(n==="custom"?"rectangle":n)}return n==="circle"?Ka(se,m):se},[Q,n,i,o,r,m.width,m.height]),He=C==null?void 0:C.onConvert,xe=(C==null?void 0:C.needsConversion)??!1,le=s.useMemo(()=>{if(n==="circle")return!1;const se=Q??(i.trim()?ri(i):null);return!!(se&&Mu(se,r))},[Q,i,r,n]),[ee,ue]=s.useState(null);Ir(()=>{if(!le){ee&&ue(null);return}!ee&&m.width>0&&m.height>0&&ue({width:m.width,height:m.height})},[le,m.width,m.height,ee]);const oe=s.useMemo(()=>{if(!le||m.width<=0||m.height<=0)return be;const se=ee??m,Te=r.width/se.width,Xe=r.height/se.height;return be.map(ze=>ze.map(Re=>({x:Re.x*Te,y:Re.y*Xe})))},[be,le,ee,r.width,r.height,m.width,m.height]),Fe=s.useMemo(()=>{if(Q){const ze=Vo(Q);if(ze.length){const Re=Yi(ze,r);return n==="circle"?Ka(Re,m):Re}}const se=H.trim(),Te=se?Wc(se,o,r):null,Xe=Te&&Te.length?Te:hs(n==="custom"?"rectangle":n);return n==="circle"?Ka(Xe,m):Xe},[Q,n,H,o,r,m.width,m.height]),Ce=s.useMemo(()=>{if(!le||m.width<=0||m.height<=0)return Fe;const se=ee??m,Te=r.width/se.width,Xe=r.height/se.height;return Fe.map(ze=>ze.map(Re=>({x:Re.x*Te,y:Re.y*Xe})))},[Fe,le,ee,r.width,r.height,m.width,m.height]),P=s.useRef(null),Y=s.useRef(!1);s.useEffect(()=>{if(!(!He||m.width<=0||m.height<=0)){if(le){if(P.current===i)return;const se=Q??(i.trim()?ri(i):null);if(!(se!=null&&se.length))return;const Te=an(se,Xe=>({x:r.x+(Xe.x-r.x)/m.width*r.width,y:r.y+(Xe.y-r.y)/m.height*r.height}));P.current=co(Te),He(Te);return}!xe||!be.length||Y.current||(Y.current=!0,He(an(Eu(be),se=>({x:se.x*Xr,y:se.y*Xr}))))}},[xe,le,He,be,Q,i,r,m.width,m.height]),Ir(()=>{const se=R;if(!se||typeof ResizeObserver>"u")return;const Te=()=>{const ze=se.getBoundingClientRect();M(Re=>Math.abs(Re.width-ze.width)<.5&&Math.abs(Re.height-ze.height)<.5?Re:{width:ze.width,height:ze.height})};Te();const Xe=new ResizeObserver(Te);return Xe.observe(se),()=>Xe.disconnect()},[R]),s.useEffect(()=>{const se=typeof document<"u"?document.fonts:void 0;se!=null&&se.ready&&se.ready.then(()=>{I(Te=>Te+1)})},[]),Ir(()=>{const se=T.current;if(!se)return;if(!he.length){z(null);return}const Te=[],Xe=document.createDocumentFragment();for(const It of he){const Tt=document.createElement("span");Object.assign(Tt.style,Kc(It.leaf)),Tt.textContent=It.text,Xe.appendChild(Tt),Te.push(Tt)}const ze=document.createElement("span");ze.textContent=" ",Xe.appendChild(ze);const Re=document.createElement("span");Re.textContent=ce||"H",Re.style.lineHeight="1",Xe.appendChild(Re),se.replaceChildren(Xe);const Pe=window.getComputedStyle(se),Ae=parseFloat(Pe.fontSize)||16,Ke=parseFloat(Pe.lineHeight),Oe=Number.isNaN(Ke)?Ae*1.2:Ke,Qe=Math.max(Oe,Ae);Re.style.fontSize=`${Qe*g}px`;const tt=Te.map(It=>It.getBoundingClientRect().width),nt=ze.getBoundingClientRect().width,xt=ce?Re.getBoundingClientRect().width:0;se.replaceChildren(),z({widths:tt,spaceWidth:nt,lineHeight:Qe,capWidth:xt})},[he,f,ce,v,g,ne,m.width]);const X=E&&ce?E.capWidth+E.lineHeight*kS:0,ie=Math.max(v,Math.ceil(g)),j=s.useMemo(()=>{if(!E||!he.length||m.width<=0||m.height<=0||!u)return 1;const se=ze=>Zc({tokens:he,widths:E.widths,spaceWidth:E.spaceWidth,lineHeight:E.lineHeight,width:m.width,height:m.height,rings:oe,mode:l,align:d,scale:ze,allowOverflow:!1,capInset:X*ze,capLines:ce?ie:0});if(se(1).placed>=he.length)return 1;if(se(Ya).placed<he.length)return Ya;let Te=Ya,Xe=1;for(let ze=0;ze<FS;ze+=1){const Re=(Te+Xe)/2;se(Re).placed>=he.length?Te=Re:Xe=Re}return Te},[E,he,m.width,m.height,oe,l,d,u,X,ce,ie]);s.useEffect(()=>{b(j)},[j,b]);const B=u?Math.min(p,j):1,J=s.useMemo(()=>!E||!he.length||m.width<=0||m.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0}:Zc({tokens:he,widths:E.widths,spaceWidth:E.spaceWidth,lineHeight:E.lineHeight,width:m.width,height:m.height,rings:oe,mode:l,align:d,scale:B,allowOverflow:c,capInset:X*B,capLines:ce?ie:0}),[E,he,m.width,m.height,oe,l,d,B,c,X,ce,ie]),te=E?E.lineHeight*B:0,$e=d==="justify"?"left":d,ye=!!(C&&Q&&m.width>0&&m.height>0),F=!!V,ve=(ye||F)&&m.width>0&&m.height>0,pe=NS(R,ve),Z=ve&&pe?HS():null,me=s.useRef(!1),De=s.useCallback(se=>{me.current=se},[]);s.useEffect(()=>{if(!ye&&!F)return;const se=Te=>{const Xe=R;if(!Xe)return;const ze=Xe.getBoundingClientRect();Te.clientX>=ze.left&&Te.clientX<=ze.right&&Te.clientY>=ze.top&&Te.clientY<=ze.bottom&&(Te.preventDefault(),Te.stopPropagation(),K(Pe=>Pe==="shape"&&me.current?Pe:Pe==="shape"&&F?"image":ye?"shape":"image"))};return document.addEventListener("dblclick",se,!0),()=>document.removeEventListener("dblclick",se,!0)},[ye,F,R]);const ge=s.useMemo(()=>x&&m.width>0&&m.height>0?_w(Ce,m):null,[x,Ce,m.width,m.height]),G=s.useRef(null),Me=(()=>{const se=G.current;return U||!V||!ae||!ge||!se||H===se.customPath||se.shape!==n&&n!=="custom"?null:xS(se.bounds,ge,ae,se.focalX,se.focalY,se.scale)})();Ir(()=>{if(N||!V||!ae||!ge)return;const se=G.current,Te=!!(se&&H!==se.customPath);Te&&Me&&V.onCommit(Me),Te&&U&&(O==null||O()),G.current={rings:Ce,bounds:ge,focalX:(Me==null?void 0:Me.focalX)??S,focalY:(Me==null?void 0:Me.focalY)??y,scale:(Me==null?void 0:Me.scale)??w,customPath:H,shape:n}},[N,U,H,n,Ce,ge,V,ae,S,y,w,Me,O]);const _e=G.current,rt=!!(N&&!U&&_e&&!Me),Je=rt&&_e?_e.focalX:(Me==null?void 0:Me.focalX)??S,at=rt&&_e?_e.focalY:(Me==null?void 0:Me.focalY)??y,it=rt&&_e?_e.scale:(Me==null?void 0:Me.scale)??w,je=rt&&_e?_e.bounds:ge,Se=s.useMemo(()=>{if(!(m.width>0)||!(m.height>0))return"";let se=Hc(i,Q,o,r,n,m);if(le){const Te=ee??m,Xe=r.width/Te.width,ze=r.height/Te.height;se=an(se,Re=>({x:Re.x*Xe,y:Re.y*ze}))}return Oc(se,m)||_c(oe,m)},[i,Q,o,r,n,m.width,m.height,le,ee,oe]),We=s.useMemo(()=>{if(!x||!(m.width>0)||!(m.height>0))return"";let se=Hc(H,Q,o,r,n,m);if(le){const Te=ee??m,Xe=r.width/Te.width,ze=r.height/Te.height;se=an(se,Re=>({x:Re.x*Xe,y:Re.y*ze}))}return Oc(se,m)||_c(Ce,m)},[x,H,Q,o,r,n,m.width,m.height,le,ee,Ce]),Be=`${$}-clip`,Ze=s.useMemo(()=>{if(!je)return null;const se=ae??{width:je.width,height:je.height},Te=Si(je,se,it);return{x:En(je.width,Te.width,Je),y:En(je.height,Te.height,at),width:Te.width,height:Te.height}},[je,ae,Je,at,it]);return a.jsxs("div",{className:`${e}-column`,ref:k,children:[Se?a.jsxs("svg",{className:`${e}-shape-fill`,viewBox:`0 0 ${m.width} ${m.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("path",{className:`${e}-shape-fill-path`,d:Se,fillRule:"evenodd"}),x&&We&&je&&Ze?a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsx("clipPath",{id:Be,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:We,fillRule:"evenodd"})})}),a.jsx("image",{href:x,x:je.x+Ze.x,y:je.y+Ze.y,width:Ze.width,height:Ze.height,preserveAspectRatio:"none",clipPath:`url(#${Be})`})]}):null]}):null,a.jsxs("div",{className:`${e}-flow${c?"":` ${e}-clip`}`,style:{...f,["--"+e+"-fit"]:B},children:[a.jsx("div",{className:`${e}-measure`,ref:T,style:f,"aria-hidden":!0}),J.segments.map((se,Te)=>{const Xe=he.slice(se.from,se.to),ze=Te===0;return a.jsx("div",{className:`${e}-line${se.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${se.top}px`,left:`${se.left}px`,width:`${se.width}px`,textAlign:se.justify?void 0:$e},children:Xe.map((Re,Pe)=>{const Ke=ce&&ze&&se.from===0&&Pe===0?Re.text.slice(1):Re.text,Oe=Kc(Re.leaf),Qe=Re.href?a.jsx("a",{className:`${e}-link`,href:Re.href,target:Re.target,rel:Re.target?"noopener noreferrer":void 0,style:Oe,children:Ke}):a.jsx("span",{style:Oe,children:Ke});return a.jsxs("span",{children:[!se.justify&&Pe>0?" ":null,Qe]},Pe)})},`${se.from}-${se.to}-${Te}`)}),h&&!Q&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:oe.map((se,Te)=>a.jsx("polygon",{points:se.map(Xe=>`${Xe.x},${Xe.y}`).join(" ")},Te))})]}),ce&&E&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...f,top:`${J.capTop}px`,left:`${J.capLeft}px`,fontSize:`${te*g}px`,lineHeight:`${te*g}px`},children:ce}),Z&&pe&&(Q&&C||V)&&Vn.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:pe.top,left:pe.left,width:pe.width,height:pe.height,zIndex:AS,pointerEvents:"none"},children:[Q&&C&&a.jsx(LS,{P:e,box:{width:pe.width,height:pe.height},viewBox:r,contours:Q,snap:C.snap,stretchToBox:!le,uniformStretch:n==="circle",stage:W,onStageChange:K,onSelectionChange:De,onChange:C.onChange,onCommit:C.onCommit}),V&&je&&a.jsx(bS,{P:e,box:{width:pe.width,height:pe.height},bounds:je,natural:ae,imageUrl:x,maskPath:We,stage:W,onStageChange:K,focalX:Je,focalY:at,scale:it,onChange:V.onChange,onCommit:V.onCommit})]}),Z),a.jsx("div",{className:`${e}-a11y`,children:q.map((se,Te)=>a.jsx("p",{children:se},Te))})]})}const _u=["diamond","parallelogram","vase","circle","shield","bobbin","custom"],DS={x:0,y:0,width:100,height:100},jS=e=>{const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?DS:{x:t[0],y:t[1],width:t[2],height:t[3]}},zS=e=>`
23700
23709
  .${e}-wrapper {
23701
23710
  box-sizing: border-box;
23702
23711
  display: flex;
@@ -23917,7 +23926,7 @@ export function Helix({
23917
23926
  clip-path: inset(50%);
23918
23927
  white-space: nowrap;
23919
23928
  }
23920
- `,BS=1;function VS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:d}=D.useScopedStyles(),c=s.useMemo(()=>zS(d),[d]),u=n??!1,p=!!r||!!o,b=s.useMemo(()=>Array.isArray(t)?t[0]??{}:{},[t]),v=(e==null?void 0:e.shape)??"custom",g=(e==null?void 0:e.customPath)??"",h=(e==null?void 0:e.pathFit)??"stretch",f=s.useMemo(()=>jS(e==null?void 0:e.pathViewBox),[e==null?void 0:e.pathViewBox]),x=(e==null?void 0:e.shapeMode)==="B"?"avoid":"contain",S=(e==null?void 0:e.textAlign)??"left",y=((e==null?void 0:e.overflowMode)??"clip")==="visible",w=((e==null?void 0:e.fitText)??"off")==="on",H=(e==null?void 0:e.dropCapSize)??BS,N=Math.max(1,Math.round((e==null?void 0:e.dropCapLines)??H)),Y=u&&p&&!i,[O,C]=s.useState(!1);s.useEffect(()=>{if(!u||!p){C(!1);return}const J=()=>C(!0),te=()=>C(!1),$e=["ArticleEditor.Item:drag-start","ArticleEditor.Selection:resize-start","ArticleEditor.Selection:move-start"],ye=["ArticleEditor.Item:drag-end","ArticleEditor.Selection:resize-end","ArticleEditor.Selection:move-end"];for(const F of $e)window.addEventListener(F,J);for(const F of ye)window.addEventListener(F,te);return()=>{for(const F of $e)window.removeEventListener(F,J);for(const F of ye)window.removeEventListener(F,te)}},[u,p]);const V=u&&p&&!i&&typeof l=="function",$=!O,R=Math.max(0,(e==null?void 0:e.pathSnap)??0),k=s.useRef(e??{}),T=s.useRef(""),m=[e==null?void 0:e.customPath,e==null?void 0:e.shape,e==null?void 0:e.pathFit,e==null?void 0:e.pathViewBox,e==null?void 0:e.imageScale,e==null?void 0:e.imageFocalX,e==null?void 0:e.imageFocalY,e==null?void 0:e.image].join("\0");if(m!==T.current)T.current=m,k.current=e??{};else if(e){const{customPath:J,shape:te,pathFit:$e,pathViewBox:ye,imageScale:F,imageFocalX:ve,imageFocalY:pe,image:Z,...me}=e,De=k.current;for(const ge of Object.keys(me))if(De[ge]!==me[ge]){k.current={...De,...me};break}}const[M,E]=s.useState(null),[z,ne]=s.useState(!1),[I,W]=s.useState(!1),K=s.useCallback(()=>W(!1),[]),ae=k.current.shape??v,de=s.useMemo(()=>!M||M.serialized===g?g:M.serialized,[M,g]);s.useEffect(()=>{V||(ne(!1),W(!1))},[V]),s.useEffect(()=>{!M||z||M.serialized===g&&E(null)},[M,g,z]);const A=s.useMemo(()=>{if(!V)return null;if(M&&(M.base===g||M.serialized===g))return M.contours;const J=ri(g);return J.length?J:null},[V,M,g]),he=!!(h==="viewbox"&&((e==null?void 0:e.pathViewBox)??"")===ms&&A&&(v==="circle"||!Mu(A,f))),q=s.useCallback((J,te,$e)=>{const ye=co(J);if(E(F=>({base:F&&(F.base===g||F.serialized===g)?F.base:g,serialized:ye,contours:J})),te){const F=k.current,ve=$e!=null&&$e.preserveShape?F.shape:"custom",pe={...F,shape:ve,customPath:ye};k.current=pe,l==null||l(pe)}},[g,l]),ce=s.useMemo(()=>V?{contours:he?A:null,snap:R,needsConversion:!he,onConvert:J=>{const te=co(J);E({base:te,serialized:te,contours:J});const $e={...k.current,pathFit:"viewbox",pathViewBox:ms,customPath:te};k.current=$e,l==null||l($e)},onChange:(J,te)=>{ne(!0),W(!!(te!=null&&te.carryImage)),q(J,!1)},onCommit:(J,te)=>{q(J,!0,te),ne(!1)}}:null,[V,he,A,R,l,q]),Q=x==="avoid"&&!!(e!=null&&e.image),be=s.useMemo(()=>({focalX:(e==null?void 0:e.imageFocalX)??.5,focalY:(e==null?void 0:e.imageFocalY)??.5,scale:(e==null?void 0:e.imageScale)??1}),[e==null?void 0:e.imageFocalX,e==null?void 0:e.imageFocalY,e==null?void 0:e.imageScale]),[He,xe]=s.useState(null),le=He??be,ee=s.useCallback(J=>xe(J),[]),ue=s.useCallback(J=>{xe(J);const te={...k.current,imageFocalX:J.focalX,imageFocalY:J.focalY,imageScale:J.scale};k.current=te,l==null||l(te)},[l]);s.useEffect(()=>{He&&Math.abs(He.focalX-be.focalX)<1e-9&&Math.abs(He.focalY-be.focalY)<1e-9&&Math.abs(He.scale-be.scale)<1e-9&&xe(null)},[He,be]);const oe=s.useMemo(()=>!V||!Q?null:{onChange:ee,onCommit:ue},[V,Q,ee,ue]),[Fe,Ce]=s.useState(void 0),P=s.useRef(void 0),U=s.useCallback(J=>{const te=P.current;te!==void 0&&Math.abs(te-J)<.005||(P.current=J,Ce(J))},[]),X=s.useMemo(()=>w&&typeof Fe=="number"?Fe:1,[Fe,w]),ie=J=>`calc(${J} * var(--${d}-fit, 1))`,j=s.useMemo(()=>{var $e,ye,F,ve,pe;const J=(e==null?void 0:e.textFontSize)??.012,te=Math.max((e==null?void 0:e.textLineHeight)??J,J);return{fontFamily:go(e==null?void 0:e.textFontFamily),fontWeight:($e=e==null?void 0:e.textFontSettings)==null?void 0:$e.fontWeight,fontStyle:(ye=e==null?void 0:e.textFontSettings)==null?void 0:ye.fontStyle,fontSize:ie(D.scalingValue(J,u)),lineHeight:ie(D.scalingValue(te,u)),letterSpacing:ie(D.scalingValue((e==null?void 0:e.textLetterSpacing)??0,u)),wordSpacing:ie(D.scalingValue((e==null?void 0:e.textWordSpacing)??0,u)),textTransform:(F=e==null?void 0:e.textTextAppearance)==null?void 0:F.textTransform,textDecoration:(ve=e==null?void 0:e.textTextAppearance)==null?void 0:ve.textDecoration,fontVariant:(pe=e==null?void 0:e.textTextAppearance)==null?void 0:pe.fontVariant}},[e,u,d]),B={[`--${d}-text-color`]:(e==null?void 0:e.textColor)??"#000000",[`--${d}-link-color`]:(e==null?void 0:e.linkColor)??(e==null?void 0:e.textColor)??"#000000",[`--${d}-background-color`]:(e==null?void 0:e.backgroundColor)??"transparent"};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx("div",{className:`${d}-wrapper`,style:{...B},children:a.jsx(OS,{P:d,item:b,shape:ae,customPath:g,pathFit:h,viewBox:f,mode:x,align:S,allowOverflow:y,fitEnabled:w,scale:X,onFitScale:U,dropCapLines:N,dropCapSize:H,showGuides:(Y||V)&&$,typography:j,imageUrl:x==="avoid"?e==null?void 0:e.image:null,imageFocalX:le.focalX,imageFocalY:le.focalY,imageScale:le.scale,imageCustomPath:de,pathDragActive:z,pathCarryImage:I,onCarryImageConsumed:K,pathEditor:$?ce:null,imageEditor:$?oe:null})})]})}const GS=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
23929
+ `,BS=1;function VS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:d}=D.useScopedStyles(),c=s.useMemo(()=>zS(d),[d]),u=n??!1,p=!!r||!!o,b=s.useMemo(()=>Array.isArray(t)?t[0]??{}:{},[t]),v=(e==null?void 0:e.shape)??"custom",g=(e==null?void 0:e.customPath)??"",h=(e==null?void 0:e.pathFit)??"stretch",f=s.useMemo(()=>jS(e==null?void 0:e.pathViewBox),[e==null?void 0:e.pathViewBox]),x=(e==null?void 0:e.shapeMode)==="B"?"avoid":"contain",S=(e==null?void 0:e.textAlign)??"left",y=((e==null?void 0:e.overflowMode)??"clip")==="visible",w=((e==null?void 0:e.fitText)??"off")==="on",H=(e==null?void 0:e.dropCapSize)??BS,N=Math.max(1,Math.round((e==null?void 0:e.dropCapLines)??H)),U=u&&p&&!i,[O,C]=s.useState(!1);s.useEffect(()=>{if(!u||!p){C(!1);return}const J=()=>C(!0),te=()=>C(!1),$e=["ArticleEditor.Item:drag-start","ArticleEditor.Selection:resize-start","ArticleEditor.Selection:move-start"],ye=["ArticleEditor.Item:drag-end","ArticleEditor.Selection:resize-end","ArticleEditor.Selection:move-end"];for(const F of $e)window.addEventListener(F,J);for(const F of ye)window.addEventListener(F,te);return()=>{for(const F of $e)window.removeEventListener(F,J);for(const F of ye)window.removeEventListener(F,te)}},[u,p]);const V=u&&p&&!i&&typeof l=="function",$=!O,R=Math.max(0,(e==null?void 0:e.pathSnap)??0),k=s.useRef(e??{}),T=s.useRef(""),m=[e==null?void 0:e.customPath,e==null?void 0:e.shape,e==null?void 0:e.pathFit,e==null?void 0:e.pathViewBox,e==null?void 0:e.imageScale,e==null?void 0:e.imageFocalX,e==null?void 0:e.imageFocalY,e==null?void 0:e.image].join("\0");if(m!==T.current)T.current=m,k.current=e??{};else if(e){const{customPath:J,shape:te,pathFit:$e,pathViewBox:ye,imageScale:F,imageFocalX:ve,imageFocalY:pe,image:Z,...me}=e,De=k.current;for(const ge of Object.keys(me))if(De[ge]!==me[ge]){k.current={...De,...me};break}}const[M,E]=s.useState(null),[z,ne]=s.useState(!1),[I,W]=s.useState(!1),K=s.useCallback(()=>W(!1),[]),ae=k.current.shape??v,de=s.useMemo(()=>!M||M.serialized===g?g:M.serialized,[M,g]);s.useEffect(()=>{V||(ne(!1),W(!1))},[V]),s.useEffect(()=>{!M||z||M.serialized===g&&E(null)},[M,g,z]);const A=s.useMemo(()=>{if(!V)return null;if(M&&(M.base===g||M.serialized===g))return M.contours;const J=ri(g);return J.length?J:null},[V,M,g]),he=!!(h==="viewbox"&&((e==null?void 0:e.pathViewBox)??"")===ms&&A&&(v==="circle"||!Mu(A,f))),q=s.useCallback((J,te,$e)=>{const ye=co(J);if(E(F=>({base:F&&(F.base===g||F.serialized===g)?F.base:g,serialized:ye,contours:J})),te){const F=k.current,ve=$e!=null&&$e.preserveShape?F.shape:"custom",pe={...F,shape:ve,customPath:ye};k.current=pe,l==null||l(pe)}},[g,l]),ce=s.useMemo(()=>V?{contours:he?A:null,snap:R,needsConversion:!he,onConvert:J=>{const te=co(J);E({base:te,serialized:te,contours:J});const $e={...k.current,pathFit:"viewbox",pathViewBox:ms,customPath:te};k.current=$e,l==null||l($e)},onChange:(J,te)=>{ne(!0),W(!!(te!=null&&te.carryImage)),q(J,!1)},onCommit:(J,te)=>{q(J,!0,te),ne(!1)}}:null,[V,he,A,R,l,q]),Q=x==="avoid"&&!!(e!=null&&e.image),be=s.useMemo(()=>({focalX:(e==null?void 0:e.imageFocalX)??.5,focalY:(e==null?void 0:e.imageFocalY)??.5,scale:(e==null?void 0:e.imageScale)??1}),[e==null?void 0:e.imageFocalX,e==null?void 0:e.imageFocalY,e==null?void 0:e.imageScale]),[He,xe]=s.useState(null),le=He??be,ee=s.useCallback(J=>xe(J),[]),ue=s.useCallback(J=>{xe(J);const te={...k.current,imageFocalX:J.focalX,imageFocalY:J.focalY,imageScale:J.scale};k.current=te,l==null||l(te)},[l]);s.useEffect(()=>{He&&Math.abs(He.focalX-be.focalX)<1e-9&&Math.abs(He.focalY-be.focalY)<1e-9&&Math.abs(He.scale-be.scale)<1e-9&&xe(null)},[He,be]);const oe=s.useMemo(()=>!V||!Q?null:{onChange:ee,onCommit:ue},[V,Q,ee,ue]),[Fe,Ce]=s.useState(void 0),P=s.useRef(void 0),Y=s.useCallback(J=>{const te=P.current;te!==void 0&&Math.abs(te-J)<.005||(P.current=J,Ce(J))},[]),X=s.useMemo(()=>w&&typeof Fe=="number"?Fe:1,[Fe,w]),ie=J=>`calc(${J} * var(--${d}-fit, 1))`,j=s.useMemo(()=>{var $e,ye,F,ve,pe;const J=(e==null?void 0:e.textFontSize)??.012,te=Math.max((e==null?void 0:e.textLineHeight)??J,J);return{fontFamily:go(e==null?void 0:e.textFontFamily),fontWeight:($e=e==null?void 0:e.textFontSettings)==null?void 0:$e.fontWeight,fontStyle:(ye=e==null?void 0:e.textFontSettings)==null?void 0:ye.fontStyle,fontSize:ie(D.scalingValue(J,u)),lineHeight:ie(D.scalingValue(te,u)),letterSpacing:ie(D.scalingValue((e==null?void 0:e.textLetterSpacing)??0,u)),wordSpacing:ie(D.scalingValue((e==null?void 0:e.textWordSpacing)??0,u)),textTransform:(F=e==null?void 0:e.textTextAppearance)==null?void 0:F.textTransform,textDecoration:(ve=e==null?void 0:e.textTextAppearance)==null?void 0:ve.textDecoration,fontVariant:(pe=e==null?void 0:e.textTextAppearance)==null?void 0:pe.fontVariant}},[e,u,d]),B={[`--${d}-text-color`]:(e==null?void 0:e.textColor)??"#000000",[`--${d}-link-color`]:(e==null?void 0:e.linkColor)??(e==null?void 0:e.textColor)??"#000000",[`--${d}-background-color`]:(e==null?void 0:e.backgroundColor)??"transparent"};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx("div",{className:`${d}-wrapper`,style:{...B},children:a.jsx(OS,{P:d,item:b,shape:ae,customPath:g,pathFit:h,viewBox:f,mode:x,align:S,allowOverflow:y,fitEnabled:w,scale:X,onFitScale:Y,dropCapLines:N,dropCapSize:H,showGuides:(U||V)&&$,typography:j,imageUrl:x==="avoid"?e==null?void 0:e.image:null,imageFocalX:le.focalX,imageFocalY:le.focalY,imageScale:le.scale,imageCustomPath:de,pathDragActive:z,pathCarryImage:I,onCarryImageConsumed:K,pathEditor:$?ce:null,imageEditor:$?oe:null})})]})}const GS=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
23921
23930
  import type React from 'react';
23922
23931
  import { CommonComponentProps } from '../props';
23923
23932
  import { scalingValue, useScopedStyles } from '../utils/index';