@cntrl-site/components 1.0.66-alpha.2 → 1.0.66-alpha.4

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 +95 -88
  2. package/dist/index.mjs +6889 -6872
  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"),pt=require("classnames"),D=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),zn=require("react-dom");function $u(e){return e.type==="object"&&e.version===1}const Tu="ControlSlider-module__wrapper___sHEkd",Iu="ControlSlider-module__hoverArrow___A-dOH",Ru="ControlSlider-module__sliderItem___QQSkR",Lu="ControlSlider-module__sliderImage___9hRl-",Pu="ControlSlider-module__arrow___05ghY",Eu="ControlSlider-module__arrowVertical___tBfVN",Mu="ControlSlider-module__nextArrow___-30Yc",ku="ControlSlider-module__arrowInner___aEra3",Au="ControlSlider-module__arrowIcon___S4ztF",Fu="ControlSlider-module__arrowImg___2dwJW",_u="ControlSlider-module__mirror___brd6U",Nu="ControlSlider-module__pagination___bicLF",Wu="ControlSlider-module__paginationInner___bT-P-",Hu="ControlSlider-module__paginationVertical___zYqKw",Du="ControlSlider-module__paginationItem___nTRbk",Ou="ControlSlider-module__dot___p1Qun",Bu="ControlSlider-module__activeDot___LHFaj",zu="ControlSlider-module__paginationInsideBottom___R3FWn",ju="ControlSlider-module__paginationInsideTop___V-qb-",Vu="ControlSlider-module__paginationOutsideBottom___14w8D",Gu="ControlSlider-module__paginationOutsideTop___SCLqB",Xu="ControlSlider-module__paginationInsideLeft___yOBRZ",Yu="ControlSlider-module__paginationInsideRight___Rtt3o",qu="ControlSlider-module__paginationOutsideLeft___lahaw",Uu="ControlSlider-module__paginationOutsideRight___EtuQa",Ku="ControlSlider-module__imgWrapper___UjEgB",Zu="ControlSlider-module__captionBlock___dJ6-j",Ju="ControlSlider-module__captionTextWrapper___HFlpf",Qu="ControlSlider-module__captionText___uGBVc",ep="ControlSlider-module__active___WZK4G",tp="ControlSlider-module__withPointerEvents___t-18M",np="ControlSlider-module__topLeftAlignment___zjnGM",ip="ControlSlider-module__topCenterAlignment___gD1xW",op="ControlSlider-module__topRightAlignment___NMapS",rp="ControlSlider-module__middleLeftAlignment___OnUrY",ap="ControlSlider-module__middleCenterAlignment___Tdkl0",sp="ControlSlider-module__middleRightAlignment___wEbfX",lp="ControlSlider-module__bottomLeftAlignment___cTP2-",cp="ControlSlider-module__bottomCenterAlignment___c54fB",dp="ControlSlider-module__bottomRightAlignment___kEwrz",up="ControlSlider-module__clickOverlay___DZA28",pp="ControlSlider-module__contain___pLyq7",mp="ControlSlider-module__cover___KdDat",ut={wrapper:Tu,hoverArrow:Iu,sliderItem:Ru,sliderImage:Lu,arrow:Pu,arrowVertical:Eu,nextArrow:Mu,arrowInner:ku,arrowIcon:Au,arrowImg:Fu,mirror:_u,pagination:Nu,paginationInner:Wu,paginationVertical:Hu,paginationItem:Du,dot:Ou,activeDot:Bu,paginationInsideBottom:zu,paginationInsideTop:ju,paginationOutsideBottom:Vu,paginationOutsideTop:Gu,paginationInsideLeft:Xu,paginationInsideRight:Yu,paginationOutsideLeft:qu,paginationOutsideRight:Uu,imgWrapper:Ku,captionBlock:Zu,captionTextWrapper:Ju,captionText:Qu,active:ep,withPointerEvents:tp,topLeftAlignment:np,topCenterAlignment:ip,topRightAlignment:op,middleLeftAlignment:rp,middleCenterAlignment:ap,middleRightAlignment:sp,bottomLeftAlignment:lp,bottomCenterAlignment:cp,bottomRightAlignment:dp,clickOverlay:up,contain:pp,cover:mp};function gp(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 hp(e,t,n){return t&&gp(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var ol="(prefers-reduced-motion: reduce)",Bi=1,fp=2,Ui=3,lo=4,Xo=5,Ir=6,_r=7,yp={CREATED:Bi,MOUNTED:fp,IDLE:Ui,MOVING:lo,SCROLLING:Xo,DRAGGING:Ir,DESTROYED:_r};function On(e){e.length=0}function ai(e,t,n){return Array.prototype.slice.call(e,t,n)}function qt(e){return e.bind.apply(e,[null].concat(ai(arguments,1)))}var zc=setTimeout,Ka=function(){};function rl(e){return requestAnimationFrame(e)}function Kr(e,t){return typeof t===e}function Mo(e){return!Cs(e)&&Kr("object",e)}var Ss=Array.isArray,jc=qt(Kr,"function"),ni=qt(Kr,"string"),Yo=qt(Kr,"undefined");function Cs(e){return e===null}function Vc(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function qo(e){return Ss(e)?e:[e]}function vn(e,t){qo(e).forEach(t)}function $s(e,t){return e.indexOf(t)>-1}function Rr(e,t){return e.push.apply(e,qo(t)),e}function _n(e,t,n){e&&vn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function En(e,t){_n(e,ni(t)?t.split(" "):t,!0)}function Uo(e,t){vn(t,e.appendChild.bind(e))}function Ts(e,t){vn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function ko(e,t){return Vc(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Gc(e,t){var n=e?ai(e.children):[];return t?n.filter(function(i){return ko(i,t)}):n}function Ko(e,t){return t?Gc(e,t)[0]:e.firstElementChild}var Ao=Object.keys;function Ci(e,t,n){return e&&(n?Ao(e).reverse():Ao(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function Fo(e){return ai(arguments,1).forEach(function(t){Ci(t,function(n,i){e[i]=t[i]})}),e}function qn(e){return ai(arguments,1).forEach(function(t){Ci(t,function(n,i){Ss(n)?e[i]=n.slice():Mo(n)?e[i]=qn({},Mo(e[i])?e[i]:{},n):e[i]=n})}),e}function al(e,t){vn(t||Ao(e),function(n){delete e[n]})}function Mn(e,t){vn(e,function(n){vn(t,function(i){n&&n.removeAttribute(i)})})}function $t(e,t,n){Mo(t)?Ci(t,function(i,o){$t(e,o,i)}):vn(e,function(i){Cs(n)||n===""?Mn(i,t):i.setAttribute(t,String(n))})}function Gi(e,t,n){var i=document.createElement(e);return t&&(ni(t)?En(i,t):$t(i,t)),n&&Uo(n,i),i}function wn(e,t,n){if(Yo(n))return getComputedStyle(e)[t];Cs(n)||(e.style[t]=""+n)}function _o(e,t){wn(e,"display",t)}function Xc(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Sn(e,t){return e.getAttribute(t)}function sl(e,t){return e&&e.classList.contains(t)}function hn(e){return e.getBoundingClientRect()}function Ti(e){vn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Yc(e){return Ko(new DOMParser().parseFromString(e,"text/html").body)}function Fn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function qc(e,t){return e&&e.querySelector(t)}function Is(e,t){return t?ai(e.querySelectorAll(t)):[]}function Nn(e,t){_n(e,t,!1)}function Za(e){return e.timeStamp}function pi(e){return ni(e)?e:e?e+"px":""}var Zo="splide",Rs="data-"+Zo;function Ro(e,t){if(!e)throw new Error("["+Zo+"] "+(t||""))}var ii=Math.min,Nr=Math.max,Wr=Math.floor,No=Math.ceil,dn=Math.abs;function Uc(e,t,n){return dn(e-t)<n}function Lr(e,t,n,i){var o=ii(t,n),r=Nr(t,n);return i?o<e&&e<r:o<=e&&e<=r}function Wi(e,t,n){var i=ii(t,n),o=Nr(t,n);return ii(Nr(i,e),o)}function Ja(e){return+(e>0)-+(e<0)}function Qa(e,t){return vn(t,function(n){e=e.replace("%s",""+n)}),e}function Ls(e){return e<10?"0"+e:""+e}var ll={};function xp(e){return""+e+Ls(ll[e]=(ll[e]||0)+1)}function Kc(){var e=[];function t(l,d,c,u){o(l,d,function(p,x,w){var m="addEventListener"in p,h=m?p.removeEventListener.bind(p,x,c,u):p.removeListener.bind(p,c);m?p.addEventListener(x,c,u):p.addListener(c),e.push([p,x,w,c,h])})}function n(l,d,c){o(l,d,function(u,p,x){e=e.filter(function(w){return w[0]===u&&w[1]===p&&w[2]===x&&(!c||w[3]===c)?(w[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){vn(l,function(u){u&&vn(d,function(p){p.split(" ").forEach(function(x){var w=x.split(".");c(u,w[0],w[1])})})})}function r(){e.forEach(function(l){l[4]()}),On(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var si="mounted",es="ready",Bn="move",co="moved",Ps="click",Zc="active",Jc="inactive",Qc="visible",ed="hidden",en="refresh",ln="updated",Ki="resize",Zr="resized",td="drag",nd="dragging",id="dragged",Jr="scroll",Li="scrolled",vp="overflow",Es="destroy",od="arrows:mounted",rd="arrows:updated",ad="pagination:mounted",sd="pagination:updated",Ms="navigation:mounted",ks="autoplay:play",ld="autoplay:playing",As="autoplay:pause",Fs="lazyload:loaded",cd="sk",dd="sh",Hr="ei";function Zt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Kc();function i(r,l){n.bind(t,qo(r).join(" "),function(d){l.apply(l,Ss(d.detail)?d.detail:[])})}function o(r){n.dispatch(t,r,ai(arguments,1))}return e&&e.event.on(Es,n.destroy),Fo(n,{bus:t,on:i,off:qt(n.unbind,t),emit:o})}function Qr(e,t,n,i){var o=Date.now,r,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?ii((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return w();d=rl(p)}}function x(C){C||h(),r=o()-(C?l*e:0),c=!1,d=rl(p)}function w(){c=!0}function m(){r=o(),l=0,n&&n(l)}function h(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function f(C){e=C}function v(){return c}return{start:x,rewind:m,pause:w,cancel:h,set:f,isPaused:v}}function bp(e){var t=e;function n(o){t=o}function i(o){return $s(qo(o),t)}return{set:n,is:i}}function wp(e,t){var n=Qr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Sp(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=Kc(),d=[];function c(){var h=n.mediaQuery==="min";Ao(o).sort(function(f,v){return h?+f-+v:+v-+f}).forEach(function(f){p(o[f],"("+(h?"min":"max")+"-width:"+f+"px)")}),p(r,ol),x()}function u(h){h&&l.destroy()}function p(h,f){var v=matchMedia(f);l.bind(v,"change",x),d.push([h,v])}function x(){var h=i.is(_r),f=n.direction,v=d.reduce(function(C,y){return qn(C,y[1].matches?y[0]:{})},{});al(n),m(v),n.destroy?e.destroy(n.destroy==="completely"):h?(u(!0),e.mount()):f!==n.direction&&e.refresh()}function w(h){matchMedia(ol).matches&&(h?qn(n,r):al(n,Ao(r)))}function m(h,f,v){qn(n,h),f&&qn(Object.getPrototypeOf(n),h),(v||!i.is(Bi))&&e.emit(ln,n)}return{setup:c,destroy:u,reduce:w,set:m}}var ea="Arrow",ta=ea+"Left",na=ea+"Right",ud=ea+"Up",pd=ea+"Down",cl="rtl",ia="ttb",fa={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[ud,na],ArrowRight:[pd,ta]};function Cp(e,t,n){function i(r,l,d){d=d||n.direction;var c=d===cl&&!l?1:d===ia?0:-1;return fa[r]&&fa[r][c]||r.replace(/width|left|right/i,function(u,p){var x=fa[u.toLowerCase()][c]||u;return p>0?x.charAt(0).toUpperCase()+x.slice(1):x})}function o(r){return r*(n.direction===cl?1:-1)}return{resolve:i,orient:o}}var Wn="role",Xi="tabindex",$p="disabled",Cn="aria-",Jo=Cn+"controls",md=Cn+"current",dl=Cn+"selected",yn=Cn+"label",_s=Cn+"labelledby",gd=Cn+"hidden",Ns=Cn+"orientation",Wo=Cn+"roledescription",ul=Cn+"live",pl=Cn+"busy",ml=Cn+"atomic",Ws=[Wn,Xi,$p,Jo,md,yn,_s,gd,Ns,Wo],kn=Zo+"__",li="is-",ya=Zo,gl=kn+"track",Tp=kn+"list",oa=kn+"slide",hd=oa+"--clone",Ip=oa+"__container",Hs=kn+"arrows",ra=kn+"arrow",fd=ra+"--prev",yd=ra+"--next",aa=kn+"pagination",xd=aa+"__page",Rp=kn+"progress",Lp=Rp+"__bar",Pp=kn+"toggle",Ep=kn+"spinner",Mp=kn+"sr",kp=li+"initialized",Ii=li+"active",vd=li+"prev",bd=li+"next",ts=li+"visible",ns=li+"loading",wd=li+"focus-in",Sd=li+"overflow",Ap=[Ii,ts,vd,bd,ns,wd,Sd],Fp={slide:oa,clone:hd,arrows:Hs,arrow:ra,prev:fd,next:yd,pagination:aa,page:xd,spinner:Ep};function _p(e,t){if(jc(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!ko(n,t);)n=n.parentElement;return n}var Np=5,hl=200,Cd="touchstart mousedown",xa="touchmove mousemove",va="touchend touchcancel mouseup click";function Wp(e,t,n){var i=Zt(e),o=i.on,r=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],x=[],w,m,h;function f(){S(),V(),y()}function v(){o(en,C),o(en,f),o(ln,y),r(document,Cd+" keydown",function(W){h=W.type==="keydown"},{capture:!0}),r(l,"focusin",function(){_n(l,wd,!!h)})}function C(W){var I=Ws.concat("style");On(u),Nn(l,p),Nn(w,x),Mn([w,m],I),Mn(l,W?I:["style",Wo])}function y(){Nn(l,p),Nn(w,x),p=q(ya),x=q(gl),En(l,p),En(w,x),$t(l,yn,n.label),$t(l,_s,n.labelledby)}function S(){w=N("."+gl),m=Ko(w,"."+Tp),Ro(w&&m,"A track/list element is missing."),Rr(u,Gc(m,"."+oa+":not(."+hd+")")),Ci({arrows:Hs,pagination:aa,prev:fd,next:yd,bar:Lp,toggle:Pp},function(W,I){c[I]=N("."+W)}),Fo(c,{root:l,track:w,list:m,slides:u})}function V(){var W=l.id||xp(Zo),I=n.role;l.id=W,w.id=w.id||W+"-track",m.id=m.id||W+"-list",!Sn(l,Wn)&&l.tagName!=="SECTION"&&I&&$t(l,Wn,I),$t(l,Wo,d.carousel),$t(m,Wn,"presentation")}function N(W){var I=qc(l,W);return I&&_p(I,"."+ya)===l?I:void 0}function q(W){return[W+"--"+n.type,W+"--"+n.direction,n.drag&&W+"--draggable",n.isNavigation&&W+"--nav",W===ya&&Ii]}return Fo(c,{setup:f,mount:v,destroy:C})}var Zi="slide",uo="loop",Qo="fade";function Hp(e,t,n,i){var o=Zt(e),r=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,x=p.isNavigation,w=p.updateOnMove,m=p.i18n,h=p.pagination,f=p.slideFocus,v=c.Direction.resolve,C=Sn(i,"style"),y=Sn(i,yn),S=n>-1,V=Ko(i,"."+Ip),N;function q(){S||(i.id=u.id+"-slide"+Ls(t+1),$t(i,Wn,h?"tabpanel":"group"),$t(i,Wo,m.slide),$t(i,yn,y||Qa(m.slideLabel,[t+1,e.length]))),W()}function W(){d(i,"click",qt(l,Ps,te)),d(i,"keydown",qt(l,cd,te)),r([co,dd,Li],T),r(Ms,B),w&&r(Bn,$)}function I(){N=!0,o.destroy(),Nn(i,Ap),Mn(i,Ws),$t(i,"style",C),$t(i,yn,y||"")}function B(){var L=e.splides.map(function(H){var U=H.splide.Components.Slides.getAt(t);return U?U.slide.id:""}).join(" ");$t(i,yn,Qa(m.slideX,(S?n:t)+1)),$t(i,Jo,L),$t(i,Wn,f?"button":""),f&&Mn(i,Wo)}function $(){N||T()}function T(){if(!N){var L=e.index;k(),F(),_n(i,vd,t===L-1),_n(i,bd,t===L+1)}}function k(){var L=O();L!==sl(i,Ii)&&(_n(i,Ii,L),$t(i,md,x&&L||""),l(L?Zc:Jc,te))}function F(){var L=P(),H=!L&&(!O()||S);if(e.state.is([lo,Xo])||$t(i,gd,H||""),$t(Is(i,p.focusableNodes||""),Xi,H?-1:""),f&&$t(i,Xi,H?-1:0),L!==sl(i,ts)&&(_n(i,ts,L),l(L?Qc:ed,te)),!L&&document.activeElement===i){var U=c.Slides.getAt(e.index);U&&Xc(U.slide)}}function g(L,H,U){wn(U&&V||i,L,H)}function O(){var L=e.index;return L===t||p.cloneStatus&&L===n}function P(){if(e.is(Qo))return O();var L=hn(c.Elements.track),H=hn(i),U=v("left",!0),de=v("right",!0);return Wr(L[U])<=No(H[U])&&Wr(H[de])<=No(L[de])}function X(L,H){var U=dn(L-t);return!S&&(p.rewind||e.is(uo))&&(U=ii(U,e.length-U)),U<=H}var te={index:t,slideIndex:n,slide:i,container:V,isClone:S,mount:q,destroy:I,update:T,style:g,isWithin:X};return te}function Dp(e,t,n){var i=Zt(e),o=i.on,r=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function x(){w(),o(en,m),o(en,w)}function w(){c.forEach(function(T,k){f(T,k,-1)})}function m(){N(function(T){T.destroy()}),On(p)}function h(){N(function(T){T.update()})}function f(T,k,F){var g=Hp(e,k,F,T);g.mount(),p.push(g),p.sort(function(O,P){return O.index-P.index})}function v(T){return T?q(function(k){return!k.isClone}):p}function C(T){var k=t.Controller,F=k.toIndex(T),g=k.hasFocus()?1:n.perPage;return q(function(O){return Lr(O.index,F,F+g-1)})}function y(T){return q(T)[0]}function S(T,k){vn(T,function(F){if(ni(F)&&(F=Yc(F)),Vc(F)){var g=c[k];g?Ts(F,g):Uo(u,F),En(F,n.classes.slide),I(F,qt(r,Ki))}}),r(en)}function V(T){Ti(q(T).map(function(k){return k.slide})),r(en)}function N(T,k){v(k).forEach(T)}function q(T){return p.filter(jc(T)?T:function(k){return ni(T)?ko(k.slide,T):$s(qo(T),k.index)})}function W(T,k,F){N(function(g){g.style(T,k,F)})}function I(T,k){var F=Is(T,"img"),g=F.length;g?F.forEach(function(O){l(O,"load error",function(){--g||k()})}):k()}function B(T){return T?c.length:p.length}function $(){return p.length>n.perPage}return{mount:x,destroy:m,update:h,register:f,get:v,getIn:C,getAt:y,add:S,remove:V,forEach:N,filter:q,style:W,getLength:B,isEnough:$}}function Op(e,t,n){var i=Zt(e),o=i.on,r=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,x=u.track,w=u.list,m=d.getAt,h=d.style,f,v,C;function y(){S(),r(window,"resize load",wp(qt(l,Ki))),o([ln,en],S),o(Ki,V)}function S(){f=n.direction===ia,wn(p,"maxWidth",pi(n.width)),wn(x,c("paddingLeft"),N(!1)),wn(x,c("paddingRight"),N(!0)),V(!0)}function V(te){var L=hn(p);(te||v.width!==L.width||v.height!==L.height)&&(wn(x,"height",q()),h(c("marginRight"),pi(n.gap)),h("width",I()),h("height",B(),!0),v=L,l(Zr),C!==(C=X())&&(_n(p,Sd,C),l(vp,C)))}function N(te){var L=n.padding,H=c(te?"right":"left");return L&&pi(L[H]||(Mo(L)?0:L))||"0px"}function q(){var te="";return f&&(te=W(),Ro(te,"height or heightRatio is missing."),te="calc("+te+" - "+N(!1)+" - "+N(!0)+")"),te}function W(){return pi(n.height||hn(w).width*n.heightRatio)}function I(){return n.autoWidth?null:pi(n.fixedWidth)||(f?"":$())}function B(){return pi(n.fixedHeight)||(f?n.autoHeight?null:$():W())}function $(){var te=pi(n.gap);return"calc((100%"+(te&&" + "+te)+")/"+(n.perPage||1)+(te&&" - "+te)+")"}function T(){return hn(w)[c("width")]}function k(te,L){var H=m(te||0);return H?hn(H.slide)[c("width")]+(L?0:O()):0}function F(te,L){var H=m(te);if(H){var U=hn(H.slide)[c("right")],de=hn(w)[c("left")];return dn(U-de)+(L?0:O())}return 0}function g(te){return F(e.length-1)-F(0)+k(0,te)}function O(){var te=m(0);return te&&parseFloat(wn(te.slide,c("marginRight")))||0}function P(te){return parseFloat(wn(x,c("padding"+(te?"Right":"Left"))))||0}function X(){return e.is(Qo)||g(!0)>T()}return{mount:y,resize:V,listSize:T,slideSize:k,sliderSize:g,totalSize:F,getPadding:P,isOverflow:X}}var Bp=2;function zp(e,t,n){var i=Zt(e),o=i.on,r=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(en,x),o([ln,Ki],m),(u=v())&&(h(u),t.Layout.resize(!0))}function x(){w(),p()}function w(){Ti(c),On(c),i.destroy()}function m(){var C=v();u!==C&&(u<C||!C)&&i.emit(en)}function h(C){var y=l.get().slice(),S=y.length;if(S){for(;y.length<C;)Rr(y,y);Rr(y.slice(-C),y.slice(0,C)).forEach(function(V,N){var q=N<C,W=f(V.slide,N);q?Ts(W,y[0].slide):Uo(r.list,W),Rr(c,W),l.register(W,N-C+(q?0:S),V.index)})}}function f(C,y){var S=C.cloneNode(!0);return En(S,n.classes.clone),S.id=e.root.id+"-clone"+Ls(y+1),S}function v(){var C=n.clones;if(!e.is(uo))C=0;else if(Yo(C)){var y=n[d("fixedWidth")]&&t.Layout.slideSize(0),S=y&&No(hn(r.track)[d("width")]/y);C=S||n[d("autoWidth")]&&e.length||n.perPage*Bp}return C}return{mount:p,destroy:w}}function jp(e,t,n){var i=Zt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,x=d.listSize,w=d.sliderSize,m=t.Direction,h=m.resolve,f=m.orient,v=t.Elements,C=v.list,y=v.track,S;function V(){S=t.Transition,o([si,Zr,ln,en],N)}function N(){t.Controller.isBusy()||(t.Scroll.cancel(),W(e.index),t.Slides.update())}function q(H,U,de,ae){H!==U&&te(H>de)&&(T(),I($(g(),H>de),!0)),l(lo),r(Bn,U,de,H),S.start(U,function(){l(Ui),r(co,U,de,H),ae&&ae()})}function W(H){I(F(H,!0))}function I(H,U){if(!e.is(Qo)){var de=U?H:B(H);wn(C,"transform","translate"+h("X")+"("+de+"px)"),H!==de&&r(dd)}}function B(H){if(e.is(uo)){var U=k(H),de=U>t.Controller.getEnd(),ae=U<0;(ae||de)&&(H=$(H,de))}return H}function $(H,U){var de=H-X(U),ae=w();return H-=f(ae*(No(dn(de)/ae)||1))*(U?1:-1),H}function T(){I(g(),!0),S.cancel()}function k(H){for(var U=t.Slides.get(),de=0,ae=1/0,A=0;A<U.length;A++){var ce=U[A].index,z=dn(F(ce,!0)-H);if(z<=ae)ae=z,de=ce;else break}return de}function F(H,U){var de=f(p(H-1)-P(H));return U?O(de):de}function g(){var H=h("left");return hn(C)[H]-hn(y)[H]+f(u(!1))}function O(H){return n.trimSpace&&e.is(Zi)&&(H=Wi(H,0,f(w(!0)-x()))),H}function P(H){var U=n.focus;return U==="center"?(x()-c(H,!0))/2:+U*c(H)||0}function X(H){return F(H?t.Controller.getEnd():0,!!n.trimSpace)}function te(H){var U=f($(g(),H));return H?U>=0:U<=C[h("scrollWidth")]-hn(y)[h("width")]}function L(H,U){U=Yo(U)?g():U;var de=H!==!0&&f(U)<f(X(!1)),ae=H!==!1&&f(U)>f(X(!0));return de||ae}return{mount:V,move:q,jump:W,translate:I,shift:$,cancel:T,toIndex:k,toPosition:F,getPosition:g,getLimit:X,exceededLimit:L,reposition:N}}function Vp(e,t,n){var i=Zt(e),o=i.on,r=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,x=p.isEnough,w=p.getLength,m=n.omitEnd,h=e.is(uo),f=e.is(Zi),v=qt(g,!1),C=qt(g,!0),y=n.start||0,S,V=y,N,q,W;function I(){B(),o([ln,en,Hr],B),o(Zr,$)}function B(){N=w(!0),q=n.perMove,W=n.perPage,S=te();var z=Wi(y,0,m?S:N-1);z!==y&&(y=z,l.reposition())}function $(){S!==te()&&r(Hr)}function T(z,re,ee){if(!ce()){var xe=F(z),Fe=X(xe);Fe>-1&&(re||Fe!==y)&&(de(Fe),l.move(xe,Fe,V,ee))}}function k(z,re,ee,xe){t.Scroll.scroll(z,re,ee,function(){var Fe=X(l.toIndex(d()));de(m?ii(Fe,S):Fe),xe&&xe()})}function F(z){var re=y;if(ni(z)){var ee=z.match(/([+\-<>])(\d+)?/)||[],xe=ee[1],Fe=ee[2];xe==="+"||xe==="-"?re=O(y+ +(""+xe+(+Fe||1)),y):xe===">"?re=Fe?L(+Fe):v(!0):xe==="<"&&(re=C(!0))}else re=h?z:Wi(z,0,S);return re}function g(z,re){var ee=q||(A()?1:W),xe=O(y+ee*(z?-1:1),y,!(q||A()));return xe===-1&&f&&!Uc(d(),c(!z),1)?z?0:S:re?xe:X(xe)}function O(z,re,ee){if(x()||A()){var xe=P(z);xe!==z&&(re=z,z=xe,ee=!1),z<0||z>S?!q&&(Lr(0,z,re,!0)||Lr(S,re,z,!0))?z=L(H(z)):h?z=ee?z<0?-(N%W||W):N:z:n.rewind?z=z<0?S:0:z=-1:ee&&z!==re&&(z=L(H(re)+(z<re?-1:1)))}else z=-1;return z}function P(z){if(f&&n.trimSpace==="move"&&z!==y)for(var re=d();re===u(z,!0)&&Lr(z,0,e.length-1,!n.rewind);)z<y?--z:++z;return z}function X(z){return h?(z+N)%N||0:z}function te(){for(var z=N-(A()||h&&q?1:W);m&&z-- >0;)if(u(N-1,!0)!==u(z,!0)){z++;break}return Wi(z,0,N-1)}function L(z){return Wi(A()?z:W*z,0,S)}function H(z){return A()?ii(z,S):Wr((z>=S?N-1:z)/W)}function U(z){var re=l.toIndex(z);return f?Wi(re,0,S):re}function de(z){z!==y&&(V=y,y=z)}function ae(z){return z?V:y}function A(){return!Yo(n.focus)||n.isNavigation}function ce(){return e.state.is([lo,Xo])&&!!n.waitForTransition}return{mount:I,go:T,scroll:k,getNext:v,getPrev:C,getAdjacent:g,getEnd:te,setIndex:de,getIndex:ae,toIndex:L,toPage:H,toDest:U,hasFocus:A,isBusy:ce}}var Gp="http://www.w3.org/2000/svg",Xp="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",sr=40;function Yp(e,t,n){var i=Zt(e),o=i.on,r=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,x=u.arrows,w=u.track,m=x,h=u.prev,f=u.next,v,C,y={};function S(){N(),o(ln,V)}function V(){q(),S()}function N(){var k=n.arrows;k&&!(h&&f)&&B(),h&&f&&(Fo(y,{prev:h,next:f}),_o(m,k?"":"none"),En(m,C=Hs+"--"+n.direction),k&&(W(),T(),$t([h,f],Jo,w.id),l(od,h,f)))}function q(){i.destroy(),Nn(m,C),v?(Ti(x?[h,f]:m),h=f=null):Mn([h,f],Ws)}function W(){o([si,co,en,Li,Hr],T),r(f,"click",qt(I,">")),r(h,"click",qt(I,"<"))}function I(k){p.go(k,!0)}function B(){m=x||Gi("div",d.arrows),h=$(!0),f=$(!1),v=!0,Uo(m,[h,f]),!x&&Ts(m,w)}function $(k){var F='<button class="'+d.arrow+" "+(k?d.prev:d.next)+'" type="button"><svg xmlns="'+Gp+'" viewBox="0 0 '+sr+" "+sr+'" width="'+sr+'" height="'+sr+'" focusable="false"><path d="'+(n.arrowPath||Xp)+'" />';return Yc(F)}function T(){if(h&&f){var k=e.index,F=p.getPrev(),g=p.getNext(),O=F>-1&&k<F?c.last:c.prev,P=g>-1&&k>g?c.first:c.next;h.disabled=F<0,f.disabled=g<0,$t(h,yn,O),$t(f,yn,P),l(rd,h,f,F,g)}}return{arrows:y,mount:S,destroy:q,update:T}}var qp=Rs+"-interval";function Up(e,t,n){var i=Zt(e),o=i.on,r=i.bind,l=i.emit,d=Qr(n.interval,e.go.bind(e,">"),W),c=d.isPaused,u=t.Elements,p=t.Elements,x=p.root,w=p.toggle,m=n.autoplay,h,f,v=m==="pause";function C(){m&&(y(),w&&$t(w,Jo,u.track.id),v||S(),q())}function y(){n.pauseOnHover&&r(x,"mouseenter mouseleave",function(B){h=B.type==="mouseenter",N()}),n.pauseOnFocus&&r(x,"focusin focusout",function(B){f=B.type==="focusin",N()}),w&&r(w,"click",function(){v?S():V(!0)}),o([Bn,Jr,en],d.rewind),o(Bn,I)}function S(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),f=h=v=!1,q(),l(ks))}function V(B){B===void 0&&(B=!0),v=!!B,q(),c()||(d.pause(),l(As))}function N(){v||(h||f?V(!1):S())}function q(){w&&(_n(w,Ii,!v),$t(w,yn,n.i18n[v?"play":"pause"]))}function W(B){var $=u.bar;$&&wn($,"width",B*100+"%"),l(ld,B)}function I(B){var $=t.Slides.getAt(B);d.set($&&+Sn($.slide,qp)||n.interval)}return{mount:C,destroy:d.cancel,play:S,pause:V,isPaused:c}}function Kp(e,t,n){var i=Zt(e),o=i.on;function r(){n.cover&&(o(Fs,qt(d,!0)),o([si,ln,en],qt(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Ko(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),_o(u,c?"none":"")}return{mount:r,destroy:qt(l,!1)}}var Zp=10,Jp=600,Qp=.6,em=1.5,tm=800;function nm(e,t,n){var i=Zt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,x=d.translate,w=e.is(Zi),m,h,f=1;function v(){o(Bn,V),o([ln,en],N)}function C(W,I,B,$,T){var k=c();if(V(),B&&(!w||!p())){var F=t.Layout.sliderSize(),g=Ja(W)*F*Wr(dn(W)/F)||0;W=d.toPosition(t.Controller.toDest(W%F))+g}var O=Uc(k,W,1);f=1,I=O?0:I||Nr(dn(W-k)/em,tm),h=$,m=Qr(I,y,qt(S,k,W,T),1),l(Xo),r(Jr),m.start()}function y(){l(Ui),h&&h(),r(Li)}function S(W,I,B,$){var T=c(),k=W+(I-W)*q($),F=(k-T)*f;x(T+F),w&&!B&&p()&&(f*=Qp,dn(F)<Zp&&C(u(p(!0)),Jp,!1,h,!0))}function V(){m&&m.cancel()}function N(){m&&!m.isPaused()&&(V(),y())}function q(W){var I=n.easingFunc;return I?I(W):1-Math.pow(1-W,4)}return{mount:v,destroy:V,scroll:C,cancel:N}}var Hi={passive:!1,capture:!0};function im(e,t,n){var i=Zt(e),o=i.on,r=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,x=t.Controller,w=t.Elements.track,m=t.Media.reduce,h=t.Direction,f=h.resolve,v=h.orient,C=u.getPosition,y=u.exceededLimit,S,V,N,q,W,I=!1,B,$,T;function k(){l(w,xa,Ka,Hi),l(w,va,Ka,Hi),l(w,Cd,g,Hi),l(w,"click",X,{capture:!0}),l(w,"dragstart",Fn),o([si,ln],F)}function F(){var M=n.drag;b(!M),q=M==="free"}function g(M){if(B=!1,!$){var E=Fe(M);xe(M.target)&&(E||!M.button)&&(x.isBusy()?Fn(M,!0):(T=E?w:window,W=c.is([lo,Xo]),N=null,l(T,xa,O,Hi),l(T,va,P,Hi),u.cancel(),p.cancel(),te(M)))}}function O(M){if(c.is(Ir)||(c.set(Ir),r(td)),M.cancelable)if(W){u.translate(S+ee(A(M)));var E=ce(M)>hl,j=I!==(I=y());(E||j)&&te(M),B=!0,r(nd),Fn(M)}else U(M)&&(W=H(M),Fn(M))}function P(M){c.is(Ir)&&(c.set(Ui),r(id)),W&&(L(M),Fn(M)),d(T,xa,O),d(T,va,P),W=!1}function X(M){!$&&B&&Fn(M,!0)}function te(M){N=V,V=M,S=C()}function L(M){var E=de(M),j=ae(E),Ce=n.rewind&&n.rewindByDrag;m(!1),q?x.scroll(j,0,n.snap):e.is(Qo)?x.go(v(Ja(E))<0?Ce?"<":"-":Ce?">":"+"):e.is(Zi)&&I&&Ce?x.go(y(!0)?">":"<"):x.go(x.toDest(j),!0),m(!0)}function H(M){var E=n.dragMinThreshold,j=Mo(E),Ce=j&&E.mouse||0,Q=(j?E.touch:+E)||10;return dn(A(M))>(Fe(M)?Q:Ce)}function U(M){return dn(A(M))>dn(A(M,!0))}function de(M){if(e.is(uo)||!I){var E=ce(M);if(E&&E<hl)return A(M)/E}return 0}function ae(M){return C()+Ja(M)*ii(dn(M)*(n.flickPower||600),q?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function A(M,E){return re(M,E)-re(z(M),E)}function ce(M){return Za(M)-Za(z(M))}function z(M){return V===M&&N||V}function re(M,E){return(Fe(M)?M.changedTouches[0]:M)["page"+f(E?"Y":"X")]}function ee(M){return M/(I&&e.is(Zi)?Np:1)}function xe(M){var E=n.noDrag;return!ko(M,"."+xd+", ."+ra)&&(!E||!ko(M,E))}function Fe(M){return typeof TouchEvent<"u"&&M instanceof TouchEvent}function ye(){return W}function b(M){$=M}return{mount:k,disable:b,isDragging:ye}}var om={Spacebar:" ",Right:na,Left:ta,Up:ud,Down:pd};function Ds(e){return e=ni(e)?e:e.key,om[e]||e}var fl="keydown";function rm(e,t,n){var i=Zt(e),o=i.on,r=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function x(){w(),o(ln,m),o(ln,w),o(Bn,f)}function w(){var C=n.keyboard;C&&(u=C==="global"?window:d,r(u,fl,v))}function m(){l(u,fl)}function h(C){p=C}function f(){var C=p;p=!0,zc(function(){p=C})}function v(C){if(!p){var y=Ds(C);y===c(ta)?e.go("<"):y===c(na)&&e.go(">")}}return{mount:x,destroy:m,disable:h}}var Lo=Rs+"-lazy",Pr=Lo+"-srcset",am="["+Lo+"], ["+Pr+"]";function sm(e,t,n){var i=Zt(e),o=i.on,r=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[co,Li],p=[];function x(){n.lazyLoad&&(w(),o(en,w))}function w(){On(p),m(),c?C():(r(u),o(u,h),h())}function m(){t.Slides.forEach(function(y){Is(y.slide,am).forEach(function(S){var V=Sn(S,Lo),N=Sn(S,Pr);if(V!==S.src||N!==S.srcset){var q=n.classes.spinner,W=S.parentElement,I=Ko(W,"."+q)||Gi("span",q,W);p.push([S,y,I]),S.src||_o(S,"none")}})})}function h(){p=p.filter(function(y){var S=n.perPage*((n.preloadPages||1)+1)-1;return y[1].isWithin(e.index,S)?f(y):!0}),p.length||r(u)}function f(y){var S=y[0];En(y[1].slide,ns),l(S,"load error",qt(v,y)),$t(S,"src",Sn(S,Lo)),$t(S,"srcset",Sn(S,Pr)),Mn(S,Lo),Mn(S,Pr)}function v(y,S){var V=y[0],N=y[1];Nn(N.slide,ns),S.type!=="error"&&(Ti(y[2]),_o(V,""),d(Fs,V,N),d(Ki)),c&&C()}function C(){p.length&&f(p.shift())}return{mount:x,destroy:qt(On,p),check:h}}function lm(e,t,n){var i=Zt(e),o=i.on,r=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,x=u.getIndex,w=u.go,m=t.Direction.resolve,h=c.pagination,f=[],v,C;function y(){S(),o([ln,en,Hr],y);var $=n.pagination;h&&_o(h,$?"":"none"),$&&(o([Bn,Jr,Li],B),V(),B(),r(ad,{list:v,items:f},I(e.index)))}function S(){v&&(Ti(h?ai(v.children):v),Nn(v,C),On(f),v=null),i.destroy()}function V(){var $=e.length,T=n.classes,k=n.i18n,F=n.perPage,g=p()?u.getEnd()+1:No($/F);v=h||Gi("ul",T.pagination,c.track.parentElement),En(v,C=aa+"--"+W()),$t(v,Wn,"tablist"),$t(v,yn,k.select),$t(v,Ns,W()===ia?"vertical":"");for(var O=0;O<g;O++){var P=Gi("li",null,v),X=Gi("button",{class:T.page,type:"button"},P),te=d.getIn(O).map(function(H){return H.slide.id}),L=!p()&&F>1?k.pageX:k.slideX;l(X,"click",qt(N,O)),n.paginationKeyboard&&l(X,"keydown",qt(q,O)),$t(P,Wn,"presentation"),$t(X,Wn,"tab"),$t(X,Jo,te.join(" ")),$t(X,yn,Qa(L,O+1)),$t(X,Xi,-1),f.push({li:P,button:X,page:O})}}function N($){w(">"+$,!0)}function q($,T){var k=f.length,F=Ds(T),g=W(),O=-1;F===m(na,!1,g)?O=++$%k:F===m(ta,!1,g)?O=(--$+k)%k:F==="Home"?O=0:F==="End"&&(O=k-1);var P=f[O];P&&(Xc(P.button),w(">"+O),Fn(T,!0))}function W(){return n.paginationDirection||n.direction}function I($){return f[u.toPage($)]}function B(){var $=I(x(!0)),T=I(x());if($){var k=$.button;Nn(k,Ii),Mn(k,dl),$t(k,Xi,-1)}if(T){var F=T.button;En(F,Ii),$t(F,dl,!0),$t(F,Xi,"")}r(sd,{list:v,items:f},$,T)}return{items:f,mount:y,destroy:S,getAt:I,update:B}}var cm=[" ","Enter"];function dm(e,t,n){var i=n.isNavigation,o=n.slideFocus,r=[];function l(){e.splides.forEach(function(h){h.isParent||(u(e,h.splide),u(h.splide,e))}),i&&p()}function d(){r.forEach(function(h){h.destroy()}),On(r)}function c(){d(),l()}function u(h,f){var v=Zt(h);v.on(Bn,function(C,y,S){f.go(f.is(uo)?S:C)}),r.push(v)}function p(){var h=Zt(e),f=h.on;f(Ps,w),f(cd,m),f([si,ln],x),r.push(h),h.emit(Ms,e.splides)}function x(){$t(t.Elements.list,Ns,n.direction===ia?"vertical":"")}function w(h){e.go(h.index)}function m(h,f){$s(cm,Ds(f))&&(w(h),Fn(f))}return{setup:qt(t.Media.set,{slideFocus:Yo(o)?i:o},!0),mount:l,destroy:d,remount:c}}function um(e,t,n){var i=Zt(e),o=i.bind,r=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,Hi)}function d(u){if(u.cancelable){var p=u.deltaY,x=p<0,w=Za(u),m=n.wheelMinThreshold||0,h=n.wheelSleep||0;dn(p)>m&&w-r>h&&(e.go(x?"<":">"),r=w),c(x)&&Fn(u)}}function c(u){return!n.releaseWheel||e.state.is(lo)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var pm=90;function mm(e,t,n){var i=Zt(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,d=Gi("span",Mp),c=Qr(pm,qt(p,!1));function u(){l&&(w(!t.Autoplay.isPaused()),$t(r,ml,!0),d.textContent="…",o(ks,qt(w,!0)),o(As,qt(w,!1)),o([co,Li],qt(p,!0)))}function p(m){$t(r,pl,m),m?(Uo(r,d),c.start()):(Ti(d),c.cancel())}function x(){Mn(r,[ul,ml,pl]),Ti(d)}function w(m){l&&$t(r,ul,m?"off":"polite")}return{mount:u,disable:w,destroy:x}}var gm=Object.freeze({__proto__:null,Media:Sp,Direction:Cp,Elements:Wp,Slides:Dp,Layout:Op,Clones:zp,Move:jp,Controller:Vp,Arrows:Yp,Autoplay:Up,Cover:Kp,Scroll:nm,Drag:im,Keyboard:rm,LazyLoad:sm,Pagination:lm,Sync:dm,Wheel:um,Live:mm}),hm={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"},fm={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:Fp,i18n:hm,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function ym(e,t,n){var i=t.Slides;function o(){Zt(e).on([si,en],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),zc(c)}return{mount:o,start:l,cancel:Ka}}function xm(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,d=qt(wn,l,"transition"),c;function u(){Zt(e).bind(l,"transitionend",function(m){m.target===l&&c&&(x(),c())})}function p(m,h){var f=i.toPosition(m,!0),v=i.getPosition(),C=w(m);dn(f-v)>=1&&C>=1?n.useScroll?r.scroll(f,C,!1,h):(d("transform "+C+"ms "+n.easing),i.translate(f,!0),c=h):(i.jump(m),h())}function x(){d(""),r.cancel()}function w(m){var h=n.rewindSpeed;if(e.is(Zi)&&h){var f=o.getIndex(!0),v=o.getEnd();if(f===0&&m>=v||f>=v&&m===0)return h}return n.speed}return{mount:u,start:p,cancel:x}}var vm=(function(){function e(n,i){this.event=Zt(),this.Components={},this.state=bp(Bi),this.splides=[],this._o={},this._E={};var o=ni(n)?qc(document,n):n;Ro(o,o+" is invalid."),this.root=o,i=qn({label:Sn(o,yn)||"",labelledby:Sn(o,_s)||""},fm,e.defaults,i||{});try{qn(i,JSON.parse(Sn(o,Rs)))}catch{Ro(!1,"Invalid JSON")}this._o=Object.create(qn({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,d=this.Components;Ro(l.is([Bi,_r]),"Already mounted!"),l.set(Bi),this._C=d,this._T=o||this._T||(this.is(Qo)?ym:xm),this._E=i||this._E;var c=Fo({},gm,this._E,{Transition:this._T});return Ci(c,function(u,p){var x=u(r,d,r._o);d[p]=x,x.setup&&x.setup()}),Ci(d,function(u){u.mount&&u.mount()}),this.emit(si),En(this.root,kp),l.set(Ui),this.emit(es),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Ui)&&(this._C.Sync.remount(),i.Components.Sync.remount()),this},t.go=function(i){return this._C.Controller.go(i),this},t.on=function(i,o){return this.event.on(i,o),this},t.off=function(i){return this.event.off(i),this},t.emit=function(i){var o;return(o=this.event).emit.apply(o,[i].concat(ai(arguments,1))),this},t.add=function(i,o){return this._C.Slides.add(i,o),this},t.remove=function(i){return this._C.Slides.remove(i),this},t.is=function(i){return this._o.type===i},t.refresh=function(){return this.emit(en),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,r=this.state;return r.is(Bi)?Zt(this).on(es,this.destroy.bind(this,i)):(Ci(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(Es),o.destroy(),i&&On(this.splides),r.set(_r)),this},hp(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})(),Os=vm;Os.defaults={};Os.STATES=yp;var yl=[[si,"onMounted"],[es,"onReady"],[Bn,"onMove"],[co,"onMoved"],[Ps,"onClick"],[Zc,"onActive"],[Jc,"onInactive"],[Qc,"onVisible"],[ed,"onHidden"],[en,"onRefresh"],[ln,"onUpdated"],[Ki,"onResize"],[Zr,"onResized"],[td,"onDrag"],[nd,"onDragging"],[id,"onDragged"],[Jr,"onScroll"],[Li,"onScrolled"],[Es,"onDestroy"],[od,"onArrowsMounted"],[rd,"onArrowsUpdated"],[ad,"onPaginationMounted"],[sd,"onPaginationUpdated"],[Ms,"onNavigationMounted"],[ks,"onAutoplayPlay"],[ld,"onAutoplayPlaying"],[As,"onAutoplayPause"],[Fs,"onLazyLoadLoaded"]];function Bs(...e){return e.filter(Boolean).join(" ")}function Dr(e){return e!==null&&typeof e=="object"}function is(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!is(n,t[i]));if(Dr(e)&&Dr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!is(e[o],t[o]))}return e===t}function bm(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function wm(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 os(e,t){const n=e;return wm(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Dr(i)?n[o]=os(Dr(n[o])?n[o]:{},i):n[o]=i}),n}var Sm=({children:e,className:t,...n})=>s.createElement("div",{className:Bs("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),zs=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 Os(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=os({},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&&!is(this.options,e)&&(this.splide.options=e,this.options=os({},e));const t=this.getSlides();bm(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){yl.forEach(([t,n])=>{const i=this.props[n];typeof i=="function"&&e.on(t,(...o)=>{i(e,...o)})})}omit(e,t){return t.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}),e}render(){const{className:e,tag:t="div",hasTrack:n=!0,children:i,...o}=this.props;return s.createElement(t,{className:Bs("splide",e),ref:this.splideRef,...this.omit(o,["options",...yl.map(r=>r[1])])},n?s.createElement(Sm,null,i):i)}},js=({children:e,className:t,...n})=>s.createElement("li",{className:Bs("splide__slide",t),...n},e);/*!
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),pt=require("classnames"),D=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),zn=require("react-dom");function Tu(e){return e.type==="object"&&e.version===1}const Iu="ControlSlider-module__wrapper___sHEkd",Ru="ControlSlider-module__hoverArrow___A-dOH",Lu="ControlSlider-module__sliderItem___QQSkR",Pu="ControlSlider-module__sliderImage___9hRl-",Eu="ControlSlider-module__arrow___05ghY",Mu="ControlSlider-module__arrowVertical___tBfVN",ku="ControlSlider-module__nextArrow___-30Yc",Au="ControlSlider-module__arrowInner___aEra3",Fu="ControlSlider-module__arrowIcon___S4ztF",_u="ControlSlider-module__arrowImg___2dwJW",Nu="ControlSlider-module__mirror___brd6U",Wu="ControlSlider-module__pagination___bicLF",Hu="ControlSlider-module__paginationInner___bT-P-",Du="ControlSlider-module__paginationVertical___zYqKw",Ou="ControlSlider-module__paginationItem___nTRbk",Bu="ControlSlider-module__dot___p1Qun",zu="ControlSlider-module__activeDot___LHFaj",ju="ControlSlider-module__paginationInsideBottom___R3FWn",Vu="ControlSlider-module__paginationInsideTop___V-qb-",Gu="ControlSlider-module__paginationOutsideBottom___14w8D",Xu="ControlSlider-module__paginationOutsideTop___SCLqB",Yu="ControlSlider-module__paginationInsideLeft___yOBRZ",qu="ControlSlider-module__paginationInsideRight___Rtt3o",Uu="ControlSlider-module__paginationOutsideLeft___lahaw",Ku="ControlSlider-module__paginationOutsideRight___EtuQa",Zu="ControlSlider-module__imgWrapper___UjEgB",Ju="ControlSlider-module__captionBlock___dJ6-j",Qu="ControlSlider-module__captionTextWrapper___HFlpf",ep="ControlSlider-module__captionText___uGBVc",tp="ControlSlider-module__active___WZK4G",np="ControlSlider-module__withPointerEvents___t-18M",ip="ControlSlider-module__topLeftAlignment___zjnGM",op="ControlSlider-module__topCenterAlignment___gD1xW",rp="ControlSlider-module__topRightAlignment___NMapS",ap="ControlSlider-module__middleLeftAlignment___OnUrY",sp="ControlSlider-module__middleCenterAlignment___Tdkl0",lp="ControlSlider-module__middleRightAlignment___wEbfX",cp="ControlSlider-module__bottomLeftAlignment___cTP2-",dp="ControlSlider-module__bottomCenterAlignment___c54fB",up="ControlSlider-module__bottomRightAlignment___kEwrz",pp="ControlSlider-module__clickOverlay___DZA28",mp="ControlSlider-module__contain___pLyq7",gp="ControlSlider-module__cover___KdDat",ut={wrapper:Iu,hoverArrow:Ru,sliderItem:Lu,sliderImage:Pu,arrow:Eu,arrowVertical:Mu,nextArrow:ku,arrowInner:Au,arrowIcon:Fu,arrowImg:_u,mirror:Nu,pagination:Wu,paginationInner:Hu,paginationVertical:Du,paginationItem:Ou,dot:Bu,activeDot:zu,paginationInsideBottom:ju,paginationInsideTop:Vu,paginationOutsideBottom:Gu,paginationOutsideTop:Xu,paginationInsideLeft:Yu,paginationInsideRight:qu,paginationOutsideLeft:Uu,paginationOutsideRight:Ku,imgWrapper:Zu,captionBlock:Ju,captionTextWrapper:Qu,captionText:ep,active:tp,withPointerEvents:np,topLeftAlignment:ip,topCenterAlignment:op,topRightAlignment:rp,middleLeftAlignment:ap,middleCenterAlignment:sp,middleRightAlignment:lp,bottomLeftAlignment:cp,bottomCenterAlignment:dp,bottomRightAlignment:up,clickOverlay:pp,contain:mp,cover:gp};function hp(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 fp(e,t,n){return t&&hp(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var ol="(prefers-reduced-motion: reduce)",Bi=1,yp=2,Ui=3,lo=4,Xo=5,Ir=6,_r=7,xp={CREATED:Bi,MOUNTED:yp,IDLE:Ui,MOVING:lo,SCROLLING:Xo,DRAGGING:Ir,DESTROYED:_r};function On(e){e.length=0}function ai(e,t,n){return Array.prototype.slice.call(e,t,n)}function Xt(e){return e.bind.apply(e,[null].concat(ai(arguments,1)))}var jc=setTimeout,Ka=function(){};function rl(e){return requestAnimationFrame(e)}function Kr(e,t){return typeof t===e}function Mo(e){return!Cs(e)&&Kr("object",e)}var Ss=Array.isArray,Vc=Xt(Kr,"function"),ni=Xt(Kr,"string"),Yo=Xt(Kr,"undefined");function Cs(e){return e===null}function Gc(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function qo(e){return Ss(e)?e:[e]}function vn(e,t){qo(e).forEach(t)}function $s(e,t){return e.indexOf(t)>-1}function Rr(e,t){return e.push.apply(e,qo(t)),e}function _n(e,t,n){e&&vn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function En(e,t){_n(e,ni(t)?t.split(" "):t,!0)}function Uo(e,t){vn(t,e.appendChild.bind(e))}function Ts(e,t){vn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function ko(e,t){return Gc(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Xc(e,t){var n=e?ai(e.children):[];return t?n.filter(function(i){return ko(i,t)}):n}function Ko(e,t){return t?Xc(e,t)[0]:e.firstElementChild}var Ao=Object.keys;function Ci(e,t,n){return e&&(n?Ao(e).reverse():Ao(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function Fo(e){return ai(arguments,1).forEach(function(t){Ci(t,function(n,i){e[i]=t[i]})}),e}function qn(e){return ai(arguments,1).forEach(function(t){Ci(t,function(n,i){Ss(n)?e[i]=n.slice():Mo(n)?e[i]=qn({},Mo(e[i])?e[i]:{},n):e[i]=n})}),e}function al(e,t){vn(t||Ao(e),function(n){delete e[n]})}function Mn(e,t){vn(e,function(n){vn(t,function(i){n&&n.removeAttribute(i)})})}function $t(e,t,n){Mo(t)?Ci(t,function(i,o){$t(e,o,i)}):vn(e,function(i){Cs(n)||n===""?Mn(i,t):i.setAttribute(t,String(n))})}function Gi(e,t,n){var i=document.createElement(e);return t&&(ni(t)?En(i,t):$t(i,t)),n&&Uo(n,i),i}function wn(e,t,n){if(Yo(n))return getComputedStyle(e)[t];Cs(n)||(e.style[t]=""+n)}function _o(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 sl(e,t){return e&&e.classList.contains(t)}function hn(e){return e.getBoundingClientRect()}function Ti(e){vn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function qc(e){return Ko(new DOMParser().parseFromString(e,"text/html").body)}function Fn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Uc(e,t){return e&&e.querySelector(t)}function Is(e,t){return t?ai(e.querySelectorAll(t)):[]}function Nn(e,t){_n(e,t,!1)}function Za(e){return e.timeStamp}function pi(e){return ni(e)?e:e?e+"px":""}var Zo="splide",Rs="data-"+Zo;function Ro(e,t){if(!e)throw new Error("["+Zo+"] "+(t||""))}var ii=Math.min,Nr=Math.max,Wr=Math.floor,No=Math.ceil,dn=Math.abs;function Kc(e,t,n){return dn(e-t)<n}function Lr(e,t,n,i){var o=ii(t,n),r=Nr(t,n);return i?o<e&&e<r:o<=e&&e<=r}function Wi(e,t,n){var i=ii(t,n),o=Nr(t,n);return ii(Nr(i,e),o)}function Ja(e){return+(e>0)-+(e<0)}function Qa(e,t){return vn(t,function(n){e=e.replace("%s",""+n)}),e}function Ls(e){return e<10?"0"+e:""+e}var ll={};function vp(e){return""+e+Ls(ll[e]=(ll[e]||0)+1)}function Zc(){var e=[];function t(l,d,c,u){o(l,d,function(p,x,w){var m="addEventListener"in p,h=m?p.removeEventListener.bind(p,x,c,u):p.removeListener.bind(p,c);m?p.addEventListener(x,c,u):p.addListener(c),e.push([p,x,w,c,h])})}function n(l,d,c){o(l,d,function(u,p,x){e=e.filter(function(w){return w[0]===u&&w[1]===p&&w[2]===x&&(!c||w[3]===c)?(w[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){vn(l,function(u){u&&vn(d,function(p){p.split(" ").forEach(function(x){var w=x.split(".");c(u,w[0],w[1])})})})}function r(){e.forEach(function(l){l[4]()}),On(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var si="mounted",es="ready",Bn="move",co="moved",Ps="click",Jc="active",Qc="inactive",ed="visible",td="hidden",en="refresh",ln="updated",Ki="resize",Zr="resized",nd="drag",id="dragging",od="dragged",Jr="scroll",Li="scrolled",bp="overflow",Es="destroy",rd="arrows:mounted",ad="arrows:updated",sd="pagination:mounted",ld="pagination:updated",Ms="navigation:mounted",ks="autoplay:play",cd="autoplay:playing",As="autoplay:pause",Fs="lazyload:loaded",dd="sk",ud="sh",Hr="ei";function Kt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Zc();function i(r,l){n.bind(t,qo(r).join(" "),function(d){l.apply(l,Ss(d.detail)?d.detail:[])})}function o(r){n.dispatch(t,r,ai(arguments,1))}return e&&e.event.on(Es,n.destroy),Fo(n,{bus:t,on:i,off:Xt(n.unbind,t),emit:o})}function Qr(e,t,n,i){var o=Date.now,r,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?ii((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return w();d=rl(p)}}function x(C){C||h(),r=o()-(C?l*e:0),c=!1,d=rl(p)}function w(){c=!0}function m(){r=o(),l=0,n&&n(l)}function h(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function f(C){e=C}function v(){return c}return{start:x,rewind:m,pause:w,cancel:h,set:f,isPaused:v}}function wp(e){var t=e;function n(o){t=o}function i(o){return $s(qo(o),t)}return{set:n,is:i}}function Sp(e,t){var n=Qr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Cp(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=Zc(),d=[];function c(){var h=n.mediaQuery==="min";Ao(o).sort(function(f,v){return h?+f-+v:+v-+f}).forEach(function(f){p(o[f],"("+(h?"min":"max")+"-width:"+f+"px)")}),p(r,ol),x()}function u(h){h&&l.destroy()}function p(h,f){var v=matchMedia(f);l.bind(v,"change",x),d.push([h,v])}function x(){var h=i.is(_r),f=n.direction,v=d.reduce(function(C,y){return qn(C,y[1].matches?y[0]:{})},{});al(n),m(v),n.destroy?e.destroy(n.destroy==="completely"):h?(u(!0),e.mount()):f!==n.direction&&e.refresh()}function w(h){matchMedia(ol).matches&&(h?qn(n,r):al(n,Ao(r)))}function m(h,f,v){qn(n,h),f&&qn(Object.getPrototypeOf(n),h),(v||!i.is(Bi))&&e.emit(ln,n)}return{setup:c,destroy:u,reduce:w,set:m}}var ea="Arrow",ta=ea+"Left",na=ea+"Right",pd=ea+"Up",md=ea+"Down",cl="rtl",ia="ttb",fa={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[pd,na],ArrowRight:[md,ta]};function $p(e,t,n){function i(r,l,d){d=d||n.direction;var c=d===cl&&!l?1:d===ia?0:-1;return fa[r]&&fa[r][c]||r.replace(/width|left|right/i,function(u,p){var x=fa[u.toLowerCase()][c]||u;return p>0?x.charAt(0).toUpperCase()+x.slice(1):x})}function o(r){return r*(n.direction===cl?1:-1)}return{resolve:i,orient:o}}var Wn="role",Xi="tabindex",Tp="disabled",Cn="aria-",Jo=Cn+"controls",gd=Cn+"current",dl=Cn+"selected",yn=Cn+"label",_s=Cn+"labelledby",hd=Cn+"hidden",Ns=Cn+"orientation",Wo=Cn+"roledescription",ul=Cn+"live",pl=Cn+"busy",ml=Cn+"atomic",Ws=[Wn,Xi,Tp,Jo,gd,yn,_s,hd,Ns,Wo],kn=Zo+"__",li="is-",ya=Zo,gl=kn+"track",Ip=kn+"list",oa=kn+"slide",fd=oa+"--clone",Rp=oa+"__container",Hs=kn+"arrows",ra=kn+"arrow",yd=ra+"--prev",xd=ra+"--next",aa=kn+"pagination",vd=aa+"__page",Lp=kn+"progress",Pp=Lp+"__bar",Ep=kn+"toggle",Mp=kn+"spinner",kp=kn+"sr",Ap=li+"initialized",Ii=li+"active",bd=li+"prev",wd=li+"next",ts=li+"visible",ns=li+"loading",Sd=li+"focus-in",Cd=li+"overflow",Fp=[Ii,ts,bd,wd,ns,Sd,Cd],_p={slide:oa,clone:fd,arrows:Hs,arrow:ra,prev:yd,next:xd,pagination:aa,page:vd,spinner:Mp};function Np(e,t){if(Vc(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!ko(n,t);)n=n.parentElement;return n}var Wp=5,hl=200,$d="touchstart mousedown",xa="touchmove mousemove",va="touchend touchcancel mouseup click";function Hp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],x=[],w,m,h;function f(){S(),G(),y()}function v(){o(en,C),o(en,f),o(ln,y),r(document,$d+" keydown",function(H){h=H.type==="keydown"},{capture:!0}),r(l,"focusin",function(){_n(l,Sd,!!h)})}function C(H){var I=Ws.concat("style");On(u),Nn(l,p),Nn(w,x),Mn([w,m],I),Mn(l,H?I:["style",Wo])}function y(){Nn(l,p),Nn(w,x),p=U(ya),x=U(gl),En(l,p),En(w,x),$t(l,yn,n.label),$t(l,_s,n.labelledby)}function S(){w=W("."+gl),m=Ko(w,"."+Ip),Ro(w&&m,"A track/list element is missing."),Rr(u,Xc(m,"."+oa+":not(."+fd+")")),Ci({arrows:Hs,pagination:aa,prev:yd,next:xd,bar:Pp,toggle:Ep},function(H,I){c[I]=W("."+H)}),Fo(c,{root:l,track:w,list:m,slides:u})}function G(){var H=l.id||vp(Zo),I=n.role;l.id=H,w.id=w.id||H+"-track",m.id=m.id||H+"-list",!Sn(l,Wn)&&l.tagName!=="SECTION"&&I&&$t(l,Wn,I),$t(l,Wo,d.carousel),$t(m,Wn,"presentation")}function W(H){var I=Uc(l,H);return I&&Np(I,"."+ya)===l?I:void 0}function U(H){return[H+"--"+n.type,H+"--"+n.direction,n.drag&&H+"--draggable",n.isNavigation&&H+"--nav",H===ya&&Ii]}return Fo(c,{setup:f,mount:v,destroy:C})}var Zi="slide",uo="loop",Qo="fade";function Dp(e,t,n,i){var o=Kt(e),r=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,x=p.isNavigation,w=p.updateOnMove,m=p.i18n,h=p.pagination,f=p.slideFocus,v=c.Direction.resolve,C=Sn(i,"style"),y=Sn(i,yn),S=n>-1,G=Ko(i,"."+Rp),W;function U(){S||(i.id=u.id+"-slide"+Ls(t+1),$t(i,Wn,h?"tabpanel":"group"),$t(i,Wo,m.slide),$t(i,yn,y||Qa(m.slideLabel,[t+1,e.length]))),H()}function H(){d(i,"click",Xt(l,Ps,ie)),d(i,"keydown",Xt(l,dd,ie)),r([co,ud,Li],T),r(Ms,z),w&&r(Bn,$)}function I(){W=!0,o.destroy(),Nn(i,Fp),Mn(i,Ws),$t(i,"style",C),$t(i,yn,y||"")}function z(){var L=e.splides.map(function(O){var K=O.splide.Components.Slides.getAt(t);return K?K.slide.id:""}).join(" ");$t(i,yn,Qa(m.slideX,(S?n:t)+1)),$t(i,Jo,L),$t(i,Wn,f?"button":""),f&&Mn(i,Wo)}function $(){W||T()}function T(){if(!W){var L=e.index;A(),_(),_n(i,bd,t===L-1),_n(i,wd,t===L+1)}}function A(){var L=B();L!==sl(i,Ii)&&(_n(i,Ii,L),$t(i,gd,x&&L||""),l(L?Jc:Qc,ie))}function _(){var L=P(),O=!L&&(!B()||S);if(e.state.is([lo,Xo])||$t(i,hd,O||""),$t(Is(i,p.focusableNodes||""),Xi,O?-1:""),f&&$t(i,Xi,O?-1:0),L!==sl(i,ts)&&(_n(i,ts,L),l(L?ed:td,ie)),!L&&document.activeElement===i){var K=c.Slides.getAt(e.index);K&&Yc(K.slide)}}function g(L,O,K){wn(K&&G||i,L,O)}function B(){var L=e.index;return L===t||p.cloneStatus&&L===n}function P(){if(e.is(Qo))return B();var L=hn(c.Elements.track),O=hn(i),K=v("left",!0),ue=v("right",!0);return Wr(L[K])<=No(O[K])&&Wr(O[ue])<=No(L[ue])}function Y(L,O){var K=dn(L-t);return!S&&(p.rewind||e.is(uo))&&(K=ii(K,e.length-K)),K<=O}var ie={index:t,slideIndex:n,slide:i,container:G,isClone:S,mount:U,destroy:I,update:T,style:g,isWithin:Y};return ie}function Op(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function x(){w(),o(en,m),o(en,w)}function w(){c.forEach(function(T,A){f(T,A,-1)})}function m(){W(function(T){T.destroy()}),On(p)}function h(){W(function(T){T.update()})}function f(T,A,_){var g=Dp(e,A,_,T);g.mount(),p.push(g),p.sort(function(B,P){return B.index-P.index})}function v(T){return T?U(function(A){return!A.isClone}):p}function C(T){var A=t.Controller,_=A.toIndex(T),g=A.hasFocus()?1:n.perPage;return U(function(B){return Lr(B.index,_,_+g-1)})}function y(T){return U(T)[0]}function S(T,A){vn(T,function(_){if(ni(_)&&(_=qc(_)),Gc(_)){var g=c[A];g?Ts(_,g):Uo(u,_),En(_,n.classes.slide),I(_,Xt(r,Ki))}}),r(en)}function G(T){Ti(U(T).map(function(A){return A.slide})),r(en)}function W(T,A){v(A).forEach(T)}function U(T){return p.filter(Vc(T)?T:function(A){return ni(T)?ko(A.slide,T):$s(qo(T),A.index)})}function H(T,A,_){W(function(g){g.style(T,A,_)})}function I(T,A){var _=Is(T,"img"),g=_.length;g?_.forEach(function(B){l(B,"load error",function(){--g||A()})}):A()}function z(T){return T?c.length:p.length}function $(){return p.length>n.perPage}return{mount:x,destroy:m,update:h,register:f,get:v,getIn:C,getAt:y,add:S,remove:G,forEach:W,filter:U,style:H,getLength:z,isEnough:$}}function Bp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,x=u.track,w=u.list,m=d.getAt,h=d.style,f,v,C;function y(){S(),r(window,"resize load",Sp(Xt(l,Ki))),o([ln,en],S),o(Ki,G)}function S(){f=n.direction===ia,wn(p,"maxWidth",pi(n.width)),wn(x,c("paddingLeft"),W(!1)),wn(x,c("paddingRight"),W(!0)),G(!0)}function G(ie){var L=hn(p);(ie||v.width!==L.width||v.height!==L.height)&&(wn(x,"height",U()),h(c("marginRight"),pi(n.gap)),h("width",I()),h("height",z(),!0),v=L,l(Zr),C!==(C=Y())&&(_n(p,Cd,C),l(bp,C)))}function W(ie){var L=n.padding,O=c(ie?"right":"left");return L&&pi(L[O]||(Mo(L)?0:L))||"0px"}function U(){var ie="";return f&&(ie=H(),Ro(ie,"height or heightRatio is missing."),ie="calc("+ie+" - "+W(!1)+" - "+W(!0)+")"),ie}function H(){return pi(n.height||hn(w).width*n.heightRatio)}function I(){return n.autoWidth?null:pi(n.fixedWidth)||(f?"":$())}function z(){return pi(n.fixedHeight)||(f?n.autoHeight?null:$():H())}function $(){var ie=pi(n.gap);return"calc((100%"+(ie&&" + "+ie)+")/"+(n.perPage||1)+(ie&&" - "+ie)+")"}function T(){return hn(w)[c("width")]}function A(ie,L){var O=m(ie||0);return O?hn(O.slide)[c("width")]+(L?0:B()):0}function _(ie,L){var O=m(ie);if(O){var K=hn(O.slide)[c("right")],ue=hn(w)[c("left")];return dn(K-ue)+(L?0:B())}return 0}function g(ie){return _(e.length-1)-_(0)+A(0,ie)}function B(){var ie=m(0);return ie&&parseFloat(wn(ie.slide,c("marginRight")))||0}function P(ie){return parseFloat(wn(x,c("padding"+(ie?"Right":"Left"))))||0}function Y(){return e.is(Qo)||g(!0)>T()}return{mount:y,resize:G,listSize:T,slideSize:A,sliderSize:g,totalSize:_,getPadding:P,isOverflow:Y}}var zp=2;function jp(e,t,n){var i=Kt(e),o=i.on,r=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(en,x),o([ln,Ki],m),(u=v())&&(h(u),t.Layout.resize(!0))}function x(){w(),p()}function w(){Ti(c),On(c),i.destroy()}function m(){var C=v();u!==C&&(u<C||!C)&&i.emit(en)}function h(C){var y=l.get().slice(),S=y.length;if(S){for(;y.length<C;)Rr(y,y);Rr(y.slice(-C),y.slice(0,C)).forEach(function(G,W){var U=W<C,H=f(G.slide,W);U?Ts(H,y[0].slide):Uo(r.list,H),Rr(c,H),l.register(H,W-C+(U?0:S),G.index)})}}function f(C,y){var S=C.cloneNode(!0);return En(S,n.classes.clone),S.id=e.root.id+"-clone"+Ls(y+1),S}function v(){var C=n.clones;if(!e.is(uo))C=0;else if(Yo(C)){var y=n[d("fixedWidth")]&&t.Layout.slideSize(0),S=y&&No(hn(r.track)[d("width")]/y);C=S||n[d("autoWidth")]&&e.length||n.perPage*zp}return C}return{mount:p,destroy:w}}function Vp(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,x=d.listSize,w=d.sliderSize,m=t.Direction,h=m.resolve,f=m.orient,v=t.Elements,C=v.list,y=v.track,S;function G(){S=t.Transition,o([si,Zr,ln,en],W)}function W(){t.Controller.isBusy()||(t.Scroll.cancel(),H(e.index),t.Slides.update())}function U(O,K,ue,le){O!==K&&ie(O>ue)&&(T(),I($(g(),O>ue),!0)),l(lo),r(Bn,K,ue,O),S.start(K,function(){l(Ui),r(co,K,ue,O),le&&le()})}function H(O){I(_(O,!0))}function I(O,K){if(!e.is(Qo)){var ue=K?O:z(O);wn(C,"transform","translate"+h("X")+"("+ue+"px)"),O!==ue&&r(ud)}}function z(O){if(e.is(uo)){var K=A(O),ue=K>t.Controller.getEnd(),le=K<0;(le||ue)&&(O=$(O,ue))}return O}function $(O,K){var ue=O-Y(K),le=w();return O-=f(le*(No(dn(ue)/le)||1))*(K?1:-1),O}function T(){I(g(),!0),S.cancel()}function A(O){for(var K=t.Slides.get(),ue=0,le=1/0,F=0;F<K.length;F++){var pe=K[F].index,j=dn(_(pe,!0)-O);if(j<=le)le=j,ue=pe;else break}return ue}function _(O,K){var ue=f(p(O-1)-P(O));return K?B(ue):ue}function g(){var O=h("left");return hn(C)[O]-hn(y)[O]+f(u(!1))}function B(O){return n.trimSpace&&e.is(Zi)&&(O=Wi(O,0,f(w(!0)-x()))),O}function P(O){var K=n.focus;return K==="center"?(x()-c(O,!0))/2:+K*c(O)||0}function Y(O){return _(O?t.Controller.getEnd():0,!!n.trimSpace)}function ie(O){var K=f($(g(),O));return O?K>=0:K<=C[h("scrollWidth")]-hn(y)[h("width")]}function L(O,K){K=Yo(K)?g():K;var ue=O!==!0&&f(K)<f(Y(!1)),le=O!==!1&&f(K)>f(Y(!0));return ue||le}return{mount:G,move:U,jump:H,translate:I,shift:$,cancel:T,toIndex:A,toPosition:_,getPosition:g,getLimit:Y,exceededLimit:L,reposition:W}}function Gp(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,x=p.isEnough,w=p.getLength,m=n.omitEnd,h=e.is(uo),f=e.is(Zi),v=Xt(g,!1),C=Xt(g,!0),y=n.start||0,S,G=y,W,U,H;function I(){z(),o([ln,en,Hr],z),o(Zr,$)}function z(){W=w(!0),U=n.perMove,H=n.perPage,S=ie();var j=Wi(y,0,m?S:W-1);j!==y&&(y=j,l.reposition())}function $(){S!==ie()&&r(Hr)}function T(j,se,ne){if(!pe()){var ve=_(j),Me=Y(ve);Me>-1&&(se||Me!==y)&&(ue(Me),l.move(ve,Me,G,ne))}}function A(j,se,ne,ve){t.Scroll.scroll(j,se,ne,function(){var Me=Y(l.toIndex(d()));ue(m?ii(Me,S):Me),ve&&ve()})}function _(j){var se=y;if(ni(j)){var ne=j.match(/([+\-<>])(\d+)?/)||[],ve=ne[1],Me=ne[2];ve==="+"||ve==="-"?se=B(y+ +(""+ve+(+Me||1)),y):ve===">"?se=Me?L(+Me):v(!0):ve==="<"&&(se=C(!0))}else se=h?j:Wi(j,0,S);return se}function g(j,se){var ne=U||(F()?1:H),ve=B(y+ne*(j?-1:1),y,!(U||F()));return ve===-1&&f&&!Kc(d(),c(!j),1)?j?0:S:se?ve:Y(ve)}function B(j,se,ne){if(x()||F()){var ve=P(j);ve!==j&&(se=j,j=ve,ne=!1),j<0||j>S?!U&&(Lr(0,j,se,!0)||Lr(S,se,j,!0))?j=L(O(j)):h?j=ne?j<0?-(W%H||H):W:j:n.rewind?j=j<0?S:0:j=-1:ne&&j!==se&&(j=L(O(se)+(j<se?-1:1)))}else j=-1;return j}function P(j){if(f&&n.trimSpace==="move"&&j!==y)for(var se=d();se===u(j,!0)&&Lr(j,0,e.length-1,!n.rewind);)j<y?--j:++j;return j}function Y(j){return h?(j+W)%W||0:j}function ie(){for(var j=W-(F()||h&&U?1:H);m&&j-- >0;)if(u(W-1,!0)!==u(j,!0)){j++;break}return Wi(j,0,W-1)}function L(j){return Wi(F()?j:H*j,0,S)}function O(j){return F()?ii(j,S):Wr((j>=S?W-1:j)/H)}function K(j){var se=l.toIndex(j);return f?Wi(se,0,S):se}function ue(j){j!==y&&(G=y,y=j)}function le(j){return j?G:y}function F(){return!Yo(n.focus)||n.isNavigation}function pe(){return e.state.is([lo,Xo])&&!!n.waitForTransition}return{mount:I,go:T,scroll:A,getNext:v,getPrev:C,getAdjacent:g,getEnd:ie,setIndex:ue,getIndex:le,toIndex:L,toPage:O,toDest:K,hasFocus:F,isBusy:pe}}var Xp="http://www.w3.org/2000/svg",Yp="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",sr=40;function qp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,x=u.arrows,w=u.track,m=x,h=u.prev,f=u.next,v,C,y={};function S(){W(),o(ln,G)}function G(){U(),S()}function W(){var A=n.arrows;A&&!(h&&f)&&z(),h&&f&&(Fo(y,{prev:h,next:f}),_o(m,A?"":"none"),En(m,C=Hs+"--"+n.direction),A&&(H(),T(),$t([h,f],Jo,w.id),l(rd,h,f)))}function U(){i.destroy(),Nn(m,C),v?(Ti(x?[h,f]:m),h=f=null):Mn([h,f],Ws)}function H(){o([si,co,en,Li,Hr],T),r(f,"click",Xt(I,">")),r(h,"click",Xt(I,"<"))}function I(A){p.go(A,!0)}function z(){m=x||Gi("div",d.arrows),h=$(!0),f=$(!1),v=!0,Uo(m,[h,f]),!x&&Ts(m,w)}function $(A){var _='<button class="'+d.arrow+" "+(A?d.prev:d.next)+'" type="button"><svg xmlns="'+Xp+'" viewBox="0 0 '+sr+" "+sr+'" width="'+sr+'" height="'+sr+'" focusable="false"><path d="'+(n.arrowPath||Yp)+'" />';return qc(_)}function T(){if(h&&f){var A=e.index,_=p.getPrev(),g=p.getNext(),B=_>-1&&A<_?c.last:c.prev,P=g>-1&&A>g?c.first:c.next;h.disabled=_<0,f.disabled=g<0,$t(h,yn,B),$t(f,yn,P),l(ad,h,f,_,g)}}return{arrows:y,mount:S,destroy:U,update:T}}var Up=Rs+"-interval";function Kp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=Qr(n.interval,e.go.bind(e,">"),H),c=d.isPaused,u=t.Elements,p=t.Elements,x=p.root,w=p.toggle,m=n.autoplay,h,f,v=m==="pause";function C(){m&&(y(),w&&$t(w,Jo,u.track.id),v||S(),U())}function y(){n.pauseOnHover&&r(x,"mouseenter mouseleave",function(z){h=z.type==="mouseenter",W()}),n.pauseOnFocus&&r(x,"focusin focusout",function(z){f=z.type==="focusin",W()}),w&&r(w,"click",function(){v?S():G(!0)}),o([Bn,Jr,en],d.rewind),o(Bn,I)}function S(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),f=h=v=!1,U(),l(ks))}function G(z){z===void 0&&(z=!0),v=!!z,U(),c()||(d.pause(),l(As))}function W(){v||(h||f?G(!1):S())}function U(){w&&(_n(w,Ii,!v),$t(w,yn,n.i18n[v?"play":"pause"]))}function H(z){var $=u.bar;$&&wn($,"width",z*100+"%"),l(cd,z)}function I(z){var $=t.Slides.getAt(z);d.set($&&+Sn($.slide,Up)||n.interval)}return{mount:C,destroy:d.cancel,play:S,pause:G,isPaused:c}}function Zp(e,t,n){var i=Kt(e),o=i.on;function r(){n.cover&&(o(Fs,Xt(d,!0)),o([si,ln,en],Xt(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Ko(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),_o(u,c?"none":"")}return{mount:r,destroy:Xt(l,!1)}}var Jp=10,Qp=600,em=.6,tm=1.5,nm=800;function im(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,x=d.translate,w=e.is(Zi),m,h,f=1;function v(){o(Bn,G),o([ln,en],W)}function C(H,I,z,$,T){var A=c();if(G(),z&&(!w||!p())){var _=t.Layout.sliderSize(),g=Ja(H)*_*Wr(dn(H)/_)||0;H=d.toPosition(t.Controller.toDest(H%_))+g}var B=Kc(A,H,1);f=1,I=B?0:I||Nr(dn(H-A)/tm,nm),h=$,m=Qr(I,y,Xt(S,A,H,T),1),l(Xo),r(Jr),m.start()}function y(){l(Ui),h&&h(),r(Li)}function S(H,I,z,$){var T=c(),A=H+(I-H)*U($),_=(A-T)*f;x(T+_),w&&!z&&p()&&(f*=em,dn(_)<Jp&&C(u(p(!0)),Qp,!1,h,!0))}function G(){m&&m.cancel()}function W(){m&&!m.isPaused()&&(G(),y())}function U(H){var I=n.easingFunc;return I?I(H):1-Math.pow(1-H,4)}return{mount:v,destroy:G,scroll:C,cancel:W}}var Hi={passive:!1,capture:!0};function om(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,x=t.Controller,w=t.Elements.track,m=t.Media.reduce,h=t.Direction,f=h.resolve,v=h.orient,C=u.getPosition,y=u.exceededLimit,S,G,W,U,H,I=!1,z,$,T;function A(){l(w,xa,Ka,Hi),l(w,va,Ka,Hi),l(w,$d,g,Hi),l(w,"click",Y,{capture:!0}),l(w,"dragstart",Fn),o([si,ln],_)}function _(){var M=n.drag;b(!M),U=M==="free"}function g(M){if(z=!1,!$){var E=Me(M);ve(M.target)&&(E||!M.button)&&(x.isBusy()?Fn(M,!0):(T=E?w:window,H=c.is([lo,Xo]),W=null,l(T,xa,B,Hi),l(T,va,P,Hi),u.cancel(),p.cancel(),ie(M)))}}function B(M){if(c.is(Ir)||(c.set(Ir),r(nd)),M.cancelable)if(H){u.translate(S+ne(F(M)));var E=pe(M)>hl,V=I!==(I=y());(E||V)&&ie(M),z=!0,r(id),Fn(M)}else K(M)&&(H=O(M),Fn(M))}function P(M){c.is(Ir)&&(c.set(Ui),r(od)),H&&(L(M),Fn(M)),d(T,xa,B),d(T,va,P),H=!1}function Y(M){!$&&z&&Fn(M,!0)}function ie(M){W=G,G=M,S=C()}function L(M){var E=ue(M),V=le(E),Se=n.rewind&&n.rewindByDrag;m(!1),U?x.scroll(V,0,n.snap):e.is(Qo)?x.go(v(Ja(E))<0?Se?"<":"-":Se?">":"+"):e.is(Zi)&&I&&Se?x.go(y(!0)?">":"<"):x.go(x.toDest(V),!0),m(!0)}function O(M){var E=n.dragMinThreshold,V=Mo(E),Se=V&&E.mouse||0,te=(V?E.touch:+E)||10;return dn(F(M))>(Me(M)?te:Se)}function K(M){return dn(F(M))>dn(F(M,!0))}function ue(M){if(e.is(uo)||!I){var E=pe(M);if(E&&E<hl)return F(M)/E}return 0}function le(M){return C()+Ja(M)*ii(dn(M)*(n.flickPower||600),U?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function F(M,E){return se(M,E)-se(j(M),E)}function pe(M){return Za(M)-Za(j(M))}function j(M){return G===M&&W||G}function se(M,E){return(Me(M)?M.changedTouches[0]:M)["page"+f(E?"Y":"X")]}function ne(M){return M/(I&&e.is(Zi)?Wp:1)}function ve(M){var E=n.noDrag;return!ko(M,"."+vd+", ."+ra)&&(!E||!ko(M,E))}function Me(M){return typeof TouchEvent<"u"&&M instanceof TouchEvent}function xe(){return H}function b(M){$=M}return{mount:A,disable:b,isDragging:xe}}var rm={Spacebar:" ",Right:na,Left:ta,Up:pd,Down:md};function Ds(e){return e=ni(e)?e:e.key,rm[e]||e}var fl="keydown";function am(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function x(){w(),o(ln,m),o(ln,w),o(Bn,f)}function w(){var C=n.keyboard;C&&(u=C==="global"?window:d,r(u,fl,v))}function m(){l(u,fl)}function h(C){p=C}function f(){var C=p;p=!0,jc(function(){p=C})}function v(C){if(!p){var y=Ds(C);y===c(ta)?e.go("<"):y===c(na)&&e.go(">")}}return{mount:x,destroy:m,disable:h}}var Lo=Rs+"-lazy",Pr=Lo+"-srcset",sm="["+Lo+"], ["+Pr+"]";function lm(e,t,n){var i=Kt(e),o=i.on,r=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[co,Li],p=[];function x(){n.lazyLoad&&(w(),o(en,w))}function w(){On(p),m(),c?C():(r(u),o(u,h),h())}function m(){t.Slides.forEach(function(y){Is(y.slide,sm).forEach(function(S){var G=Sn(S,Lo),W=Sn(S,Pr);if(G!==S.src||W!==S.srcset){var U=n.classes.spinner,H=S.parentElement,I=Ko(H,"."+U)||Gi("span",U,H);p.push([S,y,I]),S.src||_o(S,"none")}})})}function h(){p=p.filter(function(y){var S=n.perPage*((n.preloadPages||1)+1)-1;return y[1].isWithin(e.index,S)?f(y):!0}),p.length||r(u)}function f(y){var S=y[0];En(y[1].slide,ns),l(S,"load error",Xt(v,y)),$t(S,"src",Sn(S,Lo)),$t(S,"srcset",Sn(S,Pr)),Mn(S,Lo),Mn(S,Pr)}function v(y,S){var G=y[0],W=y[1];Nn(W.slide,ns),S.type!=="error"&&(Ti(y[2]),_o(G,""),d(Fs,G,W),d(Ki)),c&&C()}function C(){p.length&&f(p.shift())}return{mount:x,destroy:Xt(On,p),check:h}}function cm(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,x=u.getIndex,w=u.go,m=t.Direction.resolve,h=c.pagination,f=[],v,C;function y(){S(),o([ln,en,Hr],y);var $=n.pagination;h&&_o(h,$?"":"none"),$&&(o([Bn,Jr,Li],z),G(),z(),r(sd,{list:v,items:f},I(e.index)))}function S(){v&&(Ti(h?ai(v.children):v),Nn(v,C),On(f),v=null),i.destroy()}function G(){var $=e.length,T=n.classes,A=n.i18n,_=n.perPage,g=p()?u.getEnd()+1:No($/_);v=h||Gi("ul",T.pagination,c.track.parentElement),En(v,C=aa+"--"+H()),$t(v,Wn,"tablist"),$t(v,yn,A.select),$t(v,Ns,H()===ia?"vertical":"");for(var B=0;B<g;B++){var P=Gi("li",null,v),Y=Gi("button",{class:T.page,type:"button"},P),ie=d.getIn(B).map(function(O){return O.slide.id}),L=!p()&&_>1?A.pageX:A.slideX;l(Y,"click",Xt(W,B)),n.paginationKeyboard&&l(Y,"keydown",Xt(U,B)),$t(P,Wn,"presentation"),$t(Y,Wn,"tab"),$t(Y,Jo,ie.join(" ")),$t(Y,yn,Qa(L,B+1)),$t(Y,Xi,-1),f.push({li:P,button:Y,page:B})}}function W($){w(">"+$,!0)}function U($,T){var A=f.length,_=Ds(T),g=H(),B=-1;_===m(na,!1,g)?B=++$%A:_===m(ta,!1,g)?B=(--$+A)%A:_==="Home"?B=0:_==="End"&&(B=A-1);var P=f[B];P&&(Yc(P.button),w(">"+B),Fn(T,!0))}function H(){return n.paginationDirection||n.direction}function I($){return f[u.toPage($)]}function z(){var $=I(x(!0)),T=I(x());if($){var A=$.button;Nn(A,Ii),Mn(A,dl),$t(A,Xi,-1)}if(T){var _=T.button;En(_,Ii),$t(_,dl,!0),$t(_,Xi,"")}r(ld,{list:v,items:f},$,T)}return{items:f,mount:y,destroy:S,getAt:I,update:z}}var dm=[" ","Enter"];function um(e,t,n){var i=n.isNavigation,o=n.slideFocus,r=[];function l(){e.splides.forEach(function(h){h.isParent||(u(e,h.splide),u(h.splide,e))}),i&&p()}function d(){r.forEach(function(h){h.destroy()}),On(r)}function c(){d(),l()}function u(h,f){var v=Kt(h);v.on(Bn,function(C,y,S){f.go(f.is(uo)?S:C)}),r.push(v)}function p(){var h=Kt(e),f=h.on;f(Ps,w),f(dd,m),f([si,ln],x),r.push(h),h.emit(Ms,e.splides)}function x(){$t(t.Elements.list,Ns,n.direction===ia?"vertical":"")}function w(h){e.go(h.index)}function m(h,f){$s(dm,Ds(f))&&(w(h),Fn(f))}return{setup:Xt(t.Media.set,{slideFocus:Yo(o)?i:o},!0),mount:l,destroy:d,remount:c}}function pm(e,t,n){var i=Kt(e),o=i.bind,r=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,Hi)}function d(u){if(u.cancelable){var p=u.deltaY,x=p<0,w=Za(u),m=n.wheelMinThreshold||0,h=n.wheelSleep||0;dn(p)>m&&w-r>h&&(e.go(x?"<":">"),r=w),c(x)&&Fn(u)}}function c(u){return!n.releaseWheel||e.state.is(lo)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var mm=90;function gm(e,t,n){var i=Kt(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,d=Gi("span",kp),c=Qr(mm,Xt(p,!1));function u(){l&&(w(!t.Autoplay.isPaused()),$t(r,ml,!0),d.textContent="…",o(ks,Xt(w,!0)),o(As,Xt(w,!1)),o([co,Li],Xt(p,!0)))}function p(m){$t(r,pl,m),m?(Uo(r,d),c.start()):(Ti(d),c.cancel())}function x(){Mn(r,[ul,ml,pl]),Ti(d)}function w(m){l&&$t(r,ul,m?"off":"polite")}return{mount:u,disable:w,destroy:x}}var hm=Object.freeze({__proto__:null,Media:Cp,Direction:$p,Elements:Hp,Slides:Op,Layout:Bp,Clones:jp,Move:Vp,Controller:Gp,Arrows:qp,Autoplay:Kp,Cover:Zp,Scroll:im,Drag:om,Keyboard:am,LazyLoad:lm,Pagination:cm,Sync:um,Wheel:pm,Live:gm}),fm={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"},ym={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:_p,i18n:fm,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function xm(e,t,n){var i=t.Slides;function o(){Kt(e).on([si,en],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),jc(c)}return{mount:o,start:l,cancel:Ka}}function vm(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,d=Xt(wn,l,"transition"),c;function u(){Kt(e).bind(l,"transitionend",function(m){m.target===l&&c&&(x(),c())})}function p(m,h){var f=i.toPosition(m,!0),v=i.getPosition(),C=w(m);dn(f-v)>=1&&C>=1?n.useScroll?r.scroll(f,C,!1,h):(d("transform "+C+"ms "+n.easing),i.translate(f,!0),c=h):(i.jump(m),h())}function x(){d(""),r.cancel()}function w(m){var h=n.rewindSpeed;if(e.is(Zi)&&h){var f=o.getIndex(!0),v=o.getEnd();if(f===0&&m>=v||f>=v&&m===0)return h}return n.speed}return{mount:u,start:p,cancel:x}}var bm=(function(){function e(n,i){this.event=Kt(),this.Components={},this.state=wp(Bi),this.splides=[],this._o={},this._E={};var o=ni(n)?Uc(document,n):n;Ro(o,o+" is invalid."),this.root=o,i=qn({label:Sn(o,yn)||"",labelledby:Sn(o,_s)||""},ym,e.defaults,i||{});try{qn(i,JSON.parse(Sn(o,Rs)))}catch{Ro(!1,"Invalid JSON")}this._o=Object.create(qn({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,d=this.Components;Ro(l.is([Bi,_r]),"Already mounted!"),l.set(Bi),this._C=d,this._T=o||this._T||(this.is(Qo)?xm:vm),this._E=i||this._E;var c=Fo({},hm,this._E,{Transition:this._T});return Ci(c,function(u,p){var x=u(r,d,r._o);d[p]=x,x.setup&&x.setup()}),Ci(d,function(u){u.mount&&u.mount()}),this.emit(si),En(this.root,Ap),l.set(Ui),this.emit(es),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Ui)&&(this._C.Sync.remount(),i.Components.Sync.remount()),this},t.go=function(i){return this._C.Controller.go(i),this},t.on=function(i,o){return this.event.on(i,o),this},t.off=function(i){return this.event.off(i),this},t.emit=function(i){var o;return(o=this.event).emit.apply(o,[i].concat(ai(arguments,1))),this},t.add=function(i,o){return this._C.Slides.add(i,o),this},t.remove=function(i){return this._C.Slides.remove(i),this},t.is=function(i){return this._o.type===i},t.refresh=function(){return this.emit(en),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,r=this.state;return r.is(Bi)?Kt(this).on(es,this.destroy.bind(this,i)):(Ci(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(Es),o.destroy(),i&&On(this.splides),r.set(_r)),this},fp(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})(),Os=bm;Os.defaults={};Os.STATES=xp;var yl=[[si,"onMounted"],[es,"onReady"],[Bn,"onMove"],[co,"onMoved"],[Ps,"onClick"],[Jc,"onActive"],[Qc,"onInactive"],[ed,"onVisible"],[td,"onHidden"],[en,"onRefresh"],[ln,"onUpdated"],[Ki,"onResize"],[Zr,"onResized"],[nd,"onDrag"],[id,"onDragging"],[od,"onDragged"],[Jr,"onScroll"],[Li,"onScrolled"],[Es,"onDestroy"],[rd,"onArrowsMounted"],[ad,"onArrowsUpdated"],[sd,"onPaginationMounted"],[ld,"onPaginationUpdated"],[Ms,"onNavigationMounted"],[ks,"onAutoplayPlay"],[cd,"onAutoplayPlaying"],[As,"onAutoplayPause"],[Fs,"onLazyLoadLoaded"]];function Bs(...e){return e.filter(Boolean).join(" ")}function Dr(e){return e!==null&&typeof e=="object"}function is(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!is(n,t[i]));if(Dr(e)&&Dr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!is(e[o],t[o]))}return e===t}function wm(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function Sm(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 os(e,t){const n=e;return Sm(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Dr(i)?n[o]=os(Dr(n[o])?n[o]:{},i):n[o]=i}),n}var Cm=({children:e,className:t,...n})=>s.createElement("div",{className:Bs("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),zs=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 Os(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=os({},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&&!is(this.options,e)&&(this.splide.options=e,this.options=os({},e));const t=this.getSlides();wm(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){yl.forEach(([t,n])=>{const i=this.props[n];typeof i=="function"&&e.on(t,(...o)=>{i(e,...o)})})}omit(e,t){return t.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}),e}render(){const{className:e,tag:t="div",hasTrack:n=!0,children:i,...o}=this.props;return s.createElement(t,{className:Bs("splide",e),ref:this.splideRef,...this.omit(o,["options",...yl.map(r=>r[1])])},n?s.createElement(Cm,null,i):i)}},js=({children:e,className:t,...n})=>s.createElement("li",{className:Bs("splide__slide",t),...n},e);/*!
2
2
  * Splide.js
3
3
  * Version : 4.1.3
4
4
  * License : MIT
5
5
  * Copyright: 2022 Naotoshi Fujita
6
- */const Cm="RichTextRenderer-module__link___BWeZ2",$m={link:Cm},Tm=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))},po=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Tm(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function an(e){const{color:t,...n}=e;return n}function Ut(e,t){var o,r,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:po(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:D.scalingValue(e.letterSpacing,t),wordSpacing:D.scalingValue(e.wordSpacing,t),fontSize:D.scalingValue(n,t),lineHeight:i!==void 0?D.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(r=e.textAppearance)==null?void 0:r.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}const Ri=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:$m.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:Im(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 Im(e){return{...e.fontFamily&&{fontFamily:po(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 Rm="SvgImage-module__svg___q3xE-",Lm="SvgImage-module__img___VsTm-",xl={svg:Rm,img:Lm},Pm=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},Em=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,sn=({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)}},[]),!Pm(e)||!r?a.jsx("img",{src:e,alt:"",className:pt(xl.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:pt(xl.svg,i),style:{"--svg":Em(e),"--fill":t,"--hover-fill":n,...o??{}}})},Mm={"top-left":ut.topLeftAlignment,"top-center":ut.topCenterAlignment,"top-right":ut.topRightAlignment,"middle-left":ut.middleLeftAlignment,"middle-center":ut.middleCenterAlignment,"middle-right":ut.middleRightAlignment,"bottom-left":ut.bottomLeftAlignment,"bottom-center":ut.bottomCenterAlignment,"bottom-right":ut.bottomRightAlignment};function km({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:x,textAppearance:w,color:m}=n.imageCaption??{},[h,f]=s.useState(void 0),[v,C]=s.useState(null),[y,S]=s.useState(0),[V,N]=s.useState(0),{direction:q,transition:W,controls:I,pagination:B,imageCaption:$,triggers:T}=e,k=s.useRef(W.type),{x:F,y:g}=e.controls.offset,O=P=>{o&&o.go(P)};return s.useEffect(()=>{if(!v)return;const P=new ResizeObserver(X=>{if(!o)return;const[te]=X;f({width:Math.round(te.contentRect.width),height:Math.round(te.contentRect.height)})});return P.observe(v),()=>P.unobserve(v)},[v]),s.useEffect(()=>{!o||k.current===W.type||(N(P=>P+1),k.current=W.type)},[W.type]),a.jsx("div",{className:pt(ut.wrapper,{[ut.editor]:i}),ref:C,children:a.jsxs("div",{className:ut.sliderInner,style:{width:h?h.width:"100%",height:h?h.height:"100%",backgroundColor:W.backgroundColor&&W.type==="fade in"?W.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:pt(ut.captionBlock),children:a.jsx("div",{className:ut.captionTextWrapper,children:t.map((P,X)=>a.jsx("div",{className:pt(ut.captionText,Mm[$.alignment],{[ut.withPointerEvents]:X===y&&i,[ut.active]:X===y}),style:{fontFamily:po(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":D.scalingValue(l.width,i),letterSpacing:D.scalingValue(c,i),wordSpacing:D.scalingValue(p,i),textAlign:u,fontSize:D.scalingValue(x.fontSize,i),lineHeight:D.scalingValue(x.lineHeight,i),textTransform:w.textTransform??"none",textDecoration:w.textDecoration??"none",fontVariant:w.fontVariant??"normal",color:m,transitionDuration:W.duration?`${Math.round(parseInt(W.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:ut.captionTextInner,style:{"--link-hover-color":$.linkHoverColor,"--link-color":$.linkColor,position:"relative",top:D.scalingValue($.offset.y,i),left:D.scalingValue($.offset.x,i)},children:a.jsx(Ri,{content:P.imageCaption})})},X))})}),a.jsx(zs,{onMove:P=>{S(P.index)},ref:r,options:{arrows:!1,speed:W.duration?parseInt(W.duration):500,autoplay:T.autoPlay!==null,...T.autoPlay!==null&&{interval:parseInt(T.autoPlay)*1e3},direction:q==="horiz"||W.type==="fade in"?"ltr":"ttb",pagination:!1,drag:T.triggersList.drag,perPage:1,width:h?h.width:"100%",height:h?h.height:"100%",type:W.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((P,X)=>a.jsx(js,{children:a.jsx("div",{className:ut.sliderItem,children:a.jsx("div",{className:ut.imgWrapper,children:a.jsx("img",{className:pt(ut.sliderImage,{[ut.contain]:P.image.objectFit==="contain",[ut.cover]:P.image.objectFit==="cover"}),src:P.image.url,alt:P.image.name??""})})})},X))},V),I.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(ut.arrow,{[ut.arrowVertical]:q==="vert",[ut.hoverArrow]:I.show==="on hover"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:a.jsxs("button",{onClick:()=>{O("-1")},className:ut.arrowInner,style:{transform:`translate(${D.scalingValue(F,i)}, ${D.scalingValue(g*(q==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${q==="horiz"?"0deg":"90deg"})`},children:[I.arrowsImgUrl&&a.jsx(sn,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:pt(ut.arrowImg,ut.mirror)}),!I.arrowsImgUrl&&a.jsx(vl,{color:I.color,className:pt(ut.arrowIcon,ut.arrowImg,ut.mirror)})]})}),a.jsx("div",{className:pt(ut.arrow,ut.nextArrow,{[ut.arrowVertical]:q==="vert",[ut.hoverArrow]:I.show==="on hover"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:a.jsxs("button",{className:ut.arrowInner,onClick:()=>O("+1"),style:{transform:`translate(${D.scalingValue(F*(q==="horiz"?-1:1),i)}, ${D.scalingValue(g,i)}) scale(${e.controls.scale/100}) rotate(${q==="horiz"?"0deg":"90deg"})`},children:[I.arrowsImgUrl&&a.jsx(sn,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:ut.arrowImg}),!I.arrowsImgUrl&&a.jsx(vl,{color:I.color,className:pt(ut.arrowIcon,ut.arrowImg)})]})})]}),T.triggersList.click&&a.jsx("div",{className:ut.clickOverlay,onClick:()=>{o&&o.go("+1")}}),B.isActive&&a.jsx("div",{className:pt(ut.pagination,{[ut.paginationInsideBottom]:B.position==="inside-1"&&q==="horiz",[ut.paginationInsideTop]:B.position==="inside-2"&&q==="horiz",[ut.paginationOutsideBottom]:B.position==="outside-1"&&q==="horiz",[ut.paginationOutsideTop]:B.position==="outside-2"&&q==="horiz",[ut.paginationInsideLeft]:B.position==="inside-1"&&q==="vert",[ut.paginationInsideRight]:B.position==="inside-2"&&q==="vert",[ut.paginationOutsideLeft]:B.position==="outside-1"&&q==="vert",[ut.paginationOutsideRight]:B.position==="outside-2"&&q==="vert",[ut.paginationVertical]:q==="vert"}),children:a.jsx("div",{className:ut.paginationInner,style:{backgroundColor:B.colors[2],transform:`scale(${B.scale/100}) translate(${D.scalingValue(B.offset.x,i)}, ${D.scalingValue(B.offset.y,i)}) rotate(${q==="horiz"?"0deg":"90deg"})`},children:t.map((P,X)=>a.jsx("button",{onClick:()=>{o&&o.go(X)},className:pt(ut.paginationItem),children:a.jsx("div",{className:pt(ut.dot,{[ut.activeDot]:X===y}),style:{backgroundColor:X===y?B.colors[0]:B.colors[1],"--pagination-hover-color":B.hover}})},X))})})]})})}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 Am={element:km,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"]}},Fm="ImageRevealSlider-module__imageRevealSlider___UE5Ob",_m="ImageRevealSlider-module__image___Qjt-e",Nm="ImageRevealSlider-module__link___N-iLG",Wm="ImageRevealSlider-module__cursor___2U03d",Mi={imageRevealSlider:Fm,image:_m,link:Nm,cursor:Wm};function bl(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 ba(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Hm(e,t,n,i){let o,r;if(t==="custom"){o=n;const l=await ba(e);r=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await ba(e);r=l.height/l.width*o}else{const l=await ba(e);o=l.width,r=l.height}return{width:o,height:r,finalWidth:`${o}px`}}function Dm({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,x]=s.useState({x:0,y:0}),[w,m]=s.useState(1),[h,f]=s.useState("none"),v=s.useRef({x:0,y:0}),[C,y]=s.useState(!1),{sizeType:S,imageWidth:V,randomRangeImageWidth:N}=e.imageSize,{revealPosition:q,visible:W}=e.position,{cursorType:I,target:B,defaultCursorScale:$,defaultCursor:T,hoverCursorScale:k,hoverCursor:F}=e.cursor;s.useEffect(()=>{if(!i)return;const P=(L,H)=>{const U=i.getBoundingClientRect(),de=L-U.left,ae=H-U.top;if(x({x:de,y:ae}),I==="system"){f("none"),m(1);return}const A=de,ce=ae,z=document.elementFromPoint(U.left+A,U.top+ce);if(z&&z.closest("a")){f("none"),m(1);return}const re=bl(A,ce,r)||B==="area"?{img:F??"none",scale:k}:{img:T??"none",scale:$};f(re.img),m(re.scale)},X=L=>{L.stopPropagation(),v.current={x:L.clientX,y:L.clientY},P(L.clientX,L.clientY)},te=()=>{C&&P(v.current.x,v.current.y)};return i.addEventListener("mousemove",X),window.addEventListener("scroll",te,!0),()=>{i.removeEventListener("mousemove",X),window.removeEventListener("scroll",te,!0)}},[i,C,p,I,B,F,T,k,$,r]),s.useEffect(()=>{C||(f("none"),m(0))},[C]);const g=async(P,X,te,L={})=>{const{width:H,height:U,finalWidth:de}=await Hm(P.image.url,S,V,N);let ae=0,A=0;q==="same"?(ae=X/2,A=te/2):(ae=L.x??Math.random()*X,A=L.y??Math.random()*te);const ce=Math.min(Math.max(ae,H/2),X-H/2),z=Math.min(Math.max(A,U/2),te-U/2);return{id:u.current++,url:P.image.url,link:P.link,name:P.image.name,x:ce,y:z,width:de}};s.useEffect(()=>{if(!i||t.length===0)return;const P=i.getBoundingClientRect(),X=P.width,te=P.height,L=[];(async()=>{const U=t[0],de=await g(U,X,te);L.push(de),l(L),c(1)})()},[S,V,N,q,i]),s.useEffect(()=>{W==="last One"&&l(P=>P.length>0?[P[P.length-1]]:[])},[W]);const O=async P=>{if(!i)return;const X=i.getBoundingClientRect(),te=P.clientX-X.left,L=P.clientY-X.top;if(B==="image"&&!bl(te,L,r))return;let H=0,U=0;q==="on Click"?(H=te,U=L):q==="same"?(H=X.width/2,U=X.height/2):(H=Math.random()*X.width,U=Math.random()*X.height);const de=t[d],ae=await g(de,X.width,X.height,{x:H,y:U});l(A=>W==="all"?[...A,ae]:[ae]),c(A=>A>=t.length-1?0:A+1)};return a.jsxs("div",{ref:o,onClick:O,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),className:Mi.imageRevealSlider,style:{cursor:h==="none"?"default":"none"},children:[r.map(P=>a.jsx("div",{className:Mi.wrapper,style:{top:`${P.y}px`,left:`${P.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:P.width??"auto",height:"auto",cursor:h==="none"?"default":"none"},children:B==="area"&&P.link?a.jsx("a",{href:P.link,target:"_blank",className:Mi.link,children:a.jsx("img",{src:P.url,alt:P.name,className:Mi.image},P.id)}):a.jsx("img",{src:P.url,alt:P.name,className:Mi.image},P.id)},P.id)),C&&a.jsx("div",{className:Mi.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${w})`,backgroundImage:`url('${h}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Om={element:Dm,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:""}]}}}},Bm="LightBox-module__hidden___9s-9x",zm="LightBox-module__heroImage___sTxNF",jm="LightBox-module__background___rm9ml",Vm="LightBox-module__editor___4ACaY",Gm="LightBox-module__contentStyle___Bgnsq",Xm="LightBox-module__imageStyle___tLIlB",Ym="LightBox-module__imgWrapper___LuFUp",qm="LightBox-module__contain___8-yaS",Um="LightBox-module__cover___hNvOG",Km="LightBox-module__caption___b6L2I",Zm="LightBox-module__captionTextInner___rCGNH",Jm="LightBox-module__lightboxSplide___XFuWC",Qm="LightBox-module__arrow___iz38X",eg="LightBox-module__arrowVertical___Zfz81",tg="LightBox-module__nextArrow___zkAQN",ng="LightBox-module__arrowInner___p48sW",ig="LightBox-module__arrowIcon___3VaFf",og="LightBox-module__arrowImg___pNV88",rg="LightBox-module__mirror___pjeXc",ag="LightBox-module__thumbsWrapper___GB-nU",sg="LightBox-module__thumbsContainerVertical___wttk5",lg="LightBox-module__thumbsContainer___osSma",cg="LightBox-module__thumbsAlignStart___MO6tY",dg="LightBox-module__thumbsAlignCenter___Q4sUx",ug="LightBox-module__thumbsAlignEnd___p4y9R",pg="LightBox-module__thumbItem___HvnF3",mg="LightBox-module__closeButton___g2khP",gg="LightBox-module__fadeIn___0m5GW",hg="LightBox-module__slideInLeft___gPYwC",fg="LightBox-module__slideInRight___S-pPp",yg="LightBox-module__slideInTop___DFdAj",xg="LightBox-module__slideInBottom___m27kZ",vg="LightBox-module__fadeOut___55qBR",bg="LightBox-module__slideOutLeft___NvU7P",wg="LightBox-module__slideOutRight___SK7eC",Sg="LightBox-module__slideOutTop___Vgg0z",Cg="LightBox-module__slideOutBottom___nJ0Ef",$g="LightBox-module__scaleSlide___vZriG",Qe={hidden:Bm,heroImage:zm,background:jm,editor:Vm,contentStyle:Gm,imageStyle:Xm,imgWrapper:Ym,contain:qm,cover:Um,caption:Km,captionTextInner:Zm,lightboxSplide:Jm,arrow:Qm,arrowVertical:eg,nextArrow:tg,arrowInner:ng,arrowIcon:ig,arrowImg:og,mirror:rg,thumbsWrapper:ag,thumbsContainerVertical:sg,thumbsContainer:lg,thumbsAlignStart:cg,thumbsAlignCenter:dg,thumbsAlignEnd:ug,thumbItem:pg,closeButton:mg,fadeIn:gg,slideInLeft:hg,slideInRight:fg,slideInTop:yg,slideInBottom:xg,fadeOut:vg,slideOutLeft:bg,slideOutRight:wg,slideOutTop:Sg,slideOutBottom:Cg,scaleSlide:$g},lr=(e,t,n)=>{const i={},[o,r]=e.split("-");return o==="top"?(i.top="0",i.bottom="auto"):o==="middle"?(i.top="50%",i.bottom="auto"):o==="bottom"&&(i.top="auto",i.bottom="0"),r==="left"?(i.left="0",i.right="auto"):r==="center"?(i.left="50%",i.right="auto"):r==="right"&&(i.left="auto",i.right="0"),o==="middle"&&r==="center"?i.transform=`translate(calc(-50% + ${D.scalingValue(t.x,n)}), calc(-50% + ${D.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${D.scalingValue(t.x,n)}, calc(-50% + ${D.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${D.scalingValue(t.x,n)}), ${D.scalingValue(t.y,n)})`:i.transform=`translate(${D.scalingValue(t.x,n)}, ${D.scalingValue(t.y,n)})`,i};function $d(e){const t=window.getComputedStyle(e);return{top:parseFloat(t.paddingTop)||0,right:parseFloat(t.paddingRight)||0,bottom:parseFloat(t.paddingBottom)||0,left:parseFloat(t.paddingLeft)||0}}function Tg(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 Td(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 Ig(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 Id(e,t,n,i,o){const{x:r,y:l}=Tg(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function Rg(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"?Ig:Td,{renderedW:u,renderedH:p}=c(n,i,o,r),{offsetX:x,offsetY:w}=Id(n,i,u,p,d),m=(x+u/2)/n*100,h=(w+p/2)/i*100;return`${m}% ${h}%`}function Lg(e){return Rg(e)}function Or(e){const t=e.getBoundingClientRect(),n=$d(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),r=e.naturalWidth,l=e.naturalHeight,{renderedW:d,renderedH:c}=Td(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:x}=Id(i,o,d,c,u),w=t.left+n.left,m=t.top+n.top;return{x:p+w,y:x+m,width:d,height:c}}function wl(e){const t=e.getBoundingClientRect(),n=$d(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Sl(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 Pg(e,t){const n=(()=>{if(e==="fade in")return Qe.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Qe.slideInLeft;case"right":return Qe.slideInRight;case"top":return Qe.slideInTop;case"bottom":return Qe.slideInBottom;default:return Qe.slideInRight}return Qe.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Qe.fadeIn;if(e==="slide in")switch(t){case"left":return Qe.slideInLeft;case"right":return Qe.slideInRight;case"top":return Qe.slideInTop;case"bottom":return Qe.slideInBottom;default:return Qe.slideInRight}return Qe.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Qe.fadeOut;if(e==="slide in")switch(t){case"left":return Qe.slideOutLeft;case"right":return Qe.slideOutRight;case"top":return Qe.slideOutTop;case"bottom":return Qe.slideOutBottom;default:return Qe.slideOutRight}return Qe.fadeOut})(),r=(()=>{if(e==="fade in")return Qe.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Qe.slideOutLeft;case"right":return Qe.slideOutRight;case"top":return Qe.slideOutTop;case"bottom":return Qe.slideOutBottom;default:return Qe.slideOutRight}return Qe.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:r}}const Eg=({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:Qe.heroImage,onClick:()=>c(!0)}),a.jsx(Mg,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},Mg=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:d})=>{var fe;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:x,wordSpacing:w,fontSizeLineHeight:m,textAppearance:h,color:f}=i.imageCaption??{},[v,C]=s.useState(0),[y,S]=s.useState(0),[V,N]=s.useState(!1),[q,W]=s.useState(!1),[I,B]=s.useState({}),$=s.useRef(null),T=s.useRef(null),k=s.useRef(null),F=s.useRef(!1),g=s.useRef(null),O=s.useRef(null),P=s.useRef(null),X=s.useRef(null),te=s.useRef(!1),L=s.useRef(null),[H,U]=s.useState(!1),{appear:de,triggers:ae,slider:A,thumbnail:ce,controls:z,area:re,caption:ee,layout:xe}=o.lightboxBlock,{appearClass:Fe,backdropAppearClass:ye,backdropDisappearClass:b,disappearClass:M}=Pg(de.type,de.direction),E=(d==null?void 0:d.itemId)??null;s.useEffect(()=>{const K=()=>{setTimeout(()=>{var se,Se;(Se=(se=$.current)==null?void 0:se.splide)==null||Se.refresh()},16)},Z=()=>{S(se=>se+1)};return window.addEventListener("ArticleEditor.Layout:change",K),window.addEventListener("ArticleEditor.ComponentContent:change",Z),()=>{window.removeEventListener("ArticleEditor.Layout:change",K),window.removeEventListener("ArticleEditor.ComponentContent:change",Z)}},[]),s.useEffect(()=>{if(!e||!ce.isActive){U(!1);return}const K=L.current;if(!K)return;const Z=()=>{A.direction==="horiz"?U(K.scrollWidth>K.clientWidth):U(K.scrollHeight>K.clientHeight)};Z();const se=new ResizeObserver(Z);return se.observe(K),()=>se.disconnect()},[e,ce.isActive,n.length,I,A.direction]);const j=s.useCallback(()=>{const K=window.matchMedia("(max-width: 768px)").matches,Z=Sl(re.color);K&&!l&&Z>.9&&(document.body.style.backgroundColor=""),N(!0),F.current=!0;const se=Se=>{Se.target===g.current&&Se.animationName&&(g.current&&O.current&&g.current.removeEventListener("animationend",O.current),O.current=null,F.current&&(F.current=!1,t()),N(!1))};g.current&&(O.current=se,g.current.addEventListener("animationend",se))},[t,re.color,l]),Ce=(K,Z,se)=>{var Se,Me;if(K){if(ae.type==="click"&&ae.switch==="image")ae.repeat==="close"&&v===n.length-1?j():(Se=$.current)==null||Se.go("+1");else if(ae.type==="click"&&ae.switch==="50/50"){const $e=K.getBoundingClientRect(),G=Z-$e.left,pe=se-$e.top,oe=$e.width,Y=$e.height;let le;A.direction==="horiz"?le=G<oe/2?"-1":"+1":le=pe<Y/2?"-1":"+1",(Me=$.current)==null||Me.go(le)}}},Q=K=>{if(te.current){te.current=!1;return}const Z=n[v],se=(Z==null?void 0:Z.image.objectFit)==="cover";let Se,Me;if("changedTouches"in K&&K.changedTouches.length>0)Se=K.changedTouches[0].clientX,Me=K.changedTouches[0].clientY;else if("clientX"in K)Se=K.clientX,Me=K.clientY;else return;let $e;if(se&&k.current){const G=wl(k.current);$e=Se>=G.left&&Se<=G.right&&Me>=G.top&&Me<=G.bottom}else{const G=k.current?Or(k.current):null;if(!G){K.target===K.currentTarget&&j();return}$e=Se>=G.x&&Se<=G.x+G.width&&Me>=G.y&&Me<=G.y+G.height}$e?Ce(k.current,Se,Me):j()},Te=K=>{const Z=K.target;(Z.classList.contains(Qe.thumbsWrapper)||Z.classList.contains(Qe.thumbsContainer))&&Q(K)};s.useEffect(()=>{if(!e)return;const K=Z=>{var se,Se;if(Z.key==="Escape"){j();return}if(Z.key==="ArrowRight"){C(Me=>(Me+1)%Math.max(n.length,1)),(se=$.current)==null||se.go("+1");return}Z.key==="ArrowLeft"&&(C(Me=>(Me-1+Math.max(n.length,1))%Math.max(n.length,1)),(Se=$.current)==null||Se.go("-1"))};return window.addEventListener("keydown",K),()=>{window.removeEventListener("keydown",K)}},[e,j,n.length]),s.useEffect(()=>{if(e){if(C(0),S(Z=>Z+1),F.current=!1,N(!1),W(!1),B({}),!E)return;const K=new CustomEvent("page-overlay",{detail:{itemId:E}});window.dispatchEvent(K)}return()=>{g.current&&O.current&&(g.current.removeEventListener("animationend",O.current),O.current=null),W(!1)}},[e,E]),s.useEffect(()=>{T.current!==null&&T.current!==A.type&&S(K=>K+1),T.current=A.type},[A.type]),s.useEffect(()=>{if(!e)return;const K=document.body.style.overflow,Z=window.matchMedia("(max-width: 768px)").matches,se=Sl(re.color);document.body.style.overflow="hidden",W(!1);const Se=$e=>{$e.target===g.current&&!F.current&&$e.animationName&&(Z&&!l&&se>.9&&(document.body.style.backgroundColor=re.color),W(!0),g.current&&P.current&&g.current.removeEventListener("animationend",P.current),P.current=null)};g.current&&(P.current=Se,g.current.addEventListener("animationend",Se));const Me=$e=>{const G=$e.target;G&&(G.closest(`.${Qe.thumbsWrapper}`)||G.closest(`.${Qe.thumbsContainer}`))||A.type!=="slide"&&$e.preventDefault()};return document.addEventListener("touchmove",Me,{passive:!1}),()=>{document.body.style.overflow=K,document.removeEventListener("touchmove",Me),g.current&&P.current&&(g.current.removeEventListener("animationend",P.current),P.current=null),W(!1)}},[e,l,re.color,A.type]),s.useEffect(()=>{if(!e)return;const K=Z=>{var Se,Me;if(F.current){Z.stopPropagation();return}if(te.current){te.current=!1;return}const se=Z.target;if(!(se&&(se.closest(`.${Qe.thumbsContainer}`)||se.closest(`.${Qe.thumbItem}`)||se.closest(`.${Qe.arrow}`)||se.closest(`.${Qe.closeButton}`)||se.closest(`.${Qe.caption}`)))){if(A.type==="slide"&&ae.type==="drag"&&((Me=(Se=$.current)==null?void 0:Se.splide)!=null&&Me.root)){const $e=$.current.splide.root;if(se&&($e.contains(se)||$e===se))return}if(Z.touches.length===0&&Z.changedTouches.length>0){const $e=n[v],G=($e==null?void 0:$e.image.objectFit)==="cover",pe=Z.changedTouches[0];let oe;if(G&&k.current){const Y=wl(k.current);oe=pe.clientX>=Y.left&&pe.clientX<=Y.right&&pe.clientY>=Y.top&&pe.clientY<=Y.bottom}else{const Y=k.current?Or(k.current):null;if(!Y)return;oe=pe.clientX>=Y.x&&pe.clientX<=Y.x+Y.width&&pe.clientY>=Y.y&&pe.clientY<=Y.y+Y.height}if(!oe){Z.stopPropagation(),F.current=!0;const Y=le=>{le.stopPropagation(),le.preventDefault(),document.removeEventListener("click",Y,!0)};document.addEventListener("click",Y,!0),j()}}}};return document.addEventListener("touchend",K,{passive:!0}),()=>{document.removeEventListener("touchend",K)}},[e,j,v,n]);const ie=(A.type==="scale"||A.type==="fade")&&A.direction==="vert"&&ae.type==="drag";s.useEffect(()=>{var le,_e;if(!e||!ie||!((_e=(le=$.current)==null?void 0:le.splide)!=null&&_e.root))return;const K=$.current.splide.root,Z=30,se=(me,J)=>{if(X.current){const Ke=Math.abs(me-X.current.x),ke=Math.abs(J-X.current.y);(Ke>0||ke>0)&&(te.current=!0)}},Se=me=>{X.current&&(me.preventDefault(),se(me.clientX,me.clientY))},Me=me=>{X.current&&me.touches.length>0&&(me.preventDefault(),se(me.touches[0].clientX,me.touches[0].clientY))},$e=(me,J)=>{if(!X.current||!$.current){X.current=null;return}const Ke=Math.abs(me-X.current.x),ke=Math.abs(J-X.current.y);ke>Z&&ke>Ke&&$.current.go(J<X.current.y?"+1":"-1"),X.current=null},G=me=>{X.current&&$e(me.clientX,me.clientY),document.removeEventListener("pointerup",G),document.removeEventListener("pointercancel",G),document.removeEventListener("pointermove",Se)},pe=me=>{if(X.current){if(me.changedTouches.length>0){const J=me.changedTouches[0];$e(J.clientX,J.clientY)}document.removeEventListener("touchend",pe),document.removeEventListener("touchcancel",pe),document.removeEventListener("touchmove",Me)}},oe=me=>{X.current={x:me.clientX,y:me.clientY},te.current=!1,document.addEventListener("pointermove",Se,{passive:!1}),document.addEventListener("pointerup",G),document.addEventListener("pointercancel",G)},Y=me=>{me.touches.length>0&&(X.current={x:me.touches[0].clientX,y:me.touches[0].clientY},te.current=!1,document.addEventListener("touchmove",Me,{passive:!1}),document.addEventListener("touchend",pe),document.addEventListener("touchcancel",pe))};return K.addEventListener("pointerdown",oe),K.addEventListener("touchstart",Y),()=>{K.removeEventListener("pointerdown",oe),K.removeEventListener("touchstart",Y),document.removeEventListener("pointermove",Se),document.removeEventListener("pointerup",G),document.removeEventListener("pointercancel",G),document.removeEventListener("touchmove",Me),document.removeEventListener("touchend",pe),document.removeEventListener("touchcancel",pe),X.current=null,te.current=!1}},[e,ie,y]);const ue={backgroundColor:re.color,backdropFilter:`blur(${re.blur}px)`,animationDuration:`${parseInt(de.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(r)?null:zn.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:l?null:g,className:pt(Qe.background,V?b:ye,{[Qe.editor]:l},{[Qe.hidden]:!e}),style:{...ue,...q&&!l&&!V?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?g:null,className:pt(Qe.contentStyle,V?M:Fe,{[Qe.editor]:l},{[Qe.hidden]:!e}),style:{animationDuration:`${parseInt(de.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(zs,{onMove:K=>C(K.index),ref:$,className:Qe.lightboxSplide,options:{arrows:!1,speed:A.duration?parseInt(A.duration):500,direction:A.direction==="horiz"||A.type==="fade"||A.type==="scale"?"ltr":"ttb",pagination:!1,drag:ae.type==="drag"&&!ie,perPage:1,width:"100%",height:"100%",type:A.type==="fade"||A.type==="scale"?"fade":"loop",padding:0,rewind:ae.repeat!=="close",start:0},style:{"--splide-speed":A.duration},children:n.map((K,Z)=>{const se=lr(xe.position,xe.offset,l),Se=`${D.scalingValue(xe.padding.top,l)} ${D.scalingValue(xe.padding.right,l)} ${D.scalingValue(xe.padding.bottom,l)} ${D.scalingValue(xe.padding.left,l)}`,Me=A.type==="scale"?(()=>{const{transform:$e,...G}=se;return{...G,position:"absolute",padding:Se,boxSizing:"border-box","--position-transform":$e||"none"}})():{...se,position:"absolute",padding:Se,boxSizing:"border-box"};return a.jsx(js,{children:a.jsx("div",{className:Qe.imgWrapper,onClick:Q,children:a.jsx("img",{ref:Z===v?k:null,className:pt(Qe.imageStyle,{[Qe.contain]:K.image.objectFit==="contain",[Qe.cover]:K.image.objectFit==="cover",[Qe.scaleSlide]:A.type==="scale"}),src:K.image.url,alt:K.image.name??"",style:{...Me,pointerEvents:K.image.objectFit==="contain"?"none":"auto"}})})},Z)})},y),z.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(Qe.arrow,{[Qe.arrowVertical]:A.direction==="vert"}),style:{color:z.color,"--arrow-hover-color":z.hover},children:a.jsxs("button",{className:Qe.arrowInner,style:{transform:`translate(${D.scalingValue(z.offset.x,l)}, ${D.scalingValue(z.offset.y*(A.direction==="horiz"?1:-1),l)}) scale(${z.scale}) rotate(${A.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var K;return(K=$.current)==null?void 0:K.go("-1")},"aria-label":"Previous",children:[z.arrowsImgUrl&&a.jsx(sn,{url:z.arrowsImgUrl,fill:z.color,hoverFill:z.hover,className:pt(Qe.arrowImg,Qe.mirror)}),!z.arrowsImgUrl&&a.jsx(Cl,{color:z.color,className:pt(Qe.arrowIcon,Qe.arrowImg,Qe.mirror)})]})}),a.jsx("div",{className:pt(Qe.arrow,Qe.nextArrow,{[Qe.arrowVertical]:A.direction==="vert"}),style:{color:z.color,"--arrow-hover-color":z.hover},children:a.jsxs("button",{className:Qe.arrowInner,style:{transform:`translate(${D.scalingValue(z.offset.x*(A.direction==="horiz"?-1:1),l)}, ${D.scalingValue(z.offset.y,l)}) scale(${z.scale}) rotate(${A.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var K;return(K=$.current)==null?void 0:K.go("+1")},"aria-label":"Next",children:[z.arrowsImgUrl&&a.jsx(sn,{url:z.arrowsImgUrl,fill:z.color,hoverFill:z.hover,className:Qe.arrowImg}),!z.arrowsImgUrl&&a.jsx(Cl,{color:z.color,className:pt(Qe.arrowIcon,Qe.arrowImg)})]})})]}),re.closeIconUrl&&(()=>{const K=lr(re.closeIconAlign,re.closeIconOffset,l),Z=`scale(${re.closeIconScale})`,se=K.transform?`${K.transform} ${Z}`:Z;return a.jsx("button",{className:Qe.closeButton,style:{...K,transform:se},onClick:j,"aria-label":"Close lightbox",children:a.jsx(sn,{url:re.closeIconUrl,fill:re.closeIconColor??"#000000",hoverFill:re.closeIconHover??"#cccccc"})})})(),ee&&ee.isActive&&i.imageCaption&&((fe=n[v])==null?void 0:fe.imageCaption)&&a.jsx("div",{className:Qe.caption,style:{...lr(ee.alignment,ee.offset,l),fontFamily:po(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":D.scalingValue(c.width,l),letterSpacing:D.scalingValue(p,l),wordSpacing:D.scalingValue(w,l),textAlign:x,fontSize:D.scalingValue(m.fontSize,l),lineHeight:D.scalingValue(m.lineHeight,l),textTransform:h.textTransform??"none",textDecoration:h.textDecoration??"none",fontVariant:h.fontVariant??"normal",color:f},onClick:K=>K.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:Qe.captionTextInner,style:{"--link-color":ee.linkColor,"--link-hover-color":ee.linkHoverColor},children:a.jsx(Ri,{content:n[v].imageCaption})})}),ce.isActive&&(()=>{const[K,Z]=ce.position.split("-"),se=A.direction==="horiz"?`${K}-left`:ce.position,Se=lr(se,ce.offset,l),Me=()=>{if(A.direction==="horiz"){if(Z==="left")return"flex-start";if(Z==="center")return"center";if(Z==="right")return"flex-end"}else{if(K==="top")return"flex-start";if(K==="middle")return"center";if(K==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:L,className:Qe.thumbsWrapper,onClick:$e=>Te($e),style:{position:l?"absolute":"fixed",...Se,...A.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:pt(Qe.thumbsContainer,{[Qe.thumbsContainerVertical]:A.direction==="vert",[Qe.thumbsAlignStart]:ce.align==="start",[Qe.thumbsAlignCenter]:ce.align==="center",[Qe.thumbsAlignEnd]:ce.align==="end"}),style:{gap:D.scalingValue(ce.grid.gap,l),justifyContent:H?"flex-start":Me()},children:n.map(($e,G)=>{const pe=G===v,oe=I[G],le=ce.grid.size*(pe?ce.activeState.scale:1),_e=()=>{if(ce.fit!=="fit")return{};if(!oe)return A.direction==="horiz"?{height:D.scalingValue(le,l)}:{width:D.scalingValue(le,l)};const me=oe.width/oe.height;if(A.direction==="horiz"){const J=le,Ke=J*me;return{width:D.scalingValue(Ke,l),height:D.scalingValue(J,l)}}else{const J=le,Ke=J/me;return{width:D.scalingValue(J,l),height:D.scalingValue(Ke,l)}}};return a.jsx("button",{className:Qe.thumbItem,style:{...A.direction==="horiz"&&ce.fit!=="fit"?{height:D.scalingValue(le,l)}:{},...A.direction==="vert"&&ce.fit!=="fit"?{width:D.scalingValue(le,l)}:{},...ce.fit==="cover"?{width:D.scalingValue(le,l),height:D.scalingValue(le,l)}:{},..._e(),transition:pe?"all 0.25s ease-out":"none",opacity:pe?ce.activeState.opacity/100:ce.opacity/100,"--thumb-hover":ce.activeState.opacity/100},onClick:me=>{var J;me.stopPropagation(),C(G),(J=$.current)==null||J.go(G)},onMouseEnter:()=>{var me;ce.triggers==="hov"&&((me=$.current)==null||me.go(G))},children:a.jsx("img",{src:$e.image.url,alt:$e.image.name??"",onLoad:me=>{const J=me.currentTarget;J.naturalWidth&&J.naturalHeight&&B(Ke=>({...Ke,[G]:{width:J.naturalWidth,height:J.naturalHeight}}))},style:{objectFit:ce.fit==="cover"?"cover":"contain",...ce.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...ce.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${$e.image.name}-${G}`)})})})})()]})]}),document.getElementById(r))};function Cl({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 kg={element:Eg,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 cr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ag(e){return`
6
+ */const $m="RichTextRenderer-module__link___BWeZ2",Tm={link:$m},Im=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))},po=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Im(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function an(e){const{color:t,...n}=e;return n}function qt(e,t){var o,r,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:po(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:D.scalingValue(e.letterSpacing,t),wordSpacing:D.scalingValue(e.wordSpacing,t),fontSize:D.scalingValue(n,t),lineHeight:i!==void 0?D.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(r=e.textAppearance)==null?void 0:r.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}const Ri=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:Tm.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:Rm(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 Rm(e){return{...e.fontFamily&&{fontFamily:po(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 Lm="SvgImage-module__svg___q3xE-",Pm="SvgImage-module__img___VsTm-",xl={svg:Lm,img:Pm},Em=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},Mm=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,sn=({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)}},[]),!Em(e)||!r?a.jsx("img",{src:e,alt:"",className:pt(xl.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:pt(xl.svg,i),style:{"--svg":Mm(e),"--fill":t,"--hover-fill":n,...o??{}}})},km={"top-left":ut.topLeftAlignment,"top-center":ut.topCenterAlignment,"top-right":ut.topRightAlignment,"middle-left":ut.middleLeftAlignment,"middle-center":ut.middleCenterAlignment,"middle-right":ut.middleRightAlignment,"bottom-left":ut.bottomLeftAlignment,"bottom-center":ut.bottomCenterAlignment,"bottom-right":ut.bottomRightAlignment};function Am({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:x,textAppearance:w,color:m}=n.imageCaption??{},[h,f]=s.useState(void 0),[v,C]=s.useState(null),[y,S]=s.useState(0),[G,W]=s.useState(0),{direction:U,transition:H,controls:I,pagination:z,imageCaption:$,triggers:T}=e,A=s.useRef(H.type),{x:_,y:g}=e.controls.offset,B=P=>{o&&o.go(P)};return s.useEffect(()=>{if(!v)return;const P=new ResizeObserver(Y=>{if(!o)return;const[ie]=Y;f({width:Math.round(ie.contentRect.width),height:Math.round(ie.contentRect.height)})});return P.observe(v),()=>P.unobserve(v)},[v]),s.useEffect(()=>{!o||A.current===H.type||(W(P=>P+1),A.current=H.type)},[H.type]),a.jsx("div",{className:pt(ut.wrapper,{[ut.editor]:i}),ref:C,children:a.jsxs("div",{className:ut.sliderInner,style:{width:h?h.width:"100%",height:h?h.height:"100%",backgroundColor:H.backgroundColor&&H.type==="fade in"?H.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:pt(ut.captionBlock),children:a.jsx("div",{className:ut.captionTextWrapper,children:t.map((P,Y)=>a.jsx("div",{className:pt(ut.captionText,km[$.alignment],{[ut.withPointerEvents]:Y===y&&i,[ut.active]:Y===y}),style:{fontFamily:po(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":D.scalingValue(l.width,i),letterSpacing:D.scalingValue(c,i),wordSpacing:D.scalingValue(p,i),textAlign:u,fontSize:D.scalingValue(x.fontSize,i),lineHeight:D.scalingValue(x.lineHeight,i),textTransform:w.textTransform??"none",textDecoration:w.textDecoration??"none",fontVariant:w.fontVariant??"normal",color:m,transitionDuration:H.duration?`${Math.round(parseInt(H.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:ut.captionTextInner,style:{"--link-hover-color":$.linkHoverColor,"--link-color":$.linkColor,position:"relative",top:D.scalingValue($.offset.y,i),left:D.scalingValue($.offset.x,i)},children:a.jsx(Ri,{content:P.imageCaption})})},Y))})}),a.jsx(zs,{onMove:P=>{S(P.index)},ref:r,options:{arrows:!1,speed:H.duration?parseInt(H.duration):500,autoplay:T.autoPlay!==null,...T.autoPlay!==null&&{interval:parseInt(T.autoPlay)*1e3},direction:U==="horiz"||H.type==="fade in"?"ltr":"ttb",pagination:!1,drag:T.triggersList.drag,perPage:1,width:h?h.width:"100%",height:h?h.height:"100%",type:H.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((P,Y)=>a.jsx(js,{children:a.jsx("div",{className:ut.sliderItem,children:a.jsx("div",{className:ut.imgWrapper,children:a.jsx("img",{className:pt(ut.sliderImage,{[ut.contain]:P.image.objectFit==="contain",[ut.cover]:P.image.objectFit==="cover"}),src:P.image.url,alt:P.image.name??""})})})},Y))},G),I.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(ut.arrow,{[ut.arrowVertical]:U==="vert",[ut.hoverArrow]:I.show==="on hover"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:a.jsxs("button",{onClick:()=>{B("-1")},className:ut.arrowInner,style:{transform:`translate(${D.scalingValue(_,i)}, ${D.scalingValue(g*(U==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:[I.arrowsImgUrl&&a.jsx(sn,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:pt(ut.arrowImg,ut.mirror)}),!I.arrowsImgUrl&&a.jsx(vl,{color:I.color,className:pt(ut.arrowIcon,ut.arrowImg,ut.mirror)})]})}),a.jsx("div",{className:pt(ut.arrow,ut.nextArrow,{[ut.arrowVertical]:U==="vert",[ut.hoverArrow]:I.show==="on hover"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:a.jsxs("button",{className:ut.arrowInner,onClick:()=>B("+1"),style:{transform:`translate(${D.scalingValue(_*(U==="horiz"?-1:1),i)}, ${D.scalingValue(g,i)}) scale(${e.controls.scale/100}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:[I.arrowsImgUrl&&a.jsx(sn,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:ut.arrowImg}),!I.arrowsImgUrl&&a.jsx(vl,{color:I.color,className:pt(ut.arrowIcon,ut.arrowImg)})]})})]}),T.triggersList.click&&a.jsx("div",{className:ut.clickOverlay,onClick:()=>{o&&o.go("+1")}}),z.isActive&&a.jsx("div",{className:pt(ut.pagination,{[ut.paginationInsideBottom]:z.position==="inside-1"&&U==="horiz",[ut.paginationInsideTop]:z.position==="inside-2"&&U==="horiz",[ut.paginationOutsideBottom]:z.position==="outside-1"&&U==="horiz",[ut.paginationOutsideTop]:z.position==="outside-2"&&U==="horiz",[ut.paginationInsideLeft]:z.position==="inside-1"&&U==="vert",[ut.paginationInsideRight]:z.position==="inside-2"&&U==="vert",[ut.paginationOutsideLeft]:z.position==="outside-1"&&U==="vert",[ut.paginationOutsideRight]:z.position==="outside-2"&&U==="vert",[ut.paginationVertical]:U==="vert"}),children:a.jsx("div",{className:ut.paginationInner,style:{backgroundColor:z.colors[2],transform:`scale(${z.scale/100}) translate(${D.scalingValue(z.offset.x,i)}, ${D.scalingValue(z.offset.y,i)}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:t.map((P,Y)=>a.jsx("button",{onClick:()=>{o&&o.go(Y)},className:pt(ut.paginationItem),children:a.jsx("div",{className:pt(ut.dot,{[ut.activeDot]:Y===y}),style:{backgroundColor:Y===y?z.colors[0]:z.colors[1],"--pagination-hover-color":z.hover}})},Y))})})]})})}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 Fm={element:Am,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"]}},_m="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Nm="ImageRevealSlider-module__image___Qjt-e",Wm="ImageRevealSlider-module__link___N-iLG",Hm="ImageRevealSlider-module__cursor___2U03d",Mi={imageRevealSlider:_m,image:Nm,link:Wm,cursor:Hm};function bl(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 ba(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Dm(e,t,n,i){let o,r;if(t==="custom"){o=n;const l=await ba(e);r=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await ba(e);r=l.height/l.width*o}else{const l=await ba(e);o=l.width,r=l.height}return{width:o,height:r,finalWidth:`${o}px`}}function Om({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,x]=s.useState({x:0,y:0}),[w,m]=s.useState(1),[h,f]=s.useState("none"),v=s.useRef({x:0,y:0}),[C,y]=s.useState(!1),{sizeType:S,imageWidth:G,randomRangeImageWidth:W}=e.imageSize,{revealPosition:U,visible:H}=e.position,{cursorType:I,target:z,defaultCursorScale:$,defaultCursor:T,hoverCursorScale:A,hoverCursor:_}=e.cursor;s.useEffect(()=>{if(!i)return;const P=(L,O)=>{const K=i.getBoundingClientRect(),ue=L-K.left,le=O-K.top;if(x({x:ue,y:le}),I==="system"){f("none"),m(1);return}const F=ue,pe=le,j=document.elementFromPoint(K.left+F,K.top+pe);if(j&&j.closest("a")){f("none"),m(1);return}const se=bl(F,pe,r)||z==="area"?{img:_??"none",scale:A}:{img:T??"none",scale:$};f(se.img),m(se.scale)},Y=L=>{L.stopPropagation(),v.current={x:L.clientX,y:L.clientY},P(L.clientX,L.clientY)},ie=()=>{C&&P(v.current.x,v.current.y)};return i.addEventListener("mousemove",Y),window.addEventListener("scroll",ie,!0),()=>{i.removeEventListener("mousemove",Y),window.removeEventListener("scroll",ie,!0)}},[i,C,p,I,z,_,T,A,$,r]),s.useEffect(()=>{C||(f("none"),m(0))},[C]);const g=async(P,Y,ie,L={})=>{const{width:O,height:K,finalWidth:ue}=await Dm(P.image.url,S,G,W);let le=0,F=0;U==="same"?(le=Y/2,F=ie/2):(le=L.x??Math.random()*Y,F=L.y??Math.random()*ie);const pe=Math.min(Math.max(le,O/2),Y-O/2),j=Math.min(Math.max(F,K/2),ie-K/2);return{id:u.current++,url:P.image.url,link:P.link,name:P.image.name,x:pe,y:j,width:ue}};s.useEffect(()=>{if(!i||t.length===0)return;const P=i.getBoundingClientRect(),Y=P.width,ie=P.height,L=[];(async()=>{const K=t[0],ue=await g(K,Y,ie);L.push(ue),l(L),c(1)})()},[S,G,W,U,i]),s.useEffect(()=>{H==="last One"&&l(P=>P.length>0?[P[P.length-1]]:[])},[H]);const B=async P=>{if(!i)return;const Y=i.getBoundingClientRect(),ie=P.clientX-Y.left,L=P.clientY-Y.top;if(z==="image"&&!bl(ie,L,r))return;let O=0,K=0;U==="on Click"?(O=ie,K=L):U==="same"?(O=Y.width/2,K=Y.height/2):(O=Math.random()*Y.width,K=Math.random()*Y.height);const ue=t[d],le=await g(ue,Y.width,Y.height,{x:O,y:K});l(F=>H==="all"?[...F,le]:[le]),c(F=>F>=t.length-1?0:F+1)};return a.jsxs("div",{ref:o,onClick:B,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),className:Mi.imageRevealSlider,style:{cursor:h==="none"?"default":"none"},children:[r.map(P=>a.jsx("div",{className:Mi.wrapper,style:{top:`${P.y}px`,left:`${P.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:P.width??"auto",height:"auto",cursor:h==="none"?"default":"none"},children:z==="area"&&P.link?a.jsx("a",{href:P.link,target:"_blank",className:Mi.link,children:a.jsx("img",{src:P.url,alt:P.name,className:Mi.image},P.id)}):a.jsx("img",{src:P.url,alt:P.name,className:Mi.image},P.id)},P.id)),C&&a.jsx("div",{className:Mi.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${w})`,backgroundImage:`url('${h}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Bm={element:Om,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:""}]}}}},zm="LightBox-module__hidden___9s-9x",jm="LightBox-module__heroImage___sTxNF",Vm="LightBox-module__background___rm9ml",Gm="LightBox-module__editor___4ACaY",Xm="LightBox-module__contentStyle___Bgnsq",Ym="LightBox-module__imageStyle___tLIlB",qm="LightBox-module__imgWrapper___LuFUp",Um="LightBox-module__contain___8-yaS",Km="LightBox-module__cover___hNvOG",Zm="LightBox-module__caption___b6L2I",Jm="LightBox-module__captionTextInner___rCGNH",Qm="LightBox-module__lightboxSplide___XFuWC",eg="LightBox-module__arrow___iz38X",tg="LightBox-module__arrowVertical___Zfz81",ng="LightBox-module__nextArrow___zkAQN",ig="LightBox-module__arrowInner___p48sW",og="LightBox-module__arrowIcon___3VaFf",rg="LightBox-module__arrowImg___pNV88",ag="LightBox-module__mirror___pjeXc",sg="LightBox-module__thumbsWrapper___GB-nU",lg="LightBox-module__thumbsContainerVertical___wttk5",cg="LightBox-module__thumbsContainer___osSma",dg="LightBox-module__thumbsAlignStart___MO6tY",ug="LightBox-module__thumbsAlignCenter___Q4sUx",pg="LightBox-module__thumbsAlignEnd___p4y9R",mg="LightBox-module__thumbItem___HvnF3",gg="LightBox-module__closeButton___g2khP",hg="LightBox-module__fadeIn___0m5GW",fg="LightBox-module__slideInLeft___gPYwC",yg="LightBox-module__slideInRight___S-pPp",xg="LightBox-module__slideInTop___DFdAj",vg="LightBox-module__slideInBottom___m27kZ",bg="LightBox-module__fadeOut___55qBR",wg="LightBox-module__slideOutLeft___NvU7P",Sg="LightBox-module__slideOutRight___SK7eC",Cg="LightBox-module__slideOutTop___Vgg0z",$g="LightBox-module__slideOutBottom___nJ0Ef",Tg="LightBox-module__scaleSlide___vZriG",Ke={hidden:zm,heroImage:jm,background:Vm,editor:Gm,contentStyle:Xm,imageStyle:Ym,imgWrapper:qm,contain:Um,cover:Km,caption:Zm,captionTextInner:Jm,lightboxSplide:Qm,arrow:eg,arrowVertical:tg,nextArrow:ng,arrowInner:ig,arrowIcon:og,arrowImg:rg,mirror:ag,thumbsWrapper:sg,thumbsContainerVertical:lg,thumbsContainer:cg,thumbsAlignStart:dg,thumbsAlignCenter:ug,thumbsAlignEnd:pg,thumbItem:mg,closeButton:gg,fadeIn:hg,slideInLeft:fg,slideInRight:yg,slideInTop:xg,slideInBottom:vg,fadeOut:bg,slideOutLeft:wg,slideOutRight:Sg,slideOutTop:Cg,slideOutBottom:$g,scaleSlide:Tg},lr=(e,t,n)=>{const i={},[o,r]=e.split("-");return o==="top"?(i.top="0",i.bottom="auto"):o==="middle"?(i.top="50%",i.bottom="auto"):o==="bottom"&&(i.top="auto",i.bottom="0"),r==="left"?(i.left="0",i.right="auto"):r==="center"?(i.left="50%",i.right="auto"):r==="right"&&(i.left="auto",i.right="0"),o==="middle"&&r==="center"?i.transform=`translate(calc(-50% + ${D.scalingValue(t.x,n)}), calc(-50% + ${D.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${D.scalingValue(t.x,n)}, calc(-50% + ${D.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${D.scalingValue(t.x,n)}), ${D.scalingValue(t.y,n)})`:i.transform=`translate(${D.scalingValue(t.x,n)}, ${D.scalingValue(t.y,n)})`,i};function Td(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 Ig(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 Id(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 Rg(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 Rd(e,t,n,i,o){const{x:r,y:l}=Ig(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function Lg(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"?Rg:Id,{renderedW:u,renderedH:p}=c(n,i,o,r),{offsetX:x,offsetY:w}=Rd(n,i,u,p,d),m=(x+u/2)/n*100,h=(w+p/2)/i*100;return`${m}% ${h}%`}function Pg(e){return Lg(e)}function Or(e){const t=e.getBoundingClientRect(),n=Td(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}=Id(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:x}=Rd(i,o,d,c,u),w=t.left+n.left,m=t.top+n.top;return{x:p+w,y:x+m,width:d,height:c}}function wl(e){const t=e.getBoundingClientRect(),n=Td(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Sl(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 Eg(e,t){const n=(()=>{if(e==="fade in")return Ke.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Ke.slideInLeft;case"right":return Ke.slideInRight;case"top":return Ke.slideInTop;case"bottom":return Ke.slideInBottom;default:return Ke.slideInRight}return Ke.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Ke.fadeIn;if(e==="slide in")switch(t){case"left":return Ke.slideInLeft;case"right":return Ke.slideInRight;case"top":return Ke.slideInTop;case"bottom":return Ke.slideInBottom;default:return Ke.slideInRight}return Ke.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Ke.fadeOut;if(e==="slide in")switch(t){case"left":return Ke.slideOutLeft;case"right":return Ke.slideOutRight;case"top":return Ke.slideOutTop;case"bottom":return Ke.slideOutBottom;default:return Ke.slideOutRight}return Ke.fadeOut})(),r=(()=>{if(e==="fade in")return Ke.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Ke.slideOutLeft;case"right":return Ke.slideOutRight;case"top":return Ke.slideOutTop;case"bottom":return Ke.slideOutBottom;default:return Ke.slideOutRight}return Ke.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:r}}const Mg=({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:Ke.heroImage,onClick:()=>c(!0)}),a.jsx(kg,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},kg=({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:x,wordSpacing:w,fontSizeLineHeight:m,textAppearance:h,color:f}=i.imageCaption??{},[v,C]=s.useState(0),[y,S]=s.useState(0),[G,W]=s.useState(!1),[U,H]=s.useState(!1),[I,z]=s.useState({}),$=s.useRef(null),T=s.useRef(null),A=s.useRef(null),_=s.useRef(!1),g=s.useRef(null),B=s.useRef(null),P=s.useRef(null),Y=s.useRef(null),ie=s.useRef(!1),L=s.useRef(null),[O,K]=s.useState(!1),{appear:ue,triggers:le,slider:F,thumbnail:pe,controls:j,area:se,caption:ne,layout:ve}=o.lightboxBlock,{appearClass:Me,backdropAppearClass:xe,backdropDisappearClass:b,disappearClass:M}=Eg(ue.type,ue.direction),E=(d==null?void 0:d.itemId)??null;s.useEffect(()=>{const Z=()=>{setTimeout(()=>{var ce,we;(we=(ce=$.current)==null?void 0:ce.splide)==null||we.refresh()},16)},Q=()=>{S(ce=>ce+1)};return window.addEventListener("ArticleEditor.Layout:change",Z),window.addEventListener("ArticleEditor.ComponentContent:change",Q),()=>{window.removeEventListener("ArticleEditor.Layout:change",Z),window.removeEventListener("ArticleEditor.ComponentContent:change",Q)}},[]),s.useEffect(()=>{if(!e||!pe.isActive){K(!1);return}const Z=L.current;if(!Z)return;const Q=()=>{F.direction==="horiz"?K(Z.scrollWidth>Z.clientWidth):K(Z.scrollHeight>Z.clientHeight)};Q();const ce=new ResizeObserver(Q);return ce.observe(Z),()=>ce.disconnect()},[e,pe.isActive,n.length,I,F.direction]);const V=s.useCallback(()=>{const Z=window.matchMedia("(max-width: 768px)").matches,Q=Sl(se.color);Z&&!l&&Q>.9&&(document.body.style.backgroundColor=""),W(!0),_.current=!0;const ce=we=>{we.target===g.current&&we.animationName&&(g.current&&B.current&&g.current.removeEventListener("animationend",B.current),B.current=null,_.current&&(_.current=!1,t()),W(!1))};g.current&&(B.current=ce,g.current.addEventListener("animationend",ce))},[t,se.color,l]),Se=(Z,Q,ce)=>{var we,Pe;if(Z){if(le.type==="click"&&le.switch==="image")le.repeat==="close"&&v===n.length-1?V():(we=$.current)==null||we.go("+1");else if(le.type==="click"&&le.switch==="50/50"){const Ce=Z.getBoundingClientRect(),X=Q-Ce.left,me=ce-Ce.top,ae=Ce.width,q=Ce.height;let de;F.direction==="horiz"?de=X<ae/2?"-1":"+1":de=me<q/2?"-1":"+1",(Pe=$.current)==null||Pe.go(de)}}},te=Z=>{if(ie.current){ie.current=!1;return}const Q=n[v],ce=(Q==null?void 0:Q.image.objectFit)==="cover";let we,Pe;if("changedTouches"in Z&&Z.changedTouches.length>0)we=Z.changedTouches[0].clientX,Pe=Z.changedTouches[0].clientY;else if("clientX"in Z)we=Z.clientX,Pe=Z.clientY;else return;let Ce;if(ce&&A.current){const X=wl(A.current);Ce=we>=X.left&&we<=X.right&&Pe>=X.top&&Pe<=X.bottom}else{const X=A.current?Or(A.current):null;if(!X){Z.target===Z.currentTarget&&V();return}Ce=we>=X.x&&we<=X.x+X.width&&Pe>=X.y&&Pe<=X.y+X.height}Ce?Se(A.current,we,Pe):V()},$e=Z=>{const Q=Z.target;(Q.classList.contains(Ke.thumbsWrapper)||Q.classList.contains(Ke.thumbsContainer))&&te(Z)};s.useEffect(()=>{if(!e)return;const Z=Q=>{var ce,we;if(Q.key==="Escape"){V();return}if(Q.key==="ArrowRight"){C(Pe=>(Pe+1)%Math.max(n.length,1)),(ce=$.current)==null||ce.go("+1");return}Q.key==="ArrowLeft"&&(C(Pe=>(Pe-1+Math.max(n.length,1))%Math.max(n.length,1)),(we=$.current)==null||we.go("-1"))};return window.addEventListener("keydown",Z),()=>{window.removeEventListener("keydown",Z)}},[e,V,n.length]),s.useEffect(()=>{if(e){if(C(0),S(Q=>Q+1),_.current=!1,W(!1),H(!1),z({}),!E)return;const Z=new CustomEvent("page-overlay",{detail:{itemId:E}});window.dispatchEvent(Z)}return()=>{g.current&&B.current&&(g.current.removeEventListener("animationend",B.current),B.current=null),H(!1)}},[e,E]),s.useEffect(()=>{T.current!==null&&T.current!==F.type&&S(Z=>Z+1),T.current=F.type},[F.type]),s.useEffect(()=>{if(!e)return;const Z=document.body.style.overflow,Q=window.matchMedia("(max-width: 768px)").matches,ce=Sl(se.color);document.body.style.overflow="hidden",H(!1);const we=Ce=>{Ce.target===g.current&&!_.current&&Ce.animationName&&(Q&&!l&&ce>.9&&(document.body.style.backgroundColor=se.color),H(!0),g.current&&P.current&&g.current.removeEventListener("animationend",P.current),P.current=null)};g.current&&(P.current=we,g.current.addEventListener("animationend",we));const Pe=Ce=>{const X=Ce.target;X&&(X.closest(`.${Ke.thumbsWrapper}`)||X.closest(`.${Ke.thumbsContainer}`))||F.type!=="slide"&&Ce.preventDefault()};return document.addEventListener("touchmove",Pe,{passive:!1}),()=>{document.body.style.overflow=Z,document.removeEventListener("touchmove",Pe),g.current&&P.current&&(g.current.removeEventListener("animationend",P.current),P.current=null),H(!1)}},[e,l,se.color,F.type]),s.useEffect(()=>{if(!e)return;const Z=Q=>{var we,Pe;if(_.current){Q.stopPropagation();return}if(ie.current){ie.current=!1;return}const ce=Q.target;if(!(ce&&(ce.closest(`.${Ke.thumbsContainer}`)||ce.closest(`.${Ke.thumbItem}`)||ce.closest(`.${Ke.arrow}`)||ce.closest(`.${Ke.closeButton}`)||ce.closest(`.${Ke.caption}`)))){if(F.type==="slide"&&le.type==="drag"&&((Pe=(we=$.current)==null?void 0:we.splide)!=null&&Pe.root)){const Ce=$.current.splide.root;if(ce&&(Ce.contains(ce)||Ce===ce))return}if(Q.touches.length===0&&Q.changedTouches.length>0){const Ce=n[v],X=(Ce==null?void 0:Ce.image.objectFit)==="cover",me=Q.changedTouches[0];let ae;if(X&&A.current){const q=wl(A.current);ae=me.clientX>=q.left&&me.clientX<=q.right&&me.clientY>=q.top&&me.clientY<=q.bottom}else{const q=A.current?Or(A.current):null;if(!q)return;ae=me.clientX>=q.x&&me.clientX<=q.x+q.width&&me.clientY>=q.y&&me.clientY<=q.y+q.height}if(!ae){Q.stopPropagation(),_.current=!0;const q=de=>{de.stopPropagation(),de.preventDefault(),document.removeEventListener("click",q,!0)};document.addEventListener("click",q,!0),V()}}}};return document.addEventListener("touchend",Z,{passive:!0}),()=>{document.removeEventListener("touchend",Z)}},[e,V,v,n]);const re=(F.type==="scale"||F.type==="fade")&&F.direction==="vert"&&le.type==="drag";s.useEffect(()=>{var de,ke;if(!e||!re||!((ke=(de=$.current)==null?void 0:de.splide)!=null&&ke.root))return;const Z=$.current.splide.root,Q=30,ce=(he,J)=>{if(Y.current){const Ne=Math.abs(he-Y.current.x),Fe=Math.abs(J-Y.current.y);(Ne>0||Fe>0)&&(ie.current=!0)}},we=he=>{Y.current&&(he.preventDefault(),ce(he.clientX,he.clientY))},Pe=he=>{Y.current&&he.touches.length>0&&(he.preventDefault(),ce(he.touches[0].clientX,he.touches[0].clientY))},Ce=(he,J)=>{if(!Y.current||!$.current){Y.current=null;return}const Ne=Math.abs(he-Y.current.x),Fe=Math.abs(J-Y.current.y);Fe>Q&&Fe>Ne&&$.current.go(J<Y.current.y?"+1":"-1"),Y.current=null},X=he=>{Y.current&&Ce(he.clientX,he.clientY),document.removeEventListener("pointerup",X),document.removeEventListener("pointercancel",X),document.removeEventListener("pointermove",we)},me=he=>{if(Y.current){if(he.changedTouches.length>0){const J=he.changedTouches[0];Ce(J.clientX,J.clientY)}document.removeEventListener("touchend",me),document.removeEventListener("touchcancel",me),document.removeEventListener("touchmove",Pe)}},ae=he=>{Y.current={x:he.clientX,y:he.clientY},ie.current=!1,document.addEventListener("pointermove",we,{passive:!1}),document.addEventListener("pointerup",X),document.addEventListener("pointercancel",X)},q=he=>{he.touches.length>0&&(Y.current={x:he.touches[0].clientX,y:he.touches[0].clientY},ie.current=!1,document.addEventListener("touchmove",Pe,{passive:!1}),document.addEventListener("touchend",me),document.addEventListener("touchcancel",me))};return Z.addEventListener("pointerdown",ae),Z.addEventListener("touchstart",q),()=>{Z.removeEventListener("pointerdown",ae),Z.removeEventListener("touchstart",q),document.removeEventListener("pointermove",we),document.removeEventListener("pointerup",X),document.removeEventListener("pointercancel",X),document.removeEventListener("touchmove",Pe),document.removeEventListener("touchend",me),document.removeEventListener("touchcancel",me),Y.current=null,ie.current=!1}},[e,re,y]);const ge={backgroundColor:se.color,backdropFilter:`blur(${se.blur}px)`,animationDuration:`${parseInt(ue.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(r)?null:zn.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:l?null:g,className:pt(Ke.background,G?b:xe,{[Ke.editor]:l},{[Ke.hidden]:!e}),style:{...ge,...U&&!l&&!G?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?g:null,className:pt(Ke.contentStyle,G?M:Me,{[Ke.editor]:l},{[Ke.hidden]:!e}),style:{animationDuration:`${parseInt(ue.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(zs,{onMove:Z=>C(Z.index),ref:$,className:Ke.lightboxSplide,options:{arrows:!1,speed:F.duration?parseInt(F.duration):500,direction:F.direction==="horiz"||F.type==="fade"||F.type==="scale"?"ltr":"ttb",pagination:!1,drag:le.type==="drag"&&!re,perPage:1,width:"100%",height:"100%",type:F.type==="fade"||F.type==="scale"?"fade":"loop",padding:0,rewind:le.repeat!=="close",start:0},style:{"--splide-speed":F.duration},children:n.map((Z,Q)=>{const ce=lr(ve.position,ve.offset,l),we=`${D.scalingValue(ve.padding.top,l)} ${D.scalingValue(ve.padding.right,l)} ${D.scalingValue(ve.padding.bottom,l)} ${D.scalingValue(ve.padding.left,l)}`,Pe=F.type==="scale"?(()=>{const{transform:Ce,...X}=ce;return{...X,position:"absolute",padding:we,boxSizing:"border-box","--position-transform":Ce||"none"}})():{...ce,position:"absolute",padding:we,boxSizing:"border-box"};return a.jsx(js,{children:a.jsx("div",{className:Ke.imgWrapper,onClick:te,children:a.jsx("img",{ref:Q===v?A:null,className:pt(Ke.imageStyle,{[Ke.contain]:Z.image.objectFit==="contain",[Ke.cover]:Z.image.objectFit==="cover",[Ke.scaleSlide]:F.type==="scale"}),src:Z.image.url,alt:Z.image.name??"",style:{...Pe,pointerEvents:Z.image.objectFit==="contain"?"none":"auto"}})})},Q)})},y),j.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(Ke.arrow,{[Ke.arrowVertical]:F.direction==="vert"}),style:{color:j.color,"--arrow-hover-color":j.hover},children:a.jsxs("button",{className:Ke.arrowInner,style:{transform:`translate(${D.scalingValue(j.offset.x,l)}, ${D.scalingValue(j.offset.y*(F.direction==="horiz"?1:-1),l)}) scale(${j.scale}) rotate(${F.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var Z;return(Z=$.current)==null?void 0:Z.go("-1")},"aria-label":"Previous",children:[j.arrowsImgUrl&&a.jsx(sn,{url:j.arrowsImgUrl,fill:j.color,hoverFill:j.hover,className:pt(Ke.arrowImg,Ke.mirror)}),!j.arrowsImgUrl&&a.jsx(Cl,{color:j.color,className:pt(Ke.arrowIcon,Ke.arrowImg,Ke.mirror)})]})}),a.jsx("div",{className:pt(Ke.arrow,Ke.nextArrow,{[Ke.arrowVertical]:F.direction==="vert"}),style:{color:j.color,"--arrow-hover-color":j.hover},children:a.jsxs("button",{className:Ke.arrowInner,style:{transform:`translate(${D.scalingValue(j.offset.x*(F.direction==="horiz"?-1:1),l)}, ${D.scalingValue(j.offset.y,l)}) scale(${j.scale}) rotate(${F.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var Z;return(Z=$.current)==null?void 0:Z.go("+1")},"aria-label":"Next",children:[j.arrowsImgUrl&&a.jsx(sn,{url:j.arrowsImgUrl,fill:j.color,hoverFill:j.hover,className:Ke.arrowImg}),!j.arrowsImgUrl&&a.jsx(Cl,{color:j.color,className:pt(Ke.arrowIcon,Ke.arrowImg)})]})})]}),se.closeIconUrl&&(()=>{const Z=lr(se.closeIconAlign,se.closeIconOffset,l),Q=`scale(${se.closeIconScale})`,ce=Z.transform?`${Z.transform} ${Q}`:Q;return a.jsx("button",{className:Ke.closeButton,style:{...Z,transform:ce},onClick:V,"aria-label":"Close lightbox",children:a.jsx(sn,{url:se.closeIconUrl,fill:se.closeIconColor??"#000000",hoverFill:se.closeIconHover??"#cccccc"})})})(),ne&&ne.isActive&&i.imageCaption&&((ye=n[v])==null?void 0:ye.imageCaption)&&a.jsx("div",{className:Ke.caption,style:{...lr(ne.alignment,ne.offset,l),fontFamily:po(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":D.scalingValue(c.width,l),letterSpacing:D.scalingValue(p,l),wordSpacing:D.scalingValue(w,l),textAlign:x,fontSize:D.scalingValue(m.fontSize,l),lineHeight:D.scalingValue(m.lineHeight,l),textTransform:h.textTransform??"none",textDecoration:h.textDecoration??"none",fontVariant:h.fontVariant??"normal",color:f},onClick:Z=>Z.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:Ke.captionTextInner,style:{"--link-color":ne.linkColor,"--link-hover-color":ne.linkHoverColor},children:a.jsx(Ri,{content:n[v].imageCaption})})}),pe.isActive&&(()=>{const[Z,Q]=pe.position.split("-"),ce=F.direction==="horiz"?`${Z}-left`:pe.position,we=lr(ce,pe.offset,l),Pe=()=>{if(F.direction==="horiz"){if(Q==="left")return"flex-start";if(Q==="center")return"center";if(Q==="right")return"flex-end"}else{if(Z==="top")return"flex-start";if(Z==="middle")return"center";if(Z==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:L,className:Ke.thumbsWrapper,onClick:Ce=>$e(Ce),style:{position:l?"absolute":"fixed",...we,...F.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:pt(Ke.thumbsContainer,{[Ke.thumbsContainerVertical]:F.direction==="vert",[Ke.thumbsAlignStart]:pe.align==="start",[Ke.thumbsAlignCenter]:pe.align==="center",[Ke.thumbsAlignEnd]:pe.align==="end"}),style:{gap:D.scalingValue(pe.grid.gap,l),justifyContent:O?"flex-start":Pe()},children:n.map((Ce,X)=>{const me=X===v,ae=I[X],de=pe.grid.size*(me?pe.activeState.scale:1),ke=()=>{if(pe.fit!=="fit")return{};if(!ae)return F.direction==="horiz"?{height:D.scalingValue(de,l)}:{width:D.scalingValue(de,l)};const he=ae.width/ae.height;if(F.direction==="horiz"){const J=de,Ne=J*he;return{width:D.scalingValue(Ne,l),height:D.scalingValue(J,l)}}else{const J=de,Ne=J/he;return{width:D.scalingValue(J,l),height:D.scalingValue(Ne,l)}}};return a.jsx("button",{className:Ke.thumbItem,style:{...F.direction==="horiz"&&pe.fit!=="fit"?{height:D.scalingValue(de,l)}:{},...F.direction==="vert"&&pe.fit!=="fit"?{width:D.scalingValue(de,l)}:{},...pe.fit==="cover"?{width:D.scalingValue(de,l),height:D.scalingValue(de,l)}:{},...ke(),transition:me?"all 0.25s ease-out":"none",opacity:me?pe.activeState.opacity/100:pe.opacity/100,"--thumb-hover":pe.activeState.opacity/100},onClick:he=>{var J;he.stopPropagation(),C(X),(J=$.current)==null||J.go(X)},onMouseEnter:()=>{var he;pe.triggers==="hov"&&((he=$.current)==null||he.go(X))},children:a.jsx("img",{src:Ce.image.url,alt:Ce.image.name??"",onLoad:he=>{const J=he.currentTarget;J.naturalWidth&&J.naturalHeight&&z(Ne=>({...Ne,[X]:{width:J.naturalWidth,height:J.naturalHeight}}))},style:{objectFit:pe.fit==="cover"?"cover":"contain",...pe.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...pe.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Ce.image.name}-${X}`)})})})})()]})]}),document.getElementById(r))};function Cl({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 Ag={element:Mg,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 cr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Fg(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 Fg({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:r}){const l=!!n,d=i&&t||!t,{prefix:c}=D.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:x=[],buttonLabel:w,gap:m,fieldsGap:h,buttonCorners:f,buttonStroke:v,buttonPadding:C,isButtonFullWidth:y,inputCorners:S,inputStroke:V,inputPadding:N,inputColor:q,inputTextColor:W,inputBorderColor:I,placeholderColor:B,buttonColor:$,buttonTextColor:T,buttonBorderColor:k,labelTextColor:F,successColor:g,errorColor:O,fontFamily:P,inputFontSettings:X,inputFontSize:te,inputLineHeight:L,inputLetterSpacing:H,inputWordSpacing:U,inputTextAppearance:de,buttonFontSettings:ae,buttonFontSize:A,buttonLineHeight:ce,buttonLetterSpacing:z,buttonWordSpacing:re,buttonTextAppearance:ee,labelFontSettings:xe,labelFontSize:Fe,labelLineHeight:ye,labelLetterSpacing:b,labelWordSpacing:M,labelTextAppearance:E,statusFontSettings:j,statusFontSize:Ce,statusLineHeight:Q,statusLetterSpacing:Te,statusWordSpacing:ie,statusTextAppearance:ue,successMessage:fe,errorMessage:K,stateOverrides:Z}=e,se=u==="B",Se=x.slice(0,Math.min(p,x.length)),Me={fontSettings:{fontFamily:P,fontWeight:(X==null?void 0:X.fontWeight)??400,fontStyle:(X==null?void 0:X.fontStyle)??"normal"},fontSize:te??.01,lineHeight:L,letterSpacing:H??0,wordSpacing:U??0,textAppearance:de,color:W},$e=an(Ut(Me,t)),G=D.scalingValue(V??0,t),pe=D.scalingValue((L??te??.01)+((N==null?void 0:N.top)??0)+((N==null?void 0:N.bottom)??0)+(u==="C"?V??0:(V??0)*2),t),oe={...$e,borderStyle:"solid",borderRadius:u==="C"?0:D.scalingValue(S??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:G,borderLeftWidth:0}:{borderWidth:G},paddingTop:D.scalingValue((N==null?void 0:N.top)??0,t),paddingRight:D.scalingValue((N==null?void 0:N.right)??0,t),paddingBottom:D.scalingValue((N==null?void 0:N.bottom)??0,t),paddingLeft:D.scalingValue((N==null?void 0:N.left)??0,t),height:pe,minHeight:pe},Y={fontSettings:{fontFamily:P,fontWeight:(ae==null?void 0:ae.fontWeight)??400,fontStyle:(ae==null?void 0:ae.fontStyle)??"normal"},fontSize:A??.01,lineHeight:ce,letterSpacing:z??0,wordSpacing:re??0,textAppearance:ee,color:T},le=an(Ut(Y,t)),_e=D.scalingValue(v??0,t),me={fontSettings:{fontFamily:P,fontWeight:(xe==null?void 0:xe.fontWeight)??400,fontStyle:(xe==null?void 0:xe.fontStyle)??"normal"},fontSize:Fe??.01,lineHeight:ye,letterSpacing:b??0,wordSpacing:M??0,textAppearance:E,color:F},J=Ut(me,t),Ke={fontSettings:{fontFamily:P,fontWeight:(j==null?void 0:j.fontWeight)??400,fontStyle:(j==null?void 0:j.fontStyle)??"normal"},fontSize:Ce??.01,lineHeight:Q,letterSpacing:Te??0,wordSpacing:ie??0,textAppearance:ue,color:g},ke=an(Ut(Ke,t)),tt=D.buildColorVars(c,{inputColor:q,inputTextColor:W,inputBorderColor:I,placeholderColor:B!=null&&B.trim()?B:"#cccccc",buttonColor:$,buttonTextColor:T,buttonBorderColor:k,labelTextColor:F,successColor:g,errorColor:O},_g,Ng,Z),[Ye,dt]=s.useState(()=>Object.fromEntries(Se.map(Le=>[Le.name,""]))),[ot,Ve]=s.useState("idle"),[Re,He]=s.useState(null),Be=r==="success"?"success":r==="error"?"error":ot,Ze=r==="error"?K:Re,he=r==="filled",ve=s.useMemo(()=>{if(!he)return Ye;let Le=null;for(const Ge of Se)(Ye[Ge.name]??"").trim().length>0||(Le=Le??{...Ye},Le[Ge.name]="Filled");return Le??Ye},[Ye,he,Se]),We=Be==="error"?D.getFormFieldValidationError(Se,ve):null,be=`${r&&r!=="default"?`${c}-state-${r}`:""}`.trim(),Ie=o==null?void 0:o.submitUrl,qe=(Le,Ge)=>{dt(De=>({...De,[Le]:Ge}))},ze=async Le=>{if(Le.preventDefault(),!d)return;const Ge=Object.fromEntries(Se.map(nt=>{var it;return[nt.name,((it=Ye[nt.name])==null?void 0:it.trim())??""]}).filter(([,nt])=>nt));if(!Ie){Ve("error"),He("No integrations were found for this form.");return}if(Object.keys(Ge).length===0)return;const De=D.getFormFieldValidationError(Se,Ye);if(De){Ve("error"),He(De);return}Ve("submitting"),He(null);try{const nt=await fetch(Ie,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ge)});if(!nt.ok){const it=await nt.text();throw new Error(it||`Request failed: ${nt.status}`)}Ve("success"),dt(Object.fromEntries(Se.map(it=>[it.name,""])))}catch(nt){Ve("error"),He(nt instanceof Error?nt.message:"Something went wrong")}};return a.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${be}`.trim(),style:tt,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ag(c)}}),a.jsxs("form",{onSubmit:ze,className:`${c}-form`,children:[a.jsx("div",{className:`${c}-fields`,children:Se.map((Le,Ge)=>a.jsxs(s.Fragment,{children:[Ge>0&&a.jsx("div",{"data-controls":l?"fieldsGap":void 0,className:l?`${c}-control`:void 0,style:{height:D.scalingValue(h??0,t)}}),a.jsxs("div",{className:`${c}-field-group${se?` ${c}-labeled`:""}`,children:[se&&a.jsx("span",{className:`${c}-field-label`,style:J?{...J,lineHeight:J.fontSize}:void 0,children:Le.label||Le.name}),Le.type==="textarea"?a.jsx("textarea",{name:Le.name,autoComplete:"off",value:ve[Le.name]??"",onChange:De=>qe(Le.name,De.target.value),placeholder:Le.placeholder,className:`${c}-input`,style:oe,rows:1,"data-filled":he||(ve[Le.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:Le.type==="phone"?"tel":Le.type==="email"?"email":"text",name:Le.name,autoComplete:"off",value:ve[Le.name]??"",onChange:De=>qe(Le.name,De.target.value),placeholder:Le.placeholder,required:Le.isRequired??Le.type==="email",className:`${c}-input`,style:oe,"data-filled":he||(ve[Le.name]??"").trim().length>0})]})]},Ge))}),a.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${c}-control`:void 0,style:{height:D.scalingValue(m??0,t)}}),a.jsx("div",{className:`${c}-overlay-anchor`,children:a.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:D.scalingValue(f??0,t),borderWidth:_e,paddingTop:D.scalingValue((C==null?void 0:C.top)??0,t),paddingRight:D.scalingValue((C==null?void 0:C.right)??0,t),paddingBottom:D.scalingValue((C==null?void 0:C.bottom)??0,t),paddingLeft:D.scalingValue((C==null?void 0:C.left)??0,t),pointerEvents:d?"auto":void 0,...le,...y?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:a.jsx("span",{className:`${c}-overlay-anchor`,style:y?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:ot==="submitting"?"...":w})})})]}),Be==="success"&&a.jsx("p",{className:`${c}-success`,style:{...ke},children:fe}),Be==="error"&&a.jsx("p",{className:`${c}-error`,style:{...ke},role:"alert",children:We??Ze??K})]})}const _g={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"},Ng=["hover","focus","filled","success","error"],Wg=`import React, { useMemo, useState } from 'react';
158
+ `}function _g({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:r}){const l=!!n,d=i&&t||!t,{prefix:c}=D.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:x=[],buttonLabel:w,gap:m,fieldsGap:h,buttonCorners:f,buttonStroke:v,buttonPadding:C,isButtonFullWidth:y,inputCorners:S,inputStroke:G,inputPadding:W,inputColor:U,inputTextColor:H,inputBorderColor:I,placeholderColor:z,buttonColor:$,buttonTextColor:T,buttonBorderColor:A,labelTextColor:_,successColor:g,errorColor:B,fontFamily:P,inputFontSettings:Y,inputFontSize:ie,inputLineHeight:L,inputLetterSpacing:O,inputWordSpacing:K,inputTextAppearance:ue,buttonFontSettings:le,buttonFontSize:F,buttonLineHeight:pe,buttonLetterSpacing:j,buttonWordSpacing:se,buttonTextAppearance:ne,labelFontSettings:ve,labelFontSize:Me,labelLineHeight:xe,labelLetterSpacing:b,labelWordSpacing:M,labelTextAppearance:E,statusFontSettings:V,statusFontSize:Se,statusLineHeight:te,statusLetterSpacing:$e,statusWordSpacing:re,statusTextAppearance:ge,successMessage:ye,errorMessage:Z,stateOverrides:Q}=e,ce=u==="B",we=x.slice(0,Math.min(p,x.length)),Pe={fontSettings:{fontFamily:P,fontWeight:(Y==null?void 0:Y.fontWeight)??400,fontStyle:(Y==null?void 0:Y.fontStyle)??"normal"},fontSize:ie??.01,lineHeight:L,letterSpacing:O??0,wordSpacing:K??0,textAppearance:ue,color:H},Ce=an(qt(Pe,t)),X=D.scalingValue(G??0,t),me=D.scalingValue((L??ie??.01)+((W==null?void 0:W.top)??0)+((W==null?void 0:W.bottom)??0)+(u==="C"?G??0:(G??0)*2),t),ae={...Ce,borderStyle:"solid",borderRadius:u==="C"?0:D.scalingValue(S??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:X,borderLeftWidth:0}:{borderWidth:X},paddingTop:D.scalingValue((W==null?void 0:W.top)??0,t),paddingRight:D.scalingValue((W==null?void 0:W.right)??0,t),paddingBottom:D.scalingValue((W==null?void 0:W.bottom)??0,t),paddingLeft:D.scalingValue((W==null?void 0:W.left)??0,t),height:me,minHeight:me},q={fontSettings:{fontFamily:P,fontWeight:(le==null?void 0:le.fontWeight)??400,fontStyle:(le==null?void 0:le.fontStyle)??"normal"},fontSize:F??.01,lineHeight:pe,letterSpacing:j??0,wordSpacing:se??0,textAppearance:ne,color:T},de=an(qt(q,t)),ke=D.scalingValue(v??0,t),he={fontSettings:{fontFamily:P,fontWeight:(ve==null?void 0:ve.fontWeight)??400,fontStyle:(ve==null?void 0:ve.fontStyle)??"normal"},fontSize:Me??.01,lineHeight:xe,letterSpacing:b??0,wordSpacing:M??0,textAppearance:E,color:_},J=qt(he,t),Ne={fontSettings:{fontFamily:P,fontWeight:(V==null?void 0:V.fontWeight)??400,fontStyle:(V==null?void 0:V.fontStyle)??"normal"},fontSize:Se??.01,lineHeight:te,letterSpacing:$e??0,wordSpacing:re??0,textAppearance:ge,color:g},Fe=an(qt(Ne,t)),et=D.buildColorVars(c,{inputColor:U,inputTextColor:H,inputBorderColor:I,placeholderColor:z!=null&&z.trim()?z:"#cccccc",buttonColor:$,buttonTextColor:T,buttonBorderColor:A,labelTextColor:_,successColor:g,errorColor:B},Ng,Wg,Q),[Je,dt]=s.useState(()=>Object.fromEntries(we.map(_e=>[_e.name,""]))),[tt,De]=s.useState("idle"),[Ie,We]=s.useState(null),je=r==="success"?"success":r==="error"?"error":tt,Ue=r==="error"?Z:Ie,k=r==="filled",ee=s.useMemo(()=>{if(!k)return Je;let _e=null;for(const qe of we)(Je[qe.name]??"").trim().length>0||(_e=_e??{...Je},_e[qe.name]="Filled");return _e??Je},[Je,k,we]),Te=je==="error"?D.getFormFieldValidationError(we,ee):null,Be=`${r&&r!=="default"?`${c}-state-${r}`:""}`.trim(),Ve=o==null?void 0:o.submitUrl,rt=(_e,qe)=>{dt(Oe=>({...Oe,[_e]:qe}))},Ze=async _e=>{if(_e.preventDefault(),!d)return;const qe=Object.fromEntries(we.map(nt=>{var at;return[nt.name,((at=Je[nt.name])==null?void 0:at.trim())??""]}).filter(([,nt])=>nt));if(!Ve){De("error"),We("No integrations were found for this form.");return}if(Object.keys(qe).length===0)return;const Oe=D.getFormFieldValidationError(we,Je);if(Oe){De("error"),We(Oe);return}De("submitting"),We(null);try{const nt=await fetch(Ve,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(qe)});if(!nt.ok){const at=await nt.text();throw new Error(at||`Request failed: ${nt.status}`)}De("success"),dt(Object.fromEntries(we.map(at=>[at.name,""])))}catch(nt){De("error"),We(nt instanceof Error?nt.message:"Something went wrong")}};return a.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${Be}`.trim(),style:et,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Fg(c)}}),a.jsxs("form",{onSubmit:Ze,className:`${c}-form`,children:[a.jsx("div",{className:`${c}-fields`,children:we.map((_e,qe)=>a.jsxs(s.Fragment,{children:[qe>0&&a.jsx("div",{"data-controls":l?"fieldsGap":void 0,className:l?`${c}-control`:void 0,style:{height:D.scalingValue(h??0,t)}}),a.jsxs("div",{className:`${c}-field-group${ce?` ${c}-labeled`:""}`,children:[ce&&a.jsx("span",{className:`${c}-field-label`,style:J?{...J,lineHeight:J.fontSize}:void 0,children:_e.label||_e.name}),_e.type==="textarea"?a.jsx("textarea",{name:_e.name,autoComplete:"off",value:ee[_e.name]??"",onChange:Oe=>rt(_e.name,Oe.target.value),placeholder:_e.placeholder,className:`${c}-input`,style:ae,rows:1,"data-filled":k||(ee[_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:ee[_e.name]??"",onChange:Oe=>rt(_e.name,Oe.target.value),placeholder:_e.placeholder,required:_e.isRequired??_e.type==="email",className:`${c}-input`,style:ae,"data-filled":k||(ee[_e.name]??"").trim().length>0})]})]},qe))}),a.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${c}-control`:void 0,style:{height:D.scalingValue(m??0,t)}}),a.jsx("div",{className:`${c}-overlay-anchor`,children:a.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:D.scalingValue(f??0,t),borderWidth:ke,paddingTop:D.scalingValue((C==null?void 0:C.top)??0,t),paddingRight:D.scalingValue((C==null?void 0:C.right)??0,t),paddingBottom:D.scalingValue((C==null?void 0:C.bottom)??0,t),paddingLeft:D.scalingValue((C==null?void 0:C.left)??0,t),pointerEvents:d?"auto":void 0,...de,...y?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:a.jsx("span",{className:`${c}-overlay-anchor`,style:y?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:tt==="submitting"?"...":w})})})]}),je==="success"&&a.jsx("p",{className:`${c}-success`,style:{...Fe},children:ye}),je==="error"&&a.jsx("p",{className:`${c}-error`,style:{...Fe},role:"alert",children:Te??Ue??Z})]})}const Ng={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"},Wg=["hover","focus","filled","success","error"],Hg=`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';
@@ -789,7 +789,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
789
789
  };
790
790
 
791
791
  const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
792
- `,Hg=[{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."},{name:"message",type:"textarea",placeholder:"Enter your message",label:"Message",isRequired:!1,error:"Message is required"},{name:"message2",type:"textarea",placeholder:"Enter your message 2",label:"Message 2",isRequired:!1,error:"Message 2 is required"},{name:"message3",type:"textarea",placeholder:"Enter your message 3",label:"Message 3",isRequired:!1,error:"Message 3 is required"}],dr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Dg=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],Og={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:7},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B","C"]},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",enabled:!0},min:0,max:100},buttonPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},inputPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},buttonStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"common",title:"Stroke Input",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},isButtonFullWidth:{type:"boolean",scope:"common",title:"Full Width",display:{type:"toggle",enum:["On","Off"]}},buttonBorderColor:{type:"string",scope:"common",title:"Stroke Button",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker",visible:!1}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...dr.fontSettings,scope:"common",title:"Input",display:{type:"font-settings-weight"}},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...dr.fontSettings,scope:"common",title:"Button",display:{type:"font-settings-weight"}},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},labelFontSettings:{...dr.fontSettings,scope:"common",title:"Label",display:{type:"font-settings-weight",visible:!1}},labelFontSize:{type:"number",scope:"layout",title:"Label Font Size",display:{type:"font-size",visible:!1}},labelLineHeight:{type:"number",scope:"layout",title:"Label Line Height",display:{type:"line-height-input",visible:!1}},labelLetterSpacing:{type:"number",scope:"layout",title:"Label Letter Spacing",display:{type:"letter-spacing-input",visible:!1}},labelWordSpacing:{type:"number",scope:"layout",title:"Label Word Spacing",display:{type:"word-spacing-input",visible:!1}},labelTextAppearance:{type:"object",scope:"layout",title:"Label Text Appearance",display:{type:"text-appearance",visible:!1}},statusFontSettings:{...dr.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fieldsToShow:2,fields:Hg,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#A7A7A7",placeholderColor:"#808080",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",buttonBorderColor:"#0A00F8",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{hover:{buttonColor:"#194EFF"}},fontFamily:"Arial",inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},labelFontSettings:{fontWeight:400,fontStyle:"normal"},labelLetterSpacing:0,labelWordSpacing:0,labelTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},isButtonFullWidth:!0,buttonLabel:"Sign up",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."},layoutDefaults:{m:{gap:.032,fieldsGap:.032,buttonStroke:0,buttonCorners:.192,inputStroke:.003,inputCorners:.192,buttonPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0426,buttonLineHeight:.0426,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},t:{gap:.02604,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.039,buttonPadding:{top:.0195,right:.02604,bottom:.0195,left:.0195},inputPadding:{top:.0195,right:.0195,bottom:.0195,left:.0195},inputFontSize:.02083,inputLineHeight:.02604,buttonFontSize:.02083,buttonLineHeight:.02604,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01},d:{gap:.0083,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.05,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.01,buttonLineHeight:.01,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"type",value:"B"},then:{name:"properties.labelTextColor.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSettings.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSize.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLineHeight.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLetterSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelWordSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelTextAppearance.display.visible",value:!0}},{if:{name:"type",value:"C"},then:{name:"properties.buttonCorners.display.enabled",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.enabled",value:!1}},{if:{name:"buttonStroke",value:0},then:{name:"properties.buttonBorderColor.display.visible",value:!1}},{if:{name:"inputStroke",value:0},then:{name:"properties.inputBorderColor.display.visible",value:!1}},{if:{name:"fieldsToShow",value:1},then:{name:"properties.fieldsGap.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:["inputCorners","inputPadding"]},{type:"row",title:"",items:["fieldsToShow","inputStroke"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["buttonCorners","buttonPadding"]},{type:"row",title:"",items:["buttonStroke","isButtonFullWidth"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Dg],panelIds:["general","typeStyle"],stateItems:{default:["placeholderColor","inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor","labelTextColor"],hover:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],focus:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],filled:["inputTextColor","inputColor","inputBorderColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},Bg={element:Fg,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Stacked.png"},defaultSize:{d:{width:300},t:{width:300},m:{width:340}},schema:Og,sourceCode:Wg,fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",labelFontSettings:"fontFamily",statusFontSettings:"fontFamily"},assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]}};function ur(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function zg(e){return`
792
+ `,Dg=[{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."},{name:"message",type:"textarea",placeholder:"Enter your message",label:"Message",isRequired:!1,error:"Message is required"},{name:"message2",type:"textarea",placeholder:"Enter your message 2",label:"Message 2",isRequired:!1,error:"Message 2 is required"},{name:"message3",type:"textarea",placeholder:"Enter your message 3",label:"Message 3",isRequired:!1,error:"Message 3 is required"}],dr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Og=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],Bg={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:7},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B","C"]},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",enabled:!0},min:0,max:100},buttonPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},inputPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},buttonStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"common",title:"Stroke Input",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},isButtonFullWidth:{type:"boolean",scope:"common",title:"Full Width",display:{type:"toggle",enum:["On","Off"]}},buttonBorderColor:{type:"string",scope:"common",title:"Stroke Button",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker",visible:!1}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...dr.fontSettings,scope:"common",title:"Input",display:{type:"font-settings-weight"}},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...dr.fontSettings,scope:"common",title:"Button",display:{type:"font-settings-weight"}},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},labelFontSettings:{...dr.fontSettings,scope:"common",title:"Label",display:{type:"font-settings-weight",visible:!1}},labelFontSize:{type:"number",scope:"layout",title:"Label Font Size",display:{type:"font-size",visible:!1}},labelLineHeight:{type:"number",scope:"layout",title:"Label Line Height",display:{type:"line-height-input",visible:!1}},labelLetterSpacing:{type:"number",scope:"layout",title:"Label Letter Spacing",display:{type:"letter-spacing-input",visible:!1}},labelWordSpacing:{type:"number",scope:"layout",title:"Label Word Spacing",display:{type:"word-spacing-input",visible:!1}},labelTextAppearance:{type:"object",scope:"layout",title:"Label Text Appearance",display:{type:"text-appearance",visible:!1}},statusFontSettings:{...dr.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fieldsToShow:2,fields:Dg,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#A7A7A7",placeholderColor:"#808080",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",buttonBorderColor:"#0A00F8",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{hover:{buttonColor:"#194EFF"}},fontFamily:"Arial",inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},labelFontSettings:{fontWeight:400,fontStyle:"normal"},labelLetterSpacing:0,labelWordSpacing:0,labelTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},isButtonFullWidth:!0,buttonLabel:"Sign up",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."},layoutDefaults:{m:{gap:.032,fieldsGap:.032,buttonStroke:0,buttonCorners:.192,inputStroke:.003,inputCorners:.192,buttonPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0426,buttonLineHeight:.0426,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},t:{gap:.02604,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.039,buttonPadding:{top:.0195,right:.02604,bottom:.0195,left:.0195},inputPadding:{top:.0195,right:.0195,bottom:.0195,left:.0195},inputFontSize:.02083,inputLineHeight:.02604,buttonFontSize:.02083,buttonLineHeight:.02604,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01},d:{gap:.0083,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.05,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.01,buttonLineHeight:.01,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"type",value:"B"},then:{name:"properties.labelTextColor.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSettings.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSize.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLineHeight.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLetterSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelWordSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelTextAppearance.display.visible",value:!0}},{if:{name:"type",value:"C"},then:{name:"properties.buttonCorners.display.enabled",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.enabled",value:!1}},{if:{name:"buttonStroke",value:0},then:{name:"properties.buttonBorderColor.display.visible",value:!1}},{if:{name:"inputStroke",value:0},then:{name:"properties.inputBorderColor.display.visible",value:!1}},{if:{name:"fieldsToShow",value:1},then:{name:"properties.fieldsGap.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:["inputCorners","inputPadding"]},{type:"row",title:"",items:["fieldsToShow","inputStroke"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["buttonCorners","buttonPadding"]},{type:"row",title:"",items:["buttonStroke","isButtonFullWidth"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Og],panelIds:["general","typeStyle"],stateItems:{default:["placeholderColor","inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor","labelTextColor"],hover:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],focus:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],filled:["inputTextColor","inputColor","inputBorderColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},zg={element:_g,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Stacked.png"},defaultSize:{d:{width:300},t:{width:300},m:{width:340}},schema:Bg,sourceCode:Hg,fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",labelFontSettings:"fontFamily",statusFontSettings:"fontFamily"},assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]}};function ur(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function jg(e){return`
793
793
  .${e}-wrapper {
794
794
  display: flex;
795
795
  flex-direction: column;
@@ -982,7 +982,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
982
982
  font-size: ${ur(14)};
983
983
  color: var(--${e}-error-error-color, var(--${e}-error-color));
984
984
  }
985
- `}const jg=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:r}=D.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:x,inputFontSettings:w,inputFontSize:m,inputLineHeight:h,inputLetterSpacing:f,inputWordSpacing:v,inputTextAppearance:C,buttonFontSettings:y,buttonFontSize:S,buttonLineHeight:V,buttonLetterSpacing:N,buttonWordSpacing:q,buttonTextAppearance:W,statusFontSettings:I,statusFontSize:B,statusLineHeight:$,statusLetterSpacing:T,statusWordSpacing:k,statusTextAppearance:F,iconMaxWidth:g,minHeight:O,corners:P,stroke:X,stateOverrides:te,inputPadding:L,buttonPadding:H,successMessage:U="Thanks for subscribing!",errorMessage:de="Please, fill all required fields."}=e,ae=d.slice(0,Math.min(p,d.length)),[A,ce]=s.useState(()=>Object.fromEntries(ae.map(me=>[me.name,""]))),[z,re]=s.useState("idle"),[ee,xe]=s.useState(null),Fe=o==="success"?"success":o==="error"?"error":z,ye=o==="error"?de:ee,b=o==="filled",M=s.useMemo(()=>{if(!b)return A;let me=null;for(const J of ae)(A[J.name]??"").trim().length>0||(me=me??{...A},me[J.name]="Filled");return me??A},[b,A,ae]),E=Fe==="error"?D.getFormFieldValidationError(ae,M):null,j=o&&o!=="default"?`${r}-state-${o}`:"",Ce=ae.some(me=>(M[me.name]??"").trim().length>0),Q=j!==`${r}-state-filled`&&Ce?`${r}-state-filled`:"",Te=`${j} ${Q}`.trim(),ie=i==null?void 0:i.submitUrl,ue=u??"",fe=(c==null?void 0:c.icon)??"",K=(c==null?void 0:c.mode)==="On",Z=ue||"Submit",se={fontSettings:{fontFamily:x,fontWeight:(w==null?void 0:w.fontWeight)??400,fontStyle:(w==null?void 0:w.fontStyle)??"normal"},fontSize:m??.01,lineHeight:h,letterSpacing:f??0,wordSpacing:v??0,textAppearance:C,color:e.inputTextColor??"#111111"},Se={fontSettings:{fontFamily:x,fontWeight:(y==null?void 0:y.fontWeight)??400,fontStyle:(y==null?void 0:y.fontStyle)??"normal"},fontSize:S??.01,lineHeight:V,letterSpacing:N??0,wordSpacing:q??0,textAppearance:W,color:e.buttonTextColor??"#ffffff"},Me={fontSettings:{fontFamily:x,fontWeight:(I==null?void 0:I.fontWeight)??400,fontStyle:(I==null?void 0:I.fontStyle)??"normal"},fontSize:B??.01,lineHeight:$,letterSpacing:T??0,wordSpacing:k??0,textAppearance:F,color:e.successColor??"#22c55e"},$e=an(Ut(se,t)),G=an(Ut(Se,t)),pe=an(Ut(Me,t)),oe=D.buildColorVars(r,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(se==null?void 0:se.color)??"#111111",buttonTextColor:e.buttonTextColor??(Se==null?void 0:Se.color)??"#ffffff"},Vg,Gg,te),Y={borderRadius:D.scalingValue(P,t),borderWidth:D.scalingValue(X,t),borderStyle:"solid"},le={borderLeftWidth:D.scalingValue(X,t)},_e=async me=>{if(me.preventDefault(),!l)return;const J=Object.fromEntries(ae.map(ke=>{var tt;return[ke.name,((tt=A[ke.name])==null?void 0:tt.trim())??""]}).filter(([,ke])=>ke));if(!ie){re("error"),xe("No integrations were found for this form.");return}if(Object.keys(J).length===0)return;const Ke=D.getFormFieldValidationError(ae,A);if(Ke){re("error"),xe(Ke);return}re("submitting"),xe(null);try{const ke=await fetch(ie,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)});if(!ke.ok){const tt=await ke.text();throw new Error(tt||`Request failed: ${ke.status}`)}re("success"),ce(Object.fromEntries(ae.map(tt=>[tt.name,""])))}catch(ke){re("error"),xe(ke instanceof Error?ke.message:"Something went wrong")}};return a.jsxs("div",{className:`${r}-wrapper ${Te}`.trim(),style:oe,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:zg(r)}}),a.jsxs("form",{onSubmit:_e,className:`${r}-form`,style:{...Y,height:D.scalingValue(O,t),minHeight:D.scalingValue(O,t)},children:[a.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:ae.map(me=>a.jsx("input",{type:me.type==="email"?"email":me.type==="phone"?"tel":"text",name:me.name,autoComplete:"off",value:M[me.name]??"",onChange:J=>ce(Ke=>({...Ke,[me.name]:J.target.value})),placeholder:me.placeholder,required:me.isRequired??me.type==="email",className:`${r}-input`,style:{...$e,paddingRight:D.scalingValue(L.right,t),paddingLeft:D.scalingValue(L.left,t),paddingTop:D.scalingValue(L.top,t),paddingBottom:D.scalingValue(L.bottom,t)}},me.name))}),a.jsx("div",{className:`${r}-overlayAnchor`,children:a.jsx("button",{type:l?"submit":"button",className:`${r}-submitBtn`,"aria-label":Z,style:{...G,...le,paddingRight:D.scalingValue(H.right,t),paddingLeft:D.scalingValue(H.left,t),paddingTop:D.scalingValue(H.top,t),paddingBottom:D.scalingValue(H.bottom,t),pointerEvents:l?"auto":void 0},children:z==="submitting"?"...":K?fe&&a.jsx(sn,{url:fe,className:`${r}-submitBtnIcon`,style:{maxWidth:D.scalingValue(g??0,t)},fill:`var(--${r}-button-text-color)`,hoverFill:`var(--${r}-button-text-color)`}):ue})})]}),Fe==="success"&&a.jsx("p",{className:`${r}-success`,style:{...pe},children:U}),Fe==="error"&&a.jsx("p",{className:`${r}-error`,style:{...pe},role:"alert",children:E??ye??de})]})},Vg={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"},Gg=["hover","focus","filled","success","error"],Xg=`import React, { useMemo, useState } from 'react';
985
+ `}const Vg=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:r}=D.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:x,inputFontSettings:w,inputFontSize:m,inputLineHeight:h,inputLetterSpacing:f,inputWordSpacing:v,inputTextAppearance:C,buttonFontSettings:y,buttonFontSize:S,buttonLineHeight:G,buttonLetterSpacing:W,buttonWordSpacing:U,buttonTextAppearance:H,statusFontSettings:I,statusFontSize:z,statusLineHeight:$,statusLetterSpacing:T,statusWordSpacing:A,statusTextAppearance:_,iconMaxWidth:g,minHeight:B,corners:P,stroke:Y,stateOverrides:ie,inputPadding:L,buttonPadding:O,successMessage:K="Thanks for subscribing!",errorMessage:ue="Please, fill all required fields."}=e,le=d.slice(0,Math.min(p,d.length)),[F,pe]=s.useState(()=>Object.fromEntries(le.map(he=>[he.name,""]))),[j,se]=s.useState("idle"),[ne,ve]=s.useState(null),Me=o==="success"?"success":o==="error"?"error":j,xe=o==="error"?ue:ne,b=o==="filled",M=s.useMemo(()=>{if(!b)return F;let he=null;for(const J of le)(F[J.name]??"").trim().length>0||(he=he??{...F},he[J.name]="Filled");return he??F},[b,F,le]),E=Me==="error"?D.getFormFieldValidationError(le,M):null,V=o&&o!=="default"?`${r}-state-${o}`:"",Se=le.some(he=>(M[he.name]??"").trim().length>0),te=V!==`${r}-state-filled`&&Se?`${r}-state-filled`:"",$e=`${V} ${te}`.trim(),re=i==null?void 0:i.submitUrl,ge=u??"",ye=(c==null?void 0:c.icon)??"",Z=(c==null?void 0:c.mode)==="On",Q=ge||"Submit",ce={fontSettings:{fontFamily:x,fontWeight:(w==null?void 0:w.fontWeight)??400,fontStyle:(w==null?void 0:w.fontStyle)??"normal"},fontSize:m??.01,lineHeight:h,letterSpacing:f??0,wordSpacing:v??0,textAppearance:C,color:e.inputTextColor??"#111111"},we={fontSettings:{fontFamily:x,fontWeight:(y==null?void 0:y.fontWeight)??400,fontStyle:(y==null?void 0:y.fontStyle)??"normal"},fontSize:S??.01,lineHeight:G,letterSpacing:W??0,wordSpacing:U??0,textAppearance:H,color:e.buttonTextColor??"#ffffff"},Pe={fontSettings:{fontFamily:x,fontWeight:(I==null?void 0:I.fontWeight)??400,fontStyle:(I==null?void 0:I.fontStyle)??"normal"},fontSize:z??.01,lineHeight:$,letterSpacing:T??0,wordSpacing:A??0,textAppearance:_,color:e.successColor??"#22c55e"},Ce=an(qt(ce,t)),X=an(qt(we,t)),me=an(qt(Pe,t)),ae=D.buildColorVars(r,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(ce==null?void 0:ce.color)??"#111111",buttonTextColor:e.buttonTextColor??(we==null?void 0:we.color)??"#ffffff"},Gg,Xg,ie),q={borderRadius:D.scalingValue(P,t),borderWidth:D.scalingValue(Y,t),borderStyle:"solid"},de={borderLeftWidth:D.scalingValue(Y,t)},ke=async he=>{if(he.preventDefault(),!l)return;const J=Object.fromEntries(le.map(Fe=>{var et;return[Fe.name,((et=F[Fe.name])==null?void 0:et.trim())??""]}).filter(([,Fe])=>Fe));if(!re){se("error"),ve("No integrations were found for this form.");return}if(Object.keys(J).length===0)return;const Ne=D.getFormFieldValidationError(le,F);if(Ne){se("error"),ve(Ne);return}se("submitting"),ve(null);try{const Fe=await fetch(re,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)});if(!Fe.ok){const et=await Fe.text();throw new Error(et||`Request failed: ${Fe.status}`)}se("success"),pe(Object.fromEntries(le.map(et=>[et.name,""])))}catch(Fe){se("error"),ve(Fe instanceof Error?Fe.message:"Something went wrong")}};return a.jsxs("div",{className:`${r}-wrapper ${$e}`.trim(),style:ae,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:jg(r)}}),a.jsxs("form",{onSubmit:ke,className:`${r}-form`,style:{...q,height:D.scalingValue(B,t),minHeight:D.scalingValue(B,t)},children:[a.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:le.map(he=>a.jsx("input",{type:he.type==="email"?"email":he.type==="phone"?"tel":"text",name:he.name,autoComplete:"off",value:M[he.name]??"",onChange:J=>pe(Ne=>({...Ne,[he.name]:J.target.value})),placeholder:he.placeholder,required:he.isRequired??he.type==="email",className:`${r}-input`,style:{...Ce,paddingRight:D.scalingValue(L.right,t),paddingLeft:D.scalingValue(L.left,t),paddingTop:D.scalingValue(L.top,t),paddingBottom:D.scalingValue(L.bottom,t)}},he.name))}),a.jsx("div",{className:`${r}-overlayAnchor`,children:a.jsx("button",{type:l?"submit":"button",className:`${r}-submitBtn`,"aria-label":Q,style:{...X,...de,paddingRight:D.scalingValue(O.right,t),paddingLeft:D.scalingValue(O.left,t),paddingTop:D.scalingValue(O.top,t),paddingBottom:D.scalingValue(O.bottom,t),pointerEvents:l?"auto":void 0},children:j==="submitting"?"...":Z?ye&&a.jsx(sn,{url:ye,className:`${r}-submitBtnIcon`,style:{maxWidth:D.scalingValue(g??0,t)},fill:`var(--${r}-button-text-color)`,hoverFill:`var(--${r}-button-text-color)`}):ge})})]}),Me==="success"&&a.jsx("p",{className:`${r}-success`,style:{...me},children:K}),Me==="error"&&a.jsx("p",{className:`${r}-error`,style:{...me},role:"alert",children:E??xe??ue})]})},Gg={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"},Xg=["hover","focus","filled","success","error"],Yg=`import React, { useMemo, useState } from 'react';
986
986
  import { CommonComponentProps } from '../props';
987
987
  import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
988
988
  import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
@@ -1561,7 +1561,7 @@ const COLOR_VAR_MAP: Record<OnelinerColorKeys, string> = {
1561
1561
  };
1562
1562
 
1563
1563
  const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
1564
- `,Yg="data:image/svg+xml,"+encodeURIComponent('<svg width="23px" height="20px" viewBox="0 0 23 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Newsletter" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Tutorials-pop-up-Copy-12" transform="translate(-43, -687)" fill="#FFFFFF" fill-rule="nonzero"><path d="M66,697 C66,697.552285 65.5522847,698 65,698 L44,698 C43.4477153,698 43,697.552285 43,697 C43,696.447715 43.4477153,696 44,696 L65,696 C65.5522847,696 66,696.447715 66,697 Z M55.6689647,687.256706 L65.6689647,696.256706 C66.1103451,696.653948 66.1103451,697.346052 65.6689647,697.743294 L55.6689647,706.743294 C55.2584547,707.112753 54.6261649,707.079475 54.2567059,706.668965 C53.8872468,706.258455 53.9205252,705.626165 54.3310353,705.256706 L63.5051529,697 L54.3310353,688.743294 C53.9205252,688.373835 53.8872468,687.741545 54.2567059,687.331035 C54.6261649,686.920525 55.2584547,686.887247 55.6689647,687.256706 Z" id="Combined-Shape"></path></g></g></svg>'),qg=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."}],wa={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Ug=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],Kg={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:3},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},buttonIcon:{type:"object",scope:"common",title:"Button Icon",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},iconMaxWidth:{type:"number",scope:"common",title:"Icon Max Width",display:{type:"full-width-input"},min:0,max:1},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"Input Padding",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"Button Padding",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"numeric-input"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},strokeColor:{type:"string",scope:"common",title:"Stroke All",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"common"},inputFontSettings:{...wa.fontSettings,scope:"common",title:"Input"},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...wa.fontSettings,scope:"common",title:"Button"},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},statusFontSettings:{...wa.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fields:qg,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:Yg},fontFamily:"Arial",strokeColor:"#000000",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#000000",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{hover:{buttonColor:"#33A2F2"}},inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{minHeight:.1,iconMaxWidth:.1,stroke:.001,corners:.0053,buttonPadding:{top:.02,right:.04,bottom:.02,left:.04},inputPadding:{top:.01,right:.03,bottom:.01,left:.03},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},t:{minHeight:.0651,iconMaxWidth:.1,stroke:.001,corners:.0026,buttonPadding:{top:.02604,right:.02604,bottom:.02604,left:.02604},inputPadding:{top:.02604,right:.02604,bottom:.02604,left:.0182},inputFontSize:.0208,inputLineHeight:.02604,buttonFontSize:.0208,buttonLineHeight:.02604,statusFontSize:.0208,statusLineHeight:.02604},d:{minHeight:.028,iconMaxWidth:.028,stroke:.001,corners:.0027,buttonPadding:{right:.0175,left:.0175,top:.005,bottom:.004},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.009,buttonLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSettings.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSize.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLineHeight.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLetterSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonWordSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonTextAppearance.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"Off"},then:{name:"properties.iconMaxWidth.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["fieldsToShow","minHeight"]},{type:"row",items:["corners","stroke"]},{type:"row",title:"",items:["inputPadding","buttonPadding"]},{type:"row",title:"",items:["buttonIcon"]},"iconMaxWidth"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Ug],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","placeholderColor","inputColor","buttonTextColor","buttonColor"],hover:["strokeColor","inputColor","buttonTextColor","buttonColor"],focus:["strokeColor","inputTextColor","buttonTextColor","buttonColor"],filled:["strokeColor","inputColor","inputTextColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},Zg={element:jg,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Single_Line.png"},defaultSize:{d:{width:400},t:{width:500},m:{width:340}},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",statusFontSettings:"fontFamily"},schema:Kg,sourceCode:Xg};function Jg(e,t){const n=t>0?`${t}px`:"0px";return`
1564
+ `,qg="data:image/svg+xml,"+encodeURIComponent('<svg width="23px" height="20px" viewBox="0 0 23 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Newsletter" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Tutorials-pop-up-Copy-12" transform="translate(-43, -687)" fill="#FFFFFF" fill-rule="nonzero"><path d="M66,697 C66,697.552285 65.5522847,698 65,698 L44,698 C43.4477153,698 43,697.552285 43,697 C43,696.447715 43.4477153,696 44,696 L65,696 C65.5522847,696 66,696.447715 66,697 Z M55.6689647,687.256706 L65.6689647,696.256706 C66.1103451,696.653948 66.1103451,697.346052 65.6689647,697.743294 L55.6689647,706.743294 C55.2584547,707.112753 54.6261649,707.079475 54.2567059,706.668965 C53.8872468,706.258455 53.9205252,705.626165 54.3310353,705.256706 L63.5051529,697 L54.3310353,688.743294 C53.9205252,688.373835 53.8872468,687.741545 54.2567059,687.331035 C54.6261649,686.920525 55.2584547,686.887247 55.6689647,687.256706 Z" id="Combined-Shape"></path></g></g></svg>'),Ug=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."}],wa={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Kg=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],Zg={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:3},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},buttonIcon:{type:"object",scope:"common",title:"Button Icon",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},iconMaxWidth:{type:"number",scope:"common",title:"Icon Max Width",display:{type:"full-width-input"},min:0,max:1},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"Input Padding",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"Button Padding",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"numeric-input"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},strokeColor:{type:"string",scope:"common",title:"Stroke All",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"common"},inputFontSettings:{...wa.fontSettings,scope:"common",title:"Input"},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...wa.fontSettings,scope:"common",title:"Button"},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},statusFontSettings:{...wa.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fields:Ug,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:qg},fontFamily:"Arial",strokeColor:"#000000",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#000000",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{hover:{buttonColor:"#33A2F2"}},inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{minHeight:.1,iconMaxWidth:.1,stroke:.001,corners:.0053,buttonPadding:{top:.02,right:.04,bottom:.02,left:.04},inputPadding:{top:.01,right:.03,bottom:.01,left:.03},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},t:{minHeight:.0651,iconMaxWidth:.1,stroke:.001,corners:.0026,buttonPadding:{top:.02604,right:.02604,bottom:.02604,left:.02604},inputPadding:{top:.02604,right:.02604,bottom:.02604,left:.0182},inputFontSize:.0208,inputLineHeight:.02604,buttonFontSize:.0208,buttonLineHeight:.02604,statusFontSize:.0208,statusLineHeight:.02604},d:{minHeight:.028,iconMaxWidth:.028,stroke:.001,corners:.0027,buttonPadding:{right:.0175,left:.0175,top:.005,bottom:.004},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.009,buttonLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSettings.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSize.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLineHeight.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLetterSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonWordSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonTextAppearance.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"Off"},then:{name:"properties.iconMaxWidth.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["fieldsToShow","minHeight"]},{type:"row",items:["corners","stroke"]},{type:"row",title:"",items:["inputPadding","buttonPadding"]},{type:"row",title:"",items:["buttonIcon"]},"iconMaxWidth"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Kg],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","placeholderColor","inputColor","buttonTextColor","buttonColor"],hover:["strokeColor","inputColor","buttonTextColor","buttonColor"],focus:["strokeColor","inputTextColor","buttonTextColor","buttonColor"],filled:["strokeColor","inputColor","inputTextColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},Jg={element:Vg,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Single_Line.png"},defaultSize:{d:{width:400},t:{width:500},m:{width:340}},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",statusFontSettings:"fontFamily"},schema:Zg,sourceCode:Yg};function Qg(e,t){const n=t>0?`${t}px`:"0px";return`
1565
1565
  .${e}-marquee-wrapper {
1566
1566
  overflow: hidden;
1567
1567
  width: 100%;
@@ -1693,7 +1693,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
1693
1693
  .${e}-image-hover-grayscale:hover video {
1694
1694
  filter: grayscale(100%);
1695
1695
  }
1696
- `}const Qg=30,eh=20,Sa=3,th=12,nh=32,ih=3,oh=e=>{e.style.setProperty("animation-name","none"),e.style.setProperty("-webkit-animation-name","none"),e.offsetHeight,e.style.removeProperty("animation-name"),e.style.removeProperty("-webkit-animation-name")},rh=(e,t)=>Array.from({length:t},()=>e).flat(),ah=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},Rd=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),$l=(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=Rd(d);return c<=0?0:c+r*Math.max(0,t-1)},sh=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=Rd(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},lh=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},ch=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>lh(i,e))},dh=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??"")},uh=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,ph=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:r,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var k,F,g,O;const p=s.useRef(null),x=!!((k=e.image)!=null&&k.url&&dh(e.image));s.useLayoutEffect(()=>{d&&uh(p.current)&&(u==null||u())},[d,(F=e.image)==null?void 0:F.url,u]);const w=n.display==="cover",m=n.ratioValue??"1:1",h=n.reversed??!1,[f,v]=m.split(":").map(Number),S=(h?v:f)/(h?f:v),V=i/S,N=V>o?o:V,q=V>o?o*S:i,W=c(q),I=c(N),B={borderRadius:c(r)},$=w?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...B}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:c(i),maxHeight:c(o),objectFit:"contain",...B},T=((g=e.image)==null?void 0:g.url)&&(x?a.jsx("video",{ref:P=>{p.current=P},src:e.image.url,style:$,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:d?u:void 0,onError:d?u:void 0}):a.jsx("img",{ref:P=>{p.current=P},src:e.image.url,alt:((O=e.image)==null?void 0:O.name)??"",style:$,onLoad:d?u:void 0,onError:d?u:void 0}));return a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...w?{width:W}:{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,...w?{width:W,height:I,overflow:"hidden",...B}:{width:"max-content",maxWidth:c(i),height:c(o)}},children:T&&e.link?a.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:pt(`${t}-marquee-link`,!w&&`${t}-marquee-link-contain`),children:T}):T})})},mh=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=D.useScopedStyles(),[l,d]=s.useState(0),c=l>0?Math.round(l):0,u=s.useMemo(()=>Jg(r,c),[r,c]),{speed:p,direction:x,pauseOnHover:w,gap:m,imageMaxWidth:h,imageMaxHeight:f,hoverEffect:v,cornerRadius:C=0}=e,y=s.useMemo(()=>ah(e.imageFit),[e.imageFit]),S=(t==null?void 0:t.length)??0,V=!!o,N=!n||!!i,q=N&&v!=="off"&&v!=="randomize"?`${r}-image-hover-${v}`:void 0,W=n?!!i:!0,B=((t==null?void 0:t.length)??0)>0&&(W||!!n),$=Math.max(0,p)*Qg,T=Q=>D.scalingValue(Q,n??!1),k=s.useRef(null),F=s.useRef(null),g=s.useRef(null),[O,P]=s.useState(0),X=W&&w==="on",[te,L]=s.useState(!1),[H,U]=s.useState({}),de=s.useRef(H);de.current=H;const ae=s.useRef(null),A=s.useRef(0),ce=s.useRef(null),z=s.useMemo(()=>(t??[]).map(Q=>{var Te;return((Te=Q.image)==null?void 0:Te.url)??""}).join("\0"),[t]),[re,ee]=s.useState(Sa),xe=s.useMemo(()=>{const Q=t??[];return Q.length===0||!(W||!!n)?Q:rh(Q,re)},[t,W,re,n]),Fe=s.useMemo(()=>(t??[]).filter(Q=>{var Te;return!!((Te=Q.image)!=null&&Te.url)}).length,[t]),ye=B?ih:1;s.useLayoutEffect(()=>{A.current=0,U({}),ae.current=null,ee(Sa),d(0)},[z]),s.useEffect(()=>{if(!N||v!=="randomize")return;const Q=k.current;if(!Q)return;const Te=K=>{U(Z=>{const se=Array.from(K).filter(Me=>Me in Z&&!ch(Q,Me));if(se.length===0)return Z;const Se={...Z};return se.forEach(Me=>{delete Se[Me]}),Se})},ie=new IntersectionObserver(K=>{const Z=new Set;for(const se of K){const Se=se.target.dataset.marqueeItemIndex,Me=Se!==void 0?Number(Se):NaN;Number.isNaN(Me)||Z.add(Me)}Z.size>0&&Te(Z)},{root:Q,threshold:0});Object.keys(H).forEach(K=>{const Z=Number(K);Q.querySelectorAll(`[data-marquee-item-index="${Z}"]`).forEach(se=>ie.observe(se))});const ue={current:0},fe=()=>{const K=Object.keys(de.current);K.length!==0&&(Te(K.map(Number)),ue.current=requestAnimationFrame(fe))};return Object.keys(de.current).length>0&&(ue.current=requestAnimationFrame(fe)),()=>{cancelAnimationFrame(ue.current),ie.disconnect()}},[v,H,N]),s.useLayoutEffect(()=>{if(!B)return;const Q=k.current,Te=g.current;if(!Q||!Te)return;const ie={current:0},ue=()=>{const Z=Q.getBoundingClientRect().width||Q.offsetWidth,se=sh(Te),Se=ae.current,Me=typeof Se=="number"&&Math.abs(Se-se)<=.25;ae.current=se;let $e=re,G=0;if((W||n)&&S>0&&Z>0){const Y=$l(Te,S);if(Y>=nh){G=Y;const le=Math.min(th,Math.max(Sa,Math.ceil(Z/Y)+1));$e=le,le!==re&&ee(le)}}const oe=$e!==re&&G>0?G*$e:se>0?se:G>0?G*$e:(()=>{const Y=$l(Te,S);return Y>0?Y*$e:0})();oe>0?d(Y=>Y<=0?oe:!Me||Math.round(Y)===Math.round(oe)?Y:oe):!Me&&l<=0&&(cancelAnimationFrame(ie.current),ie.current=requestAnimationFrame(ue))},fe=()=>{cancelAnimationFrame(ie.current),ie.current=requestAnimationFrame(ue)};ce.current=fe,fe();const K=new ResizeObserver(fe);return K.observe(Q),K.observe(Te),()=>{ce.current=null,cancelAnimationFrame(ie.current),K.disconnect()}},[W,B,l,z,re,S,n]),s.useLayoutEffect(()=>{if(!B||c<=0)return;const Q=F.current;Q&&oh(Q)},[B,c,x,$]),s.useLayoutEffect(()=>{if(!B||l<=0){P(0);return}const Q=F.current,Te=g.current;if(!Q||!Te)return;const ie=()=>{const fe=Q.offsetHeight||Q.getBoundingClientRect().height,K=Array.from(Te.children).reduce((se,Se)=>Math.max(se,Se.offsetHeight||Se.getBoundingClientRect().height),0),Z=fe>0?fe:K;P(Z>0?Z:0)};ie();const ue=new ResizeObserver(ie);return ue.observe(Q),ue.observe(Te),()=>ue.disconnect()},[B,ye,xe,n,m,h,f,l,y,H]),s.useLayoutEffect(()=>{if(!n||!V||!B||typeof window>"u")return;const Q=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(Q)},[n,V,B,x,l,O,m,xe]);const b=()=>{X&&L(!0)},M=()=>{X&&L(!1)},E=s.useCallback(()=>{var Q;A.current=Math.min(Fe,A.current+1),(Q=ce.current)==null||Q.call(ce)},[Fe]),j=s.useCallback((Q,Te)=>{U(ie=>{const ue=ie[Q]??Te,fe=(t??[]).filter(Z=>Z!==ue);if(fe.length===0)return ie;const K=fe[Math.floor(Math.random()*fe.length)];return{...ie,[Q]:K}})},[t]),Ce=(Q,Te,ie,ue)=>{const fe=N&&v==="randomize"&&y.display==="cover"?H[ie]??Q:Q,K=`max(${T(m)}, ${eh}px)`,Z=`calc(-0.5 * (${K} + ${T(m)}))`;return a.jsxs("div",{className:`${r}-marquee-card`,"data-marquee-item-index":ie,onMouseEnter:N&&v==="randomize"&&y.display==="cover"?()=>j(ie,Q):void 0,children:[a.jsx(ph,{item:fe,prefix:r,imageFit:y,imageMaxWidth:h,imageMaxHeight:f,cornerRadius:C,imageHoverClass:q,isEditor:n,isFirstSet:ue,scaled:T,onFirstSetImageDone:E}),V&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${r}-gap-control`,style:{position:"absolute",top:0,right:Z,width:K,height:"100%"}})]},`${Te}-${ie}`)};if(B){const Q=W?X&&te?"paused":"running":"paused",Te=c>0&&$>0?c/$*1e3:0,ie=`${Math.max(0,Te)/1e3}s`;return a.jsxs("div",{ref:k,className:pt(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Marquee",style:O>0?{height:O}:void 0,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{ref:F,className:`${r}-marquee-track`,"data-direction":x,onMouseEnter:b,onMouseLeave:M,style:{WebkitAnimationDuration:ie,animationDuration:ie,WebkitAnimationPlayState:Q,animationPlayState:Q},children:Array.from({length:ye},(ue,fe)=>a.jsx("div",{ref:fe===0?g:void 0,className:pt(`${r}-marquee-row`,`${r}-marquee-set`),style:{gap:T(m),paddingRight:T(m)},"aria-hidden":fe>0,children:xe.map((K,Z)=>Ce(K,fe,Z,fe===0&&Z<S))},`set-${fe}`))})]})}return a.jsxs("div",{ref:k,className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{className:pt(`${r}-marquee-row`,`${r}-marquee-static`),style:{gap:T(m),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((Q,Te)=>Ce(Q,0,Te))},"marquee-static")]})},gh=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
1696
+ `}const eh=30,th=20,Sa=3,nh=12,ih=32,oh=3,rh=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")},ah=(e,t)=>Array.from({length:t},()=>e).flat(),sh=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},Ld=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),$l=(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=Ld(d);return c<=0?0:c+r*Math.max(0,t-1)},lh=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=Ld(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},ch=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},dh=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>ch(i,e))},uh=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??"")},ph=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,mh=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:r,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var A,_,g,B;const p=s.useRef(null),x=!!((A=e.image)!=null&&A.url&&uh(e.image));s.useLayoutEffect(()=>{d&&ph(p.current)&&(u==null||u())},[d,(_=e.image)==null?void 0:_.url,u]);const w=n.display==="cover",m=n.ratioValue??"1:1",h=n.reversed??!1,[f,v]=m.split(":").map(Number),S=(h?v:f)/(h?f:v),G=i/S,W=G>o?o:G,U=G>o?o*S:i,H=c(U),I=c(W),z={borderRadius:c(r)},$=w?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...z}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:c(i),maxHeight:c(o),objectFit:"contain",...z},T=((g=e.image)==null?void 0:g.url)&&(x?a.jsx("video",{ref:P=>{p.current=P},src:e.image.url,style:$,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:d?u:void 0,onError:d?u:void 0}):a.jsx("img",{ref:P=>{p.current=P},src:e.image.url,alt:((B=e.image)==null?void 0:B.name)??"",style:$,onLoad:d?u:void 0,onError:d?u:void 0}));return a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...w?{width:H}:{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,...w?{width:H,height:I,overflow:"hidden",...z}:{width:"max-content",maxWidth:c(i),height:c(o)}},children:T&&e.link?a.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:pt(`${t}-marquee-link`,!w&&`${t}-marquee-link-contain`),children:T}):T})})},gh=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=D.useScopedStyles(),[l,d]=s.useState(0),c=l>0?Math.round(l):0,u=s.useMemo(()=>Qg(r,c),[r,c]),{speed:p,direction:x,pauseOnHover:w,gap:m,imageMaxWidth:h,imageMaxHeight:f,hoverEffect:v,cornerRadius:C=0}=e,y=s.useMemo(()=>sh(e.imageFit),[e.imageFit]),S=(t==null?void 0:t.length)??0,G=!!o,W=!n||!!i,U=W&&v!=="off"&&v!=="randomize"?`${r}-image-hover-${v}`:void 0,H=n?!!i:!0,z=((t==null?void 0:t.length)??0)>0&&(H||!!n),$=Math.max(0,p)*eh,T=te=>D.scalingValue(te,n??!1),A=s.useRef(null),_=s.useRef(null),g=s.useRef(null),[B,P]=s.useState(0),Y=H&&w==="on",[ie,L]=s.useState(!1),[O,K]=s.useState({}),ue=s.useRef(O);ue.current=O;const le=s.useRef(null),F=s.useRef(0),pe=s.useRef(null),j=s.useMemo(()=>(t??[]).map(te=>{var $e;return(($e=te.image)==null?void 0:$e.url)??""}).join("\0"),[t]),[se,ne]=s.useState(Sa),ve=s.useMemo(()=>{const te=t??[];return te.length===0||!(H||!!n)?te:ah(te,se)},[t,H,se,n]),Me=s.useMemo(()=>(t??[]).filter(te=>{var $e;return!!(($e=te.image)!=null&&$e.url)}).length,[t]),xe=z?oh:1;s.useLayoutEffect(()=>{F.current=0,K({}),le.current=null,ne(Sa),d(0)},[j]),s.useEffect(()=>{if(!W||v!=="randomize")return;const te=A.current;if(!te)return;const $e=Z=>{K(Q=>{const ce=Array.from(Z).filter(Pe=>Pe in Q&&!dh(te,Pe));if(ce.length===0)return Q;const we={...Q};return ce.forEach(Pe=>{delete we[Pe]}),we})},re=new IntersectionObserver(Z=>{const Q=new Set;for(const ce of Z){const we=ce.target.dataset.marqueeItemIndex,Pe=we!==void 0?Number(we):NaN;Number.isNaN(Pe)||Q.add(Pe)}Q.size>0&&$e(Q)},{root:te,threshold:0});Object.keys(O).forEach(Z=>{const Q=Number(Z);te.querySelectorAll(`[data-marquee-item-index="${Q}"]`).forEach(ce=>re.observe(ce))});const ge={current:0},ye=()=>{const Z=Object.keys(ue.current);Z.length!==0&&($e(Z.map(Number)),ge.current=requestAnimationFrame(ye))};return Object.keys(ue.current).length>0&&(ge.current=requestAnimationFrame(ye)),()=>{cancelAnimationFrame(ge.current),re.disconnect()}},[v,O,W]),s.useLayoutEffect(()=>{if(!z)return;const te=A.current,$e=g.current;if(!te||!$e)return;const re={current:0},ge=()=>{const Q=te.getBoundingClientRect().width||te.offsetWidth,ce=lh($e),we=le.current,Pe=typeof we=="number"&&Math.abs(we-ce)<=.25;le.current=ce;let Ce=se,X=0;if((H||n)&&S>0&&Q>0){const q=$l($e,S);if(q>=ih){X=q;const de=Math.min(nh,Math.max(Sa,Math.ceil(Q/q)+1));Ce=de,de!==se&&ne(de)}}const ae=Ce!==se&&X>0?X*Ce:ce>0?ce:X>0?X*Ce:(()=>{const q=$l($e,S);return q>0?q*Ce:0})();ae>0?d(q=>q<=0?ae:!Pe||Math.round(q)===Math.round(ae)?q:ae):!Pe&&l<=0&&(cancelAnimationFrame(re.current),re.current=requestAnimationFrame(ge))},ye=()=>{cancelAnimationFrame(re.current),re.current=requestAnimationFrame(ge)};pe.current=ye,ye();const Z=new ResizeObserver(ye);return Z.observe(te),Z.observe($e),()=>{pe.current=null,cancelAnimationFrame(re.current),Z.disconnect()}},[H,z,l,j,se,S,n]),s.useLayoutEffect(()=>{if(!z||c<=0)return;const te=_.current;te&&rh(te)},[z,c,x,$]),s.useLayoutEffect(()=>{if(!z||l<=0){P(0);return}const te=_.current,$e=g.current;if(!te||!$e)return;const re=()=>{const ye=te.offsetHeight||te.getBoundingClientRect().height,Z=Array.from($e.children).reduce((ce,we)=>Math.max(ce,we.offsetHeight||we.getBoundingClientRect().height),0),Q=ye>0?ye:Z;P(Q>0?Q:0)};re();const ge=new ResizeObserver(re);return ge.observe(te),ge.observe($e),()=>ge.disconnect()},[z,xe,ve,n,m,h,f,l,y,O]),s.useLayoutEffect(()=>{if(!n||!G||!z||typeof window>"u")return;const te=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(te)},[n,G,z,x,l,B,m,ve]);const b=()=>{Y&&L(!0)},M=()=>{Y&&L(!1)},E=s.useCallback(()=>{var te;F.current=Math.min(Me,F.current+1),(te=pe.current)==null||te.call(pe)},[Me]),V=s.useCallback((te,$e)=>{K(re=>{const ge=re[te]??$e,ye=(t??[]).filter(Q=>Q!==ge);if(ye.length===0)return re;const Z=ye[Math.floor(Math.random()*ye.length)];return{...re,[te]:Z}})},[t]),Se=(te,$e,re,ge)=>{const ye=W&&v==="randomize"&&y.display==="cover"?O[re]??te:te,Z=`max(${T(m)}, ${th}px)`,Q=`calc(-0.5 * (${Z} + ${T(m)}))`;return a.jsxs("div",{className:`${r}-marquee-card`,"data-marquee-item-index":re,onMouseEnter:W&&v==="randomize"&&y.display==="cover"?()=>V(re,te):void 0,children:[a.jsx(mh,{item:ye,prefix:r,imageFit:y,imageMaxWidth:h,imageMaxHeight:f,cornerRadius:C,imageHoverClass:U,isEditor:n,isFirstSet:ge,scaled:T,onFirstSetImageDone:E}),G&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${r}-gap-control`,style:{position:"absolute",top:0,right:Q,width:Z,height:"100%"}})]},`${$e}-${re}`)};if(z){const te=H?Y&&ie?"paused":"running":"paused",$e=c>0&&$>0?c/$*1e3:0,re=`${Math.max(0,$e)/1e3}s`;return a.jsxs("div",{ref:A,className:pt(`${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:_,className:`${r}-marquee-track`,"data-direction":x,onMouseEnter:b,onMouseLeave:M,style:{WebkitAnimationDuration:re,animationDuration:re,WebkitAnimationPlayState:te,animationPlayState:te},children:Array.from({length:xe},(ge,ye)=>a.jsx("div",{ref:ye===0?g:void 0,className:pt(`${r}-marquee-row`,`${r}-marquee-set`),style:{gap:T(m),paddingRight:T(m)},"aria-hidden":ye>0,children:ve.map((Z,Q)=>Se(Z,ye,Q,ye===0&&Q<S))},`set-${ye}`))})]})}return a.jsxs("div",{ref:A,className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{className:pt(`${r}-marquee-row`,`${r}-marquee-static`),style:{gap:T(m),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((te,$e)=>Se(te,0,$e))},"marquee-static")]})},hh=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
1697
1697
  import cn from 'classnames';
1698
1698
  import { CommonComponentProps } from '../props';
1699
1699
  import { scalingValue } from '../utils/scalingValue';
@@ -2476,7 +2476,7 @@ type MarqueeProps = {
2476
2476
  isPreviewMode?: boolean;
2477
2477
  isEditMode?: boolean;
2478
2478
  } & CommonComponentProps;
2479
- `,hh={type:"object",version:1,settings:{sizing:"auto manual",properties:{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"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},hoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["off","brightness","grayscale"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,display:{type:"numeric-input"}},imageMaxWidth:{type:"number",scope:"layout",title:"Max width",min:10,display:{type:"numeric-input"}},imageMaxHeight:{type:"number",scope:"layout",title:"Max height",min:10,display:{type:"numeric-input"}},imageFit:{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",min:0,display:{type:"numeric-input"}}},defaults:{direction:"left",pauseOnHover:"off",hoverEffect:"off",imageFit:{display:"fit",ratioValue:"16:9",reversed:!1}},layoutDefaults:{m:{speed:.55,gap:.04,imageMaxWidth:.8,imageMaxHeight:.8,cornerRadius:0},t:{speed:1.64,gap:.02,imageMaxWidth:.5208,imageMaxHeight:.5208,cornerRadius:0},d:{speed:1.64,gap:.02,imageMaxWidth:.208,imageMaxHeight:.278,cornerRadius:0}},displayRules:[{if:{name:"imageFit.display",value:"cover"},then:{name:"properties.hoverEffect.display.enum",value:["off","brightness","grayscale","randomize"]}}],layout:["__componentName__","speed","direction","pauseOnHover","hoverEffect","gap","imageMaxWidth","imageMaxHeight","imageFit","cornerRadius"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["direction"]},{type:"row",items:["speed","imageFit"]},{type:"row",items:["imageMaxWidth","imageMaxHeight"]},{type:"row",items:["cornerRadius"]},{type:"row",title:"Hover Settings",items:[{type:"row",title:"",items:["hoverEffect","pauseOnHover"]}]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0,allowsVideo:!0},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"]}}},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:""},link:""}]}},fh={element:mh,id:"marquee",name:"Simple Marquee",category:"galleries",version:1,defaultSize:{d:{width:"100%"},t:{width:"100%"},m:{width:"100%"}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple-Marquee.mp4"},schema:hh,sourceCode:gh,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}};function yh(e,t,n){const i=t>0?`${t}px`:"0px",o=n?`
2479
+ `,fh={type:"object",version:1,settings:{sizing:"auto manual",properties:{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"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},hoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["off","brightness","grayscale"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,display:{type:"numeric-input"}},imageMaxWidth:{type:"number",scope:"layout",title:"Max width",min:10,display:{type:"numeric-input"}},imageMaxHeight:{type:"number",scope:"layout",title:"Max height",min:10,display:{type:"numeric-input"}},imageFit:{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",min:0,display:{type:"numeric-input"}}},defaults:{direction:"left",pauseOnHover:"off",hoverEffect:"off",imageFit:{display:"fit",ratioValue:"16:9",reversed:!1}},layoutDefaults:{m:{speed:.55,gap:.04,imageMaxWidth:.8,imageMaxHeight:.8,cornerRadius:0},t:{speed:1.64,gap:.02,imageMaxWidth:.5208,imageMaxHeight:.5208,cornerRadius:0},d:{speed:1.64,gap:.02,imageMaxWidth:.208,imageMaxHeight:.278,cornerRadius:0}},displayRules:[{if:{name:"imageFit.display",value:"cover"},then:{name:"properties.hoverEffect.display.enum",value:["off","brightness","grayscale","randomize"]}}],layout:["__componentName__","speed","direction","pauseOnHover","hoverEffect","gap","imageMaxWidth","imageMaxHeight","imageFit","cornerRadius"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["direction"]},{type:"row",items:["speed","imageFit"]},{type:"row",items:["imageMaxWidth","imageMaxHeight"]},{type:"row",items:["cornerRadius"]},{type:"row",title:"Hover Settings",items:[{type:"row",title:"",items:["hoverEffect","pauseOnHover"]}]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0,allowsVideo:!0},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"]}}},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:""},link:""}]}},yh={element:gh,id:"marquee",name:"Simple Marquee",category:"galleries",version:1,defaultSize:{d:{width:"100%"},t:{width:"100%"},m:{width:"100%"}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple-Marquee.mp4"},schema:fh,sourceCode:hh,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}};function xh(e,t,n){const i=t>0?`${t}px`:"0px",o=n?`
2480
2480
  .${e}-item-image-wrap {
2481
2481
  display: flex;
2482
2482
  flex: 0 0 auto;
@@ -2605,7 +2605,7 @@ ${o}
2605
2605
  left: -9999px;
2606
2606
  top: 0;
2607
2607
  }
2608
- `}const xh=30,Ca=3,vh=12,bh=3,rs=.72,wh=100,Sh=10,Ch=e=>Math.max(0,e)/wh,$h=e=>Math.max(0,e)/Sh,Th=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")},Ih=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),ki={ctx:void 0},Rh=()=>ki.ctx!==void 0?ki.ctx:typeof document>"u"?(ki.ctx=null,ki.ctx):(ki.ctx=document.createElement("canvas").getContext("2d"),ki.ctx),Lh=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},Ph=e=>{e.style.transform=""},Eh=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},Mh=(e,t)=>{const n=(i,o)=>{if(!i||i===t)return o;const r=o+i.offsetLeft,l=i.offsetParent;return!l||l===i?r:n(l,r)};return n(e,e.offsetWidth/2)},kh=96,Ah=(e,t,n)=>{if(t<=0||e<=0||n<2)return null;const i=2*Math.PI/t,o=new Float64Array(n+1),r=new Float64Array(n+1),l=e*t,d=u=>Math.sqrt(1+(l*Math.cos(t*u))**2),c=i/n;return Array.from({length:n},(u,p)=>{const x=p*c,w=x+c;o[p+1]=w,r[p+1]=r[p]+(d(x)+d(w))*.5*c}),{wavelength:i,periodArc:r[n],x:o,s:r}},Fh=(e,t)=>{if(e.periodArc<=0)return t;const n=t<0?-1:1,i=Math.abs(t),o=Math.floor(i/e.periodArc),r=i-o*e.periodArc,{s:l,x:d}=e,c=(m,h)=>{if(h-m<=1)return[m,h];const f=m+h>>1;return l[f]<=r?c(f,h):c(m,f)},[u,p]=c(0,l.length-1),x=l[p]-l[u],w=x>0?(r-l[u])/x:0;return n*(o*e.wavelength+d[u]+(d[p]-d[u])*w)},_h=(e,t,n,i)=>{const o=Math.max(0,n),r=e>0?2*Math.PI*o/e:0,l=p=>i+t*Math.sin(r*p),d=p=>t*r*Math.cos(r*p),c=Math.max(4,Math.ceil(o*4)),u=Array.from({length:c},(p,x)=>{const w=x/c*e,m=(x+1)/c*e,h=m-w,f=l(w),v=l(m),C=w+h/3,y=f+d(w)*h/3,S=m-h/3,V=v-d(m)*h/3;return`C${C.toFixed(2)} ${y.toFixed(2)} ${S.toFixed(2)} ${V.toFixed(2)} ${m.toFixed(2)} ${v.toFixed(2)}`});return[`M0 ${l(0).toFixed(2)}`,...u].join(" ")},Nh=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:r,isCurve:l})=>{var m;const d=o!==0?{...n,transform:`translateY(${o}px)`}:n,c=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${rs}em`},u=((m=e.image)==null?void 0:m.url)&&a.jsx("img",{src:e.image.url,alt:e.image.name??"",className:`${t}-item-image`,style:c}),p=u&&(l?a.jsx("span",{className:`${t}-item-image-wrap`,"data-marquee-wave-node":!0,children:u}):u),x=l?a.jsx("span",{className:`${t}-text`,style:d,children:Array.from(e.text).map((h,f)=>a.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:a.jsx("span",{className:`${t}-glyph-inner`,children:h===" "?" ":h})},f))}):a.jsx("span",{className:`${t}-text`,style:d,children:e.text}),w=a.jsxs(a.Fragment,{children:[p,x]});return a.jsx("div",{className:`${t}-item`,"data-marquee-text-item":!0,style:{gap:r},children:e.link?a.jsx("a",{href:e.link,className:`${t}-item-link`,style:{gap:r},children:w}):w})},Wh=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=D.useScopedStyles(),[r,l]=s.useState(0),d=r>0?Math.round(r):0,{speed:c,direction:u,pauseOnHover:p,gap:x,layoutType:w,curveAmplitude:m,curveFrequency:h,textFontFamily:f,textFontSettings:v,textFontSize:C,textLineHeight:y,textLetterSpacing:S,textWordSpacing:V,textTextAppearance:N,textColor:q,backgroundColor:W,ribbonWidth:I}=e,B=I??y,$=w==="curve",T=Ch(m),k=$h(h),F=s.useMemo(()=>yh(o,d,$),[o,d,$]),g=s.useMemo(()=>Ut({fontSettings:{fontFamily:f,fontWeight:v.fontWeight,fontStyle:v.fontStyle},letterSpacing:S,wordSpacing:V,fontSize:C,lineHeight:y,textAppearance:N,color:q},n),[f,v,S,V,C,y,N,q,n]),O=he=>D.scalingValue(he,n??!1),P=((t==null?void 0:t.length)??0)>0,X=n?!!i:!0,te=P&&(X||!!n),L=Math.max(0,c)*xh,H=X&&p==="on",[U,de]=s.useState(!1),ae=X?H&&U?"paused":"running":"paused",A=ae==="running"&&L>0&&d>0,ce=s.useRef(null),z=s.useRef(null),re=s.useRef(null),ee=s.useRef(null),xe=s.useRef(null),Fe=s.useRef(null),ye=s.useRef(A),b=s.useRef(null);ye.current=A;const[M,E]=s.useState(0),[j,Ce]=s.useState(0),[Q,Te]=s.useState(0),[ie,ue]=s.useState(0),[fe,K]=s.useState(0),Z=s.useMemo(()=>(t??[]).map(he=>{var ve;return`${he.text}\0${((ve=he.image)==null?void 0:ve.url)??""}`}).join("\0"),[t]),[se,Se]=s.useState(Ca),Me=s.useMemo(()=>{const he=t??[];return he.length===0||!(X||n)?he:Ih(he,se)},[t,X,se,n]),$e=te?bh:1;s.useLayoutEffect(()=>{Se(Ca),l(0)},[Z]),s.useLayoutEffect(()=>{var be;const he=Fe.current;if(!he)return;const ve=()=>{const Ie=getComputedStyle(he),qe=parseFloat(Ie.fontSize)||0;if(qe<=0)return;const ze=Rh();if(!ze){E(qe*rs),Ce(0);return}ze.font=`${Ie.fontStyle} ${Ie.fontWeight} ${qe}px ${Ie.fontFamily}`;const Le=ze.measureText("H"),Ge=Le.actualBoundingBoxAscent>0?Le.actualBoundingBoxAscent:qe*rs,De=Math.max(0,Le.actualBoundingBoxDescent||0),nt=Le.fontBoundingBoxAscent||0,it=Le.fontBoundingBoxDescent||0;E(St=>Math.abs(St-Ge)>.5?Ge:St);const ct=nt>0||it>0?(it-De-(nt-Ge))/2:0;Ce(St=>Math.abs(St-ct)>.25?ct:St)};ve();const We=typeof document<"u"?document.fonts:void 0;(be=We==null?void 0:We.ready)==null||be.then(ve).catch(()=>{});const Je=new ResizeObserver(ve);return Je.observe(he),()=>Je.disconnect()},[g.fontFamily,g.fontWeight,g.fontStyle,g.fontSize,g.lineHeight]),s.useLayoutEffect(()=>{if(!te)return;const he=ce.current,ve=ee.current;if(!he||!ve)return;const We={id:0},Je=()=>{const Ie=he.offsetWidth||he.getBoundingClientRect().width,qe=ve.offsetWidth||ve.getBoundingClientRect().width;if(P&&Ie>0&&qe>0){const ze=qe/se;if(ze>0){const Le=Math.min(vh,Math.max(Ca,Math.ceil(Ie/ze)+1));if(Le!==se){Se(Le);return}}}qe>0&&l(qe)};We.id=requestAnimationFrame(Je);const be=new ResizeObserver(()=>{cancelAnimationFrame(We.id),We.id=requestAnimationFrame(Je)});return be.observe(he),be.observe(ve),()=>{cancelAnimationFrame(We.id),be.disconnect()}},[te,Z,se,P,M]),s.useLayoutEffect(()=>{const he=xe.current;if(!he)return;const ve={id:0},We=()=>{const be=he.offsetHeight;be>0&&K(Ie=>Math.abs(Ie-be)>.5?be:Ie)};ve.id=requestAnimationFrame(We);const Je=new ResizeObserver(()=>{cancelAnimationFrame(ve.id),ve.id=requestAnimationFrame(We)});return Je.observe(he),()=>{cancelAnimationFrame(ve.id),Je.disconnect()}},[B,n]),s.useLayoutEffect(()=>{if(!$){Te(0),ue(0);return}const he=ce.current,ve=ee.current;if(!he||!ve)return;const We={id:0},Je=()=>{const Ie=he.offsetWidth,qe=ve.offsetHeight;Ie>0&&ue(ze=>Math.abs(ze-Ie)>.5?Ie:ze),qe>0&&Te(ze=>Math.abs(ze-qe)>.5?qe:ze)};We.id=requestAnimationFrame(Je);const be=new ResizeObserver(()=>{cancelAnimationFrame(We.id),We.id=requestAnimationFrame(Je)});return be.observe(he),be.observe(ve),()=>{cancelAnimationFrame(We.id),be.disconnect()}},[$,Z,M,y,C,te]),s.useLayoutEffect(()=>{if(!te||d<=0)return;const he=re.current;he&&Th(he)},[te,d,u,L]),s.useLayoutEffect(()=>{if(!$||!P)return;const he=ce.current;if(!he)return;const ve={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},We=()=>{for(const Le of ve.itemsCache)for(const Ge of Le.glyphs)Ph(Ge.inner)},Je=()=>{const Le=z.current??he;ve.itemsCache=Array.from(he.querySelectorAll("[data-marquee-text-item]"),Ge=>{const De=[];return Ge.querySelectorAll("[data-marquee-wave-node]").forEach(nt=>{const it=nt.firstElementChild;it&&De.push({inner:it,layoutLocalX:Mh(nt,Le)})}),{item:Ge,glyphs:De}}),ve.cacheDirty=!1},be=()=>{ve.cacheDirty&&Je();const Ge=(z.current??he).offsetWidth||1,De=Ge*T,nt=2*Math.PI*k/Ge,it=`${Ge}|${De}|${nt}`;it!==ve.lutKey&&(ve.lutKey=it,ve.lut=Ah(De,nt,kh));const ct=re.current,St=ct?Eh(getComputedStyle(ct).transform):0,Bt=he.getBoundingClientRect(),zt=Bt.left,ft=Bt.right,wt=ve.lut&&ve.lut.wavelength>0?Math.max(0,(ve.lut.periodArc/ve.lut.wavelength-1)*Ge):0;for(const{item:jt,glyphs:At}of ve.itemsCache){const vt=jt.getBoundingClientRect();if(!(vt.right<zt||vt.left>ft+wt))for(const Ft of At){const Nt=Ft.layoutLocalX+St,Kt=ve.lut?Fh(ve.lut,Nt):Nt,Jt=nt*Kt,Tt=De*Math.sin(Jt),Wt=De*nt*Math.cos(Jt),rn=Math.atan(Wt)*(180/Math.PI);Lh(Ft.inner,Kt-Nt,Tt,rn)}}},Ie=()=>{ve.cancelled||(ve.raf=0,be(),ye.current&&!document.hidden&&(ve.raf=requestAnimationFrame(Ie)))},qe=()=>{ve.cancelled||ve.raf||(ve.raf=requestAnimationFrame(Ie))};b.current=qe,qe();const ze=()=>{if(document.hidden){cancelAnimationFrame(ve.raf),ve.raf=0;return}qe()};return document.addEventListener("visibilitychange",ze),()=>{ve.cancelled=!0,b.current=null,cancelAnimationFrame(ve.raf),document.removeEventListener("visibilitychange",ze),We()}},[$,T,k,P,r,Z,se,M]),s.useLayoutEffect(()=>{var he;(he=b.current)==null||he.call(b)},[A]);const G=()=>{H&&de(!0)},pe=()=>{H&&de(!1)},oe=$?T*100:0,Y=O(B),le={minHeight:Y,...$?{paddingTop:`${oe}%`,paddingBottom:`${oe}%`}:{}},_e={height:Y,...$?{visibility:"hidden"}:{backgroundColor:W}},me={gap:O(x),minHeight:Y},J=ie*T,Ke=fe>0?fe:Q,ke=Math.max(Q,Ke),tt=$&&ie>0&&ke>0?_h(ie,J,k,J+ke/2):"",Ye=J*2+ke,dt=tt?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${ie} ${Ye}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:tt,fill:"none",stroke:W,strokeWidth:Ke,strokeLinecap:"round",strokeLinejoin:"round"})}):null,ot=a.jsx("div",{ref:xe,className:`${o}-ribbon`,style:_e,"aria-hidden":!0}),Ve=(he,ve,We)=>a.jsx(Nh,{item:he,prefix:o,textCss:g,capHeightPx:M,opticalOffsetY:j,imageGapPx:O(x),isCurve:$},`${ve}-${We}`),Re=a.jsx("span",{ref:Fe,"aria-hidden":!0,className:`${o}-cap-ref`,style:g,children:"H"}),He=d>0&&L>0?d/L*1e3:0,Be=`${Math.max(0,He)/1e3}s`,Ze=te?a.jsx("div",{ref:re,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:G,onMouseLeave:pe,style:{WebkitAnimationDuration:Be,animationDuration:Be,WebkitAnimationPlayState:ae,animationPlayState:ae},children:Array.from({length:$e},(he,ve)=>a.jsx("div",{ref:ve===0?ee:void 0,className:`${o}-marquee-set`,style:{...me,paddingRight:O(x)},"aria-hidden":ve>0,children:Me.map((We,Je)=>Ve(We,ve,Je))},`set-${ve}`))}):a.jsx("div",{ref:ee,className:pt(`${o}-marquee-set`,`${o}-marquee-static`),style:me,children:t==null?void 0:t.map((he,ve)=>Ve(he,0,ve))});return a.jsxs("div",{ref:ce,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:F}}),Re,a.jsxs("div",{ref:z,className:`${o}-marquee-wrapper`,style:le,children:[ot,dt,Ze]})]})},Hh=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
2608
+ `}const vh=30,Ca=3,bh=12,wh=3,rs=.72,Sh=100,Ch=10,$h=e=>Math.max(0,e)/Sh,Th=e=>Math.max(0,e)/Ch,Ih=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")},Rh=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),ki={ctx:void 0},Lh=()=>ki.ctx!==void 0?ki.ctx:typeof document>"u"?(ki.ctx=null,ki.ctx):(ki.ctx=document.createElement("canvas").getContext("2d"),ki.ctx),Ph=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},Eh=e=>{e.style.transform=""},Mh=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},kh=(e,t)=>{const n=(i,o)=>{if(!i||i===t)return o;const r=o+i.offsetLeft,l=i.offsetParent;return!l||l===i?r:n(l,r)};return n(e,e.offsetWidth/2)},Ah=96,Fh=(e,t,n)=>{if(t<=0||e<=0||n<2)return null;const i=2*Math.PI/t,o=new Float64Array(n+1),r=new Float64Array(n+1),l=e*t,d=u=>Math.sqrt(1+(l*Math.cos(t*u))**2),c=i/n;return Array.from({length:n},(u,p)=>{const x=p*c,w=x+c;o[p+1]=w,r[p+1]=r[p]+(d(x)+d(w))*.5*c}),{wavelength:i,periodArc:r[n],x:o,s:r}},_h=(e,t)=>{if(e.periodArc<=0)return t;const n=t<0?-1:1,i=Math.abs(t),o=Math.floor(i/e.periodArc),r=i-o*e.periodArc,{s:l,x:d}=e,c=(m,h)=>{if(h-m<=1)return[m,h];const f=m+h>>1;return l[f]<=r?c(f,h):c(m,f)},[u,p]=c(0,l.length-1),x=l[p]-l[u],w=x>0?(r-l[u])/x:0;return n*(o*e.wavelength+d[u]+(d[p]-d[u])*w)},Nh=(e,t,n,i)=>{const o=Math.max(0,n),r=e>0?2*Math.PI*o/e:0,l=p=>i+t*Math.sin(r*p),d=p=>t*r*Math.cos(r*p),c=Math.max(4,Math.ceil(o*4)),u=Array.from({length:c},(p,x)=>{const w=x/c*e,m=(x+1)/c*e,h=m-w,f=l(w),v=l(m),C=w+h/3,y=f+d(w)*h/3,S=m-h/3,G=v-d(m)*h/3;return`C${C.toFixed(2)} ${y.toFixed(2)} ${S.toFixed(2)} ${G.toFixed(2)} ${m.toFixed(2)} ${v.toFixed(2)}`});return[`M0 ${l(0).toFixed(2)}`,...u].join(" ")},Wh=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:r,isCurve:l})=>{var m;const d=o!==0?{...n,transform:`translateY(${o}px)`}:n,c=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${rs}em`},u=((m=e.image)==null?void 0:m.url)&&a.jsx("img",{src:e.image.url,alt:e.image.name??"",className:`${t}-item-image`,style:c}),p=u&&(l?a.jsx("span",{className:`${t}-item-image-wrap`,"data-marquee-wave-node":!0,children:u}):u),x=l?a.jsx("span",{className:`${t}-text`,style:d,children:Array.from(e.text).map((h,f)=>a.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:a.jsx("span",{className:`${t}-glyph-inner`,children:h===" "?" ":h})},f))}):a.jsx("span",{className:`${t}-text`,style:d,children:e.text}),w=a.jsxs(a.Fragment,{children:[p,x]});return a.jsx("div",{className:`${t}-item`,"data-marquee-text-item":!0,style:{gap:r},children:e.link?a.jsx("a",{href:e.link,className:`${t}-item-link`,style:{gap:r},children:w}):w})},Hh=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=D.useScopedStyles(),[r,l]=s.useState(0),d=r>0?Math.round(r):0,{speed:c,direction:u,pauseOnHover:p,gap:x,layoutType:w,curveAmplitude:m,curveFrequency:h,textFontFamily:f,textFontSettings:v,textFontSize:C,textLineHeight:y,textLetterSpacing:S,textWordSpacing:G,textTextAppearance:W,textColor:U,backgroundColor:H,ribbonWidth:I}=e,z=I??y,$=w==="curve",T=$h(m),A=Th(h),_=s.useMemo(()=>xh(o,d,$),[o,d,$]),g=s.useMemo(()=>qt({fontSettings:{fontFamily:f,fontWeight:v.fontWeight,fontStyle:v.fontStyle},letterSpacing:S,wordSpacing:G,fontSize:C,lineHeight:y,textAppearance:W,color:U},n),[f,v,S,G,C,y,W,U,n]),B=k=>D.scalingValue(k,n??!1),P=((t==null?void 0:t.length)??0)>0,Y=n?!!i:!0,ie=P&&(Y||!!n),L=Math.max(0,c)*vh,O=Y&&p==="on",[K,ue]=s.useState(!1),le=Y?O&&K?"paused":"running":"paused",F=le==="running"&&L>0&&d>0,pe=s.useRef(null),j=s.useRef(null),se=s.useRef(null),ne=s.useRef(null),ve=s.useRef(null),Me=s.useRef(null),xe=s.useRef(F),b=s.useRef(null);xe.current=F;const[M,E]=s.useState(0),[V,Se]=s.useState(0),[te,$e]=s.useState(0),[re,ge]=s.useState(0),[ye,Z]=s.useState(0),Q=s.useMemo(()=>(t??[]).map(k=>{var ee;return`${k.text}\0${((ee=k.image)==null?void 0:ee.url)??""}`}).join("\0"),[t]),[ce,we]=s.useState(Ca),Pe=s.useMemo(()=>{const k=t??[];return k.length===0||!(Y||n)?k:Rh(k,ce)},[t,Y,ce,n]),Ce=ie?wh:1;s.useLayoutEffect(()=>{we(Ca),l(0)},[Q]),s.useLayoutEffect(()=>{var Be;const k=Me.current;if(!k)return;const ee=()=>{const Ve=getComputedStyle(k),rt=parseFloat(Ve.fontSize)||0;if(rt<=0)return;const Ze=Lh();if(!Ze){E(rt*rs),Se(0);return}Ze.font=`${Ve.fontStyle} ${Ve.fontWeight} ${rt}px ${Ve.fontFamily}`;const _e=Ze.measureText("H"),qe=_e.actualBoundingBoxAscent>0?_e.actualBoundingBoxAscent:rt*rs,Oe=Math.max(0,_e.actualBoundingBoxDescent||0),nt=_e.fontBoundingBoxAscent||0,at=_e.fontBoundingBoxDescent||0;E(St=>Math.abs(St-qe)>.5?qe:St);const st=nt>0||at>0?(at-Oe-(nt-qe))/2:0;Se(St=>Math.abs(St-st)>.25?st:St)};ee();const Te=typeof document<"u"?document.fonts:void 0;(Be=Te==null?void 0:Te.ready)==null||Be.then(ee).catch(()=>{});const He=new ResizeObserver(ee);return He.observe(k),()=>He.disconnect()},[g.fontFamily,g.fontWeight,g.fontStyle,g.fontSize,g.lineHeight]),s.useLayoutEffect(()=>{if(!ie)return;const k=pe.current,ee=ne.current;if(!k||!ee)return;const Te={id:0},He=()=>{const Ve=k.offsetWidth||k.getBoundingClientRect().width,rt=ee.offsetWidth||ee.getBoundingClientRect().width;if(P&&Ve>0&&rt>0){const Ze=rt/ce;if(Ze>0){const _e=Math.min(bh,Math.max(Ca,Math.ceil(Ve/Ze)+1));if(_e!==ce){we(_e);return}}}rt>0&&l(rt)};Te.id=requestAnimationFrame(He);const Be=new ResizeObserver(()=>{cancelAnimationFrame(Te.id),Te.id=requestAnimationFrame(He)});return Be.observe(k),Be.observe(ee),()=>{cancelAnimationFrame(Te.id),Be.disconnect()}},[ie,Q,ce,P,M]),s.useLayoutEffect(()=>{const k=ve.current;if(!k)return;const ee={id:0},Te=()=>{const Be=k.offsetHeight;Be>0&&Z(Ve=>Math.abs(Ve-Be)>.5?Be:Ve)};ee.id=requestAnimationFrame(Te);const He=new ResizeObserver(()=>{cancelAnimationFrame(ee.id),ee.id=requestAnimationFrame(Te)});return He.observe(k),()=>{cancelAnimationFrame(ee.id),He.disconnect()}},[z,n]),s.useLayoutEffect(()=>{if(!$){$e(0),ge(0);return}const k=pe.current,ee=ne.current;if(!k||!ee)return;const Te={id:0},He=()=>{const Ve=k.offsetWidth,rt=ee.offsetHeight;Ve>0&&ge(Ze=>Math.abs(Ze-Ve)>.5?Ve:Ze),rt>0&&$e(Ze=>Math.abs(Ze-rt)>.5?rt:Ze)};Te.id=requestAnimationFrame(He);const Be=new ResizeObserver(()=>{cancelAnimationFrame(Te.id),Te.id=requestAnimationFrame(He)});return Be.observe(k),Be.observe(ee),()=>{cancelAnimationFrame(Te.id),Be.disconnect()}},[$,Q,M,y,C,ie]),s.useLayoutEffect(()=>{if(!ie||d<=0)return;const k=se.current;k&&Ih(k)},[ie,d,u,L]),s.useLayoutEffect(()=>{if(!$||!P)return;const k=pe.current;if(!k)return;const ee={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},Te=()=>{for(const _e of ee.itemsCache)for(const qe of _e.glyphs)Eh(qe.inner)},He=()=>{const _e=j.current??k;ee.itemsCache=Array.from(k.querySelectorAll("[data-marquee-text-item]"),qe=>{const Oe=[];return qe.querySelectorAll("[data-marquee-wave-node]").forEach(nt=>{const at=nt.firstElementChild;at&&Oe.push({inner:at,layoutLocalX:kh(nt,_e)})}),{item:qe,glyphs:Oe}}),ee.cacheDirty=!1},Be=()=>{ee.cacheDirty&&He();const qe=(j.current??k).offsetWidth||1,Oe=qe*T,nt=2*Math.PI*A/qe,at=`${qe}|${Oe}|${nt}`;at!==ee.lutKey&&(ee.lutKey=at,ee.lut=Fh(Oe,nt,Ah));const st=se.current,St=st?Mh(getComputedStyle(st).transform):0,Yt=k.getBoundingClientRect(),Zt=Yt.left,vt=Yt.right,wt=ee.lut&&ee.lut.wavelength>0?Math.max(0,(ee.lut.periodArc/ee.lut.wavelength-1)*qe):0;for(const{item:Bt,glyphs:At}of ee.itemsCache){const xt=Bt.getBoundingClientRect();if(!(xt.right<Zt||xt.left>vt+wt))for(const Ft of At){const Nt=Ft.layoutLocalX+St,Ut=ee.lut?_h(ee.lut,Nt):Nt,Jt=nt*Ut,Tt=Oe*Math.sin(Jt),Wt=Oe*nt*Math.cos(Jt),rn=Math.atan(Wt)*(180/Math.PI);Ph(Ft.inner,Ut-Nt,Tt,rn)}}},Ve=()=>{ee.cancelled||(ee.raf=0,Be(),xe.current&&!document.hidden&&(ee.raf=requestAnimationFrame(Ve)))},rt=()=>{ee.cancelled||ee.raf||(ee.raf=requestAnimationFrame(Ve))};b.current=rt,rt();const Ze=()=>{if(document.hidden){cancelAnimationFrame(ee.raf),ee.raf=0;return}rt()};return document.addEventListener("visibilitychange",Ze),()=>{ee.cancelled=!0,b.current=null,cancelAnimationFrame(ee.raf),document.removeEventListener("visibilitychange",Ze),Te()}},[$,T,A,P,r,Q,ce,M]),s.useLayoutEffect(()=>{var k;(k=b.current)==null||k.call(b)},[F]);const X=()=>{O&&ue(!0)},me=()=>{O&&ue(!1)},ae=$?T*100:0,q=B(z),de={minHeight:q,...$?{paddingTop:`${ae}%`,paddingBottom:`${ae}%`}:{}},ke={height:q,...$?{visibility:"hidden"}:{backgroundColor:H}},he={gap:B(x),minHeight:q},J=re*T,Ne=ye>0?ye:te,Fe=Math.max(te,Ne),et=$&&re>0&&Fe>0?Nh(re,J,A,J+Fe/2):"",Je=J*2+Fe,dt=et?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${re} ${Je}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:et,fill:"none",stroke:H,strokeWidth:Ne,strokeLinecap:"round",strokeLinejoin:"round"})}):null,tt=a.jsx("div",{ref:ve,className:`${o}-ribbon`,style:ke,"aria-hidden":!0}),De=(k,ee,Te)=>a.jsx(Wh,{item:k,prefix:o,textCss:g,capHeightPx:M,opticalOffsetY:V,imageGapPx:B(x),isCurve:$},`${ee}-${Te}`),Ie=a.jsx("span",{ref:Me,"aria-hidden":!0,className:`${o}-cap-ref`,style:g,children:"H"}),We=d>0&&L>0?d/L*1e3:0,je=`${Math.max(0,We)/1e3}s`,Ue=ie?a.jsx("div",{ref:se,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:X,onMouseLeave:me,style:{WebkitAnimationDuration:je,animationDuration:je,WebkitAnimationPlayState:le,animationPlayState:le},children:Array.from({length:Ce},(k,ee)=>a.jsx("div",{ref:ee===0?ne:void 0,className:`${o}-marquee-set`,style:{...he,paddingRight:B(x)},"aria-hidden":ee>0,children:Pe.map((Te,He)=>De(Te,ee,He))},`set-${ee}`))}):a.jsx("div",{ref:ne,className:pt(`${o}-marquee-set`,`${o}-marquee-static`),style:he,children:t==null?void 0:t.map((k,ee)=>De(k,0,ee))});return a.jsxs("div",{ref:pe,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:_}}),Ie,a.jsxs("div",{ref:j,className:`${o}-marquee-wrapper`,style:de,children:[tt,dt,Ue]})]})},Dh=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
2609
2609
  import cn from 'classnames';
2610
2610
  import { CommonComponentProps } from '../props';
2611
2611
  import { scalingValue } from '../utils/scalingValue';
@@ -3446,7 +3446,7 @@ type MarqueeTextProps = {
3446
3446
  isPreviewMode?: boolean;
3447
3447
  isEditMode?: boolean;
3448
3448
  } & CommonComponentProps;
3449
- `,Dh={fontSettings:{type:"object",scope:"common",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Oh={type:"object",version:1,settings:{sizing:"auto manual",properties:{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"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,display:{type:"numeric-input"}},ribbonWidth:{type:"number",scope:"layout",title:"Ribbon Width",min:0,display:{type:"numeric-input"}},layoutType:{type:"string",scope:"common",title:"Path Type",display:{type:"toggle-cycle",enum:["straight","curve"]}},curveAmplitude:{type:"number",scope:"layout",title:"Amplitude",min:0,max:30,step:1,display:{type:"common-numeric-input",visible:!1}},curveFrequency:{type:"number",scope:"layout",title:"Frequency",min:0,max:100,step:1,display:{type:"common-numeric-input",visible:!1}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Dh.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"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Text Color"},backgroundColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Ribbon Color"}},defaults:{direction:"left",pauseOnHover:"off",layoutType:"curve",textFontFamily:"Antique Série",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#FFFFFF",backgroundColor:"#2E12F0"},layoutDefaults:{m:{speed:.55,gap:.04,ribbonWidth:.08,curveAmplitude:6,curveFrequency:15,textFontSize:.08,textLineHeight:.08},t:{speed:1.3,gap:.02,ribbonWidth:.11,curveAmplitude:5,curveFrequency:15,textFontSize:.07,textLineHeight:.05},d:{speed:2.5,gap:.02,ribbonWidth:.11,curveAmplitude:5,curveFrequency:18,textFontSize:.071,textLineHeight:.035}},displayRules:[{if:{name:"layoutType",value:"curve"},then:{name:"properties.curveAmplitude.display.visible",value:!0}},{if:{name:"layoutType",value:"curve"},then:{name:"properties.curveFrequency.display.visible",value:!0}}],layout:["__componentName__","speed","direction","pauseOnHover","gap","ribbonWidth","layoutType","curveAmplitude","curveFrequency"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["direction","speed"]},{type:"row",items:["ribbonWidth","gap"]},{type:"row",items:["pauseOnHover","layoutType"]},{type:"row",items:["curveAmplitude","curveFrequency"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","textFontFamily","textFontSettings",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}],paletteBookmark:{items:["textColor","backgroundColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{text:{placeholder:"Add text...",label:"Text",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{type:"media-input"}},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}}},default:[{text:"NEW WORK",image:{url:"https://cdn.cntrl.site/component-assets/marquee_text_icon.svg",name:""},link:""}]}},Bh={element:Wh,id:"marquee-text",name:"Marquee Text",category:"typography",version:1,defaultSize:{d:{width:"100%"},t:{width:"100%"},m:{width:"100%"}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Text_Marquee.mp4"},schema:Oh,sourceCode:Hh,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily"}};function zh(e,t){const n=t>0?`${t}px`:"0px";return`
3449
+ `,Oh={fontSettings:{type:"object",scope:"common",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Bh={type:"object",version:1,settings:{sizing:"auto manual",properties:{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"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,display:{type:"numeric-input"}},ribbonWidth:{type:"number",scope:"layout",title:"Ribbon Width",min:0,display:{type:"numeric-input"}},layoutType:{type:"string",scope:"common",title:"Path Type",display:{type:"toggle-cycle",enum:["straight","curve"]}},curveAmplitude:{type:"number",scope:"layout",title:"Amplitude",min:0,max:30,step:1,display:{type:"common-numeric-input",visible:!1}},curveFrequency:{type:"number",scope:"layout",title:"Frequency",min:0,max:100,step:1,display:{type:"common-numeric-input",visible:!1}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Oh.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"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Text Color"},backgroundColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Ribbon Color"}},defaults:{direction:"left",pauseOnHover:"off",layoutType:"curve",textFontFamily:"Antique Série",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#FFFFFF",backgroundColor:"#2E12F0"},layoutDefaults:{m:{speed:.55,gap:.04,ribbonWidth:.08,curveAmplitude:6,curveFrequency:15,textFontSize:.08,textLineHeight:.08},t:{speed:1.3,gap:.02,ribbonWidth:.11,curveAmplitude:5,curveFrequency:15,textFontSize:.07,textLineHeight:.05},d:{speed:2.5,gap:.02,ribbonWidth:.11,curveAmplitude:5,curveFrequency:18,textFontSize:.071,textLineHeight:.035}},displayRules:[{if:{name:"layoutType",value:"curve"},then:{name:"properties.curveAmplitude.display.visible",value:!0}},{if:{name:"layoutType",value:"curve"},then:{name:"properties.curveFrequency.display.visible",value:!0}}],layout:["__componentName__","speed","direction","pauseOnHover","gap","ribbonWidth","layoutType","curveAmplitude","curveFrequency"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["direction","speed"]},{type:"row",items:["ribbonWidth","gap"]},{type:"row",items:["pauseOnHover","layoutType"]},{type:"row",items:["curveAmplitude","curveFrequency"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","textFontFamily","textFontSettings",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}],paletteBookmark:{items:["textColor","backgroundColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{text:{placeholder:"Add text...",label:"Text",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{type:"media-input"}},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}}},default:[{text:"NEW WORK",image:{url:"https://cdn.cntrl.site/component-assets/marquee_text_icon.svg",name:""},link:""}]}},zh={element:Hh,id:"marquee-text",name:"Marquee Text",category:"typography",version:1,defaultSize:{d:{width:"100%"},t:{width:"100%"},m:{width:"100%"}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Text_Marquee.mp4"},schema:Bh,sourceCode:Dh,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily"}};function jh(e,t){const n=t>0?`${t}px`:"0px";return`
3450
3450
  .${e}-marquee-wrapper {
3451
3451
  overflow: hidden;
3452
3452
  width: 100%;
@@ -3535,7 +3535,7 @@ type MarqueeTextProps = {
3535
3535
  pointer-events: auto;
3536
3536
  z-index: 10;
3537
3537
  }
3538
- `}const jh=30,Tl=2,Vh=e=>{e.style.setProperty("animation-name","none"),e.style.setProperty("-webkit-animation-name","none"),e.offsetHeight,e.style.removeProperty("animation-name"),e.style.removeProperty("-webkit-animation-name")},Gh=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=D.useScopedStyles(),{align:l,speed:d,direction:c,pauseOnHover:u,gap:p,cardWidth:x,corners:w,stroke:m,strokeColor:h,bgColor:f,padding:v,logoMarginTop:C,logoWidth:y,logoHeight:S,captionMarginTop:V}=e,N=!!o,q=((t==null?void 0:t.length)??0)>0,W=d>0&&(!n||i),I=q&&(W||n),B=Math.max(0,d)*jh,$=G=>D.scalingValue(G,n??!1),T=s.useRef(null),k=s.useRef(null),F=s.useRef(null),[g,O]=s.useState(0),[P,X]=s.useState(0),te=P>0?P:0,L=s.useMemo(()=>zh(r,te),[r,te]),[H,U]=s.useState(0),de=W&&u==="on",[ae,A]=s.useState(!1),ce=s.useRef(null),[z,re]=s.useState(0),[ee,xe]=s.useState(0),Fe=s.useRef(null),ye=G=>{var oe,Y,le,_e,me;return{fontSettings:{fontFamily:(e==null?void 0:e[`${G}FontFamily`])??"Arial",fontWeight:((oe=e==null?void 0:e[`${G}FontSettings`])==null?void 0:oe.fontWeight)??400,fontStyle:((Y=e==null?void 0:e[`${G}FontSettings`])==null?void 0:Y.fontStyle)??"normal"},textAppearance:{textTransform:((le=e==null?void 0:e[`${G}TextAppearance`])==null?void 0:le.textTransform)??"none",textDecoration:((_e=e==null?void 0:e[`${G}TextAppearance`])==null?void 0:_e.textDecoration)??"none",fontVariant:((me=e==null?void 0:e[`${G}TextAppearance`])==null?void 0:me.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"}},b=ye("text"),M=ye("caption"),E=s.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(G=>{var pe,oe;return(((pe=G.text)==null?void 0:pe.length)??0)>0||(((oe=G.caption)==null?void 0:oe.length)??0)>0}),[t]),j=s.useMemo(()=>!I||(t==null?void 0:t.length)===0?1:P<=0||g<=0?Tl:Math.max(Tl,Math.ceil(g/P)+1),[I,t==null?void 0:t.length,P,g]);s.useLayoutEffect(()=>{if(!I)return;const G=T.current,pe=F.current;if(!G||!pe)return;let oe=0;const Y=()=>{const me=G.getBoundingClientRect().width,J=pe.getBoundingClientRect().width,Ke=Fe.current,ke=typeof Ke=="number"&&Math.abs(Ke-J)<=.25;if(Fe.current=J,O(me),typeof J=="number"&&J>0&&P<=0){X(J);return}ke&&J!==P?X(J):!ke&&P<=0&&(cancelAnimationFrame(oe),oe=requestAnimationFrame(Y))},le=()=>{cancelAnimationFrame(oe),oe=requestAnimationFrame(Y)};le();const _e=new ResizeObserver(le);return _e.observe(G),_e.observe(pe),()=>{cancelAnimationFrame(oe),_e.disconnect()}},[W,I,P]);const Ce=te>0&&B>0?te/B*1e3:0,Q=`${Math.max(0,Ce)/1e3}s`;s.useLayoutEffect(()=>{if(!I||te<=0)return;const G=k.current;G&&Vh(G)},[I,te,c]),s.useLayoutEffect(()=>{if(!I){U(0);return}const G=F.current,pe=k.current;if(!G||!pe)return;const oe=()=>{let le=0;for(let _e=0;_e<G.children.length;_e++){const J=G.children[_e].firstElementChild;J&&(le=Math.max(le,J.offsetHeight))}le<=0&&(le=pe.offsetHeight),U(le>0?le:0)};oe();const Y=new ResizeObserver(oe);return Y.observe(G),Y.observe(pe),()=>{Y.disconnect()}},[I,j,t,n,p,x,v,m,w,y,S,z,ee]);const Te=()=>{de&&A(!0)},ie=()=>{de&&A(!1)},ue=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),fe=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]),K=s.useCallback((G,pe,oe,Y)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ue,width:"100%"},children:[a.jsx("div",{"data-controls":N?Y==null?void 0:Y.controlsName:void 0,"data-controls-axis":N?"y":void 0,className:N?`${r}-control`:void 0,style:{height:$((Y==null?void 0:Y.marginTop)??0)}}),a.jsx("div",{...Y!=null&&Y.dataMeasureKind?{"data-testimonial-measure":Y.dataMeasureKind}:{},style:{...Ut(G,n),textAlign:fe,pointerEvents:"auto",...typeof(Y==null?void 0:Y.minHeightPx)=="number"&&Y.minHeightPx>0?{minHeight:Y.minHeightPx}:{}},children:a.jsx(Ri,{content:pe})})]},oe),[ue,fe,n,N,r,$]),Z=s.useCallback((G,pe,oe)=>{var Y,le,_e;return a.jsxs("div",{style:{padding:`${$(v.top)} ${$(v.right)} ${$(v.bottom)} ${$(v.left)}`,width:$(x+m*2),height:"100%",borderRadius:$(w),border:`${$(m)} solid ${h}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[a.jsx("div",{className:`${r}-cover`,style:{background:f}}),a.jsxs("div",{className:`${r}-elements-overlay`,style:{alignItems:ue,textAlign:fe},children:[G.text&&K(b,G.text,"text",oe!=null&&oe.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(oe==null?void 0:oe.textMinHeightPx)=="number"&&oe.textMinHeightPx>0?{minHeightPx:oe.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ue,width:"100%"},children:[a.jsx("div",{"data-controls":N&&!(oe!=null&&oe.dataMeasureAttrs)?"logoMarginTop":void 0,className:N&&!(oe!=null&&oe.dataMeasureAttrs)?`${r}-control`:void 0,style:{height:$(C)}}),a.jsx("div",{style:{width:$(y),height:$(S)},children:((Y=G.logo)==null?void 0:Y.url)&&a.jsx("img",{src:G.logo.url,alt:((le=G.logo)==null?void 0:le.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((_e=G.logo)==null?void 0:_e.objectFit)||"contain"}})})]}),G.caption&&K(M,G.caption,"caption",{...oe!=null&&oe.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:V,...oe!=null&&oe.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(oe==null?void 0:oe.captionMinHeightPx)=="number"&&oe.captionMinHeightPx>0?{minHeightPx:oe.captionMinHeightPx}:{}})]})]},pe)},[f,V,M,x,w,S,C,y,ue,fe,v.bottom,v.left,v.right,v.top,K,m,h,b,n,N,r]),se=s.useCallback(G=>{re(G.maxTextPx),xe(G.maxCaptionPx)},[]);s.useLayoutEffect(()=>{if(!E){se({maxTextPx:0,maxCaptionPx:0});return}const G=ce.current;if(!G)return;const pe=()=>{D.readTestimonialTextMeasure(G,se)};pe();const oe=new ResizeObserver(pe);return oe.observe(G),()=>{oe.disconnect()}},[E,se,t,Z]);const Se=E?{textMinHeightPx:z,captionMinHeightPx:ee}:void 0,Me=E?a.jsx("div",{ref:ce,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((G,pe)=>Z(G,`measure-${pe}`,{dataMeasureAttrs:!0}))}):null,$e=(G,pe)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[Z(G,`card-${pe}`,Se),N&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${$(p)})`,width:$(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},pe);if(I){const G=W?de&&ae?"paused":"running":"paused";return a.jsxs("div",{ref:T,className:pt(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...H>0?{height:H}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:L}}),Me,a.jsx("div",{ref:k,className:`${r}-marquee-track`,"data-direction":c,onMouseEnter:Te,onMouseLeave:ie,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:Q,WebkitAnimationDuration:Q,animationPlayState:G,WebkitAnimationPlayState:G},children:Array.from({length:j},(pe,oe)=>a.jsx("div",{ref:oe===0?F:void 0,className:`${r}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:$(p),paddingRight:$(p)},"aria-hidden":oe>0,children:t==null?void 0:t.map((Y,le)=>$e(Y,`${oe}-${le}`))},`set-${oe}`))})]})}return a.jsxs("div",{className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:L}}),Me,a.jsx("div",{style:{gap:$(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((G,pe)=>$e(G,pe))})]})},Xh=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
3538
+ `}const Vh=30,Tl=2,Gh=e=>{e.style.setProperty("animation-name","none"),e.style.setProperty("-webkit-animation-name","none"),e.offsetHeight,e.style.removeProperty("animation-name"),e.style.removeProperty("-webkit-animation-name")},Xh=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=D.useScopedStyles(),{align:l,speed:d,direction:c,pauseOnHover:u,gap:p,cardWidth:x,corners:w,stroke:m,strokeColor:h,bgColor:f,padding:v,logoMarginTop:C,logoWidth:y,logoHeight:S,captionMarginTop:G}=e,W=!!o,U=((t==null?void 0:t.length)??0)>0,H=d>0&&(!n||i),I=U&&(H||n),z=Math.max(0,d)*Vh,$=X=>D.scalingValue(X,n??!1),T=s.useRef(null),A=s.useRef(null),_=s.useRef(null),[g,B]=s.useState(0),[P,Y]=s.useState(0),ie=P>0?P:0,L=s.useMemo(()=>jh(r,ie),[r,ie]),[O,K]=s.useState(0),ue=H&&u==="on",[le,F]=s.useState(!1),pe=s.useRef(null),[j,se]=s.useState(0),[ne,ve]=s.useState(0),Me=s.useRef(null),xe=X=>{var ae,q,de,ke,he;return{fontSettings:{fontFamily:(e==null?void 0:e[`${X}FontFamily`])??"Arial",fontWeight:((ae=e==null?void 0:e[`${X}FontSettings`])==null?void 0:ae.fontWeight)??400,fontStyle:((q=e==null?void 0:e[`${X}FontSettings`])==null?void 0:q.fontStyle)??"normal"},textAppearance:{textTransform:((de=e==null?void 0:e[`${X}TextAppearance`])==null?void 0:de.textTransform)??"none",textDecoration:((ke=e==null?void 0:e[`${X}TextAppearance`])==null?void 0:ke.textDecoration)??"none",fontVariant:((he=e==null?void 0:e[`${X}TextAppearance`])==null?void 0:he.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${X}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${X}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${X}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${X}LineHeight`])??.01,color:(e==null?void 0:e[`${X}Color`])??"#000000"}},b=xe("text"),M=xe("caption"),E=s.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(X=>{var me,ae;return(((me=X.text)==null?void 0:me.length)??0)>0||(((ae=X.caption)==null?void 0:ae.length)??0)>0}),[t]),V=s.useMemo(()=>!I||(t==null?void 0:t.length)===0?1:P<=0||g<=0?Tl:Math.max(Tl,Math.ceil(g/P)+1),[I,t==null?void 0:t.length,P,g]);s.useLayoutEffect(()=>{if(!I)return;const X=T.current,me=_.current;if(!X||!me)return;let ae=0;const q=()=>{const he=X.getBoundingClientRect().width,J=me.getBoundingClientRect().width,Ne=Me.current,Fe=typeof Ne=="number"&&Math.abs(Ne-J)<=.25;if(Me.current=J,B(he),typeof J=="number"&&J>0&&P<=0){Y(J);return}Fe&&J!==P?Y(J):!Fe&&P<=0&&(cancelAnimationFrame(ae),ae=requestAnimationFrame(q))},de=()=>{cancelAnimationFrame(ae),ae=requestAnimationFrame(q)};de();const ke=new ResizeObserver(de);return ke.observe(X),ke.observe(me),()=>{cancelAnimationFrame(ae),ke.disconnect()}},[H,I,P]);const Se=ie>0&&z>0?ie/z*1e3:0,te=`${Math.max(0,Se)/1e3}s`;s.useLayoutEffect(()=>{if(!I||ie<=0)return;const X=A.current;X&&Gh(X)},[I,ie,c]),s.useLayoutEffect(()=>{if(!I){K(0);return}const X=_.current,me=A.current;if(!X||!me)return;const ae=()=>{let de=0;for(let ke=0;ke<X.children.length;ke++){const J=X.children[ke].firstElementChild;J&&(de=Math.max(de,J.offsetHeight))}de<=0&&(de=me.offsetHeight),K(de>0?de:0)};ae();const q=new ResizeObserver(ae);return q.observe(X),q.observe(me),()=>{q.disconnect()}},[I,V,t,n,p,x,v,m,w,y,S,j,ne]);const $e=()=>{ue&&F(!0)},re=()=>{ue&&F(!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]),Z=s.useCallback((X,me,ae,q)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ge,width:"100%"},children:[a.jsx("div",{"data-controls":W?q==null?void 0:q.controlsName:void 0,"data-controls-axis":W?"y":void 0,className:W?`${r}-control`:void 0,style:{height:$((q==null?void 0:q.marginTop)??0)}}),a.jsx("div",{...q!=null&&q.dataMeasureKind?{"data-testimonial-measure":q.dataMeasureKind}:{},style:{...qt(X,n),textAlign:ye,pointerEvents:"auto",...typeof(q==null?void 0:q.minHeightPx)=="number"&&q.minHeightPx>0?{minHeight:q.minHeightPx}:{}},children:a.jsx(Ri,{content:me})})]},ae),[ge,ye,n,W,r,$]),Q=s.useCallback((X,me,ae)=>{var q,de,ke;return a.jsxs("div",{style:{padding:`${$(v.top)} ${$(v.right)} ${$(v.bottom)} ${$(v.left)}`,width:$(x+m*2),height:"100%",borderRadius:$(w),border:`${$(m)} solid ${h}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[a.jsx("div",{className:`${r}-cover`,style:{background:f}}),a.jsxs("div",{className:`${r}-elements-overlay`,style:{alignItems:ge,textAlign:ye},children:[X.text&&Z(b,X.text,"text",ae!=null&&ae.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(ae==null?void 0:ae.textMinHeightPx)=="number"&&ae.textMinHeightPx>0?{minHeightPx:ae.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ge,width:"100%"},children:[a.jsx("div",{"data-controls":W&&!(ae!=null&&ae.dataMeasureAttrs)?"logoMarginTop":void 0,className:W&&!(ae!=null&&ae.dataMeasureAttrs)?`${r}-control`:void 0,style:{height:$(C)}}),a.jsx("div",{style:{width:$(y),height:$(S)},children:((q=X.logo)==null?void 0:q.url)&&a.jsx("img",{src:X.logo.url,alt:((de=X.logo)==null?void 0:de.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((ke=X.logo)==null?void 0:ke.objectFit)||"contain"}})})]}),X.caption&&Z(M,X.caption,"caption",{...ae!=null&&ae.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:G,...ae!=null&&ae.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(ae==null?void 0:ae.captionMinHeightPx)=="number"&&ae.captionMinHeightPx>0?{minHeightPx:ae.captionMinHeightPx}:{}})]})]},me)},[f,G,M,x,w,S,C,y,ge,ye,v.bottom,v.left,v.right,v.top,Z,m,h,b,n,W,r]),ce=s.useCallback(X=>{se(X.maxTextPx),ve(X.maxCaptionPx)},[]);s.useLayoutEffect(()=>{if(!E){ce({maxTextPx:0,maxCaptionPx:0});return}const X=pe.current;if(!X)return;const me=()=>{D.readTestimonialTextMeasure(X,ce)};me();const ae=new ResizeObserver(me);return ae.observe(X),()=>{ae.disconnect()}},[E,ce,t,Q]);const we=E?{textMinHeightPx:j,captionMinHeightPx:ne}:void 0,Pe=E?a.jsx("div",{ref:pe,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((X,me)=>Q(X,`measure-${me}`,{dataMeasureAttrs:!0}))}):null,Ce=(X,me)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[Q(X,`card-${me}`,we),W&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${$(p)})`,width:$(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},me);if(I){const X=H?ue&&le?"paused":"running":"paused";return a.jsxs("div",{ref:T,className:pt(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...O>0?{height:O}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:L}}),Pe,a.jsx("div",{ref:A,className:`${r}-marquee-track`,"data-direction":c,onMouseEnter:$e,onMouseLeave:re,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:te,WebkitAnimationDuration:te,animationPlayState:X,WebkitAnimationPlayState:X},children:Array.from({length:V},(me,ae)=>a.jsx("div",{ref:ae===0?_:void 0,className:`${r}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:$(p),paddingRight:$(p)},"aria-hidden":ae>0,children:t==null?void 0:t.map((q,de)=>Ce(q,`${ae}-${de}`))},`set-${ae}`))})]})}return a.jsxs("div",{className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:L}}),Pe,a.jsx("div",{style:{gap:$(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((X,me)=>Ce(X,me))})]})},Yh=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
3539
3539
  import cn from 'classnames';
3540
3540
  import { CommonComponentProps } from '../props';
3541
3541
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
@@ -4166,7 +4166,7 @@ type TestimonialsSettings = {
4166
4166
  logoHeight: number;
4167
4167
  captionMarginTop: number;
4168
4168
  };
4169
- `,Il={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Yh={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,max:200,display:{type:"range-control"}},align:{type:"string",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},cardWidth:{type:"number",scope:"layout",title:"width",min:0,max:400,display:{type:"numeric-input"}},corners:{type:"number",scope:"layout",title:"Corners",min:0,max:100,display:{type:"numeric-input"}},stroke:{type:"number",scope:"layout",title:"Stroke",min:0,max:10,display:{type:"numeric-input"}},strokeColor:{type:"string",scope:"common",title:"Stroke Card",display:{type:"palette-color-picker",visible:!0}},bgColor:{title:"BG card",type:"string",scope:"common",display:{type:"palette-color-picker"}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},logoMarginTop:{type:"number",scope:"layout",title:"Logo margin top",min:0,max:200,display:{type:"range-control"}},logoWidth:{type:"number",scope:"layout",title:"width",min:0,max:200,display:{type:"numeric-input"}},logoHeight:{type:"number",scope:"layout",title:"height",min:0,max:200,display:{type:"numeric-input"}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},captionColor:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Il.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Il.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}}},defaults:{direction:"left",pauseOnHover:"off",strokeColor:"#000000",bgColor:"rgba(255, 255, 255, 0.81)",textColor:"#000000",captionColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},align:"center",captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{speed:.55,gap:.04,cardWidth:.8,corners:.02,stroke:.001,padding:{top:.053,right:.026,bottom:.053,left:.026},logoMarginTop:.18,logoWidth:.21,logoHeight:.21,captionMarginTop:.056,textFontSize:.069,textLineHeight:.093,captionFontSize:.053,captionLineHeight:.069},t:{speed:1.64,gap:.02,cardWidth:.44,corners:.005,stroke:.001,padding:{top:.01,right:.01,bottom:.065,left:.01},logoMarginTop:.1,logoWidth:.052,logoHeight:.052,captionMarginTop:.005,textFontSize:.035,textLineHeight:.04,captionFontSize:.023,captionLineHeight:.029},d:{speed:1.64,gap:.02,cardWidth:.15,corners:.005,stroke:.001,padding:{top:.01,right:.01,bottom:.01,left:.01},logoMarginTop:.048,logoWidth:.055,logoHeight:.027,captionMarginTop:.005,textFontSize:.012,textLineHeight:.013,captionFontSize:.01,captionLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}}],layout:["__componentName__","speed","direction","pauseOnHover","gap","cardWidth","corners","stroke","strokeColor","bgColor","padding","logoMarginTop","logoWidth","logoHeight","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["align","direction"]},{type:"row",items:["speed","pauseOnHover"]},{type:"row",title:"Card",items:[{type:"group",title:"",items:["cardWidth","corners"]},{type:"group",title:"",items:["stroke","padding"]}]},{type:"row",title:"Image Container",items:["logoWidth","logoHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["bgColor","strokeColor","textColor","captionColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{logo:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia,"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},qh={element:Gh,id:"testimonials",name:"Eliana",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Testimonials_Grid.mp4"},defaultSize:{d:{width:"100%",height:320}},schema:Yh,sourceCode:Xh,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function Uh(e){return`
4169
+ `,Il={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},qh={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,max:200,display:{type:"range-control"}},align:{type:"string",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},cardWidth:{type:"number",scope:"layout",title:"width",min:0,max:400,display:{type:"numeric-input"}},corners:{type:"number",scope:"layout",title:"Corners",min:0,max:100,display:{type:"numeric-input"}},stroke:{type:"number",scope:"layout",title:"Stroke",min:0,max:10,display:{type:"numeric-input"}},strokeColor:{type:"string",scope:"common",title:"Stroke Card",display:{type:"palette-color-picker",visible:!0}},bgColor:{title:"BG card",type:"string",scope:"common",display:{type:"palette-color-picker"}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},logoMarginTop:{type:"number",scope:"layout",title:"Logo margin top",min:0,max:200,display:{type:"range-control"}},logoWidth:{type:"number",scope:"layout",title:"width",min:0,max:200,display:{type:"numeric-input"}},logoHeight:{type:"number",scope:"layout",title:"height",min:0,max:200,display:{type:"numeric-input"}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},captionColor:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Il.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Il.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}}},defaults:{direction:"left",pauseOnHover:"off",strokeColor:"#000000",bgColor:"rgba(255, 255, 255, 0.81)",textColor:"#000000",captionColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},align:"center",captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{speed:.55,gap:.04,cardWidth:.8,corners:.02,stroke:.001,padding:{top:.053,right:.026,bottom:.053,left:.026},logoMarginTop:.18,logoWidth:.21,logoHeight:.21,captionMarginTop:.056,textFontSize:.069,textLineHeight:.093,captionFontSize:.053,captionLineHeight:.069},t:{speed:1.64,gap:.02,cardWidth:.44,corners:.005,stroke:.001,padding:{top:.01,right:.01,bottom:.065,left:.01},logoMarginTop:.1,logoWidth:.052,logoHeight:.052,captionMarginTop:.005,textFontSize:.035,textLineHeight:.04,captionFontSize:.023,captionLineHeight:.029},d:{speed:1.64,gap:.02,cardWidth:.15,corners:.005,stroke:.001,padding:{top:.01,right:.01,bottom:.01,left:.01},logoMarginTop:.048,logoWidth:.055,logoHeight:.027,captionMarginTop:.005,textFontSize:.012,textLineHeight:.013,captionFontSize:.01,captionLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}}],layout:["__componentName__","speed","direction","pauseOnHover","gap","cardWidth","corners","stroke","strokeColor","bgColor","padding","logoMarginTop","logoWidth","logoHeight","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["align","direction"]},{type:"row",items:["speed","pauseOnHover"]},{type:"row",title:"Card",items:[{type:"group",title:"",items:["cardWidth","corners"]},{type:"group",title:"",items:["stroke","padding"]}]},{type:"row",title:"Image Container",items:["logoWidth","logoHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["bgColor","strokeColor","textColor","captionColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{logo:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia,"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},Uh={element:Xh,id:"testimonials",name:"Eliana",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Testimonials_Grid.mp4"},defaultSize:{d:{width:"100%",height:320}},schema:qh,sourceCode:Yh,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function Kh(e){return`
4170
4170
  .${e}-container {
4171
4171
  position: relative;
4172
4172
  overflow-x: clip;
@@ -4290,7 +4290,7 @@ type TestimonialsSettings = {
4290
4290
  width: 100%;
4291
4291
  height: 100%;
4292
4292
  }
4293
- `}const Kh=3e3,Zh=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=D.useScopedStyles(),l=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:x,captionMarginTop:w,imageWidth:m,imageHeight:h,controlsWidth:f,controlsColor:v,controlsHoverColor:C}=e,y=d>0&&(!n||!!i),[S,V]=s.useState(0),[N,q]=s.useState(null),[W,I]=s.useState(!1),B=s.useRef(null),$=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),T=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);s.useEffect(()=>{V(0),q(null),I(!1)},[l.length]);const k=l[S],F=N===null?null:l[N],g=ye=>{var M,E,j,Ce,Q;return{fontSettings:{fontFamily:(e==null?void 0:e[`${ye}FontFamily`])??"Arial",fontWeight:((M=e==null?void 0:e[`${ye}FontSettings`])==null?void 0:M.fontWeight)??400,fontStyle:((E=e==null?void 0:e[`${ye}FontSettings`])==null?void 0:E.fontStyle)??"normal"},textAppearance:{textTransform:((j=e==null?void 0:e[`${ye}TextAppearance`])==null?void 0:j.textTransform)??"none",textDecoration:((Ce=e==null?void 0:e[`${ye}TextAppearance`])==null?void 0:Ce.textDecoration)??"none",fontVariant:((Q=e==null?void 0:e[`${ye}TextAppearance`])==null?void 0:Q.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${ye}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${ye}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${ye}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${ye}WordSpacing`])??0,color:(e==null?void 0:e[`${ye}Color`])??"#000000"}},O=g("text"),P=g("caption"),X=l.length>1&&l.some(ye=>{var b,M;return(((b=ye.text)==null?void 0:b.length)??0)>0||(((M=ye.caption)==null?void 0:M.length)??0)>0}),te=s.useRef(null),[L,H]=s.useState(0),[U,de]=s.useState(0),ae=e.controls??{mode:"Off",icon:null},A=l.length>1,ce=s.useCallback((ye,b)=>!A||b===ye?ye:(B.current&&window.clearTimeout(B.current),q(ye),I(!0),B.current=window.setTimeout(()=>{q(null),I(!1),B.current=null},300),b),[A]),z=s.useCallback(()=>{A&&V(ye=>ce(ye,(ye-1+l.length)%l.length))},[A,ce,l.length]),re=s.useCallback(()=>{A&&V(ye=>ce(ye,(ye+1)%l.length))},[A,ce,l.length]);s.useEffect(()=>{if(!y||!A)return;const ye=Math.max(300,Kh/d),b=window.setInterval(()=>{V(M=>ce(M,(M+1)%l.length))},ye);return()=>{window.clearInterval(b)}},[y,A,ce,l.length,d]),s.useEffect(()=>()=>{B.current&&window.clearTimeout(B.current)},[]);const ee=(ye,b)=>{var Q,Te,ie,ue;const M=b==null?void 0:b.textMinHeightPx,E=b==null?void 0:b.captionMinHeightPx,j=b==null?void 0:b.dataMeasureAttrs,Ce=o&&!(b!=null&&b.dataMeasureAttrs)&&!(b!=null&&b.hideControls);return a.jsxs(a.Fragment,{children:[ye.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Ce?"textMarginTop":void 0,className:Ce?`${r}-control`:void 0,style:{height:D.scalingValue(x??0,n??!1)}}),a.jsx("div",{...j&&{"data-testimonial-measure":"text"},style:{...Ut(O,n),...M&&M>0?{minHeight:M}:{},textAlign:T,pointerEvents:"auto"},children:a.jsx(Ri,{content:ye.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Ce?"imageMarginTop":void 0,className:Ce?`${r}-control`:void 0,style:{height:D.scalingValue(p??0,n??!1)}}),a.jsx("div",{style:{width:D.scalingValue(m??0,n??!1),height:D.scalingValue(h??0,n??!1)},children:((Q=ye.image)==null?void 0:Q.url)&&a.jsx("img",{src:(Te=ye.image)==null?void 0:Te.url,alt:((ie=ye.image)==null?void 0:ie.name)??"",className:`${r}-icon`,style:{objectFit:((ue=ye.image)==null?void 0:ue.objectFit)||"contain"}})})]}),ye.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Ce?"captionMarginTop":void 0,className:Ce?`${r}-control`:void 0,style:{height:D.scalingValue(w??0,n??!1)}}),a.jsx("div",{...j?{"data-testimonial-measure":"caption"}:{},style:{...Ut(P,n),...E&&E>0?{minHeight:E}:{},textAlign:T,pointerEvents:"auto"},children:a.jsx(Ri,{content:ye.caption})})]})]})},xe=s.useCallback(ye=>{H(ye.maxTextPx),de(ye.maxCaptionPx)},[]);if(s.useLayoutEffect(()=>{if(!X){xe({maxTextPx:0,maxCaptionPx:0});return}const ye=te.current;if(!ye)return;const b=()=>{D.readTestimonialTextMeasure(ye,xe)};b();const M=new ResizeObserver(b);return M.observe(ye),()=>{M.disconnect()}},[X,xe,t]),!k)return a.jsx(a.Fragment,{});const Fe=X?{textMinHeightPx:L,captionMinHeightPx:U}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${r}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Uh(r)}}),a.jsxs("div",{className:`${r}-wrapper`,style:{width:D.scalingValue(u??0,n??!1),alignItems:$},children:[X&&a.jsx("div",{ref:te,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((ye,b)=>a.jsx("div",{style:{width:"100%"},children:ee(ye,{dataMeasureAttrs:!0})},b))}),a.jsxs("div",{className:`${r}-fade-stack`,children:[F&&W&&a.jsx("div",{className:pt(`${r}-fade-item-prev`,`${r}-fade-out`),children:ee(F,{...Fe,hideControls:!0})}),a.jsx("div",{className:pt(`${r}-fade-item-current`,W?`${r}-fade-in`:void 0),children:ee(k,Fe)})]})]}),ae.mode==="On"&&a.jsxs("div",{className:`${r}-controls`,children:[a.jsx("div",{className:`${r}-arrow`,style:{width:D.scalingValue(f??.02,n??!1),height:D.scalingValue(f??.02,n??!1),"--arrow-hover-color":C},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:z,disabled:!A,"aria-label":"Previous testimonial",children:ae.icon&&a.jsx(sn,{url:ae.icon,fill:v,hoverFill:C,className:pt(`${r}-arrow-img`,`${r}-mirror`)})})}),a.jsx("div",{className:pt(`${r}-arrow`,`${r}-next-arrow`),style:{width:D.scalingValue(f??.02,n??!1),height:D.scalingValue(f??.02,n??!1),"--arrow-hover-color":C},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:re,disabled:!A,"aria-label":"Next testimonial",children:ae.icon&&a.jsx(sn,{url:ae.icon,fill:v,hoverFill:C,className:`${r}-arrow-img`})})})]})]})})},Jh=`import cn from 'classnames';
4293
+ `}const Zh=3e3,Jh=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=D.useScopedStyles(),l=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:x,captionMarginTop:w,imageWidth:m,imageHeight:h,controlsWidth:f,controlsColor:v,controlsHoverColor:C}=e,y=d>0&&(!n||!!i),[S,G]=s.useState(0),[W,U]=s.useState(null),[H,I]=s.useState(!1),z=s.useRef(null),$=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),T=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);s.useEffect(()=>{G(0),U(null),I(!1)},[l.length]);const A=l[S],_=W===null?null:l[W],g=xe=>{var M,E,V,Se,te;return{fontSettings:{fontFamily:(e==null?void 0:e[`${xe}FontFamily`])??"Arial",fontWeight:((M=e==null?void 0:e[`${xe}FontSettings`])==null?void 0:M.fontWeight)??400,fontStyle:((E=e==null?void 0:e[`${xe}FontSettings`])==null?void 0:E.fontStyle)??"normal"},textAppearance:{textTransform:((V=e==null?void 0:e[`${xe}TextAppearance`])==null?void 0:V.textTransform)??"none",textDecoration:((Se=e==null?void 0:e[`${xe}TextAppearance`])==null?void 0:Se.textDecoration)??"none",fontVariant:((te=e==null?void 0:e[`${xe}TextAppearance`])==null?void 0:te.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${xe}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${xe}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${xe}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${xe}WordSpacing`])??0,color:(e==null?void 0:e[`${xe}Color`])??"#000000"}},B=g("text"),P=g("caption"),Y=l.length>1&&l.some(xe=>{var b,M;return(((b=xe.text)==null?void 0:b.length)??0)>0||(((M=xe.caption)==null?void 0:M.length)??0)>0}),ie=s.useRef(null),[L,O]=s.useState(0),[K,ue]=s.useState(0),le=e.controls??{mode:"Off",icon:null},F=l.length>1,pe=s.useCallback((xe,b)=>!F||b===xe?xe:(z.current&&window.clearTimeout(z.current),U(xe),I(!0),z.current=window.setTimeout(()=>{U(null),I(!1),z.current=null},300),b),[F]),j=s.useCallback(()=>{F&&G(xe=>pe(xe,(xe-1+l.length)%l.length))},[F,pe,l.length]),se=s.useCallback(()=>{F&&G(xe=>pe(xe,(xe+1)%l.length))},[F,pe,l.length]);s.useEffect(()=>{if(!y||!F)return;const xe=Math.max(300,Zh/d),b=window.setInterval(()=>{G(M=>pe(M,(M+1)%l.length))},xe);return()=>{window.clearInterval(b)}},[y,F,pe,l.length,d]),s.useEffect(()=>()=>{z.current&&window.clearTimeout(z.current)},[]);const ne=(xe,b)=>{var te,$e,re,ge;const M=b==null?void 0:b.textMinHeightPx,E=b==null?void 0:b.captionMinHeightPx,V=b==null?void 0:b.dataMeasureAttrs,Se=o&&!(b!=null&&b.dataMeasureAttrs)&&!(b!=null&&b.hideControls);return a.jsxs(a.Fragment,{children:[xe.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Se?"textMarginTop":void 0,className:Se?`${r}-control`:void 0,style:{height:D.scalingValue(x??0,n??!1)}}),a.jsx("div",{...V&&{"data-testimonial-measure":"text"},style:{...qt(B,n),...M&&M>0?{minHeight:M}:{},textAlign:T,pointerEvents:"auto"},children:a.jsx(Ri,{content:xe.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Se?"imageMarginTop":void 0,className:Se?`${r}-control`:void 0,style:{height:D.scalingValue(p??0,n??!1)}}),a.jsx("div",{style:{width:D.scalingValue(m??0,n??!1),height:D.scalingValue(h??0,n??!1)},children:((te=xe.image)==null?void 0:te.url)&&a.jsx("img",{src:($e=xe.image)==null?void 0:$e.url,alt:((re=xe.image)==null?void 0:re.name)??"",className:`${r}-icon`,style:{objectFit:((ge=xe.image)==null?void 0:ge.objectFit)||"contain"}})})]}),xe.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Se?"captionMarginTop":void 0,className:Se?`${r}-control`:void 0,style:{height:D.scalingValue(w??0,n??!1)}}),a.jsx("div",{...V?{"data-testimonial-measure":"caption"}:{},style:{...qt(P,n),...E&&E>0?{minHeight:E}:{},textAlign:T,pointerEvents:"auto"},children:a.jsx(Ri,{content:xe.caption})})]})]})},ve=s.useCallback(xe=>{O(xe.maxTextPx),ue(xe.maxCaptionPx)},[]);if(s.useLayoutEffect(()=>{if(!Y){ve({maxTextPx:0,maxCaptionPx:0});return}const xe=ie.current;if(!xe)return;const b=()=>{D.readTestimonialTextMeasure(xe,ve)};b();const M=new ResizeObserver(b);return M.observe(xe),()=>{M.disconnect()}},[Y,ve,t]),!A)return a.jsx(a.Fragment,{});const Me=Y?{textMinHeightPx:L,captionMinHeightPx:K}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${r}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Kh(r)}}),a.jsxs("div",{className:`${r}-wrapper`,style:{width:D.scalingValue(u??0,n??!1),alignItems:$},children:[Y&&a.jsx("div",{ref:ie,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((xe,b)=>a.jsx("div",{style:{width:"100%"},children:ne(xe,{dataMeasureAttrs:!0})},b))}),a.jsxs("div",{className:`${r}-fade-stack`,children:[_&&H&&a.jsx("div",{className:pt(`${r}-fade-item-prev`,`${r}-fade-out`),children:ne(_,{...Me,hideControls:!0})}),a.jsx("div",{className:pt(`${r}-fade-item-current`,H?`${r}-fade-in`:void 0),children:ne(A,Me)})]})]}),le.mode==="On"&&a.jsxs("div",{className:`${r}-controls`,children:[a.jsx("div",{className:`${r}-arrow`,style:{width:D.scalingValue(f??.02,n??!1),height:D.scalingValue(f??.02,n??!1),"--arrow-hover-color":C},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:j,disabled:!F,"aria-label":"Previous testimonial",children:le.icon&&a.jsx(sn,{url:le.icon,fill:v,hoverFill:C,className:pt(`${r}-arrow-img`,`${r}-mirror`)})})}),a.jsx("div",{className:pt(`${r}-arrow`,`${r}-next-arrow`),style:{width:D.scalingValue(f??.02,n??!1),height:D.scalingValue(f??.02,n??!1),"--arrow-hover-color":C},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:se,disabled:!F,"aria-label":"Next testimonial",children:le.icon&&a.jsx(sn,{url:le.icon,fill:v,hoverFill:C,className:`${r}-arrow-img`})})})]})]})})},Qh=`import cn from 'classnames';
4294
4294
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
4295
4295
  import { CommonComponentProps } from '../props';
4296
4296
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
@@ -4786,12 +4786,12 @@ type TestimonialsSettings = {
4786
4786
  icon?: string | null;
4787
4787
  };
4788
4788
  };
4789
- `,Qh="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 18" width="10" height="18"><path fill="#000000" fill-rule="evenodd" 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" transform="translate(5, 9) rotate(-90) translate(-5, -9)"/></svg>'),Rl={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},ef={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},align:{type:"string",scope:"common",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},width:{type:"number",scope:"layout",title:"width",min:0,max:1e3,display:{type:"numeric-input"}},imageWidth:{type:"number",scope:"layout",title:"width",min:0,max:300,display:{type:"numeric-input"}},imageHeight:{type:"number",scope:"layout",title:"height",min:0,max:300,display:{type:"numeric-input"}},imageMarginTop:{type:"number",scope:"layout",title:"Image margin top",min:0,max:200,display:{type:"range-control"}},textMarginTop:{type:"number",scope:"layout",title:"Text margin top",min:0,max:200,display:{type:"range-control"}},controls:{type:"object",scope:"common",title:"Controls",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},controlsWidth:{type:"number",scope:"layout",title:"Controls width",min:0,max:100,display:{type:"numeric-input"}},controlsColor:{type:"string",scope:"common",title:"Controls Default",display:{type:"settings-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"settings-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Rl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},captionColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Caption Default"},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Rl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Text Default"}},defaults:{controls:{mode:"On",icon:Qh},controlsColor:"#000000",controlsHoverColor:"#EABC01",align:"center",textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},captionColor:"#000000"},layoutDefaults:{m:{speed:1,width:.69,imageMarginTop:.08,captionMarginTop:.04,textMarginTop:0,textFontSize:.069,captionFontSize:.053,textLineHeight:.093,captionLineHeight:.069,imageWidth:.21,imageHeight:.21,controlsWidth:.06},t:{speed:1,width:.65,imageMarginTop:.026,captionMarginTop:.01,textMarginTop:0,textFontSize:.035,captionFontSize:.023,textLineHeight:.04,captionLineHeight:.029,imageWidth:.05,imageHeight:.05,controlsWidth:.026},d:{speed:1,width:.35,imageMarginTop:.02,textMarginTop:0,captionMarginTop:.01,textFontSize:.016,captionFontSize:.009,textLineHeight:.018,captionLineHeight:.009,imageWidth:.027,imageHeight:.027,controlsWidth:.014}},layout:["__componentName__","speed","width","imageMarginTop","textMarginTop","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["width","align"]},{type:"row",items:["controls"]},{type:"row",items:["controlsWidth","speed"]},{type:"row",title:"Image Container",items:["imageWidth","imageHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["textColor","captionColor","controlsColor","controlsHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia,"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},tf={element:Zh,id:"testimonial-single",name:"Clara",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Testimonials_Single.png"},defaultSize:{d:{width:700},t:{width:700},m:{width:334}},schema:ef,sourceCode:Jh,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function nf(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ll(e){return((e==null?void 0:e.trim().length)??0)>0}function $a(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Ta(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:D.scalingValue((o-t)/2,i)}}function of(e){return`
4789
+ `,ef="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 18" width="10" height="18"><path fill="#000000" fill-rule="evenodd" 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" transform="translate(5, 9) rotate(-90) translate(-5, -9)"/></svg>'),Rl={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},tf={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},align:{type:"string",scope:"common",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},width:{type:"number",scope:"layout",title:"width",min:0,max:1e3,display:{type:"numeric-input"}},imageWidth:{type:"number",scope:"layout",title:"width",min:0,max:300,display:{type:"numeric-input"}},imageHeight:{type:"number",scope:"layout",title:"height",min:0,max:300,display:{type:"numeric-input"}},imageMarginTop:{type:"number",scope:"layout",title:"Image margin top",min:0,max:200,display:{type:"range-control"}},textMarginTop:{type:"number",scope:"layout",title:"Text margin top",min:0,max:200,display:{type:"range-control"}},controls:{type:"object",scope:"common",title:"Controls",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},controlsWidth:{type:"number",scope:"layout",title:"Controls width",min:0,max:100,display:{type:"numeric-input"}},controlsColor:{type:"string",scope:"common",title:"Controls Default",display:{type:"settings-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"settings-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Rl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},captionColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Caption Default"},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Rl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Text Default"}},defaults:{controls:{mode:"On",icon:ef},controlsColor:"#000000",controlsHoverColor:"#EABC01",align:"center",textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},captionColor:"#000000"},layoutDefaults:{m:{speed:1,width:.69,imageMarginTop:.08,captionMarginTop:.04,textMarginTop:0,textFontSize:.069,captionFontSize:.053,textLineHeight:.093,captionLineHeight:.069,imageWidth:.21,imageHeight:.21,controlsWidth:.06},t:{speed:1,width:.65,imageMarginTop:.026,captionMarginTop:.01,textMarginTop:0,textFontSize:.035,captionFontSize:.023,textLineHeight:.04,captionLineHeight:.029,imageWidth:.05,imageHeight:.05,controlsWidth:.026},d:{speed:1,width:.35,imageMarginTop:.02,textMarginTop:0,captionMarginTop:.01,textFontSize:.016,captionFontSize:.009,textLineHeight:.018,captionLineHeight:.009,imageWidth:.027,imageHeight:.027,controlsWidth:.014}},layout:["__componentName__","speed","width","imageMarginTop","textMarginTop","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["width","align"]},{type:"row",items:["controls"]},{type:"row",items:["controlsWidth","speed"]},{type:"row",title:"Image Container",items:["imageWidth","imageHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["textColor","captionColor","controlsColor","controlsHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia,"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},nf={element:Jh,id:"testimonial-single",name:"Clara",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Testimonials_Single.png"},defaultSize:{d:{width:700},t:{width:700},m:{width:334}},schema:tf,sourceCode:Qh,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function of(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ll(e){return((e==null?void 0:e.trim().length)??0)>0}function $a(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Ta(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:D.scalingValue((o-t)/2,i)}}function rf(e){return`
4790
4790
  .${e}-wrapper {
4791
4791
  display: grid;
4792
4792
  align-items: start;
4793
4793
  justify-content: center;
4794
- min-height: ${nf(48)};
4794
+ min-height: ${of(48)};
4795
4795
  }
4796
4796
  .${e}-item {
4797
4797
  display: flex;
@@ -5133,7 +5133,7 @@ type TestimonialsSettings = {
5133
5133
  z-index: 2;
5134
5134
  width: 100%;
5135
5135
  }
5136
- `}function rf(){return Math.random()<.5?"ltr":"ttb"}function af(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function sf(e){const t=rf();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{af(e)})})}const bn=500,lf=750,jn="cubic-bezier(0.22, 1, 0.36, 1)",cf=72,df=50;function uf(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 pf(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function mf(e){const[t]=e.media;return t!=null&&t.url?t:null}function Ld(e){return!Array.isArray(e)||e.length===0?[]:uf(e)?e.flatMap(t=>{const n=pf(t);if(!n)return[];const i=mf(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 $i(e){return e.type==="video"}function gf(e){const t=new Set,n=[];for(const i of e){const o=Ld(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 hf({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=>$i(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 ff(e){e.pause(),e.removeAttribute("src"),e.load()}function Pl({media:e,className:t,style:n,onMediaClick:i}){return $i(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 El(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function yf(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 xf({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{ff(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 vf({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",x=s.useRef(null),w=s.useRef(null),m=s.useRef(null),h=s.useRef(null),f=s.useRef(0),v=s.useRef(0),C=s.useRef("none"),y=s.useRef(!1),S=s.useRef(!1),V=s.useRef(null),N=s.useRef(0),q=s.useRef(null),W=s.useRef(!1),I=s.useRef(null),B=s.useRef(null),$=s.useRef(null),T=s.useRef(()=>{}),[k,F]=s.useState(null),[g,O]=s.useState(null),[P,X]=s.useState("opening"),[te,L]=s.useState(0),[H,U]=s.useState(0),[de,ae]=s.useState(null),[A,ce]=s.useState(!1),[z,re]=s.useState(!1),[ee,xe]=s.useState(!1),[Fe,ye]=s.useState(null),b=s.useRef(n),M=s.useRef(void 0),E=t[n],j=E?$i(E):!1,Ce=H!==0||A,Q=de!==null,Te=s.useCallback(he=>{const ve=he.currentTarget,We=ve instanceof HTMLVideoElement?{width:ve.videoWidth,height:ve.videoHeight}:{width:ve.naturalWidth,height:ve.naturalHeight};!We.width||!We.height||ye(We)},[]);s.useEffect(()=>{V.current=g},[g]),s.useEffect(()=>{const he=x.current;if(!he)return;const ve=()=>O(El(he));ve();const We=new ResizeObserver(ve);return We.observe(he),()=>We.disconnect()},[]);const ie=s.useCallback(()=>{I.current!==null&&(window.clearTimeout(I.current),I.current=null)},[]),ue=s.useCallback(()=>{const he=B.current;B.current=null,ie(),q.current=null,W.current=!1,ae(null),ce(!1),U(0),N.current=0,re(!1),y.current=!1,v.current=0,C.current="none",he===1?d():he===-1&&l()},[ie,d,l]),fe=s.useCallback(()=>{ie(),B.current=null,q.current=null,W.current=!1,ae(null),ce(!1),U(0),N.current=0},[ie]),K=s.useCallback(()=>{ie(),I.current=window.setTimeout(()=>{B.current!==null&&ue()},bn+32)},[ie,ue]),Z=s.useCallback((he,ve)=>{var Je;const We=((Je=V.current)==null?void 0:Je.width)??0;if(ie(),q.current=he,ae(he),W.current=!0,ce(!0),ve){B.current=he;const be=-he*We;N.current=be,U(be),K();return}N.current=0,U(0),I.current=window.setTimeout(()=>{I.current=null,fe()},bn+32)},[ie,fe,K]),se=s.useCallback(he=>{if(!(t.length<=1)){if(W.current){if(B.current===he){$.current=he,ue();return}fe()}ie(),q.current=he,ae(he),W.current=!1,ce(!1),N.current=0,U(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Z(he,!0)})})}},[t.length,Z,ue,fe,ie]);T.current=se;const Se=s.useCallback(he=>{he.propertyName!=="transform"||!W.current||B.current!==null&&ue()},[ue]),Me=s.useCallback(()=>{const he=w.current;if(!he)return;const ve=El(he);!ve.width||!ve.height||F(ve)},[]);s.useEffect(()=>{Me();const he=w.current;if(!he)return;const ve=new ResizeObserver(()=>Me());return ve.observe(he),()=>ve.disconnect()},[Me]),s.useEffect(()=>{P==="opening"&&k&&X("open")},[P,k]),s.useEffect(()=>{if(P!=="closing")return;const he=setTimeout(()=>r(),bn);return()=>clearTimeout(he)},[P,r]),s.useEffect(()=>()=>{ie()},[ie]),s.useLayoutEffect(()=>{b.current===n&&M.current===(E==null?void 0:E.url)||(ie(),B.current=null,ae(null),L(0),U(0),ce(!1),xe(!1),re(!1),ye(null),f.current=0,v.current=0,C.current="none",y.current=!1,W.current=!1,N.current=0,q.current=null,h.current=null,S.current=!1,b.current=n,M.current=E==null?void 0:E.url)},[n,E==null?void 0:E.url,ie]),s.useLayoutEffect(()=>{const he=$.current;he!==null&&($.current=null,requestAnimationFrame(()=>{T.current(he)}))},[n,E==null?void 0:E.url]),s.useEffect(()=>{if(P!=="open")return;let he=null;const ve=()=>{he&&(document.removeEventListener("click",he,!0),he=null)},We=()=>{ve(),he=ze=>{ze.stopPropagation(),ze.preventDefault(),ve()},document.addEventListener("click",he,!0)},Je=ze=>{const Le=ze<0?1:-1;if(Math.abs(ze)>df&&t.length>1){Z(Le,!0);return}Z(Le,!1)},be=ze=>{if(ze.touches.length!==1||W.current)return;const Le=ze.touches[0];S.current=!0,h.current={x:Le.clientX,y:Le.clientY},C.current="none",v.current=0,y.current=!1},Ie=ze=>{if(!h.current||ze.touches.length!==1||W.current)return;const Le=ze.touches[0],Ge=Le.clientX-h.current.x,De=Le.clientY-h.current.y;if(C.current==="none"){if(Math.abs(Ge)<10&&Math.abs(De)<10)return;if(Math.abs(Ge)>Math.abs(De)){if(t.length<=1)return;C.current="horizontal"}else if(De>0)C.current="vertical";else return}if(C.current==="horizontal"){y.current=!0,re(!0),v.current=Ge;const nt=Ge<0?1:-1;q.current!==nt&&(q.current=nt,ae(nt)),N.current=Ge,U(Ge),ze.preventDefault();return}C.current==="vertical"&&(y.current=!0,re(!0),f.current=De,L(De),ze.preventDefault())},qe=()=>{if(!h.current)return;const ze=C.current,Le=y.current;if(Le&&ze==="horizontal")Je(v.current),We();else if(Le&&ze==="vertical")if(f.current>cf){const De=window.innerHeight;f.current=De,xe(!0),L(De),X("closing")}else f.current=0,L(0),We();else ze==="horizontal"&&Math.abs(v.current)>0&&(Je(v.current),We());h.current=null,C.current="none",v.current=0,y.current=!1,re(!1)};return document.addEventListener("touchstart",be,{passive:!0}),document.addEventListener("touchmove",Ie,{passive:!1}),document.addEventListener("touchend",qe),document.addEventListener("touchcancel",qe),()=>{document.removeEventListener("touchstart",be),document.removeEventListener("touchmove",Ie),document.removeEventListener("touchend",qe),document.removeEventListener("touchcancel",qe),ve()}},[P,t.length,Z]),s.useEffect(()=>{const he=ve=>{ve.key==="Escape"&&(ve.preventDefault(),ve.stopPropagation(),P!=="closing"&&X("closing"))};return window.addEventListener("keydown",he,!0),()=>window.removeEventListener("keydown",he,!0)},[P]);const $e=()=>{P!=="closing"&&X("closing")},G=P==="open",pe=P==="closing",oe=te>0?Math.max(0,1-te/500):1,Y=te>0?Math.max(.35,1-te/500):1,le=k?p?k:yf(k,Fe):null,_e=he=>{if(he.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const ve=le??he.currentTarget.getBoundingClientRect(),We=he.clientY-ve.top,Je=Math.min(52,ve.height*.2);if(!(We>ve.height-Je)){if(he.clientX-ve.left<ve.width/2){se(-1);return}se(1)}},me=he=>{if(t.length<=1)return;const ve=le??he.currentTarget.getBoundingClientRect(),We=he.clientX-ve.left,Je=he.clientY-ve.top,be=Math.min(52,ve.height*.2);if(Je>ve.height-be){he.currentTarget.style.cursor="default";return}he.currentTarget.style.cursor=We<ve.width/2?"w-resize":"e-resize"},J={position:"fixed",top:g==null?void 0:g.top,left:g==null?void 0:g.left,width:g==null?void 0:g.width,height:g==null?void 0:g.height,zIndex:9998},Ke=p?"cover":"contain",ke=H!==0||te>0?`translate(${H}px, ${te}px)`:void 0,tt=z&&!A?"none":A?`transform ${bn}ms ${jn}`:ee?`transform ${bn}ms ${jn}, opacity ${bn}ms ${jn}`:P==="opening"||pe?`opacity ${bn}ms ${jn}`:"none",Ye={...J,transform:ke,opacity:te>0?Y:P==="opening"||pe?0:1,transition:tt,pointerEvents:"none"},dt={position:"absolute",top:((le==null?void 0:le.top)??0)-((g==null?void 0:g.top)??0),left:((le==null?void 0:le.left)??0)-((g==null?void 0:g.left)??0),width:le==null?void 0:le.width,height:le==null?void 0:le.height,objectFit:Ke,pointerEvents:j&&G&&!Ce?"auto":"none",touchAction:j&&G?"none":void 0},ot=(g==null?void 0:g.width)??0,Ve=Q?(n+de+t.length)%t.length:null,Re=Ve!==null?t[Ve]:null,He={...J,transform:Q?`translateX(${de*ot+H}px)`:void 0,opacity:1,transition:A?`transform ${bn}ms ${jn}`:"none",pointerEvents:"none"},Be={position:"absolute",top:((k==null?void 0:k.top)??0)-((g==null?void 0:g.top)??0),left:((k==null?void 0:k.left)??0)-((g==null?void 0:g.left)??0),width:k==null?void 0:k.width,height:k==null?void 0:k.height,objectFit:Ke,pointerEvents:"none"},Ze=le?{position:"fixed",top:le.top,height:le.height,width:le.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:x,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:P==="open"?"none":void 0},onClick:$e,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:G?oe:0,transition:z?"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:w,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:w,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]})})]})}),k&&g&&Re&&a.jsx("div",{style:He,onTransitionEnd:Se,children:$i(Re)?a.jsx("video",{src:Re.url,muted:!0,playsInline:!0,preload:"auto",style:Be},`neighbor-${Ve}-${Re.url}`):a.jsx("img",{src:Re.url,alt:Re.name,style:Be},`neighbor-${Ve}-${Re.url}`)}),k&&g&&E&&a.jsx("div",{style:Ye,onTransitionEnd:Se,children:j?a.jsx(xf,{src:E.url,phase:P,mediaRef:m,mediaStyle:dt,onLoadedMetadata:Te,onClick:_e,onMouseMove:me},`${n}-${E.url}`):a.jsx("img",{ref:m,src:E.url,alt:E.name,onLoad:Te,style:dt},`${n}-${E.url}`)}),G&&Ze&&t.length>1&&!j&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ze,left:le.left,cursor:"w-resize",pointerEvents:z?"none":"auto"},onClick:he=>{if(S.current){S.current=!1;return}he.stopPropagation(),se(-1)}}),a.jsx("div",{style:{...Ze,left:le.left+le.width/2,cursor:"e-resize",pointerEvents:z?"none":"auto"},onClick:he=>{if(S.current){S.current=!1;return}he.stopPropagation(),se(1)}})]})]})}function bf(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function wf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=D.useScopedStyles(),{type:p="a",gridLayout:x,textBoxWidth:w=100,verticalGap:m,entriesCount:h,lightbox:f,imageDisplay:v,imageCorners:C,lightboxImageDisplay:y,slider:S,sliderTiming:V,direction:N,transition:q,titleMarginTop:W,subtitleMarginTop:I,titleColor:B,subtitleColor:$,lightboxCounterColor:T,titleFontFamily:k,titleFontSettings:F,titleFontSize:g,titleLineHeight:O,titleLetterSpacing:P,titleWordSpacing:X,titleTextAppearance:te,subtitleFontFamily:L,subtitleFontSettings:H,subtitleFontSize:U,subtitleLineHeight:de,subtitleLetterSpacing:ae,subtitleWordSpacing:A,subtitleTextAppearance:ce,lightboxCounterFontFamily:z,lightboxCounterFontSettings:re,lightboxCounterFontSize:ee,lightboxCounterLineHeight:xe,lightboxCounterLetterSpacing:Fe,lightboxCounterWordSpacing:ye,lightboxCounterTextAppearance:b,showText:M="always",alignEntries:E="off",align:j="top"}=e,Ce={fontSettings:{fontFamily:k,fontWeight:(F==null?void 0:F.fontWeight)??400,fontStyle:(F==null?void 0:F.fontStyle)??"normal"},fontSize:g??.01,lineHeight:O,letterSpacing:P??0,wordSpacing:X??0,textAppearance:te,color:B},Te={...an(Ut(Ce,n))},ie={fontSettings:{fontFamily:L,fontWeight:(H==null?void 0:H.fontWeight)??400,fontStyle:(H==null?void 0:H.fontStyle)??"normal"},fontSize:U??.01,lineHeight:de,letterSpacing:ae??0,wordSpacing:A??0,textAppearance:ce,color:$},fe={...an(Ut(ie,n))},K={fontSettings:{fontFamily:z,fontWeight:(re==null?void 0:re.fontWeight)??400,fontStyle:(re==null?void 0:re.fontStyle)??"normal"},fontSize:ee??.01,lineHeight:xe,letterSpacing:Fe??0,wordSpacing:ye??0,textAppearance:b,color:T},se={...an(Ut(K,n)),...Ta(ee,xe,u,n)},Se=$a(g,O,`${u}-item-title`,`${u}-text-tight-leading`),Me=$a(U,de,`${u}-item-subtitle`,`${u}-text-tight-leading`),$e=Ta(g,O,u,n),G=Ta(U,de,u,n),pe=$a(ee,xe,`${u}-lightbox-counter`,`${u}-text-tight-leading`),oe=D.buildColorVars(u,{titleColor:B,subtitleColor:$,lightboxCounterColor:T},Sf,Cf),_e=`${l&&l!=="default"?`${u}-state-${l}`:""}${M==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),me=h===0?1/0:h,J=(t??[]).slice(0,me),Ke=s.useMemo(()=>f==="on"?gf(J):[],[J,f]),ke=x.entryWidth??.2,tt=(v==null?void 0:v.display)==="cover",Ye=(v==null?void 0:v.ratioValue)??"1:1",dt=(v==null?void 0:v.reversed)??!1,[ot,Ve]=Ye.split(":").map(Number),Be=`${dt?Ve:ot} / ${dt?ot:Ve}`,Ze=x.columnsCount,he=D.scalingValue(ke??0,n),ve=he,We=!tt&&S!=="off",Je=J.length%Ze||Ze,be=Je<Ze&&J.length>0,Ie=J.length-Je,qe=be?Math.floor((Ze-Je)/2)+1:1,ze=C?D.scalingValue(C,n):void 0,Le={width:ve,...tt?{aspectRatio:Be,height:"auto",overflow:"hidden"}:{height:"auto"},...ze?{borderRadius:ze,overflow:"hidden"}:{}},Ge=`${u}-item-image-wrapper${We?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),De=p==="d"||p==="e"||p==="f",nt=E==="on",it=`calc(${D.scalingValue(ke??0,n)} * (${w} / 100))`,ct=D.scalingValue(ke*w/100,n),St=tt?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...ze?{borderRadius:ze}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...ze?{borderRadius:ze}:{}},[Bt,zt]=s.useState(0),ft=s.useRef(null),wt=q==="fade"||N==="horizontal"?"ltr":N==="vertical"?"ttb":"ltr";s.useEffect(()=>{const gt=ft.current;if(!gt)return;const Ae=new ResizeObserver(Xe=>{zt(Math.round(Xe[0].contentRect.width))});return Ae.observe(gt),()=>Ae.disconnect()},[]);const jt=(()=>{const gt={...oe},Ae=ft.current?getComputedStyle(ft.current).getPropertyValue("--cntrl-article-width").trim():"";return Ae&&(gt["--cntrl-article-width"]=Ae),gt})(),[At,vt]=s.useState(!1),[Ft,Nt]=s.useState([]),[Kt,Jt]=s.useState(0),Tt=f==="on"&&(!n||i),Wt=(gt,Ae)=>{n&&!i||f!=="off"&&(Nt(gt),Jt(Ae),vt(!0))};s.useEffect(()=>{if(!At||f!=="on"||typeof document>"u")return;const gt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=gt}},[At,f]),s.useEffect(()=>{!n||i||vt(!1)},[n,i]);const rn=s.useMemo(()=>of(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:rn}}),f==="on"&&a.jsx(hf,{mediaList:Ke}),a.jsx("div",{style:oe,children:a.jsx("div",{ref:ft,className:`${u}-wrapper ${u}-type-${p}${nt?` ${u}-align-entries`:""} ${u}-image-align-${j} ${_e}`.trim(),style:{gridTemplateColumns:`repeat(${Ze}, ${he})`,rowGap:nt?0:D.scalingValue(m??0,n),columnGap:D.scalingValue(x.horizontalGap??0,n),width:D.scalingValue(x.wrapperWidth??0,n),...nt?{[`--${u}-align-entries-row-gap`]:D.scalingValue(m??0,n)}:{}},children:J.map((gt,Ae)=>{var _t;const Xe=Ll(gt.title),st=Ll(gt.subtitle),ht=(((_t=gt.link)==null?void 0:_t.length)??0)>0&&f==="off"?gt.link:void 0,yt=Math.floor(Ae/Ze)===Math.ceil(J.length/Ze)-1,Lt=be&&Ae>=Ie?`${qe+(Ae-Ie)}`:void 0,mt=De?a.jsxs("div",{className:`${u}-item-text-block`,children:[Xe&&a.jsx("p",{className:Se,style:{width:it,...Te,...$e},children:gt.title}),Xe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(W??0,n),width:ct}}),st&&a.jsx("p",{className:Me,style:{width:it,...fe,...G},children:gt.subtitle}),st&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(I??0,n),width:ct}})]}):null,Vt=nt?a.jsxs("div",{className:`${u}-item-title-row`,children:[!De&&a.jsx("div",{"data-controls":o&&Xe?"titleMarginTop":void 0,className:o&&Xe?`${u}-control`:void 0,style:{height:Xe?D.scalingValue(W??0,n):0,width:ct}}),Xe&&a.jsx("p",{className:Se,style:{width:it,...Te,...$e},children:gt.title}),De&&Xe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(W??0,n),width:ct}})]}):null,kt=nt?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!De&&a.jsx("div",{"data-controls":o&&st?"subtitleMarginTop":void 0,className:o&&st?`${u}-control`:void 0,style:{height:st?D.scalingValue(I??0,n):0,width:ct}}),st&&a.jsx("p",{className:Me,style:{width:it,...fe,...G},children:gt.subtitle}),De&&st&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(I??0,n),width:ct}})]}):null,Mt=ht?a.jsxs("a",{href:ht,target:"_blank",className:`${u}-item-text-link`,children:[Vt,kt]}):a.jsxs(a.Fragment,{children:[Vt,kt]}),Xt=Ld(gt.gallery),Yt=Xt.filter(Ct=>Ct.lightboxMedia).map(Ct=>Ct.lightboxMedia),Ht=a.jsx("div",{className:Ge,style:Le,children:Xt.length===0?null:S==="off"?(()=>{const{displayMedia:Ct,lightboxMedia:_}=Xt[0],Pe=_?Yt.findIndex(Ne=>Ne.url===_.url):-1;return a.jsx(Pl,{media:Ct,className:`${u}-item-${$i(Ct)?"video":"image"}`.trim(),style:St,onMediaClick:Tt&&Pe>=0?()=>Wt(Yt,Pe):void 0})})():a.jsxs(a.Fragment,{children:[We&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Xt.map(({displayMedia:Ct})=>$i(Ct)?a.jsx("video",{src:Ct.url,muted:!0,playsInline:!0},`sizer-${Ct.url}`):a.jsx("img",{src:Ct.url,alt:""},`sizer-${Ct.url}`))}),a.jsx(zs,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:V*1e3,width:"100%",height:"100%",speed:lf,type:q==="fade"?"fade":"loop",rewind:q==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:wt},onMoved:Ct=>{N!=="random"||q==="fade"||sf(Ct)},children:Xt.map(({displayMedia:Ct,lightboxMedia:_},Pe)=>{const Ne=_?Yt.findIndex(Oe=>Oe.url===_.url):-1;return a.jsx(js,{children:a.jsx(Pl,{media:Ct,className:`${u}-item-${$i(Ct)?"video":"image"}`.trim(),style:St,onMediaClick:Tt&&Ne>=0?()=>Wt(Yt,Ne):void 0})},Pe)})},`${q}-${ke}-${N}-${V}-${Bt}-${d}`)]})}),Dt=De?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&Xe?"titleMarginTop":void 0,className:o&&Xe?`${u}-control`:void 0,style:{height:Xe?D.scalingValue(W??0,n):0,width:ct}}),a.jsx("p",{className:Se,style:{width:it,...Te,...$e},children:gt.title}),a.jsx("div",{"data-controls":o&&st?"subtitleMarginTop":void 0,className:o&&st?`${u}-control`:void 0,style:{height:st?D.scalingValue(I??0,n):0,width:ct}}),a.jsx("p",{className:Me,style:{width:it,...fe,...G},children:gt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:Lt&&!nt?{gridColumn:Lt}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${nt&&yt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(w??0)>100?`calc(${he} * (${w} / 100))`:he,...Lt&&nt?{gridColumn:Lt}:{}},children:nt?a.jsx(a.Fragment,{children:De?a.jsxs(a.Fragment,{children:[Mt,a.jsx("a",{href:ht,target:"_blank",className:`${u}-item-image-link`,children:Ht})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:ht,target:"_blank",className:`${u}-item-image-link`,children:Ht}),Mt]})}):ht?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:ht,target:"_blank",className:`${u}-item-image-link`,children:[mt,Ht]}),!De&&a.jsx("a",{href:ht,target:"_blank",className:`${u}-item-text-link`,children:Dt})]}):a.jsxs(a.Fragment,{children:[mt,Ht,Dt]})})},Ae)})})}),(!n||i)&&At&&typeof document<"u"&&f==="on"&&(()=>{const gt=(c?document.getElementById(c):null)??document.body;return zn.createPortal(a.jsx("div",{style:jt,"data-selection":"none",children:a.jsx(vf,{prefix:u,items:Ft,index:Kt,imageDisplay:bf(y),isEditor:n,onClose:()=>vt(!1),onPrev:()=>Jt(Ae=>(Ae-1+Ft.length)%Ft.length),onNext:()=>Jt(Ae=>(Ae+1)%Ft.length),counterClassName:pe,counterStyle:se})}),gt)})()]})}const Sf={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Cf=["hover","focus","filled","success","error"],$f=`import { Splide, SplideSlide } from '@splidejs/react-splide';
5136
+ `}function af(){return Math.random()<.5?"ltr":"ttb"}function sf(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function lf(e){const t=af();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{sf(e)})})}const bn=500,cf=750,jn="cubic-bezier(0.22, 1, 0.36, 1)",df=72,uf=50;function pf(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 mf(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function gf(e){const[t]=e.media;return t!=null&&t.url?t:null}function Pd(e){return!Array.isArray(e)||e.length===0?[]:pf(e)?e.flatMap(t=>{const n=mf(t);if(!n)return[];const i=gf(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 $i(e){return e.type==="video"}function hf(e){const t=new Set,n=[];for(const i of e){const o=Pd(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 ff({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=>$i(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 yf(e){e.pause(),e.removeAttribute("src"),e.load()}function Pl({media:e,className:t,style:n,onMediaClick:i}){return $i(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 El(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function xf(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 vf({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{yf(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 bf({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",x=s.useRef(null),w=s.useRef(null),m=s.useRef(null),h=s.useRef(null),f=s.useRef(0),v=s.useRef(0),C=s.useRef("none"),y=s.useRef(!1),S=s.useRef(!1),G=s.useRef(null),W=s.useRef(0),U=s.useRef(null),H=s.useRef(!1),I=s.useRef(null),z=s.useRef(null),$=s.useRef(null),T=s.useRef(()=>{}),[A,_]=s.useState(null),[g,B]=s.useState(null),[P,Y]=s.useState("opening"),[ie,L]=s.useState(0),[O,K]=s.useState(0),[ue,le]=s.useState(null),[F,pe]=s.useState(!1),[j,se]=s.useState(!1),[ne,ve]=s.useState(!1),[Me,xe]=s.useState(null),b=s.useRef(n),M=s.useRef(void 0),E=t[n],V=E?$i(E):!1,Se=O!==0||F,te=ue!==null,$e=s.useCallback(k=>{const ee=k.currentTarget,Te=ee instanceof HTMLVideoElement?{width:ee.videoWidth,height:ee.videoHeight}:{width:ee.naturalWidth,height:ee.naturalHeight};!Te.width||!Te.height||xe(Te)},[]);s.useEffect(()=>{G.current=g},[g]),s.useEffect(()=>{const k=x.current;if(!k)return;const ee=()=>B(El(k));ee();const Te=new ResizeObserver(ee);return Te.observe(k),()=>Te.disconnect()},[]);const re=s.useCallback(()=>{I.current!==null&&(window.clearTimeout(I.current),I.current=null)},[]),ge=s.useCallback(()=>{const k=z.current;z.current=null,re(),U.current=null,H.current=!1,le(null),pe(!1),K(0),W.current=0,se(!1),y.current=!1,v.current=0,C.current="none",k===1?d():k===-1&&l()},[re,d,l]),ye=s.useCallback(()=>{re(),z.current=null,U.current=null,H.current=!1,le(null),pe(!1),K(0),W.current=0},[re]),Z=s.useCallback(()=>{re(),I.current=window.setTimeout(()=>{z.current!==null&&ge()},bn+32)},[re,ge]),Q=s.useCallback((k,ee)=>{var He;const Te=((He=G.current)==null?void 0:He.width)??0;if(re(),U.current=k,le(k),H.current=!0,pe(!0),ee){z.current=k;const Be=-k*Te;W.current=Be,K(Be),Z();return}W.current=0,K(0),I.current=window.setTimeout(()=>{I.current=null,ye()},bn+32)},[re,ye,Z]),ce=s.useCallback(k=>{if(!(t.length<=1)){if(H.current){if(z.current===k){$.current=k,ge();return}ye()}re(),U.current=k,le(k),H.current=!1,pe(!1),W.current=0,K(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Q(k,!0)})})}},[t.length,Q,ge,ye,re]);T.current=ce;const we=s.useCallback(k=>{k.propertyName!=="transform"||!H.current||z.current!==null&&ge()},[ge]),Pe=s.useCallback(()=>{const k=w.current;if(!k)return;const ee=El(k);!ee.width||!ee.height||_(ee)},[]);s.useEffect(()=>{Pe();const k=w.current;if(!k)return;const ee=new ResizeObserver(()=>Pe());return ee.observe(k),()=>ee.disconnect()},[Pe]),s.useEffect(()=>{P==="opening"&&A&&Y("open")},[P,A]),s.useEffect(()=>{if(P!=="closing")return;const k=setTimeout(()=>r(),bn);return()=>clearTimeout(k)},[P,r]),s.useEffect(()=>()=>{re()},[re]),s.useLayoutEffect(()=>{b.current===n&&M.current===(E==null?void 0:E.url)||(re(),z.current=null,le(null),L(0),K(0),pe(!1),ve(!1),se(!1),xe(null),f.current=0,v.current=0,C.current="none",y.current=!1,H.current=!1,W.current=0,U.current=null,h.current=null,S.current=!1,b.current=n,M.current=E==null?void 0:E.url)},[n,E==null?void 0:E.url,re]),s.useLayoutEffect(()=>{const k=$.current;k!==null&&($.current=null,requestAnimationFrame(()=>{T.current(k)}))},[n,E==null?void 0:E.url]),s.useEffect(()=>{if(P!=="open")return;let k=null;const ee=()=>{k&&(document.removeEventListener("click",k,!0),k=null)},Te=()=>{ee(),k=Ze=>{Ze.stopPropagation(),Ze.preventDefault(),ee()},document.addEventListener("click",k,!0)},He=Ze=>{const _e=Ze<0?1:-1;if(Math.abs(Ze)>uf&&t.length>1){Q(_e,!0);return}Q(_e,!1)},Be=Ze=>{if(Ze.touches.length!==1||H.current)return;const _e=Ze.touches[0];S.current=!0,h.current={x:_e.clientX,y:_e.clientY},C.current="none",v.current=0,y.current=!1},Ve=Ze=>{if(!h.current||Ze.touches.length!==1||H.current)return;const _e=Ze.touches[0],qe=_e.clientX-h.current.x,Oe=_e.clientY-h.current.y;if(C.current==="none"){if(Math.abs(qe)<10&&Math.abs(Oe)<10)return;if(Math.abs(qe)>Math.abs(Oe)){if(t.length<=1)return;C.current="horizontal"}else if(Oe>0)C.current="vertical";else return}if(C.current==="horizontal"){y.current=!0,se(!0),v.current=qe;const nt=qe<0?1:-1;U.current!==nt&&(U.current=nt,le(nt)),W.current=qe,K(qe),Ze.preventDefault();return}C.current==="vertical"&&(y.current=!0,se(!0),f.current=Oe,L(Oe),Ze.preventDefault())},rt=()=>{if(!h.current)return;const Ze=C.current,_e=y.current;if(_e&&Ze==="horizontal")He(v.current),Te();else if(_e&&Ze==="vertical")if(f.current>df){const Oe=window.innerHeight;f.current=Oe,ve(!0),L(Oe),Y("closing")}else f.current=0,L(0),Te();else Ze==="horizontal"&&Math.abs(v.current)>0&&(He(v.current),Te());h.current=null,C.current="none",v.current=0,y.current=!1,se(!1)};return document.addEventListener("touchstart",Be,{passive:!0}),document.addEventListener("touchmove",Ve,{passive:!1}),document.addEventListener("touchend",rt),document.addEventListener("touchcancel",rt),()=>{document.removeEventListener("touchstart",Be),document.removeEventListener("touchmove",Ve),document.removeEventListener("touchend",rt),document.removeEventListener("touchcancel",rt),ee()}},[P,t.length,Q]),s.useEffect(()=>{const k=ee=>{ee.key==="Escape"&&(ee.preventDefault(),ee.stopPropagation(),P!=="closing"&&Y("closing"))};return window.addEventListener("keydown",k,!0),()=>window.removeEventListener("keydown",k,!0)},[P]);const Ce=()=>{P!=="closing"&&Y("closing")},X=P==="open",me=P==="closing",ae=ie>0?Math.max(0,1-ie/500):1,q=ie>0?Math.max(.35,1-ie/500):1,de=A?p?A:xf(A,Me):null,ke=k=>{if(k.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const ee=de??k.currentTarget.getBoundingClientRect(),Te=k.clientY-ee.top,He=Math.min(52,ee.height*.2);if(!(Te>ee.height-He)){if(k.clientX-ee.left<ee.width/2){ce(-1);return}ce(1)}},he=k=>{if(t.length<=1)return;const ee=de??k.currentTarget.getBoundingClientRect(),Te=k.clientX-ee.left,He=k.clientY-ee.top,Be=Math.min(52,ee.height*.2);if(He>ee.height-Be){k.currentTarget.style.cursor="default";return}k.currentTarget.style.cursor=Te<ee.width/2?"w-resize":"e-resize"},J={position:"fixed",top:g==null?void 0:g.top,left:g==null?void 0:g.left,width:g==null?void 0:g.width,height:g==null?void 0:g.height,zIndex:9998},Ne=p?"cover":"contain",Fe=O!==0||ie>0?`translate(${O}px, ${ie}px)`:void 0,et=j&&!F?"none":F?`transform ${bn}ms ${jn}`:ne?`transform ${bn}ms ${jn}, opacity ${bn}ms ${jn}`:P==="opening"||me?`opacity ${bn}ms ${jn}`:"none",Je={...J,transform:Fe,opacity:ie>0?q:P==="opening"||me?0:1,transition:et,pointerEvents:"none"},dt={position:"absolute",top:((de==null?void 0:de.top)??0)-((g==null?void 0:g.top)??0),left:((de==null?void 0:de.left)??0)-((g==null?void 0:g.left)??0),width:de==null?void 0:de.width,height:de==null?void 0:de.height,objectFit:Ne,pointerEvents:V&&X&&!Se?"auto":"none",touchAction:V&&X?"none":void 0},tt=(g==null?void 0:g.width)??0,De=te?(n+ue+t.length)%t.length:null,Ie=De!==null?t[De]:null,We={...J,transform:te?`translateX(${ue*tt+O}px)`:void 0,opacity:1,transition:F?`transform ${bn}ms ${jn}`:"none",pointerEvents:"none"},je={position:"absolute",top:((A==null?void 0:A.top)??0)-((g==null?void 0:g.top)??0),left:((A==null?void 0:A.left)??0)-((g==null?void 0:g.left)??0),width:A==null?void 0:A.width,height:A==null?void 0:A.height,objectFit:Ne,pointerEvents:"none"},Ue=de?{position:"fixed",top:de.top,height:de.height,width:de.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:x,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:P==="open"?"none":void 0},onClick:Ce,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:X?ae:0,transition:j?"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:w,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:X?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:w,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:X?1:0,transition:`opacity ${bn}ms ${jn}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),A&&g&&Ie&&a.jsx("div",{style:We,onTransitionEnd:we,children:$i(Ie)?a.jsx("video",{src:Ie.url,muted:!0,playsInline:!0,preload:"auto",style:je},`neighbor-${De}-${Ie.url}`):a.jsx("img",{src:Ie.url,alt:Ie.name,style:je},`neighbor-${De}-${Ie.url}`)}),A&&g&&E&&a.jsx("div",{style:Je,onTransitionEnd:we,children:V?a.jsx(vf,{src:E.url,phase:P,mediaRef:m,mediaStyle:dt,onLoadedMetadata:$e,onClick:ke,onMouseMove:he},`${n}-${E.url}`):a.jsx("img",{ref:m,src:E.url,alt:E.name,onLoad:$e,style:dt},`${n}-${E.url}`)}),X&&Ue&&t.length>1&&!V&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ue,left:de.left,cursor:"w-resize",pointerEvents:j?"none":"auto"},onClick:k=>{if(S.current){S.current=!1;return}k.stopPropagation(),ce(-1)}}),a.jsx("div",{style:{...Ue,left:de.left+de.width/2,cursor:"e-resize",pointerEvents:j?"none":"auto"},onClick:k=>{if(S.current){S.current=!1;return}k.stopPropagation(),ce(1)}})]})]})}function wf(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Sf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=D.useScopedStyles(),{type:p="a",gridLayout:x,textBoxWidth:w=100,verticalGap:m,entriesCount:h,lightbox:f,imageDisplay:v,imageCorners:C,lightboxImageDisplay:y,slider:S,sliderTiming:G,direction:W,transition:U,titleMarginTop:H,subtitleMarginTop:I,titleColor:z,subtitleColor:$,lightboxCounterColor:T,titleFontFamily:A,titleFontSettings:_,titleFontSize:g,titleLineHeight:B,titleLetterSpacing:P,titleWordSpacing:Y,titleTextAppearance:ie,subtitleFontFamily:L,subtitleFontSettings:O,subtitleFontSize:K,subtitleLineHeight:ue,subtitleLetterSpacing:le,subtitleWordSpacing:F,subtitleTextAppearance:pe,lightboxCounterFontFamily:j,lightboxCounterFontSettings:se,lightboxCounterFontSize:ne,lightboxCounterLineHeight:ve,lightboxCounterLetterSpacing:Me,lightboxCounterWordSpacing:xe,lightboxCounterTextAppearance:b,showText:M="always",alignEntries:E="off",align:V="top"}=e,Se={fontSettings:{fontFamily:A,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:g??.01,lineHeight:B,letterSpacing:P??0,wordSpacing:Y??0,textAppearance:ie,color:z},$e={...an(qt(Se,n))},re={fontSettings:{fontFamily:L,fontWeight:(O==null?void 0:O.fontWeight)??400,fontStyle:(O==null?void 0:O.fontStyle)??"normal"},fontSize:K??.01,lineHeight:ue,letterSpacing:le??0,wordSpacing:F??0,textAppearance:pe,color:$},ye={...an(qt(re,n))},Z={fontSettings:{fontFamily:j,fontWeight:(se==null?void 0:se.fontWeight)??400,fontStyle:(se==null?void 0:se.fontStyle)??"normal"},fontSize:ne??.01,lineHeight:ve,letterSpacing:Me??0,wordSpacing:xe??0,textAppearance:b,color:T},ce={...an(qt(Z,n)),...Ta(ne,ve,u,n)},we=$a(g,B,`${u}-item-title`,`${u}-text-tight-leading`),Pe=$a(K,ue,`${u}-item-subtitle`,`${u}-text-tight-leading`),Ce=Ta(g,B,u,n),X=Ta(K,ue,u,n),me=$a(ne,ve,`${u}-lightbox-counter`,`${u}-text-tight-leading`),ae=D.buildColorVars(u,{titleColor:z,subtitleColor:$,lightboxCounterColor:T},Cf,$f),ke=`${l&&l!=="default"?`${u}-state-${l}`:""}${M==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),he=h===0?1/0:h,J=(t??[]).slice(0,he),Ne=s.useMemo(()=>f==="on"?hf(J):[],[J,f]),Fe=x.entryWidth??.2,et=(v==null?void 0:v.display)==="cover",Je=(v==null?void 0:v.ratioValue)??"1:1",dt=(v==null?void 0:v.reversed)??!1,[tt,De]=Je.split(":").map(Number),je=`${dt?De:tt} / ${dt?tt:De}`,Ue=x.columnsCount,k=D.scalingValue(Fe??0,n),ee=k,Te=!et&&S!=="off",He=J.length%Ue||Ue,Be=He<Ue&&J.length>0,Ve=J.length-He,rt=Be?Math.floor((Ue-He)/2)+1:1,Ze=C?D.scalingValue(C,n):void 0,_e={width:ee,...et?{aspectRatio:je,height:"auto",overflow:"hidden"}:{height:"auto"},...Ze?{borderRadius:Ze,overflow:"hidden"}:{}},qe=`${u}-item-image-wrapper${Te?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),Oe=p==="d"||p==="e"||p==="f",nt=E==="on",at=`calc(${D.scalingValue(Fe??0,n)} * (${w} / 100))`,st=D.scalingValue(Fe*w/100,n),St=et?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...Ze?{borderRadius:Ze}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...Ze?{borderRadius:Ze}:{}},[Yt,Zt]=s.useState(0),vt=s.useRef(null),wt=U==="fade"||W==="horizontal"?"ltr":W==="vertical"?"ttb":"ltr";s.useEffect(()=>{const gt=vt.current;if(!gt)return;const Ee=new ResizeObserver(Xe=>{Zt(Math.round(Xe[0].contentRect.width))});return Ee.observe(gt),()=>Ee.disconnect()},[]);const Bt=(()=>{const gt={...ae},Ee=vt.current?getComputedStyle(vt.current).getPropertyValue("--cntrl-article-width").trim():"";return Ee&&(gt["--cntrl-article-width"]=Ee),gt})(),[At,xt]=s.useState(!1),[Ft,Nt]=s.useState([]),[Ut,Jt]=s.useState(0),Tt=f==="on"&&(!n||i),Wt=(gt,Ee)=>{n&&!i||f!=="off"&&(Nt(gt),Jt(Ee),xt(!0))};s.useEffect(()=>{if(!At||f!=="on"||typeof document>"u")return;const gt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=gt}},[At,f]),s.useEffect(()=>{!n||i||xt(!1)},[n,i]);const rn=s.useMemo(()=>rf(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:rn}}),f==="on"&&a.jsx(ff,{mediaList:Ne}),a.jsx("div",{style:ae,children:a.jsx("div",{ref:vt,className:`${u}-wrapper ${u}-type-${p}${nt?` ${u}-align-entries`:""} ${u}-image-align-${V} ${ke}`.trim(),style:{gridTemplateColumns:`repeat(${Ue}, ${k})`,rowGap:nt?0:D.scalingValue(m??0,n),columnGap:D.scalingValue(x.horizontalGap??0,n),width:D.scalingValue(x.wrapperWidth??0,n),...nt?{[`--${u}-align-entries-row-gap`]:D.scalingValue(m??0,n)}:{}},children:J.map((gt,Ee)=>{var _t;const Xe=Ll(gt.title),lt=Ll(gt.subtitle),ht=(((_t=gt.link)==null?void 0:_t.length)??0)>0&&f==="off"?gt.link:void 0,ft=Math.floor(Ee/Ue)===Math.ceil(J.length/Ue)-1,Lt=Be&&Ee>=Ve?`${rt+(Ee-Ve)}`:void 0,mt=Oe?a.jsxs("div",{className:`${u}-item-text-block`,children:[Xe&&a.jsx("p",{className:we,style:{width:at,...$e,...Ce},children:gt.title}),Xe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(H??0,n),width:st}}),lt&&a.jsx("p",{className:Pe,style:{width:at,...ye,...X},children:gt.subtitle}),lt&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(I??0,n),width:st}})]}):null,zt=nt?a.jsxs("div",{className:`${u}-item-title-row`,children:[!Oe&&a.jsx("div",{"data-controls":o&&Xe?"titleMarginTop":void 0,className:o&&Xe?`${u}-control`:void 0,style:{height:Xe?D.scalingValue(H??0,n):0,width:st}}),Xe&&a.jsx("p",{className:we,style:{width:at,...$e,...Ce},children:gt.title}),Oe&&Xe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(H??0,n),width:st}})]}):null,kt=nt?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!Oe&&a.jsx("div",{"data-controls":o&&lt?"subtitleMarginTop":void 0,className:o&&lt?`${u}-control`:void 0,style:{height:lt?D.scalingValue(I??0,n):0,width:st}}),lt&&a.jsx("p",{className:Pe,style:{width:at,...ye,...X},children:gt.subtitle}),Oe&&lt&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(I??0,n),width:st}})]}):null,Mt=ht?a.jsxs("a",{href:ht,target:"_blank",className:`${u}-item-text-link`,children:[zt,kt]}):a.jsxs(a.Fragment,{children:[zt,kt]}),Vt=Pd(gt.gallery),Gt=Vt.filter(Ct=>Ct.lightboxMedia).map(Ct=>Ct.lightboxMedia),Ht=a.jsx("div",{className:qe,style:_e,children:Vt.length===0?null:S==="off"?(()=>{const{displayMedia:Ct,lightboxMedia:N}=Vt[0],Re=N?Gt.findIndex(Ae=>Ae.url===N.url):-1;return a.jsx(Pl,{media:Ct,className:`${u}-item-${$i(Ct)?"video":"image"}`.trim(),style:St,onMediaClick:Tt&&Re>=0?()=>Wt(Gt,Re):void 0})})():a.jsxs(a.Fragment,{children:[Te&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Vt.map(({displayMedia:Ct})=>$i(Ct)?a.jsx("video",{src:Ct.url,muted:!0,playsInline:!0},`sizer-${Ct.url}`):a.jsx("img",{src:Ct.url,alt:""},`sizer-${Ct.url}`))}),a.jsx(zs,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:G*1e3,width:"100%",height:"100%",speed:cf,type:U==="fade"?"fade":"loop",rewind:U==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:wt},onMoved:Ct=>{W!=="random"||U==="fade"||lf(Ct)},children:Vt.map(({displayMedia:Ct,lightboxMedia:N},Re)=>{const Ae=N?Gt.findIndex(ze=>ze.url===N.url):-1;return a.jsx(js,{children:a.jsx(Pl,{media:Ct,className:`${u}-item-${$i(Ct)?"video":"image"}`.trim(),style:St,onMediaClick:Tt&&Ae>=0?()=>Wt(Gt,Ae):void 0})},Re)})},`${U}-${Fe}-${W}-${G}-${Yt}-${d}`)]})}),Dt=Oe?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&Xe?"titleMarginTop":void 0,className:o&&Xe?`${u}-control`:void 0,style:{height:Xe?D.scalingValue(H??0,n):0,width:st}}),a.jsx("p",{className:we,style:{width:at,...$e,...Ce},children:gt.title}),a.jsx("div",{"data-controls":o&&lt?"subtitleMarginTop":void 0,className:o&&lt?`${u}-control`:void 0,style:{height:lt?D.scalingValue(I??0,n):0,width:st}}),a.jsx("p",{className:Pe,style:{width:at,...ye,...X},children:gt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:Lt&&!nt?{gridColumn:Lt}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${nt&&ft?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(w??0)>100?`calc(${k} * (${w} / 100))`:k,...Lt&&nt?{gridColumn:Lt}:{}},children:nt?a.jsx(a.Fragment,{children:Oe?a.jsxs(a.Fragment,{children:[Mt,a.jsx("a",{href:ht,target:"_blank",className:`${u}-item-image-link`,children:Ht})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:ht,target:"_blank",className:`${u}-item-image-link`,children:Ht}),Mt]})}):ht?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:ht,target:"_blank",className:`${u}-item-image-link`,children:[mt,Ht]}),!Oe&&a.jsx("a",{href:ht,target:"_blank",className:`${u}-item-text-link`,children:Dt})]}):a.jsxs(a.Fragment,{children:[mt,Ht,Dt]})})},Ee)})})}),(!n||i)&&At&&typeof document<"u"&&f==="on"&&(()=>{const gt=(c?document.getElementById(c):null)??document.body;return zn.createPortal(a.jsx("div",{style:Bt,"data-selection":"none",children:a.jsx(bf,{prefix:u,items:Ft,index:Ut,imageDisplay:wf(y),isEditor:n,onClose:()=>xt(!1),onPrev:()=>Jt(Ee=>(Ee-1+Ft.length)%Ft.length),onNext:()=>Jt(Ee=>(Ee+1)%Ft.length),counterClassName:me,counterStyle:ce})}),gt)})()]})}const Cf={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},$f=["hover","focus","filled","success","error"],Tf=`import { Splide, SplideSlide } from '@splidejs/react-splide';
5137
5137
  import '@splidejs/react-splide/css/core';
5138
5138
  import { CommonComponentProps } from '../props';
5139
5139
  import {
@@ -7186,12 +7186,12 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
7186
7186
  };
7187
7187
 
7188
7188
  const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
7189
- `,Ia={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Tf=["titleColor","subtitleColor","lightboxCounterColor"],If={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:{...Ia.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:{...Ia.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:{...Ia.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:[...Tf],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Rf={element:wf,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:If,sourceCode:$f},Lf=50,Ml=10,Vs="cntrl-lightbox-journal",sa=Vs,as=`${Vs}-`,la=e=>`${Vs}-${e}`,Gs=e=>e===sa||e.startsWith(as),kl=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=kl(t.get(la(e)));if(i)return i}const n=kl(t.get(sa));if(n)return n;for(const[i]of t){if(!i.startsWith(as))continue;const o=i.slice(as.length);if(!/^\d+$/.test(o))continue;const r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}return null},Fl=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},Pd=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{Gs(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(la(t),String(e)):i.searchParams.set(sa,String(e));const o=n?"replaceState":"pushState",r=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",r)},Pf=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===la(e)||i===sa:Gs(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)}},Ed=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(la(e)):[...t.keys()].some(n=>Gs(n))},Ef=(e,t)=>{if(Ed(t)){if(e){window.history.back();return}Pf(t)}},Mf=20,kf=2,Ra=e=>`max(${e}, ${Mf}px)`,Ji=e=>((e==null?void 0:e.image)??[]).slice(0,kf),Md=e=>e.reduce((t,n)=>t+Ji(n).length,0),Af=(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}},Ff=(e,t)=>{const n=Md(e),{start:i,end:o}=Af(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Er=(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)})),_f=(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 Ff(i,o)},_l=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Nf=(e,t,n)=>e==="B"?t.length>1:Md(n)>1,fn=.004,Un=.004,Yi={title1Width:.13,title2Width:.13,title3Width:.14},Kn=(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},Qi=(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},Ho=(e,t)=>Qi(e,t),cn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Zn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Qi(e.length,n),effective:Ho(e.length,n)}},kd=(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),Ad=(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),oi=["title1","title2","title3","count"],at=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Xs={title1:"1",title2:"2",title3:"3",count:"Count"},Ys=e=>[at(e,"fontFamily"),at(e,"fontSettings"),{type:"row",items:[at(e,"fontSize"),at(e,"lineHeight"),at(e,"letterSpacing"),at(e,"wordSpacing")]},at(e,"textAlign"),at(e,"textAppearance")],Wf=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(oi.map(e=>[Xs[e],Ys(e)]))}),Hf={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Df={title1:.02,title2:.02,title3:.02,count:.017},bi=(e,t)=>{const n=i=>{const o=at(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[Hf[t]]}},wi=(e,t,n)=>{var o,r;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((r=t.fontSettings)==null?void 0:r.fontStyle)??"normal"},fontSize:t.fontSize??Df[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Ut(i,n)};function Fd({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:x=0,title3MarginLeft:w=0,titleRowMarginBottom:m=0,titleHeaderLayout:h="desktop",contentMarginTop:f=0,iconMarginRight:v=0,closeIcon:C=null,closeIconMaxWidth:y=0,closeIconColor:S="#000000",closeIconHoverColor:V="#cccccc"}=n,N=D.scalingValue(f,i),q=D.scalingValue(v,i),W=D.scalingValue(m,i),I=h==="mobile",B=wi("title1",bi(n,"title1"),i),$=wi("title2",bi(n,"title2"),i),T=wi("title3",bi(n,"title3"),i),k=s.useMemo(()=>({title1Width:d??Yi.title1Width,title2Width:c??Yi.title2Width,title3Width:u??Yi.title3Width}),[d,c,u]),F=s.useMemo(()=>({title2MarginLeft:x,title3MarginLeft:w}),[x,w]),g=s.useMemo(()=>Kn(e,t,B,$,T),[e,t,B,$,T]),O=s.useMemo(()=>g.map(Y=>k[Y.widthKey]),[g,k]),P=s.useMemo(()=>Qi(g.length,O),[g.length,O]),X=s.useMemo(()=>Ho(g.length,O),[g.length,O]),te=s.useMemo(()=>g.filter(Y=>Y.prefix==="title1"),[g]),L=s.useMemo(()=>g.filter(Y=>Y.prefix==="title2"||Y.prefix==="title3"),[g]),H=s.useMemo(()=>Zn(te,k),[te,k]),U=s.useMemo(()=>Zn(L,k),[L,k]),de=!!(t.title1||t.title2||t.title3),ae=C!==null;if(!(de||ae))return null;const ce=(p??0)>0||o,z=(Y,le)=>{const _e=g.findIndex(J=>J.prefix===Y.prefix);if(!I||le==="single-row")return{effectiveWidth:X[_e]??0,resolvedWidth:P[_e]??0,maxWidth:cn(_e,P)};if(le==="two-row-top"){const J=te.findIndex(Ke=>Ke.prefix===Y.prefix);return{effectiveWidth:H.effective[J]??0,resolvedWidth:H.resolved[J]??0,maxWidth:cn(J,H.resolved)}}const me=L.findIndex(J=>J.prefix===Y.prefix);return{effectiveWidth:U.effective[me]??0,resolvedWidth:U.resolved[me]??0,maxWidth:cn(me,U.resolved)}},re=(Y,le,_e)=>{if(!I||_e==="single-row"){const tt=Y.findIndex(Ve=>Ve.prefix===le.prefix),Ye=Y.map(Ve=>k[Ve.widthKey]),dt=Qi(Y.length,Ye);return{effectiveWidth:Ho(Y.length,Ye)[tt]??0,resolvedWidth:dt[tt]??0,maxWidth:cn(tt,dt)}}if(_e==="two-row-top"){const tt=Y.filter(Ve=>Ve.prefix==="title1"),Ye=tt.findIndex(Ve=>Ve.prefix===le.prefix),{resolved:dt,effective:ot}=Zn(tt,k);return{effectiveWidth:ot[Ye]??0,resolvedWidth:dt[Ye]??0,maxWidth:cn(Ye,dt)}}const me=Y.filter(tt=>tt.prefix==="title2"||tt.prefix==="title3"),J=me.findIndex(tt=>tt.prefix===le.prefix),{resolved:Ke,effective:ke}=Zn(me,k);return{effectiveWidth:ke[J]??0,resolvedWidth:Ke[J]??0,maxWidth:cn(J,Ke)}},ee=Y=>Ad(g,P,F,Y)+(I?0:p??0),xe=()=>I?0:p??0,Fe=Y=>L.slice(0,Y).reduce((le,_e,me)=>le+(_e.marginLeftKey?F[_e.marginLeftKey]??0:0)+(U.resolved[me]??0),0),ye=Y=>{const le=L[Y];return Fe(Y)+(le.marginLeftKey?F[le.marginLeftKey]??0:0)+(U.resolved[Y]??0)},b=(Y,le,_e)=>{const me=Y.marginLeftKey?F[Y.marginLeftKey]??0:0,{effectiveWidth:J,resolvedWidth:Ke,maxWidth:ke}=_e??z(Y,le),tt=Math.max(me,Un),Ye=o&&le==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":Y.prefix,style:{width:D.scalingValue(J,i),...me>0?{marginLeft:D.scalingValue(me,i)}:{}},children:[a.jsx("p",{className:Y.className,style:Y.style,children:Y.text}),Ye&&Y.marginLeftKey?a.jsx("div",{"data-controls":Y.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ke),style:{position:"absolute",top:0,left:D.scalingValue(-me,i),width:D.scalingValue(tt,i),height:"100%",pointerEvents:"auto"}}):null,Ye?a.jsx("div",{"data-controls":Y.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ke),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:D.scalingValue(-fn/2,i),width:D.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}}):null]},Y.className)},M=(Y="two-row")=>{const le=g.findIndex(J=>J.prefix==="title1"),_e=le>=0?P[le]:k.title1Width,me=Y==="two-row"&&o;return a.jsx("div",{...me?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(_e)}:{},style:{width:D.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...me?{pointerEvents:"auto"}:{}}})},E=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:B,"aria-hidden":"true",children:" "}),j=Y=>{const le=Kn(e,Y,B,$,T);return a.jsx(a.Fragment,{children:le.map(_e=>b(_e,"single-row",re(le,_e,"single-row")))})},Ce=Y=>{const le=Kn(e,Y,B,$,T),_e=le.find(me=>me.prefix==="title1");return _e?b(_e,"two-row-top",re(le,_e,"two-row-top")):null},Q=(Y,le=!1)=>{const _e=Kn(e,Y,B,$,T),me=_e.filter(ke=>ke.prefix==="title2"||ke.prefix==="title3"),J=o&&le;return me.length>0||J||(m??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[me.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[a.jsx("div",{className:`${e}-titles-stack`,children:me.map(ke=>b(ke,"two-row-bottom",re(_e,ke,"two-row-bottom")))}),le&&o?a.jsxs(a.Fragment,{children:[Se(),Me()]}):null]}):null,(m??0)>0||J?a.jsx("div",{"data-controls":J?"titleRowMarginBottom":void 0,"data-controls-axis":J?"y":void 0,"data-controls-reverse":J?"":void 0,className:J?`${e}-control`:void 0,style:{height:W,width:"100%",flexShrink:0,pointerEvents:J?"auto":"none"}}):null]}):null},Te=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:D.scalingValue(y??0,i),height:D.scalingValue(y??0,i),marginRight:q,"--close-icon-hover-color":V},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Y=>{Y.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(sn,{url:C??"",fill:S,hoverFill:i&&!r?S:V,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:q,height:"100%",pointerEvents:"auto"}})]}),ie=()=>ae?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:Te()}):null,ue=Y=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:Y})}),fe=Y=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[ae||de?E():null,ce?M("two-row"):null,ue(Y),ie()]}),K=(Y,le=!1)=>a.jsxs(a.Fragment,{children:[fe(Ce(Y)),Q(Y,le)]}),Z=()=>{const Y=I?-1:g.findIndex(me=>me.prefix==="title1"),le=!I&&(o||(p??0)>0)?(()=>{const me=p??0,J=Y>=0?P[Y]:k.title1Width,Ke=Math.max(me,Un);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(J),style:{position:"absolute",top:0,left:0,width:D.scalingValue(Ke,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,_e=g.flatMap((me,J)=>{if(!me.marginLeftKey)return[];const Ke=F[me.marginLeftKey]??0,ke=kd(g,P,F,J)+xe(),tt=Math.max(Ke,Un);return a.jsx("div",{"data-controls":me.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(P[J]),style:{position:"absolute",top:0,left:D.scalingValue(ke,i),width:D.scalingValue(tt,i),height:"100%",pointerEvents:"auto"}},me.marginLeftKey)});return le?[le,..._e]:_e},se=()=>g.map((Y,le)=>{const _e=cn(le,P),J=ee(le)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Y.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(_e),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D.scalingValue(J,i),width:D.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${Y.widthKey}-junction`)}),Se=()=>L.flatMap((Y,le)=>{if(!Y.marginLeftKey)return[];const _e=F[Y.marginLeftKey]??0,me=Fe(le),J=Math.max(_e,Un),{resolvedWidth:Ke}=z(Y,"two-row-bottom");return a.jsx("div",{"data-controls":Y.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ke),style:{position:"absolute",top:0,left:D.scalingValue(me,i),width:D.scalingValue(J,i),height:"100%",pointerEvents:"auto"}},Y.marginLeftKey)}),Me=()=>L.map((Y,le)=>{const{maxWidth:_e}=z(Y,"two-row-bottom"),J=ye(le)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Y.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(_e),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D.scalingValue(J,i),width:D.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${Y.widthKey}-junction`)}),$e=()=>!o||I?null:a.jsxs(a.Fragment,{children:[Z(),se()]}),G=!!(t.title2||t.title3||(m??0)>0||o),pe=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[ae||de?E():null,ce?M("single-row"):null,de?ue(j(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),ie(),$e()]}),oe=()=>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:K(t,!0)}),$e()]});return a.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:N,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...I?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${I?` ${e}-lightbox-content-area-stacked`:""}`,children:a.jsx("div",{className:`${e}-text-bar-cell${I?` ${e}-text-bar-cell-stacked`:""}`,style:I?void 0:{flex:1,minWidth:0,width:"100%"},children:I?oe():pe()})})})]})}function Of(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Bf(e){return`
7189
+ `,Ia={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},If=["titleColor","subtitleColor","lightboxCounterColor"],Rf={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:{...Ia.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:{...Ia.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:{...Ia.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:[...If],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Lf={element:Sf,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:Rf,sourceCode:Tf},Pf=50,Ml=10,Vs="cntrl-lightbox-journal",sa=Vs,as=`${Vs}-`,la=e=>`${Vs}-${e}`,Gs=e=>e===sa||e.startsWith(as),kl=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=kl(t.get(la(e)));if(i)return i}const n=kl(t.get(sa));if(n)return n;for(const[i]of t){if(!i.startsWith(as))continue;const o=i.slice(as.length);if(!/^\d+$/.test(o))continue;const r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}return null},Fl=(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=>{Gs(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(la(t),String(e)):i.searchParams.set(sa,String(e));const o=n?"replaceState":"pushState",r=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",r)},Ef=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===la(e)||i===sa:Gs(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)}},Md=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(la(e)):[...t.keys()].some(n=>Gs(n))},Mf=(e,t)=>{if(Md(t)){if(e){window.history.back();return}Ef(t)}},kf=20,Af=2,Ra=e=>`max(${e}, ${kf}px)`,Ji=e=>((e==null?void 0:e.image)??[]).slice(0,Af),kd=e=>e.reduce((t,n)=>t+Ji(n).length,0),Ff=(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}},_f=(e,t)=>{const n=kd(e),{start:i,end:o}=Ff(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Er=(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)})),Nf=(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 _f(i,o)},_l=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Wf=(e,t,n)=>e==="B"?t.length>1:kd(n)>1,fn=.004,Un=.004,Yi={title1Width:.13,title2Width:.13,title3Width:.14},Kn=(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},Qi=(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},Ho=(e,t)=>Qi(e,t),cn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Zn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Qi(e.length,n),effective:Ho(e.length,n)}},Ad=(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),Fd=(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),oi=["title1","title2","title3","count"],ot=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Xs={title1:"1",title2:"2",title3:"3",count:"Count"},Ys=e=>[ot(e,"fontFamily"),ot(e,"fontSettings"),{type:"row",items:[ot(e,"fontSize"),ot(e,"lineHeight"),ot(e,"letterSpacing"),ot(e,"wordSpacing")]},ot(e,"textAlign"),ot(e,"textAppearance")],Hf=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(oi.map(e=>[Xs[e],Ys(e)]))}),Df={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Of={title1:.02,title2:.02,title3:.02,count:.017},bi=(e,t)=>{const n=i=>{const o=ot(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[Df[t]]}},wi=(e,t,n)=>{var o,r;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((r=t.fontSettings)==null?void 0:r.fontStyle)??"normal"},fontSize:t.fontSize??Of[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 _d({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:x=0,title3MarginLeft:w=0,titleRowMarginBottom:m=0,titleHeaderLayout:h="desktop",contentMarginTop:f=0,iconMarginRight:v=0,closeIcon:C=null,closeIconMaxWidth:y=0,closeIconColor:S="#000000",closeIconHoverColor:G="#cccccc"}=n,W=D.scalingValue(f,i),U=D.scalingValue(v,i),H=D.scalingValue(m,i),I=h==="mobile",z=wi("title1",bi(n,"title1"),i),$=wi("title2",bi(n,"title2"),i),T=wi("title3",bi(n,"title3"),i),A=s.useMemo(()=>({title1Width:d??Yi.title1Width,title2Width:c??Yi.title2Width,title3Width:u??Yi.title3Width}),[d,c,u]),_=s.useMemo(()=>({title2MarginLeft:x,title3MarginLeft:w}),[x,w]),g=s.useMemo(()=>Kn(e,t,z,$,T),[e,t,z,$,T]),B=s.useMemo(()=>g.map(q=>A[q.widthKey]),[g,A]),P=s.useMemo(()=>Qi(g.length,B),[g.length,B]),Y=s.useMemo(()=>Ho(g.length,B),[g.length,B]),ie=s.useMemo(()=>g.filter(q=>q.prefix==="title1"),[g]),L=s.useMemo(()=>g.filter(q=>q.prefix==="title2"||q.prefix==="title3"),[g]),O=s.useMemo(()=>Zn(ie,A),[ie,A]),K=s.useMemo(()=>Zn(L,A),[L,A]),ue=!!(t.title1||t.title2||t.title3),le=C!==null;if(!(ue||le))return null;const pe=(p??0)>0||o,j=(q,de)=>{const ke=g.findIndex(J=>J.prefix===q.prefix);if(!I||de==="single-row")return{effectiveWidth:Y[ke]??0,resolvedWidth:P[ke]??0,maxWidth:cn(ke,P)};if(de==="two-row-top"){const J=ie.findIndex(Ne=>Ne.prefix===q.prefix);return{effectiveWidth:O.effective[J]??0,resolvedWidth:O.resolved[J]??0,maxWidth:cn(J,O.resolved)}}const he=L.findIndex(J=>J.prefix===q.prefix);return{effectiveWidth:K.effective[he]??0,resolvedWidth:K.resolved[he]??0,maxWidth:cn(he,K.resolved)}},se=(q,de,ke)=>{if(!I||ke==="single-row"){const et=q.findIndex(De=>De.prefix===de.prefix),Je=q.map(De=>A[De.widthKey]),dt=Qi(q.length,Je);return{effectiveWidth:Ho(q.length,Je)[et]??0,resolvedWidth:dt[et]??0,maxWidth:cn(et,dt)}}if(ke==="two-row-top"){const et=q.filter(De=>De.prefix==="title1"),Je=et.findIndex(De=>De.prefix===de.prefix),{resolved:dt,effective:tt}=Zn(et,A);return{effectiveWidth:tt[Je]??0,resolvedWidth:dt[Je]??0,maxWidth:cn(Je,dt)}}const he=q.filter(et=>et.prefix==="title2"||et.prefix==="title3"),J=he.findIndex(et=>et.prefix===de.prefix),{resolved:Ne,effective:Fe}=Zn(he,A);return{effectiveWidth:Fe[J]??0,resolvedWidth:Ne[J]??0,maxWidth:cn(J,Ne)}},ne=q=>Fd(g,P,_,q)+(I?0:p??0),ve=()=>I?0:p??0,Me=q=>L.slice(0,q).reduce((de,ke,he)=>de+(ke.marginLeftKey?_[ke.marginLeftKey]??0:0)+(K.resolved[he]??0),0),xe=q=>{const de=L[q];return Me(q)+(de.marginLeftKey?_[de.marginLeftKey]??0:0)+(K.resolved[q]??0)},b=(q,de,ke)=>{const he=q.marginLeftKey?_[q.marginLeftKey]??0:0,{effectiveWidth:J,resolvedWidth:Ne,maxWidth:Fe}=ke??j(q,de),et=Math.max(he,Un),Je=o&&de==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":q.prefix,style:{width:D.scalingValue(J,i),...he>0?{marginLeft:D.scalingValue(he,i)}:{}},children:[a.jsx("p",{className:q.className,style:q.style,children:q.text}),Je&&q.marginLeftKey?a.jsx("div",{"data-controls":q.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ne),style:{position:"absolute",top:0,left:D.scalingValue(-he,i),width:D.scalingValue(et,i),height:"100%",pointerEvents:"auto"}}):null,Je?a.jsx("div",{"data-controls":q.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:D.scalingValue(-fn/2,i),width:D.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}}):null]},q.className)},M=(q="two-row")=>{const de=g.findIndex(J=>J.prefix==="title1"),ke=de>=0?P[de]:A.title1Width,he=q==="two-row"&&o;return a.jsx("div",{...he?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ke)}:{},style:{width:D.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...he?{pointerEvents:"auto"}:{}}})},E=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:z,"aria-hidden":"true",children:" "}),V=q=>{const de=Kn(e,q,z,$,T);return a.jsx(a.Fragment,{children:de.map(ke=>b(ke,"single-row",se(de,ke,"single-row")))})},Se=q=>{const de=Kn(e,q,z,$,T),ke=de.find(he=>he.prefix==="title1");return ke?b(ke,"two-row-top",se(de,ke,"two-row-top")):null},te=(q,de=!1)=>{const ke=Kn(e,q,z,$,T),he=ke.filter(Fe=>Fe.prefix==="title2"||Fe.prefix==="title3"),J=o&&de;return he.length>0||J||(m??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[he.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[a.jsx("div",{className:`${e}-titles-stack`,children:he.map(Fe=>b(Fe,"two-row-bottom",se(ke,Fe,"two-row-bottom")))}),de&&o?a.jsxs(a.Fragment,{children:[we(),Pe()]}):null]}):null,(m??0)>0||J?a.jsx("div",{"data-controls":J?"titleRowMarginBottom":void 0,"data-controls-axis":J?"y":void 0,"data-controls-reverse":J?"":void 0,className:J?`${e}-control`:void 0,style:{height:H,width:"100%",flexShrink:0,pointerEvents:J?"auto":"none"}}):null]}):null},$e=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:D.scalingValue(y??0,i),height:D.scalingValue(y??0,i),marginRight:U,"--close-icon-hover-color":G},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:q=>{q.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(sn,{url:C??"",fill:S,hoverFill:i&&!r?S:G,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:U,height:"100%",pointerEvents:"auto"}})]}),re=()=>le?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:$e()}):null,ge=q=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:q})}),ye=q=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[le||ue?E():null,pe?M("two-row"):null,ge(q),re()]}),Z=(q,de=!1)=>a.jsxs(a.Fragment,{children:[ye(Se(q)),te(q,de)]}),Q=()=>{const q=I?-1:g.findIndex(he=>he.prefix==="title1"),de=!I&&(o||(p??0)>0)?(()=>{const he=p??0,J=q>=0?P[q]:A.title1Width,Ne=Math.max(he,Un);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(J),style:{position:"absolute",top:0,left:0,width:D.scalingValue(Ne,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,ke=g.flatMap((he,J)=>{if(!he.marginLeftKey)return[];const Ne=_[he.marginLeftKey]??0,Fe=Ad(g,P,_,J)+ve(),et=Math.max(Ne,Un);return a.jsx("div",{"data-controls":he.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(P[J]),style:{position:"absolute",top:0,left:D.scalingValue(Fe,i),width:D.scalingValue(et,i),height:"100%",pointerEvents:"auto"}},he.marginLeftKey)});return de?[de,...ke]:ke},ce=()=>g.map((q,de)=>{const ke=cn(de,P),J=ne(de)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":q.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ke),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D.scalingValue(J,i),width:D.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${q.widthKey}-junction`)}),we=()=>L.flatMap((q,de)=>{if(!q.marginLeftKey)return[];const ke=_[q.marginLeftKey]??0,he=Me(de),J=Math.max(ke,Un),{resolvedWidth:Ne}=j(q,"two-row-bottom");return a.jsx("div",{"data-controls":q.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ne),style:{position:"absolute",top:0,left:D.scalingValue(he,i),width:D.scalingValue(J,i),height:"100%",pointerEvents:"auto"}},q.marginLeftKey)}),Pe=()=>L.map((q,de)=>{const{maxWidth:ke}=j(q,"two-row-bottom"),J=xe(de)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":q.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ke),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D.scalingValue(J,i),width:D.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${q.widthKey}-junction`)}),Ce=()=>!o||I?null:a.jsxs(a.Fragment,{children:[Q(),ce()]}),X=!!(t.title2||t.title3||(m??0)>0||o),me=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[le||ue?E():null,pe?M("single-row"):null,ue?ge(V(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),re(),Ce()]}),ae=()=>a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...X?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:X?void 0:{flex:"0 0 auto",height:"auto"},children:Z(t,!0)}),Ce()]});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:W,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...I?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${I?` ${e}-lightbox-content-area-stacked`:""}`,children:a.jsx("div",{className:`${e}-text-bar-cell${I?` ${e}-text-bar-cell-stacked`:""}`,style:I?void 0:{flex:1,minWidth:0,width:"100%"},children:I?ae():me()})})})]})}function Bf(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function zf(e){return`
7190
7190
  .${e}-wrapper {
7191
7191
  display: grid;
7192
7192
  align-items: start;
7193
7193
  justify-content: center;
7194
- min-height: ${Of(48)};
7194
+ min-height: ${Bf(48)};
7195
7195
  }
7196
7196
  .${e}-item {
7197
7197
  display: flex;
@@ -7506,7 +7506,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
7506
7506
  pointer-events: auto;
7507
7507
  flex-shrink: 0;
7508
7508
  }
7509
- `}const Nl={url:"",name:"",objectFit:"cover"},Tn=500,fo=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",zf=72,jf=50,Vf=1e4,Gf=650,Xf=500;function Yf(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=Or(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 qf(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?_d(i,n):null}function Uf(e){return e.reduce((t,n,i)=>{const o=qs(n.gallery),l=Us(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 $o(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 Wl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return $o(e,i,n)}const Kf=.03;function Nd(e){return e.width*Kf}const La={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function pr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Hl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Zf(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ss(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 Jf(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ss(e,t.width,t.height)}function Qf(e,t){if(mo(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 ey(e){const t=new Set,n=[];for(const i of e){const o=qs(i.gallery),r=Us(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 ty({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=>mo(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 eo(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=Nd(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 Br(e,t,n){const i=eo(e,t,n);return{...i,left:2*i.left-e.left}}function ny(e,t,n){const{left:i,width:o}=n,r=Nd(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 Wd(e,t,n,i){const o=eo(e,"left",i),r=eo(e,"right",i),l=Br(e,"left",i),d=Br(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 iy(e,t,n,i){const{start:o,end:r}=Wd(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function oy(e,t,n){const i=eo(e,t,n),o=Br(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Hd(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 qs(e){if(!e)return;if(Hd(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??Nl,i??o??Nl]}]}function ry(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function ay(e){const[t]=e.media;return t!=null&&t.url?t:null}function Us(e){if(!Array.isArray(e)||e.length===0)return[];if(Hd(e)){const t=[];for(const n of e){const i=ry(n);if(!i)continue;const o=ay(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 mo(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function sy({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return mo(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 ly({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 mr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return mo(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 cy({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:x,sourceRect:w,resolveCloseSourceRect:m,onClose:h,onPrev:f,onNext:v}){const C=s.useRef(null),y=s.useRef(null),S=s.useRef(null),V=s.useRef(new Map),[N,q]=s.useState(0),W=s.useRef(null),I=s.useRef(0),B=s.useRef(0),$=s.useRef("none"),T=s.useRef(!1),k=s.useRef(!1),F=s.useRef(!1),g=s.useRef(null),O=s.useRef(null),P=s.useRef(null),X=s.useRef(()=>{}),te=s.useRef(null),L=s.useRef(null),H=s.useRef(null),U=s.useRef(!1),[de,ae]=s.useState(null),[A,ce]=s.useState(La),[z,re]=s.useState(0),[ee,xe]=s.useState("opening"),[Fe,ye]=s.useState(0),[b,M]=s.useState(0),[E,j]=s.useState(!1),[Ce,Q]=s.useState(null),[Te,ie]=s.useState(null),[ue,fe]=s.useState(null),[K,Z]=s.useState(!1),[se,Se]=s.useState(null),[Me,$e]=s.useState(!1),G=s.useRef(!1),[pe,oe]=s.useState(!1),[Y,le]=s.useState(!1),_e=s.useRef(n),me=s.useRef(void 0),J=t[n],Ke=J?mo(J):!1,ke=b!==0||E,tt=!l&&(!r||!!d),Ye=c&&!l,dt=u.length>1,ot=s.useCallback((_,Pe)=>t.length<=1?null:t[(_+Pe+t.length)%t.length]??null,[t]),Ve=dt?$o(u,p,-1):ot(n,-1),Re=dt?$o(u,p,1):ot(n,1),He=Ce===-1&&ke?dt&&Te!==null?$o(u,Te,-1):ue!==null?ot(ue,-1):null:null,Be=Ce===1&&ke?dt&&Te!==null?$o(u,Te,1):ue!==null?ot(ue,1):null:null,Ze=He&&He.url!==(Ve==null?void 0:Ve.url)?He:null,he=Be&&Be.url!==(Re==null?void 0:Re.url)?Be:null,ve=Ve&&Ye?(()=>{const _=dt?Wl(u,p,-1):t.length>2?ot((n-1+t.length)%t.length,-1):null;return _&&_.url!==Ve.url?_:null})():null,We=Re&&Ye?(()=>{const _=dt?Wl(u,p,1):t.length>2?ot((n+1)%t.length,1):null;return _&&_.url!==Re.url?_:null})():null,Je=Ze??ve,be=he??We,Ie=s.useCallback((_,Pe,Ne)=>{if(!_||!Pe||!Ne)return;const Oe=V.current,lt=Oe.get(_);(lt==null?void 0:lt.width)===Pe&&(lt==null?void 0:lt.height)===Ne||(Oe.set(_,{width:Pe,height:Ne}),q(Et=>Et+1))},[]),qe=s.useCallback(_=>{if(!(_!=null&&_.url))return null;const Pe=V.current.get(_.url);return Jf(y.current,Pe)},[N,z]),ze=s.useCallback(()=>{if(!J)return;const _=qe(J);if(_){ae(_);return}const Pe=y.current;Pe&&ae(Hl(Pe))},[J,qe]),Le=s.useCallback(_=>{if(dt){const Pe=u.length;ie((p+_+Pe)%Pe),fe(null);return}t.length>1&&(fe((n+_+t.length)%t.length),ie(null))},[dt,u.length,p,t.length,n]),Ge=s.useCallback(_=>{F.current=_,j(_)},[]),De=s.useCallback(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null)},[]),nt=s.useCallback(()=>{De(),g.current=window.setTimeout(()=>{De(),Ge(!1)},fo+32)},[De,Ge]),it=s.useCallback(()=>{const _=C.current;if(!_){ce({left:0,top:0,width:typeof window<"u"?window.innerWidth:La.width,height:typeof window<"u"?window.innerHeight:La.height});return}const Pe=_.getBoundingClientRect();ce({left:Pe.left,top:Pe.top,width:Pe.width,height:Pe.height})},[]),ct=s.useCallback((_,Pe)=>{if(ke){if(pe&&!E)return`translate(${b}px, 0px)`;if(E&&Ce!==null){const Ne=qe(_);if(!Ne)return;const{x:Oe,y:lt}=iy(Ne,Pe,Ce,A);return`translate(${Oe}px, ${lt}px)`}if(E)return"translate(0px, 0px)"}},[ke,pe,E,b,Ce,A,qe]),St=s.useCallback(()=>{const _=O.current;O.current=null,De(),Ge(!1),Q(null),ie(null),fe(null),M(0),oe(!1),T.current=!1,B.current=0,$.current="none",_===-1?f():_===1&&v()},[De,Ge,f,v]),Bt=s.useCallback(()=>{De(),g.current=window.setTimeout(()=>{O.current!==null&&St()},fo+32)},[De,St]),zt=s.useCallback(()=>{De(),O.current=null,Ge(!1),Q(null),ie(null),fe(null),M(0),oe(!1),T.current=!1,B.current=0,$.current="none"},[De,Ge]),ft=s.useCallback(_=>{if(!(!Ye||!de)){if(F.current){if(O.current===_){P.current=_,St();return}zt()}De(),Le(_),O.current=_,Q(_),Ge(!0),Bt()}},[Ye,de,St,zt,De,Le,Ge,Bt]);X.current=ft;const wt=s.useCallback(()=>{te.current=null,U.current=!1,L.current!==null&&(window.clearInterval(L.current),L.current=null),H.current!==null&&(window.clearTimeout(H.current),H.current=null)},[]),jt=s.useCallback(_=>{L.current!==null&&window.clearInterval(L.current);const Pe=U.current?Xf:Gf;L.current=window.setInterval(()=>{X.current(_)},Pe)},[]),At=s.useCallback(_=>{te.current!==_&&(wt(),te.current=_,U.current=!1,X.current(_),jt(_),H.current=window.setTimeout(()=>{H.current=null,te.current===_&&(U.current=!0,jt(_))},Vf))},[wt,jt]),vt=s.useCallback(()=>{const _=y.current;if(!_)return;const Pe=J==null?void 0:J.url,Ne=Pe?V.current.get(Pe):void 0;if(Ne!=null&&Ne.width&&(Ne!=null&&Ne.height)){ae(ss(_,Ne.width,Ne.height));return}const Oe=S.current;if(Oe&&Pe&&(Oe.src===Pe||Oe.currentSrc===Pe)){const{width:Et,height:rt}=Zf(Oe);if(Et&&rt){Ie(Pe,Et,rt),ae(ss(_,Et,rt));return}}const lt=Hl(_);!lt.width||!lt.height||ae(lt)},[J==null?void 0:J.url,Ie]),Ft=s.useCallback(_=>{if(S.current=_,!!_){if(_ instanceof HTMLVideoElement){_.readyState>=1&&_.videoWidth>0&&vt();return}_.complete&&_.naturalWidth>0&&vt()}},[vt]),Nt=s.useCallback(()=>{it(),vt(),re(_=>_+1)},[it,vt]);s.useEffect(()=>{Nt();const _=y.current,Pe=C.current,Ne=new ResizeObserver(()=>Nt());return _&&Ne.observe(_),Pe&&Ne.observe(Pe),window.addEventListener("resize",Nt),()=>{Ne.disconnect(),window.removeEventListener("resize",Nt)}},[Nt,n,x]),s.useLayoutEffect(()=>{if(!J)return;const _=S.current;if(_){if(_ instanceof HTMLImageElement&&_.complete&&_.naturalWidth>0){vt();return}_ instanceof HTMLVideoElement&&_.readyState>=1&&_.videoWidth>0&&vt()}},[J==null?void 0:J.url,n,vt]),s.useEffect(()=>{ze()},[ze,N]),s.useEffect(()=>{const _=new Set,Pe=[],Ne=Oe=>{!(Oe!=null&&Oe.url)||_.has(Oe.url)||(_.add(Oe.url),Pe.push(Oe))};t.forEach(Ne),u.forEach(Oe=>Oe.items.forEach(Ne)),Pe.forEach(Oe=>{V.current.has(Oe.url)||Qf(Oe,Ie)})},[t,u,Ie]),s.useEffect(()=>{if(ee!=="opening"||!de)return;if(!w){xe("open");return}Z(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Z(!0),xe("open")})});return()=>cancelAnimationFrame(_)},[ee,de,w]),s.useEffect(()=>{if(ee!=="closing")return;const _=setTimeout(()=>h(),Tn);return()=>clearTimeout(_)},[ee,h]),s.useEffect(()=>()=>{De()},[De]),s.useLayoutEffect(()=>{_e.current===n&&me.current===(J==null?void 0:J.url)||(De(),O.current=null,Q(null),ie(null),fe(null),ye(0),M(0),Ge(!1),le(!1),oe(!1),I.current=0,B.current=0,$.current="none",T.current=!1,W.current=null,k.current=!1,S.current=null,ze(),_e.current=n,me.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,Ge,De,ze]),s.useLayoutEffect(()=>{const _=P.current;_!==null&&(P.current=null,requestAnimationFrame(()=>{X.current(_)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(ee==="opening"){G.current=!1,$e(!1);return}if(ee!=="open"||G.current)return;if(!Ve&&!Re){G.current=!0;return}$e(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{$e(!0),G.current=!0})});return()=>cancelAnimationFrame(_)},[ee,Ve==null?void 0:Ve.url,Re==null?void 0:Re.url]),s.useEffect(()=>{if(ee!=="open")return;const _=()=>{const rt=xt=>{xt.stopPropagation(),xt.preventDefault(),document.removeEventListener("click",rt,!0)};document.addEventListener("click",rt,!0)},Pe=rt=>{const xt=rt<0?1:-1;De(),Le(xt),O.current=xt,Q(xt),Ge(!0),Bt()},Ne=rt=>{if(Math.abs(rt)>jf&&Ye){Pe(rt);return}O.current=null,Q(null),ie(null),fe(null),Ge(!0),M(0),nt()},Oe=rt=>{if(rt.touches.length!==1||F.current)return;const xt=rt.touches[0];k.current=!0,W.current={x:xt.clientX,y:xt.clientY},$.current="none",B.current=0,T.current=!1},lt=rt=>{if(!W.current||rt.touches.length!==1||F.current)return;const xt=rt.touches[0],Ot=xt.clientX-W.current.x,It=xt.clientY-W.current.y;if($.current==="none"){if(Math.abs(Ot)<10&&Math.abs(It)<10)return;if(Math.abs(Ot)>Math.abs(It)){if(!Ye)return;$.current="horizontal"}else if(It>0){if(!tt)return;$.current="vertical"}else return}if($.current==="horizontal"){T.current=!0,oe(!0),B.current=Ot,M(Ot),rt.preventDefault();return}$.current==="vertical"&&(T.current=!0,oe(!0),I.current=It,ye(It),rt.preventDefault())},Et=()=>{if(!W.current)return;const rt=$.current,xt=T.current;if(xt&&rt==="horizontal")Ne(B.current),_();else if(xt&&rt==="vertical"){const Ot=I.current;if(tt&&Ot>zf){const It=window.innerHeight;I.current=It,le(!0),ye(It),xe("closing")}else I.current=0,ye(0);_()}else rt==="horizontal"&&Math.abs(B.current)>0&&(Ne(B.current),_());W.current=null,$.current="none",B.current=0,T.current=!1,oe(!1)};return document.addEventListener("touchstart",Oe,{passive:!0}),document.addEventListener("touchmove",lt,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Oe),document.removeEventListener("touchmove",lt),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[ee,Ye,Ge,nt,De,tt,Bt,Le]);const Kt=s.useCallback(()=>{const _=(m==null?void 0:m())??w??null;_&&de&&(Se(_),Z(!0)),xe("closing")},[m,w,de]);s.useEffect(()=>{const _=Oe=>{if(Oe.key==="Escape"){if(r&&d||ee==="closing")return;wt(),Kt();return}if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight"||ee!=="open"||!Ye)return;Oe.preventDefault();const lt=Oe.key==="ArrowLeft"?-1:1;Oe.repeat&&te.current===lt||At(lt)},Pe=Oe=>{if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight")return;const lt=Oe.key==="ArrowLeft"?-1:1;te.current===lt&&wt()},Ne=()=>{wt()};return window.addEventListener("keydown",_),window.addEventListener("keyup",Pe),window.addEventListener("blur",Ne),()=>{window.removeEventListener("keydown",_),window.removeEventListener("keyup",Pe),window.removeEventListener("blur",Ne),wt()}},[ee,r,d,Kt,Ye,At,wt]),s.useEffect(()=>{ee!=="open"&&wt()},[ee,wt]);const Jt=()=>{ee==="closing"||l||Kt()},Tt=ee==="open",Wt=ee==="closing",rn=Fe>0?Math.max(0,1-Fe/500):1,gt=Fe>0?Math.max(.35,1-Fe/500):1,Ae=s.useCallback(_=>{if(!(_.propertyName!=="transform"||!F.current)){if(O.current!==null){St();return}De(),Ge(!1)}},[De,Ge,St]),Xe=ee==="closing"?se??w:w,st=Xe&&de&&(ee==="opening"||Wt)?Yf(Xe,de):void 0,ht=ke&&J?ct(J,"center"):Fe>0?`translateY(${Fe}px)`:st,yt=de?pr(de,A):null,Lt=!!(Xe&&de),mt=Lt&&(ee==="closing"||ee==="open"&&K),Vt={position:"absolute",top:yt==null?void 0:yt.top,left:yt==null?void 0:yt.left,width:yt==null?void 0:yt.width,height:yt==null?void 0:yt.height,objectFit:"contain",transformOrigin:"top left",transform:ht,opacity:Fe>0?gt:Lt?1:ee==="opening"||Wt?0:1,transition:pe&&!E?"none":E?`transform ${fo}ms ${pn}`:Y?`transform ${Tn}ms ${pn}, opacity ${Tn}ms ${pn}`:mt?`transform ${Tn}ms ${pn}`:ee==="opening"||Wt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:Ke&&Tt&&!ke?"auto":"none",touchAction:Ke&&Tt?"none":void 0,zIndex:1,overflow:Ke?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Tt&&!ke?"auto":"none"},Mt=(_,Pe,Ne="adjacent")=>{const Oe=qe(_);if(!Oe)return{display:"none"};const lt=Ne==="far"?Pe==="left"?"far-left":"far-right":Pe==="left"?"left-adjacent":"right-adjacent",{start:Et}=Ce!==null?Wd(Oe,lt,Ce,A):{start:Ne==="far"?Br(Oe,Pe,A):eo(Oe,Pe,A)},rt=pr(Et,A),xt=ct(_,lt),Ot=!ke&&Ne==="adjacent"&&Tt&&!Me?oy(Oe,Pe,A):null,It=Ne==="far"&&ke&&Ce===(Pe==="left"?-1:1),nn=pe&&!E?!1:E,un=Ne==="adjacent"&&Tt&&Me&&!ke;return{position:"absolute",top:rt.top,left:rt.left,width:rt.width,height:rt.height,objectFit:"contain",transform:xt??(Ot?`translate(${Ot.x}px, ${Ot.y}px)`:void 0),opacity:Ne==="far"?Tt&&It?1:0:Tt?1:0,transition:nn?Ne==="far"?`transform ${fo}ms ${pn}`:`transform ${fo}ms ${pn}, opacity ${Tn}ms ${pn}`:un?`transform ${Tn}ms ${pn}`:ee==="opening"||Wt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},Xt=(_,Pe)=>{const Ne=qe(_);return Ne?ny(eo(Ne,Pe,A),Pe,A):null},Yt=_=>Pe=>{if(!l){if(k.current){k.current=!1;return}Pe.stopPropagation(),ft(_)}},Ht=Ve?Xt(Ve,"left"):null,Dt=Re?Xt(Re,"right"):null,_t=Ht?pr(Ht,A):null,Ct=Dt?pr(Dt,A):null;return a.jsxs("div",{ref:C,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:ee==="open"?"none":void 0},onClick:Jt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Tt?rn:0,transition:pe?"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:y,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Tt?1:0,transition:pe?"none":`opacity ${Tn}ms ${pn}`,pointerEvents:"none"},children:a.jsx(Fd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Jt})})]}),Tt&&Je&&a.jsx(mr,{media:Je,style:Mt(Je,"left","far"),onMeasure:Ie,onTransitionEnd:Ae},`far-prev-${Je.url}`),Tt&&Ve&&a.jsxs(a.Fragment,{children:[a.jsx(mr,{media:Ve,style:Mt(Ve,"left"),onMeasure:Ie,onTransitionEnd:Ae},`prev-${Ve.url}`),_t&&a.jsx("div",{style:{position:"absolute",top:_t.top,left:_t.left,width:_t.width,height:_t.height,cursor:l||pe?"default":"pointer",pointerEvents:l||pe?"none":"auto",zIndex:3},onClick:Yt(-1)})]}),Tt&&Re&&a.jsxs(a.Fragment,{children:[a.jsx(mr,{media:Re,style:Mt(Re,"right"),onMeasure:Ie,onTransitionEnd:Ae},`next-${Re.url}`),Ct&&a.jsx("div",{style:{position:"absolute",top:Ct.top,left:Ct.left,width:Ct.width,height:Ct.height,cursor:l||pe?"default":"pointer",pointerEvents:l||pe?"none":"auto",zIndex:3},onClick:Yt(1)})]}),Tt&&be&&a.jsx(mr,{media:be,style:Mt(be,"right","far"),onMeasure:Ie,onTransitionEnd:Ae},`far-next-${be.url}`),de&&J&&(Ke?a.jsx(ly,{src:J.url,phase:ee,onMediaElement:Ft,wrapperStyle:Vt,videoStyle:kt,onLoadedMetadata:vt,onTransitionEnd:Ae},`${n}-${J.url}`):a.jsx("img",{ref:Ft,src:J.url,alt:J.name,onLoad:vt,onTransitionEnd:Ae,style:Vt},`${n}-${J.url}`))]})}function dy({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=D.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:x}=e,w=(x==null?void 0:x.display)==="cover",m=(x==null?void 0:x.ratioValue)??"1:1",h=(x==null?void 0:x.reversed)??!1,[f,v]=m.split(":").map(Number),S=`${h?v:f} / ${h?f:v}`,V=c.entryWidth??.2,N=c.columnsCount,q=D.scalingValue(V,n),W=D.scalingValue(c.horizontalGap??0,n),I=q,B=q,$={width:I,...w?{aspectRatio:S,height:"auto",overflow:"hidden"}:{height:"auto"}},T=w?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},k=s.useRef(null),[F,g]=s.useState(!1),[O,P]=s.useState([]),[X,te]=s.useState(0),[L,H]=s.useState(0),[U,de]=s.useState(null),[ae,A]=s.useState({title1:"",title2:"",title3:""}),ce=(()=>{const ue={},fe=k.current?getComputedStyle(k.current).getPropertyValue("--cntrl-article-width").trim():"";return fe&&(ue["--cntrl-article-width"]=fe),ue})(),z=!n||i||o,re=s.useMemo(()=>Bf(d),[d]),ee=t??[],xe=ee.length%N||N,Fe=xe<N&&ee.length>0,ye=ee.length-xe,b=Fe?Math.floor((N-xe)/2)+1:1,M=s.useMemo(()=>Uf(ee),[ee]),E=s.useMemo(()=>ey(ee),[ee]),j=(ue,fe,K)=>{if(n&&!o&&!i)return;const Z=M.findIndex(Se=>Se.gridIndex===ue);if(Z<0)return;const se=M[Z];H(Z),P(se.items),te(fe),A(se.entry),de(K??null),g(!0)},Ce=s.useCallback(()=>{g(!1),de(null)},[]),Q=s.useCallback(()=>{const ue=M[L];return!ue||!k.current?U:qf(k.current,ue.gridIndex,w?"cover":"contain")??U},[M,L,U,w]),Te=s.useCallback(ue=>{if(M.length>1){const fe=M.length,K=(L+ue+fe)%fe,Z=M[K],se=Math.min(X,Z.items.length-1);H(K),P(Z.items),te(se),A(Z.entry);return}te(fe=>(fe+ue+O.length)%O.length)},[M,L,X,O.length]),ie=M.length>1||O.length>1;return s.useEffect(()=>{if(!F||typeof document>"u")return;const ue=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ue}},[F]),s.useEffect(()=>{!n||o||i||g(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:re}}),a.jsx(ty,{mediaList:E}),a.jsx("div",{ref:k,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${N}, ${q})`,rowGap:0,columnGap:W,width:D.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:D.scalingValue(u??0,n)},children:ee.map((ue,fe)=>{const K=qs(ue.gallery),Z=Us(K),se=Z.filter(oe=>oe.lightboxMedia).map(oe=>oe.lightboxMedia),Se=Math.floor(fe/N)===Math.ceil(ee.length/N)-1,Me=Fe&&fe>=ye?`${b+(fe-ye)}`:void 0,$e=Z[0],G=$e!=null&&$e.lightboxMedia?se.findIndex(oe=>oe.url===$e.lightboxMedia.url):-1,pe=a.jsx("div",{className:`${d}-item-image-wrapper`,style:$,children:Z.length>0&&a.jsx(sy,{media:$e.displayMedia,gridIndex:fe,className:`${d}-item-${mo($e.displayMedia)?"video":"image"}`.trim(),style:T,onMediaClick:z&&G>=0?oe=>j(fe,G,_d(oe.currentTarget,w?"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:q,...Me?{gridColumn:Me}:{}},children:[a.jsx("div",{className:`${d}-item-title-row`,children:a.jsx("div",{style:{height:0,width:B}})}),a.jsx("a",{className:`${d}-item-image-link`,children:pe}),a.jsx("div",{className:`${d}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:B}})})]})},fe)})}),F&&typeof document<"u"&&(()=>{const ue=(l?document.getElementById(l):null)??document.body;return zn.createPortal(a.jsx("div",{style:ce,"data-selection":"none",children:a.jsx(cy,{prefix:d,items:O,index:X,entry:ae,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ie,lightboxEntries:M,entryIdx:L,layoutId:r,sourceRect:U,resolveCloseSourceRect:Q,onClose:Ce,onPrev:()=>Te(-1),onNext:()=>Te(1)})}),ue)})()]})}const uy=`import { CommonComponentProps } from '../props';
7509
+ `}const Nl={url:"",name:"",objectFit:"cover"},Tn=500,fo=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",jf=72,Vf=50,Gf=1e4,Xf=650,Yf=500;function qf(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 Nd(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=Or(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 Uf(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Nd(i,n):null}function Kf(e){return e.reduce((t,n,i)=>{const o=qs(n.gallery),l=Us(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 $o(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 Wl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return $o(e,i,n)}const Zf=.03;function Wd(e){return e.width*Zf}const La={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function pr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Hl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Jf(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ss(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 Qf(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ss(e,t.width,t.height)}function ey(e,t){if(mo(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 ty(e){const t=new Set,n=[];for(const i of e){const o=qs(i.gallery),r=Us(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 ny({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=>mo(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 eo(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=Wd(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 Br(e,t,n){const i=eo(e,t,n);return{...i,left:2*i.left-e.left}}function iy(e,t,n){const{left:i,width:o}=n,r=Wd(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 Hd(e,t,n,i){const o=eo(e,"left",i),r=eo(e,"right",i),l=Br(e,"left",i),d=Br(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 oy(e,t,n,i){const{start:o,end:r}=Hd(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function ry(e,t,n){const i=eo(e,t,n),o=Br(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Dd(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 qs(e){if(!e)return;if(Dd(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??Nl,i??o??Nl]}]}function ay(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function sy(e){const[t]=e.media;return t!=null&&t.url?t:null}function Us(e){if(!Array.isArray(e)||e.length===0)return[];if(Dd(e)){const t=[];for(const n of e){const i=ay(n);if(!i)continue;const o=sy(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 mo(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function ly({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return mo(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 cy({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 mr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return mo(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 dy({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:x,sourceRect:w,resolveCloseSourceRect:m,onClose:h,onPrev:f,onNext:v}){const C=s.useRef(null),y=s.useRef(null),S=s.useRef(null),G=s.useRef(new Map),[W,U]=s.useState(0),H=s.useRef(null),I=s.useRef(0),z=s.useRef(0),$=s.useRef("none"),T=s.useRef(!1),A=s.useRef(!1),_=s.useRef(!1),g=s.useRef(null),B=s.useRef(null),P=s.useRef(null),Y=s.useRef(()=>{}),ie=s.useRef(null),L=s.useRef(null),O=s.useRef(null),K=s.useRef(!1),[ue,le]=s.useState(null),[F,pe]=s.useState(La),[j,se]=s.useState(0),[ne,ve]=s.useState("opening"),[Me,xe]=s.useState(0),[b,M]=s.useState(0),[E,V]=s.useState(!1),[Se,te]=s.useState(null),[$e,re]=s.useState(null),[ge,ye]=s.useState(null),[Z,Q]=s.useState(!1),[ce,we]=s.useState(null),[Pe,Ce]=s.useState(!1),X=s.useRef(!1),[me,ae]=s.useState(!1),[q,de]=s.useState(!1),ke=s.useRef(n),he=s.useRef(void 0),J=t[n],Ne=J?mo(J):!1,Fe=b!==0||E,et=!l&&(!r||!!d),Je=c&&!l,dt=u.length>1,tt=s.useCallback((N,Re)=>t.length<=1?null:t[(N+Re+t.length)%t.length]??null,[t]),De=dt?$o(u,p,-1):tt(n,-1),Ie=dt?$o(u,p,1):tt(n,1),We=Se===-1&&Fe?dt&&$e!==null?$o(u,$e,-1):ge!==null?tt(ge,-1):null:null,je=Se===1&&Fe?dt&&$e!==null?$o(u,$e,1):ge!==null?tt(ge,1):null:null,Ue=We&&We.url!==(De==null?void 0:De.url)?We:null,k=je&&je.url!==(Ie==null?void 0:Ie.url)?je:null,ee=De&&Je?(()=>{const N=dt?Wl(u,p,-1):t.length>2?tt((n-1+t.length)%t.length,-1):null;return N&&N.url!==De.url?N:null})():null,Te=Ie&&Je?(()=>{const N=dt?Wl(u,p,1):t.length>2?tt((n+1)%t.length,1):null;return N&&N.url!==Ie.url?N:null})():null,He=Ue??ee,Be=k??Te,Ve=s.useCallback((N,Re,Ae)=>{if(!N||!Re||!Ae)return;const ze=G.current,ct=ze.get(N);(ct==null?void 0:ct.width)===Re&&(ct==null?void 0:ct.height)===Ae||(ze.set(N,{width:Re,height:Ae}),U(Et=>Et+1))},[]),rt=s.useCallback(N=>{if(!(N!=null&&N.url))return null;const Re=G.current.get(N.url);return Qf(y.current,Re)},[W,j]),Ze=s.useCallback(()=>{if(!J)return;const N=rt(J);if(N){le(N);return}const Re=y.current;Re&&le(Hl(Re))},[J,rt]),_e=s.useCallback(N=>{if(dt){const Re=u.length;re((p+N+Re)%Re),ye(null);return}t.length>1&&(ye((n+N+t.length)%t.length),re(null))},[dt,u.length,p,t.length,n]),qe=s.useCallback(N=>{_.current=N,V(N)},[]),Oe=s.useCallback(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null)},[]),nt=s.useCallback(()=>{Oe(),g.current=window.setTimeout(()=>{Oe(),qe(!1)},fo+32)},[Oe,qe]),at=s.useCallback(()=>{const N=C.current;if(!N){pe({left:0,top:0,width:typeof window<"u"?window.innerWidth:La.width,height:typeof window<"u"?window.innerHeight:La.height});return}const Re=N.getBoundingClientRect();pe({left:Re.left,top:Re.top,width:Re.width,height:Re.height})},[]),st=s.useCallback((N,Re)=>{if(Fe){if(me&&!E)return`translate(${b}px, 0px)`;if(E&&Se!==null){const Ae=rt(N);if(!Ae)return;const{x:ze,y:ct}=oy(Ae,Re,Se,F);return`translate(${ze}px, ${ct}px)`}if(E)return"translate(0px, 0px)"}},[Fe,me,E,b,Se,F,rt]),St=s.useCallback(()=>{const N=B.current;B.current=null,Oe(),qe(!1),te(null),re(null),ye(null),M(0),ae(!1),T.current=!1,z.current=0,$.current="none",N===-1?f():N===1&&v()},[Oe,qe,f,v]),Yt=s.useCallback(()=>{Oe(),g.current=window.setTimeout(()=>{B.current!==null&&St()},fo+32)},[Oe,St]),Zt=s.useCallback(()=>{Oe(),B.current=null,qe(!1),te(null),re(null),ye(null),M(0),ae(!1),T.current=!1,z.current=0,$.current="none"},[Oe,qe]),vt=s.useCallback(N=>{if(!(!Je||!ue)){if(_.current){if(B.current===N){P.current=N,St();return}Zt()}Oe(),_e(N),B.current=N,te(N),qe(!0),Yt()}},[Je,ue,St,Zt,Oe,_e,qe,Yt]);Y.current=vt;const wt=s.useCallback(()=>{ie.current=null,K.current=!1,L.current!==null&&(window.clearInterval(L.current),L.current=null),O.current!==null&&(window.clearTimeout(O.current),O.current=null)},[]),Bt=s.useCallback(N=>{L.current!==null&&window.clearInterval(L.current);const Re=K.current?Yf:Xf;L.current=window.setInterval(()=>{Y.current(N)},Re)},[]),At=s.useCallback(N=>{ie.current!==N&&(wt(),ie.current=N,K.current=!1,Y.current(N),Bt(N),O.current=window.setTimeout(()=>{O.current=null,ie.current===N&&(K.current=!0,Bt(N))},Gf))},[wt,Bt]),xt=s.useCallback(()=>{const N=y.current;if(!N)return;const Re=J==null?void 0:J.url,Ae=Re?G.current.get(Re):void 0;if(Ae!=null&&Ae.width&&(Ae!=null&&Ae.height)){le(ss(N,Ae.width,Ae.height));return}const ze=S.current;if(ze&&Re&&(ze.src===Re||ze.currentSrc===Re)){const{width:Et,height:it}=Jf(ze);if(Et&&it){Ve(Re,Et,it),le(ss(N,Et,it));return}}const ct=Hl(N);!ct.width||!ct.height||le(ct)},[J==null?void 0:J.url,Ve]),Ft=s.useCallback(N=>{if(S.current=N,!!N){if(N instanceof HTMLVideoElement){N.readyState>=1&&N.videoWidth>0&&xt();return}N.complete&&N.naturalWidth>0&&xt()}},[xt]),Nt=s.useCallback(()=>{at(),xt(),se(N=>N+1)},[at,xt]);s.useEffect(()=>{Nt();const N=y.current,Re=C.current,Ae=new ResizeObserver(()=>Nt());return N&&Ae.observe(N),Re&&Ae.observe(Re),window.addEventListener("resize",Nt),()=>{Ae.disconnect(),window.removeEventListener("resize",Nt)}},[Nt,n,x]),s.useLayoutEffect(()=>{if(!J)return;const N=S.current;if(N){if(N instanceof HTMLImageElement&&N.complete&&N.naturalWidth>0){xt();return}N instanceof HTMLVideoElement&&N.readyState>=1&&N.videoWidth>0&&xt()}},[J==null?void 0:J.url,n,xt]),s.useEffect(()=>{Ze()},[Ze,W]),s.useEffect(()=>{const N=new Set,Re=[],Ae=ze=>{!(ze!=null&&ze.url)||N.has(ze.url)||(N.add(ze.url),Re.push(ze))};t.forEach(Ae),u.forEach(ze=>ze.items.forEach(Ae)),Re.forEach(ze=>{G.current.has(ze.url)||ey(ze,Ve)})},[t,u,Ve]),s.useEffect(()=>{if(ne!=="opening"||!ue)return;if(!w){ve("open");return}Q(!1);const N=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Q(!0),ve("open")})});return()=>cancelAnimationFrame(N)},[ne,ue,w]),s.useEffect(()=>{if(ne!=="closing")return;const N=setTimeout(()=>h(),Tn);return()=>clearTimeout(N)},[ne,h]),s.useEffect(()=>()=>{Oe()},[Oe]),s.useLayoutEffect(()=>{ke.current===n&&he.current===(J==null?void 0:J.url)||(Oe(),B.current=null,te(null),re(null),ye(null),xe(0),M(0),qe(!1),de(!1),ae(!1),I.current=0,z.current=0,$.current="none",T.current=!1,H.current=null,A.current=!1,S.current=null,Ze(),ke.current=n,he.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,qe,Oe,Ze]),s.useLayoutEffect(()=>{const N=P.current;N!==null&&(P.current=null,requestAnimationFrame(()=>{Y.current(N)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(ne==="opening"){X.current=!1,Ce(!1);return}if(ne!=="open"||X.current)return;if(!De&&!Ie){X.current=!0;return}Ce(!1);const N=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ce(!0),X.current=!0})});return()=>cancelAnimationFrame(N)},[ne,De==null?void 0:De.url,Ie==null?void 0:Ie.url]),s.useEffect(()=>{if(ne!=="open")return;const N=()=>{const it=yt=>{yt.stopPropagation(),yt.preventDefault(),document.removeEventListener("click",it,!0)};document.addEventListener("click",it,!0)},Re=it=>{const yt=it<0?1:-1;Oe(),_e(yt),B.current=yt,te(yt),qe(!0),Yt()},Ae=it=>{if(Math.abs(it)>Vf&&Je){Re(it);return}B.current=null,te(null),re(null),ye(null),qe(!0),M(0),nt()},ze=it=>{if(it.touches.length!==1||_.current)return;const yt=it.touches[0];A.current=!0,H.current={x:yt.clientX,y:yt.clientY},$.current="none",z.current=0,T.current=!1},ct=it=>{if(!H.current||it.touches.length!==1||_.current)return;const yt=it.touches[0],Ot=yt.clientX-H.current.x,It=yt.clientY-H.current.y;if($.current==="none"){if(Math.abs(Ot)<10&&Math.abs(It)<10)return;if(Math.abs(Ot)>Math.abs(It)){if(!Je)return;$.current="horizontal"}else if(It>0){if(!et)return;$.current="vertical"}else return}if($.current==="horizontal"){T.current=!0,ae(!0),z.current=Ot,M(Ot),it.preventDefault();return}$.current==="vertical"&&(T.current=!0,ae(!0),I.current=It,xe(It),it.preventDefault())},Et=()=>{if(!H.current)return;const it=$.current,yt=T.current;if(yt&&it==="horizontal")Ae(z.current),N();else if(yt&&it==="vertical"){const Ot=I.current;if(et&&Ot>jf){const It=window.innerHeight;I.current=It,de(!0),xe(It),ve("closing")}else I.current=0,xe(0);N()}else it==="horizontal"&&Math.abs(z.current)>0&&(Ae(z.current),N());H.current=null,$.current="none",z.current=0,T.current=!1,ae(!1)};return document.addEventListener("touchstart",ze,{passive:!0}),document.addEventListener("touchmove",ct,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",ze),document.removeEventListener("touchmove",ct),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[ne,Je,qe,nt,Oe,et,Yt,_e]);const Ut=s.useCallback(()=>{const N=(m==null?void 0:m())??w??null;N&&ue&&(we(N),Q(!0)),ve("closing")},[m,w,ue]);s.useEffect(()=>{const N=ze=>{if(ze.key==="Escape"){if(r&&d||ne==="closing")return;wt(),Ut();return}if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight"||ne!=="open"||!Je)return;ze.preventDefault();const ct=ze.key==="ArrowLeft"?-1:1;ze.repeat&&ie.current===ct||At(ct)},Re=ze=>{if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight")return;const ct=ze.key==="ArrowLeft"?-1:1;ie.current===ct&&wt()},Ae=()=>{wt()};return window.addEventListener("keydown",N),window.addEventListener("keyup",Re),window.addEventListener("blur",Ae),()=>{window.removeEventListener("keydown",N),window.removeEventListener("keyup",Re),window.removeEventListener("blur",Ae),wt()}},[ne,r,d,Ut,Je,At,wt]),s.useEffect(()=>{ne!=="open"&&wt()},[ne,wt]);const Jt=()=>{ne==="closing"||l||Ut()},Tt=ne==="open",Wt=ne==="closing",rn=Me>0?Math.max(0,1-Me/500):1,gt=Me>0?Math.max(.35,1-Me/500):1,Ee=s.useCallback(N=>{if(!(N.propertyName!=="transform"||!_.current)){if(B.current!==null){St();return}Oe(),qe(!1)}},[Oe,qe,St]),Xe=ne==="closing"?ce??w:w,lt=Xe&&ue&&(ne==="opening"||Wt)?qf(Xe,ue):void 0,ht=Fe&&J?st(J,"center"):Me>0?`translateY(${Me}px)`:lt,ft=ue?pr(ue,F):null,Lt=!!(Xe&&ue),mt=Lt&&(ne==="closing"||ne==="open"&&Z),zt={position:"absolute",top:ft==null?void 0:ft.top,left:ft==null?void 0:ft.left,width:ft==null?void 0:ft.width,height:ft==null?void 0:ft.height,objectFit:"contain",transformOrigin:"top left",transform:ht,opacity:Me>0?gt:Lt?1:ne==="opening"||Wt?0:1,transition:me&&!E?"none":E?`transform ${fo}ms ${pn}`:q?`transform ${Tn}ms ${pn}, opacity ${Tn}ms ${pn}`:mt?`transform ${Tn}ms ${pn}`:ne==="opening"||Wt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:Ne&&Tt&&!Fe?"auto":"none",touchAction:Ne&&Tt?"none":void 0,zIndex:1,overflow:Ne?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Tt&&!Fe?"auto":"none"},Mt=(N,Re,Ae="adjacent")=>{const ze=rt(N);if(!ze)return{display:"none"};const ct=Ae==="far"?Re==="left"?"far-left":"far-right":Re==="left"?"left-adjacent":"right-adjacent",{start:Et}=Se!==null?Hd(ze,ct,Se,F):{start:Ae==="far"?Br(ze,Re,F):eo(ze,Re,F)},it=pr(Et,F),yt=st(N,ct),Ot=!Fe&&Ae==="adjacent"&&Tt&&!Pe?ry(ze,Re,F):null,It=Ae==="far"&&Fe&&Se===(Re==="left"?-1:1),nn=me&&!E?!1:E,un=Ae==="adjacent"&&Tt&&Pe&&!Fe;return{position:"absolute",top:it.top,left:it.left,width:it.width,height:it.height,objectFit:"contain",transform:yt??(Ot?`translate(${Ot.x}px, ${Ot.y}px)`:void 0),opacity:Ae==="far"?Tt&&It?1:0:Tt?1:0,transition:nn?Ae==="far"?`transform ${fo}ms ${pn}`:`transform ${fo}ms ${pn}, opacity ${Tn}ms ${pn}`:un?`transform ${Tn}ms ${pn}`:ne==="opening"||Wt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},Vt=(N,Re)=>{const Ae=rt(N);return Ae?iy(eo(Ae,Re,F),Re,F):null},Gt=N=>Re=>{if(!l){if(A.current){A.current=!1;return}Re.stopPropagation(),vt(N)}},Ht=De?Vt(De,"left"):null,Dt=Ie?Vt(Ie,"right"):null,_t=Ht?pr(Ht,F):null,Ct=Dt?pr(Dt,F):null;return a.jsxs("div",{ref:C,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:ne==="open"?"none":void 0},onClick:Jt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Tt?rn:0,transition:me?"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:y,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Tt?1:0,transition:me?"none":`opacity ${Tn}ms ${pn}`,pointerEvents:"none"},children:a.jsx(_d,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Jt})})]}),Tt&&He&&a.jsx(mr,{media:He,style:Mt(He,"left","far"),onMeasure:Ve,onTransitionEnd:Ee},`far-prev-${He.url}`),Tt&&De&&a.jsxs(a.Fragment,{children:[a.jsx(mr,{media:De,style:Mt(De,"left"),onMeasure:Ve,onTransitionEnd:Ee},`prev-${De.url}`),_t&&a.jsx("div",{style:{position:"absolute",top:_t.top,left:_t.left,width:_t.width,height:_t.height,cursor:l||me?"default":"pointer",pointerEvents:l||me?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Tt&&Ie&&a.jsxs(a.Fragment,{children:[a.jsx(mr,{media:Ie,style:Mt(Ie,"right"),onMeasure:Ve,onTransitionEnd:Ee},`next-${Ie.url}`),Ct&&a.jsx("div",{style:{position:"absolute",top:Ct.top,left:Ct.left,width:Ct.width,height:Ct.height,cursor:l||me?"default":"pointer",pointerEvents:l||me?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Tt&&Be&&a.jsx(mr,{media:Be,style:Mt(Be,"right","far"),onMeasure:Ve,onTransitionEnd:Ee},`far-next-${Be.url}`),ue&&J&&(Ne?a.jsx(cy,{src:J.url,phase:ne,onMediaElement:Ft,wrapperStyle:zt,videoStyle:kt,onLoadedMetadata:xt,onTransitionEnd:Ee},`${n}-${J.url}`):a.jsx("img",{ref:Ft,src:J.url,alt:J.name,onLoad:xt,onTransitionEnd:Ee,style:zt},`${n}-${J.url}`))]})}function uy({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=D.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:x}=e,w=(x==null?void 0:x.display)==="cover",m=(x==null?void 0:x.ratioValue)??"1:1",h=(x==null?void 0:x.reversed)??!1,[f,v]=m.split(":").map(Number),S=`${h?v:f} / ${h?f:v}`,G=c.entryWidth??.2,W=c.columnsCount,U=D.scalingValue(G,n),H=D.scalingValue(c.horizontalGap??0,n),I=U,z=U,$={width:I,...w?{aspectRatio:S,height:"auto",overflow:"hidden"}:{height:"auto"}},T=w?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},A=s.useRef(null),[_,g]=s.useState(!1),[B,P]=s.useState([]),[Y,ie]=s.useState(0),[L,O]=s.useState(0),[K,ue]=s.useState(null),[le,F]=s.useState({title1:"",title2:"",title3:""}),pe=(()=>{const ge={},ye=A.current?getComputedStyle(A.current).getPropertyValue("--cntrl-article-width").trim():"";return ye&&(ge["--cntrl-article-width"]=ye),ge})(),j=!n||i||o,se=s.useMemo(()=>zf(d),[d]),ne=t??[],ve=ne.length%W||W,Me=ve<W&&ne.length>0,xe=ne.length-ve,b=Me?Math.floor((W-ve)/2)+1:1,M=s.useMemo(()=>Kf(ne),[ne]),E=s.useMemo(()=>ty(ne),[ne]),V=(ge,ye,Z)=>{if(n&&!o&&!i)return;const Q=M.findIndex(we=>we.gridIndex===ge);if(Q<0)return;const ce=M[Q];O(Q),P(ce.items),ie(ye),F(ce.entry),ue(Z??null),g(!0)},Se=s.useCallback(()=>{g(!1),ue(null)},[]),te=s.useCallback(()=>{const ge=M[L];return!ge||!A.current?K:Uf(A.current,ge.gridIndex,w?"cover":"contain")??K},[M,L,K,w]),$e=s.useCallback(ge=>{if(M.length>1){const ye=M.length,Z=(L+ge+ye)%ye,Q=M[Z],ce=Math.min(Y,Q.items.length-1);O(Z),P(Q.items),ie(ce),F(Q.entry);return}ie(ye=>(ye+ge+B.length)%B.length)},[M,L,Y,B.length]),re=M.length>1||B.length>1;return s.useEffect(()=>{if(!_||typeof document>"u")return;const ge=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ge}},[_]),s.useEffect(()=>{!n||o||i||g(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:se}}),a.jsx(ny,{mediaList:E}),a.jsx("div",{ref:A,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${W}, ${U})`,rowGap:0,columnGap:H,width:D.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:D.scalingValue(u??0,n)},children:ne.map((ge,ye)=>{const Z=qs(ge.gallery),Q=Us(Z),ce=Q.filter(ae=>ae.lightboxMedia).map(ae=>ae.lightboxMedia),we=Math.floor(ye/W)===Math.ceil(ne.length/W)-1,Pe=Me&&ye>=xe?`${b+(ye-xe)}`:void 0,Ce=Q[0],X=Ce!=null&&Ce.lightboxMedia?ce.findIndex(ae=>ae.url===Ce.lightboxMedia.url):-1,me=a.jsx("div",{className:`${d}-item-image-wrapper`,style:$,children:Q.length>0&&a.jsx(ly,{media:Ce.displayMedia,gridIndex:ye,className:`${d}-item-${mo(Ce.displayMedia)?"video":"image"}`.trim(),style:T,onMediaClick:j&&X>=0?ae=>V(ye,X,Nd(ae.currentTarget,w?"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:U,...Pe?{gridColumn:Pe}:{}},children:[a.jsx("div",{className:`${d}-item-title-row`,children:a.jsx("div",{style:{height:0,width:z}})}),a.jsx("a",{className:`${d}-item-image-link`,children:me}),a.jsx("div",{className:`${d}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:z}})})]})},ye)})}),_&&typeof document<"u"&&(()=>{const ge=(l?document.getElementById(l):null)??document.body;return zn.createPortal(a.jsx("div",{style:pe,"data-selection":"none",children:a.jsx(dy,{prefix:d,items:B,index:Y,entry:le,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:re,lightboxEntries:M,entryIdx:L,layoutId:r,sourceRect:K,resolveCloseSourceRect:te,onClose:Se,onPrev:()=>$e(-1),onNext:()=>$e(1)})}),ge)})()]})}const py=`import { CommonComponentProps } from '../props';
7510
7510
  import { scalingValue, useScopedStyles } from '../utils/index';
7511
7511
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
7512
7512
  import { createPortal } from 'react-dom';
@@ -9849,7 +9849,7 @@ export function Hive({
9849
9849
  </>
9850
9850
  );
9851
9851
  }
9852
- `,py="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>'),mi={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 my(e){const t={};return t[at(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[at(e,"fontSettings")]={...mi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[at(e,"fontSize")]={...mi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[at(e,"lineHeight")]={...mi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[at(e,"letterSpacing")]={...mi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[at(e,"wordSpacing")]={...mi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[at(e,"textAlign")]={...mi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[at(e,"textAppearance")]={...mi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const to=oi.filter(e=>e!=="count"),gy=to.reduce((e,t)=>({...e,...my(t)}),{}),hy=to.reduce((e,t)=>({...e,[at(t,"fontFamily")]:"Arial",[at(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[at(t,"letterSpacing")]:0,[at(t,"wordSpacing")]:0,[at(t,"textAlign")]:"left",[at(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Pa(e){return to.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[at(n,"fontSize")]=i),o!==void 0&&(t[at(n,"lineHeight")]=o),t},{})}const fy={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(to.map(e=>[Xs[e],Ys(e)]))},yy={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},xy=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...yy,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),vy={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:xy},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"}},...gy},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:py,closeIconColor:"#000000",closeIconHoverColor:"#999999",...hy},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,...Pa({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,...Pa({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,...Pa({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:[fy]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},by={element:dy,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:[...to.map(e=>({path:`${at(e,"fontFamily")}`}))]},fontRelations:{...to.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${at(t,"fontFamily")}`}),{})},schema:vy,sourceCode:uy};function wy(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 Sy({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 Ea(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Cy(e){return String(e??"").trim().length>0}function Dl(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 Ol(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 Bl(e,t,n,i,o,r,l){const d=D.scalingValue(r,l),c=D.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!p||i?d:c}}function $y(e,t,n){const i=D.scalingValue(t,n),o=D.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const zl=10,jl=10,yo={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function Ty(e,t,n){return Math.max(t,Math.min(n,e))}function Ma(e,t,n){return e+(t-e)*n}function Iy(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+zl,y:n.clientY-d.top+zl}}switch(e){case"left":return{x:jl+i/2,y:l};case"center":return{x:o/2,y:l};case"right":return{x:o-jl-i/2,y:l};default:return{x:o/2,y:l}}}function Ry(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 m=n.current,h=i.current;m&&(m.style.transform=`translate3d(${h.x}px, ${h.y}px, 0) translate(-50%, -50%) rotate(${h.rotation.toFixed(3)}deg)`)},[]),l=s.useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},[]),d=s.useCallback(()=>{const m=i.current;t?(m.x=Ma(m.x,m.targetX,yo.positionEase),m.y=Ma(m.y,m.targetY,yo.positionEase),m.rotation=Ma(m.rotation,m.targetRotation,yo.rotationEase)):(m.x=m.targetX,m.y=m.targetY,m.rotation=m.targetRotation),r();const h=Math.abs(m.x-m.targetX)<.4&&Math.abs(m.y-m.targetY)<.4,f=Math.abs(m.rotation-m.targetRotation)<.08;!h||!f?o.current=requestAnimationFrame(d):o.current=null},[r,t]),c=s.useCallback(()=>{o.current===null&&(o.current=requestAnimationFrame(d))},[d]),u=s.useCallback((m,h)=>{const f=i.current;f.targetX=m,f.targetY=h,f.targetRotation=0,f.x=m,f.y=h,f.rotation=0,f.lastX=m,f.hasLastX=!0,r(),t&&c()},[r,t,c]),p=s.useCallback((m,h)=>{if(!e)return;const f=i.current;if(t&&f.hasLastX){const v=m-f.lastX;f.targetRotation=Ty(v*yo.rotationFactor,-20,yo.maxRotation)}else f.targetRotation=0;if(f.lastX=m,f.hasLastX=!0,f.targetX=m,f.targetY=h,t){c();return}f.x=m,f.y=h,f.rotation=f.targetRotation,r()},[e,r,t,c]),x=s.useCallback(m=>{l(),i.current.hasLastX=!1,m==null||m()},[l]),w=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||w(),l),[e,w,l]),{anchorRef:n,onShow:u,onCursorMove:p,exit:x,reset:w}}function Ly(e){return`
9852
+ `,my="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>'),mi={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 gy(e){const t={};return t[ot(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[ot(e,"fontSettings")]={...mi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[ot(e,"fontSize")]={...mi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[ot(e,"lineHeight")]={...mi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[ot(e,"letterSpacing")]={...mi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[ot(e,"wordSpacing")]={...mi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[ot(e,"textAlign")]={...mi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[ot(e,"textAppearance")]={...mi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const to=oi.filter(e=>e!=="count"),hy=to.reduce((e,t)=>({...e,...gy(t)}),{}),fy=to.reduce((e,t)=>({...e,[ot(t,"fontFamily")]:"Arial",[ot(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[ot(t,"letterSpacing")]:0,[ot(t,"wordSpacing")]:0,[ot(t,"textAlign")]:"left",[ot(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Pa(e){return to.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[ot(n,"fontSize")]=i),o!==void 0&&(t[ot(n,"lineHeight")]=o),t},{})}const yy={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(to.map(e=>[Xs[e],Ys(e)]))},xy={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},vy=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...xy,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),by={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:vy},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"}},...hy},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:my,closeIconColor:"#000000",closeIconHoverColor:"#999999",...fy},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,...Pa({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,...Pa({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,...Pa({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:[yy]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},wy={element:uy,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:[...to.map(e=>({path:`${ot(e,"fontFamily")}`}))]},fontRelations:{...to.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${ot(t,"fontFamily")}`}),{})},schema:by,sourceCode:py};function Sy(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 Cy({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 Ea(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function $y(e){return String(e??"").trim().length>0}function Dl(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 Ol(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 Bl(e,t,n,i,o,r,l){const d=D.scalingValue(r,l),c=D.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!p||i?d:c}}function Ty(e,t,n){const i=D.scalingValue(t,n),o=D.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const zl=10,jl=10,yo={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function Iy(e,t,n){return Math.max(t,Math.min(n,e))}function Ma(e,t,n){return e+(t-e)*n}function Ry(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+zl,y:n.clientY-d.top+zl}}switch(e){case"left":return{x:jl+i/2,y:l};case"center":return{x:o/2,y:l};case"right":return{x:o-jl-i/2,y:l};default:return{x:o/2,y:l}}}function Ly(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 m=n.current,h=i.current;m&&(m.style.transform=`translate3d(${h.x}px, ${h.y}px, 0) translate(-50%, -50%) rotate(${h.rotation.toFixed(3)}deg)`)},[]),l=s.useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},[]),d=s.useCallback(()=>{const m=i.current;t?(m.x=Ma(m.x,m.targetX,yo.positionEase),m.y=Ma(m.y,m.targetY,yo.positionEase),m.rotation=Ma(m.rotation,m.targetRotation,yo.rotationEase)):(m.x=m.targetX,m.y=m.targetY,m.rotation=m.targetRotation),r();const h=Math.abs(m.x-m.targetX)<.4&&Math.abs(m.y-m.targetY)<.4,f=Math.abs(m.rotation-m.targetRotation)<.08;!h||!f?o.current=requestAnimationFrame(d):o.current=null},[r,t]),c=s.useCallback(()=>{o.current===null&&(o.current=requestAnimationFrame(d))},[d]),u=s.useCallback((m,h)=>{const f=i.current;f.targetX=m,f.targetY=h,f.targetRotation=0,f.x=m,f.y=h,f.rotation=0,f.lastX=m,f.hasLastX=!0,r(),t&&c()},[r,t,c]),p=s.useCallback((m,h)=>{if(!e)return;const f=i.current;if(t&&f.hasLastX){const v=m-f.lastX;f.targetRotation=Iy(v*yo.rotationFactor,-20,yo.maxRotation)}else f.targetRotation=0;if(f.lastX=m,f.hasLastX=!0,f.targetX=m,f.targetY=h,t){c();return}f.x=m,f.y=h,f.rotation=f.targetRotation,r()},[e,r,t,c]),x=s.useCallback(m=>{l(),i.current.hasLastX=!1,m==null||m()},[l]),w=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||w(),l),[e,w,l]),{anchorRef:n,onShow:u,onCursorMove:p,exit:x,reset:w}}function Py(e){return`
9853
9853
  .${e}-wrapper {
9854
9854
  display: grid;
9855
9855
  align-items: start;
@@ -10225,7 +10225,7 @@ a.${e}-list-item {
10225
10225
  overflow-wrap: anywhere;
10226
10226
  word-break: break-word;
10227
10227
  }
10228
- `}const ri=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Ks=["AColumn","BColumn","CColumn","DColumn","EColumn"],Hn="cutLabel",Do=[...Ks,Hn],ca=["A","B","C","D","E"];function Dd(e){return`${e}ColumnVerticalAlign`}const ls=["Top","Center","Bottom"];function Zs(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return ca.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Py(e){const t=Zs(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Ey(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return ca.includes(n)?n:null}function Od(e,t,n){const i=Ey(e);return i?i===t?!1:Py(n[Dd(i)]):!0}function Oo(e){const t=Zs(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return ca.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function My(e,t,n){if(Bd(e,t,n))return Oo(e);const i=Oo(e);return i.kind==="baseline"?{kind:"top"}:i}function ky(e){const t=Oo(e);return t.kind==="baseline"?{kind:"top"}:t}function Bd(e,t,n){return Od(e,n,t)?Oo(e).kind==="baseline":!1}function Ay(e){const t={};let n=!1;for(const i of ca){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}Od(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Fy(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function _y(e){const t=Oo(e).kind;return t==="baseline"?"center":t}function Ny(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Vl(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Wy(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 ka(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=Wy(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 Hy(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 Dy(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Oy={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Pt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const By={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function zy(e){return[Pt(e,"textFontFamily"),Pt(e,"textFontSettings"),{type:"row",items:[Pt(e,"textFontSize"),Pt(e,"textLineHeight"),Pt(e,"textLetterSpacing"),Pt(e,"textWordSpacing")]},Pt(e,"textTextAlign"),Pt(e,"textTextAppearance"),`${e}VerticalAlign`]}function jy(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Do.map(e=>[By[e],zy(e)]))}}function zr(e,t){const n=i=>{const o=Pt(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===Hn?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Gl(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 an(Ut(n,t))}function Xl(e,t,n,i){const o=zr(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function Yl(e,t,n,i){const o=zr(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:D.scalingValue((r-l)/2,i)}}const xn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],no=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],io=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],oo=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Vy={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Gy=["hover","focus","filled","success","error"],ql=.004,Di=.004,Aa=Di,Js=50,Bo=1440,zo=Js/Bo;function zd(e){const t=typeof e=="number"&&e>0?e:Bo;return Js/t}function Xy(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 Bo}const jd={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function Po(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Yy(e,t=1){const n=t/e;return Object.fromEntries(xn.map(i=>[i,n]))}function qy(){return Object.fromEntries([...no.map(e=>[e,0]),...io.map(e=>[e,0])])}function Uy(){return Object.fromEntries(oo.map(e=>[e,0]))}function gr(e){return Object.fromEntries(xn.map(t=>[t,typeof e[t]=="number"?e[t]:jd[t]]))}function Vd(e,t,n){const i=e-zo,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 Mr(e,t,n){const i=Qs(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 Ky(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=no[o],l=io[o],d=typeof n[r]=="number"?n[r]:0,c=typeof n[l]=="number"?n[l]:0,u=Vd(t[o]??0,d,c);u.paddingLeft!==d&&(i[r]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function Qs(e,t,n){if(e<=0)return[];const i=xn.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),l=o.reduce((u,p)=>u+p,0)+zo;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]-zo;if(p<=0)continue;const x=Math.min(c,p);d[u]-=x,c-=x}return[...d,i[e-1]]}function Zy(e,t,n){if(e<=1)return{};const i=Qs(e,t,n),o={};for(let r=0;r<e-1;r+=1){const l=xn[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function Ul(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...ri]}function Jy(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Qy(e,t,n,i){const o=Math.min(i,e.length,xn.length),r={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=xn[c],p=no[c],x=io[c],w=oo[c],m=xn[l],h=no[l],f=io[l],v=oo[l],C=n[u],y=n[p],S=n[x],V=n[w];typeof C=="number"&&(r[m]=C),typeof y=="number"&&(r[h]=y),typeof S=="number"&&(r[f]=S),typeof V=="number"&&(r[v]=V)}return r}function Gd(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 ex(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=Po(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...Yy(n,o),...qy()};if(r)for(const d of oo)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,Uy());return Gd(e,l)?l:e}function tx(e,t,n){const i=Ay(e);i&&(e={...e,...i});const o=zd(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,d=Po(e),c=Po(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:ri.length,x=S=>{if(u)return S;const V=gr({...t,...S}),N=Po(S),q=Mr(p,N,V),W=Ky(p,q,{...t,...S});return Object.keys(W).length===0?S:{...S,...W}};if(typeof r=="number"&&r!==l)return e;const w=Ul(e),m=Ul(t);if(!Jy(w,m))return x({...e,...Qy(w,m,t,p)});if(d<c&&typeof p=="number"&&!u){const S=gr({...t,...e});return x({...e,...Zy(p,d,S)})}if(u){const S=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,V=Math.max(0,(d-o)/2);return S>V?{...e,textPaddingLR:V}:e}const h=gr({...t,...e}),f=Mr(p,c,gr(t)),C=Mr(p,d,h).some((S,V)=>S<(f[V]??S)),y=xn.some(S=>{const V=e[S],N=t[S];return typeof V=="number"&&typeof N=="number"&&V!==N});return C||y?x(e):e}function nx(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(zo,i-o-r-zo)}function ix(e,t){return Math.random()*(t-e)+e}function ox(e){return Object.fromEntries(xn.map(t=>[t,typeof e[t]=="number"?e[t]:jd[t]]))}function Fa(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function rx(e,t,n,i,o,r){return e.slice(0,t).map((l,d)=>{const c=no[d],u=io[d],p=oo[d];return{key:l,textPrefix:Oy[l],widthKey:xn[d],width:n[xn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:r[p]}})}function ax({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,onUpdateSettings:d}){const{prefix:c}=D.useScopedStyles(),u=!!o,{columns:p,type:x,wrapperWidth:w,entriesCount:m,cellMinHeight:h,dividerWidth:f,showVisibility:v,cut:C,showCut:y,cutCellMinHeight:S,cutLabel:V,imageSize:N,imageOnHover:q,imagePosition:W="cursor",imageInterpolation:I="on",entryHoverEffect:B,entryHoverShowOption:$,rowPaddingTop:T,rowPaddingBottom:k,rowPaddingTopB:F,columnsOrder:g,textPaddingLR:O,textColor:P,backgroundColor:X,dividerColor:te,textHoverColor:L,backgroundHoverColor:H,dividerHoverColor:U}=e,[de,ae]=s.useState(void 0),[A,ce]=s.useState(null),z=s.useRef(null),re=q==="on"&&(!n||i),ee=W==="cursor",xe=ee&&I==="on",{anchorRef:Fe,onShow:ye,onCursorMove:b,exit:M}=Ry(!!(re&&A!==null),xe),E=(C??0)>0,j=x==="b",Ce=s.useRef(null),Q=s.useRef(null),[Te,ie]=s.useState(null),[ue,fe]=s.useState(Bo),K=zd(ue),Z=Math.max(0,((w??0)-K)/2),se=Math.min(O??0,Z),Se=Math.max(se,Di),Me=((w??0)+K)/2;s.useLayoutEffect(()=>{if(!n){fe(Bo);return}const Ae=()=>{fe(Xy(Ce.current))};Ae();const Xe=Ce.current;if(!Xe)return;const st=new ResizeObserver(Ae);st.observe(Xe);let ht=Xe;for(;ht&&!ht.style.getPropertyValue("--cntrl-article-width");)ht=ht.parentElement;return ht&&st.observe(ht),()=>st.disconnect()},[n,l]),s.useEffect(()=>{ae(void 0)},[C,y,t,m]),s.useEffect(()=>{n&&!i&&ae(void 0)},[n,i]);const $e=D.buildColorVars(c,{textColor:P,backgroundColor:X,dividerColor:te,textHoverColor:L,backgroundHoverColor:H,dividerHoverColor:U},Vy,Gy),G=r&&r!=="default"?`${c}-state-${r}`:"",oe=`${!n||i?B==="default"?`${c}-entry-hover-default`:B==="blinds"?`${c}-entry-hover-blinds`:B==="reveal"?`${c}-entry-hover-reveal`:"":""} ${G}`.trim(),Y=B==="reveal"&&(!n||i),le=(v==null?void 0:v[0])??!1,_e=(v==null?void 0:v[1])??!1,me=s.useRef(e),J=s.useRef(l);s.useEffect(()=>{if(!d||!n){me.current=e,J.current=l;return}if(J.current!==l){me.current=e,J.current=l;return}const Ae=me.current;if(!(Ae!==e))return;if(typeof Ae.columns=="number"&&typeof e.columns=="number"&&Ae.columns!==e.columns){me.current=e;return}const st=tx(e,Ae,{designWidth:ue});me.current=e,Gd(e,st)&&d(st)},[e,d,n,l,ue]);const Ke=s.useMemo(()=>ox(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),ke=s.useMemo(()=>Fa(e,no),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),tt=s.useMemo(()=>Fa(e,io),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Ye=s.useMemo(()=>Fa(e,oo),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),dt=s.useMemo(()=>Array.isArray(g)&&g.length>0?g:[...ri],[g]),ot=s.useMemo(()=>rx(dt,p,Ke,ke,tt,Ye),[dt,p,Ke,ke,tt,Ye]),Ve=Po(e),Re=s.useMemo(()=>xn.slice(0,p).map(Ae=>Ke[Ae]),[p,Ke]),He=s.useMemo(()=>Qs(p,Ve,Ke),[p,Ve,Ke]),Be=s.useMemo(()=>Mr(p,Ve,Ke),[p,Ve,Ke]),Ze=s.useMemo(()=>ot.map((Ae,Xe)=>Vd(Be[Xe]??0,Ae.paddingLeft,Ae.paddingRight)),[ot,Be]),he=s.useMemo(()=>{const Ae=m===0?1/0:m;return(t??[]).slice(0,Ae).map((st,ht)=>({id:ht,cells:Object.fromEntries(ri.map(yt=>[yt,st[yt]??""])),image:st.image,link:st.link}))},[t,m]),ve=E?de??C:he.length,We=s.useMemo(()=>E?he.slice(0,ve):he,[he,E,ve]),Je=E&&ve<he.length,be=We.length>1||Je,Ie=[le?`${c}-divider-top`:"",_e||be?`${c}-divider-bottom`:""].filter(Boolean).join(" "),qe=!n||i,ze=()=>{if(!qe)return;const Ae=de??C;if(!y){ae(he.length);return}ae(Math.min(Ae+y,he.length))},Le=Ae=>D.scalingValue(Ae,n??!1),Ge=j?F??0:T??0,De=k??0,nt=h??0,it=Math.max(De,Aa),ct=Bl(0,We.length,le,_e,Je,f??0,n??!1).borderTopWidth,St=j?"rowPaddingTopB":"rowPaddingTop",Bt=ot[0],zt=ot[ot.length-1],ft=Ze[0],wt=Ze[Ze.length-1],jt=Bt&&ft?Math.max(ft.paddingLeft,Di):0,At=zt&&wt?Math.max(wt.paddingRight,Di):0,vt=Ve,Ft=(Ae,Xe)=>Iy(W,Ce.current,ee?Ae:null,Xe),Nt=(Ae,Xe)=>{if(!re)return;const st=Ae.image;if(!(st!=null&&st.url)){M(()=>ce(null));return}const ht=(N==null?void 0:N.min)??80,yt=(N==null?void 0:N.max)??320,Lt=(A==null?void 0:A.rowId)===Ae.id,mt=Lt?A.widthPx:ix(ht,yt),{x:Vt,y:kt}=Ft(Xe,mt);if(Lt&&ee){b(Vt,kt);return}ce({rowId:Ae.id,url:st.url,objectFit:"contain",isVideo:wy(st),widthPx:mt}),z.current={x:Vt,y:kt}},Kt=Ae=>{if(!re||!A||!ee)return;const{x:Xe,y:st}=Ft(Ae,A.widthPx);b(Xe,st)},Jt=()=>{A&&M(()=>ce(null))},Tt=Ae=>{Y&&Dl(Ae,c),!(!re||!A)&&M(()=>ce(null))},Wt=Ae=>{Y&&Ol(Ae,c)};s.useLayoutEffect(()=>{if(!A||!z.current)return;const{x:Ae,y:Xe}=z.current;z.current=null,ye(Ae,Xe)},[A==null?void 0:A.rowId,A==null?void 0:A.url,ye]),s.useLayoutEffect(()=>{if(!u||j){ie(null);return}const Ae=Q.current,Xe=Ae==null?void 0:Ae.parentElement;if(!Ae||!Xe){ie(null);return}const st=()=>{const yt=Ae.querySelector("[data-list-row]");if(!yt){ie(null);return}const Lt=Xe.getBoundingClientRect(),mt=yt.getBoundingClientRect();ie(mt.top-Lt.top+mt.height/2)};st();const ht=new ResizeObserver(st);return ht.observe(Ae),ht.observe(Xe),()=>ht.disconnect()},[u,j,We,Ge,De,nt,t,e,ot,Be,ue,f,le,_e,Je]);const rn=s.useMemo(()=>!j&&Ks.some(Ae=>{const Xe=Ae.charAt(0),st=e[`${Ae}VerticalAlign`];return Bd(st,e,Xe)}),[j,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var Vt;const Ae=Ce.current;if(!Ae)return;const Xe=()=>{Ae.querySelectorAll("[data-list-col]").forEach(kt=>{kt.style.transform="";const Mt=kt.querySelector(`.${c}-list-col`);Mt&&(Mt.style.minHeight="",Mt.style.height="");const Xt=kt.querySelector(`.${c}-list-col-title`);Xt&&(Xt.style.transform="")})};if(j||!rn){Xe();return}const st=()=>{const kt=Array.from(Ae.querySelectorAll("[data-list-row]")),Mt=`${c}-list-col`,Xt=`${c}-baseline-probe`;kt.forEach(Yt=>{Yt.querySelectorAll("[data-list-col]").forEach(Ht=>{Ht.style.transform="";const Dt=Ht.querySelector(`.${Mt}`);Dt&&(Dt.style.minHeight="",Dt.style.height="");const _t=Ht.querySelector(`.${c}-list-col-title`);_t&&(_t.style.transform="")})}),kt.forEach(Yt=>{const Ht=Array.from(Yt.querySelectorAll("[data-list-col]"));Hy(Yt,Ht,Mt)}),Ae.offsetHeight,kt.forEach(Yt=>{const Ht=Array.from(Yt.querySelectorAll("[data-list-col]")),Dt=Yt.getBoundingClientRect().top,_t=new Map,Ct=Ht.map(Ne=>{const Oe=Ne.querySelector(`.${c}-list-col-title`),lt={el:Ne,titleEl:Oe,letter:Ne.getAttribute("data-col-letter")??"",kind:Ne.getAttribute("data-valign")??"top",anchor:Ne.getAttribute("data-valign-anchor")};return _t.set(lt.letter,lt),lt}),_=new Map,Pe=(Ne,Oe)=>{const lt=_.get(Ne.letter);if(lt!==void 0)return lt;const Et=Ne.anchor?_t.get(Ne.anchor):void 0;if(Ne.kind!=="baseline"||!Et||Oe.has(Ne.letter)){const nn=ka(Ne,Dt,Mt,Xt);return _.set(Ne.letter,nn),nn}Oe.add(Ne.letter);const rt=Pe(Et,Oe);Oe.delete(Ne.letter);const xt=ka(Ne,Dt,Mt,Xt),Ot=rt-xt;Dy(Ne.titleEl,Ot);const It=ka(Ne,Dt,Mt,Xt);return _.set(Ne.letter,It),It};Ct.forEach(Ne=>Pe(Ne,new Set))})};let ht=null;const yt=()=>{ht===null&&(ht=requestAnimationFrame(()=>{ht=null,st()}))};st();const Lt=new ResizeObserver(()=>yt());Lt.observe(Ae);let mt=!1;return typeof document<"u"&&((Vt=document.fonts)!=null&&Vt.ready)&&document.fonts.ready.then(()=>{mt||yt()}),()=>{mt=!0,ht!==null&&(cancelAnimationFrame(ht),ht=null),Lt.disconnect(),Xe()}},[rn,j,e,t,ue,We,Be]);const gt=s.useMemo(()=>Ly(c),[c]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:gt}}),a.jsx("div",{style:$e,children:a.jsxs("div",{ref:Ce,className:`${c}-wrapper ${oe}${Ie?` ${Ie}`:""}${j?` ${c}-type-b`:""}`.trim(),style:{width:D.scalingValue(w??0,n)},onMouseMove:re?Kt:void 0,onMouseLeave:re?Jt:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[We.map((Ae,Xe)=>{var Lt;const st=(((Lt=Ae.link)==null?void 0:Lt.length)??0)>0,ht=st&&(!n||i)?"a":"div",yt=Bl(Xe,We.length,le,_e,Je,f??0,n??!1);return a.jsxs(ht,{ref:Xe===0?mt=>{Q.current=mt}:void 0,className:`${c}-list-item${st||$==="always"?` ${c}-list-item-has-link`:""}${Je&&Xe===We.length-1?` ${c}-list-item-before-cut`:""}`,...st?{href:Ae.link,target:"_blank"}:{},style:yt,onMouseEnter:mt=>{Y&&(st||$==="always")&&Dl(mt,c),re&&Nt(Ae,mt)},onMouseLeave:mt=>{Y&&(st||$==="always")&&Ol(mt,c)},children:[Ge>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Le(Ge)}}),a.jsxs("div",{className:`${c}-list-cols-row${j?"":` ${c}-list-cols-row-h`}${u&&Xe===0&&j?` ${c}-list-cols-row-controls`:""}`,...j?{}:{"data-list-row":""},style:j?void 0:{minHeight:Le(nt)},children:[ot.map((mt,Vt)=>{const kt=Vt===ot.length-1,Mt=Ze[Vt],Xt=mt.paddingBottom,Yt=Cy(Ae.cells[mt.key]),Ht=j&&Yt&&Xt>0,Dt=j?{minHeight:Le(nt)}:{width:Le(Be[Vt])},_t=j?{paddingLeft:Le(se),paddingRight:Le(se)}:{paddingLeft:Le(Mt.paddingLeft),paddingRight:Le(Mt.paddingRight)},Ct=mt.textPrefix.charAt(0),_=j?ky(e[`${mt.textPrefix}VerticalAlign`]):My(e[`${mt.textPrefix}VerticalAlign`],e,Ct),Pe=j&&Yt&&u&&Xe===0;return j&&!Yt?null:a.jsxs("div",{className:j?`${c}-list-col-wrap`:void 0,...j?{}:{"data-list-col":"","data-col-letter":Ct,"data-valign":_.kind,..._.kind==="baseline"?{"data-valign-anchor":_.anchorLetter}:{}},children:[a.jsx("div",{className:`${c}-list-col${kt?` ${c}-list-col-last`:""}`,style:{..._t,...Dt,...j?{justifyContent:Vl(_.kind)}:{}},"data-test":mt.width,children:a.jsx("span",{className:Xl(e,mt.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Gl(zr(e,mt.textPrefix),n),...Yl(e,mt.textPrefix,c,n),...j?{}:Fy(_.kind)},children:Ae.cells[mt.key]??null})}),Ht&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Le(Xt)}}),Pe&&a.jsx("div",{"data-controls":mt.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:Le(Math.max(Xt,Aa))}})]},mt.key)}),u&&Xe===0&&j&&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(Me),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:Le(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(Me),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:Le(Math.max(Se,Ve-Se)),width:Le(Se),height:"100%"}})]})]}),!j&&De>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Le(De)}}),u&&Xe===0&&!j&&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:Le(it)}})]},Ae.id)}),u&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":St,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":j?"center":"left-y",className:`${c}-control-anchor`,style:{top:ct,left:0,width:"100%",height:Le(Math.max(Ge,Aa))}})},"row-padding-handles"),u&&!j&&Bt&&zt&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Bt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Be[0]-((ft==null?void 0:ft.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Te??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:Le(jt),height:"100%"}}),a.jsx("div",{"data-controls":zt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Be[ot.length-1]-((wt==null?void 0:wt.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Te??void 0,className:`${c}-control-anchor`,style:{top:0,left:Le(vt-At),width:Le(At),height:"100%"}})]},"column-edge-padding-handles"),u&&!j&&ot.slice(0,-1).map((Ae,Xe)=>{const st=ot[Xe+1],ht=He.slice(0,Xe+1).reduce((kt,Mt)=>kt+Mt,0),yt=Ze[Xe],Lt=Ze[Xe+1],mt=Math.max(yt.paddingRight,Di),Vt=Math.max(Lt.paddingLeft,Di);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Ae.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Be[Xe]-yt.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Te??void 0,className:`${c}-control-anchor`,style:{top:0,left:Le(ht-mt),width:Le(mt),height:"100%"}}),a.jsx("div",{"data-controls":st.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Be[Xe+1]-Lt.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Te??void 0,className:`${c}-control-anchor`,style:{top:0,left:Le(ht),width:Le(Vt),height:"100%"}})]},`${Ae.paddingRightKey}-padding`)}),u&&!j&&ot.slice(0,-1).map((Ae,Xe)=>{const st=nx(Xe,He,Re,Ve),yt=He.slice(0,Xe+1).reduce((Lt,mt)=>Lt+mt,0)-ql/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Ae.widthKey,"data-controls-axis":"x","data-controls-min":String(Js),"data-controls-max-fraction":String(st),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Le(yt),width:Le(ql),height:"calc(100%)",pointerEvents:"auto"}})},`${Ae.widthKey}-junction`)})]}),Je&&(()=>{const Ae=zr(e,Hn),Xe=_y(e.cutLabelVerticalAlign),st=Ae.textTextAlign==="justify"||j;return a.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Le(S??0),cursor:qe?"pointer":"default",...$y(_e,f??0,n??!1)},onClick:qe?ze:void 0,onMouseEnter:Y||re?Tt:void 0,onMouseLeave:Y?Wt:void 0,children:a.jsx("div",{className:`${c}-list-cols-row`,style:{...j?{paddingLeft:Le(se),paddingRight:Le(se)}:{},justifyContent:Ny(Ae.textTextAlign),alignItems:Vl(Xe)},children:a.jsx("span",{className:Xl(e,Hn,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Gl(Ae,n),...Yl(e,Hn,c,n),...st?{width:"100%"}:{}},children:V})})})})(),re&&A&&(()=>{const Ae=`${A.widthPx}px`,Xe={width:Ae,height:"auto",maxHeight:Ae,objectFit:"contain"};return a.jsx("div",{ref:Fe,className:`${c}-hover-media-anchor`,children:a.jsx(Sy,{media:A,className:A.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Xe},`${A.rowId}-${A.url}`)})})()]})})]})}const sx=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
10228
+ `}const ri=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Ks=["AColumn","BColumn","CColumn","DColumn","EColumn"],Hn="cutLabel",Do=[...Ks,Hn],ca=["A","B","C","D","E"];function Od(e){return`${e}ColumnVerticalAlign`}const ls=["Top","Center","Bottom"];function Zs(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return ca.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Ey(e){const t=Zs(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function My(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return ca.includes(n)?n:null}function Bd(e,t,n){const i=My(e);return i?i===t?!1:Ey(n[Od(i)]):!0}function Oo(e){const t=Zs(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return ca.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function ky(e,t,n){if(zd(e,t,n))return Oo(e);const i=Oo(e);return i.kind==="baseline"?{kind:"top"}:i}function Ay(e){const t=Oo(e);return t.kind==="baseline"?{kind:"top"}:t}function zd(e,t,n){return Bd(e,n,t)?Oo(e).kind==="baseline":!1}function Fy(e){const t={};let n=!1;for(const i of ca){const o=Od(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}Bd(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function _y(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Ny(e){const t=Oo(e).kind;return t==="baseline"?"center":t}function Wy(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Vl(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Hy(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 ka(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=Hy(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 Dy(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 Oy(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const By={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Pt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const zy={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function jy(e){return[Pt(e,"textFontFamily"),Pt(e,"textFontSettings"),{type:"row",items:[Pt(e,"textFontSize"),Pt(e,"textLineHeight"),Pt(e,"textLetterSpacing"),Pt(e,"textWordSpacing")]},Pt(e,"textTextAlign"),Pt(e,"textTextAppearance"),`${e}VerticalAlign`]}function Vy(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Do.map(e=>[zy[e],jy(e)]))}}function zr(e,t){const n=i=>{const o=Pt(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===Hn?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Gl(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 an(qt(n,t))}function Xl(e,t,n,i){const o=zr(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function Yl(e,t,n,i){const o=zr(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:D.scalingValue((r-l)/2,i)}}const xn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],no=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],io=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],oo=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Gy={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Xy=["hover","focus","filled","success","error"],ql=.004,Di=.004,Aa=Di,Js=50,Bo=1440,zo=Js/Bo;function jd(e){const t=typeof e=="number"&&e>0?e:Bo;return Js/t}function Yy(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 Bo}const Vd={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function Po(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function qy(e,t=1){const n=t/e;return Object.fromEntries(xn.map(i=>[i,n]))}function Uy(){return Object.fromEntries([...no.map(e=>[e,0]),...io.map(e=>[e,0])])}function Ky(){return Object.fromEntries(oo.map(e=>[e,0]))}function gr(e){return Object.fromEntries(xn.map(t=>[t,typeof e[t]=="number"?e[t]:Vd[t]]))}function Gd(e,t,n){const i=e-zo,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 Mr(e,t,n){const i=Qs(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 Zy(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=no[o],l=io[o],d=typeof n[r]=="number"?n[r]:0,c=typeof n[l]=="number"?n[l]:0,u=Gd(t[o]??0,d,c);u.paddingLeft!==d&&(i[r]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function Qs(e,t,n){if(e<=0)return[];const i=xn.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),l=o.reduce((u,p)=>u+p,0)+zo;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]-zo;if(p<=0)continue;const x=Math.min(c,p);d[u]-=x,c-=x}return[...d,i[e-1]]}function Jy(e,t,n){if(e<=1)return{};const i=Qs(e,t,n),o={};for(let r=0;r<e-1;r+=1){const l=xn[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function Ul(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...ri]}function Qy(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function ex(e,t,n,i){const o=Math.min(i,e.length,xn.length),r={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=xn[c],p=no[c],x=io[c],w=oo[c],m=xn[l],h=no[l],f=io[l],v=oo[l],C=n[u],y=n[p],S=n[x],G=n[w];typeof C=="number"&&(r[m]=C),typeof y=="number"&&(r[h]=y),typeof S=="number"&&(r[f]=S),typeof G=="number"&&(r[v]=G)}return r}function Xd(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 tx(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=Po(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...qy(n,o),...Uy()};if(r)for(const d of oo)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,Ky());return Xd(e,l)?l:e}function nx(e,t,n){const i=Fy(e);i&&(e={...e,...i});const o=jd(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,d=Po(e),c=Po(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:ri.length,x=S=>{if(u)return S;const G=gr({...t,...S}),W=Po(S),U=Mr(p,W,G),H=Zy(p,U,{...t,...S});return Object.keys(H).length===0?S:{...S,...H}};if(typeof r=="number"&&r!==l)return e;const w=Ul(e),m=Ul(t);if(!Qy(w,m))return x({...e,...ex(w,m,t,p)});if(d<c&&typeof p=="number"&&!u){const S=gr({...t,...e});return x({...e,...Jy(p,d,S)})}if(u){const S=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,G=Math.max(0,(d-o)/2);return S>G?{...e,textPaddingLR:G}:e}const h=gr({...t,...e}),f=Mr(p,c,gr(t)),C=Mr(p,d,h).some((S,G)=>S<(f[G]??S)),y=xn.some(S=>{const G=e[S],W=t[S];return typeof G=="number"&&typeof W=="number"&&G!==W});return C||y?x(e):e}function ix(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(zo,i-o-r-zo)}function ox(e,t){return Math.random()*(t-e)+e}function rx(e){return Object.fromEntries(xn.map(t=>[t,typeof e[t]=="number"?e[t]:Vd[t]]))}function Fa(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function ax(e,t,n,i,o,r){return e.slice(0,t).map((l,d)=>{const c=no[d],u=io[d],p=oo[d];return{key:l,textPrefix:By[l],widthKey:xn[d],width:n[xn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:r[p]}})}function sx({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,onUpdateSettings:d}){const{prefix:c}=D.useScopedStyles(),u=!!o,{columns:p,type:x,wrapperWidth:w,entriesCount:m,cellMinHeight:h,dividerWidth:f,showVisibility:v,cut:C,showCut:y,cutCellMinHeight:S,cutLabel:G,imageSize:W,imageOnHover:U,imagePosition:H="cursor",imageInterpolation:I="on",entryHoverEffect:z,entryHoverShowOption:$,rowPaddingTop:T,rowPaddingBottom:A,rowPaddingTopB:_,columnsOrder:g,textPaddingLR:B,textColor:P,backgroundColor:Y,dividerColor:ie,textHoverColor:L,backgroundHoverColor:O,dividerHoverColor:K}=e,[ue,le]=s.useState(void 0),[F,pe]=s.useState(null),j=s.useRef(null),se=U==="on"&&(!n||i),ne=H==="cursor",ve=ne&&I==="on",{anchorRef:Me,onShow:xe,onCursorMove:b,exit:M}=Ly(!!(se&&F!==null),ve),E=(C??0)>0,V=x==="b",Se=s.useRef(null),te=s.useRef(null),[$e,re]=s.useState(null),[ge,ye]=s.useState(Bo),Z=jd(ge),Q=Math.max(0,((w??0)-Z)/2),ce=Math.min(B??0,Q),we=Math.max(ce,Di),Pe=((w??0)+Z)/2;s.useLayoutEffect(()=>{if(!n){ye(Bo);return}const Ee=()=>{ye(Yy(Se.current))};Ee();const Xe=Se.current;if(!Xe)return;const lt=new ResizeObserver(Ee);lt.observe(Xe);let ht=Xe;for(;ht&&!ht.style.getPropertyValue("--cntrl-article-width");)ht=ht.parentElement;return ht&&lt.observe(ht),()=>lt.disconnect()},[n,l]),s.useEffect(()=>{le(void 0)},[C,y,t,m]),s.useEffect(()=>{n&&!i&&le(void 0)},[n,i]);const Ce=D.buildColorVars(c,{textColor:P,backgroundColor:Y,dividerColor:ie,textHoverColor:L,backgroundHoverColor:O,dividerHoverColor:K},Gy,Xy),X=r&&r!=="default"?`${c}-state-${r}`:"",ae=`${!n||i?z==="default"?`${c}-entry-hover-default`:z==="blinds"?`${c}-entry-hover-blinds`:z==="reveal"?`${c}-entry-hover-reveal`:"":""} ${X}`.trim(),q=z==="reveal"&&(!n||i),de=(v==null?void 0:v[0])??!1,ke=(v==null?void 0:v[1])??!1,he=s.useRef(e),J=s.useRef(l);s.useEffect(()=>{if(!d||!n){he.current=e,J.current=l;return}if(J.current!==l){he.current=e,J.current=l;return}const Ee=he.current;if(!(Ee!==e))return;if(typeof Ee.columns=="number"&&typeof e.columns=="number"&&Ee.columns!==e.columns){he.current=e;return}const lt=nx(e,Ee,{designWidth:ge});he.current=e,Xd(e,lt)&&d(lt)},[e,d,n,l,ge]);const Ne=s.useMemo(()=>rx(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Fe=s.useMemo(()=>Fa(e,no),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),et=s.useMemo(()=>Fa(e,io),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Je=s.useMemo(()=>Fa(e,oo),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),dt=s.useMemo(()=>Array.isArray(g)&&g.length>0?g:[...ri],[g]),tt=s.useMemo(()=>ax(dt,p,Ne,Fe,et,Je),[dt,p,Ne,Fe,et,Je]),De=Po(e),Ie=s.useMemo(()=>xn.slice(0,p).map(Ee=>Ne[Ee]),[p,Ne]),We=s.useMemo(()=>Qs(p,De,Ne),[p,De,Ne]),je=s.useMemo(()=>Mr(p,De,Ne),[p,De,Ne]),Ue=s.useMemo(()=>tt.map((Ee,Xe)=>Gd(je[Xe]??0,Ee.paddingLeft,Ee.paddingRight)),[tt,je]),k=s.useMemo(()=>{const Ee=m===0?1/0:m;return(t??[]).slice(0,Ee).map((lt,ht)=>({id:ht,cells:Object.fromEntries(ri.map(ft=>[ft,lt[ft]??""])),image:lt.image,link:lt.link}))},[t,m]),ee=E?ue??C:k.length,Te=s.useMemo(()=>E?k.slice(0,ee):k,[k,E,ee]),He=E&&ee<k.length,Be=Te.length>1||He,Ve=[de?`${c}-divider-top`:"",ke||Be?`${c}-divider-bottom`:""].filter(Boolean).join(" "),rt=!n||i,Ze=()=>{if(!rt)return;const Ee=ue??C;if(!y){le(k.length);return}le(Math.min(Ee+y,k.length))},_e=Ee=>D.scalingValue(Ee,n??!1),qe=V?_??0:T??0,Oe=A??0,nt=h??0,at=Math.max(Oe,Aa),st=Bl(0,Te.length,de,ke,He,f??0,n??!1).borderTopWidth,St=V?"rowPaddingTopB":"rowPaddingTop",Yt=tt[0],Zt=tt[tt.length-1],vt=Ue[0],wt=Ue[Ue.length-1],Bt=Yt&&vt?Math.max(vt.paddingLeft,Di):0,At=Zt&&wt?Math.max(wt.paddingRight,Di):0,xt=De,Ft=(Ee,Xe)=>Ry(H,Se.current,ne?Ee:null,Xe),Nt=(Ee,Xe)=>{if(!se)return;const lt=Ee.image;if(!(lt!=null&&lt.url)){M(()=>pe(null));return}const ht=(W==null?void 0:W.min)??80,ft=(W==null?void 0:W.max)??320,Lt=(F==null?void 0:F.rowId)===Ee.id,mt=Lt?F.widthPx:ox(ht,ft),{x:zt,y:kt}=Ft(Xe,mt);if(Lt&&ne){b(zt,kt);return}pe({rowId:Ee.id,url:lt.url,objectFit:"contain",isVideo:Sy(lt),widthPx:mt}),j.current={x:zt,y:kt}},Ut=Ee=>{if(!se||!F||!ne)return;const{x:Xe,y:lt}=Ft(Ee,F.widthPx);b(Xe,lt)},Jt=()=>{F&&M(()=>pe(null))},Tt=Ee=>{q&&Dl(Ee,c),!(!se||!F)&&M(()=>pe(null))},Wt=Ee=>{q&&Ol(Ee,c)};s.useLayoutEffect(()=>{if(!F||!j.current)return;const{x:Ee,y:Xe}=j.current;j.current=null,xe(Ee,Xe)},[F==null?void 0:F.rowId,F==null?void 0:F.url,xe]),s.useLayoutEffect(()=>{if(!u||V){re(null);return}const Ee=te.current,Xe=Ee==null?void 0:Ee.parentElement;if(!Ee||!Xe){re(null);return}const lt=()=>{const ft=Ee.querySelector("[data-list-row]");if(!ft){re(null);return}const Lt=Xe.getBoundingClientRect(),mt=ft.getBoundingClientRect();re(mt.top-Lt.top+mt.height/2)};lt();const ht=new ResizeObserver(lt);return ht.observe(Ee),ht.observe(Xe),()=>ht.disconnect()},[u,V,Te,qe,Oe,nt,t,e,tt,je,ge,f,de,ke,He]);const rn=s.useMemo(()=>!V&&Ks.some(Ee=>{const Xe=Ee.charAt(0),lt=e[`${Ee}VerticalAlign`];return zd(lt,e,Xe)}),[V,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var zt;const Ee=Se.current;if(!Ee)return;const Xe=()=>{Ee.querySelectorAll("[data-list-col]").forEach(kt=>{kt.style.transform="";const Mt=kt.querySelector(`.${c}-list-col`);Mt&&(Mt.style.minHeight="",Mt.style.height="");const Vt=kt.querySelector(`.${c}-list-col-title`);Vt&&(Vt.style.transform="")})};if(V||!rn){Xe();return}const lt=()=>{const kt=Array.from(Ee.querySelectorAll("[data-list-row]")),Mt=`${c}-list-col`,Vt=`${c}-baseline-probe`;kt.forEach(Gt=>{Gt.querySelectorAll("[data-list-col]").forEach(Ht=>{Ht.style.transform="";const Dt=Ht.querySelector(`.${Mt}`);Dt&&(Dt.style.minHeight="",Dt.style.height="");const _t=Ht.querySelector(`.${c}-list-col-title`);_t&&(_t.style.transform="")})}),kt.forEach(Gt=>{const Ht=Array.from(Gt.querySelectorAll("[data-list-col]"));Dy(Gt,Ht,Mt)}),Ee.offsetHeight,kt.forEach(Gt=>{const Ht=Array.from(Gt.querySelectorAll("[data-list-col]")),Dt=Gt.getBoundingClientRect().top,_t=new Map,Ct=Ht.map(Ae=>{const ze=Ae.querySelector(`.${c}-list-col-title`),ct={el:Ae,titleEl:ze,letter:Ae.getAttribute("data-col-letter")??"",kind:Ae.getAttribute("data-valign")??"top",anchor:Ae.getAttribute("data-valign-anchor")};return _t.set(ct.letter,ct),ct}),N=new Map,Re=(Ae,ze)=>{const ct=N.get(Ae.letter);if(ct!==void 0)return ct;const Et=Ae.anchor?_t.get(Ae.anchor):void 0;if(Ae.kind!=="baseline"||!Et||ze.has(Ae.letter)){const nn=ka(Ae,Dt,Mt,Vt);return N.set(Ae.letter,nn),nn}ze.add(Ae.letter);const it=Re(Et,ze);ze.delete(Ae.letter);const yt=ka(Ae,Dt,Mt,Vt),Ot=it-yt;Oy(Ae.titleEl,Ot);const It=ka(Ae,Dt,Mt,Vt);return N.set(Ae.letter,It),It};Ct.forEach(Ae=>Re(Ae,new Set))})};let ht=null;const ft=()=>{ht===null&&(ht=requestAnimationFrame(()=>{ht=null,lt()}))};lt();const Lt=new ResizeObserver(()=>ft());Lt.observe(Ee);let mt=!1;return typeof document<"u"&&((zt=document.fonts)!=null&&zt.ready)&&document.fonts.ready.then(()=>{mt||ft()}),()=>{mt=!0,ht!==null&&(cancelAnimationFrame(ht),ht=null),Lt.disconnect(),Xe()}},[rn,V,e,t,ge,Te,je]);const gt=s.useMemo(()=>Py(c),[c]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:gt}}),a.jsx("div",{style:Ce,children:a.jsxs("div",{ref:Se,className:`${c}-wrapper ${ae}${Ve?` ${Ve}`:""}${V?` ${c}-type-b`:""}`.trim(),style:{width:D.scalingValue(w??0,n)},onMouseMove:se?Ut:void 0,onMouseLeave:se?Jt:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[Te.map((Ee,Xe)=>{var Lt;const lt=(((Lt=Ee.link)==null?void 0:Lt.length)??0)>0,ht=lt&&(!n||i)?"a":"div",ft=Bl(Xe,Te.length,de,ke,He,f??0,n??!1);return a.jsxs(ht,{ref:Xe===0?mt=>{te.current=mt}:void 0,className:`${c}-list-item${lt||$==="always"?` ${c}-list-item-has-link`:""}${He&&Xe===Te.length-1?` ${c}-list-item-before-cut`:""}`,...lt?{href:Ee.link,target:"_blank"}:{},style:ft,onMouseEnter:mt=>{q&&(lt||$==="always")&&Dl(mt,c),se&&Nt(Ee,mt)},onMouseLeave:mt=>{q&&(lt||$==="always")&&Ol(mt,c)},children:[qe>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:_e(qe)}}),a.jsxs("div",{className:`${c}-list-cols-row${V?"":` ${c}-list-cols-row-h`}${u&&Xe===0&&V?` ${c}-list-cols-row-controls`:""}`,...V?{}:{"data-list-row":""},style:V?void 0:{minHeight:_e(nt)},children:[tt.map((mt,zt)=>{const kt=zt===tt.length-1,Mt=Ue[zt],Vt=mt.paddingBottom,Gt=$y(Ee.cells[mt.key]),Ht=V&&Gt&&Vt>0,Dt=V?{minHeight:_e(nt)}:{width:_e(je[zt])},_t=V?{paddingLeft:_e(ce),paddingRight:_e(ce)}:{paddingLeft:_e(Mt.paddingLeft),paddingRight:_e(Mt.paddingRight)},Ct=mt.textPrefix.charAt(0),N=V?Ay(e[`${mt.textPrefix}VerticalAlign`]):ky(e[`${mt.textPrefix}VerticalAlign`],e,Ct),Re=V&&Gt&&u&&Xe===0;return V&&!Gt?null:a.jsxs("div",{className:V?`${c}-list-col-wrap`:void 0,...V?{}:{"data-list-col":"","data-col-letter":Ct,"data-valign":N.kind,...N.kind==="baseline"?{"data-valign-anchor":N.anchorLetter}:{}},children:[a.jsx("div",{className:`${c}-list-col${kt?` ${c}-list-col-last`:""}`,style:{..._t,...Dt,...V?{justifyContent:Vl(N.kind)}:{}},"data-test":mt.width,children:a.jsx("span",{className:Xl(e,mt.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Gl(zr(e,mt.textPrefix),n),...Yl(e,mt.textPrefix,c,n),...V?{}:_y(N.kind)},children:Ee.cells[mt.key]??null})}),Ht&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:_e(Vt)}}),Re&&a.jsx("div",{"data-controls":mt.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(Vt,Aa))}})]},mt.key)}),u&&Xe===0&&V&&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,De-we)),width:_e(we),height:"100%"}})]})]}),!V&&Oe>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:_e(Oe)}}),u&&Xe===0&&!V&&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(at)}})]},Ee.id)}),u&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":St,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":V?"center":"left-y",className:`${c}-control-anchor`,style:{top:st,left:0,width:"100%",height:_e(Math.max(qe,Aa))}})},"row-padding-handles"),u&&!V&&Yt&&Zt&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Yt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(je[0]-((vt==null?void 0:vt.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":$e??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:_e(Bt),height:"100%"}}),a.jsx("div",{"data-controls":Zt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(je[tt.length-1]-((wt==null?void 0:wt.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":$e??void 0,className:`${c}-control-anchor`,style:{top:0,left:_e(xt-At),width:_e(At),height:"100%"}})]},"column-edge-padding-handles"),u&&!V&&tt.slice(0,-1).map((Ee,Xe)=>{const lt=tt[Xe+1],ht=We.slice(0,Xe+1).reduce((kt,Mt)=>kt+Mt,0),ft=Ue[Xe],Lt=Ue[Xe+1],mt=Math.max(ft.paddingRight,Di),zt=Math.max(Lt.paddingLeft,Di);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Ee.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(je[Xe]-ft.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":$e??void 0,className:`${c}-control-anchor`,style:{top:0,left:_e(ht-mt),width:_e(mt),height:"100%"}}),a.jsx("div",{"data-controls":lt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(je[Xe+1]-Lt.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":$e??void 0,className:`${c}-control-anchor`,style:{top:0,left:_e(ht),width:_e(zt),height:"100%"}})]},`${Ee.paddingRightKey}-padding`)}),u&&!V&&tt.slice(0,-1).map((Ee,Xe)=>{const lt=ix(Xe,We,Ie,De),ft=We.slice(0,Xe+1).reduce((Lt,mt)=>Lt+mt,0)-ql/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Ee.widthKey,"data-controls-axis":"x","data-controls-min":String(Js),"data-controls-max-fraction":String(lt),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:_e(ft),width:_e(ql),height:"calc(100%)",pointerEvents:"auto"}})},`${Ee.widthKey}-junction`)})]}),He&&(()=>{const Ee=zr(e,Hn),Xe=Ny(e.cutLabelVerticalAlign),lt=Ee.textTextAlign==="justify"||V;return a.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:_e(S??0),cursor:rt?"pointer":"default",...Ty(ke,f??0,n??!1)},onClick:rt?Ze:void 0,onMouseEnter:q||se?Tt:void 0,onMouseLeave:q?Wt:void 0,children:a.jsx("div",{className:`${c}-list-cols-row`,style:{...V?{paddingLeft:_e(ce),paddingRight:_e(ce)}:{},justifyContent:Wy(Ee.textTextAlign),alignItems:Vl(Xe)},children:a.jsx("span",{className:Xl(e,Hn,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Gl(Ee,n),...Yl(e,Hn,c,n),...lt?{width:"100%"}:{}},children:G})})})})(),se&&F&&(()=>{const Ee=`${F.widthPx}px`,Xe={width:Ee,height:"auto",maxHeight:Ee,objectFit:"contain"};return a.jsx("div",{ref:Me,className:`${c}-hover-media-anchor`,children:a.jsx(Cy,{media:F,className:F.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Xe},`${F.rowId}-${F.url}`)})})()]})})]})}const lx=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
10229
10229
  import { CommonComponentProps } from '../props';
10230
10230
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
10231
10231
  import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
@@ -13313,7 +13313,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
13313
13313
  </>
13314
13314
  );
13315
13315
  }
13316
- `,go=["A","B","C","D","E"],Kl=[...ls,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],gi={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"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function lx(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function hr(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function cx(){return Object.fromEntries(go.map((e,t)=>{const n=ri[t],i=`${e} column`;return[n,lx(i)]}))}function dx(){const e={};for(const t of go)e[`${t}ColumnWidth`]=hr(`${t} column width`),e[`${t}ColumnPaddingLeft`]=hr(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=hr(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=hr(`${t} column padding bottom`);return e}function Zl(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...ri]};for(const r of go)i[`${r}ColumnWidth`]=r==="A"?.0798:.32,i[`${r}ColumnPaddingLeft`]=0,i[`${r}ColumnPaddingRight`]=0,i[`${r}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function ux(e){const t={};if(e===Hn)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...ls]},enum:[...ls]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Kl],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Kl]}}return t[Pt(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Pt(e,"textFontSettings")]={...gi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Pt(e,"textFontSize")]={...gi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Pt(e,"textLineHeight")]={...gi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Pt(e,"textLetterSpacing")]={...gi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Pt(e,"textWordSpacing")]={...gi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Pt(e,"textTextAlign")]={...gi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Pt(e,"textTextAppearance")]={...gi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const px=Do.reduce((e,t)=>({...e,...ux(t)}),{});function mx(e){return{verticalAlign:e===Hn?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===Hn?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function gx(e,t={}){var n;return{...mx(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Jl=new Set(["textFontFamily","textFontSettings"]);function hx(e,t,n){const i=r=>n===void 0?!0:n==="common"?Jl.has(r):!Jl.has(r),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=Zs(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Pt(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Pt(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Pt(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Pt(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Pt(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Pt(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Pt(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Pt(e,"textTextAppearance")]=t.textTextAppearance),o}function kr(e={},t){return Do.reduce((n,i)=>({...n,...hx(i,gx(i,e),t)}),{})}const fx=kr(),yx=jy();function Xd(e){return[Pt(e,"textFontFamily"),Pt(e,"textFontSettings"),Pt(e,"textFontSize"),Pt(e,"textLineHeight"),Pt(e,"textLetterSpacing"),Pt(e,"textWordSpacing"),Pt(e,"textTextAlign"),Pt(e,"textTextAppearance"),`${e}VerticalAlign`]}function xx(){const e=[];return Ks.forEach((t,n)=>{const i=ri[n],o=Xd(t);for(let r=1;r<ri.length;r+=1){const l=[{name:"columns",value:r},...Array.from({length:r},(d,c)=>({name:`columnsOrder.${c}`,value:i,isNotEqual:!0}))];o.forEach(d=>{e.push({if:l,then:{name:`properties.${d}.display.visible`,value:!1}})})}}),e}const vx=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Xd(Hn);const bx=[...go.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],hi=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg"}],wx=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:hi[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:hi[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:hi[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:hi[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:hi[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:hi[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:hi[6],link:""}],Sx=[...go.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],Cx={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array",ref:{columnsOrder:"settings.properties.columnsOrder",columnsCount:"settings.properties.columns"}},items:{type:"object",properties:{...cx(),image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:wx},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b"]},columns:{type:"number",scope:"layout",title:"Columns",display:{type:"count-number"},min:1,max:5},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},textPaddingLR:{type:"number",scope:"layout",title:"Text Padding LR",min:0,max:9999,display:{type:"range-control"}},entriesCount:{type:"number",scope:"layout",title:"Amount",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},cellMinHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},imageOnHover:{type:"boolean",scope:"common",title:"Image On Hover",display:{type:"toggle-cycle",enum:["on","off"]}},imagePosition:{type:"string",scope:"layout",title:"Image Position",display:{type:"toggle-cycle",enum:["left","center","right","cursor"]}},imageInterpolation:{type:"boolean",scope:"common",title:"Interpolation",display:{type:"toggle-cycle",enum:["on","off"]}},imageSize:{type:"object",scope:"layout",title:"Image size",display:{type:"min-max-input"},min:1,max:1440,properties:{min:{type:"number"},max:{type:"number"}}},dividerWidth:{type:"number",scope:"layout",title:"Divider width",display:{type:"numeric-input"},min:0,max:9999},showVisibility:{type:"array",scope:"common",title:"Show",display:{type:"double-toggle",enum:["top","bottom"]},items:{type:"boolean"},default:[!0,!1]},cut:{type:"number",scope:"layout",title:"Display",display:{type:"toggle-numeric-input",enum:["off","on"]},min:1},entryHoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["none","default","blinds","reveal"]}},entryHoverShowOption:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","link only"]}},cutCellMinHeight:{type:"number",scope:"layout",title:"Cell min height",display:{type:"numeric-input"},min:0,max:9999},cutLabel:{type:"string",scope:"common",title:"Cut Label",display:{type:"label-input"}},showCut:{type:"number",scope:"layout",title:"Show",display:{type:"toggle-numeric-input",enum:["all","custom"]},min:1},rowPaddingTop:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},rowPaddingBottom:{type:"number",scope:"layout",title:"Row Padding Bottom",min:0,max:100,display:{type:"range-control"}},rowPaddingTopB:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},...dx(),columnsOrder:{type:"array",scope:"layout",title:"Columns Order",display:{type:"reorder-input"},items:{type:"string"}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},textHoverColor:{type:"string",scope:"common",title:"Text Hover",display:{type:"palette-color-picker"}},...px,backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},backgroundHoverColor:{type:"string",scope:"common",title:"BG Hover",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}}},defaults:{imageOnHover:"on",imagePosition:"cursor",imageInterpolation:"on",entryHoverEffect:"default",entryHoverShowOption:"always",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#000000",textHoverColor:"#FFFFFF",...fx,...kr({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:Zl({columns:3,type:"b",textPaddingLR:.0373,entriesCount:0,cellMinHeight:.02,imageSize:{min:80,max:320},dividerWidth:.004,cut:0,showCut:0,cutCellMinHeight:.02,rowPaddingTop:.01,rowPaddingBottom:.01,typeBDefaults:{rowPaddingTopB:.0461,AColumnPaddingBottom:.041,BColumnPaddingBottom:.041,CColumnPaddingBottom:.0615,DColumnPaddingBottom:0,EColumnPaddingBottom:0},textStroke:.003,textCorners:.192,textPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},...kr({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:Zl({columns:4,type:"a",textPaddingLR:.01,entriesCount:0,cellMinHeight:.0555,imageSize:{min:200,max:200},dividerWidth:.002083,cut:0,showCut:0,cutCellMinHeight:.0555,rowPaddingTop:0,rowPaddingBottom:0,rowPaddingTopB:.01,textStroke:.001,textCorners:.05,textPadding:{top:.01,right:.01,bottom:.01,left:.01},...kr({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...xx(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...bx.map(e=>({if:{name:"type",value:"b"},then:{name:`properties.${e}.display.visible`,value:!1}})),{if:{name:"type",value:"a"},then:{name:"properties.rowPaddingTopB.display.visible",value:!1}},...go.map(e=>({if:{name:"type",value:"a"},then:{name:`properties.${e}ColumnPaddingBottom.display.visible`,value:!1}})),{if:{name:"imagePosition",value:"cursor",isNotEqual:!0},then:{name:"properties.imageInterpolation.display.enabled",value:!1}}],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imagePosition","imageInterpolation","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","entryHoverShowOption","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...Sx]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"row",title:"",items:["columns","wrapperWidth"]},{type:"row",title:"Entries",items:["entriesCount","cellMinHeight"]},{type:"row",title:"",items:["imageOnHover","imageSize"]},{type:"row",title:"",items:["imagePosition","imageInterpolation"]},{type:"row",title:"Entry Hover",items:["entryHoverEffect","entryHoverShowOption"]},{type:"row",title:"Divider Settings",items:["dividerWidth","showVisibility"]}]},{id:"columnsOrder",icon:"layers",title:"Columns Order",tooltip:"Columns order",layout:["__componentName__","columnsOrder"]},{id:"cutSettings",icon:"cut",title:"Cut settings",tooltip:"Cut settings",layout:["__componentName__",{type:"row",title:"",items:["cut"]},{type:"row",title:"Cut Settings",items:["cutLabel","cutCellMinHeight"]},{type:"row",title:"",items:["showCut"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",yx]}],paletteBookmark:{items:[...vx],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},$x={element:ax,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>ex(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme-list-default.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...Do.map(e=>({path:`${Pt(e,"textFontFamily")}`}))]},fontRelations:{...Do.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Pt(t,"textFontFamily")}`}),{})},schema:Cx,sourceCode:sx},Ql=300,Vn=.004,Tx={questionColor:"question-color",answerColor:"answer-color",dividerColor:"divider-color",iconColor:"icon-color",questionHoverColor:"question-hover-color",iconHoverColor:"icon-hover-color",iconActiveColor:"icon-active-color",dividerHoverColor:"divider-hover-color"},Ix=["hover","focus","filled","success","error"];function Rx(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function ec(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function tc(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:D.scalingValue((o-t)/2,i)}}function Lx(e){return`
13316
+ `,go=["A","B","C","D","E"],Kl=[...ls,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],gi={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"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function cx(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function hr(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function dx(){return Object.fromEntries(go.map((e,t)=>{const n=ri[t],i=`${e} column`;return[n,cx(i)]}))}function ux(){const e={};for(const t of go)e[`${t}ColumnWidth`]=hr(`${t} column width`),e[`${t}ColumnPaddingLeft`]=hr(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=hr(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=hr(`${t} column padding bottom`);return e}function Zl(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...ri]};for(const r of go)i[`${r}ColumnWidth`]=r==="A"?.0798:.32,i[`${r}ColumnPaddingLeft`]=0,i[`${r}ColumnPaddingRight`]=0,i[`${r}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function px(e){const t={};if(e===Hn)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...ls]},enum:[...ls]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Kl],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Kl]}}return t[Pt(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Pt(e,"textFontSettings")]={...gi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Pt(e,"textFontSize")]={...gi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Pt(e,"textLineHeight")]={...gi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Pt(e,"textLetterSpacing")]={...gi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Pt(e,"textWordSpacing")]={...gi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Pt(e,"textTextAlign")]={...gi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Pt(e,"textTextAppearance")]={...gi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const mx=Do.reduce((e,t)=>({...e,...px(t)}),{});function gx(e){return{verticalAlign:e===Hn?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===Hn?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function hx(e,t={}){var n;return{...gx(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Jl=new Set(["textFontFamily","textFontSettings"]);function fx(e,t,n){const i=r=>n===void 0?!0:n==="common"?Jl.has(r):!Jl.has(r),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=Zs(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Pt(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Pt(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Pt(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Pt(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Pt(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Pt(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Pt(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Pt(e,"textTextAppearance")]=t.textTextAppearance),o}function kr(e={},t){return Do.reduce((n,i)=>({...n,...fx(i,hx(i,e),t)}),{})}const yx=kr(),xx=Vy();function Yd(e){return[Pt(e,"textFontFamily"),Pt(e,"textFontSettings"),Pt(e,"textFontSize"),Pt(e,"textLineHeight"),Pt(e,"textLetterSpacing"),Pt(e,"textWordSpacing"),Pt(e,"textTextAlign"),Pt(e,"textTextAppearance"),`${e}VerticalAlign`]}function vx(){const e=[];return Ks.forEach((t,n)=>{const i=ri[n],o=Yd(t);for(let r=1;r<ri.length;r+=1){const l=[{name:"columns",value:r},...Array.from({length:r},(d,c)=>({name:`columnsOrder.${c}`,value:i,isNotEqual:!0}))];o.forEach(d=>{e.push({if:l,then:{name:`properties.${d}.display.visible`,value:!1}})})}}),e}const bx=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Yd(Hn);const wx=[...go.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],hi=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg"}],Sx=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:hi[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:hi[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:hi[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:hi[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:hi[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:hi[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:hi[6],link:""}],Cx=[...go.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],$x={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array",ref:{columnsOrder:"settings.properties.columnsOrder",columnsCount:"settings.properties.columns"}},items:{type:"object",properties:{...dx(),image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:Sx},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b"]},columns:{type:"number",scope:"layout",title:"Columns",display:{type:"count-number"},min:1,max:5},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},textPaddingLR:{type:"number",scope:"layout",title:"Text Padding LR",min:0,max:9999,display:{type:"range-control"}},entriesCount:{type:"number",scope:"layout",title:"Amount",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},cellMinHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},imageOnHover:{type:"boolean",scope:"common",title:"Image On Hover",display:{type:"toggle-cycle",enum:["on","off"]}},imagePosition:{type:"string",scope:"layout",title:"Image Position",display:{type:"toggle-cycle",enum:["left","center","right","cursor"]}},imageInterpolation:{type:"boolean",scope:"common",title:"Interpolation",display:{type:"toggle-cycle",enum:["on","off"]}},imageSize:{type:"object",scope:"layout",title:"Image size",display:{type:"min-max-input"},min:1,max:1440,properties:{min:{type:"number"},max:{type:"number"}}},dividerWidth:{type:"number",scope:"layout",title:"Divider width",display:{type:"numeric-input"},min:0,max:9999},showVisibility:{type:"array",scope:"common",title:"Show",display:{type:"double-toggle",enum:["top","bottom"]},items:{type:"boolean"},default:[!0,!1]},cut:{type:"number",scope:"layout",title:"Display",display:{type:"toggle-numeric-input",enum:["off","on"]},min:1},entryHoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["none","default","blinds","reveal"]}},entryHoverShowOption:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","link only"]}},cutCellMinHeight:{type:"number",scope:"layout",title:"Cell min height",display:{type:"numeric-input"},min:0,max:9999},cutLabel:{type:"string",scope:"common",title:"Cut Label",display:{type:"label-input"}},showCut:{type:"number",scope:"layout",title:"Show",display:{type:"toggle-numeric-input",enum:["all","custom"]},min:1},rowPaddingTop:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},rowPaddingBottom:{type:"number",scope:"layout",title:"Row Padding Bottom",min:0,max:100,display:{type:"range-control"}},rowPaddingTopB:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},...ux(),columnsOrder:{type:"array",scope:"layout",title:"Columns Order",display:{type:"reorder-input"},items:{type:"string"}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},textHoverColor:{type:"string",scope:"common",title:"Text Hover",display:{type:"palette-color-picker"}},...mx,backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},backgroundHoverColor:{type:"string",scope:"common",title:"BG Hover",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}}},defaults:{imageOnHover:"on",imagePosition:"cursor",imageInterpolation:"on",entryHoverEffect:"default",entryHoverShowOption:"always",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#000000",textHoverColor:"#FFFFFF",...yx,...kr({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:Zl({columns:3,type:"b",textPaddingLR:.0373,entriesCount:0,cellMinHeight:.02,imageSize:{min:80,max:320},dividerWidth:.004,cut:0,showCut:0,cutCellMinHeight:.02,rowPaddingTop:.01,rowPaddingBottom:.01,typeBDefaults:{rowPaddingTopB:.0461,AColumnPaddingBottom:.041,BColumnPaddingBottom:.041,CColumnPaddingBottom:.0615,DColumnPaddingBottom:0,EColumnPaddingBottom:0},textStroke:.003,textCorners:.192,textPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},...kr({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:Zl({columns:4,type:"a",textPaddingLR:.01,entriesCount:0,cellMinHeight:.0555,imageSize:{min:200,max:200},dividerWidth:.002083,cut:0,showCut:0,cutCellMinHeight:.0555,rowPaddingTop:0,rowPaddingBottom:0,rowPaddingTopB:.01,textStroke:.001,textCorners:.05,textPadding:{top:.01,right:.01,bottom:.01,left:.01},...kr({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...vx(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...wx.map(e=>({if:{name:"type",value:"b"},then:{name:`properties.${e}.display.visible`,value:!1}})),{if:{name:"type",value:"a"},then:{name:"properties.rowPaddingTopB.display.visible",value:!1}},...go.map(e=>({if:{name:"type",value:"a"},then:{name:`properties.${e}ColumnPaddingBottom.display.visible`,value:!1}})),{if:{name:"imagePosition",value:"cursor",isNotEqual:!0},then:{name:"properties.imageInterpolation.display.enabled",value:!1}}],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imagePosition","imageInterpolation","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","entryHoverShowOption","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...Cx]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"row",title:"",items:["columns","wrapperWidth"]},{type:"row",title:"Entries",items:["entriesCount","cellMinHeight"]},{type:"row",title:"",items:["imageOnHover","imageSize"]},{type:"row",title:"",items:["imagePosition","imageInterpolation"]},{type:"row",title:"Entry Hover",items:["entryHoverEffect","entryHoverShowOption"]},{type:"row",title:"Divider Settings",items:["dividerWidth","showVisibility"]}]},{id:"columnsOrder",icon:"layers",title:"Columns Order",tooltip:"Columns order",layout:["__componentName__","columnsOrder"]},{id:"cutSettings",icon:"cut",title:"Cut settings",tooltip:"Cut settings",layout:["__componentName__",{type:"row",title:"",items:["cut"]},{type:"row",title:"Cut Settings",items:["cutLabel","cutCellMinHeight"]},{type:"row",title:"",items:["showCut"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",xx]}],paletteBookmark:{items:[...bx],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Tx={element:sx,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>tx(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme-list-default.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...Do.map(e=>({path:`${Pt(e,"textFontFamily")}`}))]},fontRelations:{...Do.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Pt(t,"textFontFamily")}`}),{})},schema:$x,sourceCode:lx},Ql=300,Vn=.004,Ix={questionColor:"question-color",answerColor:"answer-color",dividerColor:"divider-color",iconColor:"icon-color",questionHoverColor:"question-hover-color",iconHoverColor:"icon-hover-color",iconActiveColor:"icon-active-color",dividerHoverColor:"divider-hover-color"},Rx=["hover","focus","filled","success","error"];function Lx(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function ec(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function tc(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:D.scalingValue((o-t)/2,i)}}function Px(e){return`
13317
13317
  .${e}-wrapper {
13318
13318
  box-sizing: border-box;
13319
13319
  display: flex;
@@ -13375,7 +13375,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
13375
13375
  display: flex;
13376
13376
  align-items: center;
13377
13377
  justify-content: space-between;
13378
- gap: ${Rx(20)};
13378
+ gap: ${Lx(20)};
13379
13379
  width: 100%;
13380
13380
  min-width: 0;
13381
13381
  min-height: var(--${e}-question-min-height, unset);
@@ -13478,7 +13478,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
13478
13478
  pointer-events: none;
13479
13479
  z-index: 2;
13480
13480
  }
13481
- `}function nc(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 Px({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r}){const{prefix:l}=D.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:x="solid",entryHoverEffect:w="default",autoclose:m="off",icon:h,iconMaxWidth:f=.00833,iconPaddingRight:v=0,iconAnimation:C="rotate 45",questionColor:y="#000000",answerColor:S="#000000",dividerColor:V="#0000001F",iconColor:N="#000000",questionHoverColor:q="#666666",iconHoverColor:W="#666666",iconActiveColor:I="#000000",dividerHoverColor:B="#000000",questionFontFamily:$,questionFontSettings:T,questionFontSize:k,questionLineHeight:F,questionLetterSpacing:g,questionWordSpacing:O,questionTextAppearance:P,answerFontFamily:X,answerFontSettings:te,answerFontSize:L,answerLineHeight:H,answerLetterSpacing:U,answerWordSpacing:de,answerTextAppearance:ae,questionPaddingLeft:A=0,questionPaddingTop:ce=0,questionPaddingBottom:z=0,answerPaddingLeft:re=0,answerPaddingRight:ee=0,answerPaddingTop:xe=0,answerPaddingBottom:Fe=0}=e,ye=t??[],[b,M]=s.useState(()=>new Set),E=!n||i;s.useEffect(()=>{M(new Set)},[m]),s.useEffect(()=>{n&&!o&&!i&&M(new Set)},[n,o,i]);const j=Ze=>D.scalingValue(Ze,n??!1),Ce=Math.max(A,Vn),Q=Math.max(ce,Vn),Te=Math.max(z,Vn),ie=Math.max(re,Vn),ue=Math.max(ee,Vn),fe=Math.max(xe,Vn),K=Math.max(Fe,Vn),Z=Math.max(0,(c??1)-v-f),se=Math.max(0,(c??1)-ee),Se=Math.max(0,(c??1)-re),Me=Math.max(v,Vn),$e=Math.max(0,(c??1)-A-f),G=s.useMemo(()=>b.size===0?0:Math.min(...b),[b]),pe=s.useCallback(Ze=>b.has(Ze),[b]),oe=E&&w==="default"?`${l}-entry-hover-default`:"",Y=h??"",le=Y!=="",_e=C.replace(/^rotate /,""),me=`${l}-icon-anim-${_e}`,J=an(Ut(nc($,T,k,F,g,O,P,y),n)),Ke=an(Ut(nc(X,te,L,H,U,de,ae,S),n)),ke=ec(k,F,`${l}-question`,`${l}-text-tight-leading`),tt=ec(L,H,`${l}-answer-text`,`${l}-text-tight-leading`),Ye=tc(k,F,l,n),dt=tc(L,H,l,n),ot=D.buildColorVars(l,{questionColor:y,answerColor:S,dividerColor:V,iconColor:N,questionHoverColor:q,iconHoverColor:W,iconActiveColor:I,dividerHoverColor:B},Tx,Ix),Ve=r&&r!=="default"?`${l}-state-${r}`:"",Re=s.useCallback(Ze=>{E&&M(he=>{if(he.has(Ze)){const We=new Set(he);return We.delete(Ze),We}if(m==="on")return new Set([Ze]);const ve=new Set(he);return ve.add(Ze),ve})},[E,m]),He=s.useMemo(()=>Lx(l),[l]),Be={[`--${l}-divider-width`]:D.scalingValue(p,n??!1),[`--${l}-divider-style`]:x,[`--${l}-icon-max-width`]:D.scalingValue(f,n??!1),...u>0?{[`--${l}-question-min-height`]:D.scalingValue(u,n??!1)}:{}};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:He}}),a.jsx("div",{style:ot,children:a.jsx("div",{className:pt(`${l}-wrapper`,n&&!i&&`${l}-editor`,oe,Ve),style:{width:D.scalingValue(c,n??!1),maxWidth:"100%",...Be},children:ye.map((Ze,he)=>{var qe;const ve=pe(he),We=((qe=Ze.question)==null?void 0:qe.trim())??"",Je=Ze.answer,be=((Je==null?void 0:Je.length)??0)>0,Ie=d&&he===G;return a.jsxs("div",{className:pt(`${l}-item`,ve&&`${l}-item-open`),"data-faq-item":"",children:[a.jsxs("div",{className:`${l}-question-controls`,children:[Ie&&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:j(Q)}}),a.jsx("div",{"data-controls":"questionPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Z),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:j(Ce),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($e),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:j(Me),height:"100%"}})]}),a.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":ve,style:{...J,...Ye,paddingLeft:j(A),paddingRight:j(v)},onClick:()=>Re(he),children:[ce>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:j(ce)},"aria-hidden":"true"}),a.jsxs("span",{className:`${l}-question-row`,children:[a.jsx("span",{className:ke,children:We}),be&&(le?a.jsx("span",{className:`${l}-icon ${l}-icon-custom ${me}`,"aria-hidden":"true",children:a.jsx(sn,{url:Y,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 ${me}`,"aria-hidden":"true"}))]}),z>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:j(z)},"aria-hidden":"true"})]}),Ie&&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:j(Te)}})]}),be&&Je&&a.jsx("div",{className:`${l}-panel`,"aria-hidden":!ve,children:a.jsx("div",{className:`${l}-panel-inner`,children:a.jsxs("div",{className:`${l}-answer-controls`,children:[Ie&&ve&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"answerPaddingTop","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{top:0,left:0,width:"100%",height:j(fe)}}),a.jsx("div",{"data-controls":"answerPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","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,left:0,width:j(ie),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:j(ue),height:"100%"}})]}),xe>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:j(xe)}}),a.jsx("div",{className:`${l}-answer`,style:{...Ke,...dt,paddingLeft:j(re),paddingRight:j(ee)},children:a.jsx("div",{className:tt,children:a.jsx(Ri,{content:Je})})}),Fe>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:j(Fe)}}),Ie&&ve&&a.jsx("div",{"data-controls":"answerPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:j(K)}})]})})})]},he)})})})]})}const Ex=`import { useCallback, useEffect, useMemo, useState } from 'react';
13481
+ `}function nc(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 Ex({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r}){const{prefix:l}=D.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:x="solid",entryHoverEffect:w="default",autoclose:m="off",icon:h,iconMaxWidth:f=.00833,iconPaddingRight:v=0,iconAnimation:C="rotate 45",questionColor:y="#000000",answerColor:S="#000000",dividerColor:G="#0000001F",iconColor:W="#000000",questionHoverColor:U="#666666",iconHoverColor:H="#666666",iconActiveColor:I="#000000",dividerHoverColor:z="#000000",questionFontFamily:$,questionFontSettings:T,questionFontSize:A,questionLineHeight:_,questionLetterSpacing:g,questionWordSpacing:B,questionTextAppearance:P,answerFontFamily:Y,answerFontSettings:ie,answerFontSize:L,answerLineHeight:O,answerLetterSpacing:K,answerWordSpacing:ue,answerTextAppearance:le,questionPaddingLeft:F=0,questionPaddingTop:pe=0,questionPaddingBottom:j=0,answerPaddingLeft:se=0,answerPaddingRight:ne=0,answerPaddingTop:ve=0,answerPaddingBottom:Me=0}=e,xe=t??[],[b,M]=s.useState(()=>new Set),E=!n||i;s.useEffect(()=>{M(new Set)},[m]),s.useEffect(()=>{n&&!o&&!i&&M(new Set)},[n,o,i]);const V=Ue=>D.scalingValue(Ue,n??!1),Se=Math.max(F,Vn),te=Math.max(pe,Vn),$e=Math.max(j,Vn),re=Math.max(se,Vn),ge=Math.max(ne,Vn),ye=Math.max(ve,Vn),Z=Math.max(Me,Vn),Q=Math.max(0,(c??1)-v-f),ce=Math.max(0,(c??1)-ne),we=Math.max(0,(c??1)-se),Pe=Math.max(v,Vn),Ce=Math.max(0,(c??1)-F-f),X=s.useMemo(()=>b.size===0?0:Math.min(...b),[b]),me=s.useCallback(Ue=>b.has(Ue),[b]),ae=E&&w==="default"?`${l}-entry-hover-default`:"",q=h??"",de=q!=="",ke=C.replace(/^rotate /,""),he=`${l}-icon-anim-${ke}`,J=an(qt(nc($,T,A,_,g,B,P,y),n)),Ne=an(qt(nc(Y,ie,L,O,K,ue,le,S),n)),Fe=ec(A,_,`${l}-question`,`${l}-text-tight-leading`),et=ec(L,O,`${l}-answer-text`,`${l}-text-tight-leading`),Je=tc(A,_,l,n),dt=tc(L,O,l,n),tt=D.buildColorVars(l,{questionColor:y,answerColor:S,dividerColor:G,iconColor:W,questionHoverColor:U,iconHoverColor:H,iconActiveColor:I,dividerHoverColor:z},Ix,Rx),De=r&&r!=="default"?`${l}-state-${r}`:"",Ie=s.useCallback(Ue=>{E&&M(k=>{if(k.has(Ue)){const Te=new Set(k);return Te.delete(Ue),Te}if(m==="on")return new Set([Ue]);const ee=new Set(k);return ee.add(Ue),ee})},[E,m]),We=s.useMemo(()=>Px(l),[l]),je={[`--${l}-divider-width`]:D.scalingValue(p,n??!1),[`--${l}-divider-style`]:x,[`--${l}-icon-max-width`]:D.scalingValue(f,n??!1),...u>0?{[`--${l}-question-min-height`]:D.scalingValue(u,n??!1)}:{}};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:We}}),a.jsx("div",{style:tt,children:a.jsx("div",{className:pt(`${l}-wrapper`,n&&!i&&`${l}-editor`,ae,De),style:{width:D.scalingValue(c,n??!1),maxWidth:"100%",...je},children:xe.map((Ue,k)=>{var rt;const ee=me(k),Te=((rt=Ue.question)==null?void 0:rt.trim())??"",He=Ue.answer,Be=((He==null?void 0:He.length)??0)>0,Ve=d&&k===X;return a.jsxs("div",{className:pt(`${l}-item`,ee&&`${l}-item-open`),"data-faq-item":"",children:[a.jsxs("div",{className:`${l}-question-controls`,children:[Ve&&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:V(te)}}),a.jsx("div",{"data-controls":"questionPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Q),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:V(Se),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(Ce),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:V(Pe),height:"100%"}})]}),a.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":ee,style:{...J,...Je,paddingLeft:V(F),paddingRight:V(v)},onClick:()=>Ie(k),children:[pe>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:V(pe)},"aria-hidden":"true"}),a.jsxs("span",{className:`${l}-question-row`,children:[a.jsx("span",{className:Fe,children:Te}),Be&&(de?a.jsx("span",{className:`${l}-icon ${l}-icon-custom ${he}`,"aria-hidden":"true",children:a.jsx(sn,{url:q,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 ${he}`,"aria-hidden":"true"}))]}),j>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:V(j)},"aria-hidden":"true"})]}),Ve&&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:V($e)}})]}),Be&&He&&a.jsx("div",{className:`${l}-panel`,"aria-hidden":!ee,children:a.jsx("div",{className:`${l}-panel-inner`,children:a.jsxs("div",{className:`${l}-answer-controls`,children:[Ve&&ee&&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:V(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(ce),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:V(re),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:V(ge),height:"100%"}})]}),ve>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:V(ve)}}),a.jsx("div",{className:`${l}-answer`,style:{...Ne,...dt,paddingLeft:V(se),paddingRight:V(ne)},children:a.jsx("div",{className:et,children:a.jsx(Ri,{content:He})})}),Me>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:V(Me)}}),Ve&&ee&&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:V(Z)}})]})})})]},k)})})})]})}const Mx=`import { useCallback, useEffect, useMemo, useState } from 'react';
13482
13482
  import cn from 'classnames';
13483
13483
  import { CommonComponentProps } from '../props';
13484
13484
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
@@ -14226,7 +14226,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
14226
14226
  </>
14227
14227
  );
14228
14228
  }
14229
- `;function Gn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const ic={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Mx=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],kx={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:Gn("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:{...ic.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:{...ic.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:Gn("Question Padding Left"),questionPaddingTop:Gn("Question Padding Top"),questionPaddingBottom:Gn("Question Padding Bottom"),answerPaddingLeft:Gn("Answer Padding Left"),answerPaddingRight:Gn("Answer Padding Right"),answerPaddingTop:Gn("Answer Padding Top"),answerPaddingBottom:Gn("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:[...Mx],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Ax={element:Px,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:kx,sourceCode:Ex},Dn=e=>e.display==="cover",da=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},oc=100,Fx=.2,rc=8,Yd=({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"?oc:Math.max(oc,window.innerHeight*Fx),[]),x=s.useCallback($=>Math.max(0,1-$/(p*1.5)),[p]),w=s.useCallback($=>Math.max(0,1-$/(p*.45)),[p]),m=s.useCallback($=>{const T=typeof window<"u"?window.innerHeight:800,k=Math.max(.88,1-$/T*.12);return`translateY(${$}px) scale(${k})`},[]),h=s.useCallback(()=>{c.current=null},[]),f=s.useCallback(()=>{d(!0),r(0),window.setTimeout(()=>d(!1),n),h()},[n,h]),v=s.useCallback(()=>{const $=typeof window<"u"?window.innerHeight:800;d(!0),r($),window.setTimeout(()=>{t(),h(),d(!1)},Math.min(n,200))},[n,t,h]),C=s.useCallback($=>{!e||l||$.pointerType==="touch"&&(i!=null&&i($.target)||(c.current={startX:$.clientX,startY:$.clientY,isLocked:null,pointerId:$.pointerId}))},[e,l,i]),y=s.useCallback($=>{const T=c.current;if(!e||!T||$.pointerType!=="touch"||T.pointerId!==$.pointerId)return;const k=$.clientX-T.startX,F=$.clientY-T.startY;if(T.isLocked===null){if(Math.abs(k)<rc&&Math.abs(F)<rc)return;if(F>0&&F>Math.abs(k))T.isLocked=!0,$.currentTarget.setPointerCapture($.pointerId);else{T.isLocked=!1,h();return}}if(!T.isLocked)return;$.preventDefault();const g=Math.max(0,F);u.current=g,r(g)},[e,h]),S=s.useCallback($=>{const T=c.current;if(!e||!T||$.pointerType!=="touch"||T.pointerId!==$.pointerId)return;const k=T.isLocked===!0;if($.currentTarget.hasPointerCapture($.pointerId)&&$.currentTarget.releasePointerCapture($.pointerId),!k){h();return}$.clientY-T.startY>=p?v():f()},[p,v,e,h,f]),V=s.useCallback($=>{S($)},[S]),N=s.useCallback($=>{S($)},[S]),q=o>0,W=l?`transform ${n}ms ease`:"none",I=l?`opacity ${n}ms ease`:"none",B=o>0||l;return{isSwipeDragging:q,backdropStyle:{opacity:x(o),transition:I},mediaAreaStyle:{transform:m(o),transition:W,touchAction:q?"none":void 0,willChange:q?"transform":void 0},overlayContentStyle:B?{opacity:w(o),transition:I}:void 0,swipeHandlers:e?{onPointerDown:C,onPointerMove:y,onPointerUp:V,onPointerCancel:N}:{},dismissAreaStyle:e?{touchAction:q?"none":"pan-x"}:void 0}},_x="[data-lightbox-scrollable]",qd=()=>{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(_x)||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"})}},[])},Nx=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Wx=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Hx=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Dx=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(h,f)=>{Wx(t),e.scrollLeft=h,f&&(r==null||r())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,x=0;const w=()=>{t.removeEventListener("transitionend",m),clearTimeout(x)},m=h=>{h.target!==t||h.propertyName!=="transform"||p||(p=!0,w(),u(n,!0))};return t.addEventListener("transitionend",m),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)`,x=window.setTimeout(()=>{p||(p=!0,w(),u(n,!0))},i+64),()=>{p||(p=!0,w(),u(l-Hx(t),!1))}},Eo=300,Ox=900,Bx=1500,zx="cubic-bezier(0.16, 1, 0.3, 1)",jx=3e3,Vx=2,Gx=16,Xx=.05,Yx=1,fr=.3,qx=50,Ux=20,Ai=.004,ro=["title1","title2","title3"],Kx={title1:"1",title2:"2",title3:"3"},Zx={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Jx={title1:.02,title2:.02,title3:.02},yr=e=>`max(${e}, ${Ux}px)`,Qx=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]}},ev=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=Qx(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Gt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,tv=e=>[Gt(e,"fontFamily"),Gt(e,"fontSettings"),{type:"row",items:[Gt(e,"fontSize"),Gt(e,"lineHeight"),Gt(e,"letterSpacing"),Gt(e,"wordSpacing")]},Gt(e,"textAlign"),Gt(e,"textAppearance")],nv=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(ro.map(e=>[Kx[e],tv(e)]))}),el=(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},Ud=(e,t)=>el(e,t),xr=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},ac=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:el(e.length,n),effective:Ud(e.length,n)}},iv=(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},_a=(e,t)=>{const n=i=>{const o=Gt(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[Zx[t]]}},ov=(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),Na=(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??Jx[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Ut(i,n)},rv=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:x,closeIcon:w,closeIconMaxWidth:m,closeIconColor:h,closeIconHoverColor:f,thumbnailTrigger:v,thumbnailVisibility:C,thumbnailObjectFit:y,thumbnailActive:S,thumbnailActiveColor:V,title1Width:N,title2Width:q,title3Width:W,title1MarginLeft:I=0,title2MarginLeft:B=0,title3MarginLeft:$=0,titleRowMarginBottom:T=0,titleHeaderLayout:k="desktop",contentMarginTop:F,iconMarginLeft:g}=n,O=R=>D.scalingValue(R,i??!1),P=c??n.thumnailSize??.03,X=O(P),te=O(u),L=O(p??.02),H=O(x??0),U=O(F??0),de=yr(U),ae=O(g??0),[A,ce]=s.useState(0),z=s.useRef(A);z.current=A;const re=t[A],{title1:ee,title2:xe,title3:Fe}=ev(re),ye=Na("title1",_a(n,"title1"),i),b=Na("title2",_a(n,"title2"),i),M=Na("title3",_a(n,"title3"),i),E=k==="mobile",j=!o&&(!i||r),Ce=j,Q=j,Te=j,ie=Dn(y),ue=ie?{"--image-aspect-ratio":da(y)}:void 0,fe=!!(ee||xe||Fe),K=s.useMemo(()=>iv(e,ee,xe,Fe,ye,b,M),[e,A,ee,xe,Fe,ye,b,M]),Z=s.useMemo(()=>({title1Width:N,title2Width:q,title3Width:W}),[N,q,W]),se=s.useMemo(()=>K.map(R=>Z[R.widthKey]),[K,Z]),Se=s.useMemo(()=>el(K.length,se),[K.length,se]),Me=s.useMemo(()=>Ud(K.length,se),[K.length,se]),$e=s.useMemo(()=>K.filter(R=>R.prefix==="title1"),[K]),G=s.useMemo(()=>K.filter(R=>R.prefix==="title2"||R.prefix==="title3"),[K]),pe=s.useMemo(()=>ac($e,Z),[$e,Z]),oe=s.useMemo(()=>ac(G,Z),[G,Z]),Y=s.useCallback((R,ne)=>{const ge=K.indexOf(R);if(!E||ne==="single-row")return{effectiveWidth:Me[ge]??0,resolvedWidth:Se[ge]??0,maxWidth:xr(ge,Se)};if(ne==="two-row-top"){const je=$e.indexOf(R);return{effectiveWidth:pe.effective[je]??0,resolvedWidth:pe.resolved[je]??0,maxWidth:xr(je,pe.resolved)}}const Ee=G.indexOf(R);return{effectiveWidth:oe.effective[Ee]??0,resolvedWidth:oe.resolved[Ee]??0,maxWidth:xr(Ee,oe.resolved)}},[G,oe,Me,Se,K,$e,pe,E]),le=s.useCallback(R=>D.scalingValue(R,i??!1),[i]),_e=le(T??0),me=s.useMemo(()=>({title1MarginLeft:I,title2MarginLeft:B,title3MarginLeft:$}),[I,B,$]),J=s.useCallback(R=>K.slice(0,R+1).reduce((ne,ge,Ee)=>ne+(ge!=null&&ge.marginLeftKey?me[ge.marginLeftKey]??0:0)+(Se[Ee]??0),0)+(E?0:I??0),[K,me,Se,E,I]),Ke=s.useCallback(()=>E?0:I??0,[E,I]),ke=s.useCallback(R=>G.slice(0,R).reduce((ne,ge,Ee)=>ne+(ge.marginLeftKey?me[ge.marginLeftKey]??0:0)+(oe.resolved[Ee]??0),0),[G,oe.resolved,me]),tt=s.useCallback(R=>{const ne=G[R];return ke(R)+(ne.marginLeftKey?me[ne.marginLeftKey]??0:0)+(oe.resolved[R]??0)},[G,oe.resolved,ke,me]),Ye=(R,ne)=>{const ge=R.marginLeftKey?me[R.marginLeftKey]??0:0,{effectiveWidth:Ee,resolvedWidth:je,maxWidth:et}=Y(R,ne),bt=o&&ne==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":R.prefix,style:{...ne==="single-row"?{gridArea:R.prefix}:{},width:le(Ee),...ge>0?{marginLeft:le(ge)}:{}},children:[a.jsx("p",{className:R.className,style:R.style,children:R.text}),bt&&R.marginLeftKey&&a.jsx("div",{"data-controls":R.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:le(-ge),width:`max(${le(ge)}, 10px)`,height:"100%",pointerEvents:"auto"}}),bt&&a.jsx("div",{"data-controls":R.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(et),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:le(-Ai/2),width:le(Ai),height:"100%",pointerEvents:"auto"}})]},R.className)},dt=()=>{const R=E?-1:K.findIndex(Ee=>Ee.prefix==="title1"),ne=!E&&(o||(I??0)>0)?(()=>{const Ee=I??0,je=R>=0?Se[R]:N??0;return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:0,width:`max(${le(Ee)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,ge=K.flatMap((Ee,je)=>{if(!Ee.marginLeftKey)return[];const et=me[Ee.marginLeftKey]??0,bt=ov(K,Se,me,je)+Ke();return a.jsx("div",{"data-controls":Ee.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Se[je]),style:{position:"absolute",top:0,left:le(bt),width:`max(${le(et)}, 10px)`,height:"100%",pointerEvents:"auto"}},Ee.marginLeftKey)});return ne?[ne,...ge]:ge},ot=()=>K.map((R,ne)=>{const ge=xr(ne,Se),je=J(ne)-Ai/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":R.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ge),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:le(je),width:le(Ai),height:"100%",pointerEvents:"auto"}})},`${R.widthKey}-junction`)}),Ve=()=>G.flatMap((R,ne)=>{if(!R.marginLeftKey)return[];const ge=me[R.marginLeftKey]??0,Ee=ke(ne),{resolvedWidth:je}=Y(R,"two-row-bottom");return a.jsx("div",{"data-controls":R.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:le(Ee),width:`max(${le(ge)}, 10px)`,height:"100%",pointerEvents:"auto"}},R.marginLeftKey)}),Re=()=>G.map((R,ne)=>{const{maxWidth:ge}=Y(R,"two-row-bottom"),je=tt(ne)-Ai/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":R.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ge),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:le(je),width:le(Ai),height:"100%",pointerEvents:"auto"}})},`${R.widthKey}-junction`)}),He=s.useRef(null),Be=s.useRef(null),Ze=s.useRef(null),he=s.useRef(null),ve=s.useRef([]),We=s.useRef([]),Je=s.useRef(0),be=s.useRef(null),Ie=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),qe=s.useRef(null),ze=s.useRef(null),Le=s.useRef(0),Ge=s.useRef("forward"),De=s.useRef(0),nt=s.useRef(null),it=s.useRef(!1),ct=t.length>1&&(!o||!!r),St=ct?3:1,Bt=s.useMemo(()=>Array.from({length:St},()=>t).flat(),[t,St]),[zt,ft]=s.useState(!1),[wt,jt]=s.useState(!1),[At,vt]=s.useState(!0),Ft=s.useRef(null),Nt=s.useRef(null),Kt=s.useRef(!1),Jt=s.useRef(!1),Tt=s.useRef(null),Wt=s.useRef(null),rn=Ce&&!At,gt=s.useCallback(()=>{Ce&&(vt(!0),Wt.current&&clearTimeout(Wt.current),Wt.current=setTimeout(()=>{Ie.current.isActive||vt(!1)},jx))},[Ce]),Ae=s.useCallback(()=>{o||Jt.current||(Jt.current=!0,jt(!1),Tt.current=setTimeout(()=>{l()},Eo))},[o,l]),Xe=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":rn?"true":"false",style:{width:D.scalingValue(m??0,i),height:D.scalingValue(m??0,i),marginRight:ae,"--close-icon-hover-color":f},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Ae,"aria-label":"Close",children:a.jsx(sn,{url:w,fill:h,hoverFill:i&&!r?h:f,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ae,height:"100%",pointerEvents:"auto"}})]}),st=(R="two-row")=>a.jsx("div",{...R==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:le(I??0),flexShrink:0,...R==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...R==="two-row"&&o?{pointerEvents:"auto"}:{}}}),ht=()=>{const R=K.find(Ee=>Ee.prefix==="title1"),ne=K.filter(Ee=>Ee.prefix==="title2"||Ee.prefix==="title3"),ge=ne.length>0||o||(T??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(I??0)>0||o?st():null,R&&Ye(R,"two-row-top"),w&&Xe()]}),ge?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[ne.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[ne.map(Ee=>Ye(Ee,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[Ve(),Re()]})]}):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:_e,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},yt=()=>a.jsxs(a.Fragment,{children:[(I??0)>0||o?st("single-row"):null,K.map(R=>Ye(R,"single-row")),o?a.jsxs(a.Fragment,{children:[dt(),ot()]}):null,w?Xe():null]}),Lt=s.useCallback(R=>!!(R.closest("[data-controls]")||R.closest(`.${e}-thumbnails`)||R.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:mt,backdropStyle:Vt,mediaAreaStyle:kt,overlayContentStyle:Mt,swipeHandlers:Xt,dismissAreaStyle:Yt}=Yd({enabled:j??!1,onClose:Ae,animMs:Eo,isBlockedTarget:Lt}),Ht=()=>{if(!ct||t.length===0)return Je.current=0,0;const R=We.current[0],ne=We.current[t.length];if(!R||!ne)return Je.current;const ge=ne.offsetLeft-R.offsetLeft;return ge>0&&(Je.current=ge),Je.current},Dt=(R=!1)=>{if(!ct)return;const ne=Be.current,ge=Ht();!ne||ge<=0||ge<ne.clientWidth*.25||(ne.scrollLeft<=0?(ne.scrollLeft+=ge,R&&(Ie.current.scrollLeft+=ge),it.current&&(De.current+=ge)):ne.scrollLeft>=ge*2&&(ne.scrollLeft-=ge,R&&(Ie.current.scrollLeft-=ge),it.current&&(De.current-=ge)))},_t=(R,ne=(ge=>(ge=Be.current)==null?void 0:ge.scrollLeft)()??0)=>{if(!ct)return R;let Ee=t.length+R,je=1/0;for(let et=0;et<St;et++){const bt=et*t.length+R,Rt=We.current[bt];if(!Rt)continue;const tn=Math.abs(Rt.offsetLeft-ne);tn<je&&(je=tn,Ee=bt)}return Ee},Ct=R=>{const ne=Be.current;return!R||!ne?!1:R.offsetWidth>ne.clientWidth+1},_=R=>{const ne=Be.current;if(!R||!ne||!Ct(R))return!1;const ge=R.offsetLeft,Ee=ge+R.offsetWidth;return ne.scrollLeft>=ge-1&&ne.scrollLeft+ne.clientWidth<=Ee+1},Pe=(R=(ne=>(ne=Be.current)==null?void 0:ne.scrollLeft)()??0)=>{for(let Ee=0;Ee<We.current.length;Ee+=1){const je=We.current[Ee];if(je&&_(je))return Ee}let ge={flatIndex:0,distance:1/0};return We.current.forEach((Ee,je)=>{if(!Ee)return;const et=Math.abs(Ee.offsetLeft-R);et<ge.distance&&(ge={flatIndex:je,distance:et})}),ge.flatIndex},Ne=R=>{Be.current&&We.current.forEach(ne=>{ne&&(ne.style.scrollSnapAlign=Ct(ne)&&R==="backward"?"end":"start")})},Oe=(R,ne,ge)=>{const Ee=R-ne,je=Pe(ne),et=We.current[je];if(_(et))return Pe(R)%t.length;const bt=We.current[je+1],Rt=et?bt?bt.offsetLeft-et.offsetLeft:et.offsetWidth:0,tn=Rt>0?Ee>Rt*fr?1:Ee<-Rt*fr?-1:0:0;return tn===0?ge:ct?(ge+tn+t.length)%t.length:Math.max(0,Math.min(t.length-1,ge+tn))},lt=s.useCallback((R=!1)=>{if(C!=="on"||o)return;const ne=he.current,ge=z.current,Ee=ve.current[ge];if(!ne||!Ee||ne.scrollWidth<=ne.clientWidth)return;const je=ne.scrollLeft,et=je+ne.clientWidth,bt=Ee.offsetLeft,Rt=bt+Ee.offsetWidth;if(bt>=je&&Rt<=et)return;const tn=ne.scrollWidth-ne.clientWidth;let Qt=je;if(!R&&Ft.current===null){const Ei=ve.current[ge-1],ho=ve.current[ge+1],ar=Ei?Ee.offsetLeft-Ei.offsetLeft:ho?ho.offsetLeft-Ee.offsetLeft:Ee.offsetWidth;Rt>et?Qt+=ar:bt<je&&(Qt-=ar)}else Rt>et?Qt=Rt-ne.clientWidth:Qt=bt;ne.scrollLeft=Math.max(0,Math.min(tn,Qt))},[o,C]),Et=s.useCallback((R=!1)=>{R&&(Kt.current=!0),Nt.current===null&&(Nt.current=requestAnimationFrame(()=>{Nt.current=null;const ne=Kt.current;Kt.current=!1,lt(ne)}))},[lt]),rt=s.useCallback(R=>{if(R===z.current)return;const ne=z.current;z.current=R;const ge=Math.abs(R-ne)>1,Ee=ct&&t.length>1&&(ne===t.length-1&&R===0||ne===0&&R===t.length-1);ce(R),Et(ge||Ee)},[t.length,ct,Et]),xt=()=>{if(!Be.current||t.length===0||Ft.current!==null||Ie.current.isActive&&Ie.current.hasMoved)return;const R=Be.current.scrollLeft,ne=Pe(R)%t.length;ne!==z.current&&rt(ne)},Ot=()=>{Ft.current=null},It=R=>{const ne=Be.current;ne&&(ne.style.scrollSnapType=R?"":"none")},nn=()=>{var R;(R=ze.current)==null||R.call(ze),ze.current=null},un=()=>{nt.current!==null&&(cancelAnimationFrame(nt.current),nt.current=null),it.current=!1},ci=()=>{const R=Be.current;if(!R){nt.current=null,it.current=!1;return}const ne=De.current-R.scrollLeft;if(Math.abs(ne)<.5){R.scrollLeft=De.current,Dt(),xt(),nt.current=null,it.current=!1;return}R.scrollLeft+=ne*Xx,Dt(),xt(),gt(),nt.current=requestAnimationFrame(ci)},di=()=>{const R=Ze.current;R&&(R.style.transition="",R.style.transform="",R.style.willChange="")},nr=(R,ne,ge,Ee)=>{di(),R.scrollLeft=ne,Le.current=R.scrollLeft,Dt(),ge!==void 0?(z.current=ge,ce(ge)):xt(),It(!0),Ee==null||Ee()},ir=(R,{behavior:ne="smooth",activeIndex:ge,onComplete:Ee}={})=>{const je=Be.current,et=Ze.current;if(!je||!et)return;if(un(),nn(),It(!1),ne==="auto"){nr(je,R,ge,Ee);return}const bt=Math.abs(R-je.scrollLeft),Rt=Nx(bt,Ox,Bx,je.clientWidth*.55);ze.current=Dx(je,et,R,{duration:Rt,easing:zx,onComplete:()=>{ze.current=null,nr(je,R,ge,Ee)}})},pa=(R="smooth")=>{const ne=Be.current;if(!ne||t.length===0)return;const ge=Pe()%t.length,Ee=_t(ge,ne.scrollLeft),je=We.current[Ee];je&&ir(je.offsetLeft,{behavior:R,activeIndex:ge})},ma=(R,ne="smooth",ge,Ee)=>{const je=Be.current;if(!je||t.length===0)return;const et=(Ee??je.scrollLeft)-R,bt=Pe(R),Rt=We.current[bt];if(_(Rt)){It(!0),xt();return}const tn=We.current[bt+1],Qt=Rt?tn?tn.offsetLeft-Rt.offsetLeft:Rt.offsetWidth:0;if((Qt>0?et>Qt*fr?1:et<-Qt*fr?-1:0:0)!==0){const Su=ge??bt%t.length,Cu=Oe(Ee??je.scrollLeft,R,Su);$n(Cu,ne);return}const ho=Ee??je.scrollLeft,ar=Pe(ho),il=We.current[ar];if(il&&Math.abs(il.offsetLeft-ho)<1){It(!0),xt();return}pa("auto")},$n=(R,ne="smooth")=>{const ge=Be.current;if(!ge||t.length===0)return;const Ee=_t(R,ge.scrollLeft),je=We.current[Ee];je&&(ne==="smooth"?Ft.current=R:Ft.current=null,z.current=R,ce(R),Et(!0),ir(je.offsetLeft,{behavior:ne,activeIndex:R,onComplete:ne==="smooth"?Ot:void 0}))},Pi=()=>{qe.current&&(window.removeEventListener("pointerup",qe.current),window.removeEventListener("pointercancel",qe.current),qe.current=null)},or=(R,ne,ge,Ee,je)=>{const et=ge-R,bt=Ee-ne,Rt=Math.abs(et),tn=Math.abs(bt);if(Rt<qx||Rt<=tn)return!1;const Qt=et<0?1:-1,Ei=ct?(je+Qt+t.length)%t.length:Math.max(0,Math.min(t.length-1,je+Qt));return Ei===je?!1:($n(Ei),!0)},ui=R=>{if(!Ie.current.isActive)return;Pi();const ne=Be.current;if(!ne)return;const{scrollLeft:ge,startActiveIndex:Ee,hasMoved:je}=Ie.current,et=ne.scrollLeft;Dt(!0),Ie.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},ft(!1),R!==void 0&&ne.hasPointerCapture(R)&&ne.releasePointerCapture(R),je?ma(ge,"smooth",Ee,et):(It(!0),xt()),gt()},rr=(R,ne)=>{const ge=be.current;be.current=null,ge&&(or(ge.startX,ge.startY,R,ne,ge.startActiveIndex),gt())},ga=R=>{if(!Q)return;if(R.pointerType==="touch"){if(un(),It(!0),Lt(R.target))return;be.current={startX:R.clientX,startY:R.clientY,startActiveIndex:z.current};return}if(R.pointerType!=="mouse"||R.button!==0||Lt(R.target))return;const ne=Be.current;if(!ne)return;un(),nn(),di(),Ft.current=null,Ie.current={isActive:!0,startX:R.clientX,scrollLeft:ne.scrollLeft,startActiveIndex:z.current,hasMoved:!1},It(!1),gt(),ne.setPointerCapture(R.pointerId),Pi();const ge=Ee=>{Ee.pointerType==="mouse"&&ui(Ee.pointerId)};qe.current=ge,window.addEventListener("pointerup",ge),window.addEventListener("pointercancel",ge)},ha=R=>{if(!Q||R.pointerType!=="mouse")return;const ne=Be.current;if(!ne||!Ie.current.isActive)return;if(R.buttons===0){ui(R.pointerId);return}const ge=R.clientX-Ie.current.startX;Math.abs(ge)>Yx&&(Ie.current.hasMoved=!0,ft(!0)),Ie.current.hasMoved&&(R.preventDefault(),ne.scrollLeft=Ie.current.scrollLeft-ge,Dt(!0),xt(),gt())},we=R=>{if(Q){if(R.pointerType==="touch"){R.type==="pointerup"?rr(R.clientX,R.clientY):be.current=null;return}R.pointerType==="mouse"&&ui(R.pointerId)}},Ue=R=>{!Q||R.pointerType!=="mouse"||ui(R.pointerId)};return qd(),s.useEffect(()=>{const R=requestAnimationFrame(()=>jt(!0));return()=>{cancelAnimationFrame(R),nn(),Pi(),Nt.current!==null&&(cancelAnimationFrame(Nt.current),Nt.current=null),Tt.current&&clearTimeout(Tt.current),Wt.current&&clearTimeout(Wt.current)}},[]),s.useEffect(()=>{if(!Ce){vt(!0);return}gt();const R=He.current;if(!R)return;const ne=()=>gt();return R.addEventListener("pointermove",ne),R.addEventListener("pointerdown",ne),()=>{R.removeEventListener("pointermove",ne),R.removeEventListener("pointerdown",ne),Wt.current&&clearTimeout(Wt.current)}},[Ce,gt]),s.useEffect(()=>{const R=ne=>{ne.key==="Escape"&&Ae()};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[Ae]),s.useLayoutEffect(()=>{Ht()},[H,t.length,ct]),s.useLayoutEffect(()=>{o||$n(z.current,"auto")},[H,o]),s.useLayoutEffect(()=>{$n(0,"auto")},[t.length,ct]),s.useEffect(()=>{const R=Be.current;if(!R||o||!j)return;const ne=ge=>{if(ge.preventDefault(),Math.abs(ge.deltaY)<=Math.abs(ge.deltaX))return;const Ee=ge.deltaMode===1?Gx:ge.deltaMode===2?R.clientHeight:1,je=ge.deltaY*Ee*Vx;if(je!==0){if(nn(),it.current||(it.current=!0,De.current=R.scrollLeft,Ft.current=null,It(!1)),De.current+=je,!ct){const et=R.scrollWidth-R.clientWidth;De.current=Math.max(0,Math.min(et,De.current))}gt(),nt.current===null&&(nt.current=requestAnimationFrame(ci))}};return R.addEventListener("wheel",ne,{passive:!1}),()=>{R.removeEventListener("wheel",ne),un()}},[o,j,ct]),s.useEffect(()=>{const R=Be.current;if(!R)return;const ne=()=>{Dt(Ie.current.isActive);const Ee=R.scrollLeft,je=Ee-Le.current;Le.current=Ee;const et=Je.current>0?Je.current*.5:1/0;if(je!==0&&Math.abs(je)<et){const bt=je>0?"forward":"backward";bt!==Ge.current&&(Ge.current=bt,Ne(bt))}Ie.current.isActive&&Ie.current.hasMoved||xt()};R.addEventListener("scroll",ne,{passive:!0});const ge=new ResizeObserver(()=>{Ht(),Dt(Ie.current.isActive),Ne(Ge.current),xt()});return ge.observe(R),()=>{nn(),R.removeEventListener("scroll",ne),ge.disconnect()}},[t.length,ct]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{mt||Ae()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:wt?1:0,transition:`opacity ${Eo}ms ease`,pointerEvents:wt?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Vt}}),a.jsxs("div",{ref:He,className:`${e}-lightbox-dismiss-area`,style:Yt,...Xt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:kt,onClick:R=>R.stopPropagation(),children:a.jsx("div",{ref:Be,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":Q&&t.length>0?"true":"false","data-mouse-dragging":zt?"true":"false",onPointerDown:ga,onPointerMove:ha,onPointerUp:we,onPointerCancel:we,onLostPointerCapture:Ue,children:a.jsx("div",{ref:Ze,className:`${e}-lightbox-strip-track`,style:{gap:H},children:Bt.map((R,ne)=>{const ge=R.image.objectFit??"contain",Ee=ne%t.length,je=Math.floor(ne/t.length),et=yr(H),bt=`calc(-0.5 * (${et} + ${H}))`;return a.jsxs("div",{ref:Rt=>We.current[ne]=Rt,className:`${e}-strip-item`,style:{height:k==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:R.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:ge}}),o&&Ee<t.length-1&&je===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:bt,width:et,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${je}-${R.image.url}-${Ee}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":rn?"true":"false",style:Mt,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:U,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:de,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${E?` ${e}-lightbox-content-area-stacked`:""}`,children:(fe||w)&&a.jsx("div",{className:`${e}-header ${E?`${e}-header-two-row`:`${e}-header-single-row`}`,children:E?ht():fe||w?yt():null})})})]}),t.length>1&&C==="on"&&(()=>{const R=yr(L),ne=`calc(-0.5 * (${L} + ${R}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:L},children:a.jsx("div",{ref:he,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:ge=>ge.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":S,style:{gap:te,"--thumbnail-active-color":V},children:[t.map((ge,Ee)=>{const je=yr(te),et=`calc(-0.5 * (${je} + ${te}))`;return a.jsxs("div",{ref:bt=>{ve.current[Ee]=bt},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":A===Ee?"true":"false",onClick:()=>j&&v==="click"&&$n(Ee),onMouseEnter:()=>Te&&v==="hover"&&$n(Ee),"aria-label":ge.image.name?`View ${ge.image.name}`:`View image ${Ee+1}`,"aria-current":A===Ee?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${ie?` ${e}-thumb-image-cover`:""}`,src:ge.image.url,alt:"",draggable:!1,style:{...ue,maxWidth:X,maxHeight:X,width:y.display==="cover"?"auto":"100%",height:"auto",objectFit:y.display==="cover"?"cover":"contain"}})}),o&&Ee<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:et,width:je,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${ge.image.url}-${Ee}`)}),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:ne,height:R,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function av(e){return`
14229
+ `;function Gn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const ic={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},kx=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Ax={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:Gn("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:{...ic.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:{...ic.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:Gn("Question Padding Left"),questionPaddingTop:Gn("Question Padding Top"),questionPaddingBottom:Gn("Question Padding Bottom"),answerPaddingLeft:Gn("Answer Padding Left"),answerPaddingRight:Gn("Answer Padding Right"),answerPaddingTop:Gn("Answer Padding Top"),answerPaddingBottom:Gn("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:[...kx],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Fx={element:Ex,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:Ax,sourceCode:Mx},Dn=e=>e.display==="cover",da=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},oc=100,_x=.2,rc=8,qd=({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"?oc:Math.max(oc,window.innerHeight*_x),[]),x=s.useCallback($=>Math.max(0,1-$/(p*1.5)),[p]),w=s.useCallback($=>Math.max(0,1-$/(p*.45)),[p]),m=s.useCallback($=>{const T=typeof window<"u"?window.innerHeight:800,A=Math.max(.88,1-$/T*.12);return`translateY(${$}px) scale(${A})`},[]),h=s.useCallback(()=>{c.current=null},[]),f=s.useCallback(()=>{d(!0),r(0),window.setTimeout(()=>d(!1),n),h()},[n,h]),v=s.useCallback(()=>{const $=typeof window<"u"?window.innerHeight:800;d(!0),r($),window.setTimeout(()=>{t(),h(),d(!1)},Math.min(n,200))},[n,t,h]),C=s.useCallback($=>{!e||l||$.pointerType==="touch"&&(i!=null&&i($.target)||(c.current={startX:$.clientX,startY:$.clientY,isLocked:null,pointerId:$.pointerId}))},[e,l,i]),y=s.useCallback($=>{const T=c.current;if(!e||!T||$.pointerType!=="touch"||T.pointerId!==$.pointerId)return;const A=$.clientX-T.startX,_=$.clientY-T.startY;if(T.isLocked===null){if(Math.abs(A)<rc&&Math.abs(_)<rc)return;if(_>0&&_>Math.abs(A))T.isLocked=!0,$.currentTarget.setPointerCapture($.pointerId);else{T.isLocked=!1,h();return}}if(!T.isLocked)return;$.preventDefault();const g=Math.max(0,_);u.current=g,r(g)},[e,h]),S=s.useCallback($=>{const T=c.current;if(!e||!T||$.pointerType!=="touch"||T.pointerId!==$.pointerId)return;const A=T.isLocked===!0;if($.currentTarget.hasPointerCapture($.pointerId)&&$.currentTarget.releasePointerCapture($.pointerId),!A){h();return}$.clientY-T.startY>=p?v():f()},[p,v,e,h,f]),G=s.useCallback($=>{S($)},[S]),W=s.useCallback($=>{S($)},[S]),U=o>0,H=l?`transform ${n}ms ease`:"none",I=l?`opacity ${n}ms ease`:"none",z=o>0||l;return{isSwipeDragging:U,backdropStyle:{opacity:x(o),transition:I},mediaAreaStyle:{transform:m(o),transition:H,touchAction:U?"none":void 0,willChange:U?"transform":void 0},overlayContentStyle:z?{opacity:w(o),transition:I}:void 0,swipeHandlers:e?{onPointerDown:C,onPointerMove:y,onPointerUp:G,onPointerCancel:W}:{},dismissAreaStyle:e?{touchAction:U?"none":"pan-x"}:void 0}},Nx="[data-lightbox-scrollable]",Ud=()=>{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(Nx)||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"})}},[])},Wx=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Hx=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Dx=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Ox=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(h,f)=>{Hx(t),e.scrollLeft=h,f&&(r==null||r())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,x=0;const w=()=>{t.removeEventListener("transitionend",m),clearTimeout(x)},m=h=>{h.target!==t||h.propertyName!=="transform"||p||(p=!0,w(),u(n,!0))};return t.addEventListener("transitionend",m),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)`,x=window.setTimeout(()=>{p||(p=!0,w(),u(n,!0))},i+64),()=>{p||(p=!0,w(),u(l-Dx(t),!1))}},Eo=300,Bx=900,zx=1500,jx="cubic-bezier(0.16, 1, 0.3, 1)",Vx=3e3,Gx=2,Xx=16,Yx=.05,qx=1,fr=.3,Ux=50,Kx=20,Ai=.004,ro=["title1","title2","title3"],Zx={title1:"1",title2:"2",title3:"3"},Jx={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Qx={title1:.02,title2:.02,title3:.02},yr=e=>`max(${e}, ${Kx}px)`,ev=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]}},tv=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=ev(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},jt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,nv=e=>[jt(e,"fontFamily"),jt(e,"fontSettings"),{type:"row",items:[jt(e,"fontSize"),jt(e,"lineHeight"),jt(e,"letterSpacing"),jt(e,"wordSpacing")]},jt(e,"textAlign"),jt(e,"textAppearance")],iv=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(ro.map(e=>[Zx[e],nv(e)]))}),el=(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},Kd=(e,t)=>el(e,t),xr=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},ac=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:el(e.length,n),effective:Kd(e.length,n)}},ov=(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},_a=(e,t)=>{const n=i=>{const o=jt(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[Jx[t]]}},rv=(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),Na=(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??Qx[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return qt(i,n)},av=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:x,closeIcon:w,closeIconMaxWidth:m,closeIconColor:h,closeIconHoverColor:f,thumbnailTrigger:v,thumbnailVisibility:C,thumbnailObjectFit:y,thumbnailActive:S,thumbnailActiveColor:G,title1Width:W,title2Width:U,title3Width:H,title1MarginLeft:I=0,title2MarginLeft:z=0,title3MarginLeft:$=0,titleRowMarginBottom:T=0,titleHeaderLayout:A="desktop",contentMarginTop:_,iconMarginLeft:g}=n,B=R=>D.scalingValue(R,i??!1),P=c??n.thumnailSize??.03,Y=B(P),ie=B(u),L=B(p??.02),O=B(x??0),K=B(_??0),ue=yr(K),le=B(g??0),[F,pe]=s.useState(0),j=s.useRef(F);j.current=F;const se=t[F],{title1:ne,title2:ve,title3:Me}=tv(se),xe=Na("title1",_a(n,"title1"),i),b=Na("title2",_a(n,"title2"),i),M=Na("title3",_a(n,"title3"),i),E=A==="mobile",V=!o&&(!i||r),Se=V,te=V,$e=V,re=Dn(y),ge=re?{"--image-aspect-ratio":da(y)}:void 0,ye=!!(ne||ve||Me),Z=s.useMemo(()=>ov(e,ne,ve,Me,xe,b,M),[e,F,ne,ve,Me,xe,b,M]),Q=s.useMemo(()=>({title1Width:W,title2Width:U,title3Width:H}),[W,U,H]),ce=s.useMemo(()=>Z.map(R=>Q[R.widthKey]),[Z,Q]),we=s.useMemo(()=>el(Z.length,ce),[Z.length,ce]),Pe=s.useMemo(()=>Kd(Z.length,ce),[Z.length,ce]),Ce=s.useMemo(()=>Z.filter(R=>R.prefix==="title1"),[Z]),X=s.useMemo(()=>Z.filter(R=>R.prefix==="title2"||R.prefix==="title3"),[Z]),me=s.useMemo(()=>ac(Ce,Q),[Ce,Q]),ae=s.useMemo(()=>ac(X,Q),[X,Q]),q=s.useCallback((R,oe)=>{const fe=Z.indexOf(R);if(!E||oe==="single-row")return{effectiveWidth:Pe[fe]??0,resolvedWidth:we[fe]??0,maxWidth:xr(fe,we)};if(oe==="two-row-top"){const Ge=Ce.indexOf(R);return{effectiveWidth:me.effective[Ge]??0,resolvedWidth:me.resolved[Ge]??0,maxWidth:xr(Ge,me.resolved)}}const Le=X.indexOf(R);return{effectiveWidth:ae.effective[Le]??0,resolvedWidth:ae.resolved[Le]??0,maxWidth:xr(Le,ae.resolved)}},[X,ae,Pe,we,Z,Ce,me,E]),de=s.useCallback(R=>D.scalingValue(R,i??!1),[i]),ke=de(T??0),he=s.useMemo(()=>({title1MarginLeft:I,title2MarginLeft:z,title3MarginLeft:$}),[I,z,$]),J=s.useCallback(R=>Z.slice(0,R+1).reduce((oe,fe,Le)=>oe+(fe!=null&&fe.marginLeftKey?he[fe.marginLeftKey]??0:0)+(we[Le]??0),0)+(E?0:I??0),[Z,he,we,E,I]),Ne=s.useCallback(()=>E?0:I??0,[E,I]),Fe=s.useCallback(R=>X.slice(0,R).reduce((oe,fe,Le)=>oe+(fe.marginLeftKey?he[fe.marginLeftKey]??0:0)+(ae.resolved[Le]??0),0),[X,ae.resolved,he]),et=s.useCallback(R=>{const oe=X[R];return Fe(R)+(oe.marginLeftKey?he[oe.marginLeftKey]??0:0)+(ae.resolved[R]??0)},[X,ae.resolved,Fe,he]),Je=(R,oe)=>{const fe=R.marginLeftKey?he[R.marginLeftKey]??0:0,{effectiveWidth:Le,resolvedWidth:Ge,maxWidth:Qe}=q(R,oe),bt=o&&oe==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":R.prefix,style:{...oe==="single-row"?{gridArea:R.prefix}:{},width:de(Le),...fe>0?{marginLeft:de(fe)}:{}},children:[a.jsx("p",{className:R.className,style:R.style,children:R.text}),bt&&R.marginLeftKey&&a.jsx("div",{"data-controls":R.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ge),style:{position:"absolute",top:0,left:de(-fe),width:`max(${de(fe)}, 10px)`,height:"100%",pointerEvents:"auto"}}),bt&&a.jsx("div",{"data-controls":R.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:de(-Ai/2),width:de(Ai),height:"100%",pointerEvents:"auto"}})]},R.className)},dt=()=>{const R=E?-1:Z.findIndex(Le=>Le.prefix==="title1"),oe=!E&&(o||(I??0)>0)?(()=>{const Le=I??0,Ge=R>=0?we[R]:W??0;return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ge),style:{position:"absolute",top:0,left:0,width:`max(${de(Le)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,fe=Z.flatMap((Le,Ge)=>{if(!Le.marginLeftKey)return[];const Qe=he[Le.marginLeftKey]??0,bt=rv(Z,we,he,Ge)+Ne();return a.jsx("div",{"data-controls":Le.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(we[Ge]),style:{position:"absolute",top:0,left:de(bt),width:`max(${de(Qe)}, 10px)`,height:"100%",pointerEvents:"auto"}},Le.marginLeftKey)});return oe?[oe,...fe]:fe},tt=()=>Z.map((R,oe)=>{const fe=xr(oe,we),Ge=J(oe)-Ai/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":R.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(fe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:de(Ge),width:de(Ai),height:"100%",pointerEvents:"auto"}})},`${R.widthKey}-junction`)}),De=()=>X.flatMap((R,oe)=>{if(!R.marginLeftKey)return[];const fe=he[R.marginLeftKey]??0,Le=Fe(oe),{resolvedWidth:Ge}=q(R,"two-row-bottom");return a.jsx("div",{"data-controls":R.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ge),style:{position:"absolute",top:0,left:de(Le),width:`max(${de(fe)}, 10px)`,height:"100%",pointerEvents:"auto"}},R.marginLeftKey)}),Ie=()=>X.map((R,oe)=>{const{maxWidth:fe}=q(R,"two-row-bottom"),Ge=et(oe)-Ai/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":R.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(fe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:de(Ge),width:de(Ai),height:"100%",pointerEvents:"auto"}})},`${R.widthKey}-junction`)}),We=s.useRef(null),je=s.useRef(null),Ue=s.useRef(null),k=s.useRef(null),ee=s.useRef([]),Te=s.useRef([]),He=s.useRef(0),Be=s.useRef(null),Ve=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),rt=s.useRef(null),Ze=s.useRef(null),_e=s.useRef(0),qe=s.useRef("forward"),Oe=s.useRef(0),nt=s.useRef(null),at=s.useRef(!1),st=t.length>1&&(!o||!!r),St=st?3:1,Yt=s.useMemo(()=>Array.from({length:St},()=>t).flat(),[t,St]),[Zt,vt]=s.useState(!1),[wt,Bt]=s.useState(!1),[At,xt]=s.useState(!0),Ft=s.useRef(null),Nt=s.useRef(null),Ut=s.useRef(!1),Jt=s.useRef(!1),Tt=s.useRef(null),Wt=s.useRef(null),rn=Se&&!At,gt=s.useCallback(()=>{Se&&(xt(!0),Wt.current&&clearTimeout(Wt.current),Wt.current=setTimeout(()=>{Ve.current.isActive||xt(!1)},Vx))},[Se]),Ee=s.useCallback(()=>{o||Jt.current||(Jt.current=!0,Bt(!1),Tt.current=setTimeout(()=>{l()},Eo))},[o,l]),Xe=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":rn?"true":"false",style:{width:D.scalingValue(m??0,i),height:D.scalingValue(m??0,i),marginRight:le,"--close-icon-hover-color":f},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Ee,"aria-label":"Close",children:a.jsx(sn,{url:w,fill:h,hoverFill:i&&!r?h:f,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:le,height:"100%",pointerEvents:"auto"}})]}),lt=(R="two-row")=>a.jsx("div",{...R==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:de(I??0),flexShrink:0,...R==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...R==="two-row"&&o?{pointerEvents:"auto"}:{}}}),ht=()=>{const R=Z.find(Le=>Le.prefix==="title1"),oe=Z.filter(Le=>Le.prefix==="title2"||Le.prefix==="title3"),fe=oe.length>0||o||(T??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(I??0)>0||o?lt():null,R&&Je(R,"two-row-top"),w&&Xe()]}),fe?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[oe.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[oe.map(Le=>Je(Le,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[De(),Ie()]})]}):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:ke,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},ft=()=>a.jsxs(a.Fragment,{children:[(I??0)>0||o?lt("single-row"):null,Z.map(R=>Je(R,"single-row")),o?a.jsxs(a.Fragment,{children:[dt(),tt()]}):null,w?Xe():null]}),Lt=s.useCallback(R=>!!(R.closest("[data-controls]")||R.closest(`.${e}-thumbnails`)||R.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:mt,backdropStyle:zt,mediaAreaStyle:kt,overlayContentStyle:Mt,swipeHandlers:Vt,dismissAreaStyle:Gt}=qd({enabled:V??!1,onClose:Ee,animMs:Eo,isBlockedTarget:Lt}),Ht=()=>{if(!st||t.length===0)return He.current=0,0;const R=Te.current[0],oe=Te.current[t.length];if(!R||!oe)return He.current;const fe=oe.offsetLeft-R.offsetLeft;return fe>0&&(He.current=fe),He.current},Dt=(R=!1)=>{if(!st)return;const oe=je.current,fe=Ht();!oe||fe<=0||fe<oe.clientWidth*.25||(oe.scrollLeft<=0?(oe.scrollLeft+=fe,R&&(Ve.current.scrollLeft+=fe),at.current&&(Oe.current+=fe)):oe.scrollLeft>=fe*2&&(oe.scrollLeft-=fe,R&&(Ve.current.scrollLeft-=fe),at.current&&(Oe.current-=fe)))},_t=(R,oe=(fe=>(fe=je.current)==null?void 0:fe.scrollLeft)()??0)=>{if(!st)return R;let Le=t.length+R,Ge=1/0;for(let Qe=0;Qe<St;Qe++){const bt=Qe*t.length+R,Rt=Te.current[bt];if(!Rt)continue;const tn=Math.abs(Rt.offsetLeft-oe);tn<Ge&&(Ge=tn,Le=bt)}return Le},Ct=R=>{const oe=je.current;return!R||!oe?!1:R.offsetWidth>oe.clientWidth+1},N=R=>{const oe=je.current;if(!R||!oe||!Ct(R))return!1;const fe=R.offsetLeft,Le=fe+R.offsetWidth;return oe.scrollLeft>=fe-1&&oe.scrollLeft+oe.clientWidth<=Le+1},Re=(R=(oe=>(oe=je.current)==null?void 0:oe.scrollLeft)()??0)=>{for(let Le=0;Le<Te.current.length;Le+=1){const Ge=Te.current[Le];if(Ge&&N(Ge))return Le}let fe={flatIndex:0,distance:1/0};return Te.current.forEach((Le,Ge)=>{if(!Le)return;const Qe=Math.abs(Le.offsetLeft-R);Qe<fe.distance&&(fe={flatIndex:Ge,distance:Qe})}),fe.flatIndex},Ae=R=>{je.current&&Te.current.forEach(oe=>{oe&&(oe.style.scrollSnapAlign=Ct(oe)&&R==="backward"?"end":"start")})},ze=(R,oe,fe)=>{const Le=R-oe,Ge=Re(oe),Qe=Te.current[Ge];if(N(Qe))return Re(R)%t.length;const bt=Te.current[Ge+1],Rt=Qe?bt?bt.offsetLeft-Qe.offsetLeft:Qe.offsetWidth:0,tn=Rt>0?Le>Rt*fr?1:Le<-Rt*fr?-1:0:0;return tn===0?fe:st?(fe+tn+t.length)%t.length:Math.max(0,Math.min(t.length-1,fe+tn))},ct=s.useCallback((R=!1)=>{if(C!=="on"||o)return;const oe=k.current,fe=j.current,Le=ee.current[fe];if(!oe||!Le||oe.scrollWidth<=oe.clientWidth)return;const Ge=oe.scrollLeft,Qe=Ge+oe.clientWidth,bt=Le.offsetLeft,Rt=bt+Le.offsetWidth;if(bt>=Ge&&Rt<=Qe)return;const tn=oe.scrollWidth-oe.clientWidth;let Qt=Ge;if(!R&&Ft.current===null){const Ei=ee.current[fe-1],ho=ee.current[fe+1],ar=Ei?Le.offsetLeft-Ei.offsetLeft:ho?ho.offsetLeft-Le.offsetLeft:Le.offsetWidth;Rt>Qe?Qt+=ar:bt<Ge&&(Qt-=ar)}else Rt>Qe?Qt=Rt-oe.clientWidth:Qt=bt;oe.scrollLeft=Math.max(0,Math.min(tn,Qt))},[o,C]),Et=s.useCallback((R=!1)=>{R&&(Ut.current=!0),Nt.current===null&&(Nt.current=requestAnimationFrame(()=>{Nt.current=null;const oe=Ut.current;Ut.current=!1,ct(oe)}))},[ct]),it=s.useCallback(R=>{if(R===j.current)return;const oe=j.current;j.current=R;const fe=Math.abs(R-oe)>1,Le=st&&t.length>1&&(oe===t.length-1&&R===0||oe===0&&R===t.length-1);pe(R),Et(fe||Le)},[t.length,st,Et]),yt=()=>{if(!je.current||t.length===0||Ft.current!==null||Ve.current.isActive&&Ve.current.hasMoved)return;const R=je.current.scrollLeft,oe=Re(R)%t.length;oe!==j.current&&it(oe)},Ot=()=>{Ft.current=null},It=R=>{const oe=je.current;oe&&(oe.style.scrollSnapType=R?"":"none")},nn=()=>{var R;(R=Ze.current)==null||R.call(Ze),Ze.current=null},un=()=>{nt.current!==null&&(cancelAnimationFrame(nt.current),nt.current=null),at.current=!1},ci=()=>{const R=je.current;if(!R){nt.current=null,at.current=!1;return}const oe=Oe.current-R.scrollLeft;if(Math.abs(oe)<.5){R.scrollLeft=Oe.current,Dt(),yt(),nt.current=null,at.current=!1;return}R.scrollLeft+=oe*Yx,Dt(),yt(),gt(),nt.current=requestAnimationFrame(ci)},di=()=>{const R=Ue.current;R&&(R.style.transition="",R.style.transform="",R.style.willChange="")},nr=(R,oe,fe,Le)=>{di(),R.scrollLeft=oe,_e.current=R.scrollLeft,Dt(),fe!==void 0?(j.current=fe,pe(fe)):yt(),It(!0),Le==null||Le()},ir=(R,{behavior:oe="smooth",activeIndex:fe,onComplete:Le}={})=>{const Ge=je.current,Qe=Ue.current;if(!Ge||!Qe)return;if(un(),nn(),It(!1),oe==="auto"){nr(Ge,R,fe,Le);return}const bt=Math.abs(R-Ge.scrollLeft),Rt=Wx(bt,Bx,zx,Ge.clientWidth*.55);Ze.current=Ox(Ge,Qe,R,{duration:Rt,easing:jx,onComplete:()=>{Ze.current=null,nr(Ge,R,fe,Le)}})},pa=(R="smooth")=>{const oe=je.current;if(!oe||t.length===0)return;const fe=Re()%t.length,Le=_t(fe,oe.scrollLeft),Ge=Te.current[Le];Ge&&ir(Ge.offsetLeft,{behavior:R,activeIndex:fe})},ma=(R,oe="smooth",fe,Le)=>{const Ge=je.current;if(!Ge||t.length===0)return;const Qe=(Le??Ge.scrollLeft)-R,bt=Re(R),Rt=Te.current[bt];if(N(Rt)){It(!0),yt();return}const tn=Te.current[bt+1],Qt=Rt?tn?tn.offsetLeft-Rt.offsetLeft:Rt.offsetWidth:0;if((Qt>0?Qe>Qt*fr?1:Qe<-Qt*fr?-1:0:0)!==0){const Cu=fe??bt%t.length,$u=ze(Le??Ge.scrollLeft,R,Cu);$n($u,oe);return}const ho=Le??Ge.scrollLeft,ar=Re(ho),il=Te.current[ar];if(il&&Math.abs(il.offsetLeft-ho)<1){It(!0),yt();return}pa("auto")},$n=(R,oe="smooth")=>{const fe=je.current;if(!fe||t.length===0)return;const Le=_t(R,fe.scrollLeft),Ge=Te.current[Le];Ge&&(oe==="smooth"?Ft.current=R:Ft.current=null,j.current=R,pe(R),Et(!0),ir(Ge.offsetLeft,{behavior:oe,activeIndex:R,onComplete:oe==="smooth"?Ot:void 0}))},Pi=()=>{rt.current&&(window.removeEventListener("pointerup",rt.current),window.removeEventListener("pointercancel",rt.current),rt.current=null)},or=(R,oe,fe,Le,Ge)=>{const Qe=fe-R,bt=Le-oe,Rt=Math.abs(Qe),tn=Math.abs(bt);if(Rt<Ux||Rt<=tn)return!1;const Qt=Qe<0?1:-1,Ei=st?(Ge+Qt+t.length)%t.length:Math.max(0,Math.min(t.length-1,Ge+Qt));return Ei===Ge?!1:($n(Ei),!0)},ui=R=>{if(!Ve.current.isActive)return;Pi();const oe=je.current;if(!oe)return;const{scrollLeft:fe,startActiveIndex:Le,hasMoved:Ge}=Ve.current,Qe=oe.scrollLeft;Dt(!0),Ve.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},vt(!1),R!==void 0&&oe.hasPointerCapture(R)&&oe.releasePointerCapture(R),Ge?ma(fe,"smooth",Le,Qe):(It(!0),yt()),gt()},rr=(R,oe)=>{const fe=Be.current;Be.current=null,fe&&(or(fe.startX,fe.startY,R,oe,fe.startActiveIndex),gt())},ga=R=>{if(!te)return;if(R.pointerType==="touch"){if(un(),It(!0),Lt(R.target))return;Be.current={startX:R.clientX,startY:R.clientY,startActiveIndex:j.current};return}if(R.pointerType!=="mouse"||R.button!==0||Lt(R.target))return;const oe=je.current;if(!oe)return;un(),nn(),di(),Ft.current=null,Ve.current={isActive:!0,startX:R.clientX,scrollLeft:oe.scrollLeft,startActiveIndex:j.current,hasMoved:!1},It(!1),gt(),oe.setPointerCapture(R.pointerId),Pi();const fe=Le=>{Le.pointerType==="mouse"&&ui(Le.pointerId)};rt.current=fe,window.addEventListener("pointerup",fe),window.addEventListener("pointercancel",fe)},ha=R=>{if(!te||R.pointerType!=="mouse")return;const oe=je.current;if(!oe||!Ve.current.isActive)return;if(R.buttons===0){ui(R.pointerId);return}const fe=R.clientX-Ve.current.startX;Math.abs(fe)>qx&&(Ve.current.hasMoved=!0,vt(!0)),Ve.current.hasMoved&&(R.preventDefault(),oe.scrollLeft=Ve.current.scrollLeft-fe,Dt(!0),yt(),gt())},be=R=>{if(te){if(R.pointerType==="touch"){R.type==="pointerup"?rr(R.clientX,R.clientY):Be.current=null;return}R.pointerType==="mouse"&&ui(R.pointerId)}},Ye=R=>{!te||R.pointerType!=="mouse"||ui(R.pointerId)};return Ud(),s.useEffect(()=>{const R=requestAnimationFrame(()=>Bt(!0));return()=>{cancelAnimationFrame(R),nn(),Pi(),Nt.current!==null&&(cancelAnimationFrame(Nt.current),Nt.current=null),Tt.current&&clearTimeout(Tt.current),Wt.current&&clearTimeout(Wt.current)}},[]),s.useEffect(()=>{if(!Se){xt(!0);return}gt();const R=We.current;if(!R)return;const oe=()=>gt();return R.addEventListener("pointermove",oe),R.addEventListener("pointerdown",oe),()=>{R.removeEventListener("pointermove",oe),R.removeEventListener("pointerdown",oe),Wt.current&&clearTimeout(Wt.current)}},[Se,gt]),s.useEffect(()=>{const R=oe=>{oe.key==="Escape"&&Ee()};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[Ee]),s.useLayoutEffect(()=>{Ht()},[O,t.length,st]),s.useLayoutEffect(()=>{o||$n(j.current,"auto")},[O,o]),s.useLayoutEffect(()=>{$n(0,"auto")},[t.length,st]),s.useEffect(()=>{const R=je.current;if(!R||o||!V)return;const oe=fe=>{if(fe.preventDefault(),Math.abs(fe.deltaY)<=Math.abs(fe.deltaX))return;const Le=fe.deltaMode===1?Xx:fe.deltaMode===2?R.clientHeight:1,Ge=fe.deltaY*Le*Gx;if(Ge!==0){if(nn(),at.current||(at.current=!0,Oe.current=R.scrollLeft,Ft.current=null,It(!1)),Oe.current+=Ge,!st){const Qe=R.scrollWidth-R.clientWidth;Oe.current=Math.max(0,Math.min(Qe,Oe.current))}gt(),nt.current===null&&(nt.current=requestAnimationFrame(ci))}};return R.addEventListener("wheel",oe,{passive:!1}),()=>{R.removeEventListener("wheel",oe),un()}},[o,V,st]),s.useEffect(()=>{const R=je.current;if(!R)return;const oe=()=>{Dt(Ve.current.isActive);const Le=R.scrollLeft,Ge=Le-_e.current;_e.current=Le;const Qe=He.current>0?He.current*.5:1/0;if(Ge!==0&&Math.abs(Ge)<Qe){const bt=Ge>0?"forward":"backward";bt!==qe.current&&(qe.current=bt,Ae(bt))}Ve.current.isActive&&Ve.current.hasMoved||yt()};R.addEventListener("scroll",oe,{passive:!0});const fe=new ResizeObserver(()=>{Ht(),Dt(Ve.current.isActive),Ae(qe.current),yt()});return fe.observe(R),()=>{nn(),R.removeEventListener("scroll",oe),fe.disconnect()}},[t.length,st]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{mt||Ee()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:wt?1:0,transition:`opacity ${Eo}ms ease`,pointerEvents:wt?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...zt}}),a.jsxs("div",{ref:We,className:`${e}-lightbox-dismiss-area`,style:Gt,...Vt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:kt,onClick:R=>R.stopPropagation(),children:a.jsx("div",{ref:je,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":te&&t.length>0?"true":"false","data-mouse-dragging":Zt?"true":"false",onPointerDown:ga,onPointerMove:ha,onPointerUp:be,onPointerCancel:be,onLostPointerCapture:Ye,children:a.jsx("div",{ref:Ue,className:`${e}-lightbox-strip-track`,style:{gap:O},children:Yt.map((R,oe)=>{const fe=R.image.objectFit??"contain",Le=oe%t.length,Ge=Math.floor(oe/t.length),Qe=yr(O),bt=`calc(-0.5 * (${Qe} + ${O}))`;return a.jsxs("div",{ref:Rt=>Te.current[oe]=Rt,className:`${e}-strip-item`,style:{height:A==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:R.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:fe}}),o&&Le<t.length-1&&Ge===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:bt,width:Qe,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ge}-${R.image.url}-${Le}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":rn?"true":"false",style:Mt,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:K,flexShrink:0,pointerEvents:"none"},children:o&&a.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-handle-left-fraction":"0.05",style:{position:"absolute",left:0,right:0,top:0,height:ue,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${E?` ${e}-lightbox-content-area-stacked`:""}`,children:(ye||w)&&a.jsx("div",{className:`${e}-header ${E?`${e}-header-two-row`:`${e}-header-single-row`}`,children:E?ht():ye||w?ft():null})})})]}),t.length>1&&C==="on"&&(()=>{const R=yr(L),oe=`calc(-0.5 * (${L} + ${R}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:L},children:a.jsx("div",{ref:k,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:fe=>fe.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":S,style:{gap:ie,"--thumbnail-active-color":G},children:[t.map((fe,Le)=>{const Ge=yr(ie),Qe=`calc(-0.5 * (${Ge} + ${ie}))`;return a.jsxs("div",{ref:bt=>{ee.current[Le]=bt},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":F===Le?"true":"false",onClick:()=>V&&v==="click"&&$n(Le),onMouseEnter:()=>$e&&v==="hover"&&$n(Le),"aria-label":fe.image.name?`View ${fe.image.name}`:`View image ${Le+1}`,"aria-current":F===Le?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${re?` ${e}-thumb-image-cover`:""}`,src:fe.image.url,alt:"",draggable:!1,style:{...ge,maxWidth:Y,maxHeight:Y,width:y.display==="cover"?"auto":"100%",height:"auto",objectFit:y.display==="cover"?"cover":"contain"}})}),o&&Le<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Qe,width:Ge,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${fe.image.url}-${Le}`)}),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:oe,height:R,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function sv(e){return`
14230
14230
  .${e}-wrapper {
14231
14231
  position: relative;
14232
14232
  width: 100%;
@@ -14611,7 +14611,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
14611
14611
  pointer-events: auto;
14612
14612
  z-index: 10;
14613
14613
  }
14614
- `}const sv=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r})=>{const{prefix:l}=D.useScopedStyles(),{cover:d,coverFit:c}=e,u=s.useRef(null),[p,x]=s.useState(!1),w=t??[],m=p&&w.length>0,h=()=>{w.length!==0&&x(!0)};return s.useEffect(()=>{!n||i||o||x(!1)},[n,i,o]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:u,className:`${l}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:av(l)}}),d&&a.jsx("div",{className:`${l}-cover ${Dn(c)?`${l}-ratio-wrapper-cover`:`${l}-ratio-wrapper-fit`}`,onClick:()=>h(),style:{...Dn(c)?{"--image-aspect-ratio":da(c)}:{}},"aria-label":"Open image gallery",children:a.jsx("img",{className:`${l}-cover-image ${Dn(c)?`${l}-cover-image-cover`:`${l}-cover-image-fit`}`,src:d,alt:"cover"})})]}),m&&typeof document<"u"&&(()=>{const f=(r?document.getElementById(r):null)??document.body;return zn.createPortal(a.jsx(rv,{prefix:l,images:w,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:()=>x(!1)}),f)})()]})},lv=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
14614
+ `}const lv=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r})=>{const{prefix:l}=D.useScopedStyles(),{cover:d,coverFit:c}=e,u=s.useRef(null),[p,x]=s.useState(!1),w=t??[],m=p&&w.length>0,h=()=>{w.length!==0&&x(!0)};return s.useEffect(()=>{!n||i||o||x(!1)},[n,i,o]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:u,className:`${l}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:sv(l)}}),d&&a.jsx("div",{className:`${l}-cover ${Dn(c)?`${l}-ratio-wrapper-cover`:`${l}-ratio-wrapper-fit`}`,onClick:()=>h(),style:{...Dn(c)?{"--image-aspect-ratio":da(c)}:{}},"aria-label":"Open image gallery",children:a.jsx("img",{className:`${l}-cover-image ${Dn(c)?`${l}-cover-image-cover`:`${l}-cover-image-fit`}`,src:d,alt:"cover"})})]}),m&&typeof document<"u"&&(()=>{const f=(r?document.getElementById(r):null)??document.body;return zn.createPortal(a.jsx(av,{prefix:l,images:w,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:()=>x(!1)}),f)})()]})},cv=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
14615
14615
  import { createPortal } from 'react-dom';
14616
14616
  import { CommonComponentProps } from '../props';
14617
14617
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -15157,7 +15157,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
15157
15157
  </>
15158
15158
  );
15159
15159
  };
15160
- `,cv="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),fi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function dv(e){const t={};return t[Gt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Gt(e,"fontSettings")]={...fi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Gt(e,"fontSize")]={...fi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Gt(e,"lineHeight")]={...fi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Gt(e,"letterSpacing")]={...fi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Gt(e,"wordSpacing")]={...fi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Gt(e,"textAlign")]={...fi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Gt(e,"textAppearance")]={...fi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const uv=ro.reduce((e,t)=>({...e,...dv(t)}),{}),pv=ro.reduce((e,t)=>({...e,[Gt(t,"fontFamily")]:"Goudy Bookletter 1911",[Gt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Gt(t,"letterSpacing")]:0,[Gt(t,"wordSpacing")]:0,[Gt(t,"textAlign")]:"left",[Gt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Wa(e){return ro.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Gt(n,"fontSize")]=i),o!==void 0&&(t[Gt(n,"lineHeight")]=o),t},{})}const mv=nv(),gv={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"}},...uv,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:cv,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...pv},layoutDefaults:{m:{thumbnailSize:.1,thumbnailVisibility:"off",titleHeaderLayout:"mobile",thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",title1Width:.25,title2Width:.6,title3Width:.25,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.04,titleRowMarginBottom:.08,closeIconMaxWidth:.04,contentMarginTop:.08,iconMarginLeft:.02,...Wa({title1FontSize:.042,title1LineHeight:.042,title2FontSize:.042,title2LineHeight:.042,title3FontSize:.042,title3LineHeight:.042})},t:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.039,contentMarginTop:.015,iconMarginLeft:.02,...Wa({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208})},d:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.02,contentMarginTop:.015,iconMarginLeft:.02,...Wa({title1FontSize:.011,title1LineHeight:.02,title2FontSize:.011,title2LineHeight:.02,title3FontSize:.011,title3LineHeight:.02})}},displayRules:[{if:{name:"thumbnailActive",value:"outline"},then:{name:"properties.thumbnailActiveColor.display.visible",value:!0}}],layout:["__componentName__","thumbnailGap","thumbnailMarginBottom","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","contentMarginTop","title1MarginLeft","iconMarginLeft"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",title:"Thumbnails",items:["thumbnailVisibility","thumbnailObjectFit"]},{type:"row",items:["thumbnailTrigger","thumbnailActive"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[mv]}],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"}]}},hv={element:sv,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:gv,sourceCode:lv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...ro.map(e=>({path:`${Gt(e,"fontFamily")}`}))]},fontRelations:{...ro.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Gt(t,"fontFamily")}`}),{})}},fv=({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:x,coverFit:w,backgroundColor:m,imageGap:h,maxWidth:f,maxHeight:v,textTransition:C,title1Width:y,title2Width:S,title3Width:V,title1MarginLeft:N=0,title2MarginLeft:q=0,title3MarginLeft:W=0,titleRowMarginBottom:I=0,titleHeaderLayout:B="single-row",countCloseGap:$=0,closeIcon:T,closeIconMaxWidth:k,closeIconColor:F,closeIconHoverColor:g,contentMarginTop:O=0,iconMarginRight:P=0}=n,X=s.useCallback(we=>D.scalingValue(we,i??!1),[i]),te=X(h??0),L=`${f}%`,H=`${v}%`,U=X($),de=X(O),ae=X(P),A=wi("title1",bi(n,"title1"),i),ce=wi("title2",bi(n,"title2"),i),z=wi("title3",bi(n,"title3"),i),re=wi("count",bi(n,"count"),i),ee=B==="mobile",xe=!i||!!r,Fe=!o&&(!i||!!r),ye=s.useMemo(()=>Er(t,x),[t,x]),[b,M]=s.useState(l),E=ye[b],j=E==null?void 0:E.entry,[Ce,Q]=s.useState(!1),[Te,ie]=s.useState(null),[ue,fe]=s.useState(!1),[K,Z]=s.useState(null),[se,Se]=s.useState(!1),[Me,$e]=s.useState(0),[G,pe]=s.useState(),[oe,Y]=s.useState(),[le,_e]=s.useState(null),me=s.useRef(null),J=s.useRef(0),Ke=s.useRef(0),ke=s.useRef(0),tt=s.useRef(!1),Ye=s.useRef(null),dt=s.useRef(null),ot=s.useRef(null),Ve=s.useRef(null),Re=s.useRef(null),He=s.useRef(null),Be=s.useRef(null),Ze=s.useCallback(()=>{const we=dt.current;if(!we)return;const Ue=we.closest(`.${e}-lightbox-content-area`);if(!Ue)return we.getBoundingClientRect().width;const R=Array.from(Ue.children).reduce((ne,ge)=>!(ge instanceof HTMLElement)||ge.contains(we)?ne:ne+ge.getBoundingClientRect().width,0);return Ue.getBoundingClientRect().width-R},[e]),he=s.useCallback(()=>{me.current&&(clearTimeout(me.current),me.current=null)},[]),ve=s.useCallback(we=>{we===J.current&&(Z(null),Se(!1))},[]),We=s.useCallback(()=>{o||tt.current||(tt.current=!0,u==null||u(),Q(!1),Ye.current=setTimeout(()=>{p()},300))},[o,u,p]),Je=s.useCallback(we=>!!(we.closest("[data-controls]")||we.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:be,backdropStyle:Ie,mediaAreaStyle:qe,overlayContentStyle:ze,swipeHandlers:Le,dismissAreaStyle:Ge}=Yd({enabled:Fe,onClose:We,animMs:300,isBlockedTarget:Je}),De=s.useCallback(we=>{d&&Pd(we+1,c,!0)},[d,c]),nt=s.useCallback(we=>{if(we)return we.getBoundingClientRect().height},[]),it=s.useCallback(we=>{if(ye.length===0)return;const Ue=(we%ye.length+ye.length)%ye.length;if(Ue===b)return;const R=ye[b],ne=ye[Ue];J.current+=1;const ge=J.current,Ee=C==="fade"&&_l(R==null?void 0:R.entry)!==_l(ne==null?void 0:ne.entry),je=nt(ot.current),et=Ee?(()=>{const Rt=Ze();zn.flushSync(()=>{_e(ne.entry)}),ot.current&&Rt&&(ot.current.style.width=`${Rt}px`);const tn=nt(ot.current);return ot.current&&(ot.current.style.width=""),{measuredIncomingTitlesHeight:tn,incomingTitlesMeasureWidth:Rt}})():void 0,bt=Math.max(je??0,(et==null?void 0:et.measuredIncomingTitlesHeight)??0)||void 0;$e(ge),Z(b),Se(!0),M(Ue),De(Ue),ke.current=Ue,Ee?(he(),bt&&pe(bt),et!=null&&et.incomingTitlesMeasureWidth&&Y(et.incomingTitlesMeasureWidth),ie((R==null?void 0:R.entryIndex)??null),fe(!0),Ke.current=ne.entryIndex,me.current=setTimeout(()=>{ie(null),fe(!1),pe(void 0),Y(void 0),_e(null),me.current=null},400)):(he(),ie(null),fe(!1),pe(void 0),Y(void 0),_e(null),Ke.current=ne.entryIndex)},[b,he,Ze,nt,ye,De,C]),ct=s.useCallback(()=>{Be.current=null},[]),St=s.useCallback(we=>{!xe||ye.length<=1||we.pointerType==="mouse"&&we.button!==0||we.target.closest("[data-controls]")||(Be.current={startX:we.clientX,startY:we.clientY,pointerId:we.pointerId})},[xe,ye.length]),Bt=s.useCallback(we=>{var Rt;if(!xe||ye.length<=1||we.pointerType==="mouse"&&we.button!==0)return;if(be){ct();return}const Ue=Be.current;if(!Ue||Ue.pointerId!==we.pointerId||(ct(),we.target.closest("[data-controls]")))return;const ne=we.clientX-Ue.startX,ge=we.clientY-Ue.startY,Ee=Math.abs(ne),je=Math.abs(ge);if(Ee>=Lf&&Ee>je){it(ne>0?b-1:b+1);return}if(Ee>Ml||je>Ml)return;const et=(Rt=Ve.current)==null?void 0:Rt.getBoundingClientRect(),bt=et?et.left+et.width/2:window.innerWidth/2;it(we.clientX<bt?b-1:b+1)},[b,xe,it,be,ct,ye.length]),zt=s.useCallback(we=>{const Ue=Be.current;(Ue==null?void 0:Ue.pointerId)===we.pointerId&&ct()},[ct]);qd(),s.useEffect(()=>{He.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const we=requestAnimationFrame(()=>{Q(!0),requestAnimationFrame(()=>{Re.current?Re.current.focus():Ve.current&&Ve.current.focus()})});return()=>{cancelAnimationFrame(we),Ye.current&&clearTimeout(Ye.current),me.current&&clearTimeout(me.current);const Ue=He.current;Ue&&document.contains(Ue)&&Ue.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var we;C!=="fade"&&(Ke.current=((we=ye[b])==null?void 0:we.entryIndex)??0,he(),ie(null),fe(!1),pe(void 0),Y(void 0))},[b,he,ye,C]),s.useEffect(()=>{const we=Ue=>{if(Ue.key==="Escape"){We();return}if(Ue.key==="ArrowLeft"&&ye.length>1){it(b-1);return}if(Ue.key==="ArrowRight"&&ye.length>1){it(b+1);return}if(Ue.key==="Tab"&&Ve.current){const R=Ve.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),ne=Array.from(R).filter(et=>!et.closest('[aria-hidden="true"]'));if(ne.length===0)return;const ge=ne[0],Ee=ne[ne.length-1],je=document.activeElement;Ue.shiftKey?(je===ge||!Ve.current.contains(je))&&(Ue.preventDefault(),Ee.focus()):(je===Ee||!Ve.current.contains(je))&&(Ue.preventDefault(),ge.focus())}};return window.addEventListener("keydown",we),()=>window.removeEventListener("keydown",we)},[it,We,b,ye.length]),s.useLayoutEffect(()=>{he(),J.current=0,$e(0),Z(null),Se(!1),ie(null),fe(!1),pe(void 0),Y(void 0),_e(null),M(we=>{const Ue=Math.max(0,ye.length-1);return Math.min(we,Ue)})},[he,t.length,x,ye.length]),s.useLayoutEffect(()=>{var R;const we=Math.max(0,ye.length-1),Ue=Math.min(Math.max(0,l),we);ke.current=Ue,Ke.current=((R=ye[Ue])==null?void 0:R.entryIndex)??0,M(Ue)},[l]);const ft=Te!==null?t[Te]:null,wt=K!==null?ye[K]:null,jt=(j==null?void 0:j.title1)||(j==null?void 0:j.title2)||(j==null?void 0:j.title3)||(ft==null?void 0:ft.title1)||(ft==null?void 0:ft.title2)||(ft==null?void 0:ft.title3),At=Nf(x,ye,t),vt=T!==null,Ft=jt||At||vt,Nt=At&&vt?{gap:U}:void 0,Kt=`${e}-titles-stack${ee?` ${e}-titles-stack-stacked`:""}`,Jt=`${e}-titles-layer-out${ee?` ${e}-titles-layer-out-stacked`:""}`,Tt=`${e}-titles-layer-out`,Wt=(N??0)>0||o,rn=X(I),gt=s.useMemo(()=>({title1Width:y??Yi.title1Width,title2Width:S??Yi.title2Width,title3Width:V??Yi.title3Width}),[y,S,V]),Ae=s.useMemo(()=>({title2MarginLeft:q,title3MarginLeft:W}),[q,W]),Xe=s.useMemo(()=>j?Kn(e,j,A,ce,z):[],[e,j,A,ce,z]),st=s.useMemo(()=>Xe.map(we=>gt[we.widthKey]),[Xe,gt]),ht=s.useMemo(()=>Qi(Xe.length,st),[Xe.length,st]),yt=s.useMemo(()=>Ho(Xe.length,st),[Xe.length,st]),Lt=s.useMemo(()=>Xe.filter(we=>we.prefix==="title1"),[Xe]),mt=s.useMemo(()=>Xe.filter(we=>we.prefix==="title2"||we.prefix==="title3"),[Xe]),Vt=s.useMemo(()=>Zn(Lt,gt),[Lt,gt]),kt=s.useMemo(()=>Zn(mt,gt),[mt,gt]),Mt=s.useCallback((we,Ue)=>{const R=Xe.findIndex(ge=>ge.prefix===we.prefix);if(!ee||Ue==="single-row")return{effectiveWidth:yt[R]??0,resolvedWidth:ht[R]??0,maxWidth:cn(R,ht)};if(Ue==="two-row-top"){const ge=Lt.findIndex(Ee=>Ee.prefix===we.prefix);return{effectiveWidth:Vt.effective[ge]??0,resolvedWidth:Vt.resolved[ge]??0,maxWidth:cn(ge,Vt.resolved)}}const ne=mt.findIndex(ge=>ge.prefix===we.prefix);return{effectiveWidth:kt.effective[ne]??0,resolvedWidth:kt.resolved[ne]??0,maxWidth:cn(ne,kt.resolved)}},[Xe,mt,kt,yt,ht,Lt,Vt,ee]),Xt=s.useCallback(we=>Ad(Xe,ht,Ae,we)+(ee?0:N??0),[Xe,ht,Ae,ee,N]),Yt=s.useCallback(()=>ee?0:N??0,[ee,N]),Ht=s.useCallback(we=>mt.slice(0,we).reduce((Ue,R,ne)=>Ue+(R.marginLeftKey?Ae[R.marginLeftKey]??0:0)+(kt.resolved[ne]??0),0),[mt,kt.resolved,Ae]),Dt=s.useCallback(we=>{const Ue=mt[we];return Ht(we)+(Ue.marginLeftKey?Ae[Ue.marginLeftKey]??0:0)+(kt.resolved[we]??0)},[mt,kt.resolved,Ht,Ae]),_t=s.useCallback((we,Ue,R)=>{if(!ee||R==="single-row"){const et=we.findIndex(Qt=>Qt.prefix===Ue.prefix),bt=we.map(Qt=>gt[Qt.widthKey]),Rt=Qi(we.length,bt);return{effectiveWidth:Ho(we.length,bt)[et]??0,resolvedWidth:Rt[et]??0,maxWidth:cn(et,Rt)}}if(R==="two-row-top"){const et=we.filter(Qt=>Qt.prefix==="title1"),bt=et.findIndex(Qt=>Qt.prefix===Ue.prefix),{resolved:Rt,effective:tn}=Zn(et,gt);return{effectiveWidth:tn[bt]??0,resolvedWidth:Rt[bt]??0,maxWidth:cn(bt,Rt)}}const ne=we.filter(et=>et.prefix==="title2"||et.prefix==="title3"),ge=ne.findIndex(et=>et.prefix===Ue.prefix),{resolved:Ee,effective:je}=Zn(ne,gt);return{effectiveWidth:je[ge]??0,resolvedWidth:Ee[ge]??0,maxWidth:cn(ge,Ee)}},[gt,ee]),Ct=(we,Ue,R)=>{const ne=we.marginLeftKey?Ae[we.marginLeftKey]??0:0,{effectiveWidth:ge,resolvedWidth:Ee,maxWidth:je}=R??Mt(we,Ue),et=Math.max(ne,Un),bt=o&&Ue==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":we.prefix,style:{width:X(ge),...ne>0?{marginLeft:X(ne)}:{}},children:[a.jsx("p",{className:we.className,style:we.style,children:we.text}),bt&&we.marginLeftKey?a.jsx("div",{"data-controls":we.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ee),style:{position:"absolute",top:0,left:X(-ne),width:X(et),height:"100%",pointerEvents:"auto"}}):null,bt?a.jsx("div",{"data-controls":we.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(je),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:X(-fn/2),width:X(fn),height:"100%",pointerEvents:"auto"}}):null]},we.className)},_=(we="two-row")=>{const Ue=Xe.findIndex(ge=>ge.prefix==="title1"),R=Ue>=0?ht[Ue]:gt.title1Width,ne=we==="two-row"&&o;return a.jsx("div",{...ne?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(R)}:{},style:{width:X(N??0),flexShrink:0,alignSelf:"stretch",...ne?{pointerEvents:"auto"}:{}}})},Pe=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:A,"aria-hidden":"true",children:" "}),Ne=()=>a.jsx("span",{className:`${e}-entry-counter`,style:re,"aria-live":"polite","aria-atomic":"true",children:_f(ye,b,x,t)}),Oe=()=>At?o&&vt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Ne(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Ra(U)} + ${U}))`,width:Ra(U),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Ne():null,lt=()=>!At&&!vt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Nt,children:[Oe(),vt?xt():null]}),Et=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||jt?Pe():null,Wt?_("single-row"):null,It(j),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),lt(),$n()]}),rt=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||jt?Pe():null,Wt?_("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:ue&&G?{minHeight:G}:void 0,children:[a.jsx("div",{ref:ot,className:Kt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:di(le||j)}),a.jsxs("div",{ref:dt,className:Kt,style:{position:ue?"absolute":"relative",inset:ue?0:void 0,width:"100%",...ue&&oe?{width:oe,maxWidth:"100%"}:void 0},children:[ft&&ue?a.jsx("div",{className:`${Jt} ${e}-titles-fade-out`,children:di(ft)}):null,a.jsx("div",{className:`${e}-titles-layer-in${ue?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:di(j)})]})]}),lt(),$n()]}),xt=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:D.scalingValue(k??0,i),height:D.scalingValue(k??0,i),marginRight:ae,"--close-icon-hover-color":g},children:[a.jsx("button",{ref:Re,type:"button",className:`${e}-close-icon-inner`,onClick:We,"aria-label":"Close",children:a.jsx(sn,{url:T??"",fill:F,hoverFill:i&&!r?F:g,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:ae,height:"100%",pointerEvents:"auto"}})]}),Ot=(we,Ue)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[At||jt?Pe():null,Wt?_("two-row"):null,Ue!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Ue},children:we}):a.jsxs(a.Fragment,{children:[we,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),lt()]}),It=we=>{if(!we)return null;const Ue=Kn(e,we,A,ce,z);return a.jsx(a.Fragment,{children:Ue.map(R=>Ct(R,"single-row",_t(Ue,R,"single-row")))})},nn=we=>{if(!we)return null;const Ue=Kn(e,we,A,ce,z),R=Ue.find(ne=>ne.prefix==="title1");return R?Ct(R,"two-row-top",_t(Ue,R,"two-row-top")):null},un=(we,Ue=!1)=>{const R=we?Kn(e,we,A,ce,z):[],ne=R.filter(je=>je.prefix==="title2"||je.prefix==="title3"),ge=o&&Ue;return ne.length>0||ge||(I??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[ne.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[ne.map(je=>Ct(je,"two-row-bottom",_t(R,je,"two-row-bottom"))),Ue&&o?a.jsxs(a.Fragment,{children:[pa(),ma()]}):null]}):null,(I??0)>0||ge?a.jsx("div",{"data-controls":ge?"titleRowMarginBottom":void 0,"data-controls-axis":ge?"y":void 0,"data-controls-reverse":ge?"":void 0,className:ge?`${e}-control`:void 0,style:{height:rn,width:"100%",flexShrink:0,pointerEvents:ge?"auto":"none"}}):null]}):null},ci=(we,Ue=!1)=>a.jsxs(a.Fragment,{children:[Ot(nn(we)),un(we,Ue)]}),di=we=>ee?a.jsx("div",{className:`${e}-titles-row-two-row`,children:ci(we)}):we?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:It(we)}):null,nr=()=>{const we=ee?-1:Xe.findIndex(ne=>ne.prefix==="title1"),Ue=!ee&&(o||(N??0)>0)?(()=>{const ne=N??0,ge=we>=0?ht[we]:gt.title1Width,Ee=Math.max(ne,Un);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ge),style:{position:"absolute",top:0,left:0,width:X(Ee),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,R=Xe.flatMap((ne,ge)=>{if(!ne.marginLeftKey)return[];const Ee=Ae[ne.marginLeftKey]??0,je=kd(Xe,ht,Ae,ge)+Yt(),et=Math.max(Ee,Un);return a.jsx("div",{"data-controls":ne.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ht[ge]),style:{position:"absolute",top:0,left:X(je),width:X(et),height:"100%",pointerEvents:"auto"}},ne.marginLeftKey)});return Ue?[Ue,...R]:R},ir=()=>Xe.map((we,Ue)=>{const R=cn(Ue,ht),ge=Xt(Ue)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":we.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(R),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:X(ge),width:X(fn),height:"100%",pointerEvents:"auto"}})},`${we.widthKey}-junction`)}),pa=()=>mt.flatMap((we,Ue)=>{if(!we.marginLeftKey)return[];const R=Ae[we.marginLeftKey]??0,ne=Ht(Ue),ge=Math.max(R,Un),{resolvedWidth:Ee}=Mt(we,"two-row-bottom");return a.jsx("div",{"data-controls":we.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ee),style:{position:"absolute",top:0,left:X(ne),width:X(ge),height:"100%",pointerEvents:"auto"}},we.marginLeftKey)}),ma=()=>mt.map((we,Ue)=>{const{maxWidth:R}=Mt(we,"two-row-bottom"),ge=Dt(Ue)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":we.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(R),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:X(ge),width:X(fn),height:"100%",pointerEvents:"auto"}})},`${we.widthKey}-junction`)}),$n=()=>!o||ee?null:a.jsxs(a.Fragment,{children:[nr(),ir()]}),Pi=we=>{const Ue=!we.objectFit&&Dn(w);return{className:`${e}-slide-image-cell${Ue?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:L,maxHeight:H,...Ue?{"--image-aspect-ratio":da(w)}:{}}}},or=we=>we.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":we.objectFit}}:Dn(w)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ui=we=>{if(we.length===0)return null;const Ue=we.length>1,R=Ra(te),ne=`calc(-0.5 * (${R} + ${te}))`;if(we.length===1){const ge=we[0];return a.jsx("div",{...Pi(ge),children:a.jsx("img",{...or(ge),src:ge.url,alt:ge.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:Ue?{gap:te}:void 0,children:we.map((ge,Ee)=>a.jsxs("div",{...Pi(ge),children:[a.jsx("img",{...or(ge),src:ge.url,alt:ge.name??"",draggable:!1}),o&&Ue&&Ee<we.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:ne,width:R,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${ge.url}-${Ee}`))})},rr=!!(j!=null&&j.title2||j!=null&&j.title3||ft!=null&&ft.title2||ft!=null&&ft.title3||(I??0)>0||o),ga=()=>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:ot,className:Kt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ci(le||j)}),a.jsxs("div",{ref:dt,className:`${e}-titles-row-two-row`,style:{...ue&&G?{minHeight:G}:void 0,...ue&&oe?{width:oe,maxWidth:"100%"}:void 0},children:[Ot(a.jsxs("div",{className:Kt,style:{position:ue?"absolute":"relative",inset:ue?0:void 0,width:"100%"},children:[ft&&ue?a.jsx("div",{className:`${Tt} ${e}-titles-fade-out`,children:nn(ft)}):null,a.jsx("div",{className:`${e}-titles-layer-in${ue?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:nn(j)})]}),ue&&G?G:void 0),rr?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[ft&&ue?a.jsx("div",{className:`${Jt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:un(ft)}):null,a.jsx("div",{className:`${e}-titles-layer-in${ue?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${ee?` ${e}-titles-layer-in-stacked`:""}`,children:un(j,!0)})]}):null]})]}),ha=()=>{const we=rr;return a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...we?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:we?void 0:{flex:"0 0 auto",height:"auto"},children:ci(j,!0)}),$n()]})};return a.jsxs("div",{ref:Ve,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{be||We()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:vt?void 0:-1,style:{opacity:Ce?1:0,transition:"opacity 300ms ease",pointerEvents:Ce?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:m,...Ie}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Ge,...Le,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:qe,onClick:we=>we.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":xe&&ye.length>1?"true":"false",onPointerDown:xe?St:void 0,onPointerUp:xe?Bt:void 0,onPointerCancel:xe?zt:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[wt&&se?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:we=>{we.target===we.currentTarget&&ve(Me)},children:a.jsx("div",{className:`${e}-slide-area`,children:ui(wt.images)})},`slide-out-${Me}`):null,a.jsx("div",{className:`${e}-slide-layer-in${se?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:E?ui(E.images):null})},`slide-in-${Me}-${b}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:ze,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:de,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...ee?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${ee?` ${e}-lightbox-content-area-stacked`:""}`,children:Ft&&a.jsx("div",{className:`${e}-text-bar-cell${ee?` ${e}-text-bar-cell-stacked`:""}`,style:ee?void 0:{flex:1,minWidth:0,width:"100%"},children:ee?C==="fade"?ga():ha():C==="fade"?rt():Et()})})})]})]})]})};function yv(e){return`
15160
+ `,dv="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),fi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function uv(e){const t={};return t[jt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[jt(e,"fontSettings")]={...fi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[jt(e,"fontSize")]={...fi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[jt(e,"lineHeight")]={...fi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[jt(e,"letterSpacing")]={...fi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[jt(e,"wordSpacing")]={...fi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[jt(e,"textAlign")]={...fi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[jt(e,"textAppearance")]={...fi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const pv=ro.reduce((e,t)=>({...e,...uv(t)}),{}),mv=ro.reduce((e,t)=>({...e,[jt(t,"fontFamily")]:"Goudy Bookletter 1911",[jt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[jt(t,"letterSpacing")]:0,[jt(t,"wordSpacing")]:0,[jt(t,"textAlign")]:"left",[jt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Wa(e){return ro.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[jt(n,"fontSize")]=i),o!==void 0&&(t[jt(n,"lineHeight")]=o),t},{})}const gv=iv(),hv={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"}},...pv,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:dv,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...mv},layoutDefaults:{m:{thumbnailSize:.1,thumbnailVisibility:"off",titleHeaderLayout:"mobile",thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",title1Width:.25,title2Width:.6,title3Width:.25,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.04,titleRowMarginBottom:.08,closeIconMaxWidth:.04,contentMarginTop:.08,iconMarginLeft:.02,...Wa({title1FontSize:.042,title1LineHeight:.042,title2FontSize:.042,title2LineHeight:.042,title3FontSize:.042,title3LineHeight:.042})},t:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.039,contentMarginTop:.015,iconMarginLeft:.02,...Wa({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208})},d:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.02,contentMarginTop:.015,iconMarginLeft:.02,...Wa({title1FontSize:.011,title1LineHeight:.02,title2FontSize:.011,title2LineHeight:.02,title3FontSize:.011,title3LineHeight:.02})}},displayRules:[{if:{name:"thumbnailActive",value:"outline"},then:{name:"properties.thumbnailActiveColor.display.visible",value:!0}}],layout:["__componentName__","thumbnailGap","thumbnailMarginBottom","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","contentMarginTop","title1MarginLeft","iconMarginLeft"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",title:"Thumbnails",items:["thumbnailVisibility","thumbnailObjectFit"]},{type:"row",items:["thumbnailTrigger","thumbnailActive"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[gv]}],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"}]}},fv={element:lv,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:hv,sourceCode:cv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...ro.map(e=>({path:`${jt(e,"fontFamily")}`}))]},fontRelations:{...ro.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${jt(t,"fontFamily")}`}),{})}},yv=({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:x,coverFit:w,backgroundColor:m,imageGap:h,maxWidth:f,maxHeight:v,textTransition:C,title1Width:y,title2Width:S,title3Width:G,title1MarginLeft:W=0,title2MarginLeft:U=0,title3MarginLeft:H=0,titleRowMarginBottom:I=0,titleHeaderLayout:z="single-row",countCloseGap:$=0,closeIcon:T,closeIconMaxWidth:A,closeIconColor:_,closeIconHoverColor:g,contentMarginTop:B=0,iconMarginRight:P=0}=n,Y=s.useCallback(be=>D.scalingValue(be,i??!1),[i]),ie=Y(h??0),L=`${f}%`,O=`${v}%`,K=Y($),ue=Y(B),le=Y(P),F=wi("title1",bi(n,"title1"),i),pe=wi("title2",bi(n,"title2"),i),j=wi("title3",bi(n,"title3"),i),se=wi("count",bi(n,"count"),i),ne=z==="mobile",ve=!i||!!r,Me=!o&&(!i||!!r),xe=s.useMemo(()=>Er(t,x),[t,x]),[b,M]=s.useState(l),E=xe[b],V=E==null?void 0:E.entry,[Se,te]=s.useState(!1),[$e,re]=s.useState(null),[ge,ye]=s.useState(!1),[Z,Q]=s.useState(null),[ce,we]=s.useState(!1),[Pe,Ce]=s.useState(0),[X,me]=s.useState(),[ae,q]=s.useState(),[de,ke]=s.useState(null),he=s.useRef(null),J=s.useRef(0),Ne=s.useRef(0),Fe=s.useRef(0),et=s.useRef(!1),Je=s.useRef(null),dt=s.useRef(null),tt=s.useRef(null),De=s.useRef(null),Ie=s.useRef(null),We=s.useRef(null),je=s.useRef(null),Ue=s.useCallback(()=>{const be=dt.current;if(!be)return;const Ye=be.closest(`.${e}-lightbox-content-area`);if(!Ye)return be.getBoundingClientRect().width;const R=Array.from(Ye.children).reduce((oe,fe)=>!(fe instanceof HTMLElement)||fe.contains(be)?oe:oe+fe.getBoundingClientRect().width,0);return Ye.getBoundingClientRect().width-R},[e]),k=s.useCallback(()=>{he.current&&(clearTimeout(he.current),he.current=null)},[]),ee=s.useCallback(be=>{be===J.current&&(Q(null),we(!1))},[]),Te=s.useCallback(()=>{o||et.current||(et.current=!0,u==null||u(),te(!1),Je.current=setTimeout(()=>{p()},300))},[o,u,p]),He=s.useCallback(be=>!!(be.closest("[data-controls]")||be.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:Be,backdropStyle:Ve,mediaAreaStyle:rt,overlayContentStyle:Ze,swipeHandlers:_e,dismissAreaStyle:qe}=qd({enabled:Me,onClose:Te,animMs:300,isBlockedTarget:He}),Oe=s.useCallback(be=>{d&&Ed(be+1,c,!0)},[d,c]),nt=s.useCallback(be=>{if(be)return be.getBoundingClientRect().height},[]),at=s.useCallback(be=>{if(xe.length===0)return;const Ye=(be%xe.length+xe.length)%xe.length;if(Ye===b)return;const R=xe[b],oe=xe[Ye];J.current+=1;const fe=J.current,Le=C==="fade"&&_l(R==null?void 0:R.entry)!==_l(oe==null?void 0:oe.entry),Ge=nt(tt.current),Qe=Le?(()=>{const Rt=Ue();zn.flushSync(()=>{ke(oe.entry)}),tt.current&&Rt&&(tt.current.style.width=`${Rt}px`);const tn=nt(tt.current);return tt.current&&(tt.current.style.width=""),{measuredIncomingTitlesHeight:tn,incomingTitlesMeasureWidth:Rt}})():void 0,bt=Math.max(Ge??0,(Qe==null?void 0:Qe.measuredIncomingTitlesHeight)??0)||void 0;Ce(fe),Q(b),we(!0),M(Ye),Oe(Ye),Fe.current=Ye,Le?(k(),bt&&me(bt),Qe!=null&&Qe.incomingTitlesMeasureWidth&&q(Qe.incomingTitlesMeasureWidth),re((R==null?void 0:R.entryIndex)??null),ye(!0),Ne.current=oe.entryIndex,he.current=setTimeout(()=>{re(null),ye(!1),me(void 0),q(void 0),ke(null),he.current=null},400)):(k(),re(null),ye(!1),me(void 0),q(void 0),ke(null),Ne.current=oe.entryIndex)},[b,k,Ue,nt,xe,Oe,C]),st=s.useCallback(()=>{je.current=null},[]),St=s.useCallback(be=>{!ve||xe.length<=1||be.pointerType==="mouse"&&be.button!==0||be.target.closest("[data-controls]")||(je.current={startX:be.clientX,startY:be.clientY,pointerId:be.pointerId})},[ve,xe.length]),Yt=s.useCallback(be=>{var Rt;if(!ve||xe.length<=1||be.pointerType==="mouse"&&be.button!==0)return;if(Be){st();return}const Ye=je.current;if(!Ye||Ye.pointerId!==be.pointerId||(st(),be.target.closest("[data-controls]")))return;const oe=be.clientX-Ye.startX,fe=be.clientY-Ye.startY,Le=Math.abs(oe),Ge=Math.abs(fe);if(Le>=Pf&&Le>Ge){at(oe>0?b-1:b+1);return}if(Le>Ml||Ge>Ml)return;const Qe=(Rt=De.current)==null?void 0:Rt.getBoundingClientRect(),bt=Qe?Qe.left+Qe.width/2:window.innerWidth/2;at(be.clientX<bt?b-1:b+1)},[b,ve,at,Be,st,xe.length]),Zt=s.useCallback(be=>{const Ye=je.current;(Ye==null?void 0:Ye.pointerId)===be.pointerId&&st()},[st]);Ud(),s.useEffect(()=>{We.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const be=requestAnimationFrame(()=>{te(!0),requestAnimationFrame(()=>{Ie.current?Ie.current.focus():De.current&&De.current.focus()})});return()=>{cancelAnimationFrame(be),Je.current&&clearTimeout(Je.current),he.current&&clearTimeout(he.current);const Ye=We.current;Ye&&document.contains(Ye)&&Ye.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var be;C!=="fade"&&(Ne.current=((be=xe[b])==null?void 0:be.entryIndex)??0,k(),re(null),ye(!1),me(void 0),q(void 0))},[b,k,xe,C]),s.useEffect(()=>{const be=Ye=>{if(Ye.key==="Escape"){Te();return}if(Ye.key==="ArrowLeft"&&xe.length>1){at(b-1);return}if(Ye.key==="ArrowRight"&&xe.length>1){at(b+1);return}if(Ye.key==="Tab"&&De.current){const R=De.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),oe=Array.from(R).filter(Qe=>!Qe.closest('[aria-hidden="true"]'));if(oe.length===0)return;const fe=oe[0],Le=oe[oe.length-1],Ge=document.activeElement;Ye.shiftKey?(Ge===fe||!De.current.contains(Ge))&&(Ye.preventDefault(),Le.focus()):(Ge===Le||!De.current.contains(Ge))&&(Ye.preventDefault(),fe.focus())}};return window.addEventListener("keydown",be),()=>window.removeEventListener("keydown",be)},[at,Te,b,xe.length]),s.useLayoutEffect(()=>{k(),J.current=0,Ce(0),Q(null),we(!1),re(null),ye(!1),me(void 0),q(void 0),ke(null),M(be=>{const Ye=Math.max(0,xe.length-1);return Math.min(be,Ye)})},[k,t.length,x,xe.length]),s.useLayoutEffect(()=>{var R;const be=Math.max(0,xe.length-1),Ye=Math.min(Math.max(0,l),be);Fe.current=Ye,Ne.current=((R=xe[Ye])==null?void 0:R.entryIndex)??0,M(Ye)},[l]);const vt=$e!==null?t[$e]:null,wt=Z!==null?xe[Z]:null,Bt=(V==null?void 0:V.title1)||(V==null?void 0:V.title2)||(V==null?void 0:V.title3)||(vt==null?void 0:vt.title1)||(vt==null?void 0:vt.title2)||(vt==null?void 0:vt.title3),At=Wf(x,xe,t),xt=T!==null,Ft=Bt||At||xt,Nt=At&&xt?{gap:K}:void 0,Ut=`${e}-titles-stack${ne?` ${e}-titles-stack-stacked`:""}`,Jt=`${e}-titles-layer-out${ne?` ${e}-titles-layer-out-stacked`:""}`,Tt=`${e}-titles-layer-out`,Wt=(W??0)>0||o,rn=Y(I),gt=s.useMemo(()=>({title1Width:y??Yi.title1Width,title2Width:S??Yi.title2Width,title3Width:G??Yi.title3Width}),[y,S,G]),Ee=s.useMemo(()=>({title2MarginLeft:U,title3MarginLeft:H}),[U,H]),Xe=s.useMemo(()=>V?Kn(e,V,F,pe,j):[],[e,V,F,pe,j]),lt=s.useMemo(()=>Xe.map(be=>gt[be.widthKey]),[Xe,gt]),ht=s.useMemo(()=>Qi(Xe.length,lt),[Xe.length,lt]),ft=s.useMemo(()=>Ho(Xe.length,lt),[Xe.length,lt]),Lt=s.useMemo(()=>Xe.filter(be=>be.prefix==="title1"),[Xe]),mt=s.useMemo(()=>Xe.filter(be=>be.prefix==="title2"||be.prefix==="title3"),[Xe]),zt=s.useMemo(()=>Zn(Lt,gt),[Lt,gt]),kt=s.useMemo(()=>Zn(mt,gt),[mt,gt]),Mt=s.useCallback((be,Ye)=>{const R=Xe.findIndex(fe=>fe.prefix===be.prefix);if(!ne||Ye==="single-row")return{effectiveWidth:ft[R]??0,resolvedWidth:ht[R]??0,maxWidth:cn(R,ht)};if(Ye==="two-row-top"){const fe=Lt.findIndex(Le=>Le.prefix===be.prefix);return{effectiveWidth:zt.effective[fe]??0,resolvedWidth:zt.resolved[fe]??0,maxWidth:cn(fe,zt.resolved)}}const oe=mt.findIndex(fe=>fe.prefix===be.prefix);return{effectiveWidth:kt.effective[oe]??0,resolvedWidth:kt.resolved[oe]??0,maxWidth:cn(oe,kt.resolved)}},[Xe,mt,kt,ft,ht,Lt,zt,ne]),Vt=s.useCallback(be=>Fd(Xe,ht,Ee,be)+(ne?0:W??0),[Xe,ht,Ee,ne,W]),Gt=s.useCallback(()=>ne?0:W??0,[ne,W]),Ht=s.useCallback(be=>mt.slice(0,be).reduce((Ye,R,oe)=>Ye+(R.marginLeftKey?Ee[R.marginLeftKey]??0:0)+(kt.resolved[oe]??0),0),[mt,kt.resolved,Ee]),Dt=s.useCallback(be=>{const Ye=mt[be];return Ht(be)+(Ye.marginLeftKey?Ee[Ye.marginLeftKey]??0:0)+(kt.resolved[be]??0)},[mt,kt.resolved,Ht,Ee]),_t=s.useCallback((be,Ye,R)=>{if(!ne||R==="single-row"){const Qe=be.findIndex(Qt=>Qt.prefix===Ye.prefix),bt=be.map(Qt=>gt[Qt.widthKey]),Rt=Qi(be.length,bt);return{effectiveWidth:Ho(be.length,bt)[Qe]??0,resolvedWidth:Rt[Qe]??0,maxWidth:cn(Qe,Rt)}}if(R==="two-row-top"){const Qe=be.filter(Qt=>Qt.prefix==="title1"),bt=Qe.findIndex(Qt=>Qt.prefix===Ye.prefix),{resolved:Rt,effective:tn}=Zn(Qe,gt);return{effectiveWidth:tn[bt]??0,resolvedWidth:Rt[bt]??0,maxWidth:cn(bt,Rt)}}const oe=be.filter(Qe=>Qe.prefix==="title2"||Qe.prefix==="title3"),fe=oe.findIndex(Qe=>Qe.prefix===Ye.prefix),{resolved:Le,effective:Ge}=Zn(oe,gt);return{effectiveWidth:Ge[fe]??0,resolvedWidth:Le[fe]??0,maxWidth:cn(fe,Le)}},[gt,ne]),Ct=(be,Ye,R)=>{const oe=be.marginLeftKey?Ee[be.marginLeftKey]??0:0,{effectiveWidth:fe,resolvedWidth:Le,maxWidth:Ge}=R??Mt(be,Ye),Qe=Math.max(oe,Un),bt=o&&Ye==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":be.prefix,style:{width:Y(fe),...oe>0?{marginLeft:Y(oe)}:{}},children:[a.jsx("p",{className:be.className,style:be.style,children:be.text}),bt&&be.marginLeftKey?a.jsx("div",{"data-controls":be.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Le),style:{position:"absolute",top:0,left:Y(-oe),width:Y(Qe),height:"100%",pointerEvents:"auto"}}):null,bt?a.jsx("div",{"data-controls":be.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ge),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:Y(-fn/2),width:Y(fn),height:"100%",pointerEvents:"auto"}}):null]},be.className)},N=(be="two-row")=>{const Ye=Xe.findIndex(fe=>fe.prefix==="title1"),R=Ye>=0?ht[Ye]:gt.title1Width,oe=be==="two-row"&&o;return a.jsx("div",{...oe?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(R)}:{},style:{width:Y(W??0),flexShrink:0,alignSelf:"stretch",...oe?{pointerEvents:"auto"}:{}}})},Re=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:F,"aria-hidden":"true",children:" "}),Ae=()=>a.jsx("span",{className:`${e}-entry-counter`,style:se,"aria-live":"polite","aria-atomic":"true",children:Nf(xe,b,x,t)}),ze=()=>At?o&&xt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Ae(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Ra(K)} + ${K}))`,width:Ra(K),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Ae():null,ct=()=>!At&&!xt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Nt,children:[ze(),xt?yt():null]}),Et=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||Bt?Re():null,Wt?N("single-row"):null,It(V),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),ct(),$n()]}),it=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||Bt?Re():null,Wt?N("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:ge&&X?{minHeight:X}:void 0,children:[a.jsx("div",{ref:tt,className:Ut,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:di(de||V)}),a.jsxs("div",{ref:dt,className:Ut,style:{position:ge?"absolute":"relative",inset:ge?0:void 0,width:"100%",...ge&&ae?{width:ae,maxWidth:"100%"}:void 0},children:[vt&&ge?a.jsx("div",{className:`${Jt} ${e}-titles-fade-out`,children:di(vt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${ge?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:di(V)})]})]}),ct(),$n()]}),yt=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:D.scalingValue(A??0,i),height:D.scalingValue(A??0,i),marginRight:le,"--close-icon-hover-color":g},children:[a.jsx("button",{ref:Ie,type:"button",className:`${e}-close-icon-inner`,onClick:Te,"aria-label":"Close",children:a.jsx(sn,{url:T??"",fill:_,hoverFill:i&&!r?_:g,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:le,height:"100%",pointerEvents:"auto"}})]}),Ot=(be,Ye)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[At||Bt?Re():null,Wt?N("two-row"):null,Ye!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Ye},children:be}):a.jsxs(a.Fragment,{children:[be,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),ct()]}),It=be=>{if(!be)return null;const Ye=Kn(e,be,F,pe,j);return a.jsx(a.Fragment,{children:Ye.map(R=>Ct(R,"single-row",_t(Ye,R,"single-row")))})},nn=be=>{if(!be)return null;const Ye=Kn(e,be,F,pe,j),R=Ye.find(oe=>oe.prefix==="title1");return R?Ct(R,"two-row-top",_t(Ye,R,"two-row-top")):null},un=(be,Ye=!1)=>{const R=be?Kn(e,be,F,pe,j):[],oe=R.filter(Ge=>Ge.prefix==="title2"||Ge.prefix==="title3"),fe=o&&Ye;return oe.length>0||fe||(I??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[oe.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[oe.map(Ge=>Ct(Ge,"two-row-bottom",_t(R,Ge,"two-row-bottom"))),Ye&&o?a.jsxs(a.Fragment,{children:[pa(),ma()]}):null]}):null,(I??0)>0||fe?a.jsx("div",{"data-controls":fe?"titleRowMarginBottom":void 0,"data-controls-axis":fe?"y":void 0,"data-controls-reverse":fe?"":void 0,className:fe?`${e}-control`:void 0,style:{height:rn,width:"100%",flexShrink:0,pointerEvents:fe?"auto":"none"}}):null]}):null},ci=(be,Ye=!1)=>a.jsxs(a.Fragment,{children:[Ot(nn(be)),un(be,Ye)]}),di=be=>ne?a.jsx("div",{className:`${e}-titles-row-two-row`,children:ci(be)}):be?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:It(be)}):null,nr=()=>{const be=ne?-1:Xe.findIndex(oe=>oe.prefix==="title1"),Ye=!ne&&(o||(W??0)>0)?(()=>{const oe=W??0,fe=be>=0?ht[be]:gt.title1Width,Le=Math.max(oe,Un);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:Y(Le),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,R=Xe.flatMap((oe,fe)=>{if(!oe.marginLeftKey)return[];const Le=Ee[oe.marginLeftKey]??0,Ge=Ad(Xe,ht,Ee,fe)+Gt(),Qe=Math.max(Le,Un);return a.jsx("div",{"data-controls":oe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ht[fe]),style:{position:"absolute",top:0,left:Y(Ge),width:Y(Qe),height:"100%",pointerEvents:"auto"}},oe.marginLeftKey)});return Ye?[Ye,...R]:R},ir=()=>Xe.map((be,Ye)=>{const R=cn(Ye,ht),fe=Vt(Ye)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":be.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(R),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:Y(fe),width:Y(fn),height:"100%",pointerEvents:"auto"}})},`${be.widthKey}-junction`)}),pa=()=>mt.flatMap((be,Ye)=>{if(!be.marginLeftKey)return[];const R=Ee[be.marginLeftKey]??0,oe=Ht(Ye),fe=Math.max(R,Un),{resolvedWidth:Le}=Mt(be,"two-row-bottom");return a.jsx("div",{"data-controls":be.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Le),style:{position:"absolute",top:0,left:Y(oe),width:Y(fe),height:"100%",pointerEvents:"auto"}},be.marginLeftKey)}),ma=()=>mt.map((be,Ye)=>{const{maxWidth:R}=Mt(be,"two-row-bottom"),fe=Dt(Ye)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":be.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(R),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:Y(fe),width:Y(fn),height:"100%",pointerEvents:"auto"}})},`${be.widthKey}-junction`)}),$n=()=>!o||ne?null:a.jsxs(a.Fragment,{children:[nr(),ir()]}),Pi=be=>{const Ye=!be.objectFit&&Dn(w);return{className:`${e}-slide-image-cell${Ye?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:L,maxHeight:O,...Ye?{"--image-aspect-ratio":da(w)}:{}}}},or=be=>be.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":be.objectFit}}:Dn(w)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ui=be=>{if(be.length===0)return null;const Ye=be.length>1,R=Ra(ie),oe=`calc(-0.5 * (${R} + ${ie}))`;if(be.length===1){const fe=be[0];return a.jsx("div",{...Pi(fe),children:a.jsx("img",{...or(fe),src:fe.url,alt:fe.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:Ye?{gap:ie}:void 0,children:be.map((fe,Le)=>a.jsxs("div",{...Pi(fe),children:[a.jsx("img",{...or(fe),src:fe.url,alt:fe.name??"",draggable:!1}),o&&Ye&&Le<be.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:oe,width:R,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${fe.url}-${Le}`))})},rr=!!(V!=null&&V.title2||V!=null&&V.title3||vt!=null&&vt.title2||vt!=null&&vt.title3||(I??0)>0||o),ga=()=>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:tt,className:Ut,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ci(de||V)}),a.jsxs("div",{ref:dt,className:`${e}-titles-row-two-row`,style:{...ge&&X?{minHeight:X}:void 0,...ge&&ae?{width:ae,maxWidth:"100%"}:void 0},children:[Ot(a.jsxs("div",{className:Ut,style:{position:ge?"absolute":"relative",inset:ge?0:void 0,width:"100%"},children:[vt&&ge?a.jsx("div",{className:`${Tt} ${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(V)})]}),ge&&X?X:void 0),rr?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[vt&&ge?a.jsx("div",{className:`${Jt} ${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`:""}${ne?` ${e}-titles-layer-in-stacked`:""}`,children:un(V,!0)})]}):null]})]}),ha=()=>{const be=rr;return a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...be?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:be?void 0:{flex:"0 0 auto",height:"auto"},children:ci(V,!0)}),$n()]})};return a.jsxs("div",{ref:De,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{Be||Te()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:xt?void 0:-1,style:{opacity:Se?1:0,transition:"opacity 300ms ease",pointerEvents:Se?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:m,...Ve}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:qe,..._e,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:rt,onClick:be=>be.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":ve&&xe.length>1?"true":"false",onPointerDown:ve?St:void 0,onPointerUp:ve?Yt:void 0,onPointerCancel:ve?Zt:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[wt&&ce?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:be=>{be.target===be.currentTarget&&ee(Pe)},children:a.jsx("div",{className:`${e}-slide-area`,children:ui(wt.images)})},`slide-out-${Pe}`):null,a.jsx("div",{className:`${e}-slide-layer-in${ce?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:E?ui(E.images):null})},`slide-in-${Pe}-${b}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Ze,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:ue,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...ne?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${ne?` ${e}-lightbox-content-area-stacked`:""}`,children:Ft&&a.jsx("div",{className:`${e}-text-bar-cell${ne?` ${e}-text-bar-cell-stacked`:""}`,style:ne?void 0:{flex:1,minWidth:0,width:"100%"},children:ne?C==="fade"?ga():ha():C==="fade"?it():Et()})})})]})]})]})};function xv(e){return`
15161
15161
  .${e}-wrapper {
15162
15162
  position: relative;
15163
15163
  width: 100%;
@@ -15679,7 +15679,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
15679
15679
  pointer-events: auto;
15680
15680
  z-index: 10;
15681
15681
  }
15682
- `}const xv=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r,metadata:l})=>{const{prefix:d}=D.useScopedStyles(),c=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:x}=e,w=s.useRef(null),[m,h]=s.useState(!1),[f,v]=s.useState(0),C=s.useRef(!1),y=s.useRef(!1),S=s.useRef(!1),V=s.useMemo(()=>(t??[]).filter($=>Ji($).length>0),[t]),N=m&&V.length>0,q=!n,W=s.useCallback(()=>{q&&(S.current=!0,Ef(y.current,c),y.current=!1)},[q,c]),I=($=0)=>{if(V.length===0||n&&!i&&!o)return;const T=Er(V,x),k=Math.max(0,Math.min($,T.length-1));if(v(k),q){const F=Ed();Pd(k+1,c,F),y.current=!F}h(!0)},B=s.useCallback(()=>{h(!1),S.current=!1},[]);return s.useEffect(()=>{!n||i||o||h(!1)},[n,i,o]),s.useEffect(()=>{if(!q||C.current)return;C.current=!0;const $=Al(c);if(!$)return;const T=Fl($,Er(V,x).length);T<0||(v(T),h(!0))},[V,c,q,x]),s.useEffect(()=>{if(!q)return;const $=()=>{if(S.current){S.current=!1,h(!1);return}const T=Al(c);if(!T){h(!1);return}const k=Fl(T,Er(V,x).length);if(k<0){h(!1);return}y.current=!1,v(k),h(!0)};return window.addEventListener("popstate",$),()=>window.removeEventListener("popstate",$)},[V,c,q,x]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:w,className:`${d}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:yv(d)}}),u?a.jsx("button",{type:"button",className:`${d}-cover ${Dn(p)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>I(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...Dn(p)?{"--image-aspect-ratio":da(p)}:{}},"aria-label":"Open journal gallery",children:a.jsx("img",{className:`${d}-cover-image ${Dn(p)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),N&&typeof document<"u"&&(()=>{const $=(r?document.getElementById(r):null)??document.body;return zn.createPortal(a.jsx(fv,{prefix:d,entries:V,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:f,enableUrlSync:q,journalItemId:c,onBeforeClose:W,onClose:B}),$)})()]})},vv=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
15682
+ `}const vv=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r,metadata:l})=>{const{prefix:d}=D.useScopedStyles(),c=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:x}=e,w=s.useRef(null),[m,h]=s.useState(!1),[f,v]=s.useState(0),C=s.useRef(!1),y=s.useRef(!1),S=s.useRef(!1),G=s.useMemo(()=>(t??[]).filter($=>Ji($).length>0),[t]),W=m&&G.length>0,U=!n,H=s.useCallback(()=>{U&&(S.current=!0,Mf(y.current,c),y.current=!1)},[U,c]),I=($=0)=>{if(G.length===0||n&&!i&&!o)return;const T=Er(G,x),A=Math.max(0,Math.min($,T.length-1));if(v(A),U){const _=Md();Ed(A+1,c,_),y.current=!_}h(!0)},z=s.useCallback(()=>{h(!1),S.current=!1},[]);return s.useEffect(()=>{!n||i||o||h(!1)},[n,i,o]),s.useEffect(()=>{if(!U||C.current)return;C.current=!0;const $=Al(c);if(!$)return;const T=Fl($,Er(G,x).length);T<0||(v(T),h(!0))},[G,c,U,x]),s.useEffect(()=>{if(!U)return;const $=()=>{if(S.current){S.current=!1,h(!1);return}const T=Al(c);if(!T){h(!1);return}const A=Fl(T,Er(G,x).length);if(A<0){h(!1);return}y.current=!1,v(A),h(!0)};return window.addEventListener("popstate",$),()=>window.removeEventListener("popstate",$)},[G,c,U,x]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:w,className:`${d}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:xv(d)}}),u?a.jsx("button",{type:"button",className:`${d}-cover ${Dn(p)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>I(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...Dn(p)?{"--image-aspect-ratio":da(p)}:{}},"aria-label":"Open journal gallery",children:a.jsx("img",{className:`${d}-cover-image ${Dn(p)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),W&&typeof document<"u"&&(()=>{const $=(r?document.getElementById(r):null)??document.body;return zn.createPortal(a.jsx(yv,{prefix:d,entries:G,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:f,enableUrlSync:U,journalItemId:c,onBeforeClose:H,onClose:z}),$)})()]})},bv=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
15683
15683
  import { createPortal } from 'react-dom';
15684
15684
  import { CommonComponentProps } from '../props';
15685
15685
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -16435,7 +16435,7 @@ export type LightboxJournalSettings = {
16435
16435
  closeIconColor: string;
16436
16436
  closeIconHoverColor: string;
16437
16437
  };
16438
- `,bv="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>'),yi={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 wv(e){const t={};return t[at(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[at(e,"fontSettings")]={...yi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[at(e,"fontSize")]={...yi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[at(e,"lineHeight")]={...yi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[at(e,"letterSpacing")]={...yi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[at(e,"wordSpacing")]={...yi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[at(e,"textAlign")]={...yi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[at(e,"textAppearance")]={...yi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Sv=oi.reduce((e,t)=>({...e,...wv(t)}),{}),Cv=oi.reduce((e,t)=>({...e,[at(t,"fontFamily")]:"Goudy Bookletter 1911",[at(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[at(t,"letterSpacing")]:0,[at(t,"wordSpacing")]:0,[at(t,"textAlign")]:"left",[at(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Ha(e){return oi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[at(n,"fontSize")]=i),o!==void 0&&(t[at(n,"lineHeight")]=o),t},{})}const $v=Wf(),Tv={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"}}},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["A","B"]},maxHeight:{type:"number",scope:"layout",title:"Max Height (%)",min:0,max:100,display:{type:"percentage-input"}},maxWidth:{type:"number",scope:"layout",title:"Max Width (%)",min:0,max:100,display:{type:"percentage-input"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control",visible:!1}},backgroundColor:{type:"string",scope:"common",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:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},textTransition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["none","fade"]}},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"}},countCloseGap:{type:"number",scope:"layout",title:"Count / Close Gap",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"}},countColor:{type:"string",scope:"common",title:"Count Default",display:{type:"palette-color-picker"}},...Sv,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",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:bv,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...Cv,countFontFamily:"Arial"},layoutDefaults:{m:{type:"B",imageGap:.01,maxHeight:80,maxWidth:80,closeIconMaxWidth:.08,contentMarginTop:.04,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.55,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,iconMarginRight:.01,countCloseGap:.04,...Ha({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04,countFontSize:.04,countLineHeight:.04})},t:{type:"A",imageGap:.05,maxHeight:80,maxWidth:40,closeIconMaxWidth:.03,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.16,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.03,...Ha({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208,countFontSize:.0208,countLineHeight:.0208})},d:{type:"A",maxHeight:80,maxWidth:40,imageGap:.05,closeIconMaxWidth:.0125,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.02,...Ha({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098,countFontSize:.008,countLineHeight:.0098})}},layout:["__componentName__","maxWidth","maxHeight","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","countCloseGap","contentMarginTop","iconMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["type"]},{type:"row",title:"Image",items:["maxWidth","maxHeight"]},{type:"row",title:"Text",items:["textTransition"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover Image",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[$v]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","countColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemWithoutImage:!0},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"}},image:{type:"object",label:"Image",max:2,display:{type:"media-list-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]}}},default:[{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"contain"},{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"},{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"}]}]}},Iv={element:xv,id:"lightbox-journal",name:"Journal",category:"galleries",version:1,defaultSize:{d:{width:350},t:{width:300},m:{width:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Journal.png"},schema:Tv,sourceCode:vv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...oi.map(e=>({path:`${at(e,"fontFamily")}`}))]},fontRelations:{...oi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${at(t,"fontFamily")}`}),{})}},Rv={sizeType:"custom",value:700,min:400,max:700};function jr(e,t){return{widthPx:e,heightPx:e*t}}function cs(e,t,n,i,o,r){return{x:Math.min(Math.max(e,o/2),n-o/2),y:Math.min(Math.max(t,r/2),i-r/2)}}function sc(e,t,n,i){const{heightPx:o}=jr(n,i);return cs(e/2,t/2,e,t,n,o)}function Kd(e,t,n){for(const i of n){const{heightPx:o}=jr(i.widthPx,i.aspectRatio),r=i.widthPx/2,l=o/2;if(e>=i.x-r&&e<=i.x+r&&t>=i.y-l&&t<=i.y+l)return!0}return!1}function Lv(e,t,n,i,o,r,l,d){if(o==="system")return"none";const c=i.getBoundingClientRect(),u=document.elementFromPoint(c.left+e,c.top+t);return u&&u.closest("a")?"none":Kd(e,t,n)||r==="area"?l??"none":d??"none"}function lc(e,t,n){var d;const{sizeType:i,value:o,min:r,max:l}=t;return i==="custom"?o:i==="as is"?((d=n.get(e))==null?void 0:d.naturalWidth)??o:Math.round(Math.random()*(l-r)+r)}function Pv(e){return`
16438
+ `,wv="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>'),yi={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[ot(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[ot(e,"fontSettings")]={...yi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[ot(e,"fontSize")]={...yi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[ot(e,"lineHeight")]={...yi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[ot(e,"letterSpacing")]={...yi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[ot(e,"wordSpacing")]={...yi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[ot(e,"textAlign")]={...yi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[ot(e,"textAppearance")]={...yi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Cv=oi.reduce((e,t)=>({...e,...Sv(t)}),{}),$v=oi.reduce((e,t)=>({...e,[ot(t,"fontFamily")]:"Goudy Bookletter 1911",[ot(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[ot(t,"letterSpacing")]:0,[ot(t,"wordSpacing")]:0,[ot(t,"textAlign")]:"left",[ot(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Ha(e){return oi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[ot(n,"fontSize")]=i),o!==void 0&&(t[ot(n,"lineHeight")]=o),t},{})}const Tv=Hf(),Iv={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"}}},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["A","B"]},maxHeight:{type:"number",scope:"layout",title:"Max Height (%)",min:0,max:100,display:{type:"percentage-input"}},maxWidth:{type:"number",scope:"layout",title:"Max Width (%)",min:0,max:100,display:{type:"percentage-input"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control",visible:!1}},backgroundColor:{type:"string",scope:"common",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:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},textTransition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["none","fade"]}},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"}},countCloseGap:{type:"number",scope:"layout",title:"Count / Close Gap",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"}},countColor:{type:"string",scope:"common",title:"Count Default",display:{type:"palette-color-picker"}},...Cv,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",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:wv,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...$v,countFontFamily:"Arial"},layoutDefaults:{m:{type:"B",imageGap:.01,maxHeight:80,maxWidth:80,closeIconMaxWidth:.08,contentMarginTop:.04,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.55,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,iconMarginRight:.01,countCloseGap:.04,...Ha({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04,countFontSize:.04,countLineHeight:.04})},t:{type:"A",imageGap:.05,maxHeight:80,maxWidth:40,closeIconMaxWidth:.03,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.16,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.03,...Ha({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208,countFontSize:.0208,countLineHeight:.0208})},d:{type:"A",maxHeight:80,maxWidth:40,imageGap:.05,closeIconMaxWidth:.0125,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.02,...Ha({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098,countFontSize:.008,countLineHeight:.0098})}},layout:["__componentName__","maxWidth","maxHeight","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","countCloseGap","contentMarginTop","iconMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["type"]},{type:"row",title:"Image",items:["maxWidth","maxHeight"]},{type:"row",title:"Text",items:["textTransition"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover Image",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[Tv]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","countColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemWithoutImage:!0},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"}},image:{type:"object",label:"Image",max:2,display:{type:"media-list-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]}}},default:[{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"contain"},{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"},{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"}]}]}},Rv={element:vv,id:"lightbox-journal",name:"Journal",category:"galleries",version:1,defaultSize:{d:{width:350},t:{width:300},m:{width:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Journal.png"},schema:Iv,sourceCode:bv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...oi.map(e=>({path:`${ot(e,"fontFamily")}`}))]},fontRelations:{...oi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${ot(t,"fontFamily")}`}),{})}},Lv={sizeType:"custom",value:700,min:400,max:700};function jr(e,t){return{widthPx:e,heightPx:e*t}}function cs(e,t,n,i,o,r){return{x:Math.min(Math.max(e,o/2),n-o/2),y:Math.min(Math.max(t,r/2),i-r/2)}}function sc(e,t,n,i){const{heightPx:o}=jr(n,i);return cs(e/2,t/2,e,t,n,o)}function Zd(e,t,n){for(const i of n){const{heightPx:o}=jr(i.widthPx,i.aspectRatio),r=i.widthPx/2,l=o/2;if(e>=i.x-r&&e<=i.x+r&&t>=i.y-l&&t<=i.y+l)return!0}return!1}function Pv(e,t,n,i,o,r,l,d){if(o==="system")return"none";const c=i.getBoundingClientRect(),u=document.elementFromPoint(c.left+e,c.top+t);return u&&u.closest("a")?"none":Zd(e,t,n)||r==="area"?l??"none":d??"none"}function lc(e,t,n){var d;const{sizeType:i,value:o,min:r,max:l}=t;return i==="custom"?o:i==="as is"?((d=n.get(e))==null?void 0:d.naturalWidth)??o:Math.round(Math.random()*(l-r)+r)}function Ev(e){return`
16439
16439
  .${e}-root {
16440
16440
  position: absolute;
16441
16441
  top: 0;
@@ -16470,7 +16470,7 @@ export type LightboxJournalSettings = {
16470
16470
  width: 32px;
16471
16471
  height: 32px;
16472
16472
  }
16473
- `}function Ev(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 Mv(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await Ev(i)]));return new Map(n)}function kv({settings:e,content:t=[],isEditor:n}){const{prefix:i}=D.useScopedStyles(),[o,r]=s.useState(null),[l,d]=s.useState([]),[c,u]=s.useState(0),p=s.useRef(0),[x,w]=s.useState({x:0,y:0}),[m,h]=s.useState("none"),f=s.useRef({x:0,y:0}),[v,C]=s.useState(!1),[y,S]=s.useState(!1),V=s.useRef(new Map),{imageSize:N=Rv,cursor:q="system",target:W="area",position:I="random",visible:B="all",defaultCursor:$=null,hoverCursor:T=null}=e,k=t.filter(L=>{var H;return!!((H=L==null?void 0:L.image)!=null&&H.url)}),F=s.useMemo(()=>Pv(i),[i]),g=s.useCallback((L,H,U=l)=>{if(!o)return;const de=o.getBoundingClientRect(),ae=L-de.left,A=H-de.top;w({x:ae,y:A}),h(Lv(ae,A,U,o,q,W,T,$))},[o,l,q,W,T,$]);s.useEffect(()=>{const L=[...k.map(U=>U.image.url),$,T].filter(U=>!!U);if(L.length===0){V.current=new Map,S(!0);return}let H=!1;return S(!1),Mv(L).then(U=>{H||(V.current=U,S(!0))}),()=>{H=!0}},[t,$,T]),s.useEffect(()=>{if(!o)return;const L=U=>{U.stopPropagation(),f.current={x:U.clientX,y:U.clientY},g(U.clientX,U.clientY)},H=()=>{v&&g(f.current.x,f.current.y)};return o.addEventListener("mousemove",L),window.addEventListener("scroll",H,!0),()=>{o.removeEventListener("mousemove",L),window.removeEventListener("scroll",H,!0)}},[o,v,g]),s.useEffect(()=>{!o||!v||g(f.current.x,f.current.y)},[l,o,v,g]),s.useEffect(()=>{v||h("none")},[v]);const O=(L,H,U,de={})=>{var ee,xe;if(!((ee=L==null?void 0:L.image)!=null&&ee.url))return null;const ae=((xe=V.current.get(L.image.url))==null?void 0:xe.aspectRatio)??1,A=lc(L.image.url,N,V.current),{heightPx:ce}=jr(A,ae);let z=0,re=0;return I==="same"?{x:z,y:re}=sc(H,U,A,ae):(z=de.x??Math.random()*H,re=de.y??Math.random()*U,{x:z,y:re}=cs(z,re,H,U,A,ce)),{id:p.current++,url:L.image.url,link:L.link,name:L.image.name,x:z,y:re,xRatio:z/H,yRatio:re/U,aspectRatio:ae,widthPx:A}},P=()=>{if(!o)return;const L=o.getBoundingClientRect(),H=L.width,U=L.height;H===0||U===0||d(de=>de.length===0?de:de.map(ae=>{const A=N.sizeType==="random"?ae.widthPx:lc(ae.url,N,V.current),{heightPx:ce}=jr(A,ae.aspectRatio);if(I==="same"){const{x:ee,y:xe}=sc(H,U,A,ae.aspectRatio);return{...ae,x:ee,y:xe,widthPx:A}}const{x:z,y:re}=cs(ae.xRatio*H,ae.yRatio*U,H,U,A,ce);return{...ae,x:z,y:re,widthPx:A}}))};s.useEffect(()=>{if(!o||k.length===0||!y)return;const L=o.getBoundingClientRect(),H=L.width,U=L.height,de=O(k[0],H,U);de&&(d([de]),u(k.length>1?1:0))},[N,I,o,t,y]),s.useEffect(()=>{if(!o)return;P();const L=new ResizeObserver(P);return L.observe(o),window.addEventListener("resize",P),()=>{L.disconnect(),window.removeEventListener("resize",P)}},[o,I,N,l.length]),s.useEffect(()=>{B==="last One"&&d(L=>L.length>0?[L[L.length-1]]:[])},[B]);const X=L=>{if(!o||k.length===0||!y)return;const H=o.getBoundingClientRect(),U=L.clientX-H.left,de=L.clientY-H.top;if(W==="image"&&!Kd(U,de,l))return;let ae=0,A=0;I==="on Click"?(ae=U,A=de):I==="same"?(ae=H.width/2,A=H.height/2):(ae=Math.random()*H.width,A=Math.random()*H.height);const ce=k[c%k.length],z=O(ce,H.width,H.height,{x:ae,y:A});if(!z)return;const re=B==="all"?[...l,z]:[z];d(re),u(ee=>(ee+1)%k.length),g(L.clientX,L.clientY,re)},te=q==="custom"&&m!=="none";return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:F}}),a.jsxs("div",{ref:r,onClick:X,onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),className:`${i}-root`,style:{cursor:te?"none":"default"},children:[l.map(L=>a.jsx("div",{className:`${i}-wrapper`,style:{top:`${L.y}px`,left:`${L.x}px`,width:`${L.widthPx}px`,cursor:te?"none":"default"},children:W==="area"&&L.link?a.jsx("a",{href:L.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:a.jsx("img",{src:L.url,alt:L.name,className:`${i}-image`})}):a.jsx("img",{src:L.url,alt:L.name,className:`${i}-image`})},L.id)),v&&te&&a.jsx("div",{className:`${i}-cursor`,style:{left:`${x.x}px`,top:`${x.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${m}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const Av=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
16473
+ `}function Mv(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 kv(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await Mv(i)]));return new Map(n)}function Av({settings:e,content:t=[],isEditor:n}){const{prefix:i}=D.useScopedStyles(),[o,r]=s.useState(null),[l,d]=s.useState([]),[c,u]=s.useState(0),p=s.useRef(0),[x,w]=s.useState({x:0,y:0}),[m,h]=s.useState("none"),f=s.useRef({x:0,y:0}),[v,C]=s.useState(!1),[y,S]=s.useState(!1),G=s.useRef(new Map),{imageSize:W=Lv,cursor:U="system",target:H="area",position:I="random",visible:z="all",defaultCursor:$=null,hoverCursor:T=null}=e,A=t.filter(L=>{var O;return!!((O=L==null?void 0:L.image)!=null&&O.url)}),_=s.useMemo(()=>Ev(i),[i]),g=s.useCallback((L,O,K=l)=>{if(!o)return;const ue=o.getBoundingClientRect(),le=L-ue.left,F=O-ue.top;w({x:le,y:F}),h(Pv(le,F,K,o,U,H,T,$))},[o,l,U,H,T,$]);s.useEffect(()=>{const L=[...A.map(K=>K.image.url),$,T].filter(K=>!!K);if(L.length===0){G.current=new Map,S(!0);return}let O=!1;return S(!1),kv(L).then(K=>{O||(G.current=K,S(!0))}),()=>{O=!0}},[t,$,T]),s.useEffect(()=>{if(!o)return;const L=K=>{K.stopPropagation(),f.current={x:K.clientX,y:K.clientY},g(K.clientX,K.clientY)},O=()=>{v&&g(f.current.x,f.current.y)};return o.addEventListener("mousemove",L),window.addEventListener("scroll",O,!0),()=>{o.removeEventListener("mousemove",L),window.removeEventListener("scroll",O,!0)}},[o,v,g]),s.useEffect(()=>{!o||!v||g(f.current.x,f.current.y)},[l,o,v,g]),s.useEffect(()=>{v||h("none")},[v]);const B=(L,O,K,ue={})=>{var ne,ve;if(!((ne=L==null?void 0:L.image)!=null&&ne.url))return null;const le=((ve=G.current.get(L.image.url))==null?void 0:ve.aspectRatio)??1,F=lc(L.image.url,W,G.current),{heightPx:pe}=jr(F,le);let j=0,se=0;return I==="same"?{x:j,y:se}=sc(O,K,F,le):(j=ue.x??Math.random()*O,se=ue.y??Math.random()*K,{x:j,y:se}=cs(j,se,O,K,F,pe)),{id:p.current++,url:L.image.url,link:L.link,name:L.image.name,x:j,y:se,xRatio:j/O,yRatio:se/K,aspectRatio:le,widthPx:F}},P=()=>{if(!o)return;const L=o.getBoundingClientRect(),O=L.width,K=L.height;O===0||K===0||d(ue=>ue.length===0?ue:ue.map(le=>{const F=W.sizeType==="random"?le.widthPx:lc(le.url,W,G.current),{heightPx:pe}=jr(F,le.aspectRatio);if(I==="same"){const{x:ne,y:ve}=sc(O,K,F,le.aspectRatio);return{...le,x:ne,y:ve,widthPx:F}}const{x:j,y:se}=cs(le.xRatio*O,le.yRatio*K,O,K,F,pe);return{...le,x:j,y:se,widthPx:F}}))};s.useEffect(()=>{if(!o||A.length===0||!y)return;const L=o.getBoundingClientRect(),O=L.width,K=L.height,ue=B(A[0],O,K);ue&&(d([ue]),u(A.length>1?1:0))},[W,I,o,t,y]),s.useEffect(()=>{if(!o)return;P();const L=new ResizeObserver(P);return L.observe(o),window.addEventListener("resize",P),()=>{L.disconnect(),window.removeEventListener("resize",P)}},[o,I,W,l.length]),s.useEffect(()=>{z==="last One"&&d(L=>L.length>0?[L[L.length-1]]:[])},[z]);const Y=L=>{if(!o||A.length===0||!y)return;const O=o.getBoundingClientRect(),K=L.clientX-O.left,ue=L.clientY-O.top;if(H==="image"&&!Zd(K,ue,l))return;let le=0,F=0;I==="on Click"?(le=K,F=ue):I==="same"?(le=O.width/2,F=O.height/2):(le=Math.random()*O.width,F=Math.random()*O.height);const pe=A[c%A.length],j=B(pe,O.width,O.height,{x:le,y:F});if(!j)return;const se=z==="all"?[...l,j]:[j];d(se),u(ne=>(ne+1)%A.length),g(L.clientX,L.clientY,se)},ie=U==="custom"&&m!=="none";return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:_}}),a.jsxs("div",{ref:r,onClick:Y,onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),className:`${i}-root`,style:{cursor:ie?"none":"default"},children:[l.map(L=>a.jsx("div",{className:`${i}-wrapper`,style:{top:`${L.y}px`,left:`${L.x}px`,width:`${L.widthPx}px`,cursor:ie?"none":"default"},children:H==="area"&&L.link?a.jsx("a",{href:L.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:a.jsx("img",{src:L.url,alt:L.name,className:`${i}-image`})}):a.jsx("img",{src:L.url,alt:L.name,className:`${i}-image`})},L.id)),v&&ie&&a.jsx("div",{className:`${i}-cursor`,style:{left:`${x.x}px`,top:`${x.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${m}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const Fv=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
16474
16474
  import { CommonComponentProps } from '../props';
16475
16475
  import { useScopedStyles } from '../utils/index';
16476
16476
 
@@ -17000,7 +17000,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
17000
17000
  </>
17001
17001
  );
17002
17002
  }
17003
- `,Fv={type:"object",version:1,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"}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"Slider-1.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"Slider-2.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"Slider-3.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"Slider-4.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"Slider-5.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"Slider-6.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"Slider-7.png"},link:""}]},settings:{sizing:"manual",properties:{imageSize:{type:"object",scope:"layout",title:"Img Size",display:{type:"toggle-cycle-numeric-input",enum:["custom","as is","random"],inputs:{custom:"single","as is":"none",random:"range"},defaultValue:700,defaultMin:400,defaultMax:700},min:0,max:9999,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},cursor:{type:"string",scope:"common",title:"Cursor",display:{type:"toggle-cycle",enum:["system","custom"]}},target:{type:"string",scope:"common",title:"Target",display:{type:"toggle-cycle",enum:["area","image"]}},position:{type:"string",scope:"common",title:"Position",display:{type:"toggle-cycle",enum:["random","same","on Click"]}},visible:{type:"string",scope:"common",title:"Visible",display:{type:"toggle-cycle",enum:["all","last One"]}},defaultCursor:{type:["string","null"],scope:"common",title:"Default",display:{type:"settings-image-input",visible:!1}},hoverCursor:{type:["string","null"],scope:"common",title:"Hover",display:{type:"settings-image-input",visible:!1}}},defaults:{imageSize:{sizeType:"custom",value:700,min:400,max:700},cursor:"system",target:"area",position:"random",visible:"all",defaultCursor:null,hoverCursor:null},layoutDefaults:{m:{imageSize:{sizeType:"custom",value:500,min:400,max:700}},t:{imageSize:{sizeType:"custom",value:600,min:400,max:700}},d:{imageSize:{sizeType:"custom",value:700,min:400,max:700}}},displayRules:[{if:{name:"cursor",value:"custom"},then:{name:"properties.defaultCursor.display.visible",value:!0}},{if:{name:"cursor",value:"custom"},then:{name:"properties.hoverCursor.display.visible",value:!0}}],layout:["__componentName__","imageSize","cursor","target","position","visible","defaultCursor","hoverCursor"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["imageSize"]},{type:"row",title:"",items:["cursor","target"]},{type:"row",title:"",items:["position","visible"]},{type:"row",title:"Custom Cursor",items:["defaultCursor","hoverCursor"]}]}]},_v={element:kv,id:"click-gallerie",name:"Click",category:"galleries",version:1,defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Click_Gallery.mp4"},schema:Fv,sourceCode:Av,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"defaultCursor"},{path:"hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]}},Nv=100,Wv=70,Xn="cubic-bezier(0.86, 0, 0.07, 1)";function Hv(e){return`
17003
+ `,_v={type:"object",version:1,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"}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"Slider-1.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"Slider-2.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"Slider-3.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"Slider-4.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"Slider-5.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"Slider-6.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"Slider-7.png"},link:""}]},settings:{sizing:"manual",properties:{imageSize:{type:"object",scope:"layout",title:"Img Size",display:{type:"toggle-cycle-numeric-input",enum:["custom","as is","random"],inputs:{custom:"single","as is":"none",random:"range"},defaultValue:700,defaultMin:400,defaultMax:700},min:0,max:9999,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},cursor:{type:"string",scope:"common",title:"Cursor",display:{type:"toggle-cycle",enum:["system","custom"]}},target:{type:"string",scope:"common",title:"Target",display:{type:"toggle-cycle",enum:["area","image"]}},position:{type:"string",scope:"common",title:"Position",display:{type:"toggle-cycle",enum:["random","same","on Click"]}},visible:{type:"string",scope:"common",title:"Visible",display:{type:"toggle-cycle",enum:["all","last One"]}},defaultCursor:{type:["string","null"],scope:"common",title:"Default",display:{type:"settings-image-input",visible:!1}},hoverCursor:{type:["string","null"],scope:"common",title:"Hover",display:{type:"settings-image-input",visible:!1}}},defaults:{imageSize:{sizeType:"custom",value:700,min:400,max:700},cursor:"system",target:"area",position:"random",visible:"all",defaultCursor:null,hoverCursor:null},layoutDefaults:{m:{imageSize:{sizeType:"custom",value:500,min:400,max:700}},t:{imageSize:{sizeType:"custom",value:600,min:400,max:700}},d:{imageSize:{sizeType:"custom",value:700,min:400,max:700}}},displayRules:[{if:{name:"cursor",value:"custom"},then:{name:"properties.defaultCursor.display.visible",value:!0}},{if:{name:"cursor",value:"custom"},then:{name:"properties.hoverCursor.display.visible",value:!0}}],layout:["__componentName__","imageSize","cursor","target","position","visible","defaultCursor","hoverCursor"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["imageSize"]},{type:"row",title:"",items:["cursor","target"]},{type:"row",title:"",items:["position","visible"]},{type:"row",title:"Custom Cursor",items:["defaultCursor","hoverCursor"]}]}]},Nv={element:Av,id:"click-gallerie",name:"Click",category:"galleries",version:1,defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Click_Gallery.mp4"},schema:_v,sourceCode:Fv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"defaultCursor"},{path:"hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]}},Wv=100,Hv=70,Xn="cubic-bezier(0.86, 0, 0.07, 1)";function Dv(e){return`
17004
17004
  .${e}-wrapper {
17005
17005
  position: relative;
17006
17006
  width: 100%;
@@ -17110,7 +17110,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
17110
17110
  display: block;
17111
17111
  pointer-events: none;
17112
17112
  }
17113
- `}function Dv(e){return e==="blur"?Wv:e==="greyscale"?Nv:0}function xo(e,t=1,n=1){const i=Dv(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 cc(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function Ov(e,t){return t<=1?0:(e-1+t)%t}function Bv(e,t=1){return!e||e.height===0?t:e.width/e.height}function zv(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 dc(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 Zd(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function uc(e,t,n){return{...Zd(e),[`--${n}-stage-scale`]:t}}function jv(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 Vv({settings:e,content:t,isEditor:n,isPreviewMode:i}){var fe,K,Z,se,Se,Me,$e;const{prefix:o}=D.useScopedStyles(),r=s.useMemo(()=>Hv(o),[o]),{imageSize:l,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:p="greyscale"}=e,x=t??[],w=cc(x.length),[m,h]=s.useState(w.activeIndex),[f,v]=s.useState(w.backgroundIndex),[C,y]=s.useState(!1),[S,V]=s.useState(!1),[N,q]=s.useState(null),[W,I]=s.useState(null),[B,$]=s.useState(0),[T,k]=s.useState(1),[F,g]=s.useState("none"),[O,P]=s.useState("next"),[X,te]=s.useState({}),[L,H]=s.useState({width:0,height:0}),U=s.useRef(null),de=s.useRef(null),ae=!n||!!i,A=l??60,ce=Math.max(10,Math.min(100,d??A)),z=Math.max(10,Math.min(100,c??A)),re=Math.max(100,u),ee=xo(p),xe=s.useCallback(G=>{const pe=Bv(G?X[G]:void 0);return zv(L.width,L.height,pe,ce,z)},[L.height,L.width,X,z,ce]);s.useEffect(()=>{const G=de.current;if(!G)return;const pe=new ResizeObserver(([oe])=>{const{width:Y,height:le}=oe.contentRect;H({width:Y,height:le})});return pe.observe(G),()=>pe.disconnect()},[]),s.useEffect(()=>{const G=(t??[]).map(pe=>{var oe;return(oe=pe.image)==null?void 0:oe.url}).filter(pe=>!!pe);jv(G,(pe,oe)=>{te(Y=>{var le,_e;return((le=Y[pe])==null?void 0:le.width)===oe.width&&((_e=Y[pe])==null?void 0:_e.height)===oe.height?Y:{...Y,[pe]:oe}})})},[t]),s.useEffect(()=>{const{backgroundIndex:G,activeIndex:pe}=cc(x.length);h(pe),v(G),y(!1),V(!1),q(null),I(null),$(0),k(1),g("none"),P("next")},[x.length,t]),s.useEffect(()=>()=>{U.current&&clearTimeout(U.current)},[]);const Fe=s.useCallback(G=>{var me,J,Ke,ke;if(!ae||C||x.length<=1)return;const pe=G==="next"?(m+1)%x.length:(m-1+x.length)%x.length,oe=xe((J=(me=x[m])==null?void 0:me.image)==null?void 0:J.url),Y=xe((ke=(Ke=x[pe])==null?void 0:Ke.image)==null?void 0:ke.url),le=dc(L.width,L.height,oe),_e=dc(L.width,L.height,Y);U.current&&clearTimeout(U.current),P(G),V(!0),y(!0),G==="next"?(q(m),I(pe),$(0),k(1),g(xo(p,0,1))):(v(Ov(pe,x.length)),q(pe),I(m),$(1),k(_e),g(xo(p,1,_e))),requestAnimationFrame(()=>{V(!1),requestAnimationFrame(()=>{G==="next"?($(1),k(le),g(xo(p,1,le))):($(0),k(1),g(xo(p,0,1)))})}),U.current=setTimeout(()=>{G==="next"&&v(m),h(pe),q(null),I(null),y(!1)},re)},[m,p,L.height,L.width,xe,C,ae,x,re]),ye=x[m],b=f!==null?x[f]:null,M=N!==null?x[N]:null,E=W!==null?x[W]:null,j=x.length<=1?0:(m-1+x.length)%x.length,Ce=x.length<=1?0:(m+1)%x.length,Q=xe((fe=ye==null?void 0:ye.image)==null?void 0:fe.url),Te=xe((K=M==null?void 0:M.image)==null?void 0:K.url),ie=xe((Z=E==null?void 0:E.image)==null?void 0:Z.url),ue={[`--${o}-transition-ms`]:`${re}ms`};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:r}}),a.jsxs("div",{ref:de,className:pt(`${o}-wrapper`,S&&`${o}-snap`,n&&!i&&`${o}-editor`),style:ue,"aria-label":"Zoom gallery",children:[((se=b==null?void 0:b.image)==null?void 0:se.url)&&a.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:b.image.url,alt:"",style:{filter:ee}})}),C&&((Se=M==null?void 0:M.image)==null?void 0:Se.url)&&a.jsx("div",{className:pt(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${O}`),style:uc(Te,T,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:M.image.url,alt:"",style:{filter:F}})}),C&&((Me=E==null?void 0:E.image)==null?void 0:Me.url)&&a.jsx("div",{className:pt(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${O}`),style:uc(ie,B,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-image`,src:E.image.url,alt:""})}),!C&&(($e=ye==null?void 0:ye.image)==null?void 0:$e.url)&&a.jsx("div",{className:pt(`${o}-stage`,`${o}-foreground`),style:Zd(Q),children:a.jsx("img",{className:`${o}-image`,src:ye.image.url,alt:ye.image.name??""})}),ae&&x.length>1&&!C&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:pt(`${o}-nav`,`${o}-nav-prev`),onClick:()=>Fe("prev"),"aria-label":`Show previous image (${j+1} of ${x.length})`}),a.jsx("button",{type:"button",className:pt(`${o}-nav`,`${o}-nav-next`),onClick:()=>Fe("next"),"aria-label":`Show next image (${Ce+1} of ${x.length})`})]})]})]})}const Gv=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
17113
+ `}function Ov(e){return e==="blur"?Hv:e==="greyscale"?Wv:0}function xo(e,t=1,n=1){const i=Ov(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 cc(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function Bv(e,t){return t<=1?0:(e-1+t)%t}function zv(e,t=1){return!e||e.height===0?t:e.width/e.height}function jv(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 dc(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 Jd(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function uc(e,t,n){return{...Jd(e),[`--${n}-stage-scale`]:t}}function Vv(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 Gv({settings:e,content:t,isEditor:n,isPreviewMode:i}){var ye,Z,Q,ce,we,Pe,Ce;const{prefix:o}=D.useScopedStyles(),r=s.useMemo(()=>Dv(o),[o]),{imageSize:l,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:p="greyscale"}=e,x=t??[],w=cc(x.length),[m,h]=s.useState(w.activeIndex),[f,v]=s.useState(w.backgroundIndex),[C,y]=s.useState(!1),[S,G]=s.useState(!1),[W,U]=s.useState(null),[H,I]=s.useState(null),[z,$]=s.useState(0),[T,A]=s.useState(1),[_,g]=s.useState("none"),[B,P]=s.useState("next"),[Y,ie]=s.useState({}),[L,O]=s.useState({width:0,height:0}),K=s.useRef(null),ue=s.useRef(null),le=!n||!!i,F=l??60,pe=Math.max(10,Math.min(100,d??F)),j=Math.max(10,Math.min(100,c??F)),se=Math.max(100,u),ne=xo(p),ve=s.useCallback(X=>{const me=zv(X?Y[X]:void 0);return jv(L.width,L.height,me,pe,j)},[L.height,L.width,Y,j,pe]);s.useEffect(()=>{const X=ue.current;if(!X)return;const me=new ResizeObserver(([ae])=>{const{width:q,height:de}=ae.contentRect;O({width:q,height:de})});return me.observe(X),()=>me.disconnect()},[]),s.useEffect(()=>{const X=(t??[]).map(me=>{var ae;return(ae=me.image)==null?void 0:ae.url}).filter(me=>!!me);Vv(X,(me,ae)=>{ie(q=>{var de,ke;return((de=q[me])==null?void 0:de.width)===ae.width&&((ke=q[me])==null?void 0:ke.height)===ae.height?q:{...q,[me]:ae}})})},[t]),s.useEffect(()=>{const{backgroundIndex:X,activeIndex:me}=cc(x.length);h(me),v(X),y(!1),G(!1),U(null),I(null),$(0),A(1),g("none"),P("next")},[x.length,t]),s.useEffect(()=>()=>{K.current&&clearTimeout(K.current)},[]);const Me=s.useCallback(X=>{var he,J,Ne,Fe;if(!le||C||x.length<=1)return;const me=X==="next"?(m+1)%x.length:(m-1+x.length)%x.length,ae=ve((J=(he=x[m])==null?void 0:he.image)==null?void 0:J.url),q=ve((Fe=(Ne=x[me])==null?void 0:Ne.image)==null?void 0:Fe.url),de=dc(L.width,L.height,ae),ke=dc(L.width,L.height,q);K.current&&clearTimeout(K.current),P(X),G(!0),y(!0),X==="next"?(U(m),I(me),$(0),A(1),g(xo(p,0,1))):(v(Bv(me,x.length)),U(me),I(m),$(1),A(ke),g(xo(p,1,ke))),requestAnimationFrame(()=>{G(!1),requestAnimationFrame(()=>{X==="next"?($(1),A(de),g(xo(p,1,de))):($(0),A(1),g(xo(p,0,1)))})}),K.current=setTimeout(()=>{X==="next"&&v(m),h(me),U(null),I(null),y(!1)},se)},[m,p,L.height,L.width,ve,C,le,x,se]),xe=x[m],b=f!==null?x[f]:null,M=W!==null?x[W]:null,E=H!==null?x[H]:null,V=x.length<=1?0:(m-1+x.length)%x.length,Se=x.length<=1?0:(m+1)%x.length,te=ve((ye=xe==null?void 0:xe.image)==null?void 0:ye.url),$e=ve((Z=M==null?void 0:M.image)==null?void 0:Z.url),re=ve((Q=E==null?void 0:E.image)==null?void 0:Q.url),ge={[`--${o}-transition-ms`]:`${se}ms`};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:r}}),a.jsxs("div",{ref:ue,className:pt(`${o}-wrapper`,S&&`${o}-snap`,n&&!i&&`${o}-editor`),style:ge,"aria-label":"Zoom gallery",children:[((ce=b==null?void 0:b.image)==null?void 0:ce.url)&&a.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:b.image.url,alt:"",style:{filter:ne}})}),C&&((we=M==null?void 0:M.image)==null?void 0:we.url)&&a.jsx("div",{className:pt(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${B}`),style:uc($e,T,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:M.image.url,alt:"",style:{filter:_}})}),C&&((Pe=E==null?void 0:E.image)==null?void 0:Pe.url)&&a.jsx("div",{className:pt(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${B}`),style:uc(re,z,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-image`,src:E.image.url,alt:""})}),!C&&((Ce=xe==null?void 0:xe.image)==null?void 0:Ce.url)&&a.jsx("div",{className:pt(`${o}-stage`,`${o}-foreground`),style:Jd(te),children:a.jsx("img",{className:`${o}-image`,src:xe.image.url,alt:xe.image.name??""})}),le&&x.length>1&&!C&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:pt(`${o}-nav`,`${o}-nav-prev`),onClick:()=>Me("prev"),"aria-label":`Show previous image (${V+1} of ${x.length})`}),a.jsx("button",{type:"button",className:pt(`${o}-nav`,`${o}-nav-next`),onClick:()=>Me("next"),"aria-label":`Show next image (${Se+1} of ${x.length})`})]})]})]})}const Xv=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
17114
17114
  import cn from 'classnames';
17115
17115
  import { CommonComponentProps } from '../props';
17116
17116
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -17629,7 +17629,7 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
17629
17629
  </>
17630
17630
  );
17631
17631
  }
17632
- `,Xv={type:"object",version:1,settings:{sizing:"manual",properties:{maxWidth:{type:"number",scope:"common",title:"Max width (%)",display:{type:"percentage-input"},min:10,max:100},maxHeight:{type:"number",scope:"common",title:"Max height (%)",display:{type:"percentage-input"},min:10,max:100},transition:{type:"number",scope:"common",title:"Transition (ms)",display:{type:"common-numeric-input"},min:100,max:9999},bgImage:{type:"string",scope:"common",title:"BG image",display:{type:"toggle-cycle",enum:["greyscale","blur","as is"]}}},defaults:{maxWidth:60,maxHeight:60,transition:700,bgImage:"greyscale"},layout:["__componentName__","maxWidth","maxHeight","transition","bgImage"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["maxWidth","maxHeight"]},{type:"row",title:"",items:["transition","bgImage"]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0,deleteImageDeletesEntry:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input",isObjectFitEditable:!1}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:""}}]}},Yv={element:Vv,id:"scale",name:"Scale",category:"galleries",version:1,defaultSize:{d:{width:920,height:540},m:{width:"100%",height:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Scale.mp4"},schema:Xv,sourceCode:Gv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},qv={backgroundColor:"background-color",textColor:"text-color",borderColor:"border-color",iconColor:"icon-color",boxShadowColor:"box-shadow-color",innerBoxShadowColor:"inner-box-shadow-color"},Uv=["hover","active"],Da={left:"flex-start",center:"center",right:"flex-end"};function Kv(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 Zv(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 Jv(e){const t=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-box-shadow-color, transparent)`,n=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-inner-box-shadow-color, transparent)`,i=`${t}, ${n}`,o=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-hover-box-shadow-color, var(--${e}-box-shadow-color, transparent))`,r=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-hover-inner-box-shadow-color, var(--${e}-inner-box-shadow-color, transparent))`,l=`${o}, ${r}`,d=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-active-box-shadow-color, var(--${e}-box-shadow-color, transparent))`,c=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-active-inner-box-shadow-color, var(--${e}-inner-box-shadow-color, transparent))`,u=`${d}, ${c}`,p=`0 4px 12px rgba(0, 0, 0, 0.15), ${n}`,x=`.${e}-button:focus-visible, a:focus-visible .${e}-button`,w=`.${e}-button:hover, ${x}`,m=h=>`.${e}-hover-effect-${h}:hover, .${e}-hover-effect-${h}:focus-visible, a:focus-visible .${e}-hover-effect-${h}`;return`
17632
+ `,Yv={type:"object",version:1,settings:{sizing:"manual",properties:{maxWidth:{type:"number",scope:"common",title:"Max width (%)",display:{type:"percentage-input"},min:10,max:100},maxHeight:{type:"number",scope:"common",title:"Max height (%)",display:{type:"percentage-input"},min:10,max:100},transition:{type:"number",scope:"common",title:"Transition (ms)",display:{type:"common-numeric-input"},min:100,max:9999},bgImage:{type:"string",scope:"common",title:"BG image",display:{type:"toggle-cycle",enum:["greyscale","blur","as is"]}}},defaults:{maxWidth:60,maxHeight:60,transition:700,bgImage:"greyscale"},layout:["__componentName__","maxWidth","maxHeight","transition","bgImage"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["maxWidth","maxHeight"]},{type:"row",title:"",items:["transition","bgImage"]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0,deleteImageDeletesEntry:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input",isObjectFitEditable:!1}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:""}}]}},qv={element:Gv,id:"scale",name:"Scale",category:"galleries",version:1,defaultSize:{d:{width:920,height:540},m:{width:"100%",height:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Scale.mp4"},schema:Yv,sourceCode:Xv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Uv={backgroundColor:"background-color",textColor:"text-color",borderColor:"border-color",iconColor:"icon-color",boxShadowColor:"box-shadow-color",innerBoxShadowColor:"inner-box-shadow-color"},Kv=["hover","active"],Da={left:"flex-start",center:"center",right:"flex-end"};function Zv(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 Jv(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 Qv(e){const t=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-box-shadow-color, transparent)`,n=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-inner-box-shadow-color, transparent)`,i=`${t}, ${n}`,o=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-hover-box-shadow-color, var(--${e}-box-shadow-color, transparent))`,r=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-hover-inner-box-shadow-color, var(--${e}-inner-box-shadow-color, transparent))`,l=`${o}, ${r}`,d=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-active-box-shadow-color, var(--${e}-box-shadow-color, transparent))`,c=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-active-inner-box-shadow-color, var(--${e}-inner-box-shadow-color, transparent))`,u=`${d}, ${c}`,p=`0 4px 12px rgba(0, 0, 0, 0.15), ${n}`,x=`.${e}-button:focus-visible, a:focus-visible .${e}-button`,w=`.${e}-button:hover, ${x}`,m=h=>`.${e}-hover-effect-${h}:hover, .${e}-hover-effect-${h}:focus-visible, a:focus-visible .${e}-hover-effect-${h}`;return`
17633
17633
  .${e}-root {
17634
17634
  line-height: 0;
17635
17635
  }
@@ -17869,7 +17869,7 @@ a:active .${e}-button .${e}-icon-image,
17869
17869
  height: calc(1em * var(--${e}-icon-scale, 1));
17870
17870
  width: calc(1em * var(--${e}-icon-scale, 1));
17871
17871
  }
17872
- `}function Oa(e,t,n="",i,o){const r=t();return a.jsxs("span",{className:`${e}-content-roll-wrap ${n}`.trim(),style:i,children:[a.jsx("span",{className:`${e}-content-roll-spacer`,"aria-hidden":"true",style:o,children:r}),a.jsxs("span",{className:`${e}-content-roll-viewport`,children:[a.jsx("span",{className:`${e}-content-roll-layer`,style:o,children:t()}),a.jsx("span",{className:`${e}-content-roll-layer ${e}-content-roll-layer-hover`,"aria-hidden":"true",style:o,children:t()})]})]})}function pc(e,t,n="fill",i=100,o=0,r){if(!t)return null;const l=a.jsx(sn,{url:t,fill:`var(--${e}-icon-color)`,hoverFill:`var(--${e}-icon-color)`,className:`${e}-icon-image`});if(n==="inline")return a.jsx("span",{className:`${e}-icon ${e}-icon-inline`,style:{[`--${e}-icon-scale`]:i/100},"aria-hidden":"true",children:l});if(n==="fixed"&&o>0){const d=D.scalingValue(o,r);return a.jsx("span",{className:`${e}-icon`,style:{width:d,height:d},"aria-hidden":"true",children:l})}return a.jsx("span",{className:`${e}-icon ${e}-icon-fill`,"aria-hidden":"true",children:l})}function Qv({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:r}=D.useScopedStyles(),l=s.useMemo(()=>Jv(r),[r]),{type:d="a",label:c="Button",icon:u,alignment:p="center",alignA:x,order:w="text-icon",gap:m=0,iconSize:h=0,iconWidthC:f=0,dimensions:v=!1,padding:C={top:0,right:0,bottom:0,left:0},cornerRadius:y=0,boxShadow:S={top:0,left:0,right:0,bottom:0},boxShadowColor:V="rgba(0, 0, 0, 0)",innerBoxShadow:N={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:q="rgba(0, 0, 0, 0)",stroke:W=0,backgroundColor:I="#000000",textColor:B="#ffffff",borderColor:$="#ffffff",iconColor:T="#ffffff",hoverEffect:k="none",fontFamily:F,fontSettings:g,fontSize:O,lineHeight:P,letterSpacing:X=0,wordSpacing:te=0,textAppearance:L,stateOverrides:H,minWidth:U=0,minHeight:de=0,width:ae=0,height:A=0}=e,ce=D.buildColorVars(r,{backgroundColor:I,textColor:B,borderColor:$,iconColor:T,boxShadowColor:V,innerBoxShadowColor:q},qv,Uv,H),z=i&&i!=="default"?`${r}-state-${i}`:"",re=t&&!n?`${r}-editing`:"",ee=k!=="none"&&(!t||n||i==="hover")?`${r}-hover-effect-${k}`:"",xe=k==="reveal"||k==="swipe",Fe=k==="content-roll",ye=k==="reveal"&&(!t||n),b=v===!0,E=d==="a"?x??p:p,j=d==="c",Ce=d!=="b",Q={fontSettings:{fontFamily:F,fontWeight:(g==null?void 0:g.fontWeight)??400,fontStyle:(g==null?void 0:g.fontStyle)??"normal"},fontSize:O??.01,lineHeight:P,letterSpacing:X,wordSpacing:te,textAppearance:L,color:B},ie={...Ce?an(Ut(Q,t)):{},[`--${r}-box-shadow-x`]:D.scalingValue(S.left,t),[`--${r}-box-shadow-y`]:D.scalingValue(S.top,t),[`--${r}-box-shadow-blur`]:D.scalingValue(S.right,t),[`--${r}-box-shadow-spread`]:D.scalingValue(S.bottom,t),[`--${r}-inner-box-shadow-x`]:D.scalingValue(N.left,t),[`--${r}-inner-box-shadow-y`]:D.scalingValue(N.top,t),[`--${r}-inner-box-shadow-blur`]:D.scalingValue(N.right,t),[`--${r}-inner-box-shadow-spread`]:D.scalingValue(N.bottom,t),paddingTop:D.scalingValue(C.top,t),paddingRight:D.scalingValue(C.right,t),paddingBottom:D.scalingValue(C.bottom,t),paddingLeft:D.scalingValue(C.left,t),borderRadius:D.scalingValue(y,t),borderWidth:D.scalingValue(W,t),...j?{}:{justifyContent:Da[E],textAlign:E},...j&&!Fe?{gap:D.scalingValue(m,t)}:{},...b?{width:D.scalingValue(ae,t),height:D.scalingValue(A,t)}:{minWidth:D.scalingValue(U,t),minHeight:D.scalingValue(de,t),...j?{width:"100%"}:{}}};let ue;const fe={display:"inline-flex",alignItems:"center",justifyContent:j?Da[E]:Da[d==="a"?E:"center"],gap:j?D.scalingValue(m,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:E}:{}};if(d==="b"){const se=()=>pc(r,u,h>0?"fixed":"fill",100,h,t);ue=Fe?Oa(r,se,`${r}-icon-roll`,void 0,fe):se()}else if(d==="c"){const se=()=>{const Se=a.jsx("span",{className:`${r}-text`,style:{textAlign:E},children:c}),Me=pc(r,u,f>0?"fixed":"fill",100,f,t);return w==="icon-text"?a.jsxs(a.Fragment,{children:[Me,Se]}):a.jsxs(a.Fragment,{children:[Se,Me]})};ue=Fe?Oa(r,se,`${r}-icon-text-roll`,void 0,fe):se()}else ue=Fe?Oa(r,()=>c,`${r}-label-roll`,void 0,fe):xe?a.jsx("span",{className:`${r}-button-inner`,children:c}):c;const K=ye?se=>Kv(se,r):void 0,Z=ye?se=>Zv(se,r):void 0;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),a.jsx("div",{className:`${r}-root`,style:ce,children:a.jsx("div",{className:`${r}-wrapper ${z} ${re}`.trim(),children:a.jsx("div",{className:`${r}-button ${ee}`.trim(),style:ie,onMouseEnter:K,onMouseLeave:Z,role:"button",tabIndex:o||t&&!n?void 0:0,children:ue})})})]})}const e0=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
17872
+ `}function Oa(e,t,n="",i,o){const r=t();return a.jsxs("span",{className:`${e}-content-roll-wrap ${n}`.trim(),style:i,children:[a.jsx("span",{className:`${e}-content-roll-spacer`,"aria-hidden":"true",style:o,children:r}),a.jsxs("span",{className:`${e}-content-roll-viewport`,children:[a.jsx("span",{className:`${e}-content-roll-layer`,style:o,children:t()}),a.jsx("span",{className:`${e}-content-roll-layer ${e}-content-roll-layer-hover`,"aria-hidden":"true",style:o,children:t()})]})]})}function pc(e,t,n="fill",i=100,o=0,r){if(!t)return null;const l=a.jsx(sn,{url:t,fill:`var(--${e}-icon-color)`,hoverFill:`var(--${e}-icon-color)`,className:`${e}-icon-image`});if(n==="inline")return a.jsx("span",{className:`${e}-icon ${e}-icon-inline`,style:{[`--${e}-icon-scale`]:i/100},"aria-hidden":"true",children:l});if(n==="fixed"&&o>0){const d=D.scalingValue(o,r);return a.jsx("span",{className:`${e}-icon`,style:{width:d,height:d},"aria-hidden":"true",children:l})}return a.jsx("span",{className:`${e}-icon ${e}-icon-fill`,"aria-hidden":"true",children:l})}function e0({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:r}=D.useScopedStyles(),l=s.useMemo(()=>Qv(r),[r]),{type:d="a",label:c="Button",icon:u,alignment:p="center",alignA:x,order:w="text-icon",gap:m=0,iconSize:h=0,iconWidthC:f=0,dimensions:v=!1,padding:C={top:0,right:0,bottom:0,left:0},cornerRadius:y=0,boxShadow:S={top:0,left:0,right:0,bottom:0},boxShadowColor:G="rgba(0, 0, 0, 0)",innerBoxShadow:W={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:U="rgba(0, 0, 0, 0)",stroke:H=0,backgroundColor:I="#000000",textColor:z="#ffffff",borderColor:$="#ffffff",iconColor:T="#ffffff",hoverEffect:A="none",fontFamily:_,fontSettings:g,fontSize:B,lineHeight:P,letterSpacing:Y=0,wordSpacing:ie=0,textAppearance:L,stateOverrides:O,minWidth:K=0,minHeight:ue=0,width:le=0,height:F=0}=e,pe=D.buildColorVars(r,{backgroundColor:I,textColor:z,borderColor:$,iconColor:T,boxShadowColor:G,innerBoxShadowColor:U},Uv,Kv,O),j=i&&i!=="default"?`${r}-state-${i}`:"",se=t&&!n?`${r}-editing`:"",ne=A!=="none"&&(!t||n||i==="hover")?`${r}-hover-effect-${A}`:"",ve=A==="reveal"||A==="swipe",Me=A==="content-roll",xe=A==="reveal"&&(!t||n),b=v===!0,E=d==="a"?x??p:p,V=d==="c",Se=d!=="b",te={fontSettings:{fontFamily:_,fontWeight:(g==null?void 0:g.fontWeight)??400,fontStyle:(g==null?void 0:g.fontStyle)??"normal"},fontSize:B??.01,lineHeight:P,letterSpacing:Y,wordSpacing:ie,textAppearance:L,color:z},re={...Se?an(qt(te,t)):{},[`--${r}-box-shadow-x`]:D.scalingValue(S.left,t),[`--${r}-box-shadow-y`]:D.scalingValue(S.top,t),[`--${r}-box-shadow-blur`]:D.scalingValue(S.right,t),[`--${r}-box-shadow-spread`]:D.scalingValue(S.bottom,t),[`--${r}-inner-box-shadow-x`]:D.scalingValue(W.left,t),[`--${r}-inner-box-shadow-y`]:D.scalingValue(W.top,t),[`--${r}-inner-box-shadow-blur`]:D.scalingValue(W.right,t),[`--${r}-inner-box-shadow-spread`]:D.scalingValue(W.bottom,t),paddingTop:D.scalingValue(C.top,t),paddingRight:D.scalingValue(C.right,t),paddingBottom:D.scalingValue(C.bottom,t),paddingLeft:D.scalingValue(C.left,t),borderRadius:D.scalingValue(y,t),borderWidth:D.scalingValue(H,t),...V?{}:{justifyContent:Da[E],textAlign:E},...V&&!Me?{gap:D.scalingValue(m,t)}:{},...b?{width:D.scalingValue(le,t),height:D.scalingValue(F,t)}:{minWidth:D.scalingValue(K,t),minHeight:D.scalingValue(ue,t),...V?{width:"100%"}:{}}};let ge;const ye={display:"inline-flex",alignItems:"center",justifyContent:V?Da[E]:Da[d==="a"?E:"center"],gap:V?D.scalingValue(m,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:E}:{}};if(d==="b"){const ce=()=>pc(r,u,h>0?"fixed":"fill",100,h,t);ge=Me?Oa(r,ce,`${r}-icon-roll`,void 0,ye):ce()}else if(d==="c"){const ce=()=>{const we=a.jsx("span",{className:`${r}-text`,style:{textAlign:E},children:c}),Pe=pc(r,u,f>0?"fixed":"fill",100,f,t);return w==="icon-text"?a.jsxs(a.Fragment,{children:[Pe,we]}):a.jsxs(a.Fragment,{children:[we,Pe]})};ge=Me?Oa(r,ce,`${r}-icon-text-roll`,void 0,ye):ce()}else ge=Me?Oa(r,()=>c,`${r}-label-roll`,void 0,ye):ve?a.jsx("span",{className:`${r}-button-inner`,children:c}):c;const Z=xe?ce=>Zv(ce,r):void 0,Q=xe?ce=>Jv(ce,r):void 0;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),a.jsx("div",{className:`${r}-root`,style:pe,children:a.jsx("div",{className:`${r}-wrapper ${j} ${se}`.trim(),children:a.jsx("div",{className:`${r}-button ${ne}`.trim(),style:re,onMouseEnter:Z,onMouseLeave:Q,role:"button",tabIndex:o||t&&!n?void 0:0,children:ge})})})]})}const t0=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
17873
17873
  import { SvgImage } from '../helpers/SvgImage/SvgImage';
17874
17874
  import { CommonComponentProps } from '../props';
17875
17875
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
@@ -18496,7 +18496,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
18496
18496
  </>
18497
18497
  );
18498
18498
  }
18499
- `,t0={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},n0=["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],i0={type:"object",version:1,settings:{sizing:"auto",hasLinkParameter:!0,properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},label:{type:"string",scope:"common",title:"Label",display:{type:"label-input"}},icon:{type:["string","null"],scope:"common",title:"Icon",display:{type:"settings-image-input",visible:!1}},alignment:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"]}},alignA:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"],visible:!1}},order:{type:"string",scope:"layout",title:"Order",display:{type:"toggle-cycle",enum:["text-icon","icon-text"],visible:!1}},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconSize:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconWidthC:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},dimensions:{type:"boolean",scope:"layout",title:"Dimensions",display:{type:"toggle",enum:["auto","fixed"]}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",min:0,display:{type:"numeric-input"}},boxShadow:{type:"object",scope:"layout",title:"Shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},boxShadowColor:{type:"string",scope:"common",title:"Shadow Default",titleByState:{default:"Shadow Default",hover:"Shadow Hover",active:"Shadow Active"},display:{type:"palette-color-picker"}},innerBoxShadow:{type:"object",scope:"layout",title:"Inner shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},innerBoxShadowColor:{type:"string",scope:"common",title:"Inner Shadow Default",titleByState:{default:"Inner Shadow Default",hover:"Inner Shadow Hover",active:"Inner Shadow Active"},display:{type:"palette-color-picker"}},stroke:{type:"number",scope:"layout",title:"Stroke Width",display:{type:"numeric-input"},min:0,max:9999},backgroundColor:{type:"string",scope:"common",title:"BG Default",titleByState:{default:"BG Default",hover:"BG Hover",active:"BG Active"},display:{type:"palette-color-picker"}},textColor:{type:"string",scope:"common",title:"Text Default",titleByState:{default:"Text Default",hover:"Text Hover",active:"Text Active"},display:{type:"palette-color-picker"}},borderColor:{type:"string",scope:"common",title:"Border Default",titleByState:{default:"Border Default",hover:"Border Hover",active:"Border Active"},display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{default:"Icon Default",hover:"Icon Hover",active:"Icon Active"},display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},hoverEffect:{type:"string",scope:"layout",title:"Hover effect",display:{type:"toggle-cycle",enum:["none","scale-up","lift","reveal","swipe","content-roll"]}},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},fontSettings:{...t0.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},fontSize:{type:"number",scope:"layout",title:"Font size",display:{type:"font-size"}},lineHeight:{type:"number",scope:"layout",title:"Line height",display:{type:"line-height-input"}},letterSpacing:{type:"number",scope:"layout",title:"Letter spacing",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",scope:"layout",title:"Word spacing",display:{type:"word-spacing-input"}},textAppearance:{type:"object",scope:"layout",title:"Text appearance",display:{type:"text-appearance"}},minWidth:{type:"number",scope:"layout",title:"Min width",display:{type:"numeric-input"},min:0,max:9999},minHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input",visible:!1},min:0,max:9999},height:{type:"number",scope:"layout",title:"Height",display:{type:"numeric-input",visible:!1},min:0,max:9999}},defaults:{label:"Button",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01KY78A0YVT403B042HVWWTHBC.svg",boxShadowColor:"#000000",innerBoxShadowColor:"#000000",backgroundColor:"#2E12F0",textColor:"#ffffff",borderColor:"#ffffff",iconColor:"#ffffff",fontFamily:"Arial",fontSettings:{fontWeight:400,fontStyle:"normal"},stateOverrides:{hover:{backgroundColor:"#3642EF"},active:{backgroundColor:"#475FFF"}}},layoutDefaults:{m:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/375,right:20/375,bottom:10/375,left:20/375},minWidth:0/375,minHeight:0/375,width:100/375,height:100/375,cornerRadius:20/375,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/375,gap:10/375,iconWidthC:16/375,fontSize:16/375,lineHeight:16/375,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},t:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/768,right:20/768,bottom:10/768,left:20/768},minWidth:0/768,minHeight:0/768,width:100/768,height:100/768,cornerRadius:20/768,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/768,gap:10/768,iconWidthC:16/768,fontSize:16/768,lineHeight:16/768,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},d:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/1440,right:20/1440,bottom:10/1440,left:20/1440},minWidth:0/1440,minHeight:0/1440,width:100/1440,height:100/1440,cornerRadius:20/1440,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/1440,gap:10/1440,iconWidthC:16/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}},layout:["__componentName__","type","label","icon","alignment","order","gap","iconSize","iconWidthC","hoverEffect",{type:"row",title:"",items:["dimensions","padding"]},"cornerRadius","boxShadow","boxShadowColor","innerBoxShadow","innerBoxShadowColor",{type:"row",title:"",items:["stroke","borderColor"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]}],displayRules:[{if:{name:"type",value:"a"},then:{name:"properties.icon.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignment.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignA.display.visible",value:!0}},{if:{name:"type",value:"a"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"b"},then:{name:"properties.label.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontFamily.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSettings.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSize.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.lineHeight.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.letterSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.wordSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.textAppearance.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.iconSize.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.order.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.iconWidthC.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.gap.display.visible",value:!0}},{if:{name:"stroke",value:0},then:{name:"properties.borderColor.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minWidth.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minHeight.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.width.display.visible",value:!0}},{if:{name:"dimensions",value:!0},then:{name:"properties.height.display.visible",value:!0}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["label","icon","iconSize","alignA"]},{type:"row",title:"",items:["alignment","order"]},{type:"row",title:"",items:["gap","iconWidthC"]},{type:"row",title:"",items:["dimensions","padding"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]},{type:"row",title:"",items:["hoverEffect","cornerRadius"]},{type:"row",title:"",items:["boxShadow"]},{type:"row",title:"",items:["innerBoxShadow"]},{type:"row",title:"",items:["stroke"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily","fontSettings",{type:"row",title:"",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAppearance"]}],paletteBookmark:{items:[...n0],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],hover:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],active:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"]}},states:["default","hover","active"]},o0={element:Qv,id:"simple-button",name:"Simple Button",category:"ui-elements",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/button-preview.png"},schema:i0,sourceCode:e0,assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{fontSettings:"fontFamily"}};function r0(e){return`
18499
+ `,n0={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},i0=["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],o0={type:"object",version:1,settings:{sizing:"auto",hasLinkParameter:!0,properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},label:{type:"string",scope:"common",title:"Label",display:{type:"label-input"}},icon:{type:["string","null"],scope:"common",title:"Icon",display:{type:"settings-image-input",visible:!1}},alignment:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"]}},alignA:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"],visible:!1}},order:{type:"string",scope:"layout",title:"Order",display:{type:"toggle-cycle",enum:["text-icon","icon-text"],visible:!1}},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconSize:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconWidthC:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},dimensions:{type:"boolean",scope:"layout",title:"Dimensions",display:{type:"toggle",enum:["auto","fixed"]}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",min:0,display:{type:"numeric-input"}},boxShadow:{type:"object",scope:"layout",title:"Shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},boxShadowColor:{type:"string",scope:"common",title:"Shadow Default",titleByState:{default:"Shadow Default",hover:"Shadow Hover",active:"Shadow Active"},display:{type:"palette-color-picker"}},innerBoxShadow:{type:"object",scope:"layout",title:"Inner shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},innerBoxShadowColor:{type:"string",scope:"common",title:"Inner Shadow Default",titleByState:{default:"Inner Shadow Default",hover:"Inner Shadow Hover",active:"Inner Shadow Active"},display:{type:"palette-color-picker"}},stroke:{type:"number",scope:"layout",title:"Stroke Width",display:{type:"numeric-input"},min:0,max:9999},backgroundColor:{type:"string",scope:"common",title:"BG Default",titleByState:{default:"BG Default",hover:"BG Hover",active:"BG Active"},display:{type:"palette-color-picker"}},textColor:{type:"string",scope:"common",title:"Text Default",titleByState:{default:"Text Default",hover:"Text Hover",active:"Text Active"},display:{type:"palette-color-picker"}},borderColor:{type:"string",scope:"common",title:"Border Default",titleByState:{default:"Border Default",hover:"Border Hover",active:"Border Active"},display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{default:"Icon Default",hover:"Icon Hover",active:"Icon Active"},display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},hoverEffect:{type:"string",scope:"layout",title:"Hover effect",display:{type:"toggle-cycle",enum:["none","scale-up","lift","reveal","swipe","content-roll"]}},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},fontSettings:{...n0.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},fontSize:{type:"number",scope:"layout",title:"Font size",display:{type:"font-size"}},lineHeight:{type:"number",scope:"layout",title:"Line height",display:{type:"line-height-input"}},letterSpacing:{type:"number",scope:"layout",title:"Letter spacing",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",scope:"layout",title:"Word spacing",display:{type:"word-spacing-input"}},textAppearance:{type:"object",scope:"layout",title:"Text appearance",display:{type:"text-appearance"}},minWidth:{type:"number",scope:"layout",title:"Min width",display:{type:"numeric-input"},min:0,max:9999},minHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input",visible:!1},min:0,max:9999},height:{type:"number",scope:"layout",title:"Height",display:{type:"numeric-input",visible:!1},min:0,max:9999}},defaults:{label:"Button",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01KY78A0YVT403B042HVWWTHBC.svg",boxShadowColor:"#000000",innerBoxShadowColor:"#000000",backgroundColor:"#2E12F0",textColor:"#ffffff",borderColor:"#ffffff",iconColor:"#ffffff",fontFamily:"Arial",fontSettings:{fontWeight:400,fontStyle:"normal"},stateOverrides:{hover:{backgroundColor:"#3642EF"},active:{backgroundColor:"#475FFF"}}},layoutDefaults:{m:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/375,right:20/375,bottom:10/375,left:20/375},minWidth:0/375,minHeight:0/375,width:100/375,height:100/375,cornerRadius:20/375,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/375,gap:10/375,iconWidthC:16/375,fontSize:16/375,lineHeight:16/375,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},t:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/768,right:20/768,bottom:10/768,left:20/768},minWidth:0/768,minHeight:0/768,width:100/768,height:100/768,cornerRadius:20/768,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/768,gap:10/768,iconWidthC:16/768,fontSize:16/768,lineHeight:16/768,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},d:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/1440,right:20/1440,bottom:10/1440,left:20/1440},minWidth:0/1440,minHeight:0/1440,width:100/1440,height:100/1440,cornerRadius:20/1440,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/1440,gap:10/1440,iconWidthC:16/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}},layout:["__componentName__","type","label","icon","alignment","order","gap","iconSize","iconWidthC","hoverEffect",{type:"row",title:"",items:["dimensions","padding"]},"cornerRadius","boxShadow","boxShadowColor","innerBoxShadow","innerBoxShadowColor",{type:"row",title:"",items:["stroke","borderColor"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]}],displayRules:[{if:{name:"type",value:"a"},then:{name:"properties.icon.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignment.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignA.display.visible",value:!0}},{if:{name:"type",value:"a"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"b"},then:{name:"properties.label.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontFamily.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSettings.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSize.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.lineHeight.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.letterSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.wordSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.textAppearance.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.iconSize.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.order.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.iconWidthC.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.gap.display.visible",value:!0}},{if:{name:"stroke",value:0},then:{name:"properties.borderColor.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minWidth.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minHeight.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.width.display.visible",value:!0}},{if:{name:"dimensions",value:!0},then:{name:"properties.height.display.visible",value:!0}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["label","icon","iconSize","alignA"]},{type:"row",title:"",items:["alignment","order"]},{type:"row",title:"",items:["gap","iconWidthC"]},{type:"row",title:"",items:["dimensions","padding"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]},{type:"row",title:"",items:["hoverEffect","cornerRadius"]},{type:"row",title:"",items:["boxShadow"]},{type:"row",title:"",items:["innerBoxShadow"]},{type:"row",title:"",items:["stroke"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily","fontSettings",{type:"row",title:"",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAppearance"]}],paletteBookmark:{items:[...i0],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],hover:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],active:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"]}},states:["default","hover","active"]},r0={element:e0,id:"simple-button",name:"Simple Button",category:"ui-elements",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/button-preview.png"},schema:o0,sourceCode:t0,assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{fontSettings:"fontFamily"}};function a0(e){return`
18500
18500
  .${e}-titles-row {
18501
18501
  position: relative;
18502
18502
  flex: 0 1 auto;
@@ -18694,7 +18694,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
18694
18694
  pointer-events: auto;
18695
18695
  flex-shrink: 0;
18696
18696
  }
18697
- `}const In=500,vo=650,mn="cubic-bezier(0.22, 1, 0.36, 1)",a0=72,s0=50,l0=1e4,c0=650,d0=500;function u0(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 Jd(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=Or(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 p0(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Jd(i,n):null}function m0(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 To(e,t,n){var o;if(e.length<=1)return null;const i=(t+n+e.length)%e.length;return((o=e[i])==null?void 0:o.items[0])??null}function mc(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return To(e,i,n)}const g0=.03;function Qd(e){return e.width*g0}const Ba={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function vr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function gc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function h0(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ds(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 f0(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ds(e,t.width,t.height)}function y0(e,t){if(ua(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 x0(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 v0({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=>ua(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 ao(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=Qd(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 Vr(e,t,n){const i=ao(e,t,n);return{...i,left:2*i.left-e.left}}function b0(e,t,n){const{left:i,width:o}=n,r=Qd(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 eu(e,t,n,i){const o=ao(e,"left",i),r=ao(e,"right",i),l=Vr(e,"left",i),d=Vr(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 w0(e,t,n,i){const{start:o,end:r}=eu(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function S0(e,t,n){const i=ao(e,t,n),o=Vr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function ua(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function C0({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 br({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return ua(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 $0({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:x,sourceRect:w,resolveCloseSourceRect:m,onClose:h,onPrev:f,onNext:v}){const C=s.useRef(null),y=s.useRef(null),S=s.useRef(null),V=s.useRef(new Map),[N,q]=s.useState(0),W=s.useRef(null),I=s.useRef(0),B=s.useRef(0),$=s.useRef("none"),T=s.useRef(!1),k=s.useRef(!1),F=s.useRef(!1),g=s.useRef(null),O=s.useRef(null),P=s.useRef(null),X=s.useRef(()=>{}),te=s.useRef(null),L=s.useRef(null),H=s.useRef(null),U=s.useRef(!1),[de,ae]=s.useState(null),[A,ce]=s.useState(Ba),[z,re]=s.useState(0),[ee,xe]=s.useState("opening"),[Fe,ye]=s.useState(0),[b,M]=s.useState(0),[E,j]=s.useState(!1),[Ce,Q]=s.useState(null),[Te,ie]=s.useState(null),[ue,fe]=s.useState(null),[K,Z]=s.useState(!1),[se,Se]=s.useState(null),[Me,$e]=s.useState(!1),G=s.useRef(!1),[pe,oe]=s.useState(!1),[Y,le]=s.useState(!1),_e=s.useRef(n),me=s.useRef(void 0),J=t[n],Ke=J?ua(J):!1,ke=b!==0||E,tt=!l&&(!r||!!d),Ye=c&&!l,dt=u.length>1,ot=s.useCallback((_,Pe)=>t.length<=1?null:t[(_+Pe+t.length)%t.length]??null,[t]),Ve=dt?To(u,p,-1):ot(n,-1),Re=dt?To(u,p,1):ot(n,1),He=Ce===-1&&ke?dt&&Te!==null?To(u,Te,-1):ue!==null?ot(ue,-1):null:null,Be=Ce===1&&ke?dt&&Te!==null?To(u,Te,1):ue!==null?ot(ue,1):null:null,Ze=He&&He.url!==(Ve==null?void 0:Ve.url)?He:null,he=Be&&Be.url!==(Re==null?void 0:Re.url)?Be:null,ve=Ve&&Ye?(()=>{const _=dt?mc(u,p,-1):t.length>2?ot((n-1+t.length)%t.length,-1):null;return _&&_.url!==Ve.url?_:null})():null,We=Re&&Ye?(()=>{const _=dt?mc(u,p,1):t.length>2?ot((n+1)%t.length,1):null;return _&&_.url!==Re.url?_:null})():null,Je=Ze??ve,be=he??We,Ie=s.useCallback((_,Pe,Ne)=>{if(!_||!Pe||!Ne)return;const Oe=V.current,lt=Oe.get(_);(lt==null?void 0:lt.width)===Pe&&(lt==null?void 0:lt.height)===Ne||(Oe.set(_,{width:Pe,height:Ne}),q(Et=>Et+1))},[]),qe=s.useCallback(_=>{if(!(_!=null&&_.url))return null;const Pe=V.current.get(_.url);return f0(y.current,Pe)},[N,z]),ze=s.useCallback(()=>{if(!J)return;const _=qe(J);if(_){ae(_);return}const Pe=y.current;Pe&&ae(gc(Pe))},[J,qe]),Le=s.useCallback(_=>{if(dt){const Pe=u.length;ie((p+_+Pe)%Pe),fe(null);return}t.length>1&&(fe((n+_+t.length)%t.length),ie(null))},[dt,u.length,p,t.length,n]),Ge=s.useCallback(_=>{F.current=_,j(_)},[]),De=s.useCallback(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null)},[]),nt=s.useCallback(()=>{De(),g.current=window.setTimeout(()=>{De(),Ge(!1)},vo+32)},[De,Ge]),it=s.useCallback(()=>{const _=C.current;if(!_){ce({left:0,top:0,width:typeof window<"u"?window.innerWidth:Ba.width,height:typeof window<"u"?window.innerHeight:Ba.height});return}const Pe=_.getBoundingClientRect();ce({left:Pe.left,top:Pe.top,width:Pe.width,height:Pe.height})},[]),ct=s.useCallback((_,Pe)=>{if(ke){if(pe&&!E)return`translate(${b}px, 0px)`;if(E&&Ce!==null){const Ne=qe(_);if(!Ne)return;const{x:Oe,y:lt}=w0(Ne,Pe,Ce,A);return`translate(${Oe}px, ${lt}px)`}if(E)return"translate(0px, 0px)"}},[ke,pe,E,b,Ce,A,qe]),St=s.useCallback(()=>{const _=O.current;O.current=null,De(),Ge(!1),Q(null),ie(null),fe(null),M(0),oe(!1),T.current=!1,B.current=0,$.current="none",_===-1?f():_===1&&v()},[De,Ge,f,v]),Bt=s.useCallback(()=>{De(),g.current=window.setTimeout(()=>{O.current!==null&&St()},vo+32)},[De,St]),zt=s.useCallback(()=>{De(),O.current=null,Ge(!1),Q(null),ie(null),fe(null),M(0),oe(!1),T.current=!1,B.current=0,$.current="none"},[De,Ge]),ft=s.useCallback(_=>{if(!(!Ye||!de)){if(F.current){if(O.current===_){P.current=_,St();return}zt()}De(),Le(_),O.current=_,Q(_),Ge(!0),Bt()}},[Ye,de,St,zt,De,Le,Ge,Bt]);X.current=ft;const wt=s.useCallback(()=>{te.current=null,U.current=!1,L.current!==null&&(window.clearInterval(L.current),L.current=null),H.current!==null&&(window.clearTimeout(H.current),H.current=null)},[]),jt=s.useCallback(_=>{L.current!==null&&window.clearInterval(L.current);const Pe=U.current?d0:c0;L.current=window.setInterval(()=>{X.current(_)},Pe)},[]),At=s.useCallback(_=>{te.current!==_&&(wt(),te.current=_,U.current=!1,X.current(_),jt(_),H.current=window.setTimeout(()=>{H.current=null,te.current===_&&(U.current=!0,jt(_))},l0))},[wt,jt]),vt=s.useCallback(()=>{const _=y.current;if(!_)return;const Pe=J==null?void 0:J.url,Ne=Pe?V.current.get(Pe):void 0;if(Ne!=null&&Ne.width&&(Ne!=null&&Ne.height)){ae(ds(_,Ne.width,Ne.height));return}const Oe=S.current;if(Oe&&Pe&&(Oe.src===Pe||Oe.currentSrc===Pe)){const{width:Et,height:rt}=h0(Oe);if(Et&&rt){Ie(Pe,Et,rt),ae(ds(_,Et,rt));return}}const lt=gc(_);!lt.width||!lt.height||ae(lt)},[J==null?void 0:J.url,Ie]),Ft=s.useCallback(_=>{if(S.current=_,!!_){if(_ instanceof HTMLVideoElement){_.readyState>=1&&_.videoWidth>0&&vt();return}_.complete&&_.naturalWidth>0&&vt()}},[vt]),Nt=s.useCallback(()=>{it(),vt(),re(_=>_+1)},[it,vt]);s.useEffect(()=>{Nt();const _=y.current,Pe=C.current,Ne=new ResizeObserver(()=>Nt());return _&&Ne.observe(_),Pe&&Ne.observe(Pe),window.addEventListener("resize",Nt),()=>{Ne.disconnect(),window.removeEventListener("resize",Nt)}},[Nt,n,x]),s.useLayoutEffect(()=>{if(!J)return;const _=S.current;if(_){if(_ instanceof HTMLImageElement&&_.complete&&_.naturalWidth>0){vt();return}_ instanceof HTMLVideoElement&&_.readyState>=1&&_.videoWidth>0&&vt()}},[J==null?void 0:J.url,n,vt]),s.useEffect(()=>{ze()},[ze,N]),s.useEffect(()=>{const _=new Set,Pe=[],Ne=Oe=>{!(Oe!=null&&Oe.url)||_.has(Oe.url)||(_.add(Oe.url),Pe.push(Oe))};t.forEach(Ne),u.forEach(Oe=>Oe.items.forEach(Ne)),Pe.forEach(Oe=>{V.current.has(Oe.url)||y0(Oe,Ie)})},[t,u,Ie]),s.useEffect(()=>{if(ee!=="opening"||!de)return;if(!w){xe("open");return}Z(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Z(!0),xe("open")})});return()=>cancelAnimationFrame(_)},[ee,de,w]),s.useEffect(()=>{if(ee!=="closing")return;const _=setTimeout(()=>h(),In);return()=>clearTimeout(_)},[ee,h]),s.useEffect(()=>()=>{De()},[De]),s.useLayoutEffect(()=>{_e.current===n&&me.current===(J==null?void 0:J.url)||(De(),O.current=null,Q(null),ie(null),fe(null),ye(0),M(0),Ge(!1),le(!1),oe(!1),I.current=0,B.current=0,$.current="none",T.current=!1,W.current=null,k.current=!1,S.current=null,ze(),_e.current=n,me.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,Ge,De,ze]),s.useLayoutEffect(()=>{const _=P.current;_!==null&&(P.current=null,requestAnimationFrame(()=>{X.current(_)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(ee==="opening"){G.current=!1,$e(!1);return}if(ee!=="open"||G.current)return;if(!Ve&&!Re){G.current=!0;return}$e(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{$e(!0),G.current=!0})});return()=>cancelAnimationFrame(_)},[ee,Ve==null?void 0:Ve.url,Re==null?void 0:Re.url]),s.useEffect(()=>{if(ee!=="open")return;const _=()=>{const rt=xt=>{xt.stopPropagation(),xt.preventDefault(),document.removeEventListener("click",rt,!0)};document.addEventListener("click",rt,!0)},Pe=rt=>{const xt=rt<0?1:-1;De(),Le(xt),O.current=xt,Q(xt),Ge(!0),Bt()},Ne=rt=>{if(Math.abs(rt)>s0&&Ye){Pe(rt);return}O.current=null,Q(null),ie(null),fe(null),Ge(!0),M(0),nt()},Oe=rt=>{if(rt.touches.length!==1||F.current)return;const xt=rt.touches[0];k.current=!0,W.current={x:xt.clientX,y:xt.clientY},$.current="none",B.current=0,T.current=!1},lt=rt=>{if(!W.current||rt.touches.length!==1||F.current)return;const xt=rt.touches[0],Ot=xt.clientX-W.current.x,It=xt.clientY-W.current.y;if($.current==="none"){if(Math.abs(Ot)<10&&Math.abs(It)<10)return;if(Math.abs(Ot)>Math.abs(It)){if(!Ye)return;$.current="horizontal"}else if(It>0){if(!tt)return;$.current="vertical"}else return}if($.current==="horizontal"){T.current=!0,oe(!0),B.current=Ot,M(Ot),rt.preventDefault();return}$.current==="vertical"&&(T.current=!0,oe(!0),I.current=It,ye(It),rt.preventDefault())},Et=()=>{if(!W.current)return;const rt=$.current,xt=T.current;if(xt&&rt==="horizontal")Ne(B.current),_();else if(xt&&rt==="vertical"){const Ot=I.current;if(tt&&Ot>a0){const It=window.innerHeight;I.current=It,le(!0),ye(It),xe("closing")}else I.current=0,ye(0);_()}else rt==="horizontal"&&Math.abs(B.current)>0&&(Ne(B.current),_());W.current=null,$.current="none",B.current=0,T.current=!1,oe(!1)};return document.addEventListener("touchstart",Oe,{passive:!0}),document.addEventListener("touchmove",lt,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Oe),document.removeEventListener("touchmove",lt),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[ee,Ye,Ge,nt,De,tt,Bt,Le]);const Kt=s.useCallback(()=>{const _=(m==null?void 0:m())??w??null;_&&de&&(Se(_),Z(!0)),xe("closing")},[m,w,de]);s.useEffect(()=>{const _=Oe=>{if(Oe.key==="Escape"){if(r&&d||ee==="closing")return;wt(),Kt();return}if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight"||ee!=="open"||!Ye)return;Oe.preventDefault();const lt=Oe.key==="ArrowLeft"?-1:1;Oe.repeat&&te.current===lt||At(lt)},Pe=Oe=>{if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight")return;const lt=Oe.key==="ArrowLeft"?-1:1;te.current===lt&&wt()},Ne=()=>{wt()};return window.addEventListener("keydown",_),window.addEventListener("keyup",Pe),window.addEventListener("blur",Ne),()=>{window.removeEventListener("keydown",_),window.removeEventListener("keyup",Pe),window.removeEventListener("blur",Ne),wt()}},[ee,r,d,Kt,Ye,At,wt]),s.useEffect(()=>{ee!=="open"&&wt()},[ee,wt]);const Jt=()=>{ee==="closing"||l||Kt()},Tt=ee==="open",Wt=ee==="closing",rn=Fe>0?Math.max(0,1-Fe/500):1,gt=Fe>0?Math.max(.35,1-Fe/500):1,Ae=s.useCallback(_=>{if(!(_.propertyName!=="transform"||!F.current)){if(O.current!==null){St();return}De(),Ge(!1)}},[De,Ge,St]),Xe=ee==="closing"?se??w:w,st=Xe&&de&&(ee==="opening"||Wt)?u0(Xe,de):void 0,ht=ke&&J?ct(J,"center"):Fe>0?`translateY(${Fe}px)`:st,yt=de?vr(de,A):null,Lt=!!(Xe&&de),mt=Lt&&(ee==="closing"||ee==="open"&&K),Vt={position:"absolute",top:yt==null?void 0:yt.top,left:yt==null?void 0:yt.left,width:yt==null?void 0:yt.width,height:yt==null?void 0:yt.height,objectFit:"contain",transformOrigin:"top left",transform:ht,opacity:Fe>0?gt:Lt?1:ee==="opening"||Wt?0:1,transition:pe&&!E?"none":E?`transform ${vo}ms ${mn}`:Y?`transform ${In}ms ${mn}, opacity ${In}ms ${mn}`:mt?`transform ${In}ms ${mn}`:ee==="opening"||Wt?`opacity ${In}ms ${mn}`:"none",pointerEvents:Ke&&Tt&&!ke?"auto":"none",touchAction:Ke&&Tt?"none":void 0,zIndex:1,overflow:Ke?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Tt&&!ke?"auto":"none"},Mt=(_,Pe,Ne="adjacent")=>{const Oe=qe(_);if(!Oe)return{display:"none"};const lt=Ne==="far"?Pe==="left"?"far-left":"far-right":Pe==="left"?"left-adjacent":"right-adjacent",{start:Et}=Ce!==null?eu(Oe,lt,Ce,A):{start:Ne==="far"?Vr(Oe,Pe,A):ao(Oe,Pe,A)},rt=vr(Et,A),xt=ct(_,lt),Ot=!ke&&Ne==="adjacent"&&Tt&&!Me?S0(Oe,Pe,A):null,It=Ne==="far"&&ke&&Ce===(Pe==="left"?-1:1),nn=pe&&!E?!1:E,un=Ne==="adjacent"&&Tt&&Me&&!ke;return{position:"absolute",top:rt.top,left:rt.left,width:rt.width,height:rt.height,objectFit:"contain",transform:xt??(Ot?`translate(${Ot.x}px, ${Ot.y}px)`:void 0),opacity:Ne==="far"?Tt&&It?1:0:Tt?1:0,transition:nn?Ne==="far"?`transform ${vo}ms ${mn}`:`transform ${vo}ms ${mn}, opacity ${In}ms ${mn}`:un?`transform ${In}ms ${mn}`:ee==="opening"||Wt?`opacity ${In}ms ${mn}`:"none",pointerEvents:"none",zIndex:1}},Xt=(_,Pe)=>{const Ne=qe(_);return Ne?b0(ao(Ne,Pe,A),Pe,A):null},Yt=_=>Pe=>{if(!l){if(k.current){k.current=!1;return}Pe.stopPropagation(),ft(_)}},Ht=Ve?Xt(Ve,"left"):null,Dt=Re?Xt(Re,"right"):null,_t=Ht?vr(Ht,A):null,Ct=Dt?vr(Dt,A):null;return a.jsxs("div",{ref:C,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:ee==="open"?"none":void 0},onClick:Jt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Tt?rn:0,transition:pe?"none":`opacity ${In}ms ${mn}`,pointerEvents:"none"}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[a.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:y,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Tt?1:0,transition:pe?"none":`opacity ${In}ms ${mn}`,pointerEvents:"none"},children:a.jsx(Fd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Jt})})]}),Tt&&Je&&a.jsx(br,{media:Je,style:Mt(Je,"left","far"),onMeasure:Ie,onTransitionEnd:Ae},`far-prev-${Je.url}`),Tt&&Ve&&a.jsxs(a.Fragment,{children:[a.jsx(br,{media:Ve,style:Mt(Ve,"left"),onMeasure:Ie,onTransitionEnd:Ae},`prev-${Ve.url}`),_t&&a.jsx("div",{style:{position:"absolute",top:_t.top,left:_t.left,width:_t.width,height:_t.height,cursor:l||pe?"default":"pointer",pointerEvents:l||pe?"none":"auto",zIndex:3},onClick:Yt(-1)})]}),Tt&&Re&&a.jsxs(a.Fragment,{children:[a.jsx(br,{media:Re,style:Mt(Re,"right"),onMeasure:Ie,onTransitionEnd:Ae},`next-${Re.url}`),Ct&&a.jsx("div",{style:{position:"absolute",top:Ct.top,left:Ct.left,width:Ct.width,height:Ct.height,cursor:l||pe?"default":"pointer",pointerEvents:l||pe?"none":"auto",zIndex:3},onClick:Yt(1)})]}),Tt&&be&&a.jsx(br,{media:be,style:Mt(be,"right","far"),onMeasure:Ie,onTransitionEnd:Ae},`far-next-${be.url}`),de&&J&&(Ke?a.jsx(C0,{src:J.url,phase:ee,onMediaElement:Ft,wrapperStyle:Vt,videoStyle:kt,onLoadedMetadata:vt,onTransitionEnd:Ae},`${n}-${J.url}`):a.jsx("img",{ref:Ft,src:J.url,alt:J.name,onLoad:vt,onTransitionEnd:Ae,style:Vt},`${n}-${J.url}`))]})}const T0=20,I0=.18;function R0(e){return`
18697
+ `}const In=500,vo=650,mn="cubic-bezier(0.22, 1, 0.36, 1)",s0=72,l0=50,c0=1e4,d0=650,u0=500;function p0(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 Qd(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=Or(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 m0(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Qd(i,n):null}function g0(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 To(e,t,n){var o;if(e.length<=1)return null;const i=(t+n+e.length)%e.length;return((o=e[i])==null?void 0:o.items[0])??null}function mc(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return To(e,i,n)}const h0=.03;function eu(e){return e.width*h0}const Ba={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function vr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function gc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function f0(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ds(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 y0(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ds(e,t.width,t.height)}function x0(e,t){if(ua(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 v0(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 b0({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=>ua(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 ao(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=eu(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 Vr(e,t,n){const i=ao(e,t,n);return{...i,left:2*i.left-e.left}}function w0(e,t,n){const{left:i,width:o}=n,r=eu(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 tu(e,t,n,i){const o=ao(e,"left",i),r=ao(e,"right",i),l=Vr(e,"left",i),d=Vr(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 S0(e,t,n,i){const{start:o,end:r}=tu(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function C0(e,t,n){const i=ao(e,t,n),o=Vr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function ua(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function $0({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 br({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return ua(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 T0({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:x,sourceRect:w,resolveCloseSourceRect:m,onClose:h,onPrev:f,onNext:v}){const C=s.useRef(null),y=s.useRef(null),S=s.useRef(null),G=s.useRef(new Map),[W,U]=s.useState(0),H=s.useRef(null),I=s.useRef(0),z=s.useRef(0),$=s.useRef("none"),T=s.useRef(!1),A=s.useRef(!1),_=s.useRef(!1),g=s.useRef(null),B=s.useRef(null),P=s.useRef(null),Y=s.useRef(()=>{}),ie=s.useRef(null),L=s.useRef(null),O=s.useRef(null),K=s.useRef(!1),[ue,le]=s.useState(null),[F,pe]=s.useState(Ba),[j,se]=s.useState(0),[ne,ve]=s.useState("opening"),[Me,xe]=s.useState(0),[b,M]=s.useState(0),[E,V]=s.useState(!1),[Se,te]=s.useState(null),[$e,re]=s.useState(null),[ge,ye]=s.useState(null),[Z,Q]=s.useState(!1),[ce,we]=s.useState(null),[Pe,Ce]=s.useState(!1),X=s.useRef(!1),[me,ae]=s.useState(!1),[q,de]=s.useState(!1),ke=s.useRef(n),he=s.useRef(void 0),J=t[n],Ne=J?ua(J):!1,Fe=b!==0||E,et=!l&&(!r||!!d),Je=c&&!l,dt=u.length>1,tt=s.useCallback((N,Re)=>t.length<=1?null:t[(N+Re+t.length)%t.length]??null,[t]),De=dt?To(u,p,-1):tt(n,-1),Ie=dt?To(u,p,1):tt(n,1),We=Se===-1&&Fe?dt&&$e!==null?To(u,$e,-1):ge!==null?tt(ge,-1):null:null,je=Se===1&&Fe?dt&&$e!==null?To(u,$e,1):ge!==null?tt(ge,1):null:null,Ue=We&&We.url!==(De==null?void 0:De.url)?We:null,k=je&&je.url!==(Ie==null?void 0:Ie.url)?je:null,ee=De&&Je?(()=>{const N=dt?mc(u,p,-1):t.length>2?tt((n-1+t.length)%t.length,-1):null;return N&&N.url!==De.url?N:null})():null,Te=Ie&&Je?(()=>{const N=dt?mc(u,p,1):t.length>2?tt((n+1)%t.length,1):null;return N&&N.url!==Ie.url?N:null})():null,He=Ue??ee,Be=k??Te,Ve=s.useCallback((N,Re,Ae)=>{if(!N||!Re||!Ae)return;const ze=G.current,ct=ze.get(N);(ct==null?void 0:ct.width)===Re&&(ct==null?void 0:ct.height)===Ae||(ze.set(N,{width:Re,height:Ae}),U(Et=>Et+1))},[]),rt=s.useCallback(N=>{if(!(N!=null&&N.url))return null;const Re=G.current.get(N.url);return y0(y.current,Re)},[W,j]),Ze=s.useCallback(()=>{if(!J)return;const N=rt(J);if(N){le(N);return}const Re=y.current;Re&&le(gc(Re))},[J,rt]),_e=s.useCallback(N=>{if(dt){const Re=u.length;re((p+N+Re)%Re),ye(null);return}t.length>1&&(ye((n+N+t.length)%t.length),re(null))},[dt,u.length,p,t.length,n]),qe=s.useCallback(N=>{_.current=N,V(N)},[]),Oe=s.useCallback(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null)},[]),nt=s.useCallback(()=>{Oe(),g.current=window.setTimeout(()=>{Oe(),qe(!1)},vo+32)},[Oe,qe]),at=s.useCallback(()=>{const N=C.current;if(!N){pe({left:0,top:0,width:typeof window<"u"?window.innerWidth:Ba.width,height:typeof window<"u"?window.innerHeight:Ba.height});return}const Re=N.getBoundingClientRect();pe({left:Re.left,top:Re.top,width:Re.width,height:Re.height})},[]),st=s.useCallback((N,Re)=>{if(Fe){if(me&&!E)return`translate(${b}px, 0px)`;if(E&&Se!==null){const Ae=rt(N);if(!Ae)return;const{x:ze,y:ct}=S0(Ae,Re,Se,F);return`translate(${ze}px, ${ct}px)`}if(E)return"translate(0px, 0px)"}},[Fe,me,E,b,Se,F,rt]),St=s.useCallback(()=>{const N=B.current;B.current=null,Oe(),qe(!1),te(null),re(null),ye(null),M(0),ae(!1),T.current=!1,z.current=0,$.current="none",N===-1?f():N===1&&v()},[Oe,qe,f,v]),Yt=s.useCallback(()=>{Oe(),g.current=window.setTimeout(()=>{B.current!==null&&St()},vo+32)},[Oe,St]),Zt=s.useCallback(()=>{Oe(),B.current=null,qe(!1),te(null),re(null),ye(null),M(0),ae(!1),T.current=!1,z.current=0,$.current="none"},[Oe,qe]),vt=s.useCallback(N=>{if(!(!Je||!ue)){if(_.current){if(B.current===N){P.current=N,St();return}Zt()}Oe(),_e(N),B.current=N,te(N),qe(!0),Yt()}},[Je,ue,St,Zt,Oe,_e,qe,Yt]);Y.current=vt;const wt=s.useCallback(()=>{ie.current=null,K.current=!1,L.current!==null&&(window.clearInterval(L.current),L.current=null),O.current!==null&&(window.clearTimeout(O.current),O.current=null)},[]),Bt=s.useCallback(N=>{L.current!==null&&window.clearInterval(L.current);const Re=K.current?u0:d0;L.current=window.setInterval(()=>{Y.current(N)},Re)},[]),At=s.useCallback(N=>{ie.current!==N&&(wt(),ie.current=N,K.current=!1,Y.current(N),Bt(N),O.current=window.setTimeout(()=>{O.current=null,ie.current===N&&(K.current=!0,Bt(N))},c0))},[wt,Bt]),xt=s.useCallback(()=>{const N=y.current;if(!N)return;const Re=J==null?void 0:J.url,Ae=Re?G.current.get(Re):void 0;if(Ae!=null&&Ae.width&&(Ae!=null&&Ae.height)){le(ds(N,Ae.width,Ae.height));return}const ze=S.current;if(ze&&Re&&(ze.src===Re||ze.currentSrc===Re)){const{width:Et,height:it}=f0(ze);if(Et&&it){Ve(Re,Et,it),le(ds(N,Et,it));return}}const ct=gc(N);!ct.width||!ct.height||le(ct)},[J==null?void 0:J.url,Ve]),Ft=s.useCallback(N=>{if(S.current=N,!!N){if(N instanceof HTMLVideoElement){N.readyState>=1&&N.videoWidth>0&&xt();return}N.complete&&N.naturalWidth>0&&xt()}},[xt]),Nt=s.useCallback(()=>{at(),xt(),se(N=>N+1)},[at,xt]);s.useEffect(()=>{Nt();const N=y.current,Re=C.current,Ae=new ResizeObserver(()=>Nt());return N&&Ae.observe(N),Re&&Ae.observe(Re),window.addEventListener("resize",Nt),()=>{Ae.disconnect(),window.removeEventListener("resize",Nt)}},[Nt,n,x]),s.useLayoutEffect(()=>{if(!J)return;const N=S.current;if(N){if(N instanceof HTMLImageElement&&N.complete&&N.naturalWidth>0){xt();return}N instanceof HTMLVideoElement&&N.readyState>=1&&N.videoWidth>0&&xt()}},[J==null?void 0:J.url,n,xt]),s.useEffect(()=>{Ze()},[Ze,W]),s.useEffect(()=>{const N=new Set,Re=[],Ae=ze=>{!(ze!=null&&ze.url)||N.has(ze.url)||(N.add(ze.url),Re.push(ze))};t.forEach(Ae),u.forEach(ze=>ze.items.forEach(Ae)),Re.forEach(ze=>{G.current.has(ze.url)||x0(ze,Ve)})},[t,u,Ve]),s.useEffect(()=>{if(ne!=="opening"||!ue)return;if(!w){ve("open");return}Q(!1);const N=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Q(!0),ve("open")})});return()=>cancelAnimationFrame(N)},[ne,ue,w]),s.useEffect(()=>{if(ne!=="closing")return;const N=setTimeout(()=>h(),In);return()=>clearTimeout(N)},[ne,h]),s.useEffect(()=>()=>{Oe()},[Oe]),s.useLayoutEffect(()=>{ke.current===n&&he.current===(J==null?void 0:J.url)||(Oe(),B.current=null,te(null),re(null),ye(null),xe(0),M(0),qe(!1),de(!1),ae(!1),I.current=0,z.current=0,$.current="none",T.current=!1,H.current=null,A.current=!1,S.current=null,Ze(),ke.current=n,he.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,qe,Oe,Ze]),s.useLayoutEffect(()=>{const N=P.current;N!==null&&(P.current=null,requestAnimationFrame(()=>{Y.current(N)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(ne==="opening"){X.current=!1,Ce(!1);return}if(ne!=="open"||X.current)return;if(!De&&!Ie){X.current=!0;return}Ce(!1);const N=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ce(!0),X.current=!0})});return()=>cancelAnimationFrame(N)},[ne,De==null?void 0:De.url,Ie==null?void 0:Ie.url]),s.useEffect(()=>{if(ne!=="open")return;const N=()=>{const it=yt=>{yt.stopPropagation(),yt.preventDefault(),document.removeEventListener("click",it,!0)};document.addEventListener("click",it,!0)},Re=it=>{const yt=it<0?1:-1;Oe(),_e(yt),B.current=yt,te(yt),qe(!0),Yt()},Ae=it=>{if(Math.abs(it)>l0&&Je){Re(it);return}B.current=null,te(null),re(null),ye(null),qe(!0),M(0),nt()},ze=it=>{if(it.touches.length!==1||_.current)return;const yt=it.touches[0];A.current=!0,H.current={x:yt.clientX,y:yt.clientY},$.current="none",z.current=0,T.current=!1},ct=it=>{if(!H.current||it.touches.length!==1||_.current)return;const yt=it.touches[0],Ot=yt.clientX-H.current.x,It=yt.clientY-H.current.y;if($.current==="none"){if(Math.abs(Ot)<10&&Math.abs(It)<10)return;if(Math.abs(Ot)>Math.abs(It)){if(!Je)return;$.current="horizontal"}else if(It>0){if(!et)return;$.current="vertical"}else return}if($.current==="horizontal"){T.current=!0,ae(!0),z.current=Ot,M(Ot),it.preventDefault();return}$.current==="vertical"&&(T.current=!0,ae(!0),I.current=It,xe(It),it.preventDefault())},Et=()=>{if(!H.current)return;const it=$.current,yt=T.current;if(yt&&it==="horizontal")Ae(z.current),N();else if(yt&&it==="vertical"){const Ot=I.current;if(et&&Ot>s0){const It=window.innerHeight;I.current=It,de(!0),xe(It),ve("closing")}else I.current=0,xe(0);N()}else it==="horizontal"&&Math.abs(z.current)>0&&(Ae(z.current),N());H.current=null,$.current="none",z.current=0,T.current=!1,ae(!1)};return document.addEventListener("touchstart",ze,{passive:!0}),document.addEventListener("touchmove",ct,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",ze),document.removeEventListener("touchmove",ct),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[ne,Je,qe,nt,Oe,et,Yt,_e]);const Ut=s.useCallback(()=>{const N=(m==null?void 0:m())??w??null;N&&ue&&(we(N),Q(!0)),ve("closing")},[m,w,ue]);s.useEffect(()=>{const N=ze=>{if(ze.key==="Escape"){if(r&&d||ne==="closing")return;wt(),Ut();return}if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight"||ne!=="open"||!Je)return;ze.preventDefault();const ct=ze.key==="ArrowLeft"?-1:1;ze.repeat&&ie.current===ct||At(ct)},Re=ze=>{if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight")return;const ct=ze.key==="ArrowLeft"?-1:1;ie.current===ct&&wt()},Ae=()=>{wt()};return window.addEventListener("keydown",N),window.addEventListener("keyup",Re),window.addEventListener("blur",Ae),()=>{window.removeEventListener("keydown",N),window.removeEventListener("keyup",Re),window.removeEventListener("blur",Ae),wt()}},[ne,r,d,Ut,Je,At,wt]),s.useEffect(()=>{ne!=="open"&&wt()},[ne,wt]);const Jt=()=>{ne==="closing"||l||Ut()},Tt=ne==="open",Wt=ne==="closing",rn=Me>0?Math.max(0,1-Me/500):1,gt=Me>0?Math.max(.35,1-Me/500):1,Ee=s.useCallback(N=>{if(!(N.propertyName!=="transform"||!_.current)){if(B.current!==null){St();return}Oe(),qe(!1)}},[Oe,qe,St]),Xe=ne==="closing"?ce??w:w,lt=Xe&&ue&&(ne==="opening"||Wt)?p0(Xe,ue):void 0,ht=Fe&&J?st(J,"center"):Me>0?`translateY(${Me}px)`:lt,ft=ue?vr(ue,F):null,Lt=!!(Xe&&ue),mt=Lt&&(ne==="closing"||ne==="open"&&Z),zt={position:"absolute",top:ft==null?void 0:ft.top,left:ft==null?void 0:ft.left,width:ft==null?void 0:ft.width,height:ft==null?void 0:ft.height,objectFit:"contain",transformOrigin:"top left",transform:ht,opacity:Me>0?gt:Lt?1:ne==="opening"||Wt?0:1,transition:me&&!E?"none":E?`transform ${vo}ms ${mn}`:q?`transform ${In}ms ${mn}, opacity ${In}ms ${mn}`:mt?`transform ${In}ms ${mn}`:ne==="opening"||Wt?`opacity ${In}ms ${mn}`:"none",pointerEvents:Ne&&Tt&&!Fe?"auto":"none",touchAction:Ne&&Tt?"none":void 0,zIndex:1,overflow:Ne?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Tt&&!Fe?"auto":"none"},Mt=(N,Re,Ae="adjacent")=>{const ze=rt(N);if(!ze)return{display:"none"};const ct=Ae==="far"?Re==="left"?"far-left":"far-right":Re==="left"?"left-adjacent":"right-adjacent",{start:Et}=Se!==null?tu(ze,ct,Se,F):{start:Ae==="far"?Vr(ze,Re,F):ao(ze,Re,F)},it=vr(Et,F),yt=st(N,ct),Ot=!Fe&&Ae==="adjacent"&&Tt&&!Pe?C0(ze,Re,F):null,It=Ae==="far"&&Fe&&Se===(Re==="left"?-1:1),nn=me&&!E?!1:E,un=Ae==="adjacent"&&Tt&&Pe&&!Fe;return{position:"absolute",top:it.top,left:it.left,width:it.width,height:it.height,objectFit:"contain",transform:yt??(Ot?`translate(${Ot.x}px, ${Ot.y}px)`:void 0),opacity:Ae==="far"?Tt&&It?1:0:Tt?1:0,transition:nn?Ae==="far"?`transform ${vo}ms ${mn}`:`transform ${vo}ms ${mn}, opacity ${In}ms ${mn}`:un?`transform ${In}ms ${mn}`:ne==="opening"||Wt?`opacity ${In}ms ${mn}`:"none",pointerEvents:"none",zIndex:1}},Vt=(N,Re)=>{const Ae=rt(N);return Ae?w0(ao(Ae,Re,F),Re,F):null},Gt=N=>Re=>{if(!l){if(A.current){A.current=!1;return}Re.stopPropagation(),vt(N)}},Ht=De?Vt(De,"left"):null,Dt=Ie?Vt(Ie,"right"):null,_t=Ht?vr(Ht,F):null,Ct=Dt?vr(Dt,F):null;return a.jsxs("div",{ref:C,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:ne==="open"?"none":void 0},onClick:Jt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Tt?rn:0,transition:me?"none":`opacity ${In}ms ${mn}`,pointerEvents:"none"}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[a.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:y,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Tt?1:0,transition:me?"none":`opacity ${In}ms ${mn}`,pointerEvents:"none"},children:a.jsx(_d,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Jt})})]}),Tt&&He&&a.jsx(br,{media:He,style:Mt(He,"left","far"),onMeasure:Ve,onTransitionEnd:Ee},`far-prev-${He.url}`),Tt&&De&&a.jsxs(a.Fragment,{children:[a.jsx(br,{media:De,style:Mt(De,"left"),onMeasure:Ve,onTransitionEnd:Ee},`prev-${De.url}`),_t&&a.jsx("div",{style:{position:"absolute",top:_t.top,left:_t.left,width:_t.width,height:_t.height,cursor:l||me?"default":"pointer",pointerEvents:l||me?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Tt&&Ie&&a.jsxs(a.Fragment,{children:[a.jsx(br,{media:Ie,style:Mt(Ie,"right"),onMeasure:Ve,onTransitionEnd:Ee},`next-${Ie.url}`),Ct&&a.jsx("div",{style:{position:"absolute",top:Ct.top,left:Ct.left,width:Ct.width,height:Ct.height,cursor:l||me?"default":"pointer",pointerEvents:l||me?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Tt&&Be&&a.jsx(br,{media:Be,style:Mt(Be,"right","far"),onMeasure:Ve,onTransitionEnd:Ee},`far-next-${Be.url}`),ue&&J&&(Ne?a.jsx($0,{src:J.url,phase:ne,onMediaElement:Ft,wrapperStyle:zt,videoStyle:kt,onLoadedMetadata:xt,onTransitionEnd:Ee},`${n}-${J.url}`):a.jsx("img",{ref:Ft,src:J.url,alt:J.name,onLoad:xt,onTransitionEnd:Ee,style:zt},`${n}-${J.url}`))]})}const I0=20,R0=.18;function L0(e){return`
18698
18698
  .${e}-wrapper {
18699
18699
  box-sizing: border-box;
18700
18700
  max-width: 100%;
@@ -18781,8 +18781,8 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
18781
18781
  z-index: 2;
18782
18782
  pointer-events: auto;
18783
18783
  }
18784
- ${r0(e)}
18785
- `}function L0(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 P0(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 E0(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:D.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:D.scalingValue(i*I0,n??!1),[`--${t}-image-aspect`]:L0(e)}}function M0(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 Ut(n,t)}function k0(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 A0(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?Jd(d,o):void 0)}}function F0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=D.useScopedStyles(),c=s.useMemo(()=>R0(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",x=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,w=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,m=D.scalingValue(w,n??!1),h=`max(${m}, ${T0}px)`,{objectFitMode:f,imageStyle:v}=k0(e),C=M0(e,n),y=s.useRef(null),[S,V]=s.useState(!1),[N,q]=s.useState([]),[W,I]=s.useState(0),[B,$]=s.useState(0),[T,k]=s.useState(null),[F,g]=s.useState({title1:"",title2:"",title3:""}),O=(!n||i)&&!S,P=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},X=P.sizeType??"none",te=O&&X!=="none"?`${d}-item-image-hover-${X}`:void 0,L=(P.value??120)/100,H=s.useCallback(b=>{!b||X!=="scale"||(b.style.transformOrigin=Lg(b))},[X]),U=s.useCallback(b=>{if(b){if(f==="contain"){const M=P0(b);if(M){const E=b.closest(`.${d}-item-image`);E instanceof HTMLElement&&E.style.setProperty(`--${d}-item-media-aspect`,String(M))}}H(b)}},[d,H,f]),de={width:D.scalingValue(x,n??!1),...C,...E0(e,d,n),[`--${d}-image-hover-scale`]:String(L)},ae=(()=>{const b={},M=y.current?getComputedStyle(y.current).getPropertyValue("--cntrl-article-width").trim():"";return M&&(b["--cntrl-article-width"]=M),b})(),A=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),ce=s.useMemo(()=>m0(u),[u]),z=s.useMemo(()=>x0(u),[u]),re=(b,M)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const E=ce.findIndex(Ce=>Ce.gridIndex===b);if(E<0)return;const j=ce[E];$(E),q(j.items),I(0),g(j.entry),k(M??null),V(!0)},ee=s.useCallback(()=>{V(!1),k(null)},[]),xe=s.useCallback(()=>{const b=ce[B];return!b||!y.current?T:p0(y.current,b.gridIndex,f)??T},[ce,B,T,f]),Fe=s.useCallback(b=>{if(ce.length>1){const M=ce.length,E=(B+b+M)%M,j=ce[E];$(E),q(j.items),I(0),g(j.entry);return}I(M=>(M+b+N.length)%N.length)},[ce,B,N.length]),ye=ce.length>1||N.length>1;return s.useEffect(()=>{if(!S||typeof document>"u")return;const b=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=b}},[S]),s.useEffect(()=>{!n||o||i||V(!1)},[n,o,i]),s.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&V(!1)},[e==null?void 0:e.lightbox]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx(v0,{mediaList:z}),a.jsx("div",{ref:y,className:`${d}-wrapper ${d}-type-${p}`,style:de,children:u.map((b,M)=>{var Ce,Q;const E=!!((Ce=b.image)!=null&&Ce.url),j=A0(!!A,E,M,d,f,re);return a.jsxs("div",{className:`${d}-item`,children:[b.title?a.jsx("span",{className:`${d}-item-title`,onClick:j,style:j?{cursor:"pointer"}:void 0,children:b.title}):null,(Q=b.image)!=null&&Q.url?a.jsx("span",{className:[`${d}-item-image`,f==="contain"?`${d}-item-image-fit`:void 0,te].filter(Boolean).join(" "),children:b.image.type==="video"?a.jsx("video",{ref:U,src:b.image.url,"data-waterfall-index":M,style:v,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:j,onLoadedData:Te=>U(Te.currentTarget)}):a.jsx("img",{ref:U,src:b.image.url,alt:b.image.name??"","data-waterfall-index":M,style:v,onClick:j,onLoad:Te=>U(Te.currentTarget)})}):null,M<u.length-1&&a.jsx("div",{className:`${d}-item-gap-host`,style:{width:m},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:h,height:"100%"}})})]},M)})}),S&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const b=(l?document.getElementById(l):null)??document.body;return zn.createPortal(a.jsx("div",{style:ae,"data-selection":"none",children:a.jsx($0,{prefix:d,items:N,index:W,entry:F,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ye,lightboxEntries:ce,entryIdx:B,layoutId:r,sourceRect:T,resolveCloseSourceRect:xe,onClose:ee,onPrev:()=>Fe(-1),onNext:()=>Fe(1)})}),b)})()]})}const _0=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
18784
+ ${a0(e)}
18785
+ `}function P0(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 E0(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 M0(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:D.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:D.scalingValue(i*R0,n??!1),[`--${t}-image-aspect`]:P0(e)}}function k0(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 A0(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 F0(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?Qd(d,o):void 0)}}function _0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=D.useScopedStyles(),c=s.useMemo(()=>L0(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",x=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,w=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,m=D.scalingValue(w,n??!1),h=`max(${m}, ${I0}px)`,{objectFitMode:f,imageStyle:v}=A0(e),C=k0(e,n),y=s.useRef(null),[S,G]=s.useState(!1),[W,U]=s.useState([]),[H,I]=s.useState(0),[z,$]=s.useState(0),[T,A]=s.useState(null),[_,g]=s.useState({title1:"",title2:"",title3:""}),B=(!n||i)&&!S,P=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},Y=P.sizeType??"none",ie=B&&Y!=="none"?`${d}-item-image-hover-${Y}`:void 0,L=(P.value??120)/100,O=s.useCallback(b=>{!b||Y!=="scale"||(b.style.transformOrigin=Pg(b))},[Y]),K=s.useCallback(b=>{if(b){if(f==="contain"){const M=E0(b);if(M){const E=b.closest(`.${d}-item-image`);E instanceof HTMLElement&&E.style.setProperty(`--${d}-item-media-aspect`,String(M))}}O(b)}},[d,O,f]),ue={width:D.scalingValue(x,n??!1),...C,...M0(e,d,n),[`--${d}-image-hover-scale`]:String(L)},le=(()=>{const b={},M=y.current?getComputedStyle(y.current).getPropertyValue("--cntrl-article-width").trim():"";return M&&(b["--cntrl-article-width"]=M),b})(),F=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),pe=s.useMemo(()=>g0(u),[u]),j=s.useMemo(()=>v0(u),[u]),se=(b,M)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const E=pe.findIndex(Se=>Se.gridIndex===b);if(E<0)return;const V=pe[E];$(E),U(V.items),I(0),g(V.entry),A(M??null),G(!0)},ne=s.useCallback(()=>{G(!1),A(null)},[]),ve=s.useCallback(()=>{const b=pe[z];return!b||!y.current?T:m0(y.current,b.gridIndex,f)??T},[pe,z,T,f]),Me=s.useCallback(b=>{if(pe.length>1){const M=pe.length,E=(z+b+M)%M,V=pe[E];$(E),U(V.items),I(0),g(V.entry);return}I(M=>(M+b+W.length)%W.length)},[pe,z,W.length]),xe=pe.length>1||W.length>1;return s.useEffect(()=>{if(!S||typeof document>"u")return;const b=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=b}},[S]),s.useEffect(()=>{!n||o||i||G(!1)},[n,o,i]),s.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&G(!1)},[e==null?void 0:e.lightbox]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx(b0,{mediaList:j}),a.jsx("div",{ref:y,className:`${d}-wrapper ${d}-type-${p}`,style:ue,children:u.map((b,M)=>{var Se,te;const E=!!((Se=b.image)!=null&&Se.url),V=F0(!!F,E,M,d,f,se);return a.jsxs("div",{className:`${d}-item`,children:[b.title?a.jsx("span",{className:`${d}-item-title`,onClick:V,style:V?{cursor:"pointer"}:void 0,children:b.title}):null,(te=b.image)!=null&&te.url?a.jsx("span",{className:[`${d}-item-image`,f==="contain"?`${d}-item-image-fit`:void 0,ie].filter(Boolean).join(" "),children:b.image.type==="video"?a.jsx("video",{ref:K,src:b.image.url,"data-waterfall-index":M,style:v,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:V,onLoadedData:$e=>K($e.currentTarget)}):a.jsx("img",{ref:K,src:b.image.url,alt:b.image.name??"","data-waterfall-index":M,style:v,onClick:V,onLoad:$e=>K($e.currentTarget)})}):null,M<u.length-1&&a.jsx("div",{className:`${d}-item-gap-host`,style:{width:m},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:h,height:"100%"}})})]},M)})}),S&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const b=(l?document.getElementById(l):null)??document.body;return zn.createPortal(a.jsx("div",{style:le,"data-selection":"none",children:a.jsx(T0,{prefix:d,items:W,index:H,entry:_,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:xe,lightboxEntries:pe,entryIdx:z,layoutId:r,sourceRect:T,resolveCloseSourceRect:ve,onClose:ne,onPrev:()=>Me(-1),onNext:()=>Me(1)})}),b)})()]})}const N0=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
18786
18786
  import type React from 'react';
18787
18787
  import { createPortal } from 'react-dom';
18788
18788
  import { CommonComponentProps } from '../props';
@@ -19296,7 +19296,7 @@ export function Waterfall({
19296
19296
  </>
19297
19297
  );
19298
19298
  }
19299
- `,N0="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>'),Yn={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 W0(e){const t={};return t[at(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[at(e,"fontSettings")]={...Yn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[at(e,"fontSize")]={...Yn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[at(e,"lineHeight")]={...Yn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[at(e,"letterSpacing")]={...Yn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[at(e,"wordSpacing")]={...Yn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[at(e,"textAlign")]={...Yn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[at(e,"textAppearance")]={...Yn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const so=oi.filter(e=>e!=="count"),H0=so.reduce((e,t)=>({...e,...W0(t)}),{}),D0=so.reduce((e,t)=>({...e,[at(t,"fontFamily")]:"Arial",[at(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[at(t,"letterSpacing")]:0,[at(t,"wordSpacing")]:0,[at(t,"textAlign")]:"left",[at(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function za(e){return so.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[at(n,"fontSize")]=i),o!==void 0&&(t[at(n,"lineHeight")]=o),t},{})}const O0={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(so.map(e=>[Xs[e],Ys(e)]))},wr={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},B0=[{title:"Salton Sea from Above",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],z0={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"}},caption:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"cover",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]}},required:["image"]},default:B0},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},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"}}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageHoverEffect:{type:"object",scope:"common",title:"Hover",display:{type:"toggle-cycle-numeric-input",enum:["none","scale","saturate"],inputs:{none:"none",scale:"single",saturate:"none"},defaultValue:120,showDash:!1},min:0,max:9999,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},horizontalGap:{type:"number",scope:"layout",title:"Gutter",min:0,display:{type:"range-control"}},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"}},titleColor:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title1Color:{type:"string",scope:"common",title:"Title Lightbox",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Lightbox",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Lightbox",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"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Yn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{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"]}}},...H0},defaults:{type:"a",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightbox:"on",imageHoverEffect:{sizeType:"none",value:120,min:100,max:200},titleColor:"#000000",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:N0,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...D0},layoutDefaults:{d:{wrapperWidth:1,horizontalGap:.006944,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,titleFontSize:.0625,titleLineHeight:.05555,titleLetterSpacing:-34722e-8,...za({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})},m:{wrapperWidth:1,horizontalGap:.026666,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,titleFontSize:.16,titleLineHeight:.13333,...za({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{wrapperWidth:1,horizontalGap:.01302,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.03906,iconMarginRight:.026,titleFontSize:.07,titleLineHeight:.07,...za({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})}},layout:["__componentName__","type","wrapperWidth","imageDisplay","lightbox","imageHoverEffect","horizontalGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","contentMarginTop","closeIconMaxWidth","iconMarginRight","titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["wrapperWidth","lightbox"]},{type:"row",title:"Image",items:["imageDisplay","imageHoverEffect"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Lightbox",items:[O0]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},j0={element:F0,id:"waterfall",name:"Waterfall",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/waterfall.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},...so.map(e=>({path:`${at(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...so.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${at(t,"fontFamily")}`}),{})},schema:z0,sourceCode:_0},qi=500,tu="cubic-bezier(0.25, 1, 0.5, 1)",V0=300,G0=5,X0=.15,Y0=.4,q0=100,Fi=100,hc={color:"#000000",hover:"#cccccc"},bo={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},U0={s:{paddingY:5,paddingActive:5,borderRadius:9,dot:4,activeDot:8,gapInactive:9,inset:5},m:{paddingY:7,paddingActive:7,borderRadius:17,dot:8,activeDot:20,gapInactive:22,inset:7},l:{paddingY:10,paddingActive:10,borderRadius:29,dot:20,activeDot:38,gapInactive:26,inset:10}},ja={offset:{x:0,y:0},linkColor:"#cccccc"},fc={sizeType:"drag",value:3},K0="left";function Z0(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)??.02,lineHeight:(e==null?void 0:e.titleLineHeight)??.02,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,textAlign:K0,color:(e==null?void 0:e.titleColor)??"#000000"};return Ut(n,t)}function _i(e,t,n){return`${e}: ${D.scalingValue(t/1440,n)};`}function Io(e,t){return t<=0?0:(e%t+t)%t}function J0(e,t,n,i){if(!i)return{position:Io(e+t,n),hitBoundary:!1};const o=e+t;return o>=0&&o<=n+1?{position:o,hitBoundary:!1}:{position:t>0?n+1:0,hitBoundary:!0}}function Q0(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function eb(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,x)=>{n.style.transform=`translate(${p}px, ${x}px)`;const w=n.getBoundingClientRect();return{x:w.left,y:w.top}},o=i(0,0),r=i(Fi,0),l=i(0,Fi);e.removeChild(n);const d={x:(r.x-o.x)/Fi,y:(r.y-o.y)/Fi},c={x:(l.x-o.x)/Fi,y:(l.y-o.y)/Fi},u=d.x*c.y-c.x*d.y;return{ex:d,ey:c,det:u}}function tb(e,t,n){const{ex:i,ey:o,det:r}=e;return{x:(t*o.y-n*o.x)/r,y:(i.x*n-i.y*t)/r}}function nb(e,t){return`
19299
+ `,W0="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),Yn={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 H0(e){const t={};return t[ot(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[ot(e,"fontSettings")]={...Yn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[ot(e,"fontSize")]={...Yn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[ot(e,"lineHeight")]={...Yn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[ot(e,"letterSpacing")]={...Yn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[ot(e,"wordSpacing")]={...Yn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[ot(e,"textAlign")]={...Yn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[ot(e,"textAppearance")]={...Yn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const so=oi.filter(e=>e!=="count"),D0=so.reduce((e,t)=>({...e,...H0(t)}),{}),O0=so.reduce((e,t)=>({...e,[ot(t,"fontFamily")]:"Arial",[ot(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[ot(t,"letterSpacing")]:0,[ot(t,"wordSpacing")]:0,[ot(t,"textAlign")]:"left",[ot(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function za(e){return so.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[ot(n,"fontSize")]=i),o!==void 0&&(t[ot(n,"lineHeight")]=o),t},{})}const B0={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(so.map(e=>[Xs[e],Ys(e)]))},wr={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},z0=[{title:"Salton Sea from Above",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],j0={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"}},caption:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"cover",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]}},required:["image"]},default:z0},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},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"}}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageHoverEffect:{type:"object",scope:"common",title:"Hover",display:{type:"toggle-cycle-numeric-input",enum:["none","scale","saturate"],inputs:{none:"none",scale:"single",saturate:"none"},defaultValue:120,showDash:!1},min:0,max:9999,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},horizontalGap:{type:"number",scope:"layout",title:"Gutter",min:0,display:{type:"range-control"}},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"}},titleColor:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title1Color:{type:"string",scope:"common",title:"Title Lightbox",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Lightbox",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Lightbox",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"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Yn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{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"]}}},...D0},defaults:{type:"a",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightbox:"on",imageHoverEffect:{sizeType:"none",value:120,min:100,max:200},titleColor:"#000000",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:W0,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...O0},layoutDefaults:{d:{wrapperWidth:1,horizontalGap:.006944,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,titleFontSize:.0625,titleLineHeight:.05555,titleLetterSpacing:-34722e-8,...za({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})},m:{wrapperWidth:1,horizontalGap:.026666,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,titleFontSize:.16,titleLineHeight:.13333,...za({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{wrapperWidth:1,horizontalGap:.01302,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.03906,iconMarginRight:.026,titleFontSize:.07,titleLineHeight:.07,...za({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})}},layout:["__componentName__","type","wrapperWidth","imageDisplay","lightbox","imageHoverEffect","horizontalGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","contentMarginTop","closeIconMaxWidth","iconMarginRight","titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["wrapperWidth","lightbox"]},{type:"row",title:"Image",items:["imageDisplay","imageHoverEffect"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Lightbox",items:[B0]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},V0={element:_0,id:"waterfall",name:"Waterfall",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/waterfall.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},...so.map(e=>({path:`${ot(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...so.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${ot(t,"fontFamily")}`}),{})},schema:j0,sourceCode:N0},qi=500,nu="cubic-bezier(0.25, 1, 0.5, 1)",G0=300,X0=5,Y0=.15,q0=.4,U0=100,Fi=100,hc={color:"#000000",hover:"#cccccc"},bo={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},K0={s:{paddingY:5,paddingActive:5,borderRadius:9,dot:4,activeDot:8,gapInactive:9,inset:5},m:{paddingY:7,paddingActive:7,borderRadius:17,dot:8,activeDot:20,gapInactive:22,inset:7},l:{paddingY:10,paddingActive:10,borderRadius:29,dot:20,activeDot:38,gapInactive:26,inset:10}},ja={offset:{x:0,y:0},linkColor:"#cccccc"},fc={sizeType:"drag",value:3},Z0="left";function J0(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)??.02,lineHeight:(e==null?void 0:e.titleLineHeight)??.02,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,textAlign:Z0,color:(e==null?void 0:e.titleColor)??"#000000"};return qt(n,t)}function _i(e,t,n){return`${e}: ${D.scalingValue(t/1440,n)};`}function Io(e,t){return t<=0?0:(e%t+t)%t}function Q0(e,t,n,i){if(!i)return{position:Io(e+t,n),hitBoundary:!1};const o=e+t;return o>=0&&o<=n+1?{position:o,hitBoundary:!1}:{position:t>0?n+1:0,hitBoundary:!0}}function eb(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function tb(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,x)=>{n.style.transform=`translate(${p}px, ${x}px)`;const w=n.getBoundingClientRect();return{x:w.left,y:w.top}},o=i(0,0),r=i(Fi,0),l=i(0,Fi);e.removeChild(n);const d={x:(r.x-o.x)/Fi,y:(r.y-o.y)/Fi},c={x:(l.x-o.x)/Fi,y:(l.y-o.y)/Fi},u=d.x*c.y-c.x*d.y;return{ex:d,ey:c,det:u}}function nb(e,t,n){const{ex:i,ey:o,det:r}=e;return{x:(t*o.y-n*o.x)/r,y:(i.x*n-i.y*t)/r}}function ib(e,t){return`
19300
19300
  .${e}-wrapper {
19301
19301
  position: relative;
19302
19302
  width: 100%;
@@ -19368,7 +19368,7 @@ export function Waterfall({
19368
19368
  top: 0;
19369
19369
  left: 0;
19370
19370
  opacity: 0;
19371
- transition: opacity ${qi}ms ${tu};
19371
+ transition: opacity ${qi}ms ${nu};
19372
19372
  }
19373
19373
  .${e}-list-fade .${e}-slide.${e}-is-active {
19374
19374
  opacity: 1;
@@ -19566,7 +19566,7 @@ export function Waterfall({
19566
19566
  from { clip-path: inset(100% 0 0 0); }
19567
19567
  to { clip-path: inset(0 0 0 0); }
19568
19568
  }
19569
- `}function ib({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=D.useScopedStyles(),l=Z0(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??fc,p=u.sizeType??"drag",x=u.value??fc.value,w=(e==null?void 0:e.direction)??"horizontal",m=(e==null?void 0:e.transition)??"slide",h=(e==null?void 0:e.nav)??"classic",f=(e==null?void 0:e.navSize)??"m",v=U0[f],C=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,y=Re=>D.scalingValue(Re*C,n),S=(e==null?void 0:e.show)??"always",V=(e==null?void 0:e.controls)??null,N=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,q=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,W=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,I=(e==null?void 0:e.controlsColor)??hc.color,B=(e==null?void 0:e.controlsHoverColor)??hc.hover,$=(e==null?void 0:e.navColor)??bo.colors.inactive,T=(e==null?void 0:e.navPaginationColor)??bo.colors.pagination,k=(e==null?void 0:e.navBackgroundColor)??bo.colors.background,F=(e==null?void 0:e.linkColor)??ja.linkColor,g=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,O=w==="horizontal",P=p==="click",X=p==="drag",te=p==="auto"&&(!n||!!i),L=!n,H=m==="slide",U=h==="classic",de=S!=="never",ae=S==="on hover",A=D.scalingValue(N,n),ce={width:A,height:A,maxWidth:A},z=H&&c>1,[re,ee]=s.useState(0),[xe,Fe]=s.useState(z?1:0),[ye,b]=s.useState(!1),[M,E]=s.useState(!1),[j,Ce]=s.useState(!1),[Q,Te]=s.useState(0),[ie,ue]=s.useState(!1),[fe,K]=s.useState(!1),Z=s.useRef(!1),se=s.useRef(xe);se.current=xe;const Se=s.useRef(null),Me=s.useRef(0),$e=s.useRef(null),G=s.useRef(null),pe=s.useRef(null),oe=s.useRef(null),Y=s.useCallback(Re=>{Z.current=Re,b(Re)},[]),le=s.useCallback(Re=>{if(c<2||Re===0)return;const He=Re>0?1:-1,Be=Math.abs(Re);if(ue(!0),Y(!0),!H){ee(be=>Io(be+Re,c));return}let Ze=se.current;const he=z&&(Ze===0||Ze===c+1),ve=he?re+1:null;he&&(Ze=re+1);let We=Be;for(;We>0;){const be=J0(Ze,He,c,z);if(Ze=be.position,We-=1,be.hitBoundary){Me.current=We*He;break}}const Je=Be-We;if(Je>0&&ee(be=>Io(be+Je*He,c)),se.current=Ze,ve!==null){if(se.current=ve,Ze===ve){E(!0),Fe(Ze);return}Se.current=Ze,E(!0),Fe(ve);return}E(!1),Fe(Ze)},[re,c,z,H,Y]),_e=s.useCallback(Re=>{le(Re)},[le]),me=s.useCallback(Re=>{if(c<2)return;const He=Io(Re,c);if(!(He===re&&!Z.current)&&(ue(!0),Y(!0),ee(He),H)){const Be=He+(z?1:0);Se.current=null,Me.current=0,se.current=Be,E(!1),Fe(Be)}},[re,c,z,H,Y]);s.useEffect(()=>{if(!ye)return;const Re=window.setTimeout(()=>{if(z&&(xe===0||xe===c+1)){Se.current=null,E(!0),Fe(re+1);return}Y(!1)},qi);return()=>window.clearTimeout(Re)},[re,c,z,ye,Y,xe]),s.useEffect(()=>{if(!M)return;let Re=0;const He=requestAnimationFrame(()=>{Re=requestAnimationFrame(()=>{const Be=Se.current;Se.current=null;const Ze=Me.current;if(Me.current=0,E(!1),Be!==null){se.current=Be,Fe(Be);return}if(Ze!==0){le(Ze);return}Y(!1)})});return()=>{cancelAnimationFrame(He),cancelAnimationFrame(Re)}},[le,Y,M]);const J=`${z}:${c}`,Ke=s.useRef(J);s.useEffect(()=>{if(Ke.current===J)return;Ke.current=J;const Re=c>0?Math.min(re,c-1):0;pe.current=null,oe.current=null,Ce(!1),Te(0),ee(Re),E(!0),Fe(Re+(z?1:0))},[re,c,z,J]),s.useEffect(()=>{if(!ie)return;const Re=window.setTimeout(()=>ue(!1),V0);return()=>window.clearTimeout(Re)},[ie,re]),s.useEffect(()=>{if(!te||c<2)return;const Re=Math.max(x,.1)*1e3,He=window.setInterval(()=>{L&&fe||_e(1)},Re);return()=>window.clearInterval(He)},[x,c,_e,te,fe,L]);const ke=s.useCallback(Re=>{const He=pe.current;if(!He||He.pointerId!==Re.pointerId)return;pe.current=null,oe.current=null;const Be=$e.current;if(Be!=null&&Be.hasPointerCapture(Re.pointerId)&&Be.releasePointerCapture(Re.pointerId),!He.isActive){H&&Te(0);return}const he=!(Re.timeStamp-He.lastTime>q0)&&Math.abs(He.velocity)>Y0,ve=He.size>0&&Math.abs(He.offset-He.baseOffset)>He.size*X0;if(Ce(!1),!he&&!ve){Te(0);return}const We=ve?He.offset-He.baseOffset:He.velocity;let Je=1;ve&&He.size>0&&(Je=Math.max(1,Math.round(Math.abs(We)/He.size))),Te(0),le(We<0?Je:-Je)},[le,H]);s.useEffect(()=>{const Re=He=>{oe.current===null||He.pointerId!==oe.current||ke(He)};return window.addEventListener("pointerup",Re),window.addEventListener("pointercancel",Re),()=>{window.removeEventListener("pointerup",Re),window.removeEventListener("pointercancel",Re)}},[ke]);const tt=Re=>{const He=$e.current;if(!X||c<2||!He||Re.pointerType==="mouse"&&Re.button!==0)return;Se.current=null,Me.current=0,Z.current&&Y(!1);let Be=0;const Ze=G.current;if(H&&Ze){const he=O?Ze.offsetWidth:Ze.offsetHeight;if(he>0){const ve=Q0(Ze,O);let We=se.current;z&&(We===0||We===c+1)?(We=re+1,se.current=We,E(!0),Fe(We),Be=0):Be=ve+We*he,Te(Be)}}He.setPointerCapture(Re.pointerId),oe.current=Re.pointerId,pe.current={pointerId:Re.pointerId,startClientX:Re.clientX,startClientY:Re.clientY,axes:eb(He,`${r}-axis-probe`),size:O?He.offsetWidth:He.offsetHeight,isActive:!1,baseOffset:Be,offset:Be,lastTime:Re.timeStamp,velocity:0}},Ye=Re=>{const He=pe.current;if(!He||He.pointerId!==Re.pointerId)return;if(Re.pointerType==="mouse"&&Re.buttons===0){ke(Re);return}const Be=Re.clientX-He.startClientX,Ze=Re.clientY-He.startClientY,he=He.axes?tb(He.axes,Be,Ze):{x:Be,y:Ze},ve=O?he.x:he.y,We=O?he.y:he.x,Je=He.baseOffset+ve;if(!He.isActive){if(Math.max(Math.abs(ve),Math.abs(We))<G0)return;if(Math.abs(We)>Math.abs(ve)){const Ie=$e.current;Ie!=null&&Ie.hasPointerCapture(He.pointerId)&&Ie.releasePointerCapture(He.pointerId),pe.current=null,oe.current=null,H&&Te(0);return}He.isActive=!0,Ce(!0)}const be=Re.timeStamp-He.lastTime;be>0&&(He.velocity=(Je-He.offset)/be,He.lastTime=Re.timeStamp),He.offset=Je,H&&Te(Je)},dt=Re=>{ke(Re)},ot=O?`translate3d(calc(${-xe*100}% + ${Q}px), 0, 0)`:`translate3d(0, calc(${-xe*100}% + ${Q}px), 0)`,Ve=z?[d[c-1],...d,d[0]]:d;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:nb(r,n)}}),a.jsxs("div",{className:pt(`${r}-wrapper`,{[`${r}-transition-reveal`]:m==="reveal",[`${r}-transition-reveal-vertical`]:m==="reveal"&&!O}),onMouseEnter:()=>K(!0),onMouseLeave:()=>K(!1),children:[a.jsxs("div",{className:`${r}-slider-inner`,style:{backgroundColor:"transparent"},children:[a.jsx("div",{ref:$e,className:pt(`${r}-track`,{[`${r}-track-draggable`]:X,[`${r}-track-draggable-vertical`]:X&&!O}),onPointerDown:tt,onPointerMove:Ye,onPointerUp:dt,onPointerCancel:dt,onLostPointerCapture:Re=>{oe.current===Re.pointerId&&ke(Re)},children:a.jsx("div",{ref:G,className:pt(`${r}-list`,{[`${r}-list-slide`]:H,[`${r}-list-slide-vertical`]:H&&!O,[`${r}-list-fade`]:!H}),style:H?{transform:ot,transition:j||M?"none":`transform ${qi}ms ${tu}`}:void 0,children:Ve.map((Re,He)=>{const Be=z?Io(He-1,c):He,he=z&&(He===0||He===c+1)?`clone-${He===0?"start":"end"}`:`slide-${Be}`;return a.jsx("div",{className:pt(`${r}-slide`,{[`${r}-is-active`]:!H&&Be===re}),children:a.jsx("div",{className:`${r}-slider-item`,children:a.jsx("div",{className:`${r}-img-wrapper`,children:a.jsx("img",{className:pt(`${r}-slider-image`,{[`${r}-contain`]:Re.image.objectFit==="contain",[`${r}-cover`]:Re.image.objectFit==="cover"}),src:Re.image.url,alt:Re.image.name??"",draggable:!1})})})},he)})})}),de&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(`${r}-arrow`,{[`${r}-arrow-prev`]:O,[`${r}-arrow-prev-vertical`]:!O,[`${r}-hover-arrow`]:ae}),style:{color:I,"--arrow-hover-color":B,...ce},children:a.jsxs("button",{onClick:Re=>{Re.stopPropagation(),_e(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${D.scalingValue(q,n)}, ${D.scalingValue(W*(O?1:-1),n)}) rotate(${O?"0deg":"90deg"})`},children:[V&&a.jsx(sn,{url:V,fill:I,hoverFill:B,className:pt(`${r}-arrow-img`,`${r}-mirror`),style:ce}),!V&&a.jsx(yc,{color:I,className:pt(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:pt(`${r}-arrow`,{[`${r}-arrow-next`]:O,[`${r}-arrow-next-vertical`]:!O,[`${r}-hover-arrow`]:ae}),style:{color:I,"--arrow-hover-color":B,...ce},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:Re=>{Re.stopPropagation(),_e(1)},style:{transform:`translate(${D.scalingValue(q*(O?-1:1),n)}, ${D.scalingValue(W,n)}) rotate(${O?"0deg":"90deg"})`},children:[V&&a.jsx(sn,{url:V,fill:I,hoverFill:B,className:`${r}-arrow-img`,style:ce}),!V&&a.jsx(yc,{color:I,className:pt(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),P&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>_e(1)}),U&&a.jsx("div",{className:pt(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:O,[`${r}-pagination-inside-left`]:!O}),style:O?{bottom:y(v.inset)}:{left:y(v.inset)},children:a.jsx("div",{className:pt(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!O,[`${r}-animate-dots`]:ie}),style:{backgroundColor:k,gap:y(v.gapInactive-v.activeDot+v.dot),...O?{height:y(v.activeDot+v.paddingY*2),paddingTop:y(v.paddingY),paddingBottom:y(v.paddingY),paddingLeft:y(v.paddingActive),paddingRight:y(v.paddingActive)}:{width:y(v.activeDot+v.paddingY*2),paddingLeft:y(v.paddingY),paddingRight:y(v.paddingY),paddingTop:y(v.paddingActive),paddingBottom:y(v.paddingActive)},borderRadius:y(v.borderRadius),transform:`translate(${D.scalingValue(bo.offset.x,n)}, ${D.scalingValue(bo.offset.y,n)})`},children:d.map((Re,He)=>{const Be=He===re,Ze=Be?v.activeDot:v.dot;return a.jsx("button",{onClick:()=>me(He),className:`${r}-pagination-item`,style:{width:y(v.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:Be?T:$,width:y(Ze)}})},He)})},`${f}-${w}`)})]}),a.jsxs("div",{className:`${r}-caption-block`,children:[a.jsx("div",{"data-controls":o?"captionMarginTop":void 0,className:o?`${r}-control`:void 0,style:{height:D.scalingValue(g,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:d.map((Re,He)=>a.jsx("div",{className:pt(`${r}-caption-text`,{[`${r}-with-pointer-events`]:He===re&&n,[`${r}-active`]:He===re}),style:{...l,width:"max-content",transitionDuration:`${Math.round(qi/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":F,"--link-hover-color":F,position:"relative",top:D.scalingValue(ja.offset.y,n),left:D.scalingValue(ja.offset.x,n)},children:a.jsx(Ri,{content:Re.imageCaption})})},He))})]})]})]})}function yc({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 ob=`import React, { useCallback, useEffect, useRef, useState } from 'react';
19569
+ `}function ob({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=D.useScopedStyles(),l=J0(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??fc,p=u.sizeType??"drag",x=u.value??fc.value,w=(e==null?void 0:e.direction)??"horizontal",m=(e==null?void 0:e.transition)??"slide",h=(e==null?void 0:e.nav)??"classic",f=(e==null?void 0:e.navSize)??"m",v=K0[f],C=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,y=Ie=>D.scalingValue(Ie*C,n),S=(e==null?void 0:e.show)??"always",G=(e==null?void 0:e.controls)??null,W=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,U=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,H=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,I=(e==null?void 0:e.controlsColor)??hc.color,z=(e==null?void 0:e.controlsHoverColor)??hc.hover,$=(e==null?void 0:e.navColor)??bo.colors.inactive,T=(e==null?void 0:e.navPaginationColor)??bo.colors.pagination,A=(e==null?void 0:e.navBackgroundColor)??bo.colors.background,_=(e==null?void 0:e.linkColor)??ja.linkColor,g=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,B=w==="horizontal",P=p==="click",Y=p==="drag",ie=p==="auto"&&(!n||!!i),L=!n,O=m==="slide",K=h==="classic",ue=S!=="never",le=S==="on hover",F=D.scalingValue(W,n),pe={width:F,height:F,maxWidth:F},j=O&&c>1,[se,ne]=s.useState(0),[ve,Me]=s.useState(j?1:0),[xe,b]=s.useState(!1),[M,E]=s.useState(!1),[V,Se]=s.useState(!1),[te,$e]=s.useState(0),[re,ge]=s.useState(!1),[ye,Z]=s.useState(!1),Q=s.useRef(!1),ce=s.useRef(ve);ce.current=ve;const we=s.useRef(null),Pe=s.useRef(0),Ce=s.useRef(null),X=s.useRef(null),me=s.useRef(null),ae=s.useRef(null),q=s.useCallback(Ie=>{Q.current=Ie,b(Ie)},[]),de=s.useCallback(Ie=>{if(c<2||Ie===0)return;const We=Ie>0?1:-1,je=Math.abs(Ie);if(ge(!0),q(!0),!O){ne(Be=>Io(Be+Ie,c));return}let Ue=ce.current;const k=j&&(Ue===0||Ue===c+1),ee=k?se+1:null;k&&(Ue=se+1);let Te=je;for(;Te>0;){const Be=Q0(Ue,We,c,j);if(Ue=Be.position,Te-=1,Be.hitBoundary){Pe.current=Te*We;break}}const He=je-Te;if(He>0&&ne(Be=>Io(Be+He*We,c)),ce.current=Ue,ee!==null){if(ce.current=ee,Ue===ee){E(!0),Me(Ue);return}we.current=Ue,E(!0),Me(ee);return}E(!1),Me(Ue)},[se,c,j,O,q]),ke=s.useCallback(Ie=>{de(Ie)},[de]),he=s.useCallback(Ie=>{if(c<2)return;const We=Io(Ie,c);if(!(We===se&&!Q.current)&&(ge(!0),q(!0),ne(We),O)){const je=We+(j?1:0);we.current=null,Pe.current=0,ce.current=je,E(!1),Me(je)}},[se,c,j,O,q]);s.useEffect(()=>{if(!xe)return;const Ie=window.setTimeout(()=>{if(j&&(ve===0||ve===c+1)){we.current=null,E(!0),Me(se+1);return}q(!1)},qi);return()=>window.clearTimeout(Ie)},[se,c,j,xe,q,ve]),s.useEffect(()=>{if(!M)return;let Ie=0;const We=requestAnimationFrame(()=>{Ie=requestAnimationFrame(()=>{const je=we.current;we.current=null;const Ue=Pe.current;if(Pe.current=0,E(!1),je!==null){ce.current=je,Me(je);return}if(Ue!==0){de(Ue);return}q(!1)})});return()=>{cancelAnimationFrame(We),cancelAnimationFrame(Ie)}},[de,q,M]);const J=`${j}:${c}`,Ne=s.useRef(J);s.useEffect(()=>{if(Ne.current===J)return;Ne.current=J;const Ie=c>0?Math.min(se,c-1):0;me.current=null,ae.current=null,Se(!1),$e(0),ne(Ie),E(!0),Me(Ie+(j?1:0))},[se,c,j,J]),s.useEffect(()=>{if(!re)return;const Ie=window.setTimeout(()=>ge(!1),G0);return()=>window.clearTimeout(Ie)},[re,se]),s.useEffect(()=>{if(!ie||c<2)return;const Ie=Math.max(x,.1)*1e3,We=window.setInterval(()=>{L&&ye||ke(1)},Ie);return()=>window.clearInterval(We)},[x,c,ke,ie,ye,L]);const Fe=s.useCallback(Ie=>{const We=me.current;if(!We||We.pointerId!==Ie.pointerId)return;me.current=null,ae.current=null;const je=Ce.current;if(je!=null&&je.hasPointerCapture(Ie.pointerId)&&je.releasePointerCapture(Ie.pointerId),!We.isActive){O&&$e(0);return}const k=!(Ie.timeStamp-We.lastTime>U0)&&Math.abs(We.velocity)>q0,ee=We.size>0&&Math.abs(We.offset-We.baseOffset)>We.size*Y0;if(Se(!1),!k&&!ee){$e(0);return}const Te=ee?We.offset-We.baseOffset:We.velocity;let He=1;ee&&We.size>0&&(He=Math.max(1,Math.round(Math.abs(Te)/We.size))),$e(0),de(Te<0?He:-He)},[de,O]);s.useEffect(()=>{const Ie=We=>{ae.current===null||We.pointerId!==ae.current||Fe(We)};return window.addEventListener("pointerup",Ie),window.addEventListener("pointercancel",Ie),()=>{window.removeEventListener("pointerup",Ie),window.removeEventListener("pointercancel",Ie)}},[Fe]);const et=Ie=>{const We=Ce.current;if(!Y||c<2||!We||Ie.pointerType==="mouse"&&Ie.button!==0)return;we.current=null,Pe.current=0,Q.current&&q(!1);let je=0;const Ue=X.current;if(O&&Ue){const k=B?Ue.offsetWidth:Ue.offsetHeight;if(k>0){const ee=eb(Ue,B);let Te=ce.current;j&&(Te===0||Te===c+1)?(Te=se+1,ce.current=Te,E(!0),Me(Te),je=0):je=ee+Te*k,$e(je)}}We.setPointerCapture(Ie.pointerId),ae.current=Ie.pointerId,me.current={pointerId:Ie.pointerId,startClientX:Ie.clientX,startClientY:Ie.clientY,axes:tb(We,`${r}-axis-probe`),size:B?We.offsetWidth:We.offsetHeight,isActive:!1,baseOffset:je,offset:je,lastTime:Ie.timeStamp,velocity:0}},Je=Ie=>{const We=me.current;if(!We||We.pointerId!==Ie.pointerId)return;if(Ie.pointerType==="mouse"&&Ie.buttons===0){Fe(Ie);return}const je=Ie.clientX-We.startClientX,Ue=Ie.clientY-We.startClientY,k=We.axes?nb(We.axes,je,Ue):{x:je,y:Ue},ee=B?k.x:k.y,Te=B?k.y:k.x,He=We.baseOffset+ee;if(!We.isActive){if(Math.max(Math.abs(ee),Math.abs(Te))<X0)return;if(Math.abs(Te)>Math.abs(ee)){const Ve=Ce.current;Ve!=null&&Ve.hasPointerCapture(We.pointerId)&&Ve.releasePointerCapture(We.pointerId),me.current=null,ae.current=null,O&&$e(0);return}We.isActive=!0,Se(!0)}const Be=Ie.timeStamp-We.lastTime;Be>0&&(We.velocity=(He-We.offset)/Be,We.lastTime=Ie.timeStamp),We.offset=He,O&&$e(He)},dt=Ie=>{Fe(Ie)},tt=B?`translate3d(calc(${-ve*100}% + ${te}px), 0, 0)`:`translate3d(0, calc(${-ve*100}% + ${te}px), 0)`,De=j?[d[c-1],...d,d[0]]:d;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ib(r,n)}}),a.jsxs("div",{className:pt(`${r}-wrapper`,{[`${r}-transition-reveal`]:m==="reveal",[`${r}-transition-reveal-vertical`]:m==="reveal"&&!B}),onMouseEnter:()=>Z(!0),onMouseLeave:()=>Z(!1),children:[a.jsxs("div",{className:`${r}-slider-inner`,style:{backgroundColor:"transparent"},children:[a.jsx("div",{ref:Ce,className:pt(`${r}-track`,{[`${r}-track-draggable`]:Y,[`${r}-track-draggable-vertical`]:Y&&!B}),onPointerDown:et,onPointerMove:Je,onPointerUp:dt,onPointerCancel:dt,onLostPointerCapture:Ie=>{ae.current===Ie.pointerId&&Fe(Ie)},children:a.jsx("div",{ref:X,className:pt(`${r}-list`,{[`${r}-list-slide`]:O,[`${r}-list-slide-vertical`]:O&&!B,[`${r}-list-fade`]:!O}),style:O?{transform:tt,transition:V||M?"none":`transform ${qi}ms ${nu}`}:void 0,children:De.map((Ie,We)=>{const je=j?Io(We-1,c):We,k=j&&(We===0||We===c+1)?`clone-${We===0?"start":"end"}`:`slide-${je}`;return a.jsx("div",{className:pt(`${r}-slide`,{[`${r}-is-active`]:!O&&je===se}),children:a.jsx("div",{className:`${r}-slider-item`,children:a.jsx("div",{className:`${r}-img-wrapper`,children:a.jsx("img",{className:pt(`${r}-slider-image`,{[`${r}-contain`]:Ie.image.objectFit==="contain",[`${r}-cover`]:Ie.image.objectFit==="cover"}),src:Ie.image.url,alt:Ie.image.name??"",draggable:!1})})})},k)})})}),ue&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(`${r}-arrow`,{[`${r}-arrow-prev`]:B,[`${r}-arrow-prev-vertical`]:!B,[`${r}-hover-arrow`]:le}),style:{color:I,"--arrow-hover-color":z,...pe},children:a.jsxs("button",{onClick:Ie=>{Ie.stopPropagation(),ke(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${D.scalingValue(U,n)}, ${D.scalingValue(H*(B?1:-1),n)}) rotate(${B?"0deg":"90deg"})`},children:[G&&a.jsx(sn,{url:G,fill:I,hoverFill:z,className:pt(`${r}-arrow-img`,`${r}-mirror`),style:pe}),!G&&a.jsx(yc,{color:I,className:pt(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:pt(`${r}-arrow`,{[`${r}-arrow-next`]:B,[`${r}-arrow-next-vertical`]:!B,[`${r}-hover-arrow`]:le}),style:{color:I,"--arrow-hover-color":z,...pe},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:Ie=>{Ie.stopPropagation(),ke(1)},style:{transform:`translate(${D.scalingValue(U*(B?-1:1),n)}, ${D.scalingValue(H,n)}) rotate(${B?"0deg":"90deg"})`},children:[G&&a.jsx(sn,{url:G,fill:I,hoverFill:z,className:`${r}-arrow-img`,style:pe}),!G&&a.jsx(yc,{color:I,className:pt(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),P&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>ke(1)}),K&&a.jsx("div",{className:pt(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:B,[`${r}-pagination-inside-left`]:!B}),style:B?{bottom:y(v.inset)}:{left:y(v.inset)},children:a.jsx("div",{className:pt(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!B,[`${r}-animate-dots`]:re}),style:{backgroundColor:A,gap:y(v.gapInactive-v.activeDot+v.dot),...B?{height:y(v.activeDot+v.paddingY*2),paddingTop:y(v.paddingY),paddingBottom:y(v.paddingY),paddingLeft:y(v.paddingActive),paddingRight:y(v.paddingActive)}:{width:y(v.activeDot+v.paddingY*2),paddingLeft:y(v.paddingY),paddingRight:y(v.paddingY),paddingTop:y(v.paddingActive),paddingBottom:y(v.paddingActive)},borderRadius:y(v.borderRadius),transform:`translate(${D.scalingValue(bo.offset.x,n)}, ${D.scalingValue(bo.offset.y,n)})`},children:d.map((Ie,We)=>{const je=We===se,Ue=je?v.activeDot:v.dot;return a.jsx("button",{onClick:()=>he(We),className:`${r}-pagination-item`,style:{width:y(v.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:je?T:$,width:y(Ue)}})},We)})},`${f}-${w}`)})]}),a.jsxs("div",{className:`${r}-caption-block`,children:[a.jsx("div",{"data-controls":o?"captionMarginTop":void 0,className:o?`${r}-control`:void 0,style:{height:D.scalingValue(g,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:d.map((Ie,We)=>a.jsx("div",{className:pt(`${r}-caption-text`,{[`${r}-with-pointer-events`]:We===se&&n,[`${r}-active`]:We===se}),style:{...l,width:"max-content",transitionDuration:`${Math.round(qi/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":_,"--link-hover-color":_,position:"relative",top:D.scalingValue(ja.offset.y,n),left:D.scalingValue(ja.offset.x,n)},children:a.jsx(Ri,{content:Ie.imageCaption})})},We))})]})]})]})}function yc({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 rb=`import React, { useCallback, useEffect, useRef, useState } from 'react';
19570
19570
  import cn from 'classnames';
19571
19571
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
19572
19572
  import { scalingValue } from '../utils/scalingValue';
@@ -20747,14 +20747,14 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
20747
20747
  </svg>
20748
20748
  );
20749
20749
  }
20750
- `,rb={type:"object",version:1,settings:{sizing:"manual",properties:{trigger:{type:"object",scope:"common",title:"Trigger",display:{type:"toggle-cycle-numeric-input",enum:["click","drag","auto"],inputs:{click:"none",drag:"none",auto:"single"},defaultValue:3,showDash:!1},min:1,max:5,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical"]}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["slide","fade in","reveal"]}},nav:{type:"string",scope:"common",title:"Nav",display:{type:"toggle-cycle",enum:["classic","no"]}},navSize:{type:"string",scope:"layout",title:"Nav Size",display:{type:"toggle-cycle",enum:["s","m","l"]}},navUnit:{type:"number",scope:"layout",title:"",display:{type:"numeric-input",visible:!1},min:0,max:1},controls:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},controlsMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"numeric-input"},min:0,max:9999},show:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","on hover","never"]}},paddingX:{type:"number",scope:"layout",title:"Padding X",display:{type:"numeric-input"},min:-9999,max:9999},paddingY:{type:"number",scope:"layout",title:"Padding Y",display:{type:"numeric-input"},min:-9999,max:9999},controlsColor:{type:"string",scope:"common",title:"Controls Default",display:{type:"palette-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"palette-color-picker"}},navColor:{type:"string",scope:"common",title:"Dot Nav",display:{type:"palette-color-picker"}},navPaginationColor:{type:"string",scope:"common",title:"Active Nav",display:{type:"palette-color-picker"}},navBackgroundColor:{type:"string",scope:"common",title:"BG Nav",display:{type:"palette-color-picker"}},linkColor:{type:"string",scope:"common",title:"Link Default",display:{type:"palette-color-picker"}},titleColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{type:"object",scope:"common",title:"",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},titleFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{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"]}}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:100,display:{type:"range-control"}}},defaults:{trigger:{sizeType:"drag",value:3,min:1,max:5},direction:"horizontal",transition:"slide",nav:"classic",controls:null,show:"always",controlsColor:"#000000",controlsHoverColor:"#3F3F3F",navColor:"#A4A4A4",navPaginationColor:"#FFFFFF",navBackgroundColor:"#000000",linkColor:"#2E12F0",titleColor:"#000000",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{controlsMaxWidth:30/1440,paddingX:0,paddingY:0,captionMarginTop:10/1440,titleFontSize:16/1440,titleLineHeight:16/1440,navSize:"m",navUnit:1/1440},t:{controlsMaxWidth:30/768,paddingX:-10/768,paddingY:0,captionMarginTop:10/768,titleFontSize:16/768,titleLineHeight:16/768,navSize:"m",navUnit:1/768},m:{controlsMaxWidth:30/375,paddingX:-14/375,paddingY:0,captionMarginTop:10/375,titleFontSize:16/375,titleLineHeight:16/375,navSize:"m",navUnit:1/375}},displayRules:[{if:{name:"show",value:"never"},then:{name:"properties.controlsColor.display.visible",value:!1}},{if:{name:"show",value:"never"},then:{name:"properties.controlsHoverColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navPaginationColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navBackgroundColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navSize.display.visible",value:!1}}],layout:["__componentName__","trigger","direction","transition","nav","navSize","controls","controlsMaxWidth","show","paddingX","paddingY","captionMarginTop","titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["trigger","direction"]},{type:"row",title:"",items:["transition","nav"]},{type:"row",title:"",items:["navSize"]},{type:"group",title:"Controls",items:[{type:"row",title:"",items:["controls","controlsMaxWidth"]},{type:"row",title:"",items:["paddingX","paddingY"]},{type:"row",title:"",items:["show"]}]}]},{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"]}]}],paletteBookmark:{items:["controlsColor","controlsHoverColor","navPaginationColor","navColor","navBackgroundColor","titleColor","linkColor"],panelIds:["general","typeStyle"]},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/Component-default-1.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Earth-orbital mission"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Salton Sea from Above"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Lunar Module Pilot"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Lunar Module 3 porch"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Command Module"}]}]}]}},ab={element:ib,id:"slider-2-0",name:"Slider 2.0",category:"galleries",version:1,defaultSize:{d:{width:400,height:400},t:{width:400,height:400},m:{width:300,height:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Slider.mp4"},schema:rb,sourceCode:ob,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls"}]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily"}},Oi=300/1440,sb=8/1440,vi=.004;function lb(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function xc(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function vc(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:D.scalingValue((o-t)/2,i)}}function cb(e){return`
20750
+ `,ab={type:"object",version:1,settings:{sizing:"manual",properties:{trigger:{type:"object",scope:"common",title:"Trigger",display:{type:"toggle-cycle-numeric-input",enum:["click","drag","auto"],inputs:{click:"none",drag:"none",auto:"single"},defaultValue:3,showDash:!1},min:1,max:5,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical"]}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["slide","fade in","reveal"]}},nav:{type:"string",scope:"common",title:"Nav",display:{type:"toggle-cycle",enum:["classic","no"]}},navSize:{type:"string",scope:"layout",title:"Nav Size",display:{type:"toggle-cycle",enum:["s","m","l"]}},navUnit:{type:"number",scope:"layout",title:"",display:{type:"numeric-input",visible:!1},min:0,max:1},controls:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},controlsMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"numeric-input"},min:0,max:9999},show:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","on hover","never"]}},paddingX:{type:"number",scope:"layout",title:"Padding X",display:{type:"numeric-input"},min:-9999,max:9999},paddingY:{type:"number",scope:"layout",title:"Padding Y",display:{type:"numeric-input"},min:-9999,max:9999},controlsColor:{type:"string",scope:"common",title:"Controls Default",display:{type:"palette-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"palette-color-picker"}},navColor:{type:"string",scope:"common",title:"Dot Nav",display:{type:"palette-color-picker"}},navPaginationColor:{type:"string",scope:"common",title:"Active Nav",display:{type:"palette-color-picker"}},navBackgroundColor:{type:"string",scope:"common",title:"BG Nav",display:{type:"palette-color-picker"}},linkColor:{type:"string",scope:"common",title:"Link Default",display:{type:"palette-color-picker"}},titleColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{type:"object",scope:"common",title:"",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},titleFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{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"]}}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:100,display:{type:"range-control"}}},defaults:{trigger:{sizeType:"drag",value:3,min:1,max:5},direction:"horizontal",transition:"slide",nav:"classic",controls:null,show:"always",controlsColor:"#000000",controlsHoverColor:"#3F3F3F",navColor:"#A4A4A4",navPaginationColor:"#FFFFFF",navBackgroundColor:"#000000",linkColor:"#2E12F0",titleColor:"#000000",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{controlsMaxWidth:30/1440,paddingX:0,paddingY:0,captionMarginTop:10/1440,titleFontSize:16/1440,titleLineHeight:16/1440,navSize:"m",navUnit:1/1440},t:{controlsMaxWidth:30/768,paddingX:-10/768,paddingY:0,captionMarginTop:10/768,titleFontSize:16/768,titleLineHeight:16/768,navSize:"m",navUnit:1/768},m:{controlsMaxWidth:30/375,paddingX:-14/375,paddingY:0,captionMarginTop:10/375,titleFontSize:16/375,titleLineHeight:16/375,navSize:"m",navUnit:1/375}},displayRules:[{if:{name:"show",value:"never"},then:{name:"properties.controlsColor.display.visible",value:!1}},{if:{name:"show",value:"never"},then:{name:"properties.controlsHoverColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navPaginationColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navBackgroundColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navSize.display.visible",value:!1}}],layout:["__componentName__","trigger","direction","transition","nav","navSize","controls","controlsMaxWidth","show","paddingX","paddingY","captionMarginTop","titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["trigger","direction"]},{type:"row",title:"",items:["transition","nav"]},{type:"row",title:"",items:["navSize"]},{type:"group",title:"Controls",items:[{type:"row",title:"",items:["controls","controlsMaxWidth"]},{type:"row",title:"",items:["paddingX","paddingY"]},{type:"row",title:"",items:["show"]}]}]},{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"]}]}],paletteBookmark:{items:["controlsColor","controlsHoverColor","navPaginationColor","navColor","navBackgroundColor","titleColor","linkColor"],panelIds:["general","typeStyle"]},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/Component-default-1.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Earth-orbital mission"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Salton Sea from Above"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Lunar Module Pilot"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Lunar Module 3 porch"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Command Module"}]}]}]}},sb={element:ob,id:"slider-2-0",name:"Slider 2.0",category:"galleries",version:1,defaultSize:{d:{width:400,height:400},t:{width:400,height:400},m:{width:300,height:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Slider.mp4"},schema:ab,sourceCode:rb,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls"}]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily"}},Oi=300/1440,lb=8/1440,vi=.004;function cb(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function xc(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function vc(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:D.scalingValue((o-t)/2,i)}}function db(e){return`
20751
20751
  .${e}-wrapper {
20752
20752
  box-sizing: border-box;
20753
20753
  display: flex;
20754
20754
  flex-direction: column;
20755
20755
  position: relative;
20756
20756
  width: 100%;
20757
- min-height: ${lb(48)};
20757
+ min-height: ${cb(48)};
20758
20758
  }
20759
20759
  .${e}-single-title-layer {
20760
20760
  position: absolute;
@@ -20964,7 +20964,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
20964
20964
  width: var(--cntrl-article-width, 100vw) !important;
20965
20965
  height: var(--cntrl-viewport-height, 100vh) !important;
20966
20966
  }
20967
- `}const db="rgba(28,31,34,0.9)",An=500,xi="cubic-bezier(0.22, 1, 0.36, 1)",ub=72,pb=50,mb={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},gb=[];function hb(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 fb(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function yb(e){const[t]=e.media;return t!=null&&t.url?t:null}function xb(e){if(!Array.isArray(e)||e.length===0)return[];if(hb(e)){const t=[];for(const n of e){const i=fb(n);if(!i)continue;const o=yb(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 us(e){return e.type==="video"}function vb(e){e.pause(),e.removeAttribute("src"),e.load()}function Sr(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function bb(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const wb=1140/1440;function Sb(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 Cb(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 $b(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Tb({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()=>{vb(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 Ib({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const x=i==="cover",w=s.useRef(null),m=s.useRef(null),h=s.useRef(null),f=s.useRef(0),v=s.useRef(0),C=s.useRef("none"),y=s.useRef(!1),S=s.useRef(!1),V=s.useRef(!1),N=s.useRef(null),[q,W]=s.useState(null),[I,B]=s.useState("opening"),[$,T]=s.useState(0),[k,F]=s.useState(0),[g,O]=s.useState(!1),[P,X]=s.useState(!1),[te,L]=s.useState(!1),H=s.useRef(n),U=t[n],de=U?us(U):!1,ae=k!==0||g,A=s.useCallback(ie=>{V.current=ie,O(ie)},[]),ce=s.useCallback(()=>{N.current!==null&&(window.clearTimeout(N.current),N.current=null)},[]),z=s.useCallback(()=>{ce(),N.current=window.setTimeout(()=>{ce(),A(!1)},An+32)},[ce,A]),re=s.useCallback(()=>{const ie=w.current,ue=m.current;if(!ie)return;const fe=ie.getBoundingClientRect(),K=fe.width,Z=fe.height;if(!K||!Z)return;if(i==="cover"){W({width:K,height:Z,left:fe.left,top:fe.top});return}if(!ue){W(Sr(ie));return}const{width:se,height:Se}=bb(ue);if(!se||!Se){W(Sr(ie));return}const Me=se/Se,$e=K/Z;if(Me>$e){const G=K/Me;W({width:K,height:G,left:fe.left,top:fe.top+(Z-G)/2})}else{const G=Z*Me;W({width:G,height:Z,left:fe.left+(K-G)/2,top:fe.top})}},[i]);s.useEffect(()=>{re();const ie=w.current;if(!ie)return;const ue=new ResizeObserver(()=>re());return ue.observe(ie),()=>ue.disconnect()},[re,n]),s.useEffect(()=>{I==="opening"&&q&&B("open")},[I,q]),s.useEffect(()=>{if(I!=="closing")return;const ie=setTimeout(()=>r(),An);return()=>clearTimeout(ie)},[I,r]),s.useEffect(()=>()=>{ce()},[ce]),s.useLayoutEffect(()=>{if(H.current===n)return;ce(),T(0),F(0),A(!1),L(!1),X(!1),f.current=0,v.current=0,C.current="none",y.current=!1,h.current=null,S.current=!1;const ie=w.current;ie&&W(Sr(ie)),H.current=n},[n,A,ce]),s.useEffect(()=>{if(I!=="open")return;let ie=null;const ue=()=>{ie&&(document.removeEventListener("click",ie,!0),ie=null)},fe=()=>{ue(),ie=$e=>{$e.stopPropagation(),$e.preventDefault(),ue()},document.addEventListener("click",ie,!0)},K=$e=>{ce(),V.current=!1,O(!1),F(0),X(!1),y.current=!1,v.current=0,C.current="none";const G=w.current;G&&W(Sr(G)),$e<0?d():l()},Z=$e=>{if(Math.abs($e)>pb&&t.length>1){K($e);return}A(!0),F(0),z()},se=$e=>{if($e.touches.length!==1||V.current)return;const G=$e.touches[0];S.current=!0,h.current={x:G.clientX,y:G.clientY},C.current="none",v.current=0,y.current=!1},Se=$e=>{if(!h.current||$e.touches.length!==1||V.current)return;const G=$e.touches[0],pe=G.clientX-h.current.x,oe=G.clientY-h.current.y;if(C.current==="none"){if(Math.abs(pe)<10&&Math.abs(oe)<10)return;if(Math.abs(pe)>Math.abs(oe)){if(t.length<=1)return;C.current="horizontal"}else if(oe>0)C.current="vertical";else return}if(C.current==="horizontal"){y.current=!0,X(!0),v.current=pe,F(pe),$e.preventDefault();return}C.current==="vertical"&&(y.current=!0,X(!0),f.current=oe,T(oe),$e.preventDefault())},Me=()=>{if(!h.current)return;const $e=C.current,G=y.current;if(G&&$e==="horizontal")Z(v.current),fe();else if(G&&$e==="vertical")if(f.current>ub){const oe=window.innerHeight;f.current=oe,L(!0),T(oe),B("closing")}else f.current=0,T(0),fe();else $e==="horizontal"&&Math.abs(v.current)>0&&(Z(v.current),fe());h.current=null,C.current="none",v.current=0,y.current=!1,X(!1)};return document.addEventListener("touchstart",se,{passive:!0}),document.addEventListener("touchmove",Se,{passive:!1}),document.addEventListener("touchend",Me),document.addEventListener("touchcancel",Me),()=>{document.removeEventListener("touchstart",se),document.removeEventListener("touchmove",Se),document.removeEventListener("touchend",Me),document.removeEventListener("touchcancel",Me),ue()}},[I,t.length,d,l,A,z,ce]),s.useEffect(()=>{const ie=ue=>{ue.key==="Escape"&&(ue.preventDefault(),ue.stopPropagation(),I!=="closing"&&B("closing"))};return window.addEventListener("keydown",ie,!0),()=>window.removeEventListener("keydown",ie,!0)},[I]);const ee=()=>{I!=="closing"&&B("closing")},xe=I==="open",Fe=I==="closing",ye=$>0?Math.max(0,1-$/500):1,b=$>0?Math.max(.35,1-$/500):1,M=ie=>{if(ie.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const ue=ie.currentTarget.getBoundingClientRect(),fe=ie.clientY-ue.top,K=Math.min(52,ue.height*.2);if(!(fe>ue.height-K)){if(ie.clientX-ue.left<ue.width/2){l();return}d()}},E=ie=>{if(t.length<=1)return;const ue=ie.currentTarget.getBoundingClientRect(),fe=ie.clientX-ue.left,K=ie.clientY-ue.top,Z=Math.min(52,ue.height*.2);if(K>ue.height-Z){ie.currentTarget.style.cursor="default";return}ie.currentTarget.style.cursor=fe<ue.width/2?"w-resize":"e-resize"},j=s.useCallback(ie=>{ie.propertyName!=="transform"||!V.current||(ce(),A(!1))},[ce,A]),Ce=ae?`translateX(${k}px)`:$>0?`translateY(${$}px)`:void 0,Q={position:"fixed",top:q==null?void 0:q.top,left:q==null?void 0:q.left,width:q==null?void 0:q.width,height:q==null?void 0:q.height,objectFit:i==="cover"?"cover":"contain",transform:Ce,opacity:$>0?b:I==="opening"||Fe?0:1,transition:P&&!g?"none":g?`transform ${An}ms ${xi}`:te?`transform ${An}ms ${xi}, opacity ${An}ms ${xi}`:I==="opening"||Fe?`opacity ${An}ms ${xi}`:"none",pointerEvents:de&&xe&&!ae?"auto":"none",touchAction:de&&xe?"none":void 0,zIndex:9998},Te=q?{position:"fixed",top:q.top,height:q.height,width:q.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:I==="open"?"none":void 0},onClick:ee,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:xe?ye:0,transition:P?"none":`opacity ${An}ms ${xi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:x?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:w,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:xe?1:0,transition:`opacity ${An}ms ${xi}`,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:w,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:xe?1:0,transition:`opacity ${An}ms ${xi}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),q&&U&&(de?a.jsx(Tb,{src:U.url,phase:I,mediaRef:m,mediaStyle:Q,onLoadedMetadata:re,onClick:M,onMouseMove:E,onTransitionEnd:j},`${n}-${U.url}`):a.jsx("img",{ref:m,src:U.url,alt:U.name,onLoad:re,onTransitionEnd:j,style:Q},`${n}-${U.url}`)),xe&&Te&&t.length>1&&!de&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Te,left:q.left,cursor:"w-resize",pointerEvents:ae?"none":"auto"},onClick:ie=>{if(S.current){S.current=!1;return}ie.stopPropagation(),l()}}),a.jsx("div",{style:{...Te,left:q.left+q.width/2,cursor:"e-resize",pointerEvents:ae?"none":"auto"},onClick:ie=>{if(S.current){S.current=!1;return}ie.stopPropagation(),d()}})]})]})}function bc({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 x=`${e}-gallery-${us(t)?"video":"image"}`,w=r.display==="cover",m=Cb(r),h=I=>D.scalingValue(I,l??!1),f=n??Oi,v=o?{width:"100%",maxWidth:"100%"}:{width:h(f),maxWidth:"100%"},C=i?{borderRadius:h(i)}:{},y={...v,...w?{aspectRatio:m,height:"auto",overflow:"hidden"}:{},...C},S={...w?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":h(f)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...w?{}:C},N={className:x,style:S,onClick:p?I=>{I.stopPropagation(),p()}:void 0},q=Math.max(d,vi),W=us(t)?a.jsx("video",{...N,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...N,src:t.url,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[w?a.jsx("div",{style:y,children:W}):W,c&&d>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:h(d)},"aria-hidden":"true"}),u&&c&&a.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:h(q)}})]})}function Rb({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const x=t==="a"?i:t==="c"?o:0,w=x>0||c;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&w&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(x)},"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"&&w&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(x)},"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 Lb(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function wc({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 Sc({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 Va({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),[x,w]=s.useState(0),m=t??"",h=n==="left"||n==="center"||n==="right";return s.useLayoutEffect(()=>{if(!h)return;const f=p.current;if(!f||typeof ResizeObserver>"u")return;const v=()=>w(f.offsetHeight);v();const C=new ResizeObserver(v);return C.observe(f),()=>C.disconnect()},[m,h]),a.jsx("div",{ref:f=>{p.current=f,i(f)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...h?{[`--${e}-title-height`]:`${x}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:m})})]})})}const Cc=45;function $c(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 Pb(e){const t=$c(e,"--cntrl-viewport-height",window.innerHeight),n=$c(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function Eb(e,t,n){const{top:i,centerY:o}=Pb(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 Mb(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=Eb(u,n,c);return Math.exp(-(p*p)/(2*Cc*Cc))});let o=0,r=-1;return i.forEach((l,d)=>{l>r&&(r=l,o=d)}),{opacities:i,dominantIndex:o}}function kb(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(Mb(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 Ab(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 Fb({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var nt;const{prefix:l}=D.useScopedStyles(),d=s.useMemo(()=>cb(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",x=(e==null?void 0:e.imgWidth)??Oi,w=(e==null?void 0:e.titleWidth)??wb,m=Sb(e==null?void 0:e.imageDisplay),h=(e==null?void 0:e.cornerRadius)??sb,f=(e==null?void 0:e.position)??"center",v=(e==null?void 0:e.titleTopPadding)??0,C=(e==null?void 0:e.titleLeftPadding)??0,y=(e==null?void 0:e.titleRightPadding)??0,S=Lb(e==null?void 0:e.transition),V=(e==null?void 0:e.lightbox)??"on",N=p==="b",q=S==="fade"||S==="retype",{setTitleRef:W,dominantIndex:I}=kb(c.length,q,f),B=((nt=c[I])==null?void 0:nt.title)??"",$=Ab(B,S==="retype"),T=S==="fade"||S==="retype",k=S==="retype"?$:B,F=N?void 0:{width:D.scalingValue(x,n??!1)},g=V==="on"&&(!n||i||o),O=o??!1,P=(e==null?void 0:e.galleryPaddingRight)??0,X=(e==null?void 0:e.galleryPaddingLeft)??0,te=(e==null?void 0:e.galleryPaddingBetween)??0,L=it=>D.scalingValue(it,n??!1),U={width:L(w)},de=p==="a"?P:X,ae=N?{width:"100%"}:{width:`calc(100% - ${L(x)} - ${L(de)})`,...p==="c"?{marginLeft:"auto"}:{}},A=Math.max(P,vi),ce=Math.max(X,vi),z=Math.max(te,vi),re=Math.max(v,vi),ee=Math.max(C,vi),xe=Math.max(y,vi),Fe=Math.max(0,(u??1)-(x??Oi)),ye=p==="a"?Math.max(0,(u??1)-(x??Oi)-P):p==="c"?Math.max(0,(u??1)-(x??Oi)-X):p==="b"?u??1:1,b=O&&(p==="a"||p==="b"||p==="c")&&f==="top",M=O&&((p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")),E=O&&((p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"),j=c.length>1,Ce=N?void 0:L((p==="c"?X:P)+(x??Oi)),Q=p==="c"&&Ce?{left:Ce}:void 0,Te=p==="a"&&Ce?{right:Ce}:void 0,ie=N?{left:0,width:"100%"}:p==="a"?{right:L(P),width:L(x)}:{left:L(X),width:L(x)},{titleColor:ue,titleFontFamily:fe,titleFontSettings:K,titleFontSize:Z,titleLineHeight:se,titleLetterSpacing:Se,titleWordSpacing:Me,titleAlign:$e,titleTextAppearance:G,lightboxCounterColor:pe,lightboxCounterFontFamily:oe,lightboxCounterFontSettings:Y,lightboxCounterFontSize:le,lightboxCounterLineHeight:_e,lightboxCounterLetterSpacing:me,lightboxCounterWordSpacing:J,lightboxCounterTextAppearance:Ke}=e??{},ke={fontSettings:{fontFamily:fe,fontWeight:(K==null?void 0:K.fontWeight)??400,fontStyle:(K==null?void 0:K.fontStyle)??"normal"},fontSize:Z??.01,lineHeight:se,letterSpacing:Se??0,wordSpacing:Me??0,textAlign:$e??"left",textAppearance:G,color:ue??"#000000"},Ye=an(Ut(ke,n)),dt=U,ot=vc(Z,se,l,n),Ve=xc(Z,se,`${l}-title`,`${l}-text-tight-leading`),Re={fontSettings:{fontFamily:oe,fontWeight:(Y==null?void 0:Y.fontWeight)??400,fontStyle:(Y==null?void 0:Y.fontStyle)??"normal"},fontSize:le??.01,lineHeight:_e,letterSpacing:me??0,wordSpacing:J??0,textAppearance:Ke,color:pe??"#DEDDDD"},Be={...an(Ut(Re,n)),...vc(le,_e,l,n)},Ze=xc(le,_e,`${l}-lightbox-counter`,`${l}-text-tight-leading`),he=D.buildColorVars(l,{titleColor:ue??"#000000",lightboxCounterColor:pe??"#DEDDDD"},mb,gb),ve=s.useRef(null),[We,Je]=s.useState(!1),[be,Ie]=s.useState([]),[qe,ze]=s.useState(0),Le=s.useCallback((it,ct)=>{g&&(Ie(it),ze(ct),Je(!0))},[g]),Ge=s.useCallback(()=>{Je(!1)},[]),De=s.useMemo(()=>{const it={...he},ct=ve.current?getComputedStyle(ve.current).getPropertyValue("--cntrl-article-width").trim():"";return ct&&(it["--cntrl-article-width"]=ct),it},[he,We]);return s.useEffect(()=>{if(!We||V!=="on"||typeof document>"u")return;const it=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=it}},[We,V]),s.useEffect(()=>{!n||o||i||Je(!1)},[n,o,i]),s.useEffect(()=>{V==="off"&&Je(!1)},[V]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx("div",{style:he,children:a.jsxs("div",{ref:ve,className:`${l}-wrapper`,style:{width:D.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&f==="top"?L(v):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")?L(C):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"?L(y):void 0},children:[T&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(Va,{P:l,title:k,position:f,titleRef:()=>{},titleClassName:`${Ve} ${l}-single-title`,titleContainerStyle:{...ot,...ae},titleTextBoxStyle:dt,titleStyle:Ye,showTextBoxOutline:O,topPaddingControl:b?wc({P:l,scaled:L,height:re,paired:!1}):void 0})}),c.map((it,ct)=>{const St=xb(it.gallery),Bt=ct<c.length-1,zt=St.filter(wt=>wt.lightboxMedia).map(wt=>wt.lightboxMedia),ft={P:l,position:f,titleRef:W(ct),titleClassName:Ve,titleContainerStyle:ot,titleTextBoxStyle:T?{maxWidth:"100%"}:dt,titleStyle:Ye,showTextBoxOutline:O&&!T,topPaddingControl:b&&!T?wc({P:l,scaled:L,height:re,paired:j}):void 0};return a.jsxs("div",{"data-item-index":ct,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Bt?L(te):void 0},children:[M&&Sc({P:l,controlKey:"titleLeftPadding",scaled:L,width:ee,maxFraction:ye,side:"left",paired:j,anchorStyle:Q}),E&&Sc({P:l,controlKey:"titleRightPadding",scaled:L,width:xe,maxFraction:ye,side:"right",paired:j,anchorStyle:Te}),O&&Bt&&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:L(z),...ie}}),N?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:St.map(({displayMedia:wt,lightboxMedia:jt},At)=>{const vt=jt?zt.findIndex(Ft=>Ft.url===jt.url):-1;return a.jsx(bc,{P:l,media:wt,imgWidth:x||void 0,cornerRadius:h||void 0,imageDisplay:m,isEditor:n,galleryPaddingBetween:te,showPaddingAfter:At<St.length-1,showControls:O,onMediaClick:g&&vt>=0?()=>Le(zt,vt):void 0},`${wt.url}-${At}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(Va,{...ft,title:T?"":it.title})})]}):a.jsxs(a.Fragment,{children:[a.jsx(Va,{...ft,title:T?"":it.title}),St.length>0&&a.jsx(Rb,{P:l,layoutType:p,galleryWidthStyle:F,galleryPaddingRight:P,galleryPaddingLeft:X,galleryPaddingRightWidth:A,galleryPaddingLeftWidth:ce,galleryPaddingMaxFraction:Fe,showControls:O,scaled:L,children:St.map(({displayMedia:wt,lightboxMedia:jt},At)=>{const vt=jt?zt.findIndex(Ft=>Ft.url===jt.url):-1;return a.jsx(bc,{P:l,media:wt,cornerRadius:h||void 0,fillGalleryWidth:!0,imageDisplay:m,isEditor:n,galleryPaddingBetween:te,showPaddingAfter:At<St.length-1,showControls:O,onMediaClick:g&&vt>=0?()=>Le(zt,vt):void 0},`${wt.url}-${At}`)})})]})]},ct)})]})}),We&&V==="on"&&typeof document<"u"&&e&&(()=>{const it=(r?document.getElementById(r):null)??document.body;return zn.createPortal(a.jsx("div",{style:De,"data-selection":"none",children:a.jsx(Ib,{prefix:l,items:be,index:qe,imageDisplay:$b(e.lightboxImageDisplay),isEditor:n,onClose:Ge,onPrev:()=>ze(ct=>(ct-1+be.length)%be.length),onNext:()=>ze(ct=>(ct+1)%be.length),counterClassName:Ze,counterStyle:Be,backgroundColor:e.backgroundColor??db})}),it)})()]})}const _b=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
20967
+ `}const ub="rgba(28,31,34,0.9)",An=500,xi="cubic-bezier(0.22, 1, 0.36, 1)",pb=72,mb=50,gb={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},hb=[];function fb(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 yb(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function xb(e){const[t]=e.media;return t!=null&&t.url?t:null}function vb(e){if(!Array.isArray(e)||e.length===0)return[];if(fb(e)){const t=[];for(const n of e){const i=yb(n);if(!i)continue;const o=xb(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 us(e){return e.type==="video"}function bb(e){e.pause(),e.removeAttribute("src"),e.load()}function Sr(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function wb(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const Sb=1140/1440;function Cb(e){return typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"2:3",reversed:(e==null?void 0:e.reversed)??!1}}function $b(e){const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`}function Tb(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Ib({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()=>{bb(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 Rb({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const x=i==="cover",w=s.useRef(null),m=s.useRef(null),h=s.useRef(null),f=s.useRef(0),v=s.useRef(0),C=s.useRef("none"),y=s.useRef(!1),S=s.useRef(!1),G=s.useRef(!1),W=s.useRef(null),[U,H]=s.useState(null),[I,z]=s.useState("opening"),[$,T]=s.useState(0),[A,_]=s.useState(0),[g,B]=s.useState(!1),[P,Y]=s.useState(!1),[ie,L]=s.useState(!1),O=s.useRef(n),K=t[n],ue=K?us(K):!1,le=A!==0||g,F=s.useCallback(re=>{G.current=re,B(re)},[]),pe=s.useCallback(()=>{W.current!==null&&(window.clearTimeout(W.current),W.current=null)},[]),j=s.useCallback(()=>{pe(),W.current=window.setTimeout(()=>{pe(),F(!1)},An+32)},[pe,F]),se=s.useCallback(()=>{const re=w.current,ge=m.current;if(!re)return;const ye=re.getBoundingClientRect(),Z=ye.width,Q=ye.height;if(!Z||!Q)return;if(i==="cover"){H({width:Z,height:Q,left:ye.left,top:ye.top});return}if(!ge){H(Sr(re));return}const{width:ce,height:we}=wb(ge);if(!ce||!we){H(Sr(re));return}const Pe=ce/we,Ce=Z/Q;if(Pe>Ce){const X=Z/Pe;H({width:Z,height:X,left:ye.left,top:ye.top+(Q-X)/2})}else{const X=Q*Pe;H({width:X,height:Q,left:ye.left+(Z-X)/2,top:ye.top})}},[i]);s.useEffect(()=>{se();const re=w.current;if(!re)return;const ge=new ResizeObserver(()=>se());return ge.observe(re),()=>ge.disconnect()},[se,n]),s.useEffect(()=>{I==="opening"&&U&&z("open")},[I,U]),s.useEffect(()=>{if(I!=="closing")return;const re=setTimeout(()=>r(),An);return()=>clearTimeout(re)},[I,r]),s.useEffect(()=>()=>{pe()},[pe]),s.useLayoutEffect(()=>{if(O.current===n)return;pe(),T(0),_(0),F(!1),L(!1),Y(!1),f.current=0,v.current=0,C.current="none",y.current=!1,h.current=null,S.current=!1;const re=w.current;re&&H(Sr(re)),O.current=n},[n,F,pe]),s.useEffect(()=>{if(I!=="open")return;let re=null;const ge=()=>{re&&(document.removeEventListener("click",re,!0),re=null)},ye=()=>{ge(),re=Ce=>{Ce.stopPropagation(),Ce.preventDefault(),ge()},document.addEventListener("click",re,!0)},Z=Ce=>{pe(),G.current=!1,B(!1),_(0),Y(!1),y.current=!1,v.current=0,C.current="none";const X=w.current;X&&H(Sr(X)),Ce<0?d():l()},Q=Ce=>{if(Math.abs(Ce)>mb&&t.length>1){Z(Ce);return}F(!0),_(0),j()},ce=Ce=>{if(Ce.touches.length!==1||G.current)return;const X=Ce.touches[0];S.current=!0,h.current={x:X.clientX,y:X.clientY},C.current="none",v.current=0,y.current=!1},we=Ce=>{if(!h.current||Ce.touches.length!==1||G.current)return;const X=Ce.touches[0],me=X.clientX-h.current.x,ae=X.clientY-h.current.y;if(C.current==="none"){if(Math.abs(me)<10&&Math.abs(ae)<10)return;if(Math.abs(me)>Math.abs(ae)){if(t.length<=1)return;C.current="horizontal"}else if(ae>0)C.current="vertical";else return}if(C.current==="horizontal"){y.current=!0,Y(!0),v.current=me,_(me),Ce.preventDefault();return}C.current==="vertical"&&(y.current=!0,Y(!0),f.current=ae,T(ae),Ce.preventDefault())},Pe=()=>{if(!h.current)return;const Ce=C.current,X=y.current;if(X&&Ce==="horizontal")Q(v.current),ye();else if(X&&Ce==="vertical")if(f.current>pb){const ae=window.innerHeight;f.current=ae,L(!0),T(ae),z("closing")}else f.current=0,T(0),ye();else Ce==="horizontal"&&Math.abs(v.current)>0&&(Q(v.current),ye());h.current=null,C.current="none",v.current=0,y.current=!1,Y(!1)};return document.addEventListener("touchstart",ce,{passive:!0}),document.addEventListener("touchmove",we,{passive:!1}),document.addEventListener("touchend",Pe),document.addEventListener("touchcancel",Pe),()=>{document.removeEventListener("touchstart",ce),document.removeEventListener("touchmove",we),document.removeEventListener("touchend",Pe),document.removeEventListener("touchcancel",Pe),ge()}},[I,t.length,d,l,F,j,pe]),s.useEffect(()=>{const re=ge=>{ge.key==="Escape"&&(ge.preventDefault(),ge.stopPropagation(),I!=="closing"&&z("closing"))};return window.addEventListener("keydown",re,!0),()=>window.removeEventListener("keydown",re,!0)},[I]);const ne=()=>{I!=="closing"&&z("closing")},ve=I==="open",Me=I==="closing",xe=$>0?Math.max(0,1-$/500):1,b=$>0?Math.max(.35,1-$/500):1,M=re=>{if(re.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const ge=re.currentTarget.getBoundingClientRect(),ye=re.clientY-ge.top,Z=Math.min(52,ge.height*.2);if(!(ye>ge.height-Z)){if(re.clientX-ge.left<ge.width/2){l();return}d()}},E=re=>{if(t.length<=1)return;const ge=re.currentTarget.getBoundingClientRect(),ye=re.clientX-ge.left,Z=re.clientY-ge.top,Q=Math.min(52,ge.height*.2);if(Z>ge.height-Q){re.currentTarget.style.cursor="default";return}re.currentTarget.style.cursor=ye<ge.width/2?"w-resize":"e-resize"},V=s.useCallback(re=>{re.propertyName!=="transform"||!G.current||(pe(),F(!1))},[pe,F]),Se=le?`translateX(${A}px)`:$>0?`translateY(${$}px)`:void 0,te={position:"fixed",top:U==null?void 0:U.top,left:U==null?void 0:U.left,width:U==null?void 0:U.width,height:U==null?void 0:U.height,objectFit:i==="cover"?"cover":"contain",transform:Se,opacity:$>0?b:I==="opening"||Me?0:1,transition:P&&!g?"none":g?`transform ${An}ms ${xi}`:ie?`transform ${An}ms ${xi}, opacity ${An}ms ${xi}`:I==="opening"||Me?`opacity ${An}ms ${xi}`:"none",pointerEvents:ue&&ve&&!le?"auto":"none",touchAction:ue&&ve?"none":void 0,zIndex:9998},$e=U?{position:"fixed",top:U.top,height:U.height,width:U.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:I==="open"?"none":void 0},onClick:ne,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:ve?xe:0,transition:P?"none":`opacity ${An}ms ${xi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:x?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:w,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ve?1:0,transition:`opacity ${An}ms ${xi}`,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:w,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ve?1:0,transition:`opacity ${An}ms ${xi}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),U&&K&&(ue?a.jsx(Ib,{src:K.url,phase:I,mediaRef:m,mediaStyle:te,onLoadedMetadata:se,onClick:M,onMouseMove:E,onTransitionEnd:V},`${n}-${K.url}`):a.jsx("img",{ref:m,src:K.url,alt:K.name,onLoad:se,onTransitionEnd:V,style:te},`${n}-${K.url}`)),ve&&$e&&t.length>1&&!ue&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...$e,left:U.left,cursor:"w-resize",pointerEvents:le?"none":"auto"},onClick:re=>{if(S.current){S.current=!1;return}re.stopPropagation(),l()}}),a.jsx("div",{style:{...$e,left:U.left+U.width/2,cursor:"e-resize",pointerEvents:le?"none":"auto"},onClick:re=>{if(S.current){S.current=!1;return}re.stopPropagation(),d()}})]})]})}function bc({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 x=`${e}-gallery-${us(t)?"video":"image"}`,w=r.display==="cover",m=$b(r),h=I=>D.scalingValue(I,l??!1),f=n??Oi,v=o?{width:"100%",maxWidth:"100%"}:{width:h(f),maxWidth:"100%"},C=i?{borderRadius:h(i)}:{},y={...v,...w?{aspectRatio:m,height:"auto",overflow:"hidden"}:{},...C},S={...w?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":h(f)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...w?{}:C},W={className:x,style:S,onClick:p?I=>{I.stopPropagation(),p()}:void 0},U=Math.max(d,vi),H=us(t)?a.jsx("video",{...W,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...W,src:t.url,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[w?a.jsx("div",{style:y,children:H}):H,c&&d>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:h(d)},"aria-hidden":"true"}),u&&c&&a.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:h(U)}})]})}function Lb({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const x=t==="a"?i:t==="c"?o:0,w=x>0||c;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&w&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(x)},"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"&&w&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(x)},"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 Pb(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function wc({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 Sc({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 Va({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),[x,w]=s.useState(0),m=t??"",h=n==="left"||n==="center"||n==="right";return s.useLayoutEffect(()=>{if(!h)return;const f=p.current;if(!f||typeof ResizeObserver>"u")return;const v=()=>w(f.offsetHeight);v();const C=new ResizeObserver(v);return C.observe(f),()=>C.disconnect()},[m,h]),a.jsx("div",{ref:f=>{p.current=f,i(f)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...h?{[`--${e}-title-height`]:`${x}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:m})})]})})}const Cc=45;function $c(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 Eb(e){const t=$c(e,"--cntrl-viewport-height",window.innerHeight),n=$c(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function Mb(e,t,n){const{top:i,centerY:o}=Eb(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 kb(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=Mb(u,n,c);return Math.exp(-(p*p)/(2*Cc*Cc))});let o=0,r=-1;return i.forEach((l,d)=>{l>r&&(r=l,o=d)}),{opacities:i,dominantIndex:o}}function Ab(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(kb(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 Fb(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 _b({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var nt;const{prefix:l}=D.useScopedStyles(),d=s.useMemo(()=>db(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",x=(e==null?void 0:e.imgWidth)??Oi,w=(e==null?void 0:e.titleWidth)??Sb,m=Cb(e==null?void 0:e.imageDisplay),h=(e==null?void 0:e.cornerRadius)??lb,f=(e==null?void 0:e.position)??"center",v=(e==null?void 0:e.titleTopPadding)??0,C=(e==null?void 0:e.titleLeftPadding)??0,y=(e==null?void 0:e.titleRightPadding)??0,S=Pb(e==null?void 0:e.transition),G=(e==null?void 0:e.lightbox)??"on",W=p==="b",U=S==="fade"||S==="retype",{setTitleRef:H,dominantIndex:I}=Ab(c.length,U,f),z=((nt=c[I])==null?void 0:nt.title)??"",$=Fb(z,S==="retype"),T=S==="fade"||S==="retype",A=S==="retype"?$:z,_=W?void 0:{width:D.scalingValue(x,n??!1)},g=G==="on"&&(!n||i||o),B=o??!1,P=(e==null?void 0:e.galleryPaddingRight)??0,Y=(e==null?void 0:e.galleryPaddingLeft)??0,ie=(e==null?void 0:e.galleryPaddingBetween)??0,L=at=>D.scalingValue(at,n??!1),K={width:L(w)},ue=p==="a"?P:Y,le=W?{width:"100%"}:{width:`calc(100% - ${L(x)} - ${L(ue)})`,...p==="c"?{marginLeft:"auto"}:{}},F=Math.max(P,vi),pe=Math.max(Y,vi),j=Math.max(ie,vi),se=Math.max(v,vi),ne=Math.max(C,vi),ve=Math.max(y,vi),Me=Math.max(0,(u??1)-(x??Oi)),xe=p==="a"?Math.max(0,(u??1)-(x??Oi)-P):p==="c"?Math.max(0,(u??1)-(x??Oi)-Y):p==="b"?u??1:1,b=B&&(p==="a"||p==="b"||p==="c")&&f==="top",M=B&&((p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")),E=B&&((p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"),V=c.length>1,Se=W?void 0:L((p==="c"?Y:P)+(x??Oi)),te=p==="c"&&Se?{left:Se}:void 0,$e=p==="a"&&Se?{right:Se}:void 0,re=W?{left:0,width:"100%"}:p==="a"?{right:L(P),width:L(x)}:{left:L(Y),width:L(x)},{titleColor:ge,titleFontFamily:ye,titleFontSettings:Z,titleFontSize:Q,titleLineHeight:ce,titleLetterSpacing:we,titleWordSpacing:Pe,titleAlign:Ce,titleTextAppearance:X,lightboxCounterColor:me,lightboxCounterFontFamily:ae,lightboxCounterFontSettings:q,lightboxCounterFontSize:de,lightboxCounterLineHeight:ke,lightboxCounterLetterSpacing:he,lightboxCounterWordSpacing:J,lightboxCounterTextAppearance:Ne}=e??{},Fe={fontSettings:{fontFamily:ye,fontWeight:(Z==null?void 0:Z.fontWeight)??400,fontStyle:(Z==null?void 0:Z.fontStyle)??"normal"},fontSize:Q??.01,lineHeight:ce,letterSpacing:we??0,wordSpacing:Pe??0,textAlign:Ce??"left",textAppearance:X,color:ge??"#000000"},Je=an(qt(Fe,n)),dt=K,tt=vc(Q,ce,l,n),De=xc(Q,ce,`${l}-title`,`${l}-text-tight-leading`),Ie={fontSettings:{fontFamily:ae,fontWeight:(q==null?void 0:q.fontWeight)??400,fontStyle:(q==null?void 0:q.fontStyle)??"normal"},fontSize:de??.01,lineHeight:ke,letterSpacing:he??0,wordSpacing:J??0,textAppearance:Ne,color:me??"#DEDDDD"},je={...an(qt(Ie,n)),...vc(de,ke,l,n)},Ue=xc(de,ke,`${l}-lightbox-counter`,`${l}-text-tight-leading`),k=D.buildColorVars(l,{titleColor:ge??"#000000",lightboxCounterColor:me??"#DEDDDD"},gb,hb),ee=s.useRef(null),[Te,He]=s.useState(!1),[Be,Ve]=s.useState([]),[rt,Ze]=s.useState(0),_e=s.useCallback((at,st)=>{g&&(Ve(at),Ze(st),He(!0))},[g]),qe=s.useCallback(()=>{He(!1)},[]),Oe=s.useMemo(()=>{const at={...k},st=ee.current?getComputedStyle(ee.current).getPropertyValue("--cntrl-article-width").trim():"";return st&&(at["--cntrl-article-width"]=st),at},[k,Te]);return s.useEffect(()=>{if(!Te||G!=="on"||typeof document>"u")return;const at=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=at}},[Te,G]),s.useEffect(()=>{!n||o||i||He(!1)},[n,o,i]),s.useEffect(()=>{G==="off"&&He(!1)},[G]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx("div",{style:k,children:a.jsxs("div",{ref:ee,className:`${l}-wrapper`,style:{width:D.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&f==="top"?L(v):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")?L(C):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"?L(y):void 0},children:[T&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(Va,{P:l,title:A,position:f,titleRef:()=>{},titleClassName:`${De} ${l}-single-title`,titleContainerStyle:{...tt,...le},titleTextBoxStyle:dt,titleStyle:Je,showTextBoxOutline:B,topPaddingControl:b?wc({P:l,scaled:L,height:se,paired:!1}):void 0})}),c.map((at,st)=>{const St=vb(at.gallery),Yt=st<c.length-1,Zt=St.filter(wt=>wt.lightboxMedia).map(wt=>wt.lightboxMedia),vt={P:l,position:f,titleRef:H(st),titleClassName:De,titleContainerStyle:tt,titleTextBoxStyle:T?{maxWidth:"100%"}:dt,titleStyle:Je,showTextBoxOutline:B&&!T,topPaddingControl:b&&!T?wc({P:l,scaled:L,height:se,paired:V}):void 0};return a.jsxs("div",{"data-item-index":st,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Yt?L(ie):void 0},children:[M&&Sc({P:l,controlKey:"titleLeftPadding",scaled:L,width:ne,maxFraction:xe,side:"left",paired:V,anchorStyle:te}),E&&Sc({P:l,controlKey:"titleRightPadding",scaled:L,width:ve,maxFraction:xe,side:"right",paired:V,anchorStyle:$e}),B&&Yt&&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:L(j),...re}}),W?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:St.map(({displayMedia:wt,lightboxMedia:Bt},At)=>{const xt=Bt?Zt.findIndex(Ft=>Ft.url===Bt.url):-1;return a.jsx(bc,{P:l,media:wt,imgWidth:x||void 0,cornerRadius:h||void 0,imageDisplay:m,isEditor:n,galleryPaddingBetween:ie,showPaddingAfter:At<St.length-1,showControls:B,onMediaClick:g&&xt>=0?()=>_e(Zt,xt):void 0},`${wt.url}-${At}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(Va,{...vt,title:T?"":at.title})})]}):a.jsxs(a.Fragment,{children:[a.jsx(Va,{...vt,title:T?"":at.title}),St.length>0&&a.jsx(Lb,{P:l,layoutType:p,galleryWidthStyle:_,galleryPaddingRight:P,galleryPaddingLeft:Y,galleryPaddingRightWidth:F,galleryPaddingLeftWidth:pe,galleryPaddingMaxFraction:Me,showControls:B,scaled:L,children:St.map(({displayMedia:wt,lightboxMedia:Bt},At)=>{const xt=Bt?Zt.findIndex(Ft=>Ft.url===Bt.url):-1;return a.jsx(bc,{P:l,media:wt,cornerRadius:h||void 0,fillGalleryWidth:!0,imageDisplay:m,isEditor:n,galleryPaddingBetween:ie,showPaddingAfter:At<St.length-1,showControls:B,onMediaClick:g&&xt>=0?()=>_e(Zt,xt):void 0},`${wt.url}-${At}`)})})]})]},st)})]})}),Te&&G==="on"&&typeof document<"u"&&e&&(()=>{const at=(r?document.getElementById(r):null)??document.body;return zn.createPortal(a.jsx("div",{style:Oe,"data-selection":"none",children:a.jsx(Rb,{prefix:l,items:Be,index:rt,imageDisplay:Tb(e.lightboxImageDisplay),isEditor:n,onClose:qe,onPrev:()=>Ze(st=>(st-1+Be.length)%Be.length),onNext:()=>Ze(st=>(st+1)%Be.length),counterClassName:Ue,counterStyle:je,backgroundColor:e.backgroundColor??ub})}),at)})()]})}const Nb=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
20968
20968
  import { createPortal } from 'react-dom';
20969
20969
  import type React from 'react';
20970
20970
  import { CommonComponentProps } from '../props';
@@ -23014,7 +23014,7 @@ export function Mercury({
23014
23014
  </>
23015
23015
  );
23016
23016
  }
23017
- `;function Ni(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Ga={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}}},Nb={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"}},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"]}}}}}}}},required:["gallery"]},default:[{title:"AX-2 Space Suit",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-3.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-4.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-5.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title:"Earth-orbital mission",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-3.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"}]},{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-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title:"Salton Sea from Above",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-8.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-9.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-10.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-12.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]}]},settings:{sizing:"auto auto",properties:{wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},imgWidth:{type:"number",scope:"layout",title:"Img width",display:{type:"numeric-input"},min:0,max:9999},titleWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},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"}}},galleryPaddingRight:Ni("Gallery Padding Right"),galleryPaddingLeft:Ni("Gallery Padding Left"),galleryPaddingBetween:Ni("Gallery Padding Between"),cornerRadius:{type:"number",scope:"layout",title:"Corner radius",display:{type:"numeric-input"},min:0,max:9999},position:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right","top"]}},titleTopPadding:Ni("Title Top Padding"),titleLeftPadding:Ni("Title Left Padding"),titleRightPadding:Ni("Title Right Padding"),transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","retype","scroll"]}},titleColor:{type:"string",scope:"common",title:"Title",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Ga.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"}},titleAlign:{...Ga.textAlign,scope:"layout",title:"Align"},titleTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",display:{type:"settings-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},lightboxCounterFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},lightboxCounterFontSettings:{...Ga.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:{type:"a",position:"left",transition:"scroll",titleColor:"#000000",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleAlign:"center",titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",backgroundColor:"rgba(28,31,34,0.9)",lightboxCounterColor:"#DEDDDD",lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{defaultPaddingTop:30/1440,wrapperWidth:1,imgWidth:600/1440,titleWidth:400/1440,galleryPaddingRight:30/1440,galleryPaddingLeft:30/1440,galleryPaddingBetween:30/1440,titleTopPadding:0,titleLeftPadding:0,titleRightPadding:0,cornerRadius:4/1440,position:"center",titleFontSize:73/1440,titleLineHeight:66/1440,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},m:{defaultPaddingTop:10/375,wrapperWidth:1,imgWidth:170/375,titleWidth:150/375,galleryPaddingRight:10/375,galleryPaddingLeft:10/375,galleryPaddingBetween:10/375,titleTopPadding:0,titleLeftPadding:10/375,titleRightPadding:10/375,cornerRadius:8/375,position:"left",titleFontSize:30/375,titleLineHeight:25/375,lightboxCounterFontSize:14/375,lightboxCounterLineHeight:14/375},t:{defaultPaddingTop:20/768,wrapperWidth:1,imgWidth:300/768,titleWidth:320/768,galleryPaddingRight:20/768,galleryPaddingLeft:20/768,galleryPaddingBetween:20/768,titleTopPadding:0,titleLeftPadding:0,titleRightPadding:0,cornerRadius:8/768,position:"center",titleFontSize:58/768,titleLineHeight:48/768,lightboxCounterFontSize:8/768,lightboxCounterLineHeight:8/768}},displayRules:[{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}}],layout:["__componentName__","type","wrapperWidth","imgWidth","titleWidth","imageDisplay","cornerRadius","position","transition","lightbox","lightboxImageDisplay"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",items:["wrapperWidth","imgWidth"]},{type:"row",items:["cornerRadius","imageDisplay"]},{type:"row",title:"Title",items:["position","transition"]},"titleWidth",{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",items:["backgroundColor"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleAlign","titleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:["titleColor","backgroundColor","lightboxCounterColor"],panelIds:["general","typeStyle"]}},Wb={element:Fb,id:"mercury",name:"Mercury",category:"lists",layoutMode:"structured",version:1,defaultSize:{d:{width:720,height:540}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Mercury.mp4"},schema:Nb,sourceCode:_b,assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"}},Tc=48,Hb=10,Db=400,Ob=1,Bb=1120/1440,zb=140/1440,jb=550/1440,Vb=13,Gb=4,Xb=38/100,Yb=28/100,nu=2.8,qb=.9,iu=.22,Ub=.5,Kb=1,Zb=1.5,Jb=0,Qb=.85;function ew(e,t){return`
23017
+ `;function Ni(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Ga={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}}},Wb={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"}},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"]}}}}}}}},required:["gallery"]},default:[{title:"AX-2 Space Suit",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-3.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-4.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-5.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title:"Earth-orbital mission",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-3.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"}]},{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-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title:"Salton Sea from Above",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-8.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-9.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-10.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-12.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]}]},settings:{sizing:"auto auto",properties:{wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},imgWidth:{type:"number",scope:"layout",title:"Img width",display:{type:"numeric-input"},min:0,max:9999},titleWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},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"}}},galleryPaddingRight:Ni("Gallery Padding Right"),galleryPaddingLeft:Ni("Gallery Padding Left"),galleryPaddingBetween:Ni("Gallery Padding Between"),cornerRadius:{type:"number",scope:"layout",title:"Corner radius",display:{type:"numeric-input"},min:0,max:9999},position:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right","top"]}},titleTopPadding:Ni("Title Top Padding"),titleLeftPadding:Ni("Title Left Padding"),titleRightPadding:Ni("Title Right Padding"),transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","retype","scroll"]}},titleColor:{type:"string",scope:"common",title:"Title",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Ga.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"}},titleAlign:{...Ga.textAlign,scope:"layout",title:"Align"},titleTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",display:{type:"settings-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},lightboxCounterFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},lightboxCounterFontSettings:{...Ga.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:{type:"a",position:"left",transition:"scroll",titleColor:"#000000",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleAlign:"center",titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",backgroundColor:"rgba(28,31,34,0.9)",lightboxCounterColor:"#DEDDDD",lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{defaultPaddingTop:30/1440,wrapperWidth:1,imgWidth:600/1440,titleWidth:400/1440,galleryPaddingRight:30/1440,galleryPaddingLeft:30/1440,galleryPaddingBetween:30/1440,titleTopPadding:0,titleLeftPadding:0,titleRightPadding:0,cornerRadius:4/1440,position:"center",titleFontSize:73/1440,titleLineHeight:66/1440,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},m:{defaultPaddingTop:10/375,wrapperWidth:1,imgWidth:170/375,titleWidth:150/375,galleryPaddingRight:10/375,galleryPaddingLeft:10/375,galleryPaddingBetween:10/375,titleTopPadding:0,titleLeftPadding:10/375,titleRightPadding:10/375,cornerRadius:8/375,position:"left",titleFontSize:30/375,titleLineHeight:25/375,lightboxCounterFontSize:14/375,lightboxCounterLineHeight:14/375},t:{defaultPaddingTop:20/768,wrapperWidth:1,imgWidth:300/768,titleWidth:320/768,galleryPaddingRight:20/768,galleryPaddingLeft:20/768,galleryPaddingBetween:20/768,titleTopPadding:0,titleLeftPadding:0,titleRightPadding:0,cornerRadius:8/768,position:"center",titleFontSize:58/768,titleLineHeight:48/768,lightboxCounterFontSize:8/768,lightboxCounterLineHeight:8/768}},displayRules:[{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}}],layout:["__componentName__","type","wrapperWidth","imgWidth","titleWidth","imageDisplay","cornerRadius","position","transition","lightbox","lightboxImageDisplay"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",items:["wrapperWidth","imgWidth"]},{type:"row",items:["cornerRadius","imageDisplay"]},{type:"row",title:"Title",items:["position","transition"]},"titleWidth",{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",items:["backgroundColor"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleAlign","titleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:["titleColor","backgroundColor","lightboxCounterColor"],panelIds:["general","typeStyle"]}},Hb={element:_b,id:"mercury",name:"Mercury",category:"lists",layoutMode:"structured",version:1,defaultSize:{d:{width:720,height:540}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Mercury.mp4"},schema:Wb,sourceCode:Nb,assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"}},Tc=48,Db=10,Ob=400,Bb=1,zb=1120/1440,jb=140/1440,Vb=550/1440,Gb=13,Xb=4,Yb=38/100,qb=28/100,iu=2.8,Ub=.9,ou=.22,Kb=.5,Zb=1,Jb=1.5,Qb=0,ew=.85;function tw(e,t){return`
23018
23018
  .${e}-wrapper {
23019
23019
  position: relative;
23020
23020
  box-sizing: border-box;
@@ -23059,10 +23059,10 @@ export function Mercury({
23059
23059
  object-position: center;
23060
23060
  }
23061
23061
  ${t}
23062
- `}function er(e){return Number(e.toFixed(4))}function Ic(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 Xa(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 tw(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 nw(e){const[t,n]=e.ratioValue.split(":").map(Number),i=e.reversed?n:t;return(e.reversed?t:n)/i}function iw(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 ou(e,t){return(1-e)/(1-e*Math.cos(t))}function ow(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)*ou(e,i)))}return t||1}function rw(e,t){return e?1:1+iu*(.35+t)}function aw(e,t,n,i){const o=t*rw(n,i);return Math.max(0,(e-o)/2)}function ru(e,t,n){const i=ou(e,n);return{offset:Math.sin(n)*i/t,scale:i}}function au(e,t,n){return e/2+t*n}function sw(e,t,n){return e(t-n/2)}function lw(e,t){return e*t}function su(e){return Math.round(e*1e3)}function lu(e,t,n){const i=Math.cos(e),o=Math.cos(Qb*Math.PI/2);if(i>=o)return n;const r=(i+1)/(o+1);return er(t+(n-t)*r)}function cu(e){return lu(e,Ub,Kb)}function cw(e){return lu(e,Zb,Jb)}function du(e,t){if(!t)return"none";const n=cw(e);return n<=0?"none":`blur(${n}px)`}function dw(e,t,n,i,o,r,l,d){const{offset:c,scale:u}=ru(i,o,r*Math.PI*2),p=r*Math.PI*2,x=au(t,n,c),w=er(u),m=`calc(${e(x)} - var(--helix-base-w) * ${w} / 2)`,h=`calc(var(--helix-base-w) * ${w})`,f=l?`height: calc(var(--helix-base-h) * ${w});`:"";return`left: ${m}; width: ${h}; ${f} z-index: ${su(u)}; transform: translateY(-50%); opacity: ${cu(p)}; filter: ${du(p,d)};`}function uw(e,t,n,i,o,r,l,d){const c=[];for(let u=0;u<=Tc;u+=1){const p=u/Tc;c.push(` ${er(p*100)}% { ${dw(t,n,i,o,r,p,l,d)} }`)}return`@keyframes ${e}-orbit {
23062
+ `}function er(e){return Number(e.toFixed(4))}function Ic(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 Xa(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 nw(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 iw(e){const[t,n]=e.ratioValue.split(":").map(Number),i=e.reversed?n:t;return(e.reversed?t:n)/i}function ow(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 ru(e,t){return(1-e)/(1-e*Math.cos(t))}function rw(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)*ru(e,i)))}return t||1}function aw(e,t){return e?1:1+ou*(.35+t)}function sw(e,t,n,i){const o=t*aw(n,i);return Math.max(0,(e-o)/2)}function au(e,t,n){const i=ru(e,n);return{offset:Math.sin(n)*i/t,scale:i}}function su(e,t,n){return e/2+t*n}function lw(e,t,n){return e(t-n/2)}function cw(e,t){return e*t}function lu(e){return Math.round(e*1e3)}function cu(e,t,n){const i=Math.cos(e),o=Math.cos(ew*Math.PI/2);if(i>=o)return n;const r=(i+1)/(o+1);return er(t+(n-t)*r)}function du(e){return cu(e,Kb,Zb)}function dw(e){return cu(e,Jb,Qb)}function uu(e,t){if(!t)return"none";const n=dw(e);return n<=0?"none":`blur(${n}px)`}function uw(e,t,n,i,o,r,l,d){const{offset:c,scale:u}=au(i,o,r*Math.PI*2),p=r*Math.PI*2,x=su(t,n,c),w=er(u),m=`calc(${e(x)} - var(--helix-base-w) * ${w} / 2)`,h=`calc(var(--helix-base-w) * ${w})`,f=l?`height: calc(var(--helix-base-h) * ${w});`:"";return`left: ${m}; width: ${h}; ${f} z-index: ${lu(u)}; transform: translateY(-50%); opacity: ${du(p)}; filter: ${uu(p,d)};`}function pw(e,t,n,i,o,r,l,d){const c=[];for(let u=0;u<=Tc;u+=1){const p=u/Tc;c.push(` ${er(p*100)}% { ${uw(t,n,i,o,r,p,l,d)} }`)}return`@keyframes ${e}-orbit {
23063
23063
  ${c.join(`
23064
23064
  `)}
23065
- }`}function uu(e,t){return(e%t+t)%t}function pw(e,t){return tl(e,t)/t}function tl(e,t){return uu(e,t)}function mw(e,t){return Math.floor(e/t)}function gw(e,t,n,i){return mw(e,t)*n+tl(e,t)*i}function hw(e,t,n){const i=n==="left"?1-e:e;return`${er(-i*t)}s`}function Rc(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function pu(e){const t=e%1;return t<0?t+1:t}function fw(e,t,n){const i=t/nu,o=n==="left"?-e*i:e*i;return pu(o)}function yw({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=D.useScopedStyles(),r=s.useRef(null),l=Xa((e==null?void 0:e.width)??(e==null?void 0:e.spread)??(e==null?void 0:e.wrapperWidth),Bb),d=Xa(e==null?void 0:e.imageWidth,zb),c=Xa(e==null?void 0:e.turnHeight,jb),u=Ic(e==null?void 0:e.itemsPerTurn,Vb,3,40),p=Ic(e==null?void 0:e.turns,Gb,1,30),x=Math.min(qb,Math.max(0,Xb)),w=Math.min(1,Math.max(0,Yb)),m=Math.max(0,(e==null?void 0:e.speed)??nu),h=(e==null?void 0:e.direction)==="left"?"left":"right",f=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",v=(e==null?void 0:e.cornerRadius)??0,C=(e==null?void 0:e.blur)!=="off",y=s.useMemo(()=>tw(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),S=y.display==="cover",V=ae=>D.scalingValue(ae,n??!1),N=s.useMemo(()=>ow(x),[x]),q=s.useMemo(()=>aw(l,d,S,w),[l,d,S,w]),W=s.useMemo(()=>ew(o,uw(o,V,l,q,x,N,S,C)),[o,l,q,x,N,S,C,n]),I=s.useMemo(()=>(t??[]).filter(ae=>{var A;return!!((A=ae.image)!=null&&A.url)}),[t]),B=c/u,$=d*nw(y),T=Math.min(Db,p*u),k=Ob*u,F=T+k*2,O=Math.max(0,p-1)*c+(u-1)*B,P=m>0,X=f==="scroll"&&P,te=f==="autoplay"&&P&&(n?!!i:!0),[L,H]=s.useState(0);s.useEffect(()=>{if(!X)return;const ae=r.current;if(!ae)return;const A=()=>{const z=ae.getBoundingClientRect(),re=window.innerHeight||document.documentElement.clientHeight,ee=re+z.height;ee<=0||H(Math.min(1,Math.max(0,(re-z.top)/ee)))};A(),window.addEventListener("scroll",A,{passive:!0}),window.addEventListener("resize",A);const ce=new ResizeObserver(A);return ce.observe(ae),()=>{window.removeEventListener("scroll",A),window.removeEventListener("resize",A),ce.disconnect()}},[X]);const U=X?fw(L,m,h):0,de=P&&f==="autoplay"?360/(m*Hb):0;return I.length===0?a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:W}}),a.jsx("div",{className:`${o}-wrapper`,style:{width:V(l),marginInline:"auto"}})]}):a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:W}}),a.jsx("div",{ref:r,className:`${o}-wrapper`,style:{width:V(l),height:V(O),marginInline:"auto"},children:Array.from({length:F},(ae,A)=>{const ce=A-k,re=I[uu(ce,I.length)].image,ee=tl(ce,u),xe=pw(ce,u),Fe=X?pu(xe+U):xe,ye=gw(ce,u,c,B),b=w===0?0:(Rc(ee+7.3)-.5)*w*B,M=S?1:1+(Rc(ee+3.1)-.5)*2*iu*(.35+w),E=Fe*Math.PI*2,{offset:j,scale:Ce}=ru(x,N,E),Q=d*M,Te=lw(Q,Ce),ie=au(l,q,j),ue={"--helix-base-w":V(Q),...S?{"--helix-base-h":V($)}:{}},fe={top:V(ye+b),transform:"translateY(-50%)",...ue,...te?{animationDuration:`${er(de)}s`,animationDelay:hw(xe,de,h),animationDirection:h==="left"?"reverse":"normal"}:{left:sw(V,ie,Te),width:V(Te),...S?{height:V($*Ce)}:{},zIndex:su(Ce),opacity:cu(E),filter:du(E,C)}},K=v>0?{borderRadius:V(v)}:{},Z=S?{...K,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}:K,se=iw(re)?a.jsx("video",{className:`${o}-media`,style:Z,src:re.url,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:`${o}-media`,style:Z,src:re.url,alt:re.name??"",loading:"lazy",decoding:"async"});return a.jsx("div",{className:te?`${o}-item`:`${o}-item ${o}-item-static`,style:fe,children:S?a.jsx("div",{className:`${o}-cover`,style:K,children:se}):se},`${p}-${u}-${ce}`)})})]})}const xw=`import { useEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
23065
+ }`}function pu(e,t){return(e%t+t)%t}function mw(e,t){return tl(e,t)/t}function tl(e,t){return pu(e,t)}function gw(e,t){return Math.floor(e/t)}function hw(e,t,n,i){return gw(e,t)*n+tl(e,t)*i}function fw(e,t,n){const i=n==="left"?1-e:e;return`${er(-i*t)}s`}function Rc(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function mu(e){const t=e%1;return t<0?t+1:t}function yw(e,t,n){const i=t/iu,o=n==="left"?-e*i:e*i;return mu(o)}function xw({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=D.useScopedStyles(),r=s.useRef(null),l=Xa((e==null?void 0:e.width)??(e==null?void 0:e.spread)??(e==null?void 0:e.wrapperWidth),zb),d=Xa(e==null?void 0:e.imageWidth,jb),c=Xa(e==null?void 0:e.turnHeight,Vb),u=Ic(e==null?void 0:e.itemsPerTurn,Gb,3,40),p=Ic(e==null?void 0:e.turns,Xb,1,30),x=Math.min(Ub,Math.max(0,Yb)),w=Math.min(1,Math.max(0,qb)),m=Math.max(0,(e==null?void 0:e.speed)??iu),h=(e==null?void 0:e.direction)==="left"?"left":"right",f=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",v=(e==null?void 0:e.cornerRadius)??0,C=(e==null?void 0:e.blur)!=="off",y=s.useMemo(()=>nw(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),S=y.display==="cover",G=le=>D.scalingValue(le,n??!1),W=s.useMemo(()=>rw(x),[x]),U=s.useMemo(()=>sw(l,d,S,w),[l,d,S,w]),H=s.useMemo(()=>tw(o,pw(o,G,l,U,x,W,S,C)),[o,l,U,x,W,S,C,n]),I=s.useMemo(()=>(t??[]).filter(le=>{var F;return!!((F=le.image)!=null&&F.url)}),[t]),z=c/u,$=d*iw(y),T=Math.min(Ob,p*u),A=Bb*u,_=T+A*2,B=Math.max(0,p-1)*c+(u-1)*z,P=m>0,Y=f==="scroll"&&P,ie=f==="autoplay"&&P&&(n?!!i:!0),[L,O]=s.useState(0);s.useEffect(()=>{if(!Y)return;const le=r.current;if(!le)return;const F=()=>{const j=le.getBoundingClientRect(),se=window.innerHeight||document.documentElement.clientHeight,ne=se+j.height;ne<=0||O(Math.min(1,Math.max(0,(se-j.top)/ne)))};F(),window.addEventListener("scroll",F,{passive:!0}),window.addEventListener("resize",F);const pe=new ResizeObserver(F);return pe.observe(le),()=>{window.removeEventListener("scroll",F),window.removeEventListener("resize",F),pe.disconnect()}},[Y]);const K=Y?yw(L,m,h):0,ue=P&&f==="autoplay"?360/(m*Db):0;return I.length===0?a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:H}}),a.jsx("div",{className:`${o}-wrapper`,style:{width:G(l),marginInline:"auto"}})]}):a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:H}}),a.jsx("div",{ref:r,className:`${o}-wrapper`,style:{width:G(l),height:G(B),marginInline:"auto"},children:Array.from({length:_},(le,F)=>{const pe=F-A,se=I[pu(pe,I.length)].image,ne=tl(pe,u),ve=mw(pe,u),Me=Y?mu(ve+K):ve,xe=hw(pe,u,c,z),b=w===0?0:(Rc(ne+7.3)-.5)*w*z,M=S?1:1+(Rc(ne+3.1)-.5)*2*ou*(.35+w),E=Me*Math.PI*2,{offset:V,scale:Se}=au(x,W,E),te=d*M,$e=cw(te,Se),re=su(l,U,V),ge={"--helix-base-w":G(te),...S?{"--helix-base-h":G($)}:{}},ye={top:G(xe+b),transform:"translateY(-50%)",...ge,...ie?{animationDuration:`${er(ue)}s`,animationDelay:fw(ve,ue,h),animationDirection:h==="left"?"reverse":"normal"}:{left:lw(G,re,$e),width:G($e),...S?{height:G($*Se)}:{},zIndex:lu(Se),opacity:du(E),filter:uu(E,C)}},Z=v>0?{borderRadius:G(v)}:{},Q=S?{...Z,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}:Z,ce=ow(se)?a.jsx("video",{className:`${o}-media`,style:Q,src:se.url,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:`${o}-media`,style:Q,src:se.url,alt:se.name??"",loading:"lazy",decoding:"async"});return a.jsx("div",{className:ie?`${o}-item`:`${o}-item ${o}-item-static`,style:ye,children:S?a.jsx("div",{className:`${o}-cover`,style:Z,children:ce}):ce},`${p}-${u}-${pe}`)})})]})}const vw=`import { useEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
23066
23066
  import { CommonComponentProps } from '../props';
23067
23067
  import { scalingValue } from '../utils/scalingValue';
23068
23068
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -23600,7 +23600,7 @@ export function Helix({
23600
23600
  </>
23601
23601
  );
23602
23602
  }
23603
- `,vw=["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"],bw={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:vw.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"]}]}]},ww={element:yw,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:bw,sourceCode:xw,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Cr=typeof window>"u"?s.useEffect:s.useLayoutEffect,jo=120,Lc=3,Sw=.12,Ya=.25,Cw=10,$w=4e3,Tw=.12,Iw=3,Rw=3,mu=["rectangle","ellipse","circle","triangle-up","triangle-down","diamond","hourglass","teardrop","leaf","wave","custom"];function Gr(e){return e<0?0:e>1?1:e}function Lw(e,t){return e.filter(n=>n.length>0).map(n=>`M ${n.map(i=>`${i.x*t.width} ${i.y*t.height}`).join(" L ")} Z`).join(" ")}function Pw(e,t){let n=1/0,i=1/0,o=-1/0,r=-1/0;for(const c of e)for(const u of c){const p=u.x*t.width,x=u.y*t.height;p<n&&(n=p),p>o&&(o=p),x<i&&(i=x),x>r&&(r=x)}const l=o-n,d=r-i;return!isFinite(l)||!isFinite(d)||l<=0||d<=0?null:{x:n,y:i,width:l,height:d}}function wo(e){return e.map(([t,n])=>({x:t,y:n}))}function qa(e,t=jo){const n=[];for(let i=0;i<t;i+=1)n.push(e(i/t));return n}function Ar(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 ps(e,t){switch(e){case"ellipse":return[qa(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[qa(o=>{const r=o*Math.PI*2;return{x:.5+Math.cos(r)*n,y:.5+Math.sin(r)*i}})]}case"triangle-up":return[wo([[.5,0],[1,1],[0,1]])];case"triangle-down":return[wo([[0,0],[1,0],[.5,1]])];case"diamond":return[wo([[.5,0],[1,.5],[.5,1],[0,.5]])];case"hourglass":return[wo([[0,0],[1,0],[.56,.5],[1,1],[0,1],[.44,.5]])];case"teardrop":return Ar([qa(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(jo/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=jo,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[wo([[0,0],[1,0],[1,1],[0,1]])]}}const gu={x:0,y:0,width:100,height:100};function Ew(e){const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?gu:{x:t[0],y:t[1],width:t[2],height:t[3]}}function Fr(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}const ms=16,Mw=12,kw=16,Xr="0 0 100 100",Yr=100,Ua=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,Aw=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g;function Fw(e){const t=e.match(Aw);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 gs(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 _w(e){return{p:on(e.p),in:e.in?on(e.in):null,out:e.out?on(e.out):null}}function Pn(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(_w)}))}function ti(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 Pc(e,t,n,i=n){return ti(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function Nw(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),x=Math.sin(u),w=(e.x-l.x)/2,m=(e.y-l.y)/2,h=p*w+x*m,f=-x*w+p*m,v=h*h/(d*d)+f*f/(c*c);if(v>1){const te=Math.sqrt(v);d*=te,c*=te}const C=o===r?-1:1,y=d*d*f*f+c*c*h*h,S=Math.max(0,d*d*c*c-y),V=y===0?0:C*Math.sqrt(S/y),N=V*d*f/c,q=-V*c*h/d,W=p*N-x*q+(e.x+l.x)/2,I=x*N+p*q+(e.y+l.y)/2,B=Math.atan2((f-q)/c,(h-N)/d);let T=Math.atan2((-f-q)/c,(-h-N)/d)-B;!r&&T>0&&(T-=Math.PI*2),r&&T<0&&(T+=Math.PI*2);const k=Math.max(1,Math.ceil(Math.abs(T)/(Math.PI/2))),F=T/k,g=4/3*Math.tan(F/4),O=(te,L)=>({x:W+p*d*te-x*c*L,y:I+x*d*te+p*c*L}),P=[];let X=B;for(let te=0;te<k;te+=1){const L=X+F,H=Math.cos(X),U=Math.sin(X),de=Math.cos(L),ae=Math.sin(L);P.push({c1:O(H-g*U,U+g*H),c2:O(de+g*ae,ae-g*de),p:te===k-1?on(l):O(de,ae)}),X=L}return P}function Vo(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 m=i[0],h=i[i.length-1];Math.abs(m.p.x-h.p.x)<1e-6&&Math.abs(m.p.y-h.p.y)<1e-6&&(m.in=h.in??m.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(m,h)=>{i.push({p:m,in:h??null,out:null}),r=m},x=m=>{i.length&&(i[i.length-1].out=m)};Ua.lastIndex=0;let w=Ua.exec(t);for(;w!==null;){const m=w[1],h=m.toUpperCase(),f=m!==h,v=Fw(w[2]),C=y=>f?{x:r.x+v[y],y:r.y+v[y+1]}:{x:v[y],y:v[y+1]};if(h==="Z")o=!0,u(),r=on(l),d=null,c=null;else if(h==="M"){for(let y=0;y+1<v.length;y+=2){const S=C(y);y===0&&(u(),l=on(S)),p(S)}d=null,c=null}else if(h==="L"){for(let y=0;y+1<v.length;y+=2)p(C(y));d=null,c=null}else if(h==="H"){for(const y of v)p({x:f?r.x+y:y,y:r.y});d=null,c=null}else if(h==="V"){for(const y of v)p({x:r.x,y:f?r.y+y:y});d=null,c=null}else if(h==="C"){for(let y=0;y+5<v.length;y+=6){const S=C(y),V=C(y+2),N=C(y+4);x(S),p(N,V),d=V}c=null}else if(h==="S"){for(let y=0;y+3<v.length;y+=4){const S=d?gs(d,r):on(r),V=C(y),N=C(y+2);x(S),p(N,V),d=V}c=null}else if(h==="Q")for(let y=0;y+3<v.length;y+=4){const S=C(y),V=C(y+2);x(gn(r,S,2/3)),p(V,gn(V,S,2/3)),c=S,d=null}else if(h==="T")for(let y=0;y+1<v.length;y+=2){const S=c?gs(c,r):on(r),V=C(y);x(gn(r,S,2/3)),p(V,gn(V,S,2/3)),c=S,d=null}else if(h==="A")for(let y=0;y+6<v.length;y+=7){const S=f?{x:r.x+v[y+5],y:r.y+v[y+6]}:{x:v[y+5],y:v[y+6]};for(const V of Nw(r,v[y],v[y+1],v[y+2],v[y+3]!==0,v[y+4]!==0,S))x(V.c1),p(V.p,V.c2);d=null,c=null}w=Ua.exec(t)}return u(),n}function Rn(e){return`${Number(e.toFixed(2))}`}function tr(e,t){return!e.out&&!t.in}function Ec(e,t){if(tr(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 Go(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(Ec(r,l)),r=l;if(n.closed){const l=Ec(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function hu(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 hs(e,t,n){if(tr(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 nl(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of hu(n)){if(tr(o.from,o.to)){i.push(on(o.from.p));continue}for(let r=0;r<ms;r+=1)i.push(hs(o.from,o.to,r/ms))}n.closed||i.push(on(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function Jn(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of nl(e))for(const l of r)l.x<t&&(t=l.x),l.x>i&&(i=l.x),l.y<n&&(n=l.y),l.y>o&&(o=l.y);return{minX:t,minY:n,maxX:i,maxY:o}}function Ww(e){const t=Jn(e);return!isFinite(t.minX)||!isFinite(t.maxX)||!isFinite(t.minY)||!isFinite(t.maxY)?null:{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}}function fu(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 yu(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=Mw)return{closed:!0,nodes:t.map(r=>({p:on(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/kw)),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),...fu(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function Hw(e){const t={x:0,y:0,width:Yr,height:Yr};if(!e||e.pathFit!=="viewbox"||e.pathViewBox!==Xr||!e.customPath)return t;const n=Vo(e.customPath);if(!n.length)return t;const i=Jn(n),o=i.maxX-i.minX,r=i.maxY-i.minY;return!isFinite(i.minX)||!isFinite(i.minY)||!(o>0)||!(r>0)?t:{x:i.minX,y:i.minY,width:o,height:r}}function xu(e,t,n=1){if(!e.length)return!1;const i=Jn(e);if(!isFinite(i.minX)||!isFinite(i.maxX))return!1;const o=Math.max(n,t.width*.5),r=Math.max(n,t.height*.5);return i.minX<t.x-o||i.minY<t.y-r||i.maxX>t.x+t.width+o||i.maxY>t.y+t.height+r}function Dw(e,t){if(!e.length)return e;const n=Jn(e),i=n.maxX-n.minX,o=n.maxY-n.minY;if(!(i>0)||!(o>0)||n.minX>=t.x-1e-6&&n.minY>=t.y-1e-6&&n.maxX<=t.x+t.width+1e-6&&n.maxY<=t.y+t.height+1e-6)return e;const l=Math.min(t.width/i,t.height/o),d=t.x+(t.width-i*l)/2,c=t.y+(t.height-o*l)/2;return ti(e,u=>({x:d+(u.x-n.minX)*l,y:c+(u.y-n.minY)*l}))}function Ow(e,t=1,n){const i=Hw(n),o=ps(e==="custom"?"rectangle":e,t),r=Dw(ti(yu(o),l=>({x:l.x*i.width+i.x,y:l.y*i.height+i.y})),i);return{shape:e,customPath:Go(r),pathFit:"viewbox",pathViewBox:Xr}}function $r(e,t){return t>0?Math.round(e/t)*t:e}function Bw(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=Pn(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 Mc(e,t,n,i){var r;if(!t.length)return e;const o=Pn(e);for(const{contour:l,node:d}of t){const c=(r=o[l])==null?void 0:r.nodes[d];c&&(c.p={x:c.p.x+n,y:c.p.y+i},c.in&&(c.in={x:c.in.x+n,y:c.in.y+i}),c.out&&(c.out={x:c.out.x+n,y:c.out.y+i}))}return o}function zw(e,t){const n=new Map;for(const{contour:o,node:r}of t){const l=n.get(o)??[];l.push(r),n.set(o,l)}let i=e;return n.forEach((o,r)=>{const l=[...o].sort((d,c)=>c-d);for(const d of l)i=vu(i,r,d)}),i}function jw(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const d=Pn(e),c=d[t].nodes[n];if(c[i]=on(o),r){const p=i==="in"?"out":"in";c[p]=gs(o,c.p)}return d}function Vw(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=Pn(e);return r[t].nodes[n][i]=null,r}function Gw(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=Pn(e),c=d[t].nodes,u=n+1;if(tr(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,x=l.in??l.p,w=gn(r.p,p,i),m=gn(p,x,i),h=gn(x,l.p,i),f=gn(w,m,i),v=gn(m,h,i),C=gn(f,v,i),y=(n+1)%o.nodes.length;return c[n].out=w,c[y].in=h,c.splice(u,0,{p:C,in:f,out:v}),{contours:d,nodeIndex:u}}function vu(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=Pn(e);return o[t].nodes.splice(n,1),o}function kc(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=Pn(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=fu(c,l.p,u);return l.in=p.in,l.out=p.out,r}function Xw(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 Yw(e,t){let n=null;return e.forEach((i,o)=>{for(const r of hu(i)){const l=tr(r.from,r.to)?1:ms;for(let d=0;d<l;d+=1){const c=d/l,u=(d+1)/l,p=Xw(t,hs(r.from,r.to,c),hs(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 qw(e,t){const n=[];return e.forEach((i,o)=>{i.nodes.forEach((r,l)=>{o===t.contour&&l===t.node||n.push(r.p)})}),n}function Ac(e,t,n){const i=t.filter((r,l)=>isFinite(r)&&t.findIndex(d=>Math.abs(d-r)<1e-6)===l),o=i.map(r=>({value:r,axis:r,from:null}));for(const r of e)o.push({value:r[n],axis:null,from:r});for(const r of i)for(const l of e)o.push({value:r*2-l[n],axis:r,from:l});return o}function Fc(e,t,n,i,o){const r=i(t)[n];let l=null,d=1/0;for(const c of e){const u=n==="x"?{x:c.value,y:t.y}:{x:t.x,y:c.value},p=Math.abs(i(u)[n]-r);p>o||l&&p>=d||(l=c,d=p)}return l}const _c=Math.PI/4,Uw=8,Kw=Math.PI/18,Zw=8,zi=24,ji=[];function Jw(e,t){return e.length===t.length&&e.every((n,i)=>n.kind===t[i].kind&&n.a.x===t[i].a.x&&n.a.y===t[i].a.y&&n.b.x===t[i].b.x&&n.b.y===t[i].b.y)}function Qw(e){const t=Math.PI*2;return((e+Math.PI)%t+t)%t-Math.PI}function fs(e,t){const n=t.x-e.x,i=t.y-e.y,o=Math.hypot(n,i);return o<1e-6?null:{x:n/o,y:i/o}}function eS(e,t){const n=fs(e,t);return n?{kind:"align",a:{x:e.x-n.x*zi,y:e.y-n.y*zi},b:{x:t.x+n.x*zi,y:t.y+n.y*zi}}:{kind:"align",a:e,b:t}}function ys(e,t,n){return t==="x"?{kind:"center",a:{x:e,y:0},b:{x:e,y:n.height}}:{kind:"center",a:{x:0,y:e},b:{x:n.width,y:e}}}function Nc(e,t,n,i,o){if(e.axis===null)return eS(n,o(e.from??n));const r=t==="x"?{x:e.axis,y:0}:{x:0,y:e.axis};return ys(o(r)[t],t,i)}function tS(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(Nc(t,"x",l,i,o)),n&&e.y===n.value&&r.push(Nc(n,"y",l,i,o)),r}function nS(e,t,n,i){const o=e==null?void 0:e.nodes[t];if(!e||!o)return null;const r=i(o.p),l=n==="in"?o.out:o.in;if(l)return fs(i(l),r);const d=e.nodes.length,c=t+(n==="in"?1:-1);if(!e.closed&&(c<0||c>=d))return null;const u=e.nodes[(c+d)%d];if(!u)return null;const p=(n==="in"?u.in:u.out)??u.p;return fs(i(p),r)}function iS(e,t,n,i,o,r,l){const d=r(t),c=r(e),u=c.x-d.x,p=c.y-d.y,x=Math.hypot(u,p);if(x<1e-6)return{point:e,guides:ji};const w=Math.atan2(p,u),m=Math.round(w/_c)*_c;let h=o?m:null,f=!1;if(!o){const q=[];n&&q.push({angle:Math.atan2(n.y,n.x),smooth:!0}),q.push({angle:m,smooth:!1});for(const W of q){const I=Qw(W.angle-w);if(!(Math.abs(I)>Kw)&&!(Math.abs(Math.sin(I))*x>Uw)){h=W.angle,f=W.smooth;break}}}const v=i!==null&&i>0&&Math.abs(x-i)<=Zw;if(h===null&&!v)return{point:e,guides:ji};const C=h??w,y=v?i:x,S={x:Math.cos(C),y:Math.sin(C)},V=y+(h===null?0:zi),N=v?y:f?zi:0;return{point:l({x:d.x+S.x*y,y:d.y+S.y*y}),guides:[{kind:"angle",a:{x:d.x-S.x*N,y:d.y-S.y*N},b:{x:d.x+S.x*V,y:d.y+S.y*V}}]}}function Wc(e,t="stretch",n=gu){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=Vo(i),d=nl(l);if(d.length)return t==="viewbox"?Fr(d,n):Ar(d);if(typeof document>"u")return null;const c=i.split(/(?=[Mm])/).map(x=>x.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const x of c){const w=document.createElementNS("http://www.w3.org/2000/svg","path");w.setAttribute("d",x),u.appendChild(w);let m=0;try{m=w.getTotalLength()}catch{m=0}if(!m)continue;const h=[];for(let f=0;f<jo;f+=1){const v=w.getPointAtLength(f/jo*m);h.push({x:v.x,y:v.y})}p.push(h)}return p.length?t==="viewbox"?Fr(p,n):Ar(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"?Fr([r],n):Ar([r])}function oS(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=Gr(n[o]),l=Gr(n[o+1]);l>r&&i.push({x0:r,x1:l})}return rS(i)}function rS(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 aS(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 sS(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 lS(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 cS(e,t,n,i){let o=null;for(let r=0;r<Lc;r+=1){const l=Gr(t+(n-t)*r/Math.max(1,Lc-1)),d=oS(e,l),c=i==="avoid"?sS(d):d;if(o=o===null?c:aS(o,c),o.length===0)return[]}return o??[]}function bu(e){return!!e&&typeof e=="object"&&e.type==="link"}function dS(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if(bu(c)){o(c.children??[],c.value,c.target);continue}const u=c,p=(u==null?void 0:u.text)??"";if(p.trim())for(const x of p.split(/\s+/))x&&t.push({text:x,leaf:u,href:l,target:d,para:i})}};o((n==null?void 0:n.children)??[])}),t}function Hc(e){return{...e.fontFamily&&{fontFamily:po(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 uS(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(bu(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function Dc(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:d,height:c,allowOverflow:u,capInset:p,capLines:x}=e,w=e.lineHeight*l,m=e.spaceWidth*l,h=[];if(!t.length||d<=0||w<=0)return{segments:h,placed:0,height:0,capLeft:0,capTop:0};const f=Math.max(1,m*.5),v=w*Sw;let C=0,y=0,S=0,V=t[0].para,N=0,q=0,W=null;for(;C<t.length&&S<$w;){const I=y+w>c;if(I&&!u)break;const B=t[C].para;if(B>V+1){y+=w*(B-V-1),V=B-1,S+=1;continue}let $=I?[{x0:0,x1:d}]:cS(i,(y+v)/c,(y+w-v)/c,o).map(k=>({x0:k.x0*d,x1:k.x1*d}));p>0&&x>0&&!I&&$.length&&(W===null&&(W=S,N=$[0].x0,q=y),S-W<x&&($=lS($,{x0:N,x1:N+p})));const T=$.reduce((k,F)=>Math.max(k,F.x1-F.x0),0);for(const k of $){const F=k.x1-k.x0;if(F<f)continue;if(C>=t.length||t[C].para!==B)break;const g=C;let O=0;for(;C<t.length&&t[C].para===B;){const P=n[C]*l,X=C===g?P:m+P;if(O+X>F&&!(C===g&&F>=T-.5&&P>d-.5))break;O+=X,C+=1}if(C>g){const P=C>=t.length||t[C].para!==B;h.push({top:y,left:k.x0,width:F,from:g,to:C,justify:r==="justify"&&!P})}if(C>=t.length||t[C].para!==B)break}V=B,y+=w,S+=1}return{segments:h,placed:C,height:h.length?y:0,capLeft:N,capTop:q}}function pS(e){return`
23603
+ `,bw=["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"],ww={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:bw.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"]}]}]},Sw={element:xw,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:ww,sourceCode:vw,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Cr=typeof window>"u"?s.useEffect:s.useLayoutEffect,jo=120,Lc=3,Cw=.12,Ya=.25,$w=10,Tw=4e3,Iw=.12,Rw=3,Lw=2,gu=["rectangle","ellipse","circle","triangle-up","triangle-down","diamond","hourglass","teardrop","leaf","wave","custom"];function Gr(e){return e<0?0:e>1?1:e}function Pw(e,t){return e.filter(n=>n.length>0).map(n=>`M ${n.map(i=>`${i.x*t.width} ${i.y*t.height}`).join(" L ")} Z`).join(" ")}function Ew(e,t){let n=1/0,i=1/0,o=-1/0,r=-1/0;for(const c of e)for(const u of c){const p=u.x*t.width,x=u.y*t.height;p<n&&(n=p),p>o&&(o=p),x<i&&(i=x),x>r&&(r=x)}const l=o-n,d=r-i;return!isFinite(l)||!isFinite(d)||l<=0||d<=0?null:{x:n,y:i,width:l,height:d}}function wo(e){return e.map(([t,n])=>({x:t,y:n}))}function qa(e,t=jo){const n=[];for(let i=0;i<t;i+=1)n.push(e(i/t));return n}function Ar(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 ps(e,t){switch(e){case"ellipse":return[qa(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[qa(o=>{const r=o*Math.PI*2;return{x:.5+Math.cos(r)*n,y:.5+Math.sin(r)*i}})]}case"triangle-up":return[wo([[.5,0],[1,1],[0,1]])];case"triangle-down":return[wo([[0,0],[1,0],[.5,1]])];case"diamond":return[wo([[.5,0],[1,.5],[.5,1],[0,.5]])];case"hourglass":return[wo([[0,0],[1,0],[.56,.5],[1,1],[0,1],[.44,.5]])];case"teardrop":return Ar([qa(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(jo/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=jo,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[wo([[0,0],[1,0],[1,1],[0,1]])]}}const hu={x:0,y:0,width:100,height:100};function Mw(e){const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?hu:{x:t[0],y:t[1],width:t[2],height:t[3]}}function Fr(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}const ms=16,kw=12,Aw=16,Xr="0 0 100 100",Yr=100,Ua=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,Fw=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g;function _w(e){const t=e.match(Fw);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 gs(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 Nw(e){return{p:on(e.p),in:e.in?on(e.in):null,out:e.out?on(e.out):null}}function Pn(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(Nw)}))}function ti(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 Pc(e,t,n,i=n){return ti(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function Ww(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),x=Math.sin(u),w=(e.x-l.x)/2,m=(e.y-l.y)/2,h=p*w+x*m,f=-x*w+p*m,v=h*h/(d*d)+f*f/(c*c);if(v>1){const ie=Math.sqrt(v);d*=ie,c*=ie}const C=o===r?-1:1,y=d*d*f*f+c*c*h*h,S=Math.max(0,d*d*c*c-y),G=y===0?0:C*Math.sqrt(S/y),W=G*d*f/c,U=-G*c*h/d,H=p*W-x*U+(e.x+l.x)/2,I=x*W+p*U+(e.y+l.y)/2,z=Math.atan2((f-U)/c,(h-W)/d);let T=Math.atan2((-f-U)/c,(-h-W)/d)-z;!r&&T>0&&(T-=Math.PI*2),r&&T<0&&(T+=Math.PI*2);const A=Math.max(1,Math.ceil(Math.abs(T)/(Math.PI/2))),_=T/A,g=4/3*Math.tan(_/4),B=(ie,L)=>({x:H+p*d*ie-x*c*L,y:I+x*d*ie+p*c*L}),P=[];let Y=z;for(let ie=0;ie<A;ie+=1){const L=Y+_,O=Math.cos(Y),K=Math.sin(Y),ue=Math.cos(L),le=Math.sin(L);P.push({c1:B(O-g*K,K+g*O),c2:B(ue+g*le,le-g*ue),p:ie===A-1?on(l):B(ue,le)}),Y=L}return P}function Vo(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 m=i[0],h=i[i.length-1];Math.abs(m.p.x-h.p.x)<1e-6&&Math.abs(m.p.y-h.p.y)<1e-6&&(m.in=h.in??m.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(m,h)=>{i.push({p:m,in:h??null,out:null}),r=m},x=m=>{i.length&&(i[i.length-1].out=m)};Ua.lastIndex=0;let w=Ua.exec(t);for(;w!==null;){const m=w[1],h=m.toUpperCase(),f=m!==h,v=_w(w[2]),C=y=>f?{x:r.x+v[y],y:r.y+v[y+1]}:{x:v[y],y:v[y+1]};if(h==="Z")o=!0,u(),r=on(l),d=null,c=null;else if(h==="M"){for(let y=0;y+1<v.length;y+=2){const S=C(y);y===0&&(u(),l=on(S)),p(S)}d=null,c=null}else if(h==="L"){for(let y=0;y+1<v.length;y+=2)p(C(y));d=null,c=null}else if(h==="H"){for(const y of v)p({x:f?r.x+y:y,y:r.y});d=null,c=null}else if(h==="V"){for(const y of v)p({x:r.x,y:f?r.y+y:y});d=null,c=null}else if(h==="C"){for(let y=0;y+5<v.length;y+=6){const S=C(y),G=C(y+2),W=C(y+4);x(S),p(W,G),d=G}c=null}else if(h==="S"){for(let y=0;y+3<v.length;y+=4){const S=d?gs(d,r):on(r),G=C(y),W=C(y+2);x(S),p(W,G),d=G}c=null}else if(h==="Q")for(let y=0;y+3<v.length;y+=4){const S=C(y),G=C(y+2);x(gn(r,S,2/3)),p(G,gn(G,S,2/3)),c=S,d=null}else if(h==="T")for(let y=0;y+1<v.length;y+=2){const S=c?gs(c,r):on(r),G=C(y);x(gn(r,S,2/3)),p(G,gn(G,S,2/3)),c=S,d=null}else if(h==="A")for(let y=0;y+6<v.length;y+=7){const S=f?{x:r.x+v[y+5],y:r.y+v[y+6]}:{x:v[y+5],y:v[y+6]};for(const G of Ww(r,v[y],v[y+1],v[y+2],v[y+3]!==0,v[y+4]!==0,S))x(G.c1),p(G.p,G.c2);d=null,c=null}w=Ua.exec(t)}return u(),n}function Rn(e){return`${Number(e.toFixed(2))}`}function tr(e,t){return!e.out&&!t.in}function Ec(e,t){if(tr(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 Go(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(Ec(r,l)),r=l;if(n.closed){const l=Ec(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function fu(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 hs(e,t,n){if(tr(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 nl(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of fu(n)){if(tr(o.from,o.to)){i.push(on(o.from.p));continue}for(let r=0;r<ms;r+=1)i.push(hs(o.from,o.to,r/ms))}n.closed||i.push(on(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function Jn(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of nl(e))for(const l of r)l.x<t&&(t=l.x),l.x>i&&(i=l.x),l.y<n&&(n=l.y),l.y>o&&(o=l.y);return{minX:t,minY:n,maxX:i,maxY:o}}function Hw(e){const t=Jn(e);return!isFinite(t.minX)||!isFinite(t.maxX)||!isFinite(t.minY)||!isFinite(t.maxY)?null:{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}}function yu(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 xu(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=kw)return{closed:!0,nodes:t.map(r=>({p:on(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/Aw)),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),...yu(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function Dw(e){const t={x:0,y:0,width:Yr,height:Yr};if(!e||e.pathFit!=="viewbox"||e.pathViewBox!==Xr||!e.customPath)return t;const n=Vo(e.customPath);if(!n.length)return t;const i=Jn(n),o=i.maxX-i.minX,r=i.maxY-i.minY;return!isFinite(i.minX)||!isFinite(i.minY)||!(o>0)||!(r>0)?t:{x:i.minX,y:i.minY,width:o,height:r}}function vu(e,t,n=1){if(!e.length)return!1;const i=Jn(e);if(!isFinite(i.minX)||!isFinite(i.maxX))return!1;const o=Math.max(n,t.width*.5),r=Math.max(n,t.height*.5);return i.minX<t.x-o||i.minY<t.y-r||i.maxX>t.x+t.width+o||i.maxY>t.y+t.height+r}function Ow(e,t){if(!e.length)return e;const n=Jn(e),i=n.maxX-n.minX,o=n.maxY-n.minY;if(!(i>0)||!(o>0)||n.minX>=t.x-1e-6&&n.minY>=t.y-1e-6&&n.maxX<=t.x+t.width+1e-6&&n.maxY<=t.y+t.height+1e-6)return e;const l=Math.min(t.width/i,t.height/o),d=t.x+(t.width-i*l)/2,c=t.y+(t.height-o*l)/2;return ti(e,u=>({x:d+(u.x-n.minX)*l,y:c+(u.y-n.minY)*l}))}function Bw(e,t=1,n){const i=Dw(n),o=ps(e==="custom"?"rectangle":e,t),r=Ow(ti(xu(o),l=>({x:l.x*i.width+i.x,y:l.y*i.height+i.y})),i);return{shape:e,customPath:Go(r),pathFit:"viewbox",pathViewBox:Xr}}function $r(e,t){return t>0?Math.round(e/t)*t:e}function zw(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=Pn(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 Mc(e,t,n,i){var r;if(!t.length)return e;const o=Pn(e);for(const{contour:l,node:d}of t){const c=(r=o[l])==null?void 0:r.nodes[d];c&&(c.p={x:c.p.x+n,y:c.p.y+i},c.in&&(c.in={x:c.in.x+n,y:c.in.y+i}),c.out&&(c.out={x:c.out.x+n,y:c.out.y+i}))}return o}function jw(e,t){const n=new Map;for(const{contour:o,node:r}of t){const l=n.get(o)??[];l.push(r),n.set(o,l)}let i=e;return n.forEach((o,r)=>{const l=[...o].sort((d,c)=>c-d);for(const d of l)i=bu(i,r,d)}),i}function Vw(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const d=Pn(e),c=d[t].nodes[n];if(c[i]=on(o),r){const p=i==="in"?"out":"in";c[p]=gs(o,c.p)}return d}function Gw(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=Pn(e);return r[t].nodes[n][i]=null,r}function Xw(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=Pn(e),c=d[t].nodes,u=n+1;if(tr(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,x=l.in??l.p,w=gn(r.p,p,i),m=gn(p,x,i),h=gn(x,l.p,i),f=gn(w,m,i),v=gn(m,h,i),C=gn(f,v,i),y=(n+1)%o.nodes.length;return c[n].out=w,c[y].in=h,c.splice(u,0,{p:C,in:f,out:v}),{contours:d,nodeIndex:u}}function bu(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=Pn(e);return o[t].nodes.splice(n,1),o}function kc(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=Pn(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=yu(c,l.p,u);return l.in=p.in,l.out=p.out,r}function Yw(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 qw(e,t){let n=null;return e.forEach((i,o)=>{for(const r of fu(i)){const l=tr(r.from,r.to)?1:ms;for(let d=0;d<l;d+=1){const c=d/l,u=(d+1)/l,p=Yw(t,hs(r.from,r.to,c),hs(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 Uw(e,t){const n=[];return e.forEach((i,o)=>{i.nodes.forEach((r,l)=>{o===t.contour&&l===t.node||n.push(r.p)})}),n}function Ac(e,t,n){const i=t.filter((r,l)=>isFinite(r)&&t.findIndex(d=>Math.abs(d-r)<1e-6)===l),o=i.map(r=>({value:r,axis:r,from:null}));for(const r of e)o.push({value:r[n],axis:null,from:r});for(const r of i)for(const l of e)o.push({value:r*2-l[n],axis:r,from:l});return o}function Fc(e,t,n,i,o){const r=i(t)[n];let l=null,d=1/0;for(const c of e){const u=n==="x"?{x:c.value,y:t.y}:{x:t.x,y:c.value},p=Math.abs(i(u)[n]-r);p>o||l&&p>=d||(l=c,d=p)}return l}const _c=Math.PI/4,Kw=8,Zw=Math.PI/18,Jw=8,zi=24,ji=[];function Qw(e,t){return e.length===t.length&&e.every((n,i)=>n.kind===t[i].kind&&n.a.x===t[i].a.x&&n.a.y===t[i].a.y&&n.b.x===t[i].b.x&&n.b.y===t[i].b.y)}function eS(e){const t=Math.PI*2;return((e+Math.PI)%t+t)%t-Math.PI}function fs(e,t){const n=t.x-e.x,i=t.y-e.y,o=Math.hypot(n,i);return o<1e-6?null:{x:n/o,y:i/o}}function tS(e,t){const n=fs(e,t);return n?{kind:"align",a:{x:e.x-n.x*zi,y:e.y-n.y*zi},b:{x:t.x+n.x*zi,y:t.y+n.y*zi}}:{kind:"align",a:e,b:t}}function ys(e,t,n){return t==="x"?{kind:"center",a:{x:e,y:0},b:{x:e,y:n.height}}:{kind:"center",a:{x:0,y:e},b:{x:n.width,y:e}}}function Nc(e,t,n,i,o){if(e.axis===null)return tS(n,o(e.from??n));const r=t==="x"?{x:e.axis,y:0}:{x:0,y:e.axis};return ys(o(r)[t],t,i)}function nS(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(Nc(t,"x",l,i,o)),n&&e.y===n.value&&r.push(Nc(n,"y",l,i,o)),r}function iS(e,t,n,i){const o=e==null?void 0:e.nodes[t];if(!e||!o)return null;const r=i(o.p),l=n==="in"?o.out:o.in;if(l)return fs(i(l),r);const d=e.nodes.length,c=t+(n==="in"?1:-1);if(!e.closed&&(c<0||c>=d))return null;const u=e.nodes[(c+d)%d];if(!u)return null;const p=(n==="in"?u.in:u.out)??u.p;return fs(i(p),r)}function oS(e,t,n,i,o,r,l){const d=r(t),c=r(e),u=c.x-d.x,p=c.y-d.y,x=Math.hypot(u,p);if(x<1e-6)return{point:e,guides:ji};const w=Math.atan2(p,u),m=Math.round(w/_c)*_c;let h=o?m:null,f=!1;if(!o){const U=[];n&&U.push({angle:Math.atan2(n.y,n.x),smooth:!0}),U.push({angle:m,smooth:!1});for(const H of U){const I=eS(H.angle-w);if(!(Math.abs(I)>Zw)&&!(Math.abs(Math.sin(I))*x>Kw)){h=H.angle,f=H.smooth;break}}}const v=i!==null&&i>0&&Math.abs(x-i)<=Jw;if(h===null&&!v)return{point:e,guides:ji};const C=h??w,y=v?i:x,S={x:Math.cos(C),y:Math.sin(C)},G=y+(h===null?0:zi),W=v?y:f?zi:0;return{point:l({x:d.x+S.x*y,y:d.y+S.y*y}),guides:[{kind:"angle",a:{x:d.x-S.x*W,y:d.y-S.y*W},b:{x:d.x+S.x*G,y:d.y+S.y*G}}]}}function Wc(e,t="stretch",n=hu){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=Vo(i),d=nl(l);if(d.length)return t==="viewbox"?Fr(d,n):Ar(d);if(typeof document>"u")return null;const c=i.split(/(?=[Mm])/).map(x=>x.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const x of c){const w=document.createElementNS("http://www.w3.org/2000/svg","path");w.setAttribute("d",x),u.appendChild(w);let m=0;try{m=w.getTotalLength()}catch{m=0}if(!m)continue;const h=[];for(let f=0;f<jo;f+=1){const v=w.getPointAtLength(f/jo*m);h.push({x:v.x,y:v.y})}p.push(h)}return p.length?t==="viewbox"?Fr(p,n):Ar(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"?Fr([r],n):Ar([r])}function rS(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=Gr(n[o]),l=Gr(n[o+1]);l>r&&i.push({x0:r,x1:l})}return aS(i)}function aS(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 sS(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 lS(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 cS(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 dS(e,t,n,i){let o=null;for(let r=0;r<Lc;r+=1){const l=Gr(t+(n-t)*r/Math.max(1,Lc-1)),d=rS(e,l),c=i==="avoid"?lS(d):d;if(o=o===null?c:sS(o,c),o.length===0)return[]}return o??[]}function wu(e){return!!e&&typeof e=="object"&&e.type==="link"}function uS(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if(wu(c)){o(c.children??[],c.value,c.target);continue}const u=c,p=(u==null?void 0:u.text)??"";if(p.trim())for(const x of p.split(/\s+/))x&&t.push({text:x,leaf:u,href:l,target:d,para:i})}};o((n==null?void 0:n.children)??[])}),t}function Hc(e){return{...e.fontFamily&&{fontFamily:po(e.fontFamily)},...e.fontWeight&&{fontWeight:e.fontWeight},...e.fontStyle&&{fontStyle:e.fontStyle},...e.textDecoration&&{textDecoration:e.textDecoration},...e.textTransform&&{textTransform:e.textTransform},...e.fontVariant&&{fontVariant:e.fontVariant},...e.verticalAlign&&{verticalAlign:e.verticalAlign,lineHeight:"0px"}}}function pS(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(wu(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function Dc(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:d,height:c,allowOverflow:u,capInset:p,capLines:x}=e,w=e.lineHeight*l,m=e.spaceWidth*l,h=[];if(!t.length||d<=0||w<=0)return{segments:h,placed:0,height:0,capLeft:0,capTop:0};const f=Math.max(1,m*.5),v=w*Cw;let C=0,y=0,S=0,G=t[0].para,W=0,U=0,H=null;for(;C<t.length&&S<Tw;){const I=y+w>c;if(I&&!u)break;const z=t[C].para;if(z>G+1){y+=w*(z-G-1),G=z-1,S+=1;continue}let $=I?[{x0:0,x1:d}]:dS(i,(y+v)/c,(y+w-v)/c,o).map(A=>({x0:A.x0*d,x1:A.x1*d}));p>0&&x>0&&!I&&$.length&&(H===null&&(H=S,W=$[0].x0,U=y),S-H<x&&($=cS($,{x0:W,x1:W+p})));const T=$.reduce((A,_)=>Math.max(A,_.x1-_.x0),0);for(const A of $){const _=A.x1-A.x0;if(_<f)continue;if(C>=t.length||t[C].para!==z)break;const g=C;let B=0;for(;C<t.length&&t[C].para===z;){const P=n[C]*l,Y=C===g?P:m+P;if(B+Y>_&&!(C===g&&_>=T-.5&&P>d-.5))break;B+=Y,C+=1}if(C>g){const P=C>=t.length||t[C].para!==z;h.push({top:y,left:A.x0,width:_,from:g,to:C,justify:r==="justify"&&!P})}if(C>=t.length||t[C].para!==z)break}G=z,y+=w,S+=1}return{segments:h,placed:C,height:h.length?y:0,capLeft:W,capTop:U}}function mS(e){return`
23604
23604
  .${e}-wrapper {
23605
23605
  box-sizing: border-box;
23606
23606
  display: flex;
@@ -23829,7 +23829,7 @@ export function Helix({
23829
23829
  clip-path: inset(50%);
23830
23830
  white-space: nowrap;
23831
23831
  }
23832
- `}const So=7,mS=3.5,Co=9,Qn=8,ei=14,Oc=10,gS=24,Tr=14,hS=4,fS=1,yS=.05,qr=1.08;function Ur(e,t){switch(t){case"nw":return{x:e.minX,y:e.minY};case"ne":return{x:e.maxX,y:e.minY};case"se":return{x:e.maxX,y:e.maxY};case"sw":return{x:e.minX,y:e.maxY}}}function wu(e){switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}}function xs(e,t){const n=Ur(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*Oc,y:n.y+o*Oc}}const vs=.1,bs=8,xS=4;function ws(e,t){return!(t.width>0)||!(t.height>0)||!(e.width>0)||!(e.height>0)?1:Math.max(e.width/t.width,e.height/t.height)}function Si(e,t,n){const i=ws(e,t)*n;return{width:t.width*i,height:t.height*i}}function Ln(e,t,n){return(e-t)*n}function Vi(e,t,n){const i=e-t;return Math.abs(i)<xS?.5:Gr(n/i)}function vS(e,t,n,i,o,r){const l=Si(e,n,r),d=e.x+Ln(e.width,l.width,i),c=e.y+Ln(e.height,l.height,o),u=ws(e,n),p=ws(t,n),x=Math.min(bs,Math.max(vs,p>0?r*(u/p):r)),w=Si(t,n,x);return{focalX:Vi(t.width,w.width,d-t.x),focalY:Vi(t.height,w.height,c-t.y),scale:x}}function bS({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,stage:l,onStageChange:d,onSelectionChange:c,onChange:u,onCommit:p}){const x=s.useRef(null),w=s.useRef(null),m=s.useRef(i);m.current=i;const h=s.useRef(null),f=s.useRef(null),v=s.useRef(null),C=s.useRef(null),[y,S]=s.useState([]),[V,N]=s.useState(ji),q=s.useCallback(b=>{N(M=>Jw(M,b)?M:b)},[]),W=l==="shape";s.useEffect(()=>{var b;W&&((b=x.current)==null||b.focus({preventScroll:!0}))},[W]),s.useEffect(()=>{W||S(b=>b.length?[]:b)},[W]);const I=y.length>0;s.useEffect(()=>{c==null||c(I)},[I,c]),s.useEffect(()=>()=>c==null?void 0:c(!1),[c]);const B=n.width>0?t.width/n.width:1,$=n.height>0?t.height/n.height:1,T=s.useCallback(b=>r?{x:(b.x-n.x)*B,y:(b.y-n.y)*$}:{x:b.x-n.x,y:b.y-n.y},[r,n,B,$]),k=s.useCallback(b=>r?{x:n.x+(B>0?b.x/B:0),y:n.y+($>0?b.y/$:0)}:{x:n.x+b.x,y:n.y+b.y},[r,n,B,$]),F=s.useMemo(()=>k({x:t.width/2,y:t.height/2}),[k,t.width,t.height]),g=s.useCallback((b,M)=>{var j;const E=(j=x.current)==null?void 0:j.getBoundingClientRect();return!E||E.width<=0||E.height<=0?{x:0,y:0}:r?{x:n.x+(b-E.left)/E.width*n.width,y:n.y+(M-E.top)/E.height*n.height}:{x:n.x+(b-E.left),y:n.y+(M-E.top)}},[r,n]),O=s.useCallback((b,M)=>{var j;const E=(j=x.current)==null?void 0:j.getBoundingClientRect();return!E||E.width<=0||E.height<=0?{x:0,y:0}:{x:(b-E.left)/E.width*t.width,y:(M-E.top)/E.height*t.height}},[t.width,t.height]),P=s.useCallback((b,M)=>{p(b,M)},[p]),X=b=>{var $e;const M=b.metaKey||b.ctrlKey,E=v.current;if(E&&b.pointerId===E.pointerId){if(b.stopPropagation(),b.preventDefault(),E.startDistance<=0)return;const G=g(b.clientX,b.clientY),pe=Math.hypot(G.x-E.origin.x,G.y-E.origin.y),oe=Math.max(yS,pe/E.startDistance);if(!E.moved&&Math.abs(oe-1)<1e-4)return;E.moved=!0,u(Pc(E.startContours,E.origin,oe));return}const j=f.current;if(j&&b.pointerId===j.pointerId){b.stopPropagation(),b.preventDefault();const G=g(b.clientX,b.clientY),{bbox:pe}=j,oe=pe.maxX-pe.minX,Y=pe.maxY-pe.minY,le=G.x-j.origin.x,_e=G.y-j.origin.y;let me=le,J=_e;if(isFinite(oe)&&isFinite(Y))if(r){const ke=Math.min(n.x,n.x+n.width-oe),tt=Math.max(n.x,n.x+n.width-oe),Ye=Math.min(n.y,n.y+n.height-Y),dt=Math.max(n.y,n.y+n.height-Y),ot=Math.min(tt,Math.max(ke,pe.minX+le)),Ve=Math.min(dt,Math.max(Ye,pe.minY+_e));me=ot-pe.minX,J=Ve-pe.minY}else{const ke=pe.minX-n.x,tt=pe.minY-n.y,Ye=Math.min(0,t.width-oe),dt=Math.max(0,t.width-oe),ot=Math.min(0,t.height-Y),Ve=Math.max(0,t.height-Y),Re=Math.min(dt,Math.max(Ye,ke+le)),He=Math.min(Ve,Math.max(ot,tt+_e));me=Re-ke,J=He-tt}const Ke=[];if(!M&&isFinite(oe)&&isFinite(Y)){const ke=T({x:pe.minX+oe/2+me,y:pe.minY+Y/2+J}),tt={x:t.width/2,y:t.height/2};Math.abs(ke.x-tt.x)<=Tr&&(me=F.x-pe.minX-oe/2,Ke.push(ys(tt.x,"x",t))),Math.abs(ke.y-tt.y)<=Tr&&(J=F.y-pe.minY-Y/2,Ke.push(ys(tt.y,"y",t)))}if(!j.moved&&me===0&&J===0)return;j.moved=!0,q(Ke.length?Ke:ji),u(ti(j.startContours,ke=>({x:ke.x+me,y:ke.y+J})),{carryImage:!0});return}const Ce=C.current;if(Ce&&b.pointerId===Ce.pointerId){b.stopPropagation(),b.preventDefault();const G=g(b.clientX,b.clientY);let pe=G.x-Ce.origin.x,oe=G.y-Ce.origin.y;if(b.shiftKey&&(Math.abs(pe)>Math.abs(oe)?oe=0:pe=0),!Ce.moved&&pe===0&&oe===0)return;Ce.moved=!0,u(Mc(Ce.startContours,Ce.selection,pe,oe));return}const Q=h.current;if(!Q||b.pointerId!==Q.pointerId)return;b.stopPropagation(),b.preventDefault();const Te=g(b.clientX,b.clientY);if(Q.kind==="anchor"){const G={x:Q.anchor.x+(Te.x-Q.origin.x),y:Q.anchor.y+(Te.y-Q.origin.y)},pe=M?[]:qw(m.current,{contour:Q.contour,node:Q.node}),oe=M||!Q.center?[]:[Q.center],Y=Fc(Ac(pe,oe.map(me=>me.x),"x"),G,"x",T,Tr),le=Fc(Ac(pe,oe.map(me=>me.y),"y"),G,"y",T,Tr),_e=M?G:{x:(Y==null?void 0:Y.value)??$r(G.x,o),y:(le==null?void 0:le.value)??$r(G.y,o)};if(b.shiftKey&&(Math.abs(_e.x-Q.anchor.x)>Math.abs(_e.y-Q.anchor.y)?_e.y=Q.anchor.y:_e.x=Q.anchor.x),!Q.moved&&_e.x===Q.anchor.x&&_e.y===Q.anchor.y)return;Q.moved=!0,q(tS(_e,Y,le,t,T)),u(Bw(m.current,Q.contour,Q.node,_e));return}const ie=($e=m.current[Q.contour])==null?void 0:$e.nodes[Q.node],ue=Q.mirror&&!b.altKey,fe=ue||M?null:Q.kind==="in"?ie==null?void 0:ie.out:ie==null?void 0:ie.in,K=ie?T(ie.p):null,Z=fe?T(fe):null,se=ie&&(!M||b.shiftKey)?iS(Te,ie.p,ue||M?null:nS(m.current[Q.contour],Q.node,Q.kind,T),K&&Z?Math.hypot(Z.x-K.x,Z.y-K.y):null,b.shiftKey,T,k):{point:Te,guides:ji},Se=se.guides.length?se.point:M?Te:{x:$r(Te.x,o),y:$r(Te.y,o)},Me=Q.kind==="in"?ie==null?void 0:ie.in:ie==null?void 0:ie.out;!Q.moved&&Me&&Se.x===Me.x&&Se.y===Me.y||(Q.moved=!0,q(se.guides),u(jw(m.current,Q.contour,Q.node,Q.kind,Se,ue)))},te=b=>{q(ji);const M=v.current;if(M&&b.pointerId===M.pointerId){v.current=null,b.stopPropagation();const fe=x.current;fe!=null&&fe.hasPointerCapture(M.pointerId)&&fe.releasePointerCapture(M.pointerId),M.moved&&P(m.current,{preserveShape:!0});return}const E=f.current;if(E&&b.pointerId===E.pointerId){f.current=null,b.stopPropagation();const fe=x.current;fe!=null&&fe.hasPointerCapture(E.pointerId)&&fe.releasePointerCapture(E.pointerId),E.moved?P(m.current,{preserveShape:!0}):S([]);return}const j=C.current;if(j&&b.pointerId===j.pointerId){C.current=null,b.stopPropagation();const fe=x.current;fe!=null&&fe.hasPointerCapture(j.pointerId)&&fe.releasePointerCapture(j.pointerId),j.moved&&P(m.current);return}const Ce=h.current;if(!Ce||b.pointerId!==Ce.pointerId)return;h.current=null,b.stopPropagation();const Q=x.current;Q!=null&&Q.hasPointerCapture(Ce.pointerId)&&Q.releasePointerCapture(Ce.pointerId);const Te=Math.hypot(b.clientX-Ce.clientOrigin.x,b.clientY-Ce.clientOrigin.y);if(Ce.moved||Te>hS){Ce.moved&&P(m.current);return}if(!Ce.toggleOnRelease||b.type!=="pointerup")return;const ue=kc(m.current,Ce.contour,Ce.node);ue!==m.current&&(u(ue),P(ue))},L=b=>{b.stopPropagation()},H=b=>{var M,E;b.stopPropagation(),b.preventDefault(),(M=x.current)==null||M.focus({preventScroll:!0}),f.current={pointerId:b.pointerId,origin:g(b.clientX,b.clientY),startContours:Pn(i),bbox:Jn(i),moved:!1},(E=x.current)==null||E.setPointerCapture(b.pointerId)},U=(b,M)=>{var Te,ie;b.stopPropagation(),b.preventDefault(),(Te=x.current)==null||Te.focus({preventScroll:!0}),S([]),d("shape");const E=Jn(i),j=Ur(E,wu(M)),Ce=xs(E,M),Q=Math.hypot(Ce.x-j.x,Ce.y-j.y);!isFinite(Q)||Q<=0||(v.current={pointerId:b.pointerId,corner:M,origin:j,startDistance:Q,startContours:Pn(i),moved:!1},(ie=x.current)==null||ie.setPointerCapture(b.pointerId))},de=(b,M,E,j)=>{var Te,ie,ue,fe;b.stopPropagation(),b.preventDefault(),(Te=x.current)==null||Te.focus({preventScroll:!0});const Ce=(ie=i[E])==null?void 0:ie.nodes[j];if(!Ce)return;if(b.altKey){const K=M==="anchor"?vu(i,E,j):Vw(i,E,j,M);if(K===i)return;S(M==="anchor"?[]:[{contour:E,node:j}]),u(K),P(K);return}const Q=b.metaKey||b.ctrlKey;if(M==="anchor"&&b.shiftKey&&!Q){S(K=>K.some(Z=>Z.contour===E&&Z.node===j)?K.filter(Z=>!(Z.contour===E&&Z.node===j)):[...K,{contour:E,node:j}]);return}if(M==="anchor"&&!Q&&y.length>1&&y.some(K=>K.contour===E&&K.node===j)){C.current={pointerId:b.pointerId,origin:g(b.clientX,b.clientY),startContours:Pn(i),selection:y,moved:!1},(ue=x.current)==null||ue.setPointerCapture(b.pointerId);return}S([{contour:E,node:j}]),h.current={kind:M,contour:E,node:j,pointerId:b.pointerId,origin:g(b.clientX,b.clientY),clientOrigin:{x:b.clientX,y:b.clientY},anchor:Ce.p,center:Ww(i),mirror:M!=="anchor"&&!!(Ce.in&&Ce.out),toggleOnRelease:Q,moved:!1},(fe=x.current)==null||fe.setPointerCapture(b.pointerId)},ae=b=>{b.stopPropagation(),b.preventDefault();const M=ti(i,T),E=Yw(M,O(b.clientX,b.clientY));if(!E||E.distance>gS)return;const{contours:j,nodeIndex:Ce}=Gw(i,E.contour,E.segment,E.t);Ce<0||(S([{contour:E.contour,node:Ce}]),u(j),P(j))},A=b=>{if(b.key==="="||b.key==="+"||b.key==="-"||b.key==="_"){b.preventDefault(),b.stopPropagation();const Q=Jn(i);if(!isFinite(Q.minX)||!isFinite(Q.maxX))return;const Te={x:(Q.minX+Q.maxX)/2,y:(Q.minY+Q.maxY)/2},ue=b.key==="="||b.key==="+"?qr:1/qr,fe=Pc(i,Te,ue);u(fe),P(fe,{preserveShape:!0});return}if(b.key==="Escape"){b.stopPropagation(),S([]),d("none");return}if(!y.length)return;if(b.key==="Backspace"||b.key==="Delete"){b.preventDefault(),b.stopPropagation();const Q=zw(i,y);if(Q===i)return;S([]),u(Q),P(Q);return}const M=o>0?o:fS,E=b.shiftKey?M*10:M,j={ArrowLeft:[-E,0],ArrowRight:[E,0],ArrowUp:[0,-E],ArrowDown:[0,E]}[b.key];if(!j)return;b.preventDefault(),b.stopPropagation();const Ce=Mc(i,y,j[0],j[1]);u(Ce),P(Ce)},ce=s.useMemo(()=>Go(ti(i,T)),[i,T]),z=s.useMemo(()=>Jn(i),[i]),re=T({x:z.minX,y:z.minY}),ee={width:T({x:z.maxX,y:z.minY}).x-re.x,height:T({x:z.minX,y:z.maxY}).y-re.y},xe=W&&y.length===0&&isFinite(z.minX)&&isFinite(z.maxX)&&z.maxX>z.minX&&z.maxY>z.minY,Fe=y.length>0||W,ye=Fe;return a.jsxs("svg",{ref:x,className:`${e}-editor${Fe?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:A,onPointerDown:()=>{var b;return(b=x.current)==null?void 0:b.focus({preventScroll:!0})},onPointerMove:X,onPointerUp:te,onPointerCancel:te,onLostPointerCapture:te,onContextMenu:b=>{b.preventDefault()},"data-pretext-path-editor":!0,"data-selection":"none",children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>{S([]),d("none")},onClick:ae}),ye&&a.jsx("path",{className:`${e}-editor-hit`,d:ce,onClick:ae}),ye&&a.jsx("path",{className:`${e}-editor-outline`,d:ce}),ye&&V.map((b,M)=>a.jsx("line",{className:`${e}-editor-snap ${e}-editor-snap-${b.kind}`,x1:b.a.x,y1:b.a.y,x2:b.b.x,y2:b.b.y},`${b.kind}-${M}`)),a.jsx("path",{ref:w,className:`${e}-editor-body`,d:ce,fillRule:"evenodd",onPointerDown:H,onClick:ae}),ye&&i.map((b,M)=>b.nodes.map((E,j)=>{const Ce=y.some(Te=>Te.contour===M&&Te.node===j),Q=T(E.p);return a.jsxs("g",{children:[Ce&&y.length===1&&["in","out"].map(Te=>{const ie=E[Te];if(!ie)return null;const ue=T(ie);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:Q.x,y1:Q.y,x2:ue.x,y2:ue.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:ue.x,cy:ue.y,r:mS}),a.jsx("circle",{className:`${e}-editor-grab`,cx:ue.x,cy:ue.y,r:Co,onPointerDown:fe=>de(fe,Te,M,j),onClick:L})]},Te)}),a.jsx("rect",{className:`${e}-editor-anchor${Ce?` ${e}-editor-anchor-selected`:""}`,x:Q.x-So/2,y:Q.y-So/2,width:So,height:So,rx:E.in||E.out?So/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:Q.x-Co,y:Q.y-Co,width:Co*2,height:Co*2,onPointerDown:Te=>de(Te,"anchor",M,j),onClick:L,onDoubleClick:Te=>{Te.stopPropagation(),Te.preventDefault();const ie=kc(i,M,j);u(ie),P(ie)}})]},`${M}-${j}`)})),xe&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:re.x,y:re.y,width:ee.width,height:ee.height}),["nw","ne","se","sw"].map(b=>{const M=T(xs(z,b)),E=b==="ne"||b==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:M.x-Qn/2,y:M.y-Qn/2,width:Qn,height:Qn}),a.jsx("rect",{className:`${e}-editor-scale-grab${E?` ${e}-editor-scale-grab-nesw`:""}`,x:M.x-ei/2,y:M.y-ei/2,width:ei,height:ei,onPointerDown:j=>U(j,b),onClick:L})]},b)})]})]})}function wS({P:e,box:t,bounds:n,natural:i,imageUrl:o,maskPath:r,stage:l,onStageChange:d,focalX:c,focalY:u,scale:p,onChange:x,onCommit:w}){const m=s.useRef(null),h=`pretext-image-ghost-${s.useId().replace(/:/g,"")}`,f=s.useRef(null),v=s.useRef(null),C=s.useRef({focalX:c,focalY:u,scale:p});C.current={focalX:c,focalY:u,scale:p};const y=l==="image";s.useEffect(()=>{var F;y&&((F=m.current)==null||F.focus({preventScroll:!0}))},[y]);const S=s.useCallback((F,g)=>{var P;const O=(P=m.current)==null?void 0:P.getBoundingClientRect();return!O||O.width<=0||O.height<=0?{x:0,y:0}:{x:(F-O.left)/O.width*t.width,y:(g-O.top)/O.height*t.height}},[t.width,t.height]),V=F=>{var O,P;if(!i)return;F.stopPropagation(),F.preventDefault(),(O=m.current)==null||O.focus({preventScroll:!0});const g=Si(n,i,p);f.current={pointerId:F.pointerId,origin:S(F.clientX,F.clientY),startX:Ln(n.width,g.width,c),startY:Ln(n.height,g.height,u),width:g.width,height:g.height,moved:!1},(P=m.current)==null||P.setPointerCapture(F.pointerId)},N=(F,g)=>{var de,ae;if(!i)return;F.stopPropagation(),F.preventDefault(),(de=m.current)==null||de.focus({preventScroll:!0});const O=Si(n,i,p),P=Ln(n.width,O.width,c),X=Ln(n.height,O.height,u),te={minX:P,minY:X,maxX:P+O.width,maxY:X+O.height},L=Ur(te,wu(g)),H=Ur(te,g),U=Math.hypot(H.x-L.x,H.y-L.y);!isFinite(U)||U<=0||(v.current={pointerId:F.pointerId,anchor:L,startDistance:U,startScale:p,startX:P,startY:X,moved:!1},(ae=m.current)==null||ae.setPointerCapture(F.pointerId))},q=F=>{if(!i)return;const g=v.current;if(g&&F.pointerId===g.pointerId){F.stopPropagation(),F.preventDefault();const P=S(F.clientX,F.clientY),X={x:P.x-n.x,y:P.y-n.y},te=Math.hypot(X.x-g.anchor.x,X.y-g.anchor.y),L=Math.min(bs,Math.max(vs,g.startScale*(te/g.startDistance)));if(!g.moved&&Math.abs(L-g.startScale)<1e-4)return;g.moved=!0;const H=L/g.startScale,U=g.anchor.x+(g.startX-g.anchor.x)*H,de=g.anchor.y+(g.startY-g.anchor.y)*H,ae=Si(n,i,L);x({focalX:Vi(n.width,ae.width,U),focalY:Vi(n.height,ae.height,de),scale:L});return}const O=f.current;if(O&&F.pointerId===O.pointerId){F.stopPropagation(),F.preventDefault();const P=S(F.clientX,F.clientY),X=P.x-O.origin.x,te=P.y-O.origin.y;if(!O.moved&&X===0&&te===0)return;O.moved=!0,x({focalX:Vi(n.width,O.width,O.startX+X),focalY:Vi(n.height,O.height,O.startY+te),scale:p})}},W=F=>{var P,X;const g=f.current;if(g&&F.pointerId===g.pointerId){f.current=null,F.stopPropagation(),(P=m.current)!=null&&P.hasPointerCapture(g.pointerId)&&m.current.releasePointerCapture(g.pointerId),g.moved&&w(C.current);return}const O=v.current;O&&F.pointerId===O.pointerId&&(v.current=null,F.stopPropagation(),(X=m.current)!=null&&X.hasPointerCapture(O.pointerId)&&m.current.releasePointerCapture(O.pointerId),O.moved&&w(C.current))},I=F=>{if(F.key==="Escape"){F.stopPropagation(),d("none");return}if(F.key==="="||F.key==="+"||F.key==="-"||F.key==="_"){F.preventDefault(),F.stopPropagation();const g=F.key==="="||F.key==="+",O=Math.min(bs,Math.max(vs,p*(g?qr:1/qr))),P={focalX:c,focalY:u,scale:O};x(P),w(P)}},B=["nw","ne","se","sw"],$={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},T=s.useMemo(()=>{const F=i??{width:n.width,height:n.height},g=Si(n,F,p);return!(g.width>0)||!(g.height>0)?null:{x:n.x+Ln(n.width,g.width,c),y:n.y+Ln(n.height,g.height,u),width:g.width,height:g.height}},[i,n.x,n.y,n.width,n.height,c,u,p]),k=T?{minX:T.x,minY:T.y,maxX:T.x+T.width,maxY:T.y+T.height}:$;return a.jsxs("svg",{ref:m,className:`${e}-editor${y?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:I,onPointerMove:q,onPointerUp:W,onPointerCancel:W,onLostPointerCapture:W,"data-pretext-image-editor":!0,children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>d("none")}),y&&o&&T&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:h,maskUnits:"userSpaceOnUse",x:T.x,y:T.y,width:T.width,height:T.height,children:[a.jsx("rect",{x:T.x,y:T.y,width:T.width,height:T.height,fill:"#FFFFFF"}),a.jsx("path",{d:r,fillRule:"evenodd",fill:"#000000"})]})}),a.jsx("image",{className:`${e}-editor-ghost`,href:o??void 0,x:T.x,y:T.y,width:T.width,height:T.height,preserveAspectRatio:"none",mask:`url(#${h})`}),a.jsx("rect",{className:`${e}-editor-image-bounds`,x:T.x,y:T.y,width:T.width,height:T.height})]}),y&&a.jsxs(a.Fragment,{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:n.x,y:n.y,width:n.width,height:n.height}),a.jsx("rect",{className:`${e}-editor-body`,x:n.x,y:n.y,width:n.width,height:n.height,onPointerDown:V}),B.map(F=>{const g=xs(k,F),O=F==="ne"||F==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:g.x-Qn/2,y:g.y-Qn/2,width:Qn,height:Qn}),a.jsx("rect",{className:`${e}-editor-scale-grab${O?` ${e}-editor-scale-grab-nesw`:""}`,x:g.x-ei/2,y:g.y-ei/2,width:ei,height:ei,onPointerDown:P=>N(P,F)})]},F)})]})]})}function SS(e){const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}}function CS(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 $S(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=SS(e);(!r||!CS(r,d))&&(r=d,i(d)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n}function TS(){return typeof document>"u"?null:document.body}function IS({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:d,allowOverflow:c,fitEnabled:u,scale:p,onFitScale:x,dropCapLines:w,dropCapSize:m,showGuides:h,typography:f,imageUrl:v,imageFocalX:C,imageFocalY:y,imageScale:S,imageCustomPath:V,pathDragActive:N,pathCarryImage:q,onCarryImageConsumed:W,pathEditor:I,imageEditor:B}){var We,Je;const $=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[T,k]=s.useState(null),F=s.useRef(null),[g,O]=s.useState({width:0,height:0}),[P,X]=s.useState(null),[te,L]=s.useState(0),[H,U]=s.useState("none");s.useEffect(()=>{!I&&!B&&U("none")},[I,B]);const[de,ae]=s.useState(null);s.useEffect(()=>{if(!v||typeof Image>"u"){ae(null);return}let be=!1;const Ie=new Image;return Ie.onload=()=>{be||ae({width:Ie.naturalWidth,height:Ie.naturalHeight})},Ie.src=v,()=>{be=!0}},[v]);const A=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),ce=s.useMemo(()=>dS(A),[A]),z=s.useMemo(()=>uS(A),[A]),re=w>0?((Je=(We=ce[0])==null?void 0:We.text)==null?void 0:Je.charAt(0))??"":"",ee=g.height>0?g.width/g.height:1,xe=(I==null?void 0:I.contours)??null,Fe=s.useMemo(()=>{if(xe){const qe=nl(xe);if(qe.length)return Fr(qe,r)}const be=i.trim(),Ie=be?Wc(be,o,r):null;return Ie&&Ie.length?Ie:ps(n==="custom"?"rectangle":n,ee)},[xe,n,i,o,r,Math.round(ee*100)/100]),ye=I==null?void 0:I.onConvert,b=(I==null?void 0:I.needsConversion)??!1,M=s.useMemo(()=>{const be=xe??(i.trim()?Vo(i):null);return!!(be&&xu(be,r))},[xe,i,r]),[E,j]=s.useState(null);Cr(()=>{if(!M){E&&j(null);return}!E&&g.width>0&&g.height>0&&j({width:g.width,height:g.height})},[M,g.width,g.height,E]);const Ce=s.useMemo(()=>{if(!M||g.width<=0||g.height<=0)return Fe;const be=E??g,Ie=r.width/be.width,qe=r.height/be.height;return Fe.map(ze=>ze.map(Le=>({x:Le.x*Ie,y:Le.y*qe})))},[Fe,M,E,r.width,r.height,g.width,g.height]),Q=s.useMemo(()=>{const be=V.trim(),Ie=be?Wc(be,o,r):null;return Ie&&Ie.length?Ie:ps(n==="custom"?"rectangle":n,ee)},[n,V,o,r,Math.round(ee*100)/100]),Te=s.useMemo(()=>{if(!M||g.width<=0||g.height<=0)return Q;const be=E??g,Ie=r.width/be.width,qe=r.height/be.height;return Q.map(ze=>ze.map(Le=>({x:Le.x*Ie,y:Le.y*qe})))},[Q,M,E,r.width,r.height,g.width,g.height]),ie=s.useRef(null);s.useEffect(()=>{if(!(!ye||g.width<=0||g.height<=0)){if(M){if(ie.current===i)return;const be=xe??(i.trim()?Vo(i):null);if(!(be!=null&&be.length))return;const Ie=ti(be,qe=>({x:r.x+(qe.x-r.x)/g.width*r.width,y:r.y+(qe.y-r.y)/g.height*r.height}));ie.current=Go(Ie),ye(Ie);return}!b||!Fe.length||ye(ti(yu(Fe),be=>({x:be.x*Yr,y:be.y*Yr})))}},[b,M,ye,Fe,xe,i,r,g.width,g.height]),Cr(()=>{const be=T;if(!be||typeof ResizeObserver>"u")return;const Ie=()=>{const ze=be.getBoundingClientRect();O(Le=>Math.abs(Le.width-ze.width)<.5&&Math.abs(Le.height-ze.height)<.5?Le:{width:ze.width,height:ze.height})};Ie();const qe=new ResizeObserver(Ie);return qe.observe(be),()=>qe.disconnect()},[T]),s.useEffect(()=>{const be=typeof document<"u"?document.fonts:void 0;be!=null&&be.ready&&be.ready.then(()=>{L(Ie=>Ie+1)})},[]),Cr(()=>{const be=F.current;if(!be)return;if(!ce.length){X(null);return}const Ie=[],qe=document.createDocumentFragment();for(const zt of ce){const ft=document.createElement("span");Object.assign(ft.style,Hc(zt.leaf)),ft.textContent=zt.text,qe.appendChild(ft),Ie.push(ft)}const ze=document.createElement("span");ze.textContent=" ",qe.appendChild(ze);const Le=document.createElement("span");Le.textContent=re||"H",Le.style.lineHeight="1",qe.appendChild(Le),be.replaceChildren(qe);const Ge=window.getComputedStyle(be),De=parseFloat(Ge.fontSize)||16,nt=parseFloat(Ge.lineHeight),it=Number.isNaN(nt)?De*1.2:nt;Le.style.fontSize=`${it*m}px`;const ct=Ie.map(zt=>zt.getBoundingClientRect().width),St=ze.getBoundingClientRect().width,Bt=re?Le.getBoundingClientRect().width:0;be.replaceChildren(),X({widths:ct,spaceWidth:St,lineHeight:it,capWidth:Bt})},[ce,f,re,w,m,te,g.width]);const ue=P&&re?P.capWidth+P.lineHeight*Tw:0,fe=Math.max(w,Math.ceil(m)),K=s.useMemo(()=>{if(!P||!ce.length||g.width<=0||g.height<=0||!u)return 1;const be=ze=>Dc({tokens:ce,widths:P.widths,spaceWidth:P.spaceWidth,lineHeight:P.lineHeight,width:g.width,height:g.height,rings:Ce,mode:l,align:d,scale:ze,allowOverflow:!1,capInset:ue*ze,capLines:re?fe:0});if(be(1).placed>=ce.length)return 1;if(be(Ya).placed<ce.length)return Ya;let Ie=Ya,qe=1;for(let ze=0;ze<Cw;ze+=1){const Le=(Ie+qe)/2;be(Le).placed>=ce.length?Ie=Le:qe=Le}return Ie},[P,ce,g.width,g.height,Ce,l,d,u,ue,re,fe]);s.useEffect(()=>{x(K)},[K,x]);const Z=u?Math.min(p,K):1,se=s.useMemo(()=>!P||!ce.length||g.width<=0||g.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0}:Dc({tokens:ce,widths:P.widths,spaceWidth:P.spaceWidth,lineHeight:P.lineHeight,width:g.width,height:g.height,rings:Ce,mode:l,align:d,scale:Z,allowOverflow:c,capInset:ue*Z,capLines:re?fe:0}),[P,ce,g.width,g.height,Ce,l,d,Z,c,ue,re,fe]),Se=P?P.lineHeight*Z:0,Me=d==="justify"?"left":d,$e=!!(I&&xe&&g.width>0&&g.height>0),G=!!B,pe=($e||G)&&g.width>0&&g.height>0,oe=$S(T,pe),Y=pe&&oe?TS():null,le=s.useRef(!1),_e=s.useCallback(be=>{le.current=be},[]);s.useEffect(()=>{if(!$e&&!G)return;const be=Ie=>{const qe=T;if(!qe)return;const ze=qe.getBoundingClientRect();Ie.clientX>=ze.left&&Ie.clientX<=ze.right&&Ie.clientY>=ze.top&&Ie.clientY<=ze.bottom&&(Ie.preventDefault(),Ie.stopPropagation(),U(Ge=>Ge==="shape"&&le.current?Ge:Ge==="shape"&&G?"image":$e?"shape":"image"))};return document.addEventListener("dblclick",be,!0),()=>document.removeEventListener("dblclick",be,!0)},[$e,G,T]);const me=s.useMemo(()=>v&&g.width>0&&g.height>0?Pw(Te,g):null,[v,Te,g.width,g.height]),J=N&&!q&&H!=="image",Ke=s.useRef(null);!N&&v&&me&&(Ke.current={rings:Te,bounds:me,focalX:C,focalY:y,scale:S,customPath:V});const ke=J?Ke.current:null,tt=s.useRef(null),Ye=(()=>{const be=tt.current;return N||q||!B||!de||!me||!be||V===be.customPath?null:vS(be.bounds,me,de,be.focalX,be.focalY,be.scale)})();Cr(()=>{if(N||!B||!de||!me)return;const be=tt.current,Ie=!!(be&&V!==be.customPath);Ie&&Ye&&B.onCommit(Ye),Ie&&q&&(W==null||W()),tt.current={rings:Te,bounds:me,focalX:(Ye==null?void 0:Ye.focalX)??C,focalY:(Ye==null?void 0:Ye.focalY)??y,scale:(Ye==null?void 0:Ye.scale)??S,customPath:V}},[N,q,V,Te,me,B,de,C,y,S,Ye,W]);const dt=(ke==null?void 0:ke.rings)??Te,ot=(ke==null?void 0:ke.bounds)??me,Ve=(ke==null?void 0:ke.focalX)??(Ye==null?void 0:Ye.focalX)??C,Re=(ke==null?void 0:ke.focalY)??(Ye==null?void 0:Ye.focalY)??y,He=(ke==null?void 0:ke.scale)??(Ye==null?void 0:Ye.scale)??S,Be=s.useMemo(()=>v&&g.width>0&&g.height>0?Lw(dt,g):"",[v,dt,g.width,g.height]),Ze=ot,he=`${$}-clip`,ve=s.useMemo(()=>{if(!Ze)return null;const be=de??{width:Ze.width,height:Ze.height},Ie=Si(Ze,be,He);return{x:Ln(Ze.width,Ie.width,Ve),y:Ln(Ze.height,Ie.height,Re),width:Ie.width,height:Ie.height}},[Ze,de,Ve,Re,He]);return a.jsxs("div",{className:`${e}-column`,ref:k,children:[v&&Be&&Ze&&ve?a.jsxs("svg",{className:`${e}-shape-image`,viewBox:`0 0 ${g.width} ${g.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("defs",{children:a.jsx("clipPath",{id:he,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:Be,fillRule:"evenodd"})})}),a.jsx("image",{href:v,x:Ze.x+ve.x,y:Ze.y+ve.y,width:ve.width,height:ve.height,preserveAspectRatio:"none",clipPath:`url(#${he})`})]}):null,a.jsxs("div",{className:`${e}-flow${c?"":` ${e}-clip`}`,style:{...f,["--"+e+"-fit"]:Z},children:[a.jsx("div",{className:`${e}-measure`,ref:F,style:f,"aria-hidden":!0}),se.segments.map((be,Ie)=>{const qe=ce.slice(be.from,be.to),ze=Ie===0;return a.jsx("div",{className:`${e}-line${be.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${be.top}px`,left:`${be.left}px`,width:`${be.width}px`,textAlign:be.justify?void 0:Me},children:qe.map((Le,Ge)=>{const nt=re&&ze&&be.from===0&&Ge===0?Le.text.slice(1):Le.text,it=Hc(Le.leaf),ct=Le.href?a.jsx("a",{className:`${e}-link`,href:Le.href,target:Le.target,style:it,children:nt}):a.jsx("span",{style:it,children:nt});return a.jsxs("span",{children:[!be.justify&&Ge>0?" ":null,ct]},Ge)})},`${be.from}-${be.to}-${Ie}`)}),h&&!xe&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:Ce.map((be,Ie)=>a.jsx("polygon",{points:be.map(qe=>`${qe.x},${qe.y}`).join(" ")},Ie))})]}),re&&P&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...f,top:`${se.capTop}px`,left:`${se.capLeft}px`,fontSize:`${Se*m}px`,lineHeight:`${Se*m}px`},children:re}),Y&&oe&&(xe&&I||B)&&zn.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:oe.top,left:oe.left,width:oe.width,height:oe.height,zIndex:Rw,pointerEvents:"none"},children:[xe&&I&&a.jsx(bS,{P:e,box:{width:oe.width,height:oe.height},viewBox:r,contours:xe,snap:I.snap,stretchToBox:!M,stage:H,onStageChange:U,onSelectionChange:_e,onChange:I.onChange,onCommit:I.onCommit}),B&&Ze&&a.jsx(wS,{P:e,box:{width:oe.width,height:oe.height},bounds:Ze,natural:de,imageUrl:v,maskPath:Be,stage:H,onStageChange:U,focalX:Ve,focalY:Re,scale:He,onChange:B.onChange,onCommit:B.onCommit})]}),Y),a.jsx("div",{className:`${e}-a11y`,children:z.map((be,Ie)=>a.jsx("p",{children:be},Ie))})]})}function RS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:d}=D.useScopedStyles(),c=s.useMemo(()=>pS(d),[d]),u=n??!1,p=!!r||!!o,x=s.useMemo(()=>Array.isArray(t)?t[0]??{}:{},[t]),w=(e==null?void 0:e.shape)??"rectangle",m=(e==null?void 0:e.customPath)??"",h=(e==null?void 0:e.pathFit)??"stretch",f=s.useMemo(()=>Ew(e==null?void 0:e.pathViewBox),[e==null?void 0:e.pathViewBox]),v=(e==null?void 0:e.shapeMode)==="B"?"avoid":"contain",C=(e==null?void 0:e.textAlign)??"left",y=((e==null?void 0:e.overflowMode)??"clip")==="visible",S=((e==null?void 0:e.fitText)??"off")==="on",V=((e==null?void 0:e.dropCap)??"off")==="on"?Math.max(2,Math.round((e==null?void 0:e.dropCapLines)??3)):0,N=(e==null?void 0:e.dropCapSize)??Iw,q=u&&p&&!i,[W,I]=s.useState(!1);s.useEffect(()=>{if(!u||!p){I(!1);return}const Z=()=>I(!0),se=()=>I(!1),Se=["ArticleEditor.Item:drag-start","ArticleEditor.Selection:resize-start","ArticleEditor.Selection:move-start"],Me=["ArticleEditor.Item:drag-end","ArticleEditor.Selection:resize-end","ArticleEditor.Selection:move-end"];for(const $e of Se)window.addEventListener($e,Z);for(const $e of Me)window.addEventListener($e,se);return()=>{for(const $e of Se)window.removeEventListener($e,Z);for(const $e of Me)window.removeEventListener($e,se)}},[u,p]);const B=u&&p&&!i&&typeof l=="function",$=!W,T=Math.max(0,(e==null?void 0:e.pathSnap)??0),k=s.useRef(e??{}),F=s.useRef(""),g=[e==null?void 0:e.customPath,e==null?void 0:e.shape,e==null?void 0:e.pathFit,e==null?void 0:e.pathViewBox,e==null?void 0:e.imageScale,e==null?void 0:e.imageFocalX,e==null?void 0:e.imageFocalY,e==null?void 0:e.image].join("\0");g!==F.current&&(F.current=g,k.current=e??{});const[O,P]=s.useState(null),[X,te]=s.useState(!1),[L,H]=s.useState(!1),U=s.useCallback(()=>H(!1),[]),de=s.useMemo(()=>!O||O.serialized===m?m:O.serialized,[O,m]);s.useEffect(()=>{B||(te(!1),H(!1))},[B]);const ae=s.useMemo(()=>{if(!B)return null;if(O&&(O.base===m||O.serialized===m))return O.contours;const Z=Vo(m);return Z.length?Z:null},[B,O,m]),A=h==="viewbox"&&((e==null?void 0:e.pathViewBox)??"")===Xr&&!!(ae&&!xu(ae,f)),ce=s.useCallback((Z,se,Se)=>{const Me=Go(Z);if(P($e=>({base:$e&&($e.base===m||$e.serialized===m)?$e.base:m,serialized:Me,contours:Z})),se){const $e=k.current,G=Se!=null&&Se.preserveShape?$e.shape:"custom",pe={...$e,shape:G,customPath:Me};k.current=pe,l==null||l(pe)}},[m,l]),z=s.useMemo(()=>B?{contours:A?ae:null,snap:T,needsConversion:!A,onConvert:Z=>{const se=Go(Z);P({base:se,serialized:se,contours:Z});const Se={...k.current,pathFit:"viewbox",pathViewBox:Xr,customPath:se};k.current=Se,l==null||l(Se)},onChange:(Z,se)=>{te(!0),H(!!(se!=null&&se.carryImage)),ce(Z,!1)},onCommit:(Z,se)=>{ce(Z,!0,se),te(!1)}}:null,[B,A,ae,T,l,ce]),re=v==="avoid"&&!!(e!=null&&e.image),ee=s.useMemo(()=>({focalX:(e==null?void 0:e.imageFocalX)??.5,focalY:(e==null?void 0:e.imageFocalY)??.5,scale:(e==null?void 0:e.imageScale)??1}),[e==null?void 0:e.imageFocalX,e==null?void 0:e.imageFocalY,e==null?void 0:e.imageScale]),[xe,Fe]=s.useState(null),ye=xe??ee,b=s.useCallback(Z=>Fe(Z),[]),M=s.useCallback(Z=>{Fe(Z);const se={...k.current,imageFocalX:Z.focalX,imageFocalY:Z.focalY,imageScale:Z.scale};k.current=se,l==null||l(se)},[l]);s.useEffect(()=>{xe&&Math.abs(xe.focalX-ee.focalX)<1e-9&&Math.abs(xe.focalY-ee.focalY)<1e-9&&Math.abs(xe.scale-ee.scale)<1e-9&&Fe(null)},[xe,ee]);const E=s.useMemo(()=>!B||!re?null:{onChange:b,onCommit:M},[B,re,b,M]),[j,Ce]=s.useState(void 0),Q=s.useRef(void 0),Te=s.useCallback(Z=>{const se=Q.current;se!==void 0&&Math.abs(se-Z)<.005||(Q.current=Z,Ce(Z))},[]),ie=s.useMemo(()=>S&&typeof j=="number"?j:1,[j,S]),ue=Z=>`calc(${Z} * var(--${d}-fit, 1))`,fe=s.useMemo(()=>{var Z,se,Se,Me,$e;return{fontFamily:po(e==null?void 0:e.textFontFamily),fontWeight:(Z=e==null?void 0:e.textFontSettings)==null?void 0:Z.fontWeight,fontStyle:(se=e==null?void 0:e.textFontSettings)==null?void 0:se.fontStyle,fontSize:ue(D.scalingValue((e==null?void 0:e.textFontSize)??.012,u)),lineHeight:ue(D.scalingValue((e==null?void 0:e.textLineHeight)??(e==null?void 0:e.textFontSize)??.012,u)),letterSpacing:ue(D.scalingValue((e==null?void 0:e.textLetterSpacing)??0,u)),wordSpacing:ue(D.scalingValue((e==null?void 0:e.textWordSpacing)??0,u)),textTransform:(Se=e==null?void 0:e.textTextAppearance)==null?void 0:Se.textTransform,textDecoration:(Me=e==null?void 0:e.textTextAppearance)==null?void 0:Me.textDecoration,fontVariant:($e=e==null?void 0:e.textTextAppearance)==null?void 0:$e.fontVariant}},[e,u,d]),K={[`--${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:{...K},children:a.jsx(IS,{P:d,item:x,shape:w,customPath:m,pathFit:h,viewBox:f,mode:v,align:C,allowOverflow:y,fitEnabled:S,scale:ie,onFitScale:Te,dropCapLines:V,dropCapSize:N,showGuides:(q||B)&&$,typography:fe,imageUrl:v==="avoid"?e==null?void 0:e.image:null,imageFocalX:ye.focalX,imageFocalY:ye.focalY,imageScale:ye.scale,imageCustomPath:de,pathDragActive:X,pathCarryImage:L,onCarryImageConsumed:U,pathEditor:$?z:null,imageEditor:$?E:null})})]})}const LS=`import { useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from 'react';
23832
+ `}const So=7,gS=3.5,Co=9,Qn=8,ei=14,Oc=10,hS=24,Tr=14,fS=4,yS=1,xS=.05,qr=1.08;function Ur(e,t){switch(t){case"nw":return{x:e.minX,y:e.minY};case"ne":return{x:e.maxX,y:e.minY};case"se":return{x:e.maxX,y:e.maxY};case"sw":return{x:e.minX,y:e.maxY}}}function Su(e){switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}}function xs(e,t){const n=Ur(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*Oc,y:n.y+o*Oc}}const vs=.1,bs=8,vS=4;function ws(e,t){return!(t.width>0)||!(t.height>0)||!(e.width>0)||!(e.height>0)?1:Math.max(e.width/t.width,e.height/t.height)}function Si(e,t,n){const i=ws(e,t)*n;return{width:t.width*i,height:t.height*i}}function Ln(e,t,n){return(e-t)*n}function Vi(e,t,n){const i=e-t;return Math.abs(i)<vS?.5:Gr(n/i)}function Bc(e,t,n,i,o,r){const l=Si(e,n,r),d=e.x+Ln(e.width,l.width,i),c=e.y+Ln(e.height,l.height,o),u=ws(e,n),p=ws(t,n),x=Math.min(bs,Math.max(vs,p>0?r*(u/p):r)),w=Si(t,n,x);return{focalX:Vi(t.width,w.width,d-t.x),focalY:Vi(t.height,w.height,c-t.y),scale:x}}function bS({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,stage:l,onStageChange:d,onSelectionChange:c,onChange:u,onCommit:p}){const x=s.useRef(null),w=s.useRef(null),m=s.useRef(i);m.current=i;const h=s.useRef(null),f=s.useRef(null),v=s.useRef(null),C=s.useRef(null),[y,S]=s.useState([]),[G,W]=s.useState(ji),U=s.useCallback(b=>{W(M=>Qw(M,b)?M:b)},[]),H=l==="shape";s.useEffect(()=>{var b;H&&((b=x.current)==null||b.focus({preventScroll:!0}))},[H]),s.useEffect(()=>{H||S(b=>b.length?[]:b)},[H]);const I=y.length>0;s.useEffect(()=>{c==null||c(I)},[I,c]),s.useEffect(()=>()=>c==null?void 0:c(!1),[c]);const z=n.width>0?t.width/n.width:1,$=n.height>0?t.height/n.height:1,T=s.useCallback(b=>r?{x:(b.x-n.x)*z,y:(b.y-n.y)*$}:{x:b.x-n.x,y:b.y-n.y},[r,n,z,$]),A=s.useCallback(b=>r?{x:n.x+(z>0?b.x/z:0),y:n.y+($>0?b.y/$:0)}:{x:n.x+b.x,y:n.y+b.y},[r,n,z,$]),_=s.useMemo(()=>A({x:t.width/2,y:t.height/2}),[A,t.width,t.height]),g=s.useCallback((b,M)=>{var V;const E=(V=x.current)==null?void 0:V.getBoundingClientRect();return!E||E.width<=0||E.height<=0?{x:0,y:0}:r?{x:n.x+(b-E.left)/E.width*n.width,y:n.y+(M-E.top)/E.height*n.height}:{x:n.x+(b-E.left),y:n.y+(M-E.top)}},[r,n]),B=s.useCallback((b,M)=>{var V;const E=(V=x.current)==null?void 0:V.getBoundingClientRect();return!E||E.width<=0||E.height<=0?{x:0,y:0}:{x:(b-E.left)/E.width*t.width,y:(M-E.top)/E.height*t.height}},[t.width,t.height]),P=s.useCallback((b,M)=>{p(b,M)},[p]),Y=b=>{var Ce;const M=b.metaKey||b.ctrlKey,E=v.current;if(E&&b.pointerId===E.pointerId){if(b.stopPropagation(),b.preventDefault(),E.startDistance<=0)return;const X=g(b.clientX,b.clientY),me=Math.hypot(X.x-E.origin.x,X.y-E.origin.y),ae=Math.max(xS,me/E.startDistance);if(!E.moved&&Math.abs(ae-1)<1e-4)return;E.moved=!0,u(Pc(E.startContours,E.origin,ae));return}const V=f.current;if(V&&b.pointerId===V.pointerId){b.stopPropagation(),b.preventDefault();const X=g(b.clientX,b.clientY),{bbox:me}=V,ae=me.maxX-me.minX,q=me.maxY-me.minY,de=X.x-V.origin.x,ke=X.y-V.origin.y;let he=de,J=ke;if(isFinite(ae)&&isFinite(q))if(r){const Fe=Math.min(n.x,n.x+n.width-ae),et=Math.max(n.x,n.x+n.width-ae),Je=Math.min(n.y,n.y+n.height-q),dt=Math.max(n.y,n.y+n.height-q),tt=Math.min(et,Math.max(Fe,me.minX+de)),De=Math.min(dt,Math.max(Je,me.minY+ke));he=tt-me.minX,J=De-me.minY}else{const Fe=me.minX-n.x,et=me.minY-n.y,Je=Math.min(0,t.width-ae),dt=Math.max(0,t.width-ae),tt=Math.min(0,t.height-q),De=Math.max(0,t.height-q),Ie=Math.min(dt,Math.max(Je,Fe+de)),We=Math.min(De,Math.max(tt,et+ke));he=Ie-Fe,J=We-et}const Ne=[];if(!M&&isFinite(ae)&&isFinite(q)){const Fe=T({x:me.minX+ae/2+he,y:me.minY+q/2+J}),et={x:t.width/2,y:t.height/2};Math.abs(Fe.x-et.x)<=Tr&&(he=_.x-me.minX-ae/2,Ne.push(ys(et.x,"x",t))),Math.abs(Fe.y-et.y)<=Tr&&(J=_.y-me.minY-q/2,Ne.push(ys(et.y,"y",t)))}if(!V.moved&&he===0&&J===0)return;V.moved=!0,U(Ne.length?Ne:ji),u(ti(V.startContours,Fe=>({x:Fe.x+he,y:Fe.y+J})),{carryImage:!0});return}const Se=C.current;if(Se&&b.pointerId===Se.pointerId){b.stopPropagation(),b.preventDefault();const X=g(b.clientX,b.clientY);let me=X.x-Se.origin.x,ae=X.y-Se.origin.y;if(b.shiftKey&&(Math.abs(me)>Math.abs(ae)?ae=0:me=0),!Se.moved&&me===0&&ae===0)return;Se.moved=!0,u(Mc(Se.startContours,Se.selection,me,ae));return}const te=h.current;if(!te||b.pointerId!==te.pointerId)return;b.stopPropagation(),b.preventDefault();const $e=g(b.clientX,b.clientY);if(te.kind==="anchor"){const X={x:te.anchor.x+($e.x-te.origin.x),y:te.anchor.y+($e.y-te.origin.y)},me=M?[]:Uw(m.current,{contour:te.contour,node:te.node}),ae=M||!te.center?[]:[te.center],q=Fc(Ac(me,ae.map(he=>he.x),"x"),X,"x",T,Tr),de=Fc(Ac(me,ae.map(he=>he.y),"y"),X,"y",T,Tr),ke=M?X:{x:(q==null?void 0:q.value)??$r(X.x,o),y:(de==null?void 0:de.value)??$r(X.y,o)};if(b.shiftKey&&(Math.abs(ke.x-te.anchor.x)>Math.abs(ke.y-te.anchor.y)?ke.y=te.anchor.y:ke.x=te.anchor.x),!te.moved&&ke.x===te.anchor.x&&ke.y===te.anchor.y)return;te.moved=!0,U(nS(ke,q,de,t,T)),u(zw(m.current,te.contour,te.node,ke));return}const re=(Ce=m.current[te.contour])==null?void 0:Ce.nodes[te.node],ge=te.mirror&&!b.altKey,ye=ge||M?null:te.kind==="in"?re==null?void 0:re.out:re==null?void 0:re.in,Z=re?T(re.p):null,Q=ye?T(ye):null,ce=re&&(!M||b.shiftKey)?oS($e,re.p,ge||M?null:iS(m.current[te.contour],te.node,te.kind,T),Z&&Q?Math.hypot(Q.x-Z.x,Q.y-Z.y):null,b.shiftKey,T,A):{point:$e,guides:ji},we=ce.guides.length?ce.point:M?$e:{x:$r($e.x,o),y:$r($e.y,o)},Pe=te.kind==="in"?re==null?void 0:re.in:re==null?void 0:re.out;!te.moved&&Pe&&we.x===Pe.x&&we.y===Pe.y||(te.moved=!0,U(ce.guides),u(Vw(m.current,te.contour,te.node,te.kind,we,ge)))},ie=b=>{U(ji);const M=v.current;if(M&&b.pointerId===M.pointerId){v.current=null,b.stopPropagation();const ye=x.current;ye!=null&&ye.hasPointerCapture(M.pointerId)&&ye.releasePointerCapture(M.pointerId),M.moved&&P(m.current,{preserveShape:!0});return}const E=f.current;if(E&&b.pointerId===E.pointerId){f.current=null,b.stopPropagation();const ye=x.current;ye!=null&&ye.hasPointerCapture(E.pointerId)&&ye.releasePointerCapture(E.pointerId),E.moved?P(m.current,{preserveShape:!0}):S([]);return}const V=C.current;if(V&&b.pointerId===V.pointerId){C.current=null,b.stopPropagation();const ye=x.current;ye!=null&&ye.hasPointerCapture(V.pointerId)&&ye.releasePointerCapture(V.pointerId),V.moved&&P(m.current);return}const Se=h.current;if(!Se||b.pointerId!==Se.pointerId)return;h.current=null,b.stopPropagation();const te=x.current;te!=null&&te.hasPointerCapture(Se.pointerId)&&te.releasePointerCapture(Se.pointerId);const $e=Math.hypot(b.clientX-Se.clientOrigin.x,b.clientY-Se.clientOrigin.y);if(Se.moved||$e>fS){Se.moved&&P(m.current);return}if(!Se.toggleOnRelease||b.type!=="pointerup")return;const ge=kc(m.current,Se.contour,Se.node);ge!==m.current&&(u(ge),P(ge))},L=b=>{b.stopPropagation()},O=b=>{var M,E;b.stopPropagation(),b.preventDefault(),(M=x.current)==null||M.focus({preventScroll:!0}),f.current={pointerId:b.pointerId,origin:g(b.clientX,b.clientY),startContours:Pn(i),bbox:Jn(i),moved:!1},(E=x.current)==null||E.setPointerCapture(b.pointerId)},K=(b,M)=>{var $e,re;b.stopPropagation(),b.preventDefault(),($e=x.current)==null||$e.focus({preventScroll:!0}),S([]),d("shape");const E=Jn(i),V=Ur(E,Su(M)),Se=xs(E,M),te=Math.hypot(Se.x-V.x,Se.y-V.y);!isFinite(te)||te<=0||(v.current={pointerId:b.pointerId,corner:M,origin:V,startDistance:te,startContours:Pn(i),moved:!1},(re=x.current)==null||re.setPointerCapture(b.pointerId))},ue=(b,M,E,V)=>{var $e,re,ge,ye;b.stopPropagation(),b.preventDefault(),($e=x.current)==null||$e.focus({preventScroll:!0});const Se=(re=i[E])==null?void 0:re.nodes[V];if(!Se)return;if(b.altKey){const Z=M==="anchor"?bu(i,E,V):Gw(i,E,V,M);if(Z===i)return;S(M==="anchor"?[]:[{contour:E,node:V}]),u(Z),P(Z);return}const te=b.metaKey||b.ctrlKey;if(M==="anchor"&&b.shiftKey&&!te){S(Z=>Z.some(Q=>Q.contour===E&&Q.node===V)?Z.filter(Q=>!(Q.contour===E&&Q.node===V)):[...Z,{contour:E,node:V}]);return}if(M==="anchor"&&!te&&y.length>1&&y.some(Z=>Z.contour===E&&Z.node===V)){C.current={pointerId:b.pointerId,origin:g(b.clientX,b.clientY),startContours:Pn(i),selection:y,moved:!1},(ge=x.current)==null||ge.setPointerCapture(b.pointerId);return}S([{contour:E,node:V}]),h.current={kind:M,contour:E,node:V,pointerId:b.pointerId,origin:g(b.clientX,b.clientY),clientOrigin:{x:b.clientX,y:b.clientY},anchor:Se.p,center:Hw(i),mirror:M!=="anchor"&&!!(Se.in&&Se.out),toggleOnRelease:te,moved:!1},(ye=x.current)==null||ye.setPointerCapture(b.pointerId)},le=b=>{b.stopPropagation(),b.preventDefault();const M=ti(i,T),E=qw(M,B(b.clientX,b.clientY));if(!E||E.distance>hS)return;const{contours:V,nodeIndex:Se}=Xw(i,E.contour,E.segment,E.t);Se<0||(S([{contour:E.contour,node:Se}]),u(V),P(V))},F=b=>{if(b.key==="="||b.key==="+"||b.key==="-"||b.key==="_"){b.preventDefault(),b.stopPropagation();const te=Jn(i);if(!isFinite(te.minX)||!isFinite(te.maxX))return;const $e={x:(te.minX+te.maxX)/2,y:(te.minY+te.maxY)/2},ge=b.key==="="||b.key==="+"?qr:1/qr,ye=Pc(i,$e,ge);u(ye),P(ye,{preserveShape:!0});return}if(b.key==="Escape"){b.stopPropagation(),S([]),d("none");return}if(!y.length)return;if(b.key==="Backspace"||b.key==="Delete"){b.preventDefault(),b.stopPropagation();const te=jw(i,y);if(te===i)return;S([]),u(te),P(te);return}const M=o>0?o:yS,E=b.shiftKey?M*10:M,V={ArrowLeft:[-E,0],ArrowRight:[E,0],ArrowUp:[0,-E],ArrowDown:[0,E]}[b.key];if(!V)return;b.preventDefault(),b.stopPropagation();const Se=Mc(i,y,V[0],V[1]);u(Se),P(Se)},pe=s.useMemo(()=>Go(ti(i,T)),[i,T]),j=s.useMemo(()=>Jn(i),[i]),se=T({x:j.minX,y:j.minY}),ne={width:T({x:j.maxX,y:j.minY}).x-se.x,height:T({x:j.minX,y:j.maxY}).y-se.y},ve=H&&y.length===0&&isFinite(j.minX)&&isFinite(j.maxX)&&j.maxX>j.minX&&j.maxY>j.minY,Me=y.length>0||H,xe=Me;return a.jsxs("svg",{ref:x,className:`${e}-editor${Me?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:F,onPointerDown:()=>{var b;return(b=x.current)==null?void 0:b.focus({preventScroll:!0})},onPointerMove:Y,onPointerUp:ie,onPointerCancel:ie,onLostPointerCapture:ie,onContextMenu:b=>{b.preventDefault()},"data-pretext-path-editor":!0,"data-selection":"none",children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>{S([]),d("none")},onClick:le}),xe&&a.jsx("path",{className:`${e}-editor-hit`,d:pe,onClick:le}),xe&&a.jsx("path",{className:`${e}-editor-outline`,d:pe}),xe&&G.map((b,M)=>a.jsx("line",{className:`${e}-editor-snap ${e}-editor-snap-${b.kind}`,x1:b.a.x,y1:b.a.y,x2:b.b.x,y2:b.b.y},`${b.kind}-${M}`)),a.jsx("path",{ref:w,className:`${e}-editor-body`,d:pe,fillRule:"evenodd",onPointerDown:O,onClick:le}),xe&&i.map((b,M)=>b.nodes.map((E,V)=>{const Se=y.some($e=>$e.contour===M&&$e.node===V),te=T(E.p);return a.jsxs("g",{children:[Se&&y.length===1&&["in","out"].map($e=>{const re=E[$e];if(!re)return null;const ge=T(re);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:te.x,y1:te.y,x2:ge.x,y2:ge.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:ge.x,cy:ge.y,r:gS}),a.jsx("circle",{className:`${e}-editor-grab`,cx:ge.x,cy:ge.y,r:Co,onPointerDown:ye=>ue(ye,$e,M,V),onClick:L})]},$e)}),a.jsx("rect",{className:`${e}-editor-anchor${Se?` ${e}-editor-anchor-selected`:""}`,x:te.x-So/2,y:te.y-So/2,width:So,height:So,rx:E.in||E.out?So/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:te.x-Co,y:te.y-Co,width:Co*2,height:Co*2,onPointerDown:$e=>ue($e,"anchor",M,V),onClick:L,onDoubleClick:$e=>{$e.stopPropagation(),$e.preventDefault();const re=kc(i,M,V);u(re),P(re)}})]},`${M}-${V}`)})),ve&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:se.x,y:se.y,width:ne.width,height:ne.height}),["nw","ne","se","sw"].map(b=>{const M=T(xs(j,b)),E=b==="ne"||b==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:M.x-Qn/2,y:M.y-Qn/2,width:Qn,height:Qn}),a.jsx("rect",{className:`${e}-editor-scale-grab${E?` ${e}-editor-scale-grab-nesw`:""}`,x:M.x-ei/2,y:M.y-ei/2,width:ei,height:ei,onPointerDown:V=>K(V,b),onClick:L})]},b)})]})]})}function wS({P:e,box:t,bounds:n,natural:i,imageUrl:o,maskPath:r,stage:l,onStageChange:d,focalX:c,focalY:u,scale:p,onChange:x,onCommit:w}){const m=s.useRef(null),h=`pretext-image-ghost-${s.useId().replace(/:/g,"")}`,f=s.useRef(null),v=s.useRef(null),C=s.useRef({focalX:c,focalY:u,scale:p});C.current={focalX:c,focalY:u,scale:p};const y=l==="image";s.useEffect(()=>{var _;y&&((_=m.current)==null||_.focus({preventScroll:!0}))},[y]);const S=s.useCallback((_,g)=>{var P;const B=(P=m.current)==null?void 0:P.getBoundingClientRect();return!B||B.width<=0||B.height<=0?{x:0,y:0}:{x:(_-B.left)/B.width*t.width,y:(g-B.top)/B.height*t.height}},[t.width,t.height]),G=_=>{var B,P;if(!i)return;_.stopPropagation(),_.preventDefault(),(B=m.current)==null||B.focus({preventScroll:!0});const g=Si(n,i,p);f.current={pointerId:_.pointerId,origin:S(_.clientX,_.clientY),startX:Ln(n.width,g.width,c),startY:Ln(n.height,g.height,u),width:g.width,height:g.height,moved:!1},(P=m.current)==null||P.setPointerCapture(_.pointerId)},W=(_,g)=>{var ue,le;if(!i)return;_.stopPropagation(),_.preventDefault(),(ue=m.current)==null||ue.focus({preventScroll:!0});const B=Si(n,i,p),P=Ln(n.width,B.width,c),Y=Ln(n.height,B.height,u),ie={minX:P,minY:Y,maxX:P+B.width,maxY:Y+B.height},L=Ur(ie,Su(g)),O=Ur(ie,g),K=Math.hypot(O.x-L.x,O.y-L.y);!isFinite(K)||K<=0||(v.current={pointerId:_.pointerId,anchor:L,startDistance:K,startScale:p,startX:P,startY:Y,moved:!1},(le=m.current)==null||le.setPointerCapture(_.pointerId))},U=_=>{if(!i)return;const g=v.current;if(g&&_.pointerId===g.pointerId){_.stopPropagation(),_.preventDefault();const P=S(_.clientX,_.clientY),Y={x:P.x-n.x,y:P.y-n.y},ie=Math.hypot(Y.x-g.anchor.x,Y.y-g.anchor.y),L=Math.min(bs,Math.max(vs,g.startScale*(ie/g.startDistance)));if(!g.moved&&Math.abs(L-g.startScale)<1e-4)return;g.moved=!0;const O=L/g.startScale,K=g.anchor.x+(g.startX-g.anchor.x)*O,ue=g.anchor.y+(g.startY-g.anchor.y)*O,le=Si(n,i,L);x({focalX:Vi(n.width,le.width,K),focalY:Vi(n.height,le.height,ue),scale:L});return}const B=f.current;if(B&&_.pointerId===B.pointerId){_.stopPropagation(),_.preventDefault();const P=S(_.clientX,_.clientY),Y=P.x-B.origin.x,ie=P.y-B.origin.y;if(!B.moved&&Y===0&&ie===0)return;B.moved=!0,x({focalX:Vi(n.width,B.width,B.startX+Y),focalY:Vi(n.height,B.height,B.startY+ie),scale:p})}},H=_=>{var P,Y;const g=f.current;if(g&&_.pointerId===g.pointerId){f.current=null,_.stopPropagation(),(P=m.current)!=null&&P.hasPointerCapture(g.pointerId)&&m.current.releasePointerCapture(g.pointerId),g.moved&&w(C.current);return}const B=v.current;B&&_.pointerId===B.pointerId&&(v.current=null,_.stopPropagation(),(Y=m.current)!=null&&Y.hasPointerCapture(B.pointerId)&&m.current.releasePointerCapture(B.pointerId),B.moved&&w(C.current))},I=_=>{if(_.key==="Escape"){_.stopPropagation(),d("none");return}if(_.key==="="||_.key==="+"||_.key==="-"||_.key==="_"){_.preventDefault(),_.stopPropagation();const g=_.key==="="||_.key==="+",B=Math.min(bs,Math.max(vs,p*(g?qr:1/qr))),P={focalX:c,focalY:u,scale:B};x(P),w(P)}},z=["nw","ne","se","sw"],$={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},T=s.useMemo(()=>{const _=i??{width:n.width,height:n.height},g=Si(n,_,p);return!(g.width>0)||!(g.height>0)?null:{x:n.x+Ln(n.width,g.width,c),y:n.y+Ln(n.height,g.height,u),width:g.width,height:g.height}},[i,n.x,n.y,n.width,n.height,c,u,p]),A=T?{minX:T.x,minY:T.y,maxX:T.x+T.width,maxY:T.y+T.height}:$;return a.jsxs("svg",{ref:m,className:`${e}-editor${y?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:I,onPointerMove:U,onPointerUp:H,onPointerCancel:H,onLostPointerCapture:H,"data-pretext-image-editor":!0,children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>d("none")}),y&&o&&T&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:h,maskUnits:"userSpaceOnUse",x:T.x,y:T.y,width:T.width,height:T.height,children:[a.jsx("rect",{x:T.x,y:T.y,width:T.width,height:T.height,fill:"#FFFFFF"}),a.jsx("path",{d:r,fillRule:"evenodd",fill:"#000000"})]})}),a.jsx("image",{className:`${e}-editor-ghost`,href:o??void 0,x:T.x,y:T.y,width:T.width,height:T.height,preserveAspectRatio:"none",mask:`url(#${h})`}),a.jsx("rect",{className:`${e}-editor-image-bounds`,x:T.x,y:T.y,width:T.width,height:T.height})]}),y&&a.jsxs(a.Fragment,{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:n.x,y:n.y,width:n.width,height:n.height}),a.jsx("rect",{className:`${e}-editor-body`,x:n.x,y:n.y,width:n.width,height:n.height,onPointerDown:G}),z.map(_=>{const g=xs(A,_),B=_==="ne"||_==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:g.x-Qn/2,y:g.y-Qn/2,width:Qn,height:Qn}),a.jsx("rect",{className:`${e}-editor-scale-grab${B?` ${e}-editor-scale-grab-nesw`:""}`,x:g.x-ei/2,y:g.y-ei/2,width:ei,height:ei,onPointerDown:P=>W(P,_)})]},_)})]})]})}function SS(e){const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}}function CS(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 $S(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=SS(e);(!r||!CS(r,d))&&(r=d,i(d)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n}function TS(){return typeof document>"u"?null:document.body}function IS({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:d,allowOverflow:c,fitEnabled:u,scale:p,onFitScale:x,dropCapLines:w,dropCapSize:m,showGuides:h,typography:f,imageUrl:v,imageFocalX:C,imageFocalY:y,imageScale:S,imageCustomPath:G,pathDragActive:W,pathCarryImage:U,onCarryImageConsumed:H,pathEditor:I,imageEditor:z}){var je,Ue;const $=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[T,A]=s.useState(null),_=s.useRef(null),[g,B]=s.useState({width:0,height:0}),[P,Y]=s.useState(null),[ie,L]=s.useState(0),[O,K]=s.useState("none");s.useEffect(()=>{!I&&!z&&K("none")},[I,z]);const[ue,le]=s.useState(null);s.useEffect(()=>{if(!v||typeof Image>"u"){le(null);return}let k=!1;const ee=new Image;return ee.onload=()=>{k||le({width:ee.naturalWidth,height:ee.naturalHeight})},ee.src=v,()=>{k=!0}},[v]);const F=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),pe=s.useMemo(()=>uS(F),[F]),j=s.useMemo(()=>pS(F),[F]),se=w>0?((Ue=(je=pe[0])==null?void 0:je.text)==null?void 0:Ue.charAt(0))??"":"",ne=g.height>0?g.width/g.height:1,ve=(I==null?void 0:I.contours)??null,Me=s.useMemo(()=>{if(ve){const Te=nl(ve);if(Te.length)return Fr(Te,r)}const k=i.trim(),ee=k?Wc(k,o,r):null;return ee&&ee.length?ee:ps(n==="custom"?"rectangle":n,ne)},[ve,n,i,o,r,Math.round(ne*100)/100]),xe=I==null?void 0:I.onConvert,b=(I==null?void 0:I.needsConversion)??!1,M=s.useMemo(()=>{const k=ve??(i.trim()?Vo(i):null);return!!(k&&vu(k,r))},[ve,i,r]),[E,V]=s.useState(null);Cr(()=>{if(!M){E&&V(null);return}!E&&g.width>0&&g.height>0&&V({width:g.width,height:g.height})},[M,g.width,g.height,E]);const Se=s.useMemo(()=>{if(!M||g.width<=0||g.height<=0)return Me;const k=E??g,ee=r.width/k.width,Te=r.height/k.height;return Me.map(He=>He.map(Be=>({x:Be.x*ee,y:Be.y*Te})))},[Me,M,E,r.width,r.height,g.width,g.height]),te=s.useMemo(()=>{const k=G.trim(),ee=k?Wc(k,o,r):null;return ee&&ee.length?ee:ps(n==="custom"?"rectangle":n,ne)},[n,G,o,r,Math.round(ne*100)/100]),$e=s.useMemo(()=>{if(!M||g.width<=0||g.height<=0)return te;const k=E??g,ee=r.width/k.width,Te=r.height/k.height;return te.map(He=>He.map(Be=>({x:Be.x*ee,y:Be.y*Te})))},[te,M,E,r.width,r.height,g.width,g.height]),re=s.useRef(null);s.useEffect(()=>{if(!(!xe||g.width<=0||g.height<=0)){if(M){if(re.current===i)return;const k=ve??(i.trim()?Vo(i):null);if(!(k!=null&&k.length))return;const ee=ti(k,Te=>({x:r.x+(Te.x-r.x)/g.width*r.width,y:r.y+(Te.y-r.y)/g.height*r.height}));re.current=Go(ee),xe(ee);return}!b||!Me.length||xe(ti(xu(Me),k=>({x:k.x*Yr,y:k.y*Yr})))}},[b,M,xe,Me,ve,i,r,g.width,g.height]),Cr(()=>{const k=T;if(!k||typeof ResizeObserver>"u")return;const ee=()=>{const He=k.getBoundingClientRect();B(Be=>Math.abs(Be.width-He.width)<.5&&Math.abs(Be.height-He.height)<.5?Be:{width:He.width,height:He.height})};ee();const Te=new ResizeObserver(ee);return Te.observe(k),()=>Te.disconnect()},[T]),s.useEffect(()=>{const k=typeof document<"u"?document.fonts:void 0;k!=null&&k.ready&&k.ready.then(()=>{L(ee=>ee+1)})},[]),Cr(()=>{const k=_.current;if(!k)return;if(!pe.length){Y(null);return}const ee=[],Te=document.createDocumentFragment();for(const st of pe){const St=document.createElement("span");Object.assign(St.style,Hc(st.leaf)),St.textContent=st.text,Te.appendChild(St),ee.push(St)}const He=document.createElement("span");He.textContent=" ",Te.appendChild(He);const Be=document.createElement("span");Be.textContent=se||"H",Be.style.lineHeight="1",Te.appendChild(Be),k.replaceChildren(Te);const Ve=window.getComputedStyle(k),rt=parseFloat(Ve.fontSize)||16,Ze=parseFloat(Ve.lineHeight),_e=Number.isNaN(Ze)?rt*1.2:Ze,qe=Math.max(_e,rt);Be.style.fontSize=`${qe*m}px`;const Oe=ee.map(st=>st.getBoundingClientRect().width),nt=He.getBoundingClientRect().width,at=se?Be.getBoundingClientRect().width:0;k.replaceChildren(),Y({widths:Oe,spaceWidth:nt,lineHeight:qe,capWidth:at})},[pe,f,se,w,m,ie,g.width]);const ge=P&&se?P.capWidth+P.lineHeight*Iw:0,ye=Math.max(w,Math.ceil(m)),Z=s.useMemo(()=>{if(!P||!pe.length||g.width<=0||g.height<=0||!u)return 1;const k=He=>Dc({tokens:pe,widths:P.widths,spaceWidth:P.spaceWidth,lineHeight:P.lineHeight,width:g.width,height:g.height,rings:Se,mode:l,align:d,scale:He,allowOverflow:!1,capInset:ge*He,capLines:se?ye:0});if(k(1).placed>=pe.length)return 1;if(k(Ya).placed<pe.length)return Ya;let ee=Ya,Te=1;for(let He=0;He<$w;He+=1){const Be=(ee+Te)/2;k(Be).placed>=pe.length?ee=Be:Te=Be}return ee},[P,pe,g.width,g.height,Se,l,d,u,ge,se,ye]);s.useEffect(()=>{x(Z)},[Z,x]);const Q=u?Math.min(p,Z):1,ce=s.useMemo(()=>!P||!pe.length||g.width<=0||g.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0}:Dc({tokens:pe,widths:P.widths,spaceWidth:P.spaceWidth,lineHeight:P.lineHeight,width:g.width,height:g.height,rings:Se,mode:l,align:d,scale:Q,allowOverflow:c,capInset:ge*Q,capLines:se?ye:0}),[P,pe,g.width,g.height,Se,l,d,Q,c,ge,se,ye]),we=P?P.lineHeight*Q:0,Pe=d==="justify"?"left":d,Ce=!!(I&&ve&&g.width>0&&g.height>0),X=!!z,me=(Ce||X)&&g.width>0&&g.height>0,ae=$S(T,me),q=me&&ae?TS():null,de=s.useRef(!1),ke=s.useCallback(k=>{de.current=k},[]);s.useEffect(()=>{if(!Ce&&!X)return;const k=ee=>{const Te=T;if(!Te)return;const He=Te.getBoundingClientRect();ee.clientX>=He.left&&ee.clientX<=He.right&&ee.clientY>=He.top&&ee.clientY<=He.bottom&&(ee.preventDefault(),ee.stopPropagation(),K(Ve=>Ve==="shape"&&de.current?Ve:Ve==="shape"&&X?"image":Ce?"shape":"image"))};return document.addEventListener("dblclick",k,!0),()=>document.removeEventListener("dblclick",k,!0)},[Ce,X,T]);const he=s.useMemo(()=>v&&g.width>0&&g.height>0?Ew($e,g):null,[v,$e,g.width,g.height]),J=s.useRef(null),Ne=(()=>{const k=J.current;return W||U||!z||!ue||!he||!k||G===k.customPath?null:Bc(k.bounds,he,ue,k.focalX,k.focalY,k.scale)})();Cr(()=>{if(W||!z||!ue||!he)return;const k=J.current,ee=!!(k&&G!==k.customPath);ee&&Ne&&z.onCommit(Ne),ee&&U&&(H==null||H()),J.current={rings:$e,bounds:he,focalX:(Ne==null?void 0:Ne.focalX)??C,focalY:(Ne==null?void 0:Ne.focalY)??y,scale:(Ne==null?void 0:Ne.scale)??S,customPath:G}},[W,U,G,$e,he,z,ue,C,y,S,Ne,H]);const Fe=s.useMemo(()=>{if(!W||U||!ue||!he)return null;const k=J.current;return k?Bc(k.bounds,he,ue,k.focalX,k.focalY,k.scale):null},[W,U,ue,he,G,$e]),et=(Fe==null?void 0:Fe.focalX)??(Ne==null?void 0:Ne.focalX)??C,Je=(Fe==null?void 0:Fe.focalY)??(Ne==null?void 0:Ne.focalY)??y,dt=(Fe==null?void 0:Fe.scale)??(Ne==null?void 0:Ne.scale)??S,tt=s.useMemo(()=>v&&g.width>0&&g.height>0?Pw($e,g):"",[v,$e,g.width,g.height]),De=he,Ie=`${$}-clip`,We=s.useMemo(()=>{if(!De)return null;const k=ue??{width:De.width,height:De.height},ee=Si(De,k,dt);return{x:Ln(De.width,ee.width,et),y:Ln(De.height,ee.height,Je),width:ee.width,height:ee.height}},[De,ue,et,Je,dt]);return a.jsxs("div",{className:`${e}-column`,ref:A,children:[v&&tt&&De&&We?a.jsxs("svg",{className:`${e}-shape-image`,viewBox:`0 0 ${g.width} ${g.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("defs",{children:a.jsx("clipPath",{id:Ie,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:tt,fillRule:"evenodd"})})}),a.jsx("image",{href:v,x:De.x+We.x,y:De.y+We.y,width:We.width,height:We.height,preserveAspectRatio:"none",clipPath:`url(#${Ie})`})]}):null,a.jsxs("div",{className:`${e}-flow${c?"":` ${e}-clip`}`,style:{...f,["--"+e+"-fit"]:Q},children:[a.jsx("div",{className:`${e}-measure`,ref:_,style:f,"aria-hidden":!0}),ce.segments.map((k,ee)=>{const Te=pe.slice(k.from,k.to),He=ee===0;return a.jsx("div",{className:`${e}-line${k.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${k.top}px`,left:`${k.left}px`,width:`${k.width}px`,textAlign:k.justify?void 0:Pe},children:Te.map((Be,Ve)=>{const Ze=se&&He&&k.from===0&&Ve===0?Be.text.slice(1):Be.text,_e=Hc(Be.leaf),qe=Be.href?a.jsx("a",{className:`${e}-link`,href:Be.href,target:Be.target,style:_e,children:Ze}):a.jsx("span",{style:_e,children:Ze});return a.jsxs("span",{children:[!k.justify&&Ve>0?" ":null,qe]},Ve)})},`${k.from}-${k.to}-${ee}`)}),h&&!ve&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:Se.map((k,ee)=>a.jsx("polygon",{points:k.map(Te=>`${Te.x},${Te.y}`).join(" ")},ee))})]}),se&&P&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...f,top:`${ce.capTop}px`,left:`${ce.capLeft}px`,fontSize:`${we*m}px`,lineHeight:`${we*m}px`},children:se}),q&&ae&&(ve&&I||z)&&zn.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:ae.top,left:ae.left,width:ae.width,height:ae.height,zIndex:Lw,pointerEvents:"none"},children:[ve&&I&&a.jsx(bS,{P:e,box:{width:ae.width,height:ae.height},viewBox:r,contours:ve,snap:I.snap,stretchToBox:!M,stage:O,onStageChange:K,onSelectionChange:ke,onChange:I.onChange,onCommit:I.onCommit}),z&&De&&a.jsx(wS,{P:e,box:{width:ae.width,height:ae.height},bounds:De,natural:ue,imageUrl:v,maskPath:tt,stage:O,onStageChange:K,focalX:et,focalY:Je,scale:dt,onChange:z.onChange,onCommit:z.onCommit})]}),q),a.jsx("div",{className:`${e}-a11y`,children:j.map((k,ee)=>a.jsx("p",{children:k},ee))})]})}function RS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:d}=D.useScopedStyles(),c=s.useMemo(()=>mS(d),[d]),u=n??!1,p=!!r||!!o,x=s.useMemo(()=>Array.isArray(t)?t[0]??{}:{},[t]),w=(e==null?void 0:e.shape)??"rectangle",m=(e==null?void 0:e.customPath)??"",h=(e==null?void 0:e.pathFit)??"stretch",f=s.useMemo(()=>Mw(e==null?void 0:e.pathViewBox),[e==null?void 0:e.pathViewBox]),v=(e==null?void 0:e.shapeMode)==="B"?"avoid":"contain",C=(e==null?void 0:e.textAlign)??"left",y=((e==null?void 0:e.overflowMode)??"clip")==="visible",S=((e==null?void 0:e.fitText)??"off")==="on",G=((e==null?void 0:e.dropCap)??"off")==="on"?Math.max(2,Math.round((e==null?void 0:e.dropCapLines)??3)):0,W=(e==null?void 0:e.dropCapSize)??Rw,U=u&&p&&!i,[H,I]=s.useState(!1);s.useEffect(()=>{if(!u||!p){I(!1);return}const Q=()=>I(!0),ce=()=>I(!1),we=["ArticleEditor.Item:drag-start","ArticleEditor.Selection:resize-start","ArticleEditor.Selection:move-start"],Pe=["ArticleEditor.Item:drag-end","ArticleEditor.Selection:resize-end","ArticleEditor.Selection:move-end"];for(const Ce of we)window.addEventListener(Ce,Q);for(const Ce of Pe)window.addEventListener(Ce,ce);return()=>{for(const Ce of we)window.removeEventListener(Ce,Q);for(const Ce of Pe)window.removeEventListener(Ce,ce)}},[u,p]);const z=u&&p&&!i&&typeof l=="function",$=!H,T=Math.max(0,(e==null?void 0:e.pathSnap)??0),A=s.useRef(e??{}),_=s.useRef(""),g=[e==null?void 0:e.customPath,e==null?void 0:e.shape,e==null?void 0:e.pathFit,e==null?void 0:e.pathViewBox,e==null?void 0:e.imageScale,e==null?void 0:e.imageFocalX,e==null?void 0:e.imageFocalY,e==null?void 0:e.image].join("\0");g!==_.current&&(_.current=g,A.current=e??{});const[B,P]=s.useState(null),[Y,ie]=s.useState(!1),[L,O]=s.useState(!1),K=s.useCallback(()=>O(!1),[]),ue=s.useMemo(()=>!B||B.serialized===m?m:B.serialized,[B,m]);s.useEffect(()=>{z||(ie(!1),O(!1))},[z]);const le=s.useMemo(()=>{if(!z)return null;if(B&&(B.base===m||B.serialized===m))return B.contours;const Q=Vo(m);return Q.length?Q:null},[z,B,m]),F=h==="viewbox"&&((e==null?void 0:e.pathViewBox)??"")===Xr&&!!(le&&!vu(le,f)),pe=s.useCallback((Q,ce,we)=>{const Pe=Go(Q);if(P(Ce=>({base:Ce&&(Ce.base===m||Ce.serialized===m)?Ce.base:m,serialized:Pe,contours:Q})),ce){const Ce=A.current,X=we!=null&&we.preserveShape?Ce.shape:"custom",me={...Ce,shape:X,customPath:Pe};A.current=me,l==null||l(me)}},[m,l]),j=s.useMemo(()=>z?{contours:F?le:null,snap:T,needsConversion:!F,onConvert:Q=>{const ce=Go(Q);P({base:ce,serialized:ce,contours:Q});const we={...A.current,pathFit:"viewbox",pathViewBox:Xr,customPath:ce};A.current=we,l==null||l(we)},onChange:(Q,ce)=>{ie(!0),O(!!(ce!=null&&ce.carryImage)),pe(Q,!1)},onCommit:(Q,ce)=>{pe(Q,!0,ce),ie(!1)}}:null,[z,F,le,T,l,pe]),se=v==="avoid"&&!!(e!=null&&e.image),ne=s.useMemo(()=>({focalX:(e==null?void 0:e.imageFocalX)??.5,focalY:(e==null?void 0:e.imageFocalY)??.5,scale:(e==null?void 0:e.imageScale)??1}),[e==null?void 0:e.imageFocalX,e==null?void 0:e.imageFocalY,e==null?void 0:e.imageScale]),[ve,Me]=s.useState(null),xe=ve??ne,b=s.useCallback(Q=>Me(Q),[]),M=s.useCallback(Q=>{Me(Q);const ce={...A.current,imageFocalX:Q.focalX,imageFocalY:Q.focalY,imageScale:Q.scale};A.current=ce,l==null||l(ce)},[l]);s.useEffect(()=>{ve&&Math.abs(ve.focalX-ne.focalX)<1e-9&&Math.abs(ve.focalY-ne.focalY)<1e-9&&Math.abs(ve.scale-ne.scale)<1e-9&&Me(null)},[ve,ne]);const E=s.useMemo(()=>!z||!se?null:{onChange:b,onCommit:M},[z,se,b,M]),[V,Se]=s.useState(void 0),te=s.useRef(void 0),$e=s.useCallback(Q=>{const ce=te.current;ce!==void 0&&Math.abs(ce-Q)<.005||(te.current=Q,Se(Q))},[]),re=s.useMemo(()=>S&&typeof V=="number"?V:1,[V,S]),ge=Q=>`calc(${Q} * var(--${d}-fit, 1))`,ye=s.useMemo(()=>{var we,Pe,Ce,X,me;const Q=(e==null?void 0:e.textFontSize)??.012,ce=Math.max((e==null?void 0:e.textLineHeight)??Q,Q);return{fontFamily:po(e==null?void 0:e.textFontFamily),fontWeight:(we=e==null?void 0:e.textFontSettings)==null?void 0:we.fontWeight,fontStyle:(Pe=e==null?void 0:e.textFontSettings)==null?void 0:Pe.fontStyle,fontSize:ge(D.scalingValue(Q,u)),lineHeight:ge(D.scalingValue(ce,u)),letterSpacing:ge(D.scalingValue((e==null?void 0:e.textLetterSpacing)??0,u)),wordSpacing:ge(D.scalingValue((e==null?void 0:e.textWordSpacing)??0,u)),textTransform:(Ce=e==null?void 0:e.textTextAppearance)==null?void 0:Ce.textTransform,textDecoration:(X=e==null?void 0:e.textTextAppearance)==null?void 0:X.textDecoration,fontVariant:(me=e==null?void 0:e.textTextAppearance)==null?void 0:me.fontVariant}},[e,u,d]),Z={[`--${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:{...Z},children:a.jsx(IS,{P:d,item:x,shape:w,customPath:m,pathFit:h,viewBox:f,mode:v,align:C,allowOverflow:y,fitEnabled:S,scale:re,onFitScale:$e,dropCapLines:G,dropCapSize:W,showGuides:(U||z)&&$,typography:ye,imageUrl:v==="avoid"?e==null?void 0:e.image:null,imageFocalX:xe.focalX,imageFocalY:xe.focalY,imageScale:xe.scale,imageCustomPath:ue,pathDragActive:Y,pathCarryImage:L,onCarryImageConsumed:K,pathEditor:$?j:null,imageEditor:$?E:null})})]})}const LS=`import { useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from 'react';
23833
23833
  import type React from 'react';
23834
23834
  import { createPortal } from 'react-dom';
23835
23835
  import { CommonComponentProps } from '../props';
@@ -23854,10 +23854,10 @@ const DROP_CAP_SIZE_DEFAULT = 3;
23854
23854
  * box — no z-index set inside that box could ever reach past it.
23855
23855
  *
23856
23856
  * Keep this above the CMS article/editor stack (\`.editor\` is z-index 1,
23857
- * \`#component-portal\` is 2) and below host UI chrome (toolbar 4, ItemParams
23858
- * SnapBar container 5) so the orange outline never paints over panels.
23857
+ * \`#component-portal\` is 2) and below the layers list (3), toolbar (4), and
23858
+ * ItemParams SnapBar container (5) so the orange outline never paints over panels.
23859
23859
  */
23860
- const EDITOR_PORTAL_Z_INDEX = 3;
23860
+ const EDITOR_PORTAL_Z_INDEX = 2;
23861
23861
 
23862
23862
  export const SHAPE_IDS = [
23863
23863
  'rectangle',
@@ -27176,9 +27176,8 @@ function PretextColumn({
27176
27176
  return unitRings.map(ring => ring.map(point => ({ x: point.x * scaleX, y: point.y * scaleY })));
27177
27177
  }, [unitRings, exceedsEditViewBox, legacyRefBox, viewBox.width, viewBox.height, box.width, box.height]);
27178
27178
 
27179
- // The shape image reads from the *committed* path, not the in-progress drag
27180
- // draft — text reflows live as nodes are dragged, but the image mask should
27181
- // hold still until the edit is committed rather than warping every frame.
27179
+ // Image mask tracks \`imageCustomPath\`, which includes the local path draft
27180
+ // between commits so the clip updates live while handles are dragged.
27182
27181
  const committedUnitRings = useMemo(() => {
27183
27182
  const spec = imageCustomPath.trim();
27184
27183
  const parsed = spec ? parsePathSpec(spec, pathFit, viewBox) : null;
@@ -27284,7 +27283,9 @@ function PretextColumn({
27284
27283
  const computed = window.getComputedStyle(element);
27285
27284
  const fontSize = parseFloat(computed.fontSize) || 16;
27286
27285
  const parsedLineHeight = parseFloat(computed.lineHeight);
27287
- const lineHeight = Number.isNaN(parsedLineHeight) ? fontSize * 1.2 : parsedLineHeight;
27286
+ const rawLineHeight = Number.isNaN(parsedLineHeight) ? fontSize * 1.2 : parsedLineHeight;
27287
+ // Line boxes shorter than the glyphs overflow and get clipped by the flow container.
27288
+ const lineHeight = Math.max(rawLineHeight, fontSize);
27288
27289
 
27289
27290
  capSpan.style.fontSize = \`\${lineHeight * dropCapSize}px\`;
27290
27291
 
@@ -27408,25 +27409,6 @@ function PretextColumn({
27408
27409
  [imageUrl, imageRings, box.width, box.height],
27409
27410
  );
27410
27411
 
27411
- // Freeze the image mask only while a path handle is actively dragged. Between
27412
- // commits, \`imageCustomPath\` tracks the local draft so the clip updates without
27413
- // waiting on settings sync.
27414
- const freezeImageForPathEdit = pathDragActive && !pathCarryImage && editStage !== 'image';
27415
- const lastStableImageRef = useRef<FrozenShapeImage | null>(null);
27416
-
27417
- if (!pathDragActive && imageUrl && committedShapeImageBounds) {
27418
- lastStableImageRef.current = {
27419
- rings: imageRings,
27420
- bounds: committedShapeImageBounds,
27421
- focalX: imageFocalX,
27422
- focalY: imageFocalY,
27423
- scale: imageScale,
27424
- customPath: imageCustomPath,
27425
- };
27426
- }
27427
-
27428
- const dragFrozen = freezeImageForPathEdit ? lastStableImageRef.current : null;
27429
-
27430
27412
  const imagePathAnchorRef = useRef<FrozenShapeImage | null>(null);
27431
27413
  const pathPreservedTransform = (() => {
27432
27414
  const anchor = imagePathAnchorRef.current;
@@ -27488,17 +27470,38 @@ function PretextColumn({
27488
27470
  onCarryImageConsumed,
27489
27471
  ]);
27490
27472
 
27491
- const activeImageRings = dragFrozen?.rings ?? imageRings;
27492
- const activeImageBounds = dragFrozen?.bounds ?? committedShapeImageBounds;
27493
- const activeImageFocalX = dragFrozen?.focalX ?? pathPreservedTransform?.focalX ?? imageFocalX;
27494
- const activeImageFocalY = dragFrozen?.focalY ?? pathPreservedTransform?.focalY ?? imageFocalY;
27495
- const activeImageScale = dragFrozen?.scale ?? pathPreservedTransform?.scale ?? imageScale;
27473
+ // While a handle is dragged (not a whole-shape carry), keep the photo pinned in
27474
+ // column space as the live mask morphs around it.
27475
+ const pathDragLiveTransform = useMemo(() => {
27476
+ if (!pathDragActive || pathCarryImage || !naturalImageSize || !committedShapeImageBounds) return null;
27477
+ const anchor = imagePathAnchorRef.current;
27478
+ if (!anchor) return null;
27479
+ return preserveImageTransformAcrossBoundsChange(
27480
+ anchor.bounds,
27481
+ committedShapeImageBounds,
27482
+ naturalImageSize,
27483
+ anchor.focalX,
27484
+ anchor.focalY,
27485
+ anchor.scale,
27486
+ );
27487
+ }, [
27488
+ pathDragActive,
27489
+ pathCarryImage,
27490
+ naturalImageSize,
27491
+ committedShapeImageBounds,
27492
+ imageCustomPath,
27493
+ imageRings,
27494
+ ]);
27495
+
27496
+ const activeImageFocalX = pathDragLiveTransform?.focalX ?? pathPreservedTransform?.focalX ?? imageFocalX;
27497
+ const activeImageFocalY = pathDragLiveTransform?.focalY ?? pathPreservedTransform?.focalY ?? imageFocalY;
27498
+ const activeImageScale = pathDragLiveTransform?.scale ?? pathPreservedTransform?.scale ?? imageScale;
27496
27499
 
27497
27500
  const shapeImagePath = useMemo(
27498
- () => (imageUrl && box.width > 0 && box.height > 0 ? ringsToPathPx(activeImageRings, box) : ''),
27499
- [imageUrl, activeImageRings, box.width, box.height],
27501
+ () => (imageUrl && box.width > 0 && box.height > 0 ? ringsToPathPx(imageRings, box) : ''),
27502
+ [imageUrl, imageRings, box.width, box.height],
27500
27503
  );
27501
- const shapeImageBounds = activeImageBounds;
27504
+ const shapeImageBounds = committedShapeImageBounds;
27502
27505
  const clipId = \`\${imageId}-clip\`;
27503
27506
  // Before the natural size loads, fall back to filling the mask bbox exactly
27504
27507
  // (equivalent to the old xMidYMid-slice default) rather than a jump cut once it's known.
@@ -27861,18 +27864,22 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
27861
27864
 
27862
27865
  const fitVar = (value: string) => \`calc(\${value} * var(--\${P}-fit, 1))\`;
27863
27866
 
27864
- const typography = useMemo<React.CSSProperties>(() => ({
27867
+ const typography = useMemo<React.CSSProperties>(() => {
27868
+ const textFontSize = settings?.textFontSize ?? 0.012;
27869
+ const textLineHeight = Math.max(settings?.textLineHeight ?? textFontSize, textFontSize);
27870
+ return {
27865
27871
  fontFamily: normalizeFontFamilyCssValue(settings?.textFontFamily),
27866
27872
  fontWeight: settings?.textFontSettings?.fontWeight,
27867
27873
  fontStyle: settings?.textFontSettings?.fontStyle,
27868
- fontSize: fitVar(scalingValue(settings?.textFontSize ?? 0.012, editor)),
27869
- lineHeight: fitVar(scalingValue(settings?.textLineHeight ?? settings?.textFontSize ?? 0.012, editor)),
27874
+ fontSize: fitVar(scalingValue(textFontSize, editor)),
27875
+ lineHeight: fitVar(scalingValue(textLineHeight, editor)),
27870
27876
  letterSpacing: fitVar(scalingValue(settings?.textLetterSpacing ?? 0, editor)),
27871
27877
  wordSpacing: fitVar(scalingValue(settings?.textWordSpacing ?? 0, editor)),
27872
27878
  textTransform: settings?.textTextAppearance?.textTransform as React.CSSProperties['textTransform'],
27873
27879
  textDecoration: settings?.textTextAppearance?.textDecoration,
27874
27880
  fontVariant: settings?.textTextAppearance?.fontVariant,
27875
- }), [settings, editor, P]);
27881
+ };
27882
+ }, [settings, editor, P]);
27876
27883
 
27877
27884
  const colorVars = {
27878
27885
  [\`--\${P}-text-color\`]: settings?.textColor ?? '#000000',
@@ -27921,4 +27928,4 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
27921
27928
  </>
27922
27929
  );
27923
27930
  }
27924
- `,Bc=[...mu],PS={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},ES={type:"object",version:1,settings:{sizing:"manual",properties:{shape:{type:"string",scope:"layout",title:"Shape",display:{type:"drop-down",label:"Shape",enum:Bc},enum:Bc},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:"",tooltip:"A — text fills the path. B — text flows around the path.",display:{type:"radio-group"},enum:["A","B"]},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"}},dropCapSize:{type:"number",scope:"common",title:"Drop cap size",tooltip:"Height of the drop cap, in lines of body text.",min:1,max:8,step:.5,display:{type:"common-numeric-input"}},image:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-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:{...PS.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:"A",fitText:"off",dropCap:"off",dropCapLines:3,dropCapSize:3,image:null,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","fitText","dropCap","dropCapLines","dropCapSize","image"],displayRules:[{if:{name:"shapeMode",value:"B",isNotEqual:!0},then:{name:"properties.image.display.visible",value:!1}},{if:{name:"dropCap",value:"on",isNotEqual:!0},then:{name:"properties.dropCapSize.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["shapeMode"]},{type:"row",items:["shape"]},{type:"row",items:["image","dropCap"]},{type:"row",items:["dropCapSize"]}]},{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"}}}},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."}]}]}]}},MS={element:RS,id:"pretext",name:"Pretext",category:"typography",version:1,normalizeLayoutSettingsUpdate:(e,t)=>{const n=e.shape;return typeof n!="string"||n==="custom"||mu.indexOf(n)===-1?e:{...e,...Ow(n,1,t)}},defaultSize:{d:{width:380,height:382},t:{width:380,height:382},m:{width:334,height:336}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple-Marquee.mp4"},schema:ES,sourceCode:LS,assetsPaths:{content:[],parameters:[{path:"image",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily"}},kS=[Am,Om,_v,kg,Bg,Zg,fh,Bh,qh,tf,Rf,by,$x,Ax,hv,Iv,Yv,j0,o0,ab,Wb,ww,MS];exports.components=kS;exports.isSchemaV1=$u;
27931
+ `,zc=[...gu],PS={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},ES={type:"object",version:1,settings:{sizing:"manual",properties:{shape:{type:"string",scope:"layout",title:"Shape",display:{type:"drop-down",label:"Shape",enum:zc},enum:zc},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:"",tooltip:"A — text fills the path. B — text flows around the path.",display:{type:"radio-group"},enum:["A","B"]},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"}},dropCapSize:{type:"number",scope:"common",title:"Drop cap size",tooltip:"Height of the drop cap, in lines of body text.",min:1,max:8,step:.5,display:{type:"common-numeric-input"}},image:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-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:{...PS.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:"A",fitText:"off",dropCap:"off",dropCapLines:3,dropCapSize:3,image:null,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","fitText","dropCap","dropCapLines","dropCapSize","image"],displayRules:[{if:{name:"shapeMode",value:"B",isNotEqual:!0},then:{name:"properties.image.display.visible",value:!1}},{if:{name:"dropCap",value:"on",isNotEqual:!0},then:{name:"properties.dropCapSize.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["shapeMode"]},{type:"row",items:["shape"]},{type:"row",items:["image","dropCap"]},{type:"row",items:["dropCapSize"]}]},{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"}}}},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."}]}]}]}},MS={element:RS,id:"pretext",name:"Pretext",category:"typography",version:1,normalizeLayoutSettingsUpdate:(e,t)=>{const n=e.shape;return typeof n!="string"||n==="custom"||gu.indexOf(n)===-1?e:{...e,...Bw(n,1,t)}},defaultSize:{d:{width:380,height:382},t:{width:380,height:382},m:{width:334,height:336}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple-Marquee.mp4"},schema:ES,sourceCode:LS,assetsPaths:{content:[],parameters:[{path:"image",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily"}},kS=[Fm,Bm,Nv,Ag,zg,Jg,yh,zh,Uh,nf,Lf,wy,Tx,Fx,fv,Rv,qv,V0,r0,sb,Hb,Sw,MS];exports.components=kS;exports.isSchemaV1=Tu;