@cntrl-site/components 1.0.10 → 1.0.11-alpha.10
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/Components/Marquee/Marquee.d.ts +27 -0
- package/dist/Components/Marquee/MarqueeComponent.d.ts +34 -0
- package/dist/index.js +727 -22
- package/dist/index.mjs +3460 -2230
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),w=require("react"),ye=require("classnames"),$=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),vr=require("react-dom");function br(e){return e.type==="object"&&e.version===1}const xr="ControlSlider-module__wrapper___sHEkd",Sr="ControlSlider-module__hoverArrow___A-dOH",Cr="ControlSlider-module__sliderItem___QQSkR",wr="ControlSlider-module__sliderImage___9hRl-",$r="ControlSlider-module__arrow___05ghY",Tr="ControlSlider-module__arrowVertical___tBfVN",_r="ControlSlider-module__nextArrow___-30Yc",Er="ControlSlider-module__arrowInner___aEra3",Ar="ControlSlider-module__arrowIcon___S4ztF",kr="ControlSlider-module__arrowImg___2dwJW",Lr="ControlSlider-module__mirror___brd6U",Ir="ControlSlider-module__pagination___bicLF",Fr="ControlSlider-module__paginationInner___bT-P-",Pr="ControlSlider-module__paginationVertical___zYqKw",Mr="ControlSlider-module__paginationItem___nTRbk",Rr="ControlSlider-module__dot___p1Qun",Wr="ControlSlider-module__activeDot___LHFaj",Nr="ControlSlider-module__paginationInsideBottom___R3FWn",Vr="ControlSlider-module__paginationInsideTop___V-qb-",Hr="ControlSlider-module__paginationOutsideBottom___14w8D",jr="ControlSlider-module__paginationOutsideTop___SCLqB",zr="ControlSlider-module__paginationInsideLeft___yOBRZ",Or="ControlSlider-module__paginationInsideRight___Rtt3o",Br="ControlSlider-module__paginationOutsideLeft___lahaw",Dr="ControlSlider-module__paginationOutsideRight___EtuQa",qr="ControlSlider-module__imgWrapper___UjEgB",Ur="ControlSlider-module__captionBlock___dJ6-j",Gr="ControlSlider-module__captionTextWrapper___HFlpf",Yr="ControlSlider-module__captionText___uGBVc",Xr="ControlSlider-module__active___WZK4G",Kr="ControlSlider-module__withPointerEvents___t-18M",Zr="ControlSlider-module__topLeftAlignment___zjnGM",Jr="ControlSlider-module__topCenterAlignment___gD1xW",Qr="ControlSlider-module__topRightAlignment___NMapS",ei="ControlSlider-module__middleLeftAlignment___OnUrY",ti="ControlSlider-module__middleCenterAlignment___Tdkl0",ni="ControlSlider-module__middleRightAlignment___wEbfX",oi="ControlSlider-module__bottomLeftAlignment___cTP2-",ri="ControlSlider-module__bottomCenterAlignment___c54fB",ii="ControlSlider-module__bottomRightAlignment___kEwrz",ai="ControlSlider-module__clickOverlay___DZA28",si="ControlSlider-module__contain___pLyq7",li="ControlSlider-module__cover___KdDat",J={wrapper:xr,hoverArrow:Sr,sliderItem:Cr,sliderImage:wr,arrow:$r,arrowVertical:Tr,nextArrow:_r,arrowInner:Er,arrowIcon:Ar,arrowImg:kr,mirror:Lr,pagination:Ir,paginationInner:Fr,paginationVertical:Pr,paginationItem:Mr,dot:Rr,activeDot:Wr,paginationInsideBottom:Nr,paginationInsideTop:Vr,paginationOutsideBottom:Hr,paginationOutsideTop:jr,paginationInsideLeft:zr,paginationInsideRight:Or,paginationOutsideLeft:Br,paginationOutsideRight:Dr,imgWrapper:qr,captionBlock:Ur,captionTextWrapper:Gr,captionText:Yr,active:Xr,withPointerEvents:Kr,topLeftAlignment:Zr,topCenterAlignment:Jr,topRightAlignment:Qr,middleLeftAlignment:ei,middleCenterAlignment:ti,middleRightAlignment:ni,bottomLeftAlignment:oi,bottomCenterAlignment:ri,bottomRightAlignment:ii,clickOverlay:ai,contain:si,cover:li};function ci(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function ui(e,t,n){return t&&ci(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var oo="(prefers-reduced-motion: reduce)",mt=1,pi=2,yt=3,xt=4,Rt=5,Kt=6,en=7,di={CREATED:mt,MOUNTED:pi,IDLE:yt,MOVING:xt,SCROLLING:Rt,DRAGGING:Kt,DESTROYED:en};function Ue(e){e.length=0}function Qe(e,t,n){return Array.prototype.slice.call(e,t,n)}function ve(e){return e.bind.apply(e,[null].concat(Qe(arguments,1)))}var Ao=setTimeout,Tn=function(){};function ro(e){return requestAnimationFrame(e)}function an(e,t){return typeof t===e}function Et(e){return!Rn(e)&&an("object",e)}var Mn=Array.isArray,ko=ve(an,"function"),Ze=ve(an,"string"),Wt=ve(an,"undefined");function Rn(e){return e===null}function Lo(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Nt(e){return Mn(e)?e:[e]}function ke(e,t){Nt(e).forEach(t)}function Wn(e,t){return e.indexOf(t)>-1}function Zt(e,t){return e.push.apply(e,Nt(t)),e}function Be(e,t,n){e&&ke(t,function(o){o&&e.classList[n?"add":"remove"](o)})}function We(e,t){Be(e,Ze(t)?t.split(" "):t,!0)}function Vt(e,t){ke(t,e.appendChild.bind(e))}function Nn(e,t){ke(e,function(n){var o=(t||n).parentNode;o&&o.insertBefore(n,t)})}function At(e,t){return Lo(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Io(e,t){var n=e?Qe(e.children):[];return t?n.filter(function(o){return At(o,t)}):n}function Ht(e,t){return t?Io(e,t)[0]:e.firstElementChild}var kt=Object.keys;function rt(e,t,n){return e&&(n?kt(e).reverse():kt(e)).forEach(function(o){o!=="__proto__"&&t(e[o],o)}),e}function Lt(e){return Qe(arguments,1).forEach(function(t){rt(t,function(n,o){e[o]=t[o]})}),e}function Xe(e){return Qe(arguments,1).forEach(function(t){rt(t,function(n,o){Mn(n)?e[o]=n.slice():Et(n)?e[o]=Xe({},Et(e[o])?e[o]:{},n):e[o]=n})}),e}function io(e,t){ke(t||kt(e),function(n){delete e[n]})}function Ne(e,t){ke(e,function(n){ke(t,function(o){n&&n.removeAttribute(o)})})}function le(e,t,n){Et(t)?rt(t,function(o,r){le(e,r,o)}):ke(e,function(o){Rn(n)||n===""?Ne(o,t):o.setAttribute(t,String(n))})}function gt(e,t,n){var o=document.createElement(e);return t&&(Ze(t)?We(o,t):le(o,t)),n&&Vt(n,o),o}function Ie(e,t,n){if(Wt(n))return getComputedStyle(e)[t];Rn(n)||(e.style[t]=""+n)}function It(e,t){Ie(e,"display",t)}function Fo(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Fe(e,t){return e.getAttribute(t)}function ao(e,t){return e&&e.classList.contains(t)}function Ee(e){return e.getBoundingClientRect()}function it(e){ke(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Po(e){return Ht(new DOMParser().parseFromString(e,"text/html").body)}function Oe(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Mo(e,t){return e&&e.querySelector(t)}function Vn(e,t){return t?Qe(e.querySelectorAll(t)):[]}function De(e,t){Be(e,t,!1)}function _n(e){return e.timeStamp}function ot(e){return Ze(e)?e:e?e+"px":""}var jt="splide",Hn="data-"+jt;function Tt(e,t){if(!e)throw new Error("["+jt+"] "+(t||""))}var Je=Math.min,tn=Math.max,nn=Math.floor,Ft=Math.ceil,_e=Math.abs;function Ro(e,t,n){return _e(e-t)<n}function Jt(e,t,n,o){var r=Je(t,n),a=tn(t,n);return o?r<e&&e<a:r<=e&&e<=a}function pt(e,t,n){var o=Je(t,n),r=tn(t,n);return Je(tn(o,e),r)}function En(e){return+(e>0)-+(e<0)}function An(e,t){return ke(t,function(n){e=e.replace("%s",""+n)}),e}function jn(e){return e<10?"0"+e:""+e}var so={};function mi(e){return""+e+jn(so[e]=(so[e]||0)+1)}function Wo(){var e=[];function t(i,u,c,m){r(i,u,function(l,A,S){var g="addEventListener"in l,p=g?l.removeEventListener.bind(l,A,c,m):l.removeListener.bind(l,c);g?l.addEventListener(A,c,m):l.addListener(c),e.push([l,A,S,c,p])})}function n(i,u,c){r(i,u,function(m,l,A){e=e.filter(function(S){return S[0]===m&&S[1]===l&&S[2]===A&&(!c||S[3]===c)?(S[4](),!1):!0})})}function o(i,u,c){var m,l=!0;return typeof CustomEvent=="function"?m=new CustomEvent(u,{bubbles:l,detail:c}):(m=document.createEvent("CustomEvent"),m.initCustomEvent(u,l,!1,c)),i.dispatchEvent(m),m}function r(i,u,c){ke(i,function(m){m&&ke(u,function(l){l.split(" ").forEach(function(A){var S=A.split(".");c(m,S[0],S[1])})})})}function a(){e.forEach(function(i){i[4]()}),Ue(e)}return{bind:t,unbind:n,dispatch:o,destroy:a}}var et="mounted",kn="ready",Ge="move",St="moved",zn="click",No="active",Vo="inactive",Ho="visible",jo="hidden",Se="refresh",Te="updated",vt="resize",sn="resized",zo="drag",Oo="dragging",Bo="dragged",ln="scroll",st="scrolled",gi="overflow",On="destroy",Do="arrows:mounted",qo="arrows:updated",Uo="pagination:mounted",Go="pagination:updated",Bn="navigation:mounted",Dn="autoplay:play",Yo="autoplay:playing",qn="autoplay:pause",Un="lazyload:loaded",Xo="sk",Ko="sh",on="ei";function be(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Wo();function o(a,i){n.bind(t,Nt(a).join(" "),function(u){i.apply(i,Mn(u.detail)?u.detail:[])})}function r(a){n.dispatch(t,a,Qe(arguments,1))}return e&&e.event.on(On,n.destroy),Lt(n,{bus:t,on:o,off:ve(n.unbind,t),emit:r})}function cn(e,t,n,o){var r=Date.now,a,i=0,u,c=!0,m=0;function l(){if(!c){if(i=e?Je((r()-a)/e,1):1,n&&n(i),i>=1&&(t(),a=r(),o&&++m>=o))return S();u=ro(l)}}function A(h){h||p(),a=r()-(h?i*e:0),c=!1,u=ro(l)}function S(){c=!0}function g(){a=r(),i=0,n&&n(i)}function p(){u&&cancelAnimationFrame(u),i=0,u=0,c=!0}function d(h){e=h}function x(){return c}return{start:A,rewind:g,pause:S,cancel:p,set:d,isPaused:x}}function fi(e){var t=e;function n(r){t=r}function o(r){return Wn(Nt(r),t)}return{set:n,is:o}}function hi(e,t){var n=cn(0,e,null,1);return function(){n.isPaused()&&n.start()}}function yi(e,t,n){var o=e.state,r=n.breakpoints||{},a=n.reducedMotion||{},i=Wo(),u=[];function c(){var p=n.mediaQuery==="min";kt(r).sort(function(d,x){return p?+d-+x:+x-+d}).forEach(function(d){l(r[d],"("+(p?"min":"max")+"-width:"+d+"px)")}),l(a,oo),A()}function m(p){p&&i.destroy()}function l(p,d){var x=matchMedia(d);i.bind(x,"change",A),u.push([p,x])}function A(){var p=o.is(en),d=n.direction,x=u.reduce(function(h,y){return Xe(h,y[1].matches?y[0]:{})},{});io(n),g(x),n.destroy?e.destroy(n.destroy==="completely"):p?(m(!0),e.mount()):d!==n.direction&&e.refresh()}function S(p){matchMedia(oo).matches&&(p?Xe(n,a):io(n,kt(a)))}function g(p,d,x){Xe(n,p),d&&Xe(Object.getPrototypeOf(n),p),(x||!o.is(mt))&&e.emit(Te,n)}return{setup:c,destroy:m,reduce:S,set:g}}var un="Arrow",pn=un+"Left",dn=un+"Right",Zo=un+"Up",Jo=un+"Down",lo="rtl",mn="ttb",bn={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Zo,dn],ArrowRight:[Jo,pn]};function vi(e,t,n){function o(a,i,u){u=u||n.direction;var c=u===lo&&!i?1:u===mn?0:-1;return bn[a]&&bn[a][c]||a.replace(/width|left|right/i,function(m,l){var A=bn[m.toLowerCase()][c]||m;return l>0?A.charAt(0).toUpperCase()+A.slice(1):A})}function r(a){return a*(n.direction===lo?1:-1)}return{resolve:o,orient:r}}var qe="role",ft="tabindex",bi="disabled",Pe="aria-",zt=Pe+"controls",Qo=Pe+"current",co=Pe+"selected",Ae=Pe+"label",Gn=Pe+"labelledby",er=Pe+"hidden",Yn=Pe+"orientation",Pt=Pe+"roledescription",uo=Pe+"live",po=Pe+"busy",mo=Pe+"atomic",Xn=[qe,ft,bi,zt,Qo,Ae,Gn,er,Yn,Pt],Ve=jt+"__",tt="is-",xn=jt,go=Ve+"track",xi=Ve+"list",gn=Ve+"slide",tr=gn+"--clone",Si=gn+"__container",Kn=Ve+"arrows",fn=Ve+"arrow",nr=fn+"--prev",or=fn+"--next",hn=Ve+"pagination",rr=hn+"__page",Ci=Ve+"progress",wi=Ci+"__bar",$i=Ve+"toggle",Ti=Ve+"spinner",_i=Ve+"sr",Ei=tt+"initialized",at=tt+"active",ir=tt+"prev",ar=tt+"next",Ln=tt+"visible",In=tt+"loading",sr=tt+"focus-in",lr=tt+"overflow",Ai=[at,Ln,ir,ar,In,sr,lr],ki={slide:gn,clone:tr,arrows:Kn,arrow:fn,prev:nr,next:or,pagination:hn,page:rr,spinner:Ti};function Li(e,t){if(ko(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!At(n,t);)n=n.parentElement;return n}var Ii=5,fo=200,cr="touchstart mousedown",Sn="touchmove mousemove",Cn="touchend touchcancel mouseup click";function Fi(e,t,n){var o=be(e),r=o.on,a=o.bind,i=e.root,u=n.i18n,c={},m=[],l=[],A=[],S,g,p;function d(){_(),D(),y()}function x(){r(Se,h),r(Se,d),r(Te,y),a(document,cr+" keydown",function(b){p=b.type==="keydown"},{capture:!0}),a(i,"focusin",function(){Be(i,sr,!!p)})}function h(b){var C=Xn.concat("style");Ue(m),De(i,l),De(S,A),Ne([S,g],C),Ne(i,b?C:["style",Pt])}function y(){De(i,l),De(S,A),l=E(xn),A=E(go),We(i,l),We(S,A),le(i,Ae,n.label),le(i,Gn,n.labelledby)}function _(){S=W("."+go),g=Ht(S,"."+xi),Tt(S&&g,"A track/list element is missing."),Zt(m,Io(g,"."+gn+":not(."+tr+")")),rt({arrows:Kn,pagination:hn,prev:nr,next:or,bar:wi,toggle:$i},function(b,C){c[C]=W("."+b)}),Lt(c,{root:i,track:S,list:g,slides:m})}function D(){var b=i.id||mi(jt),C=n.role;i.id=b,S.id=S.id||b+"-track",g.id=g.id||b+"-list",!Fe(i,qe)&&i.tagName!=="SECTION"&&C&&le(i,qe,C),le(i,Pt,u.carousel),le(g,qe,"presentation")}function W(b){var C=Mo(i,b);return C&&Li(C,"."+xn)===i?C:void 0}function E(b){return[b+"--"+n.type,b+"--"+n.direction,n.drag&&b+"--draggable",n.isNavigation&&b+"--nav",b===xn&&at]}return Lt(c,{setup:d,mount:x,destroy:h})}var bt="slide",Ct="loop",Ot="fade";function Pi(e,t,n,o){var r=be(e),a=r.on,i=r.emit,u=r.bind,c=e.Components,m=e.root,l=e.options,A=l.isNavigation,S=l.updateOnMove,g=l.i18n,p=l.pagination,d=l.slideFocus,x=c.Direction.resolve,h=Fe(o,"style"),y=Fe(o,Ae),_=n>-1,D=Ht(o,"."+Si),W;function E(){_||(o.id=m.id+"-slide"+jn(t+1),le(o,qe,p?"tabpanel":"group"),le(o,Pt,g.slide),le(o,Ae,y||An(g.slideLabel,[t+1,e.length]))),b()}function b(){u(o,"click",ve(i,zn,k)),u(o,"keydown",ve(i,Xo,k)),a([St,Ko,st],M),a(Bn,F),S&&a(Ge,j)}function C(){W=!0,r.destroy(),De(o,Ai),Ne(o,Xn),le(o,"style",h),le(o,Ae,y||"")}function F(){var L=e.splides.map(function(T){var R=T.splide.Components.Slides.getAt(t);return R?R.slide.id:""}).join(" ");le(o,Ae,An(g.slideX,(_?n:t)+1)),le(o,zt,L),le(o,qe,d?"button":""),d&&Ne(o,Pt)}function j(){W||M()}function M(){if(!W){var L=e.index;N(),H(),Be(o,ir,t===L-1),Be(o,ar,t===L+1)}}function N(){var L=U();L!==ao(o,at)&&(Be(o,at,L),le(o,Qo,A&&L||""),i(L?No:Vo,k))}function H(){var L=f(),T=!L&&(!U()||_);if(e.state.is([xt,Rt])||le(o,er,T||""),le(Vn(o,l.focusableNodes||""),ft,T?-1:""),d&&le(o,ft,T?-1:0),L!==ao(o,Ln)&&(Be(o,Ln,L),i(L?Ho:jo,k)),!L&&document.activeElement===o){var R=c.Slides.getAt(e.index);R&&Fo(R.slide)}}function B(L,T,R){Ie(R&&D||o,L,T)}function U(){var L=e.index;return L===t||l.cloneStatus&&L===n}function f(){if(e.is(Ot))return U();var L=Ee(c.Elements.track),T=Ee(o),R=x("left",!0),Z=x("right",!0);return nn(L[R])<=Ft(T[R])&&nn(T[Z])<=Ft(L[Z])}function I(L,T){var R=_e(L-t);return!_&&(l.rewind||e.is(Ct))&&(R=Je(R,e.length-R)),R<=T}var k={index:t,slideIndex:n,slide:o,container:D,isClone:_,mount:E,destroy:C,update:M,style:B,isWithin:I};return k}function Mi(e,t,n){var o=be(e),r=o.on,a=o.emit,i=o.bind,u=t.Elements,c=u.slides,m=u.list,l=[];function A(){S(),r(Se,g),r(Se,S)}function S(){c.forEach(function(M,N){d(M,N,-1)})}function g(){W(function(M){M.destroy()}),Ue(l)}function p(){W(function(M){M.update()})}function d(M,N,H){var B=Pi(e,N,H,M);B.mount(),l.push(B),l.sort(function(U,f){return U.index-f.index})}function x(M){return M?E(function(N){return!N.isClone}):l}function h(M){var N=t.Controller,H=N.toIndex(M),B=N.hasFocus()?1:n.perPage;return E(function(U){return Jt(U.index,H,H+B-1)})}function y(M){return E(M)[0]}function _(M,N){ke(M,function(H){if(Ze(H)&&(H=Po(H)),Lo(H)){var B=c[N];B?Nn(H,B):Vt(m,H),We(H,n.classes.slide),C(H,ve(a,vt))}}),a(Se)}function D(M){it(E(M).map(function(N){return N.slide})),a(Se)}function W(M,N){x(N).forEach(M)}function E(M){return l.filter(ko(M)?M:function(N){return Ze(M)?At(N.slide,M):Wn(Nt(M),N.index)})}function b(M,N,H){W(function(B){B.style(M,N,H)})}function C(M,N){var H=Vn(M,"img"),B=H.length;B?H.forEach(function(U){i(U,"load error",function(){--B||N()})}):N()}function F(M){return M?c.length:l.length}function j(){return l.length>n.perPage}return{mount:A,destroy:g,update:p,register:d,get:x,getIn:h,getAt:y,add:_,remove:D,forEach:W,filter:E,style:b,getLength:F,isEnough:j}}function Ri(e,t,n){var o=be(e),r=o.on,a=o.bind,i=o.emit,u=t.Slides,c=t.Direction.resolve,m=t.Elements,l=m.root,A=m.track,S=m.list,g=u.getAt,p=u.style,d,x,h;function y(){_(),a(window,"resize load",hi(ve(i,vt))),r([Te,Se],_),r(vt,D)}function _(){d=n.direction===mn,Ie(l,"maxWidth",ot(n.width)),Ie(A,c("paddingLeft"),W(!1)),Ie(A,c("paddingRight"),W(!0)),D(!0)}function D(k){var L=Ee(l);(k||x.width!==L.width||x.height!==L.height)&&(Ie(A,"height",E()),p(c("marginRight"),ot(n.gap)),p("width",C()),p("height",F(),!0),x=L,i(sn),h!==(h=I())&&(Be(l,lr,h),i(gi,h)))}function W(k){var L=n.padding,T=c(k?"right":"left");return L&&ot(L[T]||(Et(L)?0:L))||"0px"}function E(){var k="";return d&&(k=b(),Tt(k,"height or heightRatio is missing."),k="calc("+k+" - "+W(!1)+" - "+W(!0)+")"),k}function b(){return ot(n.height||Ee(S).width*n.heightRatio)}function C(){return n.autoWidth?null:ot(n.fixedWidth)||(d?"":j())}function F(){return ot(n.fixedHeight)||(d?n.autoHeight?null:j():b())}function j(){var k=ot(n.gap);return"calc((100%"+(k&&" + "+k)+")/"+(n.perPage||1)+(k&&" - "+k)+")"}function M(){return Ee(S)[c("width")]}function N(k,L){var T=g(k||0);return T?Ee(T.slide)[c("width")]+(L?0:U()):0}function H(k,L){var T=g(k);if(T){var R=Ee(T.slide)[c("right")],Z=Ee(S)[c("left")];return _e(R-Z)+(L?0:U())}return 0}function B(k){return H(e.length-1)-H(0)+N(0,k)}function U(){var k=g(0);return k&&parseFloat(Ie(k.slide,c("marginRight")))||0}function f(k){return parseFloat(Ie(A,c("padding"+(k?"Right":"Left"))))||0}function I(){return e.is(Ot)||B(!0)>M()}return{mount:y,resize:D,listSize:M,slideSize:N,sliderSize:B,totalSize:H,getPadding:f,isOverflow:I}}var Wi=2;function Ni(e,t,n){var o=be(e),r=o.on,a=t.Elements,i=t.Slides,u=t.Direction.resolve,c=[],m;function l(){r(Se,A),r([Te,vt],g),(m=x())&&(p(m),t.Layout.resize(!0))}function A(){S(),l()}function S(){it(c),Ue(c),o.destroy()}function g(){var h=x();m!==h&&(m<h||!h)&&o.emit(Se)}function p(h){var y=i.get().slice(),_=y.length;if(_){for(;y.length<h;)Zt(y,y);Zt(y.slice(-h),y.slice(0,h)).forEach(function(D,W){var E=W<h,b=d(D.slide,W);E?Nn(b,y[0].slide):Vt(a.list,b),Zt(c,b),i.register(b,W-h+(E?0:_),D.index)})}}function d(h,y){var _=h.cloneNode(!0);return We(_,n.classes.clone),_.id=e.root.id+"-clone"+jn(y+1),_}function x(){var h=n.clones;if(!e.is(Ct))h=0;else if(Wt(h)){var y=n[u("fixedWidth")]&&t.Layout.slideSize(0),_=y&&Ft(Ee(a.track)[u("width")]/y);h=_||n[u("autoWidth")]&&e.length||n.perPage*Wi}return h}return{mount:l,destroy:S}}function Vi(e,t,n){var o=be(e),r=o.on,a=o.emit,i=e.state.set,u=t.Layout,c=u.slideSize,m=u.getPadding,l=u.totalSize,A=u.listSize,S=u.sliderSize,g=t.Direction,p=g.resolve,d=g.orient,x=t.Elements,h=x.list,y=x.track,_;function D(){_=t.Transition,r([et,sn,Te,Se],W)}function W(){t.Controller.isBusy()||(t.Scroll.cancel(),b(e.index),t.Slides.update())}function E(T,R,Z,ae){T!==R&&k(T>Z)&&(M(),C(j(B(),T>Z),!0)),i(xt),a(Ge,R,Z,T),_.start(R,function(){i(yt),a(St,R,Z,T),ae&&ae()})}function b(T){C(H(T,!0))}function C(T,R){if(!e.is(Ot)){var Z=R?T:F(T);Ie(h,"transform","translate"+p("X")+"("+Z+"px)"),T!==Z&&a(Ko)}}function F(T){if(e.is(Ct)){var R=N(T),Z=R>t.Controller.getEnd(),ae=R<0;(ae||Z)&&(T=j(T,Z))}return T}function j(T,R){var Z=T-I(R),ae=S();return T-=d(ae*(Ft(_e(Z)/ae)||1))*(R?1:-1),T}function M(){C(B(),!0),_.cancel()}function N(T){for(var R=t.Slides.get(),Z=0,ae=1/0,te=0;te<R.length;te++){var ce=R[te].index,P=_e(H(ce,!0)-T);if(P<=ae)ae=P,Z=ce;else break}return Z}function H(T,R){var Z=d(l(T-1)-f(T));return R?U(Z):Z}function B(){var T=p("left");return Ee(h)[T]-Ee(y)[T]+d(m(!1))}function U(T){return n.trimSpace&&e.is(bt)&&(T=pt(T,0,d(S(!0)-A()))),T}function f(T){var R=n.focus;return R==="center"?(A()-c(T,!0))/2:+R*c(T)||0}function I(T){return H(T?t.Controller.getEnd():0,!!n.trimSpace)}function k(T){var R=d(j(B(),T));return T?R>=0:R<=h[p("scrollWidth")]-Ee(y)[p("width")]}function L(T,R){R=Wt(R)?B():R;var Z=T!==!0&&d(R)<d(I(!1)),ae=T!==!1&&d(R)>d(I(!0));return Z||ae}return{mount:D,move:E,jump:b,translate:C,shift:j,cancel:M,toIndex:N,toPosition:H,getPosition:B,getLimit:I,exceededLimit:L,reposition:W}}function Hi(e,t,n){var o=be(e),r=o.on,a=o.emit,i=t.Move,u=i.getPosition,c=i.getLimit,m=i.toPosition,l=t.Slides,A=l.isEnough,S=l.getLength,g=n.omitEnd,p=e.is(Ct),d=e.is(bt),x=ve(B,!1),h=ve(B,!0),y=n.start||0,_,D=y,W,E,b;function C(){F(),r([Te,Se,on],F),r(sn,j)}function F(){W=S(!0),E=n.perMove,b=n.perPage,_=k();var P=pt(y,0,g?_:W-1);P!==y&&(y=P,i.reposition())}function j(){_!==k()&&a(on)}function M(P,ee,fe){if(!ce()){var de=H(P),ge=I(de);ge>-1&&(ee||ge!==y)&&(Z(ge),i.move(de,ge,D,fe))}}function N(P,ee,fe,de){t.Scroll.scroll(P,ee,fe,function(){var ge=I(i.toIndex(u()));Z(g?Je(ge,_):ge),de&&de()})}function H(P){var ee=y;if(Ze(P)){var fe=P.match(/([+\-<>])(\d+)?/)||[],de=fe[1],ge=fe[2];de==="+"||de==="-"?ee=U(y+ +(""+de+(+ge||1)),y):de===">"?ee=ge?L(+ge):x(!0):de==="<"&&(ee=h(!0))}else ee=p?P:pt(P,0,_);return ee}function B(P,ee){var fe=E||(te()?1:b),de=U(y+fe*(P?-1:1),y,!(E||te()));return de===-1&&d&&!Ro(u(),c(!P),1)?P?0:_:ee?de:I(de)}function U(P,ee,fe){if(A()||te()){var de=f(P);de!==P&&(ee=P,P=de,fe=!1),P<0||P>_?!E&&(Jt(0,P,ee,!0)||Jt(_,ee,P,!0))?P=L(T(P)):p?P=fe?P<0?-(W%b||b):W:P:n.rewind?P=P<0?_:0:P=-1:fe&&P!==ee&&(P=L(T(ee)+(P<ee?-1:1)))}else P=-1;return P}function f(P){if(d&&n.trimSpace==="move"&&P!==y)for(var ee=u();ee===m(P,!0)&&Jt(P,0,e.length-1,!n.rewind);)P<y?--P:++P;return P}function I(P){return p?(P+W)%W||0:P}function k(){for(var P=W-(te()||p&&E?1:b);g&&P-- >0;)if(m(W-1,!0)!==m(P,!0)){P++;break}return pt(P,0,W-1)}function L(P){return pt(te()?P:b*P,0,_)}function T(P){return te()?Je(P,_):nn((P>=_?W-1:P)/b)}function R(P){var ee=i.toIndex(P);return d?pt(ee,0,_):ee}function Z(P){P!==y&&(D=y,y=P)}function ae(P){return P?D:y}function te(){return!Wt(n.focus)||n.isNavigation}function ce(){return e.state.is([xt,Rt])&&!!n.waitForTransition}return{mount:C,go:M,scroll:N,getNext:x,getPrev:h,getAdjacent:B,getEnd:k,setIndex:Z,getIndex:ae,toIndex:L,toPage:T,toDest:R,hasFocus:te,isBusy:ce}}var ji="http://www.w3.org/2000/svg",zi="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",qt=40;function Oi(e,t,n){var o=be(e),r=o.on,a=o.bind,i=o.emit,u=n.classes,c=n.i18n,m=t.Elements,l=t.Controller,A=m.arrows,S=m.track,g=A,p=m.prev,d=m.next,x,h,y={};function _(){W(),r(Te,D)}function D(){E(),_()}function W(){var N=n.arrows;N&&!(p&&d)&&F(),p&&d&&(Lt(y,{prev:p,next:d}),It(g,N?"":"none"),We(g,h=Kn+"--"+n.direction),N&&(b(),M(),le([p,d],zt,S.id),i(Do,p,d)))}function E(){o.destroy(),De(g,h),x?(it(A?[p,d]:g),p=d=null):Ne([p,d],Xn)}function b(){r([et,St,Se,st,on],M),a(d,"click",ve(C,">")),a(p,"click",ve(C,"<"))}function C(N){l.go(N,!0)}function F(){g=A||gt("div",u.arrows),p=j(!0),d=j(!1),x=!0,Vt(g,[p,d]),!A&&Nn(g,S)}function j(N){var H='<button class="'+u.arrow+" "+(N?u.prev:u.next)+'" type="button"><svg xmlns="'+ji+'" viewBox="0 0 '+qt+" "+qt+'" width="'+qt+'" height="'+qt+'" focusable="false"><path d="'+(n.arrowPath||zi)+'" />';return Po(H)}function M(){if(p&&d){var N=e.index,H=l.getPrev(),B=l.getNext(),U=H>-1&&N<H?c.last:c.prev,f=B>-1&&N>B?c.first:c.next;p.disabled=H<0,d.disabled=B<0,le(p,Ae,U),le(d,Ae,f),i(qo,p,d,H,B)}}return{arrows:y,mount:_,destroy:E,update:M}}var Bi=Hn+"-interval";function Di(e,t,n){var o=be(e),r=o.on,a=o.bind,i=o.emit,u=cn(n.interval,e.go.bind(e,">"),b),c=u.isPaused,m=t.Elements,l=t.Elements,A=l.root,S=l.toggle,g=n.autoplay,p,d,x=g==="pause";function h(){g&&(y(),S&&le(S,zt,m.track.id),x||_(),E())}function y(){n.pauseOnHover&&a(A,"mouseenter mouseleave",function(F){p=F.type==="mouseenter",W()}),n.pauseOnFocus&&a(A,"focusin focusout",function(F){d=F.type==="focusin",W()}),S&&a(S,"click",function(){x?_():D(!0)}),r([Ge,ln,Se],u.rewind),r(Ge,C)}function _(){c()&&t.Slides.isEnough()&&(u.start(!n.resetProgress),d=p=x=!1,E(),i(Dn))}function D(F){F===void 0&&(F=!0),x=!!F,E(),c()||(u.pause(),i(qn))}function W(){x||(p||d?D(!1):_())}function E(){S&&(Be(S,at,!x),le(S,Ae,n.i18n[x?"play":"pause"]))}function b(F){var j=m.bar;j&&Ie(j,"width",F*100+"%"),i(Yo,F)}function C(F){var j=t.Slides.getAt(F);u.set(j&&+Fe(j.slide,Bi)||n.interval)}return{mount:h,destroy:u.cancel,play:_,pause:D,isPaused:c}}function qi(e,t,n){var o=be(e),r=o.on;function a(){n.cover&&(r(Un,ve(u,!0)),r([et,Te,Se],ve(i,!0)))}function i(c){t.Slides.forEach(function(m){var l=Ht(m.container||m.slide,"img");l&&l.src&&u(c,l,m)})}function u(c,m,l){l.style("background",c?'center/cover no-repeat url("'+m.src+'")':"",!0),It(m,c?"none":"")}return{mount:a,destroy:ve(i,!1)}}var Ui=10,Gi=600,Yi=.6,Xi=1.5,Ki=800;function Zi(e,t,n){var o=be(e),r=o.on,a=o.emit,i=e.state.set,u=t.Move,c=u.getPosition,m=u.getLimit,l=u.exceededLimit,A=u.translate,S=e.is(bt),g,p,d=1;function x(){r(Ge,D),r([Te,Se],W)}function h(b,C,F,j,M){var N=c();if(D(),F&&(!S||!l())){var H=t.Layout.sliderSize(),B=En(b)*H*nn(_e(b)/H)||0;b=u.toPosition(t.Controller.toDest(b%H))+B}var U=Ro(N,b,1);d=1,C=U?0:C||tn(_e(b-N)/Xi,Ki),p=j,g=cn(C,y,ve(_,N,b,M),1),i(Rt),a(ln),g.start()}function y(){i(yt),p&&p(),a(st)}function _(b,C,F,j){var M=c(),N=b+(C-b)*E(j),H=(N-M)*d;A(M+H),S&&!F&&l()&&(d*=Yi,_e(H)<Ui&&h(m(l(!0)),Gi,!1,p,!0))}function D(){g&&g.cancel()}function W(){g&&!g.isPaused()&&(D(),y())}function E(b){var C=n.easingFunc;return C?C(b):1-Math.pow(1-b,4)}return{mount:x,destroy:D,scroll:h,cancel:W}}var dt={passive:!1,capture:!0};function Ji(e,t,n){var o=be(e),r=o.on,a=o.emit,i=o.bind,u=o.unbind,c=e.state,m=t.Move,l=t.Scroll,A=t.Controller,S=t.Elements.track,g=t.Media.reduce,p=t.Direction,d=p.resolve,x=p.orient,h=m.getPosition,y=m.exceededLimit,_,D,W,E,b,C=!1,F,j,M;function N(){i(S,Sn,Tn,dt),i(S,Cn,Tn,dt),i(S,cr,B,dt),i(S,"click",I,{capture:!0}),i(S,"dragstart",Oe),r([et,Te],H)}function H(){var V=n.drag;me(!V),E=V==="free"}function B(V){if(F=!1,!j){var v=ge(V);de(V.target)&&(v||!V.button)&&(A.isBusy()?Oe(V,!0):(M=v?S:window,b=c.is([xt,Rt]),W=null,i(M,Sn,U,dt),i(M,Cn,f,dt),m.cancel(),l.cancel(),k(V)))}}function U(V){if(c.is(Kt)||(c.set(Kt),a(zo)),V.cancelable)if(b){m.translate(_+fe(te(V)));var v=ce(V)>fo,q=C!==(C=y());(v||q)&&k(V),F=!0,a(Oo),Oe(V)}else R(V)&&(b=T(V),Oe(V))}function f(V){c.is(Kt)&&(c.set(yt),a(Bo)),b&&(L(V),Oe(V)),u(M,Sn,U),u(M,Cn,f),b=!1}function I(V){!j&&F&&Oe(V,!0)}function k(V){W=D,D=V,_=h()}function L(V){var v=Z(V),q=ae(v),K=n.rewind&&n.rewindByDrag;g(!1),E?A.scroll(q,0,n.snap):e.is(Ot)?A.go(x(En(v))<0?K?"<":"-":K?">":"+"):e.is(bt)&&C&&K?A.go(y(!0)?">":"<"):A.go(A.toDest(q),!0),g(!0)}function T(V){var v=n.dragMinThreshold,q=Et(v),K=q&&v.mouse||0,Q=(q?v.touch:+v)||10;return _e(te(V))>(ge(V)?Q:K)}function R(V){return _e(te(V))>_e(te(V,!0))}function Z(V){if(e.is(Ct)||!C){var v=ce(V);if(v&&v<fo)return te(V)/v}return 0}function ae(V){return h()+En(V)*Je(_e(V)*(n.flickPower||600),E?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function te(V,v){return ee(V,v)-ee(P(V),v)}function ce(V){return _n(V)-_n(P(V))}function P(V){return D===V&&W||D}function ee(V,v){return(ge(V)?V.changedTouches[0]:V)["page"+d(v?"Y":"X")]}function fe(V){return V/(C&&e.is(bt)?Ii:1)}function de(V){var v=n.noDrag;return!At(V,"."+rr+", ."+fn)&&(!v||!At(V,v))}function ge(V){return typeof TouchEvent<"u"&&V instanceof TouchEvent}function G(){return b}function me(V){j=V}return{mount:N,disable:me,isDragging:G}}var Qi={Spacebar:" ",Right:dn,Left:pn,Up:Zo,Down:Jo};function Zn(e){return e=Ze(e)?e:e.key,Qi[e]||e}var ho="keydown";function ea(e,t,n){var o=be(e),r=o.on,a=o.bind,i=o.unbind,u=e.root,c=t.Direction.resolve,m,l;function A(){S(),r(Te,g),r(Te,S),r(Ge,d)}function S(){var h=n.keyboard;h&&(m=h==="global"?window:u,a(m,ho,x))}function g(){i(m,ho)}function p(h){l=h}function d(){var h=l;l=!0,Ao(function(){l=h})}function x(h){if(!l){var y=Zn(h);y===c(pn)?e.go("<"):y===c(dn)&&e.go(">")}}return{mount:A,destroy:g,disable:p}}var _t=Hn+"-lazy",Qt=_t+"-srcset",ta="["+_t+"], ["+Qt+"]";function na(e,t,n){var o=be(e),r=o.on,a=o.off,i=o.bind,u=o.emit,c=n.lazyLoad==="sequential",m=[St,st],l=[];function A(){n.lazyLoad&&(S(),r(Se,S))}function S(){Ue(l),g(),c?h():(a(m),r(m,p),p())}function g(){t.Slides.forEach(function(y){Vn(y.slide,ta).forEach(function(_){var D=Fe(_,_t),W=Fe(_,Qt);if(D!==_.src||W!==_.srcset){var E=n.classes.spinner,b=_.parentElement,C=Ht(b,"."+E)||gt("span",E,b);l.push([_,y,C]),_.src||It(_,"none")}})})}function p(){l=l.filter(function(y){var _=n.perPage*((n.preloadPages||1)+1)-1;return y[1].isWithin(e.index,_)?d(y):!0}),l.length||a(m)}function d(y){var _=y[0];We(y[1].slide,In),i(_,"load error",ve(x,y)),le(_,"src",Fe(_,_t)),le(_,"srcset",Fe(_,Qt)),Ne(_,_t),Ne(_,Qt)}function x(y,_){var D=y[0],W=y[1];De(W.slide,In),_.type!=="error"&&(it(y[2]),It(D,""),u(Un,D,W),u(vt)),c&&h()}function h(){l.length&&d(l.shift())}return{mount:A,destroy:ve(Ue,l),check:p}}function oa(e,t,n){var o=be(e),r=o.on,a=o.emit,i=o.bind,u=t.Slides,c=t.Elements,m=t.Controller,l=m.hasFocus,A=m.getIndex,S=m.go,g=t.Direction.resolve,p=c.pagination,d=[],x,h;function y(){_(),r([Te,Se,on],y);var j=n.pagination;p&&It(p,j?"":"none"),j&&(r([Ge,ln,st],F),D(),F(),a(Uo,{list:x,items:d},C(e.index)))}function _(){x&&(it(p?Qe(x.children):x),De(x,h),Ue(d),x=null),o.destroy()}function D(){var j=e.length,M=n.classes,N=n.i18n,H=n.perPage,B=l()?m.getEnd()+1:Ft(j/H);x=p||gt("ul",M.pagination,c.track.parentElement),We(x,h=hn+"--"+b()),le(x,qe,"tablist"),le(x,Ae,N.select),le(x,Yn,b()===mn?"vertical":"");for(var U=0;U<B;U++){var f=gt("li",null,x),I=gt("button",{class:M.page,type:"button"},f),k=u.getIn(U).map(function(T){return T.slide.id}),L=!l()&&H>1?N.pageX:N.slideX;i(I,"click",ve(W,U)),n.paginationKeyboard&&i(I,"keydown",ve(E,U)),le(f,qe,"presentation"),le(I,qe,"tab"),le(I,zt,k.join(" ")),le(I,Ae,An(L,U+1)),le(I,ft,-1),d.push({li:f,button:I,page:U})}}function W(j){S(">"+j,!0)}function E(j,M){var N=d.length,H=Zn(M),B=b(),U=-1;H===g(dn,!1,B)?U=++j%N:H===g(pn,!1,B)?U=(--j+N)%N:H==="Home"?U=0:H==="End"&&(U=N-1);var f=d[U];f&&(Fo(f.button),S(">"+U),Oe(M,!0))}function b(){return n.paginationDirection||n.direction}function C(j){return d[m.toPage(j)]}function F(){var j=C(A(!0)),M=C(A());if(j){var N=j.button;De(N,at),Ne(N,co),le(N,ft,-1)}if(M){var H=M.button;We(H,at),le(H,co,!0),le(H,ft,"")}a(Go,{list:x,items:d},j,M)}return{items:d,mount:y,destroy:_,getAt:C,update:F}}var ra=[" ","Enter"];function ia(e,t,n){var o=n.isNavigation,r=n.slideFocus,a=[];function i(){e.splides.forEach(function(p){p.isParent||(m(e,p.splide),m(p.splide,e))}),o&&l()}function u(){a.forEach(function(p){p.destroy()}),Ue(a)}function c(){u(),i()}function m(p,d){var x=be(p);x.on(Ge,function(h,y,_){d.go(d.is(Ct)?_:h)}),a.push(x)}function l(){var p=be(e),d=p.on;d(zn,S),d(Xo,g),d([et,Te],A),a.push(p),p.emit(Bn,e.splides)}function A(){le(t.Elements.list,Yn,n.direction===mn?"vertical":"")}function S(p){e.go(p.index)}function g(p,d){Wn(ra,Zn(d))&&(S(p),Oe(d))}return{setup:ve(t.Media.set,{slideFocus:Wt(r)?o:r},!0),mount:i,destroy:u,remount:c}}function aa(e,t,n){var o=be(e),r=o.bind,a=0;function i(){n.wheel&&r(t.Elements.track,"wheel",u,dt)}function u(m){if(m.cancelable){var l=m.deltaY,A=l<0,S=_n(m),g=n.wheelMinThreshold||0,p=n.wheelSleep||0;_e(l)>g&&S-a>p&&(e.go(A?"<":">"),a=S),c(A)&&Oe(m)}}function c(m){return!n.releaseWheel||e.state.is(xt)||t.Controller.getAdjacent(m)!==-1}return{mount:i}}var sa=90;function la(e,t,n){var o=be(e),r=o.on,a=t.Elements.track,i=n.live&&!n.isNavigation,u=gt("span",_i),c=cn(sa,ve(l,!1));function m(){i&&(S(!t.Autoplay.isPaused()),le(a,mo,!0),u.textContent="…",r(Dn,ve(S,!0)),r(qn,ve(S,!1)),r([St,st],ve(l,!0)))}function l(g){le(a,po,g),g?(Vt(a,u),c.start()):(it(u),c.cancel())}function A(){Ne(a,[uo,mo,po]),it(u)}function S(g){i&&le(a,uo,g?"off":"polite")}return{mount:m,disable:S,destroy:A}}var ca=Object.freeze({__proto__:null,Media:yi,Direction:vi,Elements:Fi,Slides:Mi,Layout:Ri,Clones:Ni,Move:Vi,Controller:Hi,Arrows:Oi,Autoplay:Di,Cover:qi,Scroll:Zi,Drag:Ji,Keyboard:ea,LazyLoad:na,Pagination:oa,Sync:ia,Wheel:aa,Live:la}),ua={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"},pa={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:ua,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function da(e,t,n){var o=t.Slides;function r(){be(e).on([et,Se],a)}function a(){o.forEach(function(u){u.style("transform","translateX(-"+100*u.index+"%)")})}function i(u,c){o.style("transition","opacity "+n.speed+"ms "+n.easing),Ao(c)}return{mount:r,start:i,cancel:Tn}}function ma(e,t,n){var o=t.Move,r=t.Controller,a=t.Scroll,i=t.Elements.list,u=ve(Ie,i,"transition"),c;function m(){be(e).bind(i,"transitionend",function(g){g.target===i&&c&&(A(),c())})}function l(g,p){var d=o.toPosition(g,!0),x=o.getPosition(),h=S(g);_e(d-x)>=1&&h>=1?n.useScroll?a.scroll(d,h,!1,p):(u("transform "+h+"ms "+n.easing),o.translate(d,!0),c=p):(o.jump(g),p())}function A(){u(""),a.cancel()}function S(g){var p=n.rewindSpeed;if(e.is(bt)&&p){var d=r.getIndex(!0),x=r.getEnd();if(d===0&&g>=x||d>=x&&g===0)return p}return n.speed}return{mount:m,start:l,cancel:A}}var ga=(function(){function e(n,o){this.event=be(),this.Components={},this.state=fi(mt),this.splides=[],this._o={},this._E={};var r=Ze(n)?Mo(document,n):n;Tt(r,r+" is invalid."),this.root=r,o=Xe({label:Fe(r,Ae)||"",labelledby:Fe(r,Gn)||""},pa,e.defaults,o||{});try{Xe(o,JSON.parse(Fe(r,Hn)))}catch{Tt(!1,"Invalid JSON")}this._o=Object.create(Xe({},o))}var t=e.prototype;return t.mount=function(o,r){var a=this,i=this.state,u=this.Components;Tt(i.is([mt,en]),"Already mounted!"),i.set(mt),this._C=u,this._T=r||this._T||(this.is(Ot)?da:ma),this._E=o||this._E;var c=Lt({},ca,this._E,{Transition:this._T});return rt(c,function(m,l){var A=m(a,u,a._o);u[l]=A,A.setup&&A.setup()}),rt(u,function(m){m.mount&&m.mount()}),this.emit(et),We(this.root,Ei),i.set(yt),this.emit(kn),this},t.sync=function(o){return this.splides.push({splide:o}),o.splides.push({splide:this,isParent:!0}),this.state.is(yt)&&(this._C.Sync.remount(),o.Components.Sync.remount()),this},t.go=function(o){return this._C.Controller.go(o),this},t.on=function(o,r){return this.event.on(o,r),this},t.off=function(o){return this.event.off(o),this},t.emit=function(o){var r;return(r=this.event).emit.apply(r,[o].concat(Qe(arguments,1))),this},t.add=function(o,r){return this._C.Slides.add(o,r),this},t.remove=function(o){return this._C.Slides.remove(o),this},t.is=function(o){return this._o.type===o},t.refresh=function(){return this.emit(Se),this},t.destroy=function(o){o===void 0&&(o=!0);var r=this.event,a=this.state;return a.is(mt)?be(this).on(kn,this.destroy.bind(this,o)):(rt(this._C,function(i){i.destroy&&i.destroy(o)},!0),r.emit(On),r.destroy(),o&&Ue(this.splides),a.set(en)),this},ui(e,[{key:"options",get:function(){return this._o},set:function(o){this._C.Media.set(o,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),Jn=ga;Jn.defaults={};Jn.STATES=di;var yo=[[et,"onMounted"],[kn,"onReady"],[Ge,"onMove"],[St,"onMoved"],[zn,"onClick"],[No,"onActive"],[Vo,"onInactive"],[Ho,"onVisible"],[jo,"onHidden"],[Se,"onRefresh"],[Te,"onUpdated"],[vt,"onResize"],[sn,"onResized"],[zo,"onDrag"],[Oo,"onDragging"],[Bo,"onDragged"],[ln,"onScroll"],[st,"onScrolled"],[On,"onDestroy"],[Do,"onArrowsMounted"],[qo,"onArrowsUpdated"],[Uo,"onPaginationMounted"],[Go,"onPaginationUpdated"],[Bn,"onNavigationMounted"],[Dn,"onAutoplayPlay"],[Yo,"onAutoplayPlaying"],[qn,"onAutoplayPause"],[Un,"onLazyLoadLoaded"]];function Qn(...e){return e.filter(Boolean).join(" ")}function rn(e){return e!==null&&typeof e=="object"}function Fn(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,o)=>!Fn(n,t[o]));if(rn(e)&&rn(t)){const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&!n.some(r=>!Object.prototype.hasOwnProperty.call(t,r)||!Fn(e[r],t[r]))}return e===t}function fa(e,t){return e.length===t.length&&!e.some((n,o)=>n!==t[o])}function ha(e,t){if(e){const n=Object.keys(e);for(let o=0;o<n.length;o++){const r=n[o];if(r!=="__proto__"&&t(e[r],r)===!1)break}}return e}function Pn(e,t){const n=e;return ha(t,(o,r)=>{Array.isArray(o)?n[r]=o.slice():rn(o)?n[r]=Pn(rn(n[r])?n[r]:{},o):n[r]=o}),n}var ya=({children:e,className:t,...n})=>w.createElement("div",{className:Qn("splide__track",t),...n},w.createElement("ul",{className:"splide__list"},e)),ur=class extends w.Component{constructor(){super(...arguments),this.splideRef=w.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:o}=this.splideRef;o&&(this.splide=new Jn(o,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Pn({},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&&!Fn(this.options,e)&&(this.splide.options=e,this.options=Pn({},e));const t=this.getSlides();fa(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){yo.forEach(([t,n])=>{const o=this.props[n];typeof o=="function"&&e.on(t,(...r)=>{o(e,...r)})})}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:o,...r}=this.props;return w.createElement(t,{className:Qn("splide",e),ref:this.splideRef,...this.omit(r,["options",...yo.map(a=>a[1])])},n?w.createElement(ya,null,o):o)}},pr=({children:e,className:t,...n})=>w.createElement("li",{className:Qn("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),h=require("react"),he=require("classnames"),_=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),br=require("react-dom");function xr(e){return e.type==="object"&&e.version===1}const Sr="ControlSlider-module__wrapper___sHEkd",wr="ControlSlider-module__hoverArrow___A-dOH",Cr="ControlSlider-module__sliderItem___QQSkR",$r="ControlSlider-module__sliderImage___9hRl-",Tr="ControlSlider-module__arrow___05ghY",_r="ControlSlider-module__arrowVertical___tBfVN",Er="ControlSlider-module__nextArrow___-30Yc",kr="ControlSlider-module__arrowInner___aEra3",Ir="ControlSlider-module__arrowIcon___S4ztF",Ar="ControlSlider-module__arrowImg___2dwJW",Lr="ControlSlider-module__mirror___brd6U",Fr="ControlSlider-module__pagination___bicLF",Mr="ControlSlider-module__paginationInner___bT-P-",Rr="ControlSlider-module__paginationVertical___zYqKw",Pr="ControlSlider-module__paginationItem___nTRbk",Wr="ControlSlider-module__dot___p1Qun",Nr="ControlSlider-module__activeDot___LHFaj",Hr="ControlSlider-module__paginationInsideBottom___R3FWn",jr="ControlSlider-module__paginationInsideTop___V-qb-",Vr="ControlSlider-module__paginationOutsideBottom___14w8D",Or="ControlSlider-module__paginationOutsideTop___SCLqB",zr="ControlSlider-module__paginationInsideLeft___yOBRZ",Br="ControlSlider-module__paginationInsideRight___Rtt3o",Dr="ControlSlider-module__paginationOutsideLeft___lahaw",qr="ControlSlider-module__paginationOutsideRight___EtuQa",Ur="ControlSlider-module__imgWrapper___UjEgB",Kr="ControlSlider-module__captionBlock___dJ6-j",Gr="ControlSlider-module__captionTextWrapper___HFlpf",Yr="ControlSlider-module__captionText___uGBVc",Xr="ControlSlider-module__active___WZK4G",Zr="ControlSlider-module__withPointerEvents___t-18M",Jr="ControlSlider-module__topLeftAlignment___zjnGM",Qr="ControlSlider-module__topCenterAlignment___gD1xW",ei="ControlSlider-module__topRightAlignment___NMapS",ti="ControlSlider-module__middleLeftAlignment___OnUrY",ni="ControlSlider-module__middleCenterAlignment___Tdkl0",oi="ControlSlider-module__middleRightAlignment___wEbfX",ri="ControlSlider-module__bottomLeftAlignment___cTP2-",ii="ControlSlider-module__bottomCenterAlignment___c54fB",ai="ControlSlider-module__bottomRightAlignment___kEwrz",si="ControlSlider-module__clickOverlay___DZA28",li="ControlSlider-module__contain___pLyq7",ci="ControlSlider-module__cover___KdDat",oe={wrapper:Sr,hoverArrow:wr,sliderItem:Cr,sliderImage:$r,arrow:Tr,arrowVertical:_r,nextArrow:Er,arrowInner:kr,arrowIcon:Ir,arrowImg:Ar,mirror:Lr,pagination:Fr,paginationInner:Mr,paginationVertical:Rr,paginationItem:Pr,dot:Wr,activeDot:Nr,paginationInsideBottom:Hr,paginationInsideTop:jr,paginationOutsideBottom:Vr,paginationOutsideTop:Or,paginationInsideLeft:zr,paginationInsideRight:Br,paginationOutsideLeft:Dr,paginationOutsideRight:qr,imgWrapper:Ur,captionBlock:Kr,captionTextWrapper:Gr,captionText:Yr,active:Xr,withPointerEvents:Zr,topLeftAlignment:Jr,topCenterAlignment:Qr,topRightAlignment:ei,middleLeftAlignment:ti,middleCenterAlignment:ni,middleRightAlignment:oi,bottomLeftAlignment:ri,bottomCenterAlignment:ii,bottomRightAlignment:ai,clickOverlay:si,contain:li,cover:ci};function ui(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function pi(e,t,n){return t&&ui(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var oo="(prefers-reduced-motion: reduce)",mt=1,di=2,yt=3,xt=4,Pt=5,Xt=6,en=7,mi={CREATED:mt,MOUNTED:di,IDLE:yt,MOVING:xt,SCROLLING:Pt,DRAGGING:Xt,DESTROYED:en};function Ue(e){e.length=0}function Qe(e,t,n){return Array.prototype.slice.call(e,t,n)}function ve(e){return e.bind.apply(e,[null].concat(Qe(arguments,1)))}var Io=setTimeout,Tn=function(){};function ro(e){return requestAnimationFrame(e)}function an(e,t){return typeof t===e}function Et(e){return!Pn(e)&&an("object",e)}var Rn=Array.isArray,Ao=ve(an,"function"),Ze=ve(an,"string"),Wt=ve(an,"undefined");function Pn(e){return e===null}function Lo(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Nt(e){return Rn(e)?e:[e]}function Ie(e,t){Nt(e).forEach(t)}function Wn(e,t){return e.indexOf(t)>-1}function Zt(e,t){return e.push.apply(e,Nt(t)),e}function Be(e,t,n){e&&Ie(t,function(o){o&&e.classList[n?"add":"remove"](o)})}function We(e,t){Be(e,Ze(t)?t.split(" "):t,!0)}function Ht(e,t){Ie(t,e.appendChild.bind(e))}function Nn(e,t){Ie(e,function(n){var o=(t||n).parentNode;o&&o.insertBefore(n,t)})}function kt(e,t){return Lo(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Fo(e,t){var n=e?Qe(e.children):[];return t?n.filter(function(o){return kt(o,t)}):n}function jt(e,t){return t?Fo(e,t)[0]:e.firstElementChild}var It=Object.keys;function rt(e,t,n){return e&&(n?It(e).reverse():It(e)).forEach(function(o){o!=="__proto__"&&t(e[o],o)}),e}function At(e){return Qe(arguments,1).forEach(function(t){rt(t,function(n,o){e[o]=t[o]})}),e}function Ye(e){return Qe(arguments,1).forEach(function(t){rt(t,function(n,o){Rn(n)?e[o]=n.slice():Et(n)?e[o]=Ye({},Et(e[o])?e[o]:{},n):e[o]=n})}),e}function io(e,t){Ie(t||It(e),function(n){delete e[n]})}function Ne(e,t){Ie(e,function(n){Ie(t,function(o){n&&n.removeAttribute(o)})})}function de(e,t,n){Et(t)?rt(t,function(o,r){de(e,r,o)}):Ie(e,function(o){Pn(n)||n===""?Ne(o,t):o.setAttribute(t,String(n))})}function gt(e,t,n){var o=document.createElement(e);return t&&(Ze(t)?We(o,t):de(o,t)),n&&Ht(n,o),o}function Le(e,t,n){if(Wt(n))return getComputedStyle(e)[t];Pn(n)||(e.style[t]=""+n)}function Lt(e,t){Le(e,"display",t)}function Mo(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Fe(e,t){return e.getAttribute(t)}function ao(e,t){return e&&e.classList.contains(t)}function Ee(e){return e.getBoundingClientRect()}function it(e){Ie(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Ro(e){return jt(new DOMParser().parseFromString(e,"text/html").body)}function ze(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Po(e,t){return e&&e.querySelector(t)}function Hn(e,t){return t?Qe(e.querySelectorAll(t)):[]}function De(e,t){Be(e,t,!1)}function _n(e){return e.timeStamp}function ot(e){return Ze(e)?e:e?e+"px":""}var Vt="splide",jn="data-"+Vt;function Tt(e,t){if(!e)throw new Error("["+Vt+"] "+(t||""))}var Je=Math.min,tn=Math.max,nn=Math.floor,Ft=Math.ceil,_e=Math.abs;function Wo(e,t,n){return _e(e-t)<n}function Jt(e,t,n,o){var r=Je(t,n),s=tn(t,n);return o?r<e&&e<s:r<=e&&e<=s}function pt(e,t,n){var o=Je(t,n),r=tn(t,n);return Je(tn(o,e),r)}function En(e){return+(e>0)-+(e<0)}function kn(e,t){return Ie(t,function(n){e=e.replace("%s",""+n)}),e}function Vn(e){return e<10?"0"+e:""+e}var so={};function gi(e){return""+e+Vn(so[e]=(so[e]||0)+1)}function No(){var e=[];function t(i,u,l,m){r(i,u,function(c,T,S){var g="addEventListener"in c,p=g?c.removeEventListener.bind(c,T,l,m):c.removeListener.bind(c,l);g?c.addEventListener(T,l,m):c.addListener(l),e.push([c,T,S,l,p])})}function n(i,u,l){r(i,u,function(m,c,T){e=e.filter(function(S){return S[0]===m&&S[1]===c&&S[2]===T&&(!l||S[3]===l)?(S[4](),!1):!0})})}function o(i,u,l){var m,c=!0;return typeof CustomEvent=="function"?m=new CustomEvent(u,{bubbles:c,detail:l}):(m=document.createEvent("CustomEvent"),m.initCustomEvent(u,c,!1,l)),i.dispatchEvent(m),m}function r(i,u,l){Ie(i,function(m){m&&Ie(u,function(c){c.split(" ").forEach(function(T){var S=T.split(".");l(m,S[0],S[1])})})})}function s(){e.forEach(function(i){i[4]()}),Ue(e)}return{bind:t,unbind:n,dispatch:o,destroy:s}}var et="mounted",In="ready",Ke="move",St="moved",On="click",Ho="active",jo="inactive",Vo="visible",Oo="hidden",Se="refresh",Te="updated",vt="resize",sn="resized",zo="drag",Bo="dragging",Do="dragged",ln="scroll",st="scrolled",fi="overflow",zn="destroy",qo="arrows:mounted",Uo="arrows:updated",Ko="pagination:mounted",Go="pagination:updated",Bn="navigation:mounted",Dn="autoplay:play",Yo="autoplay:playing",qn="autoplay:pause",Un="lazyload:loaded",Xo="sk",Zo="sh",on="ei";function be(e){var t=e?e.event.bus:document.createDocumentFragment(),n=No();function o(s,i){n.bind(t,Nt(s).join(" "),function(u){i.apply(i,Rn(u.detail)?u.detail:[])})}function r(s){n.dispatch(t,s,Qe(arguments,1))}return e&&e.event.on(zn,n.destroy),At(n,{bus:t,on:o,off:ve(n.unbind,t),emit:r})}function cn(e,t,n,o){var r=Date.now,s,i=0,u,l=!0,m=0;function c(){if(!l){if(i=e?Je((r()-s)/e,1):1,n&&n(i),i>=1&&(t(),s=r(),o&&++m>=o))return S();u=ro(c)}}function T(y){y||p(),s=r()-(y?i*e:0),l=!1,u=ro(c)}function S(){l=!0}function g(){s=r(),i=0,n&&n(i)}function p(){u&&cancelAnimationFrame(u),i=0,u=0,l=!0}function d(y){e=y}function x(){return l}return{start:T,rewind:g,pause:S,cancel:p,set:d,isPaused:x}}function hi(e){var t=e;function n(r){t=r}function o(r){return Wn(Nt(r),t)}return{set:n,is:o}}function yi(e,t){var n=cn(0,e,null,1);return function(){n.isPaused()&&n.start()}}function vi(e,t,n){var o=e.state,r=n.breakpoints||{},s=n.reducedMotion||{},i=No(),u=[];function l(){var p=n.mediaQuery==="min";It(r).sort(function(d,x){return p?+d-+x:+x-+d}).forEach(function(d){c(r[d],"("+(p?"min":"max")+"-width:"+d+"px)")}),c(s,oo),T()}function m(p){p&&i.destroy()}function c(p,d){var x=matchMedia(d);i.bind(x,"change",T),u.push([p,x])}function T(){var p=o.is(en),d=n.direction,x=u.reduce(function(y,b){return Ye(y,b[1].matches?b[0]:{})},{});io(n),g(x),n.destroy?e.destroy(n.destroy==="completely"):p?(m(!0),e.mount()):d!==n.direction&&e.refresh()}function S(p){matchMedia(oo).matches&&(p?Ye(n,s):io(n,It(s)))}function g(p,d,x){Ye(n,p),d&&Ye(Object.getPrototypeOf(n),p),(x||!o.is(mt))&&e.emit(Te,n)}return{setup:l,destroy:m,reduce:S,set:g}}var un="Arrow",pn=un+"Left",dn=un+"Right",Jo=un+"Up",Qo=un+"Down",lo="rtl",mn="ttb",bn={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Jo,dn],ArrowRight:[Qo,pn]};function bi(e,t,n){function o(s,i,u){u=u||n.direction;var l=u===lo&&!i?1:u===mn?0:-1;return bn[s]&&bn[s][l]||s.replace(/width|left|right/i,function(m,c){var T=bn[m.toLowerCase()][l]||m;return c>0?T.charAt(0).toUpperCase()+T.slice(1):T})}function r(s){return s*(n.direction===lo?1:-1)}return{resolve:o,orient:r}}var qe="role",ft="tabindex",xi="disabled",Me="aria-",Ot=Me+"controls",er=Me+"current",co=Me+"selected",ke=Me+"label",Kn=Me+"labelledby",tr=Me+"hidden",Gn=Me+"orientation",Mt=Me+"roledescription",uo=Me+"live",po=Me+"busy",mo=Me+"atomic",Yn=[qe,ft,xi,Ot,er,ke,Kn,tr,Gn,Mt],He=Vt+"__",tt="is-",xn=Vt,go=He+"track",Si=He+"list",gn=He+"slide",nr=gn+"--clone",wi=gn+"__container",Xn=He+"arrows",fn=He+"arrow",or=fn+"--prev",rr=fn+"--next",hn=He+"pagination",ir=hn+"__page",Ci=He+"progress",$i=Ci+"__bar",Ti=He+"toggle",_i=He+"spinner",Ei=He+"sr",ki=tt+"initialized",at=tt+"active",ar=tt+"prev",sr=tt+"next",An=tt+"visible",Ln=tt+"loading",lr=tt+"focus-in",cr=tt+"overflow",Ii=[at,An,ar,sr,Ln,lr,cr],Ai={slide:gn,clone:nr,arrows:Xn,arrow:fn,prev:or,next:rr,pagination:hn,page:ir,spinner:_i};function Li(e,t){if(Ao(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!kt(n,t);)n=n.parentElement;return n}var Fi=5,fo=200,ur="touchstart mousedown",Sn="touchmove mousemove",wn="touchend touchcancel mouseup click";function Mi(e,t,n){var o=be(e),r=o.on,s=o.bind,i=e.root,u=n.i18n,l={},m=[],c=[],T=[],S,g,p;function d(){E(),K(),b()}function x(){r(Se,y),r(Se,d),r(Te,b),s(document,ur+" keydown",function(w){p=w.type==="keydown"},{capture:!0}),s(i,"focusin",function(){Be(i,lr,!!p)})}function y(w){var C=Yn.concat("style");Ue(m),De(i,c),De(S,T),Ne([S,g],C),Ne(i,w?C:["style",Mt])}function b(){De(i,c),De(S,T),c=I(xn),T=I(go),We(i,c),We(S,T),de(i,ke,n.label),de(i,Kn,n.labelledby)}function E(){S=k("."+go),g=jt(S,"."+Si),Tt(S&&g,"A track/list element is missing."),Zt(m,Fo(g,"."+gn+":not(."+nr+")")),rt({arrows:Xn,pagination:hn,prev:or,next:rr,bar:$i,toggle:Ti},function(w,C){l[C]=k("."+w)}),At(l,{root:i,track:S,list:g,slides:m})}function K(){var w=i.id||gi(Vt),C=n.role;i.id=w,S.id=S.id||w+"-track",g.id=g.id||w+"-list",!Fe(i,qe)&&i.tagName!=="SECTION"&&C&&de(i,qe,C),de(i,Mt,u.carousel),de(g,qe,"presentation")}function k(w){var C=Po(i,w);return C&&Li(C,"."+xn)===i?C:void 0}function I(w){return[w+"--"+n.type,w+"--"+n.direction,n.drag&&w+"--draggable",n.isNavigation&&w+"--nav",w===xn&&at]}return At(l,{setup:d,mount:x,destroy:y})}var bt="slide",wt="loop",zt="fade";function Ri(e,t,n,o){var r=be(e),s=r.on,i=r.emit,u=r.bind,l=e.Components,m=e.root,c=e.options,T=c.isNavigation,S=c.updateOnMove,g=c.i18n,p=c.pagination,d=c.slideFocus,x=l.Direction.resolve,y=Fe(o,"style"),b=Fe(o,ke),E=n>-1,K=jt(o,"."+wi),k;function I(){E||(o.id=m.id+"-slide"+Vn(t+1),de(o,qe,p?"tabpanel":"group"),de(o,Mt,g.slide),de(o,ke,b||kn(g.slideLabel,[t+1,e.length]))),w()}function w(){u(o,"click",ve(i,On,A)),u(o,"keydown",ve(i,Xo,A)),s([St,Zo,st],P),s(Bn,R),S&&s(Ke,z)}function C(){k=!0,r.destroy(),De(o,Ii),Ne(o,Yn),de(o,"style",y),de(o,ke,b||"")}function R(){var M=e.splides.map(function($){var N=$.splide.Components.Slides.getAt(t);return N?N.slide.id:""}).join(" ");de(o,ke,kn(g.slideX,(E?n:t)+1)),de(o,Ot,M),de(o,qe,d?"button":""),d&&Ne(o,Mt)}function z(){k||P()}function P(){if(!k){var M=e.index;H(),j(),Be(o,ar,t===M-1),Be(o,sr,t===M+1)}}function H(){var M=G();M!==ao(o,at)&&(Be(o,at,M),de(o,er,T&&M||""),i(M?Ho:jo,A))}function j(){var M=v(),$=!M&&(!G()||E);if(e.state.is([xt,Pt])||de(o,tr,$||""),de(Hn(o,c.focusableNodes||""),ft,$?-1:""),d&&de(o,ft,$?-1:0),M!==ao(o,An)&&(Be(o,An,M),i(M?Vo:Oo,A)),!M&&document.activeElement===o){var N=l.Slides.getAt(e.index);N&&Mo(N.slide)}}function D(M,$,N){Le(N&&K||o,M,$)}function G(){var M=e.index;return M===t||c.cloneStatus&&M===n}function v(){if(e.is(zt))return G();var M=Ee(l.Elements.track),$=Ee(o),N=x("left",!0),J=x("right",!0);return nn(M[N])<=Ft($[N])&&nn($[J])<=Ft(M[J])}function F(M,$){var N=_e(M-t);return!E&&(c.rewind||e.is(wt))&&(N=Je(N,e.length-N)),N<=$}var A={index:t,slideIndex:n,slide:o,container:K,isClone:E,mount:I,destroy:C,update:P,style:D,isWithin:F};return A}function Pi(e,t,n){var o=be(e),r=o.on,s=o.emit,i=o.bind,u=t.Elements,l=u.slides,m=u.list,c=[];function T(){S(),r(Se,g),r(Se,S)}function S(){l.forEach(function(P,H){d(P,H,-1)})}function g(){k(function(P){P.destroy()}),Ue(c)}function p(){k(function(P){P.update()})}function d(P,H,j){var D=Ri(e,H,j,P);D.mount(),c.push(D),c.sort(function(G,v){return G.index-v.index})}function x(P){return P?I(function(H){return!H.isClone}):c}function y(P){var H=t.Controller,j=H.toIndex(P),D=H.hasFocus()?1:n.perPage;return I(function(G){return Jt(G.index,j,j+D-1)})}function b(P){return I(P)[0]}function E(P,H){Ie(P,function(j){if(Ze(j)&&(j=Ro(j)),Lo(j)){var D=l[H];D?Nn(j,D):Ht(m,j),We(j,n.classes.slide),C(j,ve(s,vt))}}),s(Se)}function K(P){it(I(P).map(function(H){return H.slide})),s(Se)}function k(P,H){x(H).forEach(P)}function I(P){return c.filter(Ao(P)?P:function(H){return Ze(P)?kt(H.slide,P):Wn(Nt(P),H.index)})}function w(P,H,j){k(function(D){D.style(P,H,j)})}function C(P,H){var j=Hn(P,"img"),D=j.length;D?j.forEach(function(G){i(G,"load error",function(){--D||H()})}):H()}function R(P){return P?l.length:c.length}function z(){return c.length>n.perPage}return{mount:T,destroy:g,update:p,register:d,get:x,getIn:y,getAt:b,add:E,remove:K,forEach:k,filter:I,style:w,getLength:R,isEnough:z}}function Wi(e,t,n){var o=be(e),r=o.on,s=o.bind,i=o.emit,u=t.Slides,l=t.Direction.resolve,m=t.Elements,c=m.root,T=m.track,S=m.list,g=u.getAt,p=u.style,d,x,y;function b(){E(),s(window,"resize load",yi(ve(i,vt))),r([Te,Se],E),r(vt,K)}function E(){d=n.direction===mn,Le(c,"maxWidth",ot(n.width)),Le(T,l("paddingLeft"),k(!1)),Le(T,l("paddingRight"),k(!0)),K(!0)}function K(A){var M=Ee(c);(A||x.width!==M.width||x.height!==M.height)&&(Le(T,"height",I()),p(l("marginRight"),ot(n.gap)),p("width",C()),p("height",R(),!0),x=M,i(sn),y!==(y=F())&&(Be(c,cr,y),i(fi,y)))}function k(A){var M=n.padding,$=l(A?"right":"left");return M&&ot(M[$]||(Et(M)?0:M))||"0px"}function I(){var A="";return d&&(A=w(),Tt(A,"height or heightRatio is missing."),A="calc("+A+" - "+k(!1)+" - "+k(!0)+")"),A}function w(){return ot(n.height||Ee(S).width*n.heightRatio)}function C(){return n.autoWidth?null:ot(n.fixedWidth)||(d?"":z())}function R(){return ot(n.fixedHeight)||(d?n.autoHeight?null:z():w())}function z(){var A=ot(n.gap);return"calc((100%"+(A&&" + "+A)+")/"+(n.perPage||1)+(A&&" - "+A)+")"}function P(){return Ee(S)[l("width")]}function H(A,M){var $=g(A||0);return $?Ee($.slide)[l("width")]+(M?0:G()):0}function j(A,M){var $=g(A);if($){var N=Ee($.slide)[l("right")],J=Ee(S)[l("left")];return _e(N-J)+(M?0:G())}return 0}function D(A){return j(e.length-1)-j(0)+H(0,A)}function G(){var A=g(0);return A&&parseFloat(Le(A.slide,l("marginRight")))||0}function v(A){return parseFloat(Le(T,l("padding"+(A?"Right":"Left"))))||0}function F(){return e.is(zt)||D(!0)>P()}return{mount:b,resize:K,listSize:P,slideSize:H,sliderSize:D,totalSize:j,getPadding:v,isOverflow:F}}var Ni=2;function Hi(e,t,n){var o=be(e),r=o.on,s=t.Elements,i=t.Slides,u=t.Direction.resolve,l=[],m;function c(){r(Se,T),r([Te,vt],g),(m=x())&&(p(m),t.Layout.resize(!0))}function T(){S(),c()}function S(){it(l),Ue(l),o.destroy()}function g(){var y=x();m!==y&&(m<y||!y)&&o.emit(Se)}function p(y){var b=i.get().slice(),E=b.length;if(E){for(;b.length<y;)Zt(b,b);Zt(b.slice(-y),b.slice(0,y)).forEach(function(K,k){var I=k<y,w=d(K.slide,k);I?Nn(w,b[0].slide):Ht(s.list,w),Zt(l,w),i.register(w,k-y+(I?0:E),K.index)})}}function d(y,b){var E=y.cloneNode(!0);return We(E,n.classes.clone),E.id=e.root.id+"-clone"+Vn(b+1),E}function x(){var y=n.clones;if(!e.is(wt))y=0;else if(Wt(y)){var b=n[u("fixedWidth")]&&t.Layout.slideSize(0),E=b&&Ft(Ee(s.track)[u("width")]/b);y=E||n[u("autoWidth")]&&e.length||n.perPage*Ni}return y}return{mount:c,destroy:S}}function ji(e,t,n){var o=be(e),r=o.on,s=o.emit,i=e.state.set,u=t.Layout,l=u.slideSize,m=u.getPadding,c=u.totalSize,T=u.listSize,S=u.sliderSize,g=t.Direction,p=g.resolve,d=g.orient,x=t.Elements,y=x.list,b=x.track,E;function K(){E=t.Transition,r([et,sn,Te,Se],k)}function k(){t.Controller.isBusy()||(t.Scroll.cancel(),w(e.index),t.Slides.update())}function I($,N,J,ce){$!==N&&A($>J)&&(P(),C(z(D(),$>J),!0)),i(xt),s(Ke,N,J,$),E.start(N,function(){i(yt),s(St,N,J,$),ce&&ce()})}function w($){C(j($,!0))}function C($,N){if(!e.is(zt)){var J=N?$:R($);Le(y,"transform","translate"+p("X")+"("+J+"px)"),$!==J&&s(Zo)}}function R($){if(e.is(wt)){var N=H($),J=N>t.Controller.getEnd(),ce=N<0;(ce||J)&&($=z($,J))}return $}function z($,N){var J=$-F(N),ce=S();return $-=d(ce*(Ft(_e(J)/ce)||1))*(N?1:-1),$}function P(){C(D(),!0),E.cancel()}function H($){for(var N=t.Slides.get(),J=0,ce=1/0,re=0;re<N.length;re++){var ge=N[re].index,W=_e(j(ge,!0)-$);if(W<=ce)ce=W,J=ge;else break}return J}function j($,N){var J=d(c($-1)-v($));return N?G(J):J}function D(){var $=p("left");return Ee(y)[$]-Ee(b)[$]+d(m(!1))}function G($){return n.trimSpace&&e.is(bt)&&($=pt($,0,d(S(!0)-T()))),$}function v($){var N=n.focus;return N==="center"?(T()-l($,!0))/2:+N*l($)||0}function F($){return j($?t.Controller.getEnd():0,!!n.trimSpace)}function A($){var N=d(z(D(),$));return $?N>=0:N<=y[p("scrollWidth")]-Ee(b)[p("width")]}function M($,N){N=Wt(N)?D():N;var J=$!==!0&&d(N)<d(F(!1)),ce=$!==!1&&d(N)>d(F(!0));return J||ce}return{mount:K,move:I,jump:w,translate:C,shift:z,cancel:P,toIndex:H,toPosition:j,getPosition:D,getLimit:F,exceededLimit:M,reposition:k}}function Vi(e,t,n){var o=be(e),r=o.on,s=o.emit,i=t.Move,u=i.getPosition,l=i.getLimit,m=i.toPosition,c=t.Slides,T=c.isEnough,S=c.getLength,g=n.omitEnd,p=e.is(wt),d=e.is(bt),x=ve(D,!1),y=ve(D,!0),b=n.start||0,E,K=b,k,I,w;function C(){R(),r([Te,Se,on],R),r(sn,z)}function R(){k=S(!0),I=n.perMove,w=n.perPage,E=A();var W=pt(b,0,g?E:k-1);W!==b&&(b=W,i.reposition())}function z(){E!==A()&&s(on)}function P(W,V,Q){if(!ge()){var te=j(W),se=F(te);se>-1&&(V||se!==b)&&(J(se),i.move(te,se,K,Q))}}function H(W,V,Q,te){t.Scroll.scroll(W,V,Q,function(){var se=F(i.toIndex(u()));J(g?Je(se,E):se),te&&te()})}function j(W){var V=b;if(Ze(W)){var Q=W.match(/([+\-<>])(\d+)?/)||[],te=Q[1],se=Q[2];te==="+"||te==="-"?V=G(b+ +(""+te+(+se||1)),b):te===">"?V=se?M(+se):x(!0):te==="<"&&(V=y(!0))}else V=p?W:pt(W,0,E);return V}function D(W,V){var Q=I||(re()?1:w),te=G(b+Q*(W?-1:1),b,!(I||re()));return te===-1&&d&&!Wo(u(),l(!W),1)?W?0:E:V?te:F(te)}function G(W,V,Q){if(T()||re()){var te=v(W);te!==W&&(V=W,W=te,Q=!1),W<0||W>E?!I&&(Jt(0,W,V,!0)||Jt(E,V,W,!0))?W=M($(W)):p?W=Q?W<0?-(k%w||w):k:W:n.rewind?W=W<0?E:0:W=-1:Q&&W!==V&&(W=M($(V)+(W<V?-1:1)))}else W=-1;return W}function v(W){if(d&&n.trimSpace==="move"&&W!==b)for(var V=u();V===m(W,!0)&&Jt(W,0,e.length-1,!n.rewind);)W<b?--W:++W;return W}function F(W){return p?(W+k)%k||0:W}function A(){for(var W=k-(re()||p&&I?1:w);g&&W-- >0;)if(m(k-1,!0)!==m(W,!0)){W++;break}return pt(W,0,k-1)}function M(W){return pt(re()?W:w*W,0,E)}function $(W){return re()?Je(W,E):nn((W>=E?k-1:W)/w)}function N(W){var V=i.toIndex(W);return d?pt(V,0,E):V}function J(W){W!==b&&(K=b,b=W)}function ce(W){return W?K:b}function re(){return!Wt(n.focus)||n.isNavigation}function ge(){return e.state.is([xt,Pt])&&!!n.waitForTransition}return{mount:C,go:P,scroll:H,getNext:x,getPrev:y,getAdjacent:D,getEnd:A,setIndex:J,getIndex:ce,toIndex:M,toPage:$,toDest:N,hasFocus:re,isBusy:ge}}var Oi="http://www.w3.org/2000/svg",zi="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",qt=40;function Bi(e,t,n){var o=be(e),r=o.on,s=o.bind,i=o.emit,u=n.classes,l=n.i18n,m=t.Elements,c=t.Controller,T=m.arrows,S=m.track,g=T,p=m.prev,d=m.next,x,y,b={};function E(){k(),r(Te,K)}function K(){I(),E()}function k(){var H=n.arrows;H&&!(p&&d)&&R(),p&&d&&(At(b,{prev:p,next:d}),Lt(g,H?"":"none"),We(g,y=Xn+"--"+n.direction),H&&(w(),P(),de([p,d],Ot,S.id),i(qo,p,d)))}function I(){o.destroy(),De(g,y),x?(it(T?[p,d]:g),p=d=null):Ne([p,d],Yn)}function w(){r([et,St,Se,st,on],P),s(d,"click",ve(C,">")),s(p,"click",ve(C,"<"))}function C(H){c.go(H,!0)}function R(){g=T||gt("div",u.arrows),p=z(!0),d=z(!1),x=!0,Ht(g,[p,d]),!T&&Nn(g,S)}function z(H){var j='<button class="'+u.arrow+" "+(H?u.prev:u.next)+'" type="button"><svg xmlns="'+Oi+'" viewBox="0 0 '+qt+" "+qt+'" width="'+qt+'" height="'+qt+'" focusable="false"><path d="'+(n.arrowPath||zi)+'" />';return Ro(j)}function P(){if(p&&d){var H=e.index,j=c.getPrev(),D=c.getNext(),G=j>-1&&H<j?l.last:l.prev,v=D>-1&&H>D?l.first:l.next;p.disabled=j<0,d.disabled=D<0,de(p,ke,G),de(d,ke,v),i(Uo,p,d,j,D)}}return{arrows:b,mount:E,destroy:I,update:P}}var Di=jn+"-interval";function qi(e,t,n){var o=be(e),r=o.on,s=o.bind,i=o.emit,u=cn(n.interval,e.go.bind(e,">"),w),l=u.isPaused,m=t.Elements,c=t.Elements,T=c.root,S=c.toggle,g=n.autoplay,p,d,x=g==="pause";function y(){g&&(b(),S&&de(S,Ot,m.track.id),x||E(),I())}function b(){n.pauseOnHover&&s(T,"mouseenter mouseleave",function(R){p=R.type==="mouseenter",k()}),n.pauseOnFocus&&s(T,"focusin focusout",function(R){d=R.type==="focusin",k()}),S&&s(S,"click",function(){x?E():K(!0)}),r([Ke,ln,Se],u.rewind),r(Ke,C)}function E(){l()&&t.Slides.isEnough()&&(u.start(!n.resetProgress),d=p=x=!1,I(),i(Dn))}function K(R){R===void 0&&(R=!0),x=!!R,I(),l()||(u.pause(),i(qn))}function k(){x||(p||d?K(!1):E())}function I(){S&&(Be(S,at,!x),de(S,ke,n.i18n[x?"play":"pause"]))}function w(R){var z=m.bar;z&&Le(z,"width",R*100+"%"),i(Yo,R)}function C(R){var z=t.Slides.getAt(R);u.set(z&&+Fe(z.slide,Di)||n.interval)}return{mount:y,destroy:u.cancel,play:E,pause:K,isPaused:l}}function Ui(e,t,n){var o=be(e),r=o.on;function s(){n.cover&&(r(Un,ve(u,!0)),r([et,Te,Se],ve(i,!0)))}function i(l){t.Slides.forEach(function(m){var c=jt(m.container||m.slide,"img");c&&c.src&&u(l,c,m)})}function u(l,m,c){c.style("background",l?'center/cover no-repeat url("'+m.src+'")':"",!0),Lt(m,l?"none":"")}return{mount:s,destroy:ve(i,!1)}}var Ki=10,Gi=600,Yi=.6,Xi=1.5,Zi=800;function Ji(e,t,n){var o=be(e),r=o.on,s=o.emit,i=e.state.set,u=t.Move,l=u.getPosition,m=u.getLimit,c=u.exceededLimit,T=u.translate,S=e.is(bt),g,p,d=1;function x(){r(Ke,K),r([Te,Se],k)}function y(w,C,R,z,P){var H=l();if(K(),R&&(!S||!c())){var j=t.Layout.sliderSize(),D=En(w)*j*nn(_e(w)/j)||0;w=u.toPosition(t.Controller.toDest(w%j))+D}var G=Wo(H,w,1);d=1,C=G?0:C||tn(_e(w-H)/Xi,Zi),p=z,g=cn(C,b,ve(E,H,w,P),1),i(Pt),s(ln),g.start()}function b(){i(yt),p&&p(),s(st)}function E(w,C,R,z){var P=l(),H=w+(C-w)*I(z),j=(H-P)*d;T(P+j),S&&!R&&c()&&(d*=Yi,_e(j)<Ki&&y(m(c(!0)),Gi,!1,p,!0))}function K(){g&&g.cancel()}function k(){g&&!g.isPaused()&&(K(),b())}function I(w){var C=n.easingFunc;return C?C(w):1-Math.pow(1-w,4)}return{mount:x,destroy:K,scroll:y,cancel:k}}var dt={passive:!1,capture:!0};function Qi(e,t,n){var o=be(e),r=o.on,s=o.emit,i=o.bind,u=o.unbind,l=e.state,m=t.Move,c=t.Scroll,T=t.Controller,S=t.Elements.track,g=t.Media.reduce,p=t.Direction,d=p.resolve,x=p.orient,y=m.getPosition,b=m.exceededLimit,E,K,k,I,w,C=!1,R,z,P;function H(){i(S,Sn,Tn,dt),i(S,wn,Tn,dt),i(S,ur,D,dt),i(S,"click",F,{capture:!0}),i(S,"dragstart",ze),r([et,Te],j)}function j(){var L=n.drag;ie(!L),I=L==="free"}function D(L){if(R=!1,!z){var f=se(L);te(L.target)&&(f||!L.button)&&(T.isBusy()?ze(L,!0):(P=f?S:window,w=l.is([xt,Pt]),k=null,i(P,Sn,G,dt),i(P,wn,v,dt),m.cancel(),c.cancel(),A(L)))}}function G(L){if(l.is(Xt)||(l.set(Xt),s(zo)),L.cancelable)if(w){m.translate(E+Q(re(L)));var f=ge(L)>fo,O=C!==(C=b());(f||O)&&A(L),R=!0,s(Bo),ze(L)}else N(L)&&(w=$(L),ze(L))}function v(L){l.is(Xt)&&(l.set(yt),s(Do)),w&&(M(L),ze(L)),u(P,Sn,G),u(P,wn,v),w=!1}function F(L){!z&&R&&ze(L,!0)}function A(L){k=K,K=L,E=y()}function M(L){var f=J(L),O=ce(f),Y=n.rewind&&n.rewindByDrag;g(!1),I?T.scroll(O,0,n.snap):e.is(zt)?T.go(x(En(f))<0?Y?"<":"-":Y?">":"+"):e.is(bt)&&C&&Y?T.go(b(!0)?">":"<"):T.go(T.toDest(O),!0),g(!0)}function $(L){var f=n.dragMinThreshold,O=Et(f),Y=O&&f.mouse||0,ee=(O?f.touch:+f)||10;return _e(re(L))>(se(L)?ee:Y)}function N(L){return _e(re(L))>_e(re(L,!0))}function J(L){if(e.is(wt)||!C){var f=ge(L);if(f&&f<fo)return re(L)/f}return 0}function ce(L){return y()+En(L)*Je(_e(L)*(n.flickPower||600),I?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function re(L,f){return V(L,f)-V(W(L),f)}function ge(L){return _n(L)-_n(W(L))}function W(L){return K===L&&k||K}function V(L,f){return(se(L)?L.changedTouches[0]:L)["page"+d(f?"Y":"X")]}function Q(L){return L/(C&&e.is(bt)?Fi:1)}function te(L){var f=n.noDrag;return!kt(L,"."+ir+", ."+fn)&&(!f||!kt(L,f))}function se(L){return typeof TouchEvent<"u"&&L instanceof TouchEvent}function q(){return w}function ie(L){z=L}return{mount:H,disable:ie,isDragging:q}}var ea={Spacebar:" ",Right:dn,Left:pn,Up:Jo,Down:Qo};function Zn(e){return e=Ze(e)?e:e.key,ea[e]||e}var ho="keydown";function ta(e,t,n){var o=be(e),r=o.on,s=o.bind,i=o.unbind,u=e.root,l=t.Direction.resolve,m,c;function T(){S(),r(Te,g),r(Te,S),r(Ke,d)}function S(){var y=n.keyboard;y&&(m=y==="global"?window:u,s(m,ho,x))}function g(){i(m,ho)}function p(y){c=y}function d(){var y=c;c=!0,Io(function(){c=y})}function x(y){if(!c){var b=Zn(y);b===l(pn)?e.go("<"):b===l(dn)&&e.go(">")}}return{mount:T,destroy:g,disable:p}}var _t=jn+"-lazy",Qt=_t+"-srcset",na="["+_t+"], ["+Qt+"]";function oa(e,t,n){var o=be(e),r=o.on,s=o.off,i=o.bind,u=o.emit,l=n.lazyLoad==="sequential",m=[St,st],c=[];function T(){n.lazyLoad&&(S(),r(Se,S))}function S(){Ue(c),g(),l?y():(s(m),r(m,p),p())}function g(){t.Slides.forEach(function(b){Hn(b.slide,na).forEach(function(E){var K=Fe(E,_t),k=Fe(E,Qt);if(K!==E.src||k!==E.srcset){var I=n.classes.spinner,w=E.parentElement,C=jt(w,"."+I)||gt("span",I,w);c.push([E,b,C]),E.src||Lt(E,"none")}})})}function p(){c=c.filter(function(b){var E=n.perPage*((n.preloadPages||1)+1)-1;return b[1].isWithin(e.index,E)?d(b):!0}),c.length||s(m)}function d(b){var E=b[0];We(b[1].slide,Ln),i(E,"load error",ve(x,b)),de(E,"src",Fe(E,_t)),de(E,"srcset",Fe(E,Qt)),Ne(E,_t),Ne(E,Qt)}function x(b,E){var K=b[0],k=b[1];De(k.slide,Ln),E.type!=="error"&&(it(b[2]),Lt(K,""),u(Un,K,k),u(vt)),l&&y()}function y(){c.length&&d(c.shift())}return{mount:T,destroy:ve(Ue,c),check:p}}function ra(e,t,n){var o=be(e),r=o.on,s=o.emit,i=o.bind,u=t.Slides,l=t.Elements,m=t.Controller,c=m.hasFocus,T=m.getIndex,S=m.go,g=t.Direction.resolve,p=l.pagination,d=[],x,y;function b(){E(),r([Te,Se,on],b);var z=n.pagination;p&&Lt(p,z?"":"none"),z&&(r([Ke,ln,st],R),K(),R(),s(Ko,{list:x,items:d},C(e.index)))}function E(){x&&(it(p?Qe(x.children):x),De(x,y),Ue(d),x=null),o.destroy()}function K(){var z=e.length,P=n.classes,H=n.i18n,j=n.perPage,D=c()?m.getEnd()+1:Ft(z/j);x=p||gt("ul",P.pagination,l.track.parentElement),We(x,y=hn+"--"+w()),de(x,qe,"tablist"),de(x,ke,H.select),de(x,Gn,w()===mn?"vertical":"");for(var G=0;G<D;G++){var v=gt("li",null,x),F=gt("button",{class:P.page,type:"button"},v),A=u.getIn(G).map(function($){return $.slide.id}),M=!c()&&j>1?H.pageX:H.slideX;i(F,"click",ve(k,G)),n.paginationKeyboard&&i(F,"keydown",ve(I,G)),de(v,qe,"presentation"),de(F,qe,"tab"),de(F,Ot,A.join(" ")),de(F,ke,kn(M,G+1)),de(F,ft,-1),d.push({li:v,button:F,page:G})}}function k(z){S(">"+z,!0)}function I(z,P){var H=d.length,j=Zn(P),D=w(),G=-1;j===g(dn,!1,D)?G=++z%H:j===g(pn,!1,D)?G=(--z+H)%H:j==="Home"?G=0:j==="End"&&(G=H-1);var v=d[G];v&&(Mo(v.button),S(">"+G),ze(P,!0))}function w(){return n.paginationDirection||n.direction}function C(z){return d[m.toPage(z)]}function R(){var z=C(T(!0)),P=C(T());if(z){var H=z.button;De(H,at),Ne(H,co),de(H,ft,-1)}if(P){var j=P.button;We(j,at),de(j,co,!0),de(j,ft,"")}s(Go,{list:x,items:d},z,P)}return{items:d,mount:b,destroy:E,getAt:C,update:R}}var ia=[" ","Enter"];function aa(e,t,n){var o=n.isNavigation,r=n.slideFocus,s=[];function i(){e.splides.forEach(function(p){p.isParent||(m(e,p.splide),m(p.splide,e))}),o&&c()}function u(){s.forEach(function(p){p.destroy()}),Ue(s)}function l(){u(),i()}function m(p,d){var x=be(p);x.on(Ke,function(y,b,E){d.go(d.is(wt)?E:y)}),s.push(x)}function c(){var p=be(e),d=p.on;d(On,S),d(Xo,g),d([et,Te],T),s.push(p),p.emit(Bn,e.splides)}function T(){de(t.Elements.list,Gn,n.direction===mn?"vertical":"")}function S(p){e.go(p.index)}function g(p,d){Wn(ia,Zn(d))&&(S(p),ze(d))}return{setup:ve(t.Media.set,{slideFocus:Wt(r)?o:r},!0),mount:i,destroy:u,remount:l}}function sa(e,t,n){var o=be(e),r=o.bind,s=0;function i(){n.wheel&&r(t.Elements.track,"wheel",u,dt)}function u(m){if(m.cancelable){var c=m.deltaY,T=c<0,S=_n(m),g=n.wheelMinThreshold||0,p=n.wheelSleep||0;_e(c)>g&&S-s>p&&(e.go(T?"<":">"),s=S),l(T)&&ze(m)}}function l(m){return!n.releaseWheel||e.state.is(xt)||t.Controller.getAdjacent(m)!==-1}return{mount:i}}var la=90;function ca(e,t,n){var o=be(e),r=o.on,s=t.Elements.track,i=n.live&&!n.isNavigation,u=gt("span",Ei),l=cn(la,ve(c,!1));function m(){i&&(S(!t.Autoplay.isPaused()),de(s,mo,!0),u.textContent="…",r(Dn,ve(S,!0)),r(qn,ve(S,!1)),r([St,st],ve(c,!0)))}function c(g){de(s,po,g),g?(Ht(s,u),l.start()):(it(u),l.cancel())}function T(){Ne(s,[uo,mo,po]),it(u)}function S(g){i&&de(s,uo,g?"off":"polite")}return{mount:m,disable:S,destroy:T}}var ua=Object.freeze({__proto__:null,Media:vi,Direction:bi,Elements:Mi,Slides:Pi,Layout:Wi,Clones:Hi,Move:ji,Controller:Vi,Arrows:Bi,Autoplay:qi,Cover:Ui,Scroll:Ji,Drag:Qi,Keyboard:ta,LazyLoad:oa,Pagination:ra,Sync:aa,Wheel:sa,Live:ca}),pa={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"},da={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:Ai,i18n:pa,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function ma(e,t,n){var o=t.Slides;function r(){be(e).on([et,Se],s)}function s(){o.forEach(function(u){u.style("transform","translateX(-"+100*u.index+"%)")})}function i(u,l){o.style("transition","opacity "+n.speed+"ms "+n.easing),Io(l)}return{mount:r,start:i,cancel:Tn}}function ga(e,t,n){var o=t.Move,r=t.Controller,s=t.Scroll,i=t.Elements.list,u=ve(Le,i,"transition"),l;function m(){be(e).bind(i,"transitionend",function(g){g.target===i&&l&&(T(),l())})}function c(g,p){var d=o.toPosition(g,!0),x=o.getPosition(),y=S(g);_e(d-x)>=1&&y>=1?n.useScroll?s.scroll(d,y,!1,p):(u("transform "+y+"ms "+n.easing),o.translate(d,!0),l=p):(o.jump(g),p())}function T(){u(""),s.cancel()}function S(g){var p=n.rewindSpeed;if(e.is(bt)&&p){var d=r.getIndex(!0),x=r.getEnd();if(d===0&&g>=x||d>=x&&g===0)return p}return n.speed}return{mount:m,start:c,cancel:T}}var fa=(function(){function e(n,o){this.event=be(),this.Components={},this.state=hi(mt),this.splides=[],this._o={},this._E={};var r=Ze(n)?Po(document,n):n;Tt(r,r+" is invalid."),this.root=r,o=Ye({label:Fe(r,ke)||"",labelledby:Fe(r,Kn)||""},da,e.defaults,o||{});try{Ye(o,JSON.parse(Fe(r,jn)))}catch{Tt(!1,"Invalid JSON")}this._o=Object.create(Ye({},o))}var t=e.prototype;return t.mount=function(o,r){var s=this,i=this.state,u=this.Components;Tt(i.is([mt,en]),"Already mounted!"),i.set(mt),this._C=u,this._T=r||this._T||(this.is(zt)?ma:ga),this._E=o||this._E;var l=At({},ua,this._E,{Transition:this._T});return rt(l,function(m,c){var T=m(s,u,s._o);u[c]=T,T.setup&&T.setup()}),rt(u,function(m){m.mount&&m.mount()}),this.emit(et),We(this.root,ki),i.set(yt),this.emit(In),this},t.sync=function(o){return this.splides.push({splide:o}),o.splides.push({splide:this,isParent:!0}),this.state.is(yt)&&(this._C.Sync.remount(),o.Components.Sync.remount()),this},t.go=function(o){return this._C.Controller.go(o),this},t.on=function(o,r){return this.event.on(o,r),this},t.off=function(o){return this.event.off(o),this},t.emit=function(o){var r;return(r=this.event).emit.apply(r,[o].concat(Qe(arguments,1))),this},t.add=function(o,r){return this._C.Slides.add(o,r),this},t.remove=function(o){return this._C.Slides.remove(o),this},t.is=function(o){return this._o.type===o},t.refresh=function(){return this.emit(Se),this},t.destroy=function(o){o===void 0&&(o=!0);var r=this.event,s=this.state;return s.is(mt)?be(this).on(In,this.destroy.bind(this,o)):(rt(this._C,function(i){i.destroy&&i.destroy(o)},!0),r.emit(zn),r.destroy(),o&&Ue(this.splides),s.set(en)),this},pi(e,[{key:"options",get:function(){return this._o},set:function(o){this._C.Media.set(o,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),Jn=fa;Jn.defaults={};Jn.STATES=mi;var yo=[[et,"onMounted"],[In,"onReady"],[Ke,"onMove"],[St,"onMoved"],[On,"onClick"],[Ho,"onActive"],[jo,"onInactive"],[Vo,"onVisible"],[Oo,"onHidden"],[Se,"onRefresh"],[Te,"onUpdated"],[vt,"onResize"],[sn,"onResized"],[zo,"onDrag"],[Bo,"onDragging"],[Do,"onDragged"],[ln,"onScroll"],[st,"onScrolled"],[zn,"onDestroy"],[qo,"onArrowsMounted"],[Uo,"onArrowsUpdated"],[Ko,"onPaginationMounted"],[Go,"onPaginationUpdated"],[Bn,"onNavigationMounted"],[Dn,"onAutoplayPlay"],[Yo,"onAutoplayPlaying"],[qn,"onAutoplayPause"],[Un,"onLazyLoadLoaded"]];function Qn(...e){return e.filter(Boolean).join(" ")}function rn(e){return e!==null&&typeof e=="object"}function Fn(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,o)=>!Fn(n,t[o]));if(rn(e)&&rn(t)){const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&!n.some(r=>!Object.prototype.hasOwnProperty.call(t,r)||!Fn(e[r],t[r]))}return e===t}function ha(e,t){return e.length===t.length&&!e.some((n,o)=>n!==t[o])}function ya(e,t){if(e){const n=Object.keys(e);for(let o=0;o<n.length;o++){const r=n[o];if(r!=="__proto__"&&t(e[r],r)===!1)break}}return e}function Mn(e,t){const n=e;return ya(t,(o,r)=>{Array.isArray(o)?n[r]=o.slice():rn(o)?n[r]=Mn(rn(n[r])?n[r]:{},o):n[r]=o}),n}var va=({children:e,className:t,...n})=>h.createElement("div",{className:Qn("splide__track",t),...n},h.createElement("ul",{className:"splide__list"},e)),pr=class extends h.Component{constructor(){super(...arguments),this.splideRef=h.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:o}=this.splideRef;o&&(this.splide=new Jn(o,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Mn({},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&&!Fn(this.options,e)&&(this.splide.options=e,this.options=Mn({},e));const t=this.getSlides();ha(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){yo.forEach(([t,n])=>{const o=this.props[n];typeof o=="function"&&e.on(t,(...r)=>{o(e,...r)})})}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:o,...r}=this.props;return h.createElement(t,{className:Qn("splide",e),ref:this.splideRef,...this.omit(r,["options",...yo.map(s=>s[1])])},n?h.createElement(va,null,o):o)}},dr=({children:e,className:t,...n})=>h.createElement("li",{className:Qn("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 va="RichTextRenderer-module__link___BWeZ2",ba={link:va},xa=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(o=>/^\d/.test(o))},yn=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>xa(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function ht(e){const{color:t,...n}=e;return n}function Re(e,t){var n,o,r;return{fontFamily:yn(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:(o=e.textAppearance)==null?void 0:o.textDecoration,fontVariant:(r=e.textAppearance)==null?void 0:r.fontVariant,color:e.color}}const Mt=({content:e})=>{const t=n=>n.map((o,r)=>o.type==="link"?s.jsx("a",{className:ba.link,href:o.value,target:o.target,children:t(o.children)},r):s.jsx("span",{style:Sa(o),children:o.text},r));return s.jsx(s.Fragment,{children:e.map((n,o)=>{const r=n.children;return s.jsx("div",{children:t(r)},o)})})};function Sa(e){return{...e.fontFamily&&{fontFamily:yn(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 Ca="SvgImage-module__svg___q3xE-",wa="SvgImage-module__img___VsTm-",vo={svg:Ca,img:wa},$a=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},Ta=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,Ke=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:o="",style:r})=>{const[a,i]=w.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return w.useEffect(()=>{if(typeof window<"u"&&window.CSS){const u=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');i(u)}},[]),!$a(e)||!a?s.jsx("img",{src:e,alt:"",className:ye(vo.img,o),style:r}):s.jsx("span",{"data-supports-mask":a,className:ye(vo.svg,o),style:{"--svg":Ta(e),"--fill":t,"--hover-fill":n,...r??{}}})},_a={"top-left":J.topLeftAlignment,"top-center":J.topCenterAlignment,"top-right":J.topRightAlignment,"middle-left":J.middleLeftAlignment,"middle-center":J.middleCenterAlignment,"middle-right":J.middleRightAlignment,"bottom-left":J.bottomLeftAlignment,"bottom-center":J.bottomCenterAlignment,"bottom-right":J.bottomRightAlignment};function Ea({settings:e,content:t,styles:n,isEditor:o}){const[r,a]=w.useState(null),{widthSettings:i,fontSettings:u,letterSpacing:c,textAlign:m,wordSpacing:l,fontSizeLineHeight:A,textAppearance:S,color:g}=n.imageCaption,[p,d]=w.useState(void 0),[x,h]=w.useState(null),[y,_]=w.useState(0),[D,W]=w.useState(0),{direction:E,transition:b,controls:C,pagination:F,imageCaption:j,triggers:M}=e,N=w.useRef(b.type),{x:H,y:B}=e.controls.offset,U=f=>{r&&r.go(f)};return w.useEffect(()=>{if(!x)return;const f=new ResizeObserver(I=>{if(!r)return;const[k]=I;d({width:Math.round(k.contentRect.width),height:Math.round(k.contentRect.height)})});return f.observe(x),()=>f.unobserve(x)},[x]),w.useEffect(()=>{!r||N.current===b.type||(W(f=>f+1),N.current=b.type)},[b.type]),s.jsx("div",{className:ye(J.wrapper,{[J.editor]:o}),ref:h,children:s.jsxs("div",{className:J.sliderInner,style:{width:p?p.width:"100%",height:p?p.height:"100%",backgroundColor:b.backgroundColor&&b.type==="fade in"?b.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&s.jsx("div",{className:ye(J.captionBlock),children:s.jsx("div",{className:J.captionTextWrapper,children:t.map((f,I)=>s.jsx("div",{className:ye(J.captionText,_a[j.alignment],{[J.withPointerEvents]:I===y&&o,[J.active]:I===y}),style:{fontFamily:yn(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:i.sizing==="auto"?"max-content":$.scalingValue(i.width,o),letterSpacing:$.scalingValue(c,o),wordSpacing:$.scalingValue(l,o),textAlign:m,fontSize:$.scalingValue(A.fontSize,o),lineHeight:$.scalingValue(A.lineHeight,o),textTransform:S.textTransform??"none",textDecoration:S.textDecoration??"none",fontVariant:S.fontVariant??"normal",color:g,transitionDuration:b.duration?`${Math.round(parseInt(b.duration)/2)}ms`:"500ms"},children:s.jsx("div",{"data-styles":"imageCaption",className:J.captionTextInner,style:{"--link-hover-color":j.linkHoverColor,"--link-color":j.linkColor,position:"relative",top:$.scalingValue(j.offset.y,o),left:$.scalingValue(j.offset.x,o)},children:s.jsx(Mt,{content:f.imageCaption})})},I))})}),s.jsx(ur,{onMove:f=>{_(f.index)},ref:a,options:{arrows:!1,speed:b.duration?parseInt(b.duration):500,autoplay:M.autoPlay!==null,...M.autoPlay!==null&&{interval:parseInt(M.autoPlay)*1e3},direction:E==="horiz"||b.type==="fade in"?"ltr":"ttb",pagination:!1,drag:M.triggersList.drag,perPage:1,width:p?p.width:"100%",height:p?p.height:"100%",type:b.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((f,I)=>s.jsx(pr,{children:s.jsx("div",{className:J.sliderItem,children:s.jsx("div",{className:J.imgWrapper,children:s.jsx("img",{className:ye(J.sliderImage,{[J.contain]:f.image.objectFit==="contain",[J.cover]:f.image.objectFit==="cover"}),src:f.image.url,alt:f.image.name??""})})})},I))},D),C.isActive&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:ye(J.arrow,{[J.arrowVertical]:E==="vert",[J.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:s.jsxs("button",{onClick:()=>{U("-1")},className:J.arrowInner,style:{transform:`translate(${$.scalingValue(H,o)}, ${$.scalingValue(B*(E==="horiz"?1:-1),o)}) scale(${e.controls.scale/100}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&s.jsx(Ke,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:ye(J.arrowImg,J.mirror)}),!C.arrowsImgUrl&&s.jsx(bo,{color:C.color,className:ye(J.arrowIcon,J.arrowImg,J.mirror)})]})}),s.jsx("div",{className:ye(J.arrow,J.nextArrow,{[J.arrowVertical]:E==="vert",[J.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:s.jsxs("button",{className:J.arrowInner,onClick:()=>U("+1"),style:{transform:`translate(${$.scalingValue(H*(E==="horiz"?-1:1),o)}, ${$.scalingValue(B,o)}) scale(${e.controls.scale/100}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&s.jsx(Ke,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:J.arrowImg}),!C.arrowsImgUrl&&s.jsx(bo,{color:C.color,className:ye(J.arrowIcon,J.arrowImg)})]})})]}),M.triggersList.click&&s.jsx("div",{className:J.clickOverlay,onClick:()=>{r&&r.go("+1")}}),F.isActive&&s.jsx("div",{className:ye(J.pagination,{[J.paginationInsideBottom]:F.position==="inside-1"&&E==="horiz",[J.paginationInsideTop]:F.position==="inside-2"&&E==="horiz",[J.paginationOutsideBottom]:F.position==="outside-1"&&E==="horiz",[J.paginationOutsideTop]:F.position==="outside-2"&&E==="horiz",[J.paginationInsideLeft]:F.position==="inside-1"&&E==="vert",[J.paginationInsideRight]:F.position==="inside-2"&&E==="vert",[J.paginationOutsideLeft]:F.position==="outside-1"&&E==="vert",[J.paginationOutsideRight]:F.position==="outside-2"&&E==="vert",[J.paginationVertical]:E==="vert"}),children:s.jsx("div",{className:J.paginationInner,style:{backgroundColor:F.colors[2],transform:`scale(${F.scale/100}) translate(${$.scalingValue(F.offset.x,o)}, ${$.scalingValue(F.offset.y,o)}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:t.map((f,I)=>s.jsx("button",{onClick:()=>{r&&r.go(I)},className:ye(J.paginationItem),children:s.jsx("div",{className:ye(J.dot,{[J.activeDot]:I===y}),style:{backgroundColor:I===y?F.colors[0]:F.colors[1],"--pagination-hover-color":F.hover}})},I))})})]})})}function bo({color:e,className:t}){return s.jsx("svg",{viewBox:"0 0 10 18",className:t,children:s.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:s.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 Aa={element:Ea,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",La="ImageRevealSlider-module__image___Qjt-e",Ia="ImageRevealSlider-module__link___N-iLG",Fa="ImageRevealSlider-module__cursor___2U03d",ut={imageRevealSlider:ka,image:La,link:Ia,cursor:Fa};function xo(e,t,n){for(const o of n){const r=new Image;r.src=o.url;const a=o.width?Number.parseFloat(o.width):r.naturalWidth,i=r.naturalHeight/r.naturalWidth*a,u=a/2,c=i/2;if(e>=o.x-u&&e<=o.x+u&&t>=o.y-c&&t<=o.y+c)return!0}return!1}function wn(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Pa(e,t,n,o){let r,a;if(t==="custom"){r=n;const i=await wn(e);a=i.height/i.width*r}else if(t==="random"){r=Math.random()*(o.max-o.min)+o.min;const i=await wn(e);a=i.height/i.width*r}else{const i=await wn(e);r=i.width,a=i.height}return{width:r,height:a,finalWidth:`${r}px`}}function Ma({settings:e,content:t,isEditor:n}){const[o,r]=w.useState(null),[a,i]=w.useState([]),[u,c]=w.useState(0),m=w.useRef(0),[l,A]=w.useState({x:0,y:0}),[S,g]=w.useState(1),[p,d]=w.useState("none"),x=w.useRef({x:0,y:0}),[h,y]=w.useState(!1),{sizeType:_,imageWidth:D,randomRangeImageWidth:W}=e.imageSize,{revealPosition:E,visible:b}=e.position,{cursorType:C,target:F,defaultCursorScale:j,defaultCursor:M,hoverCursorScale:N,hoverCursor:H}=e.cursor;w.useEffect(()=>{if(!o)return;const f=(L,T)=>{const R=o.getBoundingClientRect(),Z=L-R.left,ae=T-R.top;if(A({x:Z,y:ae}),C==="system"){d("none"),g(1);return}const te=Z,ce=ae,P=document.elementFromPoint(R.left+te,R.top+ce);if(P&&P.closest("a")){d("none"),g(1);return}const ee=xo(te,ce,a)||F==="area"?{img:H??"none",scale:N}:{img:M??"none",scale:j};d(ee.img),g(ee.scale)},I=L=>{L.stopPropagation(),x.current={x:L.clientX,y:L.clientY},f(L.clientX,L.clientY)},k=()=>{h&&f(x.current.x,x.current.y)};return o.addEventListener("mousemove",I),window.addEventListener("scroll",k,!0),()=>{o.removeEventListener("mousemove",I),window.removeEventListener("scroll",k,!0)}},[o,h,l,C,F,H,M,N,j,a]),w.useEffect(()=>{h||(d("none"),g(0))},[h]);const B=async(f,I,k,L={})=>{const{width:T,height:R,finalWidth:Z}=await Pa(f.image.url,_,D,W);let ae=0,te=0;E==="same"?(ae=I/2,te=k/2):(ae=L.x??Math.random()*I,te=L.y??Math.random()*k);const ce=Math.min(Math.max(ae,T/2),I-T/2),P=Math.min(Math.max(te,R/2),k-R/2);return{id:m.current++,url:f.image.url,link:f.link,name:f.image.name,x:ce,y:P,width:Z}};w.useEffect(()=>{if(!o||t.length===0)return;const f=o.getBoundingClientRect(),I=f.width,k=f.height,L=[];(async()=>{const R=t[0],Z=await B(R,I,k);L.push(Z),i(L),c(1)})()},[_,D,W,E,o]),w.useEffect(()=>{b==="last One"&&i(f=>f.length>0?[f[f.length-1]]:[])},[b]);const U=async f=>{if(!o)return;const I=o.getBoundingClientRect(),k=f.clientX-I.left,L=f.clientY-I.top;if(F==="image"&&!xo(k,L,a))return;let T=0,R=0;E==="on Click"?(T=k,R=L):E==="same"?(T=I.width/2,R=I.height/2):(T=Math.random()*I.width,R=Math.random()*I.height);const Z=t[u],ae=await B(Z,I.width,I.height,{x:T,y:R});i(te=>b==="all"?[...te,ae]:[ae]),c(te=>te>=t.length-1?0:te+1)};return s.jsxs("div",{ref:r,onClick:U,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),className:ut.imageRevealSlider,style:{cursor:p==="none"?"default":"none"},children:[a.map(f=>s.jsx("div",{className:ut.wrapper,style:{top:`${f.y}px`,left:`${f.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:f.width??"auto",height:"auto",cursor:p==="none"?"default":"none"},children:F==="area"&&f.link?s.jsx("a",{href:f.link,target:"_blank",className:ut.link,children:s.jsx("img",{src:f.url,alt:f.name,className:ut.image},f.id)}):s.jsx("img",{src:f.url,alt:f.name,className:ut.image},f.id)},f.id)),h&&s.jsx("div",{className:ut.cursor,style:{left:`${l.x}px`,top:`${l.y}px`,transform:`translate(-50%, -50%) scale(${S})`,backgroundImage:`url('${p}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Ra={element:Ma,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:""}]}}}},Wa="LightBox-module__hidden___9s-9x",Na="LightBox-module__heroImage___sTxNF",Va="LightBox-module__background___rm9ml",Ha="LightBox-module__editor___4ACaY",ja="LightBox-module__contentStyle___Bgnsq",za="LightBox-module__imageStyle___tLIlB",Oa="LightBox-module__imgWrapper___LuFUp",Ba="LightBox-module__contain___8-yaS",Da="LightBox-module__cover___hNvOG",qa="LightBox-module__caption___b6L2I",Ua="LightBox-module__captionTextInner___rCGNH",Ga="LightBox-module__lightboxSplide___XFuWC",Ya="LightBox-module__arrow___iz38X",Xa="LightBox-module__arrowVertical___Zfz81",Ka="LightBox-module__nextArrow___zkAQN",Za="LightBox-module__arrowInner___p48sW",Ja="LightBox-module__arrowIcon___3VaFf",Qa="LightBox-module__arrowImg___pNV88",es="LightBox-module__mirror___pjeXc",ts="LightBox-module__thumbsWrapper___GB-nU",ns="LightBox-module__thumbsContainerVertical___wttk5",os="LightBox-module__thumbsContainer___osSma",rs="LightBox-module__thumbsAlignStart___MO6tY",is="LightBox-module__thumbsAlignCenter___Q4sUx",as="LightBox-module__thumbsAlignEnd___p4y9R",ss="LightBox-module__thumbItem___HvnF3",ls="LightBox-module__closeButton___g2khP",cs="LightBox-module__fadeIn___0m5GW",us="LightBox-module__slideInLeft___gPYwC",ps="LightBox-module__slideInRight___S-pPp",ds="LightBox-module__slideInTop___DFdAj",ms="LightBox-module__slideInBottom___m27kZ",gs="LightBox-module__fadeOut___55qBR",fs="LightBox-module__slideOutLeft___NvU7P",hs="LightBox-module__slideOutRight___SK7eC",ys="LightBox-module__slideOutTop___Vgg0z",vs="LightBox-module__slideOutBottom___nJ0Ef",bs="LightBox-module__scaleSlide___vZriG",O={hidden:Wa,heroImage:Na,background:Va,editor:Ha,contentStyle:ja,imageStyle:za,imgWrapper:Oa,contain:Ba,cover:Da,caption:qa,captionTextInner:Ua,lightboxSplide:Ga,arrow:Ya,arrowVertical:Xa,nextArrow:Ka,arrowInner:Za,arrowIcon:Ja,arrowImg:Qa,mirror:es,thumbsWrapper:ts,thumbsContainerVertical:ns,thumbsContainer:os,thumbsAlignStart:rs,thumbsAlignCenter:is,thumbsAlignEnd:as,thumbItem:ss,closeButton:ls,fadeIn:cs,slideInLeft:us,slideInRight:ps,slideInTop:ds,slideInBottom:ms,fadeOut:gs,slideOutLeft:fs,slideOutRight:hs,slideOutTop:ys,slideOutBottom:vs,scaleSlide:bs},Ut=(e,t,n)=>{const o={},[r,a]=e.split("-");return r==="top"?(o.top="0",o.bottom="auto"):r==="middle"?(o.top="50%",o.bottom="auto"):r==="bottom"&&(o.top="auto",o.bottom="0"),a==="left"?(o.left="0",o.right="auto"):a==="center"?(o.left="50%",o.right="auto"):a==="right"&&(o.left="auto",o.right="0"),r==="middle"&&a==="center"?o.transform=`translate(calc(-50% + ${$.scalingValue(t.x,n)}), calc(-50% + ${$.scalingValue(t.y,n)}))`:r==="middle"?o.transform=`translate(${$.scalingValue(t.x,n)}, calc(-50% + ${$.scalingValue(t.y,n)}))`:a==="center"?o.transform=`translate(calc(-50% + ${$.scalingValue(t.x,n)}), ${$.scalingValue(t.y,n)})`:o.transform=`translate(${$.scalingValue(t.x,n)}, ${$.scalingValue(t.y,n)})`,o};function dr(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 So(e){const t=e.getBoundingClientRect(),n=dr(e),o=Math.max(0,t.width-n.left-n.right),r=Math.max(0,t.height-n.top-n.bottom),a=e.naturalWidth,i=e.naturalHeight,u=o/r,c=a/i;let m,l;c>u?(m=o,l=o/c):(l=r,m=r*c);const A=t.left+n.left,S=t.top+n.top,g=(o-m)/2+A,p=(r-l)/2+S;return{x:g,y:p,width:m,height:l}}function Co(e){const t=e.getBoundingClientRect(),n=dr(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function wo(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const o=t[1].split(",").map(r=>parseFloat(r.trim()));return o.length===4?o[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const o=n[1].substring(6,8);return parseInt(o,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function xs(e,t){const n=(()=>{if(e==="fade in")return O.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return O.slideInLeft;case"right":return O.slideInRight;case"top":return O.slideInTop;case"bottom":return O.slideInBottom;default:return O.slideInRight}return O.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return O.fadeIn;if(e==="slide in")switch(t){case"left":return O.slideInLeft;case"right":return O.slideInRight;case"top":return O.slideInTop;case"bottom":return O.slideInBottom;default:return O.slideInRight}return O.fadeIn})(),r=(()=>{if(e==="fade in"||e==="mix")return O.fadeOut;if(e==="slide in")switch(t){case"left":return O.slideOutLeft;case"right":return O.slideOutRight;case"top":return O.slideOutTop;case"bottom":return O.slideOutBottom;default:return O.slideOutRight}return O.fadeOut})(),a=(()=>{if(e==="fade in")return O.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return O.slideOutLeft;case"right":return O.slideOutRight;case"top":return O.slideOutTop;case"bottom":return O.slideOutBottom;default:return O.slideOutRight}return O.fadeOut})();return{appearClass:n,backdropAppearClass:o,backdropDisappearClass:r,disappearClass:a}}const Ss=({settings:e,content:t,styles:n,portalId:o,activeEvent:r,isEditor:a})=>{const[i,u]=w.useState(!1),{url:c}=e.thumbnailBlock.cover;return w.useEffect(()=>{r==="close"&&u(!1),r==="open"&&u(!0)},[r]),s.jsxs(s.Fragment,{children:[s.jsx("img",{src:c,alt:"Cover",className:O.heroImage,onClick:()=>u(!0)}),s.jsx(Cs,{isOpen:i,onClose:()=>u(!1),content:t,settings:e,lightboxStyles:n,portalId:o,isEditor:a})]})},Cs=({isOpen:e,onClose:t,content:n,lightboxStyles:o,settings:r,portalId:a,isEditor:i,metadata:u})=>{var V;const[c,m]=w.useState(0),[l,A]=w.useState(0),[S,g]=w.useState(!1),[p,d]=w.useState(!1),[x,h]=w.useState({}),y=w.useRef(null),_=w.useRef(null),D=w.useRef(null),W=w.useRef(!1),E=w.useRef(null),b=w.useRef(null),C=w.useRef(null),F=w.useRef(null),j=w.useRef(!1),M=w.useRef(null),[N,H]=w.useState(!1),{appear:B,triggers:U,slider:f,thumbnail:I,controls:k,area:L,caption:T,layout:R}=r.lightboxBlock,{appearClass:Z,backdropAppearClass:ae,backdropDisappearClass:te,disappearClass:ce}=xs(B.type,B.direction),P=(u==null?void 0:u.itemId)??null;w.useEffect(()=>{const v=()=>{setTimeout(()=>{var K,Q;(Q=(K=y.current)==null?void 0:K.splide)==null||Q.refresh()},16)},q=()=>{A(K=>K+1)};return window.addEventListener("ArticleEditor.Layout:change",v),window.addEventListener("ArticleEditor.ComponentContent:change",q),()=>{window.removeEventListener("ArticleEditor.Layout:change",v),window.removeEventListener("ArticleEditor.ComponentContent:change",q)}},[]),w.useEffect(()=>{if(!e||!I.isActive){H(!1);return}const v=M.current;if(!v)return;const q=()=>{f.direction==="horiz"?H(v.scrollWidth>v.clientWidth):H(v.scrollHeight>v.clientHeight)};q();const K=new ResizeObserver(q);return K.observe(v),()=>K.disconnect()},[e,I.isActive,n.length,x,f.direction]);const ee=w.useCallback(()=>{const v=window.matchMedia("(max-width: 768px)").matches,q=wo(L.color);v&&!i&&q>.9&&(document.body.style.backgroundColor=""),g(!0),W.current=!0;const K=Q=>{Q.target===E.current&&Q.animationName&&(E.current&&b.current&&E.current.removeEventListener("animationend",b.current),b.current=null,W.current&&(W.current=!1,t()),g(!1))};E.current&&(b.current=K,E.current.addEventListener("animationend",K))},[t,L.color,i]),fe=(v,q,K)=>{var Q,ie;if(v){if(U.type==="click"&&U.switch==="image")U.repeat==="close"&&c===n.length-1?ee():(Q=y.current)==null||Q.go("+1");else if(U.type==="click"&&U.switch==="50/50"){const re=v.getBoundingClientRect(),ne=q-re.left,ue=K-re.top,z=re.width,X=re.height;let Y;f.direction==="horiz"?Y=ne<z/2?"-1":"+1":Y=ue<X/2?"-1":"+1",(ie=y.current)==null||ie.go(Y)}}},de=v=>{if(j.current){j.current=!1;return}const q=n[c],K=(q==null?void 0:q.image.objectFit)==="cover";let Q,ie;if("changedTouches"in v&&v.changedTouches.length>0)Q=v.changedTouches[0].clientX,ie=v.changedTouches[0].clientY;else if("clientX"in v)Q=v.clientX,ie=v.clientY;else return;let re;if(K&&D.current){const ne=Co(D.current);re=Q>=ne.left&&Q<=ne.right&&ie>=ne.top&&ie<=ne.bottom}else{const ne=D.current?So(D.current):null;if(!ne){v.target===v.currentTarget&&ee();return}re=Q>=ne.x&&Q<=ne.x+ne.width&&ie>=ne.y&&ie<=ne.y+ne.height}re?fe(D.current,Q,ie):ee()},ge=v=>{const q=v.target;(q.classList.contains(O.thumbsWrapper)||q.classList.contains(O.thumbsContainer))&&de(v)};w.useEffect(()=>{if(!e)return;const v=q=>{var K,Q;if(q.key==="Escape"){ee();return}if(q.key==="ArrowRight"){m(ie=>(ie+1)%Math.max(n.length,1)),(K=y.current)==null||K.go("+1");return}q.key==="ArrowLeft"&&(m(ie=>(ie-1+Math.max(n.length,1))%Math.max(n.length,1)),(Q=y.current)==null||Q.go("-1"))};return window.addEventListener("keydown",v),()=>{window.removeEventListener("keydown",v)}},[e,ee,n.length]),w.useEffect(()=>{if(e){if(m(0),A(q=>q+1),W.current=!1,g(!1),d(!1),h({}),!P)return;const v=new CustomEvent("page-overlay",{detail:{itemId:P}});window.dispatchEvent(v)}return()=>{E.current&&b.current&&(E.current.removeEventListener("animationend",b.current),b.current=null),d(!1)}},[e,P]),w.useEffect(()=>{_.current!==null&&_.current!==f.type&&A(v=>v+1),_.current=f.type},[f.type]),w.useEffect(()=>{if(!e)return;const v=document.body.style.overflow,q=window.matchMedia("(max-width: 768px)").matches,K=wo(L.color);document.body.style.overflow="hidden",d(!1);const Q=re=>{re.target===E.current&&!W.current&&re.animationName&&(q&&!i&&K>.9&&(document.body.style.backgroundColor=L.color),d(!0),E.current&&C.current&&E.current.removeEventListener("animationend",C.current),C.current=null)};E.current&&(C.current=Q,E.current.addEventListener("animationend",Q));const ie=re=>{const ne=re.target;ne&&(ne.closest(`.${O.thumbsWrapper}`)||ne.closest(`.${O.thumbsContainer}`))||f.type!=="slide"&&re.preventDefault()};return document.addEventListener("touchmove",ie,{passive:!1}),()=>{document.body.style.overflow=v,document.removeEventListener("touchmove",ie),E.current&&C.current&&(E.current.removeEventListener("animationend",C.current),C.current=null),d(!1)}},[e,i,L.color,f.type]),w.useEffect(()=>{if(!e)return;const v=q=>{var Q,ie;if(W.current){q.stopPropagation();return}if(j.current){j.current=!1;return}const K=q.target;if(!(K&&(K.closest(`.${O.thumbsContainer}`)||K.closest(`.${O.thumbItem}`)||K.closest(`.${O.arrow}`)||K.closest(`.${O.closeButton}`)||K.closest(`.${O.caption}`)))){if(f.type==="slide"&&U.type==="drag"&&((ie=(Q=y.current)==null?void 0:Q.splide)!=null&&ie.root)){const re=y.current.splide.root;if(K&&(re.contains(K)||re===K))return}if(q.touches.length===0&&q.changedTouches.length>0){const re=n[c],ne=(re==null?void 0:re.image.objectFit)==="cover",ue=q.changedTouches[0];let z;if(ne&&D.current){const X=Co(D.current);z=ue.clientX>=X.left&&ue.clientX<=X.right&&ue.clientY>=X.top&&ue.clientY<=X.bottom}else{const X=D.current?So(D.current):null;if(!X)return;z=ue.clientX>=X.x&&ue.clientX<=X.x+X.width&&ue.clientY>=X.y&&ue.clientY<=X.y+X.height}if(!z){q.stopPropagation(),W.current=!0;const X=Y=>{Y.stopPropagation(),Y.preventDefault(),document.removeEventListener("click",X,!0)};document.addEventListener("click",X,!0),ee()}}}};return document.addEventListener("touchend",v,{passive:!0}),()=>{document.removeEventListener("touchend",v)}},[e,ee,c,n]);const G=(f.type==="scale"||f.type==="fade")&&f.direction==="vert"&&U.type==="drag";w.useEffect(()=>{var Y,se;if(!e||!G||!((se=(Y=y.current)==null?void 0:Y.splide)!=null&&se.root))return;const v=y.current.splide.root,q=30,K=(oe,pe)=>{if(F.current){const we=Math.abs(oe-F.current.x),$e=Math.abs(pe-F.current.y);(we>0||$e>0)&&(j.current=!0)}},Q=oe=>{F.current&&(oe.preventDefault(),K(oe.clientX,oe.clientY))},ie=oe=>{F.current&&oe.touches.length>0&&(oe.preventDefault(),K(oe.touches[0].clientX,oe.touches[0].clientY))},re=(oe,pe)=>{if(!F.current||!y.current){F.current=null;return}const we=Math.abs(oe-F.current.x),$e=Math.abs(pe-F.current.y);$e>q&&$e>we&&y.current.go(pe<F.current.y?"+1":"-1"),F.current=null},ne=oe=>{F.current&&re(oe.clientX,oe.clientY),document.removeEventListener("pointerup",ne),document.removeEventListener("pointercancel",ne),document.removeEventListener("pointermove",Q)},ue=oe=>{if(F.current){if(oe.changedTouches.length>0){const pe=oe.changedTouches[0];re(pe.clientX,pe.clientY)}document.removeEventListener("touchend",ue),document.removeEventListener("touchcancel",ue),document.removeEventListener("touchmove",ie)}},z=oe=>{F.current={x:oe.clientX,y:oe.clientY},j.current=!1,document.addEventListener("pointermove",Q,{passive:!1}),document.addEventListener("pointerup",ne),document.addEventListener("pointercancel",ne)},X=oe=>{oe.touches.length>0&&(F.current={x:oe.touches[0].clientX,y:oe.touches[0].clientY},j.current=!1,document.addEventListener("touchmove",ie,{passive:!1}),document.addEventListener("touchend",ue),document.addEventListener("touchcancel",ue))};return v.addEventListener("pointerdown",z),v.addEventListener("touchstart",X),()=>{v.removeEventListener("pointerdown",z),v.removeEventListener("touchstart",X),document.removeEventListener("pointermove",Q),document.removeEventListener("pointerup",ne),document.removeEventListener("pointercancel",ne),document.removeEventListener("touchmove",ie),document.removeEventListener("touchend",ue),document.removeEventListener("touchcancel",ue),F.current=null,j.current=!1}},[e,G,l]);const me={backgroundColor:L.color,backdropFilter:`blur(${L.blur}px)`,animationDuration:`${parseInt(B.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(a)?null:vr.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{ref:i?null:E,className:ye(O.background,S?te:ae,{[O.editor]:i},{[O.hidden]:!e}),style:{...me,...p&&!i&&!S?{position:"absolute"}:{}}}),s.jsxs("div",{ref:i?E:null,className:ye(O.contentStyle,S?ce:Z,{[O.editor]:i},{[O.hidden]:!e}),style:{animationDuration:`${parseInt(B.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[s.jsx(ur,{onMove:v=>m(v.index),ref:y,className:O.lightboxSplide,options:{arrows:!1,speed:f.duration?parseInt(f.duration):500,direction:f.direction==="horiz"||f.type==="fade"||f.type==="scale"?"ltr":"ttb",pagination:!1,drag:U.type==="drag"&&!G,perPage:1,width:"100%",height:"100%",type:f.type==="fade"||f.type==="scale"?"fade":"loop",padding:0,rewind:U.repeat!=="close",start:0},style:{"--splide-speed":f.duration},children:n.map((v,q)=>{const K=Ut(R.position,R.offset,i),Q=`${$.scalingValue(R.padding.top,i)} ${$.scalingValue(R.padding.right,i)} ${$.scalingValue(R.padding.bottom,i)} ${$.scalingValue(R.padding.left,i)}`,ie=f.type==="scale"?(()=>{const{transform:re,...ne}=K;return{...ne,position:"absolute",padding:Q,boxSizing:"border-box","--position-transform":re||"none"}})():{...K,position:"absolute",padding:Q,boxSizing:"border-box"};return s.jsx(pr,{children:s.jsx("div",{className:O.imgWrapper,onClick:de,children:s.jsx("img",{ref:q===c?D:null,className:ye(O.imageStyle,{[O.contain]:v.image.objectFit==="contain",[O.cover]:v.image.objectFit==="cover",[O.scaleSlide]:f.type==="scale"}),src:v.image.url,alt:v.image.name??"",style:{...ie,pointerEvents:v.image.objectFit==="contain"?"none":"auto"}})})},q)})},l),k.isActive&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:ye(O.arrow,{[O.arrowVertical]:f.direction==="vert"}),style:{color:k.color,"--arrow-hover-color":k.hover},children:s.jsxs("button",{className:O.arrowInner,style:{transform:`translate(${$.scalingValue(k.offset.x,i)}, ${$.scalingValue(k.offset.y*(f.direction==="horiz"?1:-1),i)}) scale(${k.scale}) rotate(${f.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var v;return(v=y.current)==null?void 0:v.go("-1")},"aria-label":"Previous",children:[k.arrowsImgUrl&&s.jsx(Ke,{url:k.arrowsImgUrl,fill:k.color,hoverFill:k.hover,className:ye(O.arrowImg,O.mirror)}),!k.arrowsImgUrl&&s.jsx($o,{color:k.color,className:ye(O.arrowIcon,O.arrowImg,O.mirror)})]})}),s.jsx("div",{className:ye(O.arrow,O.nextArrow,{[O.arrowVertical]:f.direction==="vert"}),style:{color:k.color,"--arrow-hover-color":k.hover},children:s.jsxs("button",{className:O.arrowInner,style:{transform:`translate(${$.scalingValue(k.offset.x*(f.direction==="horiz"?-1:1),i)}, ${$.scalingValue(k.offset.y,i)}) scale(${k.scale}) rotate(${f.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var v;return(v=y.current)==null?void 0:v.go("+1")},"aria-label":"Next",children:[k.arrowsImgUrl&&s.jsx(Ke,{url:k.arrowsImgUrl,fill:k.color,hoverFill:k.hover,className:O.arrowImg}),!k.arrowsImgUrl&&s.jsx($o,{color:k.color,className:ye(O.arrowIcon,O.arrowImg)})]})})]}),L.closeIconUrl&&(()=>{const v=Ut(L.closeIconAlign,L.closeIconOffset,i),q=`scale(${L.closeIconScale})`,K=v.transform?`${v.transform} ${q}`:q;return s.jsx("button",{className:O.closeButton,style:{...v,transform:K},onClick:ee,"aria-label":"Close lightbox",children:s.jsx(Ke,{url:L.closeIconUrl,fill:L.closeIconColor??"#000000",hoverFill:L.closeIconHover??"#cccccc"})})})(),T&&T.isActive&&o.imageCaption&&((V=n[c])==null?void 0:V.imageCaption)&&(()=>{const{widthSettings:v,fontSettings:q,letterSpacing:K,textAlign:Q,wordSpacing:ie,fontSizeLineHeight:re,textAppearance:ne,color:ue}=o.imageCaption;return s.jsx("div",{className:O.caption,style:{...Ut(T.alignment,T.offset,i),fontFamily:yn(q.fontFamily),fontWeight:q.fontWeight,fontStyle:q.fontStyle,width:v.sizing==="auto"?"max-content":$.scalingValue(v.width,i),letterSpacing:$.scalingValue(K,i),wordSpacing:$.scalingValue(ie,i),textAlign:Q,fontSize:$.scalingValue(re.fontSize,i),lineHeight:$.scalingValue(re.lineHeight,i),textTransform:ne.textTransform??"none",textDecoration:ne.textDecoration??"none",fontVariant:ne.fontVariant??"normal",color:ue},onClick:z=>z.stopPropagation(),children:s.jsx("div",{"data-styles":"imageCaption",className:O.captionTextInner,style:{"--link-color":T.linkColor,"--link-hover-color":T.linkHoverColor},children:s.jsx(Mt,{content:n[c].imageCaption})})})})(),I.isActive&&(()=>{const[v,q]=I.position.split("-"),K=f.direction==="horiz"?`${v}-left`:I.position,Q=Ut(K,I.offset,i),ie=()=>{if(f.direction==="horiz"){if(q==="left")return"flex-start";if(q==="center")return"center";if(q==="right")return"flex-end"}else{if(v==="top")return"flex-start";if(v==="middle")return"center";if(v==="bottom")return"flex-end"}return"flex-start"};return s.jsx("div",{ref:M,className:O.thumbsWrapper,onClick:re=>ge(re),style:{position:i?"absolute":"fixed",...Q,...f.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:s.jsx("div",{className:ye(O.thumbsContainer,{[O.thumbsContainerVertical]:f.direction==="vert",[O.thumbsAlignStart]:I.align==="start",[O.thumbsAlignCenter]:I.align==="center",[O.thumbsAlignEnd]:I.align==="end"}),style:{gap:$.scalingValue(I.grid.gap,i),justifyContent:N?"flex-start":ie()},children:n.map((re,ne)=>{const ue=ne===c,z=x[ne],Y=I.grid.size*(ue?I.activeState.scale:1),se=()=>{if(I.fit!=="fit")return{};if(!z)return f.direction==="horiz"?{height:$.scalingValue(Y,i)}:{width:$.scalingValue(Y,i)};const oe=z.width/z.height;if(f.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 s.jsx("button",{className:O.thumbItem,style:{...f.direction==="horiz"&&I.fit!=="fit"?{height:$.scalingValue(Y,i)}:{},...f.direction==="vert"&&I.fit!=="fit"?{width:$.scalingValue(Y,i)}:{},...I.fit==="cover"?{width:$.scalingValue(Y,i),height:$.scalingValue(Y,i)}:{},...se(),transition:ue?"all 0.25s ease-out":"none",opacity:ue?I.activeState.opacity/100:I.opacity/100,"--thumb-hover":I.activeState.opacity/100},onClick:oe=>{var pe;oe.stopPropagation(),m(ne),(pe=y.current)==null||pe.go(ne)},onMouseEnter:()=>{var oe;I.triggers==="hov"&&((oe=y.current)==null||oe.go(ne))},children:s.jsx("img",{src:re.image.url,alt:re.image.name??"",onLoad:oe=>{const pe=oe.currentTarget;pe.naturalWidth&&pe.naturalHeight&&h(we=>({...we,[ne]:{width:pe.naturalWidth,height:pe.naturalHeight}}))},style:{objectFit:I.fit==="cover"?"cover":"contain",...I.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...I.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${re.image.name}-${ne}`)})})})})()]})]}),document.getElementById(a))};function $o({color:e,className:t}){return s.jsx("svg",{viewBox:"0 0 10 18",className:t,children:s.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:s.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 ws={element:Ss,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 Gt(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function $s(e){return`
|
|
6
|
+
*/const ba="RichTextRenderer-module__link___BWeZ2",xa={link:ba},Sa=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(o=>/^\d/.test(o))},yn=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Sa(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function ht(e){const{color:t,...n}=e;return n}function Pe(e,t){var n,o,r;return{fontFamily:yn(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:(o=e.textAppearance)==null?void 0:o.textDecoration,fontVariant:(r=e.textAppearance)==null?void 0:r.fontVariant,color:e.color}}const Rt=({content:e})=>{const t=n=>n.map((o,r)=>o.type==="link"?a.jsx("a",{className:xa.link,href:o.value,target:o.target,children:t(o.children)},r):a.jsx("span",{style:wa(o),children:o.text},r));return a.jsx(a.Fragment,{children:e.map((n,o)=>{const r=n.children;return a.jsx("div",{children:t(r)},o)})})};function wa(e){return{...e.fontFamily&&{fontFamily:yn(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 Ca="SvgImage-module__svg___q3xE-",$a="SvgImage-module__img___VsTm-",vo={svg:Ca,img:$a},Ta=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},_a=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,Xe=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:o="",style:r})=>{const[s,i]=h.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return h.useEffect(()=>{if(typeof window<"u"&&window.CSS){const u=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');i(u)}},[]),!Ta(e)||!s?a.jsx("img",{src:e,alt:"",className:he(vo.img,o),style:r}):a.jsx("span",{"data-supports-mask":s,className:he(vo.svg,o),style:{"--svg":_a(e),"--fill":t,"--hover-fill":n,...r??{}}})},Ea={"top-left":oe.topLeftAlignment,"top-center":oe.topCenterAlignment,"top-right":oe.topRightAlignment,"middle-left":oe.middleLeftAlignment,"middle-center":oe.middleCenterAlignment,"middle-right":oe.middleRightAlignment,"bottom-left":oe.bottomLeftAlignment,"bottom-center":oe.bottomCenterAlignment,"bottom-right":oe.bottomRightAlignment};function ka({settings:e,content:t,styles:n,isEditor:o}){const[r,s]=h.useState(null),{widthSettings:i,fontSettings:u,letterSpacing:l,textAlign:m,wordSpacing:c,fontSizeLineHeight:T,textAppearance:S,color:g}=n.imageCaption,[p,d]=h.useState(void 0),[x,y]=h.useState(null),[b,E]=h.useState(0),[K,k]=h.useState(0),{direction:I,transition:w,controls:C,pagination:R,imageCaption:z,triggers:P}=e,H=h.useRef(w.type),{x:j,y:D}=e.controls.offset,G=v=>{r&&r.go(v)};return h.useEffect(()=>{if(!x)return;const v=new ResizeObserver(F=>{if(!r)return;const[A]=F;d({width:Math.round(A.contentRect.width),height:Math.round(A.contentRect.height)})});return v.observe(x),()=>v.unobserve(x)},[x]),h.useEffect(()=>{!r||H.current===w.type||(k(v=>v+1),H.current=w.type)},[w.type]),a.jsx("div",{className:he(oe.wrapper,{[oe.editor]:o}),ref:y,children:a.jsxs("div",{className:oe.sliderInner,style:{width:p?p.width:"100%",height:p?p.height:"100%",backgroundColor:w.backgroundColor&&w.type==="fade in"?w.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:he(oe.captionBlock),children:a.jsx("div",{className:oe.captionTextWrapper,children:t.map((v,F)=>a.jsx("div",{className:he(oe.captionText,Ea[z.alignment],{[oe.withPointerEvents]:F===b&&o,[oe.active]:F===b}),style:{fontFamily:yn(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:i.sizing==="auto"?"max-content":_.scalingValue(i.width,o),letterSpacing:_.scalingValue(l,o),wordSpacing:_.scalingValue(c,o),textAlign:m,fontSize:_.scalingValue(T.fontSize,o),lineHeight:_.scalingValue(T.lineHeight,o),textTransform:S.textTransform??"none",textDecoration:S.textDecoration??"none",fontVariant:S.fontVariant??"normal",color:g,transitionDuration:w.duration?`${Math.round(parseInt(w.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:oe.captionTextInner,style:{"--link-hover-color":z.linkHoverColor,"--link-color":z.linkColor,position:"relative",top:_.scalingValue(z.offset.y,o),left:_.scalingValue(z.offset.x,o)},children:a.jsx(Rt,{content:v.imageCaption})})},F))})}),a.jsx(pr,{onMove:v=>{E(v.index)},ref:s,options:{arrows:!1,speed:w.duration?parseInt(w.duration):500,autoplay:P.autoPlay!==null,...P.autoPlay!==null&&{interval:parseInt(P.autoPlay)*1e3},direction:I==="horiz"||w.type==="fade in"?"ltr":"ttb",pagination:!1,drag:P.triggersList.drag,perPage:1,width:p?p.width:"100%",height:p?p.height:"100%",type:w.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((v,F)=>a.jsx(dr,{children:a.jsx("div",{className:oe.sliderItem,children:a.jsx("div",{className:oe.imgWrapper,children:a.jsx("img",{className:he(oe.sliderImage,{[oe.contain]:v.image.objectFit==="contain",[oe.cover]:v.image.objectFit==="cover"}),src:v.image.url,alt:v.image.name??""})})})},F))},K),C.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:he(oe.arrow,{[oe.arrowVertical]:I==="vert",[oe.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:a.jsxs("button",{onClick:()=>{G("-1")},className:oe.arrowInner,style:{transform:`translate(${_.scalingValue(j,o)}, ${_.scalingValue(D*(I==="horiz"?1:-1),o)}) scale(${e.controls.scale/100}) rotate(${I==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&a.jsx(Xe,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:he(oe.arrowImg,oe.mirror)}),!C.arrowsImgUrl&&a.jsx(bo,{color:C.color,className:he(oe.arrowIcon,oe.arrowImg,oe.mirror)})]})}),a.jsx("div",{className:he(oe.arrow,oe.nextArrow,{[oe.arrowVertical]:I==="vert",[oe.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:a.jsxs("button",{className:oe.arrowInner,onClick:()=>G("+1"),style:{transform:`translate(${_.scalingValue(j*(I==="horiz"?-1:1),o)}, ${_.scalingValue(D,o)}) scale(${e.controls.scale/100}) rotate(${I==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&a.jsx(Xe,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:oe.arrowImg}),!C.arrowsImgUrl&&a.jsx(bo,{color:C.color,className:he(oe.arrowIcon,oe.arrowImg)})]})})]}),P.triggersList.click&&a.jsx("div",{className:oe.clickOverlay,onClick:()=>{r&&r.go("+1")}}),R.isActive&&a.jsx("div",{className:he(oe.pagination,{[oe.paginationInsideBottom]:R.position==="inside-1"&&I==="horiz",[oe.paginationInsideTop]:R.position==="inside-2"&&I==="horiz",[oe.paginationOutsideBottom]:R.position==="outside-1"&&I==="horiz",[oe.paginationOutsideTop]:R.position==="outside-2"&&I==="horiz",[oe.paginationInsideLeft]:R.position==="inside-1"&&I==="vert",[oe.paginationInsideRight]:R.position==="inside-2"&&I==="vert",[oe.paginationOutsideLeft]:R.position==="outside-1"&&I==="vert",[oe.paginationOutsideRight]:R.position==="outside-2"&&I==="vert",[oe.paginationVertical]:I==="vert"}),children:a.jsx("div",{className:oe.paginationInner,style:{backgroundColor:R.colors[2],transform:`scale(${R.scale/100}) translate(${_.scalingValue(R.offset.x,o)}, ${_.scalingValue(R.offset.y,o)}) rotate(${I==="horiz"?"0deg":"90deg"})`},children:t.map((v,F)=>a.jsx("button",{onClick:()=>{r&&r.go(F)},className:he(oe.paginationItem),children:a.jsx("div",{className:he(oe.dot,{[oe.activeDot]:F===b}),style:{backgroundColor:F===b?R.colors[0]:R.colors[1],"--pagination-hover-color":R.hover}})},F))})})]})})}function bo({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 Ia={element:ka,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"]}},Aa="ImageRevealSlider-module__imageRevealSlider___UE5Ob",La="ImageRevealSlider-module__image___Qjt-e",Fa="ImageRevealSlider-module__link___N-iLG",Ma="ImageRevealSlider-module__cursor___2U03d",ut={imageRevealSlider:Aa,image:La,link:Fa,cursor:Ma};function xo(e,t,n){for(const o of n){const r=new Image;r.src=o.url;const s=o.width?Number.parseFloat(o.width):r.naturalWidth,i=r.naturalHeight/r.naturalWidth*s,u=s/2,l=i/2;if(e>=o.x-u&&e<=o.x+u&&t>=o.y-l&&t<=o.y+l)return!0}return!1}function Cn(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Ra(e,t,n,o){let r,s;if(t==="custom"){r=n;const i=await Cn(e);s=i.height/i.width*r}else if(t==="random"){r=Math.random()*(o.max-o.min)+o.min;const i=await Cn(e);s=i.height/i.width*r}else{const i=await Cn(e);r=i.width,s=i.height}return{width:r,height:s,finalWidth:`${r}px`}}function Pa({settings:e,content:t,isEditor:n}){const[o,r]=h.useState(null),[s,i]=h.useState([]),[u,l]=h.useState(0),m=h.useRef(0),[c,T]=h.useState({x:0,y:0}),[S,g]=h.useState(1),[p,d]=h.useState("none"),x=h.useRef({x:0,y:0}),[y,b]=h.useState(!1),{sizeType:E,imageWidth:K,randomRangeImageWidth:k}=e.imageSize,{revealPosition:I,visible:w}=e.position,{cursorType:C,target:R,defaultCursorScale:z,defaultCursor:P,hoverCursorScale:H,hoverCursor:j}=e.cursor;h.useEffect(()=>{if(!o)return;const v=(M,$)=>{const N=o.getBoundingClientRect(),J=M-N.left,ce=$-N.top;if(T({x:J,y:ce}),C==="system"){d("none"),g(1);return}const re=J,ge=ce,W=document.elementFromPoint(N.left+re,N.top+ge);if(W&&W.closest("a")){d("none"),g(1);return}const V=xo(re,ge,s)||R==="area"?{img:j??"none",scale:H}:{img:P??"none",scale:z};d(V.img),g(V.scale)},F=M=>{M.stopPropagation(),x.current={x:M.clientX,y:M.clientY},v(M.clientX,M.clientY)},A=()=>{y&&v(x.current.x,x.current.y)};return o.addEventListener("mousemove",F),window.addEventListener("scroll",A,!0),()=>{o.removeEventListener("mousemove",F),window.removeEventListener("scroll",A,!0)}},[o,y,c,C,R,j,P,H,z,s]),h.useEffect(()=>{y||(d("none"),g(0))},[y]);const D=async(v,F,A,M={})=>{const{width:$,height:N,finalWidth:J}=await Ra(v.image.url,E,K,k);let ce=0,re=0;I==="same"?(ce=F/2,re=A/2):(ce=M.x??Math.random()*F,re=M.y??Math.random()*A);const ge=Math.min(Math.max(ce,$/2),F-$/2),W=Math.min(Math.max(re,N/2),A-N/2);return{id:m.current++,url:v.image.url,link:v.link,name:v.image.name,x:ge,y:W,width:J}};h.useEffect(()=>{if(!o||t.length===0)return;const v=o.getBoundingClientRect(),F=v.width,A=v.height,M=[];(async()=>{const N=t[0],J=await D(N,F,A);M.push(J),i(M),l(1)})()},[E,K,k,I,o]),h.useEffect(()=>{w==="last One"&&i(v=>v.length>0?[v[v.length-1]]:[])},[w]);const G=async v=>{if(!o)return;const F=o.getBoundingClientRect(),A=v.clientX-F.left,M=v.clientY-F.top;if(R==="image"&&!xo(A,M,s))return;let $=0,N=0;I==="on Click"?($=A,N=M):I==="same"?($=F.width/2,N=F.height/2):($=Math.random()*F.width,N=Math.random()*F.height);const J=t[u],ce=await D(J,F.width,F.height,{x:$,y:N});i(re=>w==="all"?[...re,ce]:[ce]),l(re=>re>=t.length-1?0:re+1)};return a.jsxs("div",{ref:r,onClick:G,onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),className:ut.imageRevealSlider,style:{cursor:p==="none"?"default":"none"},children:[s.map(v=>a.jsx("div",{className:ut.wrapper,style:{top:`${v.y}px`,left:`${v.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:v.width??"auto",height:"auto",cursor:p==="none"?"default":"none"},children:R==="area"&&v.link?a.jsx("a",{href:v.link,target:"_blank",className:ut.link,children:a.jsx("img",{src:v.url,alt:v.name,className:ut.image},v.id)}):a.jsx("img",{src:v.url,alt:v.name,className:ut.image},v.id)},v.id)),y&&a.jsx("div",{className:ut.cursor,style:{left:`${c.x}px`,top:`${c.y}px`,transform:`translate(-50%, -50%) scale(${S})`,backgroundImage:`url('${p}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Wa={element:Pa,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:""}]}}}},Na="LightBox-module__hidden___9s-9x",Ha="LightBox-module__heroImage___sTxNF",ja="LightBox-module__background___rm9ml",Va="LightBox-module__editor___4ACaY",Oa="LightBox-module__contentStyle___Bgnsq",za="LightBox-module__imageStyle___tLIlB",Ba="LightBox-module__imgWrapper___LuFUp",Da="LightBox-module__contain___8-yaS",qa="LightBox-module__cover___hNvOG",Ua="LightBox-module__caption___b6L2I",Ka="LightBox-module__captionTextInner___rCGNH",Ga="LightBox-module__lightboxSplide___XFuWC",Ya="LightBox-module__arrow___iz38X",Xa="LightBox-module__arrowVertical___Zfz81",Za="LightBox-module__nextArrow___zkAQN",Ja="LightBox-module__arrowInner___p48sW",Qa="LightBox-module__arrowIcon___3VaFf",es="LightBox-module__arrowImg___pNV88",ts="LightBox-module__mirror___pjeXc",ns="LightBox-module__thumbsWrapper___GB-nU",os="LightBox-module__thumbsContainerVertical___wttk5",rs="LightBox-module__thumbsContainer___osSma",is="LightBox-module__thumbsAlignStart___MO6tY",as="LightBox-module__thumbsAlignCenter___Q4sUx",ss="LightBox-module__thumbsAlignEnd___p4y9R",ls="LightBox-module__thumbItem___HvnF3",cs="LightBox-module__closeButton___g2khP",us="LightBox-module__fadeIn___0m5GW",ps="LightBox-module__slideInLeft___gPYwC",ds="LightBox-module__slideInRight___S-pPp",ms="LightBox-module__slideInTop___DFdAj",gs="LightBox-module__slideInBottom___m27kZ",fs="LightBox-module__fadeOut___55qBR",hs="LightBox-module__slideOutLeft___NvU7P",ys="LightBox-module__slideOutRight___SK7eC",vs="LightBox-module__slideOutTop___Vgg0z",bs="LightBox-module__slideOutBottom___nJ0Ef",xs="LightBox-module__scaleSlide___vZriG",U={hidden:Na,heroImage:Ha,background:ja,editor:Va,contentStyle:Oa,imageStyle:za,imgWrapper:Ba,contain:Da,cover:qa,caption:Ua,captionTextInner:Ka,lightboxSplide:Ga,arrow:Ya,arrowVertical:Xa,nextArrow:Za,arrowInner:Ja,arrowIcon:Qa,arrowImg:es,mirror:ts,thumbsWrapper:ns,thumbsContainerVertical:os,thumbsContainer:rs,thumbsAlignStart:is,thumbsAlignCenter:as,thumbsAlignEnd:ss,thumbItem:ls,closeButton:cs,fadeIn:us,slideInLeft:ps,slideInRight:ds,slideInTop:ms,slideInBottom:gs,fadeOut:fs,slideOutLeft:hs,slideOutRight:ys,slideOutTop:vs,slideOutBottom:bs,scaleSlide:xs},Ut=(e,t,n)=>{const o={},[r,s]=e.split("-");return r==="top"?(o.top="0",o.bottom="auto"):r==="middle"?(o.top="50%",o.bottom="auto"):r==="bottom"&&(o.top="auto",o.bottom="0"),s==="left"?(o.left="0",o.right="auto"):s==="center"?(o.left="50%",o.right="auto"):s==="right"&&(o.left="auto",o.right="0"),r==="middle"&&s==="center"?o.transform=`translate(calc(-50% + ${_.scalingValue(t.x,n)}), calc(-50% + ${_.scalingValue(t.y,n)}))`:r==="middle"?o.transform=`translate(${_.scalingValue(t.x,n)}, calc(-50% + ${_.scalingValue(t.y,n)}))`:s==="center"?o.transform=`translate(calc(-50% + ${_.scalingValue(t.x,n)}), ${_.scalingValue(t.y,n)})`:o.transform=`translate(${_.scalingValue(t.x,n)}, ${_.scalingValue(t.y,n)})`,o};function mr(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 So(e){const t=e.getBoundingClientRect(),n=mr(e),o=Math.max(0,t.width-n.left-n.right),r=Math.max(0,t.height-n.top-n.bottom),s=e.naturalWidth,i=e.naturalHeight,u=o/r,l=s/i;let m,c;l>u?(m=o,c=o/l):(c=r,m=r*l);const T=t.left+n.left,S=t.top+n.top,g=(o-m)/2+T,p=(r-c)/2+S;return{x:g,y:p,width:m,height:c}}function wo(e){const t=e.getBoundingClientRect(),n=mr(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Co(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const o=t[1].split(",").map(r=>parseFloat(r.trim()));return o.length===4?o[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const o=n[1].substring(6,8);return parseInt(o,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function Ss(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})(),o=(()=>{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})(),r=(()=>{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:o,backdropDisappearClass:r,disappearClass:s}}const ws=({settings:e,content:t,styles:n,portalId:o,activeEvent:r,isEditor:s})=>{const[i,u]=h.useState(!1),{url:l}=e.thumbnailBlock.cover;return h.useEffect(()=>{r==="close"&&u(!1),r==="open"&&u(!0)},[r]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:l,alt:"Cover",className:U.heroImage,onClick:()=>u(!0)}),a.jsx(Cs,{isOpen:i,onClose:()=>u(!1),content:t,settings:e,lightboxStyles:n,portalId:o,isEditor:s})]})},Cs=({isOpen:e,onClose:t,content:n,lightboxStyles:o,settings:r,portalId:s,isEditor:i,metadata:u})=>{var L;const[l,m]=h.useState(0),[c,T]=h.useState(0),[S,g]=h.useState(!1),[p,d]=h.useState(!1),[x,y]=h.useState({}),b=h.useRef(null),E=h.useRef(null),K=h.useRef(null),k=h.useRef(!1),I=h.useRef(null),w=h.useRef(null),C=h.useRef(null),R=h.useRef(null),z=h.useRef(!1),P=h.useRef(null),[H,j]=h.useState(!1),{appear:D,triggers:G,slider:v,thumbnail:F,controls:A,area:M,caption:$,layout:N}=r.lightboxBlock,{appearClass:J,backdropAppearClass:ce,backdropDisappearClass:re,disappearClass:ge}=Ss(D.type,D.direction),W=(u==null?void 0:u.itemId)??null;h.useEffect(()=>{const f=()=>{setTimeout(()=>{var Y,ee;(ee=(Y=b.current)==null?void 0:Y.splide)==null||ee.refresh()},16)},O=()=>{T(Y=>Y+1)};return window.addEventListener("ArticleEditor.Layout:change",f),window.addEventListener("ArticleEditor.ComponentContent:change",O),()=>{window.removeEventListener("ArticleEditor.Layout:change",f),window.removeEventListener("ArticleEditor.ComponentContent:change",O)}},[]),h.useEffect(()=>{if(!e||!F.isActive){j(!1);return}const f=P.current;if(!f)return;const O=()=>{v.direction==="horiz"?j(f.scrollWidth>f.clientWidth):j(f.scrollHeight>f.clientHeight)};O();const Y=new ResizeObserver(O);return Y.observe(f),()=>Y.disconnect()},[e,F.isActive,n.length,x,v.direction]);const V=h.useCallback(()=>{const f=window.matchMedia("(max-width: 768px)").matches,O=Co(M.color);f&&!i&&O>.9&&(document.body.style.backgroundColor=""),g(!0),k.current=!0;const Y=ee=>{ee.target===I.current&&ee.animationName&&(I.current&&w.current&&I.current.removeEventListener("animationend",w.current),w.current=null,k.current&&(k.current=!1,t()),g(!1))};I.current&&(w.current=Y,I.current.addEventListener("animationend",Y))},[t,M.color,i]),Q=(f,O,Y)=>{var ee,ue;if(f){if(G.type==="click"&&G.switch==="image")G.repeat==="close"&&l===n.length-1?V():(ee=b.current)==null||ee.go("+1");else if(G.type==="click"&&G.switch==="50/50"){const le=f.getBoundingClientRect(),ae=O-le.left,fe=Y-le.top,B=le.width,Z=le.height;let X;v.direction==="horiz"?X=ae<B/2?"-1":"+1":X=fe<Z/2?"-1":"+1",(ue=b.current)==null||ue.go(X)}}},te=f=>{if(z.current){z.current=!1;return}const O=n[l],Y=(O==null?void 0:O.image.objectFit)==="cover";let ee,ue;if("changedTouches"in f&&f.changedTouches.length>0)ee=f.changedTouches[0].clientX,ue=f.changedTouches[0].clientY;else if("clientX"in f)ee=f.clientX,ue=f.clientY;else return;let le;if(Y&&K.current){const ae=wo(K.current);le=ee>=ae.left&&ee<=ae.right&&ue>=ae.top&&ue<=ae.bottom}else{const ae=K.current?So(K.current):null;if(!ae){f.target===f.currentTarget&&V();return}le=ee>=ae.x&&ee<=ae.x+ae.width&&ue>=ae.y&&ue<=ae.y+ae.height}le?Q(K.current,ee,ue):V()},se=f=>{const O=f.target;(O.classList.contains(U.thumbsWrapper)||O.classList.contains(U.thumbsContainer))&&te(f)};h.useEffect(()=>{if(!e)return;const f=O=>{var Y,ee;if(O.key==="Escape"){V();return}if(O.key==="ArrowRight"){m(ue=>(ue+1)%Math.max(n.length,1)),(Y=b.current)==null||Y.go("+1");return}O.key==="ArrowLeft"&&(m(ue=>(ue-1+Math.max(n.length,1))%Math.max(n.length,1)),(ee=b.current)==null||ee.go("-1"))};return window.addEventListener("keydown",f),()=>{window.removeEventListener("keydown",f)}},[e,V,n.length]),h.useEffect(()=>{if(e){if(m(0),T(O=>O+1),k.current=!1,g(!1),d(!1),y({}),!W)return;const f=new CustomEvent("page-overlay",{detail:{itemId:W}});window.dispatchEvent(f)}return()=>{I.current&&w.current&&(I.current.removeEventListener("animationend",w.current),w.current=null),d(!1)}},[e,W]),h.useEffect(()=>{E.current!==null&&E.current!==v.type&&T(f=>f+1),E.current=v.type},[v.type]),h.useEffect(()=>{if(!e)return;const f=document.body.style.overflow,O=window.matchMedia("(max-width: 768px)").matches,Y=Co(M.color);document.body.style.overflow="hidden",d(!1);const ee=le=>{le.target===I.current&&!k.current&&le.animationName&&(O&&!i&&Y>.9&&(document.body.style.backgroundColor=M.color),d(!0),I.current&&C.current&&I.current.removeEventListener("animationend",C.current),C.current=null)};I.current&&(C.current=ee,I.current.addEventListener("animationend",ee));const ue=le=>{const ae=le.target;ae&&(ae.closest(`.${U.thumbsWrapper}`)||ae.closest(`.${U.thumbsContainer}`))||v.type!=="slide"&&le.preventDefault()};return document.addEventListener("touchmove",ue,{passive:!1}),()=>{document.body.style.overflow=f,document.removeEventListener("touchmove",ue),I.current&&C.current&&(I.current.removeEventListener("animationend",C.current),C.current=null),d(!1)}},[e,i,M.color,v.type]),h.useEffect(()=>{if(!e)return;const f=O=>{var ee,ue;if(k.current){O.stopPropagation();return}if(z.current){z.current=!1;return}const Y=O.target;if(!(Y&&(Y.closest(`.${U.thumbsContainer}`)||Y.closest(`.${U.thumbItem}`)||Y.closest(`.${U.arrow}`)||Y.closest(`.${U.closeButton}`)||Y.closest(`.${U.caption}`)))){if(v.type==="slide"&&G.type==="drag"&&((ue=(ee=b.current)==null?void 0:ee.splide)!=null&&ue.root)){const le=b.current.splide.root;if(Y&&(le.contains(Y)||le===Y))return}if(O.touches.length===0&&O.changedTouches.length>0){const le=n[l],ae=(le==null?void 0:le.image.objectFit)==="cover",fe=O.changedTouches[0];let B;if(ae&&K.current){const Z=wo(K.current);B=fe.clientX>=Z.left&&fe.clientX<=Z.right&&fe.clientY>=Z.top&&fe.clientY<=Z.bottom}else{const Z=K.current?So(K.current):null;if(!Z)return;B=fe.clientX>=Z.x&&fe.clientX<=Z.x+Z.width&&fe.clientY>=Z.y&&fe.clientY<=Z.y+Z.height}if(!B){O.stopPropagation(),k.current=!0;const Z=X=>{X.stopPropagation(),X.preventDefault(),document.removeEventListener("click",Z,!0)};document.addEventListener("click",Z,!0),V()}}}};return document.addEventListener("touchend",f,{passive:!0}),()=>{document.removeEventListener("touchend",f)}},[e,V,l,n]);const q=(v.type==="scale"||v.type==="fade")&&v.direction==="vert"&&G.type==="drag";h.useEffect(()=>{var X,pe;if(!e||!q||!((pe=(X=b.current)==null?void 0:X.splide)!=null&&pe.root))return;const f=b.current.splide.root,O=30,Y=(ne,me)=>{if(R.current){const we=Math.abs(ne-R.current.x),Ce=Math.abs(me-R.current.y);(we>0||Ce>0)&&(z.current=!0)}},ee=ne=>{R.current&&(ne.preventDefault(),Y(ne.clientX,ne.clientY))},ue=ne=>{R.current&&ne.touches.length>0&&(ne.preventDefault(),Y(ne.touches[0].clientX,ne.touches[0].clientY))},le=(ne,me)=>{if(!R.current||!b.current){R.current=null;return}const we=Math.abs(ne-R.current.x),Ce=Math.abs(me-R.current.y);Ce>O&&Ce>we&&b.current.go(me<R.current.y?"+1":"-1"),R.current=null},ae=ne=>{R.current&&le(ne.clientX,ne.clientY),document.removeEventListener("pointerup",ae),document.removeEventListener("pointercancel",ae),document.removeEventListener("pointermove",ee)},fe=ne=>{if(R.current){if(ne.changedTouches.length>0){const me=ne.changedTouches[0];le(me.clientX,me.clientY)}document.removeEventListener("touchend",fe),document.removeEventListener("touchcancel",fe),document.removeEventListener("touchmove",ue)}},B=ne=>{R.current={x:ne.clientX,y:ne.clientY},z.current=!1,document.addEventListener("pointermove",ee,{passive:!1}),document.addEventListener("pointerup",ae),document.addEventListener("pointercancel",ae)},Z=ne=>{ne.touches.length>0&&(R.current={x:ne.touches[0].clientX,y:ne.touches[0].clientY},z.current=!1,document.addEventListener("touchmove",ue,{passive:!1}),document.addEventListener("touchend",fe),document.addEventListener("touchcancel",fe))};return f.addEventListener("pointerdown",B),f.addEventListener("touchstart",Z),()=>{f.removeEventListener("pointerdown",B),f.removeEventListener("touchstart",Z),document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",ae),document.removeEventListener("pointercancel",ae),document.removeEventListener("touchmove",ue),document.removeEventListener("touchend",fe),document.removeEventListener("touchcancel",fe),R.current=null,z.current=!1}},[e,q,c]);const ie={backgroundColor:M.color,backdropFilter:`blur(${M.blur}px)`,animationDuration:`${parseInt(D.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(s)?null:br.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:i?null:I,className:he(U.background,S?re:ce,{[U.editor]:i},{[U.hidden]:!e}),style:{...ie,...p&&!i&&!S?{position:"absolute"}:{}}}),a.jsxs("div",{ref:i?I:null,className:he(U.contentStyle,S?ge:J,{[U.editor]:i},{[U.hidden]:!e}),style:{animationDuration:`${parseInt(D.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(pr,{onMove:f=>m(f.index),ref:b,className:U.lightboxSplide,options:{arrows:!1,speed:v.duration?parseInt(v.duration):500,direction:v.direction==="horiz"||v.type==="fade"||v.type==="scale"?"ltr":"ttb",pagination:!1,drag:G.type==="drag"&&!q,perPage:1,width:"100%",height:"100%",type:v.type==="fade"||v.type==="scale"?"fade":"loop",padding:0,rewind:G.repeat!=="close",start:0},style:{"--splide-speed":v.duration},children:n.map((f,O)=>{const Y=Ut(N.position,N.offset,i),ee=`${_.scalingValue(N.padding.top,i)} ${_.scalingValue(N.padding.right,i)} ${_.scalingValue(N.padding.bottom,i)} ${_.scalingValue(N.padding.left,i)}`,ue=v.type==="scale"?(()=>{const{transform:le,...ae}=Y;return{...ae,position:"absolute",padding:ee,boxSizing:"border-box","--position-transform":le||"none"}})():{...Y,position:"absolute",padding:ee,boxSizing:"border-box"};return a.jsx(dr,{children:a.jsx("div",{className:U.imgWrapper,onClick:te,children:a.jsx("img",{ref:O===l?K:null,className:he(U.imageStyle,{[U.contain]:f.image.objectFit==="contain",[U.cover]:f.image.objectFit==="cover",[U.scaleSlide]:v.type==="scale"}),src:f.image.url,alt:f.image.name??"",style:{...ue,pointerEvents:f.image.objectFit==="contain"?"none":"auto"}})})},O)})},c),A.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:he(U.arrow,{[U.arrowVertical]:v.direction==="vert"}),style:{color:A.color,"--arrow-hover-color":A.hover},children:a.jsxs("button",{className:U.arrowInner,style:{transform:`translate(${_.scalingValue(A.offset.x,i)}, ${_.scalingValue(A.offset.y*(v.direction==="horiz"?1:-1),i)}) scale(${A.scale}) rotate(${v.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var f;return(f=b.current)==null?void 0:f.go("-1")},"aria-label":"Previous",children:[A.arrowsImgUrl&&a.jsx(Xe,{url:A.arrowsImgUrl,fill:A.color,hoverFill:A.hover,className:he(U.arrowImg,U.mirror)}),!A.arrowsImgUrl&&a.jsx($o,{color:A.color,className:he(U.arrowIcon,U.arrowImg,U.mirror)})]})}),a.jsx("div",{className:he(U.arrow,U.nextArrow,{[U.arrowVertical]:v.direction==="vert"}),style:{color:A.color,"--arrow-hover-color":A.hover},children:a.jsxs("button",{className:U.arrowInner,style:{transform:`translate(${_.scalingValue(A.offset.x*(v.direction==="horiz"?-1:1),i)}, ${_.scalingValue(A.offset.y,i)}) scale(${A.scale}) rotate(${v.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var f;return(f=b.current)==null?void 0:f.go("+1")},"aria-label":"Next",children:[A.arrowsImgUrl&&a.jsx(Xe,{url:A.arrowsImgUrl,fill:A.color,hoverFill:A.hover,className:U.arrowImg}),!A.arrowsImgUrl&&a.jsx($o,{color:A.color,className:he(U.arrowIcon,U.arrowImg)})]})})]}),M.closeIconUrl&&(()=>{const f=Ut(M.closeIconAlign,M.closeIconOffset,i),O=`scale(${M.closeIconScale})`,Y=f.transform?`${f.transform} ${O}`:O;return a.jsx("button",{className:U.closeButton,style:{...f,transform:Y},onClick:V,"aria-label":"Close lightbox",children:a.jsx(Xe,{url:M.closeIconUrl,fill:M.closeIconColor??"#000000",hoverFill:M.closeIconHover??"#cccccc"})})})(),$&&$.isActive&&o.imageCaption&&((L=n[l])==null?void 0:L.imageCaption)&&(()=>{const{widthSettings:f,fontSettings:O,letterSpacing:Y,textAlign:ee,wordSpacing:ue,fontSizeLineHeight:le,textAppearance:ae,color:fe}=o.imageCaption;return a.jsx("div",{className:U.caption,style:{...Ut($.alignment,$.offset,i),fontFamily:yn(O.fontFamily),fontWeight:O.fontWeight,fontStyle:O.fontStyle,width:f.sizing==="auto"?"max-content":_.scalingValue(f.width,i),letterSpacing:_.scalingValue(Y,i),wordSpacing:_.scalingValue(ue,i),textAlign:ee,fontSize:_.scalingValue(le.fontSize,i),lineHeight:_.scalingValue(le.lineHeight,i),textTransform:ae.textTransform??"none",textDecoration:ae.textDecoration??"none",fontVariant:ae.fontVariant??"normal",color:fe},onClick:B=>B.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:U.captionTextInner,style:{"--link-color":$.linkColor,"--link-hover-color":$.linkHoverColor},children:a.jsx(Rt,{content:n[l].imageCaption})})})})(),F.isActive&&(()=>{const[f,O]=F.position.split("-"),Y=v.direction==="horiz"?`${f}-left`:F.position,ee=Ut(Y,F.offset,i),ue=()=>{if(v.direction==="horiz"){if(O==="left")return"flex-start";if(O==="center")return"center";if(O==="right")return"flex-end"}else{if(f==="top")return"flex-start";if(f==="middle")return"center";if(f==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:P,className:U.thumbsWrapper,onClick:le=>se(le),style:{position:i?"absolute":"fixed",...ee,...v.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:he(U.thumbsContainer,{[U.thumbsContainerVertical]:v.direction==="vert",[U.thumbsAlignStart]:F.align==="start",[U.thumbsAlignCenter]:F.align==="center",[U.thumbsAlignEnd]:F.align==="end"}),style:{gap:_.scalingValue(F.grid.gap,i),justifyContent:H?"flex-start":ue()},children:n.map((le,ae)=>{const fe=ae===l,B=x[ae],X=F.grid.size*(fe?F.activeState.scale:1),pe=()=>{if(F.fit!=="fit")return{};if(!B)return v.direction==="horiz"?{height:_.scalingValue(X,i)}:{width:_.scalingValue(X,i)};const ne=B.width/B.height;if(v.direction==="horiz"){const me=X,we=me*ne;return{width:_.scalingValue(we,i),height:_.scalingValue(me,i)}}else{const me=X,we=me/ne;return{width:_.scalingValue(me,i),height:_.scalingValue(we,i)}}};return a.jsx("button",{className:U.thumbItem,style:{...v.direction==="horiz"&&F.fit!=="fit"?{height:_.scalingValue(X,i)}:{},...v.direction==="vert"&&F.fit!=="fit"?{width:_.scalingValue(X,i)}:{},...F.fit==="cover"?{width:_.scalingValue(X,i),height:_.scalingValue(X,i)}:{},...pe(),transition:fe?"all 0.25s ease-out":"none",opacity:fe?F.activeState.opacity/100:F.opacity/100,"--thumb-hover":F.activeState.opacity/100},onClick:ne=>{var me;ne.stopPropagation(),m(ae),(me=b.current)==null||me.go(ae)},onMouseEnter:()=>{var ne;F.triggers==="hov"&&((ne=b.current)==null||ne.go(ae))},children:a.jsx("img",{src:le.image.url,alt:le.image.name??"",onLoad:ne=>{const me=ne.currentTarget;me.naturalWidth&&me.naturalHeight&&y(we=>({...we,[ae]:{width:me.naturalWidth,height:me.naturalHeight}}))},style:{objectFit:F.fit==="cover"?"cover":"contain",...F.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...F.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${le.image.name}-${ae}`)})})})})()]})]}),document.getElementById(s))};function $o({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 $s={element:ws,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 Kt(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ts(e){return`
|
|
7
7
|
.${e}-wrapper {
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
10
10
|
width: 100%;
|
|
11
|
-
min-height: ${
|
|
11
|
+
min-height: ${Kt(48)};
|
|
12
12
|
}
|
|
13
13
|
.${e}-wrapper.${e}-type-C .${e}-input:focus-visible,
|
|
14
14
|
.${e}-wrapper.${e}-type-C .${e}-button:focus-visible {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
min-width: 0;
|
|
33
33
|
}
|
|
34
34
|
.${e}-field-group.${e}-labeled {
|
|
35
|
-
gap: ${
|
|
35
|
+
gap: ${Kt(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: ${
|
|
131
|
+
margin-top: ${Kt(8)};
|
|
132
132
|
color: var(--${e}-success-success-color, var(--${e}-success-color));
|
|
133
133
|
}
|
|
134
134
|
.${e}-error {
|
|
135
|
-
margin-top: ${
|
|
135
|
+
margin-top: ${Kt(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
|
|
142
|
+
`}function _s({settings:e,isEditor:t,metadata:n,activeEvent:o}){const{prefix:r}=_.useScopedStyles(),{type:s="A",fieldsToShow:i=2,fields:u=[],buttonLabel:l,gap:m,fieldsGap:c,buttonCorners:T,buttonStroke:S,buttonPadding:g,isButtonFullWidth:p,inputCorners:d,inputStroke:x,inputPadding:y,inputColor:b,inputTextColor:E,inputBorderColor:K,placeholderColor:k,buttonColor:I,buttonTextColor:w,buttonBorderColor:C,labelTextColor:R,successColor:z,errorColor:P,fontFamily:H,inputFontSettings:j,inputFontSize:D,inputLineHeight:G,inputLetterSpacing:v,inputWordSpacing:F,inputTextAppearance:A,buttonFontSettings:M,buttonFontSize:$,buttonLineHeight:N,buttonLetterSpacing:J,buttonWordSpacing:ce,buttonTextAppearance:re,labelFontSettings:ge,labelFontSize:W,labelLineHeight:V,labelLetterSpacing:Q,labelWordSpacing:te,labelTextAppearance:se,statusFontSettings:q,statusFontSize:ie,statusLineHeight:L,statusLetterSpacing:f,statusWordSpacing:O,statusTextAppearance:Y,successMessage:ee,errorMessage:ue,stateOverrides:le}=e,ae=s==="B",fe=u.slice(0,Math.min(i,u.length)),B={fontSettings:{fontFamily:H,fontWeight:(j==null?void 0:j.fontWeight)??400,fontStyle:(j==null?void 0:j.fontStyle)??"normal"},fontSize:D??.01,lineHeight:G,letterSpacing:v??0,wordSpacing:F??0,textAppearance:A,color:E},Z=ht(Pe(B,t)),X=_.scalingValue(x??0,t),pe=_.scalingValue((G??D??.01)+((y==null?void 0:y.top)??0)+((y==null?void 0:y.bottom)??0)+(s==="C"?x??0:(x??0)*2),t),ne={...Z,borderStyle:"solid",borderRadius:s==="C"?0:_.scalingValue(d??0,t),...s==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:X,borderLeftWidth:0}:{borderWidth:X},paddingTop:_.scalingValue((y==null?void 0:y.top)??0,t),paddingRight:_.scalingValue((y==null?void 0:y.right)??0,t),paddingBottom:_.scalingValue((y==null?void 0:y.bottom)??0,t),paddingLeft:_.scalingValue((y==null?void 0:y.left)??0,t),height:pe,minHeight:pe},me={fontSettings:{fontFamily:H,fontWeight:(M==null?void 0:M.fontWeight)??400,fontStyle:(M==null?void 0:M.fontStyle)??"normal"},fontSize:$??.01,lineHeight:N,letterSpacing:J??0,wordSpacing:ce??0,textAppearance:re,color:w},we=ht(Pe(me,t)),Ce=_.scalingValue(S??0,t),lt={fontSettings:{fontFamily:H,fontWeight:(ge==null?void 0:ge.fontWeight)??400,fontStyle:(ge==null?void 0:ge.fontStyle)??"normal"},fontSize:W??.01,lineHeight:V,letterSpacing:Q??0,wordSpacing:te??0,textAppearance:se,color:R},Ge=Pe(lt,t),xe={fontSettings:{fontFamily:H,fontWeight:(q==null?void 0:q.fontWeight)??400,fontStyle:(q==null?void 0:q.fontStyle)??"normal"},fontSize:ie??.01,lineHeight:L,letterSpacing:f??0,wordSpacing:O??0,textAppearance:Y,color:z},Re=ht(Pe(xe,t)),nt=_.buildColorVars(r,{inputColor:b,inputTextColor:E,inputBorderColor:K,placeholderColor:k!=null&&k.trim()?k:"#cccccc",buttonColor:I,buttonTextColor:w,buttonBorderColor:C,labelTextColor:R,successColor:z,errorColor:P},Es,ks,le),[$e,je]=h.useState(()=>Object.fromEntries(fe.map(ye=>[ye.name,""]))),[eo,Ct]=h.useState("idle"),[gr,Bt]=h.useState(null),vn=o==="success"?"success":o==="error"?"error":eo,fr=o==="error"?ue:gr,Dt=o==="filled",$t=h.useMemo(()=>{if(!Dt)return $e;let ye=null;for(const Ve of fe)($e[Ve.name]??"").trim().length>0||(ye=ye??{...$e},ye[Ve.name]="Filled");return ye??$e},[$e,Dt,fe]),hr=vn==="error"?_.getFormFieldValidationError(fe,$t):null,yr=`${o&&o!=="default"?`${r}-state-${o}`:""}`.trim(),to=n==null?void 0:n.submitUrl,no=(ye,Ve)=>{je(Oe=>({...Oe,[ye]:Ve}))},vr=async ye=>{ye.preventDefault();const Ve=Object.fromEntries(fe.map(Ae=>{var ct;return[Ae.name,((ct=$e[Ae.name])==null?void 0:ct.trim())??""]}).filter(([,Ae])=>Ae));if(!to){Ct("error"),Bt("No integrations were found for this form.");return}if(Object.keys(Ve).length===0)return;const Oe=_.getFormFieldValidationError(fe,$e);if(Oe){Ct("error"),Bt(Oe);return}Ct("submitting"),Bt(null);try{const Ae=await fetch(to,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ve)});if(!Ae.ok){const ct=await Ae.text();throw new Error(ct||`Request failed: ${Ae.status}`)}Ct("success"),je(Object.fromEntries(fe.map(ct=>[ct.name,""])))}catch(Ae){Ct("error"),Bt(Ae instanceof Error?Ae.message:"Something went wrong")}};return a.jsxs("div",{className:`${r}-wrapper ${r}-type-${s} ${yr}`.trim(),style:nt,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ts(r)}}),a.jsxs("form",{onSubmit:vr,className:`${r}-form`,style:{gap:_.scalingValue(m??0,t)},children:[a.jsx("div",{className:`${r}-fields`,style:{gap:_.scalingValue(c??0,t)},children:fe.map((ye,Ve)=>a.jsxs("div",{className:`${r}-field-group${ae?` ${r}-labeled`:""}`,children:[ae&&a.jsx("span",{className:`${r}-field-label`,style:Ge?{...Ge,lineHeight:Ge.fontSize}:void 0,children:ye.label||ye.name}),ye.type==="textarea"?a.jsx("textarea",{name:ye.name,autoComplete:"off",value:$t[ye.name]??"",onChange:Oe=>no(ye.name,Oe.target.value),placeholder:ye.placeholder,className:`${r}-input`,style:ne,rows:1,"data-filled":Dt||($t[ye.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:ye.type==="phone"?"tel":ye.type==="email"?"email":"text",name:ye.name,autoComplete:"off",value:$t[ye.name]??"",onChange:Oe=>no(ye.name,Oe.target.value),placeholder:ye.placeholder,required:ye.isRequired??ye.type==="email",className:`${r}-input`,style:ne,"data-filled":Dt||($t[ye.name]??"").trim().length>0})]},Ve))}),a.jsx("div",{className:`${r}-overlay-anchor`,children:a.jsx("button",{type:"submit",className:`${r}-button`,style:{borderStyle:"solid",borderRadius:_.scalingValue(T??0,t),borderWidth:Ce,paddingTop:_.scalingValue((g==null?void 0:g.top)??0,t),paddingRight:_.scalingValue((g==null?void 0:g.right)??0,t),paddingBottom:_.scalingValue((g==null?void 0:g.bottom)??0,t),paddingLeft:_.scalingValue((g==null?void 0:g.left)??0,t),...we,...p?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:a.jsx("span",{className:`${r}-overlay-anchor`,style:p?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:eo==="submitting"?"...":l})})})]}),vn==="success"&&a.jsx("p",{className:`${r}-success`,style:{...Re},children:ee}),vn==="error"&&a.jsx("p",{className:`${r}-error`,style:{...Re},role:"alert",children:hr??fr??ue})]})}const Es={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"},ks=["hover","focus","filled","success","error"],Is=`import React, { useMemo, useState } from 'react';
|
|
143
143
|
import { CommonComponentProps } from '../props';
|
|
144
144
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
145
145
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -740,7 +740,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
740
740
|
};
|
|
741
741
|
|
|
742
742
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
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"}],Yt={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Ls=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],Is={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:"range-control"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"range-control",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:"range-control"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"range-control",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"range-control"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"range-control",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:{...Yt.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:{...Yt.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:{...Yt.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:{...Yt.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","inputStroke","inputCorners"]},{type:"group",title:"",items:["inputPadding"]}]},{type:"group",title:"Button",items:[{type:"row",items:["isButtonFullWidth"]},{type:"row",items:[{type:"group",title:"",items:["gap","buttonStroke","buttonCorners"]},{type:"group",title:"",items:["buttonPadding"]}]}]}]}]},{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:[...Ls],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:Ts,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:Is,sourceCode:As};function Xt(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ps(e){return`
|
|
743
|
+
`,As=[{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"}],Gt={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Ls=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],Fs={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:"range-control"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"range-control",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:"range-control"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"range-control",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"range-control"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"range-control",enabled:!0},min:0,max:100},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"common",title:"Stroke Input",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},isButtonFullWidth:{type:"boolean",scope:"common",title:"Full Width",display:{type:"toggle",enum:["On","Off"]}},buttonBorderColor:{type:"string",scope:"common",title:"Stroke Button",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker",visible:!1}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...Gt.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:{...Gt.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:{...Gt.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:{...Gt.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:As,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","inputStroke","inputCorners"]},{type:"group",title:"",items:["inputPadding"]}]},{type:"group",title:"Button",items:[{type:"row",items:["isButtonFullWidth"]},{type:"row",items:[{type:"group",title:"",items:["gap","buttonStroke","buttonCorners"]},{type:"group",title:"",items:["buttonPadding"]}]}]}]}]},{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:[...Ls],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"]},Ms={element:_s,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:Fs,sourceCode:Is};function Yt(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Rs(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;
|
|
|
922
922
|
align-items: center;
|
|
923
923
|
}
|
|
924
924
|
.${e}-success {
|
|
925
|
-
margin-top: ${
|
|
926
|
-
font-size: ${
|
|
925
|
+
margin-top: ${Yt(8)};
|
|
926
|
+
font-size: ${Yt(14)};
|
|
927
927
|
color: var(--${e}-success-success-color, var(--${e}-success-color));
|
|
928
928
|
}
|
|
929
929
|
.${e}-error {
|
|
930
|
-
margin-top: ${
|
|
931
|
-
font-size: ${
|
|
930
|
+
margin-top: ${Yt(8)};
|
|
931
|
+
font-size: ${Yt(14)};
|
|
932
932
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
933
933
|
}
|
|
934
|
-
`}const
|
|
934
|
+
`}const Ps=({settings:e,isEditor:t,metadata:n,activeEvent:o})=>{const{prefix:r}=_.useScopedStyles(),{fields:s=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:i,buttonLabel:u,fieldsToShow:l=1,fontFamily:m,inputFontSettings:c,inputFontSize:T,inputLineHeight:S,inputLetterSpacing:g,inputWordSpacing:p,inputTextAppearance:d,buttonFontSettings:x,buttonFontSize:y,buttonLineHeight:b,buttonLetterSpacing:E,buttonWordSpacing:K,buttonTextAppearance:k,statusFontSettings:I,statusFontSize:w,statusLineHeight:C,statusLetterSpacing:R,statusWordSpacing:z,statusTextAppearance:P,iconMaxWidth:H,minHeight:j,corners:D,stroke:G,stateOverrides:v,inputPadding:F,buttonPadding:A,successMessage:M="Thanks for subscribing!",errorMessage:$="Please, fill all required fields."}=e,N=s.slice(0,Math.min(l,s.length)),[J,ce]=h.useState(()=>Object.fromEntries(N.map(xe=>[xe.name,""]))),[re,ge]=h.useState("idle"),[W,V]=h.useState(null),Q=o==="success"?"success":o==="error"?"error":re,te=o==="error"?$:W,se=o==="filled",q=h.useMemo(()=>{if(!se)return J;let xe=null;for(const Re of N)(J[Re.name]??"").trim().length>0||(xe=xe??{...J},xe[Re.name]="Filled");return xe??J},[se,J,N]),ie=Q==="error"?_.getFormFieldValidationError(N,q):null,L=o&&o!=="default"?`${r}-state-${o}`:"",f=N.some(xe=>(q[xe.name]??"").trim().length>0),O=L!==`${r}-state-filled`&&f?`${r}-state-filled`:"",Y=`${L} ${O}`.trim(),ee=n==null?void 0:n.submitUrl,ue=u??"",le=(i==null?void 0:i.icon)??"",ae=(i==null?void 0:i.mode)==="On",fe=ue||"Submit",B={fontSettings:{fontFamily:m,fontWeight:(c==null?void 0:c.fontWeight)??400,fontStyle:(c==null?void 0:c.fontStyle)??"normal"},fontSize:T??.01,lineHeight:S,letterSpacing:g??0,wordSpacing:p??0,textAppearance:d,color:e.inputTextColor??"#111111"},Z={fontSettings:{fontFamily:m,fontWeight:(x==null?void 0:x.fontWeight)??400,fontStyle:(x==null?void 0:x.fontStyle)??"normal"},fontSize:y??.01,lineHeight:b,letterSpacing:E??0,wordSpacing:K??0,textAppearance:k,color:e.buttonTextColor??"#ffffff"},X={fontSettings:{fontFamily:m,fontWeight:(I==null?void 0:I.fontWeight)??400,fontStyle:(I==null?void 0:I.fontStyle)??"normal"},fontSize:w??.01,lineHeight:C,letterSpacing:R??0,wordSpacing:z??0,textAppearance:P,color:e.successColor??"#22c55e"},pe=ht(Pe(B,t)),ne=ht(Pe(Z,t)),me=ht(Pe(X,t)),we=_.buildColorVars(r,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(B==null?void 0:B.color)??"#111111",buttonTextColor:e.buttonTextColor??(Z==null?void 0:Z.color)??"#ffffff"},Ws,Ns,v),Ce={borderRadius:_.scalingValue(D,t),borderWidth:_.scalingValue(G,t),borderStyle:"solid"},lt={borderLeftWidth:_.scalingValue(G,t)},Ge=async xe=>{xe.preventDefault();const Re=Object.fromEntries(N.map($e=>{var je;return[$e.name,((je=J[$e.name])==null?void 0:je.trim())??""]}).filter(([,$e])=>$e));if(!ee){ge("error"),V("No integrations were found for this form.");return}if(Object.keys(Re).length===0)return;const nt=_.getFormFieldValidationError(N,J);if(nt){ge("error"),V(nt);return}ge("submitting"),V(null);try{const $e=await fetch(ee,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Re)});if(!$e.ok){const je=await $e.text();throw new Error(je||`Request failed: ${$e.status}`)}ge("success"),ce(Object.fromEntries(N.map(je=>[je.name,""])))}catch($e){ge("error"),V($e instanceof Error?$e.message:"Something went wrong")}};return a.jsxs("div",{className:`${r}-wrapper ${Y}`.trim(),style:we,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Rs(r)}}),a.jsxs("form",{onSubmit:Ge,className:`${r}-form`,style:{...Ce,height:_.scalingValue(j,t),minHeight:_.scalingValue(j,t)},children:[a.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:N.map(xe=>a.jsx("input",{type:xe.type==="email"?"email":xe.type==="phone"?"tel":"text",name:xe.name,autoComplete:"off",value:q[xe.name]??"",onChange:Re=>ce(nt=>({...nt,[xe.name]:Re.target.value})),placeholder:xe.placeholder,required:xe.isRequired??xe.type==="email",className:`${r}-input`,style:{...pe,paddingRight:_.scalingValue(F.right,t),paddingLeft:_.scalingValue(F.left,t),paddingTop:_.scalingValue(F.top,t),paddingBottom:_.scalingValue(F.bottom,t)}},xe.name))}),a.jsx("div",{className:`${r}-overlayAnchor`,children:a.jsx("button",{type:"submit",className:`${r}-submitBtn`,"aria-label":fe,style:{...ne,...lt,paddingRight:_.scalingValue(A.right,t),paddingLeft:_.scalingValue(A.left,t),paddingTop:_.scalingValue(A.top,t),paddingBottom:_.scalingValue(A.bottom,t)},children:re==="submitting"?"...":ae?le&&a.jsx(Xe,{url:le,className:`${r}-submitBtnIcon`,style:{maxWidth:_.scalingValue(H??0,t)},fill:`var(--${r}-button-text-color)`,hoverFill:`var(--${r}-button-text-color)`}):ue})})]}),Q==="success"&&a.jsx("p",{className:`${r}-success`,style:{...me},children:M}),Q==="error"&&a.jsx("p",{className:`${r}-error`,style:{...me},role:"alert",children:ie??te??$})]})},Ws={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"},Ns=["hover","focus","filled","success","error"],Hs=`import React, { useMemo, useState } from 'react';
|
|
935
935
|
import { CommonComponentProps } from '../props';
|
|
936
936
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
937
937
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -1503,7 +1503,702 @@ const COLOR_VAR_MAP: Record<OnelinerColorKeys, string> = {
|
|
|
1503
1503
|
};
|
|
1504
1504
|
|
|
1505
1505
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
1506
|
-
`,Vs="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>'),Hs=[{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."}],$n={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},js=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],zs={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:"",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"range-control"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"range-control"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"range-control"},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:{...$n.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:{...$n.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:{...$n.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:Hs,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:Vs},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","corners"]},{type:"row",items:[{type:"group",title:"",items:["stroke","buttonIcon"]},{type:"switcher",title:"Padding",options:{Input:["inputPadding"],Button:["buttonPadding"]}}]},"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:[...js],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"]},Os={element:Ms,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:zs,sourceCode:Ns};function To(e){return`
|
|
1506
|
+
`,js="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>'),Vs=[{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."}],$n={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Os=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],zs={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:"",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"range-control"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"range-control"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"range-control"},min:0,max:20},strokeColor:{type:"string",scope:"common",title:"Stroke All",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"common"},inputFontSettings:{...$n.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:{...$n.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:{...$n.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:Vs,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:js},fontFamily:"Arial",strokeColor:"#000000",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#000000",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{hover:{buttonColor:"#33A2F2"}},inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{minHeight:.1,iconMaxWidth:.1,stroke:.001,corners:0,buttonPadding:{top:.02,right:.04,bottom:.02,left:.04},inputPadding:{top:.01,right:.03,bottom:.01,left:.03},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{minHeight:.028,iconMaxWidth:.028,stroke:.001,corners:0,buttonPadding:{right:.0175,left:.0175,top:.005,bottom:.004},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.009,buttonLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSettings.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSize.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLineHeight.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLetterSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonWordSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonTextAppearance.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"Off"},then:{name:"properties.iconMaxWidth.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","fieldsToShow"]},{type:"row",items:["minHeight","corners"]},{type:"row",items:[{type:"group",title:"",items:["stroke","buttonIcon"]},{type:"switcher",title:"Padding",options:{Input:["inputPadding"],Button:["buttonPadding"]}}]},"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:[...Os],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"]},Bs={element:Ps,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:zs,sourceCode:Hs};function To(e){return`
|
|
1507
|
+
.${e}-marquee-wrapper {
|
|
1508
|
+
overflow: hidden;
|
|
1509
|
+
width: 100%;
|
|
1510
|
+
height: auto;
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
@keyframes ${e}-marquee-left {
|
|
1514
|
+
from { transform: translate3d(0, 0, 0); }
|
|
1515
|
+
to { transform: translate3d(calc(-1 * var(--marquee-distance)), 0, 0); }
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
@keyframes ${e}-marquee-right {
|
|
1519
|
+
from { transform: translate3d(calc(-1 * var(--marquee-distance)), 0, 0); }
|
|
1520
|
+
to { transform: translate3d(0, 0, 0); }
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
.${e}-marquee-track {
|
|
1524
|
+
display: flex;
|
|
1525
|
+
flex-direction: row;
|
|
1526
|
+
width: max-content;
|
|
1527
|
+
will-change: transform;
|
|
1528
|
+
backface-visibility: hidden;
|
|
1529
|
+
transform: translateZ(0);
|
|
1530
|
+
-webkit-backface-visibility: hidden;
|
|
1531
|
+
-webkit-transform: translateZ(0);
|
|
1532
|
+
flex-wrap: nowrap;
|
|
1533
|
+
animation-duration: var(--marquee-duration);
|
|
1534
|
+
animation-timing-function: linear;
|
|
1535
|
+
animation-iteration-count: infinite;
|
|
1536
|
+
animation-play-state: var(--marquee-play-state, running);
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
.${e}-marquee-track[data-direction="left"] {
|
|
1540
|
+
animation-name: ${e}-marquee-left;
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
.${e}-marquee-track[data-direction="right"] {
|
|
1544
|
+
animation-name: ${e}-marquee-right;
|
|
1545
|
+
}
|
|
1546
|
+
.${e}-marquee-row {
|
|
1547
|
+
display: flex;
|
|
1548
|
+
flex-direction: row;
|
|
1549
|
+
align-items: flex-start;
|
|
1550
|
+
}
|
|
1551
|
+
.${e}-marquee-set {
|
|
1552
|
+
flex: 0 0 auto;
|
|
1553
|
+
}
|
|
1554
|
+
.${e}-marquee-static {
|
|
1555
|
+
justify-content: center;
|
|
1556
|
+
overflow-x: auto;
|
|
1557
|
+
}
|
|
1558
|
+
.${e}-marquee-card {
|
|
1559
|
+
position: relative;
|
|
1560
|
+
flex: 0 0 auto;
|
|
1561
|
+
align-self: flex-start;
|
|
1562
|
+
transform: translateZ(0);
|
|
1563
|
+
backface-visibility: hidden;
|
|
1564
|
+
-webkit-backface-visibility: hidden;
|
|
1565
|
+
will-change: transform;
|
|
1566
|
+
}
|
|
1567
|
+
.${e}-wrapper {
|
|
1568
|
+
position: relative;
|
|
1569
|
+
width: 100%;
|
|
1570
|
+
height: 100%;
|
|
1571
|
+
order: 1;
|
|
1572
|
+
}
|
|
1573
|
+
.${e}-cover {
|
|
1574
|
+
position: absolute;
|
|
1575
|
+
width: 100%;
|
|
1576
|
+
height: 100%;
|
|
1577
|
+
top: 0;
|
|
1578
|
+
left: 0;
|
|
1579
|
+
}
|
|
1580
|
+
.${e}-elements-overlay {
|
|
1581
|
+
position: relative;
|
|
1582
|
+
inset: 0;
|
|
1583
|
+
display: flex;
|
|
1584
|
+
flex-direction: column;
|
|
1585
|
+
pointer-events: none;
|
|
1586
|
+
}
|
|
1587
|
+
.${e}-control {
|
|
1588
|
+
position: relative;
|
|
1589
|
+
z-index: 2;
|
|
1590
|
+
width: 100%;
|
|
1591
|
+
}
|
|
1592
|
+
.${e}-control::before {
|
|
1593
|
+
content: "";
|
|
1594
|
+
position: absolute;
|
|
1595
|
+
top: 0;
|
|
1596
|
+
left: 0;
|
|
1597
|
+
width: 100%;
|
|
1598
|
+
height: 100%;
|
|
1599
|
+
min-height: 20px;
|
|
1600
|
+
pointer-events: auto;
|
|
1601
|
+
z-index: 10;
|
|
1602
|
+
}
|
|
1603
|
+
.${e}-image-hover-brightness img {
|
|
1604
|
+
transition: filter 0.3s ease;
|
|
1605
|
+
}
|
|
1606
|
+
.${e}-image-hover-brightness:hover img,
|
|
1607
|
+
.${e}-image-hover-brightness-active img {
|
|
1608
|
+
filter: brightness(1.25);
|
|
1609
|
+
}
|
|
1610
|
+
.${e}-image-hover-grayscale img {
|
|
1611
|
+
transition: filter 0.3s ease;
|
|
1612
|
+
}
|
|
1613
|
+
.${e}-image-hover-grayscale:hover img,
|
|
1614
|
+
.${e}-image-hover-grayscale-active img {
|
|
1615
|
+
filter: grayscale(100%);
|
|
1616
|
+
}
|
|
1617
|
+
.${e}-image-hover-saturate img {
|
|
1618
|
+
transition: filter 0.3s ease;
|
|
1619
|
+
}
|
|
1620
|
+
.${e}-image-hover-saturate:hover img,
|
|
1621
|
+
.${e}-image-hover-saturate-active img {
|
|
1622
|
+
filter: saturate(2);
|
|
1623
|
+
}
|
|
1624
|
+
`}const Ds=30,qs=3,Us=e=>Array.from({length:qs},()=>e).flat(),Ks=(e,t)=>`${e}-${t}`,Gs=(e,t)=>{const n=t.getBoundingClientRect(),o=e.getBoundingClientRect();return o.right>n.left&&o.left<n.right},Ys=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(o=>Gs(o,e))},Xs=({item:e,prefix:t,imageFit:n,imageMaxWidth:o,imageMaxHeight:r,imageHoverClass:s,isEditor:i,isFirstSet:u,scaled:l,onFirstSetImageDone:m})=>{var S,g,p;const c=h.useRef(null);h.useLayoutEffect(()=>{if(!u)return;const d=c.current;d!=null&&d.complete&&(m==null||m())},[u,(S=e.image)==null?void 0:S.url,m]);const T=((g=e.image)==null?void 0:g.url)&&a.jsx("img",{ref:c,src:e.image.url,alt:((p=e.image)==null?void 0:p.name)??"",style:{pointerEvents:"auto",objectFit:n,...n==="contain"?{width:"auto",maxWidth:"100%",maxHeight:"100%",height:"auto"}:{width:"100%",height:"100%"}},onLoad:u?m:void 0,onError:u?m:void 0});return a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...n==="contain"?{maxWidth:l(o)}:{width:l(o)}},children:a.jsx("div",{className:s,style:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center",width:"100%",height:l(r),overflow:"hidden",flexShrink:0},children:T&&(e.link?a.jsx("a",{href:e.link,target:"_blank",rel:"noopener noreferrer",style:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center",alignSelf:"flex-start",...n==="cover"?{width:"100%",height:"100%"}:{height:"auto",width:"auto",maxWidth:"100%",maxHeight:"100%"},textDecoration:"none",color:"inherit"},children:T}):T)})})},Zs=({settings:e,content:t,isEditor:n,isPreviewMode:o})=>{const{prefix:r}=_.useScopedStyles(),{speed:s,direction:i,pauseOnHover:u,gap:l,imageMaxWidth:m,imageMaxHeight:c,imageFit:T}=e,S=e.hoverEffect==="off"?void 0:`${r}-image-hover-${e.hoverEffect}`,g=!o,p=Math.max(0,s)*Ds,d=V=>_.scalingValue(V,n??!1),x=h.useRef(null),y=h.useRef(null),b=h.useRef(null),[E,K]=h.useState(0),[k,I]=h.useState(0),[w,C]=h.useState(0),R=g&&u==="on",[z,P]=h.useState(!1),H=e.hoverRandomize==="on",[j,D]=h.useState({}),G=h.useRef(j);G.current=j;const v=h.useRef(null),F=h.useRef(0),A=h.useRef(null),M=h.useMemo(()=>(t??[]).map(V=>{var Q;return((Q=V.image)==null?void 0:Q.url)??""}).join("\0"),[t]),$=h.useMemo(()=>{const V=t??[];return!g||V.length===0?V:Us(V)},[t,g]),N=h.useMemo(()=>$.filter(V=>{var Q;return!!((Q=V.image)!=null&&Q.url)}).length,[$]),J=h.useMemo(()=>!g||(t==null?void 0:t.length)===0?1:k<=0||E<=0?2:Math.max(2,Math.ceil(E/k)+1),[g,t==null?void 0:t.length,k,E,T]);h.useLayoutEffect(()=>{F.current=0,D({})},[M]),h.useEffect(()=>{if(!H)return;const V=x.current;if(!V)return;const Q=ie=>{D(L=>{let f=null;for(const O of ie)O in L&&(Ys(V,O)||(f||(f={...L}),delete f[O]));return f??L})},te=new IntersectionObserver(ie=>{const L=new Set;for(const f of ie){const O=f.target.dataset.marqueeItemIndex,Y=O!==void 0?Number(O):NaN;Number.isNaN(Y)||L.add(Y)}L.size>0&&Q(L)},{root:V,threshold:0});Object.keys(j).forEach(ie=>{const L=Number(ie);V.querySelectorAll(`[data-marquee-item-index="${L}"]`).forEach(f=>te.observe(f))});let se=0;const q=()=>{const ie=Object.keys(G.current);ie.length!==0&&(Q(ie.map(Number)),se=requestAnimationFrame(q))};return Object.keys(G.current).length>0&&(se=requestAnimationFrame(q)),()=>{cancelAnimationFrame(se),te.disconnect()}},[H,j]),h.useLayoutEffect(()=>{if(!g)return;const V=x.current,Q=b.current;if(!V||!Q)return;let te=0;const se=()=>{const L=V.getBoundingClientRect().width,f=Q.getBoundingClientRect().width,O=v.current,Y=typeof O=="number"&&Math.abs(O-f)<=.25;if(v.current=f,K(L),typeof f=="number"&&f>0&&k<=0){I(f);return}Y&&f!==k?I(f):!Y&&k<=0&&(cancelAnimationFrame(te),te=requestAnimationFrame(se))},q=()=>{cancelAnimationFrame(te),te=requestAnimationFrame(se)};A.current=q,q();const ie=new ResizeObserver(q);return ie.observe(V),ie.observe(Q),()=>{A.current=null,cancelAnimationFrame(te),ie.disconnect()}},[g,k]),h.useLayoutEffect(()=>{const V=y.current;if(!g||!V)return;const Q=k>0?k:0,te=Q>0&&p>0?Q/p*1e3:0,se=`${Math.max(0,te)/1e3}s`;V.style.setProperty("--marquee-distance",`${Q}px`),V.style.setProperty("--marquee-duration",se)},[g,p,k]),h.useLayoutEffect(()=>{if(!g){C(0);return}if(k<=0){C(0);return}const V=y.current;if(!V)return;const Q=()=>{const se=V.getBoundingClientRect().height;C(se>0?se:0)};Q();const te=new ResizeObserver(Q);return te.observe(V),()=>{te.disconnect()}},[g,J,$,n,l,m,c,k,T]);const ce=()=>{R&&P(!0)},re=()=>{R&&P(!1)},ge=()=>{var V;F.current=Math.min(N,F.current+1),(V=A.current)==null||V.call(A)},W=(V,Q,te,se)=>{const q=Ks(Q,te),ie=H?j[te]??V:V,L=H?()=>{const f=j[te]??V,O=(t??[]).filter(ee=>ee!==f);if(O.length===0)return;const Y=O[Math.floor(Math.random()*O.length)];D(ee=>({...ee,[te]:Y}))}:void 0;return a.jsxs("div",{className:`${r}-marquee-card`,"data-marquee-card-key":q,"data-marquee-item-index":te,"data-marquee-copy-index":Q,onMouseEnter:L,children:[a.jsx(Xs,{item:ie,prefix:r,imageFit:T,imageMaxWidth:m,imageMaxHeight:c,imageHoverClass:S,isEditor:n,isFirstSet:se,scaled:d,onFirstSetImageDone:ge}),n&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${d(l)})`,width:d(l),height:"100%",pointerEvents:"auto",zIndex:2}})]},q)};return g&&((t==null?void 0:t.length)??0)>0?a.jsxs("div",{ref:x,className:he(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Marquee",style:k>0&&w>0?{height:w}:void 0,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:To(r)}}),a.jsx("div",{ref:y,className:`${r}-marquee-track`,"data-direction":i,onMouseEnter:ce,onMouseLeave:re,style:{...k<=0?{animationName:"none"}:{},...R?{"--marquee-play-state":z?"paused":"running"}:{"--marquee-play-state":"running"}},children:Array.from({length:J},(V,Q)=>a.jsx("div",{ref:Q===0?b:void 0,className:he(`${r}-marquee-row`,`${r}-marquee-set`),style:{gap:d(l),paddingRight:d(l)},"aria-hidden":Q>0,children:$.map((te,se)=>W(te,Q,se,Q===0))},`set-${Q}`))},"marquee-track")]}):a.jsxs("div",{ref:x,className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:To(r)}}),a.jsx("div",{className:he(`${r}-marquee-row`,`${r}-marquee-static`),style:{gap:d(l),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((V,Q)=>W(V,0,Q))},"marquee-static")]})},Js=`import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
1625
|
+
import cn from 'classnames';
|
|
1626
|
+
import { CommonComponentProps } from '../props';
|
|
1627
|
+
import { scalingValue } from '../utils/scalingValue';
|
|
1628
|
+
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
1629
|
+
|
|
1630
|
+
function getCSS(P: string): string {
|
|
1631
|
+
return \`
|
|
1632
|
+
.\${P}-marquee-wrapper {
|
|
1633
|
+
overflow: hidden;
|
|
1634
|
+
width: 100%;
|
|
1635
|
+
height: auto;
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
@keyframes \${P}-marquee-left {
|
|
1639
|
+
from { transform: translate3d(0, 0, 0); }
|
|
1640
|
+
to { transform: translate3d(calc(-1 * var(--marquee-distance)), 0, 0); }
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1643
|
+
@keyframes \${P}-marquee-right {
|
|
1644
|
+
from { transform: translate3d(calc(-1 * var(--marquee-distance)), 0, 0); }
|
|
1645
|
+
to { transform: translate3d(0, 0, 0); }
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
.\${P}-marquee-track {
|
|
1649
|
+
display: flex;
|
|
1650
|
+
flex-direction: row;
|
|
1651
|
+
width: max-content;
|
|
1652
|
+
will-change: transform;
|
|
1653
|
+
backface-visibility: hidden;
|
|
1654
|
+
transform: translateZ(0);
|
|
1655
|
+
-webkit-backface-visibility: hidden;
|
|
1656
|
+
-webkit-transform: translateZ(0);
|
|
1657
|
+
flex-wrap: nowrap;
|
|
1658
|
+
animation-duration: var(--marquee-duration);
|
|
1659
|
+
animation-timing-function: linear;
|
|
1660
|
+
animation-iteration-count: infinite;
|
|
1661
|
+
animation-play-state: var(--marquee-play-state, running);
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
.\${P}-marquee-track[data-direction="left"] {
|
|
1665
|
+
animation-name: \${P}-marquee-left;
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1668
|
+
.\${P}-marquee-track[data-direction="right"] {
|
|
1669
|
+
animation-name: \${P}-marquee-right;
|
|
1670
|
+
}
|
|
1671
|
+
.\${P}-marquee-row {
|
|
1672
|
+
display: flex;
|
|
1673
|
+
flex-direction: row;
|
|
1674
|
+
align-items: flex-start;
|
|
1675
|
+
}
|
|
1676
|
+
.\${P}-marquee-set {
|
|
1677
|
+
flex: 0 0 auto;
|
|
1678
|
+
}
|
|
1679
|
+
.\${P}-marquee-static {
|
|
1680
|
+
justify-content: center;
|
|
1681
|
+
overflow-x: auto;
|
|
1682
|
+
}
|
|
1683
|
+
.\${P}-marquee-card {
|
|
1684
|
+
position: relative;
|
|
1685
|
+
flex: 0 0 auto;
|
|
1686
|
+
align-self: flex-start;
|
|
1687
|
+
transform: translateZ(0);
|
|
1688
|
+
backface-visibility: hidden;
|
|
1689
|
+
-webkit-backface-visibility: hidden;
|
|
1690
|
+
will-change: transform;
|
|
1691
|
+
}
|
|
1692
|
+
.\${P}-wrapper {
|
|
1693
|
+
position: relative;
|
|
1694
|
+
width: 100%;
|
|
1695
|
+
height: 100%;
|
|
1696
|
+
order: 1;
|
|
1697
|
+
}
|
|
1698
|
+
.\${P}-cover {
|
|
1699
|
+
position: absolute;
|
|
1700
|
+
width: 100%;
|
|
1701
|
+
height: 100%;
|
|
1702
|
+
top: 0;
|
|
1703
|
+
left: 0;
|
|
1704
|
+
}
|
|
1705
|
+
.\${P}-elements-overlay {
|
|
1706
|
+
position: relative;
|
|
1707
|
+
inset: 0;
|
|
1708
|
+
display: flex;
|
|
1709
|
+
flex-direction: column;
|
|
1710
|
+
pointer-events: none;
|
|
1711
|
+
}
|
|
1712
|
+
.\${P}-control {
|
|
1713
|
+
position: relative;
|
|
1714
|
+
z-index: 2;
|
|
1715
|
+
width: 100%;
|
|
1716
|
+
}
|
|
1717
|
+
.\${P}-control::before {
|
|
1718
|
+
content: "";
|
|
1719
|
+
position: absolute;
|
|
1720
|
+
top: 0;
|
|
1721
|
+
left: 0;
|
|
1722
|
+
width: 100%;
|
|
1723
|
+
height: 100%;
|
|
1724
|
+
min-height: 20px;
|
|
1725
|
+
pointer-events: auto;
|
|
1726
|
+
z-index: 10;
|
|
1727
|
+
}
|
|
1728
|
+
.\${P}-image-hover-brightness img {
|
|
1729
|
+
transition: filter 0.3s ease;
|
|
1730
|
+
}
|
|
1731
|
+
.\${P}-image-hover-brightness:hover img,
|
|
1732
|
+
.\${P}-image-hover-brightness-active img {
|
|
1733
|
+
filter: brightness(1.25);
|
|
1734
|
+
}
|
|
1735
|
+
.\${P}-image-hover-grayscale img {
|
|
1736
|
+
transition: filter 0.3s ease;
|
|
1737
|
+
}
|
|
1738
|
+
.\${P}-image-hover-grayscale:hover img,
|
|
1739
|
+
.\${P}-image-hover-grayscale-active img {
|
|
1740
|
+
filter: grayscale(100%);
|
|
1741
|
+
}
|
|
1742
|
+
.\${P}-image-hover-saturate img {
|
|
1743
|
+
transition: filter 0.3s ease;
|
|
1744
|
+
}
|
|
1745
|
+
.\${P}-image-hover-saturate:hover img,
|
|
1746
|
+
.\${P}-image-hover-saturate-active img {
|
|
1747
|
+
filter: saturate(2);
|
|
1748
|
+
}
|
|
1749
|
+
\`;
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
const PX_PER_SEC_PER_SPEED_UNIT = 30;
|
|
1753
|
+
const TRACK_CONTENT_SEQUENCE_REPEAT = 3;
|
|
1754
|
+
|
|
1755
|
+
const expandTrackContent = (items: MarqueeItem[]) =>
|
|
1756
|
+
Array.from({ length: TRACK_CONTENT_SEQUENCE_REPEAT }, () => items).flat();
|
|
1757
|
+
|
|
1758
|
+
const getMarqueeCardKey = (copyIndex: number, itemIndex: number) => \`\${copyIndex}-\${itemIndex}\`;
|
|
1759
|
+
|
|
1760
|
+
const isCardInMarqueeView = (card: Element, wrapper: Element): boolean => {
|
|
1761
|
+
const wrapperRect = wrapper.getBoundingClientRect();
|
|
1762
|
+
const rect = card.getBoundingClientRect();
|
|
1763
|
+
return rect.right > wrapperRect.left && rect.left < wrapperRect.right;
|
|
1764
|
+
};
|
|
1765
|
+
|
|
1766
|
+
const isAnyCopyOfSlotInView = (wrapper: Element, itemIndex: number): boolean => {
|
|
1767
|
+
const cards = wrapper.querySelectorAll<HTMLElement>(\`[data-marquee-item-index="\${itemIndex}"]\`);
|
|
1768
|
+
return Array.from(cards).some((card) => isCardInMarqueeView(card, wrapper));
|
|
1769
|
+
};
|
|
1770
|
+
|
|
1771
|
+
type MarqueeItemCardProps = {
|
|
1772
|
+
item: MarqueeItem;
|
|
1773
|
+
prefix: string;
|
|
1774
|
+
imageFit: 'cover' | 'contain';
|
|
1775
|
+
imageMaxWidth: number;
|
|
1776
|
+
imageMaxHeight: number;
|
|
1777
|
+
imageHoverClass?: string;
|
|
1778
|
+
isEditor?: boolean;
|
|
1779
|
+
isFirstSet?: boolean;
|
|
1780
|
+
scaled: (value: number) => string;
|
|
1781
|
+
onFirstSetImageDone?: () => void;
|
|
1782
|
+
};
|
|
1783
|
+
|
|
1784
|
+
const MarqueeItemCard = ({
|
|
1785
|
+
item,
|
|
1786
|
+
prefix: P,
|
|
1787
|
+
imageFit,
|
|
1788
|
+
imageMaxWidth,
|
|
1789
|
+
imageMaxHeight,
|
|
1790
|
+
imageHoverClass,
|
|
1791
|
+
isEditor,
|
|
1792
|
+
isFirstSet,
|
|
1793
|
+
scaled,
|
|
1794
|
+
onFirstSetImageDone,
|
|
1795
|
+
}: MarqueeItemCardProps) => {
|
|
1796
|
+
const imageRef = useRef<HTMLImageElement | null>(null);
|
|
1797
|
+
|
|
1798
|
+
useLayoutEffect(() => {
|
|
1799
|
+
if (!isFirstSet) return;
|
|
1800
|
+
const el = imageRef.current;
|
|
1801
|
+
if (el?.complete) onFirstSetImageDone?.();
|
|
1802
|
+
}, [isFirstSet, item.image?.url, onFirstSetImageDone]);
|
|
1803
|
+
|
|
1804
|
+
const imageNode =
|
|
1805
|
+
item.image?.url &&
|
|
1806
|
+
(
|
|
1807
|
+
<img
|
|
1808
|
+
ref={imageRef}
|
|
1809
|
+
src={item.image.url}
|
|
1810
|
+
alt={item.image?.name ?? ''}
|
|
1811
|
+
style={{
|
|
1812
|
+
pointerEvents: 'auto',
|
|
1813
|
+
objectFit: imageFit,
|
|
1814
|
+
...(imageFit === 'contain'
|
|
1815
|
+
? { width: 'auto', maxWidth: '100%', maxHeight: '100%', height: 'auto' }
|
|
1816
|
+
: { width: '100%', height: '100%' }),
|
|
1817
|
+
}}
|
|
1818
|
+
onLoad={isFirstSet ? onFirstSetImageDone : undefined}
|
|
1819
|
+
onError={isFirstSet ? onFirstSetImageDone : undefined}
|
|
1820
|
+
/>
|
|
1821
|
+
);
|
|
1822
|
+
|
|
1823
|
+
return (
|
|
1824
|
+
<div
|
|
1825
|
+
style={{
|
|
1826
|
+
display: 'flex',
|
|
1827
|
+
flexDirection: 'column',
|
|
1828
|
+
alignItems: 'start',
|
|
1829
|
+
...(imageFit === 'contain' ? { maxWidth: scaled(imageMaxWidth) } : { width: scaled(imageMaxWidth) }),
|
|
1830
|
+
}}
|
|
1831
|
+
>
|
|
1832
|
+
<div
|
|
1833
|
+
className={imageHoverClass}
|
|
1834
|
+
style={{
|
|
1835
|
+
display: 'flex',
|
|
1836
|
+
flexDirection: 'column',
|
|
1837
|
+
justifyContent: 'flex-start',
|
|
1838
|
+
alignItems: 'center',
|
|
1839
|
+
width: '100%',
|
|
1840
|
+
height: scaled(imageMaxHeight),
|
|
1841
|
+
overflow: 'hidden',
|
|
1842
|
+
flexShrink: 0,
|
|
1843
|
+
}}
|
|
1844
|
+
>
|
|
1845
|
+
{imageNode &&
|
|
1846
|
+
(item.link ? (
|
|
1847
|
+
<a
|
|
1848
|
+
href={item.link}
|
|
1849
|
+
target='_blank'
|
|
1850
|
+
rel='noopener noreferrer'
|
|
1851
|
+
style={{
|
|
1852
|
+
display: 'flex',
|
|
1853
|
+
flexDirection: 'column',
|
|
1854
|
+
justifyContent: 'flex-start',
|
|
1855
|
+
alignItems: 'center',
|
|
1856
|
+
alignSelf: 'flex-start',
|
|
1857
|
+
...(imageFit === 'cover'
|
|
1858
|
+
? { width: '100%', height: '100%' }
|
|
1859
|
+
: { height: 'auto', width: 'auto', maxWidth: '100%', maxHeight: '100%' }),
|
|
1860
|
+
textDecoration: 'none',
|
|
1861
|
+
color: 'inherit',
|
|
1862
|
+
}}
|
|
1863
|
+
>
|
|
1864
|
+
{imageNode}
|
|
1865
|
+
</a>
|
|
1866
|
+
) : (
|
|
1867
|
+
imageNode
|
|
1868
|
+
))}
|
|
1869
|
+
</div>
|
|
1870
|
+
</div>
|
|
1871
|
+
);
|
|
1872
|
+
};
|
|
1873
|
+
|
|
1874
|
+
export const Marquee = ({ settings, content, isEditor, isPreviewMode }: MarqueeProps) => {
|
|
1875
|
+
const { prefix: P } = useScopedStyles();
|
|
1876
|
+
const { speed, direction, pauseOnHover, gap, imageMaxWidth, imageMaxHeight, imageFit } = settings;
|
|
1877
|
+
const imageHoverClass = settings.hoverEffect === 'off' ? undefined : \`\${P}-image-hover-\${settings.hoverEffect}\`;
|
|
1878
|
+
const autoplayEnabled = !isPreviewMode;
|
|
1879
|
+
const pxPerSec = Math.max(0, speed) * PX_PER_SEC_PER_SPEED_UNIT;
|
|
1880
|
+
const scaled = (v: number) => scalingValue(v, isEditor ?? false);
|
|
1881
|
+
const wrapperRef = useRef<HTMLDivElement | null>(null);
|
|
1882
|
+
const trackRef = useRef<HTMLDivElement | null>(null);
|
|
1883
|
+
const setRef = useRef<HTMLDivElement | null>(null);
|
|
1884
|
+
const [containerWidth, setContainerWidth] = useState(0);
|
|
1885
|
+
const [setWidth, setSetWidth] = useState(0);
|
|
1886
|
+
const [trackHeight, setTrackHeight] = useState(0);
|
|
1887
|
+
const hoverPauseEnabled = autoplayEnabled && pauseOnHover === 'on';
|
|
1888
|
+
const [isHovering, setIsHovering] = useState(false);
|
|
1889
|
+
const hoverRandomizeEnabled = settings.hoverRandomize === 'on';
|
|
1890
|
+
const [swappedSlots, setSwappedSlots] = useState<Record<number, MarqueeItem>>({});
|
|
1891
|
+
const swappedSlotsRef = useRef(swappedSlots);
|
|
1892
|
+
swappedSlotsRef.current = swappedSlots;
|
|
1893
|
+
const stableCandidateRef = useRef<number | null>(null);
|
|
1894
|
+
const loadedFirstSetImagesRef = useRef(0);
|
|
1895
|
+
const scheduleRemeasureRef = useRef<(() => void) | null>(null);
|
|
1896
|
+
const contentImageUrlsKey = useMemo(() => (content ?? []).map((i) => i.image?.url ?? '').join('\\0'),[content]);
|
|
1897
|
+
const trackContent = useMemo(() => {
|
|
1898
|
+
const items = content ?? [];
|
|
1899
|
+
if (!autoplayEnabled || items.length === 0) return items;
|
|
1900
|
+
return expandTrackContent(items);
|
|
1901
|
+
}, [content, autoplayEnabled]);
|
|
1902
|
+
const firstSetImageUrlCount = useMemo(
|
|
1903
|
+
() => trackContent.filter((i) => Boolean(i.image?.url)).length,
|
|
1904
|
+
[trackContent],
|
|
1905
|
+
);
|
|
1906
|
+
const copies = useMemo(() => {
|
|
1907
|
+
if (!autoplayEnabled || content?.length === 0) return 1;
|
|
1908
|
+
if (setWidth <= 0 || containerWidth <= 0) return 2;
|
|
1909
|
+
return Math.max(2, Math.ceil(containerWidth / setWidth) + 1);
|
|
1910
|
+
}, [autoplayEnabled, content?.length, setWidth, containerWidth, imageFit]);
|
|
1911
|
+
|
|
1912
|
+
useLayoutEffect(() => {
|
|
1913
|
+
loadedFirstSetImagesRef.current = 0;
|
|
1914
|
+
setSwappedSlots({});
|
|
1915
|
+
}, [contentImageUrlsKey]);
|
|
1916
|
+
|
|
1917
|
+
useEffect(() => {
|
|
1918
|
+
if (!hoverRandomizeEnabled) return;
|
|
1919
|
+
const wrapper = wrapperRef.current;
|
|
1920
|
+
if (!wrapper) return;
|
|
1921
|
+
|
|
1922
|
+
const revertSwappedSlotsOutOfView = (itemIndices: Iterable<number>) => {
|
|
1923
|
+
setSwappedSlots((prev) => {
|
|
1924
|
+
let next: Record<number, MarqueeItem> | null = null;
|
|
1925
|
+
for (const itemIndex of itemIndices) {
|
|
1926
|
+
if (!(itemIndex in prev)) continue;
|
|
1927
|
+
if (isAnyCopyOfSlotInView(wrapper, itemIndex)) continue;
|
|
1928
|
+
if (!next) next = { ...prev };
|
|
1929
|
+
delete next[itemIndex];
|
|
1930
|
+
}
|
|
1931
|
+
return next ?? prev;
|
|
1932
|
+
});
|
|
1933
|
+
};
|
|
1934
|
+
|
|
1935
|
+
const observer = new IntersectionObserver(
|
|
1936
|
+
(entries) => {
|
|
1937
|
+
const itemIndices = new Set<number>();
|
|
1938
|
+
for (const entry of entries) {
|
|
1939
|
+
const raw = (entry.target as HTMLElement).dataset.marqueeItemIndex;
|
|
1940
|
+
const itemIndex = raw !== undefined ? Number(raw) : NaN;
|
|
1941
|
+
if (!Number.isNaN(itemIndex)) itemIndices.add(itemIndex);
|
|
1942
|
+
}
|
|
1943
|
+
if (itemIndices.size > 0) revertSwappedSlotsOutOfView(itemIndices);
|
|
1944
|
+
},
|
|
1945
|
+
{ root: wrapper, threshold: 0 },
|
|
1946
|
+
);
|
|
1947
|
+
|
|
1948
|
+
Object.keys(swappedSlots).forEach((rawItemIndex) => {
|
|
1949
|
+
const itemIndex = Number(rawItemIndex);
|
|
1950
|
+
wrapper
|
|
1951
|
+
.querySelectorAll<HTMLDivElement>(\`[data-marquee-item-index="\${itemIndex}"]\`)
|
|
1952
|
+
.forEach((card) => observer.observe(card));
|
|
1953
|
+
});
|
|
1954
|
+
|
|
1955
|
+
let raf = 0;
|
|
1956
|
+
const tick = () => {
|
|
1957
|
+
const swappedKeys = Object.keys(swappedSlotsRef.current);
|
|
1958
|
+
if (swappedKeys.length === 0) return;
|
|
1959
|
+
revertSwappedSlotsOutOfView(swappedKeys.map(Number));
|
|
1960
|
+
raf = requestAnimationFrame(tick);
|
|
1961
|
+
};
|
|
1962
|
+
if (Object.keys(swappedSlotsRef.current).length > 0) {
|
|
1963
|
+
raf = requestAnimationFrame(tick);
|
|
1964
|
+
}
|
|
1965
|
+
|
|
1966
|
+
return () => {
|
|
1967
|
+
cancelAnimationFrame(raf);
|
|
1968
|
+
observer.disconnect();
|
|
1969
|
+
};
|
|
1970
|
+
}, [hoverRandomizeEnabled, swappedSlots]);
|
|
1971
|
+
|
|
1972
|
+
useLayoutEffect(() => {
|
|
1973
|
+
if (!autoplayEnabled) return;
|
|
1974
|
+
const wrapper = wrapperRef.current;
|
|
1975
|
+
const set = setRef.current;
|
|
1976
|
+
if (!wrapper || !set) return;
|
|
1977
|
+
let raf = 0;
|
|
1978
|
+
const measure = () => {
|
|
1979
|
+
const nextContainerWidth = wrapper.getBoundingClientRect().width;
|
|
1980
|
+
const nextRawSetWidth = set.getBoundingClientRect().width;
|
|
1981
|
+
const prevCandidate = stableCandidateRef.current;
|
|
1982
|
+
const isStableNow = typeof prevCandidate === 'number' && Math.abs(prevCandidate - nextRawSetWidth) <= 0.25;
|
|
1983
|
+
stableCandidateRef.current = nextRawSetWidth;
|
|
1984
|
+
setContainerWidth(nextContainerWidth);
|
|
1985
|
+
if (typeof nextRawSetWidth === 'number' && nextRawSetWidth > 0 && setWidth <= 0) {
|
|
1986
|
+
setSetWidth(nextRawSetWidth);
|
|
1987
|
+
return;
|
|
1988
|
+
}
|
|
1989
|
+
if (isStableNow && nextRawSetWidth !== setWidth) {
|
|
1990
|
+
setSetWidth(nextRawSetWidth);
|
|
1991
|
+
} else if (!isStableNow && setWidth <= 0) {
|
|
1992
|
+
cancelAnimationFrame(raf);
|
|
1993
|
+
raf = requestAnimationFrame(measure);
|
|
1994
|
+
}
|
|
1995
|
+
};
|
|
1996
|
+
const schedule = () => {
|
|
1997
|
+
cancelAnimationFrame(raf);
|
|
1998
|
+
raf = requestAnimationFrame(measure);
|
|
1999
|
+
};
|
|
2000
|
+
scheduleRemeasureRef.current = schedule;
|
|
2001
|
+
schedule();
|
|
2002
|
+
const ro = new ResizeObserver(schedule);
|
|
2003
|
+
ro.observe(wrapper);
|
|
2004
|
+
ro.observe(set);
|
|
2005
|
+
return () => {
|
|
2006
|
+
scheduleRemeasureRef.current = null;
|
|
2007
|
+
cancelAnimationFrame(raf);
|
|
2008
|
+
ro.disconnect();
|
|
2009
|
+
};
|
|
2010
|
+
}, [autoplayEnabled, setWidth]);
|
|
2011
|
+
|
|
2012
|
+
useLayoutEffect(() => {
|
|
2013
|
+
const track = trackRef.current;
|
|
2014
|
+
if (!autoplayEnabled || !track) return;
|
|
2015
|
+
const safeSetWidth = setWidth > 0 ? setWidth : 0;
|
|
2016
|
+
const durationMs = safeSetWidth > 0 && pxPerSec > 0 ? (safeSetWidth / pxPerSec) * 1000 : 0;
|
|
2017
|
+
const durationS = \`\${Math.max(0, durationMs) / 1000}s\`;
|
|
2018
|
+
track.style.setProperty('--marquee-distance', \`\${safeSetWidth}px\`);
|
|
2019
|
+
track.style.setProperty('--marquee-duration', durationS);
|
|
2020
|
+
}, [autoplayEnabled, pxPerSec, setWidth]);
|
|
2021
|
+
|
|
2022
|
+
useLayoutEffect(() => {
|
|
2023
|
+
if (!autoplayEnabled) {
|
|
2024
|
+
setTrackHeight(0);
|
|
2025
|
+
return;
|
|
2026
|
+
}
|
|
2027
|
+
if (setWidth <= 0) {
|
|
2028
|
+
setTrackHeight(0);
|
|
2029
|
+
return;
|
|
2030
|
+
}
|
|
2031
|
+
const track = trackRef.current;
|
|
2032
|
+
if (!track) return;
|
|
2033
|
+
const measure = () => {
|
|
2034
|
+
const next = track.getBoundingClientRect().height;
|
|
2035
|
+
setTrackHeight(next > 0 ? next : 0);
|
|
2036
|
+
};
|
|
2037
|
+
measure();
|
|
2038
|
+
const ro = new ResizeObserver(measure);
|
|
2039
|
+
ro.observe(track);
|
|
2040
|
+
return () => {
|
|
2041
|
+
ro.disconnect();
|
|
2042
|
+
};
|
|
2043
|
+
}, [autoplayEnabled, copies, trackContent, isEditor, gap, imageMaxWidth, imageMaxHeight, setWidth, imageFit]);
|
|
2044
|
+
|
|
2045
|
+
const onTrackEnter = () => {
|
|
2046
|
+
if (!hoverPauseEnabled) return;
|
|
2047
|
+
setIsHovering(true);
|
|
2048
|
+
};
|
|
2049
|
+
const onTrackLeave = () => {
|
|
2050
|
+
if (!hoverPauseEnabled) return;
|
|
2051
|
+
setIsHovering(false);
|
|
2052
|
+
};
|
|
2053
|
+
|
|
2054
|
+
const onFirstSetImageDone = () => {
|
|
2055
|
+
loadedFirstSetImagesRef.current = Math.min(
|
|
2056
|
+
firstSetImageUrlCount,
|
|
2057
|
+
loadedFirstSetImagesRef.current + 1,
|
|
2058
|
+
);
|
|
2059
|
+
scheduleRemeasureRef.current?.();
|
|
2060
|
+
};
|
|
2061
|
+
|
|
2062
|
+
const renderCardWrapper = (item: MarqueeItem, copyIndex: number, itemIndex: number, isFirstSet?: boolean) => {
|
|
2063
|
+
const cardKey = getMarqueeCardKey(copyIndex, itemIndex);
|
|
2064
|
+
const displayItem = hoverRandomizeEnabled ? (swappedSlots[itemIndex] ?? item) : item;
|
|
2065
|
+
const onCardEnter = hoverRandomizeEnabled
|
|
2066
|
+
? () => {
|
|
2067
|
+
const current = swappedSlots[itemIndex] ?? item;
|
|
2068
|
+
const candidates = (content ?? []).filter((c) => c !== current);
|
|
2069
|
+
if (candidates.length === 0) return;
|
|
2070
|
+
const next = candidates[Math.floor(Math.random() * candidates.length)];
|
|
2071
|
+
setSwappedSlots((prev) => ({ ...prev, [itemIndex]: next }));
|
|
2072
|
+
}
|
|
2073
|
+
: undefined;
|
|
2074
|
+
return (
|
|
2075
|
+
<div
|
|
2076
|
+
key={cardKey}
|
|
2077
|
+
className={\`\${P}-marquee-card\`}
|
|
2078
|
+
data-marquee-card-key={cardKey}
|
|
2079
|
+
data-marquee-item-index={itemIndex}
|
|
2080
|
+
data-marquee-copy-index={copyIndex}
|
|
2081
|
+
onMouseEnter={onCardEnter}
|
|
2082
|
+
>
|
|
2083
|
+
<MarqueeItemCard
|
|
2084
|
+
item={displayItem}
|
|
2085
|
+
prefix={P}
|
|
2086
|
+
imageFit={imageFit}
|
|
2087
|
+
imageMaxWidth={imageMaxWidth}
|
|
2088
|
+
imageMaxHeight={imageMaxHeight}
|
|
2089
|
+
imageHoverClass={imageHoverClass}
|
|
2090
|
+
isEditor={isEditor}
|
|
2091
|
+
isFirstSet={isFirstSet}
|
|
2092
|
+
scaled={scaled}
|
|
2093
|
+
onFirstSetImageDone={onFirstSetImageDone}
|
|
2094
|
+
/>
|
|
2095
|
+
{isEditor && (
|
|
2096
|
+
<div
|
|
2097
|
+
data-controls="gap"
|
|
2098
|
+
data-controls-axis="x"
|
|
2099
|
+
style={{
|
|
2100
|
+
position: 'absolute',
|
|
2101
|
+
top: 0,
|
|
2102
|
+
right: \`calc(-1 * \${scaled(gap)})\`,
|
|
2103
|
+
width: scaled(gap),
|
|
2104
|
+
height: '100%',
|
|
2105
|
+
pointerEvents: 'auto',
|
|
2106
|
+
zIndex: 2,
|
|
2107
|
+
}}
|
|
2108
|
+
/>
|
|
2109
|
+
)}
|
|
2110
|
+
</div>
|
|
2111
|
+
);
|
|
2112
|
+
};
|
|
2113
|
+
|
|
2114
|
+
if (autoplayEnabled && (content?.length ?? 0) > 0) {
|
|
2115
|
+
return (
|
|
2116
|
+
<div
|
|
2117
|
+
ref={wrapperRef}
|
|
2118
|
+
className={cn(\`\${P}-wrapper\`, \`\${P}-marquee-wrapper\`)}
|
|
2119
|
+
aria-label="Marquee"
|
|
2120
|
+
style={setWidth > 0 && trackHeight > 0 ? { height: trackHeight } : undefined}
|
|
2121
|
+
>
|
|
2122
|
+
<style dangerouslySetInnerHTML={{ __html: getCSS(P) }} />
|
|
2123
|
+
<div
|
|
2124
|
+
key="marquee-track"
|
|
2125
|
+
ref={trackRef}
|
|
2126
|
+
className={\`\${P}-marquee-track\`}
|
|
2127
|
+
data-direction={direction}
|
|
2128
|
+
onMouseEnter={onTrackEnter}
|
|
2129
|
+
onMouseLeave={onTrackLeave}
|
|
2130
|
+
style={{
|
|
2131
|
+
...(setWidth <= 0 ? { animationName: 'none' } : {}),
|
|
2132
|
+
...(hoverPauseEnabled
|
|
2133
|
+
? ({ '--marquee-play-state': isHovering ? 'paused' : 'running' } as React.CSSProperties)
|
|
2134
|
+
: ({ '--marquee-play-state': 'running' } as React.CSSProperties)),
|
|
2135
|
+
}}
|
|
2136
|
+
>
|
|
2137
|
+
{Array.from({ length: copies }, (_, copyIndex) => (
|
|
2138
|
+
<div
|
|
2139
|
+
key={\`set-\${copyIndex}\`}
|
|
2140
|
+
ref={copyIndex === 0 ? setRef : undefined}
|
|
2141
|
+
className={cn(\`\${P}-marquee-row\`, \`\${P}-marquee-set\`)}
|
|
2142
|
+
style={{
|
|
2143
|
+
gap: scaled(gap),
|
|
2144
|
+
paddingRight: scaled(gap),
|
|
2145
|
+
}}
|
|
2146
|
+
aria-hidden={copyIndex > 0}
|
|
2147
|
+
>
|
|
2148
|
+
{trackContent.map((item: MarqueeItem, index: number) =>
|
|
2149
|
+
renderCardWrapper(item, copyIndex, index, copyIndex === 0)
|
|
2150
|
+
)}
|
|
2151
|
+
</div>
|
|
2152
|
+
))}
|
|
2153
|
+
</div>
|
|
2154
|
+
</div>
|
|
2155
|
+
);
|
|
2156
|
+
}
|
|
2157
|
+
|
|
2158
|
+
return (
|
|
2159
|
+
<div ref={wrapperRef} className={\`\${P}-wrapper\`}>
|
|
2160
|
+
<style dangerouslySetInnerHTML={{ __html: getCSS(P) }} />
|
|
2161
|
+
<div
|
|
2162
|
+
key="marquee-static"
|
|
2163
|
+
className={cn(\`\${P}-marquee-row\`, \`\${P}-marquee-static\`)}
|
|
2164
|
+
style={{ gap: scaled(gap), transform: 'none' }}
|
|
2165
|
+
aria-label="Marquee"
|
|
2166
|
+
>
|
|
2167
|
+
{content?.map((item: MarqueeItem, index: number) =>
|
|
2168
|
+
renderCardWrapper(item, 0, index)
|
|
2169
|
+
)}
|
|
2170
|
+
</div>
|
|
2171
|
+
</div>
|
|
2172
|
+
);
|
|
2173
|
+
};
|
|
2174
|
+
|
|
2175
|
+
export type MarqueeItem = {
|
|
2176
|
+
image?: {
|
|
2177
|
+
url?: string;
|
|
2178
|
+
name?: string;
|
|
2179
|
+
};
|
|
2180
|
+
link?: string;
|
|
2181
|
+
};
|
|
2182
|
+
|
|
2183
|
+
export type MarqueeSettings = {
|
|
2184
|
+
speed: number;
|
|
2185
|
+
direction: 'left' | 'right';
|
|
2186
|
+
pauseOnHover: 'on' | 'off';
|
|
2187
|
+
hoverEffect: 'off' | 'brightness' | 'grayscale' | 'saturate';
|
|
2188
|
+
hoverRandomize: 'on' | 'off';
|
|
2189
|
+
gap: number;
|
|
2190
|
+
imageMaxWidth: number;
|
|
2191
|
+
imageMaxHeight: number;
|
|
2192
|
+
imageFit: 'cover' | 'contain';
|
|
2193
|
+
};
|
|
2194
|
+
|
|
2195
|
+
type MarqueeProps = {
|
|
2196
|
+
settings: MarqueeSettings;
|
|
2197
|
+
content?: MarqueeItem[];
|
|
2198
|
+
isEditor?: boolean;
|
|
2199
|
+
isPreviewMode?: boolean;
|
|
2200
|
+
} & CommonComponentProps;
|
|
2201
|
+
`,Qs={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:.5,max:7},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"switch-toggle-2",enum:["on","off"]}},hoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"switch-toggle",enum:["off","brightness","grayscale","saturate"]}},hoverRandomize:{type:"string",scope:"common",title:"Randomize",display:{type:"switch-toggle",enum:["on","off"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,max:200,display:{type:"range-control"}},imageMaxWidth:{type:"number",scope:"layout",title:"Max width",min:10,max:400,display:{type:"range-control"}},imageMaxHeight:{type:"number",scope:"layout",title:"Max height",min:10,max:400,display:{type:"range-control"}},imageFit:{type:"string",scope:"common",title:"Image cover",enum:["cover","contain"],display:{type:"switch-toggle-2",enum:["cover","contain"]}}},defaults:{direction:"left",pauseOnHover:"off",hoverEffect:"off",imageFit:"contain"},layoutDefaults:{m:{speed:.55,gap:.04,imageMaxWidth:.8,imageMaxHeight:.21},d:{speed:1.64,gap:.02,imageMaxWidth:.15,imageMaxHeight:.1}},displayRules:[{if:{name:"imageFit",value:"contain"},then:{name:"properties.hoverRandomize.display.visible",value:!1}}],layout:["__componentName__","speed","direction","pauseOnHover","hoverEffect","gap","imageMaxWidth","imageMaxHeight","imageFit"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["speed","imageFit"]},{type:"row",items:["imageMaxWidth","imageMaxHeight"]},{type:"row",items:["direction"]},{type:"group",title:"Hover Settings",items:[{type:"row",title:"",items:["pauseOnHover","hoverEffect"]},{type:"row",title:"",items:["hoverRandomize"]}]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"}},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ7RZNCQFC3T744H0KX6R3FR.jpeg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ7RZRTSS60YBFT6Y37ZX00T.jpeg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ9M9YJPQ5JWKCHDEW5M1GJD.jpeg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ7S04EHBXQS1T4KVAMZNZQM.jpeg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ7S08Q40WHD39024VNDWF2Q.jpeg",name:""},link:""}]}},el={element:Zs,id:"marquee",name:"Marquee",category:"galleries",version:1,defaultSize:{width:"100%",height:200},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/marquee.png"},schema:Qs,sourceCode:Js,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}};function _o(e){return`
|
|
1507
2202
|
.${e}-marquee-wrapper {
|
|
1508
2203
|
overflow: hidden;
|
|
1509
2204
|
width: 100%;
|
|
@@ -1590,7 +2285,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1590
2285
|
pointer-events: auto;
|
|
1591
2286
|
z-index: 10;
|
|
1592
2287
|
}
|
|
1593
|
-
`}const
|
|
2288
|
+
`}const tl=30,nl=({settings:e,content:t,isEditor:n,isPreviewMode:o})=>{const{prefix:r}=_.useScopedStyles(),{autoplay:s,align:i,speed:u,direction:l,pauseOnHover:m,gap:c,cardWidth:T,corners:S,stroke:g,strokeColor:p,bgColor:d,padding:x,logoMarginTop:y,logoWidth:b,logoHeight:E,captionMarginTop:K}=e,k=s==="on"&&!o,I=k,w=Math.max(0,u)*tl,C=B=>_.scalingValue(B,n??!1),R=h.useRef(null),z=h.useRef(null),P=h.useRef(null),[H,j]=h.useState(0),[D,G]=h.useState(0),[v,F]=h.useState(0),A=I&&m==="on",[M,$]=h.useState(!1),N=h.useRef(null),[J,ce]=h.useState(0),[re,ge]=h.useState(0),W=h.useRef(null),V=B=>{var X,pe,ne,me,we;return{fontSettings:{fontFamily:(e==null?void 0:e[`${B}FontFamily`])??"Arial",fontWeight:((X=e==null?void 0:e[`${B}FontSettings`])==null?void 0:X.fontWeight)??400,fontStyle:((pe=e==null?void 0:e[`${B}FontSettings`])==null?void 0:pe.fontStyle)??"normal"},textAppearance:{textTransform:((ne=e==null?void 0:e[`${B}TextAppearance`])==null?void 0:ne.textTransform)??"none",textDecoration:((me=e==null?void 0:e[`${B}TextAppearance`])==null?void 0:me.textDecoration)??"none",fontVariant:((we=e==null?void 0:e[`${B}TextAppearance`])==null?void 0:we.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${B}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${B}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${B}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${B}LineHeight`])??.01,color:(e==null?void 0:e[`${B}Color`])??"#000000"}},Q=V("text"),te=V("caption"),se=h.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(B=>{var Z,X;return(((Z=B.text)==null?void 0:Z.length)??0)>0||(((X=B.caption)==null?void 0:X.length)??0)>0}),[t]),q=h.useMemo(()=>!k||(t==null?void 0:t.length)===0?1:D<=0||H<=0?2:Math.max(2,Math.ceil(H/D)+1),[k,t==null?void 0:t.length,D,H]);h.useLayoutEffect(()=>{if(!k)return;const B=R.current,Z=P.current;if(!B||!Z)return;let X=0;const pe=()=>{const we=B.getBoundingClientRect().width,Ce=Z.getBoundingClientRect().width,lt=W.current,Ge=typeof lt=="number"&&Math.abs(lt-Ce)<=.25;if(W.current=Ce,j(we),typeof Ce=="number"&&Ce>0&&D<=0){G(Ce);return}Ge&&Ce!==D?G(Ce):!Ge&&D<=0&&(cancelAnimationFrame(X),X=requestAnimationFrame(pe))},ne=()=>{cancelAnimationFrame(X),X=requestAnimationFrame(pe)};ne();const me=new ResizeObserver(ne);return me.observe(B),me.observe(Z),()=>{cancelAnimationFrame(X),me.disconnect()}},[k,D]),h.useLayoutEffect(()=>{const B=z.current;if(!k||!B||!I)return;const Z=D>0?D:0,X=Z>0&&w>0?Z/w*1e3:0,pe=`${Math.max(0,X)/1e3}s`;B.style.setProperty("--marquee-distance",`${Z}px`),B.style.setProperty("--marquee-duration",pe)},[k,I,w,D]),h.useLayoutEffect(()=>{if(!k){F(0);return}const B=P.current,Z=z.current;if(!B||!Z)return;const X=()=>{let ne=0;for(let me=0;me<B.children.length;me++){const Ce=B.children[me].firstElementChild;Ce&&(ne=Math.max(ne,Ce.offsetHeight))}ne<=0&&(ne=Z.offsetHeight),F(ne>0?ne:0)};X();const pe=new ResizeObserver(X);return pe.observe(B),pe.observe(Z),()=>{pe.disconnect()}},[k,q,t,n,c,T,x,g,S,b,E,J,re]);const ie=()=>{A&&$(!0)},L=()=>{A&&$(!1)},f=h.useMemo(()=>{switch(i){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[i]),O=h.useMemo(()=>{switch(i){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[i]),Y=h.useCallback((B,Z,X,pe)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:f,width:"100%"},children:[a.jsx("div",{"data-controls":pe==null?void 0:pe.controlsName,"data-controls-axis":"y",className:`${r}-control`,style:{height:C((pe==null?void 0:pe.marginTop)??0)}}),a.jsx("div",{...pe!=null&&pe.dataMeasureKind?{"data-testimonial-measure":pe.dataMeasureKind}:{},style:{...Pe(B,n),textAlign:O,pointerEvents:"auto",...typeof(pe==null?void 0:pe.minHeightPx)=="number"&&pe.minHeightPx>0?{minHeight:pe.minHeightPx}:{}},children:a.jsx(Rt,{content:Z})})]},X),[f,O,n]),ee=h.useCallback((B,Z,X)=>{var pe,ne,me;return a.jsxs("div",{style:{padding:`${C(x.top)} ${C(x.right)} ${C(x.bottom)} ${C(x.left)}`,width:C(T+g*2),height:"100%",borderRadius:C(S),border:`${C(g)} solid ${p}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[a.jsx("div",{className:`${r}-cover`,style:{background:d}}),a.jsxs("div",{className:`${r}-elements-overlay`,style:{alignItems:f,textAlign:O},children:[B.text&&Y(Q,B.text,"text",X!=null&&X.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(X==null?void 0:X.textMinHeightPx)=="number"&&X.textMinHeightPx>0?{minHeightPx:X.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:f,width:"100%"},children:[a.jsx("div",{"data-controls":"logoMarginTop",className:`${r}-control`,style:{height:C(y)}}),a.jsx("div",{style:{width:C(b),height:C(E)},children:((pe=B.logo)==null?void 0:pe.url)&&a.jsx("img",{src:B.logo.url,alt:((ne=B.logo)==null?void 0:ne.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((me=B.logo)==null?void 0:me.objectFit)||"contain"}})})]}),B.caption&&Y(te,B.caption,"caption",{controlsName:"captionMarginTop",marginTop:K,...X!=null&&X.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(X==null?void 0:X.captionMinHeightPx)=="number"&&X.captionMinHeightPx>0?{minHeightPx:X.captionMinHeightPx}:{}})]})]},Z)},[d,K,te,T,S,E,y,b,f,O,x.bottom,x.left,x.right,x.top,Y,g,p,Q,n]),ue=h.useCallback(B=>{ce(B.maxTextPx),ge(B.maxCaptionPx)},[]);h.useLayoutEffect(()=>{if(!se){ue({maxTextPx:0,maxCaptionPx:0});return}const B=N.current;if(!B)return;const Z=()=>{_.readTestimonialTextMeasure(B,ue)};Z();const X=new ResizeObserver(Z);return X.observe(B),()=>{X.disconnect()}},[se,ue,t,ee]);const le=se?{textMinHeightPx:J,captionMinHeightPx:re}:void 0,ae=se?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((B,Z)=>ee(B,`measure-${Z}`,{dataMeasureAttrs:!0}))}):null,fe=(B,Z)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[ee(B,`card-${Z}`,le),n&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${C(c)})`,width:C(c),height:"100%",pointerEvents:"auto",zIndex:2}})]},Z);return k&&((t==null?void 0:t.length)??0)>0?a.jsxs("div",{ref:R,className:he(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...v>0?{height:v}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:_o(r)}}),ae,a.jsx("div",{ref:z,className:`${r}-marquee-track`,"data-direction":l,onMouseEnter:ie,onMouseLeave:L,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px",...A?{"--marquee-play-state":M?"paused":"running"}:{"--marquee-play-state":"running"}},children:Array.from({length:q},(B,Z)=>a.jsx("div",{ref:Z===0?P:void 0,className:`${r}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:C(c),paddingRight:C(c)},"aria-hidden":Z>0,children:t==null?void 0:t.map((X,pe)=>fe(X,`${Z}-${pe}`))},`set-${Z}`))})]}):a.jsxs("div",{className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:_o(r)}}),ae,a.jsx("div",{style:{gap:C(c),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((B,Z)=>fe(B,Z))})]})},ol=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
1594
2289
|
import cn from 'classnames';
|
|
1595
2290
|
import { CommonComponentProps } from '../props';
|
|
1596
2291
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -1821,19 +2516,29 @@ export const TestimonialGrid = ({ settings, content, isEditor, isPreviewMode }:
|
|
|
1821
2516
|
setTrackHeight(0);
|
|
1822
2517
|
return;
|
|
1823
2518
|
}
|
|
2519
|
+
const set = setRef.current;
|
|
1824
2520
|
const track = trackRef.current;
|
|
1825
|
-
if (!track) return;
|
|
2521
|
+
if (!set || !track) return;
|
|
1826
2522
|
const measure = () => {
|
|
1827
|
-
|
|
2523
|
+
let next = 0;
|
|
2524
|
+
for (let i = 0; i < set.children.length; i++) {
|
|
2525
|
+
const wrapper = set.children[i] as HTMLElement;
|
|
2526
|
+
const card = wrapper.firstElementChild as HTMLElement | null;
|
|
2527
|
+
if (card) next = Math.max(next, card.offsetHeight);
|
|
2528
|
+
}
|
|
2529
|
+
if (next <= 0) {
|
|
2530
|
+
next = track.offsetHeight;
|
|
2531
|
+
}
|
|
1828
2532
|
setTrackHeight(next > 0 ? next : 0);
|
|
1829
2533
|
};
|
|
1830
2534
|
measure();
|
|
1831
2535
|
const ro = new ResizeObserver(measure);
|
|
2536
|
+
ro.observe(set);
|
|
1832
2537
|
ro.observe(track);
|
|
1833
2538
|
return () => {
|
|
1834
2539
|
ro.disconnect();
|
|
1835
2540
|
};
|
|
1836
|
-
}, [autoplayEnabled, copies, content, isEditor, gap, cardWidth, padding, stroke, corners, logoWidth, logoHeight]);
|
|
2541
|
+
}, [autoplayEnabled, copies, content, isEditor, gap, cardWidth, padding, stroke, corners, logoWidth, logoHeight, measuredTextMinPx, measuredCaptionMinPx]);
|
|
1837
2542
|
|
|
1838
2543
|
const onTrackEnter = () => {
|
|
1839
2544
|
if (!hoverPauseEnabled) return;
|
|
@@ -1909,7 +2614,7 @@ export const TestimonialGrid = ({ settings, content, isEditor, isPreviewMode }:
|
|
|
1909
2614
|
key={key}
|
|
1910
2615
|
style={{
|
|
1911
2616
|
padding: \`\${scaled(padding.top)} \${scaled(padding.right)} \${scaled(padding.bottom)} \${scaled(padding.left)}\`,
|
|
1912
|
-
width: scaled(cardWidth + stroke * 2),
|
|
2617
|
+
width: scaled(cardWidth + (stroke * 2)),
|
|
1913
2618
|
height: '100%',
|
|
1914
2619
|
borderRadius: scaled(corners),
|
|
1915
2620
|
border: \`\${scaled(stroke)} solid \${strokeColor}\`,
|
|
@@ -2186,7 +2891,7 @@ type TestimonialsSettings = {
|
|
|
2186
2891
|
logoHeight: number;
|
|
2187
2892
|
captionMarginTop: number;
|
|
2188
2893
|
};
|
|
2189
|
-
`,
|
|
2894
|
+
`,Eo={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},rl={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:"switch-toggle-2",enum:["on","off"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,max:200,display:{type:"range-control"}},align:{type:"string",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},cardWidth:{type:"number",scope:"layout",title:"width",min:0,max:400,display:{type:"range-control"}},corners:{type:"number",scope:"layout",title:"Corners",min:0,max:100,display:{type:"range-control"}},stroke:{type:"number",scope:"layout",title:"Stroke",min:0,max:10,display:{type:"range-control"}},strokeColor:{type:"string",scope:"common",title:"Stroke Card",display:{type:"palette-color-picker",visible:!0}},bgColor:{title:"BG card",type:"string",scope:"common",display:{type:"palette-color-picker"}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},logoMarginTop:{type:"number",scope:"layout",title:"Logo margin top",min:0,max:200,display:{type:"range-control"}},logoWidth:{type:"number",scope:"layout",title:"width",min:0,max:200,display:{type:"range-control"}},logoHeight:{type:"number",scope:"layout",title:"height",min:0,max:200,display:{type:"range-control"}},textColor:{type:"string",scope:"common",title:"Fill Text",display:{type:"palette-color-picker"}},captionColor:{type:"string",scope:"common",title:"Fill Caption",display:{type:"palette-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Eo.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:{...Eo.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:["speed","pauseOnHover"]},{type:"row",items:["align","direction"]},{type:"row",title:"Card",items:[{type:"group",title:"",items:["cardWidth","corners","stroke"]},{type:"group",title:"",items:["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"}]}]}]}},il={element:nl,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:rl,sourceCode:ol,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function al(e){return`
|
|
2190
2895
|
.${e}-container {
|
|
2191
2896
|
position: relative;
|
|
2192
2897
|
overflow-x: clip;
|
|
@@ -2310,7 +3015,7 @@ type TestimonialsSettings = {
|
|
|
2310
3015
|
width: 100%;
|
|
2311
3016
|
height: 100%;
|
|
2312
3017
|
}
|
|
2313
|
-
`}const
|
|
3018
|
+
`}const sl=({settings:e,content:t,isEditor:n,isPreviewMode:o})=>{const{prefix:r}=_.useScopedStyles(),s=t||[],{autoplay:i,delay:u,align:l,width:m,imageMarginTop:c,textMarginTop:T,captionMarginTop:S,imageWidth:g,imageHeight:p,controlsWidth:d,controlsColor:x,controlsHoverColor:y}=e,b=i==="on"&&!o,[E,K]=h.useState(0),[k,I]=h.useState(null),[w,C]=h.useState(!1),R=h.useRef(null),z=h.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),P=h.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]);h.useEffect(()=>{K(0),I(null),C(!1)},[s.length]);const H=s[E],j=k===null?null:s[k],D=q=>{var L,f,O,Y,ee;return{fontSettings:{fontFamily:(e==null?void 0:e[`${q}FontFamily`])??"Arial",fontWeight:((L=e==null?void 0:e[`${q}FontSettings`])==null?void 0:L.fontWeight)??400,fontStyle:((f=e==null?void 0:e[`${q}FontSettings`])==null?void 0:f.fontStyle)??"normal"},textAppearance:{textTransform:((O=e==null?void 0:e[`${q}TextAppearance`])==null?void 0:O.textTransform)??"none",textDecoration:((Y=e==null?void 0:e[`${q}TextAppearance`])==null?void 0:Y.textDecoration)??"none",fontVariant:((ee=e==null?void 0:e[`${q}TextAppearance`])==null?void 0:ee.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"}},G=D("text"),v=D("caption"),F=s.length>1&&s.some(q=>{var ie,L;return(((ie=q.text)==null?void 0:ie.length)??0)>0||(((L=q.caption)==null?void 0:L.length)??0)>0}),A=h.useRef(null),[M,$]=h.useState(0),[N,J]=h.useState(0),ce=e.controls??{mode:"Off",icon:null},re=s.length>1,ge=h.useCallback((q,ie)=>!re||ie===q?q:(R.current&&window.clearTimeout(R.current),I(q),C(!0),R.current=window.setTimeout(()=>{I(null),C(!1),R.current=null},300),ie),[re]),W=h.useCallback(()=>{re&&K(q=>ge(q,(q-1+s.length)%s.length))},[re,ge,s.length]),V=h.useCallback(()=>{re&&K(q=>ge(q,(q+1)%s.length))},[re,ge,s.length]);h.useEffect(()=>{if(!b||!re)return;const q=Math.max(300,Number.isFinite(u*1e3)?u*1e3:0),ie=window.setInterval(()=>{K(L=>ge(L,(L+1)%s.length))},q);return()=>{window.clearInterval(ie)}},[b,re,ge,s.length,u]),h.useEffect(()=>()=>{R.current&&window.clearTimeout(R.current)},[]);const Q=(q,ie)=>{var Y,ee,ue,le;const L=ie==null?void 0:ie.textMinHeightPx,f=ie==null?void 0:ie.captionMinHeightPx,O=ie==null?void 0:ie.dataMeasureAttrs;return a.jsxs(a.Fragment,{children:[q.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:z,width:"100%"},children:[a.jsx("div",{"data-controls":"textMarginTop",className:`${r}-control`,style:{height:_.scalingValue(T??0,n??!1)}}),a.jsx("div",{...O&&{"data-testimonial-measure":"text"},style:{...Pe(G,n),...L&&L>0?{minHeight:L}:{},textAlign:P,pointerEvents:"auto"},children:a.jsx(Rt,{content:q.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:z,width:"100%"},children:[a.jsx("div",{"data-controls":"imageMarginTop",className:`${r}-control`,style:{height:_.scalingValue(c??0,n??!1)}}),a.jsx("div",{style:{width:_.scalingValue(g??0,n??!1),height:_.scalingValue(p??0,n??!1)},children:((Y=q.image)==null?void 0:Y.url)&&a.jsx("img",{src:(ee=q.image)==null?void 0:ee.url,alt:((ue=q.image)==null?void 0:ue.name)??"",className:`${r}-icon`,style:{objectFit:((le=q.image)==null?void 0:le.objectFit)||"contain"}})})]}),q.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:z,width:"100%"},children:[a.jsx("div",{"data-controls":"captionMarginTop",className:`${r}-control`,style:{height:_.scalingValue(S??0,n??!1)}}),a.jsx("div",{...O?{"data-testimonial-measure":"caption"}:{},style:{...Pe(v,n),...f&&f>0?{minHeight:f}:{},textAlign:P,pointerEvents:"auto"},children:a.jsx(Rt,{content:q.caption})})]})]})},te=h.useCallback(q=>{$(q.maxTextPx),J(q.maxCaptionPx)},[]);if(h.useLayoutEffect(()=>{if(!F){te({maxTextPx:0,maxCaptionPx:0});return}const q=A.current;if(!q)return;const ie=()=>{_.readTestimonialTextMeasure(q,te)};ie();const L=new ResizeObserver(ie);return L.observe(q),()=>{L.disconnect()}},[F,te,t]),!H)return a.jsx(a.Fragment,{});const se=F?{textMinHeightPx:M,captionMinHeightPx:N}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${r}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:al(r)}}),a.jsxs("div",{className:`${r}-wrapper`,style:{width:_.scalingValue(m??0,n??!1),alignItems:z},children:[F&&a.jsx("div",{ref:A,"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:Q(q,{dataMeasureAttrs:!0})},ie))}),a.jsxs("div",{className:`${r}-fade-stack`,children:[j&&w&&a.jsx("div",{className:he(`${r}-fade-item-prev`,`${r}-fade-out`),children:Q(j,se)}),a.jsx("div",{className:he(`${r}-fade-item-current`,w?`${r}-fade-in`:void 0),children:Q(H,se)})]})]}),ce.mode==="On"&&a.jsxs("div",{className:`${r}-controls`,children:[a.jsx("div",{className:`${r}-arrow`,style:{width:_.scalingValue(d??.02,n??!1),height:_.scalingValue(d??.02,n??!1),"--arrow-hover-color":y},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:W,disabled:!re,"aria-label":"Previous testimonial",children:ce.icon&&a.jsx(Xe,{url:ce.icon,fill:x,hoverFill:y,className:he(`${r}-arrow-img`,`${r}-mirror`)})})}),a.jsx("div",{className:he(`${r}-arrow`,`${r}-next-arrow`),style:{width:_.scalingValue(d??.02,n??!1),height:_.scalingValue(d??.02,n??!1),"--arrow-hover-color":y},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:V,disabled:!re,"aria-label":"Next testimonial",children:ce.icon&&a.jsx(Xe,{url:ce.icon,fill:x,hoverFill:y,className:`${r}-arrow-img`})})})]})]})})},ll=`import cn from 'classnames';
|
|
2314
3019
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
2315
3020
|
import { CommonComponentProps } from '../props';
|
|
2316
3021
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -2802,4 +3507,4 @@ type TestimonialsSettings = {
|
|
|
2802
3507
|
icon?: string | null;
|
|
2803
3508
|
};
|
|
2804
3509
|
};
|
|
2805
|
-
`,
|
|
3510
|
+
`,cl="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>'),ko={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},ul={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:"step-control"},step:1,min:1,max:8},align:{type:"string",scope:"common",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},width:{type:"number",scope:"layout",title:"width",min:0,max:1e3,display:{type:"range-control"}},imageWidth:{type:"number",scope:"layout",title:"width",min:0,max:300,display:{type:"range-control"}},imageHeight:{type:"number",scope:"layout",title:"height",min:0,max:300,display:{type:"range-control"}},imageMarginTop:{type:"number",scope:"layout",title:"Image margin top",min:0,max:200,display:{type:"range-control"}},textMarginTop:{type:"number",scope:"layout",title:"Text margin top",min:0,max:200,display:{type:"range-control"}},controls:{type:"object",scope:"common",title:"Controls",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},controlsWidth:{type:"number",scope:"layout",title:"Controls width",min:0,max:100,display:{type:"range-control"}},controlsColor:{type:"string",scope:"common",title:"Fill Controls",display:{type:"settings-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Hover Controls",display:{type:"settings-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...ko.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},captionColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Fill Caption"},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...ko.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Fill Text"}},defaults:{autoplay:"on",controls:{mode:"On",icon:cl},controlsColor:"#000000",controlsHoverColor:"#EABC01",align:"center",textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},captionColor:"#000000"},layoutDefaults:{m:{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:["controls",{type:"group",title:"",items:["delay","width"]}]},{type:"row",items:["controlsWidth","align"]},{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"}]}]}]}},pl={element:sl,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:ul,sourceCode:ll,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}},dl=[Ia,Wa,$s,Ms,Bs,el,il,pl];exports.components=dl;exports.isSchemaV1=xr;
|