@cntrl-site/components 1.0.1-alpha.11 → 1.0.1-alpha.12
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/Form/Form.d.ts +3 -2
- package/dist/index.js +34 -13
- package/dist/index.mjs +1939 -1895
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react/jsx-runtime"),D=require("react"),ce=require("classnames"),k=require("./useScopedStyles-Bibm8h9Z.js"),ir=require("react-dom");function ar(e){return e.type==="object"&&e.version===1}const lr="ControlSlider-module__wrapper___sHEkd",sr="ControlSlider-module__hoverArrow___A-dOH",cr="ControlSlider-module__sliderItem___QQSkR",ur="ControlSlider-module__sliderImage___9hRl-",pr="ControlSlider-module__arrow___05ghY",dr="ControlSlider-module__arrowVertical___tBfVN",gr="ControlSlider-module__nextArrow___-30Yc",fr="ControlSlider-module__arrowInner___aEra3",mr="ControlSlider-module__arrowIcon___S4ztF",yr="ControlSlider-module__arrowImg___2dwJW",hr="ControlSlider-module__mirror___brd6U",vr="ControlSlider-module__pagination___bicLF",br="ControlSlider-module__paginationInner___bT-P-",Sr="ControlSlider-module__paginationVertical___zYqKw",xr="ControlSlider-module__paginationItem___nTRbk",Cr="ControlSlider-module__dot___p1Qun",_r="ControlSlider-module__activeDot___LHFaj",wr="ControlSlider-module__paginationInsideBottom___R3FWn",$r="ControlSlider-module__paginationInsideTop___V-qb-",Tr="ControlSlider-module__paginationOutsideBottom___14w8D",Ar="ControlSlider-module__paginationOutsideTop___SCLqB",Er="ControlSlider-module__paginationInsideLeft___yOBRZ",Lr="ControlSlider-module__paginationInsideRight___Rtt3o",Ir="ControlSlider-module__paginationOutsideLeft___lahaw",kr="ControlSlider-module__paginationOutsideRight___EtuQa",Rr="ControlSlider-module__imgWrapper___UjEgB",Fr="ControlSlider-module__captionBlock___dJ6-j",Vr="ControlSlider-module__captionTextWrapper___HFlpf",Nr="ControlSlider-module__captionText___uGBVc",Or="ControlSlider-module__active___WZK4G",Br="ControlSlider-module__withPointerEvents___t-18M",jr="ControlSlider-module__topLeftAlignment___zjnGM",Wr="ControlSlider-module__topCenterAlignment___gD1xW",zr="ControlSlider-module__topRightAlignment___NMapS",Mr="ControlSlider-module__middleLeftAlignment___OnUrY",Dr="ControlSlider-module__middleCenterAlignment___Tdkl0",Hr="ControlSlider-module__middleRightAlignment___wEbfX",Pr="ControlSlider-module__bottomLeftAlignment___cTP2-",Ur="ControlSlider-module__bottomCenterAlignment___c54fB",Gr="ControlSlider-module__bottomRightAlignment___kEwrz",Yr="ControlSlider-module__clickOverlay___DZA28",qr="ControlSlider-module__contain___pLyq7",Xr="ControlSlider-module__cover___KdDat",Y={wrapper:lr,hoverArrow:sr,sliderItem:cr,sliderImage:ur,arrow:pr,arrowVertical:dr,nextArrow:gr,arrowInner:fr,arrowIcon:mr,arrowImg:yr,mirror:hr,pagination:vr,paginationInner:br,paginationVertical:Sr,paginationItem:xr,dot:Cr,activeDot:_r,paginationInsideBottom:wr,paginationInsideTop:$r,paginationOutsideBottom:Tr,paginationOutsideTop:Ar,paginationInsideLeft:Er,paginationInsideRight:Lr,paginationOutsideLeft:Ir,paginationOutsideRight:kr,imgWrapper:Rr,captionBlock:Fr,captionTextWrapper:Vr,captionText:Nr,active:Or,withPointerEvents:Br,topLeftAlignment:jr,topCenterAlignment:Wr,topRightAlignment:zr,middleLeftAlignment:Mr,middleCenterAlignment:Dr,middleRightAlignment:Hr,bottomLeftAlignment:Pr,bottomCenterAlignment:Ur,bottomRightAlignment:Gr,clickOverlay:Yr,contain:qr,cover:Xr};function Kr(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 Jr(e,t,n){return t&&Kr(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Hn="(prefers-reduced-motion: reduce)",lt=1,Zr=2,ut=3,gt=4,Tt=5,Bt=6,Mt=7,Qr={CREATED:lt,MOUNTED:Zr,IDLE:ut,MOVING:gt,SCROLLING:Tt,DRAGGING:Bt,DESTROYED:Mt};function ze(e){e.length=0}function Ye(e,t,n){return Array.prototype.slice.call(e,t,n)}function se(e){return e.bind.apply(e,[null].concat(Ye(arguments,1)))}var mo=setTimeout,dn=function(){};function Pn(e){return requestAnimationFrame(e)}function Gt(e,t){return typeof t===e}function bt(e){return!Cn(e)&&Gt("object",e)}var xn=Array.isArray,yo=se(Gt,"function"),Ue=se(Gt,"string"),At=se(Gt,"undefined");function Cn(e){return e===null}function ho(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Et(e){return xn(e)?e:[e]}function $e(e,t){Et(e).forEach(t)}function _n(e,t){return e.indexOf(t)>-1}function jt(e,t){return e.push.apply(e,Et(t)),e}function Be(e,t,n){e&&$e(t,function(o){o&&e.classList[n?"add":"remove"](o)})}function Fe(e,t){Be(e,Ue(t)?t.split(" "):t,!0)}function Lt(e,t){$e(t,e.appendChild.bind(e))}function wn(e,t){$e(e,function(n){var o=(t||n).parentNode;o&&o.insertBefore(n,t)})}function St(e,t){return ho(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function vo(e,t){var n=e?Ye(e.children):[];return t?n.filter(function(o){return St(o,t)}):n}function It(e,t){return t?vo(e,t)[0]:e.firstElementChild}var xt=Object.keys;function Je(e,t,n){return e&&(n?xt(e).reverse():xt(e)).forEach(function(o){o!=="__proto__"&&t(e[o],o)}),e}function Ct(e){return Ye(arguments,1).forEach(function(t){Je(t,function(n,o){e[o]=t[o]})}),e}function Pe(e){return Ye(arguments,1).forEach(function(t){Je(t,function(n,o){xn(n)?e[o]=n.slice():bt(n)?e[o]=Pe({},bt(e[o])?e[o]:{},n):e[o]=n})}),e}function Un(e,t){$e(t||xt(e),function(n){delete e[n]})}function Ve(e,t){$e(e,function(n){$e(t,function(o){n&&n.removeAttribute(o)})})}function ee(e,t,n){bt(t)?Je(t,function(o,r){ee(e,r,o)}):$e(e,function(o){Cn(n)||n===""?Ve(o,t):o.setAttribute(t,String(n))})}function st(e,t,n){var o=document.createElement(e);return t&&(Ue(t)?Fe(o,t):ee(o,t)),n&&Lt(n,o),o}function Ee(e,t,n){if(At(n))return getComputedStyle(e)[t];Cn(n)||(e.style[t]=""+n)}function _t(e,t){Ee(e,"display",t)}function bo(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Le(e,t){return e.getAttribute(t)}function Gn(e,t){return e&&e.classList.contains(t)}function _e(e){return e.getBoundingClientRect()}function Ze(e){$e(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function So(e){return It(new DOMParser().parseFromString(e,"text/html").body)}function Oe(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function xo(e,t){return e&&e.querySelector(t)}function $n(e,t){return t?Ye(e.querySelectorAll(t)):[]}function je(e,t){Be(e,t,!1)}function gn(e){return e.timeStamp}function Ke(e){return Ue(e)?e:e?e+"px":""}var kt="splide",Tn="data-"+kt;function yt(e,t){if(!e)throw new Error("["+kt+"] "+(t||""))}var Ge=Math.min,Dt=Math.max,Ht=Math.floor,wt=Math.ceil,Ce=Math.abs;function Co(e,t,n){return Ce(e-t)<n}function Wt(e,t,n,o){var r=Ge(t,n),a=Dt(t,n);return o?r<e&&e<a:r<=e&&e<=a}function it(e,t,n){var o=Ge(t,n),r=Dt(t,n);return Ge(Dt(o,e),r)}function fn(e){return+(e>0)-+(e<0)}function mn(e,t){return $e(t,function(n){e=e.replace("%s",""+n)}),e}function An(e){return e<10?"0"+e:""+e}var Yn={};function ei(e){return""+e+An(Yn[e]=(Yn[e]||0)+1)}function _o(){var e=[];function t(i,s,l,d){r(i,s,function(p,_,m){var h="addEventListener"in p,c=h?p.removeEventListener.bind(p,_,l,d):p.removeListener.bind(p,l);h?p.addEventListener(_,l,d):p.addListener(l),e.push([p,_,m,l,c])})}function n(i,s,l){r(i,s,function(d,p,_){e=e.filter(function(m){return m[0]===d&&m[1]===p&&m[2]===_&&(!l||m[3]===l)?(m[4](),!1):!0})})}function o(i,s,l){var d,p=!0;return typeof CustomEvent=="function"?d=new CustomEvent(s,{bubbles:p,detail:l}):(d=document.createEvent("CustomEvent"),d.initCustomEvent(s,p,!1,l)),i.dispatchEvent(d),d}function r(i,s,l){$e(i,function(d){d&&$e(s,function(p){p.split(" ").forEach(function(_){var m=_.split(".");l(d,m[0],m[1])})})})}function a(){e.forEach(function(i){i[4]()}),ze(e)}return{bind:t,unbind:n,dispatch:o,destroy:a}}var qe="mounted",yn="ready",Me="move",ft="moved",En="click",wo="active",$o="inactive",To="visible",Ao="hidden",he="refresh",xe="updated",pt="resize",Yt="resized",Eo="drag",Lo="dragging",Io="dragged",qt="scroll",et="scrolled",ti="overflow",Ln="destroy",ko="arrows:mounted",Ro="arrows:updated",Fo="pagination:mounted",Vo="pagination:updated",In="navigation:mounted",kn="autoplay:play",No="autoplay:playing",Rn="autoplay:pause",Fn="lazyload:loaded",Oo="sk",Bo="sh",Pt="ei";function ue(e){var t=e?e.event.bus:document.createDocumentFragment(),n=_o();function o(a,i){n.bind(t,Et(a).join(" "),function(s){i.apply(i,xn(s.detail)?s.detail:[])})}function r(a){n.dispatch(t,a,Ye(arguments,1))}return e&&e.event.on(Ln,n.destroy),Ct(n,{bus:t,on:o,off:se(n.unbind,t),emit:r})}function Xt(e,t,n,o){var r=Date.now,a,i=0,s,l=!0,d=0;function p(){if(!l){if(i=e?Ge((r()-a)/e,1):1,n&&n(i),i>=1&&(t(),a=r(),o&&++d>=o))return m();s=Pn(p)}}function _($){$||c(),a=r()-($?i*e:0),l=!1,s=Pn(p)}function m(){l=!0}function h(){a=r(),i=0,n&&n(i)}function c(){s&&cancelAnimationFrame(s),i=0,s=0,l=!0}function u($){e=$}function b(){return l}return{start:_,rewind:h,pause:m,cancel:c,set:u,isPaused:b}}function ni(e){var t=e;function n(r){t=r}function o(r){return _n(Et(r),t)}return{set:n,is:o}}function oi(e,t){var n=Xt(0,e,null,1);return function(){n.isPaused()&&n.start()}}function ri(e,t,n){var o=e.state,r=n.breakpoints||{},a=n.reducedMotion||{},i=_o(),s=[];function l(){var c=n.mediaQuery==="min";xt(r).sort(function(u,b){return c?+u-+b:+b-+u}).forEach(function(u){p(r[u],"("+(c?"min":"max")+"-width:"+u+"px)")}),p(a,Hn),_()}function d(c){c&&i.destroy()}function p(c,u){var b=matchMedia(u);i.bind(b,"change",_),s.push([c,b])}function _(){var c=o.is(Mt),u=n.direction,b=s.reduce(function($,f){return Pe($,f[1].matches?f[0]:{})},{});Un(n),h(b),n.destroy?e.destroy(n.destroy==="completely"):c?(d(!0),e.mount()):u!==n.direction&&e.refresh()}function m(c){matchMedia(Hn).matches&&(c?Pe(n,a):Un(n,xt(a)))}function h(c,u,b){Pe(n,c),u&&Pe(Object.getPrototypeOf(n),c),(b||!o.is(lt))&&e.emit(xe,n)}return{setup:l,destroy:d,reduce:m,set:h}}var Kt="Arrow",Jt=Kt+"Left",Zt=Kt+"Right",jo=Kt+"Up",Wo=Kt+"Down",qn="rtl",Qt="ttb",rn={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[jo,Zt],ArrowRight:[Wo,Jt]};function ii(e,t,n){function o(a,i,s){s=s||n.direction;var l=s===qn&&!i?1:s===Qt?0:-1;return rn[a]&&rn[a][l]||a.replace(/width|left|right/i,function(d,p){var _=rn[d.toLowerCase()][l]||d;return p>0?_.charAt(0).toUpperCase()+_.slice(1):_})}function r(a){return a*(n.direction===qn?1:-1)}return{resolve:o,orient:r}}var We="role",ct="tabindex",ai="disabled",Ie="aria-",Rt=Ie+"controls",zo=Ie+"current",Xn=Ie+"selected",we=Ie+"label",Vn=Ie+"labelledby",Mo=Ie+"hidden",Nn=Ie+"orientation",$t=Ie+"roledescription",Kn=Ie+"live",Jn=Ie+"busy",Zn=Ie+"atomic",On=[We,ct,ai,Rt,zo,we,Vn,Mo,Nn,$t],Ne=kt+"__",Xe="is-",an=kt,Qn=Ne+"track",li=Ne+"list",en=Ne+"slide",Do=en+"--clone",si=en+"__container",Bn=Ne+"arrows",tn=Ne+"arrow",Ho=tn+"--prev",Po=tn+"--next",nn=Ne+"pagination",Uo=nn+"__page",ci=Ne+"progress",ui=ci+"__bar",pi=Ne+"toggle",di=Ne+"spinner",gi=Ne+"sr",fi=Xe+"initialized",Qe=Xe+"active",Go=Xe+"prev",Yo=Xe+"next",hn=Xe+"visible",vn=Xe+"loading",qo=Xe+"focus-in",Xo=Xe+"overflow",mi=[Qe,hn,Go,Yo,vn,qo,Xo],yi={slide:en,clone:Do,arrows:Bn,arrow:tn,prev:Ho,next:Po,pagination:nn,page:Uo,spinner:di};function hi(e,t){if(yo(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!St(n,t);)n=n.parentElement;return n}var vi=5,eo=200,Ko="touchstart mousedown",ln="touchmove mousemove",sn="touchend touchcancel mouseup click";function bi(e,t,n){var o=ue(e),r=o.on,a=o.bind,i=e.root,s=n.i18n,l={},d=[],p=[],_=[],m,h,c;function u(){w(),j(),f()}function b(){r(he,$),r(he,u),r(xe,f),a(document,Ko+" keydown",function(v){c=v.type==="keydown"},{capture:!0}),a(i,"focusin",function(){Be(i,qo,!!c)})}function $(v){var T=On.concat("style");ze(d),je(i,p),je(m,_),Ve([m,h],T),Ve(i,v?T:["style",$t])}function f(){je(i,p),je(m,_),p=E(an),_=E(Qn),Fe(i,p),Fe(m,_),ee(i,we,n.label),ee(i,Vn,n.labelledby)}function w(){m=W("."+Qn),h=It(m,"."+li),yt(m&&h,"A track/list element is missing."),jt(d,vo(h,"."+en+":not(."+Do+")")),Je({arrows:Bn,pagination:nn,prev:Ho,next:Po,bar:ui,toggle:pi},function(v,T){l[T]=W("."+v)}),Ct(l,{root:i,track:m,list:h,slides:d})}function j(){var v=i.id||ei(kt),T=n.role;i.id=v,m.id=m.id||v+"-track",h.id=h.id||v+"-list",!Le(i,We)&&i.tagName!=="SECTION"&&T&&ee(i,We,T),ee(i,$t,s.carousel),ee(h,We,"presentation")}function W(v){var T=xo(i,v);return T&&hi(T,"."+an)===i?T:void 0}function E(v){return[v+"--"+n.type,v+"--"+n.direction,n.drag&&v+"--draggable",n.isNavigation&&v+"--nav",v===an&&Qe]}return Ct(l,{setup:u,mount:b,destroy:$})}var dt="slide",mt="loop",Ft="fade";function Si(e,t,n,o){var r=ue(e),a=r.on,i=r.emit,s=r.bind,l=e.Components,d=e.root,p=e.options,_=p.isNavigation,m=p.updateOnMove,h=p.i18n,c=p.pagination,u=p.slideFocus,b=l.Direction.resolve,$=Le(o,"style"),f=Le(o,we),w=n>-1,j=It(o,"."+si),W;function E(){w||(o.id=d.id+"-slide"+An(t+1),ee(o,We,c?"tabpanel":"group"),ee(o,$t,h.slide),ee(o,we,f||mn(h.slideLabel,[t+1,e.length]))),v()}function v(){s(o,"click",se(i,En,x)),s(o,"keydown",se(i,Oo,x)),a([ft,Bo,et],L),a(In,V),m&&a(Me,z)}function T(){W=!0,r.destroy(),je(o,mi),Ve(o,On),ee(o,"style",$),ee(o,we,f||"")}function V(){var A=e.splides.map(function(C){var N=C.splide.Components.Slides.getAt(t);return N?N.slide.id:""}).join(" ");ee(o,we,mn(h.slideX,(w?n:t)+1)),ee(o,Rt,A),ee(o,We,u?"button":""),u&&Ve(o,$t)}function z(){W||L()}function L(){if(!W){var A=e.index;F(),O(),Be(o,Go,t===A-1),Be(o,Yo,t===A+1)}}function F(){var A=H();A!==Gn(o,Qe)&&(Be(o,Qe,A),ee(o,zo,_&&A||""),i(A?wo:$o,x))}function O(){var A=g(),C=!A&&(!H()||w);if(e.state.is([gt,Tt])||ee(o,Mo,C||""),ee($n(o,p.focusableNodes||""),ct,C?-1:""),u&&ee(o,ct,C?-1:0),A!==Gn(o,hn)&&(Be(o,hn,A),i(A?To:Ao,x)),!A&&document.activeElement===o){var N=l.Slides.getAt(e.index);N&&bo(N.slide)}}function U(A,C,N){Ee(N&&j||o,A,C)}function H(){var A=e.index;return A===t||p.cloneStatus&&A===n}function g(){if(e.is(Ft))return H();var A=_e(l.Elements.track),C=_e(o),N=b("left",!0),q=b("right",!0);return Ht(A[N])<=wt(C[N])&&Ht(C[q])<=wt(A[q])}function R(A,C){var N=Ce(A-t);return!w&&(p.rewind||e.is(mt))&&(N=Ge(N,e.length-N)),N<=C}var x={index:t,slideIndex:n,slide:o,container:j,isClone:w,mount:E,destroy:T,update:L,style:U,isWithin:R};return x}function xi(e,t,n){var o=ue(e),r=o.on,a=o.emit,i=o.bind,s=t.Elements,l=s.slides,d=s.list,p=[];function _(){m(),r(he,h),r(he,m)}function m(){l.forEach(function(L,F){u(L,F,-1)})}function h(){W(function(L){L.destroy()}),ze(p)}function c(){W(function(L){L.update()})}function u(L,F,O){var U=Si(e,F,O,L);U.mount(),p.push(U),p.sort(function(H,g){return H.index-g.index})}function b(L){return L?E(function(F){return!F.isClone}):p}function $(L){var F=t.Controller,O=F.toIndex(L),U=F.hasFocus()?1:n.perPage;return E(function(H){return Wt(H.index,O,O+U-1)})}function f(L){return E(L)[0]}function w(L,F){$e(L,function(O){if(Ue(O)&&(O=So(O)),ho(O)){var U=l[F];U?wn(O,U):Lt(d,O),Fe(O,n.classes.slide),T(O,se(a,pt))}}),a(he)}function j(L){Ze(E(L).map(function(F){return F.slide})),a(he)}function W(L,F){b(F).forEach(L)}function E(L){return p.filter(yo(L)?L:function(F){return Ue(L)?St(F.slide,L):_n(Et(L),F.index)})}function v(L,F,O){W(function(U){U.style(L,F,O)})}function T(L,F){var O=$n(L,"img"),U=O.length;U?O.forEach(function(H){i(H,"load error",function(){--U||F()})}):F()}function V(L){return L?l.length:p.length}function z(){return p.length>n.perPage}return{mount:_,destroy:h,update:c,register:u,get:b,getIn:$,getAt:f,add:w,remove:j,forEach:W,filter:E,style:v,getLength:V,isEnough:z}}function Ci(e,t,n){var o=ue(e),r=o.on,a=o.bind,i=o.emit,s=t.Slides,l=t.Direction.resolve,d=t.Elements,p=d.root,_=d.track,m=d.list,h=s.getAt,c=s.style,u,b,$;function f(){w(),a(window,"resize load",oi(se(i,pt))),r([xe,he],w),r(pt,j)}function w(){u=n.direction===Qt,Ee(p,"maxWidth",Ke(n.width)),Ee(_,l("paddingLeft"),W(!1)),Ee(_,l("paddingRight"),W(!0)),j(!0)}function j(x){var A=_e(p);(x||b.width!==A.width||b.height!==A.height)&&(Ee(_,"height",E()),c(l("marginRight"),Ke(n.gap)),c("width",T()),c("height",V(),!0),b=A,i(Yt),$!==($=R())&&(Be(p,Xo,$),i(ti,$)))}function W(x){var A=n.padding,C=l(x?"right":"left");return A&&Ke(A[C]||(bt(A)?0:A))||"0px"}function E(){var x="";return u&&(x=v(),yt(x,"height or heightRatio is missing."),x="calc("+x+" - "+W(!1)+" - "+W(!0)+")"),x}function v(){return Ke(n.height||_e(m).width*n.heightRatio)}function T(){return n.autoWidth?null:Ke(n.fixedWidth)||(u?"":z())}function V(){return Ke(n.fixedHeight)||(u?n.autoHeight?null:z():v())}function z(){var x=Ke(n.gap);return"calc((100%"+(x&&" + "+x)+")/"+(n.perPage||1)+(x&&" - "+x)+")"}function L(){return _e(m)[l("width")]}function F(x,A){var C=h(x||0);return C?_e(C.slide)[l("width")]+(A?0:H()):0}function O(x,A){var C=h(x);if(C){var N=_e(C.slide)[l("right")],q=_e(m)[l("left")];return Ce(N-q)+(A?0:H())}return 0}function U(x){return O(e.length-1)-O(0)+F(0,x)}function H(){var x=h(0);return x&&parseFloat(Ee(x.slide,l("marginRight")))||0}function g(x){return parseFloat(Ee(_,l("padding"+(x?"Right":"Left"))))||0}function R(){return e.is(Ft)||U(!0)>L()}return{mount:f,resize:j,listSize:L,slideSize:F,sliderSize:U,totalSize:O,getPadding:g,isOverflow:R}}var _i=2;function wi(e,t,n){var o=ue(e),r=o.on,a=t.Elements,i=t.Slides,s=t.Direction.resolve,l=[],d;function p(){r(he,_),r([xe,pt],h),(d=b())&&(c(d),t.Layout.resize(!0))}function _(){m(),p()}function m(){Ze(l),ze(l),o.destroy()}function h(){var $=b();d!==$&&(d<$||!$)&&o.emit(he)}function c($){var f=i.get().slice(),w=f.length;if(w){for(;f.length<$;)jt(f,f);jt(f.slice(-$),f.slice(0,$)).forEach(function(j,W){var E=W<$,v=u(j.slide,W);E?wn(v,f[0].slide):Lt(a.list,v),jt(l,v),i.register(v,W-$+(E?0:w),j.index)})}}function u($,f){var w=$.cloneNode(!0);return Fe(w,n.classes.clone),w.id=e.root.id+"-clone"+An(f+1),w}function b(){var $=n.clones;if(!e.is(mt))$=0;else if(At($)){var f=n[s("fixedWidth")]&&t.Layout.slideSize(0),w=f&&wt(_e(a.track)[s("width")]/f);$=w||n[s("autoWidth")]&&e.length||n.perPage*_i}return $}return{mount:p,destroy:m}}function $i(e,t,n){var o=ue(e),r=o.on,a=o.emit,i=e.state.set,s=t.Layout,l=s.slideSize,d=s.getPadding,p=s.totalSize,_=s.listSize,m=s.sliderSize,h=t.Direction,c=h.resolve,u=h.orient,b=t.Elements,$=b.list,f=b.track,w;function j(){w=t.Transition,r([qe,Yt,xe,he],W)}function W(){t.Controller.isBusy()||(t.Scroll.cancel(),v(e.index),t.Slides.update())}function E(C,N,q,ie){C!==N&&x(C>q)&&(L(),T(z(U(),C>q),!0)),i(gt),a(Me,N,q,C),w.start(N,function(){i(ut),a(ft,N,q,C),ie&&ie()})}function v(C){T(O(C,!0))}function T(C,N){if(!e.is(Ft)){var q=N?C:V(C);Ee($,"transform","translate"+c("X")+"("+q+"px)"),C!==q&&a(Bo)}}function V(C){if(e.is(mt)){var N=F(C),q=N>t.Controller.getEnd(),ie=N<0;(ie||q)&&(C=z(C,q))}return C}function z(C,N){var q=C-R(N),ie=m();return C-=u(ie*(wt(Ce(q)/ie)||1))*(N?1:-1),C}function L(){T(U(),!0),w.cancel()}function F(C){for(var N=t.Slides.get(),q=0,ie=1/0,Q=0;Q<N.length;Q++){var me=N[Q].index,I=Ce(O(me,!0)-C);if(I<=ie)ie=I,q=me;else break}return q}function O(C,N){var q=u(p(C-1)-g(C));return N?H(q):q}function U(){var C=c("left");return _e($)[C]-_e(f)[C]+u(d(!1))}function H(C){return n.trimSpace&&e.is(dt)&&(C=it(C,0,u(m(!0)-_()))),C}function g(C){var N=n.focus;return N==="center"?(_()-l(C,!0))/2:+N*l(C)||0}function R(C){return O(C?t.Controller.getEnd():0,!!n.trimSpace)}function x(C){var N=u(z(U(),C));return C?N>=0:N<=$[c("scrollWidth")]-_e(f)[c("width")]}function A(C,N){N=At(N)?U():N;var q=C!==!0&&u(N)<u(R(!1)),ie=C!==!1&&u(N)>u(R(!0));return q||ie}return{mount:j,move:E,jump:v,translate:T,shift:z,cancel:L,toIndex:F,toPosition:O,getPosition:U,getLimit:R,exceededLimit:A,reposition:W}}function Ti(e,t,n){var o=ue(e),r=o.on,a=o.emit,i=t.Move,s=i.getPosition,l=i.getLimit,d=i.toPosition,p=t.Slides,_=p.isEnough,m=p.getLength,h=n.omitEnd,c=e.is(mt),u=e.is(dt),b=se(U,!1),$=se(U,!0),f=n.start||0,w,j=f,W,E,v;function T(){V(),r([xe,he,Pt],V),r(Yt,z)}function V(){W=m(!0),E=n.perMove,v=n.perPage,w=x();var I=it(f,0,h?w:W-1);I!==f&&(f=I,i.reposition())}function z(){w!==x()&&a(Pt)}function L(I,K,ye){if(!me()){var ae=O(I),pe=R(ae);pe>-1&&(K||pe!==f)&&(q(pe),i.move(ae,pe,j,ye))}}function F(I,K,ye,ae){t.Scroll.scroll(I,K,ye,function(){var pe=R(i.toIndex(s()));q(h?Ge(pe,w):pe),ae&&ae()})}function O(I){var K=f;if(Ue(I)){var ye=I.match(/([+\-<>])(\d+)?/)||[],ae=ye[1],pe=ye[2];ae==="+"||ae==="-"?K=H(f+ +(""+ae+(+pe||1)),f):ae===">"?K=pe?A(+pe):b(!0):ae==="<"&&(K=$(!0))}else K=c?I:it(I,0,w);return K}function U(I,K){var ye=E||(Q()?1:v),ae=H(f+ye*(I?-1:1),f,!(E||Q()));return ae===-1&&u&&!Co(s(),l(!I),1)?I?0:w:K?ae:R(ae)}function H(I,K,ye){if(_()||Q()){var ae=g(I);ae!==I&&(K=I,I=ae,ye=!1),I<0||I>w?!E&&(Wt(0,I,K,!0)||Wt(w,K,I,!0))?I=A(C(I)):c?I=ye?I<0?-(W%v||v):W:I:n.rewind?I=I<0?w:0:I=-1:ye&&I!==K&&(I=A(C(K)+(I<K?-1:1)))}else I=-1;return I}function g(I){if(u&&n.trimSpace==="move"&&I!==f)for(var K=s();K===d(I,!0)&&Wt(I,0,e.length-1,!n.rewind);)I<f?--I:++I;return I}function R(I){return c?(I+W)%W||0:I}function x(){for(var I=W-(Q()||c&&E?1:v);h&&I-- >0;)if(d(W-1,!0)!==d(I,!0)){I++;break}return it(I,0,W-1)}function A(I){return it(Q()?I:v*I,0,w)}function C(I){return Q()?Ge(I,w):Ht((I>=w?W-1:I)/v)}function N(I){var K=i.toIndex(I);return u?it(K,0,w):K}function q(I){I!==f&&(j=f,f=I)}function ie(I){return I?j:f}function Q(){return!At(n.focus)||n.isNavigation}function me(){return e.state.is([gt,Tt])&&!!n.waitForTransition}return{mount:T,go:L,scroll:F,getNext:b,getPrev:$,getAdjacent:U,getEnd:x,setIndex:q,getIndex:ie,toIndex:A,toPage:C,toDest:N,hasFocus:Q,isBusy:me}}var Ai="http://www.w3.org/2000/svg",Ei="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",Vt=40;function Li(e,t,n){var o=ue(e),r=o.on,a=o.bind,i=o.emit,s=n.classes,l=n.i18n,d=t.Elements,p=t.Controller,_=d.arrows,m=d.track,h=_,c=d.prev,u=d.next,b,$,f={};function w(){W(),r(xe,j)}function j(){E(),w()}function W(){var F=n.arrows;F&&!(c&&u)&&V(),c&&u&&(Ct(f,{prev:c,next:u}),_t(h,F?"":"none"),Fe(h,$=Bn+"--"+n.direction),F&&(v(),L(),ee([c,u],Rt,m.id),i(ko,c,u)))}function E(){o.destroy(),je(h,$),b?(Ze(_?[c,u]:h),c=u=null):Ve([c,u],On)}function v(){r([qe,ft,he,et,Pt],L),a(u,"click",se(T,">")),a(c,"click",se(T,"<"))}function T(F){p.go(F,!0)}function V(){h=_||st("div",s.arrows),c=z(!0),u=z(!1),b=!0,Lt(h,[c,u]),!_&&wn(h,m)}function z(F){var O='<button class="'+s.arrow+" "+(F?s.prev:s.next)+'" type="button"><svg xmlns="'+Ai+'" viewBox="0 0 '+Vt+" "+Vt+'" width="'+Vt+'" height="'+Vt+'" focusable="false"><path d="'+(n.arrowPath||Ei)+'" />';return So(O)}function L(){if(c&&u){var F=e.index,O=p.getPrev(),U=p.getNext(),H=O>-1&&F<O?l.last:l.prev,g=U>-1&&F>U?l.first:l.next;c.disabled=O<0,u.disabled=U<0,ee(c,we,H),ee(u,we,g),i(Ro,c,u,O,U)}}return{arrows:f,mount:w,destroy:E,update:L}}var Ii=Tn+"-interval";function ki(e,t,n){var o=ue(e),r=o.on,a=o.bind,i=o.emit,s=Xt(n.interval,e.go.bind(e,">"),v),l=s.isPaused,d=t.Elements,p=t.Elements,_=p.root,m=p.toggle,h=n.autoplay,c,u,b=h==="pause";function $(){h&&(f(),m&&ee(m,Rt,d.track.id),b||w(),E())}function f(){n.pauseOnHover&&a(_,"mouseenter mouseleave",function(V){c=V.type==="mouseenter",W()}),n.pauseOnFocus&&a(_,"focusin focusout",function(V){u=V.type==="focusin",W()}),m&&a(m,"click",function(){b?w():j(!0)}),r([Me,qt,he],s.rewind),r(Me,T)}function w(){l()&&t.Slides.isEnough()&&(s.start(!n.resetProgress),u=c=b=!1,E(),i(kn))}function j(V){V===void 0&&(V=!0),b=!!V,E(),l()||(s.pause(),i(Rn))}function W(){b||(c||u?j(!1):w())}function E(){m&&(Be(m,Qe,!b),ee(m,we,n.i18n[b?"play":"pause"]))}function v(V){var z=d.bar;z&&Ee(z,"width",V*100+"%"),i(No,V)}function T(V){var z=t.Slides.getAt(V);s.set(z&&+Le(z.slide,Ii)||n.interval)}return{mount:$,destroy:s.cancel,play:w,pause:j,isPaused:l}}function Ri(e,t,n){var o=ue(e),r=o.on;function a(){n.cover&&(r(Fn,se(s,!0)),r([qe,xe,he],se(i,!0)))}function i(l){t.Slides.forEach(function(d){var p=It(d.container||d.slide,"img");p&&p.src&&s(l,p,d)})}function s(l,d,p){p.style("background",l?'center/cover no-repeat url("'+d.src+'")':"",!0),_t(d,l?"none":"")}return{mount:a,destroy:se(i,!1)}}var Fi=10,Vi=600,Ni=.6,Oi=1.5,Bi=800;function ji(e,t,n){var o=ue(e),r=o.on,a=o.emit,i=e.state.set,s=t.Move,l=s.getPosition,d=s.getLimit,p=s.exceededLimit,_=s.translate,m=e.is(dt),h,c,u=1;function b(){r(Me,j),r([xe,he],W)}function $(v,T,V,z,L){var F=l();if(j(),V&&(!m||!p())){var O=t.Layout.sliderSize(),U=fn(v)*O*Ht(Ce(v)/O)||0;v=s.toPosition(t.Controller.toDest(v%O))+U}var H=Co(F,v,1);u=1,T=H?0:T||Dt(Ce(v-F)/Oi,Bi),c=z,h=Xt(T,f,se(w,F,v,L),1),i(Tt),a(qt),h.start()}function f(){i(ut),c&&c(),a(et)}function w(v,T,V,z){var L=l(),F=v+(T-v)*E(z),O=(F-L)*u;_(L+O),m&&!V&&p()&&(u*=Ni,Ce(O)<Fi&&$(d(p(!0)),Vi,!1,c,!0))}function j(){h&&h.cancel()}function W(){h&&!h.isPaused()&&(j(),f())}function E(v){var T=n.easingFunc;return T?T(v):1-Math.pow(1-v,4)}return{mount:b,destroy:j,scroll:$,cancel:W}}var at={passive:!1,capture:!0};function Wi(e,t,n){var o=ue(e),r=o.on,a=o.emit,i=o.bind,s=o.unbind,l=e.state,d=t.Move,p=t.Scroll,_=t.Controller,m=t.Elements.track,h=t.Media.reduce,c=t.Direction,u=c.resolve,b=c.orient,$=d.getPosition,f=d.exceededLimit,w,j,W,E,v,T=!1,V,z,L;function F(){i(m,ln,dn,at),i(m,sn,dn,at),i(m,Ko,U,at),i(m,"click",R,{capture:!0}),i(m,"dragstart",Oe),r([qe,xe],O)}function O(){var M=n.drag;De(!M),E=M==="free"}function U(M){if(V=!1,!z){var y=pe(M);ae(M.target)&&(y||!M.button)&&(_.isBusy()?Oe(M,!0):(L=y?m:window,v=l.is([gt,Tt]),W=null,i(L,ln,H,at),i(L,sn,g,at),d.cancel(),p.cancel(),x(M)))}}function H(M){if(l.is(Bt)||(l.set(Bt),a(Eo)),M.cancelable)if(v){d.translate(w+ye(Q(M)));var y=me(M)>eo,P=T!==(T=f());(y||P)&&x(M),V=!0,a(Lo),Oe(M)}else N(M)&&(v=C(M),Oe(M))}function g(M){l.is(Bt)&&(l.set(ut),a(Io)),v&&(A(M),Oe(M)),s(L,ln,H),s(L,sn,g),v=!1}function R(M){!z&&V&&Oe(M,!0)}function x(M){W=j,j=M,w=$()}function A(M){var y=q(M),P=ie(y),G=n.rewind&&n.rewindByDrag;h(!1),E?_.scroll(P,0,n.snap):e.is(Ft)?_.go(b(fn(y))<0?G?"<":"-":G?">":"+"):e.is(dt)&&T&&G?_.go(f(!0)?">":"<"):_.go(_.toDest(P),!0),h(!0)}function C(M){var y=n.dragMinThreshold,P=bt(y),G=P&&y.mouse||0,J=(P?y.touch:+y)||10;return Ce(Q(M))>(pe(M)?J:G)}function N(M){return Ce(Q(M))>Ce(Q(M,!0))}function q(M){if(e.is(mt)||!T){var y=me(M);if(y&&y<eo)return Q(M)/y}return 0}function ie(M){return $()+fn(M)*Ge(Ce(M)*(n.flickPower||600),E?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function Q(M,y){return K(M,y)-K(I(M),y)}function me(M){return gn(M)-gn(I(M))}function I(M){return j===M&&W||j}function K(M,y){return(pe(M)?M.changedTouches[0]:M)["page"+u(y?"Y":"X")]}function ye(M){return M/(T&&e.is(dt)?vi:1)}function ae(M){var y=n.noDrag;return!St(M,"."+Uo+", ."+tn)&&(!y||!St(M,y))}function pe(M){return typeof TouchEvent<"u"&&M instanceof TouchEvent}function de(){return v}function De(M){z=M}return{mount:F,disable:De,isDragging:de}}var zi={Spacebar:" ",Right:Zt,Left:Jt,Up:jo,Down:Wo};function jn(e){return e=Ue(e)?e:e.key,zi[e]||e}var to="keydown";function Mi(e,t,n){var o=ue(e),r=o.on,a=o.bind,i=o.unbind,s=e.root,l=t.Direction.resolve,d,p;function _(){m(),r(xe,h),r(xe,m),r(Me,u)}function m(){var $=n.keyboard;$&&(d=$==="global"?window:s,a(d,to,b))}function h(){i(d,to)}function c($){p=$}function u(){var $=p;p=!0,mo(function(){p=$})}function b($){if(!p){var f=jn($);f===l(Jt)?e.go("<"):f===l(Zt)&&e.go(">")}}return{mount:_,destroy:h,disable:c}}var ht=Tn+"-lazy",zt=ht+"-srcset",Di="["+ht+"], ["+zt+"]";function Hi(e,t,n){var o=ue(e),r=o.on,a=o.off,i=o.bind,s=o.emit,l=n.lazyLoad==="sequential",d=[ft,et],p=[];function _(){n.lazyLoad&&(m(),r(he,m))}function m(){ze(p),h(),l?$():(a(d),r(d,c),c())}function h(){t.Slides.forEach(function(f){$n(f.slide,Di).forEach(function(w){var j=Le(w,ht),W=Le(w,zt);if(j!==w.src||W!==w.srcset){var E=n.classes.spinner,v=w.parentElement,T=It(v,"."+E)||st("span",E,v);p.push([w,f,T]),w.src||_t(w,"none")}})})}function c(){p=p.filter(function(f){var w=n.perPage*((n.preloadPages||1)+1)-1;return f[1].isWithin(e.index,w)?u(f):!0}),p.length||a(d)}function u(f){var w=f[0];Fe(f[1].slide,vn),i(w,"load error",se(b,f)),ee(w,"src",Le(w,ht)),ee(w,"srcset",Le(w,zt)),Ve(w,ht),Ve(w,zt)}function b(f,w){var j=f[0],W=f[1];je(W.slide,vn),w.type!=="error"&&(Ze(f[2]),_t(j,""),s(Fn,j,W),s(pt)),l&&$()}function $(){p.length&&u(p.shift())}return{mount:_,destroy:se(ze,p),check:c}}function Pi(e,t,n){var o=ue(e),r=o.on,a=o.emit,i=o.bind,s=t.Slides,l=t.Elements,d=t.Controller,p=d.hasFocus,_=d.getIndex,m=d.go,h=t.Direction.resolve,c=l.pagination,u=[],b,$;function f(){w(),r([xe,he,Pt],f);var z=n.pagination;c&&_t(c,z?"":"none"),z&&(r([Me,qt,et],V),j(),V(),a(Fo,{list:b,items:u},T(e.index)))}function w(){b&&(Ze(c?Ye(b.children):b),je(b,$),ze(u),b=null),o.destroy()}function j(){var z=e.length,L=n.classes,F=n.i18n,O=n.perPage,U=p()?d.getEnd()+1:wt(z/O);b=c||st("ul",L.pagination,l.track.parentElement),Fe(b,$=nn+"--"+v()),ee(b,We,"tablist"),ee(b,we,F.select),ee(b,Nn,v()===Qt?"vertical":"");for(var H=0;H<U;H++){var g=st("li",null,b),R=st("button",{class:L.page,type:"button"},g),x=s.getIn(H).map(function(C){return C.slide.id}),A=!p()&&O>1?F.pageX:F.slideX;i(R,"click",se(W,H)),n.paginationKeyboard&&i(R,"keydown",se(E,H)),ee(g,We,"presentation"),ee(R,We,"tab"),ee(R,Rt,x.join(" ")),ee(R,we,mn(A,H+1)),ee(R,ct,-1),u.push({li:g,button:R,page:H})}}function W(z){m(">"+z,!0)}function E(z,L){var F=u.length,O=jn(L),U=v(),H=-1;O===h(Zt,!1,U)?H=++z%F:O===h(Jt,!1,U)?H=(--z+F)%F:O==="Home"?H=0:O==="End"&&(H=F-1);var g=u[H];g&&(bo(g.button),m(">"+H),Oe(L,!0))}function v(){return n.paginationDirection||n.direction}function T(z){return u[d.toPage(z)]}function V(){var z=T(_(!0)),L=T(_());if(z){var F=z.button;je(F,Qe),Ve(F,Xn),ee(F,ct,-1)}if(L){var O=L.button;Fe(O,Qe),ee(O,Xn,!0),ee(O,ct,"")}a(Vo,{list:b,items:u},z,L)}return{items:u,mount:f,destroy:w,getAt:T,update:V}}var Ui=[" ","Enter"];function Gi(e,t,n){var o=n.isNavigation,r=n.slideFocus,a=[];function i(){e.splides.forEach(function(c){c.isParent||(d(e,c.splide),d(c.splide,e))}),o&&p()}function s(){a.forEach(function(c){c.destroy()}),ze(a)}function l(){s(),i()}function d(c,u){var b=ue(c);b.on(Me,function($,f,w){u.go(u.is(mt)?w:$)}),a.push(b)}function p(){var c=ue(e),u=c.on;u(En,m),u(Oo,h),u([qe,xe],_),a.push(c),c.emit(In,e.splides)}function _(){ee(t.Elements.list,Nn,n.direction===Qt?"vertical":"")}function m(c){e.go(c.index)}function h(c,u){_n(Ui,jn(u))&&(m(c),Oe(u))}return{setup:se(t.Media.set,{slideFocus:At(r)?o:r},!0),mount:i,destroy:s,remount:l}}function Yi(e,t,n){var o=ue(e),r=o.bind,a=0;function i(){n.wheel&&r(t.Elements.track,"wheel",s,at)}function s(d){if(d.cancelable){var p=d.deltaY,_=p<0,m=gn(d),h=n.wheelMinThreshold||0,c=n.wheelSleep||0;Ce(p)>h&&m-a>c&&(e.go(_?"<":">"),a=m),l(_)&&Oe(d)}}function l(d){return!n.releaseWheel||e.state.is(gt)||t.Controller.getAdjacent(d)!==-1}return{mount:i}}var qi=90;function Xi(e,t,n){var o=ue(e),r=o.on,a=t.Elements.track,i=n.live&&!n.isNavigation,s=st("span",gi),l=Xt(qi,se(p,!1));function d(){i&&(m(!t.Autoplay.isPaused()),ee(a,Zn,!0),s.textContent="…",r(kn,se(m,!0)),r(Rn,se(m,!1)),r([ft,et],se(p,!0)))}function p(h){ee(a,Jn,h),h?(Lt(a,s),l.start()):(Ze(s),l.cancel())}function _(){Ve(a,[Kn,Zn,Jn]),Ze(s)}function m(h){i&&ee(a,Kn,h?"off":"polite")}return{mount:d,disable:m,destroy:_}}var Ki=Object.freeze({__proto__:null,Media:ri,Direction:ii,Elements:bi,Slides:xi,Layout:Ci,Clones:wi,Move:$i,Controller:Ti,Arrows:Li,Autoplay:ki,Cover:Ri,Scroll:ji,Drag:Wi,Keyboard:Mi,LazyLoad:Hi,Pagination:Pi,Sync:Gi,Wheel:Yi,Live:Xi}),Ji={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"},Zi={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:yi,i18n:Ji,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Qi(e,t,n){var o=t.Slides;function r(){ue(e).on([qe,he],a)}function a(){o.forEach(function(s){s.style("transform","translateX(-"+100*s.index+"%)")})}function i(s,l){o.style("transition","opacity "+n.speed+"ms "+n.easing),mo(l)}return{mount:r,start:i,cancel:dn}}function ea(e,t,n){var o=t.Move,r=t.Controller,a=t.Scroll,i=t.Elements.list,s=se(Ee,i,"transition"),l;function d(){ue(e).bind(i,"transitionend",function(h){h.target===i&&l&&(_(),l())})}function p(h,c){var u=o.toPosition(h,!0),b=o.getPosition(),$=m(h);Ce(u-b)>=1&&$>=1?n.useScroll?a.scroll(u,$,!1,c):(s("transform "+$+"ms "+n.easing),o.translate(u,!0),l=c):(o.jump(h),c())}function _(){s(""),a.cancel()}function m(h){var c=n.rewindSpeed;if(e.is(dt)&&c){var u=r.getIndex(!0),b=r.getEnd();if(u===0&&h>=b||u>=b&&h===0)return c}return n.speed}return{mount:d,start:p,cancel:_}}var ta=(function(){function e(n,o){this.event=ue(),this.Components={},this.state=ni(lt),this.splides=[],this._o={},this._E={};var r=Ue(n)?xo(document,n):n;yt(r,r+" is invalid."),this.root=r,o=Pe({label:Le(r,we)||"",labelledby:Le(r,Vn)||""},Zi,e.defaults,o||{});try{Pe(o,JSON.parse(Le(r,Tn)))}catch{yt(!1,"Invalid JSON")}this._o=Object.create(Pe({},o))}var t=e.prototype;return t.mount=function(o,r){var a=this,i=this.state,s=this.Components;yt(i.is([lt,Mt]),"Already mounted!"),i.set(lt),this._C=s,this._T=r||this._T||(this.is(Ft)?Qi:ea),this._E=o||this._E;var l=Ct({},Ki,this._E,{Transition:this._T});return Je(l,function(d,p){var _=d(a,s,a._o);s[p]=_,_.setup&&_.setup()}),Je(s,function(d){d.mount&&d.mount()}),this.emit(qe),Fe(this.root,fi),i.set(ut),this.emit(yn),this},t.sync=function(o){return this.splides.push({splide:o}),o.splides.push({splide:this,isParent:!0}),this.state.is(ut)&&(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(Ye(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(he),this},t.destroy=function(o){o===void 0&&(o=!0);var r=this.event,a=this.state;return a.is(lt)?ue(this).on(yn,this.destroy.bind(this,o)):(Je(this._C,function(i){i.destroy&&i.destroy(o)},!0),r.emit(Ln),r.destroy(),o&&ze(this.splides),a.set(Mt)),this},Jr(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})(),Wn=ta;Wn.defaults={};Wn.STATES=Qr;var no=[[qe,"onMounted"],[yn,"onReady"],[Me,"onMove"],[ft,"onMoved"],[En,"onClick"],[wo,"onActive"],[$o,"onInactive"],[To,"onVisible"],[Ao,"onHidden"],[he,"onRefresh"],[xe,"onUpdated"],[pt,"onResize"],[Yt,"onResized"],[Eo,"onDrag"],[Lo,"onDragging"],[Io,"onDragged"],[qt,"onScroll"],[et,"onScrolled"],[Ln,"onDestroy"],[ko,"onArrowsMounted"],[Ro,"onArrowsUpdated"],[Fo,"onPaginationMounted"],[Vo,"onPaginationUpdated"],[In,"onNavigationMounted"],[kn,"onAutoplayPlay"],[No,"onAutoplayPlaying"],[Rn,"onAutoplayPause"],[Fn,"onLazyLoadLoaded"]];function zn(...e){return e.filter(Boolean).join(" ")}function Ut(e){return e!==null&&typeof e=="object"}function bn(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,o)=>!bn(n,t[o]));if(Ut(e)&&Ut(t)){const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&!n.some(r=>!Object.prototype.hasOwnProperty.call(t,r)||!bn(e[r],t[r]))}return e===t}function na(e,t){return e.length===t.length&&!e.some((n,o)=>n!==t[o])}function oa(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 Sn(e,t){const n=e;return oa(t,(o,r)=>{Array.isArray(o)?n[r]=o.slice():Ut(o)?n[r]=Sn(Ut(n[r])?n[r]:{},o):n[r]=o}),n}var ra=({children:e,className:t,...n})=>D.createElement("div",{className:zn("splide__track",t),...n},D.createElement("ul",{className:"splide__list"},e)),Jo=class extends D.Component{constructor(){super(...arguments),this.splideRef=D.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:o}=this.splideRef;o&&(this.splide=new Wn(o,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Sn({},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&&!bn(this.options,e)&&(this.splide.options=e,this.options=Sn({},e));const t=this.getSlides();na(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){no.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 D.createElement(t,{className:zn("splide",e),ref:this.splideRef,...this.omit(r,["options",...no.map(a=>a[1])])},n?D.createElement(ra,null,o):o)}},Zo=({children:e,className:t,...n})=>D.createElement("li",{className:zn("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react/jsx-runtime"),H=require("react"),pe=require("classnames"),I=require("./useScopedStyles-Bibm8h9Z.js"),ar=require("react-dom");function lr(e){return e.type==="object"&&e.version===1}const sr="ControlSlider-module__wrapper___sHEkd",cr="ControlSlider-module__hoverArrow___A-dOH",ur="ControlSlider-module__sliderItem___QQSkR",pr="ControlSlider-module__sliderImage___9hRl-",dr="ControlSlider-module__arrow___05ghY",gr="ControlSlider-module__arrowVertical___tBfVN",fr="ControlSlider-module__nextArrow___-30Yc",mr="ControlSlider-module__arrowInner___aEra3",yr="ControlSlider-module__arrowIcon___S4ztF",hr="ControlSlider-module__arrowImg___2dwJW",vr="ControlSlider-module__mirror___brd6U",br="ControlSlider-module__pagination___bicLF",Sr="ControlSlider-module__paginationInner___bT-P-",xr="ControlSlider-module__paginationVertical___zYqKw",Cr="ControlSlider-module__paginationItem___nTRbk",_r="ControlSlider-module__dot___p1Qun",wr="ControlSlider-module__activeDot___LHFaj",$r="ControlSlider-module__paginationInsideBottom___R3FWn",Tr="ControlSlider-module__paginationInsideTop___V-qb-",Ar="ControlSlider-module__paginationOutsideBottom___14w8D",Er="ControlSlider-module__paginationOutsideTop___SCLqB",Lr="ControlSlider-module__paginationInsideLeft___yOBRZ",Ir="ControlSlider-module__paginationInsideRight___Rtt3o",kr="ControlSlider-module__paginationOutsideLeft___lahaw",Rr="ControlSlider-module__paginationOutsideRight___EtuQa",Fr="ControlSlider-module__imgWrapper___UjEgB",Vr="ControlSlider-module__captionBlock___dJ6-j",Nr="ControlSlider-module__captionTextWrapper___HFlpf",Or="ControlSlider-module__captionText___uGBVc",Br="ControlSlider-module__active___WZK4G",Wr="ControlSlider-module__withPointerEvents___t-18M",jr="ControlSlider-module__topLeftAlignment___zjnGM",zr="ControlSlider-module__topCenterAlignment___gD1xW",Mr="ControlSlider-module__topRightAlignment___NMapS",Dr="ControlSlider-module__middleLeftAlignment___OnUrY",Hr="ControlSlider-module__middleCenterAlignment___Tdkl0",Pr="ControlSlider-module__middleRightAlignment___wEbfX",Ur="ControlSlider-module__bottomLeftAlignment___cTP2-",Gr="ControlSlider-module__bottomCenterAlignment___c54fB",Yr="ControlSlider-module__bottomRightAlignment___kEwrz",qr="ControlSlider-module__clickOverlay___DZA28",Xr="ControlSlider-module__contain___pLyq7",Kr="ControlSlider-module__cover___KdDat",G={wrapper:sr,hoverArrow:cr,sliderItem:ur,sliderImage:pr,arrow:dr,arrowVertical:gr,nextArrow:fr,arrowInner:mr,arrowIcon:yr,arrowImg:hr,mirror:vr,pagination:br,paginationInner:Sr,paginationVertical:xr,paginationItem:Cr,dot:_r,activeDot:wr,paginationInsideBottom:$r,paginationInsideTop:Tr,paginationOutsideBottom:Ar,paginationOutsideTop:Er,paginationInsideLeft:Lr,paginationInsideRight:Ir,paginationOutsideLeft:kr,paginationOutsideRight:Rr,imgWrapper:Fr,captionBlock:Vr,captionTextWrapper:Nr,captionText:Or,active:Br,withPointerEvents:Wr,topLeftAlignment:jr,topCenterAlignment:zr,topRightAlignment:Mr,middleLeftAlignment:Dr,middleCenterAlignment:Hr,middleRightAlignment:Pr,bottomLeftAlignment:Ur,bottomCenterAlignment:Gr,bottomRightAlignment:Yr,clickOverlay:qr,contain:Xr,cover:Kr};function Jr(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 Zr(e,t,n){return t&&Jr(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Pn="(prefers-reduced-motion: reduce)",lt=1,Qr=2,ut=3,gt=4,Tt=5,Bt=6,Mt=7,ei={CREATED:lt,MOUNTED:Qr,IDLE:ut,MOVING:gt,SCROLLING:Tt,DRAGGING:Bt,DESTROYED:Mt};function ze(e){e.length=0}function Ye(e,t,n){return Array.prototype.slice.call(e,t,n)}function se(e){return e.bind.apply(e,[null].concat(Ye(arguments,1)))}var yo=setTimeout,gn=function(){};function Un(e){return requestAnimationFrame(e)}function Gt(e,t){return typeof t===e}function bt(e){return!_n(e)&&Gt("object",e)}var Cn=Array.isArray,ho=se(Gt,"function"),Ue=se(Gt,"string"),At=se(Gt,"undefined");function _n(e){return e===null}function vo(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Et(e){return Cn(e)?e:[e]}function Te(e,t){Et(e).forEach(t)}function wn(e,t){return e.indexOf(t)>-1}function Wt(e,t){return e.push.apply(e,Et(t)),e}function Be(e,t,n){e&&Te(t,function(o){o&&e.classList[n?"add":"remove"](o)})}function Re(e,t){Be(e,Ue(t)?t.split(" "):t,!0)}function Lt(e,t){Te(t,e.appendChild.bind(e))}function $n(e,t){Te(e,function(n){var o=(t||n).parentNode;o&&o.insertBefore(n,t)})}function St(e,t){return vo(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function bo(e,t){var n=e?Ye(e.children):[];return t?n.filter(function(o){return St(o,t)}):n}function It(e,t){return t?bo(e,t)[0]:e.firstElementChild}var xt=Object.keys;function Je(e,t,n){return e&&(n?xt(e).reverse():xt(e)).forEach(function(o){o!=="__proto__"&&t(e[o],o)}),e}function Ct(e){return Ye(arguments,1).forEach(function(t){Je(t,function(n,o){e[o]=t[o]})}),e}function Pe(e){return Ye(arguments,1).forEach(function(t){Je(t,function(n,o){Cn(n)?e[o]=n.slice():bt(n)?e[o]=Pe({},bt(e[o])?e[o]:{},n):e[o]=n})}),e}function Gn(e,t){Te(t||xt(e),function(n){delete e[n]})}function Fe(e,t){Te(e,function(n){Te(t,function(o){n&&n.removeAttribute(o)})})}function ee(e,t,n){bt(t)?Je(t,function(o,r){ee(e,r,o)}):Te(e,function(o){_n(n)||n===""?Fe(o,t):o.setAttribute(t,String(n))})}function st(e,t,n){var o=document.createElement(e);return t&&(Ue(t)?Re(o,t):ee(o,t)),n&&Lt(n,o),o}function Ee(e,t,n){if(At(n))return getComputedStyle(e)[t];_n(n)||(e.style[t]=""+n)}function _t(e,t){Ee(e,"display",t)}function So(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Le(e,t){return e.getAttribute(t)}function Yn(e,t){return e&&e.classList.contains(t)}function we(e){return e.getBoundingClientRect()}function Ze(e){Te(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function xo(e){return It(new DOMParser().parseFromString(e,"text/html").body)}function Oe(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Co(e,t){return e&&e.querySelector(t)}function Tn(e,t){return t?Ye(e.querySelectorAll(t)):[]}function We(e,t){Be(e,t,!1)}function fn(e){return e.timeStamp}function Ke(e){return Ue(e)?e:e?e+"px":""}var kt="splide",An="data-"+kt;function yt(e,t){if(!e)throw new Error("["+kt+"] "+(t||""))}var Ge=Math.min,Dt=Math.max,Ht=Math.floor,wt=Math.ceil,Ce=Math.abs;function _o(e,t,n){return Ce(e-t)<n}function jt(e,t,n,o){var r=Ge(t,n),a=Dt(t,n);return o?r<e&&e<a:r<=e&&e<=a}function it(e,t,n){var o=Ge(t,n),r=Dt(t,n);return Ge(Dt(o,e),r)}function mn(e){return+(e>0)-+(e<0)}function yn(e,t){return Te(t,function(n){e=e.replace("%s",""+n)}),e}function En(e){return e<10?"0"+e:""+e}var qn={};function ti(e){return""+e+En(qn[e]=(qn[e]||0)+1)}function wo(){var e=[];function t(i,c,l,p){r(i,c,function(u,C,y){var g="addEventListener"in u,s=g?u.removeEventListener.bind(u,C,l,p):u.removeListener.bind(u,l);g?u.addEventListener(C,l,p):u.addListener(l),e.push([u,C,y,l,s])})}function n(i,c,l){r(i,c,function(p,u,C){e=e.filter(function(y){return y[0]===p&&y[1]===u&&y[2]===C&&(!l||y[3]===l)?(y[4](),!1):!0})})}function o(i,c,l){var p,u=!0;return typeof CustomEvent=="function"?p=new CustomEvent(c,{bubbles:u,detail:l}):(p=document.createEvent("CustomEvent"),p.initCustomEvent(c,u,!1,l)),i.dispatchEvent(p),p}function r(i,c,l){Te(i,function(p){p&&Te(c,function(u){u.split(" ").forEach(function(C){var y=C.split(".");l(p,y[0],y[1])})})})}function a(){e.forEach(function(i){i[4]()}),ze(e)}return{bind:t,unbind:n,dispatch:o,destroy:a}}var qe="mounted",hn="ready",Me="move",ft="moved",Ln="click",$o="active",To="inactive",Ao="visible",Eo="hidden",he="refresh",Se="updated",pt="resize",Yt="resized",Lo="drag",Io="dragging",ko="dragged",qt="scroll",et="scrolled",ni="overflow",In="destroy",Ro="arrows:mounted",Fo="arrows:updated",Vo="pagination:mounted",No="pagination:updated",kn="navigation:mounted",Rn="autoplay:play",Oo="autoplay:playing",Fn="autoplay:pause",Vn="lazyload:loaded",Bo="sk",Wo="sh",Pt="ei";function de(e){var t=e?e.event.bus:document.createDocumentFragment(),n=wo();function o(a,i){n.bind(t,Et(a).join(" "),function(c){i.apply(i,Cn(c.detail)?c.detail:[])})}function r(a){n.dispatch(t,a,Ye(arguments,1))}return e&&e.event.on(In,n.destroy),Ct(n,{bus:t,on:o,off:se(n.unbind,t),emit:r})}function Xt(e,t,n,o){var r=Date.now,a,i=0,c,l=!0,p=0;function u(){if(!l){if(i=e?Ge((r()-a)/e,1):1,n&&n(i),i>=1&&(t(),a=r(),o&&++p>=o))return y();c=Un(u)}}function C(v){v||s(),a=r()-(v?i*e:0),l=!1,c=Un(u)}function y(){l=!0}function g(){a=r(),i=0,n&&n(i)}function s(){c&&cancelAnimationFrame(c),i=0,c=0,l=!0}function d(v){e=v}function T(){return l}return{start:C,rewind:g,pause:y,cancel:s,set:d,isPaused:T}}function oi(e){var t=e;function n(r){t=r}function o(r){return wn(Et(r),t)}return{set:n,is:o}}function ri(e,t){var n=Xt(0,e,null,1);return function(){n.isPaused()&&n.start()}}function ii(e,t,n){var o=e.state,r=n.breakpoints||{},a=n.reducedMotion||{},i=wo(),c=[];function l(){var s=n.mediaQuery==="min";xt(r).sort(function(d,T){return s?+d-+T:+T-+d}).forEach(function(d){u(r[d],"("+(s?"min":"max")+"-width:"+d+"px)")}),u(a,Pn),C()}function p(s){s&&i.destroy()}function u(s,d){var T=matchMedia(d);i.bind(T,"change",C),c.push([s,T])}function C(){var s=o.is(Mt),d=n.direction,T=c.reduce(function(v,m){return Pe(v,m[1].matches?m[0]:{})},{});Gn(n),g(T),n.destroy?e.destroy(n.destroy==="completely"):s?(p(!0),e.mount()):d!==n.direction&&e.refresh()}function y(s){matchMedia(Pn).matches&&(s?Pe(n,a):Gn(n,xt(a)))}function g(s,d,T){Pe(n,s),d&&Pe(Object.getPrototypeOf(n),s),(T||!o.is(lt))&&e.emit(Se,n)}return{setup:l,destroy:p,reduce:y,set:g}}var Kt="Arrow",Jt=Kt+"Left",Zt=Kt+"Right",jo=Kt+"Up",zo=Kt+"Down",Xn="rtl",Qt="ttb",an={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[jo,Zt],ArrowRight:[zo,Jt]};function ai(e,t,n){function o(a,i,c){c=c||n.direction;var l=c===Xn&&!i?1:c===Qt?0:-1;return an[a]&&an[a][l]||a.replace(/width|left|right/i,function(p,u){var C=an[p.toLowerCase()][l]||p;return u>0?C.charAt(0).toUpperCase()+C.slice(1):C})}function r(a){return a*(n.direction===Xn?1:-1)}return{resolve:o,orient:r}}var je="role",ct="tabindex",li="disabled",Ie="aria-",Rt=Ie+"controls",Mo=Ie+"current",Kn=Ie+"selected",$e=Ie+"label",Nn=Ie+"labelledby",Do=Ie+"hidden",On=Ie+"orientation",$t=Ie+"roledescription",Jn=Ie+"live",Zn=Ie+"busy",Qn=Ie+"atomic",Bn=[je,ct,li,Rt,Mo,$e,Nn,Do,On,$t],Ve=kt+"__",Xe="is-",ln=kt,eo=Ve+"track",si=Ve+"list",en=Ve+"slide",Ho=en+"--clone",ci=en+"__container",Wn=Ve+"arrows",tn=Ve+"arrow",Po=tn+"--prev",Uo=tn+"--next",nn=Ve+"pagination",Go=nn+"__page",ui=Ve+"progress",pi=ui+"__bar",di=Ve+"toggle",gi=Ve+"spinner",fi=Ve+"sr",mi=Xe+"initialized",Qe=Xe+"active",Yo=Xe+"prev",qo=Xe+"next",vn=Xe+"visible",bn=Xe+"loading",Xo=Xe+"focus-in",Ko=Xe+"overflow",yi=[Qe,vn,Yo,qo,bn,Xo,Ko],hi={slide:en,clone:Ho,arrows:Wn,arrow:tn,prev:Po,next:Uo,pagination:nn,page:Go,spinner:gi};function vi(e,t){if(ho(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!St(n,t);)n=n.parentElement;return n}var bi=5,to=200,Jo="touchstart mousedown",sn="touchmove mousemove",cn="touchend touchcancel mouseup click";function Si(e,t,n){var o=de(e),r=o.on,a=o.bind,i=e.root,c=n.i18n,l={},p=[],u=[],C=[],y,g,s;function d(){_(),z(),m()}function T(){r(he,v),r(he,d),r(Se,m),a(document,Jo+" keydown",function(h){s=h.type==="keydown"},{capture:!0}),a(i,"focusin",function(){Be(i,Xo,!!s)})}function v(h){var A=Bn.concat("style");ze(p),We(i,u),We(y,C),Fe([y,g],A),Fe(i,h?A:["style",$t])}function m(){We(i,u),We(y,C),u=E(ln),C=E(eo),Re(i,u),Re(y,C),ee(i,$e,n.label),ee(i,Nn,n.labelledby)}function _(){y=B("."+eo),g=It(y,"."+si),yt(y&&g,"A track/list element is missing."),Wt(p,bo(g,"."+en+":not(."+Ho+")")),Je({arrows:Wn,pagination:nn,prev:Po,next:Uo,bar:pi,toggle:di},function(h,A){l[A]=B("."+h)}),Ct(l,{root:i,track:y,list:g,slides:p})}function z(){var h=i.id||ti(kt),A=n.role;i.id=h,y.id=y.id||h+"-track",g.id=g.id||h+"-list",!Le(i,je)&&i.tagName!=="SECTION"&&A&&ee(i,je,A),ee(i,$t,c.carousel),ee(g,je,"presentation")}function B(h){var A=Co(i,h);return A&&vi(A,"."+ln)===i?A:void 0}function E(h){return[h+"--"+n.type,h+"--"+n.direction,n.drag&&h+"--draggable",n.isNavigation&&h+"--nav",h===ln&&Qe]}return Ct(l,{setup:d,mount:T,destroy:v})}var dt="slide",mt="loop",Ft="fade";function xi(e,t,n,o){var r=de(e),a=r.on,i=r.emit,c=r.bind,l=e.Components,p=e.root,u=e.options,C=u.isNavigation,y=u.updateOnMove,g=u.i18n,s=u.pagination,d=u.slideFocus,T=l.Direction.resolve,v=Le(o,"style"),m=Le(o,$e),_=n>-1,z=It(o,"."+ci),B;function E(){_||(o.id=p.id+"-slide"+En(t+1),ee(o,je,s?"tabpanel":"group"),ee(o,$t,g.slide),ee(o,$e,m||yn(g.slideLabel,[t+1,e.length]))),h()}function h(){c(o,"click",se(i,Ln,$)),c(o,"keydown",se(i,Bo,$)),a([ft,Wo,et],k),a(kn,F),y&&a(Me,j)}function A(){B=!0,r.destroy(),We(o,yi),Fe(o,Bn),ee(o,"style",v),ee(o,$e,m||"")}function F(){var w=e.splides.map(function(x){var O=x.splide.Components.Slides.getAt(t);return O?O.slide.id:""}).join(" ");ee(o,$e,yn(g.slideX,(_?n:t)+1)),ee(o,Rt,w),ee(o,je,d?"button":""),d&&Fe(o,$t)}function j(){B||k()}function k(){if(!B){var w=e.index;V(),N(),Be(o,Yo,t===w-1),Be(o,qo,t===w+1)}}function V(){var w=P();w!==Yn(o,Qe)&&(Be(o,Qe,w),ee(o,Mo,C&&w||""),i(w?$o:To,$))}function N(){var w=f(),x=!w&&(!P()||_);if(e.state.is([gt,Tt])||ee(o,Do,x||""),ee(Tn(o,u.focusableNodes||""),ct,x?-1:""),d&&ee(o,ct,x?-1:0),w!==Yn(o,vn)&&(Be(o,vn,w),i(w?Ao:Eo,$)),!w&&document.activeElement===o){var O=l.Slides.getAt(e.index);O&&So(O.slide)}}function U(w,x,O){Ee(O&&z||o,w,x)}function P(){var w=e.index;return w===t||u.cloneStatus&&w===n}function f(){if(e.is(Ft))return P();var w=we(l.Elements.track),x=we(o),O=T("left",!0),q=T("right",!0);return Ht(w[O])<=wt(x[O])&&Ht(x[q])<=wt(w[q])}function R(w,x){var O=Ce(w-t);return!_&&(u.rewind||e.is(mt))&&(O=Ge(O,e.length-O)),O<=x}var $={index:t,slideIndex:n,slide:o,container:z,isClone:_,mount:E,destroy:A,update:k,style:U,isWithin:R};return $}function Ci(e,t,n){var o=de(e),r=o.on,a=o.emit,i=o.bind,c=t.Elements,l=c.slides,p=c.list,u=[];function C(){y(),r(he,g),r(he,y)}function y(){l.forEach(function(k,V){d(k,V,-1)})}function g(){B(function(k){k.destroy()}),ze(u)}function s(){B(function(k){k.update()})}function d(k,V,N){var U=xi(e,V,N,k);U.mount(),u.push(U),u.sort(function(P,f){return P.index-f.index})}function T(k){return k?E(function(V){return!V.isClone}):u}function v(k){var V=t.Controller,N=V.toIndex(k),U=V.hasFocus()?1:n.perPage;return E(function(P){return jt(P.index,N,N+U-1)})}function m(k){return E(k)[0]}function _(k,V){Te(k,function(N){if(Ue(N)&&(N=xo(N)),vo(N)){var U=l[V];U?$n(N,U):Lt(p,N),Re(N,n.classes.slide),A(N,se(a,pt))}}),a(he)}function z(k){Ze(E(k).map(function(V){return V.slide})),a(he)}function B(k,V){T(V).forEach(k)}function E(k){return u.filter(ho(k)?k:function(V){return Ue(k)?St(V.slide,k):wn(Et(k),V.index)})}function h(k,V,N){B(function(U){U.style(k,V,N)})}function A(k,V){var N=Tn(k,"img"),U=N.length;U?N.forEach(function(P){i(P,"load error",function(){--U||V()})}):V()}function F(k){return k?l.length:u.length}function j(){return u.length>n.perPage}return{mount:C,destroy:g,update:s,register:d,get:T,getIn:v,getAt:m,add:_,remove:z,forEach:B,filter:E,style:h,getLength:F,isEnough:j}}function _i(e,t,n){var o=de(e),r=o.on,a=o.bind,i=o.emit,c=t.Slides,l=t.Direction.resolve,p=t.Elements,u=p.root,C=p.track,y=p.list,g=c.getAt,s=c.style,d,T,v;function m(){_(),a(window,"resize load",ri(se(i,pt))),r([Se,he],_),r(pt,z)}function _(){d=n.direction===Qt,Ee(u,"maxWidth",Ke(n.width)),Ee(C,l("paddingLeft"),B(!1)),Ee(C,l("paddingRight"),B(!0)),z(!0)}function z($){var w=we(u);($||T.width!==w.width||T.height!==w.height)&&(Ee(C,"height",E()),s(l("marginRight"),Ke(n.gap)),s("width",A()),s("height",F(),!0),T=w,i(Yt),v!==(v=R())&&(Be(u,Ko,v),i(ni,v)))}function B($){var w=n.padding,x=l($?"right":"left");return w&&Ke(w[x]||(bt(w)?0:w))||"0px"}function E(){var $="";return d&&($=h(),yt($,"height or heightRatio is missing."),$="calc("+$+" - "+B(!1)+" - "+B(!0)+")"),$}function h(){return Ke(n.height||we(y).width*n.heightRatio)}function A(){return n.autoWidth?null:Ke(n.fixedWidth)||(d?"":j())}function F(){return Ke(n.fixedHeight)||(d?n.autoHeight?null:j():h())}function j(){var $=Ke(n.gap);return"calc((100%"+($&&" + "+$)+")/"+(n.perPage||1)+($&&" - "+$)+")"}function k(){return we(y)[l("width")]}function V($,w){var x=g($||0);return x?we(x.slide)[l("width")]+(w?0:P()):0}function N($,w){var x=g($);if(x){var O=we(x.slide)[l("right")],q=we(y)[l("left")];return Ce(O-q)+(w?0:P())}return 0}function U($){return N(e.length-1)-N(0)+V(0,$)}function P(){var $=g(0);return $&&parseFloat(Ee($.slide,l("marginRight")))||0}function f($){return parseFloat(Ee(C,l("padding"+($?"Right":"Left"))))||0}function R(){return e.is(Ft)||U(!0)>k()}return{mount:m,resize:z,listSize:k,slideSize:V,sliderSize:U,totalSize:N,getPadding:f,isOverflow:R}}var wi=2;function $i(e,t,n){var o=de(e),r=o.on,a=t.Elements,i=t.Slides,c=t.Direction.resolve,l=[],p;function u(){r(he,C),r([Se,pt],g),(p=T())&&(s(p),t.Layout.resize(!0))}function C(){y(),u()}function y(){Ze(l),ze(l),o.destroy()}function g(){var v=T();p!==v&&(p<v||!v)&&o.emit(he)}function s(v){var m=i.get().slice(),_=m.length;if(_){for(;m.length<v;)Wt(m,m);Wt(m.slice(-v),m.slice(0,v)).forEach(function(z,B){var E=B<v,h=d(z.slide,B);E?$n(h,m[0].slide):Lt(a.list,h),Wt(l,h),i.register(h,B-v+(E?0:_),z.index)})}}function d(v,m){var _=v.cloneNode(!0);return Re(_,n.classes.clone),_.id=e.root.id+"-clone"+En(m+1),_}function T(){var v=n.clones;if(!e.is(mt))v=0;else if(At(v)){var m=n[c("fixedWidth")]&&t.Layout.slideSize(0),_=m&&wt(we(a.track)[c("width")]/m);v=_||n[c("autoWidth")]&&e.length||n.perPage*wi}return v}return{mount:u,destroy:y}}function Ti(e,t,n){var o=de(e),r=o.on,a=o.emit,i=e.state.set,c=t.Layout,l=c.slideSize,p=c.getPadding,u=c.totalSize,C=c.listSize,y=c.sliderSize,g=t.Direction,s=g.resolve,d=g.orient,T=t.Elements,v=T.list,m=T.track,_;function z(){_=t.Transition,r([qe,Yt,Se,he],B)}function B(){t.Controller.isBusy()||(t.Scroll.cancel(),h(e.index),t.Slides.update())}function E(x,O,q,ie){x!==O&&$(x>q)&&(k(),A(j(U(),x>q),!0)),i(gt),a(Me,O,q,x),_.start(O,function(){i(ut),a(ft,O,q,x),ie&&ie()})}function h(x){A(N(x,!0))}function A(x,O){if(!e.is(Ft)){var q=O?x:F(x);Ee(v,"transform","translate"+s("X")+"("+q+"px)"),x!==q&&a(Wo)}}function F(x){if(e.is(mt)){var O=V(x),q=O>t.Controller.getEnd(),ie=O<0;(ie||q)&&(x=j(x,q))}return x}function j(x,O){var q=x-R(O),ie=y();return x-=d(ie*(wt(Ce(q)/ie)||1))*(O?1:-1),x}function k(){A(U(),!0),_.cancel()}function V(x){for(var O=t.Slides.get(),q=0,ie=1/0,ne=0;ne<O.length;ne++){var le=O[ne].index,L=Ce(N(le,!0)-x);if(L<=ie)ie=L,q=le;else break}return q}function N(x,O){var q=d(u(x-1)-f(x));return O?P(q):q}function U(){var x=s("left");return we(v)[x]-we(m)[x]+d(p(!1))}function P(x){return n.trimSpace&&e.is(dt)&&(x=it(x,0,d(y(!0)-C()))),x}function f(x){var O=n.focus;return O==="center"?(C()-l(x,!0))/2:+O*l(x)||0}function R(x){return N(x?t.Controller.getEnd():0,!!n.trimSpace)}function $(x){var O=d(j(U(),x));return x?O>=0:O<=v[s("scrollWidth")]-we(m)[s("width")]}function w(x,O){O=At(O)?U():O;var q=x!==!0&&d(O)<d(R(!1)),ie=x!==!1&&d(O)>d(R(!0));return q||ie}return{mount:z,move:E,jump:h,translate:A,shift:j,cancel:k,toIndex:V,toPosition:N,getPosition:U,getLimit:R,exceededLimit:w,reposition:B}}function Ai(e,t,n){var o=de(e),r=o.on,a=o.emit,i=t.Move,c=i.getPosition,l=i.getLimit,p=i.toPosition,u=t.Slides,C=u.isEnough,y=u.getLength,g=n.omitEnd,s=e.is(mt),d=e.is(dt),T=se(U,!1),v=se(U,!0),m=n.start||0,_,z=m,B,E,h;function A(){F(),r([Se,he,Pt],F),r(Yt,j)}function F(){B=y(!0),E=n.perMove,h=n.perPage,_=$();var L=it(m,0,g?_:B-1);L!==m&&(m=L,i.reposition())}function j(){_!==$()&&a(Pt)}function k(L,Z,ye){if(!le()){var ae=N(L),ge=R(ae);ge>-1&&(Z||ge!==m)&&(q(ge),i.move(ae,ge,z,ye))}}function V(L,Z,ye,ae){t.Scroll.scroll(L,Z,ye,function(){var ge=R(i.toIndex(c()));q(g?Ge(ge,_):ge),ae&&ae()})}function N(L){var Z=m;if(Ue(L)){var ye=L.match(/([+\-<>])(\d+)?/)||[],ae=ye[1],ge=ye[2];ae==="+"||ae==="-"?Z=P(m+ +(""+ae+(+ge||1)),m):ae===">"?Z=ge?w(+ge):T(!0):ae==="<"&&(Z=v(!0))}else Z=s?L:it(L,0,_);return Z}function U(L,Z){var ye=E||(ne()?1:h),ae=P(m+ye*(L?-1:1),m,!(E||ne()));return ae===-1&&d&&!_o(c(),l(!L),1)?L?0:_:Z?ae:R(ae)}function P(L,Z,ye){if(C()||ne()){var ae=f(L);ae!==L&&(Z=L,L=ae,ye=!1),L<0||L>_?!E&&(jt(0,L,Z,!0)||jt(_,Z,L,!0))?L=w(x(L)):s?L=ye?L<0?-(B%h||h):B:L:n.rewind?L=L<0?_:0:L=-1:ye&&L!==Z&&(L=w(x(Z)+(L<Z?-1:1)))}else L=-1;return L}function f(L){if(d&&n.trimSpace==="move"&&L!==m)for(var Z=c();Z===p(L,!0)&&jt(L,0,e.length-1,!n.rewind);)L<m?--L:++L;return L}function R(L){return s?(L+B)%B||0:L}function $(){for(var L=B-(ne()||s&&E?1:h);g&&L-- >0;)if(p(B-1,!0)!==p(L,!0)){L++;break}return it(L,0,B-1)}function w(L){return it(ne()?L:h*L,0,_)}function x(L){return ne()?Ge(L,_):Ht((L>=_?B-1:L)/h)}function O(L){var Z=i.toIndex(L);return d?it(Z,0,_):Z}function q(L){L!==m&&(z=m,m=L)}function ie(L){return L?z:m}function ne(){return!At(n.focus)||n.isNavigation}function le(){return e.state.is([gt,Tt])&&!!n.waitForTransition}return{mount:A,go:k,scroll:V,getNext:T,getPrev:v,getAdjacent:U,getEnd:$,setIndex:q,getIndex:ie,toIndex:w,toPage:x,toDest:O,hasFocus:ne,isBusy:le}}var Ei="http://www.w3.org/2000/svg",Li="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",Vt=40;function Ii(e,t,n){var o=de(e),r=o.on,a=o.bind,i=o.emit,c=n.classes,l=n.i18n,p=t.Elements,u=t.Controller,C=p.arrows,y=p.track,g=C,s=p.prev,d=p.next,T,v,m={};function _(){B(),r(Se,z)}function z(){E(),_()}function B(){var V=n.arrows;V&&!(s&&d)&&F(),s&&d&&(Ct(m,{prev:s,next:d}),_t(g,V?"":"none"),Re(g,v=Wn+"--"+n.direction),V&&(h(),k(),ee([s,d],Rt,y.id),i(Ro,s,d)))}function E(){o.destroy(),We(g,v),T?(Ze(C?[s,d]:g),s=d=null):Fe([s,d],Bn)}function h(){r([qe,ft,he,et,Pt],k),a(d,"click",se(A,">")),a(s,"click",se(A,"<"))}function A(V){u.go(V,!0)}function F(){g=C||st("div",c.arrows),s=j(!0),d=j(!1),T=!0,Lt(g,[s,d]),!C&&$n(g,y)}function j(V){var N='<button class="'+c.arrow+" "+(V?c.prev:c.next)+'" type="button"><svg xmlns="'+Ei+'" viewBox="0 0 '+Vt+" "+Vt+'" width="'+Vt+'" height="'+Vt+'" focusable="false"><path d="'+(n.arrowPath||Li)+'" />';return xo(N)}function k(){if(s&&d){var V=e.index,N=u.getPrev(),U=u.getNext(),P=N>-1&&V<N?l.last:l.prev,f=U>-1&&V>U?l.first:l.next;s.disabled=N<0,d.disabled=U<0,ee(s,$e,P),ee(d,$e,f),i(Fo,s,d,N,U)}}return{arrows:m,mount:_,destroy:E,update:k}}var ki=An+"-interval";function Ri(e,t,n){var o=de(e),r=o.on,a=o.bind,i=o.emit,c=Xt(n.interval,e.go.bind(e,">"),h),l=c.isPaused,p=t.Elements,u=t.Elements,C=u.root,y=u.toggle,g=n.autoplay,s,d,T=g==="pause";function v(){g&&(m(),y&&ee(y,Rt,p.track.id),T||_(),E())}function m(){n.pauseOnHover&&a(C,"mouseenter mouseleave",function(F){s=F.type==="mouseenter",B()}),n.pauseOnFocus&&a(C,"focusin focusout",function(F){d=F.type==="focusin",B()}),y&&a(y,"click",function(){T?_():z(!0)}),r([Me,qt,he],c.rewind),r(Me,A)}function _(){l()&&t.Slides.isEnough()&&(c.start(!n.resetProgress),d=s=T=!1,E(),i(Rn))}function z(F){F===void 0&&(F=!0),T=!!F,E(),l()||(c.pause(),i(Fn))}function B(){T||(s||d?z(!1):_())}function E(){y&&(Be(y,Qe,!T),ee(y,$e,n.i18n[T?"play":"pause"]))}function h(F){var j=p.bar;j&&Ee(j,"width",F*100+"%"),i(Oo,F)}function A(F){var j=t.Slides.getAt(F);c.set(j&&+Le(j.slide,ki)||n.interval)}return{mount:v,destroy:c.cancel,play:_,pause:z,isPaused:l}}function Fi(e,t,n){var o=de(e),r=o.on;function a(){n.cover&&(r(Vn,se(c,!0)),r([qe,Se,he],se(i,!0)))}function i(l){t.Slides.forEach(function(p){var u=It(p.container||p.slide,"img");u&&u.src&&c(l,u,p)})}function c(l,p,u){u.style("background",l?'center/cover no-repeat url("'+p.src+'")':"",!0),_t(p,l?"none":"")}return{mount:a,destroy:se(i,!1)}}var Vi=10,Ni=600,Oi=.6,Bi=1.5,Wi=800;function ji(e,t,n){var o=de(e),r=o.on,a=o.emit,i=e.state.set,c=t.Move,l=c.getPosition,p=c.getLimit,u=c.exceededLimit,C=c.translate,y=e.is(dt),g,s,d=1;function T(){r(Me,z),r([Se,he],B)}function v(h,A,F,j,k){var V=l();if(z(),F&&(!y||!u())){var N=t.Layout.sliderSize(),U=mn(h)*N*Ht(Ce(h)/N)||0;h=c.toPosition(t.Controller.toDest(h%N))+U}var P=_o(V,h,1);d=1,A=P?0:A||Dt(Ce(h-V)/Bi,Wi),s=j,g=Xt(A,m,se(_,V,h,k),1),i(Tt),a(qt),g.start()}function m(){i(ut),s&&s(),a(et)}function _(h,A,F,j){var k=l(),V=h+(A-h)*E(j),N=(V-k)*d;C(k+N),y&&!F&&u()&&(d*=Oi,Ce(N)<Vi&&v(p(u(!0)),Ni,!1,s,!0))}function z(){g&&g.cancel()}function B(){g&&!g.isPaused()&&(z(),m())}function E(h){var A=n.easingFunc;return A?A(h):1-Math.pow(1-h,4)}return{mount:T,destroy:z,scroll:v,cancel:B}}var at={passive:!1,capture:!0};function zi(e,t,n){var o=de(e),r=o.on,a=o.emit,i=o.bind,c=o.unbind,l=e.state,p=t.Move,u=t.Scroll,C=t.Controller,y=t.Elements.track,g=t.Media.reduce,s=t.Direction,d=s.resolve,T=s.orient,v=p.getPosition,m=p.exceededLimit,_,z,B,E,h,A=!1,F,j,k;function V(){i(y,sn,gn,at),i(y,cn,gn,at),i(y,Jo,U,at),i(y,"click",R,{capture:!0}),i(y,"dragstart",Oe),r([qe,Se],N)}function N(){var M=n.drag;Ne(!M),E=M==="free"}function U(M){if(F=!1,!j){var b=ge(M);ae(M.target)&&(b||!M.button)&&(C.isBusy()?Oe(M,!0):(k=b?y:window,h=l.is([gt,Tt]),B=null,i(k,sn,P,at),i(k,cn,f,at),p.cancel(),u.cancel(),$(M)))}}function P(M){if(l.is(Bt)||(l.set(Bt),a(Lo)),M.cancelable)if(h){p.translate(_+ye(ne(M)));var b=le(M)>to,D=A!==(A=m());(b||D)&&$(M),F=!0,a(Io),Oe(M)}else O(M)&&(h=x(M),Oe(M))}function f(M){l.is(Bt)&&(l.set(ut),a(ko)),h&&(w(M),Oe(M)),c(k,sn,P),c(k,cn,f),h=!1}function R(M){!j&&F&&Oe(M,!0)}function $(M){B=z,z=M,_=v()}function w(M){var b=q(M),D=ie(b),X=n.rewind&&n.rewindByDrag;g(!1),E?C.scroll(D,0,n.snap):e.is(Ft)?C.go(T(mn(b))<0?X?"<":"-":X?">":"+"):e.is(dt)&&A&&X?C.go(m(!0)?">":"<"):C.go(C.toDest(D),!0),g(!0)}function x(M){var b=n.dragMinThreshold,D=bt(b),X=D&&b.mouse||0,Y=(D?b.touch:+b)||10;return Ce(ne(M))>(ge(M)?Y:X)}function O(M){return Ce(ne(M))>Ce(ne(M,!0))}function q(M){if(e.is(mt)||!A){var b=le(M);if(b&&b<to)return ne(M)/b}return 0}function ie(M){return v()+mn(M)*Ge(Ce(M)*(n.flickPower||600),E?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function ne(M,b){return Z(M,b)-Z(L(M),b)}function le(M){return fn(M)-fn(L(M))}function L(M){return z===M&&B||z}function Z(M,b){return(ge(M)?M.changedTouches[0]:M)["page"+d(b?"Y":"X")]}function ye(M){return M/(A&&e.is(dt)?bi:1)}function ae(M){var b=n.noDrag;return!St(M,"."+Go+", ."+tn)&&(!b||!St(M,b))}function ge(M){return typeof TouchEvent<"u"&&M instanceof TouchEvent}function me(){return h}function Ne(M){j=M}return{mount:V,disable:Ne,isDragging:me}}var Mi={Spacebar:" ",Right:Zt,Left:Jt,Up:jo,Down:zo};function jn(e){return e=Ue(e)?e:e.key,Mi[e]||e}var no="keydown";function Di(e,t,n){var o=de(e),r=o.on,a=o.bind,i=o.unbind,c=e.root,l=t.Direction.resolve,p,u;function C(){y(),r(Se,g),r(Se,y),r(Me,d)}function y(){var v=n.keyboard;v&&(p=v==="global"?window:c,a(p,no,T))}function g(){i(p,no)}function s(v){u=v}function d(){var v=u;u=!0,yo(function(){u=v})}function T(v){if(!u){var m=jn(v);m===l(Jt)?e.go("<"):m===l(Zt)&&e.go(">")}}return{mount:C,destroy:g,disable:s}}var ht=An+"-lazy",zt=ht+"-srcset",Hi="["+ht+"], ["+zt+"]";function Pi(e,t,n){var o=de(e),r=o.on,a=o.off,i=o.bind,c=o.emit,l=n.lazyLoad==="sequential",p=[ft,et],u=[];function C(){n.lazyLoad&&(y(),r(he,y))}function y(){ze(u),g(),l?v():(a(p),r(p,s),s())}function g(){t.Slides.forEach(function(m){Tn(m.slide,Hi).forEach(function(_){var z=Le(_,ht),B=Le(_,zt);if(z!==_.src||B!==_.srcset){var E=n.classes.spinner,h=_.parentElement,A=It(h,"."+E)||st("span",E,h);u.push([_,m,A]),_.src||_t(_,"none")}})})}function s(){u=u.filter(function(m){var _=n.perPage*((n.preloadPages||1)+1)-1;return m[1].isWithin(e.index,_)?d(m):!0}),u.length||a(p)}function d(m){var _=m[0];Re(m[1].slide,bn),i(_,"load error",se(T,m)),ee(_,"src",Le(_,ht)),ee(_,"srcset",Le(_,zt)),Fe(_,ht),Fe(_,zt)}function T(m,_){var z=m[0],B=m[1];We(B.slide,bn),_.type!=="error"&&(Ze(m[2]),_t(z,""),c(Vn,z,B),c(pt)),l&&v()}function v(){u.length&&d(u.shift())}return{mount:C,destroy:se(ze,u),check:s}}function Ui(e,t,n){var o=de(e),r=o.on,a=o.emit,i=o.bind,c=t.Slides,l=t.Elements,p=t.Controller,u=p.hasFocus,C=p.getIndex,y=p.go,g=t.Direction.resolve,s=l.pagination,d=[],T,v;function m(){_(),r([Se,he,Pt],m);var j=n.pagination;s&&_t(s,j?"":"none"),j&&(r([Me,qt,et],F),z(),F(),a(Vo,{list:T,items:d},A(e.index)))}function _(){T&&(Ze(s?Ye(T.children):T),We(T,v),ze(d),T=null),o.destroy()}function z(){var j=e.length,k=n.classes,V=n.i18n,N=n.perPage,U=u()?p.getEnd()+1:wt(j/N);T=s||st("ul",k.pagination,l.track.parentElement),Re(T,v=nn+"--"+h()),ee(T,je,"tablist"),ee(T,$e,V.select),ee(T,On,h()===Qt?"vertical":"");for(var P=0;P<U;P++){var f=st("li",null,T),R=st("button",{class:k.page,type:"button"},f),$=c.getIn(P).map(function(x){return x.slide.id}),w=!u()&&N>1?V.pageX:V.slideX;i(R,"click",se(B,P)),n.paginationKeyboard&&i(R,"keydown",se(E,P)),ee(f,je,"presentation"),ee(R,je,"tab"),ee(R,Rt,$.join(" ")),ee(R,$e,yn(w,P+1)),ee(R,ct,-1),d.push({li:f,button:R,page:P})}}function B(j){y(">"+j,!0)}function E(j,k){var V=d.length,N=jn(k),U=h(),P=-1;N===g(Zt,!1,U)?P=++j%V:N===g(Jt,!1,U)?P=(--j+V)%V:N==="Home"?P=0:N==="End"&&(P=V-1);var f=d[P];f&&(So(f.button),y(">"+P),Oe(k,!0))}function h(){return n.paginationDirection||n.direction}function A(j){return d[p.toPage(j)]}function F(){var j=A(C(!0)),k=A(C());if(j){var V=j.button;We(V,Qe),Fe(V,Kn),ee(V,ct,-1)}if(k){var N=k.button;Re(N,Qe),ee(N,Kn,!0),ee(N,ct,"")}a(No,{list:T,items:d},j,k)}return{items:d,mount:m,destroy:_,getAt:A,update:F}}var Gi=[" ","Enter"];function Yi(e,t,n){var o=n.isNavigation,r=n.slideFocus,a=[];function i(){e.splides.forEach(function(s){s.isParent||(p(e,s.splide),p(s.splide,e))}),o&&u()}function c(){a.forEach(function(s){s.destroy()}),ze(a)}function l(){c(),i()}function p(s,d){var T=de(s);T.on(Me,function(v,m,_){d.go(d.is(mt)?_:v)}),a.push(T)}function u(){var s=de(e),d=s.on;d(Ln,y),d(Bo,g),d([qe,Se],C),a.push(s),s.emit(kn,e.splides)}function C(){ee(t.Elements.list,On,n.direction===Qt?"vertical":"")}function y(s){e.go(s.index)}function g(s,d){wn(Gi,jn(d))&&(y(s),Oe(d))}return{setup:se(t.Media.set,{slideFocus:At(r)?o:r},!0),mount:i,destroy:c,remount:l}}function qi(e,t,n){var o=de(e),r=o.bind,a=0;function i(){n.wheel&&r(t.Elements.track,"wheel",c,at)}function c(p){if(p.cancelable){var u=p.deltaY,C=u<0,y=fn(p),g=n.wheelMinThreshold||0,s=n.wheelSleep||0;Ce(u)>g&&y-a>s&&(e.go(C?"<":">"),a=y),l(C)&&Oe(p)}}function l(p){return!n.releaseWheel||e.state.is(gt)||t.Controller.getAdjacent(p)!==-1}return{mount:i}}var Xi=90;function Ki(e,t,n){var o=de(e),r=o.on,a=t.Elements.track,i=n.live&&!n.isNavigation,c=st("span",fi),l=Xt(Xi,se(u,!1));function p(){i&&(y(!t.Autoplay.isPaused()),ee(a,Qn,!0),c.textContent="…",r(Rn,se(y,!0)),r(Fn,se(y,!1)),r([ft,et],se(u,!0)))}function u(g){ee(a,Zn,g),g?(Lt(a,c),l.start()):(Ze(c),l.cancel())}function C(){Fe(a,[Jn,Qn,Zn]),Ze(c)}function y(g){i&&ee(a,Jn,g?"off":"polite")}return{mount:p,disable:y,destroy:C}}var Ji=Object.freeze({__proto__:null,Media:ii,Direction:ai,Elements:Si,Slides:Ci,Layout:_i,Clones:$i,Move:Ti,Controller:Ai,Arrows:Ii,Autoplay:Ri,Cover:Fi,Scroll:ji,Drag:zi,Keyboard:Di,LazyLoad:Pi,Pagination:Ui,Sync:Yi,Wheel:qi,Live:Ki}),Zi={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"},Qi={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:hi,i18n:Zi,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function ea(e,t,n){var o=t.Slides;function r(){de(e).on([qe,he],a)}function a(){o.forEach(function(c){c.style("transform","translateX(-"+100*c.index+"%)")})}function i(c,l){o.style("transition","opacity "+n.speed+"ms "+n.easing),yo(l)}return{mount:r,start:i,cancel:gn}}function ta(e,t,n){var o=t.Move,r=t.Controller,a=t.Scroll,i=t.Elements.list,c=se(Ee,i,"transition"),l;function p(){de(e).bind(i,"transitionend",function(g){g.target===i&&l&&(C(),l())})}function u(g,s){var d=o.toPosition(g,!0),T=o.getPosition(),v=y(g);Ce(d-T)>=1&&v>=1?n.useScroll?a.scroll(d,v,!1,s):(c("transform "+v+"ms "+n.easing),o.translate(d,!0),l=s):(o.jump(g),s())}function C(){c(""),a.cancel()}function y(g){var s=n.rewindSpeed;if(e.is(dt)&&s){var d=r.getIndex(!0),T=r.getEnd();if(d===0&&g>=T||d>=T&&g===0)return s}return n.speed}return{mount:p,start:u,cancel:C}}var na=(function(){function e(n,o){this.event=de(),this.Components={},this.state=oi(lt),this.splides=[],this._o={},this._E={};var r=Ue(n)?Co(document,n):n;yt(r,r+" is invalid."),this.root=r,o=Pe({label:Le(r,$e)||"",labelledby:Le(r,Nn)||""},Qi,e.defaults,o||{});try{Pe(o,JSON.parse(Le(r,An)))}catch{yt(!1,"Invalid JSON")}this._o=Object.create(Pe({},o))}var t=e.prototype;return t.mount=function(o,r){var a=this,i=this.state,c=this.Components;yt(i.is([lt,Mt]),"Already mounted!"),i.set(lt),this._C=c,this._T=r||this._T||(this.is(Ft)?ea:ta),this._E=o||this._E;var l=Ct({},Ji,this._E,{Transition:this._T});return Je(l,function(p,u){var C=p(a,c,a._o);c[u]=C,C.setup&&C.setup()}),Je(c,function(p){p.mount&&p.mount()}),this.emit(qe),Re(this.root,mi),i.set(ut),this.emit(hn),this},t.sync=function(o){return this.splides.push({splide:o}),o.splides.push({splide:this,isParent:!0}),this.state.is(ut)&&(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(Ye(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(he),this},t.destroy=function(o){o===void 0&&(o=!0);var r=this.event,a=this.state;return a.is(lt)?de(this).on(hn,this.destroy.bind(this,o)):(Je(this._C,function(i){i.destroy&&i.destroy(o)},!0),r.emit(In),r.destroy(),o&&ze(this.splides),a.set(Mt)),this},Zr(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})(),zn=na;zn.defaults={};zn.STATES=ei;var oo=[[qe,"onMounted"],[hn,"onReady"],[Me,"onMove"],[ft,"onMoved"],[Ln,"onClick"],[$o,"onActive"],[To,"onInactive"],[Ao,"onVisible"],[Eo,"onHidden"],[he,"onRefresh"],[Se,"onUpdated"],[pt,"onResize"],[Yt,"onResized"],[Lo,"onDrag"],[Io,"onDragging"],[ko,"onDragged"],[qt,"onScroll"],[et,"onScrolled"],[In,"onDestroy"],[Ro,"onArrowsMounted"],[Fo,"onArrowsUpdated"],[Vo,"onPaginationMounted"],[No,"onPaginationUpdated"],[kn,"onNavigationMounted"],[Rn,"onAutoplayPlay"],[Oo,"onAutoplayPlaying"],[Fn,"onAutoplayPause"],[Vn,"onLazyLoadLoaded"]];function Mn(...e){return e.filter(Boolean).join(" ")}function Ut(e){return e!==null&&typeof e=="object"}function Sn(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,o)=>!Sn(n,t[o]));if(Ut(e)&&Ut(t)){const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&!n.some(r=>!Object.prototype.hasOwnProperty.call(t,r)||!Sn(e[r],t[r]))}return e===t}function oa(e,t){return e.length===t.length&&!e.some((n,o)=>n!==t[o])}function ra(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 xn(e,t){const n=e;return ra(t,(o,r)=>{Array.isArray(o)?n[r]=o.slice():Ut(o)?n[r]=xn(Ut(n[r])?n[r]:{},o):n[r]=o}),n}var ia=({children:e,className:t,...n})=>H.createElement("div",{className:Mn("splide__track",t),...n},H.createElement("ul",{className:"splide__list"},e)),Zo=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 zn(o,e),this.bind(this.splide),this.splide.mount(t,n),this.options=xn({},e||{}),this.slides=this.getSlides())}componentWillUnmount(){this.splide&&(this.splide.destroy(),this.splide=void 0),this.options=void 0,this.slides.length=0}componentDidUpdate(){if(!this.splide)return;const{options:e}=this.props;e&&!Sn(this.options,e)&&(this.splide.options=e,this.options=xn({},e));const t=this.getSlides();oa(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){oo.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:Mn("splide",e),ref:this.splideRef,...this.omit(r,["options",...oo.map(a=>a[1])])},n?H.createElement(ia,null,o):o)}},Qo=({children:e,className:t,...n})=>H.createElement("li",{className:Mn("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 ia="RichTextRenderer-module__link___BWeZ2",aa={link:ia},Qo=({content:e})=>{const t=n=>n.map((o,r)=>o.type==="link"?S.jsx("a",{className:aa.link,href:o.value,target:o.target,children:t(o.children)},r):S.jsx("span",{style:la(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 la(e){return{...e.fontFamily&&{fontFamily: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 sa="SvgImage-module__svg___q3xE-",ca="SvgImage-module__img___VsTm-",oo={svg:sa,img:ca},vt=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:o=""})=>{const[r,a]=D.useState(!0);return D.useEffect(()=>{if(typeof window<"u"&&window.CSS){const i=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');a(i)}},[]),!e.endsWith(".svg")||!r?S.jsx("img",{src:e,alt:"",className:ce(oo.img,o)}):S.jsx("span",{"data-supports-mask":r,className:ce(oo.svg,o),style:{"--svg":`url(${e})`,"--fill":t,"--hover-fill":n}})},ua={"top-left":Y.topLeftAlignment,"top-center":Y.topCenterAlignment,"top-right":Y.topRightAlignment,"middle-left":Y.middleLeftAlignment,"middle-center":Y.middleCenterAlignment,"middle-right":Y.middleRightAlignment,"bottom-left":Y.bottomLeftAlignment,"bottom-center":Y.bottomCenterAlignment,"bottom-right":Y.bottomRightAlignment};function pa({settings:e,content:t,styles:n,isEditor:o}){const[r,a]=D.useState(null),{widthSettings:i,fontSettings:s,letterSpacing:l,textAlign:d,wordSpacing:p,fontSizeLineHeight:_,textAppearance:m,color:h}=n.imageCaption,[c,u]=D.useState(void 0),[b,$]=D.useState(null),[f,w]=D.useState(0),[j,W]=D.useState(0),{direction:E,transition:v,controls:T,pagination:V,imageCaption:z,triggers:L}=e,F=D.useRef(v.type),{x:O,y:U}=e.controls.offset,H=g=>{r&&r.go(g)};return D.useEffect(()=>{if(!b)return;const g=new ResizeObserver(R=>{if(!r)return;const[x]=R;u({width:Math.round(x.contentRect.width),height:Math.round(x.contentRect.height)})});return g.observe(b),()=>g.unobserve(b)},[b]),D.useEffect(()=>{!r||F.current===v.type||(W(g=>g+1),F.current=v.type)},[v.type]),S.jsx("div",{className:ce(Y.wrapper,{[Y.editor]:o}),ref:$,children:S.jsxs("div",{className:Y.sliderInner,style:{width:c?c.width:"100%",height:c?c.height:"100%",backgroundColor:v.backgroundColor&&v.type==="fade in"?v.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&S.jsx("div",{className:ce(Y.captionBlock),children:S.jsx("div",{className:Y.captionTextWrapper,children:t.map((g,R)=>S.jsx("div",{className:ce(Y.captionText,ua[z.alignment],{[Y.withPointerEvents]:R===f&&o,[Y.active]:R===f}),style:{fontFamily:s.fontFamily,fontWeight:s.fontWeight,fontStyle:s.fontStyle,width:i.sizing==="auto"?"max-content":k.scalingValue(i.width,o),letterSpacing:k.scalingValue(l,o),wordSpacing:k.scalingValue(p,o),textAlign:d,fontSize:k.scalingValue(_.fontSize,o),lineHeight:k.scalingValue(_.lineHeight,o),textTransform:m.textTransform??"none",textDecoration:m.textDecoration??"none",fontVariant:m.fontVariant??"normal",color:h,transitionDuration:v.duration?`${Math.round(parseInt(v.duration)/2)}ms`:"500ms"},children:S.jsx("div",{"data-styles":"imageCaption",className:Y.captionTextInner,style:{"--link-hover-color":z.linkHoverColor,"--link-color":z.linkColor,position:"relative",top:k.scalingValue(z.offset.y,o),left:k.scalingValue(z.offset.x,o)},children:S.jsx(Qo,{content:g.imageCaption})})},R))})}),S.jsx(Jo,{onMove:g=>{w(g.index)},ref:a,options:{arrows:!1,speed:v.duration?parseInt(v.duration):500,autoplay:L.autoPlay!==null,...L.autoPlay!==null&&{interval:parseInt(L.autoPlay)*1e3},direction:E==="horiz"||v.type==="fade in"?"ltr":"ttb",pagination:!1,drag:L.triggersList.drag,perPage:1,width:c?c.width:"100%",height:c?c.height:"100%",type:v.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((g,R)=>S.jsx(Zo,{children:S.jsx("div",{className:Y.sliderItem,children:S.jsx("div",{className:Y.imgWrapper,children:S.jsx("img",{className:ce(Y.sliderImage,{[Y.contain]:g.image.objectFit==="contain",[Y.cover]:g.image.objectFit==="cover"}),src:g.image.url,alt:g.image.name??""})})})},R))},j),T.isActive&&S.jsxs(S.Fragment,{children:[S.jsx("div",{className:ce(Y.arrow,{[Y.arrowVertical]:E==="vert",[Y.hoverArrow]:T.show==="on hover"}),style:{color:T.color,"--arrow-hover-color":T.hover},children:S.jsxs("button",{onClick:()=>{H("-1")},className:Y.arrowInner,style:{transform:`translate(${k.scalingValue(O,o)}, ${k.scalingValue(U*(E==="horiz"?1:-1),o)}) scale(${e.controls.scale/100}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:[T.arrowsImgUrl&&S.jsx(vt,{url:T.arrowsImgUrl,fill:T.color,hoverFill:T.hover,className:ce(Y.arrowImg,Y.mirror)}),!T.arrowsImgUrl&&S.jsx(ro,{color:T.color,className:ce(Y.arrowIcon,Y.arrowImg,Y.mirror)})]})}),S.jsx("div",{className:ce(Y.arrow,Y.nextArrow,{[Y.arrowVertical]:E==="vert",[Y.hoverArrow]:T.show==="on hover"}),style:{color:T.color,"--arrow-hover-color":T.hover},children:S.jsxs("button",{className:Y.arrowInner,onClick:()=>H("+1"),style:{transform:`translate(${k.scalingValue(O*(E==="horiz"?-1:1),o)}, ${k.scalingValue(U,o)}) scale(${e.controls.scale/100}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:[T.arrowsImgUrl&&S.jsx(vt,{url:T.arrowsImgUrl,fill:T.color,hoverFill:T.hover,className:Y.arrowImg}),!T.arrowsImgUrl&&S.jsx(ro,{color:T.color,className:ce(Y.arrowIcon,Y.arrowImg)})]})})]}),L.triggersList.click&&S.jsx("div",{className:Y.clickOverlay,onClick:()=>{r&&r.go("+1")}}),V.isActive&&S.jsx("div",{className:ce(Y.pagination,{[Y.paginationInsideBottom]:V.position==="inside-1"&&E==="horiz",[Y.paginationInsideTop]:V.position==="inside-2"&&E==="horiz",[Y.paginationOutsideBottom]:V.position==="outside-1"&&E==="horiz",[Y.paginationOutsideTop]:V.position==="outside-2"&&E==="horiz",[Y.paginationInsideLeft]:V.position==="inside-1"&&E==="vert",[Y.paginationInsideRight]:V.position==="inside-2"&&E==="vert",[Y.paginationOutsideLeft]:V.position==="outside-1"&&E==="vert",[Y.paginationOutsideRight]:V.position==="outside-2"&&E==="vert",[Y.paginationVertical]:E==="vert"}),children:S.jsx("div",{className:Y.paginationInner,style:{backgroundColor:V.colors[2],transform:`scale(${V.scale/100}) translate(${k.scalingValue(V.offset.x,o)}, ${k.scalingValue(V.offset.y,o)}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:t.map((g,R)=>S.jsx("button",{onClick:()=>{r&&r.go(R)},className:ce(Y.paginationItem),children:S.jsx("div",{className:ce(Y.dot,{[Y.activeDot]:R===f}),style:{backgroundColor:R===f?V.colors[0]:V.colors[1],"--pagination-hover-color":V.hover}})},R))})})]})})}function ro({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 da={element:pa,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/sliderImg.png"},defaultSize:{width:400,height:400},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:"outside-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,defaultWidth:500},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{minWidth:58,maxWidth:108,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",minWidth:300,maxWidth:550}}},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"]}},ga="ImageRevealSlider-module__imageRevealSlider___UE5Ob",fa="ImageRevealSlider-module__image___Qjt-e",ma="ImageRevealSlider-module__link___N-iLG",ya="ImageRevealSlider-module__cursor___2U03d",ot={imageRevealSlider:ga,image:fa,link:ma,cursor:ya};function io(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,s=a/2,l=i/2;if(e>=o.x-s&&e<=o.x+s&&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 ha(e,t,n,o){let r,a;if(t==="custom"){r=n;const i=await cn(e);a=i.height/i.width*r}else if(t==="random"){r=Math.random()*(o.max-o.min)+o.min;const i=await cn(e);a=i.height/i.width*r}else{const i=await cn(e);r=i.width,a=i.height}return{width:r,height:a,finalWidth:`${r}px`}}function va({settings:e,content:t,isEditor:n}){const[o,r]=D.useState(null),[a,i]=D.useState([]),[s,l]=D.useState(0),d=D.useRef(0),[p,_]=D.useState({x:0,y:0}),[m,h]=D.useState(1),[c,u]=D.useState("none"),b=D.useRef({x:0,y:0}),[$,f]=D.useState(!1),{sizeType:w,imageWidth:j,randomRangeImageWidth:W}=e.imageSize,{revealPosition:E,visible:v}=e.position,{cursorType:T,target:V,defaultCursorScale:z,defaultCursor:L,hoverCursorScale:F,hoverCursor:O}=e.cursor;D.useEffect(()=>{if(!o)return;const g=(A,C)=>{const N=o.getBoundingClientRect(),q=A-N.left,ie=C-N.top;if(_({x:q,y:ie}),T==="system"){u("none"),h(1);return}const Q=q,me=ie,I=document.elementFromPoint(N.left+Q,N.top+me);if(I&&I.closest("a")){u("none"),h(1);return}const K=io(Q,me,a)||V==="area"?{img:O??"none",scale:F}:{img:L??"none",scale:z};u(K.img),h(K.scale)},R=A=>{A.stopPropagation(),b.current={x:A.clientX,y:A.clientY},g(A.clientX,A.clientY)},x=()=>{$&&g(b.current.x,b.current.y)};return o.addEventListener("mousemove",R),window.addEventListener("scroll",x,!0),()=>{o.removeEventListener("mousemove",R),window.removeEventListener("scroll",x,!0)}},[o,$,p,T,V,O,L,F,z,a]),D.useEffect(()=>{$||(u("none"),h(0))},[$]);const U=async(g,R,x,A={})=>{const{width:C,height:N,finalWidth:q}=await ha(g.image.url,w,j,W);let ie=0,Q=0;E==="same"?(ie=R/2,Q=x/2):(ie=A.x??Math.random()*R,Q=A.y??Math.random()*x);const me=Math.min(Math.max(ie,C/2),R-C/2),I=Math.min(Math.max(Q,N/2),x-N/2);return{id:d.current++,url:g.image.url,link:g.link,name:g.image.name,x:me,y:I,width:q}};D.useEffect(()=>{if(!o||t.length===0)return;const g=o.getBoundingClientRect(),R=g.width,x=g.height,A=[];(async()=>{const N=t[0],q=await U(N,R,x);A.push(q),i(A),l(1)})()},[w,j,W,E,o]),D.useEffect(()=>{v==="last One"&&i(g=>g.length>0?[g[g.length-1]]:[])},[v]);const H=async g=>{if(!o)return;const R=o.getBoundingClientRect(),x=g.clientX-R.left,A=g.clientY-R.top;if(V==="image"&&!io(x,A,a))return;let C=0,N=0;E==="on Click"?(C=x,N=A):E==="same"?(C=R.width/2,N=R.height/2):(C=Math.random()*R.width,N=Math.random()*R.height);const q=t[s],ie=await U(q,R.width,R.height,{x:C,y:N});i(Q=>v==="all"?[...Q,ie]:[ie]),l(Q=>Q>=t.length-1?0:Q+1)};return S.jsxs("div",{ref:r,onClick:H,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),className:ot.imageRevealSlider,style:{cursor:c==="none"?"default":"none"},children:[a.map(g=>S.jsx("div",{className:ot.wrapper,style:{top:`${g.y}px`,left:`${g.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:g.width??"auto",height:"auto",cursor:c==="none"?"default":"none"},children:V==="area"&&g.link?S.jsx("a",{href:g.link,target:"_blank",className:ot.link,children:S.jsx("img",{src:g.url,alt:g.name,className:ot.image},g.id)}):S.jsx("img",{src:g.url,alt:g.name,className:ot.image},g.id)},g.id)),$&&S.jsx("div",{className:ot.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${m})`,backgroundImage:`url('${c}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const ba={element:va,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/clickGalleryImg.png"},defaultSize:{width:"100%",height:"100%"},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,defaultWidth:500},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,minWidth:58,maxWidth:108,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",minWidth:300,maxWidth:550}}},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:""}]}}}},Sa="LightBox-module__hidden___9s-9x",xa="LightBox-module__heroImage___sTxNF",Ca="LightBox-module__background___rm9ml",_a="LightBox-module__editor___4ACaY",wa="LightBox-module__contentStyle___Bgnsq",$a="LightBox-module__imageStyle___tLIlB",Ta="LightBox-module__imgWrapper___LuFUp",Aa="LightBox-module__contain___8-yaS",Ea="LightBox-module__cover___hNvOG",La="LightBox-module__caption___b6L2I",Ia="LightBox-module__captionTextInner___rCGNH",ka="LightBox-module__lightboxSplide___XFuWC",Ra="LightBox-module__arrow___iz38X",Fa="LightBox-module__arrowVertical___Zfz81",Va="LightBox-module__nextArrow___zkAQN",Na="LightBox-module__arrowInner___p48sW",Oa="LightBox-module__arrowIcon___3VaFf",Ba="LightBox-module__arrowImg___pNV88",ja="LightBox-module__mirror___pjeXc",Wa="LightBox-module__thumbsWrapper___GB-nU",za="LightBox-module__thumbsContainerVertical___wttk5",Ma="LightBox-module__thumbsContainer___osSma",Da="LightBox-module__thumbsAlignStart___MO6tY",Ha="LightBox-module__thumbsAlignCenter___Q4sUx",Pa="LightBox-module__thumbsAlignEnd___p4y9R",Ua="LightBox-module__thumbItem___HvnF3",Ga="LightBox-module__closeButton___g2khP",Ya="LightBox-module__fadeIn___0m5GW",qa="LightBox-module__slideInLeft___gPYwC",Xa="LightBox-module__slideInRight___S-pPp",Ka="LightBox-module__slideInTop___DFdAj",Ja="LightBox-module__slideInBottom___m27kZ",Za="LightBox-module__fadeOut___55qBR",Qa="LightBox-module__slideOutLeft___NvU7P",el="LightBox-module__slideOutRight___SK7eC",tl="LightBox-module__slideOutTop___Vgg0z",nl="LightBox-module__slideOutBottom___nJ0Ef",ol="LightBox-module__scaleSlide___vZriG",B={hidden:Sa,heroImage:xa,background:Ca,editor:_a,contentStyle:wa,imageStyle:$a,imgWrapper:Ta,contain:Aa,cover:Ea,caption:La,captionTextInner:Ia,lightboxSplide:ka,arrow:Ra,arrowVertical:Fa,nextArrow:Va,arrowInner:Na,arrowIcon:Oa,arrowImg:Ba,mirror:ja,thumbsWrapper:Wa,thumbsContainerVertical:za,thumbsContainer:Ma,thumbsAlignStart:Da,thumbsAlignCenter:Ha,thumbsAlignEnd:Pa,thumbItem:Ua,closeButton:Ga,fadeIn:Ya,slideInLeft:qa,slideInRight:Xa,slideInTop:Ka,slideInBottom:Ja,fadeOut:Za,slideOutLeft:Qa,slideOutRight:el,slideOutTop:tl,slideOutBottom:nl,scaleSlide:ol},Nt=(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% + ${k.scalingValue(t.x,n)}), calc(-50% + ${k.scalingValue(t.y,n)}))`:r==="middle"?o.transform=`translate(${k.scalingValue(t.x,n)}, calc(-50% + ${k.scalingValue(t.y,n)}))`:a==="center"?o.transform=`translate(calc(-50% + ${k.scalingValue(t.x,n)}), ${k.scalingValue(t.y,n)})`:o.transform=`translate(${k.scalingValue(t.x,n)}, ${k.scalingValue(t.y,n)})`,o};function er(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 ao(e){const t=e.getBoundingClientRect(),n=er(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,s=o/r,l=a/i;let d,p;l>s?(d=o,p=o/l):(p=r,d=r*l);const _=t.left+n.left,m=t.top+n.top,h=(o-d)/2+_,c=(r-p)/2+m;return{x:h,y:c,width:d,height:p}}function lo(e){const t=e.getBoundingClientRect(),n=er(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function so(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 rl(e,t){const n=(()=>{if(e==="fade in")return B.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return B.slideInLeft;case"right":return B.slideInRight;case"top":return B.slideInTop;case"bottom":return B.slideInBottom;default:return B.slideInRight}return B.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return B.fadeIn;if(e==="slide in")switch(t){case"left":return B.slideInLeft;case"right":return B.slideInRight;case"top":return B.slideInTop;case"bottom":return B.slideInBottom;default:return B.slideInRight}return B.fadeIn})(),r=(()=>{if(e==="fade in"||e==="mix")return B.fadeOut;if(e==="slide in")switch(t){case"left":return B.slideOutLeft;case"right":return B.slideOutRight;case"top":return B.slideOutTop;case"bottom":return B.slideOutBottom;default:return B.slideOutRight}return B.fadeOut})(),a=(()=>{if(e==="fade in")return B.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return B.slideOutLeft;case"right":return B.slideOutRight;case"top":return B.slideOutTop;case"bottom":return B.slideOutBottom;default:return B.slideOutRight}return B.fadeOut})();return{appearClass:n,backdropAppearClass:o,backdropDisappearClass:r,disappearClass:a}}const il=({settings:e,content:t,styles:n,portalId:o,activeEvent:r,isEditor:a})=>{const[i,s]=D.useState(!1),{url:l}=e.thumbnailBlock.cover;return D.useEffect(()=>{r==="close"&&s(!1),r==="open"&&s(!0)},[r]),S.jsxs(S.Fragment,{children:[S.jsx("img",{src:l,alt:"Cover",className:B.heroImage,onClick:()=>s(!0)}),S.jsx(al,{isOpen:i,onClose:()=>s(!1),content:t,settings:e,lightboxStyles:n,portalId:o,isEditor:a})]})},al=({isOpen:e,onClose:t,content:n,lightboxStyles:o,settings:r,portalId:a,isEditor:i,metadata:s})=>{var M;const[l,d]=D.useState(0),[p,_]=D.useState(0),[m,h]=D.useState(!1),[c,u]=D.useState(!1),[b,$]=D.useState({}),f=D.useRef(null),w=D.useRef(null),j=D.useRef(null),W=D.useRef(!1),E=D.useRef(null),v=D.useRef(null),T=D.useRef(null),V=D.useRef(null),z=D.useRef(!1),L=D.useRef(null),[F,O]=D.useState(!1),{appear:U,triggers:H,slider:g,thumbnail:R,controls:x,area:A,caption:C,layout:N}=r.lightboxBlock,{appearClass:q,backdropAppearClass:ie,backdropDisappearClass:Q,disappearClass:me}=rl(U.type,U.direction),I=(s==null?void 0:s.itemId)??null;D.useEffect(()=>{const y=()=>{setTimeout(()=>{var G,J;(J=(G=f.current)==null?void 0:G.splide)==null||J.refresh()},16)},P=()=>{_(G=>G+1)};return window.addEventListener("ArticleEditor.Layout:change",y),window.addEventListener("ArticleEditor.ComponentContent:change",P),()=>{window.removeEventListener("ArticleEditor.Layout:change",y),window.removeEventListener("ArticleEditor.ComponentContent:change",P)}},[]),D.useEffect(()=>{if(!e||!R.isActive){O(!1);return}const y=L.current;if(!y)return;const P=()=>{g.direction==="horiz"?O(y.scrollWidth>y.clientWidth):O(y.scrollHeight>y.clientHeight)};P();const G=new ResizeObserver(P);return G.observe(y),()=>G.disconnect()},[e,R.isActive,n.length,b,g.direction]);const K=D.useCallback(()=>{const y=window.matchMedia("(max-width: 768px)").matches,P=so(A.color);y&&!i&&P>.9&&(document.body.style.backgroundColor=""),h(!0),W.current=!0;const G=J=>{J.target===E.current&&J.animationName&&(E.current&&v.current&&E.current.removeEventListener("animationend",v.current),v.current=null,W.current&&(W.current=!1,t()),h(!1))};E.current&&(v.current=G,E.current.addEventListener("animationend",G))},[t,A.color,i]),ye=(y,P,G)=>{var J,re;if(y){if(H.type==="click"&&H.switch==="image")H.repeat==="close"&&l===n.length-1?K():(J=f.current)==null||J.go("+1");else if(H.type==="click"&&H.switch==="50/50"){const Z=y.getBoundingClientRect(),X=P-Z.left,oe=G-Z.top,be=Z.width,le=Z.height;let ge;g.direction==="horiz"?ge=X<be/2?"-1":"+1":ge=oe<le/2?"-1":"+1",(re=f.current)==null||re.go(ge)}}},ae=y=>{if(z.current){z.current=!1;return}const P=n[l],G=(P==null?void 0:P.image.objectFit)==="cover";let J,re;if("changedTouches"in y&&y.changedTouches.length>0)J=y.changedTouches[0].clientX,re=y.changedTouches[0].clientY;else if("clientX"in y)J=y.clientX,re=y.clientY;else return;let Z;if(G&&j.current){const X=lo(j.current);Z=J>=X.left&&J<=X.right&&re>=X.top&&re<=X.bottom}else{const X=j.current?ao(j.current):null;if(!X){y.target===y.currentTarget&&K();return}Z=J>=X.x&&J<=X.x+X.width&&re>=X.y&&re<=X.y+X.height}Z?ye(j.current,J,re):K()},pe=y=>{const P=y.target;(P.classList.contains(B.thumbsWrapper)||P.classList.contains(B.thumbsContainer))&&ae(y)};D.useEffect(()=>{if(!e)return;const y=P=>{var G,J;if(P.key==="Escape"){K();return}if(P.key==="ArrowRight"){d(re=>(re+1)%Math.max(n.length,1)),(G=f.current)==null||G.go("+1");return}P.key==="ArrowLeft"&&(d(re=>(re-1+Math.max(n.length,1))%Math.max(n.length,1)),(J=f.current)==null||J.go("-1"))};return window.addEventListener("keydown",y),()=>{window.removeEventListener("keydown",y)}},[e,K,n.length]),D.useEffect(()=>{if(e){if(d(0),_(P=>P+1),W.current=!1,h(!1),u(!1),$({}),!I)return;const y=new CustomEvent("page-overlay",{detail:{itemId:I}});window.dispatchEvent(y)}return()=>{E.current&&v.current&&(E.current.removeEventListener("animationend",v.current),v.current=null),u(!1)}},[e,I]),D.useEffect(()=>{w.current!==null&&w.current!==g.type&&_(y=>y+1),w.current=g.type},[g.type]),D.useEffect(()=>{if(!e)return;const y=document.body.style.overflow,P=window.matchMedia("(max-width: 768px)").matches,G=so(A.color);document.body.style.overflow="hidden",u(!1);const J=Z=>{Z.target===E.current&&!W.current&&Z.animationName&&(P&&!i&&G>.9&&(document.body.style.backgroundColor=A.color),u(!0),E.current&&T.current&&E.current.removeEventListener("animationend",T.current),T.current=null)};E.current&&(T.current=J,E.current.addEventListener("animationend",J));const re=Z=>{const X=Z.target;X&&(X.closest(`.${B.thumbsWrapper}`)||X.closest(`.${B.thumbsContainer}`))||g.type!=="slide"&&Z.preventDefault()};return document.addEventListener("touchmove",re,{passive:!1}),()=>{document.body.style.overflow=y,document.removeEventListener("touchmove",re),E.current&&T.current&&(E.current.removeEventListener("animationend",T.current),T.current=null),u(!1)}},[e,i,A.color,g.type]),D.useEffect(()=>{if(!e)return;const y=P=>{var J,re;if(W.current){P.stopPropagation();return}if(z.current){z.current=!1;return}const G=P.target;if(!(G&&(G.closest(`.${B.thumbsContainer}`)||G.closest(`.${B.thumbItem}`)))){if(g.type==="slide"&&H.type==="drag"&&((re=(J=f.current)==null?void 0:J.splide)!=null&&re.root)){const Z=f.current.splide.root;if(G&&(Z.contains(G)||Z===G))return}if(P.touches.length===0&&P.changedTouches.length>0){const Z=n[l],X=(Z==null?void 0:Z.image.objectFit)==="cover",oe=P.changedTouches[0];let be;if(X&&j.current){const le=lo(j.current);be=oe.clientX>=le.left&&oe.clientX<=le.right&&oe.clientY>=le.top&&oe.clientY<=le.bottom}else{const le=j.current?ao(j.current):null;if(!le)return;be=oe.clientX>=le.x&&oe.clientX<=le.x+le.width&&oe.clientY>=le.y&&oe.clientY<=le.y+le.height}if(!be){P.stopPropagation(),W.current=!0;const le=ge=>{ge.stopPropagation(),ge.preventDefault(),document.removeEventListener("click",le,!0)};document.addEventListener("click",le,!0),K()}}}};return document.addEventListener("touchend",y,{passive:!0}),()=>{document.removeEventListener("touchend",y)}},[e,K,l,n]);const de=(g.type==="scale"||g.type==="fade")&&g.direction==="vert"&&H.type==="drag";D.useEffect(()=>{var ge,ke;if(!e||!de||!((ke=(ge=f.current)==null?void 0:ge.splide)!=null&&ke.root))return;const y=f.current.splide.root,P=30,G=(te,ne)=>{if(V.current){const ve=Math.abs(te-V.current.x),Te=Math.abs(ne-V.current.y);(ve>0||Te>0)&&(z.current=!0)}},J=te=>{V.current&&(te.preventDefault(),G(te.clientX,te.clientY))},re=te=>{V.current&&te.touches.length>0&&(te.preventDefault(),G(te.touches[0].clientX,te.touches[0].clientY))},Z=(te,ne)=>{if(!V.current||!f.current){V.current=null;return}const ve=Math.abs(te-V.current.x),Te=Math.abs(ne-V.current.y);Te>P&&Te>ve&&f.current.go(ne<V.current.y?"+1":"-1"),V.current=null},X=te=>{V.current&&Z(te.clientX,te.clientY),document.removeEventListener("pointerup",X),document.removeEventListener("pointercancel",X),document.removeEventListener("pointermove",J)},oe=te=>{if(V.current){if(te.changedTouches.length>0){const ne=te.changedTouches[0];Z(ne.clientX,ne.clientY)}document.removeEventListener("touchend",oe),document.removeEventListener("touchcancel",oe),document.removeEventListener("touchmove",re)}},be=te=>{V.current={x:te.clientX,y:te.clientY},z.current=!1,document.addEventListener("pointermove",J,{passive:!1}),document.addEventListener("pointerup",X),document.addEventListener("pointercancel",X)},le=te=>{te.touches.length>0&&(V.current={x:te.touches[0].clientX,y:te.touches[0].clientY},z.current=!1,document.addEventListener("touchmove",re,{passive:!1}),document.addEventListener("touchend",oe),document.addEventListener("touchcancel",oe))};return y.addEventListener("pointerdown",be),y.addEventListener("touchstart",le),()=>{y.removeEventListener("pointerdown",be),y.removeEventListener("touchstart",le),document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",X),document.removeEventListener("pointercancel",X),document.removeEventListener("touchmove",re),document.removeEventListener("touchend",oe),document.removeEventListener("touchcancel",oe),V.current=null,z.current=!1}},[e,de,p]);const De={backgroundColor:A.color,backdropFilter:`blur(${A.blur}px)`,animationDuration:`${parseInt(U.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return document.getElementById(a)?ir.createPortal(S.jsxs(S.Fragment,{children:[S.jsx("div",{ref:i?null:E,className:ce(B.background,m?Q:ie,{[B.editor]:i},{[B.hidden]:!e}),style:{...De,...c&&!i&&!m?{position:"absolute"}:{}}}),S.jsxs("div",{ref:i?E:null,className:ce(B.contentStyle,m?me:q,{[B.editor]:i},{[B.hidden]:!e}),style:{animationDuration:`${parseInt(U.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[S.jsx(Jo,{onMove:y=>d(y.index),ref:f,className:B.lightboxSplide,options:{arrows:!1,speed:g.duration?parseInt(g.duration):500,direction:g.direction==="horiz"||g.type==="fade"||g.type==="scale"?"ltr":"ttb",pagination:!1,drag:H.type==="drag"&&!de,perPage:1,width:"100%",height:"100%",type:g.type==="fade"||g.type==="scale"?"fade":"loop",padding:0,rewind:H.repeat!=="close",start:0},style:{"--splide-speed":g.duration},children:n.map((y,P)=>{const G=Nt(N.position,N.offset,i),J=`${k.scalingValue(N.padding.top,i)} ${k.scalingValue(N.padding.right,i)} ${k.scalingValue(N.padding.bottom,i)} ${k.scalingValue(N.padding.left,i)}`,re=g.type==="scale"?(()=>{const{transform:Z,...X}=G;return{...X,position:"absolute",padding:J,boxSizing:"border-box","--position-transform":Z||"none"}})():{...G,position:"absolute",padding:J,boxSizing:"border-box"};return S.jsx(Zo,{children:S.jsx("div",{className:B.imgWrapper,onClick:ae,children:S.jsx("img",{ref:P===l?j:null,className:ce(B.imageStyle,{[B.contain]:y.image.objectFit==="contain",[B.cover]:y.image.objectFit==="cover",[B.scaleSlide]:g.type==="scale"}),src:y.image.url,alt:y.image.name??"",style:{...re,pointerEvents:y.image.objectFit==="contain"?"none":"auto"}})})},P)})},p),x.isActive&&S.jsxs(S.Fragment,{children:[S.jsx("div",{className:ce(B.arrow,{[B.arrowVertical]:g.direction==="vert"}),style:{color:x.color,"--arrow-hover-color":x.hover},children:S.jsxs("button",{className:B.arrowInner,style:{transform:`translate(${k.scalingValue(x.offset.x,i)}, ${k.scalingValue(x.offset.y*(g.direction==="horiz"?1:-1),i)}) scale(${x.scale}) rotate(${g.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var y;return(y=f.current)==null?void 0:y.go("-1")},"aria-label":"Previous",children:[x.arrowsImgUrl&&S.jsx(vt,{url:x.arrowsImgUrl,fill:x.color,hoverFill:x.hover,className:ce(B.arrowImg,B.mirror)}),!x.arrowsImgUrl&&S.jsx(co,{color:x.color,className:ce(B.arrowIcon,B.arrowImg,B.mirror)})]})}),S.jsx("div",{className:ce(B.arrow,B.nextArrow,{[B.arrowVertical]:g.direction==="vert"}),style:{color:x.color,"--arrow-hover-color":x.hover},children:S.jsxs("button",{className:B.arrowInner,style:{transform:`translate(${k.scalingValue(x.offset.x*(g.direction==="horiz"?-1:1),i)}, ${k.scalingValue(x.offset.y,i)}) scale(${x.scale}) rotate(${g.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var y;return(y=f.current)==null?void 0:y.go("+1")},"aria-label":"Next",children:[x.arrowsImgUrl&&S.jsx(vt,{url:x.arrowsImgUrl,fill:x.color,hoverFill:x.hover,className:B.arrowImg}),!x.arrowsImgUrl&&S.jsx(co,{color:x.color,className:ce(B.arrowIcon,B.arrowImg)})]})})]}),A.closeIconUrl&&(()=>{const y=Nt(A.closeIconAlign,A.closeIconOffset,i),P=`scale(${A.closeIconScale})`,G=y.transform?`${y.transform} ${P}`:P;return S.jsx("button",{className:B.closeButton,style:{...y,transform:G},onClick:K,"aria-label":"Close lightbox",children:S.jsx(vt,{url:A.closeIconUrl,fill:A.closeIconColor??"#000000",hoverFill:A.closeIconHover??"#cccccc"})})})(),C&&C.isActive&&o.imageCaption&&((M=n[l])==null?void 0:M.imageCaption)&&(()=>{const{widthSettings:y,fontSettings:P,letterSpacing:G,textAlign:J,wordSpacing:re,fontSizeLineHeight:Z,textAppearance:X,color:oe}=o.imageCaption;return S.jsx("div",{className:B.caption,style:{...Nt(C.alignment,C.offset,i),fontFamily:P.fontFamily,fontWeight:P.fontWeight,fontStyle:P.fontStyle,width:y.sizing==="auto"?"max-content":k.scalingValue(y.width,i),letterSpacing:k.scalingValue(G,i),wordSpacing:k.scalingValue(re,i),textAlign:J,fontSize:k.scalingValue(Z.fontSize,i),lineHeight:k.scalingValue(Z.lineHeight,i),textTransform:X.textTransform??"none",textDecoration:X.textDecoration??"none",fontVariant:X.fontVariant??"normal",color:oe},onClick:be=>be.stopPropagation(),children:S.jsx("div",{"data-styles":"imageCaption",className:B.captionTextInner,style:{"--link-color":C.linkColor,"--link-hover-color":C.linkHoverColor},children:S.jsx(Qo,{content:n[l].imageCaption})})})})(),R.isActive&&(()=>{const[y,P]=R.position.split("-"),G=g.direction==="horiz"?`${y}-left`:R.position,J=Nt(G,R.offset,i),re=()=>{if(g.direction==="horiz"){if(P==="left")return"flex-start";if(P==="center")return"center";if(P==="right")return"flex-end"}else{if(y==="top")return"flex-start";if(y==="middle")return"center";if(y==="bottom")return"flex-end"}return"flex-start"};return S.jsx("div",{ref:L,className:B.thumbsWrapper,onClick:Z=>pe(Z),style:{position:i?"absolute":"fixed",...J,...g.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:S.jsx("div",{className:ce(B.thumbsContainer,{[B.thumbsContainerVertical]:g.direction==="vert",[B.thumbsAlignStart]:R.align==="start",[B.thumbsAlignCenter]:R.align==="center",[B.thumbsAlignEnd]:R.align==="end"}),style:{gap:k.scalingValue(R.grid.gap,i),justifyContent:F?"flex-start":re()},children:n.map((Z,X)=>{const oe=X===l,be=b[X],ge=R.grid.size*(oe?R.activeState.scale:1),ke=()=>{if(R.fit!=="fit")return{};if(!be)return g.direction==="horiz"?{height:k.scalingValue(ge,i)}:{width:k.scalingValue(ge,i)};const te=be.width/be.height;if(g.direction==="horiz"){const ne=ge,ve=ne*te;return{width:k.scalingValue(ve,i),height:k.scalingValue(ne,i)}}else{const ne=ge,ve=ne/te;return{width:k.scalingValue(ne,i),height:k.scalingValue(ve,i)}}};return S.jsx("button",{className:B.thumbItem,style:{...g.direction==="horiz"&&R.fit!=="fit"?{height:k.scalingValue(ge,i)}:{},...g.direction==="vert"&&R.fit!=="fit"?{width:k.scalingValue(ge,i)}:{},...R.fit==="cover"?{width:k.scalingValue(ge,i),height:k.scalingValue(ge,i)}:{},...ke(),transition:oe?"all 0.25s ease-out":"none",opacity:oe?R.activeState.opacity/100:R.opacity/100,"--thumb-hover":R.activeState.opacity/100},onClick:te=>{var ne;te.stopPropagation(),d(X),(ne=f.current)==null||ne.go(X)},onMouseEnter:()=>{var te;R.triggers==="hov"&&((te=f.current)==null||te.go(X))},children:S.jsx("img",{src:Z.image.url,alt:Z.image.name??"",onLoad:te=>{const ne=te.currentTarget;ne.naturalWidth&&ne.naturalHeight&&$(ve=>({...ve,[X]:{width:ne.naturalWidth,height:ne.naturalHeight}}))},style:{objectFit:R.fit==="cover"?"cover":"contain",...R.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...R.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Z.image.name}-${X}`)})})})})()]})]}),document.getElementById(a)):null};function co({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 ll={element:il,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/lightboxImg.png"},defaultSize:{width:440,height:550},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,defaultWidth:500},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input",minWidth:58,maxWidth:108},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",minWidth:300,maxWidth:550}}},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 rt(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function sl(e){return`
|
|
6
|
+
*/const aa="RichTextRenderer-module__link___BWeZ2",la={link:aa},er=({content:e})=>{const t=n=>n.map((o,r)=>o.type==="link"?S.jsx("a",{className:la.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: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-",ua="SvgImage-module__img___VsTm-",ro={svg:ca,img:ua},vt=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:o=""})=>{const[r,a]=H.useState(!0);return H.useEffect(()=>{if(typeof window<"u"&&window.CSS){const i=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');a(i)}},[]),!e.endsWith(".svg")||!r?S.jsx("img",{src:e,alt:"",className:pe(ro.img,o)}):S.jsx("span",{"data-supports-mask":r,className:pe(ro.svg,o),style:{"--svg":`url(${e})`,"--fill":t,"--hover-fill":n}})},pa={"top-left":G.topLeftAlignment,"top-center":G.topCenterAlignment,"top-right":G.topRightAlignment,"middle-left":G.middleLeftAlignment,"middle-center":G.middleCenterAlignment,"middle-right":G.middleRightAlignment,"bottom-left":G.bottomLeftAlignment,"bottom-center":G.bottomCenterAlignment,"bottom-right":G.bottomRightAlignment};function da({settings:e,content:t,styles:n,isEditor:o}){const[r,a]=H.useState(null),{widthSettings:i,fontSettings:c,letterSpacing:l,textAlign:p,wordSpacing:u,fontSizeLineHeight:C,textAppearance:y,color:g}=n.imageCaption,[s,d]=H.useState(void 0),[T,v]=H.useState(null),[m,_]=H.useState(0),[z,B]=H.useState(0),{direction:E,transition:h,controls:A,pagination:F,imageCaption:j,triggers:k}=e,V=H.useRef(h.type),{x:N,y:U}=e.controls.offset,P=f=>{r&&r.go(f)};return H.useEffect(()=>{if(!T)return;const f=new ResizeObserver(R=>{if(!r)return;const[$]=R;d({width:Math.round($.contentRect.width),height:Math.round($.contentRect.height)})});return f.observe(T),()=>f.unobserve(T)},[T]),H.useEffect(()=>{!r||V.current===h.type||(B(f=>f+1),V.current=h.type)},[h.type]),S.jsx("div",{className:pe(G.wrapper,{[G.editor]:o}),ref:v,children:S.jsxs("div",{className:G.sliderInner,style:{width:s?s.width:"100%",height:s?s.height:"100%",backgroundColor:h.backgroundColor&&h.type==="fade in"?h.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&S.jsx("div",{className:pe(G.captionBlock),children:S.jsx("div",{className:G.captionTextWrapper,children:t.map((f,R)=>S.jsx("div",{className:pe(G.captionText,pa[j.alignment],{[G.withPointerEvents]:R===m&&o,[G.active]:R===m}),style:{fontFamily:c.fontFamily,fontWeight:c.fontWeight,fontStyle:c.fontStyle,width:i.sizing==="auto"?"max-content":I.scalingValue(i.width,o),letterSpacing:I.scalingValue(l,o),wordSpacing:I.scalingValue(u,o),textAlign:p,fontSize:I.scalingValue(C.fontSize,o),lineHeight:I.scalingValue(C.lineHeight,o),textTransform:y.textTransform??"none",textDecoration:y.textDecoration??"none",fontVariant:y.fontVariant??"normal",color:g,transitionDuration:h.duration?`${Math.round(parseInt(h.duration)/2)}ms`:"500ms"},children:S.jsx("div",{"data-styles":"imageCaption",className:G.captionTextInner,style:{"--link-hover-color":j.linkHoverColor,"--link-color":j.linkColor,position:"relative",top:I.scalingValue(j.offset.y,o),left:I.scalingValue(j.offset.x,o)},children:S.jsx(er,{content:f.imageCaption})})},R))})}),S.jsx(Zo,{onMove:f=>{_(f.index)},ref:a,options:{arrows:!1,speed:h.duration?parseInt(h.duration):500,autoplay:k.autoPlay!==null,...k.autoPlay!==null&&{interval:parseInt(k.autoPlay)*1e3},direction:E==="horiz"||h.type==="fade in"?"ltr":"ttb",pagination:!1,drag:k.triggersList.drag,perPage:1,width:s?s.width:"100%",height:s?s.height:"100%",type:h.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((f,R)=>S.jsx(Qo,{children:S.jsx("div",{className:G.sliderItem,children:S.jsx("div",{className:G.imgWrapper,children:S.jsx("img",{className:pe(G.sliderImage,{[G.contain]:f.image.objectFit==="contain",[G.cover]:f.image.objectFit==="cover"}),src:f.image.url,alt:f.image.name??""})})})},R))},z),A.isActive&&S.jsxs(S.Fragment,{children:[S.jsx("div",{className:pe(G.arrow,{[G.arrowVertical]:E==="vert",[G.hoverArrow]:A.show==="on hover"}),style:{color:A.color,"--arrow-hover-color":A.hover},children:S.jsxs("button",{onClick:()=>{P("-1")},className:G.arrowInner,style:{transform:`translate(${I.scalingValue(N,o)}, ${I.scalingValue(U*(E==="horiz"?1:-1),o)}) scale(${e.controls.scale/100}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:[A.arrowsImgUrl&&S.jsx(vt,{url:A.arrowsImgUrl,fill:A.color,hoverFill:A.hover,className:pe(G.arrowImg,G.mirror)}),!A.arrowsImgUrl&&S.jsx(io,{color:A.color,className:pe(G.arrowIcon,G.arrowImg,G.mirror)})]})}),S.jsx("div",{className:pe(G.arrow,G.nextArrow,{[G.arrowVertical]:E==="vert",[G.hoverArrow]:A.show==="on hover"}),style:{color:A.color,"--arrow-hover-color":A.hover},children:S.jsxs("button",{className:G.arrowInner,onClick:()=>P("+1"),style:{transform:`translate(${I.scalingValue(N*(E==="horiz"?-1:1),o)}, ${I.scalingValue(U,o)}) scale(${e.controls.scale/100}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:[A.arrowsImgUrl&&S.jsx(vt,{url:A.arrowsImgUrl,fill:A.color,hoverFill:A.hover,className:G.arrowImg}),!A.arrowsImgUrl&&S.jsx(io,{color:A.color,className:pe(G.arrowIcon,G.arrowImg)})]})})]}),k.triggersList.click&&S.jsx("div",{className:G.clickOverlay,onClick:()=>{r&&r.go("+1")}}),F.isActive&&S.jsx("div",{className:pe(G.pagination,{[G.paginationInsideBottom]:F.position==="inside-1"&&E==="horiz",[G.paginationInsideTop]:F.position==="inside-2"&&E==="horiz",[G.paginationOutsideBottom]:F.position==="outside-1"&&E==="horiz",[G.paginationOutsideTop]:F.position==="outside-2"&&E==="horiz",[G.paginationInsideLeft]:F.position==="inside-1"&&E==="vert",[G.paginationInsideRight]:F.position==="inside-2"&&E==="vert",[G.paginationOutsideLeft]:F.position==="outside-1"&&E==="vert",[G.paginationOutsideRight]:F.position==="outside-2"&&E==="vert",[G.paginationVertical]:E==="vert"}),children:S.jsx("div",{className:G.paginationInner,style:{backgroundColor:F.colors[2],transform:`scale(${F.scale/100}) translate(${I.scalingValue(F.offset.x,o)}, ${I.scalingValue(F.offset.y,o)}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:t.map((f,R)=>S.jsx("button",{onClick:()=>{r&&r.go(R)},className:pe(G.paginationItem),children:S.jsx("div",{className:pe(G.dot,{[G.activeDot]:R===m}),style:{backgroundColor:R===m?F.colors[0]:F.colors[1],"--pagination-hover-color":F.hover}})},R))})})]})})}function io({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 ga={element:da,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/sliderImg.png"},defaultSize:{width:400,height:400},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:"outside-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,defaultWidth:500},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{minWidth:58,maxWidth:108,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",minWidth:300,maxWidth:550}}},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"]}},fa="ImageRevealSlider-module__imageRevealSlider___UE5Ob",ma="ImageRevealSlider-module__image___Qjt-e",ya="ImageRevealSlider-module__link___N-iLG",ha="ImageRevealSlider-module__cursor___2U03d",ot={imageRevealSlider:fa,image:ma,link:ya,cursor:ha};function ao(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,c=a/2,l=i/2;if(e>=o.x-c&&e<=o.x+c&&t>=o.y-l&&t<=o.y+l)return!0}return!1}function un(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function va(e,t,n,o){let r,a;if(t==="custom"){r=n;const i=await un(e);a=i.height/i.width*r}else if(t==="random"){r=Math.random()*(o.max-o.min)+o.min;const i=await un(e);a=i.height/i.width*r}else{const i=await un(e);r=i.width,a=i.height}return{width:r,height:a,finalWidth:`${r}px`}}function ba({settings:e,content:t,isEditor:n}){const[o,r]=H.useState(null),[a,i]=H.useState([]),[c,l]=H.useState(0),p=H.useRef(0),[u,C]=H.useState({x:0,y:0}),[y,g]=H.useState(1),[s,d]=H.useState("none"),T=H.useRef({x:0,y:0}),[v,m]=H.useState(!1),{sizeType:_,imageWidth:z,randomRangeImageWidth:B}=e.imageSize,{revealPosition:E,visible:h}=e.position,{cursorType:A,target:F,defaultCursorScale:j,defaultCursor:k,hoverCursorScale:V,hoverCursor:N}=e.cursor;H.useEffect(()=>{if(!o)return;const f=(w,x)=>{const O=o.getBoundingClientRect(),q=w-O.left,ie=x-O.top;if(C({x:q,y:ie}),A==="system"){d("none"),g(1);return}const ne=q,le=ie,L=document.elementFromPoint(O.left+ne,O.top+le);if(L&&L.closest("a")){d("none"),g(1);return}const Z=ao(ne,le,a)||F==="area"?{img:N??"none",scale:V}:{img:k??"none",scale:j};d(Z.img),g(Z.scale)},R=w=>{w.stopPropagation(),T.current={x:w.clientX,y:w.clientY},f(w.clientX,w.clientY)},$=()=>{v&&f(T.current.x,T.current.y)};return o.addEventListener("mousemove",R),window.addEventListener("scroll",$,!0),()=>{o.removeEventListener("mousemove",R),window.removeEventListener("scroll",$,!0)}},[o,v,u,A,F,N,k,V,j,a]),H.useEffect(()=>{v||(d("none"),g(0))},[v]);const U=async(f,R,$,w={})=>{const{width:x,height:O,finalWidth:q}=await va(f.image.url,_,z,B);let ie=0,ne=0;E==="same"?(ie=R/2,ne=$/2):(ie=w.x??Math.random()*R,ne=w.y??Math.random()*$);const le=Math.min(Math.max(ie,x/2),R-x/2),L=Math.min(Math.max(ne,O/2),$-O/2);return{id:p.current++,url:f.image.url,link:f.link,name:f.image.name,x:le,y:L,width:q}};H.useEffect(()=>{if(!o||t.length===0)return;const f=o.getBoundingClientRect(),R=f.width,$=f.height,w=[];(async()=>{const O=t[0],q=await U(O,R,$);w.push(q),i(w),l(1)})()},[_,z,B,E,o]),H.useEffect(()=>{h==="last One"&&i(f=>f.length>0?[f[f.length-1]]:[])},[h]);const P=async f=>{if(!o)return;const R=o.getBoundingClientRect(),$=f.clientX-R.left,w=f.clientY-R.top;if(F==="image"&&!ao($,w,a))return;let x=0,O=0;E==="on Click"?(x=$,O=w):E==="same"?(x=R.width/2,O=R.height/2):(x=Math.random()*R.width,O=Math.random()*R.height);const q=t[c],ie=await U(q,R.width,R.height,{x,y:O});i(ne=>h==="all"?[...ne,ie]:[ie]),l(ne=>ne>=t.length-1?0:ne+1)};return S.jsxs("div",{ref:r,onClick:P,onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),className:ot.imageRevealSlider,style:{cursor:s==="none"?"default":"none"},children:[a.map(f=>S.jsx("div",{className:ot.wrapper,style:{top:`${f.y}px`,left:`${f.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:f.width??"auto",height:"auto",cursor:s==="none"?"default":"none"},children:F==="area"&&f.link?S.jsx("a",{href:f.link,target:"_blank",className:ot.link,children:S.jsx("img",{src:f.url,alt:f.name,className:ot.image},f.id)}):S.jsx("img",{src:f.url,alt:f.name,className:ot.image},f.id)},f.id)),v&&S.jsx("div",{className:ot.cursor,style:{left:`${u.x}px`,top:`${u.y}px`,transform:`translate(-50%, -50%) scale(${y})`,backgroundImage:`url('${s}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Sa={element:ba,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/clickGalleryImg.png"},defaultSize:{width:"100%",height:"100%"},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,defaultWidth:500},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,minWidth:58,maxWidth:108,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",minWidth:300,maxWidth:550}}},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:""}]}}}},xa="LightBox-module__hidden___9s-9x",Ca="LightBox-module__heroImage___sTxNF",_a="LightBox-module__background___rm9ml",wa="LightBox-module__editor___4ACaY",$a="LightBox-module__contentStyle___Bgnsq",Ta="LightBox-module__imageStyle___tLIlB",Aa="LightBox-module__imgWrapper___LuFUp",Ea="LightBox-module__contain___8-yaS",La="LightBox-module__cover___hNvOG",Ia="LightBox-module__caption___b6L2I",ka="LightBox-module__captionTextInner___rCGNH",Ra="LightBox-module__lightboxSplide___XFuWC",Fa="LightBox-module__arrow___iz38X",Va="LightBox-module__arrowVertical___Zfz81",Na="LightBox-module__nextArrow___zkAQN",Oa="LightBox-module__arrowInner___p48sW",Ba="LightBox-module__arrowIcon___3VaFf",Wa="LightBox-module__arrowImg___pNV88",ja="LightBox-module__mirror___pjeXc",za="LightBox-module__thumbsWrapper___GB-nU",Ma="LightBox-module__thumbsContainerVertical___wttk5",Da="LightBox-module__thumbsContainer___osSma",Ha="LightBox-module__thumbsAlignStart___MO6tY",Pa="LightBox-module__thumbsAlignCenter___Q4sUx",Ua="LightBox-module__thumbsAlignEnd___p4y9R",Ga="LightBox-module__thumbItem___HvnF3",Ya="LightBox-module__closeButton___g2khP",qa="LightBox-module__fadeIn___0m5GW",Xa="LightBox-module__slideInLeft___gPYwC",Ka="LightBox-module__slideInRight___S-pPp",Ja="LightBox-module__slideInTop___DFdAj",Za="LightBox-module__slideInBottom___m27kZ",Qa="LightBox-module__fadeOut___55qBR",el="LightBox-module__slideOutLeft___NvU7P",tl="LightBox-module__slideOutRight___SK7eC",nl="LightBox-module__slideOutTop___Vgg0z",ol="LightBox-module__slideOutBottom___nJ0Ef",rl="LightBox-module__scaleSlide___vZriG",W={hidden:xa,heroImage:Ca,background:_a,editor:wa,contentStyle:$a,imageStyle:Ta,imgWrapper:Aa,contain:Ea,cover:La,caption:Ia,captionTextInner:ka,lightboxSplide:Ra,arrow:Fa,arrowVertical:Va,nextArrow:Na,arrowInner:Oa,arrowIcon:Ba,arrowImg:Wa,mirror:ja,thumbsWrapper:za,thumbsContainerVertical:Ma,thumbsContainer:Da,thumbsAlignStart:Ha,thumbsAlignCenter:Pa,thumbsAlignEnd:Ua,thumbItem:Ga,closeButton:Ya,fadeIn:qa,slideInLeft:Xa,slideInRight:Ka,slideInTop:Ja,slideInBottom:Za,fadeOut:Qa,slideOutLeft:el,slideOutRight:tl,slideOutTop:nl,slideOutBottom:ol,scaleSlide:rl},Nt=(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% + ${I.scalingValue(t.x,n)}), calc(-50% + ${I.scalingValue(t.y,n)}))`:r==="middle"?o.transform=`translate(${I.scalingValue(t.x,n)}, calc(-50% + ${I.scalingValue(t.y,n)}))`:a==="center"?o.transform=`translate(calc(-50% + ${I.scalingValue(t.x,n)}), ${I.scalingValue(t.y,n)})`:o.transform=`translate(${I.scalingValue(t.x,n)}, ${I.scalingValue(t.y,n)})`,o};function tr(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 lo(e){const t=e.getBoundingClientRect(),n=tr(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,c=o/r,l=a/i;let p,u;l>c?(p=o,u=o/l):(u=r,p=r*l);const C=t.left+n.left,y=t.top+n.top,g=(o-p)/2+C,s=(r-u)/2+y;return{x:g,y:s,width:p,height:u}}function so(e){const t=e.getBoundingClientRect(),n=tr(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 il(e,t){const n=(()=>{if(e==="fade in")return W.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return W.slideInLeft;case"right":return W.slideInRight;case"top":return W.slideInTop;case"bottom":return W.slideInBottom;default:return W.slideInRight}return W.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return W.fadeIn;if(e==="slide in")switch(t){case"left":return W.slideInLeft;case"right":return W.slideInRight;case"top":return W.slideInTop;case"bottom":return W.slideInBottom;default:return W.slideInRight}return W.fadeIn})(),r=(()=>{if(e==="fade in"||e==="mix")return W.fadeOut;if(e==="slide in")switch(t){case"left":return W.slideOutLeft;case"right":return W.slideOutRight;case"top":return W.slideOutTop;case"bottom":return W.slideOutBottom;default:return W.slideOutRight}return W.fadeOut})(),a=(()=>{if(e==="fade in")return W.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return W.slideOutLeft;case"right":return W.slideOutRight;case"top":return W.slideOutTop;case"bottom":return W.slideOutBottom;default:return W.slideOutRight}return W.fadeOut})();return{appearClass:n,backdropAppearClass:o,backdropDisappearClass:r,disappearClass:a}}const al=({settings:e,content:t,styles:n,portalId:o,activeEvent:r,isEditor:a})=>{const[i,c]=H.useState(!1),{url:l}=e.thumbnailBlock.cover;return H.useEffect(()=>{r==="close"&&c(!1),r==="open"&&c(!0)},[r]),S.jsxs(S.Fragment,{children:[S.jsx("img",{src:l,alt:"Cover",className:W.heroImage,onClick:()=>c(!0)}),S.jsx(ll,{isOpen:i,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:o,isEditor:a})]})},ll=({isOpen:e,onClose:t,content:n,lightboxStyles:o,settings:r,portalId:a,isEditor:i,metadata:c})=>{var M;const[l,p]=H.useState(0),[u,C]=H.useState(0),[y,g]=H.useState(!1),[s,d]=H.useState(!1),[T,v]=H.useState({}),m=H.useRef(null),_=H.useRef(null),z=H.useRef(null),B=H.useRef(!1),E=H.useRef(null),h=H.useRef(null),A=H.useRef(null),F=H.useRef(null),j=H.useRef(!1),k=H.useRef(null),[V,N]=H.useState(!1),{appear:U,triggers:P,slider:f,thumbnail:R,controls:$,area:w,caption:x,layout:O}=r.lightboxBlock,{appearClass:q,backdropAppearClass:ie,backdropDisappearClass:ne,disappearClass:le}=il(U.type,U.direction),L=(c==null?void 0:c.itemId)??null;H.useEffect(()=>{const b=()=>{setTimeout(()=>{var X,Y;(Y=(X=m.current)==null?void 0:X.splide)==null||Y.refresh()},16)},D=()=>{C(X=>X+1)};return window.addEventListener("ArticleEditor.Layout:change",b),window.addEventListener("ArticleEditor.ComponentContent:change",D),()=>{window.removeEventListener("ArticleEditor.Layout:change",b),window.removeEventListener("ArticleEditor.ComponentContent:change",D)}},[]),H.useEffect(()=>{if(!e||!R.isActive){N(!1);return}const b=k.current;if(!b)return;const D=()=>{f.direction==="horiz"?N(b.scrollWidth>b.clientWidth):N(b.scrollHeight>b.clientHeight)};D();const X=new ResizeObserver(D);return X.observe(b),()=>X.disconnect()},[e,R.isActive,n.length,T,f.direction]);const Z=H.useCallback(()=>{const b=window.matchMedia("(max-width: 768px)").matches,D=co(w.color);b&&!i&&D>.9&&(document.body.style.backgroundColor=""),g(!0),B.current=!0;const X=Y=>{Y.target===E.current&&Y.animationName&&(E.current&&h.current&&E.current.removeEventListener("animationend",h.current),h.current=null,B.current&&(B.current=!1,t()),g(!1))};E.current&&(h.current=X,E.current.addEventListener("animationend",X))},[t,w.color,i]),ye=(b,D,X)=>{var Y,oe;if(b){if(P.type==="click"&&P.switch==="image")P.repeat==="close"&&l===n.length-1?Z():(Y=m.current)==null||Y.go("+1");else if(P.type==="click"&&P.switch==="50/50"){const J=b.getBoundingClientRect(),K=D-J.left,re=X-J.top,ve=J.width,ce=J.height;let ue;f.direction==="horiz"?ue=K<ve/2?"-1":"+1":ue=re<ce/2?"-1":"+1",(oe=m.current)==null||oe.go(ue)}}},ae=b=>{if(j.current){j.current=!1;return}const D=n[l],X=(D==null?void 0:D.image.objectFit)==="cover";let Y,oe;if("changedTouches"in b&&b.changedTouches.length>0)Y=b.changedTouches[0].clientX,oe=b.changedTouches[0].clientY;else if("clientX"in b)Y=b.clientX,oe=b.clientY;else return;let J;if(X&&z.current){const K=so(z.current);J=Y>=K.left&&Y<=K.right&&oe>=K.top&&oe<=K.bottom}else{const K=z.current?lo(z.current):null;if(!K){b.target===b.currentTarget&&Z();return}J=Y>=K.x&&Y<=K.x+K.width&&oe>=K.y&&oe<=K.y+K.height}J?ye(z.current,Y,oe):Z()},ge=b=>{const D=b.target;(D.classList.contains(W.thumbsWrapper)||D.classList.contains(W.thumbsContainer))&&ae(b)};H.useEffect(()=>{if(!e)return;const b=D=>{var X,Y;if(D.key==="Escape"){Z();return}if(D.key==="ArrowRight"){p(oe=>(oe+1)%Math.max(n.length,1)),(X=m.current)==null||X.go("+1");return}D.key==="ArrowLeft"&&(p(oe=>(oe-1+Math.max(n.length,1))%Math.max(n.length,1)),(Y=m.current)==null||Y.go("-1"))};return window.addEventListener("keydown",b),()=>{window.removeEventListener("keydown",b)}},[e,Z,n.length]),H.useEffect(()=>{if(e){if(p(0),C(D=>D+1),B.current=!1,g(!1),d(!1),v({}),!L)return;const b=new CustomEvent("page-overlay",{detail:{itemId:L}});window.dispatchEvent(b)}return()=>{E.current&&h.current&&(E.current.removeEventListener("animationend",h.current),h.current=null),d(!1)}},[e,L]),H.useEffect(()=>{_.current!==null&&_.current!==f.type&&C(b=>b+1),_.current=f.type},[f.type]),H.useEffect(()=>{if(!e)return;const b=document.body.style.overflow,D=window.matchMedia("(max-width: 768px)").matches,X=co(w.color);document.body.style.overflow="hidden",d(!1);const Y=J=>{J.target===E.current&&!B.current&&J.animationName&&(D&&!i&&X>.9&&(document.body.style.backgroundColor=w.color),d(!0),E.current&&A.current&&E.current.removeEventListener("animationend",A.current),A.current=null)};E.current&&(A.current=Y,E.current.addEventListener("animationend",Y));const oe=J=>{const K=J.target;K&&(K.closest(`.${W.thumbsWrapper}`)||K.closest(`.${W.thumbsContainer}`))||f.type!=="slide"&&J.preventDefault()};return document.addEventListener("touchmove",oe,{passive:!1}),()=>{document.body.style.overflow=b,document.removeEventListener("touchmove",oe),E.current&&A.current&&(E.current.removeEventListener("animationend",A.current),A.current=null),d(!1)}},[e,i,w.color,f.type]),H.useEffect(()=>{if(!e)return;const b=D=>{var Y,oe;if(B.current){D.stopPropagation();return}if(j.current){j.current=!1;return}const X=D.target;if(!(X&&(X.closest(`.${W.thumbsContainer}`)||X.closest(`.${W.thumbItem}`)))){if(f.type==="slide"&&P.type==="drag"&&((oe=(Y=m.current)==null?void 0:Y.splide)!=null&&oe.root)){const J=m.current.splide.root;if(X&&(J.contains(X)||J===X))return}if(D.touches.length===0&&D.changedTouches.length>0){const J=n[l],K=(J==null?void 0:J.image.objectFit)==="cover",re=D.changedTouches[0];let ve;if(K&&z.current){const ce=so(z.current);ve=re.clientX>=ce.left&&re.clientX<=ce.right&&re.clientY>=ce.top&&re.clientY<=ce.bottom}else{const ce=z.current?lo(z.current):null;if(!ce)return;ve=re.clientX>=ce.x&&re.clientX<=ce.x+ce.width&&re.clientY>=ce.y&&re.clientY<=ce.y+ce.height}if(!ve){D.stopPropagation(),B.current=!0;const ce=ue=>{ue.stopPropagation(),ue.preventDefault(),document.removeEventListener("click",ce,!0)};document.addEventListener("click",ce,!0),Z()}}}};return document.addEventListener("touchend",b,{passive:!0}),()=>{document.removeEventListener("touchend",b)}},[e,Z,l,n]);const me=(f.type==="scale"||f.type==="fade")&&f.direction==="vert"&&P.type==="drag";H.useEffect(()=>{var ue,De;if(!e||!me||!((De=(ue=m.current)==null?void 0:ue.splide)!=null&&De.root))return;const b=m.current.splide.root,D=30,X=(Q,te)=>{if(F.current){const be=Math.abs(Q-F.current.x),xe=Math.abs(te-F.current.y);(be>0||xe>0)&&(j.current=!0)}},Y=Q=>{F.current&&(Q.preventDefault(),X(Q.clientX,Q.clientY))},oe=Q=>{F.current&&Q.touches.length>0&&(Q.preventDefault(),X(Q.touches[0].clientX,Q.touches[0].clientY))},J=(Q,te)=>{if(!F.current||!m.current){F.current=null;return}const be=Math.abs(Q-F.current.x),xe=Math.abs(te-F.current.y);xe>D&&xe>be&&m.current.go(te<F.current.y?"+1":"-1"),F.current=null},K=Q=>{F.current&&J(Q.clientX,Q.clientY),document.removeEventListener("pointerup",K),document.removeEventListener("pointercancel",K),document.removeEventListener("pointermove",Y)},re=Q=>{if(F.current){if(Q.changedTouches.length>0){const te=Q.changedTouches[0];J(te.clientX,te.clientY)}document.removeEventListener("touchend",re),document.removeEventListener("touchcancel",re),document.removeEventListener("touchmove",oe)}},ve=Q=>{F.current={x:Q.clientX,y:Q.clientY},j.current=!1,document.addEventListener("pointermove",Y,{passive:!1}),document.addEventListener("pointerup",K),document.addEventListener("pointercancel",K)},ce=Q=>{Q.touches.length>0&&(F.current={x:Q.touches[0].clientX,y:Q.touches[0].clientY},j.current=!1,document.addEventListener("touchmove",oe,{passive:!1}),document.addEventListener("touchend",re),document.addEventListener("touchcancel",re))};return b.addEventListener("pointerdown",ve),b.addEventListener("touchstart",ce),()=>{b.removeEventListener("pointerdown",ve),b.removeEventListener("touchstart",ce),document.removeEventListener("pointermove",Y),document.removeEventListener("pointerup",K),document.removeEventListener("pointercancel",K),document.removeEventListener("touchmove",oe),document.removeEventListener("touchend",re),document.removeEventListener("touchcancel",re),F.current=null,j.current=!1}},[e,me,u]);const Ne={backgroundColor:w.color,backdropFilter:`blur(${w.blur}px)`,animationDuration:`${parseInt(U.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return document.getElementById(a)?ar.createPortal(S.jsxs(S.Fragment,{children:[S.jsx("div",{ref:i?null:E,className:pe(W.background,y?ne:ie,{[W.editor]:i},{[W.hidden]:!e}),style:{...Ne,...s&&!i&&!y?{position:"absolute"}:{}}}),S.jsxs("div",{ref:i?E:null,className:pe(W.contentStyle,y?le:q,{[W.editor]:i},{[W.hidden]:!e}),style:{animationDuration:`${parseInt(U.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[S.jsx(Zo,{onMove:b=>p(b.index),ref:m,className:W.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:P.type==="drag"&&!me,perPage:1,width:"100%",height:"100%",type:f.type==="fade"||f.type==="scale"?"fade":"loop",padding:0,rewind:P.repeat!=="close",start:0},style:{"--splide-speed":f.duration},children:n.map((b,D)=>{const X=Nt(O.position,O.offset,i),Y=`${I.scalingValue(O.padding.top,i)} ${I.scalingValue(O.padding.right,i)} ${I.scalingValue(O.padding.bottom,i)} ${I.scalingValue(O.padding.left,i)}`,oe=f.type==="scale"?(()=>{const{transform:J,...K}=X;return{...K,position:"absolute",padding:Y,boxSizing:"border-box","--position-transform":J||"none"}})():{...X,position:"absolute",padding:Y,boxSizing:"border-box"};return S.jsx(Qo,{children:S.jsx("div",{className:W.imgWrapper,onClick:ae,children:S.jsx("img",{ref:D===l?z:null,className:pe(W.imageStyle,{[W.contain]:b.image.objectFit==="contain",[W.cover]:b.image.objectFit==="cover",[W.scaleSlide]:f.type==="scale"}),src:b.image.url,alt:b.image.name??"",style:{...oe,pointerEvents:b.image.objectFit==="contain"?"none":"auto"}})})},D)})},u),$.isActive&&S.jsxs(S.Fragment,{children:[S.jsx("div",{className:pe(W.arrow,{[W.arrowVertical]:f.direction==="vert"}),style:{color:$.color,"--arrow-hover-color":$.hover},children:S.jsxs("button",{className:W.arrowInner,style:{transform:`translate(${I.scalingValue($.offset.x,i)}, ${I.scalingValue($.offset.y*(f.direction==="horiz"?1:-1),i)}) scale(${$.scale}) rotate(${f.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var b;return(b=m.current)==null?void 0:b.go("-1")},"aria-label":"Previous",children:[$.arrowsImgUrl&&S.jsx(vt,{url:$.arrowsImgUrl,fill:$.color,hoverFill:$.hover,className:pe(W.arrowImg,W.mirror)}),!$.arrowsImgUrl&&S.jsx(uo,{color:$.color,className:pe(W.arrowIcon,W.arrowImg,W.mirror)})]})}),S.jsx("div",{className:pe(W.arrow,W.nextArrow,{[W.arrowVertical]:f.direction==="vert"}),style:{color:$.color,"--arrow-hover-color":$.hover},children:S.jsxs("button",{className:W.arrowInner,style:{transform:`translate(${I.scalingValue($.offset.x*(f.direction==="horiz"?-1:1),i)}, ${I.scalingValue($.offset.y,i)}) scale(${$.scale}) rotate(${f.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var b;return(b=m.current)==null?void 0:b.go("+1")},"aria-label":"Next",children:[$.arrowsImgUrl&&S.jsx(vt,{url:$.arrowsImgUrl,fill:$.color,hoverFill:$.hover,className:W.arrowImg}),!$.arrowsImgUrl&&S.jsx(uo,{color:$.color,className:pe(W.arrowIcon,W.arrowImg)})]})})]}),w.closeIconUrl&&(()=>{const b=Nt(w.closeIconAlign,w.closeIconOffset,i),D=`scale(${w.closeIconScale})`,X=b.transform?`${b.transform} ${D}`:D;return S.jsx("button",{className:W.closeButton,style:{...b,transform:X},onClick:Z,"aria-label":"Close lightbox",children:S.jsx(vt,{url:w.closeIconUrl,fill:w.closeIconColor??"#000000",hoverFill:w.closeIconHover??"#cccccc"})})})(),x&&x.isActive&&o.imageCaption&&((M=n[l])==null?void 0:M.imageCaption)&&(()=>{const{widthSettings:b,fontSettings:D,letterSpacing:X,textAlign:Y,wordSpacing:oe,fontSizeLineHeight:J,textAppearance:K,color:re}=o.imageCaption;return S.jsx("div",{className:W.caption,style:{...Nt(x.alignment,x.offset,i),fontFamily:D.fontFamily,fontWeight:D.fontWeight,fontStyle:D.fontStyle,width:b.sizing==="auto"?"max-content":I.scalingValue(b.width,i),letterSpacing:I.scalingValue(X,i),wordSpacing:I.scalingValue(oe,i),textAlign:Y,fontSize:I.scalingValue(J.fontSize,i),lineHeight:I.scalingValue(J.lineHeight,i),textTransform:K.textTransform??"none",textDecoration:K.textDecoration??"none",fontVariant:K.fontVariant??"normal",color:re},onClick:ve=>ve.stopPropagation(),children:S.jsx("div",{"data-styles":"imageCaption",className:W.captionTextInner,style:{"--link-color":x.linkColor,"--link-hover-color":x.linkHoverColor},children:S.jsx(er,{content:n[l].imageCaption})})})})(),R.isActive&&(()=>{const[b,D]=R.position.split("-"),X=f.direction==="horiz"?`${b}-left`:R.position,Y=Nt(X,R.offset,i),oe=()=>{if(f.direction==="horiz"){if(D==="left")return"flex-start";if(D==="center")return"center";if(D==="right")return"flex-end"}else{if(b==="top")return"flex-start";if(b==="middle")return"center";if(b==="bottom")return"flex-end"}return"flex-start"};return S.jsx("div",{ref:k,className:W.thumbsWrapper,onClick:J=>ge(J),style:{position:i?"absolute":"fixed",...Y,...f.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:S.jsx("div",{className:pe(W.thumbsContainer,{[W.thumbsContainerVertical]:f.direction==="vert",[W.thumbsAlignStart]:R.align==="start",[W.thumbsAlignCenter]:R.align==="center",[W.thumbsAlignEnd]:R.align==="end"}),style:{gap:I.scalingValue(R.grid.gap,i),justifyContent:V?"flex-start":oe()},children:n.map((J,K)=>{const re=K===l,ve=T[K],ue=R.grid.size*(re?R.activeState.scale:1),De=()=>{if(R.fit!=="fit")return{};if(!ve)return f.direction==="horiz"?{height:I.scalingValue(ue,i)}:{width:I.scalingValue(ue,i)};const Q=ve.width/ve.height;if(f.direction==="horiz"){const te=ue,be=te*Q;return{width:I.scalingValue(be,i),height:I.scalingValue(te,i)}}else{const te=ue,be=te/Q;return{width:I.scalingValue(te,i),height:I.scalingValue(be,i)}}};return S.jsx("button",{className:W.thumbItem,style:{...f.direction==="horiz"&&R.fit!=="fit"?{height:I.scalingValue(ue,i)}:{},...f.direction==="vert"&&R.fit!=="fit"?{width:I.scalingValue(ue,i)}:{},...R.fit==="cover"?{width:I.scalingValue(ue,i),height:I.scalingValue(ue,i)}:{},...De(),transition:re?"all 0.25s ease-out":"none",opacity:re?R.activeState.opacity/100:R.opacity/100,"--thumb-hover":R.activeState.opacity/100},onClick:Q=>{var te;Q.stopPropagation(),p(K),(te=m.current)==null||te.go(K)},onMouseEnter:()=>{var Q;R.triggers==="hov"&&((Q=m.current)==null||Q.go(K))},children:S.jsx("img",{src:J.image.url,alt:J.image.name??"",onLoad:Q=>{const te=Q.currentTarget;te.naturalWidth&&te.naturalHeight&&v(be=>({...be,[K]:{width:te.naturalWidth,height:te.naturalHeight}}))},style:{objectFit:R.fit==="cover"?"cover":"contain",...R.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...R.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${J.image.name}-${K}`)})})})})()]})]}),document.getElementById(a)):null};function uo({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 sl={element:al,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/lightboxImg.png"},defaultSize:{width:440,height:550},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,defaultWidth:500},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input",minWidth:58,maxWidth:108},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",minWidth:300,maxWidth:550}}},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 rt(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function cl(e){return`
|
|
7
7
|
.${e}-wrapper {
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
@@ -91,6 +91,7 @@
|
|
|
91
91
|
.${e}-button {
|
|
92
92
|
cursor: pointer;
|
|
93
93
|
white-space: nowrap;
|
|
94
|
+
box-sizing: border-box;
|
|
94
95
|
outline: none;
|
|
95
96
|
background-color: var(--${e}-button-color);
|
|
96
97
|
color: var(--${e}-button-text-color);
|
|
@@ -136,7 +137,7 @@
|
|
|
136
137
|
position: relative;
|
|
137
138
|
height: auto;
|
|
138
139
|
}
|
|
139
|
-
`}function
|
|
140
|
+
`}function ul({settings:e,isEditor:t,metadata:n,activeEvent:o}){const{prefix:r}=I.useScopedStyles(),{type:a="A",fieldsToShow:i=2,fields:c=[],buttonLabel:l,gap:p,fieldsGap:u,buttonCorners:C,buttonStroke:y,buttonPadding:g,isButtonFullWidth:s,inputCorners:d,inputStroke:T,inputPadding:v,inputColor:m,inputTextColor:_,inputBorderColor:z,placeholderColor:B,buttonColor:E,buttonTextColor:h,buttonBorderColor:A,labelTextColor:F,successColor:j,errorColor:k,fontFamily:V,inputFontSettings:N,inputFontSize:U,inputLineHeight:P,inputLetterSpacing:f,inputWordSpacing:R,inputTextAppearance:$,buttonFontSettings:w,buttonFontSize:x,buttonLineHeight:O,buttonLetterSpacing:q,buttonWordSpacing:ie,buttonTextAppearance:ne,labelFontSettings:le,labelFontSize:L,labelLineHeight:Z,labelLetterSpacing:ye,labelWordSpacing:ae,labelTextAppearance:ge,successMessage:me,errorMessage:Ne,stateOverrides:M}=e,b=a==="B",D=c.slice(0,Math.min(i,c.length)),X={fontSettings:{fontFamily:V,fontWeight:(N==null?void 0:N.fontWeight)??400,fontStyle:(N==null?void 0:N.fontStyle)??"normal"},fontSize:U??.01,lineHeight:P,letterSpacing:f??0,wordSpacing:R??0,textAppearance:$},Y=pn(X,t),oe=I.scalingValue(T??0,t),J={...Y,borderStyle:"solid",borderRadius:a==="C"?0:I.scalingValue(d??0,t),borderWidth:a==="C"?void 0:oe,borderTopWidth:a==="C"?0:void 0,borderRightWidth:a==="C"?0:void 0,borderBottomWidth:a==="C"?oe:void 0,borderLeftWidth:a==="C"?0:void 0,paddingTop:I.scalingValue((v==null?void 0:v.top)??0,t),paddingRight:I.scalingValue((v==null?void 0:v.right)??0,t),paddingBottom:I.scalingValue((v==null?void 0:v.bottom)??0,t),paddingLeft:I.scalingValue((v==null?void 0:v.left)??0,t)},K={fontSettings:{fontFamily:V,fontWeight:(w==null?void 0:w.fontWeight)??400,fontStyle:(w==null?void 0:w.fontStyle)??"normal"},fontSize:x??.01,lineHeight:O,letterSpacing:q??0,wordSpacing:ie??0,textAppearance:ne},re=pn(K,t),ve=I.scalingValue(y??0,t),ce={fontSettings:{fontFamily:V,fontWeight:(le==null?void 0:le.fontWeight)??400,fontStyle:(le==null?void 0:le.fontStyle)??"normal"},fontSize:L??.01,lineHeight:Z,letterSpacing:ye??0,wordSpacing:ae??0,textAppearance:ge},ue=pn(ce,t),De=dl(r,{inputColor:m,inputTextColor:_,inputBorderColor:z,placeholderColor:B!=null&&B.trim()?B:"#cccccc",buttonColor:E,buttonTextColor:h,buttonBorderColor:A,labelTextColor:F,successColor:j,errorColor:k},M),[Q,te]=H.useState(()=>Object.fromEntries(D.map(fe=>[fe.name,""]))),[be,xe]=H.useState("idle"),[_e,ke]=H.useState(null),on=o==="success"?"success":o==="error"?"error":be,nr=o==="error"?Ne:_e,rn=o==="filled"?Object.fromEntries(D.map(fe=>[fe.name,"Filled"])):Q,or=on==="error"?I.getFormFieldValidationError(D,rn):null,rr=o&&o!=="default"?`${r}-state-${o}`:"",Dn=n==null?void 0:n.submitUrl,Hn=(fe,tt)=>{te(He=>({...He,[fe]:tt}))},ir=async fe=>{fe.preventDefault();const tt=Object.fromEntries(D.map(Ae=>{var nt;return[Ae.name,((nt=Q[Ae.name])==null?void 0:nt.trim())??""]}).filter(([,Ae])=>Ae));if(!Dn||Object.keys(tt).length===0)return;const He=I.getFormFieldValidationError(D,Q);if(He){xe("error"),ke(He);return}xe("submitting"),ke(null);try{const Ae=await fetch(Dn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(tt)});if(!Ae.ok){const nt=await Ae.text();throw new Error(nt||`Request failed: ${Ae.status}`)}xe("success"),te(Object.fromEntries(D.map(nt=>[nt.name,""])))}catch(Ae){xe("error"),ke(Ae instanceof Error?Ae.message:"Something went wrong")}};return S.jsxs("div",{className:`${r}-wrapper ${r}-type-${a} ${rr}`.trim(),style:De,children:[S.jsx("style",{children:cl(r)}),S.jsxs("form",{onSubmit:ir,className:`${r}-form`,style:{gap:I.scalingValue(p??0,t)},children:[S.jsx("div",{className:`${r}-fields`,style:{gap:I.scalingValue(u??0,t)},children:D.map((fe,tt)=>S.jsxs("div",{className:`${r}-field-group${b?` ${r}-labeled`:""}`,children:[b&&S.jsx("span",{className:`${r}-field-label`,style:ue?{...ue,lineHeight:ue.fontSize}:void 0,children:fe.label||fe.name}),fe.type==="textarea"?S.jsx("textarea",{name:fe.name,autoComplete:"off",value:rn[fe.name]??"",onChange:He=>Hn(fe.name,He.target.value),placeholder:fe.placeholder,className:`${r}-input`,style:J,rows:1,"data-field-type":"textarea"}):S.jsx("input",{type:fe.type==="phone"?"tel":fe.type==="email"?"email":"text",name:fe.name,autoComplete:"off",value:rn[fe.name]??"",onChange:He=>Hn(fe.name,He.target.value),placeholder:fe.placeholder,required:fe.type==="email",className:`${r}-input`,style:J})]},tt))}),S.jsx("div",{className:`${r}-overlay-anchor`,children:S.jsx("button",{type:"submit",className:`${r}-button`,style:{borderStyle:"solid",borderRadius:a==="C"?0:I.scalingValue(C??0,t),borderWidth:a==="C"?void 0:ve,borderTopWidth:a==="C"?0:void 0,borderRightWidth:a==="C"?0:void 0,borderBottomWidth:a==="C"?ve:void 0,borderLeftWidth:a==="C"?0:void 0,paddingTop:I.scalingValue((g==null?void 0:g.top)??0,t),paddingRight:I.scalingValue((g==null?void 0:g.right)??0,t),paddingBottom:I.scalingValue((g==null?void 0:g.bottom)??0,t),paddingLeft:I.scalingValue((g==null?void 0:g.left)??0,t),...re,...s?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:S.jsx("span",{className:`${r}-overlay-anchor`,style:s?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:be==="submitting"?"...":l})})})]}),on==="success"&&S.jsx("p",{className:`${r}-success`,style:{...Y,lineHeight:Y==null?void 0:Y.fontSize},children:me}),on==="error"&&S.jsx("p",{className:`${r}-error`,style:{...Y,lineHeight:Y==null?void 0:Y.fontSize},role:"alert",children:or??nr??Ne})]})}const po={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"},pl=["hover","focus","filled","success","error"];function dl(e,t,n){const o={};for(const[r,a]of Object.entries(po))o[`--${e}-${a}`]=t[r];if(n)for(const r of pl){const a=n[r];if(a)for(const[i,c]of Object.entries(po)){const l=a[i];l!==void 0&&(o[`--${e}-${r}-${c}`]=l)}}return o}function pn(e,t){var n,o,r;return{fontFamily:e.fontSettings.fontFamily,fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:I.scalingValue(e.letterSpacing,t),wordSpacing:I.scalingValue(e.wordSpacing,t),fontSize:I.scalingValue(e.fontSize,t),lineHeight:e.lineHeight!==void 0?I.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}}const gl=`import React, { useState } from 'react';
|
|
140
141
|
import { CommonComponentProps } from '../props';
|
|
141
142
|
import { getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
142
143
|
|
|
@@ -233,6 +234,7 @@ function getCSS(P: string): string {
|
|
|
233
234
|
.\${P}-button {
|
|
234
235
|
cursor: pointer;
|
|
235
236
|
white-space: nowrap;
|
|
237
|
+
box-sizing: border-box;
|
|
236
238
|
outline: none;
|
|
237
239
|
background-color: var(--\${P}-button-color);
|
|
238
240
|
color: var(--\${P}-button-text-color);
|
|
@@ -296,13 +298,14 @@ export function Form({ settings, isEditor, metadata, activeEvent }: FormProps) {
|
|
|
296
298
|
fieldsToShow = 2,
|
|
297
299
|
fields = [],
|
|
298
300
|
buttonLabel,
|
|
299
|
-
gap
|
|
300
|
-
fieldsGap
|
|
301
|
+
gap,
|
|
302
|
+
fieldsGap,
|
|
301
303
|
buttonCorners,
|
|
302
304
|
buttonStroke,
|
|
305
|
+
buttonPadding,
|
|
306
|
+
isButtonFullWidth,
|
|
303
307
|
inputCorners,
|
|
304
308
|
inputStroke,
|
|
305
|
-
buttonPadding,
|
|
306
309
|
inputPadding,
|
|
307
310
|
inputColor,
|
|
308
311
|
inputTextColor,
|
|
@@ -481,11 +484,11 @@ export function Form({ settings, isEditor, metadata, activeEvent }: FormProps) {
|
|
|
481
484
|
<form
|
|
482
485
|
onSubmit={handleSubmit}
|
|
483
486
|
className={\`\${P}-form\`}
|
|
484
|
-
style={{ gap: scalingValue(gap, isEditor) }}
|
|
487
|
+
style={{ gap: scalingValue(gap ?? 0, isEditor) }}
|
|
485
488
|
>
|
|
486
489
|
<div
|
|
487
490
|
className={\`\${P}-fields\`}
|
|
488
|
-
style={{ gap: scalingValue(fieldsGap, isEditor) }}
|
|
491
|
+
style={{ gap: scalingValue(fieldsGap ?? 0, isEditor) }}
|
|
489
492
|
>
|
|
490
493
|
{visibleFields.map((field, index) => (
|
|
491
494
|
<div key={index} className={\`\${P}-field-group\${showLabels ? \` \${P}-labeled\` : ''}\`}>
|
|
@@ -539,9 +542,26 @@ export function Form({ settings, isEditor, metadata, activeEvent }: FormProps) {
|
|
|
539
542
|
paddingBottom: scalingValue(buttonPadding?.bottom ?? 0, isEditor),
|
|
540
543
|
paddingLeft: scalingValue(buttonPadding?.left ?? 0, isEditor),
|
|
541
544
|
...buttonTextCss,
|
|
545
|
+
...(isButtonFullWidth
|
|
546
|
+
? {
|
|
547
|
+
width: '100%',
|
|
548
|
+
textAlign: 'center',
|
|
549
|
+
whiteSpace: 'normal',
|
|
550
|
+
}
|
|
551
|
+
: {}),
|
|
542
552
|
}}
|
|
543
553
|
>
|
|
544
|
-
<span
|
|
554
|
+
<span
|
|
555
|
+
className={\`\${P}-overlay-anchor\`}
|
|
556
|
+
style={isButtonFullWidth
|
|
557
|
+
? {
|
|
558
|
+
display: 'inline-block',
|
|
559
|
+
maxWidth: '100%',
|
|
560
|
+
whiteSpace: 'normal',
|
|
561
|
+
textAlign: 'center',
|
|
562
|
+
}
|
|
563
|
+
: undefined}
|
|
564
|
+
>
|
|
545
565
|
{status === 'submitting' ? '...' : buttonLabel}
|
|
546
566
|
</span>
|
|
547
567
|
</button>
|
|
@@ -644,17 +664,18 @@ type FormSettings = {
|
|
|
644
664
|
labelTextAppearance?: TextStyles['textAppearance'];
|
|
645
665
|
buttonCorners?: number;
|
|
646
666
|
buttonStroke?: number;
|
|
667
|
+
buttonPadding?: Padding;
|
|
668
|
+
isButtonFullWidth?: boolean;
|
|
647
669
|
inputCorners?: number;
|
|
648
670
|
inputStroke?: number;
|
|
649
|
-
buttonPadding?: Padding;
|
|
650
671
|
inputPadding?: Padding;
|
|
651
672
|
inputColor: string;
|
|
652
673
|
inputTextColor: string;
|
|
653
674
|
inputBorderColor: string;
|
|
654
|
-
placeholderColor: string;
|
|
655
675
|
buttonColor: string;
|
|
656
676
|
buttonTextColor: string;
|
|
657
677
|
buttonBorderColor: string;
|
|
678
|
+
placeholderColor: string;
|
|
658
679
|
labelTextColor: string;
|
|
659
680
|
successColor: string;
|
|
660
681
|
errorColor: string;
|
|
@@ -716,7 +737,7 @@ function textStylesToCss(textStyles: TextStyles, isEditor?: boolean): React.CSSP
|
|
|
716
737
|
fontVariant: textStyles.textAppearance?.fontVariant
|
|
717
738
|
};
|
|
718
739
|
}
|
|
719
|
-
`,gl=[{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"}],pn={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},fl=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],ml={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"number"},min:1,max:8},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"},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"},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"},min:0,max:100},inputColor:{type:"string",scope:"layout",title:"Input Color",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"layout",title:"Input Text Color",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"layout",title:"Input Border Color",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"layout",title:"Placeholder Color",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"layout",title:"Button Color",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"layout",title:"Button Text Color",display:{type:"palette-color-picker"}},buttonBorderColor:{type:"string",scope:"layout",title:"Button Border Color",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"layout",title:"Label Color",display:{type:"palette-color-picker",visible:!1}},successColor:{type:"string",scope:"layout",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"layout",title:"Error Message Color",display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"layout"},fontFamily:{type:"string",scope:"layout",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...pn.fontSettings,scope:"layout",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:{...pn.fontSettings,scope:"layout",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:{...pn.fontSettings,scope:"layout",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}}},defaults:{fieldsToShow:2,fields:gl,type:"A",inputColor:"#FFFFFF",inputTextColor:"#999999",inputBorderColor:"#0A00F8",placeholderColor:"#0A00F8",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",buttonBorderColor:"#0A00F8",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{},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"},buttonLabel:"Sign up",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."},layoutDefaults:{m:{gap:.032,fieldsGap:.032,buttonStroke:.0026,buttonCorners:.192,inputStroke:.0026,inputCorners:.192,buttonPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputFontSize:.0373,inputLineHeight:.0373,buttonFontSize:.0373,buttonLineHeight:.0373,labelFontSize:.0373,labelLineHeight:.0373},d:{gap:.0083,fieldsGap:.0083,buttonStroke:.001,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}},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.visible",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.visible",value:!1}}]},panels:[{id:"general",icon:"cursor",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:"row",title:"Button",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:"Input",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"Button",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"Label",items:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...fl],panelIds:["general","typeStyle"],stateItems:{default:["inputColor","inputBorderColor","placeholderColor","placeholderTextColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor"],hover:["inputColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor"],focus:["inputColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor"],filled:["inputColor","inputTextColor","inputBorderColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},yl={element:cl,id:"form",name:"Newsletter Stacked",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.png"},version:1,defaultSize:{width:400,height:42},schema:ml,sourceCode:dl};function Ot(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function hl(e){return`
|
|
740
|
+
`,fl=[{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"}],dn={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},ml=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],yl={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"number"},min:1,max:8},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"},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"},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"},min:0,max:100},inputColor:{type:"string",scope:"layout",title:"Input Color",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"layout",title:"Input Text Color",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"layout",title:"Input Border Color",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"layout",title:"Placeholder Color",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"layout",title:"Button Color",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"layout",title:"Button Text Color",display:{type:"palette-color-picker"}},isButtonFullWidth:{type:"boolean",scope:"layout",title:"Full Width",display:{type:"toggle",enum:["Full Width","Off"]}},buttonBorderColor:{type:"string",scope:"layout",title:"Button Border Color",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"layout",title:"Label Color",display:{type:"palette-color-picker",visible:!1}},successColor:{type:"string",scope:"layout",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"layout",title:"Error Message Color",display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"layout"},fontFamily:{type:"string",scope:"layout",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...dn.fontSettings,scope:"layout",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:{...dn.fontSettings,scope:"layout",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:{...dn.fontSettings,scope:"layout",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}}},defaults:{fieldsToShow:2,fields:fl,type:"A",inputColor:"#FFFFFF",inputTextColor:"#999999",inputBorderColor:"#0A00F8",placeholderColor:"#0A00F8",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",buttonBorderColor:"#0A00F8",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{},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"},isButtonFullWidth:!1,buttonLabel:"Sign up",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."},layoutDefaults:{m:{gap:.032,fieldsGap:.032,buttonStroke:.0026,buttonCorners:.192,inputStroke:.0026,inputCorners:.192,buttonPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputFontSize:.0373,inputLineHeight:.0373,buttonFontSize:.0373,buttonLineHeight:.0373,labelFontSize:.0373,labelLineHeight:.0373},d:{gap:.0083,fieldsGap:.0083,buttonStroke:.001,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}},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.visible",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.visible",value:!1}}]},panels:[{id:"general",icon:"cursor",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:"Input",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"Button",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"Label",items:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...ml],panelIds:["general","typeStyle"],stateItems:{default:["inputColor","inputBorderColor","placeholderColor","placeholderTextColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor"],hover:["inputColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor"],focus:["inputColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor"],filled:["inputColor","inputTextColor","inputBorderColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},hl={element:ul,id:"form",name:"Newsletter Stacked",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/formImg.png"},version:1,defaultSize:{width:400,height:42},schema:yl,sourceCode:gl};function Ot(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function vl(e){return`
|
|
720
741
|
.${e}-wrapper {
|
|
721
742
|
display: flex;
|
|
722
743
|
flex-direction: column;
|
|
@@ -879,4 +900,4 @@ function textStylesToCss(textStyles: TextStyles, isEditor?: boolean): React.CSSP
|
|
|
879
900
|
font-size: ${Ot(14)};
|
|
880
901
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
881
902
|
}
|
|
882
|
-
`}const vl=({settings:e,isEditor:t,metadata:n,activeEvent:o})=>{const{prefix:r}=k.useScopedStyles(),{fields:a=[{name:"email",type:"email",placeholder:"Your email"}],buttonContent:i,submitButtonContent:s,buttonLabel:l,buttonIcon:d,fieldsToShow:p=1,fontFamily:_,input:m,button:h,inputFontSettings:c,inputFontSize:u,inputLineHeight:b,inputLetterSpacing:$,inputWordSpacing:f,inputTextAppearance:w,buttonFontSettings:j,buttonFontSize:W,buttonLineHeight:E,buttonLetterSpacing:v,buttonWordSpacing:T,buttonTextAppearance:V,minHeight:z,corners:L,stroke:F,stateOverrides:O,inputPadding:U,buttonPadding:H,successMessage:g="Thanks for subscribing!",errorMessage:R="Please, fill all required fields."}=e,x=a.slice(0,Math.min(p,a.length)),[A,C]=D.useState(()=>Object.fromEntries(x.map(ne=>[ne.name,""]))),[N,q]=D.useState("idle"),[ie,Q]=D.useState(null),me=o==="success"?"success":o==="error"?"error":N,I=o==="error"?R:ie,K=o==="filled"?Object.fromEntries(x.map(ne=>[ne.name,"Filled"])):A,ye=me==="error"?k.getFormFieldValidationError(x,K):null,ae=o&&o!=="default"?`${r}-state-${o}`:"",pe=n==null?void 0:n.submitUrl,de=i,De=(de==null?void 0:de.mode)==="Icon"||(de==null?void 0:de.mode)==="Label"?de.mode:s==="Icon"?"Icon":"Label",M=de===void 0?l:de.label!==void 0?de.label:l,y=de===void 0?d:de.icon!==void 0?de.icon:d,P=M??"",G=y??"",J=De==="Icon",re=P||"Submit",Z=c||u!==void 0||b!==void 0||$!==void 0||f!==void 0||w!==void 0?{fontSettings:{fontFamily:_,fontWeight:(c==null?void 0:c.fontWeight)??400,fontStyle:(c==null?void 0:c.fontStyle)??"normal"},fontSize:u??.01,lineHeight:b,letterSpacing:$??0,wordSpacing:f??0,textAppearance:w,color:e.inputTextColor??"#111111"}:m?{...m,fontSettings:{...m.fontSettings,fontFamily:_??m.fontSettings.fontFamily},color:e.inputTextColor??m.color??"#111111"}:void 0,X=j||W!==void 0||E!==void 0||v!==void 0||T!==void 0||V!==void 0?{fontSettings:{fontFamily:_,fontWeight:(j==null?void 0:j.fontWeight)??400,fontStyle:(j==null?void 0:j.fontStyle)??"normal"},fontSize:W??.01,lineHeight:E,letterSpacing:v??0,wordSpacing:T??0,textAppearance:V,color:e.buttonTextColor??"#ffffff"}:h?{...h,fontSettings:{...h.fontSettings,fontFamily:_??h.fontSettings.fontFamily},color:e.buttonTextColor??h.color??"#ffffff"}:void 0,oe=Z?go(Z,t):void 0,be=X?go(X,t):void 0,le=Sl(r,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(Z==null?void 0:Z.color)??"#111111",buttonTextColor:e.buttonTextColor??(X==null?void 0:X.color)??"#ffffff"},O),ge={borderRadius:k.scalingValue(L,t),borderWidth:k.scalingValue(F,t),borderStyle:"solid"},ke={borderLeftWidth:k.scalingValue(F,t)},te=async ne=>{ne.preventDefault();const ve=Object.fromEntries(x.map(Se=>{var Re;return[Se.name,((Re=A[Se.name])==null?void 0:Re.trim())??""]}).filter(([,Se])=>Se));if(!pe||Object.keys(ve).length===0)return;const Te=k.getFormFieldValidationError(x,A);if(Te){q("error"),Q(Te);return}q("submitting"),Q(null);try{const Se=await fetch(pe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ve)});if(!Se.ok){const Re=await Se.text();throw new Error(Re||`Request failed: ${Se.status}`)}q("success"),C(Object.fromEntries(x.map(Re=>[Re.name,""])))}catch(Se){q("error"),Q(Se instanceof Error?Se.message:"Something went wrong")}};return S.jsxs("div",{className:`${r}-wrapper ${ae}`.trim(),style:le,children:[S.jsx("style",{children:hl(r)}),S.jsxs("form",{onSubmit:te,className:`${r}-form`,style:{...ge,height:k.scalingValue(z,t),minHeight:k.scalingValue(z,t)},children:[S.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:x.map(ne=>S.jsx("input",{type:ne.type==="email"?"email":ne.type==="phone"?"tel":"text",name:ne.name,autoComplete:"off",value:K[ne.name]??"",onChange:ve=>C(Te=>({...Te,[ne.name]:ve.target.value})),placeholder:ne.placeholder,required:ne.type==="email",className:`${r}-input`,style:{...oe,paddingRight:k.scalingValue(U.right,t),paddingLeft:k.scalingValue(U.left,t),paddingTop:k.scalingValue(U.top,t),paddingBottom:k.scalingValue(U.bottom,t)}},ne.name))}),S.jsx("div",{className:`${r}-overlayAnchor`,children:S.jsx("button",{type:"submit",className:`${r}-submitBtn`,"aria-label":re,style:{...be,...ke,paddingRight:k.scalingValue(H.right,t),paddingLeft:k.scalingValue(H.left,t),paddingTop:k.scalingValue(H.top,t),paddingBottom:k.scalingValue(H.bottom,t)},children:N==="submitting"?"...":J?G?S.jsx("img",{src:G,alt:"",draggable:!1}):null:P})})]}),me==="success"&&S.jsx("p",{className:`${r}-success`,style:{...oe,lineHeight:oe==null?void 0:oe.fontSize},children:g}),me==="error"&&S.jsx("p",{className:`${r}-error`,style:{...oe,lineHeight:oe==null?void 0:oe.fontSize},role:"alert",children:ye??I??R})]})},po={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"},bl=["hover","focus","filled","success","error"];function Sl(e,t,n){const o={};for(const[r,a]of Object.entries(po))o[`--${e}-${a}`]=t[r];if(n)for(const r of bl){const a=n[r];if(a)for(const[i,s]of Object.entries(po)){const l=a[i];l!==void 0&&(o[`--${e}-${r}-${s}`]=l)}}return o}function go(e,t){var n,o,r;return{fontFamily:e.fontSettings.fontFamily,fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:k.scalingValue(e.letterSpacing,t),wordSpacing:k.scalingValue(e.wordSpacing,t),fontSize:k.scalingValue(e.fontSize,t),lineHeight:e.lineHeight!==void 0?k.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}}const xl=[{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."}],fo={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Cl=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],_l={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"layout",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","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonContent:{type:"object",scope:"common",display:{type:"button-content-switch"},properties:{mode:{type:"string",enum:["Label","Icon"]},label:{type:["string","null"],title:"Label",message:"Subscribe",display:{type:"text-input"}},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},fontFamily:{type:"string",scope:"layout",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:"layout",title:"Border Color",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"layout",title:"Input Color",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"layout",title:"Input Text Color",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"layout",title:"Placeholder Color",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"layout",title:"Button Color",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"layout",title:"Button Text Color",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"layout",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"layout",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"layout",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"layout",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"layout"},inputFontSettings:{...fo.fontSettings,scope:"layout",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:{...fo.fontSettings,scope:"layout",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"}}},defaults:{fields:xl,fieldsToShow:1,buttonContent:{mode:"Icon",label:"Submit",icon:"https://cdn.cntrl.site/component-assets/arrow.svg"},fontFamily:"Arial",inputPadding:{right:.01,left:.01,top:.01,bottom:.01},buttonPadding:{right:.01,left:.01,top:.005,bottom:.005},minHeight:.028,corners:.05,stroke:.001,strokeColor:"#0A00F8",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#0A00F8",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{},inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputFontSize:.01,inputLineHeight:.01,inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonFontSize:.01,buttonLineHeight:.01,buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","fieldsToShow"]},{type:"row",items:["minHeight","corners"]},{type:"row",items:[{type:"group",title:"",items:["stroke","buttonContent"]},{type:"switcher",title:"Padding",options:{Input:["inputPadding"],Button:["buttonPadding"]}}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["fontFamily",{type:"group",title:"Input",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"Button",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","successMessage","errorMessage"]}],paletteBookmark:{items:[...Cl],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor"],hover:["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor"],focus:["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor"],filled:["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},wl={element:vl,id:"oneliner-form",name:"Newsletter Single Line",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/onelinerImg.png"},defaultSize:{width:"30%",height:60},schema:_l},$l=[da,ba,ll,yl,wl];exports.components=$l;exports.isSchemaV1=ar;
|
|
903
|
+
`}const bl=({settings:e,isEditor:t,metadata:n,activeEvent:o})=>{const{prefix:r}=I.useScopedStyles(),{fields:a=[{name:"email",type:"email",placeholder:"Your email"}],buttonContent:i,submitButtonContent:c,buttonLabel:l,buttonIcon:p,fieldsToShow:u=1,fontFamily:C,input:y,button:g,inputFontSettings:s,inputFontSize:d,inputLineHeight:T,inputLetterSpacing:v,inputWordSpacing:m,inputTextAppearance:_,buttonFontSettings:z,buttonFontSize:B,buttonLineHeight:E,buttonLetterSpacing:h,buttonWordSpacing:A,buttonTextAppearance:F,minHeight:j,corners:k,stroke:V,stateOverrides:N,inputPadding:U,buttonPadding:P,successMessage:f="Thanks for subscribing!",errorMessage:R="Please, fill all required fields."}=e,$=a.slice(0,Math.min(u,a.length)),[w,x]=H.useState(()=>Object.fromEntries($.map(te=>[te.name,""]))),[O,q]=H.useState("idle"),[ie,ne]=H.useState(null),le=o==="success"?"success":o==="error"?"error":O,L=o==="error"?R:ie,Z=o==="filled"?Object.fromEntries($.map(te=>[te.name,"Filled"])):w,ye=le==="error"?I.getFormFieldValidationError($,Z):null,ae=o&&o!=="default"?`${r}-state-${o}`:"",ge=n==null?void 0:n.submitUrl,me=i,Ne=(me==null?void 0:me.mode)==="Icon"||(me==null?void 0:me.mode)==="Label"?me.mode:c==="Icon"?"Icon":"Label",M=me===void 0?l:me.label!==void 0?me.label:l,b=me===void 0?p:me.icon!==void 0?me.icon:p,D=M??"",X=b??"",Y=Ne==="Icon",oe=D||"Submit",J=s||d!==void 0||T!==void 0||v!==void 0||m!==void 0||_!==void 0?{fontSettings:{fontFamily:C,fontWeight:(s==null?void 0:s.fontWeight)??400,fontStyle:(s==null?void 0:s.fontStyle)??"normal"},fontSize:d??.01,lineHeight:T,letterSpacing:v??0,wordSpacing:m??0,textAppearance:_,color:e.inputTextColor??"#111111"}:y?{...y,fontSettings:{...y.fontSettings,fontFamily:C??y.fontSettings.fontFamily},color:e.inputTextColor??y.color??"#111111"}:void 0,K=z||B!==void 0||E!==void 0||h!==void 0||A!==void 0||F!==void 0?{fontSettings:{fontFamily:C,fontWeight:(z==null?void 0:z.fontWeight)??400,fontStyle:(z==null?void 0:z.fontStyle)??"normal"},fontSize:B??.01,lineHeight:E,letterSpacing:h??0,wordSpacing:A??0,textAppearance:F,color:e.buttonTextColor??"#ffffff"}:g?{...g,fontSettings:{...g.fontSettings,fontFamily:C??g.fontSettings.fontFamily},color:e.buttonTextColor??g.color??"#ffffff"}:void 0,re=J?fo(J,t):void 0,ve=K?fo(K,t):void 0,ce=xl(r,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(J==null?void 0:J.color)??"#111111",buttonTextColor:e.buttonTextColor??(K==null?void 0:K.color)??"#ffffff"},N),ue={borderRadius:I.scalingValue(k,t),borderWidth:I.scalingValue(V,t),borderStyle:"solid"},De={borderLeftWidth:I.scalingValue(V,t)},Q=async te=>{te.preventDefault();const be=Object.fromEntries($.map(_e=>{var ke;return[_e.name,((ke=w[_e.name])==null?void 0:ke.trim())??""]}).filter(([,_e])=>_e));if(!ge||Object.keys(be).length===0)return;const xe=I.getFormFieldValidationError($,w);if(xe){q("error"),ne(xe);return}q("submitting"),ne(null);try{const _e=await fetch(ge,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(be)});if(!_e.ok){const ke=await _e.text();throw new Error(ke||`Request failed: ${_e.status}`)}q("success"),x(Object.fromEntries($.map(ke=>[ke.name,""])))}catch(_e){q("error"),ne(_e instanceof Error?_e.message:"Something went wrong")}};return S.jsxs("div",{className:`${r}-wrapper ${ae}`.trim(),style:ce,children:[S.jsx("style",{children:vl(r)}),S.jsxs("form",{onSubmit:Q,className:`${r}-form`,style:{...ue,height:I.scalingValue(j,t),minHeight:I.scalingValue(j,t)},children:[S.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:$.map(te=>S.jsx("input",{type:te.type==="email"?"email":te.type==="phone"?"tel":"text",name:te.name,autoComplete:"off",value:Z[te.name]??"",onChange:be=>x(xe=>({...xe,[te.name]:be.target.value})),placeholder:te.placeholder,required:te.type==="email",className:`${r}-input`,style:{...re,paddingRight:I.scalingValue(U.right,t),paddingLeft:I.scalingValue(U.left,t),paddingTop:I.scalingValue(U.top,t),paddingBottom:I.scalingValue(U.bottom,t)}},te.name))}),S.jsx("div",{className:`${r}-overlayAnchor`,children:S.jsx("button",{type:"submit",className:`${r}-submitBtn`,"aria-label":oe,style:{...ve,...De,paddingRight:I.scalingValue(P.right,t),paddingLeft:I.scalingValue(P.left,t),paddingTop:I.scalingValue(P.top,t),paddingBottom:I.scalingValue(P.bottom,t)},children:O==="submitting"?"...":Y?X?S.jsx("img",{src:X,alt:"",draggable:!1}):null:D})})]}),le==="success"&&S.jsx("p",{className:`${r}-success`,style:{...re,lineHeight:re==null?void 0:re.fontSize},children:f}),le==="error"&&S.jsx("p",{className:`${r}-error`,style:{...re,lineHeight:re==null?void 0:re.fontSize},role:"alert",children:ye??L??R})]})},go={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"},Sl=["hover","focus","filled","success","error"];function xl(e,t,n){const o={};for(const[r,a]of Object.entries(go))o[`--${e}-${a}`]=t[r];if(n)for(const r of Sl){const a=n[r];if(a)for(const[i,c]of Object.entries(go)){const l=a[i];l!==void 0&&(o[`--${e}-${r}-${c}`]=l)}}return o}function fo(e,t){var n,o,r;return{fontFamily:e.fontSettings.fontFamily,fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:I.scalingValue(e.letterSpacing,t),wordSpacing:I.scalingValue(e.wordSpacing,t),fontSize:I.scalingValue(e.fontSize,t),lineHeight:e.lineHeight!==void 0?I.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}}const Cl=[{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."}],mo={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},_l=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],wl={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"layout",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","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonContent:{type:"object",scope:"common",display:{type:"button-content-switch"},properties:{mode:{type:"string",enum:["Label","Icon"]},label:{type:["string","null"],title:"Label",message:"Subscribe",display:{type:"text-input"}},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},fontFamily:{type:"string",scope:"layout",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:"layout",title:"Border Color",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"layout",title:"Input Color",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"layout",title:"Input Text Color",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"layout",title:"Placeholder Color",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"layout",title:"Button Color",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"layout",title:"Button Text Color",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"layout",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"layout",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"layout",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"layout",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"layout"},inputFontSettings:{...mo.fontSettings,scope:"layout",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:{...mo.fontSettings,scope:"layout",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"}}},defaults:{fields:Cl,fieldsToShow:1,buttonContent:{mode:"Icon",label:"Submit",icon:"https://cdn.cntrl.site/component-assets/arrow.svg"},fontFamily:"Arial",inputPadding:{right:.01,left:.01,top:.01,bottom:.01},buttonPadding:{right:.01,left:.01,top:.005,bottom:.005},minHeight:.028,corners:.05,stroke:.001,strokeColor:"#0A00F8",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#0A00F8",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{},inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputFontSize:.01,inputLineHeight:.01,inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonFontSize:.01,buttonLineHeight:.01,buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","fieldsToShow"]},{type:"row",items:["minHeight","corners"]},{type:"row",items:[{type:"group",title:"",items:["stroke","buttonContent"]},{type:"switcher",title:"Padding",options:{Input:["inputPadding"],Button:["buttonPadding"]}}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["fontFamily",{type:"group",title:"Input",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"Button",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","successMessage","errorMessage"]}],paletteBookmark:{items:[..._l],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor"],hover:["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor"],focus:["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor"],filled:["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},$l={element:bl,id:"oneliner-form",name:"Newsletter Single Line",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/onelinerImg.png"},defaultSize:{width:"30%",height:60},schema:wl},Tl=[ga,Sa,sl,hl,$l];exports.components=Tl;exports.isSchemaV1=lr;
|