@cntrl-site/components 1.0.33-alpha.1 → 1.0.33
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 +209 -762
- package/dist/index.mjs +6631 -7515
- package/package.json +1 -1
- package/dist/Components/Zoom/Zoom.d.ts +0 -22
- package/dist/Components/Zoom/ZoomComponent.d.ts +0 -36
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),l=require("react"),ze=require("classnames"),P=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),ji=require("react-dom");function ul(e){return e.type==="object"&&e.version===1}const pl="ControlSlider-module__wrapper___sHEkd",ml="ControlSlider-module__hoverArrow___A-dOH",gl="ControlSlider-module__sliderItem___QQSkR",hl="ControlSlider-module__sliderImage___9hRl-",fl="ControlSlider-module__arrow___05ghY",yl="ControlSlider-module__arrowVertical___tBfVN",vl="ControlSlider-module__nextArrow___-30Yc",bl="ControlSlider-module__arrowInner___aEra3",xl="ControlSlider-module__arrowIcon___S4ztF",wl="ControlSlider-module__arrowImg___2dwJW",$l="ControlSlider-module__mirror___brd6U",Sl="ControlSlider-module__pagination___bicLF",Cl="ControlSlider-module__paginationInner___bT-P-",Tl="ControlSlider-module__paginationVertical___zYqKw",Ll="ControlSlider-module__paginationItem___nTRbk",El="ControlSlider-module__dot___p1Qun",Il="ControlSlider-module__activeDot___LHFaj",Pl="ControlSlider-module__paginationInsideBottom___R3FWn",kl="ControlSlider-module__paginationInsideTop___V-qb-",Rl="ControlSlider-module__paginationOutsideBottom___14w8D",Al="ControlSlider-module__paginationOutsideTop___SCLqB",Ml="ControlSlider-module__paginationInsideLeft___yOBRZ",_l="ControlSlider-module__paginationInsideRight___Rtt3o",Fl="ControlSlider-module__paginationOutsideLeft___lahaw",Wl="ControlSlider-module__paginationOutsideRight___EtuQa",Nl="ControlSlider-module__imgWrapper___UjEgB",Hl="ControlSlider-module__captionBlock___dJ6-j",Ol="ControlSlider-module__captionTextWrapper___HFlpf",Bl="ControlSlider-module__captionText___uGBVc",jl="ControlSlider-module__active___WZK4G",zl="ControlSlider-module__withPointerEvents___t-18M",Vl="ControlSlider-module__topLeftAlignment___zjnGM",Dl="ControlSlider-module__topCenterAlignment___gD1xW",ql="ControlSlider-module__topRightAlignment___NMapS",Kl="ControlSlider-module__middleLeftAlignment___OnUrY",Gl="ControlSlider-module__middleCenterAlignment___Tdkl0",Ul="ControlSlider-module__middleRightAlignment___wEbfX",Xl="ControlSlider-module__bottomLeftAlignment___cTP2-",Yl="ControlSlider-module__bottomCenterAlignment___c54fB",Jl="ControlSlider-module__bottomRightAlignment___kEwrz",Zl="ControlSlider-module__clickOverlay___DZA28",Ql="ControlSlider-module__contain___pLyq7",ec="ControlSlider-module__cover___KdDat",Pe={wrapper:pl,hoverArrow:ml,sliderItem:gl,sliderImage:hl,arrow:fl,arrowVertical:yl,nextArrow:vl,arrowInner:bl,arrowIcon:xl,arrowImg:wl,mirror:$l,pagination:Sl,paginationInner:Cl,paginationVertical:Tl,paginationItem:Ll,dot:El,activeDot:Il,paginationInsideBottom:Pl,paginationInsideTop:kl,paginationOutsideBottom:Rl,paginationOutsideTop:Al,paginationInsideLeft:Ml,paginationInsideRight:_l,paginationOutsideLeft:Fl,paginationOutsideRight:Wl,imgWrapper:Nl,captionBlock:Hl,captionTextWrapper:Ol,captionText:Bl,active:jl,withPointerEvents:zl,topLeftAlignment:Vl,topCenterAlignment:Dl,topRightAlignment:ql,middleLeftAlignment:Kl,middleCenterAlignment:Gl,middleRightAlignment:Ul,bottomLeftAlignment:Xl,bottomCenterAlignment:Yl,bottomRightAlignment:Jl,clickOverlay:Zl,contain:Ql,cover:ec};function tc(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 nc(e,t,n){return t&&tc(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var aa="(prefers-reduced-motion: reduce)",ri=1,ic=2,li=3,vi=4,zi=5,bo=6,Eo=7,oc={CREATED:ri,MOUNTED:ic,IDLE:li,MOVING:vi,SCROLLING:zi,DRAGGING:bo,DESTROYED:Eo};function bn(e){e.length=0}function An(e,t,n){return Array.prototype.slice.call(e,t,n)}function mt(e){return e.bind.apply(e,[null].concat(An(arguments,1)))}var us=setTimeout,vr=function(){};function sa(e){return requestAnimationFrame(e)}function _o(e,t){return typeof t===e}function ki(e){return!Rr(e)&&_o("object",e)}var kr=Array.isArray,ps=mt(_o,"function"),Pn=mt(_o,"string"),Vi=mt(_o,"undefined");function Rr(e){return e===null}function ms(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Di(e){return kr(e)?e:[e]}function Gt(e,t){Di(e).forEach(t)}function Ar(e,t){return e.indexOf(t)>-1}function xo(e,t){return e.push.apply(e,Di(t)),e}function gn(e,t,n){e&&Gt(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function on(e,t){gn(e,Pn(t)?t.split(" "):t,!0)}function qi(e,t){Gt(t,e.appendChild.bind(e))}function Mr(e,t){Gt(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function Ri(e,t){return ms(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function gs(e,t){var n=e?An(e.children):[];return t?n.filter(function(i){return Ri(i,t)}):n}function Ki(e,t){return t?gs(e,t)[0]:e.firstElementChild}var Ai=Object.keys;function qn(e,t,n){return e&&(n?Ai(e).reverse():Ai(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function Mi(e){return An(arguments,1).forEach(function(t){qn(t,function(n,i){e[i]=t[i]})}),e}function In(e){return An(arguments,1).forEach(function(t){qn(t,function(n,i){kr(n)?e[i]=n.slice():ki(n)?e[i]=In({},ki(e[i])?e[i]:{},n):e[i]=n})}),e}function la(e,t){Gt(t||Ai(e),function(n){delete e[n]})}function rn(e,t){Gt(e,function(n){Gt(t,function(i){n&&n.removeAttribute(i)})})}function Oe(e,t,n){ki(t)?qn(t,function(i,o){Oe(e,o,i)}):Gt(e,function(i){Rr(n)||n===""?rn(i,t):i.setAttribute(t,String(n))})}function ai(e,t,n){var i=document.createElement(e);return t&&(Pn(t)?on(i,t):Oe(i,t)),n&&qi(n,i),i}function Jt(e,t,n){if(Vi(n))return getComputedStyle(e)[t];Rr(n)||(e.style[t]=""+n)}function _i(e,t){Jt(e,"display",t)}function hs(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Zt(e,t){return e.getAttribute(t)}function ca(e,t){return e&&e.classList.contains(t)}function Vt(e){return e.getBoundingClientRect()}function Kn(e){Gt(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function fs(e){return Ki(new DOMParser().parseFromString(e,"text/html").body)}function mn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function ys(e,t){return e&&e.querySelector(t)}function _r(e,t){return t?An(e.querySelectorAll(t)):[]}function hn(e,t){gn(e,t,!1)}function br(e){return e.timeStamp}function Hn(e){return Pn(e)?e:e?e+"px":""}var Gi="splide",Fr="data-"+Gi;function Ti(e,t){if(!e)throw new Error("["+Gi+"] "+(t||""))}var kn=Math.min,Io=Math.max,Po=Math.floor,Fi=Math.ceil,jt=Math.abs;function vs(e,t,n){return jt(e-t)<n}function wo(e,t,n,i){var o=kn(t,n),s=Io(t,n);return i?o<e&&e<s:o<=e&&e<=s}function ni(e,t,n){var i=kn(t,n),o=Io(t,n);return kn(Io(i,e),o)}function xr(e){return+(e>0)-+(e<0)}function wr(e,t){return Gt(t,function(n){e=e.replace("%s",""+n)}),e}function Wr(e){return e<10?"0"+e:""+e}var da={};function rc(e){return""+e+Wr(da[e]=(da[e]||0)+1)}function bs(){var e=[];function t(a,u,c,m){o(a,u,function(p,b,w){var S="addEventListener"in p,g=S?p.removeEventListener.bind(p,b,c,m):p.removeListener.bind(p,c);S?p.addEventListener(b,c,m):p.addListener(c),e.push([p,b,w,c,g])})}function n(a,u,c){o(a,u,function(m,p,b){e=e.filter(function(w){return w[0]===m&&w[1]===p&&w[2]===b&&(!c||w[3]===c)?(w[4](),!1):!0})})}function i(a,u,c){var m,p=!0;return typeof CustomEvent=="function"?m=new CustomEvent(u,{bubbles:p,detail:c}):(m=document.createEvent("CustomEvent"),m.initCustomEvent(u,p,!1,c)),a.dispatchEvent(m),m}function o(a,u,c){Gt(a,function(m){m&&Gt(u,function(p){p.split(" ").forEach(function(b){var w=b.split(".");c(m,w[0],w[1])})})})}function s(){e.forEach(function(a){a[4]()}),bn(e)}return{bind:t,unbind:n,dispatch:i,destroy:s}}var Mn="mounted",$r="ready",xn="move",bi="moved",Nr="click",xs="active",ws="inactive",$s="visible",Ss="hidden",Tt="refresh",Nt="updated",ci="resize",Fo="resized",Cs="drag",Ts="dragging",Ls="dragged",Wo="scroll",Un="scrolled",ac="overflow",Hr="destroy",Es="arrows:mounted",Is="arrows:updated",Ps="pagination:mounted",ks="pagination:updated",Or="navigation:mounted",Br="autoplay:play",Rs="autoplay:playing",jr="autoplay:pause",zr="lazyload:loaded",As="sk",Ms="sh",ko="ei";function bt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=bs();function i(s,a){n.bind(t,Di(s).join(" "),function(u){a.apply(a,kr(u.detail)?u.detail:[])})}function o(s){n.dispatch(t,s,An(arguments,1))}return e&&e.event.on(Hr,n.destroy),Mi(n,{bus:t,on:i,off:mt(n.unbind,t),emit:o})}function No(e,t,n,i){var o=Date.now,s,a=0,u,c=!0,m=0;function p(){if(!c){if(a=e?kn((o()-s)/e,1):1,n&&n(a),a>=1&&(t(),s=o(),i&&++m>=i))return w();u=sa(p)}}function b($){$||g(),s=o()-($?a*e:0),c=!1,u=sa(p)}function w(){c=!0}function S(){s=o(),a=0,n&&n(a)}function g(){u&&cancelAnimationFrame(u),a=0,u=0,c=!0}function v($){e=$}function T(){return c}return{start:b,rewind:S,pause:w,cancel:g,set:v,isPaused:T}}function sc(e){var t=e;function n(o){t=o}function i(o){return Ar(Di(o),t)}return{set:n,is:i}}function lc(e,t){var n=No(0,e,null,1);return function(){n.isPaused()&&n.start()}}function cc(e,t,n){var i=e.state,o=n.breakpoints||{},s=n.reducedMotion||{},a=bs(),u=[];function c(){var g=n.mediaQuery==="min";Ai(o).sort(function(v,T){return g?+v-+T:+T-+v}).forEach(function(v){p(o[v],"("+(g?"min":"max")+"-width:"+v+"px)")}),p(s,aa),b()}function m(g){g&&a.destroy()}function p(g,v){var T=matchMedia(v);a.bind(T,"change",b),u.push([g,T])}function b(){var g=i.is(Eo),v=n.direction,T=u.reduce(function($,C){return In($,C[1].matches?C[0]:{})},{});la(n),S(T),n.destroy?e.destroy(n.destroy==="completely"):g?(m(!0),e.mount()):v!==n.direction&&e.refresh()}function w(g){matchMedia(aa).matches&&(g?In(n,s):la(n,Ai(s)))}function S(g,v,T){In(n,g),v&&In(Object.getPrototypeOf(n),g),(T||!i.is(ri))&&e.emit(Nt,n)}return{setup:c,destroy:m,reduce:w,set:S}}var Ho="Arrow",Oo=Ho+"Left",Bo=Ho+"Right",_s=Ho+"Up",Fs=Ho+"Down",ua="rtl",jo="ttb",tr={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[_s,Bo],ArrowRight:[Fs,Oo]};function dc(e,t,n){function i(s,a,u){u=u||n.direction;var c=u===ua&&!a?1:u===jo?0:-1;return tr[s]&&tr[s][c]||s.replace(/width|left|right/i,function(m,p){var b=tr[m.toLowerCase()][c]||m;return p>0?b.charAt(0).toUpperCase()+b.slice(1):b})}function o(s){return s*(n.direction===ua?1:-1)}return{resolve:i,orient:o}}var fn="role",si="tabindex",uc="disabled",en="aria-",Ui=en+"controls",Ws=en+"current",pa=en+"selected",Dt=en+"label",Vr=en+"labelledby",Ns=en+"hidden",Dr=en+"orientation",Wi=en+"roledescription",ma=en+"live",ga=en+"busy",ha=en+"atomic",qr=[fn,si,uc,Ui,Ws,Dt,Vr,Ns,Dr,Wi],an=Gi+"__",_n="is-",nr=Gi,fa=an+"track",pc=an+"list",zo=an+"slide",Hs=zo+"--clone",mc=zo+"__container",Kr=an+"arrows",Vo=an+"arrow",Os=Vo+"--prev",Bs=Vo+"--next",Do=an+"pagination",js=Do+"__page",gc=an+"progress",hc=gc+"__bar",fc=an+"toggle",yc=an+"spinner",vc=an+"sr",bc=_n+"initialized",Gn=_n+"active",zs=_n+"prev",Vs=_n+"next",Sr=_n+"visible",Cr=_n+"loading",Ds=_n+"focus-in",qs=_n+"overflow",xc=[Gn,Sr,zs,Vs,Cr,Ds,qs],wc={slide:zo,clone:Hs,arrows:Kr,arrow:Vo,prev:Os,next:Bs,pagination:Do,page:js,spinner:yc};function $c(e,t){if(ps(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!Ri(n,t);)n=n.parentElement;return n}var Sc=5,ya=200,Ks="touchstart mousedown",ir="touchmove mousemove",or="touchend touchcancel mouseup click";function Cc(e,t,n){var i=bt(e),o=i.on,s=i.bind,a=e.root,u=n.i18n,c={},m=[],p=[],b=[],w,S,g;function v(){L(),A(),C()}function T(){o(Tt,$),o(Tt,v),o(Nt,C),s(document,Ks+" keydown",function(I){g=I.type==="keydown"},{capture:!0}),s(a,"focusin",function(){gn(a,Ds,!!g)})}function $(I){var E=qr.concat("style");bn(m),hn(a,p),hn(w,b),rn([w,S],E),rn(a,I?E:["style",Wi])}function C(){hn(a,p),hn(w,b),p=F(nr),b=F(fa),on(a,p),on(w,b),Oe(a,Dt,n.label),Oe(a,Vr,n.labelledby)}function L(){w=k("."+fa),S=Ki(w,"."+pc),Ti(w&&S,"A track/list element is missing."),xo(m,gs(S,"."+zo+":not(."+Hs+")")),qn({arrows:Kr,pagination:Do,prev:Os,next:Bs,bar:hc,toggle:fc},function(I,E){c[E]=k("."+I)}),Mi(c,{root:a,track:w,list:S,slides:m})}function A(){var I=a.id||rc(Gi),E=n.role;a.id=I,w.id=w.id||I+"-track",S.id=S.id||I+"-list",!Zt(a,fn)&&a.tagName!=="SECTION"&&E&&Oe(a,fn,E),Oe(a,Wi,u.carousel),Oe(S,fn,"presentation")}function k(I){var E=ys(a,I);return E&&$c(E,"."+nr)===a?E:void 0}function F(I){return[I+"--"+n.type,I+"--"+n.direction,n.drag&&I+"--draggable",n.isNavigation&&I+"--nav",I===nr&&Gn]}return Mi(c,{setup:v,mount:T,destroy:$})}var di="slide",xi="loop",Xi="fade";function Tc(e,t,n,i){var o=bt(e),s=o.on,a=o.emit,u=o.bind,c=e.Components,m=e.root,p=e.options,b=p.isNavigation,w=p.updateOnMove,S=p.i18n,g=p.pagination,v=p.slideFocus,T=c.Direction.resolve,$=Zt(i,"style"),C=Zt(i,Dt),L=n>-1,A=Ki(i,"."+mc),k;function F(){L||(i.id=m.id+"-slide"+Wr(t+1),Oe(i,fn,g?"tabpanel":"group"),Oe(i,Wi,S.slide),Oe(i,Dt,C||wr(S.slideLabel,[t+1,e.length]))),I()}function I(){u(i,"click",mt(a,Nr,Q)),u(i,"keydown",mt(a,As,Q)),s([bi,Ms,Un],_),s(Or,J),w&&s(xn,y)}function E(){k=!0,o.destroy(),hn(i,xc),rn(i,qr),Oe(i,"style",$),Oe(i,Dt,C||"")}function J(){var z=e.splides.map(function(B){var Y=B.splide.Components.Slides.getAt(t);return Y?Y.slide.id:""}).join(" ");Oe(i,Dt,wr(S.slideX,(L?n:t)+1)),Oe(i,Ui,z),Oe(i,fn,v?"button":""),v&&rn(i,Wi)}function y(){k||_()}function _(){if(!k){var z=e.index;W(),G(),gn(i,zs,t===z-1),gn(i,Vs,t===z+1)}}function W(){var z=ue();z!==ca(i,Gn)&&(gn(i,Gn,z),Oe(i,Ws,b&&z||""),a(z?xs:ws,Q))}function G(){var z=X(),B=!z&&(!ue()||L);if(e.state.is([vi,zi])||Oe(i,Ns,B||""),Oe(_r(i,p.focusableNodes||""),si,B?-1:""),v&&Oe(i,si,B?-1:0),z!==ca(i,Sr)&&(gn(i,Sr,z),a(z?$s:Ss,Q)),!z&&document.activeElement===i){var Y=c.Slides.getAt(e.index);Y&&hs(Y.slide)}}function te(z,B,Y){Jt(Y&&A||i,z,B)}function ue(){var z=e.index;return z===t||p.cloneStatus&&z===n}function X(){if(e.is(Xi))return ue();var z=Vt(c.Elements.track),B=Vt(i),Y=T("left",!0),oe=T("right",!0);return Po(z[Y])<=Fi(B[Y])&&Po(B[oe])<=Fi(z[oe])}function H(z,B){var Y=jt(z-t);return!L&&(p.rewind||e.is(xi))&&(Y=kn(Y,e.length-Y)),Y<=B}var Q={index:t,slideIndex:n,slide:i,container:A,isClone:L,mount:F,destroy:E,update:_,style:te,isWithin:H};return Q}function Lc(e,t,n){var i=bt(e),o=i.on,s=i.emit,a=i.bind,u=t.Elements,c=u.slides,m=u.list,p=[];function b(){w(),o(Tt,S),o(Tt,w)}function w(){c.forEach(function(_,W){v(_,W,-1)})}function S(){k(function(_){_.destroy()}),bn(p)}function g(){k(function(_){_.update()})}function v(_,W,G){var te=Tc(e,W,G,_);te.mount(),p.push(te),p.sort(function(ue,X){return ue.index-X.index})}function T(_){return _?F(function(W){return!W.isClone}):p}function $(_){var W=t.Controller,G=W.toIndex(_),te=W.hasFocus()?1:n.perPage;return F(function(ue){return wo(ue.index,G,G+te-1)})}function C(_){return F(_)[0]}function L(_,W){Gt(_,function(G){if(Pn(G)&&(G=fs(G)),ms(G)){var te=c[W];te?Mr(G,te):qi(m,G),on(G,n.classes.slide),E(G,mt(s,ci))}}),s(Tt)}function A(_){Kn(F(_).map(function(W){return W.slide})),s(Tt)}function k(_,W){T(W).forEach(_)}function F(_){return p.filter(ps(_)?_:function(W){return Pn(_)?Ri(W.slide,_):Ar(Di(_),W.index)})}function I(_,W,G){k(function(te){te.style(_,W,G)})}function E(_,W){var G=_r(_,"img"),te=G.length;te?G.forEach(function(ue){a(ue,"load error",function(){--te||W()})}):W()}function J(_){return _?c.length:p.length}function y(){return p.length>n.perPage}return{mount:b,destroy:S,update:g,register:v,get:T,getIn:$,getAt:C,add:L,remove:A,forEach:k,filter:F,style:I,getLength:J,isEnough:y}}function Ec(e,t,n){var i=bt(e),o=i.on,s=i.bind,a=i.emit,u=t.Slides,c=t.Direction.resolve,m=t.Elements,p=m.root,b=m.track,w=m.list,S=u.getAt,g=u.style,v,T,$;function C(){L(),s(window,"resize load",lc(mt(a,ci))),o([Nt,Tt],L),o(ci,A)}function L(){v=n.direction===jo,Jt(p,"maxWidth",Hn(n.width)),Jt(b,c("paddingLeft"),k(!1)),Jt(b,c("paddingRight"),k(!0)),A(!0)}function A(Q){var z=Vt(p);(Q||T.width!==z.width||T.height!==z.height)&&(Jt(b,"height",F()),g(c("marginRight"),Hn(n.gap)),g("width",E()),g("height",J(),!0),T=z,a(Fo),$!==($=H())&&(gn(p,qs,$),a(ac,$)))}function k(Q){var z=n.padding,B=c(Q?"right":"left");return z&&Hn(z[B]||(ki(z)?0:z))||"0px"}function F(){var Q="";return v&&(Q=I(),Ti(Q,"height or heightRatio is missing."),Q="calc("+Q+" - "+k(!1)+" - "+k(!0)+")"),Q}function I(){return Hn(n.height||Vt(w).width*n.heightRatio)}function E(){return n.autoWidth?null:Hn(n.fixedWidth)||(v?"":y())}function J(){return Hn(n.fixedHeight)||(v?n.autoHeight?null:y():I())}function y(){var Q=Hn(n.gap);return"calc((100%"+(Q&&" + "+Q)+")/"+(n.perPage||1)+(Q&&" - "+Q)+")"}function _(){return Vt(w)[c("width")]}function W(Q,z){var B=S(Q||0);return B?Vt(B.slide)[c("width")]+(z?0:ue()):0}function G(Q,z){var B=S(Q);if(B){var Y=Vt(B.slide)[c("right")],oe=Vt(w)[c("left")];return jt(Y-oe)+(z?0:ue())}return 0}function te(Q){return G(e.length-1)-G(0)+W(0,Q)}function ue(){var Q=S(0);return Q&&parseFloat(Jt(Q.slide,c("marginRight")))||0}function X(Q){return parseFloat(Jt(b,c("padding"+(Q?"Right":"Left"))))||0}function H(){return e.is(Xi)||te(!0)>_()}return{mount:C,resize:A,listSize:_,slideSize:W,sliderSize:te,totalSize:G,getPadding:X,isOverflow:H}}var Ic=2;function Pc(e,t,n){var i=bt(e),o=i.on,s=t.Elements,a=t.Slides,u=t.Direction.resolve,c=[],m;function p(){o(Tt,b),o([Nt,ci],S),(m=T())&&(g(m),t.Layout.resize(!0))}function b(){w(),p()}function w(){Kn(c),bn(c),i.destroy()}function S(){var $=T();m!==$&&(m<$||!$)&&i.emit(Tt)}function g($){var C=a.get().slice(),L=C.length;if(L){for(;C.length<$;)xo(C,C);xo(C.slice(-$),C.slice(0,$)).forEach(function(A,k){var F=k<$,I=v(A.slide,k);F?Mr(I,C[0].slide):qi(s.list,I),xo(c,I),a.register(I,k-$+(F?0:L),A.index)})}}function v($,C){var L=$.cloneNode(!0);return on(L,n.classes.clone),L.id=e.root.id+"-clone"+Wr(C+1),L}function T(){var $=n.clones;if(!e.is(xi))$=0;else if(Vi($)){var C=n[u("fixedWidth")]&&t.Layout.slideSize(0),L=C&&Fi(Vt(s.track)[u("width")]/C);$=L||n[u("autoWidth")]&&e.length||n.perPage*Ic}return $}return{mount:p,destroy:w}}function kc(e,t,n){var i=bt(e),o=i.on,s=i.emit,a=e.state.set,u=t.Layout,c=u.slideSize,m=u.getPadding,p=u.totalSize,b=u.listSize,w=u.sliderSize,S=t.Direction,g=S.resolve,v=S.orient,T=t.Elements,$=T.list,C=T.track,L;function A(){L=t.Transition,o([Mn,Fo,Nt,Tt],k)}function k(){t.Controller.isBusy()||(t.Scroll.cancel(),I(e.index),t.Slides.update())}function F(B,Y,oe,ie){B!==Y&&Q(B>oe)&&(_(),E(y(te(),B>oe),!0)),a(vi),s(xn,Y,oe,B),L.start(Y,function(){a(li),s(bi,Y,oe,B),ie&&ie()})}function I(B){E(G(B,!0))}function E(B,Y){if(!e.is(Xi)){var oe=Y?B:J(B);Jt($,"transform","translate"+g("X")+"("+oe+"px)"),B!==oe&&s(Ms)}}function J(B){if(e.is(xi)){var Y=W(B),oe=Y>t.Controller.getEnd(),ie=Y<0;(ie||oe)&&(B=y(B,oe))}return B}function y(B,Y){var oe=B-H(Y),ie=w();return B-=v(ie*(Fi(jt(oe)/ie)||1))*(Y?1:-1),B}function _(){E(te(),!0),L.cancel()}function W(B){for(var Y=t.Slides.get(),oe=0,ie=1/0,O=0;O<Y.length;O++){var ce=Y[O].index,f=jt(G(ce,!0)-B);if(f<=ie)ie=f,oe=ce;else break}return oe}function G(B,Y){var oe=v(p(B-1)-X(B));return Y?ue(oe):oe}function te(){var B=g("left");return Vt($)[B]-Vt(C)[B]+v(m(!1))}function ue(B){return n.trimSpace&&e.is(di)&&(B=ni(B,0,v(w(!0)-b()))),B}function X(B){var Y=n.focus;return Y==="center"?(b()-c(B,!0))/2:+Y*c(B)||0}function H(B){return G(B?t.Controller.getEnd():0,!!n.trimSpace)}function Q(B){var Y=v(y(te(),B));return B?Y>=0:Y<=$[g("scrollWidth")]-Vt(C)[g("width")]}function z(B,Y){Y=Vi(Y)?te():Y;var oe=B!==!0&&v(Y)<v(H(!1)),ie=B!==!1&&v(Y)>v(H(!0));return oe||ie}return{mount:A,move:F,jump:I,translate:E,shift:y,cancel:_,toIndex:W,toPosition:G,getPosition:te,getLimit:H,exceededLimit:z,reposition:k}}function Rc(e,t,n){var i=bt(e),o=i.on,s=i.emit,a=t.Move,u=a.getPosition,c=a.getLimit,m=a.toPosition,p=t.Slides,b=p.isEnough,w=p.getLength,S=n.omitEnd,g=e.is(xi),v=e.is(di),T=mt(te,!1),$=mt(te,!0),C=n.start||0,L,A=C,k,F,I;function E(){J(),o([Nt,Tt,ko],J),o(Fo,y)}function J(){k=w(!0),F=n.perMove,I=n.perPage,L=Q();var f=ni(C,0,S?L:k-1);f!==C&&(C=f,a.reposition())}function y(){L!==Q()&&s(ko)}function _(f,de,be){if(!ce()){var fe=G(f),Re=H(fe);Re>-1&&(de||Re!==C)&&(oe(Re),a.move(fe,Re,A,be))}}function W(f,de,be,fe){t.Scroll.scroll(f,de,be,function(){var Re=H(a.toIndex(u()));oe(S?kn(Re,L):Re),fe&&fe()})}function G(f){var de=C;if(Pn(f)){var be=f.match(/([+\-<>])(\d+)?/)||[],fe=be[1],Re=be[2];fe==="+"||fe==="-"?de=ue(C+ +(""+fe+(+Re||1)),C):fe===">"?de=Re?z(+Re):T(!0):fe==="<"&&(de=$(!0))}else de=g?f:ni(f,0,L);return de}function te(f,de){var be=F||(O()?1:I),fe=ue(C+be*(f?-1:1),C,!(F||O()));return fe===-1&&v&&!vs(u(),c(!f),1)?f?0:L:de?fe:H(fe)}function ue(f,de,be){if(b()||O()){var fe=X(f);fe!==f&&(de=f,f=fe,be=!1),f<0||f>L?!F&&(wo(0,f,de,!0)||wo(L,de,f,!0))?f=z(B(f)):g?f=be?f<0?-(k%I||I):k:f:n.rewind?f=f<0?L:0:f=-1:be&&f!==de&&(f=z(B(de)+(f<de?-1:1)))}else f=-1;return f}function X(f){if(v&&n.trimSpace==="move"&&f!==C)for(var de=u();de===m(f,!0)&&wo(f,0,e.length-1,!n.rewind);)f<C?--f:++f;return f}function H(f){return g?(f+k)%k||0:f}function Q(){for(var f=k-(O()||g&&F?1:I);S&&f-- >0;)if(m(k-1,!0)!==m(f,!0)){f++;break}return ni(f,0,k-1)}function z(f){return ni(O()?f:I*f,0,L)}function B(f){return O()?kn(f,L):Po((f>=L?k-1:f)/I)}function Y(f){var de=a.toIndex(f);return v?ni(de,0,L):de}function oe(f){f!==C&&(A=C,C=f)}function ie(f){return f?A:C}function O(){return!Vi(n.focus)||n.isNavigation}function ce(){return e.state.is([vi,zi])&&!!n.waitForTransition}return{mount:E,go:_,scroll:W,getNext:T,getPrev:$,getAdjacent:te,getEnd:Q,setIndex:oe,getIndex:ie,toIndex:z,toPage:B,toDest:Y,hasFocus:O,isBusy:ce}}var Ac="http://www.w3.org/2000/svg",Mc="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",no=40;function _c(e,t,n){var i=bt(e),o=i.on,s=i.bind,a=i.emit,u=n.classes,c=n.i18n,m=t.Elements,p=t.Controller,b=m.arrows,w=m.track,S=b,g=m.prev,v=m.next,T,$,C={};function L(){k(),o(Nt,A)}function A(){F(),L()}function k(){var W=n.arrows;W&&!(g&&v)&&J(),g&&v&&(Mi(C,{prev:g,next:v}),_i(S,W?"":"none"),on(S,$=Kr+"--"+n.direction),W&&(I(),_(),Oe([g,v],Ui,w.id),a(Es,g,v)))}function F(){i.destroy(),hn(S,$),T?(Kn(b?[g,v]:S),g=v=null):rn([g,v],qr)}function I(){o([Mn,bi,Tt,Un,ko],_),s(v,"click",mt(E,">")),s(g,"click",mt(E,"<"))}function E(W){p.go(W,!0)}function J(){S=b||ai("div",u.arrows),g=y(!0),v=y(!1),T=!0,qi(S,[g,v]),!b&&Mr(S,w)}function y(W){var G='<button class="'+u.arrow+" "+(W?u.prev:u.next)+'" type="button"><svg xmlns="'+Ac+'" viewBox="0 0 '+no+" "+no+'" width="'+no+'" height="'+no+'" focusable="false"><path d="'+(n.arrowPath||Mc)+'" />';return fs(G)}function _(){if(g&&v){var W=e.index,G=p.getPrev(),te=p.getNext(),ue=G>-1&&W<G?c.last:c.prev,X=te>-1&&W>te?c.first:c.next;g.disabled=G<0,v.disabled=te<0,Oe(g,Dt,ue),Oe(v,Dt,X),a(Is,g,v,G,te)}}return{arrows:C,mount:L,destroy:F,update:_}}var Fc=Fr+"-interval";function Wc(e,t,n){var i=bt(e),o=i.on,s=i.bind,a=i.emit,u=No(n.interval,e.go.bind(e,">"),I),c=u.isPaused,m=t.Elements,p=t.Elements,b=p.root,w=p.toggle,S=n.autoplay,g,v,T=S==="pause";function $(){S&&(C(),w&&Oe(w,Ui,m.track.id),T||L(),F())}function C(){n.pauseOnHover&&s(b,"mouseenter mouseleave",function(J){g=J.type==="mouseenter",k()}),n.pauseOnFocus&&s(b,"focusin focusout",function(J){v=J.type==="focusin",k()}),w&&s(w,"click",function(){T?L():A(!0)}),o([xn,Wo,Tt],u.rewind),o(xn,E)}function L(){c()&&t.Slides.isEnough()&&(u.start(!n.resetProgress),v=g=T=!1,F(),a(Br))}function A(J){J===void 0&&(J=!0),T=!!J,F(),c()||(u.pause(),a(jr))}function k(){T||(g||v?A(!1):L())}function F(){w&&(gn(w,Gn,!T),Oe(w,Dt,n.i18n[T?"play":"pause"]))}function I(J){var y=m.bar;y&&Jt(y,"width",J*100+"%"),a(Rs,J)}function E(J){var y=t.Slides.getAt(J);u.set(y&&+Zt(y.slide,Fc)||n.interval)}return{mount:$,destroy:u.cancel,play:L,pause:A,isPaused:c}}function Nc(e,t,n){var i=bt(e),o=i.on;function s(){n.cover&&(o(zr,mt(u,!0)),o([Mn,Nt,Tt],mt(a,!0)))}function a(c){t.Slides.forEach(function(m){var p=Ki(m.container||m.slide,"img");p&&p.src&&u(c,p,m)})}function u(c,m,p){p.style("background",c?'center/cover no-repeat url("'+m.src+'")':"",!0),_i(m,c?"none":"")}return{mount:s,destroy:mt(a,!1)}}var Hc=10,Oc=600,Bc=.6,jc=1.5,zc=800;function Vc(e,t,n){var i=bt(e),o=i.on,s=i.emit,a=e.state.set,u=t.Move,c=u.getPosition,m=u.getLimit,p=u.exceededLimit,b=u.translate,w=e.is(di),S,g,v=1;function T(){o(xn,A),o([Nt,Tt],k)}function $(I,E,J,y,_){var W=c();if(A(),J&&(!w||!p())){var G=t.Layout.sliderSize(),te=xr(I)*G*Po(jt(I)/G)||0;I=u.toPosition(t.Controller.toDest(I%G))+te}var ue=vs(W,I,1);v=1,E=ue?0:E||Io(jt(I-W)/jc,zc),g=y,S=No(E,C,mt(L,W,I,_),1),a(zi),s(Wo),S.start()}function C(){a(li),g&&g(),s(Un)}function L(I,E,J,y){var _=c(),W=I+(E-I)*F(y),G=(W-_)*v;b(_+G),w&&!J&&p()&&(v*=Bc,jt(G)<Hc&&$(m(p(!0)),Oc,!1,g,!0))}function A(){S&&S.cancel()}function k(){S&&!S.isPaused()&&(A(),C())}function F(I){var E=n.easingFunc;return E?E(I):1-Math.pow(1-I,4)}return{mount:T,destroy:A,scroll:$,cancel:k}}var ii={passive:!1,capture:!0};function Dc(e,t,n){var i=bt(e),o=i.on,s=i.emit,a=i.bind,u=i.unbind,c=e.state,m=t.Move,p=t.Scroll,b=t.Controller,w=t.Elements.track,S=t.Media.reduce,g=t.Direction,v=g.resolve,T=g.orient,$=m.getPosition,C=m.exceededLimit,L,A,k,F,I,E=!1,J,y,_;function W(){a(w,ir,vr,ii),a(w,or,vr,ii),a(w,Ks,te,ii),a(w,"click",H,{capture:!0}),a(w,"dragstart",mn),o([Mn,Nt],G)}function G(){var U=n.drag;ge(!U),F=U==="free"}function te(U){if(J=!1,!y){var V=Re(U);fe(U.target)&&(V||!U.button)&&(b.isBusy()?mn(U,!0):(_=V?w:window,I=c.is([vi,zi]),k=null,a(_,ir,ue,ii),a(_,or,X,ii),m.cancel(),p.cancel(),Q(U)))}}function ue(U){if(c.is(bo)||(c.set(bo),s(Cs)),U.cancelable)if(I){m.translate(L+be(O(U)));var V=ce(U)>ya,j=E!==(E=C());(V||j)&&Q(U),J=!0,s(Ts),mn(U)}else Y(U)&&(I=B(U),mn(U))}function X(U){c.is(bo)&&(c.set(li),s(Ls)),I&&(z(U),mn(U)),u(_,ir,ue),u(_,or,X),I=!1}function H(U){!y&&J&&mn(U,!0)}function Q(U){k=A,A=U,L=$()}function z(U){var V=oe(U),j=ie(V),he=n.rewind&&n.rewindByDrag;S(!1),F?b.scroll(j,0,n.snap):e.is(Xi)?b.go(T(xr(V))<0?he?"<":"-":he?">":"+"):e.is(di)&&E&&he?b.go(C(!0)?">":"<"):b.go(b.toDest(j),!0),S(!0)}function B(U){var V=n.dragMinThreshold,j=ki(V),he=j&&V.mouse||0,re=(j?V.touch:+V)||10;return jt(O(U))>(Re(U)?re:he)}function Y(U){return jt(O(U))>jt(O(U,!0))}function oe(U){if(e.is(xi)||!E){var V=ce(U);if(V&&V<ya)return O(U)/V}return 0}function ie(U){return $()+xr(U)*kn(jt(U)*(n.flickPower||600),F?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function O(U,V){return de(U,V)-de(f(U),V)}function ce(U){return br(U)-br(f(U))}function f(U){return A===U&&k||A}function de(U,V){return(Re(U)?U.changedTouches[0]:U)["page"+v(V?"Y":"X")]}function be(U){return U/(E&&e.is(di)?Sc:1)}function fe(U){var V=n.noDrag;return!Ri(U,"."+js+", ."+Vo)&&(!V||!Ri(U,V))}function Re(U){return typeof TouchEvent<"u"&&U instanceof TouchEvent}function Z(){return I}function ge(U){y=U}return{mount:W,disable:ge,isDragging:Z}}var qc={Spacebar:" ",Right:Bo,Left:Oo,Up:_s,Down:Fs};function Gr(e){return e=Pn(e)?e:e.key,qc[e]||e}var va="keydown";function Kc(e,t,n){var i=bt(e),o=i.on,s=i.bind,a=i.unbind,u=e.root,c=t.Direction.resolve,m,p;function b(){w(),o(Nt,S),o(Nt,w),o(xn,v)}function w(){var $=n.keyboard;$&&(m=$==="global"?window:u,s(m,va,T))}function S(){a(m,va)}function g($){p=$}function v(){var $=p;p=!0,us(function(){p=$})}function T($){if(!p){var C=Gr($);C===c(Oo)?e.go("<"):C===c(Bo)&&e.go(">")}}return{mount:b,destroy:S,disable:g}}var Li=Fr+"-lazy",$o=Li+"-srcset",Gc="["+Li+"], ["+$o+"]";function Uc(e,t,n){var i=bt(e),o=i.on,s=i.off,a=i.bind,u=i.emit,c=n.lazyLoad==="sequential",m=[bi,Un],p=[];function b(){n.lazyLoad&&(w(),o(Tt,w))}function w(){bn(p),S(),c?$():(s(m),o(m,g),g())}function S(){t.Slides.forEach(function(C){_r(C.slide,Gc).forEach(function(L){var A=Zt(L,Li),k=Zt(L,$o);if(A!==L.src||k!==L.srcset){var F=n.classes.spinner,I=L.parentElement,E=Ki(I,"."+F)||ai("span",F,I);p.push([L,C,E]),L.src||_i(L,"none")}})})}function g(){p=p.filter(function(C){var L=n.perPage*((n.preloadPages||1)+1)-1;return C[1].isWithin(e.index,L)?v(C):!0}),p.length||s(m)}function v(C){var L=C[0];on(C[1].slide,Cr),a(L,"load error",mt(T,C)),Oe(L,"src",Zt(L,Li)),Oe(L,"srcset",Zt(L,$o)),rn(L,Li),rn(L,$o)}function T(C,L){var A=C[0],k=C[1];hn(k.slide,Cr),L.type!=="error"&&(Kn(C[2]),_i(A,""),u(zr,A,k),u(ci)),c&&$()}function $(){p.length&&v(p.shift())}return{mount:b,destroy:mt(bn,p),check:g}}function Xc(e,t,n){var i=bt(e),o=i.on,s=i.emit,a=i.bind,u=t.Slides,c=t.Elements,m=t.Controller,p=m.hasFocus,b=m.getIndex,w=m.go,S=t.Direction.resolve,g=c.pagination,v=[],T,$;function C(){L(),o([Nt,Tt,ko],C);var y=n.pagination;g&&_i(g,y?"":"none"),y&&(o([xn,Wo,Un],J),A(),J(),s(Ps,{list:T,items:v},E(e.index)))}function L(){T&&(Kn(g?An(T.children):T),hn(T,$),bn(v),T=null),i.destroy()}function A(){var y=e.length,_=n.classes,W=n.i18n,G=n.perPage,te=p()?m.getEnd()+1:Fi(y/G);T=g||ai("ul",_.pagination,c.track.parentElement),on(T,$=Do+"--"+I()),Oe(T,fn,"tablist"),Oe(T,Dt,W.select),Oe(T,Dr,I()===jo?"vertical":"");for(var ue=0;ue<te;ue++){var X=ai("li",null,T),H=ai("button",{class:_.page,type:"button"},X),Q=u.getIn(ue).map(function(B){return B.slide.id}),z=!p()&&G>1?W.pageX:W.slideX;a(H,"click",mt(k,ue)),n.paginationKeyboard&&a(H,"keydown",mt(F,ue)),Oe(X,fn,"presentation"),Oe(H,fn,"tab"),Oe(H,Ui,Q.join(" ")),Oe(H,Dt,wr(z,ue+1)),Oe(H,si,-1),v.push({li:X,button:H,page:ue})}}function k(y){w(">"+y,!0)}function F(y,_){var W=v.length,G=Gr(_),te=I(),ue=-1;G===S(Bo,!1,te)?ue=++y%W:G===S(Oo,!1,te)?ue=(--y+W)%W:G==="Home"?ue=0:G==="End"&&(ue=W-1);var X=v[ue];X&&(hs(X.button),w(">"+ue),mn(_,!0))}function I(){return n.paginationDirection||n.direction}function E(y){return v[m.toPage(y)]}function J(){var y=E(b(!0)),_=E(b());if(y){var W=y.button;hn(W,Gn),rn(W,pa),Oe(W,si,-1)}if(_){var G=_.button;on(G,Gn),Oe(G,pa,!0),Oe(G,si,"")}s(ks,{list:T,items:v},y,_)}return{items:v,mount:C,destroy:L,getAt:E,update:J}}var Yc=[" ","Enter"];function Jc(e,t,n){var i=n.isNavigation,o=n.slideFocus,s=[];function a(){e.splides.forEach(function(g){g.isParent||(m(e,g.splide),m(g.splide,e))}),i&&p()}function u(){s.forEach(function(g){g.destroy()}),bn(s)}function c(){u(),a()}function m(g,v){var T=bt(g);T.on(xn,function($,C,L){v.go(v.is(xi)?L:$)}),s.push(T)}function p(){var g=bt(e),v=g.on;v(Nr,w),v(As,S),v([Mn,Nt],b),s.push(g),g.emit(Or,e.splides)}function b(){Oe(t.Elements.list,Dr,n.direction===jo?"vertical":"")}function w(g){e.go(g.index)}function S(g,v){Ar(Yc,Gr(v))&&(w(g),mn(v))}return{setup:mt(t.Media.set,{slideFocus:Vi(o)?i:o},!0),mount:a,destroy:u,remount:c}}function Zc(e,t,n){var i=bt(e),o=i.bind,s=0;function a(){n.wheel&&o(t.Elements.track,"wheel",u,ii)}function u(m){if(m.cancelable){var p=m.deltaY,b=p<0,w=br(m),S=n.wheelMinThreshold||0,g=n.wheelSleep||0;jt(p)>S&&w-s>g&&(e.go(b?"<":">"),s=w),c(b)&&mn(m)}}function c(m){return!n.releaseWheel||e.state.is(vi)||t.Controller.getAdjacent(m)!==-1}return{mount:a}}var Qc=90;function ed(e,t,n){var i=bt(e),o=i.on,s=t.Elements.track,a=n.live&&!n.isNavigation,u=ai("span",vc),c=No(Qc,mt(p,!1));function m(){a&&(w(!t.Autoplay.isPaused()),Oe(s,ha,!0),u.textContent="…",o(Br,mt(w,!0)),o(jr,mt(w,!1)),o([bi,Un],mt(p,!0)))}function p(S){Oe(s,ga,S),S?(qi(s,u),c.start()):(Kn(u),c.cancel())}function b(){rn(s,[ma,ha,ga]),Kn(u)}function w(S){a&&Oe(s,ma,S?"off":"polite")}return{mount:m,disable:w,destroy:b}}var td=Object.freeze({__proto__:null,Media:cc,Direction:dc,Elements:Cc,Slides:Lc,Layout:Ec,Clones:Pc,Move:kc,Controller:Rc,Arrows:_c,Autoplay:Wc,Cover:Nc,Scroll:Vc,Drag:Dc,Keyboard:Kc,LazyLoad:Uc,Pagination:Xc,Sync:Jc,Wheel:Zc,Live:ed}),nd={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"},id={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:wc,i18n:nd,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function od(e,t,n){var i=t.Slides;function o(){bt(e).on([Mn,Tt],s)}function s(){i.forEach(function(u){u.style("transform","translateX(-"+100*u.index+"%)")})}function a(u,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),us(c)}return{mount:o,start:a,cancel:vr}}function rd(e,t,n){var i=t.Move,o=t.Controller,s=t.Scroll,a=t.Elements.list,u=mt(Jt,a,"transition"),c;function m(){bt(e).bind(a,"transitionend",function(S){S.target===a&&c&&(b(),c())})}function p(S,g){var v=i.toPosition(S,!0),T=i.getPosition(),$=w(S);jt(v-T)>=1&&$>=1?n.useScroll?s.scroll(v,$,!1,g):(u("transform "+$+"ms "+n.easing),i.translate(v,!0),c=g):(i.jump(S),g())}function b(){u(""),s.cancel()}function w(S){var g=n.rewindSpeed;if(e.is(di)&&g){var v=o.getIndex(!0),T=o.getEnd();if(v===0&&S>=T||v>=T&&S===0)return g}return n.speed}return{mount:m,start:p,cancel:b}}var ad=(function(){function e(n,i){this.event=bt(),this.Components={},this.state=sc(ri),this.splides=[],this._o={},this._E={};var o=Pn(n)?ys(document,n):n;Ti(o,o+" is invalid."),this.root=o,i=In({label:Zt(o,Dt)||"",labelledby:Zt(o,Vr)||""},id,e.defaults,i||{});try{In(i,JSON.parse(Zt(o,Fr)))}catch{Ti(!1,"Invalid JSON")}this._o=Object.create(In({},i))}var t=e.prototype;return t.mount=function(i,o){var s=this,a=this.state,u=this.Components;Ti(a.is([ri,Eo]),"Already mounted!"),a.set(ri),this._C=u,this._T=o||this._T||(this.is(Xi)?od:rd),this._E=i||this._E;var c=Mi({},td,this._E,{Transition:this._T});return qn(c,function(m,p){var b=m(s,u,s._o);u[p]=b,b.setup&&b.setup()}),qn(u,function(m){m.mount&&m.mount()}),this.emit(Mn),on(this.root,bc),a.set(li),this.emit($r),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(li)&&(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(An(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(Tt),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,s=this.state;return s.is(ri)?bt(this).on($r,this.destroy.bind(this,i)):(qn(this._C,function(a){a.destroy&&a.destroy(i)},!0),o.emit(Hr),o.destroy(),i&&bn(this.splides),s.set(Eo)),this},nc(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})(),Ur=ad;Ur.defaults={};Ur.STATES=oc;var ba=[[Mn,"onMounted"],[$r,"onReady"],[xn,"onMove"],[bi,"onMoved"],[Nr,"onClick"],[xs,"onActive"],[ws,"onInactive"],[$s,"onVisible"],[Ss,"onHidden"],[Tt,"onRefresh"],[Nt,"onUpdated"],[ci,"onResize"],[Fo,"onResized"],[Cs,"onDrag"],[Ts,"onDragging"],[Ls,"onDragged"],[Wo,"onScroll"],[Un,"onScrolled"],[Hr,"onDestroy"],[Es,"onArrowsMounted"],[Is,"onArrowsUpdated"],[Ps,"onPaginationMounted"],[ks,"onPaginationUpdated"],[Or,"onNavigationMounted"],[Br,"onAutoplayPlay"],[Rs,"onAutoplayPlaying"],[jr,"onAutoplayPause"],[zr,"onLazyLoadLoaded"]];function Xr(...e){return e.filter(Boolean).join(" ")}function Ro(e){return e!==null&&typeof e=="object"}function Tr(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!Tr(n,t[i]));if(Ro(e)&&Ro(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Tr(e[o],t[o]))}return e===t}function sd(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function ld(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 Lr(e,t){const n=e;return ld(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Ro(i)?n[o]=Lr(Ro(n[o])?n[o]:{},i):n[o]=i}),n}var cd=({children:e,className:t,...n})=>l.createElement("div",{className:Xr("splide__track",t),...n},l.createElement("ul",{className:"splide__list"},e)),Yr=class extends l.Component{constructor(){super(...arguments),this.splideRef=l.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new Ur(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Lr({},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&&!Tr(this.options,e)&&(this.splide.options=e,this.options=Lr({},e));const t=this.getSlides();sd(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){ba.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 l.createElement(t,{className:Xr("splide",e),ref:this.splideRef,...this.omit(o,["options",...ba.map(s=>s[1])])},n?l.createElement(cd,null,i):i)}},Jr=({children:e,className:t,...n})=>l.createElement("li",{className:Xr("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),l=require("react"),Je=require("classnames"),I=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Bi=require("react-dom");function ll(e){return e.type==="object"&&e.version===1}const cl="ControlSlider-module__wrapper___sHEkd",dl="ControlSlider-module__hoverArrow___A-dOH",ul="ControlSlider-module__sliderItem___QQSkR",pl="ControlSlider-module__sliderImage___9hRl-",ml="ControlSlider-module__arrow___05ghY",gl="ControlSlider-module__arrowVertical___tBfVN",hl="ControlSlider-module__nextArrow___-30Yc",fl="ControlSlider-module__arrowInner___aEra3",yl="ControlSlider-module__arrowIcon___S4ztF",vl="ControlSlider-module__arrowImg___2dwJW",bl="ControlSlider-module__mirror___brd6U",xl="ControlSlider-module__pagination___bicLF",wl="ControlSlider-module__paginationInner___bT-P-",$l="ControlSlider-module__paginationVertical___zYqKw",Sl="ControlSlider-module__paginationItem___nTRbk",Cl="ControlSlider-module__dot___p1Qun",Tl="ControlSlider-module__activeDot___LHFaj",Ll="ControlSlider-module__paginationInsideBottom___R3FWn",El="ControlSlider-module__paginationInsideTop___V-qb-",Pl="ControlSlider-module__paginationOutsideBottom___14w8D",Il="ControlSlider-module__paginationOutsideTop___SCLqB",Rl="ControlSlider-module__paginationInsideLeft___yOBRZ",Ml="ControlSlider-module__paginationInsideRight___Rtt3o",Al="ControlSlider-module__paginationOutsideLeft___lahaw",kl="ControlSlider-module__paginationOutsideRight___EtuQa",_l="ControlSlider-module__imgWrapper___UjEgB",Fl="ControlSlider-module__captionBlock___dJ6-j",Wl="ControlSlider-module__captionTextWrapper___HFlpf",Nl="ControlSlider-module__captionText___uGBVc",Hl="ControlSlider-module__active___WZK4G",Ol="ControlSlider-module__withPointerEvents___t-18M",Bl="ControlSlider-module__topLeftAlignment___zjnGM",jl="ControlSlider-module__topCenterAlignment___gD1xW",zl="ControlSlider-module__topRightAlignment___NMapS",Vl="ControlSlider-module__middleLeftAlignment___OnUrY",Dl="ControlSlider-module__middleCenterAlignment___Tdkl0",ql="ControlSlider-module__middleRightAlignment___wEbfX",Kl="ControlSlider-module__bottomLeftAlignment___cTP2-",Gl="ControlSlider-module__bottomCenterAlignment___c54fB",Ul="ControlSlider-module__bottomRightAlignment___kEwrz",Xl="ControlSlider-module__clickOverlay___DZA28",Yl="ControlSlider-module__contain___pLyq7",Jl="ControlSlider-module__cover___KdDat",Pe={wrapper:cl,hoverArrow:dl,sliderItem:ul,sliderImage:pl,arrow:ml,arrowVertical:gl,nextArrow:hl,arrowInner:fl,arrowIcon:yl,arrowImg:vl,mirror:bl,pagination:xl,paginationInner:wl,paginationVertical:$l,paginationItem:Sl,dot:Cl,activeDot:Tl,paginationInsideBottom:Ll,paginationInsideTop:El,paginationOutsideBottom:Pl,paginationOutsideTop:Il,paginationInsideLeft:Rl,paginationInsideRight:Ml,paginationOutsideLeft:Al,paginationOutsideRight:kl,imgWrapper:_l,captionBlock:Fl,captionTextWrapper:Wl,captionText:Nl,active:Hl,withPointerEvents:Ol,topLeftAlignment:Bl,topCenterAlignment:jl,topRightAlignment:zl,middleLeftAlignment:Vl,middleCenterAlignment:Dl,middleRightAlignment:ql,bottomLeftAlignment:Kl,bottomCenterAlignment:Gl,bottomRightAlignment:Ul,clickOverlay:Xl,contain:Yl,cover:Jl};function Zl(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 Ql(e,t,n){return t&&Zl(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var ra="(prefers-reduced-motion: reduce)",ri=1,ec=2,li=3,vi=4,ji=5,vo=6,Lo=7,tc={CREATED:ri,MOUNTED:ec,IDLE:li,MOVING:vi,SCROLLING:ji,DRAGGING:vo,DESTROYED:Lo};function bn(e){e.length=0}function An(e,t,n){return Array.prototype.slice.call(e,t,n)}function mt(e){return e.bind.apply(e,[null].concat(An(arguments,1)))}var ls=setTimeout,yr=function(){};function aa(e){return requestAnimationFrame(e)}function ko(e,t){return typeof t===e}function Ii(e){return!Rr(e)&&ko("object",e)}var Ir=Array.isArray,cs=mt(ko,"function"),In=mt(ko,"string"),zi=mt(ko,"undefined");function Rr(e){return e===null}function ds(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Vi(e){return Ir(e)?e:[e]}function Gt(e,t){Vi(e).forEach(t)}function Mr(e,t){return e.indexOf(t)>-1}function bo(e,t){return e.push.apply(e,Vi(t)),e}function gn(e,t,n){e&&Gt(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function on(e,t){gn(e,In(t)?t.split(" "):t,!0)}function Di(e,t){Gt(t,e.appendChild.bind(e))}function Ar(e,t){Gt(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function Ri(e,t){return ds(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function us(e,t){var n=e?An(e.children):[];return t?n.filter(function(i){return Ri(i,t)}):n}function qi(e,t){return t?us(e,t)[0]:e.firstElementChild}var Mi=Object.keys;function qn(e,t,n){return e&&(n?Mi(e).reverse():Mi(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function Ai(e){return An(arguments,1).forEach(function(t){qn(t,function(n,i){e[i]=t[i]})}),e}function Pn(e){return An(arguments,1).forEach(function(t){qn(t,function(n,i){Ir(n)?e[i]=n.slice():Ii(n)?e[i]=Pn({},Ii(e[i])?e[i]:{},n):e[i]=n})}),e}function sa(e,t){Gt(t||Mi(e),function(n){delete e[n]})}function rn(e,t){Gt(e,function(n){Gt(t,function(i){n&&n.removeAttribute(i)})})}function Ne(e,t,n){Ii(t)?qn(t,function(i,o){Ne(e,o,i)}):Gt(e,function(i){Rr(n)||n===""?rn(i,t):i.setAttribute(t,String(n))})}function ai(e,t,n){var i=document.createElement(e);return t&&(In(t)?on(i,t):Ne(i,t)),n&&Di(n,i),i}function Jt(e,t,n){if(zi(n))return getComputedStyle(e)[t];Rr(n)||(e.style[t]=""+n)}function ki(e,t){Jt(e,"display",t)}function ps(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Zt(e,t){return e.getAttribute(t)}function la(e,t){return e&&e.classList.contains(t)}function Vt(e){return e.getBoundingClientRect()}function Kn(e){Gt(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function ms(e){return qi(new DOMParser().parseFromString(e,"text/html").body)}function mn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function gs(e,t){return e&&e.querySelector(t)}function kr(e,t){return t?An(e.querySelectorAll(t)):[]}function hn(e,t){gn(e,t,!1)}function vr(e){return e.timeStamp}function Hn(e){return In(e)?e:e?e+"px":""}var Ki="splide",_r="data-"+Ki;function Ci(e,t){if(!e)throw new Error("["+Ki+"] "+(t||""))}var Rn=Math.min,Eo=Math.max,Po=Math.floor,_i=Math.ceil,jt=Math.abs;function hs(e,t,n){return jt(e-t)<n}function xo(e,t,n,i){var o=Rn(t,n),s=Eo(t,n);return i?o<e&&e<s:o<=e&&e<=s}function ni(e,t,n){var i=Rn(t,n),o=Eo(t,n);return Rn(Eo(i,e),o)}function br(e){return+(e>0)-+(e<0)}function xr(e,t){return Gt(t,function(n){e=e.replace("%s",""+n)}),e}function Fr(e){return e<10?"0"+e:""+e}var ca={};function nc(e){return""+e+Fr(ca[e]=(ca[e]||0)+1)}function fs(){var e=[];function t(a,u,c,m){o(a,u,function(p,P,x){var $="addEventListener"in p,g=$?p.removeEventListener.bind(p,P,c,m):p.removeListener.bind(p,c);$?p.addEventListener(P,c,m):p.addListener(c),e.push([p,P,x,c,g])})}function n(a,u,c){o(a,u,function(m,p,P){e=e.filter(function(x){return x[0]===m&&x[1]===p&&x[2]===P&&(!c||x[3]===c)?(x[4](),!1):!0})})}function i(a,u,c){var m,p=!0;return typeof CustomEvent=="function"?m=new CustomEvent(u,{bubbles:p,detail:c}):(m=document.createEvent("CustomEvent"),m.initCustomEvent(u,p,!1,c)),a.dispatchEvent(m),m}function o(a,u,c){Gt(a,function(m){m&&Gt(u,function(p){p.split(" ").forEach(function(P){var x=P.split(".");c(m,x[0],x[1])})})})}function s(){e.forEach(function(a){a[4]()}),bn(e)}return{bind:t,unbind:n,dispatch:i,destroy:s}}var kn="mounted",wr="ready",xn="move",bi="moved",Wr="click",ys="active",vs="inactive",bs="visible",xs="hidden",Tt="refresh",Nt="updated",ci="resize",_o="resized",ws="drag",$s="dragging",Ss="dragged",Fo="scroll",Un="scrolled",ic="overflow",Nr="destroy",Cs="arrows:mounted",Ts="arrows:updated",Ls="pagination:mounted",Es="pagination:updated",Hr="navigation:mounted",Or="autoplay:play",Ps="autoplay:playing",Br="autoplay:pause",jr="lazyload:loaded",Is="sk",Rs="sh",Io="ei";function bt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=fs();function i(s,a){n.bind(t,Vi(s).join(" "),function(u){a.apply(a,Ir(u.detail)?u.detail:[])})}function o(s){n.dispatch(t,s,An(arguments,1))}return e&&e.event.on(Nr,n.destroy),Ai(n,{bus:t,on:i,off:mt(n.unbind,t),emit:o})}function Wo(e,t,n,i){var o=Date.now,s,a=0,u,c=!0,m=0;function p(){if(!c){if(a=e?Rn((o()-s)/e,1):1,n&&n(a),a>=1&&(t(),s=o(),i&&++m>=i))return x();u=aa(p)}}function P(w){w||g(),s=o()-(w?a*e:0),c=!1,u=aa(p)}function x(){c=!0}function $(){s=o(),a=0,n&&n(a)}function g(){u&&cancelAnimationFrame(u),a=0,u=0,c=!0}function y(w){e=w}function C(){return c}return{start:P,rewind:$,pause:x,cancel:g,set:y,isPaused:C}}function oc(e){var t=e;function n(o){t=o}function i(o){return Mr(Vi(o),t)}return{set:n,is:i}}function rc(e,t){var n=Wo(0,e,null,1);return function(){n.isPaused()&&n.start()}}function ac(e,t,n){var i=e.state,o=n.breakpoints||{},s=n.reducedMotion||{},a=fs(),u=[];function c(){var g=n.mediaQuery==="min";Mi(o).sort(function(y,C){return g?+y-+C:+C-+y}).forEach(function(y){p(o[y],"("+(g?"min":"max")+"-width:"+y+"px)")}),p(s,ra),P()}function m(g){g&&a.destroy()}function p(g,y){var C=matchMedia(y);a.bind(C,"change",P),u.push([g,C])}function P(){var g=i.is(Lo),y=n.direction,C=u.reduce(function(w,E){return Pn(w,E[1].matches?E[0]:{})},{});sa(n),$(C),n.destroy?e.destroy(n.destroy==="completely"):g?(m(!0),e.mount()):y!==n.direction&&e.refresh()}function x(g){matchMedia(ra).matches&&(g?Pn(n,s):sa(n,Mi(s)))}function $(g,y,C){Pn(n,g),y&&Pn(Object.getPrototypeOf(n),g),(C||!i.is(ri))&&e.emit(Nt,n)}return{setup:c,destroy:m,reduce:x,set:$}}var No="Arrow",Ho=No+"Left",Oo=No+"Right",Ms=No+"Up",As=No+"Down",da="rtl",Bo="ttb",er={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Ms,Oo],ArrowRight:[As,Ho]};function sc(e,t,n){function i(s,a,u){u=u||n.direction;var c=u===da&&!a?1:u===Bo?0:-1;return er[s]&&er[s][c]||s.replace(/width|left|right/i,function(m,p){var P=er[m.toLowerCase()][c]||m;return p>0?P.charAt(0).toUpperCase()+P.slice(1):P})}function o(s){return s*(n.direction===da?1:-1)}return{resolve:i,orient:o}}var fn="role",si="tabindex",lc="disabled",en="aria-",Gi=en+"controls",ks=en+"current",ua=en+"selected",Dt=en+"label",zr=en+"labelledby",_s=en+"hidden",Vr=en+"orientation",Fi=en+"roledescription",pa=en+"live",ma=en+"busy",ga=en+"atomic",Dr=[fn,si,lc,Gi,ks,Dt,zr,_s,Vr,Fi],an=Ki+"__",_n="is-",tr=Ki,ha=an+"track",cc=an+"list",jo=an+"slide",Fs=jo+"--clone",dc=jo+"__container",qr=an+"arrows",zo=an+"arrow",Ws=zo+"--prev",Ns=zo+"--next",Vo=an+"pagination",Hs=Vo+"__page",uc=an+"progress",pc=uc+"__bar",mc=an+"toggle",gc=an+"spinner",hc=an+"sr",fc=_n+"initialized",Gn=_n+"active",Os=_n+"prev",Bs=_n+"next",$r=_n+"visible",Sr=_n+"loading",js=_n+"focus-in",zs=_n+"overflow",yc=[Gn,$r,Os,Bs,Sr,js,zs],vc={slide:jo,clone:Fs,arrows:qr,arrow:zo,prev:Ws,next:Ns,pagination:Vo,page:Hs,spinner:gc};function bc(e,t){if(cs(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!Ri(n,t);)n=n.parentElement;return n}var xc=5,fa=200,Vs="touchstart mousedown",nr="touchmove mousemove",ir="touchend touchcancel mouseup click";function wc(e,t,n){var i=bt(e),o=i.on,s=i.bind,a=e.root,u=n.i18n,c={},m=[],p=[],P=[],x,$,g;function y(){T(),F(),E()}function C(){o(Tt,w),o(Tt,y),o(Nt,E),s(document,Vs+" keydown",function(_){g=_.type==="keydown"},{capture:!0}),s(a,"focusin",function(){gn(a,js,!!g)})}function w(_){var L=Dr.concat("style");bn(m),hn(a,p),hn(x,P),rn([x,$],L),rn(a,_?L:["style",Fi])}function E(){hn(a,p),hn(x,P),p=W(tr),P=W(ha),on(a,p),on(x,P),Ne(a,Dt,n.label),Ne(a,zr,n.labelledby)}function T(){x=M("."+ha),$=qi(x,"."+cc),Ci(x&&$,"A track/list element is missing."),bo(m,us($,"."+jo+":not(."+Fs+")")),qn({arrows:qr,pagination:Vo,prev:Ws,next:Ns,bar:pc,toggle:mc},function(_,L){c[L]=M("."+_)}),Ai(c,{root:a,track:x,list:$,slides:m})}function F(){var _=a.id||nc(Ki),L=n.role;a.id=_,x.id=x.id||_+"-track",$.id=$.id||_+"-list",!Zt(a,fn)&&a.tagName!=="SECTION"&&L&&Ne(a,fn,L),Ne(a,Fi,u.carousel),Ne($,fn,"presentation")}function M(_){var L=gs(a,_);return L&&bc(L,"."+tr)===a?L:void 0}function W(_){return[_+"--"+n.type,_+"--"+n.direction,n.drag&&_+"--draggable",n.isNavigation&&_+"--nav",_===tr&&Gn]}return Ai(c,{setup:y,mount:C,destroy:w})}var di="slide",xi="loop",Ui="fade";function $c(e,t,n,i){var o=bt(e),s=o.on,a=o.emit,u=o.bind,c=e.Components,m=e.root,p=e.options,P=p.isNavigation,x=p.updateOnMove,$=p.i18n,g=p.pagination,y=p.slideFocus,C=c.Direction.resolve,w=Zt(i,"style"),E=Zt(i,Dt),T=n>-1,F=qi(i,"."+dc),M;function W(){T||(i.id=m.id+"-slide"+Fr(t+1),Ne(i,fn,g?"tabpanel":"group"),Ne(i,Fi,$.slide),Ne(i,Dt,E||xr($.slideLabel,[t+1,e.length]))),_()}function _(){u(i,"click",mt(a,Wr,Z)),u(i,"keydown",mt(a,Is,Z)),s([bi,Rs,Un],R),s(Hr,U),x&&s(xn,v)}function L(){M=!0,o.destroy(),hn(i,yc),rn(i,Dr),Ne(i,"style",w),Ne(i,Dt,E||"")}function U(){var q=e.splides.map(function(O){var Y=O.splide.Components.Slides.getAt(t);return Y?Y.slide.id:""}).join(" ");Ne(i,Dt,xr($.slideX,(T?n:t)+1)),Ne(i,Gi,q),Ne(i,fn,y?"button":""),y&&rn(i,Fi)}function v(){M||R()}function R(){if(!M){var q=e.index;N(),D(),gn(i,Os,t===q-1),gn(i,Bs,t===q+1)}}function N(){var q=pe();q!==la(i,Gn)&&(gn(i,Gn,q),Ne(i,ks,P&&q||""),a(q?ys:vs,Z))}function D(){var q=K(),O=!q&&(!pe()||T);if(e.state.is([vi,ji])||Ne(i,_s,O||""),Ne(kr(i,p.focusableNodes||""),si,O?-1:""),y&&Ne(i,si,O?-1:0),q!==la(i,$r)&&(gn(i,$r,q),a(q?bs:xs,Z)),!q&&document.activeElement===i){var Y=c.Slides.getAt(e.index);Y&&ps(Y.slide)}}function ne(q,O,Y){Jt(Y&&F||i,q,O)}function pe(){var q=e.index;return q===t||p.cloneStatus&&q===n}function K(){if(e.is(Ui))return pe();var q=Vt(c.Elements.track),O=Vt(i),Y=C("left",!0),ae=C("right",!0);return Po(q[Y])<=_i(O[Y])&&Po(O[ae])<=_i(q[ae])}function B(q,O){var Y=jt(q-t);return!T&&(p.rewind||e.is(xi))&&(Y=Rn(Y,e.length-Y)),Y<=O}var Z={index:t,slideIndex:n,slide:i,container:F,isClone:T,mount:W,destroy:L,update:R,style:ne,isWithin:B};return Z}function Sc(e,t,n){var i=bt(e),o=i.on,s=i.emit,a=i.bind,u=t.Elements,c=u.slides,m=u.list,p=[];function P(){x(),o(Tt,$),o(Tt,x)}function x(){c.forEach(function(R,N){y(R,N,-1)})}function $(){M(function(R){R.destroy()}),bn(p)}function g(){M(function(R){R.update()})}function y(R,N,D){var ne=$c(e,N,D,R);ne.mount(),p.push(ne),p.sort(function(pe,K){return pe.index-K.index})}function C(R){return R?W(function(N){return!N.isClone}):p}function w(R){var N=t.Controller,D=N.toIndex(R),ne=N.hasFocus()?1:n.perPage;return W(function(pe){return xo(pe.index,D,D+ne-1)})}function E(R){return W(R)[0]}function T(R,N){Gt(R,function(D){if(In(D)&&(D=ms(D)),ds(D)){var ne=c[N];ne?Ar(D,ne):Di(m,D),on(D,n.classes.slide),L(D,mt(s,ci))}}),s(Tt)}function F(R){Kn(W(R).map(function(N){return N.slide})),s(Tt)}function M(R,N){C(N).forEach(R)}function W(R){return p.filter(cs(R)?R:function(N){return In(R)?Ri(N.slide,R):Mr(Vi(R),N.index)})}function _(R,N,D){M(function(ne){ne.style(R,N,D)})}function L(R,N){var D=kr(R,"img"),ne=D.length;ne?D.forEach(function(pe){a(pe,"load error",function(){--ne||N()})}):N()}function U(R){return R?c.length:p.length}function v(){return p.length>n.perPage}return{mount:P,destroy:$,update:g,register:y,get:C,getIn:w,getAt:E,add:T,remove:F,forEach:M,filter:W,style:_,getLength:U,isEnough:v}}function Cc(e,t,n){var i=bt(e),o=i.on,s=i.bind,a=i.emit,u=t.Slides,c=t.Direction.resolve,m=t.Elements,p=m.root,P=m.track,x=m.list,$=u.getAt,g=u.style,y,C,w;function E(){T(),s(window,"resize load",rc(mt(a,ci))),o([Nt,Tt],T),o(ci,F)}function T(){y=n.direction===Bo,Jt(p,"maxWidth",Hn(n.width)),Jt(P,c("paddingLeft"),M(!1)),Jt(P,c("paddingRight"),M(!0)),F(!0)}function F(Z){var q=Vt(p);(Z||C.width!==q.width||C.height!==q.height)&&(Jt(P,"height",W()),g(c("marginRight"),Hn(n.gap)),g("width",L()),g("height",U(),!0),C=q,a(_o),w!==(w=B())&&(gn(p,zs,w),a(ic,w)))}function M(Z){var q=n.padding,O=c(Z?"right":"left");return q&&Hn(q[O]||(Ii(q)?0:q))||"0px"}function W(){var Z="";return y&&(Z=_(),Ci(Z,"height or heightRatio is missing."),Z="calc("+Z+" - "+M(!1)+" - "+M(!0)+")"),Z}function _(){return Hn(n.height||Vt(x).width*n.heightRatio)}function L(){return n.autoWidth?null:Hn(n.fixedWidth)||(y?"":v())}function U(){return Hn(n.fixedHeight)||(y?n.autoHeight?null:v():_())}function v(){var Z=Hn(n.gap);return"calc((100%"+(Z&&" + "+Z)+")/"+(n.perPage||1)+(Z&&" - "+Z)+")"}function R(){return Vt(x)[c("width")]}function N(Z,q){var O=$(Z||0);return O?Vt(O.slide)[c("width")]+(q?0:pe()):0}function D(Z,q){var O=$(Z);if(O){var Y=Vt(O.slide)[c("right")],ae=Vt(x)[c("left")];return jt(Y-ae)+(q?0:pe())}return 0}function ne(Z){return D(e.length-1)-D(0)+N(0,Z)}function pe(){var Z=$(0);return Z&&parseFloat(Jt(Z.slide,c("marginRight")))||0}function K(Z){return parseFloat(Jt(P,c("padding"+(Z?"Right":"Left"))))||0}function B(){return e.is(Ui)||ne(!0)>R()}return{mount:E,resize:F,listSize:R,slideSize:N,sliderSize:ne,totalSize:D,getPadding:K,isOverflow:B}}var Tc=2;function Lc(e,t,n){var i=bt(e),o=i.on,s=t.Elements,a=t.Slides,u=t.Direction.resolve,c=[],m;function p(){o(Tt,P),o([Nt,ci],$),(m=C())&&(g(m),t.Layout.resize(!0))}function P(){x(),p()}function x(){Kn(c),bn(c),i.destroy()}function $(){var w=C();m!==w&&(m<w||!w)&&i.emit(Tt)}function g(w){var E=a.get().slice(),T=E.length;if(T){for(;E.length<w;)bo(E,E);bo(E.slice(-w),E.slice(0,w)).forEach(function(F,M){var W=M<w,_=y(F.slide,M);W?Ar(_,E[0].slide):Di(s.list,_),bo(c,_),a.register(_,M-w+(W?0:T),F.index)})}}function y(w,E){var T=w.cloneNode(!0);return on(T,n.classes.clone),T.id=e.root.id+"-clone"+Fr(E+1),T}function C(){var w=n.clones;if(!e.is(xi))w=0;else if(zi(w)){var E=n[u("fixedWidth")]&&t.Layout.slideSize(0),T=E&&_i(Vt(s.track)[u("width")]/E);w=T||n[u("autoWidth")]&&e.length||n.perPage*Tc}return w}return{mount:p,destroy:x}}function Ec(e,t,n){var i=bt(e),o=i.on,s=i.emit,a=e.state.set,u=t.Layout,c=u.slideSize,m=u.getPadding,p=u.totalSize,P=u.listSize,x=u.sliderSize,$=t.Direction,g=$.resolve,y=$.orient,C=t.Elements,w=C.list,E=C.track,T;function F(){T=t.Transition,o([kn,_o,Nt,Tt],M)}function M(){t.Controller.isBusy()||(t.Scroll.cancel(),_(e.index),t.Slides.update())}function W(O,Y,ae,oe){O!==Y&&Z(O>ae)&&(R(),L(v(ne(),O>ae),!0)),a(vi),s(xn,Y,ae,O),T.start(Y,function(){a(li),s(bi,Y,ae,O),oe&&oe()})}function _(O){L(D(O,!0))}function L(O,Y){if(!e.is(Ui)){var ae=Y?O:U(O);Jt(w,"transform","translate"+g("X")+"("+ae+"px)"),O!==ae&&s(Rs)}}function U(O){if(e.is(xi)){var Y=N(O),ae=Y>t.Controller.getEnd(),oe=Y<0;(oe||ae)&&(O=v(O,ae))}return O}function v(O,Y){var ae=O-B(Y),oe=x();return O-=y(oe*(_i(jt(ae)/oe)||1))*(Y?1:-1),O}function R(){L(ne(),!0),T.cancel()}function N(O){for(var Y=t.Slides.get(),ae=0,oe=1/0,H=0;H<Y.length;H++){var ue=Y[H].index,f=jt(D(ue,!0)-O);if(f<=oe)oe=f,ae=ue;else break}return ae}function D(O,Y){var ae=y(p(O-1)-K(O));return Y?pe(ae):ae}function ne(){var O=g("left");return Vt(w)[O]-Vt(E)[O]+y(m(!1))}function pe(O){return n.trimSpace&&e.is(di)&&(O=ni(O,0,y(x(!0)-P()))),O}function K(O){var Y=n.focus;return Y==="center"?(P()-c(O,!0))/2:+Y*c(O)||0}function B(O){return D(O?t.Controller.getEnd():0,!!n.trimSpace)}function Z(O){var Y=y(v(ne(),O));return O?Y>=0:Y<=w[g("scrollWidth")]-Vt(E)[g("width")]}function q(O,Y){Y=zi(Y)?ne():Y;var ae=O!==!0&&y(Y)<y(B(!1)),oe=O!==!1&&y(Y)>y(B(!0));return ae||oe}return{mount:F,move:W,jump:_,translate:L,shift:v,cancel:R,toIndex:N,toPosition:D,getPosition:ne,getLimit:B,exceededLimit:q,reposition:M}}function Pc(e,t,n){var i=bt(e),o=i.on,s=i.emit,a=t.Move,u=a.getPosition,c=a.getLimit,m=a.toPosition,p=t.Slides,P=p.isEnough,x=p.getLength,$=n.omitEnd,g=e.is(xi),y=e.is(di),C=mt(ne,!1),w=mt(ne,!0),E=n.start||0,T,F=E,M,W,_;function L(){U(),o([Nt,Tt,Io],U),o(_o,v)}function U(){M=x(!0),W=n.perMove,_=n.perPage,T=Z();var f=ni(E,0,$?T:M-1);f!==E&&(E=f,a.reposition())}function v(){T!==Z()&&s(Io)}function R(f,me,fe){if(!ue()){var ye=D(f),Me=B(ye);Me>-1&&(me||Me!==E)&&(ae(Me),a.move(ye,Me,F,fe))}}function N(f,me,fe,ye){t.Scroll.scroll(f,me,fe,function(){var Me=B(a.toIndex(u()));ae($?Rn(Me,T):Me),ye&&ye()})}function D(f){var me=E;if(In(f)){var fe=f.match(/([+\-<>])(\d+)?/)||[],ye=fe[1],Me=fe[2];ye==="+"||ye==="-"?me=pe(E+ +(""+ye+(+Me||1)),E):ye===">"?me=Me?q(+Me):C(!0):ye==="<"&&(me=w(!0))}else me=g?f:ni(f,0,T);return me}function ne(f,me){var fe=W||(H()?1:_),ye=pe(E+fe*(f?-1:1),E,!(W||H()));return ye===-1&&y&&!hs(u(),c(!f),1)?f?0:T:me?ye:B(ye)}function pe(f,me,fe){if(P()||H()){var ye=K(f);ye!==f&&(me=f,f=ye,fe=!1),f<0||f>T?!W&&(xo(0,f,me,!0)||xo(T,me,f,!0))?f=q(O(f)):g?f=fe?f<0?-(M%_||_):M:f:n.rewind?f=f<0?T:0:f=-1:fe&&f!==me&&(f=q(O(me)+(f<me?-1:1)))}else f=-1;return f}function K(f){if(y&&n.trimSpace==="move"&&f!==E)for(var me=u();me===m(f,!0)&&xo(f,0,e.length-1,!n.rewind);)f<E?--f:++f;return f}function B(f){return g?(f+M)%M||0:f}function Z(){for(var f=M-(H()||g&&W?1:_);$&&f-- >0;)if(m(M-1,!0)!==m(f,!0)){f++;break}return ni(f,0,M-1)}function q(f){return ni(H()?f:_*f,0,T)}function O(f){return H()?Rn(f,T):Po((f>=T?M-1:f)/_)}function Y(f){var me=a.toIndex(f);return y?ni(me,0,T):me}function ae(f){f!==E&&(F=E,E=f)}function oe(f){return f?F:E}function H(){return!zi(n.focus)||n.isNavigation}function ue(){return e.state.is([vi,ji])&&!!n.waitForTransition}return{mount:L,go:R,scroll:N,getNext:C,getPrev:w,getAdjacent:ne,getEnd:Z,setIndex:ae,getIndex:oe,toIndex:q,toPage:O,toDest:Y,hasFocus:H,isBusy:ue}}var Ic="http://www.w3.org/2000/svg",Rc="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",to=40;function Mc(e,t,n){var i=bt(e),o=i.on,s=i.bind,a=i.emit,u=n.classes,c=n.i18n,m=t.Elements,p=t.Controller,P=m.arrows,x=m.track,$=P,g=m.prev,y=m.next,C,w,E={};function T(){M(),o(Nt,F)}function F(){W(),T()}function M(){var N=n.arrows;N&&!(g&&y)&&U(),g&&y&&(Ai(E,{prev:g,next:y}),ki($,N?"":"none"),on($,w=qr+"--"+n.direction),N&&(_(),R(),Ne([g,y],Gi,x.id),a(Cs,g,y)))}function W(){i.destroy(),hn($,w),C?(Kn(P?[g,y]:$),g=y=null):rn([g,y],Dr)}function _(){o([kn,bi,Tt,Un,Io],R),s(y,"click",mt(L,">")),s(g,"click",mt(L,"<"))}function L(N){p.go(N,!0)}function U(){$=P||ai("div",u.arrows),g=v(!0),y=v(!1),C=!0,Di($,[g,y]),!P&&Ar($,x)}function v(N){var D='<button class="'+u.arrow+" "+(N?u.prev:u.next)+'" type="button"><svg xmlns="'+Ic+'" viewBox="0 0 '+to+" "+to+'" width="'+to+'" height="'+to+'" focusable="false"><path d="'+(n.arrowPath||Rc)+'" />';return ms(D)}function R(){if(g&&y){var N=e.index,D=p.getPrev(),ne=p.getNext(),pe=D>-1&&N<D?c.last:c.prev,K=ne>-1&&N>ne?c.first:c.next;g.disabled=D<0,y.disabled=ne<0,Ne(g,Dt,pe),Ne(y,Dt,K),a(Ts,g,y,D,ne)}}return{arrows:E,mount:T,destroy:W,update:R}}var Ac=_r+"-interval";function kc(e,t,n){var i=bt(e),o=i.on,s=i.bind,a=i.emit,u=Wo(n.interval,e.go.bind(e,">"),_),c=u.isPaused,m=t.Elements,p=t.Elements,P=p.root,x=p.toggle,$=n.autoplay,g,y,C=$==="pause";function w(){$&&(E(),x&&Ne(x,Gi,m.track.id),C||T(),W())}function E(){n.pauseOnHover&&s(P,"mouseenter mouseleave",function(U){g=U.type==="mouseenter",M()}),n.pauseOnFocus&&s(P,"focusin focusout",function(U){y=U.type==="focusin",M()}),x&&s(x,"click",function(){C?T():F(!0)}),o([xn,Fo,Tt],u.rewind),o(xn,L)}function T(){c()&&t.Slides.isEnough()&&(u.start(!n.resetProgress),y=g=C=!1,W(),a(Or))}function F(U){U===void 0&&(U=!0),C=!!U,W(),c()||(u.pause(),a(Br))}function M(){C||(g||y?F(!1):T())}function W(){x&&(gn(x,Gn,!C),Ne(x,Dt,n.i18n[C?"play":"pause"]))}function _(U){var v=m.bar;v&&Jt(v,"width",U*100+"%"),a(Ps,U)}function L(U){var v=t.Slides.getAt(U);u.set(v&&+Zt(v.slide,Ac)||n.interval)}return{mount:w,destroy:u.cancel,play:T,pause:F,isPaused:c}}function _c(e,t,n){var i=bt(e),o=i.on;function s(){n.cover&&(o(jr,mt(u,!0)),o([kn,Nt,Tt],mt(a,!0)))}function a(c){t.Slides.forEach(function(m){var p=qi(m.container||m.slide,"img");p&&p.src&&u(c,p,m)})}function u(c,m,p){p.style("background",c?'center/cover no-repeat url("'+m.src+'")':"",!0),ki(m,c?"none":"")}return{mount:s,destroy:mt(a,!1)}}var Fc=10,Wc=600,Nc=.6,Hc=1.5,Oc=800;function Bc(e,t,n){var i=bt(e),o=i.on,s=i.emit,a=e.state.set,u=t.Move,c=u.getPosition,m=u.getLimit,p=u.exceededLimit,P=u.translate,x=e.is(di),$,g,y=1;function C(){o(xn,F),o([Nt,Tt],M)}function w(_,L,U,v,R){var N=c();if(F(),U&&(!x||!p())){var D=t.Layout.sliderSize(),ne=br(_)*D*Po(jt(_)/D)||0;_=u.toPosition(t.Controller.toDest(_%D))+ne}var pe=hs(N,_,1);y=1,L=pe?0:L||Eo(jt(_-N)/Hc,Oc),g=v,$=Wo(L,E,mt(T,N,_,R),1),a(ji),s(Fo),$.start()}function E(){a(li),g&&g(),s(Un)}function T(_,L,U,v){var R=c(),N=_+(L-_)*W(v),D=(N-R)*y;P(R+D),x&&!U&&p()&&(y*=Nc,jt(D)<Fc&&w(m(p(!0)),Wc,!1,g,!0))}function F(){$&&$.cancel()}function M(){$&&!$.isPaused()&&(F(),E())}function W(_){var L=n.easingFunc;return L?L(_):1-Math.pow(1-_,4)}return{mount:C,destroy:F,scroll:w,cancel:M}}var ii={passive:!1,capture:!0};function jc(e,t,n){var i=bt(e),o=i.on,s=i.emit,a=i.bind,u=i.unbind,c=e.state,m=t.Move,p=t.Scroll,P=t.Controller,x=t.Elements.track,$=t.Media.reduce,g=t.Direction,y=g.resolve,C=g.orient,w=m.getPosition,E=m.exceededLimit,T,F,M,W,_,L=!1,U,v,R;function N(){a(x,nr,yr,ii),a(x,ir,yr,ii),a(x,Vs,ne,ii),a(x,"click",B,{capture:!0}),a(x,"dragstart",mn),o([kn,Nt],D)}function D(){var X=n.drag;ge(!X),W=X==="free"}function ne(X){if(U=!1,!v){var be=Me(X);ye(X.target)&&(be||!X.button)&&(P.isBusy()?mn(X,!0):(R=be?x:window,_=c.is([vi,ji]),M=null,a(R,nr,pe,ii),a(R,ir,K,ii),m.cancel(),p.cancel(),Z(X)))}}function pe(X){if(c.is(vo)||(c.set(vo),s(ws)),X.cancelable)if(_){m.translate(T+fe(H(X)));var be=ue(X)>fa,te=L!==(L=E());(be||te)&&Z(X),U=!0,s($s),mn(X)}else Y(X)&&(_=O(X),mn(X))}function K(X){c.is(vo)&&(c.set(li),s(Ss)),_&&(q(X),mn(X)),u(R,nr,pe),u(R,ir,K),_=!1}function B(X){!v&&U&&mn(X,!0)}function Z(X){M=F,F=X,T=w()}function q(X){var be=ae(X),te=oe(be),ie=n.rewind&&n.rewindByDrag;$(!1),W?P.scroll(te,0,n.snap):e.is(Ui)?P.go(C(br(be))<0?ie?"<":"-":ie?">":"+"):e.is(di)&&L&&ie?P.go(E(!0)?">":"<"):P.go(P.toDest(te),!0),$(!0)}function O(X){var be=n.dragMinThreshold,te=Ii(be),ie=te&&be.mouse||0,J=(te?be.touch:+be)||10;return jt(H(X))>(Me(X)?J:ie)}function Y(X){return jt(H(X))>jt(H(X,!0))}function ae(X){if(e.is(xi)||!L){var be=ue(X);if(be&&be<fa)return H(X)/be}return 0}function oe(X){return w()+br(X)*Rn(jt(X)*(n.flickPower||600),W?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function H(X,be){return me(X,be)-me(f(X),be)}function ue(X){return vr(X)-vr(f(X))}function f(X){return F===X&&M||F}function me(X,be){return(Me(X)?X.changedTouches[0]:X)["page"+y(be?"Y":"X")]}function fe(X){return X/(L&&e.is(di)?xc:1)}function ye(X){var be=n.noDrag;return!Ri(X,"."+Hs+", ."+zo)&&(!be||!Ri(X,be))}function Me(X){return typeof TouchEvent<"u"&&X instanceof TouchEvent}function ee(){return _}function ge(X){v=X}return{mount:N,disable:ge,isDragging:ee}}var zc={Spacebar:" ",Right:Oo,Left:Ho,Up:Ms,Down:As};function Kr(e){return e=In(e)?e:e.key,zc[e]||e}var ya="keydown";function Vc(e,t,n){var i=bt(e),o=i.on,s=i.bind,a=i.unbind,u=e.root,c=t.Direction.resolve,m,p;function P(){x(),o(Nt,$),o(Nt,x),o(xn,y)}function x(){var w=n.keyboard;w&&(m=w==="global"?window:u,s(m,ya,C))}function $(){a(m,ya)}function g(w){p=w}function y(){var w=p;p=!0,ls(function(){p=w})}function C(w){if(!p){var E=Kr(w);E===c(Ho)?e.go("<"):E===c(Oo)&&e.go(">")}}return{mount:P,destroy:$,disable:g}}var Ti=_r+"-lazy",wo=Ti+"-srcset",Dc="["+Ti+"], ["+wo+"]";function qc(e,t,n){var i=bt(e),o=i.on,s=i.off,a=i.bind,u=i.emit,c=n.lazyLoad==="sequential",m=[bi,Un],p=[];function P(){n.lazyLoad&&(x(),o(Tt,x))}function x(){bn(p),$(),c?w():(s(m),o(m,g),g())}function $(){t.Slides.forEach(function(E){kr(E.slide,Dc).forEach(function(T){var F=Zt(T,Ti),M=Zt(T,wo);if(F!==T.src||M!==T.srcset){var W=n.classes.spinner,_=T.parentElement,L=qi(_,"."+W)||ai("span",W,_);p.push([T,E,L]),T.src||ki(T,"none")}})})}function g(){p=p.filter(function(E){var T=n.perPage*((n.preloadPages||1)+1)-1;return E[1].isWithin(e.index,T)?y(E):!0}),p.length||s(m)}function y(E){var T=E[0];on(E[1].slide,Sr),a(T,"load error",mt(C,E)),Ne(T,"src",Zt(T,Ti)),Ne(T,"srcset",Zt(T,wo)),rn(T,Ti),rn(T,wo)}function C(E,T){var F=E[0],M=E[1];hn(M.slide,Sr),T.type!=="error"&&(Kn(E[2]),ki(F,""),u(jr,F,M),u(ci)),c&&w()}function w(){p.length&&y(p.shift())}return{mount:P,destroy:mt(bn,p),check:g}}function Kc(e,t,n){var i=bt(e),o=i.on,s=i.emit,a=i.bind,u=t.Slides,c=t.Elements,m=t.Controller,p=m.hasFocus,P=m.getIndex,x=m.go,$=t.Direction.resolve,g=c.pagination,y=[],C,w;function E(){T(),o([Nt,Tt,Io],E);var v=n.pagination;g&&ki(g,v?"":"none"),v&&(o([xn,Fo,Un],U),F(),U(),s(Ls,{list:C,items:y},L(e.index)))}function T(){C&&(Kn(g?An(C.children):C),hn(C,w),bn(y),C=null),i.destroy()}function F(){var v=e.length,R=n.classes,N=n.i18n,D=n.perPage,ne=p()?m.getEnd()+1:_i(v/D);C=g||ai("ul",R.pagination,c.track.parentElement),on(C,w=Vo+"--"+_()),Ne(C,fn,"tablist"),Ne(C,Dt,N.select),Ne(C,Vr,_()===Bo?"vertical":"");for(var pe=0;pe<ne;pe++){var K=ai("li",null,C),B=ai("button",{class:R.page,type:"button"},K),Z=u.getIn(pe).map(function(O){return O.slide.id}),q=!p()&&D>1?N.pageX:N.slideX;a(B,"click",mt(M,pe)),n.paginationKeyboard&&a(B,"keydown",mt(W,pe)),Ne(K,fn,"presentation"),Ne(B,fn,"tab"),Ne(B,Gi,Z.join(" ")),Ne(B,Dt,xr(q,pe+1)),Ne(B,si,-1),y.push({li:K,button:B,page:pe})}}function M(v){x(">"+v,!0)}function W(v,R){var N=y.length,D=Kr(R),ne=_(),pe=-1;D===$(Oo,!1,ne)?pe=++v%N:D===$(Ho,!1,ne)?pe=(--v+N)%N:D==="Home"?pe=0:D==="End"&&(pe=N-1);var K=y[pe];K&&(ps(K.button),x(">"+pe),mn(R,!0))}function _(){return n.paginationDirection||n.direction}function L(v){return y[m.toPage(v)]}function U(){var v=L(P(!0)),R=L(P());if(v){var N=v.button;hn(N,Gn),rn(N,ua),Ne(N,si,-1)}if(R){var D=R.button;on(D,Gn),Ne(D,ua,!0),Ne(D,si,"")}s(Es,{list:C,items:y},v,R)}return{items:y,mount:E,destroy:T,getAt:L,update:U}}var Gc=[" ","Enter"];function Uc(e,t,n){var i=n.isNavigation,o=n.slideFocus,s=[];function a(){e.splides.forEach(function(g){g.isParent||(m(e,g.splide),m(g.splide,e))}),i&&p()}function u(){s.forEach(function(g){g.destroy()}),bn(s)}function c(){u(),a()}function m(g,y){var C=bt(g);C.on(xn,function(w,E,T){y.go(y.is(xi)?T:w)}),s.push(C)}function p(){var g=bt(e),y=g.on;y(Wr,x),y(Is,$),y([kn,Nt],P),s.push(g),g.emit(Hr,e.splides)}function P(){Ne(t.Elements.list,Vr,n.direction===Bo?"vertical":"")}function x(g){e.go(g.index)}function $(g,y){Mr(Gc,Kr(y))&&(x(g),mn(y))}return{setup:mt(t.Media.set,{slideFocus:zi(o)?i:o},!0),mount:a,destroy:u,remount:c}}function Xc(e,t,n){var i=bt(e),o=i.bind,s=0;function a(){n.wheel&&o(t.Elements.track,"wheel",u,ii)}function u(m){if(m.cancelable){var p=m.deltaY,P=p<0,x=vr(m),$=n.wheelMinThreshold||0,g=n.wheelSleep||0;jt(p)>$&&x-s>g&&(e.go(P?"<":">"),s=x),c(P)&&mn(m)}}function c(m){return!n.releaseWheel||e.state.is(vi)||t.Controller.getAdjacent(m)!==-1}return{mount:a}}var Yc=90;function Jc(e,t,n){var i=bt(e),o=i.on,s=t.Elements.track,a=n.live&&!n.isNavigation,u=ai("span",hc),c=Wo(Yc,mt(p,!1));function m(){a&&(x(!t.Autoplay.isPaused()),Ne(s,ga,!0),u.textContent="…",o(Or,mt(x,!0)),o(Br,mt(x,!1)),o([bi,Un],mt(p,!0)))}function p($){Ne(s,ma,$),$?(Di(s,u),c.start()):(Kn(u),c.cancel())}function P(){rn(s,[pa,ga,ma]),Kn(u)}function x($){a&&Ne(s,pa,$?"off":"polite")}return{mount:m,disable:x,destroy:P}}var Zc=Object.freeze({__proto__:null,Media:ac,Direction:sc,Elements:wc,Slides:Sc,Layout:Cc,Clones:Lc,Move:Ec,Controller:Pc,Arrows:Mc,Autoplay:kc,Cover:_c,Scroll:Bc,Drag:jc,Keyboard:Vc,LazyLoad:qc,Pagination:Kc,Sync:Uc,Wheel:Xc,Live:Jc}),Qc={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"},ed={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:vc,i18n:Qc,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function td(e,t,n){var i=t.Slides;function o(){bt(e).on([kn,Tt],s)}function s(){i.forEach(function(u){u.style("transform","translateX(-"+100*u.index+"%)")})}function a(u,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),ls(c)}return{mount:o,start:a,cancel:yr}}function nd(e,t,n){var i=t.Move,o=t.Controller,s=t.Scroll,a=t.Elements.list,u=mt(Jt,a,"transition"),c;function m(){bt(e).bind(a,"transitionend",function($){$.target===a&&c&&(P(),c())})}function p($,g){var y=i.toPosition($,!0),C=i.getPosition(),w=x($);jt(y-C)>=1&&w>=1?n.useScroll?s.scroll(y,w,!1,g):(u("transform "+w+"ms "+n.easing),i.translate(y,!0),c=g):(i.jump($),g())}function P(){u(""),s.cancel()}function x($){var g=n.rewindSpeed;if(e.is(di)&&g){var y=o.getIndex(!0),C=o.getEnd();if(y===0&&$>=C||y>=C&&$===0)return g}return n.speed}return{mount:m,start:p,cancel:P}}var id=(function(){function e(n,i){this.event=bt(),this.Components={},this.state=oc(ri),this.splides=[],this._o={},this._E={};var o=In(n)?gs(document,n):n;Ci(o,o+" is invalid."),this.root=o,i=Pn({label:Zt(o,Dt)||"",labelledby:Zt(o,zr)||""},ed,e.defaults,i||{});try{Pn(i,JSON.parse(Zt(o,_r)))}catch{Ci(!1,"Invalid JSON")}this._o=Object.create(Pn({},i))}var t=e.prototype;return t.mount=function(i,o){var s=this,a=this.state,u=this.Components;Ci(a.is([ri,Lo]),"Already mounted!"),a.set(ri),this._C=u,this._T=o||this._T||(this.is(Ui)?td:nd),this._E=i||this._E;var c=Ai({},Zc,this._E,{Transition:this._T});return qn(c,function(m,p){var P=m(s,u,s._o);u[p]=P,P.setup&&P.setup()}),qn(u,function(m){m.mount&&m.mount()}),this.emit(kn),on(this.root,fc),a.set(li),this.emit(wr),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(li)&&(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(An(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(Tt),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,s=this.state;return s.is(ri)?bt(this).on(wr,this.destroy.bind(this,i)):(qn(this._C,function(a){a.destroy&&a.destroy(i)},!0),o.emit(Nr),o.destroy(),i&&bn(this.splides),s.set(Lo)),this},Ql(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})(),Gr=id;Gr.defaults={};Gr.STATES=tc;var va=[[kn,"onMounted"],[wr,"onReady"],[xn,"onMove"],[bi,"onMoved"],[Wr,"onClick"],[ys,"onActive"],[vs,"onInactive"],[bs,"onVisible"],[xs,"onHidden"],[Tt,"onRefresh"],[Nt,"onUpdated"],[ci,"onResize"],[_o,"onResized"],[ws,"onDrag"],[$s,"onDragging"],[Ss,"onDragged"],[Fo,"onScroll"],[Un,"onScrolled"],[Nr,"onDestroy"],[Cs,"onArrowsMounted"],[Ts,"onArrowsUpdated"],[Ls,"onPaginationMounted"],[Es,"onPaginationUpdated"],[Hr,"onNavigationMounted"],[Or,"onAutoplayPlay"],[Ps,"onAutoplayPlaying"],[Br,"onAutoplayPause"],[jr,"onLazyLoadLoaded"]];function Ur(...e){return e.filter(Boolean).join(" ")}function Ro(e){return e!==null&&typeof e=="object"}function Cr(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!Cr(n,t[i]));if(Ro(e)&&Ro(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Cr(e[o],t[o]))}return e===t}function od(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function rd(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 Tr(e,t){const n=e;return rd(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Ro(i)?n[o]=Tr(Ro(n[o])?n[o]:{},i):n[o]=i}),n}var ad=({children:e,className:t,...n})=>l.createElement("div",{className:Ur("splide__track",t),...n},l.createElement("ul",{className:"splide__list"},e)),Xr=class extends l.Component{constructor(){super(...arguments),this.splideRef=l.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new Gr(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Tr({},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&&!Cr(this.options,e)&&(this.splide.options=e,this.options=Tr({},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){va.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 l.createElement(t,{className:Ur("splide",e),ref:this.splideRef,...this.omit(o,["options",...va.map(s=>s[1])])},n?l.createElement(ad,null,i):i)}},Yr=({children:e,className:t,...n})=>l.createElement("li",{className:Ur("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 dd="RichTextRenderer-module__link___BWeZ2",ud={link:dd},pd=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))},qo=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>pd(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function qt(e){const{color:t,...n}=e;return n}function At(e,t){var o,s,a;const{fontSize:n,lineHeight:i}=e;return{fontFamily:qo(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:P.scalingValue(e.letterSpacing,t),wordSpacing:P.scalingValue(e.wordSpacing,t),fontSize:P.scalingValue(n,t),lineHeight:i!==void 0?P.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(s=e.textAppearance)==null?void 0:s.textDecoration,fontVariant:(a=e.textAppearance)==null?void 0:a.fontVariant,textAlign:e.textAlign,color:e.color}}const ui=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:ud.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:md(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 md(e){return{...e.fontFamily&&{fontFamily:qo(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-",hd="SvgImage-module__img___VsTm-",xa={svg:gd,img:hd},fd=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},yd=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,Qt=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[s,a]=l.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return l.useEffect(()=>{if(typeof window<"u"&&window.CSS){const u=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');a(u)}},[]),!fd(e)||!s?r.jsx("img",{src:e,alt:"",className:ze(xa.img,i),style:o}):r.jsx("span",{"data-supports-mask":s,className:ze(xa.svg,i),style:{"--svg":yd(e),"--fill":t,"--hover-fill":n,...o??{}}})},vd={"top-left":Pe.topLeftAlignment,"top-center":Pe.topCenterAlignment,"top-right":Pe.topRightAlignment,"middle-left":Pe.middleLeftAlignment,"middle-center":Pe.middleCenterAlignment,"middle-right":Pe.middleRightAlignment,"bottom-left":Pe.bottomLeftAlignment,"bottom-center":Pe.bottomCenterAlignment,"bottom-right":Pe.bottomRightAlignment};function bd({settings:e,content:t,styles:n,isEditor:i}){const[o,s]=l.useState(null),{widthSettings:a,fontSettings:u,letterSpacing:c,textAlign:m,wordSpacing:p,fontSizeLineHeight:b,textAppearance:w,color:S}=n.imageCaption??{},[g,v]=l.useState(void 0),[T,$]=l.useState(null),[C,L]=l.useState(0),[A,k]=l.useState(0),{direction:F,transition:I,controls:E,pagination:J,imageCaption:y,triggers:_}=e,W=l.useRef(I.type),{x:G,y:te}=e.controls.offset,ue=X=>{o&&o.go(X)};return l.useEffect(()=>{if(!T)return;const X=new ResizeObserver(H=>{if(!o)return;const[Q]=H;v({width:Math.round(Q.contentRect.width),height:Math.round(Q.contentRect.height)})});return X.observe(T),()=>X.unobserve(T)},[T]),l.useEffect(()=>{!o||W.current===I.type||(k(X=>X+1),W.current=I.type)},[I.type]),r.jsx("div",{className:ze(Pe.wrapper,{[Pe.editor]:i}),ref:$,children:r.jsxs("div",{className:Pe.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:I.backgroundColor&&I.type==="fade in"?I.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:ze(Pe.captionBlock),children:r.jsx("div",{className:Pe.captionTextWrapper,children:t.map((X,H)=>r.jsx("div",{className:ze(Pe.captionText,vd[y.alignment],{[Pe.withPointerEvents]:H===C&&i,[Pe.active]:H===C}),style:{fontFamily:qo(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:a.sizing==="auto"?"max-content":P.scalingValue(a.width,i),letterSpacing:P.scalingValue(c,i),wordSpacing:P.scalingValue(p,i),textAlign:m,fontSize:P.scalingValue(b.fontSize,i),lineHeight:P.scalingValue(b.lineHeight,i),textTransform:w.textTransform??"none",textDecoration:w.textDecoration??"none",fontVariant:w.fontVariant??"normal",color:S,transitionDuration:I.duration?`${Math.round(parseInt(I.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:Pe.captionTextInner,style:{"--link-hover-color":y.linkHoverColor,"--link-color":y.linkColor,position:"relative",top:P.scalingValue(y.offset.y,i),left:P.scalingValue(y.offset.x,i)},children:r.jsx(ui,{content:X.imageCaption})})},H))})}),r.jsx(Yr,{onMove:X=>{L(X.index)},ref:s,options:{arrows:!1,speed:I.duration?parseInt(I.duration):500,autoplay:_.autoPlay!==null,..._.autoPlay!==null&&{interval:parseInt(_.autoPlay)*1e3},direction:F==="horiz"||I.type==="fade in"?"ltr":"ttb",pagination:!1,drag:_.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:I.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((X,H)=>r.jsx(Jr,{children:r.jsx("div",{className:Pe.sliderItem,children:r.jsx("div",{className:Pe.imgWrapper,children:r.jsx("img",{className:ze(Pe.sliderImage,{[Pe.contain]:X.image.objectFit==="contain",[Pe.cover]:X.image.objectFit==="cover"}),src:X.image.url,alt:X.image.name??""})})})},H))},A),E.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:ze(Pe.arrow,{[Pe.arrowVertical]:F==="vert",[Pe.hoverArrow]:E.show==="on hover"}),style:{color:E.color,"--arrow-hover-color":E.hover},children:r.jsxs("button",{onClick:()=>{ue("-1")},className:Pe.arrowInner,style:{transform:`translate(${P.scalingValue(G,i)}, ${P.scalingValue(te*(F==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${F==="horiz"?"0deg":"90deg"})`},children:[E.arrowsImgUrl&&r.jsx(Qt,{url:E.arrowsImgUrl,fill:E.color,hoverFill:E.hover,className:ze(Pe.arrowImg,Pe.mirror)}),!E.arrowsImgUrl&&r.jsx(wa,{color:E.color,className:ze(Pe.arrowIcon,Pe.arrowImg,Pe.mirror)})]})}),r.jsx("div",{className:ze(Pe.arrow,Pe.nextArrow,{[Pe.arrowVertical]:F==="vert",[Pe.hoverArrow]:E.show==="on hover"}),style:{color:E.color,"--arrow-hover-color":E.hover},children:r.jsxs("button",{className:Pe.arrowInner,onClick:()=>ue("+1"),style:{transform:`translate(${P.scalingValue(G*(F==="horiz"?-1:1),i)}, ${P.scalingValue(te,i)}) scale(${e.controls.scale/100}) rotate(${F==="horiz"?"0deg":"90deg"})`},children:[E.arrowsImgUrl&&r.jsx(Qt,{url:E.arrowsImgUrl,fill:E.color,hoverFill:E.hover,className:Pe.arrowImg}),!E.arrowsImgUrl&&r.jsx(wa,{color:E.color,className:ze(Pe.arrowIcon,Pe.arrowImg)})]})})]}),_.triggersList.click&&r.jsx("div",{className:Pe.clickOverlay,onClick:()=>{o&&o.go("+1")}}),J.isActive&&r.jsx("div",{className:ze(Pe.pagination,{[Pe.paginationInsideBottom]:J.position==="inside-1"&&F==="horiz",[Pe.paginationInsideTop]:J.position==="inside-2"&&F==="horiz",[Pe.paginationOutsideBottom]:J.position==="outside-1"&&F==="horiz",[Pe.paginationOutsideTop]:J.position==="outside-2"&&F==="horiz",[Pe.paginationInsideLeft]:J.position==="inside-1"&&F==="vert",[Pe.paginationInsideRight]:J.position==="inside-2"&&F==="vert",[Pe.paginationOutsideLeft]:J.position==="outside-1"&&F==="vert",[Pe.paginationOutsideRight]:J.position==="outside-2"&&F==="vert",[Pe.paginationVertical]:F==="vert"}),children:r.jsx("div",{className:Pe.paginationInner,style:{backgroundColor:J.colors[2],transform:`scale(${J.scale/100}) translate(${P.scalingValue(J.offset.x,i)}, ${P.scalingValue(J.offset.y,i)}) rotate(${F==="horiz"?"0deg":"90deg"})`},children:t.map((X,H)=>r.jsx("button",{onClick:()=>{o&&o.go(H)},className:ze(Pe.paginationItem),children:r.jsx("div",{className:ze(Pe.dot,{[Pe.activeDot]:H===C}),style:{backgroundColor:H===C?J.colors[0]:J.colors[1],"--pagination-hover-color":J.hover}})},H))})})]})})}function wa({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 xd={element:bd,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"]}},wd="ImageRevealSlider-module__imageRevealSlider___UE5Ob",$d="ImageRevealSlider-module__image___Qjt-e",Sd="ImageRevealSlider-module__link___N-iLG",Cd="ImageRevealSlider-module__cursor___2U03d",Qn={imageRevealSlider:wd,image:$d,link:Sd,cursor:Cd};function $a(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const s=i.width?Number.parseFloat(i.width):o.naturalWidth,a=o.naturalHeight/o.naturalWidth*s,u=s/2,c=a/2;if(e>=i.x-u&&e<=i.x+u&&t>=i.y-c&&t<=i.y+c)return!0}return!1}function rr(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Td(e,t,n,i){let o,s;if(t==="custom"){o=n;const a=await rr(e);s=a.height/a.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const a=await rr(e);s=a.height/a.width*o}else{const a=await rr(e);o=a.width,s=a.height}return{width:o,height:s,finalWidth:`${o}px`}}function Ld({settings:e,content:t,isEditor:n}){const[i,o]=l.useState(null),[s,a]=l.useState([]),[u,c]=l.useState(0),m=l.useRef(0),[p,b]=l.useState({x:0,y:0}),[w,S]=l.useState(1),[g,v]=l.useState("none"),T=l.useRef({x:0,y:0}),[$,C]=l.useState(!1),{sizeType:L,imageWidth:A,randomRangeImageWidth:k}=e.imageSize,{revealPosition:F,visible:I}=e.position,{cursorType:E,target:J,defaultCursorScale:y,defaultCursor:_,hoverCursorScale:W,hoverCursor:G}=e.cursor;l.useEffect(()=>{if(!i)return;const X=(z,B)=>{const Y=i.getBoundingClientRect(),oe=z-Y.left,ie=B-Y.top;if(b({x:oe,y:ie}),E==="system"){v("none"),S(1);return}const O=oe,ce=ie,f=document.elementFromPoint(Y.left+O,Y.top+ce);if(f&&f.closest("a")){v("none"),S(1);return}const de=$a(O,ce,s)||J==="area"?{img:G??"none",scale:W}:{img:_??"none",scale:y};v(de.img),S(de.scale)},H=z=>{z.stopPropagation(),T.current={x:z.clientX,y:z.clientY},X(z.clientX,z.clientY)},Q=()=>{$&&X(T.current.x,T.current.y)};return i.addEventListener("mousemove",H),window.addEventListener("scroll",Q,!0),()=>{i.removeEventListener("mousemove",H),window.removeEventListener("scroll",Q,!0)}},[i,$,p,E,J,G,_,W,y,s]),l.useEffect(()=>{$||(v("none"),S(0))},[$]);const te=async(X,H,Q,z={})=>{const{width:B,height:Y,finalWidth:oe}=await Td(X.image.url,L,A,k);let ie=0,O=0;F==="same"?(ie=H/2,O=Q/2):(ie=z.x??Math.random()*H,O=z.y??Math.random()*Q);const ce=Math.min(Math.max(ie,B/2),H-B/2),f=Math.min(Math.max(O,Y/2),Q-Y/2);return{id:m.current++,url:X.image.url,link:X.link,name:X.image.name,x:ce,y:f,width:oe}};l.useEffect(()=>{if(!i||t.length===0)return;const X=i.getBoundingClientRect(),H=X.width,Q=X.height,z=[];(async()=>{const Y=t[0],oe=await te(Y,H,Q);z.push(oe),a(z),c(1)})()},[L,A,k,F,i]),l.useEffect(()=>{I==="last One"&&a(X=>X.length>0?[X[X.length-1]]:[])},[I]);const ue=async X=>{if(!i)return;const H=i.getBoundingClientRect(),Q=X.clientX-H.left,z=X.clientY-H.top;if(J==="image"&&!$a(Q,z,s))return;let B=0,Y=0;F==="on Click"?(B=Q,Y=z):F==="same"?(B=H.width/2,Y=H.height/2):(B=Math.random()*H.width,Y=Math.random()*H.height);const oe=t[u],ie=await te(oe,H.width,H.height,{x:B,y:Y});a(O=>I==="all"?[...O,ie]:[ie]),c(O=>O>=t.length-1?0:O+1)};return r.jsxs("div",{ref:o,onClick:ue,onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),className:Qn.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[s.map(X=>r.jsx("div",{className:Qn.wrapper,style:{top:`${X.y}px`,left:`${X.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:X.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:J==="area"&&X.link?r.jsx("a",{href:X.link,target:"_blank",className:Qn.link,children:r.jsx("img",{src:X.url,alt:X.name,className:Qn.image},X.id)}):r.jsx("img",{src:X.url,alt:X.name,className:Qn.image},X.id)},X.id)),$&&r.jsx("div",{className:Qn.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${w})`,backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Ed={element:Ld,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:""}]}}}},Id="LightBox-module__hidden___9s-9x",Pd="LightBox-module__heroImage___sTxNF",kd="LightBox-module__background___rm9ml",Rd="LightBox-module__editor___4ACaY",Ad="LightBox-module__contentStyle___Bgnsq",Md="LightBox-module__imageStyle___tLIlB",_d="LightBox-module__imgWrapper___LuFUp",Fd="LightBox-module__contain___8-yaS",Wd="LightBox-module__cover___hNvOG",Nd="LightBox-module__caption___b6L2I",Hd="LightBox-module__captionTextInner___rCGNH",Od="LightBox-module__lightboxSplide___XFuWC",Bd="LightBox-module__arrow___iz38X",jd="LightBox-module__arrowVertical___Zfz81",zd="LightBox-module__nextArrow___zkAQN",Vd="LightBox-module__arrowInner___p48sW",Dd="LightBox-module__arrowIcon___3VaFf",qd="LightBox-module__arrowImg___pNV88",Kd="LightBox-module__mirror___pjeXc",Gd="LightBox-module__thumbsWrapper___GB-nU",Ud="LightBox-module__thumbsContainerVertical___wttk5",Xd="LightBox-module__thumbsContainer___osSma",Yd="LightBox-module__thumbsAlignStart___MO6tY",Jd="LightBox-module__thumbsAlignCenter___Q4sUx",Zd="LightBox-module__thumbsAlignEnd___p4y9R",Qd="LightBox-module__thumbItem___HvnF3",eu="LightBox-module__closeButton___g2khP",tu="LightBox-module__fadeIn___0m5GW",nu="LightBox-module__slideInLeft___gPYwC",iu="LightBox-module__slideInRight___S-pPp",ou="LightBox-module__slideInTop___DFdAj",ru="LightBox-module__slideInBottom___m27kZ",au="LightBox-module__fadeOut___55qBR",su="LightBox-module__slideOutLeft___NvU7P",lu="LightBox-module__slideOutRight___SK7eC",cu="LightBox-module__slideOutTop___Vgg0z",du="LightBox-module__slideOutBottom___nJ0Ef",uu="LightBox-module__scaleSlide___vZriG",ve={hidden:Id,heroImage:Pd,background:kd,editor:Rd,contentStyle:Ad,imageStyle:Md,imgWrapper:_d,contain:Fd,cover:Wd,caption:Nd,captionTextInner:Hd,lightboxSplide:Od,arrow:Bd,arrowVertical:jd,nextArrow:zd,arrowInner:Vd,arrowIcon:Dd,arrowImg:qd,mirror:Kd,thumbsWrapper:Gd,thumbsContainerVertical:Ud,thumbsContainer:Xd,thumbsAlignStart:Yd,thumbsAlignCenter:Jd,thumbsAlignEnd:Zd,thumbItem:Qd,closeButton:eu,fadeIn:tu,slideInLeft:nu,slideInRight:iu,slideInTop:ou,slideInBottom:ru,fadeOut:au,slideOutLeft:su,slideOutRight:lu,slideOutTop:cu,slideOutBottom:du,scaleSlide:uu},io=(e,t,n)=>{const i={},[o,s]=e.split("-");return o==="top"?(i.top="0",i.bottom="auto"):o==="middle"?(i.top="50%",i.bottom="auto"):o==="bottom"&&(i.top="auto",i.bottom="0"),s==="left"?(i.left="0",i.right="auto"):s==="center"?(i.left="50%",i.right="auto"):s==="right"&&(i.left="auto",i.right="0"),o==="middle"&&s==="center"?i.transform=`translate(calc(-50% + ${P.scalingValue(t.x,n)}), calc(-50% + ${P.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${P.scalingValue(t.x,n)}, calc(-50% + ${P.scalingValue(t.y,n)}))`:s==="center"?i.transform=`translate(calc(-50% + ${P.scalingValue(t.x,n)}), ${P.scalingValue(t.y,n)})`:i.transform=`translate(${P.scalingValue(t.x,n)}, ${P.scalingValue(t.y,n)})`,i};function Gs(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 Sa(e){const t=e.getBoundingClientRect(),n=Gs(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),s=e.naturalWidth,a=e.naturalHeight,u=i/o,c=s/a;let m,p;c>u?(m=i,p=i/c):(p=o,m=o*c);const b=t.left+n.left,w=t.top+n.top,S=(i-m)/2+b,g=(o-p)/2+w;return{x:S,y:g,width:m,height:p}}function Ca(e){const t=e.getBoundingClientRect(),n=Gs(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Ta(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 pu(e,t){const n=(()=>{if(e==="fade in")return ve.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return ve.slideInLeft;case"right":return ve.slideInRight;case"top":return ve.slideInTop;case"bottom":return ve.slideInBottom;default:return ve.slideInRight}return ve.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return ve.fadeIn;if(e==="slide in")switch(t){case"left":return ve.slideInLeft;case"right":return ve.slideInRight;case"top":return ve.slideInTop;case"bottom":return ve.slideInBottom;default:return ve.slideInRight}return ve.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return ve.fadeOut;if(e==="slide in")switch(t){case"left":return ve.slideOutLeft;case"right":return ve.slideOutRight;case"top":return ve.slideOutTop;case"bottom":return ve.slideOutBottom;default:return ve.slideOutRight}return ve.fadeOut})(),s=(()=>{if(e==="fade in")return ve.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return ve.slideOutLeft;case"right":return ve.slideOutRight;case"top":return ve.slideOutTop;case"bottom":return ve.slideOutBottom;default:return ve.slideOutRight}return ve.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:s}}const mu=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:s,isPreviewMode:a})=>{const[u,c]=l.useState(!1),{url:m}=e.thumbnailBlock.cover;return l.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:m,alt:"Cover",className:ve.heroImage,onClick:()=>c(!0)}),r.jsx(gu,{isOpen:u,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:s})]})},gu=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:s,isEditor:a,metadata:u})=>{var Ie;const{widthSettings:c,fontSettings:m,letterSpacing:p,textAlign:b,wordSpacing:w,fontSizeLineHeight:S,textAppearance:g,color:v}=i.imageCaption??{},[T,$]=l.useState(0),[C,L]=l.useState(0),[A,k]=l.useState(!1),[F,I]=l.useState(!1),[E,J]=l.useState({}),y=l.useRef(null),_=l.useRef(null),W=l.useRef(null),G=l.useRef(!1),te=l.useRef(null),ue=l.useRef(null),X=l.useRef(null),H=l.useRef(null),Q=l.useRef(!1),z=l.useRef(null),[B,Y]=l.useState(!1),{appear:oe,triggers:ie,slider:O,thumbnail:ce,controls:f,area:de,caption:be,layout:fe}=o.lightboxBlock,{appearClass:Re,backdropAppearClass:Z,backdropDisappearClass:ge,disappearClass:U}=pu(oe.type,oe.direction),V=(u==null?void 0:u.itemId)??null;l.useEffect(()=>{const N=()=>{setTimeout(()=>{var R,K;(K=(R=y.current)==null?void 0:R.splide)==null||K.refresh()},16)},ee=()=>{L(R=>R+1)};return window.addEventListener("ArticleEditor.Layout:change",N),window.addEventListener("ArticleEditor.ComponentContent:change",ee),()=>{window.removeEventListener("ArticleEditor.Layout:change",N),window.removeEventListener("ArticleEditor.ComponentContent:change",ee)}},[]),l.useEffect(()=>{if(!e||!ce.isActive){Y(!1);return}const N=z.current;if(!N)return;const ee=()=>{O.direction==="horiz"?Y(N.scrollWidth>N.clientWidth):Y(N.scrollHeight>N.clientHeight)};ee();const R=new ResizeObserver(ee);return R.observe(N),()=>R.disconnect()},[e,ce.isActive,n.length,E,O.direction]);const j=l.useCallback(()=>{const N=window.matchMedia("(max-width: 768px)").matches,ee=Ta(de.color);N&&!a&&ee>.9&&(document.body.style.backgroundColor=""),k(!0),G.current=!0;const R=K=>{K.target===te.current&&K.animationName&&(te.current&&ue.current&&te.current.removeEventListener("animationend",ue.current),ue.current=null,G.current&&(G.current=!1,t()),k(!1))};te.current&&(ue.current=R,te.current.addEventListener("animationend",R))},[t,de.color,a]),he=(N,ee,R)=>{var K,D;if(N){if(ie.type==="click"&&ie.switch==="image")ie.repeat==="close"&&T===n.length-1?j():(K=y.current)==null||K.go("+1");else if(ie.type==="click"&&ie.switch==="50/50"){const ae=N.getBoundingClientRect(),ne=ee-ae.left,ye=R-ae.top,ke=ae.width,Te=ae.height;let xe;O.direction==="horiz"?xe=ne<ke/2?"-1":"+1":xe=ye<Te/2?"-1":"+1",(D=y.current)==null||D.go(xe)}}},re=N=>{if(Q.current){Q.current=!1;return}const ee=n[T],R=(ee==null?void 0:ee.image.objectFit)==="cover";let K,D;if("changedTouches"in N&&N.changedTouches.length>0)K=N.changedTouches[0].clientX,D=N.changedTouches[0].clientY;else if("clientX"in N)K=N.clientX,D=N.clientY;else return;let ae;if(R&&W.current){const ne=Ca(W.current);ae=K>=ne.left&&K<=ne.right&&D>=ne.top&&D<=ne.bottom}else{const ne=W.current?Sa(W.current):null;if(!ne){N.target===N.currentTarget&&j();return}ae=K>=ne.x&&K<=ne.x+ne.width&&D>=ne.y&&D<=ne.y+ne.height}ae?he(W.current,K,D):j()},Ce=N=>{const ee=N.target;(ee.classList.contains(ve.thumbsWrapper)||ee.classList.contains(ve.thumbsContainer))&&re(N)};l.useEffect(()=>{if(!e)return;const N=ee=>{var R,K;if(ee.key==="Escape"){j();return}if(ee.key==="ArrowRight"){$(D=>(D+1)%Math.max(n.length,1)),(R=y.current)==null||R.go("+1");return}ee.key==="ArrowLeft"&&($(D=>(D-1+Math.max(n.length,1))%Math.max(n.length,1)),(K=y.current)==null||K.go("-1"))};return window.addEventListener("keydown",N),()=>{window.removeEventListener("keydown",N)}},[e,j,n.length]),l.useEffect(()=>{if(e){if($(0),L(ee=>ee+1),G.current=!1,k(!1),I(!1),J({}),!V)return;const N=new CustomEvent("page-overlay",{detail:{itemId:V}});window.dispatchEvent(N)}return()=>{te.current&&ue.current&&(te.current.removeEventListener("animationend",ue.current),ue.current=null),I(!1)}},[e,V]),l.useEffect(()=>{_.current!==null&&_.current!==O.type&&L(N=>N+1),_.current=O.type},[O.type]),l.useEffect(()=>{if(!e)return;const N=document.body.style.overflow,ee=window.matchMedia("(max-width: 768px)").matches,R=Ta(de.color);document.body.style.overflow="hidden",I(!1);const K=ae=>{ae.target===te.current&&!G.current&&ae.animationName&&(ee&&!a&&R>.9&&(document.body.style.backgroundColor=de.color),I(!0),te.current&&X.current&&te.current.removeEventListener("animationend",X.current),X.current=null)};te.current&&(X.current=K,te.current.addEventListener("animationend",K));const D=ae=>{const ne=ae.target;ne&&(ne.closest(`.${ve.thumbsWrapper}`)||ne.closest(`.${ve.thumbsContainer}`))||O.type!=="slide"&&ae.preventDefault()};return document.addEventListener("touchmove",D,{passive:!1}),()=>{document.body.style.overflow=N,document.removeEventListener("touchmove",D),te.current&&X.current&&(te.current.removeEventListener("animationend",X.current),X.current=null),I(!1)}},[e,a,de.color,O.type]),l.useEffect(()=>{if(!e)return;const N=ee=>{var K,D;if(G.current){ee.stopPropagation();return}if(Q.current){Q.current=!1;return}const R=ee.target;if(!(R&&(R.closest(`.${ve.thumbsContainer}`)||R.closest(`.${ve.thumbItem}`)||R.closest(`.${ve.arrow}`)||R.closest(`.${ve.closeButton}`)||R.closest(`.${ve.caption}`)))){if(O.type==="slide"&&ie.type==="drag"&&((D=(K=y.current)==null?void 0:K.splide)!=null&&D.root)){const ae=y.current.splide.root;if(R&&(ae.contains(R)||ae===R))return}if(ee.touches.length===0&&ee.changedTouches.length>0){const ae=n[T],ne=(ae==null?void 0:ae.image.objectFit)==="cover",ye=ee.changedTouches[0];let ke;if(ne&&W.current){const Te=Ca(W.current);ke=ye.clientX>=Te.left&&ye.clientX<=Te.right&&ye.clientY>=Te.top&&ye.clientY<=Te.bottom}else{const Te=W.current?Sa(W.current):null;if(!Te)return;ke=ye.clientX>=Te.x&&ye.clientX<=Te.x+Te.width&&ye.clientY>=Te.y&&ye.clientY<=Te.y+Te.height}if(!ke){ee.stopPropagation(),G.current=!0;const Te=xe=>{xe.stopPropagation(),xe.preventDefault(),document.removeEventListener("click",Te,!0)};document.addEventListener("click",Te,!0),j()}}}};return document.addEventListener("touchend",N,{passive:!0}),()=>{document.removeEventListener("touchend",N)}},[e,j,T,n]);const Se=(O.type==="scale"||O.type==="fade")&&O.direction==="vert"&&ie.type==="drag";l.useEffect(()=>{var xe,Ke;if(!e||!Se||!((Ke=(xe=y.current)==null?void 0:xe.splide)!=null&&Ke.root))return;const N=y.current.splide.root,ee=30,R=(se,Ae)=>{if(H.current){const Ne=Math.abs(se-H.current.x),He=Math.abs(Ae-H.current.y);(Ne>0||He>0)&&(Q.current=!0)}},K=se=>{H.current&&(se.preventDefault(),R(se.clientX,se.clientY))},D=se=>{H.current&&se.touches.length>0&&(se.preventDefault(),R(se.touches[0].clientX,se.touches[0].clientY))},ae=(se,Ae)=>{if(!H.current||!y.current){H.current=null;return}const Ne=Math.abs(se-H.current.x),He=Math.abs(Ae-H.current.y);He>ee&&He>Ne&&y.current.go(Ae<H.current.y?"+1":"-1"),H.current=null},ne=se=>{H.current&&ae(se.clientX,se.clientY),document.removeEventListener("pointerup",ne),document.removeEventListener("pointercancel",ne),document.removeEventListener("pointermove",K)},ye=se=>{if(H.current){if(se.changedTouches.length>0){const Ae=se.changedTouches[0];ae(Ae.clientX,Ae.clientY)}document.removeEventListener("touchend",ye),document.removeEventListener("touchcancel",ye),document.removeEventListener("touchmove",D)}},ke=se=>{H.current={x:se.clientX,y:se.clientY},Q.current=!1,document.addEventListener("pointermove",K,{passive:!1}),document.addEventListener("pointerup",ne),document.addEventListener("pointercancel",ne)},Te=se=>{se.touches.length>0&&(H.current={x:se.touches[0].clientX,y:se.touches[0].clientY},Q.current=!1,document.addEventListener("touchmove",D,{passive:!1}),document.addEventListener("touchend",ye),document.addEventListener("touchcancel",ye))};return N.addEventListener("pointerdown",ke),N.addEventListener("touchstart",Te),()=>{N.removeEventListener("pointerdown",ke),N.removeEventListener("touchstart",Te),document.removeEventListener("pointermove",K),document.removeEventListener("pointerup",ne),document.removeEventListener("pointercancel",ne),document.removeEventListener("touchmove",D),document.removeEventListener("touchend",ye),document.removeEventListener("touchcancel",ye),H.current=null,Q.current=!1}},[e,Se,C]);const we={backgroundColor:de.color,backdropFilter:`blur(${de.blur}px)`,animationDuration:`${parseInt(oe.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(s)?null:ji.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:a?null:te,className:ze(ve.background,A?ge:Z,{[ve.editor]:a},{[ve.hidden]:!e}),style:{...we,...F&&!a&&!A?{position:"absolute"}:{}}}),r.jsxs("div",{ref:a?te:null,className:ze(ve.contentStyle,A?U:Re,{[ve.editor]:a},{[ve.hidden]:!e}),style:{animationDuration:`${parseInt(oe.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(Yr,{onMove:N=>$(N.index),ref:y,className:ve.lightboxSplide,options:{arrows:!1,speed:O.duration?parseInt(O.duration):500,direction:O.direction==="horiz"||O.type==="fade"||O.type==="scale"?"ltr":"ttb",pagination:!1,drag:ie.type==="drag"&&!Se,perPage:1,width:"100%",height:"100%",type:O.type==="fade"||O.type==="scale"?"fade":"loop",padding:0,rewind:ie.repeat!=="close",start:0},style:{"--splide-speed":O.duration},children:n.map((N,ee)=>{const R=io(fe.position,fe.offset,a),K=`${P.scalingValue(fe.padding.top,a)} ${P.scalingValue(fe.padding.right,a)} ${P.scalingValue(fe.padding.bottom,a)} ${P.scalingValue(fe.padding.left,a)}`,D=O.type==="scale"?(()=>{const{transform:ae,...ne}=R;return{...ne,position:"absolute",padding:K,boxSizing:"border-box","--position-transform":ae||"none"}})():{...R,position:"absolute",padding:K,boxSizing:"border-box"};return r.jsx(Jr,{children:r.jsx("div",{className:ve.imgWrapper,onClick:re,children:r.jsx("img",{ref:ee===T?W:null,className:ze(ve.imageStyle,{[ve.contain]:N.image.objectFit==="contain",[ve.cover]:N.image.objectFit==="cover",[ve.scaleSlide]:O.type==="scale"}),src:N.image.url,alt:N.image.name??"",style:{...D,pointerEvents:N.image.objectFit==="contain"?"none":"auto"}})})},ee)})},C),f.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:ze(ve.arrow,{[ve.arrowVertical]:O.direction==="vert"}),style:{color:f.color,"--arrow-hover-color":f.hover},children:r.jsxs("button",{className:ve.arrowInner,style:{transform:`translate(${P.scalingValue(f.offset.x,a)}, ${P.scalingValue(f.offset.y*(O.direction==="horiz"?1:-1),a)}) scale(${f.scale}) rotate(${O.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var N;return(N=y.current)==null?void 0:N.go("-1")},"aria-label":"Previous",children:[f.arrowsImgUrl&&r.jsx(Qt,{url:f.arrowsImgUrl,fill:f.color,hoverFill:f.hover,className:ze(ve.arrowImg,ve.mirror)}),!f.arrowsImgUrl&&r.jsx(La,{color:f.color,className:ze(ve.arrowIcon,ve.arrowImg,ve.mirror)})]})}),r.jsx("div",{className:ze(ve.arrow,ve.nextArrow,{[ve.arrowVertical]:O.direction==="vert"}),style:{color:f.color,"--arrow-hover-color":f.hover},children:r.jsxs("button",{className:ve.arrowInner,style:{transform:`translate(${P.scalingValue(f.offset.x*(O.direction==="horiz"?-1:1),a)}, ${P.scalingValue(f.offset.y,a)}) scale(${f.scale}) rotate(${O.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var N;return(N=y.current)==null?void 0:N.go("+1")},"aria-label":"Next",children:[f.arrowsImgUrl&&r.jsx(Qt,{url:f.arrowsImgUrl,fill:f.color,hoverFill:f.hover,className:ve.arrowImg}),!f.arrowsImgUrl&&r.jsx(La,{color:f.color,className:ze(ve.arrowIcon,ve.arrowImg)})]})})]}),de.closeIconUrl&&(()=>{const N=io(de.closeIconAlign,de.closeIconOffset,a),ee=`scale(${de.closeIconScale})`,R=N.transform?`${N.transform} ${ee}`:ee;return r.jsx("button",{className:ve.closeButton,style:{...N,transform:R},onClick:j,"aria-label":"Close lightbox",children:r.jsx(Qt,{url:de.closeIconUrl,fill:de.closeIconColor??"#000000",hoverFill:de.closeIconHover??"#cccccc"})})})(),be&&be.isActive&&i.imageCaption&&((Ie=n[T])==null?void 0:Ie.imageCaption)&&r.jsx("div",{className:ve.caption,style:{...io(be.alignment,be.offset,a),fontFamily:qo(m.fontFamily),fontWeight:m.fontWeight,fontStyle:m.fontStyle,width:c.sizing==="auto"?"max-content":P.scalingValue(c.width,a),letterSpacing:P.scalingValue(p,a),wordSpacing:P.scalingValue(w,a),textAlign:b,fontSize:P.scalingValue(S.fontSize,a),lineHeight:P.scalingValue(S.lineHeight,a),textTransform:g.textTransform??"none",textDecoration:g.textDecoration??"none",fontVariant:g.fontVariant??"normal",color:v},onClick:N=>N.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:ve.captionTextInner,style:{"--link-color":be.linkColor,"--link-hover-color":be.linkHoverColor},children:r.jsx(ui,{content:n[T].imageCaption})})}),ce.isActive&&(()=>{const[N,ee]=ce.position.split("-"),R=O.direction==="horiz"?`${N}-left`:ce.position,K=io(R,ce.offset,a),D=()=>{if(O.direction==="horiz"){if(ee==="left")return"flex-start";if(ee==="center")return"center";if(ee==="right")return"flex-end"}else{if(N==="top")return"flex-start";if(N==="middle")return"center";if(N==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:z,className:ve.thumbsWrapper,onClick:ae=>Ce(ae),style:{position:a?"absolute":"fixed",...K,...O.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:ze(ve.thumbsContainer,{[ve.thumbsContainerVertical]:O.direction==="vert",[ve.thumbsAlignStart]:ce.align==="start",[ve.thumbsAlignCenter]:ce.align==="center",[ve.thumbsAlignEnd]:ce.align==="end"}),style:{gap:P.scalingValue(ce.grid.gap,a),justifyContent:B?"flex-start":D()},children:n.map((ae,ne)=>{const ye=ne===T,ke=E[ne],xe=ce.grid.size*(ye?ce.activeState.scale:1),Ke=()=>{if(ce.fit!=="fit")return{};if(!ke)return O.direction==="horiz"?{height:P.scalingValue(xe,a)}:{width:P.scalingValue(xe,a)};const se=ke.width/ke.height;if(O.direction==="horiz"){const Ae=xe,Ne=Ae*se;return{width:P.scalingValue(Ne,a),height:P.scalingValue(Ae,a)}}else{const Ae=xe,Ne=Ae/se;return{width:P.scalingValue(Ae,a),height:P.scalingValue(Ne,a)}}};return r.jsx("button",{className:ve.thumbItem,style:{...O.direction==="horiz"&&ce.fit!=="fit"?{height:P.scalingValue(xe,a)}:{},...O.direction==="vert"&&ce.fit!=="fit"?{width:P.scalingValue(xe,a)}:{},...ce.fit==="cover"?{width:P.scalingValue(xe,a),height:P.scalingValue(xe,a)}:{},...Ke(),transition:ye?"all 0.25s ease-out":"none",opacity:ye?ce.activeState.opacity/100:ce.opacity/100,"--thumb-hover":ce.activeState.opacity/100},onClick:se=>{var Ae;se.stopPropagation(),$(ne),(Ae=y.current)==null||Ae.go(ne)},onMouseEnter:()=>{var se;ce.triggers==="hov"&&((se=y.current)==null||se.go(ne))},children:r.jsx("img",{src:ae.image.url,alt:ae.image.name??"",onLoad:se=>{const Ae=se.currentTarget;Ae.naturalWidth&&Ae.naturalHeight&&J(Ne=>({...Ne,[ne]:{width:Ae.naturalWidth,height:Ae.naturalHeight}}))},style:{objectFit:ce.fit==="cover"?"cover":"contain",...ce.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...ce.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${ae.image.name}-${ne}`)})})})})()]})]}),document.getElementById(s))};function La({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 hu={element:mu,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 oo(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function fu(e){return`
|
|
6
|
+
*/const sd="RichTextRenderer-module__link___BWeZ2",ld={link:sd},cd=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))},Do=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>cd(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function qt(e){const{color:t,...n}=e;return n}function At(e,t){var o,s,a;const{fontSize:n,lineHeight:i}=e;return{fontFamily:Do(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:I.scalingValue(e.letterSpacing,t),wordSpacing:I.scalingValue(e.wordSpacing,t),fontSize:I.scalingValue(n,t),lineHeight:i!==void 0?I.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(s=e.textAppearance)==null?void 0:s.textDecoration,fontVariant:(a=e.textAppearance)==null?void 0:a.fontVariant,textAlign:e.textAlign,color:e.color}}const ui=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:ld.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:dd(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 dd(e){return{...e.fontFamily&&{fontFamily:Do(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 ud="SvgImage-module__svg___q3xE-",pd="SvgImage-module__img___VsTm-",ba={svg:ud,img:pd},md=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},gd=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,Qt=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[s,a]=l.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return l.useEffect(()=>{if(typeof window<"u"&&window.CSS){const u=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');a(u)}},[]),!md(e)||!s?r.jsx("img",{src:e,alt:"",className:Je(ba.img,i),style:o}):r.jsx("span",{"data-supports-mask":s,className:Je(ba.svg,i),style:{"--svg":gd(e),"--fill":t,"--hover-fill":n,...o??{}}})},hd={"top-left":Pe.topLeftAlignment,"top-center":Pe.topCenterAlignment,"top-right":Pe.topRightAlignment,"middle-left":Pe.middleLeftAlignment,"middle-center":Pe.middleCenterAlignment,"middle-right":Pe.middleRightAlignment,"bottom-left":Pe.bottomLeftAlignment,"bottom-center":Pe.bottomCenterAlignment,"bottom-right":Pe.bottomRightAlignment};function fd({settings:e,content:t,styles:n,isEditor:i}){const[o,s]=l.useState(null),{widthSettings:a,fontSettings:u,letterSpacing:c,textAlign:m,wordSpacing:p,fontSizeLineHeight:P,textAppearance:x,color:$}=n.imageCaption??{},[g,y]=l.useState(void 0),[C,w]=l.useState(null),[E,T]=l.useState(0),[F,M]=l.useState(0),{direction:W,transition:_,controls:L,pagination:U,imageCaption:v,triggers:R}=e,N=l.useRef(_.type),{x:D,y:ne}=e.controls.offset,pe=K=>{o&&o.go(K)};return l.useEffect(()=>{if(!C)return;const K=new ResizeObserver(B=>{if(!o)return;const[Z]=B;y({width:Math.round(Z.contentRect.width),height:Math.round(Z.contentRect.height)})});return K.observe(C),()=>K.unobserve(C)},[C]),l.useEffect(()=>{!o||N.current===_.type||(M(K=>K+1),N.current=_.type)},[_.type]),r.jsx("div",{className:Je(Pe.wrapper,{[Pe.editor]:i}),ref:w,children:r.jsxs("div",{className:Pe.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:_.backgroundColor&&_.type==="fade in"?_.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:Je(Pe.captionBlock),children:r.jsx("div",{className:Pe.captionTextWrapper,children:t.map((K,B)=>r.jsx("div",{className:Je(Pe.captionText,hd[v.alignment],{[Pe.withPointerEvents]:B===E&&i,[Pe.active]:B===E}),style:{fontFamily:Do(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:a.sizing==="auto"?"max-content":I.scalingValue(a.width,i),letterSpacing:I.scalingValue(c,i),wordSpacing:I.scalingValue(p,i),textAlign:m,fontSize:I.scalingValue(P.fontSize,i),lineHeight:I.scalingValue(P.lineHeight,i),textTransform:x.textTransform??"none",textDecoration:x.textDecoration??"none",fontVariant:x.fontVariant??"normal",color:$,transitionDuration:_.duration?`${Math.round(parseInt(_.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:Pe.captionTextInner,style:{"--link-hover-color":v.linkHoverColor,"--link-color":v.linkColor,position:"relative",top:I.scalingValue(v.offset.y,i),left:I.scalingValue(v.offset.x,i)},children:r.jsx(ui,{content:K.imageCaption})})},B))})}),r.jsx(Xr,{onMove:K=>{T(K.index)},ref:s,options:{arrows:!1,speed:_.duration?parseInt(_.duration):500,autoplay:R.autoPlay!==null,...R.autoPlay!==null&&{interval:parseInt(R.autoPlay)*1e3},direction:W==="horiz"||_.type==="fade in"?"ltr":"ttb",pagination:!1,drag:R.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:_.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((K,B)=>r.jsx(Yr,{children:r.jsx("div",{className:Pe.sliderItem,children:r.jsx("div",{className:Pe.imgWrapper,children:r.jsx("img",{className:Je(Pe.sliderImage,{[Pe.contain]:K.image.objectFit==="contain",[Pe.cover]:K.image.objectFit==="cover"}),src:K.image.url,alt:K.image.name??""})})})},B))},F),L.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:Je(Pe.arrow,{[Pe.arrowVertical]:W==="vert",[Pe.hoverArrow]:L.show==="on hover"}),style:{color:L.color,"--arrow-hover-color":L.hover},children:r.jsxs("button",{onClick:()=>{pe("-1")},className:Pe.arrowInner,style:{transform:`translate(${I.scalingValue(D,i)}, ${I.scalingValue(ne*(W==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${W==="horiz"?"0deg":"90deg"})`},children:[L.arrowsImgUrl&&r.jsx(Qt,{url:L.arrowsImgUrl,fill:L.color,hoverFill:L.hover,className:Je(Pe.arrowImg,Pe.mirror)}),!L.arrowsImgUrl&&r.jsx(xa,{color:L.color,className:Je(Pe.arrowIcon,Pe.arrowImg,Pe.mirror)})]})}),r.jsx("div",{className:Je(Pe.arrow,Pe.nextArrow,{[Pe.arrowVertical]:W==="vert",[Pe.hoverArrow]:L.show==="on hover"}),style:{color:L.color,"--arrow-hover-color":L.hover},children:r.jsxs("button",{className:Pe.arrowInner,onClick:()=>pe("+1"),style:{transform:`translate(${I.scalingValue(D*(W==="horiz"?-1:1),i)}, ${I.scalingValue(ne,i)}) scale(${e.controls.scale/100}) rotate(${W==="horiz"?"0deg":"90deg"})`},children:[L.arrowsImgUrl&&r.jsx(Qt,{url:L.arrowsImgUrl,fill:L.color,hoverFill:L.hover,className:Pe.arrowImg}),!L.arrowsImgUrl&&r.jsx(xa,{color:L.color,className:Je(Pe.arrowIcon,Pe.arrowImg)})]})})]}),R.triggersList.click&&r.jsx("div",{className:Pe.clickOverlay,onClick:()=>{o&&o.go("+1")}}),U.isActive&&r.jsx("div",{className:Je(Pe.pagination,{[Pe.paginationInsideBottom]:U.position==="inside-1"&&W==="horiz",[Pe.paginationInsideTop]:U.position==="inside-2"&&W==="horiz",[Pe.paginationOutsideBottom]:U.position==="outside-1"&&W==="horiz",[Pe.paginationOutsideTop]:U.position==="outside-2"&&W==="horiz",[Pe.paginationInsideLeft]:U.position==="inside-1"&&W==="vert",[Pe.paginationInsideRight]:U.position==="inside-2"&&W==="vert",[Pe.paginationOutsideLeft]:U.position==="outside-1"&&W==="vert",[Pe.paginationOutsideRight]:U.position==="outside-2"&&W==="vert",[Pe.paginationVertical]:W==="vert"}),children:r.jsx("div",{className:Pe.paginationInner,style:{backgroundColor:U.colors[2],transform:`scale(${U.scale/100}) translate(${I.scalingValue(U.offset.x,i)}, ${I.scalingValue(U.offset.y,i)}) rotate(${W==="horiz"?"0deg":"90deg"})`},children:t.map((K,B)=>r.jsx("button",{onClick:()=>{o&&o.go(B)},className:Je(Pe.paginationItem),children:r.jsx("div",{className:Je(Pe.dot,{[Pe.activeDot]:B===E}),style:{backgroundColor:B===E?U.colors[0]:U.colors[1],"--pagination-hover-color":U.hover}})},B))})})]})})}function xa({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 yd={element:fd,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"]}},vd="ImageRevealSlider-module__imageRevealSlider___UE5Ob",bd="ImageRevealSlider-module__image___Qjt-e",xd="ImageRevealSlider-module__link___N-iLG",wd="ImageRevealSlider-module__cursor___2U03d",Qn={imageRevealSlider:vd,image:bd,link:xd,cursor:wd};function wa(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const s=i.width?Number.parseFloat(i.width):o.naturalWidth,a=o.naturalHeight/o.naturalWidth*s,u=s/2,c=a/2;if(e>=i.x-u&&e<=i.x+u&&t>=i.y-c&&t<=i.y+c)return!0}return!1}function or(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function $d(e,t,n,i){let o,s;if(t==="custom"){o=n;const a=await or(e);s=a.height/a.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const a=await or(e);s=a.height/a.width*o}else{const a=await or(e);o=a.width,s=a.height}return{width:o,height:s,finalWidth:`${o}px`}}function Sd({settings:e,content:t,isEditor:n}){const[i,o]=l.useState(null),[s,a]=l.useState([]),[u,c]=l.useState(0),m=l.useRef(0),[p,P]=l.useState({x:0,y:0}),[x,$]=l.useState(1),[g,y]=l.useState("none"),C=l.useRef({x:0,y:0}),[w,E]=l.useState(!1),{sizeType:T,imageWidth:F,randomRangeImageWidth:M}=e.imageSize,{revealPosition:W,visible:_}=e.position,{cursorType:L,target:U,defaultCursorScale:v,defaultCursor:R,hoverCursorScale:N,hoverCursor:D}=e.cursor;l.useEffect(()=>{if(!i)return;const K=(q,O)=>{const Y=i.getBoundingClientRect(),ae=q-Y.left,oe=O-Y.top;if(P({x:ae,y:oe}),L==="system"){y("none"),$(1);return}const H=ae,ue=oe,f=document.elementFromPoint(Y.left+H,Y.top+ue);if(f&&f.closest("a")){y("none"),$(1);return}const me=wa(H,ue,s)||U==="area"?{img:D??"none",scale:N}:{img:R??"none",scale:v};y(me.img),$(me.scale)},B=q=>{q.stopPropagation(),C.current={x:q.clientX,y:q.clientY},K(q.clientX,q.clientY)},Z=()=>{w&&K(C.current.x,C.current.y)};return i.addEventListener("mousemove",B),window.addEventListener("scroll",Z,!0),()=>{i.removeEventListener("mousemove",B),window.removeEventListener("scroll",Z,!0)}},[i,w,p,L,U,D,R,N,v,s]),l.useEffect(()=>{w||(y("none"),$(0))},[w]);const ne=async(K,B,Z,q={})=>{const{width:O,height:Y,finalWidth:ae}=await $d(K.image.url,T,F,M);let oe=0,H=0;W==="same"?(oe=B/2,H=Z/2):(oe=q.x??Math.random()*B,H=q.y??Math.random()*Z);const ue=Math.min(Math.max(oe,O/2),B-O/2),f=Math.min(Math.max(H,Y/2),Z-Y/2);return{id:m.current++,url:K.image.url,link:K.link,name:K.image.name,x:ue,y:f,width:ae}};l.useEffect(()=>{if(!i||t.length===0)return;const K=i.getBoundingClientRect(),B=K.width,Z=K.height,q=[];(async()=>{const Y=t[0],ae=await ne(Y,B,Z);q.push(ae),a(q),c(1)})()},[T,F,M,W,i]),l.useEffect(()=>{_==="last One"&&a(K=>K.length>0?[K[K.length-1]]:[])},[_]);const pe=async K=>{if(!i)return;const B=i.getBoundingClientRect(),Z=K.clientX-B.left,q=K.clientY-B.top;if(U==="image"&&!wa(Z,q,s))return;let O=0,Y=0;W==="on Click"?(O=Z,Y=q):W==="same"?(O=B.width/2,Y=B.height/2):(O=Math.random()*B.width,Y=Math.random()*B.height);const ae=t[u],oe=await ne(ae,B.width,B.height,{x:O,y:Y});a(H=>_==="all"?[...H,oe]:[oe]),c(H=>H>=t.length-1?0:H+1)};return r.jsxs("div",{ref:o,onClick:pe,onMouseEnter:()=>E(!0),onMouseLeave:()=>E(!1),className:Qn.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[s.map(K=>r.jsx("div",{className:Qn.wrapper,style:{top:`${K.y}px`,left:`${K.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:K.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:U==="area"&&K.link?r.jsx("a",{href:K.link,target:"_blank",className:Qn.link,children:r.jsx("img",{src:K.url,alt:K.name,className:Qn.image},K.id)}):r.jsx("img",{src:K.url,alt:K.name,className:Qn.image},K.id)},K.id)),w&&r.jsx("div",{className:Qn.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${x})`,backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Cd={element:Sd,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:""}]}}}},Td="LightBox-module__hidden___9s-9x",Ld="LightBox-module__heroImage___sTxNF",Ed="LightBox-module__background___rm9ml",Pd="LightBox-module__editor___4ACaY",Id="LightBox-module__contentStyle___Bgnsq",Rd="LightBox-module__imageStyle___tLIlB",Md="LightBox-module__imgWrapper___LuFUp",Ad="LightBox-module__contain___8-yaS",kd="LightBox-module__cover___hNvOG",_d="LightBox-module__caption___b6L2I",Fd="LightBox-module__captionTextInner___rCGNH",Wd="LightBox-module__lightboxSplide___XFuWC",Nd="LightBox-module__arrow___iz38X",Hd="LightBox-module__arrowVertical___Zfz81",Od="LightBox-module__nextArrow___zkAQN",Bd="LightBox-module__arrowInner___p48sW",jd="LightBox-module__arrowIcon___3VaFf",zd="LightBox-module__arrowImg___pNV88",Vd="LightBox-module__mirror___pjeXc",Dd="LightBox-module__thumbsWrapper___GB-nU",qd="LightBox-module__thumbsContainerVertical___wttk5",Kd="LightBox-module__thumbsContainer___osSma",Gd="LightBox-module__thumbsAlignStart___MO6tY",Ud="LightBox-module__thumbsAlignCenter___Q4sUx",Xd="LightBox-module__thumbsAlignEnd___p4y9R",Yd="LightBox-module__thumbItem___HvnF3",Jd="LightBox-module__closeButton___g2khP",Zd="LightBox-module__fadeIn___0m5GW",Qd="LightBox-module__slideInLeft___gPYwC",eu="LightBox-module__slideInRight___S-pPp",tu="LightBox-module__slideInTop___DFdAj",nu="LightBox-module__slideInBottom___m27kZ",iu="LightBox-module__fadeOut___55qBR",ou="LightBox-module__slideOutLeft___NvU7P",ru="LightBox-module__slideOutRight___SK7eC",au="LightBox-module__slideOutTop___Vgg0z",su="LightBox-module__slideOutBottom___nJ0Ef",lu="LightBox-module__scaleSlide___vZriG",he={hidden:Td,heroImage:Ld,background:Ed,editor:Pd,contentStyle:Id,imageStyle:Rd,imgWrapper:Md,contain:Ad,cover:kd,caption:_d,captionTextInner:Fd,lightboxSplide:Wd,arrow:Nd,arrowVertical:Hd,nextArrow:Od,arrowInner:Bd,arrowIcon:jd,arrowImg:zd,mirror:Vd,thumbsWrapper:Dd,thumbsContainerVertical:qd,thumbsContainer:Kd,thumbsAlignStart:Gd,thumbsAlignCenter:Ud,thumbsAlignEnd:Xd,thumbItem:Yd,closeButton:Jd,fadeIn:Zd,slideInLeft:Qd,slideInRight:eu,slideInTop:tu,slideInBottom:nu,fadeOut:iu,slideOutLeft:ou,slideOutRight:ru,slideOutTop:au,slideOutBottom:su,scaleSlide:lu},no=(e,t,n)=>{const i={},[o,s]=e.split("-");return o==="top"?(i.top="0",i.bottom="auto"):o==="middle"?(i.top="50%",i.bottom="auto"):o==="bottom"&&(i.top="auto",i.bottom="0"),s==="left"?(i.left="0",i.right="auto"):s==="center"?(i.left="50%",i.right="auto"):s==="right"&&(i.left="auto",i.right="0"),o==="middle"&&s==="center"?i.transform=`translate(calc(-50% + ${I.scalingValue(t.x,n)}), calc(-50% + ${I.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${I.scalingValue(t.x,n)}, calc(-50% + ${I.scalingValue(t.y,n)}))`:s==="center"?i.transform=`translate(calc(-50% + ${I.scalingValue(t.x,n)}), ${I.scalingValue(t.y,n)})`:i.transform=`translate(${I.scalingValue(t.x,n)}, ${I.scalingValue(t.y,n)})`,i};function Ds(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 $a(e){const t=e.getBoundingClientRect(),n=Ds(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),s=e.naturalWidth,a=e.naturalHeight,u=i/o,c=s/a;let m,p;c>u?(m=i,p=i/c):(p=o,m=o*c);const P=t.left+n.left,x=t.top+n.top,$=(i-m)/2+P,g=(o-p)/2+x;return{x:$,y:g,width:m,height:p}}function Sa(e){const t=e.getBoundingClientRect(),n=Ds(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Ca(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 cu(e,t){const n=(()=>{if(e==="fade in")return he.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return he.slideInLeft;case"right":return he.slideInRight;case"top":return he.slideInTop;case"bottom":return he.slideInBottom;default:return he.slideInRight}return he.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return he.fadeIn;if(e==="slide in")switch(t){case"left":return he.slideInLeft;case"right":return he.slideInRight;case"top":return he.slideInTop;case"bottom":return he.slideInBottom;default:return he.slideInRight}return he.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return he.fadeOut;if(e==="slide in")switch(t){case"left":return he.slideOutLeft;case"right":return he.slideOutRight;case"top":return he.slideOutTop;case"bottom":return he.slideOutBottom;default:return he.slideOutRight}return he.fadeOut})(),s=(()=>{if(e==="fade in")return he.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return he.slideOutLeft;case"right":return he.slideOutRight;case"top":return he.slideOutTop;case"bottom":return he.slideOutBottom;default:return he.slideOutRight}return he.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:s}}const du=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:s,isPreviewMode:a})=>{const[u,c]=l.useState(!1),{url:m}=e.thumbnailBlock.cover;return l.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:m,alt:"Cover",className:he.heroImage,onClick:()=>c(!0)}),r.jsx(uu,{isOpen:u,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:s})]})},uu=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:s,isEditor:a,metadata:u})=>{var Ee;const{widthSettings:c,fontSettings:m,letterSpacing:p,textAlign:P,wordSpacing:x,fontSizeLineHeight:$,textAppearance:g,color:y}=i.imageCaption??{},[C,w]=l.useState(0),[E,T]=l.useState(0),[F,M]=l.useState(!1),[W,_]=l.useState(!1),[L,U]=l.useState({}),v=l.useRef(null),R=l.useRef(null),N=l.useRef(null),D=l.useRef(!1),ne=l.useRef(null),pe=l.useRef(null),K=l.useRef(null),B=l.useRef(null),Z=l.useRef(!1),q=l.useRef(null),[O,Y]=l.useState(!1),{appear:ae,triggers:oe,slider:H,thumbnail:ue,controls:f,area:me,caption:fe,layout:ye}=o.lightboxBlock,{appearClass:Me,backdropAppearClass:ee,backdropDisappearClass:ge,disappearClass:X}=cu(ae.type,ae.direction),be=(u==null?void 0:u.itemId)??null;l.useEffect(()=>{const A=()=>{setTimeout(()=>{var S,j;(j=(S=v.current)==null?void 0:S.splide)==null||j.refresh()},16)},G=()=>{T(S=>S+1)};return window.addEventListener("ArticleEditor.Layout:change",A),window.addEventListener("ArticleEditor.ComponentContent:change",G),()=>{window.removeEventListener("ArticleEditor.Layout:change",A),window.removeEventListener("ArticleEditor.ComponentContent:change",G)}},[]),l.useEffect(()=>{if(!e||!ue.isActive){Y(!1);return}const A=q.current;if(!A)return;const G=()=>{H.direction==="horiz"?Y(A.scrollWidth>A.clientWidth):Y(A.scrollHeight>A.clientHeight)};G();const S=new ResizeObserver(G);return S.observe(A),()=>S.disconnect()},[e,ue.isActive,n.length,L,H.direction]);const te=l.useCallback(()=>{const A=window.matchMedia("(max-width: 768px)").matches,G=Ca(me.color);A&&!a&&G>.9&&(document.body.style.backgroundColor=""),M(!0),D.current=!0;const S=j=>{j.target===ne.current&&j.animationName&&(ne.current&&pe.current&&ne.current.removeEventListener("animationend",pe.current),pe.current=null,D.current&&(D.current=!1,t()),M(!1))};ne.current&&(pe.current=S,ne.current.addEventListener("animationend",S))},[t,me.color,a]),ie=(A,G,S)=>{var j,z;if(A){if(oe.type==="click"&&oe.switch==="image")oe.repeat==="close"&&C===n.length-1?te():(j=v.current)==null||j.go("+1");else if(oe.type==="click"&&oe.switch==="50/50"){const Q=A.getBoundingClientRect(),se=G-Q.left,Te=S-Q.top,Fe=Q.width,Ie=Q.height;let $e;H.direction==="horiz"?$e=se<Fe/2?"-1":"+1":$e=Te<Ie/2?"-1":"+1",(z=v.current)==null||z.go($e)}}},J=A=>{if(Z.current){Z.current=!1;return}const G=n[C],S=(G==null?void 0:G.image.objectFit)==="cover";let j,z;if("changedTouches"in A&&A.changedTouches.length>0)j=A.changedTouches[0].clientX,z=A.changedTouches[0].clientY;else if("clientX"in A)j=A.clientX,z=A.clientY;else return;let Q;if(S&&N.current){const se=Sa(N.current);Q=j>=se.left&&j<=se.right&&z>=se.top&&z<=se.bottom}else{const se=N.current?$a(N.current):null;if(!se){A.target===A.currentTarget&&te();return}Q=j>=se.x&&j<=se.x+se.width&&z>=se.y&&z<=se.y+se.height}Q?ie(N.current,j,z):te()},xe=A=>{const G=A.target;(G.classList.contains(he.thumbsWrapper)||G.classList.contains(he.thumbsContainer))&&J(A)};l.useEffect(()=>{if(!e)return;const A=G=>{var S,j;if(G.key==="Escape"){te();return}if(G.key==="ArrowRight"){w(z=>(z+1)%Math.max(n.length,1)),(S=v.current)==null||S.go("+1");return}G.key==="ArrowLeft"&&(w(z=>(z-1+Math.max(n.length,1))%Math.max(n.length,1)),(j=v.current)==null||j.go("-1"))};return window.addEventListener("keydown",A),()=>{window.removeEventListener("keydown",A)}},[e,te,n.length]),l.useEffect(()=>{if(e){if(w(0),T(G=>G+1),D.current=!1,M(!1),_(!1),U({}),!be)return;const A=new CustomEvent("page-overlay",{detail:{itemId:be}});window.dispatchEvent(A)}return()=>{ne.current&&pe.current&&(ne.current.removeEventListener("animationend",pe.current),pe.current=null),_(!1)}},[e,be]),l.useEffect(()=>{R.current!==null&&R.current!==H.type&&T(A=>A+1),R.current=H.type},[H.type]),l.useEffect(()=>{if(!e)return;const A=document.body.style.overflow,G=window.matchMedia("(max-width: 768px)").matches,S=Ca(me.color);document.body.style.overflow="hidden",_(!1);const j=Q=>{Q.target===ne.current&&!D.current&&Q.animationName&&(G&&!a&&S>.9&&(document.body.style.backgroundColor=me.color),_(!0),ne.current&&K.current&&ne.current.removeEventListener("animationend",K.current),K.current=null)};ne.current&&(K.current=j,ne.current.addEventListener("animationend",j));const z=Q=>{const se=Q.target;se&&(se.closest(`.${he.thumbsWrapper}`)||se.closest(`.${he.thumbsContainer}`))||H.type!=="slide"&&Q.preventDefault()};return document.addEventListener("touchmove",z,{passive:!1}),()=>{document.body.style.overflow=A,document.removeEventListener("touchmove",z),ne.current&&K.current&&(ne.current.removeEventListener("animationend",K.current),K.current=null),_(!1)}},[e,a,me.color,H.type]),l.useEffect(()=>{if(!e)return;const A=G=>{var j,z;if(D.current){G.stopPropagation();return}if(Z.current){Z.current=!1;return}const S=G.target;if(!(S&&(S.closest(`.${he.thumbsContainer}`)||S.closest(`.${he.thumbItem}`)||S.closest(`.${he.arrow}`)||S.closest(`.${he.closeButton}`)||S.closest(`.${he.caption}`)))){if(H.type==="slide"&&oe.type==="drag"&&((z=(j=v.current)==null?void 0:j.splide)!=null&&z.root)){const Q=v.current.splide.root;if(S&&(Q.contains(S)||Q===S))return}if(G.touches.length===0&&G.changedTouches.length>0){const Q=n[C],se=(Q==null?void 0:Q.image.objectFit)==="cover",Te=G.changedTouches[0];let Fe;if(se&&N.current){const Ie=Sa(N.current);Fe=Te.clientX>=Ie.left&&Te.clientX<=Ie.right&&Te.clientY>=Ie.top&&Te.clientY<=Ie.bottom}else{const Ie=N.current?$a(N.current):null;if(!Ie)return;Fe=Te.clientX>=Ie.x&&Te.clientX<=Ie.x+Ie.width&&Te.clientY>=Ie.y&&Te.clientY<=Ie.y+Ie.height}if(!Fe){G.stopPropagation(),D.current=!0;const Ie=$e=>{$e.stopPropagation(),$e.preventDefault(),document.removeEventListener("click",Ie,!0)};document.addEventListener("click",Ie,!0),te()}}}};return document.addEventListener("touchend",A,{passive:!0}),()=>{document.removeEventListener("touchend",A)}},[e,te,C,n]);const Se=(H.type==="scale"||H.type==="fade")&&H.direction==="vert"&&oe.type==="drag";l.useEffect(()=>{var $e,tt;if(!e||!Se||!((tt=($e=v.current)==null?void 0:$e.splide)!=null&&tt.root))return;const A=v.current.splide.root,G=30,S=(le,Ae)=>{if(B.current){const ze=Math.abs(le-B.current.x),Ve=Math.abs(Ae-B.current.y);(ze>0||Ve>0)&&(Z.current=!0)}},j=le=>{B.current&&(le.preventDefault(),S(le.clientX,le.clientY))},z=le=>{B.current&&le.touches.length>0&&(le.preventDefault(),S(le.touches[0].clientX,le.touches[0].clientY))},Q=(le,Ae)=>{if(!B.current||!v.current){B.current=null;return}const ze=Math.abs(le-B.current.x),Ve=Math.abs(Ae-B.current.y);Ve>G&&Ve>ze&&v.current.go(Ae<B.current.y?"+1":"-1"),B.current=null},se=le=>{B.current&&Q(le.clientX,le.clientY),document.removeEventListener("pointerup",se),document.removeEventListener("pointercancel",se),document.removeEventListener("pointermove",j)},Te=le=>{if(B.current){if(le.changedTouches.length>0){const Ae=le.changedTouches[0];Q(Ae.clientX,Ae.clientY)}document.removeEventListener("touchend",Te),document.removeEventListener("touchcancel",Te),document.removeEventListener("touchmove",z)}},Fe=le=>{B.current={x:le.clientX,y:le.clientY},Z.current=!1,document.addEventListener("pointermove",j,{passive:!1}),document.addEventListener("pointerup",se),document.addEventListener("pointercancel",se)},Ie=le=>{le.touches.length>0&&(B.current={x:le.touches[0].clientX,y:le.touches[0].clientY},Z.current=!1,document.addEventListener("touchmove",z,{passive:!1}),document.addEventListener("touchend",Te),document.addEventListener("touchcancel",Te))};return A.addEventListener("pointerdown",Fe),A.addEventListener("touchstart",Ie),()=>{A.removeEventListener("pointerdown",Fe),A.removeEventListener("touchstart",Ie),document.removeEventListener("pointermove",j),document.removeEventListener("pointerup",se),document.removeEventListener("pointercancel",se),document.removeEventListener("touchmove",z),document.removeEventListener("touchend",Te),document.removeEventListener("touchcancel",Te),B.current=null,Z.current=!1}},[e,Se,E]);const ve={backgroundColor:me.color,backdropFilter:`blur(${me.blur}px)`,animationDuration:`${parseInt(ae.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(s)?null:Bi.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:a?null:ne,className:Je(he.background,F?ge:ee,{[he.editor]:a},{[he.hidden]:!e}),style:{...ve,...W&&!a&&!F?{position:"absolute"}:{}}}),r.jsxs("div",{ref:a?ne:null,className:Je(he.contentStyle,F?X:Me,{[he.editor]:a},{[he.hidden]:!e}),style:{animationDuration:`${parseInt(ae.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(Xr,{onMove:A=>w(A.index),ref:v,className:he.lightboxSplide,options:{arrows:!1,speed:H.duration?parseInt(H.duration):500,direction:H.direction==="horiz"||H.type==="fade"||H.type==="scale"?"ltr":"ttb",pagination:!1,drag:oe.type==="drag"&&!Se,perPage:1,width:"100%",height:"100%",type:H.type==="fade"||H.type==="scale"?"fade":"loop",padding:0,rewind:oe.repeat!=="close",start:0},style:{"--splide-speed":H.duration},children:n.map((A,G)=>{const S=no(ye.position,ye.offset,a),j=`${I.scalingValue(ye.padding.top,a)} ${I.scalingValue(ye.padding.right,a)} ${I.scalingValue(ye.padding.bottom,a)} ${I.scalingValue(ye.padding.left,a)}`,z=H.type==="scale"?(()=>{const{transform:Q,...se}=S;return{...se,position:"absolute",padding:j,boxSizing:"border-box","--position-transform":Q||"none"}})():{...S,position:"absolute",padding:j,boxSizing:"border-box"};return r.jsx(Yr,{children:r.jsx("div",{className:he.imgWrapper,onClick:J,children:r.jsx("img",{ref:G===C?N:null,className:Je(he.imageStyle,{[he.contain]:A.image.objectFit==="contain",[he.cover]:A.image.objectFit==="cover",[he.scaleSlide]:H.type==="scale"}),src:A.image.url,alt:A.image.name??"",style:{...z,pointerEvents:A.image.objectFit==="contain"?"none":"auto"}})})},G)})},E),f.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:Je(he.arrow,{[he.arrowVertical]:H.direction==="vert"}),style:{color:f.color,"--arrow-hover-color":f.hover},children:r.jsxs("button",{className:he.arrowInner,style:{transform:`translate(${I.scalingValue(f.offset.x,a)}, ${I.scalingValue(f.offset.y*(H.direction==="horiz"?1:-1),a)}) scale(${f.scale}) rotate(${H.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var A;return(A=v.current)==null?void 0:A.go("-1")},"aria-label":"Previous",children:[f.arrowsImgUrl&&r.jsx(Qt,{url:f.arrowsImgUrl,fill:f.color,hoverFill:f.hover,className:Je(he.arrowImg,he.mirror)}),!f.arrowsImgUrl&&r.jsx(Ta,{color:f.color,className:Je(he.arrowIcon,he.arrowImg,he.mirror)})]})}),r.jsx("div",{className:Je(he.arrow,he.nextArrow,{[he.arrowVertical]:H.direction==="vert"}),style:{color:f.color,"--arrow-hover-color":f.hover},children:r.jsxs("button",{className:he.arrowInner,style:{transform:`translate(${I.scalingValue(f.offset.x*(H.direction==="horiz"?-1:1),a)}, ${I.scalingValue(f.offset.y,a)}) scale(${f.scale}) rotate(${H.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var A;return(A=v.current)==null?void 0:A.go("+1")},"aria-label":"Next",children:[f.arrowsImgUrl&&r.jsx(Qt,{url:f.arrowsImgUrl,fill:f.color,hoverFill:f.hover,className:he.arrowImg}),!f.arrowsImgUrl&&r.jsx(Ta,{color:f.color,className:Je(he.arrowIcon,he.arrowImg)})]})})]}),me.closeIconUrl&&(()=>{const A=no(me.closeIconAlign,me.closeIconOffset,a),G=`scale(${me.closeIconScale})`,S=A.transform?`${A.transform} ${G}`:G;return r.jsx("button",{className:he.closeButton,style:{...A,transform:S},onClick:te,"aria-label":"Close lightbox",children:r.jsx(Qt,{url:me.closeIconUrl,fill:me.closeIconColor??"#000000",hoverFill:me.closeIconHover??"#cccccc"})})})(),fe&&fe.isActive&&i.imageCaption&&((Ee=n[C])==null?void 0:Ee.imageCaption)&&r.jsx("div",{className:he.caption,style:{...no(fe.alignment,fe.offset,a),fontFamily:Do(m.fontFamily),fontWeight:m.fontWeight,fontStyle:m.fontStyle,width:c.sizing==="auto"?"max-content":I.scalingValue(c.width,a),letterSpacing:I.scalingValue(p,a),wordSpacing:I.scalingValue(x,a),textAlign:P,fontSize:I.scalingValue($.fontSize,a),lineHeight:I.scalingValue($.lineHeight,a),textTransform:g.textTransform??"none",textDecoration:g.textDecoration??"none",fontVariant:g.fontVariant??"normal",color:y},onClick:A=>A.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:he.captionTextInner,style:{"--link-color":fe.linkColor,"--link-hover-color":fe.linkHoverColor},children:r.jsx(ui,{content:n[C].imageCaption})})}),ue.isActive&&(()=>{const[A,G]=ue.position.split("-"),S=H.direction==="horiz"?`${A}-left`:ue.position,j=no(S,ue.offset,a),z=()=>{if(H.direction==="horiz"){if(G==="left")return"flex-start";if(G==="center")return"center";if(G==="right")return"flex-end"}else{if(A==="top")return"flex-start";if(A==="middle")return"center";if(A==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:q,className:he.thumbsWrapper,onClick:Q=>xe(Q),style:{position:a?"absolute":"fixed",...j,...H.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:Je(he.thumbsContainer,{[he.thumbsContainerVertical]:H.direction==="vert",[he.thumbsAlignStart]:ue.align==="start",[he.thumbsAlignCenter]:ue.align==="center",[he.thumbsAlignEnd]:ue.align==="end"}),style:{gap:I.scalingValue(ue.grid.gap,a),justifyContent:O?"flex-start":z()},children:n.map((Q,se)=>{const Te=se===C,Fe=L[se],$e=ue.grid.size*(Te?ue.activeState.scale:1),tt=()=>{if(ue.fit!=="fit")return{};if(!Fe)return H.direction==="horiz"?{height:I.scalingValue($e,a)}:{width:I.scalingValue($e,a)};const le=Fe.width/Fe.height;if(H.direction==="horiz"){const Ae=$e,ze=Ae*le;return{width:I.scalingValue(ze,a),height:I.scalingValue(Ae,a)}}else{const Ae=$e,ze=Ae/le;return{width:I.scalingValue(Ae,a),height:I.scalingValue(ze,a)}}};return r.jsx("button",{className:he.thumbItem,style:{...H.direction==="horiz"&&ue.fit!=="fit"?{height:I.scalingValue($e,a)}:{},...H.direction==="vert"&&ue.fit!=="fit"?{width:I.scalingValue($e,a)}:{},...ue.fit==="cover"?{width:I.scalingValue($e,a),height:I.scalingValue($e,a)}:{},...tt(),transition:Te?"all 0.25s ease-out":"none",opacity:Te?ue.activeState.opacity/100:ue.opacity/100,"--thumb-hover":ue.activeState.opacity/100},onClick:le=>{var Ae;le.stopPropagation(),w(se),(Ae=v.current)==null||Ae.go(se)},onMouseEnter:()=>{var le;ue.triggers==="hov"&&((le=v.current)==null||le.go(se))},children:r.jsx("img",{src:Q.image.url,alt:Q.image.name??"",onLoad:le=>{const Ae=le.currentTarget;Ae.naturalWidth&&Ae.naturalHeight&&U(ze=>({...ze,[se]:{width:Ae.naturalWidth,height:Ae.naturalHeight}}))},style:{objectFit:ue.fit==="cover"?"cover":"contain",...ue.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...ue.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Q.image.name}-${se}`)})})})})()]})]}),document.getElementById(s))};function Ta({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 pu={element:du,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 io(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function mu(e){return`
|
|
7
7
|
.${e}-wrapper {
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
10
10
|
width: 100%;
|
|
11
|
-
min-height: ${
|
|
11
|
+
min-height: ${io(48)};
|
|
12
12
|
}
|
|
13
13
|
.${e}-wrapper.${e}-type-C .${e}-input:focus-visible,
|
|
14
14
|
.${e}-wrapper.${e}-type-C .${e}-button:focus-visible {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
min-width: 0;
|
|
33
33
|
}
|
|
34
34
|
.${e}-field-group.${e}-labeled {
|
|
35
|
-
gap: ${
|
|
35
|
+
gap: ${io(4)};
|
|
36
36
|
}
|
|
37
37
|
.${e}-field-label {
|
|
38
38
|
white-space: nowrap;
|
|
@@ -128,11 +128,11 @@
|
|
|
128
128
|
outline: none;
|
|
129
129
|
}
|
|
130
130
|
.${e}-success {
|
|
131
|
-
margin-top: ${
|
|
131
|
+
margin-top: ${io(8)};
|
|
132
132
|
color: var(--${e}-success-success-color, var(--${e}-success-color));
|
|
133
133
|
}
|
|
134
134
|
.${e}-error {
|
|
135
|
-
margin-top: ${
|
|
135
|
+
margin-top: ${io(8)};
|
|
136
136
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
137
137
|
}
|
|
138
138
|
.${e}-overlay-anchor {
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
pointer-events: auto;
|
|
156
156
|
z-index: 10;
|
|
157
157
|
}
|
|
158
|
-
`}function
|
|
158
|
+
`}function gu({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:s}){const a=!!n,u=i&&t||!t,{prefix:c}=I.useScopedStyles(),{type:m="A",fieldsToShow:p=2,fields:P=[],buttonLabel:x,gap:$,fieldsGap:g,buttonCorners:y,buttonStroke:C,buttonPadding:w,isButtonFullWidth:E,inputCorners:T,inputStroke:F,inputPadding:M,inputColor:W,inputTextColor:_,inputBorderColor:L,placeholderColor:U,buttonColor:v,buttonTextColor:R,buttonBorderColor:N,labelTextColor:D,successColor:ne,errorColor:pe,fontFamily:K,inputFontSettings:B,inputFontSize:Z,inputLineHeight:q,inputLetterSpacing:O,inputWordSpacing:Y,inputTextAppearance:ae,buttonFontSettings:oe,buttonFontSize:H,buttonLineHeight:ue,buttonLetterSpacing:f,buttonWordSpacing:me,buttonTextAppearance:fe,labelFontSettings:ye,labelFontSize:Me,labelLineHeight:ee,labelLetterSpacing:ge,labelWordSpacing:X,labelTextAppearance:be,statusFontSettings:te,statusFontSize:ie,statusLineHeight:J,statusLetterSpacing:xe,statusWordSpacing:Se,statusTextAppearance:ve,successMessage:Ee,errorMessage:A,stateOverrides:G}=e,S=m==="B",j=P.slice(0,Math.min(p,P.length)),z={fontSettings:{fontFamily:K,fontWeight:(B==null?void 0:B.fontWeight)??400,fontStyle:(B==null?void 0:B.fontStyle)??"normal"},fontSize:Z??.01,lineHeight:q,letterSpacing:O??0,wordSpacing:Y??0,textAppearance:ae,color:_},Q=qt(At(z,t)),se=I.scalingValue(F??0,t),Te=I.scalingValue((q??Z??.01)+((M==null?void 0:M.top)??0)+((M==null?void 0:M.bottom)??0)+(m==="C"?F??0:(F??0)*2),t),Fe={...Q,borderStyle:"solid",borderRadius:m==="C"?0:I.scalingValue(T??0,t),...m==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:se,borderLeftWidth:0}:{borderWidth:se},paddingTop:I.scalingValue((M==null?void 0:M.top)??0,t),paddingRight:I.scalingValue((M==null?void 0:M.right)??0,t),paddingBottom:I.scalingValue((M==null?void 0:M.bottom)??0,t),paddingLeft:I.scalingValue((M==null?void 0:M.left)??0,t),height:Te,minHeight:Te},Ie={fontSettings:{fontFamily:K,fontWeight:(oe==null?void 0:oe.fontWeight)??400,fontStyle:(oe==null?void 0:oe.fontStyle)??"normal"},fontSize:H??.01,lineHeight:ue,letterSpacing:f??0,wordSpacing:me??0,textAppearance:fe,color:R},$e=qt(At(Ie,t)),tt=I.scalingValue(C??0,t),le={fontSettings:{fontFamily:K,fontWeight:(ye==null?void 0:ye.fontWeight)??400,fontStyle:(ye==null?void 0:ye.fontStyle)??"normal"},fontSize:Me??.01,lineHeight:ee,letterSpacing:ge??0,wordSpacing:X??0,textAppearance:be,color:D},Ae=At(le,t),ze={fontSettings:{fontFamily:K,fontWeight:(te==null?void 0:te.fontWeight)??400,fontStyle:(te==null?void 0:te.fontStyle)??"normal"},fontSize:ie??.01,lineHeight:J,letterSpacing:xe??0,wordSpacing:Se??0,textAppearance:ve,color:ne},Ve=qt(At(ze,t)),dt=I.buildColorVars(c,{inputColor:W,inputTextColor:_,inputBorderColor:L,placeholderColor:U!=null&&U.trim()?U:"#cccccc",buttonColor:v,buttonTextColor:R,buttonBorderColor:N,labelTextColor:D,successColor:ne,errorColor:pe},hu,fu,G),[ft,Pt]=l.useState(()=>Object.fromEntries(j.map(Oe=>[Oe.name,""]))),[xt,wt]=l.useState("idle"),[Ht,Lt]=l.useState(null),Ge=s==="success"?"success":s==="error"?"error":xt,Re=s==="error"?A:Ht,Be=s==="filled",Ue=l.useMemo(()=>{if(!Be)return ft;let Oe=null;for(const gt of j)(ft[gt.name]??"").trim().length>0||(Oe=Oe??{...ft},Oe[gt.name]="Filled");return Oe??ft},[ft,Be,j]),He=Ge==="error"?I.getFormFieldValidationError(j,Ue):null,It=`${s&&s!=="default"?`${c}-state-${s}`:""}`.trim(),Ze=o==null?void 0:o.submitUrl,kt=(Oe,gt)=>{Pt(it=>({...it,[Oe]:gt}))},Ot=async Oe=>{if(Oe.preventDefault(),!u)return;const gt=Object.fromEntries(j.map(Ye=>{var rt;return[Ye.name,((rt=ft[Ye.name])==null?void 0:rt.trim())??""]}).filter(([,Ye])=>Ye));if(!Ze){wt("error"),Lt("No integrations were found for this form.");return}if(Object.keys(gt).length===0)return;const it=I.getFormFieldValidationError(j,ft);if(it){wt("error"),Lt(it);return}wt("submitting"),Lt(null);try{const Ye=await fetch(Ze,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(gt)});if(!Ye.ok){const rt=await Ye.text();throw new Error(rt||`Request failed: ${Ye.status}`)}wt("success"),Pt(Object.fromEntries(j.map(rt=>[rt.name,""])))}catch(Ye){wt("error"),Lt(Ye instanceof Error?Ye.message:"Something went wrong")}};return r.jsxs("div",{className:`${c}-wrapper ${c}-type-${m} ${It}`.trim(),style:dt,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:mu(c)}}),r.jsxs("form",{onSubmit:Ot,className:`${c}-form`,children:[r.jsx("div",{className:`${c}-fields`,children:j.map((Oe,gt)=>r.jsxs(l.Fragment,{children:[gt>0&&r.jsx("div",{"data-controls":a?"fieldsGap":void 0,className:a?`${c}-control`:void 0,style:{height:I.scalingValue(g??0,t)}}),r.jsxs("div",{className:`${c}-field-group${S?` ${c}-labeled`:""}`,children:[S&&r.jsx("span",{className:`${c}-field-label`,style:Ae?{...Ae,lineHeight:Ae.fontSize}:void 0,children:Oe.label||Oe.name}),Oe.type==="textarea"?r.jsx("textarea",{name:Oe.name,autoComplete:"off",value:Ue[Oe.name]??"",onChange:it=>kt(Oe.name,it.target.value),placeholder:Oe.placeholder,className:`${c}-input`,style:Fe,rows:1,"data-filled":Be||(Ue[Oe.name]??"").trim().length>0,"data-field-type":"textarea"}):r.jsx("input",{type:Oe.type==="phone"?"tel":Oe.type==="email"?"email":"text",name:Oe.name,autoComplete:"off",value:Ue[Oe.name]??"",onChange:it=>kt(Oe.name,it.target.value),placeholder:Oe.placeholder,required:Oe.isRequired??Oe.type==="email",className:`${c}-input`,style:Fe,"data-filled":Be||(Ue[Oe.name]??"").trim().length>0})]})]},gt))}),r.jsx("div",{"data-controls":a?"gap":void 0,className:a?`${c}-control`:void 0,style:{height:I.scalingValue($??0,t)}}),r.jsx("div",{className:`${c}-overlay-anchor`,children:r.jsx("button",{type:u?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:I.scalingValue(y??0,t),borderWidth:tt,paddingTop:I.scalingValue((w==null?void 0:w.top)??0,t),paddingRight:I.scalingValue((w==null?void 0:w.right)??0,t),paddingBottom:I.scalingValue((w==null?void 0:w.bottom)??0,t),paddingLeft:I.scalingValue((w==null?void 0:w.left)??0,t),pointerEvents:u?"auto":void 0,...$e,...E?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:r.jsx("span",{className:`${c}-overlay-anchor`,style:E?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:xt==="submitting"?"...":x})})})]}),Ge==="success"&&r.jsx("p",{className:`${c}-success`,style:{...Ve},children:Ee}),Ge==="error"&&r.jsx("p",{className:`${c}-error`,style:{...Ve},role:"alert",children:He??Re??A})]})}const hu={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"},fu=["hover","focus","filled","success","error"],yu=`import React, { useMemo, useState } from 'react';
|
|
159
159
|
import { CommonComponentProps } from '../props';
|
|
160
160
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
161
161
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -789,7 +789,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
789
789
|
};
|
|
790
790
|
|
|
791
791
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
792
|
-
`,wu=[{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."},{name:"message",type:"textarea",placeholder:"Enter your message",label:"Message",isRequired:!1,error:"Message is required"},{name:"message2",type:"textarea",placeholder:"Enter your message 2",label:"Message 2",isRequired:!1,error:"Message 2 is required"},{name:"message3",type:"textarea",placeholder:"Enter your message 3",label:"Message 3",isRequired:!1,error:"Message 3 is required"}],ro={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},$u=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],Su={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:7},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B","C"]},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",enabled:!0},min:0,max:100},buttonPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},inputPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},buttonStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"common",title:"Stroke Input",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},isButtonFullWidth:{type:"boolean",scope:"common",title:"Full Width",display:{type:"toggle",enum:["On","Off"]}},buttonBorderColor:{type:"string",scope:"common",title:"Stroke Button",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker",visible:!1}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...ro.fontSettings,scope:"common",title:"Input",display:{type:"font-settings-weight"}},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...ro.fontSettings,scope:"common",title:"Button",display:{type:"font-settings-weight"}},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},labelFontSettings:{...ro.fontSettings,scope:"common",title:"Label",display:{type:"font-settings-weight",visible:!1}},labelFontSize:{type:"number",scope:"layout",title:"Label Font Size",display:{type:"font-size",visible:!1}},labelLineHeight:{type:"number",scope:"layout",title:"Label Line Height",display:{type:"line-height-input",visible:!1}},labelLetterSpacing:{type:"number",scope:"layout",title:"Label Letter Spacing",display:{type:"letter-spacing-input",visible:!1}},labelWordSpacing:{type:"number",scope:"layout",title:"Label Word Spacing",display:{type:"word-spacing-input",visible:!1}},labelTextAppearance:{type:"object",scope:"layout",title:"Label Text Appearance",display:{type:"text-appearance",visible:!1}},statusFontSettings:{...ro.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fieldsToShow:2,fields:wu,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#E2E2E2",placeholderColor:"#808080",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",buttonBorderColor:"#0A00F8",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{hover:{buttonColor:"#194EFF"}},fontFamily:"Arial",inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},labelFontSettings:{fontWeight:400,fontStyle:"normal"},labelLetterSpacing:0,labelWordSpacing:0,labelTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},isButtonFullWidth:!1,buttonLabel:"Sign up",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."},layoutDefaults:{m:{gap:.032,fieldsGap:.032,buttonStroke:0,buttonCorners:.192,inputStroke:.003,inputCorners:.192,buttonPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{gap:.0083,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.05,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.01,buttonLineHeight:.01,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"type",value:"B"},then:{name:"properties.labelTextColor.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSettings.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSize.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLineHeight.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLetterSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelWordSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelTextAppearance.display.visible",value:!0}},{if:{name:"type",value:"C"},then:{name:"properties.buttonCorners.display.enabled",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.enabled",value:!1}},{if:{name:"buttonStroke",value:0},then:{name:"properties.buttonBorderColor.display.visible",value:!1}},{if:{name:"inputStroke",value:0},then:{name:"properties.inputBorderColor.display.visible",value:!1}},{if:{name:"fieldsToShow",value:1},then:{name:"properties.fieldsGap.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:["inputCorners","inputPadding"]},{type:"row",title:"",items:["fieldsToShow","inputStroke"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["buttonCorners","buttonPadding"]},{type:"row",title:"",items:["buttonStroke","isButtonFullWidth"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...$u],panelIds:["general","typeStyle"],stateItems:{default:["placeholderColor","inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor","labelTextColor"],hover:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],focus:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],filled:["inputTextColor","inputColor","inputBorderColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},Cu={element:yu,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Stacked.png"},defaultSize:{d:{width:300,height:42},t:{width:346,height:42},m:{width:300,height:42}},schema:Su,sourceCode:xu,fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",labelFontSettings:"fontFamily",statusFontSettings:"fontFamily"},assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]}};function ao(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Tu(e){return`
|
|
792
|
+
`,vu=[{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."},{name:"message",type:"textarea",placeholder:"Enter your message",label:"Message",isRequired:!1,error:"Message is required"},{name:"message2",type:"textarea",placeholder:"Enter your message 2",label:"Message 2",isRequired:!1,error:"Message 2 is required"},{name:"message3",type:"textarea",placeholder:"Enter your message 3",label:"Message 3",isRequired:!1,error:"Message 3 is required"}],oo={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},bu=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],xu={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:7},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B","C"]},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",enabled:!0},min:0,max:100},buttonPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},inputPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},buttonStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"common",title:"Stroke Input",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},isButtonFullWidth:{type:"boolean",scope:"common",title:"Full Width",display:{type:"toggle",enum:["On","Off"]}},buttonBorderColor:{type:"string",scope:"common",title:"Stroke Button",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker",visible:!1}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...oo.fontSettings,scope:"common",title:"Input",display:{type:"font-settings-weight"}},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...oo.fontSettings,scope:"common",title:"Button",display:{type:"font-settings-weight"}},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},labelFontSettings:{...oo.fontSettings,scope:"common",title:"Label",display:{type:"font-settings-weight",visible:!1}},labelFontSize:{type:"number",scope:"layout",title:"Label Font Size",display:{type:"font-size",visible:!1}},labelLineHeight:{type:"number",scope:"layout",title:"Label Line Height",display:{type:"line-height-input",visible:!1}},labelLetterSpacing:{type:"number",scope:"layout",title:"Label Letter Spacing",display:{type:"letter-spacing-input",visible:!1}},labelWordSpacing:{type:"number",scope:"layout",title:"Label Word Spacing",display:{type:"word-spacing-input",visible:!1}},labelTextAppearance:{type:"object",scope:"layout",title:"Label Text Appearance",display:{type:"text-appearance",visible:!1}},statusFontSettings:{...oo.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fieldsToShow:2,fields:vu,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#E2E2E2",placeholderColor:"#808080",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",buttonBorderColor:"#0A00F8",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{hover:{buttonColor:"#194EFF"}},fontFamily:"Arial",inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},labelFontSettings:{fontWeight:400,fontStyle:"normal"},labelLetterSpacing:0,labelWordSpacing:0,labelTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},isButtonFullWidth:!1,buttonLabel:"Sign up",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."},layoutDefaults:{m:{gap:.032,fieldsGap:.032,buttonStroke:0,buttonCorners:.192,inputStroke:.003,inputCorners:.192,buttonPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{gap:.0083,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.05,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.01,buttonLineHeight:.01,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"type",value:"B"},then:{name:"properties.labelTextColor.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSettings.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSize.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLineHeight.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLetterSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelWordSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelTextAppearance.display.visible",value:!0}},{if:{name:"type",value:"C"},then:{name:"properties.buttonCorners.display.enabled",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.enabled",value:!1}},{if:{name:"buttonStroke",value:0},then:{name:"properties.buttonBorderColor.display.visible",value:!1}},{if:{name:"inputStroke",value:0},then:{name:"properties.inputBorderColor.display.visible",value:!1}},{if:{name:"fieldsToShow",value:1},then:{name:"properties.fieldsGap.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:["inputCorners","inputPadding"]},{type:"row",title:"",items:["fieldsToShow","inputStroke"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["buttonCorners","buttonPadding"]},{type:"row",title:"",items:["buttonStroke","isButtonFullWidth"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...bu],panelIds:["general","typeStyle"],stateItems:{default:["placeholderColor","inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor","labelTextColor"],hover:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],focus:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],filled:["inputTextColor","inputColor","inputBorderColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},wu={element:gu,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Stacked.png"},defaultSize:{d:{width:300,height:42},t:{width:346,height:42},m:{width:300,height:42}},schema:xu,sourceCode:yu,fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",labelFontSettings:"fontFamily",statusFontSettings:"fontFamily"},assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]}};function ro(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function $u(e){return`
|
|
793
793
|
.${e}-wrapper {
|
|
794
794
|
display: flex;
|
|
795
795
|
flex-direction: column;
|
|
@@ -971,16 +971,16 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
971
971
|
align-items: center;
|
|
972
972
|
}
|
|
973
973
|
.${e}-success {
|
|
974
|
-
margin-top: ${
|
|
975
|
-
font-size: ${
|
|
974
|
+
margin-top: ${ro(8)};
|
|
975
|
+
font-size: ${ro(14)};
|
|
976
976
|
color: var(--${e}-success-success-color, var(--${e}-success-color));
|
|
977
977
|
}
|
|
978
978
|
.${e}-error {
|
|
979
|
-
margin-top: ${
|
|
980
|
-
font-size: ${
|
|
979
|
+
margin-top: ${ro(8)};
|
|
980
|
+
font-size: ${ro(14)};
|
|
981
981
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
982
982
|
}
|
|
983
|
-
`}const
|
|
983
|
+
`}const Su=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:s}=I.useScopedStyles(),a=n&&t||!t,{fields:u=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:m,fieldsToShow:p=1,fontFamily:P,inputFontSettings:x,inputFontSize:$,inputLineHeight:g,inputLetterSpacing:y,inputWordSpacing:C,inputTextAppearance:w,buttonFontSettings:E,buttonFontSize:T,buttonLineHeight:F,buttonLetterSpacing:M,buttonWordSpacing:W,buttonTextAppearance:_,statusFontSettings:L,statusFontSize:U,statusLineHeight:v,statusLetterSpacing:R,statusWordSpacing:N,statusTextAppearance:D,iconMaxWidth:ne,minHeight:pe,corners:K,stroke:B,stateOverrides:Z,inputPadding:q,buttonPadding:O,successMessage:Y="Thanks for subscribing!",errorMessage:ae="Please, fill all required fields."}=e,oe=u.slice(0,Math.min(p,u.length)),[H,ue]=l.useState(()=>Object.fromEntries(oe.map(le=>[le.name,""]))),[f,me]=l.useState("idle"),[fe,ye]=l.useState(null),Me=o==="success"?"success":o==="error"?"error":f,ee=o==="error"?ae:fe,ge=o==="filled",X=l.useMemo(()=>{if(!ge)return H;let le=null;for(const Ae of oe)(H[Ae.name]??"").trim().length>0||(le=le??{...H},le[Ae.name]="Filled");return le??H},[ge,H,oe]),be=Me==="error"?I.getFormFieldValidationError(oe,X):null,te=o&&o!=="default"?`${s}-state-${o}`:"",ie=oe.some(le=>(X[le.name]??"").trim().length>0),J=te!==`${s}-state-filled`&&ie?`${s}-state-filled`:"",xe=`${te} ${J}`.trim(),Se=i==null?void 0:i.submitUrl,ve=m??"",Ee=(c==null?void 0:c.icon)??"",A=(c==null?void 0:c.mode)==="On",G=ve||"Submit",S={fontSettings:{fontFamily:P,fontWeight:(x==null?void 0:x.fontWeight)??400,fontStyle:(x==null?void 0:x.fontStyle)??"normal"},fontSize:$??.01,lineHeight:g,letterSpacing:y??0,wordSpacing:C??0,textAppearance:w,color:e.inputTextColor??"#111111"},j={fontSettings:{fontFamily:P,fontWeight:(E==null?void 0:E.fontWeight)??400,fontStyle:(E==null?void 0:E.fontStyle)??"normal"},fontSize:T??.01,lineHeight:F,letterSpacing:M??0,wordSpacing:W??0,textAppearance:_,color:e.buttonTextColor??"#ffffff"},z={fontSettings:{fontFamily:P,fontWeight:(L==null?void 0:L.fontWeight)??400,fontStyle:(L==null?void 0:L.fontStyle)??"normal"},fontSize:U??.01,lineHeight:v,letterSpacing:R??0,wordSpacing:N??0,textAppearance:D,color:e.successColor??"#22c55e"},Q=qt(At(S,t)),se=qt(At(j,t)),Te=qt(At(z,t)),Fe=I.buildColorVars(s,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(S==null?void 0:S.color)??"#111111",buttonTextColor:e.buttonTextColor??(j==null?void 0:j.color)??"#ffffff"},Cu,Tu,Z),Ie={borderRadius:I.scalingValue(K,t),borderWidth:I.scalingValue(B,t),borderStyle:"solid"},$e={borderLeftWidth:I.scalingValue(B,t)},tt=async le=>{if(le.preventDefault(),!a)return;const Ae=Object.fromEntries(oe.map(Ve=>{var dt;return[Ve.name,((dt=H[Ve.name])==null?void 0:dt.trim())??""]}).filter(([,Ve])=>Ve));if(!Se){me("error"),ye("No integrations were found for this form.");return}if(Object.keys(Ae).length===0)return;const ze=I.getFormFieldValidationError(oe,H);if(ze){me("error"),ye(ze);return}me("submitting"),ye(null);try{const Ve=await fetch(Se,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ae)});if(!Ve.ok){const dt=await Ve.text();throw new Error(dt||`Request failed: ${Ve.status}`)}me("success"),ue(Object.fromEntries(oe.map(dt=>[dt.name,""])))}catch(Ve){me("error"),ye(Ve instanceof Error?Ve.message:"Something went wrong")}};return r.jsxs("div",{className:`${s}-wrapper ${xe}`.trim(),style:Fe,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:$u(s)}}),r.jsxs("form",{onSubmit:tt,className:`${s}-form`,style:{...Ie,height:I.scalingValue(pe,t),minHeight:I.scalingValue(pe,t)},children:[r.jsx("div",{className:`${s}-inputWrap ${s}-overlayAnchor`,style:{flex:1,minWidth:0},children:oe.map(le=>r.jsx("input",{type:le.type==="email"?"email":le.type==="phone"?"tel":"text",name:le.name,autoComplete:"off",value:X[le.name]??"",onChange:Ae=>ue(ze=>({...ze,[le.name]:Ae.target.value})),placeholder:le.placeholder,required:le.isRequired??le.type==="email",className:`${s}-input`,style:{...Q,paddingRight:I.scalingValue(q.right,t),paddingLeft:I.scalingValue(q.left,t),paddingTop:I.scalingValue(q.top,t),paddingBottom:I.scalingValue(q.bottom,t)}},le.name))}),r.jsx("div",{className:`${s}-overlayAnchor`,children:r.jsx("button",{type:a?"submit":"button",className:`${s}-submitBtn`,"aria-label":G,style:{...se,...$e,paddingRight:I.scalingValue(O.right,t),paddingLeft:I.scalingValue(O.left,t),paddingTop:I.scalingValue(O.top,t),paddingBottom:I.scalingValue(O.bottom,t),pointerEvents:a?"auto":void 0},children:f==="submitting"?"...":A?Ee&&r.jsx(Qt,{url:Ee,className:`${s}-submitBtnIcon`,style:{maxWidth:I.scalingValue(ne??0,t)},fill:`var(--${s}-button-text-color)`,hoverFill:`var(--${s}-button-text-color)`}):ve})})]}),Me==="success"&&r.jsx("p",{className:`${s}-success`,style:{...Te},children:Y}),Me==="error"&&r.jsx("p",{className:`${s}-error`,style:{...Te},role:"alert",children:be??ee??ae})]})},Cu={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"},Tu=["hover","focus","filled","success","error"],Lu=`import React, { useMemo, useState } from 'react';
|
|
984
984
|
import { CommonComponentProps } from '../props';
|
|
985
985
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
986
986
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -1557,7 +1557,7 @@ const COLOR_VAR_MAP: Record<OnelinerColorKeys, string> = {
|
|
|
1557
1557
|
};
|
|
1558
1558
|
|
|
1559
1559
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
1560
|
-
`,ku="data:image/svg+xml,"+encodeURIComponent('<svg width="23px" height="20px" viewBox="0 0 23 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Newsletter" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Tutorials-pop-up-Copy-12" transform="translate(-43, -687)" fill="#FFFFFF" fill-rule="nonzero"><path d="M66,697 C66,697.552285 65.5522847,698 65,698 L44,698 C43.4477153,698 43,697.552285 43,697 C43,696.447715 43.4477153,696 44,696 L65,696 C65.5522847,696 66,696.447715 66,697 Z M55.6689647,687.256706 L65.6689647,696.256706 C66.1103451,696.653948 66.1103451,697.346052 65.6689647,697.743294 L55.6689647,706.743294 C55.2584547,707.112753 54.6261649,707.079475 54.2567059,706.668965 C53.8872468,706.258455 53.9205252,705.626165 54.3310353,705.256706 L63.5051529,697 L54.3310353,688.743294 C53.9205252,688.373835 53.8872468,687.741545 54.2567059,687.331035 C54.6261649,686.920525 55.2584547,686.887247 55.6689647,687.256706 Z" id="Combined-Shape"></path></g></g></svg>'),Ru=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."}],ar={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Au=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],Mu={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:3},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},buttonIcon:{type:"object",scope:"common",title:"Button Icon",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},iconMaxWidth:{type:"number",scope:"common",title:"Icon Max Width",display:{type:"full-width-input"},min:0,max:1},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"Input Padding",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"Button Padding",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"numeric-input"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},strokeColor:{type:"string",scope:"common",title:"Stroke All",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"common"},inputFontSettings:{...ar.fontSettings,scope:"common",title:"Input"},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...ar.fontSettings,scope:"common",title:"Button"},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},statusFontSettings:{...ar.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fields:Ru,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:ku},fontFamily:"Arial",strokeColor:"#000000",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#000000",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{hover:{buttonColor:"#33A2F2"}},inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{minHeight:.1,iconMaxWidth:.1,stroke:.001,corners:0,buttonPadding:{top:.02,right:.04,bottom:.02,left:.04},inputPadding:{top:.01,right:.03,bottom:.01,left:.03},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{minHeight:.028,iconMaxWidth:.028,stroke:.001,corners:0,buttonPadding:{right:.0175,left:.0175,top:.005,bottom:.004},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.009,buttonLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSettings.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSize.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLineHeight.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLetterSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonWordSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonTextAppearance.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"Off"},then:{name:"properties.iconMaxWidth.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["fieldsToShow","minHeight"]},{type:"row",items:["corners","stroke"]},{type:"row",title:"",items:["inputPadding","buttonPadding"]},{type:"row",title:"",items:["buttonIcon"]},"iconMaxWidth"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Au],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","placeholderColor","inputColor","buttonTextColor","buttonColor"],hover:["strokeColor","inputColor","buttonTextColor","buttonColor"],focus:["strokeColor","inputTextColor","buttonTextColor","buttonColor"],filled:["strokeColor","inputColor","inputTextColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},_u={element:Lu,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Single_Line.png"},defaultSize:{d:{width:400,height:60},t:{width:453,height:60},m:{width:340,height:60}},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",statusFontSettings:"fontFamily"},schema:Mu,sourceCode:Pu};function Fu(e){return`
|
|
1560
|
+
`,Eu="data:image/svg+xml,"+encodeURIComponent('<svg width="23px" height="20px" viewBox="0 0 23 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Newsletter" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Tutorials-pop-up-Copy-12" transform="translate(-43, -687)" fill="#FFFFFF" fill-rule="nonzero"><path d="M66,697 C66,697.552285 65.5522847,698 65,698 L44,698 C43.4477153,698 43,697.552285 43,697 C43,696.447715 43.4477153,696 44,696 L65,696 C65.5522847,696 66,696.447715 66,697 Z M55.6689647,687.256706 L65.6689647,696.256706 C66.1103451,696.653948 66.1103451,697.346052 65.6689647,697.743294 L55.6689647,706.743294 C55.2584547,707.112753 54.6261649,707.079475 54.2567059,706.668965 C53.8872468,706.258455 53.9205252,705.626165 54.3310353,705.256706 L63.5051529,697 L54.3310353,688.743294 C53.9205252,688.373835 53.8872468,687.741545 54.2567059,687.331035 C54.6261649,686.920525 55.2584547,686.887247 55.6689647,687.256706 Z" id="Combined-Shape"></path></g></g></svg>'),Pu=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."}],rr={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Iu=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],Ru={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:3},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},buttonIcon:{type:"object",scope:"common",title:"Button Icon",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},iconMaxWidth:{type:"number",scope:"common",title:"Icon Max Width",display:{type:"full-width-input"},min:0,max:1},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"Input Padding",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"Button Padding",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"numeric-input"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},strokeColor:{type:"string",scope:"common",title:"Stroke All",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"common"},inputFontSettings:{...rr.fontSettings,scope:"common",title:"Input"},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...rr.fontSettings,scope:"common",title:"Button"},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},statusFontSettings:{...rr.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fields:Pu,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:Eu},fontFamily:"Arial",strokeColor:"#000000",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#000000",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{hover:{buttonColor:"#33A2F2"}},inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{minHeight:.1,iconMaxWidth:.1,stroke:.001,corners:0,buttonPadding:{top:.02,right:.04,bottom:.02,left:.04},inputPadding:{top:.01,right:.03,bottom:.01,left:.03},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{minHeight:.028,iconMaxWidth:.028,stroke:.001,corners:0,buttonPadding:{right:.0175,left:.0175,top:.005,bottom:.004},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.009,buttonLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSettings.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSize.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLineHeight.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLetterSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonWordSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonTextAppearance.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"Off"},then:{name:"properties.iconMaxWidth.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["fieldsToShow","minHeight"]},{type:"row",items:["corners","stroke"]},{type:"row",title:"",items:["inputPadding","buttonPadding"]},{type:"row",title:"",items:["buttonIcon"]},"iconMaxWidth"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Iu],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","placeholderColor","inputColor","buttonTextColor","buttonColor"],hover:["strokeColor","inputColor","buttonTextColor","buttonColor"],focus:["strokeColor","inputTextColor","buttonTextColor","buttonColor"],filled:["strokeColor","inputColor","inputTextColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},Mu={element:Su,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Single_Line.png"},defaultSize:{d:{width:400,height:60},t:{width:453,height:60},m:{width:340,height:60}},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",statusFontSettings:"fontFamily"},schema:Ru,sourceCode:Lu};function Au(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
1561
1561
|
.${e}-marquee-wrapper {
|
|
1562
1562
|
overflow: hidden;
|
|
1563
1563
|
width: 100%;
|
|
@@ -1565,13 +1565,13 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1565
1565
|
}
|
|
1566
1566
|
|
|
1567
1567
|
@keyframes ${e}-marquee-left {
|
|
1568
|
-
from { transform: translate3d(0, 0, 0); }
|
|
1569
|
-
to { transform: translate3d(
|
|
1568
|
+
from { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
|
|
1569
|
+
to { -webkit-transform: translate3d(-${n}, 0, 0); transform: translate3d(-${n}, 0, 0); }
|
|
1570
1570
|
}
|
|
1571
1571
|
|
|
1572
1572
|
@keyframes ${e}-marquee-right {
|
|
1573
|
-
from { transform: translate3d(
|
|
1574
|
-
to { transform: translate3d(0, 0, 0); }
|
|
1573
|
+
from { -webkit-transform: translate3d(-${n}, 0, 0); transform: translate3d(-${n}, 0, 0); }
|
|
1574
|
+
to { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
|
|
1575
1575
|
}
|
|
1576
1576
|
|
|
1577
1577
|
.${e}-marquee-track {
|
|
@@ -1580,21 +1580,21 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1580
1580
|
width: max-content;
|
|
1581
1581
|
will-change: transform;
|
|
1582
1582
|
backface-visibility: hidden;
|
|
1583
|
-
transform: translateZ(0);
|
|
1584
1583
|
-webkit-backface-visibility: hidden;
|
|
1585
|
-
-webkit-transform: translateZ(0);
|
|
1586
1584
|
flex-wrap: nowrap;
|
|
1587
|
-
animation-
|
|
1585
|
+
-webkit-animation-timing-function: linear;
|
|
1588
1586
|
animation-timing-function: linear;
|
|
1587
|
+
-webkit-animation-iteration-count: infinite;
|
|
1589
1588
|
animation-iteration-count: infinite;
|
|
1590
|
-
animation-play-state: var(--marquee-play-state, running);
|
|
1591
1589
|
}
|
|
1592
1590
|
|
|
1593
1591
|
.${e}-marquee-track[data-direction="left"] {
|
|
1592
|
+
-webkit-animation-name: ${e}-marquee-left;
|
|
1594
1593
|
animation-name: ${e}-marquee-left;
|
|
1595
1594
|
}
|
|
1596
1595
|
|
|
1597
1596
|
.${e}-marquee-track[data-direction="right"] {
|
|
1597
|
+
-webkit-animation-name: ${e}-marquee-right;
|
|
1598
1598
|
animation-name: ${e}-marquee-right;
|
|
1599
1599
|
}
|
|
1600
1600
|
.${e}-marquee-row {
|
|
@@ -1613,10 +1613,6 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1613
1613
|
position: relative;
|
|
1614
1614
|
flex: 0 0 auto;
|
|
1615
1615
|
align-self: flex-start;
|
|
1616
|
-
transform: translateZ(0);
|
|
1617
|
-
backface-visibility: hidden;
|
|
1618
|
-
-webkit-backface-visibility: hidden;
|
|
1619
|
-
will-change: transform;
|
|
1620
1616
|
}
|
|
1621
1617
|
.${e}-wrapper {
|
|
1622
1618
|
position: relative;
|
|
@@ -1689,13 +1685,14 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1689
1685
|
.${e}-image-hover-grayscale:hover img {
|
|
1690
1686
|
filter: grayscale(100%);
|
|
1691
1687
|
}
|
|
1692
|
-
`}const
|
|
1688
|
+
`}const ku=30,_u=20,ar=3,Fu=12,Wu=32,Nu=3,Hu=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")},Ou=(e,t)=>Array.from({length:t},()=>e).flat(),Bu=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},qs=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),La=(e,t)=>{if(t<=0||e.children.length<t)return 0;const n=e.children[0],i=e.children[t-1];if(!n||!i)return 0;const o=getComputedStyle(e),s=Number.parseFloat(o.columnGap||o.gap||"0")||0,a=i.getBoundingClientRect().right-n.getBoundingClientRect().left;if(a>0)return a;const u=Array.from({length:t},(m,p)=>e.children[p]),c=qs(u);return c<=0?0:c+s*Math.max(0,t-1)},ju=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=qs(Array.from(e.children));if(i<=0)return 0;const o=getComputedStyle(e),s=Number.parseFloat(o.columnGap||o.gap||"0")||0,a=Number.parseFloat(o.paddingRight)||0;return i+s*Math.max(0,e.children.length-1)+a},zu=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},Vu=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>zu(i,e))},Du=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,imageHoverClass:s,isFirstSet:a,scaled:u,onFirstSetImageDone:c})=>{var L,U,v;const m=l.useRef(null);l.useLayoutEffect(()=>{if(!a)return;const R=m.current;R!=null&&R.complete&&(c==null||c())},[a,(L=e.image)==null?void 0:L.url,c]);const p=n.display==="cover",P=n.ratioValue??"1:1",x=n.reversed??!1,[$,g]=P.split(":").map(Number),w=(x?g:$)/(x?$:g),E=i/w,T=E>o?o:E,F=E>o?o*w:i,M=u(F),W=u(T),_=((U=e.image)==null?void 0:U.url)&&r.jsx("img",{ref:m,src:e.image.url,alt:((v=e.image)==null?void 0:v.name)??"",style:p?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover"}:{pointerEvents:"auto",display:"block",height:"100%",width:"auto",maxWidth:u(i),objectFit:"contain"},onLoad:a?c:void 0,onError:a?c:void 0});return r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...p?{width:M}:{width:"max-content",maxWidth:u(i),minWidth:0}},children:r.jsx("div",{className:s,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...p?{width:M,height:W,overflow:"hidden"}:{width:"max-content",maxWidth:u(i),height:u(o)}},children:_&&e.link?r.jsx("a",{href:e.link,target:"_blank",rel:"noopener noreferrer",className:Je(`${t}-marquee-link`,!p&&`${t}-marquee-link-contain`),children:_}):_})})},qu=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=I.useScopedStyles(),[a,u]=l.useState(0),c=a>0?Math.round(a):0,m=l.useMemo(()=>Au(s,c),[s,c]),{speed:p,direction:P,pauseOnHover:x,gap:$,imageMaxWidth:g,imageMaxHeight:y,hoverEffect:C}=e,w=l.useMemo(()=>Bu(e.imageFit),[e.imageFit]),E=(t==null?void 0:t.length)??0,T=!!o,F=!n||!!i,M=F&&C!=="off"&&C!=="randomize"?`${s}-image-hover-${C}`:void 0,W=n?!!i:!0,L=((t==null?void 0:t.length)??0)>0&&(W||!!n),U=Math.max(0,p)*ku,v=ie=>I.scalingValue(ie,n??!1),R=l.useRef(null),N=l.useRef(null),D=l.useRef(null),[ne,pe]=l.useState(0),K=W&&x==="on",[B,Z]=l.useState(!1),[q,O]=l.useState({}),Y=l.useRef(q);Y.current=q;const ae=l.useRef(null),oe=l.useRef(0),H=l.useRef(null),ue=l.useMemo(()=>(t??[]).map(ie=>{var J;return((J=ie.image)==null?void 0:J.url)??""}).join("\0"),[t]),[f,me]=l.useState(ar),fe=l.useMemo(()=>{const ie=t??[];return ie.length===0||!(W||!!n)?ie:Ou(ie,f)},[t,W,f,n]),ye=l.useMemo(()=>(t??[]).filter(ie=>{var J;return!!((J=ie.image)!=null&&J.url)}).length,[t]),Me=L?Nu:1;l.useLayoutEffect(()=>{oe.current=0,O({}),ae.current=null,me(ar),u(0)},[ue]),l.useEffect(()=>{if(!F||C!=="randomize")return;const ie=R.current;if(!ie)return;const J=Ee=>{O(A=>{const G=Array.from(Ee).filter(j=>j in A&&!Vu(ie,j));if(G.length===0)return A;const S={...A};return G.forEach(j=>{delete S[j]}),S})},xe=new IntersectionObserver(Ee=>{const A=new Set;for(const G of Ee){const S=G.target.dataset.marqueeItemIndex,j=S!==void 0?Number(S):NaN;Number.isNaN(j)||A.add(j)}A.size>0&&J(A)},{root:ie,threshold:0});Object.keys(q).forEach(Ee=>{const A=Number(Ee);ie.querySelectorAll(`[data-marquee-item-index="${A}"]`).forEach(G=>xe.observe(G))});const Se={current:0},ve=()=>{const Ee=Object.keys(Y.current);Ee.length!==0&&(J(Ee.map(Number)),Se.current=requestAnimationFrame(ve))};return Object.keys(Y.current).length>0&&(Se.current=requestAnimationFrame(ve)),()=>{cancelAnimationFrame(Se.current),xe.disconnect()}},[C,q,F]),l.useLayoutEffect(()=>{if(!L)return;const ie=R.current,J=D.current;if(!ie||!J)return;const xe={current:0},Se=()=>{const A=ie.getBoundingClientRect().width||ie.offsetWidth,G=ju(J),S=ae.current,j=typeof S=="number"&&Math.abs(S-G)<=.25;if(ae.current=G,(W||n)&&E>0&&A>0){const Q=La(J,E);if(Q>=Wu){const se=Math.min(Fu,Math.max(ar,Math.ceil(A/Q)+1));se!==f&&me(se)}}const z=G>0?G:(()=>{const Q=La(J,E);return Q>0?Q*f:0})();z>0?u(Q=>Q<=0?z:!j||Math.round(Q)===Math.round(z)?Q:z):!j&&a<=0&&(cancelAnimationFrame(xe.current),xe.current=requestAnimationFrame(Se))},ve=()=>{cancelAnimationFrame(xe.current),xe.current=requestAnimationFrame(Se)};H.current=ve,ve();const Ee=new ResizeObserver(ve);return Ee.observe(ie),Ee.observe(J),()=>{H.current=null,cancelAnimationFrame(xe.current),Ee.disconnect()}},[W,L,a,ue,f,E,n]),l.useLayoutEffect(()=>{if(!L||c<=0)return;const ie=N.current;ie&&Hu(ie)},[L,c,P,U]),l.useLayoutEffect(()=>{if(!L||a<=0){pe(0);return}const ie=N.current,J=D.current;if(!ie||!J)return;const xe=()=>{const ve=ie.offsetHeight||ie.getBoundingClientRect().height,Ee=Array.from(J.children).reduce((G,S)=>Math.max(G,S.offsetHeight||S.getBoundingClientRect().height),0),A=ve>0?ve:Ee;pe(A>0?A:0)};xe();const Se=new ResizeObserver(xe);return Se.observe(ie),Se.observe(J),()=>Se.disconnect()},[L,Me,fe,n,$,g,y,a,w,q]),l.useLayoutEffect(()=>{if(!n||!T||!L||typeof window>"u")return;const ie=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(ie)},[n,T,L,P,a,ne,$,fe]);const ee=()=>{K&&Z(!0)},ge=()=>{K&&Z(!1)},X=l.useCallback(()=>{var ie;oe.current=Math.min(ye,oe.current+1),(ie=H.current)==null||ie.call(H)},[ye]),be=l.useCallback((ie,J)=>{O(xe=>{const Se=xe[ie]??J,ve=(t??[]).filter(A=>A!==Se);if(ve.length===0)return xe;const Ee=ve[Math.floor(Math.random()*ve.length)];return{...xe,[ie]:Ee}})},[t]),te=(ie,J,xe,Se)=>{const ve=F&&C==="randomize"&&w.display==="cover"?q[xe]??ie:ie,Ee=`max(${v($)}, ${_u}px)`,A=`calc(-0.5 * (${Ee} + ${v($)}))`;return r.jsxs("div",{className:`${s}-marquee-card`,"data-marquee-item-index":xe,onMouseEnter:F&&C==="randomize"&&w.display==="cover"?()=>be(xe,ie):void 0,children:[r.jsx(Du,{item:ve,prefix:s,imageFit:w,imageMaxWidth:g,imageMaxHeight:y,imageHoverClass:M,isEditor:n,isFirstSet:Se,scaled:v,onFirstSetImageDone:X}),T&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${s}-gap-control`,style:{position:"absolute",top:0,right:A,width:Ee,height:"100%"}})]},`${J}-${xe}`)};if(L){const ie=W?K&&B?"paused":"running":"paused",J=c>0&&U>0?c/U*1e3:0,xe=`${Math.max(0,J)/1e3}s`;return r.jsxs("div",{ref:R,className:Je(`${s}-wrapper`,`${s}-marquee-wrapper`),"aria-label":"Marquee",style:ne>0?{height:ne}:void 0,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:m}}),r.jsx("div",{ref:N,className:`${s}-marquee-track`,"data-direction":P,onMouseEnter:ee,onMouseLeave:ge,style:{WebkitAnimationDuration:xe,animationDuration:xe,WebkitAnimationPlayState:ie,animationPlayState:ie},children:Array.from({length:Me},(Se,ve)=>r.jsx("div",{ref:ve===0?D:void 0,className:Je(`${s}-marquee-row`,`${s}-marquee-set`),style:{gap:v($),paddingRight:v($)},"aria-hidden":ve>0,children:fe.map((Ee,A)=>te(Ee,ve,A,ve===0&&A<E))},`set-${ve}`))})]})}return r.jsxs("div",{ref:R,className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:m}}),r.jsx("div",{className:Je(`${s}-marquee-row`,`${s}-marquee-static`),style:{gap:v($),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((ie,J)=>te(ie,0,J))},"marquee-static")]})},Ku=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
1693
1689
|
import cn from 'classnames';
|
|
1694
1690
|
import { CommonComponentProps } from '../props';
|
|
1695
1691
|
import { scalingValue } from '../utils/scalingValue';
|
|
1696
1692
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
1697
1693
|
|
|
1698
|
-
function getCSS(P: string): string {
|
|
1694
|
+
function getCSS(P: string, setWidthPx: number): string {
|
|
1695
|
+
const distance = setWidthPx > 0 ? \`\${setWidthPx}px\` : '0px';
|
|
1699
1696
|
return \`
|
|
1700
1697
|
.\${P}-marquee-wrapper {
|
|
1701
1698
|
overflow: hidden;
|
|
@@ -1704,13 +1701,13 @@ function getCSS(P: string): string {
|
|
|
1704
1701
|
}
|
|
1705
1702
|
|
|
1706
1703
|
@keyframes \${P}-marquee-left {
|
|
1707
|
-
from { transform: translate3d(0, 0, 0); }
|
|
1708
|
-
to { transform: translate3d(
|
|
1704
|
+
from { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
|
|
1705
|
+
to { -webkit-transform: translate3d(-\${distance}, 0, 0); transform: translate3d(-\${distance}, 0, 0); }
|
|
1709
1706
|
}
|
|
1710
1707
|
|
|
1711
1708
|
@keyframes \${P}-marquee-right {
|
|
1712
|
-
from { transform: translate3d(
|
|
1713
|
-
to { transform: translate3d(0, 0, 0); }
|
|
1709
|
+
from { -webkit-transform: translate3d(-\${distance}, 0, 0); transform: translate3d(-\${distance}, 0, 0); }
|
|
1710
|
+
to { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
|
|
1714
1711
|
}
|
|
1715
1712
|
|
|
1716
1713
|
.\${P}-marquee-track {
|
|
@@ -1719,21 +1716,21 @@ function getCSS(P: string): string {
|
|
|
1719
1716
|
width: max-content;
|
|
1720
1717
|
will-change: transform;
|
|
1721
1718
|
backface-visibility: hidden;
|
|
1722
|
-
transform: translateZ(0);
|
|
1723
1719
|
-webkit-backface-visibility: hidden;
|
|
1724
|
-
-webkit-transform: translateZ(0);
|
|
1725
1720
|
flex-wrap: nowrap;
|
|
1726
|
-
animation-
|
|
1721
|
+
-webkit-animation-timing-function: linear;
|
|
1727
1722
|
animation-timing-function: linear;
|
|
1723
|
+
-webkit-animation-iteration-count: infinite;
|
|
1728
1724
|
animation-iteration-count: infinite;
|
|
1729
|
-
animation-play-state: var(--marquee-play-state, running);
|
|
1730
1725
|
}
|
|
1731
1726
|
|
|
1732
1727
|
.\${P}-marquee-track[data-direction="left"] {
|
|
1728
|
+
-webkit-animation-name: \${P}-marquee-left;
|
|
1733
1729
|
animation-name: \${P}-marquee-left;
|
|
1734
1730
|
}
|
|
1735
1731
|
|
|
1736
1732
|
.\${P}-marquee-track[data-direction="right"] {
|
|
1733
|
+
-webkit-animation-name: \${P}-marquee-right;
|
|
1737
1734
|
animation-name: \${P}-marquee-right;
|
|
1738
1735
|
}
|
|
1739
1736
|
.\${P}-marquee-row {
|
|
@@ -1752,10 +1749,6 @@ function getCSS(P: string): string {
|
|
|
1752
1749
|
position: relative;
|
|
1753
1750
|
flex: 0 0 auto;
|
|
1754
1751
|
align-self: flex-start;
|
|
1755
|
-
transform: translateZ(0);
|
|
1756
|
-
backface-visibility: hidden;
|
|
1757
|
-
-webkit-backface-visibility: hidden;
|
|
1758
|
-
will-change: transform;
|
|
1759
1752
|
}
|
|
1760
1753
|
.\${P}-wrapper {
|
|
1761
1754
|
position: relative;
|
|
@@ -1834,11 +1827,77 @@ function getCSS(P: string): string {
|
|
|
1834
1827
|
const PX_PER_SEC_PER_SPEED_UNIT = 30;
|
|
1835
1828
|
const GAP_LABEL_AREA_PX = 20;
|
|
1836
1829
|
const MIN_CONTENT_SEQUENCE_REPEAT = 3;
|
|
1830
|
+
const MAX_CONTENT_SEQUENCE_REPEAT = 12;
|
|
1831
|
+
const MIN_TRUSTWORTHY_CYCLE_WIDTH_PX = 32;
|
|
1837
1832
|
const OUTER_SET_COPIES = 3;
|
|
1838
1833
|
|
|
1834
|
+
const restartTrackAnimation = (track: HTMLElement) => {
|
|
1835
|
+
track.style.setProperty('animation-name', 'none');
|
|
1836
|
+
track.style.setProperty('-webkit-animation-name', 'none');
|
|
1837
|
+
void track.offsetHeight;
|
|
1838
|
+
track.style.removeProperty('animation-name');
|
|
1839
|
+
track.style.removeProperty('-webkit-animation-name');
|
|
1840
|
+
};
|
|
1841
|
+
|
|
1839
1842
|
const expandSetContent = (items: MarqueeItem[], repeat: number) =>
|
|
1840
1843
|
Array.from({ length: repeat }, () => items).flat();
|
|
1841
1844
|
|
|
1845
|
+
type MarqueeImageFit = {
|
|
1846
|
+
display: 'fit' | 'cover';
|
|
1847
|
+
ratioValue: '1:1' | '2:3' | '3:4' | '4:5' | '16:9';
|
|
1848
|
+
reversed: boolean;
|
|
1849
|
+
};
|
|
1850
|
+
|
|
1851
|
+
const normalizeImageFit = (raw: MarqueeSettings['imageFit'] | string | undefined): MarqueeImageFit => {
|
|
1852
|
+
if (typeof raw === 'string') {
|
|
1853
|
+
return {
|
|
1854
|
+
display: raw.toLowerCase() === 'cover' ? 'cover' : 'fit',
|
|
1855
|
+
ratioValue: '16:9',
|
|
1856
|
+
reversed: false,
|
|
1857
|
+
};
|
|
1858
|
+
}
|
|
1859
|
+
const display = typeof raw?.display === 'string' ? raw.display.toLowerCase() : '';
|
|
1860
|
+
return {
|
|
1861
|
+
display: display === 'cover' ? 'cover' : 'fit',
|
|
1862
|
+
ratioValue: raw?.ratioValue ?? '16:9',
|
|
1863
|
+
reversed: raw?.reversed ?? false,
|
|
1864
|
+
};
|
|
1865
|
+
};
|
|
1866
|
+
|
|
1867
|
+
const sumElementWidths = (elements: readonly HTMLElement[]): number =>
|
|
1868
|
+
elements.reduce(
|
|
1869
|
+
(sum, child) => sum + (child.offsetWidth || child.getBoundingClientRect().width),
|
|
1870
|
+
0,
|
|
1871
|
+
);
|
|
1872
|
+
|
|
1873
|
+
const measureSingleCycleWidth = (set: HTMLElement, originalItemCount: number): number => {
|
|
1874
|
+
if (originalItemCount <= 0 || set.children.length < originalItemCount) return 0;
|
|
1875
|
+
const firstCard = set.children[0] as HTMLElement;
|
|
1876
|
+
const lastCard = set.children[originalItemCount - 1] as HTMLElement;
|
|
1877
|
+
if (!firstCard || !lastCard) return 0;
|
|
1878
|
+
const style = getComputedStyle(set);
|
|
1879
|
+
const gapPx = Number.parseFloat(style.columnGap || style.gap || '0') || 0;
|
|
1880
|
+
const spanWidth = lastCard.getBoundingClientRect().right - firstCard.getBoundingClientRect().left;
|
|
1881
|
+
if (spanWidth > 0) return spanWidth;
|
|
1882
|
+
const cycleChildren = Array.from({ length: originalItemCount }, (_, i) => set.children[i] as HTMLElement);
|
|
1883
|
+
const childWidth = sumElementWidths(cycleChildren);
|
|
1884
|
+
if (childWidth <= 0) return 0;
|
|
1885
|
+
return childWidth + gapPx * Math.max(0, originalItemCount - 1);
|
|
1886
|
+
};
|
|
1887
|
+
|
|
1888
|
+
const measureSetWidth = (set: HTMLElement): number => {
|
|
1889
|
+
const rectWidth = set.getBoundingClientRect().width;
|
|
1890
|
+
if (rectWidth > 0) return rectWidth;
|
|
1891
|
+
const offsetWidth = set.offsetWidth;
|
|
1892
|
+
if (offsetWidth > 0) return offsetWidth;
|
|
1893
|
+
const childWidth = sumElementWidths(Array.from(set.children) as HTMLElement[]);
|
|
1894
|
+
if (childWidth <= 0) return 0;
|
|
1895
|
+
const style = getComputedStyle(set);
|
|
1896
|
+
const gapPx = Number.parseFloat(style.columnGap || style.gap || '0') || 0;
|
|
1897
|
+
const paddingRightPx = Number.parseFloat(style.paddingRight) || 0;
|
|
1898
|
+
return childWidth + gapPx * Math.max(0, set.children.length - 1) + paddingRightPx;
|
|
1899
|
+
};
|
|
1900
|
+
|
|
1842
1901
|
const isCardInMarqueeView = (card: Element, wrapper: Element): boolean => {
|
|
1843
1902
|
const wrapperRect = wrapper.getBoundingClientRect();
|
|
1844
1903
|
const rect = card.getBoundingClientRect();
|
|
@@ -1853,11 +1912,7 @@ const isAnyCopyOfSlotInView = (wrapper: Element, itemIndex: number): boolean =>
|
|
|
1853
1912
|
type MarqueeItemCardProps = {
|
|
1854
1913
|
item: MarqueeItem;
|
|
1855
1914
|
prefix: string;
|
|
1856
|
-
imageFit:
|
|
1857
|
-
display: 'fit' | 'cover';
|
|
1858
|
-
ratioValue: '1:1' | '2:3' | '3:4' | '4:5' | '16:9';
|
|
1859
|
-
reversed: boolean;
|
|
1860
|
-
};
|
|
1915
|
+
imageFit: MarqueeImageFit;
|
|
1861
1916
|
imageMaxWidth: number;
|
|
1862
1917
|
imageMaxHeight: number;
|
|
1863
1918
|
imageHoverClass?: string;
|
|
@@ -1893,12 +1948,9 @@ const MarqueeItemCard = ({
|
|
|
1893
1948
|
const effW = ratioReversed ? rH : rW;
|
|
1894
1949
|
const effH = ratioReversed ? rW : rH;
|
|
1895
1950
|
const ratio = effW / effH;
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
coverHeight = imageMaxHeight;
|
|
1900
|
-
coverWidth = coverHeight * ratio;
|
|
1901
|
-
}
|
|
1951
|
+
const unconstrainedHeight = imageMaxWidth / ratio;
|
|
1952
|
+
const coverHeight = unconstrainedHeight > imageMaxHeight ? imageMaxHeight : unconstrainedHeight;
|
|
1953
|
+
const coverWidth = unconstrainedHeight > imageMaxHeight ? imageMaxHeight * ratio : imageMaxWidth;
|
|
1902
1954
|
const coverWidthScaled = scaled(coverWidth);
|
|
1903
1955
|
const coverHeightScaled = scaled(coverHeight);
|
|
1904
1956
|
|
|
@@ -1939,7 +1991,7 @@ const MarqueeItemCard = ({
|
|
|
1939
1991
|
alignItems: 'start',
|
|
1940
1992
|
...(isCover
|
|
1941
1993
|
? { width: coverWidthScaled }
|
|
1942
|
-
: { width: '
|
|
1994
|
+
: { width: 'max-content', maxWidth: scaled(imageMaxWidth), minWidth: 0 }),
|
|
1943
1995
|
}}
|
|
1944
1996
|
>
|
|
1945
1997
|
<div
|
|
@@ -1953,7 +2005,7 @@ const MarqueeItemCard = ({
|
|
|
1953
2005
|
...(isCover
|
|
1954
2006
|
? { width: coverWidthScaled, height: coverHeightScaled, overflow: 'hidden'}
|
|
1955
2007
|
: {
|
|
1956
|
-
width: '
|
|
2008
|
+
width: 'max-content',
|
|
1957
2009
|
maxWidth: scaled(imageMaxWidth),
|
|
1958
2010
|
height: scaled(imageMaxHeight),
|
|
1959
2011
|
}),
|
|
@@ -1979,8 +2031,12 @@ const MarqueeItemCard = ({
|
|
|
1979
2031
|
|
|
1980
2032
|
export const Marquee = ({ settings, content, isEditor, isPreviewMode, isEditMode }: MarqueeProps) => {
|
|
1981
2033
|
const { prefix: P } = useScopedStyles();
|
|
1982
|
-
const
|
|
1983
|
-
const
|
|
2034
|
+
const [setWidth, setSetWidth] = useState(0);
|
|
2035
|
+
const animationDistance = setWidth > 0 ? Math.round(setWidth) : 0;
|
|
2036
|
+
const scopedCss = useMemo(() => getCSS(P, animationDistance), [P, animationDistance]);
|
|
2037
|
+
const { speed, direction, pauseOnHover, gap, imageMaxWidth, imageMaxHeight, hoverEffect } = settings;
|
|
2038
|
+
const imageFit = useMemo(() => normalizeImageFit(settings.imageFit), [settings.imageFit]);
|
|
2039
|
+
const originalItemCount = content?.length ?? 0;
|
|
1984
2040
|
const showControls = Boolean(isEditMode);
|
|
1985
2041
|
const showHoverEffects = !isEditor || Boolean(isPreviewMode);
|
|
1986
2042
|
const imageHoverClass = showHoverEffects && hoverEffect !== 'off' && hoverEffect !== 'randomize' ? \`\${P}-image-hover-\${hoverEffect}\` : undefined;
|
|
@@ -1992,7 +2048,6 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
1992
2048
|
const wrapperRef = useRef<HTMLDivElement | null>(null);
|
|
1993
2049
|
const trackRef = useRef<HTMLDivElement | null>(null);
|
|
1994
2050
|
const setRef = useRef<HTMLDivElement | null>(null);
|
|
1995
|
-
const [setWidth, setSetWidth] = useState(0);
|
|
1996
2051
|
const [trackHeight, setTrackHeight] = useState(0);
|
|
1997
2052
|
const hoverPauseEnabled = autoplayEnabled && pauseOnHover === 'on';
|
|
1998
2053
|
const [isHovering, setIsHovering] = useState(false);
|
|
@@ -2006,12 +2061,14 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
2006
2061
|
const [contentSequenceRepeat, setContentSequenceRepeat] = useState(MIN_CONTENT_SEQUENCE_REPEAT);
|
|
2007
2062
|
const setContent = useMemo(() => {
|
|
2008
2063
|
const items = content ?? [];
|
|
2009
|
-
if (
|
|
2064
|
+
if (items.length === 0) return items;
|
|
2065
|
+
const shouldExpandSet = autoplayEnabled || Boolean(isEditor);
|
|
2066
|
+
if (!shouldExpandSet) return items;
|
|
2010
2067
|
return expandSetContent(items, contentSequenceRepeat);
|
|
2011
|
-
}, [content, autoplayEnabled, contentSequenceRepeat]);
|
|
2068
|
+
}, [content, autoplayEnabled, contentSequenceRepeat, isEditor]);
|
|
2012
2069
|
const firstSetImageUrlCount = useMemo(
|
|
2013
|
-
() =>
|
|
2014
|
-
[
|
|
2070
|
+
() => (content ?? []).filter((i) => Boolean(i.image?.url)).length,
|
|
2071
|
+
[content],
|
|
2015
2072
|
);
|
|
2016
2073
|
const copies = useMarqueeTrack ? OUTER_SET_COPIES : 1;
|
|
2017
2074
|
|
|
@@ -2030,14 +2087,15 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
2030
2087
|
|
|
2031
2088
|
const revertSwappedSlotsOutOfView = (itemIndices: Iterable<number>) => {
|
|
2032
2089
|
setSwappedSlots((prev) => {
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2090
|
+
const indicesToRemove = Array.from(itemIndices).filter(
|
|
2091
|
+
(itemIndex) => itemIndex in prev && !isAnyCopyOfSlotInView(wrapper, itemIndex),
|
|
2092
|
+
);
|
|
2093
|
+
if (indicesToRemove.length === 0) return prev;
|
|
2094
|
+
const next = { ...prev };
|
|
2095
|
+
indicesToRemove.forEach((itemIndex) => {
|
|
2038
2096
|
delete next[itemIndex];
|
|
2039
|
-
}
|
|
2040
|
-
return next
|
|
2097
|
+
});
|
|
2098
|
+
return next;
|
|
2041
2099
|
});
|
|
2042
2100
|
};
|
|
2043
2101
|
|
|
@@ -2058,19 +2116,19 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
2058
2116
|
.forEach((card) => observer.observe(card));
|
|
2059
2117
|
});
|
|
2060
2118
|
|
|
2061
|
-
|
|
2119
|
+
const rafRef = { current: 0 };
|
|
2062
2120
|
const tick = () => {
|
|
2063
2121
|
const swappedKeys = Object.keys(swappedSlotsRef.current);
|
|
2064
2122
|
if (swappedKeys.length === 0) return;
|
|
2065
2123
|
revertSwappedSlotsOutOfView(swappedKeys.map(Number));
|
|
2066
|
-
|
|
2124
|
+
rafRef.current = requestAnimationFrame(tick);
|
|
2067
2125
|
};
|
|
2068
2126
|
if (Object.keys(swappedSlotsRef.current).length > 0) {
|
|
2069
|
-
|
|
2127
|
+
rafRef.current = requestAnimationFrame(tick);
|
|
2070
2128
|
}
|
|
2071
2129
|
|
|
2072
2130
|
return () => {
|
|
2073
|
-
cancelAnimationFrame(
|
|
2131
|
+
cancelAnimationFrame(rafRef.current);
|
|
2074
2132
|
observer.disconnect();
|
|
2075
2133
|
};
|
|
2076
2134
|
}, [hoverEffect, swappedSlots, showHoverEffects]);
|
|
@@ -2080,42 +2138,51 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
2080
2138
|
const wrapper = wrapperRef.current;
|
|
2081
2139
|
const set = setRef.current;
|
|
2082
2140
|
if (!wrapper || !set) return;
|
|
2083
|
-
|
|
2141
|
+
const rafRef = { current: 0 };
|
|
2084
2142
|
const measure = () => {
|
|
2085
|
-
const nextContainerWidth = wrapper.getBoundingClientRect().width;
|
|
2086
|
-
const nextRawSetWidth = set
|
|
2143
|
+
const nextContainerWidth = wrapper.getBoundingClientRect().width || wrapper.offsetWidth;
|
|
2144
|
+
const nextRawSetWidth = measureSetWidth(set);
|
|
2087
2145
|
const prevCandidate = stableCandidateRef.current;
|
|
2088
2146
|
const isStableNow =
|
|
2089
2147
|
typeof prevCandidate === 'number' &&
|
|
2090
2148
|
Math.abs(prevCandidate - nextRawSetWidth) <= 0.25;
|
|
2091
2149
|
stableCandidateRef.current = nextRawSetWidth;
|
|
2092
|
-
if (autoplayEnabled &&
|
|
2093
|
-
const singleCycleWidth =
|
|
2094
|
-
if (singleCycleWidth
|
|
2095
|
-
const targetRepeat = Math.
|
|
2096
|
-
|
|
2097
|
-
Math.
|
|
2150
|
+
if ((autoplayEnabled || isEditor) && originalItemCount > 0 && nextContainerWidth > 0) {
|
|
2151
|
+
const singleCycleWidth = measureSingleCycleWidth(set, originalItemCount);
|
|
2152
|
+
if (singleCycleWidth >= MIN_TRUSTWORTHY_CYCLE_WIDTH_PX) {
|
|
2153
|
+
const targetRepeat = Math.min(
|
|
2154
|
+
MAX_CONTENT_SEQUENCE_REPEAT,
|
|
2155
|
+
Math.max(
|
|
2156
|
+
MIN_CONTENT_SEQUENCE_REPEAT,
|
|
2157
|
+
Math.ceil(nextContainerWidth / singleCycleWidth) + 1,
|
|
2158
|
+
),
|
|
2098
2159
|
);
|
|
2099
2160
|
if (targetRepeat !== contentSequenceRepeat) {
|
|
2100
2161
|
setContentSequenceRepeat(targetRepeat);
|
|
2101
|
-
return;
|
|
2102
2162
|
}
|
|
2103
2163
|
}
|
|
2104
2164
|
}
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2165
|
+
const resolvedSetWidth = nextRawSetWidth > 0
|
|
2166
|
+
? nextRawSetWidth
|
|
2167
|
+
: (() => {
|
|
2168
|
+
const singleCycleWidth = measureSingleCycleWidth(set, originalItemCount);
|
|
2169
|
+
return singleCycleWidth > 0 ? singleCycleWidth * contentSequenceRepeat : 0;
|
|
2170
|
+
})();
|
|
2171
|
+
if (resolvedSetWidth > 0) {
|
|
2172
|
+
setSetWidth((prev) => {
|
|
2173
|
+
if (prev <= 0) return resolvedSetWidth;
|
|
2174
|
+
if (!isStableNow) return prev;
|
|
2175
|
+
if (Math.round(prev) === Math.round(resolvedSetWidth)) return prev;
|
|
2176
|
+
return resolvedSetWidth;
|
|
2177
|
+
});
|
|
2111
2178
|
} else if (!isStableNow && setWidth <= 0) {
|
|
2112
|
-
cancelAnimationFrame(
|
|
2113
|
-
|
|
2179
|
+
cancelAnimationFrame(rafRef.current);
|
|
2180
|
+
rafRef.current = requestAnimationFrame(measure);
|
|
2114
2181
|
}
|
|
2115
2182
|
};
|
|
2116
2183
|
const schedule = () => {
|
|
2117
|
-
cancelAnimationFrame(
|
|
2118
|
-
|
|
2184
|
+
cancelAnimationFrame(rafRef.current);
|
|
2185
|
+
rafRef.current = requestAnimationFrame(measure);
|
|
2119
2186
|
};
|
|
2120
2187
|
scheduleRemeasureRef.current = schedule;
|
|
2121
2188
|
schedule();
|
|
@@ -2124,39 +2191,39 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
2124
2191
|
ro.observe(set);
|
|
2125
2192
|
return () => {
|
|
2126
2193
|
scheduleRemeasureRef.current = null;
|
|
2127
|
-
cancelAnimationFrame(
|
|
2194
|
+
cancelAnimationFrame(rafRef.current);
|
|
2128
2195
|
ro.disconnect();
|
|
2129
2196
|
};
|
|
2130
|
-
}, [autoplayEnabled, useMarqueeTrack, setWidth, contentImageUrlsKey, contentSequenceRepeat]);
|
|
2197
|
+
}, [autoplayEnabled, useMarqueeTrack, setWidth, contentImageUrlsKey, contentSequenceRepeat, originalItemCount, isEditor]);
|
|
2131
2198
|
|
|
2132
2199
|
useLayoutEffect(() => {
|
|
2200
|
+
if (!useMarqueeTrack || animationDistance <= 0) return;
|
|
2133
2201
|
const track = trackRef.current;
|
|
2134
|
-
if (!
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
const durationS = \`\${Math.max(0, durationMs) / 1000}s\`;
|
|
2138
|
-
track.style.setProperty('--marquee-distance', \`\${safeSetWidth}px\`);
|
|
2139
|
-
track.style.setProperty('--marquee-duration', durationS);
|
|
2140
|
-
}, [autoplayEnabled, useMarqueeTrack, pxPerSec, setWidth]);
|
|
2202
|
+
if (!track) return;
|
|
2203
|
+
restartTrackAnimation(track);
|
|
2204
|
+
}, [useMarqueeTrack, animationDistance, direction, pxPerSec]);
|
|
2141
2205
|
|
|
2142
2206
|
useLayoutEffect(() => {
|
|
2143
|
-
if (!useMarqueeTrack) {
|
|
2144
|
-
setTrackHeight(0);
|
|
2145
|
-
return;
|
|
2146
|
-
}
|
|
2147
|
-
if (setWidth <= 0) {
|
|
2207
|
+
if (!useMarqueeTrack || setWidth <= 0) {
|
|
2148
2208
|
setTrackHeight(0);
|
|
2149
2209
|
return;
|
|
2150
2210
|
}
|
|
2151
2211
|
const track = trackRef.current;
|
|
2152
|
-
|
|
2212
|
+
const set = setRef.current;
|
|
2213
|
+
if (!track || !set) return;
|
|
2153
2214
|
const measure = () => {
|
|
2154
|
-
const
|
|
2215
|
+
const trackHeight = track.offsetHeight || track.getBoundingClientRect().height;
|
|
2216
|
+
const childMaxHeight = (Array.from(set.children) as HTMLElement[]).reduce(
|
|
2217
|
+
(max, child) => Math.max(max, child.offsetHeight || child.getBoundingClientRect().height),
|
|
2218
|
+
0,
|
|
2219
|
+
);
|
|
2220
|
+
const next = trackHeight > 0 ? trackHeight : childMaxHeight;
|
|
2155
2221
|
setTrackHeight(next > 0 ? next : 0);
|
|
2156
2222
|
};
|
|
2157
2223
|
measure();
|
|
2158
2224
|
const ro = new ResizeObserver(measure);
|
|
2159
2225
|
ro.observe(track);
|
|
2226
|
+
ro.observe(set);
|
|
2160
2227
|
return () => ro.disconnect();
|
|
2161
2228
|
}, [useMarqueeTrack, copies, setContent, isEditor, gap, imageMaxWidth, imageMaxHeight, setWidth, imageFit, swappedSlots]);
|
|
2162
2229
|
|
|
@@ -2243,23 +2310,29 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
2243
2310
|
: hoverPauseEnabled
|
|
2244
2311
|
? (isHovering ? 'paused' : 'running')
|
|
2245
2312
|
: 'running';
|
|
2313
|
+
const durationMs = animationDistance > 0 && pxPerSec > 0 ? (animationDistance / pxPerSec) * 1000 : 0;
|
|
2314
|
+
const durationS = \`\${Math.max(0, durationMs) / 1000}s\`;
|
|
2246
2315
|
|
|
2247
2316
|
return (
|
|
2248
2317
|
<div
|
|
2249
2318
|
ref={wrapperRef}
|
|
2250
2319
|
className={cn(\`\${P}-wrapper\`, \`\${P}-marquee-wrapper\`)}
|
|
2251
2320
|
aria-label="Marquee"
|
|
2252
|
-
style={
|
|
2321
|
+
style={trackHeight > 0 ? { height: trackHeight } : undefined}
|
|
2253
2322
|
>
|
|
2254
2323
|
<style dangerouslySetInnerHTML={{ __html: scopedCss }} />
|
|
2255
2324
|
<div
|
|
2256
|
-
key="marquee-track"
|
|
2257
2325
|
ref={trackRef}
|
|
2258
2326
|
className={\`\${P}-marquee-track\`}
|
|
2259
2327
|
data-direction={direction}
|
|
2260
2328
|
onMouseEnter={onTrackEnter}
|
|
2261
2329
|
onMouseLeave={onTrackLeave}
|
|
2262
|
-
style={{
|
|
2330
|
+
style={{
|
|
2331
|
+
WebkitAnimationDuration: durationS,
|
|
2332
|
+
animationDuration: durationS,
|
|
2333
|
+
WebkitAnimationPlayState: marqueePlayState,
|
|
2334
|
+
animationPlayState: marqueePlayState,
|
|
2335
|
+
}}
|
|
2263
2336
|
>
|
|
2264
2337
|
{Array.from({ length: copies }, (_, copyIndex) => (
|
|
2265
2338
|
<div
|
|
@@ -2273,7 +2346,12 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
2273
2346
|
aria-hidden={copyIndex > 0}
|
|
2274
2347
|
>
|
|
2275
2348
|
{setContent.map((marqueeItem, slotIndex) =>
|
|
2276
|
-
renderCardWrapper(
|
|
2349
|
+
renderCardWrapper(
|
|
2350
|
+
marqueeItem,
|
|
2351
|
+
copyIndex,
|
|
2352
|
+
slotIndex,
|
|
2353
|
+
copyIndex === 0 && slotIndex < originalItemCount,
|
|
2354
|
+
),
|
|
2277
2355
|
)}
|
|
2278
2356
|
</div>
|
|
2279
2357
|
))}
|
|
@@ -2329,7 +2407,7 @@ type MarqueeProps = {
|
|
|
2329
2407
|
isPreviewMode?: boolean;
|
|
2330
2408
|
isEditMode?: boolean;
|
|
2331
2409
|
} & CommonComponentProps;
|
|
2332
|
-
`,
|
|
2410
|
+
`,Gu={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:7},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},hoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["off","brightness","grayscale"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,display:{type:"numeric-input"}},imageMaxWidth:{type:"number",scope:"layout",title:"Max width",min:10,display:{type:"numeric-input"}},imageMaxHeight:{type:"number",scope:"layout",title:"Max height",min:10,display:{type:"numeric-input"}},imageFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}}},defaults:{direction:"left",pauseOnHover:"off",hoverEffect:"off",imageFit:{display:"fit",ratioValue:"16:9",reversed:!1}},layoutDefaults:{m:{speed:.55,gap:.04,imageMaxWidth:.8,imageMaxHeight:.21},d:{speed:1.64,gap:.02,imageMaxWidth:.208,imageMaxHeight:.278}},displayRules:[{if:{name:"imageFit.display",value:"cover"},then:{name:"properties.hoverEffect.display.enum",value:["off","brightness","grayscale","randomize"]}}],layout:["__componentName__","speed","direction","pauseOnHover","hoverEffect","gap","imageMaxWidth","imageMaxHeight","imageFit"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["direction"]},{type:"row",items:["speed","imageFit"]},{type:"row",items:["imageMaxWidth","imageMaxHeight"]},{type:"row",title:"Hover Settings",items:[{type:"row",title:"",items:["hoverEffect","pauseOnHover"]}]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"}},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/grid(1).webp",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/grid(2).webp",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/grid(3).webp",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/grid(4).webp",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/grid(5).webp",name:""},link:""}]}},Uu={element:qu,id:"marquee",name:"Simple Marquee",category:"galleries",version:1,defaultSize:{d:{width:"100%"},m:{width:390}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple_Marquee.mp4"},schema:Gu,sourceCode:Ku,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}};function Ea(e){return`
|
|
2333
2411
|
.${e}-marquee-wrapper {
|
|
2334
2412
|
overflow: hidden;
|
|
2335
2413
|
width: 100%;
|
|
@@ -2416,7 +2494,7 @@ type MarqueeProps = {
|
|
|
2416
2494
|
pointer-events: auto;
|
|
2417
2495
|
z-index: 10;
|
|
2418
2496
|
}
|
|
2419
|
-
`}const
|
|
2497
|
+
`}const Xu=30,Pa=2,Yu=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=I.useScopedStyles(),{align:a,speed:u,direction:c,pauseOnHover:m,gap:p,cardWidth:P,corners:x,stroke:$,strokeColor:g,bgColor:y,padding:C,logoMarginTop:w,logoWidth:E,logoHeight:T,captionMarginTop:F}=e,M=!!o,W=((t==null?void 0:t.length)??0)>0,_=u>0&&(!n||i),L=W&&(_||n),U=Math.max(0,u)*Xu,v=S=>I.scalingValue(S,n??!1),R=l.useRef(null),N=l.useRef(null),D=l.useRef(null),[ne,pe]=l.useState(0),[K,B]=l.useState(0),[Z,q]=l.useState(0),O=_&&m==="on",[Y,ae]=l.useState(!1),oe=l.useRef(null),[H,ue]=l.useState(0),[f,me]=l.useState(0),fe=l.useRef(null),ye=S=>{var z,Q,se,Te,Fe;return{fontSettings:{fontFamily:(e==null?void 0:e[`${S}FontFamily`])??"Arial",fontWeight:((z=e==null?void 0:e[`${S}FontSettings`])==null?void 0:z.fontWeight)??400,fontStyle:((Q=e==null?void 0:e[`${S}FontSettings`])==null?void 0:Q.fontStyle)??"normal"},textAppearance:{textTransform:((se=e==null?void 0:e[`${S}TextAppearance`])==null?void 0:se.textTransform)??"none",textDecoration:((Te=e==null?void 0:e[`${S}TextAppearance`])==null?void 0:Te.textDecoration)??"none",fontVariant:((Fe=e==null?void 0:e[`${S}TextAppearance`])==null?void 0:Fe.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${S}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${S}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${S}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${S}LineHeight`])??.01,color:(e==null?void 0:e[`${S}Color`])??"#000000"}},Me=ye("text"),ee=ye("caption"),ge=l.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(S=>{var j,z;return(((j=S.text)==null?void 0:j.length)??0)>0||(((z=S.caption)==null?void 0:z.length)??0)>0}),[t]),X=l.useMemo(()=>!L||(t==null?void 0:t.length)===0?1:K<=0||ne<=0?Pa:Math.max(Pa,Math.ceil(ne/K)+1),[L,t==null?void 0:t.length,K,ne]);l.useLayoutEffect(()=>{if(!L)return;const S=R.current,j=D.current;if(!S||!j)return;let z=0;const Q=()=>{const Fe=S.getBoundingClientRect().width,Ie=j.getBoundingClientRect().width,$e=fe.current,tt=typeof $e=="number"&&Math.abs($e-Ie)<=.25;if(fe.current=Ie,pe(Fe),typeof Ie=="number"&&Ie>0&&K<=0){B(Ie);return}tt&&Ie!==K?B(Ie):!tt&&K<=0&&(cancelAnimationFrame(z),z=requestAnimationFrame(Q))},se=()=>{cancelAnimationFrame(z),z=requestAnimationFrame(Q)};se();const Te=new ResizeObserver(se);return Te.observe(S),Te.observe(j),()=>{cancelAnimationFrame(z),Te.disconnect()}},[_,L,K]),l.useLayoutEffect(()=>{const S=N.current;if(!L||!S)return;const j=K>0?K:0,z=j>0&&U>0?j/U*1e3:0,Q=`${Math.max(0,z)/1e3}s`;S.style.setProperty("--marquee-distance",`${j}px`),S.style.setProperty("--marquee-duration",Q)},[_,L,U,K]),l.useLayoutEffect(()=>{if(!L){q(0);return}const S=D.current,j=N.current;if(!S||!j)return;const z=()=>{let se=0;for(let Te=0;Te<S.children.length;Te++){const Ie=S.children[Te].firstElementChild;Ie&&(se=Math.max(se,Ie.offsetHeight))}se<=0&&(se=j.offsetHeight),q(se>0?se:0)};z();const Q=new ResizeObserver(z);return Q.observe(S),Q.observe(j),()=>{Q.disconnect()}},[L,X,t,n,p,P,C,$,x,E,T,H,f]);const be=()=>{O&&ae(!0)},te=()=>{O&&ae(!1)},ie=l.useMemo(()=>{switch(a){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[a]),J=l.useMemo(()=>{switch(a){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[a]),xe=l.useCallback((S,j,z,Q)=>r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ie,width:"100%"},children:[r.jsx("div",{"data-controls":M?Q==null?void 0:Q.controlsName:void 0,"data-controls-axis":M?"y":void 0,className:M?`${s}-control`:void 0,style:{height:v((Q==null?void 0:Q.marginTop)??0)}}),r.jsx("div",{...Q!=null&&Q.dataMeasureKind?{"data-testimonial-measure":Q.dataMeasureKind}:{},style:{...At(S,n),textAlign:J,pointerEvents:"auto",...typeof(Q==null?void 0:Q.minHeightPx)=="number"&&Q.minHeightPx>0?{minHeight:Q.minHeightPx}:{}},children:r.jsx(ui,{content:j})})]},z),[ie,J,n,M,s,v]),Se=l.useCallback((S,j,z)=>{var Q,se,Te;return r.jsxs("div",{style:{padding:`${v(C.top)} ${v(C.right)} ${v(C.bottom)} ${v(C.left)}`,width:v(P+$*2),height:"100%",borderRadius:v(x),border:`${v($)} solid ${g}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[r.jsx("div",{className:`${s}-cover`,style:{background:y}}),r.jsxs("div",{className:`${s}-elements-overlay`,style:{alignItems:ie,textAlign:J},children:[S.text&&xe(Me,S.text,"text",z!=null&&z.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(z==null?void 0:z.textMinHeightPx)=="number"&&z.textMinHeightPx>0?{minHeightPx:z.textMinHeightPx}:void 0),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ie,width:"100%"},children:[r.jsx("div",{"data-controls":M&&!(z!=null&&z.dataMeasureAttrs)?"logoMarginTop":void 0,className:M&&!(z!=null&&z.dataMeasureAttrs)?`${s}-control`:void 0,style:{height:v(w)}}),r.jsx("div",{style:{width:v(E),height:v(T)},children:((Q=S.logo)==null?void 0:Q.url)&&r.jsx("img",{src:S.logo.url,alt:((se=S.logo)==null?void 0:se.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((Te=S.logo)==null?void 0:Te.objectFit)||"contain"}})})]}),S.caption&&xe(ee,S.caption,"caption",{...z!=null&&z.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:F,...z!=null&&z.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(z==null?void 0:z.captionMinHeightPx)=="number"&&z.captionMinHeightPx>0?{minHeightPx:z.captionMinHeightPx}:{}})]})]},j)},[y,F,ee,P,x,T,w,E,ie,J,C.bottom,C.left,C.right,C.top,xe,$,g,Me,n,M,s]),ve=l.useCallback(S=>{ue(S.maxTextPx),me(S.maxCaptionPx)},[]);l.useLayoutEffect(()=>{if(!ge){ve({maxTextPx:0,maxCaptionPx:0});return}const S=oe.current;if(!S)return;const j=()=>{I.readTestimonialTextMeasure(S,ve)};j();const z=new ResizeObserver(j);return z.observe(S),()=>{z.disconnect()}},[ge,ve,t,Se]);const Ee=ge?{textMinHeightPx:H,captionMinHeightPx:f}:void 0,A=ge?r.jsx("div",{ref:oe,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((S,j)=>Se(S,`measure-${j}`,{dataMeasureAttrs:!0}))}):null,G=(S,j)=>r.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[Se(S,`card-${j}`,Ee),M&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${v(p)})`,width:v(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},j);if(L){const S=_?O&&Y?"paused":"running":"paused";return r.jsxs("div",{ref:R,className:Je(`${s}-wrapper`,`${s}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...Z>0?{height:Z}:{}},children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ea(s)}}),A,r.jsx("div",{ref:N,className:`${s}-marquee-track`,"data-direction":c,onMouseEnter:be,onMouseLeave:te,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":S},children:Array.from({length:X},(j,z)=>r.jsx("div",{ref:z===0?D:void 0,className:`${s}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:v(p),paddingRight:v(p)},"aria-hidden":z>0,children:t==null?void 0:t.map((Q,se)=>G(Q,`${z}-${se}`))},`set-${z}`))})]})}return r.jsxs("div",{className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ea(s)}}),A,r.jsx("div",{style:{gap:v(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((S,j)=>G(S,j))})]})},Ju=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
2420
2498
|
import cn from 'classnames';
|
|
2421
2499
|
import { CommonComponentProps } from '../props';
|
|
2422
2500
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -3031,7 +3109,7 @@ type TestimonialsSettings = {
|
|
|
3031
3109
|
logoHeight: number;
|
|
3032
3110
|
captionMarginTop: number;
|
|
3033
3111
|
};
|
|
3034
|
-
`,
|
|
3112
|
+
`,Ia={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Zu={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:{...Ia.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:{...Ia.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"}]}]}]}},Qu={element:Yu,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:Zu,sourceCode:Ju,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function ep(e){return`
|
|
3035
3113
|
.${e}-container {
|
|
3036
3114
|
position: relative;
|
|
3037
3115
|
overflow-x: clip;
|
|
@@ -3155,7 +3233,7 @@ type TestimonialsSettings = {
|
|
|
3155
3233
|
width: 100%;
|
|
3156
3234
|
height: 100%;
|
|
3157
3235
|
}
|
|
3158
|
-
`}const
|
|
3236
|
+
`}const tp=3e3,np=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=I.useScopedStyles(),a=t||[],{speed:u,align:c,width:m,imageMarginTop:p,textMarginTop:P,captionMarginTop:x,imageWidth:$,imageHeight:g,controlsWidth:y,controlsColor:C,controlsHoverColor:w}=e,E=u>0&&(!n||!!i),[T,F]=l.useState(0),[M,W]=l.useState(null),[_,L]=l.useState(!1),U=l.useRef(null),v=l.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),R=l.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);l.useEffect(()=>{F(0),W(null),L(!1)},[a.length]);const N=a[T],D=M===null?null:a[M],ne=ee=>{var X,be,te,ie,J;return{fontSettings:{fontFamily:(e==null?void 0:e[`${ee}FontFamily`])??"Arial",fontWeight:((X=e==null?void 0:e[`${ee}FontSettings`])==null?void 0:X.fontWeight)??400,fontStyle:((be=e==null?void 0:e[`${ee}FontSettings`])==null?void 0:be.fontStyle)??"normal"},textAppearance:{textTransform:((te=e==null?void 0:e[`${ee}TextAppearance`])==null?void 0:te.textTransform)??"none",textDecoration:((ie=e==null?void 0:e[`${ee}TextAppearance`])==null?void 0:ie.textDecoration)??"none",fontVariant:((J=e==null?void 0:e[`${ee}TextAppearance`])==null?void 0:J.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${ee}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${ee}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${ee}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${ee}WordSpacing`])??0,color:(e==null?void 0:e[`${ee}Color`])??"#000000"}},pe=ne("text"),K=ne("caption"),B=a.length>1&&a.some(ee=>{var ge,X;return(((ge=ee.text)==null?void 0:ge.length)??0)>0||(((X=ee.caption)==null?void 0:X.length)??0)>0}),Z=l.useRef(null),[q,O]=l.useState(0),[Y,ae]=l.useState(0),oe=e.controls??{mode:"Off",icon:null},H=a.length>1,ue=l.useCallback((ee,ge)=>!H||ge===ee?ee:(U.current&&window.clearTimeout(U.current),W(ee),L(!0),U.current=window.setTimeout(()=>{W(null),L(!1),U.current=null},300),ge),[H]),f=l.useCallback(()=>{H&&F(ee=>ue(ee,(ee-1+a.length)%a.length))},[H,ue,a.length]),me=l.useCallback(()=>{H&&F(ee=>ue(ee,(ee+1)%a.length))},[H,ue,a.length]);l.useEffect(()=>{if(!E||!H)return;const ee=Math.max(300,tp/u),ge=window.setInterval(()=>{F(X=>ue(X,(X+1)%a.length))},ee);return()=>{window.clearInterval(ge)}},[E,H,ue,a.length,u]),l.useEffect(()=>()=>{U.current&&window.clearTimeout(U.current)},[]);const fe=(ee,ge)=>{var J,xe,Se,ve;const X=ge==null?void 0:ge.textMinHeightPx,be=ge==null?void 0:ge.captionMinHeightPx,te=ge==null?void 0:ge.dataMeasureAttrs,ie=o&&!(ge!=null&&ge.dataMeasureAttrs)&&!(ge!=null&&ge.hideControls);return r.jsxs(r.Fragment,{children:[ee.text&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:v,width:"100%"},children:[r.jsx("div",{"data-controls":ie?"textMarginTop":void 0,className:ie?`${s}-control`:void 0,style:{height:I.scalingValue(P??0,n??!1)}}),r.jsx("div",{...te&&{"data-testimonial-measure":"text"},style:{...At(pe,n),...X&&X>0?{minHeight:X}:{},textAlign:R,pointerEvents:"auto"},children:r.jsx(ui,{content:ee.text})})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:v,width:"100%"},children:[r.jsx("div",{"data-controls":ie?"imageMarginTop":void 0,className:ie?`${s}-control`:void 0,style:{height:I.scalingValue(p??0,n??!1)}}),r.jsx("div",{style:{width:I.scalingValue($??0,n??!1),height:I.scalingValue(g??0,n??!1)},children:((J=ee.image)==null?void 0:J.url)&&r.jsx("img",{src:(xe=ee.image)==null?void 0:xe.url,alt:((Se=ee.image)==null?void 0:Se.name)??"",className:`${s}-icon`,style:{objectFit:((ve=ee.image)==null?void 0:ve.objectFit)||"contain"}})})]}),ee.caption&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:v,width:"100%"},children:[r.jsx("div",{"data-controls":ie?"captionMarginTop":void 0,className:ie?`${s}-control`:void 0,style:{height:I.scalingValue(x??0,n??!1)}}),r.jsx("div",{...te?{"data-testimonial-measure":"caption"}:{},style:{...At(K,n),...be&&be>0?{minHeight:be}:{},textAlign:R,pointerEvents:"auto"},children:r.jsx(ui,{content:ee.caption})})]})]})},ye=l.useCallback(ee=>{O(ee.maxTextPx),ae(ee.maxCaptionPx)},[]);if(l.useLayoutEffect(()=>{if(!B){ye({maxTextPx:0,maxCaptionPx:0});return}const ee=Z.current;if(!ee)return;const ge=()=>{I.readTestimonialTextMeasure(ee,ye)};ge();const X=new ResizeObserver(ge);return X.observe(ee),()=>{X.disconnect()}},[B,ye,t]),!N)return r.jsx(r.Fragment,{});const Me=B?{textMinHeightPx:q,captionMinHeightPx:Y}:void 0;return r.jsx(r.Fragment,{children:r.jsxs("div",{className:`${s}-container`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ep(s)}}),r.jsxs("div",{className:`${s}-wrapper`,style:{width:I.scalingValue(m??0,n??!1),alignItems:v},children:[B&&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:a.map((ee,ge)=>r.jsx("div",{style:{width:"100%"},children:fe(ee,{dataMeasureAttrs:!0})},ge))}),r.jsxs("div",{className:`${s}-fade-stack`,children:[D&&_&&r.jsx("div",{className:Je(`${s}-fade-item-prev`,`${s}-fade-out`),children:fe(D,{...Me,hideControls:!0})}),r.jsx("div",{className:Je(`${s}-fade-item-current`,_?`${s}-fade-in`:void 0),children:fe(N,Me)})]})]}),oe.mode==="On"&&r.jsxs("div",{className:`${s}-controls`,children:[r.jsx("div",{className:`${s}-arrow`,style:{width:I.scalingValue(y??.02,n??!1),height:I.scalingValue(y??.02,n??!1),"--arrow-hover-color":w},children:r.jsx("button",{type:"button",className:`${s}-arrow-inner`,onClick:f,disabled:!H,"aria-label":"Previous testimonial",children:oe.icon&&r.jsx(Qt,{url:oe.icon,fill:C,hoverFill:w,className:Je(`${s}-arrow-img`,`${s}-mirror`)})})}),r.jsx("div",{className:Je(`${s}-arrow`,`${s}-next-arrow`),style:{width:I.scalingValue(y??.02,n??!1),height:I.scalingValue(y??.02,n??!1),"--arrow-hover-color":w},children:r.jsx("button",{type:"button",className:`${s}-arrow-inner`,onClick:me,disabled:!H,"aria-label":"Next testimonial",children:oe.icon&&r.jsx(Qt,{url:oe.icon,fill:C,hoverFill:w,className:`${s}-arrow-img`})})})]})]})})},ip=`import cn from 'classnames';
|
|
3159
3237
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3160
3238
|
import { CommonComponentProps } from '../props';
|
|
3161
3239
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -3651,11 +3729,11 @@ type TestimonialsSettings = {
|
|
|
3651
3729
|
icon?: string | null;
|
|
3652
3730
|
};
|
|
3653
3731
|
};
|
|
3654
|
-
`,
|
|
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>'),Ra={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},rp={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:{...Ra.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:{...Ra.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"}]}]}]}},ap={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:rp,sourceCode:ip,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function sp(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ma(e){return((e==null?void 0:e.trim().length)??0)>0}function sr(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function lr(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:I.scalingValue((o-t)/2,i)}}function lp(e){return`
|
|
3655
3733
|
.${e}-wrapper {
|
|
3656
3734
|
display: grid;
|
|
3657
3735
|
align-items: start;
|
|
3658
|
-
min-height: ${
|
|
3736
|
+
min-height: ${sp(48)};
|
|
3659
3737
|
}
|
|
3660
3738
|
.${e}-item {
|
|
3661
3739
|
display: flex;
|
|
@@ -3992,7 +4070,7 @@ type TestimonialsSettings = {
|
|
|
3992
4070
|
pointer-events: auto;
|
|
3993
4071
|
z-index: 10;
|
|
3994
4072
|
}
|
|
3995
|
-
`}const pn=500,sp=750,On="cubic-bezier(0.22, 1, 0.36, 1)",lp=72,cp=50;function dp(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 pp(e){const[t]=e.media;return t!=null&&t.url?t:null}function mp(e){return!Array.isArray(e)||e.length===0?[]:dp(e)?e.flatMap(t=>{const n=up(t);if(!n)return[];const i=pp(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 Ei(e){return e.type==="video"}function gp(e){e.pause(),e.removeAttribute("src"),e.load()}function Aa({media:e,className:t,style:n,onMediaClick:i}){return Ei(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 so(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function hp(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function fp({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:s,onMouseMove:a,onTransitionEnd:u}){return l.useEffect(()=>{const c=n.current;if(c)return()=>{gp(c)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:s,onMouseMove:a,onTransitionEnd:u,style:i})}function yp({items:e,index:t,imageDisplay:n,onClose:i,onPrev:o,onNext:s,counterClassName:a,counterStyle:u}){const c=n==="cover",m=l.useRef(null),p=l.useRef(null),b=l.useRef(null),w=l.useRef(null),S=l.useRef(0),g=l.useRef(0),v=l.useRef("none"),T=l.useRef(!1),$=l.useRef(!1),C=l.useRef(!1),L=l.useRef(null),[A,k]=l.useState(null),[F,I]=l.useState("opening"),[E,J]=l.useState(0),[y,_]=l.useState(0),[W,G]=l.useState(!1),[te,ue]=l.useState(!1),[X,H]=l.useState(!1),Q=l.useRef(t),z=e[t],B=z?Ei(z):!1,Y=y!==0||W,oe=l.useCallback(re=>{C.current=re,G(re)},[]),ie=l.useCallback(()=>{L.current!==null&&(window.clearTimeout(L.current),L.current=null)},[]),O=l.useCallback(()=>{ie(),L.current=window.setTimeout(()=>{ie(),oe(!1)},pn+32)},[ie,oe]),ce=l.useCallback(()=>{const re=p.current,Ce=b.current;if(!re)return;const Se=re.getBoundingClientRect(),we=Se.width,Ie=Se.height;if(!we||!Ie)return;if(n==="cover"){k({width:we,height:Ie,left:Se.left,top:Se.top});return}if(!Ce){k(so(re));return}const{width:N,height:ee}=hp(Ce);if(!N||!ee){k(so(re));return}const R=N/ee,K=we/Ie;if(R>K){const D=we/R;k({width:we,height:D,left:Se.left,top:Se.top+(Ie-D)/2})}else{const D=Ie*R;k({width:D,height:Ie,left:Se.left+(we-D)/2,top:Se.top})}},[n]);l.useEffect(()=>{ce();const re=p.current;if(!re)return;const Ce=new ResizeObserver(()=>ce());return Ce.observe(re),()=>Ce.disconnect()},[ce,t]),l.useEffect(()=>{F==="opening"&&A&&I("open")},[F,A]),l.useEffect(()=>{if(F!=="closing")return;const re=setTimeout(()=>i(),pn);return()=>clearTimeout(re)},[F,i]),l.useEffect(()=>()=>{ie()},[ie]),l.useLayoutEffect(()=>{if(Q.current===t)return;ie(),J(0),_(0),oe(!1),H(!1),ue(!1),S.current=0,g.current=0,v.current="none",T.current=!1,w.current=null,$.current=!1;const re=p.current;re&&k(so(re)),Q.current=t},[t,oe,ie]),l.useEffect(()=>{if(F!=="open")return;const re=()=>{const ee=R=>{R.stopPropagation(),R.preventDefault(),document.removeEventListener("click",ee,!0)};document.addEventListener("click",ee,!0)},Ce=ee=>{ie(),C.current=!1,G(!1),_(0),ue(!1),T.current=!1,g.current=0,v.current="none";const R=p.current;R&&k(so(R)),ee<0?s():o()},Se=ee=>{if(Math.abs(ee)>cp&&e.length>1){Ce(ee);return}oe(!0),_(0),O()},we=ee=>{if(ee.touches.length!==1||C.current)return;const R=ee.touches[0];$.current=!0,w.current={x:R.clientX,y:R.clientY},v.current="none",g.current=0,T.current=!1},Ie=ee=>{if(!w.current||ee.touches.length!==1||C.current)return;const R=ee.touches[0],K=R.clientX-w.current.x,D=R.clientY-w.current.y;if(v.current==="none"){if(Math.abs(K)<10&&Math.abs(D)<10)return;if(Math.abs(K)>Math.abs(D)){if(e.length<=1)return;v.current="horizontal"}else if(D>0)v.current="vertical";else return}if(v.current==="horizontal"){T.current=!0,ue(!0),g.current=K,_(K),ee.preventDefault();return}v.current==="vertical"&&(T.current=!0,ue(!0),S.current=D,J(D),ee.preventDefault())},N=()=>{if(!w.current)return;const ee=v.current,R=T.current;if(R&&ee==="horizontal")Se(g.current),re();else if(R&&ee==="vertical"){if(S.current>lp){const D=window.innerHeight;S.current=D,H(!0),J(D),I("closing")}else S.current=0,J(0);re()}else ee==="horizontal"&&Math.abs(g.current)>0&&(Se(g.current),re());w.current=null,v.current="none",g.current=0,T.current=!1,ue(!1)};return document.addEventListener("touchstart",we,{passive:!0}),document.addEventListener("touchmove",Ie,{passive:!1}),document.addEventListener("touchend",N),document.addEventListener("touchcancel",N),()=>{document.removeEventListener("touchstart",we),document.removeEventListener("touchmove",Ie),document.removeEventListener("touchend",N),document.removeEventListener("touchcancel",N)}},[F,e.length,s,o,oe,O]),l.useEffect(()=>{const re=Ce=>{Ce.key==="Escape"&&(Ce.preventDefault(),Ce.stopPropagation(),F!=="closing"&&I("closing"))};return window.addEventListener("keydown",re,!0),()=>window.removeEventListener("keydown",re,!0)},[F]);const f=()=>{F!=="closing"&&I("closing")},de=F==="open",be=F==="closing",fe=E>0?Math.max(0,1-E/500):1,Re=E>0?Math.max(.35,1-E/500):1,Z=re=>{if(re.stopPropagation(),$.current){$.current=!1;return}if(e.length<=1)return;const Ce=re.currentTarget.getBoundingClientRect(),Se=re.clientY-Ce.top,we=Math.min(52,Ce.height*.2);if(!(Se>Ce.height-we)){if(re.clientX-Ce.left<Ce.width/2){o();return}s()}},ge=re=>{if(e.length<=1)return;const Ce=re.currentTarget.getBoundingClientRect(),Se=re.clientX-Ce.left,we=re.clientY-Ce.top,Ie=Math.min(52,Ce.height*.2);if(we>Ce.height-Ie){re.currentTarget.style.cursor="default";return}re.currentTarget.style.cursor=Se<Ce.width/2?"w-resize":"e-resize"},U=l.useCallback(re=>{re.propertyName!=="transform"||!C.current||(ie(),oe(!1))},[ie,oe]),V=Y?`translateX(${y}px)`:E>0?`translateY(${E}px)`:void 0,j={position:"fixed",top:A==null?void 0:A.top,left:A==null?void 0:A.left,width:A==null?void 0:A.width,height:A==null?void 0:A.height,objectFit:n==="cover"?"cover":"contain",transform:V,opacity:E>0?Re:F==="opening"||be?0:1,transition:te&&!W?"none":W?`transform ${pn}ms ${On}`:X?`transform ${pn}ms ${On}, opacity ${pn}ms ${On}`:F==="opening"||be?`opacity ${pn}ms ${On}`:"none",pointerEvents:B&&de&&!Y?"auto":"none",touchAction:B&&de?"none":void 0,zIndex:9998},he=A?{position:"fixed",top:A.top,height:A.height,width:A.width/2,zIndex:9999}:null;return r.jsxs("div",{ref:m,style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:9997,touchAction:F==="open"?"none":void 0},onClick:f,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:de?fe:0,transition:te?"none":`opacity ${pn}ms ${On}`,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:p,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:de?1:0,transition:`opacity ${pn}ms ${On}`,pointerEvents:"none",zIndex:9999},children:e.length>1&&r.jsxs("p",{className:a,style:u,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:p,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:de?1:0,transition:`opacity ${pn}ms ${On}`},children:e.length>1&&r.jsxs("p",{className:a,style:u,children:[t+1," / ",e.length]})})]})}),A&&z&&(B?r.jsx(fp,{src:z.url,phase:F,mediaRef:b,mediaStyle:j,onLoadedMetadata:ce,onClick:Z,onMouseMove:ge,onTransitionEnd:U},`${t}-${z.url}`):r.jsx("img",{ref:b,src:z.url,alt:z.name,onLoad:ce,onTransitionEnd:U,style:j},`${t}-${z.url}`)),de&&he&&e.length>1&&!B&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...he,left:A.left,cursor:"w-resize",pointerEvents:Y?"none":"auto"},onClick:re=>{if($.current){$.current=!1;return}re.stopPropagation(),o()}}),r.jsx("div",{style:{...he,left:A.left+A.width/2,cursor:"e-resize",pointerEvents:Y?"none":"auto"},onClick:re=>{if($.current){$.current=!1;return}re.stopPropagation(),s()}})]})]})}function vp(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function bp({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:s,activeEvent:a,layoutId:u}){const{prefix:c}=P.useScopedStyles(),{type:m="a",gridLayout:p,textBoxWidth:b=100,verticalGap:w,entriesCount:S,lightbox:g,imageDisplay:v,lightboxImageDisplay:T,slider:$,sliderTiming:C,direction:L,transition:A,titleMarginTop:k,subtitleMarginTop:F,titleColor:I,subtitleColor:E,lightboxCounterColor:J,titleFontFamily:y,titleFontSettings:_,titleFontSize:W,titleLineHeight:G,titleLetterSpacing:te,titleWordSpacing:ue,titleTextAppearance:X,subtitleFontFamily:H,subtitleFontSettings:Q,subtitleFontSize:z,subtitleLineHeight:B,subtitleLetterSpacing:Y,subtitleWordSpacing:oe,subtitleTextAppearance:ie,lightboxCounterFontFamily:O,lightboxCounterFontSettings:ce,lightboxCounterFontSize:f,lightboxCounterLineHeight:de,lightboxCounterLetterSpacing:be,lightboxCounterWordSpacing:fe,lightboxCounterTextAppearance:Re,showText:Z="always",alignEntries:ge="off",align:U="top"}=e,V={fontSettings:{fontFamily:y,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:W??.01,lineHeight:G,letterSpacing:te??0,wordSpacing:ue??0,textAppearance:X,color:I},he={...qt(At(V,n))},re={fontSettings:{fontFamily:H,fontWeight:(Q==null?void 0:Q.fontWeight)??400,fontStyle:(Q==null?void 0:Q.fontStyle)??"normal"},fontSize:z??.01,lineHeight:B,letterSpacing:Y??0,wordSpacing:oe??0,textAppearance:ie,color:E},Se={...qt(At(re,n))},we={fontSettings:{fontFamily:O,fontWeight:(ce==null?void 0:ce.fontWeight)??400,fontStyle:(ce==null?void 0:ce.fontStyle)??"normal"},fontSize:f??.01,lineHeight:de,letterSpacing:be??0,wordSpacing:fe??0,textAppearance:Re,color:J},N={...qt(At(we,n)),...cr(f,de,c,n)},ee=lr(W,G,`${c}-item-title`,`${c}-text-tight-leading`),R=lr(z,B,`${c}-item-subtitle`,`${c}-text-tight-leading`),K=cr(W,G,c,n),D=cr(z,B,c,n),ae=lr(f,de,`${c}-lightbox-counter`,`${c}-text-tight-leading`),ne=P.buildColorVars(c,{titleColor:I,subtitleColor:E,lightboxCounterColor:J},xp,wp),Te=`${a&&a!=="default"?`${c}-state-${a}`:""}${Z==="on hover"&&(!n||i)?` ${c}-show-text-hover`:""}`.trim(),xe=S===0?1/0:S,Ke=(t??[]).slice(0,xe),se=p.entryWidth??.2,Ae=(v==null?void 0:v.display)==="cover",Ne=(v==null?void 0:v.ratioValue)??"1:1",He=(v==null?void 0:v.reversed)??!1,[dt,ft]=Ne.split(":").map(Number),wt=`${He?ft:dt} / ${He?dt:ft}`,Ht=P.scalingValue(se??0,n),Lt=!Ae&&$!=="off",Xe={width:Ht,...Ae?{aspectRatio:wt,height:"auto",overflow:"hidden"}:{height:"auto"}},Me=`${c}-item-image-wrapper${Lt?` ${c}-item-image-wrapper-fit-slider`:""}`.trim(),Ve=m==="d"||m==="e"||m==="f",Ye=ge==="on",Be=`calc(${P.scalingValue(se??0,n)} * (${b} / 100))`,ut=P.scalingValue(se*b/100,n),Pt=Ae?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},[Qe,Mt]=l.useState("ltr"),[Ot,je]=l.useState(0),gt=l.useRef(null);l.useEffect(()=>{const qe=gt.current;if(!qe)return;const yt=new ResizeObserver(vt=>{je(Math.round(vt[0].contentRect.width))});return yt.observe(qe),()=>yt.disconnect()},[]);const it=(()=>{const qe={...ne},yt=gt.current?getComputedStyle(gt.current).getPropertyValue("--cntrl-article-width").trim():"";return yt&&(qe["--cntrl-article-width"]=yt),qe})(),[Ze,rt]=l.useState(!1),[at,sn]=l.useState([]),[wn,ln]=l.useState(0),ot=g==="on"&&(!n||i),tn=(qe,yt)=>{n&&!i||g!=="off"&&(sn(qe),ln(yt),rt(!0))};l.useEffect(()=>{if(!Ze||g!=="on"||typeof document>"u")return;const qe=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=qe}},[Ze,g]),l.useEffect(()=>{!n||i||rt(!1)},[n,i]);const Ut=l.useMemo(()=>ap(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ut}}),r.jsx("div",{style:ne,children:r.jsx("div",{ref:gt,className:`${c}-wrapper ${c}-type-${m}${Ye?` ${c}-align-entries`:""} ${c}-image-align-${U} ${Te}`.trim(),style:{gridTemplateColumns:`repeat(${p.columnsCount}, minmax(0, 1fr))`,rowGap:Ye?0:P.scalingValue(w??0,n),columnGap:P.scalingValue(p.horizontalGap??0,n),width:P.scalingValue(p.wrapperWidth??0,n),...Ye?{[`--${c}-align-entries-row-gap`]:P.scalingValue(w??0,n)}:{}},children:Ke.map((qe,yt)=>{var kt;const vt=Ra(qe.title),pe=Ra(qe.subtitle),Le=(((kt=qe.link)==null?void 0:kt.length)??0)>0&&g==="off"?qe.link:void 0,_e=Math.floor(yt/p.columnsCount)===Math.ceil(Ke.length/p.columnsCount)-1,We=Ve?r.jsxs("div",{className:`${c}-item-text-block`,children:[vt&&r.jsx("p",{className:ee,style:{width:Be,...he,...K},children:qe.title}),vt&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${c}-control`:void 0,style:{height:P.scalingValue(k??0,n),width:ut}}),pe&&r.jsx("p",{className:R,style:{width:Be,...Se,...D},children:qe.subtitle}),pe&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${c}-control`:void 0,style:{height:P.scalingValue(F??0,n),width:ut}})]}):null,tt=Ye?r.jsxs("div",{className:`${c}-item-title-row`,children:[!Ve&&r.jsx("div",{"data-controls":o&&vt?"titleMarginTop":void 0,className:o&&vt?`${c}-control`:void 0,style:{height:vt?P.scalingValue(k??0,n):0,width:ut}}),vt&&r.jsx("p",{className:ee,style:{width:Be,...he,...K},children:qe.title}),Ve&&vt&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${c}-control`:void 0,style:{height:P.scalingValue(k??0,n),width:ut}})]}):null,$t=Ye?r.jsxs("div",{className:`${c}-item-subtitle-row`,children:[!Ve&&r.jsx("div",{"data-controls":o&&pe?"subtitleMarginTop":void 0,className:o&&pe?`${c}-control`:void 0,style:{height:pe?P.scalingValue(F??0,n):0,width:ut}}),pe&&r.jsx("p",{className:R,style:{width:Be,...Se,...D},children:qe.subtitle}),Ve&&pe&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${c}-control`:void 0,style:{height:P.scalingValue(F??0,n),width:ut}})]}):null,Ee=Le?r.jsxs("a",{href:Le,target:"_blank",className:`${c}-item-text-link`,children:[tt,$t]}):r.jsxs(r.Fragment,{children:[tt,$t]}),et=mp(qe.gallery),De=et.filter(Ge=>Ge.lightboxMedia).map(Ge=>Ge.lightboxMedia),st=r.jsx("div",{className:Me,style:Xe,children:et.length===0?null:$==="off"?(()=>{const{displayMedia:Ge,lightboxMedia:nt}=et[0],Et=nt?De.findIndex(St=>St.url===nt.url):-1;return r.jsx(Aa,{media:Ge,className:`${c}-item-${Ei(Ge)?"video":"image"}`.trim(),style:Pt,onMediaClick:ot&&Et>=0?()=>tn(De,Et):void 0})})():r.jsxs(r.Fragment,{children:[Lt&&Ye&&r.jsx("div",{className:`${c}-item-image-wrapper-sizer`,"aria-hidden":"true",children:et.map(({displayMedia:Ge})=>Ei(Ge)?r.jsx("video",{src:Ge.url,muted:!0,playsInline:!0},`sizer-${Ge.url}`):r.jsx("img",{src:Ge.url,alt:""},`sizer-${Ge.url}`))}),r.jsx(Yr,{className:`${c}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:C*1e3,width:"100%",height:"100%",speed:sp,type:A==="fade"?"fade":"loop",rewind:A==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:A==="fade"?"ltr":L!=="random"?L==="horizontal"?"ltr":"ttb":Qe},onMoved:Ge=>{if(L!=="random"||A==="fade")return;const nt=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";Mt(nt),setTimeout(()=>{Ge.refresh()},0)},children:et.map(({displayMedia:Ge,lightboxMedia:nt},Et)=>{const St=nt?De.findIndex(_t=>_t.url===nt.url):-1;return r.jsx(Jr,{children:r.jsx(Aa,{media:Ge,className:`${c}-item-${Ei(Ge)?"video":"image"}`.trim(),style:Pt,onMediaClick:ot&&St>=0?()=>tn(De,St):void 0})},Et)})},`${A}-${se}-${L}-${C}-${Ot}-${u}`)]})}),pt=Ve?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&vt?"titleMarginTop":void 0,className:o&&vt?`${c}-control`:void 0,style:{height:vt?P.scalingValue(k??0,n):0,width:ut}}),r.jsx("p",{className:ee,style:{width:Be,...he,...K},children:qe.title}),r.jsx("div",{"data-controls":o&&pe?"subtitleMarginTop":void 0,className:o&&pe?`${c}-control`:void 0,style:{height:pe?P.scalingValue(F??0,n):0,width:ut}}),r.jsx("p",{className:R,style:{width:Be,...Se,...D},children:qe.subtitle})]});return r.jsx("div",{className:`${c}-item`.trim(),children:r.jsx("div",{className:`${o?`${c}-item-inner`:`${c}-item-inner-hidden`}${Ye&&_e?` ${c}-item-inner-last-row`:""}`.trim(),style:{width:(b??0)>100?`calc(${P.scalingValue(se??0,n)} * (${b} / 100))`:P.scalingValue(se??0,n)},children:Ye?r.jsx(r.Fragment,{children:Ve?r.jsxs(r.Fragment,{children:[Ee,r.jsx("a",{href:Le,target:"_blank",className:`${c}-item-image-link`,children:st})]}):r.jsxs(r.Fragment,{children:[r.jsx("a",{href:Le,target:"_blank",className:`${c}-item-image-link`,children:st}),Ee]})}):Le?r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:Le,target:"_blank",className:`${c}-item-image-link`,children:[We,st]}),!Ve&&r.jsx("a",{href:Le,target:"_blank",className:`${c}-item-text-link`,children:pt})]}):r.jsxs(r.Fragment,{children:[We,st,pt]})})},yt)})})}),(!n||i)&&Ze&&typeof document<"u"&&g==="on"&&ji.createPortal(r.jsx("div",{style:it,"data-selection":"none",children:r.jsx(yp,{items:at,index:wn,imageDisplay:vp(T),onClose:()=>rt(!1),onPrev:()=>ln(qe=>(qe-1+at.length)%at.length),onNext:()=>ln(qe=>(qe+1)%at.length),counterClassName:ae,counterStyle:N})}),document.body)]})}const xp={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},wp=["hover","focus","filled","success","error"],$p=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
4073
|
+
`}const pn=500,cp=750,On="cubic-bezier(0.22, 1, 0.36, 1)",dp=72,up=50;function pp(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 mp(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function gp(e){const[t]=e.media;return t!=null&&t.url?t:null}function hp(e){return!Array.isArray(e)||e.length===0?[]:pp(e)?e.flatMap(t=>{const n=mp(t);if(!n)return[];const i=gp(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 Li(e){return e.type==="video"}function fp(e){e.pause(),e.removeAttribute("src"),e.load()}function Aa({media:e,className:t,style:n,onMediaClick:i}){return Li(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 ao(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function yp(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function vp({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:s,onMouseMove:a,onTransitionEnd:u}){return l.useEffect(()=>{const c=n.current;if(c)return()=>{fp(c)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:s,onMouseMove:a,onTransitionEnd:u,style:i})}function bp({items:e,index:t,imageDisplay:n,onClose:i,onPrev:o,onNext:s,counterClassName:a,counterStyle:u}){const c=n==="cover",m=l.useRef(null),p=l.useRef(null),P=l.useRef(null),x=l.useRef(null),$=l.useRef(0),g=l.useRef(0),y=l.useRef("none"),C=l.useRef(!1),w=l.useRef(!1),E=l.useRef(!1),T=l.useRef(null),[F,M]=l.useState(null),[W,_]=l.useState("opening"),[L,U]=l.useState(0),[v,R]=l.useState(0),[N,D]=l.useState(!1),[ne,pe]=l.useState(!1),[K,B]=l.useState(!1),Z=l.useRef(t),q=e[t],O=q?Li(q):!1,Y=v!==0||N,ae=l.useCallback(J=>{E.current=J,D(J)},[]),oe=l.useCallback(()=>{T.current!==null&&(window.clearTimeout(T.current),T.current=null)},[]),H=l.useCallback(()=>{oe(),T.current=window.setTimeout(()=>{oe(),ae(!1)},pn+32)},[oe,ae]),ue=l.useCallback(()=>{const J=p.current,xe=P.current;if(!J)return;const Se=J.getBoundingClientRect(),ve=Se.width,Ee=Se.height;if(!ve||!Ee)return;if(n==="cover"){M({width:ve,height:Ee,left:Se.left,top:Se.top});return}if(!xe){M(ao(J));return}const{width:A,height:G}=yp(xe);if(!A||!G){M(ao(J));return}const S=A/G,j=ve/Ee;if(S>j){const z=ve/S;M({width:ve,height:z,left:Se.left,top:Se.top+(Ee-z)/2})}else{const z=Ee*S;M({width:z,height:Ee,left:Se.left+(ve-z)/2,top:Se.top})}},[n]);l.useEffect(()=>{ue();const J=p.current;if(!J)return;const xe=new ResizeObserver(()=>ue());return xe.observe(J),()=>xe.disconnect()},[ue,t]),l.useEffect(()=>{W==="opening"&&F&&_("open")},[W,F]),l.useEffect(()=>{if(W!=="closing")return;const J=setTimeout(()=>i(),pn);return()=>clearTimeout(J)},[W,i]),l.useEffect(()=>()=>{oe()},[oe]),l.useLayoutEffect(()=>{if(Z.current===t)return;oe(),U(0),R(0),ae(!1),B(!1),pe(!1),$.current=0,g.current=0,y.current="none",C.current=!1,x.current=null,w.current=!1;const J=p.current;J&&M(ao(J)),Z.current=t},[t,ae,oe]),l.useEffect(()=>{if(W!=="open")return;const J=()=>{const G=S=>{S.stopPropagation(),S.preventDefault(),document.removeEventListener("click",G,!0)};document.addEventListener("click",G,!0)},xe=G=>{oe(),E.current=!1,D(!1),R(0),pe(!1),C.current=!1,g.current=0,y.current="none";const S=p.current;S&&M(ao(S)),G<0?s():o()},Se=G=>{if(Math.abs(G)>up&&e.length>1){xe(G);return}ae(!0),R(0),H()},ve=G=>{if(G.touches.length!==1||E.current)return;const S=G.touches[0];w.current=!0,x.current={x:S.clientX,y:S.clientY},y.current="none",g.current=0,C.current=!1},Ee=G=>{if(!x.current||G.touches.length!==1||E.current)return;const S=G.touches[0],j=S.clientX-x.current.x,z=S.clientY-x.current.y;if(y.current==="none"){if(Math.abs(j)<10&&Math.abs(z)<10)return;if(Math.abs(j)>Math.abs(z)){if(e.length<=1)return;y.current="horizontal"}else if(z>0)y.current="vertical";else return}if(y.current==="horizontal"){C.current=!0,pe(!0),g.current=j,R(j),G.preventDefault();return}y.current==="vertical"&&(C.current=!0,pe(!0),$.current=z,U(z),G.preventDefault())},A=()=>{if(!x.current)return;const G=y.current,S=C.current;if(S&&G==="horizontal")Se(g.current),J();else if(S&&G==="vertical"){if($.current>dp){const z=window.innerHeight;$.current=z,B(!0),U(z),_("closing")}else $.current=0,U(0);J()}else G==="horizontal"&&Math.abs(g.current)>0&&(Se(g.current),J());x.current=null,y.current="none",g.current=0,C.current=!1,pe(!1)};return document.addEventListener("touchstart",ve,{passive:!0}),document.addEventListener("touchmove",Ee,{passive:!1}),document.addEventListener("touchend",A),document.addEventListener("touchcancel",A),()=>{document.removeEventListener("touchstart",ve),document.removeEventListener("touchmove",Ee),document.removeEventListener("touchend",A),document.removeEventListener("touchcancel",A)}},[W,e.length,s,o,ae,H]),l.useEffect(()=>{const J=xe=>{xe.key==="Escape"&&(xe.preventDefault(),xe.stopPropagation(),W!=="closing"&&_("closing"))};return window.addEventListener("keydown",J,!0),()=>window.removeEventListener("keydown",J,!0)},[W]);const f=()=>{W!=="closing"&&_("closing")},me=W==="open",fe=W==="closing",ye=L>0?Math.max(0,1-L/500):1,Me=L>0?Math.max(.35,1-L/500):1,ee=J=>{if(J.stopPropagation(),w.current){w.current=!1;return}if(e.length<=1)return;const xe=J.currentTarget.getBoundingClientRect(),Se=J.clientY-xe.top,ve=Math.min(52,xe.height*.2);if(!(Se>xe.height-ve)){if(J.clientX-xe.left<xe.width/2){o();return}s()}},ge=J=>{if(e.length<=1)return;const xe=J.currentTarget.getBoundingClientRect(),Se=J.clientX-xe.left,ve=J.clientY-xe.top,Ee=Math.min(52,xe.height*.2);if(ve>xe.height-Ee){J.currentTarget.style.cursor="default";return}J.currentTarget.style.cursor=Se<xe.width/2?"w-resize":"e-resize"},X=l.useCallback(J=>{J.propertyName!=="transform"||!E.current||(oe(),ae(!1))},[oe,ae]),be=Y?`translateX(${v}px)`:L>0?`translateY(${L}px)`:void 0,te={position:"fixed",top:F==null?void 0:F.top,left:F==null?void 0:F.left,width:F==null?void 0:F.width,height:F==null?void 0:F.height,objectFit:n==="cover"?"cover":"contain",transform:be,opacity:L>0?Me:W==="opening"||fe?0:1,transition:ne&&!N?"none":N?`transform ${pn}ms ${On}`:K?`transform ${pn}ms ${On}, opacity ${pn}ms ${On}`:W==="opening"||fe?`opacity ${pn}ms ${On}`:"none",pointerEvents:O&&me&&!Y?"auto":"none",touchAction:O&&me?"none":void 0,zIndex:9998},ie=F?{position:"fixed",top:F.top,height:F.height,width:F.width/2,zIndex:9999}:null;return r.jsxs("div",{ref:m,style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:9997,touchAction:W==="open"?"none":void 0},onClick:f,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:me?ye:0,transition:ne?"none":`opacity ${pn}ms ${On}`,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:p,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:me?1:0,transition:`opacity ${pn}ms ${On}`,pointerEvents:"none",zIndex:9999},children:e.length>1&&r.jsxs("p",{className:a,style:u,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:p,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:me?1:0,transition:`opacity ${pn}ms ${On}`},children:e.length>1&&r.jsxs("p",{className:a,style:u,children:[t+1," / ",e.length]})})]})}),F&&q&&(O?r.jsx(vp,{src:q.url,phase:W,mediaRef:P,mediaStyle:te,onLoadedMetadata:ue,onClick:ee,onMouseMove:ge,onTransitionEnd:X},`${t}-${q.url}`):r.jsx("img",{ref:P,src:q.url,alt:q.name,onLoad:ue,onTransitionEnd:X,style:te},`${t}-${q.url}`)),me&&ie&&e.length>1&&!O&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...ie,left:F.left,cursor:"w-resize",pointerEvents:Y?"none":"auto"},onClick:J=>{if(w.current){w.current=!1;return}J.stopPropagation(),o()}}),r.jsx("div",{style:{...ie,left:F.left+F.width/2,cursor:"e-resize",pointerEvents:Y?"none":"auto"},onClick:J=>{if(w.current){w.current=!1;return}J.stopPropagation(),s()}})]})]})}function xp(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function wp({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:s,activeEvent:a,layoutId:u}){const{prefix:c}=I.useScopedStyles(),{type:m="a",gridLayout:p,textBoxWidth:P=100,verticalGap:x,entriesCount:$,lightbox:g,imageDisplay:y,lightboxImageDisplay:C,slider:w,sliderTiming:E,direction:T,transition:F,titleMarginTop:M,subtitleMarginTop:W,titleColor:_,subtitleColor:L,lightboxCounterColor:U,titleFontFamily:v,titleFontSettings:R,titleFontSize:N,titleLineHeight:D,titleLetterSpacing:ne,titleWordSpacing:pe,titleTextAppearance:K,subtitleFontFamily:B,subtitleFontSettings:Z,subtitleFontSize:q,subtitleLineHeight:O,subtitleLetterSpacing:Y,subtitleWordSpacing:ae,subtitleTextAppearance:oe,lightboxCounterFontFamily:H,lightboxCounterFontSettings:ue,lightboxCounterFontSize:f,lightboxCounterLineHeight:me,lightboxCounterLetterSpacing:fe,lightboxCounterWordSpacing:ye,lightboxCounterTextAppearance:Me,showText:ee="always",alignEntries:ge="off",align:X="top"}=e,be={fontSettings:{fontFamily:v,fontWeight:(R==null?void 0:R.fontWeight)??400,fontStyle:(R==null?void 0:R.fontStyle)??"normal"},fontSize:N??.01,lineHeight:D,letterSpacing:ne??0,wordSpacing:pe??0,textAppearance:K,color:_},ie={...qt(At(be,n))},J={fontSettings:{fontFamily:B,fontWeight:(Z==null?void 0:Z.fontWeight)??400,fontStyle:(Z==null?void 0:Z.fontStyle)??"normal"},fontSize:q??.01,lineHeight:O,letterSpacing:Y??0,wordSpacing:ae??0,textAppearance:oe,color:L},Se={...qt(At(J,n))},ve={fontSettings:{fontFamily:H,fontWeight:(ue==null?void 0:ue.fontWeight)??400,fontStyle:(ue==null?void 0:ue.fontStyle)??"normal"},fontSize:f??.01,lineHeight:me,letterSpacing:fe??0,wordSpacing:ye??0,textAppearance:Me,color:U},A={...qt(At(ve,n)),...lr(f,me,c,n)},G=sr(N,D,`${c}-item-title`,`${c}-text-tight-leading`),S=sr(q,O,`${c}-item-subtitle`,`${c}-text-tight-leading`),j=lr(N,D,c,n),z=lr(q,O,c,n),Q=sr(f,me,`${c}-lightbox-counter`,`${c}-text-tight-leading`),se=I.buildColorVars(c,{titleColor:_,subtitleColor:L,lightboxCounterColor:U},$p,Sp),Ie=`${a&&a!=="default"?`${c}-state-${a}`:""}${ee==="on hover"&&(!n||i)?` ${c}-show-text-hover`:""}`.trim(),$e=$===0?1/0:$,tt=(t??[]).slice(0,$e),le=p.entryWidth??.2,Ae=(y==null?void 0:y.display)==="cover",ze=(y==null?void 0:y.ratioValue)??"1:1",Ve=(y==null?void 0:y.reversed)??!1,[dt,ft]=ze.split(":").map(Number),wt=`${Ve?ft:dt} / ${Ve?dt:ft}`,Ht=I.scalingValue(le??0,n),Lt=!Ae&&w!=="off",Ge={width:Ht,...Ae?{aspectRatio:wt,height:"auto",overflow:"hidden"}:{height:"auto"}},Re=`${c}-item-image-wrapper${Lt?` ${c}-item-image-wrapper-fit-slider`:""}`.trim(),Be=m==="d"||m==="e"||m==="f",Ue=ge==="on",He=`calc(${I.scalingValue(le??0,n)} * (${P} / 100))`,ut=I.scalingValue(le*P/100,n),It=Ae?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},[Ze,kt]=l.useState("ltr"),[Ot,Oe]=l.useState(0),gt=l.useRef(null);l.useEffect(()=>{const De=gt.current;if(!De)return;const yt=new ResizeObserver(vt=>{Oe(Math.round(vt[0].contentRect.width))});return yt.observe(De),()=>yt.disconnect()},[]);const it=(()=>{const De={...se},yt=gt.current?getComputedStyle(gt.current).getPropertyValue("--cntrl-article-width").trim():"";return yt&&(De["--cntrl-article-width"]=yt),De})(),[Ye,rt]=l.useState(!1),[at,sn]=l.useState([]),[wn,ln]=l.useState(0),ot=g==="on"&&(!n||i),tn=(De,yt)=>{n&&!i||g!=="off"&&(sn(De),ln(yt),rt(!0))};l.useEffect(()=>{if(!Ye||g!=="on"||typeof document>"u")return;const De=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=De}},[Ye,g]),l.useEffect(()=>{!n||i||rt(!1)},[n,i]);const Ut=l.useMemo(()=>lp(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ut}}),r.jsx("div",{style:se,children:r.jsx("div",{ref:gt,className:`${c}-wrapper ${c}-type-${m}${Ue?` ${c}-align-entries`:""} ${c}-image-align-${X} ${Ie}`.trim(),style:{gridTemplateColumns:`repeat(${p.columnsCount}, minmax(0, 1fr))`,rowGap:Ue?0:I.scalingValue(x??0,n),columnGap:I.scalingValue(p.horizontalGap??0,n),width:I.scalingValue(p.wrapperWidth??0,n),...Ue?{[`--${c}-align-entries-row-gap`]:I.scalingValue(x??0,n)}:{}},children:tt.map((De,yt)=>{var Rt;const vt=Ma(De.title),ce=Ma(De.subtitle),Ce=(((Rt=De.link)==null?void 0:Rt.length)??0)>0&&g==="off"?De.link:void 0,ke=Math.floor(yt/p.columnsCount)===Math.ceil(tt.length/p.columnsCount)-1,We=Be?r.jsxs("div",{className:`${c}-item-text-block`,children:[vt&&r.jsx("p",{className:G,style:{width:He,...ie,...j},children:De.title}),vt&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${c}-control`:void 0,style:{height:I.scalingValue(M??0,n),width:ut}}),ce&&r.jsx("p",{className:S,style:{width:He,...Se,...z},children:De.subtitle}),ce&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${c}-control`:void 0,style:{height:I.scalingValue(W??0,n),width:ut}})]}):null,et=Ue?r.jsxs("div",{className:`${c}-item-title-row`,children:[!Be&&r.jsx("div",{"data-controls":o&&vt?"titleMarginTop":void 0,className:o&&vt?`${c}-control`:void 0,style:{height:vt?I.scalingValue(M??0,n):0,width:ut}}),vt&&r.jsx("p",{className:G,style:{width:He,...ie,...j},children:De.title}),Be&&vt&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${c}-control`:void 0,style:{height:I.scalingValue(M??0,n),width:ut}})]}):null,$t=Ue?r.jsxs("div",{className:`${c}-item-subtitle-row`,children:[!Be&&r.jsx("div",{"data-controls":o&&ce?"subtitleMarginTop":void 0,className:o&&ce?`${c}-control`:void 0,style:{height:ce?I.scalingValue(W??0,n):0,width:ut}}),ce&&r.jsx("p",{className:S,style:{width:He,...Se,...z},children:De.subtitle}),Be&&ce&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${c}-control`:void 0,style:{height:I.scalingValue(W??0,n),width:ut}})]}):null,Le=Ce?r.jsxs("a",{href:Ce,target:"_blank",className:`${c}-item-text-link`,children:[et,$t]}):r.jsxs(r.Fragment,{children:[et,$t]}),Qe=hp(De.gallery),je=Qe.filter(qe=>qe.lightboxMedia).map(qe=>qe.lightboxMedia),st=r.jsx("div",{className:Re,style:Ge,children:Qe.length===0?null:w==="off"?(()=>{const{displayMedia:qe,lightboxMedia:nt}=Qe[0],Et=nt?je.findIndex(St=>St.url===nt.url):-1;return r.jsx(Aa,{media:qe,className:`${c}-item-${Li(qe)?"video":"image"}`.trim(),style:It,onMediaClick:ot&&Et>=0?()=>tn(je,Et):void 0})})():r.jsxs(r.Fragment,{children:[Lt&&Ue&&r.jsx("div",{className:`${c}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Qe.map(({displayMedia:qe})=>Li(qe)?r.jsx("video",{src:qe.url,muted:!0,playsInline:!0},`sizer-${qe.url}`):r.jsx("img",{src:qe.url,alt:""},`sizer-${qe.url}`))}),r.jsx(Xr,{className:`${c}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:E*1e3,width:"100%",height:"100%",speed:cp,type:F==="fade"?"fade":"loop",rewind:F==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:F==="fade"?"ltr":T!=="random"?T==="horizontal"?"ltr":"ttb":Ze},onMoved:qe=>{if(T!=="random"||F==="fade")return;const nt=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";kt(nt),setTimeout(()=>{qe.refresh()},0)},children:Qe.map(({displayMedia:qe,lightboxMedia:nt},Et)=>{const St=nt?je.findIndex(_t=>_t.url===nt.url):-1;return r.jsx(Yr,{children:r.jsx(Aa,{media:qe,className:`${c}-item-${Li(qe)?"video":"image"}`.trim(),style:It,onMediaClick:ot&&St>=0?()=>tn(je,St):void 0})},Et)})},`${F}-${le}-${T}-${E}-${Ot}-${u}`)]})}),pt=Be?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&vt?"titleMarginTop":void 0,className:o&&vt?`${c}-control`:void 0,style:{height:vt?I.scalingValue(M??0,n):0,width:ut}}),r.jsx("p",{className:G,style:{width:He,...ie,...j},children:De.title}),r.jsx("div",{"data-controls":o&&ce?"subtitleMarginTop":void 0,className:o&&ce?`${c}-control`:void 0,style:{height:ce?I.scalingValue(W??0,n):0,width:ut}}),r.jsx("p",{className:S,style:{width:He,...Se,...z},children:De.subtitle})]});return r.jsx("div",{className:`${c}-item`.trim(),children:r.jsx("div",{className:`${o?`${c}-item-inner`:`${c}-item-inner-hidden`}${Ue&&ke?` ${c}-item-inner-last-row`:""}`.trim(),style:{width:(P??0)>100?`calc(${I.scalingValue(le??0,n)} * (${P} / 100))`:I.scalingValue(le??0,n)},children:Ue?r.jsx(r.Fragment,{children:Be?r.jsxs(r.Fragment,{children:[Le,r.jsx("a",{href:Ce,target:"_blank",className:`${c}-item-image-link`,children:st})]}):r.jsxs(r.Fragment,{children:[r.jsx("a",{href:Ce,target:"_blank",className:`${c}-item-image-link`,children:st}),Le]})}):Ce?r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:Ce,target:"_blank",className:`${c}-item-image-link`,children:[We,st]}),!Be&&r.jsx("a",{href:Ce,target:"_blank",className:`${c}-item-text-link`,children:pt})]}):r.jsxs(r.Fragment,{children:[We,st,pt]})})},yt)})})}),(!n||i)&&Ye&&typeof document<"u"&&g==="on"&&Bi.createPortal(r.jsx("div",{style:it,"data-selection":"none",children:r.jsx(bp,{items:at,index:wn,imageDisplay:xp(C),onClose:()=>rt(!1),onPrev:()=>ln(De=>(De-1+at.length)%at.length),onNext:()=>ln(De=>(De+1)%at.length),counterClassName:Q,counterStyle:A})}),document.body)]})}const $p={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Sp=["hover","focus","filled","success","error"],Cp=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
3996
4074
|
import '@splidejs/react-splide/css/core';
|
|
3997
4075
|
import { CommonComponentProps } from '../props';
|
|
3998
4076
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -5769,11 +5847,11 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
5769
5847
|
};
|
|
5770
5848
|
|
|
5771
5849
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
5772
|
-
`,dr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Sp=["titleColor","subtitleColor","lightboxCounterColor"],Cp={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:"Gap",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:{...dr.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:{...dr.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:{...dr.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:[...Sp],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Tp={element:bp,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:Cp,sourceCode:$p},Ma=12;function Lp(e,t="50%"){const n={position:"absolute",width:Ma,height:Ma,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 Ft({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:Lp(n,i)})})}function Ep(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 Ip({media:e,className:t,style:n}){const i=l.useRef(null);return l.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const s=o.play();s&&s.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?r.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):r.jsx("img",{className:t,src:e.url,alt:"",style:n})}function So(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Pp(e){return String(e??"").trim().length>0}function _a(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 Fa(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 Wa(e,t,n,i,o,s,a){const u=P.scalingValue(s,a),c=P.scalingValue(0,a),m=e===0,p=e===t-1&&!o;return{borderTopWidth:m&&n?u:c,borderBottomWidth:!p||i?u:c}}function kp(e,t,n){const i=P.scalingValue(t,n),o=P.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Na=10;function Rp(e){return`
|
|
5850
|
+
`,cr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Tp=["titleColor","subtitleColor","lightboxCounterColor"],Lp={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:"Gap",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:{...cr.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:{...cr.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:{...cr.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:[...Tp],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Ep={element:wp,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:Lp,sourceCode:Cp},ka=12;function Pp(e,t="50%"){const n={position:"absolute",width:ka,height:ka,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 Ft({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:Pp(n,i)})})}function Ip(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 Rp({media:e,className:t,style:n}){const i=l.useRef(null);return l.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const s=o.play();s&&s.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?r.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):r.jsx("img",{className:t,src:e.url,alt:"",style:n})}function $o(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Mp(e){return String(e??"").trim().length>0}function _a(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 Fa(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 Wa(e,t,n,i,o,s,a){const u=I.scalingValue(s,a),c=I.scalingValue(0,a),m=e===0,p=e===t-1&&!o;return{borderTopWidth:m&&n?u:c,borderBottomWidth:!p||i?u:c}}function Ap(e,t,n){const i=I.scalingValue(t,n),o=I.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Na=10;function kp(e){return`
|
|
5773
5851
|
.${e}-wrapper {
|
|
5774
5852
|
display: grid;
|
|
5775
5853
|
align-items: start;
|
|
5776
|
-
min-height: ${
|
|
5854
|
+
min-height: ${$o(48)};
|
|
5777
5855
|
position: relative;
|
|
5778
5856
|
overflow: visible;
|
|
5779
5857
|
box-sizing: border-box;
|
|
@@ -5895,7 +5973,7 @@ a.${e}-list-item {
|
|
|
5895
5973
|
flex-shrink: 0;
|
|
5896
5974
|
overflow: visible;
|
|
5897
5975
|
box-sizing: border-box;
|
|
5898
|
-
min-width: ${
|
|
5976
|
+
min-width: ${$o(50)};
|
|
5899
5977
|
position: relative;
|
|
5900
5978
|
display: flex;
|
|
5901
5979
|
align-items: flex-start;
|
|
@@ -5903,7 +5981,7 @@ a.${e}-list-item {
|
|
|
5903
5981
|
|
|
5904
5982
|
.${e}-list-col-last {
|
|
5905
5983
|
flex: 1 1 auto;
|
|
5906
|
-
min-width: ${
|
|
5984
|
+
min-width: ${$o(50)};
|
|
5907
5985
|
}
|
|
5908
5986
|
|
|
5909
5987
|
.${e}-list-col-title {
|
|
@@ -6200,7 +6278,7 @@ a.${e}-list-item {
|
|
|
6200
6278
|
overflow-wrap: anywhere;
|
|
6201
6279
|
word-break: break-word;
|
|
6202
6280
|
}
|
|
6203
|
-
`}const Rn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Zr=["AColumn","BColumn","CColumn","DColumn","EColumn"],yn="cutLabel",Ni=[...Zr,yn],Ko=["A","B","C","D","E"];function Us(e){return`${e}ColumnVerticalAlign`}const Er=["Top","Center","Bottom"];function Qr(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Ko.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Ap(e){const t=Qr(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Mp(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Ko.includes(n)?n:null}function Xs(e,t,n){const i=Mp(e);return i?i===t?!1:Ap(n[Us(i)]):!0}function Hi(e){const t=Qr(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Ko.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function _p(e,t,n){if(Ys(e,t,n))return Hi(e);const i=Hi(e);return i.kind==="baseline"?{kind:"top"}:i}function Fp(e){const t=Hi(e);return t.kind==="baseline"?{kind:"top"}:t}function Ys(e,t,n){return Xs(e,n,t)?Hi(e).kind==="baseline":!1}function Wp(e){const t={};let n=!1;for(const i of Ko){const o=Us(i),s=e[o];if(e.type==="b"){const a=String(s??"Top").trim();a!=="Top"&&a!=="Center"&&a!=="Bottom"&&(t[o]="Top",n=!0);continue}Xs(s,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Np(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Hp(e){const t=Hi(e).kind;return t==="baseline"?"center":t}function Op(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Ha(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Bp(e,t){const n=document.createElement("i");n.className=t,n.setAttribute("aria-hidden","true"),e.prepend(n);const{top:i}=e.getBoundingClientRect(),{bottom:o}=n.getBoundingClientRect(),s=o-i;return n.remove(),s}function ur(e,t,n,i){const o=e.titleEl;if(!o)return 0;const s=o.closest(`.${n}`);if(!s)return 0;const a=Bp(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+a;const u=s.getBoundingClientRect(),c=o.getBoundingClientRect().height;let m=0;return e.kind==="center"?m=(u.height-c)/2:e.kind==="bottom"&&(m=u.height-c),u.top-t+m+a}function jp(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const s=o.querySelector(`.${n}`);s&&(s.style.minHeight=`${i}px`,s.style.height=`${i}px`)}),i)}function zp(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Vp={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Je(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Dp={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function qp(e){return[Je(e,"textFontFamily"),Je(e,"textFontSettings"),{type:"row",items:[Je(e,"textFontSize"),Je(e,"textLineHeight"),Je(e,"textLetterSpacing"),Je(e,"textWordSpacing")]},Je(e,"textTextAlign"),Je(e,"textTextAppearance"),`${e}VerticalAlign`]}function Kp(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Ni.map(e=>[Dp[e],qp(e)]))}}function Ao(e,t){const n=i=>{const o=Je(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===yn?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Oa(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 qt(At(n,t))}function Ba(e,t,n,i){const o=Ao(e,t),s=o.textFontSize??.01,a=o.textLineHeight;return a!==void 0&&a<s?`${n} ${i}`:n}function ja(e,t,n,i){const o=Ao(e,t),s=o.textFontSize??.01,a=o.textLineHeight;return a===void 0||a>=s?{}:{[`--${n}-title-leading-gap`]:P.scalingValue((s-a)/2,i)}}const Kt=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],pi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],mi=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],gi=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Gp={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Up=["hover","focus","filled","success","error"],za=.004,oi=.004,pr=oi,ea=50,Oi=1440,Bi=ea/Oi;function Js(e){const t=typeof e=="number"&&e>0?e:Oi;return ea/t}function Xp(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 Oi}const Zs={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function Ii(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Yp(e,t=1){const n=t/e;return Object.fromEntries(Kt.map(i=>[i,n]))}function Jp(){return Object.fromEntries([...pi.map(e=>[e,0]),...mi.map(e=>[e,0])])}function Zp(){return Object.fromEntries(gi.map(e=>[e,0]))}function lo(e){return Object.fromEntries(Kt.map(t=>[t,typeof e[t]=="number"?e[t]:Zs[t]]))}function Qs(e,t,n){const i=e-Bi,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const s=i/o;return{paddingLeft:t*s,paddingRight:n*s}}function Co(e,t,n){const i=ta(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((s,a)=>s+a,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function Qp(e,t,n){const i={};for(let o=0;o<e;o+=1){const s=pi[o],a=mi[o],u=typeof n[s]=="number"?n[s]:0,c=typeof n[a]=="number"?n[a]:0,m=Qs(t[o]??0,u,c);m.paddingLeft!==u&&(i[s]=m.paddingLeft),m.paddingRight!==c&&(i[a]=m.paddingRight)}return i}function ta(e,t,n){if(e<=0)return[];const i=Kt.slice(0,e).map(m=>n[m]);if(e===1)return i;const o=i.slice(0,e-1),a=o.reduce((m,p)=>m+p,0)+Bi;if(t>=a)return i;const u=[...o];let c=a-t;for(let m=u.length-1;m>=0&&c>0;m-=1){const p=u[m]-Bi;if(p<=0)continue;const b=Math.min(c,p);u[m]-=b,c-=b}return[...u,i[e-1]]}function em(e,t,n){if(e<=1)return{};const i=ta(e,t,n),o={};for(let s=0;s<e-1;s+=1){const a=Kt[s];i[s]!==n[a]&&(o[a]=i[s])}return o}function Va(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Rn]}function tm(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function nm(e,t,n,i){const o=Math.min(i,e.length,Kt.length),s={};for(let a=0;a<o;a+=1){const u=e[a],c=t.indexOf(u);if(c===-1)continue;const m=Kt[c],p=pi[c],b=mi[c],w=gi[c],S=Kt[a],g=pi[a],v=mi[a],T=gi[a],$=n[m],C=n[p],L=n[b],A=n[w];typeof $=="number"&&(s[S]=$),typeof C=="number"&&(s[g]=C),typeof L=="number"&&(s[v]=L),typeof A=="number"&&(s[T]=A)}return s}function el(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 im(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=Ii(e),s=e.type==="b"||e.type===void 0&&t.type==="b",a={...e,...Yp(n,o),...Jp()};if(s)for(const u of gi)typeof t[u]=="number"&&(a[u]=t[u]);else Object.assign(a,Zp());return el(e,a)?a:e}function om(e,t,n){const i=Wp(e);i&&(e={...e,...i});const o=Js(n==null?void 0:n.designWidth),s=e.columns,a=t.columns,u=Ii(e),c=Ii(t),m=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof s=="number"?s:typeof a=="number"?a:Rn.length,b=L=>{if(m)return L;const A=lo({...t,...L}),k=Ii(L),F=Co(p,k,A),I=Qp(p,F,{...t,...L});return Object.keys(I).length===0?L:{...L,...I}};if(typeof s=="number"&&s!==a)return e;const w=Va(e),S=Va(t);if(!tm(w,S))return b({...e,...nm(w,S,t,p)});if(u<c&&typeof p=="number"&&!m){const L=lo({...t,...e});return b({...e,...em(p,u,L)})}if(m){const L=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,A=Math.max(0,(u-o)/2);return L>A?{...e,textPaddingLR:A}:e}const g=lo({...t,...e}),v=Co(p,c,lo(t)),$=Co(p,u,g).some((L,A)=>L<(v[A]??L)),C=Kt.some(L=>{const A=e[L],k=t[L];return typeof A=="number"&&typeof k=="number"&&A!==k});return $||C?b(e):e}function rm(e,t,n,i){const o=t.slice(0,e).reduce((a,u)=>a+u,0),s=n.slice(e+1,t.length-1).reduce((a,u)=>a+u,0);return Math.max(Bi,i-o-s-Bi)}function am(e,t){return Math.random()*(t-e)+e}function sm(e){return Object.fromEntries(Kt.map(t=>[t,typeof e[t]=="number"?e[t]:Zs[t]]))}function mr(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function lm(e,t,n,i,o,s){return e.slice(0,t).map((a,u)=>{const c=pi[u],m=mi[u],p=gi[u];return{key:a,textPrefix:Vp[a],widthKey:Kt[u],width:n[Kt[u]],paddingLeftKey:c,paddingRightKey:m,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[m],paddingBottom:s[p]}})}function cm({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s,layoutId:a,onUpdateSettings:u}){const{prefix:c}=P.useScopedStyles(),m=!!o,{columns:p,type:b,wrapperWidth:w,entriesCount:S,cellMinHeight:g,dividerWidth:v,showVisibility:T,cut:$,showCut:C,cutCellMinHeight:L,cutLabel:A,imageSize:k,imageOnHover:F,entryHoverEffect:I,entryHoverShowOption:E,rowPaddingTop:J,rowPaddingBottom:y,rowPaddingTopB:_,columnsOrder:W,textPaddingLR:G,textColor:te,backgroundColor:ue,dividerColor:X,textHoverColor:H,backgroundHoverColor:Q,dividerHoverColor:z}=e,[B,Y]=l.useState(void 0),[oe,ie]=l.useState(null),O=F==="on"&&(!n||i),ce=($??0)>0,f=b==="b",de=l.useRef(null),be=l.useRef(null),[fe,Re]=l.useState(null),[Z,ge]=l.useState(Oi),U=Js(Z),V=Math.max(0,((w??0)-U)/2),j=Math.min(G??0,V),he=Math.max(j,oi),re=((w??0)+U)/2;l.useLayoutEffect(()=>{if(!n){ge(Oi);return}const pe=()=>{ge(Xp(de.current))};pe();const Le=de.current;if(!Le)return;const _e=new ResizeObserver(pe);_e.observe(Le);let We=Le;for(;We&&!We.style.getPropertyValue("--cntrl-article-width");)We=We.parentElement;return We&&_e.observe(We),()=>_e.disconnect()},[n,a]),l.useEffect(()=>{Y(void 0)},[$,C,t,S]),l.useEffect(()=>{n&&!i&&Y(void 0)},[n,i]);const Ce=P.buildColorVars(c,{textColor:te,backgroundColor:ue,dividerColor:X,textHoverColor:H,backgroundHoverColor:Q,dividerHoverColor:z},Gp,Up),Se=s&&s!=="default"?`${c}-state-${s}`:"",Ie=`${!n||i?I==="default"?`${c}-entry-hover-default`:I==="blinds"?`${c}-entry-hover-blinds`:I==="reveal"?`${c}-entry-hover-reveal`:"":""} ${Se}`.trim(),N=I==="reveal"&&(!n||i),ee=(T==null?void 0:T[0])??!1,R=(T==null?void 0:T[1])??!1,K=l.useRef(e),D=l.useRef(a);l.useEffect(()=>{if(!u||!n){K.current=e,D.current=a;return}if(D.current!==a){K.current=e,D.current=a;return}const pe=K.current;if(!(pe!==e))return;if(typeof pe.columns=="number"&&typeof e.columns=="number"&&pe.columns!==e.columns){K.current=e;return}const _e=om(e,pe,{designWidth:Z});K.current=e,el(e,_e)&&u(_e)},[e,u,n,a,Z]);const ae=l.useMemo(()=>sm(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),ne=l.useMemo(()=>mr(e,pi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),ye=l.useMemo(()=>mr(e,mi),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),ke=l.useMemo(()=>mr(e,gi),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),Te=l.useMemo(()=>Array.isArray(W)&&W.length>0?W:[...Rn],[W]),xe=l.useMemo(()=>lm(Te,p,ae,ne,ye,ke),[Te,p,ae,ne,ye,ke]),Ke=Ii(e),se=l.useMemo(()=>Kt.slice(0,p).map(pe=>ae[pe]),[p,ae]),Ae=l.useMemo(()=>ta(p,Ke,ae),[p,Ke,ae]),Ne=l.useMemo(()=>Co(p,Ke,ae),[p,Ke,ae]),He=l.useMemo(()=>xe.map((pe,Le)=>Qs(Ne[Le]??0,pe.paddingLeft,pe.paddingRight)),[xe,Ne]),dt=l.useMemo(()=>{const pe=S===0?1/0:S;return(t??[]).slice(0,pe).map((_e,We)=>({id:We,cells:Object.fromEntries(Rn.map(tt=>[tt,_e[tt]??""])),image:_e.image,link:_e.link}))},[t,S]),ft=ce?B??$:dt.length,It=l.useMemo(()=>ce?dt.slice(0,ft):dt,[dt,ce,ft]),xt=ce&&ft<dt.length,wt=It.length>1||xt,Ht=[ee?`${c}-divider-top`:"",R||wt?`${c}-divider-bottom`:""].filter(Boolean).join(" "),Lt=!n||i,Xe=()=>{if(!Lt)return;const pe=B??$;if(!C){Y(dt.length);return}Y(Math.min(pe+C,dt.length))},Me=pe=>P.scalingValue(pe,n??!1),Ve=f?_??0:J??0,Ye=y??0,Be=g??0,ut=Ve+Be/2,Pt=Math.max(Ye,pr),Qe=Wa(0,It.length,ee,R,xt,v??0,n??!1).borderTopWidth,Mt=fe!=null?`${fe}px`:`calc(${Qe} + ${Me(ut)})`,Ot=f?"rowPaddingTopB":"rowPaddingTop",je=xe[0],gt=xe[xe.length-1],it=He[0],Ze=He[He.length-1],rt=je&&it?Math.max(it.paddingLeft,oi):0,at=gt&&Ze?Math.max(Ze.paddingRight,oi):0,sn=Ke,wn=pe=>{const Le=de.current;if(!Le)return{x:0,y:0};const _e=Le.getBoundingClientRect();return{x:pe.clientX-_e.left+Na,y:pe.clientY-_e.top+Na}},ln=(pe,Le)=>{if(!O)return;const _e=pe.image;if(!(_e!=null&&_e.url)){ie(null);return}const{x:We,y:tt}=wn(Le),$t=(k==null?void 0:k.min)??80,Ee=(k==null?void 0:k.max)??320,et=(oe==null?void 0:oe.rowId)===pe.id?oe.widthPx:am($t,Ee);ie({rowId:pe.id,url:_e.url,objectFit:"contain",isVideo:Ep(_e),widthPx:et,x:We,y:tt})},ot=pe=>{if(!O||!oe)return;const{x:Le,y:_e}=wn(pe);ie(We=>!We||We.x===Le&&We.y===_e?We:{...We,x:Le,y:_e})},tn=()=>{ie(null)},Ut=pe=>{N&&_a(pe,c),O&&ie(null)},qe=pe=>{N&&Fa(pe,c)};l.useLayoutEffect(()=>{if(!m||f){Re(null);return}const pe=be.current,Le=pe==null?void 0:pe.parentElement;if(!pe||!Le){Re(null);return}const _e=()=>{const tt=pe.querySelector("[data-list-row]");if(!tt){Re(null);return}const $t=Le.getBoundingClientRect(),Ee=tt.getBoundingClientRect();Re(Ee.top-$t.top+Ee.height/2)};_e();const We=new ResizeObserver(_e);return We.observe(pe),We.observe(Le),()=>We.disconnect()},[m,f,It,Ve,Ye,Be,t,e,xe,Ne,Z,v,ee,R,xt]);const yt=l.useMemo(()=>!f&&Zr.some(pe=>{const Le=pe.charAt(0),_e=e[`${pe}VerticalAlign`];return Ys(_e,e,Le)}),[f,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);l.useLayoutEffect(()=>{var et;const pe=de.current;if(!pe)return;const Le=()=>{pe.querySelectorAll("[data-list-col]").forEach(De=>{De.style.transform="";const st=De.querySelector(`.${c}-list-col`);st&&(st.style.minHeight="",st.style.height="");const pt=De.querySelector(`.${c}-list-col-title`);pt&&(pt.style.transform="")})};if(f||!yt){Le();return}const _e=()=>{const De=Array.from(pe.querySelectorAll("[data-list-row]")),st=`${c}-list-col`,pt=`${c}-baseline-probe`;De.forEach(kt=>{kt.querySelectorAll("[data-list-col]").forEach(Ge=>{Ge.style.transform="";const nt=Ge.querySelector(`.${st}`);nt&&(nt.style.minHeight="",nt.style.height="");const Et=Ge.querySelector(`.${c}-list-col-title`);Et&&(Et.style.transform="")})}),De.forEach(kt=>{const Ge=Array.from(kt.querySelectorAll("[data-list-col]"));jp(kt,Ge,st)}),pe.offsetHeight,De.forEach(kt=>{const Ge=Array.from(kt.querySelectorAll("[data-list-col]")),nt=kt.getBoundingClientRect().top,Et=new Map,St=Ge.map(ht=>{const Bt=ht.querySelector(`.${c}-list-col-title`),Wt={el:ht,titleEl:Bt,letter:ht.getAttribute("data-col-letter")??"",kind:ht.getAttribute("data-valign")??"top",anchor:ht.getAttribute("data-valign-anchor")};return Et.set(Wt.letter,Wt),Wt}),_t=new Map,$n=(ht,Bt)=>{const Wt=_t.get(ht.letter);if(Wt!==void 0)return Wt;const cn=ht.anchor?Et.get(ht.anchor):void 0;if(ht.kind!=="baseline"||!cn||Bt.has(ht.letter)){const Xn=ur(ht,nt,st,pt);return _t.set(ht.letter,Xn),Xn}Bt.add(ht.letter);const Sn=$n(cn,Bt);Bt.delete(ht.letter);const dn=ur(ht,nt,st,pt),zt=Sn-dn;zp(ht.titleEl,zt);const Cn=ur(ht,nt,st,pt);return _t.set(ht.letter,Cn),Cn};St.forEach(ht=>$n(ht,new Set))})};let We=null;const tt=()=>{We===null&&(We=requestAnimationFrame(()=>{We=null,_e()}))};_e();const $t=new ResizeObserver(()=>tt());$t.observe(pe);let Ee=!1;return typeof document<"u"&&((et=document.fonts)!=null&&et.ready)&&document.fonts.ready.then(()=>{Ee||tt()}),()=>{Ee=!0,We!==null&&(cancelAnimationFrame(We),We=null),$t.disconnect(),Le()}},[yt,f,e,t,Z,It,Ne]);const vt=l.useMemo(()=>Rp(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:vt}}),r.jsx("div",{style:Ce,children:r.jsxs("div",{ref:de,className:`${c}-wrapper ${Ie}${Ht?` ${Ht}`:""}${f?` ${c}-type-b`:""}`.trim(),style:{width:P.scalingValue(w??0,n),...!f&&m?{[`--${c}-first-entry-handle-top`]:Mt}:{}},onMouseMove:O?ot:void 0,onMouseLeave:O?tn:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[It.map((pe,Le)=>{var $t;const _e=((($t=pe.link)==null?void 0:$t.length)??0)>0,We=_e&&(!n||i)?"a":"div",tt=Wa(Le,It.length,ee,R,xt,v??0,n??!1);return r.jsxs(We,{ref:Le===0?Ee=>{be.current=Ee}:void 0,className:`${c}-list-item${_e||E==="always"?` ${c}-list-item-has-link`:""}`,..._e?{href:pe.link,target:"_blank"}:{},style:tt,onMouseEnter:Ee=>{N&&(_e||E==="always")&&_a(Ee,c),O&&ln(pe,Ee)},onMouseLeave:Ee=>{N&&(_e||E==="always")&&Fa(Ee,c)},children:[Ve>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Me(Ve)}}),r.jsxs("div",{className:`${c}-list-cols-row${f?"":` ${c}-list-cols-row-h`}${m&&Le===0&&f?` ${c}-list-cols-row-controls`:""}`,...f?{}:{"data-list-row":""},style:f?void 0:{minHeight:Me(Be)},children:[xe.map((Ee,et)=>{const De=et===xe.length-1,st=He[et],pt=Ee.paddingBottom,kt=Pp(pe.cells[Ee.key]),Ge=f&&kt&&pt>0,nt=f?{minHeight:Me(Be)}:{width:Me(Ne[et])},Et=f?{paddingLeft:Me(j),paddingRight:Me(j)}:{paddingLeft:Me(st.paddingLeft),paddingRight:Me(st.paddingRight)},St=Ee.textPrefix.charAt(0),_t=f?Fp(e[`${Ee.textPrefix}VerticalAlign`]):_p(e[`${Ee.textPrefix}VerticalAlign`],e,St),$n=f&&kt&&m&&Le===0;return r.jsxs("div",{className:f?`${c}-list-col-wrap`:void 0,...f?{}:{"data-list-col":"","data-col-letter":St,"data-valign":_t.kind,..._t.kind==="baseline"?{"data-valign-anchor":_t.anchorLetter}:{}},children:[r.jsx("div",{className:`${c}-list-col${De?` ${c}-list-col-last`:""}`,style:{...Et,...nt,...f?{justifyContent:Ha(_t.kind)}:{}},"data-test":Ee.width,children:r.jsx("span",{className:Ba(e,Ee.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Oa(Ao(e,Ee.textPrefix),n),...ja(e,Ee.textPrefix,c,n),...f?{}:Np(_t.kind)},children:pe.cells[Ee.key]??null})}),Ge&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Me(pt)}}),$n&&r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Ee.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:Me(Math.max(pt,pr))}})]},Ee.key)}),m&&Le===0&&f&&r.jsxs(r.Fragment,{children:[r.jsx(Ft,{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:Me(he),height:"100%"}}),r.jsx(Ft,{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:Me(Math.max(he,Ke-he)),width:Me(he),height:"100%"}})]})]}),!f&&Ye>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Me(Ye)}}),m&&Le===0&&!f&&r.jsx(Ft,{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:Me(Pt)}})]},pe.id)}),m&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Ot,"data-controls-static-handle":"",...f?{}:{"data-controls-handle-left":"20"},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:f?"center":"left-y",areaStyle:{position:"absolute",top:Qe,left:0,width:"100%",height:Me(Math.max(Ve,pr))}})},"row-padding-handles"),m&&!f&&je&>&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":je.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ne[0]-((it==null?void 0:it.paddingRight)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:Me(rt),height:"100%"}}),r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":gt.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(Ne[xe.length-1]-((Ze==null?void 0:Ze.paddingLeft)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Me(sn-at),width:Me(at),height:"100%"}})]},"column-edge-padding-handles"),m&&!f&&xe.slice(0,-1).map((pe,Le)=>{const _e=xe[Le+1],We=Ae.slice(0,Le+1).reduce((De,st)=>De+st,0),tt=He[Le],$t=He[Le+1],Ee=Math.max(tt.paddingRight,oi),et=Math.max($t.paddingLeft,oi);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":pe.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(Ne[Le]-tt.paddingLeft),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Me(We-Ee),width:Me(Ee),height:"100%"}}),r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":_e.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ne[Le+1]-$t.paddingRight),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Me(We),width:Me(et),height:"100%"}})]},`${pe.paddingRightKey}-padding`)}),m&&!f&&xe.slice(0,-1).map((pe,Le)=>{const _e=rm(Le,Ae,se,Ke),tt=Ae.slice(0,Le+1).reduce(($t,Ee)=>$t+Ee,0)-za/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":pe.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(ea),"data-controls-max-fraction":String(_e),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Me(tt),width:Me(za),height:"calc(100%)",pointerEvents:"auto"}})},`${pe.widthKey}-junction`)})]}),xt&&(()=>{const pe=Ao(e,yn),Le=Hp(e.cutLabelVerticalAlign),_e=pe.textTextAlign==="justify"||f;return r.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Me(L??0),cursor:Lt?"pointer":"default",...kp(R,v??0,n??!1)},onClick:Lt?Xe:void 0,onMouseEnter:N||O?Ut:void 0,onMouseLeave:N?qe:void 0,children:r.jsx("div",{className:`${c}-list-cols-row`,style:{...f?{paddingLeft:Me(j),paddingRight:Me(j)}:{},justifyContent:Op(pe.textTextAlign),alignItems:Ha(Le)},children:r.jsx("span",{className:Ba(e,yn,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Oa(pe,n),...ja(e,yn,c,n),..._e?{width:"100%"}:{}},children:A})})})})(),O&&oe&&(()=>{const pe=So(oe.widthPx),Le={width:pe,height:"auto",maxHeight:pe,objectFit:"contain",left:oe.x,top:oe.y,position:"absolute"};return r.jsx(Ip,{media:oe,className:oe.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Le},`${oe.rowId}-${oe.url}`)})()]})})]})}const dm=`import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
6281
|
+
`}const Mn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Jr=["AColumn","BColumn","CColumn","DColumn","EColumn"],yn="cutLabel",Wi=[...Jr,yn],qo=["A","B","C","D","E"];function Ks(e){return`${e}ColumnVerticalAlign`}const Lr=["Top","Center","Bottom"];function Zr(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return qo.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function _p(e){const t=Zr(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Fp(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return qo.includes(n)?n:null}function Gs(e,t,n){const i=Fp(e);return i?i===t?!1:_p(n[Ks(i)]):!0}function Ni(e){const t=Zr(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return qo.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function Wp(e,t,n){if(Us(e,t,n))return Ni(e);const i=Ni(e);return i.kind==="baseline"?{kind:"top"}:i}function Np(e){const t=Ni(e);return t.kind==="baseline"?{kind:"top"}:t}function Us(e,t,n){return Gs(e,n,t)?Ni(e).kind==="baseline":!1}function Hp(e){const t={};let n=!1;for(const i of qo){const o=Ks(i),s=e[o];if(e.type==="b"){const a=String(s??"Top").trim();a!=="Top"&&a!=="Center"&&a!=="Bottom"&&(t[o]="Top",n=!0);continue}Gs(s,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Op(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Bp(e){const t=Ni(e).kind;return t==="baseline"?"center":t}function jp(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Ha(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function zp(e,t){const n=document.createElement("i");n.className=t,n.setAttribute("aria-hidden","true"),e.prepend(n);const{top:i}=e.getBoundingClientRect(),{bottom:o}=n.getBoundingClientRect(),s=o-i;return n.remove(),s}function dr(e,t,n,i){const o=e.titleEl;if(!o)return 0;const s=o.closest(`.${n}`);if(!s)return 0;const a=zp(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+a;const u=s.getBoundingClientRect(),c=o.getBoundingClientRect().height;let m=0;return e.kind==="center"?m=(u.height-c)/2:e.kind==="bottom"&&(m=u.height-c),u.top-t+m+a}function Vp(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const s=o.querySelector(`.${n}`);s&&(s.style.minHeight=`${i}px`,s.style.height=`${i}px`)}),i)}function Dp(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const qp={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Xe(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Kp={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function Gp(e){return[Xe(e,"textFontFamily"),Xe(e,"textFontSettings"),{type:"row",items:[Xe(e,"textFontSize"),Xe(e,"textLineHeight"),Xe(e,"textLetterSpacing"),Xe(e,"textWordSpacing")]},Xe(e,"textTextAlign"),Xe(e,"textTextAppearance"),`${e}VerticalAlign`]}function Up(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Wi.map(e=>[Kp[e],Gp(e)]))}}function Mo(e,t){const n=i=>{const o=Xe(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===yn?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Oa(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 qt(At(n,t))}function Ba(e,t,n,i){const o=Mo(e,t),s=o.textFontSize??.01,a=o.textLineHeight;return a!==void 0&&a<s?`${n} ${i}`:n}function ja(e,t,n,i){const o=Mo(e,t),s=o.textFontSize??.01,a=o.textLineHeight;return a===void 0||a>=s?{}:{[`--${n}-title-leading-gap`]:I.scalingValue((s-a)/2,i)}}const Kt=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],pi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],mi=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],gi=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Xp={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Yp=["hover","focus","filled","success","error"],za=.004,oi=.004,ur=oi,Qr=50,Hi=1440,Oi=Qr/Hi;function Xs(e){const t=typeof e=="number"&&e>0?e:Hi;return Qr/t}function Jp(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 Hi}const Ys={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function Ei(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Zp(e,t=1){const n=t/e;return Object.fromEntries(Kt.map(i=>[i,n]))}function Qp(){return Object.fromEntries([...pi.map(e=>[e,0]),...mi.map(e=>[e,0])])}function em(){return Object.fromEntries(gi.map(e=>[e,0]))}function so(e){return Object.fromEntries(Kt.map(t=>[t,typeof e[t]=="number"?e[t]:Ys[t]]))}function Js(e,t,n){const i=e-Oi,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const s=i/o;return{paddingLeft:t*s,paddingRight:n*s}}function So(e,t,n){const i=ea(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((s,a)=>s+a,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function tm(e,t,n){const i={};for(let o=0;o<e;o+=1){const s=pi[o],a=mi[o],u=typeof n[s]=="number"?n[s]:0,c=typeof n[a]=="number"?n[a]:0,m=Js(t[o]??0,u,c);m.paddingLeft!==u&&(i[s]=m.paddingLeft),m.paddingRight!==c&&(i[a]=m.paddingRight)}return i}function ea(e,t,n){if(e<=0)return[];const i=Kt.slice(0,e).map(m=>n[m]);if(e===1)return i;const o=i.slice(0,e-1),a=o.reduce((m,p)=>m+p,0)+Oi;if(t>=a)return i;const u=[...o];let c=a-t;for(let m=u.length-1;m>=0&&c>0;m-=1){const p=u[m]-Oi;if(p<=0)continue;const P=Math.min(c,p);u[m]-=P,c-=P}return[...u,i[e-1]]}function nm(e,t,n){if(e<=1)return{};const i=ea(e,t,n),o={};for(let s=0;s<e-1;s+=1){const a=Kt[s];i[s]!==n[a]&&(o[a]=i[s])}return o}function Va(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Mn]}function im(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function om(e,t,n,i){const o=Math.min(i,e.length,Kt.length),s={};for(let a=0;a<o;a+=1){const u=e[a],c=t.indexOf(u);if(c===-1)continue;const m=Kt[c],p=pi[c],P=mi[c],x=gi[c],$=Kt[a],g=pi[a],y=mi[a],C=gi[a],w=n[m],E=n[p],T=n[P],F=n[x];typeof w=="number"&&(s[$]=w),typeof E=="number"&&(s[g]=E),typeof T=="number"&&(s[y]=T),typeof F=="number"&&(s[C]=F)}return s}function Zs(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 rm(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=Ei(e),s=e.type==="b"||e.type===void 0&&t.type==="b",a={...e,...Zp(n,o),...Qp()};if(s)for(const u of gi)typeof t[u]=="number"&&(a[u]=t[u]);else Object.assign(a,em());return Zs(e,a)?a:e}function am(e,t,n){const i=Hp(e);i&&(e={...e,...i});const o=Xs(n==null?void 0:n.designWidth),s=e.columns,a=t.columns,u=Ei(e),c=Ei(t),m=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof s=="number"?s:typeof a=="number"?a:Mn.length,P=T=>{if(m)return T;const F=so({...t,...T}),M=Ei(T),W=So(p,M,F),_=tm(p,W,{...t,...T});return Object.keys(_).length===0?T:{...T,..._}};if(typeof s=="number"&&s!==a)return e;const x=Va(e),$=Va(t);if(!im(x,$))return P({...e,...om(x,$,t,p)});if(u<c&&typeof p=="number"&&!m){const T=so({...t,...e});return P({...e,...nm(p,u,T)})}if(m){const T=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,F=Math.max(0,(u-o)/2);return T>F?{...e,textPaddingLR:F}:e}const g=so({...t,...e}),y=So(p,c,so(t)),w=So(p,u,g).some((T,F)=>T<(y[F]??T)),E=Kt.some(T=>{const F=e[T],M=t[T];return typeof F=="number"&&typeof M=="number"&&F!==M});return w||E?P(e):e}function sm(e,t,n,i){const o=t.slice(0,e).reduce((a,u)=>a+u,0),s=n.slice(e+1,t.length-1).reduce((a,u)=>a+u,0);return Math.max(Oi,i-o-s-Oi)}function lm(e,t){return Math.random()*(t-e)+e}function cm(e){return Object.fromEntries(Kt.map(t=>[t,typeof e[t]=="number"?e[t]:Ys[t]]))}function pr(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function dm(e,t,n,i,o,s){return e.slice(0,t).map((a,u)=>{const c=pi[u],m=mi[u],p=gi[u];return{key:a,textPrefix:qp[a],widthKey:Kt[u],width:n[Kt[u]],paddingLeftKey:c,paddingRightKey:m,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[m],paddingBottom:s[p]}})}function um({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s,layoutId:a,onUpdateSettings:u}){const{prefix:c}=I.useScopedStyles(),m=!!o,{columns:p,type:P,wrapperWidth:x,entriesCount:$,cellMinHeight:g,dividerWidth:y,showVisibility:C,cut:w,showCut:E,cutCellMinHeight:T,cutLabel:F,imageSize:M,imageOnHover:W,entryHoverEffect:_,entryHoverShowOption:L,rowPaddingTop:U,rowPaddingBottom:v,rowPaddingTopB:R,columnsOrder:N,textPaddingLR:D,textColor:ne,backgroundColor:pe,dividerColor:K,textHoverColor:B,backgroundHoverColor:Z,dividerHoverColor:q}=e,[O,Y]=l.useState(void 0),[ae,oe]=l.useState(null),H=W==="on"&&(!n||i),ue=(w??0)>0,f=P==="b",me=l.useRef(null),fe=l.useRef(null),[ye,Me]=l.useState(null),[ee,ge]=l.useState(Hi),X=Xs(ee),be=Math.max(0,((x??0)-X)/2),te=Math.min(D??0,be),ie=Math.max(te,oi),J=((x??0)+X)/2;l.useLayoutEffect(()=>{if(!n){ge(Hi);return}const ce=()=>{ge(Jp(me.current))};ce();const Ce=me.current;if(!Ce)return;const ke=new ResizeObserver(ce);ke.observe(Ce);let We=Ce;for(;We&&!We.style.getPropertyValue("--cntrl-article-width");)We=We.parentElement;return We&&ke.observe(We),()=>ke.disconnect()},[n,a]),l.useEffect(()=>{Y(void 0)},[w,E,t,$]),l.useEffect(()=>{n&&!i&&Y(void 0)},[n,i]);const xe=I.buildColorVars(c,{textColor:ne,backgroundColor:pe,dividerColor:K,textHoverColor:B,backgroundHoverColor:Z,dividerHoverColor:q},Xp,Yp),Se=s&&s!=="default"?`${c}-state-${s}`:"",Ee=`${!n||i?_==="default"?`${c}-entry-hover-default`:_==="blinds"?`${c}-entry-hover-blinds`:_==="reveal"?`${c}-entry-hover-reveal`:"":""} ${Se}`.trim(),A=_==="reveal"&&(!n||i),G=(C==null?void 0:C[0])??!1,S=(C==null?void 0:C[1])??!1,j=l.useRef(e),z=l.useRef(a);l.useEffect(()=>{if(!u||!n){j.current=e,z.current=a;return}if(z.current!==a){j.current=e,z.current=a;return}const ce=j.current;if(!(ce!==e))return;if(typeof ce.columns=="number"&&typeof e.columns=="number"&&ce.columns!==e.columns){j.current=e;return}const ke=am(e,ce,{designWidth:ee});j.current=e,Zs(e,ke)&&u(ke)},[e,u,n,a,ee]);const Q=l.useMemo(()=>cm(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),se=l.useMemo(()=>pr(e,pi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),Te=l.useMemo(()=>pr(e,mi),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Fe=l.useMemo(()=>pr(e,gi),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),Ie=l.useMemo(()=>Array.isArray(N)&&N.length>0?N:[...Mn],[N]),$e=l.useMemo(()=>dm(Ie,p,Q,se,Te,Fe),[Ie,p,Q,se,Te,Fe]),tt=Ei(e),le=l.useMemo(()=>Kt.slice(0,p).map(ce=>Q[ce]),[p,Q]),Ae=l.useMemo(()=>ea(p,tt,Q),[p,tt,Q]),ze=l.useMemo(()=>So(p,tt,Q),[p,tt,Q]),Ve=l.useMemo(()=>$e.map((ce,Ce)=>Js(ze[Ce]??0,ce.paddingLeft,ce.paddingRight)),[$e,ze]),dt=l.useMemo(()=>{const ce=$===0?1/0:$;return(t??[]).slice(0,ce).map((ke,We)=>({id:We,cells:Object.fromEntries(Mn.map(et=>[et,ke[et]??""])),image:ke.image,link:ke.link}))},[t,$]),ft=ue?O??w:dt.length,Pt=l.useMemo(()=>ue?dt.slice(0,ft):dt,[dt,ue,ft]),xt=ue&&ft<dt.length,wt=Pt.length>1||xt,Ht=[G?`${c}-divider-top`:"",S||wt?`${c}-divider-bottom`:""].filter(Boolean).join(" "),Lt=!n||i,Ge=()=>{if(!Lt)return;const ce=O??w;if(!E){Y(dt.length);return}Y(Math.min(ce+E,dt.length))},Re=ce=>I.scalingValue(ce,n??!1),Be=f?R??0:U??0,Ue=v??0,He=g??0,ut=Be+He/2,It=Math.max(Ue,ur),Ze=Wa(0,Pt.length,G,S,xt,y??0,n??!1).borderTopWidth,kt=ye!=null?`${ye}px`:`calc(${Ze} + ${Re(ut)})`,Ot=f?"rowPaddingTopB":"rowPaddingTop",Oe=$e[0],gt=$e[$e.length-1],it=Ve[0],Ye=Ve[Ve.length-1],rt=Oe&&it?Math.max(it.paddingLeft,oi):0,at=gt&&Ye?Math.max(Ye.paddingRight,oi):0,sn=tt,wn=ce=>{const Ce=me.current;if(!Ce)return{x:0,y:0};const ke=Ce.getBoundingClientRect();return{x:ce.clientX-ke.left+Na,y:ce.clientY-ke.top+Na}},ln=(ce,Ce)=>{if(!H)return;const ke=ce.image;if(!(ke!=null&&ke.url)){oe(null);return}const{x:We,y:et}=wn(Ce),$t=(M==null?void 0:M.min)??80,Le=(M==null?void 0:M.max)??320,Qe=(ae==null?void 0:ae.rowId)===ce.id?ae.widthPx:lm($t,Le);oe({rowId:ce.id,url:ke.url,objectFit:"contain",isVideo:Ip(ke),widthPx:Qe,x:We,y:et})},ot=ce=>{if(!H||!ae)return;const{x:Ce,y:ke}=wn(ce);oe(We=>!We||We.x===Ce&&We.y===ke?We:{...We,x:Ce,y:ke})},tn=()=>{oe(null)},Ut=ce=>{A&&_a(ce,c),H&&oe(null)},De=ce=>{A&&Fa(ce,c)};l.useLayoutEffect(()=>{if(!m||f){Me(null);return}const ce=fe.current,Ce=ce==null?void 0:ce.parentElement;if(!ce||!Ce){Me(null);return}const ke=()=>{const et=ce.querySelector("[data-list-row]");if(!et){Me(null);return}const $t=Ce.getBoundingClientRect(),Le=et.getBoundingClientRect();Me(Le.top-$t.top+Le.height/2)};ke();const We=new ResizeObserver(ke);return We.observe(ce),We.observe(Ce),()=>We.disconnect()},[m,f,Pt,Be,Ue,He,t,e,$e,ze,ee,y,G,S,xt]);const yt=l.useMemo(()=>!f&&Jr.some(ce=>{const Ce=ce.charAt(0),ke=e[`${ce}VerticalAlign`];return Us(ke,e,Ce)}),[f,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);l.useLayoutEffect(()=>{var Qe;const ce=me.current;if(!ce)return;const Ce=()=>{ce.querySelectorAll("[data-list-col]").forEach(je=>{je.style.transform="";const st=je.querySelector(`.${c}-list-col`);st&&(st.style.minHeight="",st.style.height="");const pt=je.querySelector(`.${c}-list-col-title`);pt&&(pt.style.transform="")})};if(f||!yt){Ce();return}const ke=()=>{const je=Array.from(ce.querySelectorAll("[data-list-row]")),st=`${c}-list-col`,pt=`${c}-baseline-probe`;je.forEach(Rt=>{Rt.querySelectorAll("[data-list-col]").forEach(qe=>{qe.style.transform="";const nt=qe.querySelector(`.${st}`);nt&&(nt.style.minHeight="",nt.style.height="");const Et=qe.querySelector(`.${c}-list-col-title`);Et&&(Et.style.transform="")})}),je.forEach(Rt=>{const qe=Array.from(Rt.querySelectorAll("[data-list-col]"));Vp(Rt,qe,st)}),ce.offsetHeight,je.forEach(Rt=>{const qe=Array.from(Rt.querySelectorAll("[data-list-col]")),nt=Rt.getBoundingClientRect().top,Et=new Map,St=qe.map(ht=>{const Bt=ht.querySelector(`.${c}-list-col-title`),Wt={el:ht,titleEl:Bt,letter:ht.getAttribute("data-col-letter")??"",kind:ht.getAttribute("data-valign")??"top",anchor:ht.getAttribute("data-valign-anchor")};return Et.set(Wt.letter,Wt),Wt}),_t=new Map,$n=(ht,Bt)=>{const Wt=_t.get(ht.letter);if(Wt!==void 0)return Wt;const cn=ht.anchor?Et.get(ht.anchor):void 0;if(ht.kind!=="baseline"||!cn||Bt.has(ht.letter)){const Xn=dr(ht,nt,st,pt);return _t.set(ht.letter,Xn),Xn}Bt.add(ht.letter);const Sn=$n(cn,Bt);Bt.delete(ht.letter);const dn=dr(ht,nt,st,pt),zt=Sn-dn;Dp(ht.titleEl,zt);const Cn=dr(ht,nt,st,pt);return _t.set(ht.letter,Cn),Cn};St.forEach(ht=>$n(ht,new Set))})};let We=null;const et=()=>{We===null&&(We=requestAnimationFrame(()=>{We=null,ke()}))};ke();const $t=new ResizeObserver(()=>et());$t.observe(ce);let Le=!1;return typeof document<"u"&&((Qe=document.fonts)!=null&&Qe.ready)&&document.fonts.ready.then(()=>{Le||et()}),()=>{Le=!0,We!==null&&(cancelAnimationFrame(We),We=null),$t.disconnect(),Ce()}},[yt,f,e,t,ee,Pt,ze]);const vt=l.useMemo(()=>kp(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:vt}}),r.jsx("div",{style:xe,children:r.jsxs("div",{ref:me,className:`${c}-wrapper ${Ee}${Ht?` ${Ht}`:""}${f?` ${c}-type-b`:""}`.trim(),style:{width:I.scalingValue(x??0,n),...!f&&m?{[`--${c}-first-entry-handle-top`]:kt}:{}},onMouseMove:H?ot:void 0,onMouseLeave:H?tn:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[Pt.map((ce,Ce)=>{var $t;const ke=((($t=ce.link)==null?void 0:$t.length)??0)>0,We=ke&&(!n||i)?"a":"div",et=Wa(Ce,Pt.length,G,S,xt,y??0,n??!1);return r.jsxs(We,{ref:Ce===0?Le=>{fe.current=Le}:void 0,className:`${c}-list-item${ke||L==="always"?` ${c}-list-item-has-link`:""}`,...ke?{href:ce.link,target:"_blank"}:{},style:et,onMouseEnter:Le=>{A&&(ke||L==="always")&&_a(Le,c),H&&ln(ce,Le)},onMouseLeave:Le=>{A&&(ke||L==="always")&&Fa(Le,c)},children:[Be>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Re(Be)}}),r.jsxs("div",{className:`${c}-list-cols-row${f?"":` ${c}-list-cols-row-h`}${m&&Ce===0&&f?` ${c}-list-cols-row-controls`:""}`,...f?{}:{"data-list-row":""},style:f?void 0:{minHeight:Re(He)},children:[$e.map((Le,Qe)=>{const je=Qe===$e.length-1,st=Ve[Qe],pt=Le.paddingBottom,Rt=Mp(ce.cells[Le.key]),qe=f&&Rt&&pt>0,nt=f?{minHeight:Re(He)}:{width:Re(ze[Qe])},Et=f?{paddingLeft:Re(te),paddingRight:Re(te)}:{paddingLeft:Re(st.paddingLeft),paddingRight:Re(st.paddingRight)},St=Le.textPrefix.charAt(0),_t=f?Np(e[`${Le.textPrefix}VerticalAlign`]):Wp(e[`${Le.textPrefix}VerticalAlign`],e,St),$n=f&&Rt&&m&&Ce===0;return r.jsxs("div",{className:f?`${c}-list-col-wrap`:void 0,...f?{}:{"data-list-col":"","data-col-letter":St,"data-valign":_t.kind,..._t.kind==="baseline"?{"data-valign-anchor":_t.anchorLetter}:{}},children:[r.jsx("div",{className:`${c}-list-col${je?` ${c}-list-col-last`:""}`,style:{...Et,...nt,...f?{justifyContent:Ha(_t.kind)}:{}},"data-test":Le.width,children:r.jsx("span",{className:Ba(e,Le.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Oa(Mo(e,Le.textPrefix),n),...ja(e,Le.textPrefix,c,n),...f?{}:Op(_t.kind)},children:ce.cells[Le.key]??null})}),qe&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Re(pt)}}),$n&&r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Le.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:Re(Math.max(pt,ur))}})]},Le.key)}),m&&Ce===0&&f&&r.jsxs(r.Fragment,{children:[r.jsx(Ft,{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(J),className:`${c}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:Re(ie),height:"100%"}}),r.jsx(Ft,{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(J),className:`${c}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:Re(Math.max(ie,tt-ie)),width:Re(ie),height:"100%"}})]})]}),!f&&Ue>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Re(Ue)}}),m&&Ce===0&&!f&&r.jsx(Ft,{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:Re(It)}})]},ce.id)}),m&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Ot,"data-controls-static-handle":"",...f?{}:{"data-controls-handle-left":"20"},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:f?"center":"left-y",areaStyle:{position:"absolute",top:Ze,left:0,width:"100%",height:Re(Math.max(Be,ur))}})},"row-padding-handles"),m&&!f&&Oe&>&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Oe.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(ze[0]-((it==null?void 0:it.paddingRight)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:Re(rt),height:"100%"}}),r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":gt.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(ze[$e.length-1]-((Ye==null?void 0:Ye.paddingLeft)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Re(sn-at),width:Re(at),height:"100%"}})]},"column-edge-padding-handles"),m&&!f&&$e.slice(0,-1).map((ce,Ce)=>{const ke=$e[Ce+1],We=Ae.slice(0,Ce+1).reduce((je,st)=>je+st,0),et=Ve[Ce],$t=Ve[Ce+1],Le=Math.max(et.paddingRight,oi),Qe=Math.max($t.paddingLeft,oi);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":ce.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(ze[Ce]-et.paddingLeft),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Re(We-Le),width:Re(Le),height:"100%"}}),r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":ke.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(ze[Ce+1]-$t.paddingRight),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Re(We),width:Re(Qe),height:"100%"}})]},`${ce.paddingRightKey}-padding`)}),m&&!f&&$e.slice(0,-1).map((ce,Ce)=>{const ke=sm(Ce,Ae,le,tt),et=Ae.slice(0,Ce+1).reduce(($t,Le)=>$t+Le,0)-za/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":ce.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(Qr),"data-controls-max-fraction":String(ke),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Re(et),width:Re(za),height:"calc(100%)",pointerEvents:"auto"}})},`${ce.widthKey}-junction`)})]}),xt&&(()=>{const ce=Mo(e,yn),Ce=Bp(e.cutLabelVerticalAlign),ke=ce.textTextAlign==="justify"||f;return r.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Re(T??0),cursor:Lt?"pointer":"default",...Ap(S,y??0,n??!1)},onClick:Lt?Ge:void 0,onMouseEnter:A||H?Ut:void 0,onMouseLeave:A?De:void 0,children:r.jsx("div",{className:`${c}-list-cols-row`,style:{...f?{paddingLeft:Re(te),paddingRight:Re(te)}:{},justifyContent:jp(ce.textTextAlign),alignItems:Ha(Ce)},children:r.jsx("span",{className:Ba(e,yn,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Oa(ce,n),...ja(e,yn,c,n),...ke?{width:"100%"}:{}},children:F})})})})(),H&&ae&&(()=>{const ce=$o(ae.widthPx),Ce={width:ce,height:"auto",maxHeight:ce,objectFit:"contain",left:ae.x,top:ae.y,position:"absolute"};return r.jsx(Rp,{media:ae,className:ae.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Ce},`${ae.rowId}-${ae.url}`)})()]})})]})}const pm=`import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
6204
6282
|
import { CommonComponentProps } from '../props';
|
|
6205
6283
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
6206
6284
|
import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
|
|
@@ -9157,7 +9235,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
9157
9235
|
</>
|
|
9158
9236
|
);
|
|
9159
9237
|
}
|
|
9160
|
-
`,wi=["A","B","C","D","E"],Da=[...Er,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],Bn={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 um(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function co(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function pm(){return Object.fromEntries(wi.map((e,t)=>{const n=Rn[t],i=`${e} column`;return[n,um(i)]}))}function mm(){const e={};for(const t of wi)e[`${t}ColumnWidth`]=co(`${t} column width`),e[`${t}ColumnPaddingLeft`]=co(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=co(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=co(`${t} column padding bottom`);return e}function qa(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Rn]};for(const s of wi)i[`${s}ColumnWidth`]=s==="A"?.0798:.32,i[`${s}ColumnPaddingLeft`]=0,i[`${s}ColumnPaddingRight`]=0,i[`${s}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function gm(e){const t={};if(e===yn)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Er]},enum:[...Er]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Da],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Da]}}return t[Je(e,"textFontFamily")]={type:"string",scope:"layout",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Je(e,"textFontSettings")]={...Bn.fontSettings,scope:"layout",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Je(e,"textFontSize")]={...Bn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Je(e,"textLineHeight")]={...Bn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Je(e,"textLetterSpacing")]={...Bn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Je(e,"textWordSpacing")]={...Bn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Je(e,"textTextAlign")]={...Bn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Je(e,"textTextAppearance")]={...Bn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const hm=Ni.reduce((e,t)=>({...e,...gm(t)}),{});function fm(e){return{verticalAlign:e===yn?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===yn?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function ym(e,t={}){var n;return{...fm(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Ka=new Set(["textFontFamily","textFontSettings"]);function vm(e,t,n){const i=s=>n===void 0?!0:n==="common"?Ka.has(s):!Ka.has(s),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=Qr(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Je(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Je(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Je(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Je(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Je(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Je(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Je(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Je(e,"textTextAppearance")]=t.textTextAppearance),o}function To(e={},t){return Ni.reduce((n,i)=>({...n,...vm(i,ym(i,e),t)}),{})}const bm=To(),xm=Kp();function tl(e){return[Je(e,"textFontFamily"),Je(e,"textFontSettings"),Je(e,"textFontSize"),Je(e,"textLineHeight"),Je(e,"textLetterSpacing"),Je(e,"textWordSpacing"),Je(e,"textTextAlign"),Je(e,"textTextAppearance"),`${e}VerticalAlign`]}function wm(){const e=[];return Zr.forEach((t,n)=>{const i=Rn[n],o=tl(t);for(let s=1;s<Rn.length;s+=1){const a=[{name:"columns",value:s},...Array.from({length:s},(u,c)=>({name:`columnsOrder.${c}`,value:i,isNotEqual:!0}))];o.forEach(u=>{e.push({if:a,then:{name:`properties.${u}.display.visible`,value:!1}})})}}),e}const $m=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];tl(yn);const Sm=[...wi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],jn=[{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"}],Cm=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:jn[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:jn[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:jn[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:jn[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:jn[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:jn[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:jn[6],link:""}],Tm=[...wi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],Lm={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:{...pm(),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:Cm},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"}},...mm(),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"}},...hm,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",...bm,...To({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:qa({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},...To({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:qa({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},...To({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...wm(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...Sm.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}},...wi.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",...Tm]},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__",xm]}],paletteBookmark:{items:[...$m],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Em={element:cm,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>im(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:[...Ni.map(e=>({path:`${Je(e,"textFontFamily")}`}))]},fontRelations:{...Ni.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Je(t,"textFontFamily")}`}),{})},schema:Lm,sourceCode:dm},Ga=300,Ln=.004,Im={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"},Pm=["hover","focus","filled","success","error"];function km(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ua(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Xa(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:P.scalingValue((o-t)/2,i)}}function Rm(e){return`
|
|
9238
|
+
`,wi=["A","B","C","D","E"],Da=[...Lr,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],Bn={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 mm(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function lo(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function gm(){return Object.fromEntries(wi.map((e,t)=>{const n=Mn[t],i=`${e} column`;return[n,mm(i)]}))}function hm(){const e={};for(const t of wi)e[`${t}ColumnWidth`]=lo(`${t} column width`),e[`${t}ColumnPaddingLeft`]=lo(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=lo(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=lo(`${t} column padding bottom`);return e}function qa(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Mn]};for(const s of wi)i[`${s}ColumnWidth`]=s==="A"?.0798:.32,i[`${s}ColumnPaddingLeft`]=0,i[`${s}ColumnPaddingRight`]=0,i[`${s}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function fm(e){const t={};if(e===yn)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Lr]},enum:[...Lr]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Da],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Da]}}return t[Xe(e,"textFontFamily")]={type:"string",scope:"layout",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Xe(e,"textFontSettings")]={...Bn.fontSettings,scope:"layout",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Xe(e,"textFontSize")]={...Bn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Xe(e,"textLineHeight")]={...Bn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Xe(e,"textLetterSpacing")]={...Bn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Xe(e,"textWordSpacing")]={...Bn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Xe(e,"textTextAlign")]={...Bn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Xe(e,"textTextAppearance")]={...Bn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const ym=Wi.reduce((e,t)=>({...e,...fm(t)}),{});function vm(e){return{verticalAlign:e===yn?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===yn?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function bm(e,t={}){var n;return{...vm(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Ka=new Set(["textFontFamily","textFontSettings"]);function xm(e,t,n){const i=s=>n===void 0?!0:n==="common"?Ka.has(s):!Ka.has(s),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=Zr(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Xe(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Xe(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Xe(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Xe(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Xe(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Xe(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Xe(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Xe(e,"textTextAppearance")]=t.textTextAppearance),o}function Co(e={},t){return Wi.reduce((n,i)=>({...n,...xm(i,bm(i,e),t)}),{})}const wm=Co(),$m=Up();function Qs(e){return[Xe(e,"textFontFamily"),Xe(e,"textFontSettings"),Xe(e,"textFontSize"),Xe(e,"textLineHeight"),Xe(e,"textLetterSpacing"),Xe(e,"textWordSpacing"),Xe(e,"textTextAlign"),Xe(e,"textTextAppearance"),`${e}VerticalAlign`]}function Sm(){const e=[];return Jr.forEach((t,n)=>{const i=Mn[n],o=Qs(t);for(let s=1;s<Mn.length;s+=1){const a=[{name:"columns",value:s},...Array.from({length:s},(u,c)=>({name:`columnsOrder.${c}`,value:i,isNotEqual:!0}))];o.forEach(u=>{e.push({if:a,then:{name:`properties.${u}.display.visible`,value:!1}})})}}),e}const Cm=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Qs(yn);const Tm=[...wi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],jn=[{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"}],Lm=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:jn[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:jn[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:jn[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:jn[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:jn[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:jn[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:jn[6],link:""}],Em=[...wi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],Pm={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:{...gm(),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:Lm},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"}},...hm(),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"}},...ym,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",...wm,...Co({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:qa({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},...Co({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:qa({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},...Co({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...Sm(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...Tm.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}},...wi.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",...Em]},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__",$m]}],paletteBookmark:{items:[...Cm],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Im={element:um,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>rm(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:[...Wi.map(e=>({path:`${Xe(e,"textFontFamily")}`}))]},fontRelations:{...Wi.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Xe(t,"textFontFamily")}`}),{})},schema:Pm,sourceCode:pm},Ga=300,Ln=.004,Rm={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"},Mm=["hover","focus","filled","success","error"];function Am(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ua(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Xa(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:I.scalingValue((o-t)/2,i)}}function km(e){return`
|
|
9161
9239
|
.${e}-wrapper {
|
|
9162
9240
|
box-sizing: border-box;
|
|
9163
9241
|
display: flex;
|
|
@@ -9219,7 +9297,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
9219
9297
|
display: flex;
|
|
9220
9298
|
align-items: center;
|
|
9221
9299
|
justify-content: space-between;
|
|
9222
|
-
gap: ${
|
|
9300
|
+
gap: ${Am(20)};
|
|
9223
9301
|
width: 100%;
|
|
9224
9302
|
min-width: 0;
|
|
9225
9303
|
min-height: var(--${e}-question-min-height, unset);
|
|
@@ -9350,7 +9428,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
9350
9428
|
left: 20px;
|
|
9351
9429
|
transform: translateY(-50%);
|
|
9352
9430
|
}
|
|
9353
|
-
`}function Ya(e,t,n,i,o,s,a,u){return{fontSettings:{fontFamily:e,fontWeight:(t==null?void 0:t.fontWeight)??400,fontStyle:(t==null?void 0:t.fontStyle)??"normal"},fontSize:n??.01,lineHeight:i,letterSpacing:o??0,wordSpacing:s??0,textAppearance:a,color:u??"#000000"}}function
|
|
9431
|
+
`}function Ya(e,t,n,i,o,s,a,u){return{fontSettings:{fontFamily:e,fontWeight:(t==null?void 0:t.fontWeight)??400,fontStyle:(t==null?void 0:t.fontStyle)??"normal"},fontSize:n??.01,lineHeight:i,letterSpacing:o??0,wordSpacing:s??0,textAppearance:a,color:u??"#000000"}}function _m({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s}){const{prefix:a}=I.useScopedStyles(),u=o??!1,{wrapperWidth:c=1,cellMinHeight:m=0,dividerWidth:p=694e-6,dividerStyle:P="solid",entryHoverEffect:x="default",autoclose:$="off",icon:g,iconMaxWidth:y=.00833,iconPaddingRight:C=0,iconAnimation:w="rotate 45",questionColor:E="#000000",answerColor:T="#000000",dividerColor:F="#0000001F",iconColor:M="#000000",questionHoverColor:W="#666666",iconHoverColor:_="#666666",iconActiveColor:L="#000000",dividerHoverColor:U="#000000",questionFontFamily:v,questionFontSettings:R,questionFontSize:N,questionLineHeight:D,questionLetterSpacing:ne,questionWordSpacing:pe,questionTextAppearance:K,answerFontFamily:B,answerFontSettings:Z,answerFontSize:q,answerLineHeight:O,answerLetterSpacing:Y,answerWordSpacing:ae,answerTextAppearance:oe,questionPaddingLeft:H=0,questionPaddingTop:ue=0,questionPaddingBottom:f=0,answerPaddingLeft:me=0,answerPaddingRight:fe=0,answerPaddingTop:ye=0,answerPaddingBottom:Me=0}=e,ee=t??[],[ge,X]=l.useState(()=>new Set),be=!n||i;l.useEffect(()=>{X(new Set)},[$]),l.useEffect(()=>{n&&!o&&!i&&X(new Set)},[n,o,i]);const te=Re=>I.scalingValue(Re,n??!1),ie=Math.max(H,Ln),J=Math.max(ue,Ln),xe=Math.max(f,Ln),Se=Math.max(me,Ln),ve=Math.max(fe,Ln),Ee=Math.max(ye,Ln),A=Math.max(Me,Ln),G=Math.max(0,(c??1)-C-y),S=Math.max(0,(c??1)-fe),j=Math.max(0,(c??1)-me),z=Math.max(C,Ln),Q=Math.max(0,(c??1)-H-y),se=l.useMemo(()=>ge.size===0?0:Math.min(...ge),[ge]),Te=l.useCallback(Re=>ge.has(Re),[ge]),Fe=be&&x==="default"?`${a}-entry-hover-default`:"",Ie=g??"",$e=Ie!=="",tt=w.replace(/^rotate /,""),le=`${a}-icon-anim-${tt}`,Ae=qt(At(Ya(v,R,N,D,ne,pe,K,E),n)),ze=qt(At(Ya(B,Z,q,O,Y,ae,oe,T),n)),Ve=Ua(N,D,`${a}-question`,`${a}-text-tight-leading`),dt=Ua(q,O,`${a}-answer-text`,`${a}-text-tight-leading`),ft=Xa(N,D,a,n),Pt=Xa(q,O,a,n),xt=I.buildColorVars(a,{questionColor:E,answerColor:T,dividerColor:F,iconColor:M,questionHoverColor:W,iconHoverColor:_,iconActiveColor:L,dividerHoverColor:U},Rm,Mm),wt=s&&s!=="default"?`${a}-state-${s}`:"",Ht=l.useCallback(Re=>{be&&X(Be=>{if(Be.has(Re)){const He=new Set(Be);return He.delete(Re),He}if($==="on")return new Set([Re]);const Ue=new Set(Be);return Ue.add(Re),Ue})},[be,$]),Lt=l.useMemo(()=>km(a),[a]),Ge={[`--${a}-divider-width`]:I.scalingValue(p,n??!1),[`--${a}-divider-style`]:P,[`--${a}-icon-max-width`]:I.scalingValue(y,n??!1),...m>0?{[`--${a}-question-min-height`]:I.scalingValue(m,n??!1)}:{}};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Lt}}),r.jsx("div",{style:xt,children:r.jsx("div",{className:Je(`${a}-wrapper`,n&&!i&&`${a}-editor`,Fe,wt),style:{width:I.scalingValue(c,n??!1),maxWidth:"100%",...Ge},children:ee.map((Re,Be)=>{var kt;const Ue=Te(Be),He=((kt=Re.question)==null?void 0:kt.trim())??"",ut=Re.answer,It=((ut==null?void 0:ut.length)??0)>0,Ze=u&&Be===se;return r.jsxs("div",{className:Je(`${a}-item`,Ue&&`${a}-item-open`),"data-faq-item":"",children:[r.jsxs("div",{className:`${a}-question-controls`,children:[Ze&&r.jsxs(r.Fragment,{children:[r.jsx(Ft,{"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:`${a}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",top:0,left:0,width:"100%",height:te(J),zIndex:2}}),r.jsx(Ft,{"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(G),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:te(ie),height:"100%",zIndex:2}}),r.jsx(Ft,{"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(Q),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,right:0,width:te(z),height:"100%",zIndex:2}})]}),r.jsxs("button",{type:"button",className:`${a}-question-button`,"aria-expanded":Ue,style:{...Ae,...ft,paddingLeft:te(H),paddingRight:te(C)},onClick:()=>Ht(Be),children:[ue>0&&r.jsx("span",{className:`${a}-padding-handle`,style:{height:te(ue)},"aria-hidden":"true"}),r.jsxs("span",{className:`${a}-question-row`,children:[r.jsx("span",{className:Ve,children:He}),It&&($e?r.jsx("span",{className:`${a}-icon ${a}-icon-custom ${le}`,"aria-hidden":"true",children:r.jsx(Qt,{url:Ie,fill:M,hoverFill:_,className:`${a}-icon-image`})}):r.jsx("span",{className:`${a}-icon ${a}-icon-default ${le}`,"aria-hidden":"true"}))]}),f>0&&r.jsx("span",{className:`${a}-padding-handle`,style:{height:te(f)},"aria-hidden":"true"})]}),Ze&&r.jsx(Ft,{"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:`${a}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:te(xe),zIndex:2}})]}),It&&ut&&r.jsx("div",{className:`${a}-panel`,"aria-hidden":!Ue,children:r.jsx("div",{className:`${a}-panel-inner`,children:r.jsxs("div",{className:`${a}-answer-controls`,children:[Ze&&Ue&&r.jsxs(r.Fragment,{children:[r.jsx(Ft,{"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:`${a}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",top:0,left:0,width:"100%",height:te(Ee),zIndex:2}}),r.jsx(Ft,{"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(S),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:te(Se),height:"100%",zIndex:2}}),r.jsx(Ft,{"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(j),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,right:0,width:te(ve),height:"100%",zIndex:2}})]}),ye>0&&r.jsx("div",{className:`${a}-padding-handle`,style:{height:te(ye)}}),r.jsx("div",{className:`${a}-answer`,style:{...ze,...Pt,paddingLeft:te(me),paddingRight:te(fe)},children:r.jsx("div",{className:dt,children:r.jsx(ui,{content:ut})})}),Me>0&&r.jsx("div",{className:`${a}-padding-handle`,style:{height:te(Me)}}),Ze&&Ue&&r.jsx(Ft,{"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:`${a}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:te(A),zIndex:2}})]})})})]},Be)})})})]})}const Fm=`import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
9354
9432
|
import cn from 'classnames';
|
|
9355
9433
|
import { CommonComponentProps } from '../props';
|
|
9356
9434
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -10147,7 +10225,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
10147
10225
|
</>
|
|
10148
10226
|
);
|
|
10149
10227
|
}
|
|
10150
|
-
`;function En(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Ja={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},_m=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Fm={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:En("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:{...Ja.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:{...Ja.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:En("Question Padding Left"),questionPaddingTop:En("Question Padding Top"),questionPaddingBottom:En("Question Padding Bottom"),answerPaddingLeft:En("Answer Padding Left"),answerPaddingRight:En("Answer Padding Right"),answerPaddingTop:En("Answer Padding Top"),answerPaddingBottom:En("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:[..._m],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Wm={element:Am,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:Fm,sourceCode:Mm},vn=e=>e.display==="cover",Go=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Za=100,Nm=.2,Qa=8,nl=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,s]=l.useState(0),[a,u]=l.useState(!1),c=l.useRef(null),m=l.useRef(0);m.current=o;const p=l.useMemo(()=>typeof window>"u"?Za:Math.max(Za,window.innerHeight*Nm),[]),b=l.useCallback(y=>Math.max(0,1-y/(p*1.5)),[p]),w=l.useCallback(y=>Math.max(0,1-y/(p*.45)),[p]),S=l.useCallback(y=>{const _=typeof window<"u"?window.innerHeight:800,W=Math.max(.88,1-y/_*.12);return`translateY(${y}px) scale(${W})`},[]),g=l.useCallback(()=>{c.current=null},[]),v=l.useCallback(()=>{u(!0),s(0),window.setTimeout(()=>u(!1),n),g()},[n,g]),T=l.useCallback(()=>{const y=typeof window<"u"?window.innerHeight:800;u(!0),s(y),window.setTimeout(()=>{t(),g(),u(!1)},Math.min(n,200))},[n,t,g]),$=l.useCallback(y=>{!e||a||y.pointerType==="touch"&&(i!=null&&i(y.target)||(c.current={startX:y.clientX,startY:y.clientY,isLocked:null,pointerId:y.pointerId}))},[e,a,i]),C=l.useCallback(y=>{const _=c.current;if(!e||!_||y.pointerType!=="touch"||_.pointerId!==y.pointerId)return;const W=y.clientX-_.startX,G=y.clientY-_.startY;if(_.isLocked===null){if(Math.abs(W)<Qa&&Math.abs(G)<Qa)return;if(G>0&&G>Math.abs(W))_.isLocked=!0,y.currentTarget.setPointerCapture(y.pointerId);else{_.isLocked=!1,g();return}}if(!_.isLocked)return;y.preventDefault();const te=Math.max(0,G);m.current=te,s(te)},[e,g]),L=l.useCallback(y=>{const _=c.current;if(!e||!_||y.pointerType!=="touch"||_.pointerId!==y.pointerId)return;const W=_.isLocked===!0;if(y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),!W){g();return}y.clientY-_.startY>=p?T():v()},[p,T,e,g,v]),A=l.useCallback(y=>{L(y)},[L]),k=l.useCallback(y=>{L(y)},[L]),F=o>0,I=a?`transform ${n}ms ease`:"none",E=a?`opacity ${n}ms ease`:"none",J=o>0||a;return{isSwipeDragging:F,backdropStyle:{opacity:b(o),transition:E},mediaAreaStyle:{transform:S(o),transition:I,touchAction:F?"none":void 0,willChange:F?"transform":void 0},overlayContentStyle:J?{opacity:w(o),transition:E}:void 0,swipeHandlers:e?{onPointerDown:$,onPointerMove:C,onPointerUp:A,onPointerCancel:k}:{},dismissAreaStyle:e?{touchAction:F?"none":"pan-x"}:void 0}},Hm="[data-lightbox-scrollable]",il=()=>{l.useEffect(()=>{const e=window.scrollY,t=document.body.style.overflow,n=document.body.style.position,i=document.body.style.top,o=document.body.style.width,s=document.documentElement.style.overflow;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${e}px`,document.body.style.width="100%",document.documentElement.style.overflow="hidden";const a=u=>{const c=u.target;c instanceof Element&&c.closest(Hm)||u.preventDefault()};return document.addEventListener("touchmove",a,{passive:!1}),()=>{document.removeEventListener("touchmove",a),document.body.style.overflow=t,document.body.style.position=n,document.body.style.top=i,document.body.style.width=o,document.documentElement.style.overflow=s,window.scrollTo(0,e)}},[])},Om=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Bm=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},jm=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},zm=(e,t,n,{duration:i,easing:o,onComplete:s})=>{const a=e.scrollLeft,u=n-a,c=a-n,m=(g,v)=>{Bm(t),e.scrollLeft=g,v&&(s==null||s())};if(Math.abs(u)<.5)return m(n,!0),()=>{};let p=!1,b=0;const w=()=>{t.removeEventListener("transitionend",S),clearTimeout(b)},S=g=>{g.target!==t||g.propertyName!=="transform"||p||(p=!0,w(),m(n,!0))};return t.addEventListener("transitionend",S),t.style.willChange="transform",t.style.transition="none",t.style.transform="translate3d(0, 0, 0)",t.offsetHeight,t.style.transition=`transform ${i}ms ${o}`,t.style.transform=`translate3d(${c}px, 0, 0)`,b=window.setTimeout(()=>{p||(p=!0,w(),m(n,!0))},i+64),()=>{p||(p=!0,w(),m(a-jm(t),!1))}},Pi=300,Vm=900,Dm=1500,qm="cubic-bezier(0.16, 1, 0.3, 1)",Km=3e3,Gm=2,Um=16,Xm=.05,Ym=1,uo=.3,Jm=50,Zm=20,ei=.004,hi=["title1","title2","title3"],Qm={title1:"1",title2:"2",title3:"3"},eg={title1:"title1Color",title2:"title2Color",title3:"title3Color"},tg={title1:.02,title2:.02,title3:.02},po=e=>`max(${e}, ${Zm}px)`,ng=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]}},ig=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=ng(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},lt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,og=e=>[lt(e,"fontFamily"),lt(e,"fontSettings"),{type:"row",items:[lt(e,"fontSize"),lt(e,"lineHeight"),lt(e,"letterSpacing"),lt(e,"wordSpacing")]},lt(e,"textAlign"),lt(e,"textAppearance")],rg=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(hi.map(e=>[Qm[e],og(e)]))}),na=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,a)=>s+a,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:a},u)=>{if(s<=0||u<=0)return{overflow:s,widths:[u,...a]};const c=Math.min(s,u);return{overflow:s-c,widths:[u-c,...a]}},{overflow:i-1,widths:[]});return o},ol=(e,t)=>na(e,t),mo=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},es=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:na(e.length,n),effective:ol(e.length,n)}},ag=(e,t,n,i,o,s,a)=>{const u=[];return t&&u.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:o,text:t}),n&&u.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:s,text:n}),i&&u.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:a,text:i}),u},gr=(e,t)=>{const n=i=>{const o=lt(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[eg[t]]}},sg=(e,t,n,i)=>e.slice(0,i).reduce((o,s,a)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[a]??0),0),hr=(e,t,n)=>{var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??tg[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return At(i,n)},lg=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,onClose:a})=>{const{backgroundColor:u,thumbnailSize:c,thumbnailGap:m,thumbnailMarginBottom:p,imageGap:b,closeIcon:w,closeIconMaxWidth:S,closeIconColor:g,closeIconHoverColor:v,thumbnailTrigger:T,thumbnailVisibility:$,thumbnailObjectFit:C,thumbnailActive:L,thumbnailActiveColor:A,title1Width:k,title2Width:F,title3Width:I,title1MarginLeft:E=0,title2MarginLeft:J=0,title3MarginLeft:y=0,titleRowMarginBottom:_=0,titleHeaderLayout:W="desktop",contentMarginTop:G,iconMarginLeft:te}=n,ue=d=>P.scalingValue(d,i??!1),X=c??n.thumnailSize??.03,H=ue(X),Q=ue(m),z=ue(p??.02),B=ue(b??0),Y=ue(G??0),oe=po(Y),ie=ue(te??0),[O,ce]=l.useState(0),f=l.useRef(O);f.current=O;const de=t[O],{title1:be,title2:fe,title3:Re}=ig(de),Z=hr("title1",gr(n,"title1"),i),ge=hr("title2",gr(n,"title2"),i),U=hr("title3",gr(n,"title3"),i),V=W==="mobile",j=!o&&(!i||s),he=j,re=j,Ce=j,Se=vn(C),we=Se?{"--image-aspect-ratio":Go(C)}:void 0,Ie=!!(be||fe||Re),N=l.useMemo(()=>ag(e,be,fe,Re,Z,ge,U),[e,O,be,fe,Re,Z,ge,U]),ee=l.useMemo(()=>({title1Width:k,title2Width:F,title3Width:I}),[k,F,I]),R=l.useMemo(()=>N.map(d=>ee[d.widthKey]),[N,ee]),K=l.useMemo(()=>na(N.length,R),[N.length,R]),D=l.useMemo(()=>ol(N.length,R),[N.length,R]),ae=l.useMemo(()=>N.filter(d=>d.prefix==="title1"),[N]),ne=l.useMemo(()=>N.filter(d=>d.prefix==="title2"||d.prefix==="title3"),[N]),ye=l.useMemo(()=>es(ae,ee),[ae,ee]),ke=l.useMemo(()=>es(ne,ee),[ne,ee]),Te=l.useCallback((d,h)=>{const x=N.indexOf(d);if(!V||h==="single-row")return{effectiveWidth:D[x]??0,resolvedWidth:K[x]??0,maxWidth:mo(x,K)};if(h==="two-row-top"){const le=ae.indexOf(d);return{effectiveWidth:ye.effective[le]??0,resolvedWidth:ye.resolved[le]??0,maxWidth:mo(le,ye.resolved)}}const q=ne.indexOf(d);return{effectiveWidth:ke.effective[q]??0,resolvedWidth:ke.resolved[q]??0,maxWidth:mo(q,ke.resolved)}},[ne,ke,D,K,N,ae,ye,V]),xe=l.useCallback(d=>P.scalingValue(d,i??!1),[i]),Ke=xe(_??0),se=l.useMemo(()=>({title1MarginLeft:E,title2MarginLeft:J,title3MarginLeft:y}),[E,J,y]),Ae=l.useCallback(d=>N.slice(0,d+1).reduce((h,x,q)=>h+(x!=null&&x.marginLeftKey?se[x.marginLeftKey]??0:0)+(K[q]??0),0)+(V?0:E??0),[N,se,K,V,E]),Ne=l.useCallback(()=>V?0:E??0,[V,E]),He=l.useCallback(d=>ne.slice(0,d).reduce((h,x,q)=>h+(x.marginLeftKey?se[x.marginLeftKey]??0:0)+(ke.resolved[q]??0),0),[ne,ke.resolved,se]),dt=l.useCallback(d=>{const h=ne[d];return He(d)+(h.marginLeftKey?se[h.marginLeftKey]??0:0)+(ke.resolved[d]??0)},[ne,ke.resolved,He,se]),ft=(d,h)=>{const x=d.marginLeftKey?se[d.marginLeftKey]??0:0,{effectiveWidth:q,resolvedWidth:le,maxWidth:$e}=Te(d,h),Fe=o&&h==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":d.prefix,style:{...h==="single-row"?{gridArea:d.prefix}:{},width:xe(q),...x>0?{marginLeft:xe(x)}:{}},children:[r.jsx("p",{className:d.className,style:d.style,children:d.text}),Fe&&d.marginLeftKey&&r.jsx("div",{"data-controls":d.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(le),style:{position:"absolute",top:0,left:xe(-x),width:`max(${xe(x)}, 10px)`,height:"100%",pointerEvents:"auto"}}),Fe&&r.jsx("div",{"data-controls":d.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String($e),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:xe(-ei/2),width:xe(ei),height:"100%",pointerEvents:"auto"}})]},d.className)},It=()=>{const d=V?-1:N.findIndex(q=>q.prefix==="title1"),h=!V&&(o||(E??0)>0)?(()=>{const q=E??0,le=d>=0?K[d]:k??0;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(le),style:{position:"absolute",top:0,left:0,width:`max(${xe(q)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,x=N.flatMap((q,le)=>{if(!q.marginLeftKey)return[];const $e=se[q.marginLeftKey]??0,Fe=sg(N,K,se,le)+Ne();return r.jsx("div",{"data-controls":q.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(K[le]),style:{position:"absolute",top:0,left:xe(Fe),width:`max(${xe($e)}, 10px)`,height:"100%",pointerEvents:"auto"}},q.marginLeftKey)});return h?[h,...x]:x},xt=()=>N.map((d,h)=>{const x=mo(h,K),le=Ae(h)-ei/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":d.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(x),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:xe(le),width:xe(ei),height:"100%",pointerEvents:"auto"}})},`${d.widthKey}-junction`)}),wt=()=>ne.flatMap((d,h)=>{if(!d.marginLeftKey)return[];const x=se[d.marginLeftKey]??0,q=He(h),{resolvedWidth:le}=Te(d,"two-row-bottom");return r.jsx("div",{"data-controls":d.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(le),style:{position:"absolute",top:0,left:xe(q),width:`max(${xe(x)}, 10px)`,height:"100%",pointerEvents:"auto"}},d.marginLeftKey)}),Ht=()=>ne.map((d,h)=>{const{maxWidth:x}=Te(d,"two-row-bottom"),le=dt(h)-ei/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":d.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(x),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:xe(le),width:xe(ei),height:"100%",pointerEvents:"auto"}})},`${d.widthKey}-junction`)}),Lt=l.useRef(null),Xe=l.useRef(null),Me=l.useRef(null),Ve=l.useRef(null),Ye=l.useRef([]),Be=l.useRef([]),ut=l.useRef(0),Pt=l.useRef(null),Qe=l.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),Mt=l.useRef(null),Ot=l.useRef(null),je=l.useRef(0),gt=l.useRef("forward"),it=l.useRef(0),Ze=l.useRef(null),rt=l.useRef(!1),at=t.length>1&&(!o||!!s),sn=at?3:1,wn=l.useMemo(()=>Array.from({length:sn},()=>t).flat(),[t,sn]),[ln,ot]=l.useState(!1),[tn,Ut]=l.useState(!1),[qe,yt]=l.useState(!0),vt=l.useRef(null),pe=l.useRef(null),Le=l.useRef(!1),_e=l.useRef(!1),We=l.useRef(null),tt=l.useRef(null),$t=he&&!qe,Ee=l.useCallback(()=>{he&&(yt(!0),tt.current&&clearTimeout(tt.current),tt.current=setTimeout(()=>{Qe.current.isActive||yt(!1)},Km))},[he]),et=l.useCallback(()=>{o||_e.current||(_e.current=!0,Ut(!1),We.current=setTimeout(()=>{a()},Pi))},[o,a]),De=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":$t?"true":"false",style:{width:P.scalingValue(S??0,i),height:P.scalingValue(S??0,i),marginRight:ie,"--close-icon-hover-color":v},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:et,"aria-label":"Close",children:r.jsx(Qt,{url:w,fill:g,hoverFill:i&&!s?g: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:ie,height:"100%",pointerEvents:"auto"}})]}),st=(d="two-row")=>r.jsx("div",{...d==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:xe(E??0),flexShrink:0,...d==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...d==="two-row"&&o?{pointerEvents:"auto"}:{}}}),pt=()=>{const d=N.find(q=>q.prefix==="title1"),h=N.filter(q=>q.prefix==="title2"||q.prefix==="title3"),x=h.length>0||o||(_??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(E??0)>0||o?st():null,d&&ft(d,"two-row-top"),w&&De()]}),x?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[h.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[h.map(q=>ft(q,"two-row-bottom")),o&&r.jsxs(r.Fragment,{children:[wt(),Ht()]})]}):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:Ke,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},kt=()=>r.jsxs(r.Fragment,{children:[(E??0)>0||o?st("single-row"):null,N.map(d=>ft(d,"single-row")),o?r.jsxs(r.Fragment,{children:[It(),xt()]}):null,w?De():null]}),Ge=l.useCallback(d=>!!(d.closest("[data-controls]")||d.closest(`.${e}-thumbnails`)||d.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:nt,backdropStyle:Et,mediaAreaStyle:St,overlayContentStyle:_t,swipeHandlers:$n,dismissAreaStyle:ht}=nl({enabled:j??!1,onClose:et,animMs:Pi,isBlockedTarget:Ge}),Bt=()=>{if(!at||t.length===0)return ut.current=0,0;const d=Be.current[0],h=Be.current[t.length];if(!d||!h)return ut.current;const x=h.offsetLeft-d.offsetLeft;return x>0&&(ut.current=x),ut.current},Wt=(d=!1)=>{if(!at)return;const h=Xe.current,x=Bt();!h||x<=0||x<h.clientWidth*.25||(h.scrollLeft<=0?(h.scrollLeft+=x,d&&(Qe.current.scrollLeft+=x),rt.current&&(it.current+=x)):h.scrollLeft>=x*2&&(h.scrollLeft-=x,d&&(Qe.current.scrollLeft-=x),rt.current&&(it.current-=x)))},cn=(d,h=(x=>(x=Xe.current)==null?void 0:x.scrollLeft)()??0)=>{if(!at)return d;let q=t.length+d,le=1/0;for(let $e=0;$e<sn;$e++){const Fe=$e*t.length+d,Ue=Be.current[Fe];if(!Ue)continue;const Rt=Math.abs(Ue.offsetLeft-h);Rt<le&&(le=Rt,q=Fe)}return q},Sn=d=>{const h=Xe.current;return!d||!h?!1:d.offsetWidth>h.clientWidth+1},dn=d=>{const h=Xe.current;if(!d||!h||!Sn(d))return!1;const x=d.offsetLeft,q=x+d.offsetWidth;return h.scrollLeft>=x-1&&h.scrollLeft+h.clientWidth<=q+1},zt=(d=(h=>(h=Xe.current)==null?void 0:h.scrollLeft)()??0)=>{for(let q=0;q<Be.current.length;q+=1){const le=Be.current[q];if(le&&dn(le))return q}let x={flatIndex:0,distance:1/0};return Be.current.forEach((q,le)=>{if(!q)return;const $e=Math.abs(q.offsetLeft-d);$e<x.distance&&(x={flatIndex:le,distance:$e})}),x.flatIndex},Cn=d=>{Xe.current&&Be.current.forEach(h=>{h&&(h.style.scrollSnapAlign=Sn(h)&&d==="backward"?"end":"start")})},Xn=(d,h,x)=>{const q=d-h,le=zt(h),$e=Be.current[le];if(dn($e))return zt(d)%t.length;const Fe=Be.current[le+1],Ue=$e?Fe?Fe.offsetLeft-$e.offsetLeft:$e.offsetWidth:0,Rt=Ue>0?q>Ue*uo?1:q<-Ue*uo?-1:0:0;return Rt===0?x:at?(x+Rt+t.length)%t.length:Math.max(0,Math.min(t.length-1,x+Rt))},Yn=l.useCallback((d=!1)=>{if($!=="on"||o)return;const h=Ve.current,x=f.current,q=Ye.current[x];if(!h||!q||h.scrollWidth<=h.clientWidth)return;const le=h.scrollLeft,$e=le+h.clientWidth,Fe=q.offsetLeft,Ue=Fe+q.offsetWidth;if(Fe>=le&&Ue<=$e)return;const Rt=h.scrollWidth-h.clientWidth;let Ct=le;if(!d&&vt.current===null){const Zn=Ye.current[x-1],Si=Ye.current[x+1],to=Zn?q.offsetLeft-Zn.offsetLeft:Si?Si.offsetLeft-q.offsetLeft:q.offsetWidth;Ue>$e?Ct+=to:Fe<le&&(Ct-=to)}else Ue>$e?Ct=Ue-h.clientWidth:Ct=Fe;h.scrollLeft=Math.max(0,Math.min(Rt,Ct))},[o,$]),$i=l.useCallback((d=!1)=>{d&&(Le.current=!0),pe.current===null&&(pe.current=requestAnimationFrame(()=>{pe.current=null;const h=Le.current;Le.current=!1,Yn(h)}))},[Yn]),Yo=l.useCallback(d=>{if(d===f.current)return;const h=f.current;f.current=d;const x=Math.abs(d-h)>1,q=at&&t.length>1&&(h===t.length-1&&d===0||h===0&&d===t.length-1);ce(d),$i(x||q)},[t.length,at,$i]),Xt=()=>{if(!Xe.current||t.length===0||vt.current!==null||Qe.current.isActive&&Qe.current.hasMoved)return;const d=Xe.current.scrollLeft,h=zt(d)%t.length;h!==f.current&&Yo(h)},Yi=()=>{vt.current=null},Yt=d=>{const h=Xe.current;h&&(h.style.scrollSnapType=d?"":"none")},un=()=>{var d;(d=Ot.current)==null||d.call(Ot),Ot.current=null},Tn=()=>{Ze.current!==null&&(cancelAnimationFrame(Ze.current),Ze.current=null),rt.current=!1},Fn=()=>{const d=Xe.current;if(!d){Ze.current=null,rt.current=!1;return}const h=it.current-d.scrollLeft;if(Math.abs(h)<.5){d.scrollLeft=it.current,Wt(),Xt(),Ze.current=null,rt.current=!1;return}d.scrollLeft+=h*Xm,Wt(),Xt(),Ee(),Ze.current=requestAnimationFrame(Fn)},Wn=()=>{const d=Me.current;d&&(d.style.transition="",d.style.transform="",d.style.willChange="")},Ji=(d,h,x,q)=>{Wn(),d.scrollLeft=h,je.current=d.scrollLeft,Wt(),x!==void 0?(f.current=x,ce(x)):Xt(),Yt(!0),q==null||q()},Zi=(d,{behavior:h="smooth",activeIndex:x,onComplete:q}={})=>{const le=Xe.current,$e=Me.current;if(!le||!$e)return;if(Tn(),un(),Yt(!1),h==="auto"){Ji(le,d,x,q);return}const Fe=Math.abs(d-le.scrollLeft),Ue=Om(Fe,Vm,Dm,le.clientWidth*.55);Ot.current=zm(le,$e,d,{duration:Ue,easing:qm,onComplete:()=>{Ot.current=null,Ji(le,d,x,q)}})},Jo=(d="smooth")=>{const h=Xe.current;if(!h||t.length===0)return;const x=zt()%t.length,q=cn(x,h.scrollLeft),le=Be.current[q];le&&Zi(le.offsetLeft,{behavior:d,activeIndex:x})},Zo=(d,h="smooth",x,q)=>{const le=Xe.current;if(!le||t.length===0)return;const $e=(q??le.scrollLeft)-d,Fe=zt(d),Ue=Be.current[Fe];if(dn(Ue)){Yt(!0),Xt();return}const Rt=Be.current[Fe+1],Ct=Ue?Rt?Rt.offsetLeft-Ue.offsetLeft:Ue.offsetWidth:0;if((Ct>0?$e>Ct*uo?1:$e<-Ct*uo?-1:0:0)!==0){const cl=x??Fe%t.length,dl=Xn(q??le.scrollLeft,d,cl);nn(dl,h);return}const Si=q??le.scrollLeft,to=zt(Si),ra=Be.current[to];if(ra&&Math.abs(ra.offsetLeft-Si)<1){Yt(!0),Xt();return}Jo("auto")},nn=(d,h="smooth")=>{const x=Xe.current;if(!x||t.length===0)return;const q=cn(d,x.scrollLeft),le=Be.current[q];le&&(h==="smooth"?vt.current=d:vt.current=null,f.current=d,ce(d),$i(!0),Zi(le.offsetLeft,{behavior:h,activeIndex:d,onComplete:h==="smooth"?Yi:void 0}))},Jn=()=>{Mt.current&&(window.removeEventListener("pointerup",Mt.current),window.removeEventListener("pointercancel",Mt.current),Mt.current=null)},Qi=(d,h,x,q,le)=>{const $e=x-d,Fe=q-h,Ue=Math.abs($e),Rt=Math.abs(Fe);if(Ue<Jm||Ue<=Rt)return!1;const Ct=$e<0?1:-1,Zn=at?(le+Ct+t.length)%t.length:Math.max(0,Math.min(t.length-1,le+Ct));return Zn===le?!1:(nn(Zn),!0)},Nn=d=>{if(!Qe.current.isActive)return;Jn();const h=Xe.current;if(!h)return;const{scrollLeft:x,startActiveIndex:q,hasMoved:le}=Qe.current,$e=h.scrollLeft;Wt(!0),Qe.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},ot(!1),d!==void 0&&h.hasPointerCapture(d)&&h.releasePointerCapture(d),le?Zo(x,"smooth",q,$e):(Yt(!0),Xt()),Ee()},eo=(d,h)=>{const x=Pt.current;Pt.current=null,x&&(Qi(x.startX,x.startY,d,h,x.startActiveIndex),Ee())},Qo=d=>{if(!re)return;if(d.pointerType==="touch"){if(Tn(),Yt(!0),Ge(d.target))return;Pt.current={startX:d.clientX,startY:d.clientY,startActiveIndex:f.current};return}if(d.pointerType!=="mouse"||d.button!==0||Ge(d.target))return;const h=Xe.current;if(!h)return;Tn(),un(),Wn(),vt.current=null,Qe.current={isActive:!0,startX:d.clientX,scrollLeft:h.scrollLeft,startActiveIndex:f.current,hasMoved:!1},Yt(!1),Ee(),h.setPointerCapture(d.pointerId),Jn();const x=q=>{q.pointerType==="mouse"&&Nn(q.pointerId)};Mt.current=x,window.addEventListener("pointerup",x),window.addEventListener("pointercancel",x)},er=d=>{if(!re||d.pointerType!=="mouse")return;const h=Xe.current;if(!h||!Qe.current.isActive)return;if(d.buttons===0){Nn(d.pointerId);return}const x=d.clientX-Qe.current.startX;Math.abs(x)>Ym&&(Qe.current.hasMoved=!0,ot(!0)),Qe.current.hasMoved&&(d.preventDefault(),h.scrollLeft=Qe.current.scrollLeft-x,Wt(!0),Xt(),Ee())},M=d=>{if(re){if(d.pointerType==="touch"){d.type==="pointerup"?eo(d.clientX,d.clientY):Pt.current=null;return}d.pointerType==="mouse"&&Nn(d.pointerId)}},me=d=>{!re||d.pointerType!=="mouse"||Nn(d.pointerId)};return il(),l.useEffect(()=>{const d=requestAnimationFrame(()=>Ut(!0));return()=>{cancelAnimationFrame(d),un(),Jn(),pe.current!==null&&(cancelAnimationFrame(pe.current),pe.current=null),We.current&&clearTimeout(We.current),tt.current&&clearTimeout(tt.current)}},[]),l.useEffect(()=>{if(!he){yt(!0);return}Ee();const d=Lt.current;if(!d)return;const h=()=>Ee();return d.addEventListener("pointermove",h),d.addEventListener("pointerdown",h),()=>{d.removeEventListener("pointermove",h),d.removeEventListener("pointerdown",h),tt.current&&clearTimeout(tt.current)}},[he,Ee]),l.useEffect(()=>{const d=h=>{h.key==="Escape"&&et()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[et]),l.useLayoutEffect(()=>{Bt()},[B,t.length,at]),l.useLayoutEffect(()=>{o||nn(f.current,"auto")},[B,o]),l.useLayoutEffect(()=>{nn(0,"auto")},[t.length,at]),l.useEffect(()=>{const d=Xe.current;if(!d||o||!j)return;const h=x=>{if(x.preventDefault(),Math.abs(x.deltaY)<=Math.abs(x.deltaX))return;const q=x.deltaMode===1?Um:x.deltaMode===2?d.clientHeight:1,le=x.deltaY*q*Gm;if(le!==0){if(un(),rt.current||(rt.current=!0,it.current=d.scrollLeft,vt.current=null,Yt(!1)),it.current+=le,!at){const $e=d.scrollWidth-d.clientWidth;it.current=Math.max(0,Math.min($e,it.current))}Ee(),Ze.current===null&&(Ze.current=requestAnimationFrame(Fn))}};return d.addEventListener("wheel",h,{passive:!1}),()=>{d.removeEventListener("wheel",h),Tn()}},[o,j,at]),l.useEffect(()=>{const d=Xe.current;if(!d)return;const h=()=>{Wt(Qe.current.isActive);const q=d.scrollLeft,le=q-je.current;je.current=q;const $e=ut.current>0?ut.current*.5:1/0;if(le!==0&&Math.abs(le)<$e){const Fe=le>0?"forward":"backward";Fe!==gt.current&&(gt.current=Fe,Cn(Fe))}Qe.current.isActive&&Qe.current.hasMoved||Xt()};d.addEventListener("scroll",h,{passive:!0});const x=new ResizeObserver(()=>{Bt(),Wt(Qe.current.isActive),Cn(gt.current),Xt()});return x.observe(d),()=>{un(),d.removeEventListener("scroll",h),x.disconnect()}},[t.length,at]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{nt||et()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:tn?1:0,transition:`opacity ${Pi}ms ease`,pointerEvents:tn?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:u,...Et}}),r.jsxs("div",{ref:Lt,className:`${e}-lightbox-dismiss-area`,style:ht,...$n,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:St,onClick:d=>d.stopPropagation(),children:r.jsx("div",{ref:Xe,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":re&&t.length>0?"true":"false","data-mouse-dragging":ln?"true":"false",onPointerDown:Qo,onPointerMove:er,onPointerUp:M,onPointerCancel:M,onLostPointerCapture:me,children:r.jsx("div",{ref:Me,className:`${e}-lightbox-strip-track`,style:{gap:B},children:wn.map((d,h)=>{const x=d.image.objectFit??"contain",q=h%t.length,le=Math.floor(h/t.length),$e=po(B),Fe=`calc(-0.5 * (${$e} + ${B}))`;return r.jsxs("div",{ref:Ue=>Be.current[h]=Ue,className:`${e}-strip-item`,style:{height:W==="mobile"?"75vh":"100%"},children:[r.jsx("img",{src:d.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:x}}),o&&q<t.length-1&&le===0&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Fe,width:$e,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${le}-${d.image.url}-${q}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":$t?"true":"false",style:_t,children:[r.jsx("div",{style:{position:"relative",width:"100%",height:Y,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:oe,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${V?` ${e}-lightbox-content-area-stacked`:""}`,children:(Ie||w)&&r.jsx("div",{className:`${e}-header ${V?`${e}-header-two-row`:`${e}-header-single-row`}`,children:V?pt():Ie||w?kt():null})})})]}),t.length>1&&$==="on"&&(()=>{const d=po(z),h=`calc(-0.5 * (${z} + ${d}))`;return r.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:z},children:r.jsx("div",{ref:Ve,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:x=>x.stopPropagation(),children:r.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":L,style:{gap:Q,"--thumbnail-active-color":A},children:[t.map((x,q)=>{const le=po(Q),$e=`calc(-0.5 * (${le} + ${Q}))`;return r.jsxs("div",{ref:Fe=>{Ye.current[q]=Fe},style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":O===q?"true":"false",onClick:()=>j&&T==="click"&&nn(q),onMouseEnter:()=>Ce&&T==="hover"&&nn(q),"aria-label":x.image.name?`View ${x.image.name}`:`View image ${q+1}`,"aria-current":O===q?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${Se?` ${e}-thumb-image-cover`:""}`,src:x.image.url,alt:"",draggable:!1,style:{...we,maxWidth:H,maxHeight:H,width:C.display==="cover"?"auto":"100%",height:"auto",objectFit:C.display==="cover"?"cover":"contain"}})}),o&&q<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:$e,width:le,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${x.image.url}-${q}`)}),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:h,height:d,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function cg(e){return`
|
|
10228
|
+
`;function En(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Ja={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Wm=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Nm={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:En("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:{...Ja.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:{...Ja.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:En("Question Padding Left"),questionPaddingTop:En("Question Padding Top"),questionPaddingBottom:En("Question Padding Bottom"),answerPaddingLeft:En("Answer Padding Left"),answerPaddingRight:En("Answer Padding Right"),answerPaddingTop:En("Answer Padding Top"),answerPaddingBottom:En("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:[...Wm],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Hm={element:_m,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:Nm,sourceCode:Fm},vn=e=>e.display==="cover",Ko=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Za=100,Om=.2,Qa=8,el=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,s]=l.useState(0),[a,u]=l.useState(!1),c=l.useRef(null),m=l.useRef(0);m.current=o;const p=l.useMemo(()=>typeof window>"u"?Za:Math.max(Za,window.innerHeight*Om),[]),P=l.useCallback(v=>Math.max(0,1-v/(p*1.5)),[p]),x=l.useCallback(v=>Math.max(0,1-v/(p*.45)),[p]),$=l.useCallback(v=>{const R=typeof window<"u"?window.innerHeight:800,N=Math.max(.88,1-v/R*.12);return`translateY(${v}px) scale(${N})`},[]),g=l.useCallback(()=>{c.current=null},[]),y=l.useCallback(()=>{u(!0),s(0),window.setTimeout(()=>u(!1),n),g()},[n,g]),C=l.useCallback(()=>{const v=typeof window<"u"?window.innerHeight:800;u(!0),s(v),window.setTimeout(()=>{t(),g(),u(!1)},Math.min(n,200))},[n,t,g]),w=l.useCallback(v=>{!e||a||v.pointerType==="touch"&&(i!=null&&i(v.target)||(c.current={startX:v.clientX,startY:v.clientY,isLocked:null,pointerId:v.pointerId}))},[e,a,i]),E=l.useCallback(v=>{const R=c.current;if(!e||!R||v.pointerType!=="touch"||R.pointerId!==v.pointerId)return;const N=v.clientX-R.startX,D=v.clientY-R.startY;if(R.isLocked===null){if(Math.abs(N)<Qa&&Math.abs(D)<Qa)return;if(D>0&&D>Math.abs(N))R.isLocked=!0,v.currentTarget.setPointerCapture(v.pointerId);else{R.isLocked=!1,g();return}}if(!R.isLocked)return;v.preventDefault();const ne=Math.max(0,D);m.current=ne,s(ne)},[e,g]),T=l.useCallback(v=>{const R=c.current;if(!e||!R||v.pointerType!=="touch"||R.pointerId!==v.pointerId)return;const N=R.isLocked===!0;if(v.currentTarget.hasPointerCapture(v.pointerId)&&v.currentTarget.releasePointerCapture(v.pointerId),!N){g();return}v.clientY-R.startY>=p?C():y()},[p,C,e,g,y]),F=l.useCallback(v=>{T(v)},[T]),M=l.useCallback(v=>{T(v)},[T]),W=o>0,_=a?`transform ${n}ms ease`:"none",L=a?`opacity ${n}ms ease`:"none",U=o>0||a;return{isSwipeDragging:W,backdropStyle:{opacity:P(o),transition:L},mediaAreaStyle:{transform:$(o),transition:_,touchAction:W?"none":void 0,willChange:W?"transform":void 0},overlayContentStyle:U?{opacity:x(o),transition:L}:void 0,swipeHandlers:e?{onPointerDown:w,onPointerMove:E,onPointerUp:F,onPointerCancel:M}:{},dismissAreaStyle:e?{touchAction:W?"none":"pan-x"}:void 0}},Bm="[data-lightbox-scrollable]",tl=()=>{l.useEffect(()=>{const e=window.scrollY,t=document.body.style.overflow,n=document.body.style.position,i=document.body.style.top,o=document.body.style.width,s=document.documentElement.style.overflow;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${e}px`,document.body.style.width="100%",document.documentElement.style.overflow="hidden";const a=u=>{const c=u.target;c instanceof Element&&c.closest(Bm)||u.preventDefault()};return document.addEventListener("touchmove",a,{passive:!1}),()=>{document.removeEventListener("touchmove",a),document.body.style.overflow=t,document.body.style.position=n,document.body.style.top=i,document.body.style.width=o,document.documentElement.style.overflow=s,window.scrollTo(0,e)}},[])},jm=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},zm=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Vm=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Dm=(e,t,n,{duration:i,easing:o,onComplete:s})=>{const a=e.scrollLeft,u=n-a,c=a-n,m=(g,y)=>{zm(t),e.scrollLeft=g,y&&(s==null||s())};if(Math.abs(u)<.5)return m(n,!0),()=>{};let p=!1,P=0;const x=()=>{t.removeEventListener("transitionend",$),clearTimeout(P)},$=g=>{g.target!==t||g.propertyName!=="transform"||p||(p=!0,x(),m(n,!0))};return t.addEventListener("transitionend",$),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)`,P=window.setTimeout(()=>{p||(p=!0,x(),m(n,!0))},i+64),()=>{p||(p=!0,x(),m(a-Vm(t),!1))}},Pi=300,qm=900,Km=1500,Gm="cubic-bezier(0.16, 1, 0.3, 1)",Um=3e3,Xm=2,Ym=16,Jm=.05,Zm=1,co=.3,Qm=50,eg=20,ei=.004,hi=["title1","title2","title3"],tg={title1:"1",title2:"2",title3:"3"},ng={title1:"title1Color",title2:"title2Color",title3:"title3Color"},ig={title1:.02,title2:.02,title3:.02},uo=e=>`max(${e}, ${eg}px)`,og=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]}},rg=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=og(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},lt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,ag=e=>[lt(e,"fontFamily"),lt(e,"fontSettings"),{type:"row",items:[lt(e,"fontSize"),lt(e,"lineHeight"),lt(e,"letterSpacing"),lt(e,"wordSpacing")]},lt(e,"textAlign"),lt(e,"textAppearance")],sg=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(hi.map(e=>[tg[e],ag(e)]))}),ta=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,a)=>s+a,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:a},u)=>{if(s<=0||u<=0)return{overflow:s,widths:[u,...a]};const c=Math.min(s,u);return{overflow:s-c,widths:[u-c,...a]}},{overflow:i-1,widths:[]});return o},nl=(e,t)=>ta(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)},es=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:ta(e.length,n),effective:nl(e.length,n)}},lg=(e,t,n,i,o,s,a)=>{const u=[];return t&&u.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:o,text:t}),n&&u.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:s,text:n}),i&&u.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:a,text:i}),u},mr=(e,t)=>{const n=i=>{const o=lt(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[ng[t]]}},cg=(e,t,n,i)=>e.slice(0,i).reduce((o,s,a)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[a]??0),0),gr=(e,t,n)=>{var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??ig[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return At(i,n)},dg=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,onClose:a})=>{const{backgroundColor:u,thumbnailSize:c,thumbnailGap:m,thumbnailMarginBottom:p,imageGap:P,closeIcon:x,closeIconMaxWidth:$,closeIconColor:g,closeIconHoverColor:y,thumbnailTrigger:C,thumbnailVisibility:w,thumbnailObjectFit:E,thumbnailActive:T,thumbnailActiveColor:F,title1Width:M,title2Width:W,title3Width:_,title1MarginLeft:L=0,title2MarginLeft:U=0,title3MarginLeft:v=0,titleRowMarginBottom:R=0,titleHeaderLayout:N="desktop",contentMarginTop:D,iconMarginLeft:ne}=n,pe=d=>I.scalingValue(d,i??!1),K=c??n.thumnailSize??.03,B=pe(K),Z=pe(m),q=pe(p??.02),O=pe(P??0),Y=pe(D??0),ae=uo(Y),oe=pe(ne??0),[H,ue]=l.useState(0),f=l.useRef(H);f.current=H;const me=t[H],{title1:fe,title2:ye,title3:Me}=rg(me),ee=gr("title1",mr(n,"title1"),i),ge=gr("title2",mr(n,"title2"),i),X=gr("title3",mr(n,"title3"),i),be=N==="mobile",te=!o&&(!i||s),ie=te,J=te,xe=te,Se=vn(E),ve=Se?{"--image-aspect-ratio":Ko(E)}:void 0,Ee=!!(fe||ye||Me),A=l.useMemo(()=>lg(e,fe,ye,Me,ee,ge,X),[e,H,fe,ye,Me,ee,ge,X]),G=l.useMemo(()=>({title1Width:M,title2Width:W,title3Width:_}),[M,W,_]),S=l.useMemo(()=>A.map(d=>G[d.widthKey]),[A,G]),j=l.useMemo(()=>ta(A.length,S),[A.length,S]),z=l.useMemo(()=>nl(A.length,S),[A.length,S]),Q=l.useMemo(()=>A.filter(d=>d.prefix==="title1"),[A]),se=l.useMemo(()=>A.filter(d=>d.prefix==="title2"||d.prefix==="title3"),[A]),Te=l.useMemo(()=>es(Q,G),[Q,G]),Fe=l.useMemo(()=>es(se,G),[se,G]),Ie=l.useCallback((d,h)=>{const b=A.indexOf(d);if(!be||h==="single-row")return{effectiveWidth:z[b]??0,resolvedWidth:j[b]??0,maxWidth:po(b,j)};if(h==="two-row-top"){const re=Q.indexOf(d);return{effectiveWidth:Te.effective[re]??0,resolvedWidth:Te.resolved[re]??0,maxWidth:po(re,Te.resolved)}}const V=se.indexOf(d);return{effectiveWidth:Fe.effective[V]??0,resolvedWidth:Fe.resolved[V]??0,maxWidth:po(V,Fe.resolved)}},[se,Fe,z,j,A,Q,Te,be]),$e=l.useCallback(d=>I.scalingValue(d,i??!1),[i]),tt=$e(R??0),le=l.useMemo(()=>({title1MarginLeft:L,title2MarginLeft:U,title3MarginLeft:v}),[L,U,v]),Ae=l.useCallback(d=>A.slice(0,d+1).reduce((h,b,V)=>h+(b!=null&&b.marginLeftKey?le[b.marginLeftKey]??0:0)+(j[V]??0),0)+(be?0:L??0),[A,le,j,be,L]),ze=l.useCallback(()=>be?0:L??0,[be,L]),Ve=l.useCallback(d=>se.slice(0,d).reduce((h,b,V)=>h+(b.marginLeftKey?le[b.marginLeftKey]??0:0)+(Fe.resolved[V]??0),0),[se,Fe.resolved,le]),dt=l.useCallback(d=>{const h=se[d];return Ve(d)+(h.marginLeftKey?le[h.marginLeftKey]??0:0)+(Fe.resolved[d]??0)},[se,Fe.resolved,Ve,le]),ft=(d,h)=>{const b=d.marginLeftKey?le[d.marginLeftKey]??0:0,{effectiveWidth:V,resolvedWidth:re,maxWidth:we}=Ie(d,h),_e=o&&h==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":d.prefix,style:{...h==="single-row"?{gridArea:d.prefix}:{},width:$e(V),...b>0?{marginLeft:$e(b)}:{}},children:[r.jsx("p",{className:d.className,style:d.style,children:d.text}),_e&&d.marginLeftKey&&r.jsx("div",{"data-controls":d.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(re),style:{position:"absolute",top:0,left:$e(-b),width:`max(${$e(b)}, 10px)`,height:"100%",pointerEvents:"auto"}}),_e&&r.jsx("div",{"data-controls":d.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(we),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:$e(-ei/2),width:$e(ei),height:"100%",pointerEvents:"auto"}})]},d.className)},Pt=()=>{const d=be?-1:A.findIndex(V=>V.prefix==="title1"),h=!be&&(o||(L??0)>0)?(()=>{const V=L??0,re=d>=0?j[d]:M??0;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(re),style:{position:"absolute",top:0,left:0,width:`max(${$e(V)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,b=A.flatMap((V,re)=>{if(!V.marginLeftKey)return[];const we=le[V.marginLeftKey]??0,_e=cg(A,j,le,re)+ze();return r.jsx("div",{"data-controls":V.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(j[re]),style:{position:"absolute",top:0,left:$e(_e),width:`max(${$e(we)}, 10px)`,height:"100%",pointerEvents:"auto"}},V.marginLeftKey)});return h?[h,...b]:b},xt=()=>A.map((d,h)=>{const b=po(h,j),re=Ae(h)-ei/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":d.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(b),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:$e(re),width:$e(ei),height:"100%",pointerEvents:"auto"}})},`${d.widthKey}-junction`)}),wt=()=>se.flatMap((d,h)=>{if(!d.marginLeftKey)return[];const b=le[d.marginLeftKey]??0,V=Ve(h),{resolvedWidth:re}=Ie(d,"two-row-bottom");return r.jsx("div",{"data-controls":d.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(re),style:{position:"absolute",top:0,left:$e(V),width:`max(${$e(b)}, 10px)`,height:"100%",pointerEvents:"auto"}},d.marginLeftKey)}),Ht=()=>se.map((d,h)=>{const{maxWidth:b}=Ie(d,"two-row-bottom"),re=dt(h)-ei/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":d.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(b),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:$e(re),width:$e(ei),height:"100%",pointerEvents:"auto"}})},`${d.widthKey}-junction`)}),Lt=l.useRef(null),Ge=l.useRef(null),Re=l.useRef(null),Be=l.useRef(null),Ue=l.useRef([]),He=l.useRef([]),ut=l.useRef(0),It=l.useRef(null),Ze=l.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),kt=l.useRef(null),Ot=l.useRef(null),Oe=l.useRef(0),gt=l.useRef("forward"),it=l.useRef(0),Ye=l.useRef(null),rt=l.useRef(!1),at=t.length>1&&(!o||!!s),sn=at?3:1,wn=l.useMemo(()=>Array.from({length:sn},()=>t).flat(),[t,sn]),[ln,ot]=l.useState(!1),[tn,Ut]=l.useState(!1),[De,yt]=l.useState(!0),vt=l.useRef(null),ce=l.useRef(null),Ce=l.useRef(!1),ke=l.useRef(!1),We=l.useRef(null),et=l.useRef(null),$t=ie&&!De,Le=l.useCallback(()=>{ie&&(yt(!0),et.current&&clearTimeout(et.current),et.current=setTimeout(()=>{Ze.current.isActive||yt(!1)},Um))},[ie]),Qe=l.useCallback(()=>{o||ke.current||(ke.current=!0,Ut(!1),We.current=setTimeout(()=>{a()},Pi))},[o,a]),je=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":$t?"true":"false",style:{width:I.scalingValue($??0,i),height:I.scalingValue($??0,i),marginRight:oe,"--close-icon-hover-color":y},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Qe,"aria-label":"Close",children:r.jsx(Qt,{url:x,fill:g,hoverFill:i&&!s?g:y,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:oe,height:"100%",pointerEvents:"auto"}})]}),st=(d="two-row")=>r.jsx("div",{...d==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:$e(L??0),flexShrink:0,...d==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...d==="two-row"&&o?{pointerEvents:"auto"}:{}}}),pt=()=>{const d=A.find(V=>V.prefix==="title1"),h=A.filter(V=>V.prefix==="title2"||V.prefix==="title3"),b=h.length>0||o||(R??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(L??0)>0||o?st():null,d&&ft(d,"two-row-top"),x&&je()]}),b?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[h.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[h.map(V=>ft(V,"two-row-bottom")),o&&r.jsxs(r.Fragment,{children:[wt(),Ht()]})]}):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:tt,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},Rt=()=>r.jsxs(r.Fragment,{children:[(L??0)>0||o?st("single-row"):null,A.map(d=>ft(d,"single-row")),o?r.jsxs(r.Fragment,{children:[Pt(),xt()]}):null,x?je():null]}),qe=l.useCallback(d=>!!(d.closest("[data-controls]")||d.closest(`.${e}-thumbnails`)||d.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:nt,backdropStyle:Et,mediaAreaStyle:St,overlayContentStyle:_t,swipeHandlers:$n,dismissAreaStyle:ht}=el({enabled:te??!1,onClose:Qe,animMs:Pi,isBlockedTarget:qe}),Bt=()=>{if(!at||t.length===0)return ut.current=0,0;const d=He.current[0],h=He.current[t.length];if(!d||!h)return ut.current;const b=h.offsetLeft-d.offsetLeft;return b>0&&(ut.current=b),ut.current},Wt=(d=!1)=>{if(!at)return;const h=Ge.current,b=Bt();!h||b<=0||b<h.clientWidth*.25||(h.scrollLeft<=0?(h.scrollLeft+=b,d&&(Ze.current.scrollLeft+=b),rt.current&&(it.current+=b)):h.scrollLeft>=b*2&&(h.scrollLeft-=b,d&&(Ze.current.scrollLeft-=b),rt.current&&(it.current-=b)))},cn=(d,h=(b=>(b=Ge.current)==null?void 0:b.scrollLeft)()??0)=>{if(!at)return d;let V=t.length+d,re=1/0;for(let we=0;we<sn;we++){const _e=we*t.length+d,Ke=He.current[_e];if(!Ke)continue;const Mt=Math.abs(Ke.offsetLeft-h);Mt<re&&(re=Mt,V=_e)}return V},Sn=d=>{const h=Ge.current;return!d||!h?!1:d.offsetWidth>h.clientWidth+1},dn=d=>{const h=Ge.current;if(!d||!h||!Sn(d))return!1;const b=d.offsetLeft,V=b+d.offsetWidth;return h.scrollLeft>=b-1&&h.scrollLeft+h.clientWidth<=V+1},zt=(d=(h=>(h=Ge.current)==null?void 0:h.scrollLeft)()??0)=>{for(let V=0;V<He.current.length;V+=1){const re=He.current[V];if(re&&dn(re))return V}let b={flatIndex:0,distance:1/0};return He.current.forEach((V,re)=>{if(!V)return;const we=Math.abs(V.offsetLeft-d);we<b.distance&&(b={flatIndex:re,distance:we})}),b.flatIndex},Cn=d=>{Ge.current&&He.current.forEach(h=>{h&&(h.style.scrollSnapAlign=Sn(h)&&d==="backward"?"end":"start")})},Xn=(d,h,b)=>{const V=d-h,re=zt(h),we=He.current[re];if(dn(we))return zt(d)%t.length;const _e=He.current[re+1],Ke=we?_e?_e.offsetLeft-we.offsetLeft:we.offsetWidth:0,Mt=Ke>0?V>Ke*co?1:V<-Ke*co?-1:0:0;return Mt===0?b:at?(b+Mt+t.length)%t.length:Math.max(0,Math.min(t.length-1,b+Mt))},Yn=l.useCallback((d=!1)=>{if(w!=="on"||o)return;const h=Be.current,b=f.current,V=Ue.current[b];if(!h||!V||h.scrollWidth<=h.clientWidth)return;const re=h.scrollLeft,we=re+h.clientWidth,_e=V.offsetLeft,Ke=_e+V.offsetWidth;if(_e>=re&&Ke<=we)return;const Mt=h.scrollWidth-h.clientWidth;let Ct=re;if(!d&&vt.current===null){const Zn=Ue.current[b-1],Si=Ue.current[b+1],eo=Zn?V.offsetLeft-Zn.offsetLeft:Si?Si.offsetLeft-V.offsetLeft:V.offsetWidth;Ke>we?Ct+=eo:_e<re&&(Ct-=eo)}else Ke>we?Ct=Ke-h.clientWidth:Ct=_e;h.scrollLeft=Math.max(0,Math.min(Mt,Ct))},[o,w]),$i=l.useCallback((d=!1)=>{d&&(Ce.current=!0),ce.current===null&&(ce.current=requestAnimationFrame(()=>{ce.current=null;const h=Ce.current;Ce.current=!1,Yn(h)}))},[Yn]),Xo=l.useCallback(d=>{if(d===f.current)return;const h=f.current;f.current=d;const b=Math.abs(d-h)>1,V=at&&t.length>1&&(h===t.length-1&&d===0||h===0&&d===t.length-1);ue(d),$i(b||V)},[t.length,at,$i]),Xt=()=>{if(!Ge.current||t.length===0||vt.current!==null||Ze.current.isActive&&Ze.current.hasMoved)return;const d=Ge.current.scrollLeft,h=zt(d)%t.length;h!==f.current&&Xo(h)},Xi=()=>{vt.current=null},Yt=d=>{const h=Ge.current;h&&(h.style.scrollSnapType=d?"":"none")},un=()=>{var d;(d=Ot.current)==null||d.call(Ot),Ot.current=null},Tn=()=>{Ye.current!==null&&(cancelAnimationFrame(Ye.current),Ye.current=null),rt.current=!1},Fn=()=>{const d=Ge.current;if(!d){Ye.current=null,rt.current=!1;return}const h=it.current-d.scrollLeft;if(Math.abs(h)<.5){d.scrollLeft=it.current,Wt(),Xt(),Ye.current=null,rt.current=!1;return}d.scrollLeft+=h*Jm,Wt(),Xt(),Le(),Ye.current=requestAnimationFrame(Fn)},Wn=()=>{const d=Re.current;d&&(d.style.transition="",d.style.transform="",d.style.willChange="")},Yi=(d,h,b,V)=>{Wn(),d.scrollLeft=h,Oe.current=d.scrollLeft,Wt(),b!==void 0?(f.current=b,ue(b)):Xt(),Yt(!0),V==null||V()},Ji=(d,{behavior:h="smooth",activeIndex:b,onComplete:V}={})=>{const re=Ge.current,we=Re.current;if(!re||!we)return;if(Tn(),un(),Yt(!1),h==="auto"){Yi(re,d,b,V);return}const _e=Math.abs(d-re.scrollLeft),Ke=jm(_e,qm,Km,re.clientWidth*.55);Ot.current=Dm(re,we,d,{duration:Ke,easing:Gm,onComplete:()=>{Ot.current=null,Yi(re,d,b,V)}})},Yo=(d="smooth")=>{const h=Ge.current;if(!h||t.length===0)return;const b=zt()%t.length,V=cn(b,h.scrollLeft),re=He.current[V];re&&Ji(re.offsetLeft,{behavior:d,activeIndex:b})},Jo=(d,h="smooth",b,V)=>{const re=Ge.current;if(!re||t.length===0)return;const we=(V??re.scrollLeft)-d,_e=zt(d),Ke=He.current[_e];if(dn(Ke)){Yt(!0),Xt();return}const Mt=He.current[_e+1],Ct=Ke?Mt?Mt.offsetLeft-Ke.offsetLeft:Ke.offsetWidth:0;if((Ct>0?we>Ct*co?1:we<-Ct*co?-1:0:0)!==0){const al=b??_e%t.length,sl=Xn(V??re.scrollLeft,d,al);nn(sl,h);return}const Si=V??re.scrollLeft,eo=zt(Si),oa=He.current[eo];if(oa&&Math.abs(oa.offsetLeft-Si)<1){Yt(!0),Xt();return}Yo("auto")},nn=(d,h="smooth")=>{const b=Ge.current;if(!b||t.length===0)return;const V=cn(d,b.scrollLeft),re=He.current[V];re&&(h==="smooth"?vt.current=d:vt.current=null,f.current=d,ue(d),$i(!0),Ji(re.offsetLeft,{behavior:h,activeIndex:d,onComplete:h==="smooth"?Xi:void 0}))},Jn=()=>{kt.current&&(window.removeEventListener("pointerup",kt.current),window.removeEventListener("pointercancel",kt.current),kt.current=null)},Zi=(d,h,b,V,re)=>{const we=b-d,_e=V-h,Ke=Math.abs(we),Mt=Math.abs(_e);if(Ke<Qm||Ke<=Mt)return!1;const Ct=we<0?1:-1,Zn=at?(re+Ct+t.length)%t.length:Math.max(0,Math.min(t.length-1,re+Ct));return Zn===re?!1:(nn(Zn),!0)},Nn=d=>{if(!Ze.current.isActive)return;Jn();const h=Ge.current;if(!h)return;const{scrollLeft:b,startActiveIndex:V,hasMoved:re}=Ze.current,we=h.scrollLeft;Wt(!0),Ze.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},ot(!1),d!==void 0&&h.hasPointerCapture(d)&&h.releasePointerCapture(d),re?Jo(b,"smooth",V,we):(Yt(!0),Xt()),Le()},Qi=(d,h)=>{const b=It.current;It.current=null,b&&(Zi(b.startX,b.startY,d,h,b.startActiveIndex),Le())},Zo=d=>{if(!J)return;if(d.pointerType==="touch"){if(Tn(),Yt(!0),qe(d.target))return;It.current={startX:d.clientX,startY:d.clientY,startActiveIndex:f.current};return}if(d.pointerType!=="mouse"||d.button!==0||qe(d.target))return;const h=Ge.current;if(!h)return;Tn(),un(),Wn(),vt.current=null,Ze.current={isActive:!0,startX:d.clientX,scrollLeft:h.scrollLeft,startActiveIndex:f.current,hasMoved:!1},Yt(!1),Le(),h.setPointerCapture(d.pointerId),Jn();const b=V=>{V.pointerType==="mouse"&&Nn(V.pointerId)};kt.current=b,window.addEventListener("pointerup",b),window.addEventListener("pointercancel",b)},Qo=d=>{if(!J||d.pointerType!=="mouse")return;const h=Ge.current;if(!h||!Ze.current.isActive)return;if(d.buttons===0){Nn(d.pointerId);return}const b=d.clientX-Ze.current.startX;Math.abs(b)>Zm&&(Ze.current.hasMoved=!0,ot(!0)),Ze.current.hasMoved&&(d.preventDefault(),h.scrollLeft=Ze.current.scrollLeft-b,Wt(!0),Xt(),Le())},k=d=>{if(J){if(d.pointerType==="touch"){d.type==="pointerup"?Qi(d.clientX,d.clientY):It.current=null;return}d.pointerType==="mouse"&&Nn(d.pointerId)}},de=d=>{!J||d.pointerType!=="mouse"||Nn(d.pointerId)};return tl(),l.useEffect(()=>{const d=requestAnimationFrame(()=>Ut(!0));return()=>{cancelAnimationFrame(d),un(),Jn(),ce.current!==null&&(cancelAnimationFrame(ce.current),ce.current=null),We.current&&clearTimeout(We.current),et.current&&clearTimeout(et.current)}},[]),l.useEffect(()=>{if(!ie){yt(!0);return}Le();const d=Lt.current;if(!d)return;const h=()=>Le();return d.addEventListener("pointermove",h),d.addEventListener("pointerdown",h),()=>{d.removeEventListener("pointermove",h),d.removeEventListener("pointerdown",h),et.current&&clearTimeout(et.current)}},[ie,Le]),l.useEffect(()=>{const d=h=>{h.key==="Escape"&&Qe()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[Qe]),l.useLayoutEffect(()=>{Bt()},[O,t.length,at]),l.useLayoutEffect(()=>{o||nn(f.current,"auto")},[O,o]),l.useLayoutEffect(()=>{nn(0,"auto")},[t.length,at]),l.useEffect(()=>{const d=Ge.current;if(!d||o||!te)return;const h=b=>{if(b.preventDefault(),Math.abs(b.deltaY)<=Math.abs(b.deltaX))return;const V=b.deltaMode===1?Ym:b.deltaMode===2?d.clientHeight:1,re=b.deltaY*V*Xm;if(re!==0){if(un(),rt.current||(rt.current=!0,it.current=d.scrollLeft,vt.current=null,Yt(!1)),it.current+=re,!at){const we=d.scrollWidth-d.clientWidth;it.current=Math.max(0,Math.min(we,it.current))}Le(),Ye.current===null&&(Ye.current=requestAnimationFrame(Fn))}};return d.addEventListener("wheel",h,{passive:!1}),()=>{d.removeEventListener("wheel",h),Tn()}},[o,te,at]),l.useEffect(()=>{const d=Ge.current;if(!d)return;const h=()=>{Wt(Ze.current.isActive);const V=d.scrollLeft,re=V-Oe.current;Oe.current=V;const we=ut.current>0?ut.current*.5:1/0;if(re!==0&&Math.abs(re)<we){const _e=re>0?"forward":"backward";_e!==gt.current&&(gt.current=_e,Cn(_e))}Ze.current.isActive&&Ze.current.hasMoved||Xt()};d.addEventListener("scroll",h,{passive:!0});const b=new ResizeObserver(()=>{Bt(),Wt(Ze.current.isActive),Cn(gt.current),Xt()});return b.observe(d),()=>{un(),d.removeEventListener("scroll",h),b.disconnect()}},[t.length,at]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{nt||Qe()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:tn?1:0,transition:`opacity ${Pi}ms ease`,pointerEvents:tn?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:u,...Et}}),r.jsxs("div",{ref:Lt,className:`${e}-lightbox-dismiss-area`,style:ht,...$n,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:St,onClick:d=>d.stopPropagation(),children:r.jsx("div",{ref:Ge,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":J&&t.length>0?"true":"false","data-mouse-dragging":ln?"true":"false",onPointerDown:Zo,onPointerMove:Qo,onPointerUp:k,onPointerCancel:k,onLostPointerCapture:de,children:r.jsx("div",{ref:Re,className:`${e}-lightbox-strip-track`,style:{gap:O},children:wn.map((d,h)=>{const b=d.image.objectFit??"contain",V=h%t.length,re=Math.floor(h/t.length),we=uo(O),_e=`calc(-0.5 * (${we} + ${O}))`;return r.jsxs("div",{ref:Ke=>He.current[h]=Ke,className:`${e}-strip-item`,style:{height:N==="mobile"?"75vh":"100%"},children:[r.jsx("img",{src:d.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:b}}),o&&V<t.length-1&&re===0&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:_e,width:we,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${re}-${d.image.url}-${V}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":$t?"true":"false",style:_t,children:[r.jsx("div",{style:{position:"relative",width:"100%",height:Y,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:ae,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:(Ee||x)&&r.jsx("div",{className:`${e}-header ${be?`${e}-header-two-row`:`${e}-header-single-row`}`,children:be?pt():Ee||x?Rt():null})})})]}),t.length>1&&w==="on"&&(()=>{const d=uo(q),h=`calc(-0.5 * (${q} + ${d}))`;return r.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:q},children:r.jsx("div",{ref:Be,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:b=>b.stopPropagation(),children:r.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":T,style:{gap:Z,"--thumbnail-active-color":F},children:[t.map((b,V)=>{const re=uo(Z),we=`calc(-0.5 * (${re} + ${Z}))`;return r.jsxs("div",{ref:_e=>{Ue.current[V]=_e},style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":H===V?"true":"false",onClick:()=>te&&C==="click"&&nn(V),onMouseEnter:()=>xe&&C==="hover"&&nn(V),"aria-label":b.image.name?`View ${b.image.name}`:`View image ${V+1}`,"aria-current":H===V?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${Se?` ${e}-thumb-image-cover`:""}`,src:b.image.url,alt:"",draggable:!1,style:{...ve,maxWidth:B,maxHeight:B,width:E.display==="cover"?"auto":"100%",height:"auto",objectFit:E.display==="cover"?"cover":"contain"}})}),o&&V<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:we,width:re,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${b.image.url}-${V}`)}),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:h,height:d,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function ug(e){return`
|
|
10151
10229
|
.${e}-wrapper {
|
|
10152
10230
|
position: relative;
|
|
10153
10231
|
width: 100%;
|
|
@@ -10539,7 +10617,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
10539
10617
|
pointer-events: auto;
|
|
10540
10618
|
z-index: 10;
|
|
10541
10619
|
}
|
|
10542
|
-
`}const
|
|
10620
|
+
`}const pg=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:s})=>{const{prefix:a}=I.useScopedStyles(),{cover:u,coverFit:c}=e,m=l.useRef(null),[p,P]=l.useState(!1),x=t??[],$=p&&x.length>0,g=()=>{x.length!==0&&P(!0)};return l.useEffect(()=>{!n||i||o||P(!1)},[n,i,o]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:m,className:`${a}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ug(a)}}),u&&r.jsx("div",{className:`${a}-cover ${vn(c)?`${a}-ratio-wrapper-cover`:`${a}-ratio-wrapper-fit`}`,onClick:()=>g(),style:{...vn(c)?{"--image-aspect-ratio":Ko(c)}:{}},"aria-label":"Open image gallery",children:r.jsx("img",{className:`${a}-cover-image ${vn(c)?`${a}-cover-image-cover`:`${a}-cover-image-fit`}`,src:u,alt:"cover"})})]}),$&&typeof document<"u"&&(()=>{const y=(s?document.getElementById(s):null)??document.body;return Bi.createPortal(r.jsx(dg,{prefix:a,images:x,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:()=>P(!1)}),y)})()]})},mg=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
|
|
10543
10621
|
import { createPortal } from 'react-dom';
|
|
10544
10622
|
import { CommonComponentProps } from '../props';
|
|
10545
10623
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -11093,7 +11171,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
11093
11171
|
</>
|
|
11094
11172
|
);
|
|
11095
11173
|
};
|
|
11096
|
-
`,pg="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>'),zn={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 mg(e){const t={};return t[lt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[lt(e,"fontSettings")]={...zn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[lt(e,"fontSize")]={...zn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[lt(e,"lineHeight")]={...zn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[lt(e,"letterSpacing")]={...zn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[lt(e,"wordSpacing")]={...zn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[lt(e,"textAlign")]={...zn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[lt(e,"textAppearance")]={...zn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const gg=hi.reduce((e,t)=>({...e,...mg(t)}),{}),hg=hi.reduce((e,t)=>({...e,[lt(t,"fontFamily")]:"Goudy Bookletter 1911",[lt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[lt(t,"letterSpacing")]:0,[lt(t,"wordSpacing")]:0,[lt(t,"textAlign")]:"left",[lt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ts(e){return hi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[lt(n,"fontSize")]=i),o!==void 0&&(t[lt(n,"lineHeight")]=o),t},{})}const fg=rg(),yg={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"}},...gg,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:pg,closeIconColor:"#000000",closeIconHoverColor:"#cccccc",thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",thumbnailActiveColor:"#ffffff",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",...hg},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,...ts({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,...ts({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:[fg]}],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"}]}},vg={element:dg,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:yg,sourceCode:ug,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...hi.map(e=>({path:`${lt(e,"fontFamily")}`}))]},fontRelations:{...hi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${lt(t,"fontFamily")}`}),{})}},bg=50,ns=10,ia="cntrl-lightbox-journal",Uo=ia,Ir=`${ia}-`,Xo=e=>`${ia}-${e}`,oa=e=>e===Uo||e.startsWith(Ir),is=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},os=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=is(t.get(Xo(e)));if(i)return i}const n=is(t.get(Uo));if(n)return n;for(const[i]of t){if(!i.startsWith(Ir))continue;const o=i.slice(Ir.length);if(!/^\d+$/.test(o))continue;const s=Number.parseInt(o,10);if(Number.isFinite(s)&&s>=1)return s}return null},rs=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},rl=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(a=>{oa(a)&&i.searchParams.delete(a)}),t?i.searchParams.set(Xo(t),String(e)):i.searchParams.set(Uo,String(e));const o=n?"replaceState":"pushState",s=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",s)},xg=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Xo(e)||i===Uo:oa(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)}},al=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Xo(e)):[...t.keys()].some(n=>oa(n))},wg=(e,t)=>{if(al(t)){if(e){window.history.back();return}xg(t)}},$g=20,Sg=2,fr=e=>`max(${e}, ${$g}px)`,fi=e=>((e==null?void 0:e.image)??[]).slice(0,Sg),sl=e=>e.reduce((t,n)=>t+fi(n).length,0),Cg=(e,t)=>{const n=e.slice(0,t).reduce((o,s)=>o+fi(s).length,1),i=fi(e[t]).length;return{start:n,end:n+i-1}},Tg=(e,t)=>{const n=sl(e),{start:i,end:o}=Cg(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Lo=(e,t)=>t==="B"?e.flatMap((n,i)=>fi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:fi(n)})),Lg=(e,t,n,i)=>{var s;if(n==="B")return`${t+1} / ${e.length}`;const o=((s=e[t])==null?void 0:s.entryIndex)??0;return Tg(i,o)},as=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Eg=(e,t,n)=>e==="B"?t.length>1:sl(n)>1,ti=.004,go=.004,yr={title1Width:.13,title2Width:.13,title3Width:.14},ho=(e,t,n,i,o)=>{const s=[];return t.title1&&s.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&s.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&s.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),s},Mo=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,a)=>s+a,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:a},u)=>{if(s<=0||u<=0)return{overflow:s,widths:[u,...a]};const c=Math.min(s,u);return{overflow:s-c,widths:[u-c,...a]}},{overflow:i-1,widths:[]});return o},Pr=(e,t)=>Mo(e,t),Vn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},fo=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Mo(e.length,n),effective:Pr(e.length,n)}},Ig=(e,t,n,i)=>e.slice(0,i).reduce((o,s,a)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[a]??0),0),Pg=(e,t,n,i)=>e.slice(0,i+1).reduce((o,s,a)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[a]??0),0),yi=["title1","title2","title3","count"],ct=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,kg={title1:"1",title2:"2",title3:"3",count:"Count"},Rg=e=>[ct(e,"fontFamily"),ct(e,"fontSettings"),{type:"row",items:[ct(e,"fontSize"),ct(e,"lineHeight"),ct(e,"letterSpacing"),ct(e,"wordSpacing")]},ct(e,"textAlign"),ct(e,"textAppearance")],Ag=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(yi.map(e=>[kg[e],Rg(e)]))}),Mg={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},_g={title1:.02,title2:.02,title3:.02,count:.017},yo=(e,t)=>{const n=i=>{const o=ct(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[Mg[t]]}},vo=(e,t,n)=>{var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??_g[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return At(i,n)},Fg=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,initialSlideIndex:a=0,enableUrlSync:u=!1,journalItemId:c=null,onBeforeClose:m,onClose:p})=>{const{type:b,coverFit:w,backgroundColor:S,imageGap:g,maxWidth:v,maxHeight:T,textTransition:$,title1Width:C,title2Width:L,title3Width:A,title1MarginLeft:k=0,title2MarginLeft:F=0,title3MarginLeft:I=0,titleRowMarginBottom:E=0,titleHeaderLayout:J="single-row",countCloseGap:y=0,closeIcon:_,closeIconMaxWidth:W,closeIconColor:G,closeIconHoverColor:te,contentMarginTop:ue=0,iconMarginRight:X=0}=n,H=l.useCallback(M=>P.scalingValue(M,i??!1),[i]),Q=H(g??0),z=`${v}%`,B=`${T}%`,Y=H(y),oe=H(ue),ie=H(X),O=vo("title1",yo(n,"title1"),i),ce=vo("title2",yo(n,"title2"),i),f=vo("title3",yo(n,"title3"),i),de=vo("count",yo(n,"count"),i),be=J==="mobile",fe=!i||!!s,Re=!o&&(!i||!!s),Z=l.useMemo(()=>Lo(t,b),[t,b]),[ge,U]=l.useState(a),V=Z[ge],j=V==null?void 0:V.entry,[he,re]=l.useState(!1),[Ce,Se]=l.useState(null),[we,Ie]=l.useState(!1),[N,ee]=l.useState(null),[R,K]=l.useState(!1),[D,ae]=l.useState(0),[ne,ye]=l.useState(),[ke,Te]=l.useState(),[xe,Ke]=l.useState(null),se=l.useRef(null),Ae=l.useRef(0),Ne=l.useRef(0),He=l.useRef(0),dt=l.useRef(!1),ft=l.useRef(null),It=l.useRef(null),xt=l.useRef(null),wt=l.useRef(null),Ht=l.useRef(null),Lt=l.useRef(null),Xe=l.useRef(null),Me=l.useCallback(()=>{const M=It.current;if(!M)return;const me=M.closest(`.${e}-lightbox-content-area`);if(!me)return M.getBoundingClientRect().width;const d=Array.from(me.children).reduce((h,x)=>!(x instanceof HTMLElement)||x.contains(M)?h:h+x.getBoundingClientRect().width,0);return me.getBoundingClientRect().width-d},[e]),Ve=l.useCallback(()=>{se.current&&(clearTimeout(se.current),se.current=null)},[]),Ye=l.useCallback(M=>{M===Ae.current&&(ee(null),K(!1))},[]),Be=l.useCallback(()=>{o||dt.current||(dt.current=!0,m==null||m(),re(!1),ft.current=setTimeout(()=>{p()},300))},[o,m,p]),ut=l.useCallback(M=>!!(M.closest("[data-controls]")||M.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:Pt,backdropStyle:Qe,mediaAreaStyle:Mt,overlayContentStyle:Ot,swipeHandlers:je,dismissAreaStyle:gt}=nl({enabled:Re,onClose:Be,animMs:300,isBlockedTarget:ut}),it=l.useCallback(M=>{u&&rl(M+1,c,!0)},[u,c]),Ze=l.useCallback(M=>{if(M)return M.getBoundingClientRect().height},[]),rt=l.useCallback(M=>{if(Z.length===0)return;const me=(M%Z.length+Z.length)%Z.length;if(me===ge)return;const d=Z[ge],h=Z[me];Ae.current+=1;const x=Ae.current,q=$==="fade"&&as(d==null?void 0:d.entry)!==as(h==null?void 0:h.entry),le=Ze(xt.current),$e=q?(()=>{const Ue=Me();ji.flushSync(()=>{Ke(h.entry)}),xt.current&&Ue&&(xt.current.style.width=`${Ue}px`);const Rt=Ze(xt.current);return xt.current&&(xt.current.style.width=""),{measuredIncomingTitlesHeight:Rt,incomingTitlesMeasureWidth:Ue}})():void 0,Fe=Math.max(le??0,($e==null?void 0:$e.measuredIncomingTitlesHeight)??0)||void 0;ae(x),ee(ge),K(!0),U(me),it(me),He.current=me,q?(Ve(),Fe&&ye(Fe),$e!=null&&$e.incomingTitlesMeasureWidth&&Te($e.incomingTitlesMeasureWidth),Se((d==null?void 0:d.entryIndex)??null),Ie(!0),Ne.current=h.entryIndex,se.current=setTimeout(()=>{Se(null),Ie(!1),ye(void 0),Te(void 0),Ke(null),se.current=null},400)):(Ve(),Se(null),Ie(!1),ye(void 0),Te(void 0),Ke(null),Ne.current=h.entryIndex)},[ge,Ve,Me,Ze,Z,it,$]),at=l.useCallback(()=>{Xe.current=null},[]),sn=l.useCallback(M=>{!fe||Z.length<=1||M.pointerType==="mouse"&&M.button!==0||M.target.closest("[data-controls]")||(Xe.current={startX:M.clientX,startY:M.clientY,pointerId:M.pointerId})},[fe,Z.length]),wn=l.useCallback(M=>{var Ue;if(!fe||Z.length<=1||M.pointerType==="mouse"&&M.button!==0)return;if(Pt){at();return}const me=Xe.current;if(!me||me.pointerId!==M.pointerId||(at(),M.target.closest("[data-controls]")))return;const h=M.clientX-me.startX,x=M.clientY-me.startY,q=Math.abs(h),le=Math.abs(x);if(q>=bg&&q>le){rt(h>0?ge-1:ge+1);return}if(q>ns||le>ns)return;const $e=(Ue=wt.current)==null?void 0:Ue.getBoundingClientRect(),Fe=$e?$e.left+$e.width/2:window.innerWidth/2;rt(M.clientX<Fe?ge-1:ge+1)},[ge,fe,rt,Pt,at,Z.length]),ln=l.useCallback(M=>{const me=Xe.current;(me==null?void 0:me.pointerId)===M.pointerId&&at()},[at]);il(),l.useEffect(()=>{Lt.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const M=requestAnimationFrame(()=>{re(!0),requestAnimationFrame(()=>{Ht.current?Ht.current.focus():wt.current&&wt.current.focus()})});return()=>{cancelAnimationFrame(M),ft.current&&clearTimeout(ft.current),se.current&&clearTimeout(se.current);const me=Lt.current;me&&document.contains(me)&&me.focus()}},[]),l.useEffect(()=>{var M;$!=="fade"&&(Ne.current=((M=Z[ge])==null?void 0:M.entryIndex)??0,Ve(),Se(null),Ie(!1),ye(void 0),Te(void 0))},[ge,Ve,Z,$]),l.useEffect(()=>{const M=me=>{if(me.key==="Escape"){Be();return}if(me.key==="ArrowLeft"&&Z.length>1){rt(ge-1);return}if(me.key==="ArrowRight"&&Z.length>1){rt(ge+1);return}if(me.key==="Tab"&&wt.current){const d=wt.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),h=Array.from(d).filter($e=>!$e.closest('[aria-hidden="true"]'));if(h.length===0)return;const x=h[0],q=h[h.length-1],le=document.activeElement;me.shiftKey?(le===x||!wt.current.contains(le))&&(me.preventDefault(),q.focus()):(le===q||!wt.current.contains(le))&&(me.preventDefault(),x.focus())}};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[rt,Be,ge,Z.length]),l.useLayoutEffect(()=>{Ve(),Ae.current=0,ae(0),ee(null),K(!1),Se(null),Ie(!1),ye(void 0),Te(void 0),Ke(null),U(M=>{const me=Math.max(0,Z.length-1);return Math.min(M,me)})},[Ve,t.length,b,Z.length]),l.useLayoutEffect(()=>{var d;const M=Math.max(0,Z.length-1),me=Math.min(Math.max(0,a),M);He.current=me,Ne.current=((d=Z[me])==null?void 0:d.entryIndex)??0,U(me)},[a]);const ot=Ce!==null?t[Ce]:null,tn=N!==null?Z[N]:null,Ut=(j==null?void 0:j.title1)||(j==null?void 0:j.title2)||(j==null?void 0:j.title3)||(ot==null?void 0:ot.title1)||(ot==null?void 0:ot.title2)||(ot==null?void 0:ot.title3),qe=Eg(b,Z,t),yt=_!==null,vt=Ut||qe||yt,pe=qe&&yt?{gap:Y}:void 0,Le=`${e}-titles-stack${be?` ${e}-titles-stack-stacked`:""}`,_e=`${e}-titles-layer-out${be?` ${e}-titles-layer-out-stacked`:""}`,We=`${e}-titles-layer-out`,tt=(k??0)>0||o,$t=H(E),Ee=l.useMemo(()=>({title1Width:C??yr.title1Width,title2Width:L??yr.title2Width,title3Width:A??yr.title3Width}),[C,L,A]),et=l.useMemo(()=>({title2MarginLeft:F,title3MarginLeft:I}),[F,I]),De=l.useMemo(()=>j?ho(e,j,O,ce,f):[],[e,j,O,ce,f]),st=l.useMemo(()=>De.map(M=>Ee[M.widthKey]),[De,Ee]),pt=l.useMemo(()=>Mo(De.length,st),[De.length,st]),kt=l.useMemo(()=>Pr(De.length,st),[De.length,st]),Ge=l.useMemo(()=>De.filter(M=>M.prefix==="title1"),[De]),nt=l.useMemo(()=>De.filter(M=>M.prefix==="title2"||M.prefix==="title3"),[De]),Et=l.useMemo(()=>fo(Ge,Ee),[Ge,Ee]),St=l.useMemo(()=>fo(nt,Ee),[nt,Ee]),_t=l.useCallback((M,me)=>{const d=De.findIndex(x=>x.prefix===M.prefix);if(!be||me==="single-row")return{effectiveWidth:kt[d]??0,resolvedWidth:pt[d]??0,maxWidth:Vn(d,pt)};if(me==="two-row-top"){const x=Ge.findIndex(q=>q.prefix===M.prefix);return{effectiveWidth:Et.effective[x]??0,resolvedWidth:Et.resolved[x]??0,maxWidth:Vn(x,Et.resolved)}}const h=nt.findIndex(x=>x.prefix===M.prefix);return{effectiveWidth:St.effective[h]??0,resolvedWidth:St.resolved[h]??0,maxWidth:Vn(h,St.resolved)}},[De,nt,St,kt,pt,Ge,Et,be]),$n=l.useCallback(M=>Pg(De,pt,et,M)+(be?0:k??0),[De,pt,et,be,k]),ht=l.useCallback(()=>be?0:k??0,[be,k]),Bt=l.useCallback(M=>nt.slice(0,M).reduce((me,d,h)=>me+(d.marginLeftKey?et[d.marginLeftKey]??0:0)+(St.resolved[h]??0),0),[nt,St.resolved,et]),Wt=l.useCallback(M=>{const me=nt[M];return Bt(M)+(me.marginLeftKey?et[me.marginLeftKey]??0:0)+(St.resolved[M]??0)},[nt,St.resolved,Bt,et]),cn=l.useCallback((M,me,d)=>{if(!be||d==="single-row"){const $e=M.findIndex(Ct=>Ct.prefix===me.prefix),Fe=M.map(Ct=>Ee[Ct.widthKey]),Ue=Mo(M.length,Fe);return{effectiveWidth:Pr(M.length,Fe)[$e]??0,resolvedWidth:Ue[$e]??0,maxWidth:Vn($e,Ue)}}if(d==="two-row-top"){const $e=M.filter(Ct=>Ct.prefix==="title1"),Fe=$e.findIndex(Ct=>Ct.prefix===me.prefix),{resolved:Ue,effective:Rt}=fo($e,Ee);return{effectiveWidth:Rt[Fe]??0,resolvedWidth:Ue[Fe]??0,maxWidth:Vn(Fe,Ue)}}const h=M.filter($e=>$e.prefix==="title2"||$e.prefix==="title3"),x=h.findIndex($e=>$e.prefix===me.prefix),{resolved:q,effective:le}=fo(h,Ee);return{effectiveWidth:le[x]??0,resolvedWidth:q[x]??0,maxWidth:Vn(x,q)}},[Ee,be]),Sn=(M,me,d)=>{const h=M.marginLeftKey?et[M.marginLeftKey]??0:0,{effectiveWidth:x,resolvedWidth:q,maxWidth:le}=d??_t(M,me),$e=Math.max(h,go),Fe=o&&me==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":M.prefix,style:{width:H(x),...h>0?{marginLeft:H(h)}:{}},children:[r.jsx("p",{className:M.className,style:M.style,children:M.text}),Fe&&M.marginLeftKey?r.jsx("div",{"data-controls":M.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(q),style:{position:"absolute",top:0,left:H(-h),width:H($e),height:"100%",pointerEvents:"auto"}}):null,Fe?r.jsx("div",{"data-controls":M.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(le),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:H(-ti/2),width:H(ti),height:"100%",pointerEvents:"auto"}}):null]},M.className)},dn=(M="two-row")=>{const me=De.findIndex(x=>x.prefix==="title1"),d=me>=0?pt[me]:Ee.title1Width,h=M==="two-row"&&o;return r.jsx("div",{...h?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(d)}:{},style:{width:H(k??0),flexShrink:0,alignSelf:"stretch",...h?{pointerEvents:"auto"}:{}}})},zt=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:O,"aria-hidden":"true",children:" "}),Cn=()=>r.jsx("span",{className:`${e}-entry-counter`,style:de,"aria-live":"polite","aria-atomic":"true",children:Lg(Z,ge,b,t)}),Xn=()=>qe?o&&yt?r.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Cn(),r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${fr(Y)} + ${Y}))`,width:fr(Y),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Cn():null,Yn=()=>!qe&&!yt?null:r.jsxs("div",{className:`${e}-titles-row-header-controls`,style:pe,children:[Xn(),yt?Xt():null]}),$i=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[qe||Ut?zt():null,tt?dn("single-row"):null,Yt(j),r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),Yn(),nn()]}),Yo=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[qe||Ut?zt():null,tt?dn("single-row"):null,r.jsxs("div",{className:`${e}-titles-row-titles`,style:we&&ne?{minHeight:ne}:void 0,children:[r.jsx("div",{ref:xt,className:Le,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Wn(xe||j)}),r.jsxs("div",{ref:It,className:Le,style:{position:we?"absolute":"relative",inset:we?0:void 0,width:"100%",...we&&ke?{width:ke,maxWidth:"100%"}:void 0},children:[ot&&we?r.jsx("div",{className:`${_e} ${e}-titles-fade-out`,children:Wn(ot)}):null,r.jsx("div",{className:`${e}-titles-layer-in${we?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:Wn(j)})]})]}),Yn(),nn()]}),Xt=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:P.scalingValue(W??0,i),height:P.scalingValue(W??0,i),marginRight:ie,"--close-icon-hover-color":te},children:[r.jsx("button",{ref:Ht,type:"button",className:`${e}-close-icon-inner`,onClick:Be,"aria-label":"Close",children:r.jsx(Qt,{url:_??"",fill:G,hoverFill:i&&!s?G:te,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:ie,height:"100%",pointerEvents:"auto"}})]}),Yi=(M,me)=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[qe||Ut?zt():null,tt?dn("two-row"):null,me!==void 0?r.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:me},children:M}):r.jsxs(r.Fragment,{children:[M,r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),Yn()]}),Yt=M=>{if(!M)return null;const me=ho(e,M,O,ce,f);return r.jsx(r.Fragment,{children:me.map(d=>Sn(d,"single-row",cn(me,d,"single-row")))})},un=M=>{if(!M)return null;const me=ho(e,M,O,ce,f),d=me.find(h=>h.prefix==="title1");return d?Sn(d,"two-row-top",cn(me,d,"two-row-top")):null},Tn=(M,me=!1)=>{const d=M?ho(e,M,O,ce,f):[],h=d.filter(le=>le.prefix==="title2"||le.prefix==="title3"),x=o&&me;return h.length>0||x||(E??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[h.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[h.map(le=>Sn(le,"two-row-bottom",cn(d,le,"two-row-bottom"))),me&&o?r.jsxs(r.Fragment,{children:[Jo(),Zo()]}):null]}):null,(E??0)>0||x?r.jsx("div",{"data-controls":x?"titleRowMarginBottom":void 0,"data-controls-axis":x?"y":void 0,"data-controls-reverse":x?"":void 0,className:x?`${e}-control`:void 0,style:{height:$t,width:"100%",flexShrink:0,pointerEvents:x?"auto":"none"}}):null]}):null},Fn=(M,me=!1)=>r.jsxs(r.Fragment,{children:[Yi(un(M)),Tn(M,me)]}),Wn=M=>be?r.jsx("div",{className:`${e}-titles-row-two-row`,children:Fn(M)}):M?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Yt(M)}):null,Ji=()=>{const M=be?-1:De.findIndex(h=>h.prefix==="title1"),me=!be&&(o||(k??0)>0)?(()=>{const h=k??0,x=M>=0?pt[M]:Ee.title1Width,q=Math.max(h,go);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(x),style:{position:"absolute",top:0,left:0,width:H(q),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,d=De.flatMap((h,x)=>{if(!h.marginLeftKey)return[];const q=et[h.marginLeftKey]??0,le=Ig(De,pt,et,x)+ht(),$e=Math.max(q,go);return r.jsx("div",{"data-controls":h.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(pt[x]),style:{position:"absolute",top:0,left:H(le),width:H($e),height:"100%",pointerEvents:"auto"}},h.marginLeftKey)});return me?[me,...d]:d},Zi=()=>De.map((M,me)=>{const d=Vn(me,pt),x=$n(me)-ti/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":M.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(d),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:H(x),width:H(ti),height:"100%",pointerEvents:"auto"}})},`${M.widthKey}-junction`)}),Jo=()=>nt.flatMap((M,me)=>{if(!M.marginLeftKey)return[];const d=et[M.marginLeftKey]??0,h=Bt(me),x=Math.max(d,go),{resolvedWidth:q}=_t(M,"two-row-bottom");return r.jsx("div",{"data-controls":M.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(q),style:{position:"absolute",top:0,left:H(h),width:H(x),height:"100%",pointerEvents:"auto"}},M.marginLeftKey)}),Zo=()=>nt.map((M,me)=>{const{maxWidth:d}=_t(M,"two-row-bottom"),x=Wt(me)-ti/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":M.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(d),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:H(x),width:H(ti),height:"100%",pointerEvents:"auto"}})},`${M.widthKey}-junction`)}),nn=()=>!o||be?null:r.jsxs(r.Fragment,{children:[Ji(),Zi()]}),Jn=M=>{const me=!M.objectFit&&vn(w);return{className:`${e}-slide-image-cell${me?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:z,maxHeight:B,...me?{"--image-aspect-ratio":Go(w)}:{}}}},Qi=M=>M.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":M.objectFit}}:vn(w)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},Nn=M=>{if(M.length===0)return null;const me=M.length>1,d=fr(Q),h=`calc(-0.5 * (${d} + ${Q}))`;if(M.length===1){const x=M[0];return r.jsx("div",{...Jn(x),children:r.jsx("img",{...Qi(x),src:x.url,alt:x.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:me?{gap:Q}:void 0,children:M.map((x,q)=>r.jsxs("div",{...Jn(x),children:[r.jsx("img",{...Qi(x),src:x.url,alt:x.name??"",draggable:!1}),o&&me&&q<M.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:h,width:d,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${x.url}-${q}`))})},eo=!!(j!=null&&j.title2||j!=null&&j.title3||ot!=null&&ot.title2||ot!=null&&ot.title3||(E??0)>0||o),Qo=()=>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:xt,className:Le,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Fn(xe||j)}),r.jsxs("div",{ref:It,className:`${e}-titles-row-two-row`,style:{...we&&ne?{minHeight:ne}:void 0,...we&&ke?{width:ke,maxWidth:"100%"}:void 0},children:[Yi(r.jsxs("div",{className:Le,style:{position:we?"absolute":"relative",inset:we?0:void 0,width:"100%"},children:[ot&&we?r.jsx("div",{className:`${We} ${e}-titles-fade-out`,children:un(ot)}):null,r.jsx("div",{className:`${e}-titles-layer-in${we?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:un(j)})]}),we&&ne?ne:void 0),eo?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[ot&&we?r.jsx("div",{className:`${_e} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:Tn(ot)}):null,r.jsx("div",{className:`${e}-titles-layer-in${we?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${be?` ${e}-titles-layer-in-stacked`:""}`,children:Tn(j,!0)})]}):null]})]}),er=()=>{const M=eo;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...M?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:M?void 0:{flex:"0 0 auto",height:"auto"},children:Fn(j,!0)}),nn()]})};return r.jsxs("div",{ref:wt,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{Pt||Be()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:yt?void 0:-1,style:{opacity:he?1:0,transition:"opacity 300ms ease",pointerEvents:he?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:S,...Qe}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:gt,...je,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:Mt,onClick:M=>M.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":fe&&Z.length>1?"true":"false",onPointerDown:fe?sn:void 0,onPointerUp:fe?wn:void 0,onPointerCancel:fe?ln:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[tn&&R?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:M=>{M.target===M.currentTarget&&Ye(D)},children:r.jsx("div",{className:`${e}-slide-area`,children:Nn(tn.images)})},`slide-out-${D}`):null,r.jsx("div",{className:`${e}-slide-layer-in${R?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:V?Nn(V.images):null})},`slide-in-${D}-${ge}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Ot,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:oe,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...be?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${be?` ${e}-lightbox-content-area-stacked`:""}`,children:vt&&r.jsx("div",{className:`${e}-text-bar-cell${be?` ${e}-text-bar-cell-stacked`:""}`,style:be?void 0:{flex:1,minWidth:0,width:"100%"},children:be?$==="fade"?Qo():er():$==="fade"?Yo():$i()})})})]})]})]})};function Wg(e){return`
|
|
11174
|
+
`,gg="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>'),zn={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 hg(e){const t={};return t[lt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[lt(e,"fontSettings")]={...zn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[lt(e,"fontSize")]={...zn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[lt(e,"lineHeight")]={...zn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[lt(e,"letterSpacing")]={...zn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[lt(e,"wordSpacing")]={...zn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[lt(e,"textAlign")]={...zn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[lt(e,"textAppearance")]={...zn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const fg=hi.reduce((e,t)=>({...e,...hg(t)}),{}),yg=hi.reduce((e,t)=>({...e,[lt(t,"fontFamily")]:"Goudy Bookletter 1911",[lt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[lt(t,"letterSpacing")]:0,[lt(t,"wordSpacing")]:0,[lt(t,"textAlign")]:"left",[lt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ts(e){return hi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[lt(n,"fontSize")]=i),o!==void 0&&(t[lt(n,"lineHeight")]=o),t},{})}const vg=sg(),bg={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"}},...fg,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:gg,closeIconColor:"#000000",closeIconHoverColor:"#cccccc",thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",thumbnailActiveColor:"#ffffff",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",...yg},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,...ts({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,...ts({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:[vg]}],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"}]}},xg={element:pg,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:bg,sourceCode:mg,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...hi.map(e=>({path:`${lt(e,"fontFamily")}`}))]},fontRelations:{...hi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${lt(t,"fontFamily")}`}),{})}},wg=50,ns=10,na="cntrl-lightbox-journal",Go=na,Er=`${na}-`,Uo=e=>`${na}-${e}`,ia=e=>e===Go||e.startsWith(Er),is=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},os=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=is(t.get(Uo(e)));if(i)return i}const n=is(t.get(Go));if(n)return n;for(const[i]of t){if(!i.startsWith(Er))continue;const o=i.slice(Er.length);if(!/^\d+$/.test(o))continue;const s=Number.parseInt(o,10);if(Number.isFinite(s)&&s>=1)return s}return null},rs=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},il=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(a=>{ia(a)&&i.searchParams.delete(a)}),t?i.searchParams.set(Uo(t),String(e)):i.searchParams.set(Go,String(e));const o=n?"replaceState":"pushState",s=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",s)},$g=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Uo(e)||i===Go:ia(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)}},ol=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Uo(e)):[...t.keys()].some(n=>ia(n))},Sg=(e,t)=>{if(ol(t)){if(e){window.history.back();return}$g(t)}},Cg=20,Tg=2,hr=e=>`max(${e}, ${Cg}px)`,fi=e=>((e==null?void 0:e.image)??[]).slice(0,Tg),rl=e=>e.reduce((t,n)=>t+fi(n).length,0),Lg=(e,t)=>{const n=e.slice(0,t).reduce((o,s)=>o+fi(s).length,1),i=fi(e[t]).length;return{start:n,end:n+i-1}},Eg=(e,t)=>{const n=rl(e),{start:i,end:o}=Lg(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},To=(e,t)=>t==="B"?e.flatMap((n,i)=>fi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:fi(n)})),Pg=(e,t,n,i)=>{var s;if(n==="B")return`${t+1} / ${e.length}`;const o=((s=e[t])==null?void 0:s.entryIndex)??0;return Eg(i,o)},as=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Ig=(e,t,n)=>e==="B"?t.length>1:rl(n)>1,ti=.004,mo=.004,fr={title1Width:.13,title2Width:.13,title3Width:.14},go=(e,t,n,i,o)=>{const s=[];return t.title1&&s.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&s.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&s.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),s},Ao=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,a)=>s+a,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:a},u)=>{if(s<=0||u<=0)return{overflow:s,widths:[u,...a]};const c=Math.min(s,u);return{overflow:s-c,widths:[u-c,...a]}},{overflow:i-1,widths:[]});return o},Pr=(e,t)=>Ao(e,t),Vn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},ho=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Ao(e.length,n),effective:Pr(e.length,n)}},Rg=(e,t,n,i)=>e.slice(0,i).reduce((o,s,a)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[a]??0),0),Mg=(e,t,n,i)=>e.slice(0,i+1).reduce((o,s,a)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[a]??0),0),yi=["title1","title2","title3","count"],ct=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Ag={title1:"1",title2:"2",title3:"3",count:"Count"},kg=e=>[ct(e,"fontFamily"),ct(e,"fontSettings"),{type:"row",items:[ct(e,"fontSize"),ct(e,"lineHeight"),ct(e,"letterSpacing"),ct(e,"wordSpacing")]},ct(e,"textAlign"),ct(e,"textAppearance")],_g=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(yi.map(e=>[Ag[e],kg(e)]))}),Fg={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Wg={title1:.02,title2:.02,title3:.02,count:.017},fo=(e,t)=>{const n=i=>{const o=ct(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[Fg[t]]}},yo=(e,t,n)=>{var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??Wg[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return At(i,n)},Ng=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,initialSlideIndex:a=0,enableUrlSync:u=!1,journalItemId:c=null,onBeforeClose:m,onClose:p})=>{const{type:P,coverFit:x,backgroundColor:$,imageGap:g,maxWidth:y,maxHeight:C,textTransition:w,title1Width:E,title2Width:T,title3Width:F,title1MarginLeft:M=0,title2MarginLeft:W=0,title3MarginLeft:_=0,titleRowMarginBottom:L=0,titleHeaderLayout:U="single-row",countCloseGap:v=0,closeIcon:R,closeIconMaxWidth:N,closeIconColor:D,closeIconHoverColor:ne,contentMarginTop:pe=0,iconMarginRight:K=0}=n,B=l.useCallback(k=>I.scalingValue(k,i??!1),[i]),Z=B(g??0),q=`${y}%`,O=`${C}%`,Y=B(v),ae=B(pe),oe=B(K),H=yo("title1",fo(n,"title1"),i),ue=yo("title2",fo(n,"title2"),i),f=yo("title3",fo(n,"title3"),i),me=yo("count",fo(n,"count"),i),fe=U==="mobile",ye=!i||!!s,Me=!o&&(!i||!!s),ee=l.useMemo(()=>To(t,P),[t,P]),[ge,X]=l.useState(a),be=ee[ge],te=be==null?void 0:be.entry,[ie,J]=l.useState(!1),[xe,Se]=l.useState(null),[ve,Ee]=l.useState(!1),[A,G]=l.useState(null),[S,j]=l.useState(!1),[z,Q]=l.useState(0),[se,Te]=l.useState(),[Fe,Ie]=l.useState(),[$e,tt]=l.useState(null),le=l.useRef(null),Ae=l.useRef(0),ze=l.useRef(0),Ve=l.useRef(0),dt=l.useRef(!1),ft=l.useRef(null),Pt=l.useRef(null),xt=l.useRef(null),wt=l.useRef(null),Ht=l.useRef(null),Lt=l.useRef(null),Ge=l.useRef(null),Re=l.useCallback(()=>{const k=Pt.current;if(!k)return;const de=k.closest(`.${e}-lightbox-content-area`);if(!de)return k.getBoundingClientRect().width;const d=Array.from(de.children).reduce((h,b)=>!(b instanceof HTMLElement)||b.contains(k)?h:h+b.getBoundingClientRect().width,0);return de.getBoundingClientRect().width-d},[e]),Be=l.useCallback(()=>{le.current&&(clearTimeout(le.current),le.current=null)},[]),Ue=l.useCallback(k=>{k===Ae.current&&(G(null),j(!1))},[]),He=l.useCallback(()=>{o||dt.current||(dt.current=!0,m==null||m(),J(!1),ft.current=setTimeout(()=>{p()},300))},[o,m,p]),ut=l.useCallback(k=>!!(k.closest("[data-controls]")||k.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:It,backdropStyle:Ze,mediaAreaStyle:kt,overlayContentStyle:Ot,swipeHandlers:Oe,dismissAreaStyle:gt}=el({enabled:Me,onClose:He,animMs:300,isBlockedTarget:ut}),it=l.useCallback(k=>{u&&il(k+1,c,!0)},[u,c]),Ye=l.useCallback(k=>{if(k)return k.getBoundingClientRect().height},[]),rt=l.useCallback(k=>{if(ee.length===0)return;const de=(k%ee.length+ee.length)%ee.length;if(de===ge)return;const d=ee[ge],h=ee[de];Ae.current+=1;const b=Ae.current,V=w==="fade"&&as(d==null?void 0:d.entry)!==as(h==null?void 0:h.entry),re=Ye(xt.current),we=V?(()=>{const Ke=Re();Bi.flushSync(()=>{tt(h.entry)}),xt.current&&Ke&&(xt.current.style.width=`${Ke}px`);const Mt=Ye(xt.current);return xt.current&&(xt.current.style.width=""),{measuredIncomingTitlesHeight:Mt,incomingTitlesMeasureWidth:Ke}})():void 0,_e=Math.max(re??0,(we==null?void 0:we.measuredIncomingTitlesHeight)??0)||void 0;Q(b),G(ge),j(!0),X(de),it(de),Ve.current=de,V?(Be(),_e&&Te(_e),we!=null&&we.incomingTitlesMeasureWidth&&Ie(we.incomingTitlesMeasureWidth),Se((d==null?void 0:d.entryIndex)??null),Ee(!0),ze.current=h.entryIndex,le.current=setTimeout(()=>{Se(null),Ee(!1),Te(void 0),Ie(void 0),tt(null),le.current=null},400)):(Be(),Se(null),Ee(!1),Te(void 0),Ie(void 0),tt(null),ze.current=h.entryIndex)},[ge,Be,Re,Ye,ee,it,w]),at=l.useCallback(()=>{Ge.current=null},[]),sn=l.useCallback(k=>{!ye||ee.length<=1||k.pointerType==="mouse"&&k.button!==0||k.target.closest("[data-controls]")||(Ge.current={startX:k.clientX,startY:k.clientY,pointerId:k.pointerId})},[ye,ee.length]),wn=l.useCallback(k=>{var Ke;if(!ye||ee.length<=1||k.pointerType==="mouse"&&k.button!==0)return;if(It){at();return}const de=Ge.current;if(!de||de.pointerId!==k.pointerId||(at(),k.target.closest("[data-controls]")))return;const h=k.clientX-de.startX,b=k.clientY-de.startY,V=Math.abs(h),re=Math.abs(b);if(V>=wg&&V>re){rt(h>0?ge-1:ge+1);return}if(V>ns||re>ns)return;const we=(Ke=wt.current)==null?void 0:Ke.getBoundingClientRect(),_e=we?we.left+we.width/2:window.innerWidth/2;rt(k.clientX<_e?ge-1:ge+1)},[ge,ye,rt,It,at,ee.length]),ln=l.useCallback(k=>{const de=Ge.current;(de==null?void 0:de.pointerId)===k.pointerId&&at()},[at]);tl(),l.useEffect(()=>{Lt.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const k=requestAnimationFrame(()=>{J(!0),requestAnimationFrame(()=>{Ht.current?Ht.current.focus():wt.current&&wt.current.focus()})});return()=>{cancelAnimationFrame(k),ft.current&&clearTimeout(ft.current),le.current&&clearTimeout(le.current);const de=Lt.current;de&&document.contains(de)&&de.focus()}},[]),l.useEffect(()=>{var k;w!=="fade"&&(ze.current=((k=ee[ge])==null?void 0:k.entryIndex)??0,Be(),Se(null),Ee(!1),Te(void 0),Ie(void 0))},[ge,Be,ee,w]),l.useEffect(()=>{const k=de=>{if(de.key==="Escape"){He();return}if(de.key==="ArrowLeft"&&ee.length>1){rt(ge-1);return}if(de.key==="ArrowRight"&&ee.length>1){rt(ge+1);return}if(de.key==="Tab"&&wt.current){const d=wt.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),h=Array.from(d).filter(we=>!we.closest('[aria-hidden="true"]'));if(h.length===0)return;const b=h[0],V=h[h.length-1],re=document.activeElement;de.shiftKey?(re===b||!wt.current.contains(re))&&(de.preventDefault(),V.focus()):(re===V||!wt.current.contains(re))&&(de.preventDefault(),b.focus())}};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[rt,He,ge,ee.length]),l.useLayoutEffect(()=>{Be(),Ae.current=0,Q(0),G(null),j(!1),Se(null),Ee(!1),Te(void 0),Ie(void 0),tt(null),X(k=>{const de=Math.max(0,ee.length-1);return Math.min(k,de)})},[Be,t.length,P,ee.length]),l.useLayoutEffect(()=>{var d;const k=Math.max(0,ee.length-1),de=Math.min(Math.max(0,a),k);Ve.current=de,ze.current=((d=ee[de])==null?void 0:d.entryIndex)??0,X(de)},[a]);const ot=xe!==null?t[xe]:null,tn=A!==null?ee[A]:null,Ut=(te==null?void 0:te.title1)||(te==null?void 0:te.title2)||(te==null?void 0:te.title3)||(ot==null?void 0:ot.title1)||(ot==null?void 0:ot.title2)||(ot==null?void 0:ot.title3),De=Ig(P,ee,t),yt=R!==null,vt=Ut||De||yt,ce=De&&yt?{gap:Y}:void 0,Ce=`${e}-titles-stack${fe?` ${e}-titles-stack-stacked`:""}`,ke=`${e}-titles-layer-out${fe?` ${e}-titles-layer-out-stacked`:""}`,We=`${e}-titles-layer-out`,et=(M??0)>0||o,$t=B(L),Le=l.useMemo(()=>({title1Width:E??fr.title1Width,title2Width:T??fr.title2Width,title3Width:F??fr.title3Width}),[E,T,F]),Qe=l.useMemo(()=>({title2MarginLeft:W,title3MarginLeft:_}),[W,_]),je=l.useMemo(()=>te?go(e,te,H,ue,f):[],[e,te,H,ue,f]),st=l.useMemo(()=>je.map(k=>Le[k.widthKey]),[je,Le]),pt=l.useMemo(()=>Ao(je.length,st),[je.length,st]),Rt=l.useMemo(()=>Pr(je.length,st),[je.length,st]),qe=l.useMemo(()=>je.filter(k=>k.prefix==="title1"),[je]),nt=l.useMemo(()=>je.filter(k=>k.prefix==="title2"||k.prefix==="title3"),[je]),Et=l.useMemo(()=>ho(qe,Le),[qe,Le]),St=l.useMemo(()=>ho(nt,Le),[nt,Le]),_t=l.useCallback((k,de)=>{const d=je.findIndex(b=>b.prefix===k.prefix);if(!fe||de==="single-row")return{effectiveWidth:Rt[d]??0,resolvedWidth:pt[d]??0,maxWidth:Vn(d,pt)};if(de==="two-row-top"){const b=qe.findIndex(V=>V.prefix===k.prefix);return{effectiveWidth:Et.effective[b]??0,resolvedWidth:Et.resolved[b]??0,maxWidth:Vn(b,Et.resolved)}}const h=nt.findIndex(b=>b.prefix===k.prefix);return{effectiveWidth:St.effective[h]??0,resolvedWidth:St.resolved[h]??0,maxWidth:Vn(h,St.resolved)}},[je,nt,St,Rt,pt,qe,Et,fe]),$n=l.useCallback(k=>Mg(je,pt,Qe,k)+(fe?0:M??0),[je,pt,Qe,fe,M]),ht=l.useCallback(()=>fe?0:M??0,[fe,M]),Bt=l.useCallback(k=>nt.slice(0,k).reduce((de,d,h)=>de+(d.marginLeftKey?Qe[d.marginLeftKey]??0:0)+(St.resolved[h]??0),0),[nt,St.resolved,Qe]),Wt=l.useCallback(k=>{const de=nt[k];return Bt(k)+(de.marginLeftKey?Qe[de.marginLeftKey]??0:0)+(St.resolved[k]??0)},[nt,St.resolved,Bt,Qe]),cn=l.useCallback((k,de,d)=>{if(!fe||d==="single-row"){const we=k.findIndex(Ct=>Ct.prefix===de.prefix),_e=k.map(Ct=>Le[Ct.widthKey]),Ke=Ao(k.length,_e);return{effectiveWidth:Pr(k.length,_e)[we]??0,resolvedWidth:Ke[we]??0,maxWidth:Vn(we,Ke)}}if(d==="two-row-top"){const we=k.filter(Ct=>Ct.prefix==="title1"),_e=we.findIndex(Ct=>Ct.prefix===de.prefix),{resolved:Ke,effective:Mt}=ho(we,Le);return{effectiveWidth:Mt[_e]??0,resolvedWidth:Ke[_e]??0,maxWidth:Vn(_e,Ke)}}const h=k.filter(we=>we.prefix==="title2"||we.prefix==="title3"),b=h.findIndex(we=>we.prefix===de.prefix),{resolved:V,effective:re}=ho(h,Le);return{effectiveWidth:re[b]??0,resolvedWidth:V[b]??0,maxWidth:Vn(b,V)}},[Le,fe]),Sn=(k,de,d)=>{const h=k.marginLeftKey?Qe[k.marginLeftKey]??0:0,{effectiveWidth:b,resolvedWidth:V,maxWidth:re}=d??_t(k,de),we=Math.max(h,mo),_e=o&&de==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":k.prefix,style:{width:B(b),...h>0?{marginLeft:B(h)}:{}},children:[r.jsx("p",{className:k.className,style:k.style,children:k.text}),_e&&k.marginLeftKey?r.jsx("div",{"data-controls":k.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(V),style:{position:"absolute",top:0,left:B(-h),width:B(we),height:"100%",pointerEvents:"auto"}}):null,_e?r.jsx("div",{"data-controls":k.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(re),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:B(-ti/2),width:B(ti),height:"100%",pointerEvents:"auto"}}):null]},k.className)},dn=(k="two-row")=>{const de=je.findIndex(b=>b.prefix==="title1"),d=de>=0?pt[de]:Le.title1Width,h=k==="two-row"&&o;return r.jsx("div",{...h?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(d)}:{},style:{width:B(M??0),flexShrink:0,alignSelf:"stretch",...h?{pointerEvents:"auto"}:{}}})},zt=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:H,"aria-hidden":"true",children:" "}),Cn=()=>r.jsx("span",{className:`${e}-entry-counter`,style:me,"aria-live":"polite","aria-atomic":"true",children:Pg(ee,ge,P,t)}),Xn=()=>De?o&&yt?r.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Cn(),r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${hr(Y)} + ${Y}))`,width:hr(Y),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Cn():null,Yn=()=>!De&&!yt?null:r.jsxs("div",{className:`${e}-titles-row-header-controls`,style:ce,children:[Xn(),yt?Xt():null]}),$i=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[De||Ut?zt():null,et?dn("single-row"):null,Yt(te),r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),Yn(),nn()]}),Xo=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[De||Ut?zt():null,et?dn("single-row"):null,r.jsxs("div",{className:`${e}-titles-row-titles`,style:ve&&se?{minHeight:se}:void 0,children:[r.jsx("div",{ref:xt,className:Ce,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Wn($e||te)}),r.jsxs("div",{ref:Pt,className:Ce,style:{position:ve?"absolute":"relative",inset:ve?0:void 0,width:"100%",...ve&&Fe?{width:Fe,maxWidth:"100%"}:void 0},children:[ot&&ve?r.jsx("div",{className:`${ke} ${e}-titles-fade-out`,children:Wn(ot)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ve?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:Wn(te)})]})]}),Yn(),nn()]}),Xt=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:I.scalingValue(N??0,i),height:I.scalingValue(N??0,i),marginRight:oe,"--close-icon-hover-color":ne},children:[r.jsx("button",{ref:Ht,type:"button",className:`${e}-close-icon-inner`,onClick:He,"aria-label":"Close",children:r.jsx(Qt,{url:R??"",fill:D,hoverFill:i&&!s?D:ne,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:oe,height:"100%",pointerEvents:"auto"}})]}),Xi=(k,de)=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[De||Ut?zt():null,et?dn("two-row"):null,de!==void 0?r.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:de},children:k}):r.jsxs(r.Fragment,{children:[k,r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),Yn()]}),Yt=k=>{if(!k)return null;const de=go(e,k,H,ue,f);return r.jsx(r.Fragment,{children:de.map(d=>Sn(d,"single-row",cn(de,d,"single-row")))})},un=k=>{if(!k)return null;const de=go(e,k,H,ue,f),d=de.find(h=>h.prefix==="title1");return d?Sn(d,"two-row-top",cn(de,d,"two-row-top")):null},Tn=(k,de=!1)=>{const d=k?go(e,k,H,ue,f):[],h=d.filter(re=>re.prefix==="title2"||re.prefix==="title3"),b=o&&de;return h.length>0||b||(L??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[h.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[h.map(re=>Sn(re,"two-row-bottom",cn(d,re,"two-row-bottom"))),de&&o?r.jsxs(r.Fragment,{children:[Yo(),Jo()]}):null]}):null,(L??0)>0||b?r.jsx("div",{"data-controls":b?"titleRowMarginBottom":void 0,"data-controls-axis":b?"y":void 0,"data-controls-reverse":b?"":void 0,className:b?`${e}-control`:void 0,style:{height:$t,width:"100%",flexShrink:0,pointerEvents:b?"auto":"none"}}):null]}):null},Fn=(k,de=!1)=>r.jsxs(r.Fragment,{children:[Xi(un(k)),Tn(k,de)]}),Wn=k=>fe?r.jsx("div",{className:`${e}-titles-row-two-row`,children:Fn(k)}):k?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Yt(k)}):null,Yi=()=>{const k=fe?-1:je.findIndex(h=>h.prefix==="title1"),de=!fe&&(o||(M??0)>0)?(()=>{const h=M??0,b=k>=0?pt[k]:Le.title1Width,V=Math.max(h,mo);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(b),style:{position:"absolute",top:0,left:0,width:B(V),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,d=je.flatMap((h,b)=>{if(!h.marginLeftKey)return[];const V=Qe[h.marginLeftKey]??0,re=Rg(je,pt,Qe,b)+ht(),we=Math.max(V,mo);return r.jsx("div",{"data-controls":h.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(pt[b]),style:{position:"absolute",top:0,left:B(re),width:B(we),height:"100%",pointerEvents:"auto"}},h.marginLeftKey)});return de?[de,...d]:d},Ji=()=>je.map((k,de)=>{const d=Vn(de,pt),b=$n(de)-ti/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":k.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(d),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:B(b),width:B(ti),height:"100%",pointerEvents:"auto"}})},`${k.widthKey}-junction`)}),Yo=()=>nt.flatMap((k,de)=>{if(!k.marginLeftKey)return[];const d=Qe[k.marginLeftKey]??0,h=Bt(de),b=Math.max(d,mo),{resolvedWidth:V}=_t(k,"two-row-bottom");return r.jsx("div",{"data-controls":k.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(V),style:{position:"absolute",top:0,left:B(h),width:B(b),height:"100%",pointerEvents:"auto"}},k.marginLeftKey)}),Jo=()=>nt.map((k,de)=>{const{maxWidth:d}=_t(k,"two-row-bottom"),b=Wt(de)-ti/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":k.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(d),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:B(b),width:B(ti),height:"100%",pointerEvents:"auto"}})},`${k.widthKey}-junction`)}),nn=()=>!o||fe?null:r.jsxs(r.Fragment,{children:[Yi(),Ji()]}),Jn=k=>{const de=!k.objectFit&&vn(x);return{className:`${e}-slide-image-cell${de?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:q,maxHeight:O,...de?{"--image-aspect-ratio":Ko(x)}:{}}}},Zi=k=>k.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":k.objectFit}}:vn(x)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},Nn=k=>{if(k.length===0)return null;const de=k.length>1,d=hr(Z),h=`calc(-0.5 * (${d} + ${Z}))`;if(k.length===1){const b=k[0];return r.jsx("div",{...Jn(b),children:r.jsx("img",{...Zi(b),src:b.url,alt:b.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:de?{gap:Z}:void 0,children:k.map((b,V)=>r.jsxs("div",{...Jn(b),children:[r.jsx("img",{...Zi(b),src:b.url,alt:b.name??"",draggable:!1}),o&&de&&V<k.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:h,width:d,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${b.url}-${V}`))})},Qi=!!(te!=null&&te.title2||te!=null&&te.title3||ot!=null&&ot.title2||ot!=null&&ot.title3||(L??0)>0||o),Zo=()=>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:xt,className:Ce,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Fn($e||te)}),r.jsxs("div",{ref:Pt,className:`${e}-titles-row-two-row`,style:{...ve&&se?{minHeight:se}:void 0,...ve&&Fe?{width:Fe,maxWidth:"100%"}:void 0},children:[Xi(r.jsxs("div",{className:Ce,style:{position:ve?"absolute":"relative",inset:ve?0:void 0,width:"100%"},children:[ot&&ve?r.jsx("div",{className:`${We} ${e}-titles-fade-out`,children:un(ot)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ve?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:un(te)})]}),ve&&se?se:void 0),Qi?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[ot&&ve?r.jsx("div",{className:`${ke} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:Tn(ot)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ve?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${fe?` ${e}-titles-layer-in-stacked`:""}`,children:Tn(te,!0)})]}):null]})]}),Qo=()=>{const k=Qi;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...k?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:k?void 0:{flex:"0 0 auto",height:"auto"},children:Fn(te,!0)}),nn()]})};return r.jsxs("div",{ref:wt,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{It||He()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:yt?void 0:-1,style:{opacity:ie?1:0,transition:"opacity 300ms ease",pointerEvents:ie?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:$,...Ze}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:gt,...Oe,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:kt,onClick:k=>k.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":ye&&ee.length>1?"true":"false",onPointerDown:ye?sn:void 0,onPointerUp:ye?wn:void 0,onPointerCancel:ye?ln:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[tn&&S?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:k=>{k.target===k.currentTarget&&Ue(z)},children:r.jsx("div",{className:`${e}-slide-area`,children:Nn(tn.images)})},`slide-out-${z}`):null,r.jsx("div",{className:`${e}-slide-layer-in${S?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:be?Nn(be.images):null})},`slide-in-${z}-${ge}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Ot,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:ae,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...fe?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${fe?` ${e}-lightbox-content-area-stacked`:""}`,children:vt&&r.jsx("div",{className:`${e}-text-bar-cell${fe?` ${e}-text-bar-cell-stacked`:""}`,style:fe?void 0:{flex:1,minWidth:0,width:"100%"},children:fe?w==="fade"?Zo():Qo():w==="fade"?Xo():$i()})})})]})]})]})};function Hg(e){return`
|
|
11097
11175
|
.${e}-wrapper {
|
|
11098
11176
|
position: relative;
|
|
11099
11177
|
width: 100%;
|
|
@@ -11627,7 +11705,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
11627
11705
|
pointer-events: auto;
|
|
11628
11706
|
z-index: 10;
|
|
11629
11707
|
}
|
|
11630
|
-
`}const
|
|
11708
|
+
`}const Og=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:s,metadata:a})=>{const{prefix:u}=I.useScopedStyles(),c=(a==null?void 0:a.itemId)??null,{cover:m,coverFit:p,type:P}=e,x=l.useRef(null),[$,g]=l.useState(!1),[y,C]=l.useState(0),w=l.useRef(!1),E=l.useRef(!1),T=l.useRef(!1),F=l.useMemo(()=>(t??[]).filter(v=>fi(v).length>0),[t]),M=$&&F.length>0,W=!n,_=l.useCallback(()=>{W&&(T.current=!0,Sg(E.current,c),E.current=!1)},[W,c]),L=(v=0)=>{if(F.length===0||n&&!i&&!o)return;const R=To(F,P),N=Math.max(0,Math.min(v,R.length-1));if(C(N),W){const D=ol();il(N+1,c,D),E.current=!D}g(!0)},U=l.useCallback(()=>{g(!1),T.current=!1},[]);return l.useEffect(()=>{!n||i||o||g(!1)},[n,i,o]),l.useEffect(()=>{if(!W||w.current)return;w.current=!0;const v=os(c);if(!v)return;const R=rs(v,To(F,P).length);R<0||(C(R),g(!0))},[F,c,W,P]),l.useEffect(()=>{if(!W)return;const v=()=>{if(T.current){T.current=!1,g(!1);return}const R=os(c);if(!R){g(!1);return}const N=rs(R,To(F,P).length);if(N<0){g(!1);return}E.current=!1,C(N),g(!0)};return window.addEventListener("popstate",v),()=>window.removeEventListener("popstate",v)},[F,c,W,P]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:x,className:`${u}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Hg(u)}}),m?r.jsx("button",{type:"button",className:`${u}-cover ${vn(p)?`${u}-ratio-wrapper-cover`:`${u}-ratio-wrapper-fit`}`,onClick:()=>L(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...vn(p)?{"--image-aspect-ratio":Ko(p)}:{}},"aria-label":"Open journal gallery",children:r.jsx("img",{className:`${u}-cover-image ${vn(p)?`${u}-cover-image-cover`:`${u}-cover-image-fit`}`,src:m,alt:"cover"})}):null]}),M&&typeof document<"u"&&(()=>{const v=(s?document.getElementById(s):null)??document.body;return Bi.createPortal(r.jsx(Ng,{prefix:u,entries:F,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:y,enableUrlSync:W,journalItemId:c,onBeforeClose:_,onClose:U}),v)})()]})},Bg=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
|
|
11631
11709
|
import { createPortal } from 'react-dom';
|
|
11632
11710
|
import { CommonComponentProps } from '../props';
|
|
11633
11711
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -12395,635 +12473,4 @@ export type LightboxJournalSettings = {
|
|
|
12395
12473
|
closeIconColor: string;
|
|
12396
12474
|
closeIconHoverColor: string;
|
|
12397
12475
|
};
|
|
12398
|
-
`,
|
|
12399
|
-
.${e}-wrapper {
|
|
12400
|
-
position: relative;
|
|
12401
|
-
width: 100%;
|
|
12402
|
-
height: 100%;
|
|
12403
|
-
overflow: hidden;
|
|
12404
|
-
}
|
|
12405
|
-
.${e}-background {
|
|
12406
|
-
position: absolute;
|
|
12407
|
-
inset: 0;
|
|
12408
|
-
z-index: 1;
|
|
12409
|
-
pointer-events: none;
|
|
12410
|
-
overflow: hidden;
|
|
12411
|
-
}
|
|
12412
|
-
.${e}-effect-image {
|
|
12413
|
-
width: 100%;
|
|
12414
|
-
height: 100%;
|
|
12415
|
-
object-fit: cover;
|
|
12416
|
-
display: block;
|
|
12417
|
-
}
|
|
12418
|
-
.${e}-stage {
|
|
12419
|
-
position: absolute;
|
|
12420
|
-
left: 50%;
|
|
12421
|
-
top: 50%;
|
|
12422
|
-
transform: translate(-50%, -50%) scale(var(--${e}-stage-scale, 1));
|
|
12423
|
-
overflow: hidden;
|
|
12424
|
-
}
|
|
12425
|
-
.${e}-foreground {
|
|
12426
|
-
z-index: 2;
|
|
12427
|
-
}
|
|
12428
|
-
.${e}-incoming {
|
|
12429
|
-
will-change: transform;
|
|
12430
|
-
}
|
|
12431
|
-
.${e}-incoming-next {
|
|
12432
|
-
z-index: 4;
|
|
12433
|
-
transition: transform var(--${e}-transition-ms) ease-in;
|
|
12434
|
-
}
|
|
12435
|
-
.${e}-incoming-prev {
|
|
12436
|
-
z-index: 4;
|
|
12437
|
-
transition: transform var(--${e}-transition-ms) ease-out;
|
|
12438
|
-
}
|
|
12439
|
-
.${e}-outgoing {
|
|
12440
|
-
will-change: transform;
|
|
12441
|
-
}
|
|
12442
|
-
.${e}-outgoing-next {
|
|
12443
|
-
z-index: 3;
|
|
12444
|
-
transition: transform var(--${e}-transition-ms) ease-in;
|
|
12445
|
-
}
|
|
12446
|
-
.${e}-outgoing-prev {
|
|
12447
|
-
z-index: 3;
|
|
12448
|
-
transition: transform var(--${e}-transition-ms) ease-out;
|
|
12449
|
-
}
|
|
12450
|
-
.${e}-outgoing-next .${e}-effect-image {
|
|
12451
|
-
transition: filter var(--${e}-transition-ms) ease-in;
|
|
12452
|
-
}
|
|
12453
|
-
.${e}-outgoing-prev .${e}-effect-image {
|
|
12454
|
-
transition: filter var(--${e}-transition-ms) ease-out;
|
|
12455
|
-
}
|
|
12456
|
-
.${e}-incoming .${e}-effect-image {
|
|
12457
|
-
transition: filter var(--${e}-transition-ms) ease;
|
|
12458
|
-
}
|
|
12459
|
-
.${e}-background .${e}-effect-image {
|
|
12460
|
-
transition: filter var(--${e}-transition-ms) ease;
|
|
12461
|
-
}
|
|
12462
|
-
.${e}-snap .${e}-incoming,
|
|
12463
|
-
.${e}-snap .${e}-outgoing,
|
|
12464
|
-
.${e}-snap .${e}-outgoing .${e}-effect-image,
|
|
12465
|
-
.${e}-snap .${e}-incoming .${e}-effect-image {
|
|
12466
|
-
transition: none !important;
|
|
12467
|
-
}
|
|
12468
|
-
.${e}-nav {
|
|
12469
|
-
position: absolute;
|
|
12470
|
-
top: 0;
|
|
12471
|
-
bottom: 0;
|
|
12472
|
-
width: 50%;
|
|
12473
|
-
z-index: 5;
|
|
12474
|
-
margin: 0;
|
|
12475
|
-
padding: 0;
|
|
12476
|
-
border: none;
|
|
12477
|
-
background: none;
|
|
12478
|
-
cursor: pointer;
|
|
12479
|
-
outline: none;
|
|
12480
|
-
-webkit-tap-highlight-color: transparent;
|
|
12481
|
-
}
|
|
12482
|
-
.${e}-nav-prev {
|
|
12483
|
-
left: 0;
|
|
12484
|
-
cursor: w-resize;
|
|
12485
|
-
}
|
|
12486
|
-
.${e}-nav-next {
|
|
12487
|
-
right: 0;
|
|
12488
|
-
cursor: e-resize;
|
|
12489
|
-
}
|
|
12490
|
-
.${e}-nav:focus,
|
|
12491
|
-
.${e}-nav:focus-visible {
|
|
12492
|
-
outline: none;
|
|
12493
|
-
}
|
|
12494
|
-
.${e}-editor .${e}-nav {
|
|
12495
|
-
cursor: default;
|
|
12496
|
-
pointer-events: none;
|
|
12497
|
-
}
|
|
12498
|
-
.${e}-foreground {
|
|
12499
|
-
pointer-events: none;
|
|
12500
|
-
}
|
|
12501
|
-
.${e}-image {
|
|
12502
|
-
width: 100%;
|
|
12503
|
-
height: 100%;
|
|
12504
|
-
object-fit: contain;
|
|
12505
|
-
display: block;
|
|
12506
|
-
pointer-events: none;
|
|
12507
|
-
}
|
|
12508
|
-
`}function Xg(e){return e==="blur"?Gg:e==="greyscale"?Kg:0}function Ci(e,t=1){const n=Xg(e)*Math.max(0,Math.min(1,t));return e==="greyscale"?`grayscale(${n}%)`:e==="blur"?`blur(${n/4}px)`:"none"}function ls(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function Yg(e,t){return t<=1?0:(e-1+t)%t}function Jg(e,t=1){return!e||e.height===0?t:e.width/e.height}function Zg(e,t,n,i,o){if(e<=0||t<=0)return{widthPercent:i,heightPercent:o};const s=e*i/100,a=t*o/100;let u=s,c=u/n;return c>a&&(c=a,u=c*n),{widthPercent:u/e*100,heightPercent:c/t*100}}function cs(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 ll(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function ds(e,t,n){return{...ll(e),[`--${n}-stage-scale`]:t}}function Qg(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 eh({settings:e,content:t,isEditor:n,isPreviewMode:i}){var Ie,N,ee,R,K,D,ae;const{prefix:o}=P.useScopedStyles(),s=l.useMemo(()=>Ug(o),[o]),{imageSize:a,maxWidth:u,maxHeight:c,transition:m=1e3,bgImage:p="greyscale"}=e,b=t??[],w=ls(b.length),[S,g]=l.useState(w.activeIndex),[v,T]=l.useState(w.backgroundIndex),[$,C]=l.useState(!1),[L,A]=l.useState(!1),[k,F]=l.useState(null),[I,E]=l.useState(null),[J,y]=l.useState(0),[_,W]=l.useState(1),[G,te]=l.useState("none"),[ue,X]=l.useState("next"),[H,Q]=l.useState({}),[z,B]=l.useState({width:0,height:0}),Y=l.useRef(null),oe=l.useRef(null),ie=!n||!!i,O=a??60,ce=Math.max(10,Math.min(100,u??O)),f=Math.max(10,Math.min(100,c??O)),de=Math.max(100,m),be=Ci(p),fe=l.useCallback(ne=>{const ye=Jg(ne?H[ne]:void 0);return Zg(z.width,z.height,ye,ce,f)},[z.height,z.width,H,f,ce]);l.useEffect(()=>{const ne=oe.current;if(!ne)return;const ye=new ResizeObserver(([ke])=>{const{width:Te,height:xe}=ke.contentRect;B({width:Te,height:xe})});return ye.observe(ne),()=>ye.disconnect()},[]),l.useEffect(()=>{const ne=(t??[]).map(ye=>{var ke;return(ke=ye.image)==null?void 0:ke.url}).filter(ye=>!!ye);Qg(ne,(ye,ke)=>{Q(Te=>{var xe,Ke;return((xe=Te[ye])==null?void 0:xe.width)===ke.width&&((Ke=Te[ye])==null?void 0:Ke.height)===ke.height?Te:{...Te,[ye]:ke}})})},[t]),l.useEffect(()=>{const{backgroundIndex:ne,activeIndex:ye}=ls(b.length);g(ye),T(ne),C(!1),A(!1),F(null),E(null),y(0),W(1),te("none"),X("next")},[b.length,t]),l.useEffect(()=>()=>{Y.current&&clearTimeout(Y.current)},[]);const Re=l.useCallback(ne=>{var se,Ae,Ne,He;if(!ie||$||b.length<=1)return;const ye=ne==="next"?(S+1)%b.length:(S-1+b.length)%b.length,ke=fe((Ae=(se=b[S])==null?void 0:se.image)==null?void 0:Ae.url),Te=fe((He=(Ne=b[ye])==null?void 0:Ne.image)==null?void 0:He.url),xe=cs(z.width,z.height,ke),Ke=cs(z.width,z.height,Te);Y.current&&clearTimeout(Y.current),X(ne),A(!0),C(!0),ne==="next"?(F(S),E(ye),y(0),W(1),te(Ci(p,0))):(T(Yg(ye,b.length)),F(ye),E(S),y(1),W(Ke),te(Ci(p,1))),requestAnimationFrame(()=>{A(!1),requestAnimationFrame(()=>{ne==="next"?(y(1),W(xe),te(Ci(p,1))):(y(0),W(1),te(Ci(p,0)))})}),Y.current=setTimeout(()=>{ne==="next"&&T(S),g(ye),F(null),E(null),C(!1)},de)},[S,p,z.height,z.width,fe,$,ie,b,de]),Z=b[S],ge=v!==null?b[v]:null,U=k!==null?b[k]:null,V=I!==null?b[I]:null,j=b.length<=1?0:(S-1+b.length)%b.length,he=b.length<=1?0:(S+1)%b.length,re=fe((Ie=Z==null?void 0:Z.image)==null?void 0:Ie.url),Ce=fe((N=U==null?void 0:U.image)==null?void 0:N.url),Se=fe((ee=V==null?void 0:V.image)==null?void 0:ee.url),we={[`--${o}-transition-ms`]:`${de}ms`};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:s}}),r.jsxs("div",{ref:oe,className:ze(`${o}-wrapper`,L&&`${o}-snap`,n&&!i&&`${o}-editor`),style:we,"aria-label":"Zoom gallery",children:[((R=ge==null?void 0:ge.image)==null?void 0:R.url)&&r.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:ge.image.url,alt:"",style:{filter:be}})}),$&&((K=U==null?void 0:U.image)==null?void 0:K.url)&&r.jsx("div",{className:ze(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${ue}`),style:ds(Ce,_,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:U.image.url,alt:"",style:{filter:G}})}),$&&((D=V==null?void 0:V.image)==null?void 0:D.url)&&r.jsx("div",{className:ze(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${ue}`),style:ds(Se,J,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-image`,src:V.image.url,alt:""})}),!$&&((ae=Z==null?void 0:Z.image)==null?void 0:ae.url)&&r.jsx("div",{className:ze(`${o}-stage`,`${o}-foreground`),style:ll(re),children:r.jsx("img",{className:`${o}-image`,src:Z.image.url,alt:Z.image.name??""})}),ie&&b.length>1&&!$&&r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:ze(`${o}-nav`,`${o}-nav-prev`),onClick:()=>Re("prev"),"aria-label":`Show previous image (${j+1} of ${b.length})`}),r.jsx("button",{type:"button",className:ze(`${o}-nav`,`${o}-nav-next`),onClick:()=>Re("next"),"aria-label":`Show next image (${he+1} of ${b.length})`})]})]})]})}const th=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
12509
|
-
import cn from 'classnames';
|
|
12510
|
-
import { CommonComponentProps } from '../props';
|
|
12511
|
-
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
12512
|
-
|
|
12513
|
-
type ZoomContentItem = {
|
|
12514
|
-
image?: {
|
|
12515
|
-
url?: string;
|
|
12516
|
-
name?: string;
|
|
12517
|
-
};
|
|
12518
|
-
};
|
|
12519
|
-
|
|
12520
|
-
type ZoomSettings = {
|
|
12521
|
-
imageSize?: number;
|
|
12522
|
-
maxWidth?: number;
|
|
12523
|
-
maxHeight?: number;
|
|
12524
|
-
transition?: number;
|
|
12525
|
-
bgImage?: 'greyscale' | 'blur' | 'as is';
|
|
12526
|
-
};
|
|
12527
|
-
|
|
12528
|
-
const GREYSCALE_EFFECT_AMOUNT = 100;
|
|
12529
|
-
const BLUR_EFFECT_AMOUNT = 70;
|
|
12530
|
-
|
|
12531
|
-
type ImageDimensions = {
|
|
12532
|
-
width: number;
|
|
12533
|
-
height: number;
|
|
12534
|
-
};
|
|
12535
|
-
|
|
12536
|
-
type SizePercents = {
|
|
12537
|
-
widthPercent: number;
|
|
12538
|
-
heightPercent: number;
|
|
12539
|
-
};
|
|
12540
|
-
|
|
12541
|
-
type ZoomProps = {
|
|
12542
|
-
settings: ZoomSettings;
|
|
12543
|
-
content?: ZoomContentItem[];
|
|
12544
|
-
isEditor?: boolean;
|
|
12545
|
-
isPreviewMode?: boolean;
|
|
12546
|
-
} & CommonComponentProps;
|
|
12547
|
-
|
|
12548
|
-
function getCSS(P: string): string {
|
|
12549
|
-
return \`
|
|
12550
|
-
.\${P}-wrapper {
|
|
12551
|
-
position: relative;
|
|
12552
|
-
width: 100%;
|
|
12553
|
-
height: 100%;
|
|
12554
|
-
overflow: hidden;
|
|
12555
|
-
}
|
|
12556
|
-
.\${P}-background {
|
|
12557
|
-
position: absolute;
|
|
12558
|
-
inset: 0;
|
|
12559
|
-
z-index: 1;
|
|
12560
|
-
pointer-events: none;
|
|
12561
|
-
overflow: hidden;
|
|
12562
|
-
}
|
|
12563
|
-
.\${P}-effect-image {
|
|
12564
|
-
width: 100%;
|
|
12565
|
-
height: 100%;
|
|
12566
|
-
object-fit: cover;
|
|
12567
|
-
display: block;
|
|
12568
|
-
}
|
|
12569
|
-
.\${P}-stage {
|
|
12570
|
-
position: absolute;
|
|
12571
|
-
left: 50%;
|
|
12572
|
-
top: 50%;
|
|
12573
|
-
transform: translate(-50%, -50%) scale(var(--\${P}-stage-scale, 1));
|
|
12574
|
-
overflow: hidden;
|
|
12575
|
-
}
|
|
12576
|
-
.\${P}-foreground {
|
|
12577
|
-
z-index: 2;
|
|
12578
|
-
}
|
|
12579
|
-
.\${P}-incoming {
|
|
12580
|
-
will-change: transform;
|
|
12581
|
-
}
|
|
12582
|
-
.\${P}-incoming-next {
|
|
12583
|
-
z-index: 4;
|
|
12584
|
-
transition: transform var(--\${P}-transition-ms) ease-in;
|
|
12585
|
-
}
|
|
12586
|
-
.\${P}-incoming-prev {
|
|
12587
|
-
z-index: 4;
|
|
12588
|
-
transition: transform var(--\${P}-transition-ms) ease-out;
|
|
12589
|
-
}
|
|
12590
|
-
.\${P}-outgoing {
|
|
12591
|
-
will-change: transform;
|
|
12592
|
-
}
|
|
12593
|
-
.\${P}-outgoing-next {
|
|
12594
|
-
z-index: 3;
|
|
12595
|
-
transition: transform var(--\${P}-transition-ms) ease-in;
|
|
12596
|
-
}
|
|
12597
|
-
.\${P}-outgoing-prev {
|
|
12598
|
-
z-index: 3;
|
|
12599
|
-
transition: transform var(--\${P}-transition-ms) ease-out;
|
|
12600
|
-
}
|
|
12601
|
-
.\${P}-outgoing-next .\${P}-effect-image {
|
|
12602
|
-
transition: filter var(--\${P}-transition-ms) ease-in;
|
|
12603
|
-
}
|
|
12604
|
-
.\${P}-outgoing-prev .\${P}-effect-image {
|
|
12605
|
-
transition: filter var(--\${P}-transition-ms) ease-out;
|
|
12606
|
-
}
|
|
12607
|
-
.\${P}-incoming .\${P}-effect-image {
|
|
12608
|
-
transition: filter var(--\${P}-transition-ms) ease;
|
|
12609
|
-
}
|
|
12610
|
-
.\${P}-background .\${P}-effect-image {
|
|
12611
|
-
transition: filter var(--\${P}-transition-ms) ease;
|
|
12612
|
-
}
|
|
12613
|
-
.\${P}-snap .\${P}-incoming,
|
|
12614
|
-
.\${P}-snap .\${P}-outgoing,
|
|
12615
|
-
.\${P}-snap .\${P}-outgoing .\${P}-effect-image,
|
|
12616
|
-
.\${P}-snap .\${P}-incoming .\${P}-effect-image {
|
|
12617
|
-
transition: none !important;
|
|
12618
|
-
}
|
|
12619
|
-
.\${P}-nav {
|
|
12620
|
-
position: absolute;
|
|
12621
|
-
top: 0;
|
|
12622
|
-
bottom: 0;
|
|
12623
|
-
width: 50%;
|
|
12624
|
-
z-index: 5;
|
|
12625
|
-
margin: 0;
|
|
12626
|
-
padding: 0;
|
|
12627
|
-
border: none;
|
|
12628
|
-
background: none;
|
|
12629
|
-
cursor: pointer;
|
|
12630
|
-
outline: none;
|
|
12631
|
-
-webkit-tap-highlight-color: transparent;
|
|
12632
|
-
}
|
|
12633
|
-
.\${P}-nav-prev {
|
|
12634
|
-
left: 0;
|
|
12635
|
-
cursor: w-resize;
|
|
12636
|
-
}
|
|
12637
|
-
.\${P}-nav-next {
|
|
12638
|
-
right: 0;
|
|
12639
|
-
cursor: e-resize;
|
|
12640
|
-
}
|
|
12641
|
-
.\${P}-nav:focus,
|
|
12642
|
-
.\${P}-nav:focus-visible {
|
|
12643
|
-
outline: none;
|
|
12644
|
-
}
|
|
12645
|
-
.\${P}-editor .\${P}-nav {
|
|
12646
|
-
cursor: default;
|
|
12647
|
-
pointer-events: none;
|
|
12648
|
-
}
|
|
12649
|
-
.\${P}-foreground {
|
|
12650
|
-
pointer-events: none;
|
|
12651
|
-
}
|
|
12652
|
-
.\${P}-image {
|
|
12653
|
-
width: 100%;
|
|
12654
|
-
height: 100%;
|
|
12655
|
-
object-fit: contain;
|
|
12656
|
-
display: block;
|
|
12657
|
-
pointer-events: none;
|
|
12658
|
-
}
|
|
12659
|
-
\`;
|
|
12660
|
-
}
|
|
12661
|
-
|
|
12662
|
-
function getEffectAmount(bgImage: ZoomSettings['bgImage']): number {
|
|
12663
|
-
if (bgImage === 'blur') return BLUR_EFFECT_AMOUNT;
|
|
12664
|
-
if (bgImage === 'greyscale') return GREYSCALE_EFFECT_AMOUNT;
|
|
12665
|
-
return 0;
|
|
12666
|
-
}
|
|
12667
|
-
|
|
12668
|
-
function getBackgroundFilter(bgImage: ZoomSettings['bgImage'], progress = 1): string {
|
|
12669
|
-
const amount = getEffectAmount(bgImage) * Math.max(0, Math.min(1, progress));
|
|
12670
|
-
if (bgImage === 'greyscale') {
|
|
12671
|
-
return \`grayscale(\${amount}%)\`;
|
|
12672
|
-
}
|
|
12673
|
-
if (bgImage === 'blur') {
|
|
12674
|
-
return \`blur(\${amount / 4}px)\`;
|
|
12675
|
-
}
|
|
12676
|
-
return 'none';
|
|
12677
|
-
}
|
|
12678
|
-
|
|
12679
|
-
function getInitialIndices(itemCount: number): { backgroundIndex: number | null; activeIndex: number } {
|
|
12680
|
-
if (itemCount <= 1) {
|
|
12681
|
-
return { backgroundIndex: 0, activeIndex: 0 };
|
|
12682
|
-
}
|
|
12683
|
-
return { backgroundIndex: 0, activeIndex: 1 };
|
|
12684
|
-
}
|
|
12685
|
-
|
|
12686
|
-
function getPreviousBackgroundIndex(targetIndex: number, itemCount: number): number {
|
|
12687
|
-
if (itemCount <= 1) return 0;
|
|
12688
|
-
return (targetIndex - 1 + itemCount) % itemCount;
|
|
12689
|
-
}
|
|
12690
|
-
|
|
12691
|
-
function getImageAspectRatio(dimensions: ImageDimensions | undefined, fallback = 1): number {
|
|
12692
|
-
if (!dimensions || dimensions.height === 0) return fallback;
|
|
12693
|
-
return dimensions.width / dimensions.height;
|
|
12694
|
-
}
|
|
12695
|
-
|
|
12696
|
-
function computeFitSize(
|
|
12697
|
-
containerWidth: number,
|
|
12698
|
-
containerHeight: number,
|
|
12699
|
-
imageAspectRatio: number,
|
|
12700
|
-
maxWidthPercent: number,
|
|
12701
|
-
maxHeightPercent: number,
|
|
12702
|
-
): SizePercents {
|
|
12703
|
-
if (containerWidth <= 0 || containerHeight <= 0) {
|
|
12704
|
-
return { widthPercent: maxWidthPercent, heightPercent: maxHeightPercent };
|
|
12705
|
-
}
|
|
12706
|
-
|
|
12707
|
-
const maxW = containerWidth * maxWidthPercent / 100;
|
|
12708
|
-
const maxH = containerHeight * maxHeightPercent / 100;
|
|
12709
|
-
|
|
12710
|
-
let width = maxW;
|
|
12711
|
-
let height = width / imageAspectRatio;
|
|
12712
|
-
|
|
12713
|
-
if (height > maxH) {
|
|
12714
|
-
height = maxH;
|
|
12715
|
-
width = height * imageAspectRatio;
|
|
12716
|
-
}
|
|
12717
|
-
|
|
12718
|
-
return {
|
|
12719
|
-
widthPercent: (width / containerWidth) * 100,
|
|
12720
|
-
heightPercent: (height / containerHeight) * 100,
|
|
12721
|
-
};
|
|
12722
|
-
}
|
|
12723
|
-
|
|
12724
|
-
function computeCoverScale(
|
|
12725
|
-
containerWidth: number,
|
|
12726
|
-
containerHeight: number,
|
|
12727
|
-
fitSize: SizePercents,
|
|
12728
|
-
): number {
|
|
12729
|
-
if (containerWidth <= 0 || containerHeight <= 0) return 1;
|
|
12730
|
-
|
|
12731
|
-
const fitW = containerWidth * fitSize.widthPercent / 100;
|
|
12732
|
-
const fitH = containerHeight * fitSize.heightPercent / 100;
|
|
12733
|
-
if (fitW <= 0 || fitH <= 0) return 1;
|
|
12734
|
-
|
|
12735
|
-
return Math.max(containerWidth / fitW, containerHeight / fitH);
|
|
12736
|
-
}
|
|
12737
|
-
|
|
12738
|
-
function toSizeStyle(size: SizePercents): React.CSSProperties {
|
|
12739
|
-
return {
|
|
12740
|
-
width: \`\${size.widthPercent}%\`,
|
|
12741
|
-
height: \`\${size.heightPercent}%\`,
|
|
12742
|
-
};
|
|
12743
|
-
}
|
|
12744
|
-
|
|
12745
|
-
function toStageStyle(size: SizePercents, scale: number, prefix: string): React.CSSProperties {
|
|
12746
|
-
return {
|
|
12747
|
-
...toSizeStyle(size),
|
|
12748
|
-
[\`--\${prefix}-stage-scale\`]: scale,
|
|
12749
|
-
} as React.CSSProperties;
|
|
12750
|
-
}
|
|
12751
|
-
|
|
12752
|
-
function preloadImages(
|
|
12753
|
-
urls: string[],
|
|
12754
|
-
onDimensions: (url: string, dimensions: ImageDimensions) => void,
|
|
12755
|
-
): void {
|
|
12756
|
-
const uniqueUrls = [...new Set(urls.filter(Boolean))];
|
|
12757
|
-
uniqueUrls.forEach((url) => {
|
|
12758
|
-
const img = new Image();
|
|
12759
|
-
img.onload = () => {
|
|
12760
|
-
if (img.naturalWidth > 0 && img.naturalHeight > 0) {
|
|
12761
|
-
onDimensions(url, { width: img.naturalWidth, height: img.naturalHeight });
|
|
12762
|
-
}
|
|
12763
|
-
};
|
|
12764
|
-
img.src = url;
|
|
12765
|
-
});
|
|
12766
|
-
}
|
|
12767
|
-
|
|
12768
|
-
export function Zoom({ settings, content, isEditor, isPreviewMode }: ZoomProps) {
|
|
12769
|
-
const { prefix: P } = useScopedStyles();
|
|
12770
|
-
const scopedCss = useMemo(() => getCSS(P), [P]);
|
|
12771
|
-
const {
|
|
12772
|
-
imageSize,
|
|
12773
|
-
maxWidth,
|
|
12774
|
-
maxHeight,
|
|
12775
|
-
transition = 1000,
|
|
12776
|
-
bgImage = 'greyscale',
|
|
12777
|
-
} = settings;
|
|
12778
|
-
const items = content ?? [];
|
|
12779
|
-
const initialIndices = getInitialIndices(items.length);
|
|
12780
|
-
const [activeIndex, setActiveIndex] = useState(initialIndices.activeIndex);
|
|
12781
|
-
const [backgroundIndex, setBackgroundIndex] = useState<number | null>(initialIndices.backgroundIndex);
|
|
12782
|
-
const [isAnimating, setIsAnimating] = useState(false);
|
|
12783
|
-
const [snapLayout, setSnapLayout] = useState(false);
|
|
12784
|
-
const [outgoingIndex, setOutgoingIndex] = useState<number | null>(null);
|
|
12785
|
-
const [incomingIndex, setIncomingIndex] = useState<number | null>(null);
|
|
12786
|
-
const [incomingScale, setIncomingScale] = useState(0);
|
|
12787
|
-
const [outgoingScale, setOutgoingScale] = useState(1);
|
|
12788
|
-
const [outgoingFilter, setOutgoingFilter] = useState('none');
|
|
12789
|
-
const [transitionDirection, setTransitionDirection] = useState<'next' | 'prev'>('next');
|
|
12790
|
-
const [imageDimensions, setImageDimensions] = useState<Record<string, ImageDimensions>>({});
|
|
12791
|
-
const [containerSize, setContainerSize] = useState({ width: 0, height: 0 });
|
|
12792
|
-
const transitionTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
12793
|
-
const wrapperRef = useRef<HTMLDivElement>(null);
|
|
12794
|
-
const isInteractive = !isEditor || Boolean(isPreviewMode);
|
|
12795
|
-
const legacyImageSize = imageSize ?? 60;
|
|
12796
|
-
const maxWidthPercent = Math.max(10, Math.min(100, maxWidth ?? legacyImageSize));
|
|
12797
|
-
const maxHeightPercent = Math.max(10, Math.min(100, maxHeight ?? legacyImageSize));
|
|
12798
|
-
const transitionMs = Math.max(100, transition);
|
|
12799
|
-
const backgroundFilter = getBackgroundFilter(bgImage);
|
|
12800
|
-
|
|
12801
|
-
const getImageSizePercents = useCallback((url: string | undefined): SizePercents => {
|
|
12802
|
-
const aspectRatio = getImageAspectRatio(url ? imageDimensions[url] : undefined);
|
|
12803
|
-
return computeFitSize(
|
|
12804
|
-
containerSize.width,
|
|
12805
|
-
containerSize.height,
|
|
12806
|
-
aspectRatio,
|
|
12807
|
-
maxWidthPercent,
|
|
12808
|
-
maxHeightPercent,
|
|
12809
|
-
);
|
|
12810
|
-
}, [containerSize.height, containerSize.width, imageDimensions, maxHeightPercent, maxWidthPercent]);
|
|
12811
|
-
|
|
12812
|
-
useEffect(() => {
|
|
12813
|
-
const wrapper = wrapperRef.current;
|
|
12814
|
-
if (!wrapper) return undefined;
|
|
12815
|
-
|
|
12816
|
-
const observer = new ResizeObserver(([entry]) => {
|
|
12817
|
-
const { width, height } = entry.contentRect;
|
|
12818
|
-
setContainerSize({ width, height });
|
|
12819
|
-
});
|
|
12820
|
-
observer.observe(wrapper);
|
|
12821
|
-
|
|
12822
|
-
return () => observer.disconnect();
|
|
12823
|
-
}, []);
|
|
12824
|
-
|
|
12825
|
-
useEffect(() => {
|
|
12826
|
-
const urls = (content ?? []).map((item) => item.image?.url).filter((url): url is string => Boolean(url));
|
|
12827
|
-
preloadImages(urls, (url, dimensions) => {
|
|
12828
|
-
setImageDimensions((prev) => (
|
|
12829
|
-
prev[url]?.width === dimensions.width && prev[url]?.height === dimensions.height
|
|
12830
|
-
? prev
|
|
12831
|
-
: { ...prev, [url]: dimensions }
|
|
12832
|
-
));
|
|
12833
|
-
});
|
|
12834
|
-
}, [content]);
|
|
12835
|
-
|
|
12836
|
-
useEffect(() => {
|
|
12837
|
-
const { backgroundIndex: nextBackgroundIndex, activeIndex: nextActiveIndex } = getInitialIndices(items.length);
|
|
12838
|
-
setActiveIndex(nextActiveIndex);
|
|
12839
|
-
setBackgroundIndex(nextBackgroundIndex);
|
|
12840
|
-
setIsAnimating(false);
|
|
12841
|
-
setSnapLayout(false);
|
|
12842
|
-
setOutgoingIndex(null);
|
|
12843
|
-
setIncomingIndex(null);
|
|
12844
|
-
setIncomingScale(0);
|
|
12845
|
-
setOutgoingScale(1);
|
|
12846
|
-
setOutgoingFilter('none');
|
|
12847
|
-
setTransitionDirection('next');
|
|
12848
|
-
}, [items.length, content]);
|
|
12849
|
-
|
|
12850
|
-
useEffect(() => () => {
|
|
12851
|
-
if (transitionTimeoutRef.current) {
|
|
12852
|
-
clearTimeout(transitionTimeoutRef.current);
|
|
12853
|
-
}
|
|
12854
|
-
}, []);
|
|
12855
|
-
|
|
12856
|
-
const startTransition = useCallback((direction: 'next' | 'prev') => {
|
|
12857
|
-
if (!isInteractive || isAnimating || items.length <= 1) return;
|
|
12858
|
-
|
|
12859
|
-
const targetIndex = direction === 'next'
|
|
12860
|
-
? (activeIndex + 1) % items.length
|
|
12861
|
-
: (activeIndex - 1 + items.length) % items.length;
|
|
12862
|
-
const activeSize = getImageSizePercents(items[activeIndex]?.image?.url);
|
|
12863
|
-
const targetSize = getImageSizePercents(items[targetIndex]?.image?.url);
|
|
12864
|
-
const activeCoverScale = computeCoverScale(containerSize.width, containerSize.height, activeSize);
|
|
12865
|
-
const targetCoverScale = computeCoverScale(containerSize.width, containerSize.height, targetSize);
|
|
12866
|
-
|
|
12867
|
-
if (transitionTimeoutRef.current) {
|
|
12868
|
-
clearTimeout(transitionTimeoutRef.current);
|
|
12869
|
-
}
|
|
12870
|
-
|
|
12871
|
-
setTransitionDirection(direction);
|
|
12872
|
-
setSnapLayout(true);
|
|
12873
|
-
setIsAnimating(true);
|
|
12874
|
-
|
|
12875
|
-
if (direction === 'next') {
|
|
12876
|
-
setOutgoingIndex(activeIndex);
|
|
12877
|
-
setIncomingIndex(targetIndex);
|
|
12878
|
-
setIncomingScale(0);
|
|
12879
|
-
setOutgoingScale(1);
|
|
12880
|
-
setOutgoingFilter(getBackgroundFilter(bgImage, 0));
|
|
12881
|
-
} else {
|
|
12882
|
-
setBackgroundIndex(getPreviousBackgroundIndex(targetIndex, items.length));
|
|
12883
|
-
setOutgoingIndex(targetIndex);
|
|
12884
|
-
setIncomingIndex(activeIndex);
|
|
12885
|
-
setIncomingScale(1);
|
|
12886
|
-
setOutgoingScale(targetCoverScale);
|
|
12887
|
-
setOutgoingFilter(getBackgroundFilter(bgImage, 1));
|
|
12888
|
-
}
|
|
12889
|
-
|
|
12890
|
-
requestAnimationFrame(() => {
|
|
12891
|
-
setSnapLayout(false);
|
|
12892
|
-
requestAnimationFrame(() => {
|
|
12893
|
-
if (direction === 'next') {
|
|
12894
|
-
setIncomingScale(1);
|
|
12895
|
-
setOutgoingScale(activeCoverScale);
|
|
12896
|
-
setOutgoingFilter(getBackgroundFilter(bgImage, 1));
|
|
12897
|
-
} else {
|
|
12898
|
-
setIncomingScale(0);
|
|
12899
|
-
setOutgoingScale(1);
|
|
12900
|
-
setOutgoingFilter(getBackgroundFilter(bgImage, 0));
|
|
12901
|
-
}
|
|
12902
|
-
});
|
|
12903
|
-
});
|
|
12904
|
-
|
|
12905
|
-
transitionTimeoutRef.current = setTimeout(() => {
|
|
12906
|
-
if (direction === 'next') {
|
|
12907
|
-
setBackgroundIndex(activeIndex);
|
|
12908
|
-
}
|
|
12909
|
-
setActiveIndex(targetIndex);
|
|
12910
|
-
setOutgoingIndex(null);
|
|
12911
|
-
setIncomingIndex(null);
|
|
12912
|
-
setIsAnimating(false);
|
|
12913
|
-
}, transitionMs);
|
|
12914
|
-
}, [
|
|
12915
|
-
activeIndex,
|
|
12916
|
-
bgImage,
|
|
12917
|
-
containerSize.height,
|
|
12918
|
-
containerSize.width,
|
|
12919
|
-
getImageSizePercents,
|
|
12920
|
-
isAnimating,
|
|
12921
|
-
isInteractive,
|
|
12922
|
-
items,
|
|
12923
|
-
transitionMs,
|
|
12924
|
-
]);
|
|
12925
|
-
|
|
12926
|
-
const foregroundItem = items[activeIndex];
|
|
12927
|
-
const backgroundItem = backgroundIndex !== null ? items[backgroundIndex] : null;
|
|
12928
|
-
const outgoingItem = outgoingIndex !== null ? items[outgoingIndex] : null;
|
|
12929
|
-
const incomingItem = incomingIndex !== null ? items[incomingIndex] : null;
|
|
12930
|
-
const prevIndex = items.length <= 1 ? 0 : (activeIndex - 1 + items.length) % items.length;
|
|
12931
|
-
const nextIndex = items.length <= 1 ? 0 : (activeIndex + 1) % items.length;
|
|
12932
|
-
const foregroundSize = getImageSizePercents(foregroundItem?.image?.url);
|
|
12933
|
-
const outgoingFitSize = getImageSizePercents(outgoingItem?.image?.url);
|
|
12934
|
-
const incomingFitSize = getImageSizePercents(incomingItem?.image?.url);
|
|
12935
|
-
const wrapperStyle = {
|
|
12936
|
-
[\`--\${P}-transition-ms\`]: \`\${transitionMs}ms\`,
|
|
12937
|
-
} as React.CSSProperties;
|
|
12938
|
-
|
|
12939
|
-
return (
|
|
12940
|
-
<>
|
|
12941
|
-
<style dangerouslySetInnerHTML={{ __html: scopedCss }} />
|
|
12942
|
-
<div
|
|
12943
|
-
ref={wrapperRef}
|
|
12944
|
-
className={cn(\`\${P}-wrapper\`, snapLayout && \`\${P}-snap\`, isEditor && !isPreviewMode && \`\${P}-editor\`)}
|
|
12945
|
-
style={wrapperStyle}
|
|
12946
|
-
aria-label="Zoom gallery"
|
|
12947
|
-
>
|
|
12948
|
-
{backgroundItem?.image?.url && (
|
|
12949
|
-
<div className={\`\${P}-background\`} aria-hidden="true">
|
|
12950
|
-
<img
|
|
12951
|
-
className={\`\${P}-effect-image\`}
|
|
12952
|
-
src={backgroundItem.image.url}
|
|
12953
|
-
alt=""
|
|
12954
|
-
style={{ filter: backgroundFilter }}
|
|
12955
|
-
/>
|
|
12956
|
-
</div>
|
|
12957
|
-
)}
|
|
12958
|
-
|
|
12959
|
-
{isAnimating && outgoingItem?.image?.url && (
|
|
12960
|
-
<div
|
|
12961
|
-
className={cn(
|
|
12962
|
-
\`\${P}-stage\`,
|
|
12963
|
-
\`\${P}-outgoing\`,
|
|
12964
|
-
\`\${P}-outgoing-\${transitionDirection}\`,
|
|
12965
|
-
)}
|
|
12966
|
-
style={toStageStyle(outgoingFitSize, outgoingScale, P)}
|
|
12967
|
-
aria-hidden="true"
|
|
12968
|
-
>
|
|
12969
|
-
<img
|
|
12970
|
-
className={\`\${P}-effect-image\`}
|
|
12971
|
-
src={outgoingItem.image.url}
|
|
12972
|
-
alt=""
|
|
12973
|
-
style={{ filter: outgoingFilter }}
|
|
12974
|
-
/>
|
|
12975
|
-
</div>
|
|
12976
|
-
)}
|
|
12977
|
-
|
|
12978
|
-
{isAnimating && incomingItem?.image?.url && (
|
|
12979
|
-
<div
|
|
12980
|
-
className={cn(
|
|
12981
|
-
\`\${P}-stage\`,
|
|
12982
|
-
\`\${P}-incoming\`,
|
|
12983
|
-
\`\${P}-incoming-\${transitionDirection}\`,
|
|
12984
|
-
)}
|
|
12985
|
-
style={toStageStyle(incomingFitSize, incomingScale, P)}
|
|
12986
|
-
aria-hidden="true"
|
|
12987
|
-
>
|
|
12988
|
-
<img
|
|
12989
|
-
className={\`\${P}-image\`}
|
|
12990
|
-
src={incomingItem.image.url}
|
|
12991
|
-
alt=""
|
|
12992
|
-
/>
|
|
12993
|
-
</div>
|
|
12994
|
-
)}
|
|
12995
|
-
|
|
12996
|
-
{!isAnimating && foregroundItem?.image?.url && (
|
|
12997
|
-
<div
|
|
12998
|
-
className={cn(\`\${P}-stage\`, \`\${P}-foreground\`)}
|
|
12999
|
-
style={toSizeStyle(foregroundSize)}
|
|
13000
|
-
>
|
|
13001
|
-
<img
|
|
13002
|
-
className={\`\${P}-image\`}
|
|
13003
|
-
src={foregroundItem.image.url}
|
|
13004
|
-
alt={foregroundItem.image.name ?? ''}
|
|
13005
|
-
/>
|
|
13006
|
-
</div>
|
|
13007
|
-
)}
|
|
13008
|
-
|
|
13009
|
-
{isInteractive && items.length > 1 && !isAnimating && (
|
|
13010
|
-
<>
|
|
13011
|
-
<button
|
|
13012
|
-
type="button"
|
|
13013
|
-
className={cn(\`\${P}-nav\`, \`\${P}-nav-prev\`)}
|
|
13014
|
-
onClick={() => startTransition('prev')}
|
|
13015
|
-
aria-label={\`Show previous image (\${prevIndex + 1} of \${items.length})\`}
|
|
13016
|
-
/>
|
|
13017
|
-
<button
|
|
13018
|
-
type="button"
|
|
13019
|
-
className={cn(\`\${P}-nav\`, \`\${P}-nav-next\`)}
|
|
13020
|
-
onClick={() => startTransition('next')}
|
|
13021
|
-
aria-label={\`Show next image (\${nextIndex + 1} of \${items.length})\`}
|
|
13022
|
-
/>
|
|
13023
|
-
</>
|
|
13024
|
-
)}
|
|
13025
|
-
</div>
|
|
13026
|
-
</>
|
|
13027
|
-
);
|
|
13028
|
-
}
|
|
13029
|
-
`,nh={type:"object",version:1,settings:{sizing:"manual",properties:{maxWidth:{type:"number",scope:"common",title:"Max width (%)",display:{type:"percentage-input"},min:10,max:100},maxHeight:{type:"number",scope:"common",title:"Max height (%)",display:{type:"percentage-input"},min:10,max:100},transition:{type:"number",scope:"common",title:"Transition (ms)",display:{type:"common-numeric-input"},min:100,max:9999},bgImage:{type:"string",scope:"common",title:"BG image",display:{type:"toggle-cycle",enum:["greyscale","blur","as is"]}}},defaults:{maxWidth:60,maxHeight:60,transition:1e3,bgImage:"greyscale"},layout:["__componentName__","maxWidth","maxHeight","transition","bgImage"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["maxWidth","maxHeight"]},{type:"row",title:"",items:["transition","bgImage"]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input",isObjectFitEditable:!1}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/grid(1).webp",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/grid(2).webp",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/grid(3).webp",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/grid(4).webp",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/grid(5).webp",name:""}}]}},ih={element:eh,id:"zoom",name:"Zoom",category:"galleries",version:1,defaultSize:{d:{width:920,height:540},m:{width:"100%",height:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Zoom.mp4"},schema:nh,sourceCode:th,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},oh=[xd,Ed,hu,Cu,_u,Ku,Ju,op,Tp,Em,Wm,vg,qg,ih];exports.components=oh;exports.isSchemaV1=ul;
|
|
12476
|
+
`,jg="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>'),Dn={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 zg(e){const t={};return t[ct(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[ct(e,"fontSettings")]={...Dn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[ct(e,"fontSize")]={...Dn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[ct(e,"lineHeight")]={...Dn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[ct(e,"letterSpacing")]={...Dn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[ct(e,"wordSpacing")]={...Dn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[ct(e,"textAlign")]={...Dn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[ct(e,"textAppearance")]={...Dn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Vg=yi.reduce((e,t)=>({...e,...zg(t)}),{}),Dg=yi.reduce((e,t)=>({...e,[ct(t,"fontFamily")]:"Goudy Bookletter 1911",[ct(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[ct(t,"letterSpacing")]:0,[ct(t,"wordSpacing")]:0,[ct(t,"textAlign")]:"left",[ct(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ss(e){return yi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[ct(n,"fontSize")]=i),o!==void 0&&(t[ct(n,"lineHeight")]=o),t},{})}const qg=_g(),Kg={type:"object",version:1,settings:{sizing:"auto manual",properties:{cover:{type:"string",scope:"common",title:"",display:{type:"settings-image-input"}},coverFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["A","B"]},maxHeight:{type:"number",scope:"layout",title:"Max Height (%)",min:0,max:100,display:{type:"percentage-input"}},maxWidth:{type:"number",scope:"layout",title:"Max Width (%)",min:0,max:100,display:{type:"percentage-input"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control",visible:!1}},backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},textTransition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["none","fade"]}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},countCloseGap:{type:"number",scope:"layout",title:"Count / Close Gap",min:0,display:{type:"range-control"}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},countColor:{type:"string",scope:"common",title:"Count Default",display:{type:"palette-color-picker"}},...Vg,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/journal_1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:jg,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...Dg,countFontFamily:"Arial"},layoutDefaults:{m:{type:"B",imageGap:.01,maxHeight:80,maxWidth:80,closeIconMaxWidth:.05,contentMarginTop:.04,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.55,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,iconMarginRight:.01,countCloseGap:.005,...ss({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04,countFontSize:.04,countLineHeight:.04})},d:{type:"A",maxHeight:80,maxWidth:40,imageGap:.05,closeIconMaxWidth:.0125,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.02,...ss({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098,countFontSize:.008,countLineHeight:.0098})}},layout:["__componentName__","maxWidth","maxHeight","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","countCloseGap","contentMarginTop","iconMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["type"]},{type:"row",title:"Image",items:["maxWidth","maxHeight"]},{type:"row",title:"Text",items:["textTransition"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover Image",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[qg]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","countColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemWithoutImage:!0},items:{type:"object",properties:{title1:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},image:{type:"object",label:"Image",max:2,display:{type:"media-list-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]}}},default:[{title1:"Dorothy Manners & Julanne Johnston",title2:"by Evans Studio",title3:"Screenland",image:[{url:"https://cdn.cntrl.site/component-assets/journal_2.jpg",name:"",objectFit:"contain"},{url:"https://cdn.cntrl.site/component-assets/journal_3.jpg",name:"",objectFit:"contain"}]},{title1:"Inez Nadeau",title2:"Melbourne Spurr",title3:"Screenland",image:[{url:"https://cdn.cntrl.site/component-assets/journal_4.jpg",name:"",objectFit:"contain"}]},{title1:"Colleen Moore",title2:"Clarence S. Bull",title3:"Screenland",image:[{url:"https://cdn.cntrl.site/component-assets/journal_5.jpg",name:"",objectFit:"contain"}]},{title1:"Gloria Swanson",title2:"Donald Biddle Keyes",title3:"Screenland",image:[{url:"https://cdn.cntrl.site/component-assets/journal_6.jpg",name:"",objectFit:"contain"}]}]}},Gg={element:Og,id:"lightbox-journal",name:"Journal",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/Journal.png"},schema:Kg,sourceCode:Bg,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...yi.map(e=>({path:`${ct(e,"fontFamily")}`}))]},fontRelations:{...yi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${ct(t,"fontFamily")}`}),{})}},Ug=[yd,Cd,pu,wu,Mu,Uu,Qu,ap,Ep,Im,Hm,xg,Gg];exports.components=Ug;exports.isSchemaV1=ll;
|