@cntrl-site/components 1.0.63-alpha.0 → 1.0.63-alpha.1

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 +81 -33
  2. package/dist/index.mjs +3859 -3789
  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"),rt=require("classnames"),_=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Dn=require("react-dom");function Ud(e){return e.type==="object"&&e.version===1}const qd="ControlSlider-module__wrapper___sHEkd",Xd="ControlSlider-module__hoverArrow___A-dOH",Kd="ControlSlider-module__sliderItem___QQSkR",Yd="ControlSlider-module__sliderImage___9hRl-",Zd="ControlSlider-module__arrow___05ghY",Jd="ControlSlider-module__arrowVertical___tBfVN",Qd="ControlSlider-module__nextArrow___-30Yc",eu="ControlSlider-module__arrowInner___aEra3",tu="ControlSlider-module__arrowIcon___S4ztF",nu="ControlSlider-module__arrowImg___2dwJW",iu="ControlSlider-module__mirror___brd6U",ou="ControlSlider-module__pagination___bicLF",ru="ControlSlider-module__paginationInner___bT-P-",au="ControlSlider-module__paginationVertical___zYqKw",su="ControlSlider-module__paginationItem___nTRbk",lu="ControlSlider-module__dot___p1Qun",cu="ControlSlider-module__activeDot___LHFaj",du="ControlSlider-module__paginationInsideBottom___R3FWn",uu="ControlSlider-module__paginationInsideTop___V-qb-",pu="ControlSlider-module__paginationOutsideBottom___14w8D",mu="ControlSlider-module__paginationOutsideTop___SCLqB",gu="ControlSlider-module__paginationInsideLeft___yOBRZ",hu="ControlSlider-module__paginationInsideRight___Rtt3o",fu="ControlSlider-module__paginationOutsideLeft___lahaw",yu="ControlSlider-module__paginationOutsideRight___EtuQa",vu="ControlSlider-module__imgWrapper___UjEgB",xu="ControlSlider-module__captionBlock___dJ6-j",bu="ControlSlider-module__captionTextWrapper___HFlpf",wu="ControlSlider-module__captionText___uGBVc",Su="ControlSlider-module__active___WZK4G",$u="ControlSlider-module__withPointerEvents___t-18M",Cu="ControlSlider-module__topLeftAlignment___zjnGM",Tu="ControlSlider-module__topCenterAlignment___gD1xW",Lu="ControlSlider-module__topRightAlignment___NMapS",Ru="ControlSlider-module__middleLeftAlignment___OnUrY",Iu="ControlSlider-module__middleCenterAlignment___Tdkl0",Pu="ControlSlider-module__middleRightAlignment___wEbfX",Mu="ControlSlider-module__bottomLeftAlignment___cTP2-",Eu="ControlSlider-module__bottomCenterAlignment___c54fB",ku="ControlSlider-module__bottomRightAlignment___kEwrz",Au="ControlSlider-module__clickOverlay___DZA28",Fu="ControlSlider-module__contain___pLyq7",_u="ControlSlider-module__cover___KdDat",it={wrapper:qd,hoverArrow:Xd,sliderItem:Kd,sliderImage:Yd,arrow:Zd,arrowVertical:Jd,nextArrow:Qd,arrowInner:eu,arrowIcon:tu,arrowImg:nu,mirror:iu,pagination:ou,paginationInner:ru,paginationVertical:au,paginationItem:su,dot:lu,activeDot:cu,paginationInsideBottom:du,paginationInsideTop:uu,paginationOutsideBottom:pu,paginationOutsideTop:mu,paginationInsideLeft:gu,paginationInsideRight:hu,paginationOutsideLeft:fu,paginationOutsideRight:yu,imgWrapper:vu,captionBlock:xu,captionTextWrapper:bu,captionText:wu,active:Su,withPointerEvents:$u,topLeftAlignment:Cu,topCenterAlignment:Tu,topRightAlignment:Lu,middleLeftAlignment:Ru,middleCenterAlignment:Iu,middleRightAlignment:Pu,bottomLeftAlignment:Mu,bottomCenterAlignment:Eu,bottomRightAlignment:ku,clickOverlay:Au,contain:Fu,cover:_u};function Wu(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 Nu(e,t,n){return t&&Wu(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Es="(prefers-reduced-motion: reduce)",Ai=1,Hu=2,Hi=3,Zi=4,Fo=5,ur=6,br=7,Ou={CREATED:Ai,MOUNTED:Hu,IDLE:Hi,MOVING:Zi,SCROLLING:Fo,DRAGGING:ur,DESTROYED:br};function Hn(e){e.length=0}function ei(e,t,n){return Array.prototype.slice.call(e,t,n)}function Vt(e){return e.bind.apply(e,[null].concat(ei(arguments,1)))}var mc=setTimeout,Pa=function(){};function ks(e){return requestAnimationFrame(e)}function Mr(e,t){return typeof t===e}function wo(e){return!Za(e)&&Mr("object",e)}var Ya=Array.isArray,gc=Vt(Mr,"function"),Yn=Vt(Mr,"string"),_o=Vt(Mr,"undefined");function Za(e){return e===null}function hc(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Wo(e){return Ya(e)?e:[e]}function xn(e,t){Wo(e).forEach(t)}function Ja(e,t){return e.indexOf(t)>-1}function pr(e,t){return e.push.apply(e,Wo(t)),e}function An(e,t,n){e&&xn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function In(e,t){An(e,Yn(t)?t.split(" "):t,!0)}function No(e,t){xn(t,e.appendChild.bind(e))}function Qa(e,t){xn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function So(e,t){return hc(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function fc(e,t){var n=e?ei(e.children):[];return t?n.filter(function(i){return So(i,t)}):n}function Ho(e,t){return t?fc(e,t)[0]:e.firstElementChild}var $o=Object.keys;function fi(e,t,n){return e&&(n?$o(e).reverse():$o(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function Co(e){return ei(arguments,1).forEach(function(t){fi(t,function(n,i){e[i]=t[i]})}),e}function Un(e){return ei(arguments,1).forEach(function(t){fi(t,function(n,i){Ya(n)?e[i]=n.slice():wo(n)?e[i]=Un({},wo(e[i])?e[i]:{},n):e[i]=n})}),e}function As(e,t){xn(t||$o(e),function(n){delete e[n]})}function Pn(e,t){xn(e,function(n){xn(t,function(i){n&&n.removeAttribute(i)})})}function St(e,t,n){wo(t)?fi(t,function(i,o){St(e,o,i)}):xn(e,function(i){Za(n)||n===""?Pn(i,t):i.setAttribute(t,String(n))})}function Fi(e,t,n){var i=document.createElement(e);return t&&(Yn(t)?In(i,t):St(i,t)),n&&No(n,i),i}function wn(e,t,n){if(_o(n))return getComputedStyle(e)[t];Za(n)||(e.style[t]=""+n)}function To(e,t){wn(e,"display",t)}function yc(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Sn(e,t){return e.getAttribute(t)}function Fs(e,t){return e&&e.classList.contains(t)}function hn(e){return e.getBoundingClientRect()}function vi(e){xn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function vc(e){return Ho(new DOMParser().parseFromString(e,"text/html").body)}function kn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function xc(e,t){return e&&e.querySelector(t)}function es(e,t){return t?ei(e.querySelectorAll(t)):[]}function Fn(e,t){An(e,t,!1)}function Ma(e){return e.timeStamp}function ai(e){return Yn(e)?e:e?e+"px":""}var Oo="splide",ts="data-"+Oo;function yo(e,t){if(!e)throw new Error("["+Oo+"] "+(t||""))}var Zn=Math.min,wr=Math.max,Sr=Math.floor,Lo=Math.ceil,cn=Math.abs;function bc(e,t,n){return cn(e-t)<n}function mr(e,t,n,i){var o=Zn(t,n),r=wr(t,n);return i?o<e&&e<r:o<=e&&e<=r}function Pi(e,t,n){var i=Zn(t,n),o=wr(t,n);return Zn(wr(i,e),o)}function Ea(e){return+(e>0)-+(e<0)}function ka(e,t){return xn(t,function(n){e=e.replace("%s",""+n)}),e}function ns(e){return e<10?"0"+e:""+e}var _s={};function Du(e){return""+e+ns(_s[e]=(_s[e]||0)+1)}function wc(){var e=[];function t(l,d,c,u){o(l,d,function(p,w,b){var h="addEventListener"in p,g=h?p.removeEventListener.bind(p,w,c,u):p.removeListener.bind(p,c);h?p.addEventListener(w,c,u):p.addListener(c),e.push([p,w,b,c,g])})}function n(l,d,c){o(l,d,function(u,p,w){e=e.filter(function(b){return b[0]===u&&b[1]===p&&b[2]===w&&(!c||b[3]===c)?(b[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){xn(l,function(u){u&&xn(d,function(p){p.split(" ").forEach(function(w){var b=w.split(".");c(u,b[0],b[1])})})})}function r(){e.forEach(function(l){l[4]()}),Hn(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var ti="mounted",Aa="ready",On="move",Ji="moved",is="click",Sc="active",$c="inactive",Cc="visible",Tc="hidden",Qt="refresh",sn="updated",Oi="resize",Er="resized",Lc="drag",Rc="dragging",Ic="dragged",kr="scroll",wi="scrolled",ju="overflow",os="destroy",Pc="arrows:mounted",Mc="arrows:updated",Ec="pagination:mounted",kc="pagination:updated",rs="navigation:mounted",as="autoplay:play",Ac="autoplay:playing",ss="autoplay:pause",ls="lazyload:loaded",Fc="sk",_c="sh",$r="ei";function Xt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=wc();function i(r,l){n.bind(t,Wo(r).join(" "),function(d){l.apply(l,Ya(d.detail)?d.detail:[])})}function o(r){n.dispatch(t,r,ei(arguments,1))}return e&&e.event.on(os,n.destroy),Co(n,{bus:t,on:i,off:Vt(n.unbind,t),emit:o})}function Ar(e,t,n,i){var o=Date.now,r,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?Zn((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return b();d=ks(p)}}function w(L){L||g(),r=o()-(L?l*e:0),c=!1,d=ks(p)}function b(){c=!0}function h(){r=o(),l=0,n&&n(l)}function g(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function m(L){e=L}function v(){return c}return{start:w,rewind:h,pause:b,cancel:g,set:m,isPaused:v}}function Bu(e){var t=e;function n(o){t=o}function i(o){return Ja(Wo(o),t)}return{set:n,is:i}}function zu(e,t){var n=Ar(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Vu(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=wc(),d=[];function c(){var g=n.mediaQuery==="min";$o(o).sort(function(m,v){return g?+m-+v:+v-+m}).forEach(function(m){p(o[m],"("+(g?"min":"max")+"-width:"+m+"px)")}),p(r,Es),w()}function u(g){g&&l.destroy()}function p(g,m){var v=matchMedia(m);l.bind(v,"change",w),d.push([g,v])}function w(){var g=i.is(br),m=n.direction,v=d.reduce(function(L,f){return Un(L,f[1].matches?f[0]:{})},{});As(n),h(v),n.destroy?e.destroy(n.destroy==="completely"):g?(u(!0),e.mount()):m!==n.direction&&e.refresh()}function b(g){matchMedia(Es).matches&&(g?Un(n,r):As(n,$o(r)))}function h(g,m,v){Un(n,g),m&&Un(Object.getPrototypeOf(n),g),(v||!i.is(Ai))&&e.emit(sn,n)}return{setup:c,destroy:u,reduce:b,set:h}}var Fr="Arrow",_r=Fr+"Left",Wr=Fr+"Right",Wc=Fr+"Up",Nc=Fr+"Down",Ws="rtl",Nr="ttb",Yr={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Wc,Wr],ArrowRight:[Nc,_r]};function Gu(e,t,n){function i(r,l,d){d=d||n.direction;var c=d===Ws&&!l?1:d===Nr?0:-1;return Yr[r]&&Yr[r][c]||r.replace(/width|left|right/i,function(u,p){var w=Yr[u.toLowerCase()][c]||u;return p>0?w.charAt(0).toUpperCase()+w.slice(1):w})}function o(r){return r*(n.direction===Ws?1:-1)}return{resolve:i,orient:o}}var _n="role",_i="tabindex",Uu="disabled",$n="aria-",Do=$n+"controls",Hc=$n+"current",Ns=$n+"selected",yn=$n+"label",cs=$n+"labelledby",Oc=$n+"hidden",ds=$n+"orientation",Ro=$n+"roledescription",Hs=$n+"live",Os=$n+"busy",Ds=$n+"atomic",us=[_n,_i,Uu,Do,Hc,yn,cs,Oc,ds,Ro],Mn=Oo+"__",ni="is-",Zr=Oo,js=Mn+"track",qu=Mn+"list",Hr=Mn+"slide",Dc=Hr+"--clone",Xu=Hr+"__container",ps=Mn+"arrows",Or=Mn+"arrow",jc=Or+"--prev",Bc=Or+"--next",Dr=Mn+"pagination",zc=Dr+"__page",Ku=Mn+"progress",Yu=Ku+"__bar",Zu=Mn+"toggle",Ju=Mn+"spinner",Qu=Mn+"sr",ep=ni+"initialized",xi=ni+"active",Vc=ni+"prev",Gc=ni+"next",Fa=ni+"visible",_a=ni+"loading",Uc=ni+"focus-in",qc=ni+"overflow",tp=[xi,Fa,Vc,Gc,_a,Uc,qc],np={slide:Hr,clone:Dc,arrows:ps,arrow:Or,prev:jc,next:Bc,pagination:Dr,page:zc,spinner:Ju};function ip(e,t){if(gc(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!So(n,t);)n=n.parentElement;return n}var op=5,Bs=200,Xc="touchstart mousedown",Jr="touchmove mousemove",Qr="touchend touchcancel mouseup click";function rp(e,t,n){var i=Xt(e),o=i.on,r=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],w=[],b,h,g;function m(){S(),H(),f()}function v(){o(Qt,L),o(Qt,m),o(sn,f),r(document,Xc+" keydown",function($){g=$.type==="keydown"},{capture:!0}),r(l,"focusin",function(){An(l,Uc,!!g)})}function L($){var x=us.concat("style");Hn(u),Fn(l,p),Fn(b,w),Pn([b,h],x),Pn(l,$?x:["style",Ro])}function f(){Fn(l,p),Fn(b,w),p=R(Zr),w=R(js),In(l,p),In(b,w),St(l,yn,n.label),St(l,cs,n.labelledby)}function S(){b=P("."+js),h=Ho(b,"."+qu),yo(b&&h,"A track/list element is missing."),pr(u,fc(h,"."+Hr+":not(."+Dc+")")),fi({arrows:ps,pagination:Dr,prev:jc,next:Bc,bar:Yu,toggle:Zu},function($,x){c[x]=P("."+$)}),Co(c,{root:l,track:b,list:h,slides:u})}function H(){var $=l.id||Du(Oo),x=n.role;l.id=$,b.id=b.id||$+"-track",h.id=h.id||$+"-list",!Sn(l,_n)&&l.tagName!=="SECTION"&&x&&St(l,_n,x),St(l,Ro,d.carousel),St(h,_n,"presentation")}function P($){var x=xc(l,$);return x&&ip(x,"."+Zr)===l?x:void 0}function R($){return[$+"--"+n.type,$+"--"+n.direction,n.drag&&$+"--draggable",n.isNavigation&&$+"--nav",$===Zr&&xi]}return Co(c,{setup:m,mount:v,destroy:L})}var Di="slide",Qi="loop",jo="fade";function ap(e,t,n,i){var o=Xt(e),r=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,w=p.isNavigation,b=p.updateOnMove,h=p.i18n,g=p.pagination,m=p.slideFocus,v=c.Direction.resolve,L=Sn(i,"style"),f=Sn(i,yn),S=n>-1,H=Ho(i,"."+Xu),P;function R(){S||(i.id=u.id+"-slide"+ns(t+1),St(i,_n,g?"tabpanel":"group"),St(i,Ro,h.slide),St(i,yn,f||ka(h.slideLabel,[t+1,e.length]))),$()}function $(){d(i,"click",Vt(l,is,ee)),d(i,"keydown",Vt(l,Fc,ee)),r([Ji,_c,wi],F),r(rs,A),b&&r(On,y)}function x(){P=!0,o.destroy(),Fn(i,tp),Pn(i,us),St(i,"style",L),St(i,yn,f||"")}function A(){var k=e.splides.map(function(W){var D=W.splide.Components.Slides.getAt(t);return D?D.slide.id:""}).join(" ");St(i,yn,ka(h.slideX,(S?n:t)+1)),St(i,Do,k),St(i,_n,m?"button":""),m&&Pn(i,Ro)}function y(){P||F()}function F(){if(!P){var k=e.index;T(),j(),An(i,Vc,t===k-1),An(i,Gc,t===k+1)}}function T(){var k=B();k!==Fs(i,xi)&&(An(i,xi,k),St(i,Hc,w&&k||""),l(k?Sc:$c,ee))}function j(){var k=O(),W=!k&&(!B()||S);if(e.state.is([Zi,Fo])||St(i,Oc,W||""),St(es(i,p.focusableNodes||""),_i,W?-1:""),m&&St(i,_i,W?-1:0),k!==Fs(i,Fa)&&(An(i,Fa,k),l(k?Cc:Tc,ee)),!k&&document.activeElement===i){var D=c.Slides.getAt(e.index);D&&yc(D.slide)}}function E(k,W,D){wn(D&&H||i,k,W)}function B(){var k=e.index;return k===t||p.cloneStatus&&k===n}function O(){if(e.is(jo))return B();var k=hn(c.Elements.track),W=hn(i),D=v("left",!0),le=v("right",!0);return Sr(k[D])<=Lo(W[D])&&Sr(W[le])<=Lo(k[le])}function z(k,W){var D=cn(k-t);return!S&&(p.rewind||e.is(Qi))&&(D=Zn(D,e.length-D)),D<=W}var ee={index:t,slideIndex:n,slide:i,container:H,isClone:S,mount:R,destroy:x,update:F,style:E,isWithin:z};return ee}function sp(e,t,n){var i=Xt(e),o=i.on,r=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function w(){b(),o(Qt,h),o(Qt,b)}function b(){c.forEach(function(F,T){m(F,T,-1)})}function h(){P(function(F){F.destroy()}),Hn(p)}function g(){P(function(F){F.update()})}function m(F,T,j){var E=ap(e,T,j,F);E.mount(),p.push(E),p.sort(function(B,O){return B.index-O.index})}function v(F){return F?R(function(T){return!T.isClone}):p}function L(F){var T=t.Controller,j=T.toIndex(F),E=T.hasFocus()?1:n.perPage;return R(function(B){return mr(B.index,j,j+E-1)})}function f(F){return R(F)[0]}function S(F,T){xn(F,function(j){if(Yn(j)&&(j=vc(j)),hc(j)){var E=c[T];E?Qa(j,E):No(u,j),In(j,n.classes.slide),x(j,Vt(r,Oi))}}),r(Qt)}function H(F){vi(R(F).map(function(T){return T.slide})),r(Qt)}function P(F,T){v(T).forEach(F)}function R(F){return p.filter(gc(F)?F:function(T){return Yn(F)?So(T.slide,F):Ja(Wo(F),T.index)})}function $(F,T,j){P(function(E){E.style(F,T,j)})}function x(F,T){var j=es(F,"img"),E=j.length;E?j.forEach(function(B){l(B,"load error",function(){--E||T()})}):T()}function A(F){return F?c.length:p.length}function y(){return p.length>n.perPage}return{mount:w,destroy:h,update:g,register:m,get:v,getIn:L,getAt:f,add:S,remove:H,forEach:P,filter:R,style:$,getLength:A,isEnough:y}}function lp(e,t,n){var i=Xt(e),o=i.on,r=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,w=u.track,b=u.list,h=d.getAt,g=d.style,m,v,L;function f(){S(),r(window,"resize load",zu(Vt(l,Oi))),o([sn,Qt],S),o(Oi,H)}function S(){m=n.direction===Nr,wn(p,"maxWidth",ai(n.width)),wn(w,c("paddingLeft"),P(!1)),wn(w,c("paddingRight"),P(!0)),H(!0)}function H(ee){var k=hn(p);(ee||v.width!==k.width||v.height!==k.height)&&(wn(w,"height",R()),g(c("marginRight"),ai(n.gap)),g("width",x()),g("height",A(),!0),v=k,l(Er),L!==(L=z())&&(An(p,qc,L),l(ju,L)))}function P(ee){var k=n.padding,W=c(ee?"right":"left");return k&&ai(k[W]||(wo(k)?0:k))||"0px"}function R(){var ee="";return m&&(ee=$(),yo(ee,"height or heightRatio is missing."),ee="calc("+ee+" - "+P(!1)+" - "+P(!0)+")"),ee}function $(){return ai(n.height||hn(b).width*n.heightRatio)}function x(){return n.autoWidth?null:ai(n.fixedWidth)||(m?"":y())}function A(){return ai(n.fixedHeight)||(m?n.autoHeight?null:y():$())}function y(){var ee=ai(n.gap);return"calc((100%"+(ee&&" + "+ee)+")/"+(n.perPage||1)+(ee&&" - "+ee)+")"}function F(){return hn(b)[c("width")]}function T(ee,k){var W=h(ee||0);return W?hn(W.slide)[c("width")]+(k?0:B()):0}function j(ee,k){var W=h(ee);if(W){var D=hn(W.slide)[c("right")],le=hn(b)[c("left")];return cn(D-le)+(k?0:B())}return 0}function E(ee){return j(e.length-1)-j(0)+T(0,ee)}function B(){var ee=h(0);return ee&&parseFloat(wn(ee.slide,c("marginRight")))||0}function O(ee){return parseFloat(wn(w,c("padding"+(ee?"Right":"Left"))))||0}function z(){return e.is(jo)||E(!0)>F()}return{mount:f,resize:H,listSize:F,slideSize:T,sliderSize:E,totalSize:j,getPadding:O,isOverflow:z}}var cp=2;function dp(e,t,n){var i=Xt(e),o=i.on,r=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(Qt,w),o([sn,Oi],h),(u=v())&&(g(u),t.Layout.resize(!0))}function w(){b(),p()}function b(){vi(c),Hn(c),i.destroy()}function h(){var L=v();u!==L&&(u<L||!L)&&i.emit(Qt)}function g(L){var f=l.get().slice(),S=f.length;if(S){for(;f.length<L;)pr(f,f);pr(f.slice(-L),f.slice(0,L)).forEach(function(H,P){var R=P<L,$=m(H.slide,P);R?Qa($,f[0].slide):No(r.list,$),pr(c,$),l.register($,P-L+(R?0:S),H.index)})}}function m(L,f){var S=L.cloneNode(!0);return In(S,n.classes.clone),S.id=e.root.id+"-clone"+ns(f+1),S}function v(){var L=n.clones;if(!e.is(Qi))L=0;else if(_o(L)){var f=n[d("fixedWidth")]&&t.Layout.slideSize(0),S=f&&Lo(hn(r.track)[d("width")]/f);L=S||n[d("autoWidth")]&&e.length||n.perPage*cp}return L}return{mount:p,destroy:b}}function up(e,t,n){var i=Xt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,w=d.listSize,b=d.sliderSize,h=t.Direction,g=h.resolve,m=h.orient,v=t.Elements,L=v.list,f=v.track,S;function H(){S=t.Transition,o([ti,Er,sn,Qt],P)}function P(){t.Controller.isBusy()||(t.Scroll.cancel(),$(e.index),t.Slides.update())}function R(W,D,le,Y){W!==D&&ee(W>le)&&(F(),x(y(E(),W>le),!0)),l(Zi),r(On,D,le,W),S.start(D,function(){l(Hi),r(Ji,D,le,W),Y&&Y()})}function $(W){x(j(W,!0))}function x(W,D){if(!e.is(jo)){var le=D?W:A(W);wn(L,"transform","translate"+g("X")+"("+le+"px)"),W!==le&&r(_c)}}function A(W){if(e.is(Qi)){var D=T(W),le=D>t.Controller.getEnd(),Y=D<0;(Y||le)&&(W=y(W,le))}return W}function y(W,D){var le=W-z(D),Y=b();return W-=m(Y*(Lo(cn(le)/Y)||1))*(D?1:-1),W}function F(){x(E(),!0),S.cancel()}function T(W){for(var D=t.Slides.get(),le=0,Y=1/0,I=0;I<D.length;I++){var oe=D[I].index,N=cn(j(oe,!0)-W);if(N<=Y)Y=N,le=oe;else break}return le}function j(W,D){var le=m(p(W-1)-O(W));return D?B(le):le}function E(){var W=g("left");return hn(L)[W]-hn(f)[W]+m(u(!1))}function B(W){return n.trimSpace&&e.is(Di)&&(W=Pi(W,0,m(b(!0)-w()))),W}function O(W){var D=n.focus;return D==="center"?(w()-c(W,!0))/2:+D*c(W)||0}function z(W){return j(W?t.Controller.getEnd():0,!!n.trimSpace)}function ee(W){var D=m(y(E(),W));return W?D>=0:D<=L[g("scrollWidth")]-hn(f)[g("width")]}function k(W,D){D=_o(D)?E():D;var le=W!==!0&&m(D)<m(z(!1)),Y=W!==!1&&m(D)>m(z(!0));return le||Y}return{mount:H,move:R,jump:$,translate:x,shift:y,cancel:F,toIndex:T,toPosition:j,getPosition:E,getLimit:z,exceededLimit:k,reposition:P}}function pp(e,t,n){var i=Xt(e),o=i.on,r=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,w=p.isEnough,b=p.getLength,h=n.omitEnd,g=e.is(Qi),m=e.is(Di),v=Vt(E,!1),L=Vt(E,!0),f=n.start||0,S,H=f,P,R,$;function x(){A(),o([sn,Qt,$r],A),o(Er,y)}function A(){P=b(!0),R=n.perMove,$=n.perPage,S=ee();var N=Pi(f,0,h?S:P-1);N!==f&&(f=N,l.reposition())}function y(){S!==ee()&&r($r)}function F(N,ie,Z){if(!oe()){var te=j(N),Se=z(te);Se>-1&&(ie||Se!==f)&&(le(Se),l.move(te,Se,H,Z))}}function T(N,ie,Z,te){t.Scroll.scroll(N,ie,Z,function(){var Se=z(l.toIndex(d()));le(h?Zn(Se,S):Se),te&&te()})}function j(N){var ie=f;if(Yn(N)){var Z=N.match(/([+\-<>])(\d+)?/)||[],te=Z[1],Se=Z[2];te==="+"||te==="-"?ie=B(f+ +(""+te+(+Se||1)),f):te===">"?ie=Se?k(+Se):v(!0):te==="<"&&(ie=L(!0))}else ie=g?N:Pi(N,0,S);return ie}function E(N,ie){var Z=R||(I()?1:$),te=B(f+Z*(N?-1:1),f,!(R||I()));return te===-1&&m&&!bc(d(),c(!N),1)?N?0:S:ie?te:z(te)}function B(N,ie,Z){if(w()||I()){var te=O(N);te!==N&&(ie=N,N=te,Z=!1),N<0||N>S?!R&&(mr(0,N,ie,!0)||mr(S,ie,N,!0))?N=k(W(N)):g?N=Z?N<0?-(P%$||$):P:N:n.rewind?N=N<0?S:0:N=-1:Z&&N!==ie&&(N=k(W(ie)+(N<ie?-1:1)))}else N=-1;return N}function O(N){if(m&&n.trimSpace==="move"&&N!==f)for(var ie=d();ie===u(N,!0)&&mr(N,0,e.length-1,!n.rewind);)N<f?--N:++N;return N}function z(N){return g?(N+P)%P||0:N}function ee(){for(var N=P-(I()||g&&R?1:$);h&&N-- >0;)if(u(P-1,!0)!==u(N,!0)){N++;break}return Pi(N,0,P-1)}function k(N){return Pi(I()?N:$*N,0,S)}function W(N){return I()?Zn(N,S):Sr((N>=S?P-1:N)/$)}function D(N){var ie=l.toIndex(N);return m?Pi(ie,0,S):ie}function le(N){N!==f&&(H=f,f=N)}function Y(N){return N?H:f}function I(){return!_o(n.focus)||n.isNavigation}function oe(){return e.state.is([Zi,Fo])&&!!n.waitForTransition}return{mount:x,go:F,scroll:T,getNext:v,getPrev:L,getAdjacent:E,getEnd:ee,setIndex:le,getIndex:Y,toIndex:k,toPage:W,toDest:D,hasFocus:I,isBusy:oe}}var mp="http://www.w3.org/2000/svg",gp="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",Ko=40;function hp(e,t,n){var i=Xt(e),o=i.on,r=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,w=u.arrows,b=u.track,h=w,g=u.prev,m=u.next,v,L,f={};function S(){P(),o(sn,H)}function H(){R(),S()}function P(){var T=n.arrows;T&&!(g&&m)&&A(),g&&m&&(Co(f,{prev:g,next:m}),To(h,T?"":"none"),In(h,L=ps+"--"+n.direction),T&&($(),F(),St([g,m],Do,b.id),l(Pc,g,m)))}function R(){i.destroy(),Fn(h,L),v?(vi(w?[g,m]:h),g=m=null):Pn([g,m],us)}function $(){o([ti,Ji,Qt,wi,$r],F),r(m,"click",Vt(x,">")),r(g,"click",Vt(x,"<"))}function x(T){p.go(T,!0)}function A(){h=w||Fi("div",d.arrows),g=y(!0),m=y(!1),v=!0,No(h,[g,m]),!w&&Qa(h,b)}function y(T){var j='<button class="'+d.arrow+" "+(T?d.prev:d.next)+'" type="button"><svg xmlns="'+mp+'" viewBox="0 0 '+Ko+" "+Ko+'" width="'+Ko+'" height="'+Ko+'" focusable="false"><path d="'+(n.arrowPath||gp)+'" />';return vc(j)}function F(){if(g&&m){var T=e.index,j=p.getPrev(),E=p.getNext(),B=j>-1&&T<j?c.last:c.prev,O=E>-1&&T>E?c.first:c.next;g.disabled=j<0,m.disabled=E<0,St(g,yn,B),St(m,yn,O),l(Mc,g,m,j,E)}}return{arrows:f,mount:S,destroy:R,update:F}}var fp=ts+"-interval";function yp(e,t,n){var i=Xt(e),o=i.on,r=i.bind,l=i.emit,d=Ar(n.interval,e.go.bind(e,">"),$),c=d.isPaused,u=t.Elements,p=t.Elements,w=p.root,b=p.toggle,h=n.autoplay,g,m,v=h==="pause";function L(){h&&(f(),b&&St(b,Do,u.track.id),v||S(),R())}function f(){n.pauseOnHover&&r(w,"mouseenter mouseleave",function(A){g=A.type==="mouseenter",P()}),n.pauseOnFocus&&r(w,"focusin focusout",function(A){m=A.type==="focusin",P()}),b&&r(b,"click",function(){v?S():H(!0)}),o([On,kr,Qt],d.rewind),o(On,x)}function S(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),m=g=v=!1,R(),l(as))}function H(A){A===void 0&&(A=!0),v=!!A,R(),c()||(d.pause(),l(ss))}function P(){v||(g||m?H(!1):S())}function R(){b&&(An(b,xi,!v),St(b,yn,n.i18n[v?"play":"pause"]))}function $(A){var y=u.bar;y&&wn(y,"width",A*100+"%"),l(Ac,A)}function x(A){var y=t.Slides.getAt(A);d.set(y&&+Sn(y.slide,fp)||n.interval)}return{mount:L,destroy:d.cancel,play:S,pause:H,isPaused:c}}function vp(e,t,n){var i=Xt(e),o=i.on;function r(){n.cover&&(o(ls,Vt(d,!0)),o([ti,sn,Qt],Vt(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Ho(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),To(u,c?"none":"")}return{mount:r,destroy:Vt(l,!1)}}var xp=10,bp=600,wp=.6,Sp=1.5,$p=800;function Cp(e,t,n){var i=Xt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,w=d.translate,b=e.is(Di),h,g,m=1;function v(){o(On,H),o([sn,Qt],P)}function L($,x,A,y,F){var T=c();if(H(),A&&(!b||!p())){var j=t.Layout.sliderSize(),E=Ea($)*j*Sr(cn($)/j)||0;$=d.toPosition(t.Controller.toDest($%j))+E}var B=bc(T,$,1);m=1,x=B?0:x||wr(cn($-T)/Sp,$p),g=y,h=Ar(x,f,Vt(S,T,$,F),1),l(Fo),r(kr),h.start()}function f(){l(Hi),g&&g(),r(wi)}function S($,x,A,y){var F=c(),T=$+(x-$)*R(y),j=(T-F)*m;w(F+j),b&&!A&&p()&&(m*=wp,cn(j)<xp&&L(u(p(!0)),bp,!1,g,!0))}function H(){h&&h.cancel()}function P(){h&&!h.isPaused()&&(H(),f())}function R($){var x=n.easingFunc;return x?x($):1-Math.pow(1-$,4)}return{mount:v,destroy:H,scroll:L,cancel:P}}var Mi={passive:!1,capture:!0};function Tp(e,t,n){var i=Xt(e),o=i.on,r=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,w=t.Controller,b=t.Elements.track,h=t.Media.reduce,g=t.Direction,m=g.resolve,v=g.orient,L=u.getPosition,f=u.exceededLimit,S,H,P,R,$,x=!1,A,y,F;function T(){l(b,Jr,Pa,Mi),l(b,Qr,Pa,Mi),l(b,Xc,E,Mi),l(b,"click",z,{capture:!0}),l(b,"dragstart",kn),o([ti,sn],j)}function j(){var V=n.drag;ae(!V),R=V==="free"}function E(V){if(A=!1,!y){var J=Se(V);te(V.target)&&(J||!V.button)&&(w.isBusy()?kn(V,!0):(F=J?b:window,$=c.is([Zi,Fo]),P=null,l(F,Jr,B,Mi),l(F,Qr,O,Mi),u.cancel(),p.cancel(),ee(V)))}}function B(V){if(c.is(ur)||(c.set(ur),r(Lc)),V.cancelable)if($){u.translate(S+Z(I(V)));var J=oe(V)>Bs,Q=x!==(x=f());(J||Q)&&ee(V),A=!0,r(Rc),kn(V)}else D(V)&&($=W(V),kn(V))}function O(V){c.is(ur)&&(c.set(Hi),r(Ic)),$&&(k(V),kn(V)),d(F,Jr,B),d(F,Qr,O),$=!1}function z(V){!y&&A&&kn(V,!0)}function ee(V){P=H,H=V,S=L()}function k(V){var J=le(V),Q=Y(J),Me=n.rewind&&n.rewindByDrag;h(!1),R?w.scroll(Q,0,n.snap):e.is(jo)?w.go(v(Ea(J))<0?Me?"<":"-":Me?">":"+"):e.is(Di)&&x&&Me?w.go(f(!0)?">":"<"):w.go(w.toDest(Q),!0),h(!0)}function W(V){var J=n.dragMinThreshold,Q=wo(J),Me=Q&&J.mouse||0,be=(Q?J.touch:+J)||10;return cn(I(V))>(Se(V)?be:Me)}function D(V){return cn(I(V))>cn(I(V,!0))}function le(V){if(e.is(Qi)||!x){var J=oe(V);if(J&&J<Bs)return I(V)/J}return 0}function Y(V){return L()+Ea(V)*Zn(cn(V)*(n.flickPower||600),R?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function I(V,J){return ie(V,J)-ie(N(V),J)}function oe(V){return Ma(V)-Ma(N(V))}function N(V){return H===V&&P||H}function ie(V,J){return(Se(V)?V.changedTouches[0]:V)["page"+m(J?"Y":"X")]}function Z(V){return V/(x&&e.is(Di)?op:1)}function te(V){var J=n.noDrag;return!So(V,"."+zc+", ."+Or)&&(!J||!So(V,J))}function Se(V){return typeof TouchEvent<"u"&&V instanceof TouchEvent}function se(){return $}function ae(V){y=V}return{mount:T,disable:ae,isDragging:se}}var Lp={Spacebar:" ",Right:Wr,Left:_r,Up:Wc,Down:Nc};function ms(e){return e=Yn(e)?e:e.key,Lp[e]||e}var zs="keydown";function Rp(e,t,n){var i=Xt(e),o=i.on,r=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function w(){b(),o(sn,h),o(sn,b),o(On,m)}function b(){var L=n.keyboard;L&&(u=L==="global"?window:d,r(u,zs,v))}function h(){l(u,zs)}function g(L){p=L}function m(){var L=p;p=!0,mc(function(){p=L})}function v(L){if(!p){var f=ms(L);f===c(_r)?e.go("<"):f===c(Wr)&&e.go(">")}}return{mount:w,destroy:h,disable:g}}var vo=ts+"-lazy",gr=vo+"-srcset",Ip="["+vo+"], ["+gr+"]";function Pp(e,t,n){var i=Xt(e),o=i.on,r=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[Ji,wi],p=[];function w(){n.lazyLoad&&(b(),o(Qt,b))}function b(){Hn(p),h(),c?L():(r(u),o(u,g),g())}function h(){t.Slides.forEach(function(f){es(f.slide,Ip).forEach(function(S){var H=Sn(S,vo),P=Sn(S,gr);if(H!==S.src||P!==S.srcset){var R=n.classes.spinner,$=S.parentElement,x=Ho($,"."+R)||Fi("span",R,$);p.push([S,f,x]),S.src||To(S,"none")}})})}function g(){p=p.filter(function(f){var S=n.perPage*((n.preloadPages||1)+1)-1;return f[1].isWithin(e.index,S)?m(f):!0}),p.length||r(u)}function m(f){var S=f[0];In(f[1].slide,_a),l(S,"load error",Vt(v,f)),St(S,"src",Sn(S,vo)),St(S,"srcset",Sn(S,gr)),Pn(S,vo),Pn(S,gr)}function v(f,S){var H=f[0],P=f[1];Fn(P.slide,_a),S.type!=="error"&&(vi(f[2]),To(H,""),d(ls,H,P),d(Oi)),c&&L()}function L(){p.length&&m(p.shift())}return{mount:w,destroy:Vt(Hn,p),check:g}}function Mp(e,t,n){var i=Xt(e),o=i.on,r=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,w=u.getIndex,b=u.go,h=t.Direction.resolve,g=c.pagination,m=[],v,L;function f(){S(),o([sn,Qt,$r],f);var y=n.pagination;g&&To(g,y?"":"none"),y&&(o([On,kr,wi],A),H(),A(),r(Ec,{list:v,items:m},x(e.index)))}function S(){v&&(vi(g?ei(v.children):v),Fn(v,L),Hn(m),v=null),i.destroy()}function H(){var y=e.length,F=n.classes,T=n.i18n,j=n.perPage,E=p()?u.getEnd()+1:Lo(y/j);v=g||Fi("ul",F.pagination,c.track.parentElement),In(v,L=Dr+"--"+$()),St(v,_n,"tablist"),St(v,yn,T.select),St(v,ds,$()===Nr?"vertical":"");for(var B=0;B<E;B++){var O=Fi("li",null,v),z=Fi("button",{class:F.page,type:"button"},O),ee=d.getIn(B).map(function(W){return W.slide.id}),k=!p()&&j>1?T.pageX:T.slideX;l(z,"click",Vt(P,B)),n.paginationKeyboard&&l(z,"keydown",Vt(R,B)),St(O,_n,"presentation"),St(z,_n,"tab"),St(z,Do,ee.join(" ")),St(z,yn,ka(k,B+1)),St(z,_i,-1),m.push({li:O,button:z,page:B})}}function P(y){b(">"+y,!0)}function R(y,F){var T=m.length,j=ms(F),E=$(),B=-1;j===h(Wr,!1,E)?B=++y%T:j===h(_r,!1,E)?B=(--y+T)%T:j==="Home"?B=0:j==="End"&&(B=T-1);var O=m[B];O&&(yc(O.button),b(">"+B),kn(F,!0))}function $(){return n.paginationDirection||n.direction}function x(y){return m[u.toPage(y)]}function A(){var y=x(w(!0)),F=x(w());if(y){var T=y.button;Fn(T,xi),Pn(T,Ns),St(T,_i,-1)}if(F){var j=F.button;In(j,xi),St(j,Ns,!0),St(j,_i,"")}r(kc,{list:v,items:m},y,F)}return{items:m,mount:f,destroy:S,getAt:x,update:A}}var Ep=[" ","Enter"];function kp(e,t,n){var i=n.isNavigation,o=n.slideFocus,r=[];function l(){e.splides.forEach(function(g){g.isParent||(u(e,g.splide),u(g.splide,e))}),i&&p()}function d(){r.forEach(function(g){g.destroy()}),Hn(r)}function c(){d(),l()}function u(g,m){var v=Xt(g);v.on(On,function(L,f,S){m.go(m.is(Qi)?S:L)}),r.push(v)}function p(){var g=Xt(e),m=g.on;m(is,b),m(Fc,h),m([ti,sn],w),r.push(g),g.emit(rs,e.splides)}function w(){St(t.Elements.list,ds,n.direction===Nr?"vertical":"")}function b(g){e.go(g.index)}function h(g,m){Ja(Ep,ms(m))&&(b(g),kn(m))}return{setup:Vt(t.Media.set,{slideFocus:_o(o)?i:o},!0),mount:l,destroy:d,remount:c}}function Ap(e,t,n){var i=Xt(e),o=i.bind,r=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,Mi)}function d(u){if(u.cancelable){var p=u.deltaY,w=p<0,b=Ma(u),h=n.wheelMinThreshold||0,g=n.wheelSleep||0;cn(p)>h&&b-r>g&&(e.go(w?"<":">"),r=b),c(w)&&kn(u)}}function c(u){return!n.releaseWheel||e.state.is(Zi)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var Fp=90;function _p(e,t,n){var i=Xt(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,d=Fi("span",Qu),c=Ar(Fp,Vt(p,!1));function u(){l&&(b(!t.Autoplay.isPaused()),St(r,Ds,!0),d.textContent="…",o(as,Vt(b,!0)),o(ss,Vt(b,!1)),o([Ji,wi],Vt(p,!0)))}function p(h){St(r,Os,h),h?(No(r,d),c.start()):(vi(d),c.cancel())}function w(){Pn(r,[Hs,Ds,Os]),vi(d)}function b(h){l&&St(r,Hs,h?"off":"polite")}return{mount:u,disable:b,destroy:w}}var Wp=Object.freeze({__proto__:null,Media:Vu,Direction:Gu,Elements:rp,Slides:sp,Layout:lp,Clones:dp,Move:up,Controller:pp,Arrows:hp,Autoplay:yp,Cover:vp,Scroll:Cp,Drag:Tp,Keyboard:Rp,LazyLoad:Pp,Pagination:Mp,Sync:kp,Wheel:Ap,Live:_p}),Np={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"},Hp={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:np,i18n:Np,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Op(e,t,n){var i=t.Slides;function o(){Xt(e).on([ti,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),mc(c)}return{mount:o,start:l,cancel:Pa}}function Dp(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,d=Vt(wn,l,"transition"),c;function u(){Xt(e).bind(l,"transitionend",function(h){h.target===l&&c&&(w(),c())})}function p(h,g){var m=i.toPosition(h,!0),v=i.getPosition(),L=b(h);cn(m-v)>=1&&L>=1?n.useScroll?r.scroll(m,L,!1,g):(d("transform "+L+"ms "+n.easing),i.translate(m,!0),c=g):(i.jump(h),g())}function w(){d(""),r.cancel()}function b(h){var g=n.rewindSpeed;if(e.is(Di)&&g){var m=o.getIndex(!0),v=o.getEnd();if(m===0&&h>=v||m>=v&&h===0)return g}return n.speed}return{mount:u,start:p,cancel:w}}var jp=(function(){function e(n,i){this.event=Xt(),this.Components={},this.state=Bu(Ai),this.splides=[],this._o={},this._E={};var o=Yn(n)?xc(document,n):n;yo(o,o+" is invalid."),this.root=o,i=Un({label:Sn(o,yn)||"",labelledby:Sn(o,cs)||""},Hp,e.defaults,i||{});try{Un(i,JSON.parse(Sn(o,ts)))}catch{yo(!1,"Invalid JSON")}this._o=Object.create(Un({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,d=this.Components;yo(l.is([Ai,br]),"Already mounted!"),l.set(Ai),this._C=d,this._T=o||this._T||(this.is(jo)?Op:Dp),this._E=i||this._E;var c=Co({},Wp,this._E,{Transition:this._T});return fi(c,function(u,p){var w=u(r,d,r._o);d[p]=w,w.setup&&w.setup()}),fi(d,function(u){u.mount&&u.mount()}),this.emit(ti),In(this.root,ep),l.set(Hi),this.emit(Aa),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Hi)&&(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(ei(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(Ai)?Xt(this).on(Aa,this.destroy.bind(this,i)):(fi(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(os),o.destroy(),i&&Hn(this.splides),r.set(br)),this},Nu(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})(),gs=jp;gs.defaults={};gs.STATES=Ou;var Vs=[[ti,"onMounted"],[Aa,"onReady"],[On,"onMove"],[Ji,"onMoved"],[is,"onClick"],[Sc,"onActive"],[$c,"onInactive"],[Cc,"onVisible"],[Tc,"onHidden"],[Qt,"onRefresh"],[sn,"onUpdated"],[Oi,"onResize"],[Er,"onResized"],[Lc,"onDrag"],[Rc,"onDragging"],[Ic,"onDragged"],[kr,"onScroll"],[wi,"onScrolled"],[os,"onDestroy"],[Pc,"onArrowsMounted"],[Mc,"onArrowsUpdated"],[Ec,"onPaginationMounted"],[kc,"onPaginationUpdated"],[rs,"onNavigationMounted"],[as,"onAutoplayPlay"],[Ac,"onAutoplayPlaying"],[ss,"onAutoplayPause"],[ls,"onLazyLoadLoaded"]];function hs(...e){return e.filter(Boolean).join(" ")}function Cr(e){return e!==null&&typeof e=="object"}function Wa(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!Wa(n,t[i]));if(Cr(e)&&Cr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Wa(e[o],t[o]))}return e===t}function Bp(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function zp(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 Na(e,t){const n=e;return zp(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Cr(i)?n[o]=Na(Cr(n[o])?n[o]:{},i):n[o]=i}),n}var Vp=({children:e,className:t,...n})=>s.createElement("div",{className:hs("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),fs=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 gs(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Na({},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&&!Wa(this.options,e)&&(this.splide.options=e,this.options=Na({},e));const t=this.getSlides();Bp(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){Vs.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:hs("splide",e),ref:this.splideRef,...this.omit(o,["options",...Vs.map(r=>r[1])])},n?s.createElement(Vp,null,i):i)}},ys=({children:e,className:t,...n})=>s.createElement("li",{className:hs("splide__slide",t),...n},e);/*!
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),rt=require("classnames"),_=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Dn=require("react-dom");function Ud(e){return e.type==="object"&&e.version===1}const qd="ControlSlider-module__wrapper___sHEkd",Xd="ControlSlider-module__hoverArrow___A-dOH",Kd="ControlSlider-module__sliderItem___QQSkR",Yd="ControlSlider-module__sliderImage___9hRl-",Zd="ControlSlider-module__arrow___05ghY",Jd="ControlSlider-module__arrowVertical___tBfVN",Qd="ControlSlider-module__nextArrow___-30Yc",eu="ControlSlider-module__arrowInner___aEra3",tu="ControlSlider-module__arrowIcon___S4ztF",nu="ControlSlider-module__arrowImg___2dwJW",iu="ControlSlider-module__mirror___brd6U",ou="ControlSlider-module__pagination___bicLF",ru="ControlSlider-module__paginationInner___bT-P-",au="ControlSlider-module__paginationVertical___zYqKw",su="ControlSlider-module__paginationItem___nTRbk",lu="ControlSlider-module__dot___p1Qun",cu="ControlSlider-module__activeDot___LHFaj",du="ControlSlider-module__paginationInsideBottom___R3FWn",uu="ControlSlider-module__paginationInsideTop___V-qb-",pu="ControlSlider-module__paginationOutsideBottom___14w8D",mu="ControlSlider-module__paginationOutsideTop___SCLqB",gu="ControlSlider-module__paginationInsideLeft___yOBRZ",hu="ControlSlider-module__paginationInsideRight___Rtt3o",fu="ControlSlider-module__paginationOutsideLeft___lahaw",yu="ControlSlider-module__paginationOutsideRight___EtuQa",vu="ControlSlider-module__imgWrapper___UjEgB",xu="ControlSlider-module__captionBlock___dJ6-j",bu="ControlSlider-module__captionTextWrapper___HFlpf",wu="ControlSlider-module__captionText___uGBVc",Su="ControlSlider-module__active___WZK4G",$u="ControlSlider-module__withPointerEvents___t-18M",Cu="ControlSlider-module__topLeftAlignment___zjnGM",Tu="ControlSlider-module__topCenterAlignment___gD1xW",Lu="ControlSlider-module__topRightAlignment___NMapS",Ru="ControlSlider-module__middleLeftAlignment___OnUrY",Iu="ControlSlider-module__middleCenterAlignment___Tdkl0",Pu="ControlSlider-module__middleRightAlignment___wEbfX",Mu="ControlSlider-module__bottomLeftAlignment___cTP2-",Eu="ControlSlider-module__bottomCenterAlignment___c54fB",ku="ControlSlider-module__bottomRightAlignment___kEwrz",Au="ControlSlider-module__clickOverlay___DZA28",Fu="ControlSlider-module__contain___pLyq7",_u="ControlSlider-module__cover___KdDat",it={wrapper:qd,hoverArrow:Xd,sliderItem:Kd,sliderImage:Yd,arrow:Zd,arrowVertical:Jd,nextArrow:Qd,arrowInner:eu,arrowIcon:tu,arrowImg:nu,mirror:iu,pagination:ou,paginationInner:ru,paginationVertical:au,paginationItem:su,dot:lu,activeDot:cu,paginationInsideBottom:du,paginationInsideTop:uu,paginationOutsideBottom:pu,paginationOutsideTop:mu,paginationInsideLeft:gu,paginationInsideRight:hu,paginationOutsideLeft:fu,paginationOutsideRight:yu,imgWrapper:vu,captionBlock:xu,captionTextWrapper:bu,captionText:wu,active:Su,withPointerEvents:$u,topLeftAlignment:Cu,topCenterAlignment:Tu,topRightAlignment:Lu,middleLeftAlignment:Ru,middleCenterAlignment:Iu,middleRightAlignment:Pu,bottomLeftAlignment:Mu,bottomCenterAlignment:Eu,bottomRightAlignment:ku,clickOverlay:Au,contain:Fu,cover:_u};function Wu(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 Nu(e,t,n){return t&&Wu(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Es="(prefers-reduced-motion: reduce)",Ai=1,Hu=2,Hi=3,Zi=4,Fo=5,ur=6,br=7,Ou={CREATED:Ai,MOUNTED:Hu,IDLE:Hi,MOVING:Zi,SCROLLING:Fo,DRAGGING:ur,DESTROYED:br};function Hn(e){e.length=0}function ei(e,t,n){return Array.prototype.slice.call(e,t,n)}function Vt(e){return e.bind.apply(e,[null].concat(ei(arguments,1)))}var mc=setTimeout,Pa=function(){};function ks(e){return requestAnimationFrame(e)}function Mr(e,t){return typeof t===e}function wo(e){return!Za(e)&&Mr("object",e)}var Ya=Array.isArray,gc=Vt(Mr,"function"),Yn=Vt(Mr,"string"),_o=Vt(Mr,"undefined");function Za(e){return e===null}function hc(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Wo(e){return Ya(e)?e:[e]}function xn(e,t){Wo(e).forEach(t)}function Ja(e,t){return e.indexOf(t)>-1}function pr(e,t){return e.push.apply(e,Wo(t)),e}function An(e,t,n){e&&xn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function In(e,t){An(e,Yn(t)?t.split(" "):t,!0)}function No(e,t){xn(t,e.appendChild.bind(e))}function Qa(e,t){xn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function So(e,t){return hc(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function fc(e,t){var n=e?ei(e.children):[];return t?n.filter(function(i){return So(i,t)}):n}function Ho(e,t){return t?fc(e,t)[0]:e.firstElementChild}var $o=Object.keys;function fi(e,t,n){return e&&(n?$o(e).reverse():$o(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function Co(e){return ei(arguments,1).forEach(function(t){fi(t,function(n,i){e[i]=t[i]})}),e}function Un(e){return ei(arguments,1).forEach(function(t){fi(t,function(n,i){Ya(n)?e[i]=n.slice():wo(n)?e[i]=Un({},wo(e[i])?e[i]:{},n):e[i]=n})}),e}function As(e,t){xn(t||$o(e),function(n){delete e[n]})}function Pn(e,t){xn(e,function(n){xn(t,function(i){n&&n.removeAttribute(i)})})}function St(e,t,n){wo(t)?fi(t,function(i,o){St(e,o,i)}):xn(e,function(i){Za(n)||n===""?Pn(i,t):i.setAttribute(t,String(n))})}function Fi(e,t,n){var i=document.createElement(e);return t&&(Yn(t)?In(i,t):St(i,t)),n&&No(n,i),i}function wn(e,t,n){if(_o(n))return getComputedStyle(e)[t];Za(n)||(e.style[t]=""+n)}function To(e,t){wn(e,"display",t)}function yc(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Sn(e,t){return e.getAttribute(t)}function Fs(e,t){return e&&e.classList.contains(t)}function hn(e){return e.getBoundingClientRect()}function vi(e){xn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function vc(e){return Ho(new DOMParser().parseFromString(e,"text/html").body)}function kn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function xc(e,t){return e&&e.querySelector(t)}function es(e,t){return t?ei(e.querySelectorAll(t)):[]}function Fn(e,t){An(e,t,!1)}function Ma(e){return e.timeStamp}function ai(e){return Yn(e)?e:e?e+"px":""}var Oo="splide",ts="data-"+Oo;function yo(e,t){if(!e)throw new Error("["+Oo+"] "+(t||""))}var Zn=Math.min,wr=Math.max,Sr=Math.floor,Lo=Math.ceil,cn=Math.abs;function bc(e,t,n){return cn(e-t)<n}function mr(e,t,n,i){var o=Zn(t,n),r=wr(t,n);return i?o<e&&e<r:o<=e&&e<=r}function Pi(e,t,n){var i=Zn(t,n),o=wr(t,n);return Zn(wr(i,e),o)}function Ea(e){return+(e>0)-+(e<0)}function ka(e,t){return xn(t,function(n){e=e.replace("%s",""+n)}),e}function ns(e){return e<10?"0"+e:""+e}var _s={};function Du(e){return""+e+ns(_s[e]=(_s[e]||0)+1)}function wc(){var e=[];function t(l,d,c,u){o(l,d,function(p,w,b){var h="addEventListener"in p,g=h?p.removeEventListener.bind(p,w,c,u):p.removeListener.bind(p,c);h?p.addEventListener(w,c,u):p.addListener(c),e.push([p,w,b,c,g])})}function n(l,d,c){o(l,d,function(u,p,w){e=e.filter(function(b){return b[0]===u&&b[1]===p&&b[2]===w&&(!c||b[3]===c)?(b[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){xn(l,function(u){u&&xn(d,function(p){p.split(" ").forEach(function(w){var b=w.split(".");c(u,b[0],b[1])})})})}function r(){e.forEach(function(l){l[4]()}),Hn(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var ti="mounted",Aa="ready",On="move",Ji="moved",is="click",Sc="active",$c="inactive",Cc="visible",Tc="hidden",Qt="refresh",sn="updated",Oi="resize",Er="resized",Lc="drag",Rc="dragging",Ic="dragged",kr="scroll",wi="scrolled",ju="overflow",os="destroy",Pc="arrows:mounted",Mc="arrows:updated",Ec="pagination:mounted",kc="pagination:updated",rs="navigation:mounted",as="autoplay:play",Ac="autoplay:playing",ss="autoplay:pause",ls="lazyload:loaded",Fc="sk",_c="sh",$r="ei";function Xt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=wc();function i(r,l){n.bind(t,Wo(r).join(" "),function(d){l.apply(l,Ya(d.detail)?d.detail:[])})}function o(r){n.dispatch(t,r,ei(arguments,1))}return e&&e.event.on(os,n.destroy),Co(n,{bus:t,on:i,off:Vt(n.unbind,t),emit:o})}function Ar(e,t,n,i){var o=Date.now,r,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?Zn((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return b();d=ks(p)}}function w(L){L||g(),r=o()-(L?l*e:0),c=!1,d=ks(p)}function b(){c=!0}function h(){r=o(),l=0,n&&n(l)}function g(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function m(L){e=L}function y(){return c}return{start:w,rewind:h,pause:b,cancel:g,set:m,isPaused:y}}function Bu(e){var t=e;function n(o){t=o}function i(o){return Ja(Wo(o),t)}return{set:n,is:i}}function zu(e,t){var n=Ar(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Vu(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=wc(),d=[];function c(){var g=n.mediaQuery==="min";$o(o).sort(function(m,y){return g?+m-+y:+y-+m}).forEach(function(m){p(o[m],"("+(g?"min":"max")+"-width:"+m+"px)")}),p(r,Es),w()}function u(g){g&&l.destroy()}function p(g,m){var y=matchMedia(m);l.bind(y,"change",w),d.push([g,y])}function w(){var g=i.is(br),m=n.direction,y=d.reduce(function(L,f){return Un(L,f[1].matches?f[0]:{})},{});As(n),h(y),n.destroy?e.destroy(n.destroy==="completely"):g?(u(!0),e.mount()):m!==n.direction&&e.refresh()}function b(g){matchMedia(Es).matches&&(g?Un(n,r):As(n,$o(r)))}function h(g,m,y){Un(n,g),m&&Un(Object.getPrototypeOf(n),g),(y||!i.is(Ai))&&e.emit(sn,n)}return{setup:c,destroy:u,reduce:b,set:h}}var Fr="Arrow",_r=Fr+"Left",Wr=Fr+"Right",Wc=Fr+"Up",Nc=Fr+"Down",Ws="rtl",Nr="ttb",Yr={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Wc,Wr],ArrowRight:[Nc,_r]};function Gu(e,t,n){function i(r,l,d){d=d||n.direction;var c=d===Ws&&!l?1:d===Nr?0:-1;return Yr[r]&&Yr[r][c]||r.replace(/width|left|right/i,function(u,p){var w=Yr[u.toLowerCase()][c]||u;return p>0?w.charAt(0).toUpperCase()+w.slice(1):w})}function o(r){return r*(n.direction===Ws?1:-1)}return{resolve:i,orient:o}}var _n="role",_i="tabindex",Uu="disabled",$n="aria-",Do=$n+"controls",Hc=$n+"current",Ns=$n+"selected",yn=$n+"label",cs=$n+"labelledby",Oc=$n+"hidden",ds=$n+"orientation",Ro=$n+"roledescription",Hs=$n+"live",Os=$n+"busy",Ds=$n+"atomic",us=[_n,_i,Uu,Do,Hc,yn,cs,Oc,ds,Ro],Mn=Oo+"__",ni="is-",Zr=Oo,js=Mn+"track",qu=Mn+"list",Hr=Mn+"slide",Dc=Hr+"--clone",Xu=Hr+"__container",ps=Mn+"arrows",Or=Mn+"arrow",jc=Or+"--prev",Bc=Or+"--next",Dr=Mn+"pagination",zc=Dr+"__page",Ku=Mn+"progress",Yu=Ku+"__bar",Zu=Mn+"toggle",Ju=Mn+"spinner",Qu=Mn+"sr",ep=ni+"initialized",xi=ni+"active",Vc=ni+"prev",Gc=ni+"next",Fa=ni+"visible",_a=ni+"loading",Uc=ni+"focus-in",qc=ni+"overflow",tp=[xi,Fa,Vc,Gc,_a,Uc,qc],np={slide:Hr,clone:Dc,arrows:ps,arrow:Or,prev:jc,next:Bc,pagination:Dr,page:zc,spinner:Ju};function ip(e,t){if(gc(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!So(n,t);)n=n.parentElement;return n}var op=5,Bs=200,Xc="touchstart mousedown",Jr="touchmove mousemove",Qr="touchend touchcancel mouseup click";function rp(e,t,n){var i=Xt(e),o=i.on,r=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],w=[],b,h,g;function m(){S(),H(),f()}function y(){o(Qt,L),o(Qt,m),o(sn,f),r(document,Xc+" keydown",function($){g=$.type==="keydown"},{capture:!0}),r(l,"focusin",function(){An(l,Uc,!!g)})}function L($){var x=us.concat("style");Hn(u),Fn(l,p),Fn(b,w),Pn([b,h],x),Pn(l,$?x:["style",Ro])}function f(){Fn(l,p),Fn(b,w),p=R(Zr),w=R(js),In(l,p),In(b,w),St(l,yn,n.label),St(l,cs,n.labelledby)}function S(){b=I("."+js),h=Ho(b,"."+qu),yo(b&&h,"A track/list element is missing."),pr(u,fc(h,"."+Hr+":not(."+Dc+")")),fi({arrows:ps,pagination:Dr,prev:jc,next:Bc,bar:Yu,toggle:Zu},function($,x){c[x]=I("."+$)}),Co(c,{root:l,track:b,list:h,slides:u})}function H(){var $=l.id||Du(Oo),x=n.role;l.id=$,b.id=b.id||$+"-track",h.id=h.id||$+"-list",!Sn(l,_n)&&l.tagName!=="SECTION"&&x&&St(l,_n,x),St(l,Ro,d.carousel),St(h,_n,"presentation")}function I($){var x=xc(l,$);return x&&ip(x,"."+Zr)===l?x:void 0}function R($){return[$+"--"+n.type,$+"--"+n.direction,n.drag&&$+"--draggable",n.isNavigation&&$+"--nav",$===Zr&&xi]}return Co(c,{setup:m,mount:y,destroy:L})}var Di="slide",Qi="loop",jo="fade";function ap(e,t,n,i){var o=Xt(e),r=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,w=p.isNavigation,b=p.updateOnMove,h=p.i18n,g=p.pagination,m=p.slideFocus,y=c.Direction.resolve,L=Sn(i,"style"),f=Sn(i,yn),S=n>-1,H=Ho(i,"."+Xu),I;function R(){S||(i.id=u.id+"-slide"+ns(t+1),St(i,_n,g?"tabpanel":"group"),St(i,Ro,h.slide),St(i,yn,f||ka(h.slideLabel,[t+1,e.length]))),$()}function $(){d(i,"click",Vt(l,is,ee)),d(i,"keydown",Vt(l,Fc,ee)),r([Ji,_c,wi],k),r(rs,A),b&&r(On,v)}function x(){I=!0,o.destroy(),Fn(i,tp),Pn(i,us),St(i,"style",L),St(i,yn,f||"")}function A(){var E=e.splides.map(function(N){var j=N.splide.Components.Slides.getAt(t);return j?j.slide.id:""}).join(" ");St(i,yn,ka(h.slideX,(S?n:t)+1)),St(i,Do,E),St(i,_n,m?"button":""),m&&Pn(i,Ro)}function v(){I||k()}function k(){if(!I){var E=e.index;T(),D(),An(i,Vc,t===E-1),An(i,Gc,t===E+1)}}function T(){var E=B();E!==Fs(i,xi)&&(An(i,xi,E),St(i,Hc,w&&E||""),l(E?Sc:$c,ee))}function D(){var E=O(),N=!E&&(!B()||S);if(e.state.is([Zi,Fo])||St(i,Oc,N||""),St(es(i,p.focusableNodes||""),_i,N?-1:""),m&&St(i,_i,N?-1:0),E!==Fs(i,Fa)&&(An(i,Fa,E),l(E?Cc:Tc,ee)),!E&&document.activeElement===i){var j=c.Slides.getAt(e.index);j&&yc(j.slide)}}function P(E,N,j){wn(j&&H||i,E,N)}function B(){var E=e.index;return E===t||p.cloneStatus&&E===n}function O(){if(e.is(jo))return B();var E=hn(c.Elements.track),N=hn(i),j=y("left",!0),le=y("right",!0);return Sr(E[j])<=Lo(N[j])&&Sr(N[le])<=Lo(E[le])}function V(E,N){var j=cn(E-t);return!S&&(p.rewind||e.is(Qi))&&(j=Zn(j,e.length-j)),j<=N}var ee={index:t,slideIndex:n,slide:i,container:H,isClone:S,mount:R,destroy:x,update:k,style:P,isWithin:V};return ee}function sp(e,t,n){var i=Xt(e),o=i.on,r=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function w(){b(),o(Qt,h),o(Qt,b)}function b(){c.forEach(function(k,T){m(k,T,-1)})}function h(){I(function(k){k.destroy()}),Hn(p)}function g(){I(function(k){k.update()})}function m(k,T,D){var P=ap(e,T,D,k);P.mount(),p.push(P),p.sort(function(B,O){return B.index-O.index})}function y(k){return k?R(function(T){return!T.isClone}):p}function L(k){var T=t.Controller,D=T.toIndex(k),P=T.hasFocus()?1:n.perPage;return R(function(B){return mr(B.index,D,D+P-1)})}function f(k){return R(k)[0]}function S(k,T){xn(k,function(D){if(Yn(D)&&(D=vc(D)),hc(D)){var P=c[T];P?Qa(D,P):No(u,D),In(D,n.classes.slide),x(D,Vt(r,Oi))}}),r(Qt)}function H(k){vi(R(k).map(function(T){return T.slide})),r(Qt)}function I(k,T){y(T).forEach(k)}function R(k){return p.filter(gc(k)?k:function(T){return Yn(k)?So(T.slide,k):Ja(Wo(k),T.index)})}function $(k,T,D){I(function(P){P.style(k,T,D)})}function x(k,T){var D=es(k,"img"),P=D.length;P?D.forEach(function(B){l(B,"load error",function(){--P||T()})}):T()}function A(k){return k?c.length:p.length}function v(){return p.length>n.perPage}return{mount:w,destroy:h,update:g,register:m,get:y,getIn:L,getAt:f,add:S,remove:H,forEach:I,filter:R,style:$,getLength:A,isEnough:v}}function lp(e,t,n){var i=Xt(e),o=i.on,r=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,w=u.track,b=u.list,h=d.getAt,g=d.style,m,y,L;function f(){S(),r(window,"resize load",zu(Vt(l,Oi))),o([sn,Qt],S),o(Oi,H)}function S(){m=n.direction===Nr,wn(p,"maxWidth",ai(n.width)),wn(w,c("paddingLeft"),I(!1)),wn(w,c("paddingRight"),I(!0)),H(!0)}function H(ee){var E=hn(p);(ee||y.width!==E.width||y.height!==E.height)&&(wn(w,"height",R()),g(c("marginRight"),ai(n.gap)),g("width",x()),g("height",A(),!0),y=E,l(Er),L!==(L=V())&&(An(p,qc,L),l(ju,L)))}function I(ee){var E=n.padding,N=c(ee?"right":"left");return E&&ai(E[N]||(wo(E)?0:E))||"0px"}function R(){var ee="";return m&&(ee=$(),yo(ee,"height or heightRatio is missing."),ee="calc("+ee+" - "+I(!1)+" - "+I(!0)+")"),ee}function $(){return ai(n.height||hn(b).width*n.heightRatio)}function x(){return n.autoWidth?null:ai(n.fixedWidth)||(m?"":v())}function A(){return ai(n.fixedHeight)||(m?n.autoHeight?null:v():$())}function v(){var ee=ai(n.gap);return"calc((100%"+(ee&&" + "+ee)+")/"+(n.perPage||1)+(ee&&" - "+ee)+")"}function k(){return hn(b)[c("width")]}function T(ee,E){var N=h(ee||0);return N?hn(N.slide)[c("width")]+(E?0:B()):0}function D(ee,E){var N=h(ee);if(N){var j=hn(N.slide)[c("right")],le=hn(b)[c("left")];return cn(j-le)+(E?0:B())}return 0}function P(ee){return D(e.length-1)-D(0)+T(0,ee)}function B(){var ee=h(0);return ee&&parseFloat(wn(ee.slide,c("marginRight")))||0}function O(ee){return parseFloat(wn(w,c("padding"+(ee?"Right":"Left"))))||0}function V(){return e.is(jo)||P(!0)>k()}return{mount:f,resize:H,listSize:k,slideSize:T,sliderSize:P,totalSize:D,getPadding:O,isOverflow:V}}var cp=2;function dp(e,t,n){var i=Xt(e),o=i.on,r=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(Qt,w),o([sn,Oi],h),(u=y())&&(g(u),t.Layout.resize(!0))}function w(){b(),p()}function b(){vi(c),Hn(c),i.destroy()}function h(){var L=y();u!==L&&(u<L||!L)&&i.emit(Qt)}function g(L){var f=l.get().slice(),S=f.length;if(S){for(;f.length<L;)pr(f,f);pr(f.slice(-L),f.slice(0,L)).forEach(function(H,I){var R=I<L,$=m(H.slide,I);R?Qa($,f[0].slide):No(r.list,$),pr(c,$),l.register($,I-L+(R?0:S),H.index)})}}function m(L,f){var S=L.cloneNode(!0);return In(S,n.classes.clone),S.id=e.root.id+"-clone"+ns(f+1),S}function y(){var L=n.clones;if(!e.is(Qi))L=0;else if(_o(L)){var f=n[d("fixedWidth")]&&t.Layout.slideSize(0),S=f&&Lo(hn(r.track)[d("width")]/f);L=S||n[d("autoWidth")]&&e.length||n.perPage*cp}return L}return{mount:p,destroy:b}}function up(e,t,n){var i=Xt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,w=d.listSize,b=d.sliderSize,h=t.Direction,g=h.resolve,m=h.orient,y=t.Elements,L=y.list,f=y.track,S;function H(){S=t.Transition,o([ti,Er,sn,Qt],I)}function I(){t.Controller.isBusy()||(t.Scroll.cancel(),$(e.index),t.Slides.update())}function R(N,j,le,ie){N!==j&&ee(N>le)&&(k(),x(v(P(),N>le),!0)),l(Zi),r(On,j,le,N),S.start(j,function(){l(Hi),r(Ji,j,le,N),ie&&ie()})}function $(N){x(D(N,!0))}function x(N,j){if(!e.is(jo)){var le=j?N:A(N);wn(L,"transform","translate"+g("X")+"("+le+"px)"),N!==le&&r(_c)}}function A(N){if(e.is(Qi)){var j=T(N),le=j>t.Controller.getEnd(),ie=j<0;(ie||le)&&(N=v(N,le))}return N}function v(N,j){var le=N-V(j),ie=b();return N-=m(ie*(Lo(cn(le)/ie)||1))*(j?1:-1),N}function k(){x(P(),!0),S.cancel()}function T(N){for(var j=t.Slides.get(),le=0,ie=1/0,W=0;W<j.length;W++){var ae=j[W].index,F=cn(D(ae,!0)-N);if(F<=ie)ie=F,le=ae;else break}return le}function D(N,j){var le=m(p(N-1)-O(N));return j?B(le):le}function P(){var N=g("left");return hn(L)[N]-hn(f)[N]+m(u(!1))}function B(N){return n.trimSpace&&e.is(Di)&&(N=Pi(N,0,m(b(!0)-w()))),N}function O(N){var j=n.focus;return j==="center"?(w()-c(N,!0))/2:+j*c(N)||0}function V(N){return D(N?t.Controller.getEnd():0,!!n.trimSpace)}function ee(N){var j=m(v(P(),N));return N?j>=0:j<=L[g("scrollWidth")]-hn(f)[g("width")]}function E(N,j){j=_o(j)?P():j;var le=N!==!0&&m(j)<m(V(!1)),ie=N!==!1&&m(j)>m(V(!0));return le||ie}return{mount:H,move:R,jump:$,translate:x,shift:v,cancel:k,toIndex:T,toPosition:D,getPosition:P,getLimit:V,exceededLimit:E,reposition:I}}function pp(e,t,n){var i=Xt(e),o=i.on,r=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,w=p.isEnough,b=p.getLength,h=n.omitEnd,g=e.is(Qi),m=e.is(Di),y=Vt(P,!1),L=Vt(P,!0),f=n.start||0,S,H=f,I,R,$;function x(){A(),o([sn,Qt,$r],A),o(Er,v)}function A(){I=b(!0),R=n.perMove,$=n.perPage,S=ee();var F=Pi(f,0,h?S:I-1);F!==f&&(f=F,l.reposition())}function v(){S!==ee()&&r($r)}function k(F,J,Y){if(!ae()){var Z=D(F),ye=V(Z);ye>-1&&(J||ye!==f)&&(le(ye),l.move(Z,ye,H,Y))}}function T(F,J,Y,Z){t.Scroll.scroll(F,J,Y,function(){var ye=V(l.toIndex(d()));le(h?Zn(ye,S):ye),Z&&Z()})}function D(F){var J=f;if(Yn(F)){var Y=F.match(/([+\-<>])(\d+)?/)||[],Z=Y[1],ye=Y[2];Z==="+"||Z==="-"?J=B(f+ +(""+Z+(+ye||1)),f):Z===">"?J=ye?E(+ye):y(!0):Z==="<"&&(J=L(!0))}else J=g?F:Pi(F,0,S);return J}function P(F,J){var Y=R||(W()?1:$),Z=B(f+Y*(F?-1:1),f,!(R||W()));return Z===-1&&m&&!bc(d(),c(!F),1)?F?0:S:J?Z:V(Z)}function B(F,J,Y){if(w()||W()){var Z=O(F);Z!==F&&(J=F,F=Z,Y=!1),F<0||F>S?!R&&(mr(0,F,J,!0)||mr(S,J,F,!0))?F=E(N(F)):g?F=Y?F<0?-(I%$||$):I:F:n.rewind?F=F<0?S:0:F=-1:Y&&F!==J&&(F=E(N(J)+(F<J?-1:1)))}else F=-1;return F}function O(F){if(m&&n.trimSpace==="move"&&F!==f)for(var J=d();J===u(F,!0)&&mr(F,0,e.length-1,!n.rewind);)F<f?--F:++F;return F}function V(F){return g?(F+I)%I||0:F}function ee(){for(var F=I-(W()||g&&R?1:$);h&&F-- >0;)if(u(I-1,!0)!==u(F,!0)){F++;break}return Pi(F,0,I-1)}function E(F){return Pi(W()?F:$*F,0,S)}function N(F){return W()?Zn(F,S):Sr((F>=S?I-1:F)/$)}function j(F){var J=l.toIndex(F);return m?Pi(J,0,S):J}function le(F){F!==f&&(H=f,f=F)}function ie(F){return F?H:f}function W(){return!_o(n.focus)||n.isNavigation}function ae(){return e.state.is([Zi,Fo])&&!!n.waitForTransition}return{mount:x,go:k,scroll:T,getNext:y,getPrev:L,getAdjacent:P,getEnd:ee,setIndex:le,getIndex:ie,toIndex:E,toPage:N,toDest:j,hasFocus:W,isBusy:ae}}var mp="http://www.w3.org/2000/svg",gp="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",Ko=40;function hp(e,t,n){var i=Xt(e),o=i.on,r=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,w=u.arrows,b=u.track,h=w,g=u.prev,m=u.next,y,L,f={};function S(){I(),o(sn,H)}function H(){R(),S()}function I(){var T=n.arrows;T&&!(g&&m)&&A(),g&&m&&(Co(f,{prev:g,next:m}),To(h,T?"":"none"),In(h,L=ps+"--"+n.direction),T&&($(),k(),St([g,m],Do,b.id),l(Pc,g,m)))}function R(){i.destroy(),Fn(h,L),y?(vi(w?[g,m]:h),g=m=null):Pn([g,m],us)}function $(){o([ti,Ji,Qt,wi,$r],k),r(m,"click",Vt(x,">")),r(g,"click",Vt(x,"<"))}function x(T){p.go(T,!0)}function A(){h=w||Fi("div",d.arrows),g=v(!0),m=v(!1),y=!0,No(h,[g,m]),!w&&Qa(h,b)}function v(T){var D='<button class="'+d.arrow+" "+(T?d.prev:d.next)+'" type="button"><svg xmlns="'+mp+'" viewBox="0 0 '+Ko+" "+Ko+'" width="'+Ko+'" height="'+Ko+'" focusable="false"><path d="'+(n.arrowPath||gp)+'" />';return vc(D)}function k(){if(g&&m){var T=e.index,D=p.getPrev(),P=p.getNext(),B=D>-1&&T<D?c.last:c.prev,O=P>-1&&T>P?c.first:c.next;g.disabled=D<0,m.disabled=P<0,St(g,yn,B),St(m,yn,O),l(Mc,g,m,D,P)}}return{arrows:f,mount:S,destroy:R,update:k}}var fp=ts+"-interval";function yp(e,t,n){var i=Xt(e),o=i.on,r=i.bind,l=i.emit,d=Ar(n.interval,e.go.bind(e,">"),$),c=d.isPaused,u=t.Elements,p=t.Elements,w=p.root,b=p.toggle,h=n.autoplay,g,m,y=h==="pause";function L(){h&&(f(),b&&St(b,Do,u.track.id),y||S(),R())}function f(){n.pauseOnHover&&r(w,"mouseenter mouseleave",function(A){g=A.type==="mouseenter",I()}),n.pauseOnFocus&&r(w,"focusin focusout",function(A){m=A.type==="focusin",I()}),b&&r(b,"click",function(){y?S():H(!0)}),o([On,kr,Qt],d.rewind),o(On,x)}function S(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),m=g=y=!1,R(),l(as))}function H(A){A===void 0&&(A=!0),y=!!A,R(),c()||(d.pause(),l(ss))}function I(){y||(g||m?H(!1):S())}function R(){b&&(An(b,xi,!y),St(b,yn,n.i18n[y?"play":"pause"]))}function $(A){var v=u.bar;v&&wn(v,"width",A*100+"%"),l(Ac,A)}function x(A){var v=t.Slides.getAt(A);d.set(v&&+Sn(v.slide,fp)||n.interval)}return{mount:L,destroy:d.cancel,play:S,pause:H,isPaused:c}}function vp(e,t,n){var i=Xt(e),o=i.on;function r(){n.cover&&(o(ls,Vt(d,!0)),o([ti,sn,Qt],Vt(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Ho(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),To(u,c?"none":"")}return{mount:r,destroy:Vt(l,!1)}}var xp=10,bp=600,wp=.6,Sp=1.5,$p=800;function Cp(e,t,n){var i=Xt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,w=d.translate,b=e.is(Di),h,g,m=1;function y(){o(On,H),o([sn,Qt],I)}function L($,x,A,v,k){var T=c();if(H(),A&&(!b||!p())){var D=t.Layout.sliderSize(),P=Ea($)*D*Sr(cn($)/D)||0;$=d.toPosition(t.Controller.toDest($%D))+P}var B=bc(T,$,1);m=1,x=B?0:x||wr(cn($-T)/Sp,$p),g=v,h=Ar(x,f,Vt(S,T,$,k),1),l(Fo),r(kr),h.start()}function f(){l(Hi),g&&g(),r(wi)}function S($,x,A,v){var k=c(),T=$+(x-$)*R(v),D=(T-k)*m;w(k+D),b&&!A&&p()&&(m*=wp,cn(D)<xp&&L(u(p(!0)),bp,!1,g,!0))}function H(){h&&h.cancel()}function I(){h&&!h.isPaused()&&(H(),f())}function R($){var x=n.easingFunc;return x?x($):1-Math.pow(1-$,4)}return{mount:y,destroy:H,scroll:L,cancel:I}}var Mi={passive:!1,capture:!0};function Tp(e,t,n){var i=Xt(e),o=i.on,r=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,w=t.Controller,b=t.Elements.track,h=t.Media.reduce,g=t.Direction,m=g.resolve,y=g.orient,L=u.getPosition,f=u.exceededLimit,S,H,I,R,$,x=!1,A,v,k;function T(){l(b,Jr,Pa,Mi),l(b,Qr,Pa,Mi),l(b,Xc,P,Mi),l(b,"click",V,{capture:!0}),l(b,"dragstart",kn),o([ti,sn],D)}function D(){var z=n.drag;re(!z),R=z==="free"}function P(z){if(A=!1,!v){var Q=ye(z);Z(z.target)&&(Q||!z.button)&&(w.isBusy()?kn(z,!0):(k=Q?b:window,$=c.is([Zi,Fo]),I=null,l(k,Jr,B,Mi),l(k,Qr,O,Mi),u.cancel(),p.cancel(),ee(z)))}}function B(z){if(c.is(ur)||(c.set(ur),r(Lc)),z.cancelable)if($){u.translate(S+Y(W(z)));var Q=ae(z)>Bs,te=x!==(x=f());(Q||te)&&ee(z),A=!0,r(Rc),kn(z)}else j(z)&&($=N(z),kn(z))}function O(z){c.is(ur)&&(c.set(Hi),r(Ic)),$&&(E(z),kn(z)),d(k,Jr,B),d(k,Qr,O),$=!1}function V(z){!v&&A&&kn(z,!0)}function ee(z){I=H,H=z,S=L()}function E(z){var Q=le(z),te=ie(Q),Me=n.rewind&&n.rewindByDrag;h(!1),R?w.scroll(te,0,n.snap):e.is(jo)?w.go(y(Ea(Q))<0?Me?"<":"-":Me?">":"+"):e.is(Di)&&x&&Me?w.go(f(!0)?">":"<"):w.go(w.toDest(te),!0),h(!0)}function N(z){var Q=n.dragMinThreshold,te=wo(Q),Me=te&&Q.mouse||0,we=(te?Q.touch:+Q)||10;return cn(W(z))>(ye(z)?we:Me)}function j(z){return cn(W(z))>cn(W(z,!0))}function le(z){if(e.is(Qi)||!x){var Q=ae(z);if(Q&&Q<Bs)return W(z)/Q}return 0}function ie(z){return L()+Ea(z)*Zn(cn(z)*(n.flickPower||600),R?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function W(z,Q){return J(z,Q)-J(F(z),Q)}function ae(z){return Ma(z)-Ma(F(z))}function F(z){return H===z&&I||H}function J(z,Q){return(ye(z)?z.changedTouches[0]:z)["page"+m(Q?"Y":"X")]}function Y(z){return z/(x&&e.is(Di)?op:1)}function Z(z){var Q=n.noDrag;return!So(z,"."+zc+", ."+Or)&&(!Q||!So(z,Q))}function ye(z){return typeof TouchEvent<"u"&&z instanceof TouchEvent}function se(){return $}function re(z){v=z}return{mount:T,disable:re,isDragging:se}}var Lp={Spacebar:" ",Right:Wr,Left:_r,Up:Wc,Down:Nc};function ms(e){return e=Yn(e)?e:e.key,Lp[e]||e}var zs="keydown";function Rp(e,t,n){var i=Xt(e),o=i.on,r=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function w(){b(),o(sn,h),o(sn,b),o(On,m)}function b(){var L=n.keyboard;L&&(u=L==="global"?window:d,r(u,zs,y))}function h(){l(u,zs)}function g(L){p=L}function m(){var L=p;p=!0,mc(function(){p=L})}function y(L){if(!p){var f=ms(L);f===c(_r)?e.go("<"):f===c(Wr)&&e.go(">")}}return{mount:w,destroy:h,disable:g}}var vo=ts+"-lazy",gr=vo+"-srcset",Ip="["+vo+"], ["+gr+"]";function Pp(e,t,n){var i=Xt(e),o=i.on,r=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[Ji,wi],p=[];function w(){n.lazyLoad&&(b(),o(Qt,b))}function b(){Hn(p),h(),c?L():(r(u),o(u,g),g())}function h(){t.Slides.forEach(function(f){es(f.slide,Ip).forEach(function(S){var H=Sn(S,vo),I=Sn(S,gr);if(H!==S.src||I!==S.srcset){var R=n.classes.spinner,$=S.parentElement,x=Ho($,"."+R)||Fi("span",R,$);p.push([S,f,x]),S.src||To(S,"none")}})})}function g(){p=p.filter(function(f){var S=n.perPage*((n.preloadPages||1)+1)-1;return f[1].isWithin(e.index,S)?m(f):!0}),p.length||r(u)}function m(f){var S=f[0];In(f[1].slide,_a),l(S,"load error",Vt(y,f)),St(S,"src",Sn(S,vo)),St(S,"srcset",Sn(S,gr)),Pn(S,vo),Pn(S,gr)}function y(f,S){var H=f[0],I=f[1];Fn(I.slide,_a),S.type!=="error"&&(vi(f[2]),To(H,""),d(ls,H,I),d(Oi)),c&&L()}function L(){p.length&&m(p.shift())}return{mount:w,destroy:Vt(Hn,p),check:g}}function Mp(e,t,n){var i=Xt(e),o=i.on,r=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,w=u.getIndex,b=u.go,h=t.Direction.resolve,g=c.pagination,m=[],y,L;function f(){S(),o([sn,Qt,$r],f);var v=n.pagination;g&&To(g,v?"":"none"),v&&(o([On,kr,wi],A),H(),A(),r(Ec,{list:y,items:m},x(e.index)))}function S(){y&&(vi(g?ei(y.children):y),Fn(y,L),Hn(m),y=null),i.destroy()}function H(){var v=e.length,k=n.classes,T=n.i18n,D=n.perPage,P=p()?u.getEnd()+1:Lo(v/D);y=g||Fi("ul",k.pagination,c.track.parentElement),In(y,L=Dr+"--"+$()),St(y,_n,"tablist"),St(y,yn,T.select),St(y,ds,$()===Nr?"vertical":"");for(var B=0;B<P;B++){var O=Fi("li",null,y),V=Fi("button",{class:k.page,type:"button"},O),ee=d.getIn(B).map(function(N){return N.slide.id}),E=!p()&&D>1?T.pageX:T.slideX;l(V,"click",Vt(I,B)),n.paginationKeyboard&&l(V,"keydown",Vt(R,B)),St(O,_n,"presentation"),St(V,_n,"tab"),St(V,Do,ee.join(" ")),St(V,yn,ka(E,B+1)),St(V,_i,-1),m.push({li:O,button:V,page:B})}}function I(v){b(">"+v,!0)}function R(v,k){var T=m.length,D=ms(k),P=$(),B=-1;D===h(Wr,!1,P)?B=++v%T:D===h(_r,!1,P)?B=(--v+T)%T:D==="Home"?B=0:D==="End"&&(B=T-1);var O=m[B];O&&(yc(O.button),b(">"+B),kn(k,!0))}function $(){return n.paginationDirection||n.direction}function x(v){return m[u.toPage(v)]}function A(){var v=x(w(!0)),k=x(w());if(v){var T=v.button;Fn(T,xi),Pn(T,Ns),St(T,_i,-1)}if(k){var D=k.button;In(D,xi),St(D,Ns,!0),St(D,_i,"")}r(kc,{list:y,items:m},v,k)}return{items:m,mount:f,destroy:S,getAt:x,update:A}}var Ep=[" ","Enter"];function kp(e,t,n){var i=n.isNavigation,o=n.slideFocus,r=[];function l(){e.splides.forEach(function(g){g.isParent||(u(e,g.splide),u(g.splide,e))}),i&&p()}function d(){r.forEach(function(g){g.destroy()}),Hn(r)}function c(){d(),l()}function u(g,m){var y=Xt(g);y.on(On,function(L,f,S){m.go(m.is(Qi)?S:L)}),r.push(y)}function p(){var g=Xt(e),m=g.on;m(is,b),m(Fc,h),m([ti,sn],w),r.push(g),g.emit(rs,e.splides)}function w(){St(t.Elements.list,ds,n.direction===Nr?"vertical":"")}function b(g){e.go(g.index)}function h(g,m){Ja(Ep,ms(m))&&(b(g),kn(m))}return{setup:Vt(t.Media.set,{slideFocus:_o(o)?i:o},!0),mount:l,destroy:d,remount:c}}function Ap(e,t,n){var i=Xt(e),o=i.bind,r=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,Mi)}function d(u){if(u.cancelable){var p=u.deltaY,w=p<0,b=Ma(u),h=n.wheelMinThreshold||0,g=n.wheelSleep||0;cn(p)>h&&b-r>g&&(e.go(w?"<":">"),r=b),c(w)&&kn(u)}}function c(u){return!n.releaseWheel||e.state.is(Zi)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var Fp=90;function _p(e,t,n){var i=Xt(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,d=Fi("span",Qu),c=Ar(Fp,Vt(p,!1));function u(){l&&(b(!t.Autoplay.isPaused()),St(r,Ds,!0),d.textContent="…",o(as,Vt(b,!0)),o(ss,Vt(b,!1)),o([Ji,wi],Vt(p,!0)))}function p(h){St(r,Os,h),h?(No(r,d),c.start()):(vi(d),c.cancel())}function w(){Pn(r,[Hs,Ds,Os]),vi(d)}function b(h){l&&St(r,Hs,h?"off":"polite")}return{mount:u,disable:b,destroy:w}}var Wp=Object.freeze({__proto__:null,Media:Vu,Direction:Gu,Elements:rp,Slides:sp,Layout:lp,Clones:dp,Move:up,Controller:pp,Arrows:hp,Autoplay:yp,Cover:vp,Scroll:Cp,Drag:Tp,Keyboard:Rp,LazyLoad:Pp,Pagination:Mp,Sync:kp,Wheel:Ap,Live:_p}),Np={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"},Hp={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:np,i18n:Np,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Op(e,t,n){var i=t.Slides;function o(){Xt(e).on([ti,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),mc(c)}return{mount:o,start:l,cancel:Pa}}function Dp(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,d=Vt(wn,l,"transition"),c;function u(){Xt(e).bind(l,"transitionend",function(h){h.target===l&&c&&(w(),c())})}function p(h,g){var m=i.toPosition(h,!0),y=i.getPosition(),L=b(h);cn(m-y)>=1&&L>=1?n.useScroll?r.scroll(m,L,!1,g):(d("transform "+L+"ms "+n.easing),i.translate(m,!0),c=g):(i.jump(h),g())}function w(){d(""),r.cancel()}function b(h){var g=n.rewindSpeed;if(e.is(Di)&&g){var m=o.getIndex(!0),y=o.getEnd();if(m===0&&h>=y||m>=y&&h===0)return g}return n.speed}return{mount:u,start:p,cancel:w}}var jp=(function(){function e(n,i){this.event=Xt(),this.Components={},this.state=Bu(Ai),this.splides=[],this._o={},this._E={};var o=Yn(n)?xc(document,n):n;yo(o,o+" is invalid."),this.root=o,i=Un({label:Sn(o,yn)||"",labelledby:Sn(o,cs)||""},Hp,e.defaults,i||{});try{Un(i,JSON.parse(Sn(o,ts)))}catch{yo(!1,"Invalid JSON")}this._o=Object.create(Un({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,d=this.Components;yo(l.is([Ai,br]),"Already mounted!"),l.set(Ai),this._C=d,this._T=o||this._T||(this.is(jo)?Op:Dp),this._E=i||this._E;var c=Co({},Wp,this._E,{Transition:this._T});return fi(c,function(u,p){var w=u(r,d,r._o);d[p]=w,w.setup&&w.setup()}),fi(d,function(u){u.mount&&u.mount()}),this.emit(ti),In(this.root,ep),l.set(Hi),this.emit(Aa),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Hi)&&(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(ei(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(Ai)?Xt(this).on(Aa,this.destroy.bind(this,i)):(fi(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(os),o.destroy(),i&&Hn(this.splides),r.set(br)),this},Nu(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})(),gs=jp;gs.defaults={};gs.STATES=Ou;var Vs=[[ti,"onMounted"],[Aa,"onReady"],[On,"onMove"],[Ji,"onMoved"],[is,"onClick"],[Sc,"onActive"],[$c,"onInactive"],[Cc,"onVisible"],[Tc,"onHidden"],[Qt,"onRefresh"],[sn,"onUpdated"],[Oi,"onResize"],[Er,"onResized"],[Lc,"onDrag"],[Rc,"onDragging"],[Ic,"onDragged"],[kr,"onScroll"],[wi,"onScrolled"],[os,"onDestroy"],[Pc,"onArrowsMounted"],[Mc,"onArrowsUpdated"],[Ec,"onPaginationMounted"],[kc,"onPaginationUpdated"],[rs,"onNavigationMounted"],[as,"onAutoplayPlay"],[Ac,"onAutoplayPlaying"],[ss,"onAutoplayPause"],[ls,"onLazyLoadLoaded"]];function hs(...e){return e.filter(Boolean).join(" ")}function Cr(e){return e!==null&&typeof e=="object"}function Wa(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!Wa(n,t[i]));if(Cr(e)&&Cr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Wa(e[o],t[o]))}return e===t}function Bp(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function zp(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 Na(e,t){const n=e;return zp(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Cr(i)?n[o]=Na(Cr(n[o])?n[o]:{},i):n[o]=i}),n}var Vp=({children:e,className:t,...n})=>s.createElement("div",{className:hs("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),fs=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 gs(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Na({},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&&!Wa(this.options,e)&&(this.splide.options=e,this.options=Na({},e));const t=this.getSlides();Bp(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){Vs.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:hs("splide",e),ref:this.splideRef,...this.omit(o,["options",...Vs.map(r=>r[1])])},n?s.createElement(Vp,null,i):i)}},ys=({children:e,className:t,...n})=>s.createElement("li",{className:hs("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 Gp="RichTextRenderer-module__link___BWeZ2",Up={link:Gp},qp=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))},eo=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>qp(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function rn(e){const{color:t,...n}=e;return n}function qt(e,t){var o,r,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:eo(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:_.scalingValue(e.letterSpacing,t),wordSpacing:_.scalingValue(e.wordSpacing,t),fontSize:_.scalingValue(n,t),lineHeight:i!==void 0?_.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 bi=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:Up.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:Xp(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 Xp(e){return{...e.fontFamily&&{fontFamily:eo(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 Kp="SvgImage-module__svg___q3xE-",Yp="SvgImage-module__img___VsTm-",Gs={svg:Kp,img:Yp},Zp=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},Jp=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,an=({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)}},[]),!Zp(e)||!r?a.jsx("img",{src:e,alt:"",className:rt(Gs.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:rt(Gs.svg,i),style:{"--svg":Jp(e),"--fill":t,"--hover-fill":n,...o??{}}})},Qp={"top-left":it.topLeftAlignment,"top-center":it.topCenterAlignment,"top-right":it.topRightAlignment,"middle-left":it.middleLeftAlignment,"middle-center":it.middleCenterAlignment,"middle-right":it.middleRightAlignment,"bottom-left":it.bottomLeftAlignment,"bottom-center":it.bottomCenterAlignment,"bottom-right":it.bottomRightAlignment};function em({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:w,textAppearance:b,color:h}=n.imageCaption??{},[g,m]=s.useState(void 0),[v,L]=s.useState(null),[f,S]=s.useState(0),[H,P]=s.useState(0),{direction:R,transition:$,controls:x,pagination:A,imageCaption:y,triggers:F}=e,T=s.useRef($.type),{x:j,y:E}=e.controls.offset,B=O=>{o&&o.go(O)};return s.useEffect(()=>{if(!v)return;const O=new ResizeObserver(z=>{if(!o)return;const[ee]=z;m({width:Math.round(ee.contentRect.width),height:Math.round(ee.contentRect.height)})});return O.observe(v),()=>O.unobserve(v)},[v]),s.useEffect(()=>{!o||T.current===$.type||(P(O=>O+1),T.current=$.type)},[$.type]),a.jsx("div",{className:rt(it.wrapper,{[it.editor]:i}),ref:L,children:a.jsxs("div",{className:it.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:$.backgroundColor&&$.type==="fade in"?$.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:rt(it.captionBlock),children:a.jsx("div",{className:it.captionTextWrapper,children:t.map((O,z)=>a.jsx("div",{className:rt(it.captionText,Qp[y.alignment],{[it.withPointerEvents]:z===f&&i,[it.active]:z===f}),style:{fontFamily:eo(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":_.scalingValue(l.width,i),letterSpacing:_.scalingValue(c,i),wordSpacing:_.scalingValue(p,i),textAlign:u,fontSize:_.scalingValue(w.fontSize,i),lineHeight:_.scalingValue(w.lineHeight,i),textTransform:b.textTransform??"none",textDecoration:b.textDecoration??"none",fontVariant:b.fontVariant??"normal",color:h,transitionDuration:$.duration?`${Math.round(parseInt($.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:it.captionTextInner,style:{"--link-hover-color":y.linkHoverColor,"--link-color":y.linkColor,position:"relative",top:_.scalingValue(y.offset.y,i),left:_.scalingValue(y.offset.x,i)},children:a.jsx(bi,{content:O.imageCaption})})},z))})}),a.jsx(fs,{onMove:O=>{S(O.index)},ref:r,options:{arrows:!1,speed:$.duration?parseInt($.duration):500,autoplay:F.autoPlay!==null,...F.autoPlay!==null&&{interval:parseInt(F.autoPlay)*1e3},direction:R==="horiz"||$.type==="fade in"?"ltr":"ttb",pagination:!1,drag:F.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:$.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((O,z)=>a.jsx(ys,{children:a.jsx("div",{className:it.sliderItem,children:a.jsx("div",{className:it.imgWrapper,children:a.jsx("img",{className:rt(it.sliderImage,{[it.contain]:O.image.objectFit==="contain",[it.cover]:O.image.objectFit==="cover"}),src:O.image.url,alt:O.image.name??""})})})},z))},H),x.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:rt(it.arrow,{[it.arrowVertical]:R==="vert",[it.hoverArrow]:x.show==="on hover"}),style:{color:x.color,"--arrow-hover-color":x.hover},children:a.jsxs("button",{onClick:()=>{B("-1")},className:it.arrowInner,style:{transform:`translate(${_.scalingValue(j,i)}, ${_.scalingValue(E*(R==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${R==="horiz"?"0deg":"90deg"})`},children:[x.arrowsImgUrl&&a.jsx(an,{url:x.arrowsImgUrl,fill:x.color,hoverFill:x.hover,className:rt(it.arrowImg,it.mirror)}),!x.arrowsImgUrl&&a.jsx(Us,{color:x.color,className:rt(it.arrowIcon,it.arrowImg,it.mirror)})]})}),a.jsx("div",{className:rt(it.arrow,it.nextArrow,{[it.arrowVertical]:R==="vert",[it.hoverArrow]:x.show==="on hover"}),style:{color:x.color,"--arrow-hover-color":x.hover},children:a.jsxs("button",{className:it.arrowInner,onClick:()=>B("+1"),style:{transform:`translate(${_.scalingValue(j*(R==="horiz"?-1:1),i)}, ${_.scalingValue(E,i)}) scale(${e.controls.scale/100}) rotate(${R==="horiz"?"0deg":"90deg"})`},children:[x.arrowsImgUrl&&a.jsx(an,{url:x.arrowsImgUrl,fill:x.color,hoverFill:x.hover,className:it.arrowImg}),!x.arrowsImgUrl&&a.jsx(Us,{color:x.color,className:rt(it.arrowIcon,it.arrowImg)})]})})]}),F.triggersList.click&&a.jsx("div",{className:it.clickOverlay,onClick:()=>{o&&o.go("+1")}}),A.isActive&&a.jsx("div",{className:rt(it.pagination,{[it.paginationInsideBottom]:A.position==="inside-1"&&R==="horiz",[it.paginationInsideTop]:A.position==="inside-2"&&R==="horiz",[it.paginationOutsideBottom]:A.position==="outside-1"&&R==="horiz",[it.paginationOutsideTop]:A.position==="outside-2"&&R==="horiz",[it.paginationInsideLeft]:A.position==="inside-1"&&R==="vert",[it.paginationInsideRight]:A.position==="inside-2"&&R==="vert",[it.paginationOutsideLeft]:A.position==="outside-1"&&R==="vert",[it.paginationOutsideRight]:A.position==="outside-2"&&R==="vert",[it.paginationVertical]:R==="vert"}),children:a.jsx("div",{className:it.paginationInner,style:{backgroundColor:A.colors[2],transform:`scale(${A.scale/100}) translate(${_.scalingValue(A.offset.x,i)}, ${_.scalingValue(A.offset.y,i)}) rotate(${R==="horiz"?"0deg":"90deg"})`},children:t.map((O,z)=>a.jsx("button",{onClick:()=>{o&&o.go(z)},className:rt(it.paginationItem),children:a.jsx("div",{className:rt(it.dot,{[it.activeDot]:z===f}),style:{backgroundColor:z===f?A.colors[0]:A.colors[1],"--pagination-hover-color":A.hover}})},z))})})]})})}function Us({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 tm={element:em,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"]}},nm="ImageRevealSlider-module__imageRevealSlider___UE5Ob",im="ImageRevealSlider-module__image___Qjt-e",om="ImageRevealSlider-module__link___N-iLG",rm="ImageRevealSlider-module__cursor___2U03d",Ci={imageRevealSlider:nm,image:im,link:om,cursor:rm};function qs(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 ea(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function am(e,t,n,i){let o,r;if(t==="custom"){o=n;const l=await ea(e);r=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await ea(e);r=l.height/l.width*o}else{const l=await ea(e);o=l.width,r=l.height}return{width:o,height:r,finalWidth:`${o}px`}}function sm({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,w]=s.useState({x:0,y:0}),[b,h]=s.useState(1),[g,m]=s.useState("none"),v=s.useRef({x:0,y:0}),[L,f]=s.useState(!1),{sizeType:S,imageWidth:H,randomRangeImageWidth:P}=e.imageSize,{revealPosition:R,visible:$}=e.position,{cursorType:x,target:A,defaultCursorScale:y,defaultCursor:F,hoverCursorScale:T,hoverCursor:j}=e.cursor;s.useEffect(()=>{if(!i)return;const O=(k,W)=>{const D=i.getBoundingClientRect(),le=k-D.left,Y=W-D.top;if(w({x:le,y:Y}),x==="system"){m("none"),h(1);return}const I=le,oe=Y,N=document.elementFromPoint(D.left+I,D.top+oe);if(N&&N.closest("a")){m("none"),h(1);return}const ie=qs(I,oe,r)||A==="area"?{img:j??"none",scale:T}:{img:F??"none",scale:y};m(ie.img),h(ie.scale)},z=k=>{k.stopPropagation(),v.current={x:k.clientX,y:k.clientY},O(k.clientX,k.clientY)},ee=()=>{L&&O(v.current.x,v.current.y)};return i.addEventListener("mousemove",z),window.addEventListener("scroll",ee,!0),()=>{i.removeEventListener("mousemove",z),window.removeEventListener("scroll",ee,!0)}},[i,L,p,x,A,j,F,T,y,r]),s.useEffect(()=>{L||(m("none"),h(0))},[L]);const E=async(O,z,ee,k={})=>{const{width:W,height:D,finalWidth:le}=await am(O.image.url,S,H,P);let Y=0,I=0;R==="same"?(Y=z/2,I=ee/2):(Y=k.x??Math.random()*z,I=k.y??Math.random()*ee);const oe=Math.min(Math.max(Y,W/2),z-W/2),N=Math.min(Math.max(I,D/2),ee-D/2);return{id:u.current++,url:O.image.url,link:O.link,name:O.image.name,x:oe,y:N,width:le}};s.useEffect(()=>{if(!i||t.length===0)return;const O=i.getBoundingClientRect(),z=O.width,ee=O.height,k=[];(async()=>{const D=t[0],le=await E(D,z,ee);k.push(le),l(k),c(1)})()},[S,H,P,R,i]),s.useEffect(()=>{$==="last One"&&l(O=>O.length>0?[O[O.length-1]]:[])},[$]);const B=async O=>{if(!i)return;const z=i.getBoundingClientRect(),ee=O.clientX-z.left,k=O.clientY-z.top;if(A==="image"&&!qs(ee,k,r))return;let W=0,D=0;R==="on Click"?(W=ee,D=k):R==="same"?(W=z.width/2,D=z.height/2):(W=Math.random()*z.width,D=Math.random()*z.height);const le=t[d],Y=await E(le,z.width,z.height,{x:W,y:D});l(I=>$==="all"?[...I,Y]:[Y]),c(I=>I>=t.length-1?0:I+1)};return a.jsxs("div",{ref:o,onClick:B,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),className:Ci.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[r.map(O=>a.jsx("div",{className:Ci.wrapper,style:{top:`${O.y}px`,left:`${O.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:O.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:A==="area"&&O.link?a.jsx("a",{href:O.link,target:"_blank",className:Ci.link,children:a.jsx("img",{src:O.url,alt:O.name,className:Ci.image},O.id)}):a.jsx("img",{src:O.url,alt:O.name,className:Ci.image},O.id)},O.id)),L&&a.jsx("div",{className:Ci.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${b})`,backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const lm={element:sm,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:""}]}}}},cm="LightBox-module__hidden___9s-9x",dm="LightBox-module__heroImage___sTxNF",um="LightBox-module__background___rm9ml",pm="LightBox-module__editor___4ACaY",mm="LightBox-module__contentStyle___Bgnsq",gm="LightBox-module__imageStyle___tLIlB",hm="LightBox-module__imgWrapper___LuFUp",fm="LightBox-module__contain___8-yaS",ym="LightBox-module__cover___hNvOG",vm="LightBox-module__caption___b6L2I",xm="LightBox-module__captionTextInner___rCGNH",bm="LightBox-module__lightboxSplide___XFuWC",wm="LightBox-module__arrow___iz38X",Sm="LightBox-module__arrowVertical___Zfz81",$m="LightBox-module__nextArrow___zkAQN",Cm="LightBox-module__arrowInner___p48sW",Tm="LightBox-module__arrowIcon___3VaFf",Lm="LightBox-module__arrowImg___pNV88",Rm="LightBox-module__mirror___pjeXc",Im="LightBox-module__thumbsWrapper___GB-nU",Pm="LightBox-module__thumbsContainerVertical___wttk5",Mm="LightBox-module__thumbsContainer___osSma",Em="LightBox-module__thumbsAlignStart___MO6tY",km="LightBox-module__thumbsAlignCenter___Q4sUx",Am="LightBox-module__thumbsAlignEnd___p4y9R",Fm="LightBox-module__thumbItem___HvnF3",_m="LightBox-module__closeButton___g2khP",Wm="LightBox-module__fadeIn___0m5GW",Nm="LightBox-module__slideInLeft___gPYwC",Hm="LightBox-module__slideInRight___S-pPp",Om="LightBox-module__slideInTop___DFdAj",Dm="LightBox-module__slideInBottom___m27kZ",jm="LightBox-module__fadeOut___55qBR",Bm="LightBox-module__slideOutLeft___NvU7P",zm="LightBox-module__slideOutRight___SK7eC",Vm="LightBox-module__slideOutTop___Vgg0z",Gm="LightBox-module__slideOutBottom___nJ0Ef",Um="LightBox-module__scaleSlide___vZriG",Ge={hidden:cm,heroImage:dm,background:um,editor:pm,contentStyle:mm,imageStyle:gm,imgWrapper:hm,contain:fm,cover:ym,caption:vm,captionTextInner:xm,lightboxSplide:bm,arrow:wm,arrowVertical:Sm,nextArrow:$m,arrowInner:Cm,arrowIcon:Tm,arrowImg:Lm,mirror:Rm,thumbsWrapper:Im,thumbsContainerVertical:Pm,thumbsContainer:Mm,thumbsAlignStart:Em,thumbsAlignCenter:km,thumbsAlignEnd:Am,thumbItem:Fm,closeButton:_m,fadeIn:Wm,slideInLeft:Nm,slideInRight:Hm,slideInTop:Om,slideInBottom:Dm,fadeOut:jm,slideOutLeft:Bm,slideOutRight:zm,slideOutTop:Vm,slideOutBottom:Gm,scaleSlide:Um},Yo=(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% + ${_.scalingValue(t.x,n)}), calc(-50% + ${_.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${_.scalingValue(t.x,n)}, calc(-50% + ${_.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${_.scalingValue(t.x,n)}), ${_.scalingValue(t.y,n)})`:i.transform=`translate(${_.scalingValue(t.x,n)}, ${_.scalingValue(t.y,n)})`,i};function Kc(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 qm(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 Yc(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 Xm(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 Zc(e,t,n,i,o){const{x:r,y:l}=qm(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function Km(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"?Xm:Yc,{renderedW:u,renderedH:p}=c(n,i,o,r),{offsetX:w,offsetY:b}=Zc(n,i,u,p,d),h=(w+u/2)/n*100,g=(b+p/2)/i*100;return`${h}% ${g}%`}function Ym(e){return Km(e)}function Tr(e){const t=e.getBoundingClientRect(),n=Kc(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}=Yc(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:w}=Zc(i,o,d,c,u),b=t.left+n.left,h=t.top+n.top;return{x:p+b,y:w+h,width:d,height:c}}function Xs(e){const t=e.getBoundingClientRect(),n=Kc(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Ks(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 Zm(e,t){const n=(()=>{if(e==="fade in")return Ge.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Ge.slideInLeft;case"right":return Ge.slideInRight;case"top":return Ge.slideInTop;case"bottom":return Ge.slideInBottom;default:return Ge.slideInRight}return Ge.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Ge.fadeIn;if(e==="slide in")switch(t){case"left":return Ge.slideInLeft;case"right":return Ge.slideInRight;case"top":return Ge.slideInTop;case"bottom":return Ge.slideInBottom;default:return Ge.slideInRight}return Ge.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Ge.fadeOut;if(e==="slide in")switch(t){case"left":return Ge.slideOutLeft;case"right":return Ge.slideOutRight;case"top":return Ge.slideOutTop;case"bottom":return Ge.slideOutBottom;default:return Ge.slideOutRight}return Ge.fadeOut})(),r=(()=>{if(e==="fade in")return Ge.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Ge.slideOutLeft;case"right":return Ge.slideOutRight;case"top":return Ge.slideOutTop;case"bottom":return Ge.slideOutBottom;default:return Ge.slideOutRight}return Ge.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:r}}const Jm=({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:Ge.heroImage,onClick:()=>c(!0)}),a.jsx(Qm,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},Qm=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:d})=>{var ye;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:w,wordSpacing:b,fontSizeLineHeight:h,textAppearance:g,color:m}=i.imageCaption??{},[v,L]=s.useState(0),[f,S]=s.useState(0),[H,P]=s.useState(!1),[R,$]=s.useState(!1),[x,A]=s.useState({}),y=s.useRef(null),F=s.useRef(null),T=s.useRef(null),j=s.useRef(!1),E=s.useRef(null),B=s.useRef(null),O=s.useRef(null),z=s.useRef(null),ee=s.useRef(!1),k=s.useRef(null),[W,D]=s.useState(!1),{appear:le,triggers:Y,slider:I,thumbnail:oe,controls:N,area:ie,caption:Z,layout:te}=o.lightboxBlock,{appearClass:Se,backdropAppearClass:se,backdropDisappearClass:ae,disappearClass:V}=Zm(le.type,le.direction),J=(d==null?void 0:d.itemId)??null;s.useEffect(()=>{const q=()=>{setTimeout(()=>{var he,we;(we=(he=y.current)==null?void 0:he.splide)==null||we.refresh()},16)},de=()=>{S(he=>he+1)};return window.addEventListener("ArticleEditor.Layout:change",q),window.addEventListener("ArticleEditor.ComponentContent:change",de),()=>{window.removeEventListener("ArticleEditor.Layout:change",q),window.removeEventListener("ArticleEditor.ComponentContent:change",de)}},[]),s.useEffect(()=>{if(!e||!oe.isActive){D(!1);return}const q=k.current;if(!q)return;const de=()=>{I.direction==="horiz"?D(q.scrollWidth>q.clientWidth):D(q.scrollHeight>q.clientHeight)};de();const he=new ResizeObserver(de);return he.observe(q),()=>he.disconnect()},[e,oe.isActive,n.length,x,I.direction]);const Q=s.useCallback(()=>{const q=window.matchMedia("(max-width: 768px)").matches,de=Ks(ie.color);q&&!l&&de>.9&&(document.body.style.backgroundColor=""),P(!0),j.current=!0;const he=we=>{we.target===E.current&&we.animationName&&(E.current&&B.current&&E.current.removeEventListener("animationend",B.current),B.current=null,j.current&&(j.current=!1,t()),P(!1))};E.current&&(B.current=he,E.current.addEventListener("animationend",he))},[t,ie.color,l]),Me=(q,de,he)=>{var we,Pe;if(q){if(Y.type==="click"&&Y.switch==="image")Y.repeat==="close"&&v===n.length-1?Q():(we=y.current)==null||we.go("+1");else if(Y.type==="click"&&Y.switch==="50/50"){const Le=q.getBoundingClientRect(),G=de-Le.left,fe=he-Le.top,ce=Le.width,U=Le.height;let re;I.direction==="horiz"?re=G<ce/2?"-1":"+1":re=fe<U/2?"-1":"+1",(Pe=y.current)==null||Pe.go(re)}}},be=q=>{if(ee.current){ee.current=!1;return}const de=n[v],he=(de==null?void 0:de.image.objectFit)==="cover";let we,Pe;if("changedTouches"in q&&q.changedTouches.length>0)we=q.changedTouches[0].clientX,Pe=q.changedTouches[0].clientY;else if("clientX"in q)we=q.clientX,Pe=q.clientY;else return;let Le;if(he&&T.current){const G=Xs(T.current);Le=we>=G.left&&we<=G.right&&Pe>=G.top&&Pe<=G.bottom}else{const G=T.current?Tr(T.current):null;if(!G){q.target===q.currentTarget&&Q();return}Le=we>=G.x&&we<=G.x+G.width&&Pe>=G.y&&Pe<=G.y+G.height}Le?Me(T.current,we,Pe):Q()},Ie=q=>{const de=q.target;(de.classList.contains(Ge.thumbsWrapper)||de.classList.contains(Ge.thumbsContainer))&&be(q)};s.useEffect(()=>{if(!e)return;const q=de=>{var he,we;if(de.key==="Escape"){Q();return}if(de.key==="ArrowRight"){L(Pe=>(Pe+1)%Math.max(n.length,1)),(he=y.current)==null||he.go("+1");return}de.key==="ArrowLeft"&&(L(Pe=>(Pe-1+Math.max(n.length,1))%Math.max(n.length,1)),(we=y.current)==null||we.go("-1"))};return window.addEventListener("keydown",q),()=>{window.removeEventListener("keydown",q)}},[e,Q,n.length]),s.useEffect(()=>{if(e){if(L(0),S(de=>de+1),j.current=!1,P(!1),$(!1),A({}),!J)return;const q=new CustomEvent("page-overlay",{detail:{itemId:J}});window.dispatchEvent(q)}return()=>{E.current&&B.current&&(E.current.removeEventListener("animationend",B.current),B.current=null),$(!1)}},[e,J]),s.useEffect(()=>{F.current!==null&&F.current!==I.type&&S(q=>q+1),F.current=I.type},[I.type]),s.useEffect(()=>{if(!e)return;const q=document.body.style.overflow,de=window.matchMedia("(max-width: 768px)").matches,he=Ks(ie.color);document.body.style.overflow="hidden",$(!1);const we=Le=>{Le.target===E.current&&!j.current&&Le.animationName&&(de&&!l&&he>.9&&(document.body.style.backgroundColor=ie.color),$(!0),E.current&&O.current&&E.current.removeEventListener("animationend",O.current),O.current=null)};E.current&&(O.current=we,E.current.addEventListener("animationend",we));const Pe=Le=>{const G=Le.target;G&&(G.closest(`.${Ge.thumbsWrapper}`)||G.closest(`.${Ge.thumbsContainer}`))||I.type!=="slide"&&Le.preventDefault()};return document.addEventListener("touchmove",Pe,{passive:!1}),()=>{document.body.style.overflow=q,document.removeEventListener("touchmove",Pe),E.current&&O.current&&(E.current.removeEventListener("animationend",O.current),O.current=null),$(!1)}},[e,l,ie.color,I.type]),s.useEffect(()=>{if(!e)return;const q=de=>{var we,Pe;if(j.current){de.stopPropagation();return}if(ee.current){ee.current=!1;return}const he=de.target;if(!(he&&(he.closest(`.${Ge.thumbsContainer}`)||he.closest(`.${Ge.thumbItem}`)||he.closest(`.${Ge.arrow}`)||he.closest(`.${Ge.closeButton}`)||he.closest(`.${Ge.caption}`)))){if(I.type==="slide"&&Y.type==="drag"&&((Pe=(we=y.current)==null?void 0:we.splide)!=null&&Pe.root)){const Le=y.current.splide.root;if(he&&(Le.contains(he)||Le===he))return}if(de.touches.length===0&&de.changedTouches.length>0){const Le=n[v],G=(Le==null?void 0:Le.image.objectFit)==="cover",fe=de.changedTouches[0];let ce;if(G&&T.current){const U=Xs(T.current);ce=fe.clientX>=U.left&&fe.clientX<=U.right&&fe.clientY>=U.top&&fe.clientY<=U.bottom}else{const U=T.current?Tr(T.current):null;if(!U)return;ce=fe.clientX>=U.x&&fe.clientX<=U.x+U.width&&fe.clientY>=U.y&&fe.clientY<=U.y+U.height}if(!ce){de.stopPropagation(),j.current=!0;const U=re=>{re.stopPropagation(),re.preventDefault(),document.removeEventListener("click",U,!0)};document.addEventListener("click",U,!0),Q()}}}};return document.addEventListener("touchend",q,{passive:!0}),()=>{document.removeEventListener("touchend",q)}},[e,Q,v,n]);const ue=(I.type==="scale"||I.type==="fade")&&I.direction==="vert"&&Y.type==="drag";s.useEffect(()=>{var re,Ee;if(!e||!ue||!((Ee=(re=y.current)==null?void 0:re.splide)!=null&&Ee.root))return;const q=y.current.splide.root,de=30,he=(pe,K)=>{if(z.current){const Ve=Math.abs(pe-z.current.x),Oe=Math.abs(K-z.current.y);(Ve>0||Oe>0)&&(ee.current=!0)}},we=pe=>{z.current&&(pe.preventDefault(),he(pe.clientX,pe.clientY))},Pe=pe=>{z.current&&pe.touches.length>0&&(pe.preventDefault(),he(pe.touches[0].clientX,pe.touches[0].clientY))},Le=(pe,K)=>{if(!z.current||!y.current){z.current=null;return}const Ve=Math.abs(pe-z.current.x),Oe=Math.abs(K-z.current.y);Oe>de&&Oe>Ve&&y.current.go(K<z.current.y?"+1":"-1"),z.current=null},G=pe=>{z.current&&Le(pe.clientX,pe.clientY),document.removeEventListener("pointerup",G),document.removeEventListener("pointercancel",G),document.removeEventListener("pointermove",we)},fe=pe=>{if(z.current){if(pe.changedTouches.length>0){const K=pe.changedTouches[0];Le(K.clientX,K.clientY)}document.removeEventListener("touchend",fe),document.removeEventListener("touchcancel",fe),document.removeEventListener("touchmove",Pe)}},ce=pe=>{z.current={x:pe.clientX,y:pe.clientY},ee.current=!1,document.addEventListener("pointermove",we,{passive:!1}),document.addEventListener("pointerup",G),document.addEventListener("pointercancel",G)},U=pe=>{pe.touches.length>0&&(z.current={x:pe.touches[0].clientX,y:pe.touches[0].clientY},ee.current=!1,document.addEventListener("touchmove",Pe,{passive:!1}),document.addEventListener("touchend",fe),document.addEventListener("touchcancel",fe))};return q.addEventListener("pointerdown",ce),q.addEventListener("touchstart",U),()=>{q.removeEventListener("pointerdown",ce),q.removeEventListener("touchstart",U),document.removeEventListener("pointermove",we),document.removeEventListener("pointerup",G),document.removeEventListener("pointercancel",G),document.removeEventListener("touchmove",Pe),document.removeEventListener("touchend",fe),document.removeEventListener("touchcancel",fe),z.current=null,ee.current=!1}},[e,ue,f]);const ge={backgroundColor:ie.color,backdropFilter:`blur(${ie.blur}px)`,animationDuration:`${parseInt(le.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(r)?null:Dn.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:l?null:E,className:rt(Ge.background,H?ae:se,{[Ge.editor]:l},{[Ge.hidden]:!e}),style:{...ge,...R&&!l&&!H?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?E:null,className:rt(Ge.contentStyle,H?V:Se,{[Ge.editor]:l},{[Ge.hidden]:!e}),style:{animationDuration:`${parseInt(le.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(fs,{onMove:q=>L(q.index),ref:y,className:Ge.lightboxSplide,options:{arrows:!1,speed:I.duration?parseInt(I.duration):500,direction:I.direction==="horiz"||I.type==="fade"||I.type==="scale"?"ltr":"ttb",pagination:!1,drag:Y.type==="drag"&&!ue,perPage:1,width:"100%",height:"100%",type:I.type==="fade"||I.type==="scale"?"fade":"loop",padding:0,rewind:Y.repeat!=="close",start:0},style:{"--splide-speed":I.duration},children:n.map((q,de)=>{const he=Yo(te.position,te.offset,l),we=`${_.scalingValue(te.padding.top,l)} ${_.scalingValue(te.padding.right,l)} ${_.scalingValue(te.padding.bottom,l)} ${_.scalingValue(te.padding.left,l)}`,Pe=I.type==="scale"?(()=>{const{transform:Le,...G}=he;return{...G,position:"absolute",padding:we,boxSizing:"border-box","--position-transform":Le||"none"}})():{...he,position:"absolute",padding:we,boxSizing:"border-box"};return a.jsx(ys,{children:a.jsx("div",{className:Ge.imgWrapper,onClick:be,children:a.jsx("img",{ref:de===v?T:null,className:rt(Ge.imageStyle,{[Ge.contain]:q.image.objectFit==="contain",[Ge.cover]:q.image.objectFit==="cover",[Ge.scaleSlide]:I.type==="scale"}),src:q.image.url,alt:q.image.name??"",style:{...Pe,pointerEvents:q.image.objectFit==="contain"?"none":"auto"}})})},de)})},f),N.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:rt(Ge.arrow,{[Ge.arrowVertical]:I.direction==="vert"}),style:{color:N.color,"--arrow-hover-color":N.hover},children:a.jsxs("button",{className:Ge.arrowInner,style:{transform:`translate(${_.scalingValue(N.offset.x,l)}, ${_.scalingValue(N.offset.y*(I.direction==="horiz"?1:-1),l)}) scale(${N.scale}) rotate(${I.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var q;return(q=y.current)==null?void 0:q.go("-1")},"aria-label":"Previous",children:[N.arrowsImgUrl&&a.jsx(an,{url:N.arrowsImgUrl,fill:N.color,hoverFill:N.hover,className:rt(Ge.arrowImg,Ge.mirror)}),!N.arrowsImgUrl&&a.jsx(Ys,{color:N.color,className:rt(Ge.arrowIcon,Ge.arrowImg,Ge.mirror)})]})}),a.jsx("div",{className:rt(Ge.arrow,Ge.nextArrow,{[Ge.arrowVertical]:I.direction==="vert"}),style:{color:N.color,"--arrow-hover-color":N.hover},children:a.jsxs("button",{className:Ge.arrowInner,style:{transform:`translate(${_.scalingValue(N.offset.x*(I.direction==="horiz"?-1:1),l)}, ${_.scalingValue(N.offset.y,l)}) scale(${N.scale}) rotate(${I.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var q;return(q=y.current)==null?void 0:q.go("+1")},"aria-label":"Next",children:[N.arrowsImgUrl&&a.jsx(an,{url:N.arrowsImgUrl,fill:N.color,hoverFill:N.hover,className:Ge.arrowImg}),!N.arrowsImgUrl&&a.jsx(Ys,{color:N.color,className:rt(Ge.arrowIcon,Ge.arrowImg)})]})})]}),ie.closeIconUrl&&(()=>{const q=Yo(ie.closeIconAlign,ie.closeIconOffset,l),de=`scale(${ie.closeIconScale})`,he=q.transform?`${q.transform} ${de}`:de;return a.jsx("button",{className:Ge.closeButton,style:{...q,transform:he},onClick:Q,"aria-label":"Close lightbox",children:a.jsx(an,{url:ie.closeIconUrl,fill:ie.closeIconColor??"#000000",hoverFill:ie.closeIconHover??"#cccccc"})})})(),Z&&Z.isActive&&i.imageCaption&&((ye=n[v])==null?void 0:ye.imageCaption)&&a.jsx("div",{className:Ge.caption,style:{...Yo(Z.alignment,Z.offset,l),fontFamily:eo(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":_.scalingValue(c.width,l),letterSpacing:_.scalingValue(p,l),wordSpacing:_.scalingValue(b,l),textAlign:w,fontSize:_.scalingValue(h.fontSize,l),lineHeight:_.scalingValue(h.lineHeight,l),textTransform:g.textTransform??"none",textDecoration:g.textDecoration??"none",fontVariant:g.fontVariant??"normal",color:m},onClick:q=>q.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:Ge.captionTextInner,style:{"--link-color":Z.linkColor,"--link-hover-color":Z.linkHoverColor},children:a.jsx(bi,{content:n[v].imageCaption})})}),oe.isActive&&(()=>{const[q,de]=oe.position.split("-"),he=I.direction==="horiz"?`${q}-left`:oe.position,we=Yo(he,oe.offset,l),Pe=()=>{if(I.direction==="horiz"){if(de==="left")return"flex-start";if(de==="center")return"center";if(de==="right")return"flex-end"}else{if(q==="top")return"flex-start";if(q==="middle")return"center";if(q==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:k,className:Ge.thumbsWrapper,onClick:Le=>Ie(Le),style:{position:l?"absolute":"fixed",...we,...I.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:rt(Ge.thumbsContainer,{[Ge.thumbsContainerVertical]:I.direction==="vert",[Ge.thumbsAlignStart]:oe.align==="start",[Ge.thumbsAlignCenter]:oe.align==="center",[Ge.thumbsAlignEnd]:oe.align==="end"}),style:{gap:_.scalingValue(oe.grid.gap,l),justifyContent:W?"flex-start":Pe()},children:n.map((Le,G)=>{const fe=G===v,ce=x[G],re=oe.grid.size*(fe?oe.activeState.scale:1),Ee=()=>{if(oe.fit!=="fit")return{};if(!ce)return I.direction==="horiz"?{height:_.scalingValue(re,l)}:{width:_.scalingValue(re,l)};const pe=ce.width/ce.height;if(I.direction==="horiz"){const K=re,Ve=K*pe;return{width:_.scalingValue(Ve,l),height:_.scalingValue(K,l)}}else{const K=re,Ve=K/pe;return{width:_.scalingValue(K,l),height:_.scalingValue(Ve,l)}}};return a.jsx("button",{className:Ge.thumbItem,style:{...I.direction==="horiz"&&oe.fit!=="fit"?{height:_.scalingValue(re,l)}:{},...I.direction==="vert"&&oe.fit!=="fit"?{width:_.scalingValue(re,l)}:{},...oe.fit==="cover"?{width:_.scalingValue(re,l),height:_.scalingValue(re,l)}:{},...Ee(),transition:fe?"all 0.25s ease-out":"none",opacity:fe?oe.activeState.opacity/100:oe.opacity/100,"--thumb-hover":oe.activeState.opacity/100},onClick:pe=>{var K;pe.stopPropagation(),L(G),(K=y.current)==null||K.go(G)},onMouseEnter:()=>{var pe;oe.triggers==="hov"&&((pe=y.current)==null||pe.go(G))},children:a.jsx("img",{src:Le.image.url,alt:Le.image.name??"",onLoad:pe=>{const K=pe.currentTarget;K.naturalWidth&&K.naturalHeight&&A(Ve=>({...Ve,[G]:{width:K.naturalWidth,height:K.naturalHeight}}))},style:{objectFit:oe.fit==="cover"?"cover":"contain",...oe.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...oe.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Le.image.name}-${G}`)})})})})()]})]}),document.getElementById(r))};function Ys({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 eg={element:Jm,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 Zo(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function tg(e){return`
6
+ */const Gp="RichTextRenderer-module__link___BWeZ2",Up={link:Gp},qp=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))},eo=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>qp(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function rn(e){const{color:t,...n}=e;return n}function qt(e,t){var o,r,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:eo(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:_.scalingValue(e.letterSpacing,t),wordSpacing:_.scalingValue(e.wordSpacing,t),fontSize:_.scalingValue(n,t),lineHeight:i!==void 0?_.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 bi=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:Up.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:Xp(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 Xp(e){return{...e.fontFamily&&{fontFamily:eo(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 Kp="SvgImage-module__svg___q3xE-",Yp="SvgImage-module__img___VsTm-",Gs={svg:Kp,img:Yp},Zp=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},Jp=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,an=({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)}},[]),!Zp(e)||!r?a.jsx("img",{src:e,alt:"",className:rt(Gs.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:rt(Gs.svg,i),style:{"--svg":Jp(e),"--fill":t,"--hover-fill":n,...o??{}}})},Qp={"top-left":it.topLeftAlignment,"top-center":it.topCenterAlignment,"top-right":it.topRightAlignment,"middle-left":it.middleLeftAlignment,"middle-center":it.middleCenterAlignment,"middle-right":it.middleRightAlignment,"bottom-left":it.bottomLeftAlignment,"bottom-center":it.bottomCenterAlignment,"bottom-right":it.bottomRightAlignment};function em({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:w,textAppearance:b,color:h}=n.imageCaption??{},[g,m]=s.useState(void 0),[y,L]=s.useState(null),[f,S]=s.useState(0),[H,I]=s.useState(0),{direction:R,transition:$,controls:x,pagination:A,imageCaption:v,triggers:k}=e,T=s.useRef($.type),{x:D,y:P}=e.controls.offset,B=O=>{o&&o.go(O)};return s.useEffect(()=>{if(!y)return;const O=new ResizeObserver(V=>{if(!o)return;const[ee]=V;m({width:Math.round(ee.contentRect.width),height:Math.round(ee.contentRect.height)})});return O.observe(y),()=>O.unobserve(y)},[y]),s.useEffect(()=>{!o||T.current===$.type||(I(O=>O+1),T.current=$.type)},[$.type]),a.jsx("div",{className:rt(it.wrapper,{[it.editor]:i}),ref:L,children:a.jsxs("div",{className:it.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:$.backgroundColor&&$.type==="fade in"?$.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:rt(it.captionBlock),children:a.jsx("div",{className:it.captionTextWrapper,children:t.map((O,V)=>a.jsx("div",{className:rt(it.captionText,Qp[v.alignment],{[it.withPointerEvents]:V===f&&i,[it.active]:V===f}),style:{fontFamily:eo(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":_.scalingValue(l.width,i),letterSpacing:_.scalingValue(c,i),wordSpacing:_.scalingValue(p,i),textAlign:u,fontSize:_.scalingValue(w.fontSize,i),lineHeight:_.scalingValue(w.lineHeight,i),textTransform:b.textTransform??"none",textDecoration:b.textDecoration??"none",fontVariant:b.fontVariant??"normal",color:h,transitionDuration:$.duration?`${Math.round(parseInt($.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:it.captionTextInner,style:{"--link-hover-color":v.linkHoverColor,"--link-color":v.linkColor,position:"relative",top:_.scalingValue(v.offset.y,i),left:_.scalingValue(v.offset.x,i)},children:a.jsx(bi,{content:O.imageCaption})})},V))})}),a.jsx(fs,{onMove:O=>{S(O.index)},ref:r,options:{arrows:!1,speed:$.duration?parseInt($.duration):500,autoplay:k.autoPlay!==null,...k.autoPlay!==null&&{interval:parseInt(k.autoPlay)*1e3},direction:R==="horiz"||$.type==="fade in"?"ltr":"ttb",pagination:!1,drag:k.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:$.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((O,V)=>a.jsx(ys,{children:a.jsx("div",{className:it.sliderItem,children:a.jsx("div",{className:it.imgWrapper,children:a.jsx("img",{className:rt(it.sliderImage,{[it.contain]:O.image.objectFit==="contain",[it.cover]:O.image.objectFit==="cover"}),src:O.image.url,alt:O.image.name??""})})})},V))},H),x.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:rt(it.arrow,{[it.arrowVertical]:R==="vert",[it.hoverArrow]:x.show==="on hover"}),style:{color:x.color,"--arrow-hover-color":x.hover},children:a.jsxs("button",{onClick:()=>{B("-1")},className:it.arrowInner,style:{transform:`translate(${_.scalingValue(D,i)}, ${_.scalingValue(P*(R==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${R==="horiz"?"0deg":"90deg"})`},children:[x.arrowsImgUrl&&a.jsx(an,{url:x.arrowsImgUrl,fill:x.color,hoverFill:x.hover,className:rt(it.arrowImg,it.mirror)}),!x.arrowsImgUrl&&a.jsx(Us,{color:x.color,className:rt(it.arrowIcon,it.arrowImg,it.mirror)})]})}),a.jsx("div",{className:rt(it.arrow,it.nextArrow,{[it.arrowVertical]:R==="vert",[it.hoverArrow]:x.show==="on hover"}),style:{color:x.color,"--arrow-hover-color":x.hover},children:a.jsxs("button",{className:it.arrowInner,onClick:()=>B("+1"),style:{transform:`translate(${_.scalingValue(D*(R==="horiz"?-1:1),i)}, ${_.scalingValue(P,i)}) scale(${e.controls.scale/100}) rotate(${R==="horiz"?"0deg":"90deg"})`},children:[x.arrowsImgUrl&&a.jsx(an,{url:x.arrowsImgUrl,fill:x.color,hoverFill:x.hover,className:it.arrowImg}),!x.arrowsImgUrl&&a.jsx(Us,{color:x.color,className:rt(it.arrowIcon,it.arrowImg)})]})})]}),k.triggersList.click&&a.jsx("div",{className:it.clickOverlay,onClick:()=>{o&&o.go("+1")}}),A.isActive&&a.jsx("div",{className:rt(it.pagination,{[it.paginationInsideBottom]:A.position==="inside-1"&&R==="horiz",[it.paginationInsideTop]:A.position==="inside-2"&&R==="horiz",[it.paginationOutsideBottom]:A.position==="outside-1"&&R==="horiz",[it.paginationOutsideTop]:A.position==="outside-2"&&R==="horiz",[it.paginationInsideLeft]:A.position==="inside-1"&&R==="vert",[it.paginationInsideRight]:A.position==="inside-2"&&R==="vert",[it.paginationOutsideLeft]:A.position==="outside-1"&&R==="vert",[it.paginationOutsideRight]:A.position==="outside-2"&&R==="vert",[it.paginationVertical]:R==="vert"}),children:a.jsx("div",{className:it.paginationInner,style:{backgroundColor:A.colors[2],transform:`scale(${A.scale/100}) translate(${_.scalingValue(A.offset.x,i)}, ${_.scalingValue(A.offset.y,i)}) rotate(${R==="horiz"?"0deg":"90deg"})`},children:t.map((O,V)=>a.jsx("button",{onClick:()=>{o&&o.go(V)},className:rt(it.paginationItem),children:a.jsx("div",{className:rt(it.dot,{[it.activeDot]:V===f}),style:{backgroundColor:V===f?A.colors[0]:A.colors[1],"--pagination-hover-color":A.hover}})},V))})})]})})}function Us({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 tm={element:em,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"]}},nm="ImageRevealSlider-module__imageRevealSlider___UE5Ob",im="ImageRevealSlider-module__image___Qjt-e",om="ImageRevealSlider-module__link___N-iLG",rm="ImageRevealSlider-module__cursor___2U03d",Ci={imageRevealSlider:nm,image:im,link:om,cursor:rm};function qs(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 ea(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function am(e,t,n,i){let o,r;if(t==="custom"){o=n;const l=await ea(e);r=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await ea(e);r=l.height/l.width*o}else{const l=await ea(e);o=l.width,r=l.height}return{width:o,height:r,finalWidth:`${o}px`}}function sm({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,w]=s.useState({x:0,y:0}),[b,h]=s.useState(1),[g,m]=s.useState("none"),y=s.useRef({x:0,y:0}),[L,f]=s.useState(!1),{sizeType:S,imageWidth:H,randomRangeImageWidth:I}=e.imageSize,{revealPosition:R,visible:$}=e.position,{cursorType:x,target:A,defaultCursorScale:v,defaultCursor:k,hoverCursorScale:T,hoverCursor:D}=e.cursor;s.useEffect(()=>{if(!i)return;const O=(E,N)=>{const j=i.getBoundingClientRect(),le=E-j.left,ie=N-j.top;if(w({x:le,y:ie}),x==="system"){m("none"),h(1);return}const W=le,ae=ie,F=document.elementFromPoint(j.left+W,j.top+ae);if(F&&F.closest("a")){m("none"),h(1);return}const J=qs(W,ae,r)||A==="area"?{img:D??"none",scale:T}:{img:k??"none",scale:v};m(J.img),h(J.scale)},V=E=>{E.stopPropagation(),y.current={x:E.clientX,y:E.clientY},O(E.clientX,E.clientY)},ee=()=>{L&&O(y.current.x,y.current.y)};return i.addEventListener("mousemove",V),window.addEventListener("scroll",ee,!0),()=>{i.removeEventListener("mousemove",V),window.removeEventListener("scroll",ee,!0)}},[i,L,p,x,A,D,k,T,v,r]),s.useEffect(()=>{L||(m("none"),h(0))},[L]);const P=async(O,V,ee,E={})=>{const{width:N,height:j,finalWidth:le}=await am(O.image.url,S,H,I);let ie=0,W=0;R==="same"?(ie=V/2,W=ee/2):(ie=E.x??Math.random()*V,W=E.y??Math.random()*ee);const ae=Math.min(Math.max(ie,N/2),V-N/2),F=Math.min(Math.max(W,j/2),ee-j/2);return{id:u.current++,url:O.image.url,link:O.link,name:O.image.name,x:ae,y:F,width:le}};s.useEffect(()=>{if(!i||t.length===0)return;const O=i.getBoundingClientRect(),V=O.width,ee=O.height,E=[];(async()=>{const j=t[0],le=await P(j,V,ee);E.push(le),l(E),c(1)})()},[S,H,I,R,i]),s.useEffect(()=>{$==="last One"&&l(O=>O.length>0?[O[O.length-1]]:[])},[$]);const B=async O=>{if(!i)return;const V=i.getBoundingClientRect(),ee=O.clientX-V.left,E=O.clientY-V.top;if(A==="image"&&!qs(ee,E,r))return;let N=0,j=0;R==="on Click"?(N=ee,j=E):R==="same"?(N=V.width/2,j=V.height/2):(N=Math.random()*V.width,j=Math.random()*V.height);const le=t[d],ie=await P(le,V.width,V.height,{x:N,y:j});l(W=>$==="all"?[...W,ie]:[ie]),c(W=>W>=t.length-1?0:W+1)};return a.jsxs("div",{ref:o,onClick:B,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),className:Ci.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[r.map(O=>a.jsx("div",{className:Ci.wrapper,style:{top:`${O.y}px`,left:`${O.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:O.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:A==="area"&&O.link?a.jsx("a",{href:O.link,target:"_blank",className:Ci.link,children:a.jsx("img",{src:O.url,alt:O.name,className:Ci.image},O.id)}):a.jsx("img",{src:O.url,alt:O.name,className:Ci.image},O.id)},O.id)),L&&a.jsx("div",{className:Ci.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${b})`,backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const lm={element:sm,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:""}]}}}},cm="LightBox-module__hidden___9s-9x",dm="LightBox-module__heroImage___sTxNF",um="LightBox-module__background___rm9ml",pm="LightBox-module__editor___4ACaY",mm="LightBox-module__contentStyle___Bgnsq",gm="LightBox-module__imageStyle___tLIlB",hm="LightBox-module__imgWrapper___LuFUp",fm="LightBox-module__contain___8-yaS",ym="LightBox-module__cover___hNvOG",vm="LightBox-module__caption___b6L2I",xm="LightBox-module__captionTextInner___rCGNH",bm="LightBox-module__lightboxSplide___XFuWC",wm="LightBox-module__arrow___iz38X",Sm="LightBox-module__arrowVertical___Zfz81",$m="LightBox-module__nextArrow___zkAQN",Cm="LightBox-module__arrowInner___p48sW",Tm="LightBox-module__arrowIcon___3VaFf",Lm="LightBox-module__arrowImg___pNV88",Rm="LightBox-module__mirror___pjeXc",Im="LightBox-module__thumbsWrapper___GB-nU",Pm="LightBox-module__thumbsContainerVertical___wttk5",Mm="LightBox-module__thumbsContainer___osSma",Em="LightBox-module__thumbsAlignStart___MO6tY",km="LightBox-module__thumbsAlignCenter___Q4sUx",Am="LightBox-module__thumbsAlignEnd___p4y9R",Fm="LightBox-module__thumbItem___HvnF3",_m="LightBox-module__closeButton___g2khP",Wm="LightBox-module__fadeIn___0m5GW",Nm="LightBox-module__slideInLeft___gPYwC",Hm="LightBox-module__slideInRight___S-pPp",Om="LightBox-module__slideInTop___DFdAj",Dm="LightBox-module__slideInBottom___m27kZ",jm="LightBox-module__fadeOut___55qBR",Bm="LightBox-module__slideOutLeft___NvU7P",zm="LightBox-module__slideOutRight___SK7eC",Vm="LightBox-module__slideOutTop___Vgg0z",Gm="LightBox-module__slideOutBottom___nJ0Ef",Um="LightBox-module__scaleSlide___vZriG",Ge={hidden:cm,heroImage:dm,background:um,editor:pm,contentStyle:mm,imageStyle:gm,imgWrapper:hm,contain:fm,cover:ym,caption:vm,captionTextInner:xm,lightboxSplide:bm,arrow:wm,arrowVertical:Sm,nextArrow:$m,arrowInner:Cm,arrowIcon:Tm,arrowImg:Lm,mirror:Rm,thumbsWrapper:Im,thumbsContainerVertical:Pm,thumbsContainer:Mm,thumbsAlignStart:Em,thumbsAlignCenter:km,thumbsAlignEnd:Am,thumbItem:Fm,closeButton:_m,fadeIn:Wm,slideInLeft:Nm,slideInRight:Hm,slideInTop:Om,slideInBottom:Dm,fadeOut:jm,slideOutLeft:Bm,slideOutRight:zm,slideOutTop:Vm,slideOutBottom:Gm,scaleSlide:Um},Yo=(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% + ${_.scalingValue(t.x,n)}), calc(-50% + ${_.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${_.scalingValue(t.x,n)}, calc(-50% + ${_.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${_.scalingValue(t.x,n)}), ${_.scalingValue(t.y,n)})`:i.transform=`translate(${_.scalingValue(t.x,n)}, ${_.scalingValue(t.y,n)})`,i};function Kc(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 qm(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 Yc(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 Xm(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 Zc(e,t,n,i,o){const{x:r,y:l}=qm(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function Km(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"?Xm:Yc,{renderedW:u,renderedH:p}=c(n,i,o,r),{offsetX:w,offsetY:b}=Zc(n,i,u,p,d),h=(w+u/2)/n*100,g=(b+p/2)/i*100;return`${h}% ${g}%`}function Ym(e){return Km(e)}function Tr(e){const t=e.getBoundingClientRect(),n=Kc(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}=Yc(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:w}=Zc(i,o,d,c,u),b=t.left+n.left,h=t.top+n.top;return{x:p+b,y:w+h,width:d,height:c}}function Xs(e){const t=e.getBoundingClientRect(),n=Kc(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Ks(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 Zm(e,t){const n=(()=>{if(e==="fade in")return Ge.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Ge.slideInLeft;case"right":return Ge.slideInRight;case"top":return Ge.slideInTop;case"bottom":return Ge.slideInBottom;default:return Ge.slideInRight}return Ge.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Ge.fadeIn;if(e==="slide in")switch(t){case"left":return Ge.slideInLeft;case"right":return Ge.slideInRight;case"top":return Ge.slideInTop;case"bottom":return Ge.slideInBottom;default:return Ge.slideInRight}return Ge.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Ge.fadeOut;if(e==="slide in")switch(t){case"left":return Ge.slideOutLeft;case"right":return Ge.slideOutRight;case"top":return Ge.slideOutTop;case"bottom":return Ge.slideOutBottom;default:return Ge.slideOutRight}return Ge.fadeOut})(),r=(()=>{if(e==="fade in")return Ge.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Ge.slideOutLeft;case"right":return Ge.slideOutRight;case"top":return Ge.slideOutTop;case"bottom":return Ge.slideOutBottom;default:return Ge.slideOutRight}return Ge.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:r}}const Jm=({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:Ge.heroImage,onClick:()=>c(!0)}),a.jsx(Qm,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},Qm=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:d})=>{var ve;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:w,wordSpacing:b,fontSizeLineHeight:h,textAppearance:g,color:m}=i.imageCaption??{},[y,L]=s.useState(0),[f,S]=s.useState(0),[H,I]=s.useState(!1),[R,$]=s.useState(!1),[x,A]=s.useState({}),v=s.useRef(null),k=s.useRef(null),T=s.useRef(null),D=s.useRef(!1),P=s.useRef(null),B=s.useRef(null),O=s.useRef(null),V=s.useRef(null),ee=s.useRef(!1),E=s.useRef(null),[N,j]=s.useState(!1),{appear:le,triggers:ie,slider:W,thumbnail:ae,controls:F,area:J,caption:Y,layout:Z}=o.lightboxBlock,{appearClass:ye,backdropAppearClass:se,backdropDisappearClass:re,disappearClass:z}=Zm(le.type,le.direction),Q=(d==null?void 0:d.itemId)??null;s.useEffect(()=>{const q=()=>{setTimeout(()=>{var he,Se;(Se=(he=v.current)==null?void 0:he.splide)==null||Se.refresh()},16)},de=()=>{S(he=>he+1)};return window.addEventListener("ArticleEditor.Layout:change",q),window.addEventListener("ArticleEditor.ComponentContent:change",de),()=>{window.removeEventListener("ArticleEditor.Layout:change",q),window.removeEventListener("ArticleEditor.ComponentContent:change",de)}},[]),s.useEffect(()=>{if(!e||!ae.isActive){j(!1);return}const q=E.current;if(!q)return;const de=()=>{W.direction==="horiz"?j(q.scrollWidth>q.clientWidth):j(q.scrollHeight>q.clientHeight)};de();const he=new ResizeObserver(de);return he.observe(q),()=>he.disconnect()},[e,ae.isActive,n.length,x,W.direction]);const te=s.useCallback(()=>{const q=window.matchMedia("(max-width: 768px)").matches,de=Ks(J.color);q&&!l&&de>.9&&(document.body.style.backgroundColor=""),I(!0),D.current=!0;const he=Se=>{Se.target===P.current&&Se.animationName&&(P.current&&B.current&&P.current.removeEventListener("animationend",B.current),B.current=null,D.current&&(D.current=!1,t()),I(!1))};P.current&&(B.current=he,P.current.addEventListener("animationend",he))},[t,J.color,l]),Me=(q,de,he)=>{var Se,Pe;if(q){if(ie.type==="click"&&ie.switch==="image")ie.repeat==="close"&&y===n.length-1?te():(Se=v.current)==null||Se.go("+1");else if(ie.type==="click"&&ie.switch==="50/50"){const Le=q.getBoundingClientRect(),G=de-Le.left,fe=he-Le.top,ce=Le.width,U=Le.height;let oe;W.direction==="horiz"?oe=G<ce/2?"-1":"+1":oe=fe<U/2?"-1":"+1",(Pe=v.current)==null||Pe.go(oe)}}},we=q=>{if(ee.current){ee.current=!1;return}const de=n[y],he=(de==null?void 0:de.image.objectFit)==="cover";let Se,Pe;if("changedTouches"in q&&q.changedTouches.length>0)Se=q.changedTouches[0].clientX,Pe=q.changedTouches[0].clientY;else if("clientX"in q)Se=q.clientX,Pe=q.clientY;else return;let Le;if(he&&T.current){const G=Xs(T.current);Le=Se>=G.left&&Se<=G.right&&Pe>=G.top&&Pe<=G.bottom}else{const G=T.current?Tr(T.current):null;if(!G){q.target===q.currentTarget&&te();return}Le=Se>=G.x&&Se<=G.x+G.width&&Pe>=G.y&&Pe<=G.y+G.height}Le?Me(T.current,Se,Pe):te()},Ie=q=>{const de=q.target;(de.classList.contains(Ge.thumbsWrapper)||de.classList.contains(Ge.thumbsContainer))&&we(q)};s.useEffect(()=>{if(!e)return;const q=de=>{var he,Se;if(de.key==="Escape"){te();return}if(de.key==="ArrowRight"){L(Pe=>(Pe+1)%Math.max(n.length,1)),(he=v.current)==null||he.go("+1");return}de.key==="ArrowLeft"&&(L(Pe=>(Pe-1+Math.max(n.length,1))%Math.max(n.length,1)),(Se=v.current)==null||Se.go("-1"))};return window.addEventListener("keydown",q),()=>{window.removeEventListener("keydown",q)}},[e,te,n.length]),s.useEffect(()=>{if(e){if(L(0),S(de=>de+1),D.current=!1,I(!1),$(!1),A({}),!Q)return;const q=new CustomEvent("page-overlay",{detail:{itemId:Q}});window.dispatchEvent(q)}return()=>{P.current&&B.current&&(P.current.removeEventListener("animationend",B.current),B.current=null),$(!1)}},[e,Q]),s.useEffect(()=>{k.current!==null&&k.current!==W.type&&S(q=>q+1),k.current=W.type},[W.type]),s.useEffect(()=>{if(!e)return;const q=document.body.style.overflow,de=window.matchMedia("(max-width: 768px)").matches,he=Ks(J.color);document.body.style.overflow="hidden",$(!1);const Se=Le=>{Le.target===P.current&&!D.current&&Le.animationName&&(de&&!l&&he>.9&&(document.body.style.backgroundColor=J.color),$(!0),P.current&&O.current&&P.current.removeEventListener("animationend",O.current),O.current=null)};P.current&&(O.current=Se,P.current.addEventListener("animationend",Se));const Pe=Le=>{const G=Le.target;G&&(G.closest(`.${Ge.thumbsWrapper}`)||G.closest(`.${Ge.thumbsContainer}`))||W.type!=="slide"&&Le.preventDefault()};return document.addEventListener("touchmove",Pe,{passive:!1}),()=>{document.body.style.overflow=q,document.removeEventListener("touchmove",Pe),P.current&&O.current&&(P.current.removeEventListener("animationend",O.current),O.current=null),$(!1)}},[e,l,J.color,W.type]),s.useEffect(()=>{if(!e)return;const q=de=>{var Se,Pe;if(D.current){de.stopPropagation();return}if(ee.current){ee.current=!1;return}const he=de.target;if(!(he&&(he.closest(`.${Ge.thumbsContainer}`)||he.closest(`.${Ge.thumbItem}`)||he.closest(`.${Ge.arrow}`)||he.closest(`.${Ge.closeButton}`)||he.closest(`.${Ge.caption}`)))){if(W.type==="slide"&&ie.type==="drag"&&((Pe=(Se=v.current)==null?void 0:Se.splide)!=null&&Pe.root)){const Le=v.current.splide.root;if(he&&(Le.contains(he)||Le===he))return}if(de.touches.length===0&&de.changedTouches.length>0){const Le=n[y],G=(Le==null?void 0:Le.image.objectFit)==="cover",fe=de.changedTouches[0];let ce;if(G&&T.current){const U=Xs(T.current);ce=fe.clientX>=U.left&&fe.clientX<=U.right&&fe.clientY>=U.top&&fe.clientY<=U.bottom}else{const U=T.current?Tr(T.current):null;if(!U)return;ce=fe.clientX>=U.x&&fe.clientX<=U.x+U.width&&fe.clientY>=U.y&&fe.clientY<=U.y+U.height}if(!ce){de.stopPropagation(),D.current=!0;const U=oe=>{oe.stopPropagation(),oe.preventDefault(),document.removeEventListener("click",U,!0)};document.addEventListener("click",U,!0),te()}}}};return document.addEventListener("touchend",q,{passive:!0}),()=>{document.removeEventListener("touchend",q)}},[e,te,y,n]);const ue=(W.type==="scale"||W.type==="fade")&&W.direction==="vert"&&ie.type==="drag";s.useEffect(()=>{var oe,Ee;if(!e||!ue||!((Ee=(oe=v.current)==null?void 0:oe.splide)!=null&&Ee.root))return;const q=v.current.splide.root,de=30,he=(pe,K)=>{if(V.current){const Ve=Math.abs(pe-V.current.x),Oe=Math.abs(K-V.current.y);(Ve>0||Oe>0)&&(ee.current=!0)}},Se=pe=>{V.current&&(pe.preventDefault(),he(pe.clientX,pe.clientY))},Pe=pe=>{V.current&&pe.touches.length>0&&(pe.preventDefault(),he(pe.touches[0].clientX,pe.touches[0].clientY))},Le=(pe,K)=>{if(!V.current||!v.current){V.current=null;return}const Ve=Math.abs(pe-V.current.x),Oe=Math.abs(K-V.current.y);Oe>de&&Oe>Ve&&v.current.go(K<V.current.y?"+1":"-1"),V.current=null},G=pe=>{V.current&&Le(pe.clientX,pe.clientY),document.removeEventListener("pointerup",G),document.removeEventListener("pointercancel",G),document.removeEventListener("pointermove",Se)},fe=pe=>{if(V.current){if(pe.changedTouches.length>0){const K=pe.changedTouches[0];Le(K.clientX,K.clientY)}document.removeEventListener("touchend",fe),document.removeEventListener("touchcancel",fe),document.removeEventListener("touchmove",Pe)}},ce=pe=>{V.current={x:pe.clientX,y:pe.clientY},ee.current=!1,document.addEventListener("pointermove",Se,{passive:!1}),document.addEventListener("pointerup",G),document.addEventListener("pointercancel",G)},U=pe=>{pe.touches.length>0&&(V.current={x:pe.touches[0].clientX,y:pe.touches[0].clientY},ee.current=!1,document.addEventListener("touchmove",Pe,{passive:!1}),document.addEventListener("touchend",fe),document.addEventListener("touchcancel",fe))};return q.addEventListener("pointerdown",ce),q.addEventListener("touchstart",U),()=>{q.removeEventListener("pointerdown",ce),q.removeEventListener("touchstart",U),document.removeEventListener("pointermove",Se),document.removeEventListener("pointerup",G),document.removeEventListener("pointercancel",G),document.removeEventListener("touchmove",Pe),document.removeEventListener("touchend",fe),document.removeEventListener("touchcancel",fe),V.current=null,ee.current=!1}},[e,ue,f]);const ge={backgroundColor:J.color,backdropFilter:`blur(${J.blur}px)`,animationDuration:`${parseInt(le.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(r)?null:Dn.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:l?null:P,className:rt(Ge.background,H?re:se,{[Ge.editor]:l},{[Ge.hidden]:!e}),style:{...ge,...R&&!l&&!H?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?P:null,className:rt(Ge.contentStyle,H?z:ye,{[Ge.editor]:l},{[Ge.hidden]:!e}),style:{animationDuration:`${parseInt(le.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(fs,{onMove:q=>L(q.index),ref:v,className:Ge.lightboxSplide,options:{arrows:!1,speed:W.duration?parseInt(W.duration):500,direction:W.direction==="horiz"||W.type==="fade"||W.type==="scale"?"ltr":"ttb",pagination:!1,drag:ie.type==="drag"&&!ue,perPage:1,width:"100%",height:"100%",type:W.type==="fade"||W.type==="scale"?"fade":"loop",padding:0,rewind:ie.repeat!=="close",start:0},style:{"--splide-speed":W.duration},children:n.map((q,de)=>{const he=Yo(Z.position,Z.offset,l),Se=`${_.scalingValue(Z.padding.top,l)} ${_.scalingValue(Z.padding.right,l)} ${_.scalingValue(Z.padding.bottom,l)} ${_.scalingValue(Z.padding.left,l)}`,Pe=W.type==="scale"?(()=>{const{transform:Le,...G}=he;return{...G,position:"absolute",padding:Se,boxSizing:"border-box","--position-transform":Le||"none"}})():{...he,position:"absolute",padding:Se,boxSizing:"border-box"};return a.jsx(ys,{children:a.jsx("div",{className:Ge.imgWrapper,onClick:we,children:a.jsx("img",{ref:de===y?T:null,className:rt(Ge.imageStyle,{[Ge.contain]:q.image.objectFit==="contain",[Ge.cover]:q.image.objectFit==="cover",[Ge.scaleSlide]:W.type==="scale"}),src:q.image.url,alt:q.image.name??"",style:{...Pe,pointerEvents:q.image.objectFit==="contain"?"none":"auto"}})})},de)})},f),F.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:rt(Ge.arrow,{[Ge.arrowVertical]:W.direction==="vert"}),style:{color:F.color,"--arrow-hover-color":F.hover},children:a.jsxs("button",{className:Ge.arrowInner,style:{transform:`translate(${_.scalingValue(F.offset.x,l)}, ${_.scalingValue(F.offset.y*(W.direction==="horiz"?1:-1),l)}) scale(${F.scale}) rotate(${W.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var q;return(q=v.current)==null?void 0:q.go("-1")},"aria-label":"Previous",children:[F.arrowsImgUrl&&a.jsx(an,{url:F.arrowsImgUrl,fill:F.color,hoverFill:F.hover,className:rt(Ge.arrowImg,Ge.mirror)}),!F.arrowsImgUrl&&a.jsx(Ys,{color:F.color,className:rt(Ge.arrowIcon,Ge.arrowImg,Ge.mirror)})]})}),a.jsx("div",{className:rt(Ge.arrow,Ge.nextArrow,{[Ge.arrowVertical]:W.direction==="vert"}),style:{color:F.color,"--arrow-hover-color":F.hover},children:a.jsxs("button",{className:Ge.arrowInner,style:{transform:`translate(${_.scalingValue(F.offset.x*(W.direction==="horiz"?-1:1),l)}, ${_.scalingValue(F.offset.y,l)}) scale(${F.scale}) rotate(${W.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var q;return(q=v.current)==null?void 0:q.go("+1")},"aria-label":"Next",children:[F.arrowsImgUrl&&a.jsx(an,{url:F.arrowsImgUrl,fill:F.color,hoverFill:F.hover,className:Ge.arrowImg}),!F.arrowsImgUrl&&a.jsx(Ys,{color:F.color,className:rt(Ge.arrowIcon,Ge.arrowImg)})]})})]}),J.closeIconUrl&&(()=>{const q=Yo(J.closeIconAlign,J.closeIconOffset,l),de=`scale(${J.closeIconScale})`,he=q.transform?`${q.transform} ${de}`:de;return a.jsx("button",{className:Ge.closeButton,style:{...q,transform:he},onClick:te,"aria-label":"Close lightbox",children:a.jsx(an,{url:J.closeIconUrl,fill:J.closeIconColor??"#000000",hoverFill:J.closeIconHover??"#cccccc"})})})(),Y&&Y.isActive&&i.imageCaption&&((ve=n[y])==null?void 0:ve.imageCaption)&&a.jsx("div",{className:Ge.caption,style:{...Yo(Y.alignment,Y.offset,l),fontFamily:eo(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":_.scalingValue(c.width,l),letterSpacing:_.scalingValue(p,l),wordSpacing:_.scalingValue(b,l),textAlign:w,fontSize:_.scalingValue(h.fontSize,l),lineHeight:_.scalingValue(h.lineHeight,l),textTransform:g.textTransform??"none",textDecoration:g.textDecoration??"none",fontVariant:g.fontVariant??"normal",color:m},onClick:q=>q.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:Ge.captionTextInner,style:{"--link-color":Y.linkColor,"--link-hover-color":Y.linkHoverColor},children:a.jsx(bi,{content:n[y].imageCaption})})}),ae.isActive&&(()=>{const[q,de]=ae.position.split("-"),he=W.direction==="horiz"?`${q}-left`:ae.position,Se=Yo(he,ae.offset,l),Pe=()=>{if(W.direction==="horiz"){if(de==="left")return"flex-start";if(de==="center")return"center";if(de==="right")return"flex-end"}else{if(q==="top")return"flex-start";if(q==="middle")return"center";if(q==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:E,className:Ge.thumbsWrapper,onClick:Le=>Ie(Le),style:{position:l?"absolute":"fixed",...Se,...W.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:rt(Ge.thumbsContainer,{[Ge.thumbsContainerVertical]:W.direction==="vert",[Ge.thumbsAlignStart]:ae.align==="start",[Ge.thumbsAlignCenter]:ae.align==="center",[Ge.thumbsAlignEnd]:ae.align==="end"}),style:{gap:_.scalingValue(ae.grid.gap,l),justifyContent:N?"flex-start":Pe()},children:n.map((Le,G)=>{const fe=G===y,ce=x[G],oe=ae.grid.size*(fe?ae.activeState.scale:1),Ee=()=>{if(ae.fit!=="fit")return{};if(!ce)return W.direction==="horiz"?{height:_.scalingValue(oe,l)}:{width:_.scalingValue(oe,l)};const pe=ce.width/ce.height;if(W.direction==="horiz"){const K=oe,Ve=K*pe;return{width:_.scalingValue(Ve,l),height:_.scalingValue(K,l)}}else{const K=oe,Ve=K/pe;return{width:_.scalingValue(K,l),height:_.scalingValue(Ve,l)}}};return a.jsx("button",{className:Ge.thumbItem,style:{...W.direction==="horiz"&&ae.fit!=="fit"?{height:_.scalingValue(oe,l)}:{},...W.direction==="vert"&&ae.fit!=="fit"?{width:_.scalingValue(oe,l)}:{},...ae.fit==="cover"?{width:_.scalingValue(oe,l),height:_.scalingValue(oe,l)}:{},...Ee(),transition:fe?"all 0.25s ease-out":"none",opacity:fe?ae.activeState.opacity/100:ae.opacity/100,"--thumb-hover":ae.activeState.opacity/100},onClick:pe=>{var K;pe.stopPropagation(),L(G),(K=v.current)==null||K.go(G)},onMouseEnter:()=>{var pe;ae.triggers==="hov"&&((pe=v.current)==null||pe.go(G))},children:a.jsx("img",{src:Le.image.url,alt:Le.image.name??"",onLoad:pe=>{const K=pe.currentTarget;K.naturalWidth&&K.naturalHeight&&A(Ve=>({...Ve,[G]:{width:K.naturalWidth,height:K.naturalHeight}}))},style:{objectFit:ae.fit==="cover"?"cover":"contain",...ae.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...ae.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Le.image.name}-${G}`)})})})})()]})]}),document.getElementById(r))};function Ys({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 eg={element:Jm,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 Zo(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function tg(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 ng({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:r}){const l=!!n,d=i&&t||!t,{prefix:c}=_.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:w=[],buttonLabel:b,gap:h,fieldsGap:g,buttonCorners:m,buttonStroke:v,buttonPadding:L,isButtonFullWidth:f,inputCorners:S,inputStroke:H,inputPadding:P,inputColor:R,inputTextColor:$,inputBorderColor:x,placeholderColor:A,buttonColor:y,buttonTextColor:F,buttonBorderColor:T,labelTextColor:j,successColor:E,errorColor:B,fontFamily:O,inputFontSettings:z,inputFontSize:ee,inputLineHeight:k,inputLetterSpacing:W,inputWordSpacing:D,inputTextAppearance:le,buttonFontSettings:Y,buttonFontSize:I,buttonLineHeight:oe,buttonLetterSpacing:N,buttonWordSpacing:ie,buttonTextAppearance:Z,labelFontSettings:te,labelFontSize:Se,labelLineHeight:se,labelLetterSpacing:ae,labelWordSpacing:V,labelTextAppearance:J,statusFontSettings:Q,statusFontSize:Me,statusLineHeight:be,statusLetterSpacing:Ie,statusWordSpacing:ue,statusTextAppearance:ge,successMessage:ye,errorMessage:q,stateOverrides:de}=e,he=u==="B",we=w.slice(0,Math.min(p,w.length)),Pe={fontSettings:{fontFamily:O,fontWeight:(z==null?void 0:z.fontWeight)??400,fontStyle:(z==null?void 0:z.fontStyle)??"normal"},fontSize:ee??.01,lineHeight:k,letterSpacing:W??0,wordSpacing:D??0,textAppearance:le,color:$},Le=rn(qt(Pe,t)),G=_.scalingValue(H??0,t),fe=_.scalingValue((k??ee??.01)+((P==null?void 0:P.top)??0)+((P==null?void 0:P.bottom)??0)+(u==="C"?H??0:(H??0)*2),t),ce={...Le,borderStyle:"solid",borderRadius:u==="C"?0:_.scalingValue(S??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:G,borderLeftWidth:0}:{borderWidth:G},paddingTop:_.scalingValue((P==null?void 0:P.top)??0,t),paddingRight:_.scalingValue((P==null?void 0:P.right)??0,t),paddingBottom:_.scalingValue((P==null?void 0:P.bottom)??0,t),paddingLeft:_.scalingValue((P==null?void 0:P.left)??0,t),height:fe,minHeight:fe},U={fontSettings:{fontFamily:O,fontWeight:(Y==null?void 0:Y.fontWeight)??400,fontStyle:(Y==null?void 0:Y.fontStyle)??"normal"},fontSize:I??.01,lineHeight:oe,letterSpacing:N??0,wordSpacing:ie??0,textAppearance:Z,color:F},re=rn(qt(U,t)),Ee=_.scalingValue(v??0,t),pe={fontSettings:{fontFamily:O,fontWeight:(te==null?void 0:te.fontWeight)??400,fontStyle:(te==null?void 0:te.fontStyle)??"normal"},fontSize:Se??.01,lineHeight:se,letterSpacing:ae??0,wordSpacing:V??0,textAppearance:J,color:j},K=qt(pe,t),Ve={fontSettings:{fontFamily:O,fontWeight:(Q==null?void 0:Q.fontWeight)??400,fontStyle:(Q==null?void 0:Q.fontStyle)??"normal"},fontSize:Me??.01,lineHeight:be,letterSpacing:Ie??0,wordSpacing:ue??0,textAppearance:ge,color:E},Oe=rn(qt(Ve,t)),lt=_.buildColorVars(c,{inputColor:R,inputTextColor:$,inputBorderColor:x,placeholderColor:A!=null&&A.trim()?A:"#cccccc",buttonColor:y,buttonTextColor:F,buttonBorderColor:T,labelTextColor:j,successColor:E,errorColor:B},ig,og,de),[tt,ht]=s.useState(()=>Object.fromEntries(we.map(_e=>[_e.name,""]))),[nt,ze]=s.useState("idle"),[xe,Ae]=s.useState(null),De=r==="success"?"success":r==="error"?"error":nt,Ue=r==="error"?q:xe,Ce=r==="filled",Ne=s.useMemo(()=>{if(!Ce)return tt;let _e=null;for(const Xe of we)(tt[Xe.name]??"").trim().length>0||(_e=_e??{...tt},_e[Xe.name]="Filled");return _e??tt},[tt,Ce,we]),Be=De==="error"?_.getFormFieldValidationError(we,Ne):null,ct=`${r&&r!=="default"?`${c}-state-${r}`:""}`.trim(),Je=o==null?void 0:o.submitUrl,$t=(_e,Xe)=>{ht(je=>({...je,[_e]:Xe}))},dt=async _e=>{if(_e.preventDefault(),!d)return;const Xe=Object.fromEntries(we.map(ut=>{var pt;return[ut.name,((pt=tt[ut.name])==null?void 0:pt.trim())??""]}).filter(([,ut])=>ut));if(!Je){ze("error"),Ae("No integrations were found for this form.");return}if(Object.keys(Xe).length===0)return;const je=_.getFormFieldValidationError(we,tt);if(je){ze("error"),Ae(je);return}ze("submitting"),Ae(null);try{const ut=await fetch(Je,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Xe)});if(!ut.ok){const pt=await ut.text();throw new Error(pt||`Request failed: ${ut.status}`)}ze("success"),ht(Object.fromEntries(we.map(pt=>[pt.name,""])))}catch(ut){ze("error"),Ae(ut instanceof Error?ut.message:"Something went wrong")}};return a.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${ct}`.trim(),style:lt,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:tg(c)}}),a.jsxs("form",{onSubmit:dt,className:`${c}-form`,children:[a.jsx("div",{className:`${c}-fields`,children:we.map((_e,Xe)=>a.jsxs(s.Fragment,{children:[Xe>0&&a.jsx("div",{"data-controls":l?"fieldsGap":void 0,className:l?`${c}-control`:void 0,style:{height:_.scalingValue(g??0,t)}}),a.jsxs("div",{className:`${c}-field-group${he?` ${c}-labeled`:""}`,children:[he&&a.jsx("span",{className:`${c}-field-label`,style:K?{...K,lineHeight:K.fontSize}:void 0,children:_e.label||_e.name}),_e.type==="textarea"?a.jsx("textarea",{name:_e.name,autoComplete:"off",value:Ne[_e.name]??"",onChange:je=>$t(_e.name,je.target.value),placeholder:_e.placeholder,className:`${c}-input`,style:ce,rows:1,"data-filled":Ce||(Ne[_e.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:_e.type==="phone"?"tel":_e.type==="email"?"email":"text",name:_e.name,autoComplete:"off",value:Ne[_e.name]??"",onChange:je=>$t(_e.name,je.target.value),placeholder:_e.placeholder,required:_e.isRequired??_e.type==="email",className:`${c}-input`,style:ce,"data-filled":Ce||(Ne[_e.name]??"").trim().length>0})]})]},Xe))}),a.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${c}-control`:void 0,style:{height:_.scalingValue(h??0,t)}}),a.jsx("div",{className:`${c}-overlay-anchor`,children:a.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:_.scalingValue(m??0,t),borderWidth:Ee,paddingTop:_.scalingValue((L==null?void 0:L.top)??0,t),paddingRight:_.scalingValue((L==null?void 0:L.right)??0,t),paddingBottom:_.scalingValue((L==null?void 0:L.bottom)??0,t),paddingLeft:_.scalingValue((L==null?void 0:L.left)??0,t),pointerEvents:d?"auto":void 0,...re,...f?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:a.jsx("span",{className:`${c}-overlay-anchor`,style:f?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:nt==="submitting"?"...":b})})})]}),De==="success"&&a.jsx("p",{className:`${c}-success`,style:{...Oe},children:ye}),De==="error"&&a.jsx("p",{className:`${c}-error`,style:{...Oe},role:"alert",children:Be??Ue??q})]})}const ig={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"},og=["hover","focus","filled","success","error"],rg=`import React, { useMemo, useState } from 'react';
158
+ `}function ng({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:r}){const l=!!n,d=i&&t||!t,{prefix:c}=_.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:w=[],buttonLabel:b,gap:h,fieldsGap:g,buttonCorners:m,buttonStroke:y,buttonPadding:L,isButtonFullWidth:f,inputCorners:S,inputStroke:H,inputPadding:I,inputColor:R,inputTextColor:$,inputBorderColor:x,placeholderColor:A,buttonColor:v,buttonTextColor:k,buttonBorderColor:T,labelTextColor:D,successColor:P,errorColor:B,fontFamily:O,inputFontSettings:V,inputFontSize:ee,inputLineHeight:E,inputLetterSpacing:N,inputWordSpacing:j,inputTextAppearance:le,buttonFontSettings:ie,buttonFontSize:W,buttonLineHeight:ae,buttonLetterSpacing:F,buttonWordSpacing:J,buttonTextAppearance:Y,labelFontSettings:Z,labelFontSize:ye,labelLineHeight:se,labelLetterSpacing:re,labelWordSpacing:z,labelTextAppearance:Q,statusFontSettings:te,statusFontSize:Me,statusLineHeight:we,statusLetterSpacing:Ie,statusWordSpacing:ue,statusTextAppearance:ge,successMessage:ve,errorMessage:q,stateOverrides:de}=e,he=u==="B",Se=w.slice(0,Math.min(p,w.length)),Pe={fontSettings:{fontFamily:O,fontWeight:(V==null?void 0:V.fontWeight)??400,fontStyle:(V==null?void 0:V.fontStyle)??"normal"},fontSize:ee??.01,lineHeight:E,letterSpacing:N??0,wordSpacing:j??0,textAppearance:le,color:$},Le=rn(qt(Pe,t)),G=_.scalingValue(H??0,t),fe=_.scalingValue((E??ee??.01)+((I==null?void 0:I.top)??0)+((I==null?void 0:I.bottom)??0)+(u==="C"?H??0:(H??0)*2),t),ce={...Le,borderStyle:"solid",borderRadius:u==="C"?0:_.scalingValue(S??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:G,borderLeftWidth:0}:{borderWidth:G},paddingTop:_.scalingValue((I==null?void 0:I.top)??0,t),paddingRight:_.scalingValue((I==null?void 0:I.right)??0,t),paddingBottom:_.scalingValue((I==null?void 0:I.bottom)??0,t),paddingLeft:_.scalingValue((I==null?void 0:I.left)??0,t),height:fe,minHeight:fe},U={fontSettings:{fontFamily:O,fontWeight:(ie==null?void 0:ie.fontWeight)??400,fontStyle:(ie==null?void 0:ie.fontStyle)??"normal"},fontSize:W??.01,lineHeight:ae,letterSpacing:F??0,wordSpacing:J??0,textAppearance:Y,color:k},oe=rn(qt(U,t)),Ee=_.scalingValue(y??0,t),pe={fontSettings:{fontFamily:O,fontWeight:(Z==null?void 0:Z.fontWeight)??400,fontStyle:(Z==null?void 0:Z.fontStyle)??"normal"},fontSize:ye??.01,lineHeight:se,letterSpacing:re??0,wordSpacing:z??0,textAppearance:Q,color:D},K=qt(pe,t),Ve={fontSettings:{fontFamily:O,fontWeight:(te==null?void 0:te.fontWeight)??400,fontStyle:(te==null?void 0:te.fontStyle)??"normal"},fontSize:Me??.01,lineHeight:we,letterSpacing:Ie??0,wordSpacing:ue??0,textAppearance:ge,color:P},Oe=rn(qt(Ve,t)),lt=_.buildColorVars(c,{inputColor:R,inputTextColor:$,inputBorderColor:x,placeholderColor:A!=null&&A.trim()?A:"#cccccc",buttonColor:v,buttonTextColor:k,buttonBorderColor:T,labelTextColor:D,successColor:P,errorColor:B},ig,og,de),[tt,ht]=s.useState(()=>Object.fromEntries(Se.map(_e=>[_e.name,""]))),[nt,ze]=s.useState("idle"),[be,Ae]=s.useState(null),De=r==="success"?"success":r==="error"?"error":nt,Ue=r==="error"?q:be,Ce=r==="filled",Ne=s.useMemo(()=>{if(!Ce)return tt;let _e=null;for(const Xe of Se)(tt[Xe.name]??"").trim().length>0||(_e=_e??{...tt},_e[Xe.name]="Filled");return _e??tt},[tt,Ce,Se]),Be=De==="error"?_.getFormFieldValidationError(Se,Ne):null,ct=`${r&&r!=="default"?`${c}-state-${r}`:""}`.trim(),Je=o==null?void 0:o.submitUrl,$t=(_e,Xe)=>{ht(je=>({...je,[_e]:Xe}))},dt=async _e=>{if(_e.preventDefault(),!d)return;const Xe=Object.fromEntries(Se.map(ut=>{var pt;return[ut.name,((pt=tt[ut.name])==null?void 0:pt.trim())??""]}).filter(([,ut])=>ut));if(!Je){ze("error"),Ae("No integrations were found for this form.");return}if(Object.keys(Xe).length===0)return;const je=_.getFormFieldValidationError(Se,tt);if(je){ze("error"),Ae(je);return}ze("submitting"),Ae(null);try{const ut=await fetch(Je,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Xe)});if(!ut.ok){const pt=await ut.text();throw new Error(pt||`Request failed: ${ut.status}`)}ze("success"),ht(Object.fromEntries(Se.map(pt=>[pt.name,""])))}catch(ut){ze("error"),Ae(ut instanceof Error?ut.message:"Something went wrong")}};return a.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${ct}`.trim(),style:lt,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:tg(c)}}),a.jsxs("form",{onSubmit:dt,className:`${c}-form`,children:[a.jsx("div",{className:`${c}-fields`,children:Se.map((_e,Xe)=>a.jsxs(s.Fragment,{children:[Xe>0&&a.jsx("div",{"data-controls":l?"fieldsGap":void 0,className:l?`${c}-control`:void 0,style:{height:_.scalingValue(g??0,t)}}),a.jsxs("div",{className:`${c}-field-group${he?` ${c}-labeled`:""}`,children:[he&&a.jsx("span",{className:`${c}-field-label`,style:K?{...K,lineHeight:K.fontSize}:void 0,children:_e.label||_e.name}),_e.type==="textarea"?a.jsx("textarea",{name:_e.name,autoComplete:"off",value:Ne[_e.name]??"",onChange:je=>$t(_e.name,je.target.value),placeholder:_e.placeholder,className:`${c}-input`,style:ce,rows:1,"data-filled":Ce||(Ne[_e.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:_e.type==="phone"?"tel":_e.type==="email"?"email":"text",name:_e.name,autoComplete:"off",value:Ne[_e.name]??"",onChange:je=>$t(_e.name,je.target.value),placeholder:_e.placeholder,required:_e.isRequired??_e.type==="email",className:`${c}-input`,style:ce,"data-filled":Ce||(Ne[_e.name]??"").trim().length>0})]})]},Xe))}),a.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${c}-control`:void 0,style:{height:_.scalingValue(h??0,t)}}),a.jsx("div",{className:`${c}-overlay-anchor`,children:a.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:_.scalingValue(m??0,t),borderWidth:Ee,paddingTop:_.scalingValue((L==null?void 0:L.top)??0,t),paddingRight:_.scalingValue((L==null?void 0:L.right)??0,t),paddingBottom:_.scalingValue((L==null?void 0:L.bottom)??0,t),paddingLeft:_.scalingValue((L==null?void 0:L.left)??0,t),pointerEvents:d?"auto":void 0,...oe,...f?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:a.jsx("span",{className:`${c}-overlay-anchor`,style:f?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:nt==="submitting"?"...":b})})})]}),De==="success"&&a.jsx("p",{className:`${c}-success`,style:{...Oe},children:ve}),De==="error"&&a.jsx("p",{className:`${c}-error`,style:{...Oe},role:"alert",children:Be??Ue??q})]})}const ig={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"},og=["hover","focus","filled","success","error"],rg=`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';
@@ -980,7 +980,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
980
980
  font-size: ${Qo(14)};
981
981
  color: var(--${e}-error-error-color, var(--${e}-error-color));
982
982
  }
983
- `}const ug=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:r}=_.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:w,inputFontSettings:b,inputFontSize:h,inputLineHeight:g,inputLetterSpacing:m,inputWordSpacing:v,inputTextAppearance:L,buttonFontSettings:f,buttonFontSize:S,buttonLineHeight:H,buttonLetterSpacing:P,buttonWordSpacing:R,buttonTextAppearance:$,statusFontSettings:x,statusFontSize:A,statusLineHeight:y,statusLetterSpacing:F,statusWordSpacing:T,statusTextAppearance:j,iconMaxWidth:E,minHeight:B,corners:O,stroke:z,stateOverrides:ee,inputPadding:k,buttonPadding:W,successMessage:D="Thanks for subscribing!",errorMessage:le="Please, fill all required fields."}=e,Y=d.slice(0,Math.min(p,d.length)),[I,oe]=s.useState(()=>Object.fromEntries(Y.map(pe=>[pe.name,""]))),[N,ie]=s.useState("idle"),[Z,te]=s.useState(null),Se=o==="success"?"success":o==="error"?"error":N,se=o==="error"?le:Z,ae=o==="filled",V=s.useMemo(()=>{if(!ae)return I;let pe=null;for(const K of Y)(I[K.name]??"").trim().length>0||(pe=pe??{...I},pe[K.name]="Filled");return pe??I},[ae,I,Y]),J=Se==="error"?_.getFormFieldValidationError(Y,V):null,Q=o&&o!=="default"?`${r}-state-${o}`:"",Me=Y.some(pe=>(V[pe.name]??"").trim().length>0),be=Q!==`${r}-state-filled`&&Me?`${r}-state-filled`:"",Ie=`${Q} ${be}`.trim(),ue=i==null?void 0:i.submitUrl,ge=u??"",ye=(c==null?void 0:c.icon)??"",q=(c==null?void 0:c.mode)==="On",de=ge||"Submit",he={fontSettings:{fontFamily:w,fontWeight:(b==null?void 0:b.fontWeight)??400,fontStyle:(b==null?void 0:b.fontStyle)??"normal"},fontSize:h??.01,lineHeight:g,letterSpacing:m??0,wordSpacing:v??0,textAppearance:L,color:e.inputTextColor??"#111111"},we={fontSettings:{fontFamily:w,fontWeight:(f==null?void 0:f.fontWeight)??400,fontStyle:(f==null?void 0:f.fontStyle)??"normal"},fontSize:S??.01,lineHeight:H,letterSpacing:P??0,wordSpacing:R??0,textAppearance:$,color:e.buttonTextColor??"#ffffff"},Pe={fontSettings:{fontFamily:w,fontWeight:(x==null?void 0:x.fontWeight)??400,fontStyle:(x==null?void 0:x.fontStyle)??"normal"},fontSize:A??.01,lineHeight:y,letterSpacing:F??0,wordSpacing:T??0,textAppearance:j,color:e.successColor??"#22c55e"},Le=rn(qt(he,t)),G=rn(qt(we,t)),fe=rn(qt(Pe,t)),ce=_.buildColorVars(r,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(he==null?void 0:he.color)??"#111111",buttonTextColor:e.buttonTextColor??(we==null?void 0:we.color)??"#ffffff"},pg,mg,ee),U={borderRadius:_.scalingValue(O,t),borderWidth:_.scalingValue(z,t),borderStyle:"solid"},re={borderLeftWidth:_.scalingValue(z,t)},Ee=async pe=>{if(pe.preventDefault(),!l)return;const K=Object.fromEntries(Y.map(Oe=>{var lt;return[Oe.name,((lt=I[Oe.name])==null?void 0:lt.trim())??""]}).filter(([,Oe])=>Oe));if(!ue){ie("error"),te("No integrations were found for this form.");return}if(Object.keys(K).length===0)return;const Ve=_.getFormFieldValidationError(Y,I);if(Ve){ie("error"),te(Ve);return}ie("submitting"),te(null);try{const Oe=await fetch(ue,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(K)});if(!Oe.ok){const lt=await Oe.text();throw new Error(lt||`Request failed: ${Oe.status}`)}ie("success"),oe(Object.fromEntries(Y.map(lt=>[lt.name,""])))}catch(Oe){ie("error"),te(Oe instanceof Error?Oe.message:"Something went wrong")}};return a.jsxs("div",{className:`${r}-wrapper ${Ie}`.trim(),style:ce,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:dg(r)}}),a.jsxs("form",{onSubmit:Ee,className:`${r}-form`,style:{...U,height:_.scalingValue(B,t),minHeight:_.scalingValue(B,t)},children:[a.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:Y.map(pe=>a.jsx("input",{type:pe.type==="email"?"email":pe.type==="phone"?"tel":"text",name:pe.name,autoComplete:"off",value:V[pe.name]??"",onChange:K=>oe(Ve=>({...Ve,[pe.name]:K.target.value})),placeholder:pe.placeholder,required:pe.isRequired??pe.type==="email",className:`${r}-input`,style:{...Le,paddingRight:_.scalingValue(k.right,t),paddingLeft:_.scalingValue(k.left,t),paddingTop:_.scalingValue(k.top,t),paddingBottom:_.scalingValue(k.bottom,t)}},pe.name))}),a.jsx("div",{className:`${r}-overlayAnchor`,children:a.jsx("button",{type:l?"submit":"button",className:`${r}-submitBtn`,"aria-label":de,style:{...G,...re,paddingRight:_.scalingValue(W.right,t),paddingLeft:_.scalingValue(W.left,t),paddingTop:_.scalingValue(W.top,t),paddingBottom:_.scalingValue(W.bottom,t),pointerEvents:l?"auto":void 0},children:N==="submitting"?"...":q?ye&&a.jsx(an,{url:ye,className:`${r}-submitBtnIcon`,style:{maxWidth:_.scalingValue(E??0,t)},fill:`var(--${r}-button-text-color)`,hoverFill:`var(--${r}-button-text-color)`}):ge})})]}),Se==="success"&&a.jsx("p",{className:`${r}-success`,style:{...fe},children:D}),Se==="error"&&a.jsx("p",{className:`${r}-error`,style:{...fe},role:"alert",children:J??se??le})]})},pg={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"},mg=["hover","focus","filled","success","error"],gg=`import React, { useMemo, useState } from 'react';
983
+ `}const ug=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:r}=_.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:w,inputFontSettings:b,inputFontSize:h,inputLineHeight:g,inputLetterSpacing:m,inputWordSpacing:y,inputTextAppearance:L,buttonFontSettings:f,buttonFontSize:S,buttonLineHeight:H,buttonLetterSpacing:I,buttonWordSpacing:R,buttonTextAppearance:$,statusFontSettings:x,statusFontSize:A,statusLineHeight:v,statusLetterSpacing:k,statusWordSpacing:T,statusTextAppearance:D,iconMaxWidth:P,minHeight:B,corners:O,stroke:V,stateOverrides:ee,inputPadding:E,buttonPadding:N,successMessage:j="Thanks for subscribing!",errorMessage:le="Please, fill all required fields."}=e,ie=d.slice(0,Math.min(p,d.length)),[W,ae]=s.useState(()=>Object.fromEntries(ie.map(pe=>[pe.name,""]))),[F,J]=s.useState("idle"),[Y,Z]=s.useState(null),ye=o==="success"?"success":o==="error"?"error":F,se=o==="error"?le:Y,re=o==="filled",z=s.useMemo(()=>{if(!re)return W;let pe=null;for(const K of ie)(W[K.name]??"").trim().length>0||(pe=pe??{...W},pe[K.name]="Filled");return pe??W},[re,W,ie]),Q=ye==="error"?_.getFormFieldValidationError(ie,z):null,te=o&&o!=="default"?`${r}-state-${o}`:"",Me=ie.some(pe=>(z[pe.name]??"").trim().length>0),we=te!==`${r}-state-filled`&&Me?`${r}-state-filled`:"",Ie=`${te} ${we}`.trim(),ue=i==null?void 0:i.submitUrl,ge=u??"",ve=(c==null?void 0:c.icon)??"",q=(c==null?void 0:c.mode)==="On",de=ge||"Submit",he={fontSettings:{fontFamily:w,fontWeight:(b==null?void 0:b.fontWeight)??400,fontStyle:(b==null?void 0:b.fontStyle)??"normal"},fontSize:h??.01,lineHeight:g,letterSpacing:m??0,wordSpacing:y??0,textAppearance:L,color:e.inputTextColor??"#111111"},Se={fontSettings:{fontFamily:w,fontWeight:(f==null?void 0:f.fontWeight)??400,fontStyle:(f==null?void 0:f.fontStyle)??"normal"},fontSize:S??.01,lineHeight:H,letterSpacing:I??0,wordSpacing:R??0,textAppearance:$,color:e.buttonTextColor??"#ffffff"},Pe={fontSettings:{fontFamily:w,fontWeight:(x==null?void 0:x.fontWeight)??400,fontStyle:(x==null?void 0:x.fontStyle)??"normal"},fontSize:A??.01,lineHeight:v,letterSpacing:k??0,wordSpacing:T??0,textAppearance:D,color:e.successColor??"#22c55e"},Le=rn(qt(he,t)),G=rn(qt(Se,t)),fe=rn(qt(Pe,t)),ce=_.buildColorVars(r,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(he==null?void 0:he.color)??"#111111",buttonTextColor:e.buttonTextColor??(Se==null?void 0:Se.color)??"#ffffff"},pg,mg,ee),U={borderRadius:_.scalingValue(O,t),borderWidth:_.scalingValue(V,t),borderStyle:"solid"},oe={borderLeftWidth:_.scalingValue(V,t)},Ee=async pe=>{if(pe.preventDefault(),!l)return;const K=Object.fromEntries(ie.map(Oe=>{var lt;return[Oe.name,((lt=W[Oe.name])==null?void 0:lt.trim())??""]}).filter(([,Oe])=>Oe));if(!ue){J("error"),Z("No integrations were found for this form.");return}if(Object.keys(K).length===0)return;const Ve=_.getFormFieldValidationError(ie,W);if(Ve){J("error"),Z(Ve);return}J("submitting"),Z(null);try{const Oe=await fetch(ue,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(K)});if(!Oe.ok){const lt=await Oe.text();throw new Error(lt||`Request failed: ${Oe.status}`)}J("success"),ae(Object.fromEntries(ie.map(lt=>[lt.name,""])))}catch(Oe){J("error"),Z(Oe instanceof Error?Oe.message:"Something went wrong")}};return a.jsxs("div",{className:`${r}-wrapper ${Ie}`.trim(),style:ce,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:dg(r)}}),a.jsxs("form",{onSubmit:Ee,className:`${r}-form`,style:{...U,height:_.scalingValue(B,t),minHeight:_.scalingValue(B,t)},children:[a.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:ie.map(pe=>a.jsx("input",{type:pe.type==="email"?"email":pe.type==="phone"?"tel":"text",name:pe.name,autoComplete:"off",value:z[pe.name]??"",onChange:K=>ae(Ve=>({...Ve,[pe.name]:K.target.value})),placeholder:pe.placeholder,required:pe.isRequired??pe.type==="email",className:`${r}-input`,style:{...Le,paddingRight:_.scalingValue(E.right,t),paddingLeft:_.scalingValue(E.left,t),paddingTop:_.scalingValue(E.top,t),paddingBottom:_.scalingValue(E.bottom,t)}},pe.name))}),a.jsx("div",{className:`${r}-overlayAnchor`,children:a.jsx("button",{type:l?"submit":"button",className:`${r}-submitBtn`,"aria-label":de,style:{...G,...oe,paddingRight:_.scalingValue(N.right,t),paddingLeft:_.scalingValue(N.left,t),paddingTop:_.scalingValue(N.top,t),paddingBottom:_.scalingValue(N.bottom,t),pointerEvents:l?"auto":void 0},children:F==="submitting"?"...":q?ve&&a.jsx(an,{url:ve,className:`${r}-submitBtnIcon`,style:{maxWidth:_.scalingValue(P??0,t)},fill:`var(--${r}-button-text-color)`,hoverFill:`var(--${r}-button-text-color)`}):ge})})]}),ye==="success"&&a.jsx("p",{className:`${r}-success`,style:{...fe},children:j}),ye==="error"&&a.jsx("p",{className:`${r}-error`,style:{...fe},role:"alert",children:Q??se??le})]})},pg={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"},mg=["hover","focus","filled","success","error"],gg=`import React, { useMemo, useState } from 'react';
984
984
  import { CommonComponentProps } from '../props';
985
985
  import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
986
986
  import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
@@ -1689,7 +1689,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
1689
1689
  .${e}-image-hover-grayscale:hover video {
1690
1690
  filter: grayscale(100%);
1691
1691
  }
1692
- `}const wg=30,Sg=20,na=3,$g=12,Cg=32,Tg=3,Lg=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")},Rg=(e,t)=>Array.from({length:t},()=>e).flat(),Ig=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},Jc=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),Zs=(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=Jc(d);return c<=0?0:c+r*Math.max(0,t-1)},Pg=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=Jc(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},Mg=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},Eg=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>Mg(i,e))},kg=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??"")},Ag=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,Fg=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:r,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var T,j,E,B;const p=s.useRef(null),w=!!((T=e.image)!=null&&T.url&&kg(e.image));s.useLayoutEffect(()=>{d&&Ag(p.current)&&(u==null||u())},[d,(j=e.image)==null?void 0:j.url,u]);const b=n.display==="cover",h=n.ratioValue??"1:1",g=n.reversed??!1,[m,v]=h.split(":").map(Number),S=(g?v:m)/(g?m:v),H=i/S,P=H>o?o:H,R=H>o?o*S:i,$=c(R),x=c(P),A={borderRadius:c(r)},y=b?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...A}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:c(i),maxHeight:c(o),objectFit:"contain",...A},F=((E=e.image)==null?void 0:E.url)&&(w?a.jsx("video",{ref:O=>{p.current=O},src:e.image.url,style:y,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:d?u:void 0,onError:d?u:void 0}):a.jsx("img",{ref:O=>{p.current=O},src:e.image.url,alt:((B=e.image)==null?void 0:B.name)??"",style:y,onLoad:d?u:void 0,onError:d?u:void 0}));return a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...b?{width:$}:{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,...b?{width:$,height:x,overflow:"hidden",...A}:{width:"max-content",maxWidth:c(i),height:c(o)}},children:F&&e.link?a.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:rt(`${t}-marquee-link`,!b&&`${t}-marquee-link-contain`),children:F}):F})})},_g=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=_.useScopedStyles(),[l,d]=s.useState(0),c=l>0?Math.round(l):0,u=s.useMemo(()=>bg(r,c),[r,c]),{speed:p,direction:w,pauseOnHover:b,gap:h,imageMaxWidth:g,imageMaxHeight:m,hoverEffect:v,cornerRadius:L=0}=e,f=s.useMemo(()=>Ig(e.imageFit),[e.imageFit]),S=(t==null?void 0:t.length)??0,H=!!o,P=!n||!!i,R=P&&v!=="off"&&v!=="randomize"?`${r}-image-hover-${v}`:void 0,$=n?!!i:!0,A=((t==null?void 0:t.length)??0)>0&&($||!!n),y=Math.max(0,p)*wg,F=be=>_.scalingValue(be,n??!1),T=s.useRef(null),j=s.useRef(null),E=s.useRef(null),[B,O]=s.useState(0),z=$&&b==="on",[ee,k]=s.useState(!1),[W,D]=s.useState({}),le=s.useRef(W);le.current=W;const Y=s.useRef(null),I=s.useRef(0),oe=s.useRef(null),N=s.useMemo(()=>(t??[]).map(be=>{var Ie;return((Ie=be.image)==null?void 0:Ie.url)??""}).join("\0"),[t]),[ie,Z]=s.useState(na),te=s.useMemo(()=>{const be=t??[];return be.length===0||!($||!!n)?be:Rg(be,ie)},[t,$,ie,n]),Se=s.useMemo(()=>(t??[]).filter(be=>{var Ie;return!!((Ie=be.image)!=null&&Ie.url)}).length,[t]),se=A?Tg:1;s.useLayoutEffect(()=>{I.current=0,D({}),Y.current=null,Z(na),d(0)},[N]),s.useEffect(()=>{if(!P||v!=="randomize")return;const be=T.current;if(!be)return;const Ie=q=>{D(de=>{const he=Array.from(q).filter(Pe=>Pe in de&&!Eg(be,Pe));if(he.length===0)return de;const we={...de};return he.forEach(Pe=>{delete we[Pe]}),we})},ue=new IntersectionObserver(q=>{const de=new Set;for(const he of q){const we=he.target.dataset.marqueeItemIndex,Pe=we!==void 0?Number(we):NaN;Number.isNaN(Pe)||de.add(Pe)}de.size>0&&Ie(de)},{root:be,threshold:0});Object.keys(W).forEach(q=>{const de=Number(q);be.querySelectorAll(`[data-marquee-item-index="${de}"]`).forEach(he=>ue.observe(he))});const ge={current:0},ye=()=>{const q=Object.keys(le.current);q.length!==0&&(Ie(q.map(Number)),ge.current=requestAnimationFrame(ye))};return Object.keys(le.current).length>0&&(ge.current=requestAnimationFrame(ye)),()=>{cancelAnimationFrame(ge.current),ue.disconnect()}},[v,W,P]),s.useLayoutEffect(()=>{if(!A)return;const be=T.current,Ie=E.current;if(!be||!Ie)return;const ue={current:0},ge=()=>{const de=be.getBoundingClientRect().width||be.offsetWidth,he=Pg(Ie),we=Y.current,Pe=typeof we=="number"&&Math.abs(we-he)<=.25;Y.current=he;let Le=ie,G=0;if(($||n)&&S>0&&de>0){const U=Zs(Ie,S);if(U>=Cg){G=U;const re=Math.min($g,Math.max(na,Math.ceil(de/U)+1));Le=re,re!==ie&&Z(re)}}const ce=Le!==ie&&G>0?G*Le:he>0?he:G>0?G*Le:(()=>{const U=Zs(Ie,S);return U>0?U*Le:0})();ce>0?d(U=>U<=0?ce:!Pe||Math.round(U)===Math.round(ce)?U:ce):!Pe&&l<=0&&(cancelAnimationFrame(ue.current),ue.current=requestAnimationFrame(ge))},ye=()=>{cancelAnimationFrame(ue.current),ue.current=requestAnimationFrame(ge)};oe.current=ye,ye();const q=new ResizeObserver(ye);return q.observe(be),q.observe(Ie),()=>{oe.current=null,cancelAnimationFrame(ue.current),q.disconnect()}},[$,A,l,N,ie,S,n]),s.useLayoutEffect(()=>{if(!A||c<=0)return;const be=j.current;be&&Lg(be)},[A,c,w,y]),s.useLayoutEffect(()=>{if(!A||l<=0){O(0);return}const be=j.current,Ie=E.current;if(!be||!Ie)return;const ue=()=>{const ye=be.offsetHeight||be.getBoundingClientRect().height,q=Array.from(Ie.children).reduce((he,we)=>Math.max(he,we.offsetHeight||we.getBoundingClientRect().height),0),de=ye>0?ye:q;O(de>0?de:0)};ue();const ge=new ResizeObserver(ue);return ge.observe(be),ge.observe(Ie),()=>ge.disconnect()},[A,se,te,n,h,g,m,l,f,W]),s.useLayoutEffect(()=>{if(!n||!H||!A||typeof window>"u")return;const be=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(be)},[n,H,A,w,l,B,h,te]);const ae=()=>{z&&k(!0)},V=()=>{z&&k(!1)},J=s.useCallback(()=>{var be;I.current=Math.min(Se,I.current+1),(be=oe.current)==null||be.call(oe)},[Se]),Q=s.useCallback((be,Ie)=>{D(ue=>{const ge=ue[be]??Ie,ye=(t??[]).filter(de=>de!==ge);if(ye.length===0)return ue;const q=ye[Math.floor(Math.random()*ye.length)];return{...ue,[be]:q}})},[t]),Me=(be,Ie,ue,ge)=>{const ye=P&&v==="randomize"&&f.display==="cover"?W[ue]??be:be,q=`max(${F(h)}, ${Sg}px)`,de=`calc(-0.5 * (${q} + ${F(h)}))`;return a.jsxs("div",{className:`${r}-marquee-card`,"data-marquee-item-index":ue,onMouseEnter:P&&v==="randomize"&&f.display==="cover"?()=>Q(ue,be):void 0,children:[a.jsx(Fg,{item:ye,prefix:r,imageFit:f,imageMaxWidth:g,imageMaxHeight:m,cornerRadius:L,imageHoverClass:R,isEditor:n,isFirstSet:ge,scaled:F,onFirstSetImageDone:J}),H&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${r}-gap-control`,style:{position:"absolute",top:0,right:de,width:q,height:"100%"}})]},`${Ie}-${ue}`)};if(A){const be=$?z&&ee?"paused":"running":"paused",Ie=c>0&&y>0?c/y*1e3:0,ue=`${Math.max(0,Ie)/1e3}s`;return a.jsxs("div",{ref:T,className:rt(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Marquee",style:B>0?{height:B}:void 0,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{ref:j,className:`${r}-marquee-track`,"data-direction":w,onMouseEnter:ae,onMouseLeave:V,style:{WebkitAnimationDuration:ue,animationDuration:ue,WebkitAnimationPlayState:be,animationPlayState:be},children:Array.from({length:se},(ge,ye)=>a.jsx("div",{ref:ye===0?E:void 0,className:rt(`${r}-marquee-row`,`${r}-marquee-set`),style:{gap:F(h),paddingRight:F(h)},"aria-hidden":ye>0,children:te.map((q,de)=>Me(q,ye,de,ye===0&&de<S))},`set-${ye}`))})]})}return a.jsxs("div",{ref:T,className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{className:rt(`${r}-marquee-row`,`${r}-marquee-static`),style:{gap:F(h),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((be,Ie)=>Me(be,0,Ie))},"marquee-static")]})},Wg=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
1692
+ `}const wg=30,Sg=20,na=3,$g=12,Cg=32,Tg=3,Lg=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")},Rg=(e,t)=>Array.from({length:t},()=>e).flat(),Ig=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},Jc=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),Zs=(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=Jc(d);return c<=0?0:c+r*Math.max(0,t-1)},Pg=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=Jc(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},Mg=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},Eg=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>Mg(i,e))},kg=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??"")},Ag=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,Fg=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:r,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var T,D,P,B;const p=s.useRef(null),w=!!((T=e.image)!=null&&T.url&&kg(e.image));s.useLayoutEffect(()=>{d&&Ag(p.current)&&(u==null||u())},[d,(D=e.image)==null?void 0:D.url,u]);const b=n.display==="cover",h=n.ratioValue??"1:1",g=n.reversed??!1,[m,y]=h.split(":").map(Number),S=(g?y:m)/(g?m:y),H=i/S,I=H>o?o:H,R=H>o?o*S:i,$=c(R),x=c(I),A={borderRadius:c(r)},v=b?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...A}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:c(i),maxHeight:c(o),objectFit:"contain",...A},k=((P=e.image)==null?void 0:P.url)&&(w?a.jsx("video",{ref:O=>{p.current=O},src:e.image.url,style:v,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:d?u:void 0,onError:d?u:void 0}):a.jsx("img",{ref:O=>{p.current=O},src:e.image.url,alt:((B=e.image)==null?void 0:B.name)??"",style:v,onLoad:d?u:void 0,onError:d?u:void 0}));return a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...b?{width:$}:{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,...b?{width:$,height:x,overflow:"hidden",...A}:{width:"max-content",maxWidth:c(i),height:c(o)}},children:k&&e.link?a.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:rt(`${t}-marquee-link`,!b&&`${t}-marquee-link-contain`),children:k}):k})})},_g=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=_.useScopedStyles(),[l,d]=s.useState(0),c=l>0?Math.round(l):0,u=s.useMemo(()=>bg(r,c),[r,c]),{speed:p,direction:w,pauseOnHover:b,gap:h,imageMaxWidth:g,imageMaxHeight:m,hoverEffect:y,cornerRadius:L=0}=e,f=s.useMemo(()=>Ig(e.imageFit),[e.imageFit]),S=(t==null?void 0:t.length)??0,H=!!o,I=!n||!!i,R=I&&y!=="off"&&y!=="randomize"?`${r}-image-hover-${y}`:void 0,$=n?!!i:!0,A=((t==null?void 0:t.length)??0)>0&&($||!!n),v=Math.max(0,p)*wg,k=we=>_.scalingValue(we,n??!1),T=s.useRef(null),D=s.useRef(null),P=s.useRef(null),[B,O]=s.useState(0),V=$&&b==="on",[ee,E]=s.useState(!1),[N,j]=s.useState({}),le=s.useRef(N);le.current=N;const ie=s.useRef(null),W=s.useRef(0),ae=s.useRef(null),F=s.useMemo(()=>(t??[]).map(we=>{var Ie;return((Ie=we.image)==null?void 0:Ie.url)??""}).join("\0"),[t]),[J,Y]=s.useState(na),Z=s.useMemo(()=>{const we=t??[];return we.length===0||!($||!!n)?we:Rg(we,J)},[t,$,J,n]),ye=s.useMemo(()=>(t??[]).filter(we=>{var Ie;return!!((Ie=we.image)!=null&&Ie.url)}).length,[t]),se=A?Tg:1;s.useLayoutEffect(()=>{W.current=0,j({}),ie.current=null,Y(na),d(0)},[F]),s.useEffect(()=>{if(!I||y!=="randomize")return;const we=T.current;if(!we)return;const Ie=q=>{j(de=>{const he=Array.from(q).filter(Pe=>Pe in de&&!Eg(we,Pe));if(he.length===0)return de;const Se={...de};return he.forEach(Pe=>{delete Se[Pe]}),Se})},ue=new IntersectionObserver(q=>{const de=new Set;for(const he of q){const Se=he.target.dataset.marqueeItemIndex,Pe=Se!==void 0?Number(Se):NaN;Number.isNaN(Pe)||de.add(Pe)}de.size>0&&Ie(de)},{root:we,threshold:0});Object.keys(N).forEach(q=>{const de=Number(q);we.querySelectorAll(`[data-marquee-item-index="${de}"]`).forEach(he=>ue.observe(he))});const ge={current:0},ve=()=>{const q=Object.keys(le.current);q.length!==0&&(Ie(q.map(Number)),ge.current=requestAnimationFrame(ve))};return Object.keys(le.current).length>0&&(ge.current=requestAnimationFrame(ve)),()=>{cancelAnimationFrame(ge.current),ue.disconnect()}},[y,N,I]),s.useLayoutEffect(()=>{if(!A)return;const we=T.current,Ie=P.current;if(!we||!Ie)return;const ue={current:0},ge=()=>{const de=we.getBoundingClientRect().width||we.offsetWidth,he=Pg(Ie),Se=ie.current,Pe=typeof Se=="number"&&Math.abs(Se-he)<=.25;ie.current=he;let Le=J,G=0;if(($||n)&&S>0&&de>0){const U=Zs(Ie,S);if(U>=Cg){G=U;const oe=Math.min($g,Math.max(na,Math.ceil(de/U)+1));Le=oe,oe!==J&&Y(oe)}}const ce=Le!==J&&G>0?G*Le:he>0?he:G>0?G*Le:(()=>{const U=Zs(Ie,S);return U>0?U*Le:0})();ce>0?d(U=>U<=0?ce:!Pe||Math.round(U)===Math.round(ce)?U:ce):!Pe&&l<=0&&(cancelAnimationFrame(ue.current),ue.current=requestAnimationFrame(ge))},ve=()=>{cancelAnimationFrame(ue.current),ue.current=requestAnimationFrame(ge)};ae.current=ve,ve();const q=new ResizeObserver(ve);return q.observe(we),q.observe(Ie),()=>{ae.current=null,cancelAnimationFrame(ue.current),q.disconnect()}},[$,A,l,F,J,S,n]),s.useLayoutEffect(()=>{if(!A||c<=0)return;const we=D.current;we&&Lg(we)},[A,c,w,v]),s.useLayoutEffect(()=>{if(!A||l<=0){O(0);return}const we=D.current,Ie=P.current;if(!we||!Ie)return;const ue=()=>{const ve=we.offsetHeight||we.getBoundingClientRect().height,q=Array.from(Ie.children).reduce((he,Se)=>Math.max(he,Se.offsetHeight||Se.getBoundingClientRect().height),0),de=ve>0?ve:q;O(de>0?de:0)};ue();const ge=new ResizeObserver(ue);return ge.observe(we),ge.observe(Ie),()=>ge.disconnect()},[A,se,Z,n,h,g,m,l,f,N]),s.useLayoutEffect(()=>{if(!n||!H||!A||typeof window>"u")return;const we=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(we)},[n,H,A,w,l,B,h,Z]);const re=()=>{V&&E(!0)},z=()=>{V&&E(!1)},Q=s.useCallback(()=>{var we;W.current=Math.min(ye,W.current+1),(we=ae.current)==null||we.call(ae)},[ye]),te=s.useCallback((we,Ie)=>{j(ue=>{const ge=ue[we]??Ie,ve=(t??[]).filter(de=>de!==ge);if(ve.length===0)return ue;const q=ve[Math.floor(Math.random()*ve.length)];return{...ue,[we]:q}})},[t]),Me=(we,Ie,ue,ge)=>{const ve=I&&y==="randomize"&&f.display==="cover"?N[ue]??we:we,q=`max(${k(h)}, ${Sg}px)`,de=`calc(-0.5 * (${q} + ${k(h)}))`;return a.jsxs("div",{className:`${r}-marquee-card`,"data-marquee-item-index":ue,onMouseEnter:I&&y==="randomize"&&f.display==="cover"?()=>te(ue,we):void 0,children:[a.jsx(Fg,{item:ve,prefix:r,imageFit:f,imageMaxWidth:g,imageMaxHeight:m,cornerRadius:L,imageHoverClass:R,isEditor:n,isFirstSet:ge,scaled:k,onFirstSetImageDone:Q}),H&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${r}-gap-control`,style:{position:"absolute",top:0,right:de,width:q,height:"100%"}})]},`${Ie}-${ue}`)};if(A){const we=$?V&&ee?"paused":"running":"paused",Ie=c>0&&v>0?c/v*1e3:0,ue=`${Math.max(0,Ie)/1e3}s`;return a.jsxs("div",{ref:T,className:rt(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Marquee",style:B>0?{height:B}:void 0,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{ref:D,className:`${r}-marquee-track`,"data-direction":w,onMouseEnter:re,onMouseLeave:z,style:{WebkitAnimationDuration:ue,animationDuration:ue,WebkitAnimationPlayState:we,animationPlayState:we},children:Array.from({length:se},(ge,ve)=>a.jsx("div",{ref:ve===0?P:void 0,className:rt(`${r}-marquee-row`,`${r}-marquee-set`),style:{gap:k(h),paddingRight:k(h)},"aria-hidden":ve>0,children:Z.map((q,de)=>Me(q,ve,de,ve===0&&de<S))},`set-${ve}`))})]})}return a.jsxs("div",{ref:T,className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{className:rt(`${r}-marquee-row`,`${r}-marquee-static`),style:{gap:k(h),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((we,Ie)=>Me(we,0,Ie))},"marquee-static")]})},Wg=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
1693
1693
  import cn from 'classnames';
1694
1694
  import { CommonComponentProps } from '../props';
1695
1695
  import { scalingValue } from '../utils/scalingValue';
@@ -2561,7 +2561,7 @@ type MarqueeProps = {
2561
2561
  pointer-events: auto;
2562
2562
  z-index: 10;
2563
2563
  }
2564
- `}const Dg=30,Js=2,jg=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")},Bg=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=_.useScopedStyles(),{align:l,speed:d,direction:c,pauseOnHover:u,gap:p,cardWidth:w,corners:b,stroke:h,strokeColor:g,bgColor:m,padding:v,logoMarginTop:L,logoWidth:f,logoHeight:S,captionMarginTop:H}=e,P=!!o,R=((t==null?void 0:t.length)??0)>0,$=d>0&&(!n||i),x=R&&($||n),A=Math.max(0,d)*Dg,y=G=>_.scalingValue(G,n??!1),F=s.useRef(null),T=s.useRef(null),j=s.useRef(null),[E,B]=s.useState(0),[O,z]=s.useState(0),ee=O>0?O:0,k=s.useMemo(()=>Og(r,ee),[r,ee]),[W,D]=s.useState(0),le=$&&u==="on",[Y,I]=s.useState(!1),oe=s.useRef(null),[N,ie]=s.useState(0),[Z,te]=s.useState(0),Se=s.useRef(null),se=G=>{var ce,U,re,Ee,pe;return{fontSettings:{fontFamily:(e==null?void 0:e[`${G}FontFamily`])??"Arial",fontWeight:((ce=e==null?void 0:e[`${G}FontSettings`])==null?void 0:ce.fontWeight)??400,fontStyle:((U=e==null?void 0:e[`${G}FontSettings`])==null?void 0:U.fontStyle)??"normal"},textAppearance:{textTransform:((re=e==null?void 0:e[`${G}TextAppearance`])==null?void 0:re.textTransform)??"none",textDecoration:((Ee=e==null?void 0:e[`${G}TextAppearance`])==null?void 0:Ee.textDecoration)??"none",fontVariant:((pe=e==null?void 0:e[`${G}TextAppearance`])==null?void 0:pe.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${G}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${G}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${G}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${G}LineHeight`])??.01,color:(e==null?void 0:e[`${G}Color`])??"#000000"}},ae=se("text"),V=se("caption"),J=s.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(G=>{var fe,ce;return(((fe=G.text)==null?void 0:fe.length)??0)>0||(((ce=G.caption)==null?void 0:ce.length)??0)>0}),[t]),Q=s.useMemo(()=>!x||(t==null?void 0:t.length)===0?1:O<=0||E<=0?Js:Math.max(Js,Math.ceil(E/O)+1),[x,t==null?void 0:t.length,O,E]);s.useLayoutEffect(()=>{if(!x)return;const G=F.current,fe=j.current;if(!G||!fe)return;let ce=0;const U=()=>{const pe=G.getBoundingClientRect().width,K=fe.getBoundingClientRect().width,Ve=Se.current,Oe=typeof Ve=="number"&&Math.abs(Ve-K)<=.25;if(Se.current=K,B(pe),typeof K=="number"&&K>0&&O<=0){z(K);return}Oe&&K!==O?z(K):!Oe&&O<=0&&(cancelAnimationFrame(ce),ce=requestAnimationFrame(U))},re=()=>{cancelAnimationFrame(ce),ce=requestAnimationFrame(U)};re();const Ee=new ResizeObserver(re);return Ee.observe(G),Ee.observe(fe),()=>{cancelAnimationFrame(ce),Ee.disconnect()}},[$,x,O]);const Me=ee>0&&A>0?ee/A*1e3:0,be=`${Math.max(0,Me)/1e3}s`;s.useLayoutEffect(()=>{if(!x||ee<=0)return;const G=T.current;G&&jg(G)},[x,ee,c]),s.useLayoutEffect(()=>{if(!x){D(0);return}const G=j.current,fe=T.current;if(!G||!fe)return;const ce=()=>{let re=0;for(let Ee=0;Ee<G.children.length;Ee++){const K=G.children[Ee].firstElementChild;K&&(re=Math.max(re,K.offsetHeight))}re<=0&&(re=fe.offsetHeight),D(re>0?re:0)};ce();const U=new ResizeObserver(ce);return U.observe(G),U.observe(fe),()=>{U.disconnect()}},[x,Q,t,n,p,w,v,h,b,f,S,N,Z]);const Ie=()=>{le&&I(!0)},ue=()=>{le&&I(!1)},ge=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),ye=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]),q=s.useCallback((G,fe,ce,U)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ge,width:"100%"},children:[a.jsx("div",{"data-controls":P?U==null?void 0:U.controlsName:void 0,"data-controls-axis":P?"y":void 0,className:P?`${r}-control`:void 0,style:{height:y((U==null?void 0:U.marginTop)??0)}}),a.jsx("div",{...U!=null&&U.dataMeasureKind?{"data-testimonial-measure":U.dataMeasureKind}:{},style:{...qt(G,n),textAlign:ye,pointerEvents:"auto",...typeof(U==null?void 0:U.minHeightPx)=="number"&&U.minHeightPx>0?{minHeight:U.minHeightPx}:{}},children:a.jsx(bi,{content:fe})})]},ce),[ge,ye,n,P,r,y]),de=s.useCallback((G,fe,ce)=>{var U,re,Ee;return a.jsxs("div",{style:{padding:`${y(v.top)} ${y(v.right)} ${y(v.bottom)} ${y(v.left)}`,width:y(w+h*2),height:"100%",borderRadius:y(b),border:`${y(h)} solid ${g}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[a.jsx("div",{className:`${r}-cover`,style:{background:m}}),a.jsxs("div",{className:`${r}-elements-overlay`,style:{alignItems:ge,textAlign:ye},children:[G.text&&q(ae,G.text,"text",ce!=null&&ce.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(ce==null?void 0:ce.textMinHeightPx)=="number"&&ce.textMinHeightPx>0?{minHeightPx:ce.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ge,width:"100%"},children:[a.jsx("div",{"data-controls":P&&!(ce!=null&&ce.dataMeasureAttrs)?"logoMarginTop":void 0,className:P&&!(ce!=null&&ce.dataMeasureAttrs)?`${r}-control`:void 0,style:{height:y(L)}}),a.jsx("div",{style:{width:y(f),height:y(S)},children:((U=G.logo)==null?void 0:U.url)&&a.jsx("img",{src:G.logo.url,alt:((re=G.logo)==null?void 0:re.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((Ee=G.logo)==null?void 0:Ee.objectFit)||"contain"}})})]}),G.caption&&q(V,G.caption,"caption",{...ce!=null&&ce.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:H,...ce!=null&&ce.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(ce==null?void 0:ce.captionMinHeightPx)=="number"&&ce.captionMinHeightPx>0?{minHeightPx:ce.captionMinHeightPx}:{}})]})]},fe)},[m,H,V,w,b,S,L,f,ge,ye,v.bottom,v.left,v.right,v.top,q,h,g,ae,n,P,r]),he=s.useCallback(G=>{ie(G.maxTextPx),te(G.maxCaptionPx)},[]);s.useLayoutEffect(()=>{if(!J){he({maxTextPx:0,maxCaptionPx:0});return}const G=oe.current;if(!G)return;const fe=()=>{_.readTestimonialTextMeasure(G,he)};fe();const ce=new ResizeObserver(fe);return ce.observe(G),()=>{ce.disconnect()}},[J,he,t,de]);const we=J?{textMinHeightPx:N,captionMinHeightPx:Z}:void 0,Pe=J?a.jsx("div",{ref:oe,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((G,fe)=>de(G,`measure-${fe}`,{dataMeasureAttrs:!0}))}):null,Le=(G,fe)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[de(G,`card-${fe}`,we),P&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${y(p)})`,width:y(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},fe);if(x){const G=$?le&&Y?"paused":"running":"paused";return a.jsxs("div",{ref:F,className:rt(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...W>0?{height:W}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:k}}),Pe,a.jsx("div",{ref:T,className:`${r}-marquee-track`,"data-direction":c,onMouseEnter:Ie,onMouseLeave:ue,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:be,WebkitAnimationDuration:be,animationPlayState:G,WebkitAnimationPlayState:G},children:Array.from({length:Q},(fe,ce)=>a.jsx("div",{ref:ce===0?j:void 0,className:`${r}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:y(p),paddingRight:y(p)},"aria-hidden":ce>0,children:t==null?void 0:t.map((U,re)=>Le(U,`${ce}-${re}`))},`set-${ce}`))})]})}return a.jsxs("div",{className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:k}}),Pe,a.jsx("div",{style:{gap:y(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((G,fe)=>Le(G,fe))})]})},zg=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
2564
+ `}const Dg=30,Js=2,jg=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")},Bg=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=_.useScopedStyles(),{align:l,speed:d,direction:c,pauseOnHover:u,gap:p,cardWidth:w,corners:b,stroke:h,strokeColor:g,bgColor:m,padding:y,logoMarginTop:L,logoWidth:f,logoHeight:S,captionMarginTop:H}=e,I=!!o,R=((t==null?void 0:t.length)??0)>0,$=d>0&&(!n||i),x=R&&($||n),A=Math.max(0,d)*Dg,v=G=>_.scalingValue(G,n??!1),k=s.useRef(null),T=s.useRef(null),D=s.useRef(null),[P,B]=s.useState(0),[O,V]=s.useState(0),ee=O>0?O:0,E=s.useMemo(()=>Og(r,ee),[r,ee]),[N,j]=s.useState(0),le=$&&u==="on",[ie,W]=s.useState(!1),ae=s.useRef(null),[F,J]=s.useState(0),[Y,Z]=s.useState(0),ye=s.useRef(null),se=G=>{var ce,U,oe,Ee,pe;return{fontSettings:{fontFamily:(e==null?void 0:e[`${G}FontFamily`])??"Arial",fontWeight:((ce=e==null?void 0:e[`${G}FontSettings`])==null?void 0:ce.fontWeight)??400,fontStyle:((U=e==null?void 0:e[`${G}FontSettings`])==null?void 0:U.fontStyle)??"normal"},textAppearance:{textTransform:((oe=e==null?void 0:e[`${G}TextAppearance`])==null?void 0:oe.textTransform)??"none",textDecoration:((Ee=e==null?void 0:e[`${G}TextAppearance`])==null?void 0:Ee.textDecoration)??"none",fontVariant:((pe=e==null?void 0:e[`${G}TextAppearance`])==null?void 0:pe.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${G}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${G}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${G}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${G}LineHeight`])??.01,color:(e==null?void 0:e[`${G}Color`])??"#000000"}},re=se("text"),z=se("caption"),Q=s.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(G=>{var fe,ce;return(((fe=G.text)==null?void 0:fe.length)??0)>0||(((ce=G.caption)==null?void 0:ce.length)??0)>0}),[t]),te=s.useMemo(()=>!x||(t==null?void 0:t.length)===0?1:O<=0||P<=0?Js:Math.max(Js,Math.ceil(P/O)+1),[x,t==null?void 0:t.length,O,P]);s.useLayoutEffect(()=>{if(!x)return;const G=k.current,fe=D.current;if(!G||!fe)return;let ce=0;const U=()=>{const pe=G.getBoundingClientRect().width,K=fe.getBoundingClientRect().width,Ve=ye.current,Oe=typeof Ve=="number"&&Math.abs(Ve-K)<=.25;if(ye.current=K,B(pe),typeof K=="number"&&K>0&&O<=0){V(K);return}Oe&&K!==O?V(K):!Oe&&O<=0&&(cancelAnimationFrame(ce),ce=requestAnimationFrame(U))},oe=()=>{cancelAnimationFrame(ce),ce=requestAnimationFrame(U)};oe();const Ee=new ResizeObserver(oe);return Ee.observe(G),Ee.observe(fe),()=>{cancelAnimationFrame(ce),Ee.disconnect()}},[$,x,O]);const Me=ee>0&&A>0?ee/A*1e3:0,we=`${Math.max(0,Me)/1e3}s`;s.useLayoutEffect(()=>{if(!x||ee<=0)return;const G=T.current;G&&jg(G)},[x,ee,c]),s.useLayoutEffect(()=>{if(!x){j(0);return}const G=D.current,fe=T.current;if(!G||!fe)return;const ce=()=>{let oe=0;for(let Ee=0;Ee<G.children.length;Ee++){const K=G.children[Ee].firstElementChild;K&&(oe=Math.max(oe,K.offsetHeight))}oe<=0&&(oe=fe.offsetHeight),j(oe>0?oe:0)};ce();const U=new ResizeObserver(ce);return U.observe(G),U.observe(fe),()=>{U.disconnect()}},[x,te,t,n,p,w,y,h,b,f,S,F,Y]);const Ie=()=>{le&&W(!0)},ue=()=>{le&&W(!1)},ge=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),ve=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]),q=s.useCallback((G,fe,ce,U)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ge,width:"100%"},children:[a.jsx("div",{"data-controls":I?U==null?void 0:U.controlsName:void 0,"data-controls-axis":I?"y":void 0,className:I?`${r}-control`:void 0,style:{height:v((U==null?void 0:U.marginTop)??0)}}),a.jsx("div",{...U!=null&&U.dataMeasureKind?{"data-testimonial-measure":U.dataMeasureKind}:{},style:{...qt(G,n),textAlign:ve,pointerEvents:"auto",...typeof(U==null?void 0:U.minHeightPx)=="number"&&U.minHeightPx>0?{minHeight:U.minHeightPx}:{}},children:a.jsx(bi,{content:fe})})]},ce),[ge,ve,n,I,r,v]),de=s.useCallback((G,fe,ce)=>{var U,oe,Ee;return a.jsxs("div",{style:{padding:`${v(y.top)} ${v(y.right)} ${v(y.bottom)} ${v(y.left)}`,width:v(w+h*2),height:"100%",borderRadius:v(b),border:`${v(h)} solid ${g}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[a.jsx("div",{className:`${r}-cover`,style:{background:m}}),a.jsxs("div",{className:`${r}-elements-overlay`,style:{alignItems:ge,textAlign:ve},children:[G.text&&q(re,G.text,"text",ce!=null&&ce.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(ce==null?void 0:ce.textMinHeightPx)=="number"&&ce.textMinHeightPx>0?{minHeightPx:ce.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ge,width:"100%"},children:[a.jsx("div",{"data-controls":I&&!(ce!=null&&ce.dataMeasureAttrs)?"logoMarginTop":void 0,className:I&&!(ce!=null&&ce.dataMeasureAttrs)?`${r}-control`:void 0,style:{height:v(L)}}),a.jsx("div",{style:{width:v(f),height:v(S)},children:((U=G.logo)==null?void 0:U.url)&&a.jsx("img",{src:G.logo.url,alt:((oe=G.logo)==null?void 0:oe.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((Ee=G.logo)==null?void 0:Ee.objectFit)||"contain"}})})]}),G.caption&&q(z,G.caption,"caption",{...ce!=null&&ce.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:H,...ce!=null&&ce.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(ce==null?void 0:ce.captionMinHeightPx)=="number"&&ce.captionMinHeightPx>0?{minHeightPx:ce.captionMinHeightPx}:{}})]})]},fe)},[m,H,z,w,b,S,L,f,ge,ve,y.bottom,y.left,y.right,y.top,q,h,g,re,n,I,r]),he=s.useCallback(G=>{J(G.maxTextPx),Z(G.maxCaptionPx)},[]);s.useLayoutEffect(()=>{if(!Q){he({maxTextPx:0,maxCaptionPx:0});return}const G=ae.current;if(!G)return;const fe=()=>{_.readTestimonialTextMeasure(G,he)};fe();const ce=new ResizeObserver(fe);return ce.observe(G),()=>{ce.disconnect()}},[Q,he,t,de]);const Se=Q?{textMinHeightPx:F,captionMinHeightPx:Y}:void 0,Pe=Q?a.jsx("div",{ref:ae,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((G,fe)=>de(G,`measure-${fe}`,{dataMeasureAttrs:!0}))}):null,Le=(G,fe)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[de(G,`card-${fe}`,Se),I&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${v(p)})`,width:v(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},fe);if(x){const G=$?le&&ie?"paused":"running":"paused";return a.jsxs("div",{ref:k,className:rt(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...N>0?{height:N}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:E}}),Pe,a.jsx("div",{ref:T,className:`${r}-marquee-track`,"data-direction":c,onMouseEnter:Ie,onMouseLeave:ue,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:we,WebkitAnimationDuration:we,animationPlayState:G,WebkitAnimationPlayState:G},children:Array.from({length:te},(fe,ce)=>a.jsx("div",{ref:ce===0?D:void 0,className:`${r}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:v(p),paddingRight:v(p)},"aria-hidden":ce>0,children:t==null?void 0:t.map((U,oe)=>Le(U,`${ce}-${oe}`))},`set-${ce}`))})]})}return a.jsxs("div",{className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:E}}),Pe,a.jsx("div",{style:{gap:v(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((G,fe)=>Le(G,fe))})]})},zg=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
2565
2565
  import cn from 'classnames';
2566
2566
  import { CommonComponentProps } from '../props';
2567
2567
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
@@ -3316,7 +3316,7 @@ type TestimonialsSettings = {
3316
3316
  width: 100%;
3317
3317
  height: 100%;
3318
3318
  }
3319
- `}const qg=3e3,Xg=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=_.useScopedStyles(),l=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:w,captionMarginTop:b,imageWidth:h,imageHeight:g,controlsWidth:m,controlsColor:v,controlsHoverColor:L}=e,f=d>0&&(!n||!!i),[S,H]=s.useState(0),[P,R]=s.useState(null),[$,x]=s.useState(!1),A=s.useRef(null),y=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),F=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);s.useEffect(()=>{H(0),R(null),x(!1)},[l.length]);const T=l[S],j=P===null?null:l[P],E=se=>{var V,J,Q,Me,be;return{fontSettings:{fontFamily:(e==null?void 0:e[`${se}FontFamily`])??"Arial",fontWeight:((V=e==null?void 0:e[`${se}FontSettings`])==null?void 0:V.fontWeight)??400,fontStyle:((J=e==null?void 0:e[`${se}FontSettings`])==null?void 0:J.fontStyle)??"normal"},textAppearance:{textTransform:((Q=e==null?void 0:e[`${se}TextAppearance`])==null?void 0:Q.textTransform)??"none",textDecoration:((Me=e==null?void 0:e[`${se}TextAppearance`])==null?void 0:Me.textDecoration)??"none",fontVariant:((be=e==null?void 0:e[`${se}TextAppearance`])==null?void 0:be.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${se}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${se}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${se}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${se}WordSpacing`])??0,color:(e==null?void 0:e[`${se}Color`])??"#000000"}},B=E("text"),O=E("caption"),z=l.length>1&&l.some(se=>{var ae,V;return(((ae=se.text)==null?void 0:ae.length)??0)>0||(((V=se.caption)==null?void 0:V.length)??0)>0}),ee=s.useRef(null),[k,W]=s.useState(0),[D,le]=s.useState(0),Y=e.controls??{mode:"Off",icon:null},I=l.length>1,oe=s.useCallback((se,ae)=>!I||ae===se?se:(A.current&&window.clearTimeout(A.current),R(se),x(!0),A.current=window.setTimeout(()=>{R(null),x(!1),A.current=null},300),ae),[I]),N=s.useCallback(()=>{I&&H(se=>oe(se,(se-1+l.length)%l.length))},[I,oe,l.length]),ie=s.useCallback(()=>{I&&H(se=>oe(se,(se+1)%l.length))},[I,oe,l.length]);s.useEffect(()=>{if(!f||!I)return;const se=Math.max(300,qg/d),ae=window.setInterval(()=>{H(V=>oe(V,(V+1)%l.length))},se);return()=>{window.clearInterval(ae)}},[f,I,oe,l.length,d]),s.useEffect(()=>()=>{A.current&&window.clearTimeout(A.current)},[]);const Z=(se,ae)=>{var be,Ie,ue,ge;const V=ae==null?void 0:ae.textMinHeightPx,J=ae==null?void 0:ae.captionMinHeightPx,Q=ae==null?void 0:ae.dataMeasureAttrs,Me=o&&!(ae!=null&&ae.dataMeasureAttrs)&&!(ae!=null&&ae.hideControls);return a.jsxs(a.Fragment,{children:[se.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:y,width:"100%"},children:[a.jsx("div",{"data-controls":Me?"textMarginTop":void 0,className:Me?`${r}-control`:void 0,style:{height:_.scalingValue(w??0,n??!1)}}),a.jsx("div",{...Q&&{"data-testimonial-measure":"text"},style:{...qt(B,n),...V&&V>0?{minHeight:V}:{},textAlign:F,pointerEvents:"auto"},children:a.jsx(bi,{content:se.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:y,width:"100%"},children:[a.jsx("div",{"data-controls":Me?"imageMarginTop":void 0,className:Me?`${r}-control`:void 0,style:{height:_.scalingValue(p??0,n??!1)}}),a.jsx("div",{style:{width:_.scalingValue(h??0,n??!1),height:_.scalingValue(g??0,n??!1)},children:((be=se.image)==null?void 0:be.url)&&a.jsx("img",{src:(Ie=se.image)==null?void 0:Ie.url,alt:((ue=se.image)==null?void 0:ue.name)??"",className:`${r}-icon`,style:{objectFit:((ge=se.image)==null?void 0:ge.objectFit)||"contain"}})})]}),se.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:y,width:"100%"},children:[a.jsx("div",{"data-controls":Me?"captionMarginTop":void 0,className:Me?`${r}-control`:void 0,style:{height:_.scalingValue(b??0,n??!1)}}),a.jsx("div",{...Q?{"data-testimonial-measure":"caption"}:{},style:{...qt(O,n),...J&&J>0?{minHeight:J}:{},textAlign:F,pointerEvents:"auto"},children:a.jsx(bi,{content:se.caption})})]})]})},te=s.useCallback(se=>{W(se.maxTextPx),le(se.maxCaptionPx)},[]);if(s.useLayoutEffect(()=>{if(!z){te({maxTextPx:0,maxCaptionPx:0});return}const se=ee.current;if(!se)return;const ae=()=>{_.readTestimonialTextMeasure(se,te)};ae();const V=new ResizeObserver(ae);return V.observe(se),()=>{V.disconnect()}},[z,te,t]),!T)return a.jsx(a.Fragment,{});const Se=z?{textMinHeightPx:k,captionMinHeightPx:D}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${r}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ug(r)}}),a.jsxs("div",{className:`${r}-wrapper`,style:{width:_.scalingValue(u??0,n??!1),alignItems:y},children:[z&&a.jsx("div",{ref:ee,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((se,ae)=>a.jsx("div",{style:{width:"100%"},children:Z(se,{dataMeasureAttrs:!0})},ae))}),a.jsxs("div",{className:`${r}-fade-stack`,children:[j&&$&&a.jsx("div",{className:rt(`${r}-fade-item-prev`,`${r}-fade-out`),children:Z(j,{...Se,hideControls:!0})}),a.jsx("div",{className:rt(`${r}-fade-item-current`,$?`${r}-fade-in`:void 0),children:Z(T,Se)})]})]}),Y.mode==="On"&&a.jsxs("div",{className:`${r}-controls`,children:[a.jsx("div",{className:`${r}-arrow`,style:{width:_.scalingValue(m??.02,n??!1),height:_.scalingValue(m??.02,n??!1),"--arrow-hover-color":L},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:N,disabled:!I,"aria-label":"Previous testimonial",children:Y.icon&&a.jsx(an,{url:Y.icon,fill:v,hoverFill:L,className:rt(`${r}-arrow-img`,`${r}-mirror`)})})}),a.jsx("div",{className:rt(`${r}-arrow`,`${r}-next-arrow`),style:{width:_.scalingValue(m??.02,n??!1),height:_.scalingValue(m??.02,n??!1),"--arrow-hover-color":L},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:ie,disabled:!I,"aria-label":"Next testimonial",children:Y.icon&&a.jsx(an,{url:Y.icon,fill:v,hoverFill:L,className:`${r}-arrow-img`})})})]})]})})},Kg=`import cn from 'classnames';
3319
+ `}const qg=3e3,Xg=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=_.useScopedStyles(),l=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:w,captionMarginTop:b,imageWidth:h,imageHeight:g,controlsWidth:m,controlsColor:y,controlsHoverColor:L}=e,f=d>0&&(!n||!!i),[S,H]=s.useState(0),[I,R]=s.useState(null),[$,x]=s.useState(!1),A=s.useRef(null),v=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),k=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);s.useEffect(()=>{H(0),R(null),x(!1)},[l.length]);const T=l[S],D=I===null?null:l[I],P=se=>{var z,Q,te,Me,we;return{fontSettings:{fontFamily:(e==null?void 0:e[`${se}FontFamily`])??"Arial",fontWeight:((z=e==null?void 0:e[`${se}FontSettings`])==null?void 0:z.fontWeight)??400,fontStyle:((Q=e==null?void 0:e[`${se}FontSettings`])==null?void 0:Q.fontStyle)??"normal"},textAppearance:{textTransform:((te=e==null?void 0:e[`${se}TextAppearance`])==null?void 0:te.textTransform)??"none",textDecoration:((Me=e==null?void 0:e[`${se}TextAppearance`])==null?void 0:Me.textDecoration)??"none",fontVariant:((we=e==null?void 0:e[`${se}TextAppearance`])==null?void 0:we.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${se}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${se}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${se}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${se}WordSpacing`])??0,color:(e==null?void 0:e[`${se}Color`])??"#000000"}},B=P("text"),O=P("caption"),V=l.length>1&&l.some(se=>{var re,z;return(((re=se.text)==null?void 0:re.length)??0)>0||(((z=se.caption)==null?void 0:z.length)??0)>0}),ee=s.useRef(null),[E,N]=s.useState(0),[j,le]=s.useState(0),ie=e.controls??{mode:"Off",icon:null},W=l.length>1,ae=s.useCallback((se,re)=>!W||re===se?se:(A.current&&window.clearTimeout(A.current),R(se),x(!0),A.current=window.setTimeout(()=>{R(null),x(!1),A.current=null},300),re),[W]),F=s.useCallback(()=>{W&&H(se=>ae(se,(se-1+l.length)%l.length))},[W,ae,l.length]),J=s.useCallback(()=>{W&&H(se=>ae(se,(se+1)%l.length))},[W,ae,l.length]);s.useEffect(()=>{if(!f||!W)return;const se=Math.max(300,qg/d),re=window.setInterval(()=>{H(z=>ae(z,(z+1)%l.length))},se);return()=>{window.clearInterval(re)}},[f,W,ae,l.length,d]),s.useEffect(()=>()=>{A.current&&window.clearTimeout(A.current)},[]);const Y=(se,re)=>{var we,Ie,ue,ge;const z=re==null?void 0:re.textMinHeightPx,Q=re==null?void 0:re.captionMinHeightPx,te=re==null?void 0:re.dataMeasureAttrs,Me=o&&!(re!=null&&re.dataMeasureAttrs)&&!(re!=null&&re.hideControls);return a.jsxs(a.Fragment,{children:[se.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:v,width:"100%"},children:[a.jsx("div",{"data-controls":Me?"textMarginTop":void 0,className:Me?`${r}-control`:void 0,style:{height:_.scalingValue(w??0,n??!1)}}),a.jsx("div",{...te&&{"data-testimonial-measure":"text"},style:{...qt(B,n),...z&&z>0?{minHeight:z}:{},textAlign:k,pointerEvents:"auto"},children:a.jsx(bi,{content:se.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:v,width:"100%"},children:[a.jsx("div",{"data-controls":Me?"imageMarginTop":void 0,className:Me?`${r}-control`:void 0,style:{height:_.scalingValue(p??0,n??!1)}}),a.jsx("div",{style:{width:_.scalingValue(h??0,n??!1),height:_.scalingValue(g??0,n??!1)},children:((we=se.image)==null?void 0:we.url)&&a.jsx("img",{src:(Ie=se.image)==null?void 0:Ie.url,alt:((ue=se.image)==null?void 0:ue.name)??"",className:`${r}-icon`,style:{objectFit:((ge=se.image)==null?void 0:ge.objectFit)||"contain"}})})]}),se.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:v,width:"100%"},children:[a.jsx("div",{"data-controls":Me?"captionMarginTop":void 0,className:Me?`${r}-control`:void 0,style:{height:_.scalingValue(b??0,n??!1)}}),a.jsx("div",{...te?{"data-testimonial-measure":"caption"}:{},style:{...qt(O,n),...Q&&Q>0?{minHeight:Q}:{},textAlign:k,pointerEvents:"auto"},children:a.jsx(bi,{content:se.caption})})]})]})},Z=s.useCallback(se=>{N(se.maxTextPx),le(se.maxCaptionPx)},[]);if(s.useLayoutEffect(()=>{if(!V){Z({maxTextPx:0,maxCaptionPx:0});return}const se=ee.current;if(!se)return;const re=()=>{_.readTestimonialTextMeasure(se,Z)};re();const z=new ResizeObserver(re);return z.observe(se),()=>{z.disconnect()}},[V,Z,t]),!T)return a.jsx(a.Fragment,{});const ye=V?{textMinHeightPx:E,captionMinHeightPx:j}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${r}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ug(r)}}),a.jsxs("div",{className:`${r}-wrapper`,style:{width:_.scalingValue(u??0,n??!1),alignItems:v},children:[V&&a.jsx("div",{ref:ee,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((se,re)=>a.jsx("div",{style:{width:"100%"},children:Y(se,{dataMeasureAttrs:!0})},re))}),a.jsxs("div",{className:`${r}-fade-stack`,children:[D&&$&&a.jsx("div",{className:rt(`${r}-fade-item-prev`,`${r}-fade-out`),children:Y(D,{...ye,hideControls:!0})}),a.jsx("div",{className:rt(`${r}-fade-item-current`,$?`${r}-fade-in`:void 0),children:Y(T,ye)})]})]}),ie.mode==="On"&&a.jsxs("div",{className:`${r}-controls`,children:[a.jsx("div",{className:`${r}-arrow`,style:{width:_.scalingValue(m??.02,n??!1),height:_.scalingValue(m??.02,n??!1),"--arrow-hover-color":L},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:F,disabled:!W,"aria-label":"Previous testimonial",children:ie.icon&&a.jsx(an,{url:ie.icon,fill:y,hoverFill:L,className:rt(`${r}-arrow-img`,`${r}-mirror`)})})}),a.jsx("div",{className:rt(`${r}-arrow`,`${r}-next-arrow`),style:{width:_.scalingValue(m??.02,n??!1),height:_.scalingValue(m??.02,n??!1),"--arrow-hover-color":L},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:J,disabled:!W,"aria-label":"Next testimonial",children:ie.icon&&a.jsx(an,{url:ie.icon,fill:y,hoverFill:L,className:`${r}-arrow-img`})})})]})]})})},Kg=`import cn from 'classnames';
3320
3320
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
3321
3321
  import { CommonComponentProps } from '../props';
3322
3322
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
@@ -4159,7 +4159,7 @@ type TestimonialsSettings = {
4159
4159
  z-index: 2;
4160
4160
  width: 100%;
4161
4161
  }
4162
- `}function th(){return Math.random()<.5?"ltr":"ttb"}function nh(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function ih(e){const t=th();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{nh(e)})})}const bn=500,oh=750,jn="cubic-bezier(0.22, 1, 0.36, 1)",rh=72,ah=50;function sh(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 lh(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function ch(e){const[t]=e.media;return t!=null&&t.url?t:null}function Qc(e){return!Array.isArray(e)||e.length===0?[]:sh(e)?e.flatMap(t=>{const n=lh(t);if(!n)return[];const i=ch(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 yi(e){return e.type==="video"}function dh(e){const t=new Set,n=[];for(const i of e){const o=Qc(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 uh({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>yi(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function ph(e){e.pause(),e.removeAttribute("src"),e.load()}function nl({media:e,className:t,style:n,onMediaClick:i}){return yi(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 il(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function mh(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 gh({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{ph(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 hh({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",w=s.useRef(null),b=s.useRef(null),h=s.useRef(null),g=s.useRef(null),m=s.useRef(0),v=s.useRef(0),L=s.useRef("none"),f=s.useRef(!1),S=s.useRef(!1),H=s.useRef(null),P=s.useRef(0),R=s.useRef(null),$=s.useRef(!1),x=s.useRef(null),A=s.useRef(null),y=s.useRef(null),F=s.useRef(()=>{}),[T,j]=s.useState(null),[E,B]=s.useState(null),[O,z]=s.useState("opening"),[ee,k]=s.useState(0),[W,D]=s.useState(0),[le,Y]=s.useState(null),[I,oe]=s.useState(!1),[N,ie]=s.useState(!1),[Z,te]=s.useState(!1),[Se,se]=s.useState(null),ae=s.useRef(n),V=s.useRef(void 0),J=t[n],Q=J?yi(J):!1,Me=W!==0||I,be=le!==null,Ie=s.useCallback(Ce=>{const Ne=Ce.currentTarget,Be=Ne instanceof HTMLVideoElement?{width:Ne.videoWidth,height:Ne.videoHeight}:{width:Ne.naturalWidth,height:Ne.naturalHeight};!Be.width||!Be.height||se(Be)},[]);s.useEffect(()=>{H.current=E},[E]),s.useEffect(()=>{const Ce=w.current;if(!Ce)return;const Ne=()=>B(il(Ce));Ne();const Be=new ResizeObserver(Ne);return Be.observe(Ce),()=>Be.disconnect()},[]);const ue=s.useCallback(()=>{x.current!==null&&(window.clearTimeout(x.current),x.current=null)},[]),ge=s.useCallback(()=>{const Ce=A.current;A.current=null,ue(),R.current=null,$.current=!1,Y(null),oe(!1),D(0),P.current=0,ie(!1),f.current=!1,v.current=0,L.current="none",Ce===1?d():Ce===-1&&l()},[ue,d,l]),ye=s.useCallback(()=>{ue(),A.current=null,R.current=null,$.current=!1,Y(null),oe(!1),D(0),P.current=0},[ue]),q=s.useCallback(()=>{ue(),x.current=window.setTimeout(()=>{A.current!==null&&ge()},bn+32)},[ue,ge]),de=s.useCallback((Ce,Ne)=>{var Ke;const Be=((Ke=H.current)==null?void 0:Ke.width)??0;if(ue(),R.current=Ce,Y(Ce),$.current=!0,oe(!0),Ne){A.current=Ce;const ct=-Ce*Be;P.current=ct,D(ct),q();return}P.current=0,D(0),x.current=window.setTimeout(()=>{x.current=null,ye()},bn+32)},[ue,ye,q]),he=s.useCallback(Ce=>{if(!(t.length<=1)){if($.current){if(A.current===Ce){y.current=Ce,ge();return}ye()}ue(),R.current=Ce,Y(Ce),$.current=!1,oe(!1),P.current=0,D(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{de(Ce,!0)})})}},[t.length,de,ge,ye,ue]);F.current=he;const we=s.useCallback(Ce=>{Ce.propertyName!=="transform"||!$.current||A.current!==null&&ge()},[ge]),Pe=s.useCallback(()=>{const Ce=b.current;if(!Ce)return;const Ne=il(Ce);!Ne.width||!Ne.height||j(Ne)},[]);s.useEffect(()=>{Pe();const Ce=b.current;if(!Ce)return;const Ne=new ResizeObserver(()=>Pe());return Ne.observe(Ce),()=>Ne.disconnect()},[Pe]),s.useEffect(()=>{O==="opening"&&T&&z("open")},[O,T]),s.useEffect(()=>{if(O!=="closing")return;const Ce=setTimeout(()=>r(),bn);return()=>clearTimeout(Ce)},[O,r]),s.useEffect(()=>()=>{ue()},[ue]),s.useLayoutEffect(()=>{ae.current===n&&V.current===(J==null?void 0:J.url)||(ue(),A.current=null,Y(null),k(0),D(0),oe(!1),te(!1),ie(!1),se(null),m.current=0,v.current=0,L.current="none",f.current=!1,$.current=!1,P.current=0,R.current=null,g.current=null,S.current=!1,ae.current=n,V.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,ue]),s.useLayoutEffect(()=>{const Ce=y.current;Ce!==null&&(y.current=null,requestAnimationFrame(()=>{F.current(Ce)}))},[n,J==null?void 0:J.url]),s.useEffect(()=>{if(O!=="open")return;let Ce=null;const Ne=()=>{Ce&&(document.removeEventListener("click",Ce,!0),Ce=null)},Be=()=>{Ne(),Ce=dt=>{dt.stopPropagation(),dt.preventDefault(),Ne()},document.addEventListener("click",Ce,!0)},Ke=dt=>{const _e=dt<0?1:-1;if(Math.abs(dt)>ah&&t.length>1){de(_e,!0);return}de(_e,!1)},ct=dt=>{if(dt.touches.length!==1||$.current)return;const _e=dt.touches[0];S.current=!0,g.current={x:_e.clientX,y:_e.clientY},L.current="none",v.current=0,f.current=!1},Je=dt=>{if(!g.current||dt.touches.length!==1||$.current)return;const _e=dt.touches[0],Xe=_e.clientX-g.current.x,je=_e.clientY-g.current.y;if(L.current==="none"){if(Math.abs(Xe)<10&&Math.abs(je)<10)return;if(Math.abs(Xe)>Math.abs(je)){if(t.length<=1)return;L.current="horizontal"}else if(je>0)L.current="vertical";else return}if(L.current==="horizontal"){f.current=!0,ie(!0),v.current=Xe;const ut=Xe<0?1:-1;R.current!==ut&&(R.current=ut,Y(ut)),P.current=Xe,D(Xe),dt.preventDefault();return}L.current==="vertical"&&(f.current=!0,ie(!0),m.current=je,k(je),dt.preventDefault())},$t=()=>{if(!g.current)return;const dt=L.current,_e=f.current;if(_e&&dt==="horizontal")Ke(v.current),Be();else if(_e&&dt==="vertical")if(m.current>rh){const je=window.innerHeight;m.current=je,te(!0),k(je),z("closing")}else m.current=0,k(0),Be();else dt==="horizontal"&&Math.abs(v.current)>0&&(Ke(v.current),Be());g.current=null,L.current="none",v.current=0,f.current=!1,ie(!1)};return document.addEventListener("touchstart",ct,{passive:!0}),document.addEventListener("touchmove",Je,{passive:!1}),document.addEventListener("touchend",$t),document.addEventListener("touchcancel",$t),()=>{document.removeEventListener("touchstart",ct),document.removeEventListener("touchmove",Je),document.removeEventListener("touchend",$t),document.removeEventListener("touchcancel",$t),Ne()}},[O,t.length,de]),s.useEffect(()=>{const Ce=Ne=>{Ne.key==="Escape"&&(Ne.preventDefault(),Ne.stopPropagation(),O!=="closing"&&z("closing"))};return window.addEventListener("keydown",Ce,!0),()=>window.removeEventListener("keydown",Ce,!0)},[O]);const Le=()=>{O!=="closing"&&z("closing")},G=O==="open",fe=O==="closing",ce=ee>0?Math.max(0,1-ee/500):1,U=ee>0?Math.max(.35,1-ee/500):1,re=T?p?T:mh(T,Se):null,Ee=Ce=>{if(Ce.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const Ne=re??Ce.currentTarget.getBoundingClientRect(),Be=Ce.clientY-Ne.top,Ke=Math.min(52,Ne.height*.2);if(!(Be>Ne.height-Ke)){if(Ce.clientX-Ne.left<Ne.width/2){he(-1);return}he(1)}},pe=Ce=>{if(t.length<=1)return;const Ne=re??Ce.currentTarget.getBoundingClientRect(),Be=Ce.clientX-Ne.left,Ke=Ce.clientY-Ne.top,ct=Math.min(52,Ne.height*.2);if(Ke>Ne.height-ct){Ce.currentTarget.style.cursor="default";return}Ce.currentTarget.style.cursor=Be<Ne.width/2?"w-resize":"e-resize"},K={position:"fixed",top:E==null?void 0:E.top,left:E==null?void 0:E.left,width:E==null?void 0:E.width,height:E==null?void 0:E.height,zIndex:9998},Ve=p?"cover":"contain",Oe=W!==0||ee>0?`translate(${W}px, ${ee}px)`:void 0,lt=N&&!I?"none":I?`transform ${bn}ms ${jn}`:Z?`transform ${bn}ms ${jn}, opacity ${bn}ms ${jn}`:O==="opening"||fe?`opacity ${bn}ms ${jn}`:"none",tt={...K,transform:Oe,opacity:ee>0?U:O==="opening"||fe?0:1,transition:lt,pointerEvents:"none"},ht={position:"absolute",top:((re==null?void 0:re.top)??0)-((E==null?void 0:E.top)??0),left:((re==null?void 0:re.left)??0)-((E==null?void 0:E.left)??0),width:re==null?void 0:re.width,height:re==null?void 0:re.height,objectFit:Ve,pointerEvents:Q&&G&&!Me?"auto":"none",touchAction:Q&&G?"none":void 0},nt=(E==null?void 0:E.width)??0,ze=be?(n+le+t.length)%t.length:null,xe=ze!==null?t[ze]:null,Ae={...K,transform:be?`translateX(${le*nt+W}px)`:void 0,opacity:1,transition:I?`transform ${bn}ms ${jn}`:"none",pointerEvents:"none"},De={position:"absolute",top:((T==null?void 0:T.top)??0)-((E==null?void 0:E.top)??0),left:((T==null?void 0:T.left)??0)-((E==null?void 0:E.left)??0),width:T==null?void 0:T.width,height:T==null?void 0:T.height,objectFit:Ve,pointerEvents:"none"},Ue=re?{position:"fixed",top:re.top,height:re.height,width:re.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:w,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:O==="open"?"none":void 0},onClick:Le,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:G?ce:0,transition:N?"none":`opacity ${bn}ms ${jn}`,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:b,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:G?1:0,transition:`opacity ${bn}ms ${jn}`,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:b,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:G?1:0,transition:`opacity ${bn}ms ${jn}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),T&&E&&xe&&a.jsx("div",{style:Ae,onTransitionEnd:we,children:yi(xe)?a.jsx("video",{src:xe.url,muted:!0,playsInline:!0,preload:"auto",style:De},`neighbor-${ze}-${xe.url}`):a.jsx("img",{src:xe.url,alt:xe.name,style:De},`neighbor-${ze}-${xe.url}`)}),T&&E&&J&&a.jsx("div",{style:tt,onTransitionEnd:we,children:Q?a.jsx(gh,{src:J.url,phase:O,mediaRef:h,mediaStyle:ht,onLoadedMetadata:Ie,onClick:Ee,onMouseMove:pe},`${n}-${J.url}`):a.jsx("img",{ref:h,src:J.url,alt:J.name,onLoad:Ie,style:ht},`${n}-${J.url}`)}),G&&Ue&&t.length>1&&!Q&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ue,left:re.left,cursor:"w-resize",pointerEvents:N?"none":"auto"},onClick:Ce=>{if(S.current){S.current=!1;return}Ce.stopPropagation(),he(-1)}}),a.jsx("div",{style:{...Ue,left:re.left+re.width/2,cursor:"e-resize",pointerEvents:N?"none":"auto"},onClick:Ce=>{if(S.current){S.current=!1;return}Ce.stopPropagation(),he(1)}})]})]})}function fh(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function yh({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=_.useScopedStyles(),{type:p="a",gridLayout:w,textBoxWidth:b=100,verticalGap:h,entriesCount:g,lightbox:m,imageDisplay:v,imageCorners:L,lightboxImageDisplay:f,slider:S,sliderTiming:H,direction:P,transition:R,titleMarginTop:$,subtitleMarginTop:x,titleColor:A,subtitleColor:y,lightboxCounterColor:F,titleFontFamily:T,titleFontSettings:j,titleFontSize:E,titleLineHeight:B,titleLetterSpacing:O,titleWordSpacing:z,titleTextAppearance:ee,subtitleFontFamily:k,subtitleFontSettings:W,subtitleFontSize:D,subtitleLineHeight:le,subtitleLetterSpacing:Y,subtitleWordSpacing:I,subtitleTextAppearance:oe,lightboxCounterFontFamily:N,lightboxCounterFontSettings:ie,lightboxCounterFontSize:Z,lightboxCounterLineHeight:te,lightboxCounterLetterSpacing:Se,lightboxCounterWordSpacing:se,lightboxCounterTextAppearance:ae,showText:V="always",alignEntries:J="off",align:Q="top"}=e,Me={fontSettings:{fontFamily:T,fontWeight:(j==null?void 0:j.fontWeight)??400,fontStyle:(j==null?void 0:j.fontStyle)??"normal"},fontSize:E??.01,lineHeight:B,letterSpacing:O??0,wordSpacing:z??0,textAppearance:ee,color:A},Ie={...rn(qt(Me,n))},ue={fontSettings:{fontFamily:k,fontWeight:(W==null?void 0:W.fontWeight)??400,fontStyle:(W==null?void 0:W.fontStyle)??"normal"},fontSize:D??.01,lineHeight:le,letterSpacing:Y??0,wordSpacing:I??0,textAppearance:oe,color:y},ye={...rn(qt(ue,n))},q={fontSettings:{fontFamily:N,fontWeight:(ie==null?void 0:ie.fontWeight)??400,fontStyle:(ie==null?void 0:ie.fontStyle)??"normal"},fontSize:Z??.01,lineHeight:te,letterSpacing:Se??0,wordSpacing:se??0,textAppearance:ae,color:F},he={...rn(qt(q,n)),...oa(Z,te,u,n)},we=ia(E,B,`${u}-item-title`,`${u}-text-tight-leading`),Pe=ia(D,le,`${u}-item-subtitle`,`${u}-text-tight-leading`),Le=oa(E,B,u,n),G=oa(D,le,u,n),fe=ia(Z,te,`${u}-lightbox-counter`,`${u}-text-tight-leading`),ce=_.buildColorVars(u,{titleColor:A,subtitleColor:y,lightboxCounterColor:F},vh,xh),Ee=`${l&&l!=="default"?`${u}-state-${l}`:""}${V==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),pe=g===0?1/0:g,K=(t??[]).slice(0,pe),Ve=s.useMemo(()=>m==="on"?dh(K):[],[K,m]),Oe=w.entryWidth??.2,lt=(v==null?void 0:v.display)==="cover",tt=(v==null?void 0:v.ratioValue)??"1:1",ht=(v==null?void 0:v.reversed)??!1,[nt,ze]=tt.split(":").map(Number),De=`${ht?ze:nt} / ${ht?nt:ze}`,Ue=w.columnsCount,Ce=_.scalingValue(Oe??0,n),Ne=Ce,Be=!lt&&S!=="off",Ke=K.length%Ue||Ue,ct=Ke<Ue&&K.length>0,Je=K.length-Ke,$t=ct?Math.floor((Ue-Ke)/2)+1:1,dt=L?_.scalingValue(L,n):void 0,_e={width:Ne,...lt?{aspectRatio:De,height:"auto",overflow:"hidden"}:{height:"auto"},...dt?{borderRadius:dt,overflow:"hidden"}:{}},Xe=`${u}-item-image-wrapper${Be?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),je=p==="d"||p==="e"||p==="f",ut=J==="on",pt=`calc(${_.scalingValue(Oe??0,n)} * (${b} / 100))`,mt=_.scalingValue(Oe*b/100,n),kt=lt?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...dt?{borderRadius:dt}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...dt?{borderRadius:dt}:{}},[Kt,Yt]=s.useState(0),vt=s.useRef(null),bt=R==="fade"||P==="horizontal"?"ltr":P==="vertical"?"ttb":"ltr";s.useEffect(()=>{const at=vt.current;if(!at)return;const Te=new ResizeObserver(We=>{Yt(Math.round(We[0].contentRect.width))});return Te.observe(at),()=>Te.disconnect()},[]);const Gt=(()=>{const at={...ce},Te=vt.current?getComputedStyle(vt.current).getPropertyValue("--cntrl-article-width").trim():"";return Te&&(at["--cntrl-article-width"]=Te),at})(),[Ft,xt]=s.useState(!1),[Ht,Ut]=s.useState([]),[Zt,tn]=s.useState(0),Ct=m==="on"&&(!n||i),jt=(at,Te)=>{n&&!i||m!=="off"&&(Ut(at),tn(Te),xt(!0))};s.useEffect(()=>{if(!Ft||m!=="on"||typeof document>"u")return;const at=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=at}},[Ft,m]),s.useEffect(()=>{!n||i||xt(!1)},[n,i]);const dn=s.useMemo(()=>eh(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:dn}}),m==="on"&&a.jsx(uh,{mediaList:Ve}),a.jsx("div",{style:ce,children:a.jsx("div",{ref:vt,className:`${u}-wrapper ${u}-type-${p}${ut?` ${u}-align-entries`:""} ${u}-image-align-${Q} ${Ee}`.trim(),style:{gridTemplateColumns:`repeat(${Ue}, ${Ce})`,rowGap:ut?0:_.scalingValue(h??0,n),columnGap:_.scalingValue(w.horizontalGap??0,n),width:_.scalingValue(w.wrapperWidth??0,n),...ut?{[`--${u}-align-entries-row-gap`]:_.scalingValue(h??0,n)}:{}},children:K.map((at,Te)=>{var At;const We=tl(at.title),Qe=tl(at.subtitle),st=(((At=at.link)==null?void 0:At.length)??0)>0&&m==="off"?at.link:void 0,gt=Math.floor(Te/Ue)===Math.ceil(K.length/Ue)-1,Rt=ct&&Te>=Je?`${$t+(Te-Je)}`:void 0,ot=je?a.jsxs("div",{className:`${u}-item-text-block`,children:[We&&a.jsx("p",{className:we,style:{width:pt,...Ie,...Le},children:at.title}),We&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:_.scalingValue($??0,n),width:mt}}),Qe&&a.jsx("p",{className:Pe,style:{width:pt,...ye,...G},children:at.subtitle}),Qe&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:_.scalingValue(x??0,n),width:mt}})]}):null,Ot=ut?a.jsxs("div",{className:`${u}-item-title-row`,children:[!je&&a.jsx("div",{"data-controls":o&&We?"titleMarginTop":void 0,className:o&&We?`${u}-control`:void 0,style:{height:We?_.scalingValue($??0,n):0,width:mt}}),We&&a.jsx("p",{className:we,style:{width:pt,...Ie,...Le},children:at.title}),je&&We&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:_.scalingValue($??0,n),width:mt}})]}):null,Et=ut?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!je&&a.jsx("div",{"data-controls":o&&Qe?"subtitleMarginTop":void 0,className:o&&Qe?`${u}-control`:void 0,style:{height:Qe?_.scalingValue(x??0,n):0,width:mt}}),Qe&&a.jsx("p",{className:Pe,style:{width:pt,...ye,...G},children:at.subtitle}),je&&Qe&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:_.scalingValue(x??0,n),width:mt}})]}):null,Mt=st?a.jsxs("a",{href:st,target:"_blank",className:`${u}-item-text-link`,children:[Ot,Et]}):a.jsxs(a.Fragment,{children:[Ot,Et]}),Bt=Qc(at.gallery),zt=Bt.filter(wt=>wt.lightboxMedia).map(wt=>wt.lightboxMedia),_t=a.jsx("div",{className:Xe,style:_e,children:Bt.length===0?null:S==="off"?(()=>{const{displayMedia:wt,lightboxMedia:M}=Bt[0],ve=M?zt.findIndex(Re=>Re.url===M.url):-1;return a.jsx(nl,{media:wt,className:`${u}-item-${yi(wt)?"video":"image"}`.trim(),style:kt,onMediaClick:Ct&&ve>=0?()=>jt(zt,ve):void 0})})():a.jsxs(a.Fragment,{children:[Be&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Bt.map(({displayMedia:wt})=>yi(wt)?a.jsx("video",{src:wt.url,muted:!0,playsInline:!0},`sizer-${wt.url}`):a.jsx("img",{src:wt.url,alt:""},`sizer-${wt.url}`))}),a.jsx(fs,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:H*1e3,width:"100%",height:"100%",speed:oh,type:R==="fade"?"fade":"loop",rewind:R==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:bt},onMoved:wt=>{P!=="random"||R==="fade"||ih(wt)},children:Bt.map(({displayMedia:wt,lightboxMedia:M},ve)=>{const Re=M?zt.findIndex(ke=>ke.url===M.url):-1;return a.jsx(ys,{children:a.jsx(nl,{media:wt,className:`${u}-item-${yi(wt)?"video":"image"}`.trim(),style:kt,onMediaClick:Ct&&Re>=0?()=>jt(zt,Re):void 0})},ve)})},`${R}-${Oe}-${P}-${H}-${Kt}-${d}`)]})}),Wt=je?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&We?"titleMarginTop":void 0,className:o&&We?`${u}-control`:void 0,style:{height:We?_.scalingValue($??0,n):0,width:mt}}),a.jsx("p",{className:we,style:{width:pt,...Ie,...Le},children:at.title}),a.jsx("div",{"data-controls":o&&Qe?"subtitleMarginTop":void 0,className:o&&Qe?`${u}-control`:void 0,style:{height:Qe?_.scalingValue(x??0,n):0,width:mt}}),a.jsx("p",{className:Pe,style:{width:pt,...ye,...G},children:at.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:Rt&&!ut?{gridColumn:Rt}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${ut&&gt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(b??0)>100?`calc(${Ce} * (${b} / 100))`:Ce,...Rt&&ut?{gridColumn:Rt}:{}},children:ut?a.jsx(a.Fragment,{children:je?a.jsxs(a.Fragment,{children:[Mt,a.jsx("a",{href:st,target:"_blank",className:`${u}-item-image-link`,children:_t})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:st,target:"_blank",className:`${u}-item-image-link`,children:_t}),Mt]})}):st?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:st,target:"_blank",className:`${u}-item-image-link`,children:[ot,_t]}),!je&&a.jsx("a",{href:st,target:"_blank",className:`${u}-item-text-link`,children:Wt})]}):a.jsxs(a.Fragment,{children:[ot,_t,Wt]})})},Te)})})}),(!n||i)&&Ft&&typeof document<"u"&&m==="on"&&(()=>{const at=(c?document.getElementById(c):null)??document.body;return Dn.createPortal(a.jsx("div",{style:Gt,"data-selection":"none",children:a.jsx(hh,{prefix:u,items:Ht,index:Zt,imageDisplay:fh(f),isEditor:n,onClose:()=>xt(!1),onPrev:()=>tn(Te=>(Te-1+Ht.length)%Ht.length),onNext:()=>tn(Te=>(Te+1)%Ht.length),counterClassName:fe,counterStyle:he})}),at)})()]})}const vh={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},xh=["hover","focus","filled","success","error"],bh=`import { Splide, SplideSlide } from '@splidejs/react-splide';
4162
+ `}function th(){return Math.random()<.5?"ltr":"ttb"}function nh(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function ih(e){const t=th();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{nh(e)})})}const bn=500,oh=750,jn="cubic-bezier(0.22, 1, 0.36, 1)",rh=72,ah=50;function sh(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 lh(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function ch(e){const[t]=e.media;return t!=null&&t.url?t:null}function Qc(e){return!Array.isArray(e)||e.length===0?[]:sh(e)?e.flatMap(t=>{const n=lh(t);if(!n)return[];const i=ch(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 yi(e){return e.type==="video"}function dh(e){const t=new Set,n=[];for(const i of e){const o=Qc(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 uh({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>yi(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function ph(e){e.pause(),e.removeAttribute("src"),e.load()}function nl({media:e,className:t,style:n,onMediaClick:i}){return yi(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 il(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function mh(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 gh({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{ph(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 hh({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",w=s.useRef(null),b=s.useRef(null),h=s.useRef(null),g=s.useRef(null),m=s.useRef(0),y=s.useRef(0),L=s.useRef("none"),f=s.useRef(!1),S=s.useRef(!1),H=s.useRef(null),I=s.useRef(0),R=s.useRef(null),$=s.useRef(!1),x=s.useRef(null),A=s.useRef(null),v=s.useRef(null),k=s.useRef(()=>{}),[T,D]=s.useState(null),[P,B]=s.useState(null),[O,V]=s.useState("opening"),[ee,E]=s.useState(0),[N,j]=s.useState(0),[le,ie]=s.useState(null),[W,ae]=s.useState(!1),[F,J]=s.useState(!1),[Y,Z]=s.useState(!1),[ye,se]=s.useState(null),re=s.useRef(n),z=s.useRef(void 0),Q=t[n],te=Q?yi(Q):!1,Me=N!==0||W,we=le!==null,Ie=s.useCallback(Ce=>{const Ne=Ce.currentTarget,Be=Ne instanceof HTMLVideoElement?{width:Ne.videoWidth,height:Ne.videoHeight}:{width:Ne.naturalWidth,height:Ne.naturalHeight};!Be.width||!Be.height||se(Be)},[]);s.useEffect(()=>{H.current=P},[P]),s.useEffect(()=>{const Ce=w.current;if(!Ce)return;const Ne=()=>B(il(Ce));Ne();const Be=new ResizeObserver(Ne);return Be.observe(Ce),()=>Be.disconnect()},[]);const ue=s.useCallback(()=>{x.current!==null&&(window.clearTimeout(x.current),x.current=null)},[]),ge=s.useCallback(()=>{const Ce=A.current;A.current=null,ue(),R.current=null,$.current=!1,ie(null),ae(!1),j(0),I.current=0,J(!1),f.current=!1,y.current=0,L.current="none",Ce===1?d():Ce===-1&&l()},[ue,d,l]),ve=s.useCallback(()=>{ue(),A.current=null,R.current=null,$.current=!1,ie(null),ae(!1),j(0),I.current=0},[ue]),q=s.useCallback(()=>{ue(),x.current=window.setTimeout(()=>{A.current!==null&&ge()},bn+32)},[ue,ge]),de=s.useCallback((Ce,Ne)=>{var Ke;const Be=((Ke=H.current)==null?void 0:Ke.width)??0;if(ue(),R.current=Ce,ie(Ce),$.current=!0,ae(!0),Ne){A.current=Ce;const ct=-Ce*Be;I.current=ct,j(ct),q();return}I.current=0,j(0),x.current=window.setTimeout(()=>{x.current=null,ve()},bn+32)},[ue,ve,q]),he=s.useCallback(Ce=>{if(!(t.length<=1)){if($.current){if(A.current===Ce){v.current=Ce,ge();return}ve()}ue(),R.current=Ce,ie(Ce),$.current=!1,ae(!1),I.current=0,j(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{de(Ce,!0)})})}},[t.length,de,ge,ve,ue]);k.current=he;const Se=s.useCallback(Ce=>{Ce.propertyName!=="transform"||!$.current||A.current!==null&&ge()},[ge]),Pe=s.useCallback(()=>{const Ce=b.current;if(!Ce)return;const Ne=il(Ce);!Ne.width||!Ne.height||D(Ne)},[]);s.useEffect(()=>{Pe();const Ce=b.current;if(!Ce)return;const Ne=new ResizeObserver(()=>Pe());return Ne.observe(Ce),()=>Ne.disconnect()},[Pe]),s.useEffect(()=>{O==="opening"&&T&&V("open")},[O,T]),s.useEffect(()=>{if(O!=="closing")return;const Ce=setTimeout(()=>r(),bn);return()=>clearTimeout(Ce)},[O,r]),s.useEffect(()=>()=>{ue()},[ue]),s.useLayoutEffect(()=>{re.current===n&&z.current===(Q==null?void 0:Q.url)||(ue(),A.current=null,ie(null),E(0),j(0),ae(!1),Z(!1),J(!1),se(null),m.current=0,y.current=0,L.current="none",f.current=!1,$.current=!1,I.current=0,R.current=null,g.current=null,S.current=!1,re.current=n,z.current=Q==null?void 0:Q.url)},[n,Q==null?void 0:Q.url,ue]),s.useLayoutEffect(()=>{const Ce=v.current;Ce!==null&&(v.current=null,requestAnimationFrame(()=>{k.current(Ce)}))},[n,Q==null?void 0:Q.url]),s.useEffect(()=>{if(O!=="open")return;let Ce=null;const Ne=()=>{Ce&&(document.removeEventListener("click",Ce,!0),Ce=null)},Be=()=>{Ne(),Ce=dt=>{dt.stopPropagation(),dt.preventDefault(),Ne()},document.addEventListener("click",Ce,!0)},Ke=dt=>{const _e=dt<0?1:-1;if(Math.abs(dt)>ah&&t.length>1){de(_e,!0);return}de(_e,!1)},ct=dt=>{if(dt.touches.length!==1||$.current)return;const _e=dt.touches[0];S.current=!0,g.current={x:_e.clientX,y:_e.clientY},L.current="none",y.current=0,f.current=!1},Je=dt=>{if(!g.current||dt.touches.length!==1||$.current)return;const _e=dt.touches[0],Xe=_e.clientX-g.current.x,je=_e.clientY-g.current.y;if(L.current==="none"){if(Math.abs(Xe)<10&&Math.abs(je)<10)return;if(Math.abs(Xe)>Math.abs(je)){if(t.length<=1)return;L.current="horizontal"}else if(je>0)L.current="vertical";else return}if(L.current==="horizontal"){f.current=!0,J(!0),y.current=Xe;const ut=Xe<0?1:-1;R.current!==ut&&(R.current=ut,ie(ut)),I.current=Xe,j(Xe),dt.preventDefault();return}L.current==="vertical"&&(f.current=!0,J(!0),m.current=je,E(je),dt.preventDefault())},$t=()=>{if(!g.current)return;const dt=L.current,_e=f.current;if(_e&&dt==="horizontal")Ke(y.current),Be();else if(_e&&dt==="vertical")if(m.current>rh){const je=window.innerHeight;m.current=je,Z(!0),E(je),V("closing")}else m.current=0,E(0),Be();else dt==="horizontal"&&Math.abs(y.current)>0&&(Ke(y.current),Be());g.current=null,L.current="none",y.current=0,f.current=!1,J(!1)};return document.addEventListener("touchstart",ct,{passive:!0}),document.addEventListener("touchmove",Je,{passive:!1}),document.addEventListener("touchend",$t),document.addEventListener("touchcancel",$t),()=>{document.removeEventListener("touchstart",ct),document.removeEventListener("touchmove",Je),document.removeEventListener("touchend",$t),document.removeEventListener("touchcancel",$t),Ne()}},[O,t.length,de]),s.useEffect(()=>{const Ce=Ne=>{Ne.key==="Escape"&&(Ne.preventDefault(),Ne.stopPropagation(),O!=="closing"&&V("closing"))};return window.addEventListener("keydown",Ce,!0),()=>window.removeEventListener("keydown",Ce,!0)},[O]);const Le=()=>{O!=="closing"&&V("closing")},G=O==="open",fe=O==="closing",ce=ee>0?Math.max(0,1-ee/500):1,U=ee>0?Math.max(.35,1-ee/500):1,oe=T?p?T:mh(T,ye):null,Ee=Ce=>{if(Ce.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const Ne=oe??Ce.currentTarget.getBoundingClientRect(),Be=Ce.clientY-Ne.top,Ke=Math.min(52,Ne.height*.2);if(!(Be>Ne.height-Ke)){if(Ce.clientX-Ne.left<Ne.width/2){he(-1);return}he(1)}},pe=Ce=>{if(t.length<=1)return;const Ne=oe??Ce.currentTarget.getBoundingClientRect(),Be=Ce.clientX-Ne.left,Ke=Ce.clientY-Ne.top,ct=Math.min(52,Ne.height*.2);if(Ke>Ne.height-ct){Ce.currentTarget.style.cursor="default";return}Ce.currentTarget.style.cursor=Be<Ne.width/2?"w-resize":"e-resize"},K={position:"fixed",top:P==null?void 0:P.top,left:P==null?void 0:P.left,width:P==null?void 0:P.width,height:P==null?void 0:P.height,zIndex:9998},Ve=p?"cover":"contain",Oe=N!==0||ee>0?`translate(${N}px, ${ee}px)`:void 0,lt=F&&!W?"none":W?`transform ${bn}ms ${jn}`:Y?`transform ${bn}ms ${jn}, opacity ${bn}ms ${jn}`:O==="opening"||fe?`opacity ${bn}ms ${jn}`:"none",tt={...K,transform:Oe,opacity:ee>0?U:O==="opening"||fe?0:1,transition:lt,pointerEvents:"none"},ht={position:"absolute",top:((oe==null?void 0:oe.top)??0)-((P==null?void 0:P.top)??0),left:((oe==null?void 0:oe.left)??0)-((P==null?void 0:P.left)??0),width:oe==null?void 0:oe.width,height:oe==null?void 0:oe.height,objectFit:Ve,pointerEvents:te&&G&&!Me?"auto":"none",touchAction:te&&G?"none":void 0},nt=(P==null?void 0:P.width)??0,ze=we?(n+le+t.length)%t.length:null,be=ze!==null?t[ze]:null,Ae={...K,transform:we?`translateX(${le*nt+N}px)`:void 0,opacity:1,transition:W?`transform ${bn}ms ${jn}`:"none",pointerEvents:"none"},De={position:"absolute",top:((T==null?void 0:T.top)??0)-((P==null?void 0:P.top)??0),left:((T==null?void 0:T.left)??0)-((P==null?void 0:P.left)??0),width:T==null?void 0:T.width,height:T==null?void 0:T.height,objectFit:Ve,pointerEvents:"none"},Ue=oe?{position:"fixed",top:oe.top,height:oe.height,width:oe.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:w,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:O==="open"?"none":void 0},onClick:Le,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:G?ce:0,transition:F?"none":`opacity ${bn}ms ${jn}`,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:b,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:G?1:0,transition:`opacity ${bn}ms ${jn}`,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:b,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:G?1:0,transition:`opacity ${bn}ms ${jn}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),T&&P&&be&&a.jsx("div",{style:Ae,onTransitionEnd:Se,children:yi(be)?a.jsx("video",{src:be.url,muted:!0,playsInline:!0,preload:"auto",style:De},`neighbor-${ze}-${be.url}`):a.jsx("img",{src:be.url,alt:be.name,style:De},`neighbor-${ze}-${be.url}`)}),T&&P&&Q&&a.jsx("div",{style:tt,onTransitionEnd:Se,children:te?a.jsx(gh,{src:Q.url,phase:O,mediaRef:h,mediaStyle:ht,onLoadedMetadata:Ie,onClick:Ee,onMouseMove:pe},`${n}-${Q.url}`):a.jsx("img",{ref:h,src:Q.url,alt:Q.name,onLoad:Ie,style:ht},`${n}-${Q.url}`)}),G&&Ue&&t.length>1&&!te&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ue,left:oe.left,cursor:"w-resize",pointerEvents:F?"none":"auto"},onClick:Ce=>{if(S.current){S.current=!1;return}Ce.stopPropagation(),he(-1)}}),a.jsx("div",{style:{...Ue,left:oe.left+oe.width/2,cursor:"e-resize",pointerEvents:F?"none":"auto"},onClick:Ce=>{if(S.current){S.current=!1;return}Ce.stopPropagation(),he(1)}})]})]})}function fh(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function yh({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=_.useScopedStyles(),{type:p="a",gridLayout:w,textBoxWidth:b=100,verticalGap:h,entriesCount:g,lightbox:m,imageDisplay:y,imageCorners:L,lightboxImageDisplay:f,slider:S,sliderTiming:H,direction:I,transition:R,titleMarginTop:$,subtitleMarginTop:x,titleColor:A,subtitleColor:v,lightboxCounterColor:k,titleFontFamily:T,titleFontSettings:D,titleFontSize:P,titleLineHeight:B,titleLetterSpacing:O,titleWordSpacing:V,titleTextAppearance:ee,subtitleFontFamily:E,subtitleFontSettings:N,subtitleFontSize:j,subtitleLineHeight:le,subtitleLetterSpacing:ie,subtitleWordSpacing:W,subtitleTextAppearance:ae,lightboxCounterFontFamily:F,lightboxCounterFontSettings:J,lightboxCounterFontSize:Y,lightboxCounterLineHeight:Z,lightboxCounterLetterSpacing:ye,lightboxCounterWordSpacing:se,lightboxCounterTextAppearance:re,showText:z="always",alignEntries:Q="off",align:te="top"}=e,Me={fontSettings:{fontFamily:T,fontWeight:(D==null?void 0:D.fontWeight)??400,fontStyle:(D==null?void 0:D.fontStyle)??"normal"},fontSize:P??.01,lineHeight:B,letterSpacing:O??0,wordSpacing:V??0,textAppearance:ee,color:A},Ie={...rn(qt(Me,n))},ue={fontSettings:{fontFamily:E,fontWeight:(N==null?void 0:N.fontWeight)??400,fontStyle:(N==null?void 0:N.fontStyle)??"normal"},fontSize:j??.01,lineHeight:le,letterSpacing:ie??0,wordSpacing:W??0,textAppearance:ae,color:v},ve={...rn(qt(ue,n))},q={fontSettings:{fontFamily:F,fontWeight:(J==null?void 0:J.fontWeight)??400,fontStyle:(J==null?void 0:J.fontStyle)??"normal"},fontSize:Y??.01,lineHeight:Z,letterSpacing:ye??0,wordSpacing:se??0,textAppearance:re,color:k},he={...rn(qt(q,n)),...oa(Y,Z,u,n)},Se=ia(P,B,`${u}-item-title`,`${u}-text-tight-leading`),Pe=ia(j,le,`${u}-item-subtitle`,`${u}-text-tight-leading`),Le=oa(P,B,u,n),G=oa(j,le,u,n),fe=ia(Y,Z,`${u}-lightbox-counter`,`${u}-text-tight-leading`),ce=_.buildColorVars(u,{titleColor:A,subtitleColor:v,lightboxCounterColor:k},vh,xh),Ee=`${l&&l!=="default"?`${u}-state-${l}`:""}${z==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),pe=g===0?1/0:g,K=(t??[]).slice(0,pe),Ve=s.useMemo(()=>m==="on"?dh(K):[],[K,m]),Oe=w.entryWidth??.2,lt=(y==null?void 0:y.display)==="cover",tt=(y==null?void 0:y.ratioValue)??"1:1",ht=(y==null?void 0:y.reversed)??!1,[nt,ze]=tt.split(":").map(Number),De=`${ht?ze:nt} / ${ht?nt:ze}`,Ue=w.columnsCount,Ce=_.scalingValue(Oe??0,n),Ne=Ce,Be=!lt&&S!=="off",Ke=K.length%Ue||Ue,ct=Ke<Ue&&K.length>0,Je=K.length-Ke,$t=ct?Math.floor((Ue-Ke)/2)+1:1,dt=L?_.scalingValue(L,n):void 0,_e={width:Ne,...lt?{aspectRatio:De,height:"auto",overflow:"hidden"}:{height:"auto"},...dt?{borderRadius:dt,overflow:"hidden"}:{}},Xe=`${u}-item-image-wrapper${Be?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),je=p==="d"||p==="e"||p==="f",ut=Q==="on",pt=`calc(${_.scalingValue(Oe??0,n)} * (${b} / 100))`,mt=_.scalingValue(Oe*b/100,n),kt=lt?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...dt?{borderRadius:dt}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...dt?{borderRadius:dt}:{}},[Kt,Yt]=s.useState(0),vt=s.useRef(null),bt=R==="fade"||I==="horizontal"?"ltr":I==="vertical"?"ttb":"ltr";s.useEffect(()=>{const at=vt.current;if(!at)return;const Te=new ResizeObserver(We=>{Yt(Math.round(We[0].contentRect.width))});return Te.observe(at),()=>Te.disconnect()},[]);const Gt=(()=>{const at={...ce},Te=vt.current?getComputedStyle(vt.current).getPropertyValue("--cntrl-article-width").trim():"";return Te&&(at["--cntrl-article-width"]=Te),at})(),[Ft,xt]=s.useState(!1),[Ht,Ut]=s.useState([]),[Zt,tn]=s.useState(0),Ct=m==="on"&&(!n||i),jt=(at,Te)=>{n&&!i||m!=="off"&&(Ut(at),tn(Te),xt(!0))};s.useEffect(()=>{if(!Ft||m!=="on"||typeof document>"u")return;const at=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=at}},[Ft,m]),s.useEffect(()=>{!n||i||xt(!1)},[n,i]);const dn=s.useMemo(()=>eh(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:dn}}),m==="on"&&a.jsx(uh,{mediaList:Ve}),a.jsx("div",{style:ce,children:a.jsx("div",{ref:vt,className:`${u}-wrapper ${u}-type-${p}${ut?` ${u}-align-entries`:""} ${u}-image-align-${te} ${Ee}`.trim(),style:{gridTemplateColumns:`repeat(${Ue}, ${Ce})`,rowGap:ut?0:_.scalingValue(h??0,n),columnGap:_.scalingValue(w.horizontalGap??0,n),width:_.scalingValue(w.wrapperWidth??0,n),...ut?{[`--${u}-align-entries-row-gap`]:_.scalingValue(h??0,n)}:{}},children:K.map((at,Te)=>{var At;const We=tl(at.title),Qe=tl(at.subtitle),st=(((At=at.link)==null?void 0:At.length)??0)>0&&m==="off"?at.link:void 0,gt=Math.floor(Te/Ue)===Math.ceil(K.length/Ue)-1,Rt=ct&&Te>=Je?`${$t+(Te-Je)}`:void 0,ot=je?a.jsxs("div",{className:`${u}-item-text-block`,children:[We&&a.jsx("p",{className:Se,style:{width:pt,...Ie,...Le},children:at.title}),We&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:_.scalingValue($??0,n),width:mt}}),Qe&&a.jsx("p",{className:Pe,style:{width:pt,...ve,...G},children:at.subtitle}),Qe&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:_.scalingValue(x??0,n),width:mt}})]}):null,Ot=ut?a.jsxs("div",{className:`${u}-item-title-row`,children:[!je&&a.jsx("div",{"data-controls":o&&We?"titleMarginTop":void 0,className:o&&We?`${u}-control`:void 0,style:{height:We?_.scalingValue($??0,n):0,width:mt}}),We&&a.jsx("p",{className:Se,style:{width:pt,...Ie,...Le},children:at.title}),je&&We&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:_.scalingValue($??0,n),width:mt}})]}):null,Et=ut?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!je&&a.jsx("div",{"data-controls":o&&Qe?"subtitleMarginTop":void 0,className:o&&Qe?`${u}-control`:void 0,style:{height:Qe?_.scalingValue(x??0,n):0,width:mt}}),Qe&&a.jsx("p",{className:Pe,style:{width:pt,...ve,...G},children:at.subtitle}),je&&Qe&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:_.scalingValue(x??0,n),width:mt}})]}):null,Mt=st?a.jsxs("a",{href:st,target:"_blank",className:`${u}-item-text-link`,children:[Ot,Et]}):a.jsxs(a.Fragment,{children:[Ot,Et]}),Bt=Qc(at.gallery),zt=Bt.filter(wt=>wt.lightboxMedia).map(wt=>wt.lightboxMedia),_t=a.jsx("div",{className:Xe,style:_e,children:Bt.length===0?null:S==="off"?(()=>{const{displayMedia:wt,lightboxMedia:M}=Bt[0],xe=M?zt.findIndex(Re=>Re.url===M.url):-1;return a.jsx(nl,{media:wt,className:`${u}-item-${yi(wt)?"video":"image"}`.trim(),style:kt,onMediaClick:Ct&&xe>=0?()=>jt(zt,xe):void 0})})():a.jsxs(a.Fragment,{children:[Be&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Bt.map(({displayMedia:wt})=>yi(wt)?a.jsx("video",{src:wt.url,muted:!0,playsInline:!0},`sizer-${wt.url}`):a.jsx("img",{src:wt.url,alt:""},`sizer-${wt.url}`))}),a.jsx(fs,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:H*1e3,width:"100%",height:"100%",speed:oh,type:R==="fade"?"fade":"loop",rewind:R==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:bt},onMoved:wt=>{I!=="random"||R==="fade"||ih(wt)},children:Bt.map(({displayMedia:wt,lightboxMedia:M},xe)=>{const Re=M?zt.findIndex(ke=>ke.url===M.url):-1;return a.jsx(ys,{children:a.jsx(nl,{media:wt,className:`${u}-item-${yi(wt)?"video":"image"}`.trim(),style:kt,onMediaClick:Ct&&Re>=0?()=>jt(zt,Re):void 0})},xe)})},`${R}-${Oe}-${I}-${H}-${Kt}-${d}`)]})}),Wt=je?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&We?"titleMarginTop":void 0,className:o&&We?`${u}-control`:void 0,style:{height:We?_.scalingValue($??0,n):0,width:mt}}),a.jsx("p",{className:Se,style:{width:pt,...Ie,...Le},children:at.title}),a.jsx("div",{"data-controls":o&&Qe?"subtitleMarginTop":void 0,className:o&&Qe?`${u}-control`:void 0,style:{height:Qe?_.scalingValue(x??0,n):0,width:mt}}),a.jsx("p",{className:Pe,style:{width:pt,...ve,...G},children:at.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:Rt&&!ut?{gridColumn:Rt}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${ut&&gt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(b??0)>100?`calc(${Ce} * (${b} / 100))`:Ce,...Rt&&ut?{gridColumn:Rt}:{}},children:ut?a.jsx(a.Fragment,{children:je?a.jsxs(a.Fragment,{children:[Mt,a.jsx("a",{href:st,target:"_blank",className:`${u}-item-image-link`,children:_t})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:st,target:"_blank",className:`${u}-item-image-link`,children:_t}),Mt]})}):st?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:st,target:"_blank",className:`${u}-item-image-link`,children:[ot,_t]}),!je&&a.jsx("a",{href:st,target:"_blank",className:`${u}-item-text-link`,children:Wt})]}):a.jsxs(a.Fragment,{children:[ot,_t,Wt]})})},Te)})})}),(!n||i)&&Ft&&typeof document<"u"&&m==="on"&&(()=>{const at=(c?document.getElementById(c):null)??document.body;return Dn.createPortal(a.jsx("div",{style:Gt,"data-selection":"none",children:a.jsx(hh,{prefix:u,items:Ht,index:Zt,imageDisplay:fh(f),isEditor:n,onClose:()=>xt(!1),onPrev:()=>tn(Te=>(Te-1+Ht.length)%Ht.length),onNext:()=>tn(Te=>(Te+1)%Ht.length),counterClassName:fe,counterStyle:he})}),at)})()]})}const vh={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},xh=["hover","focus","filled","success","error"],bh=`import { Splide, SplideSlide } from '@splidejs/react-splide';
4163
4163
  import '@splidejs/react-splide/css/core';
4164
4164
  import { CommonComponentProps } from '../props';
4165
4165
  import {
@@ -6212,7 +6212,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
6212
6212
  };
6213
6213
 
6214
6214
  const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
6215
- `,ra={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},wh=["titleColor","subtitleColor","lightboxCounterColor"],Sh={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:{...ra.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:{...ra.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:{...ra.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:[...wh],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},$h={element:yh,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:Sh,sourceCode:bh},Ch=50,ol=10,vs="cntrl-lightbox-journal",jr=vs,Ha=`${vs}-`,Br=e=>`${vs}-${e}`,xs=e=>e===jr||e.startsWith(Ha),rl=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},al=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=rl(t.get(Br(e)));if(i)return i}const n=rl(t.get(jr));if(n)return n;for(const[i]of t){if(!i.startsWith(Ha))continue;const o=i.slice(Ha.length);if(!/^\d+$/.test(o))continue;const r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}return null},sl=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},ed=(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(Br(t),String(e)):i.searchParams.set(jr,String(e));const o=n?"replaceState":"pushState",r=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",r)},Th=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Br(e)||i===jr: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)}},td=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Br(e)):[...t.keys()].some(n=>xs(n))},Lh=(e,t)=>{if(td(t)){if(e){window.history.back();return}Th(t)}},Rh=20,Ih=2,aa=e=>`max(${e}, ${Rh}px)`,ji=e=>((e==null?void 0:e.image)??[]).slice(0,Ih),nd=e=>e.reduce((t,n)=>t+ji(n).length,0),Ph=(e,t)=>{const n=e.slice(0,t).reduce((o,r)=>o+ji(r).length,1),i=ji(e[t]).length;return{start:n,end:n+i-1}},Mh=(e,t)=>{const n=nd(e),{start:i,end:o}=Ph(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},hr=(e,t)=>t==="B"?e.flatMap((n,i)=>ji(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:ji(n)})),Eh=(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 Mh(i,o)},ll=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",kh=(e,t,n)=>e==="B"?t.length>1:nd(n)>1,fn=.004,qn=.004,Wi={title1Width:.13,title2Width:.13,title3Width:.14},Xn=(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},Bi=(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},Io=(e,t)=>Bi(e,t),ln=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Kn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Bi(e.length,n),effective:Io(e.length,n)}},id=(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),od=(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),Jn=["title1","title2","title3","count"],Ze=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,bs={title1:"1",title2:"2",title3:"3",count:"Count"},ws=e=>[Ze(e,"fontFamily"),Ze(e,"fontSettings"),{type:"row",items:[Ze(e,"fontSize"),Ze(e,"lineHeight"),Ze(e,"letterSpacing"),Ze(e,"wordSpacing")]},Ze(e,"textAlign"),Ze(e,"textAppearance")],Ah=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Jn.map(e=>[bs[e],ws(e)]))}),Fh={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},_h={title1:.02,title2:.02,title3:.02,count:.017},gi=(e,t)=>{const n=i=>{const o=Ze(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[Fh[t]]}},hi=(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??_h[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return qt(i,n)};function rd({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:w=0,title3MarginLeft:b=0,titleRowMarginBottom:h=0,titleHeaderLayout:g="desktop",contentMarginTop:m=0,iconMarginRight:v=0,closeIcon:L=null,closeIconMaxWidth:f=0,closeIconColor:S="#000000",closeIconHoverColor:H="#cccccc"}=n,P=_.scalingValue(m,i),R=_.scalingValue(v,i),$=_.scalingValue(h,i),x=g==="mobile",A=hi("title1",gi(n,"title1"),i),y=hi("title2",gi(n,"title2"),i),F=hi("title3",gi(n,"title3"),i),T=s.useMemo(()=>({title1Width:d??Wi.title1Width,title2Width:c??Wi.title2Width,title3Width:u??Wi.title3Width}),[d,c,u]),j=s.useMemo(()=>({title2MarginLeft:w,title3MarginLeft:b}),[w,b]),E=s.useMemo(()=>Xn(e,t,A,y,F),[e,t,A,y,F]),B=s.useMemo(()=>E.map(U=>T[U.widthKey]),[E,T]),O=s.useMemo(()=>Bi(E.length,B),[E.length,B]),z=s.useMemo(()=>Io(E.length,B),[E.length,B]),ee=s.useMemo(()=>E.filter(U=>U.prefix==="title1"),[E]),k=s.useMemo(()=>E.filter(U=>U.prefix==="title2"||U.prefix==="title3"),[E]),W=s.useMemo(()=>Kn(ee,T),[ee,T]),D=s.useMemo(()=>Kn(k,T),[k,T]),le=!!(t.title1||t.title2||t.title3),Y=L!==null;if(!(le||Y))return null;const oe=(p??0)>0||o,N=(U,re)=>{const Ee=E.findIndex(K=>K.prefix===U.prefix);if(!x||re==="single-row")return{effectiveWidth:z[Ee]??0,resolvedWidth:O[Ee]??0,maxWidth:ln(Ee,O)};if(re==="two-row-top"){const K=ee.findIndex(Ve=>Ve.prefix===U.prefix);return{effectiveWidth:W.effective[K]??0,resolvedWidth:W.resolved[K]??0,maxWidth:ln(K,W.resolved)}}const pe=k.findIndex(K=>K.prefix===U.prefix);return{effectiveWidth:D.effective[pe]??0,resolvedWidth:D.resolved[pe]??0,maxWidth:ln(pe,D.resolved)}},ie=(U,re,Ee)=>{if(!x||Ee==="single-row"){const lt=U.findIndex(ze=>ze.prefix===re.prefix),tt=U.map(ze=>T[ze.widthKey]),ht=Bi(U.length,tt);return{effectiveWidth:Io(U.length,tt)[lt]??0,resolvedWidth:ht[lt]??0,maxWidth:ln(lt,ht)}}if(Ee==="two-row-top"){const lt=U.filter(ze=>ze.prefix==="title1"),tt=lt.findIndex(ze=>ze.prefix===re.prefix),{resolved:ht,effective:nt}=Kn(lt,T);return{effectiveWidth:nt[tt]??0,resolvedWidth:ht[tt]??0,maxWidth:ln(tt,ht)}}const pe=U.filter(lt=>lt.prefix==="title2"||lt.prefix==="title3"),K=pe.findIndex(lt=>lt.prefix===re.prefix),{resolved:Ve,effective:Oe}=Kn(pe,T);return{effectiveWidth:Oe[K]??0,resolvedWidth:Ve[K]??0,maxWidth:ln(K,Ve)}},Z=U=>od(E,O,j,U)+(x?0:p??0),te=()=>x?0:p??0,Se=U=>k.slice(0,U).reduce((re,Ee,pe)=>re+(Ee.marginLeftKey?j[Ee.marginLeftKey]??0:0)+(D.resolved[pe]??0),0),se=U=>{const re=k[U];return Se(U)+(re.marginLeftKey?j[re.marginLeftKey]??0:0)+(D.resolved[U]??0)},ae=(U,re,Ee)=>{const pe=U.marginLeftKey?j[U.marginLeftKey]??0:0,{effectiveWidth:K,resolvedWidth:Ve,maxWidth:Oe}=Ee??N(U,re),lt=Math.max(pe,qn),tt=o&&re==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":U.prefix,style:{width:_.scalingValue(K,i),...pe>0?{marginLeft:_.scalingValue(pe,i)}:{}},children:[a.jsx("p",{className:U.className,style:U.style,children:U.text}),tt&&U.marginLeftKey?a.jsx("div",{"data-controls":U.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ve),style:{position:"absolute",top:0,left:_.scalingValue(-pe,i),width:_.scalingValue(lt,i),height:"100%",pointerEvents:"auto"}}):null,tt?a.jsx("div",{"data-controls":U.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Oe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:_.scalingValue(-fn/2,i),width:_.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}}):null]},U.className)},V=(U="two-row")=>{const re=E.findIndex(K=>K.prefix==="title1"),Ee=re>=0?O[re]:T.title1Width,pe=U==="two-row"&&o;return a.jsx("div",{...pe?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ee)}:{},style:{width:_.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...pe?{pointerEvents:"auto"}:{}}})},J=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:A,"aria-hidden":"true",children:" "}),Q=U=>{const re=Xn(e,U,A,y,F);return a.jsx(a.Fragment,{children:re.map(Ee=>ae(Ee,"single-row",ie(re,Ee,"single-row")))})},Me=U=>{const re=Xn(e,U,A,y,F),Ee=re.find(pe=>pe.prefix==="title1");return Ee?ae(Ee,"two-row-top",ie(re,Ee,"two-row-top")):null},be=(U,re=!1)=>{const Ee=Xn(e,U,A,y,F),pe=Ee.filter(Oe=>Oe.prefix==="title2"||Oe.prefix==="title3"),K=o&&re;return pe.length>0||K||(h??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[pe.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[a.jsx("div",{className:`${e}-titles-stack`,children:pe.map(Oe=>ae(Oe,"two-row-bottom",ie(Ee,Oe,"two-row-bottom")))}),re&&o?a.jsxs(a.Fragment,{children:[we(),Pe()]}):null]}):null,(h??0)>0||K?a.jsx("div",{"data-controls":K?"titleRowMarginBottom":void 0,"data-controls-axis":K?"y":void 0,"data-controls-reverse":K?"":void 0,className:K?`${e}-control`:void 0,style:{height:$,width:"100%",flexShrink:0,pointerEvents:K?"auto":"none"}}):null]}):null},Ie=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:_.scalingValue(f??0,i),height:_.scalingValue(f??0,i),marginRight:R,"--close-icon-hover-color":H},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:U=>{U.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(an,{url:L??"",fill:S,hoverFill:i&&!r?S: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:R,height:"100%",pointerEvents:"auto"}})]}),ue=()=>Y?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:Ie()}):null,ge=U=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:U})}),ye=U=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[Y||le?J():null,oe?V("two-row"):null,ge(U),ue()]}),q=(U,re=!1)=>a.jsxs(a.Fragment,{children:[ye(Me(U)),be(U,re)]}),de=()=>{const U=x?-1:E.findIndex(pe=>pe.prefix==="title1"),re=!x&&(o||(p??0)>0)?(()=>{const pe=p??0,K=U>=0?O[U]:T.title1Width,Ve=Math.max(pe,qn);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(K),style:{position:"absolute",top:0,left:0,width:_.scalingValue(Ve,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Ee=E.flatMap((pe,K)=>{if(!pe.marginLeftKey)return[];const Ve=j[pe.marginLeftKey]??0,Oe=id(E,O,j,K)+te(),lt=Math.max(Ve,qn);return a.jsx("div",{"data-controls":pe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(O[K]),style:{position:"absolute",top:0,left:_.scalingValue(Oe,i),width:_.scalingValue(lt,i),height:"100%",pointerEvents:"auto"}},pe.marginLeftKey)});return re?[re,...Ee]:Ee},he=()=>E.map((U,re)=>{const Ee=ln(re,O),K=Z(re)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":U.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ee),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:_.scalingValue(K,i),width:_.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${U.widthKey}-junction`)}),we=()=>k.flatMap((U,re)=>{if(!U.marginLeftKey)return[];const Ee=j[U.marginLeftKey]??0,pe=Se(re),K=Math.max(Ee,qn),{resolvedWidth:Ve}=N(U,"two-row-bottom");return a.jsx("div",{"data-controls":U.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ve),style:{position:"absolute",top:0,left:_.scalingValue(pe,i),width:_.scalingValue(K,i),height:"100%",pointerEvents:"auto"}},U.marginLeftKey)}),Pe=()=>k.map((U,re)=>{const{maxWidth:Ee}=N(U,"two-row-bottom"),K=se(re)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":U.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ee),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:_.scalingValue(K,i),width:_.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${U.widthKey}-junction`)}),Le=()=>!o||x?null:a.jsxs(a.Fragment,{children:[de(),he()]}),G=!!(t.title2||t.title3||(h??0)>0||o),fe=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Y||le?J():null,oe?V("single-row"):null,le?ge(Q(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),ue(),Le()]}),ce=()=>a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...G?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:G?void 0:{flex:"0 0 auto",height:"auto"},children:q(t,!0)}),Le()]});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:P,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...x?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${x?` ${e}-lightbox-content-area-stacked`:""}`,children:a.jsx("div",{className:`${e}-text-bar-cell${x?` ${e}-text-bar-cell-stacked`:""}`,style:x?void 0:{flex:1,minWidth:0,width:"100%"},children:x?ce():fe()})})})]})}function Wh(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Nh(e){return`
6215
+ `,ra={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},wh=["titleColor","subtitleColor","lightboxCounterColor"],Sh={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:{...ra.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:{...ra.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:{...ra.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:[...wh],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},$h={element:yh,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:Sh,sourceCode:bh},Ch=50,ol=10,vs="cntrl-lightbox-journal",jr=vs,Ha=`${vs}-`,Br=e=>`${vs}-${e}`,xs=e=>e===jr||e.startsWith(Ha),rl=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},al=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=rl(t.get(Br(e)));if(i)return i}const n=rl(t.get(jr));if(n)return n;for(const[i]of t){if(!i.startsWith(Ha))continue;const o=i.slice(Ha.length);if(!/^\d+$/.test(o))continue;const r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}return null},sl=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},ed=(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(Br(t),String(e)):i.searchParams.set(jr,String(e));const o=n?"replaceState":"pushState",r=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",r)},Th=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Br(e)||i===jr: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)}},td=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Br(e)):[...t.keys()].some(n=>xs(n))},Lh=(e,t)=>{if(td(t)){if(e){window.history.back();return}Th(t)}},Rh=20,Ih=2,aa=e=>`max(${e}, ${Rh}px)`,ji=e=>((e==null?void 0:e.image)??[]).slice(0,Ih),nd=e=>e.reduce((t,n)=>t+ji(n).length,0),Ph=(e,t)=>{const n=e.slice(0,t).reduce((o,r)=>o+ji(r).length,1),i=ji(e[t]).length;return{start:n,end:n+i-1}},Mh=(e,t)=>{const n=nd(e),{start:i,end:o}=Ph(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},hr=(e,t)=>t==="B"?e.flatMap((n,i)=>ji(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:ji(n)})),Eh=(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 Mh(i,o)},ll=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",kh=(e,t,n)=>e==="B"?t.length>1:nd(n)>1,fn=.004,qn=.004,Wi={title1Width:.13,title2Width:.13,title3Width:.14},Xn=(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},Bi=(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},Io=(e,t)=>Bi(e,t),ln=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Kn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Bi(e.length,n),effective:Io(e.length,n)}},id=(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),od=(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),Jn=["title1","title2","title3","count"],Ze=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,bs={title1:"1",title2:"2",title3:"3",count:"Count"},ws=e=>[Ze(e,"fontFamily"),Ze(e,"fontSettings"),{type:"row",items:[Ze(e,"fontSize"),Ze(e,"lineHeight"),Ze(e,"letterSpacing"),Ze(e,"wordSpacing")]},Ze(e,"textAlign"),Ze(e,"textAppearance")],Ah=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Jn.map(e=>[bs[e],ws(e)]))}),Fh={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},_h={title1:.02,title2:.02,title3:.02,count:.017},gi=(e,t)=>{const n=i=>{const o=Ze(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[Fh[t]]}},hi=(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??_h[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return qt(i,n)};function rd({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:w=0,title3MarginLeft:b=0,titleRowMarginBottom:h=0,titleHeaderLayout:g="desktop",contentMarginTop:m=0,iconMarginRight:y=0,closeIcon:L=null,closeIconMaxWidth:f=0,closeIconColor:S="#000000",closeIconHoverColor:H="#cccccc"}=n,I=_.scalingValue(m,i),R=_.scalingValue(y,i),$=_.scalingValue(h,i),x=g==="mobile",A=hi("title1",gi(n,"title1"),i),v=hi("title2",gi(n,"title2"),i),k=hi("title3",gi(n,"title3"),i),T=s.useMemo(()=>({title1Width:d??Wi.title1Width,title2Width:c??Wi.title2Width,title3Width:u??Wi.title3Width}),[d,c,u]),D=s.useMemo(()=>({title2MarginLeft:w,title3MarginLeft:b}),[w,b]),P=s.useMemo(()=>Xn(e,t,A,v,k),[e,t,A,v,k]),B=s.useMemo(()=>P.map(U=>T[U.widthKey]),[P,T]),O=s.useMemo(()=>Bi(P.length,B),[P.length,B]),V=s.useMemo(()=>Io(P.length,B),[P.length,B]),ee=s.useMemo(()=>P.filter(U=>U.prefix==="title1"),[P]),E=s.useMemo(()=>P.filter(U=>U.prefix==="title2"||U.prefix==="title3"),[P]),N=s.useMemo(()=>Kn(ee,T),[ee,T]),j=s.useMemo(()=>Kn(E,T),[E,T]),le=!!(t.title1||t.title2||t.title3),ie=L!==null;if(!(le||ie))return null;const ae=(p??0)>0||o,F=(U,oe)=>{const Ee=P.findIndex(K=>K.prefix===U.prefix);if(!x||oe==="single-row")return{effectiveWidth:V[Ee]??0,resolvedWidth:O[Ee]??0,maxWidth:ln(Ee,O)};if(oe==="two-row-top"){const K=ee.findIndex(Ve=>Ve.prefix===U.prefix);return{effectiveWidth:N.effective[K]??0,resolvedWidth:N.resolved[K]??0,maxWidth:ln(K,N.resolved)}}const pe=E.findIndex(K=>K.prefix===U.prefix);return{effectiveWidth:j.effective[pe]??0,resolvedWidth:j.resolved[pe]??0,maxWidth:ln(pe,j.resolved)}},J=(U,oe,Ee)=>{if(!x||Ee==="single-row"){const lt=U.findIndex(ze=>ze.prefix===oe.prefix),tt=U.map(ze=>T[ze.widthKey]),ht=Bi(U.length,tt);return{effectiveWidth:Io(U.length,tt)[lt]??0,resolvedWidth:ht[lt]??0,maxWidth:ln(lt,ht)}}if(Ee==="two-row-top"){const lt=U.filter(ze=>ze.prefix==="title1"),tt=lt.findIndex(ze=>ze.prefix===oe.prefix),{resolved:ht,effective:nt}=Kn(lt,T);return{effectiveWidth:nt[tt]??0,resolvedWidth:ht[tt]??0,maxWidth:ln(tt,ht)}}const pe=U.filter(lt=>lt.prefix==="title2"||lt.prefix==="title3"),K=pe.findIndex(lt=>lt.prefix===oe.prefix),{resolved:Ve,effective:Oe}=Kn(pe,T);return{effectiveWidth:Oe[K]??0,resolvedWidth:Ve[K]??0,maxWidth:ln(K,Ve)}},Y=U=>od(P,O,D,U)+(x?0:p??0),Z=()=>x?0:p??0,ye=U=>E.slice(0,U).reduce((oe,Ee,pe)=>oe+(Ee.marginLeftKey?D[Ee.marginLeftKey]??0:0)+(j.resolved[pe]??0),0),se=U=>{const oe=E[U];return ye(U)+(oe.marginLeftKey?D[oe.marginLeftKey]??0:0)+(j.resolved[U]??0)},re=(U,oe,Ee)=>{const pe=U.marginLeftKey?D[U.marginLeftKey]??0:0,{effectiveWidth:K,resolvedWidth:Ve,maxWidth:Oe}=Ee??F(U,oe),lt=Math.max(pe,qn),tt=o&&oe==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":U.prefix,style:{width:_.scalingValue(K,i),...pe>0?{marginLeft:_.scalingValue(pe,i)}:{}},children:[a.jsx("p",{className:U.className,style:U.style,children:U.text}),tt&&U.marginLeftKey?a.jsx("div",{"data-controls":U.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ve),style:{position:"absolute",top:0,left:_.scalingValue(-pe,i),width:_.scalingValue(lt,i),height:"100%",pointerEvents:"auto"}}):null,tt?a.jsx("div",{"data-controls":U.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Oe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:_.scalingValue(-fn/2,i),width:_.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}}):null]},U.className)},z=(U="two-row")=>{const oe=P.findIndex(K=>K.prefix==="title1"),Ee=oe>=0?O[oe]:T.title1Width,pe=U==="two-row"&&o;return a.jsx("div",{...pe?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ee)}:{},style:{width:_.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...pe?{pointerEvents:"auto"}:{}}})},Q=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:A,"aria-hidden":"true",children:" "}),te=U=>{const oe=Xn(e,U,A,v,k);return a.jsx(a.Fragment,{children:oe.map(Ee=>re(Ee,"single-row",J(oe,Ee,"single-row")))})},Me=U=>{const oe=Xn(e,U,A,v,k),Ee=oe.find(pe=>pe.prefix==="title1");return Ee?re(Ee,"two-row-top",J(oe,Ee,"two-row-top")):null},we=(U,oe=!1)=>{const Ee=Xn(e,U,A,v,k),pe=Ee.filter(Oe=>Oe.prefix==="title2"||Oe.prefix==="title3"),K=o&&oe;return pe.length>0||K||(h??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[pe.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[a.jsx("div",{className:`${e}-titles-stack`,children:pe.map(Oe=>re(Oe,"two-row-bottom",J(Ee,Oe,"two-row-bottom")))}),oe&&o?a.jsxs(a.Fragment,{children:[Se(),Pe()]}):null]}):null,(h??0)>0||K?a.jsx("div",{"data-controls":K?"titleRowMarginBottom":void 0,"data-controls-axis":K?"y":void 0,"data-controls-reverse":K?"":void 0,className:K?`${e}-control`:void 0,style:{height:$,width:"100%",flexShrink:0,pointerEvents:K?"auto":"none"}}):null]}):null},Ie=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:_.scalingValue(f??0,i),height:_.scalingValue(f??0,i),marginRight:R,"--close-icon-hover-color":H},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:U=>{U.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(an,{url:L??"",fill:S,hoverFill:i&&!r?S: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:R,height:"100%",pointerEvents:"auto"}})]}),ue=()=>ie?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:Ie()}):null,ge=U=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:U})}),ve=U=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[ie||le?Q():null,ae?z("two-row"):null,ge(U),ue()]}),q=(U,oe=!1)=>a.jsxs(a.Fragment,{children:[ve(Me(U)),we(U,oe)]}),de=()=>{const U=x?-1:P.findIndex(pe=>pe.prefix==="title1"),oe=!x&&(o||(p??0)>0)?(()=>{const pe=p??0,K=U>=0?O[U]:T.title1Width,Ve=Math.max(pe,qn);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(K),style:{position:"absolute",top:0,left:0,width:_.scalingValue(Ve,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Ee=P.flatMap((pe,K)=>{if(!pe.marginLeftKey)return[];const Ve=D[pe.marginLeftKey]??0,Oe=id(P,O,D,K)+Z(),lt=Math.max(Ve,qn);return a.jsx("div",{"data-controls":pe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(O[K]),style:{position:"absolute",top:0,left:_.scalingValue(Oe,i),width:_.scalingValue(lt,i),height:"100%",pointerEvents:"auto"}},pe.marginLeftKey)});return oe?[oe,...Ee]:Ee},he=()=>P.map((U,oe)=>{const Ee=ln(oe,O),K=Y(oe)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":U.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ee),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:_.scalingValue(K,i),width:_.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${U.widthKey}-junction`)}),Se=()=>E.flatMap((U,oe)=>{if(!U.marginLeftKey)return[];const Ee=D[U.marginLeftKey]??0,pe=ye(oe),K=Math.max(Ee,qn),{resolvedWidth:Ve}=F(U,"two-row-bottom");return a.jsx("div",{"data-controls":U.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ve),style:{position:"absolute",top:0,left:_.scalingValue(pe,i),width:_.scalingValue(K,i),height:"100%",pointerEvents:"auto"}},U.marginLeftKey)}),Pe=()=>E.map((U,oe)=>{const{maxWidth:Ee}=F(U,"two-row-bottom"),K=se(oe)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":U.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ee),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:_.scalingValue(K,i),width:_.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${U.widthKey}-junction`)}),Le=()=>!o||x?null:a.jsxs(a.Fragment,{children:[de(),he()]}),G=!!(t.title2||t.title3||(h??0)>0||o),fe=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[ie||le?Q():null,ae?z("single-row"):null,le?ge(te(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),ue(),Le()]}),ce=()=>a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...G?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:G?void 0:{flex:"0 0 auto",height:"auto"},children:q(t,!0)}),Le()]});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:I,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...x?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${x?` ${e}-lightbox-content-area-stacked`:""}`,children:a.jsx("div",{className:`${e}-text-bar-cell${x?` ${e}-text-bar-cell-stacked`:""}`,style:x?void 0:{flex:1,minWidth:0,width:"100%"},children:x?ce():fe()})})})]})}function Wh(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Nh(e){return`
6216
6216
  .${e}-wrapper {
6217
6217
  display: grid;
6218
6218
  align-items: start;
@@ -6532,7 +6532,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
6532
6532
  pointer-events: auto;
6533
6533
  flex-shrink: 0;
6534
6534
  }
6535
- `}const cl={url:"",name:"",objectFit:"cover"},Tn=500,ro=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",Hh=72,Oh=50,Dh=1e4,jh=650,Bh=500;function zh(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 ad(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=Tr(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 Vh(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?ad(i,n):null}function Gh(e){return e.reduce((t,n,i)=>{const o=Ss(n.gallery),l=$s(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 go(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 dl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return go(e,i,n)}const Uh=.03;function sd(e){return e.width*Uh}const sa={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function er(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function ul(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function qh(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Oa(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 Xh(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Oa(e,t.width,t.height)}function Kh(e,t){if(to(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 Yh(e){const t=new Set,n=[];for(const i of e){const o=Ss(i.gallery),r=$s(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 Zh({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=>to(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 zi(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=sd(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 Lr(e,t,n){const i=zi(e,t,n);return{...i,left:2*i.left-e.left}}function Jh(e,t,n){const{left:i,width:o}=n,r=sd(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 ld(e,t,n,i){const o=zi(e,"left",i),r=zi(e,"right",i),l=Lr(e,"left",i),d=Lr(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 Qh(e,t,n,i){const{start:o,end:r}=ld(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function ef(e,t,n){const i=zi(e,t,n),o=Lr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function cd(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 Ss(e){if(!e)return;if(cd(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??cl,i??o??cl]}]}function tf(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function nf(e){const[t]=e.media;return t!=null&&t.url?t:null}function $s(e){if(!Array.isArray(e)||e.length===0)return[];if(cd(e)){const t=[];for(const n of e){const i=tf(n);if(!i)continue;const o=nf(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 to(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function of({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return to(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 rf({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 tr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return to(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 af({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:w,sourceRect:b,resolveCloseSourceRect:h,onClose:g,onPrev:m,onNext:v}){const L=s.useRef(null),f=s.useRef(null),S=s.useRef(null),H=s.useRef(new Map),[P,R]=s.useState(0),$=s.useRef(null),x=s.useRef(0),A=s.useRef(0),y=s.useRef("none"),F=s.useRef(!1),T=s.useRef(!1),j=s.useRef(!1),E=s.useRef(null),B=s.useRef(null),O=s.useRef(null),z=s.useRef(()=>{}),ee=s.useRef(null),k=s.useRef(null),W=s.useRef(null),D=s.useRef(!1),[le,Y]=s.useState(null),[I,oe]=s.useState(sa),[N,ie]=s.useState(0),[Z,te]=s.useState("opening"),[Se,se]=s.useState(0),[ae,V]=s.useState(0),[J,Q]=s.useState(!1),[Me,be]=s.useState(null),[Ie,ue]=s.useState(null),[ge,ye]=s.useState(null),[q,de]=s.useState(!1),[he,we]=s.useState(null),[Pe,Le]=s.useState(!1),G=s.useRef(!1),[fe,ce]=s.useState(!1),[U,re]=s.useState(!1),Ee=s.useRef(n),pe=s.useRef(void 0),K=t[n],Ve=K?to(K):!1,Oe=ae!==0||J,lt=!l&&(!r||!!d),tt=c&&!l,ht=u.length>1,nt=s.useCallback((M,ve)=>t.length<=1?null:t[(M+ve+t.length)%t.length]??null,[t]),ze=ht?go(u,p,-1):nt(n,-1),xe=ht?go(u,p,1):nt(n,1),Ae=Me===-1&&Oe?ht&&Ie!==null?go(u,Ie,-1):ge!==null?nt(ge,-1):null:null,De=Me===1&&Oe?ht&&Ie!==null?go(u,Ie,1):ge!==null?nt(ge,1):null:null,Ue=Ae&&Ae.url!==(ze==null?void 0:ze.url)?Ae:null,Ce=De&&De.url!==(xe==null?void 0:xe.url)?De:null,Ne=ze&&tt?(()=>{const M=ht?dl(u,p,-1):t.length>2?nt((n-1+t.length)%t.length,-1):null;return M&&M.url!==ze.url?M:null})():null,Be=xe&&tt?(()=>{const M=ht?dl(u,p,1):t.length>2?nt((n+1)%t.length,1):null;return M&&M.url!==xe.url?M:null})():null,Ke=Ue??Ne,ct=Ce??Be,Je=s.useCallback((M,ve,Re)=>{if(!M||!ve||!Re)return;const ke=H.current,et=ke.get(M);(et==null?void 0:et.width)===ve&&(et==null?void 0:et.height)===Re||(ke.set(M,{width:ve,height:Re}),R(Pt=>Pt+1))},[]),$t=s.useCallback(M=>{if(!(M!=null&&M.url))return null;const ve=H.current.get(M.url);return Xh(f.current,ve)},[P,N]),dt=s.useCallback(()=>{if(!K)return;const M=$t(K);if(M){Y(M);return}const ve=f.current;ve&&Y(ul(ve))},[K,$t]),_e=s.useCallback(M=>{if(ht){const ve=u.length;ue((p+M+ve)%ve),ye(null);return}t.length>1&&(ye((n+M+t.length)%t.length),ue(null))},[ht,u.length,p,t.length,n]),Xe=s.useCallback(M=>{j.current=M,Q(M)},[]),je=s.useCallback(()=>{E.current!==null&&(window.clearTimeout(E.current),E.current=null)},[]),ut=s.useCallback(()=>{je(),E.current=window.setTimeout(()=>{je(),Xe(!1)},ro+32)},[je,Xe]),pt=s.useCallback(()=>{const M=L.current;if(!M){oe({left:0,top:0,width:typeof window<"u"?window.innerWidth:sa.width,height:typeof window<"u"?window.innerHeight:sa.height});return}const ve=M.getBoundingClientRect();oe({left:ve.left,top:ve.top,width:ve.width,height:ve.height})},[]),mt=s.useCallback((M,ve)=>{if(Oe){if(fe&&!J)return`translate(${ae}px, 0px)`;if(J&&Me!==null){const Re=$t(M);if(!Re)return;const{x:ke,y:et}=Qh(Re,ve,Me,I);return`translate(${ke}px, ${et}px)`}if(J)return"translate(0px, 0px)"}},[Oe,fe,J,ae,Me,I,$t]),kt=s.useCallback(()=>{const M=B.current;B.current=null,je(),Xe(!1),be(null),ue(null),ye(null),V(0),ce(!1),F.current=!1,A.current=0,y.current="none",M===-1?m():M===1&&v()},[je,Xe,m,v]),Kt=s.useCallback(()=>{je(),E.current=window.setTimeout(()=>{B.current!==null&&kt()},ro+32)},[je,kt]),Yt=s.useCallback(()=>{je(),B.current=null,Xe(!1),be(null),ue(null),ye(null),V(0),ce(!1),F.current=!1,A.current=0,y.current="none"},[je,Xe]),vt=s.useCallback(M=>{if(!(!tt||!le)){if(j.current){if(B.current===M){O.current=M,kt();return}Yt()}je(),_e(M),B.current=M,be(M),Xe(!0),Kt()}},[tt,le,kt,Yt,je,_e,Xe,Kt]);z.current=vt;const bt=s.useCallback(()=>{ee.current=null,D.current=!1,k.current!==null&&(window.clearInterval(k.current),k.current=null),W.current!==null&&(window.clearTimeout(W.current),W.current=null)},[]),Gt=s.useCallback(M=>{k.current!==null&&window.clearInterval(k.current);const ve=D.current?Bh:jh;k.current=window.setInterval(()=>{z.current(M)},ve)},[]),Ft=s.useCallback(M=>{ee.current!==M&&(bt(),ee.current=M,D.current=!1,z.current(M),Gt(M),W.current=window.setTimeout(()=>{W.current=null,ee.current===M&&(D.current=!0,Gt(M))},Dh))},[bt,Gt]),xt=s.useCallback(()=>{const M=f.current;if(!M)return;const ve=K==null?void 0:K.url,Re=ve?H.current.get(ve):void 0;if(Re!=null&&Re.width&&(Re!=null&&Re.height)){Y(Oa(M,Re.width,Re.height));return}const ke=S.current;if(ke&&ve&&(ke.src===ve||ke.currentSrc===ve)){const{width:Pt,height:Ye}=qh(ke);if(Pt&&Ye){Je(ve,Pt,Ye),Y(Oa(M,Pt,Ye));return}}const et=ul(M);!et.width||!et.height||Y(et)},[K==null?void 0:K.url,Je]),Ht=s.useCallback(M=>{if(S.current=M,!!M){if(M instanceof HTMLVideoElement){M.readyState>=1&&M.videoWidth>0&&xt();return}M.complete&&M.naturalWidth>0&&xt()}},[xt]),Ut=s.useCallback(()=>{pt(),xt(),ie(M=>M+1)},[pt,xt]);s.useEffect(()=>{Ut();const M=f.current,ve=L.current,Re=new ResizeObserver(()=>Ut());return M&&Re.observe(M),ve&&Re.observe(ve),window.addEventListener("resize",Ut),()=>{Re.disconnect(),window.removeEventListener("resize",Ut)}},[Ut,n,w]),s.useLayoutEffect(()=>{if(!K)return;const M=S.current;if(M){if(M instanceof HTMLImageElement&&M.complete&&M.naturalWidth>0){xt();return}M instanceof HTMLVideoElement&&M.readyState>=1&&M.videoWidth>0&&xt()}},[K==null?void 0:K.url,n,xt]),s.useEffect(()=>{dt()},[dt,P]),s.useEffect(()=>{const M=new Set,ve=[],Re=ke=>{!(ke!=null&&ke.url)||M.has(ke.url)||(M.add(ke.url),ve.push(ke))};t.forEach(Re),u.forEach(ke=>ke.items.forEach(Re)),ve.forEach(ke=>{H.current.has(ke.url)||Kh(ke,Je)})},[t,u,Je]),s.useEffect(()=>{if(Z!=="opening"||!le)return;if(!b){te("open");return}de(!1);const M=requestAnimationFrame(()=>{requestAnimationFrame(()=>{de(!0),te("open")})});return()=>cancelAnimationFrame(M)},[Z,le,b]),s.useEffect(()=>{if(Z!=="closing")return;const M=setTimeout(()=>g(),Tn);return()=>clearTimeout(M)},[Z,g]),s.useEffect(()=>()=>{je()},[je]),s.useLayoutEffect(()=>{Ee.current===n&&pe.current===(K==null?void 0:K.url)||(je(),B.current=null,be(null),ue(null),ye(null),se(0),V(0),Xe(!1),re(!1),ce(!1),x.current=0,A.current=0,y.current="none",F.current=!1,$.current=null,T.current=!1,S.current=null,dt(),Ee.current=n,pe.current=K==null?void 0:K.url)},[n,K==null?void 0:K.url,Xe,je,dt]),s.useLayoutEffect(()=>{const M=O.current;M!==null&&(O.current=null,requestAnimationFrame(()=>{z.current(M)}))},[n,p,K==null?void 0:K.url]),s.useLayoutEffect(()=>{if(Z==="opening"){G.current=!1,Le(!1);return}if(Z!=="open"||G.current)return;if(!ze&&!xe){G.current=!0;return}Le(!1);const M=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Le(!0),G.current=!0})});return()=>cancelAnimationFrame(M)},[Z,ze==null?void 0:ze.url,xe==null?void 0:xe.url]),s.useEffect(()=>{if(Z!=="open")return;const M=()=>{const Ye=ft=>{ft.stopPropagation(),ft.preventDefault(),document.removeEventListener("click",Ye,!0)};document.addEventListener("click",Ye,!0)},ve=Ye=>{const ft=Ye<0?1:-1;je(),_e(ft),B.current=ft,be(ft),Xe(!0),Kt()},Re=Ye=>{if(Math.abs(Ye)>Oh&&tt){ve(Ye);return}B.current=null,be(null),ue(null),ye(null),Xe(!0),V(0),ut()},ke=Ye=>{if(Ye.touches.length!==1||j.current)return;const ft=Ye.touches[0];T.current=!0,$.current={x:ft.clientX,y:ft.clientY},y.current="none",A.current=0,F.current=!1},et=Ye=>{if(!$.current||Ye.touches.length!==1||j.current)return;const ft=Ye.touches[0],Nt=ft.clientX-$.current.x,Tt=ft.clientY-$.current.y;if(y.current==="none"){if(Math.abs(Nt)<10&&Math.abs(Tt)<10)return;if(Math.abs(Nt)>Math.abs(Tt)){if(!tt)return;y.current="horizontal"}else if(Tt>0){if(!lt)return;y.current="vertical"}else return}if(y.current==="horizontal"){F.current=!0,ce(!0),A.current=Nt,V(Nt),Ye.preventDefault();return}y.current==="vertical"&&(F.current=!0,ce(!0),x.current=Tt,se(Tt),Ye.preventDefault())},Pt=()=>{if(!$.current)return;const Ye=y.current,ft=F.current;if(ft&&Ye==="horizontal")Re(A.current),M();else if(ft&&Ye==="vertical"){const Nt=x.current;if(lt&&Nt>Hh){const Tt=window.innerHeight;x.current=Tt,re(!0),se(Tt),te("closing")}else x.current=0,se(0);M()}else Ye==="horizontal"&&Math.abs(A.current)>0&&(Re(A.current),M());$.current=null,y.current="none",A.current=0,F.current=!1,ce(!1)};return document.addEventListener("touchstart",ke,{passive:!0}),document.addEventListener("touchmove",et,{passive:!1}),document.addEventListener("touchend",Pt),document.addEventListener("touchcancel",Pt),()=>{document.removeEventListener("touchstart",ke),document.removeEventListener("touchmove",et),document.removeEventListener("touchend",Pt),document.removeEventListener("touchcancel",Pt)}},[Z,tt,Xe,ut,je,lt,Kt,_e]);const Zt=s.useCallback(()=>{const M=(h==null?void 0:h())??b??null;M&&le&&(we(M),de(!0)),te("closing")},[h,b,le]);s.useEffect(()=>{const M=ke=>{if(ke.key==="Escape"){if(r&&d||Z==="closing")return;bt(),Zt();return}if(ke.key!=="ArrowLeft"&&ke.key!=="ArrowRight"||Z!=="open"||!tt)return;ke.preventDefault();const et=ke.key==="ArrowLeft"?-1:1;ke.repeat&&ee.current===et||Ft(et)},ve=ke=>{if(ke.key!=="ArrowLeft"&&ke.key!=="ArrowRight")return;const et=ke.key==="ArrowLeft"?-1:1;ee.current===et&&bt()},Re=()=>{bt()};return window.addEventListener("keydown",M),window.addEventListener("keyup",ve),window.addEventListener("blur",Re),()=>{window.removeEventListener("keydown",M),window.removeEventListener("keyup",ve),window.removeEventListener("blur",Re),bt()}},[Z,r,d,Zt,tt,Ft,bt]),s.useEffect(()=>{Z!=="open"&&bt()},[Z,bt]);const tn=()=>{Z==="closing"||l||Zt()},Ct=Z==="open",jt=Z==="closing",dn=Se>0?Math.max(0,1-Se/500):1,at=Se>0?Math.max(.35,1-Se/500):1,Te=s.useCallback(M=>{if(!(M.propertyName!=="transform"||!j.current)){if(B.current!==null){kt();return}je(),Xe(!1)}},[je,Xe,kt]),We=Z==="closing"?he??b:b,Qe=We&&le&&(Z==="opening"||jt)?zh(We,le):void 0,st=Oe&&K?mt(K,"center"):Se>0?`translateY(${Se}px)`:Qe,gt=le?er(le,I):null,Rt=!!(We&&le),ot=Rt&&(Z==="closing"||Z==="open"&&q),Ot={position:"absolute",top:gt==null?void 0:gt.top,left:gt==null?void 0:gt.left,width:gt==null?void 0:gt.width,height:gt==null?void 0:gt.height,objectFit:"contain",transformOrigin:"top left",transform:st,opacity:Se>0?at:Rt?1:Z==="opening"||jt?0:1,transition:fe&&!J?"none":J?`transform ${ro}ms ${pn}`:U?`transform ${Tn}ms ${pn}, opacity ${Tn}ms ${pn}`:ot?`transform ${Tn}ms ${pn}`:Z==="opening"||jt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:Ve&&Ct&&!Oe?"auto":"none",touchAction:Ve&&Ct?"none":void 0,zIndex:1,overflow:Ve?"hidden":void 0},Et={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ct&&!Oe?"auto":"none"},Mt=(M,ve,Re="adjacent")=>{const ke=$t(M);if(!ke)return{display:"none"};const et=Re==="far"?ve==="left"?"far-left":"far-right":ve==="left"?"left-adjacent":"right-adjacent",{start:Pt}=Me!==null?ld(ke,et,Me,I):{start:Re==="far"?Lr(ke,ve,I):zi(ke,ve,I)},Ye=er(Pt,I),ft=mt(M,et),Nt=!Oe&&Re==="adjacent"&&Ct&&!Pe?ef(ke,ve,I):null,Tt=Re==="far"&&Oe&&Me===(ve==="left"?-1:1),nn=fe&&!J?!1:J,un=Re==="adjacent"&&Ct&&Pe&&!Oe;return{position:"absolute",top:Ye.top,left:Ye.left,width:Ye.width,height:Ye.height,objectFit:"contain",transform:ft??(Nt?`translate(${Nt.x}px, ${Nt.y}px)`:void 0),opacity:Re==="far"?Ct&&Tt?1:0:Ct?1:0,transition:nn?Re==="far"?`transform ${ro}ms ${pn}`:`transform ${ro}ms ${pn}, opacity ${Tn}ms ${pn}`:un?`transform ${Tn}ms ${pn}`:Z==="opening"||jt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},Bt=(M,ve)=>{const Re=$t(M);return Re?Jh(zi(Re,ve,I),ve,I):null},zt=M=>ve=>{if(!l){if(T.current){T.current=!1;return}ve.stopPropagation(),vt(M)}},_t=ze?Bt(ze,"left"):null,Wt=xe?Bt(xe,"right"):null,At=_t?er(_t,I):null,wt=Wt?er(Wt,I):null;return a.jsxs("div",{ref:L,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:Z==="open"?"none":void 0},onClick:tn,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ct?dn:0,transition:fe?"none":`opacity ${Tn}ms ${pn}`,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:f,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Ct?1:0,transition:fe?"none":`opacity ${Tn}ms ${pn}`,pointerEvents:"none"},children:a.jsx(rd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:tn})})]}),Ct&&Ke&&a.jsx(tr,{media:Ke,style:Mt(Ke,"left","far"),onMeasure:Je,onTransitionEnd:Te},`far-prev-${Ke.url}`),Ct&&ze&&a.jsxs(a.Fragment,{children:[a.jsx(tr,{media:ze,style:Mt(ze,"left"),onMeasure:Je,onTransitionEnd:Te},`prev-${ze.url}`),At&&a.jsx("div",{style:{position:"absolute",top:At.top,left:At.left,width:At.width,height:At.height,cursor:l||fe?"default":"pointer",pointerEvents:l||fe?"none":"auto",zIndex:3},onClick:zt(-1)})]}),Ct&&xe&&a.jsxs(a.Fragment,{children:[a.jsx(tr,{media:xe,style:Mt(xe,"right"),onMeasure:Je,onTransitionEnd:Te},`next-${xe.url}`),wt&&a.jsx("div",{style:{position:"absolute",top:wt.top,left:wt.left,width:wt.width,height:wt.height,cursor:l||fe?"default":"pointer",pointerEvents:l||fe?"none":"auto",zIndex:3},onClick:zt(1)})]}),Ct&&ct&&a.jsx(tr,{media:ct,style:Mt(ct,"right","far"),onMeasure:Je,onTransitionEnd:Te},`far-next-${ct.url}`),le&&K&&(Ve?a.jsx(rf,{src:K.url,phase:Z,onMediaElement:Ht,wrapperStyle:Ot,videoStyle:Et,onLoadedMetadata:xt,onTransitionEnd:Te},`${n}-${K.url}`):a.jsx("img",{ref:Ht,src:K.url,alt:K.name,onLoad:xt,onTransitionEnd:Te,style:Ot},`${n}-${K.url}`))]})}function sf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=_.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:w}=e,b=(w==null?void 0:w.display)==="cover",h=(w==null?void 0:w.ratioValue)??"1:1",g=(w==null?void 0:w.reversed)??!1,[m,v]=h.split(":").map(Number),S=`${g?v:m} / ${g?m:v}`,H=c.entryWidth??.2,P=c.columnsCount,R=_.scalingValue(H,n),$=_.scalingValue(c.horizontalGap??0,n),x=R,A=R,y={width:x,...b?{aspectRatio:S,height:"auto",overflow:"hidden"}:{height:"auto"}},F=b?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},T=s.useRef(null),[j,E]=s.useState(!1),[B,O]=s.useState([]),[z,ee]=s.useState(0),[k,W]=s.useState(0),[D,le]=s.useState(null),[Y,I]=s.useState({title1:"",title2:"",title3:""}),oe=(()=>{const ge={},ye=T.current?getComputedStyle(T.current).getPropertyValue("--cntrl-article-width").trim():"";return ye&&(ge["--cntrl-article-width"]=ye),ge})(),N=!n||i||o,ie=s.useMemo(()=>Nh(d),[d]),Z=t??[],te=Z.length%P||P,Se=te<P&&Z.length>0,se=Z.length-te,ae=Se?Math.floor((P-te)/2)+1:1,V=s.useMemo(()=>Gh(Z),[Z]),J=s.useMemo(()=>Yh(Z),[Z]),Q=(ge,ye,q)=>{if(n&&!o&&!i)return;const de=V.findIndex(we=>we.gridIndex===ge);if(de<0)return;const he=V[de];W(de),O(he.items),ee(ye),I(he.entry),le(q??null),E(!0)},Me=s.useCallback(()=>{E(!1),le(null)},[]),be=s.useCallback(()=>{const ge=V[k];return!ge||!T.current?D:Vh(T.current,ge.gridIndex,b?"cover":"contain")??D},[V,k,D,b]),Ie=s.useCallback(ge=>{if(V.length>1){const ye=V.length,q=(k+ge+ye)%ye,de=V[q],he=Math.min(z,de.items.length-1);W(q),O(de.items),ee(he),I(de.entry);return}ee(ye=>(ye+ge+B.length)%B.length)},[V,k,z,B.length]),ue=V.length>1||B.length>1;return s.useEffect(()=>{if(!j||typeof document>"u")return;const ge=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ge}},[j]),s.useEffect(()=>{!n||o||i||E(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ie}}),a.jsx(Zh,{mediaList:J}),a.jsx("div",{ref:T,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${P}, ${R})`,rowGap:0,columnGap:$,width:_.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:_.scalingValue(u??0,n)},children:Z.map((ge,ye)=>{const q=Ss(ge.gallery),de=$s(q),he=de.filter(ce=>ce.lightboxMedia).map(ce=>ce.lightboxMedia),we=Math.floor(ye/P)===Math.ceil(Z.length/P)-1,Pe=Se&&ye>=se?`${ae+(ye-se)}`:void 0,Le=de[0],G=Le!=null&&Le.lightboxMedia?he.findIndex(ce=>ce.url===Le.lightboxMedia.url):-1,fe=a.jsx("div",{className:`${d}-item-image-wrapper`,style:y,children:de.length>0&&a.jsx(of,{media:Le.displayMedia,gridIndex:ye,className:`${d}-item-${to(Le.displayMedia)?"video":"image"}`.trim(),style:F,onMediaClick:N&&G>=0?ce=>Q(ye,G,ad(ce.currentTarget,b?"cover":"contain")):void 0})});return a.jsx("div",{className:`${d}-item`,children:a.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,we?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:R,...Pe?{gridColumn:Pe}:{}},children:[a.jsx("div",{className:`${d}-item-title-row`,children:a.jsx("div",{style:{height:0,width:A}})}),a.jsx("a",{className:`${d}-item-image-link`,children:fe}),a.jsx("div",{className:`${d}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:A}})})]})},ye)})}),j&&typeof document<"u"&&(()=>{const ge=(l?document.getElementById(l):null)??document.body;return Dn.createPortal(a.jsx("div",{style:oe,"data-selection":"none",children:a.jsx(af,{prefix:d,items:B,index:z,entry:Y,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ue,lightboxEntries:V,entryIdx:k,layoutId:r,sourceRect:D,resolveCloseSourceRect:be,onClose:Me,onPrev:()=>Ie(-1),onNext:()=>Ie(1)})}),ge)})()]})}const lf=`import { CommonComponentProps } from '../props';
6535
+ `}const cl={url:"",name:"",objectFit:"cover"},Tn=500,ro=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",Hh=72,Oh=50,Dh=1e4,jh=650,Bh=500;function zh(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 ad(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=Tr(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 Vh(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?ad(i,n):null}function Gh(e){return e.reduce((t,n,i)=>{const o=Ss(n.gallery),l=$s(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 go(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 dl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return go(e,i,n)}const Uh=.03;function sd(e){return e.width*Uh}const sa={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function er(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function ul(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function qh(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Oa(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 Xh(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Oa(e,t.width,t.height)}function Kh(e,t){if(to(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 Yh(e){const t=new Set,n=[];for(const i of e){const o=Ss(i.gallery),r=$s(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 Zh({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=>to(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 zi(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=sd(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 Lr(e,t,n){const i=zi(e,t,n);return{...i,left:2*i.left-e.left}}function Jh(e,t,n){const{left:i,width:o}=n,r=sd(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 ld(e,t,n,i){const o=zi(e,"left",i),r=zi(e,"right",i),l=Lr(e,"left",i),d=Lr(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 Qh(e,t,n,i){const{start:o,end:r}=ld(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function ef(e,t,n){const i=zi(e,t,n),o=Lr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function cd(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 Ss(e){if(!e)return;if(cd(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??cl,i??o??cl]}]}function tf(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function nf(e){const[t]=e.media;return t!=null&&t.url?t:null}function $s(e){if(!Array.isArray(e)||e.length===0)return[];if(cd(e)){const t=[];for(const n of e){const i=tf(n);if(!i)continue;const o=nf(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 to(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function of({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return to(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 rf({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 tr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return to(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 af({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:w,sourceRect:b,resolveCloseSourceRect:h,onClose:g,onPrev:m,onNext:y}){const L=s.useRef(null),f=s.useRef(null),S=s.useRef(null),H=s.useRef(new Map),[I,R]=s.useState(0),$=s.useRef(null),x=s.useRef(0),A=s.useRef(0),v=s.useRef("none"),k=s.useRef(!1),T=s.useRef(!1),D=s.useRef(!1),P=s.useRef(null),B=s.useRef(null),O=s.useRef(null),V=s.useRef(()=>{}),ee=s.useRef(null),E=s.useRef(null),N=s.useRef(null),j=s.useRef(!1),[le,ie]=s.useState(null),[W,ae]=s.useState(sa),[F,J]=s.useState(0),[Y,Z]=s.useState("opening"),[ye,se]=s.useState(0),[re,z]=s.useState(0),[Q,te]=s.useState(!1),[Me,we]=s.useState(null),[Ie,ue]=s.useState(null),[ge,ve]=s.useState(null),[q,de]=s.useState(!1),[he,Se]=s.useState(null),[Pe,Le]=s.useState(!1),G=s.useRef(!1),[fe,ce]=s.useState(!1),[U,oe]=s.useState(!1),Ee=s.useRef(n),pe=s.useRef(void 0),K=t[n],Ve=K?to(K):!1,Oe=re!==0||Q,lt=!l&&(!r||!!d),tt=c&&!l,ht=u.length>1,nt=s.useCallback((M,xe)=>t.length<=1?null:t[(M+xe+t.length)%t.length]??null,[t]),ze=ht?go(u,p,-1):nt(n,-1),be=ht?go(u,p,1):nt(n,1),Ae=Me===-1&&Oe?ht&&Ie!==null?go(u,Ie,-1):ge!==null?nt(ge,-1):null:null,De=Me===1&&Oe?ht&&Ie!==null?go(u,Ie,1):ge!==null?nt(ge,1):null:null,Ue=Ae&&Ae.url!==(ze==null?void 0:ze.url)?Ae:null,Ce=De&&De.url!==(be==null?void 0:be.url)?De:null,Ne=ze&&tt?(()=>{const M=ht?dl(u,p,-1):t.length>2?nt((n-1+t.length)%t.length,-1):null;return M&&M.url!==ze.url?M:null})():null,Be=be&&tt?(()=>{const M=ht?dl(u,p,1):t.length>2?nt((n+1)%t.length,1):null;return M&&M.url!==be.url?M:null})():null,Ke=Ue??Ne,ct=Ce??Be,Je=s.useCallback((M,xe,Re)=>{if(!M||!xe||!Re)return;const ke=H.current,et=ke.get(M);(et==null?void 0:et.width)===xe&&(et==null?void 0:et.height)===Re||(ke.set(M,{width:xe,height:Re}),R(Pt=>Pt+1))},[]),$t=s.useCallback(M=>{if(!(M!=null&&M.url))return null;const xe=H.current.get(M.url);return Xh(f.current,xe)},[I,F]),dt=s.useCallback(()=>{if(!K)return;const M=$t(K);if(M){ie(M);return}const xe=f.current;xe&&ie(ul(xe))},[K,$t]),_e=s.useCallback(M=>{if(ht){const xe=u.length;ue((p+M+xe)%xe),ve(null);return}t.length>1&&(ve((n+M+t.length)%t.length),ue(null))},[ht,u.length,p,t.length,n]),Xe=s.useCallback(M=>{D.current=M,te(M)},[]),je=s.useCallback(()=>{P.current!==null&&(window.clearTimeout(P.current),P.current=null)},[]),ut=s.useCallback(()=>{je(),P.current=window.setTimeout(()=>{je(),Xe(!1)},ro+32)},[je,Xe]),pt=s.useCallback(()=>{const M=L.current;if(!M){ae({left:0,top:0,width:typeof window<"u"?window.innerWidth:sa.width,height:typeof window<"u"?window.innerHeight:sa.height});return}const xe=M.getBoundingClientRect();ae({left:xe.left,top:xe.top,width:xe.width,height:xe.height})},[]),mt=s.useCallback((M,xe)=>{if(Oe){if(fe&&!Q)return`translate(${re}px, 0px)`;if(Q&&Me!==null){const Re=$t(M);if(!Re)return;const{x:ke,y:et}=Qh(Re,xe,Me,W);return`translate(${ke}px, ${et}px)`}if(Q)return"translate(0px, 0px)"}},[Oe,fe,Q,re,Me,W,$t]),kt=s.useCallback(()=>{const M=B.current;B.current=null,je(),Xe(!1),we(null),ue(null),ve(null),z(0),ce(!1),k.current=!1,A.current=0,v.current="none",M===-1?m():M===1&&y()},[je,Xe,m,y]),Kt=s.useCallback(()=>{je(),P.current=window.setTimeout(()=>{B.current!==null&&kt()},ro+32)},[je,kt]),Yt=s.useCallback(()=>{je(),B.current=null,Xe(!1),we(null),ue(null),ve(null),z(0),ce(!1),k.current=!1,A.current=0,v.current="none"},[je,Xe]),vt=s.useCallback(M=>{if(!(!tt||!le)){if(D.current){if(B.current===M){O.current=M,kt();return}Yt()}je(),_e(M),B.current=M,we(M),Xe(!0),Kt()}},[tt,le,kt,Yt,je,_e,Xe,Kt]);V.current=vt;const bt=s.useCallback(()=>{ee.current=null,j.current=!1,E.current!==null&&(window.clearInterval(E.current),E.current=null),N.current!==null&&(window.clearTimeout(N.current),N.current=null)},[]),Gt=s.useCallback(M=>{E.current!==null&&window.clearInterval(E.current);const xe=j.current?Bh:jh;E.current=window.setInterval(()=>{V.current(M)},xe)},[]),Ft=s.useCallback(M=>{ee.current!==M&&(bt(),ee.current=M,j.current=!1,V.current(M),Gt(M),N.current=window.setTimeout(()=>{N.current=null,ee.current===M&&(j.current=!0,Gt(M))},Dh))},[bt,Gt]),xt=s.useCallback(()=>{const M=f.current;if(!M)return;const xe=K==null?void 0:K.url,Re=xe?H.current.get(xe):void 0;if(Re!=null&&Re.width&&(Re!=null&&Re.height)){ie(Oa(M,Re.width,Re.height));return}const ke=S.current;if(ke&&xe&&(ke.src===xe||ke.currentSrc===xe)){const{width:Pt,height:Ye}=qh(ke);if(Pt&&Ye){Je(xe,Pt,Ye),ie(Oa(M,Pt,Ye));return}}const et=ul(M);!et.width||!et.height||ie(et)},[K==null?void 0:K.url,Je]),Ht=s.useCallback(M=>{if(S.current=M,!!M){if(M instanceof HTMLVideoElement){M.readyState>=1&&M.videoWidth>0&&xt();return}M.complete&&M.naturalWidth>0&&xt()}},[xt]),Ut=s.useCallback(()=>{pt(),xt(),J(M=>M+1)},[pt,xt]);s.useEffect(()=>{Ut();const M=f.current,xe=L.current,Re=new ResizeObserver(()=>Ut());return M&&Re.observe(M),xe&&Re.observe(xe),window.addEventListener("resize",Ut),()=>{Re.disconnect(),window.removeEventListener("resize",Ut)}},[Ut,n,w]),s.useLayoutEffect(()=>{if(!K)return;const M=S.current;if(M){if(M instanceof HTMLImageElement&&M.complete&&M.naturalWidth>0){xt();return}M instanceof HTMLVideoElement&&M.readyState>=1&&M.videoWidth>0&&xt()}},[K==null?void 0:K.url,n,xt]),s.useEffect(()=>{dt()},[dt,I]),s.useEffect(()=>{const M=new Set,xe=[],Re=ke=>{!(ke!=null&&ke.url)||M.has(ke.url)||(M.add(ke.url),xe.push(ke))};t.forEach(Re),u.forEach(ke=>ke.items.forEach(Re)),xe.forEach(ke=>{H.current.has(ke.url)||Kh(ke,Je)})},[t,u,Je]),s.useEffect(()=>{if(Y!=="opening"||!le)return;if(!b){Z("open");return}de(!1);const M=requestAnimationFrame(()=>{requestAnimationFrame(()=>{de(!0),Z("open")})});return()=>cancelAnimationFrame(M)},[Y,le,b]),s.useEffect(()=>{if(Y!=="closing")return;const M=setTimeout(()=>g(),Tn);return()=>clearTimeout(M)},[Y,g]),s.useEffect(()=>()=>{je()},[je]),s.useLayoutEffect(()=>{Ee.current===n&&pe.current===(K==null?void 0:K.url)||(je(),B.current=null,we(null),ue(null),ve(null),se(0),z(0),Xe(!1),oe(!1),ce(!1),x.current=0,A.current=0,v.current="none",k.current=!1,$.current=null,T.current=!1,S.current=null,dt(),Ee.current=n,pe.current=K==null?void 0:K.url)},[n,K==null?void 0:K.url,Xe,je,dt]),s.useLayoutEffect(()=>{const M=O.current;M!==null&&(O.current=null,requestAnimationFrame(()=>{V.current(M)}))},[n,p,K==null?void 0:K.url]),s.useLayoutEffect(()=>{if(Y==="opening"){G.current=!1,Le(!1);return}if(Y!=="open"||G.current)return;if(!ze&&!be){G.current=!0;return}Le(!1);const M=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Le(!0),G.current=!0})});return()=>cancelAnimationFrame(M)},[Y,ze==null?void 0:ze.url,be==null?void 0:be.url]),s.useEffect(()=>{if(Y!=="open")return;const M=()=>{const Ye=ft=>{ft.stopPropagation(),ft.preventDefault(),document.removeEventListener("click",Ye,!0)};document.addEventListener("click",Ye,!0)},xe=Ye=>{const ft=Ye<0?1:-1;je(),_e(ft),B.current=ft,we(ft),Xe(!0),Kt()},Re=Ye=>{if(Math.abs(Ye)>Oh&&tt){xe(Ye);return}B.current=null,we(null),ue(null),ve(null),Xe(!0),z(0),ut()},ke=Ye=>{if(Ye.touches.length!==1||D.current)return;const ft=Ye.touches[0];T.current=!0,$.current={x:ft.clientX,y:ft.clientY},v.current="none",A.current=0,k.current=!1},et=Ye=>{if(!$.current||Ye.touches.length!==1||D.current)return;const ft=Ye.touches[0],Nt=ft.clientX-$.current.x,Tt=ft.clientY-$.current.y;if(v.current==="none"){if(Math.abs(Nt)<10&&Math.abs(Tt)<10)return;if(Math.abs(Nt)>Math.abs(Tt)){if(!tt)return;v.current="horizontal"}else if(Tt>0){if(!lt)return;v.current="vertical"}else return}if(v.current==="horizontal"){k.current=!0,ce(!0),A.current=Nt,z(Nt),Ye.preventDefault();return}v.current==="vertical"&&(k.current=!0,ce(!0),x.current=Tt,se(Tt),Ye.preventDefault())},Pt=()=>{if(!$.current)return;const Ye=v.current,ft=k.current;if(ft&&Ye==="horizontal")Re(A.current),M();else if(ft&&Ye==="vertical"){const Nt=x.current;if(lt&&Nt>Hh){const Tt=window.innerHeight;x.current=Tt,oe(!0),se(Tt),Z("closing")}else x.current=0,se(0);M()}else Ye==="horizontal"&&Math.abs(A.current)>0&&(Re(A.current),M());$.current=null,v.current="none",A.current=0,k.current=!1,ce(!1)};return document.addEventListener("touchstart",ke,{passive:!0}),document.addEventListener("touchmove",et,{passive:!1}),document.addEventListener("touchend",Pt),document.addEventListener("touchcancel",Pt),()=>{document.removeEventListener("touchstart",ke),document.removeEventListener("touchmove",et),document.removeEventListener("touchend",Pt),document.removeEventListener("touchcancel",Pt)}},[Y,tt,Xe,ut,je,lt,Kt,_e]);const Zt=s.useCallback(()=>{const M=(h==null?void 0:h())??b??null;M&&le&&(Se(M),de(!0)),Z("closing")},[h,b,le]);s.useEffect(()=>{const M=ke=>{if(ke.key==="Escape"){if(r&&d||Y==="closing")return;bt(),Zt();return}if(ke.key!=="ArrowLeft"&&ke.key!=="ArrowRight"||Y!=="open"||!tt)return;ke.preventDefault();const et=ke.key==="ArrowLeft"?-1:1;ke.repeat&&ee.current===et||Ft(et)},xe=ke=>{if(ke.key!=="ArrowLeft"&&ke.key!=="ArrowRight")return;const et=ke.key==="ArrowLeft"?-1:1;ee.current===et&&bt()},Re=()=>{bt()};return window.addEventListener("keydown",M),window.addEventListener("keyup",xe),window.addEventListener("blur",Re),()=>{window.removeEventListener("keydown",M),window.removeEventListener("keyup",xe),window.removeEventListener("blur",Re),bt()}},[Y,r,d,Zt,tt,Ft,bt]),s.useEffect(()=>{Y!=="open"&&bt()},[Y,bt]);const tn=()=>{Y==="closing"||l||Zt()},Ct=Y==="open",jt=Y==="closing",dn=ye>0?Math.max(0,1-ye/500):1,at=ye>0?Math.max(.35,1-ye/500):1,Te=s.useCallback(M=>{if(!(M.propertyName!=="transform"||!D.current)){if(B.current!==null){kt();return}je(),Xe(!1)}},[je,Xe,kt]),We=Y==="closing"?he??b:b,Qe=We&&le&&(Y==="opening"||jt)?zh(We,le):void 0,st=Oe&&K?mt(K,"center"):ye>0?`translateY(${ye}px)`:Qe,gt=le?er(le,W):null,Rt=!!(We&&le),ot=Rt&&(Y==="closing"||Y==="open"&&q),Ot={position:"absolute",top:gt==null?void 0:gt.top,left:gt==null?void 0:gt.left,width:gt==null?void 0:gt.width,height:gt==null?void 0:gt.height,objectFit:"contain",transformOrigin:"top left",transform:st,opacity:ye>0?at:Rt?1:Y==="opening"||jt?0:1,transition:fe&&!Q?"none":Q?`transform ${ro}ms ${pn}`:U?`transform ${Tn}ms ${pn}, opacity ${Tn}ms ${pn}`:ot?`transform ${Tn}ms ${pn}`:Y==="opening"||jt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:Ve&&Ct&&!Oe?"auto":"none",touchAction:Ve&&Ct?"none":void 0,zIndex:1,overflow:Ve?"hidden":void 0},Et={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ct&&!Oe?"auto":"none"},Mt=(M,xe,Re="adjacent")=>{const ke=$t(M);if(!ke)return{display:"none"};const et=Re==="far"?xe==="left"?"far-left":"far-right":xe==="left"?"left-adjacent":"right-adjacent",{start:Pt}=Me!==null?ld(ke,et,Me,W):{start:Re==="far"?Lr(ke,xe,W):zi(ke,xe,W)},Ye=er(Pt,W),ft=mt(M,et),Nt=!Oe&&Re==="adjacent"&&Ct&&!Pe?ef(ke,xe,W):null,Tt=Re==="far"&&Oe&&Me===(xe==="left"?-1:1),nn=fe&&!Q?!1:Q,un=Re==="adjacent"&&Ct&&Pe&&!Oe;return{position:"absolute",top:Ye.top,left:Ye.left,width:Ye.width,height:Ye.height,objectFit:"contain",transform:ft??(Nt?`translate(${Nt.x}px, ${Nt.y}px)`:void 0),opacity:Re==="far"?Ct&&Tt?1:0:Ct?1:0,transition:nn?Re==="far"?`transform ${ro}ms ${pn}`:`transform ${ro}ms ${pn}, opacity ${Tn}ms ${pn}`:un?`transform ${Tn}ms ${pn}`:Y==="opening"||jt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},Bt=(M,xe)=>{const Re=$t(M);return Re?Jh(zi(Re,xe,W),xe,W):null},zt=M=>xe=>{if(!l){if(T.current){T.current=!1;return}xe.stopPropagation(),vt(M)}},_t=ze?Bt(ze,"left"):null,Wt=be?Bt(be,"right"):null,At=_t?er(_t,W):null,wt=Wt?er(Wt,W):null;return a.jsxs("div",{ref:L,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:Y==="open"?"none":void 0},onClick:tn,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ct?dn:0,transition:fe?"none":`opacity ${Tn}ms ${pn}`,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:f,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Ct?1:0,transition:fe?"none":`opacity ${Tn}ms ${pn}`,pointerEvents:"none"},children:a.jsx(rd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:tn})})]}),Ct&&Ke&&a.jsx(tr,{media:Ke,style:Mt(Ke,"left","far"),onMeasure:Je,onTransitionEnd:Te},`far-prev-${Ke.url}`),Ct&&ze&&a.jsxs(a.Fragment,{children:[a.jsx(tr,{media:ze,style:Mt(ze,"left"),onMeasure:Je,onTransitionEnd:Te},`prev-${ze.url}`),At&&a.jsx("div",{style:{position:"absolute",top:At.top,left:At.left,width:At.width,height:At.height,cursor:l||fe?"default":"pointer",pointerEvents:l||fe?"none":"auto",zIndex:3},onClick:zt(-1)})]}),Ct&&be&&a.jsxs(a.Fragment,{children:[a.jsx(tr,{media:be,style:Mt(be,"right"),onMeasure:Je,onTransitionEnd:Te},`next-${be.url}`),wt&&a.jsx("div",{style:{position:"absolute",top:wt.top,left:wt.left,width:wt.width,height:wt.height,cursor:l||fe?"default":"pointer",pointerEvents:l||fe?"none":"auto",zIndex:3},onClick:zt(1)})]}),Ct&&ct&&a.jsx(tr,{media:ct,style:Mt(ct,"right","far"),onMeasure:Je,onTransitionEnd:Te},`far-next-${ct.url}`),le&&K&&(Ve?a.jsx(rf,{src:K.url,phase:Y,onMediaElement:Ht,wrapperStyle:Ot,videoStyle:Et,onLoadedMetadata:xt,onTransitionEnd:Te},`${n}-${K.url}`):a.jsx("img",{ref:Ht,src:K.url,alt:K.name,onLoad:xt,onTransitionEnd:Te,style:Ot},`${n}-${K.url}`))]})}function sf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=_.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:w}=e,b=(w==null?void 0:w.display)==="cover",h=(w==null?void 0:w.ratioValue)??"1:1",g=(w==null?void 0:w.reversed)??!1,[m,y]=h.split(":").map(Number),S=`${g?y:m} / ${g?m:y}`,H=c.entryWidth??.2,I=c.columnsCount,R=_.scalingValue(H,n),$=_.scalingValue(c.horizontalGap??0,n),x=R,A=R,v={width:x,...b?{aspectRatio:S,height:"auto",overflow:"hidden"}:{height:"auto"}},k=b?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},T=s.useRef(null),[D,P]=s.useState(!1),[B,O]=s.useState([]),[V,ee]=s.useState(0),[E,N]=s.useState(0),[j,le]=s.useState(null),[ie,W]=s.useState({title1:"",title2:"",title3:""}),ae=(()=>{const ge={},ve=T.current?getComputedStyle(T.current).getPropertyValue("--cntrl-article-width").trim():"";return ve&&(ge["--cntrl-article-width"]=ve),ge})(),F=!n||i||o,J=s.useMemo(()=>Nh(d),[d]),Y=t??[],Z=Y.length%I||I,ye=Z<I&&Y.length>0,se=Y.length-Z,re=ye?Math.floor((I-Z)/2)+1:1,z=s.useMemo(()=>Gh(Y),[Y]),Q=s.useMemo(()=>Yh(Y),[Y]),te=(ge,ve,q)=>{if(n&&!o&&!i)return;const de=z.findIndex(Se=>Se.gridIndex===ge);if(de<0)return;const he=z[de];N(de),O(he.items),ee(ve),W(he.entry),le(q??null),P(!0)},Me=s.useCallback(()=>{P(!1),le(null)},[]),we=s.useCallback(()=>{const ge=z[E];return!ge||!T.current?j:Vh(T.current,ge.gridIndex,b?"cover":"contain")??j},[z,E,j,b]),Ie=s.useCallback(ge=>{if(z.length>1){const ve=z.length,q=(E+ge+ve)%ve,de=z[q],he=Math.min(V,de.items.length-1);N(q),O(de.items),ee(he),W(de.entry);return}ee(ve=>(ve+ge+B.length)%B.length)},[z,E,V,B.length]),ue=z.length>1||B.length>1;return s.useEffect(()=>{if(!D||typeof document>"u")return;const ge=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ge}},[D]),s.useEffect(()=>{!n||o||i||P(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:J}}),a.jsx(Zh,{mediaList:Q}),a.jsx("div",{ref:T,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${I}, ${R})`,rowGap:0,columnGap:$,width:_.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:_.scalingValue(u??0,n)},children:Y.map((ge,ve)=>{const q=Ss(ge.gallery),de=$s(q),he=de.filter(ce=>ce.lightboxMedia).map(ce=>ce.lightboxMedia),Se=Math.floor(ve/I)===Math.ceil(Y.length/I)-1,Pe=ye&&ve>=se?`${re+(ve-se)}`:void 0,Le=de[0],G=Le!=null&&Le.lightboxMedia?he.findIndex(ce=>ce.url===Le.lightboxMedia.url):-1,fe=a.jsx("div",{className:`${d}-item-image-wrapper`,style:v,children:de.length>0&&a.jsx(of,{media:Le.displayMedia,gridIndex:ve,className:`${d}-item-${to(Le.displayMedia)?"video":"image"}`.trim(),style:k,onMediaClick:F&&G>=0?ce=>te(ve,G,ad(ce.currentTarget,b?"cover":"contain")):void 0})});return a.jsx("div",{className:`${d}-item`,children:a.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,Se?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:R,...Pe?{gridColumn:Pe}:{}},children:[a.jsx("div",{className:`${d}-item-title-row`,children:a.jsx("div",{style:{height:0,width:A}})}),a.jsx("a",{className:`${d}-item-image-link`,children:fe}),a.jsx("div",{className:`${d}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:A}})})]})},ve)})}),D&&typeof document<"u"&&(()=>{const ge=(l?document.getElementById(l):null)??document.body;return Dn.createPortal(a.jsx("div",{style:ae,"data-selection":"none",children:a.jsx(af,{prefix:d,items:B,index:V,entry:ie,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ue,lightboxEntries:z,entryIdx:E,layoutId:r,sourceRect:j,resolveCloseSourceRect:we,onClose:Me,onPrev:()=>Ie(-1),onNext:()=>Ie(1)})}),ge)})()]})}const lf=`import { CommonComponentProps } from '../props';
6536
6536
  import { scalingValue, useScopedStyles } from '../utils/index';
6537
6537
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
6538
6538
  import { createPortal } from 'react-dom';
@@ -8875,7 +8875,7 @@ export function Hive({
8875
8875
  </>
8876
8876
  );
8877
8877
  }
8878
- `,cf="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>'),si={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 df(e){const t={};return t[Ze(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ze(e,"fontSettings")]={...si.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ze(e,"fontSize")]={...si.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ze(e,"lineHeight")]={...si.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ze(e,"letterSpacing")]={...si.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ze(e,"wordSpacing")]={...si.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ze(e,"textAlign")]={...si.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ze(e,"textAppearance")]={...si.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Vi=Jn.filter(e=>e!=="count"),uf=Vi.reduce((e,t)=>({...e,...df(t)}),{}),pf=Vi.reduce((e,t)=>({...e,[Ze(t,"fontFamily")]:"Arial",[Ze(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ze(t,"letterSpacing")]:0,[Ze(t,"wordSpacing")]:0,[Ze(t,"textAlign")]:"left",[Ze(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function la(e){return Vi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ze(n,"fontSize")]=i),o!==void 0&&(t[Ze(n,"lineHeight")]=o),t},{})}const mf={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Vi.map(e=>[bs[e],ws(e)]))},gf={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},hf=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...gf,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),ff={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{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"}},gallery:{type:"array",label:"Gallery",max:1,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"]}}}}}}}},required:["gallery"]},default:hf},settings:{sizing:"auto auto",properties:{gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:9999,display:{type:"numeric-input"}},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gutter",min:0}}}},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},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"}}},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"]}},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"}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",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:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}},...uf},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:cf,closeIconColor:"#000000",closeIconHoverColor:"#999999",...pf},layoutDefaults:{m:{gridLayout:{entryWidth:.37837,horizontalGap:.081,wrapperWidth:1,columnsCount:2,lockedParam:"wrapperWidth"},verticalGap:.081,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,...la({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{gridLayout:{entryWidth:.10416,horizontalGap:.013,wrapperWidth:1,columnsCount:8,lockedParam:"wrapperWidth"},verticalGap:.013,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.039,iconMarginRight:.026,...la({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})},d:{gridLayout:{entryWidth:.06944,horizontalGap:.006944,wrapperWidth:1,columnsCount:12,lockedParam:"wrapperWidth"},verticalGap:.00694,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,...la({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})}},displayRules:[{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","gridLayout","verticalGap","align","imageDisplay","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","contentMarginTop","closeIconMaxWidth","iconMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["verticalGap"]},{type:"row",title:"",items:["imageDisplay","align"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[mf]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},yf={element:sf,id:"hive",name:"Catalogue",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/hive.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...Vi.map(e=>({path:`${Ze(e,"fontFamily")}`}))]},fontRelations:{...Vi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ze(t,"fontFamily")}`}),{})},schema:ff,sourceCode:lf};function vf(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)}function xf({media:e,className:t,style:n}){const i=s.useRef(null);return s.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const r=o.play();r&&r.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?a.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:t,src:e.url,alt:"",style:n})}function ca(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function bf(e){return String(e??"").trim().length>0}function pl(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY-i.top>i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function ml(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY<i.top+i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function gl(e,t,n,i,o,r,l){const d=_.scalingValue(r,l),c=_.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!p||i?d:c}}function wf(e,t,n){const i=_.scalingValue(t,n),o=_.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const hl=10,fl=10,ao={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function Sf(e,t,n){return Math.max(t,Math.min(n,e))}function da(e,t,n){return e+(t-e)*n}function $f(e,t,n,i){if(!t)return{x:0,y:0};const o=t.offsetWidth,l=t.offsetHeight/2;if(e==="cursor"&&n){const d=t.getBoundingClientRect();return{x:n.clientX-d.left+hl,y:n.clientY-d.top+hl}}switch(e){case"left":return{x:fl+i/2,y:l};case"center":return{x:o/2,y:l};case"right":return{x:o-fl-i/2,y:l};default:return{x:o/2,y:l}}}function Cf(e,t){const n=s.useRef(null),i=s.useRef({x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1}),o=s.useRef(null),r=s.useCallback(()=>{const h=n.current,g=i.current;h&&(h.style.transform=`translate3d(${g.x}px, ${g.y}px, 0) translate(-50%, -50%) rotate(${g.rotation.toFixed(3)}deg)`)},[]),l=s.useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},[]),d=s.useCallback(()=>{const h=i.current;t?(h.x=da(h.x,h.targetX,ao.positionEase),h.y=da(h.y,h.targetY,ao.positionEase),h.rotation=da(h.rotation,h.targetRotation,ao.rotationEase)):(h.x=h.targetX,h.y=h.targetY,h.rotation=h.targetRotation),r();const g=Math.abs(h.x-h.targetX)<.4&&Math.abs(h.y-h.targetY)<.4,m=Math.abs(h.rotation-h.targetRotation)<.08;!g||!m?o.current=requestAnimationFrame(d):o.current=null},[r,t]),c=s.useCallback(()=>{o.current===null&&(o.current=requestAnimationFrame(d))},[d]),u=s.useCallback((h,g)=>{const m=i.current;m.targetX=h,m.targetY=g,m.targetRotation=0,m.x=h,m.y=g,m.rotation=0,m.lastX=h,m.hasLastX=!0,r(),t&&c()},[r,t,c]),p=s.useCallback((h,g)=>{if(!e)return;const m=i.current;if(t&&m.hasLastX){const v=h-m.lastX;m.targetRotation=Sf(v*ao.rotationFactor,-20,ao.maxRotation)}else m.targetRotation=0;if(m.lastX=h,m.hasLastX=!0,m.targetX=h,m.targetY=g,t){c();return}m.x=h,m.y=g,m.rotation=m.targetRotation,r()},[e,r,t,c]),w=s.useCallback(h=>{l(),i.current.hasLastX=!1,h==null||h()},[l]),b=s.useCallback(()=>{l(),i.current={x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1},n.current&&(n.current.style.transform="")},[l]);return s.useEffect(()=>(e||b(),l),[e,b,l]),{anchorRef:n,onShow:u,onCursorMove:p,exit:w,reset:b}}function Tf(e){return`
8878
+ `,cf="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>'),si={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 df(e){const t={};return t[Ze(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ze(e,"fontSettings")]={...si.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ze(e,"fontSize")]={...si.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ze(e,"lineHeight")]={...si.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ze(e,"letterSpacing")]={...si.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ze(e,"wordSpacing")]={...si.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ze(e,"textAlign")]={...si.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ze(e,"textAppearance")]={...si.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Vi=Jn.filter(e=>e!=="count"),uf=Vi.reduce((e,t)=>({...e,...df(t)}),{}),pf=Vi.reduce((e,t)=>({...e,[Ze(t,"fontFamily")]:"Arial",[Ze(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ze(t,"letterSpacing")]:0,[Ze(t,"wordSpacing")]:0,[Ze(t,"textAlign")]:"left",[Ze(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function la(e){return Vi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ze(n,"fontSize")]=i),o!==void 0&&(t[Ze(n,"lineHeight")]=o),t},{})}const mf={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Vi.map(e=>[bs[e],ws(e)]))},gf={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},hf=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...gf,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),ff={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{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"}},gallery:{type:"array",label:"Gallery",max:1,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"]}}}}}}}},required:["gallery"]},default:hf},settings:{sizing:"auto auto",properties:{gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:9999,display:{type:"numeric-input"}},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gutter",min:0}}}},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},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"}}},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"]}},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"}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",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:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}},...uf},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:cf,closeIconColor:"#000000",closeIconHoverColor:"#999999",...pf},layoutDefaults:{m:{gridLayout:{entryWidth:.37837,horizontalGap:.081,wrapperWidth:1,columnsCount:2,lockedParam:"wrapperWidth"},verticalGap:.081,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,...la({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{gridLayout:{entryWidth:.10416,horizontalGap:.013,wrapperWidth:1,columnsCount:8,lockedParam:"wrapperWidth"},verticalGap:.013,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.039,iconMarginRight:.026,...la({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})},d:{gridLayout:{entryWidth:.06944,horizontalGap:.006944,wrapperWidth:1,columnsCount:12,lockedParam:"wrapperWidth"},verticalGap:.00694,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,...la({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})}},displayRules:[{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","gridLayout","verticalGap","align","imageDisplay","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","contentMarginTop","closeIconMaxWidth","iconMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["verticalGap"]},{type:"row",title:"",items:["imageDisplay","align"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[mf]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},yf={element:sf,id:"hive",name:"Catalogue",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/hive.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...Vi.map(e=>({path:`${Ze(e,"fontFamily")}`}))]},fontRelations:{...Vi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ze(t,"fontFamily")}`}),{})},schema:ff,sourceCode:lf};function vf(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)}function xf({media:e,className:t,style:n}){const i=s.useRef(null);return s.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const r=o.play();r&&r.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?a.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:t,src:e.url,alt:"",style:n})}function ca(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function bf(e){return String(e??"").trim().length>0}function pl(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY-i.top>i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function ml(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY<i.top+i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function gl(e,t,n,i,o,r,l){const d=_.scalingValue(r,l),c=_.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!p||i?d:c}}function wf(e,t,n){const i=_.scalingValue(t,n),o=_.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const hl=10,fl=10,ao={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function Sf(e,t,n){return Math.max(t,Math.min(n,e))}function da(e,t,n){return e+(t-e)*n}function $f(e,t,n,i){if(!t)return{x:0,y:0};const o=t.offsetWidth,l=t.offsetHeight/2;if(e==="cursor"&&n){const d=t.getBoundingClientRect();return{x:n.clientX-d.left+hl,y:n.clientY-d.top+hl}}switch(e){case"left":return{x:fl+i/2,y:l};case"center":return{x:o/2,y:l};case"right":return{x:o-fl-i/2,y:l};default:return{x:o/2,y:l}}}function Cf(e,t){const n=s.useRef(null),i=s.useRef({x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1}),o=s.useRef(null),r=s.useCallback(()=>{const h=n.current,g=i.current;h&&(h.style.transform=`translate3d(${g.x}px, ${g.y}px, 0) translate(-50%, -50%) rotate(${g.rotation.toFixed(3)}deg)`)},[]),l=s.useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},[]),d=s.useCallback(()=>{const h=i.current;t?(h.x=da(h.x,h.targetX,ao.positionEase),h.y=da(h.y,h.targetY,ao.positionEase),h.rotation=da(h.rotation,h.targetRotation,ao.rotationEase)):(h.x=h.targetX,h.y=h.targetY,h.rotation=h.targetRotation),r();const g=Math.abs(h.x-h.targetX)<.4&&Math.abs(h.y-h.targetY)<.4,m=Math.abs(h.rotation-h.targetRotation)<.08;!g||!m?o.current=requestAnimationFrame(d):o.current=null},[r,t]),c=s.useCallback(()=>{o.current===null&&(o.current=requestAnimationFrame(d))},[d]),u=s.useCallback((h,g)=>{const m=i.current;m.targetX=h,m.targetY=g,m.targetRotation=0,m.x=h,m.y=g,m.rotation=0,m.lastX=h,m.hasLastX=!0,r(),t&&c()},[r,t,c]),p=s.useCallback((h,g)=>{if(!e)return;const m=i.current;if(t&&m.hasLastX){const y=h-m.lastX;m.targetRotation=Sf(y*ao.rotationFactor,-20,ao.maxRotation)}else m.targetRotation=0;if(m.lastX=h,m.hasLastX=!0,m.targetX=h,m.targetY=g,t){c();return}m.x=h,m.y=g,m.rotation=m.targetRotation,r()},[e,r,t,c]),w=s.useCallback(h=>{l(),i.current.hasLastX=!1,h==null||h()},[l]),b=s.useCallback(()=>{l(),i.current={x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1},n.current&&(n.current.style.transform="")},[l]);return s.useEffect(()=>(e||b(),l),[e,b,l]),{anchorRef:n,onShow:u,onCursorMove:p,exit:w,reset:b}}function Tf(e){return`
8879
8879
  .${e}-wrapper {
8880
8880
  display: grid;
8881
8881
  align-items: start;
@@ -9251,7 +9251,7 @@ a.${e}-list-item {
9251
9251
  overflow-wrap: anywhere;
9252
9252
  word-break: break-word;
9253
9253
  }
9254
- `}const Qn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Cs=["AColumn","BColumn","CColumn","DColumn","EColumn"],Wn="cutLabel",Po=[...Cs,Wn],zr=["A","B","C","D","E"];function dd(e){return`${e}ColumnVerticalAlign`}const Da=["Top","Center","Bottom"];function Ts(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return zr.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Lf(e){const t=Ts(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Rf(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return zr.includes(n)?n:null}function ud(e,t,n){const i=Rf(e);return i?i===t?!1:Lf(n[dd(i)]):!0}function Mo(e){const t=Ts(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return zr.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function If(e,t,n){if(pd(e,t,n))return Mo(e);const i=Mo(e);return i.kind==="baseline"?{kind:"top"}:i}function Pf(e){const t=Mo(e);return t.kind==="baseline"?{kind:"top"}:t}function pd(e,t,n){return ud(e,n,t)?Mo(e).kind==="baseline":!1}function Mf(e){const t={};let n=!1;for(const i of zr){const o=dd(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}ud(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Ef(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function kf(e){const t=Mo(e).kind;return t==="baseline"?"center":t}function Af(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 Ff(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 ua(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=Ff(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 _f(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 Wf(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Nf={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function It(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Hf={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function Of(e){return[It(e,"textFontFamily"),It(e,"textFontSettings"),{type:"row",items:[It(e,"textFontSize"),It(e,"textLineHeight"),It(e,"textLetterSpacing"),It(e,"textWordSpacing")]},It(e,"textTextAlign"),It(e,"textTextAppearance"),`${e}VerticalAlign`]}function Df(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Po.map(e=>[Hf[e],Of(e)]))}}function Rr(e,t){const n=i=>{const o=It(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===Wn?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function vl(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 rn(qt(n,t))}function xl(e,t,n,i){const o=Rr(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function bl(e,t,n,i){const o=Rr(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:_.scalingValue((r-l)/2,i)}}const vn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Gi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Ui=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],qi=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],jf={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Bf=["hover","focus","filled","success","error"],wl=.004,Ei=.004,pa=Ei,Ls=50,Eo=1440,ko=Ls/Eo;function md(e){const t=typeof e=="number"&&e>0?e:Eo;return Ls/t}function zf(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 Eo}const gd={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function xo(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Vf(e,t=1){const n=t/e;return Object.fromEntries(vn.map(i=>[i,n]))}function Gf(){return Object.fromEntries([...Gi.map(e=>[e,0]),...Ui.map(e=>[e,0])])}function Uf(){return Object.fromEntries(qi.map(e=>[e,0]))}function nr(e){return Object.fromEntries(vn.map(t=>[t,typeof e[t]=="number"?e[t]:gd[t]]))}function hd(e,t,n){const i=e-ko,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=Rs(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 qf(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=Gi[o],l=Ui[o],d=typeof n[r]=="number"?n[r]:0,c=typeof n[l]=="number"?n[l]:0,u=hd(t[o]??0,d,c);u.paddingLeft!==d&&(i[r]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function Rs(e,t,n){if(e<=0)return[];const i=vn.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)+ko;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]-ko;if(p<=0)continue;const w=Math.min(c,p);d[u]-=w,c-=w}return[...d,i[e-1]]}function Xf(e,t,n){if(e<=1)return{};const i=Rs(e,t,n),o={};for(let r=0;r<e-1;r+=1){const l=vn[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function Sl(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Qn]}function Kf(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Yf(e,t,n,i){const o=Math.min(i,e.length,vn.length),r={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=vn[c],p=Gi[c],w=Ui[c],b=qi[c],h=vn[l],g=Gi[l],m=Ui[l],v=qi[l],L=n[u],f=n[p],S=n[w],H=n[b];typeof L=="number"&&(r[h]=L),typeof f=="number"&&(r[g]=f),typeof S=="number"&&(r[m]=S),typeof H=="number"&&(r[v]=H)}return r}function fd(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 Zf(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=xo(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...Vf(n,o),...Gf()};if(r)for(const d of qi)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,Uf());return fd(e,l)?l:e}function Jf(e,t,n){const i=Mf(e);i&&(e={...e,...i});const o=md(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,d=xo(e),c=xo(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:Qn.length,w=S=>{if(u)return S;const H=nr({...t,...S}),P=xo(S),R=fr(p,P,H),$=qf(p,R,{...t,...S});return Object.keys($).length===0?S:{...S,...$}};if(typeof r=="number"&&r!==l)return e;const b=Sl(e),h=Sl(t);if(!Kf(b,h))return w({...e,...Yf(b,h,t,p)});if(d<c&&typeof p=="number"&&!u){const S=nr({...t,...e});return w({...e,...Xf(p,d,S)})}if(u){const S=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,H=Math.max(0,(d-o)/2);return S>H?{...e,textPaddingLR:H}:e}const g=nr({...t,...e}),m=fr(p,c,nr(t)),L=fr(p,d,g).some((S,H)=>S<(m[H]??S)),f=vn.some(S=>{const H=e[S],P=t[S];return typeof H=="number"&&typeof P=="number"&&H!==P});return L||f?w(e):e}function Qf(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(ko,i-o-r-ko)}function ey(e,t){return Math.random()*(t-e)+e}function ty(e){return Object.fromEntries(vn.map(t=>[t,typeof e[t]=="number"?e[t]:gd[t]]))}function ma(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function ny(e,t,n,i,o,r){return e.slice(0,t).map((l,d)=>{const c=Gi[d],u=Ui[d],p=qi[d];return{key:l,textPrefix:Nf[l],widthKey:vn[d],width:n[vn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:r[p]}})}function iy({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,onUpdateSettings:d}){const{prefix:c}=_.useScopedStyles(),u=!!o,{columns:p,type:w,wrapperWidth:b,entriesCount:h,cellMinHeight:g,dividerWidth:m,showVisibility:v,cut:L,showCut:f,cutCellMinHeight:S,cutLabel:H,imageSize:P,imageOnHover:R,imagePosition:$="cursor",imageInterpolation:x="on",entryHoverEffect:A,entryHoverShowOption:y,rowPaddingTop:F,rowPaddingBottom:T,rowPaddingTopB:j,columnsOrder:E,textPaddingLR:B,textColor:O,backgroundColor:z,dividerColor:ee,textHoverColor:k,backgroundHoverColor:W,dividerHoverColor:D}=e,[le,Y]=s.useState(void 0),[I,oe]=s.useState(null),N=s.useRef(null),ie=R==="on"&&(!n||i),Z=$==="cursor",te=Z&&x==="on",{anchorRef:Se,onShow:se,onCursorMove:ae,exit:V}=Cf(!!(ie&&I!==null),te),J=(L??0)>0,Q=w==="b",Me=s.useRef(null),be=s.useRef(null),[Ie,ue]=s.useState(null),[ge,ye]=s.useState(Eo),q=md(ge),de=Math.max(0,((b??0)-q)/2),he=Math.min(B??0,de),we=Math.max(he,Ei),Pe=((b??0)+q)/2;s.useLayoutEffect(()=>{if(!n){ye(Eo);return}const Te=()=>{ye(zf(Me.current))};Te();const We=Me.current;if(!We)return;const Qe=new ResizeObserver(Te);Qe.observe(We);let st=We;for(;st&&!st.style.getPropertyValue("--cntrl-article-width");)st=st.parentElement;return st&&Qe.observe(st),()=>Qe.disconnect()},[n,l]),s.useEffect(()=>{Y(void 0)},[L,f,t,h]),s.useEffect(()=>{n&&!i&&Y(void 0)},[n,i]);const Le=_.buildColorVars(c,{textColor:O,backgroundColor:z,dividerColor:ee,textHoverColor:k,backgroundHoverColor:W,dividerHoverColor:D},jf,Bf),G=r&&r!=="default"?`${c}-state-${r}`:"",ce=`${!n||i?A==="default"?`${c}-entry-hover-default`:A==="blinds"?`${c}-entry-hover-blinds`:A==="reveal"?`${c}-entry-hover-reveal`:"":""} ${G}`.trim(),U=A==="reveal"&&(!n||i),re=(v==null?void 0:v[0])??!1,Ee=(v==null?void 0:v[1])??!1,pe=s.useRef(e),K=s.useRef(l);s.useEffect(()=>{if(!d||!n){pe.current=e,K.current=l;return}if(K.current!==l){pe.current=e,K.current=l;return}const Te=pe.current;if(!(Te!==e))return;if(typeof Te.columns=="number"&&typeof e.columns=="number"&&Te.columns!==e.columns){pe.current=e;return}const Qe=Jf(e,Te,{designWidth:ge});pe.current=e,fd(e,Qe)&&d(Qe)},[e,d,n,l,ge]);const Ve=s.useMemo(()=>ty(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Oe=s.useMemo(()=>ma(e,Gi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),lt=s.useMemo(()=>ma(e,Ui),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),tt=s.useMemo(()=>ma(e,qi),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),ht=s.useMemo(()=>Array.isArray(E)&&E.length>0?E:[...Qn],[E]),nt=s.useMemo(()=>ny(ht,p,Ve,Oe,lt,tt),[ht,p,Ve,Oe,lt,tt]),ze=xo(e),xe=s.useMemo(()=>vn.slice(0,p).map(Te=>Ve[Te]),[p,Ve]),Ae=s.useMemo(()=>Rs(p,ze,Ve),[p,ze,Ve]),De=s.useMemo(()=>fr(p,ze,Ve),[p,ze,Ve]),Ue=s.useMemo(()=>nt.map((Te,We)=>hd(De[We]??0,Te.paddingLeft,Te.paddingRight)),[nt,De]),Ce=s.useMemo(()=>{const Te=h===0?1/0:h;return(t??[]).slice(0,Te).map((Qe,st)=>({id:st,cells:Object.fromEntries(Qn.map(gt=>[gt,Qe[gt]??""])),image:Qe.image,link:Qe.link}))},[t,h]),Ne=J?le??L:Ce.length,Be=s.useMemo(()=>J?Ce.slice(0,Ne):Ce,[Ce,J,Ne]),Ke=J&&Ne<Ce.length,ct=Be.length>1||Ke,Je=[re?`${c}-divider-top`:"",Ee||ct?`${c}-divider-bottom`:""].filter(Boolean).join(" "),$t=!n||i,dt=()=>{if(!$t)return;const Te=le??L;if(!f){Y(Ce.length);return}Y(Math.min(Te+f,Ce.length))},_e=Te=>_.scalingValue(Te,n??!1),Xe=Q?j??0:F??0,je=T??0,ut=g??0,pt=Math.max(je,pa),mt=gl(0,Be.length,re,Ee,Ke,m??0,n??!1).borderTopWidth,kt=Q?"rowPaddingTopB":"rowPaddingTop",Kt=nt[0],Yt=nt[nt.length-1],vt=Ue[0],bt=Ue[Ue.length-1],Gt=Kt&&vt?Math.max(vt.paddingLeft,Ei):0,Ft=Yt&&bt?Math.max(bt.paddingRight,Ei):0,xt=ze,Ht=(Te,We)=>$f($,Me.current,Z?Te:null,We),Ut=(Te,We)=>{if(!ie)return;const Qe=Te.image;if(!(Qe!=null&&Qe.url)){V(()=>oe(null));return}const st=(P==null?void 0:P.min)??80,gt=(P==null?void 0:P.max)??320,Rt=(I==null?void 0:I.rowId)===Te.id,ot=Rt?I.widthPx:ey(st,gt),{x:Ot,y:Et}=Ht(We,ot);if(Rt&&Z){ae(Ot,Et);return}oe({rowId:Te.id,url:Qe.url,objectFit:"contain",isVideo:vf(Qe),widthPx:ot}),N.current={x:Ot,y:Et}},Zt=Te=>{if(!ie||!I||!Z)return;const{x:We,y:Qe}=Ht(Te,I.widthPx);ae(We,Qe)},tn=()=>{I&&V(()=>oe(null))},Ct=Te=>{U&&pl(Te,c),!(!ie||!I)&&V(()=>oe(null))},jt=Te=>{U&&ml(Te,c)};s.useLayoutEffect(()=>{if(!I||!N.current)return;const{x:Te,y:We}=N.current;N.current=null,se(Te,We)},[I==null?void 0:I.rowId,I==null?void 0:I.url,se]),s.useLayoutEffect(()=>{if(!u||Q){ue(null);return}const Te=be.current,We=Te==null?void 0:Te.parentElement;if(!Te||!We){ue(null);return}const Qe=()=>{const gt=Te.querySelector("[data-list-row]");if(!gt){ue(null);return}const Rt=We.getBoundingClientRect(),ot=gt.getBoundingClientRect();ue(ot.top-Rt.top+ot.height/2)};Qe();const st=new ResizeObserver(Qe);return st.observe(Te),st.observe(We),()=>st.disconnect()},[u,Q,Be,Xe,je,ut,t,e,nt,De,ge,m,re,Ee,Ke]);const dn=s.useMemo(()=>!Q&&Cs.some(Te=>{const We=Te.charAt(0),Qe=e[`${Te}VerticalAlign`];return pd(Qe,e,We)}),[Q,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var Ot;const Te=Me.current;if(!Te)return;const We=()=>{Te.querySelectorAll("[data-list-col]").forEach(Et=>{Et.style.transform="";const Mt=Et.querySelector(`.${c}-list-col`);Mt&&(Mt.style.minHeight="",Mt.style.height="");const Bt=Et.querySelector(`.${c}-list-col-title`);Bt&&(Bt.style.transform="")})};if(Q||!dn){We();return}const Qe=()=>{const Et=Array.from(Te.querySelectorAll("[data-list-row]")),Mt=`${c}-list-col`,Bt=`${c}-baseline-probe`;Et.forEach(zt=>{zt.querySelectorAll("[data-list-col]").forEach(_t=>{_t.style.transform="";const Wt=_t.querySelector(`.${Mt}`);Wt&&(Wt.style.minHeight="",Wt.style.height="");const At=_t.querySelector(`.${c}-list-col-title`);At&&(At.style.transform="")})}),Et.forEach(zt=>{const _t=Array.from(zt.querySelectorAll("[data-list-col]"));_f(zt,_t,Mt)}),Te.offsetHeight,Et.forEach(zt=>{const _t=Array.from(zt.querySelectorAll("[data-list-col]")),Wt=zt.getBoundingClientRect().top,At=new Map,wt=_t.map(Re=>{const ke=Re.querySelector(`.${c}-list-col-title`),et={el:Re,titleEl:ke,letter:Re.getAttribute("data-col-letter")??"",kind:Re.getAttribute("data-valign")??"top",anchor:Re.getAttribute("data-valign-anchor")};return At.set(et.letter,et),et}),M=new Map,ve=(Re,ke)=>{const et=M.get(Re.letter);if(et!==void 0)return et;const Pt=Re.anchor?At.get(Re.anchor):void 0;if(Re.kind!=="baseline"||!Pt||ke.has(Re.letter)){const nn=ua(Re,Wt,Mt,Bt);return M.set(Re.letter,nn),nn}ke.add(Re.letter);const Ye=ve(Pt,ke);ke.delete(Re.letter);const ft=ua(Re,Wt,Mt,Bt),Nt=Ye-ft;Wf(Re.titleEl,Nt);const Tt=ua(Re,Wt,Mt,Bt);return M.set(Re.letter,Tt),Tt};wt.forEach(Re=>ve(Re,new Set))})};let st=null;const gt=()=>{st===null&&(st=requestAnimationFrame(()=>{st=null,Qe()}))};Qe();const Rt=new ResizeObserver(()=>gt());Rt.observe(Te);let ot=!1;return typeof document<"u"&&((Ot=document.fonts)!=null&&Ot.ready)&&document.fonts.ready.then(()=>{ot||gt()}),()=>{ot=!0,st!==null&&(cancelAnimationFrame(st),st=null),Rt.disconnect(),We()}},[dn,Q,e,t,ge,Be,De]);const at=s.useMemo(()=>Tf(c),[c]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:at}}),a.jsx("div",{style:Le,children:a.jsxs("div",{ref:Me,className:`${c}-wrapper ${ce}${Je?` ${Je}`:""}${Q?` ${c}-type-b`:""}`.trim(),style:{width:_.scalingValue(b??0,n)},onMouseMove:ie?Zt:void 0,onMouseLeave:ie?tn:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[Be.map((Te,We)=>{var Rt;const Qe=(((Rt=Te.link)==null?void 0:Rt.length)??0)>0,st=Qe&&(!n||i)?"a":"div",gt=gl(We,Be.length,re,Ee,Ke,m??0,n??!1);return a.jsxs(st,{ref:We===0?ot=>{be.current=ot}:void 0,className:`${c}-list-item${Qe||y==="always"?` ${c}-list-item-has-link`:""}${Ke&&We===Be.length-1?` ${c}-list-item-before-cut`:""}`,...Qe?{href:Te.link,target:"_blank"}:{},style:gt,onMouseEnter:ot=>{U&&(Qe||y==="always")&&pl(ot,c),ie&&Ut(Te,ot)},onMouseLeave:ot=>{U&&(Qe||y==="always")&&ml(ot,c)},children:[Xe>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:_e(Xe)}}),a.jsxs("div",{className:`${c}-list-cols-row${Q?"":` ${c}-list-cols-row-h`}${u&&We===0&&Q?` ${c}-list-cols-row-controls`:""}`,...Q?{}:{"data-list-row":""},style:Q?void 0:{minHeight:_e(ut)},children:[nt.map((ot,Ot)=>{const Et=Ot===nt.length-1,Mt=Ue[Ot],Bt=ot.paddingBottom,zt=bf(Te.cells[ot.key]),_t=Q&&zt&&Bt>0,Wt=Q?{minHeight:_e(ut)}:{width:_e(De[Ot])},At=Q?{paddingLeft:_e(he),paddingRight:_e(he)}:{paddingLeft:_e(Mt.paddingLeft),paddingRight:_e(Mt.paddingRight)},wt=ot.textPrefix.charAt(0),M=Q?Pf(e[`${ot.textPrefix}VerticalAlign`]):If(e[`${ot.textPrefix}VerticalAlign`],e,wt),ve=Q&&zt&&u&&We===0;return Q&&!zt?null:a.jsxs("div",{className:Q?`${c}-list-col-wrap`:void 0,...Q?{}:{"data-list-col":"","data-col-letter":wt,"data-valign":M.kind,...M.kind==="baseline"?{"data-valign-anchor":M.anchorLetter}:{}},children:[a.jsx("div",{className:`${c}-list-col${Et?` ${c}-list-col-last`:""}`,style:{...At,...Wt,...Q?{justifyContent:yl(M.kind)}:{}},"data-test":ot.width,children:a.jsx("span",{className:xl(e,ot.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...vl(Rr(e,ot.textPrefix),n),...bl(e,ot.textPrefix,c,n),...Q?{}:Ef(M.kind)},children:Te.cells[ot.key]??null})}),_t&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:_e(Bt)}}),ve&&a.jsx("div",{"data-controls":ot.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:_e(Math.max(Bt,pa))}})]},ot.key)}),u&&We===0&&Q&&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(Pe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:_e(we),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(Pe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:_e(Math.max(we,ze-we)),width:_e(we),height:"100%"}})]})]}),!Q&&je>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:_e(je)}}),u&&We===0&&!Q&&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:_e(pt)}})]},Te.id)}),u&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":kt,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":Q?"center":"left-y",className:`${c}-control-anchor`,style:{top:mt,left:0,width:"100%",height:_e(Math.max(Xe,pa))}})},"row-padding-handles"),u&&!Q&&Kt&&Yt&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Kt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(De[0]-((vt==null?void 0:vt.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Ie??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:_e(Gt),height:"100%"}}),a.jsx("div",{"data-controls":Yt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(De[nt.length-1]-((bt==null?void 0:bt.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Ie??void 0,className:`${c}-control-anchor`,style:{top:0,left:_e(xt-Ft),width:_e(Ft),height:"100%"}})]},"column-edge-padding-handles"),u&&!Q&&nt.slice(0,-1).map((Te,We)=>{const Qe=nt[We+1],st=Ae.slice(0,We+1).reduce((Et,Mt)=>Et+Mt,0),gt=Ue[We],Rt=Ue[We+1],ot=Math.max(gt.paddingRight,Ei),Ot=Math.max(Rt.paddingLeft,Ei);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Te.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(De[We]-gt.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Ie??void 0,className:`${c}-control-anchor`,style:{top:0,left:_e(st-ot),width:_e(ot),height:"100%"}}),a.jsx("div",{"data-controls":Qe.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(De[We+1]-Rt.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Ie??void 0,className:`${c}-control-anchor`,style:{top:0,left:_e(st),width:_e(Ot),height:"100%"}})]},`${Te.paddingRightKey}-padding`)}),u&&!Q&&nt.slice(0,-1).map((Te,We)=>{const Qe=Qf(We,Ae,xe,ze),gt=Ae.slice(0,We+1).reduce((Rt,ot)=>Rt+ot,0)-wl/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Te.widthKey,"data-controls-axis":"x","data-controls-min":String(Ls),"data-controls-max-fraction":String(Qe),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:_e(gt),width:_e(wl),height:"calc(100%)",pointerEvents:"auto"}})},`${Te.widthKey}-junction`)})]}),Ke&&(()=>{const Te=Rr(e,Wn),We=kf(e.cutLabelVerticalAlign),Qe=Te.textTextAlign==="justify"||Q;return a.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:_e(S??0),cursor:$t?"pointer":"default",...wf(Ee,m??0,n??!1)},onClick:$t?dt:void 0,onMouseEnter:U||ie?Ct:void 0,onMouseLeave:U?jt:void 0,children:a.jsx("div",{className:`${c}-list-cols-row`,style:{...Q?{paddingLeft:_e(he),paddingRight:_e(he)}:{},justifyContent:Af(Te.textTextAlign),alignItems:yl(We)},children:a.jsx("span",{className:xl(e,Wn,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...vl(Te,n),...bl(e,Wn,c,n),...Qe?{width:"100%"}:{}},children:H})})})})(),ie&&I&&(()=>{const Te=`${I.widthPx}px`,We={width:Te,height:"auto",maxHeight:Te,objectFit:"contain"};return a.jsx("div",{ref:Se,className:`${c}-hover-media-anchor`,children:a.jsx(xf,{media:I,className:I.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:We},`${I.rowId}-${I.url}`)})})()]})})]})}const oy=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
9254
+ `}const Qn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Cs=["AColumn","BColumn","CColumn","DColumn","EColumn"],Wn="cutLabel",Po=[...Cs,Wn],zr=["A","B","C","D","E"];function dd(e){return`${e}ColumnVerticalAlign`}const Da=["Top","Center","Bottom"];function Ts(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return zr.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Lf(e){const t=Ts(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Rf(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return zr.includes(n)?n:null}function ud(e,t,n){const i=Rf(e);return i?i===t?!1:Lf(n[dd(i)]):!0}function Mo(e){const t=Ts(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return zr.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function If(e,t,n){if(pd(e,t,n))return Mo(e);const i=Mo(e);return i.kind==="baseline"?{kind:"top"}:i}function Pf(e){const t=Mo(e);return t.kind==="baseline"?{kind:"top"}:t}function pd(e,t,n){return ud(e,n,t)?Mo(e).kind==="baseline":!1}function Mf(e){const t={};let n=!1;for(const i of zr){const o=dd(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}ud(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Ef(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function kf(e){const t=Mo(e).kind;return t==="baseline"?"center":t}function Af(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 Ff(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 ua(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=Ff(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 _f(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 Wf(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Nf={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function It(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Hf={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function Of(e){return[It(e,"textFontFamily"),It(e,"textFontSettings"),{type:"row",items:[It(e,"textFontSize"),It(e,"textLineHeight"),It(e,"textLetterSpacing"),It(e,"textWordSpacing")]},It(e,"textTextAlign"),It(e,"textTextAppearance"),`${e}VerticalAlign`]}function Df(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Po.map(e=>[Hf[e],Of(e)]))}}function Rr(e,t){const n=i=>{const o=It(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===Wn?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function vl(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 rn(qt(n,t))}function xl(e,t,n,i){const o=Rr(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function bl(e,t,n,i){const o=Rr(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:_.scalingValue((r-l)/2,i)}}const vn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Gi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Ui=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],qi=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],jf={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Bf=["hover","focus","filled","success","error"],wl=.004,Ei=.004,pa=Ei,Ls=50,Eo=1440,ko=Ls/Eo;function md(e){const t=typeof e=="number"&&e>0?e:Eo;return Ls/t}function zf(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 Eo}const gd={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function xo(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Vf(e,t=1){const n=t/e;return Object.fromEntries(vn.map(i=>[i,n]))}function Gf(){return Object.fromEntries([...Gi.map(e=>[e,0]),...Ui.map(e=>[e,0])])}function Uf(){return Object.fromEntries(qi.map(e=>[e,0]))}function nr(e){return Object.fromEntries(vn.map(t=>[t,typeof e[t]=="number"?e[t]:gd[t]]))}function hd(e,t,n){const i=e-ko,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=Rs(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 qf(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=Gi[o],l=Ui[o],d=typeof n[r]=="number"?n[r]:0,c=typeof n[l]=="number"?n[l]:0,u=hd(t[o]??0,d,c);u.paddingLeft!==d&&(i[r]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function Rs(e,t,n){if(e<=0)return[];const i=vn.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)+ko;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]-ko;if(p<=0)continue;const w=Math.min(c,p);d[u]-=w,c-=w}return[...d,i[e-1]]}function Xf(e,t,n){if(e<=1)return{};const i=Rs(e,t,n),o={};for(let r=0;r<e-1;r+=1){const l=vn[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function Sl(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Qn]}function Kf(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Yf(e,t,n,i){const o=Math.min(i,e.length,vn.length),r={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=vn[c],p=Gi[c],w=Ui[c],b=qi[c],h=vn[l],g=Gi[l],m=Ui[l],y=qi[l],L=n[u],f=n[p],S=n[w],H=n[b];typeof L=="number"&&(r[h]=L),typeof f=="number"&&(r[g]=f),typeof S=="number"&&(r[m]=S),typeof H=="number"&&(r[y]=H)}return r}function fd(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 Zf(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=xo(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...Vf(n,o),...Gf()};if(r)for(const d of qi)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,Uf());return fd(e,l)?l:e}function Jf(e,t,n){const i=Mf(e);i&&(e={...e,...i});const o=md(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,d=xo(e),c=xo(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:Qn.length,w=S=>{if(u)return S;const H=nr({...t,...S}),I=xo(S),R=fr(p,I,H),$=qf(p,R,{...t,...S});return Object.keys($).length===0?S:{...S,...$}};if(typeof r=="number"&&r!==l)return e;const b=Sl(e),h=Sl(t);if(!Kf(b,h))return w({...e,...Yf(b,h,t,p)});if(d<c&&typeof p=="number"&&!u){const S=nr({...t,...e});return w({...e,...Xf(p,d,S)})}if(u){const S=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,H=Math.max(0,(d-o)/2);return S>H?{...e,textPaddingLR:H}:e}const g=nr({...t,...e}),m=fr(p,c,nr(t)),L=fr(p,d,g).some((S,H)=>S<(m[H]??S)),f=vn.some(S=>{const H=e[S],I=t[S];return typeof H=="number"&&typeof I=="number"&&H!==I});return L||f?w(e):e}function Qf(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(ko,i-o-r-ko)}function ey(e,t){return Math.random()*(t-e)+e}function ty(e){return Object.fromEntries(vn.map(t=>[t,typeof e[t]=="number"?e[t]:gd[t]]))}function ma(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function ny(e,t,n,i,o,r){return e.slice(0,t).map((l,d)=>{const c=Gi[d],u=Ui[d],p=qi[d];return{key:l,textPrefix:Nf[l],widthKey:vn[d],width:n[vn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:r[p]}})}function iy({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,onUpdateSettings:d}){const{prefix:c}=_.useScopedStyles(),u=!!o,{columns:p,type:w,wrapperWidth:b,entriesCount:h,cellMinHeight:g,dividerWidth:m,showVisibility:y,cut:L,showCut:f,cutCellMinHeight:S,cutLabel:H,imageSize:I,imageOnHover:R,imagePosition:$="cursor",imageInterpolation:x="on",entryHoverEffect:A,entryHoverShowOption:v,rowPaddingTop:k,rowPaddingBottom:T,rowPaddingTopB:D,columnsOrder:P,textPaddingLR:B,textColor:O,backgroundColor:V,dividerColor:ee,textHoverColor:E,backgroundHoverColor:N,dividerHoverColor:j}=e,[le,ie]=s.useState(void 0),[W,ae]=s.useState(null),F=s.useRef(null),J=R==="on"&&(!n||i),Y=$==="cursor",Z=Y&&x==="on",{anchorRef:ye,onShow:se,onCursorMove:re,exit:z}=Cf(!!(J&&W!==null),Z),Q=(L??0)>0,te=w==="b",Me=s.useRef(null),we=s.useRef(null),[Ie,ue]=s.useState(null),[ge,ve]=s.useState(Eo),q=md(ge),de=Math.max(0,((b??0)-q)/2),he=Math.min(B??0,de),Se=Math.max(he,Ei),Pe=((b??0)+q)/2;s.useLayoutEffect(()=>{if(!n){ve(Eo);return}const Te=()=>{ve(zf(Me.current))};Te();const We=Me.current;if(!We)return;const Qe=new ResizeObserver(Te);Qe.observe(We);let st=We;for(;st&&!st.style.getPropertyValue("--cntrl-article-width");)st=st.parentElement;return st&&Qe.observe(st),()=>Qe.disconnect()},[n,l]),s.useEffect(()=>{ie(void 0)},[L,f,t,h]),s.useEffect(()=>{n&&!i&&ie(void 0)},[n,i]);const Le=_.buildColorVars(c,{textColor:O,backgroundColor:V,dividerColor:ee,textHoverColor:E,backgroundHoverColor:N,dividerHoverColor:j},jf,Bf),G=r&&r!=="default"?`${c}-state-${r}`:"",ce=`${!n||i?A==="default"?`${c}-entry-hover-default`:A==="blinds"?`${c}-entry-hover-blinds`:A==="reveal"?`${c}-entry-hover-reveal`:"":""} ${G}`.trim(),U=A==="reveal"&&(!n||i),oe=(y==null?void 0:y[0])??!1,Ee=(y==null?void 0:y[1])??!1,pe=s.useRef(e),K=s.useRef(l);s.useEffect(()=>{if(!d||!n){pe.current=e,K.current=l;return}if(K.current!==l){pe.current=e,K.current=l;return}const Te=pe.current;if(!(Te!==e))return;if(typeof Te.columns=="number"&&typeof e.columns=="number"&&Te.columns!==e.columns){pe.current=e;return}const Qe=Jf(e,Te,{designWidth:ge});pe.current=e,fd(e,Qe)&&d(Qe)},[e,d,n,l,ge]);const Ve=s.useMemo(()=>ty(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Oe=s.useMemo(()=>ma(e,Gi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),lt=s.useMemo(()=>ma(e,Ui),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),tt=s.useMemo(()=>ma(e,qi),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),ht=s.useMemo(()=>Array.isArray(P)&&P.length>0?P:[...Qn],[P]),nt=s.useMemo(()=>ny(ht,p,Ve,Oe,lt,tt),[ht,p,Ve,Oe,lt,tt]),ze=xo(e),be=s.useMemo(()=>vn.slice(0,p).map(Te=>Ve[Te]),[p,Ve]),Ae=s.useMemo(()=>Rs(p,ze,Ve),[p,ze,Ve]),De=s.useMemo(()=>fr(p,ze,Ve),[p,ze,Ve]),Ue=s.useMemo(()=>nt.map((Te,We)=>hd(De[We]??0,Te.paddingLeft,Te.paddingRight)),[nt,De]),Ce=s.useMemo(()=>{const Te=h===0?1/0:h;return(t??[]).slice(0,Te).map((Qe,st)=>({id:st,cells:Object.fromEntries(Qn.map(gt=>[gt,Qe[gt]??""])),image:Qe.image,link:Qe.link}))},[t,h]),Ne=Q?le??L:Ce.length,Be=s.useMemo(()=>Q?Ce.slice(0,Ne):Ce,[Ce,Q,Ne]),Ke=Q&&Ne<Ce.length,ct=Be.length>1||Ke,Je=[oe?`${c}-divider-top`:"",Ee||ct?`${c}-divider-bottom`:""].filter(Boolean).join(" "),$t=!n||i,dt=()=>{if(!$t)return;const Te=le??L;if(!f){ie(Ce.length);return}ie(Math.min(Te+f,Ce.length))},_e=Te=>_.scalingValue(Te,n??!1),Xe=te?D??0:k??0,je=T??0,ut=g??0,pt=Math.max(je,pa),mt=gl(0,Be.length,oe,Ee,Ke,m??0,n??!1).borderTopWidth,kt=te?"rowPaddingTopB":"rowPaddingTop",Kt=nt[0],Yt=nt[nt.length-1],vt=Ue[0],bt=Ue[Ue.length-1],Gt=Kt&&vt?Math.max(vt.paddingLeft,Ei):0,Ft=Yt&&bt?Math.max(bt.paddingRight,Ei):0,xt=ze,Ht=(Te,We)=>$f($,Me.current,Y?Te:null,We),Ut=(Te,We)=>{if(!J)return;const Qe=Te.image;if(!(Qe!=null&&Qe.url)){z(()=>ae(null));return}const st=(I==null?void 0:I.min)??80,gt=(I==null?void 0:I.max)??320,Rt=(W==null?void 0:W.rowId)===Te.id,ot=Rt?W.widthPx:ey(st,gt),{x:Ot,y:Et}=Ht(We,ot);if(Rt&&Y){re(Ot,Et);return}ae({rowId:Te.id,url:Qe.url,objectFit:"contain",isVideo:vf(Qe),widthPx:ot}),F.current={x:Ot,y:Et}},Zt=Te=>{if(!J||!W||!Y)return;const{x:We,y:Qe}=Ht(Te,W.widthPx);re(We,Qe)},tn=()=>{W&&z(()=>ae(null))},Ct=Te=>{U&&pl(Te,c),!(!J||!W)&&z(()=>ae(null))},jt=Te=>{U&&ml(Te,c)};s.useLayoutEffect(()=>{if(!W||!F.current)return;const{x:Te,y:We}=F.current;F.current=null,se(Te,We)},[W==null?void 0:W.rowId,W==null?void 0:W.url,se]),s.useLayoutEffect(()=>{if(!u||te){ue(null);return}const Te=we.current,We=Te==null?void 0:Te.parentElement;if(!Te||!We){ue(null);return}const Qe=()=>{const gt=Te.querySelector("[data-list-row]");if(!gt){ue(null);return}const Rt=We.getBoundingClientRect(),ot=gt.getBoundingClientRect();ue(ot.top-Rt.top+ot.height/2)};Qe();const st=new ResizeObserver(Qe);return st.observe(Te),st.observe(We),()=>st.disconnect()},[u,te,Be,Xe,je,ut,t,e,nt,De,ge,m,oe,Ee,Ke]);const dn=s.useMemo(()=>!te&&Cs.some(Te=>{const We=Te.charAt(0),Qe=e[`${Te}VerticalAlign`];return pd(Qe,e,We)}),[te,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var Ot;const Te=Me.current;if(!Te)return;const We=()=>{Te.querySelectorAll("[data-list-col]").forEach(Et=>{Et.style.transform="";const Mt=Et.querySelector(`.${c}-list-col`);Mt&&(Mt.style.minHeight="",Mt.style.height="");const Bt=Et.querySelector(`.${c}-list-col-title`);Bt&&(Bt.style.transform="")})};if(te||!dn){We();return}const Qe=()=>{const Et=Array.from(Te.querySelectorAll("[data-list-row]")),Mt=`${c}-list-col`,Bt=`${c}-baseline-probe`;Et.forEach(zt=>{zt.querySelectorAll("[data-list-col]").forEach(_t=>{_t.style.transform="";const Wt=_t.querySelector(`.${Mt}`);Wt&&(Wt.style.minHeight="",Wt.style.height="");const At=_t.querySelector(`.${c}-list-col-title`);At&&(At.style.transform="")})}),Et.forEach(zt=>{const _t=Array.from(zt.querySelectorAll("[data-list-col]"));_f(zt,_t,Mt)}),Te.offsetHeight,Et.forEach(zt=>{const _t=Array.from(zt.querySelectorAll("[data-list-col]")),Wt=zt.getBoundingClientRect().top,At=new Map,wt=_t.map(Re=>{const ke=Re.querySelector(`.${c}-list-col-title`),et={el:Re,titleEl:ke,letter:Re.getAttribute("data-col-letter")??"",kind:Re.getAttribute("data-valign")??"top",anchor:Re.getAttribute("data-valign-anchor")};return At.set(et.letter,et),et}),M=new Map,xe=(Re,ke)=>{const et=M.get(Re.letter);if(et!==void 0)return et;const Pt=Re.anchor?At.get(Re.anchor):void 0;if(Re.kind!=="baseline"||!Pt||ke.has(Re.letter)){const nn=ua(Re,Wt,Mt,Bt);return M.set(Re.letter,nn),nn}ke.add(Re.letter);const Ye=xe(Pt,ke);ke.delete(Re.letter);const ft=ua(Re,Wt,Mt,Bt),Nt=Ye-ft;Wf(Re.titleEl,Nt);const Tt=ua(Re,Wt,Mt,Bt);return M.set(Re.letter,Tt),Tt};wt.forEach(Re=>xe(Re,new Set))})};let st=null;const gt=()=>{st===null&&(st=requestAnimationFrame(()=>{st=null,Qe()}))};Qe();const Rt=new ResizeObserver(()=>gt());Rt.observe(Te);let ot=!1;return typeof document<"u"&&((Ot=document.fonts)!=null&&Ot.ready)&&document.fonts.ready.then(()=>{ot||gt()}),()=>{ot=!0,st!==null&&(cancelAnimationFrame(st),st=null),Rt.disconnect(),We()}},[dn,te,e,t,ge,Be,De]);const at=s.useMemo(()=>Tf(c),[c]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:at}}),a.jsx("div",{style:Le,children:a.jsxs("div",{ref:Me,className:`${c}-wrapper ${ce}${Je?` ${Je}`:""}${te?` ${c}-type-b`:""}`.trim(),style:{width:_.scalingValue(b??0,n)},onMouseMove:J?Zt:void 0,onMouseLeave:J?tn:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[Be.map((Te,We)=>{var Rt;const Qe=(((Rt=Te.link)==null?void 0:Rt.length)??0)>0,st=Qe&&(!n||i)?"a":"div",gt=gl(We,Be.length,oe,Ee,Ke,m??0,n??!1);return a.jsxs(st,{ref:We===0?ot=>{we.current=ot}:void 0,className:`${c}-list-item${Qe||v==="always"?` ${c}-list-item-has-link`:""}${Ke&&We===Be.length-1?` ${c}-list-item-before-cut`:""}`,...Qe?{href:Te.link,target:"_blank"}:{},style:gt,onMouseEnter:ot=>{U&&(Qe||v==="always")&&pl(ot,c),J&&Ut(Te,ot)},onMouseLeave:ot=>{U&&(Qe||v==="always")&&ml(ot,c)},children:[Xe>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:_e(Xe)}}),a.jsxs("div",{className:`${c}-list-cols-row${te?"":` ${c}-list-cols-row-h`}${u&&We===0&&te?` ${c}-list-cols-row-controls`:""}`,...te?{}:{"data-list-row":""},style:te?void 0:{minHeight:_e(ut)},children:[nt.map((ot,Ot)=>{const Et=Ot===nt.length-1,Mt=Ue[Ot],Bt=ot.paddingBottom,zt=bf(Te.cells[ot.key]),_t=te&&zt&&Bt>0,Wt=te?{minHeight:_e(ut)}:{width:_e(De[Ot])},At=te?{paddingLeft:_e(he),paddingRight:_e(he)}:{paddingLeft:_e(Mt.paddingLeft),paddingRight:_e(Mt.paddingRight)},wt=ot.textPrefix.charAt(0),M=te?Pf(e[`${ot.textPrefix}VerticalAlign`]):If(e[`${ot.textPrefix}VerticalAlign`],e,wt),xe=te&&zt&&u&&We===0;return te&&!zt?null:a.jsxs("div",{className:te?`${c}-list-col-wrap`:void 0,...te?{}:{"data-list-col":"","data-col-letter":wt,"data-valign":M.kind,...M.kind==="baseline"?{"data-valign-anchor":M.anchorLetter}:{}},children:[a.jsx("div",{className:`${c}-list-col${Et?` ${c}-list-col-last`:""}`,style:{...At,...Wt,...te?{justifyContent:yl(M.kind)}:{}},"data-test":ot.width,children:a.jsx("span",{className:xl(e,ot.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...vl(Rr(e,ot.textPrefix),n),...bl(e,ot.textPrefix,c,n),...te?{}:Ef(M.kind)},children:Te.cells[ot.key]??null})}),_t&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:_e(Bt)}}),xe&&a.jsx("div",{"data-controls":ot.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:_e(Math.max(Bt,pa))}})]},ot.key)}),u&&We===0&&te&&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(Pe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:_e(Se),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(Pe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:_e(Math.max(Se,ze-Se)),width:_e(Se),height:"100%"}})]})]}),!te&&je>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:_e(je)}}),u&&We===0&&!te&&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:_e(pt)}})]},Te.id)}),u&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":kt,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":te?"center":"left-y",className:`${c}-control-anchor`,style:{top:mt,left:0,width:"100%",height:_e(Math.max(Xe,pa))}})},"row-padding-handles"),u&&!te&&Kt&&Yt&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Kt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(De[0]-((vt==null?void 0:vt.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Ie??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:_e(Gt),height:"100%"}}),a.jsx("div",{"data-controls":Yt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(De[nt.length-1]-((bt==null?void 0:bt.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Ie??void 0,className:`${c}-control-anchor`,style:{top:0,left:_e(xt-Ft),width:_e(Ft),height:"100%"}})]},"column-edge-padding-handles"),u&&!te&&nt.slice(0,-1).map((Te,We)=>{const Qe=nt[We+1],st=Ae.slice(0,We+1).reduce((Et,Mt)=>Et+Mt,0),gt=Ue[We],Rt=Ue[We+1],ot=Math.max(gt.paddingRight,Ei),Ot=Math.max(Rt.paddingLeft,Ei);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Te.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(De[We]-gt.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Ie??void 0,className:`${c}-control-anchor`,style:{top:0,left:_e(st-ot),width:_e(ot),height:"100%"}}),a.jsx("div",{"data-controls":Qe.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(De[We+1]-Rt.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Ie??void 0,className:`${c}-control-anchor`,style:{top:0,left:_e(st),width:_e(Ot),height:"100%"}})]},`${Te.paddingRightKey}-padding`)}),u&&!te&&nt.slice(0,-1).map((Te,We)=>{const Qe=Qf(We,Ae,be,ze),gt=Ae.slice(0,We+1).reduce((Rt,ot)=>Rt+ot,0)-wl/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Te.widthKey,"data-controls-axis":"x","data-controls-min":String(Ls),"data-controls-max-fraction":String(Qe),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:_e(gt),width:_e(wl),height:"calc(100%)",pointerEvents:"auto"}})},`${Te.widthKey}-junction`)})]}),Ke&&(()=>{const Te=Rr(e,Wn),We=kf(e.cutLabelVerticalAlign),Qe=Te.textTextAlign==="justify"||te;return a.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:_e(S??0),cursor:$t?"pointer":"default",...wf(Ee,m??0,n??!1)},onClick:$t?dt:void 0,onMouseEnter:U||J?Ct:void 0,onMouseLeave:U?jt:void 0,children:a.jsx("div",{className:`${c}-list-cols-row`,style:{...te?{paddingLeft:_e(he),paddingRight:_e(he)}:{},justifyContent:Af(Te.textTextAlign),alignItems:yl(We)},children:a.jsx("span",{className:xl(e,Wn,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...vl(Te,n),...bl(e,Wn,c,n),...Qe?{width:"100%"}:{}},children:H})})})})(),J&&W&&(()=>{const Te=`${W.widthPx}px`,We={width:Te,height:"auto",maxHeight:Te,objectFit:"contain"};return a.jsx("div",{ref:ye,className:`${c}-hover-media-anchor`,children:a.jsx(xf,{media:W,className:W.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:We},`${W.rowId}-${W.url}`)})})()]})})]})}const oy=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
9255
9255
  import { CommonComponentProps } from '../props';
9256
9256
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
9257
9257
  import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
@@ -12504,7 +12504,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
12504
12504
  pointer-events: none;
12505
12505
  z-index: 2;
12506
12506
  }
12507
- `}function Pl(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 Ly({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r}){const{prefix:l}=_.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:w="solid",entryHoverEffect:b="default",autoclose:h="off",icon:g,iconMaxWidth:m=.00833,iconPaddingRight:v=0,iconAnimation:L="rotate 45",questionColor:f="#000000",answerColor:S="#000000",dividerColor:H="#0000001F",iconColor:P="#000000",questionHoverColor:R="#666666",iconHoverColor:$="#666666",iconActiveColor:x="#000000",dividerHoverColor:A="#000000",questionFontFamily:y,questionFontSettings:F,questionFontSize:T,questionLineHeight:j,questionLetterSpacing:E,questionWordSpacing:B,questionTextAppearance:O,answerFontFamily:z,answerFontSettings:ee,answerFontSize:k,answerLineHeight:W,answerLetterSpacing:D,answerWordSpacing:le,answerTextAppearance:Y,questionPaddingLeft:I=0,questionPaddingTop:oe=0,questionPaddingBottom:N=0,answerPaddingLeft:ie=0,answerPaddingRight:Z=0,answerPaddingTop:te=0,answerPaddingBottom:Se=0}=e,se=t??[],[ae,V]=s.useState(()=>new Set),J=!n||i;s.useEffect(()=>{V(new Set)},[h]),s.useEffect(()=>{n&&!o&&!i&&V(new Set)},[n,o,i]);const Q=Ue=>_.scalingValue(Ue,n??!1),Me=Math.max(I,Bn),be=Math.max(oe,Bn),Ie=Math.max(N,Bn),ue=Math.max(ie,Bn),ge=Math.max(Z,Bn),ye=Math.max(te,Bn),q=Math.max(Se,Bn),de=Math.max(0,(c??1)-v-m),he=Math.max(0,(c??1)-Z),we=Math.max(0,(c??1)-ie),Pe=Math.max(v,Bn),Le=Math.max(0,(c??1)-I-m),G=s.useMemo(()=>ae.size===0?0:Math.min(...ae),[ae]),fe=s.useCallback(Ue=>ae.has(Ue),[ae]),ce=J&&b==="default"?`${l}-entry-hover-default`:"",U=g??"",re=U!=="",Ee=L.replace(/^rotate /,""),pe=`${l}-icon-anim-${Ee}`,K=rn(qt(Pl(y,F,T,j,E,B,O,f),n)),Ve=rn(qt(Pl(z,ee,k,W,D,le,Y,S),n)),Oe=Rl(T,j,`${l}-question`,`${l}-text-tight-leading`),lt=Rl(k,W,`${l}-answer-text`,`${l}-text-tight-leading`),tt=Il(T,j,l,n),ht=Il(k,W,l,n),nt=_.buildColorVars(l,{questionColor:f,answerColor:S,dividerColor:H,iconColor:P,questionHoverColor:R,iconHoverColor:$,iconActiveColor:x,dividerHoverColor:A},Sy,$y),ze=r&&r!=="default"?`${l}-state-${r}`:"",xe=s.useCallback(Ue=>{J&&V(Ce=>{if(Ce.has(Ue)){const Be=new Set(Ce);return Be.delete(Ue),Be}if(h==="on")return new Set([Ue]);const Ne=new Set(Ce);return Ne.add(Ue),Ne})},[J,h]),Ae=s.useMemo(()=>Ty(l),[l]),De={[`--${l}-divider-width`]:_.scalingValue(p,n??!1),[`--${l}-divider-style`]:w,[`--${l}-icon-max-width`]:_.scalingValue(m,n??!1),...u>0?{[`--${l}-question-min-height`]:_.scalingValue(u,n??!1)}:{}};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ae}}),a.jsx("div",{style:nt,children:a.jsx("div",{className:rt(`${l}-wrapper`,n&&!i&&`${l}-editor`,ce,ze),style:{width:_.scalingValue(c,n??!1),maxWidth:"100%",...De},children:se.map((Ue,Ce)=>{var $t;const Ne=fe(Ce),Be=(($t=Ue.question)==null?void 0:$t.trim())??"",Ke=Ue.answer,ct=((Ke==null?void 0:Ke.length)??0)>0,Je=d&&Ce===G;return a.jsxs("div",{className:rt(`${l}-item`,Ne&&`${l}-item-open`),"data-faq-item":"",children:[a.jsxs("div",{className:`${l}-question-controls`,children:[Je&&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:Q(be)}}),a.jsx("div",{"data-controls":"questionPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(de),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:Q(Me),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(Le),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:Q(Pe),height:"100%"}})]}),a.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":Ne,style:{...K,...tt,paddingLeft:Q(I),paddingRight:Q(v)},onClick:()=>xe(Ce),children:[oe>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:Q(oe)},"aria-hidden":"true"}),a.jsxs("span",{className:`${l}-question-row`,children:[a.jsx("span",{className:Oe,children:Be}),ct&&(re?a.jsx("span",{className:`${l}-icon ${l}-icon-custom ${pe}`,"aria-hidden":"true",children:a.jsx(an,{url:U,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 ${pe}`,"aria-hidden":"true"}))]}),N>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:Q(N)},"aria-hidden":"true"})]}),Je&&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:Q(Ie)}})]}),ct&&Ke&&a.jsx("div",{className:`${l}-panel`,"aria-hidden":!Ne,children:a.jsx("div",{className:`${l}-panel-inner`,children:a.jsxs("div",{className:`${l}-answer-controls`,children:[Je&&Ne&&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:Q(ye)}}),a.jsx("div",{"data-controls":"answerPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(he),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:Q(ue),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(we),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:Q(ge),height:"100%"}})]}),te>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:Q(te)}}),a.jsx("div",{className:`${l}-answer`,style:{...Ve,...ht,paddingLeft:Q(ie),paddingRight:Q(Z)},children:a.jsx("div",{className:lt,children:a.jsx(bi,{content:Ke})})}),Se>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:Q(Se)}}),Je&&Ne&&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:Q(q)}})]})})})]},Ce)})})})]})}const Ry=`import { useCallback, useEffect, useMemo, useState } from 'react';
12507
+ `}function Pl(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 Ly({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r}){const{prefix:l}=_.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:w="solid",entryHoverEffect:b="default",autoclose:h="off",icon:g,iconMaxWidth:m=.00833,iconPaddingRight:y=0,iconAnimation:L="rotate 45",questionColor:f="#000000",answerColor:S="#000000",dividerColor:H="#0000001F",iconColor:I="#000000",questionHoverColor:R="#666666",iconHoverColor:$="#666666",iconActiveColor:x="#000000",dividerHoverColor:A="#000000",questionFontFamily:v,questionFontSettings:k,questionFontSize:T,questionLineHeight:D,questionLetterSpacing:P,questionWordSpacing:B,questionTextAppearance:O,answerFontFamily:V,answerFontSettings:ee,answerFontSize:E,answerLineHeight:N,answerLetterSpacing:j,answerWordSpacing:le,answerTextAppearance:ie,questionPaddingLeft:W=0,questionPaddingTop:ae=0,questionPaddingBottom:F=0,answerPaddingLeft:J=0,answerPaddingRight:Y=0,answerPaddingTop:Z=0,answerPaddingBottom:ye=0}=e,se=t??[],[re,z]=s.useState(()=>new Set),Q=!n||i;s.useEffect(()=>{z(new Set)},[h]),s.useEffect(()=>{n&&!o&&!i&&z(new Set)},[n,o,i]);const te=Ue=>_.scalingValue(Ue,n??!1),Me=Math.max(W,Bn),we=Math.max(ae,Bn),Ie=Math.max(F,Bn),ue=Math.max(J,Bn),ge=Math.max(Y,Bn),ve=Math.max(Z,Bn),q=Math.max(ye,Bn),de=Math.max(0,(c??1)-y-m),he=Math.max(0,(c??1)-Y),Se=Math.max(0,(c??1)-J),Pe=Math.max(y,Bn),Le=Math.max(0,(c??1)-W-m),G=s.useMemo(()=>re.size===0?0:Math.min(...re),[re]),fe=s.useCallback(Ue=>re.has(Ue),[re]),ce=Q&&b==="default"?`${l}-entry-hover-default`:"",U=g??"",oe=U!=="",Ee=L.replace(/^rotate /,""),pe=`${l}-icon-anim-${Ee}`,K=rn(qt(Pl(v,k,T,D,P,B,O,f),n)),Ve=rn(qt(Pl(V,ee,E,N,j,le,ie,S),n)),Oe=Rl(T,D,`${l}-question`,`${l}-text-tight-leading`),lt=Rl(E,N,`${l}-answer-text`,`${l}-text-tight-leading`),tt=Il(T,D,l,n),ht=Il(E,N,l,n),nt=_.buildColorVars(l,{questionColor:f,answerColor:S,dividerColor:H,iconColor:I,questionHoverColor:R,iconHoverColor:$,iconActiveColor:x,dividerHoverColor:A},Sy,$y),ze=r&&r!=="default"?`${l}-state-${r}`:"",be=s.useCallback(Ue=>{Q&&z(Ce=>{if(Ce.has(Ue)){const Be=new Set(Ce);return Be.delete(Ue),Be}if(h==="on")return new Set([Ue]);const Ne=new Set(Ce);return Ne.add(Ue),Ne})},[Q,h]),Ae=s.useMemo(()=>Ty(l),[l]),De={[`--${l}-divider-width`]:_.scalingValue(p,n??!1),[`--${l}-divider-style`]:w,[`--${l}-icon-max-width`]:_.scalingValue(m,n??!1),...u>0?{[`--${l}-question-min-height`]:_.scalingValue(u,n??!1)}:{}};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ae}}),a.jsx("div",{style:nt,children:a.jsx("div",{className:rt(`${l}-wrapper`,n&&!i&&`${l}-editor`,ce,ze),style:{width:_.scalingValue(c,n??!1),maxWidth:"100%",...De},children:se.map((Ue,Ce)=>{var $t;const Ne=fe(Ce),Be=(($t=Ue.question)==null?void 0:$t.trim())??"",Ke=Ue.answer,ct=((Ke==null?void 0:Ke.length)??0)>0,Je=d&&Ce===G;return a.jsxs("div",{className:rt(`${l}-item`,Ne&&`${l}-item-open`),"data-faq-item":"",children:[a.jsxs("div",{className:`${l}-question-controls`,children:[Je&&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:te(we)}}),a.jsx("div",{"data-controls":"questionPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(de),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:te(Me),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(Le),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:te(Pe),height:"100%"}})]}),a.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":Ne,style:{...K,...tt,paddingLeft:te(W),paddingRight:te(y)},onClick:()=>be(Ce),children:[ae>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:te(ae)},"aria-hidden":"true"}),a.jsxs("span",{className:`${l}-question-row`,children:[a.jsx("span",{className:Oe,children:Be}),ct&&(oe?a.jsx("span",{className:`${l}-icon ${l}-icon-custom ${pe}`,"aria-hidden":"true",children:a.jsx(an,{url:U,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 ${pe}`,"aria-hidden":"true"}))]}),F>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:te(F)},"aria-hidden":"true"})]}),Je&&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:te(Ie)}})]}),ct&&Ke&&a.jsx("div",{className:`${l}-panel`,"aria-hidden":!Ne,children:a.jsx("div",{className:`${l}-panel-inner`,children:a.jsxs("div",{className:`${l}-answer-controls`,children:[Je&&Ne&&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:te(ve)}}),a.jsx("div",{"data-controls":"answerPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(he),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:te(ue),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(Se),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:te(ge),height:"100%"}})]}),Z>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:te(Z)}}),a.jsx("div",{className:`${l}-answer`,style:{...Ve,...ht,paddingLeft:te(J),paddingRight:te(Y)},children:a.jsx("div",{className:lt,children:a.jsx(bi,{content:Ke})})}),ye>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:te(ye)}}),Je&&Ne&&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:te(q)}})]})})})]},Ce)})})})]})}const Ry=`import { useCallback, useEffect, useMemo, useState } from 'react';
12508
12508
  import cn from 'classnames';
12509
12509
  import { CommonComponentProps } from '../props';
12510
12510
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
@@ -13252,7 +13252,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
13252
13252
  </>
13253
13253
  );
13254
13254
  }
13255
- `;function zn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Ml={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Iy=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Py={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:zn("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:{...Ml.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:{...Ml.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:zn("Question Padding Left"),questionPaddingTop:zn("Question Padding Top"),questionPaddingBottom:zn("Question Padding Bottom"),answerPaddingLeft:zn("Answer Padding Left"),answerPaddingRight:zn("Answer Padding Right"),answerPaddingTop:zn("Answer Padding Top"),answerPaddingBottom:zn("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:[...Iy],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},My={element:Ly,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:Py,sourceCode:Ry},Nn=e=>e.display==="cover",Vr=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},El=100,Ey=.2,kl=8,vd=({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"?El:Math.max(El,window.innerHeight*Ey),[]),w=s.useCallback(y=>Math.max(0,1-y/(p*1.5)),[p]),b=s.useCallback(y=>Math.max(0,1-y/(p*.45)),[p]),h=s.useCallback(y=>{const F=typeof window<"u"?window.innerHeight:800,T=Math.max(.88,1-y/F*.12);return`translateY(${y}px) scale(${T})`},[]),g=s.useCallback(()=>{c.current=null},[]),m=s.useCallback(()=>{d(!0),r(0),window.setTimeout(()=>d(!1),n),g()},[n,g]),v=s.useCallback(()=>{const y=typeof window<"u"?window.innerHeight:800;d(!0),r(y),window.setTimeout(()=>{t(),g(),d(!1)},Math.min(n,200))},[n,t,g]),L=s.useCallback(y=>{!e||l||y.pointerType==="touch"&&(i!=null&&i(y.target)||(c.current={startX:y.clientX,startY:y.clientY,isLocked:null,pointerId:y.pointerId}))},[e,l,i]),f=s.useCallback(y=>{const F=c.current;if(!e||!F||y.pointerType!=="touch"||F.pointerId!==y.pointerId)return;const T=y.clientX-F.startX,j=y.clientY-F.startY;if(F.isLocked===null){if(Math.abs(T)<kl&&Math.abs(j)<kl)return;if(j>0&&j>Math.abs(T))F.isLocked=!0,y.currentTarget.setPointerCapture(y.pointerId);else{F.isLocked=!1,g();return}}if(!F.isLocked)return;y.preventDefault();const E=Math.max(0,j);u.current=E,r(E)},[e,g]),S=s.useCallback(y=>{const F=c.current;if(!e||!F||y.pointerType!=="touch"||F.pointerId!==y.pointerId)return;const T=F.isLocked===!0;if(y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),!T){g();return}y.clientY-F.startY>=p?v():m()},[p,v,e,g,m]),H=s.useCallback(y=>{S(y)},[S]),P=s.useCallback(y=>{S(y)},[S]),R=o>0,$=l?`transform ${n}ms ease`:"none",x=l?`opacity ${n}ms ease`:"none",A=o>0||l;return{isSwipeDragging:R,backdropStyle:{opacity:w(o),transition:x},mediaAreaStyle:{transform:h(o),transition:$,touchAction:R?"none":void 0,willChange:R?"transform":void 0},overlayContentStyle:A?{opacity:b(o),transition:x}:void 0,swipeHandlers:e?{onPointerDown:L,onPointerMove:f,onPointerUp:H,onPointerCancel:P}:{},dismissAreaStyle:e?{touchAction:R?"none":"pan-x"}:void 0}},ky="[data-lightbox-scrollable]",xd=()=>{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(ky)||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"})}},[])},Ay=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Fy=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},_y=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Wy=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(g,m)=>{Fy(t),e.scrollLeft=g,m&&(r==null||r())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,w=0;const b=()=>{t.removeEventListener("transitionend",h),clearTimeout(w)},h=g=>{g.target!==t||g.propertyName!=="transform"||p||(p=!0,b(),u(n,!0))};return t.addEventListener("transitionend",h),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)`,w=window.setTimeout(()=>{p||(p=!0,b(),u(n,!0))},i+64),()=>{p||(p=!0,b(),u(l-_y(t),!1))}},bo=300,Ny=900,Hy=1500,Oy="cubic-bezier(0.16, 1, 0.3, 1)",Dy=3e3,jy=2,By=16,zy=.05,Vy=1,or=.3,Gy=50,Uy=20,Ti=.004,Xi=["title1","title2","title3"],qy={title1:"1",title2:"2",title3:"3"},Xy={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Ky={title1:.02,title2:.02,title3:.02},rr=e=>`max(${e}, ${Uy}px)`,Yy=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]}},Zy=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=Yy(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Dt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Jy=e=>[Dt(e,"fontFamily"),Dt(e,"fontSettings"),{type:"row",items:[Dt(e,"fontSize"),Dt(e,"lineHeight"),Dt(e,"letterSpacing"),Dt(e,"wordSpacing")]},Dt(e,"textAlign"),Dt(e,"textAppearance")],Qy=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Xi.map(e=>[qy[e],Jy(e)]))}),Is=(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},bd=(e,t)=>Is(e,t),ar=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Al=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Is(e.length,n),effective:bd(e.length,n)}},ev=(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},ga=(e,t)=>{const n=i=>{const o=Dt(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[Xy[t]]}},tv=(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),ha=(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??Ky[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return qt(i,n)},nv=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:w,closeIcon:b,closeIconMaxWidth:h,closeIconColor:g,closeIconHoverColor:m,thumbnailTrigger:v,thumbnailVisibility:L,thumbnailObjectFit:f,thumbnailActive:S,thumbnailActiveColor:H,title1Width:P,title2Width:R,title3Width:$,title1MarginLeft:x=0,title2MarginLeft:A=0,title3MarginLeft:y=0,titleRowMarginBottom:F=0,titleHeaderLayout:T="desktop",contentMarginTop:j,iconMarginLeft:E}=n,B=C=>_.scalingValue(C,i??!1),O=c??n.thumnailSize??.03,z=B(O),ee=B(u),k=B(p??.02),W=B(w??0),D=B(j??0),le=rr(D),Y=B(E??0),[I,oe]=s.useState(0),N=s.useRef(I);N.current=I;const ie=t[I],{title1:Z,title2:te,title3:Se}=Zy(ie),se=ha("title1",ga(n,"title1"),i),ae=ha("title2",ga(n,"title2"),i),V=ha("title3",ga(n,"title3"),i),J=T==="mobile",Q=!o&&(!i||r),Me=Q,be=Q,Ie=Q,ue=Nn(f),ge=ue?{"--image-aspect-ratio":Vr(f)}:void 0,ye=!!(Z||te||Se),q=s.useMemo(()=>ev(e,Z,te,Se,se,ae,V),[e,I,Z,te,Se,se,ae,V]),de=s.useMemo(()=>({title1Width:P,title2Width:R,title3Width:$}),[P,R,$]),he=s.useMemo(()=>q.map(C=>de[C.widthKey]),[q,de]),we=s.useMemo(()=>Is(q.length,he),[q.length,he]),Pe=s.useMemo(()=>bd(q.length,he),[q.length,he]),Le=s.useMemo(()=>q.filter(C=>C.prefix==="title1"),[q]),G=s.useMemo(()=>q.filter(C=>C.prefix==="title2"||C.prefix==="title3"),[q]),fe=s.useMemo(()=>Al(Le,de),[Le,de]),ce=s.useMemo(()=>Al(G,de),[G,de]),U=s.useCallback((C,X)=>{const ne=q.indexOf(C);if(!J||X==="single-row")return{effectiveWidth:Pe[ne]??0,resolvedWidth:we[ne]??0,maxWidth:ar(ne,we)};if(X==="two-row-top"){const Fe=Le.indexOf(C);return{effectiveWidth:fe.effective[Fe]??0,resolvedWidth:fe.resolved[Fe]??0,maxWidth:ar(Fe,fe.resolved)}}const $e=G.indexOf(C);return{effectiveWidth:ce.effective[$e]??0,resolvedWidth:ce.resolved[$e]??0,maxWidth:ar($e,ce.resolved)}},[G,ce,Pe,we,q,Le,fe,J]),re=s.useCallback(C=>_.scalingValue(C,i??!1),[i]),Ee=re(F??0),pe=s.useMemo(()=>({title1MarginLeft:x,title2MarginLeft:A,title3MarginLeft:y}),[x,A,y]),K=s.useCallback(C=>q.slice(0,C+1).reduce((X,ne,$e)=>X+(ne!=null&&ne.marginLeftKey?pe[ne.marginLeftKey]??0:0)+(we[$e]??0),0)+(J?0:x??0),[q,pe,we,J,x]),Ve=s.useCallback(()=>J?0:x??0,[J,x]),Oe=s.useCallback(C=>G.slice(0,C).reduce((X,ne,$e)=>X+(ne.marginLeftKey?pe[ne.marginLeftKey]??0:0)+(ce.resolved[$e]??0),0),[G,ce.resolved,pe]),lt=s.useCallback(C=>{const X=G[C];return Oe(C)+(X.marginLeftKey?pe[X.marginLeftKey]??0:0)+(ce.resolved[C]??0)},[G,ce.resolved,Oe,pe]),tt=(C,X)=>{const ne=C.marginLeftKey?pe[C.marginLeftKey]??0:0,{effectiveWidth:$e,resolvedWidth:Fe,maxWidth:qe}=U(C,X),yt=o&&X==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":C.prefix,style:{...X==="single-row"?{gridArea:C.prefix}:{},width:re($e),...ne>0?{marginLeft:re(ne)}:{}},children:[a.jsx("p",{className:C.className,style:C.style,children:C.text}),yt&&C.marginLeftKey&&a.jsx("div",{"data-controls":C.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Fe),style:{position:"absolute",top:0,left:re(-ne),width:`max(${re(ne)}, 10px)`,height:"100%",pointerEvents:"auto"}}),yt&&a.jsx("div",{"data-controls":C.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(qe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:re(-Ti/2),width:re(Ti),height:"100%",pointerEvents:"auto"}})]},C.className)},ht=()=>{const C=J?-1:q.findIndex($e=>$e.prefix==="title1"),X=!J&&(o||(x??0)>0)?(()=>{const $e=x??0,Fe=C>=0?we[C]:P??0;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:`max(${re($e)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,ne=q.flatMap(($e,Fe)=>{if(!$e.marginLeftKey)return[];const qe=pe[$e.marginLeftKey]??0,yt=tv(q,we,pe,Fe)+Ve();return a.jsx("div",{"data-controls":$e.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(we[Fe]),style:{position:"absolute",top:0,left:re(yt),width:`max(${re(qe)}, 10px)`,height:"100%",pointerEvents:"auto"}},$e.marginLeftKey)});return X?[X,...ne]:ne},nt=()=>q.map((C,X)=>{const ne=ar(X,we),Fe=K(X)-Ti/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":C.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ne),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:re(Fe),width:re(Ti),height:"100%",pointerEvents:"auto"}})},`${C.widthKey}-junction`)}),ze=()=>G.flatMap((C,X)=>{if(!C.marginLeftKey)return[];const ne=pe[C.marginLeftKey]??0,$e=Oe(X),{resolvedWidth:Fe}=U(C,"two-row-bottom");return a.jsx("div",{"data-controls":C.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Fe),style:{position:"absolute",top:0,left:re($e),width:`max(${re(ne)}, 10px)`,height:"100%",pointerEvents:"auto"}},C.marginLeftKey)}),xe=()=>G.map((C,X)=>{const{maxWidth:ne}=U(C,"two-row-bottom"),Fe=lt(X)-Ti/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":C.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ne),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:re(Fe),width:re(Ti),height:"100%",pointerEvents:"auto"}})},`${C.widthKey}-junction`)}),Ae=s.useRef(null),De=s.useRef(null),Ue=s.useRef(null),Ce=s.useRef(null),Ne=s.useRef([]),Be=s.useRef([]),Ke=s.useRef(0),ct=s.useRef(null),Je=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),$t=s.useRef(null),dt=s.useRef(null),_e=s.useRef(0),Xe=s.useRef("forward"),je=s.useRef(0),ut=s.useRef(null),pt=s.useRef(!1),mt=t.length>1&&(!o||!!r),kt=mt?3:1,Kt=s.useMemo(()=>Array.from({length:kt},()=>t).flat(),[t,kt]),[Yt,vt]=s.useState(!1),[bt,Gt]=s.useState(!1),[Ft,xt]=s.useState(!0),Ht=s.useRef(null),Ut=s.useRef(null),Zt=s.useRef(!1),tn=s.useRef(!1),Ct=s.useRef(null),jt=s.useRef(null),dn=Me&&!Ft,at=s.useCallback(()=>{Me&&(xt(!0),jt.current&&clearTimeout(jt.current),jt.current=setTimeout(()=>{Je.current.isActive||xt(!1)},Dy))},[Me]),Te=s.useCallback(()=>{o||tn.current||(tn.current=!0,Gt(!1),Ct.current=setTimeout(()=>{l()},bo))},[o,l]),We=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":dn?"true":"false",style:{width:_.scalingValue(h??0,i),height:_.scalingValue(h??0,i),marginRight:Y,"--close-icon-hover-color":m},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Te,"aria-label":"Close",children:a.jsx(an,{url:b,fill:g,hoverFill:i&&!r?g:m,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:Y,height:"100%",pointerEvents:"auto"}})]}),Qe=(C="two-row")=>a.jsx("div",{...C==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:re(x??0),flexShrink:0,...C==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...C==="two-row"&&o?{pointerEvents:"auto"}:{}}}),st=()=>{const C=q.find($e=>$e.prefix==="title1"),X=q.filter($e=>$e.prefix==="title2"||$e.prefix==="title3"),ne=X.length>0||o||(F??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(x??0)>0||o?Qe():null,C&&tt(C,"two-row-top"),b&&We()]}),ne?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[X.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[X.map($e=>tt($e,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[ze(),xe()]})]}):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:Ee,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},gt=()=>a.jsxs(a.Fragment,{children:[(x??0)>0||o?Qe("single-row"):null,q.map(C=>tt(C,"single-row")),o?a.jsxs(a.Fragment,{children:[ht(),nt()]}):null,b?We():null]}),Rt=s.useCallback(C=>!!(C.closest("[data-controls]")||C.closest(`.${e}-thumbnails`)||C.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ot,backdropStyle:Ot,mediaAreaStyle:Et,overlayContentStyle:Mt,swipeHandlers:Bt,dismissAreaStyle:zt}=vd({enabled:Q??!1,onClose:Te,animMs:bo,isBlockedTarget:Rt}),_t=()=>{if(!mt||t.length===0)return Ke.current=0,0;const C=Be.current[0],X=Be.current[t.length];if(!C||!X)return Ke.current;const ne=X.offsetLeft-C.offsetLeft;return ne>0&&(Ke.current=ne),Ke.current},Wt=(C=!1)=>{if(!mt)return;const X=De.current,ne=_t();!X||ne<=0||ne<X.clientWidth*.25||(X.scrollLeft<=0?(X.scrollLeft+=ne,C&&(Je.current.scrollLeft+=ne),pt.current&&(je.current+=ne)):X.scrollLeft>=ne*2&&(X.scrollLeft-=ne,C&&(Je.current.scrollLeft-=ne),pt.current&&(je.current-=ne)))},At=(C,X=(ne=>(ne=De.current)==null?void 0:ne.scrollLeft)()??0)=>{if(!mt)return C;let $e=t.length+C,Fe=1/0;for(let qe=0;qe<kt;qe++){const yt=qe*t.length+C,Lt=Be.current[yt];if(!Lt)continue;const en=Math.abs(Lt.offsetLeft-X);en<Fe&&(Fe=en,$e=yt)}return $e},wt=C=>{const X=De.current;return!C||!X?!1:C.offsetWidth>X.clientWidth+1},M=C=>{const X=De.current;if(!C||!X||!wt(C))return!1;const ne=C.offsetLeft,$e=ne+C.offsetWidth;return X.scrollLeft>=ne-1&&X.scrollLeft+X.clientWidth<=$e+1},ve=(C=(X=>(X=De.current)==null?void 0:X.scrollLeft)()??0)=>{for(let $e=0;$e<Be.current.length;$e+=1){const Fe=Be.current[$e];if(Fe&&M(Fe))return $e}let ne={flatIndex:0,distance:1/0};return Be.current.forEach(($e,Fe)=>{if(!$e)return;const qe=Math.abs($e.offsetLeft-C);qe<ne.distance&&(ne={flatIndex:Fe,distance:qe})}),ne.flatIndex},Re=C=>{De.current&&Be.current.forEach(X=>{X&&(X.style.scrollSnapAlign=wt(X)&&C==="backward"?"end":"start")})},ke=(C,X,ne)=>{const $e=C-X,Fe=ve(X),qe=Be.current[Fe];if(M(qe))return ve(C)%t.length;const yt=Be.current[Fe+1],Lt=qe?yt?yt.offsetLeft-qe.offsetLeft:qe.offsetWidth:0,en=Lt>0?$e>Lt*or?1:$e<-Lt*or?-1:0:0;return en===0?ne:mt?(ne+en+t.length)%t.length:Math.max(0,Math.min(t.length-1,ne+en))},et=s.useCallback((C=!1)=>{if(L!=="on"||o)return;const X=Ce.current,ne=N.current,$e=Ne.current[ne];if(!X||!$e||X.scrollWidth<=X.clientWidth)return;const Fe=X.scrollLeft,qe=Fe+X.clientWidth,yt=$e.offsetLeft,Lt=yt+$e.offsetWidth;if(yt>=Fe&&Lt<=qe)return;const en=X.scrollWidth-X.clientWidth;let Jt=Fe;if(!C&&Ht.current===null){const $i=Ne.current[ne-1],oo=Ne.current[ne+1],Xo=$i?$e.offsetLeft-$i.offsetLeft:oo?oo.offsetLeft-$e.offsetLeft:$e.offsetWidth;Lt>qe?Jt+=Xo:yt<Fe&&(Jt-=Xo)}else Lt>qe?Jt=Lt-X.clientWidth:Jt=yt;X.scrollLeft=Math.max(0,Math.min(en,Jt))},[o,L]),Pt=s.useCallback((C=!1)=>{C&&(Zt.current=!0),Ut.current===null&&(Ut.current=requestAnimationFrame(()=>{Ut.current=null;const X=Zt.current;Zt.current=!1,et(X)}))},[et]),Ye=s.useCallback(C=>{if(C===N.current)return;const X=N.current;N.current=C;const ne=Math.abs(C-X)>1,$e=mt&&t.length>1&&(X===t.length-1&&C===0||X===0&&C===t.length-1);oe(C),Pt(ne||$e)},[t.length,mt,Pt]),ft=()=>{if(!De.current||t.length===0||Ht.current!==null||Je.current.isActive&&Je.current.hasMoved)return;const C=De.current.scrollLeft,X=ve(C)%t.length;X!==N.current&&Ye(X)},Nt=()=>{Ht.current=null},Tt=C=>{const X=De.current;X&&(X.style.scrollSnapType=C?"":"none")},nn=()=>{var C;(C=dt.current)==null||C.call(dt),dt.current=null},un=()=>{ut.current!==null&&(cancelAnimationFrame(ut.current),ut.current=null),pt.current=!1},ii=()=>{const C=De.current;if(!C){ut.current=null,pt.current=!1;return}const X=je.current-C.scrollLeft;if(Math.abs(X)<.5){C.scrollLeft=je.current,Wt(),ft(),ut.current=null,pt.current=!1;return}C.scrollLeft+=X*zy,Wt(),ft(),at(),ut.current=requestAnimationFrame(ii)},oi=()=>{const C=Ue.current;C&&(C.style.transition="",C.style.transform="",C.style.willChange="")},Vo=(C,X,ne,$e)=>{oi(),C.scrollLeft=X,_e.current=C.scrollLeft,Wt(),ne!==void 0?(N.current=ne,oe(ne)):ft(),Tt(!0),$e==null||$e()},Go=(C,{behavior:X="smooth",activeIndex:ne,onComplete:$e}={})=>{const Fe=De.current,qe=Ue.current;if(!Fe||!qe)return;if(un(),nn(),Tt(!1),X==="auto"){Vo(Fe,C,ne,$e);return}const yt=Math.abs(C-Fe.scrollLeft),Lt=Ay(yt,Ny,Hy,Fe.clientWidth*.55);dt.current=Wy(Fe,qe,C,{duration:Lt,easing:Oy,onComplete:()=>{dt.current=null,Vo(Fe,C,ne,$e)}})},Ur=(C="smooth")=>{const X=De.current;if(!X||t.length===0)return;const ne=ve()%t.length,$e=At(ne,X.scrollLeft),Fe=Be.current[$e];Fe&&Go(Fe.offsetLeft,{behavior:C,activeIndex:ne})},qr=(C,X="smooth",ne,$e)=>{const Fe=De.current;if(!Fe||t.length===0)return;const qe=($e??Fe.scrollLeft)-C,yt=ve(C),Lt=Be.current[yt];if(M(Lt)){Tt(!0),ft();return}const en=Be.current[yt+1],Jt=Lt?en?en.offsetLeft-Lt.offsetLeft:Lt.offsetWidth:0;if((Jt>0?qe>Jt*or?1:qe<-Jt*or?-1:0:0)!==0){const Vd=ne??yt%t.length,Gd=ke($e??Fe.scrollLeft,C,Vd);Cn(Gd,X);return}const oo=$e??Fe.scrollLeft,Xo=ve(oo),Ms=Be.current[Xo];if(Ms&&Math.abs(Ms.offsetLeft-oo)<1){Tt(!0),ft();return}Ur("auto")},Cn=(C,X="smooth")=>{const ne=De.current;if(!ne||t.length===0)return;const $e=At(C,ne.scrollLeft),Fe=Be.current[$e];Fe&&(X==="smooth"?Ht.current=C:Ht.current=null,N.current=C,oe(C),Pt(!0),Go(Fe.offsetLeft,{behavior:X,activeIndex:C,onComplete:X==="smooth"?Nt:void 0}))},Si=()=>{$t.current&&(window.removeEventListener("pointerup",$t.current),window.removeEventListener("pointercancel",$t.current),$t.current=null)},Uo=(C,X,ne,$e,Fe)=>{const qe=ne-C,yt=$e-X,Lt=Math.abs(qe),en=Math.abs(yt);if(Lt<Gy||Lt<=en)return!1;const Jt=qe<0?1:-1,$i=mt?(Fe+Jt+t.length)%t.length:Math.max(0,Math.min(t.length-1,Fe+Jt));return $i===Fe?!1:(Cn($i),!0)},ri=C=>{if(!Je.current.isActive)return;Si();const X=De.current;if(!X)return;const{scrollLeft:ne,startActiveIndex:$e,hasMoved:Fe}=Je.current,qe=X.scrollLeft;Wt(!0),Je.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},vt(!1),C!==void 0&&X.hasPointerCapture(C)&&X.releasePointerCapture(C),Fe?qr(ne,"smooth",$e,qe):(Tt(!0),ft()),at()},qo=(C,X)=>{const ne=ct.current;ct.current=null,ne&&(Uo(ne.startX,ne.startY,C,X,ne.startActiveIndex),at())},Xr=C=>{if(!be)return;if(C.pointerType==="touch"){if(un(),Tt(!0),Rt(C.target))return;ct.current={startX:C.clientX,startY:C.clientY,startActiveIndex:N.current};return}if(C.pointerType!=="mouse"||C.button!==0||Rt(C.target))return;const X=De.current;if(!X)return;un(),nn(),oi(),Ht.current=null,Je.current={isActive:!0,startX:C.clientX,scrollLeft:X.scrollLeft,startActiveIndex:N.current,hasMoved:!1},Tt(!1),at(),X.setPointerCapture(C.pointerId),Si();const ne=$e=>{$e.pointerType==="mouse"&&ri($e.pointerId)};$t.current=ne,window.addEventListener("pointerup",ne),window.addEventListener("pointercancel",ne)},Kr=C=>{if(!be||C.pointerType!=="mouse")return;const X=De.current;if(!X||!Je.current.isActive)return;if(C.buttons===0){ri(C.pointerId);return}const ne=C.clientX-Je.current.startX;Math.abs(ne)>Vy&&(Je.current.hasMoved=!0,vt(!0)),Je.current.hasMoved&&(C.preventDefault(),X.scrollLeft=Je.current.scrollLeft-ne,Wt(!0),ft(),at())},me=C=>{if(be){if(C.pointerType==="touch"){C.type==="pointerup"?qo(C.clientX,C.clientY):ct.current=null;return}C.pointerType==="mouse"&&ri(C.pointerId)}},He=C=>{!be||C.pointerType!=="mouse"||ri(C.pointerId)};return xd(),s.useEffect(()=>{const C=requestAnimationFrame(()=>Gt(!0));return()=>{cancelAnimationFrame(C),nn(),Si(),Ut.current!==null&&(cancelAnimationFrame(Ut.current),Ut.current=null),Ct.current&&clearTimeout(Ct.current),jt.current&&clearTimeout(jt.current)}},[]),s.useEffect(()=>{if(!Me){xt(!0);return}at();const C=Ae.current;if(!C)return;const X=()=>at();return C.addEventListener("pointermove",X),C.addEventListener("pointerdown",X),()=>{C.removeEventListener("pointermove",X),C.removeEventListener("pointerdown",X),jt.current&&clearTimeout(jt.current)}},[Me,at]),s.useEffect(()=>{const C=X=>{X.key==="Escape"&&Te()};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[Te]),s.useLayoutEffect(()=>{_t()},[W,t.length,mt]),s.useLayoutEffect(()=>{o||Cn(N.current,"auto")},[W,o]),s.useLayoutEffect(()=>{Cn(0,"auto")},[t.length,mt]),s.useEffect(()=>{const C=De.current;if(!C||o||!Q)return;const X=ne=>{if(ne.preventDefault(),Math.abs(ne.deltaY)<=Math.abs(ne.deltaX))return;const $e=ne.deltaMode===1?By:ne.deltaMode===2?C.clientHeight:1,Fe=ne.deltaY*$e*jy;if(Fe!==0){if(nn(),pt.current||(pt.current=!0,je.current=C.scrollLeft,Ht.current=null,Tt(!1)),je.current+=Fe,!mt){const qe=C.scrollWidth-C.clientWidth;je.current=Math.max(0,Math.min(qe,je.current))}at(),ut.current===null&&(ut.current=requestAnimationFrame(ii))}};return C.addEventListener("wheel",X,{passive:!1}),()=>{C.removeEventListener("wheel",X),un()}},[o,Q,mt]),s.useEffect(()=>{const C=De.current;if(!C)return;const X=()=>{Wt(Je.current.isActive);const $e=C.scrollLeft,Fe=$e-_e.current;_e.current=$e;const qe=Ke.current>0?Ke.current*.5:1/0;if(Fe!==0&&Math.abs(Fe)<qe){const yt=Fe>0?"forward":"backward";yt!==Xe.current&&(Xe.current=yt,Re(yt))}Je.current.isActive&&Je.current.hasMoved||ft()};C.addEventListener("scroll",X,{passive:!0});const ne=new ResizeObserver(()=>{_t(),Wt(Je.current.isActive),Re(Xe.current),ft()});return ne.observe(C),()=>{nn(),C.removeEventListener("scroll",X),ne.disconnect()}},[t.length,mt]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ot||Te()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:bt?1:0,transition:`opacity ${bo}ms ease`,pointerEvents:bt?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Ot}}),a.jsxs("div",{ref:Ae,className:`${e}-lightbox-dismiss-area`,style:zt,...Bt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Et,onClick:C=>C.stopPropagation(),children:a.jsx("div",{ref:De,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":be&&t.length>0?"true":"false","data-mouse-dragging":Yt?"true":"false",onPointerDown:Xr,onPointerMove:Kr,onPointerUp:me,onPointerCancel:me,onLostPointerCapture:He,children:a.jsx("div",{ref:Ue,className:`${e}-lightbox-strip-track`,style:{gap:W},children:Kt.map((C,X)=>{const ne=C.image.objectFit??"contain",$e=X%t.length,Fe=Math.floor(X/t.length),qe=rr(W),yt=`calc(-0.5 * (${qe} + ${W}))`;return a.jsxs("div",{ref:Lt=>Be.current[X]=Lt,className:`${e}-strip-item`,style:{height:T==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:C.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:ne}}),o&&$e<t.length-1&&Fe===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:yt,width:qe,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Fe}-${C.image.url}-${$e}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":dn?"true":"false",style:Mt,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:D,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:le,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${J?` ${e}-lightbox-content-area-stacked`:""}`,children:(ye||b)&&a.jsx("div",{className:`${e}-header ${J?`${e}-header-two-row`:`${e}-header-single-row`}`,children:J?st():ye||b?gt():null})})})]}),t.length>1&&L==="on"&&(()=>{const C=rr(k),X=`calc(-0.5 * (${k} + ${C}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:k},children:a.jsx("div",{ref:Ce,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:ne=>ne.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":S,style:{gap:ee,"--thumbnail-active-color":H},children:[t.map((ne,$e)=>{const Fe=rr(ee),qe=`calc(-0.5 * (${Fe} + ${ee}))`;return a.jsxs("div",{ref:yt=>{Ne.current[$e]=yt},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":I===$e?"true":"false",onClick:()=>Q&&v==="click"&&Cn($e),onMouseEnter:()=>Ie&&v==="hover"&&Cn($e),"aria-label":ne.image.name?`View ${ne.image.name}`:`View image ${$e+1}`,"aria-current":I===$e?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${ue?` ${e}-thumb-image-cover`:""}`,src:ne.image.url,alt:"",draggable:!1,style:{...ge,maxWidth:z,maxHeight:z,width:f.display==="cover"?"auto":"100%",height:"auto",objectFit:f.display==="cover"?"cover":"contain"}})}),o&&$e<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:qe,width:Fe,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${ne.image.url}-${$e}`)}),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:X,height:C,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function iv(e){return`
13255
+ `;function zn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Ml={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Iy=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Py={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:zn("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:{...Ml.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:{...Ml.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:zn("Question Padding Left"),questionPaddingTop:zn("Question Padding Top"),questionPaddingBottom:zn("Question Padding Bottom"),answerPaddingLeft:zn("Answer Padding Left"),answerPaddingRight:zn("Answer Padding Right"),answerPaddingTop:zn("Answer Padding Top"),answerPaddingBottom:zn("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:[...Iy],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},My={element:Ly,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:Py,sourceCode:Ry},Nn=e=>e.display==="cover",Vr=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},El=100,Ey=.2,kl=8,vd=({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"?El:Math.max(El,window.innerHeight*Ey),[]),w=s.useCallback(v=>Math.max(0,1-v/(p*1.5)),[p]),b=s.useCallback(v=>Math.max(0,1-v/(p*.45)),[p]),h=s.useCallback(v=>{const k=typeof window<"u"?window.innerHeight:800,T=Math.max(.88,1-v/k*.12);return`translateY(${v}px) scale(${T})`},[]),g=s.useCallback(()=>{c.current=null},[]),m=s.useCallback(()=>{d(!0),r(0),window.setTimeout(()=>d(!1),n),g()},[n,g]),y=s.useCallback(()=>{const v=typeof window<"u"?window.innerHeight:800;d(!0),r(v),window.setTimeout(()=>{t(),g(),d(!1)},Math.min(n,200))},[n,t,g]),L=s.useCallback(v=>{!e||l||v.pointerType==="touch"&&(i!=null&&i(v.target)||(c.current={startX:v.clientX,startY:v.clientY,isLocked:null,pointerId:v.pointerId}))},[e,l,i]),f=s.useCallback(v=>{const k=c.current;if(!e||!k||v.pointerType!=="touch"||k.pointerId!==v.pointerId)return;const T=v.clientX-k.startX,D=v.clientY-k.startY;if(k.isLocked===null){if(Math.abs(T)<kl&&Math.abs(D)<kl)return;if(D>0&&D>Math.abs(T))k.isLocked=!0,v.currentTarget.setPointerCapture(v.pointerId);else{k.isLocked=!1,g();return}}if(!k.isLocked)return;v.preventDefault();const P=Math.max(0,D);u.current=P,r(P)},[e,g]),S=s.useCallback(v=>{const k=c.current;if(!e||!k||v.pointerType!=="touch"||k.pointerId!==v.pointerId)return;const T=k.isLocked===!0;if(v.currentTarget.hasPointerCapture(v.pointerId)&&v.currentTarget.releasePointerCapture(v.pointerId),!T){g();return}v.clientY-k.startY>=p?y():m()},[p,y,e,g,m]),H=s.useCallback(v=>{S(v)},[S]),I=s.useCallback(v=>{S(v)},[S]),R=o>0,$=l?`transform ${n}ms ease`:"none",x=l?`opacity ${n}ms ease`:"none",A=o>0||l;return{isSwipeDragging:R,backdropStyle:{opacity:w(o),transition:x},mediaAreaStyle:{transform:h(o),transition:$,touchAction:R?"none":void 0,willChange:R?"transform":void 0},overlayContentStyle:A?{opacity:b(o),transition:x}:void 0,swipeHandlers:e?{onPointerDown:L,onPointerMove:f,onPointerUp:H,onPointerCancel:I}:{},dismissAreaStyle:e?{touchAction:R?"none":"pan-x"}:void 0}},ky="[data-lightbox-scrollable]",xd=()=>{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(ky)||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"})}},[])},Ay=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Fy=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},_y=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Wy=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(g,m)=>{Fy(t),e.scrollLeft=g,m&&(r==null||r())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,w=0;const b=()=>{t.removeEventListener("transitionend",h),clearTimeout(w)},h=g=>{g.target!==t||g.propertyName!=="transform"||p||(p=!0,b(),u(n,!0))};return t.addEventListener("transitionend",h),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)`,w=window.setTimeout(()=>{p||(p=!0,b(),u(n,!0))},i+64),()=>{p||(p=!0,b(),u(l-_y(t),!1))}},bo=300,Ny=900,Hy=1500,Oy="cubic-bezier(0.16, 1, 0.3, 1)",Dy=3e3,jy=2,By=16,zy=.05,Vy=1,or=.3,Gy=50,Uy=20,Ti=.004,Xi=["title1","title2","title3"],qy={title1:"1",title2:"2",title3:"3"},Xy={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Ky={title1:.02,title2:.02,title3:.02},rr=e=>`max(${e}, ${Uy}px)`,Yy=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]}},Zy=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=Yy(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Dt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Jy=e=>[Dt(e,"fontFamily"),Dt(e,"fontSettings"),{type:"row",items:[Dt(e,"fontSize"),Dt(e,"lineHeight"),Dt(e,"letterSpacing"),Dt(e,"wordSpacing")]},Dt(e,"textAlign"),Dt(e,"textAppearance")],Qy=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Xi.map(e=>[qy[e],Jy(e)]))}),Is=(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},bd=(e,t)=>Is(e,t),ar=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Al=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Is(e.length,n),effective:bd(e.length,n)}},ev=(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},ga=(e,t)=>{const n=i=>{const o=Dt(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[Xy[t]]}},tv=(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),ha=(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??Ky[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return qt(i,n)},nv=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:w,closeIcon:b,closeIconMaxWidth:h,closeIconColor:g,closeIconHoverColor:m,thumbnailTrigger:y,thumbnailVisibility:L,thumbnailObjectFit:f,thumbnailActive:S,thumbnailActiveColor:H,title1Width:I,title2Width:R,title3Width:$,title1MarginLeft:x=0,title2MarginLeft:A=0,title3MarginLeft:v=0,titleRowMarginBottom:k=0,titleHeaderLayout:T="desktop",contentMarginTop:D,iconMarginLeft:P}=n,B=C=>_.scalingValue(C,i??!1),O=c??n.thumnailSize??.03,V=B(O),ee=B(u),E=B(p??.02),N=B(w??0),j=B(D??0),le=rr(j),ie=B(P??0),[W,ae]=s.useState(0),F=s.useRef(W);F.current=W;const J=t[W],{title1:Y,title2:Z,title3:ye}=Zy(J),se=ha("title1",ga(n,"title1"),i),re=ha("title2",ga(n,"title2"),i),z=ha("title3",ga(n,"title3"),i),Q=T==="mobile",te=!o&&(!i||r),Me=te,we=te,Ie=te,ue=Nn(f),ge=ue?{"--image-aspect-ratio":Vr(f)}:void 0,ve=!!(Y||Z||ye),q=s.useMemo(()=>ev(e,Y,Z,ye,se,re,z),[e,W,Y,Z,ye,se,re,z]),de=s.useMemo(()=>({title1Width:I,title2Width:R,title3Width:$}),[I,R,$]),he=s.useMemo(()=>q.map(C=>de[C.widthKey]),[q,de]),Se=s.useMemo(()=>Is(q.length,he),[q.length,he]),Pe=s.useMemo(()=>bd(q.length,he),[q.length,he]),Le=s.useMemo(()=>q.filter(C=>C.prefix==="title1"),[q]),G=s.useMemo(()=>q.filter(C=>C.prefix==="title2"||C.prefix==="title3"),[q]),fe=s.useMemo(()=>Al(Le,de),[Le,de]),ce=s.useMemo(()=>Al(G,de),[G,de]),U=s.useCallback((C,X)=>{const ne=q.indexOf(C);if(!Q||X==="single-row")return{effectiveWidth:Pe[ne]??0,resolvedWidth:Se[ne]??0,maxWidth:ar(ne,Se)};if(X==="two-row-top"){const Fe=Le.indexOf(C);return{effectiveWidth:fe.effective[Fe]??0,resolvedWidth:fe.resolved[Fe]??0,maxWidth:ar(Fe,fe.resolved)}}const $e=G.indexOf(C);return{effectiveWidth:ce.effective[$e]??0,resolvedWidth:ce.resolved[$e]??0,maxWidth:ar($e,ce.resolved)}},[G,ce,Pe,Se,q,Le,fe,Q]),oe=s.useCallback(C=>_.scalingValue(C,i??!1),[i]),Ee=oe(k??0),pe=s.useMemo(()=>({title1MarginLeft:x,title2MarginLeft:A,title3MarginLeft:v}),[x,A,v]),K=s.useCallback(C=>q.slice(0,C+1).reduce((X,ne,$e)=>X+(ne!=null&&ne.marginLeftKey?pe[ne.marginLeftKey]??0:0)+(Se[$e]??0),0)+(Q?0:x??0),[q,pe,Se,Q,x]),Ve=s.useCallback(()=>Q?0:x??0,[Q,x]),Oe=s.useCallback(C=>G.slice(0,C).reduce((X,ne,$e)=>X+(ne.marginLeftKey?pe[ne.marginLeftKey]??0:0)+(ce.resolved[$e]??0),0),[G,ce.resolved,pe]),lt=s.useCallback(C=>{const X=G[C];return Oe(C)+(X.marginLeftKey?pe[X.marginLeftKey]??0:0)+(ce.resolved[C]??0)},[G,ce.resolved,Oe,pe]),tt=(C,X)=>{const ne=C.marginLeftKey?pe[C.marginLeftKey]??0:0,{effectiveWidth:$e,resolvedWidth:Fe,maxWidth:qe}=U(C,X),yt=o&&X==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":C.prefix,style:{...X==="single-row"?{gridArea:C.prefix}:{},width:oe($e),...ne>0?{marginLeft:oe(ne)}:{}},children:[a.jsx("p",{className:C.className,style:C.style,children:C.text}),yt&&C.marginLeftKey&&a.jsx("div",{"data-controls":C.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Fe),style:{position:"absolute",top:0,left:oe(-ne),width:`max(${oe(ne)}, 10px)`,height:"100%",pointerEvents:"auto"}}),yt&&a.jsx("div",{"data-controls":C.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(qe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:oe(-Ti/2),width:oe(Ti),height:"100%",pointerEvents:"auto"}})]},C.className)},ht=()=>{const C=Q?-1:q.findIndex($e=>$e.prefix==="title1"),X=!Q&&(o||(x??0)>0)?(()=>{const $e=x??0,Fe=C>=0?Se[C]:I??0;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:`max(${oe($e)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,ne=q.flatMap(($e,Fe)=>{if(!$e.marginLeftKey)return[];const qe=pe[$e.marginLeftKey]??0,yt=tv(q,Se,pe,Fe)+Ve();return a.jsx("div",{"data-controls":$e.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Se[Fe]),style:{position:"absolute",top:0,left:oe(yt),width:`max(${oe(qe)}, 10px)`,height:"100%",pointerEvents:"auto"}},$e.marginLeftKey)});return X?[X,...ne]:ne},nt=()=>q.map((C,X)=>{const ne=ar(X,Se),Fe=K(X)-Ti/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":C.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ne),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:oe(Fe),width:oe(Ti),height:"100%",pointerEvents:"auto"}})},`${C.widthKey}-junction`)}),ze=()=>G.flatMap((C,X)=>{if(!C.marginLeftKey)return[];const ne=pe[C.marginLeftKey]??0,$e=Oe(X),{resolvedWidth:Fe}=U(C,"two-row-bottom");return a.jsx("div",{"data-controls":C.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Fe),style:{position:"absolute",top:0,left:oe($e),width:`max(${oe(ne)}, 10px)`,height:"100%",pointerEvents:"auto"}},C.marginLeftKey)}),be=()=>G.map((C,X)=>{const{maxWidth:ne}=U(C,"two-row-bottom"),Fe=lt(X)-Ti/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":C.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ne),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:oe(Fe),width:oe(Ti),height:"100%",pointerEvents:"auto"}})},`${C.widthKey}-junction`)}),Ae=s.useRef(null),De=s.useRef(null),Ue=s.useRef(null),Ce=s.useRef(null),Ne=s.useRef([]),Be=s.useRef([]),Ke=s.useRef(0),ct=s.useRef(null),Je=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),$t=s.useRef(null),dt=s.useRef(null),_e=s.useRef(0),Xe=s.useRef("forward"),je=s.useRef(0),ut=s.useRef(null),pt=s.useRef(!1),mt=t.length>1&&(!o||!!r),kt=mt?3:1,Kt=s.useMemo(()=>Array.from({length:kt},()=>t).flat(),[t,kt]),[Yt,vt]=s.useState(!1),[bt,Gt]=s.useState(!1),[Ft,xt]=s.useState(!0),Ht=s.useRef(null),Ut=s.useRef(null),Zt=s.useRef(!1),tn=s.useRef(!1),Ct=s.useRef(null),jt=s.useRef(null),dn=Me&&!Ft,at=s.useCallback(()=>{Me&&(xt(!0),jt.current&&clearTimeout(jt.current),jt.current=setTimeout(()=>{Je.current.isActive||xt(!1)},Dy))},[Me]),Te=s.useCallback(()=>{o||tn.current||(tn.current=!0,Gt(!1),Ct.current=setTimeout(()=>{l()},bo))},[o,l]),We=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":dn?"true":"false",style:{width:_.scalingValue(h??0,i),height:_.scalingValue(h??0,i),marginRight:ie,"--close-icon-hover-color":m},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Te,"aria-label":"Close",children:a.jsx(an,{url:b,fill:g,hoverFill:i&&!r?g:m,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:ie,height:"100%",pointerEvents:"auto"}})]}),Qe=(C="two-row")=>a.jsx("div",{...C==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:oe(x??0),flexShrink:0,...C==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...C==="two-row"&&o?{pointerEvents:"auto"}:{}}}),st=()=>{const C=q.find($e=>$e.prefix==="title1"),X=q.filter($e=>$e.prefix==="title2"||$e.prefix==="title3"),ne=X.length>0||o||(k??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(x??0)>0||o?Qe():null,C&&tt(C,"two-row-top"),b&&We()]}),ne?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[X.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[X.map($e=>tt($e,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[ze(),be()]})]}):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:Ee,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},gt=()=>a.jsxs(a.Fragment,{children:[(x??0)>0||o?Qe("single-row"):null,q.map(C=>tt(C,"single-row")),o?a.jsxs(a.Fragment,{children:[ht(),nt()]}):null,b?We():null]}),Rt=s.useCallback(C=>!!(C.closest("[data-controls]")||C.closest(`.${e}-thumbnails`)||C.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ot,backdropStyle:Ot,mediaAreaStyle:Et,overlayContentStyle:Mt,swipeHandlers:Bt,dismissAreaStyle:zt}=vd({enabled:te??!1,onClose:Te,animMs:bo,isBlockedTarget:Rt}),_t=()=>{if(!mt||t.length===0)return Ke.current=0,0;const C=Be.current[0],X=Be.current[t.length];if(!C||!X)return Ke.current;const ne=X.offsetLeft-C.offsetLeft;return ne>0&&(Ke.current=ne),Ke.current},Wt=(C=!1)=>{if(!mt)return;const X=De.current,ne=_t();!X||ne<=0||ne<X.clientWidth*.25||(X.scrollLeft<=0?(X.scrollLeft+=ne,C&&(Je.current.scrollLeft+=ne),pt.current&&(je.current+=ne)):X.scrollLeft>=ne*2&&(X.scrollLeft-=ne,C&&(Je.current.scrollLeft-=ne),pt.current&&(je.current-=ne)))},At=(C,X=(ne=>(ne=De.current)==null?void 0:ne.scrollLeft)()??0)=>{if(!mt)return C;let $e=t.length+C,Fe=1/0;for(let qe=0;qe<kt;qe++){const yt=qe*t.length+C,Lt=Be.current[yt];if(!Lt)continue;const en=Math.abs(Lt.offsetLeft-X);en<Fe&&(Fe=en,$e=yt)}return $e},wt=C=>{const X=De.current;return!C||!X?!1:C.offsetWidth>X.clientWidth+1},M=C=>{const X=De.current;if(!C||!X||!wt(C))return!1;const ne=C.offsetLeft,$e=ne+C.offsetWidth;return X.scrollLeft>=ne-1&&X.scrollLeft+X.clientWidth<=$e+1},xe=(C=(X=>(X=De.current)==null?void 0:X.scrollLeft)()??0)=>{for(let $e=0;$e<Be.current.length;$e+=1){const Fe=Be.current[$e];if(Fe&&M(Fe))return $e}let ne={flatIndex:0,distance:1/0};return Be.current.forEach(($e,Fe)=>{if(!$e)return;const qe=Math.abs($e.offsetLeft-C);qe<ne.distance&&(ne={flatIndex:Fe,distance:qe})}),ne.flatIndex},Re=C=>{De.current&&Be.current.forEach(X=>{X&&(X.style.scrollSnapAlign=wt(X)&&C==="backward"?"end":"start")})},ke=(C,X,ne)=>{const $e=C-X,Fe=xe(X),qe=Be.current[Fe];if(M(qe))return xe(C)%t.length;const yt=Be.current[Fe+1],Lt=qe?yt?yt.offsetLeft-qe.offsetLeft:qe.offsetWidth:0,en=Lt>0?$e>Lt*or?1:$e<-Lt*or?-1:0:0;return en===0?ne:mt?(ne+en+t.length)%t.length:Math.max(0,Math.min(t.length-1,ne+en))},et=s.useCallback((C=!1)=>{if(L!=="on"||o)return;const X=Ce.current,ne=F.current,$e=Ne.current[ne];if(!X||!$e||X.scrollWidth<=X.clientWidth)return;const Fe=X.scrollLeft,qe=Fe+X.clientWidth,yt=$e.offsetLeft,Lt=yt+$e.offsetWidth;if(yt>=Fe&&Lt<=qe)return;const en=X.scrollWidth-X.clientWidth;let Jt=Fe;if(!C&&Ht.current===null){const $i=Ne.current[ne-1],oo=Ne.current[ne+1],Xo=$i?$e.offsetLeft-$i.offsetLeft:oo?oo.offsetLeft-$e.offsetLeft:$e.offsetWidth;Lt>qe?Jt+=Xo:yt<Fe&&(Jt-=Xo)}else Lt>qe?Jt=Lt-X.clientWidth:Jt=yt;X.scrollLeft=Math.max(0,Math.min(en,Jt))},[o,L]),Pt=s.useCallback((C=!1)=>{C&&(Zt.current=!0),Ut.current===null&&(Ut.current=requestAnimationFrame(()=>{Ut.current=null;const X=Zt.current;Zt.current=!1,et(X)}))},[et]),Ye=s.useCallback(C=>{if(C===F.current)return;const X=F.current;F.current=C;const ne=Math.abs(C-X)>1,$e=mt&&t.length>1&&(X===t.length-1&&C===0||X===0&&C===t.length-1);ae(C),Pt(ne||$e)},[t.length,mt,Pt]),ft=()=>{if(!De.current||t.length===0||Ht.current!==null||Je.current.isActive&&Je.current.hasMoved)return;const C=De.current.scrollLeft,X=xe(C)%t.length;X!==F.current&&Ye(X)},Nt=()=>{Ht.current=null},Tt=C=>{const X=De.current;X&&(X.style.scrollSnapType=C?"":"none")},nn=()=>{var C;(C=dt.current)==null||C.call(dt),dt.current=null},un=()=>{ut.current!==null&&(cancelAnimationFrame(ut.current),ut.current=null),pt.current=!1},ii=()=>{const C=De.current;if(!C){ut.current=null,pt.current=!1;return}const X=je.current-C.scrollLeft;if(Math.abs(X)<.5){C.scrollLeft=je.current,Wt(),ft(),ut.current=null,pt.current=!1;return}C.scrollLeft+=X*zy,Wt(),ft(),at(),ut.current=requestAnimationFrame(ii)},oi=()=>{const C=Ue.current;C&&(C.style.transition="",C.style.transform="",C.style.willChange="")},Vo=(C,X,ne,$e)=>{oi(),C.scrollLeft=X,_e.current=C.scrollLeft,Wt(),ne!==void 0?(F.current=ne,ae(ne)):ft(),Tt(!0),$e==null||$e()},Go=(C,{behavior:X="smooth",activeIndex:ne,onComplete:$e}={})=>{const Fe=De.current,qe=Ue.current;if(!Fe||!qe)return;if(un(),nn(),Tt(!1),X==="auto"){Vo(Fe,C,ne,$e);return}const yt=Math.abs(C-Fe.scrollLeft),Lt=Ay(yt,Ny,Hy,Fe.clientWidth*.55);dt.current=Wy(Fe,qe,C,{duration:Lt,easing:Oy,onComplete:()=>{dt.current=null,Vo(Fe,C,ne,$e)}})},Ur=(C="smooth")=>{const X=De.current;if(!X||t.length===0)return;const ne=xe()%t.length,$e=At(ne,X.scrollLeft),Fe=Be.current[$e];Fe&&Go(Fe.offsetLeft,{behavior:C,activeIndex:ne})},qr=(C,X="smooth",ne,$e)=>{const Fe=De.current;if(!Fe||t.length===0)return;const qe=($e??Fe.scrollLeft)-C,yt=xe(C),Lt=Be.current[yt];if(M(Lt)){Tt(!0),ft();return}const en=Be.current[yt+1],Jt=Lt?en?en.offsetLeft-Lt.offsetLeft:Lt.offsetWidth:0;if((Jt>0?qe>Jt*or?1:qe<-Jt*or?-1:0:0)!==0){const Vd=ne??yt%t.length,Gd=ke($e??Fe.scrollLeft,C,Vd);Cn(Gd,X);return}const oo=$e??Fe.scrollLeft,Xo=xe(oo),Ms=Be.current[Xo];if(Ms&&Math.abs(Ms.offsetLeft-oo)<1){Tt(!0),ft();return}Ur("auto")},Cn=(C,X="smooth")=>{const ne=De.current;if(!ne||t.length===0)return;const $e=At(C,ne.scrollLeft),Fe=Be.current[$e];Fe&&(X==="smooth"?Ht.current=C:Ht.current=null,F.current=C,ae(C),Pt(!0),Go(Fe.offsetLeft,{behavior:X,activeIndex:C,onComplete:X==="smooth"?Nt:void 0}))},Si=()=>{$t.current&&(window.removeEventListener("pointerup",$t.current),window.removeEventListener("pointercancel",$t.current),$t.current=null)},Uo=(C,X,ne,$e,Fe)=>{const qe=ne-C,yt=$e-X,Lt=Math.abs(qe),en=Math.abs(yt);if(Lt<Gy||Lt<=en)return!1;const Jt=qe<0?1:-1,$i=mt?(Fe+Jt+t.length)%t.length:Math.max(0,Math.min(t.length-1,Fe+Jt));return $i===Fe?!1:(Cn($i),!0)},ri=C=>{if(!Je.current.isActive)return;Si();const X=De.current;if(!X)return;const{scrollLeft:ne,startActiveIndex:$e,hasMoved:Fe}=Je.current,qe=X.scrollLeft;Wt(!0),Je.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},vt(!1),C!==void 0&&X.hasPointerCapture(C)&&X.releasePointerCapture(C),Fe?qr(ne,"smooth",$e,qe):(Tt(!0),ft()),at()},qo=(C,X)=>{const ne=ct.current;ct.current=null,ne&&(Uo(ne.startX,ne.startY,C,X,ne.startActiveIndex),at())},Xr=C=>{if(!we)return;if(C.pointerType==="touch"){if(un(),Tt(!0),Rt(C.target))return;ct.current={startX:C.clientX,startY:C.clientY,startActiveIndex:F.current};return}if(C.pointerType!=="mouse"||C.button!==0||Rt(C.target))return;const X=De.current;if(!X)return;un(),nn(),oi(),Ht.current=null,Je.current={isActive:!0,startX:C.clientX,scrollLeft:X.scrollLeft,startActiveIndex:F.current,hasMoved:!1},Tt(!1),at(),X.setPointerCapture(C.pointerId),Si();const ne=$e=>{$e.pointerType==="mouse"&&ri($e.pointerId)};$t.current=ne,window.addEventListener("pointerup",ne),window.addEventListener("pointercancel",ne)},Kr=C=>{if(!we||C.pointerType!=="mouse")return;const X=De.current;if(!X||!Je.current.isActive)return;if(C.buttons===0){ri(C.pointerId);return}const ne=C.clientX-Je.current.startX;Math.abs(ne)>Vy&&(Je.current.hasMoved=!0,vt(!0)),Je.current.hasMoved&&(C.preventDefault(),X.scrollLeft=Je.current.scrollLeft-ne,Wt(!0),ft(),at())},me=C=>{if(we){if(C.pointerType==="touch"){C.type==="pointerup"?qo(C.clientX,C.clientY):ct.current=null;return}C.pointerType==="mouse"&&ri(C.pointerId)}},He=C=>{!we||C.pointerType!=="mouse"||ri(C.pointerId)};return xd(),s.useEffect(()=>{const C=requestAnimationFrame(()=>Gt(!0));return()=>{cancelAnimationFrame(C),nn(),Si(),Ut.current!==null&&(cancelAnimationFrame(Ut.current),Ut.current=null),Ct.current&&clearTimeout(Ct.current),jt.current&&clearTimeout(jt.current)}},[]),s.useEffect(()=>{if(!Me){xt(!0);return}at();const C=Ae.current;if(!C)return;const X=()=>at();return C.addEventListener("pointermove",X),C.addEventListener("pointerdown",X),()=>{C.removeEventListener("pointermove",X),C.removeEventListener("pointerdown",X),jt.current&&clearTimeout(jt.current)}},[Me,at]),s.useEffect(()=>{const C=X=>{X.key==="Escape"&&Te()};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[Te]),s.useLayoutEffect(()=>{_t()},[N,t.length,mt]),s.useLayoutEffect(()=>{o||Cn(F.current,"auto")},[N,o]),s.useLayoutEffect(()=>{Cn(0,"auto")},[t.length,mt]),s.useEffect(()=>{const C=De.current;if(!C||o||!te)return;const X=ne=>{if(ne.preventDefault(),Math.abs(ne.deltaY)<=Math.abs(ne.deltaX))return;const $e=ne.deltaMode===1?By:ne.deltaMode===2?C.clientHeight:1,Fe=ne.deltaY*$e*jy;if(Fe!==0){if(nn(),pt.current||(pt.current=!0,je.current=C.scrollLeft,Ht.current=null,Tt(!1)),je.current+=Fe,!mt){const qe=C.scrollWidth-C.clientWidth;je.current=Math.max(0,Math.min(qe,je.current))}at(),ut.current===null&&(ut.current=requestAnimationFrame(ii))}};return C.addEventListener("wheel",X,{passive:!1}),()=>{C.removeEventListener("wheel",X),un()}},[o,te,mt]),s.useEffect(()=>{const C=De.current;if(!C)return;const X=()=>{Wt(Je.current.isActive);const $e=C.scrollLeft,Fe=$e-_e.current;_e.current=$e;const qe=Ke.current>0?Ke.current*.5:1/0;if(Fe!==0&&Math.abs(Fe)<qe){const yt=Fe>0?"forward":"backward";yt!==Xe.current&&(Xe.current=yt,Re(yt))}Je.current.isActive&&Je.current.hasMoved||ft()};C.addEventListener("scroll",X,{passive:!0});const ne=new ResizeObserver(()=>{_t(),Wt(Je.current.isActive),Re(Xe.current),ft()});return ne.observe(C),()=>{nn(),C.removeEventListener("scroll",X),ne.disconnect()}},[t.length,mt]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ot||Te()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:bt?1:0,transition:`opacity ${bo}ms ease`,pointerEvents:bt?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Ot}}),a.jsxs("div",{ref:Ae,className:`${e}-lightbox-dismiss-area`,style:zt,...Bt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Et,onClick:C=>C.stopPropagation(),children:a.jsx("div",{ref:De,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":we&&t.length>0?"true":"false","data-mouse-dragging":Yt?"true":"false",onPointerDown:Xr,onPointerMove:Kr,onPointerUp:me,onPointerCancel:me,onLostPointerCapture:He,children:a.jsx("div",{ref:Ue,className:`${e}-lightbox-strip-track`,style:{gap:N},children:Kt.map((C,X)=>{const ne=C.image.objectFit??"contain",$e=X%t.length,Fe=Math.floor(X/t.length),qe=rr(N),yt=`calc(-0.5 * (${qe} + ${N}))`;return a.jsxs("div",{ref:Lt=>Be.current[X]=Lt,className:`${e}-strip-item`,style:{height:T==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:C.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:ne}}),o&&$e<t.length-1&&Fe===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:yt,width:qe,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Fe}-${C.image.url}-${$e}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":dn?"true":"false",style:Mt,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:j,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:le,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${Q?` ${e}-lightbox-content-area-stacked`:""}`,children:(ve||b)&&a.jsx("div",{className:`${e}-header ${Q?`${e}-header-two-row`:`${e}-header-single-row`}`,children:Q?st():ve||b?gt():null})})})]}),t.length>1&&L==="on"&&(()=>{const C=rr(E),X=`calc(-0.5 * (${E} + ${C}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:E},children:a.jsx("div",{ref:Ce,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:ne=>ne.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":S,style:{gap:ee,"--thumbnail-active-color":H},children:[t.map((ne,$e)=>{const Fe=rr(ee),qe=`calc(-0.5 * (${Fe} + ${ee}))`;return a.jsxs("div",{ref:yt=>{Ne.current[$e]=yt},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":W===$e?"true":"false",onClick:()=>te&&y==="click"&&Cn($e),onMouseEnter:()=>Ie&&y==="hover"&&Cn($e),"aria-label":ne.image.name?`View ${ne.image.name}`:`View image ${$e+1}`,"aria-current":W===$e?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${ue?` ${e}-thumb-image-cover`:""}`,src:ne.image.url,alt:"",draggable:!1,style:{...ge,maxWidth:V,maxHeight:V,width:f.display==="cover"?"auto":"100%",height:"auto",objectFit:f.display==="cover"?"cover":"contain"}})}),o&&$e<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:qe,width:Fe,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${ne.image.url}-${$e}`)}),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:X,height:C,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function iv(e){return`
13256
13256
  .${e}-wrapper {
13257
13257
  position: relative;
13258
13258
  width: 100%;
@@ -14183,7 +14183,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
14183
14183
  </>
14184
14184
  );
14185
14185
  };
14186
- `,av="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>'),di={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function sv(e){const t={};return t[Dt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Dt(e,"fontSettings")]={...di.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Dt(e,"fontSize")]={...di.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Dt(e,"lineHeight")]={...di.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Dt(e,"letterSpacing")]={...di.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Dt(e,"wordSpacing")]={...di.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Dt(e,"textAlign")]={...di.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Dt(e,"textAppearance")]={...di.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const lv=Xi.reduce((e,t)=>({...e,...sv(t)}),{}),cv=Xi.reduce((e,t)=>({...e,[Dt(t,"fontFamily")]:"Goudy Bookletter 1911",[Dt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Dt(t,"letterSpacing")]:0,[Dt(t,"wordSpacing")]:0,[Dt(t,"textAlign")]:"left",[Dt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function fa(e){return Xi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Dt(n,"fontSize")]=i),o!==void 0&&(t[Dt(n,"lineHeight")]=o),t},{})}const dv=Qy(),uv={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"}},...lv,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:av,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...cv},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,...fa({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,...fa({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,...fa({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:[dv]}],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"}]}},pv={element:ov,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:uv,sourceCode:rv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Xi.map(e=>({path:`${Dt(e,"fontFamily")}`}))]},fontRelations:{...Xi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Dt(t,"fontFamily")}`}),{})}},mv=({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:w,coverFit:b,backgroundColor:h,imageGap:g,maxWidth:m,maxHeight:v,textTransition:L,title1Width:f,title2Width:S,title3Width:H,title1MarginLeft:P=0,title2MarginLeft:R=0,title3MarginLeft:$=0,titleRowMarginBottom:x=0,titleHeaderLayout:A="single-row",countCloseGap:y=0,closeIcon:F,closeIconMaxWidth:T,closeIconColor:j,closeIconHoverColor:E,contentMarginTop:B=0,iconMarginRight:O=0}=n,z=s.useCallback(me=>_.scalingValue(me,i??!1),[i]),ee=z(g??0),k=`${m}%`,W=`${v}%`,D=z(y),le=z(B),Y=z(O),I=hi("title1",gi(n,"title1"),i),oe=hi("title2",gi(n,"title2"),i),N=hi("title3",gi(n,"title3"),i),ie=hi("count",gi(n,"count"),i),Z=A==="mobile",te=!i||!!r,Se=!o&&(!i||!!r),se=s.useMemo(()=>hr(t,w),[t,w]),[ae,V]=s.useState(l),J=se[ae],Q=J==null?void 0:J.entry,[Me,be]=s.useState(!1),[Ie,ue]=s.useState(null),[ge,ye]=s.useState(!1),[q,de]=s.useState(null),[he,we]=s.useState(!1),[Pe,Le]=s.useState(0),[G,fe]=s.useState(),[ce,U]=s.useState(),[re,Ee]=s.useState(null),pe=s.useRef(null),K=s.useRef(0),Ve=s.useRef(0),Oe=s.useRef(0),lt=s.useRef(!1),tt=s.useRef(null),ht=s.useRef(null),nt=s.useRef(null),ze=s.useRef(null),xe=s.useRef(null),Ae=s.useRef(null),De=s.useRef(null),Ue=s.useCallback(()=>{const me=ht.current;if(!me)return;const He=me.closest(`.${e}-lightbox-content-area`);if(!He)return me.getBoundingClientRect().width;const C=Array.from(He.children).reduce((X,ne)=>!(ne instanceof HTMLElement)||ne.contains(me)?X:X+ne.getBoundingClientRect().width,0);return He.getBoundingClientRect().width-C},[e]),Ce=s.useCallback(()=>{pe.current&&(clearTimeout(pe.current),pe.current=null)},[]),Ne=s.useCallback(me=>{me===K.current&&(de(null),we(!1))},[]),Be=s.useCallback(()=>{o||lt.current||(lt.current=!0,u==null||u(),be(!1),tt.current=setTimeout(()=>{p()},300))},[o,u,p]),Ke=s.useCallback(me=>!!(me.closest("[data-controls]")||me.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ct,backdropStyle:Je,mediaAreaStyle:$t,overlayContentStyle:dt,swipeHandlers:_e,dismissAreaStyle:Xe}=vd({enabled:Se,onClose:Be,animMs:300,isBlockedTarget:Ke}),je=s.useCallback(me=>{d&&ed(me+1,c,!0)},[d,c]),ut=s.useCallback(me=>{if(me)return me.getBoundingClientRect().height},[]),pt=s.useCallback(me=>{if(se.length===0)return;const He=(me%se.length+se.length)%se.length;if(He===ae)return;const C=se[ae],X=se[He];K.current+=1;const ne=K.current,$e=L==="fade"&&ll(C==null?void 0:C.entry)!==ll(X==null?void 0:X.entry),Fe=ut(nt.current),qe=$e?(()=>{const Lt=Ue();Dn.flushSync(()=>{Ee(X.entry)}),nt.current&&Lt&&(nt.current.style.width=`${Lt}px`);const en=ut(nt.current);return nt.current&&(nt.current.style.width=""),{measuredIncomingTitlesHeight:en,incomingTitlesMeasureWidth:Lt}})():void 0,yt=Math.max(Fe??0,(qe==null?void 0:qe.measuredIncomingTitlesHeight)??0)||void 0;Le(ne),de(ae),we(!0),V(He),je(He),Oe.current=He,$e?(Ce(),yt&&fe(yt),qe!=null&&qe.incomingTitlesMeasureWidth&&U(qe.incomingTitlesMeasureWidth),ue((C==null?void 0:C.entryIndex)??null),ye(!0),Ve.current=X.entryIndex,pe.current=setTimeout(()=>{ue(null),ye(!1),fe(void 0),U(void 0),Ee(null),pe.current=null},400)):(Ce(),ue(null),ye(!1),fe(void 0),U(void 0),Ee(null),Ve.current=X.entryIndex)},[ae,Ce,Ue,ut,se,je,L]),mt=s.useCallback(()=>{De.current=null},[]),kt=s.useCallback(me=>{!te||se.length<=1||me.pointerType==="mouse"&&me.button!==0||me.target.closest("[data-controls]")||(De.current={startX:me.clientX,startY:me.clientY,pointerId:me.pointerId})},[te,se.length]),Kt=s.useCallback(me=>{var Lt;if(!te||se.length<=1||me.pointerType==="mouse"&&me.button!==0)return;if(ct){mt();return}const He=De.current;if(!He||He.pointerId!==me.pointerId||(mt(),me.target.closest("[data-controls]")))return;const X=me.clientX-He.startX,ne=me.clientY-He.startY,$e=Math.abs(X),Fe=Math.abs(ne);if($e>=Ch&&$e>Fe){pt(X>0?ae-1:ae+1);return}if($e>ol||Fe>ol)return;const qe=(Lt=ze.current)==null?void 0:Lt.getBoundingClientRect(),yt=qe?qe.left+qe.width/2:window.innerWidth/2;pt(me.clientX<yt?ae-1:ae+1)},[ae,te,pt,ct,mt,se.length]),Yt=s.useCallback(me=>{const He=De.current;(He==null?void 0:He.pointerId)===me.pointerId&&mt()},[mt]);xd(),s.useEffect(()=>{Ae.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const me=requestAnimationFrame(()=>{be(!0),requestAnimationFrame(()=>{xe.current?xe.current.focus():ze.current&&ze.current.focus()})});return()=>{cancelAnimationFrame(me),tt.current&&clearTimeout(tt.current),pe.current&&clearTimeout(pe.current);const He=Ae.current;He&&document.contains(He)&&He.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var me;L!=="fade"&&(Ve.current=((me=se[ae])==null?void 0:me.entryIndex)??0,Ce(),ue(null),ye(!1),fe(void 0),U(void 0))},[ae,Ce,se,L]),s.useEffect(()=>{const me=He=>{if(He.key==="Escape"){Be();return}if(He.key==="ArrowLeft"&&se.length>1){pt(ae-1);return}if(He.key==="ArrowRight"&&se.length>1){pt(ae+1);return}if(He.key==="Tab"&&ze.current){const C=ze.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),X=Array.from(C).filter(qe=>!qe.closest('[aria-hidden="true"]'));if(X.length===0)return;const ne=X[0],$e=X[X.length-1],Fe=document.activeElement;He.shiftKey?(Fe===ne||!ze.current.contains(Fe))&&(He.preventDefault(),$e.focus()):(Fe===$e||!ze.current.contains(Fe))&&(He.preventDefault(),ne.focus())}};return window.addEventListener("keydown",me),()=>window.removeEventListener("keydown",me)},[pt,Be,ae,se.length]),s.useLayoutEffect(()=>{Ce(),K.current=0,Le(0),de(null),we(!1),ue(null),ye(!1),fe(void 0),U(void 0),Ee(null),V(me=>{const He=Math.max(0,se.length-1);return Math.min(me,He)})},[Ce,t.length,w,se.length]),s.useLayoutEffect(()=>{var C;const me=Math.max(0,se.length-1),He=Math.min(Math.max(0,l),me);Oe.current=He,Ve.current=((C=se[He])==null?void 0:C.entryIndex)??0,V(He)},[l]);const vt=Ie!==null?t[Ie]:null,bt=q!==null?se[q]:null,Gt=(Q==null?void 0:Q.title1)||(Q==null?void 0:Q.title2)||(Q==null?void 0:Q.title3)||(vt==null?void 0:vt.title1)||(vt==null?void 0:vt.title2)||(vt==null?void 0:vt.title3),Ft=kh(w,se,t),xt=F!==null,Ht=Gt||Ft||xt,Ut=Ft&&xt?{gap:D}:void 0,Zt=`${e}-titles-stack${Z?` ${e}-titles-stack-stacked`:""}`,tn=`${e}-titles-layer-out${Z?` ${e}-titles-layer-out-stacked`:""}`,Ct=`${e}-titles-layer-out`,jt=(P??0)>0||o,dn=z(x),at=s.useMemo(()=>({title1Width:f??Wi.title1Width,title2Width:S??Wi.title2Width,title3Width:H??Wi.title3Width}),[f,S,H]),Te=s.useMemo(()=>({title2MarginLeft:R,title3MarginLeft:$}),[R,$]),We=s.useMemo(()=>Q?Xn(e,Q,I,oe,N):[],[e,Q,I,oe,N]),Qe=s.useMemo(()=>We.map(me=>at[me.widthKey]),[We,at]),st=s.useMemo(()=>Bi(We.length,Qe),[We.length,Qe]),gt=s.useMemo(()=>Io(We.length,Qe),[We.length,Qe]),Rt=s.useMemo(()=>We.filter(me=>me.prefix==="title1"),[We]),ot=s.useMemo(()=>We.filter(me=>me.prefix==="title2"||me.prefix==="title3"),[We]),Ot=s.useMemo(()=>Kn(Rt,at),[Rt,at]),Et=s.useMemo(()=>Kn(ot,at),[ot,at]),Mt=s.useCallback((me,He)=>{const C=We.findIndex(ne=>ne.prefix===me.prefix);if(!Z||He==="single-row")return{effectiveWidth:gt[C]??0,resolvedWidth:st[C]??0,maxWidth:ln(C,st)};if(He==="two-row-top"){const ne=Rt.findIndex($e=>$e.prefix===me.prefix);return{effectiveWidth:Ot.effective[ne]??0,resolvedWidth:Ot.resolved[ne]??0,maxWidth:ln(ne,Ot.resolved)}}const X=ot.findIndex(ne=>ne.prefix===me.prefix);return{effectiveWidth:Et.effective[X]??0,resolvedWidth:Et.resolved[X]??0,maxWidth:ln(X,Et.resolved)}},[We,ot,Et,gt,st,Rt,Ot,Z]),Bt=s.useCallback(me=>od(We,st,Te,me)+(Z?0:P??0),[We,st,Te,Z,P]),zt=s.useCallback(()=>Z?0:P??0,[Z,P]),_t=s.useCallback(me=>ot.slice(0,me).reduce((He,C,X)=>He+(C.marginLeftKey?Te[C.marginLeftKey]??0:0)+(Et.resolved[X]??0),0),[ot,Et.resolved,Te]),Wt=s.useCallback(me=>{const He=ot[me];return _t(me)+(He.marginLeftKey?Te[He.marginLeftKey]??0:0)+(Et.resolved[me]??0)},[ot,Et.resolved,_t,Te]),At=s.useCallback((me,He,C)=>{if(!Z||C==="single-row"){const qe=me.findIndex(Jt=>Jt.prefix===He.prefix),yt=me.map(Jt=>at[Jt.widthKey]),Lt=Bi(me.length,yt);return{effectiveWidth:Io(me.length,yt)[qe]??0,resolvedWidth:Lt[qe]??0,maxWidth:ln(qe,Lt)}}if(C==="two-row-top"){const qe=me.filter(Jt=>Jt.prefix==="title1"),yt=qe.findIndex(Jt=>Jt.prefix===He.prefix),{resolved:Lt,effective:en}=Kn(qe,at);return{effectiveWidth:en[yt]??0,resolvedWidth:Lt[yt]??0,maxWidth:ln(yt,Lt)}}const X=me.filter(qe=>qe.prefix==="title2"||qe.prefix==="title3"),ne=X.findIndex(qe=>qe.prefix===He.prefix),{resolved:$e,effective:Fe}=Kn(X,at);return{effectiveWidth:Fe[ne]??0,resolvedWidth:$e[ne]??0,maxWidth:ln(ne,$e)}},[at,Z]),wt=(me,He,C)=>{const X=me.marginLeftKey?Te[me.marginLeftKey]??0:0,{effectiveWidth:ne,resolvedWidth:$e,maxWidth:Fe}=C??Mt(me,He),qe=Math.max(X,qn),yt=o&&He==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":me.prefix,style:{width:z(ne),...X>0?{marginLeft:z(X)}:{}},children:[a.jsx("p",{className:me.className,style:me.style,children:me.text}),yt&&me.marginLeftKey?a.jsx("div",{"data-controls":me.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String($e),style:{position:"absolute",top:0,left:z(-X),width:z(qe),height:"100%",pointerEvents:"auto"}}):null,yt?a.jsx("div",{"data-controls":me.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,right:z(-fn/2),width:z(fn),height:"100%",pointerEvents:"auto"}}):null]},me.className)},M=(me="two-row")=>{const He=We.findIndex(ne=>ne.prefix==="title1"),C=He>=0?st[He]:at.title1Width,X=me==="two-row"&&o;return a.jsx("div",{...X?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(C)}:{},style:{width:z(P??0),flexShrink:0,alignSelf:"stretch",...X?{pointerEvents:"auto"}:{}}})},ve=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:I,"aria-hidden":"true",children:" "}),Re=()=>a.jsx("span",{className:`${e}-entry-counter`,style:ie,"aria-live":"polite","aria-atomic":"true",children:Eh(se,ae,w,t)}),ke=()=>Ft?o&&xt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Re(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${aa(D)} + ${D}))`,width:aa(D),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Re():null,et=()=>!Ft&&!xt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Ut,children:[ke(),xt?ft():null]}),Pt=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ft||Gt?ve():null,jt?M("single-row"):null,Tt(Q),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),et(),Cn()]}),Ye=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ft||Gt?ve():null,jt?M("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:ge&&G?{minHeight:G}:void 0,children:[a.jsx("div",{ref:nt,className:Zt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:oi(re||Q)}),a.jsxs("div",{ref:ht,className:Zt,style:{position:ge?"absolute":"relative",inset:ge?0:void 0,width:"100%",...ge&&ce?{width:ce,maxWidth:"100%"}:void 0},children:[vt&&ge?a.jsx("div",{className:`${tn} ${e}-titles-fade-out`,children:oi(vt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${ge?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:oi(Q)})]})]}),et(),Cn()]}),ft=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:_.scalingValue(T??0,i),height:_.scalingValue(T??0,i),marginRight:Y,"--close-icon-hover-color":E},children:[a.jsx("button",{ref:xe,type:"button",className:`${e}-close-icon-inner`,onClick:Be,"aria-label":"Close",children:a.jsx(an,{url:F??"",fill:j,hoverFill:i&&!r?j:E,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"}})]}),Nt=(me,He)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[Ft||Gt?ve():null,jt?M("two-row"):null,He!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:He},children:me}):a.jsxs(a.Fragment,{children:[me,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),et()]}),Tt=me=>{if(!me)return null;const He=Xn(e,me,I,oe,N);return a.jsx(a.Fragment,{children:He.map(C=>wt(C,"single-row",At(He,C,"single-row")))})},nn=me=>{if(!me)return null;const He=Xn(e,me,I,oe,N),C=He.find(X=>X.prefix==="title1");return C?wt(C,"two-row-top",At(He,C,"two-row-top")):null},un=(me,He=!1)=>{const C=me?Xn(e,me,I,oe,N):[],X=C.filter(Fe=>Fe.prefix==="title2"||Fe.prefix==="title3"),ne=o&&He;return X.length>0||ne||(x??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[X.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[X.map(Fe=>wt(Fe,"two-row-bottom",At(C,Fe,"two-row-bottom"))),He&&o?a.jsxs(a.Fragment,{children:[Ur(),qr()]}):null]}):null,(x??0)>0||ne?a.jsx("div",{"data-controls":ne?"titleRowMarginBottom":void 0,"data-controls-axis":ne?"y":void 0,"data-controls-reverse":ne?"":void 0,className:ne?`${e}-control`:void 0,style:{height:dn,width:"100%",flexShrink:0,pointerEvents:ne?"auto":"none"}}):null]}):null},ii=(me,He=!1)=>a.jsxs(a.Fragment,{children:[Nt(nn(me)),un(me,He)]}),oi=me=>Z?a.jsx("div",{className:`${e}-titles-row-two-row`,children:ii(me)}):me?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Tt(me)}):null,Vo=()=>{const me=Z?-1:We.findIndex(X=>X.prefix==="title1"),He=!Z&&(o||(P??0)>0)?(()=>{const X=P??0,ne=me>=0?st[me]:at.title1Width,$e=Math.max(X,qn);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ne),style:{position:"absolute",top:0,left:0,width:z($e),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,C=We.flatMap((X,ne)=>{if(!X.marginLeftKey)return[];const $e=Te[X.marginLeftKey]??0,Fe=id(We,st,Te,ne)+zt(),qe=Math.max($e,qn);return a.jsx("div",{"data-controls":X.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(st[ne]),style:{position:"absolute",top:0,left:z(Fe),width:z(qe),height:"100%",pointerEvents:"auto"}},X.marginLeftKey)});return He?[He,...C]:C},Go=()=>We.map((me,He)=>{const C=ln(He,st),ne=Bt(He)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":me.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(C),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:z(ne),width:z(fn),height:"100%",pointerEvents:"auto"}})},`${me.widthKey}-junction`)}),Ur=()=>ot.flatMap((me,He)=>{if(!me.marginLeftKey)return[];const C=Te[me.marginLeftKey]??0,X=_t(He),ne=Math.max(C,qn),{resolvedWidth:$e}=Mt(me,"two-row-bottom");return a.jsx("div",{"data-controls":me.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String($e),style:{position:"absolute",top:0,left:z(X),width:z(ne),height:"100%",pointerEvents:"auto"}},me.marginLeftKey)}),qr=()=>ot.map((me,He)=>{const{maxWidth:C}=Mt(me,"two-row-bottom"),ne=Wt(He)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":me.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(C),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:z(ne),width:z(fn),height:"100%",pointerEvents:"auto"}})},`${me.widthKey}-junction`)}),Cn=()=>!o||Z?null:a.jsxs(a.Fragment,{children:[Vo(),Go()]}),Si=me=>{const He=!me.objectFit&&Nn(b);return{className:`${e}-slide-image-cell${He?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:k,maxHeight:W,...He?{"--image-aspect-ratio":Vr(b)}:{}}}},Uo=me=>me.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":me.objectFit}}:Nn(b)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ri=me=>{if(me.length===0)return null;const He=me.length>1,C=aa(ee),X=`calc(-0.5 * (${C} + ${ee}))`;if(me.length===1){const ne=me[0];return a.jsx("div",{...Si(ne),children:a.jsx("img",{...Uo(ne),src:ne.url,alt:ne.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:He?{gap:ee}:void 0,children:me.map((ne,$e)=>a.jsxs("div",{...Si(ne),children:[a.jsx("img",{...Uo(ne),src:ne.url,alt:ne.name??"",draggable:!1}),o&&He&&$e<me.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:X,width:C,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${ne.url}-${$e}`))})},qo=!!(Q!=null&&Q.title2||Q!=null&&Q.title3||vt!=null&&vt.title2||vt!=null&&vt.title3||(x??0)>0||o),Xr=()=>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:nt,className:Zt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ii(re||Q)}),a.jsxs("div",{ref:ht,className:`${e}-titles-row-two-row`,style:{...ge&&G?{minHeight:G}:void 0,...ge&&ce?{width:ce,maxWidth:"100%"}:void 0},children:[Nt(a.jsxs("div",{className:Zt,style:{position:ge?"absolute":"relative",inset:ge?0:void 0,width:"100%"},children:[vt&&ge?a.jsx("div",{className:`${Ct} ${e}-titles-fade-out`,children:nn(vt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${ge?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:nn(Q)})]}),ge&&G?G:void 0),qo?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[vt&&ge?a.jsx("div",{className:`${tn} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:un(vt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${ge?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${Z?` ${e}-titles-layer-in-stacked`:""}`,children:un(Q,!0)})]}):null]})]}),Kr=()=>{const me=qo;return a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...me?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:me?void 0:{flex:"0 0 auto",height:"auto"},children:ii(Q,!0)}),Cn()]})};return a.jsxs("div",{ref:ze,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ct||Be()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:xt?void 0:-1,style:{opacity:Me?1:0,transition:"opacity 300ms ease",pointerEvents:Me?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:h,...Je}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Xe,..._e,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:$t,onClick:me=>me.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":te&&se.length>1?"true":"false",onPointerDown:te?kt:void 0,onPointerUp:te?Kt:void 0,onPointerCancel:te?Yt:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[bt&&he?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:me=>{me.target===me.currentTarget&&Ne(Pe)},children:a.jsx("div",{className:`${e}-slide-area`,children:ri(bt.images)})},`slide-out-${Pe}`):null,a.jsx("div",{className:`${e}-slide-layer-in${he?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:J?ri(J.images):null})},`slide-in-${Pe}-${ae}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:dt,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:le,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...Z?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${Z?` ${e}-lightbox-content-area-stacked`:""}`,children:Ht&&a.jsx("div",{className:`${e}-text-bar-cell${Z?` ${e}-text-bar-cell-stacked`:""}`,style:Z?void 0:{flex:1,minWidth:0,width:"100%"},children:Z?L==="fade"?Xr():Kr():L==="fade"?Ye():Pt()})})})]})]})]})};function gv(e){return`
14186
+ `,av="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>'),di={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function sv(e){const t={};return t[Dt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Dt(e,"fontSettings")]={...di.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Dt(e,"fontSize")]={...di.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Dt(e,"lineHeight")]={...di.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Dt(e,"letterSpacing")]={...di.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Dt(e,"wordSpacing")]={...di.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Dt(e,"textAlign")]={...di.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Dt(e,"textAppearance")]={...di.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const lv=Xi.reduce((e,t)=>({...e,...sv(t)}),{}),cv=Xi.reduce((e,t)=>({...e,[Dt(t,"fontFamily")]:"Goudy Bookletter 1911",[Dt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Dt(t,"letterSpacing")]:0,[Dt(t,"wordSpacing")]:0,[Dt(t,"textAlign")]:"left",[Dt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function fa(e){return Xi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Dt(n,"fontSize")]=i),o!==void 0&&(t[Dt(n,"lineHeight")]=o),t},{})}const dv=Qy(),uv={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"}},...lv,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:av,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...cv},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,...fa({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,...fa({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,...fa({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:[dv]}],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"}]}},pv={element:ov,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:uv,sourceCode:rv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Xi.map(e=>({path:`${Dt(e,"fontFamily")}`}))]},fontRelations:{...Xi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Dt(t,"fontFamily")}`}),{})}},mv=({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:w,coverFit:b,backgroundColor:h,imageGap:g,maxWidth:m,maxHeight:y,textTransition:L,title1Width:f,title2Width:S,title3Width:H,title1MarginLeft:I=0,title2MarginLeft:R=0,title3MarginLeft:$=0,titleRowMarginBottom:x=0,titleHeaderLayout:A="single-row",countCloseGap:v=0,closeIcon:k,closeIconMaxWidth:T,closeIconColor:D,closeIconHoverColor:P,contentMarginTop:B=0,iconMarginRight:O=0}=n,V=s.useCallback(me=>_.scalingValue(me,i??!1),[i]),ee=V(g??0),E=`${m}%`,N=`${y}%`,j=V(v),le=V(B),ie=V(O),W=hi("title1",gi(n,"title1"),i),ae=hi("title2",gi(n,"title2"),i),F=hi("title3",gi(n,"title3"),i),J=hi("count",gi(n,"count"),i),Y=A==="mobile",Z=!i||!!r,ye=!o&&(!i||!!r),se=s.useMemo(()=>hr(t,w),[t,w]),[re,z]=s.useState(l),Q=se[re],te=Q==null?void 0:Q.entry,[Me,we]=s.useState(!1),[Ie,ue]=s.useState(null),[ge,ve]=s.useState(!1),[q,de]=s.useState(null),[he,Se]=s.useState(!1),[Pe,Le]=s.useState(0),[G,fe]=s.useState(),[ce,U]=s.useState(),[oe,Ee]=s.useState(null),pe=s.useRef(null),K=s.useRef(0),Ve=s.useRef(0),Oe=s.useRef(0),lt=s.useRef(!1),tt=s.useRef(null),ht=s.useRef(null),nt=s.useRef(null),ze=s.useRef(null),be=s.useRef(null),Ae=s.useRef(null),De=s.useRef(null),Ue=s.useCallback(()=>{const me=ht.current;if(!me)return;const He=me.closest(`.${e}-lightbox-content-area`);if(!He)return me.getBoundingClientRect().width;const C=Array.from(He.children).reduce((X,ne)=>!(ne instanceof HTMLElement)||ne.contains(me)?X:X+ne.getBoundingClientRect().width,0);return He.getBoundingClientRect().width-C},[e]),Ce=s.useCallback(()=>{pe.current&&(clearTimeout(pe.current),pe.current=null)},[]),Ne=s.useCallback(me=>{me===K.current&&(de(null),Se(!1))},[]),Be=s.useCallback(()=>{o||lt.current||(lt.current=!0,u==null||u(),we(!1),tt.current=setTimeout(()=>{p()},300))},[o,u,p]),Ke=s.useCallback(me=>!!(me.closest("[data-controls]")||me.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ct,backdropStyle:Je,mediaAreaStyle:$t,overlayContentStyle:dt,swipeHandlers:_e,dismissAreaStyle:Xe}=vd({enabled:ye,onClose:Be,animMs:300,isBlockedTarget:Ke}),je=s.useCallback(me=>{d&&ed(me+1,c,!0)},[d,c]),ut=s.useCallback(me=>{if(me)return me.getBoundingClientRect().height},[]),pt=s.useCallback(me=>{if(se.length===0)return;const He=(me%se.length+se.length)%se.length;if(He===re)return;const C=se[re],X=se[He];K.current+=1;const ne=K.current,$e=L==="fade"&&ll(C==null?void 0:C.entry)!==ll(X==null?void 0:X.entry),Fe=ut(nt.current),qe=$e?(()=>{const Lt=Ue();Dn.flushSync(()=>{Ee(X.entry)}),nt.current&&Lt&&(nt.current.style.width=`${Lt}px`);const en=ut(nt.current);return nt.current&&(nt.current.style.width=""),{measuredIncomingTitlesHeight:en,incomingTitlesMeasureWidth:Lt}})():void 0,yt=Math.max(Fe??0,(qe==null?void 0:qe.measuredIncomingTitlesHeight)??0)||void 0;Le(ne),de(re),Se(!0),z(He),je(He),Oe.current=He,$e?(Ce(),yt&&fe(yt),qe!=null&&qe.incomingTitlesMeasureWidth&&U(qe.incomingTitlesMeasureWidth),ue((C==null?void 0:C.entryIndex)??null),ve(!0),Ve.current=X.entryIndex,pe.current=setTimeout(()=>{ue(null),ve(!1),fe(void 0),U(void 0),Ee(null),pe.current=null},400)):(Ce(),ue(null),ve(!1),fe(void 0),U(void 0),Ee(null),Ve.current=X.entryIndex)},[re,Ce,Ue,ut,se,je,L]),mt=s.useCallback(()=>{De.current=null},[]),kt=s.useCallback(me=>{!Z||se.length<=1||me.pointerType==="mouse"&&me.button!==0||me.target.closest("[data-controls]")||(De.current={startX:me.clientX,startY:me.clientY,pointerId:me.pointerId})},[Z,se.length]),Kt=s.useCallback(me=>{var Lt;if(!Z||se.length<=1||me.pointerType==="mouse"&&me.button!==0)return;if(ct){mt();return}const He=De.current;if(!He||He.pointerId!==me.pointerId||(mt(),me.target.closest("[data-controls]")))return;const X=me.clientX-He.startX,ne=me.clientY-He.startY,$e=Math.abs(X),Fe=Math.abs(ne);if($e>=Ch&&$e>Fe){pt(X>0?re-1:re+1);return}if($e>ol||Fe>ol)return;const qe=(Lt=ze.current)==null?void 0:Lt.getBoundingClientRect(),yt=qe?qe.left+qe.width/2:window.innerWidth/2;pt(me.clientX<yt?re-1:re+1)},[re,Z,pt,ct,mt,se.length]),Yt=s.useCallback(me=>{const He=De.current;(He==null?void 0:He.pointerId)===me.pointerId&&mt()},[mt]);xd(),s.useEffect(()=>{Ae.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const me=requestAnimationFrame(()=>{we(!0),requestAnimationFrame(()=>{be.current?be.current.focus():ze.current&&ze.current.focus()})});return()=>{cancelAnimationFrame(me),tt.current&&clearTimeout(tt.current),pe.current&&clearTimeout(pe.current);const He=Ae.current;He&&document.contains(He)&&He.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var me;L!=="fade"&&(Ve.current=((me=se[re])==null?void 0:me.entryIndex)??0,Ce(),ue(null),ve(!1),fe(void 0),U(void 0))},[re,Ce,se,L]),s.useEffect(()=>{const me=He=>{if(He.key==="Escape"){Be();return}if(He.key==="ArrowLeft"&&se.length>1){pt(re-1);return}if(He.key==="ArrowRight"&&se.length>1){pt(re+1);return}if(He.key==="Tab"&&ze.current){const C=ze.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),X=Array.from(C).filter(qe=>!qe.closest('[aria-hidden="true"]'));if(X.length===0)return;const ne=X[0],$e=X[X.length-1],Fe=document.activeElement;He.shiftKey?(Fe===ne||!ze.current.contains(Fe))&&(He.preventDefault(),$e.focus()):(Fe===$e||!ze.current.contains(Fe))&&(He.preventDefault(),ne.focus())}};return window.addEventListener("keydown",me),()=>window.removeEventListener("keydown",me)},[pt,Be,re,se.length]),s.useLayoutEffect(()=>{Ce(),K.current=0,Le(0),de(null),Se(!1),ue(null),ve(!1),fe(void 0),U(void 0),Ee(null),z(me=>{const He=Math.max(0,se.length-1);return Math.min(me,He)})},[Ce,t.length,w,se.length]),s.useLayoutEffect(()=>{var C;const me=Math.max(0,se.length-1),He=Math.min(Math.max(0,l),me);Oe.current=He,Ve.current=((C=se[He])==null?void 0:C.entryIndex)??0,z(He)},[l]);const vt=Ie!==null?t[Ie]:null,bt=q!==null?se[q]:null,Gt=(te==null?void 0:te.title1)||(te==null?void 0:te.title2)||(te==null?void 0:te.title3)||(vt==null?void 0:vt.title1)||(vt==null?void 0:vt.title2)||(vt==null?void 0:vt.title3),Ft=kh(w,se,t),xt=k!==null,Ht=Gt||Ft||xt,Ut=Ft&&xt?{gap:j}:void 0,Zt=`${e}-titles-stack${Y?` ${e}-titles-stack-stacked`:""}`,tn=`${e}-titles-layer-out${Y?` ${e}-titles-layer-out-stacked`:""}`,Ct=`${e}-titles-layer-out`,jt=(I??0)>0||o,dn=V(x),at=s.useMemo(()=>({title1Width:f??Wi.title1Width,title2Width:S??Wi.title2Width,title3Width:H??Wi.title3Width}),[f,S,H]),Te=s.useMemo(()=>({title2MarginLeft:R,title3MarginLeft:$}),[R,$]),We=s.useMemo(()=>te?Xn(e,te,W,ae,F):[],[e,te,W,ae,F]),Qe=s.useMemo(()=>We.map(me=>at[me.widthKey]),[We,at]),st=s.useMemo(()=>Bi(We.length,Qe),[We.length,Qe]),gt=s.useMemo(()=>Io(We.length,Qe),[We.length,Qe]),Rt=s.useMemo(()=>We.filter(me=>me.prefix==="title1"),[We]),ot=s.useMemo(()=>We.filter(me=>me.prefix==="title2"||me.prefix==="title3"),[We]),Ot=s.useMemo(()=>Kn(Rt,at),[Rt,at]),Et=s.useMemo(()=>Kn(ot,at),[ot,at]),Mt=s.useCallback((me,He)=>{const C=We.findIndex(ne=>ne.prefix===me.prefix);if(!Y||He==="single-row")return{effectiveWidth:gt[C]??0,resolvedWidth:st[C]??0,maxWidth:ln(C,st)};if(He==="two-row-top"){const ne=Rt.findIndex($e=>$e.prefix===me.prefix);return{effectiveWidth:Ot.effective[ne]??0,resolvedWidth:Ot.resolved[ne]??0,maxWidth:ln(ne,Ot.resolved)}}const X=ot.findIndex(ne=>ne.prefix===me.prefix);return{effectiveWidth:Et.effective[X]??0,resolvedWidth:Et.resolved[X]??0,maxWidth:ln(X,Et.resolved)}},[We,ot,Et,gt,st,Rt,Ot,Y]),Bt=s.useCallback(me=>od(We,st,Te,me)+(Y?0:I??0),[We,st,Te,Y,I]),zt=s.useCallback(()=>Y?0:I??0,[Y,I]),_t=s.useCallback(me=>ot.slice(0,me).reduce((He,C,X)=>He+(C.marginLeftKey?Te[C.marginLeftKey]??0:0)+(Et.resolved[X]??0),0),[ot,Et.resolved,Te]),Wt=s.useCallback(me=>{const He=ot[me];return _t(me)+(He.marginLeftKey?Te[He.marginLeftKey]??0:0)+(Et.resolved[me]??0)},[ot,Et.resolved,_t,Te]),At=s.useCallback((me,He,C)=>{if(!Y||C==="single-row"){const qe=me.findIndex(Jt=>Jt.prefix===He.prefix),yt=me.map(Jt=>at[Jt.widthKey]),Lt=Bi(me.length,yt);return{effectiveWidth:Io(me.length,yt)[qe]??0,resolvedWidth:Lt[qe]??0,maxWidth:ln(qe,Lt)}}if(C==="two-row-top"){const qe=me.filter(Jt=>Jt.prefix==="title1"),yt=qe.findIndex(Jt=>Jt.prefix===He.prefix),{resolved:Lt,effective:en}=Kn(qe,at);return{effectiveWidth:en[yt]??0,resolvedWidth:Lt[yt]??0,maxWidth:ln(yt,Lt)}}const X=me.filter(qe=>qe.prefix==="title2"||qe.prefix==="title3"),ne=X.findIndex(qe=>qe.prefix===He.prefix),{resolved:$e,effective:Fe}=Kn(X,at);return{effectiveWidth:Fe[ne]??0,resolvedWidth:$e[ne]??0,maxWidth:ln(ne,$e)}},[at,Y]),wt=(me,He,C)=>{const X=me.marginLeftKey?Te[me.marginLeftKey]??0:0,{effectiveWidth:ne,resolvedWidth:$e,maxWidth:Fe}=C??Mt(me,He),qe=Math.max(X,qn),yt=o&&He==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":me.prefix,style:{width:V(ne),...X>0?{marginLeft:V(X)}:{}},children:[a.jsx("p",{className:me.className,style:me.style,children:me.text}),yt&&me.marginLeftKey?a.jsx("div",{"data-controls":me.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String($e),style:{position:"absolute",top:0,left:V(-X),width:V(qe),height:"100%",pointerEvents:"auto"}}):null,yt?a.jsx("div",{"data-controls":me.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,right:V(-fn/2),width:V(fn),height:"100%",pointerEvents:"auto"}}):null]},me.className)},M=(me="two-row")=>{const He=We.findIndex(ne=>ne.prefix==="title1"),C=He>=0?st[He]:at.title1Width,X=me==="two-row"&&o;return a.jsx("div",{...X?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(C)}:{},style:{width:V(I??0),flexShrink:0,alignSelf:"stretch",...X?{pointerEvents:"auto"}:{}}})},xe=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:W,"aria-hidden":"true",children:" "}),Re=()=>a.jsx("span",{className:`${e}-entry-counter`,style:J,"aria-live":"polite","aria-atomic":"true",children:Eh(se,re,w,t)}),ke=()=>Ft?o&&xt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Re(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${aa(j)} + ${j}))`,width:aa(j),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Re():null,et=()=>!Ft&&!xt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Ut,children:[ke(),xt?ft():null]}),Pt=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ft||Gt?xe():null,jt?M("single-row"):null,Tt(te),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),et(),Cn()]}),Ye=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ft||Gt?xe():null,jt?M("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:ge&&G?{minHeight:G}:void 0,children:[a.jsx("div",{ref:nt,className:Zt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:oi(oe||te)}),a.jsxs("div",{ref:ht,className:Zt,style:{position:ge?"absolute":"relative",inset:ge?0:void 0,width:"100%",...ge&&ce?{width:ce,maxWidth:"100%"}:void 0},children:[vt&&ge?a.jsx("div",{className:`${tn} ${e}-titles-fade-out`,children:oi(vt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${ge?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:oi(te)})]})]}),et(),Cn()]}),ft=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:_.scalingValue(T??0,i),height:_.scalingValue(T??0,i),marginRight:ie,"--close-icon-hover-color":P},children:[a.jsx("button",{ref:be,type:"button",className:`${e}-close-icon-inner`,onClick:Be,"aria-label":"Close",children:a.jsx(an,{url:k??"",fill:D,hoverFill:i&&!r?D:P,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:ie,height:"100%",pointerEvents:"auto"}})]}),Nt=(me,He)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[Ft||Gt?xe():null,jt?M("two-row"):null,He!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:He},children:me}):a.jsxs(a.Fragment,{children:[me,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),et()]}),Tt=me=>{if(!me)return null;const He=Xn(e,me,W,ae,F);return a.jsx(a.Fragment,{children:He.map(C=>wt(C,"single-row",At(He,C,"single-row")))})},nn=me=>{if(!me)return null;const He=Xn(e,me,W,ae,F),C=He.find(X=>X.prefix==="title1");return C?wt(C,"two-row-top",At(He,C,"two-row-top")):null},un=(me,He=!1)=>{const C=me?Xn(e,me,W,ae,F):[],X=C.filter(Fe=>Fe.prefix==="title2"||Fe.prefix==="title3"),ne=o&&He;return X.length>0||ne||(x??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[X.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[X.map(Fe=>wt(Fe,"two-row-bottom",At(C,Fe,"two-row-bottom"))),He&&o?a.jsxs(a.Fragment,{children:[Ur(),qr()]}):null]}):null,(x??0)>0||ne?a.jsx("div",{"data-controls":ne?"titleRowMarginBottom":void 0,"data-controls-axis":ne?"y":void 0,"data-controls-reverse":ne?"":void 0,className:ne?`${e}-control`:void 0,style:{height:dn,width:"100%",flexShrink:0,pointerEvents:ne?"auto":"none"}}):null]}):null},ii=(me,He=!1)=>a.jsxs(a.Fragment,{children:[Nt(nn(me)),un(me,He)]}),oi=me=>Y?a.jsx("div",{className:`${e}-titles-row-two-row`,children:ii(me)}):me?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Tt(me)}):null,Vo=()=>{const me=Y?-1:We.findIndex(X=>X.prefix==="title1"),He=!Y&&(o||(I??0)>0)?(()=>{const X=I??0,ne=me>=0?st[me]:at.title1Width,$e=Math.max(X,qn);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ne),style:{position:"absolute",top:0,left:0,width:V($e),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,C=We.flatMap((X,ne)=>{if(!X.marginLeftKey)return[];const $e=Te[X.marginLeftKey]??0,Fe=id(We,st,Te,ne)+zt(),qe=Math.max($e,qn);return a.jsx("div",{"data-controls":X.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(st[ne]),style:{position:"absolute",top:0,left:V(Fe),width:V(qe),height:"100%",pointerEvents:"auto"}},X.marginLeftKey)});return He?[He,...C]:C},Go=()=>We.map((me,He)=>{const C=ln(He,st),ne=Bt(He)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":me.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(C),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:V(ne),width:V(fn),height:"100%",pointerEvents:"auto"}})},`${me.widthKey}-junction`)}),Ur=()=>ot.flatMap((me,He)=>{if(!me.marginLeftKey)return[];const C=Te[me.marginLeftKey]??0,X=_t(He),ne=Math.max(C,qn),{resolvedWidth:$e}=Mt(me,"two-row-bottom");return a.jsx("div",{"data-controls":me.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String($e),style:{position:"absolute",top:0,left:V(X),width:V(ne),height:"100%",pointerEvents:"auto"}},me.marginLeftKey)}),qr=()=>ot.map((me,He)=>{const{maxWidth:C}=Mt(me,"two-row-bottom"),ne=Wt(He)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":me.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(C),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:V(ne),width:V(fn),height:"100%",pointerEvents:"auto"}})},`${me.widthKey}-junction`)}),Cn=()=>!o||Y?null:a.jsxs(a.Fragment,{children:[Vo(),Go()]}),Si=me=>{const He=!me.objectFit&&Nn(b);return{className:`${e}-slide-image-cell${He?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:E,maxHeight:N,...He?{"--image-aspect-ratio":Vr(b)}:{}}}},Uo=me=>me.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":me.objectFit}}:Nn(b)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ri=me=>{if(me.length===0)return null;const He=me.length>1,C=aa(ee),X=`calc(-0.5 * (${C} + ${ee}))`;if(me.length===1){const ne=me[0];return a.jsx("div",{...Si(ne),children:a.jsx("img",{...Uo(ne),src:ne.url,alt:ne.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:He?{gap:ee}:void 0,children:me.map((ne,$e)=>a.jsxs("div",{...Si(ne),children:[a.jsx("img",{...Uo(ne),src:ne.url,alt:ne.name??"",draggable:!1}),o&&He&&$e<me.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:X,width:C,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${ne.url}-${$e}`))})},qo=!!(te!=null&&te.title2||te!=null&&te.title3||vt!=null&&vt.title2||vt!=null&&vt.title3||(x??0)>0||o),Xr=()=>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:nt,className:Zt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ii(oe||te)}),a.jsxs("div",{ref:ht,className:`${e}-titles-row-two-row`,style:{...ge&&G?{minHeight:G}:void 0,...ge&&ce?{width:ce,maxWidth:"100%"}:void 0},children:[Nt(a.jsxs("div",{className:Zt,style:{position:ge?"absolute":"relative",inset:ge?0:void 0,width:"100%"},children:[vt&&ge?a.jsx("div",{className:`${Ct} ${e}-titles-fade-out`,children:nn(vt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${ge?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:nn(te)})]}),ge&&G?G:void 0),qo?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[vt&&ge?a.jsx("div",{className:`${tn} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:un(vt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${ge?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${Y?` ${e}-titles-layer-in-stacked`:""}`,children:un(te,!0)})]}):null]})]}),Kr=()=>{const me=qo;return a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...me?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:me?void 0:{flex:"0 0 auto",height:"auto"},children:ii(te,!0)}),Cn()]})};return a.jsxs("div",{ref:ze,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ct||Be()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:xt?void 0:-1,style:{opacity:Me?1:0,transition:"opacity 300ms ease",pointerEvents:Me?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:h,...Je}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Xe,..._e,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:$t,onClick:me=>me.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":Z&&se.length>1?"true":"false",onPointerDown:Z?kt:void 0,onPointerUp:Z?Kt:void 0,onPointerCancel:Z?Yt:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[bt&&he?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:me=>{me.target===me.currentTarget&&Ne(Pe)},children:a.jsx("div",{className:`${e}-slide-area`,children:ri(bt.images)})},`slide-out-${Pe}`):null,a.jsx("div",{className:`${e}-slide-layer-in${he?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:Q?ri(Q.images):null})},`slide-in-${Pe}-${re}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:dt,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:le,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...Y?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${Y?` ${e}-lightbox-content-area-stacked`:""}`,children:Ht&&a.jsx("div",{className:`${e}-text-bar-cell${Y?` ${e}-text-bar-cell-stacked`:""}`,style:Y?void 0:{flex:1,minWidth:0,width:"100%"},children:Y?L==="fade"?Xr():Kr():L==="fade"?Ye():Pt()})})})]})]})]})};function gv(e){return`
14187
14187
  .${e}-wrapper {
14188
14188
  position: relative;
14189
14189
  width: 100%;
@@ -14705,7 +14705,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
14705
14705
  pointer-events: auto;
14706
14706
  z-index: 10;
14707
14707
  }
14708
- `}const hv=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r,metadata:l})=>{const{prefix:d}=_.useScopedStyles(),c=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:w}=e,b=s.useRef(null),[h,g]=s.useState(!1),[m,v]=s.useState(0),L=s.useRef(!1),f=s.useRef(!1),S=s.useRef(!1),H=s.useMemo(()=>(t??[]).filter(y=>ji(y).length>0),[t]),P=h&&H.length>0,R=!n,$=s.useCallback(()=>{R&&(S.current=!0,Lh(f.current,c),f.current=!1)},[R,c]),x=(y=0)=>{if(H.length===0||n&&!i&&!o)return;const F=hr(H,w),T=Math.max(0,Math.min(y,F.length-1));if(v(T),R){const j=td();ed(T+1,c,j),f.current=!j}g(!0)},A=s.useCallback(()=>{g(!1),S.current=!1},[]);return s.useEffect(()=>{!n||i||o||g(!1)},[n,i,o]),s.useEffect(()=>{if(!R||L.current)return;L.current=!0;const y=al(c);if(!y)return;const F=sl(y,hr(H,w).length);F<0||(v(F),g(!0))},[H,c,R,w]),s.useEffect(()=>{if(!R)return;const y=()=>{if(S.current){S.current=!1,g(!1);return}const F=al(c);if(!F){g(!1);return}const T=sl(F,hr(H,w).length);if(T<0){g(!1);return}f.current=!1,v(T),g(!0)};return window.addEventListener("popstate",y),()=>window.removeEventListener("popstate",y)},[H,c,R,w]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:b,className:`${d}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:gv(d)}}),u?a.jsx("button",{type:"button",className:`${d}-cover ${Nn(p)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>x(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...Nn(p)?{"--image-aspect-ratio":Vr(p)}:{}},"aria-label":"Open journal gallery",children:a.jsx("img",{className:`${d}-cover-image ${Nn(p)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),P&&typeof document<"u"&&(()=>{const y=(r?document.getElementById(r):null)??document.body;return Dn.createPortal(a.jsx(mv,{prefix:d,entries:H,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:m,enableUrlSync:R,journalItemId:c,onBeforeClose:$,onClose:A}),y)})()]})},fv=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
14708
+ `}const hv=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r,metadata:l})=>{const{prefix:d}=_.useScopedStyles(),c=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:w}=e,b=s.useRef(null),[h,g]=s.useState(!1),[m,y]=s.useState(0),L=s.useRef(!1),f=s.useRef(!1),S=s.useRef(!1),H=s.useMemo(()=>(t??[]).filter(v=>ji(v).length>0),[t]),I=h&&H.length>0,R=!n,$=s.useCallback(()=>{R&&(S.current=!0,Lh(f.current,c),f.current=!1)},[R,c]),x=(v=0)=>{if(H.length===0||n&&!i&&!o)return;const k=hr(H,w),T=Math.max(0,Math.min(v,k.length-1));if(y(T),R){const D=td();ed(T+1,c,D),f.current=!D}g(!0)},A=s.useCallback(()=>{g(!1),S.current=!1},[]);return s.useEffect(()=>{!n||i||o||g(!1)},[n,i,o]),s.useEffect(()=>{if(!R||L.current)return;L.current=!0;const v=al(c);if(!v)return;const k=sl(v,hr(H,w).length);k<0||(y(k),g(!0))},[H,c,R,w]),s.useEffect(()=>{if(!R)return;const v=()=>{if(S.current){S.current=!1,g(!1);return}const k=al(c);if(!k){g(!1);return}const T=sl(k,hr(H,w).length);if(T<0){g(!1);return}f.current=!1,y(T),g(!0)};return window.addEventListener("popstate",v),()=>window.removeEventListener("popstate",v)},[H,c,R,w]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:b,className:`${d}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:gv(d)}}),u?a.jsx("button",{type:"button",className:`${d}-cover ${Nn(p)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>x(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...Nn(p)?{"--image-aspect-ratio":Vr(p)}:{}},"aria-label":"Open journal gallery",children:a.jsx("img",{className:`${d}-cover-image ${Nn(p)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),I&&typeof document<"u"&&(()=>{const v=(r?document.getElementById(r):null)??document.body;return Dn.createPortal(a.jsx(mv,{prefix:d,entries:H,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:m,enableUrlSync:R,journalItemId:c,onBeforeClose:$,onClose:A}),v)})()]})},fv=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
14709
14709
  import { createPortal } from 'react-dom';
14710
14710
  import { CommonComponentProps } from '../props';
14711
14711
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -15496,7 +15496,7 @@ export type LightboxJournalSettings = {
15496
15496
  width: 32px;
15497
15497
  height: 32px;
15498
15498
  }
15499
- `}function Rv(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 Iv(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await Rv(i)]));return new Map(n)}function Pv({settings:e,content:t=[],isEditor:n}){const{prefix:i}=_.useScopedStyles(),[o,r]=s.useState(null),[l,d]=s.useState([]),[c,u]=s.useState(0),p=s.useRef(0),[w,b]=s.useState({x:0,y:0}),[h,g]=s.useState("none"),m=s.useRef({x:0,y:0}),[v,L]=s.useState(!1),[f,S]=s.useState(!1),H=s.useRef(new Map),{imageSize:P=Cv,cursor:R="system",target:$="area",position:x="random",visible:A="all",defaultCursor:y=null,hoverCursor:F=null}=e,T=t.filter(k=>{var W;return!!((W=k==null?void 0:k.image)!=null&&W.url)}),j=s.useMemo(()=>Lv(i),[i]),E=s.useCallback((k,W,D=l)=>{if(!o)return;const le=o.getBoundingClientRect(),Y=k-le.left,I=W-le.top;b({x:Y,y:I}),g(Tv(Y,I,D,o,R,$,F,y))},[o,l,R,$,F,y]);s.useEffect(()=>{const k=[...T.map(D=>D.image.url),y,F].filter(D=>!!D);if(k.length===0){H.current=new Map,S(!0);return}let W=!1;return S(!1),Iv(k).then(D=>{W||(H.current=D,S(!0))}),()=>{W=!0}},[t,y,F]),s.useEffect(()=>{if(!o)return;const k=D=>{D.stopPropagation(),m.current={x:D.clientX,y:D.clientY},E(D.clientX,D.clientY)},W=()=>{v&&E(m.current.x,m.current.y)};return o.addEventListener("mousemove",k),window.addEventListener("scroll",W,!0),()=>{o.removeEventListener("mousemove",k),window.removeEventListener("scroll",W,!0)}},[o,v,E]),s.useEffect(()=>{!o||!v||E(m.current.x,m.current.y)},[l,o,v,E]),s.useEffect(()=>{v||g("none")},[v]);const B=(k,W,D,le={})=>{var Z,te;if(!((Z=k==null?void 0:k.image)!=null&&Z.url))return null;const Y=((te=H.current.get(k.image.url))==null?void 0:te.aspectRatio)??1,I=_l(k.image.url,P,H.current),{heightPx:oe}=Ir(I,Y);let N=0,ie=0;return x==="same"?{x:N,y:ie}=Fl(W,D,I,Y):(N=le.x??Math.random()*W,ie=le.y??Math.random()*D,{x:N,y:ie}=ja(N,ie,W,D,I,oe)),{id:p.current++,url:k.image.url,link:k.link,name:k.image.name,x:N,y:ie,xRatio:N/W,yRatio:ie/D,aspectRatio:Y,widthPx:I}},O=()=>{if(!o)return;const k=o.getBoundingClientRect(),W=k.width,D=k.height;W===0||D===0||d(le=>le.length===0?le:le.map(Y=>{const I=P.sizeType==="random"?Y.widthPx:_l(Y.url,P,H.current),{heightPx:oe}=Ir(I,Y.aspectRatio);if(x==="same"){const{x:Z,y:te}=Fl(W,D,I,Y.aspectRatio);return{...Y,x:Z,y:te,widthPx:I}}const{x:N,y:ie}=ja(Y.xRatio*W,Y.yRatio*D,W,D,I,oe);return{...Y,x:N,y:ie,widthPx:I}}))};s.useEffect(()=>{if(!o||T.length===0||!f)return;const k=o.getBoundingClientRect(),W=k.width,D=k.height,le=B(T[0],W,D);le&&(d([le]),u(T.length>1?1:0))},[P,x,o,t,f]),s.useEffect(()=>{if(!o)return;O();const k=new ResizeObserver(O);return k.observe(o),window.addEventListener("resize",O),()=>{k.disconnect(),window.removeEventListener("resize",O)}},[o,x,P,l.length]),s.useEffect(()=>{A==="last One"&&d(k=>k.length>0?[k[k.length-1]]:[])},[A]);const z=k=>{if(!o||T.length===0||!f)return;const W=o.getBoundingClientRect(),D=k.clientX-W.left,le=k.clientY-W.top;if($==="image"&&!wd(D,le,l))return;let Y=0,I=0;x==="on Click"?(Y=D,I=le):x==="same"?(Y=W.width/2,I=W.height/2):(Y=Math.random()*W.width,I=Math.random()*W.height);const oe=T[c%T.length],N=B(oe,W.width,W.height,{x:Y,y:I});if(!N)return;const ie=A==="all"?[...l,N]:[N];d(ie),u(Z=>(Z+1)%T.length),E(k.clientX,k.clientY,ie)},ee=R==="custom"&&h!=="none";return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:j}}),a.jsxs("div",{ref:r,onClick:z,onMouseEnter:()=>L(!0),onMouseLeave:()=>L(!1),className:`${i}-root`,style:{cursor:ee?"none":"default"},children:[l.map(k=>a.jsx("div",{className:`${i}-wrapper`,style:{top:`${k.y}px`,left:`${k.x}px`,width:`${k.widthPx}px`,cursor:ee?"none":"default"},children:$==="area"&&k.link?a.jsx("a",{href:k.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:a.jsx("img",{src:k.url,alt:k.name,className:`${i}-image`})}):a.jsx("img",{src:k.url,alt:k.name,className:`${i}-image`})},k.id)),v&&ee&&a.jsx("div",{className:`${i}-cursor`,style:{left:`${w.x}px`,top:`${w.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${h}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const Mv=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
15499
+ `}function Rv(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 Iv(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await Rv(i)]));return new Map(n)}function Pv({settings:e,content:t=[],isEditor:n}){const{prefix:i}=_.useScopedStyles(),[o,r]=s.useState(null),[l,d]=s.useState([]),[c,u]=s.useState(0),p=s.useRef(0),[w,b]=s.useState({x:0,y:0}),[h,g]=s.useState("none"),m=s.useRef({x:0,y:0}),[y,L]=s.useState(!1),[f,S]=s.useState(!1),H=s.useRef(new Map),{imageSize:I=Cv,cursor:R="system",target:$="area",position:x="random",visible:A="all",defaultCursor:v=null,hoverCursor:k=null}=e,T=t.filter(E=>{var N;return!!((N=E==null?void 0:E.image)!=null&&N.url)}),D=s.useMemo(()=>Lv(i),[i]),P=s.useCallback((E,N,j=l)=>{if(!o)return;const le=o.getBoundingClientRect(),ie=E-le.left,W=N-le.top;b({x:ie,y:W}),g(Tv(ie,W,j,o,R,$,k,v))},[o,l,R,$,k,v]);s.useEffect(()=>{const E=[...T.map(j=>j.image.url),v,k].filter(j=>!!j);if(E.length===0){H.current=new Map,S(!0);return}let N=!1;return S(!1),Iv(E).then(j=>{N||(H.current=j,S(!0))}),()=>{N=!0}},[t,v,k]),s.useEffect(()=>{if(!o)return;const E=j=>{j.stopPropagation(),m.current={x:j.clientX,y:j.clientY},P(j.clientX,j.clientY)},N=()=>{y&&P(m.current.x,m.current.y)};return o.addEventListener("mousemove",E),window.addEventListener("scroll",N,!0),()=>{o.removeEventListener("mousemove",E),window.removeEventListener("scroll",N,!0)}},[o,y,P]),s.useEffect(()=>{!o||!y||P(m.current.x,m.current.y)},[l,o,y,P]),s.useEffect(()=>{y||g("none")},[y]);const B=(E,N,j,le={})=>{var Y,Z;if(!((Y=E==null?void 0:E.image)!=null&&Y.url))return null;const ie=((Z=H.current.get(E.image.url))==null?void 0:Z.aspectRatio)??1,W=_l(E.image.url,I,H.current),{heightPx:ae}=Ir(W,ie);let F=0,J=0;return x==="same"?{x:F,y:J}=Fl(N,j,W,ie):(F=le.x??Math.random()*N,J=le.y??Math.random()*j,{x:F,y:J}=ja(F,J,N,j,W,ae)),{id:p.current++,url:E.image.url,link:E.link,name:E.image.name,x:F,y:J,xRatio:F/N,yRatio:J/j,aspectRatio:ie,widthPx:W}},O=()=>{if(!o)return;const E=o.getBoundingClientRect(),N=E.width,j=E.height;N===0||j===0||d(le=>le.length===0?le:le.map(ie=>{const W=I.sizeType==="random"?ie.widthPx:_l(ie.url,I,H.current),{heightPx:ae}=Ir(W,ie.aspectRatio);if(x==="same"){const{x:Y,y:Z}=Fl(N,j,W,ie.aspectRatio);return{...ie,x:Y,y:Z,widthPx:W}}const{x:F,y:J}=ja(ie.xRatio*N,ie.yRatio*j,N,j,W,ae);return{...ie,x:F,y:J,widthPx:W}}))};s.useEffect(()=>{if(!o||T.length===0||!f)return;const E=o.getBoundingClientRect(),N=E.width,j=E.height,le=B(T[0],N,j);le&&(d([le]),u(T.length>1?1:0))},[I,x,o,t,f]),s.useEffect(()=>{if(!o)return;O();const E=new ResizeObserver(O);return E.observe(o),window.addEventListener("resize",O),()=>{E.disconnect(),window.removeEventListener("resize",O)}},[o,x,I,l.length]),s.useEffect(()=>{A==="last One"&&d(E=>E.length>0?[E[E.length-1]]:[])},[A]);const V=E=>{if(!o||T.length===0||!f)return;const N=o.getBoundingClientRect(),j=E.clientX-N.left,le=E.clientY-N.top;if($==="image"&&!wd(j,le,l))return;let ie=0,W=0;x==="on Click"?(ie=j,W=le):x==="same"?(ie=N.width/2,W=N.height/2):(ie=Math.random()*N.width,W=Math.random()*N.height);const ae=T[c%T.length],F=B(ae,N.width,N.height,{x:ie,y:W});if(!F)return;const J=A==="all"?[...l,F]:[F];d(J),u(Y=>(Y+1)%T.length),P(E.clientX,E.clientY,J)},ee=R==="custom"&&h!=="none";return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:D}}),a.jsxs("div",{ref:r,onClick:V,onMouseEnter:()=>L(!0),onMouseLeave:()=>L(!1),className:`${i}-root`,style:{cursor:ee?"none":"default"},children:[l.map(E=>a.jsx("div",{className:`${i}-wrapper`,style:{top:`${E.y}px`,left:`${E.x}px`,width:`${E.widthPx}px`,cursor:ee?"none":"default"},children:$==="area"&&E.link?a.jsx("a",{href:E.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:a.jsx("img",{src:E.url,alt:E.name,className:`${i}-image`})}):a.jsx("img",{src:E.url,alt:E.name,className:`${i}-image`})},E.id)),y&&ee&&a.jsx("div",{className:`${i}-cursor`,style:{left:`${w.x}px`,top:`${w.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${h}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const Mv=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
15500
15500
  import { CommonComponentProps } from '../props';
15501
15501
  import { useScopedStyles } from '../utils/index';
15502
15502
 
@@ -16136,7 +16136,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
16136
16136
  display: block;
16137
16137
  pointer-events: none;
16138
16138
  }
16139
- `}function Wv(e){return e==="blur"?Fv:e==="greyscale"?Av:0}function so(e,t=1,n=1){const i=Wv(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 Wl(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function Nv(e,t){return t<=1?0:(e-1+t)%t}function Hv(e,t=1){return!e||e.height===0?t:e.width/e.height}function Ov(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 Nl(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 Sd(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function Hl(e,t,n){return{...Sd(e),[`--${n}-stage-scale`]:t}}function Dv(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 jv({settings:e,content:t,isEditor:n,isPreviewMode:i}){var ye,q,de,he,we,Pe,Le;const{prefix:o}=_.useScopedStyles(),r=s.useMemo(()=>_v(o),[o]),{imageSize:l,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:p="greyscale"}=e,w=t??[],b=Wl(w.length),[h,g]=s.useState(b.activeIndex),[m,v]=s.useState(b.backgroundIndex),[L,f]=s.useState(!1),[S,H]=s.useState(!1),[P,R]=s.useState(null),[$,x]=s.useState(null),[A,y]=s.useState(0),[F,T]=s.useState(1),[j,E]=s.useState("none"),[B,O]=s.useState("next"),[z,ee]=s.useState({}),[k,W]=s.useState({width:0,height:0}),D=s.useRef(null),le=s.useRef(null),Y=!n||!!i,I=l??60,oe=Math.max(10,Math.min(100,d??I)),N=Math.max(10,Math.min(100,c??I)),ie=Math.max(100,u),Z=so(p),te=s.useCallback(G=>{const fe=Hv(G?z[G]:void 0);return Ov(k.width,k.height,fe,oe,N)},[k.height,k.width,z,N,oe]);s.useEffect(()=>{const G=le.current;if(!G)return;const fe=new ResizeObserver(([ce])=>{const{width:U,height:re}=ce.contentRect;W({width:U,height:re})});return fe.observe(G),()=>fe.disconnect()},[]),s.useEffect(()=>{const G=(t??[]).map(fe=>{var ce;return(ce=fe.image)==null?void 0:ce.url}).filter(fe=>!!fe);Dv(G,(fe,ce)=>{ee(U=>{var re,Ee;return((re=U[fe])==null?void 0:re.width)===ce.width&&((Ee=U[fe])==null?void 0:Ee.height)===ce.height?U:{...U,[fe]:ce}})})},[t]),s.useEffect(()=>{const{backgroundIndex:G,activeIndex:fe}=Wl(w.length);g(fe),v(G),f(!1),H(!1),R(null),x(null),y(0),T(1),E("none"),O("next")},[w.length,t]),s.useEffect(()=>()=>{D.current&&clearTimeout(D.current)},[]);const Se=s.useCallback(G=>{var pe,K,Ve,Oe;if(!Y||L||w.length<=1)return;const fe=G==="next"?(h+1)%w.length:(h-1+w.length)%w.length,ce=te((K=(pe=w[h])==null?void 0:pe.image)==null?void 0:K.url),U=te((Oe=(Ve=w[fe])==null?void 0:Ve.image)==null?void 0:Oe.url),re=Nl(k.width,k.height,ce),Ee=Nl(k.width,k.height,U);D.current&&clearTimeout(D.current),O(G),H(!0),f(!0),G==="next"?(R(h),x(fe),y(0),T(1),E(so(p,0,1))):(v(Nv(fe,w.length)),R(fe),x(h),y(1),T(Ee),E(so(p,1,Ee))),requestAnimationFrame(()=>{H(!1),requestAnimationFrame(()=>{G==="next"?(y(1),T(re),E(so(p,1,re))):(y(0),T(1),E(so(p,0,1)))})}),D.current=setTimeout(()=>{G==="next"&&v(h),g(fe),R(null),x(null),f(!1)},ie)},[h,p,k.height,k.width,te,L,Y,w,ie]),se=w[h],ae=m!==null?w[m]:null,V=P!==null?w[P]:null,J=$!==null?w[$]:null,Q=w.length<=1?0:(h-1+w.length)%w.length,Me=w.length<=1?0:(h+1)%w.length,be=te((ye=se==null?void 0:se.image)==null?void 0:ye.url),Ie=te((q=V==null?void 0:V.image)==null?void 0:q.url),ue=te((de=J==null?void 0:J.image)==null?void 0:de.url),ge={[`--${o}-transition-ms`]:`${ie}ms`};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:r}}),a.jsxs("div",{ref:le,className:rt(`${o}-wrapper`,S&&`${o}-snap`,n&&!i&&`${o}-editor`),style:ge,"aria-label":"Zoom gallery",children:[((he=ae==null?void 0:ae.image)==null?void 0:he.url)&&a.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:ae.image.url,alt:"",style:{filter:Z}})}),L&&((we=V==null?void 0:V.image)==null?void 0:we.url)&&a.jsx("div",{className:rt(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${B}`),style:Hl(Ie,F,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:V.image.url,alt:"",style:{filter:j}})}),L&&((Pe=J==null?void 0:J.image)==null?void 0:Pe.url)&&a.jsx("div",{className:rt(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${B}`),style:Hl(ue,A,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-image`,src:J.image.url,alt:""})}),!L&&((Le=se==null?void 0:se.image)==null?void 0:Le.url)&&a.jsx("div",{className:rt(`${o}-stage`,`${o}-foreground`),style:Sd(be),children:a.jsx("img",{className:`${o}-image`,src:se.image.url,alt:se.image.name??""})}),Y&&w.length>1&&!L&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:rt(`${o}-nav`,`${o}-nav-prev`),onClick:()=>Se("prev"),"aria-label":`Show previous image (${Q+1} of ${w.length})`}),a.jsx("button",{type:"button",className:rt(`${o}-nav`,`${o}-nav-next`),onClick:()=>Se("next"),"aria-label":`Show next image (${Me+1} of ${w.length})`})]})]})]})}const Bv=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
16139
+ `}function Wv(e){return e==="blur"?Fv:e==="greyscale"?Av:0}function so(e,t=1,n=1){const i=Wv(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 Wl(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function Nv(e,t){return t<=1?0:(e-1+t)%t}function Hv(e,t=1){return!e||e.height===0?t:e.width/e.height}function Ov(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 Nl(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 Sd(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function Hl(e,t,n){return{...Sd(e),[`--${n}-stage-scale`]:t}}function Dv(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 jv({settings:e,content:t,isEditor:n,isPreviewMode:i}){var ve,q,de,he,Se,Pe,Le;const{prefix:o}=_.useScopedStyles(),r=s.useMemo(()=>_v(o),[o]),{imageSize:l,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:p="greyscale"}=e,w=t??[],b=Wl(w.length),[h,g]=s.useState(b.activeIndex),[m,y]=s.useState(b.backgroundIndex),[L,f]=s.useState(!1),[S,H]=s.useState(!1),[I,R]=s.useState(null),[$,x]=s.useState(null),[A,v]=s.useState(0),[k,T]=s.useState(1),[D,P]=s.useState("none"),[B,O]=s.useState("next"),[V,ee]=s.useState({}),[E,N]=s.useState({width:0,height:0}),j=s.useRef(null),le=s.useRef(null),ie=!n||!!i,W=l??60,ae=Math.max(10,Math.min(100,d??W)),F=Math.max(10,Math.min(100,c??W)),J=Math.max(100,u),Y=so(p),Z=s.useCallback(G=>{const fe=Hv(G?V[G]:void 0);return Ov(E.width,E.height,fe,ae,F)},[E.height,E.width,V,F,ae]);s.useEffect(()=>{const G=le.current;if(!G)return;const fe=new ResizeObserver(([ce])=>{const{width:U,height:oe}=ce.contentRect;N({width:U,height:oe})});return fe.observe(G),()=>fe.disconnect()},[]),s.useEffect(()=>{const G=(t??[]).map(fe=>{var ce;return(ce=fe.image)==null?void 0:ce.url}).filter(fe=>!!fe);Dv(G,(fe,ce)=>{ee(U=>{var oe,Ee;return((oe=U[fe])==null?void 0:oe.width)===ce.width&&((Ee=U[fe])==null?void 0:Ee.height)===ce.height?U:{...U,[fe]:ce}})})},[t]),s.useEffect(()=>{const{backgroundIndex:G,activeIndex:fe}=Wl(w.length);g(fe),y(G),f(!1),H(!1),R(null),x(null),v(0),T(1),P("none"),O("next")},[w.length,t]),s.useEffect(()=>()=>{j.current&&clearTimeout(j.current)},[]);const ye=s.useCallback(G=>{var pe,K,Ve,Oe;if(!ie||L||w.length<=1)return;const fe=G==="next"?(h+1)%w.length:(h-1+w.length)%w.length,ce=Z((K=(pe=w[h])==null?void 0:pe.image)==null?void 0:K.url),U=Z((Oe=(Ve=w[fe])==null?void 0:Ve.image)==null?void 0:Oe.url),oe=Nl(E.width,E.height,ce),Ee=Nl(E.width,E.height,U);j.current&&clearTimeout(j.current),O(G),H(!0),f(!0),G==="next"?(R(h),x(fe),v(0),T(1),P(so(p,0,1))):(y(Nv(fe,w.length)),R(fe),x(h),v(1),T(Ee),P(so(p,1,Ee))),requestAnimationFrame(()=>{H(!1),requestAnimationFrame(()=>{G==="next"?(v(1),T(oe),P(so(p,1,oe))):(v(0),T(1),P(so(p,0,1)))})}),j.current=setTimeout(()=>{G==="next"&&y(h),g(fe),R(null),x(null),f(!1)},J)},[h,p,E.height,E.width,Z,L,ie,w,J]),se=w[h],re=m!==null?w[m]:null,z=I!==null?w[I]:null,Q=$!==null?w[$]:null,te=w.length<=1?0:(h-1+w.length)%w.length,Me=w.length<=1?0:(h+1)%w.length,we=Z((ve=se==null?void 0:se.image)==null?void 0:ve.url),Ie=Z((q=z==null?void 0:z.image)==null?void 0:q.url),ue=Z((de=Q==null?void 0:Q.image)==null?void 0:de.url),ge={[`--${o}-transition-ms`]:`${J}ms`};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:r}}),a.jsxs("div",{ref:le,className:rt(`${o}-wrapper`,S&&`${o}-snap`,n&&!i&&`${o}-editor`),style:ge,"aria-label":"Zoom gallery",children:[((he=re==null?void 0:re.image)==null?void 0:he.url)&&a.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:re.image.url,alt:"",style:{filter:Y}})}),L&&((Se=z==null?void 0:z.image)==null?void 0:Se.url)&&a.jsx("div",{className:rt(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${B}`),style:Hl(Ie,k,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:z.image.url,alt:"",style:{filter:D}})}),L&&((Pe=Q==null?void 0:Q.image)==null?void 0:Pe.url)&&a.jsx("div",{className:rt(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${B}`),style:Hl(ue,A,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-image`,src:Q.image.url,alt:""})}),!L&&((Le=se==null?void 0:se.image)==null?void 0:Le.url)&&a.jsx("div",{className:rt(`${o}-stage`,`${o}-foreground`),style:Sd(we),children:a.jsx("img",{className:`${o}-image`,src:se.image.url,alt:se.image.name??""})}),ie&&w.length>1&&!L&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:rt(`${o}-nav`,`${o}-nav-prev`),onClick:()=>ye("prev"),"aria-label":`Show previous image (${te+1} of ${w.length})`}),a.jsx("button",{type:"button",className:rt(`${o}-nav`,`${o}-nav-next`),onClick:()=>ye("next"),"aria-label":`Show next image (${Me+1} of ${w.length})`})]})]})]})}const Bv=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
16140
16140
  import cn from 'classnames';
16141
16141
  import { CommonComponentProps } from '../props';
16142
16142
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -16895,7 +16895,7 @@ a:active .${e}-button .${e}-icon-image,
16895
16895
  height: calc(1em * var(--${e}-icon-scale, 1));
16896
16896
  width: calc(1em * var(--${e}-icon-scale, 1));
16897
16897
  }
16898
- `}function xa(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 Ol(e,t,n="fill",i=100,o=0,r){if(!t)return null;const l=a.jsx(an,{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=_.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 Yv({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:r}=_.useScopedStyles(),l=s.useMemo(()=>Kv(r),[r]),{type:d="a",label:c="Button",icon:u,alignment:p="center",alignA:w,order:b="text-icon",gap:h=0,iconSize:g=0,iconWidthC:m=0,dimensions:v=!1,padding:L={top:0,right:0,bottom:0,left:0},cornerRadius:f=0,boxShadow:S={top:0,left:0,right:0,bottom:0},boxShadowColor:H="rgba(0, 0, 0, 0)",innerBoxShadow:P={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:R="rgba(0, 0, 0, 0)",stroke:$=0,backgroundColor:x="#000000",textColor:A="#ffffff",borderColor:y="#ffffff",iconColor:F="#ffffff",hoverEffect:T="none",fontFamily:j,fontSettings:E,fontSize:B,lineHeight:O,letterSpacing:z=0,wordSpacing:ee=0,textAppearance:k,stateOverrides:W,minWidth:D=0,minHeight:le=0,width:Y=0,height:I=0}=e,oe=_.buildColorVars(r,{backgroundColor:x,textColor:A,borderColor:y,iconColor:F,boxShadowColor:H,innerBoxShadowColor:R},Gv,Uv,W),N=i&&i!=="default"?`${r}-state-${i}`:"",ie=t&&!n?`${r}-editing`:"",Z=T!=="none"&&(!t||n||i==="hover")?`${r}-hover-effect-${T}`:"",te=T==="reveal"||T==="swipe",Se=T==="content-roll",se=T==="reveal"&&(!t||n),ae=v===!0,J=d==="a"?w??p:p,Q=d==="c",Me=d!=="b",be={fontSettings:{fontFamily:j,fontWeight:(E==null?void 0:E.fontWeight)??400,fontStyle:(E==null?void 0:E.fontStyle)??"normal"},fontSize:B??.01,lineHeight:O,letterSpacing:z,wordSpacing:ee,textAppearance:k,color:A},ue={...Me?rn(qt(be,t)):{},[`--${r}-box-shadow-x`]:_.scalingValue(S.left,t),[`--${r}-box-shadow-y`]:_.scalingValue(S.top,t),[`--${r}-box-shadow-blur`]:_.scalingValue(S.right,t),[`--${r}-box-shadow-spread`]:_.scalingValue(S.bottom,t),[`--${r}-inner-box-shadow-x`]:_.scalingValue(P.left,t),[`--${r}-inner-box-shadow-y`]:_.scalingValue(P.top,t),[`--${r}-inner-box-shadow-blur`]:_.scalingValue(P.right,t),[`--${r}-inner-box-shadow-spread`]:_.scalingValue(P.bottom,t),paddingTop:_.scalingValue(L.top,t),paddingRight:_.scalingValue(L.right,t),paddingBottom:_.scalingValue(L.bottom,t),paddingLeft:_.scalingValue(L.left,t),borderRadius:_.scalingValue(f,t),borderWidth:_.scalingValue($,t),...Q?{}:{justifyContent:va[J],textAlign:J},...Q&&!Se?{gap:_.scalingValue(h,t)}:{},...ae?{width:_.scalingValue(Y,t),height:_.scalingValue(I,t)}:{minWidth:_.scalingValue(D,t),minHeight:_.scalingValue(le,t),...Q?{width:"100%"}:{}}};let ge;const ye={display:"inline-flex",alignItems:"center",justifyContent:Q?va[J]:va[d==="a"?J:"center"],gap:Q?_.scalingValue(h,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:J}:{}};if(d==="b"){const he=()=>Ol(r,u,g>0?"fixed":"fill",100,g,t);ge=Se?xa(r,he,`${r}-icon-roll`,void 0,ye):he()}else if(d==="c"){const he=()=>{const we=a.jsx("span",{className:`${r}-text`,style:{textAlign:J},children:c}),Pe=Ol(r,u,m>0?"fixed":"fill",100,m,t);return b==="icon-text"?a.jsxs(a.Fragment,{children:[Pe,we]}):a.jsxs(a.Fragment,{children:[we,Pe]})};ge=Se?xa(r,he,`${r}-icon-text-roll`,void 0,ye):he()}else ge=Se?xa(r,()=>c,`${r}-label-roll`,void 0,ye):te?a.jsx("span",{className:`${r}-button-inner`,children:c}):c;const q=se?he=>qv(he,r):void 0,de=se?he=>Xv(he,r):void 0;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),a.jsx("div",{className:`${r}-root`,style:oe,children:a.jsx("div",{className:`${r}-wrapper ${N} ${ie}`.trim(),children:a.jsx("div",{className:`${r}-button ${Z}`.trim(),style:ue,onMouseEnter:q,onMouseLeave:de,role:"button",tabIndex:o||t&&!n?void 0:0,children:ge})})})]})}const Zv=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
16898
+ `}function xa(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 Ol(e,t,n="fill",i=100,o=0,r){if(!t)return null;const l=a.jsx(an,{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=_.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 Yv({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:r}=_.useScopedStyles(),l=s.useMemo(()=>Kv(r),[r]),{type:d="a",label:c="Button",icon:u,alignment:p="center",alignA:w,order:b="text-icon",gap:h=0,iconSize:g=0,iconWidthC:m=0,dimensions:y=!1,padding:L={top:0,right:0,bottom:0,left:0},cornerRadius:f=0,boxShadow:S={top:0,left:0,right:0,bottom:0},boxShadowColor:H="rgba(0, 0, 0, 0)",innerBoxShadow:I={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:R="rgba(0, 0, 0, 0)",stroke:$=0,backgroundColor:x="#000000",textColor:A="#ffffff",borderColor:v="#ffffff",iconColor:k="#ffffff",hoverEffect:T="none",fontFamily:D,fontSettings:P,fontSize:B,lineHeight:O,letterSpacing:V=0,wordSpacing:ee=0,textAppearance:E,stateOverrides:N,minWidth:j=0,minHeight:le=0,width:ie=0,height:W=0}=e,ae=_.buildColorVars(r,{backgroundColor:x,textColor:A,borderColor:v,iconColor:k,boxShadowColor:H,innerBoxShadowColor:R},Gv,Uv,N),F=i&&i!=="default"?`${r}-state-${i}`:"",J=t&&!n?`${r}-editing`:"",Y=T!=="none"&&(!t||n||i==="hover")?`${r}-hover-effect-${T}`:"",Z=T==="reveal"||T==="swipe",ye=T==="content-roll",se=T==="reveal"&&(!t||n),re=y===!0,Q=d==="a"?w??p:p,te=d==="c",Me=d!=="b",we={fontSettings:{fontFamily:D,fontWeight:(P==null?void 0:P.fontWeight)??400,fontStyle:(P==null?void 0:P.fontStyle)??"normal"},fontSize:B??.01,lineHeight:O,letterSpacing:V,wordSpacing:ee,textAppearance:E,color:A},ue={...Me?rn(qt(we,t)):{},[`--${r}-box-shadow-x`]:_.scalingValue(S.left,t),[`--${r}-box-shadow-y`]:_.scalingValue(S.top,t),[`--${r}-box-shadow-blur`]:_.scalingValue(S.right,t),[`--${r}-box-shadow-spread`]:_.scalingValue(S.bottom,t),[`--${r}-inner-box-shadow-x`]:_.scalingValue(I.left,t),[`--${r}-inner-box-shadow-y`]:_.scalingValue(I.top,t),[`--${r}-inner-box-shadow-blur`]:_.scalingValue(I.right,t),[`--${r}-inner-box-shadow-spread`]:_.scalingValue(I.bottom,t),paddingTop:_.scalingValue(L.top,t),paddingRight:_.scalingValue(L.right,t),paddingBottom:_.scalingValue(L.bottom,t),paddingLeft:_.scalingValue(L.left,t),borderRadius:_.scalingValue(f,t),borderWidth:_.scalingValue($,t),...te?{}:{justifyContent:va[Q],textAlign:Q},...te&&!ye?{gap:_.scalingValue(h,t)}:{},...re?{width:_.scalingValue(ie,t),height:_.scalingValue(W,t)}:{minWidth:_.scalingValue(j,t),minHeight:_.scalingValue(le,t),...te?{width:"100%"}:{}}};let ge;const ve={display:"inline-flex",alignItems:"center",justifyContent:te?va[Q]:va[d==="a"?Q:"center"],gap:te?_.scalingValue(h,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:Q}:{}};if(d==="b"){const he=()=>Ol(r,u,g>0?"fixed":"fill",100,g,t);ge=ye?xa(r,he,`${r}-icon-roll`,void 0,ve):he()}else if(d==="c"){const he=()=>{const Se=a.jsx("span",{className:`${r}-text`,style:{textAlign:Q},children:c}),Pe=Ol(r,u,m>0?"fixed":"fill",100,m,t);return b==="icon-text"?a.jsxs(a.Fragment,{children:[Pe,Se]}):a.jsxs(a.Fragment,{children:[Se,Pe]})};ge=ye?xa(r,he,`${r}-icon-text-roll`,void 0,ve):he()}else ge=ye?xa(r,()=>c,`${r}-label-roll`,void 0,ve):Z?a.jsx("span",{className:`${r}-button-inner`,children:c}):c;const q=se?he=>qv(he,r):void 0,de=se?he=>Xv(he,r):void 0;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),a.jsx("div",{className:`${r}-root`,style:ae,children:a.jsx("div",{className:`${r}-wrapper ${F} ${J}`.trim(),children:a.jsx("div",{className:`${r}-button ${Y}`.trim(),style:ue,onMouseEnter:q,onMouseLeave:de,role:"button",tabIndex:o||t&&!n?void 0:0,children:ge})})})]})}const Zv=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
16899
16899
  import { SvgImage } from '../helpers/SvgImage/SvgImage';
16900
16900
  import { CommonComponentProps } from '../props';
16901
16901
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
@@ -17720,7 +17720,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
17720
17720
  pointer-events: auto;
17721
17721
  flex-shrink: 0;
17722
17722
  }
17723
- `}const Ln=500,lo=650,mn="cubic-bezier(0.22, 1, 0.36, 1)",i0=72,o0=50,r0=1e4,a0=650,s0=500;function l0(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 $d(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=Tr(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 c0(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?$d(i,n):null}function d0(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 ho(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 Dl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return ho(e,i,n)}const u0=.03;function Cd(e){return e.width*u0}const ba={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function sr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function jl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function p0(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Ba(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 m0(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Ba(e,t.width,t.height)}function g0(e,t){if(Gr(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 h0(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 f0({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=>Gr(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 Ki(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=Cd(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 Pr(e,t,n){const i=Ki(e,t,n);return{...i,left:2*i.left-e.left}}function y0(e,t,n){const{left:i,width:o}=n,r=Cd(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 Td(e,t,n,i){const o=Ki(e,"left",i),r=Ki(e,"right",i),l=Pr(e,"left",i),d=Pr(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 v0(e,t,n,i){const{start:o,end:r}=Td(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function x0(e,t,n){const i=Ki(e,t,n),o=Pr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Gr(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function b0({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 lr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Gr(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 w0({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:w,sourceRect:b,resolveCloseSourceRect:h,onClose:g,onPrev:m,onNext:v}){const L=s.useRef(null),f=s.useRef(null),S=s.useRef(null),H=s.useRef(new Map),[P,R]=s.useState(0),$=s.useRef(null),x=s.useRef(0),A=s.useRef(0),y=s.useRef("none"),F=s.useRef(!1),T=s.useRef(!1),j=s.useRef(!1),E=s.useRef(null),B=s.useRef(null),O=s.useRef(null),z=s.useRef(()=>{}),ee=s.useRef(null),k=s.useRef(null),W=s.useRef(null),D=s.useRef(!1),[le,Y]=s.useState(null),[I,oe]=s.useState(ba),[N,ie]=s.useState(0),[Z,te]=s.useState("opening"),[Se,se]=s.useState(0),[ae,V]=s.useState(0),[J,Q]=s.useState(!1),[Me,be]=s.useState(null),[Ie,ue]=s.useState(null),[ge,ye]=s.useState(null),[q,de]=s.useState(!1),[he,we]=s.useState(null),[Pe,Le]=s.useState(!1),G=s.useRef(!1),[fe,ce]=s.useState(!1),[U,re]=s.useState(!1),Ee=s.useRef(n),pe=s.useRef(void 0),K=t[n],Ve=K?Gr(K):!1,Oe=ae!==0||J,lt=!l&&(!r||!!d),tt=c&&!l,ht=u.length>1,nt=s.useCallback((M,ve)=>t.length<=1?null:t[(M+ve+t.length)%t.length]??null,[t]),ze=ht?ho(u,p,-1):nt(n,-1),xe=ht?ho(u,p,1):nt(n,1),Ae=Me===-1&&Oe?ht&&Ie!==null?ho(u,Ie,-1):ge!==null?nt(ge,-1):null:null,De=Me===1&&Oe?ht&&Ie!==null?ho(u,Ie,1):ge!==null?nt(ge,1):null:null,Ue=Ae&&Ae.url!==(ze==null?void 0:ze.url)?Ae:null,Ce=De&&De.url!==(xe==null?void 0:xe.url)?De:null,Ne=ze&&tt?(()=>{const M=ht?Dl(u,p,-1):t.length>2?nt((n-1+t.length)%t.length,-1):null;return M&&M.url!==ze.url?M:null})():null,Be=xe&&tt?(()=>{const M=ht?Dl(u,p,1):t.length>2?nt((n+1)%t.length,1):null;return M&&M.url!==xe.url?M:null})():null,Ke=Ue??Ne,ct=Ce??Be,Je=s.useCallback((M,ve,Re)=>{if(!M||!ve||!Re)return;const ke=H.current,et=ke.get(M);(et==null?void 0:et.width)===ve&&(et==null?void 0:et.height)===Re||(ke.set(M,{width:ve,height:Re}),R(Pt=>Pt+1))},[]),$t=s.useCallback(M=>{if(!(M!=null&&M.url))return null;const ve=H.current.get(M.url);return m0(f.current,ve)},[P,N]),dt=s.useCallback(()=>{if(!K)return;const M=$t(K);if(M){Y(M);return}const ve=f.current;ve&&Y(jl(ve))},[K,$t]),_e=s.useCallback(M=>{if(ht){const ve=u.length;ue((p+M+ve)%ve),ye(null);return}t.length>1&&(ye((n+M+t.length)%t.length),ue(null))},[ht,u.length,p,t.length,n]),Xe=s.useCallback(M=>{j.current=M,Q(M)},[]),je=s.useCallback(()=>{E.current!==null&&(window.clearTimeout(E.current),E.current=null)},[]),ut=s.useCallback(()=>{je(),E.current=window.setTimeout(()=>{je(),Xe(!1)},lo+32)},[je,Xe]),pt=s.useCallback(()=>{const M=L.current;if(!M){oe({left:0,top:0,width:typeof window<"u"?window.innerWidth:ba.width,height:typeof window<"u"?window.innerHeight:ba.height});return}const ve=M.getBoundingClientRect();oe({left:ve.left,top:ve.top,width:ve.width,height:ve.height})},[]),mt=s.useCallback((M,ve)=>{if(Oe){if(fe&&!J)return`translate(${ae}px, 0px)`;if(J&&Me!==null){const Re=$t(M);if(!Re)return;const{x:ke,y:et}=v0(Re,ve,Me,I);return`translate(${ke}px, ${et}px)`}if(J)return"translate(0px, 0px)"}},[Oe,fe,J,ae,Me,I,$t]),kt=s.useCallback(()=>{const M=B.current;B.current=null,je(),Xe(!1),be(null),ue(null),ye(null),V(0),ce(!1),F.current=!1,A.current=0,y.current="none",M===-1?m():M===1&&v()},[je,Xe,m,v]),Kt=s.useCallback(()=>{je(),E.current=window.setTimeout(()=>{B.current!==null&&kt()},lo+32)},[je,kt]),Yt=s.useCallback(()=>{je(),B.current=null,Xe(!1),be(null),ue(null),ye(null),V(0),ce(!1),F.current=!1,A.current=0,y.current="none"},[je,Xe]),vt=s.useCallback(M=>{if(!(!tt||!le)){if(j.current){if(B.current===M){O.current=M,kt();return}Yt()}je(),_e(M),B.current=M,be(M),Xe(!0),Kt()}},[tt,le,kt,Yt,je,_e,Xe,Kt]);z.current=vt;const bt=s.useCallback(()=>{ee.current=null,D.current=!1,k.current!==null&&(window.clearInterval(k.current),k.current=null),W.current!==null&&(window.clearTimeout(W.current),W.current=null)},[]),Gt=s.useCallback(M=>{k.current!==null&&window.clearInterval(k.current);const ve=D.current?s0:a0;k.current=window.setInterval(()=>{z.current(M)},ve)},[]),Ft=s.useCallback(M=>{ee.current!==M&&(bt(),ee.current=M,D.current=!1,z.current(M),Gt(M),W.current=window.setTimeout(()=>{W.current=null,ee.current===M&&(D.current=!0,Gt(M))},r0))},[bt,Gt]),xt=s.useCallback(()=>{const M=f.current;if(!M)return;const ve=K==null?void 0:K.url,Re=ve?H.current.get(ve):void 0;if(Re!=null&&Re.width&&(Re!=null&&Re.height)){Y(Ba(M,Re.width,Re.height));return}const ke=S.current;if(ke&&ve&&(ke.src===ve||ke.currentSrc===ve)){const{width:Pt,height:Ye}=p0(ke);if(Pt&&Ye){Je(ve,Pt,Ye),Y(Ba(M,Pt,Ye));return}}const et=jl(M);!et.width||!et.height||Y(et)},[K==null?void 0:K.url,Je]),Ht=s.useCallback(M=>{if(S.current=M,!!M){if(M instanceof HTMLVideoElement){M.readyState>=1&&M.videoWidth>0&&xt();return}M.complete&&M.naturalWidth>0&&xt()}},[xt]),Ut=s.useCallback(()=>{pt(),xt(),ie(M=>M+1)},[pt,xt]);s.useEffect(()=>{Ut();const M=f.current,ve=L.current,Re=new ResizeObserver(()=>Ut());return M&&Re.observe(M),ve&&Re.observe(ve),window.addEventListener("resize",Ut),()=>{Re.disconnect(),window.removeEventListener("resize",Ut)}},[Ut,n,w]),s.useLayoutEffect(()=>{if(!K)return;const M=S.current;if(M){if(M instanceof HTMLImageElement&&M.complete&&M.naturalWidth>0){xt();return}M instanceof HTMLVideoElement&&M.readyState>=1&&M.videoWidth>0&&xt()}},[K==null?void 0:K.url,n,xt]),s.useEffect(()=>{dt()},[dt,P]),s.useEffect(()=>{const M=new Set,ve=[],Re=ke=>{!(ke!=null&&ke.url)||M.has(ke.url)||(M.add(ke.url),ve.push(ke))};t.forEach(Re),u.forEach(ke=>ke.items.forEach(Re)),ve.forEach(ke=>{H.current.has(ke.url)||g0(ke,Je)})},[t,u,Je]),s.useEffect(()=>{if(Z!=="opening"||!le)return;if(!b){te("open");return}de(!1);const M=requestAnimationFrame(()=>{requestAnimationFrame(()=>{de(!0),te("open")})});return()=>cancelAnimationFrame(M)},[Z,le,b]),s.useEffect(()=>{if(Z!=="closing")return;const M=setTimeout(()=>g(),Ln);return()=>clearTimeout(M)},[Z,g]),s.useEffect(()=>()=>{je()},[je]),s.useLayoutEffect(()=>{Ee.current===n&&pe.current===(K==null?void 0:K.url)||(je(),B.current=null,be(null),ue(null),ye(null),se(0),V(0),Xe(!1),re(!1),ce(!1),x.current=0,A.current=0,y.current="none",F.current=!1,$.current=null,T.current=!1,S.current=null,dt(),Ee.current=n,pe.current=K==null?void 0:K.url)},[n,K==null?void 0:K.url,Xe,je,dt]),s.useLayoutEffect(()=>{const M=O.current;M!==null&&(O.current=null,requestAnimationFrame(()=>{z.current(M)}))},[n,p,K==null?void 0:K.url]),s.useLayoutEffect(()=>{if(Z==="opening"){G.current=!1,Le(!1);return}if(Z!=="open"||G.current)return;if(!ze&&!xe){G.current=!0;return}Le(!1);const M=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Le(!0),G.current=!0})});return()=>cancelAnimationFrame(M)},[Z,ze==null?void 0:ze.url,xe==null?void 0:xe.url]),s.useEffect(()=>{if(Z!=="open")return;const M=()=>{const Ye=ft=>{ft.stopPropagation(),ft.preventDefault(),document.removeEventListener("click",Ye,!0)};document.addEventListener("click",Ye,!0)},ve=Ye=>{const ft=Ye<0?1:-1;je(),_e(ft),B.current=ft,be(ft),Xe(!0),Kt()},Re=Ye=>{if(Math.abs(Ye)>o0&&tt){ve(Ye);return}B.current=null,be(null),ue(null),ye(null),Xe(!0),V(0),ut()},ke=Ye=>{if(Ye.touches.length!==1||j.current)return;const ft=Ye.touches[0];T.current=!0,$.current={x:ft.clientX,y:ft.clientY},y.current="none",A.current=0,F.current=!1},et=Ye=>{if(!$.current||Ye.touches.length!==1||j.current)return;const ft=Ye.touches[0],Nt=ft.clientX-$.current.x,Tt=ft.clientY-$.current.y;if(y.current==="none"){if(Math.abs(Nt)<10&&Math.abs(Tt)<10)return;if(Math.abs(Nt)>Math.abs(Tt)){if(!tt)return;y.current="horizontal"}else if(Tt>0){if(!lt)return;y.current="vertical"}else return}if(y.current==="horizontal"){F.current=!0,ce(!0),A.current=Nt,V(Nt),Ye.preventDefault();return}y.current==="vertical"&&(F.current=!0,ce(!0),x.current=Tt,se(Tt),Ye.preventDefault())},Pt=()=>{if(!$.current)return;const Ye=y.current,ft=F.current;if(ft&&Ye==="horizontal")Re(A.current),M();else if(ft&&Ye==="vertical"){const Nt=x.current;if(lt&&Nt>i0){const Tt=window.innerHeight;x.current=Tt,re(!0),se(Tt),te("closing")}else x.current=0,se(0);M()}else Ye==="horizontal"&&Math.abs(A.current)>0&&(Re(A.current),M());$.current=null,y.current="none",A.current=0,F.current=!1,ce(!1)};return document.addEventListener("touchstart",ke,{passive:!0}),document.addEventListener("touchmove",et,{passive:!1}),document.addEventListener("touchend",Pt),document.addEventListener("touchcancel",Pt),()=>{document.removeEventListener("touchstart",ke),document.removeEventListener("touchmove",et),document.removeEventListener("touchend",Pt),document.removeEventListener("touchcancel",Pt)}},[Z,tt,Xe,ut,je,lt,Kt,_e]);const Zt=s.useCallback(()=>{const M=(h==null?void 0:h())??b??null;M&&le&&(we(M),de(!0)),te("closing")},[h,b,le]);s.useEffect(()=>{const M=ke=>{if(ke.key==="Escape"){if(r&&d||Z==="closing")return;bt(),Zt();return}if(ke.key!=="ArrowLeft"&&ke.key!=="ArrowRight"||Z!=="open"||!tt)return;ke.preventDefault();const et=ke.key==="ArrowLeft"?-1:1;ke.repeat&&ee.current===et||Ft(et)},ve=ke=>{if(ke.key!=="ArrowLeft"&&ke.key!=="ArrowRight")return;const et=ke.key==="ArrowLeft"?-1:1;ee.current===et&&bt()},Re=()=>{bt()};return window.addEventListener("keydown",M),window.addEventListener("keyup",ve),window.addEventListener("blur",Re),()=>{window.removeEventListener("keydown",M),window.removeEventListener("keyup",ve),window.removeEventListener("blur",Re),bt()}},[Z,r,d,Zt,tt,Ft,bt]),s.useEffect(()=>{Z!=="open"&&bt()},[Z,bt]);const tn=()=>{Z==="closing"||l||Zt()},Ct=Z==="open",jt=Z==="closing",dn=Se>0?Math.max(0,1-Se/500):1,at=Se>0?Math.max(.35,1-Se/500):1,Te=s.useCallback(M=>{if(!(M.propertyName!=="transform"||!j.current)){if(B.current!==null){kt();return}je(),Xe(!1)}},[je,Xe,kt]),We=Z==="closing"?he??b:b,Qe=We&&le&&(Z==="opening"||jt)?l0(We,le):void 0,st=Oe&&K?mt(K,"center"):Se>0?`translateY(${Se}px)`:Qe,gt=le?sr(le,I):null,Rt=!!(We&&le),ot=Rt&&(Z==="closing"||Z==="open"&&q),Ot={position:"absolute",top:gt==null?void 0:gt.top,left:gt==null?void 0:gt.left,width:gt==null?void 0:gt.width,height:gt==null?void 0:gt.height,objectFit:"contain",transformOrigin:"top left",transform:st,opacity:Se>0?at:Rt?1:Z==="opening"||jt?0:1,transition:fe&&!J?"none":J?`transform ${lo}ms ${mn}`:U?`transform ${Ln}ms ${mn}, opacity ${Ln}ms ${mn}`:ot?`transform ${Ln}ms ${mn}`:Z==="opening"||jt?`opacity ${Ln}ms ${mn}`:"none",pointerEvents:Ve&&Ct&&!Oe?"auto":"none",touchAction:Ve&&Ct?"none":void 0,zIndex:1,overflow:Ve?"hidden":void 0},Et={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ct&&!Oe?"auto":"none"},Mt=(M,ve,Re="adjacent")=>{const ke=$t(M);if(!ke)return{display:"none"};const et=Re==="far"?ve==="left"?"far-left":"far-right":ve==="left"?"left-adjacent":"right-adjacent",{start:Pt}=Me!==null?Td(ke,et,Me,I):{start:Re==="far"?Pr(ke,ve,I):Ki(ke,ve,I)},Ye=sr(Pt,I),ft=mt(M,et),Nt=!Oe&&Re==="adjacent"&&Ct&&!Pe?x0(ke,ve,I):null,Tt=Re==="far"&&Oe&&Me===(ve==="left"?-1:1),nn=fe&&!J?!1:J,un=Re==="adjacent"&&Ct&&Pe&&!Oe;return{position:"absolute",top:Ye.top,left:Ye.left,width:Ye.width,height:Ye.height,objectFit:"contain",transform:ft??(Nt?`translate(${Nt.x}px, ${Nt.y}px)`:void 0),opacity:Re==="far"?Ct&&Tt?1:0:Ct?1:0,transition:nn?Re==="far"?`transform ${lo}ms ${mn}`:`transform ${lo}ms ${mn}, opacity ${Ln}ms ${mn}`:un?`transform ${Ln}ms ${mn}`:Z==="opening"||jt?`opacity ${Ln}ms ${mn}`:"none",pointerEvents:"none",zIndex:1}},Bt=(M,ve)=>{const Re=$t(M);return Re?y0(Ki(Re,ve,I),ve,I):null},zt=M=>ve=>{if(!l){if(T.current){T.current=!1;return}ve.stopPropagation(),vt(M)}},_t=ze?Bt(ze,"left"):null,Wt=xe?Bt(xe,"right"):null,At=_t?sr(_t,I):null,wt=Wt?sr(Wt,I):null;return a.jsxs("div",{ref:L,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:Z==="open"?"none":void 0},onClick:tn,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ct?dn:0,transition:fe?"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:f,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Ct?1:0,transition:fe?"none":`opacity ${Ln}ms ${mn}`,pointerEvents:"none"},children:a.jsx(rd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:tn})})]}),Ct&&Ke&&a.jsx(lr,{media:Ke,style:Mt(Ke,"left","far"),onMeasure:Je,onTransitionEnd:Te},`far-prev-${Ke.url}`),Ct&&ze&&a.jsxs(a.Fragment,{children:[a.jsx(lr,{media:ze,style:Mt(ze,"left"),onMeasure:Je,onTransitionEnd:Te},`prev-${ze.url}`),At&&a.jsx("div",{style:{position:"absolute",top:At.top,left:At.left,width:At.width,height:At.height,cursor:l||fe?"default":"pointer",pointerEvents:l||fe?"none":"auto",zIndex:3},onClick:zt(-1)})]}),Ct&&xe&&a.jsxs(a.Fragment,{children:[a.jsx(lr,{media:xe,style:Mt(xe,"right"),onMeasure:Je,onTransitionEnd:Te},`next-${xe.url}`),wt&&a.jsx("div",{style:{position:"absolute",top:wt.top,left:wt.left,width:wt.width,height:wt.height,cursor:l||fe?"default":"pointer",pointerEvents:l||fe?"none":"auto",zIndex:3},onClick:zt(1)})]}),Ct&&ct&&a.jsx(lr,{media:ct,style:Mt(ct,"right","far"),onMeasure:Je,onTransitionEnd:Te},`far-next-${ct.url}`),le&&K&&(Ve?a.jsx(b0,{src:K.url,phase:Z,onMediaElement:Ht,wrapperStyle:Ot,videoStyle:Et,onLoadedMetadata:xt,onTransitionEnd:Te},`${n}-${K.url}`):a.jsx("img",{ref:Ht,src:K.url,alt:K.name,onLoad:xt,onTransitionEnd:Te,style:Ot},`${n}-${K.url}`))]})}const S0=20,$0=.18;function C0(e){return`
17723
+ `}const Ln=500,lo=650,mn="cubic-bezier(0.22, 1, 0.36, 1)",i0=72,o0=50,r0=1e4,a0=650,s0=500;function l0(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 $d(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=Tr(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 c0(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?$d(i,n):null}function d0(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 ho(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 Dl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return ho(e,i,n)}const u0=.03;function Cd(e){return e.width*u0}const ba={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function sr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function jl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function p0(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Ba(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 m0(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Ba(e,t.width,t.height)}function g0(e,t){if(Gr(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 h0(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 f0({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=>Gr(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 Ki(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=Cd(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 Pr(e,t,n){const i=Ki(e,t,n);return{...i,left:2*i.left-e.left}}function y0(e,t,n){const{left:i,width:o}=n,r=Cd(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 Td(e,t,n,i){const o=Ki(e,"left",i),r=Ki(e,"right",i),l=Pr(e,"left",i),d=Pr(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 v0(e,t,n,i){const{start:o,end:r}=Td(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function x0(e,t,n){const i=Ki(e,t,n),o=Pr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Gr(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function b0({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 lr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Gr(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 w0({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:w,sourceRect:b,resolveCloseSourceRect:h,onClose:g,onPrev:m,onNext:y}){const L=s.useRef(null),f=s.useRef(null),S=s.useRef(null),H=s.useRef(new Map),[I,R]=s.useState(0),$=s.useRef(null),x=s.useRef(0),A=s.useRef(0),v=s.useRef("none"),k=s.useRef(!1),T=s.useRef(!1),D=s.useRef(!1),P=s.useRef(null),B=s.useRef(null),O=s.useRef(null),V=s.useRef(()=>{}),ee=s.useRef(null),E=s.useRef(null),N=s.useRef(null),j=s.useRef(!1),[le,ie]=s.useState(null),[W,ae]=s.useState(ba),[F,J]=s.useState(0),[Y,Z]=s.useState("opening"),[ye,se]=s.useState(0),[re,z]=s.useState(0),[Q,te]=s.useState(!1),[Me,we]=s.useState(null),[Ie,ue]=s.useState(null),[ge,ve]=s.useState(null),[q,de]=s.useState(!1),[he,Se]=s.useState(null),[Pe,Le]=s.useState(!1),G=s.useRef(!1),[fe,ce]=s.useState(!1),[U,oe]=s.useState(!1),Ee=s.useRef(n),pe=s.useRef(void 0),K=t[n],Ve=K?Gr(K):!1,Oe=re!==0||Q,lt=!l&&(!r||!!d),tt=c&&!l,ht=u.length>1,nt=s.useCallback((M,xe)=>t.length<=1?null:t[(M+xe+t.length)%t.length]??null,[t]),ze=ht?ho(u,p,-1):nt(n,-1),be=ht?ho(u,p,1):nt(n,1),Ae=Me===-1&&Oe?ht&&Ie!==null?ho(u,Ie,-1):ge!==null?nt(ge,-1):null:null,De=Me===1&&Oe?ht&&Ie!==null?ho(u,Ie,1):ge!==null?nt(ge,1):null:null,Ue=Ae&&Ae.url!==(ze==null?void 0:ze.url)?Ae:null,Ce=De&&De.url!==(be==null?void 0:be.url)?De:null,Ne=ze&&tt?(()=>{const M=ht?Dl(u,p,-1):t.length>2?nt((n-1+t.length)%t.length,-1):null;return M&&M.url!==ze.url?M:null})():null,Be=be&&tt?(()=>{const M=ht?Dl(u,p,1):t.length>2?nt((n+1)%t.length,1):null;return M&&M.url!==be.url?M:null})():null,Ke=Ue??Ne,ct=Ce??Be,Je=s.useCallback((M,xe,Re)=>{if(!M||!xe||!Re)return;const ke=H.current,et=ke.get(M);(et==null?void 0:et.width)===xe&&(et==null?void 0:et.height)===Re||(ke.set(M,{width:xe,height:Re}),R(Pt=>Pt+1))},[]),$t=s.useCallback(M=>{if(!(M!=null&&M.url))return null;const xe=H.current.get(M.url);return m0(f.current,xe)},[I,F]),dt=s.useCallback(()=>{if(!K)return;const M=$t(K);if(M){ie(M);return}const xe=f.current;xe&&ie(jl(xe))},[K,$t]),_e=s.useCallback(M=>{if(ht){const xe=u.length;ue((p+M+xe)%xe),ve(null);return}t.length>1&&(ve((n+M+t.length)%t.length),ue(null))},[ht,u.length,p,t.length,n]),Xe=s.useCallback(M=>{D.current=M,te(M)},[]),je=s.useCallback(()=>{P.current!==null&&(window.clearTimeout(P.current),P.current=null)},[]),ut=s.useCallback(()=>{je(),P.current=window.setTimeout(()=>{je(),Xe(!1)},lo+32)},[je,Xe]),pt=s.useCallback(()=>{const M=L.current;if(!M){ae({left:0,top:0,width:typeof window<"u"?window.innerWidth:ba.width,height:typeof window<"u"?window.innerHeight:ba.height});return}const xe=M.getBoundingClientRect();ae({left:xe.left,top:xe.top,width:xe.width,height:xe.height})},[]),mt=s.useCallback((M,xe)=>{if(Oe){if(fe&&!Q)return`translate(${re}px, 0px)`;if(Q&&Me!==null){const Re=$t(M);if(!Re)return;const{x:ke,y:et}=v0(Re,xe,Me,W);return`translate(${ke}px, ${et}px)`}if(Q)return"translate(0px, 0px)"}},[Oe,fe,Q,re,Me,W,$t]),kt=s.useCallback(()=>{const M=B.current;B.current=null,je(),Xe(!1),we(null),ue(null),ve(null),z(0),ce(!1),k.current=!1,A.current=0,v.current="none",M===-1?m():M===1&&y()},[je,Xe,m,y]),Kt=s.useCallback(()=>{je(),P.current=window.setTimeout(()=>{B.current!==null&&kt()},lo+32)},[je,kt]),Yt=s.useCallback(()=>{je(),B.current=null,Xe(!1),we(null),ue(null),ve(null),z(0),ce(!1),k.current=!1,A.current=0,v.current="none"},[je,Xe]),vt=s.useCallback(M=>{if(!(!tt||!le)){if(D.current){if(B.current===M){O.current=M,kt();return}Yt()}je(),_e(M),B.current=M,we(M),Xe(!0),Kt()}},[tt,le,kt,Yt,je,_e,Xe,Kt]);V.current=vt;const bt=s.useCallback(()=>{ee.current=null,j.current=!1,E.current!==null&&(window.clearInterval(E.current),E.current=null),N.current!==null&&(window.clearTimeout(N.current),N.current=null)},[]),Gt=s.useCallback(M=>{E.current!==null&&window.clearInterval(E.current);const xe=j.current?s0:a0;E.current=window.setInterval(()=>{V.current(M)},xe)},[]),Ft=s.useCallback(M=>{ee.current!==M&&(bt(),ee.current=M,j.current=!1,V.current(M),Gt(M),N.current=window.setTimeout(()=>{N.current=null,ee.current===M&&(j.current=!0,Gt(M))},r0))},[bt,Gt]),xt=s.useCallback(()=>{const M=f.current;if(!M)return;const xe=K==null?void 0:K.url,Re=xe?H.current.get(xe):void 0;if(Re!=null&&Re.width&&(Re!=null&&Re.height)){ie(Ba(M,Re.width,Re.height));return}const ke=S.current;if(ke&&xe&&(ke.src===xe||ke.currentSrc===xe)){const{width:Pt,height:Ye}=p0(ke);if(Pt&&Ye){Je(xe,Pt,Ye),ie(Ba(M,Pt,Ye));return}}const et=jl(M);!et.width||!et.height||ie(et)},[K==null?void 0:K.url,Je]),Ht=s.useCallback(M=>{if(S.current=M,!!M){if(M instanceof HTMLVideoElement){M.readyState>=1&&M.videoWidth>0&&xt();return}M.complete&&M.naturalWidth>0&&xt()}},[xt]),Ut=s.useCallback(()=>{pt(),xt(),J(M=>M+1)},[pt,xt]);s.useEffect(()=>{Ut();const M=f.current,xe=L.current,Re=new ResizeObserver(()=>Ut());return M&&Re.observe(M),xe&&Re.observe(xe),window.addEventListener("resize",Ut),()=>{Re.disconnect(),window.removeEventListener("resize",Ut)}},[Ut,n,w]),s.useLayoutEffect(()=>{if(!K)return;const M=S.current;if(M){if(M instanceof HTMLImageElement&&M.complete&&M.naturalWidth>0){xt();return}M instanceof HTMLVideoElement&&M.readyState>=1&&M.videoWidth>0&&xt()}},[K==null?void 0:K.url,n,xt]),s.useEffect(()=>{dt()},[dt,I]),s.useEffect(()=>{const M=new Set,xe=[],Re=ke=>{!(ke!=null&&ke.url)||M.has(ke.url)||(M.add(ke.url),xe.push(ke))};t.forEach(Re),u.forEach(ke=>ke.items.forEach(Re)),xe.forEach(ke=>{H.current.has(ke.url)||g0(ke,Je)})},[t,u,Je]),s.useEffect(()=>{if(Y!=="opening"||!le)return;if(!b){Z("open");return}de(!1);const M=requestAnimationFrame(()=>{requestAnimationFrame(()=>{de(!0),Z("open")})});return()=>cancelAnimationFrame(M)},[Y,le,b]),s.useEffect(()=>{if(Y!=="closing")return;const M=setTimeout(()=>g(),Ln);return()=>clearTimeout(M)},[Y,g]),s.useEffect(()=>()=>{je()},[je]),s.useLayoutEffect(()=>{Ee.current===n&&pe.current===(K==null?void 0:K.url)||(je(),B.current=null,we(null),ue(null),ve(null),se(0),z(0),Xe(!1),oe(!1),ce(!1),x.current=0,A.current=0,v.current="none",k.current=!1,$.current=null,T.current=!1,S.current=null,dt(),Ee.current=n,pe.current=K==null?void 0:K.url)},[n,K==null?void 0:K.url,Xe,je,dt]),s.useLayoutEffect(()=>{const M=O.current;M!==null&&(O.current=null,requestAnimationFrame(()=>{V.current(M)}))},[n,p,K==null?void 0:K.url]),s.useLayoutEffect(()=>{if(Y==="opening"){G.current=!1,Le(!1);return}if(Y!=="open"||G.current)return;if(!ze&&!be){G.current=!0;return}Le(!1);const M=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Le(!0),G.current=!0})});return()=>cancelAnimationFrame(M)},[Y,ze==null?void 0:ze.url,be==null?void 0:be.url]),s.useEffect(()=>{if(Y!=="open")return;const M=()=>{const Ye=ft=>{ft.stopPropagation(),ft.preventDefault(),document.removeEventListener("click",Ye,!0)};document.addEventListener("click",Ye,!0)},xe=Ye=>{const ft=Ye<0?1:-1;je(),_e(ft),B.current=ft,we(ft),Xe(!0),Kt()},Re=Ye=>{if(Math.abs(Ye)>o0&&tt){xe(Ye);return}B.current=null,we(null),ue(null),ve(null),Xe(!0),z(0),ut()},ke=Ye=>{if(Ye.touches.length!==1||D.current)return;const ft=Ye.touches[0];T.current=!0,$.current={x:ft.clientX,y:ft.clientY},v.current="none",A.current=0,k.current=!1},et=Ye=>{if(!$.current||Ye.touches.length!==1||D.current)return;const ft=Ye.touches[0],Nt=ft.clientX-$.current.x,Tt=ft.clientY-$.current.y;if(v.current==="none"){if(Math.abs(Nt)<10&&Math.abs(Tt)<10)return;if(Math.abs(Nt)>Math.abs(Tt)){if(!tt)return;v.current="horizontal"}else if(Tt>0){if(!lt)return;v.current="vertical"}else return}if(v.current==="horizontal"){k.current=!0,ce(!0),A.current=Nt,z(Nt),Ye.preventDefault();return}v.current==="vertical"&&(k.current=!0,ce(!0),x.current=Tt,se(Tt),Ye.preventDefault())},Pt=()=>{if(!$.current)return;const Ye=v.current,ft=k.current;if(ft&&Ye==="horizontal")Re(A.current),M();else if(ft&&Ye==="vertical"){const Nt=x.current;if(lt&&Nt>i0){const Tt=window.innerHeight;x.current=Tt,oe(!0),se(Tt),Z("closing")}else x.current=0,se(0);M()}else Ye==="horizontal"&&Math.abs(A.current)>0&&(Re(A.current),M());$.current=null,v.current="none",A.current=0,k.current=!1,ce(!1)};return document.addEventListener("touchstart",ke,{passive:!0}),document.addEventListener("touchmove",et,{passive:!1}),document.addEventListener("touchend",Pt),document.addEventListener("touchcancel",Pt),()=>{document.removeEventListener("touchstart",ke),document.removeEventListener("touchmove",et),document.removeEventListener("touchend",Pt),document.removeEventListener("touchcancel",Pt)}},[Y,tt,Xe,ut,je,lt,Kt,_e]);const Zt=s.useCallback(()=>{const M=(h==null?void 0:h())??b??null;M&&le&&(Se(M),de(!0)),Z("closing")},[h,b,le]);s.useEffect(()=>{const M=ke=>{if(ke.key==="Escape"){if(r&&d||Y==="closing")return;bt(),Zt();return}if(ke.key!=="ArrowLeft"&&ke.key!=="ArrowRight"||Y!=="open"||!tt)return;ke.preventDefault();const et=ke.key==="ArrowLeft"?-1:1;ke.repeat&&ee.current===et||Ft(et)},xe=ke=>{if(ke.key!=="ArrowLeft"&&ke.key!=="ArrowRight")return;const et=ke.key==="ArrowLeft"?-1:1;ee.current===et&&bt()},Re=()=>{bt()};return window.addEventListener("keydown",M),window.addEventListener("keyup",xe),window.addEventListener("blur",Re),()=>{window.removeEventListener("keydown",M),window.removeEventListener("keyup",xe),window.removeEventListener("blur",Re),bt()}},[Y,r,d,Zt,tt,Ft,bt]),s.useEffect(()=>{Y!=="open"&&bt()},[Y,bt]);const tn=()=>{Y==="closing"||l||Zt()},Ct=Y==="open",jt=Y==="closing",dn=ye>0?Math.max(0,1-ye/500):1,at=ye>0?Math.max(.35,1-ye/500):1,Te=s.useCallback(M=>{if(!(M.propertyName!=="transform"||!D.current)){if(B.current!==null){kt();return}je(),Xe(!1)}},[je,Xe,kt]),We=Y==="closing"?he??b:b,Qe=We&&le&&(Y==="opening"||jt)?l0(We,le):void 0,st=Oe&&K?mt(K,"center"):ye>0?`translateY(${ye}px)`:Qe,gt=le?sr(le,W):null,Rt=!!(We&&le),ot=Rt&&(Y==="closing"||Y==="open"&&q),Ot={position:"absolute",top:gt==null?void 0:gt.top,left:gt==null?void 0:gt.left,width:gt==null?void 0:gt.width,height:gt==null?void 0:gt.height,objectFit:"contain",transformOrigin:"top left",transform:st,opacity:ye>0?at:Rt?1:Y==="opening"||jt?0:1,transition:fe&&!Q?"none":Q?`transform ${lo}ms ${mn}`:U?`transform ${Ln}ms ${mn}, opacity ${Ln}ms ${mn}`:ot?`transform ${Ln}ms ${mn}`:Y==="opening"||jt?`opacity ${Ln}ms ${mn}`:"none",pointerEvents:Ve&&Ct&&!Oe?"auto":"none",touchAction:Ve&&Ct?"none":void 0,zIndex:1,overflow:Ve?"hidden":void 0},Et={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ct&&!Oe?"auto":"none"},Mt=(M,xe,Re="adjacent")=>{const ke=$t(M);if(!ke)return{display:"none"};const et=Re==="far"?xe==="left"?"far-left":"far-right":xe==="left"?"left-adjacent":"right-adjacent",{start:Pt}=Me!==null?Td(ke,et,Me,W):{start:Re==="far"?Pr(ke,xe,W):Ki(ke,xe,W)},Ye=sr(Pt,W),ft=mt(M,et),Nt=!Oe&&Re==="adjacent"&&Ct&&!Pe?x0(ke,xe,W):null,Tt=Re==="far"&&Oe&&Me===(xe==="left"?-1:1),nn=fe&&!Q?!1:Q,un=Re==="adjacent"&&Ct&&Pe&&!Oe;return{position:"absolute",top:Ye.top,left:Ye.left,width:Ye.width,height:Ye.height,objectFit:"contain",transform:ft??(Nt?`translate(${Nt.x}px, ${Nt.y}px)`:void 0),opacity:Re==="far"?Ct&&Tt?1:0:Ct?1:0,transition:nn?Re==="far"?`transform ${lo}ms ${mn}`:`transform ${lo}ms ${mn}, opacity ${Ln}ms ${mn}`:un?`transform ${Ln}ms ${mn}`:Y==="opening"||jt?`opacity ${Ln}ms ${mn}`:"none",pointerEvents:"none",zIndex:1}},Bt=(M,xe)=>{const Re=$t(M);return Re?y0(Ki(Re,xe,W),xe,W):null},zt=M=>xe=>{if(!l){if(T.current){T.current=!1;return}xe.stopPropagation(),vt(M)}},_t=ze?Bt(ze,"left"):null,Wt=be?Bt(be,"right"):null,At=_t?sr(_t,W):null,wt=Wt?sr(Wt,W):null;return a.jsxs("div",{ref:L,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:Y==="open"?"none":void 0},onClick:tn,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ct?dn:0,transition:fe?"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:f,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Ct?1:0,transition:fe?"none":`opacity ${Ln}ms ${mn}`,pointerEvents:"none"},children:a.jsx(rd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:tn})})]}),Ct&&Ke&&a.jsx(lr,{media:Ke,style:Mt(Ke,"left","far"),onMeasure:Je,onTransitionEnd:Te},`far-prev-${Ke.url}`),Ct&&ze&&a.jsxs(a.Fragment,{children:[a.jsx(lr,{media:ze,style:Mt(ze,"left"),onMeasure:Je,onTransitionEnd:Te},`prev-${ze.url}`),At&&a.jsx("div",{style:{position:"absolute",top:At.top,left:At.left,width:At.width,height:At.height,cursor:l||fe?"default":"pointer",pointerEvents:l||fe?"none":"auto",zIndex:3},onClick:zt(-1)})]}),Ct&&be&&a.jsxs(a.Fragment,{children:[a.jsx(lr,{media:be,style:Mt(be,"right"),onMeasure:Je,onTransitionEnd:Te},`next-${be.url}`),wt&&a.jsx("div",{style:{position:"absolute",top:wt.top,left:wt.left,width:wt.width,height:wt.height,cursor:l||fe?"default":"pointer",pointerEvents:l||fe?"none":"auto",zIndex:3},onClick:zt(1)})]}),Ct&&ct&&a.jsx(lr,{media:ct,style:Mt(ct,"right","far"),onMeasure:Je,onTransitionEnd:Te},`far-next-${ct.url}`),le&&K&&(Ve?a.jsx(b0,{src:K.url,phase:Y,onMediaElement:Ht,wrapperStyle:Ot,videoStyle:Et,onLoadedMetadata:xt,onTransitionEnd:Te},`${n}-${K.url}`):a.jsx("img",{ref:Ht,src:K.url,alt:K.name,onLoad:xt,onTransitionEnd:Te,style:Ot},`${n}-${K.url}`))]})}const S0=20,$0=.18;function C0(e){return`
17724
17724
  .${e}-wrapper {
17725
17725
  box-sizing: border-box;
17726
17726
  max-width: 100%;
@@ -17808,7 +17808,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
17808
17808
  pointer-events: auto;
17809
17809
  }
17810
17810
  ${n0(e)}
17811
- `}function T0(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 L0(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 R0(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:_.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:_.scalingValue(i*$0,n??!1),[`--${t}-image-aspect`]:T0(e)}}function I0(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 qt(n,t)}function P0(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 M0(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?$d(d,o):void 0)}}function E0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=_.useScopedStyles(),c=s.useMemo(()=>C0(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",w=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,b=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,h=_.scalingValue(b,n??!1),g=`max(${h}, ${S0}px)`,{objectFitMode:m,imageStyle:v}=P0(e),L=I0(e,n),f=s.useRef(null),[S,H]=s.useState(!1),[P,R]=s.useState([]),[$,x]=s.useState(0),[A,y]=s.useState(0),[F,T]=s.useState(null),[j,E]=s.useState({title1:"",title2:"",title3:""}),B=(!n||i)&&!S,O=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},z=O.sizeType??"none",ee=B&&z!=="none"?`${d}-item-image-hover-${z}`:void 0,k=(O.value??120)/100,W=s.useCallback(ae=>{!ae||z!=="scale"||(ae.style.transformOrigin=Ym(ae))},[z]),D=s.useCallback(ae=>{if(ae){if(m==="contain"){const V=L0(ae);if(V){const J=ae.closest(`.${d}-item-image`);J instanceof HTMLElement&&J.style.setProperty(`--${d}-item-media-aspect`,String(V))}}W(ae)}},[d,W,m]),le={width:_.scalingValue(w,n??!1),...L,...R0(e,d,n),[`--${d}-image-hover-scale`]:String(k)},Y=(()=>{const ae={},V=f.current?getComputedStyle(f.current).getPropertyValue("--cntrl-article-width").trim():"";return V&&(ae["--cntrl-article-width"]=V),ae})(),I=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),oe=s.useMemo(()=>d0(u),[u]),N=s.useMemo(()=>h0(u),[u]),ie=(ae,V)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const J=oe.findIndex(Me=>Me.gridIndex===ae);if(J<0)return;const Q=oe[J];y(J),R(Q.items),x(0),E(Q.entry),T(V??null),H(!0)},Z=s.useCallback(()=>{H(!1),T(null)},[]),te=s.useCallback(()=>{const ae=oe[A];return!ae||!f.current?F:c0(f.current,ae.gridIndex,m)??F},[oe,A,F,m]),Se=s.useCallback(ae=>{if(oe.length>1){const V=oe.length,J=(A+ae+V)%V,Q=oe[J];y(J),R(Q.items),x(0),E(Q.entry);return}x(V=>(V+ae+P.length)%P.length)},[oe,A,P.length]),se=oe.length>1||P.length>1;return s.useEffect(()=>{if(!S||typeof document>"u")return;const ae=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ae}},[S]),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(f0,{mediaList:N}),a.jsx("div",{ref:f,className:`${d}-wrapper ${d}-type-${p}`,style:le,children:u.map((ae,V)=>{var Me,be;const J=!!((Me=ae.image)!=null&&Me.url),Q=M0(!!I,J,V,d,m,ie);return a.jsxs("div",{className:`${d}-item`,children:[ae.title?a.jsx("span",{className:`${d}-item-title`,onClick:Q,style:Q?{cursor:"pointer"}:void 0,children:ae.title}):null,(be=ae.image)!=null&&be.url?a.jsx("span",{className:[`${d}-item-image`,m==="contain"?`${d}-item-image-fit`:void 0,ee].filter(Boolean).join(" "),children:ae.image.type==="video"?a.jsx("video",{ref:D,src:ae.image.url,"data-waterfall-index":V,style:v,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:Q,onLoadedData:Ie=>D(Ie.currentTarget)}):a.jsx("img",{ref:D,src:ae.image.url,alt:ae.image.name??"","data-waterfall-index":V,style:v,onClick:Q,onLoad:Ie=>D(Ie.currentTarget)})}):null,V<u.length-1&&a.jsx("div",{className:`${d}-item-gap-host`,style:{width:h},children:o&&!S&&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:g,height:"100%"}})})]},V)})}),S&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const ae=(l?document.getElementById(l):null)??document.body;return Dn.createPortal(a.jsx("div",{style:Y,"data-selection":"none",children:a.jsx(w0,{prefix:d,items:P,index:$,entry:j,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:se,lightboxEntries:oe,entryIdx:A,layoutId:r,sourceRect:F,resolveCloseSourceRect:te,onClose:Z,onPrev:()=>Se(-1),onNext:()=>Se(1)})}),ae)})()]})}const k0=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
17811
+ `}function T0(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 L0(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 R0(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:_.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:_.scalingValue(i*$0,n??!1),[`--${t}-image-aspect`]:T0(e)}}function I0(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 qt(n,t)}function P0(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 M0(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?$d(d,o):void 0)}}function E0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=_.useScopedStyles(),c=s.useMemo(()=>C0(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",w=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,b=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,h=_.scalingValue(b,n??!1),g=`max(${h}, ${S0}px)`,{objectFitMode:m,imageStyle:y}=P0(e),L=I0(e,n),f=s.useRef(null),[S,H]=s.useState(!1),[I,R]=s.useState([]),[$,x]=s.useState(0),[A,v]=s.useState(0),[k,T]=s.useState(null),[D,P]=s.useState({title1:"",title2:"",title3:""}),B=(!n||i)&&!S,O=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},V=O.sizeType??"none",ee=B&&V!=="none"?`${d}-item-image-hover-${V}`:void 0,E=(O.value??120)/100,N=s.useCallback(re=>{!re||V!=="scale"||(re.style.transformOrigin=Ym(re))},[V]),j=s.useCallback(re=>{if(re){if(m==="contain"){const z=L0(re);if(z){const Q=re.closest(`.${d}-item-image`);Q instanceof HTMLElement&&Q.style.setProperty(`--${d}-item-media-aspect`,String(z))}}N(re)}},[d,N,m]),le={width:_.scalingValue(w,n??!1),...L,...R0(e,d,n),[`--${d}-image-hover-scale`]:String(E)},ie=(()=>{const re={},z=f.current?getComputedStyle(f.current).getPropertyValue("--cntrl-article-width").trim():"";return z&&(re["--cntrl-article-width"]=z),re})(),W=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),ae=s.useMemo(()=>d0(u),[u]),F=s.useMemo(()=>h0(u),[u]),J=(re,z)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const Q=ae.findIndex(Me=>Me.gridIndex===re);if(Q<0)return;const te=ae[Q];v(Q),R(te.items),x(0),P(te.entry),T(z??null),H(!0)},Y=s.useCallback(()=>{H(!1),T(null)},[]),Z=s.useCallback(()=>{const re=ae[A];return!re||!f.current?k:c0(f.current,re.gridIndex,m)??k},[ae,A,k,m]),ye=s.useCallback(re=>{if(ae.length>1){const z=ae.length,Q=(A+re+z)%z,te=ae[Q];v(Q),R(te.items),x(0),P(te.entry);return}x(z=>(z+re+I.length)%I.length)},[ae,A,I.length]),se=ae.length>1||I.length>1;return s.useEffect(()=>{if(!S||typeof document>"u")return;const re=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=re}},[S]),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(f0,{mediaList:F}),a.jsx("div",{ref:f,className:`${d}-wrapper ${d}-type-${p}`,style:le,children:u.map((re,z)=>{var Me,we;const Q=!!((Me=re.image)!=null&&Me.url),te=M0(!!W,Q,z,d,m,J);return a.jsxs("div",{className:`${d}-item`,children:[re.title?a.jsx("span",{className:`${d}-item-title`,onClick:te,style:te?{cursor:"pointer"}:void 0,children:re.title}):null,(we=re.image)!=null&&we.url?a.jsx("span",{className:[`${d}-item-image`,m==="contain"?`${d}-item-image-fit`:void 0,ee].filter(Boolean).join(" "),children:re.image.type==="video"?a.jsx("video",{ref:j,src:re.image.url,"data-waterfall-index":z,style:y,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:te,onLoadedData:Ie=>j(Ie.currentTarget)}):a.jsx("img",{ref:j,src:re.image.url,alt:re.image.name??"","data-waterfall-index":z,style:y,onClick:te,onLoad:Ie=>j(Ie.currentTarget)})}):null,z<u.length-1&&a.jsx("div",{className:`${d}-item-gap-host`,style:{width:h},children:o&&!S&&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:g,height:"100%"}})})]},z)})}),S&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const re=(l?document.getElementById(l):null)??document.body;return Dn.createPortal(a.jsx("div",{style:ie,"data-selection":"none",children:a.jsx(w0,{prefix:d,items:I,index:$,entry:D,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:se,lightboxEntries:ae,entryIdx:A,layoutId:r,sourceRect:k,resolveCloseSourceRect:Z,onClose:Y,onPrev:()=>ye(-1),onNext:()=>ye(1)})}),re)})()]})}const k0=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
17812
17812
  import type React from 'react';
17813
17813
  import { createPortal } from 'react-dom';
17814
17814
  import { CommonComponentProps } from '../props';
@@ -18592,7 +18592,7 @@ export function Waterfall({
18592
18592
  from { clip-path: inset(100% 0 0 0); }
18593
18593
  to { clip-path: inset(0 0 0 0); }
18594
18594
  }
18595
- `}function ex({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=_.useScopedStyles(),l=X0(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??zl,p=u.sizeType??"drag",w=u.value??zl.value,b=(e==null?void 0:e.direction)??"horizontal",h=(e==null?void 0:e.transition)??"slide",g=(e==null?void 0:e.nav)??"classic",m=(e==null?void 0:e.navSize)??"m",v=U0[m],L=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,f=xe=>_.scalingValue(xe*L,n),S=(e==null?void 0:e.show)??"always",H=(e==null?void 0:e.controls)??null,P=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,R=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,$=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,x=(e==null?void 0:e.controlsColor)??Bl.color,A=(e==null?void 0:e.controlsHoverColor)??Bl.hover,y=(e==null?void 0:e.navColor)??co.colors.inactive,F=(e==null?void 0:e.navPaginationColor)??co.colors.pagination,T=(e==null?void 0:e.navBackgroundColor)??co.colors.background,j=(e==null?void 0:e.linkColor)??Sa.linkColor,E=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,B=b==="horizontal",O=p==="click",z=p==="drag",ee=p==="auto"&&(!n||!!i),k=!n,W=h==="slide",D=g==="classic",le=S!=="never",Y=S==="on hover",I=_.scalingValue(P,n),oe={width:I,height:I,maxWidth:I},N=W&&c>1,[ie,Z]=s.useState(0),[te,Se]=s.useState(N?1:0),[se,ae]=s.useState(!1),[V,J]=s.useState(!1),[Q,Me]=s.useState(!1),[be,Ie]=s.useState(0),[ue,ge]=s.useState(!1),[ye,q]=s.useState(!1),de=s.useRef(!1),he=s.useRef(te);he.current=te;const we=s.useRef(null),Pe=s.useRef(0),Le=s.useRef(null),G=s.useRef(null),fe=s.useRef(null),ce=s.useRef(null),U=s.useCallback(xe=>{de.current=xe,ae(xe)},[]),re=s.useCallback(xe=>{if(c<2||xe===0)return;const Ae=xe>0?1:-1,De=Math.abs(xe);if(ge(!0),U(!0),!W){Z(ct=>fo(ct+xe,c));return}let Ue=he.current;const Ce=N&&(Ue===0||Ue===c+1),Ne=Ce?ie+1:null;Ce&&(Ue=ie+1);let Be=De;for(;Be>0;){const ct=K0(Ue,Ae,c,N);if(Ue=ct.position,Be-=1,ct.hitBoundary){Pe.current=Be*Ae;break}}const Ke=De-Be;if(Ke>0&&Z(ct=>fo(ct+Ke*Ae,c)),he.current=Ue,Ne!==null){if(he.current=Ne,Ue===Ne){J(!0),Se(Ue);return}we.current=Ue,J(!0),Se(Ne);return}J(!1),Se(Ue)},[ie,c,N,W,U]),Ee=s.useCallback(xe=>{re(xe)},[re]),pe=s.useCallback(xe=>{if(c<2)return;const Ae=fo(xe,c);if(!(Ae===ie&&!de.current)&&(ge(!0),U(!0),Z(Ae),W)){const De=Ae+(N?1:0);we.current=null,Pe.current=0,he.current=De,J(!1),Se(De)}},[ie,c,N,W,U]);s.useEffect(()=>{if(!se)return;const xe=window.setTimeout(()=>{if(N&&(te===0||te===c+1)){we.current=null,J(!0),Se(ie+1);return}U(!1)},Ni);return()=>window.clearTimeout(xe)},[ie,c,N,se,U,te]),s.useEffect(()=>{if(!V)return;let xe=0;const Ae=requestAnimationFrame(()=>{xe=requestAnimationFrame(()=>{const De=we.current;we.current=null;const Ue=Pe.current;if(Pe.current=0,J(!1),De!==null){he.current=De,Se(De);return}if(Ue!==0){re(Ue);return}U(!1)})});return()=>{cancelAnimationFrame(Ae),cancelAnimationFrame(xe)}},[re,U,V]);const K=`${N}:${c}`,Ve=s.useRef(K);s.useEffect(()=>{if(Ve.current===K)return;Ve.current=K;const xe=c>0?Math.min(ie,c-1):0;fe.current=null,ce.current=null,Me(!1),Ie(0),Z(xe),J(!0),Se(xe+(N?1:0))},[ie,c,N,K]),s.useEffect(()=>{if(!ue)return;const xe=window.setTimeout(()=>ge(!1),j0);return()=>window.clearTimeout(xe)},[ue,ie]),s.useEffect(()=>{if(!ee||c<2)return;const xe=Math.max(w,.1)*1e3,Ae=window.setInterval(()=>{k&&ye||Ee(1)},xe);return()=>window.clearInterval(Ae)},[w,c,Ee,ee,ye,k]);const Oe=s.useCallback(xe=>{const Ae=fe.current;if(!Ae||Ae.pointerId!==xe.pointerId)return;fe.current=null,ce.current=null;const De=Le.current;if(De!=null&&De.hasPointerCapture(xe.pointerId)&&De.releasePointerCapture(xe.pointerId),!Ae.isActive){W&&Ie(0);return}const Ce=!(xe.timeStamp-Ae.lastTime>G0)&&Math.abs(Ae.velocity)>V0,Ne=Ae.size>0&&Math.abs(Ae.offset-Ae.baseOffset)>Ae.size*z0;if(Me(!1),!Ce&&!Ne){Ie(0);return}const Be=Ne?Ae.offset-Ae.baseOffset:Ae.velocity;let Ke=1;Ne&&Ae.size>0&&(Ke=Math.max(1,Math.round(Math.abs(Be)/Ae.size))),Ie(0),re(Be<0?Ke:-Ke)},[re,W]);s.useEffect(()=>{const xe=Ae=>{ce.current===null||Ae.pointerId!==ce.current||Oe(Ae)};return window.addEventListener("pointerup",xe),window.addEventListener("pointercancel",xe),()=>{window.removeEventListener("pointerup",xe),window.removeEventListener("pointercancel",xe)}},[Oe]);const lt=xe=>{const Ae=Le.current;if(!z||c<2||!Ae||xe.pointerType==="mouse"&&xe.button!==0)return;we.current=null,Pe.current=0,de.current&&U(!1);let De=0;const Ue=G.current;if(W&&Ue){const Ce=B?Ue.offsetWidth:Ue.offsetHeight;if(Ce>0){const Ne=Y0(Ue,B);let Be=he.current;N&&(Be===0||Be===c+1)?(Be=ie+1,he.current=Be,J(!0),Se(Be),De=0):De=Ne+Be*Ce,Ie(De)}}Ae.setPointerCapture(xe.pointerId),ce.current=xe.pointerId,fe.current={pointerId:xe.pointerId,startClientX:xe.clientX,startClientY:xe.clientY,axes:Z0(Ae,`${r}-axis-probe`),size:B?Ae.offsetWidth:Ae.offsetHeight,isActive:!1,baseOffset:De,offset:De,lastTime:xe.timeStamp,velocity:0}},tt=xe=>{const Ae=fe.current;if(!Ae||Ae.pointerId!==xe.pointerId)return;if(xe.pointerType==="mouse"&&xe.buttons===0){Oe(xe);return}const De=xe.clientX-Ae.startClientX,Ue=xe.clientY-Ae.startClientY,Ce=Ae.axes?J0(Ae.axes,De,Ue):{x:De,y:Ue},Ne=B?Ce.x:Ce.y,Be=B?Ce.y:Ce.x,Ke=Ae.baseOffset+Ne;if(!Ae.isActive){if(Math.max(Math.abs(Ne),Math.abs(Be))<B0)return;if(Math.abs(Be)>Math.abs(Ne)){const Je=Le.current;Je!=null&&Je.hasPointerCapture(Ae.pointerId)&&Je.releasePointerCapture(Ae.pointerId),fe.current=null,ce.current=null,W&&Ie(0);return}Ae.isActive=!0,Me(!0)}const ct=xe.timeStamp-Ae.lastTime;ct>0&&(Ae.velocity=(Ke-Ae.offset)/ct,Ae.lastTime=xe.timeStamp),Ae.offset=Ke,W&&Ie(Ke)},ht=xe=>{Oe(xe)},nt=B?`translate3d(calc(${-te*100}% + ${be}px), 0, 0)`:`translate3d(0, calc(${-te*100}% + ${be}px), 0)`,ze=N?[d[c-1],...d,d[0]]:d;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Q0(r,n)}}),a.jsxs("div",{className:rt(`${r}-wrapper`,{[`${r}-transition-reveal`]:h==="reveal",[`${r}-transition-reveal-vertical`]:h==="reveal"&&!B}),onMouseEnter:()=>q(!0),onMouseLeave:()=>q(!1),children:[a.jsxs("div",{className:`${r}-slider-inner`,style:{backgroundColor:"transparent"},children:[a.jsx("div",{ref:Le,className:rt(`${r}-track`,{[`${r}-track-draggable`]:z,[`${r}-track-draggable-vertical`]:z&&!B}),onPointerDown:lt,onPointerMove:tt,onPointerUp:ht,onPointerCancel:ht,onLostPointerCapture:xe=>{ce.current===xe.pointerId&&Oe(xe)},children:a.jsx("div",{ref:G,className:rt(`${r}-list`,{[`${r}-list-slide`]:W,[`${r}-list-slide-vertical`]:W&&!B,[`${r}-list-fade`]:!W}),style:W?{transform:nt,transition:Q||V?"none":`transform ${Ni}ms ${Ld}`}:void 0,children:ze.map((xe,Ae)=>{const De=N?fo(Ae-1,c):Ae,Ce=N&&(Ae===0||Ae===c+1)?`clone-${Ae===0?"start":"end"}`:`slide-${De}`;return a.jsx("div",{className:rt(`${r}-slide`,{[`${r}-is-active`]:!W&&De===ie}),children:a.jsx("div",{className:`${r}-slider-item`,children:a.jsx("div",{className:`${r}-img-wrapper`,children:a.jsx("img",{className:rt(`${r}-slider-image`,{[`${r}-contain`]:xe.image.objectFit==="contain",[`${r}-cover`]:xe.image.objectFit==="cover"}),src:xe.image.url,alt:xe.image.name??"",draggable:!1})})})},Ce)})})}),le&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:rt(`${r}-arrow`,{[`${r}-arrow-prev`]:B,[`${r}-arrow-prev-vertical`]:!B,[`${r}-hover-arrow`]:Y}),style:{color:x,"--arrow-hover-color":A,...oe},children:a.jsxs("button",{onClick:xe=>{xe.stopPropagation(),Ee(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${_.scalingValue(R,n)}, ${_.scalingValue($*(B?1:-1),n)}) rotate(${B?"0deg":"90deg"})`},children:[H&&a.jsx(an,{url:H,fill:x,hoverFill:A,className:rt(`${r}-arrow-img`,`${r}-mirror`),style:oe}),!H&&a.jsx(Vl,{color:x,className:rt(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:rt(`${r}-arrow`,{[`${r}-arrow-next`]:B,[`${r}-arrow-next-vertical`]:!B,[`${r}-hover-arrow`]:Y}),style:{color:x,"--arrow-hover-color":A,...oe},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:xe=>{xe.stopPropagation(),Ee(1)},style:{transform:`translate(${_.scalingValue(R*(B?-1:1),n)}, ${_.scalingValue($,n)}) rotate(${B?"0deg":"90deg"})`},children:[H&&a.jsx(an,{url:H,fill:x,hoverFill:A,className:`${r}-arrow-img`,style:oe}),!H&&a.jsx(Vl,{color:x,className:rt(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),O&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>Ee(1)}),D&&a.jsx("div",{className:rt(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:B,[`${r}-pagination-inside-left`]:!B}),style:B?{bottom:f(v.inset)}:{left:f(v.inset)},children:a.jsx("div",{className:rt(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!B,[`${r}-animate-dots`]:ue}),style:{backgroundColor:T,gap:f(v.gapInactive-v.activeDot+v.dot),...B?{height:f(v.activeDot+v.paddingY*2),paddingTop:f(v.paddingY),paddingBottom:f(v.paddingY),paddingLeft:f(v.paddingActive),paddingRight:f(v.paddingActive)}:{width:f(v.activeDot+v.paddingY*2),paddingLeft:f(v.paddingY),paddingRight:f(v.paddingY),paddingTop:f(v.paddingActive),paddingBottom:f(v.paddingActive)},borderRadius:f(v.borderRadius),transform:`translate(${_.scalingValue(co.offset.x,n)}, ${_.scalingValue(co.offset.y,n)})`},children:d.map((xe,Ae)=>{const De=Ae===ie,Ue=De?v.activeDot:v.dot;return a.jsx("button",{onClick:()=>pe(Ae),className:`${r}-pagination-item`,style:{width:f(v.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:De?F:y,width:f(Ue)}})},Ae)})},`${m}-${b}`)})]}),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:_.scalingValue(E,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:d.map((xe,Ae)=>a.jsx("div",{className:rt(`${r}-caption-text`,{[`${r}-with-pointer-events`]:Ae===ie&&n,[`${r}-active`]:Ae===ie}),style:{...l,width:"max-content",transitionDuration:`${Math.round(Ni/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":j,"--link-hover-color":j,position:"relative",top:_.scalingValue(Sa.offset.y,n),left:_.scalingValue(Sa.offset.x,n)},children:a.jsx(bi,{content:xe.imageCaption})})},Ae))})]})]})]})}function Vl({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 tx=`import React, { useCallback, useEffect, useRef, useState } from 'react';
18595
+ `}function ex({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=_.useScopedStyles(),l=X0(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??zl,p=u.sizeType??"drag",w=u.value??zl.value,b=(e==null?void 0:e.direction)??"horizontal",h=(e==null?void 0:e.transition)??"slide",g=(e==null?void 0:e.nav)??"classic",m=(e==null?void 0:e.navSize)??"m",y=U0[m],L=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,f=be=>_.scalingValue(be*L,n),S=(e==null?void 0:e.show)??"always",H=(e==null?void 0:e.controls)??null,I=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,R=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,$=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,x=(e==null?void 0:e.controlsColor)??Bl.color,A=(e==null?void 0:e.controlsHoverColor)??Bl.hover,v=(e==null?void 0:e.navColor)??co.colors.inactive,k=(e==null?void 0:e.navPaginationColor)??co.colors.pagination,T=(e==null?void 0:e.navBackgroundColor)??co.colors.background,D=(e==null?void 0:e.linkColor)??Sa.linkColor,P=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,B=b==="horizontal",O=p==="click",V=p==="drag",ee=p==="auto"&&(!n||!!i),E=!n,N=h==="slide",j=g==="classic",le=S!=="never",ie=S==="on hover",W=_.scalingValue(I,n),ae={width:W,height:W,maxWidth:W},F=N&&c>1,[J,Y]=s.useState(0),[Z,ye]=s.useState(F?1:0),[se,re]=s.useState(!1),[z,Q]=s.useState(!1),[te,Me]=s.useState(!1),[we,Ie]=s.useState(0),[ue,ge]=s.useState(!1),[ve,q]=s.useState(!1),de=s.useRef(!1),he=s.useRef(Z);he.current=Z;const Se=s.useRef(null),Pe=s.useRef(0),Le=s.useRef(null),G=s.useRef(null),fe=s.useRef(null),ce=s.useRef(null),U=s.useCallback(be=>{de.current=be,re(be)},[]),oe=s.useCallback(be=>{if(c<2||be===0)return;const Ae=be>0?1:-1,De=Math.abs(be);if(ge(!0),U(!0),!N){Y(ct=>fo(ct+be,c));return}let Ue=he.current;const Ce=F&&(Ue===0||Ue===c+1),Ne=Ce?J+1:null;Ce&&(Ue=J+1);let Be=De;for(;Be>0;){const ct=K0(Ue,Ae,c,F);if(Ue=ct.position,Be-=1,ct.hitBoundary){Pe.current=Be*Ae;break}}const Ke=De-Be;if(Ke>0&&Y(ct=>fo(ct+Ke*Ae,c)),he.current=Ue,Ne!==null){if(he.current=Ne,Ue===Ne){Q(!0),ye(Ue);return}Se.current=Ue,Q(!0),ye(Ne);return}Q(!1),ye(Ue)},[J,c,F,N,U]),Ee=s.useCallback(be=>{oe(be)},[oe]),pe=s.useCallback(be=>{if(c<2)return;const Ae=fo(be,c);if(!(Ae===J&&!de.current)&&(ge(!0),U(!0),Y(Ae),N)){const De=Ae+(F?1:0);Se.current=null,Pe.current=0,he.current=De,Q(!1),ye(De)}},[J,c,F,N,U]);s.useEffect(()=>{if(!se)return;const be=window.setTimeout(()=>{if(F&&(Z===0||Z===c+1)){Se.current=null,Q(!0),ye(J+1);return}U(!1)},Ni);return()=>window.clearTimeout(be)},[J,c,F,se,U,Z]),s.useEffect(()=>{if(!z)return;let be=0;const Ae=requestAnimationFrame(()=>{be=requestAnimationFrame(()=>{const De=Se.current;Se.current=null;const Ue=Pe.current;if(Pe.current=0,Q(!1),De!==null){he.current=De,ye(De);return}if(Ue!==0){oe(Ue);return}U(!1)})});return()=>{cancelAnimationFrame(Ae),cancelAnimationFrame(be)}},[oe,U,z]);const K=`${F}:${c}`,Ve=s.useRef(K);s.useEffect(()=>{if(Ve.current===K)return;Ve.current=K;const be=c>0?Math.min(J,c-1):0;fe.current=null,ce.current=null,Me(!1),Ie(0),Y(be),Q(!0),ye(be+(F?1:0))},[J,c,F,K]),s.useEffect(()=>{if(!ue)return;const be=window.setTimeout(()=>ge(!1),j0);return()=>window.clearTimeout(be)},[ue,J]),s.useEffect(()=>{if(!ee||c<2)return;const be=Math.max(w,.1)*1e3,Ae=window.setInterval(()=>{E&&ve||Ee(1)},be);return()=>window.clearInterval(Ae)},[w,c,Ee,ee,ve,E]);const Oe=s.useCallback(be=>{const Ae=fe.current;if(!Ae||Ae.pointerId!==be.pointerId)return;fe.current=null,ce.current=null;const De=Le.current;if(De!=null&&De.hasPointerCapture(be.pointerId)&&De.releasePointerCapture(be.pointerId),!Ae.isActive){N&&Ie(0);return}const Ce=!(be.timeStamp-Ae.lastTime>G0)&&Math.abs(Ae.velocity)>V0,Ne=Ae.size>0&&Math.abs(Ae.offset-Ae.baseOffset)>Ae.size*z0;if(Me(!1),!Ce&&!Ne){Ie(0);return}const Be=Ne?Ae.offset-Ae.baseOffset:Ae.velocity;let Ke=1;Ne&&Ae.size>0&&(Ke=Math.max(1,Math.round(Math.abs(Be)/Ae.size))),Ie(0),oe(Be<0?Ke:-Ke)},[oe,N]);s.useEffect(()=>{const be=Ae=>{ce.current===null||Ae.pointerId!==ce.current||Oe(Ae)};return window.addEventListener("pointerup",be),window.addEventListener("pointercancel",be),()=>{window.removeEventListener("pointerup",be),window.removeEventListener("pointercancel",be)}},[Oe]);const lt=be=>{const Ae=Le.current;if(!V||c<2||!Ae||be.pointerType==="mouse"&&be.button!==0)return;Se.current=null,Pe.current=0,de.current&&U(!1);let De=0;const Ue=G.current;if(N&&Ue){const Ce=B?Ue.offsetWidth:Ue.offsetHeight;if(Ce>0){const Ne=Y0(Ue,B);let Be=he.current;F&&(Be===0||Be===c+1)?(Be=J+1,he.current=Be,Q(!0),ye(Be),De=0):De=Ne+Be*Ce,Ie(De)}}Ae.setPointerCapture(be.pointerId),ce.current=be.pointerId,fe.current={pointerId:be.pointerId,startClientX:be.clientX,startClientY:be.clientY,axes:Z0(Ae,`${r}-axis-probe`),size:B?Ae.offsetWidth:Ae.offsetHeight,isActive:!1,baseOffset:De,offset:De,lastTime:be.timeStamp,velocity:0}},tt=be=>{const Ae=fe.current;if(!Ae||Ae.pointerId!==be.pointerId)return;if(be.pointerType==="mouse"&&be.buttons===0){Oe(be);return}const De=be.clientX-Ae.startClientX,Ue=be.clientY-Ae.startClientY,Ce=Ae.axes?J0(Ae.axes,De,Ue):{x:De,y:Ue},Ne=B?Ce.x:Ce.y,Be=B?Ce.y:Ce.x,Ke=Ae.baseOffset+Ne;if(!Ae.isActive){if(Math.max(Math.abs(Ne),Math.abs(Be))<B0)return;if(Math.abs(Be)>Math.abs(Ne)){const Je=Le.current;Je!=null&&Je.hasPointerCapture(Ae.pointerId)&&Je.releasePointerCapture(Ae.pointerId),fe.current=null,ce.current=null,N&&Ie(0);return}Ae.isActive=!0,Me(!0)}const ct=be.timeStamp-Ae.lastTime;ct>0&&(Ae.velocity=(Ke-Ae.offset)/ct,Ae.lastTime=be.timeStamp),Ae.offset=Ke,N&&Ie(Ke)},ht=be=>{Oe(be)},nt=B?`translate3d(calc(${-Z*100}% + ${we}px), 0, 0)`:`translate3d(0, calc(${-Z*100}% + ${we}px), 0)`,ze=F?[d[c-1],...d,d[0]]:d;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Q0(r,n)}}),a.jsxs("div",{className:rt(`${r}-wrapper`,{[`${r}-transition-reveal`]:h==="reveal",[`${r}-transition-reveal-vertical`]:h==="reveal"&&!B}),onMouseEnter:()=>q(!0),onMouseLeave:()=>q(!1),children:[a.jsxs("div",{className:`${r}-slider-inner`,style:{backgroundColor:"transparent"},children:[a.jsx("div",{ref:Le,className:rt(`${r}-track`,{[`${r}-track-draggable`]:V,[`${r}-track-draggable-vertical`]:V&&!B}),onPointerDown:lt,onPointerMove:tt,onPointerUp:ht,onPointerCancel:ht,onLostPointerCapture:be=>{ce.current===be.pointerId&&Oe(be)},children:a.jsx("div",{ref:G,className:rt(`${r}-list`,{[`${r}-list-slide`]:N,[`${r}-list-slide-vertical`]:N&&!B,[`${r}-list-fade`]:!N}),style:N?{transform:nt,transition:te||z?"none":`transform ${Ni}ms ${Ld}`}:void 0,children:ze.map((be,Ae)=>{const De=F?fo(Ae-1,c):Ae,Ce=F&&(Ae===0||Ae===c+1)?`clone-${Ae===0?"start":"end"}`:`slide-${De}`;return a.jsx("div",{className:rt(`${r}-slide`,{[`${r}-is-active`]:!N&&De===J}),children:a.jsx("div",{className:`${r}-slider-item`,children:a.jsx("div",{className:`${r}-img-wrapper`,children:a.jsx("img",{className:rt(`${r}-slider-image`,{[`${r}-contain`]:be.image.objectFit==="contain",[`${r}-cover`]:be.image.objectFit==="cover"}),src:be.image.url,alt:be.image.name??"",draggable:!1})})})},Ce)})})}),le&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:rt(`${r}-arrow`,{[`${r}-arrow-prev`]:B,[`${r}-arrow-prev-vertical`]:!B,[`${r}-hover-arrow`]:ie}),style:{color:x,"--arrow-hover-color":A,...ae},children:a.jsxs("button",{onClick:be=>{be.stopPropagation(),Ee(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${_.scalingValue(R,n)}, ${_.scalingValue($*(B?1:-1),n)}) rotate(${B?"0deg":"90deg"})`},children:[H&&a.jsx(an,{url:H,fill:x,hoverFill:A,className:rt(`${r}-arrow-img`,`${r}-mirror`),style:ae}),!H&&a.jsx(Vl,{color:x,className:rt(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:rt(`${r}-arrow`,{[`${r}-arrow-next`]:B,[`${r}-arrow-next-vertical`]:!B,[`${r}-hover-arrow`]:ie}),style:{color:x,"--arrow-hover-color":A,...ae},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:be=>{be.stopPropagation(),Ee(1)},style:{transform:`translate(${_.scalingValue(R*(B?-1:1),n)}, ${_.scalingValue($,n)}) rotate(${B?"0deg":"90deg"})`},children:[H&&a.jsx(an,{url:H,fill:x,hoverFill:A,className:`${r}-arrow-img`,style:ae}),!H&&a.jsx(Vl,{color:x,className:rt(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),O&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>Ee(1)}),j&&a.jsx("div",{className:rt(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:B,[`${r}-pagination-inside-left`]:!B}),style:B?{bottom:f(y.inset)}:{left:f(y.inset)},children:a.jsx("div",{className:rt(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!B,[`${r}-animate-dots`]:ue}),style:{backgroundColor:T,gap:f(y.gapInactive-y.activeDot+y.dot),...B?{height:f(y.activeDot+y.paddingY*2),paddingTop:f(y.paddingY),paddingBottom:f(y.paddingY),paddingLeft:f(y.paddingActive),paddingRight:f(y.paddingActive)}:{width:f(y.activeDot+y.paddingY*2),paddingLeft:f(y.paddingY),paddingRight:f(y.paddingY),paddingTop:f(y.paddingActive),paddingBottom:f(y.paddingActive)},borderRadius:f(y.borderRadius),transform:`translate(${_.scalingValue(co.offset.x,n)}, ${_.scalingValue(co.offset.y,n)})`},children:d.map((be,Ae)=>{const De=Ae===J,Ue=De?y.activeDot:y.dot;return a.jsx("button",{onClick:()=>pe(Ae),className:`${r}-pagination-item`,style:{width:f(y.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:De?k:v,width:f(Ue)}})},Ae)})},`${m}-${b}`)})]}),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:_.scalingValue(P,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:d.map((be,Ae)=>a.jsx("div",{className:rt(`${r}-caption-text`,{[`${r}-with-pointer-events`]:Ae===J&&n,[`${r}-active`]:Ae===J}),style:{...l,width:"max-content",transitionDuration:`${Math.round(Ni/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":D,"--link-hover-color":D,position:"relative",top:_.scalingValue(Sa.offset.y,n),left:_.scalingValue(Sa.offset.x,n)},children:a.jsx(bi,{content:be.imageCaption})})},Ae))})]})]})]})}function Vl({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 tx=`import React, { useCallback, useEffect, useRef, useState } from 'react';
18596
18596
  import cn from 'classnames';
18597
18597
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
18598
18598
  import { scalingValue } from '../utils/scalingValue';
@@ -19990,7 +19990,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
19990
19990
  width: var(--cntrl-article-width, 100vw) !important;
19991
19991
  height: var(--cntrl-viewport-height, 100vh) !important;
19992
19992
  }
19993
- `}const sx="rgba(28,31,34,0.9)",En=500,pi="cubic-bezier(0.22, 1, 0.36, 1)",lx=72,cx=50,dx={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},ux=[];function px(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 mx(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function gx(e){const[t]=e.media;return t!=null&&t.url?t:null}function hx(e){if(!Array.isArray(e)||e.length===0)return[];if(px(e)){const t=[];for(const n of e){const i=mx(n);if(!i)continue;const o=gx(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 za(e){return e.type==="video"}function fx(e){e.pause(),e.removeAttribute("src"),e.load()}function dr(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function yx(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const vx=1140/1440;function xx(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 bx(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 wx(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Sx({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()=>{fx(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 $x({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const w=i==="cover",b=s.useRef(null),h=s.useRef(null),g=s.useRef(null),m=s.useRef(0),v=s.useRef(0),L=s.useRef("none"),f=s.useRef(!1),S=s.useRef(!1),H=s.useRef(!1),P=s.useRef(null),[R,$]=s.useState(null),[x,A]=s.useState("opening"),[y,F]=s.useState(0),[T,j]=s.useState(0),[E,B]=s.useState(!1),[O,z]=s.useState(!1),[ee,k]=s.useState(!1),W=s.useRef(n),D=t[n],le=D?za(D):!1,Y=T!==0||E,I=s.useCallback(ue=>{H.current=ue,B(ue)},[]),oe=s.useCallback(()=>{P.current!==null&&(window.clearTimeout(P.current),P.current=null)},[]),N=s.useCallback(()=>{oe(),P.current=window.setTimeout(()=>{oe(),I(!1)},En+32)},[oe,I]),ie=s.useCallback(()=>{const ue=b.current,ge=h.current;if(!ue)return;const ye=ue.getBoundingClientRect(),q=ye.width,de=ye.height;if(!q||!de)return;if(i==="cover"){$({width:q,height:de,left:ye.left,top:ye.top});return}if(!ge){$(dr(ue));return}const{width:he,height:we}=yx(ge);if(!he||!we){$(dr(ue));return}const Pe=he/we,Le=q/de;if(Pe>Le){const G=q/Pe;$({width:q,height:G,left:ye.left,top:ye.top+(de-G)/2})}else{const G=de*Pe;$({width:G,height:de,left:ye.left+(q-G)/2,top:ye.top})}},[i]);s.useEffect(()=>{ie();const ue=b.current;if(!ue)return;const ge=new ResizeObserver(()=>ie());return ge.observe(ue),()=>ge.disconnect()},[ie,n]),s.useEffect(()=>{x==="opening"&&R&&A("open")},[x,R]),s.useEffect(()=>{if(x!=="closing")return;const ue=setTimeout(()=>r(),En);return()=>clearTimeout(ue)},[x,r]),s.useEffect(()=>()=>{oe()},[oe]),s.useLayoutEffect(()=>{if(W.current===n)return;oe(),F(0),j(0),I(!1),k(!1),z(!1),m.current=0,v.current=0,L.current="none",f.current=!1,g.current=null,S.current=!1;const ue=b.current;ue&&$(dr(ue)),W.current=n},[n,I,oe]),s.useEffect(()=>{if(x!=="open")return;let ue=null;const ge=()=>{ue&&(document.removeEventListener("click",ue,!0),ue=null)},ye=()=>{ge(),ue=Le=>{Le.stopPropagation(),Le.preventDefault(),ge()},document.addEventListener("click",ue,!0)},q=Le=>{oe(),H.current=!1,B(!1),j(0),z(!1),f.current=!1,v.current=0,L.current="none";const G=b.current;G&&$(dr(G)),Le<0?d():l()},de=Le=>{if(Math.abs(Le)>cx&&t.length>1){q(Le);return}I(!0),j(0),N()},he=Le=>{if(Le.touches.length!==1||H.current)return;const G=Le.touches[0];S.current=!0,g.current={x:G.clientX,y:G.clientY},L.current="none",v.current=0,f.current=!1},we=Le=>{if(!g.current||Le.touches.length!==1||H.current)return;const G=Le.touches[0],fe=G.clientX-g.current.x,ce=G.clientY-g.current.y;if(L.current==="none"){if(Math.abs(fe)<10&&Math.abs(ce)<10)return;if(Math.abs(fe)>Math.abs(ce)){if(t.length<=1)return;L.current="horizontal"}else if(ce>0)L.current="vertical";else return}if(L.current==="horizontal"){f.current=!0,z(!0),v.current=fe,j(fe),Le.preventDefault();return}L.current==="vertical"&&(f.current=!0,z(!0),m.current=ce,F(ce),Le.preventDefault())},Pe=()=>{if(!g.current)return;const Le=L.current,G=f.current;if(G&&Le==="horizontal")de(v.current),ye();else if(G&&Le==="vertical")if(m.current>lx){const ce=window.innerHeight;m.current=ce,k(!0),F(ce),A("closing")}else m.current=0,F(0),ye();else Le==="horizontal"&&Math.abs(v.current)>0&&(de(v.current),ye());g.current=null,L.current="none",v.current=0,f.current=!1,z(!1)};return document.addEventListener("touchstart",he,{passive:!0}),document.addEventListener("touchmove",we,{passive:!1}),document.addEventListener("touchend",Pe),document.addEventListener("touchcancel",Pe),()=>{document.removeEventListener("touchstart",he),document.removeEventListener("touchmove",we),document.removeEventListener("touchend",Pe),document.removeEventListener("touchcancel",Pe),ge()}},[x,t.length,d,l,I,N,oe]),s.useEffect(()=>{const ue=ge=>{ge.key==="Escape"&&(ge.preventDefault(),ge.stopPropagation(),x!=="closing"&&A("closing"))};return window.addEventListener("keydown",ue,!0),()=>window.removeEventListener("keydown",ue,!0)},[x]);const Z=()=>{x!=="closing"&&A("closing")},te=x==="open",Se=x==="closing",se=y>0?Math.max(0,1-y/500):1,ae=y>0?Math.max(.35,1-y/500):1,V=ue=>{if(ue.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const ge=ue.currentTarget.getBoundingClientRect(),ye=ue.clientY-ge.top,q=Math.min(52,ge.height*.2);if(!(ye>ge.height-q)){if(ue.clientX-ge.left<ge.width/2){l();return}d()}},J=ue=>{if(t.length<=1)return;const ge=ue.currentTarget.getBoundingClientRect(),ye=ue.clientX-ge.left,q=ue.clientY-ge.top,de=Math.min(52,ge.height*.2);if(q>ge.height-de){ue.currentTarget.style.cursor="default";return}ue.currentTarget.style.cursor=ye<ge.width/2?"w-resize":"e-resize"},Q=s.useCallback(ue=>{ue.propertyName!=="transform"||!H.current||(oe(),I(!1))},[oe,I]),Me=Y?`translateX(${T}px)`:y>0?`translateY(${y}px)`:void 0,be={position:"fixed",top:R==null?void 0:R.top,left:R==null?void 0:R.left,width:R==null?void 0:R.width,height:R==null?void 0:R.height,objectFit:i==="cover"?"cover":"contain",transform:Me,opacity:y>0?ae:x==="opening"||Se?0:1,transition:O&&!E?"none":E?`transform ${En}ms ${pi}`:ee?`transform ${En}ms ${pi}, opacity ${En}ms ${pi}`:x==="opening"||Se?`opacity ${En}ms ${pi}`:"none",pointerEvents:le&&te&&!Y?"auto":"none",touchAction:le&&te?"none":void 0,zIndex:9998},Ie=R?{position:"fixed",top:R.top,height:R.height,width:R.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:x==="open"?"none":void 0},onClick:Z,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:te?se:0,transition:O?"none":`opacity ${En}ms ${pi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:w?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:b,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:te?1:0,transition:`opacity ${En}ms ${pi}`,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:b,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:te?1:0,transition:`opacity ${En}ms ${pi}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),R&&D&&(le?a.jsx(Sx,{src:D.url,phase:x,mediaRef:h,mediaStyle:be,onLoadedMetadata:ie,onClick:V,onMouseMove:J,onTransitionEnd:Q},`${n}-${D.url}`):a.jsx("img",{ref:h,src:D.url,alt:D.name,onLoad:ie,onTransitionEnd:Q,style:be},`${n}-${D.url}`)),te&&Ie&&t.length>1&&!le&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ie,left:R.left,cursor:"w-resize",pointerEvents:Y?"none":"auto"},onClick:ue=>{if(S.current){S.current=!1;return}ue.stopPropagation(),l()}}),a.jsx("div",{style:{...Ie,left:R.left+R.width/2,cursor:"e-resize",pointerEvents:Y?"none":"auto"},onClick:ue=>{if(S.current){S.current=!1;return}ue.stopPropagation(),d()}})]})]})}function ql({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 w=`${e}-gallery-${za(t)?"video":"image"}`,b=r.display==="cover",h=bx(r),g=x=>_.scalingValue(x,l??!1),m=n??ki,v=o?{width:"100%",maxWidth:"100%"}:{width:g(m),maxWidth:"100%"},L=i?{borderRadius:g(i)}:{},f={...v,...b?{aspectRatio:h,height:"auto",overflow:"hidden"}:{},...L},S={...b?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":g(m)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...b?{}:L},P={className:w,style:S,onClick:p?x=>{x.stopPropagation(),p()}:void 0},R=Math.max(d,mi),$=za(t)?a.jsx("video",{...P,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...P,src:t.url,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[b?a.jsx("div",{style:f,children:$}):$,c&&d>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:g(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:g(R)}})]})}function Cx({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const w=t==="a"?i:t==="c"?o:0,b=w>0||c;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&b&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(w)},"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"&&b&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(w)},"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 Tx(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function Xl({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 Kl({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 $a({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),[w,b]=s.useState(0),h=t??"",g=n==="left"||n==="center"||n==="right";return s.useLayoutEffect(()=>{if(!g)return;const m=p.current;if(!m||typeof ResizeObserver>"u")return;const v=()=>b(m.offsetHeight);v();const L=new ResizeObserver(v);return L.observe(m),()=>L.disconnect()},[h,g]),a.jsx("div",{ref:m=>{p.current=m,i(m)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...g?{[`--${e}-title-height`]:`${w}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:h})})]})})}const Yl=45;function Zl(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 Lx(e){const t=Zl(e,"--cntrl-viewport-height",window.innerHeight),n=Zl(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function Rx(e,t,n){const{top:i,centerY:o}=Lx(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 Ix(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=Rx(u,n,c);return Math.exp(-(p*p)/(2*Yl*Yl))});let o=0,r=-1;return i.forEach((l,d)=>{l>r&&(r=l,o=d)}),{opacities:i,dominantIndex:o}}function Px(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(Ix(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 Mx(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 Ex({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var ut;const{prefix:l}=_.useScopedStyles(),d=s.useMemo(()=>ax(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",w=(e==null?void 0:e.imgWidth)??ki,b=(e==null?void 0:e.titleWidth)??vx,h=xx(e==null?void 0:e.imageDisplay),g=(e==null?void 0:e.cornerRadius)??ox,m=(e==null?void 0:e.position)??"center",v=(e==null?void 0:e.titleTopPadding)??0,L=(e==null?void 0:e.titleLeftPadding)??0,f=(e==null?void 0:e.titleRightPadding)??0,S=Tx(e==null?void 0:e.transition),H=(e==null?void 0:e.lightbox)??"on",P=p==="b",R=S==="fade"||S==="retype",{setTitleRef:$,dominantIndex:x}=Px(c.length,R,m),A=((ut=c[x])==null?void 0:ut.title)??"",y=Mx(A,S==="retype"),F=S==="fade"||S==="retype",T=S==="retype"?y:A,j=P?void 0:{width:_.scalingValue(w,n??!1)},E=H==="on"&&(!n||i||o),B=o??!1,O=(e==null?void 0:e.galleryPaddingRight)??0,z=(e==null?void 0:e.galleryPaddingLeft)??0,ee=(e==null?void 0:e.galleryPaddingBetween)??0,k=pt=>_.scalingValue(pt,n??!1),D={width:k(b)},le=p==="a"?O:z,Y=P?{width:"100%"}:{width:`calc(100% - ${k(w)} - ${k(le)})`,...p==="c"?{marginLeft:"auto"}:{}},I=Math.max(O,mi),oe=Math.max(z,mi),N=Math.max(ee,mi),ie=Math.max(v,mi),Z=Math.max(L,mi),te=Math.max(f,mi),Se=Math.max(0,(u??1)-(w??ki)),se=p==="a"?Math.max(0,(u??1)-(w??ki)-O):p==="c"?Math.max(0,(u??1)-(w??ki)-z):p==="b"?u??1:1,ae=B&&(p==="a"||p==="b"||p==="c")&&m==="top",V=B&&((p==="a"||p==="b")&&(m==="left"||m==="top")||p==="c"&&(m==="left"||m==="top")),J=B&&((p==="c"||p==="b")&&m==="right"||p==="a"&&m==="right"),Q=c.length>1,Me=P?void 0:k((p==="c"?z:O)+(w??ki)),be=p==="c"&&Me?{left:Me}:void 0,Ie=p==="a"&&Me?{right:Me}:void 0,ue=P?{left:0,width:"100%"}:p==="a"?{right:k(O),width:k(w)}:{left:k(z),width:k(w)},{titleColor:ge,titleFontFamily:ye,titleFontSettings:q,titleFontSize:de,titleLineHeight:he,titleLetterSpacing:we,titleWordSpacing:Pe,titleAlign:Le,titleTextAppearance:G,lightboxCounterColor:fe,lightboxCounterFontFamily:ce,lightboxCounterFontSettings:U,lightboxCounterFontSize:re,lightboxCounterLineHeight:Ee,lightboxCounterLetterSpacing:pe,lightboxCounterWordSpacing:K,lightboxCounterTextAppearance:Ve}=e??{},Oe={fontSettings:{fontFamily:ye,fontWeight:(q==null?void 0:q.fontWeight)??400,fontStyle:(q==null?void 0:q.fontStyle)??"normal"},fontSize:de??.01,lineHeight:he,letterSpacing:we??0,wordSpacing:Pe??0,textAlign:Le??"left",textAppearance:G,color:ge??"#000000"},tt=rn(qt(Oe,n)),ht=D,nt=Ul(de,he,l,n),ze=Gl(de,he,`${l}-title`,`${l}-text-tight-leading`),xe={fontSettings:{fontFamily:ce,fontWeight:(U==null?void 0:U.fontWeight)??400,fontStyle:(U==null?void 0:U.fontStyle)??"normal"},fontSize:re??.01,lineHeight:Ee,letterSpacing:pe??0,wordSpacing:K??0,textAppearance:Ve,color:fe??"#DEDDDD"},De={...rn(qt(xe,n)),...Ul(re,Ee,l,n)},Ue=Gl(re,Ee,`${l}-lightbox-counter`,`${l}-text-tight-leading`),Ce=_.buildColorVars(l,{titleColor:ge??"#000000",lightboxCounterColor:fe??"#DEDDDD"},dx,ux),Ne=s.useRef(null),[Be,Ke]=s.useState(!1),[ct,Je]=s.useState([]),[$t,dt]=s.useState(0),_e=s.useCallback((pt,mt)=>{E&&(Je(pt),dt(mt),Ke(!0))},[E]),Xe=s.useCallback(()=>{Ke(!1)},[]),je=s.useMemo(()=>{const pt={...Ce},mt=Ne.current?getComputedStyle(Ne.current).getPropertyValue("--cntrl-article-width").trim():"";return mt&&(pt["--cntrl-article-width"]=mt),pt},[Ce,Be]);return s.useEffect(()=>{if(!Be||H!=="on"||typeof document>"u")return;const pt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=pt}},[Be,H]),s.useEffect(()=>{!n||o||i||Ke(!1)},[n,o,i]),s.useEffect(()=>{H==="off"&&Ke(!1)},[H]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx("div",{style:Ce,children:a.jsxs("div",{ref:Ne,className:`${l}-wrapper`,style:{width:_.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&m==="top"?k(v):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(m==="left"||m==="top")||p==="c"&&(m==="left"||m==="top")?k(L):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&m==="right"||p==="a"&&m==="right"?k(f):void 0},children:[F&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx($a,{P:l,title:T,position:m,titleRef:()=>{},titleClassName:`${ze} ${l}-single-title`,titleContainerStyle:{...nt,...Y},titleTextBoxStyle:ht,titleStyle:tt,showTextBoxOutline:B,topPaddingControl:ae?Xl({P:l,scaled:k,height:ie,paired:!1}):void 0})}),c.map((pt,mt)=>{const kt=hx(pt.gallery),Kt=mt<c.length-1,Yt=kt.filter(bt=>bt.lightboxMedia).map(bt=>bt.lightboxMedia),vt={P:l,position:m,titleRef:$(mt),titleClassName:ze,titleContainerStyle:nt,titleTextBoxStyle:F?{maxWidth:"100%"}:ht,titleStyle:tt,showTextBoxOutline:B&&!F,topPaddingControl:ae&&!F?Xl({P:l,scaled:k,height:ie,paired:Q}):void 0};return a.jsxs("div",{"data-item-index":mt,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Kt?k(ee):void 0},children:[V&&Kl({P:l,controlKey:"titleLeftPadding",scaled:k,width:Z,maxFraction:se,side:"left",paired:Q,anchorStyle:be}),J&&Kl({P:l,controlKey:"titleRightPadding",scaled:k,width:te,maxFraction:se,side:"right",paired:Q,anchorStyle:Ie}),B&&Kt&&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:k(N),...ue}}),P?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:kt.map(({displayMedia:bt,lightboxMedia:Gt},Ft)=>{const xt=Gt?Yt.findIndex(Ht=>Ht.url===Gt.url):-1;return a.jsx(ql,{P:l,media:bt,imgWidth:w||void 0,cornerRadius:g||void 0,imageDisplay:h,isEditor:n,galleryPaddingBetween:ee,showPaddingAfter:Ft<kt.length-1,showControls:B,onMediaClick:E&&xt>=0?()=>_e(Yt,xt):void 0},`${bt.url}-${Ft}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx($a,{...vt,title:F?"":pt.title})})]}):a.jsxs(a.Fragment,{children:[a.jsx($a,{...vt,title:F?"":pt.title}),kt.length>0&&a.jsx(Cx,{P:l,layoutType:p,galleryWidthStyle:j,galleryPaddingRight:O,galleryPaddingLeft:z,galleryPaddingRightWidth:I,galleryPaddingLeftWidth:oe,galleryPaddingMaxFraction:Se,showControls:B,scaled:k,children:kt.map(({displayMedia:bt,lightboxMedia:Gt},Ft)=>{const xt=Gt?Yt.findIndex(Ht=>Ht.url===Gt.url):-1;return a.jsx(ql,{P:l,media:bt,cornerRadius:g||void 0,fillGalleryWidth:!0,imageDisplay:h,isEditor:n,galleryPaddingBetween:ee,showPaddingAfter:Ft<kt.length-1,showControls:B,onMediaClick:E&&xt>=0?()=>_e(Yt,xt):void 0},`${bt.url}-${Ft}`)})})]})]},mt)})]})}),Be&&H==="on"&&typeof document<"u"&&e&&(()=>{const pt=(r?document.getElementById(r):null)??document.body;return Dn.createPortal(a.jsx("div",{style:je,"data-selection":"none",children:a.jsx($x,{prefix:l,items:ct,index:$t,imageDisplay:wx(e.lightboxImageDisplay),isEditor:n,onClose:Xe,onPrev:()=>dt(mt=>(mt-1+ct.length)%ct.length),onNext:()=>dt(mt=>(mt+1)%ct.length),counterClassName:Ue,counterStyle:De,backgroundColor:e.backgroundColor??sx})}),pt)})()]})}const kx=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
19993
+ `}const sx="rgba(28,31,34,0.9)",En=500,pi="cubic-bezier(0.22, 1, 0.36, 1)",lx=72,cx=50,dx={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},ux=[];function px(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 mx(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function gx(e){const[t]=e.media;return t!=null&&t.url?t:null}function hx(e){if(!Array.isArray(e)||e.length===0)return[];if(px(e)){const t=[];for(const n of e){const i=mx(n);if(!i)continue;const o=gx(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 za(e){return e.type==="video"}function fx(e){e.pause(),e.removeAttribute("src"),e.load()}function dr(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function yx(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const vx=1140/1440;function xx(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 bx(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 wx(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Sx({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()=>{fx(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 $x({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const w=i==="cover",b=s.useRef(null),h=s.useRef(null),g=s.useRef(null),m=s.useRef(0),y=s.useRef(0),L=s.useRef("none"),f=s.useRef(!1),S=s.useRef(!1),H=s.useRef(!1),I=s.useRef(null),[R,$]=s.useState(null),[x,A]=s.useState("opening"),[v,k]=s.useState(0),[T,D]=s.useState(0),[P,B]=s.useState(!1),[O,V]=s.useState(!1),[ee,E]=s.useState(!1),N=s.useRef(n),j=t[n],le=j?za(j):!1,ie=T!==0||P,W=s.useCallback(ue=>{H.current=ue,B(ue)},[]),ae=s.useCallback(()=>{I.current!==null&&(window.clearTimeout(I.current),I.current=null)},[]),F=s.useCallback(()=>{ae(),I.current=window.setTimeout(()=>{ae(),W(!1)},En+32)},[ae,W]),J=s.useCallback(()=>{const ue=b.current,ge=h.current;if(!ue)return;const ve=ue.getBoundingClientRect(),q=ve.width,de=ve.height;if(!q||!de)return;if(i==="cover"){$({width:q,height:de,left:ve.left,top:ve.top});return}if(!ge){$(dr(ue));return}const{width:he,height:Se}=yx(ge);if(!he||!Se){$(dr(ue));return}const Pe=he/Se,Le=q/de;if(Pe>Le){const G=q/Pe;$({width:q,height:G,left:ve.left,top:ve.top+(de-G)/2})}else{const G=de*Pe;$({width:G,height:de,left:ve.left+(q-G)/2,top:ve.top})}},[i]);s.useEffect(()=>{J();const ue=b.current;if(!ue)return;const ge=new ResizeObserver(()=>J());return ge.observe(ue),()=>ge.disconnect()},[J,n]),s.useEffect(()=>{x==="opening"&&R&&A("open")},[x,R]),s.useEffect(()=>{if(x!=="closing")return;const ue=setTimeout(()=>r(),En);return()=>clearTimeout(ue)},[x,r]),s.useEffect(()=>()=>{ae()},[ae]),s.useLayoutEffect(()=>{if(N.current===n)return;ae(),k(0),D(0),W(!1),E(!1),V(!1),m.current=0,y.current=0,L.current="none",f.current=!1,g.current=null,S.current=!1;const ue=b.current;ue&&$(dr(ue)),N.current=n},[n,W,ae]),s.useEffect(()=>{if(x!=="open")return;let ue=null;const ge=()=>{ue&&(document.removeEventListener("click",ue,!0),ue=null)},ve=()=>{ge(),ue=Le=>{Le.stopPropagation(),Le.preventDefault(),ge()},document.addEventListener("click",ue,!0)},q=Le=>{ae(),H.current=!1,B(!1),D(0),V(!1),f.current=!1,y.current=0,L.current="none";const G=b.current;G&&$(dr(G)),Le<0?d():l()},de=Le=>{if(Math.abs(Le)>cx&&t.length>1){q(Le);return}W(!0),D(0),F()},he=Le=>{if(Le.touches.length!==1||H.current)return;const G=Le.touches[0];S.current=!0,g.current={x:G.clientX,y:G.clientY},L.current="none",y.current=0,f.current=!1},Se=Le=>{if(!g.current||Le.touches.length!==1||H.current)return;const G=Le.touches[0],fe=G.clientX-g.current.x,ce=G.clientY-g.current.y;if(L.current==="none"){if(Math.abs(fe)<10&&Math.abs(ce)<10)return;if(Math.abs(fe)>Math.abs(ce)){if(t.length<=1)return;L.current="horizontal"}else if(ce>0)L.current="vertical";else return}if(L.current==="horizontal"){f.current=!0,V(!0),y.current=fe,D(fe),Le.preventDefault();return}L.current==="vertical"&&(f.current=!0,V(!0),m.current=ce,k(ce),Le.preventDefault())},Pe=()=>{if(!g.current)return;const Le=L.current,G=f.current;if(G&&Le==="horizontal")de(y.current),ve();else if(G&&Le==="vertical")if(m.current>lx){const ce=window.innerHeight;m.current=ce,E(!0),k(ce),A("closing")}else m.current=0,k(0),ve();else Le==="horizontal"&&Math.abs(y.current)>0&&(de(y.current),ve());g.current=null,L.current="none",y.current=0,f.current=!1,V(!1)};return document.addEventListener("touchstart",he,{passive:!0}),document.addEventListener("touchmove",Se,{passive:!1}),document.addEventListener("touchend",Pe),document.addEventListener("touchcancel",Pe),()=>{document.removeEventListener("touchstart",he),document.removeEventListener("touchmove",Se),document.removeEventListener("touchend",Pe),document.removeEventListener("touchcancel",Pe),ge()}},[x,t.length,d,l,W,F,ae]),s.useEffect(()=>{const ue=ge=>{ge.key==="Escape"&&(ge.preventDefault(),ge.stopPropagation(),x!=="closing"&&A("closing"))};return window.addEventListener("keydown",ue,!0),()=>window.removeEventListener("keydown",ue,!0)},[x]);const Y=()=>{x!=="closing"&&A("closing")},Z=x==="open",ye=x==="closing",se=v>0?Math.max(0,1-v/500):1,re=v>0?Math.max(.35,1-v/500):1,z=ue=>{if(ue.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const ge=ue.currentTarget.getBoundingClientRect(),ve=ue.clientY-ge.top,q=Math.min(52,ge.height*.2);if(!(ve>ge.height-q)){if(ue.clientX-ge.left<ge.width/2){l();return}d()}},Q=ue=>{if(t.length<=1)return;const ge=ue.currentTarget.getBoundingClientRect(),ve=ue.clientX-ge.left,q=ue.clientY-ge.top,de=Math.min(52,ge.height*.2);if(q>ge.height-de){ue.currentTarget.style.cursor="default";return}ue.currentTarget.style.cursor=ve<ge.width/2?"w-resize":"e-resize"},te=s.useCallback(ue=>{ue.propertyName!=="transform"||!H.current||(ae(),W(!1))},[ae,W]),Me=ie?`translateX(${T}px)`:v>0?`translateY(${v}px)`:void 0,we={position:"fixed",top:R==null?void 0:R.top,left:R==null?void 0:R.left,width:R==null?void 0:R.width,height:R==null?void 0:R.height,objectFit:i==="cover"?"cover":"contain",transform:Me,opacity:v>0?re:x==="opening"||ye?0:1,transition:O&&!P?"none":P?`transform ${En}ms ${pi}`:ee?`transform ${En}ms ${pi}, opacity ${En}ms ${pi}`:x==="opening"||ye?`opacity ${En}ms ${pi}`:"none",pointerEvents:le&&Z&&!ie?"auto":"none",touchAction:le&&Z?"none":void 0,zIndex:9998},Ie=R?{position:"fixed",top:R.top,height:R.height,width:R.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:x==="open"?"none":void 0},onClick:Y,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:Z?se:0,transition:O?"none":`opacity ${En}ms ${pi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:w?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:b,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:Z?1:0,transition:`opacity ${En}ms ${pi}`,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:b,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:Z?1:0,transition:`opacity ${En}ms ${pi}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),R&&j&&(le?a.jsx(Sx,{src:j.url,phase:x,mediaRef:h,mediaStyle:we,onLoadedMetadata:J,onClick:z,onMouseMove:Q,onTransitionEnd:te},`${n}-${j.url}`):a.jsx("img",{ref:h,src:j.url,alt:j.name,onLoad:J,onTransitionEnd:te,style:we},`${n}-${j.url}`)),Z&&Ie&&t.length>1&&!le&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ie,left:R.left,cursor:"w-resize",pointerEvents:ie?"none":"auto"},onClick:ue=>{if(S.current){S.current=!1;return}ue.stopPropagation(),l()}}),a.jsx("div",{style:{...Ie,left:R.left+R.width/2,cursor:"e-resize",pointerEvents:ie?"none":"auto"},onClick:ue=>{if(S.current){S.current=!1;return}ue.stopPropagation(),d()}})]})]})}function ql({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 w=`${e}-gallery-${za(t)?"video":"image"}`,b=r.display==="cover",h=bx(r),g=x=>_.scalingValue(x,l??!1),m=n??ki,y=o?{width:"100%",maxWidth:"100%"}:{width:g(m),maxWidth:"100%"},L=i?{borderRadius:g(i)}:{},f={...y,...b?{aspectRatio:h,height:"auto",overflow:"hidden"}:{},...L},S={...b?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":g(m)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...b?{}:L},I={className:w,style:S,onClick:p?x=>{x.stopPropagation(),p()}:void 0},R=Math.max(d,mi),$=za(t)?a.jsx("video",{...I,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...I,src:t.url,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[b?a.jsx("div",{style:f,children:$}):$,c&&d>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:g(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:g(R)}})]})}function Cx({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const w=t==="a"?i:t==="c"?o:0,b=w>0||c;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&b&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(w)},"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"&&b&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(w)},"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 Tx(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function Xl({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 Kl({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 $a({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),[w,b]=s.useState(0),h=t??"",g=n==="left"||n==="center"||n==="right";return s.useLayoutEffect(()=>{if(!g)return;const m=p.current;if(!m||typeof ResizeObserver>"u")return;const y=()=>b(m.offsetHeight);y();const L=new ResizeObserver(y);return L.observe(m),()=>L.disconnect()},[h,g]),a.jsx("div",{ref:m=>{p.current=m,i(m)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...g?{[`--${e}-title-height`]:`${w}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:h})})]})})}const Yl=45;function Zl(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 Lx(e){const t=Zl(e,"--cntrl-viewport-height",window.innerHeight),n=Zl(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function Rx(e,t,n){const{top:i,centerY:o}=Lx(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 Ix(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=Rx(u,n,c);return Math.exp(-(p*p)/(2*Yl*Yl))});let o=0,r=-1;return i.forEach((l,d)=>{l>r&&(r=l,o=d)}),{opacities:i,dominantIndex:o}}function Px(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(Ix(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 Mx(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 Ex({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var ut;const{prefix:l}=_.useScopedStyles(),d=s.useMemo(()=>ax(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",w=(e==null?void 0:e.imgWidth)??ki,b=(e==null?void 0:e.titleWidth)??vx,h=xx(e==null?void 0:e.imageDisplay),g=(e==null?void 0:e.cornerRadius)??ox,m=(e==null?void 0:e.position)??"center",y=(e==null?void 0:e.titleTopPadding)??0,L=(e==null?void 0:e.titleLeftPadding)??0,f=(e==null?void 0:e.titleRightPadding)??0,S=Tx(e==null?void 0:e.transition),H=(e==null?void 0:e.lightbox)??"on",I=p==="b",R=S==="fade"||S==="retype",{setTitleRef:$,dominantIndex:x}=Px(c.length,R,m),A=((ut=c[x])==null?void 0:ut.title)??"",v=Mx(A,S==="retype"),k=S==="fade"||S==="retype",T=S==="retype"?v:A,D=I?void 0:{width:_.scalingValue(w,n??!1)},P=H==="on"&&(!n||i||o),B=o??!1,O=(e==null?void 0:e.galleryPaddingRight)??0,V=(e==null?void 0:e.galleryPaddingLeft)??0,ee=(e==null?void 0:e.galleryPaddingBetween)??0,E=pt=>_.scalingValue(pt,n??!1),j={width:E(b)},le=p==="a"?O:V,ie=I?{width:"100%"}:{width:`calc(100% - ${E(w)} - ${E(le)})`,...p==="c"?{marginLeft:"auto"}:{}},W=Math.max(O,mi),ae=Math.max(V,mi),F=Math.max(ee,mi),J=Math.max(y,mi),Y=Math.max(L,mi),Z=Math.max(f,mi),ye=Math.max(0,(u??1)-(w??ki)),se=p==="a"?Math.max(0,(u??1)-(w??ki)-O):p==="c"?Math.max(0,(u??1)-(w??ki)-V):p==="b"?u??1:1,re=B&&(p==="a"||p==="b"||p==="c")&&m==="top",z=B&&((p==="a"||p==="b")&&(m==="left"||m==="top")||p==="c"&&(m==="left"||m==="top")),Q=B&&((p==="c"||p==="b")&&m==="right"||p==="a"&&m==="right"),te=c.length>1,Me=I?void 0:E((p==="c"?V:O)+(w??ki)),we=p==="c"&&Me?{left:Me}:void 0,Ie=p==="a"&&Me?{right:Me}:void 0,ue=I?{left:0,width:"100%"}:p==="a"?{right:E(O),width:E(w)}:{left:E(V),width:E(w)},{titleColor:ge,titleFontFamily:ve,titleFontSettings:q,titleFontSize:de,titleLineHeight:he,titleLetterSpacing:Se,titleWordSpacing:Pe,titleAlign:Le,titleTextAppearance:G,lightboxCounterColor:fe,lightboxCounterFontFamily:ce,lightboxCounterFontSettings:U,lightboxCounterFontSize:oe,lightboxCounterLineHeight:Ee,lightboxCounterLetterSpacing:pe,lightboxCounterWordSpacing:K,lightboxCounterTextAppearance:Ve}=e??{},Oe={fontSettings:{fontFamily:ve,fontWeight:(q==null?void 0:q.fontWeight)??400,fontStyle:(q==null?void 0:q.fontStyle)??"normal"},fontSize:de??.01,lineHeight:he,letterSpacing:Se??0,wordSpacing:Pe??0,textAlign:Le??"left",textAppearance:G,color:ge??"#000000"},tt=rn(qt(Oe,n)),ht=j,nt=Ul(de,he,l,n),ze=Gl(de,he,`${l}-title`,`${l}-text-tight-leading`),be={fontSettings:{fontFamily:ce,fontWeight:(U==null?void 0:U.fontWeight)??400,fontStyle:(U==null?void 0:U.fontStyle)??"normal"},fontSize:oe??.01,lineHeight:Ee,letterSpacing:pe??0,wordSpacing:K??0,textAppearance:Ve,color:fe??"#DEDDDD"},De={...rn(qt(be,n)),...Ul(oe,Ee,l,n)},Ue=Gl(oe,Ee,`${l}-lightbox-counter`,`${l}-text-tight-leading`),Ce=_.buildColorVars(l,{titleColor:ge??"#000000",lightboxCounterColor:fe??"#DEDDDD"},dx,ux),Ne=s.useRef(null),[Be,Ke]=s.useState(!1),[ct,Je]=s.useState([]),[$t,dt]=s.useState(0),_e=s.useCallback((pt,mt)=>{P&&(Je(pt),dt(mt),Ke(!0))},[P]),Xe=s.useCallback(()=>{Ke(!1)},[]),je=s.useMemo(()=>{const pt={...Ce},mt=Ne.current?getComputedStyle(Ne.current).getPropertyValue("--cntrl-article-width").trim():"";return mt&&(pt["--cntrl-article-width"]=mt),pt},[Ce,Be]);return s.useEffect(()=>{if(!Be||H!=="on"||typeof document>"u")return;const pt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=pt}},[Be,H]),s.useEffect(()=>{!n||o||i||Ke(!1)},[n,o,i]),s.useEffect(()=>{H==="off"&&Ke(!1)},[H]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx("div",{style:Ce,children:a.jsxs("div",{ref:Ne,className:`${l}-wrapper`,style:{width:_.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&m==="top"?E(y):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(m==="left"||m==="top")||p==="c"&&(m==="left"||m==="top")?E(L):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&m==="right"||p==="a"&&m==="right"?E(f):void 0},children:[k&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx($a,{P:l,title:T,position:m,titleRef:()=>{},titleClassName:`${ze} ${l}-single-title`,titleContainerStyle:{...nt,...ie},titleTextBoxStyle:ht,titleStyle:tt,showTextBoxOutline:B,topPaddingControl:re?Xl({P:l,scaled:E,height:J,paired:!1}):void 0})}),c.map((pt,mt)=>{const kt=hx(pt.gallery),Kt=mt<c.length-1,Yt=kt.filter(bt=>bt.lightboxMedia).map(bt=>bt.lightboxMedia),vt={P:l,position:m,titleRef:$(mt),titleClassName:ze,titleContainerStyle:nt,titleTextBoxStyle:k?{maxWidth:"100%"}:ht,titleStyle:tt,showTextBoxOutline:B&&!k,topPaddingControl:re&&!k?Xl({P:l,scaled:E,height:J,paired:te}):void 0};return a.jsxs("div",{"data-item-index":mt,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Kt?E(ee):void 0},children:[z&&Kl({P:l,controlKey:"titleLeftPadding",scaled:E,width:Y,maxFraction:se,side:"left",paired:te,anchorStyle:we}),Q&&Kl({P:l,controlKey:"titleRightPadding",scaled:E,width:Z,maxFraction:se,side:"right",paired:te,anchorStyle:Ie}),B&&Kt&&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:E(F),...ue}}),I?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:kt.map(({displayMedia:bt,lightboxMedia:Gt},Ft)=>{const xt=Gt?Yt.findIndex(Ht=>Ht.url===Gt.url):-1;return a.jsx(ql,{P:l,media:bt,imgWidth:w||void 0,cornerRadius:g||void 0,imageDisplay:h,isEditor:n,galleryPaddingBetween:ee,showPaddingAfter:Ft<kt.length-1,showControls:B,onMediaClick:P&&xt>=0?()=>_e(Yt,xt):void 0},`${bt.url}-${Ft}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx($a,{...vt,title:k?"":pt.title})})]}):a.jsxs(a.Fragment,{children:[a.jsx($a,{...vt,title:k?"":pt.title}),kt.length>0&&a.jsx(Cx,{P:l,layoutType:p,galleryWidthStyle:D,galleryPaddingRight:O,galleryPaddingLeft:V,galleryPaddingRightWidth:W,galleryPaddingLeftWidth:ae,galleryPaddingMaxFraction:ye,showControls:B,scaled:E,children:kt.map(({displayMedia:bt,lightboxMedia:Gt},Ft)=>{const xt=Gt?Yt.findIndex(Ht=>Ht.url===Gt.url):-1;return a.jsx(ql,{P:l,media:bt,cornerRadius:g||void 0,fillGalleryWidth:!0,imageDisplay:h,isEditor:n,galleryPaddingBetween:ee,showPaddingAfter:Ft<kt.length-1,showControls:B,onMediaClick:P&&xt>=0?()=>_e(Yt,xt):void 0},`${bt.url}-${Ft}`)})})]})]},mt)})]})}),Be&&H==="on"&&typeof document<"u"&&e&&(()=>{const pt=(r?document.getElementById(r):null)??document.body;return Dn.createPortal(a.jsx("div",{style:je,"data-selection":"none",children:a.jsx($x,{prefix:l,items:ct,index:$t,imageDisplay:wx(e.lightboxImageDisplay),isEditor:n,onClose:Xe,onPrev:()=>dt(mt=>(mt-1+ct.length)%ct.length),onNext:()=>dt(mt=>(mt+1)%ct.length),counterClassName:Ue,counterStyle:De,backgroundColor:e.backgroundColor??sx})}),pt)})()]})}const kx=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
19994
19994
  import { createPortal } from 'react-dom';
19995
19995
  import type React from 'react';
19996
19996
  import { CommonComponentProps } from '../props';
@@ -22088,7 +22088,7 @@ ${t}
22088
22088
  `}function Bo(e){return Number(e.toFixed(4))}function Ql(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 Ta(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 Jx(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 Qx(e){const[t,n]=e.ratioValue.split(":").map(Number),i=e.reversed?n:t;return(e.reversed?t:n)/i}function eb(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 Pd(e,t){return(1-e)/(1-e*Math.cos(t))}function tb(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)*Pd(e,i)))}return t||1}function nb(e,t){return e?1:1+Id*(.35+t)}function ib(e,t,n,i){const o=t*nb(n,i);return Math.max(0,(e-o)/2)}function Md(e,t,n){const i=Pd(e,n);return{offset:Math.sin(n)*i/t,scale:i}}function Ed(e,t,n){return e/2+t*n}function ob(e,t,n){return e(t-n/2)}function rb(e,t){return e*t}function kd(e){return Math.round(e*1e3)}function Ad(e,t,n){const i=Math.cos(e),o=Math.cos(Yx*Math.PI/2);if(i>=o)return n;const r=(i+1)/(o+1);return Bo(t+(n-t)*r)}function Fd(e){return Ad(e,Ux,qx)}function ab(e){return Ad(e,Xx,Kx)}function _d(e,t){if(!t)return"none";const n=ab(e);return n<=0?"none":`blur(${n}px)`}function sb(e,t,n,i,o,r,l,d){const{offset:c,scale:u}=Md(i,o,r*Math.PI*2),p=r*Math.PI*2,w=Ed(t,n,c),b=Bo(u),h=`calc(${e(w)} - var(--helix-base-w) * ${b} / 2)`,g=`calc(var(--helix-base-w) * ${b})`,m=l?`height: calc(var(--helix-base-h) * ${b});`:"";return`left: ${h}; width: ${g}; ${m} z-index: ${kd(u)}; transform: translateY(-50%); opacity: ${Fd(p)}; filter: ${_d(p,d)};`}function lb(e,t,n,i,o,r,l,d){const c=[];for(let u=0;u<=Jl;u+=1){const p=u/Jl;c.push(` ${Bo(p*100)}% { ${sb(t,n,i,o,r,p,l,d)} }`)}return`@keyframes ${e}-orbit {
22089
22089
  ${c.join(`
22090
22090
  `)}
22091
- }`}function Wd(e,t){return(e%t+t)%t}function cb(e,t){return Ps(e,t)/t}function Ps(e,t){return Wd(e,t)}function db(e,t){return Math.floor(e/t)}function ub(e,t,n,i){return db(e,t)*n+Ps(e,t)*i}function pb(e,t,n){const i=n==="left"?1-e:e;return`${Bo(-i*t)}s`}function ec(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function Nd(e){const t=e%1;return t<0?t+1:t}function mb(e,t,n){const i=t/Rd,o=n==="left"?-e*i:e*i;return Nd(o)}function gb({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=_.useScopedStyles(),r=s.useRef(null),l=Ta((e==null?void 0:e.width)??(e==null?void 0:e.spread)??(e==null?void 0:e.wrapperWidth),Hx),d=Ta(e==null?void 0:e.imageWidth,Ox),c=Ta(e==null?void 0:e.turnHeight,Dx),u=Ql(e==null?void 0:e.itemsPerTurn,jx,3,40),p=Ql(e==null?void 0:e.turns,Bx,1,30),w=Math.min(Gx,Math.max(0,zx)),b=Math.min(1,Math.max(0,Vx)),h=Math.max(0,(e==null?void 0:e.speed)??Rd),g=(e==null?void 0:e.direction)==="left"?"left":"right",m=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",v=(e==null?void 0:e.cornerRadius)??0,L=(e==null?void 0:e.blur)!=="off",f=s.useMemo(()=>Jx(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),S=f.display==="cover",H=Y=>_.scalingValue(Y,n??!1),P=s.useMemo(()=>tb(w),[w]),R=s.useMemo(()=>ib(l,d,S,b),[l,d,S,b]),$=s.useMemo(()=>Zx(o,lb(o,H,l,R,w,P,S,L)),[o,l,R,w,P,S,L,n]),x=s.useMemo(()=>(t??[]).filter(Y=>{var I;return!!((I=Y.image)!=null&&I.url)}),[t]),A=c/u,y=d*Qx(f),F=Math.min(Wx,p*u),T=Nx*u,j=F+T*2,B=Math.max(0,p-1)*c+(u-1)*A,O=h>0,z=m==="scroll"&&O,ee=m==="autoplay"&&O&&(n?!!i:!0),[k,W]=s.useState(0);s.useEffect(()=>{if(!z)return;const Y=r.current;if(!Y)return;const I=()=>{const N=Y.getBoundingClientRect(),ie=window.innerHeight||document.documentElement.clientHeight,Z=ie+N.height;Z<=0||W(Math.min(1,Math.max(0,(ie-N.top)/Z)))};I(),window.addEventListener("scroll",I,{passive:!0}),window.addEventListener("resize",I);const oe=new ResizeObserver(I);return oe.observe(Y),()=>{window.removeEventListener("scroll",I),window.removeEventListener("resize",I),oe.disconnect()}},[z]);const D=z?mb(k,h,g):0,le=O&&m==="autoplay"?360/(h*_x):0;return x.length===0?a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:$}}),a.jsx("div",{className:`${o}-wrapper`,style:{width:H(l),marginInline:"auto"}})]}):a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:$}}),a.jsx("div",{ref:r,className:`${o}-wrapper`,style:{width:H(l),height:H(B),marginInline:"auto"},children:Array.from({length:j},(Y,I)=>{const oe=I-T,ie=x[Wd(oe,x.length)].image,Z=Ps(oe,u),te=cb(oe,u),Se=z?Nd(te+D):te,se=ub(oe,u,c,A),ae=b===0?0:(ec(Z+7.3)-.5)*b*A,V=S?1:1+(ec(Z+3.1)-.5)*2*Id*(.35+b),J=Se*Math.PI*2,{offset:Q,scale:Me}=Md(w,P,J),be=d*V,Ie=rb(be,Me),ue=Ed(l,R,Q),ge={"--helix-base-w":H(be),...S?{"--helix-base-h":H(y)}:{}},ye={top:H(se+ae),transform:"translateY(-50%)",...ge,...ee?{animationDuration:`${Bo(le)}s`,animationDelay:pb(te,le,g),animationDirection:g==="left"?"reverse":"normal"}:{left:ob(H,ue,Ie),width:H(Ie),...S?{height:H(y*Me)}:{},zIndex:kd(Me),opacity:Fd(J),filter:_d(J,L)}},q=v>0?{borderRadius:H(v)}:{},de=S?{...q,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}:q,he=eb(ie)?a.jsx("video",{className:`${o}-media`,style:de,src:ie.url,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:`${o}-media`,style:de,src:ie.url,alt:ie.name??"",loading:"lazy",decoding:"async"});return a.jsx("div",{className:ee?`${o}-item`:`${o}-item ${o}-item-static`,style:ye,children:S?a.jsx("div",{className:`${o}-cover`,style:q,children:he}):he},`${p}-${u}-${oe}`)})})]})}const hb=`import { useEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
22091
+ }`}function Wd(e,t){return(e%t+t)%t}function cb(e,t){return Ps(e,t)/t}function Ps(e,t){return Wd(e,t)}function db(e,t){return Math.floor(e/t)}function ub(e,t,n,i){return db(e,t)*n+Ps(e,t)*i}function pb(e,t,n){const i=n==="left"?1-e:e;return`${Bo(-i*t)}s`}function ec(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function Nd(e){const t=e%1;return t<0?t+1:t}function mb(e,t,n){const i=t/Rd,o=n==="left"?-e*i:e*i;return Nd(o)}function gb({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=_.useScopedStyles(),r=s.useRef(null),l=Ta((e==null?void 0:e.width)??(e==null?void 0:e.spread)??(e==null?void 0:e.wrapperWidth),Hx),d=Ta(e==null?void 0:e.imageWidth,Ox),c=Ta(e==null?void 0:e.turnHeight,Dx),u=Ql(e==null?void 0:e.itemsPerTurn,jx,3,40),p=Ql(e==null?void 0:e.turns,Bx,1,30),w=Math.min(Gx,Math.max(0,zx)),b=Math.min(1,Math.max(0,Vx)),h=Math.max(0,(e==null?void 0:e.speed)??Rd),g=(e==null?void 0:e.direction)==="left"?"left":"right",m=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",y=(e==null?void 0:e.cornerRadius)??0,L=(e==null?void 0:e.blur)!=="off",f=s.useMemo(()=>Jx(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),S=f.display==="cover",H=ie=>_.scalingValue(ie,n??!1),I=s.useMemo(()=>tb(w),[w]),R=s.useMemo(()=>ib(l,d,S,b),[l,d,S,b]),$=s.useMemo(()=>Zx(o,lb(o,H,l,R,w,I,S,L)),[o,l,R,w,I,S,L,n]),x=s.useMemo(()=>(t??[]).filter(ie=>{var W;return!!((W=ie.image)!=null&&W.url)}),[t]),A=c/u,v=d*Qx(f),k=Math.min(Wx,p*u),T=Nx*u,D=k+T*2,B=Math.max(0,p-1)*c+(u-1)*A,O=h>0,V=m==="scroll"&&O,ee=m==="autoplay"&&O&&(n?!!i:!0),[E,N]=s.useState(0);s.useEffect(()=>{if(!V)return;const ie=r.current;if(!ie)return;const W=()=>{const F=ie.getBoundingClientRect(),J=window.innerHeight||document.documentElement.clientHeight,Y=J+F.height;Y<=0||N(Math.min(1,Math.max(0,(J-F.top)/Y)))};W(),window.addEventListener("scroll",W,{passive:!0}),window.addEventListener("resize",W);const ae=new ResizeObserver(W);return ae.observe(ie),()=>{window.removeEventListener("scroll",W),window.removeEventListener("resize",W),ae.disconnect()}},[V]);const j=V?mb(E,h,g):0,le=O&&m==="autoplay"?360/(h*_x):0;return x.length===0?a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:$}}),a.jsx("div",{className:`${o}-wrapper`,style:{width:H(l),marginInline:"auto"}})]}):a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:$}}),a.jsx("div",{ref:r,className:`${o}-wrapper`,style:{width:H(l),height:H(B),marginInline:"auto"},children:Array.from({length:D},(ie,W)=>{const ae=W-T,J=x[Wd(ae,x.length)].image,Y=Ps(ae,u),Z=cb(ae,u),ye=V?Nd(Z+j):Z,se=ub(ae,u,c,A),re=b===0?0:(ec(Y+7.3)-.5)*b*A,z=S?1:1+(ec(Y+3.1)-.5)*2*Id*(.35+b),Q=ye*Math.PI*2,{offset:te,scale:Me}=Md(w,I,Q),we=d*z,Ie=rb(we,Me),ue=Ed(l,R,te),ge={"--helix-base-w":H(we),...S?{"--helix-base-h":H(v)}:{}},ve={top:H(se+re),transform:"translateY(-50%)",...ge,...ee?{animationDuration:`${Bo(le)}s`,animationDelay:pb(Z,le,g),animationDirection:g==="left"?"reverse":"normal"}:{left:ob(H,ue,Ie),width:H(Ie),...S?{height:H(v*Me)}:{},zIndex:kd(Me),opacity:Fd(Q),filter:_d(Q,L)}},q=y>0?{borderRadius:H(y)}:{},de=S?{...q,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}:q,he=eb(J)?a.jsx("video",{className:`${o}-media`,style:de,src:J.url,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:`${o}-media`,style:de,src:J.url,alt:J.name??"",loading:"lazy",decoding:"async"});return a.jsx("div",{className:ee?`${o}-item`:`${o}-item ${o}-item-static`,style:ve,children:S?a.jsx("div",{className:`${o}-cover`,style:q,children:he}):he},`${p}-${u}-${ae}`)})})]})}const hb=`import { useEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
22092
22092
  import { CommonComponentProps } from '../props';
22093
22093
  import { scalingValue } from '../utils/scalingValue';
22094
22094
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -22626,7 +22626,7 @@ export function Helix({
22626
22626
  </>
22627
22627
  );
22628
22628
  }
22629
- `,fb=["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"],yb={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:fb.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"]}]}]},vb={element:gb,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:yb,sourceCode:hb,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},tc=typeof window>"u"?s.useEffect:s.useLayoutEffect,Ao=120,nc=3,xb=.12,La=.25,bb=10,wb=4e3,Sb=.12,ic=.92,$b=999,Cb=["rectangle","ellipse","circle","triangle-up","triangle-down","diamond","hourglass","teardrop","leaf","wave","custom"];function Va(e){return e<0?0:e>1?1:e}function uo(e){return e.map(([t,n])=>({x:t,y:n}))}function Ra(e,t=Ao){const n=[];for(let i=0;i<t;i+=1)n.push(e(i/t));return n}function vr(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 Tb(e,t){switch(e){case"ellipse":return[Ra(n=>{const i=n*Math.PI*2;return{x:.5+Math.cos(i)*.5,y:.5+Math.sin(i)*.5}})];case"circle":{const n=t>=1?.5/t:.5,i=t>=1?.5:.5*t;return[Ra(o=>{const r=o*Math.PI*2;return{x:.5+Math.cos(r)*n,y:.5+Math.sin(r)*i}})]}case"triangle-up":return[uo([[.5,0],[1,1],[0,1]])];case"triangle-down":return[uo([[0,0],[1,0],[.5,1]])];case"diamond":return[uo([[.5,0],[1,.5],[.5,1],[0,.5]])];case"hourglass":return[uo([[0,0],[1,0],[.56,.5],[1,1],[0,1],[.44,.5]])];case"teardrop":return vr([Ra(n=>{const i=n*Math.PI*2,o=Math.cos(i);return{x:.5+Math.sin(i)*Math.pow(Math.sin(i/2),2)*.5,y:.5-o*.5}})]);case"leaf":{const n=Math.round(Ao/2),i=[];for(let o=0;o<=n;o+=1){const r=o/n;i.push({x:.5+Math.sin(Math.PI*r)*.5,y:r})}for(let o=n;o>=0;o-=1){const r=o/n;i.push({x:.5-Math.sin(Math.PI*r)*.5,y:r})}return[i]}case"wave":{const o=Ao,r=[];for(let l=0;l<=o;l+=1){const d=l/o;r.push({x:.09+Math.sin(Math.PI*2*2*d)*.09,y:d})}for(let l=o;l>=0;l-=1){const d=l/o;r.push({x:1-.09+Math.sin(Math.PI*2*2*d+Math.PI/3)*.09,y:d})}return[r]}case"rectangle":case"custom":default:return[uo([[0,0],[1,0],[1,1],[0,1]])]}}const Hd={x:0,y:0,width:100,height:100};function Lb(e){const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?Hd:{x:t[0],y:t[1],width:t[2],height:t[3]}}function xr(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}const Ga=16,Rb=12,Ib=16,oc="0 0 100 100",rc=100,Ia=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,Pb=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g;function Mb(e){const t=e.match(Pb);return t?t.map(Number).filter(n=>!Number.isNaN(n)):[]}function gn(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function Ua(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function on(e){return{x:e.x,y:e.y}}function Eb(e){return{p:on(e.p),in:e.in?on(e.in):null,out:e.out?on(e.out):null}}function io(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(Eb)}))}function qa(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 kb(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:on(e),c2:on(l),p:on(l)}];const u=i*Math.PI/180,p=Math.cos(u),w=Math.sin(u),b=(e.x-l.x)/2,h=(e.y-l.y)/2,g=p*b+w*h,m=-w*b+p*h,v=g*g/(d*d)+m*m/(c*c);if(v>1){const ee=Math.sqrt(v);d*=ee,c*=ee}const L=o===r?-1:1,f=d*d*m*m+c*c*g*g,S=Math.max(0,d*d*c*c-f),H=f===0?0:L*Math.sqrt(S/f),P=H*d*m/c,R=-H*c*g/d,$=p*P-w*R+(e.x+l.x)/2,x=w*P+p*R+(e.y+l.y)/2,A=Math.atan2((m-R)/c,(g-P)/d);let F=Math.atan2((-m-R)/c,(-g-P)/d)-A;!r&&F>0&&(F-=Math.PI*2),r&&F<0&&(F+=Math.PI*2);const T=Math.max(1,Math.ceil(Math.abs(F)/(Math.PI/2))),j=F/T,E=4/3*Math.tan(j/4),B=(ee,k)=>({x:$+p*d*ee-w*c*k,y:x+w*d*ee+p*c*k}),O=[];let z=A;for(let ee=0;ee<T;ee+=1){const k=z+j,W=Math.cos(z),D=Math.sin(z),le=Math.cos(k),Y=Math.sin(k);O.push({c1:B(W-E*D,D+E*W),c2:B(le+E*Y,Y-E*le),p:ee===T-1?on(l):B(le,Y)}),z=k}return O}function Od(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 h=i[0],g=i[i.length-1];Math.abs(h.p.x-g.p.x)<1e-6&&Math.abs(h.p.y-g.p.y)<1e-6&&(h.in=g.in??h.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(h,g)=>{i.push({p:h,in:g??null,out:null}),r=h},w=h=>{i.length&&(i[i.length-1].out=h)};Ia.lastIndex=0;let b=Ia.exec(t);for(;b!==null;){const h=b[1],g=h.toUpperCase(),m=h!==g,v=Mb(b[2]),L=f=>m?{x:r.x+v[f],y:r.y+v[f+1]}:{x:v[f],y:v[f+1]};if(g==="Z")o=!0,u(),r=on(l),d=null,c=null;else if(g==="M"){for(let f=0;f+1<v.length;f+=2){const S=L(f);f===0&&(u(),l=on(S)),p(S)}d=null,c=null}else if(g==="L"){for(let f=0;f+1<v.length;f+=2)p(L(f));d=null,c=null}else if(g==="H"){for(const f of v)p({x:m?r.x+f:f,y:r.y});d=null,c=null}else if(g==="V"){for(const f of v)p({x:r.x,y:m?r.y+f:f});d=null,c=null}else if(g==="C"){for(let f=0;f+5<v.length;f+=6){const S=L(f),H=L(f+2),P=L(f+4);w(S),p(P,H),d=H}c=null}else if(g==="S"){for(let f=0;f+3<v.length;f+=4){const S=d?Ua(d,r):on(r),H=L(f),P=L(f+2);w(S),p(P,H),d=H}c=null}else if(g==="Q")for(let f=0;f+3<v.length;f+=4){const S=L(f),H=L(f+2);w(gn(r,S,2/3)),p(H,gn(H,S,2/3)),c=S,d=null}else if(g==="T")for(let f=0;f+1<v.length;f+=2){const S=c?Ua(c,r):on(r),H=L(f);w(gn(r,S,2/3)),p(H,gn(H,S,2/3)),c=S,d=null}else if(g==="A")for(let f=0;f+6<v.length;f+=7){const S=m?{x:r.x+v[f+5],y:r.y+v[f+6]}:{x:v[f+5],y:v[f+6]};for(const H of kb(r,v[f],v[f+1],v[f+2],v[f+3]!==0,v[f+4]!==0,S))w(H.c1),p(H.p,H.c2);d=null,c=null}b=Ia.exec(t)}return u(),n}function Rn(e){return`${Number(e.toFixed(2))}`}function zo(e,t){return!e.out&&!t.in}function ac(e,t){if(zo(e,t))return`L${Rn(t.p.x)},${Rn(t.p.y)}`;const n=e.out??e.p,i=t.in??t.p;return`C${Rn(n.x)},${Rn(n.y)} ${Rn(i.x)},${Rn(i.y)} ${Rn(t.p.x)},${Rn(t.p.y)}`}function Xa(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const[i,...o]=n.nodes;t.push(`M${Rn(i.p.x)},${Rn(i.p.y)}`);let r=i;for(const l of o)t.push(ac(r,l)),r=l;if(n.closed){const l=ac(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function Dd(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 Ka(e,t,n){if(zo(e,t))return gn(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 jd(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of Dd(n)){if(zo(o.from,o.to)){i.push(on(o.from.p));continue}for(let r=0;r<Ga;r+=1)i.push(Ka(o.from,o.to,r/Ga))}n.closed||i.push(on(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function Bd(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 Ab(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=Rb)return{closed:!0,nodes:t.map(r=>({p:on(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/Ib)),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:on(r),...Bd(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function sc(e,t){return t>0?Math.round(e/t)*t:e}function lc(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=io(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 Fb(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const d=io(e),c=d[t].nodes[n];if(c[i]=on(o),r){const p=i==="in"?"out":"in";c[p]=Ua(o,c.p)}return d}function _b(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=io(e);return r[t].nodes[n][i]=null,r}function Wb(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=io(e),c=d[t].nodes,u=n+1;if(zo(r,l))return c.splice(u,0,{p:gn(r.p,l.p,i),in:null,out:null}),{contours:d,nodeIndex:u};const p=r.out??r.p,w=l.in??l.p,b=gn(r.p,p,i),h=gn(p,w,i),g=gn(w,l.p,i),m=gn(b,h,i),v=gn(h,g,i),L=gn(m,v,i),f=(n+1)%o.nodes.length;return c[n].out=b,c[f].in=g,c.splice(u,0,{p:L,in:m,out:v}),{contours:d,nodeIndex:u}}function cc(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=io(e);return o[t].nodes.splice(n,1),o}function Nb(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=io(e),l=r[t].nodes[n];if(l.in||l.out)return l.in=null,l.out=null,r;const d=i.nodes.length,c=i.nodes[(n-1+d)%d].p,u=i.nodes[(n+1)%d].p,p=Bd(c,l.p,u);return l.in=p.in,l.out=p.out,r}function Hb(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 Ob(e,t){let n=null;return e.forEach((i,o)=>{for(const r of Dd(i)){const l=zo(r.from,r.to)?1:Ga;for(let d=0;d<l;d+=1){const c=d/l,u=(d+1)/l,p=Hb(t,Ka(r.from,r.to,c),Ka(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 Db(e,t="stretch",n=Hd){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=Od(i),d=jd(l);if(d.length)return t==="viewbox"?xr(d,n):vr(d);if(typeof document>"u")return null;const c=i.split(/(?=[Mm])/).map(w=>w.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const w of c){const b=document.createElementNS("http://www.w3.org/2000/svg","path");b.setAttribute("d",w),u.appendChild(b);let h=0;try{h=b.getTotalLength()}catch{h=0}if(!h)continue;const g=[];for(let m=0;m<Ao;m+=1){const v=b.getPointAtLength(m/Ao*h);g.push({x:v.x,y:v.y})}p.push(g)}return p.length?t==="viewbox"?xr(p,n):vr(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"?xr([r],n):vr([r])}function jb(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=Va(n[o]),l=Va(n[o+1]);l>r&&i.push({x0:r,x1:l})}return Bb(i)}function Bb(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 zb(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 Vb(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 Gb(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 Ub(e,t,n,i){let o=null;for(let r=0;r<nc;r+=1){const l=Va(t+(n-t)*r/Math.max(1,nc-1)),d=jb(e,l),c=i==="avoid"?Vb(d):d;if(o=o===null?c:zb(o,c),o.length===0)return[]}return o??[]}function zd(e){return!!e&&typeof e=="object"&&e.type==="link"}function qb(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if(zd(c)){o(c.children??[],c.value,c.target);continue}const u=c,p=(u==null?void 0:u.text)??"";if(p.trim())for(const w of p.split(/\s+/))w&&t.push({text:w,leaf:u,href:l,target:d,para:i})}};o((n==null?void 0:n.children)??[])}),t}function dc(e){return{...e.fontFamily&&{fontFamily:eo(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 Xb(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(zd(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function uc(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:d,height:c,allowOverflow:u,capInset:p,capLines:w}=e,b=e.lineHeight*l,h=e.spaceWidth*l,g=[];if(!t.length||d<=0||b<=0)return{segments:g,placed:0,height:0,capLeft:0,capTop:0};const m=Math.max(1,h*.5),v=b*xb;let L=0,f=0,S=0,H=t[0].para,P=0,R=0,$=null;for(;L<t.length&&S<wb;){const x=f+b>c;if(x&&!u)break;const A=t[L].para;if(A>H+1){f+=b*(A-H-1),H=A-1,S+=1;continue}let y=x?[{x0:0,x1:d}]:Ub(i,(f+v)/c,(f+b-v)/c,o).map(T=>({x0:T.x0*d,x1:T.x1*d}));p>0&&w>0&&!x&&y.length&&($===null&&($=S,P=y[0].x0,R=f),S-$<w&&(y=Gb(y,{x0:P,x1:P+p})));const F=y.reduce((T,j)=>Math.max(T,j.x1-j.x0),0);for(const T of y){const j=T.x1-T.x0;if(j<m)continue;if(L>=t.length||t[L].para!==A)break;const E=L;let B=0;for(;L<t.length&&t[L].para===A;){const O=n[L]*l,z=L===E?O:h+O;if(B+z>j&&!(L===E&&j>=F-.5&&O>d-.5))break;B+=z,L+=1}if(L>E){const O=L>=t.length||t[L].para!==A;g.push({top:f,left:T.x0,width:j,from:E,to:L,justify:r==="justify"&&!O})}if(L>=t.length||t[L].para!==A)break}H=A,f+=b,S+=1}return{segments:g,placed:L,height:g.length?f:0,capLeft:P,capTop:R}}function Kb(e){return`
22629
+ `,fb=["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"],yb={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:fb.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"]}]}]},vb={element:gb,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:yb,sourceCode:hb,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},tc=typeof window>"u"?s.useEffect:s.useLayoutEffect,Ao=120,nc=3,xb=.12,La=.25,bb=10,wb=4e3,Sb=.12,ic=.92,$b=999,Cb=["rectangle","ellipse","circle","triangle-up","triangle-down","diamond","hourglass","teardrop","leaf","wave","custom"];function Va(e){return e<0?0:e>1?1:e}function uo(e){return e.map(([t,n])=>({x:t,y:n}))}function Ra(e,t=Ao){const n=[];for(let i=0;i<t;i+=1)n.push(e(i/t));return n}function vr(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 Tb(e,t){switch(e){case"ellipse":return[Ra(n=>{const i=n*Math.PI*2;return{x:.5+Math.cos(i)*.5,y:.5+Math.sin(i)*.5}})];case"circle":{const n=t>=1?.5/t:.5,i=t>=1?.5:.5*t;return[Ra(o=>{const r=o*Math.PI*2;return{x:.5+Math.cos(r)*n,y:.5+Math.sin(r)*i}})]}case"triangle-up":return[uo([[.5,0],[1,1],[0,1]])];case"triangle-down":return[uo([[0,0],[1,0],[.5,1]])];case"diamond":return[uo([[.5,0],[1,.5],[.5,1],[0,.5]])];case"hourglass":return[uo([[0,0],[1,0],[.56,.5],[1,1],[0,1],[.44,.5]])];case"teardrop":return vr([Ra(n=>{const i=n*Math.PI*2,o=Math.cos(i);return{x:.5+Math.sin(i)*Math.pow(Math.sin(i/2),2)*.5,y:.5-o*.5}})]);case"leaf":{const n=Math.round(Ao/2),i=[];for(let o=0;o<=n;o+=1){const r=o/n;i.push({x:.5+Math.sin(Math.PI*r)*.5,y:r})}for(let o=n;o>=0;o-=1){const r=o/n;i.push({x:.5-Math.sin(Math.PI*r)*.5,y:r})}return[i]}case"wave":{const o=Ao,r=[];for(let l=0;l<=o;l+=1){const d=l/o;r.push({x:.09+Math.sin(Math.PI*2*2*d)*.09,y:d})}for(let l=o;l>=0;l-=1){const d=l/o;r.push({x:1-.09+Math.sin(Math.PI*2*2*d+Math.PI/3)*.09,y:d})}return[r]}case"rectangle":case"custom":default:return[uo([[0,0],[1,0],[1,1],[0,1]])]}}const Hd={x:0,y:0,width:100,height:100};function Lb(e){const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?Hd:{x:t[0],y:t[1],width:t[2],height:t[3]}}function xr(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}const Ga=16,Rb=12,Ib=16,oc="0 0 100 100",rc=100,Ia=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,Pb=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g;function Mb(e){const t=e.match(Pb);return t?t.map(Number).filter(n=>!Number.isNaN(n)):[]}function gn(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function Ua(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function on(e){return{x:e.x,y:e.y}}function Eb(e){return{p:on(e.p),in:e.in?on(e.in):null,out:e.out?on(e.out):null}}function io(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(Eb)}))}function qa(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 kb(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:on(e),c2:on(l),p:on(l)}];const u=i*Math.PI/180,p=Math.cos(u),w=Math.sin(u),b=(e.x-l.x)/2,h=(e.y-l.y)/2,g=p*b+w*h,m=-w*b+p*h,y=g*g/(d*d)+m*m/(c*c);if(y>1){const ee=Math.sqrt(y);d*=ee,c*=ee}const L=o===r?-1:1,f=d*d*m*m+c*c*g*g,S=Math.max(0,d*d*c*c-f),H=f===0?0:L*Math.sqrt(S/f),I=H*d*m/c,R=-H*c*g/d,$=p*I-w*R+(e.x+l.x)/2,x=w*I+p*R+(e.y+l.y)/2,A=Math.atan2((m-R)/c,(g-I)/d);let k=Math.atan2((-m-R)/c,(-g-I)/d)-A;!r&&k>0&&(k-=Math.PI*2),r&&k<0&&(k+=Math.PI*2);const T=Math.max(1,Math.ceil(Math.abs(k)/(Math.PI/2))),D=k/T,P=4/3*Math.tan(D/4),B=(ee,E)=>({x:$+p*d*ee-w*c*E,y:x+w*d*ee+p*c*E}),O=[];let V=A;for(let ee=0;ee<T;ee+=1){const E=V+D,N=Math.cos(V),j=Math.sin(V),le=Math.cos(E),ie=Math.sin(E);O.push({c1:B(N-P*j,j+P*N),c2:B(le+P*ie,ie-P*le),p:ee===T-1?on(l):B(le,ie)}),V=E}return O}function Od(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 h=i[0],g=i[i.length-1];Math.abs(h.p.x-g.p.x)<1e-6&&Math.abs(h.p.y-g.p.y)<1e-6&&(h.in=g.in??h.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(h,g)=>{i.push({p:h,in:g??null,out:null}),r=h},w=h=>{i.length&&(i[i.length-1].out=h)};Ia.lastIndex=0;let b=Ia.exec(t);for(;b!==null;){const h=b[1],g=h.toUpperCase(),m=h!==g,y=Mb(b[2]),L=f=>m?{x:r.x+y[f],y:r.y+y[f+1]}:{x:y[f],y:y[f+1]};if(g==="Z")o=!0,u(),r=on(l),d=null,c=null;else if(g==="M"){for(let f=0;f+1<y.length;f+=2){const S=L(f);f===0&&(u(),l=on(S)),p(S)}d=null,c=null}else if(g==="L"){for(let f=0;f+1<y.length;f+=2)p(L(f));d=null,c=null}else if(g==="H"){for(const f of y)p({x:m?r.x+f:f,y:r.y});d=null,c=null}else if(g==="V"){for(const f of y)p({x:r.x,y:m?r.y+f:f});d=null,c=null}else if(g==="C"){for(let f=0;f+5<y.length;f+=6){const S=L(f),H=L(f+2),I=L(f+4);w(S),p(I,H),d=H}c=null}else if(g==="S"){for(let f=0;f+3<y.length;f+=4){const S=d?Ua(d,r):on(r),H=L(f),I=L(f+2);w(S),p(I,H),d=H}c=null}else if(g==="Q")for(let f=0;f+3<y.length;f+=4){const S=L(f),H=L(f+2);w(gn(r,S,2/3)),p(H,gn(H,S,2/3)),c=S,d=null}else if(g==="T")for(let f=0;f+1<y.length;f+=2){const S=c?Ua(c,r):on(r),H=L(f);w(gn(r,S,2/3)),p(H,gn(H,S,2/3)),c=S,d=null}else if(g==="A")for(let f=0;f+6<y.length;f+=7){const S=m?{x:r.x+y[f+5],y:r.y+y[f+6]}:{x:y[f+5],y:y[f+6]};for(const H of kb(r,y[f],y[f+1],y[f+2],y[f+3]!==0,y[f+4]!==0,S))w(H.c1),p(H.p,H.c2);d=null,c=null}b=Ia.exec(t)}return u(),n}function Rn(e){return`${Number(e.toFixed(2))}`}function zo(e,t){return!e.out&&!t.in}function ac(e,t){if(zo(e,t))return`L${Rn(t.p.x)},${Rn(t.p.y)}`;const n=e.out??e.p,i=t.in??t.p;return`C${Rn(n.x)},${Rn(n.y)} ${Rn(i.x)},${Rn(i.y)} ${Rn(t.p.x)},${Rn(t.p.y)}`}function Xa(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const[i,...o]=n.nodes;t.push(`M${Rn(i.p.x)},${Rn(i.p.y)}`);let r=i;for(const l of o)t.push(ac(r,l)),r=l;if(n.closed){const l=ac(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function Dd(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 Ka(e,t,n){if(zo(e,t))return gn(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 jd(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of Dd(n)){if(zo(o.from,o.to)){i.push(on(o.from.p));continue}for(let r=0;r<Ga;r+=1)i.push(Ka(o.from,o.to,r/Ga))}n.closed||i.push(on(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function Bd(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 Ab(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=Rb)return{closed:!0,nodes:t.map(r=>({p:on(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/Ib)),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:on(r),...Bd(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function sc(e,t){return t>0?Math.round(e/t)*t:e}function lc(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=io(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 Fb(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const d=io(e),c=d[t].nodes[n];if(c[i]=on(o),r){const p=i==="in"?"out":"in";c[p]=Ua(o,c.p)}return d}function _b(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=io(e);return r[t].nodes[n][i]=null,r}function Wb(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=io(e),c=d[t].nodes,u=n+1;if(zo(r,l))return c.splice(u,0,{p:gn(r.p,l.p,i),in:null,out:null}),{contours:d,nodeIndex:u};const p=r.out??r.p,w=l.in??l.p,b=gn(r.p,p,i),h=gn(p,w,i),g=gn(w,l.p,i),m=gn(b,h,i),y=gn(h,g,i),L=gn(m,y,i),f=(n+1)%o.nodes.length;return c[n].out=b,c[f].in=g,c.splice(u,0,{p:L,in:m,out:y}),{contours:d,nodeIndex:u}}function cc(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=io(e);return o[t].nodes.splice(n,1),o}function Nb(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=io(e),l=r[t].nodes[n];if(l.in||l.out)return l.in=null,l.out=null,r;const d=i.nodes.length,c=i.nodes[(n-1+d)%d].p,u=i.nodes[(n+1)%d].p,p=Bd(c,l.p,u);return l.in=p.in,l.out=p.out,r}function Hb(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 Ob(e,t){let n=null;return e.forEach((i,o)=>{for(const r of Dd(i)){const l=zo(r.from,r.to)?1:Ga;for(let d=0;d<l;d+=1){const c=d/l,u=(d+1)/l,p=Hb(t,Ka(r.from,r.to,c),Ka(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 Db(e,t="stretch",n=Hd){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=Od(i),d=jd(l);if(d.length)return t==="viewbox"?xr(d,n):vr(d);if(typeof document>"u")return null;const c=i.split(/(?=[Mm])/).map(w=>w.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const w of c){const b=document.createElementNS("http://www.w3.org/2000/svg","path");b.setAttribute("d",w),u.appendChild(b);let h=0;try{h=b.getTotalLength()}catch{h=0}if(!h)continue;const g=[];for(let m=0;m<Ao;m+=1){const y=b.getPointAtLength(m/Ao*h);g.push({x:y.x,y:y.y})}p.push(g)}return p.length?t==="viewbox"?xr(p,n):vr(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"?xr([r],n):vr([r])}function jb(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=Va(n[o]),l=Va(n[o+1]);l>r&&i.push({x0:r,x1:l})}return Bb(i)}function Bb(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 zb(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 Vb(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 Gb(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 Ub(e,t,n,i){let o=null;for(let r=0;r<nc;r+=1){const l=Va(t+(n-t)*r/Math.max(1,nc-1)),d=jb(e,l),c=i==="avoid"?Vb(d):d;if(o=o===null?c:zb(o,c),o.length===0)return[]}return o??[]}function zd(e){return!!e&&typeof e=="object"&&e.type==="link"}function qb(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if(zd(c)){o(c.children??[],c.value,c.target);continue}const u=c,p=(u==null?void 0:u.text)??"";if(p.trim())for(const w of p.split(/\s+/))w&&t.push({text:w,leaf:u,href:l,target:d,para:i})}};o((n==null?void 0:n.children)??[])}),t}function dc(e){return{...e.fontFamily&&{fontFamily:eo(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 Xb(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(zd(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function uc(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:d,height:c,allowOverflow:u,capInset:p,capLines:w}=e,b=e.lineHeight*l,h=e.spaceWidth*l,g=[];if(!t.length||d<=0||b<=0)return{segments:g,placed:0,height:0,capLeft:0,capTop:0};const m=Math.max(1,h*.5),y=b*xb;let L=0,f=0,S=0,H=t[0].para,I=0,R=0,$=null;for(;L<t.length&&S<wb;){const x=f+b>c;if(x&&!u)break;const A=t[L].para;if(A>H+1){f+=b*(A-H-1),H=A-1,S+=1;continue}let v=x?[{x0:0,x1:d}]:Ub(i,(f+y)/c,(f+b-y)/c,o).map(T=>({x0:T.x0*d,x1:T.x1*d}));p>0&&w>0&&!x&&v.length&&($===null&&($=S,I=v[0].x0,R=f),S-$<w&&(v=Gb(v,{x0:I,x1:I+p})));const k=v.reduce((T,D)=>Math.max(T,D.x1-D.x0),0);for(const T of v){const D=T.x1-T.x0;if(D<m)continue;if(L>=t.length||t[L].para!==A)break;const P=L;let B=0;for(;L<t.length&&t[L].para===A;){const O=n[L]*l,V=L===P?O:h+O;if(B+V>D&&!(L===P&&D>=k-.5&&O>d-.5))break;B+=V,L+=1}if(L>P){const O=L>=t.length||t[L].para!==A;g.push({top:f,left:T.x0,width:D,from:P,to:L,justify:r==="justify"&&!O})}if(L>=t.length||t[L].para!==A)break}H=A,f+=b,S+=1}return{segments:g,placed:L,height:g.length?f:0,capLeft:I,capTop:R}}function Kb(e){return`
22630
22630
  .${e}-wrapper {
22631
22631
  box-sizing: border-box;
22632
22632
  display: flex;
@@ -22708,13 +22708,21 @@ export function Helix({
22708
22708
  /* Sits above the editor's own interaction blocker, which is z-index 1. */
22709
22709
  z-index: 10;
22710
22710
  overflow: visible;
22711
- pointer-events: auto;
22711
+ /* Pass through to default item select/drag until a path point is selected. */
22712
+ pointer-events: none;
22712
22713
  touch-action: none;
22713
22714
  outline: none;
22714
22715
  }
22716
+ .${e}-editor-armed {
22717
+ pointer-events: auto;
22718
+ }
22715
22719
  .${e}-editor-surface {
22716
22720
  fill: transparent;
22717
22721
  cursor: default;
22722
+ pointer-events: none;
22723
+ }
22724
+ .${e}-editor-armed .${e}-editor-surface {
22725
+ pointer-events: auto;
22718
22726
  }
22719
22727
  .${e}-editor-hit {
22720
22728
  fill: none;
@@ -22726,6 +22734,7 @@ export function Helix({
22726
22734
  .${e}-editor-grab {
22727
22735
  fill: transparent;
22728
22736
  stroke: none;
22737
+ pointer-events: auto;
22729
22738
  cursor: grab;
22730
22739
  }
22731
22740
  .${e}-editor-grab:active {
@@ -22770,7 +22779,7 @@ export function Helix({
22770
22779
  clip-path: inset(50%);
22771
22780
  white-space: nowrap;
22772
22781
  }
22773
- `}const po=7,Yb=3.5,mo=9,Zb=24,Jb=1;function Qb({P:e,box:t,viewBox:n,contours:i,snap:o,onChange:r,onCommit:l}){const d=s.useRef(null),c=s.useRef(i);c.current=i;const u=s.useRef(null),[p,w]=s.useState(null),b=s.useCallback(R=>({x:(R.x-n.x)/n.width*t.width,y:(R.y-n.y)/n.height*t.height}),[n,t.width,t.height]),h=s.useCallback((R,$)=>{var A;const x=(A=d.current)==null?void 0:A.getBoundingClientRect();return!x||x.width<=0||x.height<=0?{x:0,y:0}:{x:n.x+(R-x.left)/x.width*n.width,y:n.y+($-x.top)/x.height*n.height}},[n]),g=s.useCallback((R,$)=>{var A;const x=(A=d.current)==null?void 0:A.getBoundingClientRect();return!x||x.width<=0||x.height<=0?{x:0,y:0}:{x:(R-x.left)/x.width*t.width,y:($-x.top)/x.height*t.height}},[t.width,t.height]),m=R=>{const $=u.current;if(!$||R.pointerId!==$.pointerId)return;R.stopPropagation(),R.preventDefault();const x=h(R.clientX,R.clientY),A={x:sc(x.x,o),y:sc(x.y,o)};if($.kind==="anchor"){let y=A.x-$.origin.x,F=A.y-$.origin.y;if(R.shiftKey&&(Math.abs(y)>Math.abs(F)?F=0:y=0),!$.moved&&y===0&&F===0)return;$.moved=!0,r(lc(c.current,$.contour,$.node,{x:$.anchor.x+y,y:$.anchor.y+F}));return}$.moved=!0,r(Fb(c.current,$.contour,$.node,$.kind,A,$.mirror&&!R.altKey))},v=R=>{const $=u.current;if(!$||R.pointerId!==$.pointerId)return;u.current=null,R.stopPropagation();const x=d.current;x!=null&&x.hasPointerCapture($.pointerId)&&x.releasePointerCapture($.pointerId),$.moved&&l(c.current)},L=R=>{R.stopPropagation()},f=(R,$,x,A)=>{var F,T,j;R.stopPropagation(),R.preventDefault(),(F=d.current)==null||F.focus({preventScroll:!0});const y=(T=i[x])==null?void 0:T.nodes[A];if(y){if(R.altKey){const E=$==="anchor"?cc(i,x,A):_b(i,x,A,$);if(E===i)return;w($==="anchor"?null:{contour:x,node:A}),r(E),l(E);return}w({contour:x,node:A}),u.current={kind:$,contour:x,node:A,pointerId:R.pointerId,origin:h(R.clientX,R.clientY),anchor:y.p,mirror:$!=="anchor"&&!!(y.in&&y.out),moved:!1},(j=d.current)==null||j.setPointerCapture(R.pointerId)}},S=R=>{R.stopPropagation(),R.preventDefault();const $=qa(i,b),x=Ob($,g(R.clientX,R.clientY));if(!x||x.distance>Zb)return;const{contours:A,nodeIndex:y}=Wb(i,x.contour,x.segment,x.t);y<0||(w({contour:x.contour,node:y}),r(A),l(A))},H=R=>{var E,B;if(!p)return;const{contour:$,node:x}=p;if(R.key==="Escape"){R.stopPropagation(),w(null);return}if(R.key==="Backspace"||R.key==="Delete"){R.preventDefault(),R.stopPropagation();const O=cc(i,$,x);if(O===i)return;w(null),r(O),l(O);return}const A=o>0?o:Jb,y=R.shiftKey?A*10:A,F={ArrowLeft:[-y,0],ArrowRight:[y,0],ArrowUp:[0,-y],ArrowDown:[0,y]}[R.key];if(!F)return;R.preventDefault(),R.stopPropagation();const T=(B=(E=i[$])==null?void 0:E.nodes[x])==null?void 0:B.p;if(!T)return;const j=lc(i,$,x,{x:T.x+F[0],y:T.y+F[1]});r(j),l(j)},P=s.useMemo(()=>Xa(qa(i,b)),[i,b]);return a.jsxs("svg",{ref:d,className:`${e}-editor`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:H,onPointerDown:()=>{var R;return(R=d.current)==null?void 0:R.focus({preventScroll:!0})},onPointerMove:m,onPointerUp:v,onPointerCancel:v,onLostPointerCapture:v,"data-pretext-path-editor":!0,"data-selection":"none",children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>w(null),onDoubleClick:S}),a.jsx("path",{className:`${e}-editor-hit`,d:P,onDoubleClick:S}),a.jsx("path",{className:`${e}-editor-outline`,d:P}),i.map((R,$)=>R.nodes.map((x,A)=>{const y=(p==null?void 0:p.contour)===$&&(p==null?void 0:p.node)===A,F=b(x.p);return a.jsxs("g",{children:[y&&["in","out"].map(T=>{const j=x[T];if(!j)return null;const E=b(j);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:F.x,y1:F.y,x2:E.x,y2:E.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:E.x,cy:E.y,r:Yb}),a.jsx("circle",{className:`${e}-editor-grab`,cx:E.x,cy:E.y,r:mo,onPointerDown:B=>f(B,T,$,A),onClick:L})]},T)}),a.jsx("rect",{className:`${e}-editor-anchor${y?` ${e}-editor-anchor-selected`:""}`,x:F.x-po/2,y:F.y-po/2,width:po,height:po,rx:x.in||x.out?po/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:F.x-mo,y:F.y-mo,width:mo*2,height:mo*2,onPointerDown:T=>f(T,"anchor",$,A),onClick:L,onDoubleClick:T=>{T.stopPropagation(),T.preventDefault();const j=Nb(i,$,A);r(j),l(j)}})]},`${$}-${A}`)}))]})}function ew(e){const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}}function tw(e,t){return 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}function nw(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=ew(e);(!r||!tw(r,d))&&(r=d,i(d)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n}function iw(){return typeof document>"u"?null:document.body}function ow({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:d,allowOverflow:c,fitEnabled:u,scale:p,onFitScale:w,dropCapLines:b,showGuides:h,typography:g,pathEditor:m}){var ie,Z;const[v,L]=s.useState(null),f=s.useRef(null),[S,H]=s.useState({width:0,height:0}),[P,R]=s.useState(null),[$,x]=s.useState(0),A=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),y=s.useMemo(()=>qb(A),[A]),F=s.useMemo(()=>Xb(A),[A]),T=b>0?((Z=(ie=y[0])==null?void 0:ie.text)==null?void 0:Z.charAt(0))??"":"",j=S.height>0?S.width/S.height:1,E=(m==null?void 0:m.contours)??null,B=s.useMemo(()=>{if(E){const se=jd(E);if(se.length)return xr(se,r)}const te=((t==null?void 0:t.path)??"").trim()||(n==="custom"?i:""),Se=te?Db(te,o,r):null;return Se&&Se.length?Se:Tb(n==="custom"?"rectangle":n,j)},[E,t==null?void 0:t.path,n,i,o,r,Math.round(j*100)/100]),O=m==null?void 0:m.onConvert,z=(m==null?void 0:m.needsConversion)??!1;s.useEffect(()=>{!z||!O||!B.length||O(qa(Ab(B),te=>({x:te.x*rc,y:te.y*rc})))},[z,O,B]),tc(()=>{const te=v;if(!te||typeof ResizeObserver>"u")return;const Se=()=>{const ae=te.getBoundingClientRect();H(V=>Math.abs(V.width-ae.width)<.5&&Math.abs(V.height-ae.height)<.5?V:{width:ae.width,height:ae.height})};Se();const se=new ResizeObserver(Se);return se.observe(te),()=>se.disconnect()},[v]),s.useEffect(()=>{const te=typeof document<"u"?document.fonts:void 0;te!=null&&te.ready&&te.ready.then(()=>{x(Se=>Se+1)})},[]),tc(()=>{const te=f.current;if(!te)return;if(!y.length){R(null);return}const Se=[],se=document.createDocumentFragment();for(const ye of y){const q=document.createElement("span");Object.assign(q.style,dc(ye.leaf)),q.textContent=ye.text,se.appendChild(q),Se.push(q)}const ae=document.createElement("span");ae.textContent=" ",se.appendChild(ae);const V=document.createElement("span");V.textContent=T||"H",V.style.lineHeight="1",se.appendChild(V),te.replaceChildren(se);const J=window.getComputedStyle(te),Q=parseFloat(J.fontSize)||16,Me=parseFloat(J.lineHeight),be=Number.isNaN(Me)?Q*1.2:Me;V.style.fontSize=`${be*Math.max(1,b)*ic}px`;const Ie=Se.map(ye=>ye.getBoundingClientRect().width),ue=ae.getBoundingClientRect().width,ge=T?V.getBoundingClientRect().width:0;te.replaceChildren(),R({widths:Ie,spaceWidth:ue,lineHeight:be,capWidth:ge})},[y,g,T,b,$,S.width]);const ee=P&&T?P.capWidth+P.lineHeight*Sb:0,k=s.useMemo(()=>{if(!P||!y.length||S.width<=0||S.height<=0||!u)return 1;const te=ae=>uc({tokens:y,widths:P.widths,spaceWidth:P.spaceWidth,lineHeight:P.lineHeight,width:S.width,height:S.height,rings:B,mode:l,align:d,scale:ae,allowOverflow:!1,capInset:ee*ae,capLines:T?b:0});if(te(1).placed>=y.length)return 1;if(te(La).placed<y.length)return La;let Se=La,se=1;for(let ae=0;ae<bb;ae+=1){const V=(Se+se)/2;te(V).placed>=y.length?Se=V:se=V}return Se},[P,y,S.width,S.height,B,l,d,u,ee,T,b]);s.useEffect(()=>{w(k)},[k,w]);const W=u?Math.min(p,k):1,D=s.useMemo(()=>!P||!y.length||S.width<=0||S.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0}:uc({tokens:y,widths:P.widths,spaceWidth:P.spaceWidth,lineHeight:P.lineHeight,width:S.width,height:S.height,rings:B,mode:l,align:d,scale:W,allowOverflow:c,capInset:ee*W,capLines:T?b:0}),[P,y,S.width,S.height,B,l,d,W,c,ee,T,b]),le=P?P.lineHeight*W:0,Y=d==="justify"?"left":d,I=!!(m&&E&&S.width>0&&S.height>0),oe=nw(v,I),N=I&&oe?iw():null;return a.jsxs("div",{className:`${e}-column`,ref:L,children:[a.jsxs("div",{className:`${e}-flow${c?"":` ${e}-clip`}`,style:{...g,["--"+e+"-fit"]:W},children:[a.jsx("div",{className:`${e}-measure`,ref:f,style:g,"aria-hidden":!0}),T&&P&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{top:`${D.capTop}px`,left:`${D.capLeft}px`,fontSize:`${le*Math.max(1,b)*ic}px`,lineHeight:`${le*Math.max(1,b)}px`},children:T}),D.segments.map((te,Se)=>{const se=y.slice(te.from,te.to),ae=Se===0;return a.jsx("div",{className:`${e}-line${te.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${te.top}px`,left:`${te.left}px`,width:`${te.width}px`,textAlign:te.justify?void 0:Y},children:se.map((V,J)=>{const Me=T&&ae&&te.from===0&&J===0?V.text.slice(1):V.text,be=dc(V.leaf),Ie=V.href?a.jsx("a",{className:`${e}-link`,href:V.href,target:V.target,style:be,children:Me}):a.jsx("span",{style:be,children:Me});return a.jsxs("span",{children:[!te.justify&&J>0?" ":null,Ie]},J)})},`${te.from}-${te.to}-${Se}`)}),h&&!E&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:B.map((te,Se)=>a.jsx("polygon",{points:te.map(se=>`${se.x},${se.y}`).join(" ")},Se))})]}),N&&oe&&E&&m&&Dn.createPortal(a.jsx("div",{"data-selection":"none",style:{position:"fixed",top:oe.top,left:oe.left,width:oe.width,height:oe.height,zIndex:$b,pointerEvents:"none"},children:a.jsx(Qb,{P:e,box:{width:oe.width,height:oe.height},viewBox:r,contours:E,snap:m.snap,onChange:m.onChange,onCommit:m.onCommit})}),N),a.jsx("div",{className:`${e}-a11y`,children:F.map((te,Se)=>a.jsx("p",{children:te},Se))})]})}function rw({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:d}=_.useScopedStyles(),c=s.useMemo(()=>Kb(d),[d]),u=n??!1,p=!!r||!!o,w=s.useMemo(()=>Array.isArray(t)?t[0]??{}:{},[t]),b=(e==null?void 0:e.shape)??"rectangle",h=(e==null?void 0:e.customPath)??"",g=(e==null?void 0:e.pathFit)??"stretch",m=s.useMemo(()=>Lb(e==null?void 0:e.pathViewBox),[e==null?void 0:e.pathViewBox]),v=(e==null?void 0:e.shapeMode)??"contain",L=(e==null?void 0:e.textAlign)??"left",f=((e==null?void 0:e.overflowMode)??"clip")==="visible",S=((e==null?void 0:e.fitText)??"off")==="on",H=((e==null?void 0:e.dropCap)??"off")==="on"?Math.max(2,Math.round((e==null?void 0:e.dropCapLines)??3)):0,P=u&&p&&!i,R=u&&p&&!i&&typeof l=="function",$=Math.max(0,(e==null?void 0:e.pathSnap)??0),[x,A]=s.useState(null),y=s.useMemo(()=>{if(!R)return null;if(x&&(x.base===h||x.serialized===h))return x.contours;const Y=Od(h);return Y.length?Y:null},[R,x,h]),F=b==="custom"&&g==="viewbox"&&((e==null?void 0:e.pathViewBox)??"")===oc&&!!y,T=s.useCallback((Y,I)=>{const oe=Xa(Y);A(N=>({base:N&&(N.base===h||N.serialized===h)?N.base:h,serialized:oe,contours:Y})),I&&(l==null||l({...e,customPath:oe}))},[h,l,e]),j=s.useMemo(()=>R?{contours:F?y:null,snap:$,needsConversion:!F,onConvert:Y=>{const I=Xa(Y);A({base:I,serialized:I,contours:Y}),l==null||l({...e,shape:"custom",pathFit:"viewbox",pathViewBox:oc,customPath:I})},onChange:Y=>T(Y,!1),onCommit:Y=>T(Y,!0)}:null,[R,F,y,$,l,e,T]),E=!((w==null?void 0:w.path)??"").trim(),[B,O]=s.useState(void 0),z=s.useRef(void 0),ee=s.useCallback(Y=>{const I=z.current;I!==void 0&&Math.abs(I-Y)<.005||(z.current=Y,O(Y))},[]),k=s.useMemo(()=>S&&typeof B=="number"?B:1,[B,S]),W=Y=>`calc(${Y} * var(--${d}-fit, 1))`,D=s.useMemo(()=>{var Y,I,oe,N,ie;return{fontFamily:eo(e==null?void 0:e.textFontFamily),fontWeight:(Y=e==null?void 0:e.textFontSettings)==null?void 0:Y.fontWeight,fontStyle:(I=e==null?void 0:e.textFontSettings)==null?void 0:I.fontStyle,fontSize:W(_.scalingValue((e==null?void 0:e.textFontSize)??.012,u)),lineHeight:W(_.scalingValue((e==null?void 0:e.textLineHeight)??(e==null?void 0:e.textFontSize)??.012,u)),letterSpacing:W(_.scalingValue((e==null?void 0:e.textLetterSpacing)??0,u)),wordSpacing:W(_.scalingValue((e==null?void 0:e.textWordSpacing)??0,u)),textTransform:(oe=e==null?void 0:e.textTextAppearance)==null?void 0:oe.textTransform,textDecoration:(N=e==null?void 0:e.textTextAppearance)==null?void 0:N.textDecoration,fontVariant:(ie=e==null?void 0:e.textTextAppearance)==null?void 0:ie.fontVariant}},[e,u,d]),le={[`--${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:{...le},children:a.jsx(ow,{P:d,item:w,shape:b,customPath:h,pathFit:g,viewBox:m,mode:v,align:L,allowOverflow:f,fitEnabled:S,scale:k,onFitScale:ee,dropCapLines:H,showGuides:P||R,typography:D,pathEditor:E?j:null})})]})}const aw=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
22782
+ `}const po=7,Yb=3.5,mo=9,Zb=24,Jb=1;function Qb({P:e,box:t,viewBox:n,contours:i,snap:o,onChange:r,onCommit:l}){const d=s.useRef(null),c=s.useRef(i);c.current=i;const u=s.useRef(null),[p,w]=s.useState(null),b=s.useCallback(R=>({x:(R.x-n.x)/n.width*t.width,y:(R.y-n.y)/n.height*t.height}),[n,t.width,t.height]),h=s.useCallback((R,$)=>{var A;const x=(A=d.current)==null?void 0:A.getBoundingClientRect();return!x||x.width<=0||x.height<=0?{x:0,y:0}:{x:n.x+(R-x.left)/x.width*n.width,y:n.y+($-x.top)/x.height*n.height}},[n]),g=s.useCallback((R,$)=>{var A;const x=(A=d.current)==null?void 0:A.getBoundingClientRect();return!x||x.width<=0||x.height<=0?{x:0,y:0}:{x:(R-x.left)/x.width*t.width,y:($-x.top)/x.height*t.height}},[t.width,t.height]),m=R=>{const $=u.current;if(!$||R.pointerId!==$.pointerId)return;R.stopPropagation(),R.preventDefault();const x=h(R.clientX,R.clientY),A={x:sc(x.x,o),y:sc(x.y,o)};if($.kind==="anchor"){let v=A.x-$.origin.x,k=A.y-$.origin.y;if(R.shiftKey&&(Math.abs(v)>Math.abs(k)?k=0:v=0),!$.moved&&v===0&&k===0)return;$.moved=!0,r(lc(c.current,$.contour,$.node,{x:$.anchor.x+v,y:$.anchor.y+k}));return}$.moved=!0,r(Fb(c.current,$.contour,$.node,$.kind,A,$.mirror&&!R.altKey))},y=R=>{const $=u.current;if(!$||R.pointerId!==$.pointerId)return;u.current=null,R.stopPropagation();const x=d.current;x!=null&&x.hasPointerCapture($.pointerId)&&x.releasePointerCapture($.pointerId),$.moved&&l(c.current)},L=R=>{R.stopPropagation()},f=(R,$,x,A)=>{var k,T,D;R.stopPropagation(),R.preventDefault(),(k=d.current)==null||k.focus({preventScroll:!0});const v=(T=i[x])==null?void 0:T.nodes[A];if(v){if(R.altKey){const P=$==="anchor"?cc(i,x,A):_b(i,x,A,$);if(P===i)return;w($==="anchor"?null:{contour:x,node:A}),r(P),l(P);return}w({contour:x,node:A}),u.current={kind:$,contour:x,node:A,pointerId:R.pointerId,origin:h(R.clientX,R.clientY),anchor:v.p,mirror:$!=="anchor"&&!!(v.in&&v.out),moved:!1},(D=d.current)==null||D.setPointerCapture(R.pointerId)}},S=R=>{R.stopPropagation(),R.preventDefault();const $=qa(i,b),x=Ob($,g(R.clientX,R.clientY));if(!x||x.distance>Zb)return;const{contours:A,nodeIndex:v}=Wb(i,x.contour,x.segment,x.t);v<0||(w({contour:x.contour,node:v}),r(A),l(A))},H=R=>{var P,B;if(!p)return;const{contour:$,node:x}=p;if(R.key==="Escape"){R.stopPropagation(),w(null);return}if(R.key==="Backspace"||R.key==="Delete"){R.preventDefault(),R.stopPropagation();const O=cc(i,$,x);if(O===i)return;w(null),r(O),l(O);return}const A=o>0?o:Jb,v=R.shiftKey?A*10:A,k={ArrowLeft:[-v,0],ArrowRight:[v,0],ArrowUp:[0,-v],ArrowDown:[0,v]}[R.key];if(!k)return;R.preventDefault(),R.stopPropagation();const T=(B=(P=i[$])==null?void 0:P.nodes[x])==null?void 0:B.p;if(!T)return;const D=lc(i,$,x,{x:T.x+k[0],y:T.y+k[1]});r(D),l(D)},I=s.useMemo(()=>Xa(qa(i,b)),[i,b]);return a.jsxs("svg",{ref:d,className:`${e}-editor${p?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:H,onPointerDown:()=>{var R;return(R=d.current)==null?void 0:R.focus({preventScroll:!0})},onPointerMove:m,onPointerUp:y,onPointerCancel:y,onLostPointerCapture:y,"data-pretext-path-editor":!0,"data-selection":"none",children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>w(null),onDoubleClick:S}),a.jsx("path",{className:`${e}-editor-hit`,d:I,onDoubleClick:S}),a.jsx("path",{className:`${e}-editor-outline`,d:I}),i.map((R,$)=>R.nodes.map((x,A)=>{const v=(p==null?void 0:p.contour)===$&&(p==null?void 0:p.node)===A,k=b(x.p);return a.jsxs("g",{children:[v&&["in","out"].map(T=>{const D=x[T];if(!D)return null;const P=b(D);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:k.x,y1:k.y,x2:P.x,y2:P.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:P.x,cy:P.y,r:Yb}),a.jsx("circle",{className:`${e}-editor-grab`,cx:P.x,cy:P.y,r:mo,onPointerDown:B=>f(B,T,$,A),onClick:L})]},T)}),a.jsx("rect",{className:`${e}-editor-anchor${v?` ${e}-editor-anchor-selected`:""}`,x:k.x-po/2,y:k.y-po/2,width:po,height:po,rx:x.in||x.out?po/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:k.x-mo,y:k.y-mo,width:mo*2,height:mo*2,onPointerDown:T=>f(T,"anchor",$,A),onClick:L,onDoubleClick:T=>{T.stopPropagation(),T.preventDefault();const D=Nb(i,$,A);r(D),l(D)}})]},`${$}-${A}`)}))]})}function ew(e){const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}}function tw(e,t){return 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}function nw(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=ew(e);(!r||!tw(r,d))&&(r=d,i(d)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n}function iw(){return typeof document>"u"?null:document.body}function ow({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:d,allowOverflow:c,fitEnabled:u,scale:p,onFitScale:w,dropCapLines:b,showGuides:h,typography:g,pathEditor:m}){var J,Y;const[y,L]=s.useState(null),f=s.useRef(null),[S,H]=s.useState({width:0,height:0}),[I,R]=s.useState(null),[$,x]=s.useState(0),A=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),v=s.useMemo(()=>qb(A),[A]),k=s.useMemo(()=>Xb(A),[A]),T=b>0?((Y=(J=v[0])==null?void 0:J.text)==null?void 0:Y.charAt(0))??"":"",D=S.height>0?S.width/S.height:1,P=(m==null?void 0:m.contours)??null,B=s.useMemo(()=>{if(P){const se=jd(P);if(se.length)return xr(se,r)}const Z=((t==null?void 0:t.path)??"").trim()||(n==="custom"?i:""),ye=Z?Db(Z,o,r):null;return ye&&ye.length?ye:Tb(n==="custom"?"rectangle":n,D)},[P,t==null?void 0:t.path,n,i,o,r,Math.round(D*100)/100]),O=m==null?void 0:m.onConvert,V=(m==null?void 0:m.needsConversion)??!1;s.useEffect(()=>{!V||!O||!B.length||O(qa(Ab(B),Z=>({x:Z.x*rc,y:Z.y*rc})))},[V,O,B]),tc(()=>{const Z=y;if(!Z||typeof ResizeObserver>"u")return;const ye=()=>{const re=Z.getBoundingClientRect();H(z=>Math.abs(z.width-re.width)<.5&&Math.abs(z.height-re.height)<.5?z:{width:re.width,height:re.height})};ye();const se=new ResizeObserver(ye);return se.observe(Z),()=>se.disconnect()},[y]),s.useEffect(()=>{const Z=typeof document<"u"?document.fonts:void 0;Z!=null&&Z.ready&&Z.ready.then(()=>{x(ye=>ye+1)})},[]),tc(()=>{const Z=f.current;if(!Z)return;if(!v.length){R(null);return}const ye=[],se=document.createDocumentFragment();for(const ve of v){const q=document.createElement("span");Object.assign(q.style,dc(ve.leaf)),q.textContent=ve.text,se.appendChild(q),ye.push(q)}const re=document.createElement("span");re.textContent=" ",se.appendChild(re);const z=document.createElement("span");z.textContent=T||"H",z.style.lineHeight="1",se.appendChild(z),Z.replaceChildren(se);const Q=window.getComputedStyle(Z),te=parseFloat(Q.fontSize)||16,Me=parseFloat(Q.lineHeight),we=Number.isNaN(Me)?te*1.2:Me;z.style.fontSize=`${we*Math.max(1,b)*ic}px`;const Ie=ye.map(ve=>ve.getBoundingClientRect().width),ue=re.getBoundingClientRect().width,ge=T?z.getBoundingClientRect().width:0;Z.replaceChildren(),R({widths:Ie,spaceWidth:ue,lineHeight:we,capWidth:ge})},[v,g,T,b,$,S.width]);const ee=I&&T?I.capWidth+I.lineHeight*Sb:0,E=s.useMemo(()=>{if(!I||!v.length||S.width<=0||S.height<=0||!u)return 1;const Z=re=>uc({tokens:v,widths:I.widths,spaceWidth:I.spaceWidth,lineHeight:I.lineHeight,width:S.width,height:S.height,rings:B,mode:l,align:d,scale:re,allowOverflow:!1,capInset:ee*re,capLines:T?b:0});if(Z(1).placed>=v.length)return 1;if(Z(La).placed<v.length)return La;let ye=La,se=1;for(let re=0;re<bb;re+=1){const z=(ye+se)/2;Z(z).placed>=v.length?ye=z:se=z}return ye},[I,v,S.width,S.height,B,l,d,u,ee,T,b]);s.useEffect(()=>{w(E)},[E,w]);const N=u?Math.min(p,E):1,j=s.useMemo(()=>!I||!v.length||S.width<=0||S.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0}:uc({tokens:v,widths:I.widths,spaceWidth:I.spaceWidth,lineHeight:I.lineHeight,width:S.width,height:S.height,rings:B,mode:l,align:d,scale:N,allowOverflow:c,capInset:ee*N,capLines:T?b:0}),[I,v,S.width,S.height,B,l,d,N,c,ee,T,b]),le=I?I.lineHeight*N:0,ie=d==="justify"?"left":d,W=!!(m&&P&&S.width>0&&S.height>0),ae=nw(y,W),F=W&&ae?iw():null;return a.jsxs("div",{className:`${e}-column`,ref:L,children:[a.jsxs("div",{className:`${e}-flow${c?"":` ${e}-clip`}`,style:{...g,["--"+e+"-fit"]:N},children:[a.jsx("div",{className:`${e}-measure`,ref:f,style:g,"aria-hidden":!0}),T&&I&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{top:`${j.capTop}px`,left:`${j.capLeft}px`,fontSize:`${le*Math.max(1,b)*ic}px`,lineHeight:`${le*Math.max(1,b)}px`},children:T}),j.segments.map((Z,ye)=>{const se=v.slice(Z.from,Z.to),re=ye===0;return a.jsx("div",{className:`${e}-line${Z.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${Z.top}px`,left:`${Z.left}px`,width:`${Z.width}px`,textAlign:Z.justify?void 0:ie},children:se.map((z,Q)=>{const Me=T&&re&&Z.from===0&&Q===0?z.text.slice(1):z.text,we=dc(z.leaf),Ie=z.href?a.jsx("a",{className:`${e}-link`,href:z.href,target:z.target,style:we,children:Me}):a.jsx("span",{style:we,children:Me});return a.jsxs("span",{children:[!Z.justify&&Q>0?" ":null,Ie]},Q)})},`${Z.from}-${Z.to}-${ye}`)}),h&&!P&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:B.map((Z,ye)=>a.jsx("polygon",{points:Z.map(se=>`${se.x},${se.y}`).join(" ")},ye))})]}),F&&ae&&P&&m&&Dn.createPortal(a.jsx("div",{"data-selection":"none",style:{position:"fixed",top:ae.top,left:ae.left,width:ae.width,height:ae.height,zIndex:$b,pointerEvents:"none"},children:a.jsx(Qb,{P:e,box:{width:ae.width,height:ae.height},viewBox:r,contours:P,snap:m.snap,onChange:m.onChange,onCommit:m.onCommit})}),F),a.jsx("div",{className:`${e}-a11y`,children:k.map((Z,ye)=>a.jsx("p",{children:Z},ye))})]})}function rw({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:d}=_.useScopedStyles(),c=s.useMemo(()=>Kb(d),[d]),u=n??!1,p=!!r||!!o,w=s.useMemo(()=>Array.isArray(t)?t[0]??{}:{},[t]),b=(e==null?void 0:e.shape)??"rectangle",h=(e==null?void 0:e.customPath)??"",g=(e==null?void 0:e.pathFit)??"stretch",m=s.useMemo(()=>Lb(e==null?void 0:e.pathViewBox),[e==null?void 0:e.pathViewBox]),y=(e==null?void 0:e.shapeMode)??"contain",L=(e==null?void 0:e.textAlign)??"left",f=((e==null?void 0:e.overflowMode)??"clip")==="visible",S=((e==null?void 0:e.fitText)??"off")==="on",H=((e==null?void 0:e.dropCap)??"off")==="on"?Math.max(2,Math.round((e==null?void 0:e.dropCapLines)??3)):0,I=u&&p&&!i,[R,$]=s.useState(!1);s.useEffect(()=>{if(!u||!p){$(!1);return}const F=()=>$(!0),J=()=>$(!1),Y=["ArticleEditor.Item:drag-start","ArticleEditor.Selection:resize-start","ArticleEditor.Selection:move-start"],Z=["ArticleEditor.Item:drag-end","ArticleEditor.Selection:resize-end","ArticleEditor.Selection:move-end"];for(const ye of Y)window.addEventListener(ye,F);for(const ye of Z)window.addEventListener(ye,J);return()=>{for(const ye of Y)window.removeEventListener(ye,F);for(const ye of Z)window.removeEventListener(ye,J)}},[u,p]);const x=u&&p&&!i&&typeof l=="function",A=!R,v=Math.max(0,(e==null?void 0:e.pathSnap)??0),[k,T]=s.useState(null),D=s.useMemo(()=>{if(!x)return null;if(k&&(k.base===h||k.serialized===h))return k.contours;const F=Od(h);return F.length?F:null},[x,k,h]),P=b==="custom"&&g==="viewbox"&&((e==null?void 0:e.pathViewBox)??"")===oc&&!!D,B=s.useCallback((F,J)=>{const Y=Xa(F);T(Z=>({base:Z&&(Z.base===h||Z.serialized===h)?Z.base:h,serialized:Y,contours:F})),J&&(l==null||l({...e,customPath:Y}))},[h,l,e]),O=s.useMemo(()=>x?{contours:P?D:null,snap:v,needsConversion:!P,onConvert:F=>{const J=Xa(F);T({base:J,serialized:J,contours:F}),l==null||l({...e,shape:"custom",pathFit:"viewbox",pathViewBox:oc,customPath:J})},onChange:F=>B(F,!1),onCommit:F=>B(F,!0)}:null,[x,P,D,v,l,e,B]),V=!((w==null?void 0:w.path)??"").trim(),[ee,E]=s.useState(void 0),N=s.useRef(void 0),j=s.useCallback(F=>{const J=N.current;J!==void 0&&Math.abs(J-F)<.005||(N.current=F,E(F))},[]),le=s.useMemo(()=>S&&typeof ee=="number"?ee:1,[ee,S]),ie=F=>`calc(${F} * var(--${d}-fit, 1))`,W=s.useMemo(()=>{var F,J,Y,Z,ye;return{fontFamily:eo(e==null?void 0:e.textFontFamily),fontWeight:(F=e==null?void 0:e.textFontSettings)==null?void 0:F.fontWeight,fontStyle:(J=e==null?void 0:e.textFontSettings)==null?void 0:J.fontStyle,fontSize:ie(_.scalingValue((e==null?void 0:e.textFontSize)??.012,u)),lineHeight:ie(_.scalingValue((e==null?void 0:e.textLineHeight)??(e==null?void 0:e.textFontSize)??.012,u)),letterSpacing:ie(_.scalingValue((e==null?void 0:e.textLetterSpacing)??0,u)),wordSpacing:ie(_.scalingValue((e==null?void 0:e.textWordSpacing)??0,u)),textTransform:(Y=e==null?void 0:e.textTextAppearance)==null?void 0:Y.textTransform,textDecoration:(Z=e==null?void 0:e.textTextAppearance)==null?void 0:Z.textDecoration,fontVariant:(ye=e==null?void 0:e.textTextAppearance)==null?void 0:ye.fontVariant}},[e,u,d]),ae={[`--${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:{...ae},children:a.jsx(ow,{P:d,item:w,shape:b,customPath:h,pathFit:g,viewBox:m,mode:y,align:L,allowOverflow:f,fitEnabled:S,scale:le,onFitScale:j,dropCapLines:H,showGuides:(I||x)&&A,typography:W,pathEditor:V&&A?O:null})})]})}const aw=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
22774
22783
  import type React from 'react';
22775
22784
  import { createPortal } from 'react-dom';
22776
22785
  import { CommonComponentProps } from '../props';
@@ -23989,13 +23998,21 @@ function getCSS(P: string): string {
23989
23998
  /* Sits above the editor's own interaction blocker, which is z-index 1. */
23990
23999
  z-index: 10;
23991
24000
  overflow: visible;
23992
- pointer-events: auto;
24001
+ /* Pass through to default item select/drag until a path point is selected. */
24002
+ pointer-events: none;
23993
24003
  touch-action: none;
23994
24004
  outline: none;
23995
24005
  }
24006
+ .\${P}-editor-armed {
24007
+ pointer-events: auto;
24008
+ }
23996
24009
  .\${P}-editor-surface {
23997
24010
  fill: transparent;
23998
24011
  cursor: default;
24012
+ pointer-events: none;
24013
+ }
24014
+ .\${P}-editor-armed .\${P}-editor-surface {
24015
+ pointer-events: auto;
23999
24016
  }
24000
24017
  .\${P}-editor-hit {
24001
24018
  fill: none;
@@ -24007,6 +24024,7 @@ function getCSS(P: string): string {
24007
24024
  .\${P}-editor-grab {
24008
24025
  fill: transparent;
24009
24026
  stroke: none;
24027
+ pointer-events: auto;
24010
24028
  cursor: grab;
24011
24029
  }
24012
24030
  .\${P}-editor-grab:active {
@@ -24262,7 +24280,7 @@ function PretextPathEditor({ P, box, viewBox, contours, snap, onChange, onCommit
24262
24280
  return (
24263
24281
  <svg
24264
24282
  ref={svgRef}
24265
- className={\`\${P}-editor\`}
24283
+ className={\`\${P}-editor\${selection ? \` \${P}-editor-armed\` : ''}\`}
24266
24284
  width={box.width}
24267
24285
  height={box.height}
24268
24286
  viewBox={\`0 0 \${box.width} \${box.height}\`}
@@ -24277,7 +24295,8 @@ function PretextPathEditor({ P, box, viewBox, contours, snap, onChange, onCommit
24277
24295
  data-selection="none"
24278
24296
  >
24279
24297
  {/* Catches double-clicks that land near the outline rather than on it.
24280
- It never stops propagation, so the editor still selects the item. */}
24298
+ It never stops propagation, so the editor still selects the item.
24299
+ Pointer events are off until a path point is selected (armed). */}
24281
24300
  <rect
24282
24301
  className={\`\${P}-editor-surface\`}
24283
24302
  width={box.width}
@@ -24743,10 +24762,39 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
24743
24762
  const dropCapLines = (settings?.dropCap ?? 'off') === 'on' ? Math.max(2, Math.round(settings?.dropCapLines ?? 3)) : 0;
24744
24763
  const showGuides = editor && selected && !isPreviewMode;
24745
24764
 
24765
+ // Host editor signals item drag/resize/nudge on window — hide the shape overlay
24766
+ // for the same stretch so it doesn't float over the moving selection chrome.
24767
+ const [isItemTransforming, setIsItemTransforming] = useState(false);
24768
+ useEffect(() => {
24769
+ if (!editor || !selected) {
24770
+ setIsItemTransforming(false);
24771
+ return;
24772
+ }
24773
+ const start = () => setIsItemTransforming(true);
24774
+ const end = () => setIsItemTransforming(false);
24775
+ const startEvents = [
24776
+ 'ArticleEditor.Item:drag-start',
24777
+ 'ArticleEditor.Selection:resize-start',
24778
+ 'ArticleEditor.Selection:move-start',
24779
+ ] as const;
24780
+ const endEvents = [
24781
+ 'ArticleEditor.Item:drag-end',
24782
+ 'ArticleEditor.Selection:resize-end',
24783
+ 'ArticleEditor.Selection:move-end',
24784
+ ] as const;
24785
+ for (const name of startEvents) window.addEventListener(name, start);
24786
+ for (const name of endEvents) window.addEventListener(name, end);
24787
+ return () => {
24788
+ for (const name of startEvents) window.removeEventListener(name, start);
24789
+ for (const name of endEvents) window.removeEventListener(name, end);
24790
+ };
24791
+ }, [editor, selected]);
24792
+
24746
24793
  /* -- vector editing ----------------------------------------------------- */
24747
24794
 
24748
24795
  const pathEditing = editor && selected && !isPreviewMode
24749
24796
  && typeof onUpdateSettings === 'function';
24797
+ const shapeOverlayVisible = !isItemTransforming;
24750
24798
  const pathSnap = Math.max(0, settings?.pathSnap ?? 0);
24751
24799
  // The draft the handles are dragging. \`base\` is the stored path the session
24752
24800
  // started from, \`serialized\` what the draft writes out — while either still
@@ -24861,12 +24909,12 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
24861
24909
  scale={sharedScale}
24862
24910
  onFitScale={handleFitScale}
24863
24911
  dropCapLines={dropCapLines}
24864
- showGuides={showGuides || pathEditing}
24912
+ showGuides={(showGuides || pathEditing) && shapeOverlayVisible}
24865
24913
  typography={typography}
24866
- pathEditor={usesSharedPath ? pathEditor : null}
24914
+ pathEditor={usesSharedPath && shapeOverlayVisible ? pathEditor : null}
24867
24915
  />
24868
24916
  </div>
24869
24917
  </>
24870
24918
  );
24871
24919
  }
24872
- `,pc=[...Cb],sw={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},lw={type:"object",version:1,settings:{sizing:"manual",properties:{shape:{type:"string",scope:"layout",title:"Shape",display:{type:"drop-down",label:"Shape",enum:pc},enum:pc},customPath:{type:"string",scope:"layout",title:"Path",tooltip:"SVG path (M…) or a point list (0,0 100,0 50,100). Used when Shape is set to custom.",display:{type:"full-width-input",placeholder:"M0,0 C…"}},pathSnap:{type:"number",scope:"common",title:"Snap",tooltip:"Grid the points snap to while dragging, in path units (the path box is 100 x 100). 0 is off.",min:0,max:25,step:.5,display:{type:"numeric-input"}},pathFit:{type:"string",scope:"common",title:"Path fit",tooltip:"Stretch — the drawing fills the box. Viewbox — the drawing keeps its position in path coordinates (0–100).",display:{type:"toggle-cycle",enum:["stretch","viewbox"]}},shapeMode:{type:"string",scope:"common",title:"Text",tooltip:"Contain — text fills the path. Avoid — text flows around the path.",display:{type:"toggle-cycle",enum:["contain","avoid"]}},overflowMode:{type:"string",scope:"common",title:"Overflow",tooltip:"What happens to text that does not fit the path.",display:{type:"toggle-cycle",enum:["clip","visible"]}},fitText:{type:"string",scope:"common",title:"Fit text",tooltip:"Scales the type down until all text fits the path.",display:{type:"toggle-cycle",enum:["off","on"]}},dropCap:{type:"string",scope:"common",title:"Drop cap",display:{type:"toggle-cycle",enum:["off","on"]}},dropCapLines:{type:"number",scope:"common",title:"Drop cap lines",min:2,max:8,step:1,display:{type:"numeric-input"}},backgroundColor:{type:"string",scope:"common",title:"Background",display:{type:"settings-color-picker"}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...sw.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},textAlign:{type:"string",scope:"layout",title:"",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",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"]}}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"style-panel-color-picker"}},linkColor:{type:"string",scope:"common",title:"Link",display:{type:"style-panel-color-picker"}}},defaults:{shape:"diamond",customPath:"",pathSnap:0,pathFit:"stretch",shapeMode:"contain",overflowMode:"clip",fitText:"off",dropCap:"off",dropCapLines:3,backgroundColor:"rgba(0, 0, 0, 0)",textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textAlign:"center",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",linkColor:"#000000"},layoutDefaults:{m:{textFontSize:.037,textLineHeight:.048,textLetterSpacing:0,textWordSpacing:0},t:{textFontSize:.018,textLineHeight:.024,textLetterSpacing:0,textWordSpacing:0},d:{textFontSize:.011,textLineHeight:.0155,textLetterSpacing:0,textWordSpacing:0}},layout:["__componentName__","shape","customPath","pathSnap","pathFit","shapeMode","overflowMode","fitText","dropCap","dropCapLines"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",title:"Path",items:["shape","shapeMode"]},{type:"row",title:"Text Flow",items:["overflowMode","dropCap"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"",items:["textFontFamily","textFontSettings",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textAlign","textTextAppearance"]}]}],paletteBookmark:{items:["textColor","linkColor","backgroundColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemWithoutImage:!0,addItemFromFileExplorer:!1},display:{type:"array"},items:{type:"object",properties:{text:{label:"Text",placeholder:"Add Text...",display:{type:"rich-text"}},path:{type:"string",label:"Path",placeholder:"Optional path for this column...",display:{type:"text-input"}}}},default:[{text:[{type:"paragraph",children:[{text:"Style is viewed by many as a shallow obsession with disembodied surfaces. However our activities as designers are based on style’s function as a cultural communicator. A vocabulary or set of formal characteristics constitutes a particular style, recognized most frequently in retrospect. Style itself is the visual language of a culture: in fashion, in consumer goods, in art, in literature, in all media. Style is ephemeral; it is timely. To be in style is to embody the influences and values of your time."}]}],path:""}]}},cw={element:rw,id:"pretext",name:"Pretext",category:"ui-elements",version:1,defaultSize:{d:{width:620,height:780},t:{width:620,height:780},m:{width:334,height:480}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple-Marquee.mp4"},schema:lw,sourceCode:aw,assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily"}},dw=[tm,lm,kv,eg,cg,xg,Hg,Gg,Jg,$h,yf,wy,My,pv,$v,Vv,D0,t0,ix,Fx,vb,cw];exports.components=dw;exports.isSchemaV1=Ud;
24920
+ `,pc=[...Cb],sw={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},lw={type:"object",version:1,settings:{sizing:"manual",properties:{shape:{type:"string",scope:"layout",title:"Shape",display:{type:"drop-down",label:"Shape",enum:pc},enum:pc},customPath:{type:"string",scope:"layout",title:"Path",tooltip:"SVG path (M…) or a point list (0,0 100,0 50,100). Used when Shape is set to custom.",display:{type:"full-width-input",placeholder:"M0,0 C…"}},pathSnap:{type:"number",scope:"common",title:"Snap",tooltip:"Grid the points snap to while dragging, in path units (the path box is 100 x 100). 0 is off.",min:0,max:25,step:.5,display:{type:"numeric-input"}},pathFit:{type:"string",scope:"common",title:"Path fit",tooltip:"Stretch — the drawing fills the box. Viewbox — the drawing keeps its position in path coordinates (0–100).",display:{type:"toggle-cycle",enum:["stretch","viewbox"]}},shapeMode:{type:"string",scope:"common",title:"Text",tooltip:"Contain — text fills the path. Avoid — text flows around the path.",display:{type:"toggle-cycle",enum:["contain","avoid"]}},overflowMode:{type:"string",scope:"common",title:"Overflow",tooltip:"What happens to text that does not fit the path.",display:{type:"toggle-cycle",enum:["clip","visible"]}},fitText:{type:"string",scope:"common",title:"Fit text",tooltip:"Scales the type down until all text fits the path.",display:{type:"toggle-cycle",enum:["off","on"]}},dropCap:{type:"string",scope:"common",title:"Drop cap",display:{type:"toggle-cycle",enum:["off","on"]}},dropCapLines:{type:"number",scope:"common",title:"Drop cap lines",min:2,max:8,step:1,display:{type:"numeric-input"}},backgroundColor:{type:"string",scope:"common",title:"Background",display:{type:"settings-color-picker"}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...sw.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},textAlign:{type:"string",scope:"layout",title:"",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",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"]}}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"style-panel-color-picker"}},linkColor:{type:"string",scope:"common",title:"Link",display:{type:"style-panel-color-picker"}}},defaults:{shape:"diamond",customPath:"",pathSnap:0,pathFit:"stretch",shapeMode:"contain",overflowMode:"clip",fitText:"off",dropCap:"off",dropCapLines:3,backgroundColor:"rgba(0, 0, 0, 0)",textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textAlign:"center",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",linkColor:"#000000"},layoutDefaults:{m:{textFontSize:.037,textLineHeight:.048,textLetterSpacing:0,textWordSpacing:0},t:{textFontSize:.018,textLineHeight:.024,textLetterSpacing:0,textWordSpacing:0},d:{textFontSize:.011,textLineHeight:.0155,textLetterSpacing:0,textWordSpacing:0}},layout:["__componentName__","shape","customPath","pathSnap","pathFit","shapeMode","overflowMode","fitText","dropCap","dropCapLines"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",title:"Path",items:["shape","shapeMode"]},{type:"row",title:"Text Flow",items:["overflowMode","dropCap"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"",items:["textFontFamily","textFontSettings",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textAlign","textTextAppearance"]}]}],paletteBookmark:{items:["textColor","linkColor","backgroundColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemWithoutImage:!0,addItemFromFileExplorer:!1},display:{type:"array"},items:{type:"object",properties:{text:{label:"Text",placeholder:"Add Text...",display:{type:"rich-text"}},path:{type:"string",label:"Path",placeholder:"Optional path for this column...",display:{type:"text-input"}}}},default:[{text:[{type:"paragraph",children:[{text:"Style is viewed by many as a shallow obsession with disembodied surfaces. However our activities as designers are based on style’s function as a cultural communicator. A vocabulary or set of formal characteristics constitutes a particular style, recognized most frequently in retrospect. Style itself is the visual language of a culture: in fashion, in consumer goods, in art, in literature, in all media. Style is ephemeral; it is timely. To be in style is to embody the influences and values of your time."}]}],path:""}]}},cw={element:rw,id:"pretext",name:"Pretext",category:"typography",version:1,defaultSize:{d:{width:620,height:780},t:{width:620,height:780},m:{width:334,height:480}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple-Marquee.mp4"},schema:lw,sourceCode:aw,assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily"}},dw=[tm,lm,kv,eg,cg,xg,Hg,Gg,Jg,$h,yf,wy,My,pv,$v,Vv,D0,t0,ix,Fx,vb,cw];exports.components=dw;exports.isSchemaV1=Ud;