@cntrl-site/components 1.0.62 → 1.0.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=require("react"),rt=require("classnames"),S=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Yn=require("react-dom");function ld(e){return e.type==="object"&&e.version===1}const cd="ControlSlider-module__wrapper___sHEkd",dd="ControlSlider-module__hoverArrow___A-dOH",ud="ControlSlider-module__sliderItem___QQSkR",pd="ControlSlider-module__sliderImage___9hRl-",md="ControlSlider-module__arrow___05ghY",gd="ControlSlider-module__arrowVertical___tBfVN",hd="ControlSlider-module__nextArrow___-30Yc",fd="ControlSlider-module__arrowInner___aEra3",yd="ControlSlider-module__arrowIcon___S4ztF",vd="ControlSlider-module__arrowImg___2dwJW",bd="ControlSlider-module__mirror___brd6U",xd="ControlSlider-module__pagination___bicLF",wd="ControlSlider-module__paginationInner___bT-P-",Sd="ControlSlider-module__paginationVertical___zYqKw",$d="ControlSlider-module__paginationItem___nTRbk",Cd="ControlSlider-module__dot___p1Qun",Td="ControlSlider-module__activeDot___LHFaj",Ld="ControlSlider-module__paginationInsideBottom___R3FWn",Rd="ControlSlider-module__paginationInsideTop___V-qb-",Id="ControlSlider-module__paginationOutsideBottom___14w8D",Ed="ControlSlider-module__paginationOutsideTop___SCLqB",Md="ControlSlider-module__paginationInsideLeft___yOBRZ",Pd="ControlSlider-module__paginationInsideRight___Rtt3o",kd="ControlSlider-module__paginationOutsideLeft___lahaw",Ad="ControlSlider-module__paginationOutsideRight___EtuQa",Fd="ControlSlider-module__imgWrapper___UjEgB",Wd="ControlSlider-module__captionBlock___dJ6-j",_d="ControlSlider-module__captionTextWrapper___HFlpf",Hd="ControlSlider-module__captionText___uGBVc",Nd="ControlSlider-module__active___WZK4G",Od="ControlSlider-module__withPointerEvents___t-18M",Dd="ControlSlider-module__topLeftAlignment___zjnGM",jd="ControlSlider-module__topCenterAlignment___gD1xW",zd="ControlSlider-module__topRightAlignment___NMapS",Bd="ControlSlider-module__middleLeftAlignment___OnUrY",Vd="ControlSlider-module__middleCenterAlignment___Tdkl0",Gd="ControlSlider-module__middleRightAlignment___wEbfX",Ud="ControlSlider-module__bottomLeftAlignment___cTP2-",qd="ControlSlider-module__bottomCenterAlignment___c54fB",Kd="ControlSlider-module__bottomRightAlignment___kEwrz",Xd="ControlSlider-module__clickOverlay___DZA28",Yd="ControlSlider-module__contain___pLyq7",Zd="ControlSlider-module__cover___KdDat",it={wrapper:cd,hoverArrow:dd,sliderItem:ud,sliderImage:pd,arrow:md,arrowVertical:gd,nextArrow:hd,arrowInner:fd,arrowIcon:yd,arrowImg:vd,mirror:bd,pagination:xd,paginationInner:wd,paginationVertical:Sd,paginationItem:$d,dot:Cd,activeDot:Td,paginationInsideBottom:Ld,paginationInsideTop:Rd,paginationOutsideBottom:Id,paginationOutsideTop:Ed,paginationInsideLeft:Md,paginationInsideRight:Pd,paginationOutsideLeft:kd,paginationOutsideRight:Ad,imgWrapper:Fd,captionBlock:Wd,captionTextWrapper:_d,captionText:Hd,active:Nd,withPointerEvents:Od,topLeftAlignment:Dd,topCenterAlignment:jd,topRightAlignment:zd,middleLeftAlignment:Bd,middleCenterAlignment:Vd,middleRightAlignment:Gd,bottomLeftAlignment:Ud,bottomCenterAlignment:qd,bottomRightAlignment:Kd,clickOverlay:Xd,contain:Yd,cover:Zd};function Jd(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 Qd(e,t,n){return t&&Jd(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var us="(prefers-reduced-motion: reduce)",Mi=1,eu=2,Wi=3,Ki=4,To=5,tr=6,lr=7,tu={CREATED:Mi,MOUNTED:eu,IDLE:Wi,MOVING:Ki,SCROLLING:To,DRAGGING:tr,DESTROYED:lr};function Wn(e){e.length=0}function Zn(e,t,n){return Array.prototype.slice.call(e,t,n)}function Vt(e){return e.bind.apply(e,[null].concat(Zn(arguments,1)))}var Wl=setTimeout,ha=function(){};function ps(e){return requestAnimationFrame(e)}function vr(e,t){return typeof t===e}function mo(e){return!Pa(e)&&vr("object",e)}var Ma=Array.isArray,_l=Vt(vr,"function"),Un=Vt(vr,"string"),Lo=Vt(vr,"undefined");function Pa(e){return e===null}function Hl(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Ro(e){return Ma(e)?e:[e]}function yn(e,t){Ro(e).forEach(t)}function ka(e,t){return e.indexOf(t)>-1}function nr(e,t){return e.push.apply(e,Ro(t)),e}function Mn(e,t,n){e&&yn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Tn(e,t){Mn(e,Un(t)?t.split(" "):t,!0)}function Io(e,t){yn(t,e.appendChild.bind(e))}function Aa(e,t){yn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function go(e,t){return Hl(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Nl(e,t){var n=e?Zn(e.children):[];return t?n.filter(function(i){return go(i,t)}):n}function Eo(e,t){return t?Nl(e,t)[0]:e.firstElementChild}var ho=Object.keys;function mi(e,t,n){return e&&(n?ho(e).reverse():ho(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function fo(e){return Zn(arguments,1).forEach(function(t){mi(t,function(n,i){e[i]=t[i]})}),e}function zn(e){return Zn(arguments,1).forEach(function(t){mi(t,function(n,i){Ma(n)?e[i]=n.slice():mo(n)?e[i]=zn({},mo(e[i])?e[i]:{},n):e[i]=n})}),e}function ms(e,t){yn(t||ho(e),function(n){delete e[n]})}function Ln(e,t){yn(e,function(n){yn(t,function(i){n&&n.removeAttribute(i)})})}function St(e,t,n){mo(t)?mi(t,function(i,o){St(e,o,i)}):yn(e,function(i){Pa(n)||n===""?Ln(i,t):i.setAttribute(t,String(n))})}function Pi(e,t,n){var i=document.createElement(e);return t&&(Un(t)?Tn(i,t):St(i,t)),n&&Io(n,i),i}function bn(e,t,n){if(Lo(n))return getComputedStyle(e)[t];Pa(n)||(e.style[t]=""+n)}function yo(e,t){bn(e,"display",t)}function Ol(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function xn(e,t){return e.getAttribute(t)}function gs(e,t){return e&&e.classList.contains(t)}function mn(e){return e.getBoundingClientRect()}function hi(e){yn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Dl(e){return Eo(new DOMParser().parseFromString(e,"text/html").body)}function En(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function jl(e,t){return e&&e.querySelector(t)}function Fa(e,t){return t?Zn(e.querySelectorAll(t)):[]}function Pn(e,t){Mn(e,t,!1)}function fa(e){return e.timeStamp}function ii(e){return Un(e)?e:e?e+"px":""}var Mo="splide",Wa="data-"+Mo;function lo(e,t){if(!e)throw new Error("["+Mo+"] "+(t||""))}var qn=Math.min,cr=Math.max,dr=Math.floor,vo=Math.ceil,ln=Math.abs;function zl(e,t,n){return ln(e-t)<n}function ir(e,t,n,i){var o=qn(t,n),s=cr(t,n);return i?o<e&&e<s:o<=e&&e<=s}function Li(e,t,n){var i=qn(t,n),o=cr(t,n);return qn(cr(i,e),o)}function ya(e){return+(e>0)-+(e<0)}function va(e,t){return yn(t,function(n){e=e.replace("%s",""+n)}),e}function _a(e){return e<10?"0"+e:""+e}var hs={};function nu(e){return""+e+_a(hs[e]=(hs[e]||0)+1)}function Bl(){var e=[];function t(l,d,c,u){o(l,d,function(p,x,v){var f="addEventListener"in p,h=f?p.removeEventListener.bind(p,x,c,u):p.removeListener.bind(p,c);f?p.addEventListener(x,c,u):p.addListener(c),e.push([p,x,v,c,h])})}function n(l,d,c){o(l,d,function(u,p,x){e=e.filter(function(v){return v[0]===u&&v[1]===p&&v[2]===x&&(!c||v[3]===c)?(v[4](),!1):!0})})}function i(l,d,c){var u,p=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:p,detail:c}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,p,!1,c)),l.dispatchEvent(u),u}function o(l,d,c){yn(l,function(u){u&&yn(d,function(p){p.split(" ").forEach(function(x){var v=x.split(".");c(u,v[0],v[1])})})})}function s(){e.forEach(function(l){l[4]()}),Wn(e)}return{bind:t,unbind:n,dispatch:i,destroy:s}}var Jn="mounted",ba="ready",_n="move",Xi="moved",Ha="click",Vl="active",Gl="inactive",Ul="visible",ql="hidden",Qt="refresh",an="updated",_i="resize",br="resized",Kl="drag",Xl="dragging",Yl="dragged",xr="scroll",vi="scrolled",iu="overflow",Na="destroy",Zl="arrows:mounted",Jl="arrows:updated",Ql="pagination:mounted",ec="pagination:updated",Oa="navigation:mounted",Da="autoplay:play",tc="autoplay:playing",ja="autoplay:pause",za="lazyload:loaded",nc="sk",ic="sh",ur="ei";function Kt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Bl();function i(s,l){n.bind(t,Ro(s).join(" "),function(d){l.apply(l,Ma(d.detail)?d.detail:[])})}function o(s){n.dispatch(t,s,Zn(arguments,1))}return e&&e.event.on(Na,n.destroy),fo(n,{bus:t,on:i,off:Vt(n.unbind,t),emit:o})}function wr(e,t,n,i){var o=Date.now,s,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?qn((o()-s)/e,1):1,n&&n(l),l>=1&&(t(),s=o(),i&&++u>=i))return v();d=ps(p)}}function x(I){I||h(),s=o()-(I?l*e:0),c=!1,d=ps(p)}function v(){c=!0}function f(){s=o(),l=0,n&&n(l)}function h(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function m(I){e=I}function b(){return c}return{start:x,rewind:f,pause:v,cancel:h,set:m,isPaused:b}}function ou(e){var t=e;function n(o){t=o}function i(o){return ka(Ro(o),t)}return{set:n,is:i}}function ru(e,t){var n=wr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function au(e,t,n){var i=e.state,o=n.breakpoints||{},s=n.reducedMotion||{},l=Bl(),d=[];function c(){var h=n.mediaQuery==="min";ho(o).sort(function(m,b){return h?+m-+b:+b-+m}).forEach(function(m){p(o[m],"("+(h?"min":"max")+"-width:"+m+"px)")}),p(s,us),x()}function u(h){h&&l.destroy()}function p(h,m){var b=matchMedia(m);l.bind(b,"change",x),d.push([h,b])}function x(){var h=i.is(lr),m=n.direction,b=d.reduce(function(I,R){return zn(I,R[1].matches?R[0]:{})},{});ms(n),f(b),n.destroy?e.destroy(n.destroy==="completely"):h?(u(!0),e.mount()):m!==n.direction&&e.refresh()}function v(h){matchMedia(us).matches&&(h?zn(n,s):ms(n,ho(s)))}function f(h,m,b){zn(n,h),m&&zn(Object.getPrototypeOf(n),h),(b||!i.is(Mi))&&e.emit(an,n)}return{setup:c,destroy:u,reduce:v,set:f}}var Sr="Arrow",$r=Sr+"Left",Cr=Sr+"Right",oc=Sr+"Up",rc=Sr+"Down",fs="rtl",Tr="ttb",Or={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[oc,Cr],ArrowRight:[rc,$r]};function su(e,t,n){function i(s,l,d){d=d||n.direction;var c=d===fs&&!l?1:d===Tr?0:-1;return Or[s]&&Or[s][c]||s.replace(/width|left|right/i,function(u,p){var x=Or[u.toLowerCase()][c]||u;return p>0?x.charAt(0).toUpperCase()+x.slice(1):x})}function o(s){return s*(n.direction===fs?1:-1)}return{resolve:i,orient:o}}var kn="role",ki="tabindex",lu="disabled",wn="aria-",Po=wn+"controls",ac=wn+"current",ys=wn+"selected",hn=wn+"label",Ba=wn+"labelledby",sc=wn+"hidden",Va=wn+"orientation",bo=wn+"roledescription",vs=wn+"live",bs=wn+"busy",xs=wn+"atomic",Ga=[kn,ki,lu,Po,ac,hn,Ba,sc,Va,bo],Rn=Mo+"__",Qn="is-",Dr=Mo,ws=Rn+"track",cu=Rn+"list",Lr=Rn+"slide",lc=Lr+"--clone",du=Lr+"__container",Ua=Rn+"arrows",Rr=Rn+"arrow",cc=Rr+"--prev",dc=Rr+"--next",Ir=Rn+"pagination",uc=Ir+"__page",uu=Rn+"progress",pu=uu+"__bar",mu=Rn+"toggle",gu=Rn+"spinner",hu=Rn+"sr",fu=Qn+"initialized",fi=Qn+"active",pc=Qn+"prev",mc=Qn+"next",xa=Qn+"visible",wa=Qn+"loading",gc=Qn+"focus-in",hc=Qn+"overflow",yu=[fi,xa,pc,mc,wa,gc,hc],vu={slide:Lr,clone:lc,arrows:Ua,arrow:Rr,prev:cc,next:dc,pagination:Ir,page:uc,spinner:gu};function bu(e,t){if(_l(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!go(n,t);)n=n.parentElement;return n}var xu=5,Ss=200,fc="touchstart mousedown",jr="touchmove mousemove",zr="touchend touchcancel mouseup click";function wu(e,t,n){var i=Kt(e),o=i.on,s=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],x=[],v,f,h;function m(){T(),U(),R()}function b(){o(Qt,I),o(Qt,m),o(an,R),s(document,fc+" keydown",function(P){h=P.type==="keydown"},{capture:!0}),s(l,"focusin",function(){Mn(l,gc,!!h)})}function I(P){var L=Ga.concat("style");Wn(u),Pn(l,p),Pn(v,x),Ln([v,f],L),Ln(l,P?L:["style",bo])}function R(){Pn(l,p),Pn(v,x),p=B(Dr),x=B(ws),Tn(l,p),Tn(v,x),St(l,hn,n.label),St(l,Ba,n.labelledby)}function T(){v=A("."+ws),f=Eo(v,"."+cu),lo(v&&f,"A track/list element is missing."),nr(u,Nl(f,"."+Lr+":not(."+lc+")")),mi({arrows:Ua,pagination:Ir,prev:cc,next:dc,bar:pu,toggle:mu},function(P,L){c[L]=A("."+P)}),fo(c,{root:l,track:v,list:f,slides:u})}function U(){var P=l.id||nu(Mo),L=n.role;l.id=P,v.id=v.id||P+"-track",f.id=f.id||P+"-list",!xn(l,kn)&&l.tagName!=="SECTION"&&L&&St(l,kn,L),St(l,bo,d.carousel),St(f,kn,"presentation")}function A(P){var L=jl(l,P);return L&&bu(L,"."+Dr)===l?L:void 0}function B(P){return[P+"--"+n.type,P+"--"+n.direction,n.drag&&P+"--draggable",n.isNavigation&&P+"--nav",P===Dr&&fi]}return fo(c,{setup:m,mount:b,destroy:I})}var Hi="slide",Yi="loop",ko="fade";function Su(e,t,n,i){var o=Kt(e),s=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,x=p.isNavigation,v=p.updateOnMove,f=p.i18n,h=p.pagination,m=p.slideFocus,b=c.Direction.resolve,I=xn(i,"style"),R=xn(i,hn),T=n>-1,U=Eo(i,"."+du),A;function B(){T||(i.id=u.id+"-slide"+_a(t+1),St(i,kn,h?"tabpanel":"group"),St(i,bo,f.slide),St(i,hn,R||va(f.slideLabel,[t+1,e.length]))),P()}function P(){d(i,"click",Vt(l,Ha,ie)),d(i,"keydown",Vt(l,nc,ie)),s([Xi,ic,vi],W),s(Oa,j),v&&s(_n,w)}function L(){A=!0,o.destroy(),Pn(i,yu),Ln(i,Ga),St(i,"style",I),St(i,hn,R||"")}function j(){var C=e.splides.map(function(M){var O=M.splide.Components.Slides.getAt(t);return O?O.slide.id:""}).join(" ");St(i,hn,va(f.slideX,(T?n:t)+1)),St(i,Po,C),St(i,kn,m?"button":""),m&&Ln(i,bo)}function w(){A||W()}function W(){if(!A){var C=e.index;E(),J(),Mn(i,pc,t===C-1),Mn(i,mc,t===C+1)}}function E(){var C=X();C!==gs(i,fi)&&(Mn(i,fi,C),St(i,ac,x&&C||""),l(C?Vl:Gl,ie))}function J(){var C=G(),M=!C&&(!X()||T);if(e.state.is([Ki,To])||St(i,sc,M||""),St(Fa(i,p.focusableNodes||""),ki,M?-1:""),m&&St(i,ki,M?-1:0),C!==gs(i,xa)&&(Mn(i,xa,C),l(C?Ul:ql,ie)),!C&&document.activeElement===i){var O=c.Slides.getAt(e.index);O&&Ol(O.slide)}}function F(C,M,O){bn(O&&U||i,C,M)}function X(){var C=e.index;return C===t||p.cloneStatus&&C===n}function G(){if(e.is(ko))return X();var C=mn(c.Elements.track),M=mn(i),O=b("left",!0),re=b("right",!0);return dr(C[O])<=vo(M[O])&&dr(M[re])<=vo(C[re])}function V(C,M){var O=ln(C-t);return!T&&(p.rewind||e.is(Yi))&&(O=qn(O,e.length-O)),O<=M}var ie={index:t,slideIndex:n,slide:i,container:U,isClone:T,mount:B,destroy:L,update:W,style:F,isWithin:V};return ie}function $u(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function x(){v(),o(Qt,f),o(Qt,v)}function v(){c.forEach(function(W,E){m(W,E,-1)})}function f(){A(function(W){W.destroy()}),Wn(p)}function h(){A(function(W){W.update()})}function m(W,E,J){var F=Su(e,E,J,W);F.mount(),p.push(F),p.sort(function(X,G){return X.index-G.index})}function b(W){return W?B(function(E){return!E.isClone}):p}function I(W){var E=t.Controller,J=E.toIndex(W),F=E.hasFocus()?1:n.perPage;return B(function(X){return ir(X.index,J,J+F-1)})}function R(W){return B(W)[0]}function T(W,E){yn(W,function(J){if(Un(J)&&(J=Dl(J)),Hl(J)){var F=c[E];F?Aa(J,F):Io(u,J),Tn(J,n.classes.slide),L(J,Vt(s,_i))}}),s(Qt)}function U(W){hi(B(W).map(function(E){return E.slide})),s(Qt)}function A(W,E){b(E).forEach(W)}function B(W){return p.filter(_l(W)?W:function(E){return Un(W)?go(E.slide,W):ka(Ro(W),E.index)})}function P(W,E,J){A(function(F){F.style(W,E,J)})}function L(W,E){var J=Fa(W,"img"),F=J.length;F?J.forEach(function(X){l(X,"load error",function(){--F||E()})}):E()}function j(W){return W?c.length:p.length}function w(){return p.length>n.perPage}return{mount:x,destroy:f,update:h,register:m,get:b,getIn:I,getAt:R,add:T,remove:U,forEach:A,filter:B,style:P,getLength:j,isEnough:w}}function Cu(e,t,n){var i=Kt(e),o=i.on,s=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,x=u.track,v=u.list,f=d.getAt,h=d.style,m,b,I;function R(){T(),s(window,"resize load",ru(Vt(l,_i))),o([an,Qt],T),o(_i,U)}function T(){m=n.direction===Tr,bn(p,"maxWidth",ii(n.width)),bn(x,c("paddingLeft"),A(!1)),bn(x,c("paddingRight"),A(!0)),U(!0)}function U(ie){var C=mn(p);(ie||b.width!==C.width||b.height!==C.height)&&(bn(x,"height",B()),h(c("marginRight"),ii(n.gap)),h("width",L()),h("height",j(),!0),b=C,l(br),I!==(I=V())&&(Mn(p,hc,I),l(iu,I)))}function A(ie){var C=n.padding,M=c(ie?"right":"left");return C&&ii(C[M]||(mo(C)?0:C))||"0px"}function B(){var ie="";return m&&(ie=P(),lo(ie,"height or heightRatio is missing."),ie="calc("+ie+" - "+A(!1)+" - "+A(!0)+")"),ie}function P(){return ii(n.height||mn(v).width*n.heightRatio)}function L(){return n.autoWidth?null:ii(n.fixedWidth)||(m?"":w())}function j(){return ii(n.fixedHeight)||(m?n.autoHeight?null:w():P())}function w(){var ie=ii(n.gap);return"calc((100%"+(ie&&" + "+ie)+")/"+(n.perPage||1)+(ie&&" - "+ie)+")"}function W(){return mn(v)[c("width")]}function E(ie,C){var M=f(ie||0);return M?mn(M.slide)[c("width")]+(C?0:X()):0}function J(ie,C){var M=f(ie);if(M){var O=mn(M.slide)[c("right")],re=mn(v)[c("left")];return ln(O-re)+(C?0:X())}return 0}function F(ie){return J(e.length-1)-J(0)+E(0,ie)}function X(){var ie=f(0);return ie&&parseFloat(bn(ie.slide,c("marginRight")))||0}function G(ie){return parseFloat(bn(x,c("padding"+(ie?"Right":"Left"))))||0}function V(){return e.is(ko)||F(!0)>W()}return{mount:R,resize:U,listSize:W,slideSize:E,sliderSize:F,totalSize:J,getPadding:G,isOverflow:V}}var Tu=2;function Lu(e,t,n){var i=Kt(e),o=i.on,s=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(Qt,x),o([an,_i],f),(u=b())&&(h(u),t.Layout.resize(!0))}function x(){v(),p()}function v(){hi(c),Wn(c),i.destroy()}function f(){var I=b();u!==I&&(u<I||!I)&&i.emit(Qt)}function h(I){var R=l.get().slice(),T=R.length;if(T){for(;R.length<I;)nr(R,R);nr(R.slice(-I),R.slice(0,I)).forEach(function(U,A){var B=A<I,P=m(U.slide,A);B?Aa(P,R[0].slide):Io(s.list,P),nr(c,P),l.register(P,A-I+(B?0:T),U.index)})}}function m(I,R){var T=I.cloneNode(!0);return Tn(T,n.classes.clone),T.id=e.root.id+"-clone"+_a(R+1),T}function b(){var I=n.clones;if(!e.is(Yi))I=0;else if(Lo(I)){var R=n[d("fixedWidth")]&&t.Layout.slideSize(0),T=R&&vo(mn(s.track)[d("width")]/R);I=T||n[d("autoWidth")]&&e.length||n.perPage*Tu}return I}return{mount:p,destroy:v}}function Ru(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,x=d.listSize,v=d.sliderSize,f=t.Direction,h=f.resolve,m=f.orient,b=t.Elements,I=b.list,R=b.track,T;function U(){T=t.Transition,o([Jn,br,an,Qt],A)}function A(){t.Controller.isBusy()||(t.Scroll.cancel(),P(e.index),t.Slides.update())}function B(M,O,re,ne){M!==O&&ie(M>re)&&(W(),L(w(F(),M>re),!0)),l(Ki),s(_n,O,re,M),T.start(O,function(){l(Wi),s(Xi,O,re,M),ne&&ne()})}function P(M){L(J(M,!0))}function L(M,O){if(!e.is(ko)){var re=O?M:j(M);bn(I,"transform","translate"+h("X")+"("+re+"px)"),M!==re&&s(ic)}}function j(M){if(e.is(Yi)){var O=E(M),re=O>t.Controller.getEnd(),ne=O<0;(ne||re)&&(M=w(M,re))}return M}function w(M,O){var re=M-V(O),ne=v();return M-=m(ne*(vo(ln(re)/ne)||1))*(O?1:-1),M}function W(){L(F(),!0),T.cancel()}function E(M){for(var O=t.Slides.get(),re=0,ne=1/0,$=0;$<O.length;$++){var ae=O[$].index,k=ln(J(ae,!0)-M);if(k<=ne)ne=k,re=ae;else break}return re}function J(M,O){var re=m(p(M-1)-G(M));return O?X(re):re}function F(){var M=h("left");return mn(I)[M]-mn(R)[M]+m(u(!1))}function X(M){return n.trimSpace&&e.is(Hi)&&(M=Li(M,0,m(v(!0)-x()))),M}function G(M){var O=n.focus;return O==="center"?(x()-c(M,!0))/2:+O*c(M)||0}function V(M){return J(M?t.Controller.getEnd():0,!!n.trimSpace)}function ie(M){var O=m(w(F(),M));return M?O>=0:O<=I[h("scrollWidth")]-mn(R)[h("width")]}function C(M,O){O=Lo(O)?F():O;var re=M!==!0&&m(O)<m(V(!1)),ne=M!==!1&&m(O)>m(V(!0));return re||ne}return{mount:U,move:B,jump:P,translate:L,shift:w,cancel:W,toIndex:E,toPosition:J,getPosition:F,getLimit:V,exceededLimit:C,reposition:A}}function Iu(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,x=p.isEnough,v=p.getLength,f=n.omitEnd,h=e.is(Yi),m=e.is(Hi),b=Vt(F,!1),I=Vt(F,!0),R=n.start||0,T,U=R,A,B,P;function L(){j(),o([an,Qt,ur],j),o(br,w)}function j(){A=v(!0),B=n.perMove,P=n.perPage,T=ie();var k=Li(R,0,f?T:A-1);k!==R&&(R=k,l.reposition())}function w(){T!==ie()&&s(ur)}function W(k,te,K){if(!ae()){var fe=J(k),Ie=V(fe);Ie>-1&&(te||Ie!==R)&&(re(Ie),l.move(fe,Ie,U,K))}}function E(k,te,K,fe){t.Scroll.scroll(k,te,K,function(){var Ie=V(l.toIndex(d()));re(f?qn(Ie,T):Ie),fe&&fe()})}function J(k){var te=R;if(Un(k)){var K=k.match(/([+\-<>])(\d+)?/)||[],fe=K[1],Ie=K[2];fe==="+"||fe==="-"?te=X(R+ +(""+fe+(+Ie||1)),R):fe===">"?te=Ie?C(+Ie):b(!0):fe==="<"&&(te=I(!0))}else te=h?k:Li(k,0,T);return te}function F(k,te){var K=B||($()?1:P),fe=X(R+K*(k?-1:1),R,!(B||$()));return fe===-1&&m&&!zl(d(),c(!k),1)?k?0:T:te?fe:V(fe)}function X(k,te,K){if(x()||$()){var fe=G(k);fe!==k&&(te=k,k=fe,K=!1),k<0||k>T?!B&&(ir(0,k,te,!0)||ir(T,te,k,!0))?k=C(M(k)):h?k=K?k<0?-(A%P||P):A:k:n.rewind?k=k<0?T:0:k=-1:K&&k!==te&&(k=C(M(te)+(k<te?-1:1)))}else k=-1;return k}function G(k){if(m&&n.trimSpace==="move"&&k!==R)for(var te=d();te===u(k,!0)&&ir(k,0,e.length-1,!n.rewind);)k<R?--k:++k;return k}function V(k){return h?(k+A)%A||0:k}function ie(){for(var k=A-($()||h&&B?1:P);f&&k-- >0;)if(u(A-1,!0)!==u(k,!0)){k++;break}return Li(k,0,A-1)}function C(k){return Li($()?k:P*k,0,T)}function M(k){return $()?qn(k,T):dr((k>=T?A-1:k)/P)}function O(k){var te=l.toIndex(k);return m?Li(te,0,T):te}function re(k){k!==R&&(U=R,R=k)}function ne(k){return k?U:R}function $(){return!Lo(n.focus)||n.isNavigation}function ae(){return e.state.is([Ki,To])&&!!n.waitForTransition}return{mount:L,go:W,scroll:E,getNext:b,getPrev:I,getAdjacent:F,getEnd:ie,setIndex:re,getIndex:ne,toIndex:C,toPage:M,toDest:O,hasFocus:$,isBusy:ae}}var Eu="http://www.w3.org/2000/svg",Mu="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",Oo=40;function Pu(e,t,n){var i=Kt(e),o=i.on,s=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,x=u.arrows,v=u.track,f=x,h=u.prev,m=u.next,b,I,R={};function T(){A(),o(an,U)}function U(){B(),T()}function A(){var E=n.arrows;E&&!(h&&m)&&j(),h&&m&&(fo(R,{prev:h,next:m}),yo(f,E?"":"none"),Tn(f,I=Ua+"--"+n.direction),E&&(P(),W(),St([h,m],Po,v.id),l(Zl,h,m)))}function B(){i.destroy(),Pn(f,I),b?(hi(x?[h,m]:f),h=m=null):Ln([h,m],Ga)}function P(){o([Jn,Xi,Qt,vi,ur],W),s(m,"click",Vt(L,">")),s(h,"click",Vt(L,"<"))}function L(E){p.go(E,!0)}function j(){f=x||Pi("div",d.arrows),h=w(!0),m=w(!1),b=!0,Io(f,[h,m]),!x&&Aa(f,v)}function w(E){var J='<button class="'+d.arrow+" "+(E?d.prev:d.next)+'" type="button"><svg xmlns="'+Eu+'" viewBox="0 0 '+Oo+" "+Oo+'" width="'+Oo+'" height="'+Oo+'" focusable="false"><path d="'+(n.arrowPath||Mu)+'" />';return Dl(J)}function W(){if(h&&m){var E=e.index,J=p.getPrev(),F=p.getNext(),X=J>-1&&E<J?c.last:c.prev,G=F>-1&&E>F?c.first:c.next;h.disabled=J<0,m.disabled=F<0,St(h,hn,X),St(m,hn,G),l(Jl,h,m,J,F)}}return{arrows:R,mount:T,destroy:B,update:W}}var ku=Wa+"-interval";function Au(e,t,n){var i=Kt(e),o=i.on,s=i.bind,l=i.emit,d=wr(n.interval,e.go.bind(e,">"),P),c=d.isPaused,u=t.Elements,p=t.Elements,x=p.root,v=p.toggle,f=n.autoplay,h,m,b=f==="pause";function I(){f&&(R(),v&&St(v,Po,u.track.id),b||T(),B())}function R(){n.pauseOnHover&&s(x,"mouseenter mouseleave",function(j){h=j.type==="mouseenter",A()}),n.pauseOnFocus&&s(x,"focusin focusout",function(j){m=j.type==="focusin",A()}),v&&s(v,"click",function(){b?T():U(!0)}),o([_n,xr,Qt],d.rewind),o(_n,L)}function T(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),m=h=b=!1,B(),l(Da))}function U(j){j===void 0&&(j=!0),b=!!j,B(),c()||(d.pause(),l(ja))}function A(){b||(h||m?U(!1):T())}function B(){v&&(Mn(v,fi,!b),St(v,hn,n.i18n[b?"play":"pause"]))}function P(j){var w=u.bar;w&&bn(w,"width",j*100+"%"),l(tc,j)}function L(j){var w=t.Slides.getAt(j);d.set(w&&+xn(w.slide,ku)||n.interval)}return{mount:I,destroy:d.cancel,play:T,pause:U,isPaused:c}}function Fu(e,t,n){var i=Kt(e),o=i.on;function s(){n.cover&&(o(za,Vt(d,!0)),o([Jn,an,Qt],Vt(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Eo(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),yo(u,c?"none":"")}return{mount:s,destroy:Vt(l,!1)}}var Wu=10,_u=600,Hu=.6,Nu=1.5,Ou=800;function Du(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,x=d.translate,v=e.is(Hi),f,h,m=1;function b(){o(_n,U),o([an,Qt],A)}function I(P,L,j,w,W){var E=c();if(U(),j&&(!v||!p())){var J=t.Layout.sliderSize(),F=ya(P)*J*dr(ln(P)/J)||0;P=d.toPosition(t.Controller.toDest(P%J))+F}var X=zl(E,P,1);m=1,L=X?0:L||cr(ln(P-E)/Nu,Ou),h=w,f=wr(L,R,Vt(T,E,P,W),1),l(To),s(xr),f.start()}function R(){l(Wi),h&&h(),s(vi)}function T(P,L,j,w){var W=c(),E=P+(L-P)*B(w),J=(E-W)*m;x(W+J),v&&!j&&p()&&(m*=Hu,ln(J)<Wu&&I(u(p(!0)),_u,!1,h,!0))}function U(){f&&f.cancel()}function A(){f&&!f.isPaused()&&(U(),R())}function B(P){var L=n.easingFunc;return L?L(P):1-Math.pow(1-P,4)}return{mount:b,destroy:U,scroll:I,cancel:A}}var Ri={passive:!1,capture:!0};function ju(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,x=t.Controller,v=t.Elements.track,f=t.Media.reduce,h=t.Direction,m=h.resolve,b=h.orient,I=u.getPosition,R=u.exceededLimit,T,U,A,B,P,L=!1,j,w,W;function E(){l(v,jr,ha,Ri),l(v,zr,ha,Ri),l(v,fc,F,Ri),l(v,"click",V,{capture:!0}),l(v,"dragstart",En),o([Jn,an],J)}function J(){var q=n.drag;ue(!q),B=q==="free"}function F(q){if(j=!1,!w){var Q=Ie(q);fe(q.target)&&(Q||!q.button)&&(x.isBusy()?En(q,!0):(W=Q?v:window,P=c.is([Ki,To]),A=null,l(W,jr,X,Ri),l(W,zr,G,Ri),u.cancel(),p.cancel(),ie(q)))}}function X(q){if(c.is(tr)||(c.set(tr),s(Kl)),q.cancelable)if(P){u.translate(T+K($(q)));var Q=ae(q)>Ss,Y=L!==(L=R());(Q||Y)&&ie(q),j=!0,s(Xl),En(q)}else O(q)&&(P=M(q),En(q))}function G(q){c.is(tr)&&(c.set(Wi),s(Yl)),P&&(C(q),En(q)),d(W,jr,X),d(W,zr,G),P=!1}function V(q){!w&&j&&En(q,!0)}function ie(q){A=U,U=q,T=I()}function C(q){var Q=re(q),Y=ne(Q),Ae=n.rewind&&n.rewindByDrag;f(!1),B?x.scroll(Y,0,n.snap):e.is(ko)?x.go(b(ya(Q))<0?Ae?"<":"-":Ae?">":"+"):e.is(Hi)&&L&&Ae?x.go(R(!0)?">":"<"):x.go(x.toDest(Y),!0),f(!0)}function M(q){var Q=n.dragMinThreshold,Y=mo(Q),Ae=Y&&Q.mouse||0,Se=(Y?Q.touch:+Q)||10;return ln($(q))>(Ie(q)?Se:Ae)}function O(q){return ln($(q))>ln($(q,!0))}function re(q){if(e.is(Yi)||!L){var Q=ae(q);if(Q&&Q<Ss)return $(q)/Q}return 0}function ne(q){return I()+ya(q)*qn(ln(q)*(n.flickPower||600),B?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function $(q,Q){return te(q,Q)-te(k(q),Q)}function ae(q){return fa(q)-fa(k(q))}function k(q){return U===q&&A||U}function te(q,Q){return(Ie(q)?q.changedTouches[0]:q)["page"+m(Q?"Y":"X")]}function K(q){return q/(L&&e.is(Hi)?xu:1)}function fe(q){var Q=n.noDrag;return!go(q,"."+uc+", ."+Rr)&&(!Q||!go(q,Q))}function Ie(q){return typeof TouchEvent<"u"&&q instanceof TouchEvent}function me(){return P}function ue(q){w=q}return{mount:E,disable:ue,isDragging:me}}var zu={Spacebar:" ",Right:Cr,Left:$r,Up:oc,Down:rc};function qa(e){return e=Un(e)?e:e.key,zu[e]||e}var $s="keydown";function Bu(e,t,n){var i=Kt(e),o=i.on,s=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function x(){v(),o(an,f),o(an,v),o(_n,m)}function v(){var I=n.keyboard;I&&(u=I==="global"?window:d,s(u,$s,b))}function f(){l(u,$s)}function h(I){p=I}function m(){var I=p;p=!0,Wl(function(){p=I})}function b(I){if(!p){var R=qa(I);R===c($r)?e.go("<"):R===c(Cr)&&e.go(">")}}return{mount:x,destroy:f,disable:h}}var co=Wa+"-lazy",or=co+"-srcset",Vu="["+co+"], ["+or+"]";function Gu(e,t,n){var i=Kt(e),o=i.on,s=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[Xi,vi],p=[];function x(){n.lazyLoad&&(v(),o(Qt,v))}function v(){Wn(p),f(),c?I():(s(u),o(u,h),h())}function f(){t.Slides.forEach(function(R){Fa(R.slide,Vu).forEach(function(T){var U=xn(T,co),A=xn(T,or);if(U!==T.src||A!==T.srcset){var B=n.classes.spinner,P=T.parentElement,L=Eo(P,"."+B)||Pi("span",B,P);p.push([T,R,L]),T.src||yo(T,"none")}})})}function h(){p=p.filter(function(R){var T=n.perPage*((n.preloadPages||1)+1)-1;return R[1].isWithin(e.index,T)?m(R):!0}),p.length||s(u)}function m(R){var T=R[0];Tn(R[1].slide,wa),l(T,"load error",Vt(b,R)),St(T,"src",xn(T,co)),St(T,"srcset",xn(T,or)),Ln(T,co),Ln(T,or)}function b(R,T){var U=R[0],A=R[1];Pn(A.slide,wa),T.type!=="error"&&(hi(R[2]),yo(U,""),d(za,U,A),d(_i)),c&&I()}function I(){p.length&&m(p.shift())}return{mount:x,destroy:Vt(Wn,p),check:h}}function Uu(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,x=u.getIndex,v=u.go,f=t.Direction.resolve,h=c.pagination,m=[],b,I;function R(){T(),o([an,Qt,ur],R);var w=n.pagination;h&&yo(h,w?"":"none"),w&&(o([_n,xr,vi],j),U(),j(),s(Ql,{list:b,items:m},L(e.index)))}function T(){b&&(hi(h?Zn(b.children):b),Pn(b,I),Wn(m),b=null),i.destroy()}function U(){var w=e.length,W=n.classes,E=n.i18n,J=n.perPage,F=p()?u.getEnd()+1:vo(w/J);b=h||Pi("ul",W.pagination,c.track.parentElement),Tn(b,I=Ir+"--"+P()),St(b,kn,"tablist"),St(b,hn,E.select),St(b,Va,P()===Tr?"vertical":"");for(var X=0;X<F;X++){var G=Pi("li",null,b),V=Pi("button",{class:W.page,type:"button"},G),ie=d.getIn(X).map(function(M){return M.slide.id}),C=!p()&&J>1?E.pageX:E.slideX;l(V,"click",Vt(A,X)),n.paginationKeyboard&&l(V,"keydown",Vt(B,X)),St(G,kn,"presentation"),St(V,kn,"tab"),St(V,Po,ie.join(" ")),St(V,hn,va(C,X+1)),St(V,ki,-1),m.push({li:G,button:V,page:X})}}function A(w){v(">"+w,!0)}function B(w,W){var E=m.length,J=qa(W),F=P(),X=-1;J===f(Cr,!1,F)?X=++w%E:J===f($r,!1,F)?X=(--w+E)%E:J==="Home"?X=0:J==="End"&&(X=E-1);var G=m[X];G&&(Ol(G.button),v(">"+X),En(W,!0))}function P(){return n.paginationDirection||n.direction}function L(w){return m[u.toPage(w)]}function j(){var w=L(x(!0)),W=L(x());if(w){var E=w.button;Pn(E,fi),Ln(E,ys),St(E,ki,-1)}if(W){var J=W.button;Tn(J,fi),St(J,ys,!0),St(J,ki,"")}s(ec,{list:b,items:m},w,W)}return{items:m,mount:R,destroy:T,getAt:L,update:j}}var qu=[" ","Enter"];function Ku(e,t,n){var i=n.isNavigation,o=n.slideFocus,s=[];function l(){e.splides.forEach(function(h){h.isParent||(u(e,h.splide),u(h.splide,e))}),i&&p()}function d(){s.forEach(function(h){h.destroy()}),Wn(s)}function c(){d(),l()}function u(h,m){var b=Kt(h);b.on(_n,function(I,R,T){m.go(m.is(Yi)?T:I)}),s.push(b)}function p(){var h=Kt(e),m=h.on;m(Ha,v),m(nc,f),m([Jn,an],x),s.push(h),h.emit(Oa,e.splides)}function x(){St(t.Elements.list,Va,n.direction===Tr?"vertical":"")}function v(h){e.go(h.index)}function f(h,m){ka(qu,qa(m))&&(v(h),En(m))}return{setup:Vt(t.Media.set,{slideFocus:Lo(o)?i:o},!0),mount:l,destroy:d,remount:c}}function Xu(e,t,n){var i=Kt(e),o=i.bind,s=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,Ri)}function d(u){if(u.cancelable){var p=u.deltaY,x=p<0,v=fa(u),f=n.wheelMinThreshold||0,h=n.wheelSleep||0;ln(p)>f&&v-s>h&&(e.go(x?"<":">"),s=v),c(x)&&En(u)}}function c(u){return!n.releaseWheel||e.state.is(Ki)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var Yu=90;function Zu(e,t,n){var i=Kt(e),o=i.on,s=t.Elements.track,l=n.live&&!n.isNavigation,d=Pi("span",hu),c=wr(Yu,Vt(p,!1));function u(){l&&(v(!t.Autoplay.isPaused()),St(s,xs,!0),d.textContent="…",o(Da,Vt(v,!0)),o(ja,Vt(v,!1)),o([Xi,vi],Vt(p,!0)))}function p(f){St(s,bs,f),f?(Io(s,d),c.start()):(hi(d),c.cancel())}function x(){Ln(s,[vs,xs,bs]),hi(d)}function v(f){l&&St(s,vs,f?"off":"polite")}return{mount:u,disable:v,destroy:x}}var Ju=Object.freeze({__proto__:null,Media:au,Direction:su,Elements:wu,Slides:$u,Layout:Cu,Clones:Lu,Move:Ru,Controller:Iu,Arrows:Pu,Autoplay:Au,Cover:Fu,Scroll:Du,Drag:ju,Keyboard:Bu,LazyLoad:Gu,Pagination:Uu,Sync:Ku,Wheel:Xu,Live:Zu}),Qu={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"},ep={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:vu,i18n:Qu,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function tp(e,t,n){var i=t.Slides;function o(){Kt(e).on([Jn,Qt],s)}function s(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function l(d,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),Wl(c)}return{mount:o,start:l,cancel:ha}}function np(e,t,n){var i=t.Move,o=t.Controller,s=t.Scroll,l=t.Elements.list,d=Vt(bn,l,"transition"),c;function u(){Kt(e).bind(l,"transitionend",function(f){f.target===l&&c&&(x(),c())})}function p(f,h){var m=i.toPosition(f,!0),b=i.getPosition(),I=v(f);ln(m-b)>=1&&I>=1?n.useScroll?s.scroll(m,I,!1,h):(d("transform "+I+"ms "+n.easing),i.translate(m,!0),c=h):(i.jump(f),h())}function x(){d(""),s.cancel()}function v(f){var h=n.rewindSpeed;if(e.is(Hi)&&h){var m=o.getIndex(!0),b=o.getEnd();if(m===0&&f>=b||m>=b&&f===0)return h}return n.speed}return{mount:u,start:p,cancel:x}}var ip=(function(){function e(n,i){this.event=Kt(),this.Components={},this.state=ou(Mi),this.splides=[],this._o={},this._E={};var o=Un(n)?jl(document,n):n;lo(o,o+" is invalid."),this.root=o,i=zn({label:xn(o,hn)||"",labelledby:xn(o,Ba)||""},ep,e.defaults,i||{});try{zn(i,JSON.parse(xn(o,Wa)))}catch{lo(!1,"Invalid JSON")}this._o=Object.create(zn({},i))}var t=e.prototype;return t.mount=function(i,o){var s=this,l=this.state,d=this.Components;lo(l.is([Mi,lr]),"Already mounted!"),l.set(Mi),this._C=d,this._T=o||this._T||(this.is(ko)?tp:np),this._E=i||this._E;var c=fo({},Ju,this._E,{Transition:this._T});return mi(c,function(u,p){var x=u(s,d,s._o);d[p]=x,x.setup&&x.setup()}),mi(d,function(u){u.mount&&u.mount()}),this.emit(Jn),Tn(this.root,fu),l.set(Wi),this.emit(ba),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Wi)&&(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(Zn(arguments,1))),this},t.add=function(i,o){return this._C.Slides.add(i,o),this},t.remove=function(i){return this._C.Slides.remove(i),this},t.is=function(i){return this._o.type===i},t.refresh=function(){return this.emit(Qt),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,s=this.state;return s.is(Mi)?Kt(this).on(ba,this.destroy.bind(this,i)):(mi(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(Na),o.destroy(),i&&Wn(this.splides),s.set(lr)),this},Qd(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})(),Ka=ip;Ka.defaults={};Ka.STATES=tu;var Cs=[[Jn,"onMounted"],[ba,"onReady"],[_n,"onMove"],[Xi,"onMoved"],[Ha,"onClick"],[Vl,"onActive"],[Gl,"onInactive"],[Ul,"onVisible"],[ql,"onHidden"],[Qt,"onRefresh"],[an,"onUpdated"],[_i,"onResize"],[br,"onResized"],[Kl,"onDrag"],[Xl,"onDragging"],[Yl,"onDragged"],[xr,"onScroll"],[vi,"onScrolled"],[Na,"onDestroy"],[Zl,"onArrowsMounted"],[Jl,"onArrowsUpdated"],[Ql,"onPaginationMounted"],[ec,"onPaginationUpdated"],[Oa,"onNavigationMounted"],[Da,"onAutoplayPlay"],[tc,"onAutoplayPlaying"],[ja,"onAutoplayPause"],[za,"onLazyLoadLoaded"]];function Xa(...e){return e.filter(Boolean).join(" ")}function pr(e){return e!==null&&typeof e=="object"}function Sa(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!Sa(n,t[i]));if(pr(e)&&pr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Sa(e[o],t[o]))}return e===t}function op(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function rp(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 $a(e,t){const n=e;return rp(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():pr(i)?n[o]=$a(pr(n[o])?n[o]:{},i):n[o]=i}),n}var ap=({children:e,className:t,...n})=>a.createElement("div",{className:Xa("splide__track",t),...n},a.createElement("ul",{className:"splide__list"},e)),Ya=class extends a.Component{constructor(){super(...arguments),this.splideRef=a.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new Ka(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=$a({},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&&!Sa(this.options,e)&&(this.splide.options=e,this.options=$a({},e));const t=this.getSlides();op(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){Cs.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 a.createElement(t,{className:Xa("splide",e),ref:this.splideRef,...this.omit(o,["options",...Cs.map(s=>s[1])])},n?a.createElement(ap,null,i):i)}},Za=({children:e,className:t,...n})=>a.createElement("li",{className:Xa("splide__slide",t),...n},e);/*!
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=require("react"),ut=require("classnames"),C=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Yn=require("react-dom");function ud(e){return e.type==="object"&&e.version===1}const pd="ControlSlider-module__wrapper___sHEkd",md="ControlSlider-module__hoverArrow___A-dOH",gd="ControlSlider-module__sliderItem___QQSkR",hd="ControlSlider-module__sliderImage___9hRl-",fd="ControlSlider-module__arrow___05ghY",yd="ControlSlider-module__arrowVertical___tBfVN",vd="ControlSlider-module__nextArrow___-30Yc",xd="ControlSlider-module__arrowInner___aEra3",bd="ControlSlider-module__arrowIcon___S4ztF",wd="ControlSlider-module__arrowImg___2dwJW",Sd="ControlSlider-module__mirror___brd6U",$d="ControlSlider-module__pagination___bicLF",Cd="ControlSlider-module__paginationInner___bT-P-",Td="ControlSlider-module__paginationVertical___zYqKw",Ld="ControlSlider-module__paginationItem___nTRbk",Rd="ControlSlider-module__dot___p1Qun",Id="ControlSlider-module__activeDot___LHFaj",Ed="ControlSlider-module__paginationInsideBottom___R3FWn",Md="ControlSlider-module__paginationInsideTop___V-qb-",Pd="ControlSlider-module__paginationOutsideBottom___14w8D",kd="ControlSlider-module__paginationOutsideTop___SCLqB",Ad="ControlSlider-module__paginationInsideLeft___yOBRZ",Fd="ControlSlider-module__paginationInsideRight___Rtt3o",Wd="ControlSlider-module__paginationOutsideLeft___lahaw",_d="ControlSlider-module__paginationOutsideRight___EtuQa",Hd="ControlSlider-module__imgWrapper___UjEgB",Nd="ControlSlider-module__captionBlock___dJ6-j",Od="ControlSlider-module__captionTextWrapper___HFlpf",Dd="ControlSlider-module__captionText___uGBVc",jd="ControlSlider-module__active___WZK4G",zd="ControlSlider-module__withPointerEvents___t-18M",Bd="ControlSlider-module__topLeftAlignment___zjnGM",Vd="ControlSlider-module__topCenterAlignment___gD1xW",Gd="ControlSlider-module__topRightAlignment___NMapS",qd="ControlSlider-module__middleLeftAlignment___OnUrY",Ud="ControlSlider-module__middleCenterAlignment___Tdkl0",Xd="ControlSlider-module__middleRightAlignment___wEbfX",Kd="ControlSlider-module__bottomLeftAlignment___cTP2-",Yd="ControlSlider-module__bottomCenterAlignment___c54fB",Zd="ControlSlider-module__bottomRightAlignment___kEwrz",Jd="ControlSlider-module__clickOverlay___DZA28",Qd="ControlSlider-module__contain___pLyq7",eu="ControlSlider-module__cover___KdDat",ct={wrapper:pd,hoverArrow:md,sliderItem:gd,sliderImage:hd,arrow:fd,arrowVertical:yd,nextArrow:vd,arrowInner:xd,arrowIcon:bd,arrowImg:wd,mirror:Sd,pagination:$d,paginationInner:Cd,paginationVertical:Td,paginationItem:Ld,dot:Rd,activeDot:Id,paginationInsideBottom:Ed,paginationInsideTop:Md,paginationOutsideBottom:Pd,paginationOutsideTop:kd,paginationInsideLeft:Ad,paginationInsideRight:Fd,paginationOutsideLeft:Wd,paginationOutsideRight:_d,imgWrapper:Hd,captionBlock:Nd,captionTextWrapper:Od,captionText:Dd,active:jd,withPointerEvents:zd,topLeftAlignment:Bd,topCenterAlignment:Vd,topRightAlignment:Gd,middleLeftAlignment:qd,middleCenterAlignment:Ud,middleRightAlignment:Xd,bottomLeftAlignment:Kd,bottomCenterAlignment:Yd,bottomRightAlignment:Zd,clickOverlay:Jd,contain:Qd,cover:eu};function tu(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function nu(e,t,n){return t&&tu(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var gs="(prefers-reduced-motion: reduce)",Pi=1,iu=2,_i=3,Ki=4,Lo=5,nr=6,cr=7,ou={CREATED:Pi,MOUNTED:iu,IDLE:_i,MOVING:Ki,SCROLLING:Lo,DRAGGING:nr,DESTROYED:cr};function Wn(e){e.length=0}function Zn(e,t,n){return Array.prototype.slice.call(e,t,n)}function qt(e){return e.bind.apply(e,[null].concat(Zn(arguments,1)))}var Nl=setTimeout,ya=function(){};function hs(e){return requestAnimationFrame(e)}function xr(e,t){return typeof t===e}function go(e){return!Fa(e)&&xr("object",e)}var Aa=Array.isArray,Ol=qt(xr,"function"),qn=qt(xr,"string"),Ro=qt(xr,"undefined");function Fa(e){return e===null}function Dl(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Io(e){return Aa(e)?e:[e]}function yn(e,t){Io(e).forEach(t)}function Wa(e,t){return e.indexOf(t)>-1}function ir(e,t){return e.push.apply(e,Io(t)),e}function Mn(e,t,n){e&&yn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Tn(e,t){Mn(e,qn(t)?t.split(" "):t,!0)}function Eo(e,t){yn(t,e.appendChild.bind(e))}function _a(e,t){yn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function ho(e,t){return Dl(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function jl(e,t){var n=e?Zn(e.children):[];return t?n.filter(function(i){return ho(i,t)}):n}function Mo(e,t){return t?jl(e,t)[0]:e.firstElementChild}var fo=Object.keys;function mi(e,t,n){return e&&(n?fo(e).reverse():fo(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function yo(e){return Zn(arguments,1).forEach(function(t){mi(t,function(n,i){e[i]=t[i]})}),e}function zn(e){return Zn(arguments,1).forEach(function(t){mi(t,function(n,i){Aa(n)?e[i]=n.slice():go(n)?e[i]=zn({},go(e[i])?e[i]:{},n):e[i]=n})}),e}function fs(e,t){yn(t||fo(e),function(n){delete e[n]})}function Ln(e,t){yn(e,function(n){yn(t,function(i){n&&n.removeAttribute(i)})})}function $t(e,t,n){go(t)?mi(t,function(i,o){$t(e,o,i)}):yn(e,function(i){Fa(n)||n===""?Ln(i,t):i.setAttribute(t,String(n))})}function ki(e,t,n){var i=document.createElement(e);return t&&(qn(t)?Tn(i,t):$t(i,t)),n&&Eo(n,i),i}function xn(e,t,n){if(Ro(n))return getComputedStyle(e)[t];Fa(n)||(e.style[t]=""+n)}function vo(e,t){xn(e,"display",t)}function zl(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function bn(e,t){return e.getAttribute(t)}function ys(e,t){return e&&e.classList.contains(t)}function mn(e){return e.getBoundingClientRect()}function hi(e){yn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Bl(e){return Mo(new DOMParser().parseFromString(e,"text/html").body)}function En(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Vl(e,t){return e&&e.querySelector(t)}function Ha(e,t){return t?Zn(e.querySelectorAll(t)):[]}function Pn(e,t){Mn(e,t,!1)}function va(e){return e.timeStamp}function ii(e){return qn(e)?e:e?e+"px":""}var Po="splide",Na="data-"+Po;function co(e,t){if(!e)throw new Error("["+Po+"] "+(t||""))}var Un=Math.min,dr=Math.max,ur=Math.floor,xo=Math.ceil,cn=Math.abs;function Gl(e,t,n){return cn(e-t)<n}function or(e,t,n,i){var o=Un(t,n),s=dr(t,n);return i?o<e&&e<s:o<=e&&e<=s}function Ri(e,t,n){var i=Un(t,n),o=dr(t,n);return Un(dr(i,e),o)}function xa(e){return+(e>0)-+(e<0)}function ba(e,t){return yn(t,function(n){e=e.replace("%s",""+n)}),e}function Oa(e){return e<10?"0"+e:""+e}var vs={};function ru(e){return""+e+Oa(vs[e]=(vs[e]||0)+1)}function ql(){var e=[];function t(l,d,c,u){o(l,d,function(p,v,y){var g="addEventListener"in p,h=g?p.removeEventListener.bind(p,v,c,u):p.removeListener.bind(p,c);g?p.addEventListener(v,c,u):p.addListener(c),e.push([p,v,y,c,h])})}function n(l,d,c){o(l,d,function(u,p,v){e=e.filter(function(y){return y[0]===u&&y[1]===p&&y[2]===v&&(!c||y[3]===c)?(y[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){yn(l,function(u){u&&yn(d,function(p){p.split(" ").forEach(function(v){var y=v.split(".");c(u,y[0],y[1])})})})}function s(){e.forEach(function(l){l[4]()}),Wn(e)}return{bind:t,unbind:n,dispatch:i,destroy:s}}var Jn="mounted",wa="ready",_n="move",Yi="moved",Da="click",Ul="active",Xl="inactive",Kl="visible",Yl="hidden",en="refresh",sn="updated",Hi="resize",br="resized",Zl="drag",Jl="dragging",Ql="dragged",wr="scroll",vi="scrolled",au="overflow",ja="destroy",ec="arrows:mounted",tc="arrows:updated",nc="pagination:mounted",ic="pagination:updated",za="navigation:mounted",Ba="autoplay:play",oc="autoplay:playing",Va="autoplay:pause",Ga="lazyload:loaded",rc="sk",ac="sh",pr="ei";function Yt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=ql();function i(s,l){n.bind(t,Io(s).join(" "),function(d){l.apply(l,Aa(d.detail)?d.detail:[])})}function o(s){n.dispatch(t,s,Zn(arguments,1))}return e&&e.event.on(ja,n.destroy),yo(n,{bus:t,on:i,off:qt(n.unbind,t),emit:o})}function Sr(e,t,n,i){var o=Date.now,s,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?Un((o()-s)/e,1):1,n&&n(l),l>=1&&(t(),s=o(),i&&++u>=i))return y();d=hs(p)}}function v(I){I||h(),s=o()-(I?l*e:0),c=!1,d=hs(p)}function y(){c=!0}function g(){s=o(),l=0,n&&n(l)}function h(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function m(I){e=I}function b(){return c}return{start:v,rewind:g,pause:y,cancel:h,set:m,isPaused:b}}function su(e){var t=e;function n(o){t=o}function i(o){return Wa(Io(o),t)}return{set:n,is:i}}function lu(e,t){var n=Sr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function cu(e,t,n){var i=e.state,o=n.breakpoints||{},s=n.reducedMotion||{},l=ql(),d=[];function c(){var h=n.mediaQuery==="min";fo(o).sort(function(m,b){return h?+m-+b:+b-+m}).forEach(function(m){p(o[m],"("+(h?"min":"max")+"-width:"+m+"px)")}),p(s,gs),v()}function u(h){h&&l.destroy()}function p(h,m){var b=matchMedia(m);l.bind(b,"change",v),d.push([h,b])}function v(){var h=i.is(cr),m=n.direction,b=d.reduce(function(I,R){return zn(I,R[1].matches?R[0]:{})},{});fs(n),g(b),n.destroy?e.destroy(n.destroy==="completely"):h?(u(!0),e.mount()):m!==n.direction&&e.refresh()}function y(h){matchMedia(gs).matches&&(h?zn(n,s):fs(n,fo(s)))}function g(h,m,b){zn(n,h),m&&zn(Object.getPrototypeOf(n),h),(b||!i.is(Pi))&&e.emit(sn,n)}return{setup:c,destroy:u,reduce:y,set:g}}var $r="Arrow",Cr=$r+"Left",Tr=$r+"Right",sc=$r+"Up",lc=$r+"Down",xs="rtl",Lr="ttb",Dr={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[sc,Tr],ArrowRight:[lc,Cr]};function du(e,t,n){function i(s,l,d){d=d||n.direction;var c=d===xs&&!l?1:d===Lr?0:-1;return Dr[s]&&Dr[s][c]||s.replace(/width|left|right/i,function(u,p){var v=Dr[u.toLowerCase()][c]||u;return p>0?v.charAt(0).toUpperCase()+v.slice(1):v})}function o(s){return s*(n.direction===xs?1:-1)}return{resolve:i,orient:o}}var kn="role",Ai="tabindex",uu="disabled",wn="aria-",ko=wn+"controls",cc=wn+"current",bs=wn+"selected",hn=wn+"label",qa=wn+"labelledby",dc=wn+"hidden",Ua=wn+"orientation",bo=wn+"roledescription",ws=wn+"live",Ss=wn+"busy",$s=wn+"atomic",Xa=[kn,Ai,uu,ko,cc,hn,qa,dc,Ua,bo],Rn=Po+"__",Qn="is-",jr=Po,Cs=Rn+"track",pu=Rn+"list",Rr=Rn+"slide",uc=Rr+"--clone",mu=Rr+"__container",Ka=Rn+"arrows",Ir=Rn+"arrow",pc=Ir+"--prev",mc=Ir+"--next",Er=Rn+"pagination",gc=Er+"__page",gu=Rn+"progress",hu=gu+"__bar",fu=Rn+"toggle",yu=Rn+"spinner",vu=Rn+"sr",xu=Qn+"initialized",fi=Qn+"active",hc=Qn+"prev",fc=Qn+"next",Sa=Qn+"visible",$a=Qn+"loading",yc=Qn+"focus-in",vc=Qn+"overflow",bu=[fi,Sa,hc,fc,$a,yc,vc],wu={slide:Rr,clone:uc,arrows:Ka,arrow:Ir,prev:pc,next:mc,pagination:Er,page:gc,spinner:yu};function Su(e,t){if(Ol(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!ho(n,t);)n=n.parentElement;return n}var $u=5,Ts=200,xc="touchstart mousedown",zr="touchmove mousemove",Br="touchend touchcancel mouseup click";function Cu(e,t,n){var i=Yt(e),o=i.on,s=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],v=[],y,g,h;function m(){T(),q(),R()}function b(){o(en,I),o(en,m),o(sn,R),s(document,xc+" keydown",function(A){h=A.type==="keydown"},{capture:!0}),s(l,"focusin",function(){Mn(l,yc,!!h)})}function I(A){var L=Xa.concat("style");Wn(u),Pn(l,p),Pn(y,v),Ln([y,g],L),Ln(l,A?L:["style",bo])}function R(){Pn(l,p),Pn(y,v),p=V(jr),v=V(Cs),Tn(l,p),Tn(y,v),$t(l,hn,n.label),$t(l,qa,n.labelledby)}function T(){y=F("."+Cs),g=Mo(y,"."+pu),co(y&&g,"A track/list element is missing."),ir(u,jl(g,"."+Rr+":not(."+uc+")")),mi({arrows:Ka,pagination:Er,prev:pc,next:mc,bar:hu,toggle:fu},function(A,L){c[L]=F("."+A)}),yo(c,{root:l,track:y,list:g,slides:u})}function q(){var A=l.id||ru(Po),L=n.role;l.id=A,y.id=y.id||A+"-track",g.id=g.id||A+"-list",!bn(l,kn)&&l.tagName!=="SECTION"&&L&&$t(l,kn,L),$t(l,bo,d.carousel),$t(g,kn,"presentation")}function F(A){var L=Vl(l,A);return L&&Su(L,"."+jr)===l?L:void 0}function V(A){return[A+"--"+n.type,A+"--"+n.direction,n.drag&&A+"--draggable",n.isNavigation&&A+"--nav",A===jr&&fi]}return yo(c,{setup:m,mount:b,destroy:I})}var Ni="slide",Zi="loop",Ao="fade";function Tu(e,t,n,i){var o=Yt(e),s=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,v=p.isNavigation,y=p.updateOnMove,g=p.i18n,h=p.pagination,m=p.slideFocus,b=c.Direction.resolve,I=bn(i,"style"),R=bn(i,hn),T=n>-1,q=Mo(i,"."+mu),F;function V(){T||(i.id=u.id+"-slide"+Oa(t+1),$t(i,kn,h?"tabpanel":"group"),$t(i,bo,g.slide),$t(i,hn,R||ba(g.slideLabel,[t+1,e.length]))),A()}function A(){d(i,"click",qt(l,Da,ie)),d(i,"keydown",qt(l,rc,ie)),s([Yi,ac,vi],W),s(za,O),y&&s(_n,x)}function L(){F=!0,o.destroy(),Pn(i,bu),Ln(i,Xa),$t(i,"style",I),$t(i,hn,R||"")}function O(){var S=e.splides.map(function(M){var D=M.splide.Components.Slides.getAt(t);return D?D.slide.id:""}).join(" ");$t(i,hn,ba(g.slideX,(T?n:t)+1)),$t(i,ko,S),$t(i,kn,m?"button":""),m&&Ln(i,bo)}function x(){F||W()}function W(){if(!F){var S=e.index;E(),J(),Mn(i,hc,t===S-1),Mn(i,fc,t===S+1)}}function E(){var S=K();S!==ys(i,fi)&&(Mn(i,fi,S),$t(i,cc,v&&S||""),l(S?Ul:Xl,ie))}function J(){var S=B(),M=!S&&(!K()||T);if(e.state.is([Ki,Lo])||$t(i,dc,M||""),$t(Ha(i,p.focusableNodes||""),Ai,M?-1:""),m&&$t(i,Ai,M?-1:0),S!==ys(i,Sa)&&(Mn(i,Sa,S),l(S?Kl:Yl,ie)),!S&&document.activeElement===i){var D=c.Slides.getAt(e.index);D&&zl(D.slide)}}function P(S,M,D){xn(D&&q||i,S,M)}function K(){var S=e.index;return S===t||p.cloneStatus&&S===n}function B(){if(e.is(Ao))return K();var S=mn(c.Elements.track),M=mn(i),D=b("left",!0),le=b("right",!0);return ur(S[D])<=xo(M[D])&&ur(M[le])<=xo(S[le])}function z(S,M){var D=cn(S-t);return!T&&(p.rewind||e.is(Zi))&&(D=Un(D,e.length-D)),D<=M}var ie={index:t,slideIndex:n,slide:i,container:q,isClone:T,mount:V,destroy:L,update:W,style:P,isWithin:z};return ie}function Lu(e,t,n){var i=Yt(e),o=i.on,s=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function v(){y(),o(en,g),o(en,y)}function y(){c.forEach(function(W,E){m(W,E,-1)})}function g(){F(function(W){W.destroy()}),Wn(p)}function h(){F(function(W){W.update()})}function m(W,E,J){var P=Tu(e,E,J,W);P.mount(),p.push(P),p.sort(function(K,B){return K.index-B.index})}function b(W){return W?V(function(E){return!E.isClone}):p}function I(W){var E=t.Controller,J=E.toIndex(W),P=E.hasFocus()?1:n.perPage;return V(function(K){return or(K.index,J,J+P-1)})}function R(W){return V(W)[0]}function T(W,E){yn(W,function(J){if(qn(J)&&(J=Bl(J)),Dl(J)){var P=c[E];P?_a(J,P):Eo(u,J),Tn(J,n.classes.slide),L(J,qt(s,Hi))}}),s(en)}function q(W){hi(V(W).map(function(E){return E.slide})),s(en)}function F(W,E){b(E).forEach(W)}function V(W){return p.filter(Ol(W)?W:function(E){return qn(W)?ho(E.slide,W):Wa(Io(W),E.index)})}function A(W,E,J){F(function(P){P.style(W,E,J)})}function L(W,E){var J=Ha(W,"img"),P=J.length;P?J.forEach(function(K){l(K,"load error",function(){--P||E()})}):E()}function O(W){return W?c.length:p.length}function x(){return p.length>n.perPage}return{mount:v,destroy:g,update:h,register:m,get:b,getIn:I,getAt:R,add:T,remove:q,forEach:F,filter:V,style:A,getLength:O,isEnough:x}}function Ru(e,t,n){var i=Yt(e),o=i.on,s=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,v=u.track,y=u.list,g=d.getAt,h=d.style,m,b,I;function R(){T(),s(window,"resize load",lu(qt(l,Hi))),o([sn,en],T),o(Hi,q)}function T(){m=n.direction===Lr,xn(p,"maxWidth",ii(n.width)),xn(v,c("paddingLeft"),F(!1)),xn(v,c("paddingRight"),F(!0)),q(!0)}function q(ie){var S=mn(p);(ie||b.width!==S.width||b.height!==S.height)&&(xn(v,"height",V()),h(c("marginRight"),ii(n.gap)),h("width",L()),h("height",O(),!0),b=S,l(br),I!==(I=z())&&(Mn(p,vc,I),l(au,I)))}function F(ie){var S=n.padding,M=c(ie?"right":"left");return S&&ii(S[M]||(go(S)?0:S))||"0px"}function V(){var ie="";return m&&(ie=A(),co(ie,"height or heightRatio is missing."),ie="calc("+ie+" - "+F(!1)+" - "+F(!0)+")"),ie}function A(){return ii(n.height||mn(y).width*n.heightRatio)}function L(){return n.autoWidth?null:ii(n.fixedWidth)||(m?"":x())}function O(){return ii(n.fixedHeight)||(m?n.autoHeight?null:x():A())}function x(){var ie=ii(n.gap);return"calc((100%"+(ie&&" + "+ie)+")/"+(n.perPage||1)+(ie&&" - "+ie)+")"}function W(){return mn(y)[c("width")]}function E(ie,S){var M=g(ie||0);return M?mn(M.slide)[c("width")]+(S?0:K()):0}function J(ie,S){var M=g(ie);if(M){var D=mn(M.slide)[c("right")],le=mn(y)[c("left")];return cn(D-le)+(S?0:K())}return 0}function P(ie){return J(e.length-1)-J(0)+E(0,ie)}function K(){var ie=g(0);return ie&&parseFloat(xn(ie.slide,c("marginRight")))||0}function B(ie){return parseFloat(xn(v,c("padding"+(ie?"Right":"Left"))))||0}function z(){return e.is(Ao)||P(!0)>W()}return{mount:R,resize:q,listSize:W,slideSize:E,sliderSize:P,totalSize:J,getPadding:B,isOverflow:z}}var Iu=2;function Eu(e,t,n){var i=Yt(e),o=i.on,s=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(en,v),o([sn,Hi],g),(u=b())&&(h(u),t.Layout.resize(!0))}function v(){y(),p()}function y(){hi(c),Wn(c),i.destroy()}function g(){var I=b();u!==I&&(u<I||!I)&&i.emit(en)}function h(I){var R=l.get().slice(),T=R.length;if(T){for(;R.length<I;)ir(R,R);ir(R.slice(-I),R.slice(0,I)).forEach(function(q,F){var V=F<I,A=m(q.slide,F);V?_a(A,R[0].slide):Eo(s.list,A),ir(c,A),l.register(A,F-I+(V?0:T),q.index)})}}function m(I,R){var T=I.cloneNode(!0);return Tn(T,n.classes.clone),T.id=e.root.id+"-clone"+Oa(R+1),T}function b(){var I=n.clones;if(!e.is(Zi))I=0;else if(Ro(I)){var R=n[d("fixedWidth")]&&t.Layout.slideSize(0),T=R&&xo(mn(s.track)[d("width")]/R);I=T||n[d("autoWidth")]&&e.length||n.perPage*Iu}return I}return{mount:p,destroy:y}}function Mu(e,t,n){var i=Yt(e),o=i.on,s=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,v=d.listSize,y=d.sliderSize,g=t.Direction,h=g.resolve,m=g.orient,b=t.Elements,I=b.list,R=b.track,T;function q(){T=t.Transition,o([Jn,br,sn,en],F)}function F(){t.Controller.isBusy()||(t.Scroll.cancel(),A(e.index),t.Slides.update())}function V(M,D,le,oe){M!==D&&ie(M>le)&&(W(),L(x(P(),M>le),!0)),l(Ki),s(_n,D,le,M),T.start(D,function(){l(_i),s(Yi,D,le,M),oe&&oe()})}function A(M){L(J(M,!0))}function L(M,D){if(!e.is(Ao)){var le=D?M:O(M);xn(I,"transform","translate"+h("X")+"("+le+"px)"),M!==le&&s(ac)}}function O(M){if(e.is(Zi)){var D=E(M),le=D>t.Controller.getEnd(),oe=D<0;(oe||le)&&(M=x(M,le))}return M}function x(M,D){var le=M-z(D),oe=y();return M-=m(oe*(xo(cn(le)/oe)||1))*(D?1:-1),M}function W(){L(P(),!0),T.cancel()}function E(M){for(var D=t.Slides.get(),le=0,oe=1/0,$=0;$<D.length;$++){var ae=D[$].index,k=cn(J(ae,!0)-M);if(k<=oe)oe=k,le=ae;else break}return le}function J(M,D){var le=m(p(M-1)-B(M));return D?K(le):le}function P(){var M=h("left");return mn(I)[M]-mn(R)[M]+m(u(!1))}function K(M){return n.trimSpace&&e.is(Ni)&&(M=Ri(M,0,m(y(!0)-v()))),M}function B(M){var D=n.focus;return D==="center"?(v()-c(M,!0))/2:+D*c(M)||0}function z(M){return J(M?t.Controller.getEnd():0,!!n.trimSpace)}function ie(M){var D=m(x(P(),M));return M?D>=0:D<=I[h("scrollWidth")]-mn(R)[h("width")]}function S(M,D){D=Ro(D)?P():D;var le=M!==!0&&m(D)<m(z(!1)),oe=M!==!1&&m(D)>m(z(!0));return le||oe}return{mount:q,move:V,jump:A,translate:L,shift:x,cancel:W,toIndex:E,toPosition:J,getPosition:P,getLimit:z,exceededLimit:S,reposition:F}}function Pu(e,t,n){var i=Yt(e),o=i.on,s=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,v=p.isEnough,y=p.getLength,g=n.omitEnd,h=e.is(Zi),m=e.is(Ni),b=qt(P,!1),I=qt(P,!0),R=n.start||0,T,q=R,F,V,A;function L(){O(),o([sn,en,pr],O),o(br,x)}function O(){F=y(!0),V=n.perMove,A=n.perPage,T=ie();var k=Ri(R,0,g?T:F-1);k!==R&&(R=k,l.reposition())}function x(){T!==ie()&&s(pr)}function W(k,te,X){if(!ae()){var ve=J(k),Pe=z(ve);Pe>-1&&(te||Pe!==R)&&(le(Pe),l.move(ve,Pe,q,X))}}function E(k,te,X,ve){t.Scroll.scroll(k,te,X,function(){var Pe=z(l.toIndex(d()));le(g?Un(Pe,T):Pe),ve&&ve()})}function J(k){var te=R;if(qn(k)){var X=k.match(/([+\-<>])(\d+)?/)||[],ve=X[1],Pe=X[2];ve==="+"||ve==="-"?te=K(R+ +(""+ve+(+Pe||1)),R):ve===">"?te=Pe?S(+Pe):b(!0):ve==="<"&&(te=I(!0))}else te=h?k:Ri(k,0,T);return te}function P(k,te){var X=V||($()?1:A),ve=K(R+X*(k?-1:1),R,!(V||$()));return ve===-1&&m&&!Gl(d(),c(!k),1)?k?0:T:te?ve:z(ve)}function K(k,te,X){if(v()||$()){var ve=B(k);ve!==k&&(te=k,k=ve,X=!1),k<0||k>T?!V&&(or(0,k,te,!0)||or(T,te,k,!0))?k=S(M(k)):h?k=X?k<0?-(F%A||A):F:k:n.rewind?k=k<0?T:0:k=-1:X&&k!==te&&(k=S(M(te)+(k<te?-1:1)))}else k=-1;return k}function B(k){if(m&&n.trimSpace==="move"&&k!==R)for(var te=d();te===u(k,!0)&&or(k,0,e.length-1,!n.rewind);)k<R?--k:++k;return k}function z(k){return h?(k+F)%F||0:k}function ie(){for(var k=F-($()||h&&V?1:A);g&&k-- >0;)if(u(F-1,!0)!==u(k,!0)){k++;break}return Ri(k,0,F-1)}function S(k){return Ri($()?k:A*k,0,T)}function M(k){return $()?Un(k,T):ur((k>=T?F-1:k)/A)}function D(k){var te=l.toIndex(k);return m?Ri(te,0,T):te}function le(k){k!==R&&(q=R,R=k)}function oe(k){return k?q:R}function $(){return!Ro(n.focus)||n.isNavigation}function ae(){return e.state.is([Ki,Lo])&&!!n.waitForTransition}return{mount:L,go:W,scroll:E,getNext:b,getPrev:I,getAdjacent:P,getEnd:ie,setIndex:le,getIndex:oe,toIndex:S,toPage:M,toDest:D,hasFocus:$,isBusy:ae}}var ku="http://www.w3.org/2000/svg",Au="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",Do=40;function Fu(e,t,n){var i=Yt(e),o=i.on,s=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,v=u.arrows,y=u.track,g=v,h=u.prev,m=u.next,b,I,R={};function T(){F(),o(sn,q)}function q(){V(),T()}function F(){var E=n.arrows;E&&!(h&&m)&&O(),h&&m&&(yo(R,{prev:h,next:m}),vo(g,E?"":"none"),Tn(g,I=Ka+"--"+n.direction),E&&(A(),W(),$t([h,m],ko,y.id),l(ec,h,m)))}function V(){i.destroy(),Pn(g,I),b?(hi(v?[h,m]:g),h=m=null):Ln([h,m],Xa)}function A(){o([Jn,Yi,en,vi,pr],W),s(m,"click",qt(L,">")),s(h,"click",qt(L,"<"))}function L(E){p.go(E,!0)}function O(){g=v||ki("div",d.arrows),h=x(!0),m=x(!1),b=!0,Eo(g,[h,m]),!v&&_a(g,y)}function x(E){var J='<button class="'+d.arrow+" "+(E?d.prev:d.next)+'" type="button"><svg xmlns="'+ku+'" viewBox="0 0 '+Do+" "+Do+'" width="'+Do+'" height="'+Do+'" focusable="false"><path d="'+(n.arrowPath||Au)+'" />';return Bl(J)}function W(){if(h&&m){var E=e.index,J=p.getPrev(),P=p.getNext(),K=J>-1&&E<J?c.last:c.prev,B=P>-1&&E>P?c.first:c.next;h.disabled=J<0,m.disabled=P<0,$t(h,hn,K),$t(m,hn,B),l(tc,h,m,J,P)}}return{arrows:R,mount:T,destroy:V,update:W}}var Wu=Na+"-interval";function _u(e,t,n){var i=Yt(e),o=i.on,s=i.bind,l=i.emit,d=Sr(n.interval,e.go.bind(e,">"),A),c=d.isPaused,u=t.Elements,p=t.Elements,v=p.root,y=p.toggle,g=n.autoplay,h,m,b=g==="pause";function I(){g&&(R(),y&&$t(y,ko,u.track.id),b||T(),V())}function R(){n.pauseOnHover&&s(v,"mouseenter mouseleave",function(O){h=O.type==="mouseenter",F()}),n.pauseOnFocus&&s(v,"focusin focusout",function(O){m=O.type==="focusin",F()}),y&&s(y,"click",function(){b?T():q(!0)}),o([_n,wr,en],d.rewind),o(_n,L)}function T(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),m=h=b=!1,V(),l(Ba))}function q(O){O===void 0&&(O=!0),b=!!O,V(),c()||(d.pause(),l(Va))}function F(){b||(h||m?q(!1):T())}function V(){y&&(Mn(y,fi,!b),$t(y,hn,n.i18n[b?"play":"pause"]))}function A(O){var x=u.bar;x&&xn(x,"width",O*100+"%"),l(oc,O)}function L(O){var x=t.Slides.getAt(O);d.set(x&&+bn(x.slide,Wu)||n.interval)}return{mount:I,destroy:d.cancel,play:T,pause:q,isPaused:c}}function Hu(e,t,n){var i=Yt(e),o=i.on;function s(){n.cover&&(o(Ga,qt(d,!0)),o([Jn,sn,en],qt(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Mo(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),vo(u,c?"none":"")}return{mount:s,destroy:qt(l,!1)}}var Nu=10,Ou=600,Du=.6,ju=1.5,zu=800;function Bu(e,t,n){var i=Yt(e),o=i.on,s=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,v=d.translate,y=e.is(Ni),g,h,m=1;function b(){o(_n,q),o([sn,en],F)}function I(A,L,O,x,W){var E=c();if(q(),O&&(!y||!p())){var J=t.Layout.sliderSize(),P=xa(A)*J*ur(cn(A)/J)||0;A=d.toPosition(t.Controller.toDest(A%J))+P}var K=Gl(E,A,1);m=1,L=K?0:L||dr(cn(A-E)/ju,zu),h=x,g=Sr(L,R,qt(T,E,A,W),1),l(Lo),s(wr),g.start()}function R(){l(_i),h&&h(),s(vi)}function T(A,L,O,x){var W=c(),E=A+(L-A)*V(x),J=(E-W)*m;v(W+J),y&&!O&&p()&&(m*=Du,cn(J)<Nu&&I(u(p(!0)),Ou,!1,h,!0))}function q(){g&&g.cancel()}function F(){g&&!g.isPaused()&&(q(),R())}function V(A){var L=n.easingFunc;return L?L(A):1-Math.pow(1-A,4)}return{mount:b,destroy:q,scroll:I,cancel:F}}var Ii={passive:!1,capture:!0};function Vu(e,t,n){var i=Yt(e),o=i.on,s=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,v=t.Controller,y=t.Elements.track,g=t.Media.reduce,h=t.Direction,m=h.resolve,b=h.orient,I=u.getPosition,R=u.exceededLimit,T,q,F,V,A,L=!1,O,x,W;function E(){l(y,zr,ya,Ii),l(y,Br,ya,Ii),l(y,xc,P,Ii),l(y,"click",z,{capture:!0}),l(y,"dragstart",En),o([Jn,sn],J)}function J(){var U=n.drag;ce(!U),V=U==="free"}function P(U){if(O=!1,!x){var Y=Pe(U);ve(U.target)&&(Y||!U.button)&&(v.isBusy()?En(U,!0):(W=Y?y:window,A=c.is([Ki,Lo]),F=null,l(W,zr,K,Ii),l(W,Br,B,Ii),u.cancel(),p.cancel(),ie(U)))}}function K(U){if(c.is(nr)||(c.set(nr),s(Zl)),U.cancelable)if(A){u.translate(T+X($(U)));var Y=ae(U)>Ts,Z=L!==(L=R());(Y||Z)&&ie(U),O=!0,s(Jl),En(U)}else D(U)&&(A=M(U),En(U))}function B(U){c.is(nr)&&(c.set(_i),s(Ql)),A&&(S(U),En(U)),d(W,zr,K),d(W,Br,B),A=!1}function z(U){!x&&O&&En(U,!0)}function ie(U){F=q,q=U,T=I()}function S(U){var Y=le(U),Z=oe(Y),We=n.rewind&&n.rewindByDrag;g(!1),V?v.scroll(Z,0,n.snap):e.is(Ao)?v.go(b(xa(Y))<0?We?"<":"-":We?">":"+"):e.is(Ni)&&L&&We?v.go(R(!0)?">":"<"):v.go(v.toDest(Z),!0),g(!0)}function M(U){var Y=n.dragMinThreshold,Z=go(Y),We=Z&&Y.mouse||0,$e=(Z?Y.touch:+Y)||10;return cn($(U))>(Pe(U)?$e:We)}function D(U){return cn($(U))>cn($(U,!0))}function le(U){if(e.is(Zi)||!L){var Y=ae(U);if(Y&&Y<Ts)return $(U)/Y}return 0}function oe(U){return I()+xa(U)*Un(cn(U)*(n.flickPower||600),V?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function $(U,Y){return te(U,Y)-te(k(U),Y)}function ae(U){return va(U)-va(k(U))}function k(U){return q===U&&F||q}function te(U,Y){return(Pe(U)?U.changedTouches[0]:U)["page"+m(Y?"Y":"X")]}function X(U){return U/(L&&e.is(Ni)?$u:1)}function ve(U){var Y=n.noDrag;return!ho(U,"."+gc+", ."+Ir)&&(!Y||!ho(U,Y))}function Pe(U){return typeof TouchEvent<"u"&&U instanceof TouchEvent}function he(){return A}function ce(U){x=U}return{mount:E,disable:ce,isDragging:he}}var Gu={Spacebar:" ",Right:Tr,Left:Cr,Up:sc,Down:lc};function Ya(e){return e=qn(e)?e:e.key,Gu[e]||e}var Ls="keydown";function qu(e,t,n){var i=Yt(e),o=i.on,s=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function v(){y(),o(sn,g),o(sn,y),o(_n,m)}function y(){var I=n.keyboard;I&&(u=I==="global"?window:d,s(u,Ls,b))}function g(){l(u,Ls)}function h(I){p=I}function m(){var I=p;p=!0,Nl(function(){p=I})}function b(I){if(!p){var R=Ya(I);R===c(Cr)?e.go("<"):R===c(Tr)&&e.go(">")}}return{mount:v,destroy:g,disable:h}}var uo=Na+"-lazy",rr=uo+"-srcset",Uu="["+uo+"], ["+rr+"]";function Xu(e,t,n){var i=Yt(e),o=i.on,s=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[Yi,vi],p=[];function v(){n.lazyLoad&&(y(),o(en,y))}function y(){Wn(p),g(),c?I():(s(u),o(u,h),h())}function g(){t.Slides.forEach(function(R){Ha(R.slide,Uu).forEach(function(T){var q=bn(T,uo),F=bn(T,rr);if(q!==T.src||F!==T.srcset){var V=n.classes.spinner,A=T.parentElement,L=Mo(A,"."+V)||ki("span",V,A);p.push([T,R,L]),T.src||vo(T,"none")}})})}function h(){p=p.filter(function(R){var T=n.perPage*((n.preloadPages||1)+1)-1;return R[1].isWithin(e.index,T)?m(R):!0}),p.length||s(u)}function m(R){var T=R[0];Tn(R[1].slide,$a),l(T,"load error",qt(b,R)),$t(T,"src",bn(T,uo)),$t(T,"srcset",bn(T,rr)),Ln(T,uo),Ln(T,rr)}function b(R,T){var q=R[0],F=R[1];Pn(F.slide,$a),T.type!=="error"&&(hi(R[2]),vo(q,""),d(Ga,q,F),d(Hi)),c&&I()}function I(){p.length&&m(p.shift())}return{mount:v,destroy:qt(Wn,p),check:h}}function Ku(e,t,n){var i=Yt(e),o=i.on,s=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,v=u.getIndex,y=u.go,g=t.Direction.resolve,h=c.pagination,m=[],b,I;function R(){T(),o([sn,en,pr],R);var x=n.pagination;h&&vo(h,x?"":"none"),x&&(o([_n,wr,vi],O),q(),O(),s(nc,{list:b,items:m},L(e.index)))}function T(){b&&(hi(h?Zn(b.children):b),Pn(b,I),Wn(m),b=null),i.destroy()}function q(){var x=e.length,W=n.classes,E=n.i18n,J=n.perPage,P=p()?u.getEnd()+1:xo(x/J);b=h||ki("ul",W.pagination,c.track.parentElement),Tn(b,I=Er+"--"+A()),$t(b,kn,"tablist"),$t(b,hn,E.select),$t(b,Ua,A()===Lr?"vertical":"");for(var K=0;K<P;K++){var B=ki("li",null,b),z=ki("button",{class:W.page,type:"button"},B),ie=d.getIn(K).map(function(M){return M.slide.id}),S=!p()&&J>1?E.pageX:E.slideX;l(z,"click",qt(F,K)),n.paginationKeyboard&&l(z,"keydown",qt(V,K)),$t(B,kn,"presentation"),$t(z,kn,"tab"),$t(z,ko,ie.join(" ")),$t(z,hn,ba(S,K+1)),$t(z,Ai,-1),m.push({li:B,button:z,page:K})}}function F(x){y(">"+x,!0)}function V(x,W){var E=m.length,J=Ya(W),P=A(),K=-1;J===g(Tr,!1,P)?K=++x%E:J===g(Cr,!1,P)?K=(--x+E)%E:J==="Home"?K=0:J==="End"&&(K=E-1);var B=m[K];B&&(zl(B.button),y(">"+K),En(W,!0))}function A(){return n.paginationDirection||n.direction}function L(x){return m[u.toPage(x)]}function O(){var x=L(v(!0)),W=L(v());if(x){var E=x.button;Pn(E,fi),Ln(E,bs),$t(E,Ai,-1)}if(W){var J=W.button;Tn(J,fi),$t(J,bs,!0),$t(J,Ai,"")}s(ic,{list:b,items:m},x,W)}return{items:m,mount:R,destroy:T,getAt:L,update:O}}var Yu=[" ","Enter"];function Zu(e,t,n){var i=n.isNavigation,o=n.slideFocus,s=[];function l(){e.splides.forEach(function(h){h.isParent||(u(e,h.splide),u(h.splide,e))}),i&&p()}function d(){s.forEach(function(h){h.destroy()}),Wn(s)}function c(){d(),l()}function u(h,m){var b=Yt(h);b.on(_n,function(I,R,T){m.go(m.is(Zi)?T:I)}),s.push(b)}function p(){var h=Yt(e),m=h.on;m(Da,y),m(rc,g),m([Jn,sn],v),s.push(h),h.emit(za,e.splides)}function v(){$t(t.Elements.list,Ua,n.direction===Lr?"vertical":"")}function y(h){e.go(h.index)}function g(h,m){Wa(Yu,Ya(m))&&(y(h),En(m))}return{setup:qt(t.Media.set,{slideFocus:Ro(o)?i:o},!0),mount:l,destroy:d,remount:c}}function Ju(e,t,n){var i=Yt(e),o=i.bind,s=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,Ii)}function d(u){if(u.cancelable){var p=u.deltaY,v=p<0,y=va(u),g=n.wheelMinThreshold||0,h=n.wheelSleep||0;cn(p)>g&&y-s>h&&(e.go(v?"<":">"),s=y),c(v)&&En(u)}}function c(u){return!n.releaseWheel||e.state.is(Ki)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var Qu=90;function ep(e,t,n){var i=Yt(e),o=i.on,s=t.Elements.track,l=n.live&&!n.isNavigation,d=ki("span",vu),c=Sr(Qu,qt(p,!1));function u(){l&&(y(!t.Autoplay.isPaused()),$t(s,$s,!0),d.textContent="…",o(Ba,qt(y,!0)),o(Va,qt(y,!1)),o([Yi,vi],qt(p,!0)))}function p(g){$t(s,Ss,g),g?(Eo(s,d),c.start()):(hi(d),c.cancel())}function v(){Ln(s,[ws,$s,Ss]),hi(d)}function y(g){l&&$t(s,ws,g?"off":"polite")}return{mount:u,disable:y,destroy:v}}var tp=Object.freeze({__proto__:null,Media:cu,Direction:du,Elements:Cu,Slides:Lu,Layout:Ru,Clones:Eu,Move:Mu,Controller:Pu,Arrows:Fu,Autoplay:_u,Cover:Hu,Scroll:Bu,Drag:Vu,Keyboard:qu,LazyLoad:Xu,Pagination:Ku,Sync:Zu,Wheel:Ju,Live:ep}),np={prev:"Previous slide",next:"Next slide",first:"Go to first slide",last:"Go to last slide",slideX:"Go to slide %s",pageX:"Go to page %s",play:"Start autoplay",pause:"Pause autoplay",carousel:"carousel",slide:"slide",select:"Select a slide to show",slideLabel:"%s of %s"},ip={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:wu,i18n:np,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function op(e,t,n){var i=t.Slides;function o(){Yt(e).on([Jn,en],s)}function s(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function l(d,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),Nl(c)}return{mount:o,start:l,cancel:ya}}function rp(e,t,n){var i=t.Move,o=t.Controller,s=t.Scroll,l=t.Elements.list,d=qt(xn,l,"transition"),c;function u(){Yt(e).bind(l,"transitionend",function(g){g.target===l&&c&&(v(),c())})}function p(g,h){var m=i.toPosition(g,!0),b=i.getPosition(),I=y(g);cn(m-b)>=1&&I>=1?n.useScroll?s.scroll(m,I,!1,h):(d("transform "+I+"ms "+n.easing),i.translate(m,!0),c=h):(i.jump(g),h())}function v(){d(""),s.cancel()}function y(g){var h=n.rewindSpeed;if(e.is(Ni)&&h){var m=o.getIndex(!0),b=o.getEnd();if(m===0&&g>=b||m>=b&&g===0)return h}return n.speed}return{mount:u,start:p,cancel:v}}var ap=(function(){function e(n,i){this.event=Yt(),this.Components={},this.state=su(Pi),this.splides=[],this._o={},this._E={};var o=qn(n)?Vl(document,n):n;co(o,o+" is invalid."),this.root=o,i=zn({label:bn(o,hn)||"",labelledby:bn(o,qa)||""},ip,e.defaults,i||{});try{zn(i,JSON.parse(bn(o,Na)))}catch{co(!1,"Invalid JSON")}this._o=Object.create(zn({},i))}var t=e.prototype;return t.mount=function(i,o){var s=this,l=this.state,d=this.Components;co(l.is([Pi,cr]),"Already mounted!"),l.set(Pi),this._C=d,this._T=o||this._T||(this.is(Ao)?op:rp),this._E=i||this._E;var c=yo({},tp,this._E,{Transition:this._T});return mi(c,function(u,p){var v=u(s,d,s._o);d[p]=v,v.setup&&v.setup()}),mi(d,function(u){u.mount&&u.mount()}),this.emit(Jn),Tn(this.root,xu),l.set(_i),this.emit(wa),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(_i)&&(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(Zn(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,s=this.state;return s.is(Pi)?Yt(this).on(wa,this.destroy.bind(this,i)):(mi(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(ja),o.destroy(),i&&Wn(this.splides),s.set(cr)),this},nu(e,[{key:"options",get:function(){return this._o},set:function(i){this._C.Media.set(i,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),Za=ap;Za.defaults={};Za.STATES=ou;var Rs=[[Jn,"onMounted"],[wa,"onReady"],[_n,"onMove"],[Yi,"onMoved"],[Da,"onClick"],[Ul,"onActive"],[Xl,"onInactive"],[Kl,"onVisible"],[Yl,"onHidden"],[en,"onRefresh"],[sn,"onUpdated"],[Hi,"onResize"],[br,"onResized"],[Zl,"onDrag"],[Jl,"onDragging"],[Ql,"onDragged"],[wr,"onScroll"],[vi,"onScrolled"],[ja,"onDestroy"],[ec,"onArrowsMounted"],[tc,"onArrowsUpdated"],[nc,"onPaginationMounted"],[ic,"onPaginationUpdated"],[za,"onNavigationMounted"],[Ba,"onAutoplayPlay"],[oc,"onAutoplayPlaying"],[Va,"onAutoplayPause"],[Ga,"onLazyLoadLoaded"]];function Ja(...e){return e.filter(Boolean).join(" ")}function mr(e){return e!==null&&typeof e=="object"}function Ca(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!Ca(n,t[i]));if(mr(e)&&mr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Ca(e[o],t[o]))}return e===t}function sp(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function lp(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 Ta(e,t){const n=e;return lp(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():mr(i)?n[o]=Ta(mr(n[o])?n[o]:{},i):n[o]=i}),n}var cp=({children:e,className:t,...n})=>a.createElement("div",{className:Ja("splide__track",t),...n},a.createElement("ul",{className:"splide__list"},e)),Qa=class extends a.Component{constructor(){super(...arguments),this.splideRef=a.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new Za(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Ta({},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&&!Ca(this.options,e)&&(this.splide.options=e,this.options=Ta({},e));const t=this.getSlides();sp(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){Rs.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 a.createElement(t,{className:Ja("splide",e),ref:this.splideRef,...this.omit(o,["options",...Rs.map(s=>s[1])])},n?a.createElement(cp,null,i):i)}},es=({children:e,className:t,...n})=>a.createElement("li",{className:Ja("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 sp="RichTextRenderer-module__link___BWeZ2",lp={link:sp},cp=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))},Er=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>cp(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function on(e){const{color:t,...n}=e;return n}function qt(e,t){var o,s,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:Er(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:S.scalingValue(e.letterSpacing,t),wordSpacing:S.scalingValue(e.wordSpacing,t),fontSize:S.scalingValue(n,t),lineHeight:i!==void 0?S.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(s=e.textAppearance)==null?void 0:s.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}const yi=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:lp.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:dp(i),children:i.text},o));return r.jsx(r.Fragment,{children:e.map((n,i)=>{const o=n.children;return r.jsx("div",{children:t(o)},i)})})};function dp(e){return{...e.fontFamily&&{fontFamily:Er(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 up="SvgImage-module__svg___q3xE-",pp="SvgImage-module__img___VsTm-",Ts={svg:up,img:pp},mp=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},gp=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,rn=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[s,l]=a.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return a.useEffect(()=>{if(typeof window<"u"&&window.CSS){const d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');l(d)}},[]),!mp(e)||!s?r.jsx("img",{src:e,alt:"",className:rt(Ts.img,i),style:o}):r.jsx("span",{"data-supports-mask":s,className:rt(Ts.svg,i),style:{"--svg":gp(e),"--fill":t,"--hover-fill":n,...o??{}}})},hp={"top-left":it.topLeftAlignment,"top-center":it.topCenterAlignment,"top-right":it.topRightAlignment,"middle-left":it.middleLeftAlignment,"middle-center":it.middleCenterAlignment,"middle-right":it.middleRightAlignment,"bottom-left":it.bottomLeftAlignment,"bottom-center":it.bottomCenterAlignment,"bottom-right":it.bottomRightAlignment};function fp({settings:e,content:t,styles:n,isEditor:i}){const[o,s]=a.useState(null),{widthSettings:l,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:p,fontSizeLineHeight:x,textAppearance:v,color:f}=n.imageCaption??{},[h,m]=a.useState(void 0),[b,I]=a.useState(null),[R,T]=a.useState(0),[U,A]=a.useState(0),{direction:B,transition:P,controls:L,pagination:j,imageCaption:w,triggers:W}=e,E=a.useRef(P.type),{x:J,y:F}=e.controls.offset,X=G=>{o&&o.go(G)};return a.useEffect(()=>{if(!b)return;const G=new ResizeObserver(V=>{if(!o)return;const[ie]=V;m({width:Math.round(ie.contentRect.width),height:Math.round(ie.contentRect.height)})});return G.observe(b),()=>G.unobserve(b)},[b]),a.useEffect(()=>{!o||E.current===P.type||(A(G=>G+1),E.current=P.type)},[P.type]),r.jsx("div",{className:rt(it.wrapper,{[it.editor]:i}),ref:I,children:r.jsxs("div",{className:it.sliderInner,style:{width:h?h.width:"100%",height:h?h.height:"100%",backgroundColor:P.backgroundColor&&P.type==="fade in"?P.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:rt(it.captionBlock),children:r.jsx("div",{className:it.captionTextWrapper,children:t.map((G,V)=>r.jsx("div",{className:rt(it.captionText,hp[w.alignment],{[it.withPointerEvents]:V===R&&i,[it.active]:V===R}),style:{fontFamily:Er(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":S.scalingValue(l.width,i),letterSpacing:S.scalingValue(c,i),wordSpacing:S.scalingValue(p,i),textAlign:u,fontSize:S.scalingValue(x.fontSize,i),lineHeight:S.scalingValue(x.lineHeight,i),textTransform:v.textTransform??"none",textDecoration:v.textDecoration??"none",fontVariant:v.fontVariant??"normal",color:f,transitionDuration:P.duration?`${Math.round(parseInt(P.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:it.captionTextInner,style:{"--link-hover-color":w.linkHoverColor,"--link-color":w.linkColor,position:"relative",top:S.scalingValue(w.offset.y,i),left:S.scalingValue(w.offset.x,i)},children:r.jsx(yi,{content:G.imageCaption})})},V))})}),r.jsx(Ya,{onMove:G=>{T(G.index)},ref:s,options:{arrows:!1,speed:P.duration?parseInt(P.duration):500,autoplay:W.autoPlay!==null,...W.autoPlay!==null&&{interval:parseInt(W.autoPlay)*1e3},direction:B==="horiz"||P.type==="fade in"?"ltr":"ttb",pagination:!1,drag:W.triggersList.drag,perPage:1,width:h?h.width:"100%",height:h?h.height:"100%",type:P.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((G,V)=>r.jsx(Za,{children:r.jsx("div",{className:it.sliderItem,children:r.jsx("div",{className:it.imgWrapper,children:r.jsx("img",{className:rt(it.sliderImage,{[it.contain]:G.image.objectFit==="contain",[it.cover]:G.image.objectFit==="cover"}),src:G.image.url,alt:G.image.name??""})})})},V))},U),L.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:rt(it.arrow,{[it.arrowVertical]:B==="vert",[it.hoverArrow]:L.show==="on hover"}),style:{color:L.color,"--arrow-hover-color":L.hover},children:r.jsxs("button",{onClick:()=>{X("-1")},className:it.arrowInner,style:{transform:`translate(${S.scalingValue(J,i)}, ${S.scalingValue(F*(B==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[L.arrowsImgUrl&&r.jsx(rn,{url:L.arrowsImgUrl,fill:L.color,hoverFill:L.hover,className:rt(it.arrowImg,it.mirror)}),!L.arrowsImgUrl&&r.jsx(Ls,{color:L.color,className:rt(it.arrowIcon,it.arrowImg,it.mirror)})]})}),r.jsx("div",{className:rt(it.arrow,it.nextArrow,{[it.arrowVertical]:B==="vert",[it.hoverArrow]:L.show==="on hover"}),style:{color:L.color,"--arrow-hover-color":L.hover},children:r.jsxs("button",{className:it.arrowInner,onClick:()=>X("+1"),style:{transform:`translate(${S.scalingValue(J*(B==="horiz"?-1:1),i)}, ${S.scalingValue(F,i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[L.arrowsImgUrl&&r.jsx(rn,{url:L.arrowsImgUrl,fill:L.color,hoverFill:L.hover,className:it.arrowImg}),!L.arrowsImgUrl&&r.jsx(Ls,{color:L.color,className:rt(it.arrowIcon,it.arrowImg)})]})})]}),W.triggersList.click&&r.jsx("div",{className:it.clickOverlay,onClick:()=>{o&&o.go("+1")}}),j.isActive&&r.jsx("div",{className:rt(it.pagination,{[it.paginationInsideBottom]:j.position==="inside-1"&&B==="horiz",[it.paginationInsideTop]:j.position==="inside-2"&&B==="horiz",[it.paginationOutsideBottom]:j.position==="outside-1"&&B==="horiz",[it.paginationOutsideTop]:j.position==="outside-2"&&B==="horiz",[it.paginationInsideLeft]:j.position==="inside-1"&&B==="vert",[it.paginationInsideRight]:j.position==="inside-2"&&B==="vert",[it.paginationOutsideLeft]:j.position==="outside-1"&&B==="vert",[it.paginationOutsideRight]:j.position==="outside-2"&&B==="vert",[it.paginationVertical]:B==="vert"}),children:r.jsx("div",{className:it.paginationInner,style:{backgroundColor:j.colors[2],transform:`scale(${j.scale/100}) translate(${S.scalingValue(j.offset.x,i)}, ${S.scalingValue(j.offset.y,i)}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:t.map((G,V)=>r.jsx("button",{onClick:()=>{o&&o.go(V)},className:rt(it.paginationItem),children:r.jsx("div",{className:rt(it.dot,{[it.activeDot]:V===R}),style:{backgroundColor:V===R?j.colors[0]:j.colors[1],"--pagination-hover-color":j.hover}})},V))})})]})})}function Ls({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.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 yp={element:fp,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"]}},vp="ImageRevealSlider-module__imageRevealSlider___UE5Ob",bp="ImageRevealSlider-module__image___Qjt-e",xp="ImageRevealSlider-module__link___N-iLG",wp="ImageRevealSlider-module__cursor___2U03d",wi={imageRevealSlider:vp,image:bp,link:xp,cursor:wp};function Rs(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const s=i.width?Number.parseFloat(i.width):o.naturalWidth,l=o.naturalHeight/o.naturalWidth*s,d=s/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 Br(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Sp(e,t,n,i){let o,s;if(t==="custom"){o=n;const l=await Br(e);s=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await Br(e);s=l.height/l.width*o}else{const l=await Br(e);o=l.width,s=l.height}return{width:o,height:s,finalWidth:`${o}px`}}function $p({settings:e,content:t,isEditor:n}){const[i,o]=a.useState(null),[s,l]=a.useState([]),[d,c]=a.useState(0),u=a.useRef(0),[p,x]=a.useState({x:0,y:0}),[v,f]=a.useState(1),[h,m]=a.useState("none"),b=a.useRef({x:0,y:0}),[I,R]=a.useState(!1),{sizeType:T,imageWidth:U,randomRangeImageWidth:A}=e.imageSize,{revealPosition:B,visible:P}=e.position,{cursorType:L,target:j,defaultCursorScale:w,defaultCursor:W,hoverCursorScale:E,hoverCursor:J}=e.cursor;a.useEffect(()=>{if(!i)return;const G=(C,M)=>{const O=i.getBoundingClientRect(),re=C-O.left,ne=M-O.top;if(x({x:re,y:ne}),L==="system"){m("none"),f(1);return}const $=re,ae=ne,k=document.elementFromPoint(O.left+$,O.top+ae);if(k&&k.closest("a")){m("none"),f(1);return}const te=Rs($,ae,s)||j==="area"?{img:J??"none",scale:E}:{img:W??"none",scale:w};m(te.img),f(te.scale)},V=C=>{C.stopPropagation(),b.current={x:C.clientX,y:C.clientY},G(C.clientX,C.clientY)},ie=()=>{I&&G(b.current.x,b.current.y)};return i.addEventListener("mousemove",V),window.addEventListener("scroll",ie,!0),()=>{i.removeEventListener("mousemove",V),window.removeEventListener("scroll",ie,!0)}},[i,I,p,L,j,J,W,E,w,s]),a.useEffect(()=>{I||(m("none"),f(0))},[I]);const F=async(G,V,ie,C={})=>{const{width:M,height:O,finalWidth:re}=await Sp(G.image.url,T,U,A);let ne=0,$=0;B==="same"?(ne=V/2,$=ie/2):(ne=C.x??Math.random()*V,$=C.y??Math.random()*ie);const ae=Math.min(Math.max(ne,M/2),V-M/2),k=Math.min(Math.max($,O/2),ie-O/2);return{id:u.current++,url:G.image.url,link:G.link,name:G.image.name,x:ae,y:k,width:re}};a.useEffect(()=>{if(!i||t.length===0)return;const G=i.getBoundingClientRect(),V=G.width,ie=G.height,C=[];(async()=>{const O=t[0],re=await F(O,V,ie);C.push(re),l(C),c(1)})()},[T,U,A,B,i]),a.useEffect(()=>{P==="last One"&&l(G=>G.length>0?[G[G.length-1]]:[])},[P]);const X=async G=>{if(!i)return;const V=i.getBoundingClientRect(),ie=G.clientX-V.left,C=G.clientY-V.top;if(j==="image"&&!Rs(ie,C,s))return;let M=0,O=0;B==="on Click"?(M=ie,O=C):B==="same"?(M=V.width/2,O=V.height/2):(M=Math.random()*V.width,O=Math.random()*V.height);const re=t[d],ne=await F(re,V.width,V.height,{x:M,y:O});l($=>P==="all"?[...$,ne]:[ne]),c($=>$>=t.length-1?0:$+1)};return r.jsxs("div",{ref:o,onClick:X,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),className:wi.imageRevealSlider,style:{cursor:h==="none"?"default":"none"},children:[s.map(G=>r.jsx("div",{className:wi.wrapper,style:{top:`${G.y}px`,left:`${G.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:G.width??"auto",height:"auto",cursor:h==="none"?"default":"none"},children:j==="area"&&G.link?r.jsx("a",{href:G.link,target:"_blank",className:wi.link,children:r.jsx("img",{src:G.url,alt:G.name,className:wi.image},G.id)}):r.jsx("img",{src:G.url,alt:G.name,className:wi.image},G.id)},G.id)),I&&r.jsx("div",{className:wi.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${v})`,backgroundImage:`url('${h}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Cp={element:$p,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:""}]}}}},Tp="LightBox-module__hidden___9s-9x",Lp="LightBox-module__heroImage___sTxNF",Rp="LightBox-module__background___rm9ml",Ip="LightBox-module__editor___4ACaY",Ep="LightBox-module__contentStyle___Bgnsq",Mp="LightBox-module__imageStyle___tLIlB",Pp="LightBox-module__imgWrapper___LuFUp",kp="LightBox-module__contain___8-yaS",Ap="LightBox-module__cover___hNvOG",Fp="LightBox-module__caption___b6L2I",Wp="LightBox-module__captionTextInner___rCGNH",_p="LightBox-module__lightboxSplide___XFuWC",Hp="LightBox-module__arrow___iz38X",Np="LightBox-module__arrowVertical___Zfz81",Op="LightBox-module__nextArrow___zkAQN",Dp="LightBox-module__arrowInner___p48sW",jp="LightBox-module__arrowIcon___3VaFf",zp="LightBox-module__arrowImg___pNV88",Bp="LightBox-module__mirror___pjeXc",Vp="LightBox-module__thumbsWrapper___GB-nU",Gp="LightBox-module__thumbsContainerVertical___wttk5",Up="LightBox-module__thumbsContainer___osSma",qp="LightBox-module__thumbsAlignStart___MO6tY",Kp="LightBox-module__thumbsAlignCenter___Q4sUx",Xp="LightBox-module__thumbsAlignEnd___p4y9R",Yp="LightBox-module__thumbItem___HvnF3",Zp="LightBox-module__closeButton___g2khP",Jp="LightBox-module__fadeIn___0m5GW",Qp="LightBox-module__slideInLeft___gPYwC",em="LightBox-module__slideInRight___S-pPp",tm="LightBox-module__slideInTop___DFdAj",nm="LightBox-module__slideInBottom___m27kZ",im="LightBox-module__fadeOut___55qBR",om="LightBox-module__slideOutLeft___NvU7P",rm="LightBox-module__slideOutRight___SK7eC",am="LightBox-module__slideOutTop___Vgg0z",sm="LightBox-module__slideOutBottom___nJ0Ef",lm="LightBox-module__scaleSlide___vZriG",Ge={hidden:Tp,heroImage:Lp,background:Rp,editor:Ip,contentStyle:Ep,imageStyle:Mp,imgWrapper:Pp,contain:kp,cover:Ap,caption:Fp,captionTextInner:Wp,lightboxSplide:_p,arrow:Hp,arrowVertical:Np,nextArrow:Op,arrowInner:Dp,arrowIcon:jp,arrowImg:zp,mirror:Bp,thumbsWrapper:Vp,thumbsContainerVertical:Gp,thumbsContainer:Up,thumbsAlignStart:qp,thumbsAlignCenter:Kp,thumbsAlignEnd:Xp,thumbItem:Yp,closeButton:Zp,fadeIn:Jp,slideInLeft:Qp,slideInRight:em,slideInTop:tm,slideInBottom:nm,fadeOut:im,slideOutLeft:om,slideOutRight:rm,slideOutTop:am,slideOutBottom:sm,scaleSlide:lm},Do=(e,t,n)=>{const i={},[o,s]=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"),s==="left"?(i.left="0",i.right="auto"):s==="center"?(i.left="50%",i.right="auto"):s==="right"&&(i.left="auto",i.right="0"),o==="middle"&&s==="center"?i.transform=`translate(calc(-50% + ${S.scalingValue(t.x,n)}), calc(-50% + ${S.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${S.scalingValue(t.x,n)}, calc(-50% + ${S.scalingValue(t.y,n)}))`:s==="center"?i.transform=`translate(calc(-50% + ${S.scalingValue(t.x,n)}), ${S.scalingValue(t.y,n)})`:i.transform=`translate(${S.scalingValue(t.x,n)}, ${S.scalingValue(t.y,n)})`,i};function yc(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 cm(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 vc(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,s=n/i;if(s>o){const d=e;return{renderedW:d,renderedH:d/s}}const l=t;return{renderedW:l*s,renderedH:l}}function dm(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,s=n/i;if(s>o){const d=t;return{renderedW:d*s,renderedH:d}}const l=e;return{renderedW:l,renderedH:l/s}}function bc(e,t,n,i,o){const{x:s,y:l}=cm(o);return{offsetX:s*(e-n),offsetY:l*(t-i)}}function um(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,s=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight,{objectFit:l,objectPosition:d}=window.getComputedStyle(e),c=l==="cover"?dm:vc,{renderedW:u,renderedH:p}=c(n,i,o,s),{offsetX:x,offsetY:v}=bc(n,i,u,p,d),f=(x+u/2)/n*100,h=(v+p/2)/i*100;return`${f}% ${h}%`}function pm(e){return um(e)}function mr(e){const t=e.getBoundingClientRect(),n=yc(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),s=e.naturalWidth,l=e.naturalHeight,{renderedW:d,renderedH:c}=vc(i,o,s,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:x}=bc(i,o,d,c,u),v=t.left+n.left,f=t.top+n.top;return{x:p+v,y:x+f,width:d,height:c}}function Is(e){const t=e.getBoundingClientRect(),n=yc(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Es(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 mm(e,t){const n=(()=>{if(e==="fade in")return Ge.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Ge.slideInLeft;case"right":return Ge.slideInRight;case"top":return Ge.slideInTop;case"bottom":return Ge.slideInBottom;default:return Ge.slideInRight}return Ge.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Ge.fadeIn;if(e==="slide in")switch(t){case"left":return Ge.slideInLeft;case"right":return Ge.slideInRight;case"top":return Ge.slideInTop;case"bottom":return Ge.slideInBottom;default:return Ge.slideInRight}return Ge.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Ge.fadeOut;if(e==="slide in")switch(t){case"left":return Ge.slideOutLeft;case"right":return Ge.slideOutRight;case"top":return Ge.slideOutTop;case"bottom":return Ge.slideOutBottom;default:return Ge.slideOutRight}return Ge.fadeOut})(),s=(()=>{if(e==="fade in")return Ge.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Ge.slideOutLeft;case"right":return Ge.slideOutRight;case"top":return Ge.slideOutTop;case"bottom":return Ge.slideOutBottom;default:return Ge.slideOutRight}return Ge.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:s}}const gm=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:s,isPreviewMode:l})=>{const[d,c]=a.useState(!1),{url:u}=e.thumbnailBlock.cover;return a.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:u,alt:"Cover",className:Ge.heroImage,onClick:()=>c(!0)}),r.jsx(hm,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:s})]})},hm=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:s,isEditor:l,metadata:d})=>{var be;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:x,wordSpacing:v,fontSizeLineHeight:f,textAppearance:h,color:m}=i.imageCaption??{},[b,I]=a.useState(0),[R,T]=a.useState(0),[U,A]=a.useState(!1),[B,P]=a.useState(!1),[L,j]=a.useState({}),w=a.useRef(null),W=a.useRef(null),E=a.useRef(null),J=a.useRef(!1),F=a.useRef(null),X=a.useRef(null),G=a.useRef(null),V=a.useRef(null),ie=a.useRef(!1),C=a.useRef(null),[M,O]=a.useState(!1),{appear:re,triggers:ne,slider:$,thumbnail:ae,controls:k,area:te,caption:K,layout:fe}=o.lightboxBlock,{appearClass:Ie,backdropAppearClass:me,backdropDisappearClass:ue,disappearClass:q}=mm(re.type,re.direction),Q=(d==null?void 0:d.itemId)??null;a.useEffect(()=>{const z=()=>{setTimeout(()=>{var pe,xe;(xe=(pe=w.current)==null?void 0:pe.splide)==null||xe.refresh()},16)},se=()=>{T(pe=>pe+1)};return window.addEventListener("ArticleEditor.Layout:change",z),window.addEventListener("ArticleEditor.ComponentContent:change",se),()=>{window.removeEventListener("ArticleEditor.Layout:change",z),window.removeEventListener("ArticleEditor.ComponentContent:change",se)}},[]),a.useEffect(()=>{if(!e||!ae.isActive){O(!1);return}const z=C.current;if(!z)return;const se=()=>{$.direction==="horiz"?O(z.scrollWidth>z.clientWidth):O(z.scrollHeight>z.clientHeight)};se();const pe=new ResizeObserver(se);return pe.observe(z),()=>pe.disconnect()},[e,ae.isActive,n.length,L,$.direction]);const Y=a.useCallback(()=>{const z=window.matchMedia("(max-width: 768px)").matches,se=Es(te.color);z&&!l&&se>.9&&(document.body.style.backgroundColor=""),A(!0),J.current=!0;const pe=xe=>{xe.target===F.current&&xe.animationName&&(F.current&&X.current&&F.current.removeEventListener("animationend",X.current),X.current=null,J.current&&(J.current=!1,t()),A(!1))};F.current&&(X.current=pe,F.current.addEventListener("animationend",pe))},[t,te.color,l]),Ae=(z,se,pe)=>{var xe,Re;if(z){if(ne.type==="click"&&ne.switch==="image")ne.repeat==="close"&&b===n.length-1?Y():(xe=w.current)==null||xe.go("+1");else if(ne.type==="click"&&ne.switch==="50/50"){const Te=z.getBoundingClientRect(),_=se-Te.left,he=pe-Te.top,oe=Te.width,H=Te.height;let ee;$.direction==="horiz"?ee=_<oe/2?"-1":"+1":ee=he<H/2?"-1":"+1",(Re=w.current)==null||Re.go(ee)}}},Se=z=>{if(ie.current){ie.current=!1;return}const se=n[b],pe=(se==null?void 0:se.image.objectFit)==="cover";let xe,Re;if("changedTouches"in z&&z.changedTouches.length>0)xe=z.changedTouches[0].clientX,Re=z.changedTouches[0].clientY;else if("clientX"in z)xe=z.clientX,Re=z.clientY;else return;let Te;if(pe&&E.current){const _=Is(E.current);Te=xe>=_.left&&xe<=_.right&&Re>=_.top&&Re<=_.bottom}else{const _=E.current?mr(E.current):null;if(!_){z.target===z.currentTarget&&Y();return}Te=xe>=_.x&&xe<=_.x+_.width&&Re>=_.y&&Re<=_.y+_.height}Te?Ae(E.current,xe,Re):Y()},Ee=z=>{const se=z.target;(se.classList.contains(Ge.thumbsWrapper)||se.classList.contains(Ge.thumbsContainer))&&Se(z)};a.useEffect(()=>{if(!e)return;const z=se=>{var pe,xe;if(se.key==="Escape"){Y();return}if(se.key==="ArrowRight"){I(Re=>(Re+1)%Math.max(n.length,1)),(pe=w.current)==null||pe.go("+1");return}se.key==="ArrowLeft"&&(I(Re=>(Re-1+Math.max(n.length,1))%Math.max(n.length,1)),(xe=w.current)==null||xe.go("-1"))};return window.addEventListener("keydown",z),()=>{window.removeEventListener("keydown",z)}},[e,Y,n.length]),a.useEffect(()=>{if(e){if(I(0),T(se=>se+1),J.current=!1,A(!1),P(!1),j({}),!Q)return;const z=new CustomEvent("page-overlay",{detail:{itemId:Q}});window.dispatchEvent(z)}return()=>{F.current&&X.current&&(F.current.removeEventListener("animationend",X.current),X.current=null),P(!1)}},[e,Q]),a.useEffect(()=>{W.current!==null&&W.current!==$.type&&T(z=>z+1),W.current=$.type},[$.type]),a.useEffect(()=>{if(!e)return;const z=document.body.style.overflow,se=window.matchMedia("(max-width: 768px)").matches,pe=Es(te.color);document.body.style.overflow="hidden",P(!1);const xe=Te=>{Te.target===F.current&&!J.current&&Te.animationName&&(se&&!l&&pe>.9&&(document.body.style.backgroundColor=te.color),P(!0),F.current&&G.current&&F.current.removeEventListener("animationend",G.current),G.current=null)};F.current&&(G.current=xe,F.current.addEventListener("animationend",xe));const Re=Te=>{const _=Te.target;_&&(_.closest(`.${Ge.thumbsWrapper}`)||_.closest(`.${Ge.thumbsContainer}`))||$.type!=="slide"&&Te.preventDefault()};return document.addEventListener("touchmove",Re,{passive:!1}),()=>{document.body.style.overflow=z,document.removeEventListener("touchmove",Re),F.current&&G.current&&(F.current.removeEventListener("animationend",G.current),G.current=null),P(!1)}},[e,l,te.color,$.type]),a.useEffect(()=>{if(!e)return;const z=se=>{var xe,Re;if(J.current){se.stopPropagation();return}if(ie.current){ie.current=!1;return}const pe=se.target;if(!(pe&&(pe.closest(`.${Ge.thumbsContainer}`)||pe.closest(`.${Ge.thumbItem}`)||pe.closest(`.${Ge.arrow}`)||pe.closest(`.${Ge.closeButton}`)||pe.closest(`.${Ge.caption}`)))){if($.type==="slide"&&ne.type==="drag"&&((Re=(xe=w.current)==null?void 0:xe.splide)!=null&&Re.root)){const Te=w.current.splide.root;if(pe&&(Te.contains(pe)||Te===pe))return}if(se.touches.length===0&&se.changedTouches.length>0){const Te=n[b],_=(Te==null?void 0:Te.image.objectFit)==="cover",he=se.changedTouches[0];let oe;if(_&&E.current){const H=Is(E.current);oe=he.clientX>=H.left&&he.clientX<=H.right&&he.clientY>=H.top&&he.clientY<=H.bottom}else{const H=E.current?mr(E.current):null;if(!H)return;oe=he.clientX>=H.x&&he.clientX<=H.x+H.width&&he.clientY>=H.y&&he.clientY<=H.y+H.height}if(!oe){se.stopPropagation(),J.current=!0;const H=ee=>{ee.stopPropagation(),ee.preventDefault(),document.removeEventListener("click",H,!0)};document.addEventListener("click",H,!0),Y()}}}};return document.addEventListener("touchend",z,{passive:!0}),()=>{document.removeEventListener("touchend",z)}},[e,Y,b,n]);const de=($.type==="scale"||$.type==="fade")&&$.direction==="vert"&&ne.type==="drag";a.useEffect(()=>{var ee,Me;if(!e||!de||!((Me=(ee=w.current)==null?void 0:ee.splide)!=null&&Me.root))return;const z=w.current.splide.root,se=30,pe=(le,D)=>{if(V.current){const Ve=Math.abs(le-V.current.x),Oe=Math.abs(D-V.current.y);(Ve>0||Oe>0)&&(ie.current=!0)}},xe=le=>{V.current&&(le.preventDefault(),pe(le.clientX,le.clientY))},Re=le=>{V.current&&le.touches.length>0&&(le.preventDefault(),pe(le.touches[0].clientX,le.touches[0].clientY))},Te=(le,D)=>{if(!V.current||!w.current){V.current=null;return}const Ve=Math.abs(le-V.current.x),Oe=Math.abs(D-V.current.y);Oe>se&&Oe>Ve&&w.current.go(D<V.current.y?"+1":"-1"),V.current=null},_=le=>{V.current&&Te(le.clientX,le.clientY),document.removeEventListener("pointerup",_),document.removeEventListener("pointercancel",_),document.removeEventListener("pointermove",xe)},he=le=>{if(V.current){if(le.changedTouches.length>0){const D=le.changedTouches[0];Te(D.clientX,D.clientY)}document.removeEventListener("touchend",he),document.removeEventListener("touchcancel",he),document.removeEventListener("touchmove",Re)}},oe=le=>{V.current={x:le.clientX,y:le.clientY},ie.current=!1,document.addEventListener("pointermove",xe,{passive:!1}),document.addEventListener("pointerup",_),document.addEventListener("pointercancel",_)},H=le=>{le.touches.length>0&&(V.current={x:le.touches[0].clientX,y:le.touches[0].clientY},ie.current=!1,document.addEventListener("touchmove",Re,{passive:!1}),document.addEventListener("touchend",he),document.addEventListener("touchcancel",he))};return z.addEventListener("pointerdown",oe),z.addEventListener("touchstart",H),()=>{z.removeEventListener("pointerdown",oe),z.removeEventListener("touchstart",H),document.removeEventListener("pointermove",xe),document.removeEventListener("pointerup",_),document.removeEventListener("pointercancel",_),document.removeEventListener("touchmove",Re),document.removeEventListener("touchend",he),document.removeEventListener("touchcancel",he),V.current=null,ie.current=!1}},[e,de,R]);const ge={backgroundColor:te.color,backdropFilter:`blur(${te.blur}px)`,animationDuration:`${parseInt(re.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(s)?null:Yn.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:l?null:F,className:rt(Ge.background,U?ue:me,{[Ge.editor]:l},{[Ge.hidden]:!e}),style:{...ge,...B&&!l&&!U?{position:"absolute"}:{}}}),r.jsxs("div",{ref:l?F:null,className:rt(Ge.contentStyle,U?q:Ie,{[Ge.editor]:l},{[Ge.hidden]:!e}),style:{animationDuration:`${parseInt(re.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(Ya,{onMove:z=>I(z.index),ref:w,className:Ge.lightboxSplide,options:{arrows:!1,speed:$.duration?parseInt($.duration):500,direction:$.direction==="horiz"||$.type==="fade"||$.type==="scale"?"ltr":"ttb",pagination:!1,drag:ne.type==="drag"&&!de,perPage:1,width:"100%",height:"100%",type:$.type==="fade"||$.type==="scale"?"fade":"loop",padding:0,rewind:ne.repeat!=="close",start:0},style:{"--splide-speed":$.duration},children:n.map((z,se)=>{const pe=Do(fe.position,fe.offset,l),xe=`${S.scalingValue(fe.padding.top,l)} ${S.scalingValue(fe.padding.right,l)} ${S.scalingValue(fe.padding.bottom,l)} ${S.scalingValue(fe.padding.left,l)}`,Re=$.type==="scale"?(()=>{const{transform:Te,..._}=pe;return{..._,position:"absolute",padding:xe,boxSizing:"border-box","--position-transform":Te||"none"}})():{...pe,position:"absolute",padding:xe,boxSizing:"border-box"};return r.jsx(Za,{children:r.jsx("div",{className:Ge.imgWrapper,onClick:Se,children:r.jsx("img",{ref:se===b?E:null,className:rt(Ge.imageStyle,{[Ge.contain]:z.image.objectFit==="contain",[Ge.cover]:z.image.objectFit==="cover",[Ge.scaleSlide]:$.type==="scale"}),src:z.image.url,alt:z.image.name??"",style:{...Re,pointerEvents:z.image.objectFit==="contain"?"none":"auto"}})})},se)})},R),k.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:rt(Ge.arrow,{[Ge.arrowVertical]:$.direction==="vert"}),style:{color:k.color,"--arrow-hover-color":k.hover},children:r.jsxs("button",{className:Ge.arrowInner,style:{transform:`translate(${S.scalingValue(k.offset.x,l)}, ${S.scalingValue(k.offset.y*($.direction==="horiz"?1:-1),l)}) scale(${k.scale}) rotate(${$.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var z;return(z=w.current)==null?void 0:z.go("-1")},"aria-label":"Previous",children:[k.arrowsImgUrl&&r.jsx(rn,{url:k.arrowsImgUrl,fill:k.color,hoverFill:k.hover,className:rt(Ge.arrowImg,Ge.mirror)}),!k.arrowsImgUrl&&r.jsx(Ms,{color:k.color,className:rt(Ge.arrowIcon,Ge.arrowImg,Ge.mirror)})]})}),r.jsx("div",{className:rt(Ge.arrow,Ge.nextArrow,{[Ge.arrowVertical]:$.direction==="vert"}),style:{color:k.color,"--arrow-hover-color":k.hover},children:r.jsxs("button",{className:Ge.arrowInner,style:{transform:`translate(${S.scalingValue(k.offset.x*($.direction==="horiz"?-1:1),l)}, ${S.scalingValue(k.offset.y,l)}) scale(${k.scale}) rotate(${$.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var z;return(z=w.current)==null?void 0:z.go("+1")},"aria-label":"Next",children:[k.arrowsImgUrl&&r.jsx(rn,{url:k.arrowsImgUrl,fill:k.color,hoverFill:k.hover,className:Ge.arrowImg}),!k.arrowsImgUrl&&r.jsx(Ms,{color:k.color,className:rt(Ge.arrowIcon,Ge.arrowImg)})]})})]}),te.closeIconUrl&&(()=>{const z=Do(te.closeIconAlign,te.closeIconOffset,l),se=`scale(${te.closeIconScale})`,pe=z.transform?`${z.transform} ${se}`:se;return r.jsx("button",{className:Ge.closeButton,style:{...z,transform:pe},onClick:Y,"aria-label":"Close lightbox",children:r.jsx(rn,{url:te.closeIconUrl,fill:te.closeIconColor??"#000000",hoverFill:te.closeIconHover??"#cccccc"})})})(),K&&K.isActive&&i.imageCaption&&((be=n[b])==null?void 0:be.imageCaption)&&r.jsx("div",{className:Ge.caption,style:{...Do(K.alignment,K.offset,l),fontFamily:Er(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":S.scalingValue(c.width,l),letterSpacing:S.scalingValue(p,l),wordSpacing:S.scalingValue(v,l),textAlign:x,fontSize:S.scalingValue(f.fontSize,l),lineHeight:S.scalingValue(f.lineHeight,l),textTransform:h.textTransform??"none",textDecoration:h.textDecoration??"none",fontVariant:h.fontVariant??"normal",color:m},onClick:z=>z.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:Ge.captionTextInner,style:{"--link-color":K.linkColor,"--link-hover-color":K.linkHoverColor},children:r.jsx(yi,{content:n[b].imageCaption})})}),ae.isActive&&(()=>{const[z,se]=ae.position.split("-"),pe=$.direction==="horiz"?`${z}-left`:ae.position,xe=Do(pe,ae.offset,l),Re=()=>{if($.direction==="horiz"){if(se==="left")return"flex-start";if(se==="center")return"center";if(se==="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 r.jsx("div",{ref:C,className:Ge.thumbsWrapper,onClick:Te=>Ee(Te),style:{position:l?"absolute":"fixed",...xe,...$.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:rt(Ge.thumbsContainer,{[Ge.thumbsContainerVertical]:$.direction==="vert",[Ge.thumbsAlignStart]:ae.align==="start",[Ge.thumbsAlignCenter]:ae.align==="center",[Ge.thumbsAlignEnd]:ae.align==="end"}),style:{gap:S.scalingValue(ae.grid.gap,l),justifyContent:M?"flex-start":Re()},children:n.map((Te,_)=>{const he=_===b,oe=L[_],ee=ae.grid.size*(he?ae.activeState.scale:1),Me=()=>{if(ae.fit!=="fit")return{};if(!oe)return $.direction==="horiz"?{height:S.scalingValue(ee,l)}:{width:S.scalingValue(ee,l)};const le=oe.width/oe.height;if($.direction==="horiz"){const D=ee,Ve=D*le;return{width:S.scalingValue(Ve,l),height:S.scalingValue(D,l)}}else{const D=ee,Ve=D/le;return{width:S.scalingValue(D,l),height:S.scalingValue(Ve,l)}}};return r.jsx("button",{className:Ge.thumbItem,style:{...$.direction==="horiz"&&ae.fit!=="fit"?{height:S.scalingValue(ee,l)}:{},...$.direction==="vert"&&ae.fit!=="fit"?{width:S.scalingValue(ee,l)}:{},...ae.fit==="cover"?{width:S.scalingValue(ee,l),height:S.scalingValue(ee,l)}:{},...Me(),transition:he?"all 0.25s ease-out":"none",opacity:he?ae.activeState.opacity/100:ae.opacity/100,"--thumb-hover":ae.activeState.opacity/100},onClick:le=>{var D;le.stopPropagation(),I(_),(D=w.current)==null||D.go(_)},onMouseEnter:()=>{var le;ae.triggers==="hov"&&((le=w.current)==null||le.go(_))},children:r.jsx("img",{src:Te.image.url,alt:Te.image.name??"",onLoad:le=>{const D=le.currentTarget;D.naturalWidth&&D.naturalHeight&&j(Ve=>({...Ve,[_]:{width:D.naturalWidth,height:D.naturalHeight}}))},style:{objectFit:ae.fit==="cover"?"cover":"contain",...ae.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...ae.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Te.image.name}-${_}`)})})})})()]})]}),document.getElementById(s))};function Ms({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.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:gm,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 jo(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function ym(e){return`
6
+ */const dp="RichTextRenderer-module__link___BWeZ2",up={link:dp},pp=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))},Mr=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>pp(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function rn(e){const{color:t,...n}=e;return n}function Xt(e,t){var o,s,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:Mr(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:C.scalingValue(e.letterSpacing,t),wordSpacing:C.scalingValue(e.wordSpacing,t),fontSize:C.scalingValue(n,t),lineHeight:i!==void 0?C.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(s=e.textAppearance)==null?void 0:s.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}const yi=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:up.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:mp(i),children:i.text},o));return r.jsx(r.Fragment,{children:e.map((n,i)=>{const o=n.children;return r.jsx("div",{children:t(o)},i)})})};function mp(e){return{...e.fontFamily&&{fontFamily:Mr(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 gp="SvgImage-module__svg___q3xE-",hp="SvgImage-module__img___VsTm-",Is={svg:gp,img:hp},fp=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},yp=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,an=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[s,l]=a.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return a.useEffect(()=>{if(typeof window<"u"&&window.CSS){const d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');l(d)}},[]),!fp(e)||!s?r.jsx("img",{src:e,alt:"",className:ut(Is.img,i),style:o}):r.jsx("span",{"data-supports-mask":s,className:ut(Is.svg,i),style:{"--svg":yp(e),"--fill":t,"--hover-fill":n,...o??{}}})},vp={"top-left":ct.topLeftAlignment,"top-center":ct.topCenterAlignment,"top-right":ct.topRightAlignment,"middle-left":ct.middleLeftAlignment,"middle-center":ct.middleCenterAlignment,"middle-right":ct.middleRightAlignment,"bottom-left":ct.bottomLeftAlignment,"bottom-center":ct.bottomCenterAlignment,"bottom-right":ct.bottomRightAlignment};function xp({settings:e,content:t,styles:n,isEditor:i}){const[o,s]=a.useState(null),{widthSettings:l,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:p,fontSizeLineHeight:v,textAppearance:y,color:g}=n.imageCaption??{},[h,m]=a.useState(void 0),[b,I]=a.useState(null),[R,T]=a.useState(0),[q,F]=a.useState(0),{direction:V,transition:A,controls:L,pagination:O,imageCaption:x,triggers:W}=e,E=a.useRef(A.type),{x:J,y:P}=e.controls.offset,K=B=>{o&&o.go(B)};return a.useEffect(()=>{if(!b)return;const B=new ResizeObserver(z=>{if(!o)return;const[ie]=z;m({width:Math.round(ie.contentRect.width),height:Math.round(ie.contentRect.height)})});return B.observe(b),()=>B.unobserve(b)},[b]),a.useEffect(()=>{!o||E.current===A.type||(F(B=>B+1),E.current=A.type)},[A.type]),r.jsx("div",{className:ut(ct.wrapper,{[ct.editor]:i}),ref:I,children:r.jsxs("div",{className:ct.sliderInner,style:{width:h?h.width:"100%",height:h?h.height:"100%",backgroundColor:A.backgroundColor&&A.type==="fade in"?A.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:ut(ct.captionBlock),children:r.jsx("div",{className:ct.captionTextWrapper,children:t.map((B,z)=>r.jsx("div",{className:ut(ct.captionText,vp[x.alignment],{[ct.withPointerEvents]:z===R&&i,[ct.active]:z===R}),style:{fontFamily:Mr(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":C.scalingValue(l.width,i),letterSpacing:C.scalingValue(c,i),wordSpacing:C.scalingValue(p,i),textAlign:u,fontSize:C.scalingValue(v.fontSize,i),lineHeight:C.scalingValue(v.lineHeight,i),textTransform:y.textTransform??"none",textDecoration:y.textDecoration??"none",fontVariant:y.fontVariant??"normal",color:g,transitionDuration:A.duration?`${Math.round(parseInt(A.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:ct.captionTextInner,style:{"--link-hover-color":x.linkHoverColor,"--link-color":x.linkColor,position:"relative",top:C.scalingValue(x.offset.y,i),left:C.scalingValue(x.offset.x,i)},children:r.jsx(yi,{content:B.imageCaption})})},z))})}),r.jsx(Qa,{onMove:B=>{T(B.index)},ref:s,options:{arrows:!1,speed:A.duration?parseInt(A.duration):500,autoplay:W.autoPlay!==null,...W.autoPlay!==null&&{interval:parseInt(W.autoPlay)*1e3},direction:V==="horiz"||A.type==="fade in"?"ltr":"ttb",pagination:!1,drag:W.triggersList.drag,perPage:1,width:h?h.width:"100%",height:h?h.height:"100%",type:A.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((B,z)=>r.jsx(es,{children:r.jsx("div",{className:ct.sliderItem,children:r.jsx("div",{className:ct.imgWrapper,children:r.jsx("img",{className:ut(ct.sliderImage,{[ct.contain]:B.image.objectFit==="contain",[ct.cover]:B.image.objectFit==="cover"}),src:B.image.url,alt:B.image.name??""})})})},z))},q),L.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:ut(ct.arrow,{[ct.arrowVertical]:V==="vert",[ct.hoverArrow]:L.show==="on hover"}),style:{color:L.color,"--arrow-hover-color":L.hover},children:r.jsxs("button",{onClick:()=>{K("-1")},className:ct.arrowInner,style:{transform:`translate(${C.scalingValue(J,i)}, ${C.scalingValue(P*(V==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${V==="horiz"?"0deg":"90deg"})`},children:[L.arrowsImgUrl&&r.jsx(an,{url:L.arrowsImgUrl,fill:L.color,hoverFill:L.hover,className:ut(ct.arrowImg,ct.mirror)}),!L.arrowsImgUrl&&r.jsx(Es,{color:L.color,className:ut(ct.arrowIcon,ct.arrowImg,ct.mirror)})]})}),r.jsx("div",{className:ut(ct.arrow,ct.nextArrow,{[ct.arrowVertical]:V==="vert",[ct.hoverArrow]:L.show==="on hover"}),style:{color:L.color,"--arrow-hover-color":L.hover},children:r.jsxs("button",{className:ct.arrowInner,onClick:()=>K("+1"),style:{transform:`translate(${C.scalingValue(J*(V==="horiz"?-1:1),i)}, ${C.scalingValue(P,i)}) scale(${e.controls.scale/100}) rotate(${V==="horiz"?"0deg":"90deg"})`},children:[L.arrowsImgUrl&&r.jsx(an,{url:L.arrowsImgUrl,fill:L.color,hoverFill:L.hover,className:ct.arrowImg}),!L.arrowsImgUrl&&r.jsx(Es,{color:L.color,className:ut(ct.arrowIcon,ct.arrowImg)})]})})]}),W.triggersList.click&&r.jsx("div",{className:ct.clickOverlay,onClick:()=>{o&&o.go("+1")}}),O.isActive&&r.jsx("div",{className:ut(ct.pagination,{[ct.paginationInsideBottom]:O.position==="inside-1"&&V==="horiz",[ct.paginationInsideTop]:O.position==="inside-2"&&V==="horiz",[ct.paginationOutsideBottom]:O.position==="outside-1"&&V==="horiz",[ct.paginationOutsideTop]:O.position==="outside-2"&&V==="horiz",[ct.paginationInsideLeft]:O.position==="inside-1"&&V==="vert",[ct.paginationInsideRight]:O.position==="inside-2"&&V==="vert",[ct.paginationOutsideLeft]:O.position==="outside-1"&&V==="vert",[ct.paginationOutsideRight]:O.position==="outside-2"&&V==="vert",[ct.paginationVertical]:V==="vert"}),children:r.jsx("div",{className:ct.paginationInner,style:{backgroundColor:O.colors[2],transform:`scale(${O.scale/100}) translate(${C.scalingValue(O.offset.x,i)}, ${C.scalingValue(O.offset.y,i)}) rotate(${V==="horiz"?"0deg":"90deg"})`},children:t.map((B,z)=>r.jsx("button",{onClick:()=>{o&&o.go(z)},className:ut(ct.paginationItem),children:r.jsx("div",{className:ut(ct.dot,{[ct.activeDot]:z===R}),style:{backgroundColor:z===R?O.colors[0]:O.colors[1],"--pagination-hover-color":O.hover}})},z))})})]})})}function Es({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.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 bp={element:xp,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"]}},wp="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Sp="ImageRevealSlider-module__image___Qjt-e",$p="ImageRevealSlider-module__link___N-iLG",Cp="ImageRevealSlider-module__cursor___2U03d",wi={imageRevealSlider:wp,image:Sp,link:$p,cursor:Cp};function Ms(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const s=i.width?Number.parseFloat(i.width):o.naturalWidth,l=o.naturalHeight/o.naturalWidth*s,d=s/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 Vr(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Tp(e,t,n,i){let o,s;if(t==="custom"){o=n;const l=await Vr(e);s=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await Vr(e);s=l.height/l.width*o}else{const l=await Vr(e);o=l.width,s=l.height}return{width:o,height:s,finalWidth:`${o}px`}}function Lp({settings:e,content:t,isEditor:n}){const[i,o]=a.useState(null),[s,l]=a.useState([]),[d,c]=a.useState(0),u=a.useRef(0),[p,v]=a.useState({x:0,y:0}),[y,g]=a.useState(1),[h,m]=a.useState("none"),b=a.useRef({x:0,y:0}),[I,R]=a.useState(!1),{sizeType:T,imageWidth:q,randomRangeImageWidth:F}=e.imageSize,{revealPosition:V,visible:A}=e.position,{cursorType:L,target:O,defaultCursorScale:x,defaultCursor:W,hoverCursorScale:E,hoverCursor:J}=e.cursor;a.useEffect(()=>{if(!i)return;const B=(S,M)=>{const D=i.getBoundingClientRect(),le=S-D.left,oe=M-D.top;if(v({x:le,y:oe}),L==="system"){m("none"),g(1);return}const $=le,ae=oe,k=document.elementFromPoint(D.left+$,D.top+ae);if(k&&k.closest("a")){m("none"),g(1);return}const te=Ms($,ae,s)||O==="area"?{img:J??"none",scale:E}:{img:W??"none",scale:x};m(te.img),g(te.scale)},z=S=>{S.stopPropagation(),b.current={x:S.clientX,y:S.clientY},B(S.clientX,S.clientY)},ie=()=>{I&&B(b.current.x,b.current.y)};return i.addEventListener("mousemove",z),window.addEventListener("scroll",ie,!0),()=>{i.removeEventListener("mousemove",z),window.removeEventListener("scroll",ie,!0)}},[i,I,p,L,O,J,W,E,x,s]),a.useEffect(()=>{I||(m("none"),g(0))},[I]);const P=async(B,z,ie,S={})=>{const{width:M,height:D,finalWidth:le}=await Tp(B.image.url,T,q,F);let oe=0,$=0;V==="same"?(oe=z/2,$=ie/2):(oe=S.x??Math.random()*z,$=S.y??Math.random()*ie);const ae=Math.min(Math.max(oe,M/2),z-M/2),k=Math.min(Math.max($,D/2),ie-D/2);return{id:u.current++,url:B.image.url,link:B.link,name:B.image.name,x:ae,y:k,width:le}};a.useEffect(()=>{if(!i||t.length===0)return;const B=i.getBoundingClientRect(),z=B.width,ie=B.height,S=[];(async()=>{const D=t[0],le=await P(D,z,ie);S.push(le),l(S),c(1)})()},[T,q,F,V,i]),a.useEffect(()=>{A==="last One"&&l(B=>B.length>0?[B[B.length-1]]:[])},[A]);const K=async B=>{if(!i)return;const z=i.getBoundingClientRect(),ie=B.clientX-z.left,S=B.clientY-z.top;if(O==="image"&&!Ms(ie,S,s))return;let M=0,D=0;V==="on Click"?(M=ie,D=S):V==="same"?(M=z.width/2,D=z.height/2):(M=Math.random()*z.width,D=Math.random()*z.height);const le=t[d],oe=await P(le,z.width,z.height,{x:M,y:D});l($=>A==="all"?[...$,oe]:[oe]),c($=>$>=t.length-1?0:$+1)};return r.jsxs("div",{ref:o,onClick:K,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),className:wi.imageRevealSlider,style:{cursor:h==="none"?"default":"none"},children:[s.map(B=>r.jsx("div",{className:wi.wrapper,style:{top:`${B.y}px`,left:`${B.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:B.width??"auto",height:"auto",cursor:h==="none"?"default":"none"},children:O==="area"&&B.link?r.jsx("a",{href:B.link,target:"_blank",className:wi.link,children:r.jsx("img",{src:B.url,alt:B.name,className:wi.image},B.id)}):r.jsx("img",{src:B.url,alt:B.name,className:wi.image},B.id)},B.id)),I&&r.jsx("div",{className:wi.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${y})`,backgroundImage:`url('${h}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Rp={element:Lp,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:""}]}}}},Ip="LightBox-module__hidden___9s-9x",Ep="LightBox-module__heroImage___sTxNF",Mp="LightBox-module__background___rm9ml",Pp="LightBox-module__editor___4ACaY",kp="LightBox-module__contentStyle___Bgnsq",Ap="LightBox-module__imageStyle___tLIlB",Fp="LightBox-module__imgWrapper___LuFUp",Wp="LightBox-module__contain___8-yaS",_p="LightBox-module__cover___hNvOG",Hp="LightBox-module__caption___b6L2I",Np="LightBox-module__captionTextInner___rCGNH",Op="LightBox-module__lightboxSplide___XFuWC",Dp="LightBox-module__arrow___iz38X",jp="LightBox-module__arrowVertical___Zfz81",zp="LightBox-module__nextArrow___zkAQN",Bp="LightBox-module__arrowInner___p48sW",Vp="LightBox-module__arrowIcon___3VaFf",Gp="LightBox-module__arrowImg___pNV88",qp="LightBox-module__mirror___pjeXc",Up="LightBox-module__thumbsWrapper___GB-nU",Xp="LightBox-module__thumbsContainerVertical___wttk5",Kp="LightBox-module__thumbsContainer___osSma",Yp="LightBox-module__thumbsAlignStart___MO6tY",Zp="LightBox-module__thumbsAlignCenter___Q4sUx",Jp="LightBox-module__thumbsAlignEnd___p4y9R",Qp="LightBox-module__thumbItem___HvnF3",em="LightBox-module__closeButton___g2khP",tm="LightBox-module__fadeIn___0m5GW",nm="LightBox-module__slideInLeft___gPYwC",im="LightBox-module__slideInRight___S-pPp",om="LightBox-module__slideInTop___DFdAj",rm="LightBox-module__slideInBottom___m27kZ",am="LightBox-module__fadeOut___55qBR",sm="LightBox-module__slideOutLeft___NvU7P",lm="LightBox-module__slideOutRight___SK7eC",cm="LightBox-module__slideOutTop___Vgg0z",dm="LightBox-module__slideOutBottom___nJ0Ef",um="LightBox-module__scaleSlide___vZriG",Xe={hidden:Ip,heroImage:Ep,background:Mp,editor:Pp,contentStyle:kp,imageStyle:Ap,imgWrapper:Fp,contain:Wp,cover:_p,caption:Hp,captionTextInner:Np,lightboxSplide:Op,arrow:Dp,arrowVertical:jp,nextArrow:zp,arrowInner:Bp,arrowIcon:Vp,arrowImg:Gp,mirror:qp,thumbsWrapper:Up,thumbsContainerVertical:Xp,thumbsContainer:Kp,thumbsAlignStart:Yp,thumbsAlignCenter:Zp,thumbsAlignEnd:Jp,thumbItem:Qp,closeButton:em,fadeIn:tm,slideInLeft:nm,slideInRight:im,slideInTop:om,slideInBottom:rm,fadeOut:am,slideOutLeft:sm,slideOutRight:lm,slideOutTop:cm,slideOutBottom:dm,scaleSlide:um},jo=(e,t,n)=>{const i={},[o,s]=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"),s==="left"?(i.left="0",i.right="auto"):s==="center"?(i.left="50%",i.right="auto"):s==="right"&&(i.left="auto",i.right="0"),o==="middle"&&s==="center"?i.transform=`translate(calc(-50% + ${C.scalingValue(t.x,n)}), calc(-50% + ${C.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${C.scalingValue(t.x,n)}, calc(-50% + ${C.scalingValue(t.y,n)}))`:s==="center"?i.transform=`translate(calc(-50% + ${C.scalingValue(t.x,n)}), ${C.scalingValue(t.y,n)})`:i.transform=`translate(${C.scalingValue(t.x,n)}, ${C.scalingValue(t.y,n)})`,i};function bc(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 pm(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 wc(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,s=n/i;if(s>o){const d=e;return{renderedW:d,renderedH:d/s}}const l=t;return{renderedW:l*s,renderedH:l}}function mm(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,s=n/i;if(s>o){const d=t;return{renderedW:d*s,renderedH:d}}const l=e;return{renderedW:l,renderedH:l/s}}function Sc(e,t,n,i,o){const{x:s,y:l}=pm(o);return{offsetX:s*(e-n),offsetY:l*(t-i)}}function gm(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,s=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight,{objectFit:l,objectPosition:d}=window.getComputedStyle(e),c=l==="cover"?mm:wc,{renderedW:u,renderedH:p}=c(n,i,o,s),{offsetX:v,offsetY:y}=Sc(n,i,u,p,d),g=(v+u/2)/n*100,h=(y+p/2)/i*100;return`${g}% ${h}%`}function hm(e){return gm(e)}function gr(e){const t=e.getBoundingClientRect(),n=bc(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),s=e.naturalWidth,l=e.naturalHeight,{renderedW:d,renderedH:c}=wc(i,o,s,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:v}=Sc(i,o,d,c,u),y=t.left+n.left,g=t.top+n.top;return{x:p+y,y:v+g,width:d,height:c}}function Ps(e){const t=e.getBoundingClientRect(),n=bc(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function ks(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const i=t[1].split(",").map(o=>parseFloat(o.trim()));return i.length===4?i[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const i=n[1].substring(6,8);return parseInt(i,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function fm(e,t){const n=(()=>{if(e==="fade in")return Xe.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Xe.slideInLeft;case"right":return Xe.slideInRight;case"top":return Xe.slideInTop;case"bottom":return Xe.slideInBottom;default:return Xe.slideInRight}return Xe.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Xe.fadeIn;if(e==="slide in")switch(t){case"left":return Xe.slideInLeft;case"right":return Xe.slideInRight;case"top":return Xe.slideInTop;case"bottom":return Xe.slideInBottom;default:return Xe.slideInRight}return Xe.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Xe.fadeOut;if(e==="slide in")switch(t){case"left":return Xe.slideOutLeft;case"right":return Xe.slideOutRight;case"top":return Xe.slideOutTop;case"bottom":return Xe.slideOutBottom;default:return Xe.slideOutRight}return Xe.fadeOut})(),s=(()=>{if(e==="fade in")return Xe.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Xe.slideOutLeft;case"right":return Xe.slideOutRight;case"top":return Xe.slideOutTop;case"bottom":return Xe.slideOutBottom;default:return Xe.slideOutRight}return Xe.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:s}}const ym=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:s,isPreviewMode:l})=>{const[d,c]=a.useState(!1),{url:u}=e.thumbnailBlock.cover;return a.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:u,alt:"Cover",className:Xe.heroImage,onClick:()=>c(!0)}),r.jsx(vm,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:s})]})},vm=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:s,isEditor:l,metadata:d})=>{var we;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:v,wordSpacing:y,fontSizeLineHeight:g,textAppearance:h,color:m}=i.imageCaption??{},[b,I]=a.useState(0),[R,T]=a.useState(0),[q,F]=a.useState(!1),[V,A]=a.useState(!1),[L,O]=a.useState({}),x=a.useRef(null),W=a.useRef(null),E=a.useRef(null),J=a.useRef(!1),P=a.useRef(null),K=a.useRef(null),B=a.useRef(null),z=a.useRef(null),ie=a.useRef(!1),S=a.useRef(null),[M,D]=a.useState(!1),{appear:le,triggers:oe,slider:$,thumbnail:ae,controls:k,area:te,caption:X,layout:ve}=o.lightboxBlock,{appearClass:Pe,backdropAppearClass:he,backdropDisappearClass:ce,disappearClass:U}=fm(le.type,le.direction),Y=(d==null?void 0:d.itemId)??null;a.useEffect(()=>{const G=()=>{setTimeout(()=>{var pe,Se;(Se=(pe=x.current)==null?void 0:pe.splide)==null||Se.refresh()},16)},se=()=>{T(pe=>pe+1)};return window.addEventListener("ArticleEditor.Layout:change",G),window.addEventListener("ArticleEditor.ComponentContent:change",se),()=>{window.removeEventListener("ArticleEditor.Layout:change",G),window.removeEventListener("ArticleEditor.ComponentContent:change",se)}},[]),a.useEffect(()=>{if(!e||!ae.isActive){D(!1);return}const G=S.current;if(!G)return;const se=()=>{$.direction==="horiz"?D(G.scrollWidth>G.clientWidth):D(G.scrollHeight>G.clientHeight)};se();const pe=new ResizeObserver(se);return pe.observe(G),()=>pe.disconnect()},[e,ae.isActive,n.length,L,$.direction]);const Z=a.useCallback(()=>{const G=window.matchMedia("(max-width: 768px)").matches,se=ks(te.color);G&&!l&&se>.9&&(document.body.style.backgroundColor=""),F(!0),J.current=!0;const pe=Se=>{Se.target===P.current&&Se.animationName&&(P.current&&K.current&&P.current.removeEventListener("animationend",K.current),K.current=null,J.current&&(J.current=!1,t()),F(!1))};P.current&&(K.current=pe,P.current.addEventListener("animationend",pe))},[t,te.color,l]),We=(G,se,pe)=>{var Se,Me;if(G){if(oe.type==="click"&&oe.switch==="image")oe.repeat==="close"&&b===n.length-1?Z():(Se=x.current)==null||Se.go("+1");else if(oe.type==="click"&&oe.switch==="50/50"){const Le=G.getBoundingClientRect(),H=se-Le.left,ye=pe-Le.top,re=Le.width,_=Le.height;let ee;$.direction==="horiz"?ee=H<re/2?"-1":"+1":ee=ye<_/2?"-1":"+1",(Me=x.current)==null||Me.go(ee)}}},$e=G=>{if(ie.current){ie.current=!1;return}const se=n[b],pe=(se==null?void 0:se.image.objectFit)==="cover";let Se,Me;if("changedTouches"in G&&G.changedTouches.length>0)Se=G.changedTouches[0].clientX,Me=G.changedTouches[0].clientY;else if("clientX"in G)Se=G.clientX,Me=G.clientY;else return;let Le;if(pe&&E.current){const H=Ps(E.current);Le=Se>=H.left&&Se<=H.right&&Me>=H.top&&Me<=H.bottom}else{const H=E.current?gr(E.current):null;if(!H){G.target===G.currentTarget&&Z();return}Le=Se>=H.x&&Se<=H.x+H.width&&Me>=H.y&&Me<=H.y+H.height}Le?We(E.current,Se,Me):Z()},ke=G=>{const se=G.target;(se.classList.contains(Xe.thumbsWrapper)||se.classList.contains(Xe.thumbsContainer))&&$e(G)};a.useEffect(()=>{if(!e)return;const G=se=>{var pe,Se;if(se.key==="Escape"){Z();return}if(se.key==="ArrowRight"){I(Me=>(Me+1)%Math.max(n.length,1)),(pe=x.current)==null||pe.go("+1");return}se.key==="ArrowLeft"&&(I(Me=>(Me-1+Math.max(n.length,1))%Math.max(n.length,1)),(Se=x.current)==null||Se.go("-1"))};return window.addEventListener("keydown",G),()=>{window.removeEventListener("keydown",G)}},[e,Z,n.length]),a.useEffect(()=>{if(e){if(I(0),T(se=>se+1),J.current=!1,F(!1),A(!1),O({}),!Y)return;const G=new CustomEvent("page-overlay",{detail:{itemId:Y}});window.dispatchEvent(G)}return()=>{P.current&&K.current&&(P.current.removeEventListener("animationend",K.current),K.current=null),A(!1)}},[e,Y]),a.useEffect(()=>{W.current!==null&&W.current!==$.type&&T(G=>G+1),W.current=$.type},[$.type]),a.useEffect(()=>{if(!e)return;const G=document.body.style.overflow,se=window.matchMedia("(max-width: 768px)").matches,pe=ks(te.color);document.body.style.overflow="hidden",A(!1);const Se=Le=>{Le.target===P.current&&!J.current&&Le.animationName&&(se&&!l&&pe>.9&&(document.body.style.backgroundColor=te.color),A(!0),P.current&&B.current&&P.current.removeEventListener("animationend",B.current),B.current=null)};P.current&&(B.current=Se,P.current.addEventListener("animationend",Se));const Me=Le=>{const H=Le.target;H&&(H.closest(`.${Xe.thumbsWrapper}`)||H.closest(`.${Xe.thumbsContainer}`))||$.type!=="slide"&&Le.preventDefault()};return document.addEventListener("touchmove",Me,{passive:!1}),()=>{document.body.style.overflow=G,document.removeEventListener("touchmove",Me),P.current&&B.current&&(P.current.removeEventListener("animationend",B.current),B.current=null),A(!1)}},[e,l,te.color,$.type]),a.useEffect(()=>{if(!e)return;const G=se=>{var Se,Me;if(J.current){se.stopPropagation();return}if(ie.current){ie.current=!1;return}const pe=se.target;if(!(pe&&(pe.closest(`.${Xe.thumbsContainer}`)||pe.closest(`.${Xe.thumbItem}`)||pe.closest(`.${Xe.arrow}`)||pe.closest(`.${Xe.closeButton}`)||pe.closest(`.${Xe.caption}`)))){if($.type==="slide"&&oe.type==="drag"&&((Me=(Se=x.current)==null?void 0:Se.splide)!=null&&Me.root)){const Le=x.current.splide.root;if(pe&&(Le.contains(pe)||Le===pe))return}if(se.touches.length===0&&se.changedTouches.length>0){const Le=n[b],H=(Le==null?void 0:Le.image.objectFit)==="cover",ye=se.changedTouches[0];let re;if(H&&E.current){const _=Ps(E.current);re=ye.clientX>=_.left&&ye.clientX<=_.right&&ye.clientY>=_.top&&ye.clientY<=_.bottom}else{const _=E.current?gr(E.current):null;if(!_)return;re=ye.clientX>=_.x&&ye.clientX<=_.x+_.width&&ye.clientY>=_.y&&ye.clientY<=_.y+_.height}if(!re){se.stopPropagation(),J.current=!0;const _=ee=>{ee.stopPropagation(),ee.preventDefault(),document.removeEventListener("click",_,!0)};document.addEventListener("click",_,!0),Z()}}}};return document.addEventListener("touchend",G,{passive:!0}),()=>{document.removeEventListener("touchend",G)}},[e,Z,b,n]);const de=($.type==="scale"||$.type==="fade")&&$.direction==="vert"&&oe.type==="drag";a.useEffect(()=>{var ee,Ae;if(!e||!de||!((Ae=(ee=x.current)==null?void 0:ee.splide)!=null&&Ae.root))return;const G=x.current.splide.root,se=30,pe=(ue,N)=>{if(z.current){const Ue=Math.abs(ue-z.current.x),Oe=Math.abs(N-z.current.y);(Ue>0||Oe>0)&&(ie.current=!0)}},Se=ue=>{z.current&&(ue.preventDefault(),pe(ue.clientX,ue.clientY))},Me=ue=>{z.current&&ue.touches.length>0&&(ue.preventDefault(),pe(ue.touches[0].clientX,ue.touches[0].clientY))},Le=(ue,N)=>{if(!z.current||!x.current){z.current=null;return}const Ue=Math.abs(ue-z.current.x),Oe=Math.abs(N-z.current.y);Oe>se&&Oe>Ue&&x.current.go(N<z.current.y?"+1":"-1"),z.current=null},H=ue=>{z.current&&Le(ue.clientX,ue.clientY),document.removeEventListener("pointerup",H),document.removeEventListener("pointercancel",H),document.removeEventListener("pointermove",Se)},ye=ue=>{if(z.current){if(ue.changedTouches.length>0){const N=ue.changedTouches[0];Le(N.clientX,N.clientY)}document.removeEventListener("touchend",ye),document.removeEventListener("touchcancel",ye),document.removeEventListener("touchmove",Me)}},re=ue=>{z.current={x:ue.clientX,y:ue.clientY},ie.current=!1,document.addEventListener("pointermove",Se,{passive:!1}),document.addEventListener("pointerup",H),document.addEventListener("pointercancel",H)},_=ue=>{ue.touches.length>0&&(z.current={x:ue.touches[0].clientX,y:ue.touches[0].clientY},ie.current=!1,document.addEventListener("touchmove",Me,{passive:!1}),document.addEventListener("touchend",ye),document.addEventListener("touchcancel",ye))};return G.addEventListener("pointerdown",re),G.addEventListener("touchstart",_),()=>{G.removeEventListener("pointerdown",re),G.removeEventListener("touchstart",_),document.removeEventListener("pointermove",Se),document.removeEventListener("pointerup",H),document.removeEventListener("pointercancel",H),document.removeEventListener("touchmove",Me),document.removeEventListener("touchend",ye),document.removeEventListener("touchcancel",ye),z.current=null,ie.current=!1}},[e,de,R]);const fe={backgroundColor:te.color,backdropFilter:`blur(${te.blur}px)`,animationDuration:`${parseInt(le.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(s)?null:Yn.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:l?null:P,className:ut(Xe.background,q?ce:he,{[Xe.editor]:l},{[Xe.hidden]:!e}),style:{...fe,...V&&!l&&!q?{position:"absolute"}:{}}}),r.jsxs("div",{ref:l?P:null,className:ut(Xe.contentStyle,q?U:Pe,{[Xe.editor]:l},{[Xe.hidden]:!e}),style:{animationDuration:`${parseInt(le.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(Qa,{onMove:G=>I(G.index),ref:x,className:Xe.lightboxSplide,options:{arrows:!1,speed:$.duration?parseInt($.duration):500,direction:$.direction==="horiz"||$.type==="fade"||$.type==="scale"?"ltr":"ttb",pagination:!1,drag:oe.type==="drag"&&!de,perPage:1,width:"100%",height:"100%",type:$.type==="fade"||$.type==="scale"?"fade":"loop",padding:0,rewind:oe.repeat!=="close",start:0},style:{"--splide-speed":$.duration},children:n.map((G,se)=>{const pe=jo(ve.position,ve.offset,l),Se=`${C.scalingValue(ve.padding.top,l)} ${C.scalingValue(ve.padding.right,l)} ${C.scalingValue(ve.padding.bottom,l)} ${C.scalingValue(ve.padding.left,l)}`,Me=$.type==="scale"?(()=>{const{transform:Le,...H}=pe;return{...H,position:"absolute",padding:Se,boxSizing:"border-box","--position-transform":Le||"none"}})():{...pe,position:"absolute",padding:Se,boxSizing:"border-box"};return r.jsx(es,{children:r.jsx("div",{className:Xe.imgWrapper,onClick:$e,children:r.jsx("img",{ref:se===b?E:null,className:ut(Xe.imageStyle,{[Xe.contain]:G.image.objectFit==="contain",[Xe.cover]:G.image.objectFit==="cover",[Xe.scaleSlide]:$.type==="scale"}),src:G.image.url,alt:G.image.name??"",style:{...Me,pointerEvents:G.image.objectFit==="contain"?"none":"auto"}})})},se)})},R),k.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:ut(Xe.arrow,{[Xe.arrowVertical]:$.direction==="vert"}),style:{color:k.color,"--arrow-hover-color":k.hover},children:r.jsxs("button",{className:Xe.arrowInner,style:{transform:`translate(${C.scalingValue(k.offset.x,l)}, ${C.scalingValue(k.offset.y*($.direction==="horiz"?1:-1),l)}) scale(${k.scale}) rotate(${$.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var G;return(G=x.current)==null?void 0:G.go("-1")},"aria-label":"Previous",children:[k.arrowsImgUrl&&r.jsx(an,{url:k.arrowsImgUrl,fill:k.color,hoverFill:k.hover,className:ut(Xe.arrowImg,Xe.mirror)}),!k.arrowsImgUrl&&r.jsx(As,{color:k.color,className:ut(Xe.arrowIcon,Xe.arrowImg,Xe.mirror)})]})}),r.jsx("div",{className:ut(Xe.arrow,Xe.nextArrow,{[Xe.arrowVertical]:$.direction==="vert"}),style:{color:k.color,"--arrow-hover-color":k.hover},children:r.jsxs("button",{className:Xe.arrowInner,style:{transform:`translate(${C.scalingValue(k.offset.x*($.direction==="horiz"?-1:1),l)}, ${C.scalingValue(k.offset.y,l)}) scale(${k.scale}) rotate(${$.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var G;return(G=x.current)==null?void 0:G.go("+1")},"aria-label":"Next",children:[k.arrowsImgUrl&&r.jsx(an,{url:k.arrowsImgUrl,fill:k.color,hoverFill:k.hover,className:Xe.arrowImg}),!k.arrowsImgUrl&&r.jsx(As,{color:k.color,className:ut(Xe.arrowIcon,Xe.arrowImg)})]})})]}),te.closeIconUrl&&(()=>{const G=jo(te.closeIconAlign,te.closeIconOffset,l),se=`scale(${te.closeIconScale})`,pe=G.transform?`${G.transform} ${se}`:se;return r.jsx("button",{className:Xe.closeButton,style:{...G,transform:pe},onClick:Z,"aria-label":"Close lightbox",children:r.jsx(an,{url:te.closeIconUrl,fill:te.closeIconColor??"#000000",hoverFill:te.closeIconHover??"#cccccc"})})})(),X&&X.isActive&&i.imageCaption&&((we=n[b])==null?void 0:we.imageCaption)&&r.jsx("div",{className:Xe.caption,style:{...jo(X.alignment,X.offset,l),fontFamily:Mr(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":C.scalingValue(c.width,l),letterSpacing:C.scalingValue(p,l),wordSpacing:C.scalingValue(y,l),textAlign:v,fontSize:C.scalingValue(g.fontSize,l),lineHeight:C.scalingValue(g.lineHeight,l),textTransform:h.textTransform??"none",textDecoration:h.textDecoration??"none",fontVariant:h.fontVariant??"normal",color:m},onClick:G=>G.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:Xe.captionTextInner,style:{"--link-color":X.linkColor,"--link-hover-color":X.linkHoverColor},children:r.jsx(yi,{content:n[b].imageCaption})})}),ae.isActive&&(()=>{const[G,se]=ae.position.split("-"),pe=$.direction==="horiz"?`${G}-left`:ae.position,Se=jo(pe,ae.offset,l),Me=()=>{if($.direction==="horiz"){if(se==="left")return"flex-start";if(se==="center")return"center";if(se==="right")return"flex-end"}else{if(G==="top")return"flex-start";if(G==="middle")return"center";if(G==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:S,className:Xe.thumbsWrapper,onClick:Le=>ke(Le),style:{position:l?"absolute":"fixed",...Se,...$.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:ut(Xe.thumbsContainer,{[Xe.thumbsContainerVertical]:$.direction==="vert",[Xe.thumbsAlignStart]:ae.align==="start",[Xe.thumbsAlignCenter]:ae.align==="center",[Xe.thumbsAlignEnd]:ae.align==="end"}),style:{gap:C.scalingValue(ae.grid.gap,l),justifyContent:M?"flex-start":Me()},children:n.map((Le,H)=>{const ye=H===b,re=L[H],ee=ae.grid.size*(ye?ae.activeState.scale:1),Ae=()=>{if(ae.fit!=="fit")return{};if(!re)return $.direction==="horiz"?{height:C.scalingValue(ee,l)}:{width:C.scalingValue(ee,l)};const ue=re.width/re.height;if($.direction==="horiz"){const N=ee,Ue=N*ue;return{width:C.scalingValue(Ue,l),height:C.scalingValue(N,l)}}else{const N=ee,Ue=N/ue;return{width:C.scalingValue(N,l),height:C.scalingValue(Ue,l)}}};return r.jsx("button",{className:Xe.thumbItem,style:{...$.direction==="horiz"&&ae.fit!=="fit"?{height:C.scalingValue(ee,l)}:{},...$.direction==="vert"&&ae.fit!=="fit"?{width:C.scalingValue(ee,l)}:{},...ae.fit==="cover"?{width:C.scalingValue(ee,l),height:C.scalingValue(ee,l)}:{},...Ae(),transition:ye?"all 0.25s ease-out":"none",opacity:ye?ae.activeState.opacity/100:ae.opacity/100,"--thumb-hover":ae.activeState.opacity/100},onClick:ue=>{var N;ue.stopPropagation(),I(H),(N=x.current)==null||N.go(H)},onMouseEnter:()=>{var ue;ae.triggers==="hov"&&((ue=x.current)==null||ue.go(H))},children:r.jsx("img",{src:Le.image.url,alt:Le.image.name??"",onLoad:ue=>{const N=ue.currentTarget;N.naturalWidth&&N.naturalHeight&&O(Ue=>({...Ue,[H]:{width:N.naturalWidth,height:N.naturalHeight}}))},style:{objectFit:ae.fit==="cover"?"cover":"contain",...ae.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...ae.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Le.image.name}-${H}`)})})})})()]})]}),document.getElementById(s))};function As({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const xm={element:ym,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Lightbox.png"},defaultSize:{d:{width:440,height:550},t:{width:235,height:293},m:{width:265,height:331}},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.thumbnailBlock.cover.url",placeholderEnabled:!0},{path:"settings.controls.arrowsImgUrl"},{path:"settings.area.closeIconUrl"}]},schema:{type:"object",properties:{settings:{type:"object",properties:{thumbnailBlock:{display:{type:"settings-block",triggerEvent:"close"},type:"object",properties:{cover:{title:"COVER",icon:"cover",tooltip:"Cover Image",type:"object",properties:{url:{type:"string",display:{type:"cover-image-input"}}}}}},lightboxBlock:{display:{type:"settings-block",triggerEvent:"open"},type:"object",properties:{appear:{title:"APPEAR",icon:"transition",tooltip:"Appearance",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide in","fade in","mix"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]},direction:{type:"string",title:"From",display:{type:"direction-control"},enum:["top","left","right","bottom"]}}},triggers:{title:"TRIGGERS",icon:"target",tooltip:"Triggers",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["click","drag"]},switch:{type:"string",display:{type:"ratio-group"},enum:["image","50/50"]},repeat:{type:"string",title:"Repeat",display:{visible:!1,type:"ratio-group"},enum:["close","loop"]}}},slider:{title:"SLIDER",icon:"horizontal-resize",tooltip:"Slider",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade","scale"]},direction:{type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},thumbnail:{title:"THUMB",icon:"thumbnail",tooltip:"Thumbnail",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},fit:{type:"string",display:{type:"ratio-group"},enum:["cover","fit"]},align:{type:"string",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},triggers:{type:"string",title:"Triggers",display:{type:"ratio-group",direction:"horizontal"},enum:["clk","hov"]},grid:{type:"object",title:"Grid",display:{type:"group"},properties:{size:{type:"number",label:"Box",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},gap:{type:"number",label:"Gap",scalingEnabled:!0,min:0,display:{type:"numeric-input"}}}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}},activeState:{type:"object",title:"ACTIVE",display:{type:"group"},properties:{scale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control"}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}}}}}},layout:{title:"LAYOUT",icon:"layout",tooltip:"Layout",type:"object",properties:{position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},padding:{type:"object",title:"Padding",display:{type:"padding-controls"},properties:{top:{min:0,step:1,type:"number"},left:{min:0,step:1,type:"number"},right:{min:0,step:1,type:"number"},bottom:{min:0,step:1,type:"number"}}}}},controls:{title:"CONTROLS",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},color:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},area:{title:"AREA",icon:"area",tooltip:"Area",type:"object",properties:{color:{type:"string",display:{type:"settings-color-picker",format:"single"}},blur:{type:"number",label:"icon:blur",display:{type:"numeric-input"}},closeIconUrl:{type:["string","null"],title:"Close Icon",display:{type:"settings-image-input"}},closeIconAlign:{display:{type:"align-grid",direction:"horizontal"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},closeIconScale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},closeIconOffset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},closeIconColor:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},closeIconHover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},caption:{title:"DESC",icon:"text-icon",tooltip:"Description",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}}}},default:{d:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"slide in",duration:"1000ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.01,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:0,bottom:.06,left:0}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},linkColor:"#cccccc",linkHoverColor:"#cccccc"}}},m:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"horiz",duration:"1000ms"},thumbnail:{isActive:!0,position:"bottom-center",fit:"fit",align:"start",triggers:"hov",grid:{size:.1,gap:.05},offset:{x:.01,y:-.05},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.05,bottom:.06,left:.05}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}},t:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.03,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.1,bottom:.06,left:.1}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}}},displayRules:[{if:{name:"lightboxBlock.appear.type",value:"slide in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.slider.direction",value:"vert"},then:{name:"properties.lightboxBlock.properties.thumbnail.properties.align.display.direction",value:"vertical"}},{if:{name:"lightboxBlock.appear.type",value:"mix"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.appear.type",value:"fade in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!1}},{if:[{name:"lightboxBlock.triggers.type",value:"click"},{name:"lightboxBlock.triggers.switch",value:"image"}],then:{name:"properties.lightboxBlock.properties.triggers.properties.repeat.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{label:"Description",placeholder:"Add Caption...",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/2.jpg",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/3.jpg",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/4.jpg",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}};function zo(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function bm(e){return`
7
7
  .${e}-wrapper {
8
8
  display: flex;
9
9
  flex-direction: column;
10
10
  width: 100%;
11
- min-height: ${jo(48)};
11
+ min-height: ${zo(48)};
12
12
  }
13
13
  .${e}-wrapper.${e}-type-C .${e}-input:focus-visible,
14
14
  .${e}-wrapper.${e}-type-C .${e}-button:focus-visible {
@@ -32,7 +32,7 @@
32
32
  min-width: 0;
33
33
  }
34
34
  .${e}-field-group.${e}-labeled {
35
- gap: ${jo(4)};
35
+ gap: ${zo(4)};
36
36
  }
37
37
  .${e}-field-label {
38
38
  white-space: nowrap;
@@ -128,11 +128,11 @@
128
128
  outline: none;
129
129
  }
130
130
  .${e}-success {
131
- margin-top: ${jo(8)};
131
+ margin-top: ${zo(8)};
132
132
  color: var(--${e}-success-success-color, var(--${e}-success-color));
133
133
  }
134
134
  .${e}-error {
135
- margin-top: ${jo(8)};
135
+ margin-top: ${zo(8)};
136
136
  color: var(--${e}-error-error-color, var(--${e}-error-color));
137
137
  }
138
138
  .${e}-overlay-anchor {
@@ -155,7 +155,7 @@
155
155
  pointer-events: auto;
156
156
  z-index: 10;
157
157
  }
158
- `}function vm({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:s}){const l=!!n,d=i&&t||!t,{prefix:c}=S.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:x=[],buttonLabel:v,gap:f,fieldsGap:h,buttonCorners:m,buttonStroke:b,buttonPadding:I,isButtonFullWidth:R,inputCorners:T,inputStroke:U,inputPadding:A,inputColor:B,inputTextColor:P,inputBorderColor:L,placeholderColor:j,buttonColor:w,buttonTextColor:W,buttonBorderColor:E,labelTextColor:J,successColor:F,errorColor:X,fontFamily:G,inputFontSettings:V,inputFontSize:ie,inputLineHeight:C,inputLetterSpacing:M,inputWordSpacing:O,inputTextAppearance:re,buttonFontSettings:ne,buttonFontSize:$,buttonLineHeight:ae,buttonLetterSpacing:k,buttonWordSpacing:te,buttonTextAppearance:K,labelFontSettings:fe,labelFontSize:Ie,labelLineHeight:me,labelLetterSpacing:ue,labelWordSpacing:q,labelTextAppearance:Q,statusFontSettings:Y,statusFontSize:Ae,statusLineHeight:Se,statusLetterSpacing:Ee,statusWordSpacing:de,statusTextAppearance:ge,successMessage:be,errorMessage:z,stateOverrides:se}=e,pe=u==="B",xe=x.slice(0,Math.min(p,x.length)),Re={fontSettings:{fontFamily:G,fontWeight:(V==null?void 0:V.fontWeight)??400,fontStyle:(V==null?void 0:V.fontStyle)??"normal"},fontSize:ie??.01,lineHeight:C,letterSpacing:M??0,wordSpacing:O??0,textAppearance:re,color:P},Te=on(qt(Re,t)),_=S.scalingValue(U??0,t),he=S.scalingValue((C??ie??.01)+((A==null?void 0:A.top)??0)+((A==null?void 0:A.bottom)??0)+(u==="C"?U??0:(U??0)*2),t),oe={...Te,borderStyle:"solid",borderRadius:u==="C"?0:S.scalingValue(T??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:_,borderLeftWidth:0}:{borderWidth:_},paddingTop:S.scalingValue((A==null?void 0:A.top)??0,t),paddingRight:S.scalingValue((A==null?void 0:A.right)??0,t),paddingBottom:S.scalingValue((A==null?void 0:A.bottom)??0,t),paddingLeft:S.scalingValue((A==null?void 0:A.left)??0,t),height:he,minHeight:he},H={fontSettings:{fontFamily:G,fontWeight:(ne==null?void 0:ne.fontWeight)??400,fontStyle:(ne==null?void 0:ne.fontStyle)??"normal"},fontSize:$??.01,lineHeight:ae,letterSpacing:k??0,wordSpacing:te??0,textAppearance:K,color:W},ee=on(qt(H,t)),Me=S.scalingValue(b??0,t),le={fontSettings:{fontFamily:G,fontWeight:(fe==null?void 0:fe.fontWeight)??400,fontStyle:(fe==null?void 0:fe.fontStyle)??"normal"},fontSize:Ie??.01,lineHeight:me,letterSpacing:ue??0,wordSpacing:q??0,textAppearance:Q,color:J},D=qt(le,t),Ve={fontSettings:{fontFamily:G,fontWeight:(Y==null?void 0:Y.fontWeight)??400,fontStyle:(Y==null?void 0:Y.fontStyle)??"normal"},fontSize:Ae??.01,lineHeight:Se,letterSpacing:Ee??0,wordSpacing:de??0,textAppearance:ge,color:F},Oe=on(qt(Ve,t)),lt=S.buildColorVars(c,{inputColor:B,inputTextColor:P,inputBorderColor:L,placeholderColor:j!=null&&j.trim()?j:"#cccccc",buttonColor:w,buttonTextColor:W,buttonBorderColor:E,labelTextColor:J,successColor:F,errorColor:X},bm,xm,se),[tt,ht]=a.useState(()=>Object.fromEntries(xe.map(We=>[We.name,""]))),[nt,Be]=a.useState("idle"),[ve,ke]=a.useState(null),De=s==="success"?"success":s==="error"?"error":nt,Ue=s==="error"?z:ve,$e=s==="filled",He=a.useMemo(()=>{if(!$e)return tt;let We=null;for(const Ke of xe)(tt[Ke.name]??"").trim().length>0||(We=We??{...tt},We[Ke.name]="Filled");return We??tt},[tt,$e,xe]),ze=De==="error"?S.getFormFieldValidationError(xe,He):null,ct=`${s&&s!=="default"?`${c}-state-${s}`:""}`.trim(),Je=o==null?void 0:o.submitUrl,$t=(We,Ke)=>{ht(je=>({...je,[We]:Ke}))},dt=async We=>{if(We.preventDefault(),!d)return;const Ke=Object.fromEntries(xe.map(ut=>{var pt;return[ut.name,((pt=tt[ut.name])==null?void 0:pt.trim())??""]}).filter(([,ut])=>ut));if(!Je){Be("error"),ke("No integrations were found for this form.");return}if(Object.keys(Ke).length===0)return;const je=S.getFormFieldValidationError(xe,tt);if(je){Be("error"),ke(je);return}Be("submitting"),ke(null);try{const ut=await fetch(Je,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ke)});if(!ut.ok){const pt=await ut.text();throw new Error(pt||`Request failed: ${ut.status}`)}Be("success"),ht(Object.fromEntries(xe.map(pt=>[pt.name,""])))}catch(ut){Be("error"),ke(ut instanceof Error?ut.message:"Something went wrong")}};return r.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${ct}`.trim(),style:lt,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ym(c)}}),r.jsxs("form",{onSubmit:dt,className:`${c}-form`,children:[r.jsx("div",{className:`${c}-fields`,children:xe.map((We,Ke)=>r.jsxs(a.Fragment,{children:[Ke>0&&r.jsx("div",{"data-controls":l?"fieldsGap":void 0,className:l?`${c}-control`:void 0,style:{height:S.scalingValue(h??0,t)}}),r.jsxs("div",{className:`${c}-field-group${pe?` ${c}-labeled`:""}`,children:[pe&&r.jsx("span",{className:`${c}-field-label`,style:D?{...D,lineHeight:D.fontSize}:void 0,children:We.label||We.name}),We.type==="textarea"?r.jsx("textarea",{name:We.name,autoComplete:"off",value:He[We.name]??"",onChange:je=>$t(We.name,je.target.value),placeholder:We.placeholder,className:`${c}-input`,style:oe,rows:1,"data-filled":$e||(He[We.name]??"").trim().length>0,"data-field-type":"textarea"}):r.jsx("input",{type:We.type==="phone"?"tel":We.type==="email"?"email":"text",name:We.name,autoComplete:"off",value:He[We.name]??"",onChange:je=>$t(We.name,je.target.value),placeholder:We.placeholder,required:We.isRequired??We.type==="email",className:`${c}-input`,style:oe,"data-filled":$e||(He[We.name]??"").trim().length>0})]})]},Ke))}),r.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${c}-control`:void 0,style:{height:S.scalingValue(f??0,t)}}),r.jsx("div",{className:`${c}-overlay-anchor`,children:r.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:S.scalingValue(m??0,t),borderWidth:Me,paddingTop:S.scalingValue((I==null?void 0:I.top)??0,t),paddingRight:S.scalingValue((I==null?void 0:I.right)??0,t),paddingBottom:S.scalingValue((I==null?void 0:I.bottom)??0,t),paddingLeft:S.scalingValue((I==null?void 0:I.left)??0,t),pointerEvents:d?"auto":void 0,...ee,...R?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:r.jsx("span",{className:`${c}-overlay-anchor`,style:R?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:nt==="submitting"?"...":v})})})]}),De==="success"&&r.jsx("p",{className:`${c}-success`,style:{...Oe},children:be}),De==="error"&&r.jsx("p",{className:`${c}-error`,style:{...Oe},role:"alert",children:ze??Ue??z})]})}const bm={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"},xm=["hover","focus","filled","success","error"],wm=`import React, { useMemo, useState } from 'react';
158
+ `}function wm({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:s}){const l=!!n,d=i&&t||!t,{prefix:c}=C.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:v=[],buttonLabel:y,gap:g,fieldsGap:h,buttonCorners:m,buttonStroke:b,buttonPadding:I,isButtonFullWidth:R,inputCorners:T,inputStroke:q,inputPadding:F,inputColor:V,inputTextColor:A,inputBorderColor:L,placeholderColor:O,buttonColor:x,buttonTextColor:W,buttonBorderColor:E,labelTextColor:J,successColor:P,errorColor:K,fontFamily:B,inputFontSettings:z,inputFontSize:ie,inputLineHeight:S,inputLetterSpacing:M,inputWordSpacing:D,inputTextAppearance:le,buttonFontSettings:oe,buttonFontSize:$,buttonLineHeight:ae,buttonLetterSpacing:k,buttonWordSpacing:te,buttonTextAppearance:X,labelFontSettings:ve,labelFontSize:Pe,labelLineHeight:he,labelLetterSpacing:ce,labelWordSpacing:U,labelTextAppearance:Y,statusFontSettings:Z,statusFontSize:We,statusLineHeight:$e,statusLetterSpacing:ke,statusWordSpacing:de,statusTextAppearance:fe,successMessage:we,errorMessage:G,stateOverrides:se}=e,pe=u==="B",Se=v.slice(0,Math.min(p,v.length)),Me={fontSettings:{fontFamily:B,fontWeight:(z==null?void 0:z.fontWeight)??400,fontStyle:(z==null?void 0:z.fontStyle)??"normal"},fontSize:ie??.01,lineHeight:S,letterSpacing:M??0,wordSpacing:D??0,textAppearance:le,color:A},Le=rn(Xt(Me,t)),H=C.scalingValue(q??0,t),ye=C.scalingValue((S??ie??.01)+((F==null?void 0:F.top)??0)+((F==null?void 0:F.bottom)??0)+(u==="C"?q??0:(q??0)*2),t),re={...Le,borderStyle:"solid",borderRadius:u==="C"?0:C.scalingValue(T??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:H,borderLeftWidth:0}:{borderWidth:H},paddingTop:C.scalingValue((F==null?void 0:F.top)??0,t),paddingRight:C.scalingValue((F==null?void 0:F.right)??0,t),paddingBottom:C.scalingValue((F==null?void 0:F.bottom)??0,t),paddingLeft:C.scalingValue((F==null?void 0:F.left)??0,t),height:ye,minHeight:ye},_={fontSettings:{fontFamily:B,fontWeight:(oe==null?void 0:oe.fontWeight)??400,fontStyle:(oe==null?void 0:oe.fontStyle)??"normal"},fontSize:$??.01,lineHeight:ae,letterSpacing:k??0,wordSpacing:te??0,textAppearance:X,color:W},ee=rn(Xt(_,t)),Ae=C.scalingValue(b??0,t),ue={fontSettings:{fontFamily:B,fontWeight:(ve==null?void 0:ve.fontWeight)??400,fontStyle:(ve==null?void 0:ve.fontStyle)??"normal"},fontSize:Pe??.01,lineHeight:he,letterSpacing:ce??0,wordSpacing:U??0,textAppearance:Y,color:J},N=Xt(ue,t),Ue={fontSettings:{fontFamily:B,fontWeight:(Z==null?void 0:Z.fontWeight)??400,fontStyle:(Z==null?void 0:Z.fontStyle)??"normal"},fontSize:We??.01,lineHeight:$e,letterSpacing:ke??0,wordSpacing:de??0,textAppearance:fe,color:P},Oe=rn(Xt(Ue,t)),dt=C.buildColorVars(c,{inputColor:V,inputTextColor:A,inputBorderColor:L,placeholderColor:O!=null&&O.trim()?O:"#cccccc",buttonColor:x,buttonTextColor:W,buttonBorderColor:E,labelTextColor:J,successColor:P,errorColor:K},Sm,$m,se),[nt,ht]=a.useState(()=>Object.fromEntries(Se.map(Ee=>[Ee.name,""]))),[st,Be]=a.useState("idle"),[xe,Fe]=a.useState(null),je=s==="success"?"success":s==="error"?"error":st,Ke=s==="error"?G:xe,ne=s==="filled",ge=a.useMemo(()=>{if(!ne)return nt;let Ee=null;for(const qe of Se)(nt[qe.name]??"").trim().length>0||(Ee=Ee??{...nt},Ee[qe.name]="Filled");return Ee??nt},[nt,ne,Se]),Ie=je==="error"?C.getFormFieldValidationError(Se,ge):null,Ze=`${s&&s!=="default"?`${c}-state-${s}`:""}`.trim(),Ve=o==null?void 0:o.submitUrl,at=(Ee,qe)=>{ht(_e=>({..._e,[Ee]:qe}))},Je=async Ee=>{if(Ee.preventDefault(),!d)return;const qe=Object.fromEntries(Se.map(tt=>{var rt;return[tt.name,((rt=nt[tt.name])==null?void 0:rt.trim())??""]}).filter(([,tt])=>tt));if(!Ve){Be("error"),Fe("No integrations were found for this form.");return}if(Object.keys(qe).length===0)return;const _e=C.getFormFieldValidationError(Se,nt);if(_e){Be("error"),Fe(_e);return}Be("submitting"),Fe(null);try{const tt=await fetch(Ve,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(qe)});if(!tt.ok){const rt=await tt.text();throw new Error(rt||`Request failed: ${tt.status}`)}Be("success"),ht(Object.fromEntries(Se.map(rt=>[rt.name,""])))}catch(tt){Be("error"),Fe(tt instanceof Error?tt.message:"Something went wrong")}};return r.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${Ze}`.trim(),style:dt,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:bm(c)}}),r.jsxs("form",{onSubmit:Je,className:`${c}-form`,children:[r.jsx("div",{className:`${c}-fields`,children:Se.map((Ee,qe)=>r.jsxs(a.Fragment,{children:[qe>0&&r.jsx("div",{"data-controls":l?"fieldsGap":void 0,className:l?`${c}-control`:void 0,style:{height:C.scalingValue(h??0,t)}}),r.jsxs("div",{className:`${c}-field-group${pe?` ${c}-labeled`:""}`,children:[pe&&r.jsx("span",{className:`${c}-field-label`,style:N?{...N,lineHeight:N.fontSize}:void 0,children:Ee.label||Ee.name}),Ee.type==="textarea"?r.jsx("textarea",{name:Ee.name,autoComplete:"off",value:ge[Ee.name]??"",onChange:_e=>at(Ee.name,_e.target.value),placeholder:Ee.placeholder,className:`${c}-input`,style:re,rows:1,"data-filled":ne||(ge[Ee.name]??"").trim().length>0,"data-field-type":"textarea"}):r.jsx("input",{type:Ee.type==="phone"?"tel":Ee.type==="email"?"email":"text",name:Ee.name,autoComplete:"off",value:ge[Ee.name]??"",onChange:_e=>at(Ee.name,_e.target.value),placeholder:Ee.placeholder,required:Ee.isRequired??Ee.type==="email",className:`${c}-input`,style:re,"data-filled":ne||(ge[Ee.name]??"").trim().length>0})]})]},qe))}),r.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${c}-control`:void 0,style:{height:C.scalingValue(g??0,t)}}),r.jsx("div",{className:`${c}-overlay-anchor`,children:r.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:C.scalingValue(m??0,t),borderWidth:Ae,paddingTop:C.scalingValue((I==null?void 0:I.top)??0,t),paddingRight:C.scalingValue((I==null?void 0:I.right)??0,t),paddingBottom:C.scalingValue((I==null?void 0:I.bottom)??0,t),paddingLeft:C.scalingValue((I==null?void 0:I.left)??0,t),pointerEvents:d?"auto":void 0,...ee,...R?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:r.jsx("span",{className:`${c}-overlay-anchor`,style:R?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:st==="submitting"?"...":y})})})]}),je==="success"&&r.jsx("p",{className:`${c}-success`,style:{...Oe},children:we}),je==="error"&&r.jsx("p",{className:`${c}-error`,style:{...Oe},role:"alert",children:Ie??Ke??G})]})}const Sm={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"},$m=["hover","focus","filled","success","error"],Cm=`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
- `,Sm=[{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"}],zo={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},$m=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],Cm={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:{...zo.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:{...zo.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:{...zo.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:{...zo.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:Sm,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:[...$m],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"]},Tm={element:vm,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:Cm,sourceCode:wm,fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",labelFontSettings:"fontFamily",statusFontSettings:"fontFamily"},assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]}};function Bo(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Lm(e){return`
792
+ `,Tm=[{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"}],Bo={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Lm=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],Rm={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:{...Bo.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:{...Bo.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:{...Bo.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:{...Bo.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:Tm,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:[...Lm],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"]},Im={element:wm,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:Rm,sourceCode:Cm,fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",labelFontSettings:"fontFamily",statusFontSettings:"fontFamily"},assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]}};function Vo(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Em(e){return`
793
793
  .${e}-wrapper {
794
794
  display: flex;
795
795
  flex-direction: column;
@@ -971,16 +971,16 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
971
971
  align-items: center;
972
972
  }
973
973
  .${e}-success {
974
- margin-top: ${Bo(8)};
975
- font-size: ${Bo(14)};
974
+ margin-top: ${Vo(8)};
975
+ font-size: ${Vo(14)};
976
976
  color: var(--${e}-success-success-color, var(--${e}-success-color));
977
977
  }
978
978
  .${e}-error {
979
- margin-top: ${Bo(8)};
980
- font-size: ${Bo(14)};
979
+ margin-top: ${Vo(8)};
980
+ font-size: ${Vo(14)};
981
981
  color: var(--${e}-error-error-color, var(--${e}-error-color));
982
982
  }
983
- `}const Rm=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:s}=S.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:x,inputFontSettings:v,inputFontSize:f,inputLineHeight:h,inputLetterSpacing:m,inputWordSpacing:b,inputTextAppearance:I,buttonFontSettings:R,buttonFontSize:T,buttonLineHeight:U,buttonLetterSpacing:A,buttonWordSpacing:B,buttonTextAppearance:P,statusFontSettings:L,statusFontSize:j,statusLineHeight:w,statusLetterSpacing:W,statusWordSpacing:E,statusTextAppearance:J,iconMaxWidth:F,minHeight:X,corners:G,stroke:V,stateOverrides:ie,inputPadding:C,buttonPadding:M,successMessage:O="Thanks for subscribing!",errorMessage:re="Please, fill all required fields."}=e,ne=d.slice(0,Math.min(p,d.length)),[$,ae]=a.useState(()=>Object.fromEntries(ne.map(le=>[le.name,""]))),[k,te]=a.useState("idle"),[K,fe]=a.useState(null),Ie=o==="success"?"success":o==="error"?"error":k,me=o==="error"?re:K,ue=o==="filled",q=a.useMemo(()=>{if(!ue)return $;let le=null;for(const D of ne)($[D.name]??"").trim().length>0||(le=le??{...$},le[D.name]="Filled");return le??$},[ue,$,ne]),Q=Ie==="error"?S.getFormFieldValidationError(ne,q):null,Y=o&&o!=="default"?`${s}-state-${o}`:"",Ae=ne.some(le=>(q[le.name]??"").trim().length>0),Se=Y!==`${s}-state-filled`&&Ae?`${s}-state-filled`:"",Ee=`${Y} ${Se}`.trim(),de=i==null?void 0:i.submitUrl,ge=u??"",be=(c==null?void 0:c.icon)??"",z=(c==null?void 0:c.mode)==="On",se=ge||"Submit",pe={fontSettings:{fontFamily:x,fontWeight:(v==null?void 0:v.fontWeight)??400,fontStyle:(v==null?void 0:v.fontStyle)??"normal"},fontSize:f??.01,lineHeight:h,letterSpacing:m??0,wordSpacing:b??0,textAppearance:I,color:e.inputTextColor??"#111111"},xe={fontSettings:{fontFamily:x,fontWeight:(R==null?void 0:R.fontWeight)??400,fontStyle:(R==null?void 0:R.fontStyle)??"normal"},fontSize:T??.01,lineHeight:U,letterSpacing:A??0,wordSpacing:B??0,textAppearance:P,color:e.buttonTextColor??"#ffffff"},Re={fontSettings:{fontFamily:x,fontWeight:(L==null?void 0:L.fontWeight)??400,fontStyle:(L==null?void 0:L.fontStyle)??"normal"},fontSize:j??.01,lineHeight:w,letterSpacing:W??0,wordSpacing:E??0,textAppearance:J,color:e.successColor??"#22c55e"},Te=on(qt(pe,t)),_=on(qt(xe,t)),he=on(qt(Re,t)),oe=S.buildColorVars(s,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(pe==null?void 0:pe.color)??"#111111",buttonTextColor:e.buttonTextColor??(xe==null?void 0:xe.color)??"#ffffff"},Im,Em,ie),H={borderRadius:S.scalingValue(G,t),borderWidth:S.scalingValue(V,t),borderStyle:"solid"},ee={borderLeftWidth:S.scalingValue(V,t)},Me=async le=>{if(le.preventDefault(),!l)return;const D=Object.fromEntries(ne.map(Oe=>{var lt;return[Oe.name,((lt=$[Oe.name])==null?void 0:lt.trim())??""]}).filter(([,Oe])=>Oe));if(!de){te("error"),fe("No integrations were found for this form.");return}if(Object.keys(D).length===0)return;const Ve=S.getFormFieldValidationError(ne,$);if(Ve){te("error"),fe(Ve);return}te("submitting"),fe(null);try{const Oe=await fetch(de,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(D)});if(!Oe.ok){const lt=await Oe.text();throw new Error(lt||`Request failed: ${Oe.status}`)}te("success"),ae(Object.fromEntries(ne.map(lt=>[lt.name,""])))}catch(Oe){te("error"),fe(Oe instanceof Error?Oe.message:"Something went wrong")}};return r.jsxs("div",{className:`${s}-wrapper ${Ee}`.trim(),style:oe,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Lm(s)}}),r.jsxs("form",{onSubmit:Me,className:`${s}-form`,style:{...H,height:S.scalingValue(X,t),minHeight:S.scalingValue(X,t)},children:[r.jsx("div",{className:`${s}-inputWrap ${s}-overlayAnchor`,style:{flex:1,minWidth:0},children:ne.map(le=>r.jsx("input",{type:le.type==="email"?"email":le.type==="phone"?"tel":"text",name:le.name,autoComplete:"off",value:q[le.name]??"",onChange:D=>ae(Ve=>({...Ve,[le.name]:D.target.value})),placeholder:le.placeholder,required:le.isRequired??le.type==="email",className:`${s}-input`,style:{...Te,paddingRight:S.scalingValue(C.right,t),paddingLeft:S.scalingValue(C.left,t),paddingTop:S.scalingValue(C.top,t),paddingBottom:S.scalingValue(C.bottom,t)}},le.name))}),r.jsx("div",{className:`${s}-overlayAnchor`,children:r.jsx("button",{type:l?"submit":"button",className:`${s}-submitBtn`,"aria-label":se,style:{..._,...ee,paddingRight:S.scalingValue(M.right,t),paddingLeft:S.scalingValue(M.left,t),paddingTop:S.scalingValue(M.top,t),paddingBottom:S.scalingValue(M.bottom,t),pointerEvents:l?"auto":void 0},children:k==="submitting"?"...":z?be&&r.jsx(rn,{url:be,className:`${s}-submitBtnIcon`,style:{maxWidth:S.scalingValue(F??0,t)},fill:`var(--${s}-button-text-color)`,hoverFill:`var(--${s}-button-text-color)`}):ge})})]}),Ie==="success"&&r.jsx("p",{className:`${s}-success`,style:{...he},children:O}),Ie==="error"&&r.jsx("p",{className:`${s}-error`,style:{...he},role:"alert",children:Q??me??re})]})},Im={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"},Em=["hover","focus","filled","success","error"],Mm=`import React, { useMemo, useState } from 'react';
983
+ `}const Mm=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:s}=C.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:v,inputFontSettings:y,inputFontSize:g,inputLineHeight:h,inputLetterSpacing:m,inputWordSpacing:b,inputTextAppearance:I,buttonFontSettings:R,buttonFontSize:T,buttonLineHeight:q,buttonLetterSpacing:F,buttonWordSpacing:V,buttonTextAppearance:A,statusFontSettings:L,statusFontSize:O,statusLineHeight:x,statusLetterSpacing:W,statusWordSpacing:E,statusTextAppearance:J,iconMaxWidth:P,minHeight:K,corners:B,stroke:z,stateOverrides:ie,inputPadding:S,buttonPadding:M,successMessage:D="Thanks for subscribing!",errorMessage:le="Please, fill all required fields."}=e,oe=d.slice(0,Math.min(p,d.length)),[$,ae]=a.useState(()=>Object.fromEntries(oe.map(ue=>[ue.name,""]))),[k,te]=a.useState("idle"),[X,ve]=a.useState(null),Pe=o==="success"?"success":o==="error"?"error":k,he=o==="error"?le:X,ce=o==="filled",U=a.useMemo(()=>{if(!ce)return $;let ue=null;for(const N of oe)($[N.name]??"").trim().length>0||(ue=ue??{...$},ue[N.name]="Filled");return ue??$},[ce,$,oe]),Y=Pe==="error"?C.getFormFieldValidationError(oe,U):null,Z=o&&o!=="default"?`${s}-state-${o}`:"",We=oe.some(ue=>(U[ue.name]??"").trim().length>0),$e=Z!==`${s}-state-filled`&&We?`${s}-state-filled`:"",ke=`${Z} ${$e}`.trim(),de=i==null?void 0:i.submitUrl,fe=u??"",we=(c==null?void 0:c.icon)??"",G=(c==null?void 0:c.mode)==="On",se=fe||"Submit",pe={fontSettings:{fontFamily:v,fontWeight:(y==null?void 0:y.fontWeight)??400,fontStyle:(y==null?void 0:y.fontStyle)??"normal"},fontSize:g??.01,lineHeight:h,letterSpacing:m??0,wordSpacing:b??0,textAppearance:I,color:e.inputTextColor??"#111111"},Se={fontSettings:{fontFamily:v,fontWeight:(R==null?void 0:R.fontWeight)??400,fontStyle:(R==null?void 0:R.fontStyle)??"normal"},fontSize:T??.01,lineHeight:q,letterSpacing:F??0,wordSpacing:V??0,textAppearance:A,color:e.buttonTextColor??"#ffffff"},Me={fontSettings:{fontFamily:v,fontWeight:(L==null?void 0:L.fontWeight)??400,fontStyle:(L==null?void 0:L.fontStyle)??"normal"},fontSize:O??.01,lineHeight:x,letterSpacing:W??0,wordSpacing:E??0,textAppearance:J,color:e.successColor??"#22c55e"},Le=rn(Xt(pe,t)),H=rn(Xt(Se,t)),ye=rn(Xt(Me,t)),re=C.buildColorVars(s,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(pe==null?void 0:pe.color)??"#111111",buttonTextColor:e.buttonTextColor??(Se==null?void 0:Se.color)??"#ffffff"},Pm,km,ie),_={borderRadius:C.scalingValue(B,t),borderWidth:C.scalingValue(z,t),borderStyle:"solid"},ee={borderLeftWidth:C.scalingValue(z,t)},Ae=async ue=>{if(ue.preventDefault(),!l)return;const N=Object.fromEntries(oe.map(Oe=>{var dt;return[Oe.name,((dt=$[Oe.name])==null?void 0:dt.trim())??""]}).filter(([,Oe])=>Oe));if(!de){te("error"),ve("No integrations were found for this form.");return}if(Object.keys(N).length===0)return;const Ue=C.getFormFieldValidationError(oe,$);if(Ue){te("error"),ve(Ue);return}te("submitting"),ve(null);try{const Oe=await fetch(de,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(N)});if(!Oe.ok){const dt=await Oe.text();throw new Error(dt||`Request failed: ${Oe.status}`)}te("success"),ae(Object.fromEntries(oe.map(dt=>[dt.name,""])))}catch(Oe){te("error"),ve(Oe instanceof Error?Oe.message:"Something went wrong")}};return r.jsxs("div",{className:`${s}-wrapper ${ke}`.trim(),style:re,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Em(s)}}),r.jsxs("form",{onSubmit:Ae,className:`${s}-form`,style:{..._,height:C.scalingValue(K,t),minHeight:C.scalingValue(K,t)},children:[r.jsx("div",{className:`${s}-inputWrap ${s}-overlayAnchor`,style:{flex:1,minWidth:0},children:oe.map(ue=>r.jsx("input",{type:ue.type==="email"?"email":ue.type==="phone"?"tel":"text",name:ue.name,autoComplete:"off",value:U[ue.name]??"",onChange:N=>ae(Ue=>({...Ue,[ue.name]:N.target.value})),placeholder:ue.placeholder,required:ue.isRequired??ue.type==="email",className:`${s}-input`,style:{...Le,paddingRight:C.scalingValue(S.right,t),paddingLeft:C.scalingValue(S.left,t),paddingTop:C.scalingValue(S.top,t),paddingBottom:C.scalingValue(S.bottom,t)}},ue.name))}),r.jsx("div",{className:`${s}-overlayAnchor`,children:r.jsx("button",{type:l?"submit":"button",className:`${s}-submitBtn`,"aria-label":se,style:{...H,...ee,paddingRight:C.scalingValue(M.right,t),paddingLeft:C.scalingValue(M.left,t),paddingTop:C.scalingValue(M.top,t),paddingBottom:C.scalingValue(M.bottom,t),pointerEvents:l?"auto":void 0},children:k==="submitting"?"...":G?we&&r.jsx(an,{url:we,className:`${s}-submitBtnIcon`,style:{maxWidth:C.scalingValue(P??0,t)},fill:`var(--${s}-button-text-color)`,hoverFill:`var(--${s}-button-text-color)`}):fe})})]}),Pe==="success"&&r.jsx("p",{className:`${s}-success`,style:{...ye},children:D}),Pe==="error"&&r.jsx("p",{className:`${s}-error`,style:{...ye},role:"alert",children:Y??he??le})]})},Pm={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"},km=["hover","focus","filled","success","error"],Am=`import React, { useMemo, useState } from 'react';
984
984
  import { CommonComponentProps } from '../props';
985
985
  import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
986
986
  import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
@@ -1557,7 +1557,7 @@ const COLOR_VAR_MAP: Record<OnelinerColorKeys, string> = {
1557
1557
  };
1558
1558
 
1559
1559
  const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
1560
- `,Pm="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>'),km=[{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."}],Vr={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Am=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],Fm={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:{...Vr.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:{...Vr.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:{...Vr.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:km,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:Pm},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:[...Am],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"]},Wm={element:Rm,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:Fm,sourceCode:Mm};function _m(e,t){const n=t>0?`${t}px`:"0px";return`
1560
+ `,Fm="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>'),Wm=[{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."}],Gr={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},_m=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],Hm={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:{...Gr.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:{...Gr.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:{...Gr.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:Wm,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:Fm},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:[..._m],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"]},Nm={element:Mm,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:Hm,sourceCode:Am};function Om(e,t){const n=t>0?`${t}px`:"0px";return`
1561
1561
  .${e}-marquee-wrapper {
1562
1562
  overflow: hidden;
1563
1563
  width: 100%;
@@ -1689,7 +1689,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
1689
1689
  .${e}-image-hover-grayscale:hover video {
1690
1690
  filter: grayscale(100%);
1691
1691
  }
1692
- `}const Hm=30,Nm=20,Gr=3,Om=12,Dm=32,jm=3,zm=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")},Bm=(e,t)=>Array.from({length:t},()=>e).flat(),Vm=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},xc=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),Ps=(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),s=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=xc(d);return c<=0?0:c+s*Math.max(0,t-1)},Gm=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=xc(Array.from(e.children));if(i<=0)return 0;const o=getComputedStyle(e),s=Number.parseFloat(o.columnGap||o.gap||"0")||0,l=Number.parseFloat(o.paddingRight)||0;return i+s*Math.max(0,e.children.length-1)+l},Um=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},qm=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>Um(i,e))},Km=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??"")},Xm=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,Ym=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:s,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var E,J,F,X;const p=a.useRef(null),x=!!((E=e.image)!=null&&E.url&&Km(e.image));a.useLayoutEffect(()=>{d&&Xm(p.current)&&(u==null||u())},[d,(J=e.image)==null?void 0:J.url,u]);const v=n.display==="cover",f=n.ratioValue??"1:1",h=n.reversed??!1,[m,b]=f.split(":").map(Number),T=(h?b:m)/(h?m:b),U=i/T,A=U>o?o:U,B=U>o?o*T:i,P=c(B),L=c(A),j={borderRadius:c(s)},w=v?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...j}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:c(i),maxHeight:c(o),objectFit:"contain",...j},W=((F=e.image)==null?void 0:F.url)&&(x?r.jsx("video",{ref:G=>{p.current=G},src:e.image.url,style:w,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:d?u:void 0,onError:d?u:void 0}):r.jsx("img",{ref:G=>{p.current=G},src:e.image.url,alt:((X=e.image)==null?void 0:X.name)??"",style:w,onLoad:d?u:void 0,onError:d?u:void 0}));return r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...v?{width:P}:{width:"max-content",maxWidth:c(i),minWidth:0}},children:r.jsx("div",{className:l,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...v?{width:P,height:L,overflow:"hidden",...j}:{width:"max-content",maxWidth:c(i),height:c(o)}},children:W&&e.link?r.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:rt(`${t}-marquee-link`,!v&&`${t}-marquee-link-contain`),children:W}):W})})},Zm=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=S.useScopedStyles(),[l,d]=a.useState(0),c=l>0?Math.round(l):0,u=a.useMemo(()=>_m(s,c),[s,c]),{speed:p,direction:x,pauseOnHover:v,gap:f,imageMaxWidth:h,imageMaxHeight:m,hoverEffect:b,cornerRadius:I=0}=e,R=a.useMemo(()=>Vm(e.imageFit),[e.imageFit]),T=(t==null?void 0:t.length)??0,U=!!o,A=!n||!!i,B=A&&b!=="off"&&b!=="randomize"?`${s}-image-hover-${b}`:void 0,P=n?!!i:!0,j=((t==null?void 0:t.length)??0)>0&&(P||!!n),w=Math.max(0,p)*Hm,W=Se=>S.scalingValue(Se,n??!1),E=a.useRef(null),J=a.useRef(null),F=a.useRef(null),[X,G]=a.useState(0),V=P&&v==="on",[ie,C]=a.useState(!1),[M,O]=a.useState({}),re=a.useRef(M);re.current=M;const ne=a.useRef(null),$=a.useRef(0),ae=a.useRef(null),k=a.useMemo(()=>(t??[]).map(Se=>{var Ee;return((Ee=Se.image)==null?void 0:Ee.url)??""}).join("\0"),[t]),[te,K]=a.useState(Gr),fe=a.useMemo(()=>{const Se=t??[];return Se.length===0||!(P||!!n)?Se:Bm(Se,te)},[t,P,te,n]),Ie=a.useMemo(()=>(t??[]).filter(Se=>{var Ee;return!!((Ee=Se.image)!=null&&Ee.url)}).length,[t]),me=j?jm:1;a.useLayoutEffect(()=>{$.current=0,O({}),ne.current=null,K(Gr),d(0)},[k]),a.useEffect(()=>{if(!A||b!=="randomize")return;const Se=E.current;if(!Se)return;const Ee=z=>{O(se=>{const pe=Array.from(z).filter(Re=>Re in se&&!qm(Se,Re));if(pe.length===0)return se;const xe={...se};return pe.forEach(Re=>{delete xe[Re]}),xe})},de=new IntersectionObserver(z=>{const se=new Set;for(const pe of z){const xe=pe.target.dataset.marqueeItemIndex,Re=xe!==void 0?Number(xe):NaN;Number.isNaN(Re)||se.add(Re)}se.size>0&&Ee(se)},{root:Se,threshold:0});Object.keys(M).forEach(z=>{const se=Number(z);Se.querySelectorAll(`[data-marquee-item-index="${se}"]`).forEach(pe=>de.observe(pe))});const ge={current:0},be=()=>{const z=Object.keys(re.current);z.length!==0&&(Ee(z.map(Number)),ge.current=requestAnimationFrame(be))};return Object.keys(re.current).length>0&&(ge.current=requestAnimationFrame(be)),()=>{cancelAnimationFrame(ge.current),de.disconnect()}},[b,M,A]),a.useLayoutEffect(()=>{if(!j)return;const Se=E.current,Ee=F.current;if(!Se||!Ee)return;const de={current:0},ge=()=>{const se=Se.getBoundingClientRect().width||Se.offsetWidth,pe=Gm(Ee),xe=ne.current,Re=typeof xe=="number"&&Math.abs(xe-pe)<=.25;ne.current=pe;let Te=te,_=0;if((P||n)&&T>0&&se>0){const H=Ps(Ee,T);if(H>=Dm){_=H;const ee=Math.min(Om,Math.max(Gr,Math.ceil(se/H)+1));Te=ee,ee!==te&&K(ee)}}const oe=Te!==te&&_>0?_*Te:pe>0?pe:_>0?_*Te:(()=>{const H=Ps(Ee,T);return H>0?H*Te:0})();oe>0?d(H=>H<=0?oe:!Re||Math.round(H)===Math.round(oe)?H:oe):!Re&&l<=0&&(cancelAnimationFrame(de.current),de.current=requestAnimationFrame(ge))},be=()=>{cancelAnimationFrame(de.current),de.current=requestAnimationFrame(ge)};ae.current=be,be();const z=new ResizeObserver(be);return z.observe(Se),z.observe(Ee),()=>{ae.current=null,cancelAnimationFrame(de.current),z.disconnect()}},[P,j,l,k,te,T,n]),a.useLayoutEffect(()=>{if(!j||c<=0)return;const Se=J.current;Se&&zm(Se)},[j,c,x,w]),a.useLayoutEffect(()=>{if(!j||l<=0){G(0);return}const Se=J.current,Ee=F.current;if(!Se||!Ee)return;const de=()=>{const be=Se.offsetHeight||Se.getBoundingClientRect().height,z=Array.from(Ee.children).reduce((pe,xe)=>Math.max(pe,xe.offsetHeight||xe.getBoundingClientRect().height),0),se=be>0?be:z;G(se>0?se:0)};de();const ge=new ResizeObserver(de);return ge.observe(Se),ge.observe(Ee),()=>ge.disconnect()},[j,me,fe,n,f,h,m,l,R,M]),a.useLayoutEffect(()=>{if(!n||!U||!j||typeof window>"u")return;const Se=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(Se)},[n,U,j,x,l,X,f,fe]);const ue=()=>{V&&C(!0)},q=()=>{V&&C(!1)},Q=a.useCallback(()=>{var Se;$.current=Math.min(Ie,$.current+1),(Se=ae.current)==null||Se.call(ae)},[Ie]),Y=a.useCallback((Se,Ee)=>{O(de=>{const ge=de[Se]??Ee,be=(t??[]).filter(se=>se!==ge);if(be.length===0)return de;const z=be[Math.floor(Math.random()*be.length)];return{...de,[Se]:z}})},[t]),Ae=(Se,Ee,de,ge)=>{const be=A&&b==="randomize"&&R.display==="cover"?M[de]??Se:Se,z=`max(${W(f)}, ${Nm}px)`,se=`calc(-0.5 * (${z} + ${W(f)}))`;return r.jsxs("div",{className:`${s}-marquee-card`,"data-marquee-item-index":de,onMouseEnter:A&&b==="randomize"&&R.display==="cover"?()=>Y(de,Se):void 0,children:[r.jsx(Ym,{item:be,prefix:s,imageFit:R,imageMaxWidth:h,imageMaxHeight:m,cornerRadius:I,imageHoverClass:B,isEditor:n,isFirstSet:ge,scaled:W,onFirstSetImageDone:Q}),U&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${s}-gap-control`,style:{position:"absolute",top:0,right:se,width:z,height:"100%"}})]},`${Ee}-${de}`)};if(j){const Se=P?V&&ie?"paused":"running":"paused",Ee=c>0&&w>0?c/w*1e3:0,de=`${Math.max(0,Ee)/1e3}s`;return r.jsxs("div",{ref:E,className:rt(`${s}-wrapper`,`${s}-marquee-wrapper`),"aria-label":"Marquee",style:X>0?{height:X}:void 0,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),r.jsx("div",{ref:J,className:`${s}-marquee-track`,"data-direction":x,onMouseEnter:ue,onMouseLeave:q,style:{WebkitAnimationDuration:de,animationDuration:de,WebkitAnimationPlayState:Se,animationPlayState:Se},children:Array.from({length:me},(ge,be)=>r.jsx("div",{ref:be===0?F:void 0,className:rt(`${s}-marquee-row`,`${s}-marquee-set`),style:{gap:W(f),paddingRight:W(f)},"aria-hidden":be>0,children:fe.map((z,se)=>Ae(z,be,se,be===0&&se<T))},`set-${be}`))})]})}return r.jsxs("div",{ref:E,className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),r.jsx("div",{className:rt(`${s}-marquee-row`,`${s}-marquee-static`),style:{gap:W(f),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((Se,Ee)=>Ae(Se,0,Ee))},"marquee-static")]})},Jm=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
1692
+ `}const Dm=30,jm=20,qr=3,zm=12,Bm=32,Vm=3,Gm=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")},qm=(e,t)=>Array.from({length:t},()=>e).flat(),Um=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},$c=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),Fs=(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),s=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=$c(d);return c<=0?0:c+s*Math.max(0,t-1)},Xm=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=$c(Array.from(e.children));if(i<=0)return 0;const o=getComputedStyle(e),s=Number.parseFloat(o.columnGap||o.gap||"0")||0,l=Number.parseFloat(o.paddingRight)||0;return i+s*Math.max(0,e.children.length-1)+l},Km=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},Ym=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>Km(i,e))},Zm=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??"")},Jm=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,Qm=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:s,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var E,J,P,K;const p=a.useRef(null),v=!!((E=e.image)!=null&&E.url&&Zm(e.image));a.useLayoutEffect(()=>{d&&Jm(p.current)&&(u==null||u())},[d,(J=e.image)==null?void 0:J.url,u]);const y=n.display==="cover",g=n.ratioValue??"1:1",h=n.reversed??!1,[m,b]=g.split(":").map(Number),T=(h?b:m)/(h?m:b),q=i/T,F=q>o?o:q,V=q>o?o*T:i,A=c(V),L=c(F),O={borderRadius:c(s)},x=y?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...O}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:c(i),maxHeight:c(o),objectFit:"contain",...O},W=((P=e.image)==null?void 0:P.url)&&(v?r.jsx("video",{ref:B=>{p.current=B},src:e.image.url,style:x,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:d?u:void 0,onError:d?u:void 0}):r.jsx("img",{ref:B=>{p.current=B},src:e.image.url,alt:((K=e.image)==null?void 0:K.name)??"",style:x,onLoad:d?u:void 0,onError:d?u:void 0}));return r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...y?{width:A}:{width:"max-content",maxWidth:c(i),minWidth:0}},children:r.jsx("div",{className:l,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...y?{width:A,height:L,overflow:"hidden",...O}:{width:"max-content",maxWidth:c(i),height:c(o)}},children:W&&e.link?r.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:ut(`${t}-marquee-link`,!y&&`${t}-marquee-link-contain`),children:W}):W})})},eg=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=C.useScopedStyles(),[l,d]=a.useState(0),c=l>0?Math.round(l):0,u=a.useMemo(()=>Om(s,c),[s,c]),{speed:p,direction:v,pauseOnHover:y,gap:g,imageMaxWidth:h,imageMaxHeight:m,hoverEffect:b,cornerRadius:I=0}=e,R=a.useMemo(()=>Um(e.imageFit),[e.imageFit]),T=(t==null?void 0:t.length)??0,q=!!o,F=!n||!!i,V=F&&b!=="off"&&b!=="randomize"?`${s}-image-hover-${b}`:void 0,A=n?!!i:!0,O=((t==null?void 0:t.length)??0)>0&&(A||!!n),x=Math.max(0,p)*Dm,W=$e=>C.scalingValue($e,n??!1),E=a.useRef(null),J=a.useRef(null),P=a.useRef(null),[K,B]=a.useState(0),z=A&&y==="on",[ie,S]=a.useState(!1),[M,D]=a.useState({}),le=a.useRef(M);le.current=M;const oe=a.useRef(null),$=a.useRef(0),ae=a.useRef(null),k=a.useMemo(()=>(t??[]).map($e=>{var ke;return((ke=$e.image)==null?void 0:ke.url)??""}).join("\0"),[t]),[te,X]=a.useState(qr),ve=a.useMemo(()=>{const $e=t??[];return $e.length===0||!(A||!!n)?$e:qm($e,te)},[t,A,te,n]),Pe=a.useMemo(()=>(t??[]).filter($e=>{var ke;return!!((ke=$e.image)!=null&&ke.url)}).length,[t]),he=O?Vm:1;a.useLayoutEffect(()=>{$.current=0,D({}),oe.current=null,X(qr),d(0)},[k]),a.useEffect(()=>{if(!F||b!=="randomize")return;const $e=E.current;if(!$e)return;const ke=G=>{D(se=>{const pe=Array.from(G).filter(Me=>Me in se&&!Ym($e,Me));if(pe.length===0)return se;const Se={...se};return pe.forEach(Me=>{delete Se[Me]}),Se})},de=new IntersectionObserver(G=>{const se=new Set;for(const pe of G){const Se=pe.target.dataset.marqueeItemIndex,Me=Se!==void 0?Number(Se):NaN;Number.isNaN(Me)||se.add(Me)}se.size>0&&ke(se)},{root:$e,threshold:0});Object.keys(M).forEach(G=>{const se=Number(G);$e.querySelectorAll(`[data-marquee-item-index="${se}"]`).forEach(pe=>de.observe(pe))});const fe={current:0},we=()=>{const G=Object.keys(le.current);G.length!==0&&(ke(G.map(Number)),fe.current=requestAnimationFrame(we))};return Object.keys(le.current).length>0&&(fe.current=requestAnimationFrame(we)),()=>{cancelAnimationFrame(fe.current),de.disconnect()}},[b,M,F]),a.useLayoutEffect(()=>{if(!O)return;const $e=E.current,ke=P.current;if(!$e||!ke)return;const de={current:0},fe=()=>{const se=$e.getBoundingClientRect().width||$e.offsetWidth,pe=Xm(ke),Se=oe.current,Me=typeof Se=="number"&&Math.abs(Se-pe)<=.25;oe.current=pe;let Le=te,H=0;if((A||n)&&T>0&&se>0){const _=Fs(ke,T);if(_>=Bm){H=_;const ee=Math.min(zm,Math.max(qr,Math.ceil(se/_)+1));Le=ee,ee!==te&&X(ee)}}const re=Le!==te&&H>0?H*Le:pe>0?pe:H>0?H*Le:(()=>{const _=Fs(ke,T);return _>0?_*Le:0})();re>0?d(_=>_<=0?re:!Me||Math.round(_)===Math.round(re)?_:re):!Me&&l<=0&&(cancelAnimationFrame(de.current),de.current=requestAnimationFrame(fe))},we=()=>{cancelAnimationFrame(de.current),de.current=requestAnimationFrame(fe)};ae.current=we,we();const G=new ResizeObserver(we);return G.observe($e),G.observe(ke),()=>{ae.current=null,cancelAnimationFrame(de.current),G.disconnect()}},[A,O,l,k,te,T,n]),a.useLayoutEffect(()=>{if(!O||c<=0)return;const $e=J.current;$e&&Gm($e)},[O,c,v,x]),a.useLayoutEffect(()=>{if(!O||l<=0){B(0);return}const $e=J.current,ke=P.current;if(!$e||!ke)return;const de=()=>{const we=$e.offsetHeight||$e.getBoundingClientRect().height,G=Array.from(ke.children).reduce((pe,Se)=>Math.max(pe,Se.offsetHeight||Se.getBoundingClientRect().height),0),se=we>0?we:G;B(se>0?se:0)};de();const fe=new ResizeObserver(de);return fe.observe($e),fe.observe(ke),()=>fe.disconnect()},[O,he,ve,n,g,h,m,l,R,M]),a.useLayoutEffect(()=>{if(!n||!q||!O||typeof window>"u")return;const $e=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame($e)},[n,q,O,v,l,K,g,ve]);const ce=()=>{z&&S(!0)},U=()=>{z&&S(!1)},Y=a.useCallback(()=>{var $e;$.current=Math.min(Pe,$.current+1),($e=ae.current)==null||$e.call(ae)},[Pe]),Z=a.useCallback(($e,ke)=>{D(de=>{const fe=de[$e]??ke,we=(t??[]).filter(se=>se!==fe);if(we.length===0)return de;const G=we[Math.floor(Math.random()*we.length)];return{...de,[$e]:G}})},[t]),We=($e,ke,de,fe)=>{const we=F&&b==="randomize"&&R.display==="cover"?M[de]??$e:$e,G=`max(${W(g)}, ${jm}px)`,se=`calc(-0.5 * (${G} + ${W(g)}))`;return r.jsxs("div",{className:`${s}-marquee-card`,"data-marquee-item-index":de,onMouseEnter:F&&b==="randomize"&&R.display==="cover"?()=>Z(de,$e):void 0,children:[r.jsx(Qm,{item:we,prefix:s,imageFit:R,imageMaxWidth:h,imageMaxHeight:m,cornerRadius:I,imageHoverClass:V,isEditor:n,isFirstSet:fe,scaled:W,onFirstSetImageDone:Y}),q&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${s}-gap-control`,style:{position:"absolute",top:0,right:se,width:G,height:"100%"}})]},`${ke}-${de}`)};if(O){const $e=A?z&&ie?"paused":"running":"paused",ke=c>0&&x>0?c/x*1e3:0,de=`${Math.max(0,ke)/1e3}s`;return r.jsxs("div",{ref:E,className:ut(`${s}-wrapper`,`${s}-marquee-wrapper`),"aria-label":"Marquee",style:K>0?{height:K}:void 0,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),r.jsx("div",{ref:J,className:`${s}-marquee-track`,"data-direction":v,onMouseEnter:ce,onMouseLeave:U,style:{WebkitAnimationDuration:de,animationDuration:de,WebkitAnimationPlayState:$e,animationPlayState:$e},children:Array.from({length:he},(fe,we)=>r.jsx("div",{ref:we===0?P:void 0,className:ut(`${s}-marquee-row`,`${s}-marquee-set`),style:{gap:W(g),paddingRight:W(g)},"aria-hidden":we>0,children:ve.map((G,se)=>We(G,we,se,we===0&&se<T))},`set-${we}`))})]})}return r.jsxs("div",{ref:E,className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),r.jsx("div",{className:ut(`${s}-marquee-row`,`${s}-marquee-static`),style:{gap:W(g),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map(($e,ke)=>We($e,0,ke))},"marquee-static")]})},tg=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
1693
1693
  import cn from 'classnames';
1694
1694
  import { CommonComponentProps } from '../props';
1695
1695
  import { scalingValue } from '../utils/scalingValue';
@@ -2472,7 +2472,977 @@ type MarqueeProps = {
2472
2472
  isPreviewMode?: boolean;
2473
2473
  isEditMode?: boolean;
2474
2474
  } & CommonComponentProps;
2475
- `,Qm={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:""}]}},eg={element:Zm,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:Qm,sourceCode:Jm,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}};function tg(e,t){const n=t>0?`${t}px`:"0px";return`
2475
+ `,ng={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:""}]}},ig={element:eg,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:ng,sourceCode:tg,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}};function og(e,t,n){const i=t>0?`${t}px`:"0px",o=n?`
2476
+ .${e}-item-image-wrap {
2477
+ display: flex;
2478
+ flex: 0 0 auto;
2479
+ align-items: center;
2480
+ }
2481
+ .${e}-glyph {
2482
+ display: inline-block;
2483
+ }
2484
+ .${e}-glyph-inner {
2485
+ display: inline-block;
2486
+ transform-origin: 50% 50%;
2487
+ backface-visibility: hidden;
2488
+ -webkit-backface-visibility: hidden;
2489
+ }
2490
+ .${e}-item-image {
2491
+ transform-origin: 50% 50%;
2492
+ backface-visibility: hidden;
2493
+ -webkit-backface-visibility: hidden;
2494
+ }
2495
+ `:"";return`
2496
+ .${e}-wrapper {
2497
+ position: relative;
2498
+ width: 100%;
2499
+ height: auto;
2500
+ }
2501
+ .${e}-marquee-wrapper {
2502
+ position: relative;
2503
+ overflow: hidden;
2504
+ width: 100%;
2505
+ height: auto;
2506
+ }
2507
+ .${e}-curve-bg {
2508
+ position: absolute;
2509
+ left: 0;
2510
+ top: 0;
2511
+ width: 100%;
2512
+ height: 100%;
2513
+ overflow: visible;
2514
+ pointer-events: none;
2515
+ z-index: 0;
2516
+ }
2517
+ .${e}-ribbon {
2518
+ position: absolute;
2519
+ left: 0;
2520
+ top: 50%;
2521
+ width: 100%;
2522
+ transform: translateY(-50%);
2523
+ pointer-events: none;
2524
+ z-index: 0;
2525
+ }
2526
+
2527
+ @keyframes ${e}-marquee-left {
2528
+ from { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
2529
+ to { -webkit-transform: translate3d(-${i}, 0, 0); transform: translate3d(-${i}, 0, 0); }
2530
+ }
2531
+
2532
+ @keyframes ${e}-marquee-right {
2533
+ from { -webkit-transform: translate3d(-${i}, 0, 0); transform: translate3d(-${i}, 0, 0); }
2534
+ to { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
2535
+ }
2536
+
2537
+ .${e}-marquee-track {
2538
+ display: flex;
2539
+ flex-direction: row;
2540
+ width: max-content;
2541
+ backface-visibility: hidden;
2542
+ -webkit-backface-visibility: hidden;
2543
+ flex-wrap: nowrap;
2544
+ -webkit-animation-timing-function: linear;
2545
+ animation-timing-function: linear;
2546
+ -webkit-animation-iteration-count: infinite;
2547
+ animation-iteration-count: infinite;
2548
+ position: relative;
2549
+ z-index: 1;
2550
+ }
2551
+ .${e}-marquee-track[data-direction="left"] {
2552
+ -webkit-animation-name: ${e}-marquee-left;
2553
+ animation-name: ${e}-marquee-left;
2554
+ }
2555
+ .${e}-marquee-track[data-direction="right"] {
2556
+ -webkit-animation-name: ${e}-marquee-right;
2557
+ animation-name: ${e}-marquee-right;
2558
+ }
2559
+ .${e}-marquee-set {
2560
+ display: flex;
2561
+ flex-direction: row;
2562
+ align-items: center;
2563
+ flex: 0 0 auto;
2564
+ position: relative;
2565
+ z-index: 1;
2566
+ }
2567
+ .${e}-marquee-static {
2568
+ justify-content: center;
2569
+ overflow-x: auto;
2570
+ }
2571
+ .${e}-item {
2572
+ position: relative;
2573
+ display: flex;
2574
+ flex-direction: row;
2575
+ align-items: center;
2576
+ flex: 0 0 auto;
2577
+ white-space: nowrap;
2578
+ }
2579
+ .${e}-item-link {
2580
+ display: flex;
2581
+ flex-direction: row;
2582
+ align-items: center;
2583
+ text-decoration: none;
2584
+ color: inherit;
2585
+ }
2586
+ .${e}-item-image {
2587
+ display: block;
2588
+ width: auto;
2589
+ flex: 0 0 auto;
2590
+ object-fit: contain;
2591
+ }
2592
+ .${e}-text {
2593
+ display: inline-block;
2594
+ }
2595
+ ${o}
2596
+ .${e}-cap-ref {
2597
+ position: absolute;
2598
+ visibility: hidden;
2599
+ pointer-events: none;
2600
+ white-space: nowrap;
2601
+ left: -9999px;
2602
+ top: 0;
2603
+ }
2604
+ `}const rg=30,Ur=3,ag=12,sg=3,La=.72,lg=100,cg=10,dg=e=>Math.max(0,e)/lg,ug=e=>Math.max(0,e)/cg,pg=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")},mg=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),Si={ctx:void 0},gg=()=>Si.ctx!==void 0?Si.ctx:typeof document>"u"?(Si.ctx=null,Si.ctx):(Si.ctx=document.createElement("canvas").getContext("2d"),Si.ctx),hg=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},fg=e=>{e.style.transform=""},yg=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},vg=(e,t)=>{const n=(i,o)=>{if(!i||i===t)return o;const s=o+i.offsetLeft,l=i.offsetParent;return!l||l===i?s:n(l,s)};return n(e,e.offsetWidth/2)},xg=96,bg=(e,t,n)=>{if(t<=0||e<=0||n<2)return null;const i=2*Math.PI/t,o=new Float64Array(n+1),s=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 v=p*c,y=v+c;o[p+1]=y,s[p+1]=s[p]+(d(v)+d(y))*.5*c}),{wavelength:i,periodArc:s[n],x:o,s}},wg=(e,t)=>{if(e.periodArc<=0)return t;const n=t<0?-1:1,i=Math.abs(t),o=Math.floor(i/e.periodArc),s=i-o*e.periodArc,{s:l,x:d}=e,c=(g,h)=>{if(h-g<=1)return[g,h];const m=g+h>>1;return l[m]<=s?c(m,h):c(g,m)},[u,p]=c(0,l.length-1),v=l[p]-l[u],y=v>0?(s-l[u])/v:0;return n*(o*e.wavelength+d[u]+(d[p]-d[u])*y)},Sg=(e,t,n,i)=>{const o=Math.max(0,n),s=e>0?2*Math.PI*o/e:0,l=p=>i+t*Math.sin(s*p),d=p=>t*s*Math.cos(s*p),c=Math.max(4,Math.ceil(o*4)),u=Array.from({length:c},(p,v)=>{const y=v/c*e,g=(v+1)/c*e,h=g-y,m=l(y),b=l(g),I=y+h/3,R=m+d(y)*h/3,T=g-h/3,q=b-d(g)*h/3;return`C${I.toFixed(2)} ${R.toFixed(2)} ${T.toFixed(2)} ${q.toFixed(2)} ${g.toFixed(2)} ${b.toFixed(2)}`});return[`M0 ${l(0).toFixed(2)}`,...u].join(" ")},$g=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:s,isCurve:l})=>{var g;const d=o!==0?{...n,transform:`translateY(${o}px)`}:n,c=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${La}em`},u=((g=e.image)==null?void 0:g.url)&&r.jsx("img",{src:e.image.url,alt:e.image.name??"",className:`${t}-item-image`,style:c}),p=u&&(l?r.jsx("span",{className:`${t}-item-image-wrap`,"data-marquee-wave-node":!0,children:u}):u),v=l?r.jsx("span",{className:`${t}-text`,style:d,children:Array.from(e.text).map((h,m)=>r.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:r.jsx("span",{className:`${t}-glyph-inner`,children:h===" "?" ":h})},m))}):r.jsx("span",{className:`${t}-text`,style:d,children:e.text}),y=r.jsxs(r.Fragment,{children:[p,v]});return r.jsx("div",{className:`${t}-item`,"data-marquee-text-item":!0,style:{gap:s},children:e.link?r.jsx("a",{href:e.link,className:`${t}-item-link`,style:{gap:s},children:y}):y})},Cg=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=C.useScopedStyles(),[s,l]=a.useState(0),d=s>0?Math.round(s):0,{speed:c,direction:u,pauseOnHover:p,gap:v,layoutType:y,curveAmplitude:g,curveFrequency:h,textFontFamily:m,textFontSettings:b,textFontSize:I,textLineHeight:R,textLetterSpacing:T,textWordSpacing:q,textTextAppearance:F,textColor:V,backgroundColor:A,ribbonWidth:L}=e,O=L??R,x=y==="curve",W=dg(g),E=ug(h),J=a.useMemo(()=>og(o,d,x),[o,d,x]),P=a.useMemo(()=>Xt({fontSettings:{fontFamily:m,fontWeight:b.fontWeight,fontStyle:b.fontStyle},letterSpacing:T,wordSpacing:q,fontSize:I,lineHeight:R,textAppearance:F,color:V},n),[m,b,T,q,I,R,F,V,n]),K=ne=>C.scalingValue(ne,n??!1),B=((t==null?void 0:t.length)??0)>0,z=n?!!i:!0,ie=B&&(z||!!n),S=Math.max(0,c)*rg,M=z&&p==="on",[D,le]=a.useState(!1),oe=z?M&&D?"paused":"running":"paused",$=oe==="running"&&S>0&&d>0,ae=a.useRef(null),k=a.useRef(null),te=a.useRef(null),X=a.useRef(null),ve=a.useRef(null),Pe=a.useRef(null),he=a.useRef($),ce=a.useRef(null);he.current=$;const[U,Y]=a.useState(0),[Z,We]=a.useState(0),[$e,ke]=a.useState(0),[de,fe]=a.useState(0),[we,G]=a.useState(0),se=a.useMemo(()=>(t??[]).map(ne=>{var ge;return`${ne.text}\0${((ge=ne.image)==null?void 0:ge.url)??""}`}).join("\0"),[t]),[pe,Se]=a.useState(Ur),Me=a.useMemo(()=>{const ne=t??[];return ne.length===0||!(z||n)?ne:mg(ne,pe)},[t,z,pe,n]),Le=ie?sg:1;a.useLayoutEffect(()=>{Se(Ur),l(0)},[se]),a.useLayoutEffect(()=>{var Ze;const ne=Pe.current;if(!ne)return;const ge=()=>{const Ve=getComputedStyle(ne),at=parseFloat(Ve.fontSize)||0;if(at<=0)return;const Je=gg();if(!Je){Y(at*La),We(0);return}Je.font=`${Ve.fontStyle} ${Ve.fontWeight} ${at}px ${Ve.fontFamily}`;const Ee=Je.measureText("H"),qe=Ee.actualBoundingBoxAscent>0?Ee.actualBoundingBoxAscent:at*La,_e=Math.max(0,Ee.actualBoundingBoxDescent||0),tt=Ee.fontBoundingBoxAscent||0,rt=Ee.fontBoundingBoxDescent||0;Y(Tt=>Math.abs(Tt-qe)>.5?qe:Tt);const lt=tt>0||rt>0?(rt-_e-(tt-qe))/2:0;We(Tt=>Math.abs(Tt-lt)>.25?lt:Tt)};ge();const Ie=typeof document<"u"?document.fonts:void 0;(Ze=Ie==null?void 0:Ie.ready)==null||Ze.then(ge).catch(()=>{});const Ge=new ResizeObserver(ge);return Ge.observe(ne),()=>Ge.disconnect()},[P.fontFamily,P.fontWeight,P.fontStyle,P.fontSize,P.lineHeight]),a.useLayoutEffect(()=>{if(!ie)return;const ne=ae.current,ge=X.current;if(!ne||!ge)return;const Ie={id:0},Ge=()=>{const Ve=ne.getBoundingClientRect().width||ne.offsetWidth,at=ge.getBoundingClientRect().width||ge.offsetWidth;if(B&&Ve>0&&at>0){const Je=at/pe;if(Je>0){const Ee=Math.min(ag,Math.max(Ur,Math.ceil(Ve/Je)+1));if(Ee!==pe){Se(Ee);return}}}at>0&&l(at)};Ie.id=requestAnimationFrame(Ge);const Ze=new ResizeObserver(()=>{cancelAnimationFrame(Ie.id),Ie.id=requestAnimationFrame(Ge)});return Ze.observe(ne),Ze.observe(ge),()=>{cancelAnimationFrame(Ie.id),Ze.disconnect()}},[ie,se,pe,B,U]),a.useLayoutEffect(()=>{const ne=ve.current;if(!ne)return;const ge={id:0},Ie=()=>{const Ze=ne.offsetHeight;Ze>0&&G(Ve=>Math.abs(Ve-Ze)>.5?Ze:Ve)};ge.id=requestAnimationFrame(Ie);const Ge=new ResizeObserver(()=>{cancelAnimationFrame(ge.id),ge.id=requestAnimationFrame(Ie)});return Ge.observe(ne),()=>{cancelAnimationFrame(ge.id),Ge.disconnect()}},[O,n]),a.useLayoutEffect(()=>{if(!x){ke(0),fe(0);return}const ne=ae.current,ge=X.current;if(!ne||!ge)return;const Ie={id:0},Ge=()=>{const Ve=ne.offsetWidth,at=ge.offsetHeight;Ve>0&&fe(Je=>Math.abs(Je-Ve)>.5?Ve:Je),at>0&&ke(Je=>Math.abs(Je-at)>.5?at:Je)};Ie.id=requestAnimationFrame(Ge);const Ze=new ResizeObserver(()=>{cancelAnimationFrame(Ie.id),Ie.id=requestAnimationFrame(Ge)});return Ze.observe(ne),Ze.observe(ge),()=>{cancelAnimationFrame(Ie.id),Ze.disconnect()}},[x,se,U,R,I,ie]),a.useLayoutEffect(()=>{if(!ie||d<=0)return;const ne=te.current;ne&&pg(ne)},[ie,d,u,S]),a.useLayoutEffect(()=>{if(!x||!B)return;const ne=ae.current;if(!ne)return;const ge={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},Ie=()=>{for(const Ee of ge.itemsCache)for(const qe of Ee.glyphs)fg(qe.inner)},Ge=()=>{const Ee=k.current??ne;ge.itemsCache=Array.from(ne.querySelectorAll("[data-marquee-text-item]"),qe=>{const _e=[];return qe.querySelectorAll("[data-marquee-wave-node]").forEach(tt=>{const rt=tt.firstElementChild;rt&&_e.push({inner:rt,layoutLocalX:vg(tt,Ee)})}),{item:qe,glyphs:_e}}),ge.cacheDirty=!1},Ze=()=>{ge.cacheDirty&&Ge();const qe=(k.current??ne).offsetWidth||1,_e=qe*W,tt=2*Math.PI*E/qe,rt=`${qe}|${_e}|${tt}`;rt!==ge.lutKey&&(ge.lutKey=rt,ge.lut=bg(_e,tt,xg));const lt=te.current,Tt=lt?yg(getComputedStyle(lt).transform):0,Ut=ne.getBoundingClientRect(),Zt=Ut.left,xt=Ut.right,wt=ge.lut&&ge.lut.wavelength>0?Math.max(0,(ge.lut.periodArc/ge.lut.wavelength-1)*qe):0;for(const{item:jt,glyphs:At}of ge.itemsCache){const vt=jt.getBoundingClientRect();if(!(vt.right<Zt||vt.left>xt+wt))for(const Ft of At){const _t=Ft.layoutLocalX+Tt,Kt=ge.lut?wg(ge.lut,_t):_t,Jt=tt*Kt,Ct=_e*Math.sin(Jt),Ht=_e*tt*Math.cos(Jt),on=Math.atan(Ht)*(180/Math.PI);hg(Ft.inner,Kt-_t,Ct,on)}}},Ve=()=>{ge.cancelled||(ge.raf=0,Ze(),he.current&&!document.hidden&&(ge.raf=requestAnimationFrame(Ve)))},at=()=>{ge.cancelled||ge.raf||(ge.raf=requestAnimationFrame(Ve))};ce.current=at,at();const Je=()=>{if(document.hidden){cancelAnimationFrame(ge.raf),ge.raf=0;return}at()};return document.addEventListener("visibilitychange",Je),()=>{ge.cancelled=!0,ce.current=null,cancelAnimationFrame(ge.raf),document.removeEventListener("visibilitychange",Je),Ie()}},[x,W,E,B,s,se,pe,U]),a.useLayoutEffect(()=>{var ne;(ne=ce.current)==null||ne.call(ce)},[$]);const H=()=>{M&&le(!0)},ye=()=>{M&&le(!1)},re=x?W*100:0,_=K(O),ee={minHeight:_,...x?{paddingTop:`${re}%`,paddingBottom:`${re}%`}:{}},Ae={height:_,...x?{visibility:"hidden"}:{backgroundColor:A}},ue={gap:K(v),minHeight:_},N=de*W,Ue=we>0?we:$e,Oe=Math.max($e,Ue),dt=x&&de>0&&Oe>0?Sg(de,N,E,N+Oe/2):"",nt=N*2+Oe,ht=dt?r.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${de} ${nt}`,preserveAspectRatio:"none","aria-hidden":!0,children:r.jsx("path",{d:dt,fill:"none",stroke:A,strokeWidth:Ue,strokeLinecap:"round",strokeLinejoin:"round"})}):null,st=r.jsx("div",{ref:ve,className:`${o}-ribbon`,style:Ae,"aria-hidden":!0}),Be=(ne,ge,Ie)=>r.jsx($g,{item:ne,prefix:o,textCss:P,capHeightPx:U,opticalOffsetY:Z,imageGapPx:K(v),isCurve:x},`${ge}-${Ie}`),xe=r.jsx("span",{ref:Pe,"aria-hidden":!0,className:`${o}-cap-ref`,style:P,children:"H"}),Fe=d>0&&S>0?d/S*1e3:0,je=`${Math.max(0,Fe)/1e3}s`,Ke=ie?r.jsx("div",{ref:te,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:H,onMouseLeave:ye,style:{WebkitAnimationDuration:je,animationDuration:je,WebkitAnimationPlayState:oe,animationPlayState:oe},children:Array.from({length:Le},(ne,ge)=>r.jsx("div",{ref:ge===0?X:void 0,className:`${o}-marquee-set`,style:{...ue,paddingRight:K(v)},"aria-hidden":ge>0,children:Me.map((Ie,Ge)=>Be(Ie,ge,Ge))},`set-${ge}`))}):r.jsx("div",{ref:X,className:ut(`${o}-marquee-set`,`${o}-marquee-static`),style:ue,children:t==null?void 0:t.map((ne,ge)=>Be(ne,0,ge))});return r.jsxs("div",{ref:ae,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:J}}),xe,r.jsxs("div",{ref:k,className:`${o}-marquee-wrapper`,style:ee,children:[st,ht,Ke]})]})},Tg=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
2605
+ import cn from 'classnames';
2606
+ import { CommonComponentProps } from '../props';
2607
+ import { scalingValue } from '../utils/scalingValue';
2608
+ import { useScopedStyles } from '../utils/useScopedStyles';
2609
+ import { textStylesToCss } from '../utils/textStylesToCss';
2610
+
2611
+ function getCSS(P: string, setWidthPx: number, isCurve: boolean): string {
2612
+ const distance = setWidthPx > 0 ? \`\${setWidthPx}px\` : '0px';
2613
+ const curveCss = isCurve ? \`
2614
+ .\${P}-item-image-wrap {
2615
+ display: flex;
2616
+ flex: 0 0 auto;
2617
+ align-items: center;
2618
+ }
2619
+ .\${P}-glyph {
2620
+ display: inline-block;
2621
+ }
2622
+ .\${P}-glyph-inner {
2623
+ display: inline-block;
2624
+ transform-origin: 50% 50%;
2625
+ backface-visibility: hidden;
2626
+ -webkit-backface-visibility: hidden;
2627
+ }
2628
+ .\${P}-item-image {
2629
+ transform-origin: 50% 50%;
2630
+ backface-visibility: hidden;
2631
+ -webkit-backface-visibility: hidden;
2632
+ }
2633
+ \` : '';
2634
+ return \`
2635
+ .\${P}-wrapper {
2636
+ position: relative;
2637
+ width: 100%;
2638
+ height: auto;
2639
+ }
2640
+ .\${P}-marquee-wrapper {
2641
+ position: relative;
2642
+ overflow: hidden;
2643
+ width: 100%;
2644
+ height: auto;
2645
+ }
2646
+ .\${P}-curve-bg {
2647
+ position: absolute;
2648
+ left: 0;
2649
+ top: 0;
2650
+ width: 100%;
2651
+ height: 100%;
2652
+ overflow: visible;
2653
+ pointer-events: none;
2654
+ z-index: 0;
2655
+ }
2656
+ .\${P}-ribbon {
2657
+ position: absolute;
2658
+ left: 0;
2659
+ top: 50%;
2660
+ width: 100%;
2661
+ transform: translateY(-50%);
2662
+ pointer-events: none;
2663
+ z-index: 0;
2664
+ }
2665
+
2666
+ @keyframes \${P}-marquee-left {
2667
+ from { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
2668
+ to { -webkit-transform: translate3d(-\${distance}, 0, 0); transform: translate3d(-\${distance}, 0, 0); }
2669
+ }
2670
+
2671
+ @keyframes \${P}-marquee-right {
2672
+ from { -webkit-transform: translate3d(-\${distance}, 0, 0); transform: translate3d(-\${distance}, 0, 0); }
2673
+ to { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
2674
+ }
2675
+
2676
+ .\${P}-marquee-track {
2677
+ display: flex;
2678
+ flex-direction: row;
2679
+ width: max-content;
2680
+ backface-visibility: hidden;
2681
+ -webkit-backface-visibility: hidden;
2682
+ flex-wrap: nowrap;
2683
+ -webkit-animation-timing-function: linear;
2684
+ animation-timing-function: linear;
2685
+ -webkit-animation-iteration-count: infinite;
2686
+ animation-iteration-count: infinite;
2687
+ position: relative;
2688
+ z-index: 1;
2689
+ }
2690
+ .\${P}-marquee-track[data-direction="left"] {
2691
+ -webkit-animation-name: \${P}-marquee-left;
2692
+ animation-name: \${P}-marquee-left;
2693
+ }
2694
+ .\${P}-marquee-track[data-direction="right"] {
2695
+ -webkit-animation-name: \${P}-marquee-right;
2696
+ animation-name: \${P}-marquee-right;
2697
+ }
2698
+ .\${P}-marquee-set {
2699
+ display: flex;
2700
+ flex-direction: row;
2701
+ align-items: center;
2702
+ flex: 0 0 auto;
2703
+ position: relative;
2704
+ z-index: 1;
2705
+ }
2706
+ .\${P}-marquee-static {
2707
+ justify-content: center;
2708
+ overflow-x: auto;
2709
+ }
2710
+ .\${P}-item {
2711
+ position: relative;
2712
+ display: flex;
2713
+ flex-direction: row;
2714
+ align-items: center;
2715
+ flex: 0 0 auto;
2716
+ white-space: nowrap;
2717
+ }
2718
+ .\${P}-item-link {
2719
+ display: flex;
2720
+ flex-direction: row;
2721
+ align-items: center;
2722
+ text-decoration: none;
2723
+ color: inherit;
2724
+ }
2725
+ .\${P}-item-image {
2726
+ display: block;
2727
+ width: auto;
2728
+ flex: 0 0 auto;
2729
+ object-fit: contain;
2730
+ }
2731
+ .\${P}-text {
2732
+ display: inline-block;
2733
+ }
2734
+ \${curveCss}
2735
+ .\${P}-cap-ref {
2736
+ position: absolute;
2737
+ visibility: hidden;
2738
+ pointer-events: none;
2739
+ white-space: nowrap;
2740
+ left: -9999px;
2741
+ top: 0;
2742
+ }
2743
+ \`;
2744
+ }
2745
+
2746
+ const PX_PER_SEC_PER_SPEED_UNIT = 30;
2747
+ const MIN_CONTENT_SEQUENCE_REPEAT = 3;
2748
+ const MAX_CONTENT_SEQUENCE_REPEAT = 12;
2749
+ const OUTER_SET_COPIES = 3;
2750
+ const DEFAULT_CAP_HEIGHT_RATIO = 0.72;
2751
+ const CURVE_AMPLITUDE_SCALE = 100;
2752
+ const CURVE_FREQUENCY_SCALE = 10;
2753
+
2754
+ const normalizeCurveAmplitude = (value: number): number => Math.max(0, value) / CURVE_AMPLITUDE_SCALE;
2755
+ const normalizeCurveFrequency = (value: number): number => Math.max(0, value) / CURVE_FREQUENCY_SCALE;
2756
+
2757
+ const restartTrackAnimation = (track: HTMLElement) => {
2758
+ track.style.setProperty('animation-name', 'none');
2759
+ track.style.setProperty('-webkit-animation-name', 'none');
2760
+ void track.offsetHeight;
2761
+ track.style.removeProperty('animation-name');
2762
+ track.style.removeProperty('-webkit-animation-name');
2763
+ };
2764
+
2765
+ const expandSetContent = (items: MarqueeTextItem[], repeat: number): MarqueeTextItem[] => (
2766
+ Array.from({ length: repeat * items.length }, (_, i) => items[i % items.length])
2767
+ );
2768
+
2769
+ const sharedCanvas = { ctx: undefined as CanvasRenderingContext2D | null | undefined };
2770
+ const getSharedCanvasCtx = (): CanvasRenderingContext2D | null => {
2771
+ if (sharedCanvas.ctx !== undefined) return sharedCanvas.ctx;
2772
+ if (typeof document === 'undefined') {
2773
+ sharedCanvas.ctx = null;
2774
+ return sharedCanvas.ctx;
2775
+ }
2776
+ sharedCanvas.ctx = document.createElement('canvas').getContext('2d');
2777
+ return sharedCanvas.ctx;
2778
+ };
2779
+
2780
+ type MarqueeTextItemViewProps = {
2781
+ item: MarqueeTextItem;
2782
+ prefix: string;
2783
+ textCss: CSSProperties;
2784
+ capHeightPx: number;
2785
+ opticalOffsetY: number;
2786
+ imageGapPx: string;
2787
+ isCurve: boolean;
2788
+ };
2789
+
2790
+ const applyWaveTransform = (el: HTMLElement, x: number, y: number, rotateDeg: number) => {
2791
+ el.style.transform = \`translate3d(\${x}px, \${y}px, 0) rotate(\${rotateDeg}deg)\`;
2792
+ };
2793
+
2794
+ const clearWaveTransform = (el: HTMLElement) => {
2795
+ el.style.transform = '';
2796
+ };
2797
+
2798
+ const readTranslateX = (transform: string): number => {
2799
+ if (!transform || transform === 'none') return 0;
2800
+ try {
2801
+ return new DOMMatrixReadOnly(transform).m41;
2802
+ } catch {
2803
+ return 0;
2804
+ }
2805
+ };
2806
+
2807
+ // Layout-only X in ancestor space; track translateX is added once per frame.
2808
+ const getLayoutLocalCenterX = (el: HTMLElement, ancestor: HTMLElement): number => {
2809
+ const walk = (node: HTMLElement | null, x: number): number => {
2810
+ if (!node || node === ancestor) return x;
2811
+ const nextX = x + node.offsetLeft;
2812
+ const parent = node.offsetParent as HTMLElement | null;
2813
+ if (!parent || parent === node) return nextX;
2814
+ return walk(parent, nextX);
2815
+ };
2816
+ return walk(el, el.offsetWidth / 2);
2817
+ };
2818
+
2819
+ type WaveGlyphCache = {
2820
+ inner: HTMLElement;
2821
+ layoutLocalX: number;
2822
+ };
2823
+
2824
+ type WaveItemCache = {
2825
+ item: HTMLElement;
2826
+ glyphs: WaveGlyphCache[];
2827
+ };
2828
+
2829
+ const WAVE_ARC_LUT_SAMPLES = 96;
2830
+
2831
+ type WaveArcLut = {
2832
+ wavelength: number;
2833
+ periodArc: number;
2834
+ x: Float64Array;
2835
+ s: Float64Array;
2836
+ };
2837
+
2838
+ // Invert s(x) = ∫ sqrt(1 + (A k cos(k t))²) dt so glyphs keep their layout
2839
+ // advance along the curve instead of along horizontal x.
2840
+ const buildWaveArcLut = (amplitude: number, k: number, samples: number): WaveArcLut | null => {
2841
+ if (k <= 0 || amplitude <= 0 || samples < 2) return null;
2842
+ const wavelength = (2 * Math.PI) / k;
2843
+ const x = new Float64Array(samples + 1);
2844
+ const s = new Float64Array(samples + 1);
2845
+ const slopeAmp = amplitude * k;
2846
+ const ds = (t: number) => Math.sqrt(1 + (slopeAmp * Math.cos(k * t)) ** 2);
2847
+ const dx = wavelength / samples;
2848
+ Array.from({ length: samples }, (_, i) => {
2849
+ const t0 = i * dx;
2850
+ const t1 = t0 + dx;
2851
+ x[i + 1] = t1;
2852
+ s[i + 1] = s[i] + (ds(t0) + ds(t1)) * 0.5 * dx;
2853
+ });
2854
+ return { wavelength, periodArc: s[samples], x, s };
2855
+ };
2856
+
2857
+ const xFromArcLength = (lut: WaveArcLut, targetS: number): number => {
2858
+ if (lut.periodArc <= 0) return targetS;
2859
+ const sign = targetS < 0 ? -1 : 1;
2860
+ const sAbs = Math.abs(targetS);
2861
+ const n = Math.floor(sAbs / lut.periodArc);
2862
+ const r = sAbs - n * lut.periodArc;
2863
+ const { s, x } = lut;
2864
+ const findBracket = (lo: number, hi: number): [number, number] => {
2865
+ if (hi - lo <= 1) return [lo, hi];
2866
+ const mid = (lo + hi) >> 1;
2867
+ return s[mid] <= r ? findBracket(mid, hi) : findBracket(lo, mid);
2868
+ };
2869
+ const [lo, hi] = findBracket(0, s.length - 1);
2870
+ const span = s[hi] - s[lo];
2871
+ const t = span > 0 ? (r - s[lo]) / span : 0;
2872
+ return sign * (n * lut.wavelength + x[lo] + (x[hi] - x[lo]) * t);
2873
+ };
2874
+
2875
+ const buildCurveBackgroundPath = (
2876
+ width: number,
2877
+ amplitude: number,
2878
+ frequency: number,
2879
+ centerY: number,
2880
+ ): string => {
2881
+ const periods = Math.max(0, frequency);
2882
+ const k = width > 0 ? (2 * Math.PI * periods) / width : 0;
2883
+ const yAt = (x: number) => centerY + amplitude * Math.sin(k * x);
2884
+ const dyAt = (x: number) => amplitude * k * Math.cos(k * x);
2885
+ const segments = Math.max(4, Math.ceil(periods * 4));
2886
+ const curveParts = Array.from({ length: segments }, (_, i) => {
2887
+ const x0 = (i / segments) * width;
2888
+ const x1 = ((i + 1) / segments) * width;
2889
+ const dx = x1 - x0;
2890
+ const y0 = yAt(x0);
2891
+ const y1 = yAt(x1);
2892
+ const c1x = x0 + dx / 3;
2893
+ const c1y = y0 + (dyAt(x0) * dx) / 3;
2894
+ const c2x = x1 - dx / 3;
2895
+ const c2y = y1 - (dyAt(x1) * dx) / 3;
2896
+ return \`C\${c1x.toFixed(2)} \${c1y.toFixed(2)} \${c2x.toFixed(2)} \${c2y.toFixed(2)} \${x1.toFixed(2)} \${y1.toFixed(2)}\`;
2897
+ });
2898
+ return [\`M0 \${yAt(0).toFixed(2)}\`, ...curveParts].join(' ');
2899
+ };
2900
+
2901
+ const MarqueeTextItemView = ({ item, prefix: P, textCss, capHeightPx, opticalOffsetY, imageGapPx, isCurve }: MarqueeTextItemViewProps) => {
2902
+ const textStyle: CSSProperties = opticalOffsetY !== 0 ? { ...textCss, transform: \`translateY(\${opticalOffsetY}px)\` } : textCss;
2903
+ const imageHeightStyle: CSSProperties = capHeightPx > 0 ? { height: \`\${capHeightPx}px\` } : { fontSize: textCss.fontSize, height: \`\${DEFAULT_CAP_HEIGHT_RATIO}em\` };
2904
+ const image = item.image?.url && (
2905
+ <img
2906
+ src={item.image.url}
2907
+ alt={item.image.name ?? ''}
2908
+ className={\`\${P}-item-image\`}
2909
+ style={imageHeightStyle}
2910
+ />
2911
+ );
2912
+ const imageNode = image && (isCurve ? <span className={\`\${P}-item-image-wrap\`} data-marquee-wave-node>{image}</span>: image);
2913
+ const textNode = isCurve
2914
+ ? (
2915
+ <span className={\`\${P}-text\`} style={textStyle}>
2916
+ {Array.from(item.text).map((char, index) => (
2917
+ <span key={index} className={\`\${P}-glyph\`} data-marquee-wave-node>
2918
+ <span className={\`\${P}-glyph-inner\`}>{char === ' ' ? '\\u00A0' : char}</span>
2919
+ </span>
2920
+ ))}
2921
+ </span>
2922
+ )
2923
+ : <span className={\`\${P}-text\`} style={textStyle}>{item.text}</span>;
2924
+ const content = (
2925
+ <>
2926
+ {imageNode}
2927
+ {textNode}
2928
+ </>
2929
+ );
2930
+ return (
2931
+ <div className={\`\${P}-item\`} data-marquee-text-item style={{ gap: imageGapPx }}>
2932
+ {item.link
2933
+ ? <a href={item.link} className={\`\${P}-item-link\`} style={{ gap: imageGapPx }}>{content}</a>
2934
+ : content}
2935
+ </div>
2936
+ );
2937
+ };
2938
+
2939
+ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode }: MarqueeTextProps) => {
2940
+ const { prefix: P } = useScopedStyles();
2941
+ const [setWidth, setSetWidth] = useState(0);
2942
+ const animationDistance = setWidth > 0 ? Math.round(setWidth) : 0;
2943
+ const {
2944
+ speed,
2945
+ direction,
2946
+ pauseOnHover,
2947
+ gap,
2948
+ layoutType,
2949
+ curveAmplitude,
2950
+ curveFrequency,
2951
+ textFontFamily,
2952
+ textFontSettings,
2953
+ textFontSize,
2954
+ textLineHeight,
2955
+ textLetterSpacing,
2956
+ textWordSpacing,
2957
+ textTextAppearance,
2958
+ textColor,
2959
+ backgroundColor,
2960
+ ribbonWidth: ribbonWidthSetting,
2961
+ } = settings;
2962
+ const ribbonWidth = ribbonWidthSetting ?? textLineHeight;
2963
+ const isCurveLayout = layoutType === 'curve';
2964
+ const amplitudeRatio = normalizeCurveAmplitude(curveAmplitude);
2965
+ const curvePeriods = normalizeCurveFrequency(curveFrequency);
2966
+ const scopedCss = useMemo(() => getCSS(P, animationDistance, isCurveLayout), [P, animationDistance, isCurveLayout]);
2967
+
2968
+ const textCss = useMemo<CSSProperties>(() => textStylesToCss({
2969
+ fontSettings: {
2970
+ fontFamily: textFontFamily,
2971
+ fontWeight: textFontSettings.fontWeight,
2972
+ fontStyle: textFontSettings.fontStyle,
2973
+ },
2974
+ letterSpacing: textLetterSpacing,
2975
+ wordSpacing: textWordSpacing,
2976
+ fontSize: textFontSize,
2977
+ lineHeight: textLineHeight,
2978
+ textAppearance: textTextAppearance,
2979
+ color: textColor,
2980
+ }, isEditor), [textFontFamily, textFontSettings, textLetterSpacing, textWordSpacing, textFontSize, textLineHeight, textTextAppearance, textColor, isEditor]);
2981
+
2982
+ const scaled = (v: number) => scalingValue(v, isEditor ?? false);
2983
+ const hasContent = (content?.length ?? 0) > 0;
2984
+ const autoplayEnabled = isEditor ? Boolean(isPreviewMode) : true;
2985
+ const useMarqueeTrack = hasContent && (autoplayEnabled || Boolean(isEditor));
2986
+ const pxPerSec = Math.max(0, speed) * PX_PER_SEC_PER_SPEED_UNIT;
2987
+ const hoverPauseEnabled = autoplayEnabled && pauseOnHover === 'on';
2988
+ const [isHovering, setIsHovering] = useState(false);
2989
+ const playState: 'paused' | 'running' = !autoplayEnabled
2990
+ ? 'paused'
2991
+ : hoverPauseEnabled
2992
+ ? (isHovering ? 'paused' : 'running')
2993
+ : 'running';
2994
+ const waveShouldLoop = playState === 'running' && pxPerSec > 0 && animationDistance > 0;
2995
+
2996
+ const wrapperRef = useRef<HTMLDivElement | null>(null);
2997
+ const bandRef = useRef<HTMLDivElement | null>(null);
2998
+ const trackRef = useRef<HTMLDivElement | null>(null);
2999
+ const setRef = useRef<HTMLDivElement | null>(null);
3000
+ const ribbonRef = useRef<HTMLDivElement | null>(null);
3001
+ const capRefEl = useRef<HTMLSpanElement | null>(null);
3002
+ const waveShouldLoopRef = useRef(waveShouldLoop);
3003
+ const waveKickRef = useRef<(() => void) | null>(null);
3004
+ waveShouldLoopRef.current = waveShouldLoop;
3005
+ const [capHeightPx, setCapHeightPx] = useState(0);
3006
+ const [opticalOffsetY, setOpticalOffsetY] = useState(0);
3007
+ const [curveBandHeightPx, setCurveBandHeightPx] = useState(0);
3008
+ const [curveWidthPx, setCurveWidthPx] = useState(0);
3009
+ const [ribbonHeightPx, setRibbonHeightPx] = useState(0);
3010
+
3011
+ const contentKey = useMemo(
3012
+ () => (content ?? []).map((i) => \`\${i.text}\\0\${i.image?.url ?? ''}\`).join('\\0'),
3013
+ [content],
3014
+ );
3015
+ const [contentSequenceRepeat, setContentSequenceRepeat] = useState(MIN_CONTENT_SEQUENCE_REPEAT);
3016
+ const setContent = useMemo(() => {
3017
+ const items = content ?? [];
3018
+ if (items.length === 0) return items;
3019
+ if (!(autoplayEnabled || isEditor)) return items;
3020
+ return expandSetContent(items, contentSequenceRepeat);
3021
+ }, [content, autoplayEnabled, contentSequenceRepeat, isEditor]);
3022
+ const copies = useMarqueeTrack ? OUTER_SET_COPIES : 1;
3023
+
3024
+ useLayoutEffect(() => {
3025
+ setContentSequenceRepeat(MIN_CONTENT_SEQUENCE_REPEAT);
3026
+ setSetWidth(0);
3027
+ }, [contentKey]);
3028
+
3029
+ // Cap-height + optical vertical offset for image sizing / text baseline balance.
3030
+ useLayoutEffect(() => {
3031
+ const el = capRefEl.current;
3032
+ if (!el) return;
3033
+ const measure = () => {
3034
+ const computed = getComputedStyle(el);
3035
+ const fontSizePx = parseFloat(computed.fontSize) || 0;
3036
+ if (fontSizePx <= 0) return;
3037
+ const ctx = getSharedCanvasCtx();
3038
+ if (!ctx) {
3039
+ setCapHeightPx(fontSizePx * DEFAULT_CAP_HEIGHT_RATIO);
3040
+ setOpticalOffsetY(0);
3041
+ return;
3042
+ }
3043
+ ctx.font = \`\${computed.fontStyle} \${computed.fontWeight} \${fontSizePx}px \${computed.fontFamily}\`;
3044
+ const metrics = ctx.measureText('H');
3045
+ const inkAscent = metrics.actualBoundingBoxAscent > 0
3046
+ ? metrics.actualBoundingBoxAscent
3047
+ : fontSizePx * DEFAULT_CAP_HEIGHT_RATIO;
3048
+ const inkDescent = Math.max(0, metrics.actualBoundingBoxDescent || 0);
3049
+ const fontAscent = metrics.fontBoundingBoxAscent || 0;
3050
+ const fontDescent = metrics.fontBoundingBoxDescent || 0;
3051
+ setCapHeightPx((prev) => (Math.abs(prev - inkAscent) > 0.5 ? inkAscent : prev));
3052
+ const nextOffset = (fontAscent > 0 || fontDescent > 0)
3053
+ ? ((fontDescent - inkDescent) - (fontAscent - inkAscent)) / 2
3054
+ : 0;
3055
+ setOpticalOffsetY((prev) => (Math.abs(prev - nextOffset) > 0.25 ? nextOffset : prev));
3056
+ };
3057
+ measure();
3058
+ const fonts: FontFaceSet | undefined = typeof document !== 'undefined' ? document.fonts : undefined;
3059
+ fonts?.ready?.then(measure).catch(() => {});
3060
+ const ro = new ResizeObserver(measure);
3061
+ ro.observe(el);
3062
+ return () => ro.disconnect();
3063
+ }, [textCss.fontFamily, textCss.fontWeight, textCss.fontStyle, textCss.fontSize, textCss.lineHeight]);
3064
+
3065
+ useLayoutEffect(() => {
3066
+ if (!useMarqueeTrack) return;
3067
+ const wrapper = wrapperRef.current;
3068
+ const set = setRef.current;
3069
+ if (!wrapper || !set) return;
3070
+ const raf = { id: 0 };
3071
+ const measure = () => {
3072
+ const containerWidth = wrapper.getBoundingClientRect().width || wrapper.offsetWidth;
3073
+ const rawSetWidth = set.getBoundingClientRect().width || set.offsetWidth;
3074
+ if (hasContent && containerWidth > 0 && rawSetWidth > 0) {
3075
+ const singleCycleWidth = rawSetWidth / contentSequenceRepeat;
3076
+ if (singleCycleWidth > 0) {
3077
+ const targetRepeat = Math.min(
3078
+ MAX_CONTENT_SEQUENCE_REPEAT,
3079
+ Math.max(MIN_CONTENT_SEQUENCE_REPEAT, Math.ceil(containerWidth / singleCycleWidth) + 1),
3080
+ );
3081
+ if (targetRepeat !== contentSequenceRepeat) {
3082
+ setContentSequenceRepeat(targetRepeat);
3083
+ return;
3084
+ }
3085
+ }
3086
+ }
3087
+ if (rawSetWidth > 0) setSetWidth(rawSetWidth);
3088
+ };
3089
+ raf.id = requestAnimationFrame(measure);
3090
+ const ro = new ResizeObserver(() => {
3091
+ cancelAnimationFrame(raf.id);
3092
+ raf.id = requestAnimationFrame(measure);
3093
+ });
3094
+ ro.observe(wrapper);
3095
+ ro.observe(set);
3096
+ return () => {
3097
+ cancelAnimationFrame(raf.id);
3098
+ ro.disconnect();
3099
+ };
3100
+ }, [useMarqueeTrack, contentKey, contentSequenceRepeat, hasContent, capHeightPx]);
3101
+
3102
+ useLayoutEffect(() => {
3103
+ const ribbon = ribbonRef.current;
3104
+ if (!ribbon) return;
3105
+ const raf = { id: 0 };
3106
+ const measure = () => {
3107
+ const height = ribbon.offsetHeight;
3108
+ if (height > 0) setRibbonHeightPx((prev) => (Math.abs(prev - height) > 0.5 ? height : prev));
3109
+ };
3110
+ raf.id = requestAnimationFrame(measure);
3111
+ const ro = new ResizeObserver(() => {
3112
+ cancelAnimationFrame(raf.id);
3113
+ raf.id = requestAnimationFrame(measure);
3114
+ });
3115
+ ro.observe(ribbon);
3116
+ return () => {
3117
+ cancelAnimationFrame(raf.id);
3118
+ ro.disconnect();
3119
+ };
3120
+ }, [ribbonWidth, isEditor]);
3121
+
3122
+ useLayoutEffect(() => {
3123
+ if (!isCurveLayout) {
3124
+ setCurveBandHeightPx(0);
3125
+ setCurveWidthPx(0);
3126
+ return;
3127
+ }
3128
+ const wrapper = wrapperRef.current;
3129
+ const set = setRef.current;
3130
+ if (!wrapper || !set) return;
3131
+ const raf = { id: 0 };
3132
+ const measure = () => {
3133
+ const width = wrapper.offsetWidth;
3134
+ const bandHeight = set.offsetHeight;
3135
+ if (width > 0) setCurveWidthPx((prev) => (Math.abs(prev - width) > 0.5 ? width : prev));
3136
+ if (bandHeight > 0) setCurveBandHeightPx((prev) => (Math.abs(prev - bandHeight) > 0.5 ? bandHeight : prev));
3137
+ };
3138
+ raf.id = requestAnimationFrame(measure);
3139
+ const ro = new ResizeObserver(() => {
3140
+ cancelAnimationFrame(raf.id);
3141
+ raf.id = requestAnimationFrame(measure);
3142
+ });
3143
+ ro.observe(wrapper);
3144
+ ro.observe(set);
3145
+ return () => {
3146
+ cancelAnimationFrame(raf.id);
3147
+ ro.disconnect();
3148
+ };
3149
+ }, [isCurveLayout, contentKey, capHeightPx, textLineHeight, textFontSize, useMarqueeTrack]);
3150
+
3151
+ useLayoutEffect(() => {
3152
+ if (!useMarqueeTrack || animationDistance <= 0) return;
3153
+ const track = trackRef.current;
3154
+ if (!track) return;
3155
+ restartTrackAnimation(track);
3156
+ }, [useMarqueeTrack, animationDistance, direction, pxPerSec]);
3157
+
3158
+ useLayoutEffect(() => {
3159
+ if (!isCurveLayout || !hasContent) return;
3160
+ const wrapper = wrapperRef.current;
3161
+ if (!wrapper) return;
3162
+
3163
+ const wave = {
3164
+ raf: 0,
3165
+ cancelled: false,
3166
+ lut: null as WaveArcLut | null,
3167
+ lutKey: '',
3168
+ itemsCache: [] as WaveItemCache[],
3169
+ cacheDirty: true,
3170
+ };
3171
+
3172
+ const clearWaveTransforms = () => {
3173
+ for (const item of wave.itemsCache) {
3174
+ for (const glyph of item.glyphs) clearWaveTransform(glyph.inner);
3175
+ }
3176
+ };
3177
+
3178
+ const rebuildCache = () => {
3179
+ const band = bandRef.current ?? wrapper;
3180
+ wave.itemsCache = Array.from(
3181
+ wrapper.querySelectorAll<HTMLElement>('[data-marquee-text-item]'),
3182
+ (item) => {
3183
+ const glyphs: WaveGlyphCache[] = [];
3184
+ item.querySelectorAll<HTMLElement>('[data-marquee-wave-node]').forEach((node) => {
3185
+ const inner = node.firstElementChild as HTMLElement | null;
3186
+ if (!inner) return;
3187
+ glyphs.push({
3188
+ inner,
3189
+ layoutLocalX: getLayoutLocalCenterX(node, band),
3190
+ });
3191
+ });
3192
+ return { item, glyphs };
3193
+ },
3194
+ );
3195
+ wave.cacheDirty = false;
3196
+ };
3197
+
3198
+ const applyWave = () => {
3199
+ if (wave.cacheDirty) rebuildCache();
3200
+ const band = bandRef.current ?? wrapper;
3201
+ const width = band.offsetWidth || 1;
3202
+ const amplitude = width * amplitudeRatio;
3203
+ const k = (2 * Math.PI * curvePeriods) / width;
3204
+ const nextLutKey = \`\${width}|\${amplitude}|\${k}\`;
3205
+ if (nextLutKey !== wave.lutKey) {
3206
+ wave.lutKey = nextLutKey;
3207
+ wave.lut = buildWaveArcLut(amplitude, k, WAVE_ARC_LUT_SAMPLES);
3208
+ }
3209
+
3210
+ const track = trackRef.current;
3211
+ const trackTx = track ? readTranslateX(getComputedStyle(track).transform) : 0;
3212
+ const wrapperRect = wrapper.getBoundingClientRect();
3213
+ const viewLeft = wrapperRect.left;
3214
+ const viewRight = wrapperRect.right;
3215
+ const extraRight = wave.lut && wave.lut.wavelength > 0
3216
+ ? Math.max(0, (wave.lut.periodArc / wave.lut.wavelength - 1) * width)
3217
+ : 0;
3218
+
3219
+ for (const { item, glyphs } of wave.itemsCache) {
3220
+ const itemRect = item.getBoundingClientRect();
3221
+ if (itemRect.right < viewLeft || itemRect.left > viewRight + extraRight) continue;
3222
+ for (const glyph of glyphs) {
3223
+ const localX = glyph.layoutLocalX + trackTx;
3224
+ const xPath = wave.lut ? xFromArcLength(wave.lut, localX) : localX;
3225
+ const phase = k * xPath;
3226
+ const y = amplitude * Math.sin(phase);
3227
+ const slope = amplitude * k * Math.cos(phase);
3228
+ const rotateDeg = Math.atan(slope) * (180 / Math.PI);
3229
+ applyWaveTransform(glyph.inner, xPath - localX, y, rotateDeg);
3230
+ }
3231
+ }
3232
+ };
3233
+
3234
+ const tick = () => {
3235
+ if (wave.cancelled) return;
3236
+ wave.raf = 0;
3237
+ applyWave();
3238
+ if (waveShouldLoopRef.current && !document.hidden) {
3239
+ wave.raf = requestAnimationFrame(tick);
3240
+ }
3241
+ };
3242
+
3243
+ const kick = () => {
3244
+ if (wave.cancelled || wave.raf) return;
3245
+ wave.raf = requestAnimationFrame(tick);
3246
+ };
3247
+
3248
+ waveKickRef.current = kick;
3249
+ kick();
3250
+
3251
+ const onVisibility = () => {
3252
+ if (document.hidden) {
3253
+ cancelAnimationFrame(wave.raf);
3254
+ wave.raf = 0;
3255
+ return;
3256
+ }
3257
+ kick();
3258
+ };
3259
+ document.addEventListener('visibilitychange', onVisibility);
3260
+
3261
+ return () => {
3262
+ wave.cancelled = true;
3263
+ waveKickRef.current = null;
3264
+ cancelAnimationFrame(wave.raf);
3265
+ document.removeEventListener('visibilitychange', onVisibility);
3266
+ clearWaveTransforms();
3267
+ };
3268
+ }, [isCurveLayout, amplitudeRatio, curvePeriods, hasContent, setWidth, contentKey, contentSequenceRepeat, capHeightPx]);
3269
+
3270
+ useLayoutEffect(() => {
3271
+ waveKickRef.current?.();
3272
+ }, [waveShouldLoop]);
3273
+
3274
+ const onTrackEnter = () => {
3275
+ if (hoverPauseEnabled) setIsHovering(true);
3276
+ };
3277
+ const onTrackLeave = () => {
3278
+ if (hoverPauseEnabled) setIsHovering(false);
3279
+ };
3280
+
3281
+ const curvePaddingPercent = isCurveLayout
3282
+ ? amplitudeRatio * 100
3283
+ : 0;
3284
+ const ribbonHeightCss = scaled(ribbonWidth);
3285
+ const bandStyle: CSSProperties = {
3286
+ minHeight: ribbonHeightCss,
3287
+ ...(isCurveLayout
3288
+ ? { paddingTop: \`\${curvePaddingPercent}%\`, paddingBottom: \`\${curvePaddingPercent}%\` }
3289
+ : {}),
3290
+ };
3291
+ const ribbonStyle: CSSProperties = {
3292
+ height: ribbonHeightCss,
3293
+ ...(!isCurveLayout ? { backgroundColor } : { visibility: 'hidden' }),
3294
+ };
3295
+ const setStyle: CSSProperties = {
3296
+ gap: scaled(gap),
3297
+ minHeight: ribbonHeightCss,
3298
+ };
3299
+ const curveAmplitudePx = curveWidthPx * amplitudeRatio;
3300
+ const curveStrokeWidth = ribbonHeightPx > 0 ? ribbonHeightPx : curveBandHeightPx;
3301
+ // Keep content band >= stroke so overflow:hidden does not clip sine peaks.
3302
+ const curveContentBandPx = Math.max(curveBandHeightPx, curveStrokeWidth);
3303
+ const curveBgPath = isCurveLayout && curveWidthPx > 0 && curveContentBandPx > 0
3304
+ ? buildCurveBackgroundPath(
3305
+ curveWidthPx,
3306
+ curveAmplitudePx,
3307
+ curvePeriods,
3308
+ curveAmplitudePx + curveContentBandPx / 2,
3309
+ )
3310
+ : '';
3311
+ const curveViewBoxH = curveAmplitudePx * 2 + curveContentBandPx;
3312
+ const curveBgSvg = curveBgPath ? (
3313
+ <svg
3314
+ className={\`\${P}-curve-bg\`}
3315
+ viewBox={\`0 0 \${curveWidthPx} \${curveViewBoxH}\`}
3316
+ preserveAspectRatio="none"
3317
+ aria-hidden
3318
+ >
3319
+ <path
3320
+ d={curveBgPath}
3321
+ fill="none"
3322
+ stroke={backgroundColor}
3323
+ strokeWidth={curveStrokeWidth}
3324
+ strokeLinecap="round"
3325
+ strokeLinejoin="round"
3326
+ />
3327
+ </svg>
3328
+ ) : null;
3329
+ const ribbon = (
3330
+ <div ref={ribbonRef} className={\`\${P}-ribbon\`} style={ribbonStyle} aria-hidden />
3331
+ );
3332
+
3333
+ const renderItem = (item: MarqueeTextItem, copyIndex: number, slotIndex: number) => (
3334
+ <MarqueeTextItemView
3335
+ key={\`\${copyIndex}-\${slotIndex}\`}
3336
+ item={item}
3337
+ prefix={P}
3338
+ textCss={textCss}
3339
+ capHeightPx={capHeightPx}
3340
+ opticalOffsetY={opticalOffsetY}
3341
+ imageGapPx={scaled(gap)}
3342
+ isCurve={isCurveLayout}
3343
+ />
3344
+ );
3345
+
3346
+ const capRef = (
3347
+ <span ref={capRefEl} aria-hidden className={\`\${P}-cap-ref\`} style={textCss}>H</span>
3348
+ );
3349
+
3350
+ const durationMs = animationDistance > 0 && pxPerSec > 0 ? (animationDistance / pxPerSec) * 1000 : 0;
3351
+ const durationS = \`\${Math.max(0, durationMs) / 1000}s\`;
3352
+
3353
+ const inner = useMarqueeTrack ? (
3354
+ <div
3355
+ ref={trackRef}
3356
+ className={\`\${P}-marquee-track\`}
3357
+ data-direction={direction}
3358
+ onMouseEnter={onTrackEnter}
3359
+ onMouseLeave={onTrackLeave}
3360
+ style={{
3361
+ WebkitAnimationDuration: durationS,
3362
+ animationDuration: durationS,
3363
+ WebkitAnimationPlayState: playState,
3364
+ animationPlayState: playState,
3365
+ }}
3366
+ >
3367
+ {Array.from({ length: copies }, (_, copyIndex) => (
3368
+ <div
3369
+ key={\`set-\${copyIndex}\`}
3370
+ ref={copyIndex === 0 ? setRef : undefined}
3371
+ className={\`\${P}-marquee-set\`}
3372
+ style={{ ...setStyle, paddingRight: scaled(gap) }}
3373
+ aria-hidden={copyIndex > 0}
3374
+ >
3375
+ {setContent.map((item, slotIndex) => renderItem(item, copyIndex, slotIndex))}
3376
+ </div>
3377
+ ))}
3378
+ </div>
3379
+ ) : (
3380
+ <div
3381
+ ref={setRef}
3382
+ className={cn(\`\${P}-marquee-set\`, \`\${P}-marquee-static\`)}
3383
+ style={setStyle}
3384
+ >
3385
+ {content?.map((item, itemIndex) => renderItem(item, 0, itemIndex))}
3386
+ </div>
3387
+ );
3388
+
3389
+ return (
3390
+ <div ref={wrapperRef} className={\`\${P}-wrapper\`} aria-label="Marquee text">
3391
+ <style dangerouslySetInnerHTML={{ __html: scopedCss }} />
3392
+ {capRef}
3393
+ <div ref={bandRef} className={\`\${P}-marquee-wrapper\`} style={bandStyle}>
3394
+ {ribbon}
3395
+ {curveBgSvg}
3396
+ {inner}
3397
+ </div>
3398
+ </div>
3399
+ );
3400
+ };
3401
+
3402
+ export type MarqueeTextItem = {
3403
+ text: string;
3404
+ image?: {
3405
+ url?: string;
3406
+ name?: string;
3407
+ };
3408
+ link?: string;
3409
+ };
3410
+
3411
+ export type MarqueeTextSettings = {
3412
+ speed: number;
3413
+ direction: 'left' | 'right';
3414
+ pauseOnHover: 'on' | 'off';
3415
+ gap: number;
3416
+ ribbonWidth?: number;
3417
+ layoutType: 'straight' | 'curve';
3418
+ curveAmplitude: number;
3419
+ curveFrequency: number;
3420
+ textFontFamily: string;
3421
+ textFontSettings: {
3422
+ fontWeight: number;
3423
+ fontStyle: string;
3424
+ };
3425
+ textFontSize: number;
3426
+ textLineHeight: number;
3427
+ textLetterSpacing: number;
3428
+ textWordSpacing: number;
3429
+ textTextAppearance: {
3430
+ textTransform: string;
3431
+ textDecoration: string;
3432
+ fontVariant: string;
3433
+ };
3434
+ textColor: string;
3435
+ backgroundColor: string;
3436
+ };
3437
+
3438
+ type MarqueeTextProps = {
3439
+ settings: MarqueeTextSettings;
3440
+ content?: MarqueeTextItem[];
3441
+ isEditor?: boolean;
3442
+ isPreviewMode?: boolean;
3443
+ isEditMode?: boolean;
3444
+ } & CommonComponentProps;
3445
+ `,Lg={fontSettings:{type:"object",scope:"common",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Rg={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:{...Lg.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:""}]}},Ig={element:Cg,id:"marquee-text",name:"Marquee Text",category:"galleries",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:Rg,sourceCode:Tg,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily"}};function Eg(e,t){const n=t>0?`${t}px`:"0px";return`
2476
3446
  .${e}-marquee-wrapper {
2477
3447
  overflow: hidden;
2478
3448
  width: 100%;
@@ -2561,7 +3531,7 @@ type MarqueeProps = {
2561
3531
  pointer-events: auto;
2562
3532
  z-index: 10;
2563
3533
  }
2564
- `}const ng=30,ks=2,ig=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")},og=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=S.useScopedStyles(),{align:l,speed:d,direction:c,pauseOnHover:u,gap:p,cardWidth:x,corners:v,stroke:f,strokeColor:h,bgColor:m,padding:b,logoMarginTop:I,logoWidth:R,logoHeight:T,captionMarginTop:U}=e,A=!!o,B=((t==null?void 0:t.length)??0)>0,P=d>0&&(!n||i),L=B&&(P||n),j=Math.max(0,d)*ng,w=_=>S.scalingValue(_,n??!1),W=a.useRef(null),E=a.useRef(null),J=a.useRef(null),[F,X]=a.useState(0),[G,V]=a.useState(0),ie=G>0?G:0,C=a.useMemo(()=>tg(s,ie),[s,ie]),[M,O]=a.useState(0),re=P&&u==="on",[ne,$]=a.useState(!1),ae=a.useRef(null),[k,te]=a.useState(0),[K,fe]=a.useState(0),Ie=a.useRef(null),me=_=>{var oe,H,ee,Me,le;return{fontSettings:{fontFamily:(e==null?void 0:e[`${_}FontFamily`])??"Arial",fontWeight:((oe=e==null?void 0:e[`${_}FontSettings`])==null?void 0:oe.fontWeight)??400,fontStyle:((H=e==null?void 0:e[`${_}FontSettings`])==null?void 0:H.fontStyle)??"normal"},textAppearance:{textTransform:((ee=e==null?void 0:e[`${_}TextAppearance`])==null?void 0:ee.textTransform)??"none",textDecoration:((Me=e==null?void 0:e[`${_}TextAppearance`])==null?void 0:Me.textDecoration)??"none",fontVariant:((le=e==null?void 0:e[`${_}TextAppearance`])==null?void 0:le.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${_}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${_}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${_}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${_}LineHeight`])??.01,color:(e==null?void 0:e[`${_}Color`])??"#000000"}},ue=me("text"),q=me("caption"),Q=a.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(_=>{var he,oe;return(((he=_.text)==null?void 0:he.length)??0)>0||(((oe=_.caption)==null?void 0:oe.length)??0)>0}),[t]),Y=a.useMemo(()=>!L||(t==null?void 0:t.length)===0?1:G<=0||F<=0?ks:Math.max(ks,Math.ceil(F/G)+1),[L,t==null?void 0:t.length,G,F]);a.useLayoutEffect(()=>{if(!L)return;const _=W.current,he=J.current;if(!_||!he)return;let oe=0;const H=()=>{const le=_.getBoundingClientRect().width,D=he.getBoundingClientRect().width,Ve=Ie.current,Oe=typeof Ve=="number"&&Math.abs(Ve-D)<=.25;if(Ie.current=D,X(le),typeof D=="number"&&D>0&&G<=0){V(D);return}Oe&&D!==G?V(D):!Oe&&G<=0&&(cancelAnimationFrame(oe),oe=requestAnimationFrame(H))},ee=()=>{cancelAnimationFrame(oe),oe=requestAnimationFrame(H)};ee();const Me=new ResizeObserver(ee);return Me.observe(_),Me.observe(he),()=>{cancelAnimationFrame(oe),Me.disconnect()}},[P,L,G]);const Ae=ie>0&&j>0?ie/j*1e3:0,Se=`${Math.max(0,Ae)/1e3}s`;a.useLayoutEffect(()=>{if(!L||ie<=0)return;const _=E.current;_&&ig(_)},[L,ie,c]),a.useLayoutEffect(()=>{if(!L){O(0);return}const _=J.current,he=E.current;if(!_||!he)return;const oe=()=>{let ee=0;for(let Me=0;Me<_.children.length;Me++){const D=_.children[Me].firstElementChild;D&&(ee=Math.max(ee,D.offsetHeight))}ee<=0&&(ee=he.offsetHeight),O(ee>0?ee:0)};oe();const H=new ResizeObserver(oe);return H.observe(_),H.observe(he),()=>{H.disconnect()}},[L,Y,t,n,p,x,b,f,v,R,T,k,K]);const Ee=()=>{re&&$(!0)},de=()=>{re&&$(!1)},ge=a.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),be=a.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]),z=a.useCallback((_,he,oe,H)=>r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ge,width:"100%"},children:[r.jsx("div",{"data-controls":A?H==null?void 0:H.controlsName:void 0,"data-controls-axis":A?"y":void 0,className:A?`${s}-control`:void 0,style:{height:w((H==null?void 0:H.marginTop)??0)}}),r.jsx("div",{...H!=null&&H.dataMeasureKind?{"data-testimonial-measure":H.dataMeasureKind}:{},style:{...qt(_,n),textAlign:be,pointerEvents:"auto",...typeof(H==null?void 0:H.minHeightPx)=="number"&&H.minHeightPx>0?{minHeight:H.minHeightPx}:{}},children:r.jsx(yi,{content:he})})]},oe),[ge,be,n,A,s,w]),se=a.useCallback((_,he,oe)=>{var H,ee,Me;return r.jsxs("div",{style:{padding:`${w(b.top)} ${w(b.right)} ${w(b.bottom)} ${w(b.left)}`,width:w(x+f*2),height:"100%",borderRadius:w(v),border:`${w(f)} solid ${h}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[r.jsx("div",{className:`${s}-cover`,style:{background:m}}),r.jsxs("div",{className:`${s}-elements-overlay`,style:{alignItems:ge,textAlign:be},children:[_.text&&z(ue,_.text,"text",oe!=null&&oe.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(oe==null?void 0:oe.textMinHeightPx)=="number"&&oe.textMinHeightPx>0?{minHeightPx:oe.textMinHeightPx}:void 0),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ge,width:"100%"},children:[r.jsx("div",{"data-controls":A&&!(oe!=null&&oe.dataMeasureAttrs)?"logoMarginTop":void 0,className:A&&!(oe!=null&&oe.dataMeasureAttrs)?`${s}-control`:void 0,style:{height:w(I)}}),r.jsx("div",{style:{width:w(R),height:w(T)},children:((H=_.logo)==null?void 0:H.url)&&r.jsx("img",{src:_.logo.url,alt:((ee=_.logo)==null?void 0:ee.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((Me=_.logo)==null?void 0:Me.objectFit)||"contain"}})})]}),_.caption&&z(q,_.caption,"caption",{...oe!=null&&oe.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:U,...oe!=null&&oe.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(oe==null?void 0:oe.captionMinHeightPx)=="number"&&oe.captionMinHeightPx>0?{minHeightPx:oe.captionMinHeightPx}:{}})]})]},he)},[m,U,q,x,v,T,I,R,ge,be,b.bottom,b.left,b.right,b.top,z,f,h,ue,n,A,s]),pe=a.useCallback(_=>{te(_.maxTextPx),fe(_.maxCaptionPx)},[]);a.useLayoutEffect(()=>{if(!Q){pe({maxTextPx:0,maxCaptionPx:0});return}const _=ae.current;if(!_)return;const he=()=>{S.readTestimonialTextMeasure(_,pe)};he();const oe=new ResizeObserver(he);return oe.observe(_),()=>{oe.disconnect()}},[Q,pe,t,se]);const xe=Q?{textMinHeightPx:k,captionMinHeightPx:K}:void 0,Re=Q?r.jsx("div",{ref:ae,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((_,he)=>se(_,`measure-${he}`,{dataMeasureAttrs:!0}))}):null,Te=(_,he)=>r.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[se(_,`card-${he}`,xe),A&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${w(p)})`,width:w(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},he);if(L){const _=P?re&&ne?"paused":"running":"paused";return r.jsxs("div",{ref:W,className:rt(`${s}-wrapper`,`${s}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...M>0?{height:M}:{}},children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:C}}),Re,r.jsx("div",{ref:E,className:`${s}-marquee-track`,"data-direction":c,onMouseEnter:Ee,onMouseLeave:de,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:Se,WebkitAnimationDuration:Se,animationPlayState:_,WebkitAnimationPlayState:_},children:Array.from({length:Y},(he,oe)=>r.jsx("div",{ref:oe===0?J:void 0,className:`${s}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:w(p),paddingRight:w(p)},"aria-hidden":oe>0,children:t==null?void 0:t.map((H,ee)=>Te(H,`${oe}-${ee}`))},`set-${oe}`))})]})}return r.jsxs("div",{className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:C}}),Re,r.jsx("div",{style:{gap:w(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((_,he)=>Te(_,he))})]})},rg=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
3534
+ `}const Mg=30,Ws=2,Pg=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")},kg=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=C.useScopedStyles(),{align:l,speed:d,direction:c,pauseOnHover:u,gap:p,cardWidth:v,corners:y,stroke:g,strokeColor:h,bgColor:m,padding:b,logoMarginTop:I,logoWidth:R,logoHeight:T,captionMarginTop:q}=e,F=!!o,V=((t==null?void 0:t.length)??0)>0,A=d>0&&(!n||i),L=V&&(A||n),O=Math.max(0,d)*Mg,x=H=>C.scalingValue(H,n??!1),W=a.useRef(null),E=a.useRef(null),J=a.useRef(null),[P,K]=a.useState(0),[B,z]=a.useState(0),ie=B>0?B:0,S=a.useMemo(()=>Eg(s,ie),[s,ie]),[M,D]=a.useState(0),le=A&&u==="on",[oe,$]=a.useState(!1),ae=a.useRef(null),[k,te]=a.useState(0),[X,ve]=a.useState(0),Pe=a.useRef(null),he=H=>{var re,_,ee,Ae,ue;return{fontSettings:{fontFamily:(e==null?void 0:e[`${H}FontFamily`])??"Arial",fontWeight:((re=e==null?void 0:e[`${H}FontSettings`])==null?void 0:re.fontWeight)??400,fontStyle:((_=e==null?void 0:e[`${H}FontSettings`])==null?void 0:_.fontStyle)??"normal"},textAppearance:{textTransform:((ee=e==null?void 0:e[`${H}TextAppearance`])==null?void 0:ee.textTransform)??"none",textDecoration:((Ae=e==null?void 0:e[`${H}TextAppearance`])==null?void 0:Ae.textDecoration)??"none",fontVariant:((ue=e==null?void 0:e[`${H}TextAppearance`])==null?void 0:ue.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${H}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${H}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${H}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${H}LineHeight`])??.01,color:(e==null?void 0:e[`${H}Color`])??"#000000"}},ce=he("text"),U=he("caption"),Y=a.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(H=>{var ye,re;return(((ye=H.text)==null?void 0:ye.length)??0)>0||(((re=H.caption)==null?void 0:re.length)??0)>0}),[t]),Z=a.useMemo(()=>!L||(t==null?void 0:t.length)===0?1:B<=0||P<=0?Ws:Math.max(Ws,Math.ceil(P/B)+1),[L,t==null?void 0:t.length,B,P]);a.useLayoutEffect(()=>{if(!L)return;const H=W.current,ye=J.current;if(!H||!ye)return;let re=0;const _=()=>{const ue=H.getBoundingClientRect().width,N=ye.getBoundingClientRect().width,Ue=Pe.current,Oe=typeof Ue=="number"&&Math.abs(Ue-N)<=.25;if(Pe.current=N,K(ue),typeof N=="number"&&N>0&&B<=0){z(N);return}Oe&&N!==B?z(N):!Oe&&B<=0&&(cancelAnimationFrame(re),re=requestAnimationFrame(_))},ee=()=>{cancelAnimationFrame(re),re=requestAnimationFrame(_)};ee();const Ae=new ResizeObserver(ee);return Ae.observe(H),Ae.observe(ye),()=>{cancelAnimationFrame(re),Ae.disconnect()}},[A,L,B]);const We=ie>0&&O>0?ie/O*1e3:0,$e=`${Math.max(0,We)/1e3}s`;a.useLayoutEffect(()=>{if(!L||ie<=0)return;const H=E.current;H&&Pg(H)},[L,ie,c]),a.useLayoutEffect(()=>{if(!L){D(0);return}const H=J.current,ye=E.current;if(!H||!ye)return;const re=()=>{let ee=0;for(let Ae=0;Ae<H.children.length;Ae++){const N=H.children[Ae].firstElementChild;N&&(ee=Math.max(ee,N.offsetHeight))}ee<=0&&(ee=ye.offsetHeight),D(ee>0?ee:0)};re();const _=new ResizeObserver(re);return _.observe(H),_.observe(ye),()=>{_.disconnect()}},[L,Z,t,n,p,v,b,g,y,R,T,k,X]);const ke=()=>{le&&$(!0)},de=()=>{le&&$(!1)},fe=a.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),we=a.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]),G=a.useCallback((H,ye,re,_)=>r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:fe,width:"100%"},children:[r.jsx("div",{"data-controls":F?_==null?void 0:_.controlsName:void 0,"data-controls-axis":F?"y":void 0,className:F?`${s}-control`:void 0,style:{height:x((_==null?void 0:_.marginTop)??0)}}),r.jsx("div",{..._!=null&&_.dataMeasureKind?{"data-testimonial-measure":_.dataMeasureKind}:{},style:{...Xt(H,n),textAlign:we,pointerEvents:"auto",...typeof(_==null?void 0:_.minHeightPx)=="number"&&_.minHeightPx>0?{minHeight:_.minHeightPx}:{}},children:r.jsx(yi,{content:ye})})]},re),[fe,we,n,F,s,x]),se=a.useCallback((H,ye,re)=>{var _,ee,Ae;return r.jsxs("div",{style:{padding:`${x(b.top)} ${x(b.right)} ${x(b.bottom)} ${x(b.left)}`,width:x(v+g*2),height:"100%",borderRadius:x(y),border:`${x(g)} solid ${h}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[r.jsx("div",{className:`${s}-cover`,style:{background:m}}),r.jsxs("div",{className:`${s}-elements-overlay`,style:{alignItems:fe,textAlign:we},children:[H.text&&G(ce,H.text,"text",re!=null&&re.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(re==null?void 0:re.textMinHeightPx)=="number"&&re.textMinHeightPx>0?{minHeightPx:re.textMinHeightPx}:void 0),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:fe,width:"100%"},children:[r.jsx("div",{"data-controls":F&&!(re!=null&&re.dataMeasureAttrs)?"logoMarginTop":void 0,className:F&&!(re!=null&&re.dataMeasureAttrs)?`${s}-control`:void 0,style:{height:x(I)}}),r.jsx("div",{style:{width:x(R),height:x(T)},children:((_=H.logo)==null?void 0:_.url)&&r.jsx("img",{src:H.logo.url,alt:((ee=H.logo)==null?void 0:ee.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((Ae=H.logo)==null?void 0:Ae.objectFit)||"contain"}})})]}),H.caption&&G(U,H.caption,"caption",{...re!=null&&re.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:q,...re!=null&&re.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(re==null?void 0:re.captionMinHeightPx)=="number"&&re.captionMinHeightPx>0?{minHeightPx:re.captionMinHeightPx}:{}})]})]},ye)},[m,q,U,v,y,T,I,R,fe,we,b.bottom,b.left,b.right,b.top,G,g,h,ce,n,F,s]),pe=a.useCallback(H=>{te(H.maxTextPx),ve(H.maxCaptionPx)},[]);a.useLayoutEffect(()=>{if(!Y){pe({maxTextPx:0,maxCaptionPx:0});return}const H=ae.current;if(!H)return;const ye=()=>{C.readTestimonialTextMeasure(H,pe)};ye();const re=new ResizeObserver(ye);return re.observe(H),()=>{re.disconnect()}},[Y,pe,t,se]);const Se=Y?{textMinHeightPx:k,captionMinHeightPx:X}:void 0,Me=Y?r.jsx("div",{ref:ae,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((H,ye)=>se(H,`measure-${ye}`,{dataMeasureAttrs:!0}))}):null,Le=(H,ye)=>r.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[se(H,`card-${ye}`,Se),F&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${x(p)})`,width:x(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},ye);if(L){const H=A?le&&oe?"paused":"running":"paused";return r.jsxs("div",{ref:W,className:ut(`${s}-wrapper`,`${s}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...M>0?{height:M}:{}},children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:S}}),Me,r.jsx("div",{ref:E,className:`${s}-marquee-track`,"data-direction":c,onMouseEnter:ke,onMouseLeave:de,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:$e,WebkitAnimationDuration:$e,animationPlayState:H,WebkitAnimationPlayState:H},children:Array.from({length:Z},(ye,re)=>r.jsx("div",{ref:re===0?J:void 0,className:`${s}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:x(p),paddingRight:x(p)},"aria-hidden":re>0,children:t==null?void 0:t.map((_,ee)=>Le(_,`${re}-${ee}`))},`set-${re}`))})]})}return r.jsxs("div",{className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:S}}),Me,r.jsx("div",{style:{gap:x(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((H,ye)=>Le(H,ye))})]})},Ag=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
2565
3535
  import cn from 'classnames';
2566
3536
  import { CommonComponentProps } from '../props';
2567
3537
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
@@ -3192,7 +4162,7 @@ type TestimonialsSettings = {
3192
4162
  logoHeight: number;
3193
4163
  captionMarginTop: number;
3194
4164
  };
3195
- `,As={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},ag={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:{...As.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:{...As.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"}]}]}]}},sg={element:og,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:ag,sourceCode:rg,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function lg(e){return`
4165
+ `,_s={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Fg={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:{..._s.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:{..._s.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"}]}]}]}},Wg={element:kg,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:Fg,sourceCode:Ag,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function _g(e){return`
3196
4166
  .${e}-container {
3197
4167
  position: relative;
3198
4168
  overflow-x: clip;
@@ -3316,7 +4286,7 @@ type TestimonialsSettings = {
3316
4286
  width: 100%;
3317
4287
  height: 100%;
3318
4288
  }
3319
- `}const cg=3e3,dg=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=S.useScopedStyles(),l=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:x,captionMarginTop:v,imageWidth:f,imageHeight:h,controlsWidth:m,controlsColor:b,controlsHoverColor:I}=e,R=d>0&&(!n||!!i),[T,U]=a.useState(0),[A,B]=a.useState(null),[P,L]=a.useState(!1),j=a.useRef(null),w=a.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),W=a.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);a.useEffect(()=>{U(0),B(null),L(!1)},[l.length]);const E=l[T],J=A===null?null:l[A],F=me=>{var q,Q,Y,Ae,Se;return{fontSettings:{fontFamily:(e==null?void 0:e[`${me}FontFamily`])??"Arial",fontWeight:((q=e==null?void 0:e[`${me}FontSettings`])==null?void 0:q.fontWeight)??400,fontStyle:((Q=e==null?void 0:e[`${me}FontSettings`])==null?void 0:Q.fontStyle)??"normal"},textAppearance:{textTransform:((Y=e==null?void 0:e[`${me}TextAppearance`])==null?void 0:Y.textTransform)??"none",textDecoration:((Ae=e==null?void 0:e[`${me}TextAppearance`])==null?void 0:Ae.textDecoration)??"none",fontVariant:((Se=e==null?void 0:e[`${me}TextAppearance`])==null?void 0:Se.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${me}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${me}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${me}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${me}WordSpacing`])??0,color:(e==null?void 0:e[`${me}Color`])??"#000000"}},X=F("text"),G=F("caption"),V=l.length>1&&l.some(me=>{var ue,q;return(((ue=me.text)==null?void 0:ue.length)??0)>0||(((q=me.caption)==null?void 0:q.length)??0)>0}),ie=a.useRef(null),[C,M]=a.useState(0),[O,re]=a.useState(0),ne=e.controls??{mode:"Off",icon:null},$=l.length>1,ae=a.useCallback((me,ue)=>!$||ue===me?me:(j.current&&window.clearTimeout(j.current),B(me),L(!0),j.current=window.setTimeout(()=>{B(null),L(!1),j.current=null},300),ue),[$]),k=a.useCallback(()=>{$&&U(me=>ae(me,(me-1+l.length)%l.length))},[$,ae,l.length]),te=a.useCallback(()=>{$&&U(me=>ae(me,(me+1)%l.length))},[$,ae,l.length]);a.useEffect(()=>{if(!R||!$)return;const me=Math.max(300,cg/d),ue=window.setInterval(()=>{U(q=>ae(q,(q+1)%l.length))},me);return()=>{window.clearInterval(ue)}},[R,$,ae,l.length,d]),a.useEffect(()=>()=>{j.current&&window.clearTimeout(j.current)},[]);const K=(me,ue)=>{var Se,Ee,de,ge;const q=ue==null?void 0:ue.textMinHeightPx,Q=ue==null?void 0:ue.captionMinHeightPx,Y=ue==null?void 0:ue.dataMeasureAttrs,Ae=o&&!(ue!=null&&ue.dataMeasureAttrs)&&!(ue!=null&&ue.hideControls);return r.jsxs(r.Fragment,{children:[me.text&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:w,width:"100%"},children:[r.jsx("div",{"data-controls":Ae?"textMarginTop":void 0,className:Ae?`${s}-control`:void 0,style:{height:S.scalingValue(x??0,n??!1)}}),r.jsx("div",{...Y&&{"data-testimonial-measure":"text"},style:{...qt(X,n),...q&&q>0?{minHeight:q}:{},textAlign:W,pointerEvents:"auto"},children:r.jsx(yi,{content:me.text})})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:w,width:"100%"},children:[r.jsx("div",{"data-controls":Ae?"imageMarginTop":void 0,className:Ae?`${s}-control`:void 0,style:{height:S.scalingValue(p??0,n??!1)}}),r.jsx("div",{style:{width:S.scalingValue(f??0,n??!1),height:S.scalingValue(h??0,n??!1)},children:((Se=me.image)==null?void 0:Se.url)&&r.jsx("img",{src:(Ee=me.image)==null?void 0:Ee.url,alt:((de=me.image)==null?void 0:de.name)??"",className:`${s}-icon`,style:{objectFit:((ge=me.image)==null?void 0:ge.objectFit)||"contain"}})})]}),me.caption&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:w,width:"100%"},children:[r.jsx("div",{"data-controls":Ae?"captionMarginTop":void 0,className:Ae?`${s}-control`:void 0,style:{height:S.scalingValue(v??0,n??!1)}}),r.jsx("div",{...Y?{"data-testimonial-measure":"caption"}:{},style:{...qt(G,n),...Q&&Q>0?{minHeight:Q}:{},textAlign:W,pointerEvents:"auto"},children:r.jsx(yi,{content:me.caption})})]})]})},fe=a.useCallback(me=>{M(me.maxTextPx),re(me.maxCaptionPx)},[]);if(a.useLayoutEffect(()=>{if(!V){fe({maxTextPx:0,maxCaptionPx:0});return}const me=ie.current;if(!me)return;const ue=()=>{S.readTestimonialTextMeasure(me,fe)};ue();const q=new ResizeObserver(ue);return q.observe(me),()=>{q.disconnect()}},[V,fe,t]),!E)return r.jsx(r.Fragment,{});const Ie=V?{textMinHeightPx:C,captionMinHeightPx:O}:void 0;return r.jsx(r.Fragment,{children:r.jsxs("div",{className:`${s}-container`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:lg(s)}}),r.jsxs("div",{className:`${s}-wrapper`,style:{width:S.scalingValue(u??0,n??!1),alignItems:w},children:[V&&r.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((me,ue)=>r.jsx("div",{style:{width:"100%"},children:K(me,{dataMeasureAttrs:!0})},ue))}),r.jsxs("div",{className:`${s}-fade-stack`,children:[J&&P&&r.jsx("div",{className:rt(`${s}-fade-item-prev`,`${s}-fade-out`),children:K(J,{...Ie,hideControls:!0})}),r.jsx("div",{className:rt(`${s}-fade-item-current`,P?`${s}-fade-in`:void 0),children:K(E,Ie)})]})]}),ne.mode==="On"&&r.jsxs("div",{className:`${s}-controls`,children:[r.jsx("div",{className:`${s}-arrow`,style:{width:S.scalingValue(m??.02,n??!1),height:S.scalingValue(m??.02,n??!1),"--arrow-hover-color":I},children:r.jsx("button",{type:"button",className:`${s}-arrow-inner`,onClick:k,disabled:!$,"aria-label":"Previous testimonial",children:ne.icon&&r.jsx(rn,{url:ne.icon,fill:b,hoverFill:I,className:rt(`${s}-arrow-img`,`${s}-mirror`)})})}),r.jsx("div",{className:rt(`${s}-arrow`,`${s}-next-arrow`),style:{width:S.scalingValue(m??.02,n??!1),height:S.scalingValue(m??.02,n??!1),"--arrow-hover-color":I},children:r.jsx("button",{type:"button",className:`${s}-arrow-inner`,onClick:te,disabled:!$,"aria-label":"Next testimonial",children:ne.icon&&r.jsx(rn,{url:ne.icon,fill:b,hoverFill:I,className:`${s}-arrow-img`})})})]})]})})},ug=`import cn from 'classnames';
4289
+ `}const Hg=3e3,Ng=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=C.useScopedStyles(),l=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:v,captionMarginTop:y,imageWidth:g,imageHeight:h,controlsWidth:m,controlsColor:b,controlsHoverColor:I}=e,R=d>0&&(!n||!!i),[T,q]=a.useState(0),[F,V]=a.useState(null),[A,L]=a.useState(!1),O=a.useRef(null),x=a.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),W=a.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);a.useEffect(()=>{q(0),V(null),L(!1)},[l.length]);const E=l[T],J=F===null?null:l[F],P=he=>{var U,Y,Z,We,$e;return{fontSettings:{fontFamily:(e==null?void 0:e[`${he}FontFamily`])??"Arial",fontWeight:((U=e==null?void 0:e[`${he}FontSettings`])==null?void 0:U.fontWeight)??400,fontStyle:((Y=e==null?void 0:e[`${he}FontSettings`])==null?void 0:Y.fontStyle)??"normal"},textAppearance:{textTransform:((Z=e==null?void 0:e[`${he}TextAppearance`])==null?void 0:Z.textTransform)??"none",textDecoration:((We=e==null?void 0:e[`${he}TextAppearance`])==null?void 0:We.textDecoration)??"none",fontVariant:(($e=e==null?void 0:e[`${he}TextAppearance`])==null?void 0:$e.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${he}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${he}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${he}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${he}WordSpacing`])??0,color:(e==null?void 0:e[`${he}Color`])??"#000000"}},K=P("text"),B=P("caption"),z=l.length>1&&l.some(he=>{var ce,U;return(((ce=he.text)==null?void 0:ce.length)??0)>0||(((U=he.caption)==null?void 0:U.length)??0)>0}),ie=a.useRef(null),[S,M]=a.useState(0),[D,le]=a.useState(0),oe=e.controls??{mode:"Off",icon:null},$=l.length>1,ae=a.useCallback((he,ce)=>!$||ce===he?he:(O.current&&window.clearTimeout(O.current),V(he),L(!0),O.current=window.setTimeout(()=>{V(null),L(!1),O.current=null},300),ce),[$]),k=a.useCallback(()=>{$&&q(he=>ae(he,(he-1+l.length)%l.length))},[$,ae,l.length]),te=a.useCallback(()=>{$&&q(he=>ae(he,(he+1)%l.length))},[$,ae,l.length]);a.useEffect(()=>{if(!R||!$)return;const he=Math.max(300,Hg/d),ce=window.setInterval(()=>{q(U=>ae(U,(U+1)%l.length))},he);return()=>{window.clearInterval(ce)}},[R,$,ae,l.length,d]),a.useEffect(()=>()=>{O.current&&window.clearTimeout(O.current)},[]);const X=(he,ce)=>{var $e,ke,de,fe;const U=ce==null?void 0:ce.textMinHeightPx,Y=ce==null?void 0:ce.captionMinHeightPx,Z=ce==null?void 0:ce.dataMeasureAttrs,We=o&&!(ce!=null&&ce.dataMeasureAttrs)&&!(ce!=null&&ce.hideControls);return r.jsxs(r.Fragment,{children:[he.text&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:x,width:"100%"},children:[r.jsx("div",{"data-controls":We?"textMarginTop":void 0,className:We?`${s}-control`:void 0,style:{height:C.scalingValue(v??0,n??!1)}}),r.jsx("div",{...Z&&{"data-testimonial-measure":"text"},style:{...Xt(K,n),...U&&U>0?{minHeight:U}:{},textAlign:W,pointerEvents:"auto"},children:r.jsx(yi,{content:he.text})})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:x,width:"100%"},children:[r.jsx("div",{"data-controls":We?"imageMarginTop":void 0,className:We?`${s}-control`:void 0,style:{height:C.scalingValue(p??0,n??!1)}}),r.jsx("div",{style:{width:C.scalingValue(g??0,n??!1),height:C.scalingValue(h??0,n??!1)},children:(($e=he.image)==null?void 0:$e.url)&&r.jsx("img",{src:(ke=he.image)==null?void 0:ke.url,alt:((de=he.image)==null?void 0:de.name)??"",className:`${s}-icon`,style:{objectFit:((fe=he.image)==null?void 0:fe.objectFit)||"contain"}})})]}),he.caption&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:x,width:"100%"},children:[r.jsx("div",{"data-controls":We?"captionMarginTop":void 0,className:We?`${s}-control`:void 0,style:{height:C.scalingValue(y??0,n??!1)}}),r.jsx("div",{...Z?{"data-testimonial-measure":"caption"}:{},style:{...Xt(B,n),...Y&&Y>0?{minHeight:Y}:{},textAlign:W,pointerEvents:"auto"},children:r.jsx(yi,{content:he.caption})})]})]})},ve=a.useCallback(he=>{M(he.maxTextPx),le(he.maxCaptionPx)},[]);if(a.useLayoutEffect(()=>{if(!z){ve({maxTextPx:0,maxCaptionPx:0});return}const he=ie.current;if(!he)return;const ce=()=>{C.readTestimonialTextMeasure(he,ve)};ce();const U=new ResizeObserver(ce);return U.observe(he),()=>{U.disconnect()}},[z,ve,t]),!E)return r.jsx(r.Fragment,{});const Pe=z?{textMinHeightPx:S,captionMinHeightPx:D}:void 0;return r.jsx(r.Fragment,{children:r.jsxs("div",{className:`${s}-container`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:_g(s)}}),r.jsxs("div",{className:`${s}-wrapper`,style:{width:C.scalingValue(u??0,n??!1),alignItems:x},children:[z&&r.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((he,ce)=>r.jsx("div",{style:{width:"100%"},children:X(he,{dataMeasureAttrs:!0})},ce))}),r.jsxs("div",{className:`${s}-fade-stack`,children:[J&&A&&r.jsx("div",{className:ut(`${s}-fade-item-prev`,`${s}-fade-out`),children:X(J,{...Pe,hideControls:!0})}),r.jsx("div",{className:ut(`${s}-fade-item-current`,A?`${s}-fade-in`:void 0),children:X(E,Pe)})]})]}),oe.mode==="On"&&r.jsxs("div",{className:`${s}-controls`,children:[r.jsx("div",{className:`${s}-arrow`,style:{width:C.scalingValue(m??.02,n??!1),height:C.scalingValue(m??.02,n??!1),"--arrow-hover-color":I},children:r.jsx("button",{type:"button",className:`${s}-arrow-inner`,onClick:k,disabled:!$,"aria-label":"Previous testimonial",children:oe.icon&&r.jsx(an,{url:oe.icon,fill:b,hoverFill:I,className:ut(`${s}-arrow-img`,`${s}-mirror`)})})}),r.jsx("div",{className:ut(`${s}-arrow`,`${s}-next-arrow`),style:{width:C.scalingValue(m??.02,n??!1),height:C.scalingValue(m??.02,n??!1),"--arrow-hover-color":I},children:r.jsx("button",{type:"button",className:`${s}-arrow-inner`,onClick:te,disabled:!$,"aria-label":"Next testimonial",children:oe.icon&&r.jsx(an,{url:oe.icon,fill:b,hoverFill:I,className:`${s}-arrow-img`})})})]})]})})},Og=`import cn from 'classnames';
3320
4290
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
3321
4291
  import { CommonComponentProps } from '../props';
3322
4292
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
@@ -3812,12 +4782,12 @@ type TestimonialsSettings = {
3812
4782
  icon?: string | null;
3813
4783
  };
3814
4784
  };
3815
- `,pg="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>'),Fs={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},mg={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:{...Fs.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:{...Fs.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:pg},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"}]}]}]}},gg={element:dg,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:mg,sourceCode:ug,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function hg(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ws(e){return((e==null?void 0:e.trim().length)??0)>0}function Ur(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function qr(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:S.scalingValue((o-t)/2,i)}}function fg(e){return`
4785
+ `,Dg="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>'),Hs={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},jg={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:{...Hs.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:{...Hs.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:Dg},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"}]}]}]}},zg={element:Ng,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:jg,sourceCode:Og,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function Bg(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ns(e){return((e==null?void 0:e.trim().length)??0)>0}function Xr(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Kr(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:C.scalingValue((o-t)/2,i)}}function Vg(e){return`
3816
4786
  .${e}-wrapper {
3817
4787
  display: grid;
3818
4788
  align-items: start;
3819
4789
  justify-content: center;
3820
- min-height: ${hg(48)};
4790
+ min-height: ${Bg(48)};
3821
4791
  }
3822
4792
  .${e}-item {
3823
4793
  display: flex;
@@ -4159,7 +5129,7 @@ type TestimonialsSettings = {
4159
5129
  z-index: 2;
4160
5130
  width: 100%;
4161
5131
  }
4162
- `}function yg(){return Math.random()<.5?"ltr":"ttb"}function vg(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function bg(e){const t=yg();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{vg(e)})})}const vn=500,xg=750,Hn="cubic-bezier(0.22, 1, 0.36, 1)",wg=72,Sg=50;function $g(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 Cg(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Tg(e){const[t]=e.media;return t!=null&&t.url?t:null}function wc(e){return!Array.isArray(e)||e.length===0?[]:$g(e)?e.flatMap(t=>{const n=Cg(t);if(!n)return[];const i=Tg(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 gi(e){return e.type==="video"}function Lg(e){const t=new Set,n=[];for(const i of e){const o=wc(i.gallery);for(const s of o){const l=s.lightboxMedia;l!=null&&l.url&&!t.has(l.url)&&(t.add(l.url),n.push(l))}}return n}function Rg({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>gi(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function Ig(e){e.pause(),e.removeAttribute("src"),e.load()}function _s({media:e,className:t,style:n,onMediaClick:i}){return gi(e)?r.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):r.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function Hs(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Eg(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 s=e.width/n;return{width:e.width,height:s,left:e.left,top:e.top+(e.height-s)/2}}const o=e.height*n;return{width:o,height:e.height,left:e.left+(e.width-o)/2,top:e.top}}function Mg({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:s,onMouseMove:l}){return a.useEffect(()=>{const d=n.current;if(d)return()=>{Ig(d)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:s,onMouseMove:l,style:i})}function Pg({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:s,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",x=a.useRef(null),v=a.useRef(null),f=a.useRef(null),h=a.useRef(null),m=a.useRef(0),b=a.useRef(0),I=a.useRef("none"),R=a.useRef(!1),T=a.useRef(!1),U=a.useRef(null),A=a.useRef(0),B=a.useRef(null),P=a.useRef(!1),L=a.useRef(null),j=a.useRef(null),w=a.useRef(null),W=a.useRef(()=>{}),[E,J]=a.useState(null),[F,X]=a.useState(null),[G,V]=a.useState("opening"),[ie,C]=a.useState(0),[M,O]=a.useState(0),[re,ne]=a.useState(null),[$,ae]=a.useState(!1),[k,te]=a.useState(!1),[K,fe]=a.useState(!1),[Ie,me]=a.useState(null),ue=a.useRef(n),q=a.useRef(void 0),Q=t[n],Y=Q?gi(Q):!1,Ae=M!==0||$,Se=re!==null,Ee=a.useCallback($e=>{const He=$e.currentTarget,ze=He instanceof HTMLVideoElement?{width:He.videoWidth,height:He.videoHeight}:{width:He.naturalWidth,height:He.naturalHeight};!ze.width||!ze.height||me(ze)},[]);a.useEffect(()=>{U.current=F},[F]),a.useEffect(()=>{const $e=x.current;if(!$e)return;const He=()=>X(Hs($e));He();const ze=new ResizeObserver(He);return ze.observe($e),()=>ze.disconnect()},[]);const de=a.useCallback(()=>{L.current!==null&&(window.clearTimeout(L.current),L.current=null)},[]),ge=a.useCallback(()=>{const $e=j.current;j.current=null,de(),B.current=null,P.current=!1,ne(null),ae(!1),O(0),A.current=0,te(!1),R.current=!1,b.current=0,I.current="none",$e===1?d():$e===-1&&l()},[de,d,l]),be=a.useCallback(()=>{de(),j.current=null,B.current=null,P.current=!1,ne(null),ae(!1),O(0),A.current=0},[de]),z=a.useCallback(()=>{de(),L.current=window.setTimeout(()=>{j.current!==null&&ge()},vn+32)},[de,ge]),se=a.useCallback(($e,He)=>{var Xe;const ze=((Xe=U.current)==null?void 0:Xe.width)??0;if(de(),B.current=$e,ne($e),P.current=!0,ae(!0),He){j.current=$e;const ct=-$e*ze;A.current=ct,O(ct),z();return}A.current=0,O(0),L.current=window.setTimeout(()=>{L.current=null,be()},vn+32)},[de,be,z]),pe=a.useCallback($e=>{if(!(t.length<=1)){if(P.current){if(j.current===$e){w.current=$e,ge();return}be()}de(),B.current=$e,ne($e),P.current=!1,ae(!1),A.current=0,O(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{se($e,!0)})})}},[t.length,se,ge,be,de]);W.current=pe;const xe=a.useCallback($e=>{$e.propertyName!=="transform"||!P.current||j.current!==null&&ge()},[ge]),Re=a.useCallback(()=>{const $e=v.current;if(!$e)return;const He=Hs($e);!He.width||!He.height||J(He)},[]);a.useEffect(()=>{Re();const $e=v.current;if(!$e)return;const He=new ResizeObserver(()=>Re());return He.observe($e),()=>He.disconnect()},[Re]),a.useEffect(()=>{G==="opening"&&E&&V("open")},[G,E]),a.useEffect(()=>{if(G!=="closing")return;const $e=setTimeout(()=>s(),vn);return()=>clearTimeout($e)},[G,s]),a.useEffect(()=>()=>{de()},[de]),a.useLayoutEffect(()=>{ue.current===n&&q.current===(Q==null?void 0:Q.url)||(de(),j.current=null,ne(null),C(0),O(0),ae(!1),fe(!1),te(!1),me(null),m.current=0,b.current=0,I.current="none",R.current=!1,P.current=!1,A.current=0,B.current=null,h.current=null,T.current=!1,ue.current=n,q.current=Q==null?void 0:Q.url)},[n,Q==null?void 0:Q.url,de]),a.useLayoutEffect(()=>{const $e=w.current;$e!==null&&(w.current=null,requestAnimationFrame(()=>{W.current($e)}))},[n,Q==null?void 0:Q.url]),a.useEffect(()=>{if(G!=="open")return;let $e=null;const He=()=>{$e&&(document.removeEventListener("click",$e,!0),$e=null)},ze=()=>{He(),$e=dt=>{dt.stopPropagation(),dt.preventDefault(),He()},document.addEventListener("click",$e,!0)},Xe=dt=>{const We=dt<0?1:-1;if(Math.abs(dt)>Sg&&t.length>1){se(We,!0);return}se(We,!1)},ct=dt=>{if(dt.touches.length!==1||P.current)return;const We=dt.touches[0];T.current=!0,h.current={x:We.clientX,y:We.clientY},I.current="none",b.current=0,R.current=!1},Je=dt=>{if(!h.current||dt.touches.length!==1||P.current)return;const We=dt.touches[0],Ke=We.clientX-h.current.x,je=We.clientY-h.current.y;if(I.current==="none"){if(Math.abs(Ke)<10&&Math.abs(je)<10)return;if(Math.abs(Ke)>Math.abs(je)){if(t.length<=1)return;I.current="horizontal"}else if(je>0)I.current="vertical";else return}if(I.current==="horizontal"){R.current=!0,te(!0),b.current=Ke;const ut=Ke<0?1:-1;B.current!==ut&&(B.current=ut,ne(ut)),A.current=Ke,O(Ke),dt.preventDefault();return}I.current==="vertical"&&(R.current=!0,te(!0),m.current=je,C(je),dt.preventDefault())},$t=()=>{if(!h.current)return;const dt=I.current,We=R.current;if(We&&dt==="horizontal")Xe(b.current),ze();else if(We&&dt==="vertical")if(m.current>wg){const je=window.innerHeight;m.current=je,fe(!0),C(je),V("closing")}else m.current=0,C(0),ze();else dt==="horizontal"&&Math.abs(b.current)>0&&(Xe(b.current),ze());h.current=null,I.current="none",b.current=0,R.current=!1,te(!1)};return document.addEventListener("touchstart",ct,{passive:!0}),document.addEventListener("touchmove",Je,{passive:!1}),document.addEventListener("touchend",$t),document.addEventListener("touchcancel",$t),()=>{document.removeEventListener("touchstart",ct),document.removeEventListener("touchmove",Je),document.removeEventListener("touchend",$t),document.removeEventListener("touchcancel",$t),He()}},[G,t.length,se]),a.useEffect(()=>{const $e=He=>{He.key==="Escape"&&(He.preventDefault(),He.stopPropagation(),G!=="closing"&&V("closing"))};return window.addEventListener("keydown",$e,!0),()=>window.removeEventListener("keydown",$e,!0)},[G]);const Te=()=>{G!=="closing"&&V("closing")},_=G==="open",he=G==="closing",oe=ie>0?Math.max(0,1-ie/500):1,H=ie>0?Math.max(.35,1-ie/500):1,ee=E?p?E:Eg(E,Ie):null,Me=$e=>{if($e.stopPropagation(),T.current){T.current=!1;return}if(t.length<=1)return;const He=ee??$e.currentTarget.getBoundingClientRect(),ze=$e.clientY-He.top,Xe=Math.min(52,He.height*.2);if(!(ze>He.height-Xe)){if($e.clientX-He.left<He.width/2){pe(-1);return}pe(1)}},le=$e=>{if(t.length<=1)return;const He=ee??$e.currentTarget.getBoundingClientRect(),ze=$e.clientX-He.left,Xe=$e.clientY-He.top,ct=Math.min(52,He.height*.2);if(Xe>He.height-ct){$e.currentTarget.style.cursor="default";return}$e.currentTarget.style.cursor=ze<He.width/2?"w-resize":"e-resize"},D={position:"fixed",top:F==null?void 0:F.top,left:F==null?void 0:F.left,width:F==null?void 0:F.width,height:F==null?void 0:F.height,zIndex:9998},Ve=p?"cover":"contain",Oe=M!==0||ie>0?`translate(${M}px, ${ie}px)`:void 0,lt=k&&!$?"none":$?`transform ${vn}ms ${Hn}`:K?`transform ${vn}ms ${Hn}, opacity ${vn}ms ${Hn}`:G==="opening"||he?`opacity ${vn}ms ${Hn}`:"none",tt={...D,transform:Oe,opacity:ie>0?H:G==="opening"||he?0:1,transition:lt,pointerEvents:"none"},ht={position:"absolute",top:((ee==null?void 0:ee.top)??0)-((F==null?void 0:F.top)??0),left:((ee==null?void 0:ee.left)??0)-((F==null?void 0:F.left)??0),width:ee==null?void 0:ee.width,height:ee==null?void 0:ee.height,objectFit:Ve,pointerEvents:Y&&_&&!Ae?"auto":"none",touchAction:Y&&_?"none":void 0},nt=(F==null?void 0:F.width)??0,Be=Se?(n+re+t.length)%t.length:null,ve=Be!==null?t[Be]:null,ke={...D,transform:Se?`translateX(${re*nt+M}px)`:void 0,opacity:1,transition:$?`transform ${vn}ms ${Hn}`:"none",pointerEvents:"none"},De={position:"absolute",top:((E==null?void 0:E.top)??0)-((F==null?void 0:F.top)??0),left:((E==null?void 0:E.left)??0)-((F==null?void 0:F.left)??0),width:E==null?void 0:E.width,height:E==null?void 0:E.height,objectFit:Ve,pointerEvents:"none"},Ue=ee?{position:"fixed",top:ee.top,height:ee.height,width:ee.width/2,zIndex:9999}:null;return r.jsxs("div",{ref:x,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:G==="open"?"none":void 0},onClick:Te,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:_?oe:0,transition:k?"none":`opacity ${vn}ms ${Hn}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:p?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:v,style:{position:"absolute",inset:0}}),r.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:_?1:0,transition:`opacity ${vn}ms ${Hn}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:v,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:_?1:0,transition:`opacity ${vn}ms ${Hn}`},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),E&&F&&ve&&r.jsx("div",{style:ke,onTransitionEnd:xe,children:gi(ve)?r.jsx("video",{src:ve.url,muted:!0,playsInline:!0,preload:"auto",style:De},`neighbor-${Be}-${ve.url}`):r.jsx("img",{src:ve.url,alt:ve.name,style:De},`neighbor-${Be}-${ve.url}`)}),E&&F&&Q&&r.jsx("div",{style:tt,onTransitionEnd:xe,children:Y?r.jsx(Mg,{src:Q.url,phase:G,mediaRef:f,mediaStyle:ht,onLoadedMetadata:Ee,onClick:Me,onMouseMove:le},`${n}-${Q.url}`):r.jsx("img",{ref:f,src:Q.url,alt:Q.name,onLoad:Ee,style:ht},`${n}-${Q.url}`)}),_&&Ue&&t.length>1&&!Y&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...Ue,left:ee.left,cursor:"w-resize",pointerEvents:k?"none":"auto"},onClick:$e=>{if(T.current){T.current=!1;return}$e.stopPropagation(),pe(-1)}}),r.jsx("div",{style:{...Ue,left:ee.left+ee.width/2,cursor:"e-resize",pointerEvents:k?"none":"auto"},onClick:$e=>{if(T.current){T.current=!1;return}$e.stopPropagation(),pe(1)}})]})]})}function kg(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Ag({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:s,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=S.useScopedStyles(),{type:p="a",gridLayout:x,textBoxWidth:v=100,verticalGap:f,entriesCount:h,lightbox:m,imageDisplay:b,imageCorners:I,lightboxImageDisplay:R,slider:T,sliderTiming:U,direction:A,transition:B,titleMarginTop:P,subtitleMarginTop:L,titleColor:j,subtitleColor:w,lightboxCounterColor:W,titleFontFamily:E,titleFontSettings:J,titleFontSize:F,titleLineHeight:X,titleLetterSpacing:G,titleWordSpacing:V,titleTextAppearance:ie,subtitleFontFamily:C,subtitleFontSettings:M,subtitleFontSize:O,subtitleLineHeight:re,subtitleLetterSpacing:ne,subtitleWordSpacing:$,subtitleTextAppearance:ae,lightboxCounterFontFamily:k,lightboxCounterFontSettings:te,lightboxCounterFontSize:K,lightboxCounterLineHeight:fe,lightboxCounterLetterSpacing:Ie,lightboxCounterWordSpacing:me,lightboxCounterTextAppearance:ue,showText:q="always",alignEntries:Q="off",align:Y="top"}=e,Ae={fontSettings:{fontFamily:E,fontWeight:(J==null?void 0:J.fontWeight)??400,fontStyle:(J==null?void 0:J.fontStyle)??"normal"},fontSize:F??.01,lineHeight:X,letterSpacing:G??0,wordSpacing:V??0,textAppearance:ie,color:j},Ee={...on(qt(Ae,n))},de={fontSettings:{fontFamily:C,fontWeight:(M==null?void 0:M.fontWeight)??400,fontStyle:(M==null?void 0:M.fontStyle)??"normal"},fontSize:O??.01,lineHeight:re,letterSpacing:ne??0,wordSpacing:$??0,textAppearance:ae,color:w},be={...on(qt(de,n))},z={fontSettings:{fontFamily:k,fontWeight:(te==null?void 0:te.fontWeight)??400,fontStyle:(te==null?void 0:te.fontStyle)??"normal"},fontSize:K??.01,lineHeight:fe,letterSpacing:Ie??0,wordSpacing:me??0,textAppearance:ue,color:W},pe={...on(qt(z,n)),...qr(K,fe,u,n)},xe=Ur(F,X,`${u}-item-title`,`${u}-text-tight-leading`),Re=Ur(O,re,`${u}-item-subtitle`,`${u}-text-tight-leading`),Te=qr(F,X,u,n),_=qr(O,re,u,n),he=Ur(K,fe,`${u}-lightbox-counter`,`${u}-text-tight-leading`),oe=S.buildColorVars(u,{titleColor:j,subtitleColor:w,lightboxCounterColor:W},Fg,Wg),Me=`${l&&l!=="default"?`${u}-state-${l}`:""}${q==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),le=h===0?1/0:h,D=(t??[]).slice(0,le),Ve=a.useMemo(()=>m==="on"?Lg(D):[],[D,m]),Oe=x.entryWidth??.2,lt=(b==null?void 0:b.display)==="cover",tt=(b==null?void 0:b.ratioValue)??"1:1",ht=(b==null?void 0:b.reversed)??!1,[nt,Be]=tt.split(":").map(Number),De=`${ht?Be:nt} / ${ht?nt:Be}`,Ue=x.columnsCount,$e=S.scalingValue(Oe??0,n),He=$e,ze=!lt&&T!=="off",Xe=D.length%Ue||Ue,ct=Xe<Ue&&D.length>0,Je=D.length-Xe,$t=ct?Math.floor((Ue-Xe)/2)+1:1,dt=I?S.scalingValue(I,n):void 0,We={width:He,...lt?{aspectRatio:De,height:"auto",overflow:"hidden"}:{height:"auto"},...dt?{borderRadius:dt,overflow:"hidden"}:{}},Ke=`${u}-item-image-wrapper${ze?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),je=p==="d"||p==="e"||p==="f",ut=Q==="on",pt=`calc(${S.scalingValue(Oe??0,n)} * (${v} / 100))`,mt=S.scalingValue(Oe*v/100,n),kt=lt?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...dt?{borderRadius:dt}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...dt?{borderRadius:dt}:{}},[Xt,Yt]=a.useState(0),vt=a.useRef(null),xt=B==="fade"||A==="horizontal"?"ltr":A==="vertical"?"ttb":"ltr";a.useEffect(()=>{const at=vt.current;if(!at)return;const Ce=new ResizeObserver(_e=>{Yt(Math.round(_e[0].contentRect.width))});return Ce.observe(at),()=>Ce.disconnect()},[]);const Gt=(()=>{const at={...oe},Ce=vt.current?getComputedStyle(vt.current).getPropertyValue("--cntrl-article-width").trim():"";return Ce&&(at["--cntrl-article-width"]=Ce),at})(),[Ft,bt]=a.useState(!1),[Nt,Ut]=a.useState([]),[Zt,tn]=a.useState(0),Ct=m==="on"&&(!n||i),jt=(at,Ce)=>{n&&!i||m!=="off"&&(Ut(at),tn(Ce),bt(!0))};a.useEffect(()=>{if(!Ft||m!=="on"||typeof document>"u")return;const at=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=at}},[Ft,m]),a.useEffect(()=>{!n||i||bt(!1)},[n,i]);const cn=a.useMemo(()=>fg(u),[u]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:cn}}),m==="on"&&r.jsx(Rg,{mediaList:Ve}),r.jsx("div",{style:oe,children:r.jsx("div",{ref:vt,className:`${u}-wrapper ${u}-type-${p}${ut?` ${u}-align-entries`:""} ${u}-image-align-${Y} ${Me}`.trim(),style:{gridTemplateColumns:`repeat(${Ue}, ${$e})`,rowGap:ut?0:S.scalingValue(f??0,n),columnGap:S.scalingValue(x.horizontalGap??0,n),width:S.scalingValue(x.wrapperWidth??0,n),...ut?{[`--${u}-align-entries-row-gap`]:S.scalingValue(f??0,n)}:{}},children:D.map((at,Ce)=>{var At;const _e=Ws(at.title),Qe=Ws(at.subtitle),st=(((At=at.link)==null?void 0:At.length)??0)>0&&m==="off"?at.link:void 0,gt=Math.floor(Ce/Ue)===Math.ceil(D.length/Ue)-1,Rt=ct&&Ce>=Je?`${$t+(Ce-Je)}`:void 0,ot=je?r.jsxs("div",{className:`${u}-item-text-block`,children:[_e&&r.jsx("p",{className:xe,style:{width:pt,...Ee,...Te},children:at.title}),_e&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:S.scalingValue(P??0,n),width:mt}}),Qe&&r.jsx("p",{className:Re,style:{width:pt,...be,..._},children:at.subtitle}),Qe&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:S.scalingValue(L??0,n),width:mt}})]}):null,Ot=ut?r.jsxs("div",{className:`${u}-item-title-row`,children:[!je&&r.jsx("div",{"data-controls":o&&_e?"titleMarginTop":void 0,className:o&&_e?`${u}-control`:void 0,style:{height:_e?S.scalingValue(P??0,n):0,width:mt}}),_e&&r.jsx("p",{className:xe,style:{width:pt,...Ee,...Te},children:at.title}),je&&_e&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:S.scalingValue(P??0,n),width:mt}})]}):null,Pt=ut?r.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!je&&r.jsx("div",{"data-controls":o&&Qe?"subtitleMarginTop":void 0,className:o&&Qe?`${u}-control`:void 0,style:{height:Qe?S.scalingValue(L??0,n):0,width:mt}}),Qe&&r.jsx("p",{className:Re,style:{width:pt,...be,..._},children:at.subtitle}),je&&Qe&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:S.scalingValue(L??0,n),width:mt}})]}):null,Mt=st?r.jsxs("a",{href:st,target:"_blank",className:`${u}-item-text-link`,children:[Ot,Pt]}):r.jsxs(r.Fragment,{children:[Ot,Pt]}),zt=wc(at.gallery),Bt=zt.filter(wt=>wt.lightboxMedia).map(wt=>wt.lightboxMedia),Wt=r.jsx("div",{className:Ke,style:We,children:zt.length===0?null:T==="off"?(()=>{const{displayMedia:wt,lightboxMedia:y}=zt[0],ye=y?Bt.findIndex(Le=>Le.url===y.url):-1;return r.jsx(_s,{media:wt,className:`${u}-item-${gi(wt)?"video":"image"}`.trim(),style:kt,onMediaClick:Ct&&ye>=0?()=>jt(Bt,ye):void 0})})():r.jsxs(r.Fragment,{children:[ze&&r.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:zt.map(({displayMedia:wt})=>gi(wt)?r.jsx("video",{src:wt.url,muted:!0,playsInline:!0},`sizer-${wt.url}`):r.jsx("img",{src:wt.url,alt:""},`sizer-${wt.url}`))}),r.jsx(Ya,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:U*1e3,width:"100%",height:"100%",speed:xg,type:B==="fade"?"fade":"loop",rewind:B==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:xt},onMoved:wt=>{A!=="random"||B==="fade"||bg(wt)},children:zt.map(({displayMedia:wt,lightboxMedia:y},ye)=>{const Le=y?Bt.findIndex(Pe=>Pe.url===y.url):-1;return r.jsx(Za,{children:r.jsx(_s,{media:wt,className:`${u}-item-${gi(wt)?"video":"image"}`.trim(),style:kt,onMediaClick:Ct&&Le>=0?()=>jt(Bt,Le):void 0})},ye)})},`${B}-${Oe}-${A}-${U}-${Xt}-${d}`)]})}),_t=je?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&_e?"titleMarginTop":void 0,className:o&&_e?`${u}-control`:void 0,style:{height:_e?S.scalingValue(P??0,n):0,width:mt}}),r.jsx("p",{className:xe,style:{width:pt,...Ee,...Te},children:at.title}),r.jsx("div",{"data-controls":o&&Qe?"subtitleMarginTop":void 0,className:o&&Qe?`${u}-control`:void 0,style:{height:Qe?S.scalingValue(L??0,n):0,width:mt}}),r.jsx("p",{className:Re,style:{width:pt,...be,..._},children:at.subtitle})]});return r.jsx("div",{className:`${u}-item`.trim(),style:Rt&&!ut?{gridColumn:Rt}:void 0,children:r.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${ut&&gt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(v??0)>100?`calc(${$e} * (${v} / 100))`:$e,...Rt&&ut?{gridColumn:Rt}:{}},children:ut?r.jsx(r.Fragment,{children:je?r.jsxs(r.Fragment,{children:[Mt,r.jsx("a",{href:st,target:"_blank",className:`${u}-item-image-link`,children:Wt})]}):r.jsxs(r.Fragment,{children:[r.jsx("a",{href:st,target:"_blank",className:`${u}-item-image-link`,children:Wt}),Mt]})}):st?r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:st,target:"_blank",className:`${u}-item-image-link`,children:[ot,Wt]}),!je&&r.jsx("a",{href:st,target:"_blank",className:`${u}-item-text-link`,children:_t})]}):r.jsxs(r.Fragment,{children:[ot,Wt,_t]})})},Ce)})})}),(!n||i)&&Ft&&typeof document<"u"&&m==="on"&&(()=>{const at=(c?document.getElementById(c):null)??document.body;return Yn.createPortal(r.jsx("div",{style:Gt,"data-selection":"none",children:r.jsx(Pg,{prefix:u,items:Nt,index:Zt,imageDisplay:kg(R),isEditor:n,onClose:()=>bt(!1),onPrev:()=>tn(Ce=>(Ce-1+Nt.length)%Nt.length),onNext:()=>tn(Ce=>(Ce+1)%Nt.length),counterClassName:he,counterStyle:pe})}),at)})()]})}const Fg={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Wg=["hover","focus","filled","success","error"],_g=`import { Splide, SplideSlide } from '@splidejs/react-splide';
5132
+ `}function Gg(){return Math.random()<.5?"ltr":"ttb"}function qg(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function Ug(e){const t=Gg();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{qg(e)})})}const vn=500,Xg=750,Hn="cubic-bezier(0.22, 1, 0.36, 1)",Kg=72,Yg=50;function Zg(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 Jg(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Qg(e){const[t]=e.media;return t!=null&&t.url?t:null}function Cc(e){return!Array.isArray(e)||e.length===0?[]:Zg(e)?e.flatMap(t=>{const n=Jg(t);if(!n)return[];const i=Qg(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 gi(e){return e.type==="video"}function eh(e){const t=new Set,n=[];for(const i of e){const o=Cc(i.gallery);for(const s of o){const l=s.lightboxMedia;l!=null&&l.url&&!t.has(l.url)&&(t.add(l.url),n.push(l))}}return n}function th({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>gi(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function nh(e){e.pause(),e.removeAttribute("src"),e.load()}function Os({media:e,className:t,style:n,onMediaClick:i}){return gi(e)?r.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):r.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function Ds(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function ih(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 s=e.width/n;return{width:e.width,height:s,left:e.left,top:e.top+(e.height-s)/2}}const o=e.height*n;return{width:o,height:e.height,left:e.left+(e.width-o)/2,top:e.top}}function oh({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:s,onMouseMove:l}){return a.useEffect(()=>{const d=n.current;if(d)return()=>{nh(d)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:s,onMouseMove:l,style:i})}function rh({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:s,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",v=a.useRef(null),y=a.useRef(null),g=a.useRef(null),h=a.useRef(null),m=a.useRef(0),b=a.useRef(0),I=a.useRef("none"),R=a.useRef(!1),T=a.useRef(!1),q=a.useRef(null),F=a.useRef(0),V=a.useRef(null),A=a.useRef(!1),L=a.useRef(null),O=a.useRef(null),x=a.useRef(null),W=a.useRef(()=>{}),[E,J]=a.useState(null),[P,K]=a.useState(null),[B,z]=a.useState("opening"),[ie,S]=a.useState(0),[M,D]=a.useState(0),[le,oe]=a.useState(null),[$,ae]=a.useState(!1),[k,te]=a.useState(!1),[X,ve]=a.useState(!1),[Pe,he]=a.useState(null),ce=a.useRef(n),U=a.useRef(void 0),Y=t[n],Z=Y?gi(Y):!1,We=M!==0||$,$e=le!==null,ke=a.useCallback(ne=>{const ge=ne.currentTarget,Ie=ge instanceof HTMLVideoElement?{width:ge.videoWidth,height:ge.videoHeight}:{width:ge.naturalWidth,height:ge.naturalHeight};!Ie.width||!Ie.height||he(Ie)},[]);a.useEffect(()=>{q.current=P},[P]),a.useEffect(()=>{const ne=v.current;if(!ne)return;const ge=()=>K(Ds(ne));ge();const Ie=new ResizeObserver(ge);return Ie.observe(ne),()=>Ie.disconnect()},[]);const de=a.useCallback(()=>{L.current!==null&&(window.clearTimeout(L.current),L.current=null)},[]),fe=a.useCallback(()=>{const ne=O.current;O.current=null,de(),V.current=null,A.current=!1,oe(null),ae(!1),D(0),F.current=0,te(!1),R.current=!1,b.current=0,I.current="none",ne===1?d():ne===-1&&l()},[de,d,l]),we=a.useCallback(()=>{de(),O.current=null,V.current=null,A.current=!1,oe(null),ae(!1),D(0),F.current=0},[de]),G=a.useCallback(()=>{de(),L.current=window.setTimeout(()=>{O.current!==null&&fe()},vn+32)},[de,fe]),se=a.useCallback((ne,ge)=>{var Ge;const Ie=((Ge=q.current)==null?void 0:Ge.width)??0;if(de(),V.current=ne,oe(ne),A.current=!0,ae(!0),ge){O.current=ne;const Ze=-ne*Ie;F.current=Ze,D(Ze),G();return}F.current=0,D(0),L.current=window.setTimeout(()=>{L.current=null,we()},vn+32)},[de,we,G]),pe=a.useCallback(ne=>{if(!(t.length<=1)){if(A.current){if(O.current===ne){x.current=ne,fe();return}we()}de(),V.current=ne,oe(ne),A.current=!1,ae(!1),F.current=0,D(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{se(ne,!0)})})}},[t.length,se,fe,we,de]);W.current=pe;const Se=a.useCallback(ne=>{ne.propertyName!=="transform"||!A.current||O.current!==null&&fe()},[fe]),Me=a.useCallback(()=>{const ne=y.current;if(!ne)return;const ge=Ds(ne);!ge.width||!ge.height||J(ge)},[]);a.useEffect(()=>{Me();const ne=y.current;if(!ne)return;const ge=new ResizeObserver(()=>Me());return ge.observe(ne),()=>ge.disconnect()},[Me]),a.useEffect(()=>{B==="opening"&&E&&z("open")},[B,E]),a.useEffect(()=>{if(B!=="closing")return;const ne=setTimeout(()=>s(),vn);return()=>clearTimeout(ne)},[B,s]),a.useEffect(()=>()=>{de()},[de]),a.useLayoutEffect(()=>{ce.current===n&&U.current===(Y==null?void 0:Y.url)||(de(),O.current=null,oe(null),S(0),D(0),ae(!1),ve(!1),te(!1),he(null),m.current=0,b.current=0,I.current="none",R.current=!1,A.current=!1,F.current=0,V.current=null,h.current=null,T.current=!1,ce.current=n,U.current=Y==null?void 0:Y.url)},[n,Y==null?void 0:Y.url,de]),a.useLayoutEffect(()=>{const ne=x.current;ne!==null&&(x.current=null,requestAnimationFrame(()=>{W.current(ne)}))},[n,Y==null?void 0:Y.url]),a.useEffect(()=>{if(B!=="open")return;let ne=null;const ge=()=>{ne&&(document.removeEventListener("click",ne,!0),ne=null)},Ie=()=>{ge(),ne=Je=>{Je.stopPropagation(),Je.preventDefault(),ge()},document.addEventListener("click",ne,!0)},Ge=Je=>{const Ee=Je<0?1:-1;if(Math.abs(Je)>Yg&&t.length>1){se(Ee,!0);return}se(Ee,!1)},Ze=Je=>{if(Je.touches.length!==1||A.current)return;const Ee=Je.touches[0];T.current=!0,h.current={x:Ee.clientX,y:Ee.clientY},I.current="none",b.current=0,R.current=!1},Ve=Je=>{if(!h.current||Je.touches.length!==1||A.current)return;const Ee=Je.touches[0],qe=Ee.clientX-h.current.x,_e=Ee.clientY-h.current.y;if(I.current==="none"){if(Math.abs(qe)<10&&Math.abs(_e)<10)return;if(Math.abs(qe)>Math.abs(_e)){if(t.length<=1)return;I.current="horizontal"}else if(_e>0)I.current="vertical";else return}if(I.current==="horizontal"){R.current=!0,te(!0),b.current=qe;const tt=qe<0?1:-1;V.current!==tt&&(V.current=tt,oe(tt)),F.current=qe,D(qe),Je.preventDefault();return}I.current==="vertical"&&(R.current=!0,te(!0),m.current=_e,S(_e),Je.preventDefault())},at=()=>{if(!h.current)return;const Je=I.current,Ee=R.current;if(Ee&&Je==="horizontal")Ge(b.current),Ie();else if(Ee&&Je==="vertical")if(m.current>Kg){const _e=window.innerHeight;m.current=_e,ve(!0),S(_e),z("closing")}else m.current=0,S(0),Ie();else Je==="horizontal"&&Math.abs(b.current)>0&&(Ge(b.current),Ie());h.current=null,I.current="none",b.current=0,R.current=!1,te(!1)};return document.addEventListener("touchstart",Ze,{passive:!0}),document.addEventListener("touchmove",Ve,{passive:!1}),document.addEventListener("touchend",at),document.addEventListener("touchcancel",at),()=>{document.removeEventListener("touchstart",Ze),document.removeEventListener("touchmove",Ve),document.removeEventListener("touchend",at),document.removeEventListener("touchcancel",at),ge()}},[B,t.length,se]),a.useEffect(()=>{const ne=ge=>{ge.key==="Escape"&&(ge.preventDefault(),ge.stopPropagation(),B!=="closing"&&z("closing"))};return window.addEventListener("keydown",ne,!0),()=>window.removeEventListener("keydown",ne,!0)},[B]);const Le=()=>{B!=="closing"&&z("closing")},H=B==="open",ye=B==="closing",re=ie>0?Math.max(0,1-ie/500):1,_=ie>0?Math.max(.35,1-ie/500):1,ee=E?p?E:ih(E,Pe):null,Ae=ne=>{if(ne.stopPropagation(),T.current){T.current=!1;return}if(t.length<=1)return;const ge=ee??ne.currentTarget.getBoundingClientRect(),Ie=ne.clientY-ge.top,Ge=Math.min(52,ge.height*.2);if(!(Ie>ge.height-Ge)){if(ne.clientX-ge.left<ge.width/2){pe(-1);return}pe(1)}},ue=ne=>{if(t.length<=1)return;const ge=ee??ne.currentTarget.getBoundingClientRect(),Ie=ne.clientX-ge.left,Ge=ne.clientY-ge.top,Ze=Math.min(52,ge.height*.2);if(Ge>ge.height-Ze){ne.currentTarget.style.cursor="default";return}ne.currentTarget.style.cursor=Ie<ge.width/2?"w-resize":"e-resize"},N={position:"fixed",top:P==null?void 0:P.top,left:P==null?void 0:P.left,width:P==null?void 0:P.width,height:P==null?void 0:P.height,zIndex:9998},Ue=p?"cover":"contain",Oe=M!==0||ie>0?`translate(${M}px, ${ie}px)`:void 0,dt=k&&!$?"none":$?`transform ${vn}ms ${Hn}`:X?`transform ${vn}ms ${Hn}, opacity ${vn}ms ${Hn}`:B==="opening"||ye?`opacity ${vn}ms ${Hn}`:"none",nt={...N,transform:Oe,opacity:ie>0?_:B==="opening"||ye?0:1,transition:dt,pointerEvents:"none"},ht={position:"absolute",top:((ee==null?void 0:ee.top)??0)-((P==null?void 0:P.top)??0),left:((ee==null?void 0:ee.left)??0)-((P==null?void 0:P.left)??0),width:ee==null?void 0:ee.width,height:ee==null?void 0:ee.height,objectFit:Ue,pointerEvents:Z&&H&&!We?"auto":"none",touchAction:Z&&H?"none":void 0},st=(P==null?void 0:P.width)??0,Be=$e?(n+le+t.length)%t.length:null,xe=Be!==null?t[Be]:null,Fe={...N,transform:$e?`translateX(${le*st+M}px)`:void 0,opacity:1,transition:$?`transform ${vn}ms ${Hn}`:"none",pointerEvents:"none"},je={position:"absolute",top:((E==null?void 0:E.top)??0)-((P==null?void 0:P.top)??0),left:((E==null?void 0:E.left)??0)-((P==null?void 0:P.left)??0),width:E==null?void 0:E.width,height:E==null?void 0:E.height,objectFit:Ue,pointerEvents:"none"},Ke=ee?{position:"fixed",top:ee.top,height:ee.height,width:ee.width/2,zIndex:9999}:null;return r.jsxs("div",{ref:v,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:B==="open"?"none":void 0},onClick:Le,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:H?re:0,transition:k?"none":`opacity ${vn}ms ${Hn}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:p?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:y,style:{position:"absolute",inset:0}}),r.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:H?1:0,transition:`opacity ${vn}ms ${Hn}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:y,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:H?1:0,transition:`opacity ${vn}ms ${Hn}`},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),E&&P&&xe&&r.jsx("div",{style:Fe,onTransitionEnd:Se,children:gi(xe)?r.jsx("video",{src:xe.url,muted:!0,playsInline:!0,preload:"auto",style:je},`neighbor-${Be}-${xe.url}`):r.jsx("img",{src:xe.url,alt:xe.name,style:je},`neighbor-${Be}-${xe.url}`)}),E&&P&&Y&&r.jsx("div",{style:nt,onTransitionEnd:Se,children:Z?r.jsx(oh,{src:Y.url,phase:B,mediaRef:g,mediaStyle:ht,onLoadedMetadata:ke,onClick:Ae,onMouseMove:ue},`${n}-${Y.url}`):r.jsx("img",{ref:g,src:Y.url,alt:Y.name,onLoad:ke,style:ht},`${n}-${Y.url}`)}),H&&Ke&&t.length>1&&!Z&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...Ke,left:ee.left,cursor:"w-resize",pointerEvents:k?"none":"auto"},onClick:ne=>{if(T.current){T.current=!1;return}ne.stopPropagation(),pe(-1)}}),r.jsx("div",{style:{...Ke,left:ee.left+ee.width/2,cursor:"e-resize",pointerEvents:k?"none":"auto"},onClick:ne=>{if(T.current){T.current=!1;return}ne.stopPropagation(),pe(1)}})]})]})}function ah(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function sh({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:s,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=C.useScopedStyles(),{type:p="a",gridLayout:v,textBoxWidth:y=100,verticalGap:g,entriesCount:h,lightbox:m,imageDisplay:b,imageCorners:I,lightboxImageDisplay:R,slider:T,sliderTiming:q,direction:F,transition:V,titleMarginTop:A,subtitleMarginTop:L,titleColor:O,subtitleColor:x,lightboxCounterColor:W,titleFontFamily:E,titleFontSettings:J,titleFontSize:P,titleLineHeight:K,titleLetterSpacing:B,titleWordSpacing:z,titleTextAppearance:ie,subtitleFontFamily:S,subtitleFontSettings:M,subtitleFontSize:D,subtitleLineHeight:le,subtitleLetterSpacing:oe,subtitleWordSpacing:$,subtitleTextAppearance:ae,lightboxCounterFontFamily:k,lightboxCounterFontSettings:te,lightboxCounterFontSize:X,lightboxCounterLineHeight:ve,lightboxCounterLetterSpacing:Pe,lightboxCounterWordSpacing:he,lightboxCounterTextAppearance:ce,showText:U="always",alignEntries:Y="off",align:Z="top"}=e,We={fontSettings:{fontFamily:E,fontWeight:(J==null?void 0:J.fontWeight)??400,fontStyle:(J==null?void 0:J.fontStyle)??"normal"},fontSize:P??.01,lineHeight:K,letterSpacing:B??0,wordSpacing:z??0,textAppearance:ie,color:O},ke={...rn(Xt(We,n))},de={fontSettings:{fontFamily:S,fontWeight:(M==null?void 0:M.fontWeight)??400,fontStyle:(M==null?void 0:M.fontStyle)??"normal"},fontSize:D??.01,lineHeight:le,letterSpacing:oe??0,wordSpacing:$??0,textAppearance:ae,color:x},we={...rn(Xt(de,n))},G={fontSettings:{fontFamily:k,fontWeight:(te==null?void 0:te.fontWeight)??400,fontStyle:(te==null?void 0:te.fontStyle)??"normal"},fontSize:X??.01,lineHeight:ve,letterSpacing:Pe??0,wordSpacing:he??0,textAppearance:ce,color:W},pe={...rn(Xt(G,n)),...Kr(X,ve,u,n)},Se=Xr(P,K,`${u}-item-title`,`${u}-text-tight-leading`),Me=Xr(D,le,`${u}-item-subtitle`,`${u}-text-tight-leading`),Le=Kr(P,K,u,n),H=Kr(D,le,u,n),ye=Xr(X,ve,`${u}-lightbox-counter`,`${u}-text-tight-leading`),re=C.buildColorVars(u,{titleColor:O,subtitleColor:x,lightboxCounterColor:W},lh,ch),Ae=`${l&&l!=="default"?`${u}-state-${l}`:""}${U==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),ue=h===0?1/0:h,N=(t??[]).slice(0,ue),Ue=a.useMemo(()=>m==="on"?eh(N):[],[N,m]),Oe=v.entryWidth??.2,dt=(b==null?void 0:b.display)==="cover",nt=(b==null?void 0:b.ratioValue)??"1:1",ht=(b==null?void 0:b.reversed)??!1,[st,Be]=nt.split(":").map(Number),je=`${ht?Be:st} / ${ht?st:Be}`,Ke=v.columnsCount,ne=C.scalingValue(Oe??0,n),ge=ne,Ie=!dt&&T!=="off",Ge=N.length%Ke||Ke,Ze=Ge<Ke&&N.length>0,Ve=N.length-Ge,at=Ze?Math.floor((Ke-Ge)/2)+1:1,Je=I?C.scalingValue(I,n):void 0,Ee={width:ge,...dt?{aspectRatio:je,height:"auto",overflow:"hidden"}:{height:"auto"},...Je?{borderRadius:Je,overflow:"hidden"}:{}},qe=`${u}-item-image-wrapper${Ie?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),_e=p==="d"||p==="e"||p==="f",tt=Y==="on",rt=`calc(${C.scalingValue(Oe??0,n)} * (${y} / 100))`,lt=C.scalingValue(Oe*y/100,n),Tt=dt?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...Je?{borderRadius:Je}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...Je?{borderRadius:Je}:{}},[Ut,Zt]=a.useState(0),xt=a.useRef(null),wt=V==="fade"||F==="horizontal"?"ltr":F==="vertical"?"ttb":"ltr";a.useEffect(()=>{const mt=xt.current;if(!mt)return;const Te=new ResizeObserver(De=>{Zt(Math.round(De[0].contentRect.width))});return Te.observe(mt),()=>Te.disconnect()},[]);const jt=(()=>{const mt={...re},Te=xt.current?getComputedStyle(xt.current).getPropertyValue("--cntrl-article-width").trim():"";return Te&&(mt["--cntrl-article-width"]=Te),mt})(),[At,vt]=a.useState(!1),[Ft,_t]=a.useState([]),[Kt,Jt]=a.useState(0),Ct=m==="on"&&(!n||i),Ht=(mt,Te)=>{n&&!i||m!=="off"&&(_t(mt),Jt(Te),vt(!0))};a.useEffect(()=>{if(!At||m!=="on"||typeof document>"u")return;const mt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=mt}},[At,m]),a.useEffect(()=>{!n||i||vt(!1)},[n,i]);const on=a.useMemo(()=>Vg(u),[u]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:on}}),m==="on"&&r.jsx(th,{mediaList:Ue}),r.jsx("div",{style:re,children:r.jsx("div",{ref:xt,className:`${u}-wrapper ${u}-type-${p}${tt?` ${u}-align-entries`:""} ${u}-image-align-${Z} ${Ae}`.trim(),style:{gridTemplateColumns:`repeat(${Ke}, ${ne})`,rowGap:tt?0:C.scalingValue(g??0,n),columnGap:C.scalingValue(v.horizontalGap??0,n),width:C.scalingValue(v.wrapperWidth??0,n),...tt?{[`--${u}-align-entries-row-gap`]:C.scalingValue(g??0,n)}:{}},children:N.map((mt,Te)=>{var Wt;const De=Ns(mt.title),it=Ns(mt.subtitle),gt=(((Wt=mt.link)==null?void 0:Wt.length)??0)>0&&m==="off"?mt.link:void 0,ft=Math.floor(Te/Ke)===Math.ceil(N.length/Ke)-1,It=Ze&&Te>=Ve?`${at+(Te-Ve)}`:void 0,pt=_e?r.jsxs("div",{className:`${u}-item-text-block`,children:[De&&r.jsx("p",{className:Se,style:{width:rt,...ke,...Le},children:mt.title}),De&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:C.scalingValue(A??0,n),width:lt}}),it&&r.jsx("p",{className:Me,style:{width:rt,...we,...H},children:mt.subtitle}),it&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:C.scalingValue(L??0,n),width:lt}})]}):null,zt=tt?r.jsxs("div",{className:`${u}-item-title-row`,children:[!_e&&r.jsx("div",{"data-controls":o&&De?"titleMarginTop":void 0,className:o&&De?`${u}-control`:void 0,style:{height:De?C.scalingValue(A??0,n):0,width:lt}}),De&&r.jsx("p",{className:Se,style:{width:rt,...ke,...Le},children:mt.title}),_e&&De&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:C.scalingValue(A??0,n),width:lt}})]}):null,kt=tt?r.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!_e&&r.jsx("div",{"data-controls":o&&it?"subtitleMarginTop":void 0,className:o&&it?`${u}-control`:void 0,style:{height:it?C.scalingValue(L??0,n):0,width:lt}}),it&&r.jsx("p",{className:Me,style:{width:rt,...we,...H},children:mt.subtitle}),_e&&it&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:C.scalingValue(L??0,n),width:lt}})]}):null,Pt=gt?r.jsxs("a",{href:gt,target:"_blank",className:`${u}-item-text-link`,children:[zt,kt]}):r.jsxs(r.Fragment,{children:[zt,kt]}),Vt=Cc(mt.gallery),Gt=Vt.filter(St=>St.lightboxMedia).map(St=>St.lightboxMedia),Nt=r.jsx("div",{className:qe,style:Ee,children:Vt.length===0?null:T==="off"?(()=>{const{displayMedia:St,lightboxMedia:w}=Vt[0],be=w?Gt.findIndex(Re=>Re.url===w.url):-1;return r.jsx(Os,{media:St,className:`${u}-item-${gi(St)?"video":"image"}`.trim(),style:Tt,onMediaClick:Ct&&be>=0?()=>Ht(Gt,be):void 0})})():r.jsxs(r.Fragment,{children:[Ie&&r.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Vt.map(({displayMedia:St})=>gi(St)?r.jsx("video",{src:St.url,muted:!0,playsInline:!0},`sizer-${St.url}`):r.jsx("img",{src:St.url,alt:""},`sizer-${St.url}`))}),r.jsx(Qa,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:q*1e3,width:"100%",height:"100%",speed:Xg,type:V==="fade"?"fade":"loop",rewind:V==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:wt},onMoved:St=>{F!=="random"||V==="fade"||Ug(St)},children:Vt.map(({displayMedia:St,lightboxMedia:w},be)=>{const Re=w?Gt.findIndex(He=>He.url===w.url):-1;return r.jsx(es,{children:r.jsx(Os,{media:St,className:`${u}-item-${gi(St)?"video":"image"}`.trim(),style:Tt,onMediaClick:Ct&&Re>=0?()=>Ht(Gt,Re):void 0})},be)})},`${V}-${Oe}-${F}-${q}-${Ut}-${d}`)]})}),Ot=_e?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&De?"titleMarginTop":void 0,className:o&&De?`${u}-control`:void 0,style:{height:De?C.scalingValue(A??0,n):0,width:lt}}),r.jsx("p",{className:Se,style:{width:rt,...ke,...Le},children:mt.title}),r.jsx("div",{"data-controls":o&&it?"subtitleMarginTop":void 0,className:o&&it?`${u}-control`:void 0,style:{height:it?C.scalingValue(L??0,n):0,width:lt}}),r.jsx("p",{className:Me,style:{width:rt,...we,...H},children:mt.subtitle})]});return r.jsx("div",{className:`${u}-item`.trim(),style:It&&!tt?{gridColumn:It}:void 0,children:r.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${tt&&ft?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(y??0)>100?`calc(${ne} * (${y} / 100))`:ne,...It&&tt?{gridColumn:It}:{}},children:tt?r.jsx(r.Fragment,{children:_e?r.jsxs(r.Fragment,{children:[Pt,r.jsx("a",{href:gt,target:"_blank",className:`${u}-item-image-link`,children:Nt})]}):r.jsxs(r.Fragment,{children:[r.jsx("a",{href:gt,target:"_blank",className:`${u}-item-image-link`,children:Nt}),Pt]})}):gt?r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:gt,target:"_blank",className:`${u}-item-image-link`,children:[pt,Nt]}),!_e&&r.jsx("a",{href:gt,target:"_blank",className:`${u}-item-text-link`,children:Ot})]}):r.jsxs(r.Fragment,{children:[pt,Nt,Ot]})})},Te)})})}),(!n||i)&&At&&typeof document<"u"&&m==="on"&&(()=>{const mt=(c?document.getElementById(c):null)??document.body;return Yn.createPortal(r.jsx("div",{style:jt,"data-selection":"none",children:r.jsx(rh,{prefix:u,items:Ft,index:Kt,imageDisplay:ah(R),isEditor:n,onClose:()=>vt(!1),onPrev:()=>Jt(Te=>(Te-1+Ft.length)%Ft.length),onNext:()=>Jt(Te=>(Te+1)%Ft.length),counterClassName:ye,counterStyle:pe})}),mt)})()]})}const lh={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},ch=["hover","focus","filled","success","error"],dh=`import { Splide, SplideSlide } from '@splidejs/react-splide';
4163
5133
  import '@splidejs/react-splide/css/core';
4164
5134
  import { CommonComponentProps } from '../props';
4165
5135
  import {
@@ -6212,12 +7182,12 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
6212
7182
  };
6213
7183
 
6214
7184
  const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
6215
- `,Kr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Hg=["titleColor","subtitleColor","lightboxCounterColor"],Ng={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:{...Kr.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:{...Kr.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:{...Kr.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:[...Hg],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Og={element:Ag,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:Ng,sourceCode:_g},Dg=50,Ns=10,Ja="cntrl-lightbox-journal",Mr=Ja,Ca=`${Ja}-`,Pr=e=>`${Ja}-${e}`,Qa=e=>e===Mr||e.startsWith(Ca),Os=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Ds=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Os(t.get(Pr(e)));if(i)return i}const n=Os(t.get(Mr));if(n)return n;for(const[i]of t){if(!i.startsWith(Ca))continue;const o=i.slice(Ca.length);if(!/^\d+$/.test(o))continue;const s=Number.parseInt(o,10);if(Number.isFinite(s)&&s>=1)return s}return null},js=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},Sc=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{Qa(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(Pr(t),String(e)):i.searchParams.set(Mr,String(e));const o=n?"replaceState":"pushState",s=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",s)},jg=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Pr(e)||i===Mr:Qa(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)}},$c=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Pr(e)):[...t.keys()].some(n=>Qa(n))},zg=(e,t)=>{if($c(t)){if(e){window.history.back();return}jg(t)}},Bg=20,Vg=2,Xr=e=>`max(${e}, ${Bg}px)`,Ni=e=>((e==null?void 0:e.image)??[]).slice(0,Vg),Cc=e=>e.reduce((t,n)=>t+Ni(n).length,0),Gg=(e,t)=>{const n=e.slice(0,t).reduce((o,s)=>o+Ni(s).length,1),i=Ni(e[t]).length;return{start:n,end:n+i-1}},Ug=(e,t)=>{const n=Cc(e),{start:i,end:o}=Gg(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},rr=(e,t)=>t==="B"?e.flatMap((n,i)=>Ni(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Ni(n)})),qg=(e,t,n,i)=>{var s;if(n==="B")return`${t+1} / ${e.length}`;const o=((s=e[t])==null?void 0:s.entryIndex)??0;return Ug(i,o)},zs=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Kg=(e,t,n)=>e==="B"?t.length>1:Cc(n)>1,gn=.004,Bn=.004,Ai={title1Width:.13,title2Width:.13,title3Width:.14},Vn=(e,t,n,i,o)=>{const s=[];return t.title1&&s.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&s.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&s.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),s},Oi=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,l)=>s+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:l},d)=>{if(s<=0||d<=0)return{overflow:s,widths:[d,...l]};const c=Math.min(s,d);return{overflow:s-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},xo=(e,t)=>Oi(e,t),sn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Gn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Oi(e.length,n),effective:xo(e.length,n)}},Tc=(e,t,n,i)=>e.slice(0,i).reduce((o,s,l)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[l]??0),0),Lc=(e,t,n,i)=>e.slice(0,i+1).reduce((o,s,l)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[l]??0),0),Kn=["title1","title2","title3","count"],Ze=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,es={title1:"1",title2:"2",title3:"3",count:"Count"},ts=e=>[Ze(e,"fontFamily"),Ze(e,"fontSettings"),{type:"row",items:[Ze(e,"fontSize"),Ze(e,"lineHeight"),Ze(e,"letterSpacing"),Ze(e,"wordSpacing")]},Ze(e,"textAlign"),Ze(e,"textAppearance")],Xg=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Kn.map(e=>[es[e],ts(e)]))}),Yg={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Zg={title1:.02,title2:.02,title3:.02,count:.017},ui=(e,t)=>{const n=i=>{const o=Ze(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[Yg[t]]}},pi=(e,t,n)=>{var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??Zg[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 Rc({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,onClose:l}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:p=0,title2MarginLeft:x=0,title3MarginLeft:v=0,titleRowMarginBottom:f=0,titleHeaderLayout:h="desktop",contentMarginTop:m=0,iconMarginRight:b=0,closeIcon:I=null,closeIconMaxWidth:R=0,closeIconColor:T="#000000",closeIconHoverColor:U="#cccccc"}=n,A=S.scalingValue(m,i),B=S.scalingValue(b,i),P=S.scalingValue(f,i),L=h==="mobile",j=pi("title1",ui(n,"title1"),i),w=pi("title2",ui(n,"title2"),i),W=pi("title3",ui(n,"title3"),i),E=a.useMemo(()=>({title1Width:d??Ai.title1Width,title2Width:c??Ai.title2Width,title3Width:u??Ai.title3Width}),[d,c,u]),J=a.useMemo(()=>({title2MarginLeft:x,title3MarginLeft:v}),[x,v]),F=a.useMemo(()=>Vn(e,t,j,w,W),[e,t,j,w,W]),X=a.useMemo(()=>F.map(H=>E[H.widthKey]),[F,E]),G=a.useMemo(()=>Oi(F.length,X),[F.length,X]),V=a.useMemo(()=>xo(F.length,X),[F.length,X]),ie=a.useMemo(()=>F.filter(H=>H.prefix==="title1"),[F]),C=a.useMemo(()=>F.filter(H=>H.prefix==="title2"||H.prefix==="title3"),[F]),M=a.useMemo(()=>Gn(ie,E),[ie,E]),O=a.useMemo(()=>Gn(C,E),[C,E]),re=!!(t.title1||t.title2||t.title3),ne=I!==null;if(!(re||ne))return null;const ae=(p??0)>0||o,k=(H,ee)=>{const Me=F.findIndex(D=>D.prefix===H.prefix);if(!L||ee==="single-row")return{effectiveWidth:V[Me]??0,resolvedWidth:G[Me]??0,maxWidth:sn(Me,G)};if(ee==="two-row-top"){const D=ie.findIndex(Ve=>Ve.prefix===H.prefix);return{effectiveWidth:M.effective[D]??0,resolvedWidth:M.resolved[D]??0,maxWidth:sn(D,M.resolved)}}const le=C.findIndex(D=>D.prefix===H.prefix);return{effectiveWidth:O.effective[le]??0,resolvedWidth:O.resolved[le]??0,maxWidth:sn(le,O.resolved)}},te=(H,ee,Me)=>{if(!L||Me==="single-row"){const lt=H.findIndex(Be=>Be.prefix===ee.prefix),tt=H.map(Be=>E[Be.widthKey]),ht=Oi(H.length,tt);return{effectiveWidth:xo(H.length,tt)[lt]??0,resolvedWidth:ht[lt]??0,maxWidth:sn(lt,ht)}}if(Me==="two-row-top"){const lt=H.filter(Be=>Be.prefix==="title1"),tt=lt.findIndex(Be=>Be.prefix===ee.prefix),{resolved:ht,effective:nt}=Gn(lt,E);return{effectiveWidth:nt[tt]??0,resolvedWidth:ht[tt]??0,maxWidth:sn(tt,ht)}}const le=H.filter(lt=>lt.prefix==="title2"||lt.prefix==="title3"),D=le.findIndex(lt=>lt.prefix===ee.prefix),{resolved:Ve,effective:Oe}=Gn(le,E);return{effectiveWidth:Oe[D]??0,resolvedWidth:Ve[D]??0,maxWidth:sn(D,Ve)}},K=H=>Lc(F,G,J,H)+(L?0:p??0),fe=()=>L?0:p??0,Ie=H=>C.slice(0,H).reduce((ee,Me,le)=>ee+(Me.marginLeftKey?J[Me.marginLeftKey]??0:0)+(O.resolved[le]??0),0),me=H=>{const ee=C[H];return Ie(H)+(ee.marginLeftKey?J[ee.marginLeftKey]??0:0)+(O.resolved[H]??0)},ue=(H,ee,Me)=>{const le=H.marginLeftKey?J[H.marginLeftKey]??0:0,{effectiveWidth:D,resolvedWidth:Ve,maxWidth:Oe}=Me??k(H,ee),lt=Math.max(le,Bn),tt=o&&ee==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":H.prefix,style:{width:S.scalingValue(D,i),...le>0?{marginLeft:S.scalingValue(le,i)}:{}},children:[r.jsx("p",{className:H.className,style:H.style,children:H.text}),tt&&H.marginLeftKey?r.jsx("div",{"data-controls":H.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ve),style:{position:"absolute",top:0,left:S.scalingValue(-le,i),width:S.scalingValue(lt,i),height:"100%",pointerEvents:"auto"}}):null,tt?r.jsx("div",{"data-controls":H.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Oe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:S.scalingValue(-gn/2,i),width:S.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}}):null]},H.className)},q=(H="two-row")=>{const ee=F.findIndex(D=>D.prefix==="title1"),Me=ee>=0?G[ee]:E.title1Width,le=H==="two-row"&&o;return r.jsx("div",{...le?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Me)}:{},style:{width:S.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...le?{pointerEvents:"auto"}:{}}})},Q=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:j,"aria-hidden":"true",children:" "}),Y=H=>{const ee=Vn(e,H,j,w,W);return r.jsx(r.Fragment,{children:ee.map(Me=>ue(Me,"single-row",te(ee,Me,"single-row")))})},Ae=H=>{const ee=Vn(e,H,j,w,W),Me=ee.find(le=>le.prefix==="title1");return Me?ue(Me,"two-row-top",te(ee,Me,"two-row-top")):null},Se=(H,ee=!1)=>{const Me=Vn(e,H,j,w,W),le=Me.filter(Oe=>Oe.prefix==="title2"||Oe.prefix==="title3"),D=o&&ee;return le.length>0||D||(f??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[le.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[r.jsx("div",{className:`${e}-titles-stack`,children:le.map(Oe=>ue(Oe,"two-row-bottom",te(Me,Oe,"two-row-bottom")))}),ee&&o?r.jsxs(r.Fragment,{children:[xe(),Re()]}):null]}):null,(f??0)>0||D?r.jsx("div",{"data-controls":D?"titleRowMarginBottom":void 0,"data-controls-axis":D?"y":void 0,"data-controls-reverse":D?"":void 0,className:D?`${e}-control`:void 0,style:{height:P,width:"100%",flexShrink:0,pointerEvents:D?"auto":"none"}}):null]}):null},Ee=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:S.scalingValue(R??0,i),height:S.scalingValue(R??0,i),marginRight:B,"--close-icon-hover-color":U},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:H=>{H.stopPropagation(),l==null||l()},"aria-label":"Close",children:r.jsx(rn,{url:I??"",fill:T,hoverFill:i&&!s?T:U,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:B,height:"100%",pointerEvents:"auto"}})]}),de=()=>ne?r.jsx("div",{className:`${e}-titles-row-header-controls`,children:Ee()}):null,ge=H=>r.jsx("div",{className:`${e}-titles-row-titles`,children:r.jsx("div",{className:`${e}-titles-stack`,children:H})}),be=H=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[ne||re?Q():null,ae?q("two-row"):null,ge(H),de()]}),z=(H,ee=!1)=>r.jsxs(r.Fragment,{children:[be(Ae(H)),Se(H,ee)]}),se=()=>{const H=L?-1:F.findIndex(le=>le.prefix==="title1"),ee=!L&&(o||(p??0)>0)?(()=>{const le=p??0,D=H>=0?G[H]:E.title1Width,Ve=Math.max(le,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(D),style:{position:"absolute",top:0,left:0,width:S.scalingValue(Ve,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Me=F.flatMap((le,D)=>{if(!le.marginLeftKey)return[];const Ve=J[le.marginLeftKey]??0,Oe=Tc(F,G,J,D)+fe(),lt=Math.max(Ve,Bn);return r.jsx("div",{"data-controls":le.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(G[D]),style:{position:"absolute",top:0,left:S.scalingValue(Oe,i),width:S.scalingValue(lt,i),height:"100%",pointerEvents:"auto"}},le.marginLeftKey)});return ee?[ee,...Me]:Me},pe=()=>F.map((H,ee)=>{const Me=sn(ee,G),D=K(ee)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":H.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Me),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:S.scalingValue(D,i),width:S.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}})},`${H.widthKey}-junction`)}),xe=()=>C.flatMap((H,ee)=>{if(!H.marginLeftKey)return[];const Me=J[H.marginLeftKey]??0,le=Ie(ee),D=Math.max(Me,Bn),{resolvedWidth:Ve}=k(H,"two-row-bottom");return r.jsx("div",{"data-controls":H.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ve),style:{position:"absolute",top:0,left:S.scalingValue(le,i),width:S.scalingValue(D,i),height:"100%",pointerEvents:"auto"}},H.marginLeftKey)}),Re=()=>C.map((H,ee)=>{const{maxWidth:Me}=k(H,"two-row-bottom"),D=me(ee)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":H.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Me),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:S.scalingValue(D,i),width:S.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}})},`${H.widthKey}-junction`)}),Te=()=>!o||L?null:r.jsxs(r.Fragment,{children:[se(),pe()]}),_=!!(t.title2||t.title3||(f??0)>0||o),he=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[ne||re?Q():null,ae?q("single-row"):null,re?ge(Y(t)):r.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),de(),Te()]}),oe=()=>r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,..._?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:_?void 0:{flex:"0 0 auto",height:"auto"},children:z(t,!0)}),Te()]});return r.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:A,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...L?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${L?` ${e}-lightbox-content-area-stacked`:""}`,children:r.jsx("div",{className:`${e}-text-bar-cell${L?` ${e}-text-bar-cell-stacked`:""}`,style:L?void 0:{flex:1,minWidth:0,width:"100%"},children:L?oe():he()})})})]})}function Jg(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Qg(e){return`
7185
+ `,Yr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},uh=["titleColor","subtitleColor","lightboxCounterColor"],ph={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:{...Yr.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:{...Yr.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:{...Yr.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:[...uh],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},mh={element:sh,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:ph,sourceCode:dh},gh=50,js=10,ts="cntrl-lightbox-journal",Pr=ts,Ra=`${ts}-`,kr=e=>`${ts}-${e}`,ns=e=>e===Pr||e.startsWith(Ra),zs=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Bs=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=zs(t.get(kr(e)));if(i)return i}const n=zs(t.get(Pr));if(n)return n;for(const[i]of t){if(!i.startsWith(Ra))continue;const o=i.slice(Ra.length);if(!/^\d+$/.test(o))continue;const s=Number.parseInt(o,10);if(Number.isFinite(s)&&s>=1)return s}return null},Vs=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},Tc=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{ns(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(kr(t),String(e)):i.searchParams.set(Pr,String(e));const o=n?"replaceState":"pushState",s=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",s)},hh=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===kr(e)||i===Pr:ns(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)}},Lc=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(kr(e)):[...t.keys()].some(n=>ns(n))},fh=(e,t)=>{if(Lc(t)){if(e){window.history.back();return}hh(t)}},yh=20,vh=2,Zr=e=>`max(${e}, ${yh}px)`,Oi=e=>((e==null?void 0:e.image)??[]).slice(0,vh),Rc=e=>e.reduce((t,n)=>t+Oi(n).length,0),xh=(e,t)=>{const n=e.slice(0,t).reduce((o,s)=>o+Oi(s).length,1),i=Oi(e[t]).length;return{start:n,end:n+i-1}},bh=(e,t)=>{const n=Rc(e),{start:i,end:o}=xh(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},ar=(e,t)=>t==="B"?e.flatMap((n,i)=>Oi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Oi(n)})),wh=(e,t,n,i)=>{var s;if(n==="B")return`${t+1} / ${e.length}`;const o=((s=e[t])==null?void 0:s.entryIndex)??0;return bh(i,o)},Gs=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Sh=(e,t,n)=>e==="B"?t.length>1:Rc(n)>1,gn=.004,Bn=.004,Fi={title1Width:.13,title2Width:.13,title3Width:.14},Vn=(e,t,n,i,o)=>{const s=[];return t.title1&&s.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&s.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&s.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),s},Di=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,l)=>s+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:l},d)=>{if(s<=0||d<=0)return{overflow:s,widths:[d,...l]};const c=Math.min(s,d);return{overflow:s-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},wo=(e,t)=>Di(e,t),ln=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Gn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Di(e.length,n),effective:wo(e.length,n)}},Ic=(e,t,n,i)=>e.slice(0,i).reduce((o,s,l)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[l]??0),0),Ec=(e,t,n,i)=>e.slice(0,i+1).reduce((o,s,l)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[l]??0),0),Xn=["title1","title2","title3","count"],et=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,is={title1:"1",title2:"2",title3:"3",count:"Count"},os=e=>[et(e,"fontFamily"),et(e,"fontSettings"),{type:"row",items:[et(e,"fontSize"),et(e,"lineHeight"),et(e,"letterSpacing"),et(e,"wordSpacing")]},et(e,"textAlign"),et(e,"textAppearance")],$h=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Xn.map(e=>[is[e],os(e)]))}),Ch={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Th={title1:.02,title2:.02,title3:.02,count:.017},ui=(e,t)=>{const n=i=>{const o=et(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[Ch[t]]}},pi=(e,t,n)=>{var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??Th[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Xt(i,n)};function Mc({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,onClose:l}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:p=0,title2MarginLeft:v=0,title3MarginLeft:y=0,titleRowMarginBottom:g=0,titleHeaderLayout:h="desktop",contentMarginTop:m=0,iconMarginRight:b=0,closeIcon:I=null,closeIconMaxWidth:R=0,closeIconColor:T="#000000",closeIconHoverColor:q="#cccccc"}=n,F=C.scalingValue(m,i),V=C.scalingValue(b,i),A=C.scalingValue(g,i),L=h==="mobile",O=pi("title1",ui(n,"title1"),i),x=pi("title2",ui(n,"title2"),i),W=pi("title3",ui(n,"title3"),i),E=a.useMemo(()=>({title1Width:d??Fi.title1Width,title2Width:c??Fi.title2Width,title3Width:u??Fi.title3Width}),[d,c,u]),J=a.useMemo(()=>({title2MarginLeft:v,title3MarginLeft:y}),[v,y]),P=a.useMemo(()=>Vn(e,t,O,x,W),[e,t,O,x,W]),K=a.useMemo(()=>P.map(_=>E[_.widthKey]),[P,E]),B=a.useMemo(()=>Di(P.length,K),[P.length,K]),z=a.useMemo(()=>wo(P.length,K),[P.length,K]),ie=a.useMemo(()=>P.filter(_=>_.prefix==="title1"),[P]),S=a.useMemo(()=>P.filter(_=>_.prefix==="title2"||_.prefix==="title3"),[P]),M=a.useMemo(()=>Gn(ie,E),[ie,E]),D=a.useMemo(()=>Gn(S,E),[S,E]),le=!!(t.title1||t.title2||t.title3),oe=I!==null;if(!(le||oe))return null;const ae=(p??0)>0||o,k=(_,ee)=>{const Ae=P.findIndex(N=>N.prefix===_.prefix);if(!L||ee==="single-row")return{effectiveWidth:z[Ae]??0,resolvedWidth:B[Ae]??0,maxWidth:ln(Ae,B)};if(ee==="two-row-top"){const N=ie.findIndex(Ue=>Ue.prefix===_.prefix);return{effectiveWidth:M.effective[N]??0,resolvedWidth:M.resolved[N]??0,maxWidth:ln(N,M.resolved)}}const ue=S.findIndex(N=>N.prefix===_.prefix);return{effectiveWidth:D.effective[ue]??0,resolvedWidth:D.resolved[ue]??0,maxWidth:ln(ue,D.resolved)}},te=(_,ee,Ae)=>{if(!L||Ae==="single-row"){const dt=_.findIndex(Be=>Be.prefix===ee.prefix),nt=_.map(Be=>E[Be.widthKey]),ht=Di(_.length,nt);return{effectiveWidth:wo(_.length,nt)[dt]??0,resolvedWidth:ht[dt]??0,maxWidth:ln(dt,ht)}}if(Ae==="two-row-top"){const dt=_.filter(Be=>Be.prefix==="title1"),nt=dt.findIndex(Be=>Be.prefix===ee.prefix),{resolved:ht,effective:st}=Gn(dt,E);return{effectiveWidth:st[nt]??0,resolvedWidth:ht[nt]??0,maxWidth:ln(nt,ht)}}const ue=_.filter(dt=>dt.prefix==="title2"||dt.prefix==="title3"),N=ue.findIndex(dt=>dt.prefix===ee.prefix),{resolved:Ue,effective:Oe}=Gn(ue,E);return{effectiveWidth:Oe[N]??0,resolvedWidth:Ue[N]??0,maxWidth:ln(N,Ue)}},X=_=>Ec(P,B,J,_)+(L?0:p??0),ve=()=>L?0:p??0,Pe=_=>S.slice(0,_).reduce((ee,Ae,ue)=>ee+(Ae.marginLeftKey?J[Ae.marginLeftKey]??0:0)+(D.resolved[ue]??0),0),he=_=>{const ee=S[_];return Pe(_)+(ee.marginLeftKey?J[ee.marginLeftKey]??0:0)+(D.resolved[_]??0)},ce=(_,ee,Ae)=>{const ue=_.marginLeftKey?J[_.marginLeftKey]??0:0,{effectiveWidth:N,resolvedWidth:Ue,maxWidth:Oe}=Ae??k(_,ee),dt=Math.max(ue,Bn),nt=o&&ee==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":_.prefix,style:{width:C.scalingValue(N,i),...ue>0?{marginLeft:C.scalingValue(ue,i)}:{}},children:[r.jsx("p",{className:_.className,style:_.style,children:_.text}),nt&&_.marginLeftKey?r.jsx("div",{"data-controls":_.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ue),style:{position:"absolute",top:0,left:C.scalingValue(-ue,i),width:C.scalingValue(dt,i),height:"100%",pointerEvents:"auto"}}):null,nt?r.jsx("div",{"data-controls":_.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Oe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:C.scalingValue(-gn/2,i),width:C.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}}):null]},_.className)},U=(_="two-row")=>{const ee=P.findIndex(N=>N.prefix==="title1"),Ae=ee>=0?B[ee]:E.title1Width,ue=_==="two-row"&&o;return r.jsx("div",{...ue?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ae)}:{},style:{width:C.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...ue?{pointerEvents:"auto"}:{}}})},Y=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:O,"aria-hidden":"true",children:" "}),Z=_=>{const ee=Vn(e,_,O,x,W);return r.jsx(r.Fragment,{children:ee.map(Ae=>ce(Ae,"single-row",te(ee,Ae,"single-row")))})},We=_=>{const ee=Vn(e,_,O,x,W),Ae=ee.find(ue=>ue.prefix==="title1");return Ae?ce(Ae,"two-row-top",te(ee,Ae,"two-row-top")):null},$e=(_,ee=!1)=>{const Ae=Vn(e,_,O,x,W),ue=Ae.filter(Oe=>Oe.prefix==="title2"||Oe.prefix==="title3"),N=o&&ee;return ue.length>0||N||(g??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[ue.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[r.jsx("div",{className:`${e}-titles-stack`,children:ue.map(Oe=>ce(Oe,"two-row-bottom",te(Ae,Oe,"two-row-bottom")))}),ee&&o?r.jsxs(r.Fragment,{children:[Se(),Me()]}):null]}):null,(g??0)>0||N?r.jsx("div",{"data-controls":N?"titleRowMarginBottom":void 0,"data-controls-axis":N?"y":void 0,"data-controls-reverse":N?"":void 0,className:N?`${e}-control`:void 0,style:{height:A,width:"100%",flexShrink:0,pointerEvents:N?"auto":"none"}}):null]}):null},ke=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:C.scalingValue(R??0,i),height:C.scalingValue(R??0,i),marginRight:V,"--close-icon-hover-color":q},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:_=>{_.stopPropagation(),l==null||l()},"aria-label":"Close",children:r.jsx(an,{url:I??"",fill:T,hoverFill:i&&!s?T:q,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:V,height:"100%",pointerEvents:"auto"}})]}),de=()=>oe?r.jsx("div",{className:`${e}-titles-row-header-controls`,children:ke()}):null,fe=_=>r.jsx("div",{className:`${e}-titles-row-titles`,children:r.jsx("div",{className:`${e}-titles-stack`,children:_})}),we=_=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[oe||le?Y():null,ae?U("two-row"):null,fe(_),de()]}),G=(_,ee=!1)=>r.jsxs(r.Fragment,{children:[we(We(_)),$e(_,ee)]}),se=()=>{const _=L?-1:P.findIndex(ue=>ue.prefix==="title1"),ee=!L&&(o||(p??0)>0)?(()=>{const ue=p??0,N=_>=0?B[_]:E.title1Width,Ue=Math.max(ue,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(N),style:{position:"absolute",top:0,left:0,width:C.scalingValue(Ue,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Ae=P.flatMap((ue,N)=>{if(!ue.marginLeftKey)return[];const Ue=J[ue.marginLeftKey]??0,Oe=Ic(P,B,J,N)+ve(),dt=Math.max(Ue,Bn);return r.jsx("div",{"data-controls":ue.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(B[N]),style:{position:"absolute",top:0,left:C.scalingValue(Oe,i),width:C.scalingValue(dt,i),height:"100%",pointerEvents:"auto"}},ue.marginLeftKey)});return ee?[ee,...Ae]:Ae},pe=()=>P.map((_,ee)=>{const Ae=ln(ee,B),N=X(ee)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":_.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ae),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:C.scalingValue(N,i),width:C.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}})},`${_.widthKey}-junction`)}),Se=()=>S.flatMap((_,ee)=>{if(!_.marginLeftKey)return[];const Ae=J[_.marginLeftKey]??0,ue=Pe(ee),N=Math.max(Ae,Bn),{resolvedWidth:Ue}=k(_,"two-row-bottom");return r.jsx("div",{"data-controls":_.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ue),style:{position:"absolute",top:0,left:C.scalingValue(ue,i),width:C.scalingValue(N,i),height:"100%",pointerEvents:"auto"}},_.marginLeftKey)}),Me=()=>S.map((_,ee)=>{const{maxWidth:Ae}=k(_,"two-row-bottom"),N=he(ee)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":_.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ae),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:C.scalingValue(N,i),width:C.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}})},`${_.widthKey}-junction`)}),Le=()=>!o||L?null:r.jsxs(r.Fragment,{children:[se(),pe()]}),H=!!(t.title2||t.title3||(g??0)>0||o),ye=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[oe||le?Y():null,ae?U("single-row"):null,le?fe(Z(t)):r.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),de(),Le()]}),re=()=>r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...H?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:H?void 0:{flex:"0 0 auto",height:"auto"},children:G(t,!0)}),Le()]});return r.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:F,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...L?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${L?` ${e}-lightbox-content-area-stacked`:""}`,children:r.jsx("div",{className:`${e}-text-bar-cell${L?` ${e}-text-bar-cell-stacked`:""}`,style:L?void 0:{flex:1,minWidth:0,width:"100%"},children:L?re():ye()})})})]})}function Lh(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Rh(e){return`
6216
7186
  .${e}-wrapper {
6217
7187
  display: grid;
6218
7188
  align-items: start;
6219
7189
  justify-content: center;
6220
- min-height: ${Jg(48)};
7190
+ min-height: ${Lh(48)};
6221
7191
  }
6222
7192
  .${e}-item {
6223
7193
  display: flex;
@@ -6532,7 +7502,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
6532
7502
  pointer-events: auto;
6533
7503
  flex-shrink: 0;
6534
7504
  }
6535
- `}const Bs={url:"",name:"",objectFit:"cover"},$n=500,eo=650,un="cubic-bezier(0.22, 1, 0.36, 1)",eh=72,th=50,nh=1e4,ih=650,oh=500;function rh(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,s=e.top-t.top;return`translate(${o}px, ${s}px) scale(${n}, ${i})`}function Ic(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=mr(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 ah(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Ic(i,n):null}function sh(e){return e.reduce((t,n,i)=>{const o=ns(n.gallery),l=is(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 ro(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 Vs(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return ro(e,i,n)}const lh=.03;function Ec(e){return e.width*lh}const Yr={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Vo(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Gs(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function ch(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Ta(e,t,n){const i=e.getBoundingClientRect(),o=i.width,s=i.height,l=t/n,d=o/s;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(s-u)/2}}const c=s*l;return{width:c,height:s,left:i.left+(o-c)/2,top:i.top}}function dh(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Ta(e,t.width,t.height)}function uh(e,t){if(Zi(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 ph(e){const t=new Set,n=[];for(const i of e){const o=ns(i.gallery),s=is(o);for(const l of s)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 mh({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Zi(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function Di(e,t,n){const{width:i,height:o,top:s}=e,{left:l,width:d}=n,c=Ec(n);return t==="left"?{left:l+c-i,top:s,width:i,height:o}:{left:l+d-c,top:s,width:i,height:o}}function gr(e,t,n){const i=Di(e,t,n);return{...i,left:2*i.left-e.left}}function gh(e,t,n){const{left:i,width:o}=n,s=Ec(n);return t==="left"?{left:i,top:e.top,width:s,height:e.height}:{left:i+o-s,top:e.top,width:s,height:e.height}}function Mc(e,t,n,i){const o=Di(e,"left",i),s=Di(e,"right",i),l=gr(e,"left",i),d=gr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:s,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:d,end:s};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:s};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:s,end:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function hh(e,t,n,i){const{start:o,end:s}=Mc(e,t,n,i);return{x:s.left-o.left,y:s.top-o.top}}function fh(e,t,n){const i=Di(e,t,n),o=gr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Pc(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 ns(e){if(!e)return;if(Pc(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??Bs,i??o??Bs]}]}function yh(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function vh(e){const[t]=e.media;return t!=null&&t.url?t:null}function is(e){if(!Array.isArray(e)||e.length===0)return[];if(Pc(e)){const t=[];for(const n of e){const i=yh(n);if(!i)continue;const o=vh(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 Zi(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function bh({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return Zi(e)?r.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}):r.jsx("img",{src:e.url,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function xh({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:s,onTransitionEnd:l}){const d=a.useRef(null);return a.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:l,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:s,onClick:c=>c.stopPropagation(),style:o},e)})}function Go({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Zi(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const s=o.currentTarget;s.videoWidth>0&&s.videoHeight>0&&(i==null||i(e.url,s.videoWidth,s.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const s=o.currentTarget;s.naturalWidth>0&&s.naturalHeight>0&&(i==null||i(e.url,s.naturalWidth,s.naturalHeight))},onTransitionEnd:n})}function wh({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:x,sourceRect:v,resolveCloseSourceRect:f,onClose:h,onPrev:m,onNext:b}){const I=a.useRef(null),R=a.useRef(null),T=a.useRef(null),U=a.useRef(new Map),[A,B]=a.useState(0),P=a.useRef(null),L=a.useRef(0),j=a.useRef(0),w=a.useRef("none"),W=a.useRef(!1),E=a.useRef(!1),J=a.useRef(!1),F=a.useRef(null),X=a.useRef(null),G=a.useRef(null),V=a.useRef(()=>{}),ie=a.useRef(null),C=a.useRef(null),M=a.useRef(null),O=a.useRef(!1),[re,ne]=a.useState(null),[$,ae]=a.useState(Yr),[k,te]=a.useState(0),[K,fe]=a.useState("opening"),[Ie,me]=a.useState(0),[ue,q]=a.useState(0),[Q,Y]=a.useState(!1),[Ae,Se]=a.useState(null),[Ee,de]=a.useState(null),[ge,be]=a.useState(null),[z,se]=a.useState(!1),[pe,xe]=a.useState(null),[Re,Te]=a.useState(!1),_=a.useRef(!1),[he,oe]=a.useState(!1),[H,ee]=a.useState(!1),Me=a.useRef(n),le=a.useRef(void 0),D=t[n],Ve=D?Zi(D):!1,Oe=ue!==0||Q,lt=!l&&(!s||!!d),tt=c&&!l,ht=u.length>1,nt=a.useCallback((y,ye)=>t.length<=1?null:t[(y+ye+t.length)%t.length]??null,[t]),Be=ht?ro(u,p,-1):nt(n,-1),ve=ht?ro(u,p,1):nt(n,1),ke=Ae===-1&&Oe?ht&&Ee!==null?ro(u,Ee,-1):ge!==null?nt(ge,-1):null:null,De=Ae===1&&Oe?ht&&Ee!==null?ro(u,Ee,1):ge!==null?nt(ge,1):null:null,Ue=ke&&ke.url!==(Be==null?void 0:Be.url)?ke:null,$e=De&&De.url!==(ve==null?void 0:ve.url)?De:null,He=Be&&tt?(()=>{const y=ht?Vs(u,p,-1):t.length>2?nt((n-1+t.length)%t.length,-1):null;return y&&y.url!==Be.url?y:null})():null,ze=ve&&tt?(()=>{const y=ht?Vs(u,p,1):t.length>2?nt((n+1)%t.length,1):null;return y&&y.url!==ve.url?y:null})():null,Xe=Ue??He,ct=$e??ze,Je=a.useCallback((y,ye,Le)=>{if(!y||!ye||!Le)return;const Pe=U.current,et=Pe.get(y);(et==null?void 0:et.width)===ye&&(et==null?void 0:et.height)===Le||(Pe.set(y,{width:ye,height:Le}),B(Et=>Et+1))},[]),$t=a.useCallback(y=>{if(!(y!=null&&y.url))return null;const ye=U.current.get(y.url);return dh(R.current,ye)},[A,k]),dt=a.useCallback(()=>{if(!D)return;const y=$t(D);if(y){ne(y);return}const ye=R.current;ye&&ne(Gs(ye))},[D,$t]),We=a.useCallback(y=>{if(ht){const ye=u.length;de((p+y+ye)%ye),be(null);return}t.length>1&&(be((n+y+t.length)%t.length),de(null))},[ht,u.length,p,t.length,n]),Ke=a.useCallback(y=>{J.current=y,Y(y)},[]),je=a.useCallback(()=>{F.current!==null&&(window.clearTimeout(F.current),F.current=null)},[]),ut=a.useCallback(()=>{je(),F.current=window.setTimeout(()=>{je(),Ke(!1)},eo+32)},[je,Ke]),pt=a.useCallback(()=>{const y=I.current;if(!y){ae({left:0,top:0,width:typeof window<"u"?window.innerWidth:Yr.width,height:typeof window<"u"?window.innerHeight:Yr.height});return}const ye=y.getBoundingClientRect();ae({left:ye.left,top:ye.top,width:ye.width,height:ye.height})},[]),mt=a.useCallback((y,ye)=>{if(Oe){if(he&&!Q)return`translate(${ue}px, 0px)`;if(Q&&Ae!==null){const Le=$t(y);if(!Le)return;const{x:Pe,y:et}=hh(Le,ye,Ae,$);return`translate(${Pe}px, ${et}px)`}if(Q)return"translate(0px, 0px)"}},[Oe,he,Q,ue,Ae,$,$t]),kt=a.useCallback(()=>{const y=X.current;X.current=null,je(),Ke(!1),Se(null),de(null),be(null),q(0),oe(!1),W.current=!1,j.current=0,w.current="none",y===-1?m():y===1&&b()},[je,Ke,m,b]),Xt=a.useCallback(()=>{je(),F.current=window.setTimeout(()=>{X.current!==null&&kt()},eo+32)},[je,kt]),Yt=a.useCallback(()=>{je(),X.current=null,Ke(!1),Se(null),de(null),be(null),q(0),oe(!1),W.current=!1,j.current=0,w.current="none"},[je,Ke]),vt=a.useCallback(y=>{if(!(!tt||!re)){if(J.current){if(X.current===y){G.current=y,kt();return}Yt()}je(),We(y),X.current=y,Se(y),Ke(!0),Xt()}},[tt,re,kt,Yt,je,We,Ke,Xt]);V.current=vt;const xt=a.useCallback(()=>{ie.current=null,O.current=!1,C.current!==null&&(window.clearInterval(C.current),C.current=null),M.current!==null&&(window.clearTimeout(M.current),M.current=null)},[]),Gt=a.useCallback(y=>{C.current!==null&&window.clearInterval(C.current);const ye=O.current?oh:ih;C.current=window.setInterval(()=>{V.current(y)},ye)},[]),Ft=a.useCallback(y=>{ie.current!==y&&(xt(),ie.current=y,O.current=!1,V.current(y),Gt(y),M.current=window.setTimeout(()=>{M.current=null,ie.current===y&&(O.current=!0,Gt(y))},nh))},[xt,Gt]),bt=a.useCallback(()=>{const y=R.current;if(!y)return;const ye=D==null?void 0:D.url,Le=ye?U.current.get(ye):void 0;if(Le!=null&&Le.width&&(Le!=null&&Le.height)){ne(Ta(y,Le.width,Le.height));return}const Pe=T.current;if(Pe&&ye&&(Pe.src===ye||Pe.currentSrc===ye)){const{width:Et,height:Ye}=ch(Pe);if(Et&&Ye){Je(ye,Et,Ye),ne(Ta(y,Et,Ye));return}}const et=Gs(y);!et.width||!et.height||ne(et)},[D==null?void 0:D.url,Je]),Nt=a.useCallback(y=>{if(T.current=y,!!y){if(y instanceof HTMLVideoElement){y.readyState>=1&&y.videoWidth>0&&bt();return}y.complete&&y.naturalWidth>0&&bt()}},[bt]),Ut=a.useCallback(()=>{pt(),bt(),te(y=>y+1)},[pt,bt]);a.useEffect(()=>{Ut();const y=R.current,ye=I.current,Le=new ResizeObserver(()=>Ut());return y&&Le.observe(y),ye&&Le.observe(ye),window.addEventListener("resize",Ut),()=>{Le.disconnect(),window.removeEventListener("resize",Ut)}},[Ut,n,x]),a.useLayoutEffect(()=>{if(!D)return;const y=T.current;if(y){if(y instanceof HTMLImageElement&&y.complete&&y.naturalWidth>0){bt();return}y instanceof HTMLVideoElement&&y.readyState>=1&&y.videoWidth>0&&bt()}},[D==null?void 0:D.url,n,bt]),a.useEffect(()=>{dt()},[dt,A]),a.useEffect(()=>{const y=new Set,ye=[],Le=Pe=>{!(Pe!=null&&Pe.url)||y.has(Pe.url)||(y.add(Pe.url),ye.push(Pe))};t.forEach(Le),u.forEach(Pe=>Pe.items.forEach(Le)),ye.forEach(Pe=>{U.current.has(Pe.url)||uh(Pe,Je)})},[t,u,Je]),a.useEffect(()=>{if(K!=="opening"||!re)return;if(!v){fe("open");return}se(!1);const y=requestAnimationFrame(()=>{requestAnimationFrame(()=>{se(!0),fe("open")})});return()=>cancelAnimationFrame(y)},[K,re,v]),a.useEffect(()=>{if(K!=="closing")return;const y=setTimeout(()=>h(),$n);return()=>clearTimeout(y)},[K,h]),a.useEffect(()=>()=>{je()},[je]),a.useLayoutEffect(()=>{Me.current===n&&le.current===(D==null?void 0:D.url)||(je(),X.current=null,Se(null),de(null),be(null),me(0),q(0),Ke(!1),ee(!1),oe(!1),L.current=0,j.current=0,w.current="none",W.current=!1,P.current=null,E.current=!1,T.current=null,dt(),Me.current=n,le.current=D==null?void 0:D.url)},[n,D==null?void 0:D.url,Ke,je,dt]),a.useLayoutEffect(()=>{const y=G.current;y!==null&&(G.current=null,requestAnimationFrame(()=>{V.current(y)}))},[n,p,D==null?void 0:D.url]),a.useLayoutEffect(()=>{if(K==="opening"){_.current=!1,Te(!1);return}if(K!=="open"||_.current)return;if(!Be&&!ve){_.current=!0;return}Te(!1);const y=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Te(!0),_.current=!0})});return()=>cancelAnimationFrame(y)},[K,Be==null?void 0:Be.url,ve==null?void 0:ve.url]),a.useEffect(()=>{if(K!=="open")return;const y=()=>{const Ye=ft=>{ft.stopPropagation(),ft.preventDefault(),document.removeEventListener("click",Ye,!0)};document.addEventListener("click",Ye,!0)},ye=Ye=>{const ft=Ye<0?1:-1;je(),We(ft),X.current=ft,Se(ft),Ke(!0),Xt()},Le=Ye=>{if(Math.abs(Ye)>th&&tt){ye(Ye);return}X.current=null,Se(null),de(null),be(null),Ke(!0),q(0),ut()},Pe=Ye=>{if(Ye.touches.length!==1||J.current)return;const ft=Ye.touches[0];E.current=!0,P.current={x:ft.clientX,y:ft.clientY},w.current="none",j.current=0,W.current=!1},et=Ye=>{if(!P.current||Ye.touches.length!==1||J.current)return;const ft=Ye.touches[0],Ht=ft.clientX-P.current.x,Tt=ft.clientY-P.current.y;if(w.current==="none"){if(Math.abs(Ht)<10&&Math.abs(Tt)<10)return;if(Math.abs(Ht)>Math.abs(Tt)){if(!tt)return;w.current="horizontal"}else if(Tt>0){if(!lt)return;w.current="vertical"}else return}if(w.current==="horizontal"){W.current=!0,oe(!0),j.current=Ht,q(Ht),Ye.preventDefault();return}w.current==="vertical"&&(W.current=!0,oe(!0),L.current=Tt,me(Tt),Ye.preventDefault())},Et=()=>{if(!P.current)return;const Ye=w.current,ft=W.current;if(ft&&Ye==="horizontal")Le(j.current),y();else if(ft&&Ye==="vertical"){const Ht=L.current;if(lt&&Ht>eh){const Tt=window.innerHeight;L.current=Tt,ee(!0),me(Tt),fe("closing")}else L.current=0,me(0);y()}else Ye==="horizontal"&&Math.abs(j.current)>0&&(Le(j.current),y());P.current=null,w.current="none",j.current=0,W.current=!1,oe(!1)};return document.addEventListener("touchstart",Pe,{passive:!0}),document.addEventListener("touchmove",et,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Pe),document.removeEventListener("touchmove",et),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[K,tt,Ke,ut,je,lt,Xt,We]);const Zt=a.useCallback(()=>{const y=(f==null?void 0:f())??v??null;y&&re&&(xe(y),se(!0)),fe("closing")},[f,v,re]);a.useEffect(()=>{const y=Pe=>{if(Pe.key==="Escape"){if(s&&d||K==="closing")return;xt(),Zt();return}if(Pe.key!=="ArrowLeft"&&Pe.key!=="ArrowRight"||K!=="open"||!tt)return;Pe.preventDefault();const et=Pe.key==="ArrowLeft"?-1:1;Pe.repeat&&ie.current===et||Ft(et)},ye=Pe=>{if(Pe.key!=="ArrowLeft"&&Pe.key!=="ArrowRight")return;const et=Pe.key==="ArrowLeft"?-1:1;ie.current===et&&xt()},Le=()=>{xt()};return window.addEventListener("keydown",y),window.addEventListener("keyup",ye),window.addEventListener("blur",Le),()=>{window.removeEventListener("keydown",y),window.removeEventListener("keyup",ye),window.removeEventListener("blur",Le),xt()}},[K,s,d,Zt,tt,Ft,xt]),a.useEffect(()=>{K!=="open"&&xt()},[K,xt]);const tn=()=>{K==="closing"||l||Zt()},Ct=K==="open",jt=K==="closing",cn=Ie>0?Math.max(0,1-Ie/500):1,at=Ie>0?Math.max(.35,1-Ie/500):1,Ce=a.useCallback(y=>{if(!(y.propertyName!=="transform"||!J.current)){if(X.current!==null){kt();return}je(),Ke(!1)}},[je,Ke,kt]),_e=K==="closing"?pe??v:v,Qe=_e&&re&&(K==="opening"||jt)?rh(_e,re):void 0,st=Oe&&D?mt(D,"center"):Ie>0?`translateY(${Ie}px)`:Qe,gt=re?Vo(re,$):null,Rt=!!(_e&&re),ot=Rt&&(K==="closing"||K==="open"&&z),Ot={position:"absolute",top:gt==null?void 0:gt.top,left:gt==null?void 0:gt.left,width:gt==null?void 0:gt.width,height:gt==null?void 0:gt.height,objectFit:"contain",transformOrigin:"top left",transform:st,opacity:Ie>0?at:Rt?1:K==="opening"||jt?0:1,transition:he&&!Q?"none":Q?`transform ${eo}ms ${un}`:H?`transform ${$n}ms ${un}, opacity ${$n}ms ${un}`:ot?`transform ${$n}ms ${un}`:K==="opening"||jt?`opacity ${$n}ms ${un}`:"none",pointerEvents:Ve&&Ct&&!Oe?"auto":"none",touchAction:Ve&&Ct?"none":void 0,zIndex:1,overflow:Ve?"hidden":void 0},Pt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ct&&!Oe?"auto":"none"},Mt=(y,ye,Le="adjacent")=>{const Pe=$t(y);if(!Pe)return{display:"none"};const et=Le==="far"?ye==="left"?"far-left":"far-right":ye==="left"?"left-adjacent":"right-adjacent",{start:Et}=Ae!==null?Mc(Pe,et,Ae,$):{start:Le==="far"?gr(Pe,ye,$):Di(Pe,ye,$)},Ye=Vo(Et,$),ft=mt(y,et),Ht=!Oe&&Le==="adjacent"&&Ct&&!Re?fh(Pe,ye,$):null,Tt=Le==="far"&&Oe&&Ae===(ye==="left"?-1:1),nn=he&&!Q?!1:Q,dn=Le==="adjacent"&&Ct&&Re&&!Oe;return{position:"absolute",top:Ye.top,left:Ye.left,width:Ye.width,height:Ye.height,objectFit:"contain",transform:ft??(Ht?`translate(${Ht.x}px, ${Ht.y}px)`:void 0),opacity:Le==="far"?Ct&&Tt?1:0:Ct?1:0,transition:nn?Le==="far"?`transform ${eo}ms ${un}`:`transform ${eo}ms ${un}, opacity ${$n}ms ${un}`:dn?`transform ${$n}ms ${un}`:K==="opening"||jt?`opacity ${$n}ms ${un}`:"none",pointerEvents:"none",zIndex:1}},zt=(y,ye)=>{const Le=$t(y);return Le?gh(Di(Le,ye,$),ye,$):null},Bt=y=>ye=>{if(!l){if(E.current){E.current=!1;return}ye.stopPropagation(),vt(y)}},Wt=Be?zt(Be,"left"):null,_t=ve?zt(ve,"right"):null,At=Wt?Vo(Wt,$):null,wt=_t?Vo(_t,$):null;return r.jsxs("div",{ref:I,className:[`${e}-lightbox`,s?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:K==="open"?"none":void 0},onClick:tn,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ct?cn:0,transition:he?"none":`opacity ${$n}ms ${un}`,pointerEvents:"none"}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[r.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:R,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:Ct?1:0,transition:he?"none":`opacity ${$n}ms ${un}`,pointerEvents:"none"},children:r.jsx(Rc,{prefix:e,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,onClose:tn})})]}),Ct&&Xe&&r.jsx(Go,{media:Xe,style:Mt(Xe,"left","far"),onMeasure:Je,onTransitionEnd:Ce},`far-prev-${Xe.url}`),Ct&&Be&&r.jsxs(r.Fragment,{children:[r.jsx(Go,{media:Be,style:Mt(Be,"left"),onMeasure:Je,onTransitionEnd:Ce},`prev-${Be.url}`),At&&r.jsx("div",{style:{position:"absolute",top:At.top,left:At.left,width:At.width,height:At.height,cursor:l||he?"default":"pointer",pointerEvents:l||he?"none":"auto",zIndex:3},onClick:Bt(-1)})]}),Ct&&ve&&r.jsxs(r.Fragment,{children:[r.jsx(Go,{media:ve,style:Mt(ve,"right"),onMeasure:Je,onTransitionEnd:Ce},`next-${ve.url}`),wt&&r.jsx("div",{style:{position:"absolute",top:wt.top,left:wt.left,width:wt.width,height:wt.height,cursor:l||he?"default":"pointer",pointerEvents:l||he?"none":"auto",zIndex:3},onClick:Bt(1)})]}),Ct&&ct&&r.jsx(Go,{media:ct,style:Mt(ct,"right","far"),onMeasure:Je,onTransitionEnd:Ce},`far-next-${ct.url}`),re&&D&&(Ve?r.jsx(xh,{src:D.url,phase:K,onMediaElement:Nt,wrapperStyle:Ot,videoStyle:Pt,onLoadedMetadata:bt,onTransitionEnd:Ce},`${n}-${D.url}`):r.jsx("img",{ref:Nt,src:D.url,alt:D.name,onLoad:bt,onTransitionEnd:Ce,style:Ot},`${n}-${D.url}`))]})}function Sh({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:s,portalId:l}){const{prefix:d}=S.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:x}=e,v=(x==null?void 0:x.display)==="cover",f=(x==null?void 0:x.ratioValue)??"1:1",h=(x==null?void 0:x.reversed)??!1,[m,b]=f.split(":").map(Number),T=`${h?b:m} / ${h?m:b}`,U=c.entryWidth??.2,A=c.columnsCount,B=S.scalingValue(U,n),P=S.scalingValue(c.horizontalGap??0,n),L=B,j=B,w={width:L,...v?{aspectRatio:T,height:"auto",overflow:"hidden"}:{height:"auto"}},W=v?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},E=a.useRef(null),[J,F]=a.useState(!1),[X,G]=a.useState([]),[V,ie]=a.useState(0),[C,M]=a.useState(0),[O,re]=a.useState(null),[ne,$]=a.useState({title1:"",title2:"",title3:""}),ae=(()=>{const ge={},be=E.current?getComputedStyle(E.current).getPropertyValue("--cntrl-article-width").trim():"";return be&&(ge["--cntrl-article-width"]=be),ge})(),k=!n||i||o,te=a.useMemo(()=>Qg(d),[d]),K=t??[],fe=K.length%A||A,Ie=fe<A&&K.length>0,me=K.length-fe,ue=Ie?Math.floor((A-fe)/2)+1:1,q=a.useMemo(()=>sh(K),[K]),Q=a.useMemo(()=>ph(K),[K]),Y=(ge,be,z)=>{if(n&&!o&&!i)return;const se=q.findIndex(xe=>xe.gridIndex===ge);if(se<0)return;const pe=q[se];M(se),G(pe.items),ie(be),$(pe.entry),re(z??null),F(!0)},Ae=a.useCallback(()=>{F(!1),re(null)},[]),Se=a.useCallback(()=>{const ge=q[C];return!ge||!E.current?O:ah(E.current,ge.gridIndex,v?"cover":"contain")??O},[q,C,O,v]),Ee=a.useCallback(ge=>{if(q.length>1){const be=q.length,z=(C+ge+be)%be,se=q[z],pe=Math.min(V,se.items.length-1);M(z),G(se.items),ie(pe),$(se.entry);return}ie(be=>(be+ge+X.length)%X.length)},[q,C,V,X.length]),de=q.length>1||X.length>1;return a.useEffect(()=>{if(!J||typeof document>"u")return;const ge=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ge}},[J]),a.useEffect(()=>{!n||o||i||F(!1)},[n,o,i]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:te}}),r.jsx(mh,{mediaList:Q}),r.jsx("div",{ref:E,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${A}, ${B})`,rowGap:0,columnGap:P,width:S.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:S.scalingValue(u??0,n)},children:K.map((ge,be)=>{const z=ns(ge.gallery),se=is(z),pe=se.filter(oe=>oe.lightboxMedia).map(oe=>oe.lightboxMedia),xe=Math.floor(be/A)===Math.ceil(K.length/A)-1,Re=Ie&&be>=me?`${ue+(be-me)}`:void 0,Te=se[0],_=Te!=null&&Te.lightboxMedia?pe.findIndex(oe=>oe.url===Te.lightboxMedia.url):-1,he=r.jsx("div",{className:`${d}-item-image-wrapper`,style:w,children:se.length>0&&r.jsx(bh,{media:Te.displayMedia,gridIndex:be,className:`${d}-item-${Zi(Te.displayMedia)?"video":"image"}`.trim(),style:W,onMediaClick:k&&_>=0?oe=>Y(be,_,Ic(oe.currentTarget,v?"cover":"contain")):void 0})});return r.jsx("div",{className:`${d}-item`,children:r.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,xe?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:B,...Re?{gridColumn:Re}:{}},children:[r.jsx("div",{className:`${d}-item-title-row`,children:r.jsx("div",{style:{height:0,width:j}})}),r.jsx("a",{className:`${d}-item-image-link`,children:he}),r.jsx("div",{className:`${d}-item-subtitle-row`,children:r.jsx("div",{style:{height:0,width:j}})})]})},be)})}),J&&typeof document<"u"&&(()=>{const ge=(l?document.getElementById(l):null)??document.body;return Yn.createPortal(r.jsx("div",{style:ae,"data-selection":"none",children:r.jsx(wh,{prefix:d,items:X,index:V,entry:ne,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:de,lightboxEntries:q,entryIdx:C,layoutId:s,sourceRect:O,resolveCloseSourceRect:Se,onClose:Ae,onPrev:()=>Ee(-1),onNext:()=>Ee(1)})}),ge)})()]})}const $h=`import { CommonComponentProps } from '../props';
7505
+ `}const qs={url:"",name:"",objectFit:"cover"},$n=500,to=650,un="cubic-bezier(0.22, 1, 0.36, 1)",Ih=72,Eh=50,Mh=1e4,Ph=650,kh=500;function Ah(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,s=e.top-t.top;return`translate(${o}px, ${s}px) scale(${n}, ${i})`}function Pc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=gr(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 Fh(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Pc(i,n):null}function Wh(e){return e.reduce((t,n,i)=>{const o=rs(n.gallery),l=as(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 ao(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 Us(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return ao(e,i,n)}const _h=.03;function kc(e){return e.width*_h}const Jr={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Go(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Xs(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Hh(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Ia(e,t,n){const i=e.getBoundingClientRect(),o=i.width,s=i.height,l=t/n,d=o/s;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(s-u)/2}}const c=s*l;return{width:c,height:s,left:i.left+(o-c)/2,top:i.top}}function Nh(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Ia(e,t.width,t.height)}function Oh(e,t){if(Ji(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 Dh(e){const t=new Set,n=[];for(const i of e){const o=rs(i.gallery),s=as(o);for(const l of s)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 jh({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Ji(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function ji(e,t,n){const{width:i,height:o,top:s}=e,{left:l,width:d}=n,c=kc(n);return t==="left"?{left:l+c-i,top:s,width:i,height:o}:{left:l+d-c,top:s,width:i,height:o}}function hr(e,t,n){const i=ji(e,t,n);return{...i,left:2*i.left-e.left}}function zh(e,t,n){const{left:i,width:o}=n,s=kc(n);return t==="left"?{left:i,top:e.top,width:s,height:e.height}:{left:i+o-s,top:e.top,width:s,height:e.height}}function Ac(e,t,n,i){const o=ji(e,"left",i),s=ji(e,"right",i),l=hr(e,"left",i),d=hr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:s,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:d,end:s};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:s};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:s,end:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function Bh(e,t,n,i){const{start:o,end:s}=Ac(e,t,n,i);return{x:s.left-o.left,y:s.top-o.top}}function Vh(e,t,n){const i=ji(e,t,n),o=hr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Fc(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 rs(e){if(!e)return;if(Fc(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??qs,i??o??qs]}]}function Gh(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function qh(e){const[t]=e.media;return t!=null&&t.url?t:null}function as(e){if(!Array.isArray(e)||e.length===0)return[];if(Fc(e)){const t=[];for(const n of e){const i=Gh(n);if(!i)continue;const o=qh(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 Ji(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Uh({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return Ji(e)?r.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}):r.jsx("img",{src:e.url,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function Xh({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:s,onTransitionEnd:l}){const d=a.useRef(null);return a.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:l,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:s,onClick:c=>c.stopPropagation(),style:o},e)})}function qo({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Ji(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const s=o.currentTarget;s.videoWidth>0&&s.videoHeight>0&&(i==null||i(e.url,s.videoWidth,s.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const s=o.currentTarget;s.naturalWidth>0&&s.naturalHeight>0&&(i==null||i(e.url,s.naturalWidth,s.naturalHeight))},onTransitionEnd:n})}function Kh({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:v,sourceRect:y,resolveCloseSourceRect:g,onClose:h,onPrev:m,onNext:b}){const I=a.useRef(null),R=a.useRef(null),T=a.useRef(null),q=a.useRef(new Map),[F,V]=a.useState(0),A=a.useRef(null),L=a.useRef(0),O=a.useRef(0),x=a.useRef("none"),W=a.useRef(!1),E=a.useRef(!1),J=a.useRef(!1),P=a.useRef(null),K=a.useRef(null),B=a.useRef(null),z=a.useRef(()=>{}),ie=a.useRef(null),S=a.useRef(null),M=a.useRef(null),D=a.useRef(!1),[le,oe]=a.useState(null),[$,ae]=a.useState(Jr),[k,te]=a.useState(0),[X,ve]=a.useState("opening"),[Pe,he]=a.useState(0),[ce,U]=a.useState(0),[Y,Z]=a.useState(!1),[We,$e]=a.useState(null),[ke,de]=a.useState(null),[fe,we]=a.useState(null),[G,se]=a.useState(!1),[pe,Se]=a.useState(null),[Me,Le]=a.useState(!1),H=a.useRef(!1),[ye,re]=a.useState(!1),[_,ee]=a.useState(!1),Ae=a.useRef(n),ue=a.useRef(void 0),N=t[n],Ue=N?Ji(N):!1,Oe=ce!==0||Y,dt=!l&&(!s||!!d),nt=c&&!l,ht=u.length>1,st=a.useCallback((w,be)=>t.length<=1?null:t[(w+be+t.length)%t.length]??null,[t]),Be=ht?ao(u,p,-1):st(n,-1),xe=ht?ao(u,p,1):st(n,1),Fe=We===-1&&Oe?ht&&ke!==null?ao(u,ke,-1):fe!==null?st(fe,-1):null:null,je=We===1&&Oe?ht&&ke!==null?ao(u,ke,1):fe!==null?st(fe,1):null:null,Ke=Fe&&Fe.url!==(Be==null?void 0:Be.url)?Fe:null,ne=je&&je.url!==(xe==null?void 0:xe.url)?je:null,ge=Be&&nt?(()=>{const w=ht?Us(u,p,-1):t.length>2?st((n-1+t.length)%t.length,-1):null;return w&&w.url!==Be.url?w:null})():null,Ie=xe&&nt?(()=>{const w=ht?Us(u,p,1):t.length>2?st((n+1)%t.length,1):null;return w&&w.url!==xe.url?w:null})():null,Ge=Ke??ge,Ze=ne??Ie,Ve=a.useCallback((w,be,Re)=>{if(!w||!be||!Re)return;const He=q.current,ot=He.get(w);(ot==null?void 0:ot.width)===be&&(ot==null?void 0:ot.height)===Re||(He.set(w,{width:be,height:Re}),V(Mt=>Mt+1))},[]),at=a.useCallback(w=>{if(!(w!=null&&w.url))return null;const be=q.current.get(w.url);return Nh(R.current,be)},[F,k]),Je=a.useCallback(()=>{if(!N)return;const w=at(N);if(w){oe(w);return}const be=R.current;be&&oe(Xs(be))},[N,at]),Ee=a.useCallback(w=>{if(ht){const be=u.length;de((p+w+be)%be),we(null);return}t.length>1&&(we((n+w+t.length)%t.length),de(null))},[ht,u.length,p,t.length,n]),qe=a.useCallback(w=>{J.current=w,Z(w)},[]),_e=a.useCallback(()=>{P.current!==null&&(window.clearTimeout(P.current),P.current=null)},[]),tt=a.useCallback(()=>{_e(),P.current=window.setTimeout(()=>{_e(),qe(!1)},to+32)},[_e,qe]),rt=a.useCallback(()=>{const w=I.current;if(!w){ae({left:0,top:0,width:typeof window<"u"?window.innerWidth:Jr.width,height:typeof window<"u"?window.innerHeight:Jr.height});return}const be=w.getBoundingClientRect();ae({left:be.left,top:be.top,width:be.width,height:be.height})},[]),lt=a.useCallback((w,be)=>{if(Oe){if(ye&&!Y)return`translate(${ce}px, 0px)`;if(Y&&We!==null){const Re=at(w);if(!Re)return;const{x:He,y:ot}=Bh(Re,be,We,$);return`translate(${He}px, ${ot}px)`}if(Y)return"translate(0px, 0px)"}},[Oe,ye,Y,ce,We,$,at]),Tt=a.useCallback(()=>{const w=K.current;K.current=null,_e(),qe(!1),$e(null),de(null),we(null),U(0),re(!1),W.current=!1,O.current=0,x.current="none",w===-1?m():w===1&&b()},[_e,qe,m,b]),Ut=a.useCallback(()=>{_e(),P.current=window.setTimeout(()=>{K.current!==null&&Tt()},to+32)},[_e,Tt]),Zt=a.useCallback(()=>{_e(),K.current=null,qe(!1),$e(null),de(null),we(null),U(0),re(!1),W.current=!1,O.current=0,x.current="none"},[_e,qe]),xt=a.useCallback(w=>{if(!(!nt||!le)){if(J.current){if(K.current===w){B.current=w,Tt();return}Zt()}_e(),Ee(w),K.current=w,$e(w),qe(!0),Ut()}},[nt,le,Tt,Zt,_e,Ee,qe,Ut]);z.current=xt;const wt=a.useCallback(()=>{ie.current=null,D.current=!1,S.current!==null&&(window.clearInterval(S.current),S.current=null),M.current!==null&&(window.clearTimeout(M.current),M.current=null)},[]),jt=a.useCallback(w=>{S.current!==null&&window.clearInterval(S.current);const be=D.current?kh:Ph;S.current=window.setInterval(()=>{z.current(w)},be)},[]),At=a.useCallback(w=>{ie.current!==w&&(wt(),ie.current=w,D.current=!1,z.current(w),jt(w),M.current=window.setTimeout(()=>{M.current=null,ie.current===w&&(D.current=!0,jt(w))},Mh))},[wt,jt]),vt=a.useCallback(()=>{const w=R.current;if(!w)return;const be=N==null?void 0:N.url,Re=be?q.current.get(be):void 0;if(Re!=null&&Re.width&&(Re!=null&&Re.height)){oe(Ia(w,Re.width,Re.height));return}const He=T.current;if(He&&be&&(He.src===be||He.currentSrc===be)){const{width:Mt,height:Qe}=Hh(He);if(Mt&&Qe){Ve(be,Mt,Qe),oe(Ia(w,Mt,Qe));return}}const ot=Xs(w);!ot.width||!ot.height||oe(ot)},[N==null?void 0:N.url,Ve]),Ft=a.useCallback(w=>{if(T.current=w,!!w){if(w instanceof HTMLVideoElement){w.readyState>=1&&w.videoWidth>0&&vt();return}w.complete&&w.naturalWidth>0&&vt()}},[vt]),_t=a.useCallback(()=>{rt(),vt(),te(w=>w+1)},[rt,vt]);a.useEffect(()=>{_t();const w=R.current,be=I.current,Re=new ResizeObserver(()=>_t());return w&&Re.observe(w),be&&Re.observe(be),window.addEventListener("resize",_t),()=>{Re.disconnect(),window.removeEventListener("resize",_t)}},[_t,n,v]),a.useLayoutEffect(()=>{if(!N)return;const w=T.current;if(w){if(w instanceof HTMLImageElement&&w.complete&&w.naturalWidth>0){vt();return}w instanceof HTMLVideoElement&&w.readyState>=1&&w.videoWidth>0&&vt()}},[N==null?void 0:N.url,n,vt]),a.useEffect(()=>{Je()},[Je,F]),a.useEffect(()=>{const w=new Set,be=[],Re=He=>{!(He!=null&&He.url)||w.has(He.url)||(w.add(He.url),be.push(He))};t.forEach(Re),u.forEach(He=>He.items.forEach(Re)),be.forEach(He=>{q.current.has(He.url)||Oh(He,Ve)})},[t,u,Ve]),a.useEffect(()=>{if(X!=="opening"||!le)return;if(!y){ve("open");return}se(!1);const w=requestAnimationFrame(()=>{requestAnimationFrame(()=>{se(!0),ve("open")})});return()=>cancelAnimationFrame(w)},[X,le,y]),a.useEffect(()=>{if(X!=="closing")return;const w=setTimeout(()=>h(),$n);return()=>clearTimeout(w)},[X,h]),a.useEffect(()=>()=>{_e()},[_e]),a.useLayoutEffect(()=>{Ae.current===n&&ue.current===(N==null?void 0:N.url)||(_e(),K.current=null,$e(null),de(null),we(null),he(0),U(0),qe(!1),ee(!1),re(!1),L.current=0,O.current=0,x.current="none",W.current=!1,A.current=null,E.current=!1,T.current=null,Je(),Ae.current=n,ue.current=N==null?void 0:N.url)},[n,N==null?void 0:N.url,qe,_e,Je]),a.useLayoutEffect(()=>{const w=B.current;w!==null&&(B.current=null,requestAnimationFrame(()=>{z.current(w)}))},[n,p,N==null?void 0:N.url]),a.useLayoutEffect(()=>{if(X==="opening"){H.current=!1,Le(!1);return}if(X!=="open"||H.current)return;if(!Be&&!xe){H.current=!0;return}Le(!1);const w=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Le(!0),H.current=!0})});return()=>cancelAnimationFrame(w)},[X,Be==null?void 0:Be.url,xe==null?void 0:xe.url]),a.useEffect(()=>{if(X!=="open")return;const w=()=>{const Qe=yt=>{yt.stopPropagation(),yt.preventDefault(),document.removeEventListener("click",Qe,!0)};document.addEventListener("click",Qe,!0)},be=Qe=>{const yt=Qe<0?1:-1;_e(),Ee(yt),K.current=yt,$e(yt),qe(!0),Ut()},Re=Qe=>{if(Math.abs(Qe)>Eh&&nt){be(Qe);return}K.current=null,$e(null),de(null),we(null),qe(!0),U(0),tt()},He=Qe=>{if(Qe.touches.length!==1||J.current)return;const yt=Qe.touches[0];E.current=!0,A.current={x:yt.clientX,y:yt.clientY},x.current="none",O.current=0,W.current=!1},ot=Qe=>{if(!A.current||Qe.touches.length!==1||J.current)return;const yt=Qe.touches[0],Dt=yt.clientX-A.current.x,Lt=yt.clientY-A.current.y;if(x.current==="none"){if(Math.abs(Dt)<10&&Math.abs(Lt)<10)return;if(Math.abs(Dt)>Math.abs(Lt)){if(!nt)return;x.current="horizontal"}else if(Lt>0){if(!dt)return;x.current="vertical"}else return}if(x.current==="horizontal"){W.current=!0,re(!0),O.current=Dt,U(Dt),Qe.preventDefault();return}x.current==="vertical"&&(W.current=!0,re(!0),L.current=Lt,he(Lt),Qe.preventDefault())},Mt=()=>{if(!A.current)return;const Qe=x.current,yt=W.current;if(yt&&Qe==="horizontal")Re(O.current),w();else if(yt&&Qe==="vertical"){const Dt=L.current;if(dt&&Dt>Ih){const Lt=window.innerHeight;L.current=Lt,ee(!0),he(Lt),ve("closing")}else L.current=0,he(0);w()}else Qe==="horizontal"&&Math.abs(O.current)>0&&(Re(O.current),w());A.current=null,x.current="none",O.current=0,W.current=!1,re(!1)};return document.addEventListener("touchstart",He,{passive:!0}),document.addEventListener("touchmove",ot,{passive:!1}),document.addEventListener("touchend",Mt),document.addEventListener("touchcancel",Mt),()=>{document.removeEventListener("touchstart",He),document.removeEventListener("touchmove",ot),document.removeEventListener("touchend",Mt),document.removeEventListener("touchcancel",Mt)}},[X,nt,qe,tt,_e,dt,Ut,Ee]);const Kt=a.useCallback(()=>{const w=(g==null?void 0:g())??y??null;w&&le&&(Se(w),se(!0)),ve("closing")},[g,y,le]);a.useEffect(()=>{const w=He=>{if(He.key==="Escape"){if(s&&d||X==="closing")return;wt(),Kt();return}if(He.key!=="ArrowLeft"&&He.key!=="ArrowRight"||X!=="open"||!nt)return;He.preventDefault();const ot=He.key==="ArrowLeft"?-1:1;He.repeat&&ie.current===ot||At(ot)},be=He=>{if(He.key!=="ArrowLeft"&&He.key!=="ArrowRight")return;const ot=He.key==="ArrowLeft"?-1:1;ie.current===ot&&wt()},Re=()=>{wt()};return window.addEventListener("keydown",w),window.addEventListener("keyup",be),window.addEventListener("blur",Re),()=>{window.removeEventListener("keydown",w),window.removeEventListener("keyup",be),window.removeEventListener("blur",Re),wt()}},[X,s,d,Kt,nt,At,wt]),a.useEffect(()=>{X!=="open"&&wt()},[X,wt]);const Jt=()=>{X==="closing"||l||Kt()},Ct=X==="open",Ht=X==="closing",on=Pe>0?Math.max(0,1-Pe/500):1,mt=Pe>0?Math.max(.35,1-Pe/500):1,Te=a.useCallback(w=>{if(!(w.propertyName!=="transform"||!J.current)){if(K.current!==null){Tt();return}_e(),qe(!1)}},[_e,qe,Tt]),De=X==="closing"?pe??y:y,it=De&&le&&(X==="opening"||Ht)?Ah(De,le):void 0,gt=Oe&&N?lt(N,"center"):Pe>0?`translateY(${Pe}px)`:it,ft=le?Go(le,$):null,It=!!(De&&le),pt=It&&(X==="closing"||X==="open"&&G),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:gt,opacity:Pe>0?mt:It?1:X==="opening"||Ht?0:1,transition:ye&&!Y?"none":Y?`transform ${to}ms ${un}`:_?`transform ${$n}ms ${un}, opacity ${$n}ms ${un}`:pt?`transform ${$n}ms ${un}`:X==="opening"||Ht?`opacity ${$n}ms ${un}`:"none",pointerEvents:Ue&&Ct&&!Oe?"auto":"none",touchAction:Ue&&Ct?"none":void 0,zIndex:1,overflow:Ue?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ct&&!Oe?"auto":"none"},Pt=(w,be,Re="adjacent")=>{const He=at(w);if(!He)return{display:"none"};const ot=Re==="far"?be==="left"?"far-left":"far-right":be==="left"?"left-adjacent":"right-adjacent",{start:Mt}=We!==null?Ac(He,ot,We,$):{start:Re==="far"?hr(He,be,$):ji(He,be,$)},Qe=Go(Mt,$),yt=lt(w,ot),Dt=!Oe&&Re==="adjacent"&&Ct&&!Me?Vh(He,be,$):null,Lt=Re==="far"&&Oe&&We===(be==="left"?-1:1),nn=ye&&!Y?!1:Y,dn=Re==="adjacent"&&Ct&&Me&&!Oe;return{position:"absolute",top:Qe.top,left:Qe.left,width:Qe.width,height:Qe.height,objectFit:"contain",transform:yt??(Dt?`translate(${Dt.x}px, ${Dt.y}px)`:void 0),opacity:Re==="far"?Ct&&Lt?1:0:Ct?1:0,transition:nn?Re==="far"?`transform ${to}ms ${un}`:`transform ${to}ms ${un}, opacity ${$n}ms ${un}`:dn?`transform ${$n}ms ${un}`:X==="opening"||Ht?`opacity ${$n}ms ${un}`:"none",pointerEvents:"none",zIndex:1}},Vt=(w,be)=>{const Re=at(w);return Re?zh(ji(Re,be,$),be,$):null},Gt=w=>be=>{if(!l){if(E.current){E.current=!1;return}be.stopPropagation(),xt(w)}},Nt=Be?Vt(Be,"left"):null,Ot=xe?Vt(xe,"right"):null,Wt=Nt?Go(Nt,$):null,St=Ot?Go(Ot,$):null;return r.jsxs("div",{ref:I,className:[`${e}-lightbox`,s?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:X==="open"?"none":void 0},onClick:Jt,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ct?on:0,transition:ye?"none":`opacity ${$n}ms ${un}`,pointerEvents:"none"}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[r.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:R,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:Ct?1:0,transition:ye?"none":`opacity ${$n}ms ${un}`,pointerEvents:"none"},children:r.jsx(Mc,{prefix:e,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,onClose:Jt})})]}),Ct&&Ge&&r.jsx(qo,{media:Ge,style:Pt(Ge,"left","far"),onMeasure:Ve,onTransitionEnd:Te},`far-prev-${Ge.url}`),Ct&&Be&&r.jsxs(r.Fragment,{children:[r.jsx(qo,{media:Be,style:Pt(Be,"left"),onMeasure:Ve,onTransitionEnd:Te},`prev-${Be.url}`),Wt&&r.jsx("div",{style:{position:"absolute",top:Wt.top,left:Wt.left,width:Wt.width,height:Wt.height,cursor:l||ye?"default":"pointer",pointerEvents:l||ye?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Ct&&xe&&r.jsxs(r.Fragment,{children:[r.jsx(qo,{media:xe,style:Pt(xe,"right"),onMeasure:Ve,onTransitionEnd:Te},`next-${xe.url}`),St&&r.jsx("div",{style:{position:"absolute",top:St.top,left:St.left,width:St.width,height:St.height,cursor:l||ye?"default":"pointer",pointerEvents:l||ye?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Ct&&Ze&&r.jsx(qo,{media:Ze,style:Pt(Ze,"right","far"),onMeasure:Ve,onTransitionEnd:Te},`far-next-${Ze.url}`),le&&N&&(Ue?r.jsx(Xh,{src:N.url,phase:X,onMediaElement:Ft,wrapperStyle:zt,videoStyle:kt,onLoadedMetadata:vt,onTransitionEnd:Te},`${n}-${N.url}`):r.jsx("img",{ref:Ft,src:N.url,alt:N.name,onLoad:vt,onTransitionEnd:Te,style:zt},`${n}-${N.url}`))]})}function Yh({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:s,portalId:l}){const{prefix:d}=C.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:v}=e,y=(v==null?void 0:v.display)==="cover",g=(v==null?void 0:v.ratioValue)??"1:1",h=(v==null?void 0:v.reversed)??!1,[m,b]=g.split(":").map(Number),T=`${h?b:m} / ${h?m:b}`,q=c.entryWidth??.2,F=c.columnsCount,V=C.scalingValue(q,n),A=C.scalingValue(c.horizontalGap??0,n),L=V,O=V,x={width:L,...y?{aspectRatio:T,height:"auto",overflow:"hidden"}:{height:"auto"}},W=y?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},E=a.useRef(null),[J,P]=a.useState(!1),[K,B]=a.useState([]),[z,ie]=a.useState(0),[S,M]=a.useState(0),[D,le]=a.useState(null),[oe,$]=a.useState({title1:"",title2:"",title3:""}),ae=(()=>{const fe={},we=E.current?getComputedStyle(E.current).getPropertyValue("--cntrl-article-width").trim():"";return we&&(fe["--cntrl-article-width"]=we),fe})(),k=!n||i||o,te=a.useMemo(()=>Rh(d),[d]),X=t??[],ve=X.length%F||F,Pe=ve<F&&X.length>0,he=X.length-ve,ce=Pe?Math.floor((F-ve)/2)+1:1,U=a.useMemo(()=>Wh(X),[X]),Y=a.useMemo(()=>Dh(X),[X]),Z=(fe,we,G)=>{if(n&&!o&&!i)return;const se=U.findIndex(Se=>Se.gridIndex===fe);if(se<0)return;const pe=U[se];M(se),B(pe.items),ie(we),$(pe.entry),le(G??null),P(!0)},We=a.useCallback(()=>{P(!1),le(null)},[]),$e=a.useCallback(()=>{const fe=U[S];return!fe||!E.current?D:Fh(E.current,fe.gridIndex,y?"cover":"contain")??D},[U,S,D,y]),ke=a.useCallback(fe=>{if(U.length>1){const we=U.length,G=(S+fe+we)%we,se=U[G],pe=Math.min(z,se.items.length-1);M(G),B(se.items),ie(pe),$(se.entry);return}ie(we=>(we+fe+K.length)%K.length)},[U,S,z,K.length]),de=U.length>1||K.length>1;return a.useEffect(()=>{if(!J||typeof document>"u")return;const fe=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=fe}},[J]),a.useEffect(()=>{!n||o||i||P(!1)},[n,o,i]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:te}}),r.jsx(jh,{mediaList:Y}),r.jsx("div",{ref:E,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${F}, ${V})`,rowGap:0,columnGap:A,width:C.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:C.scalingValue(u??0,n)},children:X.map((fe,we)=>{const G=rs(fe.gallery),se=as(G),pe=se.filter(re=>re.lightboxMedia).map(re=>re.lightboxMedia),Se=Math.floor(we/F)===Math.ceil(X.length/F)-1,Me=Pe&&we>=he?`${ce+(we-he)}`:void 0,Le=se[0],H=Le!=null&&Le.lightboxMedia?pe.findIndex(re=>re.url===Le.lightboxMedia.url):-1,ye=r.jsx("div",{className:`${d}-item-image-wrapper`,style:x,children:se.length>0&&r.jsx(Uh,{media:Le.displayMedia,gridIndex:we,className:`${d}-item-${Ji(Le.displayMedia)?"video":"image"}`.trim(),style:W,onMediaClick:k&&H>=0?re=>Z(we,H,Pc(re.currentTarget,y?"cover":"contain")):void 0})});return r.jsx("div",{className:`${d}-item`,children:r.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,Se?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:V,...Me?{gridColumn:Me}:{}},children:[r.jsx("div",{className:`${d}-item-title-row`,children:r.jsx("div",{style:{height:0,width:O}})}),r.jsx("a",{className:`${d}-item-image-link`,children:ye}),r.jsx("div",{className:`${d}-item-subtitle-row`,children:r.jsx("div",{style:{height:0,width:O}})})]})},we)})}),J&&typeof document<"u"&&(()=>{const fe=(l?document.getElementById(l):null)??document.body;return Yn.createPortal(r.jsx("div",{style:ae,"data-selection":"none",children:r.jsx(Kh,{prefix:d,items:K,index:z,entry:oe,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:de,lightboxEntries:U,entryIdx:S,layoutId:s,sourceRect:D,resolveCloseSourceRect:$e,onClose:We,onPrev:()=>ke(-1),onNext:()=>ke(1)})}),fe)})()]})}const Zh=`import { CommonComponentProps } from '../props';
6536
7506
  import { scalingValue, useScopedStyles } from '../utils/index';
6537
7507
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
6538
7508
  import { createPortal } from 'react-dom';
@@ -8875,11 +9845,11 @@ export function Hive({
8875
9845
  </>
8876
9846
  );
8877
9847
  }
8878
- `,Ch="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>'),oi={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 Th(e){const t={};return t[Ze(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ze(e,"fontSettings")]={...oi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ze(e,"fontSize")]={...oi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ze(e,"lineHeight")]={...oi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ze(e,"letterSpacing")]={...oi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ze(e,"wordSpacing")]={...oi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ze(e,"textAlign")]={...oi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ze(e,"textAppearance")]={...oi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const ji=Kn.filter(e=>e!=="count"),Lh=ji.reduce((e,t)=>({...e,...Th(t)}),{}),Rh=ji.reduce((e,t)=>({...e,[Ze(t,"fontFamily")]:"Arial",[Ze(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ze(t,"letterSpacing")]:0,[Ze(t,"wordSpacing")]:0,[Ze(t,"textAlign")]:"left",[Ze(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Zr(e){return ji.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ze(n,"fontSize")]=i),o!==void 0&&(t[Ze(n,"lineHeight")]=o),t},{})}const Ih={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(ji.map(e=>[es[e],ts(e)]))},Eh={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},Mh=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...Eh,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),Ph={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:Mh},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"}},...Lh},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:Ch,closeIconColor:"#000000",closeIconHoverColor:"#999999",...Rh},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,...Zr({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,...Zr({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,...Zr({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:[Ih]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},kh={element:Sh,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:[...ji.map(e=>({path:`${Ze(e,"fontFamily")}`}))]},fontRelations:{...ji.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ze(t,"fontFamily")}`}),{})},schema:Ph,sourceCode:$h};function Ah(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 Fh({media:e,className:t,style:n}){const i=a.useRef(null);return a.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const s=o.play();s&&s.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?r.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):r.jsx("img",{className:t,src:e.url,alt:"",style:n})}function Jr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Wh(e){return String(e??"").trim().length>0}function Us(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 qs(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 Ks(e,t,n,i,o,s,l){const d=S.scalingValue(s,l),c=S.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!p||i?d:c}}function _h(e,t,n){const i=S.scalingValue(t,n),o=S.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Xs=10,Ys=10,to={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function Hh(e,t,n){return Math.max(t,Math.min(n,e))}function Qr(e,t,n){return e+(t-e)*n}function Nh(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+Xs,y:n.clientY-d.top+Xs}}switch(e){case"left":return{x:Ys+i/2,y:l};case"center":return{x:o/2,y:l};case"right":return{x:o-Ys-i/2,y:l};default:return{x:o/2,y:l}}}function Oh(e,t){const n=a.useRef(null),i=a.useRef({x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1}),o=a.useRef(null),s=a.useCallback(()=>{const f=n.current,h=i.current;f&&(f.style.transform=`translate3d(${h.x}px, ${h.y}px, 0) translate(-50%, -50%) rotate(${h.rotation.toFixed(3)}deg)`)},[]),l=a.useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},[]),d=a.useCallback(()=>{const f=i.current;t?(f.x=Qr(f.x,f.targetX,to.positionEase),f.y=Qr(f.y,f.targetY,to.positionEase),f.rotation=Qr(f.rotation,f.targetRotation,to.rotationEase)):(f.x=f.targetX,f.y=f.targetY,f.rotation=f.targetRotation),s();const h=Math.abs(f.x-f.targetX)<.4&&Math.abs(f.y-f.targetY)<.4,m=Math.abs(f.rotation-f.targetRotation)<.08;!h||!m?o.current=requestAnimationFrame(d):o.current=null},[s,t]),c=a.useCallback(()=>{o.current===null&&(o.current=requestAnimationFrame(d))},[d]),u=a.useCallback((f,h)=>{const m=i.current;m.targetX=f,m.targetY=h,m.targetRotation=0,m.x=f,m.y=h,m.rotation=0,m.lastX=f,m.hasLastX=!0,s(),t&&c()},[s,t,c]),p=a.useCallback((f,h)=>{if(!e)return;const m=i.current;if(t&&m.hasLastX){const b=f-m.lastX;m.targetRotation=Hh(b*to.rotationFactor,-20,to.maxRotation)}else m.targetRotation=0;if(m.lastX=f,m.hasLastX=!0,m.targetX=f,m.targetY=h,t){c();return}m.x=f,m.y=h,m.rotation=m.targetRotation,s()},[e,s,t,c]),x=a.useCallback(f=>{l(),i.current.hasLastX=!1,f==null||f()},[l]),v=a.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 a.useEffect(()=>(e||v(),l),[e,v,l]),{anchorRef:n,onShow:u,onCursorMove:p,exit:x,reset:v}}function Dh(e){return`
9848
+ `,Jh="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>'),oi={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 Qh(e){const t={};return t[et(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSettings")]={...oi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSize")]={...oi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[et(e,"lineHeight")]={...oi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[et(e,"letterSpacing")]={...oi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[et(e,"wordSpacing")]={...oi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[et(e,"textAlign")]={...oi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[et(e,"textAppearance")]={...oi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const zi=Xn.filter(e=>e!=="count"),ef=zi.reduce((e,t)=>({...e,...Qh(t)}),{}),tf=zi.reduce((e,t)=>({...e,[et(t,"fontFamily")]:"Arial",[et(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[et(t,"letterSpacing")]:0,[et(t,"wordSpacing")]:0,[et(t,"textAlign")]:"left",[et(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Qr(e){return zi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[et(n,"fontSize")]=i),o!==void 0&&(t[et(n,"lineHeight")]=o),t},{})}const nf={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(zi.map(e=>[is[e],os(e)]))},of={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},rf=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...of,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),af={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:rf},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"}},...ef},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:Jh,closeIconColor:"#000000",closeIconHoverColor:"#999999",...tf},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,...Qr({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,...Qr({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,...Qr({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:[nf]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},sf={element:Yh,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:[...zi.map(e=>({path:`${et(e,"fontFamily")}`}))]},fontRelations:{...zi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${et(t,"fontFamily")}`}),{})},schema:af,sourceCode:Zh};function lf(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 cf({media:e,className:t,style:n}){const i=a.useRef(null);return a.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const s=o.play();s&&s.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?r.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):r.jsx("img",{className:t,src:e.url,alt:"",style:n})}function ea(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function df(e){return String(e??"").trim().length>0}function Ks(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 Ys(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 Zs(e,t,n,i,o,s,l){const d=C.scalingValue(s,l),c=C.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!p||i?d:c}}function uf(e,t,n){const i=C.scalingValue(t,n),o=C.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Js=10,Qs=10,no={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function pf(e,t,n){return Math.max(t,Math.min(n,e))}function ta(e,t,n){return e+(t-e)*n}function mf(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+Js,y:n.clientY-d.top+Js}}switch(e){case"left":return{x:Qs+i/2,y:l};case"center":return{x:o/2,y:l};case"right":return{x:o-Qs-i/2,y:l};default:return{x:o/2,y:l}}}function gf(e,t){const n=a.useRef(null),i=a.useRef({x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1}),o=a.useRef(null),s=a.useCallback(()=>{const g=n.current,h=i.current;g&&(g.style.transform=`translate3d(${h.x}px, ${h.y}px, 0) translate(-50%, -50%) rotate(${h.rotation.toFixed(3)}deg)`)},[]),l=a.useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},[]),d=a.useCallback(()=>{const g=i.current;t?(g.x=ta(g.x,g.targetX,no.positionEase),g.y=ta(g.y,g.targetY,no.positionEase),g.rotation=ta(g.rotation,g.targetRotation,no.rotationEase)):(g.x=g.targetX,g.y=g.targetY,g.rotation=g.targetRotation),s();const h=Math.abs(g.x-g.targetX)<.4&&Math.abs(g.y-g.targetY)<.4,m=Math.abs(g.rotation-g.targetRotation)<.08;!h||!m?o.current=requestAnimationFrame(d):o.current=null},[s,t]),c=a.useCallback(()=>{o.current===null&&(o.current=requestAnimationFrame(d))},[d]),u=a.useCallback((g,h)=>{const m=i.current;m.targetX=g,m.targetY=h,m.targetRotation=0,m.x=g,m.y=h,m.rotation=0,m.lastX=g,m.hasLastX=!0,s(),t&&c()},[s,t,c]),p=a.useCallback((g,h)=>{if(!e)return;const m=i.current;if(t&&m.hasLastX){const b=g-m.lastX;m.targetRotation=pf(b*no.rotationFactor,-20,no.maxRotation)}else m.targetRotation=0;if(m.lastX=g,m.hasLastX=!0,m.targetX=g,m.targetY=h,t){c();return}m.x=g,m.y=h,m.rotation=m.targetRotation,s()},[e,s,t,c]),v=a.useCallback(g=>{l(),i.current.hasLastX=!1,g==null||g()},[l]),y=a.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 a.useEffect(()=>(e||y(),l),[e,y,l]),{anchorRef:n,onShow:u,onCursorMove:p,exit:v,reset:y}}function hf(e){return`
8879
9849
  .${e}-wrapper {
8880
9850
  display: grid;
8881
9851
  align-items: start;
8882
- min-height: ${Jr(48)};
9852
+ min-height: ${ea(48)};
8883
9853
  position: relative;
8884
9854
  overflow: visible;
8885
9855
  box-sizing: border-box;
@@ -9008,7 +9978,7 @@ a.${e}-list-item {
9008
9978
  flex-shrink: 0;
9009
9979
  overflow: visible;
9010
9980
  box-sizing: border-box;
9011
- min-width: ${Jr(50)};
9981
+ min-width: ${ea(50)};
9012
9982
  position: relative;
9013
9983
  display: flex;
9014
9984
  align-items: flex-start;
@@ -9016,7 +9986,7 @@ a.${e}-list-item {
9016
9986
 
9017
9987
  .${e}-list-col-last {
9018
9988
  flex: 1 1 auto;
9019
- min-width: ${Jr(50)};
9989
+ min-width: ${ea(50)};
9020
9990
  }
9021
9991
 
9022
9992
  .${e}-list-col-title {
@@ -9251,7 +10221,7 @@ a.${e}-list-item {
9251
10221
  overflow-wrap: anywhere;
9252
10222
  word-break: break-word;
9253
10223
  }
9254
- `}const Xn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],os=["AColumn","BColumn","CColumn","DColumn","EColumn"],An="cutLabel",wo=[...os,An],kr=["A","B","C","D","E"];function kc(e){return`${e}ColumnVerticalAlign`}const La=["Top","Center","Bottom"];function rs(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return kr.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function jh(e){const t=rs(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function zh(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return kr.includes(n)?n:null}function Ac(e,t,n){const i=zh(e);return i?i===t?!1:jh(n[kc(i)]):!0}function So(e){const t=rs(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return kr.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function Bh(e,t,n){if(Fc(e,t,n))return So(e);const i=So(e);return i.kind==="baseline"?{kind:"top"}:i}function Vh(e){const t=So(e);return t.kind==="baseline"?{kind:"top"}:t}function Fc(e,t,n){return Ac(e,n,t)?So(e).kind==="baseline":!1}function Gh(e){const t={};let n=!1;for(const i of kr){const o=kc(i),s=e[o];if(e.type==="b"){const l=String(s??"Top").trim();l!=="Top"&&l!=="Center"&&l!=="Bottom"&&(t[o]="Top",n=!0);continue}Ac(s,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Uh(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function qh(e){const t=So(e).kind;return t==="baseline"?"center":t}function Kh(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Zs(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Xh(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(),s=o-i;return n.remove(),s}function ea(e,t,n,i){const o=e.titleEl;if(!o)return 0;const s=o.closest(`.${n}`);if(!s)return 0;const l=Xh(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const d=s.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 Yh(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const s=o.querySelector(`.${n}`);s&&(s.style.minHeight=`${i}px`,s.style.height=`${i}px`)}),i)}function Zh(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Jh={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function It(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Qh={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function ef(e){return[It(e,"textFontFamily"),It(e,"textFontSettings"),{type:"row",items:[It(e,"textFontSize"),It(e,"textLineHeight"),It(e,"textLetterSpacing"),It(e,"textWordSpacing")]},It(e,"textTextAlign"),It(e,"textTextAppearance"),`${e}VerticalAlign`]}function tf(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(wo.map(e=>[Qh[e],ef(e)]))}}function hr(e,t){const n=i=>{const o=It(t,i);return e[o]};return{textFontFamily:n("textFontFamily")??"Arial",textFontSettings:n("textFontSettings")??{fontWeight:400,fontStyle:"normal"},textFontSize:n("textFontSize"),textLineHeight:n("textLineHeight"),textLetterSpacing:n("textLetterSpacing")??0,textWordSpacing:n("textWordSpacing")??0,textTextAlign:n("textTextAlign")??(t===An?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Js(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 on(qt(n,t))}function Qs(e,t,n,i){const o=hr(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<s?`${n} ${i}`:n}function el(e,t,n,i){const o=hr(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=s?{}:{[`--${n}-title-leading-gap`]:S.scalingValue((s-l)/2,i)}}const fn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],zi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Bi=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Vi=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],nf={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},of=["hover","focus","filled","success","error"],tl=.004,Ii=.004,ta=Ii,as=50,$o=1440,Co=as/$o;function Wc(e){const t=typeof e=="number"&&e>0?e:$o;return as/t}function rf(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 $o}const _c={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function uo(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function af(e,t=1){const n=t/e;return Object.fromEntries(fn.map(i=>[i,n]))}function sf(){return Object.fromEntries([...zi.map(e=>[e,0]),...Bi.map(e=>[e,0])])}function lf(){return Object.fromEntries(Vi.map(e=>[e,0]))}function Uo(e){return Object.fromEntries(fn.map(t=>[t,typeof e[t]=="number"?e[t]:_c[t]]))}function Hc(e,t,n){const i=e-Co,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const s=i/o;return{paddingLeft:t*s,paddingRight:n*s}}function ar(e,t,n){const i=ss(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((s,l)=>s+l,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function cf(e,t,n){const i={};for(let o=0;o<e;o+=1){const s=zi[o],l=Bi[o],d=typeof n[s]=="number"?n[s]:0,c=typeof n[l]=="number"?n[l]:0,u=Hc(t[o]??0,d,c);u.paddingLeft!==d&&(i[s]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function ss(e,t,n){if(e<=0)return[];const i=fn.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)+Co;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]-Co;if(p<=0)continue;const x=Math.min(c,p);d[u]-=x,c-=x}return[...d,i[e-1]]}function df(e,t,n){if(e<=1)return{};const i=ss(e,t,n),o={};for(let s=0;s<e-1;s+=1){const l=fn[s];i[s]!==n[l]&&(o[l]=i[s])}return o}function nl(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Xn]}function uf(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function pf(e,t,n,i){const o=Math.min(i,e.length,fn.length),s={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=fn[c],p=zi[c],x=Bi[c],v=Vi[c],f=fn[l],h=zi[l],m=Bi[l],b=Vi[l],I=n[u],R=n[p],T=n[x],U=n[v];typeof I=="number"&&(s[f]=I),typeof R=="number"&&(s[h]=R),typeof T=="number"&&(s[m]=T),typeof U=="number"&&(s[b]=U)}return s}function Nc(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 mf(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=uo(e),s=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...af(n,o),...sf()};if(s)for(const d of Vi)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,lf());return Nc(e,l)?l:e}function gf(e,t,n){const i=Gh(e);i&&(e={...e,...i});const o=Wc(n==null?void 0:n.designWidth),s=e.columns,l=t.columns,d=uo(e),c=uo(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof s=="number"?s:typeof l=="number"?l:Xn.length,x=T=>{if(u)return T;const U=Uo({...t,...T}),A=uo(T),B=ar(p,A,U),P=cf(p,B,{...t,...T});return Object.keys(P).length===0?T:{...T,...P}};if(typeof s=="number"&&s!==l)return e;const v=nl(e),f=nl(t);if(!uf(v,f))return x({...e,...pf(v,f,t,p)});if(d<c&&typeof p=="number"&&!u){const T=Uo({...t,...e});return x({...e,...df(p,d,T)})}if(u){const T=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,U=Math.max(0,(d-o)/2);return T>U?{...e,textPaddingLR:U}:e}const h=Uo({...t,...e}),m=ar(p,c,Uo(t)),I=ar(p,d,h).some((T,U)=>T<(m[U]??T)),R=fn.some(T=>{const U=e[T],A=t[T];return typeof U=="number"&&typeof A=="number"&&U!==A});return I||R?x(e):e}function hf(e,t,n,i){const o=t.slice(0,e).reduce((l,d)=>l+d,0),s=n.slice(e+1,t.length-1).reduce((l,d)=>l+d,0);return Math.max(Co,i-o-s-Co)}function ff(e,t){return Math.random()*(t-e)+e}function yf(e){return Object.fromEntries(fn.map(t=>[t,typeof e[t]=="number"?e[t]:_c[t]]))}function na(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function vf(e,t,n,i,o,s){return e.slice(0,t).map((l,d)=>{const c=zi[d],u=Bi[d],p=Vi[d];return{key:l,textPrefix:Jh[l],widthKey:fn[d],width:n[fn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:s[p]}})}function bf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s,layoutId:l,onUpdateSettings:d}){const{prefix:c}=S.useScopedStyles(),u=!!o,{columns:p,type:x,wrapperWidth:v,entriesCount:f,cellMinHeight:h,dividerWidth:m,showVisibility:b,cut:I,showCut:R,cutCellMinHeight:T,cutLabel:U,imageSize:A,imageOnHover:B,imagePosition:P="cursor",imageInterpolation:L="on",entryHoverEffect:j,entryHoverShowOption:w,rowPaddingTop:W,rowPaddingBottom:E,rowPaddingTopB:J,columnsOrder:F,textPaddingLR:X,textColor:G,backgroundColor:V,dividerColor:ie,textHoverColor:C,backgroundHoverColor:M,dividerHoverColor:O}=e,[re,ne]=a.useState(void 0),[$,ae]=a.useState(null),k=a.useRef(null),te=B==="on"&&(!n||i),K=P==="cursor",fe=K&&L==="on",{anchorRef:Ie,onShow:me,onCursorMove:ue,exit:q}=Oh(!!(te&&$!==null),fe),Q=(I??0)>0,Y=x==="b",Ae=a.useRef(null),Se=a.useRef(null),[Ee,de]=a.useState(null),[ge,be]=a.useState($o),z=Wc(ge),se=Math.max(0,((v??0)-z)/2),pe=Math.min(X??0,se),xe=Math.max(pe,Ii),Re=((v??0)+z)/2;a.useLayoutEffect(()=>{if(!n){be($o);return}const Ce=()=>{be(rf(Ae.current))};Ce();const _e=Ae.current;if(!_e)return;const Qe=new ResizeObserver(Ce);Qe.observe(_e);let st=_e;for(;st&&!st.style.getPropertyValue("--cntrl-article-width");)st=st.parentElement;return st&&Qe.observe(st),()=>Qe.disconnect()},[n,l]),a.useEffect(()=>{ne(void 0)},[I,R,t,f]),a.useEffect(()=>{n&&!i&&ne(void 0)},[n,i]);const Te=S.buildColorVars(c,{textColor:G,backgroundColor:V,dividerColor:ie,textHoverColor:C,backgroundHoverColor:M,dividerHoverColor:O},nf,of),_=s&&s!=="default"?`${c}-state-${s}`:"",oe=`${!n||i?j==="default"?`${c}-entry-hover-default`:j==="blinds"?`${c}-entry-hover-blinds`:j==="reveal"?`${c}-entry-hover-reveal`:"":""} ${_}`.trim(),H=j==="reveal"&&(!n||i),ee=(b==null?void 0:b[0])??!1,Me=(b==null?void 0:b[1])??!1,le=a.useRef(e),D=a.useRef(l);a.useEffect(()=>{if(!d||!n){le.current=e,D.current=l;return}if(D.current!==l){le.current=e,D.current=l;return}const Ce=le.current;if(!(Ce!==e))return;if(typeof Ce.columns=="number"&&typeof e.columns=="number"&&Ce.columns!==e.columns){le.current=e;return}const Qe=gf(e,Ce,{designWidth:ge});le.current=e,Nc(e,Qe)&&d(Qe)},[e,d,n,l,ge]);const Ve=a.useMemo(()=>yf(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Oe=a.useMemo(()=>na(e,zi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),lt=a.useMemo(()=>na(e,Bi),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),tt=a.useMemo(()=>na(e,Vi),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),ht=a.useMemo(()=>Array.isArray(F)&&F.length>0?F:[...Xn],[F]),nt=a.useMemo(()=>vf(ht,p,Ve,Oe,lt,tt),[ht,p,Ve,Oe,lt,tt]),Be=uo(e),ve=a.useMemo(()=>fn.slice(0,p).map(Ce=>Ve[Ce]),[p,Ve]),ke=a.useMemo(()=>ss(p,Be,Ve),[p,Be,Ve]),De=a.useMemo(()=>ar(p,Be,Ve),[p,Be,Ve]),Ue=a.useMemo(()=>nt.map((Ce,_e)=>Hc(De[_e]??0,Ce.paddingLeft,Ce.paddingRight)),[nt,De]),$e=a.useMemo(()=>{const Ce=f===0?1/0:f;return(t??[]).slice(0,Ce).map((Qe,st)=>({id:st,cells:Object.fromEntries(Xn.map(gt=>[gt,Qe[gt]??""])),image:Qe.image,link:Qe.link}))},[t,f]),He=Q?re??I:$e.length,ze=a.useMemo(()=>Q?$e.slice(0,He):$e,[$e,Q,He]),Xe=Q&&He<$e.length,ct=ze.length>1||Xe,Je=[ee?`${c}-divider-top`:"",Me||ct?`${c}-divider-bottom`:""].filter(Boolean).join(" "),$t=!n||i,dt=()=>{if(!$t)return;const Ce=re??I;if(!R){ne($e.length);return}ne(Math.min(Ce+R,$e.length))},We=Ce=>S.scalingValue(Ce,n??!1),Ke=Y?J??0:W??0,je=E??0,ut=h??0,pt=Math.max(je,ta),mt=Ks(0,ze.length,ee,Me,Xe,m??0,n??!1).borderTopWidth,kt=Y?"rowPaddingTopB":"rowPaddingTop",Xt=nt[0],Yt=nt[nt.length-1],vt=Ue[0],xt=Ue[Ue.length-1],Gt=Xt&&vt?Math.max(vt.paddingLeft,Ii):0,Ft=Yt&&xt?Math.max(xt.paddingRight,Ii):0,bt=Be,Nt=(Ce,_e)=>Nh(P,Ae.current,K?Ce:null,_e),Ut=(Ce,_e)=>{if(!te)return;const Qe=Ce.image;if(!(Qe!=null&&Qe.url)){q(()=>ae(null));return}const st=(A==null?void 0:A.min)??80,gt=(A==null?void 0:A.max)??320,Rt=($==null?void 0:$.rowId)===Ce.id,ot=Rt?$.widthPx:ff(st,gt),{x:Ot,y:Pt}=Nt(_e,ot);if(Rt&&K){ue(Ot,Pt);return}ae({rowId:Ce.id,url:Qe.url,objectFit:"contain",isVideo:Ah(Qe),widthPx:ot}),k.current={x:Ot,y:Pt}},Zt=Ce=>{if(!te||!$||!K)return;const{x:_e,y:Qe}=Nt(Ce,$.widthPx);ue(_e,Qe)},tn=()=>{$&&q(()=>ae(null))},Ct=Ce=>{H&&Us(Ce,c),!(!te||!$)&&q(()=>ae(null))},jt=Ce=>{H&&qs(Ce,c)};a.useLayoutEffect(()=>{if(!$||!k.current)return;const{x:Ce,y:_e}=k.current;k.current=null,me(Ce,_e)},[$==null?void 0:$.rowId,$==null?void 0:$.url,me]),a.useLayoutEffect(()=>{if(!u||Y){de(null);return}const Ce=Se.current,_e=Ce==null?void 0:Ce.parentElement;if(!Ce||!_e){de(null);return}const Qe=()=>{const gt=Ce.querySelector("[data-list-row]");if(!gt){de(null);return}const Rt=_e.getBoundingClientRect(),ot=gt.getBoundingClientRect();de(ot.top-Rt.top+ot.height/2)};Qe();const st=new ResizeObserver(Qe);return st.observe(Ce),st.observe(_e),()=>st.disconnect()},[u,Y,ze,Ke,je,ut,t,e,nt,De,ge,m,ee,Me,Xe]);const cn=a.useMemo(()=>!Y&&os.some(Ce=>{const _e=Ce.charAt(0),Qe=e[`${Ce}VerticalAlign`];return Fc(Qe,e,_e)}),[Y,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);a.useLayoutEffect(()=>{var Ot;const Ce=Ae.current;if(!Ce)return;const _e=()=>{Ce.querySelectorAll("[data-list-col]").forEach(Pt=>{Pt.style.transform="";const Mt=Pt.querySelector(`.${c}-list-col`);Mt&&(Mt.style.minHeight="",Mt.style.height="");const zt=Pt.querySelector(`.${c}-list-col-title`);zt&&(zt.style.transform="")})};if(Y||!cn){_e();return}const Qe=()=>{const Pt=Array.from(Ce.querySelectorAll("[data-list-row]")),Mt=`${c}-list-col`,zt=`${c}-baseline-probe`;Pt.forEach(Bt=>{Bt.querySelectorAll("[data-list-col]").forEach(Wt=>{Wt.style.transform="";const _t=Wt.querySelector(`.${Mt}`);_t&&(_t.style.minHeight="",_t.style.height="");const At=Wt.querySelector(`.${c}-list-col-title`);At&&(At.style.transform="")})}),Pt.forEach(Bt=>{const Wt=Array.from(Bt.querySelectorAll("[data-list-col]"));Yh(Bt,Wt,Mt)}),Ce.offsetHeight,Pt.forEach(Bt=>{const Wt=Array.from(Bt.querySelectorAll("[data-list-col]")),_t=Bt.getBoundingClientRect().top,At=new Map,wt=Wt.map(Le=>{const Pe=Le.querySelector(`.${c}-list-col-title`),et={el:Le,titleEl:Pe,letter:Le.getAttribute("data-col-letter")??"",kind:Le.getAttribute("data-valign")??"top",anchor:Le.getAttribute("data-valign-anchor")};return At.set(et.letter,et),et}),y=new Map,ye=(Le,Pe)=>{const et=y.get(Le.letter);if(et!==void 0)return et;const Et=Le.anchor?At.get(Le.anchor):void 0;if(Le.kind!=="baseline"||!Et||Pe.has(Le.letter)){const nn=ea(Le,_t,Mt,zt);return y.set(Le.letter,nn),nn}Pe.add(Le.letter);const Ye=ye(Et,Pe);Pe.delete(Le.letter);const ft=ea(Le,_t,Mt,zt),Ht=Ye-ft;Zh(Le.titleEl,Ht);const Tt=ea(Le,_t,Mt,zt);return y.set(Le.letter,Tt),Tt};wt.forEach(Le=>ye(Le,new Set))})};let st=null;const gt=()=>{st===null&&(st=requestAnimationFrame(()=>{st=null,Qe()}))};Qe();const Rt=new ResizeObserver(()=>gt());Rt.observe(Ce);let ot=!1;return typeof document<"u"&&((Ot=document.fonts)!=null&&Ot.ready)&&document.fonts.ready.then(()=>{ot||gt()}),()=>{ot=!0,st!==null&&(cancelAnimationFrame(st),st=null),Rt.disconnect(),_e()}},[cn,Y,e,t,ge,ze,De]);const at=a.useMemo(()=>Dh(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:at}}),r.jsx("div",{style:Te,children:r.jsxs("div",{ref:Ae,className:`${c}-wrapper ${oe}${Je?` ${Je}`:""}${Y?` ${c}-type-b`:""}`.trim(),style:{width:S.scalingValue(v??0,n)},onMouseMove:te?Zt:void 0,onMouseLeave:te?tn:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[ze.map((Ce,_e)=>{var Rt;const Qe=(((Rt=Ce.link)==null?void 0:Rt.length)??0)>0,st=Qe&&(!n||i)?"a":"div",gt=Ks(_e,ze.length,ee,Me,Xe,m??0,n??!1);return r.jsxs(st,{ref:_e===0?ot=>{Se.current=ot}:void 0,className:`${c}-list-item${Qe||w==="always"?` ${c}-list-item-has-link`:""}${Xe&&_e===ze.length-1?` ${c}-list-item-before-cut`:""}`,...Qe?{href:Ce.link,target:"_blank"}:{},style:gt,onMouseEnter:ot=>{H&&(Qe||w==="always")&&Us(ot,c),te&&Ut(Ce,ot)},onMouseLeave:ot=>{H&&(Qe||w==="always")&&qs(ot,c)},children:[Ke>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:We(Ke)}}),r.jsxs("div",{className:`${c}-list-cols-row${Y?"":` ${c}-list-cols-row-h`}${u&&_e===0&&Y?` ${c}-list-cols-row-controls`:""}`,...Y?{}:{"data-list-row":""},style:Y?void 0:{minHeight:We(ut)},children:[nt.map((ot,Ot)=>{const Pt=Ot===nt.length-1,Mt=Ue[Ot],zt=ot.paddingBottom,Bt=Wh(Ce.cells[ot.key]),Wt=Y&&Bt&&zt>0,_t=Y?{minHeight:We(ut)}:{width:We(De[Ot])},At=Y?{paddingLeft:We(pe),paddingRight:We(pe)}:{paddingLeft:We(Mt.paddingLeft),paddingRight:We(Mt.paddingRight)},wt=ot.textPrefix.charAt(0),y=Y?Vh(e[`${ot.textPrefix}VerticalAlign`]):Bh(e[`${ot.textPrefix}VerticalAlign`],e,wt),ye=Y&&Bt&&u&&_e===0;return Y&&!Bt?null:r.jsxs("div",{className:Y?`${c}-list-col-wrap`:void 0,...Y?{}:{"data-list-col":"","data-col-letter":wt,"data-valign":y.kind,...y.kind==="baseline"?{"data-valign-anchor":y.anchorLetter}:{}},children:[r.jsx("div",{className:`${c}-list-col${Pt?` ${c}-list-col-last`:""}`,style:{...At,..._t,...Y?{justifyContent:Zs(y.kind)}:{}},"data-test":ot.width,children:r.jsx("span",{className:Qs(e,ot.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Js(hr(e,ot.textPrefix),n),...el(e,ot.textPrefix,c,n),...Y?{}:Uh(y.kind)},children:Ce.cells[ot.key]??null})}),Wt&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:We(zt)}}),ye&&r.jsx("div",{"data-controls":ot.paddingBottomKey,"data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:We(Math.max(zt,ta))}})]},ot.key)}),u&&_e===0&&Y&&r.jsxs(r.Fragment,{children:[r.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(Re),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:We(xe),height:"100%"}}),r.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(Re),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:We(Math.max(xe,Be-xe)),width:We(xe),height:"100%"}})]})]}),!Y&&je>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:We(je)}}),u&&_e===0&&!Y&&r.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:We(pt)}})]},Ce.id)}),u&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":kt,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":Y?"center":"left-y",className:`${c}-control-anchor`,style:{top:mt,left:0,width:"100%",height:We(Math.max(Ke,ta))}})},"row-padding-handles"),u&&!Y&&Xt&&Yt&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx("div",{"data-controls":Xt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(De[0]-((vt==null?void 0:vt.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Ee??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:We(Gt),height:"100%"}}),r.jsx("div",{"data-controls":Yt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(De[nt.length-1]-((xt==null?void 0:xt.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Ee??void 0,className:`${c}-control-anchor`,style:{top:0,left:We(bt-Ft),width:We(Ft),height:"100%"}})]},"column-edge-padding-handles"),u&&!Y&&nt.slice(0,-1).map((Ce,_e)=>{const Qe=nt[_e+1],st=ke.slice(0,_e+1).reduce((Pt,Mt)=>Pt+Mt,0),gt=Ue[_e],Rt=Ue[_e+1],ot=Math.max(gt.paddingRight,Ii),Ot=Math.max(Rt.paddingLeft,Ii);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx("div",{"data-controls":Ce.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(De[_e]-gt.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Ee??void 0,className:`${c}-control-anchor`,style:{top:0,left:We(st-ot),width:We(ot),height:"100%"}}),r.jsx("div",{"data-controls":Qe.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(De[_e+1]-Rt.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Ee??void 0,className:`${c}-control-anchor`,style:{top:0,left:We(st),width:We(Ot),height:"100%"}})]},`${Ce.paddingRightKey}-padding`)}),u&&!Y&&nt.slice(0,-1).map((Ce,_e)=>{const Qe=hf(_e,ke,ve,Be),gt=ke.slice(0,_e+1).reduce((Rt,ot)=>Rt+ot,0)-tl/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":Ce.widthKey,"data-controls-axis":"x","data-controls-min":String(as),"data-controls-max-fraction":String(Qe),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:We(gt),width:We(tl),height:"calc(100%)",pointerEvents:"auto"}})},`${Ce.widthKey}-junction`)})]}),Xe&&(()=>{const Ce=hr(e,An),_e=qh(e.cutLabelVerticalAlign),Qe=Ce.textTextAlign==="justify"||Y;return r.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:We(T??0),cursor:$t?"pointer":"default",..._h(Me,m??0,n??!1)},onClick:$t?dt:void 0,onMouseEnter:H||te?Ct:void 0,onMouseLeave:H?jt:void 0,children:r.jsx("div",{className:`${c}-list-cols-row`,style:{...Y?{paddingLeft:We(pe),paddingRight:We(pe)}:{},justifyContent:Kh(Ce.textTextAlign),alignItems:Zs(_e)},children:r.jsx("span",{className:Qs(e,An,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Js(Ce,n),...el(e,An,c,n),...Qe?{width:"100%"}:{}},children:U})})})})(),te&&$&&(()=>{const Ce=`${$.widthPx}px`,_e={width:Ce,height:"auto",maxHeight:Ce,objectFit:"contain"};return r.jsx("div",{ref:Ie,className:`${c}-hover-media-anchor`,children:r.jsx(Fh,{media:$,className:$.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:_e},`${$.rowId}-${$.url}`)})})()]})})]})}const xf=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
10224
+ `}const Kn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],ss=["AColumn","BColumn","CColumn","DColumn","EColumn"],An="cutLabel",So=[...ss,An],Ar=["A","B","C","D","E"];function Wc(e){return`${e}ColumnVerticalAlign`}const Ea=["Top","Center","Bottom"];function ls(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Ar.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function ff(e){const t=ls(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function yf(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Ar.includes(n)?n:null}function _c(e,t,n){const i=yf(e);return i?i===t?!1:ff(n[Wc(i)]):!0}function $o(e){const t=ls(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Ar.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function vf(e,t,n){if(Hc(e,t,n))return $o(e);const i=$o(e);return i.kind==="baseline"?{kind:"top"}:i}function xf(e){const t=$o(e);return t.kind==="baseline"?{kind:"top"}:t}function Hc(e,t,n){return _c(e,n,t)?$o(e).kind==="baseline":!1}function bf(e){const t={};let n=!1;for(const i of Ar){const o=Wc(i),s=e[o];if(e.type==="b"){const l=String(s??"Top").trim();l!=="Top"&&l!=="Center"&&l!=="Bottom"&&(t[o]="Top",n=!0);continue}_c(s,i,e)||(t[o]="Top",n=!0)}return n?t:null}function wf(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Sf(e){const t=$o(e).kind;return t==="baseline"?"center":t}function $f(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function el(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Cf(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(),s=o-i;return n.remove(),s}function na(e,t,n,i){const o=e.titleEl;if(!o)return 0;const s=o.closest(`.${n}`);if(!s)return 0;const l=Cf(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const d=s.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 Tf(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const s=o.querySelector(`.${n}`);s&&(s.style.minHeight=`${i}px`,s.style.height=`${i}px`)}),i)}function Lf(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Rf={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Et(e,t){return`${e}${t.replace(/^text/,"Text")}`}const If={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function Ef(e){return[Et(e,"textFontFamily"),Et(e,"textFontSettings"),{type:"row",items:[Et(e,"textFontSize"),Et(e,"textLineHeight"),Et(e,"textLetterSpacing"),Et(e,"textWordSpacing")]},Et(e,"textTextAlign"),Et(e,"textTextAppearance"),`${e}VerticalAlign`]}function Mf(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(So.map(e=>[If[e],Ef(e)]))}}function fr(e,t){const n=i=>{const o=Et(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===An?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function tl(e,t){var i,o;const n={fontSettings:{fontFamily:e.textFontFamily,fontWeight:((i=e.textFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e.textFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:e.textFontSize??.01,lineHeight:e.textLineHeight,letterSpacing:e.textLetterSpacing,wordSpacing:e.textWordSpacing,textAlign:e.textTextAlign,textAppearance:e.textTextAppearance,color:e.textColor??"#767676"};return rn(Xt(n,t))}function nl(e,t,n,i){const o=fr(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<s?`${n} ${i}`:n}function il(e,t,n,i){const o=fr(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=s?{}:{[`--${n}-title-leading-gap`]:C.scalingValue((s-l)/2,i)}}const fn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Bi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Vi=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Gi=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Pf={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},kf=["hover","focus","filled","success","error"],ol=.004,Ei=.004,ia=Ei,cs=50,Co=1440,To=cs/Co;function Nc(e){const t=typeof e=="number"&&e>0?e:Co;return cs/t}function Af(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 Co}const Oc={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 Ff(e,t=1){const n=t/e;return Object.fromEntries(fn.map(i=>[i,n]))}function Wf(){return Object.fromEntries([...Bi.map(e=>[e,0]),...Vi.map(e=>[e,0])])}function _f(){return Object.fromEntries(Gi.map(e=>[e,0]))}function Uo(e){return Object.fromEntries(fn.map(t=>[t,typeof e[t]=="number"?e[t]:Oc[t]]))}function Dc(e,t,n){const i=e-To,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const s=i/o;return{paddingLeft:t*s,paddingRight:n*s}}function sr(e,t,n){const i=ds(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((s,l)=>s+l,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function Hf(e,t,n){const i={};for(let o=0;o<e;o+=1){const s=Bi[o],l=Vi[o],d=typeof n[s]=="number"?n[s]:0,c=typeof n[l]=="number"?n[l]:0,u=Dc(t[o]??0,d,c);u.paddingLeft!==d&&(i[s]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function ds(e,t,n){if(e<=0)return[];const i=fn.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)+To;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]-To;if(p<=0)continue;const v=Math.min(c,p);d[u]-=v,c-=v}return[...d,i[e-1]]}function Nf(e,t,n){if(e<=1)return{};const i=ds(e,t,n),o={};for(let s=0;s<e-1;s+=1){const l=fn[s];i[s]!==n[l]&&(o[l]=i[s])}return o}function rl(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Kn]}function Of(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Df(e,t,n,i){const o=Math.min(i,e.length,fn.length),s={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=fn[c],p=Bi[c],v=Vi[c],y=Gi[c],g=fn[l],h=Bi[l],m=Vi[l],b=Gi[l],I=n[u],R=n[p],T=n[v],q=n[y];typeof I=="number"&&(s[g]=I),typeof R=="number"&&(s[h]=R),typeof T=="number"&&(s[m]=T),typeof q=="number"&&(s[b]=q)}return s}function jc(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 jf(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=po(e),s=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...Ff(n,o),...Wf()};if(s)for(const d of Gi)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,_f());return jc(e,l)?l:e}function zf(e,t,n){const i=bf(e);i&&(e={...e,...i});const o=Nc(n==null?void 0:n.designWidth),s=e.columns,l=t.columns,d=po(e),c=po(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof s=="number"?s:typeof l=="number"?l:Kn.length,v=T=>{if(u)return T;const q=Uo({...t,...T}),F=po(T),V=sr(p,F,q),A=Hf(p,V,{...t,...T});return Object.keys(A).length===0?T:{...T,...A}};if(typeof s=="number"&&s!==l)return e;const y=rl(e),g=rl(t);if(!Of(y,g))return v({...e,...Df(y,g,t,p)});if(d<c&&typeof p=="number"&&!u){const T=Uo({...t,...e});return v({...e,...Nf(p,d,T)})}if(u){const T=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,q=Math.max(0,(d-o)/2);return T>q?{...e,textPaddingLR:q}:e}const h=Uo({...t,...e}),m=sr(p,c,Uo(t)),I=sr(p,d,h).some((T,q)=>T<(m[q]??T)),R=fn.some(T=>{const q=e[T],F=t[T];return typeof q=="number"&&typeof F=="number"&&q!==F});return I||R?v(e):e}function Bf(e,t,n,i){const o=t.slice(0,e).reduce((l,d)=>l+d,0),s=n.slice(e+1,t.length-1).reduce((l,d)=>l+d,0);return Math.max(To,i-o-s-To)}function Vf(e,t){return Math.random()*(t-e)+e}function Gf(e){return Object.fromEntries(fn.map(t=>[t,typeof e[t]=="number"?e[t]:Oc[t]]))}function oa(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function qf(e,t,n,i,o,s){return e.slice(0,t).map((l,d)=>{const c=Bi[d],u=Vi[d],p=Gi[d];return{key:l,textPrefix:Rf[l],widthKey:fn[d],width:n[fn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:s[p]}})}function Uf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s,layoutId:l,onUpdateSettings:d}){const{prefix:c}=C.useScopedStyles(),u=!!o,{columns:p,type:v,wrapperWidth:y,entriesCount:g,cellMinHeight:h,dividerWidth:m,showVisibility:b,cut:I,showCut:R,cutCellMinHeight:T,cutLabel:q,imageSize:F,imageOnHover:V,imagePosition:A="cursor",imageInterpolation:L="on",entryHoverEffect:O,entryHoverShowOption:x,rowPaddingTop:W,rowPaddingBottom:E,rowPaddingTopB:J,columnsOrder:P,textPaddingLR:K,textColor:B,backgroundColor:z,dividerColor:ie,textHoverColor:S,backgroundHoverColor:M,dividerHoverColor:D}=e,[le,oe]=a.useState(void 0),[$,ae]=a.useState(null),k=a.useRef(null),te=V==="on"&&(!n||i),X=A==="cursor",ve=X&&L==="on",{anchorRef:Pe,onShow:he,onCursorMove:ce,exit:U}=gf(!!(te&&$!==null),ve),Y=(I??0)>0,Z=v==="b",We=a.useRef(null),$e=a.useRef(null),[ke,de]=a.useState(null),[fe,we]=a.useState(Co),G=Nc(fe),se=Math.max(0,((y??0)-G)/2),pe=Math.min(K??0,se),Se=Math.max(pe,Ei),Me=((y??0)+G)/2;a.useLayoutEffect(()=>{if(!n){we(Co);return}const Te=()=>{we(Af(We.current))};Te();const De=We.current;if(!De)return;const it=new ResizeObserver(Te);it.observe(De);let gt=De;for(;gt&&!gt.style.getPropertyValue("--cntrl-article-width");)gt=gt.parentElement;return gt&&it.observe(gt),()=>it.disconnect()},[n,l]),a.useEffect(()=>{oe(void 0)},[I,R,t,g]),a.useEffect(()=>{n&&!i&&oe(void 0)},[n,i]);const Le=C.buildColorVars(c,{textColor:B,backgroundColor:z,dividerColor:ie,textHoverColor:S,backgroundHoverColor:M,dividerHoverColor:D},Pf,kf),H=s&&s!=="default"?`${c}-state-${s}`:"",re=`${!n||i?O==="default"?`${c}-entry-hover-default`:O==="blinds"?`${c}-entry-hover-blinds`:O==="reveal"?`${c}-entry-hover-reveal`:"":""} ${H}`.trim(),_=O==="reveal"&&(!n||i),ee=(b==null?void 0:b[0])??!1,Ae=(b==null?void 0:b[1])??!1,ue=a.useRef(e),N=a.useRef(l);a.useEffect(()=>{if(!d||!n){ue.current=e,N.current=l;return}if(N.current!==l){ue.current=e,N.current=l;return}const Te=ue.current;if(!(Te!==e))return;if(typeof Te.columns=="number"&&typeof e.columns=="number"&&Te.columns!==e.columns){ue.current=e;return}const it=zf(e,Te,{designWidth:fe});ue.current=e,jc(e,it)&&d(it)},[e,d,n,l,fe]);const Ue=a.useMemo(()=>Gf(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Oe=a.useMemo(()=>oa(e,Bi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),dt=a.useMemo(()=>oa(e,Vi),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),nt=a.useMemo(()=>oa(e,Gi),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),ht=a.useMemo(()=>Array.isArray(P)&&P.length>0?P:[...Kn],[P]),st=a.useMemo(()=>qf(ht,p,Ue,Oe,dt,nt),[ht,p,Ue,Oe,dt,nt]),Be=po(e),xe=a.useMemo(()=>fn.slice(0,p).map(Te=>Ue[Te]),[p,Ue]),Fe=a.useMemo(()=>ds(p,Be,Ue),[p,Be,Ue]),je=a.useMemo(()=>sr(p,Be,Ue),[p,Be,Ue]),Ke=a.useMemo(()=>st.map((Te,De)=>Dc(je[De]??0,Te.paddingLeft,Te.paddingRight)),[st,je]),ne=a.useMemo(()=>{const Te=g===0?1/0:g;return(t??[]).slice(0,Te).map((it,gt)=>({id:gt,cells:Object.fromEntries(Kn.map(ft=>[ft,it[ft]??""])),image:it.image,link:it.link}))},[t,g]),ge=Y?le??I:ne.length,Ie=a.useMemo(()=>Y?ne.slice(0,ge):ne,[ne,Y,ge]),Ge=Y&&ge<ne.length,Ze=Ie.length>1||Ge,Ve=[ee?`${c}-divider-top`:"",Ae||Ze?`${c}-divider-bottom`:""].filter(Boolean).join(" "),at=!n||i,Je=()=>{if(!at)return;const Te=le??I;if(!R){oe(ne.length);return}oe(Math.min(Te+R,ne.length))},Ee=Te=>C.scalingValue(Te,n??!1),qe=Z?J??0:W??0,_e=E??0,tt=h??0,rt=Math.max(_e,ia),lt=Zs(0,Ie.length,ee,Ae,Ge,m??0,n??!1).borderTopWidth,Tt=Z?"rowPaddingTopB":"rowPaddingTop",Ut=st[0],Zt=st[st.length-1],xt=Ke[0],wt=Ke[Ke.length-1],jt=Ut&&xt?Math.max(xt.paddingLeft,Ei):0,At=Zt&&wt?Math.max(wt.paddingRight,Ei):0,vt=Be,Ft=(Te,De)=>mf(A,We.current,X?Te:null,De),_t=(Te,De)=>{if(!te)return;const it=Te.image;if(!(it!=null&&it.url)){U(()=>ae(null));return}const gt=(F==null?void 0:F.min)??80,ft=(F==null?void 0:F.max)??320,It=($==null?void 0:$.rowId)===Te.id,pt=It?$.widthPx:Vf(gt,ft),{x:zt,y:kt}=Ft(De,pt);if(It&&X){ce(zt,kt);return}ae({rowId:Te.id,url:it.url,objectFit:"contain",isVideo:lf(it),widthPx:pt}),k.current={x:zt,y:kt}},Kt=Te=>{if(!te||!$||!X)return;const{x:De,y:it}=Ft(Te,$.widthPx);ce(De,it)},Jt=()=>{$&&U(()=>ae(null))},Ct=Te=>{_&&Ks(Te,c),!(!te||!$)&&U(()=>ae(null))},Ht=Te=>{_&&Ys(Te,c)};a.useLayoutEffect(()=>{if(!$||!k.current)return;const{x:Te,y:De}=k.current;k.current=null,he(Te,De)},[$==null?void 0:$.rowId,$==null?void 0:$.url,he]),a.useLayoutEffect(()=>{if(!u||Z){de(null);return}const Te=$e.current,De=Te==null?void 0:Te.parentElement;if(!Te||!De){de(null);return}const it=()=>{const ft=Te.querySelector("[data-list-row]");if(!ft){de(null);return}const It=De.getBoundingClientRect(),pt=ft.getBoundingClientRect();de(pt.top-It.top+pt.height/2)};it();const gt=new ResizeObserver(it);return gt.observe(Te),gt.observe(De),()=>gt.disconnect()},[u,Z,Ie,qe,_e,tt,t,e,st,je,fe,m,ee,Ae,Ge]);const on=a.useMemo(()=>!Z&&ss.some(Te=>{const De=Te.charAt(0),it=e[`${Te}VerticalAlign`];return Hc(it,e,De)}),[Z,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);a.useLayoutEffect(()=>{var zt;const Te=We.current;if(!Te)return;const De=()=>{Te.querySelectorAll("[data-list-col]").forEach(kt=>{kt.style.transform="";const Pt=kt.querySelector(`.${c}-list-col`);Pt&&(Pt.style.minHeight="",Pt.style.height="");const Vt=kt.querySelector(`.${c}-list-col-title`);Vt&&(Vt.style.transform="")})};if(Z||!on){De();return}const it=()=>{const kt=Array.from(Te.querySelectorAll("[data-list-row]")),Pt=`${c}-list-col`,Vt=`${c}-baseline-probe`;kt.forEach(Gt=>{Gt.querySelectorAll("[data-list-col]").forEach(Nt=>{Nt.style.transform="";const Ot=Nt.querySelector(`.${Pt}`);Ot&&(Ot.style.minHeight="",Ot.style.height="");const Wt=Nt.querySelector(`.${c}-list-col-title`);Wt&&(Wt.style.transform="")})}),kt.forEach(Gt=>{const Nt=Array.from(Gt.querySelectorAll("[data-list-col]"));Tf(Gt,Nt,Pt)}),Te.offsetHeight,kt.forEach(Gt=>{const Nt=Array.from(Gt.querySelectorAll("[data-list-col]")),Ot=Gt.getBoundingClientRect().top,Wt=new Map,St=Nt.map(Re=>{const He=Re.querySelector(`.${c}-list-col-title`),ot={el:Re,titleEl:He,letter:Re.getAttribute("data-col-letter")??"",kind:Re.getAttribute("data-valign")??"top",anchor:Re.getAttribute("data-valign-anchor")};return Wt.set(ot.letter,ot),ot}),w=new Map,be=(Re,He)=>{const ot=w.get(Re.letter);if(ot!==void 0)return ot;const Mt=Re.anchor?Wt.get(Re.anchor):void 0;if(Re.kind!=="baseline"||!Mt||He.has(Re.letter)){const nn=na(Re,Ot,Pt,Vt);return w.set(Re.letter,nn),nn}He.add(Re.letter);const Qe=be(Mt,He);He.delete(Re.letter);const yt=na(Re,Ot,Pt,Vt),Dt=Qe-yt;Lf(Re.titleEl,Dt);const Lt=na(Re,Ot,Pt,Vt);return w.set(Re.letter,Lt),Lt};St.forEach(Re=>be(Re,new Set))})};let gt=null;const ft=()=>{gt===null&&(gt=requestAnimationFrame(()=>{gt=null,it()}))};it();const It=new ResizeObserver(()=>ft());It.observe(Te);let pt=!1;return typeof document<"u"&&((zt=document.fonts)!=null&&zt.ready)&&document.fonts.ready.then(()=>{pt||ft()}),()=>{pt=!0,gt!==null&&(cancelAnimationFrame(gt),gt=null),It.disconnect(),De()}},[on,Z,e,t,fe,Ie,je]);const mt=a.useMemo(()=>hf(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:mt}}),r.jsx("div",{style:Le,children:r.jsxs("div",{ref:We,className:`${c}-wrapper ${re}${Ve?` ${Ve}`:""}${Z?` ${c}-type-b`:""}`.trim(),style:{width:C.scalingValue(y??0,n)},onMouseMove:te?Kt:void 0,onMouseLeave:te?Jt:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[Ie.map((Te,De)=>{var It;const it=(((It=Te.link)==null?void 0:It.length)??0)>0,gt=it&&(!n||i)?"a":"div",ft=Zs(De,Ie.length,ee,Ae,Ge,m??0,n??!1);return r.jsxs(gt,{ref:De===0?pt=>{$e.current=pt}:void 0,className:`${c}-list-item${it||x==="always"?` ${c}-list-item-has-link`:""}${Ge&&De===Ie.length-1?` ${c}-list-item-before-cut`:""}`,...it?{href:Te.link,target:"_blank"}:{},style:ft,onMouseEnter:pt=>{_&&(it||x==="always")&&Ks(pt,c),te&&_t(Te,pt)},onMouseLeave:pt=>{_&&(it||x==="always")&&Ys(pt,c)},children:[qe>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ee(qe)}}),r.jsxs("div",{className:`${c}-list-cols-row${Z?"":` ${c}-list-cols-row-h`}${u&&De===0&&Z?` ${c}-list-cols-row-controls`:""}`,...Z?{}:{"data-list-row":""},style:Z?void 0:{minHeight:Ee(tt)},children:[st.map((pt,zt)=>{const kt=zt===st.length-1,Pt=Ke[zt],Vt=pt.paddingBottom,Gt=df(Te.cells[pt.key]),Nt=Z&&Gt&&Vt>0,Ot=Z?{minHeight:Ee(tt)}:{width:Ee(je[zt])},Wt=Z?{paddingLeft:Ee(pe),paddingRight:Ee(pe)}:{paddingLeft:Ee(Pt.paddingLeft),paddingRight:Ee(Pt.paddingRight)},St=pt.textPrefix.charAt(0),w=Z?xf(e[`${pt.textPrefix}VerticalAlign`]):vf(e[`${pt.textPrefix}VerticalAlign`],e,St),be=Z&&Gt&&u&&De===0;return Z&&!Gt?null:r.jsxs("div",{className:Z?`${c}-list-col-wrap`:void 0,...Z?{}:{"data-list-col":"","data-col-letter":St,"data-valign":w.kind,...w.kind==="baseline"?{"data-valign-anchor":w.anchorLetter}:{}},children:[r.jsx("div",{className:`${c}-list-col${kt?` ${c}-list-col-last`:""}`,style:{...Wt,...Ot,...Z?{justifyContent:el(w.kind)}:{}},"data-test":pt.width,children:r.jsx("span",{className:nl(e,pt.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...tl(fr(e,pt.textPrefix),n),...il(e,pt.textPrefix,c,n),...Z?{}:wf(w.kind)},children:Te.cells[pt.key]??null})}),Nt&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ee(Vt)}}),be&&r.jsx("div",{"data-controls":pt.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:Ee(Math.max(Vt,ia))}})]},pt.key)}),u&&De===0&&Z&&r.jsxs(r.Fragment,{children:[r.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:Ee(Se),height:"100%"}}),r.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:Ee(Math.max(Se,Be-Se)),width:Ee(Se),height:"100%"}})]})]}),!Z&&_e>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ee(_e)}}),u&&De===0&&!Z&&r.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:Ee(rt)}})]},Te.id)}),u&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":Tt,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":Z?"center":"left-y",className:`${c}-control-anchor`,style:{top:lt,left:0,width:"100%",height:Ee(Math.max(qe,ia))}})},"row-padding-handles"),u&&!Z&&Ut&&Zt&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx("div",{"data-controls":Ut.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(je[0]-((xt==null?void 0:xt.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ke??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:Ee(jt),height:"100%"}}),r.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[st.length-1]-((wt==null?void 0:wt.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ke??void 0,className:`${c}-control-anchor`,style:{top:0,left:Ee(vt-At),width:Ee(At),height:"100%"}})]},"column-edge-padding-handles"),u&&!Z&&st.slice(0,-1).map((Te,De)=>{const it=st[De+1],gt=Fe.slice(0,De+1).reduce((kt,Pt)=>kt+Pt,0),ft=Ke[De],It=Ke[De+1],pt=Math.max(ft.paddingRight,Ei),zt=Math.max(It.paddingLeft,Ei);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx("div",{"data-controls":Te.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(je[De]-ft.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ke??void 0,className:`${c}-control-anchor`,style:{top:0,left:Ee(gt-pt),width:Ee(pt),height:"100%"}}),r.jsx("div",{"data-controls":it.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(je[De+1]-It.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ke??void 0,className:`${c}-control-anchor`,style:{top:0,left:Ee(gt),width:Ee(zt),height:"100%"}})]},`${Te.paddingRightKey}-padding`)}),u&&!Z&&st.slice(0,-1).map((Te,De)=>{const it=Bf(De,Fe,xe,Be),ft=Fe.slice(0,De+1).reduce((It,pt)=>It+pt,0)-ol/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":Te.widthKey,"data-controls-axis":"x","data-controls-min":String(cs),"data-controls-max-fraction":String(it),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Ee(ft),width:Ee(ol),height:"calc(100%)",pointerEvents:"auto"}})},`${Te.widthKey}-junction`)})]}),Ge&&(()=>{const Te=fr(e,An),De=Sf(e.cutLabelVerticalAlign),it=Te.textTextAlign==="justify"||Z;return r.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Ee(T??0),cursor:at?"pointer":"default",...uf(Ae,m??0,n??!1)},onClick:at?Je:void 0,onMouseEnter:_||te?Ct:void 0,onMouseLeave:_?Ht:void 0,children:r.jsx("div",{className:`${c}-list-cols-row`,style:{...Z?{paddingLeft:Ee(pe),paddingRight:Ee(pe)}:{},justifyContent:$f(Te.textTextAlign),alignItems:el(De)},children:r.jsx("span",{className:nl(e,An,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...tl(Te,n),...il(e,An,c,n),...it?{width:"100%"}:{}},children:q})})})})(),te&&$&&(()=>{const Te=`${$.widthPx}px`,De={width:Te,height:"auto",maxHeight:Te,objectFit:"contain"};return r.jsx("div",{ref:Pe,className:`${c}-hover-media-anchor`,children:r.jsx(cf,{media:$,className:$.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:De},`${$.rowId}-${$.url}`)})})()]})})]})}const Xf=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
9255
10225
  import { CommonComponentProps } from '../props';
9256
10226
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
9257
10227
  import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
@@ -12339,7 +13309,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
12339
13309
  </>
12340
13310
  );
12341
13311
  }
12342
- `,Ji=["A","B","C","D","E"],il=[...La,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],ri={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 wf(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function qo(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function Sf(){return Object.fromEntries(Ji.map((e,t)=>{const n=Xn[t],i=`${e} column`;return[n,wf(i)]}))}function $f(){const e={};for(const t of Ji)e[`${t}ColumnWidth`]=qo(`${t} column width`),e[`${t}ColumnPaddingLeft`]=qo(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=qo(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=qo(`${t} column padding bottom`);return e}function ol(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Xn]};for(const s of Ji)i[`${s}ColumnWidth`]=s==="A"?.0798:.32,i[`${s}ColumnPaddingLeft`]=0,i[`${s}ColumnPaddingRight`]=0,i[`${s}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function Cf(e){const t={};if(e===An)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...La]},enum:[...La]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...il],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...il]}}return t[It(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[It(e,"textFontSettings")]={...ri.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[It(e,"textFontSize")]={...ri.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[It(e,"textLineHeight")]={...ri.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[It(e,"textLetterSpacing")]={...ri.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[It(e,"textWordSpacing")]={...ri.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[It(e,"textTextAlign")]={...ri.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[It(e,"textTextAppearance")]={...ri.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const Tf=wo.reduce((e,t)=>({...e,...Cf(t)}),{});function Lf(e){return{verticalAlign:e===An?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===An?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function Rf(e,t={}){var n;return{...Lf(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const rl=new Set(["textFontFamily","textFontSettings"]);function If(e,t,n){const i=s=>n===void 0?!0:n==="common"?rl.has(s):!rl.has(s),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=rs(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[It(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[It(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[It(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[It(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[It(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[It(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[It(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[It(e,"textTextAppearance")]=t.textTextAppearance),o}function sr(e={},t){return wo.reduce((n,i)=>({...n,...If(i,Rf(i,e),t)}),{})}const Ef=sr(),Mf=tf();function Oc(e){return[It(e,"textFontFamily"),It(e,"textFontSettings"),It(e,"textFontSize"),It(e,"textLineHeight"),It(e,"textLetterSpacing"),It(e,"textWordSpacing"),It(e,"textTextAlign"),It(e,"textTextAppearance"),`${e}VerticalAlign`]}function Pf(){const e=[];return os.forEach((t,n)=>{const i=Xn[n],o=Oc(t);for(let s=1;s<Xn.length;s+=1){const l=[{name:"columns",value:s},...Array.from({length:s},(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 kf=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Oc(An);const Af=[...Ji.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],ai=[{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"}],Ff=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:ai[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:ai[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:ai[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:ai[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:ai[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:ai[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:ai[6],link:""}],Wf=[...Ji.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],_f={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:{...Sf(),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:Ff},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"}},...$f(),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"}},...Tf,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",...Ef,...sr({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:ol({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},...sr({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:ol({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},...sr({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...Pf(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...Af.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}},...Ji.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",...Wf]},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__",Mf]}],paletteBookmark:{items:[...kf],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Hf={element:bf,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>mf(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:[...wo.map(e=>({path:`${It(e,"textFontFamily")}`}))]},fontRelations:{...wo.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${It(t,"textFontFamily")}`}),{})},schema:_f,sourceCode:xf},al=300,Nn=.004,Nf={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"},Of=["hover","focus","filled","success","error"];function Df(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function sl(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function ll(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:S.scalingValue((o-t)/2,i)}}function jf(e){return`
13312
+ `,Qi=["A","B","C","D","E"],al=[...Ea,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],ri={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 Kf(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function Xo(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function Yf(){return Object.fromEntries(Qi.map((e,t)=>{const n=Kn[t],i=`${e} column`;return[n,Kf(i)]}))}function Zf(){const e={};for(const t of Qi)e[`${t}ColumnWidth`]=Xo(`${t} column width`),e[`${t}ColumnPaddingLeft`]=Xo(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=Xo(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=Xo(`${t} column padding bottom`);return e}function sl(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Kn]};for(const s of Qi)i[`${s}ColumnWidth`]=s==="A"?.0798:.32,i[`${s}ColumnPaddingLeft`]=0,i[`${s}ColumnPaddingRight`]=0,i[`${s}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function Jf(e){const t={};if(e===An)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Ea]},enum:[...Ea]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...al],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...al]}}return t[Et(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Et(e,"textFontSettings")]={...ri.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Et(e,"textFontSize")]={...ri.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Et(e,"textLineHeight")]={...ri.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Et(e,"textLetterSpacing")]={...ri.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Et(e,"textWordSpacing")]={...ri.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Et(e,"textTextAlign")]={...ri.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Et(e,"textTextAppearance")]={...ri.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const Qf=So.reduce((e,t)=>({...e,...Jf(t)}),{});function ey(e){return{verticalAlign:e===An?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===An?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function ty(e,t={}){var n;return{...ey(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const ll=new Set(["textFontFamily","textFontSettings"]);function ny(e,t,n){const i=s=>n===void 0?!0:n==="common"?ll.has(s):!ll.has(s),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=ls(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Et(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Et(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Et(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Et(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Et(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Et(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Et(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Et(e,"textTextAppearance")]=t.textTextAppearance),o}function lr(e={},t){return So.reduce((n,i)=>({...n,...ny(i,ty(i,e),t)}),{})}const iy=lr(),oy=Mf();function zc(e){return[Et(e,"textFontFamily"),Et(e,"textFontSettings"),Et(e,"textFontSize"),Et(e,"textLineHeight"),Et(e,"textLetterSpacing"),Et(e,"textWordSpacing"),Et(e,"textTextAlign"),Et(e,"textTextAppearance"),`${e}VerticalAlign`]}function ry(){const e=[];return ss.forEach((t,n)=>{const i=Kn[n],o=zc(t);for(let s=1;s<Kn.length;s+=1){const l=[{name:"columns",value:s},...Array.from({length:s},(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 ay=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];zc(An);const sy=[...Qi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],ai=[{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"}],ly=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:ai[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:ai[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:ai[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:ai[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:ai[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:ai[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:ai[6],link:""}],cy=[...Qi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],dy={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:{...Yf(),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:ly},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"}},...Zf(),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"}},...Qf,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",...iy,...lr({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:sl({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},...lr({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:sl({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},...lr({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...ry(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...sy.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}},...Qi.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",...cy]},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__",oy]}],paletteBookmark:{items:[...ay],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},uy={element:Uf,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>jf(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:[...So.map(e=>({path:`${Et(e,"textFontFamily")}`}))]},fontRelations:{...So.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Et(t,"textFontFamily")}`}),{})},schema:dy,sourceCode:Xf},cl=300,Nn=.004,py={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"},my=["hover","focus","filled","success","error"];function gy(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function dl(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function ul(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:C.scalingValue((o-t)/2,i)}}function hy(e){return`
12343
13313
  .${e}-wrapper {
12344
13314
  box-sizing: border-box;
12345
13315
  display: flex;
@@ -12401,7 +13371,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
12401
13371
  display: flex;
12402
13372
  align-items: center;
12403
13373
  justify-content: space-between;
12404
- gap: ${Df(20)};
13374
+ gap: ${gy(20)};
12405
13375
  width: 100%;
12406
13376
  min-width: 0;
12407
13377
  min-height: var(--${e}-question-min-height, unset);
@@ -12429,7 +13399,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
12429
13399
  width: var(--${e}-icon-max-width);
12430
13400
  height: var(--${e}-icon-max-width);
12431
13401
  position: relative;
12432
- transition: transform ${al}ms ease;
13402
+ transition: transform ${cl}ms ease;
12433
13403
  }
12434
13404
  .${e}-icon-custom {
12435
13405
  display: flex;
@@ -12466,7 +13436,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
12466
13436
  .${e}-panel {
12467
13437
  display: grid;
12468
13438
  grid-template-rows: 0fr;
12469
- transition: grid-template-rows ${al}ms ease;
13439
+ transition: grid-template-rows ${cl}ms ease;
12470
13440
  }
12471
13441
  .${e}-item-open .${e}-panel {
12472
13442
  grid-template-rows: 1fr;
@@ -12504,7 +13474,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
12504
13474
  pointer-events: none;
12505
13475
  z-index: 2;
12506
13476
  }
12507
- `}function cl(e,t,n,i,o,s,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:s??0,textAppearance:l,color:d??"#000000"}}function zf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s}){const{prefix:l}=S.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:x="solid",entryHoverEffect:v="default",autoclose:f="off",icon:h,iconMaxWidth:m=.00833,iconPaddingRight:b=0,iconAnimation:I="rotate 45",questionColor:R="#000000",answerColor:T="#000000",dividerColor:U="#0000001F",iconColor:A="#000000",questionHoverColor:B="#666666",iconHoverColor:P="#666666",iconActiveColor:L="#000000",dividerHoverColor:j="#000000",questionFontFamily:w,questionFontSettings:W,questionFontSize:E,questionLineHeight:J,questionLetterSpacing:F,questionWordSpacing:X,questionTextAppearance:G,answerFontFamily:V,answerFontSettings:ie,answerFontSize:C,answerLineHeight:M,answerLetterSpacing:O,answerWordSpacing:re,answerTextAppearance:ne,questionPaddingLeft:$=0,questionPaddingTop:ae=0,questionPaddingBottom:k=0,answerPaddingLeft:te=0,answerPaddingRight:K=0,answerPaddingTop:fe=0,answerPaddingBottom:Ie=0}=e,me=t??[],[ue,q]=a.useState(()=>new Set),Q=!n||i;a.useEffect(()=>{q(new Set)},[f]),a.useEffect(()=>{n&&!o&&!i&&q(new Set)},[n,o,i]);const Y=Ue=>S.scalingValue(Ue,n??!1),Ae=Math.max($,Nn),Se=Math.max(ae,Nn),Ee=Math.max(k,Nn),de=Math.max(te,Nn),ge=Math.max(K,Nn),be=Math.max(fe,Nn),z=Math.max(Ie,Nn),se=Math.max(0,(c??1)-b-m),pe=Math.max(0,(c??1)-K),xe=Math.max(0,(c??1)-te),Re=Math.max(b,Nn),Te=Math.max(0,(c??1)-$-m),_=a.useMemo(()=>ue.size===0?0:Math.min(...ue),[ue]),he=a.useCallback(Ue=>ue.has(Ue),[ue]),oe=Q&&v==="default"?`${l}-entry-hover-default`:"",H=h??"",ee=H!=="",Me=I.replace(/^rotate /,""),le=`${l}-icon-anim-${Me}`,D=on(qt(cl(w,W,E,J,F,X,G,R),n)),Ve=on(qt(cl(V,ie,C,M,O,re,ne,T),n)),Oe=sl(E,J,`${l}-question`,`${l}-text-tight-leading`),lt=sl(C,M,`${l}-answer-text`,`${l}-text-tight-leading`),tt=ll(E,J,l,n),ht=ll(C,M,l,n),nt=S.buildColorVars(l,{questionColor:R,answerColor:T,dividerColor:U,iconColor:A,questionHoverColor:B,iconHoverColor:P,iconActiveColor:L,dividerHoverColor:j},Nf,Of),Be=s&&s!=="default"?`${l}-state-${s}`:"",ve=a.useCallback(Ue=>{Q&&q($e=>{if($e.has(Ue)){const ze=new Set($e);return ze.delete(Ue),ze}if(f==="on")return new Set([Ue]);const He=new Set($e);return He.add(Ue),He})},[Q,f]),ke=a.useMemo(()=>jf(l),[l]),De={[`--${l}-divider-width`]:S.scalingValue(p,n??!1),[`--${l}-divider-style`]:x,[`--${l}-icon-max-width`]:S.scalingValue(m,n??!1),...u>0?{[`--${l}-question-min-height`]:S.scalingValue(u,n??!1)}:{}};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ke}}),r.jsx("div",{style:nt,children:r.jsx("div",{className:rt(`${l}-wrapper`,n&&!i&&`${l}-editor`,oe,Be),style:{width:S.scalingValue(c,n??!1),maxWidth:"100%",...De},children:me.map((Ue,$e)=>{var $t;const He=he($e),ze=(($t=Ue.question)==null?void 0:$t.trim())??"",Xe=Ue.answer,ct=((Xe==null?void 0:Xe.length)??0)>0,Je=d&&$e===_;return r.jsxs("div",{className:rt(`${l}-item`,He&&`${l}-item-open`),"data-faq-item":"",children:[r.jsxs("div",{className:`${l}-question-controls`,children:[Je&&r.jsxs(r.Fragment,{children:[r.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:Y(Se)}}),r.jsx("div",{"data-controls":"questionPaddingLeft","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:Y(Ae),height:"100%"}}),r.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(Te),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:Y(Re),height:"100%"}})]}),r.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":He,style:{...D,...tt,paddingLeft:Y($),paddingRight:Y(b)},onClick:()=>ve($e),children:[ae>0&&r.jsx("span",{className:`${l}-padding-handle`,style:{height:Y(ae)},"aria-hidden":"true"}),r.jsxs("span",{className:`${l}-question-row`,children:[r.jsx("span",{className:Oe,children:ze}),ct&&(ee?r.jsx("span",{className:`${l}-icon ${l}-icon-custom ${le}`,"aria-hidden":"true",children:r.jsx(rn,{url:H,fill:`var(--${l}-icon-color)`,hoverFill:`var(--${l}-icon-hover-color, var(--${l}-icon-color))`,className:`${l}-icon-image`})}):r.jsx("span",{className:`${l}-icon ${l}-icon-default ${le}`,"aria-hidden":"true"}))]}),k>0&&r.jsx("span",{className:`${l}-padding-handle`,style:{height:Y(k)},"aria-hidden":"true"})]}),Je&&r.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:Y(Ee)}})]}),ct&&Xe&&r.jsx("div",{className:`${l}-panel`,"aria-hidden":!He,children:r.jsx("div",{className:`${l}-panel-inner`,children:r.jsxs("div",{className:`${l}-answer-controls`,children:[Je&&He&&r.jsxs(r.Fragment,{children:[r.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:Y(be)}}),r.jsx("div",{"data-controls":"answerPaddingLeft","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-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:Y(de),height:"100%"}}),r.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(xe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:Y(ge),height:"100%"}})]}),fe>0&&r.jsx("div",{className:`${l}-padding-handle`,style:{height:Y(fe)}}),r.jsx("div",{className:`${l}-answer`,style:{...Ve,...ht,paddingLeft:Y(te),paddingRight:Y(K)},children:r.jsx("div",{className:lt,children:r.jsx(yi,{content:Xe})})}),Ie>0&&r.jsx("div",{className:`${l}-padding-handle`,style:{height:Y(Ie)}}),Je&&He&&r.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:Y(z)}})]})})})]},$e)})})})]})}const Bf=`import { useCallback, useEffect, useMemo, useState } from 'react';
13477
+ `}function pl(e,t,n,i,o,s,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:s??0,textAppearance:l,color:d??"#000000"}}function fy({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s}){const{prefix:l}=C.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:v="solid",entryHoverEffect:y="default",autoclose:g="off",icon:h,iconMaxWidth:m=.00833,iconPaddingRight:b=0,iconAnimation:I="rotate 45",questionColor:R="#000000",answerColor:T="#000000",dividerColor:q="#0000001F",iconColor:F="#000000",questionHoverColor:V="#666666",iconHoverColor:A="#666666",iconActiveColor:L="#000000",dividerHoverColor:O="#000000",questionFontFamily:x,questionFontSettings:W,questionFontSize:E,questionLineHeight:J,questionLetterSpacing:P,questionWordSpacing:K,questionTextAppearance:B,answerFontFamily:z,answerFontSettings:ie,answerFontSize:S,answerLineHeight:M,answerLetterSpacing:D,answerWordSpacing:le,answerTextAppearance:oe,questionPaddingLeft:$=0,questionPaddingTop:ae=0,questionPaddingBottom:k=0,answerPaddingLeft:te=0,answerPaddingRight:X=0,answerPaddingTop:ve=0,answerPaddingBottom:Pe=0}=e,he=t??[],[ce,U]=a.useState(()=>new Set),Y=!n||i;a.useEffect(()=>{U(new Set)},[g]),a.useEffect(()=>{n&&!o&&!i&&U(new Set)},[n,o,i]);const Z=Ke=>C.scalingValue(Ke,n??!1),We=Math.max($,Nn),$e=Math.max(ae,Nn),ke=Math.max(k,Nn),de=Math.max(te,Nn),fe=Math.max(X,Nn),we=Math.max(ve,Nn),G=Math.max(Pe,Nn),se=Math.max(0,(c??1)-b-m),pe=Math.max(0,(c??1)-X),Se=Math.max(0,(c??1)-te),Me=Math.max(b,Nn),Le=Math.max(0,(c??1)-$-m),H=a.useMemo(()=>ce.size===0?0:Math.min(...ce),[ce]),ye=a.useCallback(Ke=>ce.has(Ke),[ce]),re=Y&&y==="default"?`${l}-entry-hover-default`:"",_=h??"",ee=_!=="",Ae=I.replace(/^rotate /,""),ue=`${l}-icon-anim-${Ae}`,N=rn(Xt(pl(x,W,E,J,P,K,B,R),n)),Ue=rn(Xt(pl(z,ie,S,M,D,le,oe,T),n)),Oe=dl(E,J,`${l}-question`,`${l}-text-tight-leading`),dt=dl(S,M,`${l}-answer-text`,`${l}-text-tight-leading`),nt=ul(E,J,l,n),ht=ul(S,M,l,n),st=C.buildColorVars(l,{questionColor:R,answerColor:T,dividerColor:q,iconColor:F,questionHoverColor:V,iconHoverColor:A,iconActiveColor:L,dividerHoverColor:O},py,my),Be=s&&s!=="default"?`${l}-state-${s}`:"",xe=a.useCallback(Ke=>{Y&&U(ne=>{if(ne.has(Ke)){const Ie=new Set(ne);return Ie.delete(Ke),Ie}if(g==="on")return new Set([Ke]);const ge=new Set(ne);return ge.add(Ke),ge})},[Y,g]),Fe=a.useMemo(()=>hy(l),[l]),je={[`--${l}-divider-width`]:C.scalingValue(p,n??!1),[`--${l}-divider-style`]:v,[`--${l}-icon-max-width`]:C.scalingValue(m,n??!1),...u>0?{[`--${l}-question-min-height`]:C.scalingValue(u,n??!1)}:{}};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Fe}}),r.jsx("div",{style:st,children:r.jsx("div",{className:ut(`${l}-wrapper`,n&&!i&&`${l}-editor`,re,Be),style:{width:C.scalingValue(c,n??!1),maxWidth:"100%",...je},children:he.map((Ke,ne)=>{var at;const ge=ye(ne),Ie=((at=Ke.question)==null?void 0:at.trim())??"",Ge=Ke.answer,Ze=((Ge==null?void 0:Ge.length)??0)>0,Ve=d&&ne===H;return r.jsxs("div",{className:ut(`${l}-item`,ge&&`${l}-item-open`),"data-faq-item":"",children:[r.jsxs("div",{className:`${l}-question-controls`,children:[Ve&&r.jsxs(r.Fragment,{children:[r.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:Z($e)}}),r.jsx("div",{"data-controls":"questionPaddingLeft","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:Z(We),height:"100%"}}),r.jsx("div",{"data-controls":"iconPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Le),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:Z(Me),height:"100%"}})]}),r.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":ge,style:{...N,...nt,paddingLeft:Z($),paddingRight:Z(b)},onClick:()=>xe(ne),children:[ae>0&&r.jsx("span",{className:`${l}-padding-handle`,style:{height:Z(ae)},"aria-hidden":"true"}),r.jsxs("span",{className:`${l}-question-row`,children:[r.jsx("span",{className:Oe,children:Ie}),Ze&&(ee?r.jsx("span",{className:`${l}-icon ${l}-icon-custom ${ue}`,"aria-hidden":"true",children:r.jsx(an,{url:_,fill:`var(--${l}-icon-color)`,hoverFill:`var(--${l}-icon-hover-color, var(--${l}-icon-color))`,className:`${l}-icon-image`})}):r.jsx("span",{className:`${l}-icon ${l}-icon-default ${ue}`,"aria-hidden":"true"}))]}),k>0&&r.jsx("span",{className:`${l}-padding-handle`,style:{height:Z(k)},"aria-hidden":"true"})]}),Ve&&r.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:Z(ke)}})]}),Ze&&Ge&&r.jsx("div",{className:`${l}-panel`,"aria-hidden":!ge,children:r.jsx("div",{className:`${l}-panel-inner`,children:r.jsxs("div",{className:`${l}-answer-controls`,children:[Ve&&ge&&r.jsxs(r.Fragment,{children:[r.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:Z(we)}}),r.jsx("div",{"data-controls":"answerPaddingLeft","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-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:Z(de),height:"100%"}}),r.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:Z(fe),height:"100%"}})]}),ve>0&&r.jsx("div",{className:`${l}-padding-handle`,style:{height:Z(ve)}}),r.jsx("div",{className:`${l}-answer`,style:{...Ue,...ht,paddingLeft:Z(te),paddingRight:Z(X)},children:r.jsx("div",{className:dt,children:r.jsx(yi,{content:Ge})})}),Pe>0&&r.jsx("div",{className:`${l}-padding-handle`,style:{height:Z(Pe)}}),Ve&&ge&&r.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:Z(G)}})]})})})]},ne)})})})]})}const yy=`import { useCallback, useEffect, useMemo, useState } from 'react';
12508
13478
  import cn from 'classnames';
12509
13479
  import { CommonComponentProps } from '../props';
12510
13480
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
@@ -13252,7 +14222,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
13252
14222
  </>
13253
14223
  );
13254
14224
  }
13255
- `;function On(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const dl={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Vf=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Gf={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:On("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:{...dl.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:{...dl.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:On("Question Padding Left"),questionPaddingTop:On("Question Padding Top"),questionPaddingBottom:On("Question Padding Bottom"),answerPaddingLeft:On("Answer Padding Left"),answerPaddingRight:On("Answer Padding Right"),answerPaddingTop:On("Answer Padding Top"),answerPaddingBottom:On("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:[...Vf],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Uf={element:zf,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:Gf,sourceCode:Bf},Fn=e=>e.display==="cover",Ar=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},ul=100,qf=.2,pl=8,Dc=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,s]=a.useState(0),[l,d]=a.useState(!1),c=a.useRef(null),u=a.useRef(0);u.current=o;const p=a.useMemo(()=>typeof window>"u"?ul:Math.max(ul,window.innerHeight*qf),[]),x=a.useCallback(w=>Math.max(0,1-w/(p*1.5)),[p]),v=a.useCallback(w=>Math.max(0,1-w/(p*.45)),[p]),f=a.useCallback(w=>{const W=typeof window<"u"?window.innerHeight:800,E=Math.max(.88,1-w/W*.12);return`translateY(${w}px) scale(${E})`},[]),h=a.useCallback(()=>{c.current=null},[]),m=a.useCallback(()=>{d(!0),s(0),window.setTimeout(()=>d(!1),n),h()},[n,h]),b=a.useCallback(()=>{const w=typeof window<"u"?window.innerHeight:800;d(!0),s(w),window.setTimeout(()=>{t(),h(),d(!1)},Math.min(n,200))},[n,t,h]),I=a.useCallback(w=>{!e||l||w.pointerType==="touch"&&(i!=null&&i(w.target)||(c.current={startX:w.clientX,startY:w.clientY,isLocked:null,pointerId:w.pointerId}))},[e,l,i]),R=a.useCallback(w=>{const W=c.current;if(!e||!W||w.pointerType!=="touch"||W.pointerId!==w.pointerId)return;const E=w.clientX-W.startX,J=w.clientY-W.startY;if(W.isLocked===null){if(Math.abs(E)<pl&&Math.abs(J)<pl)return;if(J>0&&J>Math.abs(E))W.isLocked=!0,w.currentTarget.setPointerCapture(w.pointerId);else{W.isLocked=!1,h();return}}if(!W.isLocked)return;w.preventDefault();const F=Math.max(0,J);u.current=F,s(F)},[e,h]),T=a.useCallback(w=>{const W=c.current;if(!e||!W||w.pointerType!=="touch"||W.pointerId!==w.pointerId)return;const E=W.isLocked===!0;if(w.currentTarget.hasPointerCapture(w.pointerId)&&w.currentTarget.releasePointerCapture(w.pointerId),!E){h();return}w.clientY-W.startY>=p?b():m()},[p,b,e,h,m]),U=a.useCallback(w=>{T(w)},[T]),A=a.useCallback(w=>{T(w)},[T]),B=o>0,P=l?`transform ${n}ms ease`:"none",L=l?`opacity ${n}ms ease`:"none",j=o>0||l;return{isSwipeDragging:B,backdropStyle:{opacity:x(o),transition:L},mediaAreaStyle:{transform:f(o),transition:P,touchAction:B?"none":void 0,willChange:B?"transform":void 0},overlayContentStyle:j?{opacity:v(o),transition:L}:void 0,swipeHandlers:e?{onPointerDown:I,onPointerMove:R,onPointerUp:U,onPointerCancel:A}:{},dismissAreaStyle:e?{touchAction:B?"none":"pan-x"}:void 0}},Kf="[data-lightbox-scrollable]",jc=()=>{a.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,s=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(Kf)||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=s,window.scrollTo({top:e,left:0,behavior:"instant"})}},[])},Xf=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Yf=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Zf=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Jf=(e,t,n,{duration:i,easing:o,onComplete:s})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(h,m)=>{Yf(t),e.scrollLeft=h,m&&(s==null||s())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,x=0;const v=()=>{t.removeEventListener("transitionend",f),clearTimeout(x)},f=h=>{h.target!==t||h.propertyName!=="transform"||p||(p=!0,v(),u(n,!0))};return t.addEventListener("transitionend",f),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,v(),u(n,!0))},i+64),()=>{p||(p=!0,v(),u(l-Zf(t),!1))}},po=300,Qf=900,ey=1500,ty="cubic-bezier(0.16, 1, 0.3, 1)",ny=3e3,iy=2,oy=16,ry=.05,ay=1,Ko=.3,sy=50,ly=20,Si=.004,Gi=["title1","title2","title3"],cy={title1:"1",title2:"2",title3:"3"},dy={title1:"title1Color",title2:"title2Color",title3:"title3Color"},uy={title1:.02,title2:.02,title3:.02},Xo=e=>`max(${e}, ${ly}px)`,py=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]}},my=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=py(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Dt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,gy=e=>[Dt(e,"fontFamily"),Dt(e,"fontSettings"),{type:"row",items:[Dt(e,"fontSize"),Dt(e,"lineHeight"),Dt(e,"letterSpacing"),Dt(e,"wordSpacing")]},Dt(e,"textAlign"),Dt(e,"textAppearance")],hy=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Gi.map(e=>[cy[e],gy(e)]))}),ls=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,l)=>s+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:l},d)=>{if(s<=0||d<=0)return{overflow:s,widths:[d,...l]};const c=Math.min(s,d);return{overflow:s-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},zc=(e,t)=>ls(e,t),Yo=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},ml=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:ls(e.length,n),effective:zc(e.length,n)}},fy=(e,t,n,i,o,s,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:s,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:l,text:i}),d},ia=(e,t)=>{const n=i=>{const o=Dt(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[dy[t]]}},yy=(e,t,n,i)=>e.slice(0,i).reduce((o,s,l)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[l]??0),0),oa=(e,t,n)=>{var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??uy[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return qt(i,n)},vy=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:x,closeIcon:v,closeIconMaxWidth:f,closeIconColor:h,closeIconHoverColor:m,thumbnailTrigger:b,thumbnailVisibility:I,thumbnailObjectFit:R,thumbnailActive:T,thumbnailActiveColor:U,title1Width:A,title2Width:B,title3Width:P,title1MarginLeft:L=0,title2MarginLeft:j=0,title3MarginLeft:w=0,titleRowMarginBottom:W=0,titleHeaderLayout:E="desktop",contentMarginTop:J,iconMarginLeft:F}=n,X=g=>S.scalingValue(g,i??!1),G=c??n.thumnailSize??.03,V=X(G),ie=X(u),C=X(p??.02),M=X(x??0),O=X(J??0),re=Xo(O),ne=X(F??0),[$,ae]=a.useState(0),k=a.useRef($);k.current=$;const te=t[$],{title1:K,title2:fe,title3:Ie}=my(te),me=oa("title1",ia(n,"title1"),i),ue=oa("title2",ia(n,"title2"),i),q=oa("title3",ia(n,"title3"),i),Q=E==="mobile",Y=!o&&(!i||s),Ae=Y,Se=Y,Ee=Y,de=Fn(R),ge=de?{"--image-aspect-ratio":Ar(R)}:void 0,be=!!(K||fe||Ie),z=a.useMemo(()=>fy(e,K,fe,Ie,me,ue,q),[e,$,K,fe,Ie,me,ue,q]),se=a.useMemo(()=>({title1Width:A,title2Width:B,title3Width:P}),[A,B,P]),pe=a.useMemo(()=>z.map(g=>se[g.widthKey]),[z,se]),xe=a.useMemo(()=>ls(z.length,pe),[z.length,pe]),Re=a.useMemo(()=>zc(z.length,pe),[z.length,pe]),Te=a.useMemo(()=>z.filter(g=>g.prefix==="title1"),[z]),_=a.useMemo(()=>z.filter(g=>g.prefix==="title2"||g.prefix==="title3"),[z]),he=a.useMemo(()=>ml(Te,se),[Te,se]),oe=a.useMemo(()=>ml(_,se),[_,se]),H=a.useCallback((g,N)=>{const Z=z.indexOf(g);if(!Q||N==="single-row")return{effectiveWidth:Re[Z]??0,resolvedWidth:xe[Z]??0,maxWidth:Yo(Z,xe)};if(N==="two-row-top"){const Fe=Te.indexOf(g);return{effectiveWidth:he.effective[Fe]??0,resolvedWidth:he.resolved[Fe]??0,maxWidth:Yo(Fe,he.resolved)}}const we=_.indexOf(g);return{effectiveWidth:oe.effective[we]??0,resolvedWidth:oe.resolved[we]??0,maxWidth:Yo(we,oe.resolved)}},[_,oe,Re,xe,z,Te,he,Q]),ee=a.useCallback(g=>S.scalingValue(g,i??!1),[i]),Me=ee(W??0),le=a.useMemo(()=>({title1MarginLeft:L,title2MarginLeft:j,title3MarginLeft:w}),[L,j,w]),D=a.useCallback(g=>z.slice(0,g+1).reduce((N,Z,we)=>N+(Z!=null&&Z.marginLeftKey?le[Z.marginLeftKey]??0:0)+(xe[we]??0),0)+(Q?0:L??0),[z,le,xe,Q,L]),Ve=a.useCallback(()=>Q?0:L??0,[Q,L]),Oe=a.useCallback(g=>_.slice(0,g).reduce((N,Z,we)=>N+(Z.marginLeftKey?le[Z.marginLeftKey]??0:0)+(oe.resolved[we]??0),0),[_,oe.resolved,le]),lt=a.useCallback(g=>{const N=_[g];return Oe(g)+(N.marginLeftKey?le[N.marginLeftKey]??0:0)+(oe.resolved[g]??0)},[_,oe.resolved,Oe,le]),tt=(g,N)=>{const Z=g.marginLeftKey?le[g.marginLeftKey]??0:0,{effectiveWidth:we,resolvedWidth:Fe,maxWidth:qe}=H(g,N),yt=o&&N==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":g.prefix,style:{...N==="single-row"?{gridArea:g.prefix}:{},width:ee(we),...Z>0?{marginLeft:ee(Z)}:{}},children:[r.jsx("p",{className:g.className,style:g.style,children:g.text}),yt&&g.marginLeftKey&&r.jsx("div",{"data-controls":g.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Fe),style:{position:"absolute",top:0,left:ee(-Z),width:`max(${ee(Z)}, 10px)`,height:"100%",pointerEvents:"auto"}}),yt&&r.jsx("div",{"data-controls":g.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:ee(-Si/2),width:ee(Si),height:"100%",pointerEvents:"auto"}})]},g.className)},ht=()=>{const g=Q?-1:z.findIndex(we=>we.prefix==="title1"),N=!Q&&(o||(L??0)>0)?(()=>{const we=L??0,Fe=g>=0?xe[g]:A??0;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Fe),style:{position:"absolute",top:0,left:0,width:`max(${ee(we)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Z=z.flatMap((we,Fe)=>{if(!we.marginLeftKey)return[];const qe=le[we.marginLeftKey]??0,yt=yy(z,xe,le,Fe)+Ve();return r.jsx("div",{"data-controls":we.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(xe[Fe]),style:{position:"absolute",top:0,left:ee(yt),width:`max(${ee(qe)}, 10px)`,height:"100%",pointerEvents:"auto"}},we.marginLeftKey)});return N?[N,...Z]:Z},nt=()=>z.map((g,N)=>{const Z=Yo(N,xe),Fe=D(N)-Si/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":g.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Z),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:ee(Fe),width:ee(Si),height:"100%",pointerEvents:"auto"}})},`${g.widthKey}-junction`)}),Be=()=>_.flatMap((g,N)=>{if(!g.marginLeftKey)return[];const Z=le[g.marginLeftKey]??0,we=Oe(N),{resolvedWidth:Fe}=H(g,"two-row-bottom");return r.jsx("div",{"data-controls":g.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Fe),style:{position:"absolute",top:0,left:ee(we),width:`max(${ee(Z)}, 10px)`,height:"100%",pointerEvents:"auto"}},g.marginLeftKey)}),ve=()=>_.map((g,N)=>{const{maxWidth:Z}=H(g,"two-row-bottom"),Fe=lt(N)-Si/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":g.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Z),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:ee(Fe),width:ee(Si),height:"100%",pointerEvents:"auto"}})},`${g.widthKey}-junction`)}),ke=a.useRef(null),De=a.useRef(null),Ue=a.useRef(null),$e=a.useRef(null),He=a.useRef([]),ze=a.useRef([]),Xe=a.useRef(0),ct=a.useRef(null),Je=a.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),$t=a.useRef(null),dt=a.useRef(null),We=a.useRef(0),Ke=a.useRef("forward"),je=a.useRef(0),ut=a.useRef(null),pt=a.useRef(!1),mt=t.length>1&&(!o||!!s),kt=mt?3:1,Xt=a.useMemo(()=>Array.from({length:kt},()=>t).flat(),[t,kt]),[Yt,vt]=a.useState(!1),[xt,Gt]=a.useState(!1),[Ft,bt]=a.useState(!0),Nt=a.useRef(null),Ut=a.useRef(null),Zt=a.useRef(!1),tn=a.useRef(!1),Ct=a.useRef(null),jt=a.useRef(null),cn=Ae&&!Ft,at=a.useCallback(()=>{Ae&&(bt(!0),jt.current&&clearTimeout(jt.current),jt.current=setTimeout(()=>{Je.current.isActive||bt(!1)},ny))},[Ae]),Ce=a.useCallback(()=>{o||tn.current||(tn.current=!0,Gt(!1),Ct.current=setTimeout(()=>{l()},po))},[o,l]),_e=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":cn?"true":"false",style:{width:S.scalingValue(f??0,i),height:S.scalingValue(f??0,i),marginRight:ne,"--close-icon-hover-color":m},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Ce,"aria-label":"Close",children:r.jsx(rn,{url:v,fill:h,hoverFill:i&&!s?h:m,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ne,height:"100%",pointerEvents:"auto"}})]}),Qe=(g="two-row")=>r.jsx("div",{...g==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:ee(L??0),flexShrink:0,...g==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...g==="two-row"&&o?{pointerEvents:"auto"}:{}}}),st=()=>{const g=z.find(we=>we.prefix==="title1"),N=z.filter(we=>we.prefix==="title2"||we.prefix==="title3"),Z=N.length>0||o||(W??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(L??0)>0||o?Qe():null,g&&tt(g,"two-row-top"),v&&_e()]}),Z?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[N.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[N.map(we=>tt(we,"two-row-bottom")),o&&r.jsxs(r.Fragment,{children:[Be(),ve()]})]}):null,r.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:Me,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},gt=()=>r.jsxs(r.Fragment,{children:[(L??0)>0||o?Qe("single-row"):null,z.map(g=>tt(g,"single-row")),o?r.jsxs(r.Fragment,{children:[ht(),nt()]}):null,v?_e():null]}),Rt=a.useCallback(g=>!!(g.closest("[data-controls]")||g.closest(`.${e}-thumbnails`)||g.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ot,backdropStyle:Ot,mediaAreaStyle:Pt,overlayContentStyle:Mt,swipeHandlers:zt,dismissAreaStyle:Bt}=Dc({enabled:Y??!1,onClose:Ce,animMs:po,isBlockedTarget:Rt}),Wt=()=>{if(!mt||t.length===0)return Xe.current=0,0;const g=ze.current[0],N=ze.current[t.length];if(!g||!N)return Xe.current;const Z=N.offsetLeft-g.offsetLeft;return Z>0&&(Xe.current=Z),Xe.current},_t=(g=!1)=>{if(!mt)return;const N=De.current,Z=Wt();!N||Z<=0||Z<N.clientWidth*.25||(N.scrollLeft<=0?(N.scrollLeft+=Z,g&&(Je.current.scrollLeft+=Z),pt.current&&(je.current+=Z)):N.scrollLeft>=Z*2&&(N.scrollLeft-=Z,g&&(Je.current.scrollLeft-=Z),pt.current&&(je.current-=Z)))},At=(g,N=(Z=>(Z=De.current)==null?void 0:Z.scrollLeft)()??0)=>{if(!mt)return g;let we=t.length+g,Fe=1/0;for(let qe=0;qe<kt;qe++){const yt=qe*t.length+g,Lt=ze.current[yt];if(!Lt)continue;const en=Math.abs(Lt.offsetLeft-N);en<Fe&&(Fe=en,we=yt)}return we},wt=g=>{const N=De.current;return!g||!N?!1:g.offsetWidth>N.clientWidth+1},y=g=>{const N=De.current;if(!g||!N||!wt(g))return!1;const Z=g.offsetLeft,we=Z+g.offsetWidth;return N.scrollLeft>=Z-1&&N.scrollLeft+N.clientWidth<=we+1},ye=(g=(N=>(N=De.current)==null?void 0:N.scrollLeft)()??0)=>{for(let we=0;we<ze.current.length;we+=1){const Fe=ze.current[we];if(Fe&&y(Fe))return we}let Z={flatIndex:0,distance:1/0};return ze.current.forEach((we,Fe)=>{if(!we)return;const qe=Math.abs(we.offsetLeft-g);qe<Z.distance&&(Z={flatIndex:Fe,distance:qe})}),Z.flatIndex},Le=g=>{De.current&&ze.current.forEach(N=>{N&&(N.style.scrollSnapAlign=wt(N)&&g==="backward"?"end":"start")})},Pe=(g,N,Z)=>{const we=g-N,Fe=ye(N),qe=ze.current[Fe];if(y(qe))return ye(g)%t.length;const yt=ze.current[Fe+1],Lt=qe?yt?yt.offsetLeft-qe.offsetLeft:qe.offsetWidth:0,en=Lt>0?we>Lt*Ko?1:we<-Lt*Ko?-1:0:0;return en===0?Z:mt?(Z+en+t.length)%t.length:Math.max(0,Math.min(t.length-1,Z+en))},et=a.useCallback((g=!1)=>{if(I!=="on"||o)return;const N=$e.current,Z=k.current,we=He.current[Z];if(!N||!we||N.scrollWidth<=N.clientWidth)return;const Fe=N.scrollLeft,qe=Fe+N.clientWidth,yt=we.offsetLeft,Lt=yt+we.offsetWidth;if(yt>=Fe&&Lt<=qe)return;const en=N.scrollWidth-N.clientWidth;let Jt=Fe;if(!g&&Nt.current===null){const xi=He.current[Z-1],Qi=He.current[Z+1],No=xi?we.offsetLeft-xi.offsetLeft:Qi?Qi.offsetLeft-we.offsetLeft:we.offsetWidth;Lt>qe?Jt+=No:yt<Fe&&(Jt-=No)}else Lt>qe?Jt=Lt-N.clientWidth:Jt=yt;N.scrollLeft=Math.max(0,Math.min(en,Jt))},[o,I]),Et=a.useCallback((g=!1)=>{g&&(Zt.current=!0),Ut.current===null&&(Ut.current=requestAnimationFrame(()=>{Ut.current=null;const N=Zt.current;Zt.current=!1,et(N)}))},[et]),Ye=a.useCallback(g=>{if(g===k.current)return;const N=k.current;k.current=g;const Z=Math.abs(g-N)>1,we=mt&&t.length>1&&(N===t.length-1&&g===0||N===0&&g===t.length-1);ae(g),Et(Z||we)},[t.length,mt,Et]),ft=()=>{if(!De.current||t.length===0||Nt.current!==null||Je.current.isActive&&Je.current.hasMoved)return;const g=De.current.scrollLeft,N=ye(g)%t.length;N!==k.current&&Ye(N)},Ht=()=>{Nt.current=null},Tt=g=>{const N=De.current;N&&(N.style.scrollSnapType=g?"":"none")},nn=()=>{var g;(g=dt.current)==null||g.call(dt),dt.current=null},dn=()=>{ut.current!==null&&(cancelAnimationFrame(ut.current),ut.current=null),pt.current=!1},ei=()=>{const g=De.current;if(!g){ut.current=null,pt.current=!1;return}const N=je.current-g.scrollLeft;if(Math.abs(N)<.5){g.scrollLeft=je.current,_t(),ft(),ut.current=null,pt.current=!1;return}g.scrollLeft+=N*ry,_t(),ft(),at(),ut.current=requestAnimationFrame(ei)},ti=()=>{const g=Ue.current;g&&(g.style.transition="",g.style.transform="",g.style.willChange="")},Fo=(g,N,Z,we)=>{ti(),g.scrollLeft=N,We.current=g.scrollLeft,_t(),Z!==void 0?(k.current=Z,ae(Z)):ft(),Tt(!0),we==null||we()},Wo=(g,{behavior:N="smooth",activeIndex:Z,onComplete:we}={})=>{const Fe=De.current,qe=Ue.current;if(!Fe||!qe)return;if(dn(),nn(),Tt(!1),N==="auto"){Fo(Fe,g,Z,we);return}const yt=Math.abs(g-Fe.scrollLeft),Lt=Xf(yt,Qf,ey,Fe.clientWidth*.55);dt.current=Jf(Fe,qe,g,{duration:Lt,easing:ty,onComplete:()=>{dt.current=null,Fo(Fe,g,Z,we)}})},Wr=(g="smooth")=>{const N=De.current;if(!N||t.length===0)return;const Z=ye()%t.length,we=At(Z,N.scrollLeft),Fe=ze.current[we];Fe&&Wo(Fe.offsetLeft,{behavior:g,activeIndex:Z})},_r=(g,N="smooth",Z,we)=>{const Fe=De.current;if(!Fe||t.length===0)return;const qe=(we??Fe.scrollLeft)-g,yt=ye(g),Lt=ze.current[yt];if(y(Lt)){Tt(!0),ft();return}const en=ze.current[yt+1],Jt=Lt?en?en.offsetLeft-Lt.offsetLeft:Lt.offsetWidth:0;if((Jt>0?qe>Jt*Ko?1:qe<-Jt*Ko?-1:0:0)!==0){const ad=Z??yt%t.length,sd=Pe(we??Fe.scrollLeft,g,ad);Sn(sd,N);return}const Qi=we??Fe.scrollLeft,No=ye(Qi),ds=ze.current[No];if(ds&&Math.abs(ds.offsetLeft-Qi)<1){Tt(!0),ft();return}Wr("auto")},Sn=(g,N="smooth")=>{const Z=De.current;if(!Z||t.length===0)return;const we=At(g,Z.scrollLeft),Fe=ze.current[we];Fe&&(N==="smooth"?Nt.current=g:Nt.current=null,k.current=g,ae(g),Et(!0),Wo(Fe.offsetLeft,{behavior:N,activeIndex:g,onComplete:N==="smooth"?Ht:void 0}))},bi=()=>{$t.current&&(window.removeEventListener("pointerup",$t.current),window.removeEventListener("pointercancel",$t.current),$t.current=null)},_o=(g,N,Z,we,Fe)=>{const qe=Z-g,yt=we-N,Lt=Math.abs(qe),en=Math.abs(yt);if(Lt<sy||Lt<=en)return!1;const Jt=qe<0?1:-1,xi=mt?(Fe+Jt+t.length)%t.length:Math.max(0,Math.min(t.length-1,Fe+Jt));return xi===Fe?!1:(Sn(xi),!0)},ni=g=>{if(!Je.current.isActive)return;bi();const N=De.current;if(!N)return;const{scrollLeft:Z,startActiveIndex:we,hasMoved:Fe}=Je.current,qe=N.scrollLeft;_t(!0),Je.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},vt(!1),g!==void 0&&N.hasPointerCapture(g)&&N.releasePointerCapture(g),Fe?_r(Z,"smooth",we,qe):(Tt(!0),ft()),at()},Ho=(g,N)=>{const Z=ct.current;ct.current=null,Z&&(_o(Z.startX,Z.startY,g,N,Z.startActiveIndex),at())},Hr=g=>{if(!Se)return;if(g.pointerType==="touch"){if(dn(),Tt(!0),Rt(g.target))return;ct.current={startX:g.clientX,startY:g.clientY,startActiveIndex:k.current};return}if(g.pointerType!=="mouse"||g.button!==0||Rt(g.target))return;const N=De.current;if(!N)return;dn(),nn(),ti(),Nt.current=null,Je.current={isActive:!0,startX:g.clientX,scrollLeft:N.scrollLeft,startActiveIndex:k.current,hasMoved:!1},Tt(!1),at(),N.setPointerCapture(g.pointerId),bi();const Z=we=>{we.pointerType==="mouse"&&ni(we.pointerId)};$t.current=Z,window.addEventListener("pointerup",Z),window.addEventListener("pointercancel",Z)},Nr=g=>{if(!Se||g.pointerType!=="mouse")return;const N=De.current;if(!N||!Je.current.isActive)return;if(g.buttons===0){ni(g.pointerId);return}const Z=g.clientX-Je.current.startX;Math.abs(Z)>ay&&(Je.current.hasMoved=!0,vt(!0)),Je.current.hasMoved&&(g.preventDefault(),N.scrollLeft=Je.current.scrollLeft-Z,_t(!0),ft(),at())},ce=g=>{if(Se){if(g.pointerType==="touch"){g.type==="pointerup"?Ho(g.clientX,g.clientY):ct.current=null;return}g.pointerType==="mouse"&&ni(g.pointerId)}},Ne=g=>{!Se||g.pointerType!=="mouse"||ni(g.pointerId)};return jc(),a.useEffect(()=>{const g=requestAnimationFrame(()=>Gt(!0));return()=>{cancelAnimationFrame(g),nn(),bi(),Ut.current!==null&&(cancelAnimationFrame(Ut.current),Ut.current=null),Ct.current&&clearTimeout(Ct.current),jt.current&&clearTimeout(jt.current)}},[]),a.useEffect(()=>{if(!Ae){bt(!0);return}at();const g=ke.current;if(!g)return;const N=()=>at();return g.addEventListener("pointermove",N),g.addEventListener("pointerdown",N),()=>{g.removeEventListener("pointermove",N),g.removeEventListener("pointerdown",N),jt.current&&clearTimeout(jt.current)}},[Ae,at]),a.useEffect(()=>{const g=N=>{N.key==="Escape"&&Ce()};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[Ce]),a.useLayoutEffect(()=>{Wt()},[M,t.length,mt]),a.useLayoutEffect(()=>{o||Sn(k.current,"auto")},[M,o]),a.useLayoutEffect(()=>{Sn(0,"auto")},[t.length,mt]),a.useEffect(()=>{const g=De.current;if(!g||o||!Y)return;const N=Z=>{if(Z.preventDefault(),Math.abs(Z.deltaY)<=Math.abs(Z.deltaX))return;const we=Z.deltaMode===1?oy:Z.deltaMode===2?g.clientHeight:1,Fe=Z.deltaY*we*iy;if(Fe!==0){if(nn(),pt.current||(pt.current=!0,je.current=g.scrollLeft,Nt.current=null,Tt(!1)),je.current+=Fe,!mt){const qe=g.scrollWidth-g.clientWidth;je.current=Math.max(0,Math.min(qe,je.current))}at(),ut.current===null&&(ut.current=requestAnimationFrame(ei))}};return g.addEventListener("wheel",N,{passive:!1}),()=>{g.removeEventListener("wheel",N),dn()}},[o,Y,mt]),a.useEffect(()=>{const g=De.current;if(!g)return;const N=()=>{_t(Je.current.isActive);const we=g.scrollLeft,Fe=we-We.current;We.current=we;const qe=Xe.current>0?Xe.current*.5:1/0;if(Fe!==0&&Math.abs(Fe)<qe){const yt=Fe>0?"forward":"backward";yt!==Ke.current&&(Ke.current=yt,Le(yt))}Je.current.isActive&&Je.current.hasMoved||ft()};g.addEventListener("scroll",N,{passive:!0});const Z=new ResizeObserver(()=>{Wt(),_t(Je.current.isActive),Le(Ke.current),ft()});return Z.observe(g),()=>{nn(),g.removeEventListener("scroll",N),Z.disconnect()}},[t.length,mt]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ot||Ce()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:xt?1:0,transition:`opacity ${po}ms ease`,pointerEvents:xt?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Ot}}),r.jsxs("div",{ref:ke,className:`${e}-lightbox-dismiss-area`,style:Bt,...zt,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:Pt,onClick:g=>g.stopPropagation(),children:r.jsx("div",{ref:De,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":Se&&t.length>0?"true":"false","data-mouse-dragging":Yt?"true":"false",onPointerDown:Hr,onPointerMove:Nr,onPointerUp:ce,onPointerCancel:ce,onLostPointerCapture:Ne,children:r.jsx("div",{ref:Ue,className:`${e}-lightbox-strip-track`,style:{gap:M},children:Xt.map((g,N)=>{const Z=g.image.objectFit??"contain",we=N%t.length,Fe=Math.floor(N/t.length),qe=Xo(M),yt=`calc(-0.5 * (${qe} + ${M}))`;return r.jsxs("div",{ref:Lt=>ze.current[N]=Lt,className:`${e}-strip-item`,style:{height:E==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[r.jsx("img",{src:g.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:Z}}),o&&we<t.length-1&&Fe===0&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:yt,width:qe,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Fe}-${g.image.url}-${we}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":cn?"true":"false",style:Mt,children:[r.jsx("div",{style:{position:"relative",width:"100%",height:O,flexShrink:0,pointerEvents:"none"},children:o&&r.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:re,pointerEvents:"auto",zIndex:3}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:r.jsx("div",{className:`${e}-lightbox-content-area${Q?` ${e}-lightbox-content-area-stacked`:""}`,children:(be||v)&&r.jsx("div",{className:`${e}-header ${Q?`${e}-header-two-row`:`${e}-header-single-row`}`,children:Q?st():be||v?gt():null})})})]}),t.length>1&&I==="on"&&(()=>{const g=Xo(C),N=`calc(-0.5 * (${C} + ${g}))`;return r.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:C},children:r.jsx("div",{ref:$e,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:Z=>Z.stopPropagation(),children:r.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":T,style:{gap:ie,"--thumbnail-active-color":U},children:[t.map((Z,we)=>{const Fe=Xo(ie),qe=`calc(-0.5 * (${Fe} + ${ie}))`;return r.jsxs("div",{ref:yt=>{He.current[we]=yt},style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":$===we?"true":"false",onClick:()=>Y&&b==="click"&&Sn(we),onMouseEnter:()=>Ee&&b==="hover"&&Sn(we),"aria-label":Z.image.name?`View ${Z.image.name}`:`View image ${we+1}`,"aria-current":$===we?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${de?` ${e}-thumb-image-cover`:""}`,src:Z.image.url,alt:"",draggable:!1,style:{...ge,maxWidth:V,maxHeight:V,width:R.display==="cover"?"auto":"100%",height:"auto",objectFit:R.display==="cover"?"cover":"contain"}})}),o&&we<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:qe,width:Fe,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${Z.image.url}-${we}`)}),o&&r.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:N,height:g,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function by(e){return`
14225
+ `;function On(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const ml={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},vy=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],xy={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:On("Icon Padding Right"),iconAnimation:{type:"string",scope:"common",title:"Icon Animation",display:{type:"toggle-cycle",enum:["rotate 180","rotate 90","rotate 45"]}},questionColor:{type:"string",scope:"common",title:"Question Default",display:{type:"palette-color-picker"}},answerColor:{type:"string",scope:"common",title:"Answer Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"palette-color-picker"}},questionHoverColor:{type:"string",scope:"common",title:"Question Hover",display:{type:"palette-color-picker"}},iconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"palette-color-picker"}},iconActiveColor:{type:"string",scope:"common",title:"Icon Active",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}},questionFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},questionFontSettings:{...ml.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},questionFontSize:{type:"number",scope:"layout",title:"Question Font Size",display:{type:"font-size"}},questionLineHeight:{type:"number",scope:"layout",title:"Question Line Height",display:{type:"line-height-input"}},questionLetterSpacing:{type:"number",scope:"layout",title:"Question Letter Spacing",display:{type:"letter-spacing-input"}},questionWordSpacing:{type:"number",scope:"layout",title:"Question Word Spacing",display:{type:"word-spacing-input"}},questionTextAppearance:{type:"object",scope:"layout",title:"Question Text Appearance",display:{type:"text-appearance"}},answerFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},answerFontSettings:{...ml.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},answerFontSize:{type:"number",scope:"layout",title:"Answer Font Size",display:{type:"font-size"}},answerLineHeight:{type:"number",scope:"layout",title:"Answer Line Height",display:{type:"line-height-input"}},answerLetterSpacing:{type:"number",scope:"layout",title:"Answer Letter Spacing",display:{type:"letter-spacing-input"}},answerWordSpacing:{type:"number",scope:"layout",title:"Answer Word Spacing",display:{type:"word-spacing-input"}},answerTextAppearance:{type:"object",scope:"layout",title:"Answer Text Appearance",display:{type:"text-appearance"}},questionPaddingLeft:On("Question Padding Left"),questionPaddingTop:On("Question Padding Top"),questionPaddingBottom:On("Question Padding Bottom"),answerPaddingLeft:On("Answer Padding Left"),answerPaddingRight:On("Answer Padding Right"),answerPaddingTop:On("Answer Padding Top"),answerPaddingBottom:On("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:[...vy],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},by={element:fy,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:xy,sourceCode:yy},Fn=e=>e.display==="cover",Fr=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},gl=100,wy=.2,hl=8,Bc=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,s]=a.useState(0),[l,d]=a.useState(!1),c=a.useRef(null),u=a.useRef(0);u.current=o;const p=a.useMemo(()=>typeof window>"u"?gl:Math.max(gl,window.innerHeight*wy),[]),v=a.useCallback(x=>Math.max(0,1-x/(p*1.5)),[p]),y=a.useCallback(x=>Math.max(0,1-x/(p*.45)),[p]),g=a.useCallback(x=>{const W=typeof window<"u"?window.innerHeight:800,E=Math.max(.88,1-x/W*.12);return`translateY(${x}px) scale(${E})`},[]),h=a.useCallback(()=>{c.current=null},[]),m=a.useCallback(()=>{d(!0),s(0),window.setTimeout(()=>d(!1),n),h()},[n,h]),b=a.useCallback(()=>{const x=typeof window<"u"?window.innerHeight:800;d(!0),s(x),window.setTimeout(()=>{t(),h(),d(!1)},Math.min(n,200))},[n,t,h]),I=a.useCallback(x=>{!e||l||x.pointerType==="touch"&&(i!=null&&i(x.target)||(c.current={startX:x.clientX,startY:x.clientY,isLocked:null,pointerId:x.pointerId}))},[e,l,i]),R=a.useCallback(x=>{const W=c.current;if(!e||!W||x.pointerType!=="touch"||W.pointerId!==x.pointerId)return;const E=x.clientX-W.startX,J=x.clientY-W.startY;if(W.isLocked===null){if(Math.abs(E)<hl&&Math.abs(J)<hl)return;if(J>0&&J>Math.abs(E))W.isLocked=!0,x.currentTarget.setPointerCapture(x.pointerId);else{W.isLocked=!1,h();return}}if(!W.isLocked)return;x.preventDefault();const P=Math.max(0,J);u.current=P,s(P)},[e,h]),T=a.useCallback(x=>{const W=c.current;if(!e||!W||x.pointerType!=="touch"||W.pointerId!==x.pointerId)return;const E=W.isLocked===!0;if(x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId),!E){h();return}x.clientY-W.startY>=p?b():m()},[p,b,e,h,m]),q=a.useCallback(x=>{T(x)},[T]),F=a.useCallback(x=>{T(x)},[T]),V=o>0,A=l?`transform ${n}ms ease`:"none",L=l?`opacity ${n}ms ease`:"none",O=o>0||l;return{isSwipeDragging:V,backdropStyle:{opacity:v(o),transition:L},mediaAreaStyle:{transform:g(o),transition:A,touchAction:V?"none":void 0,willChange:V?"transform":void 0},overlayContentStyle:O?{opacity:y(o),transition:L}:void 0,swipeHandlers:e?{onPointerDown:I,onPointerMove:R,onPointerUp:q,onPointerCancel:F}:{},dismissAreaStyle:e?{touchAction:V?"none":"pan-x"}:void 0}},Sy="[data-lightbox-scrollable]",Vc=()=>{a.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,s=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(Sy)||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=s,window.scrollTo({top:e,left:0,behavior:"instant"})}},[])},$y=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Cy=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Ty=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Ly=(e,t,n,{duration:i,easing:o,onComplete:s})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(h,m)=>{Cy(t),e.scrollLeft=h,m&&(s==null||s())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,v=0;const y=()=>{t.removeEventListener("transitionend",g),clearTimeout(v)},g=h=>{h.target!==t||h.propertyName!=="transform"||p||(p=!0,y(),u(n,!0))};return t.addEventListener("transitionend",g),t.style.willChange="transform",t.style.transition="none",t.style.transform="translate3d(0, 0, 0)",t.offsetHeight,t.style.transition=`transform ${i}ms ${o}`,t.style.transform=`translate3d(${c}px, 0, 0)`,v=window.setTimeout(()=>{p||(p=!0,y(),u(n,!0))},i+64),()=>{p||(p=!0,y(),u(l-Ty(t),!1))}},mo=300,Ry=900,Iy=1500,Ey="cubic-bezier(0.16, 1, 0.3, 1)",My=3e3,Py=2,ky=16,Ay=.05,Fy=1,Ko=.3,Wy=50,_y=20,$i=.004,qi=["title1","title2","title3"],Hy={title1:"1",title2:"2",title3:"3"},Ny={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Oy={title1:.02,title2:.02,title3:.02},Yo=e=>`max(${e}, ${_y}px)`,Dy=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]}},jy=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=Dy(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Bt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,zy=e=>[Bt(e,"fontFamily"),Bt(e,"fontSettings"),{type:"row",items:[Bt(e,"fontSize"),Bt(e,"lineHeight"),Bt(e,"letterSpacing"),Bt(e,"wordSpacing")]},Bt(e,"textAlign"),Bt(e,"textAppearance")],By=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(qi.map(e=>[Hy[e],zy(e)]))}),us=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,l)=>s+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:l},d)=>{if(s<=0||d<=0)return{overflow:s,widths:[d,...l]};const c=Math.min(s,d);return{overflow:s-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},Gc=(e,t)=>us(e,t),Zo=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},fl=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:us(e.length,n),effective:Gc(e.length,n)}},Vy=(e,t,n,i,o,s,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:s,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:l,text:i}),d},ra=(e,t)=>{const n=i=>{const o=Bt(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[Ny[t]]}},Gy=(e,t,n,i)=>e.slice(0,i).reduce((o,s,l)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[l]??0),0),aa=(e,t,n)=>{var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??Oy[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Xt(i,n)},qy=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:v,closeIcon:y,closeIconMaxWidth:g,closeIconColor:h,closeIconHoverColor:m,thumbnailTrigger:b,thumbnailVisibility:I,thumbnailObjectFit:R,thumbnailActive:T,thumbnailActiveColor:q,title1Width:F,title2Width:V,title3Width:A,title1MarginLeft:L=0,title2MarginLeft:O=0,title3MarginLeft:x=0,titleRowMarginBottom:W=0,titleHeaderLayout:E="desktop",contentMarginTop:J,iconMarginLeft:P}=n,K=f=>C.scalingValue(f,i??!1),B=c??n.thumnailSize??.03,z=K(B),ie=K(u),S=K(p??.02),M=K(v??0),D=K(J??0),le=Yo(D),oe=K(P??0),[$,ae]=a.useState(0),k=a.useRef($);k.current=$;const te=t[$],{title1:X,title2:ve,title3:Pe}=jy(te),he=aa("title1",ra(n,"title1"),i),ce=aa("title2",ra(n,"title2"),i),U=aa("title3",ra(n,"title3"),i),Y=E==="mobile",Z=!o&&(!i||s),We=Z,$e=Z,ke=Z,de=Fn(R),fe=de?{"--image-aspect-ratio":Fr(R)}:void 0,we=!!(X||ve||Pe),G=a.useMemo(()=>Vy(e,X,ve,Pe,he,ce,U),[e,$,X,ve,Pe,he,ce,U]),se=a.useMemo(()=>({title1Width:F,title2Width:V,title3Width:A}),[F,V,A]),pe=a.useMemo(()=>G.map(f=>se[f.widthKey]),[G,se]),Se=a.useMemo(()=>us(G.length,pe),[G.length,pe]),Me=a.useMemo(()=>Gc(G.length,pe),[G.length,pe]),Le=a.useMemo(()=>G.filter(f=>f.prefix==="title1"),[G]),H=a.useMemo(()=>G.filter(f=>f.prefix==="title2"||f.prefix==="title3"),[G]),ye=a.useMemo(()=>fl(Le,se),[Le,se]),re=a.useMemo(()=>fl(H,se),[H,se]),_=a.useCallback((f,j)=>{const Q=G.indexOf(f);if(!Y||j==="single-row")return{effectiveWidth:Me[Q]??0,resolvedWidth:Se[Q]??0,maxWidth:Zo(Q,Se)};if(j==="two-row-top"){const Ne=Le.indexOf(f);return{effectiveWidth:ye.effective[Ne]??0,resolvedWidth:ye.resolved[Ne]??0,maxWidth:Zo(Ne,ye.resolved)}}const Ce=H.indexOf(f);return{effectiveWidth:re.effective[Ce]??0,resolvedWidth:re.resolved[Ce]??0,maxWidth:Zo(Ce,re.resolved)}},[H,re,Me,Se,G,Le,ye,Y]),ee=a.useCallback(f=>C.scalingValue(f,i??!1),[i]),Ae=ee(W??0),ue=a.useMemo(()=>({title1MarginLeft:L,title2MarginLeft:O,title3MarginLeft:x}),[L,O,x]),N=a.useCallback(f=>G.slice(0,f+1).reduce((j,Q,Ce)=>j+(Q!=null&&Q.marginLeftKey?ue[Q.marginLeftKey]??0:0)+(Se[Ce]??0),0)+(Y?0:L??0),[G,ue,Se,Y,L]),Ue=a.useCallback(()=>Y?0:L??0,[Y,L]),Oe=a.useCallback(f=>H.slice(0,f).reduce((j,Q,Ce)=>j+(Q.marginLeftKey?ue[Q.marginLeftKey]??0:0)+(re.resolved[Ce]??0),0),[H,re.resolved,ue]),dt=a.useCallback(f=>{const j=H[f];return Oe(f)+(j.marginLeftKey?ue[j.marginLeftKey]??0:0)+(re.resolved[f]??0)},[H,re.resolved,Oe,ue]),nt=(f,j)=>{const Q=f.marginLeftKey?ue[f.marginLeftKey]??0:0,{effectiveWidth:Ce,resolvedWidth:Ne,maxWidth:Ye}=_(f,j),bt=o&&j==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":f.prefix,style:{...j==="single-row"?{gridArea:f.prefix}:{},width:ee(Ce),...Q>0?{marginLeft:ee(Q)}:{}},children:[r.jsx("p",{className:f.className,style:f.style,children:f.text}),bt&&f.marginLeftKey&&r.jsx("div",{"data-controls":f.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ne),style:{position:"absolute",top:0,left:ee(-Q),width:`max(${ee(Q)}, 10px)`,height:"100%",pointerEvents:"auto"}}),bt&&r.jsx("div",{"data-controls":f.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ye),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:ee(-$i/2),width:ee($i),height:"100%",pointerEvents:"auto"}})]},f.className)},ht=()=>{const f=Y?-1:G.findIndex(Ce=>Ce.prefix==="title1"),j=!Y&&(o||(L??0)>0)?(()=>{const Ce=L??0,Ne=f>=0?Se[f]:F??0;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ne),style:{position:"absolute",top:0,left:0,width:`max(${ee(Ce)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Q=G.flatMap((Ce,Ne)=>{if(!Ce.marginLeftKey)return[];const Ye=ue[Ce.marginLeftKey]??0,bt=Gy(G,Se,ue,Ne)+Ue();return r.jsx("div",{"data-controls":Ce.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Se[Ne]),style:{position:"absolute",top:0,left:ee(bt),width:`max(${ee(Ye)}, 10px)`,height:"100%",pointerEvents:"auto"}},Ce.marginLeftKey)});return j?[j,...Q]:Q},st=()=>G.map((f,j)=>{const Q=Zo(j,Se),Ne=N(j)-$i/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":f.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Q),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:ee(Ne),width:ee($i),height:"100%",pointerEvents:"auto"}})},`${f.widthKey}-junction`)}),Be=()=>H.flatMap((f,j)=>{if(!f.marginLeftKey)return[];const Q=ue[f.marginLeftKey]??0,Ce=Oe(j),{resolvedWidth:Ne}=_(f,"two-row-bottom");return r.jsx("div",{"data-controls":f.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ne),style:{position:"absolute",top:0,left:ee(Ce),width:`max(${ee(Q)}, 10px)`,height:"100%",pointerEvents:"auto"}},f.marginLeftKey)}),xe=()=>H.map((f,j)=>{const{maxWidth:Q}=_(f,"two-row-bottom"),Ne=dt(j)-$i/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":f.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Q),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:ee(Ne),width:ee($i),height:"100%",pointerEvents:"auto"}})},`${f.widthKey}-junction`)}),Fe=a.useRef(null),je=a.useRef(null),Ke=a.useRef(null),ne=a.useRef(null),ge=a.useRef([]),Ie=a.useRef([]),Ge=a.useRef(0),Ze=a.useRef(null),Ve=a.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),at=a.useRef(null),Je=a.useRef(null),Ee=a.useRef(0),qe=a.useRef("forward"),_e=a.useRef(0),tt=a.useRef(null),rt=a.useRef(!1),lt=t.length>1&&(!o||!!s),Tt=lt?3:1,Ut=a.useMemo(()=>Array.from({length:Tt},()=>t).flat(),[t,Tt]),[Zt,xt]=a.useState(!1),[wt,jt]=a.useState(!1),[At,vt]=a.useState(!0),Ft=a.useRef(null),_t=a.useRef(null),Kt=a.useRef(!1),Jt=a.useRef(!1),Ct=a.useRef(null),Ht=a.useRef(null),on=We&&!At,mt=a.useCallback(()=>{We&&(vt(!0),Ht.current&&clearTimeout(Ht.current),Ht.current=setTimeout(()=>{Ve.current.isActive||vt(!1)},My))},[We]),Te=a.useCallback(()=>{o||Jt.current||(Jt.current=!0,jt(!1),Ct.current=setTimeout(()=>{l()},mo))},[o,l]),De=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":on?"true":"false",style:{width:C.scalingValue(g??0,i),height:C.scalingValue(g??0,i),marginRight:oe,"--close-icon-hover-color":m},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Te,"aria-label":"Close",children:r.jsx(an,{url:y,fill:h,hoverFill:i&&!s?h:m,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:oe,height:"100%",pointerEvents:"auto"}})]}),it=(f="two-row")=>r.jsx("div",{...f==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:ee(L??0),flexShrink:0,...f==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...f==="two-row"&&o?{pointerEvents:"auto"}:{}}}),gt=()=>{const f=G.find(Ce=>Ce.prefix==="title1"),j=G.filter(Ce=>Ce.prefix==="title2"||Ce.prefix==="title3"),Q=j.length>0||o||(W??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(L??0)>0||o?it():null,f&&nt(f,"two-row-top"),y&&De()]}),Q?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[j.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[j.map(Ce=>nt(Ce,"two-row-bottom")),o&&r.jsxs(r.Fragment,{children:[Be(),xe()]})]}):null,r.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:Ae,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},ft=()=>r.jsxs(r.Fragment,{children:[(L??0)>0||o?it("single-row"):null,G.map(f=>nt(f,"single-row")),o?r.jsxs(r.Fragment,{children:[ht(),st()]}):null,y?De():null]}),It=a.useCallback(f=>!!(f.closest("[data-controls]")||f.closest(`.${e}-thumbnails`)||f.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:pt,backdropStyle:zt,mediaAreaStyle:kt,overlayContentStyle:Pt,swipeHandlers:Vt,dismissAreaStyle:Gt}=Bc({enabled:Z??!1,onClose:Te,animMs:mo,isBlockedTarget:It}),Nt=()=>{if(!lt||t.length===0)return Ge.current=0,0;const f=Ie.current[0],j=Ie.current[t.length];if(!f||!j)return Ge.current;const Q=j.offsetLeft-f.offsetLeft;return Q>0&&(Ge.current=Q),Ge.current},Ot=(f=!1)=>{if(!lt)return;const j=je.current,Q=Nt();!j||Q<=0||Q<j.clientWidth*.25||(j.scrollLeft<=0?(j.scrollLeft+=Q,f&&(Ve.current.scrollLeft+=Q),rt.current&&(_e.current+=Q)):j.scrollLeft>=Q*2&&(j.scrollLeft-=Q,f&&(Ve.current.scrollLeft-=Q),rt.current&&(_e.current-=Q)))},Wt=(f,j=(Q=>(Q=je.current)==null?void 0:Q.scrollLeft)()??0)=>{if(!lt)return f;let Ce=t.length+f,Ne=1/0;for(let Ye=0;Ye<Tt;Ye++){const bt=Ye*t.length+f,Rt=Ie.current[bt];if(!Rt)continue;const tn=Math.abs(Rt.offsetLeft-j);tn<Ne&&(Ne=tn,Ce=bt)}return Ce},St=f=>{const j=je.current;return!f||!j?!1:f.offsetWidth>j.clientWidth+1},w=f=>{const j=je.current;if(!f||!j||!St(f))return!1;const Q=f.offsetLeft,Ce=Q+f.offsetWidth;return j.scrollLeft>=Q-1&&j.scrollLeft+j.clientWidth<=Ce+1},be=(f=(j=>(j=je.current)==null?void 0:j.scrollLeft)()??0)=>{for(let Ce=0;Ce<Ie.current.length;Ce+=1){const Ne=Ie.current[Ce];if(Ne&&w(Ne))return Ce}let Q={flatIndex:0,distance:1/0};return Ie.current.forEach((Ce,Ne)=>{if(!Ce)return;const Ye=Math.abs(Ce.offsetLeft-f);Ye<Q.distance&&(Q={flatIndex:Ne,distance:Ye})}),Q.flatIndex},Re=f=>{je.current&&Ie.current.forEach(j=>{j&&(j.style.scrollSnapAlign=St(j)&&f==="backward"?"end":"start")})},He=(f,j,Q)=>{const Ce=f-j,Ne=be(j),Ye=Ie.current[Ne];if(w(Ye))return be(f)%t.length;const bt=Ie.current[Ne+1],Rt=Ye?bt?bt.offsetLeft-Ye.offsetLeft:Ye.offsetWidth:0,tn=Rt>0?Ce>Rt*Ko?1:Ce<-Rt*Ko?-1:0:0;return tn===0?Q:lt?(Q+tn+t.length)%t.length:Math.max(0,Math.min(t.length-1,Q+tn))},ot=a.useCallback((f=!1)=>{if(I!=="on"||o)return;const j=ne.current,Q=k.current,Ce=ge.current[Q];if(!j||!Ce||j.scrollWidth<=j.clientWidth)return;const Ne=j.scrollLeft,Ye=Ne+j.clientWidth,bt=Ce.offsetLeft,Rt=bt+Ce.offsetWidth;if(bt>=Ne&&Rt<=Ye)return;const tn=j.scrollWidth-j.clientWidth;let Qt=Ne;if(!f&&Ft.current===null){const bi=ge.current[Q-1],eo=ge.current[Q+1],Oo=bi?Ce.offsetLeft-bi.offsetLeft:eo?eo.offsetLeft-Ce.offsetLeft:Ce.offsetWidth;Rt>Ye?Qt+=Oo:bt<Ne&&(Qt-=Oo)}else Rt>Ye?Qt=Rt-j.clientWidth:Qt=bt;j.scrollLeft=Math.max(0,Math.min(tn,Qt))},[o,I]),Mt=a.useCallback((f=!1)=>{f&&(Kt.current=!0),_t.current===null&&(_t.current=requestAnimationFrame(()=>{_t.current=null;const j=Kt.current;Kt.current=!1,ot(j)}))},[ot]),Qe=a.useCallback(f=>{if(f===k.current)return;const j=k.current;k.current=f;const Q=Math.abs(f-j)>1,Ce=lt&&t.length>1&&(j===t.length-1&&f===0||j===0&&f===t.length-1);ae(f),Mt(Q||Ce)},[t.length,lt,Mt]),yt=()=>{if(!je.current||t.length===0||Ft.current!==null||Ve.current.isActive&&Ve.current.hasMoved)return;const f=je.current.scrollLeft,j=be(f)%t.length;j!==k.current&&Qe(j)},Dt=()=>{Ft.current=null},Lt=f=>{const j=je.current;j&&(j.style.scrollSnapType=f?"":"none")},nn=()=>{var f;(f=Je.current)==null||f.call(Je),Je.current=null},dn=()=>{tt.current!==null&&(cancelAnimationFrame(tt.current),tt.current=null),rt.current=!1},ei=()=>{const f=je.current;if(!f){tt.current=null,rt.current=!1;return}const j=_e.current-f.scrollLeft;if(Math.abs(j)<.5){f.scrollLeft=_e.current,Ot(),yt(),tt.current=null,rt.current=!1;return}f.scrollLeft+=j*Ay,Ot(),yt(),mt(),tt.current=requestAnimationFrame(ei)},ti=()=>{const f=Ke.current;f&&(f.style.transition="",f.style.transform="",f.style.willChange="")},Wo=(f,j,Q,Ce)=>{ti(),f.scrollLeft=j,Ee.current=f.scrollLeft,Ot(),Q!==void 0?(k.current=Q,ae(Q)):yt(),Lt(!0),Ce==null||Ce()},_o=(f,{behavior:j="smooth",activeIndex:Q,onComplete:Ce}={})=>{const Ne=je.current,Ye=Ke.current;if(!Ne||!Ye)return;if(dn(),nn(),Lt(!1),j==="auto"){Wo(Ne,f,Q,Ce);return}const bt=Math.abs(f-Ne.scrollLeft),Rt=$y(bt,Ry,Iy,Ne.clientWidth*.55);Je.current=Ly(Ne,Ye,f,{duration:Rt,easing:Ey,onComplete:()=>{Je.current=null,Wo(Ne,f,Q,Ce)}})},_r=(f="smooth")=>{const j=je.current;if(!j||t.length===0)return;const Q=be()%t.length,Ce=Wt(Q,j.scrollLeft),Ne=Ie.current[Ce];Ne&&_o(Ne.offsetLeft,{behavior:f,activeIndex:Q})},Hr=(f,j="smooth",Q,Ce)=>{const Ne=je.current;if(!Ne||t.length===0)return;const Ye=(Ce??Ne.scrollLeft)-f,bt=be(f),Rt=Ie.current[bt];if(w(Rt)){Lt(!0),yt();return}const tn=Ie.current[bt+1],Qt=Rt?tn?tn.offsetLeft-Rt.offsetLeft:Rt.offsetWidth:0;if((Qt>0?Ye>Qt*Ko?1:Ye<-Qt*Ko?-1:0:0)!==0){const cd=Q??bt%t.length,dd=He(Ce??Ne.scrollLeft,f,cd);Sn(dd,j);return}const eo=Ce??Ne.scrollLeft,Oo=be(eo),ms=Ie.current[Oo];if(ms&&Math.abs(ms.offsetLeft-eo)<1){Lt(!0),yt();return}_r("auto")},Sn=(f,j="smooth")=>{const Q=je.current;if(!Q||t.length===0)return;const Ce=Wt(f,Q.scrollLeft),Ne=Ie.current[Ce];Ne&&(j==="smooth"?Ft.current=f:Ft.current=null,k.current=f,ae(f),Mt(!0),_o(Ne.offsetLeft,{behavior:j,activeIndex:f,onComplete:j==="smooth"?Dt:void 0}))},xi=()=>{at.current&&(window.removeEventListener("pointerup",at.current),window.removeEventListener("pointercancel",at.current),at.current=null)},Ho=(f,j,Q,Ce,Ne)=>{const Ye=Q-f,bt=Ce-j,Rt=Math.abs(Ye),tn=Math.abs(bt);if(Rt<Wy||Rt<=tn)return!1;const Qt=Ye<0?1:-1,bi=lt?(Ne+Qt+t.length)%t.length:Math.max(0,Math.min(t.length-1,Ne+Qt));return bi===Ne?!1:(Sn(bi),!0)},ni=f=>{if(!Ve.current.isActive)return;xi();const j=je.current;if(!j)return;const{scrollLeft:Q,startActiveIndex:Ce,hasMoved:Ne}=Ve.current,Ye=j.scrollLeft;Ot(!0),Ve.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},xt(!1),f!==void 0&&j.hasPointerCapture(f)&&j.releasePointerCapture(f),Ne?Hr(Q,"smooth",Ce,Ye):(Lt(!0),yt()),mt()},No=(f,j)=>{const Q=Ze.current;Ze.current=null,Q&&(Ho(Q.startX,Q.startY,f,j,Q.startActiveIndex),mt())},Nr=f=>{if(!$e)return;if(f.pointerType==="touch"){if(dn(),Lt(!0),It(f.target))return;Ze.current={startX:f.clientX,startY:f.clientY,startActiveIndex:k.current};return}if(f.pointerType!=="mouse"||f.button!==0||It(f.target))return;const j=je.current;if(!j)return;dn(),nn(),ti(),Ft.current=null,Ve.current={isActive:!0,startX:f.clientX,scrollLeft:j.scrollLeft,startActiveIndex:k.current,hasMoved:!1},Lt(!1),mt(),j.setPointerCapture(f.pointerId),xi();const Q=Ce=>{Ce.pointerType==="mouse"&&ni(Ce.pointerId)};at.current=Q,window.addEventListener("pointerup",Q),window.addEventListener("pointercancel",Q)},Or=f=>{if(!$e||f.pointerType!=="mouse")return;const j=je.current;if(!j||!Ve.current.isActive)return;if(f.buttons===0){ni(f.pointerId);return}const Q=f.clientX-Ve.current.startX;Math.abs(Q)>Fy&&(Ve.current.hasMoved=!0,xt(!0)),Ve.current.hasMoved&&(f.preventDefault(),j.scrollLeft=Ve.current.scrollLeft-Q,Ot(!0),yt(),mt())},me=f=>{if($e){if(f.pointerType==="touch"){f.type==="pointerup"?No(f.clientX,f.clientY):Ze.current=null;return}f.pointerType==="mouse"&&ni(f.pointerId)}},ze=f=>{!$e||f.pointerType!=="mouse"||ni(f.pointerId)};return Vc(),a.useEffect(()=>{const f=requestAnimationFrame(()=>jt(!0));return()=>{cancelAnimationFrame(f),nn(),xi(),_t.current!==null&&(cancelAnimationFrame(_t.current),_t.current=null),Ct.current&&clearTimeout(Ct.current),Ht.current&&clearTimeout(Ht.current)}},[]),a.useEffect(()=>{if(!We){vt(!0);return}mt();const f=Fe.current;if(!f)return;const j=()=>mt();return f.addEventListener("pointermove",j),f.addEventListener("pointerdown",j),()=>{f.removeEventListener("pointermove",j),f.removeEventListener("pointerdown",j),Ht.current&&clearTimeout(Ht.current)}},[We,mt]),a.useEffect(()=>{const f=j=>{j.key==="Escape"&&Te()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[Te]),a.useLayoutEffect(()=>{Nt()},[M,t.length,lt]),a.useLayoutEffect(()=>{o||Sn(k.current,"auto")},[M,o]),a.useLayoutEffect(()=>{Sn(0,"auto")},[t.length,lt]),a.useEffect(()=>{const f=je.current;if(!f||o||!Z)return;const j=Q=>{if(Q.preventDefault(),Math.abs(Q.deltaY)<=Math.abs(Q.deltaX))return;const Ce=Q.deltaMode===1?ky:Q.deltaMode===2?f.clientHeight:1,Ne=Q.deltaY*Ce*Py;if(Ne!==0){if(nn(),rt.current||(rt.current=!0,_e.current=f.scrollLeft,Ft.current=null,Lt(!1)),_e.current+=Ne,!lt){const Ye=f.scrollWidth-f.clientWidth;_e.current=Math.max(0,Math.min(Ye,_e.current))}mt(),tt.current===null&&(tt.current=requestAnimationFrame(ei))}};return f.addEventListener("wheel",j,{passive:!1}),()=>{f.removeEventListener("wheel",j),dn()}},[o,Z,lt]),a.useEffect(()=>{const f=je.current;if(!f)return;const j=()=>{Ot(Ve.current.isActive);const Ce=f.scrollLeft,Ne=Ce-Ee.current;Ee.current=Ce;const Ye=Ge.current>0?Ge.current*.5:1/0;if(Ne!==0&&Math.abs(Ne)<Ye){const bt=Ne>0?"forward":"backward";bt!==qe.current&&(qe.current=bt,Re(bt))}Ve.current.isActive&&Ve.current.hasMoved||yt()};f.addEventListener("scroll",j,{passive:!0});const Q=new ResizeObserver(()=>{Nt(),Ot(Ve.current.isActive),Re(qe.current),yt()});return Q.observe(f),()=>{nn(),f.removeEventListener("scroll",j),Q.disconnect()}},[t.length,lt]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{pt||Te()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:wt?1:0,transition:`opacity ${mo}ms ease`,pointerEvents:wt?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...zt}}),r.jsxs("div",{ref:Fe,className:`${e}-lightbox-dismiss-area`,style:Gt,...Vt,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:kt,onClick:f=>f.stopPropagation(),children:r.jsx("div",{ref:je,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":$e&&t.length>0?"true":"false","data-mouse-dragging":Zt?"true":"false",onPointerDown:Nr,onPointerMove:Or,onPointerUp:me,onPointerCancel:me,onLostPointerCapture:ze,children:r.jsx("div",{ref:Ke,className:`${e}-lightbox-strip-track`,style:{gap:M},children:Ut.map((f,j)=>{const Q=f.image.objectFit??"contain",Ce=j%t.length,Ne=Math.floor(j/t.length),Ye=Yo(M),bt=`calc(-0.5 * (${Ye} + ${M}))`;return r.jsxs("div",{ref:Rt=>Ie.current[j]=Rt,className:`${e}-strip-item`,style:{height:E==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[r.jsx("img",{src:f.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:Q}}),o&&Ce<t.length-1&&Ne===0&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:bt,width:Ye,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ne}-${f.image.url}-${Ce}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":on?"true":"false",style:Pt,children:[r.jsx("div",{style:{position:"relative",width:"100%",height:D,flexShrink:0,pointerEvents:"none"},children:o&&r.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-handle-left-fraction":"0.05",style:{position:"absolute",left:0,right:0,top:0,height:le,pointerEvents:"auto",zIndex:3}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:r.jsx("div",{className:`${e}-lightbox-content-area${Y?` ${e}-lightbox-content-area-stacked`:""}`,children:(we||y)&&r.jsx("div",{className:`${e}-header ${Y?`${e}-header-two-row`:`${e}-header-single-row`}`,children:Y?gt():we||y?ft():null})})})]}),t.length>1&&I==="on"&&(()=>{const f=Yo(S),j=`calc(-0.5 * (${S} + ${f}))`;return r.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:S},children:r.jsx("div",{ref:ne,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:Q=>Q.stopPropagation(),children:r.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":T,style:{gap:ie,"--thumbnail-active-color":q},children:[t.map((Q,Ce)=>{const Ne=Yo(ie),Ye=`calc(-0.5 * (${Ne} + ${ie}))`;return r.jsxs("div",{ref:bt=>{ge.current[Ce]=bt},style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":$===Ce?"true":"false",onClick:()=>Z&&b==="click"&&Sn(Ce),onMouseEnter:()=>ke&&b==="hover"&&Sn(Ce),"aria-label":Q.image.name?`View ${Q.image.name}`:`View image ${Ce+1}`,"aria-current":$===Ce?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${de?` ${e}-thumb-image-cover`:""}`,src:Q.image.url,alt:"",draggable:!1,style:{...fe,maxWidth:z,maxHeight:z,width:R.display==="cover"?"auto":"100%",height:"auto",objectFit:R.display==="cover"?"cover":"contain"}})}),o&&Ce<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Ye,width:Ne,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${Q.image.url}-${Ce}`)}),o&&r.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:j,height:f,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function Uy(e){return`
13256
14226
  .${e}-wrapper {
13257
14227
  position: relative;
13258
14228
  width: 100%;
@@ -13483,7 +14453,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
13483
14453
  background-color: transparent;
13484
14454
  padding: 0;
13485
14455
  opacity: 1;
13486
- transition: opacity ${po}ms ease;
14456
+ transition: opacity ${mo}ms ease;
13487
14457
  }
13488
14458
 
13489
14459
  .${e}-close-icon[data-overlay-content-hidden="true"] {
@@ -13596,7 +14566,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
13596
14566
  display: flex;
13597
14567
  flex-direction: column;
13598
14568
  opacity: 1;
13599
- transition: opacity ${po}ms ease;
14569
+ transition: opacity ${mo}ms ease;
13600
14570
  }
13601
14571
 
13602
14572
  .${e}-lightbox-content-inner[data-overlay-content-hidden="true"] {
@@ -13637,7 +14607,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
13637
14607
  pointer-events: auto;
13638
14608
  z-index: 10;
13639
14609
  }
13640
- `}const xy=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:s})=>{const{prefix:l}=S.useScopedStyles(),{cover:d,coverFit:c}=e,u=a.useRef(null),[p,x]=a.useState(!1),v=t??[],f=p&&v.length>0,h=()=>{v.length!==0&&x(!0)};return a.useEffect(()=>{!n||i||o||x(!1)},[n,i,o]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:u,className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:by(l)}}),d&&r.jsx("div",{className:`${l}-cover ${Fn(c)?`${l}-ratio-wrapper-cover`:`${l}-ratio-wrapper-fit`}`,onClick:()=>h(),style:{...Fn(c)?{"--image-aspect-ratio":Ar(c)}:{}},"aria-label":"Open image gallery",children:r.jsx("img",{className:`${l}-cover-image ${Fn(c)?`${l}-cover-image-cover`:`${l}-cover-image-fit`}`,src:d,alt:"cover"})})]}),f&&typeof document<"u"&&(()=>{const m=(s?document.getElementById(s):null)??document.body;return Yn.createPortal(r.jsx(vy,{prefix:l,images:v,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:()=>x(!1)}),m)})()]})},wy=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
14610
+ `}const Xy=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:s})=>{const{prefix:l}=C.useScopedStyles(),{cover:d,coverFit:c}=e,u=a.useRef(null),[p,v]=a.useState(!1),y=t??[],g=p&&y.length>0,h=()=>{y.length!==0&&v(!0)};return a.useEffect(()=>{!n||i||o||v(!1)},[n,i,o]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:u,className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Uy(l)}}),d&&r.jsx("div",{className:`${l}-cover ${Fn(c)?`${l}-ratio-wrapper-cover`:`${l}-ratio-wrapper-fit`}`,onClick:()=>h(),style:{...Fn(c)?{"--image-aspect-ratio":Fr(c)}:{}},"aria-label":"Open image gallery",children:r.jsx("img",{className:`${l}-cover-image ${Fn(c)?`${l}-cover-image-cover`:`${l}-cover-image-fit`}`,src:d,alt:"cover"})})]}),g&&typeof document<"u"&&(()=>{const m=(s?document.getElementById(s):null)??document.body;return Yn.createPortal(r.jsx(qy,{prefix:l,images:y,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:()=>v(!1)}),m)})()]})},Ky=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
13641
14611
  import { createPortal } from 'react-dom';
13642
14612
  import { CommonComponentProps } from '../props';
13643
14613
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -14183,7 +15153,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
14183
15153
  </>
14184
15154
  );
14185
15155
  };
14186
- `,Sy="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),si={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function $y(e){const t={};return t[Dt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Dt(e,"fontSettings")]={...si.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Dt(e,"fontSize")]={...si.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Dt(e,"lineHeight")]={...si.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Dt(e,"letterSpacing")]={...si.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Dt(e,"wordSpacing")]={...si.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Dt(e,"textAlign")]={...si.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Dt(e,"textAppearance")]={...si.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Cy=Gi.reduce((e,t)=>({...e,...$y(t)}),{}),Ty=Gi.reduce((e,t)=>({...e,[Dt(t,"fontFamily")]:"Goudy Bookletter 1911",[Dt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Dt(t,"letterSpacing")]:0,[Dt(t,"wordSpacing")]:0,[Dt(t,"textAlign")]:"left",[Dt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ra(e){return Gi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Dt(n,"fontSize")]=i),o!==void 0&&(t[Dt(n,"lineHeight")]=o),t},{})}const Ly=hy(),Ry={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"}},...Cy,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:Sy,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...Ty},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,...ra({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,...ra({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,...ra({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:[Ly]}],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"}]}},Iy={element:xy,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:Ry,sourceCode:wy,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Gi.map(e=>({path:`${Dt(e,"fontFamily")}`}))]},fontRelations:{...Gi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Dt(t,"fontFamily")}`}),{})}},Ey=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,initialSlideIndex:l=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:p})=>{const{type:x,coverFit:v,backgroundColor:f,imageGap:h,maxWidth:m,maxHeight:b,textTransition:I,title1Width:R,title2Width:T,title3Width:U,title1MarginLeft:A=0,title2MarginLeft:B=0,title3MarginLeft:P=0,titleRowMarginBottom:L=0,titleHeaderLayout:j="single-row",countCloseGap:w=0,closeIcon:W,closeIconMaxWidth:E,closeIconColor:J,closeIconHoverColor:F,contentMarginTop:X=0,iconMarginRight:G=0}=n,V=a.useCallback(ce=>S.scalingValue(ce,i??!1),[i]),ie=V(h??0),C=`${m}%`,M=`${b}%`,O=V(w),re=V(X),ne=V(G),$=pi("title1",ui(n,"title1"),i),ae=pi("title2",ui(n,"title2"),i),k=pi("title3",ui(n,"title3"),i),te=pi("count",ui(n,"count"),i),K=j==="mobile",fe=!i||!!s,Ie=!o&&(!i||!!s),me=a.useMemo(()=>rr(t,x),[t,x]),[ue,q]=a.useState(l),Q=me[ue],Y=Q==null?void 0:Q.entry,[Ae,Se]=a.useState(!1),[Ee,de]=a.useState(null),[ge,be]=a.useState(!1),[z,se]=a.useState(null),[pe,xe]=a.useState(!1),[Re,Te]=a.useState(0),[_,he]=a.useState(),[oe,H]=a.useState(),[ee,Me]=a.useState(null),le=a.useRef(null),D=a.useRef(0),Ve=a.useRef(0),Oe=a.useRef(0),lt=a.useRef(!1),tt=a.useRef(null),ht=a.useRef(null),nt=a.useRef(null),Be=a.useRef(null),ve=a.useRef(null),ke=a.useRef(null),De=a.useRef(null),Ue=a.useCallback(()=>{const ce=ht.current;if(!ce)return;const Ne=ce.closest(`.${e}-lightbox-content-area`);if(!Ne)return ce.getBoundingClientRect().width;const g=Array.from(Ne.children).reduce((N,Z)=>!(Z instanceof HTMLElement)||Z.contains(ce)?N:N+Z.getBoundingClientRect().width,0);return Ne.getBoundingClientRect().width-g},[e]),$e=a.useCallback(()=>{le.current&&(clearTimeout(le.current),le.current=null)},[]),He=a.useCallback(ce=>{ce===D.current&&(se(null),xe(!1))},[]),ze=a.useCallback(()=>{o||lt.current||(lt.current=!0,u==null||u(),Se(!1),tt.current=setTimeout(()=>{p()},300))},[o,u,p]),Xe=a.useCallback(ce=>!!(ce.closest("[data-controls]")||ce.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ct,backdropStyle:Je,mediaAreaStyle:$t,overlayContentStyle:dt,swipeHandlers:We,dismissAreaStyle:Ke}=Dc({enabled:Ie,onClose:ze,animMs:300,isBlockedTarget:Xe}),je=a.useCallback(ce=>{d&&Sc(ce+1,c,!0)},[d,c]),ut=a.useCallback(ce=>{if(ce)return ce.getBoundingClientRect().height},[]),pt=a.useCallback(ce=>{if(me.length===0)return;const Ne=(ce%me.length+me.length)%me.length;if(Ne===ue)return;const g=me[ue],N=me[Ne];D.current+=1;const Z=D.current,we=I==="fade"&&zs(g==null?void 0:g.entry)!==zs(N==null?void 0:N.entry),Fe=ut(nt.current),qe=we?(()=>{const Lt=Ue();Yn.flushSync(()=>{Me(N.entry)}),nt.current&&Lt&&(nt.current.style.width=`${Lt}px`);const en=ut(nt.current);return nt.current&&(nt.current.style.width=""),{measuredIncomingTitlesHeight:en,incomingTitlesMeasureWidth:Lt}})():void 0,yt=Math.max(Fe??0,(qe==null?void 0:qe.measuredIncomingTitlesHeight)??0)||void 0;Te(Z),se(ue),xe(!0),q(Ne),je(Ne),Oe.current=Ne,we?($e(),yt&&he(yt),qe!=null&&qe.incomingTitlesMeasureWidth&&H(qe.incomingTitlesMeasureWidth),de((g==null?void 0:g.entryIndex)??null),be(!0),Ve.current=N.entryIndex,le.current=setTimeout(()=>{de(null),be(!1),he(void 0),H(void 0),Me(null),le.current=null},400)):($e(),de(null),be(!1),he(void 0),H(void 0),Me(null),Ve.current=N.entryIndex)},[ue,$e,Ue,ut,me,je,I]),mt=a.useCallback(()=>{De.current=null},[]),kt=a.useCallback(ce=>{!fe||me.length<=1||ce.pointerType==="mouse"&&ce.button!==0||ce.target.closest("[data-controls]")||(De.current={startX:ce.clientX,startY:ce.clientY,pointerId:ce.pointerId})},[fe,me.length]),Xt=a.useCallback(ce=>{var Lt;if(!fe||me.length<=1||ce.pointerType==="mouse"&&ce.button!==0)return;if(ct){mt();return}const Ne=De.current;if(!Ne||Ne.pointerId!==ce.pointerId||(mt(),ce.target.closest("[data-controls]")))return;const N=ce.clientX-Ne.startX,Z=ce.clientY-Ne.startY,we=Math.abs(N),Fe=Math.abs(Z);if(we>=Dg&&we>Fe){pt(N>0?ue-1:ue+1);return}if(we>Ns||Fe>Ns)return;const qe=(Lt=Be.current)==null?void 0:Lt.getBoundingClientRect(),yt=qe?qe.left+qe.width/2:window.innerWidth/2;pt(ce.clientX<yt?ue-1:ue+1)},[ue,fe,pt,ct,mt,me.length]),Yt=a.useCallback(ce=>{const Ne=De.current;(Ne==null?void 0:Ne.pointerId)===ce.pointerId&&mt()},[mt]);jc(),a.useEffect(()=>{ke.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const ce=requestAnimationFrame(()=>{Se(!0),requestAnimationFrame(()=>{ve.current?ve.current.focus():Be.current&&Be.current.focus()})});return()=>{cancelAnimationFrame(ce),tt.current&&clearTimeout(tt.current),le.current&&clearTimeout(le.current);const Ne=ke.current;Ne&&document.contains(Ne)&&Ne.focus({preventScroll:!0})}},[]),a.useEffect(()=>{var ce;I!=="fade"&&(Ve.current=((ce=me[ue])==null?void 0:ce.entryIndex)??0,$e(),de(null),be(!1),he(void 0),H(void 0))},[ue,$e,me,I]),a.useEffect(()=>{const ce=Ne=>{if(Ne.key==="Escape"){ze();return}if(Ne.key==="ArrowLeft"&&me.length>1){pt(ue-1);return}if(Ne.key==="ArrowRight"&&me.length>1){pt(ue+1);return}if(Ne.key==="Tab"&&Be.current){const g=Be.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),N=Array.from(g).filter(qe=>!qe.closest('[aria-hidden="true"]'));if(N.length===0)return;const Z=N[0],we=N[N.length-1],Fe=document.activeElement;Ne.shiftKey?(Fe===Z||!Be.current.contains(Fe))&&(Ne.preventDefault(),we.focus()):(Fe===we||!Be.current.contains(Fe))&&(Ne.preventDefault(),Z.focus())}};return window.addEventListener("keydown",ce),()=>window.removeEventListener("keydown",ce)},[pt,ze,ue,me.length]),a.useLayoutEffect(()=>{$e(),D.current=0,Te(0),se(null),xe(!1),de(null),be(!1),he(void 0),H(void 0),Me(null),q(ce=>{const Ne=Math.max(0,me.length-1);return Math.min(ce,Ne)})},[$e,t.length,x,me.length]),a.useLayoutEffect(()=>{var g;const ce=Math.max(0,me.length-1),Ne=Math.min(Math.max(0,l),ce);Oe.current=Ne,Ve.current=((g=me[Ne])==null?void 0:g.entryIndex)??0,q(Ne)},[l]);const vt=Ee!==null?t[Ee]:null,xt=z!==null?me[z]:null,Gt=(Y==null?void 0:Y.title1)||(Y==null?void 0:Y.title2)||(Y==null?void 0:Y.title3)||(vt==null?void 0:vt.title1)||(vt==null?void 0:vt.title2)||(vt==null?void 0:vt.title3),Ft=Kg(x,me,t),bt=W!==null,Nt=Gt||Ft||bt,Ut=Ft&&bt?{gap:O}:void 0,Zt=`${e}-titles-stack${K?` ${e}-titles-stack-stacked`:""}`,tn=`${e}-titles-layer-out${K?` ${e}-titles-layer-out-stacked`:""}`,Ct=`${e}-titles-layer-out`,jt=(A??0)>0||o,cn=V(L),at=a.useMemo(()=>({title1Width:R??Ai.title1Width,title2Width:T??Ai.title2Width,title3Width:U??Ai.title3Width}),[R,T,U]),Ce=a.useMemo(()=>({title2MarginLeft:B,title3MarginLeft:P}),[B,P]),_e=a.useMemo(()=>Y?Vn(e,Y,$,ae,k):[],[e,Y,$,ae,k]),Qe=a.useMemo(()=>_e.map(ce=>at[ce.widthKey]),[_e,at]),st=a.useMemo(()=>Oi(_e.length,Qe),[_e.length,Qe]),gt=a.useMemo(()=>xo(_e.length,Qe),[_e.length,Qe]),Rt=a.useMemo(()=>_e.filter(ce=>ce.prefix==="title1"),[_e]),ot=a.useMemo(()=>_e.filter(ce=>ce.prefix==="title2"||ce.prefix==="title3"),[_e]),Ot=a.useMemo(()=>Gn(Rt,at),[Rt,at]),Pt=a.useMemo(()=>Gn(ot,at),[ot,at]),Mt=a.useCallback((ce,Ne)=>{const g=_e.findIndex(Z=>Z.prefix===ce.prefix);if(!K||Ne==="single-row")return{effectiveWidth:gt[g]??0,resolvedWidth:st[g]??0,maxWidth:sn(g,st)};if(Ne==="two-row-top"){const Z=Rt.findIndex(we=>we.prefix===ce.prefix);return{effectiveWidth:Ot.effective[Z]??0,resolvedWidth:Ot.resolved[Z]??0,maxWidth:sn(Z,Ot.resolved)}}const N=ot.findIndex(Z=>Z.prefix===ce.prefix);return{effectiveWidth:Pt.effective[N]??0,resolvedWidth:Pt.resolved[N]??0,maxWidth:sn(N,Pt.resolved)}},[_e,ot,Pt,gt,st,Rt,Ot,K]),zt=a.useCallback(ce=>Lc(_e,st,Ce,ce)+(K?0:A??0),[_e,st,Ce,K,A]),Bt=a.useCallback(()=>K?0:A??0,[K,A]),Wt=a.useCallback(ce=>ot.slice(0,ce).reduce((Ne,g,N)=>Ne+(g.marginLeftKey?Ce[g.marginLeftKey]??0:0)+(Pt.resolved[N]??0),0),[ot,Pt.resolved,Ce]),_t=a.useCallback(ce=>{const Ne=ot[ce];return Wt(ce)+(Ne.marginLeftKey?Ce[Ne.marginLeftKey]??0:0)+(Pt.resolved[ce]??0)},[ot,Pt.resolved,Wt,Ce]),At=a.useCallback((ce,Ne,g)=>{if(!K||g==="single-row"){const qe=ce.findIndex(Jt=>Jt.prefix===Ne.prefix),yt=ce.map(Jt=>at[Jt.widthKey]),Lt=Oi(ce.length,yt);return{effectiveWidth:xo(ce.length,yt)[qe]??0,resolvedWidth:Lt[qe]??0,maxWidth:sn(qe,Lt)}}if(g==="two-row-top"){const qe=ce.filter(Jt=>Jt.prefix==="title1"),yt=qe.findIndex(Jt=>Jt.prefix===Ne.prefix),{resolved:Lt,effective:en}=Gn(qe,at);return{effectiveWidth:en[yt]??0,resolvedWidth:Lt[yt]??0,maxWidth:sn(yt,Lt)}}const N=ce.filter(qe=>qe.prefix==="title2"||qe.prefix==="title3"),Z=N.findIndex(qe=>qe.prefix===Ne.prefix),{resolved:we,effective:Fe}=Gn(N,at);return{effectiveWidth:Fe[Z]??0,resolvedWidth:we[Z]??0,maxWidth:sn(Z,we)}},[at,K]),wt=(ce,Ne,g)=>{const N=ce.marginLeftKey?Ce[ce.marginLeftKey]??0:0,{effectiveWidth:Z,resolvedWidth:we,maxWidth:Fe}=g??Mt(ce,Ne),qe=Math.max(N,Bn),yt=o&&Ne==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":ce.prefix,style:{width:V(Z),...N>0?{marginLeft:V(N)}:{}},children:[r.jsx("p",{className:ce.className,style:ce.style,children:ce.text}),yt&&ce.marginLeftKey?r.jsx("div",{"data-controls":ce.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(we),style:{position:"absolute",top:0,left:V(-N),width:V(qe),height:"100%",pointerEvents:"auto"}}):null,yt?r.jsx("div",{"data-controls":ce.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Fe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:V(-gn/2),width:V(gn),height:"100%",pointerEvents:"auto"}}):null]},ce.className)},y=(ce="two-row")=>{const Ne=_e.findIndex(Z=>Z.prefix==="title1"),g=Ne>=0?st[Ne]:at.title1Width,N=ce==="two-row"&&o;return r.jsx("div",{...N?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(g)}:{},style:{width:V(A??0),flexShrink:0,alignSelf:"stretch",...N?{pointerEvents:"auto"}:{}}})},ye=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:$,"aria-hidden":"true",children:" "}),Le=()=>r.jsx("span",{className:`${e}-entry-counter`,style:te,"aria-live":"polite","aria-atomic":"true",children:qg(me,ue,x,t)}),Pe=()=>Ft?o&&bt?r.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Le(),r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Xr(O)} + ${O}))`,width:Xr(O),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Le():null,et=()=>!Ft&&!bt?null:r.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Ut,children:[Pe(),bt?ft():null]}),Et=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ft||Gt?ye():null,jt?y("single-row"):null,Tt(Y),r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),et(),Sn()]}),Ye=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ft||Gt?ye():null,jt?y("single-row"):null,r.jsxs("div",{className:`${e}-titles-row-titles`,style:ge&&_?{minHeight:_}:void 0,children:[r.jsx("div",{ref:nt,className:Zt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ti(ee||Y)}),r.jsxs("div",{ref:ht,className:Zt,style:{position:ge?"absolute":"relative",inset:ge?0:void 0,width:"100%",...ge&&oe?{width:oe,maxWidth:"100%"}:void 0},children:[vt&&ge?r.jsx("div",{className:`${tn} ${e}-titles-fade-out`,children:ti(vt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ge?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:ti(Y)})]})]}),et(),Sn()]}),ft=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:S.scalingValue(E??0,i),height:S.scalingValue(E??0,i),marginRight:ne,"--close-icon-hover-color":F},children:[r.jsx("button",{ref:ve,type:"button",className:`${e}-close-icon-inner`,onClick:ze,"aria-label":"Close",children:r.jsx(rn,{url:W??"",fill:J,hoverFill:i&&!s?J:F,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ne,height:"100%",pointerEvents:"auto"}})]}),Ht=(ce,Ne)=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[Ft||Gt?ye():null,jt?y("two-row"):null,Ne!==void 0?r.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Ne},children:ce}):r.jsxs(r.Fragment,{children:[ce,r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),et()]}),Tt=ce=>{if(!ce)return null;const Ne=Vn(e,ce,$,ae,k);return r.jsx(r.Fragment,{children:Ne.map(g=>wt(g,"single-row",At(Ne,g,"single-row")))})},nn=ce=>{if(!ce)return null;const Ne=Vn(e,ce,$,ae,k),g=Ne.find(N=>N.prefix==="title1");return g?wt(g,"two-row-top",At(Ne,g,"two-row-top")):null},dn=(ce,Ne=!1)=>{const g=ce?Vn(e,ce,$,ae,k):[],N=g.filter(Fe=>Fe.prefix==="title2"||Fe.prefix==="title3"),Z=o&&Ne;return N.length>0||Z||(L??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[N.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[N.map(Fe=>wt(Fe,"two-row-bottom",At(g,Fe,"two-row-bottom"))),Ne&&o?r.jsxs(r.Fragment,{children:[Wr(),_r()]}):null]}):null,(L??0)>0||Z?r.jsx("div",{"data-controls":Z?"titleRowMarginBottom":void 0,"data-controls-axis":Z?"y":void 0,"data-controls-reverse":Z?"":void 0,className:Z?`${e}-control`:void 0,style:{height:cn,width:"100%",flexShrink:0,pointerEvents:Z?"auto":"none"}}):null]}):null},ei=(ce,Ne=!1)=>r.jsxs(r.Fragment,{children:[Ht(nn(ce)),dn(ce,Ne)]}),ti=ce=>K?r.jsx("div",{className:`${e}-titles-row-two-row`,children:ei(ce)}):ce?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Tt(ce)}):null,Fo=()=>{const ce=K?-1:_e.findIndex(N=>N.prefix==="title1"),Ne=!K&&(o||(A??0)>0)?(()=>{const N=A??0,Z=ce>=0?st[ce]:at.title1Width,we=Math.max(N,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Z),style:{position:"absolute",top:0,left:0,width:V(we),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,g=_e.flatMap((N,Z)=>{if(!N.marginLeftKey)return[];const we=Ce[N.marginLeftKey]??0,Fe=Tc(_e,st,Ce,Z)+Bt(),qe=Math.max(we,Bn);return r.jsx("div",{"data-controls":N.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(st[Z]),style:{position:"absolute",top:0,left:V(Fe),width:V(qe),height:"100%",pointerEvents:"auto"}},N.marginLeftKey)});return Ne?[Ne,...g]:g},Wo=()=>_e.map((ce,Ne)=>{const g=sn(Ne,st),Z=zt(Ne)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":ce.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(g),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:V(Z),width:V(gn),height:"100%",pointerEvents:"auto"}})},`${ce.widthKey}-junction`)}),Wr=()=>ot.flatMap((ce,Ne)=>{if(!ce.marginLeftKey)return[];const g=Ce[ce.marginLeftKey]??0,N=Wt(Ne),Z=Math.max(g,Bn),{resolvedWidth:we}=Mt(ce,"two-row-bottom");return r.jsx("div",{"data-controls":ce.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(we),style:{position:"absolute",top:0,left:V(N),width:V(Z),height:"100%",pointerEvents:"auto"}},ce.marginLeftKey)}),_r=()=>ot.map((ce,Ne)=>{const{maxWidth:g}=Mt(ce,"two-row-bottom"),Z=_t(Ne)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":ce.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(g),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:V(Z),width:V(gn),height:"100%",pointerEvents:"auto"}})},`${ce.widthKey}-junction`)}),Sn=()=>!o||K?null:r.jsxs(r.Fragment,{children:[Fo(),Wo()]}),bi=ce=>{const Ne=!ce.objectFit&&Fn(v);return{className:`${e}-slide-image-cell${Ne?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:C,maxHeight:M,...Ne?{"--image-aspect-ratio":Ar(v)}:{}}}},_o=ce=>ce.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":ce.objectFit}}:Fn(v)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ni=ce=>{if(ce.length===0)return null;const Ne=ce.length>1,g=Xr(ie),N=`calc(-0.5 * (${g} + ${ie}))`;if(ce.length===1){const Z=ce[0];return r.jsx("div",{...bi(Z),children:r.jsx("img",{..._o(Z),src:Z.url,alt:Z.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:Ne?{gap:ie}:void 0,children:ce.map((Z,we)=>r.jsxs("div",{...bi(Z),children:[r.jsx("img",{..._o(Z),src:Z.url,alt:Z.name??"",draggable:!1}),o&&Ne&&we<ce.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:N,width:g,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Z.url}-${we}`))})},Ho=!!(Y!=null&&Y.title2||Y!=null&&Y.title3||vt!=null&&vt.title2||vt!=null&&vt.title3||(L??0)>0||o),Hr=()=>r.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[r.jsx("div",{ref:nt,className:Zt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ei(ee||Y)}),r.jsxs("div",{ref:ht,className:`${e}-titles-row-two-row`,style:{...ge&&_?{minHeight:_}:void 0,...ge&&oe?{width:oe,maxWidth:"100%"}:void 0},children:[Ht(r.jsxs("div",{className:Zt,style:{position:ge?"absolute":"relative",inset:ge?0:void 0,width:"100%"},children:[vt&&ge?r.jsx("div",{className:`${Ct} ${e}-titles-fade-out`,children:nn(vt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ge?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:nn(Y)})]}),ge&&_?_:void 0),Ho?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[vt&&ge?r.jsx("div",{className:`${tn} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:dn(vt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ge?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${K?` ${e}-titles-layer-in-stacked`:""}`,children:dn(Y,!0)})]}):null]})]}),Nr=()=>{const ce=Ho;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...ce?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:ce?void 0:{flex:"0 0 auto",height:"auto"},children:ei(Y,!0)}),Sn()]})};return r.jsxs("div",{ref:Be,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ct||ze()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:bt?void 0:-1,style:{opacity:Ae?1:0,transition:"opacity 300ms ease",pointerEvents:Ae?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:f,...Je}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Ke,...We,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:$t,onClick:ce=>ce.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":fe&&me.length>1?"true":"false",onPointerDown:fe?kt:void 0,onPointerUp:fe?Xt:void 0,onPointerCancel:fe?Yt:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[xt&&pe?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:ce=>{ce.target===ce.currentTarget&&He(Re)},children:r.jsx("div",{className:`${e}-slide-area`,children:ni(xt.images)})},`slide-out-${Re}`):null,r.jsx("div",{className:`${e}-slide-layer-in${pe?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:Q?ni(Q.images):null})},`slide-in-${Re}-${ue}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:dt,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:re,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...K?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${K?` ${e}-lightbox-content-area-stacked`:""}`,children:Nt&&r.jsx("div",{className:`${e}-text-bar-cell${K?` ${e}-text-bar-cell-stacked`:""}`,style:K?void 0:{flex:1,minWidth:0,width:"100%"},children:K?I==="fade"?Hr():Nr():I==="fade"?Ye():Et()})})})]})]})]})};function My(e){return`
15156
+ `,Yy="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),si={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Zy(e){const t={};return t[Bt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Bt(e,"fontSettings")]={...si.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Bt(e,"fontSize")]={...si.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Bt(e,"lineHeight")]={...si.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Bt(e,"letterSpacing")]={...si.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Bt(e,"wordSpacing")]={...si.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Bt(e,"textAlign")]={...si.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Bt(e,"textAppearance")]={...si.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Jy=qi.reduce((e,t)=>({...e,...Zy(t)}),{}),Qy=qi.reduce((e,t)=>({...e,[Bt(t,"fontFamily")]:"Goudy Bookletter 1911",[Bt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Bt(t,"letterSpacing")]:0,[Bt(t,"wordSpacing")]:0,[Bt(t,"textAlign")]:"left",[Bt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function sa(e){return qi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Bt(n,"fontSize")]=i),o!==void 0&&(t[Bt(n,"lineHeight")]=o),t},{})}const ev=By(),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"}}},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"}},...Jy,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:Yy,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...Qy},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,...sa({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,...sa({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,...sa({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:[ev]}],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"}]}},nv={element:Xy,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:tv,sourceCode:Ky,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...qi.map(e=>({path:`${Bt(e,"fontFamily")}`}))]},fontRelations:{...qi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Bt(t,"fontFamily")}`}),{})}},iv=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,initialSlideIndex:l=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:p})=>{const{type:v,coverFit:y,backgroundColor:g,imageGap:h,maxWidth:m,maxHeight:b,textTransition:I,title1Width:R,title2Width:T,title3Width:q,title1MarginLeft:F=0,title2MarginLeft:V=0,title3MarginLeft:A=0,titleRowMarginBottom:L=0,titleHeaderLayout:O="single-row",countCloseGap:x=0,closeIcon:W,closeIconMaxWidth:E,closeIconColor:J,closeIconHoverColor:P,contentMarginTop:K=0,iconMarginRight:B=0}=n,z=a.useCallback(me=>C.scalingValue(me,i??!1),[i]),ie=z(h??0),S=`${m}%`,M=`${b}%`,D=z(x),le=z(K),oe=z(B),$=pi("title1",ui(n,"title1"),i),ae=pi("title2",ui(n,"title2"),i),k=pi("title3",ui(n,"title3"),i),te=pi("count",ui(n,"count"),i),X=O==="mobile",ve=!i||!!s,Pe=!o&&(!i||!!s),he=a.useMemo(()=>ar(t,v),[t,v]),[ce,U]=a.useState(l),Y=he[ce],Z=Y==null?void 0:Y.entry,[We,$e]=a.useState(!1),[ke,de]=a.useState(null),[fe,we]=a.useState(!1),[G,se]=a.useState(null),[pe,Se]=a.useState(!1),[Me,Le]=a.useState(0),[H,ye]=a.useState(),[re,_]=a.useState(),[ee,Ae]=a.useState(null),ue=a.useRef(null),N=a.useRef(0),Ue=a.useRef(0),Oe=a.useRef(0),dt=a.useRef(!1),nt=a.useRef(null),ht=a.useRef(null),st=a.useRef(null),Be=a.useRef(null),xe=a.useRef(null),Fe=a.useRef(null),je=a.useRef(null),Ke=a.useCallback(()=>{const me=ht.current;if(!me)return;const ze=me.closest(`.${e}-lightbox-content-area`);if(!ze)return me.getBoundingClientRect().width;const f=Array.from(ze.children).reduce((j,Q)=>!(Q instanceof HTMLElement)||Q.contains(me)?j:j+Q.getBoundingClientRect().width,0);return ze.getBoundingClientRect().width-f},[e]),ne=a.useCallback(()=>{ue.current&&(clearTimeout(ue.current),ue.current=null)},[]),ge=a.useCallback(me=>{me===N.current&&(se(null),Se(!1))},[]),Ie=a.useCallback(()=>{o||dt.current||(dt.current=!0,u==null||u(),$e(!1),nt.current=setTimeout(()=>{p()},300))},[o,u,p]),Ge=a.useCallback(me=>!!(me.closest("[data-controls]")||me.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:Ze,backdropStyle:Ve,mediaAreaStyle:at,overlayContentStyle:Je,swipeHandlers:Ee,dismissAreaStyle:qe}=Bc({enabled:Pe,onClose:Ie,animMs:300,isBlockedTarget:Ge}),_e=a.useCallback(me=>{d&&Tc(me+1,c,!0)},[d,c]),tt=a.useCallback(me=>{if(me)return me.getBoundingClientRect().height},[]),rt=a.useCallback(me=>{if(he.length===0)return;const ze=(me%he.length+he.length)%he.length;if(ze===ce)return;const f=he[ce],j=he[ze];N.current+=1;const Q=N.current,Ce=I==="fade"&&Gs(f==null?void 0:f.entry)!==Gs(j==null?void 0:j.entry),Ne=tt(st.current),Ye=Ce?(()=>{const Rt=Ke();Yn.flushSync(()=>{Ae(j.entry)}),st.current&&Rt&&(st.current.style.width=`${Rt}px`);const tn=tt(st.current);return st.current&&(st.current.style.width=""),{measuredIncomingTitlesHeight:tn,incomingTitlesMeasureWidth:Rt}})():void 0,bt=Math.max(Ne??0,(Ye==null?void 0:Ye.measuredIncomingTitlesHeight)??0)||void 0;Le(Q),se(ce),Se(!0),U(ze),_e(ze),Oe.current=ze,Ce?(ne(),bt&&ye(bt),Ye!=null&&Ye.incomingTitlesMeasureWidth&&_(Ye.incomingTitlesMeasureWidth),de((f==null?void 0:f.entryIndex)??null),we(!0),Ue.current=j.entryIndex,ue.current=setTimeout(()=>{de(null),we(!1),ye(void 0),_(void 0),Ae(null),ue.current=null},400)):(ne(),de(null),we(!1),ye(void 0),_(void 0),Ae(null),Ue.current=j.entryIndex)},[ce,ne,Ke,tt,he,_e,I]),lt=a.useCallback(()=>{je.current=null},[]),Tt=a.useCallback(me=>{!ve||he.length<=1||me.pointerType==="mouse"&&me.button!==0||me.target.closest("[data-controls]")||(je.current={startX:me.clientX,startY:me.clientY,pointerId:me.pointerId})},[ve,he.length]),Ut=a.useCallback(me=>{var Rt;if(!ve||he.length<=1||me.pointerType==="mouse"&&me.button!==0)return;if(Ze){lt();return}const ze=je.current;if(!ze||ze.pointerId!==me.pointerId||(lt(),me.target.closest("[data-controls]")))return;const j=me.clientX-ze.startX,Q=me.clientY-ze.startY,Ce=Math.abs(j),Ne=Math.abs(Q);if(Ce>=gh&&Ce>Ne){rt(j>0?ce-1:ce+1);return}if(Ce>js||Ne>js)return;const Ye=(Rt=Be.current)==null?void 0:Rt.getBoundingClientRect(),bt=Ye?Ye.left+Ye.width/2:window.innerWidth/2;rt(me.clientX<bt?ce-1:ce+1)},[ce,ve,rt,Ze,lt,he.length]),Zt=a.useCallback(me=>{const ze=je.current;(ze==null?void 0:ze.pointerId)===me.pointerId&&lt()},[lt]);Vc(),a.useEffect(()=>{Fe.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const me=requestAnimationFrame(()=>{$e(!0),requestAnimationFrame(()=>{xe.current?xe.current.focus():Be.current&&Be.current.focus()})});return()=>{cancelAnimationFrame(me),nt.current&&clearTimeout(nt.current),ue.current&&clearTimeout(ue.current);const ze=Fe.current;ze&&document.contains(ze)&&ze.focus({preventScroll:!0})}},[]),a.useEffect(()=>{var me;I!=="fade"&&(Ue.current=((me=he[ce])==null?void 0:me.entryIndex)??0,ne(),de(null),we(!1),ye(void 0),_(void 0))},[ce,ne,he,I]),a.useEffect(()=>{const me=ze=>{if(ze.key==="Escape"){Ie();return}if(ze.key==="ArrowLeft"&&he.length>1){rt(ce-1);return}if(ze.key==="ArrowRight"&&he.length>1){rt(ce+1);return}if(ze.key==="Tab"&&Be.current){const f=Be.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),j=Array.from(f).filter(Ye=>!Ye.closest('[aria-hidden="true"]'));if(j.length===0)return;const Q=j[0],Ce=j[j.length-1],Ne=document.activeElement;ze.shiftKey?(Ne===Q||!Be.current.contains(Ne))&&(ze.preventDefault(),Ce.focus()):(Ne===Ce||!Be.current.contains(Ne))&&(ze.preventDefault(),Q.focus())}};return window.addEventListener("keydown",me),()=>window.removeEventListener("keydown",me)},[rt,Ie,ce,he.length]),a.useLayoutEffect(()=>{ne(),N.current=0,Le(0),se(null),Se(!1),de(null),we(!1),ye(void 0),_(void 0),Ae(null),U(me=>{const ze=Math.max(0,he.length-1);return Math.min(me,ze)})},[ne,t.length,v,he.length]),a.useLayoutEffect(()=>{var f;const me=Math.max(0,he.length-1),ze=Math.min(Math.max(0,l),me);Oe.current=ze,Ue.current=((f=he[ze])==null?void 0:f.entryIndex)??0,U(ze)},[l]);const xt=ke!==null?t[ke]:null,wt=G!==null?he[G]:null,jt=(Z==null?void 0:Z.title1)||(Z==null?void 0:Z.title2)||(Z==null?void 0:Z.title3)||(xt==null?void 0:xt.title1)||(xt==null?void 0:xt.title2)||(xt==null?void 0:xt.title3),At=Sh(v,he,t),vt=W!==null,Ft=jt||At||vt,_t=At&&vt?{gap:D}:void 0,Kt=`${e}-titles-stack${X?` ${e}-titles-stack-stacked`:""}`,Jt=`${e}-titles-layer-out${X?` ${e}-titles-layer-out-stacked`:""}`,Ct=`${e}-titles-layer-out`,Ht=(F??0)>0||o,on=z(L),mt=a.useMemo(()=>({title1Width:R??Fi.title1Width,title2Width:T??Fi.title2Width,title3Width:q??Fi.title3Width}),[R,T,q]),Te=a.useMemo(()=>({title2MarginLeft:V,title3MarginLeft:A}),[V,A]),De=a.useMemo(()=>Z?Vn(e,Z,$,ae,k):[],[e,Z,$,ae,k]),it=a.useMemo(()=>De.map(me=>mt[me.widthKey]),[De,mt]),gt=a.useMemo(()=>Di(De.length,it),[De.length,it]),ft=a.useMemo(()=>wo(De.length,it),[De.length,it]),It=a.useMemo(()=>De.filter(me=>me.prefix==="title1"),[De]),pt=a.useMemo(()=>De.filter(me=>me.prefix==="title2"||me.prefix==="title3"),[De]),zt=a.useMemo(()=>Gn(It,mt),[It,mt]),kt=a.useMemo(()=>Gn(pt,mt),[pt,mt]),Pt=a.useCallback((me,ze)=>{const f=De.findIndex(Q=>Q.prefix===me.prefix);if(!X||ze==="single-row")return{effectiveWidth:ft[f]??0,resolvedWidth:gt[f]??0,maxWidth:ln(f,gt)};if(ze==="two-row-top"){const Q=It.findIndex(Ce=>Ce.prefix===me.prefix);return{effectiveWidth:zt.effective[Q]??0,resolvedWidth:zt.resolved[Q]??0,maxWidth:ln(Q,zt.resolved)}}const j=pt.findIndex(Q=>Q.prefix===me.prefix);return{effectiveWidth:kt.effective[j]??0,resolvedWidth:kt.resolved[j]??0,maxWidth:ln(j,kt.resolved)}},[De,pt,kt,ft,gt,It,zt,X]),Vt=a.useCallback(me=>Ec(De,gt,Te,me)+(X?0:F??0),[De,gt,Te,X,F]),Gt=a.useCallback(()=>X?0:F??0,[X,F]),Nt=a.useCallback(me=>pt.slice(0,me).reduce((ze,f,j)=>ze+(f.marginLeftKey?Te[f.marginLeftKey]??0:0)+(kt.resolved[j]??0),0),[pt,kt.resolved,Te]),Ot=a.useCallback(me=>{const ze=pt[me];return Nt(me)+(ze.marginLeftKey?Te[ze.marginLeftKey]??0:0)+(kt.resolved[me]??0)},[pt,kt.resolved,Nt,Te]),Wt=a.useCallback((me,ze,f)=>{if(!X||f==="single-row"){const Ye=me.findIndex(Qt=>Qt.prefix===ze.prefix),bt=me.map(Qt=>mt[Qt.widthKey]),Rt=Di(me.length,bt);return{effectiveWidth:wo(me.length,bt)[Ye]??0,resolvedWidth:Rt[Ye]??0,maxWidth:ln(Ye,Rt)}}if(f==="two-row-top"){const Ye=me.filter(Qt=>Qt.prefix==="title1"),bt=Ye.findIndex(Qt=>Qt.prefix===ze.prefix),{resolved:Rt,effective:tn}=Gn(Ye,mt);return{effectiveWidth:tn[bt]??0,resolvedWidth:Rt[bt]??0,maxWidth:ln(bt,Rt)}}const j=me.filter(Ye=>Ye.prefix==="title2"||Ye.prefix==="title3"),Q=j.findIndex(Ye=>Ye.prefix===ze.prefix),{resolved:Ce,effective:Ne}=Gn(j,mt);return{effectiveWidth:Ne[Q]??0,resolvedWidth:Ce[Q]??0,maxWidth:ln(Q,Ce)}},[mt,X]),St=(me,ze,f)=>{const j=me.marginLeftKey?Te[me.marginLeftKey]??0:0,{effectiveWidth:Q,resolvedWidth:Ce,maxWidth:Ne}=f??Pt(me,ze),Ye=Math.max(j,Bn),bt=o&&ze==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":me.prefix,style:{width:z(Q),...j>0?{marginLeft:z(j)}:{}},children:[r.jsx("p",{className:me.className,style:me.style,children:me.text}),bt&&me.marginLeftKey?r.jsx("div",{"data-controls":me.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ce),style:{position:"absolute",top:0,left:z(-j),width:z(Ye),height:"100%",pointerEvents:"auto"}}):null,bt?r.jsx("div",{"data-controls":me.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ne),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:z(-gn/2),width:z(gn),height:"100%",pointerEvents:"auto"}}):null]},me.className)},w=(me="two-row")=>{const ze=De.findIndex(Q=>Q.prefix==="title1"),f=ze>=0?gt[ze]:mt.title1Width,j=me==="two-row"&&o;return r.jsx("div",{...j?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(f)}:{},style:{width:z(F??0),flexShrink:0,alignSelf:"stretch",...j?{pointerEvents:"auto"}:{}}})},be=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:$,"aria-hidden":"true",children:" "}),Re=()=>r.jsx("span",{className:`${e}-entry-counter`,style:te,"aria-live":"polite","aria-atomic":"true",children:wh(he,ce,v,t)}),He=()=>At?o&&vt?r.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Re(),r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Zr(D)} + ${D}))`,width:Zr(D),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Re():null,ot=()=>!At&&!vt?null:r.jsxs("div",{className:`${e}-titles-row-header-controls`,style:_t,children:[He(),vt?yt():null]}),Mt=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||jt?be():null,Ht?w("single-row"):null,Lt(Z),r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),ot(),Sn()]}),Qe=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||jt?be():null,Ht?w("single-row"):null,r.jsxs("div",{className:`${e}-titles-row-titles`,style:fe&&H?{minHeight:H}:void 0,children:[r.jsx("div",{ref:st,className:Kt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ti(ee||Z)}),r.jsxs("div",{ref:ht,className:Kt,style:{position:fe?"absolute":"relative",inset:fe?0:void 0,width:"100%",...fe&&re?{width:re,maxWidth:"100%"}:void 0},children:[xt&&fe?r.jsx("div",{className:`${Jt} ${e}-titles-fade-out`,children:ti(xt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${fe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:ti(Z)})]})]}),ot(),Sn()]}),yt=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:C.scalingValue(E??0,i),height:C.scalingValue(E??0,i),marginRight:oe,"--close-icon-hover-color":P},children:[r.jsx("button",{ref:xe,type:"button",className:`${e}-close-icon-inner`,onClick:Ie,"aria-label":"Close",children:r.jsx(an,{url:W??"",fill:J,hoverFill:i&&!s?J:P,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:oe,height:"100%",pointerEvents:"auto"}})]}),Dt=(me,ze)=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[At||jt?be():null,Ht?w("two-row"):null,ze!==void 0?r.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:ze},children:me}):r.jsxs(r.Fragment,{children:[me,r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),ot()]}),Lt=me=>{if(!me)return null;const ze=Vn(e,me,$,ae,k);return r.jsx(r.Fragment,{children:ze.map(f=>St(f,"single-row",Wt(ze,f,"single-row")))})},nn=me=>{if(!me)return null;const ze=Vn(e,me,$,ae,k),f=ze.find(j=>j.prefix==="title1");return f?St(f,"two-row-top",Wt(ze,f,"two-row-top")):null},dn=(me,ze=!1)=>{const f=me?Vn(e,me,$,ae,k):[],j=f.filter(Ne=>Ne.prefix==="title2"||Ne.prefix==="title3"),Q=o&&ze;return j.length>0||Q||(L??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[j.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[j.map(Ne=>St(Ne,"two-row-bottom",Wt(f,Ne,"two-row-bottom"))),ze&&o?r.jsxs(r.Fragment,{children:[_r(),Hr()]}):null]}):null,(L??0)>0||Q?r.jsx("div",{"data-controls":Q?"titleRowMarginBottom":void 0,"data-controls-axis":Q?"y":void 0,"data-controls-reverse":Q?"":void 0,className:Q?`${e}-control`:void 0,style:{height:on,width:"100%",flexShrink:0,pointerEvents:Q?"auto":"none"}}):null]}):null},ei=(me,ze=!1)=>r.jsxs(r.Fragment,{children:[Dt(nn(me)),dn(me,ze)]}),ti=me=>X?r.jsx("div",{className:`${e}-titles-row-two-row`,children:ei(me)}):me?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Lt(me)}):null,Wo=()=>{const me=X?-1:De.findIndex(j=>j.prefix==="title1"),ze=!X&&(o||(F??0)>0)?(()=>{const j=F??0,Q=me>=0?gt[me]:mt.title1Width,Ce=Math.max(j,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Q),style:{position:"absolute",top:0,left:0,width:z(Ce),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,f=De.flatMap((j,Q)=>{if(!j.marginLeftKey)return[];const Ce=Te[j.marginLeftKey]??0,Ne=Ic(De,gt,Te,Q)+Gt(),Ye=Math.max(Ce,Bn);return r.jsx("div",{"data-controls":j.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(gt[Q]),style:{position:"absolute",top:0,left:z(Ne),width:z(Ye),height:"100%",pointerEvents:"auto"}},j.marginLeftKey)});return ze?[ze,...f]:f},_o=()=>De.map((me,ze)=>{const f=ln(ze,gt),Q=Vt(ze)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":me.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(f),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:z(Q),width:z(gn),height:"100%",pointerEvents:"auto"}})},`${me.widthKey}-junction`)}),_r=()=>pt.flatMap((me,ze)=>{if(!me.marginLeftKey)return[];const f=Te[me.marginLeftKey]??0,j=Nt(ze),Q=Math.max(f,Bn),{resolvedWidth:Ce}=Pt(me,"two-row-bottom");return r.jsx("div",{"data-controls":me.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ce),style:{position:"absolute",top:0,left:z(j),width:z(Q),height:"100%",pointerEvents:"auto"}},me.marginLeftKey)}),Hr=()=>pt.map((me,ze)=>{const{maxWidth:f}=Pt(me,"two-row-bottom"),Q=Ot(ze)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":me.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(f),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:z(Q),width:z(gn),height:"100%",pointerEvents:"auto"}})},`${me.widthKey}-junction`)}),Sn=()=>!o||X?null:r.jsxs(r.Fragment,{children:[Wo(),_o()]}),xi=me=>{const ze=!me.objectFit&&Fn(y);return{className:`${e}-slide-image-cell${ze?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:S,maxHeight:M,...ze?{"--image-aspect-ratio":Fr(y)}:{}}}},Ho=me=>me.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":me.objectFit}}:Fn(y)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ni=me=>{if(me.length===0)return null;const ze=me.length>1,f=Zr(ie),j=`calc(-0.5 * (${f} + ${ie}))`;if(me.length===1){const Q=me[0];return r.jsx("div",{...xi(Q),children:r.jsx("img",{...Ho(Q),src:Q.url,alt:Q.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:ze?{gap:ie}:void 0,children:me.map((Q,Ce)=>r.jsxs("div",{...xi(Q),children:[r.jsx("img",{...Ho(Q),src:Q.url,alt:Q.name??"",draggable:!1}),o&&ze&&Ce<me.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:j,width:f,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Q.url}-${Ce}`))})},No=!!(Z!=null&&Z.title2||Z!=null&&Z.title3||xt!=null&&xt.title2||xt!=null&&xt.title3||(L??0)>0||o),Nr=()=>r.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[r.jsx("div",{ref:st,className:Kt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ei(ee||Z)}),r.jsxs("div",{ref:ht,className:`${e}-titles-row-two-row`,style:{...fe&&H?{minHeight:H}:void 0,...fe&&re?{width:re,maxWidth:"100%"}:void 0},children:[Dt(r.jsxs("div",{className:Kt,style:{position:fe?"absolute":"relative",inset:fe?0:void 0,width:"100%"},children:[xt&&fe?r.jsx("div",{className:`${Ct} ${e}-titles-fade-out`,children:nn(xt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${fe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:nn(Z)})]}),fe&&H?H:void 0),No?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[xt&&fe?r.jsx("div",{className:`${Jt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:dn(xt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${fe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${X?` ${e}-titles-layer-in-stacked`:""}`,children:dn(Z,!0)})]}):null]})]}),Or=()=>{const me=No;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...me?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:me?void 0:{flex:"0 0 auto",height:"auto"},children:ei(Z,!0)}),Sn()]})};return r.jsxs("div",{ref:Be,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{Ze||Ie()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:vt?void 0:-1,style:{opacity:We?1:0,transition:"opacity 300ms ease",pointerEvents:We?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:g,...Ve}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:qe,...Ee,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:at,onClick:me=>me.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":ve&&he.length>1?"true":"false",onPointerDown:ve?Tt:void 0,onPointerUp:ve?Ut:void 0,onPointerCancel:ve?Zt:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[wt&&pe?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:me=>{me.target===me.currentTarget&&ge(Me)},children:r.jsx("div",{className:`${e}-slide-area`,children:ni(wt.images)})},`slide-out-${Me}`):null,r.jsx("div",{className:`${e}-slide-layer-in${pe?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:Y?ni(Y.images):null})},`slide-in-${Me}-${ce}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Je,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:le,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...X?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${X?` ${e}-lightbox-content-area-stacked`:""}`,children:Ft&&r.jsx("div",{className:`${e}-text-bar-cell${X?` ${e}-text-bar-cell-stacked`:""}`,style:X?void 0:{flex:1,minWidth:0,width:"100%"},children:X?I==="fade"?Nr():Or():I==="fade"?Qe():Mt()})})})]})]})]})};function ov(e){return`
14187
15157
  .${e}-wrapper {
14188
15158
  position: relative;
14189
15159
  width: 100%;
@@ -14705,7 +15675,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
14705
15675
  pointer-events: auto;
14706
15676
  z-index: 10;
14707
15677
  }
14708
- `}const Py=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:s,metadata:l})=>{const{prefix:d}=S.useScopedStyles(),c=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:x}=e,v=a.useRef(null),[f,h]=a.useState(!1),[m,b]=a.useState(0),I=a.useRef(!1),R=a.useRef(!1),T=a.useRef(!1),U=a.useMemo(()=>(t??[]).filter(w=>Ni(w).length>0),[t]),A=f&&U.length>0,B=!n,P=a.useCallback(()=>{B&&(T.current=!0,zg(R.current,c),R.current=!1)},[B,c]),L=(w=0)=>{if(U.length===0||n&&!i&&!o)return;const W=rr(U,x),E=Math.max(0,Math.min(w,W.length-1));if(b(E),B){const J=$c();Sc(E+1,c,J),R.current=!J}h(!0)},j=a.useCallback(()=>{h(!1),T.current=!1},[]);return a.useEffect(()=>{!n||i||o||h(!1)},[n,i,o]),a.useEffect(()=>{if(!B||I.current)return;I.current=!0;const w=Ds(c);if(!w)return;const W=js(w,rr(U,x).length);W<0||(b(W),h(!0))},[U,c,B,x]),a.useEffect(()=>{if(!B)return;const w=()=>{if(T.current){T.current=!1,h(!1);return}const W=Ds(c);if(!W){h(!1);return}const E=js(W,rr(U,x).length);if(E<0){h(!1);return}R.current=!1,b(E),h(!0)};return window.addEventListener("popstate",w),()=>window.removeEventListener("popstate",w)},[U,c,B,x]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:v,className:`${d}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:My(d)}}),u?r.jsx("button",{type:"button",className:`${d}-cover ${Fn(p)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>L(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...Fn(p)?{"--image-aspect-ratio":Ar(p)}:{}},"aria-label":"Open journal gallery",children:r.jsx("img",{className:`${d}-cover-image ${Fn(p)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),A&&typeof document<"u"&&(()=>{const w=(s?document.getElementById(s):null)??document.body;return Yn.createPortal(r.jsx(Ey,{prefix:d,entries:U,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:m,enableUrlSync:B,journalItemId:c,onBeforeClose:P,onClose:j}),w)})()]})},ky=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
15678
+ `}const rv=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:s,metadata:l})=>{const{prefix:d}=C.useScopedStyles(),c=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:v}=e,y=a.useRef(null),[g,h]=a.useState(!1),[m,b]=a.useState(0),I=a.useRef(!1),R=a.useRef(!1),T=a.useRef(!1),q=a.useMemo(()=>(t??[]).filter(x=>Oi(x).length>0),[t]),F=g&&q.length>0,V=!n,A=a.useCallback(()=>{V&&(T.current=!0,fh(R.current,c),R.current=!1)},[V,c]),L=(x=0)=>{if(q.length===0||n&&!i&&!o)return;const W=ar(q,v),E=Math.max(0,Math.min(x,W.length-1));if(b(E),V){const J=Lc();Tc(E+1,c,J),R.current=!J}h(!0)},O=a.useCallback(()=>{h(!1),T.current=!1},[]);return a.useEffect(()=>{!n||i||o||h(!1)},[n,i,o]),a.useEffect(()=>{if(!V||I.current)return;I.current=!0;const x=Bs(c);if(!x)return;const W=Vs(x,ar(q,v).length);W<0||(b(W),h(!0))},[q,c,V,v]),a.useEffect(()=>{if(!V)return;const x=()=>{if(T.current){T.current=!1,h(!1);return}const W=Bs(c);if(!W){h(!1);return}const E=Vs(W,ar(q,v).length);if(E<0){h(!1);return}R.current=!1,b(E),h(!0)};return window.addEventListener("popstate",x),()=>window.removeEventListener("popstate",x)},[q,c,V,v]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:y,className:`${d}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ov(d)}}),u?r.jsx("button",{type:"button",className:`${d}-cover ${Fn(p)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>L(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...Fn(p)?{"--image-aspect-ratio":Fr(p)}:{}},"aria-label":"Open journal gallery",children:r.jsx("img",{className:`${d}-cover-image ${Fn(p)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),F&&typeof document<"u"&&(()=>{const x=(s?document.getElementById(s):null)??document.body;return Yn.createPortal(r.jsx(iv,{prefix:d,entries:q,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:m,enableUrlSync:V,journalItemId:c,onBeforeClose:A,onClose:O}),x)})()]})},av=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
14709
15679
  import { createPortal } from 'react-dom';
14710
15680
  import { CommonComponentProps } from '../props';
14711
15681
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -15461,7 +16431,7 @@ export type LightboxJournalSettings = {
15461
16431
  closeIconColor: string;
15462
16432
  closeIconHoverColor: string;
15463
16433
  };
15464
- `,Ay="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>'),li={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 Fy(e){const t={};return t[Ze(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ze(e,"fontSettings")]={...li.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ze(e,"fontSize")]={...li.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ze(e,"lineHeight")]={...li.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ze(e,"letterSpacing")]={...li.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ze(e,"wordSpacing")]={...li.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ze(e,"textAlign")]={...li.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ze(e,"textAppearance")]={...li.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Wy=Kn.reduce((e,t)=>({...e,...Fy(t)}),{}),_y=Kn.reduce((e,t)=>({...e,[Ze(t,"fontFamily")]:"Goudy Bookletter 1911",[Ze(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ze(t,"letterSpacing")]:0,[Ze(t,"wordSpacing")]:0,[Ze(t,"textAlign")]:"left",[Ze(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function aa(e){return Kn.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ze(n,"fontSize")]=i),o!==void 0&&(t[Ze(n,"lineHeight")]=o),t},{})}const Hy=Xg(),Ny={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"}},...Wy,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:Ay,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",..._y,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,...aa({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,...aa({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,...aa({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:[Hy]}],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"}]}]}},Oy={element:Py,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:Ny,sourceCode:ky,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Kn.map(e=>({path:`${Ze(e,"fontFamily")}`}))]},fontRelations:{...Kn.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ze(t,"fontFamily")}`}),{})}},Dy={sizeType:"custom",value:700,min:400,max:700};function fr(e,t){return{widthPx:e,heightPx:e*t}}function Ra(e,t,n,i,o,s){return{x:Math.min(Math.max(e,o/2),n-o/2),y:Math.min(Math.max(t,s/2),i-s/2)}}function gl(e,t,n,i){const{heightPx:o}=fr(n,i);return Ra(e/2,t/2,e,t,n,o)}function Bc(e,t,n){for(const i of n){const{heightPx:o}=fr(i.widthPx,i.aspectRatio),s=i.widthPx/2,l=o/2;if(e>=i.x-s&&e<=i.x+s&&t>=i.y-l&&t<=i.y+l)return!0}return!1}function jy(e,t,n,i,o,s,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":Bc(e,t,n)||s==="area"?l??"none":d??"none"}function hl(e,t,n){var d;const{sizeType:i,value:o,min:s,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-s)+s)}function zy(e){return`
16434
+ `,sv="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>'),li={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 lv(e){const t={};return t[et(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSettings")]={...li.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSize")]={...li.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[et(e,"lineHeight")]={...li.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[et(e,"letterSpacing")]={...li.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[et(e,"wordSpacing")]={...li.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[et(e,"textAlign")]={...li.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[et(e,"textAppearance")]={...li.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const cv=Xn.reduce((e,t)=>({...e,...lv(t)}),{}),dv=Xn.reduce((e,t)=>({...e,[et(t,"fontFamily")]:"Goudy Bookletter 1911",[et(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[et(t,"letterSpacing")]:0,[et(t,"wordSpacing")]:0,[et(t,"textAlign")]:"left",[et(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function la(e){return Xn.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[et(n,"fontSize")]=i),o!==void 0&&(t[et(n,"lineHeight")]=o),t},{})}const uv=$h(),pv={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:sv,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...dv,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,...la({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,...la({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,...la({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:[uv]}],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"}]}]}},mv={element:rv,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:pv,sourceCode:av,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Xn.map(e=>({path:`${et(e,"fontFamily")}`}))]},fontRelations:{...Xn.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${et(t,"fontFamily")}`}),{})}},gv={sizeType:"custom",value:700,min:400,max:700};function yr(e,t){return{widthPx:e,heightPx:e*t}}function Ma(e,t,n,i,o,s){return{x:Math.min(Math.max(e,o/2),n-o/2),y:Math.min(Math.max(t,s/2),i-s/2)}}function yl(e,t,n,i){const{heightPx:o}=yr(n,i);return Ma(e/2,t/2,e,t,n,o)}function qc(e,t,n){for(const i of n){const{heightPx:o}=yr(i.widthPx,i.aspectRatio),s=i.widthPx/2,l=o/2;if(e>=i.x-s&&e<=i.x+s&&t>=i.y-l&&t<=i.y+l)return!0}return!1}function hv(e,t,n,i,o,s,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":qc(e,t,n)||s==="area"?l??"none":d??"none"}function vl(e,t,n){var d;const{sizeType:i,value:o,min:s,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-s)+s)}function fv(e){return`
15465
16435
  .${e}-root {
15466
16436
  position: absolute;
15467
16437
  top: 0;
@@ -15496,7 +16466,7 @@ export type LightboxJournalSettings = {
15496
16466
  width: 32px;
15497
16467
  height: 32px;
15498
16468
  }
15499
- `}function By(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 Vy(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await By(i)]));return new Map(n)}function Gy({settings:e,content:t=[],isEditor:n}){const{prefix:i}=S.useScopedStyles(),[o,s]=a.useState(null),[l,d]=a.useState([]),[c,u]=a.useState(0),p=a.useRef(0),[x,v]=a.useState({x:0,y:0}),[f,h]=a.useState("none"),m=a.useRef({x:0,y:0}),[b,I]=a.useState(!1),[R,T]=a.useState(!1),U=a.useRef(new Map),{imageSize:A=Dy,cursor:B="system",target:P="area",position:L="random",visible:j="all",defaultCursor:w=null,hoverCursor:W=null}=e,E=t.filter(C=>{var M;return!!((M=C==null?void 0:C.image)!=null&&M.url)}),J=a.useMemo(()=>zy(i),[i]),F=a.useCallback((C,M,O=l)=>{if(!o)return;const re=o.getBoundingClientRect(),ne=C-re.left,$=M-re.top;v({x:ne,y:$}),h(jy(ne,$,O,o,B,P,W,w))},[o,l,B,P,W,w]);a.useEffect(()=>{const C=[...E.map(O=>O.image.url),w,W].filter(O=>!!O);if(C.length===0){U.current=new Map,T(!0);return}let M=!1;return T(!1),Vy(C).then(O=>{M||(U.current=O,T(!0))}),()=>{M=!0}},[t,w,W]),a.useEffect(()=>{if(!o)return;const C=O=>{O.stopPropagation(),m.current={x:O.clientX,y:O.clientY},F(O.clientX,O.clientY)},M=()=>{b&&F(m.current.x,m.current.y)};return o.addEventListener("mousemove",C),window.addEventListener("scroll",M,!0),()=>{o.removeEventListener("mousemove",C),window.removeEventListener("scroll",M,!0)}},[o,b,F]),a.useEffect(()=>{!o||!b||F(m.current.x,m.current.y)},[l,o,b,F]),a.useEffect(()=>{b||h("none")},[b]);const X=(C,M,O,re={})=>{var K,fe;if(!((K=C==null?void 0:C.image)!=null&&K.url))return null;const ne=((fe=U.current.get(C.image.url))==null?void 0:fe.aspectRatio)??1,$=hl(C.image.url,A,U.current),{heightPx:ae}=fr($,ne);let k=0,te=0;return L==="same"?{x:k,y:te}=gl(M,O,$,ne):(k=re.x??Math.random()*M,te=re.y??Math.random()*O,{x:k,y:te}=Ra(k,te,M,O,$,ae)),{id:p.current++,url:C.image.url,link:C.link,name:C.image.name,x:k,y:te,xRatio:k/M,yRatio:te/O,aspectRatio:ne,widthPx:$}},G=()=>{if(!o)return;const C=o.getBoundingClientRect(),M=C.width,O=C.height;M===0||O===0||d(re=>re.length===0?re:re.map(ne=>{const $=A.sizeType==="random"?ne.widthPx:hl(ne.url,A,U.current),{heightPx:ae}=fr($,ne.aspectRatio);if(L==="same"){const{x:K,y:fe}=gl(M,O,$,ne.aspectRatio);return{...ne,x:K,y:fe,widthPx:$}}const{x:k,y:te}=Ra(ne.xRatio*M,ne.yRatio*O,M,O,$,ae);return{...ne,x:k,y:te,widthPx:$}}))};a.useEffect(()=>{if(!o||E.length===0||!R)return;const C=o.getBoundingClientRect(),M=C.width,O=C.height,re=X(E[0],M,O);re&&(d([re]),u(E.length>1?1:0))},[A,L,o,t,R]),a.useEffect(()=>{if(!o)return;G();const C=new ResizeObserver(G);return C.observe(o),window.addEventListener("resize",G),()=>{C.disconnect(),window.removeEventListener("resize",G)}},[o,L,A,l.length]),a.useEffect(()=>{j==="last One"&&d(C=>C.length>0?[C[C.length-1]]:[])},[j]);const V=C=>{if(!o||E.length===0||!R)return;const M=o.getBoundingClientRect(),O=C.clientX-M.left,re=C.clientY-M.top;if(P==="image"&&!Bc(O,re,l))return;let ne=0,$=0;L==="on Click"?(ne=O,$=re):L==="same"?(ne=M.width/2,$=M.height/2):(ne=Math.random()*M.width,$=Math.random()*M.height);const ae=E[c%E.length],k=X(ae,M.width,M.height,{x:ne,y:$});if(!k)return;const te=j==="all"?[...l,k]:[k];d(te),u(K=>(K+1)%E.length),F(C.clientX,C.clientY,te)},ie=B==="custom"&&f!=="none";return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:J}}),r.jsxs("div",{ref:s,onClick:V,onMouseEnter:()=>I(!0),onMouseLeave:()=>I(!1),className:`${i}-root`,style:{cursor:ie?"none":"default"},children:[l.map(C=>r.jsx("div",{className:`${i}-wrapper`,style:{top:`${C.y}px`,left:`${C.x}px`,width:`${C.widthPx}px`,cursor:ie?"none":"default"},children:P==="area"&&C.link?r.jsx("a",{href:C.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:r.jsx("img",{src:C.url,alt:C.name,className:`${i}-image`})}):r.jsx("img",{src:C.url,alt:C.name,className:`${i}-image`})},C.id)),b&&ie&&r.jsx("div",{className:`${i}-cursor`,style:{left:`${x.x}px`,top:`${x.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${f}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const Uy=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
16469
+ `}function yv(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 vv(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await yv(i)]));return new Map(n)}function xv({settings:e,content:t=[],isEditor:n}){const{prefix:i}=C.useScopedStyles(),[o,s]=a.useState(null),[l,d]=a.useState([]),[c,u]=a.useState(0),p=a.useRef(0),[v,y]=a.useState({x:0,y:0}),[g,h]=a.useState("none"),m=a.useRef({x:0,y:0}),[b,I]=a.useState(!1),[R,T]=a.useState(!1),q=a.useRef(new Map),{imageSize:F=gv,cursor:V="system",target:A="area",position:L="random",visible:O="all",defaultCursor:x=null,hoverCursor:W=null}=e,E=t.filter(S=>{var M;return!!((M=S==null?void 0:S.image)!=null&&M.url)}),J=a.useMemo(()=>fv(i),[i]),P=a.useCallback((S,M,D=l)=>{if(!o)return;const le=o.getBoundingClientRect(),oe=S-le.left,$=M-le.top;y({x:oe,y:$}),h(hv(oe,$,D,o,V,A,W,x))},[o,l,V,A,W,x]);a.useEffect(()=>{const S=[...E.map(D=>D.image.url),x,W].filter(D=>!!D);if(S.length===0){q.current=new Map,T(!0);return}let M=!1;return T(!1),vv(S).then(D=>{M||(q.current=D,T(!0))}),()=>{M=!0}},[t,x,W]),a.useEffect(()=>{if(!o)return;const S=D=>{D.stopPropagation(),m.current={x:D.clientX,y:D.clientY},P(D.clientX,D.clientY)},M=()=>{b&&P(m.current.x,m.current.y)};return o.addEventListener("mousemove",S),window.addEventListener("scroll",M,!0),()=>{o.removeEventListener("mousemove",S),window.removeEventListener("scroll",M,!0)}},[o,b,P]),a.useEffect(()=>{!o||!b||P(m.current.x,m.current.y)},[l,o,b,P]),a.useEffect(()=>{b||h("none")},[b]);const K=(S,M,D,le={})=>{var X,ve;if(!((X=S==null?void 0:S.image)!=null&&X.url))return null;const oe=((ve=q.current.get(S.image.url))==null?void 0:ve.aspectRatio)??1,$=vl(S.image.url,F,q.current),{heightPx:ae}=yr($,oe);let k=0,te=0;return L==="same"?{x:k,y:te}=yl(M,D,$,oe):(k=le.x??Math.random()*M,te=le.y??Math.random()*D,{x:k,y:te}=Ma(k,te,M,D,$,ae)),{id:p.current++,url:S.image.url,link:S.link,name:S.image.name,x:k,y:te,xRatio:k/M,yRatio:te/D,aspectRatio:oe,widthPx:$}},B=()=>{if(!o)return;const S=o.getBoundingClientRect(),M=S.width,D=S.height;M===0||D===0||d(le=>le.length===0?le:le.map(oe=>{const $=F.sizeType==="random"?oe.widthPx:vl(oe.url,F,q.current),{heightPx:ae}=yr($,oe.aspectRatio);if(L==="same"){const{x:X,y:ve}=yl(M,D,$,oe.aspectRatio);return{...oe,x:X,y:ve,widthPx:$}}const{x:k,y:te}=Ma(oe.xRatio*M,oe.yRatio*D,M,D,$,ae);return{...oe,x:k,y:te,widthPx:$}}))};a.useEffect(()=>{if(!o||E.length===0||!R)return;const S=o.getBoundingClientRect(),M=S.width,D=S.height,le=K(E[0],M,D);le&&(d([le]),u(E.length>1?1:0))},[F,L,o,t,R]),a.useEffect(()=>{if(!o)return;B();const S=new ResizeObserver(B);return S.observe(o),window.addEventListener("resize",B),()=>{S.disconnect(),window.removeEventListener("resize",B)}},[o,L,F,l.length]),a.useEffect(()=>{O==="last One"&&d(S=>S.length>0?[S[S.length-1]]:[])},[O]);const z=S=>{if(!o||E.length===0||!R)return;const M=o.getBoundingClientRect(),D=S.clientX-M.left,le=S.clientY-M.top;if(A==="image"&&!qc(D,le,l))return;let oe=0,$=0;L==="on Click"?(oe=D,$=le):L==="same"?(oe=M.width/2,$=M.height/2):(oe=Math.random()*M.width,$=Math.random()*M.height);const ae=E[c%E.length],k=K(ae,M.width,M.height,{x:oe,y:$});if(!k)return;const te=O==="all"?[...l,k]:[k];d(te),u(X=>(X+1)%E.length),P(S.clientX,S.clientY,te)},ie=V==="custom"&&g!=="none";return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:J}}),r.jsxs("div",{ref:s,onClick:z,onMouseEnter:()=>I(!0),onMouseLeave:()=>I(!1),className:`${i}-root`,style:{cursor:ie?"none":"default"},children:[l.map(S=>r.jsx("div",{className:`${i}-wrapper`,style:{top:`${S.y}px`,left:`${S.x}px`,width:`${S.widthPx}px`,cursor:ie?"none":"default"},children:A==="area"&&S.link?r.jsx("a",{href:S.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:r.jsx("img",{src:S.url,alt:S.name,className:`${i}-image`})}):r.jsx("img",{src:S.url,alt:S.name,className:`${i}-image`})},S.id)),b&&ie&&r.jsx("div",{className:`${i}-cursor`,style:{left:`${v.x}px`,top:`${v.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const bv=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
15500
16470
  import { CommonComponentProps } from '../props';
15501
16471
  import { useScopedStyles } from '../utils/index';
15502
16472
 
@@ -16026,7 +16996,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
16026
16996
  </>
16027
16997
  );
16028
16998
  }
16029
- `,qy={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"]}]}]},Ky={element:Gy,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:qy,sourceCode:Uy,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"defaultCursor"},{path:"hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]}},Xy=100,Yy=70,Dn="cubic-bezier(0.86, 0, 0.07, 1)";function Zy(e){return`
16999
+ `,wv={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"]}]}]},Sv={element:xv,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:wv,sourceCode:bv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"defaultCursor"},{path:"hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]}},$v=100,Cv=70,Dn="cubic-bezier(0.86, 0, 0.07, 1)";function Tv(e){return`
16030
17000
  .${e}-wrapper {
16031
17001
  position: relative;
16032
17002
  width: 100%;
@@ -16136,7 +17106,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
16136
17106
  display: block;
16137
17107
  pointer-events: none;
16138
17108
  }
16139
- `}function Jy(e){return e==="blur"?Yy:e==="greyscale"?Xy:0}function no(e,t=1,n=1){const i=Jy(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 fl(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function Qy(e,t){return t<=1?0:(e-1+t)%t}function ev(e,t=1){return!e||e.height===0?t:e.width/e.height}function tv(e,t,n,i,o){if(e<=0||t<=0)return{widthPercent:i,heightPercent:o};const s=e*i/100,l=t*o/100;let d=s,c=d/n;return c>l&&(c=l,d=c*n),{widthPercent:d/e*100,heightPercent:c/t*100}}function yl(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 Vc(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function vl(e,t,n){return{...Vc(e),[`--${n}-stage-scale`]:t}}function nv(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 iv({settings:e,content:t,isEditor:n,isPreviewMode:i}){var be,z,se,pe,xe,Re,Te;const{prefix:o}=S.useScopedStyles(),s=a.useMemo(()=>Zy(o),[o]),{imageSize:l,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:p="greyscale"}=e,x=t??[],v=fl(x.length),[f,h]=a.useState(v.activeIndex),[m,b]=a.useState(v.backgroundIndex),[I,R]=a.useState(!1),[T,U]=a.useState(!1),[A,B]=a.useState(null),[P,L]=a.useState(null),[j,w]=a.useState(0),[W,E]=a.useState(1),[J,F]=a.useState("none"),[X,G]=a.useState("next"),[V,ie]=a.useState({}),[C,M]=a.useState({width:0,height:0}),O=a.useRef(null),re=a.useRef(null),ne=!n||!!i,$=l??60,ae=Math.max(10,Math.min(100,d??$)),k=Math.max(10,Math.min(100,c??$)),te=Math.max(100,u),K=no(p),fe=a.useCallback(_=>{const he=ev(_?V[_]:void 0);return tv(C.width,C.height,he,ae,k)},[C.height,C.width,V,k,ae]);a.useEffect(()=>{const _=re.current;if(!_)return;const he=new ResizeObserver(([oe])=>{const{width:H,height:ee}=oe.contentRect;M({width:H,height:ee})});return he.observe(_),()=>he.disconnect()},[]),a.useEffect(()=>{const _=(t??[]).map(he=>{var oe;return(oe=he.image)==null?void 0:oe.url}).filter(he=>!!he);nv(_,(he,oe)=>{ie(H=>{var ee,Me;return((ee=H[he])==null?void 0:ee.width)===oe.width&&((Me=H[he])==null?void 0:Me.height)===oe.height?H:{...H,[he]:oe}})})},[t]),a.useEffect(()=>{const{backgroundIndex:_,activeIndex:he}=fl(x.length);h(he),b(_),R(!1),U(!1),B(null),L(null),w(0),E(1),F("none"),G("next")},[x.length,t]),a.useEffect(()=>()=>{O.current&&clearTimeout(O.current)},[]);const Ie=a.useCallback(_=>{var le,D,Ve,Oe;if(!ne||I||x.length<=1)return;const he=_==="next"?(f+1)%x.length:(f-1+x.length)%x.length,oe=fe((D=(le=x[f])==null?void 0:le.image)==null?void 0:D.url),H=fe((Oe=(Ve=x[he])==null?void 0:Ve.image)==null?void 0:Oe.url),ee=yl(C.width,C.height,oe),Me=yl(C.width,C.height,H);O.current&&clearTimeout(O.current),G(_),U(!0),R(!0),_==="next"?(B(f),L(he),w(0),E(1),F(no(p,0,1))):(b(Qy(he,x.length)),B(he),L(f),w(1),E(Me),F(no(p,1,Me))),requestAnimationFrame(()=>{U(!1),requestAnimationFrame(()=>{_==="next"?(w(1),E(ee),F(no(p,1,ee))):(w(0),E(1),F(no(p,0,1)))})}),O.current=setTimeout(()=>{_==="next"&&b(f),h(he),B(null),L(null),R(!1)},te)},[f,p,C.height,C.width,fe,I,ne,x,te]),me=x[f],ue=m!==null?x[m]:null,q=A!==null?x[A]:null,Q=P!==null?x[P]:null,Y=x.length<=1?0:(f-1+x.length)%x.length,Ae=x.length<=1?0:(f+1)%x.length,Se=fe((be=me==null?void 0:me.image)==null?void 0:be.url),Ee=fe((z=q==null?void 0:q.image)==null?void 0:z.url),de=fe((se=Q==null?void 0:Q.image)==null?void 0:se.url),ge={[`--${o}-transition-ms`]:`${te}ms`};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:s}}),r.jsxs("div",{ref:re,className:rt(`${o}-wrapper`,T&&`${o}-snap`,n&&!i&&`${o}-editor`),style:ge,"aria-label":"Zoom gallery",children:[((pe=ue==null?void 0:ue.image)==null?void 0:pe.url)&&r.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:ue.image.url,alt:"",style:{filter:K}})}),I&&((xe=q==null?void 0:q.image)==null?void 0:xe.url)&&r.jsx("div",{className:rt(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${X}`),style:vl(Ee,W,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:q.image.url,alt:"",style:{filter:J}})}),I&&((Re=Q==null?void 0:Q.image)==null?void 0:Re.url)&&r.jsx("div",{className:rt(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${X}`),style:vl(de,j,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-image`,src:Q.image.url,alt:""})}),!I&&((Te=me==null?void 0:me.image)==null?void 0:Te.url)&&r.jsx("div",{className:rt(`${o}-stage`,`${o}-foreground`),style:Vc(Se),children:r.jsx("img",{className:`${o}-image`,src:me.image.url,alt:me.image.name??""})}),ne&&x.length>1&&!I&&r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:rt(`${o}-nav`,`${o}-nav-prev`),onClick:()=>Ie("prev"),"aria-label":`Show previous image (${Y+1} of ${x.length})`}),r.jsx("button",{type:"button",className:rt(`${o}-nav`,`${o}-nav-next`),onClick:()=>Ie("next"),"aria-label":`Show next image (${Ae+1} of ${x.length})`})]})]})]})}const ov=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
17109
+ `}function Lv(e){return e==="blur"?Cv:e==="greyscale"?$v:0}function io(e,t=1,n=1){const i=Lv(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 xl(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function Rv(e,t){return t<=1?0:(e-1+t)%t}function Iv(e,t=1){return!e||e.height===0?t:e.width/e.height}function Ev(e,t,n,i,o){if(e<=0||t<=0)return{widthPercent:i,heightPercent:o};const s=e*i/100,l=t*o/100;let d=s,c=d/n;return c>l&&(c=l,d=c*n),{widthPercent:d/e*100,heightPercent:c/t*100}}function bl(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 Uc(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function wl(e,t,n){return{...Uc(e),[`--${n}-stage-scale`]:t}}function Mv(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 Pv({settings:e,content:t,isEditor:n,isPreviewMode:i}){var we,G,se,pe,Se,Me,Le;const{prefix:o}=C.useScopedStyles(),s=a.useMemo(()=>Tv(o),[o]),{imageSize:l,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:p="greyscale"}=e,v=t??[],y=xl(v.length),[g,h]=a.useState(y.activeIndex),[m,b]=a.useState(y.backgroundIndex),[I,R]=a.useState(!1),[T,q]=a.useState(!1),[F,V]=a.useState(null),[A,L]=a.useState(null),[O,x]=a.useState(0),[W,E]=a.useState(1),[J,P]=a.useState("none"),[K,B]=a.useState("next"),[z,ie]=a.useState({}),[S,M]=a.useState({width:0,height:0}),D=a.useRef(null),le=a.useRef(null),oe=!n||!!i,$=l??60,ae=Math.max(10,Math.min(100,d??$)),k=Math.max(10,Math.min(100,c??$)),te=Math.max(100,u),X=io(p),ve=a.useCallback(H=>{const ye=Iv(H?z[H]:void 0);return Ev(S.width,S.height,ye,ae,k)},[S.height,S.width,z,k,ae]);a.useEffect(()=>{const H=le.current;if(!H)return;const ye=new ResizeObserver(([re])=>{const{width:_,height:ee}=re.contentRect;M({width:_,height:ee})});return ye.observe(H),()=>ye.disconnect()},[]),a.useEffect(()=>{const H=(t??[]).map(ye=>{var re;return(re=ye.image)==null?void 0:re.url}).filter(ye=>!!ye);Mv(H,(ye,re)=>{ie(_=>{var ee,Ae;return((ee=_[ye])==null?void 0:ee.width)===re.width&&((Ae=_[ye])==null?void 0:Ae.height)===re.height?_:{..._,[ye]:re}})})},[t]),a.useEffect(()=>{const{backgroundIndex:H,activeIndex:ye}=xl(v.length);h(ye),b(H),R(!1),q(!1),V(null),L(null),x(0),E(1),P("none"),B("next")},[v.length,t]),a.useEffect(()=>()=>{D.current&&clearTimeout(D.current)},[]);const Pe=a.useCallback(H=>{var ue,N,Ue,Oe;if(!oe||I||v.length<=1)return;const ye=H==="next"?(g+1)%v.length:(g-1+v.length)%v.length,re=ve((N=(ue=v[g])==null?void 0:ue.image)==null?void 0:N.url),_=ve((Oe=(Ue=v[ye])==null?void 0:Ue.image)==null?void 0:Oe.url),ee=bl(S.width,S.height,re),Ae=bl(S.width,S.height,_);D.current&&clearTimeout(D.current),B(H),q(!0),R(!0),H==="next"?(V(g),L(ye),x(0),E(1),P(io(p,0,1))):(b(Rv(ye,v.length)),V(ye),L(g),x(1),E(Ae),P(io(p,1,Ae))),requestAnimationFrame(()=>{q(!1),requestAnimationFrame(()=>{H==="next"?(x(1),E(ee),P(io(p,1,ee))):(x(0),E(1),P(io(p,0,1)))})}),D.current=setTimeout(()=>{H==="next"&&b(g),h(ye),V(null),L(null),R(!1)},te)},[g,p,S.height,S.width,ve,I,oe,v,te]),he=v[g],ce=m!==null?v[m]:null,U=F!==null?v[F]:null,Y=A!==null?v[A]:null,Z=v.length<=1?0:(g-1+v.length)%v.length,We=v.length<=1?0:(g+1)%v.length,$e=ve((we=he==null?void 0:he.image)==null?void 0:we.url),ke=ve((G=U==null?void 0:U.image)==null?void 0:G.url),de=ve((se=Y==null?void 0:Y.image)==null?void 0:se.url),fe={[`--${o}-transition-ms`]:`${te}ms`};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:s}}),r.jsxs("div",{ref:le,className:ut(`${o}-wrapper`,T&&`${o}-snap`,n&&!i&&`${o}-editor`),style:fe,"aria-label":"Zoom gallery",children:[((pe=ce==null?void 0:ce.image)==null?void 0:pe.url)&&r.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:ce.image.url,alt:"",style:{filter:X}})}),I&&((Se=U==null?void 0:U.image)==null?void 0:Se.url)&&r.jsx("div",{className:ut(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${K}`),style:wl(ke,W,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:U.image.url,alt:"",style:{filter:J}})}),I&&((Me=Y==null?void 0:Y.image)==null?void 0:Me.url)&&r.jsx("div",{className:ut(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${K}`),style:wl(de,O,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-image`,src:Y.image.url,alt:""})}),!I&&((Le=he==null?void 0:he.image)==null?void 0:Le.url)&&r.jsx("div",{className:ut(`${o}-stage`,`${o}-foreground`),style:Uc($e),children:r.jsx("img",{className:`${o}-image`,src:he.image.url,alt:he.image.name??""})}),oe&&v.length>1&&!I&&r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:ut(`${o}-nav`,`${o}-nav-prev`),onClick:()=>Pe("prev"),"aria-label":`Show previous image (${Z+1} of ${v.length})`}),r.jsx("button",{type:"button",className:ut(`${o}-nav`,`${o}-nav-next`),onClick:()=>Pe("next"),"aria-label":`Show next image (${We+1} of ${v.length})`})]})]})]})}const kv=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
16140
17110
  import cn from 'classnames';
16141
17111
  import { CommonComponentProps } from '../props';
16142
17112
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -16655,7 +17625,7 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
16655
17625
  </>
16656
17626
  );
16657
17627
  }
16658
- `,rv={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:""}}]}},av={element:iv,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:rv,sourceCode:ov,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},sv={backgroundColor:"background-color",textColor:"text-color",borderColor:"border-color",iconColor:"icon-color",boxShadowColor:"box-shadow-color",innerBoxShadowColor:"inner-box-shadow-color"},lv=["hover","active"],sa={left:"flex-start",center:"center",right:"flex-end"};function cv(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 dv(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 uv(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))`,s=`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}, ${s}`,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`,v=`.${e}-button:hover, ${x}`,f=h=>`.${e}-hover-effect-${h}:hover, .${e}-hover-effect-${h}:focus-visible, a:focus-visible .${e}-hover-effect-${h}`;return`
17628
+ `,Av={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:""}}]}},Fv={element:Pv,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:Av,sourceCode:kv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Wv={backgroundColor:"background-color",textColor:"text-color",borderColor:"border-color",iconColor:"icon-color",boxShadowColor:"box-shadow-color",innerBoxShadowColor:"inner-box-shadow-color"},_v=["hover","active"],ca={left:"flex-start",center:"center",right:"flex-end"};function Hv(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 Nv(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 Ov(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))`,s=`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}, ${s}`,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}`,v=`.${e}-button:focus-visible, a:focus-visible .${e}-button`,y=`.${e}-button:hover, ${v}`,g=h=>`.${e}-hover-effect-${h}:hover, .${e}-hover-effect-${h}:focus-visible, a:focus-visible .${e}-hover-effect-${h}`;return`
16659
17629
  .${e}-root {
16660
17630
  line-height: 0;
16661
17631
  }
@@ -16685,11 +17655,11 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
16685
17655
  .${e}-wrapper.${e}-editing .${e}-button {
16686
17656
  transition: color 250ms, background-color 250ms, border-color 250ms, transform 250ms;
16687
17657
  }
16688
- ${f("scale-up")},
17658
+ ${g("scale-up")},
16689
17659
  .${e}-wrapper.${e}-state-hover .${e}-hover-effect-scale-up {
16690
17660
  transform: scale(1.05);
16691
17661
  }
16692
- ${f("lift")},
17662
+ ${g("lift")},
16693
17663
  .${e}-wrapper.${e}-state-hover .${e}-hover-effect-lift {
16694
17664
  transform: translateY(-2px);
16695
17665
  box-shadow: ${p};
@@ -16751,9 +17721,9 @@ a:focus-visible .${e}-hover-effect-swipe::before,
16751
17721
  .${e}-wrapper.${e}-state-hover .${e}-hover-effect-swipe::before {
16752
17722
  transform: translateX(0);
16753
17723
  }
16754
- ${f("reveal")},
17724
+ ${g("reveal")},
16755
17725
  .${e}-wrapper.${e}-state-hover .${e}-hover-effect-reveal,
16756
- ${f("swipe")},
17726
+ ${g("swipe")},
16757
17727
  .${e}-wrapper.${e}-state-hover .${e}-hover-effect-swipe {
16758
17728
  background-color: var(--${e}-background-color);
16759
17729
  }
@@ -16816,7 +17786,7 @@ a:focus-visible .${e}-hover-effect-content-roll .${e}-content-roll-layer-hover,
16816
17786
  transform: translateY(-50%);
16817
17787
  opacity: 1;
16818
17788
  }
16819
- ${v} {
17789
+ ${y} {
16820
17790
  background-color: var(--${e}-hover-background-color, var(--${e}-background-color));
16821
17791
  color: var(--${e}-hover-text-color, var(--${e}-text-color));
16822
17792
  border-color: var(--${e}-hover-border-color, var(--${e}-border-color));
@@ -16895,7 +17865,7 @@ a:active .${e}-button .${e}-icon-image,
16895
17865
  height: calc(1em * var(--${e}-icon-scale, 1));
16896
17866
  width: calc(1em * var(--${e}-icon-scale, 1));
16897
17867
  }
16898
- `}function la(e,t,n="",i,o){const s=t();return r.jsxs("span",{className:`${e}-content-roll-wrap ${n}`.trim(),style:i,children:[r.jsx("span",{className:`${e}-content-roll-spacer`,"aria-hidden":"true",style:o,children:s}),r.jsxs("span",{className:`${e}-content-roll-viewport`,children:[r.jsx("span",{className:`${e}-content-roll-layer`,style:o,children:t()}),r.jsx("span",{className:`${e}-content-roll-layer ${e}-content-roll-layer-hover`,"aria-hidden":"true",style:o,children:t()})]})]})}function bl(e,t,n="fill",i=100,o=0,s){if(!t)return null;const l=r.jsx(rn,{url:t,fill:`var(--${e}-icon-color)`,hoverFill:`var(--${e}-icon-color)`,className:`${e}-icon-image`});if(n==="inline")return r.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=S.scalingValue(o,s);return r.jsx("span",{className:`${e}-icon`,style:{width:d,height:d},"aria-hidden":"true",children:l})}return r.jsx("span",{className:`${e}-icon ${e}-icon-fill`,"aria-hidden":"true",children:l})}function pv({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:s}=S.useScopedStyles(),l=a.useMemo(()=>uv(s),[s]),{type:d="a",label:c="Button",icon:u,alignment:p="center",alignA:x,order:v="text-icon",gap:f=0,iconSize:h=0,iconWidthC:m=0,dimensions:b=!1,padding:I={top:0,right:0,bottom:0,left:0},cornerRadius:R=0,boxShadow:T={top:0,left:0,right:0,bottom:0},boxShadowColor:U="rgba(0, 0, 0, 0)",innerBoxShadow:A={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:B="rgba(0, 0, 0, 0)",stroke:P=0,backgroundColor:L="#000000",textColor:j="#ffffff",borderColor:w="#ffffff",iconColor:W="#ffffff",hoverEffect:E="none",fontFamily:J,fontSettings:F,fontSize:X,lineHeight:G,letterSpacing:V=0,wordSpacing:ie=0,textAppearance:C,stateOverrides:M,minWidth:O=0,minHeight:re=0,width:ne=0,height:$=0}=e,ae=S.buildColorVars(s,{backgroundColor:L,textColor:j,borderColor:w,iconColor:W,boxShadowColor:U,innerBoxShadowColor:B},sv,lv,M),k=i&&i!=="default"?`${s}-state-${i}`:"",te=t&&!n?`${s}-editing`:"",K=E!=="none"&&(!t||n||i==="hover")?`${s}-hover-effect-${E}`:"",fe=E==="reveal"||E==="swipe",Ie=E==="content-roll",me=E==="reveal"&&(!t||n),ue=b===!0,Q=d==="a"?x??p:p,Y=d==="c",Ae=d!=="b",Se={fontSettings:{fontFamily:J,fontWeight:(F==null?void 0:F.fontWeight)??400,fontStyle:(F==null?void 0:F.fontStyle)??"normal"},fontSize:X??.01,lineHeight:G,letterSpacing:V,wordSpacing:ie,textAppearance:C,color:j},de={...Ae?on(qt(Se,t)):{},[`--${s}-box-shadow-x`]:S.scalingValue(T.left,t),[`--${s}-box-shadow-y`]:S.scalingValue(T.top,t),[`--${s}-box-shadow-blur`]:S.scalingValue(T.right,t),[`--${s}-box-shadow-spread`]:S.scalingValue(T.bottom,t),[`--${s}-inner-box-shadow-x`]:S.scalingValue(A.left,t),[`--${s}-inner-box-shadow-y`]:S.scalingValue(A.top,t),[`--${s}-inner-box-shadow-blur`]:S.scalingValue(A.right,t),[`--${s}-inner-box-shadow-spread`]:S.scalingValue(A.bottom,t),paddingTop:S.scalingValue(I.top,t),paddingRight:S.scalingValue(I.right,t),paddingBottom:S.scalingValue(I.bottom,t),paddingLeft:S.scalingValue(I.left,t),borderRadius:S.scalingValue(R,t),borderWidth:S.scalingValue(P,t),...Y?{}:{justifyContent:sa[Q],textAlign:Q},...Y&&!Ie?{gap:S.scalingValue(f,t)}:{},...ue?{width:S.scalingValue(ne,t),height:S.scalingValue($,t)}:{minWidth:S.scalingValue(O,t),minHeight:S.scalingValue(re,t),...Y?{width:"100%"}:{}}};let ge;const be={display:"inline-flex",alignItems:"center",justifyContent:Y?sa[Q]:sa[d==="a"?Q:"center"],gap:Y?S.scalingValue(f,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:Q}:{}};if(d==="b"){const pe=()=>bl(s,u,h>0?"fixed":"fill",100,h,t);ge=Ie?la(s,pe,`${s}-icon-roll`,void 0,be):pe()}else if(d==="c"){const pe=()=>{const xe=r.jsx("span",{className:`${s}-text`,style:{textAlign:Q},children:c}),Re=bl(s,u,m>0?"fixed":"fill",100,m,t);return v==="icon-text"?r.jsxs(r.Fragment,{children:[Re,xe]}):r.jsxs(r.Fragment,{children:[xe,Re]})};ge=Ie?la(s,pe,`${s}-icon-text-roll`,void 0,be):pe()}else ge=Ie?la(s,()=>c,`${s}-label-roll`,void 0,be):fe?r.jsx("span",{className:`${s}-button-inner`,children:c}):c;const z=me?pe=>cv(pe,s):void 0,se=me?pe=>dv(pe,s):void 0;return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),r.jsx("div",{className:`${s}-root`,style:ae,children:r.jsx("div",{className:`${s}-wrapper ${k} ${te}`.trim(),children:r.jsx("div",{className:`${s}-button ${K}`.trim(),style:de,onMouseEnter:z,onMouseLeave:se,role:"button",tabIndex:o||t&&!n?void 0:0,children:ge})})})]})}const mv=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
17868
+ `}function da(e,t,n="",i,o){const s=t();return r.jsxs("span",{className:`${e}-content-roll-wrap ${n}`.trim(),style:i,children:[r.jsx("span",{className:`${e}-content-roll-spacer`,"aria-hidden":"true",style:o,children:s}),r.jsxs("span",{className:`${e}-content-roll-viewport`,children:[r.jsx("span",{className:`${e}-content-roll-layer`,style:o,children:t()}),r.jsx("span",{className:`${e}-content-roll-layer ${e}-content-roll-layer-hover`,"aria-hidden":"true",style:o,children:t()})]})]})}function Sl(e,t,n="fill",i=100,o=0,s){if(!t)return null;const l=r.jsx(an,{url:t,fill:`var(--${e}-icon-color)`,hoverFill:`var(--${e}-icon-color)`,className:`${e}-icon-image`});if(n==="inline")return r.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=C.scalingValue(o,s);return r.jsx("span",{className:`${e}-icon`,style:{width:d,height:d},"aria-hidden":"true",children:l})}return r.jsx("span",{className:`${e}-icon ${e}-icon-fill`,"aria-hidden":"true",children:l})}function Dv({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:s}=C.useScopedStyles(),l=a.useMemo(()=>Ov(s),[s]),{type:d="a",label:c="Button",icon:u,alignment:p="center",alignA:v,order:y="text-icon",gap:g=0,iconSize:h=0,iconWidthC:m=0,dimensions:b=!1,padding:I={top:0,right:0,bottom:0,left:0},cornerRadius:R=0,boxShadow:T={top:0,left:0,right:0,bottom:0},boxShadowColor:q="rgba(0, 0, 0, 0)",innerBoxShadow:F={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:V="rgba(0, 0, 0, 0)",stroke:A=0,backgroundColor:L="#000000",textColor:O="#ffffff",borderColor:x="#ffffff",iconColor:W="#ffffff",hoverEffect:E="none",fontFamily:J,fontSettings:P,fontSize:K,lineHeight:B,letterSpacing:z=0,wordSpacing:ie=0,textAppearance:S,stateOverrides:M,minWidth:D=0,minHeight:le=0,width:oe=0,height:$=0}=e,ae=C.buildColorVars(s,{backgroundColor:L,textColor:O,borderColor:x,iconColor:W,boxShadowColor:q,innerBoxShadowColor:V},Wv,_v,M),k=i&&i!=="default"?`${s}-state-${i}`:"",te=t&&!n?`${s}-editing`:"",X=E!=="none"&&(!t||n||i==="hover")?`${s}-hover-effect-${E}`:"",ve=E==="reveal"||E==="swipe",Pe=E==="content-roll",he=E==="reveal"&&(!t||n),ce=b===!0,Y=d==="a"?v??p:p,Z=d==="c",We=d!=="b",$e={fontSettings:{fontFamily:J,fontWeight:(P==null?void 0:P.fontWeight)??400,fontStyle:(P==null?void 0:P.fontStyle)??"normal"},fontSize:K??.01,lineHeight:B,letterSpacing:z,wordSpacing:ie,textAppearance:S,color:O},de={...We?rn(Xt($e,t)):{},[`--${s}-box-shadow-x`]:C.scalingValue(T.left,t),[`--${s}-box-shadow-y`]:C.scalingValue(T.top,t),[`--${s}-box-shadow-blur`]:C.scalingValue(T.right,t),[`--${s}-box-shadow-spread`]:C.scalingValue(T.bottom,t),[`--${s}-inner-box-shadow-x`]:C.scalingValue(F.left,t),[`--${s}-inner-box-shadow-y`]:C.scalingValue(F.top,t),[`--${s}-inner-box-shadow-blur`]:C.scalingValue(F.right,t),[`--${s}-inner-box-shadow-spread`]:C.scalingValue(F.bottom,t),paddingTop:C.scalingValue(I.top,t),paddingRight:C.scalingValue(I.right,t),paddingBottom:C.scalingValue(I.bottom,t),paddingLeft:C.scalingValue(I.left,t),borderRadius:C.scalingValue(R,t),borderWidth:C.scalingValue(A,t),...Z?{}:{justifyContent:ca[Y],textAlign:Y},...Z&&!Pe?{gap:C.scalingValue(g,t)}:{},...ce?{width:C.scalingValue(oe,t),height:C.scalingValue($,t)}:{minWidth:C.scalingValue(D,t),minHeight:C.scalingValue(le,t),...Z?{width:"100%"}:{}}};let fe;const we={display:"inline-flex",alignItems:"center",justifyContent:Z?ca[Y]:ca[d==="a"?Y:"center"],gap:Z?C.scalingValue(g,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:Y}:{}};if(d==="b"){const pe=()=>Sl(s,u,h>0?"fixed":"fill",100,h,t);fe=Pe?da(s,pe,`${s}-icon-roll`,void 0,we):pe()}else if(d==="c"){const pe=()=>{const Se=r.jsx("span",{className:`${s}-text`,style:{textAlign:Y},children:c}),Me=Sl(s,u,m>0?"fixed":"fill",100,m,t);return y==="icon-text"?r.jsxs(r.Fragment,{children:[Me,Se]}):r.jsxs(r.Fragment,{children:[Se,Me]})};fe=Pe?da(s,pe,`${s}-icon-text-roll`,void 0,we):pe()}else fe=Pe?da(s,()=>c,`${s}-label-roll`,void 0,we):ve?r.jsx("span",{className:`${s}-button-inner`,children:c}):c;const G=he?pe=>Hv(pe,s):void 0,se=he?pe=>Nv(pe,s):void 0;return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),r.jsx("div",{className:`${s}-root`,style:ae,children:r.jsx("div",{className:`${s}-wrapper ${k} ${te}`.trim(),children:r.jsx("div",{className:`${s}-button ${X}`.trim(),style:de,onMouseEnter:G,onMouseLeave:se,role:"button",tabIndex:o||t&&!n?void 0:0,children:fe})})})]})}const jv=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
16899
17869
  import { SvgImage } from '../helpers/SvgImage/SvgImage';
16900
17870
  import { CommonComponentProps } from '../props';
16901
17871
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
@@ -17522,7 +18492,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
17522
18492
  </>
17523
18493
  );
17524
18494
  }
17525
- `,gv={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},hv=["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],fv={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:{...gv.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:[...hv],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"]},yv={element:pv,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:fv,sourceCode:mv,assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{fontSettings:"fontFamily"}};function vv(e){return`
18495
+ `,zv={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Bv=["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],Vv={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:{...zv.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:[...Bv],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"]},Gv={element:Dv,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:Vv,sourceCode:jv,assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{fontSettings:"fontFamily"}};function qv(e){return`
17526
18496
  .${e}-titles-row {
17527
18497
  position: relative;
17528
18498
  flex: 0 1 auto;
@@ -17720,7 +18690,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
17720
18690
  pointer-events: auto;
17721
18691
  flex-shrink: 0;
17722
18692
  }
17723
- `}const Cn=500,io=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",bv=72,xv=50,wv=1e4,Sv=650,$v=500;function Cv(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,s=e.top-t.top;return`translate(${o}px, ${s}px) scale(${n}, ${i})`}function Gc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=mr(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 Tv(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Gc(i,n):null}function Lv(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 ao(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 xl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return ao(e,i,n)}const Rv=.03;function Uc(e){return e.width*Rv}const ca={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Zo(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function wl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Iv(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Ia(e,t,n){const i=e.getBoundingClientRect(),o=i.width,s=i.height,l=t/n,d=o/s;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(s-u)/2}}const c=s*l;return{width:c,height:s,left:i.left+(o-c)/2,top:i.top}}function Ev(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Ia(e,t.width,t.height)}function Mv(e,t){if(Fr(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 Pv(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 kv({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Fr(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function Ui(e,t,n){const{width:i,height:o,top:s}=e,{left:l,width:d}=n,c=Uc(n);return t==="left"?{left:l+c-i,top:s,width:i,height:o}:{left:l+d-c,top:s,width:i,height:o}}function yr(e,t,n){const i=Ui(e,t,n);return{...i,left:2*i.left-e.left}}function Av(e,t,n){const{left:i,width:o}=n,s=Uc(n);return t==="left"?{left:i,top:e.top,width:s,height:e.height}:{left:i+o-s,top:e.top,width:s,height:e.height}}function qc(e,t,n,i){const o=Ui(e,"left",i),s=Ui(e,"right",i),l=yr(e,"left",i),d=yr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:s,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:d,end:s};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:s};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:s,end:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function Fv(e,t,n,i){const{start:o,end:s}=qc(e,t,n,i);return{x:s.left-o.left,y:s.top-o.top}}function Wv(e,t,n){const i=Ui(e,t,n),o=yr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Fr(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function _v({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:s,onTransitionEnd:l}){const d=a.useRef(null);return a.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:l,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:s,onClick:c=>c.stopPropagation(),style:o},e)})}function Jo({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Fr(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const s=o.currentTarget;s.videoWidth>0&&s.videoHeight>0&&(i==null||i(e.url,s.videoWidth,s.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const s=o.currentTarget;s.naturalWidth>0&&s.naturalHeight>0&&(i==null||i(e.url,s.naturalWidth,s.naturalHeight))},onTransitionEnd:n})}function Hv({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:x,sourceRect:v,resolveCloseSourceRect:f,onClose:h,onPrev:m,onNext:b}){const I=a.useRef(null),R=a.useRef(null),T=a.useRef(null),U=a.useRef(new Map),[A,B]=a.useState(0),P=a.useRef(null),L=a.useRef(0),j=a.useRef(0),w=a.useRef("none"),W=a.useRef(!1),E=a.useRef(!1),J=a.useRef(!1),F=a.useRef(null),X=a.useRef(null),G=a.useRef(null),V=a.useRef(()=>{}),ie=a.useRef(null),C=a.useRef(null),M=a.useRef(null),O=a.useRef(!1),[re,ne]=a.useState(null),[$,ae]=a.useState(ca),[k,te]=a.useState(0),[K,fe]=a.useState("opening"),[Ie,me]=a.useState(0),[ue,q]=a.useState(0),[Q,Y]=a.useState(!1),[Ae,Se]=a.useState(null),[Ee,de]=a.useState(null),[ge,be]=a.useState(null),[z,se]=a.useState(!1),[pe,xe]=a.useState(null),[Re,Te]=a.useState(!1),_=a.useRef(!1),[he,oe]=a.useState(!1),[H,ee]=a.useState(!1),Me=a.useRef(n),le=a.useRef(void 0),D=t[n],Ve=D?Fr(D):!1,Oe=ue!==0||Q,lt=!l&&(!s||!!d),tt=c&&!l,ht=u.length>1,nt=a.useCallback((y,ye)=>t.length<=1?null:t[(y+ye+t.length)%t.length]??null,[t]),Be=ht?ao(u,p,-1):nt(n,-1),ve=ht?ao(u,p,1):nt(n,1),ke=Ae===-1&&Oe?ht&&Ee!==null?ao(u,Ee,-1):ge!==null?nt(ge,-1):null:null,De=Ae===1&&Oe?ht&&Ee!==null?ao(u,Ee,1):ge!==null?nt(ge,1):null:null,Ue=ke&&ke.url!==(Be==null?void 0:Be.url)?ke:null,$e=De&&De.url!==(ve==null?void 0:ve.url)?De:null,He=Be&&tt?(()=>{const y=ht?xl(u,p,-1):t.length>2?nt((n-1+t.length)%t.length,-1):null;return y&&y.url!==Be.url?y:null})():null,ze=ve&&tt?(()=>{const y=ht?xl(u,p,1):t.length>2?nt((n+1)%t.length,1):null;return y&&y.url!==ve.url?y:null})():null,Xe=Ue??He,ct=$e??ze,Je=a.useCallback((y,ye,Le)=>{if(!y||!ye||!Le)return;const Pe=U.current,et=Pe.get(y);(et==null?void 0:et.width)===ye&&(et==null?void 0:et.height)===Le||(Pe.set(y,{width:ye,height:Le}),B(Et=>Et+1))},[]),$t=a.useCallback(y=>{if(!(y!=null&&y.url))return null;const ye=U.current.get(y.url);return Ev(R.current,ye)},[A,k]),dt=a.useCallback(()=>{if(!D)return;const y=$t(D);if(y){ne(y);return}const ye=R.current;ye&&ne(wl(ye))},[D,$t]),We=a.useCallback(y=>{if(ht){const ye=u.length;de((p+y+ye)%ye),be(null);return}t.length>1&&(be((n+y+t.length)%t.length),de(null))},[ht,u.length,p,t.length,n]),Ke=a.useCallback(y=>{J.current=y,Y(y)},[]),je=a.useCallback(()=>{F.current!==null&&(window.clearTimeout(F.current),F.current=null)},[]),ut=a.useCallback(()=>{je(),F.current=window.setTimeout(()=>{je(),Ke(!1)},io+32)},[je,Ke]),pt=a.useCallback(()=>{const y=I.current;if(!y){ae({left:0,top:0,width:typeof window<"u"?window.innerWidth:ca.width,height:typeof window<"u"?window.innerHeight:ca.height});return}const ye=y.getBoundingClientRect();ae({left:ye.left,top:ye.top,width:ye.width,height:ye.height})},[]),mt=a.useCallback((y,ye)=>{if(Oe){if(he&&!Q)return`translate(${ue}px, 0px)`;if(Q&&Ae!==null){const Le=$t(y);if(!Le)return;const{x:Pe,y:et}=Fv(Le,ye,Ae,$);return`translate(${Pe}px, ${et}px)`}if(Q)return"translate(0px, 0px)"}},[Oe,he,Q,ue,Ae,$,$t]),kt=a.useCallback(()=>{const y=X.current;X.current=null,je(),Ke(!1),Se(null),de(null),be(null),q(0),oe(!1),W.current=!1,j.current=0,w.current="none",y===-1?m():y===1&&b()},[je,Ke,m,b]),Xt=a.useCallback(()=>{je(),F.current=window.setTimeout(()=>{X.current!==null&&kt()},io+32)},[je,kt]),Yt=a.useCallback(()=>{je(),X.current=null,Ke(!1),Se(null),de(null),be(null),q(0),oe(!1),W.current=!1,j.current=0,w.current="none"},[je,Ke]),vt=a.useCallback(y=>{if(!(!tt||!re)){if(J.current){if(X.current===y){G.current=y,kt();return}Yt()}je(),We(y),X.current=y,Se(y),Ke(!0),Xt()}},[tt,re,kt,Yt,je,We,Ke,Xt]);V.current=vt;const xt=a.useCallback(()=>{ie.current=null,O.current=!1,C.current!==null&&(window.clearInterval(C.current),C.current=null),M.current!==null&&(window.clearTimeout(M.current),M.current=null)},[]),Gt=a.useCallback(y=>{C.current!==null&&window.clearInterval(C.current);const ye=O.current?$v:Sv;C.current=window.setInterval(()=>{V.current(y)},ye)},[]),Ft=a.useCallback(y=>{ie.current!==y&&(xt(),ie.current=y,O.current=!1,V.current(y),Gt(y),M.current=window.setTimeout(()=>{M.current=null,ie.current===y&&(O.current=!0,Gt(y))},wv))},[xt,Gt]),bt=a.useCallback(()=>{const y=R.current;if(!y)return;const ye=D==null?void 0:D.url,Le=ye?U.current.get(ye):void 0;if(Le!=null&&Le.width&&(Le!=null&&Le.height)){ne(Ia(y,Le.width,Le.height));return}const Pe=T.current;if(Pe&&ye&&(Pe.src===ye||Pe.currentSrc===ye)){const{width:Et,height:Ye}=Iv(Pe);if(Et&&Ye){Je(ye,Et,Ye),ne(Ia(y,Et,Ye));return}}const et=wl(y);!et.width||!et.height||ne(et)},[D==null?void 0:D.url,Je]),Nt=a.useCallback(y=>{if(T.current=y,!!y){if(y instanceof HTMLVideoElement){y.readyState>=1&&y.videoWidth>0&&bt();return}y.complete&&y.naturalWidth>0&&bt()}},[bt]),Ut=a.useCallback(()=>{pt(),bt(),te(y=>y+1)},[pt,bt]);a.useEffect(()=>{Ut();const y=R.current,ye=I.current,Le=new ResizeObserver(()=>Ut());return y&&Le.observe(y),ye&&Le.observe(ye),window.addEventListener("resize",Ut),()=>{Le.disconnect(),window.removeEventListener("resize",Ut)}},[Ut,n,x]),a.useLayoutEffect(()=>{if(!D)return;const y=T.current;if(y){if(y instanceof HTMLImageElement&&y.complete&&y.naturalWidth>0){bt();return}y instanceof HTMLVideoElement&&y.readyState>=1&&y.videoWidth>0&&bt()}},[D==null?void 0:D.url,n,bt]),a.useEffect(()=>{dt()},[dt,A]),a.useEffect(()=>{const y=new Set,ye=[],Le=Pe=>{!(Pe!=null&&Pe.url)||y.has(Pe.url)||(y.add(Pe.url),ye.push(Pe))};t.forEach(Le),u.forEach(Pe=>Pe.items.forEach(Le)),ye.forEach(Pe=>{U.current.has(Pe.url)||Mv(Pe,Je)})},[t,u,Je]),a.useEffect(()=>{if(K!=="opening"||!re)return;if(!v){fe("open");return}se(!1);const y=requestAnimationFrame(()=>{requestAnimationFrame(()=>{se(!0),fe("open")})});return()=>cancelAnimationFrame(y)},[K,re,v]),a.useEffect(()=>{if(K!=="closing")return;const y=setTimeout(()=>h(),Cn);return()=>clearTimeout(y)},[K,h]),a.useEffect(()=>()=>{je()},[je]),a.useLayoutEffect(()=>{Me.current===n&&le.current===(D==null?void 0:D.url)||(je(),X.current=null,Se(null),de(null),be(null),me(0),q(0),Ke(!1),ee(!1),oe(!1),L.current=0,j.current=0,w.current="none",W.current=!1,P.current=null,E.current=!1,T.current=null,dt(),Me.current=n,le.current=D==null?void 0:D.url)},[n,D==null?void 0:D.url,Ke,je,dt]),a.useLayoutEffect(()=>{const y=G.current;y!==null&&(G.current=null,requestAnimationFrame(()=>{V.current(y)}))},[n,p,D==null?void 0:D.url]),a.useLayoutEffect(()=>{if(K==="opening"){_.current=!1,Te(!1);return}if(K!=="open"||_.current)return;if(!Be&&!ve){_.current=!0;return}Te(!1);const y=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Te(!0),_.current=!0})});return()=>cancelAnimationFrame(y)},[K,Be==null?void 0:Be.url,ve==null?void 0:ve.url]),a.useEffect(()=>{if(K!=="open")return;const y=()=>{const Ye=ft=>{ft.stopPropagation(),ft.preventDefault(),document.removeEventListener("click",Ye,!0)};document.addEventListener("click",Ye,!0)},ye=Ye=>{const ft=Ye<0?1:-1;je(),We(ft),X.current=ft,Se(ft),Ke(!0),Xt()},Le=Ye=>{if(Math.abs(Ye)>xv&&tt){ye(Ye);return}X.current=null,Se(null),de(null),be(null),Ke(!0),q(0),ut()},Pe=Ye=>{if(Ye.touches.length!==1||J.current)return;const ft=Ye.touches[0];E.current=!0,P.current={x:ft.clientX,y:ft.clientY},w.current="none",j.current=0,W.current=!1},et=Ye=>{if(!P.current||Ye.touches.length!==1||J.current)return;const ft=Ye.touches[0],Ht=ft.clientX-P.current.x,Tt=ft.clientY-P.current.y;if(w.current==="none"){if(Math.abs(Ht)<10&&Math.abs(Tt)<10)return;if(Math.abs(Ht)>Math.abs(Tt)){if(!tt)return;w.current="horizontal"}else if(Tt>0){if(!lt)return;w.current="vertical"}else return}if(w.current==="horizontal"){W.current=!0,oe(!0),j.current=Ht,q(Ht),Ye.preventDefault();return}w.current==="vertical"&&(W.current=!0,oe(!0),L.current=Tt,me(Tt),Ye.preventDefault())},Et=()=>{if(!P.current)return;const Ye=w.current,ft=W.current;if(ft&&Ye==="horizontal")Le(j.current),y();else if(ft&&Ye==="vertical"){const Ht=L.current;if(lt&&Ht>bv){const Tt=window.innerHeight;L.current=Tt,ee(!0),me(Tt),fe("closing")}else L.current=0,me(0);y()}else Ye==="horizontal"&&Math.abs(j.current)>0&&(Le(j.current),y());P.current=null,w.current="none",j.current=0,W.current=!1,oe(!1)};return document.addEventListener("touchstart",Pe,{passive:!0}),document.addEventListener("touchmove",et,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Pe),document.removeEventListener("touchmove",et),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[K,tt,Ke,ut,je,lt,Xt,We]);const Zt=a.useCallback(()=>{const y=(f==null?void 0:f())??v??null;y&&re&&(xe(y),se(!0)),fe("closing")},[f,v,re]);a.useEffect(()=>{const y=Pe=>{if(Pe.key==="Escape"){if(s&&d||K==="closing")return;xt(),Zt();return}if(Pe.key!=="ArrowLeft"&&Pe.key!=="ArrowRight"||K!=="open"||!tt)return;Pe.preventDefault();const et=Pe.key==="ArrowLeft"?-1:1;Pe.repeat&&ie.current===et||Ft(et)},ye=Pe=>{if(Pe.key!=="ArrowLeft"&&Pe.key!=="ArrowRight")return;const et=Pe.key==="ArrowLeft"?-1:1;ie.current===et&&xt()},Le=()=>{xt()};return window.addEventListener("keydown",y),window.addEventListener("keyup",ye),window.addEventListener("blur",Le),()=>{window.removeEventListener("keydown",y),window.removeEventListener("keyup",ye),window.removeEventListener("blur",Le),xt()}},[K,s,d,Zt,tt,Ft,xt]),a.useEffect(()=>{K!=="open"&&xt()},[K,xt]);const tn=()=>{K==="closing"||l||Zt()},Ct=K==="open",jt=K==="closing",cn=Ie>0?Math.max(0,1-Ie/500):1,at=Ie>0?Math.max(.35,1-Ie/500):1,Ce=a.useCallback(y=>{if(!(y.propertyName!=="transform"||!J.current)){if(X.current!==null){kt();return}je(),Ke(!1)}},[je,Ke,kt]),_e=K==="closing"?pe??v:v,Qe=_e&&re&&(K==="opening"||jt)?Cv(_e,re):void 0,st=Oe&&D?mt(D,"center"):Ie>0?`translateY(${Ie}px)`:Qe,gt=re?Zo(re,$):null,Rt=!!(_e&&re),ot=Rt&&(K==="closing"||K==="open"&&z),Ot={position:"absolute",top:gt==null?void 0:gt.top,left:gt==null?void 0:gt.left,width:gt==null?void 0:gt.width,height:gt==null?void 0:gt.height,objectFit:"contain",transformOrigin:"top left",transform:st,opacity:Ie>0?at:Rt?1:K==="opening"||jt?0:1,transition:he&&!Q?"none":Q?`transform ${io}ms ${pn}`:H?`transform ${Cn}ms ${pn}, opacity ${Cn}ms ${pn}`:ot?`transform ${Cn}ms ${pn}`:K==="opening"||jt?`opacity ${Cn}ms ${pn}`:"none",pointerEvents:Ve&&Ct&&!Oe?"auto":"none",touchAction:Ve&&Ct?"none":void 0,zIndex:1,overflow:Ve?"hidden":void 0},Pt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ct&&!Oe?"auto":"none"},Mt=(y,ye,Le="adjacent")=>{const Pe=$t(y);if(!Pe)return{display:"none"};const et=Le==="far"?ye==="left"?"far-left":"far-right":ye==="left"?"left-adjacent":"right-adjacent",{start:Et}=Ae!==null?qc(Pe,et,Ae,$):{start:Le==="far"?yr(Pe,ye,$):Ui(Pe,ye,$)},Ye=Zo(Et,$),ft=mt(y,et),Ht=!Oe&&Le==="adjacent"&&Ct&&!Re?Wv(Pe,ye,$):null,Tt=Le==="far"&&Oe&&Ae===(ye==="left"?-1:1),nn=he&&!Q?!1:Q,dn=Le==="adjacent"&&Ct&&Re&&!Oe;return{position:"absolute",top:Ye.top,left:Ye.left,width:Ye.width,height:Ye.height,objectFit:"contain",transform:ft??(Ht?`translate(${Ht.x}px, ${Ht.y}px)`:void 0),opacity:Le==="far"?Ct&&Tt?1:0:Ct?1:0,transition:nn?Le==="far"?`transform ${io}ms ${pn}`:`transform ${io}ms ${pn}, opacity ${Cn}ms ${pn}`:dn?`transform ${Cn}ms ${pn}`:K==="opening"||jt?`opacity ${Cn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},zt=(y,ye)=>{const Le=$t(y);return Le?Av(Ui(Le,ye,$),ye,$):null},Bt=y=>ye=>{if(!l){if(E.current){E.current=!1;return}ye.stopPropagation(),vt(y)}},Wt=Be?zt(Be,"left"):null,_t=ve?zt(ve,"right"):null,At=Wt?Zo(Wt,$):null,wt=_t?Zo(_t,$):null;return r.jsxs("div",{ref:I,className:[`${e}-lightbox`,s?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:K==="open"?"none":void 0},onClick:tn,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ct?cn:0,transition:he?"none":`opacity ${Cn}ms ${pn}`,pointerEvents:"none"}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[r.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:R,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:Ct?1:0,transition:he?"none":`opacity ${Cn}ms ${pn}`,pointerEvents:"none"},children:r.jsx(Rc,{prefix:e,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,onClose:tn})})]}),Ct&&Xe&&r.jsx(Jo,{media:Xe,style:Mt(Xe,"left","far"),onMeasure:Je,onTransitionEnd:Ce},`far-prev-${Xe.url}`),Ct&&Be&&r.jsxs(r.Fragment,{children:[r.jsx(Jo,{media:Be,style:Mt(Be,"left"),onMeasure:Je,onTransitionEnd:Ce},`prev-${Be.url}`),At&&r.jsx("div",{style:{position:"absolute",top:At.top,left:At.left,width:At.width,height:At.height,cursor:l||he?"default":"pointer",pointerEvents:l||he?"none":"auto",zIndex:3},onClick:Bt(-1)})]}),Ct&&ve&&r.jsxs(r.Fragment,{children:[r.jsx(Jo,{media:ve,style:Mt(ve,"right"),onMeasure:Je,onTransitionEnd:Ce},`next-${ve.url}`),wt&&r.jsx("div",{style:{position:"absolute",top:wt.top,left:wt.left,width:wt.width,height:wt.height,cursor:l||he?"default":"pointer",pointerEvents:l||he?"none":"auto",zIndex:3},onClick:Bt(1)})]}),Ct&&ct&&r.jsx(Jo,{media:ct,style:Mt(ct,"right","far"),onMeasure:Je,onTransitionEnd:Ce},`far-next-${ct.url}`),re&&D&&(Ve?r.jsx(_v,{src:D.url,phase:K,onMediaElement:Nt,wrapperStyle:Ot,videoStyle:Pt,onLoadedMetadata:bt,onTransitionEnd:Ce},`${n}-${D.url}`):r.jsx("img",{ref:Nt,src:D.url,alt:D.name,onLoad:bt,onTransitionEnd:Ce,style:Ot},`${n}-${D.url}`))]})}const Nv=20,Ov=.18;function Dv(e){return`
18693
+ `}const Cn=500,oo=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",Uv=72,Xv=50,Kv=1e4,Yv=650,Zv=500;function Jv(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,s=e.top-t.top;return`translate(${o}px, ${s}px) scale(${n}, ${i})`}function Xc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=gr(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 Qv(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Xc(i,n):null}function e0(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 so(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 $l(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return so(e,i,n)}const t0=.03;function Kc(e){return e.width*t0}const ua={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Jo(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Cl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function n0(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Pa(e,t,n){const i=e.getBoundingClientRect(),o=i.width,s=i.height,l=t/n,d=o/s;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(s-u)/2}}const c=s*l;return{width:c,height:s,left:i.left+(o-c)/2,top:i.top}}function i0(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Pa(e,t.width,t.height)}function o0(e,t){if(Wr(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 r0(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 a0({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Wr(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function Ui(e,t,n){const{width:i,height:o,top:s}=e,{left:l,width:d}=n,c=Kc(n);return t==="left"?{left:l+c-i,top:s,width:i,height:o}:{left:l+d-c,top:s,width:i,height:o}}function vr(e,t,n){const i=Ui(e,t,n);return{...i,left:2*i.left-e.left}}function s0(e,t,n){const{left:i,width:o}=n,s=Kc(n);return t==="left"?{left:i,top:e.top,width:s,height:e.height}:{left:i+o-s,top:e.top,width:s,height:e.height}}function Yc(e,t,n,i){const o=Ui(e,"left",i),s=Ui(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:s,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:d,end:s};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:s};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:s,end:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function l0(e,t,n,i){const{start:o,end:s}=Yc(e,t,n,i);return{x:s.left-o.left,y:s.top-o.top}}function c0(e,t,n){const i=Ui(e,t,n),o=vr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Wr(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function d0({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:s,onTransitionEnd:l}){const d=a.useRef(null);return a.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:l,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:s,onClick:c=>c.stopPropagation(),style:o},e)})}function Qo({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Wr(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const s=o.currentTarget;s.videoWidth>0&&s.videoHeight>0&&(i==null||i(e.url,s.videoWidth,s.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const s=o.currentTarget;s.naturalWidth>0&&s.naturalHeight>0&&(i==null||i(e.url,s.naturalWidth,s.naturalHeight))},onTransitionEnd:n})}function u0({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:v,sourceRect:y,resolveCloseSourceRect:g,onClose:h,onPrev:m,onNext:b}){const I=a.useRef(null),R=a.useRef(null),T=a.useRef(null),q=a.useRef(new Map),[F,V]=a.useState(0),A=a.useRef(null),L=a.useRef(0),O=a.useRef(0),x=a.useRef("none"),W=a.useRef(!1),E=a.useRef(!1),J=a.useRef(!1),P=a.useRef(null),K=a.useRef(null),B=a.useRef(null),z=a.useRef(()=>{}),ie=a.useRef(null),S=a.useRef(null),M=a.useRef(null),D=a.useRef(!1),[le,oe]=a.useState(null),[$,ae]=a.useState(ua),[k,te]=a.useState(0),[X,ve]=a.useState("opening"),[Pe,he]=a.useState(0),[ce,U]=a.useState(0),[Y,Z]=a.useState(!1),[We,$e]=a.useState(null),[ke,de]=a.useState(null),[fe,we]=a.useState(null),[G,se]=a.useState(!1),[pe,Se]=a.useState(null),[Me,Le]=a.useState(!1),H=a.useRef(!1),[ye,re]=a.useState(!1),[_,ee]=a.useState(!1),Ae=a.useRef(n),ue=a.useRef(void 0),N=t[n],Ue=N?Wr(N):!1,Oe=ce!==0||Y,dt=!l&&(!s||!!d),nt=c&&!l,ht=u.length>1,st=a.useCallback((w,be)=>t.length<=1?null:t[(w+be+t.length)%t.length]??null,[t]),Be=ht?so(u,p,-1):st(n,-1),xe=ht?so(u,p,1):st(n,1),Fe=We===-1&&Oe?ht&&ke!==null?so(u,ke,-1):fe!==null?st(fe,-1):null:null,je=We===1&&Oe?ht&&ke!==null?so(u,ke,1):fe!==null?st(fe,1):null:null,Ke=Fe&&Fe.url!==(Be==null?void 0:Be.url)?Fe:null,ne=je&&je.url!==(xe==null?void 0:xe.url)?je:null,ge=Be&&nt?(()=>{const w=ht?$l(u,p,-1):t.length>2?st((n-1+t.length)%t.length,-1):null;return w&&w.url!==Be.url?w:null})():null,Ie=xe&&nt?(()=>{const w=ht?$l(u,p,1):t.length>2?st((n+1)%t.length,1):null;return w&&w.url!==xe.url?w:null})():null,Ge=Ke??ge,Ze=ne??Ie,Ve=a.useCallback((w,be,Re)=>{if(!w||!be||!Re)return;const He=q.current,ot=He.get(w);(ot==null?void 0:ot.width)===be&&(ot==null?void 0:ot.height)===Re||(He.set(w,{width:be,height:Re}),V(Mt=>Mt+1))},[]),at=a.useCallback(w=>{if(!(w!=null&&w.url))return null;const be=q.current.get(w.url);return i0(R.current,be)},[F,k]),Je=a.useCallback(()=>{if(!N)return;const w=at(N);if(w){oe(w);return}const be=R.current;be&&oe(Cl(be))},[N,at]),Ee=a.useCallback(w=>{if(ht){const be=u.length;de((p+w+be)%be),we(null);return}t.length>1&&(we((n+w+t.length)%t.length),de(null))},[ht,u.length,p,t.length,n]),qe=a.useCallback(w=>{J.current=w,Z(w)},[]),_e=a.useCallback(()=>{P.current!==null&&(window.clearTimeout(P.current),P.current=null)},[]),tt=a.useCallback(()=>{_e(),P.current=window.setTimeout(()=>{_e(),qe(!1)},oo+32)},[_e,qe]),rt=a.useCallback(()=>{const w=I.current;if(!w){ae({left:0,top:0,width:typeof window<"u"?window.innerWidth:ua.width,height:typeof window<"u"?window.innerHeight:ua.height});return}const be=w.getBoundingClientRect();ae({left:be.left,top:be.top,width:be.width,height:be.height})},[]),lt=a.useCallback((w,be)=>{if(Oe){if(ye&&!Y)return`translate(${ce}px, 0px)`;if(Y&&We!==null){const Re=at(w);if(!Re)return;const{x:He,y:ot}=l0(Re,be,We,$);return`translate(${He}px, ${ot}px)`}if(Y)return"translate(0px, 0px)"}},[Oe,ye,Y,ce,We,$,at]),Tt=a.useCallback(()=>{const w=K.current;K.current=null,_e(),qe(!1),$e(null),de(null),we(null),U(0),re(!1),W.current=!1,O.current=0,x.current="none",w===-1?m():w===1&&b()},[_e,qe,m,b]),Ut=a.useCallback(()=>{_e(),P.current=window.setTimeout(()=>{K.current!==null&&Tt()},oo+32)},[_e,Tt]),Zt=a.useCallback(()=>{_e(),K.current=null,qe(!1),$e(null),de(null),we(null),U(0),re(!1),W.current=!1,O.current=0,x.current="none"},[_e,qe]),xt=a.useCallback(w=>{if(!(!nt||!le)){if(J.current){if(K.current===w){B.current=w,Tt();return}Zt()}_e(),Ee(w),K.current=w,$e(w),qe(!0),Ut()}},[nt,le,Tt,Zt,_e,Ee,qe,Ut]);z.current=xt;const wt=a.useCallback(()=>{ie.current=null,D.current=!1,S.current!==null&&(window.clearInterval(S.current),S.current=null),M.current!==null&&(window.clearTimeout(M.current),M.current=null)},[]),jt=a.useCallback(w=>{S.current!==null&&window.clearInterval(S.current);const be=D.current?Zv:Yv;S.current=window.setInterval(()=>{z.current(w)},be)},[]),At=a.useCallback(w=>{ie.current!==w&&(wt(),ie.current=w,D.current=!1,z.current(w),jt(w),M.current=window.setTimeout(()=>{M.current=null,ie.current===w&&(D.current=!0,jt(w))},Kv))},[wt,jt]),vt=a.useCallback(()=>{const w=R.current;if(!w)return;const be=N==null?void 0:N.url,Re=be?q.current.get(be):void 0;if(Re!=null&&Re.width&&(Re!=null&&Re.height)){oe(Pa(w,Re.width,Re.height));return}const He=T.current;if(He&&be&&(He.src===be||He.currentSrc===be)){const{width:Mt,height:Qe}=n0(He);if(Mt&&Qe){Ve(be,Mt,Qe),oe(Pa(w,Mt,Qe));return}}const ot=Cl(w);!ot.width||!ot.height||oe(ot)},[N==null?void 0:N.url,Ve]),Ft=a.useCallback(w=>{if(T.current=w,!!w){if(w instanceof HTMLVideoElement){w.readyState>=1&&w.videoWidth>0&&vt();return}w.complete&&w.naturalWidth>0&&vt()}},[vt]),_t=a.useCallback(()=>{rt(),vt(),te(w=>w+1)},[rt,vt]);a.useEffect(()=>{_t();const w=R.current,be=I.current,Re=new ResizeObserver(()=>_t());return w&&Re.observe(w),be&&Re.observe(be),window.addEventListener("resize",_t),()=>{Re.disconnect(),window.removeEventListener("resize",_t)}},[_t,n,v]),a.useLayoutEffect(()=>{if(!N)return;const w=T.current;if(w){if(w instanceof HTMLImageElement&&w.complete&&w.naturalWidth>0){vt();return}w instanceof HTMLVideoElement&&w.readyState>=1&&w.videoWidth>0&&vt()}},[N==null?void 0:N.url,n,vt]),a.useEffect(()=>{Je()},[Je,F]),a.useEffect(()=>{const w=new Set,be=[],Re=He=>{!(He!=null&&He.url)||w.has(He.url)||(w.add(He.url),be.push(He))};t.forEach(Re),u.forEach(He=>He.items.forEach(Re)),be.forEach(He=>{q.current.has(He.url)||o0(He,Ve)})},[t,u,Ve]),a.useEffect(()=>{if(X!=="opening"||!le)return;if(!y){ve("open");return}se(!1);const w=requestAnimationFrame(()=>{requestAnimationFrame(()=>{se(!0),ve("open")})});return()=>cancelAnimationFrame(w)},[X,le,y]),a.useEffect(()=>{if(X!=="closing")return;const w=setTimeout(()=>h(),Cn);return()=>clearTimeout(w)},[X,h]),a.useEffect(()=>()=>{_e()},[_e]),a.useLayoutEffect(()=>{Ae.current===n&&ue.current===(N==null?void 0:N.url)||(_e(),K.current=null,$e(null),de(null),we(null),he(0),U(0),qe(!1),ee(!1),re(!1),L.current=0,O.current=0,x.current="none",W.current=!1,A.current=null,E.current=!1,T.current=null,Je(),Ae.current=n,ue.current=N==null?void 0:N.url)},[n,N==null?void 0:N.url,qe,_e,Je]),a.useLayoutEffect(()=>{const w=B.current;w!==null&&(B.current=null,requestAnimationFrame(()=>{z.current(w)}))},[n,p,N==null?void 0:N.url]),a.useLayoutEffect(()=>{if(X==="opening"){H.current=!1,Le(!1);return}if(X!=="open"||H.current)return;if(!Be&&!xe){H.current=!0;return}Le(!1);const w=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Le(!0),H.current=!0})});return()=>cancelAnimationFrame(w)},[X,Be==null?void 0:Be.url,xe==null?void 0:xe.url]),a.useEffect(()=>{if(X!=="open")return;const w=()=>{const Qe=yt=>{yt.stopPropagation(),yt.preventDefault(),document.removeEventListener("click",Qe,!0)};document.addEventListener("click",Qe,!0)},be=Qe=>{const yt=Qe<0?1:-1;_e(),Ee(yt),K.current=yt,$e(yt),qe(!0),Ut()},Re=Qe=>{if(Math.abs(Qe)>Xv&&nt){be(Qe);return}K.current=null,$e(null),de(null),we(null),qe(!0),U(0),tt()},He=Qe=>{if(Qe.touches.length!==1||J.current)return;const yt=Qe.touches[0];E.current=!0,A.current={x:yt.clientX,y:yt.clientY},x.current="none",O.current=0,W.current=!1},ot=Qe=>{if(!A.current||Qe.touches.length!==1||J.current)return;const yt=Qe.touches[0],Dt=yt.clientX-A.current.x,Lt=yt.clientY-A.current.y;if(x.current==="none"){if(Math.abs(Dt)<10&&Math.abs(Lt)<10)return;if(Math.abs(Dt)>Math.abs(Lt)){if(!nt)return;x.current="horizontal"}else if(Lt>0){if(!dt)return;x.current="vertical"}else return}if(x.current==="horizontal"){W.current=!0,re(!0),O.current=Dt,U(Dt),Qe.preventDefault();return}x.current==="vertical"&&(W.current=!0,re(!0),L.current=Lt,he(Lt),Qe.preventDefault())},Mt=()=>{if(!A.current)return;const Qe=x.current,yt=W.current;if(yt&&Qe==="horizontal")Re(O.current),w();else if(yt&&Qe==="vertical"){const Dt=L.current;if(dt&&Dt>Uv){const Lt=window.innerHeight;L.current=Lt,ee(!0),he(Lt),ve("closing")}else L.current=0,he(0);w()}else Qe==="horizontal"&&Math.abs(O.current)>0&&(Re(O.current),w());A.current=null,x.current="none",O.current=0,W.current=!1,re(!1)};return document.addEventListener("touchstart",He,{passive:!0}),document.addEventListener("touchmove",ot,{passive:!1}),document.addEventListener("touchend",Mt),document.addEventListener("touchcancel",Mt),()=>{document.removeEventListener("touchstart",He),document.removeEventListener("touchmove",ot),document.removeEventListener("touchend",Mt),document.removeEventListener("touchcancel",Mt)}},[X,nt,qe,tt,_e,dt,Ut,Ee]);const Kt=a.useCallback(()=>{const w=(g==null?void 0:g())??y??null;w&&le&&(Se(w),se(!0)),ve("closing")},[g,y,le]);a.useEffect(()=>{const w=He=>{if(He.key==="Escape"){if(s&&d||X==="closing")return;wt(),Kt();return}if(He.key!=="ArrowLeft"&&He.key!=="ArrowRight"||X!=="open"||!nt)return;He.preventDefault();const ot=He.key==="ArrowLeft"?-1:1;He.repeat&&ie.current===ot||At(ot)},be=He=>{if(He.key!=="ArrowLeft"&&He.key!=="ArrowRight")return;const ot=He.key==="ArrowLeft"?-1:1;ie.current===ot&&wt()},Re=()=>{wt()};return window.addEventListener("keydown",w),window.addEventListener("keyup",be),window.addEventListener("blur",Re),()=>{window.removeEventListener("keydown",w),window.removeEventListener("keyup",be),window.removeEventListener("blur",Re),wt()}},[X,s,d,Kt,nt,At,wt]),a.useEffect(()=>{X!=="open"&&wt()},[X,wt]);const Jt=()=>{X==="closing"||l||Kt()},Ct=X==="open",Ht=X==="closing",on=Pe>0?Math.max(0,1-Pe/500):1,mt=Pe>0?Math.max(.35,1-Pe/500):1,Te=a.useCallback(w=>{if(!(w.propertyName!=="transform"||!J.current)){if(K.current!==null){Tt();return}_e(),qe(!1)}},[_e,qe,Tt]),De=X==="closing"?pe??y:y,it=De&&le&&(X==="opening"||Ht)?Jv(De,le):void 0,gt=Oe&&N?lt(N,"center"):Pe>0?`translateY(${Pe}px)`:it,ft=le?Jo(le,$):null,It=!!(De&&le),pt=It&&(X==="closing"||X==="open"&&G),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:gt,opacity:Pe>0?mt:It?1:X==="opening"||Ht?0:1,transition:ye&&!Y?"none":Y?`transform ${oo}ms ${pn}`:_?`transform ${Cn}ms ${pn}, opacity ${Cn}ms ${pn}`:pt?`transform ${Cn}ms ${pn}`:X==="opening"||Ht?`opacity ${Cn}ms ${pn}`:"none",pointerEvents:Ue&&Ct&&!Oe?"auto":"none",touchAction:Ue&&Ct?"none":void 0,zIndex:1,overflow:Ue?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ct&&!Oe?"auto":"none"},Pt=(w,be,Re="adjacent")=>{const He=at(w);if(!He)return{display:"none"};const ot=Re==="far"?be==="left"?"far-left":"far-right":be==="left"?"left-adjacent":"right-adjacent",{start:Mt}=We!==null?Yc(He,ot,We,$):{start:Re==="far"?vr(He,be,$):Ui(He,be,$)},Qe=Jo(Mt,$),yt=lt(w,ot),Dt=!Oe&&Re==="adjacent"&&Ct&&!Me?c0(He,be,$):null,Lt=Re==="far"&&Oe&&We===(be==="left"?-1:1),nn=ye&&!Y?!1:Y,dn=Re==="adjacent"&&Ct&&Me&&!Oe;return{position:"absolute",top:Qe.top,left:Qe.left,width:Qe.width,height:Qe.height,objectFit:"contain",transform:yt??(Dt?`translate(${Dt.x}px, ${Dt.y}px)`:void 0),opacity:Re==="far"?Ct&&Lt?1:0:Ct?1:0,transition:nn?Re==="far"?`transform ${oo}ms ${pn}`:`transform ${oo}ms ${pn}, opacity ${Cn}ms ${pn}`:dn?`transform ${Cn}ms ${pn}`:X==="opening"||Ht?`opacity ${Cn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},Vt=(w,be)=>{const Re=at(w);return Re?s0(Ui(Re,be,$),be,$):null},Gt=w=>be=>{if(!l){if(E.current){E.current=!1;return}be.stopPropagation(),xt(w)}},Nt=Be?Vt(Be,"left"):null,Ot=xe?Vt(xe,"right"):null,Wt=Nt?Jo(Nt,$):null,St=Ot?Jo(Ot,$):null;return r.jsxs("div",{ref:I,className:[`${e}-lightbox`,s?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:X==="open"?"none":void 0},onClick:Jt,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ct?on:0,transition:ye?"none":`opacity ${Cn}ms ${pn}`,pointerEvents:"none"}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[r.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:R,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:Ct?1:0,transition:ye?"none":`opacity ${Cn}ms ${pn}`,pointerEvents:"none"},children:r.jsx(Mc,{prefix:e,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,onClose:Jt})})]}),Ct&&Ge&&r.jsx(Qo,{media:Ge,style:Pt(Ge,"left","far"),onMeasure:Ve,onTransitionEnd:Te},`far-prev-${Ge.url}`),Ct&&Be&&r.jsxs(r.Fragment,{children:[r.jsx(Qo,{media:Be,style:Pt(Be,"left"),onMeasure:Ve,onTransitionEnd:Te},`prev-${Be.url}`),Wt&&r.jsx("div",{style:{position:"absolute",top:Wt.top,left:Wt.left,width:Wt.width,height:Wt.height,cursor:l||ye?"default":"pointer",pointerEvents:l||ye?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Ct&&xe&&r.jsxs(r.Fragment,{children:[r.jsx(Qo,{media:xe,style:Pt(xe,"right"),onMeasure:Ve,onTransitionEnd:Te},`next-${xe.url}`),St&&r.jsx("div",{style:{position:"absolute",top:St.top,left:St.left,width:St.width,height:St.height,cursor:l||ye?"default":"pointer",pointerEvents:l||ye?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Ct&&Ze&&r.jsx(Qo,{media:Ze,style:Pt(Ze,"right","far"),onMeasure:Ve,onTransitionEnd:Te},`far-next-${Ze.url}`),le&&N&&(Ue?r.jsx(d0,{src:N.url,phase:X,onMediaElement:Ft,wrapperStyle:zt,videoStyle:kt,onLoadedMetadata:vt,onTransitionEnd:Te},`${n}-${N.url}`):r.jsx("img",{ref:Ft,src:N.url,alt:N.name,onLoad:vt,onTransitionEnd:Te,style:zt},`${n}-${N.url}`))]})}const p0=20,m0=.18;function g0(e){return`
17724
18694
  .${e}-wrapper {
17725
18695
  box-sizing: border-box;
17726
18696
  max-width: 100%;
@@ -17807,8 +18777,8 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
17807
18777
  z-index: 2;
17808
18778
  pointer-events: auto;
17809
18779
  }
17810
- ${vv(e)}
17811
- `}function jv(e){const{imageDisplay:t}=e??{},n=(t==null?void 0:t.ratioValue)??"1:1",i=(t==null?void 0:t.reversed)??!1,[o,s]=n.split(":").map(Number),l=i?s:o,d=i?o:s;return d>0?l/d:1}function zv(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 Bv(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:S.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:S.scalingValue(i*Ov,n??!1),[`--${t}-image-aspect`]:jv(e)}}function Vv(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 Gv(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 Uv(e,t,n,i,o,s){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);s(n,d?Gc(d,o):void 0)}}function qv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:s,portalId:l}){const{prefix:d}=S.useScopedStyles(),c=a.useMemo(()=>Dv(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",x=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,v=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,f=S.scalingValue(v,n??!1),h=`max(${f}, ${Nv}px)`,{objectFitMode:m,imageStyle:b}=Gv(e),I=Vv(e,n),R=a.useRef(null),[T,U]=a.useState(!1),[A,B]=a.useState([]),[P,L]=a.useState(0),[j,w]=a.useState(0),[W,E]=a.useState(null),[J,F]=a.useState({title1:"",title2:"",title3:""}),X=(!n||i)&&!T,G=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},V=G.sizeType??"none",ie=X&&V!=="none"?`${d}-item-image-hover-${V}`:void 0,C=(G.value??120)/100,M=a.useCallback(ue=>{!ue||V!=="scale"||(ue.style.transformOrigin=pm(ue))},[V]),O=a.useCallback(ue=>{if(ue){if(m==="contain"){const q=zv(ue);if(q){const Q=ue.closest(`.${d}-item-image`);Q instanceof HTMLElement&&Q.style.setProperty(`--${d}-item-media-aspect`,String(q))}}M(ue)}},[d,M,m]),re={width:S.scalingValue(x,n??!1),...I,...Bv(e,d,n),[`--${d}-image-hover-scale`]:String(C)},ne=(()=>{const ue={},q=R.current?getComputedStyle(R.current).getPropertyValue("--cntrl-article-width").trim():"";return q&&(ue["--cntrl-article-width"]=q),ue})(),$=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),ae=a.useMemo(()=>Lv(u),[u]),k=a.useMemo(()=>Pv(u),[u]),te=(ue,q)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const Q=ae.findIndex(Ae=>Ae.gridIndex===ue);if(Q<0)return;const Y=ae[Q];w(Q),B(Y.items),L(0),F(Y.entry),E(q??null),U(!0)},K=a.useCallback(()=>{U(!1),E(null)},[]),fe=a.useCallback(()=>{const ue=ae[j];return!ue||!R.current?W:Tv(R.current,ue.gridIndex,m)??W},[ae,j,W,m]),Ie=a.useCallback(ue=>{if(ae.length>1){const q=ae.length,Q=(j+ue+q)%q,Y=ae[Q];w(Q),B(Y.items),L(0),F(Y.entry);return}L(q=>(q+ue+A.length)%A.length)},[ae,j,A.length]),me=ae.length>1||A.length>1;return a.useEffect(()=>{if(!T||typeof document>"u")return;const ue=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ue}},[T]),a.useEffect(()=>{!n||o||i||U(!1)},[n,o,i]),a.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&U(!1)},[e==null?void 0:e.lightbox]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),r.jsx(kv,{mediaList:k}),r.jsx("div",{ref:R,className:`${d}-wrapper ${d}-type-${p}`,style:re,children:u.map((ue,q)=>{var Ae,Se;const Q=!!((Ae=ue.image)!=null&&Ae.url),Y=Uv(!!$,Q,q,d,m,te);return r.jsxs("div",{className:`${d}-item`,children:[ue.title?r.jsx("span",{className:`${d}-item-title`,onClick:Y,style:Y?{cursor:"pointer"}:void 0,children:ue.title}):null,(Se=ue.image)!=null&&Se.url?r.jsx("span",{className:[`${d}-item-image`,m==="contain"?`${d}-item-image-fit`:void 0,ie].filter(Boolean).join(" "),children:ue.image.type==="video"?r.jsx("video",{ref:O,src:ue.image.url,"data-waterfall-index":q,style:b,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:Y,onLoadedData:Ee=>O(Ee.currentTarget)}):r.jsx("img",{ref:O,src:ue.image.url,alt:ue.image.name??"","data-waterfall-index":q,style:b,onClick:Y,onLoad:Ee=>O(Ee.currentTarget)})}):null,q<u.length-1&&r.jsx("div",{className:`${d}-item-gap-host`,style:{width:f},children:o&&!T&&r.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%"}})})]},q)})}),T&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const ue=(l?document.getElementById(l):null)??document.body;return Yn.createPortal(r.jsx("div",{style:ne,"data-selection":"none",children:r.jsx(Hv,{prefix:d,items:A,index:P,entry:J,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:me,lightboxEntries:ae,entryIdx:j,layoutId:s,sourceRect:W,resolveCloseSourceRect:fe,onClose:K,onPrev:()=>Ie(-1),onNext:()=>Ie(1)})}),ue)})()]})}const Kv=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
18780
+ ${qv(e)}
18781
+ `}function h0(e){const{imageDisplay:t}=e??{},n=(t==null?void 0:t.ratioValue)??"1:1",i=(t==null?void 0:t.reversed)??!1,[o,s]=n.split(":").map(Number),l=i?s:o,d=i?o:s;return d>0?l/d:1}function f0(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 y0(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:C.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:C.scalingValue(i*m0,n??!1),[`--${t}-image-aspect`]:h0(e)}}function v0(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 Xt(n,t)}function x0(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 b0(e,t,n,i,o,s){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);s(n,d?Xc(d,o):void 0)}}function w0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:s,portalId:l}){const{prefix:d}=C.useScopedStyles(),c=a.useMemo(()=>g0(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",v=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,y=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,g=C.scalingValue(y,n??!1),h=`max(${g}, ${p0}px)`,{objectFitMode:m,imageStyle:b}=x0(e),I=v0(e,n),R=a.useRef(null),[T,q]=a.useState(!1),[F,V]=a.useState([]),[A,L]=a.useState(0),[O,x]=a.useState(0),[W,E]=a.useState(null),[J,P]=a.useState({title1:"",title2:"",title3:""}),K=(!n||i)&&!T,B=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},z=B.sizeType??"none",ie=K&&z!=="none"?`${d}-item-image-hover-${z}`:void 0,S=(B.value??120)/100,M=a.useCallback(ce=>{!ce||z!=="scale"||(ce.style.transformOrigin=hm(ce))},[z]),D=a.useCallback(ce=>{if(ce){if(m==="contain"){const U=f0(ce);if(U){const Y=ce.closest(`.${d}-item-image`);Y instanceof HTMLElement&&Y.style.setProperty(`--${d}-item-media-aspect`,String(U))}}M(ce)}},[d,M,m]),le={width:C.scalingValue(v,n??!1),...I,...y0(e,d,n),[`--${d}-image-hover-scale`]:String(S)},oe=(()=>{const ce={},U=R.current?getComputedStyle(R.current).getPropertyValue("--cntrl-article-width").trim():"";return U&&(ce["--cntrl-article-width"]=U),ce})(),$=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),ae=a.useMemo(()=>e0(u),[u]),k=a.useMemo(()=>r0(u),[u]),te=(ce,U)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const Y=ae.findIndex(We=>We.gridIndex===ce);if(Y<0)return;const Z=ae[Y];x(Y),V(Z.items),L(0),P(Z.entry),E(U??null),q(!0)},X=a.useCallback(()=>{q(!1),E(null)},[]),ve=a.useCallback(()=>{const ce=ae[O];return!ce||!R.current?W:Qv(R.current,ce.gridIndex,m)??W},[ae,O,W,m]),Pe=a.useCallback(ce=>{if(ae.length>1){const U=ae.length,Y=(O+ce+U)%U,Z=ae[Y];x(Y),V(Z.items),L(0),P(Z.entry);return}L(U=>(U+ce+F.length)%F.length)},[ae,O,F.length]),he=ae.length>1||F.length>1;return a.useEffect(()=>{if(!T||typeof document>"u")return;const ce=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ce}},[T]),a.useEffect(()=>{!n||o||i||q(!1)},[n,o,i]),a.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&q(!1)},[e==null?void 0:e.lightbox]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),r.jsx(a0,{mediaList:k}),r.jsx("div",{ref:R,className:`${d}-wrapper ${d}-type-${p}`,style:le,children:u.map((ce,U)=>{var We,$e;const Y=!!((We=ce.image)!=null&&We.url),Z=b0(!!$,Y,U,d,m,te);return r.jsxs("div",{className:`${d}-item`,children:[ce.title?r.jsx("span",{className:`${d}-item-title`,onClick:Z,style:Z?{cursor:"pointer"}:void 0,children:ce.title}):null,($e=ce.image)!=null&&$e.url?r.jsx("span",{className:[`${d}-item-image`,m==="contain"?`${d}-item-image-fit`:void 0,ie].filter(Boolean).join(" "),children:ce.image.type==="video"?r.jsx("video",{ref:D,src:ce.image.url,"data-waterfall-index":U,style:b,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:Z,onLoadedData:ke=>D(ke.currentTarget)}):r.jsx("img",{ref:D,src:ce.image.url,alt:ce.image.name??"","data-waterfall-index":U,style:b,onClick:Z,onLoad:ke=>D(ke.currentTarget)})}):null,U<u.length-1&&r.jsx("div",{className:`${d}-item-gap-host`,style:{width:g},children:o&&!T&&r.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%"}})})]},U)})}),T&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const ce=(l?document.getElementById(l):null)??document.body;return Yn.createPortal(r.jsx("div",{style:oe,"data-selection":"none",children:r.jsx(u0,{prefix:d,items:F,index:A,entry:J,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:he,lightboxEntries:ae,entryIdx:O,layoutId:s,sourceRect:W,resolveCloseSourceRect:ve,onClose:X,onPrev:()=>Pe(-1),onNext:()=>Pe(1)})}),ce)})()]})}const S0=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
17812
18782
  import type React from 'react';
17813
18783
  import { createPortal } from 'react-dom';
17814
18784
  import { CommonComponentProps } from '../props';
@@ -18322,7 +19292,7 @@ export function Waterfall({
18322
19292
  </>
18323
19293
  );
18324
19294
  }
18325
- `,Xv="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>'),jn={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 Yv(e){const t={};return t[Ze(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ze(e,"fontSettings")]={...jn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ze(e,"fontSize")]={...jn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ze(e,"lineHeight")]={...jn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ze(e,"letterSpacing")]={...jn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ze(e,"wordSpacing")]={...jn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ze(e,"textAlign")]={...jn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ze(e,"textAppearance")]={...jn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const qi=Kn.filter(e=>e!=="count"),Zv=qi.reduce((e,t)=>({...e,...Yv(t)}),{}),Jv=qi.reduce((e,t)=>({...e,[Ze(t,"fontFamily")]:"Arial",[Ze(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ze(t,"letterSpacing")]:0,[Ze(t,"wordSpacing")]:0,[Ze(t,"textAlign")]:"left",[Ze(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function da(e){return qi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ze(n,"fontSize")]=i),o!==void 0&&(t[Ze(n,"lineHeight")]=o),t},{})}const Qv={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(qi.map(e=>[es[e],ts(e)]))},Qo={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},e0=[{title:"Salton Sea from Above",...Qo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...Qo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...Qo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...Qo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],t0={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:e0},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:{...jn.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"]}}},...Zv},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:Xv,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...Jv},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,...da({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,...da({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,...da({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:[Qv]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},n0={element:qv,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"},...qi.map(e=>({path:`${Ze(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...qi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ze(t,"fontFamily")}`}),{})},schema:t0,sourceCode:Kv},Fi=500,Kc="cubic-bezier(0.25, 1, 0.5, 1)",i0=300,o0=5,r0=.15,a0=.4,s0=100,$i=100,Sl={color:"#000000",hover:"#cccccc"},oo={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},l0={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}},ua={offset:{x:0,y:0},linkColor:"#cccccc"},$l={sizeType:"drag",value:3},c0="left";function d0(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:c0,color:(e==null?void 0:e.titleColor)??"#000000"};return qt(n,t)}function Ci(e,t,n){return`${e}: ${S.scalingValue(t/1440,n)};`}function so(e,t){return t<=0?0:(e%t+t)%t}function u0(e,t,n,i){if(!i)return{position:so(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 p0(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function m0(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 v=n.getBoundingClientRect();return{x:v.left,y:v.top}},o=i(0,0),s=i($i,0),l=i(0,$i);e.removeChild(n);const d={x:(s.x-o.x)/$i,y:(s.y-o.y)/$i},c={x:(l.x-o.x)/$i,y:(l.y-o.y)/$i},u=d.x*c.y-c.x*d.y;return{ex:d,ey:c,det:u}}function g0(e,t,n){const{ex:i,ey:o,det:s}=e;return{x:(t*o.y-n*o.x)/s,y:(i.x*n-i.y*t)/s}}function h0(e,t){return`
19295
+ `,$0="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>'),jn={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 C0(e){const t={};return t[et(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSettings")]={...jn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSize")]={...jn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[et(e,"lineHeight")]={...jn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[et(e,"letterSpacing")]={...jn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[et(e,"wordSpacing")]={...jn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[et(e,"textAlign")]={...jn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[et(e,"textAppearance")]={...jn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Xi=Xn.filter(e=>e!=="count"),T0=Xi.reduce((e,t)=>({...e,...C0(t)}),{}),L0=Xi.reduce((e,t)=>({...e,[et(t,"fontFamily")]:"Arial",[et(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[et(t,"letterSpacing")]:0,[et(t,"wordSpacing")]:0,[et(t,"textAlign")]:"left",[et(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function pa(e){return Xi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[et(n,"fontSize")]=i),o!==void 0&&(t[et(n,"lineHeight")]=o),t},{})}const R0={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Xi.map(e=>[is[e],os(e)]))},er={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},I0=[{title:"Salton Sea from Above",...er,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...er,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...er,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...er,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],E0={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:I0},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:{...jn.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"]}}},...T0},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:$0,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...L0},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,...pa({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,...pa({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,...pa({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:[R0]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},M0={element:w0,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"},...Xi.map(e=>({path:`${et(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...Xi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${et(t,"fontFamily")}`}),{})},schema:E0,sourceCode:S0},Wi=500,Zc="cubic-bezier(0.25, 1, 0.5, 1)",P0=300,k0=5,A0=.15,F0=.4,W0=100,Ci=100,Tl={color:"#000000",hover:"#cccccc"},ro={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},_0={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}},ma={offset:{x:0,y:0},linkColor:"#cccccc"},Ll={sizeType:"drag",value:3},H0="left";function N0(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:H0,color:(e==null?void 0:e.titleColor)??"#000000"};return Xt(n,t)}function Ti(e,t,n){return`${e}: ${C.scalingValue(t/1440,n)};`}function lo(e,t){return t<=0?0:(e%t+t)%t}function O0(e,t,n,i){if(!i)return{position:lo(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 D0(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function j0(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,v)=>{n.style.transform=`translate(${p}px, ${v}px)`;const y=n.getBoundingClientRect();return{x:y.left,y:y.top}},o=i(0,0),s=i(Ci,0),l=i(0,Ci);e.removeChild(n);const d={x:(s.x-o.x)/Ci,y:(s.y-o.y)/Ci},c={x:(l.x-o.x)/Ci,y:(l.y-o.y)/Ci},u=d.x*c.y-c.x*d.y;return{ex:d,ey:c,det:u}}function z0(e,t,n){const{ex:i,ey:o,det:s}=e;return{x:(t*o.y-n*o.x)/s,y:(i.x*n-i.y*t)/s}}function B0(e,t){return`
18326
19296
  .${e}-wrapper {
18327
19297
  position: relative;
18328
19298
  width: 100%;
@@ -18394,7 +19364,7 @@ export function Waterfall({
18394
19364
  top: 0;
18395
19365
  left: 0;
18396
19366
  opacity: 0;
18397
- transition: opacity ${Fi}ms ${Kc};
19367
+ transition: opacity ${Wi}ms ${Zc};
18398
19368
  }
18399
19369
  .${e}-list-fade .${e}-slide.${e}-is-active {
18400
19370
  opacity: 1;
@@ -18421,29 +19391,29 @@ export function Waterfall({
18421
19391
  top: 50%;
18422
19392
  z-index: 1;
18423
19393
  padding: 0;
18424
- ${Ci("width",30,t)}
18425
- ${Ci("height",30,t)}
19394
+ ${Ti("width",30,t)}
19395
+ ${Ti("height",30,t)}
18426
19396
  transition: opacity 0.15s ease-in-out;
18427
19397
  }
18428
19398
  .${e}-arrow-prev {
18429
- ${Ci("left",-20,t)}
19399
+ ${Ti("left",-20,t)}
18430
19400
  transform: translate3d(-50%, -50%, 0);
18431
19401
  }
18432
19402
  .${e}-arrow-next {
18433
19403
  left: unset;
18434
- ${Ci("right",-20,t)}
19404
+ ${Ti("right",-20,t)}
18435
19405
  transform: translate3d(50%, -50%, 0);
18436
19406
  }
18437
19407
  .${e}-arrow-prev-vertical {
18438
19408
  left: 50%;
18439
- ${Ci("top",-20,t)}
19409
+ ${Ti("top",-20,t)}
18440
19410
  transform: translate3d(-50%, -50%, 0);
18441
19411
  }
18442
19412
  .${e}-arrow-next-vertical {
18443
19413
  left: 50%;
18444
19414
  right: unset;
18445
19415
  top: unset;
18446
- ${Ci("bottom",-20,t)}
19416
+ ${Ti("bottom",-20,t)}
18447
19417
  transform: translate3d(-50%, 50%, 0);
18448
19418
  }
18449
19419
  .${e}-arrow-hidden {
@@ -18579,10 +19549,10 @@ export function Waterfall({
18579
19549
  object-fit: cover;
18580
19550
  }
18581
19551
  .${e}-transition-reveal .${e}-slide.${e}-is-active .${e}-slider-image {
18582
- animation: ${e}-reveal-horizontal ${Fi}ms ease;
19552
+ animation: ${e}-reveal-horizontal ${Wi}ms ease;
18583
19553
  }
18584
19554
  .${e}-transition-reveal-vertical .${e}-slide.${e}-is-active .${e}-slider-image {
18585
- animation: ${e}-reveal-vertical ${Fi}ms ease;
19555
+ animation: ${e}-reveal-vertical ${Wi}ms ease;
18586
19556
  }
18587
19557
  @keyframes ${e}-reveal-horizontal {
18588
19558
  from { clip-path: inset(0 100% 0 0); }
@@ -18592,7 +19562,7 @@ export function Waterfall({
18592
19562
  from { clip-path: inset(100% 0 0 0); }
18593
19563
  to { clip-path: inset(0 0 0 0); }
18594
19564
  }
18595
- `}function f0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:s}=S.useScopedStyles(),l=d0(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??$l,p=u.sizeType??"drag",x=u.value??$l.value,v=(e==null?void 0:e.direction)??"horizontal",f=(e==null?void 0:e.transition)??"slide",h=(e==null?void 0:e.nav)??"classic",m=(e==null?void 0:e.navSize)??"m",b=l0[m],I=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,R=ve=>S.scalingValue(ve*I,n),T=(e==null?void 0:e.show)??"always",U=(e==null?void 0:e.controls)??null,A=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,B=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,P=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,L=(e==null?void 0:e.controlsColor)??Sl.color,j=(e==null?void 0:e.controlsHoverColor)??Sl.hover,w=(e==null?void 0:e.navColor)??oo.colors.inactive,W=(e==null?void 0:e.navPaginationColor)??oo.colors.pagination,E=(e==null?void 0:e.navBackgroundColor)??oo.colors.background,J=(e==null?void 0:e.linkColor)??ua.linkColor,F=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,X=v==="horizontal",G=p==="click",V=p==="drag",ie=p==="auto"&&(!n||!!i),C=!n,M=f==="slide",O=h==="classic",re=T!=="never",ne=T==="on hover",$=S.scalingValue(A,n),ae={width:$,height:$,maxWidth:$},k=M&&c>1,[te,K]=a.useState(0),[fe,Ie]=a.useState(k?1:0),[me,ue]=a.useState(!1),[q,Q]=a.useState(!1),[Y,Ae]=a.useState(!1),[Se,Ee]=a.useState(0),[de,ge]=a.useState(!1),[be,z]=a.useState(!1),se=a.useRef(!1),pe=a.useRef(fe);pe.current=fe;const xe=a.useRef(null),Re=a.useRef(0),Te=a.useRef(null),_=a.useRef(null),he=a.useRef(null),oe=a.useRef(null),H=a.useCallback(ve=>{se.current=ve,ue(ve)},[]),ee=a.useCallback(ve=>{if(c<2||ve===0)return;const ke=ve>0?1:-1,De=Math.abs(ve);if(ge(!0),H(!0),!M){K(ct=>so(ct+ve,c));return}let Ue=pe.current;const $e=k&&(Ue===0||Ue===c+1),He=$e?te+1:null;$e&&(Ue=te+1);let ze=De;for(;ze>0;){const ct=u0(Ue,ke,c,k);if(Ue=ct.position,ze-=1,ct.hitBoundary){Re.current=ze*ke;break}}const Xe=De-ze;if(Xe>0&&K(ct=>so(ct+Xe*ke,c)),pe.current=Ue,He!==null){if(pe.current=He,Ue===He){Q(!0),Ie(Ue);return}xe.current=Ue,Q(!0),Ie(He);return}Q(!1),Ie(Ue)},[te,c,k,M,H]),Me=a.useCallback(ve=>{ee(ve)},[ee]),le=a.useCallback(ve=>{if(c<2)return;const ke=so(ve,c);if(!(ke===te&&!se.current)&&(ge(!0),H(!0),K(ke),M)){const De=ke+(k?1:0);xe.current=null,Re.current=0,pe.current=De,Q(!1),Ie(De)}},[te,c,k,M,H]);a.useEffect(()=>{if(!me)return;const ve=window.setTimeout(()=>{if(k&&(fe===0||fe===c+1)){xe.current=null,Q(!0),Ie(te+1);return}H(!1)},Fi);return()=>window.clearTimeout(ve)},[te,c,k,me,H,fe]),a.useEffect(()=>{if(!q)return;let ve=0;const ke=requestAnimationFrame(()=>{ve=requestAnimationFrame(()=>{const De=xe.current;xe.current=null;const Ue=Re.current;if(Re.current=0,Q(!1),De!==null){pe.current=De,Ie(De);return}if(Ue!==0){ee(Ue);return}H(!1)})});return()=>{cancelAnimationFrame(ke),cancelAnimationFrame(ve)}},[ee,H,q]);const D=`${k}:${c}`,Ve=a.useRef(D);a.useEffect(()=>{if(Ve.current===D)return;Ve.current=D;const ve=c>0?Math.min(te,c-1):0;he.current=null,oe.current=null,Ae(!1),Ee(0),K(ve),Q(!0),Ie(ve+(k?1:0))},[te,c,k,D]),a.useEffect(()=>{if(!de)return;const ve=window.setTimeout(()=>ge(!1),i0);return()=>window.clearTimeout(ve)},[de,te]),a.useEffect(()=>{if(!ie||c<2)return;const ve=Math.max(x,.1)*1e3,ke=window.setInterval(()=>{C&&be||Me(1)},ve);return()=>window.clearInterval(ke)},[x,c,Me,ie,be,C]);const Oe=a.useCallback(ve=>{const ke=he.current;if(!ke||ke.pointerId!==ve.pointerId)return;he.current=null,oe.current=null;const De=Te.current;if(De!=null&&De.hasPointerCapture(ve.pointerId)&&De.releasePointerCapture(ve.pointerId),!ke.isActive){M&&Ee(0);return}const $e=!(ve.timeStamp-ke.lastTime>s0)&&Math.abs(ke.velocity)>a0,He=ke.size>0&&Math.abs(ke.offset-ke.baseOffset)>ke.size*r0;if(Ae(!1),!$e&&!He){Ee(0);return}const ze=He?ke.offset-ke.baseOffset:ke.velocity;let Xe=1;He&&ke.size>0&&(Xe=Math.max(1,Math.round(Math.abs(ze)/ke.size))),Ee(0),ee(ze<0?Xe:-Xe)},[ee,M]);a.useEffect(()=>{const ve=ke=>{oe.current===null||ke.pointerId!==oe.current||Oe(ke)};return window.addEventListener("pointerup",ve),window.addEventListener("pointercancel",ve),()=>{window.removeEventListener("pointerup",ve),window.removeEventListener("pointercancel",ve)}},[Oe]);const lt=ve=>{const ke=Te.current;if(!V||c<2||!ke||ve.pointerType==="mouse"&&ve.button!==0)return;xe.current=null,Re.current=0,se.current&&H(!1);let De=0;const Ue=_.current;if(M&&Ue){const $e=X?Ue.offsetWidth:Ue.offsetHeight;if($e>0){const He=p0(Ue,X);let ze=pe.current;k&&(ze===0||ze===c+1)?(ze=te+1,pe.current=ze,Q(!0),Ie(ze),De=0):De=He+ze*$e,Ee(De)}}ke.setPointerCapture(ve.pointerId),oe.current=ve.pointerId,he.current={pointerId:ve.pointerId,startClientX:ve.clientX,startClientY:ve.clientY,axes:m0(ke,`${s}-axis-probe`),size:X?ke.offsetWidth:ke.offsetHeight,isActive:!1,baseOffset:De,offset:De,lastTime:ve.timeStamp,velocity:0}},tt=ve=>{const ke=he.current;if(!ke||ke.pointerId!==ve.pointerId)return;if(ve.pointerType==="mouse"&&ve.buttons===0){Oe(ve);return}const De=ve.clientX-ke.startClientX,Ue=ve.clientY-ke.startClientY,$e=ke.axes?g0(ke.axes,De,Ue):{x:De,y:Ue},He=X?$e.x:$e.y,ze=X?$e.y:$e.x,Xe=ke.baseOffset+He;if(!ke.isActive){if(Math.max(Math.abs(He),Math.abs(ze))<o0)return;if(Math.abs(ze)>Math.abs(He)){const Je=Te.current;Je!=null&&Je.hasPointerCapture(ke.pointerId)&&Je.releasePointerCapture(ke.pointerId),he.current=null,oe.current=null,M&&Ee(0);return}ke.isActive=!0,Ae(!0)}const ct=ve.timeStamp-ke.lastTime;ct>0&&(ke.velocity=(Xe-ke.offset)/ct,ke.lastTime=ve.timeStamp),ke.offset=Xe,M&&Ee(Xe)},ht=ve=>{Oe(ve)},nt=X?`translate3d(calc(${-fe*100}% + ${Se}px), 0, 0)`:`translate3d(0, calc(${-fe*100}% + ${Se}px), 0)`,Be=k?[d[c-1],...d,d[0]]:d;return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:h0(s,n)}}),r.jsxs("div",{className:rt(`${s}-wrapper`,{[`${s}-transition-reveal`]:f==="reveal",[`${s}-transition-reveal-vertical`]:f==="reveal"&&!X}),onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),children:[r.jsxs("div",{className:`${s}-slider-inner`,style:{backgroundColor:"transparent"},children:[r.jsx("div",{ref:Te,className:rt(`${s}-track`,{[`${s}-track-draggable`]:V,[`${s}-track-draggable-vertical`]:V&&!X}),onPointerDown:lt,onPointerMove:tt,onPointerUp:ht,onPointerCancel:ht,onLostPointerCapture:ve=>{oe.current===ve.pointerId&&Oe(ve)},children:r.jsx("div",{ref:_,className:rt(`${s}-list`,{[`${s}-list-slide`]:M,[`${s}-list-slide-vertical`]:M&&!X,[`${s}-list-fade`]:!M}),style:M?{transform:nt,transition:Y||q?"none":`transform ${Fi}ms ${Kc}`}:void 0,children:Be.map((ve,ke)=>{const De=k?so(ke-1,c):ke,$e=k&&(ke===0||ke===c+1)?`clone-${ke===0?"start":"end"}`:`slide-${De}`;return r.jsx("div",{className:rt(`${s}-slide`,{[`${s}-is-active`]:!M&&De===te}),children:r.jsx("div",{className:`${s}-slider-item`,children:r.jsx("div",{className:`${s}-img-wrapper`,children:r.jsx("img",{className:rt(`${s}-slider-image`,{[`${s}-contain`]:ve.image.objectFit==="contain",[`${s}-cover`]:ve.image.objectFit==="cover"}),src:ve.image.url,alt:ve.image.name??"",draggable:!1})})})},$e)})})}),re&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:rt(`${s}-arrow`,{[`${s}-arrow-prev`]:X,[`${s}-arrow-prev-vertical`]:!X,[`${s}-hover-arrow`]:ne}),style:{color:L,"--arrow-hover-color":j,...ae},children:r.jsxs("button",{onClick:ve=>{ve.stopPropagation(),Me(-1)},className:`${s}-arrow-inner`,style:{transform:`translate(${S.scalingValue(B,n)}, ${S.scalingValue(P*(X?1:-1),n)}) rotate(${X?"0deg":"90deg"})`},children:[U&&r.jsx(rn,{url:U,fill:L,hoverFill:j,className:rt(`${s}-arrow-img`,`${s}-mirror`),style:ae}),!U&&r.jsx(Cl,{color:L,className:rt(`${s}-arrow-icon`,`${s}-arrow-img`,`${s}-mirror`)})]})}),r.jsx("div",{className:rt(`${s}-arrow`,{[`${s}-arrow-next`]:X,[`${s}-arrow-next-vertical`]:!X,[`${s}-hover-arrow`]:ne}),style:{color:L,"--arrow-hover-color":j,...ae},children:r.jsxs("button",{className:`${s}-arrow-inner`,onClick:ve=>{ve.stopPropagation(),Me(1)},style:{transform:`translate(${S.scalingValue(B*(X?-1:1),n)}, ${S.scalingValue(P,n)}) rotate(${X?"0deg":"90deg"})`},children:[U&&r.jsx(rn,{url:U,fill:L,hoverFill:j,className:`${s}-arrow-img`,style:ae}),!U&&r.jsx(Cl,{color:L,className:rt(`${s}-arrow-icon`,`${s}-arrow-img`)})]})})]}),G&&r.jsx("div",{className:`${s}-click-overlay`,onClick:()=>Me(1)}),O&&r.jsx("div",{className:rt(`${s}-pagination`,{[`${s}-pagination-inside-bottom`]:X,[`${s}-pagination-inside-left`]:!X}),style:X?{bottom:R(b.inset)}:{left:R(b.inset)},children:r.jsx("div",{className:rt(`${s}-pagination-inner`,{[`${s}-pagination-vertical`]:!X,[`${s}-animate-dots`]:de}),style:{backgroundColor:E,gap:R(b.gapInactive-b.activeDot+b.dot),...X?{height:R(b.activeDot+b.paddingY*2),paddingTop:R(b.paddingY),paddingBottom:R(b.paddingY),paddingLeft:R(b.paddingActive),paddingRight:R(b.paddingActive)}:{width:R(b.activeDot+b.paddingY*2),paddingLeft:R(b.paddingY),paddingRight:R(b.paddingY),paddingTop:R(b.paddingActive),paddingBottom:R(b.paddingActive)},borderRadius:R(b.borderRadius),transform:`translate(${S.scalingValue(oo.offset.x,n)}, ${S.scalingValue(oo.offset.y,n)})`},children:d.map((ve,ke)=>{const De=ke===te,Ue=De?b.activeDot:b.dot;return r.jsx("button",{onClick:()=>le(ke),className:`${s}-pagination-item`,style:{width:R(b.activeDot)},children:r.jsx("div",{className:`${s}-dot`,style:{backgroundColor:De?W:w,width:R(Ue)}})},ke)})},`${m}-${v}`)})]}),r.jsxs("div",{className:`${s}-caption-block`,children:[r.jsx("div",{"data-controls":o?"captionMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:S.scalingValue(F,n)}}),r.jsx("div",{className:`${s}-caption-text-wrapper`,children:d.map((ve,ke)=>r.jsx("div",{className:rt(`${s}-caption-text`,{[`${s}-with-pointer-events`]:ke===te&&n,[`${s}-active`]:ke===te}),style:{...l,width:"max-content",transitionDuration:`${Math.round(Fi/2)}ms`},children:r.jsx("div",{className:`${s}-caption-text-inner`,style:{"--link-color":J,"--link-hover-color":J,position:"relative",top:S.scalingValue(ua.offset.y,n),left:S.scalingValue(ua.offset.x,n)},children:r.jsx(yi,{content:ve.imageCaption})})},ke))})]})]})]})}function Cl({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.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 y0=`import React, { useCallback, useEffect, useRef, useState } from 'react';
19565
+ `}function V0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:s}=C.useScopedStyles(),l=N0(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??Ll,p=u.sizeType??"drag",v=u.value??Ll.value,y=(e==null?void 0:e.direction)??"horizontal",g=(e==null?void 0:e.transition)??"slide",h=(e==null?void 0:e.nav)??"classic",m=(e==null?void 0:e.navSize)??"m",b=_0[m],I=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,R=xe=>C.scalingValue(xe*I,n),T=(e==null?void 0:e.show)??"always",q=(e==null?void 0:e.controls)??null,F=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,V=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,A=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,L=(e==null?void 0:e.controlsColor)??Tl.color,O=(e==null?void 0:e.controlsHoverColor)??Tl.hover,x=(e==null?void 0:e.navColor)??ro.colors.inactive,W=(e==null?void 0:e.navPaginationColor)??ro.colors.pagination,E=(e==null?void 0:e.navBackgroundColor)??ro.colors.background,J=(e==null?void 0:e.linkColor)??ma.linkColor,P=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,K=y==="horizontal",B=p==="click",z=p==="drag",ie=p==="auto"&&(!n||!!i),S=!n,M=g==="slide",D=h==="classic",le=T!=="never",oe=T==="on hover",$=C.scalingValue(F,n),ae={width:$,height:$,maxWidth:$},k=M&&c>1,[te,X]=a.useState(0),[ve,Pe]=a.useState(k?1:0),[he,ce]=a.useState(!1),[U,Y]=a.useState(!1),[Z,We]=a.useState(!1),[$e,ke]=a.useState(0),[de,fe]=a.useState(!1),[we,G]=a.useState(!1),se=a.useRef(!1),pe=a.useRef(ve);pe.current=ve;const Se=a.useRef(null),Me=a.useRef(0),Le=a.useRef(null),H=a.useRef(null),ye=a.useRef(null),re=a.useRef(null),_=a.useCallback(xe=>{se.current=xe,ce(xe)},[]),ee=a.useCallback(xe=>{if(c<2||xe===0)return;const Fe=xe>0?1:-1,je=Math.abs(xe);if(fe(!0),_(!0),!M){X(Ze=>lo(Ze+xe,c));return}let Ke=pe.current;const ne=k&&(Ke===0||Ke===c+1),ge=ne?te+1:null;ne&&(Ke=te+1);let Ie=je;for(;Ie>0;){const Ze=O0(Ke,Fe,c,k);if(Ke=Ze.position,Ie-=1,Ze.hitBoundary){Me.current=Ie*Fe;break}}const Ge=je-Ie;if(Ge>0&&X(Ze=>lo(Ze+Ge*Fe,c)),pe.current=Ke,ge!==null){if(pe.current=ge,Ke===ge){Y(!0),Pe(Ke);return}Se.current=Ke,Y(!0),Pe(ge);return}Y(!1),Pe(Ke)},[te,c,k,M,_]),Ae=a.useCallback(xe=>{ee(xe)},[ee]),ue=a.useCallback(xe=>{if(c<2)return;const Fe=lo(xe,c);if(!(Fe===te&&!se.current)&&(fe(!0),_(!0),X(Fe),M)){const je=Fe+(k?1:0);Se.current=null,Me.current=0,pe.current=je,Y(!1),Pe(je)}},[te,c,k,M,_]);a.useEffect(()=>{if(!he)return;const xe=window.setTimeout(()=>{if(k&&(ve===0||ve===c+1)){Se.current=null,Y(!0),Pe(te+1);return}_(!1)},Wi);return()=>window.clearTimeout(xe)},[te,c,k,he,_,ve]),a.useEffect(()=>{if(!U)return;let xe=0;const Fe=requestAnimationFrame(()=>{xe=requestAnimationFrame(()=>{const je=Se.current;Se.current=null;const Ke=Me.current;if(Me.current=0,Y(!1),je!==null){pe.current=je,Pe(je);return}if(Ke!==0){ee(Ke);return}_(!1)})});return()=>{cancelAnimationFrame(Fe),cancelAnimationFrame(xe)}},[ee,_,U]);const N=`${k}:${c}`,Ue=a.useRef(N);a.useEffect(()=>{if(Ue.current===N)return;Ue.current=N;const xe=c>0?Math.min(te,c-1):0;ye.current=null,re.current=null,We(!1),ke(0),X(xe),Y(!0),Pe(xe+(k?1:0))},[te,c,k,N]),a.useEffect(()=>{if(!de)return;const xe=window.setTimeout(()=>fe(!1),P0);return()=>window.clearTimeout(xe)},[de,te]),a.useEffect(()=>{if(!ie||c<2)return;const xe=Math.max(v,.1)*1e3,Fe=window.setInterval(()=>{S&&we||Ae(1)},xe);return()=>window.clearInterval(Fe)},[v,c,Ae,ie,we,S]);const Oe=a.useCallback(xe=>{const Fe=ye.current;if(!Fe||Fe.pointerId!==xe.pointerId)return;ye.current=null,re.current=null;const je=Le.current;if(je!=null&&je.hasPointerCapture(xe.pointerId)&&je.releasePointerCapture(xe.pointerId),!Fe.isActive){M&&ke(0);return}const ne=!(xe.timeStamp-Fe.lastTime>W0)&&Math.abs(Fe.velocity)>F0,ge=Fe.size>0&&Math.abs(Fe.offset-Fe.baseOffset)>Fe.size*A0;if(We(!1),!ne&&!ge){ke(0);return}const Ie=ge?Fe.offset-Fe.baseOffset:Fe.velocity;let Ge=1;ge&&Fe.size>0&&(Ge=Math.max(1,Math.round(Math.abs(Ie)/Fe.size))),ke(0),ee(Ie<0?Ge:-Ge)},[ee,M]);a.useEffect(()=>{const xe=Fe=>{re.current===null||Fe.pointerId!==re.current||Oe(Fe)};return window.addEventListener("pointerup",xe),window.addEventListener("pointercancel",xe),()=>{window.removeEventListener("pointerup",xe),window.removeEventListener("pointercancel",xe)}},[Oe]);const dt=xe=>{const Fe=Le.current;if(!z||c<2||!Fe||xe.pointerType==="mouse"&&xe.button!==0)return;Se.current=null,Me.current=0,se.current&&_(!1);let je=0;const Ke=H.current;if(M&&Ke){const ne=K?Ke.offsetWidth:Ke.offsetHeight;if(ne>0){const ge=D0(Ke,K);let Ie=pe.current;k&&(Ie===0||Ie===c+1)?(Ie=te+1,pe.current=Ie,Y(!0),Pe(Ie),je=0):je=ge+Ie*ne,ke(je)}}Fe.setPointerCapture(xe.pointerId),re.current=xe.pointerId,ye.current={pointerId:xe.pointerId,startClientX:xe.clientX,startClientY:xe.clientY,axes:j0(Fe,`${s}-axis-probe`),size:K?Fe.offsetWidth:Fe.offsetHeight,isActive:!1,baseOffset:je,offset:je,lastTime:xe.timeStamp,velocity:0}},nt=xe=>{const Fe=ye.current;if(!Fe||Fe.pointerId!==xe.pointerId)return;if(xe.pointerType==="mouse"&&xe.buttons===0){Oe(xe);return}const je=xe.clientX-Fe.startClientX,Ke=xe.clientY-Fe.startClientY,ne=Fe.axes?z0(Fe.axes,je,Ke):{x:je,y:Ke},ge=K?ne.x:ne.y,Ie=K?ne.y:ne.x,Ge=Fe.baseOffset+ge;if(!Fe.isActive){if(Math.max(Math.abs(ge),Math.abs(Ie))<k0)return;if(Math.abs(Ie)>Math.abs(ge)){const Ve=Le.current;Ve!=null&&Ve.hasPointerCapture(Fe.pointerId)&&Ve.releasePointerCapture(Fe.pointerId),ye.current=null,re.current=null,M&&ke(0);return}Fe.isActive=!0,We(!0)}const Ze=xe.timeStamp-Fe.lastTime;Ze>0&&(Fe.velocity=(Ge-Fe.offset)/Ze,Fe.lastTime=xe.timeStamp),Fe.offset=Ge,M&&ke(Ge)},ht=xe=>{Oe(xe)},st=K?`translate3d(calc(${-ve*100}% + ${$e}px), 0, 0)`:`translate3d(0, calc(${-ve*100}% + ${$e}px), 0)`,Be=k?[d[c-1],...d,d[0]]:d;return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:B0(s,n)}}),r.jsxs("div",{className:ut(`${s}-wrapper`,{[`${s}-transition-reveal`]:g==="reveal",[`${s}-transition-reveal-vertical`]:g==="reveal"&&!K}),onMouseEnter:()=>G(!0),onMouseLeave:()=>G(!1),children:[r.jsxs("div",{className:`${s}-slider-inner`,style:{backgroundColor:"transparent"},children:[r.jsx("div",{ref:Le,className:ut(`${s}-track`,{[`${s}-track-draggable`]:z,[`${s}-track-draggable-vertical`]:z&&!K}),onPointerDown:dt,onPointerMove:nt,onPointerUp:ht,onPointerCancel:ht,onLostPointerCapture:xe=>{re.current===xe.pointerId&&Oe(xe)},children:r.jsx("div",{ref:H,className:ut(`${s}-list`,{[`${s}-list-slide`]:M,[`${s}-list-slide-vertical`]:M&&!K,[`${s}-list-fade`]:!M}),style:M?{transform:st,transition:Z||U?"none":`transform ${Wi}ms ${Zc}`}:void 0,children:Be.map((xe,Fe)=>{const je=k?lo(Fe-1,c):Fe,ne=k&&(Fe===0||Fe===c+1)?`clone-${Fe===0?"start":"end"}`:`slide-${je}`;return r.jsx("div",{className:ut(`${s}-slide`,{[`${s}-is-active`]:!M&&je===te}),children:r.jsx("div",{className:`${s}-slider-item`,children:r.jsx("div",{className:`${s}-img-wrapper`,children:r.jsx("img",{className:ut(`${s}-slider-image`,{[`${s}-contain`]:xe.image.objectFit==="contain",[`${s}-cover`]:xe.image.objectFit==="cover"}),src:xe.image.url,alt:xe.image.name??"",draggable:!1})})})},ne)})})}),le&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:ut(`${s}-arrow`,{[`${s}-arrow-prev`]:K,[`${s}-arrow-prev-vertical`]:!K,[`${s}-hover-arrow`]:oe}),style:{color:L,"--arrow-hover-color":O,...ae},children:r.jsxs("button",{onClick:xe=>{xe.stopPropagation(),Ae(-1)},className:`${s}-arrow-inner`,style:{transform:`translate(${C.scalingValue(V,n)}, ${C.scalingValue(A*(K?1:-1),n)}) rotate(${K?"0deg":"90deg"})`},children:[q&&r.jsx(an,{url:q,fill:L,hoverFill:O,className:ut(`${s}-arrow-img`,`${s}-mirror`),style:ae}),!q&&r.jsx(Rl,{color:L,className:ut(`${s}-arrow-icon`,`${s}-arrow-img`,`${s}-mirror`)})]})}),r.jsx("div",{className:ut(`${s}-arrow`,{[`${s}-arrow-next`]:K,[`${s}-arrow-next-vertical`]:!K,[`${s}-hover-arrow`]:oe}),style:{color:L,"--arrow-hover-color":O,...ae},children:r.jsxs("button",{className:`${s}-arrow-inner`,onClick:xe=>{xe.stopPropagation(),Ae(1)},style:{transform:`translate(${C.scalingValue(V*(K?-1:1),n)}, ${C.scalingValue(A,n)}) rotate(${K?"0deg":"90deg"})`},children:[q&&r.jsx(an,{url:q,fill:L,hoverFill:O,className:`${s}-arrow-img`,style:ae}),!q&&r.jsx(Rl,{color:L,className:ut(`${s}-arrow-icon`,`${s}-arrow-img`)})]})})]}),B&&r.jsx("div",{className:`${s}-click-overlay`,onClick:()=>Ae(1)}),D&&r.jsx("div",{className:ut(`${s}-pagination`,{[`${s}-pagination-inside-bottom`]:K,[`${s}-pagination-inside-left`]:!K}),style:K?{bottom:R(b.inset)}:{left:R(b.inset)},children:r.jsx("div",{className:ut(`${s}-pagination-inner`,{[`${s}-pagination-vertical`]:!K,[`${s}-animate-dots`]:de}),style:{backgroundColor:E,gap:R(b.gapInactive-b.activeDot+b.dot),...K?{height:R(b.activeDot+b.paddingY*2),paddingTop:R(b.paddingY),paddingBottom:R(b.paddingY),paddingLeft:R(b.paddingActive),paddingRight:R(b.paddingActive)}:{width:R(b.activeDot+b.paddingY*2),paddingLeft:R(b.paddingY),paddingRight:R(b.paddingY),paddingTop:R(b.paddingActive),paddingBottom:R(b.paddingActive)},borderRadius:R(b.borderRadius),transform:`translate(${C.scalingValue(ro.offset.x,n)}, ${C.scalingValue(ro.offset.y,n)})`},children:d.map((xe,Fe)=>{const je=Fe===te,Ke=je?b.activeDot:b.dot;return r.jsx("button",{onClick:()=>ue(Fe),className:`${s}-pagination-item`,style:{width:R(b.activeDot)},children:r.jsx("div",{className:`${s}-dot`,style:{backgroundColor:je?W:x,width:R(Ke)}})},Fe)})},`${m}-${y}`)})]}),r.jsxs("div",{className:`${s}-caption-block`,children:[r.jsx("div",{"data-controls":o?"captionMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:C.scalingValue(P,n)}}),r.jsx("div",{className:`${s}-caption-text-wrapper`,children:d.map((xe,Fe)=>r.jsx("div",{className:ut(`${s}-caption-text`,{[`${s}-with-pointer-events`]:Fe===te&&n,[`${s}-active`]:Fe===te}),style:{...l,width:"max-content",transitionDuration:`${Math.round(Wi/2)}ms`},children:r.jsx("div",{className:`${s}-caption-text-inner`,style:{"--link-color":J,"--link-hover-color":J,position:"relative",top:C.scalingValue(ma.offset.y,n),left:C.scalingValue(ma.offset.x,n)},children:r.jsx(yi,{content:xe.imageCaption})})},Fe))})]})]})]})}function Rl({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.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 G0=`import React, { useCallback, useEffect, useRef, useState } from 'react';
18596
19566
  import cn from 'classnames';
18597
19567
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
18598
19568
  import { scalingValue } from '../utils/scalingValue';
@@ -19773,14 +20743,14 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
19773
20743
  </svg>
19774
20744
  );
19775
20745
  }
19776
- `,v0={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"}]}]}]}},b0={element:f0,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:v0,sourceCode:y0,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls"}]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily"}},Ei=300/1440,x0=8/1440,di=.004;function w0(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Tl(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Ll(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:S.scalingValue((o-t)/2,i)}}function S0(e){return`
20746
+ `,q0={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"}]}]}]}},U0={element:V0,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:q0,sourceCode:G0,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls"}]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily"}},Mi=300/1440,X0=8/1440,di=.004;function K0(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Il(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function El(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:C.scalingValue((o-t)/2,i)}}function Y0(e){return`
19777
20747
  .${e}-wrapper {
19778
20748
  box-sizing: border-box;
19779
20749
  display: flex;
19780
20750
  flex-direction: column;
19781
20751
  position: relative;
19782
20752
  width: 100%;
19783
- min-height: ${w0(48)};
20753
+ min-height: ${K0(48)};
19784
20754
  }
19785
20755
  .${e}-single-title-layer {
19786
20756
  position: absolute;
@@ -19990,7 +20960,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
19990
20960
  width: var(--cntrl-article-width, 100vw) !important;
19991
20961
  height: var(--cntrl-viewport-height, 100vh) !important;
19992
20962
  }
19993
- `}const $0="rgba(28,31,34,0.9)",In=500,ci="cubic-bezier(0.22, 1, 0.36, 1)",C0=72,T0=50,L0={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},R0=[];function I0(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 E0(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function M0(e){const[t]=e.media;return t!=null&&t.url?t:null}function P0(e){if(!Array.isArray(e)||e.length===0)return[];if(I0(e)){const t=[];for(const n of e){const i=E0(n);if(!i)continue;const o=M0(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 Ea(e){return e.type==="video"}function k0(e){e.pause(),e.removeAttribute("src"),e.load()}function er(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function A0(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const F0=1140/1440;function W0(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 _0(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 H0(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function N0({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:s,onMouseMove:l,onTransitionEnd:d}){return a.useEffect(()=>{const c=n.current;if(c)return()=>{k0(c)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:s,onMouseMove:l,onTransitionEnd:d,style:i})}function O0({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:s,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const x=i==="cover",v=a.useRef(null),f=a.useRef(null),h=a.useRef(null),m=a.useRef(0),b=a.useRef(0),I=a.useRef("none"),R=a.useRef(!1),T=a.useRef(!1),U=a.useRef(!1),A=a.useRef(null),[B,P]=a.useState(null),[L,j]=a.useState("opening"),[w,W]=a.useState(0),[E,J]=a.useState(0),[F,X]=a.useState(!1),[G,V]=a.useState(!1),[ie,C]=a.useState(!1),M=a.useRef(n),O=t[n],re=O?Ea(O):!1,ne=E!==0||F,$=a.useCallback(de=>{U.current=de,X(de)},[]),ae=a.useCallback(()=>{A.current!==null&&(window.clearTimeout(A.current),A.current=null)},[]),k=a.useCallback(()=>{ae(),A.current=window.setTimeout(()=>{ae(),$(!1)},In+32)},[ae,$]),te=a.useCallback(()=>{const de=v.current,ge=f.current;if(!de)return;const be=de.getBoundingClientRect(),z=be.width,se=be.height;if(!z||!se)return;if(i==="cover"){P({width:z,height:se,left:be.left,top:be.top});return}if(!ge){P(er(de));return}const{width:pe,height:xe}=A0(ge);if(!pe||!xe){P(er(de));return}const Re=pe/xe,Te=z/se;if(Re>Te){const _=z/Re;P({width:z,height:_,left:be.left,top:be.top+(se-_)/2})}else{const _=se*Re;P({width:_,height:se,left:be.left+(z-_)/2,top:be.top})}},[i]);a.useEffect(()=>{te();const de=v.current;if(!de)return;const ge=new ResizeObserver(()=>te());return ge.observe(de),()=>ge.disconnect()},[te,n]),a.useEffect(()=>{L==="opening"&&B&&j("open")},[L,B]),a.useEffect(()=>{if(L!=="closing")return;const de=setTimeout(()=>s(),In);return()=>clearTimeout(de)},[L,s]),a.useEffect(()=>()=>{ae()},[ae]),a.useLayoutEffect(()=>{if(M.current===n)return;ae(),W(0),J(0),$(!1),C(!1),V(!1),m.current=0,b.current=0,I.current="none",R.current=!1,h.current=null,T.current=!1;const de=v.current;de&&P(er(de)),M.current=n},[n,$,ae]),a.useEffect(()=>{if(L!=="open")return;let de=null;const ge=()=>{de&&(document.removeEventListener("click",de,!0),de=null)},be=()=>{ge(),de=Te=>{Te.stopPropagation(),Te.preventDefault(),ge()},document.addEventListener("click",de,!0)},z=Te=>{ae(),U.current=!1,X(!1),J(0),V(!1),R.current=!1,b.current=0,I.current="none";const _=v.current;_&&P(er(_)),Te<0?d():l()},se=Te=>{if(Math.abs(Te)>T0&&t.length>1){z(Te);return}$(!0),J(0),k()},pe=Te=>{if(Te.touches.length!==1||U.current)return;const _=Te.touches[0];T.current=!0,h.current={x:_.clientX,y:_.clientY},I.current="none",b.current=0,R.current=!1},xe=Te=>{if(!h.current||Te.touches.length!==1||U.current)return;const _=Te.touches[0],he=_.clientX-h.current.x,oe=_.clientY-h.current.y;if(I.current==="none"){if(Math.abs(he)<10&&Math.abs(oe)<10)return;if(Math.abs(he)>Math.abs(oe)){if(t.length<=1)return;I.current="horizontal"}else if(oe>0)I.current="vertical";else return}if(I.current==="horizontal"){R.current=!0,V(!0),b.current=he,J(he),Te.preventDefault();return}I.current==="vertical"&&(R.current=!0,V(!0),m.current=oe,W(oe),Te.preventDefault())},Re=()=>{if(!h.current)return;const Te=I.current,_=R.current;if(_&&Te==="horizontal")se(b.current),be();else if(_&&Te==="vertical")if(m.current>C0){const oe=window.innerHeight;m.current=oe,C(!0),W(oe),j("closing")}else m.current=0,W(0),be();else Te==="horizontal"&&Math.abs(b.current)>0&&(se(b.current),be());h.current=null,I.current="none",b.current=0,R.current=!1,V(!1)};return document.addEventListener("touchstart",pe,{passive:!0}),document.addEventListener("touchmove",xe,{passive:!1}),document.addEventListener("touchend",Re),document.addEventListener("touchcancel",Re),()=>{document.removeEventListener("touchstart",pe),document.removeEventListener("touchmove",xe),document.removeEventListener("touchend",Re),document.removeEventListener("touchcancel",Re),ge()}},[L,t.length,d,l,$,k,ae]),a.useEffect(()=>{const de=ge=>{ge.key==="Escape"&&(ge.preventDefault(),ge.stopPropagation(),L!=="closing"&&j("closing"))};return window.addEventListener("keydown",de,!0),()=>window.removeEventListener("keydown",de,!0)},[L]);const K=()=>{L!=="closing"&&j("closing")},fe=L==="open",Ie=L==="closing",me=w>0?Math.max(0,1-w/500):1,ue=w>0?Math.max(.35,1-w/500):1,q=de=>{if(de.stopPropagation(),T.current){T.current=!1;return}if(t.length<=1)return;const ge=de.currentTarget.getBoundingClientRect(),be=de.clientY-ge.top,z=Math.min(52,ge.height*.2);if(!(be>ge.height-z)){if(de.clientX-ge.left<ge.width/2){l();return}d()}},Q=de=>{if(t.length<=1)return;const ge=de.currentTarget.getBoundingClientRect(),be=de.clientX-ge.left,z=de.clientY-ge.top,se=Math.min(52,ge.height*.2);if(z>ge.height-se){de.currentTarget.style.cursor="default";return}de.currentTarget.style.cursor=be<ge.width/2?"w-resize":"e-resize"},Y=a.useCallback(de=>{de.propertyName!=="transform"||!U.current||(ae(),$(!1))},[ae,$]),Ae=ne?`translateX(${E}px)`:w>0?`translateY(${w}px)`:void 0,Se={position:"fixed",top:B==null?void 0:B.top,left:B==null?void 0:B.left,width:B==null?void 0:B.width,height:B==null?void 0:B.height,objectFit:i==="cover"?"cover":"contain",transform:Ae,opacity:w>0?ue:L==="opening"||Ie?0:1,transition:G&&!F?"none":F?`transform ${In}ms ${ci}`:ie?`transform ${In}ms ${ci}, opacity ${In}ms ${ci}`:L==="opening"||Ie?`opacity ${In}ms ${ci}`:"none",pointerEvents:re&&fe&&!ne?"auto":"none",touchAction:re&&fe?"none":void 0,zIndex:9998},Ee=B?{position:"fixed",top:B.top,height:B.height,width:B.width/2,zIndex:9999}:null;return r.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:L==="open"?"none":void 0},onClick:K,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:fe?me:0,transition:G?"none":`opacity ${In}ms ${ci}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:x?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:v,style:{position:"absolute",inset:0}}),r.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:fe?1:0,transition:`opacity ${In}ms ${ci}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:v,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:fe?1:0,transition:`opacity ${In}ms ${ci}`},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),B&&O&&(re?r.jsx(N0,{src:O.url,phase:L,mediaRef:f,mediaStyle:Se,onLoadedMetadata:te,onClick:q,onMouseMove:Q,onTransitionEnd:Y},`${n}-${O.url}`):r.jsx("img",{ref:f,src:O.url,alt:O.name,onLoad:te,onTransitionEnd:Y,style:Se},`${n}-${O.url}`)),fe&&Ee&&t.length>1&&!re&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...Ee,left:B.left,cursor:"w-resize",pointerEvents:ne?"none":"auto"},onClick:de=>{if(T.current){T.current=!1;return}de.stopPropagation(),l()}}),r.jsx("div",{style:{...Ee,left:B.left+B.width/2,cursor:"e-resize",pointerEvents:ne?"none":"auto"},onClick:de=>{if(T.current){T.current=!1;return}de.stopPropagation(),d()}})]})]})}function Rl({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:s,isEditor:l,galleryPaddingBetween:d=0,showPaddingAfter:c=!1,showControls:u=!1,onMediaClick:p}){const x=`${e}-gallery-${Ea(t)?"video":"image"}`,v=s.display==="cover",f=_0(s),h=L=>S.scalingValue(L,l??!1),m=n??Ei,b=o?{width:"100%",maxWidth:"100%"}:{width:h(m),maxWidth:"100%"},I=i?{borderRadius:h(i)}:{},R={...b,...v?{aspectRatio:f,height:"auto",overflow:"hidden"}:{},...I},T={...v?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":h(m)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...v?{}:I},A={className:x,style:T,onClick:p?L=>{L.stopPropagation(),p()}:void 0},B=Math.max(d,di),P=Ea(t)?r.jsx("video",{...A,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):r.jsx("img",{...A,src:t.url,alt:t.name??""});return r.jsxs("div",{className:`${e}-gallery-item`,children:[v?r.jsx("div",{style:R,children:P}):P,c&&d>0&&r.jsx("div",{className:`${e}-padding-handle`,style:{height:h(d)},"aria-hidden":"true"}),u&&c&&r.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(B)}})]})}function D0({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:s,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const x=t==="a"?i:t==="c"?o:0,v=x>0||c;return r.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&v&&r.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(x)},"aria-hidden":"true"}),c&&t==="c"&&r.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%"}}),r.jsx("div",{className:`${e}-gallery`,style:n,children:p}),t==="a"&&v&&r.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(x)},"aria-hidden":"true"}),c&&t==="a"&&r.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(s),height:"100%"}})]})}function j0(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function Il({P:e,scaled:t,height:n,paired:i}){return r.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 El({P:e,controlKey:t,scaled:n,width:i,maxFraction:o,side:s,paired:l,anchorStyle:d}){return r.jsx("div",{"data-controls":t,...l?{"data-controls-paired":""}:{},"data-controls-axis":"x","data-controls-variant":"column-padding",...s==="right"?{"data-controls-reverse":""}:{},"data-controls-min":"0","data-controls-max-fraction":String(o),className:`${e}-control-anchor`,style:{top:0,...s==="left"?{left:0}:{right:0},width:n(i),height:"100%",...d}})}function pa({P:e,title:t,position:n,titleRef:i,titleClassName:o,titleContainerStyle:s,titleTextBoxStyle:l,titleStyle:d,showTextBoxOutline:c=!1,topPaddingControl:u}){const p=a.useRef(null),[x,v]=a.useState(0),f=t??"",h=n==="left"||n==="center"||n==="right";return a.useLayoutEffect(()=>{if(!h)return;const m=p.current;if(!m||typeof ResizeObserver>"u")return;const b=()=>v(m.offsetHeight);b();const I=new ResizeObserver(b);return I.observe(m),()=>I.disconnect()},[f,h]),r.jsx("div",{ref:m=>{p.current=m,i(m)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...h?{[`--${e}-title-height`]:`${x}px`}:{},...s},children:r.jsxs("div",{className:`${e}-title-text-stack`,style:l,children:[u,r.jsx("div",{className:c?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:r.jsx("span",{className:`${e}-title-text`,style:d,children:f})})]})})}const Ml=45;function Pl(e,t,n){let i=e;for(;i;){const o=getComputedStyle(i).getPropertyValue(t).trim();if(o){const s=parseFloat(o);if(!Number.isNaN(s))return s}i=i.parentElement}return n}function z0(e){const t=Pl(e,"--cntrl-viewport-height",window.innerHeight),n=Pl(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function B0(e,t,n){const{top:i,centerY:o}=z0(n);if(t==="top"){const l=n&&parseFloat(getComputedStyle(n).top)||i;return Math.abs(e.top-l)}const s=e.top+e.height/2;return Math.abs(s-o)}function V0(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=B0(u,n,c);return Math.exp(-(p*p)/(2*Ml*Ml))});let o=0,s=-1;return i.forEach((l,d)=>{l>s&&(s=l,o=d)}),{opacities:i,dominantIndex:o}}function G0(e,t,n){const i=a.useRef([]),[{opacities:o,dominantIndex:s},l]=a.useState(()=>({opacities:Array.from({length:e},(c,u)=>u===0?1:0),dominantIndex:0}));return a.useLayoutEffect(()=>{if(!t||e===0){l({opacities:Array.from({length:e},()=>1),dominantIndex:0});return}let c=0;const u=()=>{l(V0(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:s}}function U0(e,t){const[n,i]=a.useState(e),o=a.useRef(e);return a.useEffect(()=>{if(!t){o.current=e,i(e);return}const s=Array.from(o.current),l=Array.from(e),d=Math.max(s.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),...s.slice(c)].join("");o.current=p,i(p),c>=d&&window.clearInterval(u)},35);return()=>window.clearInterval(u)},[t,e]),n}function q0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:s}){var ut;const{prefix:l}=S.useScopedStyles(),d=a.useMemo(()=>S0(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)??Ei,v=(e==null?void 0:e.titleWidth)??F0,f=W0(e==null?void 0:e.imageDisplay),h=(e==null?void 0:e.cornerRadius)??x0,m=(e==null?void 0:e.position)??"center",b=(e==null?void 0:e.titleTopPadding)??0,I=(e==null?void 0:e.titleLeftPadding)??0,R=(e==null?void 0:e.titleRightPadding)??0,T=j0(e==null?void 0:e.transition),U=(e==null?void 0:e.lightbox)??"on",A=p==="b",B=T==="fade"||T==="retype",{setTitleRef:P,dominantIndex:L}=G0(c.length,B,m),j=((ut=c[L])==null?void 0:ut.title)??"",w=U0(j,T==="retype"),W=T==="fade"||T==="retype",E=T==="retype"?w:j,J=A?void 0:{width:S.scalingValue(x,n??!1)},F=U==="on"&&(!n||i||o),X=o??!1,G=(e==null?void 0:e.galleryPaddingRight)??0,V=(e==null?void 0:e.galleryPaddingLeft)??0,ie=(e==null?void 0:e.galleryPaddingBetween)??0,C=pt=>S.scalingValue(pt,n??!1),O={width:C(v)},re=p==="a"?G:V,ne=A?{width:"100%"}:{width:`calc(100% - ${C(x)} - ${C(re)})`,...p==="c"?{marginLeft:"auto"}:{}},$=Math.max(G,di),ae=Math.max(V,di),k=Math.max(ie,di),te=Math.max(b,di),K=Math.max(I,di),fe=Math.max(R,di),Ie=Math.max(0,(u??1)-(x??Ei)),me=p==="a"?Math.max(0,(u??1)-(x??Ei)-G):p==="c"?Math.max(0,(u??1)-(x??Ei)-V):p==="b"?u??1:1,ue=X&&(p==="a"||p==="b"||p==="c")&&m==="top",q=X&&((p==="a"||p==="b")&&(m==="left"||m==="top")||p==="c"&&(m==="left"||m==="top")),Q=X&&((p==="c"||p==="b")&&m==="right"||p==="a"&&m==="right"),Y=c.length>1,Ae=A?void 0:C((p==="c"?V:G)+(x??Ei)),Se=p==="c"&&Ae?{left:Ae}:void 0,Ee=p==="a"&&Ae?{right:Ae}:void 0,de=A?{left:0,width:"100%"}:p==="a"?{right:C(G),width:C(x)}:{left:C(V),width:C(x)},{titleColor:ge,titleFontFamily:be,titleFontSettings:z,titleFontSize:se,titleLineHeight:pe,titleLetterSpacing:xe,titleWordSpacing:Re,titleAlign:Te,titleTextAppearance:_,lightboxCounterColor:he,lightboxCounterFontFamily:oe,lightboxCounterFontSettings:H,lightboxCounterFontSize:ee,lightboxCounterLineHeight:Me,lightboxCounterLetterSpacing:le,lightboxCounterWordSpacing:D,lightboxCounterTextAppearance:Ve}=e??{},Oe={fontSettings:{fontFamily:be,fontWeight:(z==null?void 0:z.fontWeight)??400,fontStyle:(z==null?void 0:z.fontStyle)??"normal"},fontSize:se??.01,lineHeight:pe,letterSpacing:xe??0,wordSpacing:Re??0,textAlign:Te??"left",textAppearance:_,color:ge??"#000000"},tt=on(qt(Oe,n)),ht=O,nt=Ll(se,pe,l,n),Be=Tl(se,pe,`${l}-title`,`${l}-text-tight-leading`),ve={fontSettings:{fontFamily:oe,fontWeight:(H==null?void 0:H.fontWeight)??400,fontStyle:(H==null?void 0:H.fontStyle)??"normal"},fontSize:ee??.01,lineHeight:Me,letterSpacing:le??0,wordSpacing:D??0,textAppearance:Ve,color:he??"#DEDDDD"},De={...on(qt(ve,n)),...Ll(ee,Me,l,n)},Ue=Tl(ee,Me,`${l}-lightbox-counter`,`${l}-text-tight-leading`),$e=S.buildColorVars(l,{titleColor:ge??"#000000",lightboxCounterColor:he??"#DEDDDD"},L0,R0),He=a.useRef(null),[ze,Xe]=a.useState(!1),[ct,Je]=a.useState([]),[$t,dt]=a.useState(0),We=a.useCallback((pt,mt)=>{F&&(Je(pt),dt(mt),Xe(!0))},[F]),Ke=a.useCallback(()=>{Xe(!1)},[]),je=a.useMemo(()=>{const pt={...$e},mt=He.current?getComputedStyle(He.current).getPropertyValue("--cntrl-article-width").trim():"";return mt&&(pt["--cntrl-article-width"]=mt),pt},[$e,ze]);return a.useEffect(()=>{if(!ze||U!=="on"||typeof document>"u")return;const pt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=pt}},[ze,U]),a.useEffect(()=>{!n||o||i||Xe(!1)},[n,o,i]),a.useEffect(()=>{U==="off"&&Xe(!1)},[U]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),r.jsx("div",{style:$e,children:r.jsxs("div",{ref:He,className:`${l}-wrapper`,style:{width:S.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&m==="top"?C(b):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(m==="left"||m==="top")||p==="c"&&(m==="left"||m==="top")?C(I):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&m==="right"||p==="a"&&m==="right"?C(R):void 0},children:[W&&r.jsx("div",{className:`${l}-single-title-layer`,children:r.jsx(pa,{P:l,title:E,position:m,titleRef:()=>{},titleClassName:`${Be} ${l}-single-title`,titleContainerStyle:{...nt,...ne},titleTextBoxStyle:ht,titleStyle:tt,showTextBoxOutline:X,topPaddingControl:ue?Il({P:l,scaled:C,height:te,paired:!1}):void 0})}),c.map((pt,mt)=>{const kt=P0(pt.gallery),Xt=mt<c.length-1,Yt=kt.filter(xt=>xt.lightboxMedia).map(xt=>xt.lightboxMedia),vt={P:l,position:m,titleRef:P(mt),titleClassName:Be,titleContainerStyle:nt,titleTextBoxStyle:W?{maxWidth:"100%"}:ht,titleStyle:tt,showTextBoxOutline:X&&!W,topPaddingControl:ue&&!W?Il({P:l,scaled:C,height:te,paired:Y}):void 0};return r.jsxs("div",{"data-item-index":mt,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Xt?C(ie):void 0},children:[q&&El({P:l,controlKey:"titleLeftPadding",scaled:C,width:K,maxFraction:me,side:"left",paired:Y,anchorStyle:Se}),Q&&El({P:l,controlKey:"titleRightPadding",scaled:C,width:fe,maxFraction:me,side:"right",paired:Y,anchorStyle:Ee}),X&&Xt&&r.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:C(k),...de}}),A?r.jsxs("div",{className:`${l}-gallery`,children:[r.jsx("div",{className:`${l}-gallery-media`,children:kt.map(({displayMedia:xt,lightboxMedia:Gt},Ft)=>{const bt=Gt?Yt.findIndex(Nt=>Nt.url===Gt.url):-1;return r.jsx(Rl,{P:l,media:xt,imgWidth:x||void 0,cornerRadius:h||void 0,imageDisplay:f,isEditor:n,galleryPaddingBetween:ie,showPaddingAfter:Ft<kt.length-1,showControls:X,onMediaClick:F&&bt>=0?()=>We(Yt,bt):void 0},`${xt.url}-${Ft}`)})}),r.jsx("div",{className:`${l}-title-layer`,children:r.jsx(pa,{...vt,title:W?"":pt.title})})]}):r.jsxs(r.Fragment,{children:[r.jsx(pa,{...vt,title:W?"":pt.title}),kt.length>0&&r.jsx(D0,{P:l,layoutType:p,galleryWidthStyle:J,galleryPaddingRight:G,galleryPaddingLeft:V,galleryPaddingRightWidth:$,galleryPaddingLeftWidth:ae,galleryPaddingMaxFraction:Ie,showControls:X,scaled:C,children:kt.map(({displayMedia:xt,lightboxMedia:Gt},Ft)=>{const bt=Gt?Yt.findIndex(Nt=>Nt.url===Gt.url):-1;return r.jsx(Rl,{P:l,media:xt,cornerRadius:h||void 0,fillGalleryWidth:!0,imageDisplay:f,isEditor:n,galleryPaddingBetween:ie,showPaddingAfter:Ft<kt.length-1,showControls:X,onMediaClick:F&&bt>=0?()=>We(Yt,bt):void 0},`${xt.url}-${Ft}`)})})]})]},mt)})]})}),ze&&U==="on"&&typeof document<"u"&&e&&(()=>{const pt=(s?document.getElementById(s):null)??document.body;return Yn.createPortal(r.jsx("div",{style:je,"data-selection":"none",children:r.jsx(O0,{prefix:l,items:ct,index:$t,imageDisplay:H0(e.lightboxImageDisplay),isEditor:n,onClose:Ke,onPrev:()=>dt(mt=>(mt-1+ct.length)%ct.length),onNext:()=>dt(mt=>(mt+1)%ct.length),counterClassName:Ue,counterStyle:De,backgroundColor:e.backgroundColor??$0})}),pt)})()]})}const K0=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
20963
+ `}const Z0="rgba(28,31,34,0.9)",In=500,ci="cubic-bezier(0.22, 1, 0.36, 1)",J0=72,Q0=50,ex={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},tx=[];function nx(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 ix(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function ox(e){const[t]=e.media;return t!=null&&t.url?t:null}function rx(e){if(!Array.isArray(e)||e.length===0)return[];if(nx(e)){const t=[];for(const n of e){const i=ix(n);if(!i)continue;const o=ox(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 ka(e){return e.type==="video"}function ax(e){e.pause(),e.removeAttribute("src"),e.load()}function tr(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function sx(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const lx=1140/1440;function cx(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 dx(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 ux(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function px({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:s,onMouseMove:l,onTransitionEnd:d}){return a.useEffect(()=>{const c=n.current;if(c)return()=>{ax(c)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:s,onMouseMove:l,onTransitionEnd:d,style:i})}function mx({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:s,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const v=i==="cover",y=a.useRef(null),g=a.useRef(null),h=a.useRef(null),m=a.useRef(0),b=a.useRef(0),I=a.useRef("none"),R=a.useRef(!1),T=a.useRef(!1),q=a.useRef(!1),F=a.useRef(null),[V,A]=a.useState(null),[L,O]=a.useState("opening"),[x,W]=a.useState(0),[E,J]=a.useState(0),[P,K]=a.useState(!1),[B,z]=a.useState(!1),[ie,S]=a.useState(!1),M=a.useRef(n),D=t[n],le=D?ka(D):!1,oe=E!==0||P,$=a.useCallback(de=>{q.current=de,K(de)},[]),ae=a.useCallback(()=>{F.current!==null&&(window.clearTimeout(F.current),F.current=null)},[]),k=a.useCallback(()=>{ae(),F.current=window.setTimeout(()=>{ae(),$(!1)},In+32)},[ae,$]),te=a.useCallback(()=>{const de=y.current,fe=g.current;if(!de)return;const we=de.getBoundingClientRect(),G=we.width,se=we.height;if(!G||!se)return;if(i==="cover"){A({width:G,height:se,left:we.left,top:we.top});return}if(!fe){A(tr(de));return}const{width:pe,height:Se}=sx(fe);if(!pe||!Se){A(tr(de));return}const Me=pe/Se,Le=G/se;if(Me>Le){const H=G/Me;A({width:G,height:H,left:we.left,top:we.top+(se-H)/2})}else{const H=se*Me;A({width:H,height:se,left:we.left+(G-H)/2,top:we.top})}},[i]);a.useEffect(()=>{te();const de=y.current;if(!de)return;const fe=new ResizeObserver(()=>te());return fe.observe(de),()=>fe.disconnect()},[te,n]),a.useEffect(()=>{L==="opening"&&V&&O("open")},[L,V]),a.useEffect(()=>{if(L!=="closing")return;const de=setTimeout(()=>s(),In);return()=>clearTimeout(de)},[L,s]),a.useEffect(()=>()=>{ae()},[ae]),a.useLayoutEffect(()=>{if(M.current===n)return;ae(),W(0),J(0),$(!1),S(!1),z(!1),m.current=0,b.current=0,I.current="none",R.current=!1,h.current=null,T.current=!1;const de=y.current;de&&A(tr(de)),M.current=n},[n,$,ae]),a.useEffect(()=>{if(L!=="open")return;let de=null;const fe=()=>{de&&(document.removeEventListener("click",de,!0),de=null)},we=()=>{fe(),de=Le=>{Le.stopPropagation(),Le.preventDefault(),fe()},document.addEventListener("click",de,!0)},G=Le=>{ae(),q.current=!1,K(!1),J(0),z(!1),R.current=!1,b.current=0,I.current="none";const H=y.current;H&&A(tr(H)),Le<0?d():l()},se=Le=>{if(Math.abs(Le)>Q0&&t.length>1){G(Le);return}$(!0),J(0),k()},pe=Le=>{if(Le.touches.length!==1||q.current)return;const H=Le.touches[0];T.current=!0,h.current={x:H.clientX,y:H.clientY},I.current="none",b.current=0,R.current=!1},Se=Le=>{if(!h.current||Le.touches.length!==1||q.current)return;const H=Le.touches[0],ye=H.clientX-h.current.x,re=H.clientY-h.current.y;if(I.current==="none"){if(Math.abs(ye)<10&&Math.abs(re)<10)return;if(Math.abs(ye)>Math.abs(re)){if(t.length<=1)return;I.current="horizontal"}else if(re>0)I.current="vertical";else return}if(I.current==="horizontal"){R.current=!0,z(!0),b.current=ye,J(ye),Le.preventDefault();return}I.current==="vertical"&&(R.current=!0,z(!0),m.current=re,W(re),Le.preventDefault())},Me=()=>{if(!h.current)return;const Le=I.current,H=R.current;if(H&&Le==="horizontal")se(b.current),we();else if(H&&Le==="vertical")if(m.current>J0){const re=window.innerHeight;m.current=re,S(!0),W(re),O("closing")}else m.current=0,W(0),we();else Le==="horizontal"&&Math.abs(b.current)>0&&(se(b.current),we());h.current=null,I.current="none",b.current=0,R.current=!1,z(!1)};return document.addEventListener("touchstart",pe,{passive:!0}),document.addEventListener("touchmove",Se,{passive:!1}),document.addEventListener("touchend",Me),document.addEventListener("touchcancel",Me),()=>{document.removeEventListener("touchstart",pe),document.removeEventListener("touchmove",Se),document.removeEventListener("touchend",Me),document.removeEventListener("touchcancel",Me),fe()}},[L,t.length,d,l,$,k,ae]),a.useEffect(()=>{const de=fe=>{fe.key==="Escape"&&(fe.preventDefault(),fe.stopPropagation(),L!=="closing"&&O("closing"))};return window.addEventListener("keydown",de,!0),()=>window.removeEventListener("keydown",de,!0)},[L]);const X=()=>{L!=="closing"&&O("closing")},ve=L==="open",Pe=L==="closing",he=x>0?Math.max(0,1-x/500):1,ce=x>0?Math.max(.35,1-x/500):1,U=de=>{if(de.stopPropagation(),T.current){T.current=!1;return}if(t.length<=1)return;const fe=de.currentTarget.getBoundingClientRect(),we=de.clientY-fe.top,G=Math.min(52,fe.height*.2);if(!(we>fe.height-G)){if(de.clientX-fe.left<fe.width/2){l();return}d()}},Y=de=>{if(t.length<=1)return;const fe=de.currentTarget.getBoundingClientRect(),we=de.clientX-fe.left,G=de.clientY-fe.top,se=Math.min(52,fe.height*.2);if(G>fe.height-se){de.currentTarget.style.cursor="default";return}de.currentTarget.style.cursor=we<fe.width/2?"w-resize":"e-resize"},Z=a.useCallback(de=>{de.propertyName!=="transform"||!q.current||(ae(),$(!1))},[ae,$]),We=oe?`translateX(${E}px)`:x>0?`translateY(${x}px)`:void 0,$e={position:"fixed",top:V==null?void 0:V.top,left:V==null?void 0:V.left,width:V==null?void 0:V.width,height:V==null?void 0:V.height,objectFit:i==="cover"?"cover":"contain",transform:We,opacity:x>0?ce:L==="opening"||Pe?0:1,transition:B&&!P?"none":P?`transform ${In}ms ${ci}`:ie?`transform ${In}ms ${ci}, opacity ${In}ms ${ci}`:L==="opening"||Pe?`opacity ${In}ms ${ci}`:"none",pointerEvents:le&&ve&&!oe?"auto":"none",touchAction:le&&ve?"none":void 0,zIndex:9998},ke=V?{position:"fixed",top:V.top,height:V.height,width:V.width/2,zIndex:9999}:null;return r.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:L==="open"?"none":void 0},onClick:X,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:ve?he:0,transition:B?"none":`opacity ${In}ms ${ci}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:v?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:y,style:{position:"absolute",inset:0}}),r.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 ${In}ms ${ci}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:y,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ve?1:0,transition:`opacity ${In}ms ${ci}`},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),V&&D&&(le?r.jsx(px,{src:D.url,phase:L,mediaRef:g,mediaStyle:$e,onLoadedMetadata:te,onClick:U,onMouseMove:Y,onTransitionEnd:Z},`${n}-${D.url}`):r.jsx("img",{ref:g,src:D.url,alt:D.name,onLoad:te,onTransitionEnd:Z,style:$e},`${n}-${D.url}`)),ve&&ke&&t.length>1&&!le&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...ke,left:V.left,cursor:"w-resize",pointerEvents:oe?"none":"auto"},onClick:de=>{if(T.current){T.current=!1;return}de.stopPropagation(),l()}}),r.jsx("div",{style:{...ke,left:V.left+V.width/2,cursor:"e-resize",pointerEvents:oe?"none":"auto"},onClick:de=>{if(T.current){T.current=!1;return}de.stopPropagation(),d()}})]})]})}function Ml({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:s,isEditor:l,galleryPaddingBetween:d=0,showPaddingAfter:c=!1,showControls:u=!1,onMediaClick:p}){const v=`${e}-gallery-${ka(t)?"video":"image"}`,y=s.display==="cover",g=dx(s),h=L=>C.scalingValue(L,l??!1),m=n??Mi,b=o?{width:"100%",maxWidth:"100%"}:{width:h(m),maxWidth:"100%"},I=i?{borderRadius:h(i)}:{},R={...b,...y?{aspectRatio:g,height:"auto",overflow:"hidden"}:{},...I},T={...y?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":h(m)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...y?{}:I},F={className:v,style:T,onClick:p?L=>{L.stopPropagation(),p()}:void 0},V=Math.max(d,di),A=ka(t)?r.jsx("video",{...F,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):r.jsx("img",{...F,src:t.url,alt:t.name??""});return r.jsxs("div",{className:`${e}-gallery-item`,children:[y?r.jsx("div",{style:R,children:A}):A,c&&d>0&&r.jsx("div",{className:`${e}-padding-handle`,style:{height:h(d)},"aria-hidden":"true"}),u&&c&&r.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(V)}})]})}function gx({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:s,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const v=t==="a"?i:t==="c"?o:0,y=v>0||c;return r.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&y&&r.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(v)},"aria-hidden":"true"}),c&&t==="c"&&r.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%"}}),r.jsx("div",{className:`${e}-gallery`,style:n,children:p}),t==="a"&&y&&r.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(v)},"aria-hidden":"true"}),c&&t==="a"&&r.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(s),height:"100%"}})]})}function hx(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function Pl({P:e,scaled:t,height:n,paired:i}){return r.jsx("div",{"data-controls":"titleTopPadding",...i?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{top:0,left:0,width:"100%",height:t(n)}})}function kl({P:e,controlKey:t,scaled:n,width:i,maxFraction:o,side:s,paired:l,anchorStyle:d}){return r.jsx("div",{"data-controls":t,...l?{"data-controls-paired":""}:{},"data-controls-axis":"x","data-controls-variant":"column-padding",...s==="right"?{"data-controls-reverse":""}:{},"data-controls-min":"0","data-controls-max-fraction":String(o),className:`${e}-control-anchor`,style:{top:0,...s==="left"?{left:0}:{right:0},width:n(i),height:"100%",...d}})}function ga({P:e,title:t,position:n,titleRef:i,titleClassName:o,titleContainerStyle:s,titleTextBoxStyle:l,titleStyle:d,showTextBoxOutline:c=!1,topPaddingControl:u}){const p=a.useRef(null),[v,y]=a.useState(0),g=t??"",h=n==="left"||n==="center"||n==="right";return a.useLayoutEffect(()=>{if(!h)return;const m=p.current;if(!m||typeof ResizeObserver>"u")return;const b=()=>y(m.offsetHeight);b();const I=new ResizeObserver(b);return I.observe(m),()=>I.disconnect()},[g,h]),r.jsx("div",{ref:m=>{p.current=m,i(m)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...h?{[`--${e}-title-height`]:`${v}px`}:{},...s},children:r.jsxs("div",{className:`${e}-title-text-stack`,style:l,children:[u,r.jsx("div",{className:c?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:r.jsx("span",{className:`${e}-title-text`,style:d,children:g})})]})})}const Al=45;function Fl(e,t,n){let i=e;for(;i;){const o=getComputedStyle(i).getPropertyValue(t).trim();if(o){const s=parseFloat(o);if(!Number.isNaN(s))return s}i=i.parentElement}return n}function fx(e){const t=Fl(e,"--cntrl-viewport-height",window.innerHeight),n=Fl(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function yx(e,t,n){const{top:i,centerY:o}=fx(n);if(t==="top"){const l=n&&parseFloat(getComputedStyle(n).top)||i;return Math.abs(e.top-l)}const s=e.top+e.height/2;return Math.abs(s-o)}function vx(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=yx(u,n,c);return Math.exp(-(p*p)/(2*Al*Al))});let o=0,s=-1;return i.forEach((l,d)=>{l>s&&(s=l,o=d)}),{opacities:i,dominantIndex:o}}function xx(e,t,n){const i=a.useRef([]),[{opacities:o,dominantIndex:s},l]=a.useState(()=>({opacities:Array.from({length:e},(c,u)=>u===0?1:0),dominantIndex:0}));return a.useLayoutEffect(()=>{if(!t||e===0){l({opacities:Array.from({length:e},()=>1),dominantIndex:0});return}let c=0;const u=()=>{l(vx(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:s}}function bx(e,t){const[n,i]=a.useState(e),o=a.useRef(e);return a.useEffect(()=>{if(!t){o.current=e,i(e);return}const s=Array.from(o.current),l=Array.from(e),d=Math.max(s.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),...s.slice(c)].join("");o.current=p,i(p),c>=d&&window.clearInterval(u)},35);return()=>window.clearInterval(u)},[t,e]),n}function wx({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:s}){var tt;const{prefix:l}=C.useScopedStyles(),d=a.useMemo(()=>Y0(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",v=(e==null?void 0:e.imgWidth)??Mi,y=(e==null?void 0:e.titleWidth)??lx,g=cx(e==null?void 0:e.imageDisplay),h=(e==null?void 0:e.cornerRadius)??X0,m=(e==null?void 0:e.position)??"center",b=(e==null?void 0:e.titleTopPadding)??0,I=(e==null?void 0:e.titleLeftPadding)??0,R=(e==null?void 0:e.titleRightPadding)??0,T=hx(e==null?void 0:e.transition),q=(e==null?void 0:e.lightbox)??"on",F=p==="b",V=T==="fade"||T==="retype",{setTitleRef:A,dominantIndex:L}=xx(c.length,V,m),O=((tt=c[L])==null?void 0:tt.title)??"",x=bx(O,T==="retype"),W=T==="fade"||T==="retype",E=T==="retype"?x:O,J=F?void 0:{width:C.scalingValue(v,n??!1)},P=q==="on"&&(!n||i||o),K=o??!1,B=(e==null?void 0:e.galleryPaddingRight)??0,z=(e==null?void 0:e.galleryPaddingLeft)??0,ie=(e==null?void 0:e.galleryPaddingBetween)??0,S=rt=>C.scalingValue(rt,n??!1),D={width:S(y)},le=p==="a"?B:z,oe=F?{width:"100%"}:{width:`calc(100% - ${S(v)} - ${S(le)})`,...p==="c"?{marginLeft:"auto"}:{}},$=Math.max(B,di),ae=Math.max(z,di),k=Math.max(ie,di),te=Math.max(b,di),X=Math.max(I,di),ve=Math.max(R,di),Pe=Math.max(0,(u??1)-(v??Mi)),he=p==="a"?Math.max(0,(u??1)-(v??Mi)-B):p==="c"?Math.max(0,(u??1)-(v??Mi)-z):p==="b"?u??1:1,ce=K&&(p==="a"||p==="b"||p==="c")&&m==="top",U=K&&((p==="a"||p==="b")&&(m==="left"||m==="top")||p==="c"&&(m==="left"||m==="top")),Y=K&&((p==="c"||p==="b")&&m==="right"||p==="a"&&m==="right"),Z=c.length>1,We=F?void 0:S((p==="c"?z:B)+(v??Mi)),$e=p==="c"&&We?{left:We}:void 0,ke=p==="a"&&We?{right:We}:void 0,de=F?{left:0,width:"100%"}:p==="a"?{right:S(B),width:S(v)}:{left:S(z),width:S(v)},{titleColor:fe,titleFontFamily:we,titleFontSettings:G,titleFontSize:se,titleLineHeight:pe,titleLetterSpacing:Se,titleWordSpacing:Me,titleAlign:Le,titleTextAppearance:H,lightboxCounterColor:ye,lightboxCounterFontFamily:re,lightboxCounterFontSettings:_,lightboxCounterFontSize:ee,lightboxCounterLineHeight:Ae,lightboxCounterLetterSpacing:ue,lightboxCounterWordSpacing:N,lightboxCounterTextAppearance:Ue}=e??{},Oe={fontSettings:{fontFamily:we,fontWeight:(G==null?void 0:G.fontWeight)??400,fontStyle:(G==null?void 0:G.fontStyle)??"normal"},fontSize:se??.01,lineHeight:pe,letterSpacing:Se??0,wordSpacing:Me??0,textAlign:Le??"left",textAppearance:H,color:fe??"#000000"},nt=rn(Xt(Oe,n)),ht=D,st=El(se,pe,l,n),Be=Il(se,pe,`${l}-title`,`${l}-text-tight-leading`),xe={fontSettings:{fontFamily:re,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:ee??.01,lineHeight:Ae,letterSpacing:ue??0,wordSpacing:N??0,textAppearance:Ue,color:ye??"#DEDDDD"},je={...rn(Xt(xe,n)),...El(ee,Ae,l,n)},Ke=Il(ee,Ae,`${l}-lightbox-counter`,`${l}-text-tight-leading`),ne=C.buildColorVars(l,{titleColor:fe??"#000000",lightboxCounterColor:ye??"#DEDDDD"},ex,tx),ge=a.useRef(null),[Ie,Ge]=a.useState(!1),[Ze,Ve]=a.useState([]),[at,Je]=a.useState(0),Ee=a.useCallback((rt,lt)=>{P&&(Ve(rt),Je(lt),Ge(!0))},[P]),qe=a.useCallback(()=>{Ge(!1)},[]),_e=a.useMemo(()=>{const rt={...ne},lt=ge.current?getComputedStyle(ge.current).getPropertyValue("--cntrl-article-width").trim():"";return lt&&(rt["--cntrl-article-width"]=lt),rt},[ne,Ie]);return a.useEffect(()=>{if(!Ie||q!=="on"||typeof document>"u")return;const rt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=rt}},[Ie,q]),a.useEffect(()=>{!n||o||i||Ge(!1)},[n,o,i]),a.useEffect(()=>{q==="off"&&Ge(!1)},[q]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),r.jsx("div",{style:ne,children:r.jsxs("div",{ref:ge,className:`${l}-wrapper`,style:{width:C.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&m==="top"?S(b):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(m==="left"||m==="top")||p==="c"&&(m==="left"||m==="top")?S(I):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&m==="right"||p==="a"&&m==="right"?S(R):void 0},children:[W&&r.jsx("div",{className:`${l}-single-title-layer`,children:r.jsx(ga,{P:l,title:E,position:m,titleRef:()=>{},titleClassName:`${Be} ${l}-single-title`,titleContainerStyle:{...st,...oe},titleTextBoxStyle:ht,titleStyle:nt,showTextBoxOutline:K,topPaddingControl:ce?Pl({P:l,scaled:S,height:te,paired:!1}):void 0})}),c.map((rt,lt)=>{const Tt=rx(rt.gallery),Ut=lt<c.length-1,Zt=Tt.filter(wt=>wt.lightboxMedia).map(wt=>wt.lightboxMedia),xt={P:l,position:m,titleRef:A(lt),titleClassName:Be,titleContainerStyle:st,titleTextBoxStyle:W?{maxWidth:"100%"}:ht,titleStyle:nt,showTextBoxOutline:K&&!W,topPaddingControl:ce&&!W?Pl({P:l,scaled:S,height:te,paired:Z}):void 0};return r.jsxs("div",{"data-item-index":lt,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Ut?S(ie):void 0},children:[U&&kl({P:l,controlKey:"titleLeftPadding",scaled:S,width:X,maxFraction:he,side:"left",paired:Z,anchorStyle:$e}),Y&&kl({P:l,controlKey:"titleRightPadding",scaled:S,width:ve,maxFraction:he,side:"right",paired:Z,anchorStyle:ke}),K&&Ut&&r.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:S(k),...de}}),F?r.jsxs("div",{className:`${l}-gallery`,children:[r.jsx("div",{className:`${l}-gallery-media`,children:Tt.map(({displayMedia:wt,lightboxMedia:jt},At)=>{const vt=jt?Zt.findIndex(Ft=>Ft.url===jt.url):-1;return r.jsx(Ml,{P:l,media:wt,imgWidth:v||void 0,cornerRadius:h||void 0,imageDisplay:g,isEditor:n,galleryPaddingBetween:ie,showPaddingAfter:At<Tt.length-1,showControls:K,onMediaClick:P&&vt>=0?()=>Ee(Zt,vt):void 0},`${wt.url}-${At}`)})}),r.jsx("div",{className:`${l}-title-layer`,children:r.jsx(ga,{...xt,title:W?"":rt.title})})]}):r.jsxs(r.Fragment,{children:[r.jsx(ga,{...xt,title:W?"":rt.title}),Tt.length>0&&r.jsx(gx,{P:l,layoutType:p,galleryWidthStyle:J,galleryPaddingRight:B,galleryPaddingLeft:z,galleryPaddingRightWidth:$,galleryPaddingLeftWidth:ae,galleryPaddingMaxFraction:Pe,showControls:K,scaled:S,children:Tt.map(({displayMedia:wt,lightboxMedia:jt},At)=>{const vt=jt?Zt.findIndex(Ft=>Ft.url===jt.url):-1;return r.jsx(Ml,{P:l,media:wt,cornerRadius:h||void 0,fillGalleryWidth:!0,imageDisplay:g,isEditor:n,galleryPaddingBetween:ie,showPaddingAfter:At<Tt.length-1,showControls:K,onMediaClick:P&&vt>=0?()=>Ee(Zt,vt):void 0},`${wt.url}-${At}`)})})]})]},lt)})]})}),Ie&&q==="on"&&typeof document<"u"&&e&&(()=>{const rt=(s?document.getElementById(s):null)??document.body;return Yn.createPortal(r.jsx("div",{style:_e,"data-selection":"none",children:r.jsx(mx,{prefix:l,items:Ze,index:at,imageDisplay:ux(e.lightboxImageDisplay),isEditor:n,onClose:qe,onPrev:()=>Je(lt=>(lt-1+Ze.length)%Ze.length),onNext:()=>Je(lt=>(lt+1)%Ze.length),counterClassName:Ke,counterStyle:je,backgroundColor:e.backgroundColor??Z0})}),rt)})()]})}const Sx=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
19994
20964
  import { createPortal } from 'react-dom';
19995
20965
  import type React from 'react';
19996
20966
  import { CommonComponentProps } from '../props';
@@ -22040,7 +23010,7 @@ export function Mercury({
22040
23010
  </>
22041
23011
  );
22042
23012
  }
22043
- `;function Ti(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const ma={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"}}},X0={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:Ti("Gallery Padding Right"),galleryPaddingLeft:Ti("Gallery Padding Left"),galleryPaddingBetween:Ti("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:Ti("Title Top Padding"),titleLeftPadding:Ti("Title Left Padding"),titleRightPadding:Ti("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:{...ma.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:{...ma.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:{...ma.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"]}},Y0={element:q0,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:X0,sourceCode:K0,assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"}},kl=48,Z0=10,J0=400,Q0=1,eb=1120/1440,tb=140/1440,nb=550/1440,ib=13,ob=4,rb=38/100,ab=28/100,Xc=2.8,sb=.9,Yc=.22,lb=.5,cb=1,db=1.5,ub=0,pb=.85;function mb(e,t){return`
23013
+ `;function Li(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const ha={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"}}},$x={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:Li("Gallery Padding Right"),galleryPaddingLeft:Li("Gallery Padding Left"),galleryPaddingBetween:Li("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:Li("Title Top Padding"),titleLeftPadding:Li("Title Left Padding"),titleRightPadding:Li("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:{...ha.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:{...ha.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:{...ha.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"]}},Cx={element:wx,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:$x,sourceCode:Sx,assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"}},Wl=48,Tx=10,Lx=400,Rx=1,Ix=1120/1440,Ex=140/1440,Mx=550/1440,Px=13,kx=4,Ax=38/100,Fx=28/100,Jc=2.8,Wx=.9,Qc=.22,_x=.5,Hx=1,Nx=1.5,Ox=0,Dx=.85;function jx(e,t){return`
22044
23014
  .${e}-wrapper {
22045
23015
  position: relative;
22046
23016
  box-sizing: border-box;
@@ -22085,10 +23055,10 @@ export function Mercury({
22085
23055
  object-position: center;
22086
23056
  }
22087
23057
  ${t}
22088
- `}function Ao(e){return Number(e.toFixed(4))}function Al(e,t,n,i){const s=(typeof e=="string"?Number(e):e)??t;return Number.isFinite(s)?Math.min(i,Math.max(n,Math.round(s))):t}function ga(e,t,n=0,i=9999){const s=(typeof e=="string"?Number(e):e)??t;return Number.isFinite(s)?Math.min(i,Math.max(n,s)):t}function gb(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 hb(e){const[t,n]=e.ratioValue.split(":").map(Number),i=e.reversed?n:t;return(e.reversed?t:n)/i}function fb(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 Zc(e,t){return(1-e)/(1-e*Math.cos(t))}function yb(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)*Zc(e,i)))}return t||1}function vb(e,t){return e?1:1+Yc*(.35+t)}function bb(e,t,n,i){const o=t*vb(n,i);return Math.max(0,(e-o)/2)}function Jc(e,t,n){const i=Zc(e,n);return{offset:Math.sin(n)*i/t,scale:i}}function Qc(e,t,n){return e/2+t*n}function xb(e,t,n){return e(t-n/2)}function wb(e,t){return e*t}function ed(e){return Math.round(e*1e3)}function td(e,t,n){const i=Math.cos(e),o=Math.cos(pb*Math.PI/2);if(i>=o)return n;const s=(i+1)/(o+1);return Ao(t+(n-t)*s)}function nd(e){return td(e,lb,cb)}function Sb(e){return td(e,db,ub)}function id(e,t){if(!t)return"none";const n=Sb(e);return n<=0?"none":`blur(${n}px)`}function $b(e,t,n,i,o,s,l,d){const{offset:c,scale:u}=Jc(i,o,s*Math.PI*2),p=s*Math.PI*2,x=Qc(t,n,c),v=Ao(u),f=`calc(${e(x)} - var(--helix-base-w) * ${v} / 2)`,h=`calc(var(--helix-base-w) * ${v})`,m=l?`height: calc(var(--helix-base-h) * ${v});`:"";return`left: ${f}; width: ${h}; ${m} z-index: ${ed(u)}; transform: translateY(-50%); opacity: ${nd(p)}; filter: ${id(p,d)};`}function Cb(e,t,n,i,o,s,l,d){const c=[];for(let u=0;u<=kl;u+=1){const p=u/kl;c.push(` ${Ao(p*100)}% { ${$b(t,n,i,o,s,p,l,d)} }`)}return`@keyframes ${e}-orbit {
23058
+ `}function Fo(e){return Number(e.toFixed(4))}function _l(e,t,n,i){const s=(typeof e=="string"?Number(e):e)??t;return Number.isFinite(s)?Math.min(i,Math.max(n,Math.round(s))):t}function fa(e,t,n=0,i=9999){const s=(typeof e=="string"?Number(e):e)??t;return Number.isFinite(s)?Math.min(i,Math.max(n,s)):t}function zx(e){return typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"2:3",reversed:(e==null?void 0:e.reversed)??!1}}function Bx(e){const[t,n]=e.ratioValue.split(":").map(Number),i=e.reversed?n:t;return(e.reversed?t:n)/i}function Vx(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 ed(e,t){return(1-e)/(1-e*Math.cos(t))}function Gx(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)*ed(e,i)))}return t||1}function qx(e,t){return e?1:1+Qc*(.35+t)}function Ux(e,t,n,i){const o=t*qx(n,i);return Math.max(0,(e-o)/2)}function td(e,t,n){const i=ed(e,n);return{offset:Math.sin(n)*i/t,scale:i}}function nd(e,t,n){return e/2+t*n}function Xx(e,t,n){return e(t-n/2)}function Kx(e,t){return e*t}function id(e){return Math.round(e*1e3)}function od(e,t,n){const i=Math.cos(e),o=Math.cos(Dx*Math.PI/2);if(i>=o)return n;const s=(i+1)/(o+1);return Fo(t+(n-t)*s)}function rd(e){return od(e,_x,Hx)}function Yx(e){return od(e,Nx,Ox)}function ad(e,t){if(!t)return"none";const n=Yx(e);return n<=0?"none":`blur(${n}px)`}function Zx(e,t,n,i,o,s,l,d){const{offset:c,scale:u}=td(i,o,s*Math.PI*2),p=s*Math.PI*2,v=nd(t,n,c),y=Fo(u),g=`calc(${e(v)} - var(--helix-base-w) * ${y} / 2)`,h=`calc(var(--helix-base-w) * ${y})`,m=l?`height: calc(var(--helix-base-h) * ${y});`:"";return`left: ${g}; width: ${h}; ${m} z-index: ${id(u)}; transform: translateY(-50%); opacity: ${rd(p)}; filter: ${ad(p,d)};`}function Jx(e,t,n,i,o,s,l,d){const c=[];for(let u=0;u<=Wl;u+=1){const p=u/Wl;c.push(` ${Fo(p*100)}% { ${Zx(t,n,i,o,s,p,l,d)} }`)}return`@keyframes ${e}-orbit {
22089
23059
  ${c.join(`
22090
23060
  `)}
22091
- }`}function od(e,t){return(e%t+t)%t}function Tb(e,t){return cs(e,t)/t}function cs(e,t){return od(e,t)}function Lb(e,t){return Math.floor(e/t)}function Rb(e,t,n,i){return Lb(e,t)*n+cs(e,t)*i}function Ib(e,t,n){const i=n==="left"?1-e:e;return`${Ao(-i*t)}s`}function Fl(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function rd(e){const t=e%1;return t<0?t+1:t}function Eb(e,t,n){const i=t/Xc,o=n==="left"?-e*i:e*i;return rd(o)}function Mb({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=S.useScopedStyles(),s=a.useRef(null),l=ga((e==null?void 0:e.width)??(e==null?void 0:e.spread)??(e==null?void 0:e.wrapperWidth),eb),d=ga(e==null?void 0:e.imageWidth,tb),c=ga(e==null?void 0:e.turnHeight,nb),u=Al(e==null?void 0:e.itemsPerTurn,ib,3,40),p=Al(e==null?void 0:e.turns,ob,1,30),x=Math.min(sb,Math.max(0,rb)),v=Math.min(1,Math.max(0,ab)),f=Math.max(0,(e==null?void 0:e.speed)??Xc),h=(e==null?void 0:e.direction)==="left"?"left":"right",m=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",b=(e==null?void 0:e.cornerRadius)??0,I=(e==null?void 0:e.blur)!=="off",R=a.useMemo(()=>gb(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),T=R.display==="cover",U=ne=>S.scalingValue(ne,n??!1),A=a.useMemo(()=>yb(x),[x]),B=a.useMemo(()=>bb(l,d,T,v),[l,d,T,v]),P=a.useMemo(()=>mb(o,Cb(o,U,l,B,x,A,T,I)),[o,l,B,x,A,T,I,n]),L=a.useMemo(()=>(t??[]).filter(ne=>{var $;return!!(($=ne.image)!=null&&$.url)}),[t]),j=c/u,w=d*hb(R),W=Math.min(J0,p*u),E=Q0*u,J=W+E*2,X=Math.max(0,p-1)*c+(u-1)*j,G=f>0,V=m==="scroll"&&G,ie=m==="autoplay"&&G&&(n?!!i:!0),[C,M]=a.useState(0);a.useEffect(()=>{if(!V)return;const ne=s.current;if(!ne)return;const $=()=>{const k=ne.getBoundingClientRect(),te=window.innerHeight||document.documentElement.clientHeight,K=te+k.height;K<=0||M(Math.min(1,Math.max(0,(te-k.top)/K)))};$(),window.addEventListener("scroll",$,{passive:!0}),window.addEventListener("resize",$);const ae=new ResizeObserver($);return ae.observe(ne),()=>{window.removeEventListener("scroll",$),window.removeEventListener("resize",$),ae.disconnect()}},[V]);const O=V?Eb(C,f,h):0,re=G&&m==="autoplay"?360/(f*Z0):0;return L.length===0?r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:P}}),r.jsx("div",{className:`${o}-wrapper`,style:{width:U(l),marginInline:"auto"}})]}):r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:P}}),r.jsx("div",{ref:s,className:`${o}-wrapper`,style:{width:U(l),height:U(X),marginInline:"auto"},children:Array.from({length:J},(ne,$)=>{const ae=$-E,te=L[od(ae,L.length)].image,K=cs(ae,u),fe=Tb(ae,u),Ie=V?rd(fe+O):fe,me=Rb(ae,u,c,j),ue=v===0?0:(Fl(K+7.3)-.5)*v*j,q=T?1:1+(Fl(K+3.1)-.5)*2*Yc*(.35+v),Q=Ie*Math.PI*2,{offset:Y,scale:Ae}=Jc(x,A,Q),Se=d*q,Ee=wb(Se,Ae),de=Qc(l,B,Y),ge={"--helix-base-w":U(Se),...T?{"--helix-base-h":U(w)}:{}},be={top:U(me+ue),transform:"translateY(-50%)",...ge,...ie?{animationDuration:`${Ao(re)}s`,animationDelay:Ib(fe,re,h),animationDirection:h==="left"?"reverse":"normal"}:{left:xb(U,de,Ee),width:U(Ee),...T?{height:U(w*Ae)}:{},zIndex:ed(Ae),opacity:nd(Q),filter:id(Q,I)}},z=b>0?{borderRadius:U(b)}:{},se=T?{...z,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}:z,pe=fb(te)?r.jsx("video",{className:`${o}-media`,style:se,src:te.url,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):r.jsx("img",{className:`${o}-media`,style:se,src:te.url,alt:te.name??"",loading:"lazy",decoding:"async"});return r.jsx("div",{className:ie?`${o}-item`:`${o}-item ${o}-item-static`,style:be,children:T?r.jsx("div",{className:`${o}-cover`,style:z,children:pe}):pe},`${p}-${u}-${ae}`)})})]})}const Pb=`import { useEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
23061
+ }`}function sd(e,t){return(e%t+t)%t}function Qx(e,t){return ps(e,t)/t}function ps(e,t){return sd(e,t)}function eb(e,t){return Math.floor(e/t)}function tb(e,t,n,i){return eb(e,t)*n+ps(e,t)*i}function nb(e,t,n){const i=n==="left"?1-e:e;return`${Fo(-i*t)}s`}function Hl(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function ld(e){const t=e%1;return t<0?t+1:t}function ib(e,t,n){const i=t/Jc,o=n==="left"?-e*i:e*i;return ld(o)}function ob({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=C.useScopedStyles(),s=a.useRef(null),l=fa((e==null?void 0:e.width)??(e==null?void 0:e.spread)??(e==null?void 0:e.wrapperWidth),Ix),d=fa(e==null?void 0:e.imageWidth,Ex),c=fa(e==null?void 0:e.turnHeight,Mx),u=_l(e==null?void 0:e.itemsPerTurn,Px,3,40),p=_l(e==null?void 0:e.turns,kx,1,30),v=Math.min(Wx,Math.max(0,Ax)),y=Math.min(1,Math.max(0,Fx)),g=Math.max(0,(e==null?void 0:e.speed)??Jc),h=(e==null?void 0:e.direction)==="left"?"left":"right",m=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",b=(e==null?void 0:e.cornerRadius)??0,I=(e==null?void 0:e.blur)!=="off",R=a.useMemo(()=>zx(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),T=R.display==="cover",q=oe=>C.scalingValue(oe,n??!1),F=a.useMemo(()=>Gx(v),[v]),V=a.useMemo(()=>Ux(l,d,T,y),[l,d,T,y]),A=a.useMemo(()=>jx(o,Jx(o,q,l,V,v,F,T,I)),[o,l,V,v,F,T,I,n]),L=a.useMemo(()=>(t??[]).filter(oe=>{var $;return!!(($=oe.image)!=null&&$.url)}),[t]),O=c/u,x=d*Bx(R),W=Math.min(Lx,p*u),E=Rx*u,J=W+E*2,K=Math.max(0,p-1)*c+(u-1)*O,B=g>0,z=m==="scroll"&&B,ie=m==="autoplay"&&B&&(n?!!i:!0),[S,M]=a.useState(0);a.useEffect(()=>{if(!z)return;const oe=s.current;if(!oe)return;const $=()=>{const k=oe.getBoundingClientRect(),te=window.innerHeight||document.documentElement.clientHeight,X=te+k.height;X<=0||M(Math.min(1,Math.max(0,(te-k.top)/X)))};$(),window.addEventListener("scroll",$,{passive:!0}),window.addEventListener("resize",$);const ae=new ResizeObserver($);return ae.observe(oe),()=>{window.removeEventListener("scroll",$),window.removeEventListener("resize",$),ae.disconnect()}},[z]);const D=z?ib(S,g,h):0,le=B&&m==="autoplay"?360/(g*Tx):0;return L.length===0?r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:A}}),r.jsx("div",{className:`${o}-wrapper`,style:{width:q(l),marginInline:"auto"}})]}):r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:A}}),r.jsx("div",{ref:s,className:`${o}-wrapper`,style:{width:q(l),height:q(K),marginInline:"auto"},children:Array.from({length:J},(oe,$)=>{const ae=$-E,te=L[sd(ae,L.length)].image,X=ps(ae,u),ve=Qx(ae,u),Pe=z?ld(ve+D):ve,he=tb(ae,u,c,O),ce=y===0?0:(Hl(X+7.3)-.5)*y*O,U=T?1:1+(Hl(X+3.1)-.5)*2*Qc*(.35+y),Y=Pe*Math.PI*2,{offset:Z,scale:We}=td(v,F,Y),$e=d*U,ke=Kx($e,We),de=nd(l,V,Z),fe={"--helix-base-w":q($e),...T?{"--helix-base-h":q(x)}:{}},we={top:q(he+ce),transform:"translateY(-50%)",...fe,...ie?{animationDuration:`${Fo(le)}s`,animationDelay:nb(ve,le,h),animationDirection:h==="left"?"reverse":"normal"}:{left:Xx(q,de,ke),width:q(ke),...T?{height:q(x*We)}:{},zIndex:id(We),opacity:rd(Y),filter:ad(Y,I)}},G=b>0?{borderRadius:q(b)}:{},se=T?{...G,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}:G,pe=Vx(te)?r.jsx("video",{className:`${o}-media`,style:se,src:te.url,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):r.jsx("img",{className:`${o}-media`,style:se,src:te.url,alt:te.name??"",loading:"lazy",decoding:"async"});return r.jsx("div",{className:ie?`${o}-item`:`${o}-item ${o}-item-static`,style:we,children:T?r.jsx("div",{className:`${o}-cover`,style:G,children:pe}):pe},`${p}-${u}-${ae}`)})})]})}const rb=`import { useEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
22092
23062
  import { CommonComponentProps } from '../props';
22093
23063
  import { scalingValue } from '../utils/scalingValue';
22094
23064
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -22626,4 +23596,4 @@ export function Helix({
22626
23596
  </>
22627
23597
  );
22628
23598
  }
22629
- `,kb=["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"],Ab={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:kb.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"]}]}]},Fb={element:Mb,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:Ab,sourceCode:Pb,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Wb=[yp,Cp,Ky,fm,Tm,Wm,eg,sg,gg,Og,kh,Hf,Uf,Iy,Oy,av,n0,yv,b0,Y0,Fb];exports.components=Wb;exports.isSchemaV1=ld;
23599
+ `,ab=["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"],sb={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:ab.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"]}]}]},lb={element:ob,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:sb,sourceCode:rb,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},cb=[bp,Rp,Sv,xm,Im,Nm,ig,Ig,Wg,zg,mh,sf,uy,by,nv,mv,Fv,M0,Gv,U0,Cx,lb];exports.components=cb;exports.isSchemaV1=ud;