@cntrl-site/components 1.0.11-alpha.5 → 1.0.11-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),m=require("react"),ye=require("classnames"),S=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Yr=require("react-dom");function No(e){return e.type==="object"&&e.version===1}const Oo="ControlSlider-module__wrapper___sHEkd",jo="ControlSlider-module__hoverArrow___A-dOH",zo="ControlSlider-module__sliderItem___QQSkR",Bo="ControlSlider-module__sliderImage___9hRl-",Vo="ControlSlider-module__arrow___05ghY",Do="ControlSlider-module__arrowVertical___tBfVN",Go="ControlSlider-module__nextArrow___-30Yc",Uo="ControlSlider-module__arrowInner___aEra3",qo="ControlSlider-module__arrowIcon___S4ztF",Ko="ControlSlider-module__arrowImg___2dwJW",Yo="ControlSlider-module__mirror___brd6U",Xo="ControlSlider-module__pagination___bicLF",Zo="ControlSlider-module__paginationInner___bT-P-",Jo="ControlSlider-module__paginationVertical___zYqKw",Qo="ControlSlider-module__paginationItem___nTRbk",ei="ControlSlider-module__dot___p1Qun",ti="ControlSlider-module__activeDot___LHFaj",ni="ControlSlider-module__paginationInsideBottom___R3FWn",ri="ControlSlider-module__paginationInsideTop___V-qb-",oi="ControlSlider-module__paginationOutsideBottom___14w8D",ii="ControlSlider-module__paginationOutsideTop___SCLqB",ai="ControlSlider-module__paginationInsideLeft___yOBRZ",si="ControlSlider-module__paginationInsideRight___Rtt3o",li="ControlSlider-module__paginationOutsideLeft___lahaw",ci="ControlSlider-module__paginationOutsideRight___EtuQa",ui="ControlSlider-module__imgWrapper___UjEgB",pi="ControlSlider-module__captionBlock___dJ6-j",di="ControlSlider-module__captionTextWrapper___HFlpf",mi="ControlSlider-module__captionText___uGBVc",gi="ControlSlider-module__active___WZK4G",hi="ControlSlider-module__withPointerEvents___t-18M",fi="ControlSlider-module__topLeftAlignment___zjnGM",yi="ControlSlider-module__topCenterAlignment___gD1xW",vi="ControlSlider-module__topRightAlignment___NMapS",bi="ControlSlider-module__middleLeftAlignment___OnUrY",xi="ControlSlider-module__middleCenterAlignment___Tdkl0",Si="ControlSlider-module__middleRightAlignment___wEbfX",Ci="ControlSlider-module__bottomLeftAlignment___cTP2-",wi="ControlSlider-module__bottomCenterAlignment___c54fB",$i="ControlSlider-module__bottomRightAlignment___kEwrz",Ti="ControlSlider-module__clickOverlay___DZA28",_i="ControlSlider-module__contain___pLyq7",Li="ControlSlider-module__cover___KdDat",ee={wrapper:Oo,hoverArrow:jo,sliderItem:zo,sliderImage:Bo,arrow:Vo,arrowVertical:Do,nextArrow:Go,arrowInner:Uo,arrowIcon:qo,arrowImg:Ko,mirror:Yo,pagination:Xo,paginationInner:Zo,paginationVertical:Jo,paginationItem:Qo,dot:ei,activeDot:ti,paginationInsideBottom:ni,paginationInsideTop:ri,paginationOutsideBottom:oi,paginationOutsideTop:ii,paginationInsideLeft:ai,paginationInsideRight:si,paginationOutsideLeft:li,paginationOutsideRight:ci,imgWrapper:ui,captionBlock:pi,captionTextWrapper:di,captionText:mi,active:gi,withPointerEvents:hi,topLeftAlignment:fi,topCenterAlignment:yi,topRightAlignment:vi,middleLeftAlignment:bi,middleCenterAlignment:xi,middleRightAlignment:Si,bottomLeftAlignment:Ci,bottomCenterAlignment:wi,bottomRightAlignment:$i,clickOverlay:Ti,contain:_i,cover:Li};function Ei(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ii(e,t,n){return t&&Ei(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var xr="(prefers-reduced-motion: reduce)",Et=1,Ai=2,kt=3,Rt=4,qt=5,ln=6,mn=7,ki={CREATED:Et,MOUNTED:Ai,IDLE:kt,MOVING:Rt,SCROLLING:qt,DRAGGING:ln,DESTROYED:mn};function at(e){e.length=0}function gt(e,t,n){return Array.prototype.slice.call(e,t,n)}function xe(e){return e.bind.apply(e,[null].concat(gt(arguments,1)))}var Xr=setTimeout,Bn=function(){};function Sr(e){return requestAnimationFrame(e)}function bn(e,t){return typeof t===e}function Ot(e){return!Qn(e)&&bn("object",e)}var Jn=Array.isArray,Zr=xe(bn,"function"),dt=xe(bn,"string"),Kt=xe(bn,"undefined");function Qn(e){return e===null}function Jr(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Yt(e){return Jn(e)?e:[e]}function Ge(e,t){Yt(e).forEach(t)}function er(e,t){return e.indexOf(t)>-1}function cn(e,t){return e.push.apply(e,Yt(t)),e}function nt(e,t,n){e&&Ge(t,function(r){r&&e.classList[n?"add":"remove"](r)})}function Ze(e,t){nt(e,dt(t)?t.split(" "):t,!0)}function Xt(e,t){Ge(t,e.appendChild.bind(e))}function tr(e,t){Ge(e,function(n){var r=(t||n).parentNode;r&&r.insertBefore(n,t)})}function jt(e,t){return Jr(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Qr(e,t){var n=e?gt(e.children):[];return t?n.filter(function(r){return jt(r,t)}):n}function Zt(e,t){return t?Qr(e,t)[0]:e.firstElementChild}var zt=Object.keys;function bt(e,t,n){return e&&(n?zt(e).reverse():zt(e)).forEach(function(r){r!=="__proto__"&&t(e[r],r)}),e}function Bt(e){return gt(arguments,1).forEach(function(t){bt(t,function(n,r){e[r]=t[r]})}),e}function ut(e){return gt(arguments,1).forEach(function(t){bt(t,function(n,r){Jn(n)?e[r]=n.slice():Ot(n)?e[r]=ut({},Ot(e[r])?e[r]:{},n):e[r]=n})}),e}function Cr(e,t){Ge(t||zt(e),function(n){delete e[n]})}function Je(e,t){Ge(e,function(n){Ge(t,function(r){n&&n.removeAttribute(r)})})}function pe(e,t,n){Ot(t)?bt(t,function(r,o){pe(e,o,r)}):Ge(e,function(r){Qn(n)||n===""?Je(r,t):r.setAttribute(t,String(n))})}function It(e,t,n){var r=document.createElement(e);return t&&(dt(t)?Ze(r,t):pe(r,t)),n&&Xt(n,r),r}function qe(e,t,n){if(Kt(n))return getComputedStyle(e)[t];Qn(n)||(e.style[t]=""+n)}function Vt(e,t){qe(e,"display",t)}function eo(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Ke(e,t){return e.getAttribute(t)}function wr(e,t){return e&&e.classList.contains(t)}function Ve(e){return e.getBoundingClientRect()}function St(e){Ge(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function to(e){return Zt(new DOMParser().parseFromString(e,"text/html").body)}function tt(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function no(e,t){return e&&e.querySelector(t)}function nr(e,t){return t?gt(e.querySelectorAll(t)):[]}function rt(e,t){nt(e,t,!1)}function Vn(e){return e.timeStamp}function yt(e){return dt(e)?e:e?e+"px":""}var Jt="splide",rr="data-"+Jt;function Ht(e,t){if(!e)throw new Error("["+Jt+"] "+(t||""))}var mt=Math.min,gn=Math.max,hn=Math.floor,Dt=Math.ceil,je=Math.abs;function ro(e,t,n){return je(e-t)<n}function un(e,t,n,r){var o=mt(t,n),s=gn(t,n);return r?o<e&&e<s:o<=e&&e<=s}function Tt(e,t,n){var r=mt(t,n),o=gn(t,n);return mt(gn(r,e),o)}function Dn(e){return+(e>0)-+(e<0)}function Gn(e,t){return Ge(t,function(n){e=e.replace("%s",""+n)}),e}function or(e){return e<10?"0"+e:""+e}var $r={};function Fi(e){return""+e+or($r[e]=($r[e]||0)+1)}function oo(){var e=[];function t(i,l,c,d){o(i,l,function(u,T,C){var h="addEventListener"in u,p=h?u.removeEventListener.bind(u,T,c,d):u.removeListener.bind(u,c);h?u.addEventListener(T,c,d):u.addListener(c),e.push([u,T,C,c,p])})}function n(i,l,c){o(i,l,function(d,u,T){e=e.filter(function(C){return C[0]===d&&C[1]===u&&C[2]===T&&(!c||C[3]===c)?(C[4](),!1):!0})})}function r(i,l,c){var d,u=!0;return typeof CustomEvent=="function"?d=new CustomEvent(l,{bubbles:u,detail:c}):(d=document.createEvent("CustomEvent"),d.initCustomEvent(l,u,!1,c)),i.dispatchEvent(d),d}function o(i,l,c){Ge(i,function(d){d&&Ge(l,function(u){u.split(" ").forEach(function(T){var C=T.split(".");c(d,C[0],C[1])})})})}function s(){e.forEach(function(i){i[4]()}),at(e)}return{bind:t,unbind:n,dispatch:r,destroy:s}}var ht="mounted",Un="ready",st="move",Pt="moved",ir="click",io="active",ao="inactive",so="visible",lo="hidden",Le="refresh",We="updated",Ft="resize",xn="resized",co="drag",uo="dragging",po="dragged",Sn="scroll",wt="scrolled",Wi="overflow",ar="destroy",mo="arrows:mounted",go="arrows:updated",ho="pagination:mounted",fo="pagination:updated",sr="navigation:mounted",lr="autoplay:play",yo="autoplay:playing",cr="autoplay:pause",ur="lazyload:loaded",vo="sk",bo="sh",fn="ei";function $e(e){var t=e?e.event.bus:document.createDocumentFragment(),n=oo();function r(s,i){n.bind(t,Yt(s).join(" "),function(l){i.apply(i,Jn(l.detail)?l.detail:[])})}function o(s){n.dispatch(t,s,gt(arguments,1))}return e&&e.event.on(ar,n.destroy),Bt(n,{bus:t,on:r,off:xe(n.unbind,t),emit:o})}function Cn(e,t,n,r){var o=Date.now,s,i=0,l,c=!0,d=0;function u(){if(!c){if(i=e?mt((o()-s)/e,1):1,n&&n(i),i>=1&&(t(),s=o(),r&&++d>=r))return C();l=Sr(u)}}function T(v){v||p(),s=o()-(v?i*e:0),c=!1,l=Sr(u)}function C(){c=!0}function h(){s=o(),i=0,n&&n(i)}function p(){l&&cancelAnimationFrame(l),i=0,l=0,c=!0}function g(v){e=v}function $(){return c}return{start:T,rewind:h,pause:C,cancel:p,set:g,isPaused:$}}function Ri(e){var t=e;function n(o){t=o}function r(o){return er(Yt(o),t)}return{set:n,is:r}}function Pi(e,t){var n=Cn(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Mi(e,t,n){var r=e.state,o=n.breakpoints||{},s=n.reducedMotion||{},i=oo(),l=[];function c(){var p=n.mediaQuery==="min";zt(o).sort(function(g,$){return p?+g-+$:+$-+g}).forEach(function(g){u(o[g],"("+(p?"min":"max")+"-width:"+g+"px)")}),u(s,xr),T()}function d(p){p&&i.destroy()}function u(p,g){var $=matchMedia(g);i.bind($,"change",T),l.push([p,$])}function T(){var p=r.is(mn),g=n.direction,$=l.reduce(function(v,y){return ut(v,y[1].matches?y[0]:{})},{});Cr(n),h($),n.destroy?e.destroy(n.destroy==="completely"):p?(d(!0),e.mount()):g!==n.direction&&e.refresh()}function C(p){matchMedia(xr).matches&&(p?ut(n,s):Cr(n,zt(s)))}function h(p,g,$){ut(n,p),g&&ut(Object.getPrototypeOf(n),p),($||!r.is(Et))&&e.emit(We,n)}return{setup:c,destroy:d,reduce:C,set:h}}var wn="Arrow",$n=wn+"Left",Tn=wn+"Right",xo=wn+"Up",So=wn+"Down",Tr="rtl",_n="ttb",Mn={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[xo,Tn],ArrowRight:[So,$n]};function Hi(e,t,n){function r(s,i,l){l=l||n.direction;var c=l===Tr&&!i?1:l===_n?0:-1;return Mn[s]&&Mn[s][c]||s.replace(/width|left|right/i,function(d,u){var T=Mn[d.toLowerCase()][c]||d;return u>0?T.charAt(0).toUpperCase()+T.slice(1):T})}function o(s){return s*(n.direction===Tr?1:-1)}return{resolve:r,orient:o}}var ot="role",At="tabindex",Ni="disabled",Ye="aria-",Qt=Ye+"controls",Co=Ye+"current",_r=Ye+"selected",De=Ye+"label",pr=Ye+"labelledby",wo=Ye+"hidden",dr=Ye+"orientation",Gt=Ye+"roledescription",Lr=Ye+"live",Er=Ye+"busy",Ir=Ye+"atomic",mr=[ot,At,Ni,Qt,Co,De,pr,wo,dr,Gt],Qe=Jt+"__",ft="is-",Hn=Jt,Ar=Qe+"track",Oi=Qe+"list",Ln=Qe+"slide",$o=Ln+"--clone",ji=Ln+"__container",gr=Qe+"arrows",En=Qe+"arrow",To=En+"--prev",_o=En+"--next",In=Qe+"pagination",Lo=In+"__page",zi=Qe+"progress",Bi=zi+"__bar",Vi=Qe+"toggle",Di=Qe+"spinner",Gi=Qe+"sr",Ui=ft+"initialized",Ct=ft+"active",Eo=ft+"prev",Io=ft+"next",qn=ft+"visible",Kn=ft+"loading",Ao=ft+"focus-in",ko=ft+"overflow",qi=[Ct,qn,Eo,Io,Kn,Ao,ko],Ki={slide:Ln,clone:$o,arrows:gr,arrow:En,prev:To,next:_o,pagination:In,page:Lo,spinner:Di};function Yi(e,t){if(Zr(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!jt(n,t);)n=n.parentElement;return n}var Xi=5,kr=200,Fo="touchstart mousedown",Nn="touchmove mousemove",On="touchend touchcancel mouseup click";function Zi(e,t,n){var r=$e(e),o=r.on,s=r.bind,i=e.root,l=n.i18n,c={},d=[],u=[],T=[],C,h,p;function g(){E(),B(),y()}function $(){o(Le,v),o(Le,g),o(We,y),s(document,Fo+" keydown",function(f){p=f.type==="keydown"},{capture:!0}),s(i,"focusin",function(){nt(i,Ao,!!p)})}function v(f){var x=mr.concat("style");at(d),rt(i,u),rt(C,T),Je([C,h],x),Je(i,f?x:["style",Gt])}function y(){rt(i,u),rt(C,T),u=_(Hn),T=_(Ar),Ze(i,u),Ze(C,T),pe(i,De,n.label),pe(i,pr,n.labelledby)}function E(){C=R("."+Ar),h=Zt(C,"."+Oi),Ht(C&&h,"A track/list element is missing."),cn(d,Qr(h,"."+Ln+":not(."+$o+")")),bt({arrows:gr,pagination:In,prev:To,next:_o,bar:Bi,toggle:Vi},function(f,x){c[x]=R("."+f)}),Bt(c,{root:i,track:C,list:h,slides:d})}function B(){var f=i.id||Fi(Jt),x=n.role;i.id=f,C.id=C.id||f+"-track",h.id=h.id||f+"-list",!Ke(i,ot)&&i.tagName!=="SECTION"&&x&&pe(i,ot,x),pe(i,Gt,l.carousel),pe(h,ot,"presentation")}function R(f){var x=no(i,f);return x&&Yi(x,"."+Hn)===i?x:void 0}function _(f){return[f+"--"+n.type,f+"--"+n.direction,n.drag&&f+"--draggable",n.isNavigation&&f+"--nav",f===Hn&&Ct]}return Bt(c,{setup:g,mount:$,destroy:v})}var Wt="slide",Mt="loop",en="fade";function Ji(e,t,n,r){var o=$e(e),s=o.on,i=o.emit,l=o.bind,c=e.Components,d=e.root,u=e.options,T=u.isNavigation,C=u.updateOnMove,h=u.i18n,p=u.pagination,g=u.slideFocus,$=c.Direction.resolve,v=Ke(r,"style"),y=Ke(r,De),E=n>-1,B=Zt(r,"."+ji),R;function _(){E||(r.id=d.id+"-slide"+or(t+1),pe(r,ot,p?"tabpanel":"group"),pe(r,Gt,h.slide),pe(r,De,y||Gn(h.slideLabel,[t+1,e.length]))),f()}function f(){l(r,"click",xe(i,ir,F)),l(r,"keydown",xe(i,vo,F)),s([Pt,bo,wt],I),s(sr,L),C&&s(st,j)}function x(){R=!0,o.destroy(),rt(r,qi),Je(r,mr),pe(r,"style",v),pe(r,De,y||"")}function L(){var W=e.splides.map(function(A){var N=A.splide.Components.Slides.getAt(t);return N?N.slide.id:""}).join(" ");pe(r,De,Gn(h.slideX,(E?n:t)+1)),pe(r,Qt,W),pe(r,ot,g?"button":""),g&&Je(r,Gt)}function j(){R||I()}function I(){if(!R){var W=e.index;P(),H(),nt(r,Eo,t===W-1),nt(r,Io,t===W+1)}}function P(){var W=D();W!==wr(r,Ct)&&(nt(r,Ct,W),pe(r,Co,T&&W||""),i(W?io:ao,F))}function H(){var W=b(),A=!W&&(!D()||E);if(e.state.is([Rt,qt])||pe(r,wo,A||""),pe(nr(r,u.focusableNodes||""),At,A?-1:""),g&&pe(r,At,A?-1:0),W!==wr(r,qn)&&(nt(r,qn,W),i(W?so:lo,F)),!W&&document.activeElement===r){var N=c.Slides.getAt(e.index);N&&eo(N.slide)}}function z(W,A,N){qe(N&&B||r,W,A)}function D(){var W=e.index;return W===t||u.cloneStatus&&W===n}function b(){if(e.is(en))return D();var W=Ve(c.Elements.track),A=Ve(r),N=$("left",!0),Z=$("right",!0);return hn(W[N])<=Dt(A[N])&&hn(A[Z])<=Dt(W[Z])}function k(W,A){var N=je(W-t);return!E&&(u.rewind||e.is(Mt))&&(N=mt(N,e.length-N)),N<=A}var F={index:t,slideIndex:n,slide:r,container:B,isClone:E,mount:_,destroy:x,update:I,style:z,isWithin:k};return F}function Qi(e,t,n){var r=$e(e),o=r.on,s=r.emit,i=r.bind,l=t.Elements,c=l.slides,d=l.list,u=[];function T(){C(),o(Le,h),o(Le,C)}function C(){c.forEach(function(I,P){g(I,P,-1)})}function h(){R(function(I){I.destroy()}),at(u)}function p(){R(function(I){I.update()})}function g(I,P,H){var z=Ji(e,P,H,I);z.mount(),u.push(z),u.sort(function(D,b){return D.index-b.index})}function $(I){return I?_(function(P){return!P.isClone}):u}function v(I){var P=t.Controller,H=P.toIndex(I),z=P.hasFocus()?1:n.perPage;return _(function(D){return un(D.index,H,H+z-1)})}function y(I){return _(I)[0]}function E(I,P){Ge(I,function(H){if(dt(H)&&(H=to(H)),Jr(H)){var z=c[P];z?tr(H,z):Xt(d,H),Ze(H,n.classes.slide),x(H,xe(s,Ft))}}),s(Le)}function B(I){St(_(I).map(function(P){return P.slide})),s(Le)}function R(I,P){$(P).forEach(I)}function _(I){return u.filter(Zr(I)?I:function(P){return dt(I)?jt(P.slide,I):er(Yt(I),P.index)})}function f(I,P,H){R(function(z){z.style(I,P,H)})}function x(I,P){var H=nr(I,"img"),z=H.length;z?H.forEach(function(D){i(D,"load error",function(){--z||P()})}):P()}function L(I){return I?c.length:u.length}function j(){return u.length>n.perPage}return{mount:T,destroy:h,update:p,register:g,get:$,getIn:v,getAt:y,add:E,remove:B,forEach:R,filter:_,style:f,getLength:L,isEnough:j}}function ea(e,t,n){var r=$e(e),o=r.on,s=r.bind,i=r.emit,l=t.Slides,c=t.Direction.resolve,d=t.Elements,u=d.root,T=d.track,C=d.list,h=l.getAt,p=l.style,g,$,v;function y(){E(),s(window,"resize load",Pi(xe(i,Ft))),o([We,Le],E),o(Ft,B)}function E(){g=n.direction===_n,qe(u,"maxWidth",yt(n.width)),qe(T,c("paddingLeft"),R(!1)),qe(T,c("paddingRight"),R(!0)),B(!0)}function B(F){var W=Ve(u);(F||$.width!==W.width||$.height!==W.height)&&(qe(T,"height",_()),p(c("marginRight"),yt(n.gap)),p("width",x()),p("height",L(),!0),$=W,i(xn),v!==(v=k())&&(nt(u,ko,v),i(Wi,v)))}function R(F){var W=n.padding,A=c(F?"right":"left");return W&&yt(W[A]||(Ot(W)?0:W))||"0px"}function _(){var F="";return g&&(F=f(),Ht(F,"height or heightRatio is missing."),F="calc("+F+" - "+R(!1)+" - "+R(!0)+")"),F}function f(){return yt(n.height||Ve(C).width*n.heightRatio)}function x(){return n.autoWidth?null:yt(n.fixedWidth)||(g?"":j())}function L(){return yt(n.fixedHeight)||(g?n.autoHeight?null:j():f())}function j(){var F=yt(n.gap);return"calc((100%"+(F&&" + "+F)+")/"+(n.perPage||1)+(F&&" - "+F)+")"}function I(){return Ve(C)[c("width")]}function P(F,W){var A=h(F||0);return A?Ve(A.slide)[c("width")]+(W?0:D()):0}function H(F,W){var A=h(F);if(A){var N=Ve(A.slide)[c("right")],Z=Ve(C)[c("left")];return je(N-Z)+(W?0:D())}return 0}function z(F){return H(e.length-1)-H(0)+P(0,F)}function D(){var F=h(0);return F&&parseFloat(qe(F.slide,c("marginRight")))||0}function b(F){return parseFloat(qe(T,c("padding"+(F?"Right":"Left"))))||0}function k(){return e.is(en)||z(!0)>I()}return{mount:y,resize:B,listSize:I,slideSize:P,sliderSize:z,totalSize:H,getPadding:b,isOverflow:k}}var ta=2;function na(e,t,n){var r=$e(e),o=r.on,s=t.Elements,i=t.Slides,l=t.Direction.resolve,c=[],d;function u(){o(Le,T),o([We,Ft],h),(d=$())&&(p(d),t.Layout.resize(!0))}function T(){C(),u()}function C(){St(c),at(c),r.destroy()}function h(){var v=$();d!==v&&(d<v||!v)&&r.emit(Le)}function p(v){var y=i.get().slice(),E=y.length;if(E){for(;y.length<v;)cn(y,y);cn(y.slice(-v),y.slice(0,v)).forEach(function(B,R){var _=R<v,f=g(B.slide,R);_?tr(f,y[0].slide):Xt(s.list,f),cn(c,f),i.register(f,R-v+(_?0:E),B.index)})}}function g(v,y){var E=v.cloneNode(!0);return Ze(E,n.classes.clone),E.id=e.root.id+"-clone"+or(y+1),E}function $(){var v=n.clones;if(!e.is(Mt))v=0;else if(Kt(v)){var y=n[l("fixedWidth")]&&t.Layout.slideSize(0),E=y&&Dt(Ve(s.track)[l("width")]/y);v=E||n[l("autoWidth")]&&e.length||n.perPage*ta}return v}return{mount:u,destroy:C}}function ra(e,t,n){var r=$e(e),o=r.on,s=r.emit,i=e.state.set,l=t.Layout,c=l.slideSize,d=l.getPadding,u=l.totalSize,T=l.listSize,C=l.sliderSize,h=t.Direction,p=h.resolve,g=h.orient,$=t.Elements,v=$.list,y=$.track,E;function B(){E=t.Transition,o([ht,xn,We,Le],R)}function R(){t.Controller.isBusy()||(t.Scroll.cancel(),f(e.index),t.Slides.update())}function _(A,N,Z,le){A!==N&&F(A>Z)&&(I(),x(j(z(),A>Z),!0)),i(Rt),s(st,N,Z,A),E.start(N,function(){i(kt),s(Pt,N,Z,A),le&&le()})}function f(A){x(H(A,!0))}function x(A,N){if(!e.is(en)){var Z=N?A:L(A);qe(v,"transform","translate"+p("X")+"("+Z+"px)"),A!==Z&&s(bo)}}function L(A){if(e.is(Mt)){var N=P(A),Z=N>t.Controller.getEnd(),le=N<0;(le||Z)&&(A=j(A,Z))}return A}function j(A,N){var Z=A-k(N),le=C();return A-=g(le*(Dt(je(Z)/le)||1))*(N?1:-1),A}function I(){x(z(),!0),E.cancel()}function P(A){for(var N=t.Slides.get(),Z=0,le=1/0,ne=0;ne<N.length;ne++){var de=N[ne].index,M=je(H(de,!0)-A);if(M<=le)le=M,Z=de;else break}return Z}function H(A,N){var Z=g(u(A-1)-b(A));return N?D(Z):Z}function z(){var A=p("left");return Ve(v)[A]-Ve(y)[A]+g(d(!1))}function D(A){return n.trimSpace&&e.is(Wt)&&(A=Tt(A,0,g(C(!0)-T()))),A}function b(A){var N=n.focus;return N==="center"?(T()-c(A,!0))/2:+N*c(A)||0}function k(A){return H(A?t.Controller.getEnd():0,!!n.trimSpace)}function F(A){var N=g(j(z(),A));return A?N>=0:N<=v[p("scrollWidth")]-Ve(y)[p("width")]}function W(A,N){N=Kt(N)?z():N;var Z=A!==!0&&g(N)<g(k(!1)),le=A!==!1&&g(N)>g(k(!0));return Z||le}return{mount:B,move:_,jump:f,translate:x,shift:j,cancel:I,toIndex:P,toPosition:H,getPosition:z,getLimit:k,exceededLimit:W,reposition:R}}function oa(e,t,n){var r=$e(e),o=r.on,s=r.emit,i=t.Move,l=i.getPosition,c=i.getLimit,d=i.toPosition,u=t.Slides,T=u.isEnough,C=u.getLength,h=n.omitEnd,p=e.is(Mt),g=e.is(Wt),$=xe(z,!1),v=xe(z,!0),y=n.start||0,E,B=y,R,_,f;function x(){L(),o([We,Le,fn],L),o(xn,j)}function L(){R=C(!0),_=n.perMove,f=n.perPage,E=F();var M=Tt(y,0,h?E:R-1);M!==y&&(y=M,i.reposition())}function j(){E!==F()&&s(fn)}function I(M,te,fe){if(!de()){var me=H(M),ge=k(me);ge>-1&&(te||ge!==y)&&(Z(ge),i.move(me,ge,B,fe))}}function P(M,te,fe,me){t.Scroll.scroll(M,te,fe,function(){var ge=k(i.toIndex(l()));Z(h?mt(ge,E):ge),me&&me()})}function H(M){var te=y;if(dt(M)){var fe=M.match(/([+\-<>])(\d+)?/)||[],me=fe[1],ge=fe[2];me==="+"||me==="-"?te=D(y+ +(""+me+(+ge||1)),y):me===">"?te=ge?W(+ge):$(!0):me==="<"&&(te=v(!0))}else te=p?M:Tt(M,0,E);return te}function z(M,te){var fe=_||(ne()?1:f),me=D(y+fe*(M?-1:1),y,!(_||ne()));return me===-1&&g&&!ro(l(),c(!M),1)?M?0:E:te?me:k(me)}function D(M,te,fe){if(T()||ne()){var me=b(M);me!==M&&(te=M,M=me,fe=!1),M<0||M>E?!_&&(un(0,M,te,!0)||un(E,te,M,!0))?M=W(A(M)):p?M=fe?M<0?-(R%f||f):R:M:n.rewind?M=M<0?E:0:M=-1:fe&&M!==te&&(M=W(A(te)+(M<te?-1:1)))}else M=-1;return M}function b(M){if(g&&n.trimSpace==="move"&&M!==y)for(var te=l();te===d(M,!0)&&un(M,0,e.length-1,!n.rewind);)M<y?--M:++M;return M}function k(M){return p?(M+R)%R||0:M}function F(){for(var M=R-(ne()||p&&_?1:f);h&&M-- >0;)if(d(R-1,!0)!==d(M,!0)){M++;break}return Tt(M,0,R-1)}function W(M){return Tt(ne()?M:f*M,0,E)}function A(M){return ne()?mt(M,E):hn((M>=E?R-1:M)/f)}function N(M){var te=i.toIndex(M);return g?Tt(te,0,E):te}function Z(M){M!==y&&(B=y,y=M)}function le(M){return M?B:y}function ne(){return!Kt(n.focus)||n.isNavigation}function de(){return e.state.is([Rt,qt])&&!!n.waitForTransition}return{mount:x,go:I,scroll:P,getNext:$,getPrev:v,getAdjacent:z,getEnd:F,setIndex:Z,getIndex:le,toIndex:W,toPage:A,toDest:N,hasFocus:ne,isBusy:de}}var ia="http://www.w3.org/2000/svg",aa="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",nn=40;function sa(e,t,n){var r=$e(e),o=r.on,s=r.bind,i=r.emit,l=n.classes,c=n.i18n,d=t.Elements,u=t.Controller,T=d.arrows,C=d.track,h=T,p=d.prev,g=d.next,$,v,y={};function E(){R(),o(We,B)}function B(){_(),E()}function R(){var P=n.arrows;P&&!(p&&g)&&L(),p&&g&&(Bt(y,{prev:p,next:g}),Vt(h,P?"":"none"),Ze(h,v=gr+"--"+n.direction),P&&(f(),I(),pe([p,g],Qt,C.id),i(mo,p,g)))}function _(){r.destroy(),rt(h,v),$?(St(T?[p,g]:h),p=g=null):Je([p,g],mr)}function f(){o([ht,Pt,Le,wt,fn],I),s(g,"click",xe(x,">")),s(p,"click",xe(x,"<"))}function x(P){u.go(P,!0)}function L(){h=T||It("div",l.arrows),p=j(!0),g=j(!1),$=!0,Xt(h,[p,g]),!T&&tr(h,C)}function j(P){var H='<button class="'+l.arrow+" "+(P?l.prev:l.next)+'" type="button"><svg xmlns="'+ia+'" viewBox="0 0 '+nn+" "+nn+'" width="'+nn+'" height="'+nn+'" focusable="false"><path d="'+(n.arrowPath||aa)+'" />';return to(H)}function I(){if(p&&g){var P=e.index,H=u.getPrev(),z=u.getNext(),D=H>-1&&P<H?c.last:c.prev,b=z>-1&&P>z?c.first:c.next;p.disabled=H<0,g.disabled=z<0,pe(p,De,D),pe(g,De,b),i(go,p,g,H,z)}}return{arrows:y,mount:E,destroy:_,update:I}}var la=rr+"-interval";function ca(e,t,n){var r=$e(e),o=r.on,s=r.bind,i=r.emit,l=Cn(n.interval,e.go.bind(e,">"),f),c=l.isPaused,d=t.Elements,u=t.Elements,T=u.root,C=u.toggle,h=n.autoplay,p,g,$=h==="pause";function v(){h&&(y(),C&&pe(C,Qt,d.track.id),$||E(),_())}function y(){n.pauseOnHover&&s(T,"mouseenter mouseleave",function(L){p=L.type==="mouseenter",R()}),n.pauseOnFocus&&s(T,"focusin focusout",function(L){g=L.type==="focusin",R()}),C&&s(C,"click",function(){$?E():B(!0)}),o([st,Sn,Le],l.rewind),o(st,x)}function E(){c()&&t.Slides.isEnough()&&(l.start(!n.resetProgress),g=p=$=!1,_(),i(lr))}function B(L){L===void 0&&(L=!0),$=!!L,_(),c()||(l.pause(),i(cr))}function R(){$||(p||g?B(!1):E())}function _(){C&&(nt(C,Ct,!$),pe(C,De,n.i18n[$?"play":"pause"]))}function f(L){var j=d.bar;j&&qe(j,"width",L*100+"%"),i(yo,L)}function x(L){var j=t.Slides.getAt(L);l.set(j&&+Ke(j.slide,la)||n.interval)}return{mount:v,destroy:l.cancel,play:E,pause:B,isPaused:c}}function ua(e,t,n){var r=$e(e),o=r.on;function s(){n.cover&&(o(ur,xe(l,!0)),o([ht,We,Le],xe(i,!0)))}function i(c){t.Slides.forEach(function(d){var u=Zt(d.container||d.slide,"img");u&&u.src&&l(c,u,d)})}function l(c,d,u){u.style("background",c?'center/cover no-repeat url("'+d.src+'")':"",!0),Vt(d,c?"none":"")}return{mount:s,destroy:xe(i,!1)}}var pa=10,da=600,ma=.6,ga=1.5,ha=800;function fa(e,t,n){var r=$e(e),o=r.on,s=r.emit,i=e.state.set,l=t.Move,c=l.getPosition,d=l.getLimit,u=l.exceededLimit,T=l.translate,C=e.is(Wt),h,p,g=1;function $(){o(st,B),o([We,Le],R)}function v(f,x,L,j,I){var P=c();if(B(),L&&(!C||!u())){var H=t.Layout.sliderSize(),z=Dn(f)*H*hn(je(f)/H)||0;f=l.toPosition(t.Controller.toDest(f%H))+z}var D=ro(P,f,1);g=1,x=D?0:x||gn(je(f-P)/ga,ha),p=j,h=Cn(x,y,xe(E,P,f,I),1),i(qt),s(Sn),h.start()}function y(){i(kt),p&&p(),s(wt)}function E(f,x,L,j){var I=c(),P=f+(x-f)*_(j),H=(P-I)*g;T(I+H),C&&!L&&u()&&(g*=ma,je(H)<pa&&v(d(u(!0)),da,!1,p,!0))}function B(){h&&h.cancel()}function R(){h&&!h.isPaused()&&(B(),y())}function _(f){var x=n.easingFunc;return x?x(f):1-Math.pow(1-f,4)}return{mount:$,destroy:B,scroll:v,cancel:R}}var _t={passive:!1,capture:!0};function ya(e,t,n){var r=$e(e),o=r.on,s=r.emit,i=r.bind,l=r.unbind,c=e.state,d=t.Move,u=t.Scroll,T=t.Controller,C=t.Elements.track,h=t.Media.reduce,p=t.Direction,g=p.resolve,$=p.orient,v=d.getPosition,y=d.exceededLimit,E,B,R,_,f,x=!1,L,j,I;function P(){i(C,Nn,Bn,_t),i(C,On,Bn,_t),i(C,Fo,z,_t),i(C,"click",k,{capture:!0}),i(C,"dragstart",tt),o([ht,We],H)}function H(){var O=n.drag;ie(!O),_=O==="free"}function z(O){if(L=!1,!j){var w=ge(O);me(O.target)&&(w||!O.button)&&(T.isBusy()?tt(O,!0):(I=w?C:window,f=c.is([Rt,qt]),R=null,i(I,Nn,D,_t),i(I,On,b,_t),d.cancel(),u.cancel(),F(O)))}}function D(O){if(c.is(ln)||(c.set(ln),s(co)),O.cancelable)if(f){d.translate(E+fe(ne(O)));var w=de(O)>kr,G=x!==(x=y());(w||G)&&F(O),L=!0,s(uo),tt(O)}else N(O)&&(f=A(O),tt(O))}function b(O){c.is(ln)&&(c.set(kt),s(po)),f&&(W(O),tt(O)),l(I,Nn,D),l(I,On,b),f=!1}function k(O){!j&&L&&tt(O,!0)}function F(O){R=B,B=O,E=v()}function W(O){var w=Z(O),G=le(w),Y=n.rewind&&n.rewindByDrag;h(!1),_?T.scroll(G,0,n.snap):e.is(en)?T.go($(Dn(w))<0?Y?"<":"-":Y?">":"+"):e.is(Wt)&&x&&Y?T.go(y(!0)?">":"<"):T.go(T.toDest(G),!0),h(!0)}function A(O){var w=n.dragMinThreshold,G=Ot(w),Y=G&&w.mouse||0,J=(G?w.touch:+w)||10;return je(ne(O))>(ge(O)?J:Y)}function N(O){return je(ne(O))>je(ne(O,!0))}function Z(O){if(e.is(Mt)||!x){var w=de(O);if(w&&w<kr)return ne(O)/w}return 0}function le(O){return v()+Dn(O)*mt(je(O)*(n.flickPower||600),_?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function ne(O,w){return te(O,w)-te(M(O),w)}function de(O){return Vn(O)-Vn(M(O))}function M(O){return B===O&&R||B}function te(O,w){return(ge(O)?O.changedTouches[0]:O)["page"+g(w?"Y":"X")]}function fe(O){return O/(x&&e.is(Wt)?Xi:1)}function me(O){var w=n.noDrag;return!jt(O,"."+Lo+", ."+En)&&(!w||!jt(O,w))}function ge(O){return typeof TouchEvent<"u"&&O instanceof TouchEvent}function q(){return f}function ie(O){j=O}return{mount:P,disable:ie,isDragging:q}}var va={Spacebar:" ",Right:Tn,Left:$n,Up:xo,Down:So};function hr(e){return e=dt(e)?e:e.key,va[e]||e}var Fr="keydown";function ba(e,t,n){var r=$e(e),o=r.on,s=r.bind,i=r.unbind,l=e.root,c=t.Direction.resolve,d,u;function T(){C(),o(We,h),o(We,C),o(st,g)}function C(){var v=n.keyboard;v&&(d=v==="global"?window:l,s(d,Fr,$))}function h(){i(d,Fr)}function p(v){u=v}function g(){var v=u;u=!0,Xr(function(){u=v})}function $(v){if(!u){var y=hr(v);y===c($n)?e.go("<"):y===c(Tn)&&e.go(">")}}return{mount:T,destroy:h,disable:p}}var Nt=rr+"-lazy",pn=Nt+"-srcset",xa="["+Nt+"], ["+pn+"]";function Sa(e,t,n){var r=$e(e),o=r.on,s=r.off,i=r.bind,l=r.emit,c=n.lazyLoad==="sequential",d=[Pt,wt],u=[];function T(){n.lazyLoad&&(C(),o(Le,C))}function C(){at(u),h(),c?v():(s(d),o(d,p),p())}function h(){t.Slides.forEach(function(y){nr(y.slide,xa).forEach(function(E){var B=Ke(E,Nt),R=Ke(E,pn);if(B!==E.src||R!==E.srcset){var _=n.classes.spinner,f=E.parentElement,x=Zt(f,"."+_)||It("span",_,f);u.push([E,y,x]),E.src||Vt(E,"none")}})})}function p(){u=u.filter(function(y){var E=n.perPage*((n.preloadPages||1)+1)-1;return y[1].isWithin(e.index,E)?g(y):!0}),u.length||s(d)}function g(y){var E=y[0];Ze(y[1].slide,Kn),i(E,"load error",xe($,y)),pe(E,"src",Ke(E,Nt)),pe(E,"srcset",Ke(E,pn)),Je(E,Nt),Je(E,pn)}function $(y,E){var B=y[0],R=y[1];rt(R.slide,Kn),E.type!=="error"&&(St(y[2]),Vt(B,""),l(ur,B,R),l(Ft)),c&&v()}function v(){u.length&&g(u.shift())}return{mount:T,destroy:xe(at,u),check:p}}function Ca(e,t,n){var r=$e(e),o=r.on,s=r.emit,i=r.bind,l=t.Slides,c=t.Elements,d=t.Controller,u=d.hasFocus,T=d.getIndex,C=d.go,h=t.Direction.resolve,p=c.pagination,g=[],$,v;function y(){E(),o([We,Le,fn],y);var j=n.pagination;p&&Vt(p,j?"":"none"),j&&(o([st,Sn,wt],L),B(),L(),s(ho,{list:$,items:g},x(e.index)))}function E(){$&&(St(p?gt($.children):$),rt($,v),at(g),$=null),r.destroy()}function B(){var j=e.length,I=n.classes,P=n.i18n,H=n.perPage,z=u()?d.getEnd()+1:Dt(j/H);$=p||It("ul",I.pagination,c.track.parentElement),Ze($,v=In+"--"+f()),pe($,ot,"tablist"),pe($,De,P.select),pe($,dr,f()===_n?"vertical":"");for(var D=0;D<z;D++){var b=It("li",null,$),k=It("button",{class:I.page,type:"button"},b),F=l.getIn(D).map(function(A){return A.slide.id}),W=!u()&&H>1?P.pageX:P.slideX;i(k,"click",xe(R,D)),n.paginationKeyboard&&i(k,"keydown",xe(_,D)),pe(b,ot,"presentation"),pe(k,ot,"tab"),pe(k,Qt,F.join(" ")),pe(k,De,Gn(W,D+1)),pe(k,At,-1),g.push({li:b,button:k,page:D})}}function R(j){C(">"+j,!0)}function _(j,I){var P=g.length,H=hr(I),z=f(),D=-1;H===h(Tn,!1,z)?D=++j%P:H===h($n,!1,z)?D=(--j+P)%P:H==="Home"?D=0:H==="End"&&(D=P-1);var b=g[D];b&&(eo(b.button),C(">"+D),tt(I,!0))}function f(){return n.paginationDirection||n.direction}function x(j){return g[d.toPage(j)]}function L(){var j=x(T(!0)),I=x(T());if(j){var P=j.button;rt(P,Ct),Je(P,_r),pe(P,At,-1)}if(I){var H=I.button;Ze(H,Ct),pe(H,_r,!0),pe(H,At,"")}s(fo,{list:$,items:g},j,I)}return{items:g,mount:y,destroy:E,getAt:x,update:L}}var wa=[" ","Enter"];function $a(e,t,n){var r=n.isNavigation,o=n.slideFocus,s=[];function i(){e.splides.forEach(function(p){p.isParent||(d(e,p.splide),d(p.splide,e))}),r&&u()}function l(){s.forEach(function(p){p.destroy()}),at(s)}function c(){l(),i()}function d(p,g){var $=$e(p);$.on(st,function(v,y,E){g.go(g.is(Mt)?E:v)}),s.push($)}function u(){var p=$e(e),g=p.on;g(ir,C),g(vo,h),g([ht,We],T),s.push(p),p.emit(sr,e.splides)}function T(){pe(t.Elements.list,dr,n.direction===_n?"vertical":"")}function C(p){e.go(p.index)}function h(p,g){er(wa,hr(g))&&(C(p),tt(g))}return{setup:xe(t.Media.set,{slideFocus:Kt(o)?r:o},!0),mount:i,destroy:l,remount:c}}function Ta(e,t,n){var r=$e(e),o=r.bind,s=0;function i(){n.wheel&&o(t.Elements.track,"wheel",l,_t)}function l(d){if(d.cancelable){var u=d.deltaY,T=u<0,C=Vn(d),h=n.wheelMinThreshold||0,p=n.wheelSleep||0;je(u)>h&&C-s>p&&(e.go(T?"<":">"),s=C),c(T)&&tt(d)}}function c(d){return!n.releaseWheel||e.state.is(Rt)||t.Controller.getAdjacent(d)!==-1}return{mount:i}}var _a=90;function La(e,t,n){var r=$e(e),o=r.on,s=t.Elements.track,i=n.live&&!n.isNavigation,l=It("span",Gi),c=Cn(_a,xe(u,!1));function d(){i&&(C(!t.Autoplay.isPaused()),pe(s,Ir,!0),l.textContent="…",o(lr,xe(C,!0)),o(cr,xe(C,!1)),o([Pt,wt],xe(u,!0)))}function u(h){pe(s,Er,h),h?(Xt(s,l),c.start()):(St(l),c.cancel())}function T(){Je(s,[Lr,Ir,Er]),St(l)}function C(h){i&&pe(s,Lr,h?"off":"polite")}return{mount:d,disable:C,destroy:T}}var Ea=Object.freeze({__proto__:null,Media:Mi,Direction:Hi,Elements:Zi,Slides:Qi,Layout:ea,Clones:na,Move:ra,Controller:oa,Arrows:sa,Autoplay:ca,Cover:ua,Scroll:fa,Drag:ya,Keyboard:ba,LazyLoad:Sa,Pagination:Ca,Sync:$a,Wheel:Ta,Live:La}),Ia={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"},Aa={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:Ki,i18n:Ia,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function ka(e,t,n){var r=t.Slides;function o(){$e(e).on([ht,Le],s)}function s(){r.forEach(function(l){l.style("transform","translateX(-"+100*l.index+"%)")})}function i(l,c){r.style("transition","opacity "+n.speed+"ms "+n.easing),Xr(c)}return{mount:o,start:i,cancel:Bn}}function Fa(e,t,n){var r=t.Move,o=t.Controller,s=t.Scroll,i=t.Elements.list,l=xe(qe,i,"transition"),c;function d(){$e(e).bind(i,"transitionend",function(h){h.target===i&&c&&(T(),c())})}function u(h,p){var g=r.toPosition(h,!0),$=r.getPosition(),v=C(h);je(g-$)>=1&&v>=1?n.useScroll?s.scroll(g,v,!1,p):(l("transform "+v+"ms "+n.easing),r.translate(g,!0),c=p):(r.jump(h),p())}function T(){l(""),s.cancel()}function C(h){var p=n.rewindSpeed;if(e.is(Wt)&&p){var g=o.getIndex(!0),$=o.getEnd();if(g===0&&h>=$||g>=$&&h===0)return p}return n.speed}return{mount:d,start:u,cancel:T}}var Wa=(function(){function e(n,r){this.event=$e(),this.Components={},this.state=Ri(Et),this.splides=[],this._o={},this._E={};var o=dt(n)?no(document,n):n;Ht(o,o+" is invalid."),this.root=o,r=ut({label:Ke(o,De)||"",labelledby:Ke(o,pr)||""},Aa,e.defaults,r||{});try{ut(r,JSON.parse(Ke(o,rr)))}catch{Ht(!1,"Invalid JSON")}this._o=Object.create(ut({},r))}var t=e.prototype;return t.mount=function(r,o){var s=this,i=this.state,l=this.Components;Ht(i.is([Et,mn]),"Already mounted!"),i.set(Et),this._C=l,this._T=o||this._T||(this.is(en)?ka:Fa),this._E=r||this._E;var c=Bt({},Ea,this._E,{Transition:this._T});return bt(c,function(d,u){var T=d(s,l,s._o);l[u]=T,T.setup&&T.setup()}),bt(l,function(d){d.mount&&d.mount()}),this.emit(ht),Ze(this.root,Ui),i.set(kt),this.emit(Un),this},t.sync=function(r){return this.splides.push({splide:r}),r.splides.push({splide:this,isParent:!0}),this.state.is(kt)&&(this._C.Sync.remount(),r.Components.Sync.remount()),this},t.go=function(r){return this._C.Controller.go(r),this},t.on=function(r,o){return this.event.on(r,o),this},t.off=function(r){return this.event.off(r),this},t.emit=function(r){var o;return(o=this.event).emit.apply(o,[r].concat(gt(arguments,1))),this},t.add=function(r,o){return this._C.Slides.add(r,o),this},t.remove=function(r){return this._C.Slides.remove(r),this},t.is=function(r){return this._o.type===r},t.refresh=function(){return this.emit(Le),this},t.destroy=function(r){r===void 0&&(r=!0);var o=this.event,s=this.state;return s.is(Et)?$e(this).on(Un,this.destroy.bind(this,r)):(bt(this._C,function(i){i.destroy&&i.destroy(r)},!0),o.emit(ar),o.destroy(),r&&at(this.splides),s.set(mn)),this},Ii(e,[{key:"options",get:function(){return this._o},set:function(r){this._C.Media.set(r,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),fr=Wa;fr.defaults={};fr.STATES=ki;var Wr=[[ht,"onMounted"],[Un,"onReady"],[st,"onMove"],[Pt,"onMoved"],[ir,"onClick"],[io,"onActive"],[ao,"onInactive"],[so,"onVisible"],[lo,"onHidden"],[Le,"onRefresh"],[We,"onUpdated"],[Ft,"onResize"],[xn,"onResized"],[co,"onDrag"],[uo,"onDragging"],[po,"onDragged"],[Sn,"onScroll"],[wt,"onScrolled"],[ar,"onDestroy"],[mo,"onArrowsMounted"],[go,"onArrowsUpdated"],[ho,"onPaginationMounted"],[fo,"onPaginationUpdated"],[sr,"onNavigationMounted"],[lr,"onAutoplayPlay"],[yo,"onAutoplayPlaying"],[cr,"onAutoplayPause"],[ur,"onLazyLoadLoaded"]];function yr(...e){return e.filter(Boolean).join(" ")}function yn(e){return e!==null&&typeof e=="object"}function Yn(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,r)=>!Yn(n,t[r]));if(yn(e)&&yn(t)){const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Yn(e[o],t[o]))}return e===t}function Ra(e,t){return e.length===t.length&&!e.some((n,r)=>n!==t[r])}function Pa(e,t){if(e){const n=Object.keys(e);for(let r=0;r<n.length;r++){const o=n[r];if(o!=="__proto__"&&t(e[o],o)===!1)break}}return e}function Xn(e,t){const n=e;return Pa(t,(r,o)=>{Array.isArray(r)?n[o]=r.slice():yn(r)?n[o]=Xn(yn(n[o])?n[o]:{},r):n[o]=r}),n}var Ma=({children:e,className:t,...n})=>m.createElement("div",{className:yr("splide__track",t),...n},m.createElement("ul",{className:"splide__list"},e)),vr=class extends m.Component{constructor(){super(...arguments),this.splideRef=m.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:r}=this.splideRef;r&&(this.splide=new fr(r,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Xn({},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&&!Yn(this.options,e)&&(this.splide.options=e,this.options=Xn({},e));const t=this.getSlides();Ra(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){Wr.forEach(([t,n])=>{const r=this.props[n];typeof r=="function"&&e.on(t,(...o)=>{r(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:r,...o}=this.props;return m.createElement(t,{className:yr("splide",e),ref:this.splideRef,...this.omit(o,["options",...Wr.map(s=>s[1])])},n?m.createElement(Ma,null,r):r)}},br=({children:e,className:t,...n})=>m.createElement("li",{className:yr("splide__slide",t),...n},e);/*!
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),g=require("react"),ve=require("classnames"),$=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),po=require("react-dom");function ri(e){return e.type==="object"&&e.version===1}const oi="ControlSlider-module__wrapper___sHEkd",ii="ControlSlider-module__hoverArrow___A-dOH",ai="ControlSlider-module__sliderItem___QQSkR",li="ControlSlider-module__sliderImage___9hRl-",si="ControlSlider-module__arrow___05ghY",ci="ControlSlider-module__arrowVertical___tBfVN",di="ControlSlider-module__nextArrow___-30Yc",ui="ControlSlider-module__arrowInner___aEra3",pi="ControlSlider-module__arrowIcon___S4ztF",mi="ControlSlider-module__arrowImg___2dwJW",gi="ControlSlider-module__mirror___brd6U",hi="ControlSlider-module__pagination___bicLF",fi="ControlSlider-module__paginationInner___bT-P-",yi="ControlSlider-module__paginationVertical___zYqKw",vi="ControlSlider-module__paginationItem___nTRbk",bi="ControlSlider-module__dot___p1Qun",xi="ControlSlider-module__activeDot___LHFaj",Ci="ControlSlider-module__paginationInsideBottom___R3FWn",Si="ControlSlider-module__paginationInsideTop___V-qb-",$i="ControlSlider-module__paginationOutsideBottom___14w8D",wi="ControlSlider-module__paginationOutsideTop___SCLqB",Ti="ControlSlider-module__paginationInsideLeft___yOBRZ",Li="ControlSlider-module__paginationInsideRight___Rtt3o",_i="ControlSlider-module__paginationOutsideLeft___lahaw",Wi="ControlSlider-module__paginationOutsideRight___EtuQa",Ei="ControlSlider-module__imgWrapper___UjEgB",Pi="ControlSlider-module__captionBlock___dJ6-j",Ai="ControlSlider-module__captionTextWrapper___HFlpf",Ii="ControlSlider-module__captionText___uGBVc",Ri="ControlSlider-module__active___WZK4G",ki="ControlSlider-module__withPointerEvents___t-18M",Fi="ControlSlider-module__topLeftAlignment___zjnGM",Mi="ControlSlider-module__topCenterAlignment___gD1xW",Hi="ControlSlider-module__topRightAlignment___NMapS",Ni="ControlSlider-module__middleLeftAlignment___OnUrY",Oi="ControlSlider-module__middleCenterAlignment___Tdkl0",Bi="ControlSlider-module__middleRightAlignment___wEbfX",Di="ControlSlider-module__bottomLeftAlignment___cTP2-",ji="ControlSlider-module__bottomCenterAlignment___c54fB",zi="ControlSlider-module__bottomRightAlignment___kEwrz",Vi="ControlSlider-module__clickOverlay___DZA28",Ki="ControlSlider-module__contain___pLyq7",Gi="ControlSlider-module__cover___KdDat",te={wrapper:oi,hoverArrow:ii,sliderItem:ai,sliderImage:li,arrow:si,arrowVertical:ci,nextArrow:di,arrowInner:ui,arrowIcon:pi,arrowImg:mi,mirror:gi,pagination:hi,paginationInner:fi,paginationVertical:yi,paginationItem:vi,dot:bi,activeDot:xi,paginationInsideBottom:Ci,paginationInsideTop:Si,paginationOutsideBottom:$i,paginationOutsideTop:wi,paginationInsideLeft:Ti,paginationInsideRight:Li,paginationOutsideLeft:_i,paginationOutsideRight:Wi,imgWrapper:Ei,captionBlock:Pi,captionTextWrapper:Ai,captionText:Ii,active:Ri,withPointerEvents:ki,topLeftAlignment:Fi,topCenterAlignment:Mi,topRightAlignment:Hi,middleLeftAlignment:Ni,middleCenterAlignment:Oi,middleRightAlignment:Bi,bottomLeftAlignment:Di,bottomCenterAlignment:ji,bottomRightAlignment:zi,clickOverlay:Vi,contain:Ki,cover:Gi};function Ui(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function qi(e,t,n){return t&&Ui(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Nr="(prefers-reduced-motion: reduce)",Ft=1,Yi=2,Nt=3,Dt=4,rn=5,wn=6,An=7,Xi={CREATED:Ft,MOUNTED:Yi,IDLE:Nt,MOVING:Dt,SCROLLING:rn,DRAGGING:wn,DESTROYED:An};function pt(e){e.length=0}function xt(e,t,n){return Array.prototype.slice.call(e,t,n)}function $e(e){return e.bind.apply(e,[null].concat(xt(arguments,1)))}var mo=setTimeout,ir=function(){};function Or(e){return requestAnimationFrame(e)}function On(e,t){return typeof t===e}function qt(e){return!hr(e)&&On("object",e)}var gr=Array.isArray,go=$e(On,"function"),vt=$e(On,"string"),on=$e(On,"undefined");function hr(e){return e===null}function ho(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function an(e){return gr(e)?e:[e]}function Ye(e,t){an(e).forEach(t)}function fr(e,t){return e.indexOf(t)>-1}function Tn(e,t){return e.push.apply(e,an(t)),e}function st(e,t,n){e&&Ye(t,function(r){r&&e.classList[n?"add":"remove"](r)})}function rt(e,t){st(e,vt(t)?t.split(" "):t,!0)}function ln(e,t){Ye(t,e.appendChild.bind(e))}function yr(e,t){Ye(e,function(n){var r=(t||n).parentNode;r&&r.insertBefore(n,t)})}function Yt(e,t){return ho(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function fo(e,t){var n=e?xt(e.children):[];return t?n.filter(function(r){return Yt(r,t)}):n}function sn(e,t){return t?fo(e,t)[0]:e.firstElementChild}var Xt=Object.keys;function Tt(e,t,n){return e&&(n?Xt(e).reverse():Xt(e)).forEach(function(r){r!=="__proto__"&&t(e[r],r)}),e}function Zt(e){return xt(arguments,1).forEach(function(t){Tt(t,function(n,r){e[r]=t[r]})}),e}function ft(e){return xt(arguments,1).forEach(function(t){Tt(t,function(n,r){gr(n)?e[r]=n.slice():qt(n)?e[r]=ft({},qt(e[r])?e[r]:{},n):e[r]=n})}),e}function Br(e,t){Ye(t||Xt(e),function(n){delete e[n]})}function ot(e,t){Ye(e,function(n){Ye(t,function(r){n&&n.removeAttribute(r)})})}function de(e,t,n){qt(t)?Tt(t,function(r,o){de(e,o,r)}):Ye(e,function(r){hr(n)||n===""?ot(r,t):r.setAttribute(t,String(n))})}function Mt(e,t,n){var r=document.createElement(e);return t&&(vt(t)?rt(r,t):de(r,t)),n&&ln(n,r),r}function Je(e,t,n){if(on(n))return getComputedStyle(e)[t];hr(n)||(e.style[t]=""+n)}function Jt(e,t){Je(e,"display",t)}function yo(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Qe(e,t){return e.getAttribute(t)}function Dr(e,t){return e&&e.classList.contains(t)}function Ue(e){return e.getBoundingClientRect()}function Lt(e){Ye(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function vo(e){return sn(new DOMParser().parseFromString(e,"text/html").body)}function lt(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function bo(e,t){return e&&e.querySelector(t)}function vr(e,t){return t?xt(e.querySelectorAll(t)):[]}function ct(e,t){st(e,t,!1)}function ar(e){return e.timeStamp}function $t(e){return vt(e)?e:e?e+"px":""}var cn="splide",br="data-"+cn;function Gt(e,t){if(!e)throw new Error("["+cn+"] "+(t||""))}var bt=Math.min,In=Math.max,Rn=Math.floor,Qt=Math.ceil,Ne=Math.abs;function xo(e,t,n){return Ne(e-t)<n}function Ln(e,t,n,r){var o=bt(t,n),l=In(t,n);return r?o<e&&e<l:o<=e&&e<=l}function It(e,t,n){var r=bt(t,n),o=In(t,n);return bt(In(r,e),o)}function lr(e){return+(e>0)-+(e<0)}function sr(e,t){return Ye(t,function(n){e=e.replace("%s",""+n)}),e}function xr(e){return e<10?"0"+e:""+e}var jr={};function Zi(e){return""+e+xr(jr[e]=(jr[e]||0)+1)}function Co(){var e=[];function t(i,c,s,u){o(i,c,function(d,L,b){var f="addEventListener"in d,p=f?d.removeEventListener.bind(d,L,s,u):d.removeListener.bind(d,s);f?d.addEventListener(L,s,u):d.addListener(s),e.push([d,L,b,s,p])})}function n(i,c,s){o(i,c,function(u,d,L){e=e.filter(function(b){return b[0]===u&&b[1]===d&&b[2]===L&&(!s||b[3]===s)?(b[4](),!1):!0})})}function r(i,c,s){var u,d=!0;return typeof CustomEvent=="function"?u=new CustomEvent(c,{bubbles:d,detail:s}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(c,d,!1,s)),i.dispatchEvent(u),u}function o(i,c,s){Ye(i,function(u){u&&Ye(c,function(d){d.split(" ").forEach(function(L){var b=L.split(".");s(u,b[0],b[1])})})})}function l(){e.forEach(function(i){i[4]()}),pt(e)}return{bind:t,unbind:n,dispatch:r,destroy:l}}var Ct="mounted",cr="ready",mt="move",jt="moved",Cr="click",So="active",$o="inactive",wo="visible",To="hidden",_e="refresh",ke="updated",Ot="resize",Bn="resized",Lo="drag",_o="dragging",Wo="dragged",Dn="scroll",Wt="scrolled",Ji="overflow",Sr="destroy",Eo="arrows:mounted",Po="arrows:updated",Ao="pagination:mounted",Io="pagination:updated",$r="navigation:mounted",wr="autoplay:play",Ro="autoplay:playing",Tr="autoplay:pause",Lr="lazyload:loaded",ko="sk",Fo="sh",kn="ei";function Te(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Co();function r(l,i){n.bind(t,an(l).join(" "),function(c){i.apply(i,gr(c.detail)?c.detail:[])})}function o(l){n.dispatch(t,l,xt(arguments,1))}return e&&e.event.on(Sr,n.destroy),Zt(n,{bus:t,on:r,off:$e(n.unbind,t),emit:o})}function jn(e,t,n,r){var o=Date.now,l,i=0,c,s=!0,u=0;function d(){if(!s){if(i=e?bt((o()-l)/e,1):1,n&&n(i),i>=1&&(t(),l=o(),r&&++u>=r))return b();c=Or(d)}}function L(h){h||p(),l=o()-(h?i*e:0),s=!1,c=Or(d)}function b(){s=!0}function f(){l=o(),i=0,n&&n(i)}function p(){c&&cancelAnimationFrame(c),i=0,c=0,s=!0}function m(h){e=h}function v(){return s}return{start:L,rewind:f,pause:b,cancel:p,set:m,isPaused:v}}function Qi(e){var t=e;function n(o){t=o}function r(o){return fr(an(o),t)}return{set:n,is:r}}function ea(e,t){var n=jn(0,e,null,1);return function(){n.isPaused()&&n.start()}}function ta(e,t,n){var r=e.state,o=n.breakpoints||{},l=n.reducedMotion||{},i=Co(),c=[];function s(){var p=n.mediaQuery==="min";Xt(o).sort(function(m,v){return p?+m-+v:+v-+m}).forEach(function(m){d(o[m],"("+(p?"min":"max")+"-width:"+m+"px)")}),d(l,Nr),L()}function u(p){p&&i.destroy()}function d(p,m){var v=matchMedia(m);i.bind(v,"change",L),c.push([p,v])}function L(){var p=r.is(An),m=n.direction,v=c.reduce(function(h,S){return ft(h,S[1].matches?S[0]:{})},{});Br(n),f(v),n.destroy?e.destroy(n.destroy==="completely"):p?(u(!0),e.mount()):m!==n.direction&&e.refresh()}function b(p){matchMedia(Nr).matches&&(p?ft(n,l):Br(n,Xt(l)))}function f(p,m,v){ft(n,p),m&&ft(Object.getPrototypeOf(n),p),(v||!r.is(Ft))&&e.emit(ke,n)}return{setup:s,destroy:u,reduce:b,set:f}}var zn="Arrow",Vn=zn+"Left",Kn=zn+"Right",Mo=zn+"Up",Ho=zn+"Down",zr="rtl",Gn="ttb",Qn={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Mo,Kn],ArrowRight:[Ho,Vn]};function na(e,t,n){function r(l,i,c){c=c||n.direction;var s=c===zr&&!i?1:c===Gn?0:-1;return Qn[l]&&Qn[l][s]||l.replace(/width|left|right/i,function(u,d){var L=Qn[u.toLowerCase()][s]||u;return d>0?L.charAt(0).toUpperCase()+L.slice(1):L})}function o(l){return l*(n.direction===zr?1:-1)}return{resolve:r,orient:o}}var dt="role",Ht="tabindex",ra="disabled",tt="aria-",dn=tt+"controls",No=tt+"current",Vr=tt+"selected",qe=tt+"label",_r=tt+"labelledby",Oo=tt+"hidden",Wr=tt+"orientation",en=tt+"roledescription",Kr=tt+"live",Gr=tt+"busy",Ur=tt+"atomic",Er=[dt,Ht,ra,dn,No,qe,_r,Oo,Wr,en],it=cn+"__",St="is-",er=cn,qr=it+"track",oa=it+"list",Un=it+"slide",Bo=Un+"--clone",ia=Un+"__container",Pr=it+"arrows",qn=it+"arrow",Do=qn+"--prev",jo=qn+"--next",Yn=it+"pagination",zo=Yn+"__page",aa=it+"progress",la=aa+"__bar",sa=it+"toggle",ca=it+"spinner",da=it+"sr",ua=St+"initialized",_t=St+"active",Vo=St+"prev",Ko=St+"next",dr=St+"visible",ur=St+"loading",Go=St+"focus-in",Uo=St+"overflow",pa=[_t,dr,Vo,Ko,ur,Go,Uo],ma={slide:Un,clone:Bo,arrows:Pr,arrow:qn,prev:Do,next:jo,pagination:Yn,page:zo,spinner:ca};function ga(e,t){if(go(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!Yt(n,t);)n=n.parentElement;return n}var ha=5,Yr=200,qo="touchstart mousedown",tr="touchmove mousemove",nr="touchend touchcancel mouseup click";function fa(e,t,n){var r=Te(e),o=r.on,l=r.bind,i=e.root,c=n.i18n,s={},u=[],d=[],L=[],b,f,p;function m(){T(),z(),S()}function v(){o(_e,h),o(_e,m),o(ke,S),l(document,qo+" keydown",function(y){p=y.type==="keydown"},{capture:!0}),l(i,"focusin",function(){st(i,Go,!!p)})}function h(y){var x=Er.concat("style");pt(u),ct(i,d),ct(b,L),ot([b,f],x),ot(i,y?x:["style",en])}function S(){ct(i,d),ct(b,L),d=_(er),L=_(qr),rt(i,d),rt(b,L),de(i,qe,n.label),de(i,_r,n.labelledby)}function T(){b=F("."+qr),f=sn(b,"."+oa),Gt(b&&f,"A track/list element is missing."),Tn(u,fo(f,"."+Un+":not(."+Bo+")")),Tt({arrows:Pr,pagination:Yn,prev:Do,next:jo,bar:la,toggle:sa},function(y,x){s[x]=F("."+y)}),Zt(s,{root:i,track:b,list:f,slides:u})}function z(){var y=i.id||Zi(cn),x=n.role;i.id=y,b.id=b.id||y+"-track",f.id=f.id||y+"-list",!Qe(i,dt)&&i.tagName!=="SECTION"&&x&&de(i,dt,x),de(i,en,c.carousel),de(f,dt,"presentation")}function F(y){var x=bo(i,y);return x&&ga(x,"."+er)===i?x:void 0}function _(y){return[y+"--"+n.type,y+"--"+n.direction,n.drag&&y+"--draggable",n.isNavigation&&y+"--nav",y===er&&_t]}return Zt(s,{setup:m,mount:v,destroy:h})}var Bt="slide",zt="loop",un="fade";function ya(e,t,n,r){var o=Te(e),l=o.on,i=o.emit,c=o.bind,s=e.Components,u=e.root,d=e.options,L=d.isNavigation,b=d.updateOnMove,f=d.i18n,p=d.pagination,m=d.slideFocus,v=s.Direction.resolve,h=Qe(r,"style"),S=Qe(r,qe),T=n>-1,z=sn(r,"."+ia),F;function _(){T||(r.id=u.id+"-slide"+xr(t+1),de(r,dt,p?"tabpanel":"group"),de(r,en,f.slide),de(r,qe,S||sr(f.slideLabel,[t+1,e.length]))),y()}function y(){c(r,"click",$e(i,Cr,I)),c(r,"keydown",$e(i,ko,I)),l([jt,Fo,Wt],P),l($r,E),b&&l(mt,O)}function x(){F=!0,o.destroy(),ct(r,pa),ot(r,Er),de(r,"style",h),de(r,qe,S||"")}function E(){var k=e.splides.map(function(W){var M=W.splide.Components.Slides.getAt(t);return M?M.slide.id:""}).join(" ");de(r,qe,sr(f.slideX,(T?n:t)+1)),de(r,dn,k),de(r,dt,m?"button":""),m&&ot(r,en)}function O(){F||P()}function P(){if(!F){var k=e.index;H(),N(),st(r,Vo,t===k-1),st(r,Ko,t===k+1)}}function H(){var k=V();k!==Dr(r,_t)&&(st(r,_t,k),de(r,No,L&&k||""),i(k?So:$o,I))}function N(){var k=C(),W=!k&&(!V()||T);if(e.state.is([Dt,rn])||de(r,Oo,W||""),de(vr(r,d.focusableNodes||""),Ht,W?-1:""),m&&de(r,Ht,W?-1:0),k!==Dr(r,dr)&&(st(r,dr,k),i(k?wo:To,I)),!k&&document.activeElement===r){var M=s.Slides.getAt(e.index);M&&yo(M.slide)}}function D(k,W,M){Je(M&&z||r,k,W)}function V(){var k=e.index;return k===t||d.cloneStatus&&k===n}function C(){if(e.is(un))return V();var k=Ue(s.Elements.track),W=Ue(r),M=v("left",!0),Z=v("right",!0);return Rn(k[M])<=Qt(W[M])&&Rn(W[Z])<=Qt(k[Z])}function A(k,W){var M=Ne(k-t);return!T&&(d.rewind||e.is(zt))&&(M=bt(M,e.length-M)),M<=W}var I={index:t,slideIndex:n,slide:r,container:z,isClone:T,mount:_,destroy:x,update:P,style:D,isWithin:A};return I}function va(e,t,n){var r=Te(e),o=r.on,l=r.emit,i=r.bind,c=t.Elements,s=c.slides,u=c.list,d=[];function L(){b(),o(_e,f),o(_e,b)}function b(){s.forEach(function(P,H){m(P,H,-1)})}function f(){F(function(P){P.destroy()}),pt(d)}function p(){F(function(P){P.update()})}function m(P,H,N){var D=ya(e,H,N,P);D.mount(),d.push(D),d.sort(function(V,C){return V.index-C.index})}function v(P){return P?_(function(H){return!H.isClone}):d}function h(P){var H=t.Controller,N=H.toIndex(P),D=H.hasFocus()?1:n.perPage;return _(function(V){return Ln(V.index,N,N+D-1)})}function S(P){return _(P)[0]}function T(P,H){Ye(P,function(N){if(vt(N)&&(N=vo(N)),ho(N)){var D=s[H];D?yr(N,D):ln(u,N),rt(N,n.classes.slide),x(N,$e(l,Ot))}}),l(_e)}function z(P){Lt(_(P).map(function(H){return H.slide})),l(_e)}function F(P,H){v(H).forEach(P)}function _(P){return d.filter(go(P)?P:function(H){return vt(P)?Yt(H.slide,P):fr(an(P),H.index)})}function y(P,H,N){F(function(D){D.style(P,H,N)})}function x(P,H){var N=vr(P,"img"),D=N.length;D?N.forEach(function(V){i(V,"load error",function(){--D||H()})}):H()}function E(P){return P?s.length:d.length}function O(){return d.length>n.perPage}return{mount:L,destroy:f,update:p,register:m,get:v,getIn:h,getAt:S,add:T,remove:z,forEach:F,filter:_,style:y,getLength:E,isEnough:O}}function ba(e,t,n){var r=Te(e),o=r.on,l=r.bind,i=r.emit,c=t.Slides,s=t.Direction.resolve,u=t.Elements,d=u.root,L=u.track,b=u.list,f=c.getAt,p=c.style,m,v,h;function S(){T(),l(window,"resize load",ea($e(i,Ot))),o([ke,_e],T),o(Ot,z)}function T(){m=n.direction===Gn,Je(d,"maxWidth",$t(n.width)),Je(L,s("paddingLeft"),F(!1)),Je(L,s("paddingRight"),F(!0)),z(!0)}function z(I){var k=Ue(d);(I||v.width!==k.width||v.height!==k.height)&&(Je(L,"height",_()),p(s("marginRight"),$t(n.gap)),p("width",x()),p("height",E(),!0),v=k,i(Bn),h!==(h=A())&&(st(d,Uo,h),i(Ji,h)))}function F(I){var k=n.padding,W=s(I?"right":"left");return k&&$t(k[W]||(qt(k)?0:k))||"0px"}function _(){var I="";return m&&(I=y(),Gt(I,"height or heightRatio is missing."),I="calc("+I+" - "+F(!1)+" - "+F(!0)+")"),I}function y(){return $t(n.height||Ue(b).width*n.heightRatio)}function x(){return n.autoWidth?null:$t(n.fixedWidth)||(m?"":O())}function E(){return $t(n.fixedHeight)||(m?n.autoHeight?null:O():y())}function O(){var I=$t(n.gap);return"calc((100%"+(I&&" + "+I)+")/"+(n.perPage||1)+(I&&" - "+I)+")"}function P(){return Ue(b)[s("width")]}function H(I,k){var W=f(I||0);return W?Ue(W.slide)[s("width")]+(k?0:V()):0}function N(I,k){var W=f(I);if(W){var M=Ue(W.slide)[s("right")],Z=Ue(b)[s("left")];return Ne(M-Z)+(k?0:V())}return 0}function D(I){return N(e.length-1)-N(0)+H(0,I)}function V(){var I=f(0);return I&&parseFloat(Je(I.slide,s("marginRight")))||0}function C(I){return parseFloat(Je(L,s("padding"+(I?"Right":"Left"))))||0}function A(){return e.is(un)||D(!0)>P()}return{mount:S,resize:z,listSize:P,slideSize:H,sliderSize:D,totalSize:N,getPadding:C,isOverflow:A}}var xa=2;function Ca(e,t,n){var r=Te(e),o=r.on,l=t.Elements,i=t.Slides,c=t.Direction.resolve,s=[],u;function d(){o(_e,L),o([ke,Ot],f),(u=v())&&(p(u),t.Layout.resize(!0))}function L(){b(),d()}function b(){Lt(s),pt(s),r.destroy()}function f(){var h=v();u!==h&&(u<h||!h)&&r.emit(_e)}function p(h){var S=i.get().slice(),T=S.length;if(T){for(;S.length<h;)Tn(S,S);Tn(S.slice(-h),S.slice(0,h)).forEach(function(z,F){var _=F<h,y=m(z.slide,F);_?yr(y,S[0].slide):ln(l.list,y),Tn(s,y),i.register(y,F-h+(_?0:T),z.index)})}}function m(h,S){var T=h.cloneNode(!0);return rt(T,n.classes.clone),T.id=e.root.id+"-clone"+xr(S+1),T}function v(){var h=n.clones;if(!e.is(zt))h=0;else if(on(h)){var S=n[c("fixedWidth")]&&t.Layout.slideSize(0),T=S&&Qt(Ue(l.track)[c("width")]/S);h=T||n[c("autoWidth")]&&e.length||n.perPage*xa}return h}return{mount:d,destroy:b}}function Sa(e,t,n){var r=Te(e),o=r.on,l=r.emit,i=e.state.set,c=t.Layout,s=c.slideSize,u=c.getPadding,d=c.totalSize,L=c.listSize,b=c.sliderSize,f=t.Direction,p=f.resolve,m=f.orient,v=t.Elements,h=v.list,S=v.track,T;function z(){T=t.Transition,o([Ct,Bn,ke,_e],F)}function F(){t.Controller.isBusy()||(t.Scroll.cancel(),y(e.index),t.Slides.update())}function _(W,M,Z,ae){W!==M&&I(W>Z)&&(P(),x(O(D(),W>Z),!0)),i(Dt),l(mt,M,Z,W),T.start(M,function(){i(Nt),l(jt,M,Z,W),ae&&ae()})}function y(W){x(N(W,!0))}function x(W,M){if(!e.is(un)){var Z=M?W:E(W);Je(h,"transform","translate"+p("X")+"("+Z+"px)"),W!==Z&&l(Fo)}}function E(W){if(e.is(zt)){var M=H(W),Z=M>t.Controller.getEnd(),ae=M<0;(ae||Z)&&(W=O(W,Z))}return W}function O(W,M){var Z=W-A(M),ae=b();return W-=m(ae*(Qt(Ne(Z)/ae)||1))*(M?1:-1),W}function P(){x(D(),!0),T.cancel()}function H(W){for(var M=t.Slides.get(),Z=0,ae=1/0,ne=0;ne<M.length;ne++){var ue=M[ne].index,R=Ne(N(ue,!0)-W);if(R<=ae)ae=R,Z=ue;else break}return Z}function N(W,M){var Z=m(d(W-1)-C(W));return M?V(Z):Z}function D(){var W=p("left");return Ue(h)[W]-Ue(S)[W]+m(u(!1))}function V(W){return n.trimSpace&&e.is(Bt)&&(W=It(W,0,m(b(!0)-L()))),W}function C(W){var M=n.focus;return M==="center"?(L()-s(W,!0))/2:+M*s(W)||0}function A(W){return N(W?t.Controller.getEnd():0,!!n.trimSpace)}function I(W){var M=m(O(D(),W));return W?M>=0:M<=h[p("scrollWidth")]-Ue(S)[p("width")]}function k(W,M){M=on(M)?D():M;var Z=W!==!0&&m(M)<m(A(!1)),ae=W!==!1&&m(M)>m(A(!0));return Z||ae}return{mount:z,move:_,jump:y,translate:x,shift:O,cancel:P,toIndex:H,toPosition:N,getPosition:D,getLimit:A,exceededLimit:k,reposition:F}}function $a(e,t,n){var r=Te(e),o=r.on,l=r.emit,i=t.Move,c=i.getPosition,s=i.getLimit,u=i.toPosition,d=t.Slides,L=d.isEnough,b=d.getLength,f=n.omitEnd,p=e.is(zt),m=e.is(Bt),v=$e(D,!1),h=$e(D,!0),S=n.start||0,T,z=S,F,_,y;function x(){E(),o([ke,_e,kn],E),o(Bn,O)}function E(){F=b(!0),_=n.perMove,y=n.perPage,T=I();var R=It(S,0,f?T:F-1);R!==S&&(S=R,i.reposition())}function O(){T!==I()&&l(kn)}function P(R,re,he){if(!ue()){var me=N(R),ge=A(me);ge>-1&&(re||ge!==S)&&(Z(ge),i.move(me,ge,z,he))}}function H(R,re,he,me){t.Scroll.scroll(R,re,he,function(){var ge=A(i.toIndex(c()));Z(f?bt(ge,T):ge),me&&me()})}function N(R){var re=S;if(vt(R)){var he=R.match(/([+\-<>])(\d+)?/)||[],me=he[1],ge=he[2];me==="+"||me==="-"?re=V(S+ +(""+me+(+ge||1)),S):me===">"?re=ge?k(+ge):v(!0):me==="<"&&(re=h(!0))}else re=p?R:It(R,0,T);return re}function D(R,re){var he=_||(ne()?1:y),me=V(S+he*(R?-1:1),S,!(_||ne()));return me===-1&&m&&!xo(c(),s(!R),1)?R?0:T:re?me:A(me)}function V(R,re,he){if(L()||ne()){var me=C(R);me!==R&&(re=R,R=me,he=!1),R<0||R>T?!_&&(Ln(0,R,re,!0)||Ln(T,re,R,!0))?R=k(W(R)):p?R=he?R<0?-(F%y||y):F:R:n.rewind?R=R<0?T:0:R=-1:he&&R!==re&&(R=k(W(re)+(R<re?-1:1)))}else R=-1;return R}function C(R){if(m&&n.trimSpace==="move"&&R!==S)for(var re=c();re===u(R,!0)&&Ln(R,0,e.length-1,!n.rewind);)R<S?--R:++R;return R}function A(R){return p?(R+F)%F||0:R}function I(){for(var R=F-(ne()||p&&_?1:y);f&&R-- >0;)if(u(F-1,!0)!==u(R,!0)){R++;break}return It(R,0,F-1)}function k(R){return It(ne()?R:y*R,0,T)}function W(R){return ne()?bt(R,T):Rn((R>=T?F-1:R)/y)}function M(R){var re=i.toIndex(R);return m?It(re,0,T):re}function Z(R){R!==S&&(z=S,S=R)}function ae(R){return R?z:S}function ne(){return!on(n.focus)||n.isNavigation}function ue(){return e.state.is([Dt,rn])&&!!n.waitForTransition}return{mount:x,go:P,scroll:H,getNext:v,getPrev:h,getAdjacent:D,getEnd:I,setIndex:Z,getIndex:ae,toIndex:k,toPage:W,toDest:M,hasFocus:ne,isBusy:ue}}var wa="http://www.w3.org/2000/svg",Ta="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",yn=40;function La(e,t,n){var r=Te(e),o=r.on,l=r.bind,i=r.emit,c=n.classes,s=n.i18n,u=t.Elements,d=t.Controller,L=u.arrows,b=u.track,f=L,p=u.prev,m=u.next,v,h,S={};function T(){F(),o(ke,z)}function z(){_(),T()}function F(){var H=n.arrows;H&&!(p&&m)&&E(),p&&m&&(Zt(S,{prev:p,next:m}),Jt(f,H?"":"none"),rt(f,h=Pr+"--"+n.direction),H&&(y(),P(),de([p,m],dn,b.id),i(Eo,p,m)))}function _(){r.destroy(),ct(f,h),v?(Lt(L?[p,m]:f),p=m=null):ot([p,m],Er)}function y(){o([Ct,jt,_e,Wt,kn],P),l(m,"click",$e(x,">")),l(p,"click",$e(x,"<"))}function x(H){d.go(H,!0)}function E(){f=L||Mt("div",c.arrows),p=O(!0),m=O(!1),v=!0,ln(f,[p,m]),!L&&yr(f,b)}function O(H){var N='<button class="'+c.arrow+" "+(H?c.prev:c.next)+'" type="button"><svg xmlns="'+wa+'" viewBox="0 0 '+yn+" "+yn+'" width="'+yn+'" height="'+yn+'" focusable="false"><path d="'+(n.arrowPath||Ta)+'" />';return vo(N)}function P(){if(p&&m){var H=e.index,N=d.getPrev(),D=d.getNext(),V=N>-1&&H<N?s.last:s.prev,C=D>-1&&H>D?s.first:s.next;p.disabled=N<0,m.disabled=D<0,de(p,qe,V),de(m,qe,C),i(Po,p,m,N,D)}}return{arrows:S,mount:T,destroy:_,update:P}}var _a=br+"-interval";function Wa(e,t,n){var r=Te(e),o=r.on,l=r.bind,i=r.emit,c=jn(n.interval,e.go.bind(e,">"),y),s=c.isPaused,u=t.Elements,d=t.Elements,L=d.root,b=d.toggle,f=n.autoplay,p,m,v=f==="pause";function h(){f&&(S(),b&&de(b,dn,u.track.id),v||T(),_())}function S(){n.pauseOnHover&&l(L,"mouseenter mouseleave",function(E){p=E.type==="mouseenter",F()}),n.pauseOnFocus&&l(L,"focusin focusout",function(E){m=E.type==="focusin",F()}),b&&l(b,"click",function(){v?T():z(!0)}),o([mt,Dn,_e],c.rewind),o(mt,x)}function T(){s()&&t.Slides.isEnough()&&(c.start(!n.resetProgress),m=p=v=!1,_(),i(wr))}function z(E){E===void 0&&(E=!0),v=!!E,_(),s()||(c.pause(),i(Tr))}function F(){v||(p||m?z(!1):T())}function _(){b&&(st(b,_t,!v),de(b,qe,n.i18n[v?"play":"pause"]))}function y(E){var O=u.bar;O&&Je(O,"width",E*100+"%"),i(Ro,E)}function x(E){var O=t.Slides.getAt(E);c.set(O&&+Qe(O.slide,_a)||n.interval)}return{mount:h,destroy:c.cancel,play:T,pause:z,isPaused:s}}function Ea(e,t,n){var r=Te(e),o=r.on;function l(){n.cover&&(o(Lr,$e(c,!0)),o([Ct,ke,_e],$e(i,!0)))}function i(s){t.Slides.forEach(function(u){var d=sn(u.container||u.slide,"img");d&&d.src&&c(s,d,u)})}function c(s,u,d){d.style("background",s?'center/cover no-repeat url("'+u.src+'")':"",!0),Jt(u,s?"none":"")}return{mount:l,destroy:$e(i,!1)}}var Pa=10,Aa=600,Ia=.6,Ra=1.5,ka=800;function Fa(e,t,n){var r=Te(e),o=r.on,l=r.emit,i=e.state.set,c=t.Move,s=c.getPosition,u=c.getLimit,d=c.exceededLimit,L=c.translate,b=e.is(Bt),f,p,m=1;function v(){o(mt,z),o([ke,_e],F)}function h(y,x,E,O,P){var H=s();if(z(),E&&(!b||!d())){var N=t.Layout.sliderSize(),D=lr(y)*N*Rn(Ne(y)/N)||0;y=c.toPosition(t.Controller.toDest(y%N))+D}var V=xo(H,y,1);m=1,x=V?0:x||In(Ne(y-H)/Ra,ka),p=O,f=jn(x,S,$e(T,H,y,P),1),i(rn),l(Dn),f.start()}function S(){i(Nt),p&&p(),l(Wt)}function T(y,x,E,O){var P=s(),H=y+(x-y)*_(O),N=(H-P)*m;L(P+N),b&&!E&&d()&&(m*=Ia,Ne(N)<Pa&&h(u(d(!0)),Aa,!1,p,!0))}function z(){f&&f.cancel()}function F(){f&&!f.isPaused()&&(z(),S())}function _(y){var x=n.easingFunc;return x?x(y):1-Math.pow(1-y,4)}return{mount:v,destroy:z,scroll:h,cancel:F}}var Rt={passive:!1,capture:!0};function Ma(e,t,n){var r=Te(e),o=r.on,l=r.emit,i=r.bind,c=r.unbind,s=e.state,u=t.Move,d=t.Scroll,L=t.Controller,b=t.Elements.track,f=t.Media.reduce,p=t.Direction,m=p.resolve,v=p.orient,h=u.getPosition,S=u.exceededLimit,T,z,F,_,y,x=!1,E,O,P;function H(){i(b,tr,ir,Rt),i(b,nr,ir,Rt),i(b,qo,D,Rt),i(b,"click",A,{capture:!0}),i(b,"dragstart",lt),o([Ct,ke],N)}function N(){var B=n.drag;le(!B),_=B==="free"}function D(B){if(E=!1,!O){var w=ge(B);me(B.target)&&(w||!B.button)&&(L.isBusy()?lt(B,!0):(P=w?b:window,y=s.is([Dt,rn]),F=null,i(P,tr,V,Rt),i(P,nr,C,Rt),u.cancel(),d.cancel(),I(B)))}}function V(B){if(s.is(wn)||(s.set(wn),l(Lo)),B.cancelable)if(y){u.translate(T+he(ne(B)));var w=ue(B)>Yr,K=x!==(x=S());(w||K)&&I(B),E=!0,l(_o),lt(B)}else M(B)&&(y=W(B),lt(B))}function C(B){s.is(wn)&&(s.set(Nt),l(Wo)),y&&(k(B),lt(B)),c(P,tr,V),c(P,nr,C),y=!1}function A(B){!O&&E&&lt(B,!0)}function I(B){F=z,z=B,T=h()}function k(B){var w=Z(B),K=ae(w),X=n.rewind&&n.rewindByDrag;f(!1),_?L.scroll(K,0,n.snap):e.is(un)?L.go(v(lr(w))<0?X?"<":"-":X?">":"+"):e.is(Bt)&&x&&X?L.go(S(!0)?">":"<"):L.go(L.toDest(K),!0),f(!0)}function W(B){var w=n.dragMinThreshold,K=qt(w),X=K&&w.mouse||0,J=(K?w.touch:+w)||10;return Ne(ne(B))>(ge(B)?J:X)}function M(B){return Ne(ne(B))>Ne(ne(B,!0))}function Z(B){if(e.is(zt)||!x){var w=ue(B);if(w&&w<Yr)return ne(B)/w}return 0}function ae(B){return h()+lr(B)*bt(Ne(B)*(n.flickPower||600),_?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function ne(B,w){return re(B,w)-re(R(B),w)}function ue(B){return ar(B)-ar(R(B))}function R(B){return z===B&&F||z}function re(B,w){return(ge(B)?B.changedTouches[0]:B)["page"+m(w?"Y":"X")]}function he(B){return B/(x&&e.is(Bt)?ha:1)}function me(B){var w=n.noDrag;return!Yt(B,"."+zo+", ."+qn)&&(!w||!Yt(B,w))}function ge(B){return typeof TouchEvent<"u"&&B instanceof TouchEvent}function U(){return y}function le(B){O=B}return{mount:H,disable:le,isDragging:U}}var Ha={Spacebar:" ",Right:Kn,Left:Vn,Up:Mo,Down:Ho};function Ar(e){return e=vt(e)?e:e.key,Ha[e]||e}var Xr="keydown";function Na(e,t,n){var r=Te(e),o=r.on,l=r.bind,i=r.unbind,c=e.root,s=t.Direction.resolve,u,d;function L(){b(),o(ke,f),o(ke,b),o(mt,m)}function b(){var h=n.keyboard;h&&(u=h==="global"?window:c,l(u,Xr,v))}function f(){i(u,Xr)}function p(h){d=h}function m(){var h=d;d=!0,mo(function(){d=h})}function v(h){if(!d){var S=Ar(h);S===s(Vn)?e.go("<"):S===s(Kn)&&e.go(">")}}return{mount:L,destroy:f,disable:p}}var Ut=br+"-lazy",_n=Ut+"-srcset",Oa="["+Ut+"], ["+_n+"]";function Ba(e,t,n){var r=Te(e),o=r.on,l=r.off,i=r.bind,c=r.emit,s=n.lazyLoad==="sequential",u=[jt,Wt],d=[];function L(){n.lazyLoad&&(b(),o(_e,b))}function b(){pt(d),f(),s?h():(l(u),o(u,p),p())}function f(){t.Slides.forEach(function(S){vr(S.slide,Oa).forEach(function(T){var z=Qe(T,Ut),F=Qe(T,_n);if(z!==T.src||F!==T.srcset){var _=n.classes.spinner,y=T.parentElement,x=sn(y,"."+_)||Mt("span",_,y);d.push([T,S,x]),T.src||Jt(T,"none")}})})}function p(){d=d.filter(function(S){var T=n.perPage*((n.preloadPages||1)+1)-1;return S[1].isWithin(e.index,T)?m(S):!0}),d.length||l(u)}function m(S){var T=S[0];rt(S[1].slide,ur),i(T,"load error",$e(v,S)),de(T,"src",Qe(T,Ut)),de(T,"srcset",Qe(T,_n)),ot(T,Ut),ot(T,_n)}function v(S,T){var z=S[0],F=S[1];ct(F.slide,ur),T.type!=="error"&&(Lt(S[2]),Jt(z,""),c(Lr,z,F),c(Ot)),s&&h()}function h(){d.length&&m(d.shift())}return{mount:L,destroy:$e(pt,d),check:p}}function Da(e,t,n){var r=Te(e),o=r.on,l=r.emit,i=r.bind,c=t.Slides,s=t.Elements,u=t.Controller,d=u.hasFocus,L=u.getIndex,b=u.go,f=t.Direction.resolve,p=s.pagination,m=[],v,h;function S(){T(),o([ke,_e,kn],S);var O=n.pagination;p&&Jt(p,O?"":"none"),O&&(o([mt,Dn,Wt],E),z(),E(),l(Ao,{list:v,items:m},x(e.index)))}function T(){v&&(Lt(p?xt(v.children):v),ct(v,h),pt(m),v=null),r.destroy()}function z(){var O=e.length,P=n.classes,H=n.i18n,N=n.perPage,D=d()?u.getEnd()+1:Qt(O/N);v=p||Mt("ul",P.pagination,s.track.parentElement),rt(v,h=Yn+"--"+y()),de(v,dt,"tablist"),de(v,qe,H.select),de(v,Wr,y()===Gn?"vertical":"");for(var V=0;V<D;V++){var C=Mt("li",null,v),A=Mt("button",{class:P.page,type:"button"},C),I=c.getIn(V).map(function(W){return W.slide.id}),k=!d()&&N>1?H.pageX:H.slideX;i(A,"click",$e(F,V)),n.paginationKeyboard&&i(A,"keydown",$e(_,V)),de(C,dt,"presentation"),de(A,dt,"tab"),de(A,dn,I.join(" ")),de(A,qe,sr(k,V+1)),de(A,Ht,-1),m.push({li:C,button:A,page:V})}}function F(O){b(">"+O,!0)}function _(O,P){var H=m.length,N=Ar(P),D=y(),V=-1;N===f(Kn,!1,D)?V=++O%H:N===f(Vn,!1,D)?V=(--O+H)%H:N==="Home"?V=0:N==="End"&&(V=H-1);var C=m[V];C&&(yo(C.button),b(">"+V),lt(P,!0))}function y(){return n.paginationDirection||n.direction}function x(O){return m[u.toPage(O)]}function E(){var O=x(L(!0)),P=x(L());if(O){var H=O.button;ct(H,_t),ot(H,Vr),de(H,Ht,-1)}if(P){var N=P.button;rt(N,_t),de(N,Vr,!0),de(N,Ht,"")}l(Io,{list:v,items:m},O,P)}return{items:m,mount:S,destroy:T,getAt:x,update:E}}var ja=[" ","Enter"];function za(e,t,n){var r=n.isNavigation,o=n.slideFocus,l=[];function i(){e.splides.forEach(function(p){p.isParent||(u(e,p.splide),u(p.splide,e))}),r&&d()}function c(){l.forEach(function(p){p.destroy()}),pt(l)}function s(){c(),i()}function u(p,m){var v=Te(p);v.on(mt,function(h,S,T){m.go(m.is(zt)?T:h)}),l.push(v)}function d(){var p=Te(e),m=p.on;m(Cr,b),m(ko,f),m([Ct,ke],L),l.push(p),p.emit($r,e.splides)}function L(){de(t.Elements.list,Wr,n.direction===Gn?"vertical":"")}function b(p){e.go(p.index)}function f(p,m){fr(ja,Ar(m))&&(b(p),lt(m))}return{setup:$e(t.Media.set,{slideFocus:on(o)?r:o},!0),mount:i,destroy:c,remount:s}}function Va(e,t,n){var r=Te(e),o=r.bind,l=0;function i(){n.wheel&&o(t.Elements.track,"wheel",c,Rt)}function c(u){if(u.cancelable){var d=u.deltaY,L=d<0,b=ar(u),f=n.wheelMinThreshold||0,p=n.wheelSleep||0;Ne(d)>f&&b-l>p&&(e.go(L?"<":">"),l=b),s(L)&&lt(u)}}function s(u){return!n.releaseWheel||e.state.is(Dt)||t.Controller.getAdjacent(u)!==-1}return{mount:i}}var Ka=90;function Ga(e,t,n){var r=Te(e),o=r.on,l=t.Elements.track,i=n.live&&!n.isNavigation,c=Mt("span",da),s=jn(Ka,$e(d,!1));function u(){i&&(b(!t.Autoplay.isPaused()),de(l,Ur,!0),c.textContent="…",o(wr,$e(b,!0)),o(Tr,$e(b,!1)),o([jt,Wt],$e(d,!0)))}function d(f){de(l,Gr,f),f?(ln(l,c),s.start()):(Lt(c),s.cancel())}function L(){ot(l,[Kr,Ur,Gr]),Lt(c)}function b(f){i&&de(l,Kr,f?"off":"polite")}return{mount:u,disable:b,destroy:L}}var Ua=Object.freeze({__proto__:null,Media:ta,Direction:na,Elements:fa,Slides:va,Layout:ba,Clones:Ca,Move:Sa,Controller:$a,Arrows:La,Autoplay:Wa,Cover:Ea,Scroll:Fa,Drag:Ma,Keyboard:Na,LazyLoad:Ba,Pagination:Da,Sync:za,Wheel:Va,Live:Ga}),qa={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"},Ya={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:ma,i18n:qa,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Xa(e,t,n){var r=t.Slides;function o(){Te(e).on([Ct,_e],l)}function l(){r.forEach(function(c){c.style("transform","translateX(-"+100*c.index+"%)")})}function i(c,s){r.style("transition","opacity "+n.speed+"ms "+n.easing),mo(s)}return{mount:o,start:i,cancel:ir}}function Za(e,t,n){var r=t.Move,o=t.Controller,l=t.Scroll,i=t.Elements.list,c=$e(Je,i,"transition"),s;function u(){Te(e).bind(i,"transitionend",function(f){f.target===i&&s&&(L(),s())})}function d(f,p){var m=r.toPosition(f,!0),v=r.getPosition(),h=b(f);Ne(m-v)>=1&&h>=1?n.useScroll?l.scroll(m,h,!1,p):(c("transform "+h+"ms "+n.easing),r.translate(m,!0),s=p):(r.jump(f),p())}function L(){c(""),l.cancel()}function b(f){var p=n.rewindSpeed;if(e.is(Bt)&&p){var m=o.getIndex(!0),v=o.getEnd();if(m===0&&f>=v||m>=v&&f===0)return p}return n.speed}return{mount:u,start:d,cancel:L}}var Ja=(function(){function e(n,r){this.event=Te(),this.Components={},this.state=Qi(Ft),this.splides=[],this._o={},this._E={};var o=vt(n)?bo(document,n):n;Gt(o,o+" is invalid."),this.root=o,r=ft({label:Qe(o,qe)||"",labelledby:Qe(o,_r)||""},Ya,e.defaults,r||{});try{ft(r,JSON.parse(Qe(o,br)))}catch{Gt(!1,"Invalid JSON")}this._o=Object.create(ft({},r))}var t=e.prototype;return t.mount=function(r,o){var l=this,i=this.state,c=this.Components;Gt(i.is([Ft,An]),"Already mounted!"),i.set(Ft),this._C=c,this._T=o||this._T||(this.is(un)?Xa:Za),this._E=r||this._E;var s=Zt({},Ua,this._E,{Transition:this._T});return Tt(s,function(u,d){var L=u(l,c,l._o);c[d]=L,L.setup&&L.setup()}),Tt(c,function(u){u.mount&&u.mount()}),this.emit(Ct),rt(this.root,ua),i.set(Nt),this.emit(cr),this},t.sync=function(r){return this.splides.push({splide:r}),r.splides.push({splide:this,isParent:!0}),this.state.is(Nt)&&(this._C.Sync.remount(),r.Components.Sync.remount()),this},t.go=function(r){return this._C.Controller.go(r),this},t.on=function(r,o){return this.event.on(r,o),this},t.off=function(r){return this.event.off(r),this},t.emit=function(r){var o;return(o=this.event).emit.apply(o,[r].concat(xt(arguments,1))),this},t.add=function(r,o){return this._C.Slides.add(r,o),this},t.remove=function(r){return this._C.Slides.remove(r),this},t.is=function(r){return this._o.type===r},t.refresh=function(){return this.emit(_e),this},t.destroy=function(r){r===void 0&&(r=!0);var o=this.event,l=this.state;return l.is(Ft)?Te(this).on(cr,this.destroy.bind(this,r)):(Tt(this._C,function(i){i.destroy&&i.destroy(r)},!0),o.emit(Sr),o.destroy(),r&&pt(this.splides),l.set(An)),this},qi(e,[{key:"options",get:function(){return this._o},set:function(r){this._C.Media.set(r,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),Ir=Ja;Ir.defaults={};Ir.STATES=Xi;var Zr=[[Ct,"onMounted"],[cr,"onReady"],[mt,"onMove"],[jt,"onMoved"],[Cr,"onClick"],[So,"onActive"],[$o,"onInactive"],[wo,"onVisible"],[To,"onHidden"],[_e,"onRefresh"],[ke,"onUpdated"],[Ot,"onResize"],[Bn,"onResized"],[Lo,"onDrag"],[_o,"onDragging"],[Wo,"onDragged"],[Dn,"onScroll"],[Wt,"onScrolled"],[Sr,"onDestroy"],[Eo,"onArrowsMounted"],[Po,"onArrowsUpdated"],[Ao,"onPaginationMounted"],[Io,"onPaginationUpdated"],[$r,"onNavigationMounted"],[wr,"onAutoplayPlay"],[Ro,"onAutoplayPlaying"],[Tr,"onAutoplayPause"],[Lr,"onLazyLoadLoaded"]];function Rr(...e){return e.filter(Boolean).join(" ")}function Fn(e){return e!==null&&typeof e=="object"}function pr(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,r)=>!pr(n,t[r]));if(Fn(e)&&Fn(t)){const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!pr(e[o],t[o]))}return e===t}function Qa(e,t){return e.length===t.length&&!e.some((n,r)=>n!==t[r])}function el(e,t){if(e){const n=Object.keys(e);for(let r=0;r<n.length;r++){const o=n[r];if(o!=="__proto__"&&t(e[o],o)===!1)break}}return e}function mr(e,t){const n=e;return el(t,(r,o)=>{Array.isArray(r)?n[o]=r.slice():Fn(r)?n[o]=mr(Fn(n[o])?n[o]:{},r):n[o]=r}),n}var tl=({children:e,className:t,...n})=>g.createElement("div",{className:Rr("splide__track",t),...n},g.createElement("ul",{className:"splide__list"},e)),kr=class extends g.Component{constructor(){super(...arguments),this.splideRef=g.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:r}=this.splideRef;r&&(this.splide=new Ir(r,e),this.bind(this.splide),this.splide.mount(t,n),this.options=mr({},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&&!pr(this.options,e)&&(this.splide.options=e,this.options=mr({},e));const t=this.getSlides();Qa(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){Zr.forEach(([t,n])=>{const r=this.props[n];typeof r=="function"&&e.on(t,(...o)=>{r(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:r,...o}=this.props;return g.createElement(t,{className:Rr("splide",e),ref:this.splideRef,...this.omit(o,["options",...Zr.map(l=>l[1])])},n?g.createElement(tl,null,r):r)}},Fr=({children:e,className:t,...n})=>g.createElement("li",{className:Rr("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 Ha="RichTextRenderer-module__link___BWeZ2",Na={link:Ha},Oa=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(r=>/^\d/.test(r))},An=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Oa(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function it(e){const{color:t,...n}=e;return n}function Be(e,t){var n,r,o;return{fontFamily:An(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:S.scalingValue(e.letterSpacing,t),wordSpacing:S.scalingValue(e.wordSpacing,t),fontSize:S.scalingValue(e.fontSize,t),lineHeight:e.lineHeight!==void 0?S.scalingValue(e.lineHeight,t):void 0,textTransform:(n=e.textAppearance)==null?void 0:n.textTransform,textDecoration:(r=e.textAppearance)==null?void 0:r.textDecoration,fontVariant:(o=e.textAppearance)==null?void 0:o.fontVariant,color:e.color}}const Ut=({content:e})=>{const t=n=>n.map((r,o)=>r.type==="link"?a.jsx("a",{className:Na.link,href:r.value,target:r.target,children:t(r.children)},o):a.jsx("span",{style:ja(r),children:r.text},o));return a.jsx(a.Fragment,{children:e.map((n,r)=>{const o=n.children;return a.jsx("div",{children:t(o)},r)})})};function ja(e){return{...e.fontFamily&&{fontFamily:An(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 za="SvgImage-module__svg___q3xE-",Ba="SvgImage-module__img___VsTm-",Rr={svg:za,img:Ba},Va=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},Da=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,pt=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:r="",style:o})=>{const[s,i]=m.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return m.useEffect(()=>{if(typeof window<"u"&&window.CSS){const l=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');i(l)}},[]),!Va(e)||!s?a.jsx("img",{src:e,alt:"",className:ye(Rr.img,r),style:o}):a.jsx("span",{"data-supports-mask":s,className:ye(Rr.svg,r),style:{"--svg":Da(e),"--fill":t,"--hover-fill":n,...o??{}}})},Ga={"top-left":ee.topLeftAlignment,"top-center":ee.topCenterAlignment,"top-right":ee.topRightAlignment,"middle-left":ee.middleLeftAlignment,"middle-center":ee.middleCenterAlignment,"middle-right":ee.middleRightAlignment,"bottom-left":ee.bottomLeftAlignment,"bottom-center":ee.bottomCenterAlignment,"bottom-right":ee.bottomRightAlignment};function Ua({settings:e,content:t,styles:n,isEditor:r}){const[o,s]=m.useState(null),{widthSettings:i,fontSettings:l,letterSpacing:c,textAlign:d,wordSpacing:u,fontSizeLineHeight:T,textAppearance:C,color:h}=n.imageCaption,[p,g]=m.useState(void 0),[$,v]=m.useState(null),[y,E]=m.useState(0),[B,R]=m.useState(0),{direction:_,transition:f,controls:x,pagination:L,imageCaption:j,triggers:I}=e,P=m.useRef(f.type),{x:H,y:z}=e.controls.offset,D=b=>{o&&o.go(b)};return m.useEffect(()=>{if(!$)return;const b=new ResizeObserver(k=>{if(!o)return;const[F]=k;g({width:Math.round(F.contentRect.width),height:Math.round(F.contentRect.height)})});return b.observe($),()=>b.unobserve($)},[$]),m.useEffect(()=>{!o||P.current===f.type||(R(b=>b+1),P.current=f.type)},[f.type]),a.jsx("div",{className:ye(ee.wrapper,{[ee.editor]:r}),ref:v,children:a.jsxs("div",{className:ee.sliderInner,style:{width:p?p.width:"100%",height:p?p.height:"100%",backgroundColor:f.backgroundColor&&f.type==="fade in"?f.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:ye(ee.captionBlock),children:a.jsx("div",{className:ee.captionTextWrapper,children:t.map((b,k)=>a.jsx("div",{className:ye(ee.captionText,Ga[j.alignment],{[ee.withPointerEvents]:k===y&&r,[ee.active]:k===y}),style:{fontFamily:An(l.fontFamily),fontWeight:l.fontWeight,fontStyle:l.fontStyle,width:i.sizing==="auto"?"max-content":S.scalingValue(i.width,r),letterSpacing:S.scalingValue(c,r),wordSpacing:S.scalingValue(u,r),textAlign:d,fontSize:S.scalingValue(T.fontSize,r),lineHeight:S.scalingValue(T.lineHeight,r),textTransform:C.textTransform??"none",textDecoration:C.textDecoration??"none",fontVariant:C.fontVariant??"normal",color:h,transitionDuration:f.duration?`${Math.round(parseInt(f.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:ee.captionTextInner,style:{"--link-hover-color":j.linkHoverColor,"--link-color":j.linkColor,position:"relative",top:S.scalingValue(j.offset.y,r),left:S.scalingValue(j.offset.x,r)},children:a.jsx(Ut,{content:b.imageCaption})})},k))})}),a.jsx(vr,{onMove:b=>{E(b.index)},ref:s,options:{arrows:!1,speed:f.duration?parseInt(f.duration):500,autoplay:I.autoPlay!==null,...I.autoPlay!==null&&{interval:parseInt(I.autoPlay)*1e3},direction:_==="horiz"||f.type==="fade in"?"ltr":"ttb",pagination:!1,drag:I.triggersList.drag,perPage:1,width:p?p.width:"100%",height:p?p.height:"100%",type:f.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((b,k)=>a.jsx(br,{children:a.jsx("div",{className:ee.sliderItem,children:a.jsx("div",{className:ee.imgWrapper,children:a.jsx("img",{className:ye(ee.sliderImage,{[ee.contain]:b.image.objectFit==="contain",[ee.cover]:b.image.objectFit==="cover"}),src:b.image.url,alt:b.image.name??""})})})},k))},B),x.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ye(ee.arrow,{[ee.arrowVertical]:_==="vert",[ee.hoverArrow]:x.show==="on hover"}),style:{color:x.color,"--arrow-hover-color":x.hover},children:a.jsxs("button",{onClick:()=>{D("-1")},className:ee.arrowInner,style:{transform:`translate(${S.scalingValue(H,r)}, ${S.scalingValue(z*(_==="horiz"?1:-1),r)}) scale(${e.controls.scale/100}) rotate(${_==="horiz"?"0deg":"90deg"})`},children:[x.arrowsImgUrl&&a.jsx(pt,{url:x.arrowsImgUrl,fill:x.color,hoverFill:x.hover,className:ye(ee.arrowImg,ee.mirror)}),!x.arrowsImgUrl&&a.jsx(Pr,{color:x.color,className:ye(ee.arrowIcon,ee.arrowImg,ee.mirror)})]})}),a.jsx("div",{className:ye(ee.arrow,ee.nextArrow,{[ee.arrowVertical]:_==="vert",[ee.hoverArrow]:x.show==="on hover"}),style:{color:x.color,"--arrow-hover-color":x.hover},children:a.jsxs("button",{className:ee.arrowInner,onClick:()=>D("+1"),style:{transform:`translate(${S.scalingValue(H*(_==="horiz"?-1:1),r)}, ${S.scalingValue(z,r)}) scale(${e.controls.scale/100}) rotate(${_==="horiz"?"0deg":"90deg"})`},children:[x.arrowsImgUrl&&a.jsx(pt,{url:x.arrowsImgUrl,fill:x.color,hoverFill:x.hover,className:ee.arrowImg}),!x.arrowsImgUrl&&a.jsx(Pr,{color:x.color,className:ye(ee.arrowIcon,ee.arrowImg)})]})})]}),I.triggersList.click&&a.jsx("div",{className:ee.clickOverlay,onClick:()=>{o&&o.go("+1")}}),L.isActive&&a.jsx("div",{className:ye(ee.pagination,{[ee.paginationInsideBottom]:L.position==="inside-1"&&_==="horiz",[ee.paginationInsideTop]:L.position==="inside-2"&&_==="horiz",[ee.paginationOutsideBottom]:L.position==="outside-1"&&_==="horiz",[ee.paginationOutsideTop]:L.position==="outside-2"&&_==="horiz",[ee.paginationInsideLeft]:L.position==="inside-1"&&_==="vert",[ee.paginationInsideRight]:L.position==="inside-2"&&_==="vert",[ee.paginationOutsideLeft]:L.position==="outside-1"&&_==="vert",[ee.paginationOutsideRight]:L.position==="outside-2"&&_==="vert",[ee.paginationVertical]:_==="vert"}),children:a.jsx("div",{className:ee.paginationInner,style:{backgroundColor:L.colors[2],transform:`scale(${L.scale/100}) translate(${S.scalingValue(L.offset.x,r)}, ${S.scalingValue(L.offset.y,r)}) rotate(${_==="horiz"?"0deg":"90deg"})`},children:t.map((b,k)=>a.jsx("button",{onClick:()=>{o&&o.go(k)},className:ye(ee.paginationItem),children:a.jsx("div",{className:ye(ee.dot,{[ee.activeDot]:k===y}),style:{backgroundColor:k===y?L.colors[0]:L.colors[1],"--pagination-hover-color":L.hover}})},k))})})]})})}function Pr({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const qa={element:Ua,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/sliderImg.png"},defaultSize:{width:400,height:400},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"]}},Ka="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Ya="ImageRevealSlider-module__image___Qjt-e",Xa="ImageRevealSlider-module__link___N-iLG",Za="ImageRevealSlider-module__cursor___2U03d",$t={imageRevealSlider:Ka,image:Ya,link:Xa,cursor:Za};function Mr(e,t,n){for(const r of n){const o=new Image;o.src=r.url;const s=r.width?Number.parseFloat(r.width):o.naturalWidth,i=o.naturalHeight/o.naturalWidth*s,l=s/2,c=i/2;if(e>=r.x-l&&e<=r.x+l&&t>=r.y-c&&t<=r.y+c)return!0}return!1}function jn(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Ja(e,t,n,r){let o,s;if(t==="custom"){o=n;const i=await jn(e);s=i.height/i.width*o}else if(t==="random"){o=Math.random()*(r.max-r.min)+r.min;const i=await jn(e);s=i.height/i.width*o}else{const i=await jn(e);o=i.width,s=i.height}return{width:o,height:s,finalWidth:`${o}px`}}function Qa({settings:e,content:t,isEditor:n}){const[r,o]=m.useState(null),[s,i]=m.useState([]),[l,c]=m.useState(0),d=m.useRef(0),[u,T]=m.useState({x:0,y:0}),[C,h]=m.useState(1),[p,g]=m.useState("none"),$=m.useRef({x:0,y:0}),[v,y]=m.useState(!1),{sizeType:E,imageWidth:B,randomRangeImageWidth:R}=e.imageSize,{revealPosition:_,visible:f}=e.position,{cursorType:x,target:L,defaultCursorScale:j,defaultCursor:I,hoverCursorScale:P,hoverCursor:H}=e.cursor;m.useEffect(()=>{if(!r)return;const b=(W,A)=>{const N=r.getBoundingClientRect(),Z=W-N.left,le=A-N.top;if(T({x:Z,y:le}),x==="system"){g("none"),h(1);return}const ne=Z,de=le,M=document.elementFromPoint(N.left+ne,N.top+de);if(M&&M.closest("a")){g("none"),h(1);return}const te=Mr(ne,de,s)||L==="area"?{img:H??"none",scale:P}:{img:I??"none",scale:j};g(te.img),h(te.scale)},k=W=>{W.stopPropagation(),$.current={x:W.clientX,y:W.clientY},b(W.clientX,W.clientY)},F=()=>{v&&b($.current.x,$.current.y)};return r.addEventListener("mousemove",k),window.addEventListener("scroll",F,!0),()=>{r.removeEventListener("mousemove",k),window.removeEventListener("scroll",F,!0)}},[r,v,u,x,L,H,I,P,j,s]),m.useEffect(()=>{v||(g("none"),h(0))},[v]);const z=async(b,k,F,W={})=>{const{width:A,height:N,finalWidth:Z}=await Ja(b.image.url,E,B,R);let le=0,ne=0;_==="same"?(le=k/2,ne=F/2):(le=W.x??Math.random()*k,ne=W.y??Math.random()*F);const de=Math.min(Math.max(le,A/2),k-A/2),M=Math.min(Math.max(ne,N/2),F-N/2);return{id:d.current++,url:b.image.url,link:b.link,name:b.image.name,x:de,y:M,width:Z}};m.useEffect(()=>{if(!r||t.length===0)return;const b=r.getBoundingClientRect(),k=b.width,F=b.height,W=[];(async()=>{const N=t[0],Z=await z(N,k,F);W.push(Z),i(W),c(1)})()},[E,B,R,_,r]),m.useEffect(()=>{f==="last One"&&i(b=>b.length>0?[b[b.length-1]]:[])},[f]);const D=async b=>{if(!r)return;const k=r.getBoundingClientRect(),F=b.clientX-k.left,W=b.clientY-k.top;if(L==="image"&&!Mr(F,W,s))return;let A=0,N=0;_==="on Click"?(A=F,N=W):_==="same"?(A=k.width/2,N=k.height/2):(A=Math.random()*k.width,N=Math.random()*k.height);const Z=t[l],le=await z(Z,k.width,k.height,{x:A,y:N});i(ne=>f==="all"?[...ne,le]:[le]),c(ne=>ne>=t.length-1?0:ne+1)};return a.jsxs("div",{ref:o,onClick:D,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),className:$t.imageRevealSlider,style:{cursor:p==="none"?"default":"none"},children:[s.map(b=>a.jsx("div",{className:$t.wrapper,style:{top:`${b.y}px`,left:`${b.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:b.width??"auto",height:"auto",cursor:p==="none"?"default":"none"},children:L==="area"&&b.link?a.jsx("a",{href:b.link,target:"_blank",className:$t.link,children:a.jsx("img",{src:b.url,alt:b.name,className:$t.image},b.id)}):a.jsx("img",{src:b.url,alt:b.name,className:$t.image},b.id)},b.id)),v&&a.jsx("div",{className:$t.cursor,style:{left:`${u.x}px`,top:`${u.y}px`,transform:`translate(-50%, -50%) scale(${C})`,backgroundImage:`url('${p}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const es={element:Qa,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/clickGalleryImg.png"},defaultSize:{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:""}]}}}},ts="LightBox-module__hidden___9s-9x",ns="LightBox-module__heroImage___sTxNF",rs="LightBox-module__background___rm9ml",os="LightBox-module__editor___4ACaY",is="LightBox-module__contentStyle___Bgnsq",as="LightBox-module__imageStyle___tLIlB",ss="LightBox-module__imgWrapper___LuFUp",ls="LightBox-module__contain___8-yaS",cs="LightBox-module__cover___hNvOG",us="LightBox-module__caption___b6L2I",ps="LightBox-module__captionTextInner___rCGNH",ds="LightBox-module__lightboxSplide___XFuWC",ms="LightBox-module__arrow___iz38X",gs="LightBox-module__arrowVertical___Zfz81",hs="LightBox-module__nextArrow___zkAQN",fs="LightBox-module__arrowInner___p48sW",ys="LightBox-module__arrowIcon___3VaFf",vs="LightBox-module__arrowImg___pNV88",bs="LightBox-module__mirror___pjeXc",xs="LightBox-module__thumbsWrapper___GB-nU",Ss="LightBox-module__thumbsContainerVertical___wttk5",Cs="LightBox-module__thumbsContainer___osSma",ws="LightBox-module__thumbsAlignStart___MO6tY",$s="LightBox-module__thumbsAlignCenter___Q4sUx",Ts="LightBox-module__thumbsAlignEnd___p4y9R",_s="LightBox-module__thumbItem___HvnF3",Ls="LightBox-module__closeButton___g2khP",Es="LightBox-module__fadeIn___0m5GW",Is="LightBox-module__slideInLeft___gPYwC",As="LightBox-module__slideInRight___S-pPp",ks="LightBox-module__slideInTop___DFdAj",Fs="LightBox-module__slideInBottom___m27kZ",Ws="LightBox-module__fadeOut___55qBR",Rs="LightBox-module__slideOutLeft___NvU7P",Ps="LightBox-module__slideOutRight___SK7eC",Ms="LightBox-module__slideOutTop___Vgg0z",Hs="LightBox-module__slideOutBottom___nJ0Ef",Ns="LightBox-module__scaleSlide___vZriG",U={hidden:ts,heroImage:ns,background:rs,editor:os,contentStyle:is,imageStyle:as,imgWrapper:ss,contain:ls,cover:cs,caption:us,captionTextInner:ps,lightboxSplide:ds,arrow:ms,arrowVertical:gs,nextArrow:hs,arrowInner:fs,arrowIcon:ys,arrowImg:vs,mirror:bs,thumbsWrapper:xs,thumbsContainerVertical:Ss,thumbsContainer:Cs,thumbsAlignStart:ws,thumbsAlignCenter:$s,thumbsAlignEnd:Ts,thumbItem:_s,closeButton:Ls,fadeIn:Es,slideInLeft:Is,slideInRight:As,slideInTop:ks,slideInBottom:Fs,fadeOut:Ws,slideOutLeft:Rs,slideOutRight:Ps,slideOutTop:Ms,slideOutBottom:Hs,scaleSlide:Ns},rn=(e,t,n)=>{const r={},[o,s]=e.split("-");return o==="top"?(r.top="0",r.bottom="auto"):o==="middle"?(r.top="50%",r.bottom="auto"):o==="bottom"&&(r.top="auto",r.bottom="0"),s==="left"?(r.left="0",r.right="auto"):s==="center"?(r.left="50%",r.right="auto"):s==="right"&&(r.left="auto",r.right="0"),o==="middle"&&s==="center"?r.transform=`translate(calc(-50% + ${S.scalingValue(t.x,n)}), calc(-50% + ${S.scalingValue(t.y,n)}))`:o==="middle"?r.transform=`translate(${S.scalingValue(t.x,n)}, calc(-50% + ${S.scalingValue(t.y,n)}))`:s==="center"?r.transform=`translate(calc(-50% + ${S.scalingValue(t.x,n)}), ${S.scalingValue(t.y,n)})`:r.transform=`translate(${S.scalingValue(t.x,n)}, ${S.scalingValue(t.y,n)})`,r};function Wo(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 Hr(e){const t=e.getBoundingClientRect(),n=Wo(e),r=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),s=e.naturalWidth,i=e.naturalHeight,l=r/o,c=s/i;let d,u;c>l?(d=r,u=r/c):(u=o,d=o*c);const T=t.left+n.left,C=t.top+n.top,h=(r-d)/2+T,p=(o-u)/2+C;return{x:h,y:p,width:d,height:u}}function Nr(e){const t=e.getBoundingClientRect(),n=Wo(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Or(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const r=t[1].split(",").map(o=>parseFloat(o.trim()));return r.length===4?r[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const r=n[1].substring(6,8);return parseInt(r,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function Os(e,t){const n=(()=>{if(e==="fade in")return U.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return U.slideInLeft;case"right":return U.slideInRight;case"top":return U.slideInTop;case"bottom":return U.slideInBottom;default:return U.slideInRight}return U.fadeIn})(),r=(()=>{if(e==="fade in"||e==="mix")return U.fadeIn;if(e==="slide in")switch(t){case"left":return U.slideInLeft;case"right":return U.slideInRight;case"top":return U.slideInTop;case"bottom":return U.slideInBottom;default:return U.slideInRight}return U.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return U.fadeOut;if(e==="slide in")switch(t){case"left":return U.slideOutLeft;case"right":return U.slideOutRight;case"top":return U.slideOutTop;case"bottom":return U.slideOutBottom;default:return U.slideOutRight}return U.fadeOut})(),s=(()=>{if(e==="fade in")return U.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return U.slideOutLeft;case"right":return U.slideOutRight;case"top":return U.slideOutTop;case"bottom":return U.slideOutBottom;default:return U.slideOutRight}return U.fadeOut})();return{appearClass:n,backdropAppearClass:r,backdropDisappearClass:o,disappearClass:s}}const js=({settings:e,content:t,styles:n,portalId:r,activeEvent:o,isEditor:s})=>{const[i,l]=m.useState(!1),{url:c}=e.thumbnailBlock.cover;return m.useEffect(()=>{o==="close"&&l(!1),o==="open"&&l(!0)},[o]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:c,alt:"Cover",className:U.heroImage,onClick:()=>l(!0)}),a.jsx(zs,{isOpen:i,onClose:()=>l(!1),content:t,settings:e,lightboxStyles:n,portalId:r,isEditor:s})]})},zs=({isOpen:e,onClose:t,content:n,lightboxStyles:r,settings:o,portalId:s,isEditor:i,metadata:l})=>{var O;const[c,d]=m.useState(0),[u,T]=m.useState(0),[C,h]=m.useState(!1),[p,g]=m.useState(!1),[$,v]=m.useState({}),y=m.useRef(null),E=m.useRef(null),B=m.useRef(null),R=m.useRef(!1),_=m.useRef(null),f=m.useRef(null),x=m.useRef(null),L=m.useRef(null),j=m.useRef(!1),I=m.useRef(null),[P,H]=m.useState(!1),{appear:z,triggers:D,slider:b,thumbnail:k,controls:F,area:W,caption:A,layout:N}=o.lightboxBlock,{appearClass:Z,backdropAppearClass:le,backdropDisappearClass:ne,disappearClass:de}=Os(z.type,z.direction),M=(l==null?void 0:l.itemId)??null;m.useEffect(()=>{const w=()=>{setTimeout(()=>{var Y,J;(J=(Y=y.current)==null?void 0:Y.splide)==null||J.refresh()},16)},G=()=>{T(Y=>Y+1)};return window.addEventListener("ArticleEditor.Layout:change",w),window.addEventListener("ArticleEditor.ComponentContent:change",G),()=>{window.removeEventListener("ArticleEditor.Layout:change",w),window.removeEventListener("ArticleEditor.ComponentContent:change",G)}},[]),m.useEffect(()=>{if(!e||!k.isActive){H(!1);return}const w=I.current;if(!w)return;const G=()=>{b.direction==="horiz"?H(w.scrollWidth>w.clientWidth):H(w.scrollHeight>w.clientHeight)};G();const Y=new ResizeObserver(G);return Y.observe(w),()=>Y.disconnect()},[e,k.isActive,n.length,$,b.direction]);const te=m.useCallback(()=>{const w=window.matchMedia("(max-width: 768px)").matches,G=Or(W.color);w&&!i&&G>.9&&(document.body.style.backgroundColor=""),h(!0),R.current=!0;const Y=J=>{J.target===_.current&&J.animationName&&(_.current&&f.current&&_.current.removeEventListener("animationend",f.current),f.current=null,R.current&&(R.current=!1,t()),h(!1))};_.current&&(f.current=Y,_.current.addEventListener("animationend",Y))},[t,W.color,i]),fe=(w,G,Y)=>{var J,ae;if(w){if(D.type==="click"&&D.switch==="image")D.repeat==="close"&&c===n.length-1?te():(J=y.current)==null||J.go("+1");else if(D.type==="click"&&D.switch==="50/50"){const oe=w.getBoundingClientRect(),re=G-oe.left,ce=Y-oe.top,V=oe.width,X=oe.height;let K;b.direction==="horiz"?K=re<V/2?"-1":"+1":K=ce<X/2?"-1":"+1",(ae=y.current)==null||ae.go(K)}}},me=w=>{if(j.current){j.current=!1;return}const G=n[c],Y=(G==null?void 0:G.image.objectFit)==="cover";let J,ae;if("changedTouches"in w&&w.changedTouches.length>0)J=w.changedTouches[0].clientX,ae=w.changedTouches[0].clientY;else if("clientX"in w)J=w.clientX,ae=w.clientY;else return;let oe;if(Y&&B.current){const re=Nr(B.current);oe=J>=re.left&&J<=re.right&&ae>=re.top&&ae<=re.bottom}else{const re=B.current?Hr(B.current):null;if(!re){w.target===w.currentTarget&&te();return}oe=J>=re.x&&J<=re.x+re.width&&ae>=re.y&&ae<=re.y+re.height}oe?fe(B.current,J,ae):te()},ge=w=>{const G=w.target;(G.classList.contains(U.thumbsWrapper)||G.classList.contains(U.thumbsContainer))&&me(w)};m.useEffect(()=>{if(!e)return;const w=G=>{var Y,J;if(G.key==="Escape"){te();return}if(G.key==="ArrowRight"){d(ae=>(ae+1)%Math.max(n.length,1)),(Y=y.current)==null||Y.go("+1");return}G.key==="ArrowLeft"&&(d(ae=>(ae-1+Math.max(n.length,1))%Math.max(n.length,1)),(J=y.current)==null||J.go("-1"))};return window.addEventListener("keydown",w),()=>{window.removeEventListener("keydown",w)}},[e,te,n.length]),m.useEffect(()=>{if(e){if(d(0),T(G=>G+1),R.current=!1,h(!1),g(!1),v({}),!M)return;const w=new CustomEvent("page-overlay",{detail:{itemId:M}});window.dispatchEvent(w)}return()=>{_.current&&f.current&&(_.current.removeEventListener("animationend",f.current),f.current=null),g(!1)}},[e,M]),m.useEffect(()=>{E.current!==null&&E.current!==b.type&&T(w=>w+1),E.current=b.type},[b.type]),m.useEffect(()=>{if(!e)return;const w=document.body.style.overflow,G=window.matchMedia("(max-width: 768px)").matches,Y=Or(W.color);document.body.style.overflow="hidden",g(!1);const J=oe=>{oe.target===_.current&&!R.current&&oe.animationName&&(G&&!i&&Y>.9&&(document.body.style.backgroundColor=W.color),g(!0),_.current&&x.current&&_.current.removeEventListener("animationend",x.current),x.current=null)};_.current&&(x.current=J,_.current.addEventListener("animationend",J));const ae=oe=>{const re=oe.target;re&&(re.closest(`.${U.thumbsWrapper}`)||re.closest(`.${U.thumbsContainer}`))||b.type!=="slide"&&oe.preventDefault()};return document.addEventListener("touchmove",ae,{passive:!1}),()=>{document.body.style.overflow=w,document.removeEventListener("touchmove",ae),_.current&&x.current&&(_.current.removeEventListener("animationend",x.current),x.current=null),g(!1)}},[e,i,W.color,b.type]),m.useEffect(()=>{if(!e)return;const w=G=>{var J,ae;if(R.current){G.stopPropagation();return}if(j.current){j.current=!1;return}const Y=G.target;if(!(Y&&(Y.closest(`.${U.thumbsContainer}`)||Y.closest(`.${U.thumbItem}`)||Y.closest(`.${U.arrow}`)||Y.closest(`.${U.closeButton}`)||Y.closest(`.${U.caption}`)))){if(b.type==="slide"&&D.type==="drag"&&((ae=(J=y.current)==null?void 0:J.splide)!=null&&ae.root)){const oe=y.current.splide.root;if(Y&&(oe.contains(Y)||oe===Y))return}if(G.touches.length===0&&G.changedTouches.length>0){const oe=n[c],re=(oe==null?void 0:oe.image.objectFit)==="cover",ce=G.changedTouches[0];let V;if(re&&B.current){const X=Nr(B.current);V=ce.clientX>=X.left&&ce.clientX<=X.right&&ce.clientY>=X.top&&ce.clientY<=X.bottom}else{const X=B.current?Hr(B.current):null;if(!X)return;V=ce.clientX>=X.x&&ce.clientX<=X.x+X.width&&ce.clientY>=X.y&&ce.clientY<=X.y+X.height}if(!V){G.stopPropagation(),R.current=!0;const X=K=>{K.stopPropagation(),K.preventDefault(),document.removeEventListener("click",X,!0)};document.addEventListener("click",X,!0),te()}}}};return document.addEventListener("touchend",w,{passive:!0}),()=>{document.removeEventListener("touchend",w)}},[e,te,c,n]);const q=(b.type==="scale"||b.type==="fade")&&b.direction==="vert"&&D.type==="drag";m.useEffect(()=>{var K,se;if(!e||!q||!((se=(K=y.current)==null?void 0:K.splide)!=null&&se.root))return;const w=y.current.splide.root,G=30,Y=(Q,ue)=>{if(L.current){const Se=Math.abs(Q-L.current.x),Te=Math.abs(ue-L.current.y);(Se>0||Te>0)&&(j.current=!0)}},J=Q=>{L.current&&(Q.preventDefault(),Y(Q.clientX,Q.clientY))},ae=Q=>{L.current&&Q.touches.length>0&&(Q.preventDefault(),Y(Q.touches[0].clientX,Q.touches[0].clientY))},oe=(Q,ue)=>{if(!L.current||!y.current){L.current=null;return}const Se=Math.abs(Q-L.current.x),Te=Math.abs(ue-L.current.y);Te>G&&Te>Se&&y.current.go(ue<L.current.y?"+1":"-1"),L.current=null},re=Q=>{L.current&&oe(Q.clientX,Q.clientY),document.removeEventListener("pointerup",re),document.removeEventListener("pointercancel",re),document.removeEventListener("pointermove",J)},ce=Q=>{if(L.current){if(Q.changedTouches.length>0){const ue=Q.changedTouches[0];oe(ue.clientX,ue.clientY)}document.removeEventListener("touchend",ce),document.removeEventListener("touchcancel",ce),document.removeEventListener("touchmove",ae)}},V=Q=>{L.current={x:Q.clientX,y:Q.clientY},j.current=!1,document.addEventListener("pointermove",J,{passive:!1}),document.addEventListener("pointerup",re),document.addEventListener("pointercancel",re)},X=Q=>{Q.touches.length>0&&(L.current={x:Q.touches[0].clientX,y:Q.touches[0].clientY},j.current=!1,document.addEventListener("touchmove",ae,{passive:!1}),document.addEventListener("touchend",ce),document.addEventListener("touchcancel",ce))};return w.addEventListener("pointerdown",V),w.addEventListener("touchstart",X),()=>{w.removeEventListener("pointerdown",V),w.removeEventListener("touchstart",X),document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",re),document.removeEventListener("pointercancel",re),document.removeEventListener("touchmove",ae),document.removeEventListener("touchend",ce),document.removeEventListener("touchcancel",ce),L.current=null,j.current=!1}},[e,q,u]);const ie={backgroundColor:W.color,backdropFilter:`blur(${W.blur}px)`,animationDuration:`${parseInt(z.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(s)?null:Yr.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:i?null:_,className:ye(U.background,C?ne:le,{[U.editor]:i},{[U.hidden]:!e}),style:{...ie,...p&&!i&&!C?{position:"absolute"}:{}}}),a.jsxs("div",{ref:i?_:null,className:ye(U.contentStyle,C?de:Z,{[U.editor]:i},{[U.hidden]:!e}),style:{animationDuration:`${parseInt(z.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(vr,{onMove:w=>d(w.index),ref:y,className:U.lightboxSplide,options:{arrows:!1,speed:b.duration?parseInt(b.duration):500,direction:b.direction==="horiz"||b.type==="fade"||b.type==="scale"?"ltr":"ttb",pagination:!1,drag:D.type==="drag"&&!q,perPage:1,width:"100%",height:"100%",type:b.type==="fade"||b.type==="scale"?"fade":"loop",padding:0,rewind:D.repeat!=="close",start:0},style:{"--splide-speed":b.duration},children:n.map((w,G)=>{const Y=rn(N.position,N.offset,i),J=`${S.scalingValue(N.padding.top,i)} ${S.scalingValue(N.padding.right,i)} ${S.scalingValue(N.padding.bottom,i)} ${S.scalingValue(N.padding.left,i)}`,ae=b.type==="scale"?(()=>{const{transform:oe,...re}=Y;return{...re,position:"absolute",padding:J,boxSizing:"border-box","--position-transform":oe||"none"}})():{...Y,position:"absolute",padding:J,boxSizing:"border-box"};return a.jsx(br,{children:a.jsx("div",{className:U.imgWrapper,onClick:me,children:a.jsx("img",{ref:G===c?B:null,className:ye(U.imageStyle,{[U.contain]:w.image.objectFit==="contain",[U.cover]:w.image.objectFit==="cover",[U.scaleSlide]:b.type==="scale"}),src:w.image.url,alt:w.image.name??"",style:{...ae,pointerEvents:w.image.objectFit==="contain"?"none":"auto"}})})},G)})},u),F.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ye(U.arrow,{[U.arrowVertical]:b.direction==="vert"}),style:{color:F.color,"--arrow-hover-color":F.hover},children:a.jsxs("button",{className:U.arrowInner,style:{transform:`translate(${S.scalingValue(F.offset.x,i)}, ${S.scalingValue(F.offset.y*(b.direction==="horiz"?1:-1),i)}) scale(${F.scale}) rotate(${b.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var w;return(w=y.current)==null?void 0:w.go("-1")},"aria-label":"Previous",children:[F.arrowsImgUrl&&a.jsx(pt,{url:F.arrowsImgUrl,fill:F.color,hoverFill:F.hover,className:ye(U.arrowImg,U.mirror)}),!F.arrowsImgUrl&&a.jsx(jr,{color:F.color,className:ye(U.arrowIcon,U.arrowImg,U.mirror)})]})}),a.jsx("div",{className:ye(U.arrow,U.nextArrow,{[U.arrowVertical]:b.direction==="vert"}),style:{color:F.color,"--arrow-hover-color":F.hover},children:a.jsxs("button",{className:U.arrowInner,style:{transform:`translate(${S.scalingValue(F.offset.x*(b.direction==="horiz"?-1:1),i)}, ${S.scalingValue(F.offset.y,i)}) scale(${F.scale}) rotate(${b.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var w;return(w=y.current)==null?void 0:w.go("+1")},"aria-label":"Next",children:[F.arrowsImgUrl&&a.jsx(pt,{url:F.arrowsImgUrl,fill:F.color,hoverFill:F.hover,className:U.arrowImg}),!F.arrowsImgUrl&&a.jsx(jr,{color:F.color,className:ye(U.arrowIcon,U.arrowImg)})]})})]}),W.closeIconUrl&&(()=>{const w=rn(W.closeIconAlign,W.closeIconOffset,i),G=`scale(${W.closeIconScale})`,Y=w.transform?`${w.transform} ${G}`:G;return a.jsx("button",{className:U.closeButton,style:{...w,transform:Y},onClick:te,"aria-label":"Close lightbox",children:a.jsx(pt,{url:W.closeIconUrl,fill:W.closeIconColor??"#000000",hoverFill:W.closeIconHover??"#cccccc"})})})(),A&&A.isActive&&r.imageCaption&&((O=n[c])==null?void 0:O.imageCaption)&&(()=>{const{widthSettings:w,fontSettings:G,letterSpacing:Y,textAlign:J,wordSpacing:ae,fontSizeLineHeight:oe,textAppearance:re,color:ce}=r.imageCaption;return a.jsx("div",{className:U.caption,style:{...rn(A.alignment,A.offset,i),fontFamily:An(G.fontFamily),fontWeight:G.fontWeight,fontStyle:G.fontStyle,width:w.sizing==="auto"?"max-content":S.scalingValue(w.width,i),letterSpacing:S.scalingValue(Y,i),wordSpacing:S.scalingValue(ae,i),textAlign:J,fontSize:S.scalingValue(oe.fontSize,i),lineHeight:S.scalingValue(oe.lineHeight,i),textTransform:re.textTransform??"none",textDecoration:re.textDecoration??"none",fontVariant:re.fontVariant??"normal",color:ce},onClick:V=>V.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:U.captionTextInner,style:{"--link-color":A.linkColor,"--link-hover-color":A.linkHoverColor},children:a.jsx(Ut,{content:n[c].imageCaption})})})})(),k.isActive&&(()=>{const[w,G]=k.position.split("-"),Y=b.direction==="horiz"?`${w}-left`:k.position,J=rn(Y,k.offset,i),ae=()=>{if(b.direction==="horiz"){if(G==="left")return"flex-start";if(G==="center")return"center";if(G==="right")return"flex-end"}else{if(w==="top")return"flex-start";if(w==="middle")return"center";if(w==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:I,className:U.thumbsWrapper,onClick:oe=>ge(oe),style:{position:i?"absolute":"fixed",...J,...b.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:ye(U.thumbsContainer,{[U.thumbsContainerVertical]:b.direction==="vert",[U.thumbsAlignStart]:k.align==="start",[U.thumbsAlignCenter]:k.align==="center",[U.thumbsAlignEnd]:k.align==="end"}),style:{gap:S.scalingValue(k.grid.gap,i),justifyContent:P?"flex-start":ae()},children:n.map((oe,re)=>{const ce=re===c,V=$[re],K=k.grid.size*(ce?k.activeState.scale:1),se=()=>{if(k.fit!=="fit")return{};if(!V)return b.direction==="horiz"?{height:S.scalingValue(K,i)}:{width:S.scalingValue(K,i)};const Q=V.width/V.height;if(b.direction==="horiz"){const ue=K,Se=ue*Q;return{width:S.scalingValue(Se,i),height:S.scalingValue(ue,i)}}else{const ue=K,Se=ue/Q;return{width:S.scalingValue(ue,i),height:S.scalingValue(Se,i)}}};return a.jsx("button",{className:U.thumbItem,style:{...b.direction==="horiz"&&k.fit!=="fit"?{height:S.scalingValue(K,i)}:{},...b.direction==="vert"&&k.fit!=="fit"?{width:S.scalingValue(K,i)}:{},...k.fit==="cover"?{width:S.scalingValue(K,i),height:S.scalingValue(K,i)}:{},...se(),transition:ce?"all 0.25s ease-out":"none",opacity:ce?k.activeState.opacity/100:k.opacity/100,"--thumb-hover":k.activeState.opacity/100},onClick:Q=>{var ue;Q.stopPropagation(),d(re),(ue=y.current)==null||ue.go(re)},onMouseEnter:()=>{var Q;k.triggers==="hov"&&((Q=y.current)==null||Q.go(re))},children:a.jsx("img",{src:oe.image.url,alt:oe.image.name??"",onLoad:Q=>{const ue=Q.currentTarget;ue.naturalWidth&&ue.naturalHeight&&v(Se=>({...Se,[re]:{width:ue.naturalWidth,height:ue.naturalHeight}}))},style:{objectFit:k.fit==="cover"?"cover":"contain",...k.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...k.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${oe.image.name}-${re}`)})})})})()]})]}),document.getElementById(s))};function jr({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Bs={element:js,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/lightboxImg.png"},defaultSize:{width:440,height:550},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 on(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Vs(e){return`
6
+ */const nl="RichTextRenderer-module__link___BWeZ2",rl={link:nl},ol=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(r=>/^\d/.test(r))},Xn=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>ol(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function ut(e){const{color:t,...n}=e;return n}function ze(e,t){var n,r,o;return{fontFamily:Xn(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:$.scalingValue(e.letterSpacing,t),wordSpacing:$.scalingValue(e.wordSpacing,t),fontSize:$.scalingValue(e.fontSize,t),lineHeight:e.lineHeight!==void 0?$.scalingValue(e.lineHeight,t):void 0,textTransform:(n=e.textAppearance)==null?void 0:n.textTransform,textDecoration:(r=e.textAppearance)==null?void 0:r.textDecoration,fontVariant:(o=e.textAppearance)==null?void 0:o.fontVariant,color:e.color}}const tn=({content:e})=>{const t=n=>n.map((r,o)=>r.type==="link"?a.jsx("a",{className:rl.link,href:r.value,target:r.target,children:t(r.children)},o):a.jsx("span",{style:il(r),children:r.text},o));return a.jsx(a.Fragment,{children:e.map((n,r)=>{const o=n.children;return a.jsx("div",{children:t(o)},r)})})};function il(e){return{...e.fontFamily&&{fontFamily:Xn(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 al="SvgImage-module__svg___q3xE-",ll="SvgImage-module__img___VsTm-",Jr={svg:al,img:ll},sl=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},cl=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,yt=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:r="",style:o})=>{const[l,i]=g.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return g.useEffect(()=>{if(typeof window<"u"&&window.CSS){const c=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');i(c)}},[]),!sl(e)||!l?a.jsx("img",{src:e,alt:"",className:ve(Jr.img,r),style:o}):a.jsx("span",{"data-supports-mask":l,className:ve(Jr.svg,r),style:{"--svg":cl(e),"--fill":t,"--hover-fill":n,...o??{}}})},dl={"top-left":te.topLeftAlignment,"top-center":te.topCenterAlignment,"top-right":te.topRightAlignment,"middle-left":te.middleLeftAlignment,"middle-center":te.middleCenterAlignment,"middle-right":te.middleRightAlignment,"bottom-left":te.bottomLeftAlignment,"bottom-center":te.bottomCenterAlignment,"bottom-right":te.bottomRightAlignment};function ul({settings:e,content:t,styles:n,isEditor:r}){const[o,l]=g.useState(null),{widthSettings:i,fontSettings:c,letterSpacing:s,textAlign:u,wordSpacing:d,fontSizeLineHeight:L,textAppearance:b,color:f}=n.imageCaption,[p,m]=g.useState(void 0),[v,h]=g.useState(null),[S,T]=g.useState(0),[z,F]=g.useState(0),{direction:_,transition:y,controls:x,pagination:E,imageCaption:O,triggers:P}=e,H=g.useRef(y.type),{x:N,y:D}=e.controls.offset,V=C=>{o&&o.go(C)};return g.useEffect(()=>{if(!v)return;const C=new ResizeObserver(A=>{if(!o)return;const[I]=A;m({width:Math.round(I.contentRect.width),height:Math.round(I.contentRect.height)})});return C.observe(v),()=>C.unobserve(v)},[v]),g.useEffect(()=>{!o||H.current===y.type||(F(C=>C+1),H.current=y.type)},[y.type]),a.jsx("div",{className:ve(te.wrapper,{[te.editor]:r}),ref:h,children:a.jsxs("div",{className:te.sliderInner,style:{width:p?p.width:"100%",height:p?p.height:"100%",backgroundColor:y.backgroundColor&&y.type==="fade in"?y.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:ve(te.captionBlock),children:a.jsx("div",{className:te.captionTextWrapper,children:t.map((C,A)=>a.jsx("div",{className:ve(te.captionText,dl[O.alignment],{[te.withPointerEvents]:A===S&&r,[te.active]:A===S}),style:{fontFamily:Xn(c.fontFamily),fontWeight:c.fontWeight,fontStyle:c.fontStyle,width:i.sizing==="auto"?"max-content":$.scalingValue(i.width,r),letterSpacing:$.scalingValue(s,r),wordSpacing:$.scalingValue(d,r),textAlign:u,fontSize:$.scalingValue(L.fontSize,r),lineHeight:$.scalingValue(L.lineHeight,r),textTransform:b.textTransform??"none",textDecoration:b.textDecoration??"none",fontVariant:b.fontVariant??"normal",color:f,transitionDuration:y.duration?`${Math.round(parseInt(y.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:te.captionTextInner,style:{"--link-hover-color":O.linkHoverColor,"--link-color":O.linkColor,position:"relative",top:$.scalingValue(O.offset.y,r),left:$.scalingValue(O.offset.x,r)},children:a.jsx(tn,{content:C.imageCaption})})},A))})}),a.jsx(kr,{onMove:C=>{T(C.index)},ref:l,options:{arrows:!1,speed:y.duration?parseInt(y.duration):500,autoplay:P.autoPlay!==null,...P.autoPlay!==null&&{interval:parseInt(P.autoPlay)*1e3},direction:_==="horiz"||y.type==="fade in"?"ltr":"ttb",pagination:!1,drag:P.triggersList.drag,perPage:1,width:p?p.width:"100%",height:p?p.height:"100%",type:y.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((C,A)=>a.jsx(Fr,{children:a.jsx("div",{className:te.sliderItem,children:a.jsx("div",{className:te.imgWrapper,children:a.jsx("img",{className:ve(te.sliderImage,{[te.contain]:C.image.objectFit==="contain",[te.cover]:C.image.objectFit==="cover"}),src:C.image.url,alt:C.image.name??""})})})},A))},z),x.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ve(te.arrow,{[te.arrowVertical]:_==="vert",[te.hoverArrow]:x.show==="on hover"}),style:{color:x.color,"--arrow-hover-color":x.hover},children:a.jsxs("button",{onClick:()=>{V("-1")},className:te.arrowInner,style:{transform:`translate(${$.scalingValue(N,r)}, ${$.scalingValue(D*(_==="horiz"?1:-1),r)}) scale(${e.controls.scale/100}) rotate(${_==="horiz"?"0deg":"90deg"})`},children:[x.arrowsImgUrl&&a.jsx(yt,{url:x.arrowsImgUrl,fill:x.color,hoverFill:x.hover,className:ve(te.arrowImg,te.mirror)}),!x.arrowsImgUrl&&a.jsx(Qr,{color:x.color,className:ve(te.arrowIcon,te.arrowImg,te.mirror)})]})}),a.jsx("div",{className:ve(te.arrow,te.nextArrow,{[te.arrowVertical]:_==="vert",[te.hoverArrow]:x.show==="on hover"}),style:{color:x.color,"--arrow-hover-color":x.hover},children:a.jsxs("button",{className:te.arrowInner,onClick:()=>V("+1"),style:{transform:`translate(${$.scalingValue(N*(_==="horiz"?-1:1),r)}, ${$.scalingValue(D,r)}) scale(${e.controls.scale/100}) rotate(${_==="horiz"?"0deg":"90deg"})`},children:[x.arrowsImgUrl&&a.jsx(yt,{url:x.arrowsImgUrl,fill:x.color,hoverFill:x.hover,className:te.arrowImg}),!x.arrowsImgUrl&&a.jsx(Qr,{color:x.color,className:ve(te.arrowIcon,te.arrowImg)})]})})]}),P.triggersList.click&&a.jsx("div",{className:te.clickOverlay,onClick:()=>{o&&o.go("+1")}}),E.isActive&&a.jsx("div",{className:ve(te.pagination,{[te.paginationInsideBottom]:E.position==="inside-1"&&_==="horiz",[te.paginationInsideTop]:E.position==="inside-2"&&_==="horiz",[te.paginationOutsideBottom]:E.position==="outside-1"&&_==="horiz",[te.paginationOutsideTop]:E.position==="outside-2"&&_==="horiz",[te.paginationInsideLeft]:E.position==="inside-1"&&_==="vert",[te.paginationInsideRight]:E.position==="inside-2"&&_==="vert",[te.paginationOutsideLeft]:E.position==="outside-1"&&_==="vert",[te.paginationOutsideRight]:E.position==="outside-2"&&_==="vert",[te.paginationVertical]:_==="vert"}),children:a.jsx("div",{className:te.paginationInner,style:{backgroundColor:E.colors[2],transform:`scale(${E.scale/100}) translate(${$.scalingValue(E.offset.x,r)}, ${$.scalingValue(E.offset.y,r)}) rotate(${_==="horiz"?"0deg":"90deg"})`},children:t.map((C,A)=>a.jsx("button",{onClick:()=>{o&&o.go(A)},className:ve(te.paginationItem),children:a.jsx("div",{className:ve(te.dot,{[te.activeDot]:A===S}),style:{backgroundColor:A===S?E.colors[0]:E.colors[1],"--pagination-hover-color":E.hover}})},A))})})]})})}function Qr({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const pl={element:ul,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/sliderImg.png"},defaultSize:{width:400,height:400},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"]}},ml="ImageRevealSlider-module__imageRevealSlider___UE5Ob",gl="ImageRevealSlider-module__image___Qjt-e",hl="ImageRevealSlider-module__link___N-iLG",fl="ImageRevealSlider-module__cursor___2U03d",At={imageRevealSlider:ml,image:gl,link:hl,cursor:fl};function eo(e,t,n){for(const r of n){const o=new Image;o.src=r.url;const l=r.width?Number.parseFloat(r.width):o.naturalWidth,i=o.naturalHeight/o.naturalWidth*l,c=l/2,s=i/2;if(e>=r.x-c&&e<=r.x+c&&t>=r.y-s&&t<=r.y+s)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 yl(e,t,n,r){let o,l;if(t==="custom"){o=n;const i=await rr(e);l=i.height/i.width*o}else if(t==="random"){o=Math.random()*(r.max-r.min)+r.min;const i=await rr(e);l=i.height/i.width*o}else{const i=await rr(e);o=i.width,l=i.height}return{width:o,height:l,finalWidth:`${o}px`}}function vl({settings:e,content:t,isEditor:n}){const[r,o]=g.useState(null),[l,i]=g.useState([]),[c,s]=g.useState(0),u=g.useRef(0),[d,L]=g.useState({x:0,y:0}),[b,f]=g.useState(1),[p,m]=g.useState("none"),v=g.useRef({x:0,y:0}),[h,S]=g.useState(!1),{sizeType:T,imageWidth:z,randomRangeImageWidth:F}=e.imageSize,{revealPosition:_,visible:y}=e.position,{cursorType:x,target:E,defaultCursorScale:O,defaultCursor:P,hoverCursorScale:H,hoverCursor:N}=e.cursor;g.useEffect(()=>{if(!r)return;const C=(k,W)=>{const M=r.getBoundingClientRect(),Z=k-M.left,ae=W-M.top;if(L({x:Z,y:ae}),x==="system"){m("none"),f(1);return}const ne=Z,ue=ae,R=document.elementFromPoint(M.left+ne,M.top+ue);if(R&&R.closest("a")){m("none"),f(1);return}const re=eo(ne,ue,l)||E==="area"?{img:N??"none",scale:H}:{img:P??"none",scale:O};m(re.img),f(re.scale)},A=k=>{k.stopPropagation(),v.current={x:k.clientX,y:k.clientY},C(k.clientX,k.clientY)},I=()=>{h&&C(v.current.x,v.current.y)};return r.addEventListener("mousemove",A),window.addEventListener("scroll",I,!0),()=>{r.removeEventListener("mousemove",A),window.removeEventListener("scroll",I,!0)}},[r,h,d,x,E,N,P,H,O,l]),g.useEffect(()=>{h||(m("none"),f(0))},[h]);const D=async(C,A,I,k={})=>{const{width:W,height:M,finalWidth:Z}=await yl(C.image.url,T,z,F);let ae=0,ne=0;_==="same"?(ae=A/2,ne=I/2):(ae=k.x??Math.random()*A,ne=k.y??Math.random()*I);const ue=Math.min(Math.max(ae,W/2),A-W/2),R=Math.min(Math.max(ne,M/2),I-M/2);return{id:u.current++,url:C.image.url,link:C.link,name:C.image.name,x:ue,y:R,width:Z}};g.useEffect(()=>{if(!r||t.length===0)return;const C=r.getBoundingClientRect(),A=C.width,I=C.height,k=[];(async()=>{const M=t[0],Z=await D(M,A,I);k.push(Z),i(k),s(1)})()},[T,z,F,_,r]),g.useEffect(()=>{y==="last One"&&i(C=>C.length>0?[C[C.length-1]]:[])},[y]);const V=async C=>{if(!r)return;const A=r.getBoundingClientRect(),I=C.clientX-A.left,k=C.clientY-A.top;if(E==="image"&&!eo(I,k,l))return;let W=0,M=0;_==="on Click"?(W=I,M=k):_==="same"?(W=A.width/2,M=A.height/2):(W=Math.random()*A.width,M=Math.random()*A.height);const Z=t[c],ae=await D(Z,A.width,A.height,{x:W,y:M});i(ne=>y==="all"?[...ne,ae]:[ae]),s(ne=>ne>=t.length-1?0:ne+1)};return a.jsxs("div",{ref:o,onClick:V,onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),className:At.imageRevealSlider,style:{cursor:p==="none"?"default":"none"},children:[l.map(C=>a.jsx("div",{className:At.wrapper,style:{top:`${C.y}px`,left:`${C.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:C.width??"auto",height:"auto",cursor:p==="none"?"default":"none"},children:E==="area"&&C.link?a.jsx("a",{href:C.link,target:"_blank",className:At.link,children:a.jsx("img",{src:C.url,alt:C.name,className:At.image},C.id)}):a.jsx("img",{src:C.url,alt:C.name,className:At.image},C.id)},C.id)),h&&a.jsx("div",{className:At.cursor,style:{left:`${d.x}px`,top:`${d.y}px`,transform:`translate(-50%, -50%) scale(${b})`,backgroundImage:`url('${p}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const bl={element:vl,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/clickGalleryImg.png"},defaultSize:{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:""}]}}}},xl="LightBox-module__hidden___9s-9x",Cl="LightBox-module__heroImage___sTxNF",Sl="LightBox-module__background___rm9ml",$l="LightBox-module__editor___4ACaY",wl="LightBox-module__contentStyle___Bgnsq",Tl="LightBox-module__imageStyle___tLIlB",Ll="LightBox-module__imgWrapper___LuFUp",_l="LightBox-module__contain___8-yaS",Wl="LightBox-module__cover___hNvOG",El="LightBox-module__caption___b6L2I",Pl="LightBox-module__captionTextInner___rCGNH",Al="LightBox-module__lightboxSplide___XFuWC",Il="LightBox-module__arrow___iz38X",Rl="LightBox-module__arrowVertical___Zfz81",kl="LightBox-module__nextArrow___zkAQN",Fl="LightBox-module__arrowInner___p48sW",Ml="LightBox-module__arrowIcon___3VaFf",Hl="LightBox-module__arrowImg___pNV88",Nl="LightBox-module__mirror___pjeXc",Ol="LightBox-module__thumbsWrapper___GB-nU",Bl="LightBox-module__thumbsContainerVertical___wttk5",Dl="LightBox-module__thumbsContainer___osSma",jl="LightBox-module__thumbsAlignStart___MO6tY",zl="LightBox-module__thumbsAlignCenter___Q4sUx",Vl="LightBox-module__thumbsAlignEnd___p4y9R",Kl="LightBox-module__thumbItem___HvnF3",Gl="LightBox-module__closeButton___g2khP",Ul="LightBox-module__fadeIn___0m5GW",ql="LightBox-module__slideInLeft___gPYwC",Yl="LightBox-module__slideInRight___S-pPp",Xl="LightBox-module__slideInTop___DFdAj",Zl="LightBox-module__slideInBottom___m27kZ",Jl="LightBox-module__fadeOut___55qBR",Ql="LightBox-module__slideOutLeft___NvU7P",es="LightBox-module__slideOutRight___SK7eC",ts="LightBox-module__slideOutTop___Vgg0z",ns="LightBox-module__slideOutBottom___nJ0Ef",rs="LightBox-module__scaleSlide___vZriG",G={hidden:xl,heroImage:Cl,background:Sl,editor:$l,contentStyle:wl,imageStyle:Tl,imgWrapper:Ll,contain:_l,cover:Wl,caption:El,captionTextInner:Pl,lightboxSplide:Al,arrow:Il,arrowVertical:Rl,nextArrow:kl,arrowInner:Fl,arrowIcon:Ml,arrowImg:Hl,mirror:Nl,thumbsWrapper:Ol,thumbsContainerVertical:Bl,thumbsContainer:Dl,thumbsAlignStart:jl,thumbsAlignCenter:zl,thumbsAlignEnd:Vl,thumbItem:Kl,closeButton:Gl,fadeIn:Ul,slideInLeft:ql,slideInRight:Yl,slideInTop:Xl,slideInBottom:Zl,fadeOut:Jl,slideOutLeft:Ql,slideOutRight:es,slideOutTop:ts,slideOutBottom:ns,scaleSlide:rs},vn=(e,t,n)=>{const r={},[o,l]=e.split("-");return o==="top"?(r.top="0",r.bottom="auto"):o==="middle"?(r.top="50%",r.bottom="auto"):o==="bottom"&&(r.top="auto",r.bottom="0"),l==="left"?(r.left="0",r.right="auto"):l==="center"?(r.left="50%",r.right="auto"):l==="right"&&(r.left="auto",r.right="0"),o==="middle"&&l==="center"?r.transform=`translate(calc(-50% + ${$.scalingValue(t.x,n)}), calc(-50% + ${$.scalingValue(t.y,n)}))`:o==="middle"?r.transform=`translate(${$.scalingValue(t.x,n)}, calc(-50% + ${$.scalingValue(t.y,n)}))`:l==="center"?r.transform=`translate(calc(-50% + ${$.scalingValue(t.x,n)}), ${$.scalingValue(t.y,n)})`:r.transform=`translate(${$.scalingValue(t.x,n)}, ${$.scalingValue(t.y,n)})`,r};function Yo(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 to(e){const t=e.getBoundingClientRect(),n=Yo(e),r=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),l=e.naturalWidth,i=e.naturalHeight,c=r/o,s=l/i;let u,d;s>c?(u=r,d=r/s):(d=o,u=o*s);const L=t.left+n.left,b=t.top+n.top,f=(r-u)/2+L,p=(o-d)/2+b;return{x:f,y:p,width:u,height:d}}function no(e){const t=e.getBoundingClientRect(),n=Yo(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function ro(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const r=t[1].split(",").map(o=>parseFloat(o.trim()));return r.length===4?r[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const r=n[1].substring(6,8);return parseInt(r,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function os(e,t){const n=(()=>{if(e==="fade in")return G.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return G.slideInLeft;case"right":return G.slideInRight;case"top":return G.slideInTop;case"bottom":return G.slideInBottom;default:return G.slideInRight}return G.fadeIn})(),r=(()=>{if(e==="fade in"||e==="mix")return G.fadeIn;if(e==="slide in")switch(t){case"left":return G.slideInLeft;case"right":return G.slideInRight;case"top":return G.slideInTop;case"bottom":return G.slideInBottom;default:return G.slideInRight}return G.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return G.fadeOut;if(e==="slide in")switch(t){case"left":return G.slideOutLeft;case"right":return G.slideOutRight;case"top":return G.slideOutTop;case"bottom":return G.slideOutBottom;default:return G.slideOutRight}return G.fadeOut})(),l=(()=>{if(e==="fade in")return G.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return G.slideOutLeft;case"right":return G.slideOutRight;case"top":return G.slideOutTop;case"bottom":return G.slideOutBottom;default:return G.slideOutRight}return G.fadeOut})();return{appearClass:n,backdropAppearClass:r,backdropDisappearClass:o,disappearClass:l}}const is=({settings:e,content:t,styles:n,portalId:r,activeEvent:o,isEditor:l})=>{const[i,c]=g.useState(!1),{url:s}=e.thumbnailBlock.cover;return g.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:s,alt:"Cover",className:G.heroImage,onClick:()=>c(!0)}),a.jsx(as,{isOpen:i,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:r,isEditor:l})]})},as=({isOpen:e,onClose:t,content:n,lightboxStyles:r,settings:o,portalId:l,isEditor:i,metadata:c})=>{var B;const[s,u]=g.useState(0),[d,L]=g.useState(0),[b,f]=g.useState(!1),[p,m]=g.useState(!1),[v,h]=g.useState({}),S=g.useRef(null),T=g.useRef(null),z=g.useRef(null),F=g.useRef(!1),_=g.useRef(null),y=g.useRef(null),x=g.useRef(null),E=g.useRef(null),O=g.useRef(!1),P=g.useRef(null),[H,N]=g.useState(!1),{appear:D,triggers:V,slider:C,thumbnail:A,controls:I,area:k,caption:W,layout:M}=o.lightboxBlock,{appearClass:Z,backdropAppearClass:ae,backdropDisappearClass:ne,disappearClass:ue}=os(D.type,D.direction),R=(c==null?void 0:c.itemId)??null;g.useEffect(()=>{const w=()=>{setTimeout(()=>{var X,J;(J=(X=S.current)==null?void 0:X.splide)==null||J.refresh()},16)},K=()=>{L(X=>X+1)};return window.addEventListener("ArticleEditor.Layout:change",w),window.addEventListener("ArticleEditor.ComponentContent:change",K),()=>{window.removeEventListener("ArticleEditor.Layout:change",w),window.removeEventListener("ArticleEditor.ComponentContent:change",K)}},[]),g.useEffect(()=>{if(!e||!A.isActive){N(!1);return}const w=P.current;if(!w)return;const K=()=>{C.direction==="horiz"?N(w.scrollWidth>w.clientWidth):N(w.scrollHeight>w.clientHeight)};K();const X=new ResizeObserver(K);return X.observe(w),()=>X.disconnect()},[e,A.isActive,n.length,v,C.direction]);const re=g.useCallback(()=>{const w=window.matchMedia("(max-width: 768px)").matches,K=ro(k.color);w&&!i&&K>.9&&(document.body.style.backgroundColor=""),f(!0),F.current=!0;const X=J=>{J.target===_.current&&J.animationName&&(_.current&&y.current&&_.current.removeEventListener("animationend",y.current),y.current=null,F.current&&(F.current=!1,t()),f(!1))};_.current&&(y.current=X,_.current.addEventListener("animationend",X))},[t,k.color,i]),he=(w,K,X)=>{var J,ie;if(w){if(V.type==="click"&&V.switch==="image")V.repeat==="close"&&s===n.length-1?re():(J=S.current)==null||J.go("+1");else if(V.type==="click"&&V.switch==="50/50"){const Q=w.getBoundingClientRect(),ee=K-Q.left,se=X-Q.top,j=Q.width,q=Q.height;let Y;C.direction==="horiz"?Y=ee<j/2?"-1":"+1":Y=se<q/2?"-1":"+1",(ie=S.current)==null||ie.go(Y)}}},me=w=>{if(O.current){O.current=!1;return}const K=n[s],X=(K==null?void 0:K.image.objectFit)==="cover";let J,ie;if("changedTouches"in w&&w.changedTouches.length>0)J=w.changedTouches[0].clientX,ie=w.changedTouches[0].clientY;else if("clientX"in w)J=w.clientX,ie=w.clientY;else return;let Q;if(X&&z.current){const ee=no(z.current);Q=J>=ee.left&&J<=ee.right&&ie>=ee.top&&ie<=ee.bottom}else{const ee=z.current?to(z.current):null;if(!ee){w.target===w.currentTarget&&re();return}Q=J>=ee.x&&J<=ee.x+ee.width&&ie>=ee.y&&ie<=ee.y+ee.height}Q?he(z.current,J,ie):re()},ge=w=>{const K=w.target;(K.classList.contains(G.thumbsWrapper)||K.classList.contains(G.thumbsContainer))&&me(w)};g.useEffect(()=>{if(!e)return;const w=K=>{var X,J;if(K.key==="Escape"){re();return}if(K.key==="ArrowRight"){u(ie=>(ie+1)%Math.max(n.length,1)),(X=S.current)==null||X.go("+1");return}K.key==="ArrowLeft"&&(u(ie=>(ie-1+Math.max(n.length,1))%Math.max(n.length,1)),(J=S.current)==null||J.go("-1"))};return window.addEventListener("keydown",w),()=>{window.removeEventListener("keydown",w)}},[e,re,n.length]),g.useEffect(()=>{if(e){if(u(0),L(K=>K+1),F.current=!1,f(!1),m(!1),h({}),!R)return;const w=new CustomEvent("page-overlay",{detail:{itemId:R}});window.dispatchEvent(w)}return()=>{_.current&&y.current&&(_.current.removeEventListener("animationend",y.current),y.current=null),m(!1)}},[e,R]),g.useEffect(()=>{T.current!==null&&T.current!==C.type&&L(w=>w+1),T.current=C.type},[C.type]),g.useEffect(()=>{if(!e)return;const w=document.body.style.overflow,K=window.matchMedia("(max-width: 768px)").matches,X=ro(k.color);document.body.style.overflow="hidden",m(!1);const J=Q=>{Q.target===_.current&&!F.current&&Q.animationName&&(K&&!i&&X>.9&&(document.body.style.backgroundColor=k.color),m(!0),_.current&&x.current&&_.current.removeEventListener("animationend",x.current),x.current=null)};_.current&&(x.current=J,_.current.addEventListener("animationend",J));const ie=Q=>{const ee=Q.target;ee&&(ee.closest(`.${G.thumbsWrapper}`)||ee.closest(`.${G.thumbsContainer}`))||C.type!=="slide"&&Q.preventDefault()};return document.addEventListener("touchmove",ie,{passive:!1}),()=>{document.body.style.overflow=w,document.removeEventListener("touchmove",ie),_.current&&x.current&&(_.current.removeEventListener("animationend",x.current),x.current=null),m(!1)}},[e,i,k.color,C.type]),g.useEffect(()=>{if(!e)return;const w=K=>{var J,ie;if(F.current){K.stopPropagation();return}if(O.current){O.current=!1;return}const X=K.target;if(!(X&&(X.closest(`.${G.thumbsContainer}`)||X.closest(`.${G.thumbItem}`)||X.closest(`.${G.arrow}`)||X.closest(`.${G.closeButton}`)||X.closest(`.${G.caption}`)))){if(C.type==="slide"&&V.type==="drag"&&((ie=(J=S.current)==null?void 0:J.splide)!=null&&ie.root)){const Q=S.current.splide.root;if(X&&(Q.contains(X)||Q===X))return}if(K.touches.length===0&&K.changedTouches.length>0){const Q=n[s],ee=(Q==null?void 0:Q.image.objectFit)==="cover",se=K.changedTouches[0];let j;if(ee&&z.current){const q=no(z.current);j=se.clientX>=q.left&&se.clientX<=q.right&&se.clientY>=q.top&&se.clientY<=q.bottom}else{const q=z.current?to(z.current):null;if(!q)return;j=se.clientX>=q.x&&se.clientX<=q.x+q.width&&se.clientY>=q.y&&se.clientY<=q.y+q.height}if(!j){K.stopPropagation(),F.current=!0;const q=Y=>{Y.stopPropagation(),Y.preventDefault(),document.removeEventListener("click",q,!0)};document.addEventListener("click",q,!0),re()}}}};return document.addEventListener("touchend",w,{passive:!0}),()=>{document.removeEventListener("touchend",w)}},[e,re,s,n]);const U=(C.type==="scale"||C.type==="fade")&&C.direction==="vert"&&V.type==="drag";g.useEffect(()=>{var Y,ce;if(!e||!U||!((ce=(Y=S.current)==null?void 0:Y.splide)!=null&&ce.root))return;const w=S.current.splide.root,K=30,X=(oe,pe)=>{if(E.current){const we=Math.abs(oe-E.current.x),Le=Math.abs(pe-E.current.y);(we>0||Le>0)&&(O.current=!0)}},J=oe=>{E.current&&(oe.preventDefault(),X(oe.clientX,oe.clientY))},ie=oe=>{E.current&&oe.touches.length>0&&(oe.preventDefault(),X(oe.touches[0].clientX,oe.touches[0].clientY))},Q=(oe,pe)=>{if(!E.current||!S.current){E.current=null;return}const we=Math.abs(oe-E.current.x),Le=Math.abs(pe-E.current.y);Le>K&&Le>we&&S.current.go(pe<E.current.y?"+1":"-1"),E.current=null},ee=oe=>{E.current&&Q(oe.clientX,oe.clientY),document.removeEventListener("pointerup",ee),document.removeEventListener("pointercancel",ee),document.removeEventListener("pointermove",J)},se=oe=>{if(E.current){if(oe.changedTouches.length>0){const pe=oe.changedTouches[0];Q(pe.clientX,pe.clientY)}document.removeEventListener("touchend",se),document.removeEventListener("touchcancel",se),document.removeEventListener("touchmove",ie)}},j=oe=>{E.current={x:oe.clientX,y:oe.clientY},O.current=!1,document.addEventListener("pointermove",J,{passive:!1}),document.addEventListener("pointerup",ee),document.addEventListener("pointercancel",ee)},q=oe=>{oe.touches.length>0&&(E.current={x:oe.touches[0].clientX,y:oe.touches[0].clientY},O.current=!1,document.addEventListener("touchmove",ie,{passive:!1}),document.addEventListener("touchend",se),document.addEventListener("touchcancel",se))};return w.addEventListener("pointerdown",j),w.addEventListener("touchstart",q),()=>{w.removeEventListener("pointerdown",j),w.removeEventListener("touchstart",q),document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",ee),document.removeEventListener("pointercancel",ee),document.removeEventListener("touchmove",ie),document.removeEventListener("touchend",se),document.removeEventListener("touchcancel",se),E.current=null,O.current=!1}},[e,U,d]);const le={backgroundColor:k.color,backdropFilter:`blur(${k.blur}px)`,animationDuration:`${parseInt(D.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(l)?null:po.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:i?null:_,className:ve(G.background,b?ne:ae,{[G.editor]:i},{[G.hidden]:!e}),style:{...le,...p&&!i&&!b?{position:"absolute"}:{}}}),a.jsxs("div",{ref:i?_:null,className:ve(G.contentStyle,b?ue:Z,{[G.editor]:i},{[G.hidden]:!e}),style:{animationDuration:`${parseInt(D.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(kr,{onMove:w=>u(w.index),ref:S,className:G.lightboxSplide,options:{arrows:!1,speed:C.duration?parseInt(C.duration):500,direction:C.direction==="horiz"||C.type==="fade"||C.type==="scale"?"ltr":"ttb",pagination:!1,drag:V.type==="drag"&&!U,perPage:1,width:"100%",height:"100%",type:C.type==="fade"||C.type==="scale"?"fade":"loop",padding:0,rewind:V.repeat!=="close",start:0},style:{"--splide-speed":C.duration},children:n.map((w,K)=>{const X=vn(M.position,M.offset,i),J=`${$.scalingValue(M.padding.top,i)} ${$.scalingValue(M.padding.right,i)} ${$.scalingValue(M.padding.bottom,i)} ${$.scalingValue(M.padding.left,i)}`,ie=C.type==="scale"?(()=>{const{transform:Q,...ee}=X;return{...ee,position:"absolute",padding:J,boxSizing:"border-box","--position-transform":Q||"none"}})():{...X,position:"absolute",padding:J,boxSizing:"border-box"};return a.jsx(Fr,{children:a.jsx("div",{className:G.imgWrapper,onClick:me,children:a.jsx("img",{ref:K===s?z:null,className:ve(G.imageStyle,{[G.contain]:w.image.objectFit==="contain",[G.cover]:w.image.objectFit==="cover",[G.scaleSlide]:C.type==="scale"}),src:w.image.url,alt:w.image.name??"",style:{...ie,pointerEvents:w.image.objectFit==="contain"?"none":"auto"}})})},K)})},d),I.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ve(G.arrow,{[G.arrowVertical]:C.direction==="vert"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:a.jsxs("button",{className:G.arrowInner,style:{transform:`translate(${$.scalingValue(I.offset.x,i)}, ${$.scalingValue(I.offset.y*(C.direction==="horiz"?1:-1),i)}) scale(${I.scale}) rotate(${C.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var w;return(w=S.current)==null?void 0:w.go("-1")},"aria-label":"Previous",children:[I.arrowsImgUrl&&a.jsx(yt,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:ve(G.arrowImg,G.mirror)}),!I.arrowsImgUrl&&a.jsx(oo,{color:I.color,className:ve(G.arrowIcon,G.arrowImg,G.mirror)})]})}),a.jsx("div",{className:ve(G.arrow,G.nextArrow,{[G.arrowVertical]:C.direction==="vert"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:a.jsxs("button",{className:G.arrowInner,style:{transform:`translate(${$.scalingValue(I.offset.x*(C.direction==="horiz"?-1:1),i)}, ${$.scalingValue(I.offset.y,i)}) scale(${I.scale}) rotate(${C.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var w;return(w=S.current)==null?void 0:w.go("+1")},"aria-label":"Next",children:[I.arrowsImgUrl&&a.jsx(yt,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:G.arrowImg}),!I.arrowsImgUrl&&a.jsx(oo,{color:I.color,className:ve(G.arrowIcon,G.arrowImg)})]})})]}),k.closeIconUrl&&(()=>{const w=vn(k.closeIconAlign,k.closeIconOffset,i),K=`scale(${k.closeIconScale})`,X=w.transform?`${w.transform} ${K}`:K;return a.jsx("button",{className:G.closeButton,style:{...w,transform:X},onClick:re,"aria-label":"Close lightbox",children:a.jsx(yt,{url:k.closeIconUrl,fill:k.closeIconColor??"#000000",hoverFill:k.closeIconHover??"#cccccc"})})})(),W&&W.isActive&&r.imageCaption&&((B=n[s])==null?void 0:B.imageCaption)&&(()=>{const{widthSettings:w,fontSettings:K,letterSpacing:X,textAlign:J,wordSpacing:ie,fontSizeLineHeight:Q,textAppearance:ee,color:se}=r.imageCaption;return a.jsx("div",{className:G.caption,style:{...vn(W.alignment,W.offset,i),fontFamily:Xn(K.fontFamily),fontWeight:K.fontWeight,fontStyle:K.fontStyle,width:w.sizing==="auto"?"max-content":$.scalingValue(w.width,i),letterSpacing:$.scalingValue(X,i),wordSpacing:$.scalingValue(ie,i),textAlign:J,fontSize:$.scalingValue(Q.fontSize,i),lineHeight:$.scalingValue(Q.lineHeight,i),textTransform:ee.textTransform??"none",textDecoration:ee.textDecoration??"none",fontVariant:ee.fontVariant??"normal",color:se},onClick:j=>j.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:G.captionTextInner,style:{"--link-color":W.linkColor,"--link-hover-color":W.linkHoverColor},children:a.jsx(tn,{content:n[s].imageCaption})})})})(),A.isActive&&(()=>{const[w,K]=A.position.split("-"),X=C.direction==="horiz"?`${w}-left`:A.position,J=vn(X,A.offset,i),ie=()=>{if(C.direction==="horiz"){if(K==="left")return"flex-start";if(K==="center")return"center";if(K==="right")return"flex-end"}else{if(w==="top")return"flex-start";if(w==="middle")return"center";if(w==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:P,className:G.thumbsWrapper,onClick:Q=>ge(Q),style:{position:i?"absolute":"fixed",...J,...C.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:ve(G.thumbsContainer,{[G.thumbsContainerVertical]:C.direction==="vert",[G.thumbsAlignStart]:A.align==="start",[G.thumbsAlignCenter]:A.align==="center",[G.thumbsAlignEnd]:A.align==="end"}),style:{gap:$.scalingValue(A.grid.gap,i),justifyContent:H?"flex-start":ie()},children:n.map((Q,ee)=>{const se=ee===s,j=v[ee],Y=A.grid.size*(se?A.activeState.scale:1),ce=()=>{if(A.fit!=="fit")return{};if(!j)return C.direction==="horiz"?{height:$.scalingValue(Y,i)}:{width:$.scalingValue(Y,i)};const oe=j.width/j.height;if(C.direction==="horiz"){const pe=Y,we=pe*oe;return{width:$.scalingValue(we,i),height:$.scalingValue(pe,i)}}else{const pe=Y,we=pe/oe;return{width:$.scalingValue(pe,i),height:$.scalingValue(we,i)}}};return a.jsx("button",{className:G.thumbItem,style:{...C.direction==="horiz"&&A.fit!=="fit"?{height:$.scalingValue(Y,i)}:{},...C.direction==="vert"&&A.fit!=="fit"?{width:$.scalingValue(Y,i)}:{},...A.fit==="cover"?{width:$.scalingValue(Y,i),height:$.scalingValue(Y,i)}:{},...ce(),transition:se?"all 0.25s ease-out":"none",opacity:se?A.activeState.opacity/100:A.opacity/100,"--thumb-hover":A.activeState.opacity/100},onClick:oe=>{var pe;oe.stopPropagation(),u(ee),(pe=S.current)==null||pe.go(ee)},onMouseEnter:()=>{var oe;A.triggers==="hov"&&((oe=S.current)==null||oe.go(ee))},children:a.jsx("img",{src:Q.image.url,alt:Q.image.name??"",onLoad:oe=>{const pe=oe.currentTarget;pe.naturalWidth&&pe.naturalHeight&&h(we=>({...we,[ee]:{width:pe.naturalWidth,height:pe.naturalHeight}}))},style:{objectFit:A.fit==="cover"?"cover":"contain",...A.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...A.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Q.image.name}-${ee}`)})})})})()]})]}),document.getElementById(l))};function oo({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const ls={element:is,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/lightboxImg.png"},defaultSize:{width:440,height:550},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 bn(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function ss(e){return`
7
7
  .${e}-wrapper {
8
8
  display: flex;
9
9
  flex-direction: column;
10
10
  width: 100%;
11
- min-height: ${on(48)};
11
+ min-height: ${bn(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: ${on(4)};
35
+ gap: ${bn(4)};
36
36
  }
37
37
  .${e}-field-label {
38
38
  white-space: nowrap;
@@ -128,18 +128,18 @@
128
128
  outline: none;
129
129
  }
130
130
  .${e}-success {
131
- margin-top: ${on(8)};
131
+ margin-top: ${bn(8)};
132
132
  color: var(--${e}-success-success-color, var(--${e}-success-color));
133
133
  }
134
134
  .${e}-error {
135
- margin-top: ${on(8)};
135
+ margin-top: ${bn(8)};
136
136
  color: var(--${e}-error-error-color, var(--${e}-error-color));
137
137
  }
138
138
  .${e}-overlay-anchor {
139
139
  position: relative;
140
140
  height: auto;
141
141
  }
142
- `}function Ds({settings:e,isEditor:t,metadata:n,activeEvent:r}){const{prefix:o}=S.useScopedStyles(),{type:s="A",fieldsToShow:i=2,fields:l=[],buttonLabel:c,gap:d,fieldsGap:u,buttonCorners:T,buttonStroke:C,buttonPadding:h,isButtonFullWidth:p,inputCorners:g,inputStroke:$,inputPadding:v,inputColor:y,inputTextColor:E,inputBorderColor:B,placeholderColor:R,buttonColor:_,buttonTextColor:f,buttonBorderColor:x,labelTextColor:L,successColor:j,errorColor:I,fontFamily:P,inputFontSettings:H,inputFontSize:z,inputLineHeight:D,inputLetterSpacing:b,inputWordSpacing:k,inputTextAppearance:F,buttonFontSettings:W,buttonFontSize:A,buttonLineHeight:N,buttonLetterSpacing:Z,buttonWordSpacing:le,buttonTextAppearance:ne,labelFontSettings:de,labelFontSize:M,labelLineHeight:te,labelLetterSpacing:fe,labelWordSpacing:me,labelTextAppearance:ge,statusFontSettings:q,statusFontSize:ie,statusLineHeight:O,statusLetterSpacing:w,statusWordSpacing:G,statusTextAppearance:Y,successMessage:J,errorMessage:ae,stateOverrides:oe}=e,re=s==="B",ce=l.slice(0,Math.min(i,l.length)),V={fontSettings:{fontFamily:P,fontWeight:(H==null?void 0:H.fontWeight)??400,fontStyle:(H==null?void 0:H.fontStyle)??"normal"},fontSize:z??.01,lineHeight:D,letterSpacing:b??0,wordSpacing:k??0,textAppearance:F,color:E},X=it(Be(V,t)),K=S.scalingValue($??0,t),se=S.scalingValue((D??z??.01)+((v==null?void 0:v.top)??0)+((v==null?void 0:v.bottom)??0)+(s==="C"?$??0:($??0)*2),t),Q={...X,borderStyle:"solid",borderRadius:s==="C"?0:S.scalingValue(g??0,t),...s==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:K,borderLeftWidth:0}:{borderWidth:K},paddingTop:S.scalingValue((v==null?void 0:v.top)??0,t),paddingRight:S.scalingValue((v==null?void 0:v.right)??0,t),paddingBottom:S.scalingValue((v==null?void 0:v.bottom)??0,t),paddingLeft:S.scalingValue((v==null?void 0:v.left)??0,t),height:se,minHeight:se},ue={fontSettings:{fontFamily:P,fontWeight:(W==null?void 0:W.fontWeight)??400,fontStyle:(W==null?void 0:W.fontStyle)??"normal"},fontSize:A??.01,lineHeight:N,letterSpacing:Z??0,wordSpacing:le??0,textAppearance:ne,color:f},Se=it(Be(ue,t)),Te=S.scalingValue(C??0,t),Re={fontSettings:{fontFamily:P,fontWeight:(de==null?void 0:de.fontWeight)??400,fontStyle:(de==null?void 0:de.fontStyle)??"normal"},fontSize:M??.01,lineHeight:te,letterSpacing:fe??0,wordSpacing:me??0,textAppearance:ge,color:L},Pe=Be(Re,t),ve={fontSettings:{fontFamily:P,fontWeight:(q==null?void 0:q.fontWeight)??400,fontStyle:(q==null?void 0:q.fontStyle)??"normal"},fontSize:ie??.01,lineHeight:O,letterSpacing:w??0,wordSpacing:G??0,textAppearance:Y,color:j},Ee=it(Be(ve,t)),Ie=S.buildColorVars(o,{inputColor:y,inputTextColor:E,inputBorderColor:B,placeholderColor:R!=null&&R.trim()?R:"#cccccc",buttonColor:_,buttonTextColor:f,buttonBorderColor:x,labelTextColor:L,successColor:j,errorColor:I},Gs,Us,oe),[Ce,Me]=m.useState(()=>Object.fromEntries(ce.map(he=>[he.name,""]))),[be,He]=m.useState("idle"),[_e,ke]=m.useState(null),ze=r==="success"?"success":r==="error"?"error":be,Xe=r==="error"?ae:_e,lt=r==="filled",et=m.useMemo(()=>{if(!lt)return Ce;let he=null;for(const Fe of ce)(Ce[Fe.name]??"").trim().length>0||(he=he??{...Ce},he[Fe.name]="Filled");return he??Ce},[Ce,lt,ce]),kn=ze==="error"?S.getFormFieldValidationError(ce,et):null,Wn=`${r&&r!=="default"?`${o}-state-${r}`:""}`.trim(),tn=n==null?void 0:n.submitUrl,we=(he,Fe)=>{Me(Ne=>({...Ne,[he]:Fe}))},Ae=async he=>{he.preventDefault();const Fe=Object.fromEntries(ce.map(Oe=>{var Ue;return[Oe.name,((Ue=Ce[Oe.name])==null?void 0:Ue.trim())??""]}).filter(([,Oe])=>Oe));if(!tn){He("error"),ke("No integrations were found for this form.");return}if(Object.keys(Fe).length===0)return;const Ne=S.getFormFieldValidationError(ce,Ce);if(Ne){He("error"),ke(Ne);return}He("submitting"),ke(null);try{const Oe=await fetch(tn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Fe)});if(!Oe.ok){const Ue=await Oe.text();throw new Error(Ue||`Request failed: ${Oe.status}`)}He("success"),Me(Object.fromEntries(ce.map(Ue=>[Ue.name,""])))}catch(Oe){He("error"),ke(Oe instanceof Error?Oe.message:"Something went wrong")}};return a.jsxs("div",{className:`${o}-wrapper ${o}-type-${s} ${Wn}`.trim(),style:Ie,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Vs(o)}}),a.jsxs("form",{onSubmit:Ae,className:`${o}-form`,style:{gap:S.scalingValue(d??0,t)},children:[a.jsx("div",{className:`${o}-fields`,style:{gap:S.scalingValue(u??0,t)},children:ce.map((he,Fe)=>a.jsxs("div",{className:`${o}-field-group${re?` ${o}-labeled`:""}`,children:[re&&a.jsx("span",{className:`${o}-field-label`,style:Pe?{...Pe,lineHeight:Pe.fontSize}:void 0,children:he.label||he.name}),he.type==="textarea"?a.jsx("textarea",{name:he.name,autoComplete:"off",value:et[he.name]??"",onChange:Ne=>we(he.name,Ne.target.value),placeholder:he.placeholder,className:`${o}-input`,style:Q,rows:1,"data-filled":lt||(et[he.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:he.type==="phone"?"tel":he.type==="email"?"email":"text",name:he.name,autoComplete:"off",value:et[he.name]??"",onChange:Ne=>we(he.name,Ne.target.value),placeholder:he.placeholder,required:he.isRequired??he.type==="email",className:`${o}-input`,style:Q,"data-filled":lt||(et[he.name]??"").trim().length>0})]},Fe))}),a.jsx("div",{className:`${o}-overlay-anchor`,children:a.jsx("button",{type:"submit",className:`${o}-button`,style:{borderStyle:"solid",borderRadius:S.scalingValue(T??0,t),borderWidth:Te,paddingTop:S.scalingValue((h==null?void 0:h.top)??0,t),paddingRight:S.scalingValue((h==null?void 0:h.right)??0,t),paddingBottom:S.scalingValue((h==null?void 0:h.bottom)??0,t),paddingLeft:S.scalingValue((h==null?void 0:h.left)??0,t),...Se,...p?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:a.jsx("span",{className:`${o}-overlay-anchor`,style:p?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:be==="submitting"?"...":c})})})]}),ze==="success"&&a.jsx("p",{className:`${o}-success`,style:{...Ee},children:J}),ze==="error"&&a.jsx("p",{className:`${o}-error`,style:{...Ee},role:"alert",children:kn??Xe??ae})]})}const Gs={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"},Us=["hover","focus","filled","success","error"],qs=`import React, { useMemo, useState } from 'react';\r
142
+ `}function cs({settings:e,isEditor:t,metadata:n,activeEvent:r}){const{prefix:o}=$.useScopedStyles(),{type:l="A",fieldsToShow:i=2,fields:c=[],buttonLabel:s,gap:u,fieldsGap:d,buttonCorners:L,buttonStroke:b,buttonPadding:f,isButtonFullWidth:p,inputCorners:m,inputStroke:v,inputPadding:h,inputColor:S,inputTextColor:T,inputBorderColor:z,placeholderColor:F,buttonColor:_,buttonTextColor:y,buttonBorderColor:x,labelTextColor:E,successColor:O,errorColor:P,fontFamily:H,inputFontSettings:N,inputFontSize:D,inputLineHeight:V,inputLetterSpacing:C,inputWordSpacing:A,inputTextAppearance:I,buttonFontSettings:k,buttonFontSize:W,buttonLineHeight:M,buttonLetterSpacing:Z,buttonWordSpacing:ae,buttonTextAppearance:ne,labelFontSettings:ue,labelFontSize:R,labelLineHeight:re,labelLetterSpacing:he,labelWordSpacing:me,labelTextAppearance:ge,statusFontSettings:U,statusFontSize:le,statusLineHeight:B,statusLetterSpacing:w,statusWordSpacing:K,statusTextAppearance:X,successMessage:J,errorMessage:ie,stateOverrides:Q}=e,ee=l==="B",se=c.slice(0,Math.min(i,c.length)),j={fontSettings:{fontFamily:H,fontWeight:(N==null?void 0:N.fontWeight)??400,fontStyle:(N==null?void 0:N.fontStyle)??"normal"},fontSize:D??.01,lineHeight:V,letterSpacing:C??0,wordSpacing:A??0,textAppearance:I,color:T},q=ut(ze(j,t)),Y=$.scalingValue(v??0,t),ce=$.scalingValue((V??D??.01)+((h==null?void 0:h.top)??0)+((h==null?void 0:h.bottom)??0)+(l==="C"?v??0:(v??0)*2),t),oe={...q,borderStyle:"solid",borderRadius:l==="C"?0:$.scalingValue(m??0,t),...l==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:Y,borderLeftWidth:0}:{borderWidth:Y},paddingTop:$.scalingValue((h==null?void 0:h.top)??0,t),paddingRight:$.scalingValue((h==null?void 0:h.right)??0,t),paddingBottom:$.scalingValue((h==null?void 0:h.bottom)??0,t),paddingLeft:$.scalingValue((h==null?void 0:h.left)??0,t),height:ce,minHeight:ce},pe={fontSettings:{fontFamily:H,fontWeight:(k==null?void 0:k.fontWeight)??400,fontStyle:(k==null?void 0:k.fontStyle)??"normal"},fontSize:W??.01,lineHeight:M,letterSpacing:Z??0,wordSpacing:ae??0,textAppearance:ne,color:y},we=ut(ze(pe,t)),Le=$.scalingValue(b??0,t),Oe={fontSettings:{fontFamily:H,fontWeight:(ue==null?void 0:ue.fontWeight)??400,fontStyle:(ue==null?void 0:ue.fontStyle)??"normal"},fontSize:R??.01,lineHeight:re,letterSpacing:he??0,wordSpacing:me??0,textAppearance:ge,color:E},Xe=ze(Oe,t),be={fontSettings:{fontFamily:H,fontWeight:(U==null?void 0:U.fontWeight)??400,fontStyle:(U==null?void 0:U.fontStyle)??"normal"},fontSize:le??.01,lineHeight:B,letterSpacing:w??0,wordSpacing:K??0,textAppearance:X,color:O},Ae=ut(ze(be,t)),Be=$.buildColorVars(o,{inputColor:S,inputTextColor:T,inputBorderColor:z,placeholderColor:F!=null&&F.trim()?F:"#cccccc",buttonColor:_,buttonTextColor:y,buttonBorderColor:x,labelTextColor:E,successColor:O,errorColor:P},ds,us,Q),[xe,Fe]=g.useState(()=>Object.fromEntries(se.map(fe=>[fe.name,""]))),[Ce,Ie]=g.useState("idle"),[We,Ee]=g.useState(null),Ve=r==="success"?"success":r==="error"?"error":Ce,Ze=r==="error"?ie:We,Me=r==="filled",He=g.useMemo(()=>{if(!Me)return xe;let fe=null;for(const Ke of se)(xe[Ke.name]??"").trim().length>0||(fe=fe??{...xe},fe[Ke.name]="Filled");return fe??xe},[xe,Me,se]),at=Ve==="error"?$.getFormFieldValidationError(se,He):null,Zn=`${r&&r!=="default"?`${o}-state-${r}`:""}`.trim(),mn=n==null?void 0:n.submitUrl,gn=(fe,Ke)=>{Fe(De=>({...De,[fe]:Ke}))},Pe=async fe=>{fe.preventDefault();const Ke=Object.fromEntries(se.map(Re=>{var Ge;return[Re.name,((Ge=xe[Re.name])==null?void 0:Ge.trim())??""]}).filter(([,Re])=>Re));if(!mn){Ie("error"),Ee("No integrations were found for this form.");return}if(Object.keys(Ke).length===0)return;const De=$.getFormFieldValidationError(se,xe);if(De){Ie("error"),Ee(De);return}Ie("submitting"),Ee(null);try{const Re=await fetch(mn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ke)});if(!Re.ok){const Ge=await Re.text();throw new Error(Ge||`Request failed: ${Re.status}`)}Ie("success"),Fe(Object.fromEntries(se.map(Ge=>[Ge.name,""])))}catch(Re){Ie("error"),Ee(Re instanceof Error?Re.message:"Something went wrong")}};return a.jsxs("div",{className:`${o}-wrapper ${o}-type-${l} ${Zn}`.trim(),style:Be,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ss(o)}}),a.jsxs("form",{onSubmit:Pe,className:`${o}-form`,style:{gap:$.scalingValue(u??0,t)},children:[a.jsx("div",{className:`${o}-fields`,style:{gap:$.scalingValue(d??0,t)},children:se.map((fe,Ke)=>a.jsxs("div",{className:`${o}-field-group${ee?` ${o}-labeled`:""}`,children:[ee&&a.jsx("span",{className:`${o}-field-label`,style:Xe?{...Xe,lineHeight:Xe.fontSize}:void 0,children:fe.label||fe.name}),fe.type==="textarea"?a.jsx("textarea",{name:fe.name,autoComplete:"off",value:He[fe.name]??"",onChange:De=>gn(fe.name,De.target.value),placeholder:fe.placeholder,className:`${o}-input`,style:oe,rows:1,"data-filled":Me||(He[fe.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:fe.type==="phone"?"tel":fe.type==="email"?"email":"text",name:fe.name,autoComplete:"off",value:He[fe.name]??"",onChange:De=>gn(fe.name,De.target.value),placeholder:fe.placeholder,required:fe.isRequired??fe.type==="email",className:`${o}-input`,style:oe,"data-filled":Me||(He[fe.name]??"").trim().length>0})]},Ke))}),a.jsx("div",{className:`${o}-overlay-anchor`,children:a.jsx("button",{type:"submit",className:`${o}-button`,style:{borderStyle:"solid",borderRadius:$.scalingValue(L??0,t),borderWidth:Le,paddingTop:$.scalingValue((f==null?void 0:f.top)??0,t),paddingRight:$.scalingValue((f==null?void 0:f.right)??0,t),paddingBottom:$.scalingValue((f==null?void 0:f.bottom)??0,t),paddingLeft:$.scalingValue((f==null?void 0:f.left)??0,t),...we,...p?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:a.jsx("span",{className:`${o}-overlay-anchor`,style:p?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:Ce==="submitting"?"...":s})})})]}),Ve==="success"&&a.jsx("p",{className:`${o}-success`,style:{...Ae},children:J}),Ve==="error"&&a.jsx("p",{className:`${o}-error`,style:{...Ae},role:"alert",children:at??Ze??ie})]})}const ds={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"},us=["hover","focus","filled","success","error"],ps=`import React, { useMemo, useState } from 'react';\r
143
143
  import { CommonComponentProps } from '../props';\r
144
144
  import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';\r
145
145
  import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';\r
@@ -740,7 +740,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {\r
740
740
  };\r
741
741
  \r
742
742
  const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
743
- `,Ks=[{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."},{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"}],an={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Ys=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],Xs={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"number"},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:"Input Fill",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"common",title:"Input Stroke",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler text",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Button Fill",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Button Label",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:"Button Stroke",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Color",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:{...an.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:{...an.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:{...an.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:{...an.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:Ks,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","fieldsToShow"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:[{type:"group",title:"",items:["fieldsGap","inputCorners"]},{type:"group",title:"",items:["inputStroke","inputPadding"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["gap","buttonCorners"]},{type:"row",title:"",items:["buttonStroke","buttonPadding"]},{type:"row",title:"",items:["isButtonFullWidth"]}]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["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:["fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Ys],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"]},Zs={element:Ds,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.jpg"},defaultSize:{width:300,height:42},schema:Xs,sourceCode:qs};function sn(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Js(e){return`
743
+ `,ms=[{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."},{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"}],xn={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},gs=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],hs={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"number"},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:"Input Fill",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"common",title:"Input Stroke",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler text",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Button Fill",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Button Label",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:"Button Stroke",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Color",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:{...xn.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:{...xn.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:{...xn.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:{...xn.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:ms,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","fieldsToShow"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:[{type:"group",title:"",items:["fieldsGap","inputCorners"]},{type:"group",title:"",items:["inputStroke","inputPadding"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["gap","buttonCorners"]},{type:"row",title:"",items:["buttonStroke","buttonPadding"]},{type:"row",title:"",items:["isButtonFullWidth"]}]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["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:["fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...gs],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"]},fs={element:cs,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.jpg"},defaultSize:{width:300,height:42},schema:hs,sourceCode:ps};function Cn(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function ys(e){return`
744
744
  .${e}-wrapper {
745
745
  display: flex;
746
746
  flex-direction: column;
@@ -922,16 +922,16 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
922
922
  align-items: center;
923
923
  }
924
924
  .${e}-success {
925
- margin-top: ${sn(8)};
926
- font-size: ${sn(14)};
925
+ margin-top: ${Cn(8)};
926
+ font-size: ${Cn(14)};
927
927
  color: var(--${e}-success-success-color, var(--${e}-success-color));
928
928
  }
929
929
  .${e}-error {
930
- margin-top: ${sn(8)};
931
- font-size: ${sn(14)};
930
+ margin-top: ${Cn(8)};
931
+ font-size: ${Cn(14)};
932
932
  color: var(--${e}-error-error-color, var(--${e}-error-color));
933
933
  }
934
- `}const Qs=({settings:e,isEditor:t,metadata:n,activeEvent:r})=>{const{prefix:o}=S.useScopedStyles(),{fields:s=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:i,buttonLabel:l,fieldsToShow:c=1,fontFamily:d,inputFontSettings:u,inputFontSize:T,inputLineHeight:C,inputLetterSpacing:h,inputWordSpacing:p,inputTextAppearance:g,buttonFontSettings:$,buttonFontSize:v,buttonLineHeight:y,buttonLetterSpacing:E,buttonWordSpacing:B,buttonTextAppearance:R,statusFontSettings:_,statusFontSize:f,statusLineHeight:x,statusLetterSpacing:L,statusWordSpacing:j,statusTextAppearance:I,iconMaxWidth:P,minHeight:H,corners:z,stroke:D,stateOverrides:b,inputPadding:k,buttonPadding:F,successMessage:W="Thanks for subscribing!",errorMessage:A="Please, fill all required fields."}=e,N=s.slice(0,Math.min(c,s.length)),[Z,le]=m.useState(()=>Object.fromEntries(N.map(ve=>[ve.name,""]))),[ne,de]=m.useState("idle"),[M,te]=m.useState(null),fe=r==="success"?"success":r==="error"?"error":ne,me=r==="error"?A:M,ge=r==="filled",q=m.useMemo(()=>{if(!ge)return Z;let ve=null;for(const Ee of N)(Z[Ee.name]??"").trim().length>0||(ve=ve??{...Z},ve[Ee.name]="Filled");return ve??Z},[ge,Z,N]),ie=fe==="error"?S.getFormFieldValidationError(N,q):null,O=r&&r!=="default"?`${o}-state-${r}`:"",w=N.some(ve=>(q[ve.name]??"").trim().length>0),G=O!==`${o}-state-filled`&&w?`${o}-state-filled`:"",Y=`${O} ${G}`.trim(),J=n==null?void 0:n.submitUrl,ae=l??"",oe=(i==null?void 0:i.icon)??"",re=(i==null?void 0:i.mode)==="On",ce=ae||"Submit",V={fontSettings:{fontFamily:d,fontWeight:(u==null?void 0:u.fontWeight)??400,fontStyle:(u==null?void 0:u.fontStyle)??"normal"},fontSize:T??.01,lineHeight:C,letterSpacing:h??0,wordSpacing:p??0,textAppearance:g,color:e.inputTextColor??"#111111"},X={fontSettings:{fontFamily:d,fontWeight:($==null?void 0:$.fontWeight)??400,fontStyle:($==null?void 0:$.fontStyle)??"normal"},fontSize:v??.01,lineHeight:y,letterSpacing:E??0,wordSpacing:B??0,textAppearance:R,color:e.buttonTextColor??"#ffffff"},K={fontSettings:{fontFamily:d,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:f??.01,lineHeight:x,letterSpacing:L??0,wordSpacing:j??0,textAppearance:I,color:e.successColor??"#22c55e"},se=it(Be(V,t)),Q=it(Be(X,t)),ue=it(Be(K,t)),Se=S.buildColorVars(o,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(V==null?void 0:V.color)??"#111111",buttonTextColor:e.buttonTextColor??(X==null?void 0:X.color)??"#ffffff"},el,tl,b),Te={borderRadius:S.scalingValue(z,t),borderWidth:S.scalingValue(D,t),borderStyle:"solid"},Re={borderLeftWidth:S.scalingValue(D,t)},Pe=async ve=>{ve.preventDefault();const Ee=Object.fromEntries(N.map(Ce=>{var Me;return[Ce.name,((Me=Z[Ce.name])==null?void 0:Me.trim())??""]}).filter(([,Ce])=>Ce));if(!J){de("error"),te("No integrations were found for this form.");return}if(Object.keys(Ee).length===0)return;const Ie=S.getFormFieldValidationError(N,Z);if(Ie){de("error"),te(Ie);return}de("submitting"),te(null);try{const Ce=await fetch(J,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ee)});if(!Ce.ok){const Me=await Ce.text();throw new Error(Me||`Request failed: ${Ce.status}`)}de("success"),le(Object.fromEntries(N.map(Me=>[Me.name,""])))}catch(Ce){de("error"),te(Ce instanceof Error?Ce.message:"Something went wrong")}};return a.jsxs("div",{className:`${o}-wrapper ${Y}`.trim(),style:Se,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Js(o)}}),a.jsxs("form",{onSubmit:Pe,className:`${o}-form`,style:{...Te,height:S.scalingValue(H,t),minHeight:S.scalingValue(H,t)},children:[a.jsx("div",{className:`${o}-inputWrap ${o}-overlayAnchor`,style:{flex:1,minWidth:0},children:N.map(ve=>a.jsx("input",{type:ve.type==="email"?"email":ve.type==="phone"?"tel":"text",name:ve.name,autoComplete:"off",value:q[ve.name]??"",onChange:Ee=>le(Ie=>({...Ie,[ve.name]:Ee.target.value})),placeholder:ve.placeholder,required:ve.isRequired??ve.type==="email",className:`${o}-input`,style:{...se,paddingRight:S.scalingValue(k.right,t),paddingLeft:S.scalingValue(k.left,t),paddingTop:S.scalingValue(k.top,t),paddingBottom:S.scalingValue(k.bottom,t)}},ve.name))}),a.jsx("div",{className:`${o}-overlayAnchor`,children:a.jsx("button",{type:"submit",className:`${o}-submitBtn`,"aria-label":ce,style:{...Q,...Re,paddingRight:S.scalingValue(F.right,t),paddingLeft:S.scalingValue(F.left,t),paddingTop:S.scalingValue(F.top,t),paddingBottom:S.scalingValue(F.bottom,t)},children:ne==="submitting"?"...":re?oe&&a.jsx(pt,{url:oe,className:`${o}-submitBtnIcon`,style:{maxWidth:S.scalingValue(P??0,t)},fill:`var(--${o}-button-text-color)`,hoverFill:`var(--${o}-button-text-color)`}):ae})})]}),fe==="success"&&a.jsx("p",{className:`${o}-success`,style:{...ue},children:W}),fe==="error"&&a.jsx("p",{className:`${o}-error`,style:{...ue},role:"alert",children:ie??me??A})]})},el={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"},tl=["hover","focus","filled","success","error"],nl=`import React, { useMemo, useState } from 'react';\r
934
+ `}const vs=({settings:e,isEditor:t,metadata:n,activeEvent:r})=>{const{prefix:o}=$.useScopedStyles(),{fields:l=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:i,buttonLabel:c,fieldsToShow:s=1,fontFamily:u,inputFontSettings:d,inputFontSize:L,inputLineHeight:b,inputLetterSpacing:f,inputWordSpacing:p,inputTextAppearance:m,buttonFontSettings:v,buttonFontSize:h,buttonLineHeight:S,buttonLetterSpacing:T,buttonWordSpacing:z,buttonTextAppearance:F,statusFontSettings:_,statusFontSize:y,statusLineHeight:x,statusLetterSpacing:E,statusWordSpacing:O,statusTextAppearance:P,iconMaxWidth:H,minHeight:N,corners:D,stroke:V,stateOverrides:C,inputPadding:A,buttonPadding:I,successMessage:k="Thanks for subscribing!",errorMessage:W="Please, fill all required fields."}=e,M=l.slice(0,Math.min(s,l.length)),[Z,ae]=g.useState(()=>Object.fromEntries(M.map(be=>[be.name,""]))),[ne,ue]=g.useState("idle"),[R,re]=g.useState(null),he=r==="success"?"success":r==="error"?"error":ne,me=r==="error"?W:R,ge=r==="filled",U=g.useMemo(()=>{if(!ge)return Z;let be=null;for(const Ae of M)(Z[Ae.name]??"").trim().length>0||(be=be??{...Z},be[Ae.name]="Filled");return be??Z},[ge,Z,M]),le=he==="error"?$.getFormFieldValidationError(M,U):null,B=r&&r!=="default"?`${o}-state-${r}`:"",w=M.some(be=>(U[be.name]??"").trim().length>0),K=B!==`${o}-state-filled`&&w?`${o}-state-filled`:"",X=`${B} ${K}`.trim(),J=n==null?void 0:n.submitUrl,ie=c??"",Q=(i==null?void 0:i.icon)??"",ee=(i==null?void 0:i.mode)==="On",se=ie||"Submit",j={fontSettings:{fontFamily:u,fontWeight:(d==null?void 0:d.fontWeight)??400,fontStyle:(d==null?void 0:d.fontStyle)??"normal"},fontSize:L??.01,lineHeight:b,letterSpacing:f??0,wordSpacing:p??0,textAppearance:m,color:e.inputTextColor??"#111111"},q={fontSettings:{fontFamily:u,fontWeight:(v==null?void 0:v.fontWeight)??400,fontStyle:(v==null?void 0:v.fontStyle)??"normal"},fontSize:h??.01,lineHeight:S,letterSpacing:T??0,wordSpacing:z??0,textAppearance:F,color:e.buttonTextColor??"#ffffff"},Y={fontSettings:{fontFamily:u,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:y??.01,lineHeight:x,letterSpacing:E??0,wordSpacing:O??0,textAppearance:P,color:e.successColor??"#22c55e"},ce=ut(ze(j,t)),oe=ut(ze(q,t)),pe=ut(ze(Y,t)),we=$.buildColorVars(o,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(j==null?void 0:j.color)??"#111111",buttonTextColor:e.buttonTextColor??(q==null?void 0:q.color)??"#ffffff"},bs,xs,C),Le={borderRadius:$.scalingValue(D,t),borderWidth:$.scalingValue(V,t),borderStyle:"solid"},Oe={borderLeftWidth:$.scalingValue(V,t)},Xe=async be=>{be.preventDefault();const Ae=Object.fromEntries(M.map(xe=>{var Fe;return[xe.name,((Fe=Z[xe.name])==null?void 0:Fe.trim())??""]}).filter(([,xe])=>xe));if(!J){ue("error"),re("No integrations were found for this form.");return}if(Object.keys(Ae).length===0)return;const Be=$.getFormFieldValidationError(M,Z);if(Be){ue("error"),re(Be);return}ue("submitting"),re(null);try{const xe=await fetch(J,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ae)});if(!xe.ok){const Fe=await xe.text();throw new Error(Fe||`Request failed: ${xe.status}`)}ue("success"),ae(Object.fromEntries(M.map(Fe=>[Fe.name,""])))}catch(xe){ue("error"),re(xe instanceof Error?xe.message:"Something went wrong")}};return a.jsxs("div",{className:`${o}-wrapper ${X}`.trim(),style:we,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ys(o)}}),a.jsxs("form",{onSubmit:Xe,className:`${o}-form`,style:{...Le,height:$.scalingValue(N,t),minHeight:$.scalingValue(N,t)},children:[a.jsx("div",{className:`${o}-inputWrap ${o}-overlayAnchor`,style:{flex:1,minWidth:0},children:M.map(be=>a.jsx("input",{type:be.type==="email"?"email":be.type==="phone"?"tel":"text",name:be.name,autoComplete:"off",value:U[be.name]??"",onChange:Ae=>ae(Be=>({...Be,[be.name]:Ae.target.value})),placeholder:be.placeholder,required:be.isRequired??be.type==="email",className:`${o}-input`,style:{...ce,paddingRight:$.scalingValue(A.right,t),paddingLeft:$.scalingValue(A.left,t),paddingTop:$.scalingValue(A.top,t),paddingBottom:$.scalingValue(A.bottom,t)}},be.name))}),a.jsx("div",{className:`${o}-overlayAnchor`,children:a.jsx("button",{type:"submit",className:`${o}-submitBtn`,"aria-label":se,style:{...oe,...Oe,paddingRight:$.scalingValue(I.right,t),paddingLeft:$.scalingValue(I.left,t),paddingTop:$.scalingValue(I.top,t),paddingBottom:$.scalingValue(I.bottom,t)},children:ne==="submitting"?"...":ee?Q&&a.jsx(yt,{url:Q,className:`${o}-submitBtnIcon`,style:{maxWidth:$.scalingValue(H??0,t)},fill:`var(--${o}-button-text-color)`,hoverFill:`var(--${o}-button-text-color)`}):ie})})]}),he==="success"&&a.jsx("p",{className:`${o}-success`,style:{...pe},children:k}),he==="error"&&a.jsx("p",{className:`${o}-error`,style:{...pe},role:"alert",children:le??me??W})]})},bs={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"},xs=["hover","focus","filled","success","error"],Cs=`import React, { useMemo, useState } from 'react';\r
935
935
  import { CommonComponentProps } from '../props';\r
936
936
  import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';\r
937
937
  import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';\r
@@ -1503,7 +1503,7 @@ const COLOR_VAR_MAP: Record<OnelinerColorKeys, string> = {\r
1503
1503
  };\r
1504
1504
  \r
1505
1505
  const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
1506
- `,rl="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>'),ol=[{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."}],zn={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},il=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],al={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"number"},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",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Input Fill",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 Text",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Button Fill",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Button Label",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:{...zn.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:{...zn.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:{...zn.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:ol,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:rl},fontFamily:"Arial",strokeColor:"#0A00F8",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#0088D7",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:0,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:0,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__","fieldsToShow"]},{type:"row",items:["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:["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:["fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...il],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"]},sl={element:Qs,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/onelinerImg.jpg"},defaultSize:{width:400,height:60},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},schema:al,sourceCode:nl};function zr(e){return`
1506
+ `,Ss="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>'),$s=[{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."}],or={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},ws=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],Ts={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"number"},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",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Input Fill",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 Text",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Button Fill",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Button Label",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:{...or.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:{...or.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:{...or.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:$s,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:Ss},fontFamily:"Arial",strokeColor:"#0A00F8",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#0088D7",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:0,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:0,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__","fieldsToShow"]},{type:"row",items:["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:["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:["fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...ws],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"]},Ls={element:vs,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/onelinerImg.jpg"},defaultSize:{width:400,height:60},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},schema:Ts,sourceCode:Cs};function io(e){return`
1507
1507
  .${e}-marquee-wrapper {
1508
1508
  overflow: hidden;
1509
1509
  width: 100%;
@@ -1590,7 +1590,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
1590
1590
  pointer-events: auto;
1591
1591
  z-index: 10;
1592
1592
  }
1593
- `}const ll=30,cl=({settings:e,content:t,isEditor:n,isPreviewMode:r})=>{const{prefix:o}=S.useScopedStyles(),{autoplay:s,align:i,speed:l,direction:c,pauseOnHover:d,gap:u,cardWidth:T,corners:C,stroke:h,strokeColor:p,bgColor:g,padding:$,logoMarginTop:v,logoWidth:y,logoHeight:E,captionMarginTop:B}=e,R=s==="on"&&!r,_=R,f=Math.max(0,l)*ll,x=V=>S.scalingValue(V,n??!1),L=m.useRef(null),j=m.useRef(null),I=m.useRef(null),[P,H]=m.useState(0),[z,D]=m.useState(0),[b,k]=m.useState(0),F=_&&d==="on",[W,A]=m.useState(!1),N=m.useRef(null),[Z,le]=m.useState(0),[ne,de]=m.useState(0),M=m.useRef(null),te=V=>{var K,se,Q,ue,Se;return{fontSettings:{fontFamily:(e==null?void 0:e[`${V}FontFamily`])??"Arial",fontWeight:((K=e==null?void 0:e[`${V}FontSettings`])==null?void 0:K.fontWeight)??400,fontStyle:((se=e==null?void 0:e[`${V}FontSettings`])==null?void 0:se.fontStyle)??"normal"},textAppearance:{textTransform:((Q=e==null?void 0:e[`${V}TextAppearance`])==null?void 0:Q.textTransform)??"none",textDecoration:((ue=e==null?void 0:e[`${V}TextAppearance`])==null?void 0:ue.textDecoration)??"none",fontVariant:((Se=e==null?void 0:e[`${V}TextAppearance`])==null?void 0:Se.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${V}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${V}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${V}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${V}LineHeight`])??.01,color:(e==null?void 0:e[`${V}Color`])??"#000000"}},fe=te("text"),me=te("caption"),ge=m.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(V=>{var X,K;return(((X=V.text)==null?void 0:X.length)??0)>0||(((K=V.caption)==null?void 0:K.length)??0)>0}),[t]),q=m.useMemo(()=>!R||(t==null?void 0:t.length)===0?1:z<=0||P<=0?2:Math.max(2,Math.ceil(P/z)+1),[R,t==null?void 0:t.length,z,P]);m.useLayoutEffect(()=>{if(!R)return;const V=L.current,X=I.current;if(!V||!X)return;let K=0;const se=()=>{const Se=V.getBoundingClientRect().width,Te=X.getBoundingClientRect().width,Re=M.current,Pe=typeof Re=="number"&&Math.abs(Re-Te)<=.25;if(M.current=Te,H(Se),typeof Te=="number"&&Te>0&&z<=0){D(Te);return}Pe&&Te!==z?D(Te):!Pe&&z<=0&&(cancelAnimationFrame(K),K=requestAnimationFrame(se))},Q=()=>{cancelAnimationFrame(K),K=requestAnimationFrame(se)};Q();const ue=new ResizeObserver(Q);return ue.observe(V),ue.observe(X),()=>{cancelAnimationFrame(K),ue.disconnect()}},[R,z]),m.useLayoutEffect(()=>{const V=j.current;if(!R||!V||!_)return;const X=z>0?z:0,K=X>0&&f>0?X/f*1e3:0,se=`${Math.max(0,K)/1e3}s`;V.style.setProperty("--marquee-distance",`${X}px`),V.style.setProperty("--marquee-duration",se)},[R,_,f,z]),m.useLayoutEffect(()=>{if(!R){k(0);return}const V=j.current;if(!V)return;const X=()=>{const se=V.getBoundingClientRect().height;k(se>0?se:0)};X();const K=new ResizeObserver(X);return K.observe(V),()=>{K.disconnect()}},[R,q,t,n,u,T,$,h,C,y,E]);const ie=()=>{F&&A(!0)},O=()=>{F&&A(!1)},w=m.useMemo(()=>{switch(i){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[i]),G=m.useMemo(()=>{switch(i){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[i]),Y=m.useCallback((V,X,K,se)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:w,width:"100%"},children:[a.jsx("div",{"data-controls":se==null?void 0:se.controlsName,"data-controls-axis":"y",className:`${o}-control`,style:{height:x((se==null?void 0:se.marginTop)??0)}}),a.jsx("div",{...se!=null&&se.dataMeasureKind?{"data-testimonial-measure":se.dataMeasureKind}:{},style:{...Be(V,n),textAlign:G,pointerEvents:"auto",...typeof(se==null?void 0:se.minHeightPx)=="number"&&se.minHeightPx>0?{minHeight:se.minHeightPx}:{}},children:a.jsx(Ut,{content:X})})]},K),[w,G,n]),J=m.useCallback((V,X,K)=>{var se,Q,ue;return a.jsxs("div",{style:{padding:`${x($.top)} ${x($.right)} ${x($.bottom)} ${x($.left)}`,width:x(T+h*2),height:"100%",borderRadius:x(C),border:`${x(h)} solid ${p}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[a.jsx("div",{className:`${o}-cover`,style:{background:g}}),a.jsxs("div",{className:`${o}-elements-overlay`,style:{alignItems:w,textAlign:G},children:[V.text&&Y(fe,V.text,"text",K!=null&&K.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(K==null?void 0:K.textMinHeightPx)=="number"&&K.textMinHeightPx>0?{minHeightPx:K.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:w,width:"100%"},children:[a.jsx("div",{"data-controls":"logoMarginTop",className:`${o}-control`,style:{height:x(v)}}),a.jsx("div",{style:{width:x(y),height:x(E)},children:((se=V.logo)==null?void 0:se.url)&&a.jsx("img",{src:V.logo.url,alt:((Q=V.logo)==null?void 0:Q.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((ue=V.logo)==null?void 0:ue.objectFit)||"contain"}})})]}),V.caption&&Y(me,V.caption,"caption",{controlsName:"captionMarginTop",marginTop:B,...K!=null&&K.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(K==null?void 0:K.captionMinHeightPx)=="number"&&K.captionMinHeightPx>0?{minHeightPx:K.captionMinHeightPx}:{}})]})]},X)},[g,B,me,T,C,E,v,y,w,G,$.bottom,$.left,$.right,$.top,Y,h,p,fe,n]),ae=m.useCallback(V=>{le(V.maxTextPx),de(V.maxCaptionPx)},[]);m.useLayoutEffect(()=>{if(!ge){ae({maxTextPx:0,maxCaptionPx:0});return}const V=N.current;if(!V)return;const X=()=>{S.readTestimonialTextMeasure(V,ae)};X();const K=new ResizeObserver(X);return K.observe(V),()=>{K.disconnect()}},[ge,ae,t,J]);const oe=ge?{textMinHeightPx:Z,captionMinHeightPx:ne}:void 0,re=ge?a.jsx("div",{ref:N,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((V,X)=>J(V,`measure-${X}`,{dataMeasureAttrs:!0}))}):null,ce=(V,X)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[J(V,`card-${X}`,oe),n&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${x(u)})`,width:x(u),height:"100%",pointerEvents:"auto",zIndex:2}})]},X);return R&&((t==null?void 0:t.length)??0)>0?a.jsxs("div",{ref:L,className:ye(`${o}-wrapper`,`${o}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...b>0?{height:b}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:zr(o)}}),re,a.jsx("div",{ref:j,className:`${o}-marquee-track`,"data-direction":c,onMouseEnter:ie,onMouseLeave:O,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px",...F?{"--marquee-play-state":W?"paused":"running"}:{"--marquee-play-state":"running"}},children:Array.from({length:q},(V,X)=>a.jsx("div",{ref:X===0?I:void 0,className:`${o}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:x(u),paddingRight:x(u)},"aria-hidden":X>0,children:t==null?void 0:t.map((K,se)=>ce(K,`${X}-${se}`))},`set-${X}`))})]}):a.jsxs("div",{className:`${o}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:zr(o)}}),re,a.jsx("div",{style:{gap:x(u),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((V,X)=>ce(V,X))})]})},ul=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';\r
1593
+ `}const _s=30,Ws=({settings:e,content:t,isEditor:n,isPreviewMode:r})=>{const{prefix:o}=$.useScopedStyles(),{autoplay:l,align:i,speed:c,direction:s,pauseOnHover:u,gap:d,cardWidth:L,corners:b,stroke:f,strokeColor:p,bgColor:m,padding:v,logoMarginTop:h,logoWidth:S,logoHeight:T,captionMarginTop:z}=e,F=l==="on"&&!r,_=F,y=Math.max(0,c)*_s,x=j=>$.scalingValue(j,n??!1),E=g.useRef(null),O=g.useRef(null),P=g.useRef(null),[H,N]=g.useState(0),[D,V]=g.useState(0),[C,A]=g.useState(0),I=_&&u==="on",[k,W]=g.useState(!1),M=g.useRef(null),[Z,ae]=g.useState(0),[ne,ue]=g.useState(0),R=g.useRef(null),re=j=>{var Y,ce,oe,pe,we;return{fontSettings:{fontFamily:(e==null?void 0:e[`${j}FontFamily`])??"Arial",fontWeight:((Y=e==null?void 0:e[`${j}FontSettings`])==null?void 0:Y.fontWeight)??400,fontStyle:((ce=e==null?void 0:e[`${j}FontSettings`])==null?void 0:ce.fontStyle)??"normal"},textAppearance:{textTransform:((oe=e==null?void 0:e[`${j}TextAppearance`])==null?void 0:oe.textTransform)??"none",textDecoration:((pe=e==null?void 0:e[`${j}TextAppearance`])==null?void 0:pe.textDecoration)??"none",fontVariant:((we=e==null?void 0:e[`${j}TextAppearance`])==null?void 0:we.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${j}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${j}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${j}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${j}LineHeight`])??.01,color:(e==null?void 0:e[`${j}Color`])??"#000000"}},he=re("text"),me=re("caption"),ge=g.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(j=>{var q,Y;return(((q=j.text)==null?void 0:q.length)??0)>0||(((Y=j.caption)==null?void 0:Y.length)??0)>0}),[t]),U=g.useMemo(()=>!F||(t==null?void 0:t.length)===0?1:D<=0||H<=0?2:Math.max(2,Math.ceil(H/D)+1),[F,t==null?void 0:t.length,D,H]);g.useLayoutEffect(()=>{if(!F)return;const j=E.current,q=P.current;if(!j||!q)return;let Y=0;const ce=()=>{const we=j.getBoundingClientRect().width,Le=q.getBoundingClientRect().width,Oe=R.current,Xe=typeof Oe=="number"&&Math.abs(Oe-Le)<=.25;if(R.current=Le,N(we),typeof Le=="number"&&Le>0&&D<=0){V(Le);return}Xe&&Le!==D?V(Le):!Xe&&D<=0&&(cancelAnimationFrame(Y),Y=requestAnimationFrame(ce))},oe=()=>{cancelAnimationFrame(Y),Y=requestAnimationFrame(ce)};oe();const pe=new ResizeObserver(oe);return pe.observe(j),pe.observe(q),()=>{cancelAnimationFrame(Y),pe.disconnect()}},[F,D]),g.useLayoutEffect(()=>{const j=O.current;if(!F||!j||!_)return;const q=D>0?D:0,Y=q>0&&y>0?q/y*1e3:0,ce=`${Math.max(0,Y)/1e3}s`;j.style.setProperty("--marquee-distance",`${q}px`),j.style.setProperty("--marquee-duration",ce)},[F,_,y,D]),g.useLayoutEffect(()=>{if(!F){A(0);return}const j=O.current;if(!j)return;const q=()=>{const ce=j.getBoundingClientRect().height;A(ce>0?ce:0)};q();const Y=new ResizeObserver(q);return Y.observe(j),()=>{Y.disconnect()}},[F,U,t,n,d,L,v,f,b,S,T]);const le=()=>{I&&W(!0)},B=()=>{I&&W(!1)},w=g.useMemo(()=>{switch(i){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[i]),K=g.useMemo(()=>{switch(i){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[i]),X=g.useCallback((j,q,Y,ce)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:w,width:"100%"},children:[a.jsx("div",{"data-controls":ce==null?void 0:ce.controlsName,"data-controls-axis":"y",className:`${o}-control`,style:{height:x((ce==null?void 0:ce.marginTop)??0)}}),a.jsx("div",{...ce!=null&&ce.dataMeasureKind?{"data-testimonial-measure":ce.dataMeasureKind}:{},style:{...ze(j,n),textAlign:K,pointerEvents:"auto",...typeof(ce==null?void 0:ce.minHeightPx)=="number"&&ce.minHeightPx>0?{minHeight:ce.minHeightPx}:{}},children:a.jsx(tn,{content:q})})]},Y),[w,K,n]),J=g.useCallback((j,q,Y)=>{var ce,oe,pe;return a.jsxs("div",{style:{padding:`${x(v.top)} ${x(v.right)} ${x(v.bottom)} ${x(v.left)}`,width:x(L+f*2),height:"100%",borderRadius:x(b),border:`${x(f)} solid ${p}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[a.jsx("div",{className:`${o}-cover`,style:{background:m}}),a.jsxs("div",{className:`${o}-elements-overlay`,style:{alignItems:w,textAlign:K},children:[j.text&&X(he,j.text,"text",Y!=null&&Y.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(Y==null?void 0:Y.textMinHeightPx)=="number"&&Y.textMinHeightPx>0?{minHeightPx:Y.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:w,width:"100%"},children:[a.jsx("div",{"data-controls":"logoMarginTop",className:`${o}-control`,style:{height:x(h)}}),a.jsx("div",{style:{width:x(S),height:x(T)},children:((ce=j.logo)==null?void 0:ce.url)&&a.jsx("img",{src:j.logo.url,alt:((oe=j.logo)==null?void 0:oe.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((pe=j.logo)==null?void 0:pe.objectFit)||"contain"}})})]}),j.caption&&X(me,j.caption,"caption",{controlsName:"captionMarginTop",marginTop:z,...Y!=null&&Y.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(Y==null?void 0:Y.captionMinHeightPx)=="number"&&Y.captionMinHeightPx>0?{minHeightPx:Y.captionMinHeightPx}:{}})]})]},q)},[m,z,me,L,b,T,h,S,w,K,v.bottom,v.left,v.right,v.top,X,f,p,he,n]),ie=g.useCallback(j=>{ae(j.maxTextPx),ue(j.maxCaptionPx)},[]);g.useLayoutEffect(()=>{if(!ge){ie({maxTextPx:0,maxCaptionPx:0});return}const j=M.current;if(!j)return;const q=()=>{$.readTestimonialTextMeasure(j,ie)};q();const Y=new ResizeObserver(q);return Y.observe(j),()=>{Y.disconnect()}},[ge,ie,t,J]);const Q=ge?{textMinHeightPx:Z,captionMinHeightPx:ne}:void 0,ee=ge?a.jsx("div",{ref:M,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((j,q)=>J(j,`measure-${q}`,{dataMeasureAttrs:!0}))}):null,se=(j,q)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[J(j,`card-${q}`,Q),n&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${x(d)})`,width:x(d),height:"100%",pointerEvents:"auto",zIndex:2}})]},q);return F&&((t==null?void 0:t.length)??0)>0?a.jsxs("div",{ref:E,className:ve(`${o}-wrapper`,`${o}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...C>0?{height:C}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:io(o)}}),ee,a.jsx("div",{ref:O,className:`${o}-marquee-track`,"data-direction":s,onMouseEnter:le,onMouseLeave:B,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px",...I?{"--marquee-play-state":k?"paused":"running"}:{"--marquee-play-state":"running"}},children:Array.from({length:U},(j,q)=>a.jsx("div",{ref:q===0?P:void 0,className:`${o}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:x(d),paddingRight:x(d)},"aria-hidden":q>0,children:t==null?void 0:t.map((Y,ce)=>se(Y,`${q}-${ce}`))},`set-${q}`))})]}):a.jsxs("div",{className:`${o}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:io(o)}}),ee,a.jsx("div",{style:{gap:x(d),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((j,q)=>se(j,q))})]})},Es=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';\r
1594
1594
  import cn from 'classnames';\r
1595
1595
  import { CommonComponentProps } from '../props';\r
1596
1596
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';\r
@@ -2186,7 +2186,7 @@ type TestimonialsSettings = {\r
2186
2186
  logoHeight: number;\r
2187
2187
  captionMarginTop: number;\r
2188
2188
  };\r
2189
- `,Br={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},pl={type:"object",version:1,settings:{sizing:"auto manual",properties:{autoplay:{type:"string",scope:"common",title:"Autoplay",display:{type:"switch-control"},enum:["on","off"]},speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:.5,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",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 color",display:{type:"palette-color-picker",visible:!0}},bgColor:{title:"BG color",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:100,display:{type:"range-control"}},logoWidth:{type:"number",scope:"layout",title:"width",min:0,max:200,display:{type:"numeric-input"}},logoHeight:{type:"number",scope:"layout",title:"height",min:0,max:200,display:{type:"numeric-input"}},textColor:{type:"string",scope:"common",title:"Text color",display:{type:"palette-color-picker"}},captionColor:{type:"string",scope:"common",title:"Caption color",display:{type:"palette-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:100,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Br.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:{...Br.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:{autoplay:"on",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__","autoplay","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__","autoplay"]},{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:[{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"}]}]}]}},dl={element:cl,id:"testimonials",name:"Eliana",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/testimonials.png"},defaultSize:{width:"100%",height:320},schema:pl,sourceCode:ul,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function ml(e){return`
2189
+ `,ao={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Ps={type:"object",version:1,settings:{sizing:"auto manual",properties:{autoplay:{type:"string",scope:"common",title:"Autoplay",display:{type:"switch-control"},enum:["on","off"]},speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:.5,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",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 color",display:{type:"palette-color-picker",visible:!0}},bgColor:{title:"BG color",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:100,display:{type:"range-control"}},logoWidth:{type:"number",scope:"layout",title:"width",min:0,max:200,display:{type:"numeric-input"}},logoHeight:{type:"number",scope:"layout",title:"height",min:0,max:200,display:{type:"numeric-input"}},textColor:{type:"string",scope:"common",title:"Text color",display:{type:"palette-color-picker"}},captionColor:{type:"string",scope:"common",title:"Caption color",display:{type:"palette-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:100,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...ao.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:{...ao.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:{autoplay:"on",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__","autoplay","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__","autoplay"]},{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:[{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"}]}]}]}},As={element:Ws,id:"testimonials",name:"Eliana",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/testimonials.png"},defaultSize:{width:"100%",height:320},schema:Ps,sourceCode:Es,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function Is(e){return`
2190
2190
  .${e}-container {
2191
2191
  position: relative;
2192
2192
  overflow-x: clip;
@@ -2310,7 +2310,7 @@ type TestimonialsSettings = {\r
2310
2310
  width: 100%;
2311
2311
  height: 100%;
2312
2312
  }
2313
- `}const gl=({settings:e,content:t,isEditor:n,isPreviewMode:r})=>{const{prefix:o}=S.useScopedStyles(),s=t||[],{autoplay:i,delay:l,align:c,width:d,imageMarginTop:u,textMarginTop:T,captionMarginTop:C,imageWidth:h,imageHeight:p,controlsWidth:g,controlsColor:$,controlsHoverColor:v}=e,y=i==="on"&&!r,[E,B]=m.useState(0),[R,_]=m.useState(null),[f,x]=m.useState(!1),L=m.useRef(null),j=m.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),I=m.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);m.useEffect(()=>{B(0),_(null),x(!1)},[s.length]);const P=s[E],H=R===null?null:s[R],z=q=>{var O,w,G,Y,J;return{fontSettings:{fontFamily:(e==null?void 0:e[`${q}FontFamily`])??"Arial",fontWeight:((O=e==null?void 0:e[`${q}FontSettings`])==null?void 0:O.fontWeight)??400,fontStyle:((w=e==null?void 0:e[`${q}FontSettings`])==null?void 0:w.fontStyle)??"normal"},textAppearance:{textTransform:((G=e==null?void 0:e[`${q}TextAppearance`])==null?void 0:G.textTransform)??"none",textDecoration:((Y=e==null?void 0:e[`${q}TextAppearance`])==null?void 0:Y.textDecoration)??"none",fontVariant:((J=e==null?void 0:e[`${q}TextAppearance`])==null?void 0:J.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${q}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${q}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${q}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${q}WordSpacing`])??0,color:(e==null?void 0:e[`${q}Color`])??"#000000"}},D=z("text"),b=z("caption"),k=s.length>1&&s.some(q=>{var ie,O;return(((ie=q.text)==null?void 0:ie.length)??0)>0||(((O=q.caption)==null?void 0:O.length)??0)>0}),F=m.useRef(null),[W,A]=m.useState(0),[N,Z]=m.useState(0),le=e.controls??{mode:"Off",icon:null},ne=s.length>1,de=m.useCallback((q,ie)=>!ne||ie===q?q:(L.current&&window.clearTimeout(L.current),_(q),x(!0),L.current=window.setTimeout(()=>{_(null),x(!1),L.current=null},300),ie),[ne]),M=m.useCallback(()=>{ne&&B(q=>de(q,(q-1+s.length)%s.length))},[ne,de,s.length]),te=m.useCallback(()=>{ne&&B(q=>de(q,(q+1)%s.length))},[ne,de,s.length]);m.useEffect(()=>{if(!y||!ne)return;const q=Math.max(300,Number.isFinite(l*1e3)?l*1e3:0),ie=window.setInterval(()=>{B(O=>de(O,(O+1)%s.length))},q);return()=>{window.clearInterval(ie)}},[y,ne,de,s.length,l]),m.useEffect(()=>()=>{L.current&&window.clearTimeout(L.current)},[]);const fe=(q,ie)=>{var Y,J,ae,oe;const O=ie==null?void 0:ie.textMinHeightPx,w=ie==null?void 0:ie.captionMinHeightPx,G=ie==null?void 0:ie.dataMeasureAttrs;return a.jsxs(a.Fragment,{children:[q.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:j,width:"100%"},children:[a.jsx("div",{"data-controls":"textMarginTop",className:`${o}-control`,style:{height:S.scalingValue(T??0,n??!1)}}),a.jsx("div",{...G&&{"data-testimonial-measure":"text"},style:{...Be(D,n),...O&&O>0?{minHeight:O}:{},textAlign:I,pointerEvents:"auto"},children:a.jsx(Ut,{content:q.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:j,width:"100%"},children:[a.jsx("div",{"data-controls":"imageMarginTop",className:`${o}-control`,style:{height:S.scalingValue(u??0,n??!1)}}),a.jsx("div",{style:{width:S.scalingValue(h??0,n??!1),height:S.scalingValue(p??0,n??!1)},children:((Y=q.image)==null?void 0:Y.url)&&a.jsx("img",{src:(J=q.image)==null?void 0:J.url,alt:((ae=q.image)==null?void 0:ae.name)??"",className:`${o}-icon`,style:{objectFit:((oe=q.image)==null?void 0:oe.objectFit)||"contain"}})})]}),q.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:j,width:"100%"},children:[a.jsx("div",{"data-controls":"captionMarginTop",className:`${o}-control`,style:{height:S.scalingValue(C??0,n??!1)}}),a.jsx("div",{...G?{"data-testimonial-measure":"caption"}:{},style:{...Be(b,n),...w&&w>0?{minHeight:w}:{},textAlign:I,pointerEvents:"auto"},children:a.jsx(Ut,{content:q.caption})})]})]})},me=m.useCallback(q=>{A(q.maxTextPx),Z(q.maxCaptionPx)},[]);if(m.useLayoutEffect(()=>{if(!k){me({maxTextPx:0,maxCaptionPx:0});return}const q=F.current;if(!q)return;const ie=()=>{S.readTestimonialTextMeasure(q,me)};ie();const O=new ResizeObserver(ie);return O.observe(q),()=>{O.disconnect()}},[k,me,t]),!P)return a.jsx(a.Fragment,{});const ge=k?{textMinHeightPx:W,captionMinHeightPx:N}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${o}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ml(o)}}),a.jsxs("div",{className:`${o}-wrapper`,style:{width:S.scalingValue(d??0,n??!1),alignItems:j},children:[k&&a.jsx("div",{ref:F,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:s.map((q,ie)=>a.jsx("div",{style:{width:"100%"},children:fe(q,{dataMeasureAttrs:!0})},ie))}),a.jsxs("div",{className:`${o}-fade-stack`,children:[H&&f&&a.jsx("div",{className:ye(`${o}-fade-item-prev`,`${o}-fade-out`),children:fe(H,ge)}),a.jsx("div",{className:ye(`${o}-fade-item-current`,f?`${o}-fade-in`:void 0),children:fe(P,ge)})]})]}),le.mode==="On"&&a.jsxs("div",{className:`${o}-controls`,children:[a.jsx("div",{className:`${o}-arrow`,style:{width:S.scalingValue(g??.02,n??!1),height:S.scalingValue(g??.02,n??!1),"--arrow-hover-color":v},children:a.jsx("button",{type:"button",className:`${o}-arrow-inner`,onClick:M,disabled:!ne,"aria-label":"Previous testimonial",children:le.icon&&a.jsx(pt,{url:le.icon,fill:$,hoverFill:v,className:ye(`${o}-arrow-img`,`${o}-mirror`)})})}),a.jsx("div",{className:ye(`${o}-arrow`,`${o}-next-arrow`),style:{width:S.scalingValue(g??.02,n??!1),height:S.scalingValue(g??.02,n??!1),"--arrow-hover-color":v},children:a.jsx("button",{type:"button",className:`${o}-arrow-inner`,onClick:te,disabled:!ne,"aria-label":"Next testimonial",children:le.icon&&a.jsx(pt,{url:le.icon,fill:$,hoverFill:v,className:`${o}-arrow-img`})})})]})]})})},hl=`import cn from 'classnames';\r
2313
+ `}const Rs=({settings:e,content:t,isEditor:n,isPreviewMode:r})=>{const{prefix:o}=$.useScopedStyles(),l=t||[],{autoplay:i,delay:c,align:s,width:u,imageMarginTop:d,textMarginTop:L,captionMarginTop:b,imageWidth:f,imageHeight:p,controlsWidth:m,controlsColor:v,controlsHoverColor:h}=e,S=i==="on"&&!r,[T,z]=g.useState(0),[F,_]=g.useState(null),[y,x]=g.useState(!1),E=g.useRef(null),O=g.useMemo(()=>{switch(s){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[s]),P=g.useMemo(()=>{switch(s){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[s]);g.useEffect(()=>{z(0),_(null),x(!1)},[l.length]);const H=l[T],N=F===null?null:l[F],D=U=>{var B,w,K,X,J;return{fontSettings:{fontFamily:(e==null?void 0:e[`${U}FontFamily`])??"Arial",fontWeight:((B=e==null?void 0:e[`${U}FontSettings`])==null?void 0:B.fontWeight)??400,fontStyle:((w=e==null?void 0:e[`${U}FontSettings`])==null?void 0:w.fontStyle)??"normal"},textAppearance:{textTransform:((K=e==null?void 0:e[`${U}TextAppearance`])==null?void 0:K.textTransform)??"none",textDecoration:((X=e==null?void 0:e[`${U}TextAppearance`])==null?void 0:X.textDecoration)??"none",fontVariant:((J=e==null?void 0:e[`${U}TextAppearance`])==null?void 0:J.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${U}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${U}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${U}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${U}WordSpacing`])??0,color:(e==null?void 0:e[`${U}Color`])??"#000000"}},V=D("text"),C=D("caption"),A=l.length>1&&l.some(U=>{var le,B;return(((le=U.text)==null?void 0:le.length)??0)>0||(((B=U.caption)==null?void 0:B.length)??0)>0}),I=g.useRef(null),[k,W]=g.useState(0),[M,Z]=g.useState(0),ae=e.controls??{mode:"Off",icon:null},ne=l.length>1,ue=g.useCallback((U,le)=>!ne||le===U?U:(E.current&&window.clearTimeout(E.current),_(U),x(!0),E.current=window.setTimeout(()=>{_(null),x(!1),E.current=null},300),le),[ne]),R=g.useCallback(()=>{ne&&z(U=>ue(U,(U-1+l.length)%l.length))},[ne,ue,l.length]),re=g.useCallback(()=>{ne&&z(U=>ue(U,(U+1)%l.length))},[ne,ue,l.length]);g.useEffect(()=>{if(!S||!ne)return;const U=Math.max(300,Number.isFinite(c*1e3)?c*1e3:0),le=window.setInterval(()=>{z(B=>ue(B,(B+1)%l.length))},U);return()=>{window.clearInterval(le)}},[S,ne,ue,l.length,c]),g.useEffect(()=>()=>{E.current&&window.clearTimeout(E.current)},[]);const he=(U,le)=>{var X,J,ie,Q;const B=le==null?void 0:le.textMinHeightPx,w=le==null?void 0:le.captionMinHeightPx,K=le==null?void 0:le.dataMeasureAttrs;return a.jsxs(a.Fragment,{children:[U.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:O,width:"100%"},children:[a.jsx("div",{"data-controls":"textMarginTop",className:`${o}-control`,style:{height:$.scalingValue(L??0,n??!1)}}),a.jsx("div",{...K&&{"data-testimonial-measure":"text"},style:{...ze(V,n),...B&&B>0?{minHeight:B}:{},textAlign:P,pointerEvents:"auto"},children:a.jsx(tn,{content:U.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:O,width:"100%"},children:[a.jsx("div",{"data-controls":"imageMarginTop",className:`${o}-control`,style:{height:$.scalingValue(d??0,n??!1)}}),a.jsx("div",{style:{width:$.scalingValue(f??0,n??!1),height:$.scalingValue(p??0,n??!1)},children:((X=U.image)==null?void 0:X.url)&&a.jsx("img",{src:(J=U.image)==null?void 0:J.url,alt:((ie=U.image)==null?void 0:ie.name)??"",className:`${o}-icon`,style:{objectFit:((Q=U.image)==null?void 0:Q.objectFit)||"contain"}})})]}),U.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:O,width:"100%"},children:[a.jsx("div",{"data-controls":"captionMarginTop",className:`${o}-control`,style:{height:$.scalingValue(b??0,n??!1)}}),a.jsx("div",{...K?{"data-testimonial-measure":"caption"}:{},style:{...ze(C,n),...w&&w>0?{minHeight:w}:{},textAlign:P,pointerEvents:"auto"},children:a.jsx(tn,{content:U.caption})})]})]})},me=g.useCallback(U=>{W(U.maxTextPx),Z(U.maxCaptionPx)},[]);if(g.useLayoutEffect(()=>{if(!A){me({maxTextPx:0,maxCaptionPx:0});return}const U=I.current;if(!U)return;const le=()=>{$.readTestimonialTextMeasure(U,me)};le();const B=new ResizeObserver(le);return B.observe(U),()=>{B.disconnect()}},[A,me,t]),!H)return a.jsx(a.Fragment,{});const ge=A?{textMinHeightPx:k,captionMinHeightPx:M}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${o}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Is(o)}}),a.jsxs("div",{className:`${o}-wrapper`,style:{width:$.scalingValue(u??0,n??!1),alignItems:O},children:[A&&a.jsx("div",{ref:I,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((U,le)=>a.jsx("div",{style:{width:"100%"},children:he(U,{dataMeasureAttrs:!0})},le))}),a.jsxs("div",{className:`${o}-fade-stack`,children:[N&&y&&a.jsx("div",{className:ve(`${o}-fade-item-prev`,`${o}-fade-out`),children:he(N,ge)}),a.jsx("div",{className:ve(`${o}-fade-item-current`,y?`${o}-fade-in`:void 0),children:he(H,ge)})]})]}),ae.mode==="On"&&a.jsxs("div",{className:`${o}-controls`,children:[a.jsx("div",{className:`${o}-arrow`,style:{width:$.scalingValue(m??.02,n??!1),height:$.scalingValue(m??.02,n??!1),"--arrow-hover-color":h},children:a.jsx("button",{type:"button",className:`${o}-arrow-inner`,onClick:R,disabled:!ne,"aria-label":"Previous testimonial",children:ae.icon&&a.jsx(yt,{url:ae.icon,fill:v,hoverFill:h,className:ve(`${o}-arrow-img`,`${o}-mirror`)})})}),a.jsx("div",{className:ve(`${o}-arrow`,`${o}-next-arrow`),style:{width:$.scalingValue(m??.02,n??!1),height:$.scalingValue(m??.02,n??!1),"--arrow-hover-color":h},children:a.jsx("button",{type:"button",className:`${o}-arrow-inner`,onClick:re,disabled:!ne,"aria-label":"Next testimonial",children:ae.icon&&a.jsx(yt,{url:ae.icon,fill:v,hoverFill:h,className:`${o}-arrow-img`})})})]})]})})},ks=`import cn from 'classnames';\r
2314
2314
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\r
2315
2315
  import { CommonComponentProps } from '../props';\r
2316
2316
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';\r
@@ -2802,11 +2802,11 @@ type TestimonialsSettings = {\r
2802
2802
  icon?: string | null;\r
2803
2803
  };\r
2804
2804
  };\r
2805
- `,fl="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>'),Vr={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},yl={type:"object",version:1,settings:{sizing:"auto manual",properties:{autoplay:{type:"string",scope:"common",title:"Autoplay",display:{type:"switch-control"},enum:["on","off"]},delay:{type:"number",scope:"layout",title:"Delay(s)",display:{type:"percentage-input"},step:1,min:1,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:100,display:{type:"range-control"}},textMarginTop:{type:"number",scope:"layout",title:"Text margin top",min:0,max:100,display:{type:"range-control"}},controls:{type:"object",scope:"common",title:"Controls",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},controlsWidth:{type:"number",scope:"layout",title:"Controls width",min:0,max:100,display:{type:"numeric-input"}},controlsColor:{type:"string",scope:"common",title:"Controls Color",display:{type:"settings-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"settings-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:100,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Vr.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},captionColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Caption Color"},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Vr.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Text Color"}},defaults:{autoplay:"on",controls:{mode:"On",icon:fl},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:"Charter",captionFontSettings:{fontWeight:400,fontStyle:"normal"},captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},captionColor:"#000000"},layoutDefaults:{m:{delay:3,width:.69,imageMarginTop:.08,captionMarginTop:.04,textMarginTop:0,textFontSize:.069,captionFontSize:.053,textLineHeight:.093,captionLineHeight:.069,imageWidth:.21,imageHeight:.21,controlsWidth:.06},d:{delay:3,width:.35,imageMarginTop:.02,textMarginTop:0,captionMarginTop:.01,textFontSize:.016,captionFontSize:.009,textLineHeight:.018,captionLineHeight:.009,imageWidth:.027,imageHeight:.027,controlsWidth:.014}},displayRules:[{if:{name:"autoplay",value:"off"},then:{name:"properties.delay.display.enabled",value:!1}}],layout:["__componentName__","autoplay","delay","width","imageMarginTop","textMarginTop","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","autoplay"]},{type:"row",items:["width","align"]},{type:"row",items:["controls"]},{type:"row",items:["controlsWidth","delay"]},{type:"row",title:"Image Container",items:["imageWidth","imageHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{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"}]}]}]}},vl={element:gl,id:"testimonial-single",name:"Clara",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/testimonialsSingle.png"},defaultSize:{width:700,height:300},schema:yl,sourceCode:hl,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function bl(){return window.navigator.platform==="Win32"||window.navigator.platform==="Win64"?'"InputMono-Regular", monospace':'"DepartureMono-Regular", monospace'}function xl(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Sl(e){return`
2805
+ `,Fs="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>'),lo={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Ms={type:"object",version:1,settings:{sizing:"auto manual",properties:{autoplay:{type:"string",scope:"common",title:"Autoplay",display:{type:"switch-control"},enum:["on","off"]},delay:{type:"number",scope:"layout",title:"Delay(s)",display:{type:"percentage-input"},step:1,min:1,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:100,display:{type:"range-control"}},textMarginTop:{type:"number",scope:"layout",title:"Text margin top",min:0,max:100,display:{type:"range-control"}},controls:{type:"object",scope:"common",title:"Controls",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},controlsWidth:{type:"number",scope:"layout",title:"Controls width",min:0,max:100,display:{type:"numeric-input"}},controlsColor:{type:"string",scope:"common",title:"Controls Color",display:{type:"settings-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"settings-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:100,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...lo.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},captionColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Caption Color"},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...lo.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Text Color"}},defaults:{autoplay:"on",controls:{mode:"On",icon:Fs},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:"Charter",captionFontSettings:{fontWeight:400,fontStyle:"normal"},captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},captionColor:"#000000"},layoutDefaults:{m:{delay:3,width:.69,imageMarginTop:.08,captionMarginTop:.04,textMarginTop:0,textFontSize:.069,captionFontSize:.053,textLineHeight:.093,captionLineHeight:.069,imageWidth:.21,imageHeight:.21,controlsWidth:.06},d:{delay:3,width:.35,imageMarginTop:.02,textMarginTop:0,captionMarginTop:.01,textFontSize:.016,captionFontSize:.009,textLineHeight:.018,captionLineHeight:.009,imageWidth:.027,imageHeight:.027,controlsWidth:.014}},displayRules:[{if:{name:"autoplay",value:"off"},then:{name:"properties.delay.display.enabled",value:!1}}],layout:["__componentName__","autoplay","delay","width","imageMarginTop","textMarginTop","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","autoplay"]},{type:"row",items:["width","align"]},{type:"row",items:["controls"]},{type:"row",items:["controlsWidth","delay"]},{type:"row",title:"Image Container",items:["imageWidth","imageHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{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"}]}]}]}},Hs={element:Rs,id:"testimonial-single",name:"Clara",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/testimonialsSingle.png"},defaultSize:{width:700,height:300},schema:Ms,sourceCode:ks,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function Ns(){return window.navigator.platform==="Win32"||window.navigator.platform==="Win64"?'"InputMono-Regular", monospace':'"DepartureMono-Regular", monospace'}function Os(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Bs(e){return`
2806
2806
  .${e}-wrapper {
2807
2807
  display: grid;
2808
2808
  align-items: start;
2809
- min-height: ${xl(48)};
2809
+ min-height: ${Os(48)};
2810
2810
  }
2811
2811
  .${e}-item {
2812
2812
  display: flex;
@@ -2890,7 +2890,7 @@ type TestimonialsSettings = {\r
2890
2890
  pointer-events: auto;
2891
2891
  z-index: 10;
2892
2892
  }
2893
- `}const ct=500,vt="cubic-bezier(0.22, 1, 0.36, 1)";function Cl({images:e,index:t,imageDisplay:n,originRect:r,reverseClose:o,onClose:s,onPrev:i,onNext:l}){const c=m.useRef(null),d=m.useRef(null),[u,T]=m.useState(null),[C,h]=m.useState(r?"opening":"open"),[p,g]=m.useState(!0),$=m.useRef(t),v=m.useCallback(()=>{const f=c.current,x=d.current;if(!f||!x)return;const L=f.getBoundingClientRect(),j=L.width,I=L.height,P=x.naturalWidth,H=x.naturalHeight;if(!j||!I||!P||!H)return;if(n==="Cover"){T({width:j,height:I,left:L.left,top:L.top});return}const z=P/H,D=j/I;if(z>D){const b=j/z;T({width:j,height:b,left:L.left,top:L.top+(I-b)/2})}else{const b=I*z;T({width:b,height:I,left:L.left+(j-b)/2,top:L.top})}},[n]);m.useEffect(()=>{v();const f=c.current;if(!f)return;const x=new ResizeObserver(()=>v());return x.observe(f),()=>x.disconnect()},[v,t]),m.useEffect(()=>{if(C!=="opening"||!u)return;const f={id:0};return f.id=requestAnimationFrame(()=>{f.id=requestAnimationFrame(()=>h("open"))}),()=>cancelAnimationFrame(f.id)},[C,u]),m.useEffect(()=>{if(C!=="closing")return;const f=setTimeout(()=>s(),ct);return()=>clearTimeout(f)},[C,s]),m.useEffect(()=>{$.current!==t&&g(!1),$.current=t},[t]);const y=()=>{C!=="closing"&&h("closing")},E=C==="open",B=C==="closing",R=B&&o&&!!r,_=C==="opening"?r??u:R?r:u;return a.jsxs("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:9997},onClick:y,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:E?1:0,transition:`opacity ${ct}ms ${vt}`,pointerEvents:"none"}}),a.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:c,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",color:"#E6E6E6",letterSpacing:"-0.6px",lineHeight:"16px",opacity:E?1:0,transition:`opacity ${ct}ms ${vt}`,fontFamily:bl()},children:e.length>1&&a.jsxs(a.Fragment,{children:[a.jsx("p",{children:t+1}),a.jsx("p",{children:"/"}),a.jsx("p",{children:e.length})]})})]}),_&&a.jsx("img",{ref:d,src:e[t],onLoad:v,style:{position:"fixed",top:_.top,left:_.left,width:_.width,height:_.height,objectFit:n==="Cover"?"cover":"contain",opacity:B&&!R?0:1,transition:B&&!R?`opacity ${ct}ms ${vt}`:R||p?`top ${ct}ms ${vt}, left ${ct}ms ${vt}, width ${ct}ms ${vt}, height ${ct}ms ${vt}`:"none",pointerEvents:"none",zIndex:9998}}),E&&u&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{position:"fixed",top:u.top,left:u.left,width:u.width/2,height:u.height,cursor:"w-resize",zIndex:9999},onClick:f=>{f.stopPropagation(),i()}}),a.jsx("div",{style:{position:"fixed",top:u.top,left:u.left+u.width/2,width:u.width/2,height:u.height,cursor:"e-resize",zIndex:9999},onClick:f=>{f.stopPropagation(),l()}})]})]})}function wl({settings:e,content:t,isEditor:n,isPreviewMode:r,metadata:o,activeEvent:s,layoutId:i}){const{prefix:l}=S.useScopedStyles(),{type:c="A",gridLayout:d,textBoxWidth:u,verticalGap:T,entriesCount:C,lightbox:h,imageDisplay:p,slider:g,sliderTiming:$,direction:v,transition:y,titleMarginTop:E,subtitleMarginTop:B,titleColor:R,subtitleColor:_,titleFontFamily:f,titleFontSettings:x,titleFontSize:L,titleLineHeight:j,titleLetterSpacing:I,titleWordSpacing:P,titleTextAppearance:H,subtitleFontFamily:z,subtitleFontSettings:D,subtitleFontSize:b,subtitleLineHeight:k,subtitleLetterSpacing:F,subtitleWordSpacing:W,subtitleTextAppearance:A}=e,N={fontSettings:{fontFamily:f,fontWeight:(x==null?void 0:x.fontWeight)??400,fontStyle:(x==null?void 0:x.fontStyle)??"normal"},fontSize:L??.01,lineHeight:j,letterSpacing:I??0,wordSpacing:P??0,textAppearance:H,color:R},le={...it(Be(N,n))},ne={fontSettings:{fontFamily:z,fontWeight:(D==null?void 0:D.fontWeight)??400,fontStyle:(D==null?void 0:D.fontStyle)??"normal"},fontSize:b??.01,lineHeight:k,letterSpacing:F??0,wordSpacing:W??0,textAppearance:A,color:_},M={...it(Be(ne,n))},te=S.buildColorVars(l,{titleColor:R,subtitleColor:_},$l,Tl),me=`${s&&s!=="default"?`${l}-state-${s}`:""}`.trim(),ge=C===0?1/0:C,q=(t??[]).slice(0,ge),ie=d.entryWidth??.2,O=(p==null?void 0:p.display)==="Cover",w=(p==null?void 0:p.ratioValue)??"1:1",G=(p==null?void 0:p.reversed)??!1,[Y,J]=w.split(":").map(Number),ae=G?J:Y,oe=G?Y:J,re=`${ae} / ${oe}`,ce=ae>=oe,V={objectFit:O?"cover":"contain",...O&&{aspectRatio:re,width:ce?"100%":"auto",height:ce?"auto":"100%"}},[X,K]=m.useState("ltr"),[se,Q]=m.useState(0),ue=m.useRef(null);m.useEffect(()=>{const be=ue.current;if(!be)return;const He=new ResizeObserver(_e=>{Q(Math.round(_e[0].contentRect.width))});return He.observe(be),()=>He.disconnect()},[]);const[Se,Te]=m.useState(!1),[Re,Pe]=m.useState([]),[ve,Ee]=m.useState(0),[Ie,Ce]=m.useState(null),Me=(be,He,_e)=>{if(h==="Off")return;const ke=be.currentTarget.getBoundingClientRect();Ce({top:ke.top,left:ke.left,width:ke.width,height:ke.height}),Pe(He),Ee(_e),Te(!0)};return m.useEffect(()=>{if(!Se||h!=="On"||typeof document>"u")return;const be=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=be}},[Se,h]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Sl(l)}}),a.jsx("div",{style:te,children:a.jsx("div",{ref:ue,className:`${l}-wrapper ${l}-type-${c} ${me}`.trim(),style:{gridTemplateColumns:`repeat(${d.columnsCount}, minmax(0, 1fr))`,rowGap:S.scalingValue(T??0,n),columnGap:S.scalingValue(d.horizontalGap??0,n),width:S.scalingValue(d.wrapperWidth??0,n)},children:q.map((be,He)=>{var _e,ke;return a.jsx("div",{className:`${l}-item`.trim(),children:a.jsx("div",{className:r?`${l}-item-inner`:`${l}-item-inner-hidden`,style:{width:(u??0)>100?`calc(${S.scalingValue(ie??0,n)} * (${u} / 100))`:S.scalingValue(ie??0,n)},children:a.jsxs("a",{href:(((_e=be.link)==null?void 0:_e.length)??0)>0&&h==="Off"?be.link:void 0,target:"_blank",className:`${l}-item-image-link`,children:[a.jsx("div",{className:`${l}-item-image-wrapper`,style:{width:S.scalingValue(ie??0,n),height:S.scalingValue(ie??0,n)},children:(((ke=be.image)==null?void 0:ke.length)??0)===0?null:g==="Off"?a.jsx("img",{src:be.image[0].url,alt:be.image[0].name,className:`${l}-item-image`.trim(),style:V,onClick:ze=>Me(ze,be.image.map(Xe=>Xe.url),0)}):a.jsx(vr,{className:`${l}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:$*1e3,width:"100%",height:"100%",speed:500,type:y==="Fade"?"fade":"loop",rewind:y==="Fade",pauseOnHover:!1,pauseOnFocus:!1,direction:y==="Fade"?"ltr":v!=="Random"?v==="Horizontal"?"ltr":"ttb":X},onMoved:ze=>{if(v!=="Random"||y==="Fade")return;const Xe=Math.random()>.5?Math.random()>.5?"rtl":"ltr":Math.random()>.5?"btt":"ttb";K(Xe),setTimeout(()=>{ze.refresh()},0)},children:be.image.map((ze,Xe)=>a.jsx(br,{children:a.jsx("img",{src:ze.url,alt:ze.name,className:`${l}-item-image`.trim(),style:V,onClick:lt=>Me(lt,be.image.map(et=>et.url),Xe)})},Xe))},`${y}-${ie}-${v}-${$}-${se}-${i}`)}),a.jsx("div",{"data-controls":"titleMarginTop",className:`${l}-control`,style:{height:S.scalingValue(E??0,n),width:S.scalingValue(ie*u/100,n)}}),a.jsx("p",{className:`${l}-item-title`.trim(),style:{width:`calc(${S.scalingValue(ie??0,n)} * (${u} / 100))`,...le},children:be.title}),c==="B"&&a.jsx("div",{"data-controls":"subtitleMarginTop",className:`${l}-control`,style:{height:S.scalingValue(B??0,n),width:S.scalingValue(ie*u/100,n)}}),c==="B"&&a.jsx("p",{className:`${l}-item-subtitle`.trim(),style:{width:`calc(${S.scalingValue(ie??0,n)} * (${u} / 100))`,...M},children:be.subtitle})]})})},He)})})}),Se&&typeof document&&document.getElementById("grid-component-lightbox-portal")&&h==="On"&&Yr.createPortal(a.jsx("div",{"data-selection":"none",children:a.jsx(Cl,{images:Re,index:ve,imageDisplay:p.display,originRect:Ie,reverseClose:g==="Off",onClose:()=>Te(!1),onPrev:()=>Ee(be=>(be-1+Re.length)%Re.length),onNext:()=>Ee(be=>(be+1)%Re.length)})}),document.body)]})}const $l={titleColor:"title-color",subtitleColor:"subtitle-color"},Tl=["hover","focus","filled","success","error"],_l=`import { Splide, SplideSlide } from '@splidejs/react-splide';\r
2893
+ `}const ht=500,wt="cubic-bezier(0.22, 1, 0.36, 1)";function Ds({images:e,index:t,imageDisplay:n,originRect:r,reverseClose:o,onClose:l,onPrev:i,onNext:c}){const s=g.useRef(null),u=g.useRef(null),[d,L]=g.useState(null),[b,f]=g.useState(r?"opening":"open"),[p,m]=g.useState(!0),v=g.useRef(t),h=g.useCallback(()=>{const y=s.current,x=u.current;if(!y||!x)return;const E=y.getBoundingClientRect(),O=E.width,P=E.height,H=x.naturalWidth,N=x.naturalHeight;if(!O||!P||!H||!N)return;if(n==="Cover"){L({width:O,height:P,left:E.left,top:E.top});return}const D=H/N,V=O/P;if(D>V){const C=O/D;L({width:O,height:C,left:E.left,top:E.top+(P-C)/2})}else{const C=P*D;L({width:C,height:P,left:E.left+(O-C)/2,top:E.top})}},[n]);g.useEffect(()=>{h();const y=s.current;if(!y)return;const x=new ResizeObserver(()=>h());return x.observe(y),()=>x.disconnect()},[h,t]),g.useEffect(()=>{if(b!=="opening"||!d)return;const y={id:0};return y.id=requestAnimationFrame(()=>{y.id=requestAnimationFrame(()=>f("open"))}),()=>cancelAnimationFrame(y.id)},[b,d]),g.useEffect(()=>{if(b!=="closing")return;const y=setTimeout(()=>l(),ht);return()=>clearTimeout(y)},[b,l]),g.useEffect(()=>{v.current!==t&&m(!1),v.current=t},[t]);const S=()=>{b!=="closing"&&f("closing")},T=b==="open",z=b==="closing",F=z&&o&&!!r,_=b==="opening"?r??d:F?r:d;return a.jsxs("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:9997},onClick:S,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:T?1:0,transition:`opacity ${ht}ms ${wt}`,pointerEvents:"none"}}),a.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:s,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",color:"#E6E6E6",letterSpacing:"-0.6px",lineHeight:"16px",opacity:T?1:0,transition:`opacity ${ht}ms ${wt}`,fontFamily:Ns()},children:e.length>1&&a.jsxs(a.Fragment,{children:[a.jsx("p",{children:t+1}),a.jsx("p",{children:"/"}),a.jsx("p",{children:e.length})]})})]}),_&&a.jsx("img",{ref:u,src:e[t],onLoad:h,style:{position:"fixed",top:_.top,left:_.left,width:_.width,height:_.height,objectFit:n==="Cover"?"cover":"contain",opacity:z&&!F?0:1,transition:z&&!F?`opacity ${ht}ms ${wt}`:F||p?`top ${ht}ms ${wt}, left ${ht}ms ${wt}, width ${ht}ms ${wt}, height ${ht}ms ${wt}`:"none",pointerEvents:"none",zIndex:9998}}),T&&d&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{position:"fixed",top:d.top,left:d.left,width:d.width/2,height:d.height,cursor:"w-resize",zIndex:9999},onClick:y=>{y.stopPropagation(),i()}}),a.jsx("div",{style:{position:"fixed",top:d.top,left:d.left+d.width/2,width:d.width/2,height:d.height,cursor:"e-resize",zIndex:9999},onClick:y=>{y.stopPropagation(),c()}})]})]})}function js({settings:e,content:t,isEditor:n,isPreviewMode:r,metadata:o,activeEvent:l,layoutId:i}){const{prefix:c}=$.useScopedStyles(),{type:s="A",gridLayout:u,textBoxWidth:d,verticalGap:L,entriesCount:b,lightbox:f,imageDisplay:p,slider:m,sliderTiming:v,direction:h,transition:S,titleMarginTop:T,subtitleMarginTop:z,titleColor:F,subtitleColor:_,titleFontFamily:y,titleFontSettings:x,titleFontSize:E,titleLineHeight:O,titleLetterSpacing:P,titleWordSpacing:H,titleTextAppearance:N,subtitleFontFamily:D,subtitleFontSettings:V,subtitleFontSize:C,subtitleLineHeight:A,subtitleLetterSpacing:I,subtitleWordSpacing:k,subtitleTextAppearance:W}=e,M={fontSettings:{fontFamily:y,fontWeight:(x==null?void 0:x.fontWeight)??400,fontStyle:(x==null?void 0:x.fontStyle)??"normal"},fontSize:E??.01,lineHeight:O,letterSpacing:P??0,wordSpacing:H??0,textAppearance:N,color:F},ae={...ut(ze(M,n))},ne={fontSettings:{fontFamily:D,fontWeight:(V==null?void 0:V.fontWeight)??400,fontStyle:(V==null?void 0:V.fontStyle)??"normal"},fontSize:C??.01,lineHeight:A,letterSpacing:I??0,wordSpacing:k??0,textAppearance:W,color:_},R={...ut(ze(ne,n))},re=$.buildColorVars(c,{titleColor:F,subtitleColor:_},zs,Vs),me=`${l&&l!=="default"?`${c}-state-${l}`:""}`.trim(),ge=b===0?1/0:b,U=(t??[]).slice(0,ge),le=u.entryWidth??.2,B=(p==null?void 0:p.display)==="Cover",w=(p==null?void 0:p.ratioValue)??"1:1",K=(p==null?void 0:p.reversed)??!1,[X,J]=w.split(":").map(Number),ie=K?J:X,Q=K?X:J,ee=`${ie} / ${Q}`,se=ie>=Q,j={objectFit:B?"cover":"contain",...B&&{aspectRatio:ee,width:se?"100%":"auto",height:se?"auto":"100%"}},[q,Y]=g.useState("ltr"),[ce,oe]=g.useState(0),pe=g.useRef(null);g.useEffect(()=>{const Ce=pe.current;if(!Ce)return;const Ie=new ResizeObserver(We=>{oe(Math.round(We[0].contentRect.width))});return Ie.observe(Ce),()=>Ie.disconnect()},[]);const[we,Le]=g.useState(!1),[Oe,Xe]=g.useState([]),[be,Ae]=g.useState(0),[Be,xe]=g.useState(null),Fe=(Ce,Ie,We)=>{if(f==="Off")return;const Ee=Ce.currentTarget.getBoundingClientRect();xe({top:Ee.top,left:Ee.left,width:Ee.width,height:Ee.height}),Xe(Ie),Ae(We),Le(!0)};return g.useEffect(()=>{if(!we||f!=="On"||typeof document>"u")return;const Ce=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Ce}},[we,f]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Bs(c)}}),a.jsx("div",{style:re,children:a.jsx("div",{ref:pe,className:`${c}-wrapper ${c}-type-${s} ${me}`.trim(),style:{gridTemplateColumns:`repeat(${u.columnsCount}, minmax(0, 1fr))`,rowGap:$.scalingValue(L??0,n),columnGap:$.scalingValue(u.horizontalGap??0,n),width:$.scalingValue(u.wrapperWidth??0,n)},children:U.map((Ce,Ie)=>{var We,Ee;return a.jsx("div",{className:`${c}-item`.trim(),children:a.jsx("div",{className:r?`${c}-item-inner`:`${c}-item-inner-hidden`,style:{width:(d??0)>100?`calc(${$.scalingValue(le??0,n)} * (${d} / 100))`:$.scalingValue(le??0,n)},children:a.jsxs("a",{href:(((We=Ce.link)==null?void 0:We.length)??0)>0&&f==="Off"?Ce.link:void 0,target:"_blank",className:`${c}-item-image-link`,children:[a.jsx("div",{className:`${c}-item-image-wrapper`,style:{width:$.scalingValue(le??0,n),height:$.scalingValue(le??0,n)},children:(((Ee=Ce.image)==null?void 0:Ee.length)??0)===0?null:m==="Off"?a.jsx("img",{src:Ce.image[0].url,alt:Ce.image[0].name,className:`${c}-item-image`.trim(),style:j,onClick:Ve=>Fe(Ve,Ce.image.map(Ze=>Ze.url),0)}):a.jsx(kr,{className:`${c}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:v*1e3,width:"100%",height:"100%",speed:500,type:S==="Fade"?"fade":"loop",rewind:S==="Fade",pauseOnHover:!1,pauseOnFocus:!1,direction:S==="Fade"?"ltr":h!=="Random"?h==="Horizontal"?"ltr":"ttb":q},onMoved:Ve=>{if(h!=="Random"||S==="Fade")return;const Ze=Math.random()>.5?Math.random()>.5?"rtl":"ltr":Math.random()>.5?"btt":"ttb";Y(Ze),setTimeout(()=>{Ve.refresh()},0)},children:Ce.image.map((Ve,Ze)=>a.jsx(Fr,{children:a.jsx("img",{src:Ve.url,alt:Ve.name,className:`${c}-item-image`.trim(),style:j,onClick:Me=>Fe(Me,Ce.image.map(He=>He.url),Ze)})},Ze))},`${S}-${le}-${h}-${v}-${ce}-${i}`)}),a.jsx("div",{"data-controls":"titleMarginTop",className:`${c}-control`,style:{height:$.scalingValue(T??0,n),width:$.scalingValue(le*d/100,n)}}),a.jsx("p",{className:`${c}-item-title`.trim(),style:{width:`calc(${$.scalingValue(le??0,n)} * (${d} / 100))`,...ae},children:Ce.title}),s==="B"&&a.jsx("div",{"data-controls":"subtitleMarginTop",className:`${c}-control`,style:{height:$.scalingValue(z??0,n),width:$.scalingValue(le*d/100,n)}}),s==="B"&&a.jsx("p",{className:`${c}-item-subtitle`.trim(),style:{width:`calc(${$.scalingValue(le??0,n)} * (${d} / 100))`,...R},children:Ce.subtitle})]})})},Ie)})})}),we&&typeof document&&document.getElementById("grid-component-lightbox-portal")&&f==="On"&&po.createPortal(a.jsx("div",{"data-selection":"none",children:a.jsx(Ds,{images:Oe,index:be,imageDisplay:p.display,originRect:Be,reverseClose:m==="Off",onClose:()=>Le(!1),onPrev:()=>Ae(Ce=>(Ce-1+Oe.length)%Oe.length),onNext:()=>Ae(Ce=>(Ce+1)%Oe.length)})}),document.body)]})}const zs={titleColor:"title-color",subtitleColor:"subtitle-color"},Vs=["hover","focus","filled","success","error"],Ks=`import { Splide, SplideSlide } from '@splidejs/react-splide';\r
2894
2894
  import '@splidejs/react-splide/css/core';\r
2895
2895
  import { CommonComponentProps } from '../props';\r
2896
2896
  import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';\r
@@ -3549,11 +3549,11 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {\r
3549
3549
  };\r
3550
3550
  \r
3551
3551
  const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
3552
- `,Dr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Ll=["titleColor","subtitleColor"],El={type:"object",version:1,properties:{content:{type:"array",settings:{addItemFromFileExplorer:!0},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"}},image:{type:"object",label:"Image",display:{type:"media-list-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:[{title:"Title 1",subtitle:"Subtitle 1",image:[{url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",name:"Grid-1.png",objectFit:"cover"}],link:""},{title:"Title 2",subtitle:"Subtitle 2",image:[{url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",name:"Grid-2.png",objectFit:"cover"}],link:""},{title:"Title 3",subtitle:"Subtitle 3",image:[{url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",name:"Grid-3.png",objectFit:"cover"}],link:""}]}},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B"]},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,max:200},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},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"}}},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 Color",display:{type:"palette-color-picker"}},subtitleColor:{type:"string",scope:"common",title:"Subtitle Color",display:{type:"palette-color-picker",visible:!1}},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"}}},defaults:{lightbox:"Off",imageDisplay:{display:"Fit",ratioValue:"16:9",reversed:!1},type:"A",slider:"Off",sliderTiming:5,direction:"Horizontal",transition:"Slide",titleColor:"#767676",subtitleColor:"#DEDDDD",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},subtitleFontFamily:"Arial",subtitleFontSettings:{fontWeight:400,fontStyle:"normal"},subtitleLetterSpacing:0,subtitleWordSpacing:0,subtitleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{gridLayout:{entryWidth:.2,horizontalGap:.05,wrapperWidth:1,columnsCount:2,lockedParam:null},textBoxWidth:100,verticalGap:.0083,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:.043,titleLineHeight:.043,subtitleFontSize:.0373,subtitleLineHeight:.0373},d:{gridLayout:{entryWidth:.2,horizontalGap:.05,wrapperWidth:1,columnsCount:2,lockedParam:null},textBoxWidth:100,verticalGap:.0083,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:.01,titleLineHeight:.01,subtitleFontSize:.01,subtitleLineHeight:.01}},displayRules:[{if:{name:"transition",value:"Fade"},then:{name:"properties.direction.display.enabled",value:!1}},{if:{name:"type",value:"B"},then:{name:"properties.subtitleColor.display.visible",value:!0}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","entriesCount","lightbox","imageDisplay","slider","sliderTiming","direction","transition","transition","titleMarginTop","subtitleMarginTop"]},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"row",title:"Grid",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["textBoxWidth","entriesCount"]},{type:"row",title:"",items:["verticalGap"]},{type:"row",title:"Image",items:["imageDisplay","lightbox"]},{type:"row",title:"Slider",items:[{type:"group",title:"",items:["slider","sliderTiming"]},{type:"group",title:"",items:["direction","transition"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Subtitle",items:["subtitleFontFamily","subtitleFontSettings",{type:"row",items:["subtitleFontSize","subtitleLineHeight","subtitleLetterSpacing","subtitleWordSpacing"]},"subtitleTextAppearance"]}]}],paletteBookmark:{items:[...Ll],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor"]}}},Il={element:wl,id:"grid",name:"Neptune",category:"grids",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.png"},version:1,defaultSize:{width:720,height:540},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},schema:El,sourceCode:_l};function dn(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Al(e){return`
3552
+ `,so={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Gs=["titleColor","subtitleColor"],Us={type:"object",version:1,properties:{content:{type:"array",settings:{addItemFromFileExplorer:!0},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"}},image:{type:"object",label:"Image",display:{type:"media-list-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:[{title:"Title 1",subtitle:"Subtitle 1",image:[{url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",name:"Grid-1.png",objectFit:"cover"}],link:""},{title:"Title 2",subtitle:"Subtitle 2",image:[{url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",name:"Grid-2.png",objectFit:"cover"}],link:""},{title:"Title 3",subtitle:"Subtitle 3",image:[{url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",name:"Grid-3.png",objectFit:"cover"}],link:""}]}},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B"]},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,max:200},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},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"}}},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 Color",display:{type:"palette-color-picker"}},subtitleColor:{type:"string",scope:"common",title:"Subtitle Color",display:{type:"palette-color-picker",visible:!1}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...so.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:{...so.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"}}},defaults:{lightbox:"Off",imageDisplay:{display:"Fit",ratioValue:"16:9",reversed:!1},type:"A",slider:"Off",sliderTiming:5,direction:"Horizontal",transition:"Slide",titleColor:"#767676",subtitleColor:"#DEDDDD",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},subtitleFontFamily:"Arial",subtitleFontSettings:{fontWeight:400,fontStyle:"normal"},subtitleLetterSpacing:0,subtitleWordSpacing:0,subtitleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{gridLayout:{entryWidth:.2,horizontalGap:.05,wrapperWidth:1,columnsCount:2,lockedParam:null},textBoxWidth:100,verticalGap:.0083,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:.043,titleLineHeight:.043,subtitleFontSize:.0373,subtitleLineHeight:.0373},d:{gridLayout:{entryWidth:.2,horizontalGap:.05,wrapperWidth:1,columnsCount:2,lockedParam:null},textBoxWidth:100,verticalGap:.0083,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:.01,titleLineHeight:.01,subtitleFontSize:.01,subtitleLineHeight:.01}},displayRules:[{if:{name:"transition",value:"Fade"},then:{name:"properties.direction.display.enabled",value:!1}},{if:{name:"type",value:"B"},then:{name:"properties.subtitleColor.display.visible",value:!0}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","entriesCount","lightbox","imageDisplay","slider","sliderTiming","direction","transition","transition","titleMarginTop","subtitleMarginTop"]},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"row",title:"Grid",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["textBoxWidth","entriesCount"]},{type:"row",title:"",items:["verticalGap"]},{type:"row",title:"Image",items:["imageDisplay","lightbox"]},{type:"row",title:"Slider",items:[{type:"group",title:"",items:["slider","sliderTiming"]},{type:"group",title:"",items:["direction","transition"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Subtitle",items:["subtitleFontFamily","subtitleFontSettings",{type:"row",items:["subtitleFontSize","subtitleLineHeight","subtitleLetterSpacing","subtitleWordSpacing"]},"subtitleTextAppearance"]}]}],paletteBookmark:{items:[...Gs],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor"]}}},qs={element:js,id:"grid",name:"Neptune",category:"grids",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.png"},version:1,defaultSize:{width:720,height:540},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},schema:Us,sourceCode:Ks};function Wn(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ys(e){return`
3553
3553
  .${e}-wrapper {
3554
3554
  display: grid;
3555
3555
  align-items: start;
3556
- min-height: ${dn(48)};
3556
+ min-height: ${Wn(48)};
3557
3557
  position: relative;
3558
3558
  overflow: visible;
3559
3559
  box-sizing: border-box;
@@ -3571,6 +3571,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
3571
3571
 
3572
3572
  .${e}-list-item {
3573
3573
  display: flex;
3574
+ flex-direction: column;
3574
3575
  align-items: stretch;
3575
3576
  width: 100%;
3576
3577
  overflow: visible;
@@ -3584,7 +3585,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
3584
3585
 
3585
3586
  .${e}-list-cols-row {
3586
3587
  display: flex;
3587
- align-items: stretch;
3588
+ align-items: start;
3588
3589
  width: 100%;
3589
3590
  box-sizing: border-box;
3590
3591
  }
@@ -3604,7 +3605,7 @@ a.${e}-list-item {
3604
3605
  flex-shrink: 0;
3605
3606
  overflow: visible;
3606
3607
  box-sizing: border-box;
3607
- min-width: ${dn(50)};
3608
+ min-width: ${Wn(50)};
3608
3609
  position: relative;
3609
3610
  display: flex;
3610
3611
  align-items: center;
@@ -3612,7 +3613,7 @@ a.${e}-list-item {
3612
3613
 
3613
3614
  .${e}-list-col-last {
3614
3615
  flex: 1 1 auto;
3615
- min-width: ${dn(50)};
3616
+ min-width: ${Wn(50)};
3616
3617
  }
3617
3618
 
3618
3619
  .${e}-list-col-title {
@@ -3626,11 +3627,57 @@ a.${e}-list-item {
3626
3627
  }
3627
3628
 
3628
3629
  .${e}-col-resize-handle,
3629
- .${e}-row-padding-handle,
3630
- .${e}-wrapper-padding-handle {
3630
+ .${e}-padding-control-handle {
3631
3631
  background: transparent;
3632
3632
  }
3633
3633
 
3634
+ .${e}-row-padding-handle {
3635
+ position: relative;
3636
+ z-index: 2;
3637
+ width: 100%;
3638
+ flex-shrink: 0;
3639
+ background: var(--${e}-background-color);
3640
+ }
3641
+
3642
+ .${e}-row-padding-handle::before {
3643
+ content: "";
3644
+ position: absolute;
3645
+ top: 0;
3646
+ left: 0;
3647
+ width: 100%;
3648
+ height: 100%;
3649
+ min-height: 20px;
3650
+ pointer-events: auto;
3651
+ z-index: 10;
3652
+ }
3653
+
3654
+ .${e}-col-resize-handle::after {
3655
+ content: '';
3656
+ position: absolute;
3657
+ top: 0;
3658
+ left: 50%;
3659
+ transform: translateX(-50%);
3660
+ width: 2px;
3661
+ height: 100%;
3662
+ background: #FF5C02;
3663
+ pointer-events: none;
3664
+ }
3665
+
3666
+ .${e}-padding-control-handle::after {
3667
+ content: '';
3668
+ position: absolute;
3669
+ top: 50%;
3670
+ left: 50%;
3671
+ transform: translate(-50%, -50%);
3672
+ width: 4px;
3673
+ height: 12px;
3674
+ background: #FF5C02;
3675
+ border: 1px solid #FFFFFF;
3676
+ border-radius: 5px;
3677
+ pointer-events: none;
3678
+ box-sizing: border-box;
3679
+ }
3680
+
3634
3681
  .${e}-wrapper.${e}-entry-hover-default .${e}-list-item,
3635
3682
  .${e}-wrapper.${e}-entry-hover-blinds .${e}-list-item,
3636
3683
  .${e}-wrapper.${e}-entry-hover-default .${e}-cut-item,
@@ -3652,6 +3699,15 @@ a.${e}-list-item {
3652
3699
  background: var(--${e}-background-hover-color);
3653
3700
  }
3654
3701
 
3702
+ .${e}-wrapper.${e}-entry-hover-default .${e}-list-item:hover .${e}-row-padding-handle,
3703
+ .${e}-wrapper.${e}-entry-hover-default.${e}-state-hover .${e}-list-item .${e}-row-padding-handle,
3704
+ .${e}-wrapper.${e}-entry-hover-blinds .${e}-list-item:hover .${e}-row-padding-handle,
3705
+ .${e}-wrapper.${e}-entry-hover-blinds .${e}-list-item:has(+ .${e}-list-item:hover) .${e}-row-padding-handle,
3706
+ .${e}-wrapper.${e}-entry-hover-blinds .${e}-list-item:has(+ .${e}-cut-item:hover) .${e}-row-padding-handle,
3707
+ .${e}-wrapper.${e}-entry-hover-blinds.${e}-state-hover .${e}-list-item .${e}-row-padding-handle {
3708
+ background: var(--${e}-background-hover-color);
3709
+ }
3710
+
3655
3711
  .${e}-wrapper.${e}-entry-hover-default .${e}-list-item:hover,
3656
3712
  .${e}-wrapper.${e}-entry-hover-default .${e}-list-item:has(+ .${e}-list-item:hover),
3657
3713
  .${e}-wrapper.${e}-entry-hover-default .${e}-list-item:has(+ .${e}-cut-item:hover),
@@ -3733,937 +3789,1334 @@ a.${e}-list-item {
3733
3789
  overflow-wrap: anywhere;
3734
3790
  word-break: break-word;
3735
3791
  }
3736
- `}const Gr=["AColumn","BColumn","CColumn","DColumn","EColumn"],xt=["AColumnWidth","BColumn","CColumn","DColumn","EColumn"],Ur=.004,qr=.004,Kr=.004,Ro=50,kl=1440,vn=Ro/kl,Lt={AColumnWidth:.02,BColumn:.02,CColumn:.02,DColumn:.02,EColumn:.02};function Zn(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1,n=typeof e.wrapperPaddingLeft=="number"?e.wrapperPaddingLeft:0,r=typeof e.wrapperPaddingRight=="number"?e.wrapperPaddingRight:0;return Math.max(0,t-n-r)}function Fl(e,t=1){const n=t/e;return Object.fromEntries(xt.map(r=>[r,n]))}function Wl(e){return Object.fromEntries(xt.map(t=>[t,typeof e[t]=="number"?e[t]:Lt[t]]))}function Po(e,t,n){if(e<=0)return[];const r=xt.slice(0,e).map(d=>n[d]);if(e===1)return r;const o=r.slice(0,e-1),i=o.reduce((d,u)=>d+u,0)+vn;if(t>=i)return r;const l=[...o];let c=i-t;for(let d=l.length-1;d>=0&&c>0;d-=1){const u=l[d]-vn;if(u<=0)continue;const T=Math.min(c,u);l[d]-=T,c-=T}return[...l,r[e-1]]}function Rl(e,t,n){if(e<=1)return{};const r=Po(e,t,n),o={};for(let s=0;s<e-1;s+=1){const i=xt[s];r[s]!==n[i]&&(o[i]=r[s])}return o}function Pl(e,t){const n=e.columns,r=t.columns,o=Zn(e),s=Zn(t);if(typeof n=="number"&&n!==r)return{...e,...Fl(n,o)};if(o<s){const i=typeof n=="number"?n:typeof r=="number"?r:void 0;if(typeof i=="number"){const l=Wl({...t,...e});return{...e,...Rl(i,o,l)}}}return e}function Ml(e,t,n,r){const o=t.slice(0,e).reduce((i,l)=>i+l,0),s=n.slice(e+1,t.length-1).reduce((i,l)=>i+l,0);return Math.max(vn,r-o-s-vn)}function Hl(e,t){return Math.random()*(t-e)+e}function Nl({settings:e,content:t,isEditor:n,isPreviewMode:r,metadata:o,activeEvent:s,layoutId:i,onUpdateSettings:l}){const{prefix:c}=S.useScopedStyles(),{columns:d,wrapperWidth:u,entriesCount:T,cellMinHeight:C,dividerWidth:h,cut:p,showCut:g,cutCellMinHeight:$,cutLabel:v,imageSize:y,imageOnHover:E,entryHoverEffect:B,rowPaddingTop:R,rowPaddingBottom:_,wrapperPaddingLeft:f,wrapperPaddingRight:x,AColumnWidth:L,BColumn:j,CColumn:I,DColumn:P,EColumn:H,columnsOrder:z,textColor:D,textFontFamily:b,textFontSettings:k,textFontSize:F,textLineHeight:W,textLetterSpacing:A,textWordSpacing:N,textTextAppearance:Z,backgroundColor:le,dividerColor:ne,textHoverColor:de,backgroundHoverColor:M,dividerHoverColor:te}=e,[fe,me]=m.useState(void 0),[ge,q]=m.useState(null),ie=E==="On",O=(p??0)>0;m.useEffect(()=>{me(void 0)},[p,g,t,T]);const w=F??.01,G=w*1.2,Y=Math.max(W??w,G),J={fontSettings:{fontFamily:b,fontWeight:(k==null?void 0:k.fontWeight)??400,fontStyle:(k==null?void 0:k.fontStyle)??"normal"},fontSize:w,lineHeight:Y,letterSpacing:A??0,wordSpacing:N??0,textAppearance:Z,color:D},oe={...it(Be(J,n))},re=S.buildColorVars(c,{textColor:D,backgroundColor:le,dividerColor:ne,textHoverColor:de,backgroundHoverColor:M,dividerHoverColor:te},Ol,jl),ce=s&&s!=="default"?`${c}-state-${s}`:"",X=`${B==="Default"?`${c}-entry-hover-default`:B==="Blinds"?`${c}-entry-hover-blinds`:""} ${ce}`.trim(),K=m.useRef(null),se=m.useRef(e);m.useEffect(()=>{if(!l||!n){se.current=e;return}const we=se.current,Ae=Pl(e,we);se.current=e,Ae!==e&&l(Ae)},[e,l,n]);const Q={AColumnWidth:L??Lt.AColumnWidth,BColumn:j??Lt.BColumn,CColumn:I??Lt.CColumn,DColumn:P??Lt.DColumn,EColumn:H??Lt.EColumn},ue=m.useMemo(()=>Array.isArray(z)&&z.length>0?z:[...Gr],[z]),Se=m.useMemo(()=>ue.slice(0,d).map((we,Ae)=>({key:we,widthKey:xt[Ae],width:Q[xt[Ae]]})),[d,ue,L,j,I,P,H]),Te=f??0,Re=x??0,Pe=Zn(e),ve=m.useMemo(()=>xt.slice(0,d).map(we=>Q[we]),[d,L,j,I,P,H]),Ee=m.useMemo(()=>Po(d,Pe,Q),[d,Pe,L,j,I,P,H]),Ie=m.useMemo(()=>{const we=T===0?1/0:T;return(t??[]).slice(0,we).map((he,Fe)=>({id:Fe,cells:Object.fromEntries(Gr.map(Ne=>[Ne,he[Ne]??""])),image:he.image,link:he.link}))},[t,T]),Ce=O?fe??p:Ie.length,Me=m.useMemo(()=>O?Ie.slice(0,Ce):Ie,[Ie,O,Ce]),be=O&&Ce<Ie.length,He=()=>{const we=fe??p;if(!g){me(Ie.length);return}me(Math.min(we+g,Ie.length))},_e=we=>S.scalingValue(we,n??!1),ke=R??0,ze=_??0,Xe=Math.max(ke,qr),lt=Math.max(ze,qr),et=Math.max(Te,Kr),kn=Math.max(Re,Kr),Fn={paddingLeft:_e(Te),paddingRight:_e(Re)},Wn=we=>{if(!ie)return;const Ae=we.image;if(!(Ae!=null&&Ae.url)){q(null);return}if((ge==null?void 0:ge.rowId)===we.id)return;const he=(y==null?void 0:y.min)??80,Fe=(y==null?void 0:y.max)??320;q({rowId:we.id,url:Ae.url,objectFit:Ae.objectFit??"cover",widthPx:Hl(he,Fe)})},tn=()=>{q(null)};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Al(c)}}),a.jsx("div",{style:re,children:a.jsxs("div",{ref:K,className:`${c}-wrapper ${X}`.trim(),style:{width:S.scalingValue(u??0,n)},onMouseLeave:ie?tn:void 0,children:[n&&a.jsx("div",{"data-controls":"wrapperPaddingLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-no-highlight":"",className:`${c}-wrapper-padding-handle`,style:{position:"absolute",top:0,left:0,width:_e(et),height:"100%",pointerEvents:"auto",zIndex:4}}),n&&a.jsx("div",{"data-controls":"wrapperPaddingRight","data-controls-axis":"x","data-controls-reverse":"","data-controls-min":"0","data-controls-no-highlight":"",className:`${c}-wrapper-padding-handle`,style:{position:"absolute",top:0,right:0,width:_e(kn),height:"100%",pointerEvents:"auto",zIndex:4}}),a.jsxs("div",{style:{width:"100%"},children:[Me.map((we,Ae)=>{var Oe;const he=(((Oe=we.link)==null?void 0:Oe.length)??0)>0,Fe=he?"a":"div",Ne={paddingTop:_e(ke),paddingBottom:_e(ze),borderBottomWidth:S.scalingValue(h??0,n),...Ae===0?{borderTopWidth:S.scalingValue(h??0,n)}:{}};return a.jsxs(Fe,{className:`${c}-list-item`,...he?{href:we.link,target:"_blank"}:{},style:Ne,onMouseEnter:ie?()=>Wn(we):void 0,children:[n&&a.jsx("div",{"data-controls":"rowPaddingTop","data-controls-axis":"y","data-controls-min":"0","data-controls-no-highlight":"",className:`${c}-row-padding-handle`,style:{position:"absolute",top:0,left:0,width:"100%",height:_e(Xe),pointerEvents:"auto",zIndex:3}}),a.jsx("div",{className:`${c}-list-cols-row`,style:{...Fn,minHeight:_e(C??0)},children:Se.map((Ue,Rn)=>{const Pn=Rn===Se.length-1,Mo=Ee[Rn],Ho=Ml(Rn,Ee,ve,Pe);return a.jsxs("div",{className:`${c}-list-col${Pn?` ${c}-list-col-last`:""}`,style:Pn?void 0:{width:_e(Mo)},"data-test":Ue.width,children:[a.jsx("span",{className:`${c}-list-col-title`,style:oe,children:we.cells[Ue.key]??null}),n&&!Pn&&a.jsx("div",{"data-controls":Ue.widthKey,"data-controls-axis":"x","data-controls-min":String(Ro),"data-controls-max-fraction":String(Ho),"data-controls-no-highlight":"",className:`${c}-col-resize-handle`,style:{position:"absolute",top:0,left:`calc(100% - ${_e(Ur/2)})`,width:_e(Ur),height:"100%",pointerEvents:"auto",zIndex:2}})]},Ue.key)})}),n&&a.jsx("div",{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-min":"0","data-controls-no-highlight":"",className:`${c}-row-padding-handle`,style:{position:"absolute",bottom:0,left:0,width:"100%",height:_e(lt),pointerEvents:"auto",zIndex:3}})]},we.id)}),be&&a.jsx("div",{className:`${c}-cut-item`,style:{minHeight:_e($??0),borderBottomWidth:S.scalingValue(h??0,n)},children:a.jsx("div",{className:`${c}-list-cols-row`,style:{...Fn,justifyContent:"center"},children:a.jsx("button",{type:"button",className:`${c}-cut-label`,style:oe,onClick:He,children:v})})})]}),ie&&ge&&a.jsx("img",{className:`${c}-hover-image`,src:ge.url,alt:"",style:{width:dn(ge.widthPx),objectFit:ge.objectFit}})]})})]})}const Ol={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},jl=["hover","focus","filled","success","error"],zl=`import { Splide, SplideSlide } from '@splidejs/react-splide';\r
3737
- import '@splidejs/react-splide/css/core';\r
3738
- import { CommonComponentProps } from '../props';\r
3739
- import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';\r
3740
- import { useEffect, useMemo, useRef, useState } from 'react';\r
3741
- import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';\r
3742
- \r
3743
- function sv(px: number): string {\r
3744
- return \`calc(var(--cntrl-article-width, 100vw) * \${px / 1440})\`;\r
3745
- }\r
3746
- \r
3747
- function getCSS(P: string): string {\r
3748
- return \`\r
3749
- .\${P}-wrapper {\r
3750
- display: grid;\r
3751
- align-items: start;\r
3752
- min-height: \${sv(48)};\r
3753
- position: relative;\r
3754
- overflow: visible;\r
3755
- box-sizing: border-box;\r
3756
- }\r
3757
- \r
3758
- .\${P}-hover-image {\r
3759
- position: absolute;\r
3760
- right: 0;\r
3761
- bottom: 0;\r
3762
- z-index: 10;\r
3763
- pointer-events: none;\r
3764
- display: block;\r
3765
- height: auto;\r
3766
- }\r
3767
- \r
3768
- .\${P}-list-item {\r
3769
- display: flex;\r
3770
- align-items: stretch;\r
3771
- width: 100%;\r
3772
- overflow: visible;\r
3773
- position: relative;\r
3774
- box-sizing: content-box;\r
3775
- border-bottom-style: solid;\r
3776
- border-bottom-color: var(--\${P}-divider-color);\r
3777
- user-select: none;\r
3778
- background: var(--\${P}-background-color);\r
3779
- }\r
3780
- \r
3781
- .\${P}-list-cols-row {\r
3782
- display: flex;\r
3783
- align-items: stretch;\r
3784
- width: 100%;\r
3785
- box-sizing: border-box;\r
3786
- }\r
3787
- \r
3788
- a.\${P}-list-item {\r
3789
- text-decoration: none;\r
3790
- color: inherit;\r
3791
- cursor: pointer;\r
3792
- }\r
3793
- \r
3794
- .\${P}-list-item:first-child {\r
3795
- border-top-style: solid;\r
3796
- border-top-color: var(--\${P}-divider-color);\r
3797
- }\r
3798
- \r
3799
- .\${P}-list-col {\r
3800
- flex-shrink: 0;\r
3801
- overflow: visible;\r
3802
- box-sizing: border-box;\r
3803
- min-width: \${sv(50)};\r
3804
- position: relative;\r
3805
- display: flex;\r
3806
- align-items: center;\r
3807
- }\r
3808
- \r
3809
- .\${P}-list-col-last {\r
3810
- flex: 1 1 auto;\r
3811
- min-width: \${sv(50)};\r
3812
- }\r
3813
- \r
3814
- .\${P}-list-col-title {\r
3815
- color: var(--\${P}-text-color);\r
3816
- white-space: pre-wrap;\r
3817
- overflow-wrap: anywhere;\r
3818
- word-break: break-word;\r
3819
- flex: 1;\r
3820
- min-width: 0;\r
3821
- width: 100%;\r
3822
- }\r
3823
- \r
3824
- .\${P}-col-resize-handle,\r
3825
- .\${P}-row-padding-handle,\r
3826
- .\${P}-wrapper-padding-handle {\r
3827
- background: transparent;\r
3828
- }\r
3829
- \r
3830
- .\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-item,\r
3831
- .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item,\r
3832
- .\${P}-wrapper.\${P}-entry-hover-default .\${P}-cut-item,\r
3833
- .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-cut-item {\r
3834
- transition: background-color 250ms, border-color 250ms;\r
3835
- }\r
3836
- \r
3837
- .\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-col-title,\r
3838
- .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-col-title,\r
3839
- .\${P}-wrapper.\${P}-entry-hover-default .\${P}-cut-label,\r
3840
- .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-cut-label {\r
3841
- transition: color 250ms;\r
3842
- }\r
3843
- \r
3844
- .\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-item:hover,\r
3845
- .\${P}-wrapper.\${P}-entry-hover-default.\${P}-state-hover .\${P}-list-item,\r
3846
- .\${P}-wrapper.\${P}-entry-hover-default .\${P}-cut-item:hover,\r
3847
- .\${P}-wrapper.\${P}-entry-hover-default.\${P}-state-hover .\${P}-cut-item {\r
3848
- background: var(--\${P}-background-hover-color);\r
3849
- }\r
3850
- \r
3851
- .\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-item:hover,\r
3852
- .\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-item:has(+ .\${P}-list-item:hover),\r
3853
- .\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-item:has(+ .\${P}-cut-item:hover),\r
3854
- .\${P}-wrapper.\${P}-entry-hover-default.\${P}-state-hover .\${P}-list-item,\r
3855
- .\${P}-wrapper.\${P}-entry-hover-default .\${P}-cut-item:hover,\r
3856
- .\${P}-wrapper.\${P}-entry-hover-default.\${P}-state-hover .\${P}-cut-item,\r
3857
- .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item:hover,\r
3858
- .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item:has(+ .\${P}-list-item:hover),\r
3859
- .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item:has(+ .\${P}-cut-item:hover),\r
3860
- .\${P}-wrapper.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item,\r
3861
- .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-cut-item:hover,\r
3862
- .\${P}-wrapper.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-cut-item {\r
3863
- border-bottom-color: var(--\${P}-divider-hover-color);\r
3864
- }\r
3865
- \r
3866
- .\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-item:hover:first-child,\r
3867
- .\${P}-wrapper.\${P}-entry-hover-default.\${P}-state-hover .\${P}-list-item:first-child,\r
3868
- .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item:hover:first-child,\r
3869
- .\${P}-wrapper.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item:first-child {\r
3870
- border-top-color: var(--\${P}-divider-hover-color);\r
3871
- }\r
3872
- \r
3873
- .\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-item:hover .\${P}-list-col-title,\r
3874
- .\${P}-wrapper.\${P}-entry-hover-default.\${P}-state-hover .\${P}-list-item .\${P}-list-col-title,\r
3875
- .\${P}-wrapper.\${P}-entry-hover-default .\${P}-cut-item:hover .\${P}-cut-label,\r
3876
- .\${P}-wrapper.\${P}-entry-hover-default.\${P}-state-hover .\${P}-cut-item .\${P}-cut-label,\r
3877
- .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item:hover .\${P}-list-col-title,\r
3878
- .\${P}-wrapper.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item .\${P}-list-col-title,\r
3879
- .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-cut-item:hover .\${P}-cut-label,\r
3880
- .\${P}-wrapper.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-cut-item .\${P}-cut-label {\r
3881
- color: var(--\${P}-text-hover-color);\r
3882
- }\r
3883
- \r
3884
- .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item::before,\r
3885
- .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-cut-item::before {\r
3886
- content: '';\r
3887
- position: absolute;\r
3888
- inset: 0;\r
3889
- background: var(--\${P}-background-hover-color);\r
3890
- transform: scaleY(0);\r
3891
- transform-origin: center center;\r
3892
- transition: transform 250ms;\r
3893
- z-index: 0;\r
3894
- pointer-events: none;\r
3895
- }\r
3896
- \r
3897
- .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-col,\r
3898
- .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-cut-label {\r
3899
- position: relative;\r
3900
- z-index: 1;\r
3901
- }\r
3902
- \r
3903
- .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item:hover::before,\r
3904
- .\${P}-wrapper.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item::before,\r
3905
- .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-cut-item:hover::before,\r
3906
- .\${P}-wrapper.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-cut-item::before {\r
3907
- transform: scaleY(1);\r
3908
- }\r
3909
- \r
3910
- .\${P}-cut-item {\r
3911
- display: flex;\r
3912
- align-items: center;\r
3913
- justify-content: center;\r
3914
- width: 100%;\r
3915
- overflow: visible;\r
3916
- position: relative;\r
3917
- box-sizing: border-box;\r
3918
- border-bottom-style: solid;\r
3919
- border-bottom-color: var(--\${P}-divider-color);\r
3920
- user-select: none;\r
3921
- background: var(--\${P}-background-color);\r
3922
- }\r
3923
- \r
3924
- .\${P}-cut-label {\r
3925
- all: unset;\r
3926
- cursor: pointer;\r
3927
- color: var(--\${P}-text-color);\r
3928
- white-space: pre-wrap;\r
3929
- overflow-wrap: anywhere;\r
3930
- word-break: break-word;\r
3931
- }\r
3932
- \`;\r
3933
- }\r
3934
- \r
3935
- type ListItemColumn = {\r
3936
- key: string;\r
3937
- widthKey: ColumnWidthKey;\r
3938
- width: number;\r
3939
- };\r
3940
- \r
3941
- const COLUMN_CONTENT_KEYS = [\r
3942
- 'AColumn',\r
3943
- 'BColumn',\r
3944
- 'CColumn',\r
3945
- 'DColumn',\r
3946
- 'EColumn',\r
3947
- ] as const;\r
3948
- \r
3949
- const COLUMN_WIDTH_KEYS = [\r
3950
- 'AColumnWidth',\r
3951
- 'BColumn',\r
3952
- 'CColumn',\r
3953
- 'DColumn',\r
3954
- 'EColumn',\r
3955
- ] as const;\r
3956
- \r
3957
- type ColumnWidthKey = typeof COLUMN_WIDTH_KEYS[number];\r
3958
- \r
3959
- const COL_RESIZE_HANDLE_WIDTH = 0.004;\r
3960
- const ROW_PADDING_HANDLE_HEIGHT = 0.004;\r
3961
- const WRAPPER_PADDING_HANDLE_WIDTH = 0.004;\r
3962
- const MIN_COLUMN_WIDTH_PX = 50;\r
3963
- const ARTICLE_DESIGN_WIDTH = 1440;\r
3964
- const MIN_COLUMN_WIDTH = MIN_COLUMN_WIDTH_PX / ARTICLE_DESIGN_WIDTH;\r
3965
- \r
3966
- const DEFAULT_COLUMN_WIDTHS: Record<ColumnWidthKey, number> = {\r
3967
- AColumnWidth: 0.02,\r
3968
- BColumn: 0.02,\r
3969
- CColumn: 0.02,\r
3970
- DColumn: 0.02,\r
3971
- EColumn: 0.02,\r
3972
- };\r
3973
- \r
3974
- export function getListEffectiveContentWidth(\r
3975
- settings: Record<string, unknown>,\r
3976
- ): number {\r
3977
- const wrapperWidth = typeof settings.wrapperWidth === 'number' ? settings.wrapperWidth : 1;\r
3978
- const paddingLeft =\r
3979
- typeof settings.wrapperPaddingLeft === 'number' ? settings.wrapperPaddingLeft : 0;\r
3980
- const paddingRight =\r
3981
- typeof settings.wrapperPaddingRight === 'number' ? settings.wrapperPaddingRight : 0;\r
3982
- \r
3983
- return Math.max(0, wrapperWidth - paddingLeft - paddingRight);\r
3984
- }\r
3985
- \r
3986
- export function getEqualListColumnWidthUpdates(\r
3987
- columns: number,\r
3988
- contentWidth: number = 1,\r
3989
- ): Record<ColumnWidthKey, number> {\r
3990
- const equalColumnWidth = contentWidth / columns;\r
3991
- return Object.fromEntries(\r
3992
- COLUMN_WIDTH_KEYS.map((key) => [key, equalColumnWidth]),\r
3993
- ) as Record<ColumnWidthKey, number>;\r
3994
- }\r
3995
- \r
3996
- function getStoredColumnWidths(\r
3997
- settings: Record<string, unknown>,\r
3998
- ): Record<ColumnWidthKey, number> {\r
3999
- return Object.fromEntries(\r
4000
- COLUMN_WIDTH_KEYS.map((key) => [\r
4001
- key,\r
4002
- typeof settings[key] === 'number'\r
4003
- ? settings[key] as number\r
4004
- : DEFAULT_COLUMN_WIDTHS[key],\r
4005
- ]),\r
4006
- ) as Record<ColumnWidthKey, number>;\r
4007
- }\r
4008
- \r
4009
- export function resolveListColumnWidths(\r
4010
- columns: number,\r
4011
- wrapperWidth: number,\r
4012
- storedWidths: Record<ColumnWidthKey, number>,\r
4013
- ): number[] {\r
4014
- if (columns <= 0) {\r
4015
- return [];\r
4016
- }\r
4017
- \r
4018
- const widths = COLUMN_WIDTH_KEYS.slice(0, columns).map(\r
4019
- (key) => storedWidths[key],\r
4020
- );\r
4021
- \r
4022
- if (columns === 1) {\r
4023
- return widths;\r
4024
- }\r
4025
- \r
4026
- const fixedWidths = widths.slice(0, columns - 1);\r
4027
- const fixedSum = fixedWidths.reduce((sum, width) => sum + width, 0);\r
4028
- const minTotalWidth = fixedSum + MIN_COLUMN_WIDTH;\r
4029
- \r
4030
- if (wrapperWidth >= minTotalWidth) {\r
4031
- return widths;\r
4032
- }\r
4033
- \r
4034
- const resolvedFixedWidths = [...fixedWidths];\r
4035
- let overflow = minTotalWidth - wrapperWidth;\r
4036
- \r
4037
- for (let index = resolvedFixedWidths.length - 1; index >= 0 && overflow > 0; index -= 1) {\r
4038
- const shrinkable = resolvedFixedWidths[index] - MIN_COLUMN_WIDTH;\r
4039
- if (shrinkable <= 0) {\r
4040
- continue;\r
4041
- }\r
4042
- \r
4043
- const shrinkAmount = Math.min(overflow, shrinkable);\r
4044
- resolvedFixedWidths[index] -= shrinkAmount;\r
4045
- overflow -= shrinkAmount;\r
4046
- }\r
4047
- \r
4048
- return [...resolvedFixedWidths, widths[columns - 1]];\r
4049
- }\r
4050
- \r
4051
- function getListColumnWidthUpdatesForWrapperWidth(\r
4052
- columns: number,\r
4053
- wrapperWidth: number,\r
4054
- storedWidths: Record<ColumnWidthKey, number>,\r
4055
- ): Partial<Record<ColumnWidthKey, number>> {\r
4056
- if (columns <= 1) {\r
4057
- return {};\r
4058
- }\r
4059
- \r
4060
- const resolvedWidths = resolveListColumnWidths(columns, wrapperWidth, storedWidths);\r
4061
- const updates: Partial<Record<ColumnWidthKey, number>> = {};\r
4062
- \r
4063
- for (let index = 0; index < columns - 1; index += 1) {\r
4064
- const key = COLUMN_WIDTH_KEYS[index];\r
4065
- if (resolvedWidths[index] !== storedWidths[key]) {\r
4066
- updates[key] = resolvedWidths[index];\r
4067
- }\r
4068
- }\r
4069
- \r
4070
- return updates;\r
4071
- }\r
4072
- \r
4073
- export function applyListSettingsChange(\r
4074
- nextSettings: Record<string, unknown>,\r
4075
- prevSettings: Record<string, unknown>,\r
4076
- ): Record<string, unknown> {\r
4077
- const nextColumns = nextSettings.columns;\r
4078
- const prevColumns = prevSettings.columns;\r
4079
- const nextContentWidth = getListEffectiveContentWidth(nextSettings);\r
4080
- const prevContentWidth = getListEffectiveContentWidth(prevSettings);\r
4081
- \r
4082
- if (typeof nextColumns === 'number' && nextColumns !== prevColumns) {\r
4083
- return {\r
4084
- ...nextSettings,\r
4085
- ...getEqualListColumnWidthUpdates(nextColumns, nextContentWidth),\r
4086
- };\r
4087
- }\r
4088
- \r
4089
- if (nextContentWidth < prevContentWidth) {\r
4090
- const columns =\r
4091
- typeof nextColumns === 'number'\r
4092
- ? nextColumns\r
4093
- : typeof prevColumns === 'number'\r
4094
- ? prevColumns\r
4095
- : undefined;\r
4096
- \r
4097
- if (typeof columns === 'number') {\r
4098
- const storedWidths = getStoredColumnWidths({ ...prevSettings, ...nextSettings });\r
4099
- \r
4100
- return {\r
4101
- ...nextSettings,\r
4102
- ...getListColumnWidthUpdatesForWrapperWidth(columns, nextContentWidth, storedWidths),\r
4103
- };\r
4104
- }\r
4105
- }\r
4106
- \r
4107
- return nextSettings;\r
4108
- }\r
4109
- \r
4110
- function getColumnMaxWidth(\r
4111
- columnIndex: number,\r
4112
- resolvedWidths: number[],\r
4113
- storedWidths: number[],\r
4114
- wrapperWidth: number,\r
4115
- ): number {\r
4116
- const leftWidth = resolvedWidths\r
4117
- .slice(0, columnIndex)\r
4118
- .reduce((sum, width) => sum + width, 0);\r
4119
- const rightPreferredWidth = storedWidths\r
4120
- .slice(columnIndex + 1, resolvedWidths.length - 1)\r
4121
- .reduce((sum, width) => sum + width, 0);\r
4122
- \r
4123
- return Math.max(\r
4124
- MIN_COLUMN_WIDTH,\r
4125
- wrapperWidth - leftWidth - rightPreferredWidth - MIN_COLUMN_WIDTH,\r
4126
- );\r
4127
- }\r
4128
- \r
4129
- type ListContentItem = {\r
4130
- AColumn?: string;\r
4131
- BColumn?: string;\r
4132
- CColumn?: string;\r
4133
- DColumn?: string;\r
4134
- EColumn?: string;\r
4135
- image?: {\r
4136
- objectFit?: 'cover' | 'contain';\r
4137
- url: string;\r
4138
- name: string;\r
4139
- };\r
4140
- link?: string;\r
4141
- };\r
4142
- \r
4143
- type ListItemRow = {\r
4144
- id: string | number;\r
4145
- cells: Record<string, React.ReactNode>;\r
4146
- image?: ListContentItem['image'];\r
4147
- link?: string;\r
4148
- };\r
4149
- \r
4150
- type HoverImageState = {\r
4151
- rowId: string | number;\r
4152
- url: string;\r
4153
- objectFit: 'cover' | 'contain';\r
4154
- widthPx: number;\r
4155
- };\r
4156
- \r
4157
- function randomBetween(min: number, max: number): number {\r
4158
- return Math.random() * (max - min) + min;\r
4159
- }\r
4160
- \r
4161
- type ListProps = {\r
4162
- layoutId?: string;\r
4163
- settings: ListSettings;\r
4164
- content?: ListContentItem[];\r
4165
- isEditor?: boolean;\r
4166
- isPreviewMode?: boolean;\r
4167
- activeEvent: string | undefined;\r
4168
- onUpdateSettings?: (settings: ListSettings) => void;\r
4169
- } & CommonComponentProps;\r
4170
- \r
4171
- export function List({ settings, content, isEditor, isPreviewMode, metadata, activeEvent, layoutId, onUpdateSettings }: ListProps) {\r
4172
- const { prefix: P } = useScopedStyles();\r
4173
- const {\r
4174
- columns,\r
4175
- wrapperWidth,\r
4176
- entriesCount,\r
4177
- cellMinHeight,\r
4178
- dividerWidth,\r
4179
- cut,\r
4180
- showCut,\r
4181
- cutCellMinHeight,\r
4182
- cutLabel,\r
4183
- imageSize,\r
4184
- imageOnHover,\r
4185
- entryHoverEffect,\r
4186
- rowPaddingTop,\r
4187
- rowPaddingBottom,\r
4188
- wrapperPaddingLeft,\r
4189
- wrapperPaddingRight,\r
4190
- AColumnWidth,\r
4191
- BColumn,\r
4192
- CColumn,\r
4193
- DColumn,\r
4194
- EColumn,\r
4195
- columnsOrder,\r
4196
- textColor,\r
4197
- textFontFamily,\r
4198
- textFontSettings,\r
4199
- textFontSize,\r
4200
- textLineHeight,\r
4201
- textLetterSpacing,\r
4202
- textWordSpacing,\r
4203
- textTextAppearance,\r
4204
- backgroundColor,\r
4205
- dividerColor,\r
4206
- textHoverColor,\r
4207
- backgroundHoverColor,\r
4208
- dividerHoverColor,\r
4209
- } = settings;\r
4210
- \r
4211
- const [visibleRowCount, setVisibleRowCount] = useState<number | undefined>(undefined);\r
4212
- const [hoverImage, setHoverImage] = useState<HoverImageState | null>(null);\r
4213
- const showHoverImage = imageOnHover === 'On';\r
4214
- const cutEnabled = (cut ?? 0) > 0;\r
4215
- \r
4216
- useEffect(() => {\r
4217
- setVisibleRowCount(undefined);\r
4218
- }, [cut, showCut, content, entriesCount]);\r
4219
- \r
4220
- const resolvedFontSize = textFontSize ?? 0.01;\r
4221
- const minLineHeight = resolvedFontSize * 1.2;\r
4222
- const resolvedLineHeight = Math.max(textLineHeight ?? resolvedFontSize, minLineHeight);\r
4223
- \r
4224
- const resolvedTextTextStyle: TextStyles = {\r
4225
- fontSettings: {\r
4226
- fontFamily: textFontFamily,\r
4227
- fontWeight: textFontSettings?.fontWeight ?? 400,\r
4228
- fontStyle: textFontSettings?.fontStyle ?? 'normal',\r
4229
- },\r
4230
- fontSize: resolvedFontSize,\r
4231
- lineHeight: resolvedLineHeight,\r
4232
- letterSpacing: textLetterSpacing ?? 0,\r
4233
- wordSpacing: textWordSpacing ?? 0,\r
4234
- textAppearance: textTextAppearance,\r
4235
- color: textColor,\r
4236
- };\r
4237
- const textTypographyCss = omitTextColors(textStylesToCss(resolvedTextTextStyle, isEditor));\r
4238
- const textFieldCss = {\r
4239
- ...textTypographyCss,\r
4240
- } as React.CSSProperties;\r
4241
- \r
4242
- const colorVars = buildColorVars(P, {\r
4243
- textColor,\r
4244
- backgroundColor,\r
4245
- dividerColor,\r
4246
- textHoverColor,\r
4247
- backgroundHoverColor,\r
4248
- dividerHoverColor\r
4249
- }, COLOR_VAR_MAP, STATE_KEYS);\r
4250
- \r
4251
- const stateClass = activeEvent && activeEvent !== 'default' ? \`\${P}-state-\${activeEvent}\` : '';\r
4252
- const entryHoverClass =\r
4253
- entryHoverEffect === 'Default'\r
4254
- ? \`\${P}-entry-hover-default\`\r
4255
- : entryHoverEffect === 'Blinds'\r
4256
- ? \`\${P}-entry-hover-blinds\`\r
4257
- : '';\r
4258
- const wrapperStateClasses = \`\${entryHoverClass} \${stateClass}\`.trim();\r
4259
- \r
4260
- const containerRef = useRef<HTMLDivElement>(null);\r
4261
- const prevSettingsRef = useRef(settings);\r
4262
- \r
4263
- useEffect(() => {\r
4264
- if (!onUpdateSettings || !isEditor) {\r
4265
- prevSettingsRef.current = settings;\r
4266
- return;\r
4267
- }\r
4268
- \r
4269
- const prevSettings = prevSettingsRef.current;\r
4270
- const updatedSettings = applyListSettingsChange(\r
4271
- settings as Record<string, unknown>,\r
4272
- prevSettings as Record<string, unknown>,\r
4273
- ) as ListSettings;\r
4274
- \r
4275
- prevSettingsRef.current = settings;\r
4276
- \r
4277
- if (updatedSettings === settings) {\r
4278
- return;\r
4279
- }\r
4280
- \r
4281
- onUpdateSettings(updatedSettings);\r
4282
- }, [settings, onUpdateSettings, isEditor]);\r
4283
- \r
4284
- const columnWidthByKey: Record<ColumnWidthKey, number> = {\r
4285
- AColumnWidth: AColumnWidth ?? DEFAULT_COLUMN_WIDTHS.AColumnWidth,\r
4286
- BColumn: BColumn ?? DEFAULT_COLUMN_WIDTHS.BColumn,\r
4287
- CColumn: CColumn ?? DEFAULT_COLUMN_WIDTHS.CColumn,\r
4288
- DColumn: DColumn ?? DEFAULT_COLUMN_WIDTHS.DColumn,\r
4289
- EColumn: EColumn ?? DEFAULT_COLUMN_WIDTHS.EColumn,\r
4290
- };\r
4291
- \r
4292
- const resolvedColumnsOrder = useMemo(() => {\r
4293
- if (Array.isArray(columnsOrder) && columnsOrder.length > 0) {\r
4294
- return columnsOrder as typeof COLUMN_CONTENT_KEYS[number][];\r
4295
- }\r
4296
- return [...COLUMN_CONTENT_KEYS];\r
4297
- }, [columnsOrder]);\r
4298
- \r
4299
- const listColumns: ListItemColumn[] = useMemo(\r
4300
- () =>\r
4301
- resolvedColumnsOrder.slice(0, columns).map((key, index) => ({\r
4302
- key,\r
4303
- widthKey: COLUMN_WIDTH_KEYS[index],\r
4304
- width: columnWidthByKey[COLUMN_WIDTH_KEYS[index]],\r
4305
- })),\r
4306
- [\r
4307
- columns,\r
4308
- resolvedColumnsOrder,\r
4309
- AColumnWidth,\r
4310
- BColumn,\r
4311
- CColumn,\r
4312
- DColumn,\r
4313
- EColumn,\r
4314
- ]\r
4315
- );\r
4316
- \r
4317
- const resolvedWrapperPaddingLeft = wrapperPaddingLeft ?? 0;\r
4318
- const resolvedWrapperPaddingRight = wrapperPaddingRight ?? 0;\r
4319
- const resolvedContentWidth = getListEffectiveContentWidth(settings as Record<string, unknown>);\r
4320
- const storedColumnWidths = useMemo(\r
4321
- () => COLUMN_WIDTH_KEYS.slice(0, columns).map((key) => columnWidthByKey[key]),\r
4322
- [\r
4323
- columns,\r
4324
- AColumnWidth,\r
4325
- BColumn,\r
4326
- CColumn,\r
4327
- DColumn,\r
4328
- EColumn,\r
4329
- ],\r
4330
- );\r
4331
- const resolvedColumnWidths = useMemo(\r
4332
- () => resolveListColumnWidths(columns, resolvedContentWidth, columnWidthByKey),\r
4333
- [\r
4334
- columns,\r
4335
- resolvedContentWidth,\r
4336
- AColumnWidth,\r
4337
- BColumn,\r
4338
- CColumn,\r
4339
- DColumn,\r
4340
- EColumn,\r
4341
- ],\r
4342
- );\r
4343
- \r
4344
- const allRows: ListItemRow[] = useMemo(() => {\r
4345
- const resEntriesCount = entriesCount === 0 ? Infinity : entriesCount;\r
4346
- const items = (content ?? []).slice(0, resEntriesCount);\r
4347
- \r
4348
- return items.map((item, index) => ({\r
4349
- id: index,\r
4350
- cells: Object.fromEntries(\r
4351
- COLUMN_CONTENT_KEYS.map((key) => [key, item[key] ?? ''])\r
4352
- ),\r
4353
- image: item.image,\r
4354
- link: item.link,\r
4355
- }));\r
4356
- }, [content, entriesCount]);\r
4357
- \r
4358
- const effectiveVisibleCount = cutEnabled\r
4359
- ? (visibleRowCount ?? cut)\r
4360
- : allRows.length;\r
4361
- \r
4362
- const visibleRows = useMemo(() => {\r
4363
- if (cutEnabled) {\r
4364
- return allRows.slice(0, effectiveVisibleCount);\r
4365
- }\r
4366
- return allRows;\r
4367
- }, [allRows, cutEnabled, effectiveVisibleCount]);\r
4368
- \r
4369
- const showCutLabel = cutEnabled && effectiveVisibleCount < allRows.length;\r
4370
- \r
4371
- const handleShowMore = () => {\r
4372
- const currentVisible = visibleRowCount ?? cut;\r
4373
- if (!showCut) {\r
4374
- setVisibleRowCount(allRows.length);\r
4375
- return;\r
4376
- }\r
4377
- setVisibleRowCount(Math.min(currentVisible + showCut, allRows.length));\r
4378
- };\r
4379
- \r
4380
- const scaled = (v: number) => scalingValue(v, isEditor ?? false);\r
4381
- const resolvedRowPaddingTop = rowPaddingTop ?? 0;\r
4382
- const resolvedRowPaddingBottom = rowPaddingBottom ?? 0;\r
4383
- const topHandleHeight = Math.max(resolvedRowPaddingTop, ROW_PADDING_HANDLE_HEIGHT);\r
4384
- const bottomHandleHeight = Math.max(resolvedRowPaddingBottom, ROW_PADDING_HANDLE_HEIGHT);\r
4385
- const leftHandleWidth = Math.max(resolvedWrapperPaddingLeft, WRAPPER_PADDING_HANDLE_WIDTH);\r
4386
- const rightHandleWidth = Math.max(resolvedWrapperPaddingRight, WRAPPER_PADDING_HANDLE_WIDTH);\r
4387
- const columnsRowStyle: React.CSSProperties = {\r
4388
- paddingLeft: scaled(resolvedWrapperPaddingLeft),\r
4389
- paddingRight: scaled(resolvedWrapperPaddingRight),\r
4390
- };\r
4391
- \r
4392
- const handleRowMouseEnter = (row: ListItemRow) => {\r
4393
- if (!showHoverImage) return;\r
4394
- \r
4395
- const image = row.image;\r
4396
- if (!image?.url) {\r
4397
- setHoverImage(null);\r
4398
- return;\r
4399
- }\r
4400
- \r
4401
- if (hoverImage?.rowId === row.id) {\r
4402
- return;\r
4403
- }\r
4404
- \r
4405
- const minWidth = imageSize?.min ?? 80;\r
4406
- const maxWidth = imageSize?.max ?? 320;\r
4407
- setHoverImage({\r
4408
- rowId: row.id,\r
4409
- url: image.url,\r
4410
- objectFit: image.objectFit ?? 'cover',\r
4411
- widthPx: randomBetween(minWidth, maxWidth),\r
4412
- });\r
4413
- };\r
4414
- \r
4415
- const handleWrapperMouseLeave = () => {\r
4416
- setHoverImage(null);\r
4417
- };\r
4418
- \r
4419
- return (\r
4420
- <>\r
4421
- <style dangerouslySetInnerHTML={{ __html: getCSS(P) }} />\r
4422
- <div style={colorVars}>\r
4423
- <div\r
4424
- ref={containerRef}\r
4425
- className={\`\${P}-wrapper \${wrapperStateClasses}\`.trim()}\r
4426
- style={{\r
4427
- width: scalingValue(wrapperWidth ?? 0, isEditor),\r
4428
- }}\r
4429
- onMouseLeave={showHoverImage ? handleWrapperMouseLeave : undefined}\r
4430
- >\r
4431
- {isEditor && (\r
4432
- <div\r
4433
- data-controls="wrapperPaddingLeft"\r
4434
- data-controls-axis="x"\r
4435
- data-controls-min="0"\r
4436
- data-controls-no-highlight=""\r
4437
- className={\`\${P}-wrapper-padding-handle\`}\r
4438
- style={{\r
4439
- position: 'absolute',\r
4440
- top: 0,\r
4441
- left: 0,\r
4442
- width: scaled(leftHandleWidth),\r
4443
- height: '100%',\r
4444
- pointerEvents: 'auto',\r
4445
- zIndex: 4,\r
4446
- }}\r
4447
- />\r
4448
- )}\r
4449
- {isEditor && (\r
4450
- <div\r
4451
- data-controls="wrapperPaddingRight"\r
4452
- data-controls-axis="x"\r
4453
- data-controls-reverse=""\r
4454
- data-controls-min="0"\r
4455
- data-controls-no-highlight=""\r
4456
- className={\`\${P}-wrapper-padding-handle\`}\r
4457
- style={{\r
4458
- position: 'absolute',\r
4459
- top: 0,\r
4460
- right: 0,\r
4461
- width: scaled(rightHandleWidth),\r
4462
- height: '100%',\r
4463
- pointerEvents: 'auto',\r
4464
- zIndex: 4,\r
4465
- }}\r
4466
- />\r
4467
- )}\r
4468
- <div style={{ width: '100%' }}>\r
4469
- {visibleRows.map((row, rowIdx) => {\r
4470
- const hasLink = (row.link?.length ?? 0) > 0;\r
4471
- const RowElement = hasLink ? 'a' : 'div';\r
4472
- const rowStyle = {\r
4473
- paddingTop: scaled(resolvedRowPaddingTop),\r
4474
- paddingBottom: scaled(resolvedRowPaddingBottom),\r
4475
- borderBottomWidth: scalingValue(dividerWidth ?? 0, isEditor),\r
4476
- ...(rowIdx === 0 ? { borderTopWidth: scalingValue(dividerWidth ?? 0, isEditor) } : {}),\r
4477
- };\r
4478
- \r
4479
- return (\r
4480
- <RowElement\r
4481
- key={row.id}\r
4482
- className={\`\${P}-list-item\`}\r
4483
- {...(hasLink ? { href: row.link, target: '_blank' } : {})}\r
4484
- style={rowStyle}\r
4485
- onMouseEnter={showHoverImage ? () => handleRowMouseEnter(row) : undefined}\r
4486
- >\r
4487
- {isEditor && (\r
4488
- <div\r
4489
- data-controls="rowPaddingTop"\r
4490
- data-controls-axis="y"\r
4491
- data-controls-min="0"\r
4492
- data-controls-no-highlight=""\r
4493
- className={\`\${P}-row-padding-handle\`}\r
4494
- style={{\r
4495
- position: 'absolute',\r
4496
- top: 0,\r
4497
- left: 0,\r
4498
- width: '100%',\r
4499
- height: scaled(topHandleHeight),\r
4500
- pointerEvents: 'auto',\r
4501
- zIndex: 3,\r
4502
- }}\r
4503
- />\r
4504
- )}\r
4505
- <div className={\`\${P}-list-cols-row\`} style={{ ...columnsRowStyle, minHeight: scaled(cellMinHeight ?? 0) }}>\r
4506
- {listColumns.map((col, colIndex) => {\r
4507
- const isLastColumn = colIndex === listColumns.length - 1;\r
4508
- const columnWidth = resolvedColumnWidths[colIndex];\r
4509
- const maxColumnWidth = getColumnMaxWidth(\r
4510
- colIndex,\r
4511
- resolvedColumnWidths,\r
4512
- storedColumnWidths,\r
4513
- resolvedContentWidth,\r
4514
- );\r
4515
- return (\r
4516
- <div\r
4517
- key={col.key}\r
4518
- className={\`\${P}-list-col\${isLastColumn ? \` \${P}-list-col-last\` : ''}\`}\r
4519
- style={isLastColumn ? undefined : { width: scaled(columnWidth) }}\r
4520
- data-test={col.width}\r
4521
- >\r
4522
- <span\r
4523
- className={\`\${P}-list-col-title\`}\r
4524
- style={textFieldCss}\r
4525
- >\r
4526
- {row.cells[col.key] ?? null}\r
4527
- </span>\r
4528
- {isEditor && !isLastColumn && (\r
4529
- <div\r
4530
- data-controls={col.widthKey}\r
4531
- data-controls-axis="x"\r
4532
- data-controls-min={String(MIN_COLUMN_WIDTH_PX)}\r
4533
- data-controls-max-fraction={String(maxColumnWidth)}\r
4534
- data-controls-no-highlight=""\r
4535
- className={\`\${P}-col-resize-handle\`}\r
4536
- style={{\r
4537
- position: 'absolute',\r
4538
- top: 0,\r
4539
- left: \`calc(100% - \${scaled(COL_RESIZE_HANDLE_WIDTH / 2)})\`,\r
4540
- width: scaled(COL_RESIZE_HANDLE_WIDTH),\r
4541
- height: '100%',\r
4542
- pointerEvents: 'auto',\r
4543
- zIndex: 2,\r
4544
- }}\r
4545
- />\r
4546
- )}\r
4547
- </div>\r
4548
- );\r
4549
- })}\r
4550
- </div>\r
4551
- {isEditor && (\r
4552
- <div\r
4553
- data-controls="rowPaddingBottom"\r
4554
- data-controls-axis="y"\r
4555
- data-controls-min="0"\r
4556
- data-controls-no-highlight=""\r
4557
- className={\`\${P}-row-padding-handle\`}\r
4558
- style={{\r
4559
- position: 'absolute',\r
4560
- bottom: 0,\r
4561
- left: 0,\r
4562
- width: '100%',\r
4563
- height: scaled(bottomHandleHeight),\r
4564
- pointerEvents: 'auto',\r
4565
- zIndex: 3,\r
4566
- }}\r
4567
- />\r
4568
- )}\r
4569
- </RowElement>\r
4570
- );\r
4571
- })}\r
4572
- {showCutLabel && (\r
4573
- <div\r
4574
- className={\`\${P}-cut-item\`}\r
4575
- style={{\r
4576
- minHeight: scaled(cutCellMinHeight ?? 0),\r
4577
- borderBottomWidth: scalingValue(dividerWidth ?? 0, isEditor),\r
4578
- }}\r
4579
- >\r
4580
- <div\r
4581
- className={\`\${P}-list-cols-row\`}\r
4582
- style={{ ...columnsRowStyle, justifyContent: 'center' }}\r
4583
- >\r
4584
- <button\r
4585
- type="button"\r
4586
- className={\`\${P}-cut-label\`}\r
4587
- style={textFieldCss}\r
4588
- onClick={handleShowMore}\r
4589
- >\r
4590
- {cutLabel}\r
4591
- </button>\r
4592
- </div>\r
4593
- </div>\r
4594
- )}\r
4595
- </div>\r
4596
- {showHoverImage && hoverImage && (\r
4597
- <img\r
4598
- className={\`\${P}-hover-image\`}\r
4599
- src={hoverImage.url}\r
4600
- alt=""\r
4601
- style={{\r
4602
- width: sv(hoverImage.widthPx),\r
4603
- objectFit: hoverImage.objectFit,\r
4604
- }}\r
4605
- />\r
4606
- )}\r
4607
- </div>\r
4608
- </div>\r
4609
- </>\r
4610
- );\r
4611
- }\r
4612
- \r
4613
- type ListSettings = {\r
4614
- columns: number;\r
4615
- wrapperWidth: number;\r
4616
- entriesCount: number;\r
4617
- cellMinHeight: number;\r
4618
- imageOnHover: 'On' | 'Off';\r
4619
- imageSize?: { min: number; max: number };\r
4620
- dividerWidth: number;\r
4621
- cut: number;\r
4622
- showCut: number;\r
4623
- cutCellMinHeight: number;\r
4624
- cutLabel: string;\r
4625
- entryHoverEffect: 'None' | 'Default' | 'Blinds';\r
4626
- rowPaddingTop: number;\r
4627
- rowPaddingBottom: number;\r
4628
- wrapperPaddingLeft: number;\r
4629
- wrapperPaddingRight: number;\r
4630
- AColumnWidth: number;\r
4631
- BColumn: number;\r
4632
- CColumn: number;\r
4633
- DColumn: number;\r
4634
- EColumn: number;\r
4635
- columnsOrder?: string[];\r
4636
- textColor: string;\r
4637
- textFontFamily: string;\r
4638
- textFontSettings?: { fontWeight: number; fontStyle: string };\r
4639
- textFontSize?: number;\r
4640
- textLineHeight?: number;\r
4641
- textLetterSpacing?: number;\r
4642
- textWordSpacing?: number;\r
4643
- textTextAppearance?: TextStyles['textAppearance'];\r
4644
- backgroundColor: string;\r
4645
- dividerColor: string;\r
4646
- textHoverColor: string;\r
4647
- backgroundHoverColor: string;\r
4648
- dividerHoverColor: string;\r
4649
- };\r
4650
- \r
4651
- type ColorKeys =\r
4652
- | 'textColor'\r
4653
- | 'backgroundColor'\r
4654
- | 'dividerColor'\r
4655
- | 'textHoverColor'\r
4656
- | 'backgroundHoverColor'\r
4657
- | 'dividerHoverColor'\r
4658
- \r
4659
- const COLOR_VAR_MAP: Record<ColorKeys, string> = {\r
4660
- textColor: 'text-color',\r
4661
- backgroundColor: 'background-color',\r
4662
- dividerColor: 'divider-color',\r
4663
- textHoverColor: 'text-hover-color',\r
4664
- backgroundHoverColor: 'background-hover-color',\r
4665
- dividerHoverColor: 'divider-hover-color',\r
4666
- };\r
4667
- \r
4668
- const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
4669
- `,Bl={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Vl=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"],Dl={type:"object",version:1,properties:{content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{AColumn:{type:"string",label:"A column",placeholder:"Add Title...",display:{type:"text-input"}},BColumn:{type:"string",label:"B column",placeholder:"Add Title...",display:{type:"text-input"}},CColumn:{type:"string",label:"C column",placeholder:"Add Title...",display:{type:"text-input"}},DColumn:{type:"string",label:"D column",placeholder:"Add Title...",display:{type:"text-input"}},EColumn:{type:"string",label:"E column",placeholder:"Add Title...",display:{type:"text-input"}},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:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:[{AColumn:"AColumn",BColumn:"BColumn",CColumn:"CColumn",DColumn:"DColumn",EColumn:"EColumn",image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"},link:""},{AColumn:"AColumn 2",BColumn:"BColumn 2",CColumn:"CColumn 2",DColumn:"DColumn 2",EColumn:"EColumn 2",image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"},link:""},{AColumn:"AColumn 3",BColumn:"BColumn 3",CColumn:"CColumn 3",DColumn:"DColumn 3",EColumn:"EColumn 3",image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"},link:""}]}},settings:{sizing:"auto auto",properties:{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},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["Auto","Fixed"]},min:1},cellMinHeight:{type:"number",scope:"layout",title:"Cell 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},cut:{type:"number",scope:"layout",title:"Cut",display:{type:"toggle-numeric-input",enum:["Off","On"]},min:1},entryHoverEffect:{type:"string",scope:"common",title:"Entry Hover Effect",display:{type:"toggle-cycle",enum:["None","Default","Blinds"]}},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"}},wrapperPaddingLeft:{type:"number",scope:"layout",title:"Wrapper Padding Left",min:0,max:100,display:{type:"range-control"}},wrapperPaddingRight:{type:"number",scope:"layout",title:"Wrapper Padding Right",min:0,max:100,display:{type:"range-control"}},AColumnWidth:{type:"number",scope:"layout",title:"A column width",min:0,max:100,display:{type:"range-control"}},BColumn:{type:"number",scope:"layout",title:"B column width",min:0,max:100,display:{type:"range-control"}},CColumn:{type:"number",scope:"layout",title:"C column width",min:0,max:100,display:{type:"range-control"}},DColumn:{type:"number",scope:"layout",title:"D column width",min:0,max:100,display:{type:"range-control"}},EColumn:{type:"number",scope:"layout",title:"E column width",min:0,max:100,display:{type:"range-control"}},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"}},textFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},textFontSettings:{...Bl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},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:"Off",entryHoverEffect:"None",cutLabel:"SEE ALL",textColor:"#767676",textHoverColor:"#767676",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},backgroundColor:"#FFFFFF00",dividerColor:"#767676",backgroundHoverColor:"#FFFFFF00",dividerHoverColor:"#767676"},layoutDefaults:{m:{columns:5,wrapperWidth:1,entriesCount:0,cellMinHeight:.02,imageSize:{min:80,max:320},dividerWidth:.002,cut:0,showCut:0,cutCellMinHeight:.02,rowPaddingTop:.01,rowPaddingBottom:.01,wrapperPaddingLeft:.01,wrapperPaddingRight:.01,AColumnWidth:.2,BColumn:.2,CColumn:.2,DColumn:.2,EColumn:.2,columnsOrder:["AColumn","BColumn","CColumn","DColumn","EColumn"],textStroke:.003,textCorners:.192,textPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},textFontSize:.043,textLineHeight:.043},d:{columns:5,wrapperWidth:1,entriesCount:0,cellMinHeight:.03,imageSize:{min:80,max:320},dividerWidth:6e-4,cut:0,showCut:0,cutCellMinHeight:.03,rowPaddingTop:.01,rowPaddingBottom:.01,wrapperPaddingLeft:.01,wrapperPaddingRight:.01,AColumnWidth:.2,BColumn:.2,CColumn:.2,DColumn:.2,EColumn:.2,columnsOrder:["AColumn","BColumn","CColumn","DColumn","EColumn"],textStroke:.001,textCorners:.05,textPadding:{top:.01,right:.01,bottom:.01,left:.01},textFontSize:.01,textLineHeight:.01}},displayRules:[{if:{name:"cut",value:0},then:{name:"properties.cutLabel.display.visible",value:!1}},{if:{name:"cut",value:0},then:{name:"properties.cutCellMinHeight.display.visible",value:!1}},{if:{name:"cut",value:0},then:{name:"properties.showCut.display.visible",value:!1}}],layout:["__componentName__","name","columns","wrapperWidth","entriesCount","cellMinHeight","imageOnHover","imageSize","dividerWidth","cut","showCut","cutCellMinHeight","entryHoverEffect","cutLabel","rowPaddingTop","rowPaddingBottom","wrapperPaddingLeft","wrapperPaddingRight","AColumnWidth","BColumn","CColumn","DColumn","EColumn","columnsOrder"]},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},{type:"row",title:"",items:["columns","wrapperWidth"]},{type:"row",title:"",items:["entriesCount","cellMinHeight"]},{type:"row",title:"",items:["imageOnHover","imageSize"]},{type:"row",title:"",items:["dividerWidth","cut"]},{type:"row",title:"",items:["entryHoverEffect"]},{type:"row",title:"Cut Settings",items:["cutLabel","cutCellMinHeight"]},{type:"row",title:"",items:["showCut"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["columnsOrder"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]}],paletteBookmark:{items:[...Vl],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Gl={element:Nl,id:"list",name:"Default List",category:"lists",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.png"},version:1,defaultSize:{width:720,height:540},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},schema:Dl,sourceCode:zl},Ul=[qa,es,Bs,Zs,sl,dl,vl,Il,Gl];exports.components=Ul;exports.isSchemaV1=No;
3792
+ `}const Mn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],et=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Hn=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Nn=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],co=.004,Sn=.004,Xo=50,Xs=1440,nn=Xo/Xs,kt={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function En(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Zs(e,t=1){const n=t/e;return Object.fromEntries(et.map(r=>[r,n]))}function $n(e){return Object.fromEntries(et.map(t=>[t,typeof e[t]=="number"?e[t]:kt[t]]))}function Zo(e,t,n){const r=e-nn,o=t+n;if(o<=0||o<=r)return{paddingLeft:t,paddingRight:n};if(r<=0)return{paddingLeft:0,paddingRight:0};const l=r/o;return{paddingLeft:t*l,paddingRight:n*l}}function Pn(e,t,n){const r=Mr(e,t,n);if(e<=0)return[];const o=r.slice(0,e-1).reduce((l,i)=>l+i,0);return[...r.slice(0,e-1),Math.max(0,t-o)]}function Js(e,t,n){const r={};for(let o=0;o<e;o+=1){const l=Hn[o],i=Nn[o],c=typeof n[l]=="number"?n[l]:0,s=typeof n[i]=="number"?n[i]:0,u=Zo(t[o]??0,c,s);u.paddingLeft!==c&&(r[l]=u.paddingLeft),u.paddingRight!==s&&(r[i]=u.paddingRight)}return r}function Mr(e,t,n){if(e<=0)return[];const r=et.slice(0,e).map(u=>n[u]);if(e===1)return r;const o=r.slice(0,e-1),i=o.reduce((u,d)=>u+d,0)+nn;if(t>=i)return r;const c=[...o];let s=i-t;for(let u=c.length-1;u>=0&&s>0;u-=1){const d=c[u]-nn;if(d<=0)continue;const L=Math.min(s,d);c[u]-=L,s-=L}return[...c,r[e-1]]}function Qs(e,t,n){if(e<=1)return{};const r=Mr(e,t,n),o={};for(let l=0;l<e-1;l+=1){const i=et[l];r[l]!==n[i]&&(o[i]=r[l])}return o}function uo(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Mn]}function ec(e,t){return e.length!==t.length?!1:e.every((n,r)=>n===t[r])}function tc(e,t,n,r){const o=Math.min(r,e.length,et.length),l={};for(let i=0;i<o;i+=1){const c=e[i],s=t.indexOf(c);if(s===-1)continue;const u=et[s],d=Hn[s],L=Nn[s],b=et[i],f=Hn[i],p=Nn[i],m=n[u],v=n[d],h=n[L];typeof m=="number"&&(l[b]=m),typeof v=="number"&&(l[f]=v),typeof h=="number"&&(l[p]=h)}return l}function nc(e,t){const n=e.columns,r=t.columns,o=En(e),l=En(t),i=typeof n=="number"?n:typeof r=="number"?r:Mn.length,c=m=>{const v=$n({...t,...m}),h=En(m),S=Pn(i,h,v),T=Js(i,S,{...t,...m});return Object.keys(T).length===0?m:{...m,...T}};if(typeof n=="number"&&n!==r)return c({...e,...Zs(n,o)});const s=uo(e),u=uo(t);if(!ec(s,u))return c({...e,...tc(s,u,t,i)});if(o<l&&typeof i=="number"){const m=$n({...t,...e});return c({...e,...Qs(i,o,m)})}const d=$n({...t,...e}),L=Pn(i,l,$n(t)),f=Pn(i,o,d).some((m,v)=>m<(L[v]??m)),p=et.some(m=>{const v=e[m],h=t[m];return typeof v=="number"&&typeof h=="number"&&v!==h});return f||p?c(e):e}function rc(e,t,n,r){const o=t.slice(0,e).reduce((i,c)=>i+c,0),l=n.slice(e+1,t.length-1).reduce((i,c)=>i+c,0);return Math.max(nn,r-o-l-nn)}function oc(e,t){return Math.random()*(t-e)+e}function ic({settings:e,content:t,isEditor:n,isPreviewMode:r,metadata:o,activeEvent:l,layoutId:i,onUpdateSettings:c}){const{prefix:s}=$.useScopedStyles(),u=!!(n&&r),{columns:d,wrapperWidth:L,entriesCount:b,cellMinHeight:f,dividerWidth:p,cut:m,showCut:v,cutCellMinHeight:h,cutLabel:S,imageSize:T,imageOnHover:z,entryHoverEffect:F,rowPaddingTop:_,rowPaddingBottom:y,AColumnWidth:x,AColumnPaddingLeft:E,AColumnPaddingRight:O,BColumnWidth:P,BColumnPaddingLeft:H,BColumnPaddingRight:N,CColumnWidth:D,CColumnPaddingLeft:V,CColumnPaddingRight:C,DColumnWidth:A,DColumnPaddingLeft:I,DColumnPaddingRight:k,EColumnWidth:W,EColumnPaddingLeft:M,EColumnPaddingRight:Z,columnsOrder:ae,textColor:ne,textFontFamily:ue,textFontSettings:R,textFontSize:re,textLineHeight:he,textLetterSpacing:me,textWordSpacing:ge,textTextAppearance:U,backgroundColor:le,dividerColor:B,textHoverColor:w,backgroundHoverColor:K,dividerHoverColor:X}=e,[J,ie]=g.useState(void 0),[Q,ee]=g.useState(null),se=z==="On",j=(m??0)>0;g.useEffect(()=>{ie(void 0)},[m,v,t,b]);const q=re??.01,Y=q*1.2,ce=Math.max(he??q,Y),oe={fontSettings:{fontFamily:ue,fontWeight:(R==null?void 0:R.fontWeight)??400,fontStyle:(R==null?void 0:R.fontStyle)??"normal"},fontSize:q,lineHeight:ce,letterSpacing:me??0,wordSpacing:ge??0,textAppearance:U,color:ne},we={...ut(ze(oe,n))},Le=$.buildColorVars(s,{textColor:ne,backgroundColor:le,dividerColor:B,textHoverColor:w,backgroundHoverColor:K,dividerHoverColor:X},ac,lc),Oe=l&&l!=="default"?`${s}-state-${l}`:"",be=`${F==="Default"?`${s}-entry-hover-default`:F==="Blinds"?`${s}-entry-hover-blinds`:""} ${Oe}`.trim(),Ae=g.useRef(null),Be=g.useRef(e);g.useEffect(()=>{if(!c||!n){Be.current=e;return}const ye=Be.current,Se=nc(e,ye);Be.current=e,Se!==e&&c(Se)},[e,c,n]);const xe={AColumnWidth:x??kt.AColumnWidth,BColumnWidth:P??kt.BColumnWidth,CColumnWidth:D??kt.CColumnWidth,DColumnWidth:A??kt.DColumnWidth,EColumnWidth:W??kt.EColumnWidth},Fe={AColumnPaddingLeft:E??0,BColumnPaddingLeft:H??0,CColumnPaddingLeft:V??0,DColumnPaddingLeft:I??0,EColumnPaddingLeft:M??0},Ce={AColumnPaddingRight:O??0,BColumnPaddingRight:N??0,CColumnPaddingRight:C??0,DColumnPaddingRight:k??0,EColumnPaddingRight:Z??0},Ie=g.useMemo(()=>Array.isArray(ae)&&ae.length>0?ae:[...Mn],[ae]),We=g.useMemo(()=>Ie.slice(0,d).map((ye,Se)=>{const je=Hn[Se],nt=Nn[Se];return{key:ye,widthKey:et[Se],width:xe[et[Se]],paddingLeftKey:je,paddingRightKey:nt,paddingLeft:Fe[je],paddingRight:Ce[nt]}}),[d,Ie,x,P,D,A,W,E,O,H,N,V,C,I,k,M,Z]),Ee=En(e),Ve=g.useMemo(()=>et.slice(0,d).map(ye=>xe[ye]),[d,x,P,D,A,W]),Ze=g.useMemo(()=>Mr(d,Ee,xe),[d,Ee,x,P,D,A,W]),Me=g.useMemo(()=>Pn(d,Ee,xe),[d,Ee,x,P,D,A,W]),He=g.useMemo(()=>We.map((ye,Se)=>Zo(Me[Se]??0,ye.paddingLeft,ye.paddingRight)),[We,Me]),at=g.useMemo(()=>{const ye=b===0?1/0:b;return(t??[]).slice(0,ye).map((je,nt)=>({id:nt,cells:Object.fromEntries(Mn.map(gt=>[gt,je[gt]??""])),image:je.image,link:je.link}))},[t,b]),pn=j?J??m:at.length,Zn=g.useMemo(()=>j?at.slice(0,pn):at,[at,j,pn]),mn=j&&pn<at.length,gn=()=>{const ye=J??m;if(!v){ie(at.length);return}ie(Math.min(ye+v,at.length))},Pe=ye=>$.scalingValue(ye,n??!1),fe=_??0,Ke=y??0,De=We[0],Re=We[We.length-1],Ge=He[0],Vt=He[He.length-1],Jo=De&&Ge?Math.max(Ge.paddingLeft,Sn):0,Hr=Re&&Vt?Math.max(Vt.paddingRight,Sn):0,Qo=Ee,ei=ye=>{if(!se)return;const Se=ye.image;if(!(Se!=null&&Se.url)){ee(null);return}if((Q==null?void 0:Q.rowId)===ye.id)return;const je=(T==null?void 0:T.min)??80,nt=(T==null?void 0:T.max)??320;ee({rowId:ye.id,url:Se.url,objectFit:Se.objectFit??"cover",widthPx:oc(je,nt)})},ti=()=>{ee(null)};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ys(s)}}),a.jsx("div",{style:Le,children:a.jsxs("div",{ref:Ae,className:`${s}-wrapper ${be}`.trim(),style:{width:$.scalingValue(L??0,n)},onMouseLeave:se?ti:void 0,children:[a.jsxs("div",{style:{width:"100%"},children:[Zn.map((ye,Se)=>{var Kt;const je=(((Kt=ye.link)==null?void 0:Kt.length)??0)>0,nt=je?"a":"div",gt={borderBottomWidth:$.scalingValue(p??0,n),...Se===0?{borderTopWidth:$.scalingValue(p??0,n)}:{}};return a.jsxs(nt,{className:`${s}-list-item`,...je?{href:ye.link,target:"_blank"}:{},style:gt,onMouseEnter:se?()=>ei(ye):void 0,children:[(fe>0||u)&&a.jsx("div",{...u?{"data-controls":"rowPaddingTop","data-controls-axis":"y","data-controls-min":"0"}:{},className:`${s}-row-padding-handle`,style:{height:Pe(fe)}}),a.jsx("div",{className:`${s}-list-cols-row`,style:{minHeight:Pe(f??0)},children:We.map((Et,Pt)=>{const hn=Pt===We.length-1,Jn=Me[Pt],fn=He[Pt];return a.jsx("div",{className:`${s}-list-col${hn?` ${s}-list-col-last`:""}`,style:{paddingLeft:Pe(fn.paddingLeft),paddingRight:Pe(fn.paddingRight),...hn?{}:{width:Pe(Jn)}},"data-test":Et.width,children:a.jsx("span",{className:`${s}-list-col-title`,style:we,children:ye.cells[Et.key]??null})},Et.key)})}),(Ke>0||u)&&a.jsx("div",{...u?{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-min":"0"}:{},className:`${s}-row-padding-handle`,style:{height:Pe(Ke)}})]},ye.id)}),mn&&a.jsx("div",{className:`${s}-cut-item`,style:{minHeight:Pe(h??0),borderBottomWidth:$.scalingValue(p??0,n)},children:a.jsx("div",{className:`${s}-list-cols-row`,style:{justifyContent:"center"},children:a.jsx("button",{type:"button",className:`${s}-cut-label`,style:we,onClick:gn,children:S})})})]}),u&&De&&Re&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":De.paddingLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Me[0]-((Ge==null?void 0:Ge.paddingRight)??0)),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:0,width:Pe(Jo),height:"100%",pointerEvents:"auto",zIndex:2}}),a.jsx("div",{"data-controls":Re.paddingRightKey,"data-controls-axis":"x","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Me[We.length-1]-((Vt==null?void 0:Vt.paddingLeft)??0)),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:Pe(Qo-Hr),width:Pe(Hr),height:"100%",pointerEvents:"auto",zIndex:2}})]},"column-edge-padding-handles"),u&&We.slice(0,-1).map((ye,Se)=>{const je=We[Se+1],nt=rc(Se,Ze,Ve,Ee),gt=Ze.slice(0,Se+1).reduce((fn,ni)=>fn+ni,0),Kt=He[Se],Et=He[Se+1],Pt=Math.max(Kt.paddingRight,Sn),hn=Math.max(Et.paddingLeft,Sn),Jn=gt-co/2;return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":ye.paddingRightKey,"data-controls-axis":"x","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Me[Se]-Kt.paddingLeft),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:Pe(gt-Pt),width:Pe(Pt),height:"100%",pointerEvents:"auto",zIndex:2}}),a.jsx("div",{"data-controls":ye.widthKey,"data-controls-axis":"x","data-controls-min":String(Xo),"data-controls-max-fraction":String(nt),"data-controls-variant":"column-width",className:`${s}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Pe(Jn),width:Pe(co),height:"calc(100%)",pointerEvents:"auto",zIndex:4}}),a.jsx("div",{"data-controls":je.paddingLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Me[Se+1]-Et.paddingRight),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:Pe(gt),width:Pe(hn),height:"100%",pointerEvents:"auto",zIndex:2}})]},`${ye.widthKey}-junction`)}),se&&Q&&a.jsx("img",{className:`${s}-hover-image`,src:Q.url,alt:"",style:{width:Wn(Q.widthPx),objectFit:Q.objectFit}})]})})]})}const ac={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},lc=["hover","focus","filled","success","error"],sc=`import { Splide, SplideSlide } from '@splidejs/react-splide';
3793
+ import '@splidejs/react-splide/css/core';
3794
+ import { CommonComponentProps } from '../props';
3795
+ import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
3796
+ import { useEffect, useMemo, useRef, useState } from 'react';
3797
+ import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
3798
+
3799
+ function sv(px: number): string {
3800
+ return \`calc(var(--cntrl-article-width, 100vw) * \${px / 1440})\`;
3801
+ }
3802
+
3803
+ function getCSS(P: string): string {
3804
+ return \`
3805
+ .\${P}-wrapper {
3806
+ display: grid;
3807
+ align-items: start;
3808
+ min-height: \${sv(48)};
3809
+ position: relative;
3810
+ overflow: visible;
3811
+ box-sizing: border-box;
3812
+ }
3813
+
3814
+ .\${P}-hover-image {
3815
+ position: absolute;
3816
+ right: 0;
3817
+ bottom: 0;
3818
+ z-index: 10;
3819
+ pointer-events: none;
3820
+ display: block;
3821
+ height: auto;
3822
+ }
3823
+
3824
+ .\${P}-list-item {
3825
+ display: flex;
3826
+ flex-direction: column;
3827
+ align-items: stretch;
3828
+ width: 100%;
3829
+ overflow: visible;
3830
+ position: relative;
3831
+ box-sizing: content-box;
3832
+ border-bottom-style: solid;
3833
+ border-bottom-color: var(--\${P}-divider-color);
3834
+ user-select: none;
3835
+ background: var(--\${P}-background-color);
3836
+ }
3837
+
3838
+ .\${P}-list-cols-row {
3839
+ display: flex;
3840
+ align-items: start;
3841
+ width: 100%;
3842
+ box-sizing: border-box;
3843
+ }
3844
+
3845
+ a.\${P}-list-item {
3846
+ text-decoration: none;
3847
+ color: inherit;
3848
+ cursor: pointer;
3849
+ }
3850
+
3851
+ .\${P}-list-item:first-child {
3852
+ border-top-style: solid;
3853
+ border-top-color: var(--\${P}-divider-color);
3854
+ }
3855
+
3856
+ .\${P}-list-col {
3857
+ flex-shrink: 0;
3858
+ overflow: visible;
3859
+ box-sizing: border-box;
3860
+ min-width: \${sv(50)};
3861
+ position: relative;
3862
+ display: flex;
3863
+ align-items: center;
3864
+ }
3865
+
3866
+ .\${P}-list-col-last {
3867
+ flex: 1 1 auto;
3868
+ min-width: \${sv(50)};
3869
+ }
3870
+
3871
+ .\${P}-list-col-title {
3872
+ color: var(--\${P}-text-color);
3873
+ white-space: pre-wrap;
3874
+ overflow-wrap: anywhere;
3875
+ word-break: break-word;
3876
+ flex: 1;
3877
+ min-width: 0;
3878
+ width: 100%;
3879
+ }
3880
+
3881
+ .\${P}-col-resize-handle,
3882
+ .\${P}-padding-control-handle {
3883
+ background: transparent;
3884
+ }
3885
+
3886
+ .\${P}-row-padding-handle {
3887
+ position: relative;
3888
+ z-index: 2;
3889
+ width: 100%;
3890
+ flex-shrink: 0;
3891
+ background: var(--\${P}-background-color);
3892
+ }
3893
+
3894
+ .\${P}-row-padding-handle::before {
3895
+ content: "";
3896
+ position: absolute;
3897
+ top: 0;
3898
+ left: 0;
3899
+ width: 100%;
3900
+ height: 100%;
3901
+ min-height: 20px;
3902
+ pointer-events: auto;
3903
+ z-index: 10;
3904
+ }
3905
+
3906
+ .\${P}-col-resize-handle::after {
3907
+ content: '';
3908
+ position: absolute;
3909
+ top: 0;
3910
+ left: 50%;
3911
+ transform: translateX(-50%);
3912
+ width: 2px;
3913
+ height: 100%;
3914
+ background: #FF5C02;
3915
+ pointer-events: none;
3916
+ }
3917
+
3918
+ .\${P}-padding-control-handle::after {
3919
+ content: '';
3920
+ position: absolute;
3921
+ top: 50%;
3922
+ left: 50%;
3923
+ transform: translate(-50%, -50%);
3924
+ width: 4px;
3925
+ height: 12px;
3926
+ background: #FF5C02;
3927
+ border: 1px solid #FFFFFF;
3928
+ border-radius: 5px;
3929
+ pointer-events: none;
3930
+ box-sizing: border-box;
3931
+ }
3932
+
3933
+ .\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-item,
3934
+ .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item,
3935
+ .\${P}-wrapper.\${P}-entry-hover-default .\${P}-cut-item,
3936
+ .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-cut-item {
3937
+ transition: background-color 250ms, border-color 250ms;
3938
+ }
3939
+
3940
+ .\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-col-title,
3941
+ .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-col-title,
3942
+ .\${P}-wrapper.\${P}-entry-hover-default .\${P}-cut-label,
3943
+ .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-cut-label {
3944
+ transition: color 250ms;
3945
+ }
3946
+
3947
+ .\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-item:hover,
3948
+ .\${P}-wrapper.\${P}-entry-hover-default.\${P}-state-hover .\${P}-list-item,
3949
+ .\${P}-wrapper.\${P}-entry-hover-default .\${P}-cut-item:hover,
3950
+ .\${P}-wrapper.\${P}-entry-hover-default.\${P}-state-hover .\${P}-cut-item {
3951
+ background: var(--\${P}-background-hover-color);
3952
+ }
3953
+
3954
+ .\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-item:hover .\${P}-row-padding-handle,
3955
+ .\${P}-wrapper.\${P}-entry-hover-default.\${P}-state-hover .\${P}-list-item .\${P}-row-padding-handle,
3956
+ .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item:hover .\${P}-row-padding-handle,
3957
+ .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item:has(+ .\${P}-list-item:hover) .\${P}-row-padding-handle,
3958
+ .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item:has(+ .\${P}-cut-item:hover) .\${P}-row-padding-handle,
3959
+ .\${P}-wrapper.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item .\${P}-row-padding-handle {
3960
+ background: var(--\${P}-background-hover-color);
3961
+ }
3962
+
3963
+ .\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-item:hover,
3964
+ .\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-item:has(+ .\${P}-list-item:hover),
3965
+ .\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-item:has(+ .\${P}-cut-item:hover),
3966
+ .\${P}-wrapper.\${P}-entry-hover-default.\${P}-state-hover .\${P}-list-item,
3967
+ .\${P}-wrapper.\${P}-entry-hover-default .\${P}-cut-item:hover,
3968
+ .\${P}-wrapper.\${P}-entry-hover-default.\${P}-state-hover .\${P}-cut-item,
3969
+ .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item:hover,
3970
+ .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item:has(+ .\${P}-list-item:hover),
3971
+ .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item:has(+ .\${P}-cut-item:hover),
3972
+ .\${P}-wrapper.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item,
3973
+ .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-cut-item:hover,
3974
+ .\${P}-wrapper.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-cut-item {
3975
+ border-bottom-color: var(--\${P}-divider-hover-color);
3976
+ }
3977
+
3978
+ .\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-item:hover:first-child,
3979
+ .\${P}-wrapper.\${P}-entry-hover-default.\${P}-state-hover .\${P}-list-item:first-child,
3980
+ .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item:hover:first-child,
3981
+ .\${P}-wrapper.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item:first-child {
3982
+ border-top-color: var(--\${P}-divider-hover-color);
3983
+ }
3984
+
3985
+ .\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-item:hover .\${P}-list-col-title,
3986
+ .\${P}-wrapper.\${P}-entry-hover-default.\${P}-state-hover .\${P}-list-item .\${P}-list-col-title,
3987
+ .\${P}-wrapper.\${P}-entry-hover-default .\${P}-cut-item:hover .\${P}-cut-label,
3988
+ .\${P}-wrapper.\${P}-entry-hover-default.\${P}-state-hover .\${P}-cut-item .\${P}-cut-label,
3989
+ .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item:hover .\${P}-list-col-title,
3990
+ .\${P}-wrapper.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item .\${P}-list-col-title,
3991
+ .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-cut-item:hover .\${P}-cut-label,
3992
+ .\${P}-wrapper.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-cut-item .\${P}-cut-label {
3993
+ color: var(--\${P}-text-hover-color);
3994
+ }
3995
+
3996
+ .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item::before,
3997
+ .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-cut-item::before {
3998
+ content: '';
3999
+ position: absolute;
4000
+ inset: 0;
4001
+ background: var(--\${P}-background-hover-color);
4002
+ transform: scaleY(0);
4003
+ transform-origin: center center;
4004
+ transition: transform 250ms;
4005
+ z-index: 0;
4006
+ pointer-events: none;
4007
+ }
4008
+
4009
+ .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-col,
4010
+ .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-cut-label {
4011
+ position: relative;
4012
+ z-index: 1;
4013
+ }
4014
+
4015
+ .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item:hover::before,
4016
+ .\${P}-wrapper.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item::before,
4017
+ .\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-cut-item:hover::before,
4018
+ .\${P}-wrapper.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-cut-item::before {
4019
+ transform: scaleY(1);
4020
+ }
4021
+
4022
+ .\${P}-cut-item {
4023
+ display: flex;
4024
+ align-items: center;
4025
+ justify-content: center;
4026
+ width: 100%;
4027
+ overflow: visible;
4028
+ position: relative;
4029
+ box-sizing: border-box;
4030
+ border-bottom-style: solid;
4031
+ border-bottom-color: var(--\${P}-divider-color);
4032
+ user-select: none;
4033
+ background: var(--\${P}-background-color);
4034
+ }
4035
+
4036
+ .\${P}-cut-label {
4037
+ all: unset;
4038
+ cursor: pointer;
4039
+ color: var(--\${P}-text-color);
4040
+ white-space: pre-wrap;
4041
+ overflow-wrap: anywhere;
4042
+ word-break: break-word;
4043
+ }
4044
+ \`;
4045
+ }
4046
+
4047
+ type ColumnPaddingLeftKey = typeof COLUMN_PADDING_LEFT_KEYS[number];
4048
+ type ColumnPaddingRightKey = typeof COLUMN_PADDING_RIGHT_KEYS[number];
4049
+
4050
+ type ListItemColumn = {
4051
+ key: string;
4052
+ widthKey: ColumnWidthKey;
4053
+ width: number;
4054
+ paddingLeftKey: ColumnPaddingLeftKey;
4055
+ paddingRightKey: ColumnPaddingRightKey;
4056
+ paddingLeft: number;
4057
+ paddingRight: number;
4058
+ };
4059
+
4060
+ const COLUMN_CONTENT_KEYS = [
4061
+ 'AColumn',
4062
+ 'BColumnWidth',
4063
+ 'CColumnWidth',
4064
+ 'DColumnWidth',
4065
+ 'EColumnWidth',
4066
+ ] as const;
4067
+
4068
+ const COLUMN_WIDTH_KEYS = [
4069
+ 'AColumnWidth',
4070
+ 'BColumnWidth',
4071
+ 'CColumnWidth',
4072
+ 'DColumnWidth',
4073
+ 'EColumnWidth',
4074
+ ] as const;
4075
+
4076
+ const COLUMN_PADDING_LEFT_KEYS = [
4077
+ 'AColumnPaddingLeft',
4078
+ 'BColumnPaddingLeft',
4079
+ 'CColumnPaddingLeft',
4080
+ 'DColumnPaddingLeft',
4081
+ 'EColumnPaddingLeft',
4082
+ ] as const;
4083
+
4084
+ const COLUMN_PADDING_RIGHT_KEYS = [
4085
+ 'AColumnPaddingRight',
4086
+ 'BColumnPaddingRight',
4087
+ 'CColumnPaddingRight',
4088
+ 'DColumnPaddingRight',
4089
+ 'EColumnPaddingRight',
4090
+ ] as const;
4091
+
4092
+ type ColumnWidthKey = typeof COLUMN_WIDTH_KEYS[number];
4093
+
4094
+ const COL_RESIZE_HANDLE_WIDTH = 0.004;
4095
+ const COL_PADDING_HANDLE_WIDTH = 0.004;
4096
+ const MIN_COLUMN_WIDTH_PX = 50;
4097
+ const ARTICLE_DESIGN_WIDTH = 1440;
4098
+ const MIN_COLUMN_WIDTH = MIN_COLUMN_WIDTH_PX / ARTICLE_DESIGN_WIDTH;
4099
+
4100
+ const DEFAULT_COLUMN_WIDTHS: Record<ColumnWidthKey, number> = {
4101
+ AColumnWidth: 0.02,
4102
+ BColumnWidth: 0.02,
4103
+ CColumnWidth: 0.02,
4104
+ DColumnWidth: 0.02,
4105
+ EColumnWidth: 0.02,
4106
+ };
4107
+
4108
+ export function getListEffectiveContentWidth(
4109
+ settings: Record<string, unknown>,
4110
+ ): number {
4111
+ const wrapperWidth = typeof settings.wrapperWidth === 'number' ? settings.wrapperWidth : 1;
4112
+
4113
+ return Math.max(0, wrapperWidth);
4114
+ }
4115
+
4116
+ export function getEqualListColumnWidthUpdates(
4117
+ columns: number,
4118
+ contentWidth: number = 1,
4119
+ ): Record<ColumnWidthKey, number> {
4120
+ const equalColumnWidth = contentWidth / columns;
4121
+ return Object.fromEntries(
4122
+ COLUMN_WIDTH_KEYS.map((key) => [key, equalColumnWidth]),
4123
+ ) as Record<ColumnWidthKey, number>;
4124
+ }
4125
+
4126
+ function getStoreDColumnWidthWidths(
4127
+ settings: Record<string, unknown>,
4128
+ ): Record<ColumnWidthKey, number> {
4129
+ return Object.fromEntries(
4130
+ COLUMN_WIDTH_KEYS.map((key) => [
4131
+ key,
4132
+ typeof settings[key] === 'number'
4133
+ ? settings[key] as number
4134
+ : DEFAULT_COLUMN_WIDTHS[key],
4135
+ ]),
4136
+ ) as Record<ColumnWidthKey, number>;
4137
+ }
4138
+
4139
+ export function resolveListColumnPadding(
4140
+ columnWidth: number,
4141
+ paddingLeft: number,
4142
+ paddingRight: number,
4143
+ ): { paddingLeft: number; paddingRight: number } {
4144
+ const maxTotalPadding = columnWidth - MIN_COLUMN_WIDTH;
4145
+ const totalPadding = paddingLeft + paddingRight;
4146
+
4147
+ if (totalPadding <= 0 || totalPadding <= maxTotalPadding) {
4148
+ return { paddingLeft, paddingRight };
4149
+ }
4150
+
4151
+ if (maxTotalPadding <= 0) {
4152
+ return { paddingLeft: 0, paddingRight: 0 };
4153
+ }
4154
+
4155
+ const scale = maxTotalPadding / totalPadding;
4156
+
4157
+ return {
4158
+ paddingLeft: paddingLeft * scale,
4159
+ paddingRight: paddingRight * scale,
4160
+ };
4161
+ }
4162
+
4163
+ export function getEffectiveListColumnWidths(
4164
+ columns: number,
4165
+ wrapperWidth: number,
4166
+ storedWidths: Record<ColumnWidthKey, number>,
4167
+ ): number[] {
4168
+ const resolvedWidths = resolveListColumnWidths(columns, wrapperWidth, storedWidths);
4169
+
4170
+ if (columns <= 0) {
4171
+ return [];
4172
+ }
4173
+
4174
+ const sumFixed = resolvedWidths.slice(0, columns - 1).reduce((sum, width) => sum + width, 0);
4175
+
4176
+ return [
4177
+ ...resolvedWidths.slice(0, columns - 1),
4178
+ Math.max(0, wrapperWidth - sumFixed),
4179
+ ];
4180
+ }
4181
+
4182
+ function getListColumnPaddingUpdates(
4183
+ columns: number,
4184
+ effectiveWidths: number[],
4185
+ settings: Record<string, unknown>,
4186
+ ): Partial<Record<ColumnPaddingLeftKey | ColumnPaddingRightKey, number>> {
4187
+ const updates: Partial<Record<ColumnPaddingLeftKey | ColumnPaddingRightKey, number>> = {};
4188
+
4189
+ for (let index = 0; index < columns; index += 1) {
4190
+ const paddingLeftKey = COLUMN_PADDING_LEFT_KEYS[index];
4191
+ const paddingRightKey = COLUMN_PADDING_RIGHT_KEYS[index];
4192
+ const storedPaddingLeft = typeof settings[paddingLeftKey] === 'number'
4193
+ ? settings[paddingLeftKey] as number
4194
+ : 0;
4195
+ const storedPaddingRight = typeof settings[paddingRightKey] === 'number'
4196
+ ? settings[paddingRightKey] as number
4197
+ : 0;
4198
+ const resolvedPadding = resolveListColumnPadding(
4199
+ effectiveWidths[index] ?? 0,
4200
+ storedPaddingLeft,
4201
+ storedPaddingRight,
4202
+ );
4203
+
4204
+ if (resolvedPadding.paddingLeft !== storedPaddingLeft) {
4205
+ updates[paddingLeftKey] = resolvedPadding.paddingLeft;
4206
+ }
4207
+
4208
+ if (resolvedPadding.paddingRight !== storedPaddingRight) {
4209
+ updates[paddingRightKey] = resolvedPadding.paddingRight;
4210
+ }
4211
+ }
4212
+
4213
+ return updates;
4214
+ }
4215
+
4216
+ export function resolveListColumnWidths(
4217
+ columns: number,
4218
+ wrapperWidth: number,
4219
+ storedWidths: Record<ColumnWidthKey, number>,
4220
+ ): number[] {
4221
+ if (columns <= 0) {
4222
+ return [];
4223
+ }
4224
+
4225
+ const widths = COLUMN_WIDTH_KEYS.slice(0, columns).map(
4226
+ (key) => storedWidths[key],
4227
+ );
4228
+
4229
+ if (columns === 1) {
4230
+ return widths;
4231
+ }
4232
+
4233
+ const fixedWidths = widths.slice(0, columns - 1);
4234
+ const fixedSum = fixedWidths.reduce((sum, width) => sum + width, 0);
4235
+ const minTotalWidth = fixedSum + MIN_COLUMN_WIDTH;
4236
+
4237
+ if (wrapperWidth >= minTotalWidth) {
4238
+ return widths;
4239
+ }
4240
+
4241
+ const resolvedFixedWidths = [...fixedWidths];
4242
+ let overflow = minTotalWidth - wrapperWidth;
4243
+
4244
+ for (let index = resolvedFixedWidths.length - 1; index >= 0 && overflow > 0; index -= 1) {
4245
+ const shrinkable = resolvedFixedWidths[index] - MIN_COLUMN_WIDTH;
4246
+ if (shrinkable <= 0) {
4247
+ continue;
4248
+ }
4249
+
4250
+ const shrinkAmount = Math.min(overflow, shrinkable);
4251
+ resolvedFixedWidths[index] -= shrinkAmount;
4252
+ overflow -= shrinkAmount;
4253
+ }
4254
+
4255
+ return [...resolvedFixedWidths, widths[columns - 1]];
4256
+ }
4257
+
4258
+ function getListColumnWidthUpdatesForWrapperWidth(
4259
+ columns: number,
4260
+ wrapperWidth: number,
4261
+ storedWidths: Record<ColumnWidthKey, number>,
4262
+ ): Partial<Record<ColumnWidthKey, number>> {
4263
+ if (columns <= 1) {
4264
+ return {};
4265
+ }
4266
+
4267
+ const resolvedWidths = resolveListColumnWidths(columns, wrapperWidth, storedWidths);
4268
+ const updates: Partial<Record<ColumnWidthKey, number>> = {};
4269
+
4270
+ for (let index = 0; index < columns - 1; index += 1) {
4271
+ const key = COLUMN_WIDTH_KEYS[index];
4272
+ if (resolvedWidths[index] !== storedWidths[key]) {
4273
+ updates[key] = resolvedWidths[index];
4274
+ }
4275
+ }
4276
+
4277
+ return updates;
4278
+ }
4279
+
4280
+ function getColumnsOrder(settings: Record<string, unknown>): string[] {
4281
+ if (Array.isArray(settings.columnsOrder) && settings.columnsOrder.length > 0) {
4282
+ return settings.columnsOrder as string[];
4283
+ }
4284
+
4285
+ return [...COLUMN_CONTENT_KEYS];
4286
+ }
4287
+
4288
+ function areStringArraysEqual(left: string[], right: string[]): boolean {
4289
+ if (left.length !== right.length) {
4290
+ return false;
4291
+ }
4292
+
4293
+ return left.every((value, index) => value === right[index]);
4294
+ }
4295
+
4296
+ function getColumnLayoutUpdatesForOrderChange(
4297
+ nextOrder: string[],
4298
+ prevOrder: string[],
4299
+ prevSettings: Record<string, unknown>,
4300
+ columns: number,
4301
+ ): Record<string, number> {
4302
+ const count = Math.min(columns, nextOrder.length, COLUMN_WIDTH_KEYS.length);
4303
+ const updates: Record<string, number> = {};
4304
+
4305
+ for (let index = 0; index < count; index += 1) {
4306
+ const contentKey = nextOrder[index];
4307
+ const prevSlotIndex = prevOrder.indexOf(contentKey);
4308
+
4309
+ if (prevSlotIndex === -1) {
4310
+ continue;
4311
+ }
4312
+
4313
+ const prevWidthKey = COLUMN_WIDTH_KEYS[prevSlotIndex];
4314
+ const prevPaddingLeftKey = COLUMN_PADDING_LEFT_KEYS[prevSlotIndex];
4315
+ const prevPaddingRightKey = COLUMN_PADDING_RIGHT_KEYS[prevSlotIndex];
4316
+ const widthKey = COLUMN_WIDTH_KEYS[index];
4317
+ const paddingLeftKey = COLUMN_PADDING_LEFT_KEYS[index];
4318
+ const paddingRightKey = COLUMN_PADDING_RIGHT_KEYS[index];
4319
+
4320
+ const prevWidth = prevSettings[prevWidthKey];
4321
+ const prevPaddingLeft = prevSettings[prevPaddingLeftKey];
4322
+ const prevPaddingRight = prevSettings[prevPaddingRightKey];
4323
+
4324
+ if (typeof prevWidth === 'number') {
4325
+ updates[widthKey] = prevWidth;
4326
+ }
4327
+
4328
+ if (typeof prevPaddingLeft === 'number') {
4329
+ updates[paddingLeftKey] = prevPaddingLeft;
4330
+ }
4331
+
4332
+ if (typeof prevPaddingRight === 'number') {
4333
+ updates[paddingRightKey] = prevPaddingRight;
4334
+ }
4335
+ }
4336
+
4337
+ return updates;
4338
+ }
4339
+
4340
+ export function applyListSettingsChange(
4341
+ nextSettings: Record<string, unknown>,
4342
+ prevSettings: Record<string, unknown>,
4343
+ ): Record<string, unknown> {
4344
+ const nextColumns = nextSettings.columns;
4345
+ const prevColumns = prevSettings.columns;
4346
+ const nextContentWidth = getListEffectiveContentWidth(nextSettings);
4347
+ const prevContentWidth = getListEffectiveContentWidth(prevSettings);
4348
+ const columns =
4349
+ typeof nextColumns === 'number'
4350
+ ? nextColumns
4351
+ : typeof prevColumns === 'number'
4352
+ ? prevColumns
4353
+ : COLUMN_CONTENT_KEYS.length;
4354
+
4355
+ const withColumnPaddingUpdates = (
4356
+ settings: Record<string, unknown>,
4357
+ ): Record<string, unknown> => {
4358
+ const storedWidths = getStoreDColumnWidthWidths({ ...prevSettings, ...settings });
4359
+ const contentWidth = getListEffectiveContentWidth(settings);
4360
+ const effectiveWidths = getEffectiveListColumnWidths(columns, contentWidth, storedWidths);
4361
+ const paddingUpdates = getListColumnPaddingUpdates(columns, effectiveWidths, {
4362
+ ...prevSettings,
4363
+ ...settings,
4364
+ });
4365
+
4366
+ if (Object.keys(paddingUpdates).length === 0) {
4367
+ return settings;
4368
+ }
4369
+
4370
+ return {
4371
+ ...settings,
4372
+ ...paddingUpdates,
4373
+ };
4374
+ };
4375
+
4376
+ if (typeof nextColumns === 'number' && nextColumns !== prevColumns) {
4377
+ return withColumnPaddingUpdates({
4378
+ ...nextSettings,
4379
+ ...getEqualListColumnWidthUpdates(nextColumns, nextContentWidth),
4380
+ });
4381
+ }
4382
+
4383
+ const nextOrder = getColumnsOrder(nextSettings);
4384
+ const prevOrder = getColumnsOrder(prevSettings);
4385
+
4386
+ if (!areStringArraysEqual(nextOrder, prevOrder)) {
4387
+ return withColumnPaddingUpdates({
4388
+ ...nextSettings,
4389
+ ...getColumnLayoutUpdatesForOrderChange(nextOrder, prevOrder, prevSettings, columns),
4390
+ });
4391
+ }
4392
+
4393
+ if (nextContentWidth < prevContentWidth) {
4394
+ if (typeof columns === 'number') {
4395
+ const storedWidths = getStoreDColumnWidthWidths({ ...prevSettings, ...nextSettings });
4396
+
4397
+ return withColumnPaddingUpdates({
4398
+ ...nextSettings,
4399
+ ...getListColumnWidthUpdatesForWrapperWidth(columns, nextContentWidth, storedWidths),
4400
+ });
4401
+ }
4402
+ }
4403
+
4404
+ const storedWidths = getStoreDColumnWidthWidths({ ...prevSettings, ...nextSettings });
4405
+ const prevEffectiveWidths = getEffectiveListColumnWidths(
4406
+ columns,
4407
+ prevContentWidth,
4408
+ getStoreDColumnWidthWidths(prevSettings),
4409
+ );
4410
+ const nextEffectiveWidths = getEffectiveListColumnWidths(
4411
+ columns,
4412
+ nextContentWidth,
4413
+ storedWidths,
4414
+ );
4415
+ const columnWidthDecreased = nextEffectiveWidths.some(
4416
+ (width, index) => width < (prevEffectiveWidths[index] ?? width),
4417
+ );
4418
+ const columnWidthSettingChanged = COLUMN_WIDTH_KEYS.some((key) => {
4419
+ const nextWidth = nextSettings[key];
4420
+ const prevWidth = prevSettings[key];
4421
+
4422
+ return typeof nextWidth === 'number'
4423
+ && typeof prevWidth === 'number'
4424
+ && nextWidth !== prevWidth;
4425
+ });
4426
+
4427
+ if (columnWidthDecreased || columnWidthSettingChanged) {
4428
+ return withColumnPaddingUpdates(nextSettings);
4429
+ }
4430
+
4431
+ return nextSettings;
4432
+ }
4433
+
4434
+ function getColumnMaxWidth(
4435
+ columnIndex: number,
4436
+ resolvedWidths: number[],
4437
+ storedWidths: number[],
4438
+ wrapperWidth: number,
4439
+ ): number {
4440
+ const leftWidth = resolvedWidths
4441
+ .slice(0, columnIndex)
4442
+ .reduce((sum, width) => sum + width, 0);
4443
+ const rightPreferredWidth = storedWidths
4444
+ .slice(columnIndex + 1, resolvedWidths.length - 1)
4445
+ .reduce((sum, width) => sum + width, 0);
4446
+
4447
+ return Math.max(
4448
+ MIN_COLUMN_WIDTH,
4449
+ wrapperWidth - leftWidth - rightPreferredWidth - MIN_COLUMN_WIDTH,
4450
+ );
4451
+ }
4452
+
4453
+ type ListContentItem = {
4454
+ AColumn?: string;
4455
+ BColumnWidth?: string;
4456
+ CColumnWidth?: string;
4457
+ DColumnWidth?: string;
4458
+ EColumnWidth?: string;
4459
+ image?: {
4460
+ objectFit?: 'cover' | 'contain';
4461
+ url: string;
4462
+ name: string;
4463
+ };
4464
+ link?: string;
4465
+ };
4466
+
4467
+ type ListItemRow = {
4468
+ id: string | number;
4469
+ cells: Record<string, React.ReactNode>;
4470
+ image?: ListContentItem['image'];
4471
+ link?: string;
4472
+ };
4473
+
4474
+ type HoverImageState = {
4475
+ rowId: string | number;
4476
+ url: string;
4477
+ objectFit: 'cover' | 'contain';
4478
+ widthPx: number;
4479
+ };
4480
+
4481
+ function randomBetween(min: number, max: number): number {
4482
+ return Math.random() * (max - min) + min;
4483
+ }
4484
+
4485
+ type ListProps = {
4486
+ layoutId?: string;
4487
+ settings: ListSettings;
4488
+ content?: ListContentItem[];
4489
+ isEditor?: boolean;
4490
+ isPreviewMode?: boolean;
4491
+ activeEvent: string | undefined;
4492
+ onUpdateSettings?: (settings: ListSettings) => void;
4493
+ } & CommonComponentProps;
4494
+
4495
+ export function List({ settings, content, isEditor, isPreviewMode, metadata, activeEvent, layoutId, onUpdateSettings }: ListProps) {
4496
+ const { prefix: P } = useScopedStyles();
4497
+ const showControls = Boolean(isEditor && isPreviewMode);
4498
+ const {
4499
+ columns,
4500
+ wrapperWidth,
4501
+ entriesCount,
4502
+ cellMinHeight,
4503
+ dividerWidth,
4504
+ cut,
4505
+ showCut,
4506
+ cutCellMinHeight,
4507
+ cutLabel,
4508
+ imageSize,
4509
+ imageOnHover,
4510
+ entryHoverEffect,
4511
+ rowPaddingTop,
4512
+ rowPaddingBottom,
4513
+ AColumnWidth,
4514
+ AColumnPaddingLeft,
4515
+ AColumnPaddingRight,
4516
+ BColumnWidth,
4517
+ BColumnPaddingLeft,
4518
+ BColumnPaddingRight,
4519
+ CColumnWidth,
4520
+ CColumnPaddingLeft,
4521
+ CColumnPaddingRight,
4522
+ DColumnWidth,
4523
+ DColumnPaddingLeft,
4524
+ DColumnPaddingRight,
4525
+ EColumnWidth,
4526
+ EColumnPaddingLeft,
4527
+ EColumnPaddingRight,
4528
+ columnsOrder,
4529
+ textColor,
4530
+ textFontFamily,
4531
+ textFontSettings,
4532
+ textFontSize,
4533
+ textLineHeight,
4534
+ textLetterSpacing,
4535
+ textWordSpacing,
4536
+ textTextAppearance,
4537
+ backgroundColor,
4538
+ dividerColor,
4539
+ textHoverColor,
4540
+ backgroundHoverColor,
4541
+ dividerHoverColor,
4542
+ } = settings;
4543
+
4544
+ const [visibleRowCount, setVisibleRowCount] = useState<number | undefined>(undefined);
4545
+ const [hoverImage, setHoverImage] = useState<HoverImageState | null>(null);
4546
+ const showHoverImage = imageOnHover === 'On';
4547
+ const cutEnabled = (cut ?? 0) > 0;
4548
+
4549
+ useEffect(() => {
4550
+ setVisibleRowCount(undefined);
4551
+ }, [cut, showCut, content, entriesCount]);
4552
+
4553
+ const resolvedFontSize = textFontSize ?? 0.01;
4554
+ const minLineHeight = resolvedFontSize * 1.2;
4555
+ const resolvedLineHeight = Math.max(textLineHeight ?? resolvedFontSize, minLineHeight);
4556
+
4557
+ const resolvedTextTextStyle: TextStyles = {
4558
+ fontSettings: {
4559
+ fontFamily: textFontFamily,
4560
+ fontWeight: textFontSettings?.fontWeight ?? 400,
4561
+ fontStyle: textFontSettings?.fontStyle ?? 'normal',
4562
+ },
4563
+ fontSize: resolvedFontSize,
4564
+ lineHeight: resolvedLineHeight,
4565
+ letterSpacing: textLetterSpacing ?? 0,
4566
+ wordSpacing: textWordSpacing ?? 0,
4567
+ textAppearance: textTextAppearance,
4568
+ color: textColor,
4569
+ };
4570
+ const textTypographyCss = omitTextColors(textStylesToCss(resolvedTextTextStyle, isEditor));
4571
+ const textFieldCss = {
4572
+ ...textTypographyCss,
4573
+ } as React.CSSProperties;
4574
+
4575
+ const colorVars = buildColorVars(P, {
4576
+ textColor,
4577
+ backgroundColor,
4578
+ dividerColor,
4579
+ textHoverColor,
4580
+ backgroundHoverColor,
4581
+ dividerHoverColor
4582
+ }, COLOR_VAR_MAP, STATE_KEYS);
4583
+
4584
+ const stateClass = activeEvent && activeEvent !== 'default' ? \`\${P}-state-\${activeEvent}\` : '';
4585
+ const entryHoverClass =
4586
+ entryHoverEffect === 'Default'
4587
+ ? \`\${P}-entry-hover-default\`
4588
+ : entryHoverEffect === 'Blinds'
4589
+ ? \`\${P}-entry-hover-blinds\`
4590
+ : '';
4591
+ const wrapperStateClasses = \`\${entryHoverClass} \${stateClass}\`.trim();
4592
+
4593
+ const containerRef = useRef<HTMLDivElement>(null);
4594
+ const prevSettingsRef = useRef(settings);
4595
+
4596
+ useEffect(() => {
4597
+ if (!onUpdateSettings || !isEditor) {
4598
+ prevSettingsRef.current = settings;
4599
+ return;
4600
+ }
4601
+
4602
+ const prevSettings = prevSettingsRef.current;
4603
+ const updatedSettings = applyListSettingsChange(
4604
+ settings as Record<string, unknown>,
4605
+ prevSettings as Record<string, unknown>,
4606
+ ) as ListSettings;
4607
+
4608
+ prevSettingsRef.current = settings;
4609
+
4610
+ if (updatedSettings === settings) {
4611
+ return;
4612
+ }
4613
+
4614
+ onUpdateSettings(updatedSettings);
4615
+ }, [settings, onUpdateSettings, isEditor]);
4616
+
4617
+ const columnWidthByKey: Record<ColumnWidthKey, number> = {
4618
+ AColumnWidth: AColumnWidth ?? DEFAULT_COLUMN_WIDTHS.AColumnWidth,
4619
+ BColumnWidth: BColumnWidth ?? DEFAULT_COLUMN_WIDTHS.BColumnWidth,
4620
+ CColumnWidth: CColumnWidth ?? DEFAULT_COLUMN_WIDTHS.CColumnWidth,
4621
+ DColumnWidth: DColumnWidth ?? DEFAULT_COLUMN_WIDTHS.DColumnWidth,
4622
+ EColumnWidth: EColumnWidth ?? DEFAULT_COLUMN_WIDTHS.EColumnWidth,
4623
+ };
4624
+
4625
+ const columnPaddingLeftByKey: Record<ColumnPaddingLeftKey, number> = {
4626
+ AColumnPaddingLeft: AColumnPaddingLeft ?? 0,
4627
+ BColumnPaddingLeft: BColumnPaddingLeft ?? 0,
4628
+ CColumnPaddingLeft: CColumnPaddingLeft ?? 0,
4629
+ DColumnPaddingLeft: DColumnPaddingLeft ?? 0,
4630
+ EColumnPaddingLeft: EColumnPaddingLeft ?? 0,
4631
+ };
4632
+
4633
+ const columnPaddingRightByKey: Record<ColumnPaddingRightKey, number> = {
4634
+ AColumnPaddingRight: AColumnPaddingRight ?? 0,
4635
+ BColumnPaddingRight: BColumnPaddingRight ?? 0,
4636
+ CColumnPaddingRight: CColumnPaddingRight ?? 0,
4637
+ DColumnPaddingRight: DColumnPaddingRight ?? 0,
4638
+ EColumnPaddingRight: EColumnPaddingRight ?? 0,
4639
+ };
4640
+
4641
+ const resolveDColumnWidthsOrder = useMemo(() => {
4642
+ if (Array.isArray(columnsOrder) && columnsOrder.length > 0) {
4643
+ return columnsOrder as typeof COLUMN_CONTENT_KEYS[number][];
4644
+ }
4645
+ return [...COLUMN_CONTENT_KEYS];
4646
+ }, [columnsOrder]);
4647
+
4648
+ const listColumns: ListItemColumn[] = useMemo(
4649
+ () =>
4650
+ resolveDColumnWidthsOrder.slice(0, columns).map((key, index) => {
4651
+ const paddingLeftKey = COLUMN_PADDING_LEFT_KEYS[index];
4652
+ const paddingRightKey = COLUMN_PADDING_RIGHT_KEYS[index];
4653
+ return {
4654
+ key,
4655
+ widthKey: COLUMN_WIDTH_KEYS[index],
4656
+ width: columnWidthByKey[COLUMN_WIDTH_KEYS[index]],
4657
+ paddingLeftKey,
4658
+ paddingRightKey,
4659
+ paddingLeft: columnPaddingLeftByKey[paddingLeftKey],
4660
+ paddingRight: columnPaddingRightByKey[paddingRightKey],
4661
+ };
4662
+ }),
4663
+ [
4664
+ columns,
4665
+ resolveDColumnWidthsOrder,
4666
+ AColumnWidth,
4667
+ BColumnWidth,
4668
+ CColumnWidth,
4669
+ DColumnWidth,
4670
+ EColumnWidth,
4671
+ AColumnPaddingLeft,
4672
+ AColumnPaddingRight,
4673
+ BColumnPaddingLeft,
4674
+ BColumnPaddingRight,
4675
+ CColumnPaddingLeft,
4676
+ CColumnPaddingRight,
4677
+ DColumnPaddingLeft,
4678
+ DColumnPaddingRight,
4679
+ EColumnPaddingLeft,
4680
+ EColumnPaddingRight,
4681
+ ]
4682
+ );
4683
+
4684
+ const resolvedContentWidth = getListEffectiveContentWidth(settings as Record<string, unknown>);
4685
+ const storeDColumnWidthWidths = useMemo(
4686
+ () => COLUMN_WIDTH_KEYS.slice(0, columns).map((key) => columnWidthByKey[key]),
4687
+ [
4688
+ columns,
4689
+ AColumnWidth,
4690
+ BColumnWidth,
4691
+ CColumnWidth,
4692
+ DColumnWidth,
4693
+ EColumnWidth,
4694
+ ],
4695
+ );
4696
+ const resolveDColumnWidthWidths = useMemo(
4697
+ () => resolveListColumnWidths(columns, resolvedContentWidth, columnWidthByKey),
4698
+ [
4699
+ columns,
4700
+ resolvedContentWidth,
4701
+ AColumnWidth,
4702
+ BColumnWidth,
4703
+ CColumnWidth,
4704
+ DColumnWidth,
4705
+ EColumnWidth,
4706
+ ],
4707
+ );
4708
+
4709
+ const effectiveColumnWidths = useMemo(
4710
+ () => getEffectiveListColumnWidths(columns, resolvedContentWidth, columnWidthByKey),
4711
+ [
4712
+ columns,
4713
+ resolvedContentWidth,
4714
+ AColumnWidth,
4715
+ BColumnWidth,
4716
+ CColumnWidth,
4717
+ DColumnWidth,
4718
+ EColumnWidth,
4719
+ ],
4720
+ );
4721
+
4722
+ const effectiveColumnPaddings = useMemo(
4723
+ () =>
4724
+ listColumns.map((col, index) =>
4725
+ resolveListColumnPadding(
4726
+ effectiveColumnWidths[index] ?? 0,
4727
+ col.paddingLeft,
4728
+ col.paddingRight,
4729
+ )),
4730
+ [listColumns, effectiveColumnWidths],
4731
+ );
4732
+
4733
+ const allRows: ListItemRow[] = useMemo(() => {
4734
+ const resEntriesCount = entriesCount === 0 ? Infinity : entriesCount;
4735
+ const items = (content ?? []).slice(0, resEntriesCount);
4736
+
4737
+ return items.map((item, index) => ({
4738
+ id: index,
4739
+ cells: Object.fromEntries(
4740
+ COLUMN_CONTENT_KEYS.map((key) => [key, item[key] ?? ''])
4741
+ ),
4742
+ image: item.image,
4743
+ link: item.link,
4744
+ }));
4745
+ }, [content, entriesCount]);
4746
+
4747
+ const effectiveVisibleCount = cutEnabled
4748
+ ? (visibleRowCount ?? cut)
4749
+ : allRows.length;
4750
+
4751
+ const visibleRows = useMemo(() => {
4752
+ if (cutEnabled) {
4753
+ return allRows.slice(0, effectiveVisibleCount);
4754
+ }
4755
+ return allRows;
4756
+ }, [allRows, cutEnabled, effectiveVisibleCount]);
4757
+
4758
+ const showCutLabel = cutEnabled && effectiveVisibleCount < allRows.length;
4759
+
4760
+ const handleShowMore = () => {
4761
+ const currentVisible = visibleRowCount ?? cut;
4762
+ if (!showCut) {
4763
+ setVisibleRowCount(allRows.length);
4764
+ return;
4765
+ }
4766
+ setVisibleRowCount(Math.min(currentVisible + showCut, allRows.length));
4767
+ };
4768
+
4769
+ const scaled = (v: number) => scalingValue(v, isEditor ?? false);
4770
+ const resolvedRowPaddingTop = rowPaddingTop ?? 0;
4771
+ const resolvedRowPaddingBottom = rowPaddingBottom ?? 0;
4772
+ const firstColumn = listColumns[0];
4773
+ const lastColumn = listColumns[listColumns.length - 1];
4774
+ const firstColumnEffectivePadding = effectiveColumnPaddings[0];
4775
+ const lastColumnEffectivePadding = effectiveColumnPaddings[effectiveColumnPaddings.length - 1];
4776
+ const firstColumnPaddingLeftWidth = firstColumn && firstColumnEffectivePadding
4777
+ ? Math.max(firstColumnEffectivePadding.paddingLeft, COL_PADDING_HANDLE_WIDTH)
4778
+ : 0;
4779
+ const lastColumnPaddingRightWidth = lastColumn && lastColumnEffectivePadding
4780
+ ? Math.max(lastColumnEffectivePadding.paddingRight, COL_PADDING_HANDLE_WIDTH)
4781
+ : 0;
4782
+ const columnsRightEdge = resolvedContentWidth;
4783
+
4784
+ const handleRowMouseEnter = (row: ListItemRow) => {
4785
+ if (!showHoverImage) return;
4786
+
4787
+ const image = row.image;
4788
+ if (!image?.url) {
4789
+ setHoverImage(null);
4790
+ return;
4791
+ }
4792
+
4793
+ if (hoverImage?.rowId === row.id) {
4794
+ return;
4795
+ }
4796
+
4797
+ const minWidth = imageSize?.min ?? 80;
4798
+ const maxWidth = imageSize?.max ?? 320;
4799
+ setHoverImage({
4800
+ rowId: row.id,
4801
+ url: image.url,
4802
+ objectFit: image.objectFit ?? 'cover',
4803
+ widthPx: randomBetween(minWidth, maxWidth),
4804
+ });
4805
+ };
4806
+
4807
+ const handleWrapperMouseLeave = () => {
4808
+ setHoverImage(null);
4809
+ };
4810
+
4811
+ return (
4812
+ <>
4813
+ <style dangerouslySetInnerHTML={{ __html: getCSS(P) }} />
4814
+ <div style={colorVars}>
4815
+ <div
4816
+ ref={containerRef}
4817
+ className={\`\${P}-wrapper \${wrapperStateClasses}\`.trim()}
4818
+ style={{
4819
+ width: scalingValue(wrapperWidth ?? 0, isEditor),
4820
+ }}
4821
+ onMouseLeave={showHoverImage ? handleWrapperMouseLeave : undefined}
4822
+ >
4823
+ <div style={{ width: '100%' }}>
4824
+ {visibleRows.map((row, rowIdx) => {
4825
+ const hasLink = (row.link?.length ?? 0) > 0;
4826
+ const RowElement = hasLink ? 'a' : 'div';
4827
+ const rowStyle = {
4828
+ borderBottomWidth: scalingValue(dividerWidth ?? 0, isEditor),
4829
+ ...(rowIdx === 0 ? { borderTopWidth: scalingValue(dividerWidth ?? 0, isEditor) } : {}),
4830
+ };
4831
+
4832
+ return (
4833
+ <RowElement
4834
+ key={row.id}
4835
+ className={\`\${P}-list-item\`}
4836
+ {...(hasLink ? { href: row.link, target: '_blank' } : {})}
4837
+ style={rowStyle}
4838
+ onMouseEnter={showHoverImage ? () => handleRowMouseEnter(row) : undefined}
4839
+ >
4840
+ {(resolvedRowPaddingTop > 0 || showControls) && (
4841
+ <div
4842
+ {...(showControls ? {
4843
+ 'data-controls': 'rowPaddingTop',
4844
+ 'data-controls-axis': 'y',
4845
+ 'data-controls-min': '0',
4846
+ } : {})}
4847
+ className={\`\${P}-row-padding-handle\`}
4848
+ style={{ height: scaled(resolvedRowPaddingTop) }}
4849
+ />
4850
+ )}
4851
+ <div className={\`\${P}-list-cols-row\`} style={{ minHeight: scaled(cellMinHeight ?? 0) }}>
4852
+ {listColumns.map((col, colIndex) => {
4853
+ const isLastColumn = colIndex === listColumns.length - 1;
4854
+ const columnWidth = effectiveColumnWidths[colIndex];
4855
+ const effectivePadding = effectiveColumnPaddings[colIndex];
4856
+ return (
4857
+ <div
4858
+ key={col.key}
4859
+ className={\`\${P}-list-col\${isLastColumn ? \` \${P}-list-col-last\` : ''}\`}
4860
+ style={{
4861
+ paddingLeft: scaled(effectivePadding.paddingLeft),
4862
+ paddingRight: scaled(effectivePadding.paddingRight),
4863
+ ...(isLastColumn ? {} : { width: scaled(columnWidth) }),
4864
+ }}
4865
+ data-test={col.width}
4866
+ >
4867
+ <span
4868
+ className={\`\${P}-list-col-title\`}
4869
+ style={textFieldCss}
4870
+ >
4871
+ {row.cells[col.key] ?? null}
4872
+ </span>
4873
+ </div>
4874
+ );
4875
+ })}
4876
+ </div>
4877
+ {(resolvedRowPaddingBottom > 0 || showControls) && (
4878
+ <div
4879
+ {...(showControls ? {
4880
+ 'data-controls': 'rowPaddingBottom',
4881
+ 'data-controls-axis': 'y',
4882
+ 'data-controls-min': '0',
4883
+ } : {})}
4884
+ className={\`\${P}-row-padding-handle\`}
4885
+ style={{ height: scaled(resolvedRowPaddingBottom) }}
4886
+ />
4887
+ )}
4888
+ </RowElement>
4889
+ );
4890
+ })}
4891
+ {showCutLabel && (
4892
+ <div
4893
+ className={\`\${P}-cut-item\`}
4894
+ style={{
4895
+ minHeight: scaled(cutCellMinHeight ?? 0),
4896
+ borderBottomWidth: scalingValue(dividerWidth ?? 0, isEditor),
4897
+ }}
4898
+ >
4899
+ <div
4900
+ className={\`\${P}-list-cols-row\`}
4901
+ style={{ justifyContent: 'center' }}
4902
+ >
4903
+ <button
4904
+ type="button"
4905
+ className={\`\${P}-cut-label\`}
4906
+ style={textFieldCss}
4907
+ onClick={handleShowMore}
4908
+ >
4909
+ {cutLabel}
4910
+ </button>
4911
+ </div>
4912
+ </div>
4913
+ )}
4914
+ </div>
4915
+ {showControls && firstColumn && lastColumn && (
4916
+ <div key="column-edge-padding-handles" style={{ position: 'absolute', inset: 0, pointerEvents: 'none' }}>
4917
+ <div
4918
+ data-controls={firstColumn.paddingLeftKey}
4919
+ data-controls-axis="x"
4920
+ data-controls-min="0"
4921
+ data-controls-max-fraction={String(
4922
+ effectiveColumnWidths[0] - (firstColumnEffectivePadding?.paddingRight ?? 0),
4923
+ )}
4924
+ data-controls-static-handle=""
4925
+ className={\`\${P}-padding-control-handle\`}
4926
+ style={{
4927
+ position: 'absolute',
4928
+ top: 0,
4929
+ left: 0,
4930
+ width: scaled(firstColumnPaddingLeftWidth),
4931
+ height: '100%',
4932
+ pointerEvents: 'auto',
4933
+ zIndex: 2,
4934
+ }}
4935
+ />
4936
+ <div
4937
+ data-controls={lastColumn.paddingRightKey}
4938
+ data-controls-axis="x"
4939
+ data-controls-reverse=""
4940
+ data-controls-min="0"
4941
+ data-controls-max-fraction={String(
4942
+ effectiveColumnWidths[listColumns.length - 1]
4943
+ - (lastColumnEffectivePadding?.paddingLeft ?? 0),
4944
+ )}
4945
+ data-controls-static-handle=""
4946
+ className={\`\${P}-padding-control-handle\`}
4947
+ style={{
4948
+ position: 'absolute',
4949
+ top: 0,
4950
+ left: scaled(columnsRightEdge - lastColumnPaddingRightWidth),
4951
+ width: scaled(lastColumnPaddingRightWidth),
4952
+ height: '100%',
4953
+ pointerEvents: 'auto',
4954
+ zIndex: 2,
4955
+ }}
4956
+ />
4957
+ </div>
4958
+ )}
4959
+ {showControls && listColumns.slice(0, -1).map((col, colIndex) => {
4960
+ const nextCol = listColumns[colIndex + 1];
4961
+ const maxColumnWidth = getColumnMaxWidth(
4962
+ colIndex,
4963
+ resolveDColumnWidthWidths,
4964
+ storeDColumnWidthWidths,
4965
+ resolvedContentWidth,
4966
+ );
4967
+ const boundaryLeft = resolveDColumnWidthWidths.slice(0, colIndex + 1).reduce((sum, width) => sum + width, 0);
4968
+ const colEffectivePadding = effectiveColumnPaddings[colIndex];
4969
+ const nextColEffectivePadding = effectiveColumnPaddings[colIndex + 1];
4970
+ const paddingRightWidth = Math.max(
4971
+ colEffectivePadding.paddingRight,
4972
+ COL_PADDING_HANDLE_WIDTH,
4973
+ );
4974
+ const paddingLeftWidth = Math.max(
4975
+ nextColEffectivePadding.paddingLeft,
4976
+ COL_PADDING_HANDLE_WIDTH,
4977
+ );
4978
+ const columnWidthHandleLeft = boundaryLeft - COL_RESIZE_HANDLE_WIDTH / 2;
4979
+
4980
+ return (
4981
+ <div key={\`\${col.widthKey}-junction\`} style={{ position: 'absolute', inset: 0, pointerEvents: 'none' }}>
4982
+ <div
4983
+ data-controls={col.paddingRightKey}
4984
+ data-controls-axis="x"
4985
+ data-controls-reverse=""
4986
+ data-controls-min="0"
4987
+ data-controls-max-fraction={String(
4988
+ effectiveColumnWidths[colIndex] - colEffectivePadding.paddingLeft,
4989
+ )}
4990
+ data-controls-static-handle=""
4991
+ className={\`\${P}-padding-control-handle\`}
4992
+ style={{
4993
+ position: 'absolute',
4994
+ top: 0,
4995
+ left: scaled(boundaryLeft - paddingRightWidth),
4996
+ width: scaled(paddingRightWidth),
4997
+ height: '100%',
4998
+ pointerEvents: 'auto',
4999
+ zIndex: 2,
5000
+ }}
5001
+ />
5002
+ <div
5003
+ data-controls={col.widthKey}
5004
+ data-controls-axis="x"
5005
+ data-controls-min={String(MIN_COLUMN_WIDTH_PX)}
5006
+ data-controls-max-fraction={String(maxColumnWidth)}
5007
+ data-controls-variant="column-width"
5008
+ className={\`\${P}-col-resize-handle\`}
5009
+ style={{
5010
+ position: 'absolute',
5011
+ top: '0px',
5012
+ left: scaled(columnWidthHandleLeft),
5013
+ width: scaled(COL_RESIZE_HANDLE_WIDTH),
5014
+ height: 'calc(100%)',
5015
+ pointerEvents: 'auto',
5016
+ zIndex: 4,
5017
+ }}
5018
+ />
5019
+ <div
5020
+ data-controls={nextCol.paddingLeftKey}
5021
+ data-controls-axis="x"
5022
+ data-controls-min="0"
5023
+ data-controls-max-fraction={String(
5024
+ effectiveColumnWidths[colIndex + 1] - nextColEffectivePadding.paddingRight,
5025
+ )}
5026
+ data-controls-static-handle=""
5027
+ className={\`\${P}-padding-control-handle\`}
5028
+ style={{
5029
+ position: 'absolute',
5030
+ top: 0,
5031
+ left: scaled(boundaryLeft),
5032
+ width: scaled(paddingLeftWidth),
5033
+ height: '100%',
5034
+ pointerEvents: 'auto',
5035
+ zIndex: 2,
5036
+ }}
5037
+ />
5038
+ </div>
5039
+ );
5040
+ })}
5041
+ {showHoverImage && hoverImage && (
5042
+ <img
5043
+ className={\`\${P}-hover-image\`}
5044
+ src={hoverImage.url}
5045
+ alt=""
5046
+ style={{
5047
+ width: sv(hoverImage.widthPx),
5048
+ objectFit: hoverImage.objectFit,
5049
+ }}
5050
+ />
5051
+ )}
5052
+ </div>
5053
+ </div>
5054
+ </>
5055
+ );
5056
+ }
5057
+
5058
+ type ListSettings = {
5059
+ columns: number;
5060
+ wrapperWidth: number;
5061
+ entriesCount: number;
5062
+ cellMinHeight: number;
5063
+ imageOnHover: 'On' | 'Off';
5064
+ imageSize?: { min: number; max: number };
5065
+ dividerWidth: number;
5066
+ cut: number;
5067
+ showCut: number;
5068
+ cutCellMinHeight: number;
5069
+ cutLabel: string;
5070
+ entryHoverEffect: 'None' | 'Default' | 'Blinds';
5071
+ rowPaddingTop: number;
5072
+ rowPaddingBottom: number;
5073
+ AColumnWidth: number;
5074
+ AColumnPaddingLeft: number;
5075
+ AColumnPaddingRight: number;
5076
+ BColumnWidth: number;
5077
+ BColumnPaddingLeft: number;
5078
+ BColumnPaddingRight: number;
5079
+ CColumnWidth: number;
5080
+ CColumnPaddingLeft: number;
5081
+ CColumnPaddingRight: number;
5082
+ DColumnWidth: number;
5083
+ DColumnPaddingLeft: number;
5084
+ DColumnPaddingRight: number;
5085
+ EColumnWidth: number;
5086
+ EColumnPaddingLeft: number;
5087
+ EColumnPaddingRight: number;
5088
+ columnsOrder?: string[];
5089
+ textColor: string;
5090
+ textFontFamily: string;
5091
+ textFontSettings?: { fontWeight: number; fontStyle: string };
5092
+ textFontSize?: number;
5093
+ textLineHeight?: number;
5094
+ textLetterSpacing?: number;
5095
+ textWordSpacing?: number;
5096
+ textTextAppearance?: TextStyles['textAppearance'];
5097
+ backgroundColor: string;
5098
+ dividerColor: string;
5099
+ textHoverColor: string;
5100
+ backgroundHoverColor: string;
5101
+ dividerHoverColor: string;
5102
+ };
5103
+
5104
+ type ColorKeys =
5105
+ | 'textColor'
5106
+ | 'backgroundColor'
5107
+ | 'dividerColor'
5108
+ | 'textHoverColor'
5109
+ | 'backgroundHoverColor'
5110
+ | 'dividerHoverColor'
5111
+
5112
+ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
5113
+ textColor: 'text-color',
5114
+ backgroundColor: 'background-color',
5115
+ dividerColor: 'divider-color',
5116
+ textHoverColor: 'text-hover-color',
5117
+ backgroundHoverColor: 'background-hover-color',
5118
+ dividerHoverColor: 'divider-hover-color',
5119
+ };
5120
+
5121
+ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
5122
+ `,cc={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},dc=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"],uc={type:"object",version:1,properties:{content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{AColumn:{type:"string",label:"A column",placeholder:"Add Title...",display:{type:"text-input"}},BColumnWidth:{type:"string",label:"B column",placeholder:"Add Title...",display:{type:"text-input"}},CColumnWidth:{type:"string",label:"C column",placeholder:"Add Title...",display:{type:"text-input"}},DColumnWidth:{type:"string",label:"D column",placeholder:"Add Title...",display:{type:"text-input"}},EColumnWidth:{type:"string",label:"E column",placeholder:"Add Title...",display:{type:"text-input"}},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:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:[{AColumn:"AColumn",BColumnWidth:"BColumnWidth",CColumnWidth:"CColumnWidth",DColumnWidth:"DColumnWidth",EColumnWidth:"EColumnWidth",image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"},link:""},{AColumn:"AColumn 2",BColumnWidth:"BColumnWidth 2",CColumnWidth:"CColumnWidth 2",DColumnWidth:"DColumnWidth 2",EColumnWidth:"EColumnWidth 2",image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"},link:""},{AColumn:"AColumn 3",BColumnWidth:"BColumnWidth 3",CColumnWidth:"CColumnWidth 3",DColumnWidth:"DColumnWidth 3",EColumnWidth:"EColumnWidth 3",image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"},link:""}]}},settings:{sizing:"auto auto",properties:{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},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["Auto","Fixed"]},min:1},cellMinHeight:{type:"number",scope:"layout",title:"Cell 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},cut:{type:"number",scope:"layout",title:"Cut",display:{type:"toggle-numeric-input",enum:["Off","On"]},min:1},entryHoverEffect:{type:"string",scope:"common",title:"Entry Hover Effect",display:{type:"toggle-cycle",enum:["None","Default","Blinds"]}},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"}},AColumnWidth:{type:"number",scope:"layout",title:"A column width",min:0,max:100,display:{type:"range-control"}},AColumnPaddingLeft:{type:"number",scope:"layout",title:"A column padding left",min:0,max:100,display:{type:"range-control"}},AColumnPaddingRight:{type:"number",scope:"layout",title:"A column padding right",min:0,max:100,display:{type:"range-control"}},BColumnWidth:{type:"number",scope:"layout",title:"B column width",min:0,max:100,display:{type:"range-control"}},BColumnPaddingLeft:{type:"number",scope:"layout",title:"B column padding left",min:0,max:100,display:{type:"range-control"}},BColumnPaddingRight:{type:"number",scope:"layout",title:"B column padding right",min:0,max:100,display:{type:"range-control"}},CColumnWidth:{type:"number",scope:"layout",title:"C column width",min:0,max:100,display:{type:"range-control"}},CColumnPaddingLeft:{type:"number",scope:"layout",title:"C column padding left",min:0,max:100,display:{type:"range-control"}},CColumnPaddingRight:{type:"number",scope:"layout",title:"C column padding right",min:0,max:100,display:{type:"range-control"}},DColumnWidth:{type:"number",scope:"layout",title:"D column width",min:0,max:100,display:{type:"range-control"}},DColumnPaddingLeft:{type:"number",scope:"layout",title:"D column padding left",min:0,max:100,display:{type:"range-control"}},DColumnPaddingRight:{type:"number",scope:"layout",title:"D column padding right",min:0,max:100,display:{type:"range-control"}},EColumnWidth:{type:"number",scope:"layout",title:"E column width",min:0,max:100,display:{type:"range-control"}},EColumnPaddingLeft:{type:"number",scope:"layout",title:"E column padding left",min:0,max:100,display:{type:"range-control"}},EColumnPaddingRight:{type:"number",scope:"layout",title:"E column padding right",min:0,max:100,display:{type:"range-control"}},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"}},textFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},textFontSettings:{...cc.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},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:"Off",entryHoverEffect:"None",cutLabel:"SEE ALL",textColor:"#767676",textHoverColor:"#767676",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},backgroundColor:"#FFFFFF00",dividerColor:"#767676",backgroundHoverColor:"#FFFFFF00",dividerHoverColor:"#767676"},layoutDefaults:{m:{columns:5,wrapperWidth:1,entriesCount:0,cellMinHeight:.02,imageSize:{min:80,max:320},dividerWidth:.002,cut:0,showCut:0,cutCellMinHeight:.02,rowPaddingTop:.01,rowPaddingBottom:.01,AColumnWidth:.2,AColumnPaddingLeft:0,AColumnPaddingRight:0,BColumnWidth:.2,BColumnPaddingLeft:0,BColumnPaddingRight:0,CColumnWidth:.2,CColumnPaddingLeft:0,CColumnPaddingRight:0,DColumnWidth:.2,DColumnPaddingLeft:0,DColumnPaddingRight:0,EColumnWidth:.2,EColumnPaddingLeft:0,EColumnPaddingRight:0,columnsOrder:["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],textStroke:.003,textCorners:.192,textPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},textFontSize:.043,textLineHeight:.043},d:{columns:5,wrapperWidth:1,entriesCount:0,cellMinHeight:.03,imageSize:{min:80,max:320},dividerWidth:6e-4,cut:0,showCut:0,cutCellMinHeight:.03,rowPaddingTop:.01,rowPaddingBottom:.01,AColumnWidth:.2,AColumnPaddingLeft:0,AColumnPaddingRight:0,BColumnWidth:.2,BColumnPaddingLeft:0,BColumnPaddingRight:0,CColumnWidth:.2,CColumnPaddingLeft:0,CColumnPaddingRight:0,DColumnWidth:.2,DColumnPaddingLeft:0,DColumnPaddingRight:0,EColumnWidth:.2,EColumnPaddingLeft:0,EColumnPaddingRight:0,columnsOrder:["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],textStroke:.001,textCorners:.05,textPadding:{top:.01,right:.01,bottom:.01,left:.01},textFontSize:.01,textLineHeight:.01}},displayRules:[{if:{name:"cut",value:0},then:{name:"properties.cutLabel.display.visible",value:!1}},{if:{name:"cut",value:0},then:{name:"properties.cutCellMinHeight.display.visible",value:!1}},{if:{name:"cut",value:0},then:{name:"properties.showCut.display.visible",value:!1}}],layout:["__componentName__","name","columns","wrapperWidth","entriesCount","cellMinHeight","imageOnHover","imageSize","dividerWidth","cut","showCut","cutCellMinHeight","entryHoverEffect","cutLabel","rowPaddingTop","rowPaddingBottom","AColumnWidth","AColumnPaddingLeft","AColumnPaddingRight","BColumnWidth","BColumnPaddingLeft","BColumnPaddingRight","CColumnWidth","CColumnPaddingLeft","CColumnPaddingRight","DColumnWidth","DColumnPaddingLeft","DColumnPaddingRight","EColumnWidth","EColumnPaddingLeft","EColumnPaddingRight","columnsOrder"]},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},{type:"row",title:"",items:["columns","wrapperWidth"]},{type:"row",title:"",items:["entriesCount","cellMinHeight"]},{type:"row",title:"",items:["imageOnHover","imageSize"]},{type:"row",title:"",items:["dividerWidth","cut"]},{type:"row",title:"",items:["entryHoverEffect"]},{type:"row",title:"Cut Settings",items:["cutLabel","cutCellMinHeight"]},{type:"row",title:"",items:["showCut"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["columnsOrder"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]}],paletteBookmark:{items:[...dc],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},pc={element:ic,id:"list",name:"Default List",category:"lists",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.png"},version:1,defaultSize:{width:720,height:540},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},schema:uc,sourceCode:sc},mc=[pl,bl,ls,fs,Ls,As,Hs,qs,pc];exports.components=mc;exports.isSchemaV1=ri;