@cntrl-site/components 1.0.39-alpha.0 → 1.0.39-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +22 -22
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=require("react"),nt=require("classnames"),F=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Mi=require("react-dom");function Dl(e){return e.type==="object"&&e.version===1}const Vl="ControlSlider-module__wrapper___sHEkd",ql="ControlSlider-module__hoverArrow___A-dOH",Gl="ControlSlider-module__sliderItem___QQSkR",Kl="ControlSlider-module__sliderImage___9hRl-",Ul="ControlSlider-module__arrow___05ghY",Xl="ControlSlider-module__arrowVertical___tBfVN",Yl="ControlSlider-module__nextArrow___-30Yc",Jl="ControlSlider-module__arrowInner___aEra3",Zl="ControlSlider-module__arrowIcon___S4ztF",Ql="ControlSlider-module__arrowImg___2dwJW",ec="ControlSlider-module__mirror___brd6U",tc="ControlSlider-module__pagination___bicLF",nc="ControlSlider-module__paginationInner___bT-P-",ic="ControlSlider-module__paginationVertical___zYqKw",oc="ControlSlider-module__paginationItem___nTRbk",rc="ControlSlider-module__dot___p1Qun",ac="ControlSlider-module__activeDot___LHFaj",sc="ControlSlider-module__paginationInsideBottom___R3FWn",lc="ControlSlider-module__paginationInsideTop___V-qb-",cc="ControlSlider-module__paginationOutsideBottom___14w8D",dc="ControlSlider-module__paginationOutsideTop___SCLqB",uc="ControlSlider-module__paginationInsideLeft___yOBRZ",pc="ControlSlider-module__paginationInsideRight___Rtt3o",mc="ControlSlider-module__paginationOutsideLeft___lahaw",gc="ControlSlider-module__paginationOutsideRight___EtuQa",hc="ControlSlider-module__imgWrapper___UjEgB",fc="ControlSlider-module__captionBlock___dJ6-j",yc="ControlSlider-module__captionTextWrapper___HFlpf",vc="ControlSlider-module__captionText___uGBVc",xc="ControlSlider-module__active___WZK4G",bc="ControlSlider-module__withPointerEvents___t-18M",wc="ControlSlider-module__topLeftAlignment___zjnGM",Sc="ControlSlider-module__topCenterAlignment___gD1xW",$c="ControlSlider-module__topRightAlignment___NMapS",Cc="ControlSlider-module__middleLeftAlignment___OnUrY",Tc="ControlSlider-module__middleCenterAlignment___Tdkl0",Lc="ControlSlider-module__middleRightAlignment___wEbfX",Ic="ControlSlider-module__bottomLeftAlignment___cTP2-",Ec="ControlSlider-module__bottomCenterAlignment___c54fB",Rc="ControlSlider-module__bottomRightAlignment___kEwrz",Mc="ControlSlider-module__clickOverlay___DZA28",Pc="ControlSlider-module__contain___pLyq7",kc="ControlSlider-module__cover___KdDat",je={wrapper:Vl,hoverArrow:ql,sliderItem:Gl,sliderImage:Kl,arrow:Ul,arrowVertical:Xl,nextArrow:Yl,arrowInner:Jl,arrowIcon:Zl,arrowImg:Ql,mirror:ec,pagination:tc,paginationInner:nc,paginationVertical:ic,paginationItem:oc,dot:rc,activeDot:ac,paginationInsideBottom:sc,paginationInsideTop:lc,paginationOutsideBottom:cc,paginationOutsideTop:dc,paginationInsideLeft:uc,paginationInsideRight:pc,paginationOutsideLeft:mc,paginationOutsideRight:gc,imgWrapper:hc,captionBlock:fc,captionTextWrapper:yc,captionText:vc,active:xc,withPointerEvents:bc,topLeftAlignment:wc,topCenterAlignment:Sc,topRightAlignment:$c,middleLeftAlignment:Cc,middleCenterAlignment:Tc,middleRightAlignment:Lc,bottomLeftAlignment:Ic,bottomCenterAlignment:Ec,bottomRightAlignment:Rc,clickOverlay:Mc,contain:Pc,cover:kc};function Ac(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 Wc(e,t,n){return t&&Ac(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var $a="(prefers-reduced-motion: reduce)",hi=1,_c=2,xi=3,Pi=4,io=5,ko=6,jo=7,Fc={CREATED:hi,MOUNTED:_c,IDLE:xi,MOVING:Pi,SCROLLING:io,DRAGGING:ko,DESTROYED:jo};function Tn(e){e.length=0}function jn(e,t,n){return Array.prototype.slice.call(e,t,n)}function bt(e){return e.bind.apply(e,[null].concat(jn(arguments,1)))}var Ws=setTimeout,Pr=function(){};function Ca(e){return requestAnimationFrame(e)}function Ko(e,t){return typeof t===e}function Vi(e){return!Gr(e)&&Ko("object",e)}var qr=Array.isArray,_s=bt(Ko,"function"),Nn=bt(Ko,"string"),oo=bt(Ko,"undefined");function Gr(e){return e===null}function Fs(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function ro(e){return qr(e)?e:[e]}function en(e,t){ro(e).forEach(t)}function Kr(e,t){return e.indexOf(t)>-1}function Ao(e,t){return e.push.apply(e,ro(t)),e}function bn(e,t,n){e&&en(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function un(e,t){bn(e,Nn(t)?t.split(" "):t,!0)}function ao(e,t){en(t,e.appendChild.bind(e))}function Ur(e,t){en(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function qi(e,t){return Fs(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Ns(e,t){var n=e?jn(e.children):[];return t?n.filter(function(i){return qi(i,t)}):n}function so(e,t){return t?Ns(e,t)[0]:e.firstElementChild}var Gi=Object.keys;function ti(e,t,n){return e&&(n?Gi(e).reverse():Gi(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function Ki(e){return jn(arguments,1).forEach(function(t){ti(t,function(n,i){e[i]=t[i]})}),e}function An(e){return jn(arguments,1).forEach(function(t){ti(t,function(n,i){qr(n)?e[i]=n.slice():Vi(n)?e[i]=An({},Vi(e[i])?e[i]:{},n):e[i]=n})}),e}function Ta(e,t){en(t||Gi(e),function(n){delete e[n]})}function pn(e,t){en(e,function(n){en(t,function(i){n&&n.removeAttribute(i)})})}function Qe(e,t,n){Vi(t)?ti(t,function(i,o){Qe(e,o,i)}):en(e,function(i){Gr(n)||n===""?pn(i,t):i.setAttribute(t,String(n))})}function fi(e,t,n){var i=document.createElement(e);return t&&(Nn(t)?un(i,t):Qe(i,t)),n&&ao(n,i),i}function rn(e,t,n){if(oo(n))return getComputedStyle(e)[t];Gr(n)||(e.style[t]=""+n)}function Ui(e,t){rn(e,"display",t)}function Hs(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function an(e,t){return e.getAttribute(t)}function La(e,t){return e&&e.classList.contains(t)}function Ut(e){return e.getBoundingClientRect()}function ni(e){en(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Os(e){return so(new DOMParser().parseFromString(e,"text/html").body)}function xn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function js(e,t){return e&&e.querySelector(t)}function Xr(e,t){return t?jn(e.querySelectorAll(t)):[]}function wn(e,t){bn(e,t,!1)}function kr(e){return e.timeStamp}function Gn(e){return Nn(e)?e:e?e+"px":""}var lo="splide",Yr="data-"+lo;function Oi(e,t){if(!e)throw new Error("["+lo+"] "+(t||""))}var Hn=Math.min,Bo=Math.max,zo=Math.floor,Xi=Math.ceil,qt=Math.abs;function Bs(e,t,n){return qt(e-t)<n}function Wo(e,t,n,i){var o=Hn(t,n),l=Bo(t,n);return i?o<e&&e<l:o<=e&&e<=l}function pi(e,t,n){var i=Hn(t,n),o=Bo(t,n);return Hn(Bo(i,e),o)}function Ar(e){return+(e>0)-+(e<0)}function Wr(e,t){return en(t,function(n){e=e.replace("%s",""+n)}),e}function Jr(e){return e<10?"0"+e:""+e}var Ia={};function Nc(e){return""+e+Jr(Ia[e]=(Ia[e]||0)+1)}function zs(){var e=[];function t(s,d,c,u){o(s,d,function(m,y,L){var T="addEventListener"in m,h=T?m.removeEventListener.bind(m,y,c,u):m.removeListener.bind(m,c);T?m.addEventListener(y,c,u):m.addListener(c),e.push([m,y,L,c,h])})}function n(s,d,c){o(s,d,function(u,m,y){e=e.filter(function(L){return L[0]===u&&L[1]===m&&L[2]===y&&(!c||L[3]===c)?(L[4](),!1):!0})})}function i(s,d,c){var u,m=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:m,detail:c}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,m,!1,c)),s.dispatchEvent(u),u}function o(s,d,c){en(s,function(u){u&&en(d,function(m){m.split(" ").forEach(function(y){var L=y.split(".");c(u,L[0],L[1])})})})}function l(){e.forEach(function(s){s[4]()}),Tn(e)}return{bind:t,unbind:n,dispatch:i,destroy:l}}var Bn="mounted",_r="ready",Ln="move",ki="moved",Zr="click",Ds="active",Vs="inactive",qs="visible",Gs="hidden",Pt="refresh",zt="updated",bi="resize",Uo="resized",Ks="drag",Us="dragging",Xs="dragged",Xo="scroll",ri="scrolled",Hc="overflow",Qr="destroy",Ys="arrows:mounted",Js="arrows:updated",Zs="pagination:mounted",Qs="pagination:updated",ea="navigation:mounted",ta="autoplay:play",el="autoplay:playing",na="autoplay:pause",ia="lazyload:loaded",tl="sk",nl="sh",Do="ei";function Tt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=zs();function i(l,s){n.bind(t,ro(l).join(" "),function(d){s.apply(s,qr(d.detail)?d.detail:[])})}function o(l){n.dispatch(t,l,jn(arguments,1))}return e&&e.event.on(Qr,n.destroy),Ki(n,{bus:t,on:i,off:bt(n.unbind,t),emit:o})}function Yo(e,t,n,i){var o=Date.now,l,s=0,d,c=!0,u=0;function m(){if(!c){if(s=e?Hn((o()-l)/e,1):1,n&&n(s),s>=1&&(t(),l=o(),i&&++u>=i))return L();d=Ca(m)}}function y(I){I||h(),l=o()-(I?s*e:0),c=!1,d=Ca(m)}function L(){c=!0}function T(){l=o(),s=0,n&&n(s)}function h(){d&&cancelAnimationFrame(d),s=0,d=0,c=!0}function v(I){e=I}function w(){return c}return{start:y,rewind:T,pause:L,cancel:h,set:v,isPaused:w}}function Oc(e){var t=e;function n(o){t=o}function i(o){return Kr(ro(o),t)}return{set:n,is:i}}function jc(e,t){var n=Yo(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Bc(e,t,n){var i=e.state,o=n.breakpoints||{},l=n.reducedMotion||{},s=zs(),d=[];function c(){var h=n.mediaQuery==="min";Gi(o).sort(function(v,w){return h?+v-+w:+w-+v}).forEach(function(v){m(o[v],"("+(h?"min":"max")+"-width:"+v+"px)")}),m(l,$a),y()}function u(h){h&&s.destroy()}function m(h,v){var w=matchMedia(v);s.bind(w,"change",y),d.push([h,w])}function y(){var h=i.is(jo),v=n.direction,w=d.reduce(function(I,R){return An(I,R[1].matches?R[0]:{})},{});Ta(n),T(w),n.destroy?e.destroy(n.destroy==="completely"):h?(u(!0),e.mount()):v!==n.direction&&e.refresh()}function L(h){matchMedia($a).matches&&(h?An(n,l):Ta(n,Gi(l)))}function T(h,v,w){An(n,h),v&&An(Object.getPrototypeOf(n),h),(w||!i.is(hi))&&e.emit(zt,n)}return{setup:c,destroy:u,reduce:L,set:T}}var Jo="Arrow",Zo=Jo+"Left",Qo=Jo+"Right",il=Jo+"Up",ol=Jo+"Down",Ea="rtl",er="ttb",gr={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[il,Qo],ArrowRight:[ol,Zo]};function zc(e,t,n){function i(l,s,d){d=d||n.direction;var c=d===Ea&&!s?1:d===er?0:-1;return gr[l]&&gr[l][c]||l.replace(/width|left|right/i,function(u,m){var y=gr[u.toLowerCase()][c]||u;return m>0?y.charAt(0).toUpperCase()+y.slice(1):y})}function o(l){return l*(n.direction===Ea?1:-1)}return{resolve:i,orient:o}}var Sn="role",yi="tabindex",Dc="disabled",sn="aria-",co=sn+"controls",rl=sn+"current",Ra=sn+"selected",Yt=sn+"label",oa=sn+"labelledby",al=sn+"hidden",ra=sn+"orientation",Yi=sn+"roledescription",Ma=sn+"live",Pa=sn+"busy",ka=sn+"atomic",aa=[Sn,yi,Dc,co,rl,Yt,oa,al,ra,Yi],mn=lo+"__",zn="is-",hr=lo,Aa=mn+"track",Vc=mn+"list",tr=mn+"slide",sl=tr+"--clone",qc=tr+"__container",sa=mn+"arrows",nr=mn+"arrow",ll=nr+"--prev",cl=nr+"--next",ir=mn+"pagination",dl=ir+"__page",Gc=mn+"progress",Kc=Gc+"__bar",Uc=mn+"toggle",Xc=mn+"spinner",Yc=mn+"sr",Jc=zn+"initialized",ii=zn+"active",ul=zn+"prev",pl=zn+"next",Fr=zn+"visible",Nr=zn+"loading",ml=zn+"focus-in",gl=zn+"overflow",Zc=[ii,Fr,ul,pl,Nr,ml,gl],Qc={slide:tr,clone:sl,arrows:sa,arrow:nr,prev:ll,next:cl,pagination:ir,page:dl,spinner:Xc};function ed(e,t){if(_s(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!qi(n,t);)n=n.parentElement;return n}var td=5,Wa=200,hl="touchstart mousedown",fr="touchmove mousemove",yr="touchend touchcancel mouseup click";function nd(e,t,n){var i=Tt(e),o=i.on,l=i.bind,s=e.root,d=n.i18n,c={},u=[],m=[],y=[],L,T,h;function v(){A(),H(),R()}function w(){o(Pt,I),o(Pt,v),o(zt,R),l(document,hl+" keydown",function(M){h=M.type==="keydown"},{capture:!0}),l(s,"focusin",function(){bn(s,ml,!!h)})}function I(M){var C=aa.concat("style");Tn(u),wn(s,m),wn(L,y),pn([L,T],C),pn(s,M?C:["style",Yi])}function R(){wn(s,m),wn(L,y),m=O(hr),y=O(Aa),un(s,m),un(L,y),Qe(s,Yt,n.label),Qe(s,oa,n.labelledby)}function A(){L=b("."+Aa),T=so(L,"."+Vc),Oi(L&&T,"A track/list element is missing."),Ao(u,Ns(T,"."+tr+":not(."+sl+")")),ti({arrows:sa,pagination:ir,prev:ll,next:cl,bar:Kc,toggle:Uc},function(M,C){c[C]=b("."+M)}),Ki(c,{root:s,track:L,list:T,slides:u})}function H(){var M=s.id||Nc(lo),C=n.role;s.id=M,L.id=L.id||M+"-track",T.id=T.id||M+"-list",!an(s,Sn)&&s.tagName!=="SECTION"&&C&&Qe(s,Sn,C),Qe(s,Yi,d.carousel),Qe(T,Sn,"presentation")}function b(M){var C=js(s,M);return C&&ed(C,"."+hr)===s?C:void 0}function O(M){return[M+"--"+n.type,M+"--"+n.direction,n.drag&&M+"--draggable",n.isNavigation&&M+"--nav",M===hr&&ii]}return Ki(c,{setup:v,mount:w,destroy:I})}var wi="slide",Ai="loop",uo="fade";function id(e,t,n,i){var o=Tt(e),l=o.on,s=o.emit,d=o.bind,c=e.Components,u=e.root,m=e.options,y=m.isNavigation,L=m.updateOnMove,T=m.i18n,h=m.pagination,v=m.slideFocus,w=c.Direction.resolve,I=an(i,"style"),R=an(i,Yt),A=n>-1,H=so(i,"."+qc),b;function O(){A||(i.id=u.id+"-slide"+Jr(t+1),Qe(i,Sn,h?"tabpanel":"group"),Qe(i,Yi,T.slide),Qe(i,Yt,R||Wr(T.slideLabel,[t+1,e.length]))),M()}function M(){d(i,"click",bt(s,Zr,z)),d(i,"keydown",bt(s,tl,z)),l([ki,nl,ri],W),l(ea,q),L&&l(Ln,f)}function C(){b=!0,o.destroy(),wn(i,Zc),pn(i,aa),Qe(i,"style",I),Qe(i,Yt,R||"")}function q(){var P=e.splides.map(function(S){var K=S.splide.Components.Slides.getAt(t);return K?K.slide.id:""}).join(" ");Qe(i,Yt,Wr(T.slideX,(A?n:t)+1)),Qe(i,co,P),Qe(i,Sn,v?"button":""),v&&pn(i,Yi)}function f(){b||W()}function W(){if(!b){var P=e.index;_(),B(),bn(i,ul,t===P-1),bn(i,pl,t===P+1)}}function _(){var P=ne();P!==La(i,ii)&&(bn(i,ii,P),Qe(i,rl,y&&P||""),s(P?Ds:Vs,z))}function B(){var P=G(),S=!P&&(!ne()||A);if(e.state.is([Pi,io])||Qe(i,al,S||""),Qe(Xr(i,m.focusableNodes||""),yi,S?-1:""),v&&Qe(i,yi,S?-1:0),P!==La(i,Fr)&&(bn(i,Fr,P),s(P?qs:Gs,z)),!P&&document.activeElement===i){var K=c.Slides.getAt(e.index);K&&Hs(K.slide)}}function ee(P,S,K){rn(K&&H||i,P,S)}function ne(){var P=e.index;return P===t||m.cloneStatus&&P===n}function G(){if(e.is(uo))return ne();var P=Ut(c.Elements.track),S=Ut(i),K=w("left",!0),Z=w("right",!0);return zo(P[K])<=Xi(S[K])&&zo(S[Z])<=Xi(P[Z])}function D(P,S){var K=qt(P-t);return!A&&(m.rewind||e.is(Ai))&&(K=Hn(K,e.length-K)),K<=S}var z={index:t,slideIndex:n,slide:i,container:H,isClone:A,mount:O,destroy:C,update:W,style:ee,isWithin:D};return z}function od(e,t,n){var i=Tt(e),o=i.on,l=i.emit,s=i.bind,d=t.Elements,c=d.slides,u=d.list,m=[];function y(){L(),o(Pt,T),o(Pt,L)}function L(){c.forEach(function(W,_){v(W,_,-1)})}function T(){b(function(W){W.destroy()}),Tn(m)}function h(){b(function(W){W.update()})}function v(W,_,B){var ee=id(e,_,B,W);ee.mount(),m.push(ee),m.sort(function(ne,G){return ne.index-G.index})}function w(W){return W?O(function(_){return!_.isClone}):m}function I(W){var _=t.Controller,B=_.toIndex(W),ee=_.hasFocus()?1:n.perPage;return O(function(ne){return Wo(ne.index,B,B+ee-1)})}function R(W){return O(W)[0]}function A(W,_){en(W,function(B){if(Nn(B)&&(B=Os(B)),Fs(B)){var ee=c[_];ee?Ur(B,ee):ao(u,B),un(B,n.classes.slide),C(B,bt(l,bi))}}),l(Pt)}function H(W){ni(O(W).map(function(_){return _.slide})),l(Pt)}function b(W,_){w(_).forEach(W)}function O(W){return m.filter(_s(W)?W:function(_){return Nn(W)?qi(_.slide,W):Kr(ro(W),_.index)})}function M(W,_,B){b(function(ee){ee.style(W,_,B)})}function C(W,_){var B=Xr(W,"img"),ee=B.length;ee?B.forEach(function(ne){s(ne,"load error",function(){--ee||_()})}):_()}function q(W){return W?c.length:m.length}function f(){return m.length>n.perPage}return{mount:y,destroy:T,update:h,register:v,get:w,getIn:I,getAt:R,add:A,remove:H,forEach:b,filter:O,style:M,getLength:q,isEnough:f}}function rd(e,t,n){var i=Tt(e),o=i.on,l=i.bind,s=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,m=u.root,y=u.track,L=u.list,T=d.getAt,h=d.style,v,w,I;function R(){A(),l(window,"resize load",jc(bt(s,bi))),o([zt,Pt],A),o(bi,H)}function A(){v=n.direction===er,rn(m,"maxWidth",Gn(n.width)),rn(y,c("paddingLeft"),b(!1)),rn(y,c("paddingRight"),b(!0)),H(!0)}function H(z){var P=Ut(m);(z||w.width!==P.width||w.height!==P.height)&&(rn(y,"height",O()),h(c("marginRight"),Gn(n.gap)),h("width",C()),h("height",q(),!0),w=P,s(Uo),I!==(I=D())&&(bn(m,gl,I),s(Hc,I)))}function b(z){var P=n.padding,S=c(z?"right":"left");return P&&Gn(P[S]||(Vi(P)?0:P))||"0px"}function O(){var z="";return v&&(z=M(),Oi(z,"height or heightRatio is missing."),z="calc("+z+" - "+b(!1)+" - "+b(!0)+")"),z}function M(){return Gn(n.height||Ut(L).width*n.heightRatio)}function C(){return n.autoWidth?null:Gn(n.fixedWidth)||(v?"":f())}function q(){return Gn(n.fixedHeight)||(v?n.autoHeight?null:f():M())}function f(){var z=Gn(n.gap);return"calc((100%"+(z&&" + "+z)+")/"+(n.perPage||1)+(z&&" - "+z)+")"}function W(){return Ut(L)[c("width")]}function _(z,P){var S=T(z||0);return S?Ut(S.slide)[c("width")]+(P?0:ne()):0}function B(z,P){var S=T(z);if(S){var K=Ut(S.slide)[c("right")],Z=Ut(L)[c("left")];return qt(K-Z)+(P?0:ne())}return 0}function ee(z){return B(e.length-1)-B(0)+_(0,z)}function ne(){var z=T(0);return z&&parseFloat(rn(z.slide,c("marginRight")))||0}function G(z){return parseFloat(rn(y,c("padding"+(z?"Right":"Left"))))||0}function D(){return e.is(uo)||ee(!0)>W()}return{mount:R,resize:H,listSize:W,slideSize:_,sliderSize:ee,totalSize:B,getPadding:G,isOverflow:D}}var ad=2;function sd(e,t,n){var i=Tt(e),o=i.on,l=t.Elements,s=t.Slides,d=t.Direction.resolve,c=[],u;function m(){o(Pt,y),o([zt,bi],T),(u=w())&&(h(u),t.Layout.resize(!0))}function y(){L(),m()}function L(){ni(c),Tn(c),i.destroy()}function T(){var I=w();u!==I&&(u<I||!I)&&i.emit(Pt)}function h(I){var R=s.get().slice(),A=R.length;if(A){for(;R.length<I;)Ao(R,R);Ao(R.slice(-I),R.slice(0,I)).forEach(function(H,b){var O=b<I,M=v(H.slide,b);O?Ur(M,R[0].slide):ao(l.list,M),Ao(c,M),s.register(M,b-I+(O?0:A),H.index)})}}function v(I,R){var A=I.cloneNode(!0);return un(A,n.classes.clone),A.id=e.root.id+"-clone"+Jr(R+1),A}function w(){var I=n.clones;if(!e.is(Ai))I=0;else if(oo(I)){var R=n[d("fixedWidth")]&&t.Layout.slideSize(0),A=R&&Xi(Ut(l.track)[d("width")]/R);I=A||n[d("autoWidth")]&&e.length||n.perPage*ad}return I}return{mount:m,destroy:L}}function ld(e,t,n){var i=Tt(e),o=i.on,l=i.emit,s=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,m=d.totalSize,y=d.listSize,L=d.sliderSize,T=t.Direction,h=T.resolve,v=T.orient,w=t.Elements,I=w.list,R=w.track,A;function H(){A=t.Transition,o([Bn,Uo,zt,Pt],b)}function b(){t.Controller.isBusy()||(t.Scroll.cancel(),M(e.index),t.Slides.update())}function O(S,K,Z,U){S!==K&&z(S>Z)&&(W(),C(f(ee(),S>Z),!0)),s(Pi),l(Ln,K,Z,S),A.start(K,function(){s(xi),l(ki,K,Z,S),U&&U()})}function M(S){C(B(S,!0))}function C(S,K){if(!e.is(uo)){var Z=K?S:q(S);rn(I,"transform","translate"+h("X")+"("+Z+"px)"),S!==Z&&l(nl)}}function q(S){if(e.is(Ai)){var K=_(S),Z=K>t.Controller.getEnd(),U=K<0;(U||Z)&&(S=f(S,Z))}return S}function f(S,K){var Z=S-D(K),U=L();return S-=v(U*(Xi(qt(Z)/U)||1))*(K?1:-1),S}function W(){C(ee(),!0),A.cancel()}function _(S){for(var K=t.Slides.get(),Z=0,U=1/0,N=0;N<K.length;N++){var pe=K[N].index,g=qt(B(pe,!0)-S);if(g<=U)U=g,Z=pe;else break}return Z}function B(S,K){var Z=v(m(S-1)-G(S));return K?ne(Z):Z}function ee(){var S=h("left");return Ut(I)[S]-Ut(R)[S]+v(u(!1))}function ne(S){return n.trimSpace&&e.is(wi)&&(S=pi(S,0,v(L(!0)-y()))),S}function G(S){var K=n.focus;return K==="center"?(y()-c(S,!0))/2:+K*c(S)||0}function D(S){return B(S?t.Controller.getEnd():0,!!n.trimSpace)}function z(S){var K=v(f(ee(),S));return S?K>=0:K<=I[h("scrollWidth")]-Ut(R)[h("width")]}function P(S,K){K=oo(K)?ee():K;var Z=S!==!0&&v(K)<v(D(!1)),U=S!==!1&&v(K)>v(D(!0));return Z||U}return{mount:H,move:O,jump:M,translate:C,shift:f,cancel:W,toIndex:_,toPosition:B,getPosition:ee,getLimit:D,exceededLimit:P,reposition:b}}function cd(e,t,n){var i=Tt(e),o=i.on,l=i.emit,s=t.Move,d=s.getPosition,c=s.getLimit,u=s.toPosition,m=t.Slides,y=m.isEnough,L=m.getLength,T=n.omitEnd,h=e.is(Ai),v=e.is(wi),w=bt(ee,!1),I=bt(ee,!0),R=n.start||0,A,H=R,b,O,M;function C(){q(),o([zt,Pt,Do],q),o(Uo,f)}function q(){b=L(!0),O=n.perMove,M=n.perPage,A=z();var g=pi(R,0,T?A:b-1);g!==R&&(R=g,s.reposition())}function f(){A!==z()&&l(Do)}function W(g,ue,ve){if(!pe()){var ge=B(g),Ee=D(ge);Ee>-1&&(ue||Ee!==R)&&(Z(Ee),s.move(ge,Ee,H,ve))}}function _(g,ue,ve,ge){t.Scroll.scroll(g,ue,ve,function(){var Ee=D(s.toIndex(d()));Z(T?Hn(Ee,A):Ee),ge&&ge()})}function B(g){var ue=R;if(Nn(g)){var ve=g.match(/([+\-<>])(\d+)?/)||[],ge=ve[1],Ee=ve[2];ge==="+"||ge==="-"?ue=ne(R+ +(""+ge+(+Ee||1)),R):ge===">"?ue=Ee?P(+Ee):w(!0):ge==="<"&&(ue=I(!0))}else ue=h?g:pi(g,0,A);return ue}function ee(g,ue){var ve=O||(N()?1:M),ge=ne(R+ve*(g?-1:1),R,!(O||N()));return ge===-1&&v&&!Bs(d(),c(!g),1)?g?0:A:ue?ge:D(ge)}function ne(g,ue,ve){if(y()||N()){var ge=G(g);ge!==g&&(ue=g,g=ge,ve=!1),g<0||g>A?!O&&(Wo(0,g,ue,!0)||Wo(A,ue,g,!0))?g=P(S(g)):h?g=ve?g<0?-(b%M||M):b:g:n.rewind?g=g<0?A:0:g=-1:ve&&g!==ue&&(g=P(S(ue)+(g<ue?-1:1)))}else g=-1;return g}function G(g){if(v&&n.trimSpace==="move"&&g!==R)for(var ue=d();ue===u(g,!0)&&Wo(g,0,e.length-1,!n.rewind);)g<R?--g:++g;return g}function D(g){return h?(g+b)%b||0:g}function z(){for(var g=b-(N()||h&&O?1:M);T&&g-- >0;)if(u(b-1,!0)!==u(g,!0)){g++;break}return pi(g,0,b-1)}function P(g){return pi(N()?g:M*g,0,A)}function S(g){return N()?Hn(g,A):zo((g>=A?b-1:g)/M)}function K(g){var ue=s.toIndex(g);return v?pi(ue,0,A):ue}function Z(g){g!==R&&(H=R,R=g)}function U(g){return g?H:R}function N(){return!oo(n.focus)||n.isNavigation}function pe(){return e.state.is([Pi,io])&&!!n.waitForTransition}return{mount:C,go:W,scroll:_,getNext:w,getPrev:I,getAdjacent:ee,getEnd:z,setIndex:Z,getIndex:U,toIndex:P,toPage:S,toDest:K,hasFocus:N,isBusy:pe}}var dd="http://www.w3.org/2000/svg",ud="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",vo=40;function pd(e,t,n){var i=Tt(e),o=i.on,l=i.bind,s=i.emit,d=n.classes,c=n.i18n,u=t.Elements,m=t.Controller,y=u.arrows,L=u.track,T=y,h=u.prev,v=u.next,w,I,R={};function A(){b(),o(zt,H)}function H(){O(),A()}function b(){var _=n.arrows;_&&!(h&&v)&&q(),h&&v&&(Ki(R,{prev:h,next:v}),Ui(T,_?"":"none"),un(T,I=sa+"--"+n.direction),_&&(M(),W(),Qe([h,v],co,L.id),s(Ys,h,v)))}function O(){i.destroy(),wn(T,I),w?(ni(y?[h,v]:T),h=v=null):pn([h,v],aa)}function M(){o([Bn,ki,Pt,ri,Do],W),l(v,"click",bt(C,">")),l(h,"click",bt(C,"<"))}function C(_){m.go(_,!0)}function q(){T=y||fi("div",d.arrows),h=f(!0),v=f(!1),w=!0,ao(T,[h,v]),!y&&Ur(T,L)}function f(_){var B='<button class="'+d.arrow+" "+(_?d.prev:d.next)+'" type="button"><svg xmlns="'+dd+'" viewBox="0 0 '+vo+" "+vo+'" width="'+vo+'" height="'+vo+'" focusable="false"><path d="'+(n.arrowPath||ud)+'" />';return Os(B)}function W(){if(h&&v){var _=e.index,B=m.getPrev(),ee=m.getNext(),ne=B>-1&&_<B?c.last:c.prev,G=ee>-1&&_>ee?c.first:c.next;h.disabled=B<0,v.disabled=ee<0,Qe(h,Yt,ne),Qe(v,Yt,G),s(Js,h,v,B,ee)}}return{arrows:R,mount:A,destroy:O,update:W}}var md=Yr+"-interval";function gd(e,t,n){var i=Tt(e),o=i.on,l=i.bind,s=i.emit,d=Yo(n.interval,e.go.bind(e,">"),M),c=d.isPaused,u=t.Elements,m=t.Elements,y=m.root,L=m.toggle,T=n.autoplay,h,v,w=T==="pause";function I(){T&&(R(),L&&Qe(L,co,u.track.id),w||A(),O())}function R(){n.pauseOnHover&&l(y,"mouseenter mouseleave",function(q){h=q.type==="mouseenter",b()}),n.pauseOnFocus&&l(y,"focusin focusout",function(q){v=q.type==="focusin",b()}),L&&l(L,"click",function(){w?A():H(!0)}),o([Ln,Xo,Pt],d.rewind),o(Ln,C)}function A(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),v=h=w=!1,O(),s(ta))}function H(q){q===void 0&&(q=!0),w=!!q,O(),c()||(d.pause(),s(na))}function b(){w||(h||v?H(!1):A())}function O(){L&&(bn(L,ii,!w),Qe(L,Yt,n.i18n[w?"play":"pause"]))}function M(q){var f=u.bar;f&&rn(f,"width",q*100+"%"),s(el,q)}function C(q){var f=t.Slides.getAt(q);d.set(f&&+an(f.slide,md)||n.interval)}return{mount:I,destroy:d.cancel,play:A,pause:H,isPaused:c}}function hd(e,t,n){var i=Tt(e),o=i.on;function l(){n.cover&&(o(ia,bt(d,!0)),o([Bn,zt,Pt],bt(s,!0)))}function s(c){t.Slides.forEach(function(u){var m=so(u.container||u.slide,"img");m&&m.src&&d(c,m,u)})}function d(c,u,m){m.style("background",c?'center/cover no-repeat url("'+u.src+'")':"",!0),Ui(u,c?"none":"")}return{mount:l,destroy:bt(s,!1)}}var fd=10,yd=600,vd=.6,xd=1.5,bd=800;function wd(e,t,n){var i=Tt(e),o=i.on,l=i.emit,s=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,m=d.exceededLimit,y=d.translate,L=e.is(wi),T,h,v=1;function w(){o(Ln,H),o([zt,Pt],b)}function I(M,C,q,f,W){var _=c();if(H(),q&&(!L||!m())){var B=t.Layout.sliderSize(),ee=Ar(M)*B*zo(qt(M)/B)||0;M=d.toPosition(t.Controller.toDest(M%B))+ee}var ne=Bs(_,M,1);v=1,C=ne?0:C||Bo(qt(M-_)/xd,bd),h=f,T=Yo(C,R,bt(A,_,M,W),1),s(io),l(Xo),T.start()}function R(){s(xi),h&&h(),l(ri)}function A(M,C,q,f){var W=c(),_=M+(C-M)*O(f),B=(_-W)*v;y(W+B),L&&!q&&m()&&(v*=vd,qt(B)<fd&&I(u(m(!0)),yd,!1,h,!0))}function H(){T&&T.cancel()}function b(){T&&!T.isPaused()&&(H(),R())}function O(M){var C=n.easingFunc;return C?C(M):1-Math.pow(1-M,4)}return{mount:w,destroy:H,scroll:I,cancel:b}}var mi={passive:!1,capture:!0};function Sd(e,t,n){var i=Tt(e),o=i.on,l=i.emit,s=i.bind,d=i.unbind,c=e.state,u=t.Move,m=t.Scroll,y=t.Controller,L=t.Elements.track,T=t.Media.reduce,h=t.Direction,v=h.resolve,w=h.orient,I=u.getPosition,R=u.exceededLimit,A,H,b,O,M,C=!1,q,f,W;function _(){s(L,fr,Pr,mi),s(L,yr,Pr,mi),s(L,hl,ee,mi),s(L,"click",D,{capture:!0}),s(L,"dragstart",xn),o([Bn,zt],B)}function B(){var J=n.drag;me(!J),O=J==="free"}function ee(J){if(q=!1,!f){var be=Ee(J);ge(J.target)&&(be||!J.button)&&(y.isBusy()?xn(J,!0):(W=be?L:window,M=c.is([Pi,io]),b=null,s(W,fr,ne,mi),s(W,yr,G,mi),u.cancel(),m.cancel(),z(J)))}}function ne(J){if(c.is(ko)||(c.set(ko),l(Ks)),J.cancelable)if(M){u.translate(A+ve(N(J)));var be=pe(J)>Wa,le=C!==(C=R());(be||le)&&z(J),q=!0,l(Us),xn(J)}else K(J)&&(M=S(J),xn(J))}function G(J){c.is(ko)&&(c.set(xi),l(Xs)),M&&(P(J),xn(J)),d(W,fr,ne),d(W,yr,G),M=!1}function D(J){!f&&q&&xn(J,!0)}function z(J){b=H,H=J,A=I()}function P(J){var be=Z(J),le=U(be),ce=n.rewind&&n.rewindByDrag;T(!1),O?y.scroll(le,0,n.snap):e.is(uo)?y.go(w(Ar(be))<0?ce?"<":"-":ce?">":"+"):e.is(wi)&&C&&ce?y.go(R(!0)?">":"<"):y.go(y.toDest(le),!0),T(!0)}function S(J){var be=n.dragMinThreshold,le=Vi(be),ce=le&&be.mouse||0,re=(le?be.touch:+be)||10;return qt(N(J))>(Ee(J)?re:ce)}function K(J){return qt(N(J))>qt(N(J,!0))}function Z(J){if(e.is(Ai)||!C){var be=pe(J);if(be&&be<Wa)return N(J)/be}return 0}function U(J){return I()+Ar(J)*Hn(qt(J)*(n.flickPower||600),O?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function N(J,be){return ue(J,be)-ue(g(J),be)}function pe(J){return kr(J)-kr(g(J))}function g(J){return H===J&&b||H}function ue(J,be){return(Ee(J)?J.changedTouches[0]:J)["page"+v(be?"Y":"X")]}function ve(J){return J/(C&&e.is(wi)?td:1)}function ge(J){var be=n.noDrag;return!qi(J,"."+dl+", ."+nr)&&(!be||!qi(J,be))}function Ee(J){return typeof TouchEvent<"u"&&J instanceof TouchEvent}function te(){return M}function me(J){f=J}return{mount:_,disable:me,isDragging:te}}var $d={Spacebar:" ",Right:Qo,Left:Zo,Up:il,Down:ol};function la(e){return e=Nn(e)?e:e.key,$d[e]||e}var _a="keydown";function Cd(e,t,n){var i=Tt(e),o=i.on,l=i.bind,s=i.unbind,d=e.root,c=t.Direction.resolve,u,m;function y(){L(),o(zt,T),o(zt,L),o(Ln,v)}function L(){var I=n.keyboard;I&&(u=I==="global"?window:d,l(u,_a,w))}function T(){s(u,_a)}function h(I){m=I}function v(){var I=m;m=!0,Ws(function(){m=I})}function w(I){if(!m){var R=la(I);R===c(Zo)?e.go("<"):R===c(Qo)&&e.go(">")}}return{mount:y,destroy:T,disable:h}}var ji=Yr+"-lazy",_o=ji+"-srcset",Td="["+ji+"], ["+_o+"]";function Ld(e,t,n){var i=Tt(e),o=i.on,l=i.off,s=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[ki,ri],m=[];function y(){n.lazyLoad&&(L(),o(Pt,L))}function L(){Tn(m),T(),c?I():(l(u),o(u,h),h())}function T(){t.Slides.forEach(function(R){Xr(R.slide,Td).forEach(function(A){var H=an(A,ji),b=an(A,_o);if(H!==A.src||b!==A.srcset){var O=n.classes.spinner,M=A.parentElement,C=so(M,"."+O)||fi("span",O,M);m.push([A,R,C]),A.src||Ui(A,"none")}})})}function h(){m=m.filter(function(R){var A=n.perPage*((n.preloadPages||1)+1)-1;return R[1].isWithin(e.index,A)?v(R):!0}),m.length||l(u)}function v(R){var A=R[0];un(R[1].slide,Nr),s(A,"load error",bt(w,R)),Qe(A,"src",an(A,ji)),Qe(A,"srcset",an(A,_o)),pn(A,ji),pn(A,_o)}function w(R,A){var H=R[0],b=R[1];wn(b.slide,Nr),A.type!=="error"&&(ni(R[2]),Ui(H,""),d(ia,H,b),d(bi)),c&&I()}function I(){m.length&&v(m.shift())}return{mount:y,destroy:bt(Tn,m),check:h}}function Id(e,t,n){var i=Tt(e),o=i.on,l=i.emit,s=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,m=u.hasFocus,y=u.getIndex,L=u.go,T=t.Direction.resolve,h=c.pagination,v=[],w,I;function R(){A(),o([zt,Pt,Do],R);var f=n.pagination;h&&Ui(h,f?"":"none"),f&&(o([Ln,Xo,ri],q),H(),q(),l(Zs,{list:w,items:v},C(e.index)))}function A(){w&&(ni(h?jn(w.children):w),wn(w,I),Tn(v),w=null),i.destroy()}function H(){var f=e.length,W=n.classes,_=n.i18n,B=n.perPage,ee=m()?u.getEnd()+1:Xi(f/B);w=h||fi("ul",W.pagination,c.track.parentElement),un(w,I=ir+"--"+M()),Qe(w,Sn,"tablist"),Qe(w,Yt,_.select),Qe(w,ra,M()===er?"vertical":"");for(var ne=0;ne<ee;ne++){var G=fi("li",null,w),D=fi("button",{class:W.page,type:"button"},G),z=d.getIn(ne).map(function(S){return S.slide.id}),P=!m()&&B>1?_.pageX:_.slideX;s(D,"click",bt(b,ne)),n.paginationKeyboard&&s(D,"keydown",bt(O,ne)),Qe(G,Sn,"presentation"),Qe(D,Sn,"tab"),Qe(D,co,z.join(" ")),Qe(D,Yt,Wr(P,ne+1)),Qe(D,yi,-1),v.push({li:G,button:D,page:ne})}}function b(f){L(">"+f,!0)}function O(f,W){var _=v.length,B=la(W),ee=M(),ne=-1;B===T(Qo,!1,ee)?ne=++f%_:B===T(Zo,!1,ee)?ne=(--f+_)%_:B==="Home"?ne=0:B==="End"&&(ne=_-1);var G=v[ne];G&&(Hs(G.button),L(">"+ne),xn(W,!0))}function M(){return n.paginationDirection||n.direction}function C(f){return v[u.toPage(f)]}function q(){var f=C(y(!0)),W=C(y());if(f){var _=f.button;wn(_,ii),pn(_,Ra),Qe(_,yi,-1)}if(W){var B=W.button;un(B,ii),Qe(B,Ra,!0),Qe(B,yi,"")}l(Qs,{list:w,items:v},f,W)}return{items:v,mount:R,destroy:A,getAt:C,update:q}}var Ed=[" ","Enter"];function Rd(e,t,n){var i=n.isNavigation,o=n.slideFocus,l=[];function s(){e.splides.forEach(function(h){h.isParent||(u(e,h.splide),u(h.splide,e))}),i&&m()}function d(){l.forEach(function(h){h.destroy()}),Tn(l)}function c(){d(),s()}function u(h,v){var w=Tt(h);w.on(Ln,function(I,R,A){v.go(v.is(Ai)?A:I)}),l.push(w)}function m(){var h=Tt(e),v=h.on;v(Zr,L),v(tl,T),v([Bn,zt],y),l.push(h),h.emit(ea,e.splides)}function y(){Qe(t.Elements.list,ra,n.direction===er?"vertical":"")}function L(h){e.go(h.index)}function T(h,v){Kr(Ed,la(v))&&(L(h),xn(v))}return{setup:bt(t.Media.set,{slideFocus:oo(o)?i:o},!0),mount:s,destroy:d,remount:c}}function Md(e,t,n){var i=Tt(e),o=i.bind,l=0;function s(){n.wheel&&o(t.Elements.track,"wheel",d,mi)}function d(u){if(u.cancelable){var m=u.deltaY,y=m<0,L=kr(u),T=n.wheelMinThreshold||0,h=n.wheelSleep||0;qt(m)>T&&L-l>h&&(e.go(y?"<":">"),l=L),c(y)&&xn(u)}}function c(u){return!n.releaseWheel||e.state.is(Pi)||t.Controller.getAdjacent(u)!==-1}return{mount:s}}var Pd=90;function kd(e,t,n){var i=Tt(e),o=i.on,l=t.Elements.track,s=n.live&&!n.isNavigation,d=fi("span",Yc),c=Yo(Pd,bt(m,!1));function u(){s&&(L(!t.Autoplay.isPaused()),Qe(l,ka,!0),d.textContent="…",o(ta,bt(L,!0)),o(na,bt(L,!1)),o([ki,ri],bt(m,!0)))}function m(T){Qe(l,Pa,T),T?(ao(l,d),c.start()):(ni(d),c.cancel())}function y(){pn(l,[Ma,ka,Pa]),ni(d)}function L(T){s&&Qe(l,Ma,T?"off":"polite")}return{mount:u,disable:L,destroy:y}}var Ad=Object.freeze({__proto__:null,Media:Bc,Direction:zc,Elements:nd,Slides:od,Layout:rd,Clones:sd,Move:ld,Controller:cd,Arrows:pd,Autoplay:gd,Cover:hd,Scroll:wd,Drag:Sd,Keyboard:Cd,LazyLoad:Ld,Pagination:Id,Sync:Rd,Wheel:Md,Live:kd}),Wd={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"},_d={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:Qc,i18n:Wd,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Fd(e,t,n){var i=t.Slides;function o(){Tt(e).on([Bn,Pt],l)}function l(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function s(d,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),Ws(c)}return{mount:o,start:s,cancel:Pr}}function Nd(e,t,n){var i=t.Move,o=t.Controller,l=t.Scroll,s=t.Elements.list,d=bt(rn,s,"transition"),c;function u(){Tt(e).bind(s,"transitionend",function(T){T.target===s&&c&&(y(),c())})}function m(T,h){var v=i.toPosition(T,!0),w=i.getPosition(),I=L(T);qt(v-w)>=1&&I>=1?n.useScroll?l.scroll(v,I,!1,h):(d("transform "+I+"ms "+n.easing),i.translate(v,!0),c=h):(i.jump(T),h())}function y(){d(""),l.cancel()}function L(T){var h=n.rewindSpeed;if(e.is(wi)&&h){var v=o.getIndex(!0),w=o.getEnd();if(v===0&&T>=w||v>=w&&T===0)return h}return n.speed}return{mount:u,start:m,cancel:y}}var Hd=(function(){function e(n,i){this.event=Tt(),this.Components={},this.state=Oc(hi),this.splides=[],this._o={},this._E={};var o=Nn(n)?js(document,n):n;Oi(o,o+" is invalid."),this.root=o,i=An({label:an(o,Yt)||"",labelledby:an(o,oa)||""},_d,e.defaults,i||{});try{An(i,JSON.parse(an(o,Yr)))}catch{Oi(!1,"Invalid JSON")}this._o=Object.create(An({},i))}var t=e.prototype;return t.mount=function(i,o){var l=this,s=this.state,d=this.Components;Oi(s.is([hi,jo]),"Already mounted!"),s.set(hi),this._C=d,this._T=o||this._T||(this.is(uo)?Fd:Nd),this._E=i||this._E;var c=Ki({},Ad,this._E,{Transition:this._T});return ti(c,function(u,m){var y=u(l,d,l._o);d[m]=y,y.setup&&y.setup()}),ti(d,function(u){u.mount&&u.mount()}),this.emit(Bn),un(this.root,Jc),s.set(xi),this.emit(_r),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(xi)&&(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(jn(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(Pt),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,l=this.state;return l.is(hi)?Tt(this).on(_r,this.destroy.bind(this,i)):(ti(this._C,function(s){s.destroy&&s.destroy(i)},!0),o.emit(Qr),o.destroy(),i&&Tn(this.splides),l.set(jo)),this},Wc(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})(),ca=Hd;ca.defaults={};ca.STATES=Fc;var Fa=[[Bn,"onMounted"],[_r,"onReady"],[Ln,"onMove"],[ki,"onMoved"],[Zr,"onClick"],[Ds,"onActive"],[Vs,"onInactive"],[qs,"onVisible"],[Gs,"onHidden"],[Pt,"onRefresh"],[zt,"onUpdated"],[bi,"onResize"],[Uo,"onResized"],[Ks,"onDrag"],[Us,"onDragging"],[Xs,"onDragged"],[Xo,"onScroll"],[ri,"onScrolled"],[Qr,"onDestroy"],[Ys,"onArrowsMounted"],[Js,"onArrowsUpdated"],[Zs,"onPaginationMounted"],[Qs,"onPaginationUpdated"],[ea,"onNavigationMounted"],[ta,"onAutoplayPlay"],[el,"onAutoplayPlaying"],[na,"onAutoplayPause"],[ia,"onLazyLoadLoaded"]];function da(...e){return e.filter(Boolean).join(" ")}function Vo(e){return e!==null&&typeof e=="object"}function Hr(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!Hr(n,t[i]));if(Vo(e)&&Vo(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Hr(e[o],t[o]))}return e===t}function Od(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function jd(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 Or(e,t){const n=e;return jd(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Vo(i)?n[o]=Or(Vo(n[o])?n[o]:{},i):n[o]=i}),n}var Bd=({children:e,className:t,...n})=>a.createElement("div",{className:da("splide__track",t),...n},a.createElement("ul",{className:"splide__list"},e)),ua=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 ca(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Or({},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&&!Hr(this.options,e)&&(this.splide.options=e,this.options=Or({},e));const t=this.getSlides();Od(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){Fa.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:da("splide",e),ref:this.splideRef,...this.omit(o,["options",...Fa.map(l=>l[1])])},n?a.createElement(Bd,null,i):i)}},pa=({children:e,className:t,...n})=>a.createElement("li",{className:da("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=require("react"),nt=require("classnames"),_=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Mi=require("react-dom");function Dl(e){return e.type==="object"&&e.version===1}const Vl="ControlSlider-module__wrapper___sHEkd",ql="ControlSlider-module__hoverArrow___A-dOH",Gl="ControlSlider-module__sliderItem___QQSkR",Kl="ControlSlider-module__sliderImage___9hRl-",Ul="ControlSlider-module__arrow___05ghY",Xl="ControlSlider-module__arrowVertical___tBfVN",Yl="ControlSlider-module__nextArrow___-30Yc",Jl="ControlSlider-module__arrowInner___aEra3",Zl="ControlSlider-module__arrowIcon___S4ztF",Ql="ControlSlider-module__arrowImg___2dwJW",ec="ControlSlider-module__mirror___brd6U",tc="ControlSlider-module__pagination___bicLF",nc="ControlSlider-module__paginationInner___bT-P-",ic="ControlSlider-module__paginationVertical___zYqKw",oc="ControlSlider-module__paginationItem___nTRbk",rc="ControlSlider-module__dot___p1Qun",ac="ControlSlider-module__activeDot___LHFaj",sc="ControlSlider-module__paginationInsideBottom___R3FWn",lc="ControlSlider-module__paginationInsideTop___V-qb-",cc="ControlSlider-module__paginationOutsideBottom___14w8D",dc="ControlSlider-module__paginationOutsideTop___SCLqB",uc="ControlSlider-module__paginationInsideLeft___yOBRZ",pc="ControlSlider-module__paginationInsideRight___Rtt3o",mc="ControlSlider-module__paginationOutsideLeft___lahaw",gc="ControlSlider-module__paginationOutsideRight___EtuQa",hc="ControlSlider-module__imgWrapper___UjEgB",fc="ControlSlider-module__captionBlock___dJ6-j",yc="ControlSlider-module__captionTextWrapper___HFlpf",vc="ControlSlider-module__captionText___uGBVc",xc="ControlSlider-module__active___WZK4G",bc="ControlSlider-module__withPointerEvents___t-18M",wc="ControlSlider-module__topLeftAlignment___zjnGM",Sc="ControlSlider-module__topCenterAlignment___gD1xW",$c="ControlSlider-module__topRightAlignment___NMapS",Cc="ControlSlider-module__middleLeftAlignment___OnUrY",Tc="ControlSlider-module__middleCenterAlignment___Tdkl0",Lc="ControlSlider-module__middleRightAlignment___wEbfX",Ic="ControlSlider-module__bottomLeftAlignment___cTP2-",Ec="ControlSlider-module__bottomCenterAlignment___c54fB",Rc="ControlSlider-module__bottomRightAlignment___kEwrz",Mc="ControlSlider-module__clickOverlay___DZA28",Pc="ControlSlider-module__contain___pLyq7",kc="ControlSlider-module__cover___KdDat",je={wrapper:Vl,hoverArrow:ql,sliderItem:Gl,sliderImage:Kl,arrow:Ul,arrowVertical:Xl,nextArrow:Yl,arrowInner:Jl,arrowIcon:Zl,arrowImg:Ql,mirror:ec,pagination:tc,paginationInner:nc,paginationVertical:ic,paginationItem:oc,dot:rc,activeDot:ac,paginationInsideBottom:sc,paginationInsideTop:lc,paginationOutsideBottom:cc,paginationOutsideTop:dc,paginationInsideLeft:uc,paginationInsideRight:pc,paginationOutsideLeft:mc,paginationOutsideRight:gc,imgWrapper:hc,captionBlock:fc,captionTextWrapper:yc,captionText:vc,active:xc,withPointerEvents:bc,topLeftAlignment:wc,topCenterAlignment:Sc,topRightAlignment:$c,middleLeftAlignment:Cc,middleCenterAlignment:Tc,middleRightAlignment:Lc,bottomLeftAlignment:Ic,bottomCenterAlignment:Ec,bottomRightAlignment:Rc,clickOverlay:Mc,contain:Pc,cover:kc};function Ac(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 Wc(e,t,n){return t&&Ac(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var $a="(prefers-reduced-motion: reduce)",hi=1,Fc=2,xi=3,Pi=4,io=5,ko=6,jo=7,_c={CREATED:hi,MOUNTED:Fc,IDLE:xi,MOVING:Pi,SCROLLING:io,DRAGGING:ko,DESTROYED:jo};function Tn(e){e.length=0}function jn(e,t,n){return Array.prototype.slice.call(e,t,n)}function bt(e){return e.bind.apply(e,[null].concat(jn(arguments,1)))}var Ws=setTimeout,Pr=function(){};function Ca(e){return requestAnimationFrame(e)}function Ko(e,t){return typeof t===e}function Vi(e){return!Gr(e)&&Ko("object",e)}var qr=Array.isArray,Fs=bt(Ko,"function"),Nn=bt(Ko,"string"),oo=bt(Ko,"undefined");function Gr(e){return e===null}function _s(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function ro(e){return qr(e)?e:[e]}function en(e,t){ro(e).forEach(t)}function Kr(e,t){return e.indexOf(t)>-1}function Ao(e,t){return e.push.apply(e,ro(t)),e}function bn(e,t,n){e&&en(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function un(e,t){bn(e,Nn(t)?t.split(" "):t,!0)}function ao(e,t){en(t,e.appendChild.bind(e))}function Ur(e,t){en(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function qi(e,t){return _s(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Ns(e,t){var n=e?jn(e.children):[];return t?n.filter(function(i){return qi(i,t)}):n}function so(e,t){return t?Ns(e,t)[0]:e.firstElementChild}var Gi=Object.keys;function ti(e,t,n){return e&&(n?Gi(e).reverse():Gi(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function Ki(e){return jn(arguments,1).forEach(function(t){ti(t,function(n,i){e[i]=t[i]})}),e}function An(e){return jn(arguments,1).forEach(function(t){ti(t,function(n,i){qr(n)?e[i]=n.slice():Vi(n)?e[i]=An({},Vi(e[i])?e[i]:{},n):e[i]=n})}),e}function Ta(e,t){en(t||Gi(e),function(n){delete e[n]})}function pn(e,t){en(e,function(n){en(t,function(i){n&&n.removeAttribute(i)})})}function Qe(e,t,n){Vi(t)?ti(t,function(i,o){Qe(e,o,i)}):en(e,function(i){Gr(n)||n===""?pn(i,t):i.setAttribute(t,String(n))})}function fi(e,t,n){var i=document.createElement(e);return t&&(Nn(t)?un(i,t):Qe(i,t)),n&&ao(n,i),i}function rn(e,t,n){if(oo(n))return getComputedStyle(e)[t];Gr(n)||(e.style[t]=""+n)}function Ui(e,t){rn(e,"display",t)}function Hs(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function an(e,t){return e.getAttribute(t)}function La(e,t){return e&&e.classList.contains(t)}function Ut(e){return e.getBoundingClientRect()}function ni(e){en(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Os(e){return so(new DOMParser().parseFromString(e,"text/html").body)}function xn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function js(e,t){return e&&e.querySelector(t)}function Xr(e,t){return t?jn(e.querySelectorAll(t)):[]}function wn(e,t){bn(e,t,!1)}function kr(e){return e.timeStamp}function Gn(e){return Nn(e)?e:e?e+"px":""}var lo="splide",Yr="data-"+lo;function Oi(e,t){if(!e)throw new Error("["+lo+"] "+(t||""))}var Hn=Math.min,Bo=Math.max,zo=Math.floor,Xi=Math.ceil,qt=Math.abs;function Bs(e,t,n){return qt(e-t)<n}function Wo(e,t,n,i){var o=Hn(t,n),l=Bo(t,n);return i?o<e&&e<l:o<=e&&e<=l}function pi(e,t,n){var i=Hn(t,n),o=Bo(t,n);return Hn(Bo(i,e),o)}function Ar(e){return+(e>0)-+(e<0)}function Wr(e,t){return en(t,function(n){e=e.replace("%s",""+n)}),e}function Jr(e){return e<10?"0"+e:""+e}var Ia={};function Nc(e){return""+e+Jr(Ia[e]=(Ia[e]||0)+1)}function zs(){var e=[];function t(s,d,c,u){o(s,d,function(m,y,L){var T="addEventListener"in m,h=T?m.removeEventListener.bind(m,y,c,u):m.removeListener.bind(m,c);T?m.addEventListener(y,c,u):m.addListener(c),e.push([m,y,L,c,h])})}function n(s,d,c){o(s,d,function(u,m,y){e=e.filter(function(L){return L[0]===u&&L[1]===m&&L[2]===y&&(!c||L[3]===c)?(L[4](),!1):!0})})}function i(s,d,c){var u,m=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:m,detail:c}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,m,!1,c)),s.dispatchEvent(u),u}function o(s,d,c){en(s,function(u){u&&en(d,function(m){m.split(" ").forEach(function(y){var L=y.split(".");c(u,L[0],L[1])})})})}function l(){e.forEach(function(s){s[4]()}),Tn(e)}return{bind:t,unbind:n,dispatch:i,destroy:l}}var Bn="mounted",Fr="ready",Ln="move",ki="moved",Zr="click",Ds="active",Vs="inactive",qs="visible",Gs="hidden",Pt="refresh",zt="updated",bi="resize",Uo="resized",Ks="drag",Us="dragging",Xs="dragged",Xo="scroll",ri="scrolled",Hc="overflow",Qr="destroy",Ys="arrows:mounted",Js="arrows:updated",Zs="pagination:mounted",Qs="pagination:updated",ea="navigation:mounted",ta="autoplay:play",el="autoplay:playing",na="autoplay:pause",ia="lazyload:loaded",tl="sk",nl="sh",Do="ei";function Tt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=zs();function i(l,s){n.bind(t,ro(l).join(" "),function(d){s.apply(s,qr(d.detail)?d.detail:[])})}function o(l){n.dispatch(t,l,jn(arguments,1))}return e&&e.event.on(Qr,n.destroy),Ki(n,{bus:t,on:i,off:bt(n.unbind,t),emit:o})}function Yo(e,t,n,i){var o=Date.now,l,s=0,d,c=!0,u=0;function m(){if(!c){if(s=e?Hn((o()-l)/e,1):1,n&&n(s),s>=1&&(t(),l=o(),i&&++u>=i))return L();d=Ca(m)}}function y(I){I||h(),l=o()-(I?s*e:0),c=!1,d=Ca(m)}function L(){c=!0}function T(){l=o(),s=0,n&&n(s)}function h(){d&&cancelAnimationFrame(d),s=0,d=0,c=!0}function v(I){e=I}function w(){return c}return{start:y,rewind:T,pause:L,cancel:h,set:v,isPaused:w}}function Oc(e){var t=e;function n(o){t=o}function i(o){return Kr(ro(o),t)}return{set:n,is:i}}function jc(e,t){var n=Yo(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Bc(e,t,n){var i=e.state,o=n.breakpoints||{},l=n.reducedMotion||{},s=zs(),d=[];function c(){var h=n.mediaQuery==="min";Gi(o).sort(function(v,w){return h?+v-+w:+w-+v}).forEach(function(v){m(o[v],"("+(h?"min":"max")+"-width:"+v+"px)")}),m(l,$a),y()}function u(h){h&&s.destroy()}function m(h,v){var w=matchMedia(v);s.bind(w,"change",y),d.push([h,w])}function y(){var h=i.is(jo),v=n.direction,w=d.reduce(function(I,R){return An(I,R[1].matches?R[0]:{})},{});Ta(n),T(w),n.destroy?e.destroy(n.destroy==="completely"):h?(u(!0),e.mount()):v!==n.direction&&e.refresh()}function L(h){matchMedia($a).matches&&(h?An(n,l):Ta(n,Gi(l)))}function T(h,v,w){An(n,h),v&&An(Object.getPrototypeOf(n),h),(w||!i.is(hi))&&e.emit(zt,n)}return{setup:c,destroy:u,reduce:L,set:T}}var Jo="Arrow",Zo=Jo+"Left",Qo=Jo+"Right",il=Jo+"Up",ol=Jo+"Down",Ea="rtl",er="ttb",gr={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[il,Qo],ArrowRight:[ol,Zo]};function zc(e,t,n){function i(l,s,d){d=d||n.direction;var c=d===Ea&&!s?1:d===er?0:-1;return gr[l]&&gr[l][c]||l.replace(/width|left|right/i,function(u,m){var y=gr[u.toLowerCase()][c]||u;return m>0?y.charAt(0).toUpperCase()+y.slice(1):y})}function o(l){return l*(n.direction===Ea?1:-1)}return{resolve:i,orient:o}}var Sn="role",yi="tabindex",Dc="disabled",sn="aria-",co=sn+"controls",rl=sn+"current",Ra=sn+"selected",Yt=sn+"label",oa=sn+"labelledby",al=sn+"hidden",ra=sn+"orientation",Yi=sn+"roledescription",Ma=sn+"live",Pa=sn+"busy",ka=sn+"atomic",aa=[Sn,yi,Dc,co,rl,Yt,oa,al,ra,Yi],mn=lo+"__",zn="is-",hr=lo,Aa=mn+"track",Vc=mn+"list",tr=mn+"slide",sl=tr+"--clone",qc=tr+"__container",sa=mn+"arrows",nr=mn+"arrow",ll=nr+"--prev",cl=nr+"--next",ir=mn+"pagination",dl=ir+"__page",Gc=mn+"progress",Kc=Gc+"__bar",Uc=mn+"toggle",Xc=mn+"spinner",Yc=mn+"sr",Jc=zn+"initialized",ii=zn+"active",ul=zn+"prev",pl=zn+"next",_r=zn+"visible",Nr=zn+"loading",ml=zn+"focus-in",gl=zn+"overflow",Zc=[ii,_r,ul,pl,Nr,ml,gl],Qc={slide:tr,clone:sl,arrows:sa,arrow:nr,prev:ll,next:cl,pagination:ir,page:dl,spinner:Xc};function ed(e,t){if(Fs(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!qi(n,t);)n=n.parentElement;return n}var td=5,Wa=200,hl="touchstart mousedown",fr="touchmove mousemove",yr="touchend touchcancel mouseup click";function nd(e,t,n){var i=Tt(e),o=i.on,l=i.bind,s=e.root,d=n.i18n,c={},u=[],m=[],y=[],L,T,h;function v(){A(),H(),R()}function w(){o(Pt,I),o(Pt,v),o(zt,R),l(document,hl+" keydown",function(M){h=M.type==="keydown"},{capture:!0}),l(s,"focusin",function(){bn(s,ml,!!h)})}function I(M){var C=aa.concat("style");Tn(u),wn(s,m),wn(L,y),pn([L,T],C),pn(s,M?C:["style",Yi])}function R(){wn(s,m),wn(L,y),m=O(hr),y=O(Aa),un(s,m),un(L,y),Qe(s,Yt,n.label),Qe(s,oa,n.labelledby)}function A(){L=b("."+Aa),T=so(L,"."+Vc),Oi(L&&T,"A track/list element is missing."),Ao(u,Ns(T,"."+tr+":not(."+sl+")")),ti({arrows:sa,pagination:ir,prev:ll,next:cl,bar:Kc,toggle:Uc},function(M,C){c[C]=b("."+M)}),Ki(c,{root:s,track:L,list:T,slides:u})}function H(){var M=s.id||Nc(lo),C=n.role;s.id=M,L.id=L.id||M+"-track",T.id=T.id||M+"-list",!an(s,Sn)&&s.tagName!=="SECTION"&&C&&Qe(s,Sn,C),Qe(s,Yi,d.carousel),Qe(T,Sn,"presentation")}function b(M){var C=js(s,M);return C&&ed(C,"."+hr)===s?C:void 0}function O(M){return[M+"--"+n.type,M+"--"+n.direction,n.drag&&M+"--draggable",n.isNavigation&&M+"--nav",M===hr&&ii]}return Ki(c,{setup:v,mount:w,destroy:I})}var wi="slide",Ai="loop",uo="fade";function id(e,t,n,i){var o=Tt(e),l=o.on,s=o.emit,d=o.bind,c=e.Components,u=e.root,m=e.options,y=m.isNavigation,L=m.updateOnMove,T=m.i18n,h=m.pagination,v=m.slideFocus,w=c.Direction.resolve,I=an(i,"style"),R=an(i,Yt),A=n>-1,H=so(i,"."+qc),b;function O(){A||(i.id=u.id+"-slide"+Jr(t+1),Qe(i,Sn,h?"tabpanel":"group"),Qe(i,Yi,T.slide),Qe(i,Yt,R||Wr(T.slideLabel,[t+1,e.length]))),M()}function M(){d(i,"click",bt(s,Zr,z)),d(i,"keydown",bt(s,tl,z)),l([ki,nl,ri],W),l(ea,q),L&&l(Ln,f)}function C(){b=!0,o.destroy(),wn(i,Zc),pn(i,aa),Qe(i,"style",I),Qe(i,Yt,R||"")}function q(){var P=e.splides.map(function(S){var K=S.splide.Components.Slides.getAt(t);return K?K.slide.id:""}).join(" ");Qe(i,Yt,Wr(T.slideX,(A?n:t)+1)),Qe(i,co,P),Qe(i,Sn,v?"button":""),v&&pn(i,Yi)}function f(){b||W()}function W(){if(!b){var P=e.index;F(),B(),bn(i,ul,t===P-1),bn(i,pl,t===P+1)}}function F(){var P=ne();P!==La(i,ii)&&(bn(i,ii,P),Qe(i,rl,y&&P||""),s(P?Ds:Vs,z))}function B(){var P=G(),S=!P&&(!ne()||A);if(e.state.is([Pi,io])||Qe(i,al,S||""),Qe(Xr(i,m.focusableNodes||""),yi,S?-1:""),v&&Qe(i,yi,S?-1:0),P!==La(i,_r)&&(bn(i,_r,P),s(P?qs:Gs,z)),!P&&document.activeElement===i){var K=c.Slides.getAt(e.index);K&&Hs(K.slide)}}function ee(P,S,K){rn(K&&H||i,P,S)}function ne(){var P=e.index;return P===t||m.cloneStatus&&P===n}function G(){if(e.is(uo))return ne();var P=Ut(c.Elements.track),S=Ut(i),K=w("left",!0),Z=w("right",!0);return zo(P[K])<=Xi(S[K])&&zo(S[Z])<=Xi(P[Z])}function D(P,S){var K=qt(P-t);return!A&&(m.rewind||e.is(Ai))&&(K=Hn(K,e.length-K)),K<=S}var z={index:t,slideIndex:n,slide:i,container:H,isClone:A,mount:O,destroy:C,update:W,style:ee,isWithin:D};return z}function od(e,t,n){var i=Tt(e),o=i.on,l=i.emit,s=i.bind,d=t.Elements,c=d.slides,u=d.list,m=[];function y(){L(),o(Pt,T),o(Pt,L)}function L(){c.forEach(function(W,F){v(W,F,-1)})}function T(){b(function(W){W.destroy()}),Tn(m)}function h(){b(function(W){W.update()})}function v(W,F,B){var ee=id(e,F,B,W);ee.mount(),m.push(ee),m.sort(function(ne,G){return ne.index-G.index})}function w(W){return W?O(function(F){return!F.isClone}):m}function I(W){var F=t.Controller,B=F.toIndex(W),ee=F.hasFocus()?1:n.perPage;return O(function(ne){return Wo(ne.index,B,B+ee-1)})}function R(W){return O(W)[0]}function A(W,F){en(W,function(B){if(Nn(B)&&(B=Os(B)),_s(B)){var ee=c[F];ee?Ur(B,ee):ao(u,B),un(B,n.classes.slide),C(B,bt(l,bi))}}),l(Pt)}function H(W){ni(O(W).map(function(F){return F.slide})),l(Pt)}function b(W,F){w(F).forEach(W)}function O(W){return m.filter(Fs(W)?W:function(F){return Nn(W)?qi(F.slide,W):Kr(ro(W),F.index)})}function M(W,F,B){b(function(ee){ee.style(W,F,B)})}function C(W,F){var B=Xr(W,"img"),ee=B.length;ee?B.forEach(function(ne){s(ne,"load error",function(){--ee||F()})}):F()}function q(W){return W?c.length:m.length}function f(){return m.length>n.perPage}return{mount:y,destroy:T,update:h,register:v,get:w,getIn:I,getAt:R,add:A,remove:H,forEach:b,filter:O,style:M,getLength:q,isEnough:f}}function rd(e,t,n){var i=Tt(e),o=i.on,l=i.bind,s=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,m=u.root,y=u.track,L=u.list,T=d.getAt,h=d.style,v,w,I;function R(){A(),l(window,"resize load",jc(bt(s,bi))),o([zt,Pt],A),o(bi,H)}function A(){v=n.direction===er,rn(m,"maxWidth",Gn(n.width)),rn(y,c("paddingLeft"),b(!1)),rn(y,c("paddingRight"),b(!0)),H(!0)}function H(z){var P=Ut(m);(z||w.width!==P.width||w.height!==P.height)&&(rn(y,"height",O()),h(c("marginRight"),Gn(n.gap)),h("width",C()),h("height",q(),!0),w=P,s(Uo),I!==(I=D())&&(bn(m,gl,I),s(Hc,I)))}function b(z){var P=n.padding,S=c(z?"right":"left");return P&&Gn(P[S]||(Vi(P)?0:P))||"0px"}function O(){var z="";return v&&(z=M(),Oi(z,"height or heightRatio is missing."),z="calc("+z+" - "+b(!1)+" - "+b(!0)+")"),z}function M(){return Gn(n.height||Ut(L).width*n.heightRatio)}function C(){return n.autoWidth?null:Gn(n.fixedWidth)||(v?"":f())}function q(){return Gn(n.fixedHeight)||(v?n.autoHeight?null:f():M())}function f(){var z=Gn(n.gap);return"calc((100%"+(z&&" + "+z)+")/"+(n.perPage||1)+(z&&" - "+z)+")"}function W(){return Ut(L)[c("width")]}function F(z,P){var S=T(z||0);return S?Ut(S.slide)[c("width")]+(P?0:ne()):0}function B(z,P){var S=T(z);if(S){var K=Ut(S.slide)[c("right")],Z=Ut(L)[c("left")];return qt(K-Z)+(P?0:ne())}return 0}function ee(z){return B(e.length-1)-B(0)+F(0,z)}function ne(){var z=T(0);return z&&parseFloat(rn(z.slide,c("marginRight")))||0}function G(z){return parseFloat(rn(y,c("padding"+(z?"Right":"Left"))))||0}function D(){return e.is(uo)||ee(!0)>W()}return{mount:R,resize:H,listSize:W,slideSize:F,sliderSize:ee,totalSize:B,getPadding:G,isOverflow:D}}var ad=2;function sd(e,t,n){var i=Tt(e),o=i.on,l=t.Elements,s=t.Slides,d=t.Direction.resolve,c=[],u;function m(){o(Pt,y),o([zt,bi],T),(u=w())&&(h(u),t.Layout.resize(!0))}function y(){L(),m()}function L(){ni(c),Tn(c),i.destroy()}function T(){var I=w();u!==I&&(u<I||!I)&&i.emit(Pt)}function h(I){var R=s.get().slice(),A=R.length;if(A){for(;R.length<I;)Ao(R,R);Ao(R.slice(-I),R.slice(0,I)).forEach(function(H,b){var O=b<I,M=v(H.slide,b);O?Ur(M,R[0].slide):ao(l.list,M),Ao(c,M),s.register(M,b-I+(O?0:A),H.index)})}}function v(I,R){var A=I.cloneNode(!0);return un(A,n.classes.clone),A.id=e.root.id+"-clone"+Jr(R+1),A}function w(){var I=n.clones;if(!e.is(Ai))I=0;else if(oo(I)){var R=n[d("fixedWidth")]&&t.Layout.slideSize(0),A=R&&Xi(Ut(l.track)[d("width")]/R);I=A||n[d("autoWidth")]&&e.length||n.perPage*ad}return I}return{mount:m,destroy:L}}function ld(e,t,n){var i=Tt(e),o=i.on,l=i.emit,s=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,m=d.totalSize,y=d.listSize,L=d.sliderSize,T=t.Direction,h=T.resolve,v=T.orient,w=t.Elements,I=w.list,R=w.track,A;function H(){A=t.Transition,o([Bn,Uo,zt,Pt],b)}function b(){t.Controller.isBusy()||(t.Scroll.cancel(),M(e.index),t.Slides.update())}function O(S,K,Z,U){S!==K&&z(S>Z)&&(W(),C(f(ee(),S>Z),!0)),s(Pi),l(Ln,K,Z,S),A.start(K,function(){s(xi),l(ki,K,Z,S),U&&U()})}function M(S){C(B(S,!0))}function C(S,K){if(!e.is(uo)){var Z=K?S:q(S);rn(I,"transform","translate"+h("X")+"("+Z+"px)"),S!==Z&&l(nl)}}function q(S){if(e.is(Ai)){var K=F(S),Z=K>t.Controller.getEnd(),U=K<0;(U||Z)&&(S=f(S,Z))}return S}function f(S,K){var Z=S-D(K),U=L();return S-=v(U*(Xi(qt(Z)/U)||1))*(K?1:-1),S}function W(){C(ee(),!0),A.cancel()}function F(S){for(var K=t.Slides.get(),Z=0,U=1/0,N=0;N<K.length;N++){var pe=K[N].index,g=qt(B(pe,!0)-S);if(g<=U)U=g,Z=pe;else break}return Z}function B(S,K){var Z=v(m(S-1)-G(S));return K?ne(Z):Z}function ee(){var S=h("left");return Ut(I)[S]-Ut(R)[S]+v(u(!1))}function ne(S){return n.trimSpace&&e.is(wi)&&(S=pi(S,0,v(L(!0)-y()))),S}function G(S){var K=n.focus;return K==="center"?(y()-c(S,!0))/2:+K*c(S)||0}function D(S){return B(S?t.Controller.getEnd():0,!!n.trimSpace)}function z(S){var K=v(f(ee(),S));return S?K>=0:K<=I[h("scrollWidth")]-Ut(R)[h("width")]}function P(S,K){K=oo(K)?ee():K;var Z=S!==!0&&v(K)<v(D(!1)),U=S!==!1&&v(K)>v(D(!0));return Z||U}return{mount:H,move:O,jump:M,translate:C,shift:f,cancel:W,toIndex:F,toPosition:B,getPosition:ee,getLimit:D,exceededLimit:P,reposition:b}}function cd(e,t,n){var i=Tt(e),o=i.on,l=i.emit,s=t.Move,d=s.getPosition,c=s.getLimit,u=s.toPosition,m=t.Slides,y=m.isEnough,L=m.getLength,T=n.omitEnd,h=e.is(Ai),v=e.is(wi),w=bt(ee,!1),I=bt(ee,!0),R=n.start||0,A,H=R,b,O,M;function C(){q(),o([zt,Pt,Do],q),o(Uo,f)}function q(){b=L(!0),O=n.perMove,M=n.perPage,A=z();var g=pi(R,0,T?A:b-1);g!==R&&(R=g,s.reposition())}function f(){A!==z()&&l(Do)}function W(g,ue,ve){if(!pe()){var ge=B(g),Ee=D(ge);Ee>-1&&(ue||Ee!==R)&&(Z(Ee),s.move(ge,Ee,H,ve))}}function F(g,ue,ve,ge){t.Scroll.scroll(g,ue,ve,function(){var Ee=D(s.toIndex(d()));Z(T?Hn(Ee,A):Ee),ge&&ge()})}function B(g){var ue=R;if(Nn(g)){var ve=g.match(/([+\-<>])(\d+)?/)||[],ge=ve[1],Ee=ve[2];ge==="+"||ge==="-"?ue=ne(R+ +(""+ge+(+Ee||1)),R):ge===">"?ue=Ee?P(+Ee):w(!0):ge==="<"&&(ue=I(!0))}else ue=h?g:pi(g,0,A);return ue}function ee(g,ue){var ve=O||(N()?1:M),ge=ne(R+ve*(g?-1:1),R,!(O||N()));return ge===-1&&v&&!Bs(d(),c(!g),1)?g?0:A:ue?ge:D(ge)}function ne(g,ue,ve){if(y()||N()){var ge=G(g);ge!==g&&(ue=g,g=ge,ve=!1),g<0||g>A?!O&&(Wo(0,g,ue,!0)||Wo(A,ue,g,!0))?g=P(S(g)):h?g=ve?g<0?-(b%M||M):b:g:n.rewind?g=g<0?A:0:g=-1:ve&&g!==ue&&(g=P(S(ue)+(g<ue?-1:1)))}else g=-1;return g}function G(g){if(v&&n.trimSpace==="move"&&g!==R)for(var ue=d();ue===u(g,!0)&&Wo(g,0,e.length-1,!n.rewind);)g<R?--g:++g;return g}function D(g){return h?(g+b)%b||0:g}function z(){for(var g=b-(N()||h&&O?1:M);T&&g-- >0;)if(u(b-1,!0)!==u(g,!0)){g++;break}return pi(g,0,b-1)}function P(g){return pi(N()?g:M*g,0,A)}function S(g){return N()?Hn(g,A):zo((g>=A?b-1:g)/M)}function K(g){var ue=s.toIndex(g);return v?pi(ue,0,A):ue}function Z(g){g!==R&&(H=R,R=g)}function U(g){return g?H:R}function N(){return!oo(n.focus)||n.isNavigation}function pe(){return e.state.is([Pi,io])&&!!n.waitForTransition}return{mount:C,go:W,scroll:F,getNext:w,getPrev:I,getAdjacent:ee,getEnd:z,setIndex:Z,getIndex:U,toIndex:P,toPage:S,toDest:K,hasFocus:N,isBusy:pe}}var dd="http://www.w3.org/2000/svg",ud="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",vo=40;function pd(e,t,n){var i=Tt(e),o=i.on,l=i.bind,s=i.emit,d=n.classes,c=n.i18n,u=t.Elements,m=t.Controller,y=u.arrows,L=u.track,T=y,h=u.prev,v=u.next,w,I,R={};function A(){b(),o(zt,H)}function H(){O(),A()}function b(){var F=n.arrows;F&&!(h&&v)&&q(),h&&v&&(Ki(R,{prev:h,next:v}),Ui(T,F?"":"none"),un(T,I=sa+"--"+n.direction),F&&(M(),W(),Qe([h,v],co,L.id),s(Ys,h,v)))}function O(){i.destroy(),wn(T,I),w?(ni(y?[h,v]:T),h=v=null):pn([h,v],aa)}function M(){o([Bn,ki,Pt,ri,Do],W),l(v,"click",bt(C,">")),l(h,"click",bt(C,"<"))}function C(F){m.go(F,!0)}function q(){T=y||fi("div",d.arrows),h=f(!0),v=f(!1),w=!0,ao(T,[h,v]),!y&&Ur(T,L)}function f(F){var B='<button class="'+d.arrow+" "+(F?d.prev:d.next)+'" type="button"><svg xmlns="'+dd+'" viewBox="0 0 '+vo+" "+vo+'" width="'+vo+'" height="'+vo+'" focusable="false"><path d="'+(n.arrowPath||ud)+'" />';return Os(B)}function W(){if(h&&v){var F=e.index,B=m.getPrev(),ee=m.getNext(),ne=B>-1&&F<B?c.last:c.prev,G=ee>-1&&F>ee?c.first:c.next;h.disabled=B<0,v.disabled=ee<0,Qe(h,Yt,ne),Qe(v,Yt,G),s(Js,h,v,B,ee)}}return{arrows:R,mount:A,destroy:O,update:W}}var md=Yr+"-interval";function gd(e,t,n){var i=Tt(e),o=i.on,l=i.bind,s=i.emit,d=Yo(n.interval,e.go.bind(e,">"),M),c=d.isPaused,u=t.Elements,m=t.Elements,y=m.root,L=m.toggle,T=n.autoplay,h,v,w=T==="pause";function I(){T&&(R(),L&&Qe(L,co,u.track.id),w||A(),O())}function R(){n.pauseOnHover&&l(y,"mouseenter mouseleave",function(q){h=q.type==="mouseenter",b()}),n.pauseOnFocus&&l(y,"focusin focusout",function(q){v=q.type==="focusin",b()}),L&&l(L,"click",function(){w?A():H(!0)}),o([Ln,Xo,Pt],d.rewind),o(Ln,C)}function A(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),v=h=w=!1,O(),s(ta))}function H(q){q===void 0&&(q=!0),w=!!q,O(),c()||(d.pause(),s(na))}function b(){w||(h||v?H(!1):A())}function O(){L&&(bn(L,ii,!w),Qe(L,Yt,n.i18n[w?"play":"pause"]))}function M(q){var f=u.bar;f&&rn(f,"width",q*100+"%"),s(el,q)}function C(q){var f=t.Slides.getAt(q);d.set(f&&+an(f.slide,md)||n.interval)}return{mount:I,destroy:d.cancel,play:A,pause:H,isPaused:c}}function hd(e,t,n){var i=Tt(e),o=i.on;function l(){n.cover&&(o(ia,bt(d,!0)),o([Bn,zt,Pt],bt(s,!0)))}function s(c){t.Slides.forEach(function(u){var m=so(u.container||u.slide,"img");m&&m.src&&d(c,m,u)})}function d(c,u,m){m.style("background",c?'center/cover no-repeat url("'+u.src+'")':"",!0),Ui(u,c?"none":"")}return{mount:l,destroy:bt(s,!1)}}var fd=10,yd=600,vd=.6,xd=1.5,bd=800;function wd(e,t,n){var i=Tt(e),o=i.on,l=i.emit,s=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,m=d.exceededLimit,y=d.translate,L=e.is(wi),T,h,v=1;function w(){o(Ln,H),o([zt,Pt],b)}function I(M,C,q,f,W){var F=c();if(H(),q&&(!L||!m())){var B=t.Layout.sliderSize(),ee=Ar(M)*B*zo(qt(M)/B)||0;M=d.toPosition(t.Controller.toDest(M%B))+ee}var ne=Bs(F,M,1);v=1,C=ne?0:C||Bo(qt(M-F)/xd,bd),h=f,T=Yo(C,R,bt(A,F,M,W),1),s(io),l(Xo),T.start()}function R(){s(xi),h&&h(),l(ri)}function A(M,C,q,f){var W=c(),F=M+(C-M)*O(f),B=(F-W)*v;y(W+B),L&&!q&&m()&&(v*=vd,qt(B)<fd&&I(u(m(!0)),yd,!1,h,!0))}function H(){T&&T.cancel()}function b(){T&&!T.isPaused()&&(H(),R())}function O(M){var C=n.easingFunc;return C?C(M):1-Math.pow(1-M,4)}return{mount:w,destroy:H,scroll:I,cancel:b}}var mi={passive:!1,capture:!0};function Sd(e,t,n){var i=Tt(e),o=i.on,l=i.emit,s=i.bind,d=i.unbind,c=e.state,u=t.Move,m=t.Scroll,y=t.Controller,L=t.Elements.track,T=t.Media.reduce,h=t.Direction,v=h.resolve,w=h.orient,I=u.getPosition,R=u.exceededLimit,A,H,b,O,M,C=!1,q,f,W;function F(){s(L,fr,Pr,mi),s(L,yr,Pr,mi),s(L,hl,ee,mi),s(L,"click",D,{capture:!0}),s(L,"dragstart",xn),o([Bn,zt],B)}function B(){var J=n.drag;me(!J),O=J==="free"}function ee(J){if(q=!1,!f){var be=Ee(J);ge(J.target)&&(be||!J.button)&&(y.isBusy()?xn(J,!0):(W=be?L:window,M=c.is([Pi,io]),b=null,s(W,fr,ne,mi),s(W,yr,G,mi),u.cancel(),m.cancel(),z(J)))}}function ne(J){if(c.is(ko)||(c.set(ko),l(Ks)),J.cancelable)if(M){u.translate(A+ve(N(J)));var be=pe(J)>Wa,le=C!==(C=R());(be||le)&&z(J),q=!0,l(Us),xn(J)}else K(J)&&(M=S(J),xn(J))}function G(J){c.is(ko)&&(c.set(xi),l(Xs)),M&&(P(J),xn(J)),d(W,fr,ne),d(W,yr,G),M=!1}function D(J){!f&&q&&xn(J,!0)}function z(J){b=H,H=J,A=I()}function P(J){var be=Z(J),le=U(be),ce=n.rewind&&n.rewindByDrag;T(!1),O?y.scroll(le,0,n.snap):e.is(uo)?y.go(w(Ar(be))<0?ce?"<":"-":ce?">":"+"):e.is(wi)&&C&&ce?y.go(R(!0)?">":"<"):y.go(y.toDest(le),!0),T(!0)}function S(J){var be=n.dragMinThreshold,le=Vi(be),ce=le&&be.mouse||0,re=(le?be.touch:+be)||10;return qt(N(J))>(Ee(J)?re:ce)}function K(J){return qt(N(J))>qt(N(J,!0))}function Z(J){if(e.is(Ai)||!C){var be=pe(J);if(be&&be<Wa)return N(J)/be}return 0}function U(J){return I()+Ar(J)*Hn(qt(J)*(n.flickPower||600),O?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function N(J,be){return ue(J,be)-ue(g(J),be)}function pe(J){return kr(J)-kr(g(J))}function g(J){return H===J&&b||H}function ue(J,be){return(Ee(J)?J.changedTouches[0]:J)["page"+v(be?"Y":"X")]}function ve(J){return J/(C&&e.is(wi)?td:1)}function ge(J){var be=n.noDrag;return!qi(J,"."+dl+", ."+nr)&&(!be||!qi(J,be))}function Ee(J){return typeof TouchEvent<"u"&&J instanceof TouchEvent}function te(){return M}function me(J){f=J}return{mount:F,disable:me,isDragging:te}}var $d={Spacebar:" ",Right:Qo,Left:Zo,Up:il,Down:ol};function la(e){return e=Nn(e)?e:e.key,$d[e]||e}var Fa="keydown";function Cd(e,t,n){var i=Tt(e),o=i.on,l=i.bind,s=i.unbind,d=e.root,c=t.Direction.resolve,u,m;function y(){L(),o(zt,T),o(zt,L),o(Ln,v)}function L(){var I=n.keyboard;I&&(u=I==="global"?window:d,l(u,Fa,w))}function T(){s(u,Fa)}function h(I){m=I}function v(){var I=m;m=!0,Ws(function(){m=I})}function w(I){if(!m){var R=la(I);R===c(Zo)?e.go("<"):R===c(Qo)&&e.go(">")}}return{mount:y,destroy:T,disable:h}}var ji=Yr+"-lazy",Fo=ji+"-srcset",Td="["+ji+"], ["+Fo+"]";function Ld(e,t,n){var i=Tt(e),o=i.on,l=i.off,s=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[ki,ri],m=[];function y(){n.lazyLoad&&(L(),o(Pt,L))}function L(){Tn(m),T(),c?I():(l(u),o(u,h),h())}function T(){t.Slides.forEach(function(R){Xr(R.slide,Td).forEach(function(A){var H=an(A,ji),b=an(A,Fo);if(H!==A.src||b!==A.srcset){var O=n.classes.spinner,M=A.parentElement,C=so(M,"."+O)||fi("span",O,M);m.push([A,R,C]),A.src||Ui(A,"none")}})})}function h(){m=m.filter(function(R){var A=n.perPage*((n.preloadPages||1)+1)-1;return R[1].isWithin(e.index,A)?v(R):!0}),m.length||l(u)}function v(R){var A=R[0];un(R[1].slide,Nr),s(A,"load error",bt(w,R)),Qe(A,"src",an(A,ji)),Qe(A,"srcset",an(A,Fo)),pn(A,ji),pn(A,Fo)}function w(R,A){var H=R[0],b=R[1];wn(b.slide,Nr),A.type!=="error"&&(ni(R[2]),Ui(H,""),d(ia,H,b),d(bi)),c&&I()}function I(){m.length&&v(m.shift())}return{mount:y,destroy:bt(Tn,m),check:h}}function Id(e,t,n){var i=Tt(e),o=i.on,l=i.emit,s=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,m=u.hasFocus,y=u.getIndex,L=u.go,T=t.Direction.resolve,h=c.pagination,v=[],w,I;function R(){A(),o([zt,Pt,Do],R);var f=n.pagination;h&&Ui(h,f?"":"none"),f&&(o([Ln,Xo,ri],q),H(),q(),l(Zs,{list:w,items:v},C(e.index)))}function A(){w&&(ni(h?jn(w.children):w),wn(w,I),Tn(v),w=null),i.destroy()}function H(){var f=e.length,W=n.classes,F=n.i18n,B=n.perPage,ee=m()?u.getEnd()+1:Xi(f/B);w=h||fi("ul",W.pagination,c.track.parentElement),un(w,I=ir+"--"+M()),Qe(w,Sn,"tablist"),Qe(w,Yt,F.select),Qe(w,ra,M()===er?"vertical":"");for(var ne=0;ne<ee;ne++){var G=fi("li",null,w),D=fi("button",{class:W.page,type:"button"},G),z=d.getIn(ne).map(function(S){return S.slide.id}),P=!m()&&B>1?F.pageX:F.slideX;s(D,"click",bt(b,ne)),n.paginationKeyboard&&s(D,"keydown",bt(O,ne)),Qe(G,Sn,"presentation"),Qe(D,Sn,"tab"),Qe(D,co,z.join(" ")),Qe(D,Yt,Wr(P,ne+1)),Qe(D,yi,-1),v.push({li:G,button:D,page:ne})}}function b(f){L(">"+f,!0)}function O(f,W){var F=v.length,B=la(W),ee=M(),ne=-1;B===T(Qo,!1,ee)?ne=++f%F:B===T(Zo,!1,ee)?ne=(--f+F)%F:B==="Home"?ne=0:B==="End"&&(ne=F-1);var G=v[ne];G&&(Hs(G.button),L(">"+ne),xn(W,!0))}function M(){return n.paginationDirection||n.direction}function C(f){return v[u.toPage(f)]}function q(){var f=C(y(!0)),W=C(y());if(f){var F=f.button;wn(F,ii),pn(F,Ra),Qe(F,yi,-1)}if(W){var B=W.button;un(B,ii),Qe(B,Ra,!0),Qe(B,yi,"")}l(Qs,{list:w,items:v},f,W)}return{items:v,mount:R,destroy:A,getAt:C,update:q}}var Ed=[" ","Enter"];function Rd(e,t,n){var i=n.isNavigation,o=n.slideFocus,l=[];function s(){e.splides.forEach(function(h){h.isParent||(u(e,h.splide),u(h.splide,e))}),i&&m()}function d(){l.forEach(function(h){h.destroy()}),Tn(l)}function c(){d(),s()}function u(h,v){var w=Tt(h);w.on(Ln,function(I,R,A){v.go(v.is(Ai)?A:I)}),l.push(w)}function m(){var h=Tt(e),v=h.on;v(Zr,L),v(tl,T),v([Bn,zt],y),l.push(h),h.emit(ea,e.splides)}function y(){Qe(t.Elements.list,ra,n.direction===er?"vertical":"")}function L(h){e.go(h.index)}function T(h,v){Kr(Ed,la(v))&&(L(h),xn(v))}return{setup:bt(t.Media.set,{slideFocus:oo(o)?i:o},!0),mount:s,destroy:d,remount:c}}function Md(e,t,n){var i=Tt(e),o=i.bind,l=0;function s(){n.wheel&&o(t.Elements.track,"wheel",d,mi)}function d(u){if(u.cancelable){var m=u.deltaY,y=m<0,L=kr(u),T=n.wheelMinThreshold||0,h=n.wheelSleep||0;qt(m)>T&&L-l>h&&(e.go(y?"<":">"),l=L),c(y)&&xn(u)}}function c(u){return!n.releaseWheel||e.state.is(Pi)||t.Controller.getAdjacent(u)!==-1}return{mount:s}}var Pd=90;function kd(e,t,n){var i=Tt(e),o=i.on,l=t.Elements.track,s=n.live&&!n.isNavigation,d=fi("span",Yc),c=Yo(Pd,bt(m,!1));function u(){s&&(L(!t.Autoplay.isPaused()),Qe(l,ka,!0),d.textContent="…",o(ta,bt(L,!0)),o(na,bt(L,!1)),o([ki,ri],bt(m,!0)))}function m(T){Qe(l,Pa,T),T?(ao(l,d),c.start()):(ni(d),c.cancel())}function y(){pn(l,[Ma,ka,Pa]),ni(d)}function L(T){s&&Qe(l,Ma,T?"off":"polite")}return{mount:u,disable:L,destroy:y}}var Ad=Object.freeze({__proto__:null,Media:Bc,Direction:zc,Elements:nd,Slides:od,Layout:rd,Clones:sd,Move:ld,Controller:cd,Arrows:pd,Autoplay:gd,Cover:hd,Scroll:wd,Drag:Sd,Keyboard:Cd,LazyLoad:Ld,Pagination:Id,Sync:Rd,Wheel:Md,Live:kd}),Wd={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"},Fd={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:Qc,i18n:Wd,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function _d(e,t,n){var i=t.Slides;function o(){Tt(e).on([Bn,Pt],l)}function l(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function s(d,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),Ws(c)}return{mount:o,start:s,cancel:Pr}}function Nd(e,t,n){var i=t.Move,o=t.Controller,l=t.Scroll,s=t.Elements.list,d=bt(rn,s,"transition"),c;function u(){Tt(e).bind(s,"transitionend",function(T){T.target===s&&c&&(y(),c())})}function m(T,h){var v=i.toPosition(T,!0),w=i.getPosition(),I=L(T);qt(v-w)>=1&&I>=1?n.useScroll?l.scroll(v,I,!1,h):(d("transform "+I+"ms "+n.easing),i.translate(v,!0),c=h):(i.jump(T),h())}function y(){d(""),l.cancel()}function L(T){var h=n.rewindSpeed;if(e.is(wi)&&h){var v=o.getIndex(!0),w=o.getEnd();if(v===0&&T>=w||v>=w&&T===0)return h}return n.speed}return{mount:u,start:m,cancel:y}}var Hd=(function(){function e(n,i){this.event=Tt(),this.Components={},this.state=Oc(hi),this.splides=[],this._o={},this._E={};var o=Nn(n)?js(document,n):n;Oi(o,o+" is invalid."),this.root=o,i=An({label:an(o,Yt)||"",labelledby:an(o,oa)||""},Fd,e.defaults,i||{});try{An(i,JSON.parse(an(o,Yr)))}catch{Oi(!1,"Invalid JSON")}this._o=Object.create(An({},i))}var t=e.prototype;return t.mount=function(i,o){var l=this,s=this.state,d=this.Components;Oi(s.is([hi,jo]),"Already mounted!"),s.set(hi),this._C=d,this._T=o||this._T||(this.is(uo)?_d:Nd),this._E=i||this._E;var c=Ki({},Ad,this._E,{Transition:this._T});return ti(c,function(u,m){var y=u(l,d,l._o);d[m]=y,y.setup&&y.setup()}),ti(d,function(u){u.mount&&u.mount()}),this.emit(Bn),un(this.root,Jc),s.set(xi),this.emit(Fr),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(xi)&&(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(jn(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(Pt),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,l=this.state;return l.is(hi)?Tt(this).on(Fr,this.destroy.bind(this,i)):(ti(this._C,function(s){s.destroy&&s.destroy(i)},!0),o.emit(Qr),o.destroy(),i&&Tn(this.splides),l.set(jo)),this},Wc(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})(),ca=Hd;ca.defaults={};ca.STATES=_c;var _a=[[Bn,"onMounted"],[Fr,"onReady"],[Ln,"onMove"],[ki,"onMoved"],[Zr,"onClick"],[Ds,"onActive"],[Vs,"onInactive"],[qs,"onVisible"],[Gs,"onHidden"],[Pt,"onRefresh"],[zt,"onUpdated"],[bi,"onResize"],[Uo,"onResized"],[Ks,"onDrag"],[Us,"onDragging"],[Xs,"onDragged"],[Xo,"onScroll"],[ri,"onScrolled"],[Qr,"onDestroy"],[Ys,"onArrowsMounted"],[Js,"onArrowsUpdated"],[Zs,"onPaginationMounted"],[Qs,"onPaginationUpdated"],[ea,"onNavigationMounted"],[ta,"onAutoplayPlay"],[el,"onAutoplayPlaying"],[na,"onAutoplayPause"],[ia,"onLazyLoadLoaded"]];function da(...e){return e.filter(Boolean).join(" ")}function Vo(e){return e!==null&&typeof e=="object"}function Hr(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!Hr(n,t[i]));if(Vo(e)&&Vo(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Hr(e[o],t[o]))}return e===t}function Od(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function jd(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 Or(e,t){const n=e;return jd(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Vo(i)?n[o]=Or(Vo(n[o])?n[o]:{},i):n[o]=i}),n}var Bd=({children:e,className:t,...n})=>a.createElement("div",{className:da("splide__track",t),...n},a.createElement("ul",{className:"splide__list"},e)),ua=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 ca(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Or({},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&&!Hr(this.options,e)&&(this.splide.options=e,this.options=Or({},e));const t=this.getSlides();Od(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){_a.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:da("splide",e),ref:this.splideRef,...this.omit(o,["options",..._a.map(l=>l[1])])},n?a.createElement(Bd,null,i):i)}},pa=({children:e,className:t,...n})=>a.createElement("li",{className:da("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 zd="RichTextRenderer-module__link___BWeZ2",Dd={link:zd},Vd=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))},or=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Vd(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function Jt(e){const{color:t,...n}=e;return n}function Ft(e,t){var o,l,s;const{fontSize:n,lineHeight:i}=e;return{fontFamily:or(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:F.scalingValue(e.letterSpacing,t),wordSpacing:F.scalingValue(e.wordSpacing,t),fontSize:F.scalingValue(n,t),lineHeight:i!==void 0?F.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(l=e.textAppearance)==null?void 0:l.textDecoration,fontVariant:(s=e.textAppearance)==null?void 0:s.fontVariant,textAlign:e.textAlign,color:e.color}}const Si=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:Dd.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:qd(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 qd(e){return{...e.fontFamily&&{fontFamily:or(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 Gd="SvgImage-module__svg___q3xE-",Kd="SvgImage-module__img___VsTm-",Na={svg:Gd,img:Kd},Ud=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},Xd=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,Zt=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[l,s]=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("")');s(d)}},[]),!Ud(e)||!l?r.jsx("img",{src:e,alt:"",className:nt(Na.img,i),style:o}):r.jsx("span",{"data-supports-mask":l,className:nt(Na.svg,i),style:{"--svg":Xd(e),"--fill":t,"--hover-fill":n,...o??{}}})},Yd={"top-left":je.topLeftAlignment,"top-center":je.topCenterAlignment,"top-right":je.topRightAlignment,"middle-left":je.middleLeftAlignment,"middle-center":je.middleCenterAlignment,"middle-right":je.middleRightAlignment,"bottom-left":je.bottomLeftAlignment,"bottom-center":je.bottomCenterAlignment,"bottom-right":je.bottomRightAlignment};function Jd({settings:e,content:t,styles:n,isEditor:i}){const[o,l]=a.useState(null),{widthSettings:s,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:m,fontSizeLineHeight:y,textAppearance:L,color:T}=n.imageCaption??{},[h,v]=a.useState(void 0),[w,I]=a.useState(null),[R,A]=a.useState(0),[H,b]=a.useState(0),{direction:O,transition:M,controls:C,pagination:q,imageCaption:f,triggers:W}=e,_=a.useRef(M.type),{x:B,y:ee}=e.controls.offset,ne=G=>{o&&o.go(G)};return a.useEffect(()=>{if(!w)return;const G=new ResizeObserver(D=>{if(!o)return;const[z]=D;v({width:Math.round(z.contentRect.width),height:Math.round(z.contentRect.height)})});return G.observe(w),()=>G.unobserve(w)},[w]),a.useEffect(()=>{!o||_.current===M.type||(b(G=>G+1),_.current=M.type)},[M.type]),r.jsx("div",{className:nt(je.wrapper,{[je.editor]:i}),ref:I,children:r.jsxs("div",{className:je.sliderInner,style:{width:h?h.width:"100%",height:h?h.height:"100%",backgroundColor:M.backgroundColor&&M.type==="fade in"?M.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:nt(je.captionBlock),children:r.jsx("div",{className:je.captionTextWrapper,children:t.map((G,D)=>r.jsx("div",{className:nt(je.captionText,Yd[f.alignment],{[je.withPointerEvents]:D===R&&i,[je.active]:D===R}),style:{fontFamily:or(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:s.sizing==="auto"?"max-content":F.scalingValue(s.width,i),letterSpacing:F.scalingValue(c,i),wordSpacing:F.scalingValue(m,i),textAlign:u,fontSize:F.scalingValue(y.fontSize,i),lineHeight:F.scalingValue(y.lineHeight,i),textTransform:L.textTransform??"none",textDecoration:L.textDecoration??"none",fontVariant:L.fontVariant??"normal",color:T,transitionDuration:M.duration?`${Math.round(parseInt(M.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:je.captionTextInner,style:{"--link-hover-color":f.linkHoverColor,"--link-color":f.linkColor,position:"relative",top:F.scalingValue(f.offset.y,i),left:F.scalingValue(f.offset.x,i)},children:r.jsx(Si,{content:G.imageCaption})})},D))})}),r.jsx(ua,{onMove:G=>{A(G.index)},ref:l,options:{arrows:!1,speed:M.duration?parseInt(M.duration):500,autoplay:W.autoPlay!==null,...W.autoPlay!==null&&{interval:parseInt(W.autoPlay)*1e3},direction:O==="horiz"||M.type==="fade in"?"ltr":"ttb",pagination:!1,drag:W.triggersList.drag,perPage:1,width:h?h.width:"100%",height:h?h.height:"100%",type:M.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((G,D)=>r.jsx(pa,{children:r.jsx("div",{className:je.sliderItem,children:r.jsx("div",{className:je.imgWrapper,children:r.jsx("img",{className:nt(je.sliderImage,{[je.contain]:G.image.objectFit==="contain",[je.cover]:G.image.objectFit==="cover"}),src:G.image.url,alt:G.image.name??""})})})},D))},H),C.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:nt(je.arrow,{[je.arrowVertical]:O==="vert",[je.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:r.jsxs("button",{onClick:()=>{ne("-1")},className:je.arrowInner,style:{transform:`translate(${F.scalingValue(B,i)}, ${F.scalingValue(ee*(O==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${O==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&r.jsx(Zt,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:nt(je.arrowImg,je.mirror)}),!C.arrowsImgUrl&&r.jsx(Ha,{color:C.color,className:nt(je.arrowIcon,je.arrowImg,je.mirror)})]})}),r.jsx("div",{className:nt(je.arrow,je.nextArrow,{[je.arrowVertical]:O==="vert",[je.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:r.jsxs("button",{className:je.arrowInner,onClick:()=>ne("+1"),style:{transform:`translate(${F.scalingValue(B*(O==="horiz"?-1:1),i)}, ${F.scalingValue(ee,i)}) scale(${e.controls.scale/100}) rotate(${O==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&r.jsx(Zt,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:je.arrowImg}),!C.arrowsImgUrl&&r.jsx(Ha,{color:C.color,className:nt(je.arrowIcon,je.arrowImg)})]})})]}),W.triggersList.click&&r.jsx("div",{className:je.clickOverlay,onClick:()=>{o&&o.go("+1")}}),q.isActive&&r.jsx("div",{className:nt(je.pagination,{[je.paginationInsideBottom]:q.position==="inside-1"&&O==="horiz",[je.paginationInsideTop]:q.position==="inside-2"&&O==="horiz",[je.paginationOutsideBottom]:q.position==="outside-1"&&O==="horiz",[je.paginationOutsideTop]:q.position==="outside-2"&&O==="horiz",[je.paginationInsideLeft]:q.position==="inside-1"&&O==="vert",[je.paginationInsideRight]:q.position==="inside-2"&&O==="vert",[je.paginationOutsideLeft]:q.position==="outside-1"&&O==="vert",[je.paginationOutsideRight]:q.position==="outside-2"&&O==="vert",[je.paginationVertical]:O==="vert"}),children:r.jsx("div",{className:je.paginationInner,style:{backgroundColor:q.colors[2],transform:`scale(${q.scale/100}) translate(${F.scalingValue(q.offset.x,i)}, ${F.scalingValue(q.offset.y,i)}) rotate(${O==="horiz"?"0deg":"90deg"})`},children:t.map((G,D)=>r.jsx("button",{onClick:()=>{o&&o.go(D)},className:nt(je.paginationItem),children:r.jsx("div",{className:nt(je.dot,{[je.activeDot]:D===R}),style:{backgroundColor:D===R?q.colors[0]:q.colors[1],"--pagination-hover-color":q.hover}})},D))})})]})})}function Ha({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 Zd={element:Jd,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"]}},Qd="ImageRevealSlider-module__imageRevealSlider___UE5Ob",eu="ImageRevealSlider-module__image___Qjt-e",tu="ImageRevealSlider-module__link___N-iLG",nu="ImageRevealSlider-module__cursor___2U03d",di={imageRevealSlider:Qd,image:eu,link:tu,cursor:nu};function Oa(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const l=i.width?Number.parseFloat(i.width):o.naturalWidth,s=o.naturalHeight/o.naturalWidth*l,d=l/2,c=s/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 iu(e,t,n,i){let o,l;if(t==="custom"){o=n;const s=await vr(e);l=s.height/s.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const s=await vr(e);l=s.height/s.width*o}else{const s=await vr(e);o=s.width,l=s.height}return{width:o,height:l,finalWidth:`${o}px`}}function ou({settings:e,content:t,isEditor:n}){const[i,o]=a.useState(null),[l,s]=a.useState([]),[d,c]=a.useState(0),u=a.useRef(0),[m,y]=a.useState({x:0,y:0}),[L,T]=a.useState(1),[h,v]=a.useState("none"),w=a.useRef({x:0,y:0}),[I,R]=a.useState(!1),{sizeType:A,imageWidth:H,randomRangeImageWidth:b}=e.imageSize,{revealPosition:O,visible:M}=e.position,{cursorType:C,target:q,defaultCursorScale:f,defaultCursor:W,hoverCursorScale:_,hoverCursor:B}=e.cursor;a.useEffect(()=>{if(!i)return;const G=(P,S)=>{const K=i.getBoundingClientRect(),Z=P-K.left,U=S-K.top;if(y({x:Z,y:U}),C==="system"){v("none"),T(1);return}const N=Z,pe=U,g=document.elementFromPoint(K.left+N,K.top+pe);if(g&&g.closest("a")){v("none"),T(1);return}const ue=Oa(N,pe,l)||q==="area"?{img:B??"none",scale:_}:{img:W??"none",scale:f};v(ue.img),T(ue.scale)},D=P=>{P.stopPropagation(),w.current={x:P.clientX,y:P.clientY},G(P.clientX,P.clientY)},z=()=>{I&&G(w.current.x,w.current.y)};return i.addEventListener("mousemove",D),window.addEventListener("scroll",z,!0),()=>{i.removeEventListener("mousemove",D),window.removeEventListener("scroll",z,!0)}},[i,I,m,C,q,B,W,_,f,l]),a.useEffect(()=>{I||(v("none"),T(0))},[I]);const ee=async(G,D,z,P={})=>{const{width:S,height:K,finalWidth:Z}=await iu(G.image.url,A,H,b);let U=0,N=0;O==="same"?(U=D/2,N=z/2):(U=P.x??Math.random()*D,N=P.y??Math.random()*z);const pe=Math.min(Math.max(U,S/2),D-S/2),g=Math.min(Math.max(N,K/2),z-K/2);return{id:u.current++,url:G.image.url,link:G.link,name:G.image.name,x:pe,y:g,width:Z}};a.useEffect(()=>{if(!i||t.length===0)return;const G=i.getBoundingClientRect(),D=G.width,z=G.height,P=[];(async()=>{const K=t[0],Z=await ee(K,D,z);P.push(Z),s(P),c(1)})()},[A,H,b,O,i]),a.useEffect(()=>{M==="last One"&&s(G=>G.length>0?[G[G.length-1]]:[])},[M]);const ne=async G=>{if(!i)return;const D=i.getBoundingClientRect(),z=G.clientX-D.left,P=G.clientY-D.top;if(q==="image"&&!Oa(z,P,l))return;let S=0,K=0;O==="on Click"?(S=z,K=P):O==="same"?(S=D.width/2,K=D.height/2):(S=Math.random()*D.width,K=Math.random()*D.height);const Z=t[d],U=await ee(Z,D.width,D.height,{x:S,y:K});s(N=>M==="all"?[...N,U]:[U]),c(N=>N>=t.length-1?0:N+1)};return r.jsxs("div",{ref:o,onClick:ne,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),className:di.imageRevealSlider,style:{cursor:h==="none"?"default":"none"},children:[l.map(G=>r.jsx("div",{className:di.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:q==="area"&&G.link?r.jsx("a",{href:G.link,target:"_blank",className:di.link,children:r.jsx("img",{src:G.url,alt:G.name,className:di.image},G.id)}):r.jsx("img",{src:G.url,alt:G.name,className:di.image},G.id)},G.id)),I&&r.jsx("div",{className:di.cursor,style:{left:`${m.x}px`,top:`${m.y}px`,transform:`translate(-50%, -50%) scale(${L})`,backgroundImage:`url('${h}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const ru={element:ou,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:""}]}}}},au="LightBox-module__hidden___9s-9x",su="LightBox-module__heroImage___sTxNF",lu="LightBox-module__background___rm9ml",cu="LightBox-module__editor___4ACaY",du="LightBox-module__contentStyle___Bgnsq",uu="LightBox-module__imageStyle___tLIlB",pu="LightBox-module__imgWrapper___LuFUp",mu="LightBox-module__contain___8-yaS",gu="LightBox-module__cover___hNvOG",hu="LightBox-module__caption___b6L2I",fu="LightBox-module__captionTextInner___rCGNH",yu="LightBox-module__lightboxSplide___XFuWC",vu="LightBox-module__arrow___iz38X",xu="LightBox-module__arrowVertical___Zfz81",bu="LightBox-module__nextArrow___zkAQN",wu="LightBox-module__arrowInner___p48sW",Su="LightBox-module__arrowIcon___3VaFf",$u="LightBox-module__arrowImg___pNV88",Cu="LightBox-module__mirror___pjeXc",Tu="LightBox-module__thumbsWrapper___GB-nU",Lu="LightBox-module__thumbsContainerVertical___wttk5",Iu="LightBox-module__thumbsContainer___osSma",Eu="LightBox-module__thumbsAlignStart___MO6tY",Ru="LightBox-module__thumbsAlignCenter___Q4sUx",Mu="LightBox-module__thumbsAlignEnd___p4y9R",Pu="LightBox-module__thumbItem___HvnF3",ku="LightBox-module__closeButton___g2khP",Au="LightBox-module__fadeIn___0m5GW",Wu="LightBox-module__slideInLeft___gPYwC",_u="LightBox-module__slideInRight___S-pPp",Fu="LightBox-module__slideInTop___DFdAj",Nu="LightBox-module__slideInBottom___m27kZ",Hu="LightBox-module__fadeOut___55qBR",Ou="LightBox-module__slideOutLeft___NvU7P",ju="LightBox-module__slideOutRight___SK7eC",Bu="LightBox-module__slideOutTop___Vgg0z",zu="LightBox-module__slideOutBottom___nJ0Ef",Du="LightBox-module__scaleSlide___vZriG",Re={hidden:au,heroImage:su,background:lu,editor:cu,contentStyle:du,imageStyle:uu,imgWrapper:pu,contain:mu,cover:gu,caption:hu,captionTextInner:fu,lightboxSplide:yu,arrow:vu,arrowVertical:xu,nextArrow:bu,arrowInner:wu,arrowIcon:Su,arrowImg:$u,mirror:Cu,thumbsWrapper:Tu,thumbsContainerVertical:Lu,thumbsContainer:Iu,thumbsAlignStart:Eu,thumbsAlignCenter:Ru,thumbsAlignEnd:Mu,thumbItem:Pu,closeButton:ku,fadeIn:Au,slideInLeft:Wu,slideInRight:_u,slideInTop:Fu,slideInBottom:Nu,fadeOut:Hu,slideOutLeft:Ou,slideOutRight:ju,slideOutTop:Bu,slideOutBottom:zu,scaleSlide:Du},xo=(e,t,n)=>{const i={},[o,l]=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"),l==="left"?(i.left="0",i.right="auto"):l==="center"?(i.left="50%",i.right="auto"):l==="right"&&(i.left="auto",i.right="0"),o==="middle"&&l==="center"?i.transform=`translate(calc(-50% + ${F.scalingValue(t.x,n)}), calc(-50% + ${F.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${F.scalingValue(t.x,n)}, calc(-50% + ${F.scalingValue(t.y,n)}))`:l==="center"?i.transform=`translate(calc(-50% + ${F.scalingValue(t.x,n)}), ${F.scalingValue(t.y,n)})`:i.transform=`translate(${F.scalingValue(t.x,n)}, ${F.scalingValue(t.y,n)})`,i};function fl(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 ja(e){const t=e.getBoundingClientRect(),n=fl(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),l=e.naturalWidth,s=e.naturalHeight,d=i/o,c=l/s;let u,m;c>d?(u=i,m=i/c):(m=o,u=o*c);const y=t.left+n.left,L=t.top+n.top,T=(i-u)/2+y,h=(o-m)/2+L;return{x:T,y:h,width:u,height:m}}function Ba(e){const t=e.getBoundingClientRect(),n=fl(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function za(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 Vu(e,t){const n=(()=>{if(e==="fade in")return Re.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Re.slideInLeft;case"right":return Re.slideInRight;case"top":return Re.slideInTop;case"bottom":return Re.slideInBottom;default:return Re.slideInRight}return Re.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Re.fadeIn;if(e==="slide in")switch(t){case"left":return Re.slideInLeft;case"right":return Re.slideInRight;case"top":return Re.slideInTop;case"bottom":return Re.slideInBottom;default:return Re.slideInRight}return Re.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Re.fadeOut;if(e==="slide in")switch(t){case"left":return Re.slideOutLeft;case"right":return Re.slideOutRight;case"top":return Re.slideOutTop;case"bottom":return Re.slideOutBottom;default:return Re.slideOutRight}return Re.fadeOut})(),l=(()=>{if(e==="fade in")return Re.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Re.slideOutLeft;case"right":return Re.slideOutRight;case"top":return Re.slideOutTop;case"bottom":return Re.slideOutBottom;default:return Re.slideOutRight}return Re.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:l}}const qu=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:l,isPreviewMode:s})=>{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:Re.heroImage,onClick:()=>c(!0)}),r.jsx(Gu,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:l})]})},Gu=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:l,isEditor:s,metadata:d})=>{var _e;const{widthSettings:c,fontSettings:u,letterSpacing:m,textAlign:y,wordSpacing:L,fontSizeLineHeight:T,textAppearance:h,color:v}=i.imageCaption??{},[w,I]=a.useState(0),[R,A]=a.useState(0),[H,b]=a.useState(!1),[O,M]=a.useState(!1),[C,q]=a.useState({}),f=a.useRef(null),W=a.useRef(null),_=a.useRef(null),B=a.useRef(!1),ee=a.useRef(null),ne=a.useRef(null),G=a.useRef(null),D=a.useRef(null),z=a.useRef(!1),P=a.useRef(null),[S,K]=a.useState(!1),{appear:Z,triggers:U,slider:N,thumbnail:pe,controls:g,area:ue,caption:ve,layout:ge}=o.lightboxBlock,{appearClass:Ee,backdropAppearClass:te,backdropDisappearClass:me,disappearClass:J}=Vu(Z.type,Z.direction),be=(d==null?void 0:d.itemId)??null;a.useEffect(()=>{const $=()=>{setTimeout(()=>{var E,X;(X=(E=f.current)==null?void 0:E.splide)==null||X.refresh()},16)},ae=()=>{A(E=>E+1)};return window.addEventListener("ArticleEditor.Layout:change",$),window.addEventListener("ArticleEditor.ComponentContent:change",ae),()=>{window.removeEventListener("ArticleEditor.Layout:change",$),window.removeEventListener("ArticleEditor.ComponentContent:change",ae)}},[]),a.useEffect(()=>{if(!e||!pe.isActive){K(!1);return}const $=P.current;if(!$)return;const ae=()=>{N.direction==="horiz"?K($.scrollWidth>$.clientWidth):K($.scrollHeight>$.clientHeight)};ae();const E=new ResizeObserver(ae);return E.observe($),()=>E.disconnect()},[e,pe.isActive,n.length,C,N.direction]);const le=a.useCallback(()=>{const $=window.matchMedia("(max-width: 768px)").matches,ae=za(ue.color);$&&!s&&ae>.9&&(document.body.style.backgroundColor=""),b(!0),B.current=!0;const E=X=>{X.target===ee.current&&X.animationName&&(ee.current&&ne.current&&ee.current.removeEventListener("animationend",ne.current),ne.current=null,B.current&&(B.current=!1,t()),b(!1))};ee.current&&(ne.current=E,ee.current.addEventListener("animationend",E))},[t,ue.color,s]),ce=($,ae,E)=>{var X,Y;if($){if(U.type==="click"&&U.switch==="image")U.repeat==="close"&&w===n.length-1?le():(X=f.current)==null||X.go("+1");else if(U.type==="click"&&U.switch==="50/50"){const se=$.getBoundingClientRect(),de=ae-se.left,fe=E-se.top,Ne=se.width,We=se.height;let j;N.direction==="horiz"?j=de<Ne/2?"-1":"+1":j=fe<We/2?"-1":"+1",(Y=f.current)==null||Y.go(j)}}},re=$=>{if(z.current){z.current=!1;return}const ae=n[w],E=(ae==null?void 0:ae.image.objectFit)==="cover";let X,Y;if("changedTouches"in $&&$.changedTouches.length>0)X=$.changedTouches[0].clientX,Y=$.changedTouches[0].clientY;else if("clientX"in $)X=$.clientX,Y=$.clientY;else return;let se;if(E&&_.current){const de=Ba(_.current);se=X>=de.left&&X<=de.right&&Y>=de.top&&Y<=de.bottom}else{const de=_.current?ja(_.current):null;if(!de){$.target===$.currentTarget&&le();return}se=X>=de.x&&X<=de.x+de.width&&Y>=de.y&&Y<=de.y+de.height}se?ce(_.current,X,Y):le()},Ie=$=>{const ae=$.target;(ae.classList.contains(Re.thumbsWrapper)||ae.classList.contains(Re.thumbsContainer))&&re($)};a.useEffect(()=>{if(!e)return;const $=ae=>{var E,X;if(ae.key==="Escape"){le();return}if(ae.key==="ArrowRight"){I(Y=>(Y+1)%Math.max(n.length,1)),(E=f.current)==null||E.go("+1");return}ae.key==="ArrowLeft"&&(I(Y=>(Y-1+Math.max(n.length,1))%Math.max(n.length,1)),(X=f.current)==null||X.go("-1"))};return window.addEventListener("keydown",$),()=>{window.removeEventListener("keydown",$)}},[e,le,n.length]),a.useEffect(()=>{if(e){if(I(0),A(ae=>ae+1),B.current=!1,b(!1),M(!1),q({}),!be)return;const $=new CustomEvent("page-overlay",{detail:{itemId:be}});window.dispatchEvent($)}return()=>{ee.current&&ne.current&&(ee.current.removeEventListener("animationend",ne.current),ne.current=null),M(!1)}},[e,be]),a.useEffect(()=>{W.current!==null&&W.current!==N.type&&A($=>$+1),W.current=N.type},[N.type]),a.useEffect(()=>{if(!e)return;const $=document.body.style.overflow,ae=window.matchMedia("(max-width: 768px)").matches,E=za(ue.color);document.body.style.overflow="hidden",M(!1);const X=se=>{se.target===ee.current&&!B.current&&se.animationName&&(ae&&!s&&E>.9&&(document.body.style.backgroundColor=ue.color),M(!0),ee.current&&G.current&&ee.current.removeEventListener("animationend",G.current),G.current=null)};ee.current&&(G.current=X,ee.current.addEventListener("animationend",X));const Y=se=>{const de=se.target;de&&(de.closest(`.${Re.thumbsWrapper}`)||de.closest(`.${Re.thumbsContainer}`))||N.type!=="slide"&&se.preventDefault()};return document.addEventListener("touchmove",Y,{passive:!1}),()=>{document.body.style.overflow=$,document.removeEventListener("touchmove",Y),ee.current&&G.current&&(ee.current.removeEventListener("animationend",G.current),G.current=null),M(!1)}},[e,s,ue.color,N.type]),a.useEffect(()=>{if(!e)return;const $=ae=>{var X,Y;if(B.current){ae.stopPropagation();return}if(z.current){z.current=!1;return}const E=ae.target;if(!(E&&(E.closest(`.${Re.thumbsContainer}`)||E.closest(`.${Re.thumbItem}`)||E.closest(`.${Re.arrow}`)||E.closest(`.${Re.closeButton}`)||E.closest(`.${Re.caption}`)))){if(N.type==="slide"&&U.type==="drag"&&((Y=(X=f.current)==null?void 0:X.splide)!=null&&Y.root)){const se=f.current.splide.root;if(E&&(se.contains(E)||se===E))return}if(ae.touches.length===0&&ae.changedTouches.length>0){const se=n[w],de=(se==null?void 0:se.image.objectFit)==="cover",fe=ae.changedTouches[0];let Ne;if(de&&_.current){const We=Ba(_.current);Ne=fe.clientX>=We.left&&fe.clientX<=We.right&&fe.clientY>=We.top&&fe.clientY<=We.bottom}else{const We=_.current?ja(_.current):null;if(!We)return;Ne=fe.clientX>=We.x&&fe.clientX<=We.x+We.width&&fe.clientY>=We.y&&fe.clientY<=We.y+We.height}if(!Ne){ae.stopPropagation(),B.current=!0;const We=j=>{j.stopPropagation(),j.preventDefault(),document.removeEventListener("click",We,!0)};document.addEventListener("click",We,!0),le()}}}};return document.addEventListener("touchend",$,{passive:!0}),()=>{document.removeEventListener("touchend",$)}},[e,le,w,n]);const ke=(N.type==="scale"||N.type==="fade")&&N.direction==="vert"&&U.type==="drag";a.useEffect(()=>{var j,Ce;if(!e||!ke||!((Ce=(j=f.current)==null?void 0:j.splide)!=null&&Ce.root))return;const $=f.current.splide.root,ae=30,E=(Q,he)=>{if(D.current){const $e=Math.abs(Q-D.current.x),Oe=Math.abs(he-D.current.y);($e>0||Oe>0)&&(z.current=!0)}},X=Q=>{D.current&&(Q.preventDefault(),E(Q.clientX,Q.clientY))},Y=Q=>{D.current&&Q.touches.length>0&&(Q.preventDefault(),E(Q.touches[0].clientX,Q.touches[0].clientY))},se=(Q,he)=>{if(!D.current||!f.current){D.current=null;return}const $e=Math.abs(Q-D.current.x),Oe=Math.abs(he-D.current.y);Oe>ae&&Oe>$e&&f.current.go(he<D.current.y?"+1":"-1"),D.current=null},de=Q=>{D.current&&se(Q.clientX,Q.clientY),document.removeEventListener("pointerup",de),document.removeEventListener("pointercancel",de),document.removeEventListener("pointermove",X)},fe=Q=>{if(D.current){if(Q.changedTouches.length>0){const he=Q.changedTouches[0];se(he.clientX,he.clientY)}document.removeEventListener("touchend",fe),document.removeEventListener("touchcancel",fe),document.removeEventListener("touchmove",Y)}},Ne=Q=>{D.current={x:Q.clientX,y:Q.clientY},z.current=!1,document.addEventListener("pointermove",X,{passive:!1}),document.addEventListener("pointerup",de),document.addEventListener("pointercancel",de)},We=Q=>{Q.touches.length>0&&(D.current={x:Q.touches[0].clientX,y:Q.touches[0].clientY},z.current=!1,document.addEventListener("touchmove",Y,{passive:!1}),document.addEventListener("touchend",fe),document.addEventListener("touchcancel",fe))};return $.addEventListener("pointerdown",Ne),$.addEventListener("touchstart",We),()=>{$.removeEventListener("pointerdown",Ne),$.removeEventListener("touchstart",We),document.removeEventListener("pointermove",X),document.removeEventListener("pointerup",de),document.removeEventListener("pointercancel",de),document.removeEventListener("touchmove",Y),document.removeEventListener("touchend",fe),document.removeEventListener("touchcancel",fe),D.current=null,z.current=!1}},[e,ke,R]);const Le={backgroundColor:ue.color,backdropFilter:`blur(${ue.blur}px)`,animationDuration:`${parseInt(Z.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(l)?null:Mi.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:s?null:ee,className:nt(Re.background,H?me:te,{[Re.editor]:s},{[Re.hidden]:!e}),style:{...Le,...O&&!s&&!H?{position:"absolute"}:{}}}),r.jsxs("div",{ref:s?ee:null,className:nt(Re.contentStyle,H?J:Ee,{[Re.editor]:s},{[Re.hidden]:!e}),style:{animationDuration:`${parseInt(Z.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(ua,{onMove:$=>I($.index),ref:f,className:Re.lightboxSplide,options:{arrows:!1,speed:N.duration?parseInt(N.duration):500,direction:N.direction==="horiz"||N.type==="fade"||N.type==="scale"?"ltr":"ttb",pagination:!1,drag:U.type==="drag"&&!ke,perPage:1,width:"100%",height:"100%",type:N.type==="fade"||N.type==="scale"?"fade":"loop",padding:0,rewind:U.repeat!=="close",start:0},style:{"--splide-speed":N.duration},children:n.map(($,ae)=>{const E=xo(ge.position,ge.offset,s),X=`${F.scalingValue(ge.padding.top,s)} ${F.scalingValue(ge.padding.right,s)} ${F.scalingValue(ge.padding.bottom,s)} ${F.scalingValue(ge.padding.left,s)}`,Y=N.type==="scale"?(()=>{const{transform:se,...de}=E;return{...de,position:"absolute",padding:X,boxSizing:"border-box","--position-transform":se||"none"}})():{...E,position:"absolute",padding:X,boxSizing:"border-box"};return r.jsx(pa,{children:r.jsx("div",{className:Re.imgWrapper,onClick:re,children:r.jsx("img",{ref:ae===w?_:null,className:nt(Re.imageStyle,{[Re.contain]:$.image.objectFit==="contain",[Re.cover]:$.image.objectFit==="cover",[Re.scaleSlide]:N.type==="scale"}),src:$.image.url,alt:$.image.name??"",style:{...Y,pointerEvents:$.image.objectFit==="contain"?"none":"auto"}})})},ae)})},R),g.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:nt(Re.arrow,{[Re.arrowVertical]:N.direction==="vert"}),style:{color:g.color,"--arrow-hover-color":g.hover},children:r.jsxs("button",{className:Re.arrowInner,style:{transform:`translate(${F.scalingValue(g.offset.x,s)}, ${F.scalingValue(g.offset.y*(N.direction==="horiz"?1:-1),s)}) scale(${g.scale}) rotate(${N.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var $;return($=f.current)==null?void 0:$.go("-1")},"aria-label":"Previous",children:[g.arrowsImgUrl&&r.jsx(Zt,{url:g.arrowsImgUrl,fill:g.color,hoverFill:g.hover,className:nt(Re.arrowImg,Re.mirror)}),!g.arrowsImgUrl&&r.jsx(Da,{color:g.color,className:nt(Re.arrowIcon,Re.arrowImg,Re.mirror)})]})}),r.jsx("div",{className:nt(Re.arrow,Re.nextArrow,{[Re.arrowVertical]:N.direction==="vert"}),style:{color:g.color,"--arrow-hover-color":g.hover},children:r.jsxs("button",{className:Re.arrowInner,style:{transform:`translate(${F.scalingValue(g.offset.x*(N.direction==="horiz"?-1:1),s)}, ${F.scalingValue(g.offset.y,s)}) scale(${g.scale}) rotate(${N.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var $;return($=f.current)==null?void 0:$.go("+1")},"aria-label":"Next",children:[g.arrowsImgUrl&&r.jsx(Zt,{url:g.arrowsImgUrl,fill:g.color,hoverFill:g.hover,className:Re.arrowImg}),!g.arrowsImgUrl&&r.jsx(Da,{color:g.color,className:nt(Re.arrowIcon,Re.arrowImg)})]})})]}),ue.closeIconUrl&&(()=>{const $=xo(ue.closeIconAlign,ue.closeIconOffset,s),ae=`scale(${ue.closeIconScale})`,E=$.transform?`${$.transform} ${ae}`:ae;return r.jsx("button",{className:Re.closeButton,style:{...$,transform:E},onClick:le,"aria-label":"Close lightbox",children:r.jsx(Zt,{url:ue.closeIconUrl,fill:ue.closeIconColor??"#000000",hoverFill:ue.closeIconHover??"#cccccc"})})})(),ve&&ve.isActive&&i.imageCaption&&((_e=n[w])==null?void 0:_e.imageCaption)&&r.jsx("div",{className:Re.caption,style:{...xo(ve.alignment,ve.offset,s),fontFamily:or(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":F.scalingValue(c.width,s),letterSpacing:F.scalingValue(m,s),wordSpacing:F.scalingValue(L,s),textAlign:y,fontSize:F.scalingValue(T.fontSize,s),lineHeight:F.scalingValue(T.lineHeight,s),textTransform:h.textTransform??"none",textDecoration:h.textDecoration??"none",fontVariant:h.fontVariant??"normal",color:v},onClick:$=>$.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:Re.captionTextInner,style:{"--link-color":ve.linkColor,"--link-hover-color":ve.linkHoverColor},children:r.jsx(Si,{content:n[w].imageCaption})})}),pe.isActive&&(()=>{const[$,ae]=pe.position.split("-"),E=N.direction==="horiz"?`${$}-left`:pe.position,X=xo(E,pe.offset,s),Y=()=>{if(N.direction==="horiz"){if(ae==="left")return"flex-start";if(ae==="center")return"center";if(ae==="right")return"flex-end"}else{if($==="top")return"flex-start";if($==="middle")return"center";if($==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:P,className:Re.thumbsWrapper,onClick:se=>Ie(se),style:{position:s?"absolute":"fixed",...X,...N.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:nt(Re.thumbsContainer,{[Re.thumbsContainerVertical]:N.direction==="vert",[Re.thumbsAlignStart]:pe.align==="start",[Re.thumbsAlignCenter]:pe.align==="center",[Re.thumbsAlignEnd]:pe.align==="end"}),style:{gap:F.scalingValue(pe.grid.gap,s),justifyContent:S?"flex-start":Y()},children:n.map((se,de)=>{const fe=de===w,Ne=C[de],j=pe.grid.size*(fe?pe.activeState.scale:1),Ce=()=>{if(pe.fit!=="fit")return{};if(!Ne)return N.direction==="horiz"?{height:F.scalingValue(j,s)}:{width:F.scalingValue(j,s)};const Q=Ne.width/Ne.height;if(N.direction==="horiz"){const he=j,$e=he*Q;return{width:F.scalingValue($e,s),height:F.scalingValue(he,s)}}else{const he=j,$e=he/Q;return{width:F.scalingValue(he,s),height:F.scalingValue($e,s)}}};return r.jsx("button",{className:Re.thumbItem,style:{...N.direction==="horiz"&&pe.fit!=="fit"?{height:F.scalingValue(j,s)}:{},...N.direction==="vert"&&pe.fit!=="fit"?{width:F.scalingValue(j,s)}:{},...pe.fit==="cover"?{width:F.scalingValue(j,s),height:F.scalingValue(j,s)}:{},...Ce(),transition:fe?"all 0.25s ease-out":"none",opacity:fe?pe.activeState.opacity/100:pe.opacity/100,"--thumb-hover":pe.activeState.opacity/100},onClick:Q=>{var he;Q.stopPropagation(),I(de),(he=f.current)==null||he.go(de)},onMouseEnter:()=>{var Q;pe.triggers==="hov"&&((Q=f.current)==null||Q.go(de))},children:r.jsx("img",{src:se.image.url,alt:se.image.name??"",onLoad:Q=>{const he=Q.currentTarget;he.naturalWidth&&he.naturalHeight&&q($e=>({...$e,[de]:{width:he.naturalWidth,height:he.naturalHeight}}))},style:{objectFit:pe.fit==="cover"?"cover":"contain",...pe.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...pe.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${se.image.name}-${de}`)})})})})()]})]}),document.getElementById(l))};function Da({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 Ku={element:qu,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 bo(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Uu(e){return`
|
|
6
|
+
*/const zd="RichTextRenderer-module__link___BWeZ2",Dd={link:zd},Vd=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))},or=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Vd(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function Jt(e){const{color:t,...n}=e;return n}function _t(e,t){var o,l,s;const{fontSize:n,lineHeight:i}=e;return{fontFamily:or(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:_.scalingValue(e.letterSpacing,t),wordSpacing:_.scalingValue(e.wordSpacing,t),fontSize:_.scalingValue(n,t),lineHeight:i!==void 0?_.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(l=e.textAppearance)==null?void 0:l.textDecoration,fontVariant:(s=e.textAppearance)==null?void 0:s.fontVariant,textAlign:e.textAlign,color:e.color}}const Si=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:Dd.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:qd(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 qd(e){return{...e.fontFamily&&{fontFamily:or(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 Gd="SvgImage-module__svg___q3xE-",Kd="SvgImage-module__img___VsTm-",Na={svg:Gd,img:Kd},Ud=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},Xd=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,Zt=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[l,s]=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("")');s(d)}},[]),!Ud(e)||!l?r.jsx("img",{src:e,alt:"",className:nt(Na.img,i),style:o}):r.jsx("span",{"data-supports-mask":l,className:nt(Na.svg,i),style:{"--svg":Xd(e),"--fill":t,"--hover-fill":n,...o??{}}})},Yd={"top-left":je.topLeftAlignment,"top-center":je.topCenterAlignment,"top-right":je.topRightAlignment,"middle-left":je.middleLeftAlignment,"middle-center":je.middleCenterAlignment,"middle-right":je.middleRightAlignment,"bottom-left":je.bottomLeftAlignment,"bottom-center":je.bottomCenterAlignment,"bottom-right":je.bottomRightAlignment};function Jd({settings:e,content:t,styles:n,isEditor:i}){const[o,l]=a.useState(null),{widthSettings:s,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:m,fontSizeLineHeight:y,textAppearance:L,color:T}=n.imageCaption??{},[h,v]=a.useState(void 0),[w,I]=a.useState(null),[R,A]=a.useState(0),[H,b]=a.useState(0),{direction:O,transition:M,controls:C,pagination:q,imageCaption:f,triggers:W}=e,F=a.useRef(M.type),{x:B,y:ee}=e.controls.offset,ne=G=>{o&&o.go(G)};return a.useEffect(()=>{if(!w)return;const G=new ResizeObserver(D=>{if(!o)return;const[z]=D;v({width:Math.round(z.contentRect.width),height:Math.round(z.contentRect.height)})});return G.observe(w),()=>G.unobserve(w)},[w]),a.useEffect(()=>{!o||F.current===M.type||(b(G=>G+1),F.current=M.type)},[M.type]),r.jsx("div",{className:nt(je.wrapper,{[je.editor]:i}),ref:I,children:r.jsxs("div",{className:je.sliderInner,style:{width:h?h.width:"100%",height:h?h.height:"100%",backgroundColor:M.backgroundColor&&M.type==="fade in"?M.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:nt(je.captionBlock),children:r.jsx("div",{className:je.captionTextWrapper,children:t.map((G,D)=>r.jsx("div",{className:nt(je.captionText,Yd[f.alignment],{[je.withPointerEvents]:D===R&&i,[je.active]:D===R}),style:{fontFamily:or(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:s.sizing==="auto"?"max-content":_.scalingValue(s.width,i),letterSpacing:_.scalingValue(c,i),wordSpacing:_.scalingValue(m,i),textAlign:u,fontSize:_.scalingValue(y.fontSize,i),lineHeight:_.scalingValue(y.lineHeight,i),textTransform:L.textTransform??"none",textDecoration:L.textDecoration??"none",fontVariant:L.fontVariant??"normal",color:T,transitionDuration:M.duration?`${Math.round(parseInt(M.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:je.captionTextInner,style:{"--link-hover-color":f.linkHoverColor,"--link-color":f.linkColor,position:"relative",top:_.scalingValue(f.offset.y,i),left:_.scalingValue(f.offset.x,i)},children:r.jsx(Si,{content:G.imageCaption})})},D))})}),r.jsx(ua,{onMove:G=>{A(G.index)},ref:l,options:{arrows:!1,speed:M.duration?parseInt(M.duration):500,autoplay:W.autoPlay!==null,...W.autoPlay!==null&&{interval:parseInt(W.autoPlay)*1e3},direction:O==="horiz"||M.type==="fade in"?"ltr":"ttb",pagination:!1,drag:W.triggersList.drag,perPage:1,width:h?h.width:"100%",height:h?h.height:"100%",type:M.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((G,D)=>r.jsx(pa,{children:r.jsx("div",{className:je.sliderItem,children:r.jsx("div",{className:je.imgWrapper,children:r.jsx("img",{className:nt(je.sliderImage,{[je.contain]:G.image.objectFit==="contain",[je.cover]:G.image.objectFit==="cover"}),src:G.image.url,alt:G.image.name??""})})})},D))},H),C.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:nt(je.arrow,{[je.arrowVertical]:O==="vert",[je.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:r.jsxs("button",{onClick:()=>{ne("-1")},className:je.arrowInner,style:{transform:`translate(${_.scalingValue(B,i)}, ${_.scalingValue(ee*(O==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${O==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&r.jsx(Zt,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:nt(je.arrowImg,je.mirror)}),!C.arrowsImgUrl&&r.jsx(Ha,{color:C.color,className:nt(je.arrowIcon,je.arrowImg,je.mirror)})]})}),r.jsx("div",{className:nt(je.arrow,je.nextArrow,{[je.arrowVertical]:O==="vert",[je.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:r.jsxs("button",{className:je.arrowInner,onClick:()=>ne("+1"),style:{transform:`translate(${_.scalingValue(B*(O==="horiz"?-1:1),i)}, ${_.scalingValue(ee,i)}) scale(${e.controls.scale/100}) rotate(${O==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&r.jsx(Zt,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:je.arrowImg}),!C.arrowsImgUrl&&r.jsx(Ha,{color:C.color,className:nt(je.arrowIcon,je.arrowImg)})]})})]}),W.triggersList.click&&r.jsx("div",{className:je.clickOverlay,onClick:()=>{o&&o.go("+1")}}),q.isActive&&r.jsx("div",{className:nt(je.pagination,{[je.paginationInsideBottom]:q.position==="inside-1"&&O==="horiz",[je.paginationInsideTop]:q.position==="inside-2"&&O==="horiz",[je.paginationOutsideBottom]:q.position==="outside-1"&&O==="horiz",[je.paginationOutsideTop]:q.position==="outside-2"&&O==="horiz",[je.paginationInsideLeft]:q.position==="inside-1"&&O==="vert",[je.paginationInsideRight]:q.position==="inside-2"&&O==="vert",[je.paginationOutsideLeft]:q.position==="outside-1"&&O==="vert",[je.paginationOutsideRight]:q.position==="outside-2"&&O==="vert",[je.paginationVertical]:O==="vert"}),children:r.jsx("div",{className:je.paginationInner,style:{backgroundColor:q.colors[2],transform:`scale(${q.scale/100}) translate(${_.scalingValue(q.offset.x,i)}, ${_.scalingValue(q.offset.y,i)}) rotate(${O==="horiz"?"0deg":"90deg"})`},children:t.map((G,D)=>r.jsx("button",{onClick:()=>{o&&o.go(D)},className:nt(je.paginationItem),children:r.jsx("div",{className:nt(je.dot,{[je.activeDot]:D===R}),style:{backgroundColor:D===R?q.colors[0]:q.colors[1],"--pagination-hover-color":q.hover}})},D))})})]})})}function Ha({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 Zd={element:Jd,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"]}},Qd="ImageRevealSlider-module__imageRevealSlider___UE5Ob",eu="ImageRevealSlider-module__image___Qjt-e",tu="ImageRevealSlider-module__link___N-iLG",nu="ImageRevealSlider-module__cursor___2U03d",di={imageRevealSlider:Qd,image:eu,link:tu,cursor:nu};function Oa(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const l=i.width?Number.parseFloat(i.width):o.naturalWidth,s=o.naturalHeight/o.naturalWidth*l,d=l/2,c=s/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 iu(e,t,n,i){let o,l;if(t==="custom"){o=n;const s=await vr(e);l=s.height/s.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const s=await vr(e);l=s.height/s.width*o}else{const s=await vr(e);o=s.width,l=s.height}return{width:o,height:l,finalWidth:`${o}px`}}function ou({settings:e,content:t,isEditor:n}){const[i,o]=a.useState(null),[l,s]=a.useState([]),[d,c]=a.useState(0),u=a.useRef(0),[m,y]=a.useState({x:0,y:0}),[L,T]=a.useState(1),[h,v]=a.useState("none"),w=a.useRef({x:0,y:0}),[I,R]=a.useState(!1),{sizeType:A,imageWidth:H,randomRangeImageWidth:b}=e.imageSize,{revealPosition:O,visible:M}=e.position,{cursorType:C,target:q,defaultCursorScale:f,defaultCursor:W,hoverCursorScale:F,hoverCursor:B}=e.cursor;a.useEffect(()=>{if(!i)return;const G=(P,S)=>{const K=i.getBoundingClientRect(),Z=P-K.left,U=S-K.top;if(y({x:Z,y:U}),C==="system"){v("none"),T(1);return}const N=Z,pe=U,g=document.elementFromPoint(K.left+N,K.top+pe);if(g&&g.closest("a")){v("none"),T(1);return}const ue=Oa(N,pe,l)||q==="area"?{img:B??"none",scale:F}:{img:W??"none",scale:f};v(ue.img),T(ue.scale)},D=P=>{P.stopPropagation(),w.current={x:P.clientX,y:P.clientY},G(P.clientX,P.clientY)},z=()=>{I&&G(w.current.x,w.current.y)};return i.addEventListener("mousemove",D),window.addEventListener("scroll",z,!0),()=>{i.removeEventListener("mousemove",D),window.removeEventListener("scroll",z,!0)}},[i,I,m,C,q,B,W,F,f,l]),a.useEffect(()=>{I||(v("none"),T(0))},[I]);const ee=async(G,D,z,P={})=>{const{width:S,height:K,finalWidth:Z}=await iu(G.image.url,A,H,b);let U=0,N=0;O==="same"?(U=D/2,N=z/2):(U=P.x??Math.random()*D,N=P.y??Math.random()*z);const pe=Math.min(Math.max(U,S/2),D-S/2),g=Math.min(Math.max(N,K/2),z-K/2);return{id:u.current++,url:G.image.url,link:G.link,name:G.image.name,x:pe,y:g,width:Z}};a.useEffect(()=>{if(!i||t.length===0)return;const G=i.getBoundingClientRect(),D=G.width,z=G.height,P=[];(async()=>{const K=t[0],Z=await ee(K,D,z);P.push(Z),s(P),c(1)})()},[A,H,b,O,i]),a.useEffect(()=>{M==="last One"&&s(G=>G.length>0?[G[G.length-1]]:[])},[M]);const ne=async G=>{if(!i)return;const D=i.getBoundingClientRect(),z=G.clientX-D.left,P=G.clientY-D.top;if(q==="image"&&!Oa(z,P,l))return;let S=0,K=0;O==="on Click"?(S=z,K=P):O==="same"?(S=D.width/2,K=D.height/2):(S=Math.random()*D.width,K=Math.random()*D.height);const Z=t[d],U=await ee(Z,D.width,D.height,{x:S,y:K});s(N=>M==="all"?[...N,U]:[U]),c(N=>N>=t.length-1?0:N+1)};return r.jsxs("div",{ref:o,onClick:ne,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),className:di.imageRevealSlider,style:{cursor:h==="none"?"default":"none"},children:[l.map(G=>r.jsx("div",{className:di.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:q==="area"&&G.link?r.jsx("a",{href:G.link,target:"_blank",className:di.link,children:r.jsx("img",{src:G.url,alt:G.name,className:di.image},G.id)}):r.jsx("img",{src:G.url,alt:G.name,className:di.image},G.id)},G.id)),I&&r.jsx("div",{className:di.cursor,style:{left:`${m.x}px`,top:`${m.y}px`,transform:`translate(-50%, -50%) scale(${L})`,backgroundImage:`url('${h}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const ru={element:ou,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:""}]}}}},au="LightBox-module__hidden___9s-9x",su="LightBox-module__heroImage___sTxNF",lu="LightBox-module__background___rm9ml",cu="LightBox-module__editor___4ACaY",du="LightBox-module__contentStyle___Bgnsq",uu="LightBox-module__imageStyle___tLIlB",pu="LightBox-module__imgWrapper___LuFUp",mu="LightBox-module__contain___8-yaS",gu="LightBox-module__cover___hNvOG",hu="LightBox-module__caption___b6L2I",fu="LightBox-module__captionTextInner___rCGNH",yu="LightBox-module__lightboxSplide___XFuWC",vu="LightBox-module__arrow___iz38X",xu="LightBox-module__arrowVertical___Zfz81",bu="LightBox-module__nextArrow___zkAQN",wu="LightBox-module__arrowInner___p48sW",Su="LightBox-module__arrowIcon___3VaFf",$u="LightBox-module__arrowImg___pNV88",Cu="LightBox-module__mirror___pjeXc",Tu="LightBox-module__thumbsWrapper___GB-nU",Lu="LightBox-module__thumbsContainerVertical___wttk5",Iu="LightBox-module__thumbsContainer___osSma",Eu="LightBox-module__thumbsAlignStart___MO6tY",Ru="LightBox-module__thumbsAlignCenter___Q4sUx",Mu="LightBox-module__thumbsAlignEnd___p4y9R",Pu="LightBox-module__thumbItem___HvnF3",ku="LightBox-module__closeButton___g2khP",Au="LightBox-module__fadeIn___0m5GW",Wu="LightBox-module__slideInLeft___gPYwC",Fu="LightBox-module__slideInRight___S-pPp",_u="LightBox-module__slideInTop___DFdAj",Nu="LightBox-module__slideInBottom___m27kZ",Hu="LightBox-module__fadeOut___55qBR",Ou="LightBox-module__slideOutLeft___NvU7P",ju="LightBox-module__slideOutRight___SK7eC",Bu="LightBox-module__slideOutTop___Vgg0z",zu="LightBox-module__slideOutBottom___nJ0Ef",Du="LightBox-module__scaleSlide___vZriG",Re={hidden:au,heroImage:su,background:lu,editor:cu,contentStyle:du,imageStyle:uu,imgWrapper:pu,contain:mu,cover:gu,caption:hu,captionTextInner:fu,lightboxSplide:yu,arrow:vu,arrowVertical:xu,nextArrow:bu,arrowInner:wu,arrowIcon:Su,arrowImg:$u,mirror:Cu,thumbsWrapper:Tu,thumbsContainerVertical:Lu,thumbsContainer:Iu,thumbsAlignStart:Eu,thumbsAlignCenter:Ru,thumbsAlignEnd:Mu,thumbItem:Pu,closeButton:ku,fadeIn:Au,slideInLeft:Wu,slideInRight:Fu,slideInTop:_u,slideInBottom:Nu,fadeOut:Hu,slideOutLeft:Ou,slideOutRight:ju,slideOutTop:Bu,slideOutBottom:zu,scaleSlide:Du},xo=(e,t,n)=>{const i={},[o,l]=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"),l==="left"?(i.left="0",i.right="auto"):l==="center"?(i.left="50%",i.right="auto"):l==="right"&&(i.left="auto",i.right="0"),o==="middle"&&l==="center"?i.transform=`translate(calc(-50% + ${_.scalingValue(t.x,n)}), calc(-50% + ${_.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${_.scalingValue(t.x,n)}, calc(-50% + ${_.scalingValue(t.y,n)}))`:l==="center"?i.transform=`translate(calc(-50% + ${_.scalingValue(t.x,n)}), ${_.scalingValue(t.y,n)})`:i.transform=`translate(${_.scalingValue(t.x,n)}, ${_.scalingValue(t.y,n)})`,i};function fl(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 ja(e){const t=e.getBoundingClientRect(),n=fl(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),l=e.naturalWidth,s=e.naturalHeight,d=i/o,c=l/s;let u,m;c>d?(u=i,m=i/c):(m=o,u=o*c);const y=t.left+n.left,L=t.top+n.top,T=(i-u)/2+y,h=(o-m)/2+L;return{x:T,y:h,width:u,height:m}}function Ba(e){const t=e.getBoundingClientRect(),n=fl(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function za(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 Vu(e,t){const n=(()=>{if(e==="fade in")return Re.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Re.slideInLeft;case"right":return Re.slideInRight;case"top":return Re.slideInTop;case"bottom":return Re.slideInBottom;default:return Re.slideInRight}return Re.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Re.fadeIn;if(e==="slide in")switch(t){case"left":return Re.slideInLeft;case"right":return Re.slideInRight;case"top":return Re.slideInTop;case"bottom":return Re.slideInBottom;default:return Re.slideInRight}return Re.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Re.fadeOut;if(e==="slide in")switch(t){case"left":return Re.slideOutLeft;case"right":return Re.slideOutRight;case"top":return Re.slideOutTop;case"bottom":return Re.slideOutBottom;default:return Re.slideOutRight}return Re.fadeOut})(),l=(()=>{if(e==="fade in")return Re.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Re.slideOutLeft;case"right":return Re.slideOutRight;case"top":return Re.slideOutTop;case"bottom":return Re.slideOutBottom;default:return Re.slideOutRight}return Re.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:l}}const qu=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:l,isPreviewMode:s})=>{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:Re.heroImage,onClick:()=>c(!0)}),r.jsx(Gu,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:l})]})},Gu=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:l,isEditor:s,metadata:d})=>{var Fe;const{widthSettings:c,fontSettings:u,letterSpacing:m,textAlign:y,wordSpacing:L,fontSizeLineHeight:T,textAppearance:h,color:v}=i.imageCaption??{},[w,I]=a.useState(0),[R,A]=a.useState(0),[H,b]=a.useState(!1),[O,M]=a.useState(!1),[C,q]=a.useState({}),f=a.useRef(null),W=a.useRef(null),F=a.useRef(null),B=a.useRef(!1),ee=a.useRef(null),ne=a.useRef(null),G=a.useRef(null),D=a.useRef(null),z=a.useRef(!1),P=a.useRef(null),[S,K]=a.useState(!1),{appear:Z,triggers:U,slider:N,thumbnail:pe,controls:g,area:ue,caption:ve,layout:ge}=o.lightboxBlock,{appearClass:Ee,backdropAppearClass:te,backdropDisappearClass:me,disappearClass:J}=Vu(Z.type,Z.direction),be=(d==null?void 0:d.itemId)??null;a.useEffect(()=>{const $=()=>{setTimeout(()=>{var E,X;(X=(E=f.current)==null?void 0:E.splide)==null||X.refresh()},16)},ae=()=>{A(E=>E+1)};return window.addEventListener("ArticleEditor.Layout:change",$),window.addEventListener("ArticleEditor.ComponentContent:change",ae),()=>{window.removeEventListener("ArticleEditor.Layout:change",$),window.removeEventListener("ArticleEditor.ComponentContent:change",ae)}},[]),a.useEffect(()=>{if(!e||!pe.isActive){K(!1);return}const $=P.current;if(!$)return;const ae=()=>{N.direction==="horiz"?K($.scrollWidth>$.clientWidth):K($.scrollHeight>$.clientHeight)};ae();const E=new ResizeObserver(ae);return E.observe($),()=>E.disconnect()},[e,pe.isActive,n.length,C,N.direction]);const le=a.useCallback(()=>{const $=window.matchMedia("(max-width: 768px)").matches,ae=za(ue.color);$&&!s&&ae>.9&&(document.body.style.backgroundColor=""),b(!0),B.current=!0;const E=X=>{X.target===ee.current&&X.animationName&&(ee.current&&ne.current&&ee.current.removeEventListener("animationend",ne.current),ne.current=null,B.current&&(B.current=!1,t()),b(!1))};ee.current&&(ne.current=E,ee.current.addEventListener("animationend",E))},[t,ue.color,s]),ce=($,ae,E)=>{var X,Y;if($){if(U.type==="click"&&U.switch==="image")U.repeat==="close"&&w===n.length-1?le():(X=f.current)==null||X.go("+1");else if(U.type==="click"&&U.switch==="50/50"){const se=$.getBoundingClientRect(),de=ae-se.left,fe=E-se.top,Ne=se.width,We=se.height;let j;N.direction==="horiz"?j=de<Ne/2?"-1":"+1":j=fe<We/2?"-1":"+1",(Y=f.current)==null||Y.go(j)}}},re=$=>{if(z.current){z.current=!1;return}const ae=n[w],E=(ae==null?void 0:ae.image.objectFit)==="cover";let X,Y;if("changedTouches"in $&&$.changedTouches.length>0)X=$.changedTouches[0].clientX,Y=$.changedTouches[0].clientY;else if("clientX"in $)X=$.clientX,Y=$.clientY;else return;let se;if(E&&F.current){const de=Ba(F.current);se=X>=de.left&&X<=de.right&&Y>=de.top&&Y<=de.bottom}else{const de=F.current?ja(F.current):null;if(!de){$.target===$.currentTarget&&le();return}se=X>=de.x&&X<=de.x+de.width&&Y>=de.y&&Y<=de.y+de.height}se?ce(F.current,X,Y):le()},Ie=$=>{const ae=$.target;(ae.classList.contains(Re.thumbsWrapper)||ae.classList.contains(Re.thumbsContainer))&&re($)};a.useEffect(()=>{if(!e)return;const $=ae=>{var E,X;if(ae.key==="Escape"){le();return}if(ae.key==="ArrowRight"){I(Y=>(Y+1)%Math.max(n.length,1)),(E=f.current)==null||E.go("+1");return}ae.key==="ArrowLeft"&&(I(Y=>(Y-1+Math.max(n.length,1))%Math.max(n.length,1)),(X=f.current)==null||X.go("-1"))};return window.addEventListener("keydown",$),()=>{window.removeEventListener("keydown",$)}},[e,le,n.length]),a.useEffect(()=>{if(e){if(I(0),A(ae=>ae+1),B.current=!1,b(!1),M(!1),q({}),!be)return;const $=new CustomEvent("page-overlay",{detail:{itemId:be}});window.dispatchEvent($)}return()=>{ee.current&&ne.current&&(ee.current.removeEventListener("animationend",ne.current),ne.current=null),M(!1)}},[e,be]),a.useEffect(()=>{W.current!==null&&W.current!==N.type&&A($=>$+1),W.current=N.type},[N.type]),a.useEffect(()=>{if(!e)return;const $=document.body.style.overflow,ae=window.matchMedia("(max-width: 768px)").matches,E=za(ue.color);document.body.style.overflow="hidden",M(!1);const X=se=>{se.target===ee.current&&!B.current&&se.animationName&&(ae&&!s&&E>.9&&(document.body.style.backgroundColor=ue.color),M(!0),ee.current&&G.current&&ee.current.removeEventListener("animationend",G.current),G.current=null)};ee.current&&(G.current=X,ee.current.addEventListener("animationend",X));const Y=se=>{const de=se.target;de&&(de.closest(`.${Re.thumbsWrapper}`)||de.closest(`.${Re.thumbsContainer}`))||N.type!=="slide"&&se.preventDefault()};return document.addEventListener("touchmove",Y,{passive:!1}),()=>{document.body.style.overflow=$,document.removeEventListener("touchmove",Y),ee.current&&G.current&&(ee.current.removeEventListener("animationend",G.current),G.current=null),M(!1)}},[e,s,ue.color,N.type]),a.useEffect(()=>{if(!e)return;const $=ae=>{var X,Y;if(B.current){ae.stopPropagation();return}if(z.current){z.current=!1;return}const E=ae.target;if(!(E&&(E.closest(`.${Re.thumbsContainer}`)||E.closest(`.${Re.thumbItem}`)||E.closest(`.${Re.arrow}`)||E.closest(`.${Re.closeButton}`)||E.closest(`.${Re.caption}`)))){if(N.type==="slide"&&U.type==="drag"&&((Y=(X=f.current)==null?void 0:X.splide)!=null&&Y.root)){const se=f.current.splide.root;if(E&&(se.contains(E)||se===E))return}if(ae.touches.length===0&&ae.changedTouches.length>0){const se=n[w],de=(se==null?void 0:se.image.objectFit)==="cover",fe=ae.changedTouches[0];let Ne;if(de&&F.current){const We=Ba(F.current);Ne=fe.clientX>=We.left&&fe.clientX<=We.right&&fe.clientY>=We.top&&fe.clientY<=We.bottom}else{const We=F.current?ja(F.current):null;if(!We)return;Ne=fe.clientX>=We.x&&fe.clientX<=We.x+We.width&&fe.clientY>=We.y&&fe.clientY<=We.y+We.height}if(!Ne){ae.stopPropagation(),B.current=!0;const We=j=>{j.stopPropagation(),j.preventDefault(),document.removeEventListener("click",We,!0)};document.addEventListener("click",We,!0),le()}}}};return document.addEventListener("touchend",$,{passive:!0}),()=>{document.removeEventListener("touchend",$)}},[e,le,w,n]);const ke=(N.type==="scale"||N.type==="fade")&&N.direction==="vert"&&U.type==="drag";a.useEffect(()=>{var j,Ce;if(!e||!ke||!((Ce=(j=f.current)==null?void 0:j.splide)!=null&&Ce.root))return;const $=f.current.splide.root,ae=30,E=(Q,he)=>{if(D.current){const $e=Math.abs(Q-D.current.x),Oe=Math.abs(he-D.current.y);($e>0||Oe>0)&&(z.current=!0)}},X=Q=>{D.current&&(Q.preventDefault(),E(Q.clientX,Q.clientY))},Y=Q=>{D.current&&Q.touches.length>0&&(Q.preventDefault(),E(Q.touches[0].clientX,Q.touches[0].clientY))},se=(Q,he)=>{if(!D.current||!f.current){D.current=null;return}const $e=Math.abs(Q-D.current.x),Oe=Math.abs(he-D.current.y);Oe>ae&&Oe>$e&&f.current.go(he<D.current.y?"+1":"-1"),D.current=null},de=Q=>{D.current&&se(Q.clientX,Q.clientY),document.removeEventListener("pointerup",de),document.removeEventListener("pointercancel",de),document.removeEventListener("pointermove",X)},fe=Q=>{if(D.current){if(Q.changedTouches.length>0){const he=Q.changedTouches[0];se(he.clientX,he.clientY)}document.removeEventListener("touchend",fe),document.removeEventListener("touchcancel",fe),document.removeEventListener("touchmove",Y)}},Ne=Q=>{D.current={x:Q.clientX,y:Q.clientY},z.current=!1,document.addEventListener("pointermove",X,{passive:!1}),document.addEventListener("pointerup",de),document.addEventListener("pointercancel",de)},We=Q=>{Q.touches.length>0&&(D.current={x:Q.touches[0].clientX,y:Q.touches[0].clientY},z.current=!1,document.addEventListener("touchmove",Y,{passive:!1}),document.addEventListener("touchend",fe),document.addEventListener("touchcancel",fe))};return $.addEventListener("pointerdown",Ne),$.addEventListener("touchstart",We),()=>{$.removeEventListener("pointerdown",Ne),$.removeEventListener("touchstart",We),document.removeEventListener("pointermove",X),document.removeEventListener("pointerup",de),document.removeEventListener("pointercancel",de),document.removeEventListener("touchmove",Y),document.removeEventListener("touchend",fe),document.removeEventListener("touchcancel",fe),D.current=null,z.current=!1}},[e,ke,R]);const Le={backgroundColor:ue.color,backdropFilter:`blur(${ue.blur}px)`,animationDuration:`${parseInt(Z.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(l)?null:Mi.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:s?null:ee,className:nt(Re.background,H?me:te,{[Re.editor]:s},{[Re.hidden]:!e}),style:{...Le,...O&&!s&&!H?{position:"absolute"}:{}}}),r.jsxs("div",{ref:s?ee:null,className:nt(Re.contentStyle,H?J:Ee,{[Re.editor]:s},{[Re.hidden]:!e}),style:{animationDuration:`${parseInt(Z.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(ua,{onMove:$=>I($.index),ref:f,className:Re.lightboxSplide,options:{arrows:!1,speed:N.duration?parseInt(N.duration):500,direction:N.direction==="horiz"||N.type==="fade"||N.type==="scale"?"ltr":"ttb",pagination:!1,drag:U.type==="drag"&&!ke,perPage:1,width:"100%",height:"100%",type:N.type==="fade"||N.type==="scale"?"fade":"loop",padding:0,rewind:U.repeat!=="close",start:0},style:{"--splide-speed":N.duration},children:n.map(($,ae)=>{const E=xo(ge.position,ge.offset,s),X=`${_.scalingValue(ge.padding.top,s)} ${_.scalingValue(ge.padding.right,s)} ${_.scalingValue(ge.padding.bottom,s)} ${_.scalingValue(ge.padding.left,s)}`,Y=N.type==="scale"?(()=>{const{transform:se,...de}=E;return{...de,position:"absolute",padding:X,boxSizing:"border-box","--position-transform":se||"none"}})():{...E,position:"absolute",padding:X,boxSizing:"border-box"};return r.jsx(pa,{children:r.jsx("div",{className:Re.imgWrapper,onClick:re,children:r.jsx("img",{ref:ae===w?F:null,className:nt(Re.imageStyle,{[Re.contain]:$.image.objectFit==="contain",[Re.cover]:$.image.objectFit==="cover",[Re.scaleSlide]:N.type==="scale"}),src:$.image.url,alt:$.image.name??"",style:{...Y,pointerEvents:$.image.objectFit==="contain"?"none":"auto"}})})},ae)})},R),g.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:nt(Re.arrow,{[Re.arrowVertical]:N.direction==="vert"}),style:{color:g.color,"--arrow-hover-color":g.hover},children:r.jsxs("button",{className:Re.arrowInner,style:{transform:`translate(${_.scalingValue(g.offset.x,s)}, ${_.scalingValue(g.offset.y*(N.direction==="horiz"?1:-1),s)}) scale(${g.scale}) rotate(${N.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var $;return($=f.current)==null?void 0:$.go("-1")},"aria-label":"Previous",children:[g.arrowsImgUrl&&r.jsx(Zt,{url:g.arrowsImgUrl,fill:g.color,hoverFill:g.hover,className:nt(Re.arrowImg,Re.mirror)}),!g.arrowsImgUrl&&r.jsx(Da,{color:g.color,className:nt(Re.arrowIcon,Re.arrowImg,Re.mirror)})]})}),r.jsx("div",{className:nt(Re.arrow,Re.nextArrow,{[Re.arrowVertical]:N.direction==="vert"}),style:{color:g.color,"--arrow-hover-color":g.hover},children:r.jsxs("button",{className:Re.arrowInner,style:{transform:`translate(${_.scalingValue(g.offset.x*(N.direction==="horiz"?-1:1),s)}, ${_.scalingValue(g.offset.y,s)}) scale(${g.scale}) rotate(${N.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var $;return($=f.current)==null?void 0:$.go("+1")},"aria-label":"Next",children:[g.arrowsImgUrl&&r.jsx(Zt,{url:g.arrowsImgUrl,fill:g.color,hoverFill:g.hover,className:Re.arrowImg}),!g.arrowsImgUrl&&r.jsx(Da,{color:g.color,className:nt(Re.arrowIcon,Re.arrowImg)})]})})]}),ue.closeIconUrl&&(()=>{const $=xo(ue.closeIconAlign,ue.closeIconOffset,s),ae=`scale(${ue.closeIconScale})`,E=$.transform?`${$.transform} ${ae}`:ae;return r.jsx("button",{className:Re.closeButton,style:{...$,transform:E},onClick:le,"aria-label":"Close lightbox",children:r.jsx(Zt,{url:ue.closeIconUrl,fill:ue.closeIconColor??"#000000",hoverFill:ue.closeIconHover??"#cccccc"})})})(),ve&&ve.isActive&&i.imageCaption&&((Fe=n[w])==null?void 0:Fe.imageCaption)&&r.jsx("div",{className:Re.caption,style:{...xo(ve.alignment,ve.offset,s),fontFamily:or(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":_.scalingValue(c.width,s),letterSpacing:_.scalingValue(m,s),wordSpacing:_.scalingValue(L,s),textAlign:y,fontSize:_.scalingValue(T.fontSize,s),lineHeight:_.scalingValue(T.lineHeight,s),textTransform:h.textTransform??"none",textDecoration:h.textDecoration??"none",fontVariant:h.fontVariant??"normal",color:v},onClick:$=>$.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:Re.captionTextInner,style:{"--link-color":ve.linkColor,"--link-hover-color":ve.linkHoverColor},children:r.jsx(Si,{content:n[w].imageCaption})})}),pe.isActive&&(()=>{const[$,ae]=pe.position.split("-"),E=N.direction==="horiz"?`${$}-left`:pe.position,X=xo(E,pe.offset,s),Y=()=>{if(N.direction==="horiz"){if(ae==="left")return"flex-start";if(ae==="center")return"center";if(ae==="right")return"flex-end"}else{if($==="top")return"flex-start";if($==="middle")return"center";if($==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:P,className:Re.thumbsWrapper,onClick:se=>Ie(se),style:{position:s?"absolute":"fixed",...X,...N.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:nt(Re.thumbsContainer,{[Re.thumbsContainerVertical]:N.direction==="vert",[Re.thumbsAlignStart]:pe.align==="start",[Re.thumbsAlignCenter]:pe.align==="center",[Re.thumbsAlignEnd]:pe.align==="end"}),style:{gap:_.scalingValue(pe.grid.gap,s),justifyContent:S?"flex-start":Y()},children:n.map((se,de)=>{const fe=de===w,Ne=C[de],j=pe.grid.size*(fe?pe.activeState.scale:1),Ce=()=>{if(pe.fit!=="fit")return{};if(!Ne)return N.direction==="horiz"?{height:_.scalingValue(j,s)}:{width:_.scalingValue(j,s)};const Q=Ne.width/Ne.height;if(N.direction==="horiz"){const he=j,$e=he*Q;return{width:_.scalingValue($e,s),height:_.scalingValue(he,s)}}else{const he=j,$e=he/Q;return{width:_.scalingValue(he,s),height:_.scalingValue($e,s)}}};return r.jsx("button",{className:Re.thumbItem,style:{...N.direction==="horiz"&&pe.fit!=="fit"?{height:_.scalingValue(j,s)}:{},...N.direction==="vert"&&pe.fit!=="fit"?{width:_.scalingValue(j,s)}:{},...pe.fit==="cover"?{width:_.scalingValue(j,s),height:_.scalingValue(j,s)}:{},...Ce(),transition:fe?"all 0.25s ease-out":"none",opacity:fe?pe.activeState.opacity/100:pe.opacity/100,"--thumb-hover":pe.activeState.opacity/100},onClick:Q=>{var he;Q.stopPropagation(),I(de),(he=f.current)==null||he.go(de)},onMouseEnter:()=>{var Q;pe.triggers==="hov"&&((Q=f.current)==null||Q.go(de))},children:r.jsx("img",{src:se.image.url,alt:se.image.name??"",onLoad:Q=>{const he=Q.currentTarget;he.naturalWidth&&he.naturalHeight&&q($e=>({...$e,[de]:{width:he.naturalWidth,height:he.naturalHeight}}))},style:{objectFit:pe.fit==="cover"?"cover":"contain",...pe.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...pe.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${se.image.name}-${de}`)})})})})()]})]}),document.getElementById(l))};function Da({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 Ku={element:qu,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 bo(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Uu(e){return`
|
|
7
7
|
.${e}-wrapper {
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
pointer-events: auto;
|
|
156
156
|
z-index: 10;
|
|
157
157
|
}
|
|
158
|
-
`}function Xu({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:l}){const s=!!n,d=i&&t||!t,{prefix:c}=
|
|
158
|
+
`}function Xu({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:l}){const s=!!n,d=i&&t||!t,{prefix:c}=_.useScopedStyles(),{type:u="A",fieldsToShow:m=2,fields:y=[],buttonLabel:L,gap:T,fieldsGap:h,buttonCorners:v,buttonStroke:w,buttonPadding:I,isButtonFullWidth:R,inputCorners:A,inputStroke:H,inputPadding:b,inputColor:O,inputTextColor:M,inputBorderColor:C,placeholderColor:q,buttonColor:f,buttonTextColor:W,buttonBorderColor:F,labelTextColor:B,successColor:ee,errorColor:ne,fontFamily:G,inputFontSettings:D,inputFontSize:z,inputLineHeight:P,inputLetterSpacing:S,inputWordSpacing:K,inputTextAppearance:Z,buttonFontSettings:U,buttonFontSize:N,buttonLineHeight:pe,buttonLetterSpacing:g,buttonWordSpacing:ue,buttonTextAppearance:ve,labelFontSettings:ge,labelFontSize:Ee,labelLineHeight:te,labelLetterSpacing:me,labelWordSpacing:J,labelTextAppearance:be,statusFontSettings:le,statusFontSize:ce,statusLineHeight:re,statusLetterSpacing:Ie,statusWordSpacing:ke,statusTextAppearance:Le,successMessage:Fe,errorMessage:$,stateOverrides:ae}=e,E=u==="B",X=y.slice(0,Math.min(m,y.length)),Y={fontSettings:{fontFamily:G,fontWeight:(D==null?void 0:D.fontWeight)??400,fontStyle:(D==null?void 0:D.fontStyle)??"normal"},fontSize:z??.01,lineHeight:P,letterSpacing:S??0,wordSpacing:K??0,textAppearance:Z,color:M},se=Jt(_t(Y,t)),de=_.scalingValue(H??0,t),fe=_.scalingValue((P??z??.01)+((b==null?void 0:b.top)??0)+((b==null?void 0:b.bottom)??0)+(u==="C"?H??0:(H??0)*2),t),Ne={...se,borderStyle:"solid",borderRadius:u==="C"?0:_.scalingValue(A??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:de,borderLeftWidth:0}:{borderWidth:de},paddingTop:_.scalingValue((b==null?void 0:b.top)??0,t),paddingRight:_.scalingValue((b==null?void 0:b.right)??0,t),paddingBottom:_.scalingValue((b==null?void 0:b.bottom)??0,t),paddingLeft:_.scalingValue((b==null?void 0:b.left)??0,t),height:fe,minHeight:fe},We={fontSettings:{fontFamily:G,fontWeight:(U==null?void 0:U.fontWeight)??400,fontStyle:(U==null?void 0:U.fontStyle)??"normal"},fontSize:N??.01,lineHeight:pe,letterSpacing:g??0,wordSpacing:ue??0,textAppearance:ve,color:W},j=Jt(_t(We,t)),Ce=_.scalingValue(w??0,t),Q={fontSettings:{fontFamily:G,fontWeight:(ge==null?void 0:ge.fontWeight)??400,fontStyle:(ge==null?void 0:ge.fontStyle)??"normal"},fontSize:Ee??.01,lineHeight:te,letterSpacing:me??0,wordSpacing:J??0,textAppearance:be,color:B},he=_t(Q,t),$e={fontSettings:{fontFamily:G,fontWeight:(le==null?void 0:le.fontWeight)??400,fontStyle:(le==null?void 0:le.fontStyle)??"normal"},fontSize:ce??.01,lineHeight:re,letterSpacing:Ie??0,wordSpacing:ke??0,textAppearance:Le,color:ee},Oe=Jt(_t($e,t)),Ye=_.buildColorVars(c,{inputColor:O,inputTextColor:M,inputBorderColor:C,placeholderColor:q!=null&&q.trim()?q:"#cccccc",buttonColor:f,buttonTextColor:W,buttonBorderColor:F,labelTextColor:B,successColor:ee,errorColor:ne},Yu,Ju,ae),[Be,Ve]=a.useState(()=>Object.fromEntries(X.map(Ge=>[Ge.name,""]))),[dt,ft]=a.useState("idle"),[wt,Ct]=a.useState(null),Ze=l==="success"?"success":l==="error"?"error":dt,ze=l==="error"?$:wt,Je=l==="filled",it=a.useMemo(()=>{if(!Je)return Be;let Ge=null;for(const $t of X)(Be[$t.name]??"").trim().length>0||(Ge=Ge??{...Be},Ge[$t.name]="Filled");return Ge??Be},[Be,Je,X]),qe=Ze==="error"?_.getFormFieldValidationError(X,it):null,rt=`${l&&l!=="default"?`${c}-state-${l}`:""}`.trim(),ot=o==null?void 0:o.submitUrl,kt=(Ge,$t)=>{Ve(Ue=>({...Ue,[Ge]:$t}))},Ht=async Ge=>{if(Ge.preventDefault(),!d)return;const $t=Object.fromEntries(X.map(st=>{var gt;return[st.name,((gt=Be[st.name])==null?void 0:gt.trim())??""]}).filter(([,st])=>st));if(!ot){ft("error"),Ct("No integrations were found for this form.");return}if(Object.keys($t).length===0)return;const Ue=_.getFormFieldValidationError(X,Be);if(Ue){ft("error"),Ct(Ue);return}ft("submitting"),Ct(null);try{const st=await fetch(ot,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($t)});if(!st.ok){const gt=await st.text();throw new Error(gt||`Request failed: ${st.status}`)}ft("success"),Ve(Object.fromEntries(X.map(gt=>[gt.name,""])))}catch(st){ft("error"),Ct(st instanceof Error?st.message:"Something went wrong")}};return r.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${rt}`.trim(),style:Ye,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Uu(c)}}),r.jsxs("form",{onSubmit:Ht,className:`${c}-form`,children:[r.jsx("div",{className:`${c}-fields`,children:X.map((Ge,$t)=>r.jsxs(a.Fragment,{children:[$t>0&&r.jsx("div",{"data-controls":s?"fieldsGap":void 0,className:s?`${c}-control`:void 0,style:{height:_.scalingValue(h??0,t)}}),r.jsxs("div",{className:`${c}-field-group${E?` ${c}-labeled`:""}`,children:[E&&r.jsx("span",{className:`${c}-field-label`,style:he?{...he,lineHeight:he.fontSize}:void 0,children:Ge.label||Ge.name}),Ge.type==="textarea"?r.jsx("textarea",{name:Ge.name,autoComplete:"off",value:it[Ge.name]??"",onChange:Ue=>kt(Ge.name,Ue.target.value),placeholder:Ge.placeholder,className:`${c}-input`,style:Ne,rows:1,"data-filled":Je||(it[Ge.name]??"").trim().length>0,"data-field-type":"textarea"}):r.jsx("input",{type:Ge.type==="phone"?"tel":Ge.type==="email"?"email":"text",name:Ge.name,autoComplete:"off",value:it[Ge.name]??"",onChange:Ue=>kt(Ge.name,Ue.target.value),placeholder:Ge.placeholder,required:Ge.isRequired??Ge.type==="email",className:`${c}-input`,style:Ne,"data-filled":Je||(it[Ge.name]??"").trim().length>0})]})]},$t))}),r.jsx("div",{"data-controls":s?"gap":void 0,className:s?`${c}-control`:void 0,style:{height:_.scalingValue(T??0,t)}}),r.jsx("div",{className:`${c}-overlay-anchor`,children:r.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:_.scalingValue(v??0,t),borderWidth:Ce,paddingTop:_.scalingValue((I==null?void 0:I.top)??0,t),paddingRight:_.scalingValue((I==null?void 0:I.right)??0,t),paddingBottom:_.scalingValue((I==null?void 0:I.bottom)??0,t),paddingLeft:_.scalingValue((I==null?void 0:I.left)??0,t),pointerEvents:d?"auto":void 0,...j,...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:dt==="submitting"?"...":L})})})]}),Ze==="success"&&r.jsx("p",{className:`${c}-success`,style:{...Oe},children:Fe}),Ze==="error"&&r.jsx("p",{className:`${c}-error`,style:{...Oe},role:"alert",children:qe??ze??$})]})}const Yu={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"},Ju=["hover","focus","filled","success","error"],Zu=`import React, { useMemo, useState } from 'react';
|
|
159
159
|
import { CommonComponentProps } from '../props';
|
|
160
160
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
161
161
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -980,7 +980,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
980
980
|
font-size: ${So(14)};
|
|
981
981
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
982
982
|
}
|
|
983
|
-
`}const op=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:l}=
|
|
983
|
+
`}const op=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:l}=_.useScopedStyles(),s=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:m=1,fontFamily:y,inputFontSettings:L,inputFontSize:T,inputLineHeight:h,inputLetterSpacing:v,inputWordSpacing:w,inputTextAppearance:I,buttonFontSettings:R,buttonFontSize:A,buttonLineHeight:H,buttonLetterSpacing:b,buttonWordSpacing:O,buttonTextAppearance:M,statusFontSettings:C,statusFontSize:q,statusLineHeight:f,statusLetterSpacing:W,statusWordSpacing:F,statusTextAppearance:B,iconMaxWidth:ee,minHeight:ne,corners:G,stroke:D,stateOverrides:z,inputPadding:P,buttonPadding:S,successMessage:K="Thanks for subscribing!",errorMessage:Z="Please, fill all required fields."}=e,U=d.slice(0,Math.min(m,d.length)),[N,pe]=a.useState(()=>Object.fromEntries(U.map(Q=>[Q.name,""]))),[g,ue]=a.useState("idle"),[ve,ge]=a.useState(null),Ee=o==="success"?"success":o==="error"?"error":g,te=o==="error"?Z:ve,me=o==="filled",J=a.useMemo(()=>{if(!me)return N;let Q=null;for(const he of U)(N[he.name]??"").trim().length>0||(Q=Q??{...N},Q[he.name]="Filled");return Q??N},[me,N,U]),be=Ee==="error"?_.getFormFieldValidationError(U,J):null,le=o&&o!=="default"?`${l}-state-${o}`:"",ce=U.some(Q=>(J[Q.name]??"").trim().length>0),re=le!==`${l}-state-filled`&&ce?`${l}-state-filled`:"",Ie=`${le} ${re}`.trim(),ke=i==null?void 0:i.submitUrl,Le=u??"",Fe=(c==null?void 0:c.icon)??"",$=(c==null?void 0:c.mode)==="On",ae=Le||"Submit",E={fontSettings:{fontFamily:y,fontWeight:(L==null?void 0:L.fontWeight)??400,fontStyle:(L==null?void 0:L.fontStyle)??"normal"},fontSize:T??.01,lineHeight:h,letterSpacing:v??0,wordSpacing:w??0,textAppearance:I,color:e.inputTextColor??"#111111"},X={fontSettings:{fontFamily:y,fontWeight:(R==null?void 0:R.fontWeight)??400,fontStyle:(R==null?void 0:R.fontStyle)??"normal"},fontSize:A??.01,lineHeight:H,letterSpacing:b??0,wordSpacing:O??0,textAppearance:M,color:e.buttonTextColor??"#ffffff"},Y={fontSettings:{fontFamily:y,fontWeight:(C==null?void 0:C.fontWeight)??400,fontStyle:(C==null?void 0:C.fontStyle)??"normal"},fontSize:q??.01,lineHeight:f,letterSpacing:W??0,wordSpacing:F??0,textAppearance:B,color:e.successColor??"#22c55e"},se=Jt(_t(E,t)),de=Jt(_t(X,t)),fe=Jt(_t(Y,t)),Ne=_.buildColorVars(l,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(E==null?void 0:E.color)??"#111111",buttonTextColor:e.buttonTextColor??(X==null?void 0:X.color)??"#ffffff"},rp,ap,z),We={borderRadius:_.scalingValue(G,t),borderWidth:_.scalingValue(D,t),borderStyle:"solid"},j={borderLeftWidth:_.scalingValue(D,t)},Ce=async Q=>{if(Q.preventDefault(),!s)return;const he=Object.fromEntries(U.map(Oe=>{var Ye;return[Oe.name,((Ye=N[Oe.name])==null?void 0:Ye.trim())??""]}).filter(([,Oe])=>Oe));if(!ke){ue("error"),ge("No integrations were found for this form.");return}if(Object.keys(he).length===0)return;const $e=_.getFormFieldValidationError(U,N);if($e){ue("error"),ge($e);return}ue("submitting"),ge(null);try{const Oe=await fetch(ke,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(he)});if(!Oe.ok){const Ye=await Oe.text();throw new Error(Ye||`Request failed: ${Oe.status}`)}ue("success"),pe(Object.fromEntries(U.map(Ye=>[Ye.name,""])))}catch(Oe){ue("error"),ge(Oe instanceof Error?Oe.message:"Something went wrong")}};return r.jsxs("div",{className:`${l}-wrapper ${Ie}`.trim(),style:Ne,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ip(l)}}),r.jsxs("form",{onSubmit:Ce,className:`${l}-form`,style:{...We,height:_.scalingValue(ne,t),minHeight:_.scalingValue(ne,t)},children:[r.jsx("div",{className:`${l}-inputWrap ${l}-overlayAnchor`,style:{flex:1,minWidth:0},children:U.map(Q=>r.jsx("input",{type:Q.type==="email"?"email":Q.type==="phone"?"tel":"text",name:Q.name,autoComplete:"off",value:J[Q.name]??"",onChange:he=>pe($e=>({...$e,[Q.name]:he.target.value})),placeholder:Q.placeholder,required:Q.isRequired??Q.type==="email",className:`${l}-input`,style:{...se,paddingRight:_.scalingValue(P.right,t),paddingLeft:_.scalingValue(P.left,t),paddingTop:_.scalingValue(P.top,t),paddingBottom:_.scalingValue(P.bottom,t)}},Q.name))}),r.jsx("div",{className:`${l}-overlayAnchor`,children:r.jsx("button",{type:s?"submit":"button",className:`${l}-submitBtn`,"aria-label":ae,style:{...de,...j,paddingRight:_.scalingValue(S.right,t),paddingLeft:_.scalingValue(S.left,t),paddingTop:_.scalingValue(S.top,t),paddingBottom:_.scalingValue(S.bottom,t),pointerEvents:s?"auto":void 0},children:g==="submitting"?"...":$?Fe&&r.jsx(Zt,{url:Fe,className:`${l}-submitBtnIcon`,style:{maxWidth:_.scalingValue(ee??0,t)},fill:`var(--${l}-button-text-color)`,hoverFill:`var(--${l}-button-text-color)`}):Le})})]}),Ee==="success"&&r.jsx("p",{className:`${l}-success`,style:{...fe},children:K}),Ee==="error"&&r.jsx("p",{className:`${l}-error`,style:{...fe},role:"alert",children:be??te??Z})]})},rp={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"},ap=["hover","focus","filled","success","error"],sp=`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';
|
|
@@ -1685,7 +1685,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1685
1685
|
.${e}-image-hover-grayscale:hover img {
|
|
1686
1686
|
filter: grayscale(100%);
|
|
1687
1687
|
}
|
|
1688
|
-
`}const gp=30,hp=20,br=3,fp=12,yp=32,vp=3,xp=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")},bp=(e,t)=>Array.from({length:t},()=>e).flat(),wp=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},yl=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),Va=(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),l=Number.parseFloat(o.columnGap||o.gap||"0")||0,s=i.getBoundingClientRect().right-n.getBoundingClientRect().left;if(s>0)return s;const d=Array.from({length:t},(u,m)=>e.children[m]),c=yl(d);return c<=0?0:c+l*Math.max(0,t-1)},Sp=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=yl(Array.from(e.children));if(i<=0)return 0;const o=getComputedStyle(e),l=Number.parseFloat(o.columnGap||o.gap||"0")||0,s=Number.parseFloat(o.paddingRight)||0;return i+l*Math.max(0,e.children.length-1)+s},$p=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},Cp=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>$p(i,e))},Tp=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,imageHoverClass:l,isFirstSet:s,scaled:d,onFirstSetImageDone:c})=>{var C,q,f;const u=a.useRef(null);a.useLayoutEffect(()=>{if(!s)return;const W=u.current;W!=null&&W.complete&&(c==null||c())},[s,(C=e.image)==null?void 0:C.url,c]);const m=n.display==="cover",y=n.ratioValue??"1:1",L=n.reversed??!1,[T,h]=y.split(":").map(Number),I=(L?h:T)/(L?T:h),R=i/I,A=R>o?o:R,H=R>o?o*I:i,b=d(H),O=d(A),M=((q=e.image)==null?void 0:q.url)&&r.jsx("img",{ref:u,src:e.image.url,alt:((f=e.image)==null?void 0:f.name)??"",style:m?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover"}:{pointerEvents:"auto",display:"block",height:"100%",width:"auto",maxWidth:d(i),objectFit:"contain"},onLoad:s?c:void 0,onError:s?c:void 0});return r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...m?{width:b}:{width:"max-content",maxWidth:d(i),minWidth:0}},children:r.jsx("div",{className:l,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...m?{width:b,height:O,overflow:"hidden"}:{width:"max-content",maxWidth:d(i),height:d(o)}},children:M&&e.link?r.jsx("a",{href:e.link,target:"_blank",rel:"noopener noreferrer",className:nt(`${t}-marquee-link`,!m&&`${t}-marquee-link-contain`),children:M}):M})})},Lp=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=
|
|
1688
|
+
`}const gp=30,hp=20,br=3,fp=12,yp=32,vp=3,xp=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")},bp=(e,t)=>Array.from({length:t},()=>e).flat(),wp=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},yl=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),Va=(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),l=Number.parseFloat(o.columnGap||o.gap||"0")||0,s=i.getBoundingClientRect().right-n.getBoundingClientRect().left;if(s>0)return s;const d=Array.from({length:t},(u,m)=>e.children[m]),c=yl(d);return c<=0?0:c+l*Math.max(0,t-1)},Sp=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=yl(Array.from(e.children));if(i<=0)return 0;const o=getComputedStyle(e),l=Number.parseFloat(o.columnGap||o.gap||"0")||0,s=Number.parseFloat(o.paddingRight)||0;return i+l*Math.max(0,e.children.length-1)+s},$p=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},Cp=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>$p(i,e))},Tp=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,imageHoverClass:l,isFirstSet:s,scaled:d,onFirstSetImageDone:c})=>{var C,q,f;const u=a.useRef(null);a.useLayoutEffect(()=>{if(!s)return;const W=u.current;W!=null&&W.complete&&(c==null||c())},[s,(C=e.image)==null?void 0:C.url,c]);const m=n.display==="cover",y=n.ratioValue??"1:1",L=n.reversed??!1,[T,h]=y.split(":").map(Number),I=(L?h:T)/(L?T:h),R=i/I,A=R>o?o:R,H=R>o?o*I:i,b=d(H),O=d(A),M=((q=e.image)==null?void 0:q.url)&&r.jsx("img",{ref:u,src:e.image.url,alt:((f=e.image)==null?void 0:f.name)??"",style:m?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover"}:{pointerEvents:"auto",display:"block",height:"100%",width:"auto",maxWidth:d(i),objectFit:"contain"},onLoad:s?c:void 0,onError:s?c:void 0});return r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...m?{width:b}:{width:"max-content",maxWidth:d(i),minWidth:0}},children:r.jsx("div",{className:l,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...m?{width:b,height:O,overflow:"hidden"}:{width:"max-content",maxWidth:d(i),height:d(o)}},children:M&&e.link?r.jsx("a",{href:e.link,target:"_blank",rel:"noopener noreferrer",className:nt(`${t}-marquee-link`,!m&&`${t}-marquee-link-contain`),children:M}):M})})},Lp=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=_.useScopedStyles(),[s,d]=a.useState(0),c=s>0?Math.round(s):0,u=a.useMemo(()=>mp(l,c),[l,c]),{speed:m,direction:y,pauseOnHover:L,gap:T,imageMaxWidth:h,imageMaxHeight:v,hoverEffect:w}=e,I=a.useMemo(()=>wp(e.imageFit),[e.imageFit]),R=(t==null?void 0:t.length)??0,A=!!o,H=!n||!!i,b=H&&w!=="off"&&w!=="randomize"?`${l}-image-hover-${w}`:void 0,O=n?!!i:!0,C=((t==null?void 0:t.length)??0)>0&&(O||!!n),q=Math.max(0,m)*gp,f=ce=>_.scalingValue(ce,n??!1),W=a.useRef(null),F=a.useRef(null),B=a.useRef(null),[ee,ne]=a.useState(0),G=O&&L==="on",[D,z]=a.useState(!1),[P,S]=a.useState({}),K=a.useRef(P);K.current=P;const Z=a.useRef(null),U=a.useRef(0),N=a.useRef(null),pe=a.useMemo(()=>(t??[]).map(ce=>{var re;return((re=ce.image)==null?void 0:re.url)??""}).join("\0"),[t]),[g,ue]=a.useState(br),ve=a.useMemo(()=>{const ce=t??[];return ce.length===0||!(O||!!n)?ce:bp(ce,g)},[t,O,g,n]),ge=a.useMemo(()=>(t??[]).filter(ce=>{var re;return!!((re=ce.image)!=null&&re.url)}).length,[t]),Ee=C?vp:1;a.useLayoutEffect(()=>{U.current=0,S({}),Z.current=null,ue(br),d(0)},[pe]),a.useEffect(()=>{if(!H||w!=="randomize")return;const ce=W.current;if(!ce)return;const re=Fe=>{S($=>{const ae=Array.from(Fe).filter(X=>X in $&&!Cp(ce,X));if(ae.length===0)return $;const E={...$};return ae.forEach(X=>{delete E[X]}),E})},Ie=new IntersectionObserver(Fe=>{const $=new Set;for(const ae of Fe){const E=ae.target.dataset.marqueeItemIndex,X=E!==void 0?Number(E):NaN;Number.isNaN(X)||$.add(X)}$.size>0&&re($)},{root:ce,threshold:0});Object.keys(P).forEach(Fe=>{const $=Number(Fe);ce.querySelectorAll(`[data-marquee-item-index="${$}"]`).forEach(ae=>Ie.observe(ae))});const ke={current:0},Le=()=>{const Fe=Object.keys(K.current);Fe.length!==0&&(re(Fe.map(Number)),ke.current=requestAnimationFrame(Le))};return Object.keys(K.current).length>0&&(ke.current=requestAnimationFrame(Le)),()=>{cancelAnimationFrame(ke.current),Ie.disconnect()}},[w,P,H]),a.useLayoutEffect(()=>{if(!C)return;const ce=W.current,re=B.current;if(!ce||!re)return;const Ie={current:0},ke=()=>{const $=ce.getBoundingClientRect().width||ce.offsetWidth,ae=Sp(re),E=Z.current,X=typeof E=="number"&&Math.abs(E-ae)<=.25;if(Z.current=ae,(O||n)&&R>0&&$>0){const se=Va(re,R);if(se>=yp){const de=Math.min(fp,Math.max(br,Math.ceil($/se)+1));de!==g&&ue(de)}}const Y=ae>0?ae:(()=>{const se=Va(re,R);return se>0?se*g:0})();Y>0?d(se=>se<=0?Y:!X||Math.round(se)===Math.round(Y)?se:Y):!X&&s<=0&&(cancelAnimationFrame(Ie.current),Ie.current=requestAnimationFrame(ke))},Le=()=>{cancelAnimationFrame(Ie.current),Ie.current=requestAnimationFrame(ke)};N.current=Le,Le();const Fe=new ResizeObserver(Le);return Fe.observe(ce),Fe.observe(re),()=>{N.current=null,cancelAnimationFrame(Ie.current),Fe.disconnect()}},[O,C,s,pe,g,R,n]),a.useLayoutEffect(()=>{if(!C||c<=0)return;const ce=F.current;ce&&xp(ce)},[C,c,y,q]),a.useLayoutEffect(()=>{if(!C||s<=0){ne(0);return}const ce=F.current,re=B.current;if(!ce||!re)return;const Ie=()=>{const Le=ce.offsetHeight||ce.getBoundingClientRect().height,Fe=Array.from(re.children).reduce((ae,E)=>Math.max(ae,E.offsetHeight||E.getBoundingClientRect().height),0),$=Le>0?Le:Fe;ne($>0?$:0)};Ie();const ke=new ResizeObserver(Ie);return ke.observe(ce),ke.observe(re),()=>ke.disconnect()},[C,Ee,ve,n,T,h,v,s,I,P]),a.useLayoutEffect(()=>{if(!n||!A||!C||typeof window>"u")return;const ce=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(ce)},[n,A,C,y,s,ee,T,ve]);const te=()=>{G&&z(!0)},me=()=>{G&&z(!1)},J=a.useCallback(()=>{var ce;U.current=Math.min(ge,U.current+1),(ce=N.current)==null||ce.call(N)},[ge]),be=a.useCallback((ce,re)=>{S(Ie=>{const ke=Ie[ce]??re,Le=(t??[]).filter($=>$!==ke);if(Le.length===0)return Ie;const Fe=Le[Math.floor(Math.random()*Le.length)];return{...Ie,[ce]:Fe}})},[t]),le=(ce,re,Ie,ke)=>{const Le=H&&w==="randomize"&&I.display==="cover"?P[Ie]??ce:ce,Fe=`max(${f(T)}, ${hp}px)`,$=`calc(-0.5 * (${Fe} + ${f(T)}))`;return r.jsxs("div",{className:`${l}-marquee-card`,"data-marquee-item-index":Ie,onMouseEnter:H&&w==="randomize"&&I.display==="cover"?()=>be(Ie,ce):void 0,children:[r.jsx(Tp,{item:Le,prefix:l,imageFit:I,imageMaxWidth:h,imageMaxHeight:v,imageHoverClass:b,isEditor:n,isFirstSet:ke,scaled:f,onFirstSetImageDone:J}),A&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${l}-gap-control`,style:{position:"absolute",top:0,right:$,width:Fe,height:"100%"}})]},`${re}-${Ie}`)};if(C){const ce=O?G&&D?"paused":"running":"paused",re=c>0&&q>0?c/q*1e3:0,Ie=`${Math.max(0,re)/1e3}s`;return r.jsxs("div",{ref:W,className:nt(`${l}-wrapper`,`${l}-marquee-wrapper`),"aria-label":"Marquee",style:ee>0?{height:ee}:void 0,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),r.jsx("div",{ref:F,className:`${l}-marquee-track`,"data-direction":y,onMouseEnter:te,onMouseLeave:me,style:{WebkitAnimationDuration:Ie,animationDuration:Ie,WebkitAnimationPlayState:ce,animationPlayState:ce},children:Array.from({length:Ee},(ke,Le)=>r.jsx("div",{ref:Le===0?B:void 0,className:nt(`${l}-marquee-row`,`${l}-marquee-set`),style:{gap:f(T),paddingRight:f(T)},"aria-hidden":Le>0,children:ve.map((Fe,$)=>le(Fe,Le,$,Le===0&&$<R))},`set-${Le}`))})]})}return r.jsxs("div",{ref:W,className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),r.jsx("div",{className:nt(`${l}-marquee-row`,`${l}-marquee-static`),style:{gap:f(T),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((ce,re)=>le(ce,0,re))},"marquee-static")]})},Ip=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
1689
1689
|
import cn from 'classnames';
|
|
1690
1690
|
import { CommonComponentProps } from '../props';
|
|
1691
1691
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -2494,7 +2494,7 @@ type MarqueeProps = {
|
|
|
2494
2494
|
pointer-events: auto;
|
|
2495
2495
|
z-index: 10;
|
|
2496
2496
|
}
|
|
2497
|
-
`}const Mp=30,Ga=2,Pp=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=
|
|
2497
|
+
`}const Mp=30,Ga=2,Pp=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=_.useScopedStyles(),{align:s,speed:d,direction:c,pauseOnHover:u,gap:m,cardWidth:y,corners:L,stroke:T,strokeColor:h,bgColor:v,padding:w,logoMarginTop:I,logoWidth:R,logoHeight:A,captionMarginTop:H}=e,b=!!o,O=((t==null?void 0:t.length)??0)>0,M=d>0&&(!n||i),C=O&&(M||n),q=Math.max(0,d)*Mp,f=E=>_.scalingValue(E,n??!1),W=a.useRef(null),F=a.useRef(null),B=a.useRef(null),[ee,ne]=a.useState(0),[G,D]=a.useState(0),[z,P]=a.useState(0),S=M&&u==="on",[K,Z]=a.useState(!1),U=a.useRef(null),[N,pe]=a.useState(0),[g,ue]=a.useState(0),ve=a.useRef(null),ge=E=>{var Y,se,de,fe,Ne;return{fontSettings:{fontFamily:(e==null?void 0:e[`${E}FontFamily`])??"Arial",fontWeight:((Y=e==null?void 0:e[`${E}FontSettings`])==null?void 0:Y.fontWeight)??400,fontStyle:((se=e==null?void 0:e[`${E}FontSettings`])==null?void 0:se.fontStyle)??"normal"},textAppearance:{textTransform:((de=e==null?void 0:e[`${E}TextAppearance`])==null?void 0:de.textTransform)??"none",textDecoration:((fe=e==null?void 0:e[`${E}TextAppearance`])==null?void 0:fe.textDecoration)??"none",fontVariant:((Ne=e==null?void 0:e[`${E}TextAppearance`])==null?void 0:Ne.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${E}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${E}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${E}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${E}LineHeight`])??.01,color:(e==null?void 0:e[`${E}Color`])??"#000000"}},Ee=ge("text"),te=ge("caption"),me=a.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(E=>{var X,Y;return(((X=E.text)==null?void 0:X.length)??0)>0||(((Y=E.caption)==null?void 0:Y.length)??0)>0}),[t]),J=a.useMemo(()=>!C||(t==null?void 0:t.length)===0?1:G<=0||ee<=0?Ga:Math.max(Ga,Math.ceil(ee/G)+1),[C,t==null?void 0:t.length,G,ee]);a.useLayoutEffect(()=>{if(!C)return;const E=W.current,X=B.current;if(!E||!X)return;let Y=0;const se=()=>{const Ne=E.getBoundingClientRect().width,We=X.getBoundingClientRect().width,j=ve.current,Ce=typeof j=="number"&&Math.abs(j-We)<=.25;if(ve.current=We,ne(Ne),typeof We=="number"&&We>0&&G<=0){D(We);return}Ce&&We!==G?D(We):!Ce&&G<=0&&(cancelAnimationFrame(Y),Y=requestAnimationFrame(se))},de=()=>{cancelAnimationFrame(Y),Y=requestAnimationFrame(se)};de();const fe=new ResizeObserver(de);return fe.observe(E),fe.observe(X),()=>{cancelAnimationFrame(Y),fe.disconnect()}},[M,C,G]),a.useLayoutEffect(()=>{const E=F.current;if(!C||!E)return;const X=G>0?G:0,Y=X>0&&q>0?X/q*1e3:0,se=`${Math.max(0,Y)/1e3}s`;E.style.setProperty("--marquee-distance",`${X}px`),E.style.setProperty("--marquee-duration",se)},[M,C,q,G]),a.useLayoutEffect(()=>{if(!C){P(0);return}const E=B.current,X=F.current;if(!E||!X)return;const Y=()=>{let de=0;for(let fe=0;fe<E.children.length;fe++){const We=E.children[fe].firstElementChild;We&&(de=Math.max(de,We.offsetHeight))}de<=0&&(de=X.offsetHeight),P(de>0?de:0)};Y();const se=new ResizeObserver(Y);return se.observe(E),se.observe(X),()=>{se.disconnect()}},[C,J,t,n,m,y,w,T,L,R,A,N,g]);const be=()=>{S&&Z(!0)},le=()=>{S&&Z(!1)},ce=a.useMemo(()=>{switch(s){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[s]),re=a.useMemo(()=>{switch(s){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[s]),Ie=a.useCallback((E,X,Y,se)=>r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ce,width:"100%"},children:[r.jsx("div",{"data-controls":b?se==null?void 0:se.controlsName:void 0,"data-controls-axis":b?"y":void 0,className:b?`${l}-control`:void 0,style:{height:f((se==null?void 0:se.marginTop)??0)}}),r.jsx("div",{...se!=null&&se.dataMeasureKind?{"data-testimonial-measure":se.dataMeasureKind}:{},style:{..._t(E,n),textAlign:re,pointerEvents:"auto",...typeof(se==null?void 0:se.minHeightPx)=="number"&&se.minHeightPx>0?{minHeight:se.minHeightPx}:{}},children:r.jsx(Si,{content:X})})]},Y),[ce,re,n,b,l,f]),ke=a.useCallback((E,X,Y)=>{var se,de,fe;return r.jsxs("div",{style:{padding:`${f(w.top)} ${f(w.right)} ${f(w.bottom)} ${f(w.left)}`,width:f(y+T*2),height:"100%",borderRadius:f(L),border:`${f(T)} solid ${h}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[r.jsx("div",{className:`${l}-cover`,style:{background:v}}),r.jsxs("div",{className:`${l}-elements-overlay`,style:{alignItems:ce,textAlign:re},children:[E.text&&Ie(Ee,E.text,"text",Y!=null&&Y.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(Y==null?void 0:Y.textMinHeightPx)=="number"&&Y.textMinHeightPx>0?{minHeightPx:Y.textMinHeightPx}:void 0),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ce,width:"100%"},children:[r.jsx("div",{"data-controls":b&&!(Y!=null&&Y.dataMeasureAttrs)?"logoMarginTop":void 0,className:b&&!(Y!=null&&Y.dataMeasureAttrs)?`${l}-control`:void 0,style:{height:f(I)}}),r.jsx("div",{style:{width:f(R),height:f(A)},children:((se=E.logo)==null?void 0:se.url)&&r.jsx("img",{src:E.logo.url,alt:((de=E.logo)==null?void 0:de.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((fe=E.logo)==null?void 0:fe.objectFit)||"contain"}})})]}),E.caption&&Ie(te,E.caption,"caption",{...Y!=null&&Y.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:H,...Y!=null&&Y.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(Y==null?void 0:Y.captionMinHeightPx)=="number"&&Y.captionMinHeightPx>0?{minHeightPx:Y.captionMinHeightPx}:{}})]})]},X)},[v,H,te,y,L,A,I,R,ce,re,w.bottom,w.left,w.right,w.top,Ie,T,h,Ee,n,b,l]),Le=a.useCallback(E=>{pe(E.maxTextPx),ue(E.maxCaptionPx)},[]);a.useLayoutEffect(()=>{if(!me){Le({maxTextPx:0,maxCaptionPx:0});return}const E=U.current;if(!E)return;const X=()=>{_.readTestimonialTextMeasure(E,Le)};X();const Y=new ResizeObserver(X);return Y.observe(E),()=>{Y.disconnect()}},[me,Le,t,ke]);const Fe=me?{textMinHeightPx:N,captionMinHeightPx:g}:void 0,$=me?r.jsx("div",{ref:U,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((E,X)=>ke(E,`measure-${X}`,{dataMeasureAttrs:!0}))}):null,ae=(E,X)=>r.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[ke(E,`card-${X}`,Fe),b&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${f(m)})`,width:f(m),height:"100%",pointerEvents:"auto",zIndex:2}})]},X);if(C){const E=M?S&&K?"paused":"running":"paused";return r.jsxs("div",{ref:W,className:nt(`${l}-wrapper`,`${l}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...z>0?{height:z}:{}},children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:qa(l)}}),$,r.jsx("div",{ref:F,className:`${l}-marquee-track`,"data-direction":c,onMouseEnter:be,onMouseLeave:le,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px","--marquee-play-state":E},children:Array.from({length:J},(X,Y)=>r.jsx("div",{ref:Y===0?B:void 0,className:`${l}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:f(m),paddingRight:f(m)},"aria-hidden":Y>0,children:t==null?void 0:t.map((se,de)=>ae(se,`${Y}-${de}`))},`set-${Y}`))})]})}return r.jsxs("div",{className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:qa(l)}}),$,r.jsx("div",{style:{gap:f(m),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((E,X)=>ae(E,X))})]})},kp=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
2498
2498
|
import cn from 'classnames';
|
|
2499
2499
|
import { CommonComponentProps } from '../props';
|
|
2500
2500
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -3109,7 +3109,7 @@ type TestimonialsSettings = {
|
|
|
3109
3109
|
logoHeight: number;
|
|
3110
3110
|
captionMarginTop: number;
|
|
3111
3111
|
};
|
|
3112
|
-
`,Ka={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Ap={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:"Fill Text",display:{type:"palette-color-picker"}},captionColor:{type:"string",scope:"common",title:"Fill Caption",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:{...Ka.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:{...Ka.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:.058,textLineHeight:.088,captionFontSize:.053,captionLineHeight:.069},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"}]}]}]}},Wp={element:Pp,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:Ap,sourceCode:kp,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function
|
|
3112
|
+
`,Ka={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Ap={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:"Fill Text",display:{type:"palette-color-picker"}},captionColor:{type:"string",scope:"common",title:"Fill Caption",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:{...Ka.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:{...Ka.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:.058,textLineHeight:.088,captionFontSize:.053,captionLineHeight:.069},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"}]}]}]}},Wp={element:Pp,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:Ap,sourceCode:kp,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function Fp(e){return`
|
|
3113
3113
|
.${e}-container {
|
|
3114
3114
|
position: relative;
|
|
3115
3115
|
overflow-x: clip;
|
|
@@ -3233,7 +3233,7 @@ type TestimonialsSettings = {
|
|
|
3233
3233
|
width: 100%;
|
|
3234
3234
|
height: 100%;
|
|
3235
3235
|
}
|
|
3236
|
-
`}const
|
|
3236
|
+
`}const _p=3e3,Np=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=_.useScopedStyles(),s=t||[],{speed:d,align:c,width:u,imageMarginTop:m,textMarginTop:y,captionMarginTop:L,imageWidth:T,imageHeight:h,controlsWidth:v,controlsColor:w,controlsHoverColor:I}=e,R=d>0&&(!n||!!i),[A,H]=a.useState(0),[b,O]=a.useState(null),[M,C]=a.useState(!1),q=a.useRef(null),f=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(()=>{H(0),O(null),C(!1)},[s.length]);const F=s[A],B=b===null?null:s[b],ee=te=>{var J,be,le,ce,re;return{fontSettings:{fontFamily:(e==null?void 0:e[`${te}FontFamily`])??"Arial",fontWeight:((J=e==null?void 0:e[`${te}FontSettings`])==null?void 0:J.fontWeight)??400,fontStyle:((be=e==null?void 0:e[`${te}FontSettings`])==null?void 0:be.fontStyle)??"normal"},textAppearance:{textTransform:((le=e==null?void 0:e[`${te}TextAppearance`])==null?void 0:le.textTransform)??"none",textDecoration:((ce=e==null?void 0:e[`${te}TextAppearance`])==null?void 0:ce.textDecoration)??"none",fontVariant:((re=e==null?void 0:e[`${te}TextAppearance`])==null?void 0:re.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${te}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${te}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${te}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${te}WordSpacing`])??0,color:(e==null?void 0:e[`${te}Color`])??"#000000"}},ne=ee("text"),G=ee("caption"),D=s.length>1&&s.some(te=>{var me,J;return(((me=te.text)==null?void 0:me.length)??0)>0||(((J=te.caption)==null?void 0:J.length)??0)>0}),z=a.useRef(null),[P,S]=a.useState(0),[K,Z]=a.useState(0),U=e.controls??{mode:"Off",icon:null},N=s.length>1,pe=a.useCallback((te,me)=>!N||me===te?te:(q.current&&window.clearTimeout(q.current),O(te),C(!0),q.current=window.setTimeout(()=>{O(null),C(!1),q.current=null},300),me),[N]),g=a.useCallback(()=>{N&&H(te=>pe(te,(te-1+s.length)%s.length))},[N,pe,s.length]),ue=a.useCallback(()=>{N&&H(te=>pe(te,(te+1)%s.length))},[N,pe,s.length]);a.useEffect(()=>{if(!R||!N)return;const te=Math.max(300,_p/d),me=window.setInterval(()=>{H(J=>pe(J,(J+1)%s.length))},te);return()=>{window.clearInterval(me)}},[R,N,pe,s.length,d]),a.useEffect(()=>()=>{q.current&&window.clearTimeout(q.current)},[]);const ve=(te,me)=>{var re,Ie,ke,Le;const J=me==null?void 0:me.textMinHeightPx,be=me==null?void 0:me.captionMinHeightPx,le=me==null?void 0:me.dataMeasureAttrs,ce=o&&!(me!=null&&me.dataMeasureAttrs)&&!(me!=null&&me.hideControls);return r.jsxs(r.Fragment,{children:[te.text&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:f,width:"100%"},children:[r.jsx("div",{"data-controls":ce?"textMarginTop":void 0,className:ce?`${l}-control`:void 0,style:{height:_.scalingValue(y??0,n??!1)}}),r.jsx("div",{...le&&{"data-testimonial-measure":"text"},style:{..._t(ne,n),...J&&J>0?{minHeight:J}:{},textAlign:W,pointerEvents:"auto"},children:r.jsx(Si,{content:te.text})})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:f,width:"100%"},children:[r.jsx("div",{"data-controls":ce?"imageMarginTop":void 0,className:ce?`${l}-control`:void 0,style:{height:_.scalingValue(m??0,n??!1)}}),r.jsx("div",{style:{width:_.scalingValue(T??0,n??!1),height:_.scalingValue(h??0,n??!1)},children:((re=te.image)==null?void 0:re.url)&&r.jsx("img",{src:(Ie=te.image)==null?void 0:Ie.url,alt:((ke=te.image)==null?void 0:ke.name)??"",className:`${l}-icon`,style:{objectFit:((Le=te.image)==null?void 0:Le.objectFit)||"contain"}})})]}),te.caption&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:f,width:"100%"},children:[r.jsx("div",{"data-controls":ce?"captionMarginTop":void 0,className:ce?`${l}-control`:void 0,style:{height:_.scalingValue(L??0,n??!1)}}),r.jsx("div",{...le?{"data-testimonial-measure":"caption"}:{},style:{..._t(G,n),...be&&be>0?{minHeight:be}:{},textAlign:W,pointerEvents:"auto"},children:r.jsx(Si,{content:te.caption})})]})]})},ge=a.useCallback(te=>{S(te.maxTextPx),Z(te.maxCaptionPx)},[]);if(a.useLayoutEffect(()=>{if(!D){ge({maxTextPx:0,maxCaptionPx:0});return}const te=z.current;if(!te)return;const me=()=>{_.readTestimonialTextMeasure(te,ge)};me();const J=new ResizeObserver(me);return J.observe(te),()=>{J.disconnect()}},[D,ge,t]),!F)return r.jsx(r.Fragment,{});const Ee=D?{textMinHeightPx:P,captionMinHeightPx:K}:void 0;return r.jsx(r.Fragment,{children:r.jsxs("div",{className:`${l}-container`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Fp(l)}}),r.jsxs("div",{className:`${l}-wrapper`,style:{width:_.scalingValue(u??0,n??!1),alignItems:f},children:[D&&r.jsx("div",{ref:z,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:s.map((te,me)=>r.jsx("div",{style:{width:"100%"},children:ve(te,{dataMeasureAttrs:!0})},me))}),r.jsxs("div",{className:`${l}-fade-stack`,children:[B&&M&&r.jsx("div",{className:nt(`${l}-fade-item-prev`,`${l}-fade-out`),children:ve(B,{...Ee,hideControls:!0})}),r.jsx("div",{className:nt(`${l}-fade-item-current`,M?`${l}-fade-in`:void 0),children:ve(F,Ee)})]})]}),U.mode==="On"&&r.jsxs("div",{className:`${l}-controls`,children:[r.jsx("div",{className:`${l}-arrow`,style:{width:_.scalingValue(v??.02,n??!1),height:_.scalingValue(v??.02,n??!1),"--arrow-hover-color":I},children:r.jsx("button",{type:"button",className:`${l}-arrow-inner`,onClick:g,disabled:!N,"aria-label":"Previous testimonial",children:U.icon&&r.jsx(Zt,{url:U.icon,fill:w,hoverFill:I,className:nt(`${l}-arrow-img`,`${l}-mirror`)})})}),r.jsx("div",{className:nt(`${l}-arrow`,`${l}-next-arrow`),style:{width:_.scalingValue(v??.02,n??!1),height:_.scalingValue(v??.02,n??!1),"--arrow-hover-color":I},children:r.jsx("button",{type:"button",className:`${l}-arrow-inner`,onClick:ue,disabled:!N,"aria-label":"Next testimonial",children:U.icon&&r.jsx(Zt,{url:U.icon,fill:w,hoverFill:I,className:`${l}-arrow-img`})})})]})]})})},Hp=`import cn from 'classnames';
|
|
3237
3237
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3238
3238
|
import { CommonComponentProps } from '../props';
|
|
3239
3239
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -3729,7 +3729,7 @@ type TestimonialsSettings = {
|
|
|
3729
3729
|
icon?: string | null;
|
|
3730
3730
|
};
|
|
3731
3731
|
};
|
|
3732
|
-
`,Op="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>'),Ua={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},jp={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:"Fill Controls",display:{type:"settings-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Hover Controls",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:{...Ua.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:"Fill Caption"},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Ua.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:"Fill Text"}},defaults:{controls:{mode:"On",icon:Op},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},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"}]}]}]}},Bp={element:Np,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,height:300},t:{width:373,height:300},m:{width:334,height:300}},schema:jp,sourceCode:Hp,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function zp(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Xa(e){return((e==null?void 0:e.trim().length)??0)>0}function wr(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Sr(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:
|
|
3732
|
+
`,Op="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>'),Ua={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},jp={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:"Fill Controls",display:{type:"settings-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Hover Controls",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:{...Ua.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:"Fill Caption"},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Ua.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:"Fill Text"}},defaults:{controls:{mode:"On",icon:Op},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},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"}]}]}]}},Bp={element:Np,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,height:300},t:{width:373,height:300},m:{width:334,height:300}},schema:jp,sourceCode:Hp,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function zp(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Xa(e){return((e==null?void 0:e.trim().length)??0)>0}function wr(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Sr(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:_.scalingValue((o-t)/2,i)}}function Dp(e){return`
|
|
3733
3733
|
.${e}-wrapper {
|
|
3734
3734
|
display: grid;
|
|
3735
3735
|
align-items: start;
|
|
@@ -4070,7 +4070,7 @@ type TestimonialsSettings = {
|
|
|
4070
4070
|
pointer-events: auto;
|
|
4071
4071
|
z-index: 10;
|
|
4072
4072
|
}
|
|
4073
|
-
`}const yn=500,Vp=750,Kn="cubic-bezier(0.22, 1, 0.36, 1)",qp=72,Gp=50;function Kp(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 Up(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Xp(e){const[t]=e.media;return t!=null&&t.url?t:null}function Yp(e){return!Array.isArray(e)||e.length===0?[]:Kp(e)?e.flatMap(t=>{const n=Up(t);if(!n)return[];const i=Xp(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 Bi(e){return e.type==="video"}function Jp(e){e.pause(),e.removeAttribute("src"),e.load()}function Ya({media:e,className:t,style:n,onMediaClick:i}){return Bi(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 $o(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Zp(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Qp({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:l,onMouseMove:s,onTransitionEnd:d}){return a.useEffect(()=>{const c=n.current;if(c)return()=>{Jp(c)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:l,onMouseMove:s,onTransitionEnd:d,style:i})}function em({items:e,index:t,imageDisplay:n,onClose:i,onPrev:o,onNext:l,counterClassName:s,counterStyle:d}){const c=n==="cover",u=a.useRef(null),m=a.useRef(null),y=a.useRef(null),L=a.useRef(null),T=a.useRef(0),h=a.useRef(0),v=a.useRef("none"),w=a.useRef(!1),I=a.useRef(!1),R=a.useRef(!1),A=a.useRef(null),[H,b]=a.useState(null),[O,M]=a.useState("opening"),[C,q]=a.useState(0),[f,W]=a.useState(0),[_,B]=a.useState(!1),[ee,ne]=a.useState(!1),[G,D]=a.useState(!1),z=a.useRef(t),P=e[t],S=P?Bi(P):!1,K=f!==0||_,Z=a.useCallback(re=>{R.current=re,B(re)},[]),U=a.useCallback(()=>{A.current!==null&&(window.clearTimeout(A.current),A.current=null)},[]),N=a.useCallback(()=>{U(),A.current=window.setTimeout(()=>{U(),Z(!1)},yn+32)},[U,Z]),pe=a.useCallback(()=>{const re=m.current,Ie=y.current;if(!re)return;const ke=re.getBoundingClientRect(),Le=ke.width,_e=ke.height;if(!Le||!_e)return;if(n==="cover"){b({width:Le,height:_e,left:ke.left,top:ke.top});return}if(!Ie){b($o(re));return}const{width:$,height:ae}=Zp(Ie);if(!$||!ae){b($o(re));return}const E=$/ae,X=Le/_e;if(E>X){const Y=Le/E;b({width:Le,height:Y,left:ke.left,top:ke.top+(_e-Y)/2})}else{const Y=_e*E;b({width:Y,height:_e,left:ke.left+(Le-Y)/2,top:ke.top})}},[n]);a.useEffect(()=>{pe();const re=m.current;if(!re)return;const Ie=new ResizeObserver(()=>pe());return Ie.observe(re),()=>Ie.disconnect()},[pe,t]),a.useEffect(()=>{O==="opening"&&H&&M("open")},[O,H]),a.useEffect(()=>{if(O!=="closing")return;const re=setTimeout(()=>i(),yn);return()=>clearTimeout(re)},[O,i]),a.useEffect(()=>()=>{U()},[U]),a.useLayoutEffect(()=>{if(z.current===t)return;U(),q(0),W(0),Z(!1),D(!1),ne(!1),T.current=0,h.current=0,v.current="none",w.current=!1,L.current=null,I.current=!1;const re=m.current;re&&b($o(re)),z.current=t},[t,Z,U]),a.useEffect(()=>{if(O!=="open")return;const re=()=>{const ae=E=>{E.stopPropagation(),E.preventDefault(),document.removeEventListener("click",ae,!0)};document.addEventListener("click",ae,!0)},Ie=ae=>{U(),R.current=!1,B(!1),W(0),ne(!1),w.current=!1,h.current=0,v.current="none";const E=m.current;E&&b($o(E)),ae<0?l():o()},ke=ae=>{if(Math.abs(ae)>Gp&&e.length>1){Ie(ae);return}Z(!0),W(0),N()},Le=ae=>{if(ae.touches.length!==1||R.current)return;const E=ae.touches[0];I.current=!0,L.current={x:E.clientX,y:E.clientY},v.current="none",h.current=0,w.current=!1},_e=ae=>{if(!L.current||ae.touches.length!==1||R.current)return;const E=ae.touches[0],X=E.clientX-L.current.x,Y=E.clientY-L.current.y;if(v.current==="none"){if(Math.abs(X)<10&&Math.abs(Y)<10)return;if(Math.abs(X)>Math.abs(Y)){if(e.length<=1)return;v.current="horizontal"}else if(Y>0)v.current="vertical";else return}if(v.current==="horizontal"){w.current=!0,ne(!0),h.current=X,W(X),ae.preventDefault();return}v.current==="vertical"&&(w.current=!0,ne(!0),T.current=Y,q(Y),ae.preventDefault())},$=()=>{if(!L.current)return;const ae=v.current,E=w.current;if(E&&ae==="horizontal")ke(h.current),re();else if(E&&ae==="vertical"){if(T.current>qp){const Y=window.innerHeight;T.current=Y,D(!0),q(Y),M("closing")}else T.current=0,q(0);re()}else ae==="horizontal"&&Math.abs(h.current)>0&&(ke(h.current),re());L.current=null,v.current="none",h.current=0,w.current=!1,ne(!1)};return document.addEventListener("touchstart",Le,{passive:!0}),document.addEventListener("touchmove",_e,{passive:!1}),document.addEventListener("touchend",$),document.addEventListener("touchcancel",$),()=>{document.removeEventListener("touchstart",Le),document.removeEventListener("touchmove",_e),document.removeEventListener("touchend",$),document.removeEventListener("touchcancel",$)}},[O,e.length,l,o,Z,N]),a.useEffect(()=>{const re=Ie=>{Ie.key==="Escape"&&(Ie.preventDefault(),Ie.stopPropagation(),O!=="closing"&&M("closing"))};return window.addEventListener("keydown",re,!0),()=>window.removeEventListener("keydown",re,!0)},[O]);const g=()=>{O!=="closing"&&M("closing")},ue=O==="open",ve=O==="closing",ge=C>0?Math.max(0,1-C/500):1,Ee=C>0?Math.max(.35,1-C/500):1,te=re=>{if(re.stopPropagation(),I.current){I.current=!1;return}if(e.length<=1)return;const Ie=re.currentTarget.getBoundingClientRect(),ke=re.clientY-Ie.top,Le=Math.min(52,Ie.height*.2);if(!(ke>Ie.height-Le)){if(re.clientX-Ie.left<Ie.width/2){o();return}l()}},me=re=>{if(e.length<=1)return;const Ie=re.currentTarget.getBoundingClientRect(),ke=re.clientX-Ie.left,Le=re.clientY-Ie.top,_e=Math.min(52,Ie.height*.2);if(Le>Ie.height-_e){re.currentTarget.style.cursor="default";return}re.currentTarget.style.cursor=ke<Ie.width/2?"w-resize":"e-resize"},J=a.useCallback(re=>{re.propertyName!=="transform"||!R.current||(U(),Z(!1))},[U,Z]),be=K?`translateX(${f}px)`:C>0?`translateY(${C}px)`:void 0,le={position:"fixed",top:H==null?void 0:H.top,left:H==null?void 0:H.left,width:H==null?void 0:H.width,height:H==null?void 0:H.height,objectFit:n==="cover"?"cover":"contain",transform:be,opacity:C>0?Ee:O==="opening"||ve?0:1,transition:ee&&!_?"none":_?`transform ${yn}ms ${Kn}`:G?`transform ${yn}ms ${Kn}, opacity ${yn}ms ${Kn}`:O==="opening"||ve?`opacity ${yn}ms ${Kn}`:"none",pointerEvents:S&&ue&&!K?"auto":"none",touchAction:S&&ue?"none":void 0,zIndex:9998},ce=H?{position:"fixed",top:H.top,height:H.height,width:H.width/2,zIndex:9999}:null;return r.jsxs("div",{ref:u,style:{position:"fixed",top:"var(--cntrl-article-top, 0)",left:"var(--cntrl-article-left, 0)",width:"var(--cntrl-article-width, 100vw) !important",height:"var(--cntrl-viewport-height, 100vh) !important",zIndex:9997,touchAction:O==="open"?"none":void 0},onClick:g,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:ue?ge:0,transition:ee?"none":`opacity ${yn}ms ${Kn}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:c?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:m,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:ue?1:0,transition:`opacity ${yn}ms ${Kn}`,pointerEvents:"none",zIndex:9999},children:e.length>1&&r.jsxs("p",{className:s,style:d,children:[t+1," / ",e.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:m,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ue?1:0,transition:`opacity ${yn}ms ${Kn}`},children:e.length>1&&r.jsxs("p",{className:s,style:d,children:[t+1," / ",e.length]})})]})}),H&&P&&(S?r.jsx(Qp,{src:P.url,phase:O,mediaRef:y,mediaStyle:le,onLoadedMetadata:pe,onClick:te,onMouseMove:me,onTransitionEnd:J},`${t}-${P.url}`):r.jsx("img",{ref:y,src:P.url,alt:P.name,onLoad:pe,onTransitionEnd:J,style:le},`${t}-${P.url}`)),ue&&ce&&e.length>1&&!S&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...ce,left:H.left,cursor:"w-resize",pointerEvents:K?"none":"auto"},onClick:re=>{if(I.current){I.current=!1;return}re.stopPropagation(),o()}}),r.jsx("div",{style:{...ce,left:H.left+H.width/2,cursor:"e-resize",pointerEvents:K?"none":"auto"},onClick:re=>{if(I.current){I.current=!1;return}re.stopPropagation(),l()}})]})]})}function tm(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function nm({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:l,activeEvent:s,layoutId:d,portalId:c}){const{prefix:u}=F.useScopedStyles(),{type:m="a",gridLayout:y,textBoxWidth:L=100,verticalGap:T,entriesCount:h,lightbox:v,imageDisplay:w,lightboxImageDisplay:I,slider:R,sliderTiming:A,direction:H,transition:b,titleMarginTop:O,subtitleMarginTop:M,titleColor:C,subtitleColor:q,lightboxCounterColor:f,titleFontFamily:W,titleFontSettings:_,titleFontSize:B,titleLineHeight:ee,titleLetterSpacing:ne,titleWordSpacing:G,titleTextAppearance:D,subtitleFontFamily:z,subtitleFontSettings:P,subtitleFontSize:S,subtitleLineHeight:K,subtitleLetterSpacing:Z,subtitleWordSpacing:U,subtitleTextAppearance:N,lightboxCounterFontFamily:pe,lightboxCounterFontSettings:g,lightboxCounterFontSize:ue,lightboxCounterLineHeight:ve,lightboxCounterLetterSpacing:ge,lightboxCounterWordSpacing:Ee,lightboxCounterTextAppearance:te,showText:me="always",alignEntries:J="off",align:be="top"}=e,le={fontSettings:{fontFamily:W,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:B??.01,lineHeight:ee,letterSpacing:ne??0,wordSpacing:G??0,textAppearance:D,color:C},re={...Jt(Ft(le,n))},Ie={fontSettings:{fontFamily:z,fontWeight:(P==null?void 0:P.fontWeight)??400,fontStyle:(P==null?void 0:P.fontStyle)??"normal"},fontSize:S??.01,lineHeight:K,letterSpacing:Z??0,wordSpacing:U??0,textAppearance:N,color:q},Le={...Jt(Ft(Ie,n))},_e={fontSettings:{fontFamily:pe,fontWeight:(g==null?void 0:g.fontWeight)??400,fontStyle:(g==null?void 0:g.fontStyle)??"normal"},fontSize:ue??.01,lineHeight:ve,letterSpacing:ge??0,wordSpacing:Ee??0,textAppearance:te,color:f},ae={...Jt(Ft(_e,n)),...Sr(ue,ve,u,n)},E=wr(B,ee,`${u}-item-title`,`${u}-text-tight-leading`),X=wr(S,K,`${u}-item-subtitle`,`${u}-text-tight-leading`),Y=Sr(B,ee,u,n),se=Sr(S,K,u,n),de=wr(ue,ve,`${u}-lightbox-counter`,`${u}-text-tight-leading`),fe=F.buildColorVars(u,{titleColor:C,subtitleColor:q,lightboxCounterColor:f},im,om),j=`${s&&s!=="default"?`${u}-state-${s}`:""}${me==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),Ce=h===0?1/0:h,Q=(t??[]).slice(0,Ce),he=y.entryWidth??.2,$e=(w==null?void 0:w.display)==="cover",Oe=(w==null?void 0:w.ratioValue)??"1:1",Ye=(w==null?void 0:w.reversed)??!1,[Be,Ve]=Oe.split(":").map(Number),wt=`${Ye?Ve:Be} / ${Ye?Be:Ve}`,Ct=F.scalingValue(he??0,n),Ze=!$e&&R!=="off",ze={width:Ct,...$e?{aspectRatio:wt,height:"auto",overflow:"hidden"}:{height:"auto"}},Je=`${u}-item-image-wrapper${Ze?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),it=m==="d"||m==="e"||m==="f",qe=J==="on",yt=`calc(${F.scalingValue(he??0,n)} * (${L} / 100))`,rt=F.scalingValue(he*L/100,n),ot=$e?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},[kt,Ht]=a.useState("ltr"),[Ge,$t]=a.useState(0),Ue=a.useRef(null);a.useEffect(()=>{const we=Ue.current;if(!we)return;const He=new ResizeObserver(ie=>{$t(Math.round(ie[0].contentRect.width))});return He.observe(we),()=>He.disconnect()},[]);const st=(()=>{const we={...fe},He=Ue.current?getComputedStyle(Ue.current).getPropertyValue("--cntrl-article-width").trim():"";return He&&(we["--cntrl-article-width"]=He),we})(),[gt,ut]=a.useState(!1),[Bt,tn]=a.useState([]),[ln,ct]=a.useState(0),Ot=v==="on"&&(!n||i),At=(we,He)=>{n&&!i||v!=="off"&&(tn(we),ct(He),ut(!0))};a.useEffect(()=>{if(!gt||v!=="on"||typeof document>"u")return;const we=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=we}},[gt,v]),a.useEffect(()=>{!n||i||ut(!1)},[n,i]);const ye=a.useMemo(()=>Dp(u),[u]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ye}}),r.jsx("div",{style:fe,children:r.jsx("div",{ref:Ue,className:`${u}-wrapper ${u}-type-${m}${qe?` ${u}-align-entries`:""} ${u}-image-align-${be} ${j}`.trim(),style:{gridTemplateColumns:`repeat(${y.columnsCount}, minmax(0, 1fr))`,rowGap:qe?0:F.scalingValue(T??0,n),columnGap:F.scalingValue(y.horizontalGap??0,n),width:F.scalingValue(y.wrapperWidth??0,n),...qe?{[`--${u}-align-entries-row-gap`]:F.scalingValue(T??0,n)}:{}},children:Q.map((we,He)=>{var It;const ie=Xa(we.title),Te=Xa(we.subtitle),Me=(((It=we.link)==null?void 0:It.length)??0)>0&&v==="off"?we.link:void 0,Pe=Math.floor(He/y.columnsCount)===Math.ceil(Q.length/y.columnsCount)-1,De=it?r.jsxs("div",{className:`${u}-item-text-block`,children:[ie&&r.jsx("p",{className:E,style:{width:yt,...re,...Y},children:we.title}),ie&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(O??0,n),width:rt}}),Te&&r.jsx("p",{className:X,style:{width:yt,...Le,...se},children:we.subtitle}),Te&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(M??0,n),width:rt}})]}):null,pt=qe?r.jsxs("div",{className:`${u}-item-title-row`,children:[!it&&r.jsx("div",{"data-controls":o&&ie?"titleMarginTop":void 0,className:o&&ie?`${u}-control`:void 0,style:{height:ie?F.scalingValue(O??0,n):0,width:rt}}),ie&&r.jsx("p",{className:E,style:{width:yt,...re,...Y},children:we.title}),it&&ie&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(O??0,n),width:rt}})]}):null,Fe=qe?r.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!it&&r.jsx("div",{"data-controls":o&&Te?"subtitleMarginTop":void 0,className:o&&Te?`${u}-control`:void 0,style:{height:Te?F.scalingValue(M??0,n):0,width:rt}}),Te&&r.jsx("p",{className:X,style:{width:yt,...Le,...se},children:we.subtitle}),it&&Te&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(M??0,n),width:rt}})]}):null,mt=Me?r.jsxs("a",{href:Me,target:"_blank",className:`${u}-item-text-link`,children:[pt,Fe]}):r.jsxs(r.Fragment,{children:[pt,Fe]}),et=Yp(we.gallery),vt=et.filter(tt=>tt.lightboxMedia).map(tt=>tt.lightboxMedia),ht=r.jsx("div",{className:Je,style:ze,children:et.length===0?null:R==="off"?(()=>{const{displayMedia:tt,lightboxMedia:Lt}=et[0],Et=Lt?vt.findIndex(Rt=>Rt.url===Lt.url):-1;return r.jsx(Ya,{media:tt,className:`${u}-item-${Bi(tt)?"video":"image"}`.trim(),style:ot,onMediaClick:Ot&&Et>=0?()=>At(vt,Et):void 0})})():r.jsxs(r.Fragment,{children:[Ze&&qe&&r.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:et.map(({displayMedia:tt})=>Bi(tt)?r.jsx("video",{src:tt.url,muted:!0,playsInline:!0},`sizer-${tt.url}`):r.jsx("img",{src:tt.url,alt:""},`sizer-${tt.url}`))}),r.jsx(ua,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:A*1e3,width:"100%",height:"100%",speed:Vp,type:b==="fade"?"fade":"loop",rewind:b==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:b==="fade"?"ltr":H!=="random"?H==="horizontal"?"ltr":"ttb":kt},onMoved:tt=>{if(H!=="random"||b==="fade")return;const Lt=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";Ht(Lt),setTimeout(()=>{tt.refresh()},0)},children:et.map(({displayMedia:tt,lightboxMedia:Lt},Et)=>{const Rt=Lt?vt.findIndex(cn=>cn.url===Lt.url):-1;return r.jsx(pa,{children:r.jsx(Ya,{media:tt,className:`${u}-item-${Bi(tt)?"video":"image"}`.trim(),style:ot,onMediaClick:Ot&&Rt>=0?()=>At(vt,Rt):void 0})},Et)})},`${b}-${he}-${H}-${A}-${Ge}-${d}`)]})}),Wt=it?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&ie?"titleMarginTop":void 0,className:o&&ie?`${u}-control`:void 0,style:{height:ie?F.scalingValue(O??0,n):0,width:rt}}),r.jsx("p",{className:E,style:{width:yt,...re,...Y},children:we.title}),r.jsx("div",{"data-controls":o&&Te?"subtitleMarginTop":void 0,className:o&&Te?`${u}-control`:void 0,style:{height:Te?F.scalingValue(M??0,n):0,width:rt}}),r.jsx("p",{className:X,style:{width:yt,...Le,...se},children:we.subtitle})]});return r.jsx("div",{className:`${u}-item`.trim(),children:r.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${qe&&Pe?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(L??0)>100?`calc(${F.scalingValue(he??0,n)} * (${L} / 100))`:F.scalingValue(he??0,n)},children:qe?r.jsx(r.Fragment,{children:it?r.jsxs(r.Fragment,{children:[mt,r.jsx("a",{href:Me,target:"_blank",className:`${u}-item-image-link`,children:ht})]}):r.jsxs(r.Fragment,{children:[r.jsx("a",{href:Me,target:"_blank",className:`${u}-item-image-link`,children:ht}),mt]})}):Me?r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:Me,target:"_blank",className:`${u}-item-image-link`,children:[De,ht]}),!it&&r.jsx("a",{href:Me,target:"_blank",className:`${u}-item-text-link`,children:Wt})]}):r.jsxs(r.Fragment,{children:[De,ht,Wt]})})},He)})})}),(!n||i)&>&&typeof document<"u"&&v==="on"&&(()=>{const we=(c?document.getElementById(c):null)??document.body;return Mi.createPortal(r.jsx("div",{style:st,"data-selection":"none",children:r.jsx(em,{items:Bt,index:ln,imageDisplay:tm(I),onClose:()=>ut(!1),onPrev:()=>ct(He=>(He-1+Bt.length)%Bt.length),onNext:()=>ct(He=>(He+1)%Bt.length),counterClassName:de,counterStyle:ae})}),we)})()]})}const im={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},om=["hover","focus","filled","success","error"],rm=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
4073
|
+
`}const yn=500,Vp=750,Kn="cubic-bezier(0.22, 1, 0.36, 1)",qp=72,Gp=50;function Kp(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 Up(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Xp(e){const[t]=e.media;return t!=null&&t.url?t:null}function Yp(e){return!Array.isArray(e)||e.length===0?[]:Kp(e)?e.flatMap(t=>{const n=Up(t);if(!n)return[];const i=Xp(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 Bi(e){return e.type==="video"}function Jp(e){e.pause(),e.removeAttribute("src"),e.load()}function Ya({media:e,className:t,style:n,onMediaClick:i}){return Bi(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 $o(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Zp(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Qp({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:l,onMouseMove:s,onTransitionEnd:d}){return a.useEffect(()=>{const c=n.current;if(c)return()=>{Jp(c)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:l,onMouseMove:s,onTransitionEnd:d,style:i})}function em({items:e,index:t,imageDisplay:n,onClose:i,onPrev:o,onNext:l,counterClassName:s,counterStyle:d}){const c=n==="cover",u=a.useRef(null),m=a.useRef(null),y=a.useRef(null),L=a.useRef(null),T=a.useRef(0),h=a.useRef(0),v=a.useRef("none"),w=a.useRef(!1),I=a.useRef(!1),R=a.useRef(!1),A=a.useRef(null),[H,b]=a.useState(null),[O,M]=a.useState("opening"),[C,q]=a.useState(0),[f,W]=a.useState(0),[F,B]=a.useState(!1),[ee,ne]=a.useState(!1),[G,D]=a.useState(!1),z=a.useRef(t),P=e[t],S=P?Bi(P):!1,K=f!==0||F,Z=a.useCallback(re=>{R.current=re,B(re)},[]),U=a.useCallback(()=>{A.current!==null&&(window.clearTimeout(A.current),A.current=null)},[]),N=a.useCallback(()=>{U(),A.current=window.setTimeout(()=>{U(),Z(!1)},yn+32)},[U,Z]),pe=a.useCallback(()=>{const re=m.current,Ie=y.current;if(!re)return;const ke=re.getBoundingClientRect(),Le=ke.width,Fe=ke.height;if(!Le||!Fe)return;if(n==="cover"){b({width:Le,height:Fe,left:ke.left,top:ke.top});return}if(!Ie){b($o(re));return}const{width:$,height:ae}=Zp(Ie);if(!$||!ae){b($o(re));return}const E=$/ae,X=Le/Fe;if(E>X){const Y=Le/E;b({width:Le,height:Y,left:ke.left,top:ke.top+(Fe-Y)/2})}else{const Y=Fe*E;b({width:Y,height:Fe,left:ke.left+(Le-Y)/2,top:ke.top})}},[n]);a.useEffect(()=>{pe();const re=m.current;if(!re)return;const Ie=new ResizeObserver(()=>pe());return Ie.observe(re),()=>Ie.disconnect()},[pe,t]),a.useEffect(()=>{O==="opening"&&H&&M("open")},[O,H]),a.useEffect(()=>{if(O!=="closing")return;const re=setTimeout(()=>i(),yn);return()=>clearTimeout(re)},[O,i]),a.useEffect(()=>()=>{U()},[U]),a.useLayoutEffect(()=>{if(z.current===t)return;U(),q(0),W(0),Z(!1),D(!1),ne(!1),T.current=0,h.current=0,v.current="none",w.current=!1,L.current=null,I.current=!1;const re=m.current;re&&b($o(re)),z.current=t},[t,Z,U]),a.useEffect(()=>{if(O!=="open")return;const re=()=>{const ae=E=>{E.stopPropagation(),E.preventDefault(),document.removeEventListener("click",ae,!0)};document.addEventListener("click",ae,!0)},Ie=ae=>{U(),R.current=!1,B(!1),W(0),ne(!1),w.current=!1,h.current=0,v.current="none";const E=m.current;E&&b($o(E)),ae<0?l():o()},ke=ae=>{if(Math.abs(ae)>Gp&&e.length>1){Ie(ae);return}Z(!0),W(0),N()},Le=ae=>{if(ae.touches.length!==1||R.current)return;const E=ae.touches[0];I.current=!0,L.current={x:E.clientX,y:E.clientY},v.current="none",h.current=0,w.current=!1},Fe=ae=>{if(!L.current||ae.touches.length!==1||R.current)return;const E=ae.touches[0],X=E.clientX-L.current.x,Y=E.clientY-L.current.y;if(v.current==="none"){if(Math.abs(X)<10&&Math.abs(Y)<10)return;if(Math.abs(X)>Math.abs(Y)){if(e.length<=1)return;v.current="horizontal"}else if(Y>0)v.current="vertical";else return}if(v.current==="horizontal"){w.current=!0,ne(!0),h.current=X,W(X),ae.preventDefault();return}v.current==="vertical"&&(w.current=!0,ne(!0),T.current=Y,q(Y),ae.preventDefault())},$=()=>{if(!L.current)return;const ae=v.current,E=w.current;if(E&&ae==="horizontal")ke(h.current),re();else if(E&&ae==="vertical"){if(T.current>qp){const Y=window.innerHeight;T.current=Y,D(!0),q(Y),M("closing")}else T.current=0,q(0);re()}else ae==="horizontal"&&Math.abs(h.current)>0&&(ke(h.current),re());L.current=null,v.current="none",h.current=0,w.current=!1,ne(!1)};return document.addEventListener("touchstart",Le,{passive:!0}),document.addEventListener("touchmove",Fe,{passive:!1}),document.addEventListener("touchend",$),document.addEventListener("touchcancel",$),()=>{document.removeEventListener("touchstart",Le),document.removeEventListener("touchmove",Fe),document.removeEventListener("touchend",$),document.removeEventListener("touchcancel",$)}},[O,e.length,l,o,Z,N]),a.useEffect(()=>{const re=Ie=>{Ie.key==="Escape"&&(Ie.preventDefault(),Ie.stopPropagation(),O!=="closing"&&M("closing"))};return window.addEventListener("keydown",re,!0),()=>window.removeEventListener("keydown",re,!0)},[O]);const g=()=>{O!=="closing"&&M("closing")},ue=O==="open",ve=O==="closing",ge=C>0?Math.max(0,1-C/500):1,Ee=C>0?Math.max(.35,1-C/500):1,te=re=>{if(re.stopPropagation(),I.current){I.current=!1;return}if(e.length<=1)return;const Ie=re.currentTarget.getBoundingClientRect(),ke=re.clientY-Ie.top,Le=Math.min(52,Ie.height*.2);if(!(ke>Ie.height-Le)){if(re.clientX-Ie.left<Ie.width/2){o();return}l()}},me=re=>{if(e.length<=1)return;const Ie=re.currentTarget.getBoundingClientRect(),ke=re.clientX-Ie.left,Le=re.clientY-Ie.top,Fe=Math.min(52,Ie.height*.2);if(Le>Ie.height-Fe){re.currentTarget.style.cursor="default";return}re.currentTarget.style.cursor=ke<Ie.width/2?"w-resize":"e-resize"},J=a.useCallback(re=>{re.propertyName!=="transform"||!R.current||(U(),Z(!1))},[U,Z]),be=K?`translateX(${f}px)`:C>0?`translateY(${C}px)`:void 0,le={position:"fixed",top:H==null?void 0:H.top,left:H==null?void 0:H.left,width:H==null?void 0:H.width,height:H==null?void 0:H.height,objectFit:n==="cover"?"cover":"contain",transform:be,opacity:C>0?Ee:O==="opening"||ve?0:1,transition:ee&&!F?"none":F?`transform ${yn}ms ${Kn}`:G?`transform ${yn}ms ${Kn}, opacity ${yn}ms ${Kn}`:O==="opening"||ve?`opacity ${yn}ms ${Kn}`:"none",pointerEvents:S&&ue&&!K?"auto":"none",touchAction:S&&ue?"none":void 0,zIndex:9998},ce=H?{position:"fixed",top:H.top,height:H.height,width:H.width/2,zIndex:9999}:null;return r.jsxs("div",{ref:u,style:{position:"fixed",top:"var(--cntrl-article-top, 0)",left:"var(--cntrl-article-left, 0)",width:"var(--cntrl-article-width, 100vw) !important",height:"var(--cntrl-viewport-height, 100vh) !important",zIndex:9997,touchAction:O==="open"?"none":void 0},onClick:g,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:ue?ge:0,transition:ee?"none":`opacity ${yn}ms ${Kn}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:c?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:m,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:ue?1:0,transition:`opacity ${yn}ms ${Kn}`,pointerEvents:"none",zIndex:9999},children:e.length>1&&r.jsxs("p",{className:s,style:d,children:[t+1," / ",e.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:m,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ue?1:0,transition:`opacity ${yn}ms ${Kn}`},children:e.length>1&&r.jsxs("p",{className:s,style:d,children:[t+1," / ",e.length]})})]})}),H&&P&&(S?r.jsx(Qp,{src:P.url,phase:O,mediaRef:y,mediaStyle:le,onLoadedMetadata:pe,onClick:te,onMouseMove:me,onTransitionEnd:J},`${t}-${P.url}`):r.jsx("img",{ref:y,src:P.url,alt:P.name,onLoad:pe,onTransitionEnd:J,style:le},`${t}-${P.url}`)),ue&&ce&&e.length>1&&!S&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...ce,left:H.left,cursor:"w-resize",pointerEvents:K?"none":"auto"},onClick:re=>{if(I.current){I.current=!1;return}re.stopPropagation(),o()}}),r.jsx("div",{style:{...ce,left:H.left+H.width/2,cursor:"e-resize",pointerEvents:K?"none":"auto"},onClick:re=>{if(I.current){I.current=!1;return}re.stopPropagation(),l()}})]})]})}function tm(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function nm({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:l,activeEvent:s,layoutId:d,portalId:c}){const{prefix:u}=_.useScopedStyles(),{type:m="a",gridLayout:y,textBoxWidth:L=100,verticalGap:T,entriesCount:h,lightbox:v,imageDisplay:w,lightboxImageDisplay:I,slider:R,sliderTiming:A,direction:H,transition:b,titleMarginTop:O,subtitleMarginTop:M,titleColor:C,subtitleColor:q,lightboxCounterColor:f,titleFontFamily:W,titleFontSettings:F,titleFontSize:B,titleLineHeight:ee,titleLetterSpacing:ne,titleWordSpacing:G,titleTextAppearance:D,subtitleFontFamily:z,subtitleFontSettings:P,subtitleFontSize:S,subtitleLineHeight:K,subtitleLetterSpacing:Z,subtitleWordSpacing:U,subtitleTextAppearance:N,lightboxCounterFontFamily:pe,lightboxCounterFontSettings:g,lightboxCounterFontSize:ue,lightboxCounterLineHeight:ve,lightboxCounterLetterSpacing:ge,lightboxCounterWordSpacing:Ee,lightboxCounterTextAppearance:te,showText:me="always",alignEntries:J="off",align:be="top"}=e,le={fontSettings:{fontFamily:W,fontWeight:(F==null?void 0:F.fontWeight)??400,fontStyle:(F==null?void 0:F.fontStyle)??"normal"},fontSize:B??.01,lineHeight:ee,letterSpacing:ne??0,wordSpacing:G??0,textAppearance:D,color:C},re={...Jt(_t(le,n))},Ie={fontSettings:{fontFamily:z,fontWeight:(P==null?void 0:P.fontWeight)??400,fontStyle:(P==null?void 0:P.fontStyle)??"normal"},fontSize:S??.01,lineHeight:K,letterSpacing:Z??0,wordSpacing:U??0,textAppearance:N,color:q},Le={...Jt(_t(Ie,n))},Fe={fontSettings:{fontFamily:pe,fontWeight:(g==null?void 0:g.fontWeight)??400,fontStyle:(g==null?void 0:g.fontStyle)??"normal"},fontSize:ue??.01,lineHeight:ve,letterSpacing:ge??0,wordSpacing:Ee??0,textAppearance:te,color:f},ae={...Jt(_t(Fe,n)),...Sr(ue,ve,u,n)},E=wr(B,ee,`${u}-item-title`,`${u}-text-tight-leading`),X=wr(S,K,`${u}-item-subtitle`,`${u}-text-tight-leading`),Y=Sr(B,ee,u,n),se=Sr(S,K,u,n),de=wr(ue,ve,`${u}-lightbox-counter`,`${u}-text-tight-leading`),fe=_.buildColorVars(u,{titleColor:C,subtitleColor:q,lightboxCounterColor:f},im,om),j=`${s&&s!=="default"?`${u}-state-${s}`:""}${me==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),Ce=h===0?1/0:h,Q=(t??[]).slice(0,Ce),he=y.entryWidth??.2,$e=(w==null?void 0:w.display)==="cover",Oe=(w==null?void 0:w.ratioValue)??"1:1",Ye=(w==null?void 0:w.reversed)??!1,[Be,Ve]=Oe.split(":").map(Number),wt=`${Ye?Ve:Be} / ${Ye?Be:Ve}`,Ct=_.scalingValue(he??0,n),Ze=!$e&&R!=="off",ze={width:Ct,...$e?{aspectRatio:wt,height:"auto",overflow:"hidden"}:{height:"auto"}},Je=`${u}-item-image-wrapper${Ze?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),it=m==="d"||m==="e"||m==="f",qe=J==="on",yt=`calc(${_.scalingValue(he??0,n)} * (${L} / 100))`,rt=_.scalingValue(he*L/100,n),ot=$e?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},[kt,Ht]=a.useState("ltr"),[Ge,$t]=a.useState(0),Ue=a.useRef(null);a.useEffect(()=>{const we=Ue.current;if(!we)return;const He=new ResizeObserver(ie=>{$t(Math.round(ie[0].contentRect.width))});return He.observe(we),()=>He.disconnect()},[]);const st=(()=>{const we={...fe},He=Ue.current?getComputedStyle(Ue.current).getPropertyValue("--cntrl-article-width").trim():"";return He&&(we["--cntrl-article-width"]=He),we})(),[gt,ut]=a.useState(!1),[Bt,tn]=a.useState([]),[ln,ct]=a.useState(0),Ot=v==="on"&&(!n||i),At=(we,He)=>{n&&!i||v!=="off"&&(tn(we),ct(He),ut(!0))};a.useEffect(()=>{if(!gt||v!=="on"||typeof document>"u")return;const we=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=we}},[gt,v]),a.useEffect(()=>{!n||i||ut(!1)},[n,i]);const ye=a.useMemo(()=>Dp(u),[u]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ye}}),r.jsx("div",{style:fe,children:r.jsx("div",{ref:Ue,className:`${u}-wrapper ${u}-type-${m}${qe?` ${u}-align-entries`:""} ${u}-image-align-${be} ${j}`.trim(),style:{gridTemplateColumns:`repeat(${y.columnsCount}, minmax(0, 1fr))`,rowGap:qe?0:_.scalingValue(T??0,n),columnGap:_.scalingValue(y.horizontalGap??0,n),width:_.scalingValue(y.wrapperWidth??0,n),...qe?{[`--${u}-align-entries-row-gap`]:_.scalingValue(T??0,n)}:{}},children:Q.map((we,He)=>{var It;const ie=Xa(we.title),Te=Xa(we.subtitle),Me=(((It=we.link)==null?void 0:It.length)??0)>0&&v==="off"?we.link:void 0,Pe=Math.floor(He/y.columnsCount)===Math.ceil(Q.length/y.columnsCount)-1,De=it?r.jsxs("div",{className:`${u}-item-text-block`,children:[ie&&r.jsx("p",{className:E,style:{width:yt,...re,...Y},children:we.title}),ie&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:_.scalingValue(O??0,n),width:rt}}),Te&&r.jsx("p",{className:X,style:{width:yt,...Le,...se},children:we.subtitle}),Te&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:_.scalingValue(M??0,n),width:rt}})]}):null,pt=qe?r.jsxs("div",{className:`${u}-item-title-row`,children:[!it&&r.jsx("div",{"data-controls":o&&ie?"titleMarginTop":void 0,className:o&&ie?`${u}-control`:void 0,style:{height:ie?_.scalingValue(O??0,n):0,width:rt}}),ie&&r.jsx("p",{className:E,style:{width:yt,...re,...Y},children:we.title}),it&&ie&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:_.scalingValue(O??0,n),width:rt}})]}):null,_e=qe?r.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!it&&r.jsx("div",{"data-controls":o&&Te?"subtitleMarginTop":void 0,className:o&&Te?`${u}-control`:void 0,style:{height:Te?_.scalingValue(M??0,n):0,width:rt}}),Te&&r.jsx("p",{className:X,style:{width:yt,...Le,...se},children:we.subtitle}),it&&Te&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:_.scalingValue(M??0,n),width:rt}})]}):null,mt=Me?r.jsxs("a",{href:Me,target:"_blank",className:`${u}-item-text-link`,children:[pt,_e]}):r.jsxs(r.Fragment,{children:[pt,_e]}),et=Yp(we.gallery),vt=et.filter(tt=>tt.lightboxMedia).map(tt=>tt.lightboxMedia),ht=r.jsx("div",{className:Je,style:ze,children:et.length===0?null:R==="off"?(()=>{const{displayMedia:tt,lightboxMedia:Lt}=et[0],Et=Lt?vt.findIndex(Rt=>Rt.url===Lt.url):-1;return r.jsx(Ya,{media:tt,className:`${u}-item-${Bi(tt)?"video":"image"}`.trim(),style:ot,onMediaClick:Ot&&Et>=0?()=>At(vt,Et):void 0})})():r.jsxs(r.Fragment,{children:[Ze&&qe&&r.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:et.map(({displayMedia:tt})=>Bi(tt)?r.jsx("video",{src:tt.url,muted:!0,playsInline:!0},`sizer-${tt.url}`):r.jsx("img",{src:tt.url,alt:""},`sizer-${tt.url}`))}),r.jsx(ua,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:A*1e3,width:"100%",height:"100%",speed:Vp,type:b==="fade"?"fade":"loop",rewind:b==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:b==="fade"?"ltr":H!=="random"?H==="horizontal"?"ltr":"ttb":kt},onMoved:tt=>{if(H!=="random"||b==="fade")return;const Lt=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";Ht(Lt),setTimeout(()=>{tt.refresh()},0)},children:et.map(({displayMedia:tt,lightboxMedia:Lt},Et)=>{const Rt=Lt?vt.findIndex(cn=>cn.url===Lt.url):-1;return r.jsx(pa,{children:r.jsx(Ya,{media:tt,className:`${u}-item-${Bi(tt)?"video":"image"}`.trim(),style:ot,onMediaClick:Ot&&Rt>=0?()=>At(vt,Rt):void 0})},Et)})},`${b}-${he}-${H}-${A}-${Ge}-${d}`)]})}),Wt=it?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&ie?"titleMarginTop":void 0,className:o&&ie?`${u}-control`:void 0,style:{height:ie?_.scalingValue(O??0,n):0,width:rt}}),r.jsx("p",{className:E,style:{width:yt,...re,...Y},children:we.title}),r.jsx("div",{"data-controls":o&&Te?"subtitleMarginTop":void 0,className:o&&Te?`${u}-control`:void 0,style:{height:Te?_.scalingValue(M??0,n):0,width:rt}}),r.jsx("p",{className:X,style:{width:yt,...Le,...se},children:we.subtitle})]});return r.jsx("div",{className:`${u}-item`.trim(),children:r.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${qe&&Pe?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(L??0)>100?`calc(${_.scalingValue(he??0,n)} * (${L} / 100))`:_.scalingValue(he??0,n)},children:qe?r.jsx(r.Fragment,{children:it?r.jsxs(r.Fragment,{children:[mt,r.jsx("a",{href:Me,target:"_blank",className:`${u}-item-image-link`,children:ht})]}):r.jsxs(r.Fragment,{children:[r.jsx("a",{href:Me,target:"_blank",className:`${u}-item-image-link`,children:ht}),mt]})}):Me?r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:Me,target:"_blank",className:`${u}-item-image-link`,children:[De,ht]}),!it&&r.jsx("a",{href:Me,target:"_blank",className:`${u}-item-text-link`,children:Wt})]}):r.jsxs(r.Fragment,{children:[De,ht,Wt]})})},He)})})}),(!n||i)&>&&typeof document<"u"&&v==="on"&&(()=>{const we=(c?document.getElementById(c):null)??document.body;return Mi.createPortal(r.jsx("div",{style:st,"data-selection":"none",children:r.jsx(em,{items:Bt,index:ln,imageDisplay:tm(I),onClose:()=>ut(!1),onPrev:()=>ct(He=>(He-1+Bt.length)%Bt.length),onNext:()=>ct(He=>(He+1)%Bt.length),counterClassName:de,counterStyle:ae})}),we)})()]})}const im={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},om=["hover","focus","filled","success","error"],rm=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
4074
4074
|
import '@splidejs/react-splide/css/core';
|
|
4075
4075
|
import { CommonComponentProps } from '../props';
|
|
4076
4076
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -5850,7 +5850,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
5850
5850
|
};
|
|
5851
5851
|
|
|
5852
5852
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
5853
|
-
`,$r={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},am=["titleColor","subtitleColor","lightboxCounterColor"],sm={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!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:"Flying Over the Old Town",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(1).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Doors of Matera",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(2).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Cattedrale di Santa Maria",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(3).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"City Through the Cracks",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(4).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Private Stone Gardens",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(5).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/grid(6).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/grid(7).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Leaving the Old Town",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(8).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Under the Sun",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(9).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Citygates View",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(10).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Around the City",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(11).webp",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"}}},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:{...$r.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:{...$r.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:{...$r.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:"cover",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",slider:"on",sliderTiming:3,direction:"horizontal",transition:"fade",showText:"always",alignEntries:"on",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:"a",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,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:.0506,lightboxCounterFontSize:.0373,lightboxCounterLineHeight:.0373},d:{type:"a",gridLayout:{entryWidth:.0833,horizontalGap:0,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:200,verticalGap:.09722,entriesCount:0,titleMarginTop:.008,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,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","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"]},{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:[...am],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},lm={element:nm,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:sm,sourceCode:rm},cm=50,Ja=10,ma="cntrl-lightbox-journal",rr=ma,jr=`${ma}-`,ar=e=>`${ma}-${e}`,ga=e=>e===rr||e.startsWith(jr),Za=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Qa=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Za(t.get(ar(e)));if(i)return i}const n=Za(t.get(rr));if(n)return n;for(const[i]of t){if(!i.startsWith(jr))continue;const o=i.slice(jr.length);if(!/^\d+$/.test(o))continue;const l=Number.parseInt(o,10);if(Number.isFinite(l)&&l>=1)return l}return null},es=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},vl=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(s=>{ga(s)&&i.searchParams.delete(s)}),t?i.searchParams.set(ar(t),String(e)):i.searchParams.set(rr,String(e));const o=n?"replaceState":"pushState",l=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",l)},dm=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===ar(e)||i===rr:ga(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)}},xl=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(ar(e)):[...t.keys()].some(n=>ga(n))},um=(e,t)=>{if(xl(t)){if(e){window.history.back();return}dm(t)}},pm=20,mm=2,Cr=e=>`max(${e}, ${pm}px)`,$i=e=>((e==null?void 0:e.image)??[]).slice(0,mm),bl=e=>e.reduce((t,n)=>t+$i(n).length,0),gm=(e,t)=>{const n=e.slice(0,t).reduce((o,l)=>o+$i(l).length,1),i=$i(e[t]).length;return{start:n,end:n+i-1}},hm=(e,t)=>{const n=bl(e),{start:i,end:o}=gm(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Fo=(e,t)=>t==="B"?e.flatMap((n,i)=>$i(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:$i(n)})),fm=(e,t,n,i)=>{var l;if(n==="B")return`${t+1} / ${e.length}`;const o=((l=e[t])==null?void 0:l.entryIndex)??0;return hm(i,o)},ts=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",ym=(e,t,n)=>e==="B"?t.length>1:bl(n)>1,Xt=.004,Wn=.004,vi={title1Width:.13,title2Width:.13,title3Width:.14},_n=(e,t,n,i,o)=>{const l=[];return t.title1&&l.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&l.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&l.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),l},Ci=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((l,s)=>l+s,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:l,widths:s},d)=>{if(l<=0||d<=0)return{overflow:l,widths:[d,...s]};const c=Math.min(l,d);return{overflow:l-c,widths:[d-c,...s]}},{overflow:i-1,widths:[]});return o},Ji=(e,t)=>Ci(e,t),Vt=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Fn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Ci(e.length,n),effective:Ji(e.length,n)}},wl=(e,t,n,i)=>e.slice(0,i).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0),Sl=(e,t,n,i)=>e.slice(0,i+1).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0),oi=["title1","title2","title3","count"],Xe=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,$l={title1:"1",title2:"2",title3:"3",count:"Count"},Cl=e=>[Xe(e,"fontFamily"),Xe(e,"fontSettings"),{type:"row",items:[Xe(e,"fontSize"),Xe(e,"lineHeight"),Xe(e,"letterSpacing"),Xe(e,"wordSpacing")]},Xe(e,"textAlign"),Xe(e,"textAppearance")],vm=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(oi.map(e=>[$l[e],Cl(e)]))}),xm={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},bm={title1:.02,title2:.02,title3:.02,count:.017},Qn=(e,t)=>{const n=i=>{const o=Xe(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[xm[t]]}},ei=(e,t,n)=>{var o,l;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((l=t.fontSettings)==null?void 0:l.fontStyle)??"normal"},fontSize:t.fontSize??bm[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Ft(i,n)};function wm({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,onClose:s}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:m=0,title2MarginLeft:y=0,title3MarginLeft:L=0,titleRowMarginBottom:T=0,titleHeaderLayout:h="desktop",contentMarginTop:v=0,iconMarginRight:w=0,closeIcon:I=null,closeIconMaxWidth:R=0,closeIconColor:A="#000000",closeIconHoverColor:H="#cccccc"}=n,b=a.useCallback(j=>F.scalingValue(j,i??!1),[i]),O=b(v),M=b(w),C=b(T),q=h==="mobile",f=ei("title1",Qn(n,"title1"),i),W=ei("title2",Qn(n,"title2"),i),_=ei("title3",Qn(n,"title3"),i),B=a.useMemo(()=>({title1Width:d??vi.title1Width,title2Width:c??vi.title2Width,title3Width:u??vi.title3Width}),[d,c,u]),ee=a.useMemo(()=>({title2MarginLeft:y,title3MarginLeft:L}),[y,L]),ne=a.useMemo(()=>_n(e,t,f,W,_),[e,t,f,W,_]),G=a.useMemo(()=>ne.map(j=>B[j.widthKey]),[ne,B]),D=a.useMemo(()=>Ci(ne.length,G),[ne.length,G]),z=a.useMemo(()=>Ji(ne.length,G),[ne.length,G]),P=a.useMemo(()=>ne.filter(j=>j.prefix==="title1"),[ne]),S=a.useMemo(()=>ne.filter(j=>j.prefix==="title2"||j.prefix==="title3"),[ne]),K=a.useMemo(()=>Fn(P,B),[P,B]),Z=a.useMemo(()=>Fn(S,B),[S,B]),U=!!(t.title1||t.title2||t.title3),N=I!==null;if(!(U||N))return null;const g=(m??0)>0||o,ue=(j,Ce)=>{const Q=ne.findIndex($e=>$e.prefix===j.prefix);if(!q||Ce==="single-row")return{effectiveWidth:z[Q]??0,resolvedWidth:D[Q]??0,maxWidth:Vt(Q,D)};if(Ce==="two-row-top"){const $e=P.findIndex(Oe=>Oe.prefix===j.prefix);return{effectiveWidth:K.effective[$e]??0,resolvedWidth:K.resolved[$e]??0,maxWidth:Vt($e,K.resolved)}}const he=S.findIndex($e=>$e.prefix===j.prefix);return{effectiveWidth:Z.effective[he]??0,resolvedWidth:Z.resolved[he]??0,maxWidth:Vt(he,Z.resolved)}},ve=(j,Ce,Q)=>{if(!q||Q==="single-row"){const Be=j.findIndex(wt=>wt.prefix===Ce.prefix),Ve=j.map(wt=>B[wt.widthKey]),dt=Ci(j.length,Ve);return{effectiveWidth:Ji(j.length,Ve)[Be]??0,resolvedWidth:dt[Be]??0,maxWidth:Vt(Be,dt)}}if(Q==="two-row-top"){const Be=j.filter(wt=>wt.prefix==="title1"),Ve=Be.findIndex(wt=>wt.prefix===Ce.prefix),{resolved:dt,effective:ft}=Fn(Be,B);return{effectiveWidth:ft[Ve]??0,resolvedWidth:dt[Ve]??0,maxWidth:Vt(Ve,dt)}}const he=j.filter(Be=>Be.prefix==="title2"||Be.prefix==="title3"),$e=he.findIndex(Be=>Be.prefix===Ce.prefix),{resolved:Oe,effective:Ye}=Fn(he,B);return{effectiveWidth:Ye[$e]??0,resolvedWidth:Oe[$e]??0,maxWidth:Vt($e,Oe)}},ge=j=>Sl(ne,D,ee,j)+(q?0:m??0),Ee=()=>q?0:m??0,te=j=>S.slice(0,j).reduce((Ce,Q,he)=>Ce+(Q.marginLeftKey?ee[Q.marginLeftKey]??0:0)+(Z.resolved[he]??0),0),me=j=>{const Ce=S[j];return te(j)+(Ce.marginLeftKey?ee[Ce.marginLeftKey]??0:0)+(Z.resolved[j]??0)},J=(j,Ce,Q)=>{const he=j.marginLeftKey?ee[j.marginLeftKey]??0:0,{effectiveWidth:$e,resolvedWidth:Oe,maxWidth:Ye}=Q??ue(j,Ce),Be=Math.max(he,Wn),Ve=o&&Ce==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":j.prefix,style:{width:b($e),...he>0?{marginLeft:b(he)}:{}},children:[r.jsx("p",{className:j.className,style:j.style,children:j.text}),Ve&&j.marginLeftKey?r.jsx("div",{"data-controls":j.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Oe),style:{position:"absolute",top:0,left:b(-he),width:b(Be),height:"100%",pointerEvents:"auto"}}):null,Ve?r.jsx("div",{"data-controls":j.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:b(-Xt/2),width:b(Xt),height:"100%",pointerEvents:"auto"}}):null]},j.className)},be=(j="two-row")=>{const Ce=ne.findIndex($e=>$e.prefix==="title1"),Q=Ce>=0?D[Ce]:B.title1Width,he=j==="two-row"&&o;return r.jsx("div",{...he?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Q)}:{},style:{width:b(m??0),flexShrink:0,alignSelf:"stretch",...he?{pointerEvents:"auto"}:{}}})},le=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:f,"aria-hidden":"true",children:" "}),ce=j=>{const Ce=_n(e,j,f,W,_);return r.jsx(r.Fragment,{children:Ce.map(Q=>J(Q,"single-row",ve(Ce,Q,"single-row")))})},re=j=>{const Ce=_n(e,j,f,W,_),Q=Ce.find(he=>he.prefix==="title1");return Q?J(Q,"two-row-top",ve(Ce,Q,"two-row-top")):null},Ie=(j,Ce=!1)=>{const Q=_n(e,j,f,W,_),he=Q.filter(Ye=>Ye.prefix==="title2"||Ye.prefix==="title3"),$e=o&&Ce;return he.length>0||$e||(T??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[he.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[r.jsx("div",{className:`${e}-titles-stack`,children:he.map(Ye=>J(Ye,"two-row-bottom",ve(Q,Ye,"two-row-bottom")))}),Ce&&o?r.jsxs(r.Fragment,{children:[Y(),se()]}):null]}):null,(T??0)>0||$e?r.jsx("div",{"data-controls":$e?"titleRowMarginBottom":void 0,"data-controls-axis":$e?"y":void 0,"data-controls-reverse":$e?"":void 0,className:$e?`${e}-control`:void 0,style:{height:C,width:"100%",flexShrink:0,pointerEvents:$e?"auto":"none"}}):null]}):null},ke=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:F.scalingValue(R??0,i),height:F.scalingValue(R??0,i),marginRight:M,"--close-icon-hover-color":H},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:j=>{j.stopPropagation(),s==null||s()},"aria-label":"Close",children:r.jsx(Zt,{url:I??"",fill:A,hoverFill:i&&!l?A:H,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:M,height:"100%",pointerEvents:"auto"}})]}),Le=()=>N?r.jsx("div",{className:`${e}-titles-row-header-controls`,children:ke()}):null,_e=j=>r.jsx("div",{className:`${e}-titles-row-titles`,children:r.jsx("div",{className:`${e}-titles-stack`,children:j})}),$=j=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[N||U?le():null,g?be("two-row"):null,_e(j),Le()]}),ae=(j,Ce=!1)=>r.jsxs(r.Fragment,{children:[$(re(j)),Ie(j,Ce)]}),E=()=>{const j=q?-1:ne.findIndex(he=>he.prefix==="title1"),Ce=!q&&(o||(m??0)>0)?(()=>{const he=m??0,$e=j>=0?D[j]:B.title1Width,Oe=Math.max(he,Wn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String($e),style:{position:"absolute",top:0,left:0,width:b(Oe),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Q=ne.flatMap((he,$e)=>{if(!he.marginLeftKey)return[];const Oe=ee[he.marginLeftKey]??0,Ye=wl(ne,D,ee,$e)+Ee(),Be=Math.max(Oe,Wn);return r.jsx("div",{"data-controls":he.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(D[$e]),style:{position:"absolute",top:0,left:b(Ye),width:b(Be),height:"100%",pointerEvents:"auto"}},he.marginLeftKey)});return Ce?[Ce,...Q]:Q},X=()=>ne.map((j,Ce)=>{const Q=Vt(Ce,D),$e=ge(Ce)-Xt/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":j.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:b($e),width:b(Xt),height:"100%",pointerEvents:"auto"}})},`${j.widthKey}-junction`)}),Y=()=>S.flatMap((j,Ce)=>{if(!j.marginLeftKey)return[];const Q=ee[j.marginLeftKey]??0,he=te(Ce),$e=Math.max(Q,Wn),{resolvedWidth:Oe}=ue(j,"two-row-bottom");return r.jsx("div",{"data-controls":j.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Oe),style:{position:"absolute",top:0,left:b(he),width:b($e),height:"100%",pointerEvents:"auto"}},j.marginLeftKey)}),se=()=>S.map((j,Ce)=>{const{maxWidth:Q}=ue(j,"two-row-bottom"),$e=me(Ce)-Xt/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":j.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:b($e),width:b(Xt),height:"100%",pointerEvents:"auto"}})},`${j.widthKey}-junction`)}),de=()=>!o||q?null:r.jsxs(r.Fragment,{children:[E(),X()]}),fe=!!(t.title2||t.title3||(T??0)>0||o),Ne=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[N||U?le():null,g?be("single-row"):null,U?_e(ce(t)):r.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),Le(),de()]}),We=()=>r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...fe?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:fe?void 0:{flex:"0 0 auto",height:"auto"},children:ae(t,!0)}),de()]});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:O,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...q?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${q?` ${e}-lightbox-content-area-stacked`:""}`,children:r.jsx("div",{className:`${e}-text-bar-cell${q?` ${e}-text-bar-cell-stacked`:""}`,style:q?void 0:{flex:1,minWidth:0,width:"100%"},children:q?We():Ne()})})})]})}function Sm(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function $m(e){return`
|
|
5853
|
+
`,$r={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},am=["titleColor","subtitleColor","lightboxCounterColor"],sm={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!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:"Flying Over the Old Town",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(1).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Doors of Matera",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(2).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Cattedrale di Santa Maria",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(3).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"City Through the Cracks",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(4).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Private Stone Gardens",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(5).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/grid(6).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/grid(7).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Leaving the Old Town",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(8).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Under the Sun",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(9).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Citygates View",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(10).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Around the City",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(11).webp",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"}}},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:{...$r.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:{...$r.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:{...$r.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:"cover",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",slider:"on",sliderTiming:3,direction:"horizontal",transition:"fade",showText:"always",alignEntries:"on",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:"a",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,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:.0506,lightboxCounterFontSize:.0373,lightboxCounterLineHeight:.0373},d:{type:"a",gridLayout:{entryWidth:.0833,horizontalGap:0,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:200,verticalGap:.09722,entriesCount:0,titleMarginTop:.008,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,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","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"]},{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:[...am],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},lm={element:nm,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:sm,sourceCode:rm},cm=50,Ja=10,ma="cntrl-lightbox-journal",rr=ma,jr=`${ma}-`,ar=e=>`${ma}-${e}`,ga=e=>e===rr||e.startsWith(jr),Za=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Qa=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Za(t.get(ar(e)));if(i)return i}const n=Za(t.get(rr));if(n)return n;for(const[i]of t){if(!i.startsWith(jr))continue;const o=i.slice(jr.length);if(!/^\d+$/.test(o))continue;const l=Number.parseInt(o,10);if(Number.isFinite(l)&&l>=1)return l}return null},es=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},vl=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(s=>{ga(s)&&i.searchParams.delete(s)}),t?i.searchParams.set(ar(t),String(e)):i.searchParams.set(rr,String(e));const o=n?"replaceState":"pushState",l=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",l)},dm=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===ar(e)||i===rr:ga(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)}},xl=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(ar(e)):[...t.keys()].some(n=>ga(n))},um=(e,t)=>{if(xl(t)){if(e){window.history.back();return}dm(t)}},pm=20,mm=2,Cr=e=>`max(${e}, ${pm}px)`,$i=e=>((e==null?void 0:e.image)??[]).slice(0,mm),bl=e=>e.reduce((t,n)=>t+$i(n).length,0),gm=(e,t)=>{const n=e.slice(0,t).reduce((o,l)=>o+$i(l).length,1),i=$i(e[t]).length;return{start:n,end:n+i-1}},hm=(e,t)=>{const n=bl(e),{start:i,end:o}=gm(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},_o=(e,t)=>t==="B"?e.flatMap((n,i)=>$i(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:$i(n)})),fm=(e,t,n,i)=>{var l;if(n==="B")return`${t+1} / ${e.length}`;const o=((l=e[t])==null?void 0:l.entryIndex)??0;return hm(i,o)},ts=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",ym=(e,t,n)=>e==="B"?t.length>1:bl(n)>1,Xt=.004,Wn=.004,vi={title1Width:.13,title2Width:.13,title3Width:.14},Fn=(e,t,n,i,o)=>{const l=[];return t.title1&&l.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&l.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&l.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),l},Ci=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((l,s)=>l+s,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:l,widths:s},d)=>{if(l<=0||d<=0)return{overflow:l,widths:[d,...s]};const c=Math.min(l,d);return{overflow:l-c,widths:[d-c,...s]}},{overflow:i-1,widths:[]});return o},Ji=(e,t)=>Ci(e,t),Vt=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},_n=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Ci(e.length,n),effective:Ji(e.length,n)}},wl=(e,t,n,i)=>e.slice(0,i).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0),Sl=(e,t,n,i)=>e.slice(0,i+1).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0),oi=["title1","title2","title3","count"],Xe=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,$l={title1:"1",title2:"2",title3:"3",count:"Count"},Cl=e=>[Xe(e,"fontFamily"),Xe(e,"fontSettings"),{type:"row",items:[Xe(e,"fontSize"),Xe(e,"lineHeight"),Xe(e,"letterSpacing"),Xe(e,"wordSpacing")]},Xe(e,"textAlign"),Xe(e,"textAppearance")],vm=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(oi.map(e=>[$l[e],Cl(e)]))}),xm={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},bm={title1:.02,title2:.02,title3:.02,count:.017},Qn=(e,t)=>{const n=i=>{const o=Xe(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[xm[t]]}},ei=(e,t,n)=>{var o,l;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((l=t.fontSettings)==null?void 0:l.fontStyle)??"normal"},fontSize:t.fontSize??bm[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return _t(i,n)};function wm({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,onClose:s}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:m=0,title2MarginLeft:y=0,title3MarginLeft:L=0,titleRowMarginBottom:T=0,titleHeaderLayout:h="desktop",contentMarginTop:v=0,iconMarginRight:w=0,closeIcon:I=null,closeIconMaxWidth:R=0,closeIconColor:A="#000000",closeIconHoverColor:H="#cccccc"}=n,b=a.useCallback(j=>_.scalingValue(j,i??!1),[i]),O=b(v),M=b(w),C=b(T),q=h==="mobile",f=ei("title1",Qn(n,"title1"),i),W=ei("title2",Qn(n,"title2"),i),F=ei("title3",Qn(n,"title3"),i),B=a.useMemo(()=>({title1Width:d??vi.title1Width,title2Width:c??vi.title2Width,title3Width:u??vi.title3Width}),[d,c,u]),ee=a.useMemo(()=>({title2MarginLeft:y,title3MarginLeft:L}),[y,L]),ne=a.useMemo(()=>Fn(e,t,f,W,F),[e,t,f,W,F]),G=a.useMemo(()=>ne.map(j=>B[j.widthKey]),[ne,B]),D=a.useMemo(()=>Ci(ne.length,G),[ne.length,G]),z=a.useMemo(()=>Ji(ne.length,G),[ne.length,G]),P=a.useMemo(()=>ne.filter(j=>j.prefix==="title1"),[ne]),S=a.useMemo(()=>ne.filter(j=>j.prefix==="title2"||j.prefix==="title3"),[ne]),K=a.useMemo(()=>_n(P,B),[P,B]),Z=a.useMemo(()=>_n(S,B),[S,B]),U=!!(t.title1||t.title2||t.title3),N=I!==null;if(!(U||N))return null;const g=(m??0)>0||o,ue=(j,Ce)=>{const Q=ne.findIndex($e=>$e.prefix===j.prefix);if(!q||Ce==="single-row")return{effectiveWidth:z[Q]??0,resolvedWidth:D[Q]??0,maxWidth:Vt(Q,D)};if(Ce==="two-row-top"){const $e=P.findIndex(Oe=>Oe.prefix===j.prefix);return{effectiveWidth:K.effective[$e]??0,resolvedWidth:K.resolved[$e]??0,maxWidth:Vt($e,K.resolved)}}const he=S.findIndex($e=>$e.prefix===j.prefix);return{effectiveWidth:Z.effective[he]??0,resolvedWidth:Z.resolved[he]??0,maxWidth:Vt(he,Z.resolved)}},ve=(j,Ce,Q)=>{if(!q||Q==="single-row"){const Be=j.findIndex(wt=>wt.prefix===Ce.prefix),Ve=j.map(wt=>B[wt.widthKey]),dt=Ci(j.length,Ve);return{effectiveWidth:Ji(j.length,Ve)[Be]??0,resolvedWidth:dt[Be]??0,maxWidth:Vt(Be,dt)}}if(Q==="two-row-top"){const Be=j.filter(wt=>wt.prefix==="title1"),Ve=Be.findIndex(wt=>wt.prefix===Ce.prefix),{resolved:dt,effective:ft}=_n(Be,B);return{effectiveWidth:ft[Ve]??0,resolvedWidth:dt[Ve]??0,maxWidth:Vt(Ve,dt)}}const he=j.filter(Be=>Be.prefix==="title2"||Be.prefix==="title3"),$e=he.findIndex(Be=>Be.prefix===Ce.prefix),{resolved:Oe,effective:Ye}=_n(he,B);return{effectiveWidth:Ye[$e]??0,resolvedWidth:Oe[$e]??0,maxWidth:Vt($e,Oe)}},ge=j=>Sl(ne,D,ee,j)+(q?0:m??0),Ee=()=>q?0:m??0,te=j=>S.slice(0,j).reduce((Ce,Q,he)=>Ce+(Q.marginLeftKey?ee[Q.marginLeftKey]??0:0)+(Z.resolved[he]??0),0),me=j=>{const Ce=S[j];return te(j)+(Ce.marginLeftKey?ee[Ce.marginLeftKey]??0:0)+(Z.resolved[j]??0)},J=(j,Ce,Q)=>{const he=j.marginLeftKey?ee[j.marginLeftKey]??0:0,{effectiveWidth:$e,resolvedWidth:Oe,maxWidth:Ye}=Q??ue(j,Ce),Be=Math.max(he,Wn),Ve=o&&Ce==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":j.prefix,style:{width:b($e),...he>0?{marginLeft:b(he)}:{}},children:[r.jsx("p",{className:j.className,style:j.style,children:j.text}),Ve&&j.marginLeftKey?r.jsx("div",{"data-controls":j.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Oe),style:{position:"absolute",top:0,left:b(-he),width:b(Be),height:"100%",pointerEvents:"auto"}}):null,Ve?r.jsx("div",{"data-controls":j.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:b(-Xt/2),width:b(Xt),height:"100%",pointerEvents:"auto"}}):null]},j.className)},be=(j="two-row")=>{const Ce=ne.findIndex($e=>$e.prefix==="title1"),Q=Ce>=0?D[Ce]:B.title1Width,he=j==="two-row"&&o;return r.jsx("div",{...he?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Q)}:{},style:{width:b(m??0),flexShrink:0,alignSelf:"stretch",...he?{pointerEvents:"auto"}:{}}})},le=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:f,"aria-hidden":"true",children:" "}),ce=j=>{const Ce=Fn(e,j,f,W,F);return r.jsx(r.Fragment,{children:Ce.map(Q=>J(Q,"single-row",ve(Ce,Q,"single-row")))})},re=j=>{const Ce=Fn(e,j,f,W,F),Q=Ce.find(he=>he.prefix==="title1");return Q?J(Q,"two-row-top",ve(Ce,Q,"two-row-top")):null},Ie=(j,Ce=!1)=>{const Q=Fn(e,j,f,W,F),he=Q.filter(Ye=>Ye.prefix==="title2"||Ye.prefix==="title3"),$e=o&&Ce;return he.length>0||$e||(T??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[he.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[r.jsx("div",{className:`${e}-titles-stack`,children:he.map(Ye=>J(Ye,"two-row-bottom",ve(Q,Ye,"two-row-bottom")))}),Ce&&o?r.jsxs(r.Fragment,{children:[Y(),se()]}):null]}):null,(T??0)>0||$e?r.jsx("div",{"data-controls":$e?"titleRowMarginBottom":void 0,"data-controls-axis":$e?"y":void 0,"data-controls-reverse":$e?"":void 0,className:$e?`${e}-control`:void 0,style:{height:C,width:"100%",flexShrink:0,pointerEvents:$e?"auto":"none"}}):null]}):null},ke=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:_.scalingValue(R??0,i),height:_.scalingValue(R??0,i),marginRight:M,"--close-icon-hover-color":H},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:j=>{j.stopPropagation(),s==null||s()},"aria-label":"Close",children:r.jsx(Zt,{url:I??"",fill:A,hoverFill:i&&!l?A:H,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:M,height:"100%",pointerEvents:"auto"}})]}),Le=()=>N?r.jsx("div",{className:`${e}-titles-row-header-controls`,children:ke()}):null,Fe=j=>r.jsx("div",{className:`${e}-titles-row-titles`,children:r.jsx("div",{className:`${e}-titles-stack`,children:j})}),$=j=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[N||U?le():null,g?be("two-row"):null,Fe(j),Le()]}),ae=(j,Ce=!1)=>r.jsxs(r.Fragment,{children:[$(re(j)),Ie(j,Ce)]}),E=()=>{const j=q?-1:ne.findIndex(he=>he.prefix==="title1"),Ce=!q&&(o||(m??0)>0)?(()=>{const he=m??0,$e=j>=0?D[j]:B.title1Width,Oe=Math.max(he,Wn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String($e),style:{position:"absolute",top:0,left:0,width:b(Oe),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Q=ne.flatMap((he,$e)=>{if(!he.marginLeftKey)return[];const Oe=ee[he.marginLeftKey]??0,Ye=wl(ne,D,ee,$e)+Ee(),Be=Math.max(Oe,Wn);return r.jsx("div",{"data-controls":he.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(D[$e]),style:{position:"absolute",top:0,left:b(Ye),width:b(Be),height:"100%",pointerEvents:"auto"}},he.marginLeftKey)});return Ce?[Ce,...Q]:Q},X=()=>ne.map((j,Ce)=>{const Q=Vt(Ce,D),$e=ge(Ce)-Xt/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":j.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:b($e),width:b(Xt),height:"100%",pointerEvents:"auto"}})},`${j.widthKey}-junction`)}),Y=()=>S.flatMap((j,Ce)=>{if(!j.marginLeftKey)return[];const Q=ee[j.marginLeftKey]??0,he=te(Ce),$e=Math.max(Q,Wn),{resolvedWidth:Oe}=ue(j,"two-row-bottom");return r.jsx("div",{"data-controls":j.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Oe),style:{position:"absolute",top:0,left:b(he),width:b($e),height:"100%",pointerEvents:"auto"}},j.marginLeftKey)}),se=()=>S.map((j,Ce)=>{const{maxWidth:Q}=ue(j,"two-row-bottom"),$e=me(Ce)-Xt/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":j.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:b($e),width:b(Xt),height:"100%",pointerEvents:"auto"}})},`${j.widthKey}-junction`)}),de=()=>!o||q?null:r.jsxs(r.Fragment,{children:[E(),X()]}),fe=!!(t.title2||t.title3||(T??0)>0||o),Ne=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[N||U?le():null,g?be("single-row"):null,U?Fe(ce(t)):r.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),Le(),de()]}),We=()=>r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...fe?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:fe?void 0:{flex:"0 0 auto",height:"auto"},children:ae(t,!0)}),de()]});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:O,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...q?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${q?` ${e}-lightbox-content-area-stacked`:""}`,children:r.jsx("div",{className:`${e}-text-bar-cell${q?` ${e}-text-bar-cell-stacked`:""}`,style:q?void 0:{flex:1,minWidth:0,width:"100%"},children:q?We():Ne()})})})]})}function Sm(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function $m(e){return`
|
|
5854
5854
|
.${e}-wrapper {
|
|
5855
5855
|
display: grid;
|
|
5856
5856
|
align-items: start;
|
|
@@ -6180,7 +6180,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
6180
6180
|
pointer-events: auto;
|
|
6181
6181
|
flex-shrink: 0;
|
|
6182
6182
|
}
|
|
6183
|
-
`}const ns={url:"",name:"",objectFit:"cover"},Kt=500,vn="cubic-bezier(0.22, 1, 0.36, 1)",Cm=72,Tm=50;function Lm(e){return e.reduce((t,n,i)=>{const o=ha(n.gallery),s=fa(o).filter(d=>d.lightboxMedia).map(d=>d.lightboxMedia);return s.length===0||t.push({gridIndex:i,items:s,entry:{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}),t},[])}function Co(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}const Im=.05;function Tl(e){return e.width*Im}const Tr={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function To(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function is(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Em(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Br(e,t,n){const i=e.getBoundingClientRect(),o=i.width,l=i.height,s=t/n,d=o/l;if(s>d){const u=o/s;return{width:o,height:u,left:i.left,top:i.top+(l-u)/2}}const c=l*s;return{width:c,height:l,left:i.left+(o-c)/2,top:i.top}}function Rm(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Br(e,t.width,t.height)}function Mm(e,t){if(Wi(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 Pm(e){const t=new Set,n=[];for(const i of e){const o=ha(i.gallery),l=fa(o);for(const s of l)for(const d of[s.displayMedia,s.lightboxMedia])d!=null&&d.url&&!t.has(d.url)&&(t.add(d.url),n.push(d))}return n}function km({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=>Wi(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 Zi(e,t,n){const{width:i,height:o,top:l}=e,{left:s,width:d}=n,c=Tl(n);return t==="left"?{left:s+c-i,top:l,width:i,height:o}:{left:s+d-c,top:l,width:i,height:o}}function zr(e,t,n){const i=Zi(e,t,n);return{...i,left:2*i.left-e.left}}function Am(e,t,n){const{left:i,width:o}=n,l=Tl(n);return t==="left"?{left:i,top:e.top,width:l,height:e.height}:{left:i+o-l,top:e.top,width:l,height:e.height}}function Ll(e,t,n,i){const o=Zi(e,"left",i),l=Zi(e,"right",i),s=zr(e,"left",i),d=zr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:l,end:e};case"left-adjacent":return{start:o,end:s};case"far-right":return{start:d,end:l};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:l};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:l,end:d};case"far-left":return{start:s,end:o};default:return{start:e,end:e}}}function Wm(e,t,n,i){const{start:o,end:l}=Ll(e,t,n,i);return{x:l.left-o.left,y:l.top-o.top}}function Il(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 ha(e){if(!e)return;if(Il(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??ns,i??o??ns]}]}function _m(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Fm(e){const[t]=e.media;return t!=null&&t.url?t:null}function fa(e){if(!Array.isArray(e)||e.length===0)return[];if(Il(e)){const t=[];for(const n of e){const i=_m(n);if(!i)continue;const o=Fm(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 Wi(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Nm(e){e.pause()}function Hm({media:e,className:t,style:n,onMediaClick:i}){return Wi(e)?r.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onClick:i}):r.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function Om({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:l,onTransitionEnd:s}){const d=a.useRef(null);return a.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c&&Nm(c),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:s,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:l,onClick:c=>c.stopPropagation(),style:o},e)})}function Lo({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Wi(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const l=o.currentTarget;l.videoWidth>0&&l.videoHeight>0&&(i==null||i(e.url,l.videoWidth,l.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const l=o.currentTarget;l.naturalWidth>0&&l.naturalHeight>0&&(i==null||i(e.url,l.naturalWidth,l.naturalHeight))},onTransitionEnd:n})}function jm({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:m,layoutId:y,onClose:L,onPrev:T,onNext:h}){const v=a.useRef(null),w=a.useRef(null),I=a.useRef(null),R=a.useRef(new Map),[A,H]=a.useState(0),b=a.useRef(null),O=a.useRef(0),M=a.useRef(0),C=a.useRef("none"),q=a.useRef(!1),f=a.useRef(!1),W=a.useRef(!1),_=a.useRef(null),B=a.useRef(null),[ee,ne]=a.useState(null),[G,D]=a.useState(Tr),[z,P]=a.useState(0),[S,K]=a.useState("opening"),[Z,U]=a.useState(0),[N,pe]=a.useState(0),[g,ue]=a.useState(!1),[ve,ge]=a.useState(null),[Ee,te]=a.useState(null),[me,J]=a.useState(null),[be,le]=a.useState(!1),[ce,re]=a.useState(!1),[Ie,ke]=a.useState(!1),Le=a.useRef(n),_e=a.useRef(void 0),$=t[n],ae=$?Wi($):!1,E=N!==0||g,X=!s&&(!l||!!d),Y=c&&!s,se=u.length>1,de=a.useCallback((ye,we)=>t.length<=1?null:t[(ye+we+t.length)%t.length]??null,[t]),fe=se?Co(u,m,-1):de(n,-1),Ne=se?Co(u,m,1):de(n,1),We=ve===-1&&E?se&&Ee!==null?Co(u,Ee,-1):me!==null?de(me,-1):null:null,j=ve===1&&E?se&&Ee!==null?Co(u,Ee,1):me!==null?de(me,1):null:null,Ce=We&&We.url!==(fe==null?void 0:fe.url)?We:null,Q=j&&j.url!==(Ne==null?void 0:Ne.url)?j:null,he=a.useCallback((ye,we,He)=>{if(!ye||!we||!He)return;const ie=R.current,Te=ie.get(ye);(Te==null?void 0:Te.width)===we&&(Te==null?void 0:Te.height)===He||(ie.set(ye,{width:we,height:He}),H(Me=>Me+1))},[]),$e=a.useCallback(ye=>{if(!(ye!=null&&ye.url))return null;const we=R.current.get(ye.url);return Rm(w.current,we)},[A,z]),Oe=a.useCallback(()=>{if(!$)return;const ye=$e($);if(ye){ne(ye);return}const we=w.current;we&&ne(is(we))},[$,$e]),Ye=a.useCallback(ye=>{if(se){const we=u.length;te((m+ye+we)%we),J(null);return}t.length>1&&(J((n+ye+t.length)%t.length),te(null))},[se,u.length,m,t.length,n]),Be=a.useCallback(ye=>{W.current=ye,ue(ye)},[]),Ve=a.useCallback(()=>{_.current!==null&&(window.clearTimeout(_.current),_.current=null)},[]),dt=a.useCallback(()=>{Ve(),_.current=window.setTimeout(()=>{Ve(),Be(!1)},Kt+32)},[Ve,Be]),ft=a.useCallback(()=>{const ye=v.current;if(!ye){D({left:0,top:0,width:typeof window<"u"?window.innerWidth:Tr.width,height:typeof window<"u"?window.innerHeight:Tr.height});return}const we=ye.getBoundingClientRect();D({left:we.left,top:we.top,width:we.width,height:we.height})},[]),wt=a.useCallback((ye,we,He)=>{if(E){if(ce&&!g)return`translate(${N}px, 0px)`;if(g&&ve!==null){if((we==="far-left"||we==="far-right")&&!(He!=null&&He.farMediaReady))return"translate(0px, 0px)";const ie=$e(ye);if(!ie)return;const{x:Te,y:Me}=Wm(ie,we,ve,G);return`translate(${Te}px, ${Me}px)`}if(g)return"translate(0px, 0px)"}},[E,ce,g,N,ve,G,$e]),Ct=a.useCallback(()=>{const ye=B.current;B.current=null,Ve(),Be(!1),ge(null),te(null),J(null),le(!1),pe(0),re(!1),q.current=!1,M.current=0,C.current="none",ye===-1?T():ye===1&&h()},[Ve,Be,T,h]),Ze=a.useCallback(()=>{Ve(),_.current=window.setTimeout(()=>{B.current!==null&&Ct()},Kt+32)},[Ve,Ct]),ze=a.useCallback(ye=>{!Y||!ee||W.current||(Ve(),Ye(ye),B.current=ye,ge(ye),Be(!0),Ze())},[Y,ee,Ve,Ye,Be,Ze]),Je=a.useCallback(()=>{const ye=w.current;if(!ye)return;const we=$==null?void 0:$.url,He=we?R.current.get(we):void 0;if(He!=null&&He.width&&(He!=null&&He.height)){ne(Br(ye,He.width,He.height));return}const ie=I.current;if(ie&&we&&(ie.src===we||ie.currentSrc===we)){const{width:Me,height:Pe}=Em(ie);if(Me&&Pe){he(we,Me,Pe),ne(Br(ye,Me,Pe));return}}const Te=is(ye);!Te.width||!Te.height||ne(Te)},[$==null?void 0:$.url,he]),it=a.useCallback(ye=>{if(I.current=ye,!!ye){if(ye instanceof HTMLVideoElement){ye.readyState>=1&&ye.videoWidth>0&&Je();return}ye.complete&&ye.naturalWidth>0&&Je()}},[Je]),qe=a.useCallback(()=>{ft(),Je(),P(ye=>ye+1)},[ft,Je]);a.useEffect(()=>{qe();const ye=w.current,we=v.current,He=new ResizeObserver(()=>qe());return ye&&He.observe(ye),we&&He.observe(we),window.addEventListener("resize",qe),()=>{He.disconnect(),window.removeEventListener("resize",qe)}},[qe,n,y]),a.useLayoutEffect(()=>{if(!$)return;const ye=I.current;if(ye){if(ye instanceof HTMLImageElement&&ye.complete&&ye.naturalWidth>0){Je();return}ye instanceof HTMLVideoElement&&ye.readyState>=1&&ye.videoWidth>0&&Je()}},[$==null?void 0:$.url,n,Je]),a.useEffect(()=>{Oe()},[Oe,A]),a.useEffect(()=>{const ye=new Set,we=[],He=ie=>{!(ie!=null&&ie.url)||ye.has(ie.url)||(ye.add(ie.url),we.push(ie))};t.forEach(He),u.forEach(ie=>ie.items.forEach(He)),we.forEach(ie=>{R.current.has(ie.url)||Mm(ie,he)})},[t,u,he]),a.useEffect(()=>{S==="opening"&&ee&&K("open")},[S,ee]),a.useEffect(()=>{if(S!=="closing")return;const ye=setTimeout(()=>L(),Kt);return()=>clearTimeout(ye)},[S,L]),a.useEffect(()=>()=>{Ve()},[Ve]),a.useLayoutEffect(()=>{Le.current===n&&_e.current===($==null?void 0:$.url)||(Ve(),B.current=null,ge(null),te(null),J(null),le(!1),U(0),pe(0),Be(!1),ke(!1),re(!1),O.current=0,M.current=0,C.current="none",q.current=!1,b.current=null,f.current=!1,I.current=null,Oe(),Le.current=n,_e.current=$==null?void 0:$.url)},[n,$==null?void 0:$.url,Be,Ve,Oe]),a.useLayoutEffect(()=>{if(!(Ce||Q)||!E){le(!1);return}le(!1);const ye=requestAnimationFrame(()=>{requestAnimationFrame(()=>le(!0))});return()=>cancelAnimationFrame(ye)},[Ce==null?void 0:Ce.url,Q==null?void 0:Q.url,E]),a.useEffect(()=>{if(S!=="open")return;const ye=()=>{const Pe=De=>{De.stopPropagation(),De.preventDefault(),document.removeEventListener("click",Pe,!0)};document.addEventListener("click",Pe,!0)},we=Pe=>{const De=Pe<0?1:-1;Ve(),Ye(De),B.current=De,ge(De),Be(!0),Ze()},He=Pe=>{if(Math.abs(Pe)>Tm&&Y){we(Pe);return}B.current=null,ge(null),te(null),J(null),le(!1),Be(!0),pe(0),dt()},ie=Pe=>{if(Pe.touches.length!==1||W.current)return;const De=Pe.touches[0];f.current=!0,b.current={x:De.clientX,y:De.clientY},C.current="none",M.current=0,q.current=!1},Te=Pe=>{if(!b.current||Pe.touches.length!==1||W.current)return;const De=Pe.touches[0],pt=De.clientX-b.current.x,Fe=De.clientY-b.current.y;if(C.current==="none"){if(Math.abs(pt)<10&&Math.abs(Fe)<10)return;if(Math.abs(pt)>Math.abs(Fe)){if(!Y)return;C.current="horizontal"}else if(Fe>0){if(!X)return;C.current="vertical"}else return}if(C.current==="horizontal"){q.current=!0,re(!0),M.current=pt,pe(pt),Pe.preventDefault();return}C.current==="vertical"&&(q.current=!0,re(!0),O.current=Fe,U(Fe),Pe.preventDefault())},Me=()=>{if(!b.current)return;const Pe=C.current,De=q.current;if(De&&Pe==="horizontal")He(M.current),ye();else if(De&&Pe==="vertical"){const pt=O.current;if(X&&pt>Cm){const Fe=window.innerHeight;O.current=Fe,ke(!0),U(Fe),K("closing")}else O.current=0,U(0);ye()}else Pe==="horizontal"&&Math.abs(M.current)>0&&(He(M.current),ye());b.current=null,C.current="none",M.current=0,q.current=!1,re(!1)};return document.addEventListener("touchstart",ie,{passive:!0}),document.addEventListener("touchmove",Te,{passive:!1}),document.addEventListener("touchend",Me),document.addEventListener("touchcancel",Me),()=>{document.removeEventListener("touchstart",ie),document.removeEventListener("touchmove",Te),document.removeEventListener("touchend",Me),document.removeEventListener("touchcancel",Me)}},[S,Y,Be,dt,Ve,X,Ze,Ye]),a.useEffect(()=>{const ye=we=>{we.key==="Escape"&&(l&&d||S!=="closing"&&K("closing"))};return window.addEventListener("keydown",ye),()=>window.removeEventListener("keydown",ye)},[S,l,d]);const yt=()=>{S==="closing"||s||K("closing")},rt=S==="open",ot=S==="closing",kt=Z>0?Math.max(0,1-Z/500):1,Ht=Z>0?Math.max(.35,1-Z/500):1,Ge=a.useCallback(ye=>{if(!(ye.propertyName!=="transform"||!W.current)){if(B.current!==null){Ct();return}Ve(),Be(!1)}},[Ve,Be,Ct]),$t=E&&$?wt($,"center"):Z>0?`translateY(${Z}px)`:void 0,Ue=ee?To(ee,G):null,st={position:"absolute",top:Ue==null?void 0:Ue.top,left:Ue==null?void 0:Ue.left,width:Ue==null?void 0:Ue.width,height:Ue==null?void 0:Ue.height,objectFit:"contain",transform:$t,opacity:Z>0?Ht:S==="opening"||ot?0:1,transition:ce&&!g?"none":g?`transform ${Kt}ms ${vn}`:Ie?`transform ${Kt}ms ${vn}, opacity ${Kt}ms ${vn}`:S==="opening"||ot?`opacity ${Kt}ms ${vn}`:"none",pointerEvents:ae&&rt&&!E?"auto":"none",touchAction:ae&&rt?"none":void 0,zIndex:1,overflow:ae?"hidden":void 0},gt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:rt&&!E?"auto":"none"},ut=(ye,we,He="adjacent")=>{const ie=$e(ye);if(!ie)return{display:"none"};const Te=He==="far"?we==="left"?"far-left":"far-right":we==="left"?"left-adjacent":"right-adjacent",{start:Me}=ve!==null?Ll(ie,Te,ve,G):{start:He==="far"?zr(ie,we,G):Zi(ie,we,G)},Pe=To(Me,G),De=wt(ye,Te,{farMediaReady:He!=="far"||be}),pt=ce&&!g?!1:g||He==="far"&&be;return{position:"absolute",top:Pe.top,left:Pe.left,width:Pe.width,height:Pe.height,objectFit:"contain",transform:De,opacity:He==="far"?be&&rt?1:0:rt?1:0,transition:pt?`transform ${Kt}ms ${vn}, opacity ${Kt}ms ${vn}`:S==="opening"||ot?`opacity ${Kt}ms ${vn}`:"none",pointerEvents:"none",zIndex:1}},Bt=(ye,we)=>{const He=$e(ye);return He?Am(Zi(He,we,G),we,G):null},tn=ye=>we=>{if(!s){if(f.current){f.current=!1;return}we.stopPropagation(),ze(ye)}},ln=fe?Bt(fe,"left"):null,ct=Ne?Bt(Ne,"right"):null,Ot=ln?To(ln,G):null,At=ct?To(ct,G):null;return r.jsxs("div",{ref:v,className:[`${e}-lightbox`,l?`${e}-lightbox-editor`:"",s?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:S==="open"?"none":void 0},onClick:yt,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"#ffffff",opacity:rt?kt:0,transition:ce?"none":`opacity ${Kt}ms ${vn}`,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:w,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:rt?1:0,transition:ce?"none":`opacity ${Kt}ms ${vn}`,pointerEvents:"none"},children:r.jsx(wm,{prefix:e,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:d,onClose:yt})})]}),rt&&Ce&&r.jsx(Lo,{media:Ce,style:ut(Ce,"left","far"),onMeasure:he,onTransitionEnd:Ge},`far-prev-${Ce.url}`),rt&&fe&&r.jsxs(r.Fragment,{children:[r.jsx(Lo,{media:fe,style:ut(fe,"left"),onMeasure:he,onTransitionEnd:Ge},`prev-${fe.url}`),Ot&&r.jsx("div",{style:{position:"absolute",top:Ot.top,left:Ot.left,width:Ot.width,height:Ot.height,cursor:E||s?"default":"pointer",pointerEvents:E||s?"none":"auto",zIndex:3},onClick:tn(-1)})]}),rt&&Ne&&r.jsxs(r.Fragment,{children:[r.jsx(Lo,{media:Ne,style:ut(Ne,"right"),onMeasure:he,onTransitionEnd:Ge},`next-${Ne.url}`),At&&r.jsx("div",{style:{position:"absolute",top:At.top,left:At.left,width:At.width,height:At.height,cursor:E||s?"default":"pointer",pointerEvents:E||s?"none":"auto",zIndex:3},onClick:tn(1)})]}),rt&&Q&&r.jsx(Lo,{media:Q,style:ut(Q,"right","far"),onMeasure:he,onTransitionEnd:Ge},`far-next-${Q.url}`),ee&&$&&(ae?r.jsx(Om,{src:$.url,phase:S,onMediaElement:it,wrapperStyle:st,videoStyle:gt,onLoadedMetadata:Je,onTransitionEnd:Ge},`${n}-${$.url}`):r.jsx("img",{ref:it,src:$.url,alt:$.name,onLoad:Je,onTransitionEnd:Ge,style:st},`${n}-${$.url}`))]})}function Bm({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:l,portalId:s}){const{prefix:d}=F.useScopedStyles(),{gridLayout:c,verticalGap:u,align:m="top",imageDisplay:y}=e,L=(y==null?void 0:y.display)==="cover",T=(y==null?void 0:y.ratioValue)??"1:1",h=(y==null?void 0:y.reversed)??!1,[v,w]=T.split(":").map(Number),A=`${h?w:v} / ${h?v:w}`,H=c.entryWidth??.2,b=F.scalingValue(H??0,n),O=F.scalingValue(H??0,n),M={width:b,...L?{aspectRatio:A,height:"auto",overflow:"hidden"}:{height:"auto"}},C=L?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},q=a.useRef(null),[f,W]=a.useState(!1),[_,B]=a.useState([]),[ee,ne]=a.useState(0),[G,D]=a.useState(0),[z,P]=a.useState({title1:"",title2:"",title3:""}),S=(()=>{const ge={},Ee=q.current?getComputedStyle(q.current).getPropertyValue("--cntrl-article-width").trim():"";return Ee&&(ge["--cntrl-article-width"]=Ee),ge})(),K=!n||i||o,Z=a.useMemo(()=>$m(d),[d]),U=t??[],N=a.useMemo(()=>Lm(U),[U]),pe=a.useMemo(()=>Pm(U),[U]),g=(ge,Ee)=>{if(n&&!o&&!i)return;const te=N.findIndex(J=>J.gridIndex===ge);if(te<0)return;const me=N[te];D(te),B(me.items),ne(Ee),P(me.entry),W(!0)},ue=a.useCallback(ge=>{if(N.length>1){const Ee=N.length,te=(G+ge+Ee)%Ee,me=N[te],J=Math.min(ee,me.items.length-1);D(te),B(me.items),ne(J),P(me.entry);return}ne(Ee=>(Ee+ge+_.length)%_.length)},[N,G,ee,_.length]),ve=N.length>1||_.length>1;return a.useEffect(()=>{if(!f||typeof document>"u")return;const ge=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ge}},[f]),a.useEffect(()=>{!n||o||i||W(!1)},[n,o,i]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Z}}),r.jsx(km,{mediaList:pe}),r.jsx("div",{ref:q,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${m}`.trim(),style:{gridTemplateColumns:`repeat(${c.columnsCount}, minmax(0, 1fr))`,rowGap:0,columnGap:F.scalingValue(c.horizontalGap??0,n),width:F.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:F.scalingValue(u??0,n)},children:U.map((ge,Ee)=>{const te=ha(ge.gallery),me=fa(te),J=me.filter(ce=>ce.lightboxMedia).map(ce=>ce.lightboxMedia),be=Math.floor(Ee/c.columnsCount)===Math.ceil(U.length/c.columnsCount)-1,le=r.jsx("div",{className:`${d}-item-image-wrapper`,style:M,children:me.length===0?null:(()=>{const{displayMedia:ce,lightboxMedia:re}=me[0],Ie=re?J.findIndex(ke=>ke.url===re.url):-1;return r.jsx(Hm,{media:ce,className:`${d}-item-${Wi(ce)?"video":"image"}`.trim(),style:C,onMediaClick:K&&Ie>=0?()=>g(Ee,Ie):void 0})})()});return r.jsx("div",{className:`${d}-item`,children:r.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,be?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:F.scalingValue(H??0,n)},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:le}),r.jsx("div",{className:`${d}-item-subtitle-row`,children:r.jsx("div",{style:{height:0,width:O}})})]})},Ee)})}),f&&typeof document<"u"&&(()=>{const ge=(s?document.getElementById(s):null)??document.body;return Mi.createPortal(r.jsx("div",{style:S,"data-selection":"none",children:r.jsx(jm,{prefix:d,items:_,index:ee,entry:z,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ve,lightboxEntries:N,entryIdx:G,layoutId:l,onClose:()=>W(!1),onPrev:()=>ue(-1),onNext:()=>ue(1)})}),ge)})()]})}const zm=`import { CommonComponentProps } from '../props';
|
|
6183
|
+
`}const ns={url:"",name:"",objectFit:"cover"},Kt=500,vn="cubic-bezier(0.22, 1, 0.36, 1)",Cm=72,Tm=50;function Lm(e){return e.reduce((t,n,i)=>{const o=ha(n.gallery),s=fa(o).filter(d=>d.lightboxMedia).map(d=>d.lightboxMedia);return s.length===0||t.push({gridIndex:i,items:s,entry:{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}),t},[])}function Co(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}const Im=.05;function Tl(e){return e.width*Im}const Tr={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function To(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function is(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Em(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Br(e,t,n){const i=e.getBoundingClientRect(),o=i.width,l=i.height,s=t/n,d=o/l;if(s>d){const u=o/s;return{width:o,height:u,left:i.left,top:i.top+(l-u)/2}}const c=l*s;return{width:c,height:l,left:i.left+(o-c)/2,top:i.top}}function Rm(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Br(e,t.width,t.height)}function Mm(e,t){if(Wi(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 Pm(e){const t=new Set,n=[];for(const i of e){const o=ha(i.gallery),l=fa(o);for(const s of l)for(const d of[s.displayMedia,s.lightboxMedia])d!=null&&d.url&&!t.has(d.url)&&(t.add(d.url),n.push(d))}return n}function km({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=>Wi(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 Zi(e,t,n){const{width:i,height:o,top:l}=e,{left:s,width:d}=n,c=Tl(n);return t==="left"?{left:s+c-i,top:l,width:i,height:o}:{left:s+d-c,top:l,width:i,height:o}}function zr(e,t,n){const i=Zi(e,t,n);return{...i,left:2*i.left-e.left}}function Am(e,t,n){const{left:i,width:o}=n,l=Tl(n);return t==="left"?{left:i,top:e.top,width:l,height:e.height}:{left:i+o-l,top:e.top,width:l,height:e.height}}function Ll(e,t,n,i){const o=Zi(e,"left",i),l=Zi(e,"right",i),s=zr(e,"left",i),d=zr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:l,end:e};case"left-adjacent":return{start:o,end:s};case"far-right":return{start:d,end:l};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:l};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:l,end:d};case"far-left":return{start:s,end:o};default:return{start:e,end:e}}}function Wm(e,t,n,i){const{start:o,end:l}=Ll(e,t,n,i);return{x:l.left-o.left,y:l.top-o.top}}function Il(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 ha(e){if(!e)return;if(Il(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??ns,i??o??ns]}]}function Fm(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function _m(e){const[t]=e.media;return t!=null&&t.url?t:null}function fa(e){if(!Array.isArray(e)||e.length===0)return[];if(Il(e)){const t=[];for(const n of e){const i=Fm(n);if(!i)continue;const o=_m(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 Wi(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Nm(e){e.pause()}function Hm({media:e,className:t,style:n,onMediaClick:i}){return Wi(e)?r.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onClick:i}):r.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function Om({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:l,onTransitionEnd:s}){const d=a.useRef(null);return a.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c&&Nm(c),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:s,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:l,onClick:c=>c.stopPropagation(),style:o},e)})}function Lo({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Wi(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const l=o.currentTarget;l.videoWidth>0&&l.videoHeight>0&&(i==null||i(e.url,l.videoWidth,l.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const l=o.currentTarget;l.naturalWidth>0&&l.naturalHeight>0&&(i==null||i(e.url,l.naturalWidth,l.naturalHeight))},onTransitionEnd:n})}function jm({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:m,layoutId:y,onClose:L,onPrev:T,onNext:h}){const v=a.useRef(null),w=a.useRef(null),I=a.useRef(null),R=a.useRef(new Map),[A,H]=a.useState(0),b=a.useRef(null),O=a.useRef(0),M=a.useRef(0),C=a.useRef("none"),q=a.useRef(!1),f=a.useRef(!1),W=a.useRef(!1),F=a.useRef(null),B=a.useRef(null),[ee,ne]=a.useState(null),[G,D]=a.useState(Tr),[z,P]=a.useState(0),[S,K]=a.useState("opening"),[Z,U]=a.useState(0),[N,pe]=a.useState(0),[g,ue]=a.useState(!1),[ve,ge]=a.useState(null),[Ee,te]=a.useState(null),[me,J]=a.useState(null),[be,le]=a.useState(!1),[ce,re]=a.useState(!1),[Ie,ke]=a.useState(!1),Le=a.useRef(n),Fe=a.useRef(void 0),$=t[n],ae=$?Wi($):!1,E=N!==0||g,X=!s&&(!l||!!d),Y=c&&!s,se=u.length>1,de=a.useCallback((ye,we)=>t.length<=1?null:t[(ye+we+t.length)%t.length]??null,[t]),fe=se?Co(u,m,-1):de(n,-1),Ne=se?Co(u,m,1):de(n,1),We=ve===-1&&E?se&&Ee!==null?Co(u,Ee,-1):me!==null?de(me,-1):null:null,j=ve===1&&E?se&&Ee!==null?Co(u,Ee,1):me!==null?de(me,1):null:null,Ce=We&&We.url!==(fe==null?void 0:fe.url)?We:null,Q=j&&j.url!==(Ne==null?void 0:Ne.url)?j:null,he=a.useCallback((ye,we,He)=>{if(!ye||!we||!He)return;const ie=R.current,Te=ie.get(ye);(Te==null?void 0:Te.width)===we&&(Te==null?void 0:Te.height)===He||(ie.set(ye,{width:we,height:He}),H(Me=>Me+1))},[]),$e=a.useCallback(ye=>{if(!(ye!=null&&ye.url))return null;const we=R.current.get(ye.url);return Rm(w.current,we)},[A,z]),Oe=a.useCallback(()=>{if(!$)return;const ye=$e($);if(ye){ne(ye);return}const we=w.current;we&&ne(is(we))},[$,$e]),Ye=a.useCallback(ye=>{if(se){const we=u.length;te((m+ye+we)%we),J(null);return}t.length>1&&(J((n+ye+t.length)%t.length),te(null))},[se,u.length,m,t.length,n]),Be=a.useCallback(ye=>{W.current=ye,ue(ye)},[]),Ve=a.useCallback(()=>{F.current!==null&&(window.clearTimeout(F.current),F.current=null)},[]),dt=a.useCallback(()=>{Ve(),F.current=window.setTimeout(()=>{Ve(),Be(!1)},Kt+32)},[Ve,Be]),ft=a.useCallback(()=>{const ye=v.current;if(!ye){D({left:0,top:0,width:typeof window<"u"?window.innerWidth:Tr.width,height:typeof window<"u"?window.innerHeight:Tr.height});return}const we=ye.getBoundingClientRect();D({left:we.left,top:we.top,width:we.width,height:we.height})},[]),wt=a.useCallback((ye,we,He)=>{if(E){if(ce&&!g)return`translate(${N}px, 0px)`;if(g&&ve!==null){if((we==="far-left"||we==="far-right")&&!(He!=null&&He.farMediaReady))return"translate(0px, 0px)";const ie=$e(ye);if(!ie)return;const{x:Te,y:Me}=Wm(ie,we,ve,G);return`translate(${Te}px, ${Me}px)`}if(g)return"translate(0px, 0px)"}},[E,ce,g,N,ve,G,$e]),Ct=a.useCallback(()=>{const ye=B.current;B.current=null,Ve(),Be(!1),ge(null),te(null),J(null),le(!1),pe(0),re(!1),q.current=!1,M.current=0,C.current="none",ye===-1?T():ye===1&&h()},[Ve,Be,T,h]),Ze=a.useCallback(()=>{Ve(),F.current=window.setTimeout(()=>{B.current!==null&&Ct()},Kt+32)},[Ve,Ct]),ze=a.useCallback(ye=>{!Y||!ee||W.current||(Ve(),Ye(ye),B.current=ye,ge(ye),Be(!0),Ze())},[Y,ee,Ve,Ye,Be,Ze]),Je=a.useCallback(()=>{const ye=w.current;if(!ye)return;const we=$==null?void 0:$.url,He=we?R.current.get(we):void 0;if(He!=null&&He.width&&(He!=null&&He.height)){ne(Br(ye,He.width,He.height));return}const ie=I.current;if(ie&&we&&(ie.src===we||ie.currentSrc===we)){const{width:Me,height:Pe}=Em(ie);if(Me&&Pe){he(we,Me,Pe),ne(Br(ye,Me,Pe));return}}const Te=is(ye);!Te.width||!Te.height||ne(Te)},[$==null?void 0:$.url,he]),it=a.useCallback(ye=>{if(I.current=ye,!!ye){if(ye instanceof HTMLVideoElement){ye.readyState>=1&&ye.videoWidth>0&&Je();return}ye.complete&&ye.naturalWidth>0&&Je()}},[Je]),qe=a.useCallback(()=>{ft(),Je(),P(ye=>ye+1)},[ft,Je]);a.useEffect(()=>{qe();const ye=w.current,we=v.current,He=new ResizeObserver(()=>qe());return ye&&He.observe(ye),we&&He.observe(we),window.addEventListener("resize",qe),()=>{He.disconnect(),window.removeEventListener("resize",qe)}},[qe,n,y]),a.useLayoutEffect(()=>{if(!$)return;const ye=I.current;if(ye){if(ye instanceof HTMLImageElement&&ye.complete&&ye.naturalWidth>0){Je();return}ye instanceof HTMLVideoElement&&ye.readyState>=1&&ye.videoWidth>0&&Je()}},[$==null?void 0:$.url,n,Je]),a.useEffect(()=>{Oe()},[Oe,A]),a.useEffect(()=>{const ye=new Set,we=[],He=ie=>{!(ie!=null&&ie.url)||ye.has(ie.url)||(ye.add(ie.url),we.push(ie))};t.forEach(He),u.forEach(ie=>ie.items.forEach(He)),we.forEach(ie=>{R.current.has(ie.url)||Mm(ie,he)})},[t,u,he]),a.useEffect(()=>{S==="opening"&&ee&&K("open")},[S,ee]),a.useEffect(()=>{if(S!=="closing")return;const ye=setTimeout(()=>L(),Kt);return()=>clearTimeout(ye)},[S,L]),a.useEffect(()=>()=>{Ve()},[Ve]),a.useLayoutEffect(()=>{Le.current===n&&Fe.current===($==null?void 0:$.url)||(Ve(),B.current=null,ge(null),te(null),J(null),le(!1),U(0),pe(0),Be(!1),ke(!1),re(!1),O.current=0,M.current=0,C.current="none",q.current=!1,b.current=null,f.current=!1,I.current=null,Oe(),Le.current=n,Fe.current=$==null?void 0:$.url)},[n,$==null?void 0:$.url,Be,Ve,Oe]),a.useLayoutEffect(()=>{if(!(Ce||Q)||!E){le(!1);return}le(!1);const ye=requestAnimationFrame(()=>{requestAnimationFrame(()=>le(!0))});return()=>cancelAnimationFrame(ye)},[Ce==null?void 0:Ce.url,Q==null?void 0:Q.url,E]),a.useEffect(()=>{if(S!=="open")return;const ye=()=>{const Pe=De=>{De.stopPropagation(),De.preventDefault(),document.removeEventListener("click",Pe,!0)};document.addEventListener("click",Pe,!0)},we=Pe=>{const De=Pe<0?1:-1;Ve(),Ye(De),B.current=De,ge(De),Be(!0),Ze()},He=Pe=>{if(Math.abs(Pe)>Tm&&Y){we(Pe);return}B.current=null,ge(null),te(null),J(null),le(!1),Be(!0),pe(0),dt()},ie=Pe=>{if(Pe.touches.length!==1||W.current)return;const De=Pe.touches[0];f.current=!0,b.current={x:De.clientX,y:De.clientY},C.current="none",M.current=0,q.current=!1},Te=Pe=>{if(!b.current||Pe.touches.length!==1||W.current)return;const De=Pe.touches[0],pt=De.clientX-b.current.x,_e=De.clientY-b.current.y;if(C.current==="none"){if(Math.abs(pt)<10&&Math.abs(_e)<10)return;if(Math.abs(pt)>Math.abs(_e)){if(!Y)return;C.current="horizontal"}else if(_e>0){if(!X)return;C.current="vertical"}else return}if(C.current==="horizontal"){q.current=!0,re(!0),M.current=pt,pe(pt),Pe.preventDefault();return}C.current==="vertical"&&(q.current=!0,re(!0),O.current=_e,U(_e),Pe.preventDefault())},Me=()=>{if(!b.current)return;const Pe=C.current,De=q.current;if(De&&Pe==="horizontal")He(M.current),ye();else if(De&&Pe==="vertical"){const pt=O.current;if(X&&pt>Cm){const _e=window.innerHeight;O.current=_e,ke(!0),U(_e),K("closing")}else O.current=0,U(0);ye()}else Pe==="horizontal"&&Math.abs(M.current)>0&&(He(M.current),ye());b.current=null,C.current="none",M.current=0,q.current=!1,re(!1)};return document.addEventListener("touchstart",ie,{passive:!0}),document.addEventListener("touchmove",Te,{passive:!1}),document.addEventListener("touchend",Me),document.addEventListener("touchcancel",Me),()=>{document.removeEventListener("touchstart",ie),document.removeEventListener("touchmove",Te),document.removeEventListener("touchend",Me),document.removeEventListener("touchcancel",Me)}},[S,Y,Be,dt,Ve,X,Ze,Ye]),a.useEffect(()=>{const ye=we=>{we.key==="Escape"&&(l&&d||S!=="closing"&&K("closing"))};return window.addEventListener("keydown",ye),()=>window.removeEventListener("keydown",ye)},[S,l,d]);const yt=()=>{S==="closing"||s||K("closing")},rt=S==="open",ot=S==="closing",kt=Z>0?Math.max(0,1-Z/500):1,Ht=Z>0?Math.max(.35,1-Z/500):1,Ge=a.useCallback(ye=>{if(!(ye.propertyName!=="transform"||!W.current)){if(B.current!==null){Ct();return}Ve(),Be(!1)}},[Ve,Be,Ct]),$t=E&&$?wt($,"center"):Z>0?`translateY(${Z}px)`:void 0,Ue=ee?To(ee,G):null,st={position:"absolute",top:Ue==null?void 0:Ue.top,left:Ue==null?void 0:Ue.left,width:Ue==null?void 0:Ue.width,height:Ue==null?void 0:Ue.height,objectFit:"contain",transform:$t,opacity:Z>0?Ht:S==="opening"||ot?0:1,transition:ce&&!g?"none":g?`transform ${Kt}ms ${vn}`:Ie?`transform ${Kt}ms ${vn}, opacity ${Kt}ms ${vn}`:S==="opening"||ot?`opacity ${Kt}ms ${vn}`:"none",pointerEvents:ae&&rt&&!E?"auto":"none",touchAction:ae&&rt?"none":void 0,zIndex:1,overflow:ae?"hidden":void 0},gt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:rt&&!E?"auto":"none"},ut=(ye,we,He="adjacent")=>{const ie=$e(ye);if(!ie)return{display:"none"};const Te=He==="far"?we==="left"?"far-left":"far-right":we==="left"?"left-adjacent":"right-adjacent",{start:Me}=ve!==null?Ll(ie,Te,ve,G):{start:He==="far"?zr(ie,we,G):Zi(ie,we,G)},Pe=To(Me,G),De=wt(ye,Te,{farMediaReady:He!=="far"||be}),pt=ce&&!g?!1:g||He==="far"&&be;return{position:"absolute",top:Pe.top,left:Pe.left,width:Pe.width,height:Pe.height,objectFit:"contain",transform:De,opacity:He==="far"?be&&rt?1:0:rt?1:0,transition:pt?`transform ${Kt}ms ${vn}, opacity ${Kt}ms ${vn}`:S==="opening"||ot?`opacity ${Kt}ms ${vn}`:"none",pointerEvents:"none",zIndex:1}},Bt=(ye,we)=>{const He=$e(ye);return He?Am(Zi(He,we,G),we,G):null},tn=ye=>we=>{if(!s){if(f.current){f.current=!1;return}we.stopPropagation(),ze(ye)}},ln=fe?Bt(fe,"left"):null,ct=Ne?Bt(Ne,"right"):null,Ot=ln?To(ln,G):null,At=ct?To(ct,G):null;return r.jsxs("div",{ref:v,className:[`${e}-lightbox`,l?`${e}-lightbox-editor`:"",s?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:S==="open"?"none":void 0},onClick:yt,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"#ffffff",opacity:rt?kt:0,transition:ce?"none":`opacity ${Kt}ms ${vn}`,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:w,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:rt?1:0,transition:ce?"none":`opacity ${Kt}ms ${vn}`,pointerEvents:"none"},children:r.jsx(wm,{prefix:e,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:d,onClose:yt})})]}),rt&&Ce&&r.jsx(Lo,{media:Ce,style:ut(Ce,"left","far"),onMeasure:he,onTransitionEnd:Ge},`far-prev-${Ce.url}`),rt&&fe&&r.jsxs(r.Fragment,{children:[r.jsx(Lo,{media:fe,style:ut(fe,"left"),onMeasure:he,onTransitionEnd:Ge},`prev-${fe.url}`),Ot&&r.jsx("div",{style:{position:"absolute",top:Ot.top,left:Ot.left,width:Ot.width,height:Ot.height,cursor:E||s?"default":"pointer",pointerEvents:E||s?"none":"auto",zIndex:3},onClick:tn(-1)})]}),rt&&Ne&&r.jsxs(r.Fragment,{children:[r.jsx(Lo,{media:Ne,style:ut(Ne,"right"),onMeasure:he,onTransitionEnd:Ge},`next-${Ne.url}`),At&&r.jsx("div",{style:{position:"absolute",top:At.top,left:At.left,width:At.width,height:At.height,cursor:E||s?"default":"pointer",pointerEvents:E||s?"none":"auto",zIndex:3},onClick:tn(1)})]}),rt&&Q&&r.jsx(Lo,{media:Q,style:ut(Q,"right","far"),onMeasure:he,onTransitionEnd:Ge},`far-next-${Q.url}`),ee&&$&&(ae?r.jsx(Om,{src:$.url,phase:S,onMediaElement:it,wrapperStyle:st,videoStyle:gt,onLoadedMetadata:Je,onTransitionEnd:Ge},`${n}-${$.url}`):r.jsx("img",{ref:it,src:$.url,alt:$.name,onLoad:Je,onTransitionEnd:Ge,style:st},`${n}-${$.url}`))]})}function Bm({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:l,portalId:s}){const{prefix:d}=_.useScopedStyles(),{gridLayout:c,verticalGap:u,align:m="top",imageDisplay:y}=e,L=(y==null?void 0:y.display)==="cover",T=(y==null?void 0:y.ratioValue)??"1:1",h=(y==null?void 0:y.reversed)??!1,[v,w]=T.split(":").map(Number),A=`${h?w:v} / ${h?v:w}`,H=c.entryWidth??.2,b=_.scalingValue(H??0,n),O=_.scalingValue(H??0,n),M={width:b,...L?{aspectRatio:A,height:"auto",overflow:"hidden"}:{height:"auto"}},C=L?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},q=a.useRef(null),[f,W]=a.useState(!1),[F,B]=a.useState([]),[ee,ne]=a.useState(0),[G,D]=a.useState(0),[z,P]=a.useState({title1:"",title2:"",title3:""}),S=(()=>{const ge={},Ee=q.current?getComputedStyle(q.current).getPropertyValue("--cntrl-article-width").trim():"";return Ee&&(ge["--cntrl-article-width"]=Ee),ge})(),K=!n||i||o,Z=a.useMemo(()=>$m(d),[d]),U=t??[],N=a.useMemo(()=>Lm(U),[U]),pe=a.useMemo(()=>Pm(U),[U]),g=(ge,Ee)=>{if(n&&!o&&!i)return;const te=N.findIndex(J=>J.gridIndex===ge);if(te<0)return;const me=N[te];D(te),B(me.items),ne(Ee),P(me.entry),W(!0)},ue=a.useCallback(ge=>{if(N.length>1){const Ee=N.length,te=(G+ge+Ee)%Ee,me=N[te],J=Math.min(ee,me.items.length-1);D(te),B(me.items),ne(J),P(me.entry);return}ne(Ee=>(Ee+ge+F.length)%F.length)},[N,G,ee,F.length]),ve=N.length>1||F.length>1;return a.useEffect(()=>{if(!f||typeof document>"u")return;const ge=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ge}},[f]),a.useEffect(()=>{!n||o||i||W(!1)},[n,o,i]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Z}}),r.jsx(km,{mediaList:pe}),r.jsx("div",{ref:q,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${m}`.trim(),style:{gridTemplateColumns:`repeat(${c.columnsCount}, minmax(0, 1fr))`,rowGap:0,columnGap:_.scalingValue(c.horizontalGap??0,n),width:_.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:_.scalingValue(u??0,n)},children:U.map((ge,Ee)=>{const te=ha(ge.gallery),me=fa(te),J=me.filter(ce=>ce.lightboxMedia).map(ce=>ce.lightboxMedia),be=Math.floor(Ee/c.columnsCount)===Math.ceil(U.length/c.columnsCount)-1,le=r.jsx("div",{className:`${d}-item-image-wrapper`,style:M,children:me.length===0?null:(()=>{const{displayMedia:ce,lightboxMedia:re}=me[0],Ie=re?J.findIndex(ke=>ke.url===re.url):-1;return r.jsx(Hm,{media:ce,className:`${d}-item-${Wi(ce)?"video":"image"}`.trim(),style:C,onMediaClick:K&&Ie>=0?()=>g(Ee,Ie):void 0})})()});return r.jsx("div",{className:`${d}-item`,children:r.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,be?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:_.scalingValue(H??0,n)},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:le}),r.jsx("div",{className:`${d}-item-subtitle-row`,children:r.jsx("div",{style:{height:0,width:O}})})]})},Ee)})}),f&&typeof document<"u"&&(()=>{const ge=(s?document.getElementById(s):null)??document.body;return Mi.createPortal(r.jsx("div",{style:S,"data-selection":"none",children:r.jsx(jm,{prefix:d,items:F,index:ee,entry:z,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ve,lightboxEntries:N,entryIdx:G,layoutId:l,onClose:()=>W(!1),onPrev:()=>ue(-1),onNext:()=>ue(1)})}),ge)})()]})}const zm=`import { CommonComponentProps } from '../props';
|
|
6184
6184
|
import { scalingValue, useScopedStyles } from '../utils/index';
|
|
6185
6185
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
6186
6186
|
import { createPortal } from 'react-dom';
|
|
@@ -8212,7 +8212,7 @@ export function Hive({
|
|
|
8212
8212
|
</>
|
|
8213
8213
|
);
|
|
8214
8214
|
}
|
|
8215
|
-
`,Dm="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>'),Un={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 Vm(e){const t={};return t[Xe(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Xe(e,"fontSettings")]={...Un.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Xe(e,"fontSize")]={...Un.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Xe(e,"lineHeight")]={...Un.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Xe(e,"letterSpacing")]={...Un.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Xe(e,"wordSpacing")]={...Un.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Xe(e,"textAlign")]={...Un.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Xe(e,"textAppearance")]={...Un.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Ti=oi.filter(e=>e!=="count"),qm=Ti.reduce((e,t)=>({...e,...Vm(t)}),{}),Gm=Ti.reduce((e,t)=>({...e,[Xe(t,"fontFamily")]:"Goudy Bookletter 1911",[Xe(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Xe(t,"letterSpacing")]:0,[Xe(t,"wordSpacing")]:0,[Xe(t,"textAlign")]:"left",[Xe(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function os(e){return Ti.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Xe(n,"fontSize")]=i),o!==void 0&&(t[Xe(n,"lineHeight")]=o),t},{})}const Km={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Ti.map(e=>[$l[e],Cl(e)]))},Um={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!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:[{title1:"Dorothy Manners & Julanne Johnston",title2:"by Evans Studio",title3:"Screenland",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(1).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title1:"Inez Nadeau",title2:"Melbourne Spurr",title3:"Screenland",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(2).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title1:"Colleen Moore",title2:"Clarence S. Bull",title3:"Screenland",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(3).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title1:"Gloria Swanson",title2:"Donald Biddle Keyes",title3:"Screenland",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(4).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title1:"",title2:"",title3:"",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(5).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title1:"",title2:"",title3:"",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(6).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]}]},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"}},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"}},...qm},defaults:{imageDisplay:{display:"cover",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",closeIcon:Dm,closeIconColor:"#000000",closeIconHoverColor:"#999999",...Gm},layoutDefaults:{m:{gridLayout:{entryWidth:.8,horizontalGap:.0533,wrapperWidth:1,columnsCount:1,lockedParam:null},verticalGap:.266,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.55,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.04,closeIconMaxWidth:.05,iconMarginRight:.01,...os({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04})},d:{gridLayout:{entryWidth:.0833,horizontalGap:0,wrapperWidth:1,columnsCount:3,lockedParam:null},verticalGap:.09722,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,...os({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:[Km]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},Xm={element:Bm,id:"hive",name:"Hive",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:[...Ti.map(e=>({path:`${Xe(e,"fontFamily")}`}))]},fontRelations:{...Ti.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Xe(t,"fontFamily")}`}),{})},schema:Um,sourceCode:zm},rs=12;function Ym(e,t="50%"){const n={position:"absolute",width:rs,height:rs,pointerEvents:"none"};return e==="left-y"?{...n,left:20,top:"50%",transform:"translateY(-50%)"}:e==="center-x"?{...n,left:"50%",top:t,transform:"translate(-50%, -50%)"}:{...n,left:"50%",top:"50%",transform:"translate(-50%, -50%)"}}function Nt({className:e,areaStyle:t,hitPlacement:n,centerXHitTop:i,...o}){return r.jsx("div",{className:e,style:{...t,pointerEvents:"none"},"data-controls-center-only-drag":"",...o,children:r.jsx("div",{style:Ym(n,i)})})}function Jm(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 Zm({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 l=o.play();l&&l.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 No(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Qm(e){return String(e??"").trim().length>0}function as(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 ss(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 ls(e,t,n,i,o,l,s){const d=F.scalingValue(l,s),c=F.scalingValue(0,s),u=e===0,m=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!m||i?d:c}}function eg(e,t,n){const i=F.scalingValue(t,n),o=F.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const cs=10;function tg(e){return`
|
|
8215
|
+
`,Dm="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>'),Un={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 Vm(e){const t={};return t[Xe(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Xe(e,"fontSettings")]={...Un.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Xe(e,"fontSize")]={...Un.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Xe(e,"lineHeight")]={...Un.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Xe(e,"letterSpacing")]={...Un.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Xe(e,"wordSpacing")]={...Un.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Xe(e,"textAlign")]={...Un.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Xe(e,"textAppearance")]={...Un.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Ti=oi.filter(e=>e!=="count"),qm=Ti.reduce((e,t)=>({...e,...Vm(t)}),{}),Gm=Ti.reduce((e,t)=>({...e,[Xe(t,"fontFamily")]:"Goudy Bookletter 1911",[Xe(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Xe(t,"letterSpacing")]:0,[Xe(t,"wordSpacing")]:0,[Xe(t,"textAlign")]:"left",[Xe(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function os(e){return Ti.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Xe(n,"fontSize")]=i),o!==void 0&&(t[Xe(n,"lineHeight")]=o),t},{})}const Km={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Ti.map(e=>[$l[e],Cl(e)]))},Um={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!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:[{title1:"Dorothy Manners & Julanne Johnston",title2:"by Evans Studio",title3:"Screenland",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(1).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title1:"Inez Nadeau",title2:"Melbourne Spurr",title3:"Screenland",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(2).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title1:"Colleen Moore",title2:"Clarence S. Bull",title3:"Screenland",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(3).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title1:"Gloria Swanson",title2:"Donald Biddle Keyes",title3:"Screenland",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(4).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title1:"",title2:"",title3:"",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(5).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title1:"",title2:"",title3:"",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(6).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]}]},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"}},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"}},...qm},defaults:{imageDisplay:{display:"cover",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",closeIcon:Dm,closeIconColor:"#000000",closeIconHoverColor:"#999999",...Gm},layoutDefaults:{m:{gridLayout:{entryWidth:.8,horizontalGap:.0533,wrapperWidth:1,columnsCount:1,lockedParam:null},verticalGap:.266,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.55,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.04,closeIconMaxWidth:.05,iconMarginRight:.01,...os({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04})},d:{gridLayout:{entryWidth:.0833,horizontalGap:0,wrapperWidth:1,columnsCount:3,lockedParam:null},verticalGap:.09722,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,...os({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:[Km]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},Xm={element:Bm,id:"hive",name:"Hive",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:[...Ti.map(e=>({path:`${Xe(e,"fontFamily")}`}))]},fontRelations:{...Ti.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Xe(t,"fontFamily")}`}),{})},schema:Um,sourceCode:zm},rs=12;function Ym(e,t="50%"){const n={position:"absolute",width:rs,height:rs,pointerEvents:"none"};return e==="left-y"?{...n,left:20,top:"50%",transform:"translateY(-50%)"}:e==="center-x"?{...n,left:"50%",top:t,transform:"translate(-50%, -50%)"}:{...n,left:"50%",top:"50%",transform:"translate(-50%, -50%)"}}function Nt({className:e,areaStyle:t,hitPlacement:n,centerXHitTop:i,...o}){return r.jsx("div",{className:e,style:{...t,pointerEvents:"none"},"data-controls-center-only-drag":"",...o,children:r.jsx("div",{style:Ym(n,i)})})}function Jm(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 Zm({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 l=o.play();l&&l.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 No(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Qm(e){return String(e??"").trim().length>0}function as(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 ss(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 ls(e,t,n,i,o,l,s){const d=_.scalingValue(l,s),c=_.scalingValue(0,s),u=e===0,m=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!m||i?d:c}}function eg(e,t,n){const i=_.scalingValue(t,n),o=_.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const cs=10;function tg(e){return`
|
|
8216
8216
|
.${e}-wrapper {
|
|
8217
8217
|
display: grid;
|
|
8218
8218
|
align-items: start;
|
|
@@ -8643,7 +8643,7 @@ a.${e}-list-item {
|
|
|
8643
8643
|
overflow-wrap: anywhere;
|
|
8644
8644
|
word-break: break-word;
|
|
8645
8645
|
}
|
|
8646
|
-
`}const On=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],ya=["AColumn","BColumn","CColumn","DColumn","EColumn"],$n="cutLabel",Qi=[...ya,$n],sr=["A","B","C","D","E"];function El(e){return`${e}ColumnVerticalAlign`}const Dr=["Top","Center","Bottom"];function va(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return sr.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function ng(e){const t=va(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function ig(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return sr.includes(n)?n:null}function Rl(e,t,n){const i=ig(e);return i?i===t?!1:ng(n[El(i)]):!0}function eo(e){const t=va(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return sr.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function og(e,t,n){if(Ml(e,t,n))return eo(e);const i=eo(e);return i.kind==="baseline"?{kind:"top"}:i}function rg(e){const t=eo(e);return t.kind==="baseline"?{kind:"top"}:t}function Ml(e,t,n){return Rl(e,n,t)?eo(e).kind==="baseline":!1}function ag(e){const t={};let n=!1;for(const i of sr){const o=El(i),l=e[o];if(e.type==="b"){const s=String(l??"Top").trim();s!=="Top"&&s!=="Center"&&s!=="Bottom"&&(t[o]="Top",n=!0);continue}Rl(l,i,e)||(t[o]="Top",n=!0)}return n?t:null}function sg(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function lg(e){const t=eo(e).kind;return t==="baseline"?"center":t}function cg(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function ds(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function dg(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(),l=o-i;return n.remove(),l}function Lr(e,t,n,i){const o=e.titleEl;if(!o)return 0;const l=o.closest(`.${n}`);if(!l)return 0;const s=dg(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+s;const d=l.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+s}function ug(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const l=o.querySelector(`.${n}`);l&&(l.style.minHeight=`${i}px`,l.style.height=`${i}px`)}),i)}function pg(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const mg={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function lt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const gg={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function hg(e){return[lt(e,"textFontFamily"),lt(e,"textFontSettings"),{type:"row",items:[lt(e,"textFontSize"),lt(e,"textLineHeight"),lt(e,"textLetterSpacing"),lt(e,"textWordSpacing")]},lt(e,"textTextAlign"),lt(e,"textTextAppearance"),`${e}VerticalAlign`]}function fg(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Qi.map(e=>[gg[e],hg(e)]))}}function qo(e,t){const n=i=>{const o=lt(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===$n?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function us(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 Jt(Ft(n,t))}function ps(e,t,n,i){const o=qo(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s!==void 0&&s<l?`${n} ${i}`:n}function ms(e,t,n,i){const o=qo(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s===void 0||s>=l?{}:{[`--${n}-title-leading-gap`]:F.scalingValue((l-s)/2,i)}}const Qt=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Li=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Ii=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Ei=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],yg={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},vg=["hover","focus","filled","success","error"],gs=.004,gi=.004,Ir=gi,xa=50,to=1440,no=xa/to;function Pl(e){const t=typeof e=="number"&&e>0?e:to;return xa/t}function xg(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 to}const kl={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function zi(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function bg(e,t=1){const n=t/e;return Object.fromEntries(Qt.map(i=>[i,n]))}function wg(){return Object.fromEntries([...Li.map(e=>[e,0]),...Ii.map(e=>[e,0])])}function Sg(){return Object.fromEntries(Ei.map(e=>[e,0]))}function Io(e){return Object.fromEntries(Qt.map(t=>[t,typeof e[t]=="number"?e[t]:kl[t]]))}function Al(e,t,n){const i=e-no,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const l=i/o;return{paddingLeft:t*l,paddingRight:n*l}}function Ho(e,t,n){const i=ba(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((l,s)=>l+s,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function $g(e,t,n){const i={};for(let o=0;o<e;o+=1){const l=Li[o],s=Ii[o],d=typeof n[l]=="number"?n[l]:0,c=typeof n[s]=="number"?n[s]:0,u=Al(t[o]??0,d,c);u.paddingLeft!==d&&(i[l]=u.paddingLeft),u.paddingRight!==c&&(i[s]=u.paddingRight)}return i}function ba(e,t,n){if(e<=0)return[];const i=Qt.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),s=o.reduce((u,m)=>u+m,0)+no;if(t>=s)return i;const d=[...o];let c=s-t;for(let u=d.length-1;u>=0&&c>0;u-=1){const m=d[u]-no;if(m<=0)continue;const y=Math.min(c,m);d[u]-=y,c-=y}return[...d,i[e-1]]}function Cg(e,t,n){if(e<=1)return{};const i=ba(e,t,n),o={};for(let l=0;l<e-1;l+=1){const s=Qt[l];i[l]!==n[s]&&(o[s]=i[l])}return o}function hs(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...On]}function Tg(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Lg(e,t,n,i){const o=Math.min(i,e.length,Qt.length),l={};for(let s=0;s<o;s+=1){const d=e[s],c=t.indexOf(d);if(c===-1)continue;const u=Qt[c],m=Li[c],y=Ii[c],L=Ei[c],T=Qt[s],h=Li[s],v=Ii[s],w=Ei[s],I=n[u],R=n[m],A=n[y],H=n[L];typeof I=="number"&&(l[T]=I),typeof R=="number"&&(l[h]=R),typeof A=="number"&&(l[v]=A),typeof H=="number"&&(l[w]=H)}return l}function Wl(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 Ig(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=zi(e),l=e.type==="b"||e.type===void 0&&t.type==="b",s={...e,...bg(n,o),...wg()};if(l)for(const d of Ei)typeof t[d]=="number"&&(s[d]=t[d]);else Object.assign(s,Sg());return Wl(e,s)?s:e}function Eg(e,t,n){const i=ag(e);i&&(e={...e,...i});const o=Pl(n==null?void 0:n.designWidth),l=e.columns,s=t.columns,d=zi(e),c=zi(t),u=e.type==="b"||e.type===void 0&&t.type==="b",m=typeof l=="number"?l:typeof s=="number"?s:On.length,y=A=>{if(u)return A;const H=Io({...t,...A}),b=zi(A),O=Ho(m,b,H),M=$g(m,O,{...t,...A});return Object.keys(M).length===0?A:{...A,...M}};if(typeof l=="number"&&l!==s)return e;const L=hs(e),T=hs(t);if(!Tg(L,T))return y({...e,...Lg(L,T,t,m)});if(d<c&&typeof m=="number"&&!u){const A=Io({...t,...e});return y({...e,...Cg(m,d,A)})}if(u){const A=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,H=Math.max(0,(d-o)/2);return A>H?{...e,textPaddingLR:H}:e}const h=Io({...t,...e}),v=Ho(m,c,Io(t)),I=Ho(m,d,h).some((A,H)=>A<(v[H]??A)),R=Qt.some(A=>{const H=e[A],b=t[A];return typeof H=="number"&&typeof b=="number"&&H!==b});return I||R?y(e):e}function Rg(e,t,n,i){const o=t.slice(0,e).reduce((s,d)=>s+d,0),l=n.slice(e+1,t.length-1).reduce((s,d)=>s+d,0);return Math.max(no,i-o-l-no)}function Mg(e,t){return Math.random()*(t-e)+e}function Pg(e){return Object.fromEntries(Qt.map(t=>[t,typeof e[t]=="number"?e[t]:kl[t]]))}function Er(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function kg(e,t,n,i,o,l){return e.slice(0,t).map((s,d)=>{const c=Li[d],u=Ii[d],m=Ei[d];return{key:s,textPrefix:mg[s],widthKey:Qt[d],width:n[Qt[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:m,paddingLeft:i[c],paddingRight:o[u],paddingBottom:l[m]}})}function Ag({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:l,layoutId:s,onUpdateSettings:d}){const{prefix:c}=F.useScopedStyles(),u=!!o,{columns:m,type:y,wrapperWidth:L,entriesCount:T,cellMinHeight:h,dividerWidth:v,showVisibility:w,cut:I,showCut:R,cutCellMinHeight:A,cutLabel:H,imageSize:b,imageOnHover:O,entryHoverEffect:M,entryHoverShowOption:C,rowPaddingTop:q,rowPaddingBottom:f,rowPaddingTopB:W,columnsOrder:_,textPaddingLR:B,textColor:ee,backgroundColor:ne,dividerColor:G,textHoverColor:D,backgroundHoverColor:z,dividerHoverColor:P}=e,[S,K]=a.useState(void 0),[Z,U]=a.useState(null),N=O==="on"&&(!n||i),pe=(I??0)>0,g=y==="b",ue=a.useRef(null),ve=a.useRef(null),[ge,Ee]=a.useState(null),[te,me]=a.useState(to),J=Pl(te),be=Math.max(0,((L??0)-J)/2),le=Math.min(B??0,be),ce=Math.max(le,gi),re=((L??0)+J)/2;a.useLayoutEffect(()=>{if(!n){me(to);return}const ie=()=>{me(xg(ue.current))};ie();const Te=ue.current;if(!Te)return;const Me=new ResizeObserver(ie);Me.observe(Te);let Pe=Te;for(;Pe&&!Pe.style.getPropertyValue("--cntrl-article-width");)Pe=Pe.parentElement;return Pe&&Me.observe(Pe),()=>Me.disconnect()},[n,s]),a.useEffect(()=>{K(void 0)},[I,R,t,T]),a.useEffect(()=>{n&&!i&&K(void 0)},[n,i]);const Ie=F.buildColorVars(c,{textColor:ee,backgroundColor:ne,dividerColor:G,textHoverColor:D,backgroundHoverColor:z,dividerHoverColor:P},yg,vg),ke=l&&l!=="default"?`${c}-state-${l}`:"",_e=`${!n||i?M==="default"?`${c}-entry-hover-default`:M==="blinds"?`${c}-entry-hover-blinds`:M==="reveal"?`${c}-entry-hover-reveal`:"":""} ${ke}`.trim(),$=M==="reveal"&&(!n||i),ae=(w==null?void 0:w[0])??!1,E=(w==null?void 0:w[1])??!1,X=a.useRef(e),Y=a.useRef(s);a.useEffect(()=>{if(!d||!n){X.current=e,Y.current=s;return}if(Y.current!==s){X.current=e,Y.current=s;return}const ie=X.current;if(!(ie!==e))return;if(typeof ie.columns=="number"&&typeof e.columns=="number"&&ie.columns!==e.columns){X.current=e;return}const Me=Eg(e,ie,{designWidth:te});X.current=e,Wl(e,Me)&&d(Me)},[e,d,n,s,te]);const se=a.useMemo(()=>Pg(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),de=a.useMemo(()=>Er(e,Li),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),fe=a.useMemo(()=>Er(e,Ii),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Ne=a.useMemo(()=>Er(e,Ei),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),We=a.useMemo(()=>Array.isArray(_)&&_.length>0?_:[...On],[_]),j=a.useMemo(()=>kg(We,m,se,de,fe,Ne),[We,m,se,de,fe,Ne]),Ce=zi(e),Q=a.useMemo(()=>Qt.slice(0,m).map(ie=>se[ie]),[m,se]),he=a.useMemo(()=>ba(m,Ce,se),[m,Ce,se]),$e=a.useMemo(()=>Ho(m,Ce,se),[m,Ce,se]),Oe=a.useMemo(()=>j.map((ie,Te)=>Al($e[Te]??0,ie.paddingLeft,ie.paddingRight)),[j,$e]),Ye=a.useMemo(()=>{const ie=T===0?1/0:T;return(t??[]).slice(0,ie).map((Me,Pe)=>({id:Pe,cells:Object.fromEntries(On.map(De=>[De,Me[De]??""])),image:Me.image,link:Me.link}))},[t,T]),Be=pe?S??I:Ye.length,Ve=a.useMemo(()=>pe?Ye.slice(0,Be):Ye,[Ye,pe,Be]),dt=pe&&Be<Ye.length,ft=Ve.length>1||dt,wt=[ae?`${c}-divider-top`:"",E||ft?`${c}-divider-bottom`:""].filter(Boolean).join(" "),Ct=!n||i,Ze=()=>{if(!Ct)return;const ie=S??I;if(!R){K(Ye.length);return}K(Math.min(ie+R,Ye.length))},ze=ie=>F.scalingValue(ie,n??!1),Je=g?W??0:q??0,it=f??0,qe=h??0,yt=Je+qe/2,rt=Math.max(it,Ir),ot=ls(0,Ve.length,ae,E,dt,v??0,n??!1).borderTopWidth,kt=ge!=null?`${ge}px`:`calc(${ot} + ${ze(yt)})`,Ht=g?"rowPaddingTopB":"rowPaddingTop",Ge=j[0],$t=j[j.length-1],Ue=Oe[0],st=Oe[Oe.length-1],gt=Ge&&Ue?Math.max(Ue.paddingLeft,gi):0,ut=$t&&st?Math.max(st.paddingRight,gi):0,Bt=Ce,tn=ie=>{const Te=ue.current;if(!Te)return{x:0,y:0};const Me=Te.getBoundingClientRect();return{x:ie.clientX-Me.left+cs,y:ie.clientY-Me.top+cs}},ln=(ie,Te)=>{if(!N)return;const Me=ie.image;if(!(Me!=null&&Me.url)){U(null);return}const{x:Pe,y:De}=tn(Te),pt=(b==null?void 0:b.min)??80,Fe=(b==null?void 0:b.max)??320,mt=(Z==null?void 0:Z.rowId)===ie.id?Z.widthPx:Mg(pt,Fe);U({rowId:ie.id,url:Me.url,objectFit:"contain",isVideo:Jm(Me),widthPx:mt,x:Pe,y:De})},ct=ie=>{if(!N||!Z)return;const{x:Te,y:Me}=tn(ie);U(Pe=>!Pe||Pe.x===Te&&Pe.y===Me?Pe:{...Pe,x:Te,y:Me})},Ot=()=>{U(null)},At=ie=>{$&&as(ie,c),N&&U(null)},ye=ie=>{$&&ss(ie,c)};a.useLayoutEffect(()=>{if(!u||g){Ee(null);return}const ie=ve.current,Te=ie==null?void 0:ie.parentElement;if(!ie||!Te){Ee(null);return}const Me=()=>{const De=ie.querySelector("[data-list-row]");if(!De){Ee(null);return}const pt=Te.getBoundingClientRect(),Fe=De.getBoundingClientRect();Ee(Fe.top-pt.top+Fe.height/2)};Me();const Pe=new ResizeObserver(Me);return Pe.observe(ie),Pe.observe(Te),()=>Pe.disconnect()},[u,g,Ve,Je,it,qe,t,e,j,$e,te,v,ae,E,dt]);const we=a.useMemo(()=>!g&&ya.some(ie=>{const Te=ie.charAt(0),Me=e[`${ie}VerticalAlign`];return Ml(Me,e,Te)}),[g,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);a.useLayoutEffect(()=>{var mt;const ie=ue.current;if(!ie)return;const Te=()=>{ie.querySelectorAll("[data-list-col]").forEach(et=>{et.style.transform="";const vt=et.querySelector(`.${c}-list-col`);vt&&(vt.style.minHeight="",vt.style.height="");const ht=et.querySelector(`.${c}-list-col-title`);ht&&(ht.style.transform="")})};if(g||!we){Te();return}const Me=()=>{const et=Array.from(ie.querySelectorAll("[data-list-row]")),vt=`${c}-list-col`,ht=`${c}-baseline-probe`;et.forEach(Wt=>{Wt.querySelectorAll("[data-list-col]").forEach(It=>{It.style.transform="";const tt=It.querySelector(`.${vt}`);tt&&(tt.style.minHeight="",tt.style.height="");const Lt=It.querySelector(`.${c}-list-col-title`);Lt&&(Lt.style.transform="")})}),et.forEach(Wt=>{const It=Array.from(Wt.querySelectorAll("[data-list-col]"));ug(Wt,It,vt)}),ie.offsetHeight,et.forEach(Wt=>{const It=Array.from(Wt.querySelectorAll("[data-list-col]")),tt=Wt.getBoundingClientRect().top,Lt=new Map,Et=It.map(St=>{const Dt=St.querySelector(`.${c}-list-col-title`),jt={el:St,titleEl:Dt,letter:St.getAttribute("data-col-letter")??"",kind:St.getAttribute("data-valign")??"top",anchor:St.getAttribute("data-valign-anchor")};return Lt.set(jt.letter,jt),jt}),Rt=new Map,cn=(St,Dt)=>{const jt=Rt.get(St.letter);if(jt!==void 0)return jt;const gn=St.anchor?Lt.get(St.anchor):void 0;if(St.kind!=="baseline"||!gn||Dt.has(St.letter)){const ai=Lr(St,tt,vt,ht);return Rt.set(St.letter,ai),ai}Dt.add(St.letter);const In=cn(gn,Dt);Dt.delete(St.letter);const hn=Lr(St,tt,vt,ht),Gt=In-hn;pg(St.titleEl,Gt);const En=Lr(St,tt,vt,ht);return Rt.set(St.letter,En),En};Et.forEach(St=>cn(St,new Set))})};let Pe=null;const De=()=>{Pe===null&&(Pe=requestAnimationFrame(()=>{Pe=null,Me()}))};Me();const pt=new ResizeObserver(()=>De());pt.observe(ie);let Fe=!1;return typeof document<"u"&&((mt=document.fonts)!=null&&mt.ready)&&document.fonts.ready.then(()=>{Fe||De()}),()=>{Fe=!0,Pe!==null&&(cancelAnimationFrame(Pe),Pe=null),pt.disconnect(),Te()}},[we,g,e,t,te,Ve,$e]);const He=a.useMemo(()=>tg(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:He}}),r.jsx("div",{style:Ie,children:r.jsxs("div",{ref:ue,className:`${c}-wrapper ${_e}${wt?` ${wt}`:""}${g?` ${c}-type-b`:""}`.trim(),style:{width:F.scalingValue(L??0,n),...!g&&u?{[`--${c}-first-entry-handle-top`]:kt}:{}},onMouseMove:N?ct:void 0,onMouseLeave:N?Ot:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[Ve.map((ie,Te)=>{var pt;const Me=(((pt=ie.link)==null?void 0:pt.length)??0)>0,Pe=Me&&(!n||i)?"a":"div",De=ls(Te,Ve.length,ae,E,dt,v??0,n??!1);return r.jsxs(Pe,{ref:Te===0?Fe=>{ve.current=Fe}:void 0,className:`${c}-list-item${Me||C==="always"?` ${c}-list-item-has-link`:""}`,...Me?{href:ie.link,target:"_blank"}:{},style:De,onMouseEnter:Fe=>{$&&(Me||C==="always")&&as(Fe,c),N&&ln(ie,Fe)},onMouseLeave:Fe=>{$&&(Me||C==="always")&&ss(Fe,c)},children:[Je>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:ze(Je)}}),r.jsxs("div",{className:`${c}-list-cols-row${g?"":` ${c}-list-cols-row-h`}${u&&Te===0&&g?` ${c}-list-cols-row-controls`:""}`,...g?{}:{"data-list-row":""},style:g?void 0:{minHeight:ze(qe)},children:[j.map((Fe,mt)=>{const et=mt===j.length-1,vt=Oe[mt],ht=Fe.paddingBottom,Wt=Qm(ie.cells[Fe.key]),It=g&&Wt&&ht>0,tt=g?{minHeight:ze(qe)}:{width:ze($e[mt])},Lt=g?{paddingLeft:ze(le),paddingRight:ze(le)}:{paddingLeft:ze(vt.paddingLeft),paddingRight:ze(vt.paddingRight)},Et=Fe.textPrefix.charAt(0),Rt=g?rg(e[`${Fe.textPrefix}VerticalAlign`]):og(e[`${Fe.textPrefix}VerticalAlign`],e,Et),cn=g&&Wt&&u&&Te===0;return r.jsxs("div",{className:g?`${c}-list-col-wrap`:void 0,...g?{}:{"data-list-col":"","data-col-letter":Et,"data-valign":Rt.kind,...Rt.kind==="baseline"?{"data-valign-anchor":Rt.anchorLetter}:{}},children:[r.jsx("div",{className:`${c}-list-col${et?` ${c}-list-col-last`:""}`,style:{...Lt,...tt,...g?{justifyContent:ds(Rt.kind)}:{}},"data-test":Fe.width,children:r.jsx("span",{className:ps(e,Fe.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...us(qo(e,Fe.textPrefix),n),...ms(e,Fe.textPrefix,c,n),...g?{}:sg(Rt.kind)},children:ie.cells[Fe.key]??null})}),It&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:ze(ht)}}),cn&&r.jsx(Nt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Fe.paddingBottomKey,"data-controls-static-handle":"","data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:"center",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:ze(Math.max(ht,Ir))}})]},Fe.key)}),u&&Te===0&&g&&r.jsxs(r.Fragment,{children:[r.jsx(Nt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(re),className:`${c}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:ze(ce),height:"100%"}}),r.jsx(Nt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"textPaddingLR","data-controls-static-handle":"","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),className:`${c}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:ze(Math.max(ce,Ce-ce)),width:ze(ce),height:"100%"}})]})]}),!g&&it>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:ze(it)}}),u&&Te===0&&!g&&r.jsx(Nt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"rowPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:ze(rt)}})]},ie.id)}),u&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx(Nt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Ht,"data-controls-static-handle":"",...g?{}:{"data-controls-handle-left":"20"},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:g?"center":"left-y",areaStyle:{position:"absolute",top:ot,left:0,width:"100%",height:ze(Math.max(Je,Ir))}})},"row-padding-handles"),u&&!g&&Ge&&$t&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(Nt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Ge.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String($e[0]-((Ue==null?void 0:Ue.paddingRight)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:ze(gt),height:"100%"}}),r.jsx(Nt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":$t.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String($e[j.length-1]-((st==null?void 0:st.paddingLeft)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:ze(Bt-ut),width:ze(ut),height:"100%"}})]},"column-edge-padding-handles"),u&&!g&&j.slice(0,-1).map((ie,Te)=>{const Me=j[Te+1],Pe=he.slice(0,Te+1).reduce((et,vt)=>et+vt,0),De=Oe[Te],pt=Oe[Te+1],Fe=Math.max(De.paddingRight,gi),mt=Math.max(pt.paddingLeft,gi);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(Nt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":ie.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String($e[Te]-De.paddingLeft),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:ze(Pe-Fe),width:ze(Fe),height:"100%"}}),r.jsx(Nt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Me.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String($e[Te+1]-pt.paddingRight),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:ze(Pe),width:ze(mt),height:"100%"}})]},`${ie.paddingRightKey}-padding`)}),u&&!g&&j.slice(0,-1).map((ie,Te)=>{const Me=Rg(Te,he,Q,Ce),De=he.slice(0,Te+1).reduce((pt,Fe)=>pt+Fe,0)-gs/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":ie.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(xa),"data-controls-max-fraction":String(Me),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:ze(De),width:ze(gs),height:"calc(100%)",pointerEvents:"auto"}})},`${ie.widthKey}-junction`)})]}),dt&&(()=>{const ie=qo(e,$n),Te=lg(e.cutLabelVerticalAlign),Me=ie.textTextAlign==="justify"||g;return r.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:ze(A??0),cursor:Ct?"pointer":"default",...eg(E,v??0,n??!1)},onClick:Ct?Ze:void 0,onMouseEnter:$||N?At:void 0,onMouseLeave:$?ye:void 0,children:r.jsx("div",{className:`${c}-list-cols-row`,style:{...g?{paddingLeft:ze(le),paddingRight:ze(le)}:{},justifyContent:cg(ie.textTextAlign),alignItems:ds(Te)},children:r.jsx("span",{className:ps(e,$n,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...us(ie,n),...ms(e,$n,c,n),...Me?{width:"100%"}:{}},children:H})})})})(),N&&Z&&(()=>{const ie=No(Z.widthPx),Te={width:ie,height:"auto",maxHeight:ie,objectFit:"contain",left:Z.x,top:Z.y,position:"absolute"};return r.jsx(Zm,{media:Z,className:Z.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Te},`${Z.rowId}-${Z.url}`)})()]})})]})}const Wg=`import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
8646
|
+
`}const On=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],ya=["AColumn","BColumn","CColumn","DColumn","EColumn"],$n="cutLabel",Qi=[...ya,$n],sr=["A","B","C","D","E"];function El(e){return`${e}ColumnVerticalAlign`}const Dr=["Top","Center","Bottom"];function va(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return sr.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function ng(e){const t=va(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function ig(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return sr.includes(n)?n:null}function Rl(e,t,n){const i=ig(e);return i?i===t?!1:ng(n[El(i)]):!0}function eo(e){const t=va(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return sr.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function og(e,t,n){if(Ml(e,t,n))return eo(e);const i=eo(e);return i.kind==="baseline"?{kind:"top"}:i}function rg(e){const t=eo(e);return t.kind==="baseline"?{kind:"top"}:t}function Ml(e,t,n){return Rl(e,n,t)?eo(e).kind==="baseline":!1}function ag(e){const t={};let n=!1;for(const i of sr){const o=El(i),l=e[o];if(e.type==="b"){const s=String(l??"Top").trim();s!=="Top"&&s!=="Center"&&s!=="Bottom"&&(t[o]="Top",n=!0);continue}Rl(l,i,e)||(t[o]="Top",n=!0)}return n?t:null}function sg(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function lg(e){const t=eo(e).kind;return t==="baseline"?"center":t}function cg(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function ds(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function dg(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(),l=o-i;return n.remove(),l}function Lr(e,t,n,i){const o=e.titleEl;if(!o)return 0;const l=o.closest(`.${n}`);if(!l)return 0;const s=dg(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+s;const d=l.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+s}function ug(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const l=o.querySelector(`.${n}`);l&&(l.style.minHeight=`${i}px`,l.style.height=`${i}px`)}),i)}function pg(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const mg={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function lt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const gg={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function hg(e){return[lt(e,"textFontFamily"),lt(e,"textFontSettings"),{type:"row",items:[lt(e,"textFontSize"),lt(e,"textLineHeight"),lt(e,"textLetterSpacing"),lt(e,"textWordSpacing")]},lt(e,"textTextAlign"),lt(e,"textTextAppearance"),`${e}VerticalAlign`]}function fg(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Qi.map(e=>[gg[e],hg(e)]))}}function qo(e,t){const n=i=>{const o=lt(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===$n?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function us(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 Jt(_t(n,t))}function ps(e,t,n,i){const o=qo(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s!==void 0&&s<l?`${n} ${i}`:n}function ms(e,t,n,i){const o=qo(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s===void 0||s>=l?{}:{[`--${n}-title-leading-gap`]:_.scalingValue((l-s)/2,i)}}const Qt=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Li=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Ii=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Ei=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],yg={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},vg=["hover","focus","filled","success","error"],gs=.004,gi=.004,Ir=gi,xa=50,to=1440,no=xa/to;function Pl(e){const t=typeof e=="number"&&e>0?e:to;return xa/t}function xg(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 to}const kl={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function zi(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function bg(e,t=1){const n=t/e;return Object.fromEntries(Qt.map(i=>[i,n]))}function wg(){return Object.fromEntries([...Li.map(e=>[e,0]),...Ii.map(e=>[e,0])])}function Sg(){return Object.fromEntries(Ei.map(e=>[e,0]))}function Io(e){return Object.fromEntries(Qt.map(t=>[t,typeof e[t]=="number"?e[t]:kl[t]]))}function Al(e,t,n){const i=e-no,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const l=i/o;return{paddingLeft:t*l,paddingRight:n*l}}function Ho(e,t,n){const i=ba(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((l,s)=>l+s,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function $g(e,t,n){const i={};for(let o=0;o<e;o+=1){const l=Li[o],s=Ii[o],d=typeof n[l]=="number"?n[l]:0,c=typeof n[s]=="number"?n[s]:0,u=Al(t[o]??0,d,c);u.paddingLeft!==d&&(i[l]=u.paddingLeft),u.paddingRight!==c&&(i[s]=u.paddingRight)}return i}function ba(e,t,n){if(e<=0)return[];const i=Qt.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),s=o.reduce((u,m)=>u+m,0)+no;if(t>=s)return i;const d=[...o];let c=s-t;for(let u=d.length-1;u>=0&&c>0;u-=1){const m=d[u]-no;if(m<=0)continue;const y=Math.min(c,m);d[u]-=y,c-=y}return[...d,i[e-1]]}function Cg(e,t,n){if(e<=1)return{};const i=ba(e,t,n),o={};for(let l=0;l<e-1;l+=1){const s=Qt[l];i[l]!==n[s]&&(o[s]=i[l])}return o}function hs(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...On]}function Tg(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Lg(e,t,n,i){const o=Math.min(i,e.length,Qt.length),l={};for(let s=0;s<o;s+=1){const d=e[s],c=t.indexOf(d);if(c===-1)continue;const u=Qt[c],m=Li[c],y=Ii[c],L=Ei[c],T=Qt[s],h=Li[s],v=Ii[s],w=Ei[s],I=n[u],R=n[m],A=n[y],H=n[L];typeof I=="number"&&(l[T]=I),typeof R=="number"&&(l[h]=R),typeof A=="number"&&(l[v]=A),typeof H=="number"&&(l[w]=H)}return l}function Wl(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 Ig(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=zi(e),l=e.type==="b"||e.type===void 0&&t.type==="b",s={...e,...bg(n,o),...wg()};if(l)for(const d of Ei)typeof t[d]=="number"&&(s[d]=t[d]);else Object.assign(s,Sg());return Wl(e,s)?s:e}function Eg(e,t,n){const i=ag(e);i&&(e={...e,...i});const o=Pl(n==null?void 0:n.designWidth),l=e.columns,s=t.columns,d=zi(e),c=zi(t),u=e.type==="b"||e.type===void 0&&t.type==="b",m=typeof l=="number"?l:typeof s=="number"?s:On.length,y=A=>{if(u)return A;const H=Io({...t,...A}),b=zi(A),O=Ho(m,b,H),M=$g(m,O,{...t,...A});return Object.keys(M).length===0?A:{...A,...M}};if(typeof l=="number"&&l!==s)return e;const L=hs(e),T=hs(t);if(!Tg(L,T))return y({...e,...Lg(L,T,t,m)});if(d<c&&typeof m=="number"&&!u){const A=Io({...t,...e});return y({...e,...Cg(m,d,A)})}if(u){const A=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,H=Math.max(0,(d-o)/2);return A>H?{...e,textPaddingLR:H}:e}const h=Io({...t,...e}),v=Ho(m,c,Io(t)),I=Ho(m,d,h).some((A,H)=>A<(v[H]??A)),R=Qt.some(A=>{const H=e[A],b=t[A];return typeof H=="number"&&typeof b=="number"&&H!==b});return I||R?y(e):e}function Rg(e,t,n,i){const o=t.slice(0,e).reduce((s,d)=>s+d,0),l=n.slice(e+1,t.length-1).reduce((s,d)=>s+d,0);return Math.max(no,i-o-l-no)}function Mg(e,t){return Math.random()*(t-e)+e}function Pg(e){return Object.fromEntries(Qt.map(t=>[t,typeof e[t]=="number"?e[t]:kl[t]]))}function Er(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function kg(e,t,n,i,o,l){return e.slice(0,t).map((s,d)=>{const c=Li[d],u=Ii[d],m=Ei[d];return{key:s,textPrefix:mg[s],widthKey:Qt[d],width:n[Qt[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:m,paddingLeft:i[c],paddingRight:o[u],paddingBottom:l[m]}})}function Ag({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:l,layoutId:s,onUpdateSettings:d}){const{prefix:c}=_.useScopedStyles(),u=!!o,{columns:m,type:y,wrapperWidth:L,entriesCount:T,cellMinHeight:h,dividerWidth:v,showVisibility:w,cut:I,showCut:R,cutCellMinHeight:A,cutLabel:H,imageSize:b,imageOnHover:O,entryHoverEffect:M,entryHoverShowOption:C,rowPaddingTop:q,rowPaddingBottom:f,rowPaddingTopB:W,columnsOrder:F,textPaddingLR:B,textColor:ee,backgroundColor:ne,dividerColor:G,textHoverColor:D,backgroundHoverColor:z,dividerHoverColor:P}=e,[S,K]=a.useState(void 0),[Z,U]=a.useState(null),N=O==="on"&&(!n||i),pe=(I??0)>0,g=y==="b",ue=a.useRef(null),ve=a.useRef(null),[ge,Ee]=a.useState(null),[te,me]=a.useState(to),J=Pl(te),be=Math.max(0,((L??0)-J)/2),le=Math.min(B??0,be),ce=Math.max(le,gi),re=((L??0)+J)/2;a.useLayoutEffect(()=>{if(!n){me(to);return}const ie=()=>{me(xg(ue.current))};ie();const Te=ue.current;if(!Te)return;const Me=new ResizeObserver(ie);Me.observe(Te);let Pe=Te;for(;Pe&&!Pe.style.getPropertyValue("--cntrl-article-width");)Pe=Pe.parentElement;return Pe&&Me.observe(Pe),()=>Me.disconnect()},[n,s]),a.useEffect(()=>{K(void 0)},[I,R,t,T]),a.useEffect(()=>{n&&!i&&K(void 0)},[n,i]);const Ie=_.buildColorVars(c,{textColor:ee,backgroundColor:ne,dividerColor:G,textHoverColor:D,backgroundHoverColor:z,dividerHoverColor:P},yg,vg),ke=l&&l!=="default"?`${c}-state-${l}`:"",Fe=`${!n||i?M==="default"?`${c}-entry-hover-default`:M==="blinds"?`${c}-entry-hover-blinds`:M==="reveal"?`${c}-entry-hover-reveal`:"":""} ${ke}`.trim(),$=M==="reveal"&&(!n||i),ae=(w==null?void 0:w[0])??!1,E=(w==null?void 0:w[1])??!1,X=a.useRef(e),Y=a.useRef(s);a.useEffect(()=>{if(!d||!n){X.current=e,Y.current=s;return}if(Y.current!==s){X.current=e,Y.current=s;return}const ie=X.current;if(!(ie!==e))return;if(typeof ie.columns=="number"&&typeof e.columns=="number"&&ie.columns!==e.columns){X.current=e;return}const Me=Eg(e,ie,{designWidth:te});X.current=e,Wl(e,Me)&&d(Me)},[e,d,n,s,te]);const se=a.useMemo(()=>Pg(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),de=a.useMemo(()=>Er(e,Li),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),fe=a.useMemo(()=>Er(e,Ii),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Ne=a.useMemo(()=>Er(e,Ei),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),We=a.useMemo(()=>Array.isArray(F)&&F.length>0?F:[...On],[F]),j=a.useMemo(()=>kg(We,m,se,de,fe,Ne),[We,m,se,de,fe,Ne]),Ce=zi(e),Q=a.useMemo(()=>Qt.slice(0,m).map(ie=>se[ie]),[m,se]),he=a.useMemo(()=>ba(m,Ce,se),[m,Ce,se]),$e=a.useMemo(()=>Ho(m,Ce,se),[m,Ce,se]),Oe=a.useMemo(()=>j.map((ie,Te)=>Al($e[Te]??0,ie.paddingLeft,ie.paddingRight)),[j,$e]),Ye=a.useMemo(()=>{const ie=T===0?1/0:T;return(t??[]).slice(0,ie).map((Me,Pe)=>({id:Pe,cells:Object.fromEntries(On.map(De=>[De,Me[De]??""])),image:Me.image,link:Me.link}))},[t,T]),Be=pe?S??I:Ye.length,Ve=a.useMemo(()=>pe?Ye.slice(0,Be):Ye,[Ye,pe,Be]),dt=pe&&Be<Ye.length,ft=Ve.length>1||dt,wt=[ae?`${c}-divider-top`:"",E||ft?`${c}-divider-bottom`:""].filter(Boolean).join(" "),Ct=!n||i,Ze=()=>{if(!Ct)return;const ie=S??I;if(!R){K(Ye.length);return}K(Math.min(ie+R,Ye.length))},ze=ie=>_.scalingValue(ie,n??!1),Je=g?W??0:q??0,it=f??0,qe=h??0,yt=Je+qe/2,rt=Math.max(it,Ir),ot=ls(0,Ve.length,ae,E,dt,v??0,n??!1).borderTopWidth,kt=ge!=null?`${ge}px`:`calc(${ot} + ${ze(yt)})`,Ht=g?"rowPaddingTopB":"rowPaddingTop",Ge=j[0],$t=j[j.length-1],Ue=Oe[0],st=Oe[Oe.length-1],gt=Ge&&Ue?Math.max(Ue.paddingLeft,gi):0,ut=$t&&st?Math.max(st.paddingRight,gi):0,Bt=Ce,tn=ie=>{const Te=ue.current;if(!Te)return{x:0,y:0};const Me=Te.getBoundingClientRect();return{x:ie.clientX-Me.left+cs,y:ie.clientY-Me.top+cs}},ln=(ie,Te)=>{if(!N)return;const Me=ie.image;if(!(Me!=null&&Me.url)){U(null);return}const{x:Pe,y:De}=tn(Te),pt=(b==null?void 0:b.min)??80,_e=(b==null?void 0:b.max)??320,mt=(Z==null?void 0:Z.rowId)===ie.id?Z.widthPx:Mg(pt,_e);U({rowId:ie.id,url:Me.url,objectFit:"contain",isVideo:Jm(Me),widthPx:mt,x:Pe,y:De})},ct=ie=>{if(!N||!Z)return;const{x:Te,y:Me}=tn(ie);U(Pe=>!Pe||Pe.x===Te&&Pe.y===Me?Pe:{...Pe,x:Te,y:Me})},Ot=()=>{U(null)},At=ie=>{$&&as(ie,c),N&&U(null)},ye=ie=>{$&&ss(ie,c)};a.useLayoutEffect(()=>{if(!u||g){Ee(null);return}const ie=ve.current,Te=ie==null?void 0:ie.parentElement;if(!ie||!Te){Ee(null);return}const Me=()=>{const De=ie.querySelector("[data-list-row]");if(!De){Ee(null);return}const pt=Te.getBoundingClientRect(),_e=De.getBoundingClientRect();Ee(_e.top-pt.top+_e.height/2)};Me();const Pe=new ResizeObserver(Me);return Pe.observe(ie),Pe.observe(Te),()=>Pe.disconnect()},[u,g,Ve,Je,it,qe,t,e,j,$e,te,v,ae,E,dt]);const we=a.useMemo(()=>!g&&ya.some(ie=>{const Te=ie.charAt(0),Me=e[`${ie}VerticalAlign`];return Ml(Me,e,Te)}),[g,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);a.useLayoutEffect(()=>{var mt;const ie=ue.current;if(!ie)return;const Te=()=>{ie.querySelectorAll("[data-list-col]").forEach(et=>{et.style.transform="";const vt=et.querySelector(`.${c}-list-col`);vt&&(vt.style.minHeight="",vt.style.height="");const ht=et.querySelector(`.${c}-list-col-title`);ht&&(ht.style.transform="")})};if(g||!we){Te();return}const Me=()=>{const et=Array.from(ie.querySelectorAll("[data-list-row]")),vt=`${c}-list-col`,ht=`${c}-baseline-probe`;et.forEach(Wt=>{Wt.querySelectorAll("[data-list-col]").forEach(It=>{It.style.transform="";const tt=It.querySelector(`.${vt}`);tt&&(tt.style.minHeight="",tt.style.height="");const Lt=It.querySelector(`.${c}-list-col-title`);Lt&&(Lt.style.transform="")})}),et.forEach(Wt=>{const It=Array.from(Wt.querySelectorAll("[data-list-col]"));ug(Wt,It,vt)}),ie.offsetHeight,et.forEach(Wt=>{const It=Array.from(Wt.querySelectorAll("[data-list-col]")),tt=Wt.getBoundingClientRect().top,Lt=new Map,Et=It.map(St=>{const Dt=St.querySelector(`.${c}-list-col-title`),jt={el:St,titleEl:Dt,letter:St.getAttribute("data-col-letter")??"",kind:St.getAttribute("data-valign")??"top",anchor:St.getAttribute("data-valign-anchor")};return Lt.set(jt.letter,jt),jt}),Rt=new Map,cn=(St,Dt)=>{const jt=Rt.get(St.letter);if(jt!==void 0)return jt;const gn=St.anchor?Lt.get(St.anchor):void 0;if(St.kind!=="baseline"||!gn||Dt.has(St.letter)){const ai=Lr(St,tt,vt,ht);return Rt.set(St.letter,ai),ai}Dt.add(St.letter);const In=cn(gn,Dt);Dt.delete(St.letter);const hn=Lr(St,tt,vt,ht),Gt=In-hn;pg(St.titleEl,Gt);const En=Lr(St,tt,vt,ht);return Rt.set(St.letter,En),En};Et.forEach(St=>cn(St,new Set))})};let Pe=null;const De=()=>{Pe===null&&(Pe=requestAnimationFrame(()=>{Pe=null,Me()}))};Me();const pt=new ResizeObserver(()=>De());pt.observe(ie);let _e=!1;return typeof document<"u"&&((mt=document.fonts)!=null&&mt.ready)&&document.fonts.ready.then(()=>{_e||De()}),()=>{_e=!0,Pe!==null&&(cancelAnimationFrame(Pe),Pe=null),pt.disconnect(),Te()}},[we,g,e,t,te,Ve,$e]);const He=a.useMemo(()=>tg(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:He}}),r.jsx("div",{style:Ie,children:r.jsxs("div",{ref:ue,className:`${c}-wrapper ${Fe}${wt?` ${wt}`:""}${g?` ${c}-type-b`:""}`.trim(),style:{width:_.scalingValue(L??0,n),...!g&&u?{[`--${c}-first-entry-handle-top`]:kt}:{}},onMouseMove:N?ct:void 0,onMouseLeave:N?Ot:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[Ve.map((ie,Te)=>{var pt;const Me=(((pt=ie.link)==null?void 0:pt.length)??0)>0,Pe=Me&&(!n||i)?"a":"div",De=ls(Te,Ve.length,ae,E,dt,v??0,n??!1);return r.jsxs(Pe,{ref:Te===0?_e=>{ve.current=_e}:void 0,className:`${c}-list-item${Me||C==="always"?` ${c}-list-item-has-link`:""}`,...Me?{href:ie.link,target:"_blank"}:{},style:De,onMouseEnter:_e=>{$&&(Me||C==="always")&&as(_e,c),N&&ln(ie,_e)},onMouseLeave:_e=>{$&&(Me||C==="always")&&ss(_e,c)},children:[Je>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:ze(Je)}}),r.jsxs("div",{className:`${c}-list-cols-row${g?"":` ${c}-list-cols-row-h`}${u&&Te===0&&g?` ${c}-list-cols-row-controls`:""}`,...g?{}:{"data-list-row":""},style:g?void 0:{minHeight:ze(qe)},children:[j.map((_e,mt)=>{const et=mt===j.length-1,vt=Oe[mt],ht=_e.paddingBottom,Wt=Qm(ie.cells[_e.key]),It=g&&Wt&&ht>0,tt=g?{minHeight:ze(qe)}:{width:ze($e[mt])},Lt=g?{paddingLeft:ze(le),paddingRight:ze(le)}:{paddingLeft:ze(vt.paddingLeft),paddingRight:ze(vt.paddingRight)},Et=_e.textPrefix.charAt(0),Rt=g?rg(e[`${_e.textPrefix}VerticalAlign`]):og(e[`${_e.textPrefix}VerticalAlign`],e,Et),cn=g&&Wt&&u&&Te===0;return r.jsxs("div",{className:g?`${c}-list-col-wrap`:void 0,...g?{}:{"data-list-col":"","data-col-letter":Et,"data-valign":Rt.kind,...Rt.kind==="baseline"?{"data-valign-anchor":Rt.anchorLetter}:{}},children:[r.jsx("div",{className:`${c}-list-col${et?` ${c}-list-col-last`:""}`,style:{...Lt,...tt,...g?{justifyContent:ds(Rt.kind)}:{}},"data-test":_e.width,children:r.jsx("span",{className:ps(e,_e.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...us(qo(e,_e.textPrefix),n),...ms(e,_e.textPrefix,c,n),...g?{}:sg(Rt.kind)},children:ie.cells[_e.key]??null})}),It&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:ze(ht)}}),cn&&r.jsx(Nt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":_e.paddingBottomKey,"data-controls-static-handle":"","data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:"center",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:ze(Math.max(ht,Ir))}})]},_e.key)}),u&&Te===0&&g&&r.jsxs(r.Fragment,{children:[r.jsx(Nt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(re),className:`${c}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:ze(ce),height:"100%"}}),r.jsx(Nt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"textPaddingLR","data-controls-static-handle":"","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),className:`${c}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:ze(Math.max(ce,Ce-ce)),width:ze(ce),height:"100%"}})]})]}),!g&&it>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:ze(it)}}),u&&Te===0&&!g&&r.jsx(Nt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"rowPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:ze(rt)}})]},ie.id)}),u&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx(Nt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Ht,"data-controls-static-handle":"",...g?{}:{"data-controls-handle-left":"20"},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:g?"center":"left-y",areaStyle:{position:"absolute",top:ot,left:0,width:"100%",height:ze(Math.max(Je,Ir))}})},"row-padding-handles"),u&&!g&&Ge&&$t&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(Nt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Ge.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String($e[0]-((Ue==null?void 0:Ue.paddingRight)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:ze(gt),height:"100%"}}),r.jsx(Nt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":$t.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String($e[j.length-1]-((st==null?void 0:st.paddingLeft)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:ze(Bt-ut),width:ze(ut),height:"100%"}})]},"column-edge-padding-handles"),u&&!g&&j.slice(0,-1).map((ie,Te)=>{const Me=j[Te+1],Pe=he.slice(0,Te+1).reduce((et,vt)=>et+vt,0),De=Oe[Te],pt=Oe[Te+1],_e=Math.max(De.paddingRight,gi),mt=Math.max(pt.paddingLeft,gi);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(Nt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":ie.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String($e[Te]-De.paddingLeft),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:ze(Pe-_e),width:ze(_e),height:"100%"}}),r.jsx(Nt,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Me.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String($e[Te+1]-pt.paddingRight),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:ze(Pe),width:ze(mt),height:"100%"}})]},`${ie.paddingRightKey}-padding`)}),u&&!g&&j.slice(0,-1).map((ie,Te)=>{const Me=Rg(Te,he,Q,Ce),De=he.slice(0,Te+1).reduce((pt,_e)=>pt+_e,0)-gs/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":ie.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(xa),"data-controls-max-fraction":String(Me),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:ze(De),width:ze(gs),height:"calc(100%)",pointerEvents:"auto"}})},`${ie.widthKey}-junction`)})]}),dt&&(()=>{const ie=qo(e,$n),Te=lg(e.cutLabelVerticalAlign),Me=ie.textTextAlign==="justify"||g;return r.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:ze(A??0),cursor:Ct?"pointer":"default",...eg(E,v??0,n??!1)},onClick:Ct?Ze:void 0,onMouseEnter:$||N?At:void 0,onMouseLeave:$?ye:void 0,children:r.jsx("div",{className:`${c}-list-cols-row`,style:{...g?{paddingLeft:ze(le),paddingRight:ze(le)}:{},justifyContent:cg(ie.textTextAlign),alignItems:ds(Te)},children:r.jsx("span",{className:ps(e,$n,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...us(ie,n),...ms(e,$n,c,n),...Me?{width:"100%"}:{}},children:H})})})})(),N&&Z&&(()=>{const ie=No(Z.widthPx),Te={width:ie,height:"auto",maxHeight:ie,objectFit:"contain",left:Z.x,top:Z.y,position:"absolute"};return r.jsx(Zm,{media:Z,className:Z.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Te},`${Z.rowId}-${Z.url}`)})()]})})]})}const Wg=`import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
8647
8647
|
import { CommonComponentProps } from '../props';
|
|
8648
8648
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
8649
8649
|
import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
|
|
@@ -11600,7 +11600,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
11600
11600
|
</>
|
|
11601
11601
|
);
|
|
11602
11602
|
}
|
|
11603
|
-
`,_i=["A","B","C","D","E"],fs=[...Dr,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],Xn={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 _g(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function Eo(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function Fg(){return Object.fromEntries(_i.map((e,t)=>{const n=On[t],i=`${e} column`;return[n,_g(i)]}))}function Ng(){const e={};for(const t of _i)e[`${t}ColumnWidth`]=Eo(`${t} column width`),e[`${t}ColumnPaddingLeft`]=Eo(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=Eo(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=Eo(`${t} column padding bottom`);return e}function ys(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...On]};for(const l of _i)i[`${l}ColumnWidth`]=l==="A"?.0798:.32,i[`${l}ColumnPaddingLeft`]=0,i[`${l}ColumnPaddingRight`]=0,i[`${l}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function Hg(e){const t={};if(e===$n)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Dr]},enum:[...Dr]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...fs],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...fs]}}return t[lt(e,"textFontFamily")]={type:"string",scope:"layout",title:"",display:{type:"font-family-select",hideLabel:!0}},t[lt(e,"textFontSettings")]={...Xn.fontSettings,scope:"layout",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[lt(e,"textFontSize")]={...Xn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[lt(e,"textLineHeight")]={...Xn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[lt(e,"textLetterSpacing")]={...Xn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[lt(e,"textWordSpacing")]={...Xn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[lt(e,"textTextAlign")]={...Xn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[lt(e,"textTextAppearance")]={...Xn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const Og=Qi.reduce((e,t)=>({...e,...Hg(t)}),{});function jg(e){return{verticalAlign:e===$n?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===$n?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function Bg(e,t={}){var n;return{...jg(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const vs=new Set(["textFontFamily","textFontSettings"]);function zg(e,t,n){const i=l=>n===void 0?!0:n==="common"?vs.has(l):!vs.has(l),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=va(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[lt(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[lt(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[lt(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[lt(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[lt(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[lt(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[lt(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[lt(e,"textTextAppearance")]=t.textTextAppearance),o}function Oo(e={},t){return Qi.reduce((n,i)=>({...n,...zg(i,Bg(i,e),t)}),{})}const Dg=Oo(),Vg=fg();function _l(e){return[lt(e,"textFontFamily"),lt(e,"textFontSettings"),lt(e,"textFontSize"),lt(e,"textLineHeight"),lt(e,"textLetterSpacing"),lt(e,"textWordSpacing"),lt(e,"textTextAlign"),lt(e,"textTextAppearance"),`${e}VerticalAlign`]}function qg(){const e=[];return ya.forEach((t,n)=>{const i=On[n],o=_l(t);for(let l=1;l<On.length;l+=1){const s=[{name:"columns",value:l},...Array.from({length:l},(d,c)=>({name:`columnsOrder.${c}`,value:i,isNotEqual:!0}))];o.forEach(d=>{e.push({if:s,then:{name:`properties.${d}.display.visible`,value:!1}})})}}),e}const Gg=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];_l($n);const Kg=[..._i.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],Yn=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(1).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(2).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(3).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(4).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(5).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(8).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(9).webp"}],Ug=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:Yn[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:Yn[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:Yn[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:Yn[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:Yn[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:Yn[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:Yn[6],link:""}],Xg=[..._i.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],Yg={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0},display:{type:"array",ref:{columnsOrder:"settings.properties.columnsOrder",columnsCount:"settings.properties.columns"}},items:{type:"object",properties:{...Fg(),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:Ug},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"]}},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"}},...Ng(),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"}},...Og,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",entryHoverEffect:"default",entryHoverShowOption:"always",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#000000",textHoverColor:"#FFFFFF",...Dg,...Oo({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:ys({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},...Oo({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:ys({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},...Oo({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...qg(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...Kg.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}},..._i.map(e=>({if:{name:"type",value:"a"},then:{name:`properties.${e}ColumnPaddingBottom.display.visible`,value:!1}}))],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","entryHoverShowOption","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...Xg]},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:"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__",Vg]}],paletteBookmark:{items:[...Gg],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Jg={element:Ag,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>Ig(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme_List.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...Qi.map(e=>({path:`${lt(e,"textFontFamily")}`}))]},fontRelations:{...Qi.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${lt(t,"textFontFamily")}`}),{})},schema:Yg,sourceCode:Wg},xs=300,Mn=.004,Zg={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"},Qg=["hover","focus","filled","success","error"];function eh(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function bs(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function ws(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:F.scalingValue((o-t)/2,i)}}function th(e){return`
|
|
11603
|
+
`,Fi=["A","B","C","D","E"],fs=[...Dr,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],Xn={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 Fg(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function Eo(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function _g(){return Object.fromEntries(Fi.map((e,t)=>{const n=On[t],i=`${e} column`;return[n,Fg(i)]}))}function Ng(){const e={};for(const t of Fi)e[`${t}ColumnWidth`]=Eo(`${t} column width`),e[`${t}ColumnPaddingLeft`]=Eo(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=Eo(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=Eo(`${t} column padding bottom`);return e}function ys(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...On]};for(const l of Fi)i[`${l}ColumnWidth`]=l==="A"?.0798:.32,i[`${l}ColumnPaddingLeft`]=0,i[`${l}ColumnPaddingRight`]=0,i[`${l}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function Hg(e){const t={};if(e===$n)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Dr]},enum:[...Dr]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...fs],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...fs]}}return t[lt(e,"textFontFamily")]={type:"string",scope:"layout",title:"",display:{type:"font-family-select",hideLabel:!0}},t[lt(e,"textFontSettings")]={...Xn.fontSettings,scope:"layout",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[lt(e,"textFontSize")]={...Xn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[lt(e,"textLineHeight")]={...Xn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[lt(e,"textLetterSpacing")]={...Xn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[lt(e,"textWordSpacing")]={...Xn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[lt(e,"textTextAlign")]={...Xn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[lt(e,"textTextAppearance")]={...Xn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const Og=Qi.reduce((e,t)=>({...e,...Hg(t)}),{});function jg(e){return{verticalAlign:e===$n?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===$n?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function Bg(e,t={}){var n;return{...jg(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const vs=new Set(["textFontFamily","textFontSettings"]);function zg(e,t,n){const i=l=>n===void 0?!0:n==="common"?vs.has(l):!vs.has(l),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=va(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[lt(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[lt(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[lt(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[lt(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[lt(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[lt(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[lt(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[lt(e,"textTextAppearance")]=t.textTextAppearance),o}function Oo(e={},t){return Qi.reduce((n,i)=>({...n,...zg(i,Bg(i,e),t)}),{})}const Dg=Oo(),Vg=fg();function Fl(e){return[lt(e,"textFontFamily"),lt(e,"textFontSettings"),lt(e,"textFontSize"),lt(e,"textLineHeight"),lt(e,"textLetterSpacing"),lt(e,"textWordSpacing"),lt(e,"textTextAlign"),lt(e,"textTextAppearance"),`${e}VerticalAlign`]}function qg(){const e=[];return ya.forEach((t,n)=>{const i=On[n],o=Fl(t);for(let l=1;l<On.length;l+=1){const s=[{name:"columns",value:l},...Array.from({length:l},(d,c)=>({name:`columnsOrder.${c}`,value:i,isNotEqual:!0}))];o.forEach(d=>{e.push({if:s,then:{name:`properties.${d}.display.visible`,value:!1}})})}}),e}const Gg=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Fl($n);const Kg=[...Fi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],Yn=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(1).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(2).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(3).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(4).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(5).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(8).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(9).webp"}],Ug=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:Yn[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:Yn[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:Yn[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:Yn[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:Yn[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:Yn[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:Yn[6],link:""}],Xg=[...Fi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],Yg={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0},display:{type:"array",ref:{columnsOrder:"settings.properties.columnsOrder",columnsCount:"settings.properties.columns"}},items:{type:"object",properties:{..._g(),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:Ug},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"]}},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"}},...Ng(),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"}},...Og,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",entryHoverEffect:"default",entryHoverShowOption:"always",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#000000",textHoverColor:"#FFFFFF",...Dg,...Oo({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:ys({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},...Oo({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:ys({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},...Oo({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...qg(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...Kg.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}},...Fi.map(e=>({if:{name:"type",value:"a"},then:{name:`properties.${e}ColumnPaddingBottom.display.visible`,value:!1}}))],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","entryHoverShowOption","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...Xg]},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:"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__",Vg]}],paletteBookmark:{items:[...Gg],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Jg={element:Ag,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>Ig(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme_List.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...Qi.map(e=>({path:`${lt(e,"textFontFamily")}`}))]},fontRelations:{...Qi.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${lt(t,"textFontFamily")}`}),{})},schema:Yg,sourceCode:Wg},xs=300,Mn=.004,Zg={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"},Qg=["hover","focus","filled","success","error"];function eh(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function bs(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function ws(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:_.scalingValue((o-t)/2,i)}}function th(e){return`
|
|
11604
11604
|
.${e}-wrapper {
|
|
11605
11605
|
box-sizing: border-box;
|
|
11606
11606
|
display: flex;
|
|
@@ -11793,7 +11793,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
11793
11793
|
left: 20px;
|
|
11794
11794
|
transform: translateY(-50%);
|
|
11795
11795
|
}
|
|
11796
|
-
`}function Ss(e,t,n,i,o,l,s,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:l??0,textAppearance:s,color:d??"#000000"}}function nh({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:l}){const{prefix:s}=
|
|
11796
|
+
`}function Ss(e,t,n,i,o,l,s,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:l??0,textAppearance:s,color:d??"#000000"}}function nh({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:l}){const{prefix:s}=_.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:m=694e-6,dividerStyle:y="solid",entryHoverEffect:L="default",autoclose:T="off",icon:h,iconMaxWidth:v=.00833,iconPaddingRight:w=0,iconAnimation:I="rotate 45",questionColor:R="#000000",answerColor:A="#000000",dividerColor:H="#0000001F",iconColor:b="#000000",questionHoverColor:O="#666666",iconHoverColor:M="#666666",iconActiveColor:C="#000000",dividerHoverColor:q="#000000",questionFontFamily:f,questionFontSettings:W,questionFontSize:F,questionLineHeight:B,questionLetterSpacing:ee,questionWordSpacing:ne,questionTextAppearance:G,answerFontFamily:D,answerFontSettings:z,answerFontSize:P,answerLineHeight:S,answerLetterSpacing:K,answerWordSpacing:Z,answerTextAppearance:U,questionPaddingLeft:N=0,questionPaddingTop:pe=0,questionPaddingBottom:g=0,answerPaddingLeft:ue=0,answerPaddingRight:ve=0,answerPaddingTop:ge=0,answerPaddingBottom:Ee=0}=e,te=t??[],[me,J]=a.useState(()=>new Set),be=!n||i;a.useEffect(()=>{J(new Set)},[T]),a.useEffect(()=>{n&&!o&&!i&&J(new Set)},[n,o,i]);const le=ze=>_.scalingValue(ze,n??!1),ce=Math.max(N,Mn),re=Math.max(pe,Mn),Ie=Math.max(g,Mn),ke=Math.max(ue,Mn),Le=Math.max(ve,Mn),Fe=Math.max(ge,Mn),$=Math.max(Ee,Mn),ae=Math.max(0,(c??1)-w-v),E=Math.max(0,(c??1)-ve),X=Math.max(0,(c??1)-ue),Y=Math.max(w,Mn),se=Math.max(0,(c??1)-N-v),de=a.useMemo(()=>me.size===0?0:Math.min(...me),[me]),fe=a.useCallback(ze=>me.has(ze),[me]),Ne=be&&L==="default"?`${s}-entry-hover-default`:"",We=h??"",j=We!=="",Ce=I.replace(/^rotate /,""),Q=`${s}-icon-anim-${Ce}`,he=Jt(_t(Ss(f,W,F,B,ee,ne,G,R),n)),$e=Jt(_t(Ss(D,z,P,S,K,Z,U,A),n)),Oe=bs(F,B,`${s}-question`,`${s}-text-tight-leading`),Ye=bs(P,S,`${s}-answer-text`,`${s}-text-tight-leading`),Be=ws(F,B,s,n),Ve=ws(P,S,s,n),dt=_.buildColorVars(s,{questionColor:R,answerColor:A,dividerColor:H,iconColor:b,questionHoverColor:O,iconHoverColor:M,iconActiveColor:C,dividerHoverColor:q},Zg,Qg),ft=l&&l!=="default"?`${s}-state-${l}`:"",wt=a.useCallback(ze=>{be&&J(Je=>{if(Je.has(ze)){const qe=new Set(Je);return qe.delete(ze),qe}if(T==="on")return new Set([ze]);const it=new Set(Je);return it.add(ze),it})},[be,T]),Ct=a.useMemo(()=>th(s),[s]),Ze={[`--${s}-divider-width`]:_.scalingValue(m,n??!1),[`--${s}-divider-style`]:y,[`--${s}-icon-max-width`]:_.scalingValue(v,n??!1),...u>0?{[`--${s}-question-min-height`]:_.scalingValue(u,n??!1)}:{}};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ct}}),r.jsx("div",{style:dt,children:r.jsx("div",{className:nt(`${s}-wrapper`,n&&!i&&`${s}-editor`,Ne,ft),style:{width:_.scalingValue(c,n??!1),maxWidth:"100%",...Ze},children:te.map((ze,Je)=>{var kt;const it=fe(Je),qe=((kt=ze.question)==null?void 0:kt.trim())??"",yt=ze.answer,rt=((yt==null?void 0:yt.length)??0)>0,ot=d&&Je===de;return r.jsxs("div",{className:nt(`${s}-item`,it&&`${s}-item-open`),"data-faq-item":"",children:[r.jsxs("div",{className:`${s}-question-controls`,children:[ot&&r.jsxs(r.Fragment,{children:[r.jsx(Nt,{"data-controls":"questionPaddingTop","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",top:0,left:0,width:"100%",height:le(re),zIndex:2}}),r.jsx(Nt,{"data-controls":"questionPaddingLeft","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(ae),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:le(ce),height:"100%",zIndex:2}}),r.jsx(Nt,{"data-controls":"iconPaddingRight","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(se),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,right:0,width:le(Y),height:"100%",zIndex:2}})]}),r.jsxs("button",{type:"button",className:`${s}-question-button`,"aria-expanded":it,style:{...he,...Be,paddingLeft:le(N),paddingRight:le(w)},onClick:()=>wt(Je),children:[pe>0&&r.jsx("span",{className:`${s}-padding-handle`,style:{height:le(pe)},"aria-hidden":"true"}),r.jsxs("span",{className:`${s}-question-row`,children:[r.jsx("span",{className:Oe,children:qe}),rt&&(j?r.jsx("span",{className:`${s}-icon ${s}-icon-custom ${Q}`,"aria-hidden":"true",children:r.jsx(Zt,{url:We,fill:b,hoverFill:M,className:`${s}-icon-image`})}):r.jsx("span",{className:`${s}-icon ${s}-icon-default ${Q}`,"aria-hidden":"true"}))]}),g>0&&r.jsx("span",{className:`${s}-padding-handle`,style:{height:le(g)},"aria-hidden":"true"})]}),ot&&r.jsx(Nt,{"data-controls":"questionPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:le(Ie),zIndex:2}})]}),rt&&yt&&r.jsx("div",{className:`${s}-panel`,"aria-hidden":!it,children:r.jsx("div",{className:`${s}-panel-inner`,children:r.jsxs("div",{className:`${s}-answer-controls`,children:[ot&&it&&r.jsxs(r.Fragment,{children:[r.jsx(Nt,{"data-controls":"answerPaddingTop","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",top:0,left:0,width:"100%",height:le(Fe),zIndex:2}}),r.jsx(Nt,{"data-controls":"answerPaddingLeft","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(E),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:le(ke),height:"100%",zIndex:2}}),r.jsx(Nt,{"data-controls":"answerPaddingRight","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(X),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,right:0,width:le(Le),height:"100%",zIndex:2}})]}),ge>0&&r.jsx("div",{className:`${s}-padding-handle`,style:{height:le(ge)}}),r.jsx("div",{className:`${s}-answer`,style:{...$e,...Ve,paddingLeft:le(ue),paddingRight:le(ve)},children:r.jsx("div",{className:Ye,children:r.jsx(Si,{content:yt})})}),Ee>0&&r.jsx("div",{className:`${s}-padding-handle`,style:{height:le(Ee)}}),ot&&it&&r.jsx(Nt,{"data-controls":"answerPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:le($),zIndex:2}})]})})})]},Je)})})})]})}const ih=`import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
11797
11797
|
import cn from 'classnames';
|
|
11798
11798
|
import { CommonComponentProps } from '../props';
|
|
11799
11799
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -12590,7 +12590,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
12590
12590
|
</>
|
|
12591
12591
|
);
|
|
12592
12592
|
}
|
|
12593
|
-
`;function Pn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const $s={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},oh=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],rh={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:Pn("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:{...$s.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:{...$s.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:Pn("Question Padding Left"),questionPaddingTop:Pn("Question Padding Top"),questionPaddingBottom:Pn("Question Padding Bottom"),answerPaddingLeft:Pn("Answer Padding Left"),answerPaddingRight:Pn("Answer Padding Right"),answerPaddingTop:Pn("Answer Padding Top"),answerPaddingBottom:Pn("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"https://cdn.cntrl.site/component-assets/PlusIcon.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:[...oh],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},ah={element:nh,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:rh,sourceCode:ih},Cn=e=>e.display==="cover",lr=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Cs=100,sh=.2,Ts=8,Fl=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,l]=a.useState(0),[s,d]=a.useState(!1),c=a.useRef(null),u=a.useRef(0);u.current=o;const m=a.useMemo(()=>typeof window>"u"?Cs:Math.max(Cs,window.innerHeight*sh),[]),y=a.useCallback(f=>Math.max(0,1-f/(m*1.5)),[m]),L=a.useCallback(f=>Math.max(0,1-f/(m*.45)),[m]),T=a.useCallback(f=>{const W=typeof window<"u"?window.innerHeight:800,_=Math.max(.88,1-f/W*.12);return`translateY(${f}px) scale(${_})`},[]),h=a.useCallback(()=>{c.current=null},[]),v=a.useCallback(()=>{d(!0),l(0),window.setTimeout(()=>d(!1),n),h()},[n,h]),w=a.useCallback(()=>{const f=typeof window<"u"?window.innerHeight:800;d(!0),l(f),window.setTimeout(()=>{t(),h(),d(!1)},Math.min(n,200))},[n,t,h]),I=a.useCallback(f=>{!e||s||f.pointerType==="touch"&&(i!=null&&i(f.target)||(c.current={startX:f.clientX,startY:f.clientY,isLocked:null,pointerId:f.pointerId}))},[e,s,i]),R=a.useCallback(f=>{const W=c.current;if(!e||!W||f.pointerType!=="touch"||W.pointerId!==f.pointerId)return;const _=f.clientX-W.startX,B=f.clientY-W.startY;if(W.isLocked===null){if(Math.abs(_)<Ts&&Math.abs(B)<Ts)return;if(B>0&&B>Math.abs(_))W.isLocked=!0,f.currentTarget.setPointerCapture(f.pointerId);else{W.isLocked=!1,h();return}}if(!W.isLocked)return;f.preventDefault();const ee=Math.max(0,B);u.current=ee,l(ee)},[e,h]),A=a.useCallback(f=>{const W=c.current;if(!e||!W||f.pointerType!=="touch"||W.pointerId!==f.pointerId)return;const _=W.isLocked===!0;if(f.currentTarget.hasPointerCapture(f.pointerId)&&f.currentTarget.releasePointerCapture(f.pointerId),!_){h();return}f.clientY-W.startY>=m?w():v()},[m,w,e,h,v]),H=a.useCallback(f=>{A(f)},[A]),b=a.useCallback(f=>{A(f)},[A]),O=o>0,M=s?`transform ${n}ms ease`:"none",C=s?`opacity ${n}ms ease`:"none",q=o>0||s;return{isSwipeDragging:O,backdropStyle:{opacity:y(o),transition:C},mediaAreaStyle:{transform:T(o),transition:M,touchAction:O?"none":void 0,willChange:O?"transform":void 0},overlayContentStyle:q?{opacity:L(o),transition:C}:void 0,swipeHandlers:e?{onPointerDown:I,onPointerMove:R,onPointerUp:H,onPointerCancel:b}:{},dismissAreaStyle:e?{touchAction:O?"none":"pan-x"}:void 0}},lh="[data-lightbox-scrollable]",Nl=()=>{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,l=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 s=d=>{const c=d.target;c instanceof Element&&c.closest(lh)||d.preventDefault()};return document.addEventListener("touchmove",s,{passive:!1}),()=>{document.removeEventListener("touchmove",s),document.body.style.overflow=t,document.body.style.position=n,document.body.style.top=i,document.body.style.width=o,document.documentElement.style.overflow=l,window.scrollTo(0,e)}},[])},ch=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},dh=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},uh=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},ph=(e,t,n,{duration:i,easing:o,onComplete:l})=>{const s=e.scrollLeft,d=n-s,c=s-n,u=(h,v)=>{dh(t),e.scrollLeft=h,v&&(l==null||l())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let m=!1,y=0;const L=()=>{t.removeEventListener("transitionend",T),clearTimeout(y)},T=h=>{h.target!==t||h.propertyName!=="transform"||m||(m=!0,L(),u(n,!0))};return t.addEventListener("transitionend",T),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)`,y=window.setTimeout(()=>{m||(m=!0,L(),u(n,!0))},i+64),()=>{m||(m=!0,L(),u(s-uh(t),!1))}},Di=300,mh=900,gh=1500,hh="cubic-bezier(0.16, 1, 0.3, 1)",fh=3e3,yh=2,vh=16,xh=.05,bh=1,Ro=.3,wh=50,Sh=20,ui=.004,Ri=["title1","title2","title3"],$h={title1:"1",title2:"2",title3:"3"},Ch={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Th={title1:.02,title2:.02,title3:.02},Mo=e=>`max(${e}, ${Sh}px)`,Lh=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]}},Ih=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=Lh(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},xt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Eh=e=>[xt(e,"fontFamily"),xt(e,"fontSettings"),{type:"row",items:[xt(e,"fontSize"),xt(e,"lineHeight"),xt(e,"letterSpacing"),xt(e,"wordSpacing")]},xt(e,"textAlign"),xt(e,"textAppearance")],Rh=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Ri.map(e=>[$h[e],Eh(e)]))}),wa=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((l,s)=>l+s,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:l,widths:s},d)=>{if(l<=0||d<=0)return{overflow:l,widths:[d,...s]};const c=Math.min(l,d);return{overflow:l-c,widths:[d-c,...s]}},{overflow:i-1,widths:[]});return o},Hl=(e,t)=>wa(e,t),Po=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Ls=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:wa(e.length,n),effective:Hl(e.length,n)}},Mh=(e,t,n,i,o,l,s)=>{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:l,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:s,text:i}),d},Rr=(e,t)=>{const n=i=>{const o=xt(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]]}},Ph=(e,t,n,i)=>e.slice(0,i).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0),Mr=(e,t,n)=>{var o,l;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((l=t.fontSettings)==null?void 0:l.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 Ft(i,n)},kh=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,onClose:s})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:m,imageGap:y,closeIcon:L,closeIconMaxWidth:T,closeIconColor:h,closeIconHoverColor:v,thumbnailTrigger:w,thumbnailVisibility:I,thumbnailObjectFit:R,thumbnailActive:A,thumbnailActiveColor:H,title1Width:b,title2Width:O,title3Width:M,title1MarginLeft:C=0,title2MarginLeft:q=0,title3MarginLeft:f=0,titleRowMarginBottom:W=0,titleHeaderLayout:_="desktop",contentMarginTop:B,iconMarginLeft:ee}=n,ne=p=>F.scalingValue(p,i??!1),G=c??n.thumnailSize??.03,D=ne(G),z=ne(u),P=ne(m??.02),S=ne(y??0),K=ne(B??0),Z=Mo(K),U=ne(ee??0),[N,pe]=a.useState(0),g=a.useRef(N);g.current=N;const ue=t[N],{title1:ve,title2:ge,title3:Ee}=Ih(ue),te=Mr("title1",Rr(n,"title1"),i),me=Mr("title2",Rr(n,"title2"),i),J=Mr("title3",Rr(n,"title3"),i),be=_==="mobile",le=!o&&(!i||l),ce=le,re=le,Ie=le,ke=Cn(R),Le=ke?{"--image-aspect-ratio":lr(R)}:void 0,_e=!!(ve||ge||Ee),$=a.useMemo(()=>Mh(e,ve,ge,Ee,te,me,J),[e,N,ve,ge,Ee,te,me,J]),ae=a.useMemo(()=>({title1Width:b,title2Width:O,title3Width:M}),[b,O,M]),E=a.useMemo(()=>$.map(p=>ae[p.widthKey]),[$,ae]),X=a.useMemo(()=>wa($.length,E),[$.length,E]),Y=a.useMemo(()=>Hl($.length,E),[$.length,E]),se=a.useMemo(()=>$.filter(p=>p.prefix==="title1"),[$]),de=a.useMemo(()=>$.filter(p=>p.prefix==="title2"||p.prefix==="title3"),[$]),fe=a.useMemo(()=>Ls(se,ae),[se,ae]),Ne=a.useMemo(()=>Ls(de,ae),[de,ae]),We=a.useCallback((p,x)=>{const k=$.indexOf(p);if(!be||x==="single-row")return{effectiveWidth:Y[k]??0,resolvedWidth:X[k]??0,maxWidth:Po(k,X)};if(x==="two-row-top"){const xe=se.indexOf(p);return{effectiveWidth:fe.effective[xe]??0,resolvedWidth:fe.resolved[xe]??0,maxWidth:Po(xe,fe.resolved)}}const oe=de.indexOf(p);return{effectiveWidth:Ne.effective[oe]??0,resolvedWidth:Ne.resolved[oe]??0,maxWidth:Po(oe,Ne.resolved)}},[de,Ne,Y,X,$,se,fe,be]),j=a.useCallback(p=>F.scalingValue(p,i??!1),[i]),Ce=j(W??0),Q=a.useMemo(()=>({title1MarginLeft:C,title2MarginLeft:q,title3MarginLeft:f}),[C,q,f]),he=a.useCallback(p=>$.slice(0,p+1).reduce((x,k,oe)=>x+(k!=null&&k.marginLeftKey?Q[k.marginLeftKey]??0:0)+(X[oe]??0),0)+(be?0:C??0),[$,Q,X,be,C]),$e=a.useCallback(()=>be?0:C??0,[be,C]),Oe=a.useCallback(p=>de.slice(0,p).reduce((x,k,oe)=>x+(k.marginLeftKey?Q[k.marginLeftKey]??0:0)+(Ne.resolved[oe]??0),0),[de,Ne.resolved,Q]),Ye=a.useCallback(p=>{const x=de[p];return Oe(p)+(x.marginLeftKey?Q[x.marginLeftKey]??0:0)+(Ne.resolved[p]??0)},[de,Ne.resolved,Oe,Q]),Be=(p,x)=>{const k=p.marginLeftKey?Q[p.marginLeftKey]??0:0,{effectiveWidth:oe,resolvedWidth:xe,maxWidth:Ae}=We(p,x),Ke=o&&x==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":p.prefix,style:{...x==="single-row"?{gridArea:p.prefix}:{},width:j(oe),...k>0?{marginLeft:j(k)}:{}},children:[r.jsx("p",{className:p.className,style:p.style,children:p.text}),Ke&&p.marginLeftKey&&r.jsx("div",{"data-controls":p.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(xe),style:{position:"absolute",top:0,left:j(-k),width:`max(${j(k)}, 10px)`,height:"100%",pointerEvents:"auto"}}),Ke&&r.jsx("div",{"data-controls":p.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,right:j(-ui/2),width:j(ui),height:"100%",pointerEvents:"auto"}})]},p.className)},Ve=()=>{const p=be?-1:$.findIndex(oe=>oe.prefix==="title1"),x=!be&&(o||(C??0)>0)?(()=>{const oe=C??0,xe=p>=0?X[p]:b??0;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(xe),style:{position:"absolute",top:0,left:0,width:`max(${j(oe)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,k=$.flatMap((oe,xe)=>{if(!oe.marginLeftKey)return[];const Ae=Q[oe.marginLeftKey]??0,Ke=Ph($,X,Q,xe)+$e();return r.jsx("div",{"data-controls":oe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(X[xe]),style:{position:"absolute",top:0,left:j(Ke),width:`max(${j(Ae)}, 10px)`,height:"100%",pointerEvents:"auto"}},oe.marginLeftKey)});return x?[x,...k]:k},dt=()=>$.map((p,x)=>{const k=Po(x,X),xe=he(x)-ui/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":p.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(k),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:j(xe),width:j(ui),height:"100%",pointerEvents:"auto"}})},`${p.widthKey}-junction`)}),ft=()=>de.flatMap((p,x)=>{if(!p.marginLeftKey)return[];const k=Q[p.marginLeftKey]??0,oe=Oe(x),{resolvedWidth:xe}=We(p,"two-row-bottom");return r.jsx("div",{"data-controls":p.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(xe),style:{position:"absolute",top:0,left:j(oe),width:`max(${j(k)}, 10px)`,height:"100%",pointerEvents:"auto"}},p.marginLeftKey)}),wt=()=>de.map((p,x)=>{const{maxWidth:k}=We(p,"two-row-bottom"),xe=Ye(x)-ui/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":p.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(k),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:j(xe),width:j(ui),height:"100%",pointerEvents:"auto"}})},`${p.widthKey}-junction`)}),Ct=a.useRef(null),Ze=a.useRef(null),ze=a.useRef(null),Je=a.useRef(null),it=a.useRef([]),qe=a.useRef([]),yt=a.useRef(0),rt=a.useRef(null),ot=a.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),kt=a.useRef(null),Ht=a.useRef(null),Ge=a.useRef(0),$t=a.useRef("forward"),Ue=a.useRef(0),st=a.useRef(null),gt=a.useRef(!1),ut=t.length>1&&(!o||!!l),Bt=ut?3:1,tn=a.useMemo(()=>Array.from({length:Bt},()=>t).flat(),[t,Bt]),[ln,ct]=a.useState(!1),[Ot,At]=a.useState(!1),[ye,we]=a.useState(!0),He=a.useRef(null),ie=a.useRef(null),Te=a.useRef(!1),Me=a.useRef(!1),Pe=a.useRef(null),De=a.useRef(null),pt=ce&&!ye,Fe=a.useCallback(()=>{ce&&(we(!0),De.current&&clearTimeout(De.current),De.current=setTimeout(()=>{ot.current.isActive||we(!1)},fh))},[ce]),mt=a.useCallback(()=>{o||Me.current||(Me.current=!0,At(!1),Pe.current=setTimeout(()=>{s()},Di))},[o,s]),et=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":pt?"true":"false",style:{width:F.scalingValue(T??0,i),height:F.scalingValue(T??0,i),marginRight:U,"--close-icon-hover-color":v},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:mt,"aria-label":"Close",children:r.jsx(Zt,{url:L,fill:h,hoverFill:i&&!l?h:v,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:U,height:"100%",pointerEvents:"auto"}})]}),vt=(p="two-row")=>r.jsx("div",{...p==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:j(C??0),flexShrink:0,...p==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...p==="two-row"&&o?{pointerEvents:"auto"}:{}}}),ht=()=>{const p=$.find(oe=>oe.prefix==="title1"),x=$.filter(oe=>oe.prefix==="title2"||oe.prefix==="title3"),k=x.length>0||o||(W??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(C??0)>0||o?vt():null,p&&Be(p,"two-row-top"),L&&et()]}),k?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[x.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[x.map(oe=>Be(oe,"two-row-bottom")),o&&r.jsxs(r.Fragment,{children:[ft(),wt()]})]}):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:Ce,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},Wt=()=>r.jsxs(r.Fragment,{children:[(C??0)>0||o?vt("single-row"):null,$.map(p=>Be(p,"single-row")),o?r.jsxs(r.Fragment,{children:[Ve(),dt()]}):null,L?et():null]}),It=a.useCallback(p=>!!(p.closest("[data-controls]")||p.closest(`.${e}-thumbnails`)||p.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:tt,backdropStyle:Lt,mediaAreaStyle:Et,overlayContentStyle:Rt,swipeHandlers:cn,dismissAreaStyle:St}=Fl({enabled:le??!1,onClose:mt,animMs:Di,isBlockedTarget:It}),Dt=()=>{if(!ut||t.length===0)return yt.current=0,0;const p=qe.current[0],x=qe.current[t.length];if(!p||!x)return yt.current;const k=x.offsetLeft-p.offsetLeft;return k>0&&(yt.current=k),yt.current},jt=(p=!1)=>{if(!ut)return;const x=Ze.current,k=Dt();!x||k<=0||k<x.clientWidth*.25||(x.scrollLeft<=0?(x.scrollLeft+=k,p&&(ot.current.scrollLeft+=k),gt.current&&(Ue.current+=k)):x.scrollLeft>=k*2&&(x.scrollLeft-=k,p&&(ot.current.scrollLeft-=k),gt.current&&(Ue.current-=k)))},gn=(p,x=(k=>(k=Ze.current)==null?void 0:k.scrollLeft)()??0)=>{if(!ut)return p;let oe=t.length+p,xe=1/0;for(let Ae=0;Ae<Bt;Ae++){const Ke=Ae*t.length+p,at=qe.current[Ke];if(!at)continue;const _t=Math.abs(at.offsetLeft-x);_t<xe&&(xe=_t,oe=Ke)}return oe},In=p=>{const x=Ze.current;return!p||!x?!1:p.offsetWidth>x.clientWidth+1},hn=p=>{const x=Ze.current;if(!p||!x||!In(p))return!1;const k=p.offsetLeft,oe=k+p.offsetWidth;return x.scrollLeft>=k-1&&x.scrollLeft+x.clientWidth<=oe+1},Gt=(p=(x=>(x=Ze.current)==null?void 0:x.scrollLeft)()??0)=>{for(let oe=0;oe<qe.current.length;oe+=1){const xe=qe.current[oe];if(xe&&hn(xe))return oe}let k={flatIndex:0,distance:1/0};return qe.current.forEach((oe,xe)=>{if(!oe)return;const Ae=Math.abs(oe.offsetLeft-p);Ae<k.distance&&(k={flatIndex:xe,distance:Ae})}),k.flatIndex},En=p=>{Ze.current&&qe.current.forEach(x=>{x&&(x.style.scrollSnapAlign=In(x)&&p==="backward"?"end":"start")})},ai=(p,x,k)=>{const oe=p-x,xe=Gt(x),Ae=qe.current[xe];if(hn(Ae))return Gt(p)%t.length;const Ke=qe.current[xe+1],at=Ae?Ke?Ke.offsetLeft-Ae.offsetLeft:Ae.offsetWidth:0,_t=at>0?oe>at*Ro?1:oe<-at*Ro?-1:0:0;return _t===0?k:ut?(k+_t+t.length)%t.length:Math.max(0,Math.min(t.length-1,k+_t))},si=a.useCallback((p=!1)=>{if(I!=="on"||o)return;const x=Je.current,k=g.current,oe=it.current[k];if(!x||!oe||x.scrollWidth<=x.clientWidth)return;const xe=x.scrollLeft,Ae=xe+x.clientWidth,Ke=oe.offsetLeft,at=Ke+oe.offsetWidth;if(Ke>=xe&&at<=Ae)return;const _t=x.scrollWidth-x.clientWidth;let Mt=xe;if(!p&&He.current===null){const ci=it.current[k-1],Ni=it.current[k+1],yo=ci?oe.offsetLeft-ci.offsetLeft:Ni?Ni.offsetLeft-oe.offsetLeft:oe.offsetWidth;at>Ae?Mt+=yo:Ke<xe&&(Mt-=yo)}else at>Ae?Mt=at-x.clientWidth:Mt=Ke;x.scrollLeft=Math.max(0,Math.min(_t,Mt))},[o,I]),Fi=a.useCallback((p=!1)=>{p&&(Te.current=!0),ie.current===null&&(ie.current=requestAnimationFrame(()=>{ie.current=null;const x=Te.current;Te.current=!1,si(x)}))},[si]),cr=a.useCallback(p=>{if(p===g.current)return;const x=g.current;g.current=p;const k=Math.abs(p-x)>1,oe=ut&&t.length>1&&(x===t.length-1&&p===0||x===0&&p===t.length-1);pe(p),Fi(k||oe)},[t.length,ut,Fi]),nn=()=>{if(!Ze.current||t.length===0||He.current!==null||ot.current.isActive&&ot.current.hasMoved)return;const p=Ze.current.scrollLeft,x=Gt(p)%t.length;x!==g.current&&cr(x)},po=()=>{He.current=null},on=p=>{const x=Ze.current;x&&(x.style.scrollSnapType=p?"":"none")},fn=()=>{var p;(p=Ht.current)==null||p.call(Ht),Ht.current=null},Rn=()=>{st.current!==null&&(cancelAnimationFrame(st.current),st.current=null),gt.current=!1},Dn=()=>{const p=Ze.current;if(!p){st.current=null,gt.current=!1;return}const x=Ue.current-p.scrollLeft;if(Math.abs(x)<.5){p.scrollLeft=Ue.current,jt(),nn(),st.current=null,gt.current=!1;return}p.scrollLeft+=x*xh,jt(),nn(),Fe(),st.current=requestAnimationFrame(Dn)},Vn=()=>{const p=ze.current;p&&(p.style.transition="",p.style.transform="",p.style.willChange="")},mo=(p,x,k,oe)=>{Vn(),p.scrollLeft=x,Ge.current=p.scrollLeft,jt(),k!==void 0?(g.current=k,pe(k)):nn(),on(!0),oe==null||oe()},go=(p,{behavior:x="smooth",activeIndex:k,onComplete:oe}={})=>{const xe=Ze.current,Ae=ze.current;if(!xe||!Ae)return;if(Rn(),fn(),on(!1),x==="auto"){mo(xe,p,k,oe);return}const Ke=Math.abs(p-xe.scrollLeft),at=ch(Ke,mh,gh,xe.clientWidth*.55);Ht.current=ph(xe,Ae,p,{duration:at,easing:hh,onComplete:()=>{Ht.current=null,mo(xe,p,k,oe)}})},dr=(p="smooth")=>{const x=Ze.current;if(!x||t.length===0)return;const k=Gt()%t.length,oe=gn(k,x.scrollLeft),xe=qe.current[oe];xe&&go(xe.offsetLeft,{behavior:p,activeIndex:k})},ur=(p,x="smooth",k,oe)=>{const xe=Ze.current;if(!xe||t.length===0)return;const Ae=(oe??xe.scrollLeft)-p,Ke=Gt(p),at=qe.current[Ke];if(hn(at)){on(!0),nn();return}const _t=qe.current[Ke+1],Mt=at?_t?_t.offsetLeft-at.offsetLeft:at.offsetWidth:0;if((Mt>0?Ae>Mt*Ro?1:Ae<-Mt*Ro?-1:0:0)!==0){const Bl=k??Ke%t.length,zl=ai(oe??xe.scrollLeft,p,Bl);dn(zl,x);return}const Ni=oe??xe.scrollLeft,yo=Gt(Ni),Sa=qe.current[yo];if(Sa&&Math.abs(Sa.offsetLeft-Ni)<1){on(!0),nn();return}dr("auto")},dn=(p,x="smooth")=>{const k=Ze.current;if(!k||t.length===0)return;const oe=gn(p,k.scrollLeft),xe=qe.current[oe];xe&&(x==="smooth"?He.current=p:He.current=null,g.current=p,pe(p),Fi(!0),go(xe.offsetLeft,{behavior:x,activeIndex:p,onComplete:x==="smooth"?po:void 0}))},li=()=>{kt.current&&(window.removeEventListener("pointerup",kt.current),window.removeEventListener("pointercancel",kt.current),kt.current=null)},ho=(p,x,k,oe,xe)=>{const Ae=k-p,Ke=oe-x,at=Math.abs(Ae),_t=Math.abs(Ke);if(at<wh||at<=_t)return!1;const Mt=Ae<0?1:-1,ci=ut?(xe+Mt+t.length)%t.length:Math.max(0,Math.min(t.length-1,xe+Mt));return ci===xe?!1:(dn(ci),!0)},qn=p=>{if(!ot.current.isActive)return;li();const x=Ze.current;if(!x)return;const{scrollLeft:k,startActiveIndex:oe,hasMoved:xe}=ot.current,Ae=x.scrollLeft;jt(!0),ot.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},ct(!1),p!==void 0&&x.hasPointerCapture(p)&&x.releasePointerCapture(p),xe?ur(k,"smooth",oe,Ae):(on(!0),nn()),Fe()},fo=(p,x)=>{const k=rt.current;rt.current=null,k&&(ho(k.startX,k.startY,p,x,k.startActiveIndex),Fe())},pr=p=>{if(!re)return;if(p.pointerType==="touch"){if(Rn(),on(!0),It(p.target))return;rt.current={startX:p.clientX,startY:p.clientY,startActiveIndex:g.current};return}if(p.pointerType!=="mouse"||p.button!==0||It(p.target))return;const x=Ze.current;if(!x)return;Rn(),fn(),Vn(),He.current=null,ot.current={isActive:!0,startX:p.clientX,scrollLeft:x.scrollLeft,startActiveIndex:g.current,hasMoved:!1},on(!1),Fe(),x.setPointerCapture(p.pointerId),li();const k=oe=>{oe.pointerType==="mouse"&&qn(oe.pointerId)};kt.current=k,window.addEventListener("pointerup",k),window.addEventListener("pointercancel",k)},mr=p=>{if(!re||p.pointerType!=="mouse")return;const x=Ze.current;if(!x||!ot.current.isActive)return;if(p.buttons===0){qn(p.pointerId);return}const k=p.clientX-ot.current.startX;Math.abs(k)>bh&&(ot.current.hasMoved=!0,ct(!0)),ot.current.hasMoved&&(p.preventDefault(),x.scrollLeft=ot.current.scrollLeft-k,jt(!0),nn(),Fe())},V=p=>{if(re){if(p.pointerType==="touch"){p.type==="pointerup"?fo(p.clientX,p.clientY):rt.current=null;return}p.pointerType==="mouse"&&qn(p.pointerId)}},Se=p=>{!re||p.pointerType!=="mouse"||qn(p.pointerId)};return Nl(),a.useEffect(()=>{const p=requestAnimationFrame(()=>At(!0));return()=>{cancelAnimationFrame(p),fn(),li(),ie.current!==null&&(cancelAnimationFrame(ie.current),ie.current=null),Pe.current&&clearTimeout(Pe.current),De.current&&clearTimeout(De.current)}},[]),a.useEffect(()=>{if(!ce){we(!0);return}Fe();const p=Ct.current;if(!p)return;const x=()=>Fe();return p.addEventListener("pointermove",x),p.addEventListener("pointerdown",x),()=>{p.removeEventListener("pointermove",x),p.removeEventListener("pointerdown",x),De.current&&clearTimeout(De.current)}},[ce,Fe]),a.useEffect(()=>{const p=x=>{x.key==="Escape"&&mt()};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[mt]),a.useLayoutEffect(()=>{Dt()},[S,t.length,ut]),a.useLayoutEffect(()=>{o||dn(g.current,"auto")},[S,o]),a.useLayoutEffect(()=>{dn(0,"auto")},[t.length,ut]),a.useEffect(()=>{const p=Ze.current;if(!p||o||!le)return;const x=k=>{if(k.preventDefault(),Math.abs(k.deltaY)<=Math.abs(k.deltaX))return;const oe=k.deltaMode===1?vh:k.deltaMode===2?p.clientHeight:1,xe=k.deltaY*oe*yh;if(xe!==0){if(fn(),gt.current||(gt.current=!0,Ue.current=p.scrollLeft,He.current=null,on(!1)),Ue.current+=xe,!ut){const Ae=p.scrollWidth-p.clientWidth;Ue.current=Math.max(0,Math.min(Ae,Ue.current))}Fe(),st.current===null&&(st.current=requestAnimationFrame(Dn))}};return p.addEventListener("wheel",x,{passive:!1}),()=>{p.removeEventListener("wheel",x),Rn()}},[o,le,ut]),a.useEffect(()=>{const p=Ze.current;if(!p)return;const x=()=>{jt(ot.current.isActive);const oe=p.scrollLeft,xe=oe-Ge.current;Ge.current=oe;const Ae=yt.current>0?yt.current*.5:1/0;if(xe!==0&&Math.abs(xe)<Ae){const Ke=xe>0?"forward":"backward";Ke!==$t.current&&($t.current=Ke,En(Ke))}ot.current.isActive&&ot.current.hasMoved||nn()};p.addEventListener("scroll",x,{passive:!0});const k=new ResizeObserver(()=>{Dt(),jt(ot.current.isActive),En($t.current),nn()});return k.observe(p),()=>{fn(),p.removeEventListener("scroll",x),k.disconnect()}},[t.length,ut]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{tt||mt()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:Ot?1:0,transition:`opacity ${Di}ms ease`,pointerEvents:Ot?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Lt}}),r.jsxs("div",{ref:Ct,className:`${e}-lightbox-dismiss-area`,style:St,...cn,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:Et,onClick:p=>p.stopPropagation(),children:r.jsx("div",{ref:Ze,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":re&&t.length>0?"true":"false","data-mouse-dragging":ln?"true":"false",onPointerDown:pr,onPointerMove:mr,onPointerUp:V,onPointerCancel:V,onLostPointerCapture:Se,children:r.jsx("div",{ref:ze,className:`${e}-lightbox-strip-track`,style:{gap:S},children:tn.map((p,x)=>{const k=p.image.objectFit??"contain",oe=x%t.length,xe=Math.floor(x/t.length),Ae=Mo(S),Ke=`calc(-0.5 * (${Ae} + ${S}))`;return r.jsxs("div",{ref:at=>qe.current[x]=at,className:`${e}-strip-item`,style:{height:_==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"75%"},children:[r.jsx("img",{src:p.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:k}}),o&&oe<t.length-1&&xe===0&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Ke,width:Ae,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${xe}-${p.image.url}-${oe}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":pt?"true":"false",style:Rt,children:[r.jsx("div",{style:{position:"relative",width:"100%",height:K,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:Z,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${be?` ${e}-lightbox-content-area-stacked`:""}`,children:(_e||L)&&r.jsx("div",{className:`${e}-header ${be?`${e}-header-two-row`:`${e}-header-single-row`}`,children:be?ht():_e||L?Wt():null})})})]}),t.length>1&&I==="on"&&(()=>{const p=Mo(P),x=`calc(-0.5 * (${P} + ${p}))`;return r.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:P},children:r.jsx("div",{ref:Je,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:k=>k.stopPropagation(),children:r.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":A,style:{gap:z,"--thumbnail-active-color":H},children:[t.map((k,oe)=>{const xe=Mo(z),Ae=`calc(-0.5 * (${xe} + ${z}))`;return r.jsxs("div",{ref:Ke=>{it.current[oe]=Ke},style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":N===oe?"true":"false",onClick:()=>le&&w==="click"&&dn(oe),onMouseEnter:()=>Ie&&w==="hover"&&dn(oe),"aria-label":k.image.name?`View ${k.image.name}`:`View image ${oe+1}`,"aria-current":N===oe?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${ke?` ${e}-thumb-image-cover`:""}`,src:k.image.url,alt:"",draggable:!1,style:{...Le,maxWidth:D,maxHeight:D,width:R.display==="cover"?"auto":"100%",height:"auto",objectFit:R.display==="cover"?"cover":"contain"}})}),o&&oe<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Ae,width:xe,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${k.image.url}-${oe}`)}),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:x,height:p,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function Ah(e){return`
|
|
12593
|
+
`;function Pn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const $s={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},oh=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],rh={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:Pn("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:{...$s.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:{...$s.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:Pn("Question Padding Left"),questionPaddingTop:Pn("Question Padding Top"),questionPaddingBottom:Pn("Question Padding Bottom"),answerPaddingLeft:Pn("Answer Padding Left"),answerPaddingRight:Pn("Answer Padding Right"),answerPaddingTop:Pn("Answer Padding Top"),answerPaddingBottom:Pn("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"https://cdn.cntrl.site/component-assets/PlusIcon.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:[...oh],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},ah={element:nh,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:rh,sourceCode:ih},Cn=e=>e.display==="cover",lr=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Cs=100,sh=.2,Ts=8,_l=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,l]=a.useState(0),[s,d]=a.useState(!1),c=a.useRef(null),u=a.useRef(0);u.current=o;const m=a.useMemo(()=>typeof window>"u"?Cs:Math.max(Cs,window.innerHeight*sh),[]),y=a.useCallback(f=>Math.max(0,1-f/(m*1.5)),[m]),L=a.useCallback(f=>Math.max(0,1-f/(m*.45)),[m]),T=a.useCallback(f=>{const W=typeof window<"u"?window.innerHeight:800,F=Math.max(.88,1-f/W*.12);return`translateY(${f}px) scale(${F})`},[]),h=a.useCallback(()=>{c.current=null},[]),v=a.useCallback(()=>{d(!0),l(0),window.setTimeout(()=>d(!1),n),h()},[n,h]),w=a.useCallback(()=>{const f=typeof window<"u"?window.innerHeight:800;d(!0),l(f),window.setTimeout(()=>{t(),h(),d(!1)},Math.min(n,200))},[n,t,h]),I=a.useCallback(f=>{!e||s||f.pointerType==="touch"&&(i!=null&&i(f.target)||(c.current={startX:f.clientX,startY:f.clientY,isLocked:null,pointerId:f.pointerId}))},[e,s,i]),R=a.useCallback(f=>{const W=c.current;if(!e||!W||f.pointerType!=="touch"||W.pointerId!==f.pointerId)return;const F=f.clientX-W.startX,B=f.clientY-W.startY;if(W.isLocked===null){if(Math.abs(F)<Ts&&Math.abs(B)<Ts)return;if(B>0&&B>Math.abs(F))W.isLocked=!0,f.currentTarget.setPointerCapture(f.pointerId);else{W.isLocked=!1,h();return}}if(!W.isLocked)return;f.preventDefault();const ee=Math.max(0,B);u.current=ee,l(ee)},[e,h]),A=a.useCallback(f=>{const W=c.current;if(!e||!W||f.pointerType!=="touch"||W.pointerId!==f.pointerId)return;const F=W.isLocked===!0;if(f.currentTarget.hasPointerCapture(f.pointerId)&&f.currentTarget.releasePointerCapture(f.pointerId),!F){h();return}f.clientY-W.startY>=m?w():v()},[m,w,e,h,v]),H=a.useCallback(f=>{A(f)},[A]),b=a.useCallback(f=>{A(f)},[A]),O=o>0,M=s?`transform ${n}ms ease`:"none",C=s?`opacity ${n}ms ease`:"none",q=o>0||s;return{isSwipeDragging:O,backdropStyle:{opacity:y(o),transition:C},mediaAreaStyle:{transform:T(o),transition:M,touchAction:O?"none":void 0,willChange:O?"transform":void 0},overlayContentStyle:q?{opacity:L(o),transition:C}:void 0,swipeHandlers:e?{onPointerDown:I,onPointerMove:R,onPointerUp:H,onPointerCancel:b}:{},dismissAreaStyle:e?{touchAction:O?"none":"pan-x"}:void 0}},lh="[data-lightbox-scrollable]",Nl=()=>{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,l=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 s=d=>{const c=d.target;c instanceof Element&&c.closest(lh)||d.preventDefault()};return document.addEventListener("touchmove",s,{passive:!1}),()=>{document.removeEventListener("touchmove",s),document.body.style.overflow=t,document.body.style.position=n,document.body.style.top=i,document.body.style.width=o,document.documentElement.style.overflow=l,window.scrollTo(0,e)}},[])},ch=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},dh=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},uh=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},ph=(e,t,n,{duration:i,easing:o,onComplete:l})=>{const s=e.scrollLeft,d=n-s,c=s-n,u=(h,v)=>{dh(t),e.scrollLeft=h,v&&(l==null||l())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let m=!1,y=0;const L=()=>{t.removeEventListener("transitionend",T),clearTimeout(y)},T=h=>{h.target!==t||h.propertyName!=="transform"||m||(m=!0,L(),u(n,!0))};return t.addEventListener("transitionend",T),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)`,y=window.setTimeout(()=>{m||(m=!0,L(),u(n,!0))},i+64),()=>{m||(m=!0,L(),u(s-uh(t),!1))}},Di=300,mh=900,gh=1500,hh="cubic-bezier(0.16, 1, 0.3, 1)",fh=3e3,yh=2,vh=16,xh=.05,bh=1,Ro=.3,wh=50,Sh=20,ui=.004,Ri=["title1","title2","title3"],$h={title1:"1",title2:"2",title3:"3"},Ch={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Th={title1:.02,title2:.02,title3:.02},Mo=e=>`max(${e}, ${Sh}px)`,Lh=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]}},Ih=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=Lh(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},xt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Eh=e=>[xt(e,"fontFamily"),xt(e,"fontSettings"),{type:"row",items:[xt(e,"fontSize"),xt(e,"lineHeight"),xt(e,"letterSpacing"),xt(e,"wordSpacing")]},xt(e,"textAlign"),xt(e,"textAppearance")],Rh=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Ri.map(e=>[$h[e],Eh(e)]))}),wa=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((l,s)=>l+s,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:l,widths:s},d)=>{if(l<=0||d<=0)return{overflow:l,widths:[d,...s]};const c=Math.min(l,d);return{overflow:l-c,widths:[d-c,...s]}},{overflow:i-1,widths:[]});return o},Hl=(e,t)=>wa(e,t),Po=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Ls=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:wa(e.length,n),effective:Hl(e.length,n)}},Mh=(e,t,n,i,o,l,s)=>{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:l,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:s,text:i}),d},Rr=(e,t)=>{const n=i=>{const o=xt(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]]}},Ph=(e,t,n,i)=>e.slice(0,i).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0),Mr=(e,t,n)=>{var o,l;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((l=t.fontSettings)==null?void 0:l.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 _t(i,n)},kh=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,onClose:s})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:m,imageGap:y,closeIcon:L,closeIconMaxWidth:T,closeIconColor:h,closeIconHoverColor:v,thumbnailTrigger:w,thumbnailVisibility:I,thumbnailObjectFit:R,thumbnailActive:A,thumbnailActiveColor:H,title1Width:b,title2Width:O,title3Width:M,title1MarginLeft:C=0,title2MarginLeft:q=0,title3MarginLeft:f=0,titleRowMarginBottom:W=0,titleHeaderLayout:F="desktop",contentMarginTop:B,iconMarginLeft:ee}=n,ne=p=>_.scalingValue(p,i??!1),G=c??n.thumnailSize??.03,D=ne(G),z=ne(u),P=ne(m??.02),S=ne(y??0),K=ne(B??0),Z=Mo(K),U=ne(ee??0),[N,pe]=a.useState(0),g=a.useRef(N);g.current=N;const ue=t[N],{title1:ve,title2:ge,title3:Ee}=Ih(ue),te=Mr("title1",Rr(n,"title1"),i),me=Mr("title2",Rr(n,"title2"),i),J=Mr("title3",Rr(n,"title3"),i),be=F==="mobile",le=!o&&(!i||l),ce=le,re=le,Ie=le,ke=Cn(R),Le=ke?{"--image-aspect-ratio":lr(R)}:void 0,Fe=!!(ve||ge||Ee),$=a.useMemo(()=>Mh(e,ve,ge,Ee,te,me,J),[e,N,ve,ge,Ee,te,me,J]),ae=a.useMemo(()=>({title1Width:b,title2Width:O,title3Width:M}),[b,O,M]),E=a.useMemo(()=>$.map(p=>ae[p.widthKey]),[$,ae]),X=a.useMemo(()=>wa($.length,E),[$.length,E]),Y=a.useMemo(()=>Hl($.length,E),[$.length,E]),se=a.useMemo(()=>$.filter(p=>p.prefix==="title1"),[$]),de=a.useMemo(()=>$.filter(p=>p.prefix==="title2"||p.prefix==="title3"),[$]),fe=a.useMemo(()=>Ls(se,ae),[se,ae]),Ne=a.useMemo(()=>Ls(de,ae),[de,ae]),We=a.useCallback((p,x)=>{const k=$.indexOf(p);if(!be||x==="single-row")return{effectiveWidth:Y[k]??0,resolvedWidth:X[k]??0,maxWidth:Po(k,X)};if(x==="two-row-top"){const xe=se.indexOf(p);return{effectiveWidth:fe.effective[xe]??0,resolvedWidth:fe.resolved[xe]??0,maxWidth:Po(xe,fe.resolved)}}const oe=de.indexOf(p);return{effectiveWidth:Ne.effective[oe]??0,resolvedWidth:Ne.resolved[oe]??0,maxWidth:Po(oe,Ne.resolved)}},[de,Ne,Y,X,$,se,fe,be]),j=a.useCallback(p=>_.scalingValue(p,i??!1),[i]),Ce=j(W??0),Q=a.useMemo(()=>({title1MarginLeft:C,title2MarginLeft:q,title3MarginLeft:f}),[C,q,f]),he=a.useCallback(p=>$.slice(0,p+1).reduce((x,k,oe)=>x+(k!=null&&k.marginLeftKey?Q[k.marginLeftKey]??0:0)+(X[oe]??0),0)+(be?0:C??0),[$,Q,X,be,C]),$e=a.useCallback(()=>be?0:C??0,[be,C]),Oe=a.useCallback(p=>de.slice(0,p).reduce((x,k,oe)=>x+(k.marginLeftKey?Q[k.marginLeftKey]??0:0)+(Ne.resolved[oe]??0),0),[de,Ne.resolved,Q]),Ye=a.useCallback(p=>{const x=de[p];return Oe(p)+(x.marginLeftKey?Q[x.marginLeftKey]??0:0)+(Ne.resolved[p]??0)},[de,Ne.resolved,Oe,Q]),Be=(p,x)=>{const k=p.marginLeftKey?Q[p.marginLeftKey]??0:0,{effectiveWidth:oe,resolvedWidth:xe,maxWidth:Ae}=We(p,x),Ke=o&&x==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":p.prefix,style:{...x==="single-row"?{gridArea:p.prefix}:{},width:j(oe),...k>0?{marginLeft:j(k)}:{}},children:[r.jsx("p",{className:p.className,style:p.style,children:p.text}),Ke&&p.marginLeftKey&&r.jsx("div",{"data-controls":p.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(xe),style:{position:"absolute",top:0,left:j(-k),width:`max(${j(k)}, 10px)`,height:"100%",pointerEvents:"auto"}}),Ke&&r.jsx("div",{"data-controls":p.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,right:j(-ui/2),width:j(ui),height:"100%",pointerEvents:"auto"}})]},p.className)},Ve=()=>{const p=be?-1:$.findIndex(oe=>oe.prefix==="title1"),x=!be&&(o||(C??0)>0)?(()=>{const oe=C??0,xe=p>=0?X[p]:b??0;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(xe),style:{position:"absolute",top:0,left:0,width:`max(${j(oe)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,k=$.flatMap((oe,xe)=>{if(!oe.marginLeftKey)return[];const Ae=Q[oe.marginLeftKey]??0,Ke=Ph($,X,Q,xe)+$e();return r.jsx("div",{"data-controls":oe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(X[xe]),style:{position:"absolute",top:0,left:j(Ke),width:`max(${j(Ae)}, 10px)`,height:"100%",pointerEvents:"auto"}},oe.marginLeftKey)});return x?[x,...k]:k},dt=()=>$.map((p,x)=>{const k=Po(x,X),xe=he(x)-ui/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":p.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(k),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:j(xe),width:j(ui),height:"100%",pointerEvents:"auto"}})},`${p.widthKey}-junction`)}),ft=()=>de.flatMap((p,x)=>{if(!p.marginLeftKey)return[];const k=Q[p.marginLeftKey]??0,oe=Oe(x),{resolvedWidth:xe}=We(p,"two-row-bottom");return r.jsx("div",{"data-controls":p.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(xe),style:{position:"absolute",top:0,left:j(oe),width:`max(${j(k)}, 10px)`,height:"100%",pointerEvents:"auto"}},p.marginLeftKey)}),wt=()=>de.map((p,x)=>{const{maxWidth:k}=We(p,"two-row-bottom"),xe=Ye(x)-ui/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":p.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(k),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:j(xe),width:j(ui),height:"100%",pointerEvents:"auto"}})},`${p.widthKey}-junction`)}),Ct=a.useRef(null),Ze=a.useRef(null),ze=a.useRef(null),Je=a.useRef(null),it=a.useRef([]),qe=a.useRef([]),yt=a.useRef(0),rt=a.useRef(null),ot=a.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),kt=a.useRef(null),Ht=a.useRef(null),Ge=a.useRef(0),$t=a.useRef("forward"),Ue=a.useRef(0),st=a.useRef(null),gt=a.useRef(!1),ut=t.length>1&&(!o||!!l),Bt=ut?3:1,tn=a.useMemo(()=>Array.from({length:Bt},()=>t).flat(),[t,Bt]),[ln,ct]=a.useState(!1),[Ot,At]=a.useState(!1),[ye,we]=a.useState(!0),He=a.useRef(null),ie=a.useRef(null),Te=a.useRef(!1),Me=a.useRef(!1),Pe=a.useRef(null),De=a.useRef(null),pt=ce&&!ye,_e=a.useCallback(()=>{ce&&(we(!0),De.current&&clearTimeout(De.current),De.current=setTimeout(()=>{ot.current.isActive||we(!1)},fh))},[ce]),mt=a.useCallback(()=>{o||Me.current||(Me.current=!0,At(!1),Pe.current=setTimeout(()=>{s()},Di))},[o,s]),et=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":pt?"true":"false",style:{width:_.scalingValue(T??0,i),height:_.scalingValue(T??0,i),marginRight:U,"--close-icon-hover-color":v},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:mt,"aria-label":"Close",children:r.jsx(Zt,{url:L,fill:h,hoverFill:i&&!l?h:v,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:U,height:"100%",pointerEvents:"auto"}})]}),vt=(p="two-row")=>r.jsx("div",{...p==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:j(C??0),flexShrink:0,...p==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...p==="two-row"&&o?{pointerEvents:"auto"}:{}}}),ht=()=>{const p=$.find(oe=>oe.prefix==="title1"),x=$.filter(oe=>oe.prefix==="title2"||oe.prefix==="title3"),k=x.length>0||o||(W??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(C??0)>0||o?vt():null,p&&Be(p,"two-row-top"),L&&et()]}),k?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[x.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[x.map(oe=>Be(oe,"two-row-bottom")),o&&r.jsxs(r.Fragment,{children:[ft(),wt()]})]}):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:Ce,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},Wt=()=>r.jsxs(r.Fragment,{children:[(C??0)>0||o?vt("single-row"):null,$.map(p=>Be(p,"single-row")),o?r.jsxs(r.Fragment,{children:[Ve(),dt()]}):null,L?et():null]}),It=a.useCallback(p=>!!(p.closest("[data-controls]")||p.closest(`.${e}-thumbnails`)||p.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:tt,backdropStyle:Lt,mediaAreaStyle:Et,overlayContentStyle:Rt,swipeHandlers:cn,dismissAreaStyle:St}=_l({enabled:le??!1,onClose:mt,animMs:Di,isBlockedTarget:It}),Dt=()=>{if(!ut||t.length===0)return yt.current=0,0;const p=qe.current[0],x=qe.current[t.length];if(!p||!x)return yt.current;const k=x.offsetLeft-p.offsetLeft;return k>0&&(yt.current=k),yt.current},jt=(p=!1)=>{if(!ut)return;const x=Ze.current,k=Dt();!x||k<=0||k<x.clientWidth*.25||(x.scrollLeft<=0?(x.scrollLeft+=k,p&&(ot.current.scrollLeft+=k),gt.current&&(Ue.current+=k)):x.scrollLeft>=k*2&&(x.scrollLeft-=k,p&&(ot.current.scrollLeft-=k),gt.current&&(Ue.current-=k)))},gn=(p,x=(k=>(k=Ze.current)==null?void 0:k.scrollLeft)()??0)=>{if(!ut)return p;let oe=t.length+p,xe=1/0;for(let Ae=0;Ae<Bt;Ae++){const Ke=Ae*t.length+p,at=qe.current[Ke];if(!at)continue;const Ft=Math.abs(at.offsetLeft-x);Ft<xe&&(xe=Ft,oe=Ke)}return oe},In=p=>{const x=Ze.current;return!p||!x?!1:p.offsetWidth>x.clientWidth+1},hn=p=>{const x=Ze.current;if(!p||!x||!In(p))return!1;const k=p.offsetLeft,oe=k+p.offsetWidth;return x.scrollLeft>=k-1&&x.scrollLeft+x.clientWidth<=oe+1},Gt=(p=(x=>(x=Ze.current)==null?void 0:x.scrollLeft)()??0)=>{for(let oe=0;oe<qe.current.length;oe+=1){const xe=qe.current[oe];if(xe&&hn(xe))return oe}let k={flatIndex:0,distance:1/0};return qe.current.forEach((oe,xe)=>{if(!oe)return;const Ae=Math.abs(oe.offsetLeft-p);Ae<k.distance&&(k={flatIndex:xe,distance:Ae})}),k.flatIndex},En=p=>{Ze.current&&qe.current.forEach(x=>{x&&(x.style.scrollSnapAlign=In(x)&&p==="backward"?"end":"start")})},ai=(p,x,k)=>{const oe=p-x,xe=Gt(x),Ae=qe.current[xe];if(hn(Ae))return Gt(p)%t.length;const Ke=qe.current[xe+1],at=Ae?Ke?Ke.offsetLeft-Ae.offsetLeft:Ae.offsetWidth:0,Ft=at>0?oe>at*Ro?1:oe<-at*Ro?-1:0:0;return Ft===0?k:ut?(k+Ft+t.length)%t.length:Math.max(0,Math.min(t.length-1,k+Ft))},si=a.useCallback((p=!1)=>{if(I!=="on"||o)return;const x=Je.current,k=g.current,oe=it.current[k];if(!x||!oe||x.scrollWidth<=x.clientWidth)return;const xe=x.scrollLeft,Ae=xe+x.clientWidth,Ke=oe.offsetLeft,at=Ke+oe.offsetWidth;if(Ke>=xe&&at<=Ae)return;const Ft=x.scrollWidth-x.clientWidth;let Mt=xe;if(!p&&He.current===null){const ci=it.current[k-1],Ni=it.current[k+1],yo=ci?oe.offsetLeft-ci.offsetLeft:Ni?Ni.offsetLeft-oe.offsetLeft:oe.offsetWidth;at>Ae?Mt+=yo:Ke<xe&&(Mt-=yo)}else at>Ae?Mt=at-x.clientWidth:Mt=Ke;x.scrollLeft=Math.max(0,Math.min(Ft,Mt))},[o,I]),_i=a.useCallback((p=!1)=>{p&&(Te.current=!0),ie.current===null&&(ie.current=requestAnimationFrame(()=>{ie.current=null;const x=Te.current;Te.current=!1,si(x)}))},[si]),cr=a.useCallback(p=>{if(p===g.current)return;const x=g.current;g.current=p;const k=Math.abs(p-x)>1,oe=ut&&t.length>1&&(x===t.length-1&&p===0||x===0&&p===t.length-1);pe(p),_i(k||oe)},[t.length,ut,_i]),nn=()=>{if(!Ze.current||t.length===0||He.current!==null||ot.current.isActive&&ot.current.hasMoved)return;const p=Ze.current.scrollLeft,x=Gt(p)%t.length;x!==g.current&&cr(x)},po=()=>{He.current=null},on=p=>{const x=Ze.current;x&&(x.style.scrollSnapType=p?"":"none")},fn=()=>{var p;(p=Ht.current)==null||p.call(Ht),Ht.current=null},Rn=()=>{st.current!==null&&(cancelAnimationFrame(st.current),st.current=null),gt.current=!1},Dn=()=>{const p=Ze.current;if(!p){st.current=null,gt.current=!1;return}const x=Ue.current-p.scrollLeft;if(Math.abs(x)<.5){p.scrollLeft=Ue.current,jt(),nn(),st.current=null,gt.current=!1;return}p.scrollLeft+=x*xh,jt(),nn(),_e(),st.current=requestAnimationFrame(Dn)},Vn=()=>{const p=ze.current;p&&(p.style.transition="",p.style.transform="",p.style.willChange="")},mo=(p,x,k,oe)=>{Vn(),p.scrollLeft=x,Ge.current=p.scrollLeft,jt(),k!==void 0?(g.current=k,pe(k)):nn(),on(!0),oe==null||oe()},go=(p,{behavior:x="smooth",activeIndex:k,onComplete:oe}={})=>{const xe=Ze.current,Ae=ze.current;if(!xe||!Ae)return;if(Rn(),fn(),on(!1),x==="auto"){mo(xe,p,k,oe);return}const Ke=Math.abs(p-xe.scrollLeft),at=ch(Ke,mh,gh,xe.clientWidth*.55);Ht.current=ph(xe,Ae,p,{duration:at,easing:hh,onComplete:()=>{Ht.current=null,mo(xe,p,k,oe)}})},dr=(p="smooth")=>{const x=Ze.current;if(!x||t.length===0)return;const k=Gt()%t.length,oe=gn(k,x.scrollLeft),xe=qe.current[oe];xe&&go(xe.offsetLeft,{behavior:p,activeIndex:k})},ur=(p,x="smooth",k,oe)=>{const xe=Ze.current;if(!xe||t.length===0)return;const Ae=(oe??xe.scrollLeft)-p,Ke=Gt(p),at=qe.current[Ke];if(hn(at)){on(!0),nn();return}const Ft=qe.current[Ke+1],Mt=at?Ft?Ft.offsetLeft-at.offsetLeft:at.offsetWidth:0;if((Mt>0?Ae>Mt*Ro?1:Ae<-Mt*Ro?-1:0:0)!==0){const Bl=k??Ke%t.length,zl=ai(oe??xe.scrollLeft,p,Bl);dn(zl,x);return}const Ni=oe??xe.scrollLeft,yo=Gt(Ni),Sa=qe.current[yo];if(Sa&&Math.abs(Sa.offsetLeft-Ni)<1){on(!0),nn();return}dr("auto")},dn=(p,x="smooth")=>{const k=Ze.current;if(!k||t.length===0)return;const oe=gn(p,k.scrollLeft),xe=qe.current[oe];xe&&(x==="smooth"?He.current=p:He.current=null,g.current=p,pe(p),_i(!0),go(xe.offsetLeft,{behavior:x,activeIndex:p,onComplete:x==="smooth"?po:void 0}))},li=()=>{kt.current&&(window.removeEventListener("pointerup",kt.current),window.removeEventListener("pointercancel",kt.current),kt.current=null)},ho=(p,x,k,oe,xe)=>{const Ae=k-p,Ke=oe-x,at=Math.abs(Ae),Ft=Math.abs(Ke);if(at<wh||at<=Ft)return!1;const Mt=Ae<0?1:-1,ci=ut?(xe+Mt+t.length)%t.length:Math.max(0,Math.min(t.length-1,xe+Mt));return ci===xe?!1:(dn(ci),!0)},qn=p=>{if(!ot.current.isActive)return;li();const x=Ze.current;if(!x)return;const{scrollLeft:k,startActiveIndex:oe,hasMoved:xe}=ot.current,Ae=x.scrollLeft;jt(!0),ot.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},ct(!1),p!==void 0&&x.hasPointerCapture(p)&&x.releasePointerCapture(p),xe?ur(k,"smooth",oe,Ae):(on(!0),nn()),_e()},fo=(p,x)=>{const k=rt.current;rt.current=null,k&&(ho(k.startX,k.startY,p,x,k.startActiveIndex),_e())},pr=p=>{if(!re)return;if(p.pointerType==="touch"){if(Rn(),on(!0),It(p.target))return;rt.current={startX:p.clientX,startY:p.clientY,startActiveIndex:g.current};return}if(p.pointerType!=="mouse"||p.button!==0||It(p.target))return;const x=Ze.current;if(!x)return;Rn(),fn(),Vn(),He.current=null,ot.current={isActive:!0,startX:p.clientX,scrollLeft:x.scrollLeft,startActiveIndex:g.current,hasMoved:!1},on(!1),_e(),x.setPointerCapture(p.pointerId),li();const k=oe=>{oe.pointerType==="mouse"&&qn(oe.pointerId)};kt.current=k,window.addEventListener("pointerup",k),window.addEventListener("pointercancel",k)},mr=p=>{if(!re||p.pointerType!=="mouse")return;const x=Ze.current;if(!x||!ot.current.isActive)return;if(p.buttons===0){qn(p.pointerId);return}const k=p.clientX-ot.current.startX;Math.abs(k)>bh&&(ot.current.hasMoved=!0,ct(!0)),ot.current.hasMoved&&(p.preventDefault(),x.scrollLeft=ot.current.scrollLeft-k,jt(!0),nn(),_e())},V=p=>{if(re){if(p.pointerType==="touch"){p.type==="pointerup"?fo(p.clientX,p.clientY):rt.current=null;return}p.pointerType==="mouse"&&qn(p.pointerId)}},Se=p=>{!re||p.pointerType!=="mouse"||qn(p.pointerId)};return Nl(),a.useEffect(()=>{const p=requestAnimationFrame(()=>At(!0));return()=>{cancelAnimationFrame(p),fn(),li(),ie.current!==null&&(cancelAnimationFrame(ie.current),ie.current=null),Pe.current&&clearTimeout(Pe.current),De.current&&clearTimeout(De.current)}},[]),a.useEffect(()=>{if(!ce){we(!0);return}_e();const p=Ct.current;if(!p)return;const x=()=>_e();return p.addEventListener("pointermove",x),p.addEventListener("pointerdown",x),()=>{p.removeEventListener("pointermove",x),p.removeEventListener("pointerdown",x),De.current&&clearTimeout(De.current)}},[ce,_e]),a.useEffect(()=>{const p=x=>{x.key==="Escape"&&mt()};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[mt]),a.useLayoutEffect(()=>{Dt()},[S,t.length,ut]),a.useLayoutEffect(()=>{o||dn(g.current,"auto")},[S,o]),a.useLayoutEffect(()=>{dn(0,"auto")},[t.length,ut]),a.useEffect(()=>{const p=Ze.current;if(!p||o||!le)return;const x=k=>{if(k.preventDefault(),Math.abs(k.deltaY)<=Math.abs(k.deltaX))return;const oe=k.deltaMode===1?vh:k.deltaMode===2?p.clientHeight:1,xe=k.deltaY*oe*yh;if(xe!==0){if(fn(),gt.current||(gt.current=!0,Ue.current=p.scrollLeft,He.current=null,on(!1)),Ue.current+=xe,!ut){const Ae=p.scrollWidth-p.clientWidth;Ue.current=Math.max(0,Math.min(Ae,Ue.current))}_e(),st.current===null&&(st.current=requestAnimationFrame(Dn))}};return p.addEventListener("wheel",x,{passive:!1}),()=>{p.removeEventListener("wheel",x),Rn()}},[o,le,ut]),a.useEffect(()=>{const p=Ze.current;if(!p)return;const x=()=>{jt(ot.current.isActive);const oe=p.scrollLeft,xe=oe-Ge.current;Ge.current=oe;const Ae=yt.current>0?yt.current*.5:1/0;if(xe!==0&&Math.abs(xe)<Ae){const Ke=xe>0?"forward":"backward";Ke!==$t.current&&($t.current=Ke,En(Ke))}ot.current.isActive&&ot.current.hasMoved||nn()};p.addEventListener("scroll",x,{passive:!0});const k=new ResizeObserver(()=>{Dt(),jt(ot.current.isActive),En($t.current),nn()});return k.observe(p),()=>{fn(),p.removeEventListener("scroll",x),k.disconnect()}},[t.length,ut]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{tt||mt()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:Ot?1:0,transition:`opacity ${Di}ms ease`,pointerEvents:Ot?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Lt}}),r.jsxs("div",{ref:Ct,className:`${e}-lightbox-dismiss-area`,style:St,...cn,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:Et,onClick:p=>p.stopPropagation(),children:r.jsx("div",{ref:Ze,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":re&&t.length>0?"true":"false","data-mouse-dragging":ln?"true":"false",onPointerDown:pr,onPointerMove:mr,onPointerUp:V,onPointerCancel:V,onLostPointerCapture:Se,children:r.jsx("div",{ref:ze,className:`${e}-lightbox-strip-track`,style:{gap:S},children:tn.map((p,x)=>{const k=p.image.objectFit??"contain",oe=x%t.length,xe=Math.floor(x/t.length),Ae=Mo(S),Ke=`calc(-0.5 * (${Ae} + ${S}))`;return r.jsxs("div",{ref:at=>qe.current[x]=at,className:`${e}-strip-item`,style:{height:F==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"75%"},children:[r.jsx("img",{src:p.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:k}}),o&&oe<t.length-1&&xe===0&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Ke,width:Ae,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${xe}-${p.image.url}-${oe}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":pt?"true":"false",style:Rt,children:[r.jsx("div",{style:{position:"relative",width:"100%",height:K,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:Z,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${be?` ${e}-lightbox-content-area-stacked`:""}`,children:(Fe||L)&&r.jsx("div",{className:`${e}-header ${be?`${e}-header-two-row`:`${e}-header-single-row`}`,children:be?ht():Fe||L?Wt():null})})})]}),t.length>1&&I==="on"&&(()=>{const p=Mo(P),x=`calc(-0.5 * (${P} + ${p}))`;return r.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:P},children:r.jsx("div",{ref:Je,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:k=>k.stopPropagation(),children:r.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":A,style:{gap:z,"--thumbnail-active-color":H},children:[t.map((k,oe)=>{const xe=Mo(z),Ae=`calc(-0.5 * (${xe} + ${z}))`;return r.jsxs("div",{ref:Ke=>{it.current[oe]=Ke},style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":N===oe?"true":"false",onClick:()=>le&&w==="click"&&dn(oe),onMouseEnter:()=>Ie&&w==="hover"&&dn(oe),"aria-label":k.image.name?`View ${k.image.name}`:`View image ${oe+1}`,"aria-current":N===oe?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${ke?` ${e}-thumb-image-cover`:""}`,src:k.image.url,alt:"",draggable:!1,style:{...Le,maxWidth:D,maxHeight:D,width:R.display==="cover"?"auto":"100%",height:"auto",objectFit:R.display==="cover"?"cover":"contain"}})}),o&&oe<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Ae,width:xe,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${k.image.url}-${oe}`)}),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:x,height:p,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function Ah(e){return`
|
|
12594
12594
|
.${e}-wrapper {
|
|
12595
12595
|
position: relative;
|
|
12596
12596
|
width: 100%;
|
|
@@ -12982,7 +12982,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
12982
12982
|
pointer-events: auto;
|
|
12983
12983
|
z-index: 10;
|
|
12984
12984
|
}
|
|
12985
|
-
`}const Wh=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:l})=>{const{prefix:s}=
|
|
12985
|
+
`}const Wh=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:l})=>{const{prefix:s}=_.useScopedStyles(),{cover:d,coverFit:c}=e,u=a.useRef(null),[m,y]=a.useState(!1),L=t??[],T=m&&L.length>0,h=()=>{L.length!==0&&y(!0)};return a.useEffect(()=>{!n||i||o||y(!1)},[n,i,o]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:u,className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ah(s)}}),d&&r.jsx("div",{className:`${s}-cover ${Cn(c)?`${s}-ratio-wrapper-cover`:`${s}-ratio-wrapper-fit`}`,onClick:()=>h(),style:{...Cn(c)?{"--image-aspect-ratio":lr(c)}:{}},"aria-label":"Open image gallery",children:r.jsx("img",{className:`${s}-cover-image ${Cn(c)?`${s}-cover-image-cover`:`${s}-cover-image-fit`}`,src:d,alt:"cover"})})]}),T&&typeof document<"u"&&(()=>{const v=(l?document.getElementById(l):null)??document.body;return Mi.createPortal(r.jsx(kh,{prefix:s,images:L,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:()=>y(!1)}),v)})()]})},Fh=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
|
|
12986
12986
|
import { createPortal } from 'react-dom';
|
|
12987
12987
|
import { CommonComponentProps } from '../props';
|
|
12988
12988
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -13536,7 +13536,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
13536
13536
|
</>
|
|
13537
13537
|
);
|
|
13538
13538
|
};
|
|
13539
|
-
`,Fh="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 Nh(e){const t={};return t[xt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[xt(e,"fontSettings")]={...Jn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[xt(e,"fontSize")]={...Jn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[xt(e,"lineHeight")]={...Jn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[xt(e,"letterSpacing")]={...Jn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[xt(e,"wordSpacing")]={...Jn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[xt(e,"textAlign")]={...Jn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[xt(e,"textAppearance")]={...Jn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Hh=Ri.reduce((e,t)=>({...e,...Nh(t)}),{}),Oh=Ri.reduce((e,t)=>({...e,[xt(t,"fontFamily")]:"Goudy Bookletter 1911",[xt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[xt(t,"letterSpacing")]:0,[xt(t,"wordSpacing")]:0,[xt(t,"textAlign")]:"left",[xt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Is(e){return Ri.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[xt(n,"fontSize")]=i),o!==void 0&&(t[xt(n,"lineHeight")]=o),t},{})}const jh=Rh(),Bh={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:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",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"]}},thumbnailActiveColor:{type:"string",scope:"common",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:"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"}},...Hh,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/lightbox_strip_1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:Fh,closeIconColor:"#000000",closeIconHoverColor:"#cccccc",thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",thumbnailActiveColor:"#ffffff",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",...Oh},layoutDefaults:{m:{thumbnailSize:.1,thumbnailVisibility:"off",titleHeaderLayout:"mobile",thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,title1Width:.25,title2Width:.6,title3Width:.25,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.04,titleRowMarginBottom:.08,closeIconMaxWidth:.04,backgroundColor:"#FFFFFF",contentMarginTop:.08,iconMarginLeft:.02,...Is({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04})},d:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.02,backgroundColor:"#FFFFFF",contentMarginTop:.015,iconMarginLeft:.02,...Is({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:[jh]}],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/lightbox_strip_2.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_3.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_4.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_5.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_6.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_7.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"}]}},zh={element:Wh,id:"lightbox-strip",name:"Strip",category:"galleries",version:1,defaultSize:{d:{width:350,height:350},m:{width:300,height:350}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Strip.mp4"},schema:Bh,sourceCode:_h,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Ri.map(e=>({path:`${xt(e,"fontFamily")}`}))]},fontRelations:{...Ri.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${xt(t,"fontFamily")}`}),{})}},Dh=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,initialSlideIndex:s=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:m})=>{const{type:y,coverFit:L,backgroundColor:T,imageGap:h,maxWidth:v,maxHeight:w,textTransition:I,title1Width:R,title2Width:A,title3Width:H,title1MarginLeft:b=0,title2MarginLeft:O=0,title3MarginLeft:M=0,titleRowMarginBottom:C=0,titleHeaderLayout:q="single-row",countCloseGap:f=0,closeIcon:W,closeIconMaxWidth:_,closeIconColor:B,closeIconHoverColor:ee,contentMarginTop:ne=0,iconMarginRight:G=0}=n,D=a.useCallback(V=>F.scalingValue(V,i??!1),[i]),z=D(h??0),P=`${v}%`,S=`${w}%`,K=D(f),Z=D(ne),U=D(G),N=ei("title1",Qn(n,"title1"),i),pe=ei("title2",Qn(n,"title2"),i),g=ei("title3",Qn(n,"title3"),i),ue=ei("count",Qn(n,"count"),i),ve=q==="mobile",ge=!i||!!l,Ee=!o&&(!i||!!l),te=a.useMemo(()=>Fo(t,y),[t,y]),[me,J]=a.useState(s),be=te[me],le=be==null?void 0:be.entry,[ce,re]=a.useState(!1),[Ie,ke]=a.useState(null),[Le,_e]=a.useState(!1),[$,ae]=a.useState(null),[E,X]=a.useState(!1),[Y,se]=a.useState(0),[de,fe]=a.useState(),[Ne,We]=a.useState(),[j,Ce]=a.useState(null),Q=a.useRef(null),he=a.useRef(0),$e=a.useRef(0),Oe=a.useRef(0),Ye=a.useRef(!1),Be=a.useRef(null),Ve=a.useRef(null),dt=a.useRef(null),ft=a.useRef(null),wt=a.useRef(null),Ct=a.useRef(null),Ze=a.useRef(null),ze=a.useCallback(()=>{const V=Ve.current;if(!V)return;const Se=V.closest(`.${e}-lightbox-content-area`);if(!Se)return V.getBoundingClientRect().width;const p=Array.from(Se.children).reduce((x,k)=>!(k instanceof HTMLElement)||k.contains(V)?x:x+k.getBoundingClientRect().width,0);return Se.getBoundingClientRect().width-p},[e]),Je=a.useCallback(()=>{Q.current&&(clearTimeout(Q.current),Q.current=null)},[]),it=a.useCallback(V=>{V===he.current&&(ae(null),X(!1))},[]),qe=a.useCallback(()=>{o||Ye.current||(Ye.current=!0,u==null||u(),re(!1),Be.current=setTimeout(()=>{m()},300))},[o,u,m]),yt=a.useCallback(V=>!!(V.closest("[data-controls]")||V.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:rt,backdropStyle:ot,mediaAreaStyle:kt,overlayContentStyle:Ht,swipeHandlers:Ge,dismissAreaStyle:$t}=Fl({enabled:Ee,onClose:qe,animMs:300,isBlockedTarget:yt}),Ue=a.useCallback(V=>{d&&vl(V+1,c,!0)},[d,c]),st=a.useCallback(V=>{if(V)return V.getBoundingClientRect().height},[]),gt=a.useCallback(V=>{if(te.length===0)return;const Se=(V%te.length+te.length)%te.length;if(Se===me)return;const p=te[me],x=te[Se];he.current+=1;const k=he.current,oe=I==="fade"&&ts(p==null?void 0:p.entry)!==ts(x==null?void 0:x.entry),xe=st(dt.current),Ae=oe?(()=>{const at=ze();Mi.flushSync(()=>{Ce(x.entry)}),dt.current&&at&&(dt.current.style.width=`${at}px`);const _t=st(dt.current);return dt.current&&(dt.current.style.width=""),{measuredIncomingTitlesHeight:_t,incomingTitlesMeasureWidth:at}})():void 0,Ke=Math.max(xe??0,(Ae==null?void 0:Ae.measuredIncomingTitlesHeight)??0)||void 0;se(k),ae(me),X(!0),J(Se),Ue(Se),Oe.current=Se,oe?(Je(),Ke&&fe(Ke),Ae!=null&&Ae.incomingTitlesMeasureWidth&&We(Ae.incomingTitlesMeasureWidth),ke((p==null?void 0:p.entryIndex)??null),_e(!0),$e.current=x.entryIndex,Q.current=setTimeout(()=>{ke(null),_e(!1),fe(void 0),We(void 0),Ce(null),Q.current=null},400)):(Je(),ke(null),_e(!1),fe(void 0),We(void 0),Ce(null),$e.current=x.entryIndex)},[me,Je,ze,st,te,Ue,I]),ut=a.useCallback(()=>{Ze.current=null},[]),Bt=a.useCallback(V=>{!ge||te.length<=1||V.pointerType==="mouse"&&V.button!==0||V.target.closest("[data-controls]")||(Ze.current={startX:V.clientX,startY:V.clientY,pointerId:V.pointerId})},[ge,te.length]),tn=a.useCallback(V=>{var at;if(!ge||te.length<=1||V.pointerType==="mouse"&&V.button!==0)return;if(rt){ut();return}const Se=Ze.current;if(!Se||Se.pointerId!==V.pointerId||(ut(),V.target.closest("[data-controls]")))return;const x=V.clientX-Se.startX,k=V.clientY-Se.startY,oe=Math.abs(x),xe=Math.abs(k);if(oe>=cm&&oe>xe){gt(x>0?me-1:me+1);return}if(oe>Ja||xe>Ja)return;const Ae=(at=ft.current)==null?void 0:at.getBoundingClientRect(),Ke=Ae?Ae.left+Ae.width/2:window.innerWidth/2;gt(V.clientX<Ke?me-1:me+1)},[me,ge,gt,rt,ut,te.length]),ln=a.useCallback(V=>{const Se=Ze.current;(Se==null?void 0:Se.pointerId)===V.pointerId&&ut()},[ut]);Nl(),a.useEffect(()=>{Ct.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const V=requestAnimationFrame(()=>{re(!0),requestAnimationFrame(()=>{wt.current?wt.current.focus():ft.current&&ft.current.focus()})});return()=>{cancelAnimationFrame(V),Be.current&&clearTimeout(Be.current),Q.current&&clearTimeout(Q.current);const Se=Ct.current;Se&&document.contains(Se)&&Se.focus()}},[]),a.useEffect(()=>{var V;I!=="fade"&&($e.current=((V=te[me])==null?void 0:V.entryIndex)??0,Je(),ke(null),_e(!1),fe(void 0),We(void 0))},[me,Je,te,I]),a.useEffect(()=>{const V=Se=>{if(Se.key==="Escape"){qe();return}if(Se.key==="ArrowLeft"&&te.length>1){gt(me-1);return}if(Se.key==="ArrowRight"&&te.length>1){gt(me+1);return}if(Se.key==="Tab"&&ft.current){const p=ft.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),x=Array.from(p).filter(Ae=>!Ae.closest('[aria-hidden="true"]'));if(x.length===0)return;const k=x[0],oe=x[x.length-1],xe=document.activeElement;Se.shiftKey?(xe===k||!ft.current.contains(xe))&&(Se.preventDefault(),oe.focus()):(xe===oe||!ft.current.contains(xe))&&(Se.preventDefault(),k.focus())}};return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[gt,qe,me,te.length]),a.useLayoutEffect(()=>{Je(),he.current=0,se(0),ae(null),X(!1),ke(null),_e(!1),fe(void 0),We(void 0),Ce(null),J(V=>{const Se=Math.max(0,te.length-1);return Math.min(V,Se)})},[Je,t.length,y,te.length]),a.useLayoutEffect(()=>{var p;const V=Math.max(0,te.length-1),Se=Math.min(Math.max(0,s),V);Oe.current=Se,$e.current=((p=te[Se])==null?void 0:p.entryIndex)??0,J(Se)},[s]);const ct=Ie!==null?t[Ie]:null,Ot=$!==null?te[$]:null,At=(le==null?void 0:le.title1)||(le==null?void 0:le.title2)||(le==null?void 0:le.title3)||(ct==null?void 0:ct.title1)||(ct==null?void 0:ct.title2)||(ct==null?void 0:ct.title3),ye=ym(y,te,t),we=W!==null,He=At||ye||we,ie=ye&&we?{gap:K}:void 0,Te=`${e}-titles-stack${ve?` ${e}-titles-stack-stacked`:""}`,Me=`${e}-titles-layer-out${ve?` ${e}-titles-layer-out-stacked`:""}`,Pe=`${e}-titles-layer-out`,De=(b??0)>0||o,pt=D(C),Fe=a.useMemo(()=>({title1Width:R??vi.title1Width,title2Width:A??vi.title2Width,title3Width:H??vi.title3Width}),[R,A,H]),mt=a.useMemo(()=>({title2MarginLeft:O,title3MarginLeft:M}),[O,M]),et=a.useMemo(()=>le?_n(e,le,N,pe,g):[],[e,le,N,pe,g]),vt=a.useMemo(()=>et.map(V=>Fe[V.widthKey]),[et,Fe]),ht=a.useMemo(()=>Ci(et.length,vt),[et.length,vt]),Wt=a.useMemo(()=>Ji(et.length,vt),[et.length,vt]),It=a.useMemo(()=>et.filter(V=>V.prefix==="title1"),[et]),tt=a.useMemo(()=>et.filter(V=>V.prefix==="title2"||V.prefix==="title3"),[et]),Lt=a.useMemo(()=>Fn(It,Fe),[It,Fe]),Et=a.useMemo(()=>Fn(tt,Fe),[tt,Fe]),Rt=a.useCallback((V,Se)=>{const p=et.findIndex(k=>k.prefix===V.prefix);if(!ve||Se==="single-row")return{effectiveWidth:Wt[p]??0,resolvedWidth:ht[p]??0,maxWidth:Vt(p,ht)};if(Se==="two-row-top"){const k=It.findIndex(oe=>oe.prefix===V.prefix);return{effectiveWidth:Lt.effective[k]??0,resolvedWidth:Lt.resolved[k]??0,maxWidth:Vt(k,Lt.resolved)}}const x=tt.findIndex(k=>k.prefix===V.prefix);return{effectiveWidth:Et.effective[x]??0,resolvedWidth:Et.resolved[x]??0,maxWidth:Vt(x,Et.resolved)}},[et,tt,Et,Wt,ht,It,Lt,ve]),cn=a.useCallback(V=>Sl(et,ht,mt,V)+(ve?0:b??0),[et,ht,mt,ve,b]),St=a.useCallback(()=>ve?0:b??0,[ve,b]),Dt=a.useCallback(V=>tt.slice(0,V).reduce((Se,p,x)=>Se+(p.marginLeftKey?mt[p.marginLeftKey]??0:0)+(Et.resolved[x]??0),0),[tt,Et.resolved,mt]),jt=a.useCallback(V=>{const Se=tt[V];return Dt(V)+(Se.marginLeftKey?mt[Se.marginLeftKey]??0:0)+(Et.resolved[V]??0)},[tt,Et.resolved,Dt,mt]),gn=a.useCallback((V,Se,p)=>{if(!ve||p==="single-row"){const Ae=V.findIndex(Mt=>Mt.prefix===Se.prefix),Ke=V.map(Mt=>Fe[Mt.widthKey]),at=Ci(V.length,Ke);return{effectiveWidth:Ji(V.length,Ke)[Ae]??0,resolvedWidth:at[Ae]??0,maxWidth:Vt(Ae,at)}}if(p==="two-row-top"){const Ae=V.filter(Mt=>Mt.prefix==="title1"),Ke=Ae.findIndex(Mt=>Mt.prefix===Se.prefix),{resolved:at,effective:_t}=Fn(Ae,Fe);return{effectiveWidth:_t[Ke]??0,resolvedWidth:at[Ke]??0,maxWidth:Vt(Ke,at)}}const x=V.filter(Ae=>Ae.prefix==="title2"||Ae.prefix==="title3"),k=x.findIndex(Ae=>Ae.prefix===Se.prefix),{resolved:oe,effective:xe}=Fn(x,Fe);return{effectiveWidth:xe[k]??0,resolvedWidth:oe[k]??0,maxWidth:Vt(k,oe)}},[Fe,ve]),In=(V,Se,p)=>{const x=V.marginLeftKey?mt[V.marginLeftKey]??0:0,{effectiveWidth:k,resolvedWidth:oe,maxWidth:xe}=p??Rt(V,Se),Ae=Math.max(x,Wn),Ke=o&&Se==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":V.prefix,style:{width:D(k),...x>0?{marginLeft:D(x)}:{}},children:[r.jsx("p",{className:V.className,style:V.style,children:V.text}),Ke&&V.marginLeftKey?r.jsx("div",{"data-controls":V.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(oe),style:{position:"absolute",top:0,left:D(-x),width:D(Ae),height:"100%",pointerEvents:"auto"}}):null,Ke?r.jsx("div",{"data-controls":V.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(xe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:D(-Xt/2),width:D(Xt),height:"100%",pointerEvents:"auto"}}):null]},V.className)},hn=(V="two-row")=>{const Se=et.findIndex(k=>k.prefix==="title1"),p=Se>=0?ht[Se]:Fe.title1Width,x=V==="two-row"&&o;return r.jsx("div",{...x?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(p)}:{},style:{width:D(b??0),flexShrink:0,alignSelf:"stretch",...x?{pointerEvents:"auto"}:{}}})},Gt=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:N,"aria-hidden":"true",children:" "}),En=()=>r.jsx("span",{className:`${e}-entry-counter`,style:ue,"aria-live":"polite","aria-atomic":"true",children:fm(te,me,y,t)}),ai=()=>ye?o&&we?r.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[En(),r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Cr(K)} + ${K}))`,width:Cr(K),height:"100%",pointerEvents:"auto",zIndex:3}})]}):En():null,si=()=>!ye&&!we?null:r.jsxs("div",{className:`${e}-titles-row-header-controls`,style:ie,children:[ai(),we?nn():null]}),Fi=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[ye||At?Gt():null,De?hn("single-row"):null,on(le),r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),si(),dn()]}),cr=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[ye||At?Gt():null,De?hn("single-row"):null,r.jsxs("div",{className:`${e}-titles-row-titles`,style:Le&&de?{minHeight:de}:void 0,children:[r.jsx("div",{ref:dt,className:Te,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Vn(j||le)}),r.jsxs("div",{ref:Ve,className:Te,style:{position:Le?"absolute":"relative",inset:Le?0:void 0,width:"100%",...Le&&Ne?{width:Ne,maxWidth:"100%"}:void 0},children:[ct&&Le?r.jsx("div",{className:`${Me} ${e}-titles-fade-out`,children:Vn(ct)}):null,r.jsx("div",{className:`${e}-titles-layer-in${Le?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:Vn(le)})]})]}),si(),dn()]}),nn=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:F.scalingValue(_??0,i),height:F.scalingValue(_??0,i),marginRight:U,"--close-icon-hover-color":ee},children:[r.jsx("button",{ref:wt,type:"button",className:`${e}-close-icon-inner`,onClick:qe,"aria-label":"Close",children:r.jsx(Zt,{url:W??"",fill:B,hoverFill:i&&!l?B:ee,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:U,height:"100%",pointerEvents:"auto"}})]}),po=(V,Se)=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[ye||At?Gt():null,De?hn("two-row"):null,Se!==void 0?r.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Se},children:V}):r.jsxs(r.Fragment,{children:[V,r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),si()]}),on=V=>{if(!V)return null;const Se=_n(e,V,N,pe,g);return r.jsx(r.Fragment,{children:Se.map(p=>In(p,"single-row",gn(Se,p,"single-row")))})},fn=V=>{if(!V)return null;const Se=_n(e,V,N,pe,g),p=Se.find(x=>x.prefix==="title1");return p?In(p,"two-row-top",gn(Se,p,"two-row-top")):null},Rn=(V,Se=!1)=>{const p=V?_n(e,V,N,pe,g):[],x=p.filter(xe=>xe.prefix==="title2"||xe.prefix==="title3"),k=o&&Se;return x.length>0||k||(C??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[x.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[x.map(xe=>In(xe,"two-row-bottom",gn(p,xe,"two-row-bottom"))),Se&&o?r.jsxs(r.Fragment,{children:[dr(),ur()]}):null]}):null,(C??0)>0||k?r.jsx("div",{"data-controls":k?"titleRowMarginBottom":void 0,"data-controls-axis":k?"y":void 0,"data-controls-reverse":k?"":void 0,className:k?`${e}-control`:void 0,style:{height:pt,width:"100%",flexShrink:0,pointerEvents:k?"auto":"none"}}):null]}):null},Dn=(V,Se=!1)=>r.jsxs(r.Fragment,{children:[po(fn(V)),Rn(V,Se)]}),Vn=V=>ve?r.jsx("div",{className:`${e}-titles-row-two-row`,children:Dn(V)}):V?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:on(V)}):null,mo=()=>{const V=ve?-1:et.findIndex(x=>x.prefix==="title1"),Se=!ve&&(o||(b??0)>0)?(()=>{const x=b??0,k=V>=0?ht[V]:Fe.title1Width,oe=Math.max(x,Wn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(k),style:{position:"absolute",top:0,left:0,width:D(oe),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,p=et.flatMap((x,k)=>{if(!x.marginLeftKey)return[];const oe=mt[x.marginLeftKey]??0,xe=wl(et,ht,mt,k)+St(),Ae=Math.max(oe,Wn);return r.jsx("div",{"data-controls":x.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ht[k]),style:{position:"absolute",top:0,left:D(xe),width:D(Ae),height:"100%",pointerEvents:"auto"}},x.marginLeftKey)});return Se?[Se,...p]:p},go=()=>et.map((V,Se)=>{const p=Vt(Se,ht),k=cn(Se)-Xt/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":V.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(p),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D(k),width:D(Xt),height:"100%",pointerEvents:"auto"}})},`${V.widthKey}-junction`)}),dr=()=>tt.flatMap((V,Se)=>{if(!V.marginLeftKey)return[];const p=mt[V.marginLeftKey]??0,x=Dt(Se),k=Math.max(p,Wn),{resolvedWidth:oe}=Rt(V,"two-row-bottom");return r.jsx("div",{"data-controls":V.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(oe),style:{position:"absolute",top:0,left:D(x),width:D(k),height:"100%",pointerEvents:"auto"}},V.marginLeftKey)}),ur=()=>tt.map((V,Se)=>{const{maxWidth:p}=Rt(V,"two-row-bottom"),k=jt(Se)-Xt/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":V.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(p),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D(k),width:D(Xt),height:"100%",pointerEvents:"auto"}})},`${V.widthKey}-junction`)}),dn=()=>!o||ve?null:r.jsxs(r.Fragment,{children:[mo(),go()]}),li=V=>{const Se=!V.objectFit&&Cn(L);return{className:`${e}-slide-image-cell${Se?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:P,maxHeight:S,...Se?{"--image-aspect-ratio":lr(L)}:{}}}},ho=V=>V.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":V.objectFit}}:Cn(L)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},qn=V=>{if(V.length===0)return null;const Se=V.length>1,p=Cr(z),x=`calc(-0.5 * (${p} + ${z}))`;if(V.length===1){const k=V[0];return r.jsx("div",{...li(k),children:r.jsx("img",{...ho(k),src:k.url,alt:k.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:Se?{gap:z}:void 0,children:V.map((k,oe)=>r.jsxs("div",{...li(k),children:[r.jsx("img",{...ho(k),src:k.url,alt:k.name??"",draggable:!1}),o&&Se&&oe<V.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:x,width:p,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${k.url}-${oe}`))})},fo=!!(le!=null&&le.title2||le!=null&&le.title3||ct!=null&&ct.title2||ct!=null&&ct.title3||(C??0)>0||o),pr=()=>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:dt,className:Te,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Dn(j||le)}),r.jsxs("div",{ref:Ve,className:`${e}-titles-row-two-row`,style:{...Le&&de?{minHeight:de}:void 0,...Le&&Ne?{width:Ne,maxWidth:"100%"}:void 0},children:[po(r.jsxs("div",{className:Te,style:{position:Le?"absolute":"relative",inset:Le?0:void 0,width:"100%"},children:[ct&&Le?r.jsx("div",{className:`${Pe} ${e}-titles-fade-out`,children:fn(ct)}):null,r.jsx("div",{className:`${e}-titles-layer-in${Le?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:fn(le)})]}),Le&&de?de:void 0),fo?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[ct&&Le?r.jsx("div",{className:`${Me} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:Rn(ct)}):null,r.jsx("div",{className:`${e}-titles-layer-in${Le?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${ve?` ${e}-titles-layer-in-stacked`:""}`,children:Rn(le,!0)})]}):null]})]}),mr=()=>{const V=fo;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...V?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:V?void 0:{flex:"0 0 auto",height:"auto"},children:Dn(le,!0)}),dn()]})};return r.jsxs("div",{ref:ft,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{rt||qe()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:we?void 0:-1,style:{opacity:ce?1:0,transition:"opacity 300ms ease",pointerEvents:ce?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:T,...ot}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:$t,...Ge,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:kt,onClick:V=>V.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":ge&&te.length>1?"true":"false",onPointerDown:ge?Bt:void 0,onPointerUp:ge?tn:void 0,onPointerCancel:ge?ln:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[Ot&&E?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:V=>{V.target===V.currentTarget&&it(Y)},children:r.jsx("div",{className:`${e}-slide-area`,children:qn(Ot.images)})},`slide-out-${Y}`):null,r.jsx("div",{className:`${e}-slide-layer-in${E?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:be?qn(be.images):null})},`slide-in-${Y}-${me}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Ht,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:Z,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...ve?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${ve?` ${e}-lightbox-content-area-stacked`:""}`,children:He&&r.jsx("div",{className:`${e}-text-bar-cell${ve?` ${e}-text-bar-cell-stacked`:""}`,style:ve?void 0:{flex:1,minWidth:0,width:"100%"},children:ve?I==="fade"?pr():mr():I==="fade"?cr():Fi()})})})]})]})]})};function Vh(e){return`
|
|
13539
|
+
`,_h="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 Nh(e){const t={};return t[xt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[xt(e,"fontSettings")]={...Jn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[xt(e,"fontSize")]={...Jn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[xt(e,"lineHeight")]={...Jn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[xt(e,"letterSpacing")]={...Jn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[xt(e,"wordSpacing")]={...Jn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[xt(e,"textAlign")]={...Jn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[xt(e,"textAppearance")]={...Jn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Hh=Ri.reduce((e,t)=>({...e,...Nh(t)}),{}),Oh=Ri.reduce((e,t)=>({...e,[xt(t,"fontFamily")]:"Goudy Bookletter 1911",[xt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[xt(t,"letterSpacing")]:0,[xt(t,"wordSpacing")]:0,[xt(t,"textAlign")]:"left",[xt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Is(e){return Ri.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[xt(n,"fontSize")]=i),o!==void 0&&(t[xt(n,"lineHeight")]=o),t},{})}const jh=Rh(),Bh={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:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",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"]}},thumbnailActiveColor:{type:"string",scope:"common",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:"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"}},...Hh,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/lightbox_strip_1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:_h,closeIconColor:"#000000",closeIconHoverColor:"#cccccc",thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",thumbnailActiveColor:"#ffffff",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",...Oh},layoutDefaults:{m:{thumbnailSize:.1,thumbnailVisibility:"off",titleHeaderLayout:"mobile",thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,title1Width:.25,title2Width:.6,title3Width:.25,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.04,titleRowMarginBottom:.08,closeIconMaxWidth:.04,backgroundColor:"#FFFFFF",contentMarginTop:.08,iconMarginLeft:.02,...Is({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04})},d:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.02,backgroundColor:"#FFFFFF",contentMarginTop:.015,iconMarginLeft:.02,...Is({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:[jh]}],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/lightbox_strip_2.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_3.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_4.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_5.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_6.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_7.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"}]}},zh={element:Wh,id:"lightbox-strip",name:"Strip",category:"galleries",version:1,defaultSize:{d:{width:350,height:350},m:{width:300,height:350}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Strip.mp4"},schema:Bh,sourceCode:Fh,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Ri.map(e=>({path:`${xt(e,"fontFamily")}`}))]},fontRelations:{...Ri.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${xt(t,"fontFamily")}`}),{})}},Dh=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,initialSlideIndex:s=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:m})=>{const{type:y,coverFit:L,backgroundColor:T,imageGap:h,maxWidth:v,maxHeight:w,textTransition:I,title1Width:R,title2Width:A,title3Width:H,title1MarginLeft:b=0,title2MarginLeft:O=0,title3MarginLeft:M=0,titleRowMarginBottom:C=0,titleHeaderLayout:q="single-row",countCloseGap:f=0,closeIcon:W,closeIconMaxWidth:F,closeIconColor:B,closeIconHoverColor:ee,contentMarginTop:ne=0,iconMarginRight:G=0}=n,D=a.useCallback(V=>_.scalingValue(V,i??!1),[i]),z=D(h??0),P=`${v}%`,S=`${w}%`,K=D(f),Z=D(ne),U=D(G),N=ei("title1",Qn(n,"title1"),i),pe=ei("title2",Qn(n,"title2"),i),g=ei("title3",Qn(n,"title3"),i),ue=ei("count",Qn(n,"count"),i),ve=q==="mobile",ge=!i||!!l,Ee=!o&&(!i||!!l),te=a.useMemo(()=>_o(t,y),[t,y]),[me,J]=a.useState(s),be=te[me],le=be==null?void 0:be.entry,[ce,re]=a.useState(!1),[Ie,ke]=a.useState(null),[Le,Fe]=a.useState(!1),[$,ae]=a.useState(null),[E,X]=a.useState(!1),[Y,se]=a.useState(0),[de,fe]=a.useState(),[Ne,We]=a.useState(),[j,Ce]=a.useState(null),Q=a.useRef(null),he=a.useRef(0),$e=a.useRef(0),Oe=a.useRef(0),Ye=a.useRef(!1),Be=a.useRef(null),Ve=a.useRef(null),dt=a.useRef(null),ft=a.useRef(null),wt=a.useRef(null),Ct=a.useRef(null),Ze=a.useRef(null),ze=a.useCallback(()=>{const V=Ve.current;if(!V)return;const Se=V.closest(`.${e}-lightbox-content-area`);if(!Se)return V.getBoundingClientRect().width;const p=Array.from(Se.children).reduce((x,k)=>!(k instanceof HTMLElement)||k.contains(V)?x:x+k.getBoundingClientRect().width,0);return Se.getBoundingClientRect().width-p},[e]),Je=a.useCallback(()=>{Q.current&&(clearTimeout(Q.current),Q.current=null)},[]),it=a.useCallback(V=>{V===he.current&&(ae(null),X(!1))},[]),qe=a.useCallback(()=>{o||Ye.current||(Ye.current=!0,u==null||u(),re(!1),Be.current=setTimeout(()=>{m()},300))},[o,u,m]),yt=a.useCallback(V=>!!(V.closest("[data-controls]")||V.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:rt,backdropStyle:ot,mediaAreaStyle:kt,overlayContentStyle:Ht,swipeHandlers:Ge,dismissAreaStyle:$t}=_l({enabled:Ee,onClose:qe,animMs:300,isBlockedTarget:yt}),Ue=a.useCallback(V=>{d&&vl(V+1,c,!0)},[d,c]),st=a.useCallback(V=>{if(V)return V.getBoundingClientRect().height},[]),gt=a.useCallback(V=>{if(te.length===0)return;const Se=(V%te.length+te.length)%te.length;if(Se===me)return;const p=te[me],x=te[Se];he.current+=1;const k=he.current,oe=I==="fade"&&ts(p==null?void 0:p.entry)!==ts(x==null?void 0:x.entry),xe=st(dt.current),Ae=oe?(()=>{const at=ze();Mi.flushSync(()=>{Ce(x.entry)}),dt.current&&at&&(dt.current.style.width=`${at}px`);const Ft=st(dt.current);return dt.current&&(dt.current.style.width=""),{measuredIncomingTitlesHeight:Ft,incomingTitlesMeasureWidth:at}})():void 0,Ke=Math.max(xe??0,(Ae==null?void 0:Ae.measuredIncomingTitlesHeight)??0)||void 0;se(k),ae(me),X(!0),J(Se),Ue(Se),Oe.current=Se,oe?(Je(),Ke&&fe(Ke),Ae!=null&&Ae.incomingTitlesMeasureWidth&&We(Ae.incomingTitlesMeasureWidth),ke((p==null?void 0:p.entryIndex)??null),Fe(!0),$e.current=x.entryIndex,Q.current=setTimeout(()=>{ke(null),Fe(!1),fe(void 0),We(void 0),Ce(null),Q.current=null},400)):(Je(),ke(null),Fe(!1),fe(void 0),We(void 0),Ce(null),$e.current=x.entryIndex)},[me,Je,ze,st,te,Ue,I]),ut=a.useCallback(()=>{Ze.current=null},[]),Bt=a.useCallback(V=>{!ge||te.length<=1||V.pointerType==="mouse"&&V.button!==0||V.target.closest("[data-controls]")||(Ze.current={startX:V.clientX,startY:V.clientY,pointerId:V.pointerId})},[ge,te.length]),tn=a.useCallback(V=>{var at;if(!ge||te.length<=1||V.pointerType==="mouse"&&V.button!==0)return;if(rt){ut();return}const Se=Ze.current;if(!Se||Se.pointerId!==V.pointerId||(ut(),V.target.closest("[data-controls]")))return;const x=V.clientX-Se.startX,k=V.clientY-Se.startY,oe=Math.abs(x),xe=Math.abs(k);if(oe>=cm&&oe>xe){gt(x>0?me-1:me+1);return}if(oe>Ja||xe>Ja)return;const Ae=(at=ft.current)==null?void 0:at.getBoundingClientRect(),Ke=Ae?Ae.left+Ae.width/2:window.innerWidth/2;gt(V.clientX<Ke?me-1:me+1)},[me,ge,gt,rt,ut,te.length]),ln=a.useCallback(V=>{const Se=Ze.current;(Se==null?void 0:Se.pointerId)===V.pointerId&&ut()},[ut]);Nl(),a.useEffect(()=>{Ct.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const V=requestAnimationFrame(()=>{re(!0),requestAnimationFrame(()=>{wt.current?wt.current.focus():ft.current&&ft.current.focus()})});return()=>{cancelAnimationFrame(V),Be.current&&clearTimeout(Be.current),Q.current&&clearTimeout(Q.current);const Se=Ct.current;Se&&document.contains(Se)&&Se.focus()}},[]),a.useEffect(()=>{var V;I!=="fade"&&($e.current=((V=te[me])==null?void 0:V.entryIndex)??0,Je(),ke(null),Fe(!1),fe(void 0),We(void 0))},[me,Je,te,I]),a.useEffect(()=>{const V=Se=>{if(Se.key==="Escape"){qe();return}if(Se.key==="ArrowLeft"&&te.length>1){gt(me-1);return}if(Se.key==="ArrowRight"&&te.length>1){gt(me+1);return}if(Se.key==="Tab"&&ft.current){const p=ft.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),x=Array.from(p).filter(Ae=>!Ae.closest('[aria-hidden="true"]'));if(x.length===0)return;const k=x[0],oe=x[x.length-1],xe=document.activeElement;Se.shiftKey?(xe===k||!ft.current.contains(xe))&&(Se.preventDefault(),oe.focus()):(xe===oe||!ft.current.contains(xe))&&(Se.preventDefault(),k.focus())}};return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[gt,qe,me,te.length]),a.useLayoutEffect(()=>{Je(),he.current=0,se(0),ae(null),X(!1),ke(null),Fe(!1),fe(void 0),We(void 0),Ce(null),J(V=>{const Se=Math.max(0,te.length-1);return Math.min(V,Se)})},[Je,t.length,y,te.length]),a.useLayoutEffect(()=>{var p;const V=Math.max(0,te.length-1),Se=Math.min(Math.max(0,s),V);Oe.current=Se,$e.current=((p=te[Se])==null?void 0:p.entryIndex)??0,J(Se)},[s]);const ct=Ie!==null?t[Ie]:null,Ot=$!==null?te[$]:null,At=(le==null?void 0:le.title1)||(le==null?void 0:le.title2)||(le==null?void 0:le.title3)||(ct==null?void 0:ct.title1)||(ct==null?void 0:ct.title2)||(ct==null?void 0:ct.title3),ye=ym(y,te,t),we=W!==null,He=At||ye||we,ie=ye&&we?{gap:K}:void 0,Te=`${e}-titles-stack${ve?` ${e}-titles-stack-stacked`:""}`,Me=`${e}-titles-layer-out${ve?` ${e}-titles-layer-out-stacked`:""}`,Pe=`${e}-titles-layer-out`,De=(b??0)>0||o,pt=D(C),_e=a.useMemo(()=>({title1Width:R??vi.title1Width,title2Width:A??vi.title2Width,title3Width:H??vi.title3Width}),[R,A,H]),mt=a.useMemo(()=>({title2MarginLeft:O,title3MarginLeft:M}),[O,M]),et=a.useMemo(()=>le?Fn(e,le,N,pe,g):[],[e,le,N,pe,g]),vt=a.useMemo(()=>et.map(V=>_e[V.widthKey]),[et,_e]),ht=a.useMemo(()=>Ci(et.length,vt),[et.length,vt]),Wt=a.useMemo(()=>Ji(et.length,vt),[et.length,vt]),It=a.useMemo(()=>et.filter(V=>V.prefix==="title1"),[et]),tt=a.useMemo(()=>et.filter(V=>V.prefix==="title2"||V.prefix==="title3"),[et]),Lt=a.useMemo(()=>_n(It,_e),[It,_e]),Et=a.useMemo(()=>_n(tt,_e),[tt,_e]),Rt=a.useCallback((V,Se)=>{const p=et.findIndex(k=>k.prefix===V.prefix);if(!ve||Se==="single-row")return{effectiveWidth:Wt[p]??0,resolvedWidth:ht[p]??0,maxWidth:Vt(p,ht)};if(Se==="two-row-top"){const k=It.findIndex(oe=>oe.prefix===V.prefix);return{effectiveWidth:Lt.effective[k]??0,resolvedWidth:Lt.resolved[k]??0,maxWidth:Vt(k,Lt.resolved)}}const x=tt.findIndex(k=>k.prefix===V.prefix);return{effectiveWidth:Et.effective[x]??0,resolvedWidth:Et.resolved[x]??0,maxWidth:Vt(x,Et.resolved)}},[et,tt,Et,Wt,ht,It,Lt,ve]),cn=a.useCallback(V=>Sl(et,ht,mt,V)+(ve?0:b??0),[et,ht,mt,ve,b]),St=a.useCallback(()=>ve?0:b??0,[ve,b]),Dt=a.useCallback(V=>tt.slice(0,V).reduce((Se,p,x)=>Se+(p.marginLeftKey?mt[p.marginLeftKey]??0:0)+(Et.resolved[x]??0),0),[tt,Et.resolved,mt]),jt=a.useCallback(V=>{const Se=tt[V];return Dt(V)+(Se.marginLeftKey?mt[Se.marginLeftKey]??0:0)+(Et.resolved[V]??0)},[tt,Et.resolved,Dt,mt]),gn=a.useCallback((V,Se,p)=>{if(!ve||p==="single-row"){const Ae=V.findIndex(Mt=>Mt.prefix===Se.prefix),Ke=V.map(Mt=>_e[Mt.widthKey]),at=Ci(V.length,Ke);return{effectiveWidth:Ji(V.length,Ke)[Ae]??0,resolvedWidth:at[Ae]??0,maxWidth:Vt(Ae,at)}}if(p==="two-row-top"){const Ae=V.filter(Mt=>Mt.prefix==="title1"),Ke=Ae.findIndex(Mt=>Mt.prefix===Se.prefix),{resolved:at,effective:Ft}=_n(Ae,_e);return{effectiveWidth:Ft[Ke]??0,resolvedWidth:at[Ke]??0,maxWidth:Vt(Ke,at)}}const x=V.filter(Ae=>Ae.prefix==="title2"||Ae.prefix==="title3"),k=x.findIndex(Ae=>Ae.prefix===Se.prefix),{resolved:oe,effective:xe}=_n(x,_e);return{effectiveWidth:xe[k]??0,resolvedWidth:oe[k]??0,maxWidth:Vt(k,oe)}},[_e,ve]),In=(V,Se,p)=>{const x=V.marginLeftKey?mt[V.marginLeftKey]??0:0,{effectiveWidth:k,resolvedWidth:oe,maxWidth:xe}=p??Rt(V,Se),Ae=Math.max(x,Wn),Ke=o&&Se==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":V.prefix,style:{width:D(k),...x>0?{marginLeft:D(x)}:{}},children:[r.jsx("p",{className:V.className,style:V.style,children:V.text}),Ke&&V.marginLeftKey?r.jsx("div",{"data-controls":V.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(oe),style:{position:"absolute",top:0,left:D(-x),width:D(Ae),height:"100%",pointerEvents:"auto"}}):null,Ke?r.jsx("div",{"data-controls":V.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(xe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:D(-Xt/2),width:D(Xt),height:"100%",pointerEvents:"auto"}}):null]},V.className)},hn=(V="two-row")=>{const Se=et.findIndex(k=>k.prefix==="title1"),p=Se>=0?ht[Se]:_e.title1Width,x=V==="two-row"&&o;return r.jsx("div",{...x?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(p)}:{},style:{width:D(b??0),flexShrink:0,alignSelf:"stretch",...x?{pointerEvents:"auto"}:{}}})},Gt=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:N,"aria-hidden":"true",children:" "}),En=()=>r.jsx("span",{className:`${e}-entry-counter`,style:ue,"aria-live":"polite","aria-atomic":"true",children:fm(te,me,y,t)}),ai=()=>ye?o&&we?r.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[En(),r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Cr(K)} + ${K}))`,width:Cr(K),height:"100%",pointerEvents:"auto",zIndex:3}})]}):En():null,si=()=>!ye&&!we?null:r.jsxs("div",{className:`${e}-titles-row-header-controls`,style:ie,children:[ai(),we?nn():null]}),_i=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[ye||At?Gt():null,De?hn("single-row"):null,on(le),r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),si(),dn()]}),cr=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[ye||At?Gt():null,De?hn("single-row"):null,r.jsxs("div",{className:`${e}-titles-row-titles`,style:Le&&de?{minHeight:de}:void 0,children:[r.jsx("div",{ref:dt,className:Te,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Vn(j||le)}),r.jsxs("div",{ref:Ve,className:Te,style:{position:Le?"absolute":"relative",inset:Le?0:void 0,width:"100%",...Le&&Ne?{width:Ne,maxWidth:"100%"}:void 0},children:[ct&&Le?r.jsx("div",{className:`${Me} ${e}-titles-fade-out`,children:Vn(ct)}):null,r.jsx("div",{className:`${e}-titles-layer-in${Le?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:Vn(le)})]})]}),si(),dn()]}),nn=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:_.scalingValue(F??0,i),height:_.scalingValue(F??0,i),marginRight:U,"--close-icon-hover-color":ee},children:[r.jsx("button",{ref:wt,type:"button",className:`${e}-close-icon-inner`,onClick:qe,"aria-label":"Close",children:r.jsx(Zt,{url:W??"",fill:B,hoverFill:i&&!l?B:ee,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:U,height:"100%",pointerEvents:"auto"}})]}),po=(V,Se)=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[ye||At?Gt():null,De?hn("two-row"):null,Se!==void 0?r.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Se},children:V}):r.jsxs(r.Fragment,{children:[V,r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),si()]}),on=V=>{if(!V)return null;const Se=Fn(e,V,N,pe,g);return r.jsx(r.Fragment,{children:Se.map(p=>In(p,"single-row",gn(Se,p,"single-row")))})},fn=V=>{if(!V)return null;const Se=Fn(e,V,N,pe,g),p=Se.find(x=>x.prefix==="title1");return p?In(p,"two-row-top",gn(Se,p,"two-row-top")):null},Rn=(V,Se=!1)=>{const p=V?Fn(e,V,N,pe,g):[],x=p.filter(xe=>xe.prefix==="title2"||xe.prefix==="title3"),k=o&&Se;return x.length>0||k||(C??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[x.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[x.map(xe=>In(xe,"two-row-bottom",gn(p,xe,"two-row-bottom"))),Se&&o?r.jsxs(r.Fragment,{children:[dr(),ur()]}):null]}):null,(C??0)>0||k?r.jsx("div",{"data-controls":k?"titleRowMarginBottom":void 0,"data-controls-axis":k?"y":void 0,"data-controls-reverse":k?"":void 0,className:k?`${e}-control`:void 0,style:{height:pt,width:"100%",flexShrink:0,pointerEvents:k?"auto":"none"}}):null]}):null},Dn=(V,Se=!1)=>r.jsxs(r.Fragment,{children:[po(fn(V)),Rn(V,Se)]}),Vn=V=>ve?r.jsx("div",{className:`${e}-titles-row-two-row`,children:Dn(V)}):V?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:on(V)}):null,mo=()=>{const V=ve?-1:et.findIndex(x=>x.prefix==="title1"),Se=!ve&&(o||(b??0)>0)?(()=>{const x=b??0,k=V>=0?ht[V]:_e.title1Width,oe=Math.max(x,Wn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(k),style:{position:"absolute",top:0,left:0,width:D(oe),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,p=et.flatMap((x,k)=>{if(!x.marginLeftKey)return[];const oe=mt[x.marginLeftKey]??0,xe=wl(et,ht,mt,k)+St(),Ae=Math.max(oe,Wn);return r.jsx("div",{"data-controls":x.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ht[k]),style:{position:"absolute",top:0,left:D(xe),width:D(Ae),height:"100%",pointerEvents:"auto"}},x.marginLeftKey)});return Se?[Se,...p]:p},go=()=>et.map((V,Se)=>{const p=Vt(Se,ht),k=cn(Se)-Xt/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":V.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(p),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D(k),width:D(Xt),height:"100%",pointerEvents:"auto"}})},`${V.widthKey}-junction`)}),dr=()=>tt.flatMap((V,Se)=>{if(!V.marginLeftKey)return[];const p=mt[V.marginLeftKey]??0,x=Dt(Se),k=Math.max(p,Wn),{resolvedWidth:oe}=Rt(V,"two-row-bottom");return r.jsx("div",{"data-controls":V.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(oe),style:{position:"absolute",top:0,left:D(x),width:D(k),height:"100%",pointerEvents:"auto"}},V.marginLeftKey)}),ur=()=>tt.map((V,Se)=>{const{maxWidth:p}=Rt(V,"two-row-bottom"),k=jt(Se)-Xt/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":V.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(p),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D(k),width:D(Xt),height:"100%",pointerEvents:"auto"}})},`${V.widthKey}-junction`)}),dn=()=>!o||ve?null:r.jsxs(r.Fragment,{children:[mo(),go()]}),li=V=>{const Se=!V.objectFit&&Cn(L);return{className:`${e}-slide-image-cell${Se?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:P,maxHeight:S,...Se?{"--image-aspect-ratio":lr(L)}:{}}}},ho=V=>V.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":V.objectFit}}:Cn(L)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},qn=V=>{if(V.length===0)return null;const Se=V.length>1,p=Cr(z),x=`calc(-0.5 * (${p} + ${z}))`;if(V.length===1){const k=V[0];return r.jsx("div",{...li(k),children:r.jsx("img",{...ho(k),src:k.url,alt:k.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:Se?{gap:z}:void 0,children:V.map((k,oe)=>r.jsxs("div",{...li(k),children:[r.jsx("img",{...ho(k),src:k.url,alt:k.name??"",draggable:!1}),o&&Se&&oe<V.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:x,width:p,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${k.url}-${oe}`))})},fo=!!(le!=null&&le.title2||le!=null&&le.title3||ct!=null&&ct.title2||ct!=null&&ct.title3||(C??0)>0||o),pr=()=>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:dt,className:Te,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Dn(j||le)}),r.jsxs("div",{ref:Ve,className:`${e}-titles-row-two-row`,style:{...Le&&de?{minHeight:de}:void 0,...Le&&Ne?{width:Ne,maxWidth:"100%"}:void 0},children:[po(r.jsxs("div",{className:Te,style:{position:Le?"absolute":"relative",inset:Le?0:void 0,width:"100%"},children:[ct&&Le?r.jsx("div",{className:`${Pe} ${e}-titles-fade-out`,children:fn(ct)}):null,r.jsx("div",{className:`${e}-titles-layer-in${Le?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:fn(le)})]}),Le&&de?de:void 0),fo?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[ct&&Le?r.jsx("div",{className:`${Me} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:Rn(ct)}):null,r.jsx("div",{className:`${e}-titles-layer-in${Le?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${ve?` ${e}-titles-layer-in-stacked`:""}`,children:Rn(le,!0)})]}):null]})]}),mr=()=>{const V=fo;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...V?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:V?void 0:{flex:"0 0 auto",height:"auto"},children:Dn(le,!0)}),dn()]})};return r.jsxs("div",{ref:ft,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{rt||qe()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:we?void 0:-1,style:{opacity:ce?1:0,transition:"opacity 300ms ease",pointerEvents:ce?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:T,...ot}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:$t,...Ge,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:kt,onClick:V=>V.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":ge&&te.length>1?"true":"false",onPointerDown:ge?Bt:void 0,onPointerUp:ge?tn:void 0,onPointerCancel:ge?ln:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[Ot&&E?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:V=>{V.target===V.currentTarget&&it(Y)},children:r.jsx("div",{className:`${e}-slide-area`,children:qn(Ot.images)})},`slide-out-${Y}`):null,r.jsx("div",{className:`${e}-slide-layer-in${E?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:be?qn(be.images):null})},`slide-in-${Y}-${me}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Ht,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:Z,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...ve?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${ve?` ${e}-lightbox-content-area-stacked`:""}`,children:He&&r.jsx("div",{className:`${e}-text-bar-cell${ve?` ${e}-text-bar-cell-stacked`:""}`,style:ve?void 0:{flex:1,minWidth:0,width:"100%"},children:ve?I==="fade"?pr():mr():I==="fade"?cr():_i()})})})]})]})]})};function Vh(e){return`
|
|
13540
13540
|
.${e}-wrapper {
|
|
13541
13541
|
position: relative;
|
|
13542
13542
|
width: 100%;
|
|
@@ -14070,7 +14070,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
14070
14070
|
pointer-events: auto;
|
|
14071
14071
|
z-index: 10;
|
|
14072
14072
|
}
|
|
14073
|
-
`}const qh=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:l,metadata:s})=>{const{prefix:d}=
|
|
14073
|
+
`}const qh=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:l,metadata:s})=>{const{prefix:d}=_.useScopedStyles(),c=(s==null?void 0:s.itemId)??null,{cover:u,coverFit:m,type:y}=e,L=a.useRef(null),[T,h]=a.useState(!1),[v,w]=a.useState(0),I=a.useRef(!1),R=a.useRef(!1),A=a.useRef(!1),H=a.useMemo(()=>(t??[]).filter(f=>$i(f).length>0),[t]),b=T&&H.length>0,O=!n,M=a.useCallback(()=>{O&&(A.current=!0,um(R.current,c),R.current=!1)},[O,c]),C=(f=0)=>{if(H.length===0||n&&!i&&!o)return;const W=_o(H,y),F=Math.max(0,Math.min(f,W.length-1));if(w(F),O){const B=xl();vl(F+1,c,B),R.current=!B}h(!0)},q=a.useCallback(()=>{h(!1),A.current=!1},[]);return a.useEffect(()=>{!n||i||o||h(!1)},[n,i,o]),a.useEffect(()=>{if(!O||I.current)return;I.current=!0;const f=Qa(c);if(!f)return;const W=es(f,_o(H,y).length);W<0||(w(W),h(!0))},[H,c,O,y]),a.useEffect(()=>{if(!O)return;const f=()=>{if(A.current){A.current=!1,h(!1);return}const W=Qa(c);if(!W){h(!1);return}const F=es(W,_o(H,y).length);if(F<0){h(!1);return}R.current=!1,w(F),h(!0)};return window.addEventListener("popstate",f),()=>window.removeEventListener("popstate",f)},[H,c,O,y]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:L,className:`${d}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Vh(d)}}),u?r.jsx("button",{type:"button",className:`${d}-cover ${Cn(m)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>C(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...Cn(m)?{"--image-aspect-ratio":lr(m)}:{}},"aria-label":"Open journal gallery",children:r.jsx("img",{className:`${d}-cover-image ${Cn(m)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),b&&typeof document<"u"&&(()=>{const f=(l?document.getElementById(l):null)??document.body;return Mi.createPortal(r.jsx(Dh,{prefix:d,entries:H,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:v,enableUrlSync:O,journalItemId:c,onBeforeClose:M,onClose:q}),f)})()]})},Gh=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
|
|
14074
14074
|
import { createPortal } from 'react-dom';
|
|
14075
14075
|
import { CommonComponentProps } from '../props';
|
|
14076
14076
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -14873,7 +14873,7 @@ export type LightboxJournalSettings = {
|
|
|
14873
14873
|
width: 32px;
|
|
14874
14874
|
height: 32px;
|
|
14875
14875
|
}
|
|
14876
|
-
`}function of(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 rf(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await of(i)]));return new Map(n)}function af({settings:e,content:t=[],isEditor:n}){const{prefix:i}=
|
|
14876
|
+
`}function of(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 rf(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await of(i)]));return new Map(n)}function af({settings:e,content:t=[],isEditor:n}){const{prefix:i}=_.useScopedStyles(),[o,l]=a.useState(null),[s,d]=a.useState([]),[c,u]=a.useState(0),m=a.useRef(0),[y,L]=a.useState({x:0,y:0}),[T,h]=a.useState("none"),v=a.useRef({x:0,y:0}),[w,I]=a.useState(!1),[R,A]=a.useState(!1),H=a.useRef(new Map),{imageSize:b=ef,cursor:O="system",target:M="area",position:C="random",visible:q="all",defaultCursor:f=null,hoverCursor:W=null}=e,F=a.useMemo(()=>nf(i),[i]),B=a.useCallback((z,P,S=s)=>{if(!o)return;const K=o.getBoundingClientRect(),Z=z-K.left,U=P-K.top;L({x:Z,y:U}),h(tf(Z,U,S,o,O,M,W,f))},[o,s,O,M,W,f]);a.useEffect(()=>{const z=[...t.map(S=>S.image.url),f,W].filter(S=>!!S);if(z.length===0){H.current=new Map,A(!0);return}let P=!1;return A(!1),rf(z).then(S=>{P||(H.current=S,A(!0))}),()=>{P=!0}},[t,f,W]),a.useEffect(()=>{if(!o)return;const z=S=>{S.stopPropagation(),v.current={x:S.clientX,y:S.clientY},B(S.clientX,S.clientY)},P=()=>{w&&B(v.current.x,v.current.y)};return o.addEventListener("mousemove",z),window.addEventListener("scroll",P,!0),()=>{o.removeEventListener("mousemove",z),window.removeEventListener("scroll",P,!0)}},[o,w,B]),a.useEffect(()=>{!o||!w||B(v.current.x,v.current.y)},[s,o,w,B]),a.useEffect(()=>{w||h("none")},[w]);const ee=(z,P,S,K={})=>{var ue;const Z=((ue=H.current.get(z.image.url))==null?void 0:ue.aspectRatio)??1,U=Ms(z.image.url,b,H.current),{heightPx:N}=Go(U,Z);let pe=0,g=0;return C==="same"?{x:pe,y:g}=Rs(P,S,U,Z):(pe=K.x??Math.random()*P,g=K.y??Math.random()*S,{x:pe,y:g}=Vr(pe,g,P,S,U,N)),{id:m.current++,url:z.image.url,link:z.link,name:z.image.name,x:pe,y:g,xRatio:pe/P,yRatio:g/S,aspectRatio:Z,widthPx:U}},ne=()=>{if(!o)return;const z=o.getBoundingClientRect(),P=z.width,S=z.height;P===0||S===0||d(K=>K.length===0?K:K.map(Z=>{const U=b.sizeType==="random"?Z.widthPx:Ms(Z.url,b,H.current),{heightPx:N}=Go(U,Z.aspectRatio);if(C==="same"){const{x:ue,y:ve}=Rs(P,S,U,Z.aspectRatio);return{...Z,x:ue,y:ve,widthPx:U}}const{x:pe,y:g}=Vr(Z.xRatio*P,Z.yRatio*S,P,S,U,N);return{...Z,x:pe,y:g,widthPx:U}}))};a.useEffect(()=>{if(!o||t.length===0||!R)return;const z=o.getBoundingClientRect(),P=z.width,S=z.height,K=ee(t[0],P,S);d([K]),u(1)},[b,C,o,t,R]),a.useEffect(()=>{if(!o)return;ne();const z=new ResizeObserver(ne);return z.observe(o),window.addEventListener("resize",ne),()=>{z.disconnect(),window.removeEventListener("resize",ne)}},[o,C,b,s.length]),a.useEffect(()=>{q==="last One"&&d(z=>z.length>0?[z[z.length-1]]:[])},[q]);const G=z=>{if(!o||t.length===0||!R)return;const P=o.getBoundingClientRect(),S=z.clientX-P.left,K=z.clientY-P.top;if(M==="image"&&!Ol(S,K,s))return;let Z=0,U=0;C==="on Click"?(Z=S,U=K):C==="same"?(Z=P.width/2,U=P.height/2):(Z=Math.random()*P.width,U=Math.random()*P.height);const N=t[c],pe=ee(N,P.width,P.height,{x:Z,y:U}),g=q==="all"?[...s,pe]:[pe];d(g),u(ue=>ue>=t.length-1?0:ue+1),B(z.clientX,z.clientY,g)},D=O==="custom"&&T!=="none";return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:F}}),r.jsxs("div",{ref:l,onClick:G,onMouseEnter:()=>I(!0),onMouseLeave:()=>I(!1),className:`${i}-root`,style:{cursor:D?"none":"default"},children:[s.map(z=>r.jsx("div",{className:`${i}-wrapper`,style:{top:`${z.y}px`,left:`${z.x}px`,width:`${z.widthPx}px`,cursor:D?"none":"default"},children:M==="area"&&z.link?r.jsx("a",{href:z.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:r.jsx("img",{src:z.url,alt:z.name,className:`${i}-image`})}):r.jsx("img",{src:z.url,alt:z.name,className:`${i}-image`})},z.id)),w&&D&&r.jsx("div",{className:`${i}-cursor`,style:{left:`${y.x}px`,top:`${y.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${T}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const sf=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
14877
14877
|
import { CommonComponentProps } from '../props';
|
|
14878
14878
|
import { useScopedStyles } from '../utils/index';
|
|
14879
14879
|
|
|
@@ -15504,7 +15504,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
15504
15504
|
display: block;
|
|
15505
15505
|
pointer-events: none;
|
|
15506
15506
|
}
|
|
15507
|
-
`}function mf(e){return e==="blur"?uf:e==="greyscale"?df:0}function Hi(e,t=1,n=1){const i=mf(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 Ps(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function gf(e,t){return t<=1?0:(e-1+t)%t}function hf(e,t=1){return!e||e.height===0?t:e.width/e.height}function ff(e,t,n,i,o){if(e<=0||t<=0)return{widthPercent:i,heightPercent:o};const l=e*i/100,s=t*o/100;let d=l,c=d/n;return c>s&&(c=s,d=c*n),{widthPercent:d/e*100,heightPercent:c/t*100}}function ks(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 jl(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function As(e,t,n){return{...jl(e),[`--${n}-stage-scale`]:t}}function yf(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 vf({settings:e,content:t,isEditor:n,isPreviewMode:i}){var
|
|
15507
|
+
`}function mf(e){return e==="blur"?uf:e==="greyscale"?df:0}function Hi(e,t=1,n=1){const i=mf(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 Ps(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function gf(e,t){return t<=1?0:(e-1+t)%t}function hf(e,t=1){return!e||e.height===0?t:e.width/e.height}function ff(e,t,n,i,o){if(e<=0||t<=0)return{widthPercent:i,heightPercent:o};const l=e*i/100,s=t*o/100;let d=l,c=d/n;return c>s&&(c=s,d=c*n),{widthPercent:d/e*100,heightPercent:c/t*100}}function ks(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 jl(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function As(e,t,n){return{...jl(e),[`--${n}-stage-scale`]:t}}function yf(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 vf({settings:e,content:t,isEditor:n,isPreviewMode:i}){var Fe,$,ae,E,X,Y,se;const{prefix:o}=_.useScopedStyles(),l=a.useMemo(()=>pf(o),[o]),{imageSize:s,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:m="greyscale"}=e,y=t??[],L=Ps(y.length),[T,h]=a.useState(L.activeIndex),[v,w]=a.useState(L.backgroundIndex),[I,R]=a.useState(!1),[A,H]=a.useState(!1),[b,O]=a.useState(null),[M,C]=a.useState(null),[q,f]=a.useState(0),[W,F]=a.useState(1),[B,ee]=a.useState("none"),[ne,G]=a.useState("next"),[D,z]=a.useState({}),[P,S]=a.useState({width:0,height:0}),K=a.useRef(null),Z=a.useRef(null),U=!n||!!i,N=s??60,pe=Math.max(10,Math.min(100,d??N)),g=Math.max(10,Math.min(100,c??N)),ue=Math.max(100,u),ve=Hi(m),ge=a.useCallback(de=>{const fe=hf(de?D[de]:void 0);return ff(P.width,P.height,fe,pe,g)},[P.height,P.width,D,g,pe]);a.useEffect(()=>{const de=Z.current;if(!de)return;const fe=new ResizeObserver(([Ne])=>{const{width:We,height:j}=Ne.contentRect;S({width:We,height:j})});return fe.observe(de),()=>fe.disconnect()},[]),a.useEffect(()=>{const de=(t??[]).map(fe=>{var Ne;return(Ne=fe.image)==null?void 0:Ne.url}).filter(fe=>!!fe);yf(de,(fe,Ne)=>{z(We=>{var j,Ce;return((j=We[fe])==null?void 0:j.width)===Ne.width&&((Ce=We[fe])==null?void 0:Ce.height)===Ne.height?We:{...We,[fe]:Ne}})})},[t]),a.useEffect(()=>{const{backgroundIndex:de,activeIndex:fe}=Ps(y.length);h(fe),w(de),R(!1),H(!1),O(null),C(null),f(0),F(1),ee("none"),G("next")},[y.length,t]),a.useEffect(()=>()=>{K.current&&clearTimeout(K.current)},[]);const Ee=a.useCallback(de=>{var Q,he,$e,Oe;if(!U||I||y.length<=1)return;const fe=de==="next"?(T+1)%y.length:(T-1+y.length)%y.length,Ne=ge((he=(Q=y[T])==null?void 0:Q.image)==null?void 0:he.url),We=ge((Oe=($e=y[fe])==null?void 0:$e.image)==null?void 0:Oe.url),j=ks(P.width,P.height,Ne),Ce=ks(P.width,P.height,We);K.current&&clearTimeout(K.current),G(de),H(!0),R(!0),de==="next"?(O(T),C(fe),f(0),F(1),ee(Hi(m,0,1))):(w(gf(fe,y.length)),O(fe),C(T),f(1),F(Ce),ee(Hi(m,1,Ce))),requestAnimationFrame(()=>{H(!1),requestAnimationFrame(()=>{de==="next"?(f(1),F(j),ee(Hi(m,1,j))):(f(0),F(1),ee(Hi(m,0,1)))})}),K.current=setTimeout(()=>{de==="next"&&w(T),h(fe),O(null),C(null),R(!1)},ue)},[T,m,P.height,P.width,ge,I,U,y,ue]),te=y[T],me=v!==null?y[v]:null,J=b!==null?y[b]:null,be=M!==null?y[M]:null,le=y.length<=1?0:(T-1+y.length)%y.length,ce=y.length<=1?0:(T+1)%y.length,re=ge((Fe=te==null?void 0:te.image)==null?void 0:Fe.url),Ie=ge(($=J==null?void 0:J.image)==null?void 0:$.url),ke=ge((ae=be==null?void 0:be.image)==null?void 0:ae.url),Le={[`--${o}-transition-ms`]:`${ue}ms`};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),r.jsxs("div",{ref:Z,className:nt(`${o}-wrapper`,A&&`${o}-snap`,n&&!i&&`${o}-editor`),style:Le,"aria-label":"Zoom gallery",children:[((E=me==null?void 0:me.image)==null?void 0:E.url)&&r.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:me.image.url,alt:"",style:{filter:ve}})}),I&&((X=J==null?void 0:J.image)==null?void 0:X.url)&&r.jsx("div",{className:nt(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${ne}`),style:As(Ie,W,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:J.image.url,alt:"",style:{filter:B}})}),I&&((Y=be==null?void 0:be.image)==null?void 0:Y.url)&&r.jsx("div",{className:nt(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${ne}`),style:As(ke,q,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-image`,src:be.image.url,alt:""})}),!I&&((se=te==null?void 0:te.image)==null?void 0:se.url)&&r.jsx("div",{className:nt(`${o}-stage`,`${o}-foreground`),style:jl(re),children:r.jsx("img",{className:`${o}-image`,src:te.image.url,alt:te.image.name??""})}),U&&y.length>1&&!I&&r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:nt(`${o}-nav`,`${o}-nav-prev`),onClick:()=>Ee("prev"),"aria-label":`Show previous image (${le+1} of ${y.length})`}),r.jsx("button",{type:"button",className:nt(`${o}-nav`,`${o}-nav-next`),onClick:()=>Ee("next"),"aria-label":`Show next image (${ce+1} of ${y.length})`})]})]})]})}const xf=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
15508
15508
|
import cn from 'classnames';
|
|
15509
15509
|
import { CommonComponentProps } from '../props';
|
|
15510
15510
|
import { useScopedStyles } from '../utils/useScopedStyles';
|