@cntrl-site/components 1.0.0 → 1.0.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Components/Form/Form.d.ts +12 -3
- package/dist/Components/OnelinerForm/OnelinerForm.d.ts +16 -1
- package/dist/components.css +1 -1
- package/dist/index.js +250 -83
- package/dist/index.mjs +2416 -1927
- package/dist/types/SchemaV1.d.ts +18 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,37 +1,26 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),D=require("react"),se=require("classnames"),B=require("./useScopedStyles-b8cb4EW8.js"),Hr=require("react-dom");function Ur(e){return e.type==="object"&&e.version===1}const Gr="ControlSlider-module__wrapper___sHEkd",Yr="ControlSlider-module__hoverArrow___A-dOH",Xr="ControlSlider-module__sliderItem___QQSkR",qr="ControlSlider-module__sliderImage___9hRl-",Kr="ControlSlider-module__arrow___05ghY",Jr="ControlSlider-module__arrowVertical___tBfVN",Zr="ControlSlider-module__nextArrow___-30Yc",Qr="ControlSlider-module__arrowInner___aEra3",ei="ControlSlider-module__arrowIcon___S4ztF",ti="ControlSlider-module__arrowImg___2dwJW",ni="ControlSlider-module__mirror___brd6U",ri="ControlSlider-module__pagination___bicLF",ii="ControlSlider-module__paginationInner___bT-P-",oi="ControlSlider-module__paginationVertical___zYqKw",ai="ControlSlider-module__paginationItem___nTRbk",li="ControlSlider-module__dot___p1Qun",si="ControlSlider-module__activeDot___LHFaj",ci="ControlSlider-module__paginationInsideBottom___R3FWn",ui="ControlSlider-module__paginationInsideTop___V-qb-",pi="ControlSlider-module__paginationOutsideBottom___14w8D",di="ControlSlider-module__paginationOutsideTop___SCLqB",gi="ControlSlider-module__paginationInsideLeft___yOBRZ",fi="ControlSlider-module__paginationInsideRight___Rtt3o",mi="ControlSlider-module__paginationOutsideLeft___lahaw",hi="ControlSlider-module__paginationOutsideRight___EtuQa",yi="ControlSlider-module__imgWrapper___UjEgB",vi="ControlSlider-module__captionBlock___dJ6-j",bi="ControlSlider-module__captionTextWrapper___HFlpf",_i="ControlSlider-module__captionText___uGBVc",Si="ControlSlider-module__active___WZK4G",xi="ControlSlider-module__withPointerEvents___t-18M",Ci="ControlSlider-module__topLeftAlignment___zjnGM",wi="ControlSlider-module__topCenterAlignment___gD1xW",Ei="ControlSlider-module__topRightAlignment___NMapS",Ai="ControlSlider-module__middleLeftAlignment___OnUrY",Ii="ControlSlider-module__middleCenterAlignment___Tdkl0",Ti="ControlSlider-module__middleRightAlignment___wEbfX",Li="ControlSlider-module__bottomLeftAlignment___cTP2-",Ri="ControlSlider-module__bottomCenterAlignment___c54fB",ki="ControlSlider-module__bottomRightAlignment___kEwrz",Ni="ControlSlider-module__clickOverlay___DZA28",ji="ControlSlider-module__contain___pLyq7",Oi="ControlSlider-module__cover___KdDat",U={wrapper:Gr,hoverArrow:Yr,sliderItem:Xr,sliderImage:qr,arrow:Kr,arrowVertical:Jr,nextArrow:Zr,arrowInner:Qr,arrowIcon:ei,arrowImg:ti,mirror:ni,pagination:ri,paginationInner:ii,paginationVertical:oi,paginationItem:ai,dot:li,activeDot:si,paginationInsideBottom:ci,paginationInsideTop:ui,paginationOutsideBottom:pi,paginationOutsideTop:di,paginationInsideLeft:gi,paginationInsideRight:fi,paginationOutsideLeft:mi,paginationOutsideRight:hi,imgWrapper:yi,captionBlock:vi,captionTextWrapper:bi,captionText:_i,active:Si,withPointerEvents:xi,topLeftAlignment:Ci,topCenterAlignment:wi,topRightAlignment:Ei,middleLeftAlignment:Ai,middleCenterAlignment:Ii,middleRightAlignment:Ti,bottomLeftAlignment:Li,bottomCenterAlignment:Ri,bottomRightAlignment:ki,clickOverlay:Ni,contain:ji,cover:Oi};function Vi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $i(e,t,n){return t&&Vi(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var On="(prefers-reduced-motion: reduce)",Qe=1,Pi=2,nt=3,ot=4,vt=5,Rt=6,Ot=7,Bi={CREATED:Qe,MOUNTED:Pi,IDLE:nt,MOVING:ot,SCROLLING:vt,DRAGGING:Rt,DESTROYED:Ot};function Ve(e){e.length=0}function De(e,t,n){return Array.prototype.slice.call(e,t,n)}function oe(e){return e.bind.apply(e,[null].concat(De(arguments,1)))}var ir=setTimeout,on=function(){};function Vn(e){return requestAnimationFrame(e)}function Ft(e,t){return typeof t===e}function pt(e){return!mn(e)&&Ft("object",e)}var fn=Array.isArray,or=oe(Ft,"function"),Fe=oe(Ft,"string"),bt=oe(Ft,"undefined");function mn(e){return e===null}function ar(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function _t(e){return fn(e)?e:[e]}function Ce(e,t){_t(e).forEach(t)}function hn(e,t){return e.indexOf(t)>-1}function kt(e,t){return e.push.apply(e,_t(t)),e}function Ne(e,t,n){e&&Ce(t,function(r){r&&e.classList[n?"add":"remove"](r)})}function Ie(e,t){Ne(e,Fe(t)?t.split(" "):t,!0)}function St(e,t){Ce(t,e.appendChild.bind(e))}function yn(e,t){Ce(e,function(n){var r=(t||n).parentNode;r&&r.insertBefore(n,t)})}function dt(e,t){return ar(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function lr(e,t){var n=e?De(e.children):[];return t?n.filter(function(r){return dt(r,t)}):n}function xt(e,t){return t?lr(e,t)[0]:e.firstElementChild}var gt=Object.keys;function Ue(e,t,n){return e&&(n?gt(e).reverse():gt(e)).forEach(function(r){r!=="__proto__"&&t(e[r],r)}),e}function ft(e){return De(arguments,1).forEach(function(t){Ue(t,function(n,r){e[r]=t[r]})}),e}function Be(e){return De(arguments,1).forEach(function(t){Ue(t,function(n,r){fn(n)?e[r]=n.slice():pt(n)?e[r]=Be({},pt(e[r])?e[r]:{},n):e[r]=n})}),e}function $n(e,t){Ce(t||gt(e),function(n){delete e[n]})}function Te(e,t){Ce(e,function(n){Ce(t,function(r){n&&n.removeAttribute(r)})})}function K(e,t,n){pt(t)?Ue(t,function(r,o){K(e,o,r)}):Ce(e,function(r){mn(n)||n===""?Te(r,t):r.setAttribute(t,String(n))})}function et(e,t,n){var r=document.createElement(e);return t&&(Fe(t)?Ie(r,t):K(r,t)),n&&St(n,r),r}function we(e,t,n){if(bt(n))return getComputedStyle(e)[t];mn(n)||(e.style[t]=""+n)}function mt(e,t){we(e,"display",t)}function sr(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Ee(e,t){return e.getAttribute(t)}function Pn(e,t){return e&&e.classList.contains(t)}function Se(e){return e.getBoundingClientRect()}function Ge(e){Ce(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function cr(e){return xt(new DOMParser().parseFromString(e,"text/html").body)}function ke(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function ur(e,t){return e&&e.querySelector(t)}function vn(e,t){return t?De(e.querySelectorAll(t)):[]}function je(e,t){Ne(e,t,!1)}function an(e){return e.timeStamp}function He(e){return Fe(e)?e:e?e+"px":""}var Ct="splide",bn="data-"+Ct;function st(e,t){if(!e)throw new Error("["+Ct+"] "+(t||""))}var ze=Math.min,Vt=Math.max,$t=Math.floor,ht=Math.ceil,be=Math.abs;function pr(e,t,n){return be(e-t)<n}function Nt(e,t,n,r){var o=ze(t,n),a=Vt(t,n);return r?o<e&&e<a:o<=e&&e<=a}function Je(e,t,n){var r=ze(t,n),o=Vt(t,n);return ze(Vt(r,e),o)}function ln(e){return+(e>0)-+(e<0)}function sn(e,t){return Ce(t,function(n){e=e.replace("%s",""+n)}),e}function _n(e){return e<10?"0"+e:""+e}var Bn={};function Fi(e){return""+e+_n(Bn[e]=(Bn[e]||0)+1)}function dr(){var e=[];function t(i,s,l,p){o(i,s,function(u,x,m){var h="addEventListener"in u,c=h?u.removeEventListener.bind(u,x,l,p):u.removeListener.bind(u,l);h?u.addEventListener(x,l,p):u.addListener(l),e.push([u,x,m,l,c])})}function n(i,s,l){o(i,s,function(p,u,x){e=e.filter(function(m){return m[0]===p&&m[1]===u&&m[2]===x&&(!l||m[3]===l)?(m[4](),!1):!0})})}function r(i,s,l){var p,u=!0;return typeof CustomEvent=="function"?p=new CustomEvent(s,{bubbles:u,detail:l}):(p=document.createEvent("CustomEvent"),p.initCustomEvent(s,u,!1,l)),i.dispatchEvent(p),p}function o(i,s,l){Ce(i,function(p){p&&Ce(s,function(u){u.split(" ").forEach(function(x){var m=x.split(".");l(p,m[0],m[1])})})})}function a(){e.forEach(function(i){i[4]()}),Ve(e)}return{bind:t,unbind:n,dispatch:r,destroy:a}}var We="mounted",cn="ready",$e="move",at="moved",Sn="click",gr="active",fr="inactive",mr="visible",hr="hidden",ge="refresh",ye="updated",rt="resize",zt="resized",yr="drag",vr="dragging",br="dragged",Dt="scroll",Xe="scrolled",zi="overflow",xn="destroy",_r="arrows:mounted",Sr="arrows:updated",xr="pagination:mounted",Cr="pagination:updated",Cn="navigation:mounted",wn="autoplay:play",wr="autoplay:playing",En="autoplay:pause",An="lazyload:loaded",Er="sk",Ar="sh",Pt="ei";function ce(e){var t=e?e.event.bus:document.createDocumentFragment(),n=dr();function r(a,i){n.bind(t,_t(a).join(" "),function(s){i.apply(i,fn(s.detail)?s.detail:[])})}function o(a){n.dispatch(t,a,De(arguments,1))}return e&&e.event.on(xn,n.destroy),ft(n,{bus:t,on:r,off:oe(n.unbind,t),emit:o})}function Wt(e,t,n,r){var o=Date.now,a,i=0,s,l=!0,p=0;function u(){if(!l){if(i=e?ze((o()-a)/e,1):1,n&&n(i),i>=1&&(t(),a=o(),r&&++p>=r))return m();s=Vn(u)}}function x(v){v||c(),a=o()-(v?i*e:0),l=!1,s=Vn(u)}function m(){l=!0}function h(){a=o(),i=0,n&&n(i)}function c(){s&&cancelAnimationFrame(s),i=0,s=0,l=!0}function d(v){e=v}function w(){return l}return{start:x,rewind:h,pause:m,cancel:c,set:d,isPaused:w}}function Di(e){var t=e;function n(o){t=o}function r(o){return hn(_t(o),t)}return{set:n,is:r}}function Wi(e,t){var n=Wt(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Mi(e,t,n){var r=e.state,o=n.breakpoints||{},a=n.reducedMotion||{},i=dr(),s=[];function l(){var c=n.mediaQuery==="min";gt(o).sort(function(d,w){return c?+d-+w:+w-+d}).forEach(function(d){u(o[d],"("+(c?"min":"max")+"-width:"+d+"px)")}),u(a,On),x()}function p(c){c&&i.destroy()}function u(c,d){var w=matchMedia(d);i.bind(w,"change",x),s.push([c,w])}function x(){var c=r.is(Ot),d=n.direction,w=s.reduce(function(v,g){return Be(v,g[1].matches?g[0]:{})},{});$n(n),h(w),n.destroy?e.destroy(n.destroy==="completely"):c?(p(!0),e.mount()):d!==n.direction&&e.refresh()}function m(c){matchMedia(On).matches&&(c?Be(n,a):$n(n,gt(a)))}function h(c,d,w){Be(n,c),d&&Be(Object.getPrototypeOf(n),c),(w||!r.is(Qe))&&e.emit(ye,n)}return{setup:l,destroy:p,reduce:m,set:h}}var Mt="Arrow",Ht=Mt+"Left",Ut=Mt+"Right",Ir=Mt+"Up",Tr=Mt+"Down",Fn="rtl",Gt="ttb",Kt={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Ir,Ut],ArrowRight:[Tr,Ht]};function Hi(e,t,n){function r(a,i,s){s=s||n.direction;var l=s===Fn&&!i?1:s===Gt?0:-1;return Kt[a]&&Kt[a][l]||a.replace(/width|left|right/i,function(p,u){var x=Kt[p.toLowerCase()][l]||p;return u>0?x.charAt(0).toUpperCase()+x.slice(1):x})}function o(a){return a*(n.direction===Fn?1:-1)}return{resolve:r,orient:o}}var Oe="role",tt="tabindex",Ui="disabled",Ae="aria-",wt=Ae+"controls",Lr=Ae+"current",zn=Ae+"selected",xe=Ae+"label",In=Ae+"labelledby",Rr=Ae+"hidden",Tn=Ae+"orientation",yt=Ae+"roledescription",Dn=Ae+"live",Wn=Ae+"busy",Mn=Ae+"atomic",Ln=[Oe,tt,Ui,wt,Lr,xe,In,Rr,Tn,yt],Le=Ct+"__",Me="is-",Jt=Ct,Hn=Le+"track",Gi=Le+"list",Yt=Le+"slide",kr=Yt+"--clone",Yi=Yt+"__container",Rn=Le+"arrows",Xt=Le+"arrow",Nr=Xt+"--prev",jr=Xt+"--next",qt=Le+"pagination",Or=qt+"__page",Xi=Le+"progress",qi=Xi+"__bar",Ki=Le+"toggle",Ji=Le+"spinner",Zi=Le+"sr",Qi=Me+"initialized",Ye=Me+"active",Vr=Me+"prev",$r=Me+"next",un=Me+"visible",pn=Me+"loading",Pr=Me+"focus-in",Br=Me+"overflow",eo=[Ye,un,Vr,$r,pn,Pr,Br],to={slide:Yt,clone:kr,arrows:Rn,arrow:Xt,prev:Nr,next:jr,pagination:qt,page:Or,spinner:Ji};function no(e,t){if(or(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!dt(n,t);)n=n.parentElement;return n}var ro=5,Un=200,Fr="touchstart mousedown",Zt="touchmove mousemove",Qt="touchend touchcancel mouseup click";function io(e,t,n){var r=ce(e),o=r.on,a=r.bind,i=e.root,s=n.i18n,l={},p=[],u=[],x=[],m,h,c;function d(){C(),W(),g()}function w(){o(ge,v),o(ge,d),o(ye,g),a(document,Fr+" keydown",function(y){c=y.type==="keydown"},{capture:!0}),a(i,"focusin",function(){Ne(i,Pr,!!c)})}function v(y){var A=Ln.concat("style");Ve(p),je(i,u),je(m,x),Te([m,h],A),Te(i,y?A:["style",yt])}function g(){je(i,u),je(m,x),u=I(Jt),x=I(Hn),Ie(i,u),Ie(m,x),K(i,xe,n.label),K(i,In,n.labelledby)}function C(){m=F("."+Hn),h=xt(m,"."+Gi),st(m&&h,"A track/list element is missing."),kt(p,lr(h,"."+Yt+":not(."+kr+")")),Ue({arrows:Rn,pagination:qt,prev:Nr,next:jr,bar:qi,toggle:Ki},function(y,A){l[A]=F("."+y)}),ft(l,{root:i,track:m,list:h,slides:p})}function W(){var y=i.id||Fi(Ct),A=n.role;i.id=y,m.id=m.id||y+"-track",h.id=h.id||y+"-list",!Ee(i,Oe)&&i.tagName!=="SECTION"&&A&&K(i,Oe,A),K(i,yt,s.carousel),K(h,Oe,"presentation")}function F(y){var A=ur(i,y);return A&&no(A,"."+Jt)===i?A:void 0}function I(y){return[y+"--"+n.type,y+"--"+n.direction,n.drag&&y+"--draggable",n.isNavigation&&y+"--nav",y===Jt&&Ye]}return ft(l,{setup:d,mount:w,destroy:v})}var it="slide",lt="loop",Et="fade";function oo(e,t,n,r){var o=ce(e),a=o.on,i=o.emit,s=o.bind,l=e.Components,p=e.root,u=e.options,x=u.isNavigation,m=u.updateOnMove,h=u.i18n,c=u.pagination,d=u.slideFocus,w=l.Direction.resolve,v=Ee(r,"style"),g=Ee(r,xe),C=n>-1,W=xt(r,"."+Yi),F;function I(){C||(r.id=p.id+"-slide"+_n(t+1),K(r,Oe,c?"tabpanel":"group"),K(r,yt,h.slide),K(r,xe,g||sn(h.slideLabel,[t+1,e.length]))),y()}function y(){s(r,"click",oe(i,Sn,T)),s(r,"keydown",oe(i,Er,T)),a([at,Ar,Xe],E),a(Cn,k),m&&a($e,$)}function A(){F=!0,o.destroy(),je(r,eo),Te(r,Ln),K(r,"style",v),K(r,xe,g||"")}function k(){var R=e.splides.map(function(S){var j=S.splide.Components.Slides.getAt(t);return j?j.slide.id:""}).join(" ");K(r,xe,sn(h.slideX,(C?n:t)+1)),K(r,wt,R),K(r,Oe,d?"button":""),d&&Te(r,yt)}function $(){F||E()}function E(){if(!F){var R=e.index;O(),V(),Ne(r,Vr,t===R-1),Ne(r,$r,t===R+1)}}function O(){var R=M();R!==Pn(r,Ye)&&(Ne(r,Ye,R),K(r,Lr,x&&R||""),i(R?gr:fr,T))}function V(){var R=f(),S=!R&&(!M()||C);if(e.state.is([ot,vt])||K(r,Rr,S||""),K(vn(r,u.focusableNodes||""),tt,S?-1:""),d&&K(r,tt,S?-1:0),R!==Pn(r,un)&&(Ne(r,un,R),i(R?mr:hr,T)),!R&&document.activeElement===r){var j=l.Slides.getAt(e.index);j&&sr(j.slide)}}function G(R,S,j){we(j&&W||r,R,S)}function M(){var R=e.index;return R===t||u.cloneStatus&&R===n}function f(){if(e.is(Et))return M();var R=Se(l.Elements.track),S=Se(r),j=w("left",!0),Y=w("right",!0);return $t(R[j])<=ht(S[j])&&$t(S[Y])<=ht(R[Y])}function N(R,S){var j=be(R-t);return!C&&(u.rewind||e.is(lt))&&(j=ze(j,e.length-j)),j<=S}var T={index:t,slideIndex:n,slide:r,container:W,isClone:C,mount:I,destroy:A,update:E,style:G,isWithin:N};return T}function ao(e,t,n){var r=ce(e),o=r.on,a=r.emit,i=r.bind,s=t.Elements,l=s.slides,p=s.list,u=[];function x(){m(),o(ge,h),o(ge,m)}function m(){l.forEach(function(E,O){d(E,O,-1)})}function h(){F(function(E){E.destroy()}),Ve(u)}function c(){F(function(E){E.update()})}function d(E,O,V){var G=oo(e,O,V,E);G.mount(),u.push(G),u.sort(function(M,f){return M.index-f.index})}function w(E){return E?I(function(O){return!O.isClone}):u}function v(E){var O=t.Controller,V=O.toIndex(E),G=O.hasFocus()?1:n.perPage;return I(function(M){return Nt(M.index,V,V+G-1)})}function g(E){return I(E)[0]}function C(E,O){Ce(E,function(V){if(Fe(V)&&(V=cr(V)),ar(V)){var G=l[O];G?yn(V,G):St(p,V),Ie(V,n.classes.slide),A(V,oe(a,rt))}}),a(ge)}function W(E){Ge(I(E).map(function(O){return O.slide})),a(ge)}function F(E,O){w(O).forEach(E)}function I(E){return u.filter(or(E)?E:function(O){return Fe(E)?dt(O.slide,E):hn(_t(E),O.index)})}function y(E,O,V){F(function(G){G.style(E,O,V)})}function A(E,O){var V=vn(E,"img"),G=V.length;G?V.forEach(function(M){i(M,"load error",function(){--G||O()})}):O()}function k(E){return E?l.length:u.length}function $(){return u.length>n.perPage}return{mount:x,destroy:h,update:c,register:d,get:w,getIn:v,getAt:g,add:C,remove:W,forEach:F,filter:I,style:y,getLength:k,isEnough:$}}function lo(e,t,n){var r=ce(e),o=r.on,a=r.bind,i=r.emit,s=t.Slides,l=t.Direction.resolve,p=t.Elements,u=p.root,x=p.track,m=p.list,h=s.getAt,c=s.style,d,w,v;function g(){C(),a(window,"resize load",Wi(oe(i,rt))),o([ye,ge],C),o(rt,W)}function C(){d=n.direction===Gt,we(u,"maxWidth",He(n.width)),we(x,l("paddingLeft"),F(!1)),we(x,l("paddingRight"),F(!0)),W(!0)}function W(T){var R=Se(u);(T||w.width!==R.width||w.height!==R.height)&&(we(x,"height",I()),c(l("marginRight"),He(n.gap)),c("width",A()),c("height",k(),!0),w=R,i(zt),v!==(v=N())&&(Ne(u,Br,v),i(zi,v)))}function F(T){var R=n.padding,S=l(T?"right":"left");return R&&He(R[S]||(pt(R)?0:R))||"0px"}function I(){var T="";return d&&(T=y(),st(T,"height or heightRatio is missing."),T="calc("+T+" - "+F(!1)+" - "+F(!0)+")"),T}function y(){return He(n.height||Se(m).width*n.heightRatio)}function A(){return n.autoWidth?null:He(n.fixedWidth)||(d?"":$())}function k(){return He(n.fixedHeight)||(d?n.autoHeight?null:$():y())}function $(){var T=He(n.gap);return"calc((100%"+(T&&" + "+T)+")/"+(n.perPage||1)+(T&&" - "+T)+")"}function E(){return Se(m)[l("width")]}function O(T,R){var S=h(T||0);return S?Se(S.slide)[l("width")]+(R?0:M()):0}function V(T,R){var S=h(T);if(S){var j=Se(S.slide)[l("right")],Y=Se(m)[l("left")];return be(j-Y)+(R?0:M())}return 0}function G(T){return V(e.length-1)-V(0)+O(0,T)}function M(){var T=h(0);return T&&parseFloat(we(T.slide,l("marginRight")))||0}function f(T){return parseFloat(we(x,l("padding"+(T?"Right":"Left"))))||0}function N(){return e.is(Et)||G(!0)>E()}return{mount:g,resize:W,listSize:E,slideSize:O,sliderSize:G,totalSize:V,getPadding:f,isOverflow:N}}var so=2;function co(e,t,n){var r=ce(e),o=r.on,a=t.Elements,i=t.Slides,s=t.Direction.resolve,l=[],p;function u(){o(ge,x),o([ye,rt],h),(p=w())&&(c(p),t.Layout.resize(!0))}function x(){m(),u()}function m(){Ge(l),Ve(l),r.destroy()}function h(){var v=w();p!==v&&(p<v||!v)&&r.emit(ge)}function c(v){var g=i.get().slice(),C=g.length;if(C){for(;g.length<v;)kt(g,g);kt(g.slice(-v),g.slice(0,v)).forEach(function(W,F){var I=F<v,y=d(W.slide,F);I?yn(y,g[0].slide):St(a.list,y),kt(l,y),i.register(y,F-v+(I?0:C),W.index)})}}function d(v,g){var C=v.cloneNode(!0);return Ie(C,n.classes.clone),C.id=e.root.id+"-clone"+_n(g+1),C}function w(){var v=n.clones;if(!e.is(lt))v=0;else if(bt(v)){var g=n[s("fixedWidth")]&&t.Layout.slideSize(0),C=g&&ht(Se(a.track)[s("width")]/g);v=C||n[s("autoWidth")]&&e.length||n.perPage*so}return v}return{mount:u,destroy:m}}function uo(e,t,n){var r=ce(e),o=r.on,a=r.emit,i=e.state.set,s=t.Layout,l=s.slideSize,p=s.getPadding,u=s.totalSize,x=s.listSize,m=s.sliderSize,h=t.Direction,c=h.resolve,d=h.orient,w=t.Elements,v=w.list,g=w.track,C;function W(){C=t.Transition,o([We,zt,ye,ge],F)}function F(){t.Controller.isBusy()||(t.Scroll.cancel(),y(e.index),t.Slides.update())}function I(S,j,Y,re){S!==j&&T(S>Y)&&(E(),A($(G(),S>Y),!0)),i(ot),a($e,j,Y,S),C.start(j,function(){i(nt),a(at,j,Y,S),re&&re()})}function y(S){A(V(S,!0))}function A(S,j){if(!e.is(Et)){var Y=j?S:k(S);we(v,"transform","translate"+c("X")+"("+Y+"px)"),S!==Y&&a(Ar)}}function k(S){if(e.is(lt)){var j=O(S),Y=j>t.Controller.getEnd(),re=j<0;(re||Y)&&(S=$(S,Y))}return S}function $(S,j){var Y=S-N(j),re=m();return S-=d(re*(ht(be(Y)/re)||1))*(j?1:-1),S}function E(){A(G(),!0),C.cancel()}function O(S){for(var j=t.Slides.get(),Y=0,re=1/0,ne=0;ne<j.length;ne++){var me=j[ne].index,L=be(V(me,!0)-S);if(L<=re)re=L,Y=me;else break}return Y}function V(S,j){var Y=d(u(S-1)-f(S));return j?M(Y):Y}function G(){var S=c("left");return Se(v)[S]-Se(g)[S]+d(p(!1))}function M(S){return n.trimSpace&&e.is(it)&&(S=Je(S,0,d(m(!0)-x()))),S}function f(S){var j=n.focus;return j==="center"?(x()-l(S,!0))/2:+j*l(S)||0}function N(S){return V(S?t.Controller.getEnd():0,!!n.trimSpace)}function T(S){var j=d($(G(),S));return S?j>=0:j<=v[c("scrollWidth")]-Se(g)[c("width")]}function R(S,j){j=bt(j)?G():j;var Y=S!==!0&&d(j)<d(N(!1)),re=S!==!1&&d(j)>d(N(!0));return Y||re}return{mount:W,move:I,jump:y,translate:A,shift:$,cancel:E,toIndex:O,toPosition:V,getPosition:G,getLimit:N,exceededLimit:R,reposition:F}}function po(e,t,n){var r=ce(e),o=r.on,a=r.emit,i=t.Move,s=i.getPosition,l=i.getLimit,p=i.toPosition,u=t.Slides,x=u.isEnough,m=u.getLength,h=n.omitEnd,c=e.is(lt),d=e.is(it),w=oe(G,!1),v=oe(G,!0),g=n.start||0,C,W=g,F,I,y;function A(){k(),o([ye,ge,Pt],k),o(zt,$)}function k(){F=m(!0),I=n.perMove,y=n.perPage,C=T();var L=Je(g,0,h?C:F-1);L!==g&&(g=L,i.reposition())}function $(){C!==T()&&a(Pt)}function E(L,J,fe){if(!me()){var ae=V(L),Z=N(ae);Z>-1&&(J||Z!==g)&&(Y(Z),i.move(ae,Z,W,fe))}}function O(L,J,fe,ae){t.Scroll.scroll(L,J,fe,function(){var Z=N(i.toIndex(s()));Y(h?ze(Z,C):Z),ae&&ae()})}function V(L){var J=g;if(Fe(L)){var fe=L.match(/([+\-<>])(\d+)?/)||[],ae=fe[1],Z=fe[2];ae==="+"||ae==="-"?J=M(g+ +(""+ae+(+Z||1)),g):ae===">"?J=Z?R(+Z):w(!0):ae==="<"&&(J=v(!0))}else J=c?L:Je(L,0,C);return J}function G(L,J){var fe=I||(ne()?1:y),ae=M(g+fe*(L?-1:1),g,!(I||ne()));return ae===-1&&d&&!pr(s(),l(!L),1)?L?0:C:J?ae:N(ae)}function M(L,J,fe){if(x()||ne()){var ae=f(L);ae!==L&&(J=L,L=ae,fe=!1),L<0||L>C?!I&&(Nt(0,L,J,!0)||Nt(C,J,L,!0))?L=R(S(L)):c?L=fe?L<0?-(F%y||y):F:L:n.rewind?L=L<0?C:0:L=-1:fe&&L!==J&&(L=R(S(J)+(L<J?-1:1)))}else L=-1;return L}function f(L){if(d&&n.trimSpace==="move"&&L!==g)for(var J=s();J===p(L,!0)&&Nt(L,0,e.length-1,!n.rewind);)L<g?--L:++L;return L}function N(L){return c?(L+F)%F||0:L}function T(){for(var L=F-(ne()||c&&I?1:y);h&&L-- >0;)if(p(F-1,!0)!==p(L,!0)){L++;break}return Je(L,0,F-1)}function R(L){return Je(ne()?L:y*L,0,C)}function S(L){return ne()?ze(L,C):$t((L>=C?F-1:L)/y)}function j(L){var J=i.toIndex(L);return d?Je(J,0,C):J}function Y(L){L!==g&&(W=g,g=L)}function re(L){return L?W:g}function ne(){return!bt(n.focus)||n.isNavigation}function me(){return e.state.is([ot,vt])&&!!n.waitForTransition}return{mount:A,go:E,scroll:O,getNext:w,getPrev:v,getAdjacent:G,getEnd:T,setIndex:Y,getIndex:re,toIndex:R,toPage:S,toDest:j,hasFocus:ne,isBusy:me}}var go="http://www.w3.org/2000/svg",fo="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",Tt=40;function mo(e,t,n){var r=ce(e),o=r.on,a=r.bind,i=r.emit,s=n.classes,l=n.i18n,p=t.Elements,u=t.Controller,x=p.arrows,m=p.track,h=x,c=p.prev,d=p.next,w,v,g={};function C(){F(),o(ye,W)}function W(){I(),C()}function F(){var O=n.arrows;O&&!(c&&d)&&k(),c&&d&&(ft(g,{prev:c,next:d}),mt(h,O?"":"none"),Ie(h,v=Rn+"--"+n.direction),O&&(y(),E(),K([c,d],wt,m.id),i(_r,c,d)))}function I(){r.destroy(),je(h,v),w?(Ge(x?[c,d]:h),c=d=null):Te([c,d],Ln)}function y(){o([We,at,ge,Xe,Pt],E),a(d,"click",oe(A,">")),a(c,"click",oe(A,"<"))}function A(O){u.go(O,!0)}function k(){h=x||et("div",s.arrows),c=$(!0),d=$(!1),w=!0,St(h,[c,d]),!x&&yn(h,m)}function $(O){var V='<button class="'+s.arrow+" "+(O?s.prev:s.next)+'" type="button"><svg xmlns="'+go+'" viewBox="0 0 '+Tt+" "+Tt+'" width="'+Tt+'" height="'+Tt+'" focusable="false"><path d="'+(n.arrowPath||fo)+'" />';return cr(V)}function E(){if(c&&d){var O=e.index,V=u.getPrev(),G=u.getNext(),M=V>-1&&O<V?l.last:l.prev,f=G>-1&&O>G?l.first:l.next;c.disabled=V<0,d.disabled=G<0,K(c,xe,M),K(d,xe,f),i(Sr,c,d,V,G)}}return{arrows:g,mount:C,destroy:I,update:E}}var ho=bn+"-interval";function yo(e,t,n){var r=ce(e),o=r.on,a=r.bind,i=r.emit,s=Wt(n.interval,e.go.bind(e,">"),y),l=s.isPaused,p=t.Elements,u=t.Elements,x=u.root,m=u.toggle,h=n.autoplay,c,d,w=h==="pause";function v(){h&&(g(),m&&K(m,wt,p.track.id),w||C(),I())}function g(){n.pauseOnHover&&a(x,"mouseenter mouseleave",function(k){c=k.type==="mouseenter",F()}),n.pauseOnFocus&&a(x,"focusin focusout",function(k){d=k.type==="focusin",F()}),m&&a(m,"click",function(){w?C():W(!0)}),o([$e,Dt,ge],s.rewind),o($e,A)}function C(){l()&&t.Slides.isEnough()&&(s.start(!n.resetProgress),d=c=w=!1,I(),i(wn))}function W(k){k===void 0&&(k=!0),w=!!k,I(),l()||(s.pause(),i(En))}function F(){w||(c||d?W(!1):C())}function I(){m&&(Ne(m,Ye,!w),K(m,xe,n.i18n[w?"play":"pause"]))}function y(k){var $=p.bar;$&&we($,"width",k*100+"%"),i(wr,k)}function A(k){var $=t.Slides.getAt(k);s.set($&&+Ee($.slide,ho)||n.interval)}return{mount:v,destroy:s.cancel,play:C,pause:W,isPaused:l}}function vo(e,t,n){var r=ce(e),o=r.on;function a(){n.cover&&(o(An,oe(s,!0)),o([We,ye,ge],oe(i,!0)))}function i(l){t.Slides.forEach(function(p){var u=xt(p.container||p.slide,"img");u&&u.src&&s(l,u,p)})}function s(l,p,u){u.style("background",l?'center/cover no-repeat url("'+p.src+'")':"",!0),mt(p,l?"none":"")}return{mount:a,destroy:oe(i,!1)}}var bo=10,_o=600,So=.6,xo=1.5,Co=800;function wo(e,t,n){var r=ce(e),o=r.on,a=r.emit,i=e.state.set,s=t.Move,l=s.getPosition,p=s.getLimit,u=s.exceededLimit,x=s.translate,m=e.is(it),h,c,d=1;function w(){o($e,W),o([ye,ge],F)}function v(y,A,k,$,E){var O=l();if(W(),k&&(!m||!u())){var V=t.Layout.sliderSize(),G=ln(y)*V*$t(be(y)/V)||0;y=s.toPosition(t.Controller.toDest(y%V))+G}var M=pr(O,y,1);d=1,A=M?0:A||Vt(be(y-O)/xo,Co),c=$,h=Wt(A,g,oe(C,O,y,E),1),i(vt),a(Dt),h.start()}function g(){i(nt),c&&c(),a(Xe)}function C(y,A,k,$){var E=l(),O=y+(A-y)*I($),V=(O-E)*d;x(E+V),m&&!k&&u()&&(d*=So,be(V)<bo&&v(p(u(!0)),_o,!1,c,!0))}function W(){h&&h.cancel()}function F(){h&&!h.isPaused()&&(W(),g())}function I(y){var A=n.easingFunc;return A?A(y):1-Math.pow(1-y,4)}return{mount:w,destroy:W,scroll:v,cancel:F}}var Ze={passive:!1,capture:!0};function Eo(e,t,n){var r=ce(e),o=r.on,a=r.emit,i=r.bind,s=r.unbind,l=e.state,p=t.Move,u=t.Scroll,x=t.Controller,m=t.Elements.track,h=t.Media.reduce,c=t.Direction,d=c.resolve,w=c.orient,v=p.getPosition,g=p.exceededLimit,C,W,F,I,y,A=!1,k,$,E;function O(){i(m,Zt,on,Ze),i(m,Qt,on,Ze),i(m,Fr,G,Ze),i(m,"click",N,{capture:!0}),i(m,"dragstart",ke),o([We,ye],V)}function V(){var z=n.drag;de(!z),I=z==="free"}function G(z){if(k=!1,!$){var _=Z(z);ae(z.target)&&(_||!z.button)&&(x.isBusy()?ke(z,!0):(E=_?m:window,y=l.is([ot,vt]),F=null,i(E,Zt,M,Ze),i(E,Qt,f,Ze),p.cancel(),u.cancel(),T(z)))}}function M(z){if(l.is(Rt)||(l.set(Rt),a(yr)),z.cancelable)if(y){p.translate(C+fe(ne(z)));var _=me(z)>Un,H=A!==(A=g());(_||H)&&T(z),k=!0,a(vr),ke(z)}else j(z)&&(y=S(z),ke(z))}function f(z){l.is(Rt)&&(l.set(nt),a(br)),y&&(R(z),ke(z)),s(E,Zt,M),s(E,Qt,f),y=!1}function N(z){!$&&k&&ke(z,!0)}function T(z){F=W,W=z,C=v()}function R(z){var _=Y(z),H=re(_),X=n.rewind&&n.rewindByDrag;h(!1),I?x.scroll(H,0,n.snap):e.is(Et)?x.go(w(ln(_))<0?X?"<":"-":X?">":"+"):e.is(it)&&A&&X?x.go(g(!0)?">":"<"):x.go(x.toDest(H),!0),h(!0)}function S(z){var _=n.dragMinThreshold,H=pt(_),X=H&&_.mouse||0,Q=(H?_.touch:+_)||10;return be(ne(z))>(Z(z)?Q:X)}function j(z){return be(ne(z))>be(ne(z,!0))}function Y(z){if(e.is(lt)||!A){var _=me(z);if(_&&_<Un)return ne(z)/_}return 0}function re(z){return v()+ln(z)*ze(be(z)*(n.flickPower||600),I?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function ne(z,_){return J(z,_)-J(L(z),_)}function me(z){return an(z)-an(L(z))}function L(z){return W===z&&F||W}function J(z,_){return(Z(z)?z.changedTouches[0]:z)["page"+d(_?"Y":"X")]}function fe(z){return z/(A&&e.is(it)?ro:1)}function ae(z){var _=n.noDrag;return!dt(z,"."+Or+", ."+Xt)&&(!_||!dt(z,_))}function Z(z){return typeof TouchEvent<"u"&&z instanceof TouchEvent}function _e(){return y}function de(z){$=z}return{mount:O,disable:de,isDragging:_e}}var Ao={Spacebar:" ",Right:Ut,Left:Ht,Up:Ir,Down:Tr};function kn(e){return e=Fe(e)?e:e.key,Ao[e]||e}var Gn="keydown";function Io(e,t,n){var r=ce(e),o=r.on,a=r.bind,i=r.unbind,s=e.root,l=t.Direction.resolve,p,u;function x(){m(),o(ye,h),o(ye,m),o($e,d)}function m(){var v=n.keyboard;v&&(p=v==="global"?window:s,a(p,Gn,w))}function h(){i(p,Gn)}function c(v){u=v}function d(){var v=u;u=!0,ir(function(){u=v})}function w(v){if(!u){var g=kn(v);g===l(Ht)?e.go("<"):g===l(Ut)&&e.go(">")}}return{mount:x,destroy:h,disable:c}}var ct=bn+"-lazy",jt=ct+"-srcset",To="["+ct+"], ["+jt+"]";function Lo(e,t,n){var r=ce(e),o=r.on,a=r.off,i=r.bind,s=r.emit,l=n.lazyLoad==="sequential",p=[at,Xe],u=[];function x(){n.lazyLoad&&(m(),o(ge,m))}function m(){Ve(u),h(),l?v():(a(p),o(p,c),c())}function h(){t.Slides.forEach(function(g){vn(g.slide,To).forEach(function(C){var W=Ee(C,ct),F=Ee(C,jt);if(W!==C.src||F!==C.srcset){var I=n.classes.spinner,y=C.parentElement,A=xt(y,"."+I)||et("span",I,y);u.push([C,g,A]),C.src||mt(C,"none")}})})}function c(){u=u.filter(function(g){var C=n.perPage*((n.preloadPages||1)+1)-1;return g[1].isWithin(e.index,C)?d(g):!0}),u.length||a(p)}function d(g){var C=g[0];Ie(g[1].slide,pn),i(C,"load error",oe(w,g)),K(C,"src",Ee(C,ct)),K(C,"srcset",Ee(C,jt)),Te(C,ct),Te(C,jt)}function w(g,C){var W=g[0],F=g[1];je(F.slide,pn),C.type!=="error"&&(Ge(g[2]),mt(W,""),s(An,W,F),s(rt)),l&&v()}function v(){u.length&&d(u.shift())}return{mount:x,destroy:oe(Ve,u),check:c}}function Ro(e,t,n){var r=ce(e),o=r.on,a=r.emit,i=r.bind,s=t.Slides,l=t.Elements,p=t.Controller,u=p.hasFocus,x=p.getIndex,m=p.go,h=t.Direction.resolve,c=l.pagination,d=[],w,v;function g(){C(),o([ye,ge,Pt],g);var $=n.pagination;c&&mt(c,$?"":"none"),$&&(o([$e,Dt,Xe],k),W(),k(),a(xr,{list:w,items:d},A(e.index)))}function C(){w&&(Ge(c?De(w.children):w),je(w,v),Ve(d),w=null),r.destroy()}function W(){var $=e.length,E=n.classes,O=n.i18n,V=n.perPage,G=u()?p.getEnd()+1:ht($/V);w=c||et("ul",E.pagination,l.track.parentElement),Ie(w,v=qt+"--"+y()),K(w,Oe,"tablist"),K(w,xe,O.select),K(w,Tn,y()===Gt?"vertical":"");for(var M=0;M<G;M++){var f=et("li",null,w),N=et("button",{class:E.page,type:"button"},f),T=s.getIn(M).map(function(S){return S.slide.id}),R=!u()&&V>1?O.pageX:O.slideX;i(N,"click",oe(F,M)),n.paginationKeyboard&&i(N,"keydown",oe(I,M)),K(f,Oe,"presentation"),K(N,Oe,"tab"),K(N,wt,T.join(" ")),K(N,xe,sn(R,M+1)),K(N,tt,-1),d.push({li:f,button:N,page:M})}}function F($){m(">"+$,!0)}function I($,E){var O=d.length,V=kn(E),G=y(),M=-1;V===h(Ut,!1,G)?M=++$%O:V===h(Ht,!1,G)?M=(--$+O)%O:V==="Home"?M=0:V==="End"&&(M=O-1);var f=d[M];f&&(sr(f.button),m(">"+M),ke(E,!0))}function y(){return n.paginationDirection||n.direction}function A($){return d[p.toPage($)]}function k(){var $=A(x(!0)),E=A(x());if($){var O=$.button;je(O,Ye),Te(O,zn),K(O,tt,-1)}if(E){var V=E.button;Ie(V,Ye),K(V,zn,!0),K(V,tt,"")}a(Cr,{list:w,items:d},$,E)}return{items:d,mount:g,destroy:C,getAt:A,update:k}}var ko=[" ","Enter"];function No(e,t,n){var r=n.isNavigation,o=n.slideFocus,a=[];function i(){e.splides.forEach(function(c){c.isParent||(p(e,c.splide),p(c.splide,e))}),r&&u()}function s(){a.forEach(function(c){c.destroy()}),Ve(a)}function l(){s(),i()}function p(c,d){var w=ce(c);w.on($e,function(v,g,C){d.go(d.is(lt)?C:v)}),a.push(w)}function u(){var c=ce(e),d=c.on;d(Sn,m),d(Er,h),d([We,ye],x),a.push(c),c.emit(Cn,e.splides)}function x(){K(t.Elements.list,Tn,n.direction===Gt?"vertical":"")}function m(c){e.go(c.index)}function h(c,d){hn(ko,kn(d))&&(m(c),ke(d))}return{setup:oe(t.Media.set,{slideFocus:bt(o)?r:o},!0),mount:i,destroy:s,remount:l}}function jo(e,t,n){var r=ce(e),o=r.bind,a=0;function i(){n.wheel&&o(t.Elements.track,"wheel",s,Ze)}function s(p){if(p.cancelable){var u=p.deltaY,x=u<0,m=an(p),h=n.wheelMinThreshold||0,c=n.wheelSleep||0;be(u)>h&&m-a>c&&(e.go(x?"<":">"),a=m),l(x)&&ke(p)}}function l(p){return!n.releaseWheel||e.state.is(ot)||t.Controller.getAdjacent(p)!==-1}return{mount:i}}var Oo=90;function Vo(e,t,n){var r=ce(e),o=r.on,a=t.Elements.track,i=n.live&&!n.isNavigation,s=et("span",Zi),l=Wt(Oo,oe(u,!1));function p(){i&&(m(!t.Autoplay.isPaused()),K(a,Mn,!0),s.textContent="…",o(wn,oe(m,!0)),o(En,oe(m,!1)),o([at,Xe],oe(u,!0)))}function u(h){K(a,Wn,h),h?(St(a,s),l.start()):(Ge(s),l.cancel())}function x(){Te(a,[Dn,Mn,Wn]),Ge(s)}function m(h){i&&K(a,Dn,h?"off":"polite")}return{mount:p,disable:m,destroy:x}}var $o=Object.freeze({__proto__:null,Media:Mi,Direction:Hi,Elements:io,Slides:ao,Layout:lo,Clones:co,Move:uo,Controller:po,Arrows:mo,Autoplay:yo,Cover:vo,Scroll:wo,Drag:Eo,Keyboard:Io,LazyLoad:Lo,Pagination:Ro,Sync:No,Wheel:jo,Live:Vo}),Po={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"},Bo={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:to,i18n:Po,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Fo(e,t,n){var r=t.Slides;function o(){ce(e).on([We,ge],a)}function a(){r.forEach(function(s){s.style("transform","translateX(-"+100*s.index+"%)")})}function i(s,l){r.style("transition","opacity "+n.speed+"ms "+n.easing),ir(l)}return{mount:o,start:i,cancel:on}}function zo(e,t,n){var r=t.Move,o=t.Controller,a=t.Scroll,i=t.Elements.list,s=oe(we,i,"transition"),l;function p(){ce(e).bind(i,"transitionend",function(h){h.target===i&&l&&(x(),l())})}function u(h,c){var d=r.toPosition(h,!0),w=r.getPosition(),v=m(h);be(d-w)>=1&&v>=1?n.useScroll?a.scroll(d,v,!1,c):(s("transform "+v+"ms "+n.easing),r.translate(d,!0),l=c):(r.jump(h),c())}function x(){s(""),a.cancel()}function m(h){var c=n.rewindSpeed;if(e.is(it)&&c){var d=o.getIndex(!0),w=o.getEnd();if(d===0&&h>=w||d>=w&&h===0)return c}return n.speed}return{mount:p,start:u,cancel:x}}var Do=(function(){function e(n,r){this.event=ce(),this.Components={},this.state=Di(Qe),this.splides=[],this._o={},this._E={};var o=Fe(n)?ur(document,n):n;st(o,o+" is invalid."),this.root=o,r=Be({label:Ee(o,xe)||"",labelledby:Ee(o,In)||""},Bo,e.defaults,r||{});try{Be(r,JSON.parse(Ee(o,bn)))}catch{st(!1,"Invalid JSON")}this._o=Object.create(Be({},r))}var t=e.prototype;return t.mount=function(r,o){var a=this,i=this.state,s=this.Components;st(i.is([Qe,Ot]),"Already mounted!"),i.set(Qe),this._C=s,this._T=o||this._T||(this.is(Et)?Fo:zo),this._E=r||this._E;var l=ft({},$o,this._E,{Transition:this._T});return Ue(l,function(p,u){var x=p(a,s,a._o);s[u]=x,x.setup&&x.setup()}),Ue(s,function(p){p.mount&&p.mount()}),this.emit(We),Ie(this.root,Qi),i.set(nt),this.emit(cn),this},t.sync=function(r){return this.splides.push({splide:r}),r.splides.push({splide:this,isParent:!0}),this.state.is(nt)&&(this._C.Sync.remount(),r.Components.Sync.remount()),this},t.go=function(r){return this._C.Controller.go(r),this},t.on=function(r,o){return this.event.on(r,o),this},t.off=function(r){return this.event.off(r),this},t.emit=function(r){var o;return(o=this.event).emit.apply(o,[r].concat(De(arguments,1))),this},t.add=function(r,o){return this._C.Slides.add(r,o),this},t.remove=function(r){return this._C.Slides.remove(r),this},t.is=function(r){return this._o.type===r},t.refresh=function(){return this.emit(ge),this},t.destroy=function(r){r===void 0&&(r=!0);var o=this.event,a=this.state;return a.is(Qe)?ce(this).on(cn,this.destroy.bind(this,r)):(Ue(this._C,function(i){i.destroy&&i.destroy(r)},!0),o.emit(xn),o.destroy(),r&&Ve(this.splides),a.set(Ot)),this},$i(e,[{key:"options",get:function(){return this._o},set:function(r){this._C.Media.set(r,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),Nn=Do;Nn.defaults={};Nn.STATES=Bi;var Yn=[[We,"onMounted"],[cn,"onReady"],[$e,"onMove"],[at,"onMoved"],[Sn,"onClick"],[gr,"onActive"],[fr,"onInactive"],[mr,"onVisible"],[hr,"onHidden"],[ge,"onRefresh"],[ye,"onUpdated"],[rt,"onResize"],[zt,"onResized"],[yr,"onDrag"],[vr,"onDragging"],[br,"onDragged"],[Dt,"onScroll"],[Xe,"onScrolled"],[xn,"onDestroy"],[_r,"onArrowsMounted"],[Sr,"onArrowsUpdated"],[xr,"onPaginationMounted"],[Cr,"onPaginationUpdated"],[Cn,"onNavigationMounted"],[wn,"onAutoplayPlay"],[wr,"onAutoplayPlaying"],[En,"onAutoplayPause"],[An,"onLazyLoadLoaded"]];function jn(...e){return e.filter(Boolean).join(" ")}function Bt(e){return e!==null&&typeof e=="object"}function dn(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,r)=>!dn(n,t[r]));if(Bt(e)&&Bt(t)){const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!dn(e[o],t[o]))}return e===t}function Wo(e,t){return e.length===t.length&&!e.some((n,r)=>n!==t[r])}function Mo(e,t){if(e){const n=Object.keys(e);for(let r=0;r<n.length;r++){const o=n[r];if(o!=="__proto__"&&t(e[o],o)===!1)break}}return e}function gn(e,t){const n=e;return Mo(t,(r,o)=>{Array.isArray(r)?n[o]=r.slice():Bt(r)?n[o]=gn(Bt(n[o])?n[o]:{},r):n[o]=r}),n}var Ho=({children:e,className:t,...n})=>D.createElement("div",{className:jn("splide__track",t),...n},D.createElement("ul",{className:"splide__list"},e)),zr=class extends D.Component{constructor(){super(...arguments),this.splideRef=D.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:r}=this.splideRef;r&&(this.splide=new Nn(r,e),this.bind(this.splide),this.splide.mount(t,n),this.options=gn({},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&&!dn(this.options,e)&&(this.splide.options=e,this.options=gn({},e));const t=this.getSlides();Wo(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){Yn.forEach(([t,n])=>{const r=this.props[n];typeof r=="function"&&e.on(t,(...o)=>{r(e,...o)})})}omit(e,t){return t.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}),e}render(){const{className:e,tag:t="div",hasTrack:n=!0,children:r,...o}=this.props;return D.createElement(t,{className:jn("splide",e),ref:this.splideRef,...this.omit(o,["options",...Yn.map(a=>a[1])])},n?D.createElement(Ho,null,r):r)}},Dr=({children:e,className:t,...n})=>D.createElement("li",{className:jn("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react/jsx-runtime"),z=require("react"),ce=require("classnames"),j=require("./useScopedStyles-b8cb4EW8.js"),Ur=require("react-dom");function Gr(e){return e.type==="object"&&e.version===1}const Yr="ControlSlider-module__wrapper___sHEkd",qr="ControlSlider-module__hoverArrow___A-dOH",Xr="ControlSlider-module__sliderItem___QQSkR",Kr="ControlSlider-module__sliderImage___9hRl-",Jr="ControlSlider-module__arrow___05ghY",Zr="ControlSlider-module__arrowVertical___tBfVN",Qr="ControlSlider-module__nextArrow___-30Yc",eo="ControlSlider-module__arrowInner___aEra3",to="ControlSlider-module__arrowIcon___S4ztF",no="ControlSlider-module__arrowImg___2dwJW",ro="ControlSlider-module__mirror___brd6U",oo="ControlSlider-module__pagination___bicLF",io="ControlSlider-module__paginationInner___bT-P-",ao="ControlSlider-module__paginationVertical___zYqKw",lo="ControlSlider-module__paginationItem___nTRbk",so="ControlSlider-module__dot___p1Qun",co="ControlSlider-module__activeDot___LHFaj",uo="ControlSlider-module__paginationInsideBottom___R3FWn",po="ControlSlider-module__paginationInsideTop___V-qb-",go="ControlSlider-module__paginationOutsideBottom___14w8D",fo="ControlSlider-module__paginationOutsideTop___SCLqB",mo="ControlSlider-module__paginationInsideLeft___yOBRZ",yo="ControlSlider-module__paginationInsideRight___Rtt3o",ho="ControlSlider-module__paginationOutsideLeft___lahaw",vo="ControlSlider-module__paginationOutsideRight___EtuQa",bo="ControlSlider-module__imgWrapper___UjEgB",_o="ControlSlider-module__captionBlock___dJ6-j",So="ControlSlider-module__captionTextWrapper___HFlpf",Co="ControlSlider-module__captionText___uGBVc",xo="ControlSlider-module__active___WZK4G",wo="ControlSlider-module__withPointerEvents___t-18M",Eo="ControlSlider-module__topLeftAlignment___zjnGM",Ao="ControlSlider-module__topCenterAlignment___gD1xW",To="ControlSlider-module__topRightAlignment___NMapS",Io="ControlSlider-module__middleLeftAlignment___OnUrY",$o="ControlSlider-module__middleCenterAlignment___Tdkl0",Lo="ControlSlider-module__middleRightAlignment___wEbfX",Ro="ControlSlider-module__bottomLeftAlignment___cTP2-",ko="ControlSlider-module__bottomCenterAlignment___c54fB",No="ControlSlider-module__bottomRightAlignment___kEwrz",Oo="ControlSlider-module__clickOverlay___DZA28",jo="ControlSlider-module__contain___pLyq7",Vo="ControlSlider-module__cover___KdDat",G={wrapper:Yr,hoverArrow:qr,sliderItem:Xr,sliderImage:Kr,arrow:Jr,arrowVertical:Zr,nextArrow:Qr,arrowInner:eo,arrowIcon:to,arrowImg:no,mirror:ro,pagination:oo,paginationInner:io,paginationVertical:ao,paginationItem:lo,dot:so,activeDot:co,paginationInsideBottom:uo,paginationInsideTop:po,paginationOutsideBottom:go,paginationOutsideTop:fo,paginationInsideLeft:mo,paginationInsideRight:yo,paginationOutsideLeft:ho,paginationOutsideRight:vo,imgWrapper:bo,captionBlock:_o,captionTextWrapper:So,captionText:Co,active:xo,withPointerEvents:wo,topLeftAlignment:Eo,topCenterAlignment:Ao,topRightAlignment:To,middleLeftAlignment:Io,middleCenterAlignment:$o,middleRightAlignment:Lo,bottomLeftAlignment:Ro,bottomCenterAlignment:ko,bottomRightAlignment:No,clickOverlay:Oo,contain:jo,cover:Vo};function Po(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Bo(e,t,n){return t&&Po(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var On="(prefers-reduced-motion: reduce)",et=1,Fo=2,rt=3,at=4,bt=5,Lt=6,Ot=7,Do={CREATED:et,MOUNTED:Fo,IDLE:rt,MOVING:at,SCROLLING:bt,DRAGGING:Lt,DESTROYED:Ot};function Ne(e){e.length=0}function ze(e,t,n){return Array.prototype.slice.call(e,t,n)}function ae(e){return e.bind.apply(e,[null].concat(ze(arguments,1)))}var ir=setTimeout,on=function(){};function jn(e){return requestAnimationFrame(e)}function Ft(e,t){return typeof t===e}function dt(e){return!mn(e)&&Ft("object",e)}var fn=Array.isArray,ar=ae(Ft,"function"),Fe=ae(Ft,"string"),_t=ae(Ft,"undefined");function mn(e){return e===null}function lr(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function St(e){return fn(e)?e:[e]}function Se(e,t){St(e).forEach(t)}function yn(e,t){return e.indexOf(t)>-1}function Rt(e,t){return e.push.apply(e,St(t)),e}function Le(e,t,n){e&&Se(t,function(r){r&&e.classList[n?"add":"remove"](r)})}function Ee(e,t){Le(e,Fe(t)?t.split(" "):t,!0)}function Ct(e,t){Se(t,e.appendChild.bind(e))}function hn(e,t){Se(e,function(n){var r=(t||n).parentNode;r&&r.insertBefore(n,t)})}function gt(e,t){return lr(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function sr(e,t){var n=e?ze(e.children):[];return t?n.filter(function(r){return gt(r,t)}):n}function xt(e,t){return t?sr(e,t)[0]:e.firstElementChild}var ft=Object.keys;function Ue(e,t,n){return e&&(n?ft(e).reverse():ft(e)).forEach(function(r){r!=="__proto__"&&t(e[r],r)}),e}function mt(e){return ze(arguments,1).forEach(function(t){Ue(t,function(n,r){e[r]=t[r]})}),e}function Be(e){return ze(arguments,1).forEach(function(t){Ue(t,function(n,r){fn(n)?e[r]=n.slice():dt(n)?e[r]=Be({},dt(e[r])?e[r]:{},n):e[r]=n})}),e}function Vn(e,t){Se(t||ft(e),function(n){delete e[n]})}function Ae(e,t){Se(e,function(n){Se(t,function(r){n&&n.removeAttribute(r)})})}function Q(e,t,n){dt(t)?Ue(t,function(r,o){Q(e,o,r)}):Se(e,function(r){mn(n)||n===""?Ae(r,t):r.setAttribute(t,String(n))})}function tt(e,t,n){var r=document.createElement(e);return t&&(Fe(t)?Ee(r,t):Q(r,t)),n&&Ct(n,r),r}function Ce(e,t,n){if(_t(n))return getComputedStyle(e)[t];mn(n)||(e.style[t]=""+n)}function yt(e,t){Ce(e,"display",t)}function cr(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function xe(e,t){return e.getAttribute(t)}function Pn(e,t){return e&&e.classList.contains(t)}function be(e){return e.getBoundingClientRect()}function Ge(e){Se(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function ur(e){return xt(new DOMParser().parseFromString(e,"text/html").body)}function $e(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function pr(e,t){return e&&e.querySelector(t)}function vn(e,t){return t?ze(e.querySelectorAll(t)):[]}function Re(e,t){Le(e,t,!1)}function an(e){return e.timeStamp}function He(e){return Fe(e)?e:e?e+"px":""}var wt="splide",bn="data-"+wt;function ct(e,t){if(!e)throw new Error("["+wt+"] "+(t||""))}var De=Math.min,jt=Math.max,Vt=Math.floor,ht=Math.ceil,ve=Math.abs;function dr(e,t,n){return ve(e-t)<n}function kt(e,t,n,r){var o=De(t,n),a=jt(t,n);return r?o<e&&e<a:o<=e&&e<=a}function Ze(e,t,n){var r=De(t,n),o=jt(t,n);return De(jt(r,e),o)}function ln(e){return+(e>0)-+(e<0)}function sn(e,t){return Se(t,function(n){e=e.replace("%s",""+n)}),e}function _n(e){return e<10?"0"+e:""+e}var Bn={};function zo(e){return""+e+_n(Bn[e]=(Bn[e]||0)+1)}function gr(){var e=[];function t(i,s,l,p){o(i,s,function(c,w,v){var b="addEventListener"in c,u=b?c.removeEventListener.bind(c,w,l,p):c.removeListener.bind(c,l);b?c.addEventListener(w,l,p):c.addListener(l),e.push([c,w,v,l,u])})}function n(i,s,l){o(i,s,function(p,c,w){e=e.filter(function(v){return v[0]===p&&v[1]===c&&v[2]===w&&(!l||v[3]===l)?(v[4](),!1):!0})})}function r(i,s,l){var p,c=!0;return typeof CustomEvent=="function"?p=new CustomEvent(s,{bubbles:c,detail:l}):(p=document.createEvent("CustomEvent"),p.initCustomEvent(s,c,!1,l)),i.dispatchEvent(p),p}function o(i,s,l){Se(i,function(p){p&&Se(s,function(c){c.split(" ").forEach(function(w){var v=w.split(".");l(p,v[0],v[1])})})})}function a(){e.forEach(function(i){i[4]()}),Ne(e)}return{bind:t,unbind:n,dispatch:r,destroy:a}}var Me="mounted",cn="ready",Oe="move",lt="moved",Sn="click",fr="active",mr="inactive",yr="visible",hr="hidden",me="refresh",he="updated",ot="resize",Dt="resized",vr="drag",br="dragging",_r="dragged",zt="scroll",qe="scrolled",Mo="overflow",Cn="destroy",Sr="arrows:mounted",Cr="arrows:updated",xr="pagination:mounted",wr="pagination:updated",xn="navigation:mounted",wn="autoplay:play",Er="autoplay:playing",En="autoplay:pause",An="lazyload:loaded",Ar="sk",Tr="sh",Pt="ei";function ue(e){var t=e?e.event.bus:document.createDocumentFragment(),n=gr();function r(a,i){n.bind(t,St(a).join(" "),function(s){i.apply(i,fn(s.detail)?s.detail:[])})}function o(a){n.dispatch(t,a,ze(arguments,1))}return e&&e.event.on(Cn,n.destroy),mt(n,{bus:t,on:r,off:ae(n.unbind,t),emit:o})}function Mt(e,t,n,r){var o=Date.now,a,i=0,s,l=!0,p=0;function c(){if(!l){if(i=e?De((o()-a)/e,1):1,n&&n(i),i>=1&&(t(),a=o(),r&&++p>=r))return v();s=jn(c)}}function w(E){E||u(),a=o()-(E?i*e:0),l=!1,s=jn(c)}function v(){l=!0}function b(){a=o(),i=0,n&&n(i)}function u(){s&&cancelAnimationFrame(s),i=0,s=0,l=!0}function d(E){e=E}function A(){return l}return{start:w,rewind:b,pause:v,cancel:u,set:d,isPaused:A}}function Wo(e){var t=e;function n(o){t=o}function r(o){return yn(St(o),t)}return{set:n,is:r}}function Ho(e,t){var n=Mt(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Uo(e,t,n){var r=e.state,o=n.breakpoints||{},a=n.reducedMotion||{},i=gr(),s=[];function l(){var u=n.mediaQuery==="min";ft(o).sort(function(d,A){return u?+d-+A:+A-+d}).forEach(function(d){c(o[d],"("+(u?"min":"max")+"-width:"+d+"px)")}),c(a,On),w()}function p(u){u&&i.destroy()}function c(u,d){var A=matchMedia(d);i.bind(A,"change",w),s.push([u,A])}function w(){var u=r.is(Ot),d=n.direction,A=s.reduce(function(E,g){return Be(E,g[1].matches?g[0]:{})},{});Vn(n),b(A),n.destroy?e.destroy(n.destroy==="completely"):u?(p(!0),e.mount()):d!==n.direction&&e.refresh()}function v(u){matchMedia(On).matches&&(u?Be(n,a):Vn(n,ft(a)))}function b(u,d,A){Be(n,u),d&&Be(Object.getPrototypeOf(n),u),(A||!r.is(et))&&e.emit(he,n)}return{setup:l,destroy:p,reduce:v,set:b}}var Wt="Arrow",Ht=Wt+"Left",Ut=Wt+"Right",Ir=Wt+"Up",$r=Wt+"Down",Fn="rtl",Gt="ttb",Kt={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Ir,Ut],ArrowRight:[$r,Ht]};function Go(e,t,n){function r(a,i,s){s=s||n.direction;var l=s===Fn&&!i?1:s===Gt?0:-1;return Kt[a]&&Kt[a][l]||a.replace(/width|left|right/i,function(p,c){var w=Kt[p.toLowerCase()][l]||p;return c>0?w.charAt(0).toUpperCase()+w.slice(1):w})}function o(a){return a*(n.direction===Fn?1:-1)}return{resolve:r,orient:o}}var ke="role",nt="tabindex",Yo="disabled",we="aria-",Et=we+"controls",Lr=we+"current",Dn=we+"selected",_e=we+"label",Tn=we+"labelledby",Rr=we+"hidden",In=we+"orientation",vt=we+"roledescription",zn=we+"live",Mn=we+"busy",Wn=we+"atomic",$n=[ke,nt,Yo,Et,Lr,_e,Tn,Rr,In,vt],Te=wt+"__",We="is-",Jt=wt,Hn=Te+"track",qo=Te+"list",Yt=Te+"slide",kr=Yt+"--clone",Xo=Yt+"__container",Ln=Te+"arrows",qt=Te+"arrow",Nr=qt+"--prev",Or=qt+"--next",Xt=Te+"pagination",jr=Xt+"__page",Ko=Te+"progress",Jo=Ko+"__bar",Zo=Te+"toggle",Qo=Te+"spinner",ei=Te+"sr",ti=We+"initialized",Ye=We+"active",Vr=We+"prev",Pr=We+"next",un=We+"visible",pn=We+"loading",Br=We+"focus-in",Fr=We+"overflow",ni=[Ye,un,Vr,Pr,pn,Br,Fr],ri={slide:Yt,clone:kr,arrows:Ln,arrow:qt,prev:Nr,next:Or,pagination:Xt,page:jr,spinner:Qo};function oi(e,t){if(ar(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!gt(n,t);)n=n.parentElement;return n}var ii=5,Un=200,Dr="touchstart mousedown",Zt="touchmove mousemove",Qt="touchend touchcancel mouseup click";function ai(e,t,n){var r=ue(e),o=r.on,a=r.bind,i=e.root,s=n.i18n,l={},p=[],c=[],w=[],v,b,u;function d(){y(),M(),g()}function A(){o(me,E),o(me,d),o(he,g),a(document,Dr+" keydown",function(h){u=h.type==="keydown"},{capture:!0}),a(i,"focusin",function(){Le(i,Br,!!u)})}function E(h){var $=$n.concat("style");Ne(p),Re(i,c),Re(v,w),Ae([v,b],$),Ae(i,h?$:["style",vt])}function g(){Re(i,c),Re(v,w),c=I(Jt),w=I(Hn),Ee(i,c),Ee(v,w),Q(i,_e,n.label),Q(i,Tn,n.labelledby)}function y(){v=P("."+Hn),b=xt(v,"."+qo),ct(v&&b,"A track/list element is missing."),Rt(p,sr(b,"."+Yt+":not(."+kr+")")),Ue({arrows:Ln,pagination:Xt,prev:Nr,next:Or,bar:Jo,toggle:Zo},function(h,$){l[$]=P("."+h)}),mt(l,{root:i,track:v,list:b,slides:p})}function M(){var h=i.id||zo(wt),$=n.role;i.id=h,v.id=v.id||h+"-track",b.id=b.id||h+"-list",!xe(i,ke)&&i.tagName!=="SECTION"&&$&&Q(i,ke,$),Q(i,vt,s.carousel),Q(b,ke,"presentation")}function P(h){var $=pr(i,h);return $&&oi($,"."+Jt)===i?$:void 0}function I(h){return[h+"--"+n.type,h+"--"+n.direction,n.drag&&h+"--draggable",n.isNavigation&&h+"--nav",h===Jt&&Ye]}return mt(l,{setup:d,mount:A,destroy:E})}var it="slide",st="loop",At="fade";function li(e,t,n,r){var o=ue(e),a=o.on,i=o.emit,s=o.bind,l=e.Components,p=e.root,c=e.options,w=c.isNavigation,v=c.updateOnMove,b=c.i18n,u=c.pagination,d=c.slideFocus,A=l.Direction.resolve,E=xe(r,"style"),g=xe(r,_e),y=n>-1,M=xt(r,"."+Xo),P;function I(){y||(r.id=p.id+"-slide"+_n(t+1),Q(r,ke,u?"tabpanel":"group"),Q(r,vt,b.slide),Q(r,_e,g||sn(b.slideLabel,[t+1,e.length]))),h()}function h(){s(r,"click",ae(i,Sn,T)),s(r,"keydown",ae(i,Ar,T)),a([lt,Tr,qe],R),a(xn,k),v&&a(Oe,F)}function $(){P=!0,o.destroy(),Re(r,ni),Ae(r,$n),Q(r,"style",E),Q(r,_e,g||"")}function k(){var C=e.splides.map(function(m){var O=m.splide.Components.Slides.getAt(t);return O?O.slide.id:""}).join(" ");Q(r,_e,sn(b.slideX,(y?n:t)+1)),Q(r,Et,C),Q(r,ke,d?"button":""),d&&Ae(r,vt)}function F(){P||R()}function R(){if(!P){var C=e.index;N(),V(),Le(r,Vr,t===C-1),Le(r,Pr,t===C+1)}}function N(){var C=H();C!==Pn(r,Ye)&&(Le(r,Ye,C),Q(r,Lr,w&&C||""),i(C?fr:mr,T))}function V(){var C=f(),m=!C&&(!H()||y);if(e.state.is([at,bt])||Q(r,Rr,m||""),Q(vn(r,c.focusableNodes||""),nt,m?-1:""),d&&Q(r,nt,m?-1:0),C!==Pn(r,un)&&(Le(r,un,C),i(C?yr:hr,T)),!C&&document.activeElement===r){var O=l.Slides.getAt(e.index);O&&cr(O.slide)}}function W(C,m,O){Ce(O&&M||r,C,m)}function H(){var C=e.index;return C===t||c.cloneStatus&&C===n}function f(){if(e.is(At))return H();var C=be(l.Elements.track),m=be(r),O=A("left",!0),X=A("right",!0);return Vt(C[O])<=ht(m[O])&&Vt(m[X])<=ht(C[X])}function x(C,m){var O=ve(C-t);return!y&&(c.rewind||e.is(st))&&(O=De(O,e.length-O)),O<=m}var T={index:t,slideIndex:n,slide:r,container:M,isClone:y,mount:I,destroy:$,update:R,style:W,isWithin:x};return T}function si(e,t,n){var r=ue(e),o=r.on,a=r.emit,i=r.bind,s=t.Elements,l=s.slides,p=s.list,c=[];function w(){v(),o(me,b),o(me,v)}function v(){l.forEach(function(R,N){d(R,N,-1)})}function b(){P(function(R){R.destroy()}),Ne(c)}function u(){P(function(R){R.update()})}function d(R,N,V){var W=li(e,N,V,R);W.mount(),c.push(W),c.sort(function(H,f){return H.index-f.index})}function A(R){return R?I(function(N){return!N.isClone}):c}function E(R){var N=t.Controller,V=N.toIndex(R),W=N.hasFocus()?1:n.perPage;return I(function(H){return kt(H.index,V,V+W-1)})}function g(R){return I(R)[0]}function y(R,N){Se(R,function(V){if(Fe(V)&&(V=ur(V)),lr(V)){var W=l[N];W?hn(V,W):Ct(p,V),Ee(V,n.classes.slide),$(V,ae(a,ot))}}),a(me)}function M(R){Ge(I(R).map(function(N){return N.slide})),a(me)}function P(R,N){A(N).forEach(R)}function I(R){return c.filter(ar(R)?R:function(N){return Fe(R)?gt(N.slide,R):yn(St(R),N.index)})}function h(R,N,V){P(function(W){W.style(R,N,V)})}function $(R,N){var V=vn(R,"img"),W=V.length;W?V.forEach(function(H){i(H,"load error",function(){--W||N()})}):N()}function k(R){return R?l.length:c.length}function F(){return c.length>n.perPage}return{mount:w,destroy:b,update:u,register:d,get:A,getIn:E,getAt:g,add:y,remove:M,forEach:P,filter:I,style:h,getLength:k,isEnough:F}}function ci(e,t,n){var r=ue(e),o=r.on,a=r.bind,i=r.emit,s=t.Slides,l=t.Direction.resolve,p=t.Elements,c=p.root,w=p.track,v=p.list,b=s.getAt,u=s.style,d,A,E;function g(){y(),a(window,"resize load",Ho(ae(i,ot))),o([he,me],y),o(ot,M)}function y(){d=n.direction===Gt,Ce(c,"maxWidth",He(n.width)),Ce(w,l("paddingLeft"),P(!1)),Ce(w,l("paddingRight"),P(!0)),M(!0)}function M(T){var C=be(c);(T||A.width!==C.width||A.height!==C.height)&&(Ce(w,"height",I()),u(l("marginRight"),He(n.gap)),u("width",$()),u("height",k(),!0),A=C,i(Dt),E!==(E=x())&&(Le(c,Fr,E),i(Mo,E)))}function P(T){var C=n.padding,m=l(T?"right":"left");return C&&He(C[m]||(dt(C)?0:C))||"0px"}function I(){var T="";return d&&(T=h(),ct(T,"height or heightRatio is missing."),T="calc("+T+" - "+P(!1)+" - "+P(!0)+")"),T}function h(){return He(n.height||be(v).width*n.heightRatio)}function $(){return n.autoWidth?null:He(n.fixedWidth)||(d?"":F())}function k(){return He(n.fixedHeight)||(d?n.autoHeight?null:F():h())}function F(){var T=He(n.gap);return"calc((100%"+(T&&" + "+T)+")/"+(n.perPage||1)+(T&&" - "+T)+")"}function R(){return be(v)[l("width")]}function N(T,C){var m=b(T||0);return m?be(m.slide)[l("width")]+(C?0:H()):0}function V(T,C){var m=b(T);if(m){var O=be(m.slide)[l("right")],X=be(v)[l("left")];return ve(O-X)+(C?0:H())}return 0}function W(T){return V(e.length-1)-V(0)+N(0,T)}function H(){var T=b(0);return T&&parseFloat(Ce(T.slide,l("marginRight")))||0}function f(T){return parseFloat(Ce(w,l("padding"+(T?"Right":"Left"))))||0}function x(){return e.is(At)||W(!0)>R()}return{mount:g,resize:M,listSize:R,slideSize:N,sliderSize:W,totalSize:V,getPadding:f,isOverflow:x}}var ui=2;function pi(e,t,n){var r=ue(e),o=r.on,a=t.Elements,i=t.Slides,s=t.Direction.resolve,l=[],p;function c(){o(me,w),o([he,ot],b),(p=A())&&(u(p),t.Layout.resize(!0))}function w(){v(),c()}function v(){Ge(l),Ne(l),r.destroy()}function b(){var E=A();p!==E&&(p<E||!E)&&r.emit(me)}function u(E){var g=i.get().slice(),y=g.length;if(y){for(;g.length<E;)Rt(g,g);Rt(g.slice(-E),g.slice(0,E)).forEach(function(M,P){var I=P<E,h=d(M.slide,P);I?hn(h,g[0].slide):Ct(a.list,h),Rt(l,h),i.register(h,P-E+(I?0:y),M.index)})}}function d(E,g){var y=E.cloneNode(!0);return Ee(y,n.classes.clone),y.id=e.root.id+"-clone"+_n(g+1),y}function A(){var E=n.clones;if(!e.is(st))E=0;else if(_t(E)){var g=n[s("fixedWidth")]&&t.Layout.slideSize(0),y=g&&ht(be(a.track)[s("width")]/g);E=y||n[s("autoWidth")]&&e.length||n.perPage*ui}return E}return{mount:c,destroy:v}}function di(e,t,n){var r=ue(e),o=r.on,a=r.emit,i=e.state.set,s=t.Layout,l=s.slideSize,p=s.getPadding,c=s.totalSize,w=s.listSize,v=s.sliderSize,b=t.Direction,u=b.resolve,d=b.orient,A=t.Elements,E=A.list,g=A.track,y;function M(){y=t.Transition,o([Me,Dt,he,me],P)}function P(){t.Controller.isBusy()||(t.Scroll.cancel(),h(e.index),t.Slides.update())}function I(m,O,X,oe){m!==O&&T(m>X)&&(R(),$(F(W(),m>X),!0)),i(at),a(Oe,O,X,m),y.start(O,function(){i(rt),a(lt,O,X,m),oe&&oe()})}function h(m){$(V(m,!0))}function $(m,O){if(!e.is(At)){var X=O?m:k(m);Ce(E,"transform","translate"+u("X")+"("+X+"px)"),m!==X&&a(Tr)}}function k(m){if(e.is(st)){var O=N(m),X=O>t.Controller.getEnd(),oe=O<0;(oe||X)&&(m=F(m,X))}return m}function F(m,O){var X=m-x(O),oe=v();return m-=d(oe*(ht(ve(X)/oe)||1))*(O?1:-1),m}function R(){$(W(),!0),y.cancel()}function N(m){for(var O=t.Slides.get(),X=0,oe=1/0,re=0;re<O.length;re++){var ye=O[re].index,L=ve(V(ye,!0)-m);if(L<=oe)oe=L,X=ye;else break}return X}function V(m,O){var X=d(c(m-1)-f(m));return O?H(X):X}function W(){var m=u("left");return be(E)[m]-be(g)[m]+d(p(!1))}function H(m){return n.trimSpace&&e.is(it)&&(m=Ze(m,0,d(v(!0)-w()))),m}function f(m){var O=n.focus;return O==="center"?(w()-l(m,!0))/2:+O*l(m)||0}function x(m){return V(m?t.Controller.getEnd():0,!!n.trimSpace)}function T(m){var O=d(F(W(),m));return m?O>=0:O<=E[u("scrollWidth")]-be(g)[u("width")]}function C(m,O){O=_t(O)?W():O;var X=m!==!0&&d(O)<d(x(!1)),oe=m!==!1&&d(O)>d(x(!0));return X||oe}return{mount:M,move:I,jump:h,translate:$,shift:F,cancel:R,toIndex:N,toPosition:V,getPosition:W,getLimit:x,exceededLimit:C,reposition:P}}function gi(e,t,n){var r=ue(e),o=r.on,a=r.emit,i=t.Move,s=i.getPosition,l=i.getLimit,p=i.toPosition,c=t.Slides,w=c.isEnough,v=c.getLength,b=n.omitEnd,u=e.is(st),d=e.is(it),A=ae(W,!1),E=ae(W,!0),g=n.start||0,y,M=g,P,I,h;function $(){k(),o([he,me,Pt],k),o(Dt,F)}function k(){P=v(!0),I=n.perMove,h=n.perPage,y=T();var L=Ze(g,0,b?y:P-1);L!==g&&(g=L,i.reposition())}function F(){y!==T()&&a(Pt)}function R(L,J,ge){if(!ye()){var le=V(L),fe=x(le);fe>-1&&(J||fe!==g)&&(X(fe),i.move(le,fe,M,ge))}}function N(L,J,ge,le){t.Scroll.scroll(L,J,ge,function(){var fe=x(i.toIndex(s()));X(b?De(fe,y):fe),le&&le()})}function V(L){var J=g;if(Fe(L)){var ge=L.match(/([+\-<>])(\d+)?/)||[],le=ge[1],fe=ge[2];le==="+"||le==="-"?J=H(g+ +(""+le+(+fe||1)),g):le===">"?J=fe?C(+fe):A(!0):le==="<"&&(J=E(!0))}else J=u?L:Ze(L,0,y);return J}function W(L,J){var ge=I||(re()?1:h),le=H(g+ge*(L?-1:1),g,!(I||re()));return le===-1&&d&&!dr(s(),l(!L),1)?L?0:y:J?le:x(le)}function H(L,J,ge){if(w()||re()){var le=f(L);le!==L&&(J=L,L=le,ge=!1),L<0||L>y?!I&&(kt(0,L,J,!0)||kt(y,J,L,!0))?L=C(m(L)):u?L=ge?L<0?-(P%h||h):P:L:n.rewind?L=L<0?y:0:L=-1:ge&&L!==J&&(L=C(m(J)+(L<J?-1:1)))}else L=-1;return L}function f(L){if(d&&n.trimSpace==="move"&&L!==g)for(var J=s();J===p(L,!0)&&kt(L,0,e.length-1,!n.rewind);)L<g?--L:++L;return L}function x(L){return u?(L+P)%P||0:L}function T(){for(var L=P-(re()||u&&I?1:h);b&&L-- >0;)if(p(P-1,!0)!==p(L,!0)){L++;break}return Ze(L,0,P-1)}function C(L){return Ze(re()?L:h*L,0,y)}function m(L){return re()?De(L,y):Vt((L>=y?P-1:L)/h)}function O(L){var J=i.toIndex(L);return d?Ze(J,0,y):J}function X(L){L!==g&&(M=g,g=L)}function oe(L){return L?M:g}function re(){return!_t(n.focus)||n.isNavigation}function ye(){return e.state.is([at,bt])&&!!n.waitForTransition}return{mount:$,go:R,scroll:N,getNext:A,getPrev:E,getAdjacent:W,getEnd:T,setIndex:X,getIndex:oe,toIndex:C,toPage:m,toDest:O,hasFocus:re,isBusy:ye}}var fi="http://www.w3.org/2000/svg",mi="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",It=40;function yi(e,t,n){var r=ue(e),o=r.on,a=r.bind,i=r.emit,s=n.classes,l=n.i18n,p=t.Elements,c=t.Controller,w=p.arrows,v=p.track,b=w,u=p.prev,d=p.next,A,E,g={};function y(){P(),o(he,M)}function M(){I(),y()}function P(){var N=n.arrows;N&&!(u&&d)&&k(),u&&d&&(mt(g,{prev:u,next:d}),yt(b,N?"":"none"),Ee(b,E=Ln+"--"+n.direction),N&&(h(),R(),Q([u,d],Et,v.id),i(Sr,u,d)))}function I(){r.destroy(),Re(b,E),A?(Ge(w?[u,d]:b),u=d=null):Ae([u,d],$n)}function h(){o([Me,lt,me,qe,Pt],R),a(d,"click",ae($,">")),a(u,"click",ae($,"<"))}function $(N){c.go(N,!0)}function k(){b=w||tt("div",s.arrows),u=F(!0),d=F(!1),A=!0,Ct(b,[u,d]),!w&&hn(b,v)}function F(N){var V='<button class="'+s.arrow+" "+(N?s.prev:s.next)+'" type="button"><svg xmlns="'+fi+'" viewBox="0 0 '+It+" "+It+'" width="'+It+'" height="'+It+'" focusable="false"><path d="'+(n.arrowPath||mi)+'" />';return ur(V)}function R(){if(u&&d){var N=e.index,V=c.getPrev(),W=c.getNext(),H=V>-1&&N<V?l.last:l.prev,f=W>-1&&N>W?l.first:l.next;u.disabled=V<0,d.disabled=W<0,Q(u,_e,H),Q(d,_e,f),i(Cr,u,d,V,W)}}return{arrows:g,mount:y,destroy:I,update:R}}var hi=bn+"-interval";function vi(e,t,n){var r=ue(e),o=r.on,a=r.bind,i=r.emit,s=Mt(n.interval,e.go.bind(e,">"),h),l=s.isPaused,p=t.Elements,c=t.Elements,w=c.root,v=c.toggle,b=n.autoplay,u,d,A=b==="pause";function E(){b&&(g(),v&&Q(v,Et,p.track.id),A||y(),I())}function g(){n.pauseOnHover&&a(w,"mouseenter mouseleave",function(k){u=k.type==="mouseenter",P()}),n.pauseOnFocus&&a(w,"focusin focusout",function(k){d=k.type==="focusin",P()}),v&&a(v,"click",function(){A?y():M(!0)}),o([Oe,zt,me],s.rewind),o(Oe,$)}function y(){l()&&t.Slides.isEnough()&&(s.start(!n.resetProgress),d=u=A=!1,I(),i(wn))}function M(k){k===void 0&&(k=!0),A=!!k,I(),l()||(s.pause(),i(En))}function P(){A||(u||d?M(!1):y())}function I(){v&&(Le(v,Ye,!A),Q(v,_e,n.i18n[A?"play":"pause"]))}function h(k){var F=p.bar;F&&Ce(F,"width",k*100+"%"),i(Er,k)}function $(k){var F=t.Slides.getAt(k);s.set(F&&+xe(F.slide,hi)||n.interval)}return{mount:E,destroy:s.cancel,play:y,pause:M,isPaused:l}}function bi(e,t,n){var r=ue(e),o=r.on;function a(){n.cover&&(o(An,ae(s,!0)),o([Me,he,me],ae(i,!0)))}function i(l){t.Slides.forEach(function(p){var c=xt(p.container||p.slide,"img");c&&c.src&&s(l,c,p)})}function s(l,p,c){c.style("background",l?'center/cover no-repeat url("'+p.src+'")':"",!0),yt(p,l?"none":"")}return{mount:a,destroy:ae(i,!1)}}var _i=10,Si=600,Ci=.6,xi=1.5,wi=800;function Ei(e,t,n){var r=ue(e),o=r.on,a=r.emit,i=e.state.set,s=t.Move,l=s.getPosition,p=s.getLimit,c=s.exceededLimit,w=s.translate,v=e.is(it),b,u,d=1;function A(){o(Oe,M),o([he,me],P)}function E(h,$,k,F,R){var N=l();if(M(),k&&(!v||!c())){var V=t.Layout.sliderSize(),W=ln(h)*V*Vt(ve(h)/V)||0;h=s.toPosition(t.Controller.toDest(h%V))+W}var H=dr(N,h,1);d=1,$=H?0:$||jt(ve(h-N)/xi,wi),u=F,b=Mt($,g,ae(y,N,h,R),1),i(bt),a(zt),b.start()}function g(){i(rt),u&&u(),a(qe)}function y(h,$,k,F){var R=l(),N=h+($-h)*I(F),V=(N-R)*d;w(R+V),v&&!k&&c()&&(d*=Ci,ve(V)<_i&&E(p(c(!0)),Si,!1,u,!0))}function M(){b&&b.cancel()}function P(){b&&!b.isPaused()&&(M(),g())}function I(h){var $=n.easingFunc;return $?$(h):1-Math.pow(1-h,4)}return{mount:A,destroy:M,scroll:E,cancel:P}}var Qe={passive:!1,capture:!0};function Ai(e,t,n){var r=ue(e),o=r.on,a=r.emit,i=r.bind,s=r.unbind,l=e.state,p=t.Move,c=t.Scroll,w=t.Controller,v=t.Elements.track,b=t.Media.reduce,u=t.Direction,d=u.resolve,A=u.orient,E=p.getPosition,g=p.exceededLimit,y,M,P,I,h,$=!1,k,F,R;function N(){i(v,Zt,on,Qe),i(v,Qt,on,Qe),i(v,Dr,W,Qe),i(v,"click",x,{capture:!0}),i(v,"dragstart",$e),o([Me,he],V)}function V(){var D=n.drag;Xe(!D),I=D==="free"}function W(D){if(k=!1,!F){var S=fe(D);le(D.target)&&(S||!D.button)&&(w.isBusy()?$e(D,!0):(R=S?v:window,h=l.is([at,bt]),P=null,i(R,Zt,H,Qe),i(R,Qt,f,Qe),p.cancel(),c.cancel(),T(D)))}}function H(D){if(l.is(Lt)||(l.set(Lt),a(vr)),D.cancelable)if(h){p.translate(y+ge(re(D)));var S=ye(D)>Un,U=$!==($=g());(S||U)&&T(D),k=!0,a(br),$e(D)}else O(D)&&(h=m(D),$e(D))}function f(D){l.is(Lt)&&(l.set(rt),a(_r)),h&&(C(D),$e(D)),s(R,Zt,H),s(R,Qt,f),h=!1}function x(D){!F&&k&&$e(D,!0)}function T(D){P=M,M=D,y=E()}function C(D){var S=X(D),U=oe(S),Y=n.rewind&&n.rewindByDrag;b(!1),I?w.scroll(U,0,n.snap):e.is(At)?w.go(A(ln(S))<0?Y?"<":"-":Y?">":"+"):e.is(it)&&$&&Y?w.go(g(!0)?">":"<"):w.go(w.toDest(U),!0),b(!0)}function m(D){var S=n.dragMinThreshold,U=dt(S),Y=U&&S.mouse||0,Z=(U?S.touch:+S)||10;return ve(re(D))>(fe(D)?Z:Y)}function O(D){return ve(re(D))>ve(re(D,!0))}function X(D){if(e.is(st)||!$){var S=ye(D);if(S&&S<Un)return re(D)/S}return 0}function oe(D){return E()+ln(D)*De(ve(D)*(n.flickPower||600),I?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function re(D,S){return J(D,S)-J(L(D),S)}function ye(D){return an(D)-an(L(D))}function L(D){return M===D&&P||M}function J(D,S){return(fe(D)?D.changedTouches[0]:D)["page"+d(S?"Y":"X")]}function ge(D){return D/($&&e.is(it)?ii:1)}function le(D){var S=n.noDrag;return!gt(D,"."+jr+", ."+qt)&&(!S||!gt(D,S))}function fe(D){return typeof TouchEvent<"u"&&D instanceof TouchEvent}function je(){return h}function Xe(D){F=D}return{mount:N,disable:Xe,isDragging:je}}var Ti={Spacebar:" ",Right:Ut,Left:Ht,Up:Ir,Down:$r};function Rn(e){return e=Fe(e)?e:e.key,Ti[e]||e}var Gn="keydown";function Ii(e,t,n){var r=ue(e),o=r.on,a=r.bind,i=r.unbind,s=e.root,l=t.Direction.resolve,p,c;function w(){v(),o(he,b),o(he,v),o(Oe,d)}function v(){var E=n.keyboard;E&&(p=E==="global"?window:s,a(p,Gn,A))}function b(){i(p,Gn)}function u(E){c=E}function d(){var E=c;c=!0,ir(function(){c=E})}function A(E){if(!c){var g=Rn(E);g===l(Ht)?e.go("<"):g===l(Ut)&&e.go(">")}}return{mount:w,destroy:b,disable:u}}var ut=bn+"-lazy",Nt=ut+"-srcset",$i="["+ut+"], ["+Nt+"]";function Li(e,t,n){var r=ue(e),o=r.on,a=r.off,i=r.bind,s=r.emit,l=n.lazyLoad==="sequential",p=[lt,qe],c=[];function w(){n.lazyLoad&&(v(),o(me,v))}function v(){Ne(c),b(),l?E():(a(p),o(p,u),u())}function b(){t.Slides.forEach(function(g){vn(g.slide,$i).forEach(function(y){var M=xe(y,ut),P=xe(y,Nt);if(M!==y.src||P!==y.srcset){var I=n.classes.spinner,h=y.parentElement,$=xt(h,"."+I)||tt("span",I,h);c.push([y,g,$]),y.src||yt(y,"none")}})})}function u(){c=c.filter(function(g){var y=n.perPage*((n.preloadPages||1)+1)-1;return g[1].isWithin(e.index,y)?d(g):!0}),c.length||a(p)}function d(g){var y=g[0];Ee(g[1].slide,pn),i(y,"load error",ae(A,g)),Q(y,"src",xe(y,ut)),Q(y,"srcset",xe(y,Nt)),Ae(y,ut),Ae(y,Nt)}function A(g,y){var M=g[0],P=g[1];Re(P.slide,pn),y.type!=="error"&&(Ge(g[2]),yt(M,""),s(An,M,P),s(ot)),l&&E()}function E(){c.length&&d(c.shift())}return{mount:w,destroy:ae(Ne,c),check:u}}function Ri(e,t,n){var r=ue(e),o=r.on,a=r.emit,i=r.bind,s=t.Slides,l=t.Elements,p=t.Controller,c=p.hasFocus,w=p.getIndex,v=p.go,b=t.Direction.resolve,u=l.pagination,d=[],A,E;function g(){y(),o([he,me,Pt],g);var F=n.pagination;u&&yt(u,F?"":"none"),F&&(o([Oe,zt,qe],k),M(),k(),a(xr,{list:A,items:d},$(e.index)))}function y(){A&&(Ge(u?ze(A.children):A),Re(A,E),Ne(d),A=null),r.destroy()}function M(){var F=e.length,R=n.classes,N=n.i18n,V=n.perPage,W=c()?p.getEnd()+1:ht(F/V);A=u||tt("ul",R.pagination,l.track.parentElement),Ee(A,E=Xt+"--"+h()),Q(A,ke,"tablist"),Q(A,_e,N.select),Q(A,In,h()===Gt?"vertical":"");for(var H=0;H<W;H++){var f=tt("li",null,A),x=tt("button",{class:R.page,type:"button"},f),T=s.getIn(H).map(function(m){return m.slide.id}),C=!c()&&V>1?N.pageX:N.slideX;i(x,"click",ae(P,H)),n.paginationKeyboard&&i(x,"keydown",ae(I,H)),Q(f,ke,"presentation"),Q(x,ke,"tab"),Q(x,Et,T.join(" ")),Q(x,_e,sn(C,H+1)),Q(x,nt,-1),d.push({li:f,button:x,page:H})}}function P(F){v(">"+F,!0)}function I(F,R){var N=d.length,V=Rn(R),W=h(),H=-1;V===b(Ut,!1,W)?H=++F%N:V===b(Ht,!1,W)?H=(--F+N)%N:V==="Home"?H=0:V==="End"&&(H=N-1);var f=d[H];f&&(cr(f.button),v(">"+H),$e(R,!0))}function h(){return n.paginationDirection||n.direction}function $(F){return d[p.toPage(F)]}function k(){var F=$(w(!0)),R=$(w());if(F){var N=F.button;Re(N,Ye),Ae(N,Dn),Q(N,nt,-1)}if(R){var V=R.button;Ee(V,Ye),Q(V,Dn,!0),Q(V,nt,"")}a(wr,{list:A,items:d},F,R)}return{items:d,mount:g,destroy:y,getAt:$,update:k}}var ki=[" ","Enter"];function Ni(e,t,n){var r=n.isNavigation,o=n.slideFocus,a=[];function i(){e.splides.forEach(function(u){u.isParent||(p(e,u.splide),p(u.splide,e))}),r&&c()}function s(){a.forEach(function(u){u.destroy()}),Ne(a)}function l(){s(),i()}function p(u,d){var A=ue(u);A.on(Oe,function(E,g,y){d.go(d.is(st)?y:E)}),a.push(A)}function c(){var u=ue(e),d=u.on;d(Sn,v),d(Ar,b),d([Me,he],w),a.push(u),u.emit(xn,e.splides)}function w(){Q(t.Elements.list,In,n.direction===Gt?"vertical":"")}function v(u){e.go(u.index)}function b(u,d){yn(ki,Rn(d))&&(v(u),$e(d))}return{setup:ae(t.Media.set,{slideFocus:_t(o)?r:o},!0),mount:i,destroy:s,remount:l}}function Oi(e,t,n){var r=ue(e),o=r.bind,a=0;function i(){n.wheel&&o(t.Elements.track,"wheel",s,Qe)}function s(p){if(p.cancelable){var c=p.deltaY,w=c<0,v=an(p),b=n.wheelMinThreshold||0,u=n.wheelSleep||0;ve(c)>b&&v-a>u&&(e.go(w?"<":">"),a=v),l(w)&&$e(p)}}function l(p){return!n.releaseWheel||e.state.is(at)||t.Controller.getAdjacent(p)!==-1}return{mount:i}}var ji=90;function Vi(e,t,n){var r=ue(e),o=r.on,a=t.Elements.track,i=n.live&&!n.isNavigation,s=tt("span",ei),l=Mt(ji,ae(c,!1));function p(){i&&(v(!t.Autoplay.isPaused()),Q(a,Wn,!0),s.textContent="…",o(wn,ae(v,!0)),o(En,ae(v,!1)),o([lt,qe],ae(c,!0)))}function c(b){Q(a,Mn,b),b?(Ct(a,s),l.start()):(Ge(s),l.cancel())}function w(){Ae(a,[zn,Wn,Mn]),Ge(s)}function v(b){i&&Q(a,zn,b?"off":"polite")}return{mount:p,disable:v,destroy:w}}var Pi=Object.freeze({__proto__:null,Media:Uo,Direction:Go,Elements:ai,Slides:si,Layout:ci,Clones:pi,Move:di,Controller:gi,Arrows:yi,Autoplay:vi,Cover:bi,Scroll:Ei,Drag:Ai,Keyboard:Ii,LazyLoad:Li,Pagination:Ri,Sync:Ni,Wheel:Oi,Live:Vi}),Bi={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"},Fi={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:ri,i18n:Bi,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Di(e,t,n){var r=t.Slides;function o(){ue(e).on([Me,me],a)}function a(){r.forEach(function(s){s.style("transform","translateX(-"+100*s.index+"%)")})}function i(s,l){r.style("transition","opacity "+n.speed+"ms "+n.easing),ir(l)}return{mount:o,start:i,cancel:on}}function zi(e,t,n){var r=t.Move,o=t.Controller,a=t.Scroll,i=t.Elements.list,s=ae(Ce,i,"transition"),l;function p(){ue(e).bind(i,"transitionend",function(b){b.target===i&&l&&(w(),l())})}function c(b,u){var d=r.toPosition(b,!0),A=r.getPosition(),E=v(b);ve(d-A)>=1&&E>=1?n.useScroll?a.scroll(d,E,!1,u):(s("transform "+E+"ms "+n.easing),r.translate(d,!0),l=u):(r.jump(b),u())}function w(){s(""),a.cancel()}function v(b){var u=n.rewindSpeed;if(e.is(it)&&u){var d=o.getIndex(!0),A=o.getEnd();if(d===0&&b>=A||d>=A&&b===0)return u}return n.speed}return{mount:p,start:c,cancel:w}}var Mi=(function(){function e(n,r){this.event=ue(),this.Components={},this.state=Wo(et),this.splides=[],this._o={},this._E={};var o=Fe(n)?pr(document,n):n;ct(o,o+" is invalid."),this.root=o,r=Be({label:xe(o,_e)||"",labelledby:xe(o,Tn)||""},Fi,e.defaults,r||{});try{Be(r,JSON.parse(xe(o,bn)))}catch{ct(!1,"Invalid JSON")}this._o=Object.create(Be({},r))}var t=e.prototype;return t.mount=function(r,o){var a=this,i=this.state,s=this.Components;ct(i.is([et,Ot]),"Already mounted!"),i.set(et),this._C=s,this._T=o||this._T||(this.is(At)?Di:zi),this._E=r||this._E;var l=mt({},Pi,this._E,{Transition:this._T});return Ue(l,function(p,c){var w=p(a,s,a._o);s[c]=w,w.setup&&w.setup()}),Ue(s,function(p){p.mount&&p.mount()}),this.emit(Me),Ee(this.root,ti),i.set(rt),this.emit(cn),this},t.sync=function(r){return this.splides.push({splide:r}),r.splides.push({splide:this,isParent:!0}),this.state.is(rt)&&(this._C.Sync.remount(),r.Components.Sync.remount()),this},t.go=function(r){return this._C.Controller.go(r),this},t.on=function(r,o){return this.event.on(r,o),this},t.off=function(r){return this.event.off(r),this},t.emit=function(r){var o;return(o=this.event).emit.apply(o,[r].concat(ze(arguments,1))),this},t.add=function(r,o){return this._C.Slides.add(r,o),this},t.remove=function(r){return this._C.Slides.remove(r),this},t.is=function(r){return this._o.type===r},t.refresh=function(){return this.emit(me),this},t.destroy=function(r){r===void 0&&(r=!0);var o=this.event,a=this.state;return a.is(et)?ue(this).on(cn,this.destroy.bind(this,r)):(Ue(this._C,function(i){i.destroy&&i.destroy(r)},!0),o.emit(Cn),o.destroy(),r&&Ne(this.splides),a.set(Ot)),this},Bo(e,[{key:"options",get:function(){return this._o},set:function(r){this._C.Media.set(r,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),kn=Mi;kn.defaults={};kn.STATES=Do;var Yn=[[Me,"onMounted"],[cn,"onReady"],[Oe,"onMove"],[lt,"onMoved"],[Sn,"onClick"],[fr,"onActive"],[mr,"onInactive"],[yr,"onVisible"],[hr,"onHidden"],[me,"onRefresh"],[he,"onUpdated"],[ot,"onResize"],[Dt,"onResized"],[vr,"onDrag"],[br,"onDragging"],[_r,"onDragged"],[zt,"onScroll"],[qe,"onScrolled"],[Cn,"onDestroy"],[Sr,"onArrowsMounted"],[Cr,"onArrowsUpdated"],[xr,"onPaginationMounted"],[wr,"onPaginationUpdated"],[xn,"onNavigationMounted"],[wn,"onAutoplayPlay"],[Er,"onAutoplayPlaying"],[En,"onAutoplayPause"],[An,"onLazyLoadLoaded"]];function Nn(...e){return e.filter(Boolean).join(" ")}function Bt(e){return e!==null&&typeof e=="object"}function dn(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,r)=>!dn(n,t[r]));if(Bt(e)&&Bt(t)){const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!dn(e[o],t[o]))}return e===t}function Wi(e,t){return e.length===t.length&&!e.some((n,r)=>n!==t[r])}function Hi(e,t){if(e){const n=Object.keys(e);for(let r=0;r<n.length;r++){const o=n[r];if(o!=="__proto__"&&t(e[o],o)===!1)break}}return e}function gn(e,t){const n=e;return Hi(t,(r,o)=>{Array.isArray(r)?n[o]=r.slice():Bt(r)?n[o]=gn(Bt(n[o])?n[o]:{},r):n[o]=r}),n}var Ui=({children:e,className:t,...n})=>z.createElement("div",{className:Nn("splide__track",t),...n},z.createElement("ul",{className:"splide__list"},e)),zr=class extends z.Component{constructor(){super(...arguments),this.splideRef=z.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:r}=this.splideRef;r&&(this.splide=new kn(r,e),this.bind(this.splide),this.splide.mount(t,n),this.options=gn({},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&&!dn(this.options,e)&&(this.splide.options=e,this.options=gn({},e));const t=this.getSlides();Wi(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){Yn.forEach(([t,n])=>{const r=this.props[n];typeof r=="function"&&e.on(t,(...o)=>{r(e,...o)})})}omit(e,t){return t.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}),e}render(){const{className:e,tag:t="div",hasTrack:n=!0,children:r,...o}=this.props;return z.createElement(t,{className:Nn("splide",e),ref:this.splideRef,...this.omit(o,["options",...Yn.map(a=>a[1])])},n?z.createElement(Ui,null,r):r)}},Mr=({children:e,className:t,...n})=>z.createElement("li",{className:Nn("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 Uo="RichTextRenderer-module__link___BWeZ2",Go={link:Uo},Wr=({content:e})=>{const t=n=>n.map((r,o)=>r.type==="link"?b.jsx("a",{className:Go.link,href:r.value,target:r.target,children:t(r.children)},o):b.jsx("span",{style:Yo(r),children:r.text},o));return b.jsx(b.Fragment,{children:e.map((n,r)=>{const o=n.children;return b.jsx("div",{children:t(o)},r)})})};function Yo(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 Xo="SvgImage-module__svg___q3xE-",qo="SvgImage-module__img___VsTm-",Xn={svg:Xo,img:qo},ut=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:r=""})=>{const[o,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")||!o?b.jsx("img",{src:e,alt:"",className:se(Xn.img,r)}):b.jsx("span",{"data-supports-mask":o,className:se(Xn.svg,r),style:{"--svg":`url(${e})`,"--fill":t,"--hover-fill":n}})},Ko={"top-left":U.topLeftAlignment,"top-center":U.topCenterAlignment,"top-right":U.topRightAlignment,"middle-left":U.middleLeftAlignment,"middle-center":U.middleCenterAlignment,"middle-right":U.middleRightAlignment,"bottom-left":U.bottomLeftAlignment,"bottom-center":U.bottomCenterAlignment,"bottom-right":U.bottomRightAlignment};function Jo({settings:e,content:t,styles:n,isEditor:r}){const[o,a]=D.useState(null),{widthSettings:i,fontSettings:s,letterSpacing:l,textAlign:p,wordSpacing:u,fontSizeLineHeight:x,textAppearance:m,color:h}=n.imageCaption,[c,d]=D.useState(void 0),[w,v]=D.useState(null),[g,C]=D.useState(0),[W,F]=D.useState(0),{direction:I,transition:y,controls:A,pagination:k,imageCaption:$,triggers:E}=e,O=D.useRef(y.type),{x:V,y:G}=e.controls.offset,M=f=>{o&&o.go(f)};return D.useEffect(()=>{if(!w)return;const f=new ResizeObserver(N=>{if(!o)return;const[T]=N;d({width:Math.round(T.contentRect.width),height:Math.round(T.contentRect.height)})});return f.observe(w),()=>f.unobserve(w)},[w]),D.useEffect(()=>{!o||O.current===y.type||(F(f=>f+1),O.current=y.type)},[y.type]),b.jsx("div",{className:se(U.wrapper,{[U.editor]:r}),ref:v,children:b.jsxs("div",{className:U.sliderInner,style:{width:c?c.width:"100%",height:c?c.height:"100%",backgroundColor:y.backgroundColor&&y.type==="fade in"?y.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&b.jsx("div",{className:se(U.captionBlock),children:b.jsx("div",{className:U.captionTextWrapper,children:t.map((f,N)=>b.jsx("div",{className:se(U.captionText,Ko[$.alignment],{[U.withPointerEvents]:N===g&&r,[U.active]:N===g}),style:{fontFamily:s.fontFamily,fontWeight:s.fontWeight,fontStyle:s.fontStyle,width:i.sizing==="auto"?"max-content":B.scalingValue(i.width,r),letterSpacing:B.scalingValue(l,r),wordSpacing:B.scalingValue(u,r),textAlign:p,fontSize:B.scalingValue(x.fontSize,r),lineHeight:B.scalingValue(x.lineHeight,r),textTransform:m.textTransform??"none",textDecoration:m.textDecoration??"none",fontVariant:m.fontVariant??"normal",color:h,transitionDuration:y.duration?`${Math.round(parseInt(y.duration)/2)}ms`:"500ms"},children:b.jsx("div",{"data-styles":"imageCaption",className:U.captionTextInner,style:{"--link-hover-color":$.linkHoverColor,"--link-color":$.linkColor,position:"relative",top:B.scalingValue($.offset.y,r),left:B.scalingValue($.offset.x,r)},children:b.jsx(Wr,{content:f.imageCaption})})},N))})}),b.jsx(zr,{onMove:f=>{C(f.index)},ref:a,options:{arrows:!1,speed:y.duration?parseInt(y.duration):500,autoplay:E.autoPlay!==null,...E.autoPlay!==null&&{interval:parseInt(E.autoPlay)*1e3},direction:I==="horiz"||y.type==="fade in"?"ltr":"ttb",pagination:!1,drag:E.triggersList.drag,perPage:1,width:c?c.width:"100%",height:c?c.height:"100%",type:y.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((f,N)=>b.jsx(Dr,{children:b.jsx("div",{className:U.sliderItem,children:b.jsx("div",{className:U.imgWrapper,children:b.jsx("img",{className:se(U.sliderImage,{[U.contain]:f.image.objectFit==="contain",[U.cover]:f.image.objectFit==="cover"}),src:f.image.url,alt:f.image.name??""})})})},N))},W),A.isActive&&b.jsxs(b.Fragment,{children:[b.jsx("div",{className:se(U.arrow,{[U.arrowVertical]:I==="vert",[U.hoverArrow]:A.show==="on hover"}),style:{color:A.color,"--arrow-hover-color":A.hover},children:b.jsxs("button",{onClick:()=>{M("-1")},className:U.arrowInner,style:{transform:`translate(${B.scalingValue(V,r)}, ${B.scalingValue(G*(I==="horiz"?1:-1),r)}) scale(${e.controls.scale/100}) rotate(${I==="horiz"?"0deg":"90deg"})`},children:[A.arrowsImgUrl&&b.jsx(ut,{url:A.arrowsImgUrl,fill:A.color,hoverFill:A.hover,className:se(U.arrowImg,U.mirror)}),!A.arrowsImgUrl&&b.jsx(qn,{color:A.color,className:se(U.arrowIcon,U.arrowImg,U.mirror)})]})}),b.jsx("div",{className:se(U.arrow,U.nextArrow,{[U.arrowVertical]:I==="vert",[U.hoverArrow]:A.show==="on hover"}),style:{color:A.color,"--arrow-hover-color":A.hover},children:b.jsxs("button",{className:U.arrowInner,onClick:()=>M("+1"),style:{transform:`translate(${B.scalingValue(V*(I==="horiz"?-1:1),r)}, ${B.scalingValue(G,r)}) scale(${e.controls.scale/100}) rotate(${I==="horiz"?"0deg":"90deg"})`},children:[A.arrowsImgUrl&&b.jsx(ut,{url:A.arrowsImgUrl,fill:A.color,hoverFill:A.hover,className:U.arrowImg}),!A.arrowsImgUrl&&b.jsx(qn,{color:A.color,className:se(U.arrowIcon,U.arrowImg)})]})})]}),E.triggersList.click&&b.jsx("div",{className:U.clickOverlay,onClick:()=>{o&&o.go("+1")}}),k.isActive&&b.jsx("div",{className:se(U.pagination,{[U.paginationInsideBottom]:k.position==="inside-1"&&I==="horiz",[U.paginationInsideTop]:k.position==="inside-2"&&I==="horiz",[U.paginationOutsideBottom]:k.position==="outside-1"&&I==="horiz",[U.paginationOutsideTop]:k.position==="outside-2"&&I==="horiz",[U.paginationInsideLeft]:k.position==="inside-1"&&I==="vert",[U.paginationInsideRight]:k.position==="inside-2"&&I==="vert",[U.paginationOutsideLeft]:k.position==="outside-1"&&I==="vert",[U.paginationOutsideRight]:k.position==="outside-2"&&I==="vert",[U.paginationVertical]:I==="vert"}),children:b.jsx("div",{className:U.paginationInner,style:{backgroundColor:k.colors[2],transform:`scale(${k.scale/100}) translate(${B.scalingValue(k.offset.x,r)}, ${B.scalingValue(k.offset.y,r)}) rotate(${I==="horiz"?"0deg":"90deg"})`},children:t.map((f,N)=>b.jsx("button",{onClick:()=>{o&&o.go(N)},className:se(U.paginationItem),children:b.jsx("div",{className:se(U.dot,{[U.activeDot]:N===g}),style:{backgroundColor:N===g?k.colors[0]:k.colors[1],"--pagination-hover-color":k.hover}})},N))})})]})})}function qn({color:e,className:t}){return b.jsx("svg",{viewBox:"0 0 10 18",className:t,children:b.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:b.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 Zo={element:Jo,id:"control-slider",name:"Slider",preview:{type:"video",url:"https://cdn.cntrl.site/component-assets/Control-slider-preview.mp4"},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"]}},Qo="ImageRevealSlider-module__imageRevealSlider___UE5Ob",ea="ImageRevealSlider-module__image___Qjt-e",ta="ImageRevealSlider-module__link___N-iLG",na="ImageRevealSlider-module__cursor___2U03d",qe={imageRevealSlider:Qo,image:ea,link:ta,cursor:na};function Kn(e,t,n){for(const r of n){const o=new Image;o.src=r.url;const a=r.width?Number.parseFloat(r.width):o.naturalWidth,i=o.naturalHeight/o.naturalWidth*a,s=a/2,l=i/2;if(e>=r.x-s&&e<=r.x+s&&t>=r.y-l&&t<=r.y+l)return!0}return!1}function en(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function ra(e,t,n,r){let o,a;if(t==="custom"){o=n;const i=await en(e);a=i.height/i.width*o}else if(t==="random"){o=Math.random()*(r.max-r.min)+r.min;const i=await en(e);a=i.height/i.width*o}else{const i=await en(e);o=i.width,a=i.height}return{width:o,height:a,finalWidth:`${o}px`}}function ia({settings:e,content:t,isEditor:n}){const[r,o]=D.useState(null),[a,i]=D.useState([]),[s,l]=D.useState(0),p=D.useRef(0),[u,x]=D.useState({x:0,y:0}),[m,h]=D.useState(1),[c,d]=D.useState("none"),w=D.useRef({x:0,y:0}),[v,g]=D.useState(!1),{sizeType:C,imageWidth:W,randomRangeImageWidth:F}=e.imageSize,{revealPosition:I,visible:y}=e.position,{cursorType:A,target:k,defaultCursorScale:$,defaultCursor:E,hoverCursorScale:O,hoverCursor:V}=e.cursor;D.useEffect(()=>{if(!r)return;const f=(R,S)=>{const j=r.getBoundingClientRect(),Y=R-j.left,re=S-j.top;if(x({x:Y,y:re}),A==="system"){d("none"),h(1);return}const ne=Y,me=re,L=document.elementFromPoint(j.left+ne,j.top+me);if(L&&L.closest("a")){d("none"),h(1);return}const J=Kn(ne,me,a)||k==="area"?{img:V??"none",scale:O}:{img:E??"none",scale:$};d(J.img),h(J.scale)},N=R=>{R.stopPropagation(),w.current={x:R.clientX,y:R.clientY},f(R.clientX,R.clientY)},T=()=>{v&&f(w.current.x,w.current.y)};return r.addEventListener("mousemove",N),window.addEventListener("scroll",T,!0),()=>{r.removeEventListener("mousemove",N),window.removeEventListener("scroll",T,!0)}},[r,v,u,A,k,V,E,O,$,a]),D.useEffect(()=>{v||(d("none"),h(0))},[v]);const G=async(f,N,T,R={})=>{const{width:S,height:j,finalWidth:Y}=await ra(f.image.url,C,W,F);let re=0,ne=0;I==="same"?(re=N/2,ne=T/2):(re=R.x??Math.random()*N,ne=R.y??Math.random()*T);const me=Math.min(Math.max(re,S/2),N-S/2),L=Math.min(Math.max(ne,j/2),T-j/2);return{id:p.current++,url:f.image.url,link:f.link,name:f.image.name,x:me,y:L,width:Y}};D.useEffect(()=>{if(!r||t.length===0)return;const f=r.getBoundingClientRect(),N=f.width,T=f.height,R=[];(async()=>{const j=t[0],Y=await G(j,N,T);R.push(Y),i(R),l(1)})()},[C,W,F,I,r]),D.useEffect(()=>{y==="last One"&&i(f=>f.length>0?[f[f.length-1]]:[])},[y]);const M=async f=>{if(!r)return;const N=r.getBoundingClientRect(),T=f.clientX-N.left,R=f.clientY-N.top;if(k==="image"&&!Kn(T,R,a))return;let S=0,j=0;I==="on Click"?(S=T,j=R):I==="same"?(S=N.width/2,j=N.height/2):(S=Math.random()*N.width,j=Math.random()*N.height);const Y=t[s],re=await G(Y,N.width,N.height,{x:S,y:j});i(ne=>y==="all"?[...ne,re]:[re]),l(ne=>ne>=t.length-1?0:ne+1)};return b.jsxs("div",{ref:o,onClick:M,onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),className:qe.imageRevealSlider,style:{cursor:c==="none"?"default":"none"},children:[a.map(f=>b.jsx("div",{className:qe.wrapper,style:{top:`${f.y}px`,left:`${f.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:f.width??"auto",height:"auto",cursor:c==="none"?"default":"none"},children:k==="area"&&f.link?b.jsx("a",{href:f.link,target:"_blank",className:qe.link,children:b.jsx("img",{src:f.url,alt:f.name,className:qe.image},f.id)}):b.jsx("img",{src:f.url,alt:f.name,className:qe.image},f.id)},f.id)),v&&b.jsx("div",{className:qe.cursor,style:{left:`${u.x}px`,top:`${u.y}px`,transform:`translate(-50%, -50%) scale(${m})`,backgroundImage:`url('${c}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const oa={element:ia,id:"control-image-reveal",name:"Click Gallery",preview:{type:"video",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7EQ3WSW43JG5YMC8B2HTPKT.mp4"},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:""}]}}}},aa="LightBox-module__hidden___9s-9x",la="LightBox-module__heroImage___sTxNF",sa="LightBox-module__background___rm9ml",ca="LightBox-module__editor___4ACaY",ua="LightBox-module__contentStyle___Bgnsq",pa="LightBox-module__imageStyle___tLIlB",da="LightBox-module__imgWrapper___LuFUp",ga="LightBox-module__contain___8-yaS",fa="LightBox-module__cover___hNvOG",ma="LightBox-module__caption___b6L2I",ha="LightBox-module__captionTextInner___rCGNH",ya="LightBox-module__lightboxSplide___XFuWC",va="LightBox-module__arrow___iz38X",ba="LightBox-module__arrowVertical___Zfz81",_a="LightBox-module__nextArrow___zkAQN",Sa="LightBox-module__arrowInner___p48sW",xa="LightBox-module__arrowIcon___3VaFf",Ca="LightBox-module__arrowImg___pNV88",wa="LightBox-module__mirror___pjeXc",Ea="LightBox-module__thumbsWrapper___GB-nU",Aa="LightBox-module__thumbsContainerVertical___wttk5",Ia="LightBox-module__thumbsContainer___osSma",Ta="LightBox-module__thumbsAlignStart___MO6tY",La="LightBox-module__thumbsAlignCenter___Q4sUx",Ra="LightBox-module__thumbsAlignEnd___p4y9R",ka="LightBox-module__thumbItem___HvnF3",Na="LightBox-module__closeButton___g2khP",ja="LightBox-module__fadeIn___0m5GW",Oa="LightBox-module__slideInLeft___gPYwC",Va="LightBox-module__slideInRight___S-pPp",$a="LightBox-module__slideInTop___DFdAj",Pa="LightBox-module__slideInBottom___m27kZ",Ba="LightBox-module__fadeOut___55qBR",Fa="LightBox-module__slideOutLeft___NvU7P",za="LightBox-module__slideOutRight___SK7eC",Da="LightBox-module__slideOutTop___Vgg0z",Wa="LightBox-module__slideOutBottom___nJ0Ef",Ma="LightBox-module__scaleSlide___vZriG",P={hidden:aa,heroImage:la,background:sa,editor:ca,contentStyle:ua,imageStyle:pa,imgWrapper:da,contain:ga,cover:fa,caption:ma,captionTextInner:ha,lightboxSplide:ya,arrow:va,arrowVertical:ba,nextArrow:_a,arrowInner:Sa,arrowIcon:xa,arrowImg:Ca,mirror:wa,thumbsWrapper:Ea,thumbsContainerVertical:Aa,thumbsContainer:Ia,thumbsAlignStart:Ta,thumbsAlignCenter:La,thumbsAlignEnd:Ra,thumbItem:ka,closeButton:Na,fadeIn:ja,slideInLeft:Oa,slideInRight:Va,slideInTop:$a,slideInBottom:Pa,fadeOut:Ba,slideOutLeft:Fa,slideOutRight:za,slideOutTop:Da,slideOutBottom:Wa,scaleSlide:Ma},Lt=(e,t,n)=>{const r={},[o,a]=e.split("-");return o==="top"?(r.top="0",r.bottom="auto"):o==="middle"?(r.top="50%",r.bottom="auto"):o==="bottom"&&(r.top="auto",r.bottom="0"),a==="left"?(r.left="0",r.right="auto"):a==="center"?(r.left="50%",r.right="auto"):a==="right"&&(r.left="auto",r.right="0"),o==="middle"&&a==="center"?r.transform=`translate(calc(-50% + ${B.scalingValue(t.x,n)}), calc(-50% + ${B.scalingValue(t.y,n)}))`:o==="middle"?r.transform=`translate(${B.scalingValue(t.x,n)}, calc(-50% + ${B.scalingValue(t.y,n)}))`:a==="center"?r.transform=`translate(calc(-50% + ${B.scalingValue(t.x,n)}), ${B.scalingValue(t.y,n)})`:r.transform=`translate(${B.scalingValue(t.x,n)}, ${B.scalingValue(t.y,n)})`,r};function Mr(e){const t=window.getComputedStyle(e);return{top:parseFloat(t.paddingTop)||0,right:parseFloat(t.paddingRight)||0,bottom:parseFloat(t.paddingBottom)||0,left:parseFloat(t.paddingLeft)||0}}function Jn(e){const t=e.getBoundingClientRect(),n=Mr(e),r=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),a=e.naturalWidth,i=e.naturalHeight,s=r/o,l=a/i;let p,u;l>s?(p=r,u=r/l):(u=o,p=o*l);const x=t.left+n.left,m=t.top+n.top,h=(r-p)/2+x,c=(o-u)/2+m;return{x:h,y:c,width:p,height:u}}function Zn(e){const t=e.getBoundingClientRect(),n=Mr(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Qn(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const r=t[1].split(",").map(o=>parseFloat(o.trim()));return r.length===4?r[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const r=n[1].substring(6,8);return parseInt(r,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function Ha(e,t){const n=(()=>{if(e==="fade in")return P.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return P.slideInLeft;case"right":return P.slideInRight;case"top":return P.slideInTop;case"bottom":return P.slideInBottom;default:return P.slideInRight}return P.fadeIn})(),r=(()=>{if(e==="fade in"||e==="mix")return P.fadeIn;if(e==="slide in")switch(t){case"left":return P.slideInLeft;case"right":return P.slideInRight;case"top":return P.slideInTop;case"bottom":return P.slideInBottom;default:return P.slideInRight}return P.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return P.fadeOut;if(e==="slide in")switch(t){case"left":return P.slideOutLeft;case"right":return P.slideOutRight;case"top":return P.slideOutTop;case"bottom":return P.slideOutBottom;default:return P.slideOutRight}return P.fadeOut})(),a=(()=>{if(e==="fade in")return P.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return P.slideOutLeft;case"right":return P.slideOutRight;case"top":return P.slideOutTop;case"bottom":return P.slideOutBottom;default:return P.slideOutRight}return P.fadeOut})();return{appearClass:n,backdropAppearClass:r,backdropDisappearClass:o,disappearClass:a}}const Ua=({settings:e,content:t,styles:n,portalId:r,activeEvent:o,isEditor:a})=>{const[i,s]=D.useState(!1),{url:l}=e.thumbnailBlock.cover;return D.useEffect(()=>{o==="close"&&s(!1),o==="open"&&s(!0)},[o]),b.jsxs(b.Fragment,{children:[b.jsx("img",{src:l,alt:"Cover",className:P.heroImage,onClick:()=>s(!0)}),b.jsx(Ga,{isOpen:i,onClose:()=>s(!1),content:t,settings:e,lightboxStyles:n,portalId:r,isEditor:a})]})},Ga=({isOpen:e,onClose:t,content:n,lightboxStyles:r,settings:o,portalId:a,isEditor:i,metadata:s})=>{var z;const[l,p]=D.useState(0),[u,x]=D.useState(0),[m,h]=D.useState(!1),[c,d]=D.useState(!1),[w,v]=D.useState({}),g=D.useRef(null),C=D.useRef(null),W=D.useRef(null),F=D.useRef(!1),I=D.useRef(null),y=D.useRef(null),A=D.useRef(null),k=D.useRef(null),$=D.useRef(!1),E=D.useRef(null),[O,V]=D.useState(!1),{appear:G,triggers:M,slider:f,thumbnail:N,controls:T,area:R,caption:S,layout:j}=o.lightboxBlock,{appearClass:Y,backdropAppearClass:re,backdropDisappearClass:ne,disappearClass:me}=Ha(G.type,G.direction),L=(s==null?void 0:s.itemId)??null;D.useEffect(()=>{const _=()=>{setTimeout(()=>{var X,Q;(Q=(X=g.current)==null?void 0:X.splide)==null||Q.refresh()},16)},H=()=>{x(X=>X+1)};return window.addEventListener("ArticleEditor.Layout:change",_),window.addEventListener("ArticleEditor.ComponentContent:change",H),()=>{window.removeEventListener("ArticleEditor.Layout:change",_),window.removeEventListener("ArticleEditor.ComponentContent:change",H)}},[]),D.useEffect(()=>{if(!e||!N.isActive){V(!1);return}const _=E.current;if(!_)return;const H=()=>{f.direction==="horiz"?V(_.scrollWidth>_.clientWidth):V(_.scrollHeight>_.clientHeight)};H();const X=new ResizeObserver(H);return X.observe(_),()=>X.disconnect()},[e,N.isActive,n.length,w,f.direction]);const J=D.useCallback(()=>{const _=window.matchMedia("(max-width: 768px)").matches,H=Qn(R.color);_&&!i&&H>.9&&(document.body.style.backgroundColor=""),h(!0),F.current=!0;const X=Q=>{Q.target===I.current&&Q.animationName&&(I.current&&y.current&&I.current.removeEventListener("animationend",y.current),y.current=null,F.current&&(F.current=!1,t()),h(!1))};I.current&&(y.current=X,I.current.addEventListener("animationend",X))},[t,R.color,i]),fe=(_,H,X)=>{var Q,ie;if(_){if(M.type==="click"&&M.switch==="image")M.repeat==="close"&&l===n.length-1?J():(Q=g.current)==null||Q.go("+1");else if(M.type==="click"&&M.switch==="50/50"){const ee=_.getBoundingClientRect(),q=H-ee.left,le=X-ee.top,ve=ee.width,ue=ee.height;let he;f.direction==="horiz"?he=q<ve/2?"-1":"+1":he=le<ue/2?"-1":"+1",(ie=g.current)==null||ie.go(he)}}},ae=_=>{if($.current){$.current=!1;return}const H=n[l],X=(H==null?void 0:H.image.objectFit)==="cover";let Q,ie;if("changedTouches"in _&&_.changedTouches.length>0)Q=_.changedTouches[0].clientX,ie=_.changedTouches[0].clientY;else if("clientX"in _)Q=_.clientX,ie=_.clientY;else return;let ee;if(X&&W.current){const q=Zn(W.current);ee=Q>=q.left&&Q<=q.right&&ie>=q.top&&ie<=q.bottom}else{const q=W.current?Jn(W.current):null;if(!q){_.target===_.currentTarget&&J();return}ee=Q>=q.x&&Q<=q.x+q.width&&ie>=q.y&&ie<=q.y+q.height}ee?fe(W.current,Q,ie):J()},Z=_=>{const H=_.target;(H.classList.contains(P.thumbsWrapper)||H.classList.contains(P.thumbsContainer))&&ae(_)};D.useEffect(()=>{if(!e)return;const _=H=>{var X,Q;if(H.key==="Escape"){J();return}if(H.key==="ArrowRight"){p(ie=>(ie+1)%Math.max(n.length,1)),(X=g.current)==null||X.go("+1");return}H.key==="ArrowLeft"&&(p(ie=>(ie-1+Math.max(n.length,1))%Math.max(n.length,1)),(Q=g.current)==null||Q.go("-1"))};return window.addEventListener("keydown",_),()=>{window.removeEventListener("keydown",_)}},[e,J,n.length]),D.useEffect(()=>{if(e){if(p(0),x(H=>H+1),F.current=!1,h(!1),d(!1),v({}),!L)return;const _=new CustomEvent("page-overlay",{detail:{itemId:L}});window.dispatchEvent(_)}return()=>{I.current&&y.current&&(I.current.removeEventListener("animationend",y.current),y.current=null),d(!1)}},[e,L]),D.useEffect(()=>{C.current!==null&&C.current!==f.type&&x(_=>_+1),C.current=f.type},[f.type]),D.useEffect(()=>{if(!e)return;const _=document.body.style.overflow,H=window.matchMedia("(max-width: 768px)").matches,X=Qn(R.color);document.body.style.overflow="hidden",d(!1);const Q=ee=>{ee.target===I.current&&!F.current&&ee.animationName&&(H&&!i&&X>.9&&(document.body.style.backgroundColor=R.color),d(!0),I.current&&A.current&&I.current.removeEventListener("animationend",A.current),A.current=null)};I.current&&(A.current=Q,I.current.addEventListener("animationend",Q));const ie=ee=>{const q=ee.target;q&&(q.closest(`.${P.thumbsWrapper}`)||q.closest(`.${P.thumbsContainer}`))||f.type!=="slide"&&ee.preventDefault()};return document.addEventListener("touchmove",ie,{passive:!1}),()=>{document.body.style.overflow=_,document.removeEventListener("touchmove",ie),I.current&&A.current&&(I.current.removeEventListener("animationend",A.current),A.current=null),d(!1)}},[e,i,R.color,f.type]),D.useEffect(()=>{if(!e)return;const _=H=>{var Q,ie;if(F.current){H.stopPropagation();return}if($.current){$.current=!1;return}const X=H.target;if(!(X&&(X.closest(`.${P.thumbsContainer}`)||X.closest(`.${P.thumbItem}`)))){if(f.type==="slide"&&M.type==="drag"&&((ie=(Q=g.current)==null?void 0:Q.splide)!=null&&ie.root)){const ee=g.current.splide.root;if(X&&(ee.contains(X)||ee===X))return}if(H.touches.length===0&&H.changedTouches.length>0){const ee=n[l],q=(ee==null?void 0:ee.image.objectFit)==="cover",le=H.changedTouches[0];let ve;if(q&&W.current){const ue=Zn(W.current);ve=le.clientX>=ue.left&&le.clientX<=ue.right&&le.clientY>=ue.top&&le.clientY<=ue.bottom}else{const ue=W.current?Jn(W.current):null;if(!ue)return;ve=le.clientX>=ue.x&&le.clientX<=ue.x+ue.width&&le.clientY>=ue.y&&le.clientY<=ue.y+ue.height}if(!ve){H.stopPropagation(),F.current=!0;const ue=he=>{he.stopPropagation(),he.preventDefault(),document.removeEventListener("click",ue,!0)};document.addEventListener("click",ue,!0),J()}}}};return document.addEventListener("touchend",_,{passive:!0}),()=>{document.removeEventListener("touchend",_)}},[e,J,l,n]);const _e=(f.type==="scale"||f.type==="fade")&&f.direction==="vert"&&M.type==="drag";D.useEffect(()=>{var he,At;if(!e||!_e||!((At=(he=g.current)==null?void 0:he.splide)!=null&&At.root))return;const _=g.current.splide.root,H=30,X=(te,pe)=>{if(k.current){const Re=Math.abs(te-k.current.x),It=Math.abs(pe-k.current.y);(Re>0||It>0)&&($.current=!0)}},Q=te=>{k.current&&(te.preventDefault(),X(te.clientX,te.clientY))},ie=te=>{k.current&&te.touches.length>0&&(te.preventDefault(),X(te.touches[0].clientX,te.touches[0].clientY))},ee=(te,pe)=>{if(!k.current||!g.current){k.current=null;return}const Re=Math.abs(te-k.current.x),It=Math.abs(pe-k.current.y);It>H&&It>Re&&g.current.go(pe<k.current.y?"+1":"-1"),k.current=null},q=te=>{k.current&&ee(te.clientX,te.clientY),document.removeEventListener("pointerup",q),document.removeEventListener("pointercancel",q),document.removeEventListener("pointermove",Q)},le=te=>{if(k.current){if(te.changedTouches.length>0){const pe=te.changedTouches[0];ee(pe.clientX,pe.clientY)}document.removeEventListener("touchend",le),document.removeEventListener("touchcancel",le),document.removeEventListener("touchmove",ie)}},ve=te=>{k.current={x:te.clientX,y:te.clientY},$.current=!1,document.addEventListener("pointermove",Q,{passive:!1}),document.addEventListener("pointerup",q),document.addEventListener("pointercancel",q)},ue=te=>{te.touches.length>0&&(k.current={x:te.touches[0].clientX,y:te.touches[0].clientY},$.current=!1,document.addEventListener("touchmove",ie,{passive:!1}),document.addEventListener("touchend",le),document.addEventListener("touchcancel",le))};return _.addEventListener("pointerdown",ve),_.addEventListener("touchstart",ue),()=>{_.removeEventListener("pointerdown",ve),_.removeEventListener("touchstart",ue),document.removeEventListener("pointermove",Q),document.removeEventListener("pointerup",q),document.removeEventListener("pointercancel",q),document.removeEventListener("touchmove",ie),document.removeEventListener("touchend",le),document.removeEventListener("touchcancel",le),k.current=null,$.current=!1}},[e,_e,u]);const de={backgroundColor:R.color,backdropFilter:`blur(${R.blur}px)`,animationDuration:`${parseInt(G.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return document.getElementById(a)?Hr.createPortal(b.jsxs(b.Fragment,{children:[b.jsx("div",{ref:i?null:I,className:se(P.background,m?ne:re,{[P.editor]:i},{[P.hidden]:!e}),style:{...de,...c&&!i&&!m?{position:"absolute"}:{}}}),b.jsxs("div",{ref:i?I:null,className:se(P.contentStyle,m?me:Y,{[P.editor]:i},{[P.hidden]:!e}),style:{animationDuration:`${parseInt(G.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[b.jsx(zr,{onMove:_=>p(_.index),ref:g,className:P.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:M.type==="drag"&&!_e,perPage:1,width:"100%",height:"100%",type:f.type==="fade"||f.type==="scale"?"fade":"loop",padding:0,rewind:M.repeat!=="close",start:0},style:{"--splide-speed":f.duration},children:n.map((_,H)=>{const X=Lt(j.position,j.offset,i),Q=`${B.scalingValue(j.padding.top,i)} ${B.scalingValue(j.padding.right,i)} ${B.scalingValue(j.padding.bottom,i)} ${B.scalingValue(j.padding.left,i)}`,ie=f.type==="scale"?(()=>{const{transform:ee,...q}=X;return{...q,position:"absolute",padding:Q,boxSizing:"border-box","--position-transform":ee||"none"}})():{...X,position:"absolute",padding:Q,boxSizing:"border-box"};return b.jsx(Dr,{children:b.jsx("div",{className:P.imgWrapper,onClick:ae,children:b.jsx("img",{ref:H===l?W:null,className:se(P.imageStyle,{[P.contain]:_.image.objectFit==="contain",[P.cover]:_.image.objectFit==="cover",[P.scaleSlide]:f.type==="scale"}),src:_.image.url,alt:_.image.name??"",style:{...ie,pointerEvents:_.image.objectFit==="contain"?"none":"auto"}})})},H)})},u),T.isActive&&b.jsxs(b.Fragment,{children:[b.jsx("div",{className:se(P.arrow,{[P.arrowVertical]:f.direction==="vert"}),style:{color:T.color,"--arrow-hover-color":T.hover},children:b.jsxs("button",{className:P.arrowInner,style:{transform:`translate(${B.scalingValue(T.offset.x,i)}, ${B.scalingValue(T.offset.y*(f.direction==="horiz"?1:-1),i)}) scale(${T.scale}) rotate(${f.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var _;return(_=g.current)==null?void 0:_.go("-1")},"aria-label":"Previous",children:[T.arrowsImgUrl&&b.jsx(ut,{url:T.arrowsImgUrl,fill:T.color,hoverFill:T.hover,className:se(P.arrowImg,P.mirror)}),!T.arrowsImgUrl&&b.jsx(er,{color:T.color,className:se(P.arrowIcon,P.arrowImg,P.mirror)})]})}),b.jsx("div",{className:se(P.arrow,P.nextArrow,{[P.arrowVertical]:f.direction==="vert"}),style:{color:T.color,"--arrow-hover-color":T.hover},children:b.jsxs("button",{className:P.arrowInner,style:{transform:`translate(${B.scalingValue(T.offset.x*(f.direction==="horiz"?-1:1),i)}, ${B.scalingValue(T.offset.y,i)}) scale(${T.scale}) rotate(${f.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var _;return(_=g.current)==null?void 0:_.go("+1")},"aria-label":"Next",children:[T.arrowsImgUrl&&b.jsx(ut,{url:T.arrowsImgUrl,fill:T.color,hoverFill:T.hover,className:P.arrowImg}),!T.arrowsImgUrl&&b.jsx(er,{color:T.color,className:se(P.arrowIcon,P.arrowImg)})]})})]}),R.closeIconUrl&&(()=>{const _=Lt(R.closeIconAlign,R.closeIconOffset,i),H=`scale(${R.closeIconScale})`,X=_.transform?`${_.transform} ${H}`:H;return b.jsx("button",{className:P.closeButton,style:{..._,transform:X},onClick:J,"aria-label":"Close lightbox",children:b.jsx(ut,{url:R.closeIconUrl,fill:R.closeIconColor??"#000000",hoverFill:R.closeIconHover??"#cccccc"})})})(),S&&S.isActive&&r.imageCaption&&((z=n[l])==null?void 0:z.imageCaption)&&(()=>{const{widthSettings:_,fontSettings:H,letterSpacing:X,textAlign:Q,wordSpacing:ie,fontSizeLineHeight:ee,textAppearance:q,color:le}=r.imageCaption;return b.jsx("div",{className:P.caption,style:{...Lt(S.alignment,S.offset,i),fontFamily:H.fontFamily,fontWeight:H.fontWeight,fontStyle:H.fontStyle,width:_.sizing==="auto"?"max-content":B.scalingValue(_.width,i),letterSpacing:B.scalingValue(X,i),wordSpacing:B.scalingValue(ie,i),textAlign:Q,fontSize:B.scalingValue(ee.fontSize,i),lineHeight:B.scalingValue(ee.lineHeight,i),textTransform:q.textTransform??"none",textDecoration:q.textDecoration??"none",fontVariant:q.fontVariant??"normal",color:le},onClick:ve=>ve.stopPropagation(),children:b.jsx("div",{"data-styles":"imageCaption",className:P.captionTextInner,style:{"--link-color":S.linkColor,"--link-hover-color":S.linkHoverColor},children:b.jsx(Wr,{content:n[l].imageCaption})})})})(),N.isActive&&(()=>{const[_,H]=N.position.split("-"),X=f.direction==="horiz"?`${_}-left`:N.position,Q=Lt(X,N.offset,i),ie=()=>{if(f.direction==="horiz"){if(H==="left")return"flex-start";if(H==="center")return"center";if(H==="right")return"flex-end"}else{if(_==="top")return"flex-start";if(_==="middle")return"center";if(_==="bottom")return"flex-end"}return"flex-start"};return b.jsx("div",{ref:E,className:P.thumbsWrapper,onClick:ee=>Z(ee),style:{position:i?"absolute":"fixed",...Q,...f.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:b.jsx("div",{className:se(P.thumbsContainer,{[P.thumbsContainerVertical]:f.direction==="vert",[P.thumbsAlignStart]:N.align==="start",[P.thumbsAlignCenter]:N.align==="center",[P.thumbsAlignEnd]:N.align==="end"}),style:{gap:B.scalingValue(N.grid.gap,i),justifyContent:O?"flex-start":ie()},children:n.map((ee,q)=>{const le=q===l,ve=w[q],he=N.grid.size*(le?N.activeState.scale:1),At=()=>{if(N.fit!=="fit")return{};if(!ve)return f.direction==="horiz"?{height:B.scalingValue(he,i)}:{width:B.scalingValue(he,i)};const te=ve.width/ve.height;if(f.direction==="horiz"){const pe=he,Re=pe*te;return{width:B.scalingValue(Re,i),height:B.scalingValue(pe,i)}}else{const pe=he,Re=pe/te;return{width:B.scalingValue(pe,i),height:B.scalingValue(Re,i)}}};return b.jsx("button",{className:P.thumbItem,style:{...f.direction==="horiz"&&N.fit!=="fit"?{height:B.scalingValue(he,i)}:{},...f.direction==="vert"&&N.fit!=="fit"?{width:B.scalingValue(he,i)}:{},...N.fit==="cover"?{width:B.scalingValue(he,i),height:B.scalingValue(he,i)}:{},...At(),transition:le?"all 0.25s ease-out":"none",opacity:le?N.activeState.opacity/100:N.opacity/100,"--thumb-hover":N.activeState.opacity/100},onClick:te=>{var pe;te.stopPropagation(),p(q),(pe=g.current)==null||pe.go(q)},onMouseEnter:()=>{var te;N.triggers==="hov"&&((te=g.current)==null||te.go(q))},children:b.jsx("img",{src:ee.image.url,alt:ee.image.name??"",onLoad:te=>{const pe=te.currentTarget;pe.naturalWidth&&pe.naturalHeight&&v(Re=>({...Re,[q]:{width:pe.naturalWidth,height:pe.naturalHeight}}))},style:{objectFit:N.fit==="cover"?"cover":"contain",...N.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...N.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${ee.image.name}-${q}`)})})})})()]})]}),document.getElementById(a)):null};function er({color:e,className:t}){return b.jsx("svg",{viewBox:"0 0 10 18",className:t,children:b.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:b.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 Ya={element:Ua,id:"lightbox",name:"Lightbox",preview:{type:"video",url:"https://cdn.cntrl.site/component-assets/lightbox.mp4"},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 Ke(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Xa(e){return`
|
|
6
|
+
*/const Gi="RichTextRenderer-module__link___BWeZ2",Yi={link:Gi},Wr=({content:e})=>{const t=n=>n.map((r,o)=>r.type==="link"?_.jsx("a",{className:Yi.link,href:r.value,target:r.target,children:t(r.children)},o):_.jsx("span",{style:qi(r),children:r.text},o));return _.jsx(_.Fragment,{children:e.map((n,r)=>{const o=n.children;return _.jsx("div",{children:t(o)},r)})})};function qi(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 Xi="SvgImage-module__svg___q3xE-",Ki="SvgImage-module__img___VsTm-",qn={svg:Xi,img:Ki},pt=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:r=""})=>{const[o,a]=z.useState(!0);return z.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")||!o?_.jsx("img",{src:e,alt:"",className:ce(qn.img,r)}):_.jsx("span",{"data-supports-mask":o,className:ce(qn.svg,r),style:{"--svg":`url(${e})`,"--fill":t,"--hover-fill":n}})},Ji={"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 Zi({settings:e,content:t,styles:n,isEditor:r}){const[o,a]=z.useState(null),{widthSettings:i,fontSettings:s,letterSpacing:l,textAlign:p,wordSpacing:c,fontSizeLineHeight:w,textAppearance:v,color:b}=n.imageCaption,[u,d]=z.useState(void 0),[A,E]=z.useState(null),[g,y]=z.useState(0),[M,P]=z.useState(0),{direction:I,transition:h,controls:$,pagination:k,imageCaption:F,triggers:R}=e,N=z.useRef(h.type),{x:V,y:W}=e.controls.offset,H=f=>{o&&o.go(f)};return z.useEffect(()=>{if(!A)return;const f=new ResizeObserver(x=>{if(!o)return;const[T]=x;d({width:Math.round(T.contentRect.width),height:Math.round(T.contentRect.height)})});return f.observe(A),()=>f.unobserve(A)},[A]),z.useEffect(()=>{!o||N.current===h.type||(P(f=>f+1),N.current=h.type)},[h.type]),_.jsx("div",{className:ce(G.wrapper,{[G.editor]:r}),ref:E,children:_.jsxs("div",{className:G.sliderInner,style:{width:u?u.width:"100%",height:u?u.height:"100%",backgroundColor:h.backgroundColor&&h.type==="fade in"?h.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&_.jsx("div",{className:ce(G.captionBlock),children:_.jsx("div",{className:G.captionTextWrapper,children:t.map((f,x)=>_.jsx("div",{className:ce(G.captionText,Ji[F.alignment],{[G.withPointerEvents]:x===g&&r,[G.active]:x===g}),style:{fontFamily:s.fontFamily,fontWeight:s.fontWeight,fontStyle:s.fontStyle,width:i.sizing==="auto"?"max-content":j.scalingValue(i.width,r),letterSpacing:j.scalingValue(l,r),wordSpacing:j.scalingValue(c,r),textAlign:p,fontSize:j.scalingValue(w.fontSize,r),lineHeight:j.scalingValue(w.lineHeight,r),textTransform:v.textTransform??"none",textDecoration:v.textDecoration??"none",fontVariant:v.fontVariant??"normal",color:b,transitionDuration:h.duration?`${Math.round(parseInt(h.duration)/2)}ms`:"500ms"},children:_.jsx("div",{"data-styles":"imageCaption",className:G.captionTextInner,style:{"--link-hover-color":F.linkHoverColor,"--link-color":F.linkColor,position:"relative",top:j.scalingValue(F.offset.y,r),left:j.scalingValue(F.offset.x,r)},children:_.jsx(Wr,{content:f.imageCaption})})},x))})}),_.jsx(zr,{onMove:f=>{y(f.index)},ref:a,options:{arrows:!1,speed:h.duration?parseInt(h.duration):500,autoplay:R.autoPlay!==null,...R.autoPlay!==null&&{interval:parseInt(R.autoPlay)*1e3},direction:I==="horiz"||h.type==="fade in"?"ltr":"ttb",pagination:!1,drag:R.triggersList.drag,perPage:1,width:u?u.width:"100%",height:u?u.height:"100%",type:h.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((f,x)=>_.jsx(Mr,{children:_.jsx("div",{className:G.sliderItem,children:_.jsx("div",{className:G.imgWrapper,children:_.jsx("img",{className:ce(G.sliderImage,{[G.contain]:f.image.objectFit==="contain",[G.cover]:f.image.objectFit==="cover"}),src:f.image.url,alt:f.image.name??""})})})},x))},M),$.isActive&&_.jsxs(_.Fragment,{children:[_.jsx("div",{className:ce(G.arrow,{[G.arrowVertical]:I==="vert",[G.hoverArrow]:$.show==="on hover"}),style:{color:$.color,"--arrow-hover-color":$.hover},children:_.jsxs("button",{onClick:()=>{H("-1")},className:G.arrowInner,style:{transform:`translate(${j.scalingValue(V,r)}, ${j.scalingValue(W*(I==="horiz"?1:-1),r)}) scale(${e.controls.scale/100}) rotate(${I==="horiz"?"0deg":"90deg"})`},children:[$.arrowsImgUrl&&_.jsx(pt,{url:$.arrowsImgUrl,fill:$.color,hoverFill:$.hover,className:ce(G.arrowImg,G.mirror)}),!$.arrowsImgUrl&&_.jsx(Xn,{color:$.color,className:ce(G.arrowIcon,G.arrowImg,G.mirror)})]})}),_.jsx("div",{className:ce(G.arrow,G.nextArrow,{[G.arrowVertical]:I==="vert",[G.hoverArrow]:$.show==="on hover"}),style:{color:$.color,"--arrow-hover-color":$.hover},children:_.jsxs("button",{className:G.arrowInner,onClick:()=>H("+1"),style:{transform:`translate(${j.scalingValue(V*(I==="horiz"?-1:1),r)}, ${j.scalingValue(W,r)}) scale(${e.controls.scale/100}) rotate(${I==="horiz"?"0deg":"90deg"})`},children:[$.arrowsImgUrl&&_.jsx(pt,{url:$.arrowsImgUrl,fill:$.color,hoverFill:$.hover,className:G.arrowImg}),!$.arrowsImgUrl&&_.jsx(Xn,{color:$.color,className:ce(G.arrowIcon,G.arrowImg)})]})})]}),R.triggersList.click&&_.jsx("div",{className:G.clickOverlay,onClick:()=>{o&&o.go("+1")}}),k.isActive&&_.jsx("div",{className:ce(G.pagination,{[G.paginationInsideBottom]:k.position==="inside-1"&&I==="horiz",[G.paginationInsideTop]:k.position==="inside-2"&&I==="horiz",[G.paginationOutsideBottom]:k.position==="outside-1"&&I==="horiz",[G.paginationOutsideTop]:k.position==="outside-2"&&I==="horiz",[G.paginationInsideLeft]:k.position==="inside-1"&&I==="vert",[G.paginationInsideRight]:k.position==="inside-2"&&I==="vert",[G.paginationOutsideLeft]:k.position==="outside-1"&&I==="vert",[G.paginationOutsideRight]:k.position==="outside-2"&&I==="vert",[G.paginationVertical]:I==="vert"}),children:_.jsx("div",{className:G.paginationInner,style:{backgroundColor:k.colors[2],transform:`scale(${k.scale/100}) translate(${j.scalingValue(k.offset.x,r)}, ${j.scalingValue(k.offset.y,r)}) rotate(${I==="horiz"?"0deg":"90deg"})`},children:t.map((f,x)=>_.jsx("button",{onClick:()=>{o&&o.go(x)},className:ce(G.paginationItem),children:_.jsx("div",{className:ce(G.dot,{[G.activeDot]:x===g}),style:{backgroundColor:x===g?k.colors[0]:k.colors[1],"--pagination-hover-color":k.hover}})},x))})})]})})}function Xn({color:e,className:t}){return _.jsx("svg",{viewBox:"0 0 10 18",className:t,children:_.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:_.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 Qi={element:Zi,id:"control-slider",name:"Slider",preview:{type:"video",url:"https://cdn.cntrl.site/component-assets/Control-slider-preview.mp4"},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"]}},ea="ImageRevealSlider-module__imageRevealSlider___UE5Ob",ta="ImageRevealSlider-module__image___Qjt-e",na="ImageRevealSlider-module__link___N-iLG",ra="ImageRevealSlider-module__cursor___2U03d",Ke={imageRevealSlider:ea,image:ta,link:na,cursor:ra};function Kn(e,t,n){for(const r of n){const o=new Image;o.src=r.url;const a=r.width?Number.parseFloat(r.width):o.naturalWidth,i=o.naturalHeight/o.naturalWidth*a,s=a/2,l=i/2;if(e>=r.x-s&&e<=r.x+s&&t>=r.y-l&&t<=r.y+l)return!0}return!1}function en(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function oa(e,t,n,r){let o,a;if(t==="custom"){o=n;const i=await en(e);a=i.height/i.width*o}else if(t==="random"){o=Math.random()*(r.max-r.min)+r.min;const i=await en(e);a=i.height/i.width*o}else{const i=await en(e);o=i.width,a=i.height}return{width:o,height:a,finalWidth:`${o}px`}}function ia({settings:e,content:t,isEditor:n}){const[r,o]=z.useState(null),[a,i]=z.useState([]),[s,l]=z.useState(0),p=z.useRef(0),[c,w]=z.useState({x:0,y:0}),[v,b]=z.useState(1),[u,d]=z.useState("none"),A=z.useRef({x:0,y:0}),[E,g]=z.useState(!1),{sizeType:y,imageWidth:M,randomRangeImageWidth:P}=e.imageSize,{revealPosition:I,visible:h}=e.position,{cursorType:$,target:k,defaultCursorScale:F,defaultCursor:R,hoverCursorScale:N,hoverCursor:V}=e.cursor;z.useEffect(()=>{if(!r)return;const f=(C,m)=>{const O=r.getBoundingClientRect(),X=C-O.left,oe=m-O.top;if(w({x:X,y:oe}),$==="system"){d("none"),b(1);return}const re=X,ye=oe,L=document.elementFromPoint(O.left+re,O.top+ye);if(L&&L.closest("a")){d("none"),b(1);return}const J=Kn(re,ye,a)||k==="area"?{img:V??"none",scale:N}:{img:R??"none",scale:F};d(J.img),b(J.scale)},x=C=>{C.stopPropagation(),A.current={x:C.clientX,y:C.clientY},f(C.clientX,C.clientY)},T=()=>{E&&f(A.current.x,A.current.y)};return r.addEventListener("mousemove",x),window.addEventListener("scroll",T,!0),()=>{r.removeEventListener("mousemove",x),window.removeEventListener("scroll",T,!0)}},[r,E,c,$,k,V,R,N,F,a]),z.useEffect(()=>{E||(d("none"),b(0))},[E]);const W=async(f,x,T,C={})=>{const{width:m,height:O,finalWidth:X}=await oa(f.image.url,y,M,P);let oe=0,re=0;I==="same"?(oe=x/2,re=T/2):(oe=C.x??Math.random()*x,re=C.y??Math.random()*T);const ye=Math.min(Math.max(oe,m/2),x-m/2),L=Math.min(Math.max(re,O/2),T-O/2);return{id:p.current++,url:f.image.url,link:f.link,name:f.image.name,x:ye,y:L,width:X}};z.useEffect(()=>{if(!r||t.length===0)return;const f=r.getBoundingClientRect(),x=f.width,T=f.height,C=[];(async()=>{const O=t[0],X=await W(O,x,T);C.push(X),i(C),l(1)})()},[y,M,P,I,r]),z.useEffect(()=>{h==="last One"&&i(f=>f.length>0?[f[f.length-1]]:[])},[h]);const H=async f=>{if(!r)return;const x=r.getBoundingClientRect(),T=f.clientX-x.left,C=f.clientY-x.top;if(k==="image"&&!Kn(T,C,a))return;let m=0,O=0;I==="on Click"?(m=T,O=C):I==="same"?(m=x.width/2,O=x.height/2):(m=Math.random()*x.width,O=Math.random()*x.height);const X=t[s],oe=await W(X,x.width,x.height,{x:m,y:O});i(re=>h==="all"?[...re,oe]:[oe]),l(re=>re>=t.length-1?0:re+1)};return _.jsxs("div",{ref:o,onClick:H,onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),className:Ke.imageRevealSlider,style:{cursor:u==="none"?"default":"none"},children:[a.map(f=>_.jsx("div",{className:Ke.wrapper,style:{top:`${f.y}px`,left:`${f.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:f.width??"auto",height:"auto",cursor:u==="none"?"default":"none"},children:k==="area"&&f.link?_.jsx("a",{href:f.link,target:"_blank",className:Ke.link,children:_.jsx("img",{src:f.url,alt:f.name,className:Ke.image},f.id)}):_.jsx("img",{src:f.url,alt:f.name,className:Ke.image},f.id)},f.id)),E&&_.jsx("div",{className:Ke.cursor,style:{left:`${c.x}px`,top:`${c.y}px`,transform:`translate(-50%, -50%) scale(${v})`,backgroundImage:`url('${u}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const aa={element:ia,id:"control-image-reveal",name:"Click Gallery",preview:{type:"video",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7EQ3WSW43JG5YMC8B2HTPKT.mp4"},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:""}]}}}},la="LightBox-module__hidden___9s-9x",sa="LightBox-module__heroImage___sTxNF",ca="LightBox-module__background___rm9ml",ua="LightBox-module__editor___4ACaY",pa="LightBox-module__contentStyle___Bgnsq",da="LightBox-module__imageStyle___tLIlB",ga="LightBox-module__imgWrapper___LuFUp",fa="LightBox-module__contain___8-yaS",ma="LightBox-module__cover___hNvOG",ya="LightBox-module__caption___b6L2I",ha="LightBox-module__captionTextInner___rCGNH",va="LightBox-module__lightboxSplide___XFuWC",ba="LightBox-module__arrow___iz38X",_a="LightBox-module__arrowVertical___Zfz81",Sa="LightBox-module__nextArrow___zkAQN",Ca="LightBox-module__arrowInner___p48sW",xa="LightBox-module__arrowIcon___3VaFf",wa="LightBox-module__arrowImg___pNV88",Ea="LightBox-module__mirror___pjeXc",Aa="LightBox-module__thumbsWrapper___GB-nU",Ta="LightBox-module__thumbsContainerVertical___wttk5",Ia="LightBox-module__thumbsContainer___osSma",$a="LightBox-module__thumbsAlignStart___MO6tY",La="LightBox-module__thumbsAlignCenter___Q4sUx",Ra="LightBox-module__thumbsAlignEnd___p4y9R",ka="LightBox-module__thumbItem___HvnF3",Na="LightBox-module__closeButton___g2khP",Oa="LightBox-module__fadeIn___0m5GW",ja="LightBox-module__slideInLeft___gPYwC",Va="LightBox-module__slideInRight___S-pPp",Pa="LightBox-module__slideInTop___DFdAj",Ba="LightBox-module__slideInBottom___m27kZ",Fa="LightBox-module__fadeOut___55qBR",Da="LightBox-module__slideOutLeft___NvU7P",za="LightBox-module__slideOutRight___SK7eC",Ma="LightBox-module__slideOutTop___Vgg0z",Wa="LightBox-module__slideOutBottom___nJ0Ef",Ha="LightBox-module__scaleSlide___vZriG",B={hidden:la,heroImage:sa,background:ca,editor:ua,contentStyle:pa,imageStyle:da,imgWrapper:ga,contain:fa,cover:ma,caption:ya,captionTextInner:ha,lightboxSplide:va,arrow:ba,arrowVertical:_a,nextArrow:Sa,arrowInner:Ca,arrowIcon:xa,arrowImg:wa,mirror:Ea,thumbsWrapper:Aa,thumbsContainerVertical:Ta,thumbsContainer:Ia,thumbsAlignStart:$a,thumbsAlignCenter:La,thumbsAlignEnd:Ra,thumbItem:ka,closeButton:Na,fadeIn:Oa,slideInLeft:ja,slideInRight:Va,slideInTop:Pa,slideInBottom:Ba,fadeOut:Fa,slideOutLeft:Da,slideOutRight:za,slideOutTop:Ma,slideOutBottom:Wa,scaleSlide:Ha},$t=(e,t,n)=>{const r={},[o,a]=e.split("-");return o==="top"?(r.top="0",r.bottom="auto"):o==="middle"?(r.top="50%",r.bottom="auto"):o==="bottom"&&(r.top="auto",r.bottom="0"),a==="left"?(r.left="0",r.right="auto"):a==="center"?(r.left="50%",r.right="auto"):a==="right"&&(r.left="auto",r.right="0"),o==="middle"&&a==="center"?r.transform=`translate(calc(-50% + ${j.scalingValue(t.x,n)}), calc(-50% + ${j.scalingValue(t.y,n)}))`:o==="middle"?r.transform=`translate(${j.scalingValue(t.x,n)}, calc(-50% + ${j.scalingValue(t.y,n)}))`:a==="center"?r.transform=`translate(calc(-50% + ${j.scalingValue(t.x,n)}), ${j.scalingValue(t.y,n)})`:r.transform=`translate(${j.scalingValue(t.x,n)}, ${j.scalingValue(t.y,n)})`,r};function Hr(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 Jn(e){const t=e.getBoundingClientRect(),n=Hr(e),r=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),a=e.naturalWidth,i=e.naturalHeight,s=r/o,l=a/i;let p,c;l>s?(p=r,c=r/l):(c=o,p=o*l);const w=t.left+n.left,v=t.top+n.top,b=(r-p)/2+w,u=(o-c)/2+v;return{x:b,y:u,width:p,height:c}}function Zn(e){const t=e.getBoundingClientRect(),n=Hr(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Qn(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const r=t[1].split(",").map(o=>parseFloat(o.trim()));return r.length===4?r[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const r=n[1].substring(6,8);return parseInt(r,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function Ua(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})(),r=(()=>{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})(),o=(()=>{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:r,backdropDisappearClass:o,disappearClass:a}}const Ga=({settings:e,content:t,styles:n,portalId:r,activeEvent:o,isEditor:a})=>{const[i,s]=z.useState(!1),{url:l}=e.thumbnailBlock.cover;return z.useEffect(()=>{o==="close"&&s(!1),o==="open"&&s(!0)},[o]),_.jsxs(_.Fragment,{children:[_.jsx("img",{src:l,alt:"Cover",className:B.heroImage,onClick:()=>s(!0)}),_.jsx(Ya,{isOpen:i,onClose:()=>s(!1),content:t,settings:e,lightboxStyles:n,portalId:r,isEditor:a})]})},Ya=({isOpen:e,onClose:t,content:n,lightboxStyles:r,settings:o,portalId:a,isEditor:i,metadata:s})=>{var D;const[l,p]=z.useState(0),[c,w]=z.useState(0),[v,b]=z.useState(!1),[u,d]=z.useState(!1),[A,E]=z.useState({}),g=z.useRef(null),y=z.useRef(null),M=z.useRef(null),P=z.useRef(!1),I=z.useRef(null),h=z.useRef(null),$=z.useRef(null),k=z.useRef(null),F=z.useRef(!1),R=z.useRef(null),[N,V]=z.useState(!1),{appear:W,triggers:H,slider:f,thumbnail:x,controls:T,area:C,caption:m,layout:O}=o.lightboxBlock,{appearClass:X,backdropAppearClass:oe,backdropDisappearClass:re,disappearClass:ye}=Ua(W.type,W.direction),L=(s==null?void 0:s.itemId)??null;z.useEffect(()=>{const S=()=>{setTimeout(()=>{var Y,Z;(Z=(Y=g.current)==null?void 0:Y.splide)==null||Z.refresh()},16)},U=()=>{w(Y=>Y+1)};return window.addEventListener("ArticleEditor.Layout:change",S),window.addEventListener("ArticleEditor.ComponentContent:change",U),()=>{window.removeEventListener("ArticleEditor.Layout:change",S),window.removeEventListener("ArticleEditor.ComponentContent:change",U)}},[]),z.useEffect(()=>{if(!e||!x.isActive){V(!1);return}const S=R.current;if(!S)return;const U=()=>{f.direction==="horiz"?V(S.scrollWidth>S.clientWidth):V(S.scrollHeight>S.clientHeight)};U();const Y=new ResizeObserver(U);return Y.observe(S),()=>Y.disconnect()},[e,x.isActive,n.length,A,f.direction]);const J=z.useCallback(()=>{const S=window.matchMedia("(max-width: 768px)").matches,U=Qn(C.color);S&&!i&&U>.9&&(document.body.style.backgroundColor=""),b(!0),P.current=!0;const Y=Z=>{Z.target===I.current&&Z.animationName&&(I.current&&h.current&&I.current.removeEventListener("animationend",h.current),h.current=null,P.current&&(P.current=!1,t()),b(!1))};I.current&&(h.current=Y,I.current.addEventListener("animationend",Y))},[t,C.color,i]),ge=(S,U,Y)=>{var Z,ie;if(S){if(H.type==="click"&&H.switch==="image")H.repeat==="close"&&l===n.length-1?J():(Z=g.current)==null||Z.go("+1");else if(H.type==="click"&&H.switch==="50/50"){const ee=S.getBoundingClientRect(),K=U-ee.left,q=Y-ee.top,pe=ee.width,te=ee.height;let se;f.direction==="horiz"?se=K<pe/2?"-1":"+1":se=q<te/2?"-1":"+1",(ie=g.current)==null||ie.go(se)}}},le=S=>{if(F.current){F.current=!1;return}const U=n[l],Y=(U==null?void 0:U.image.objectFit)==="cover";let Z,ie;if("changedTouches"in S&&S.changedTouches.length>0)Z=S.changedTouches[0].clientX,ie=S.changedTouches[0].clientY;else if("clientX"in S)Z=S.clientX,ie=S.clientY;else return;let ee;if(Y&&M.current){const K=Zn(M.current);ee=Z>=K.left&&Z<=K.right&&ie>=K.top&&ie<=K.bottom}else{const K=M.current?Jn(M.current):null;if(!K){S.target===S.currentTarget&&J();return}ee=Z>=K.x&&Z<=K.x+K.width&&ie>=K.y&&ie<=K.y+K.height}ee?ge(M.current,Z,ie):J()},fe=S=>{const U=S.target;(U.classList.contains(B.thumbsWrapper)||U.classList.contains(B.thumbsContainer))&&le(S)};z.useEffect(()=>{if(!e)return;const S=U=>{var Y,Z;if(U.key==="Escape"){J();return}if(U.key==="ArrowRight"){p(ie=>(ie+1)%Math.max(n.length,1)),(Y=g.current)==null||Y.go("+1");return}U.key==="ArrowLeft"&&(p(ie=>(ie-1+Math.max(n.length,1))%Math.max(n.length,1)),(Z=g.current)==null||Z.go("-1"))};return window.addEventListener("keydown",S),()=>{window.removeEventListener("keydown",S)}},[e,J,n.length]),z.useEffect(()=>{if(e){if(p(0),w(U=>U+1),P.current=!1,b(!1),d(!1),E({}),!L)return;const S=new CustomEvent("page-overlay",{detail:{itemId:L}});window.dispatchEvent(S)}return()=>{I.current&&h.current&&(I.current.removeEventListener("animationend",h.current),h.current=null),d(!1)}},[e,L]),z.useEffect(()=>{y.current!==null&&y.current!==f.type&&w(S=>S+1),y.current=f.type},[f.type]),z.useEffect(()=>{if(!e)return;const S=document.body.style.overflow,U=window.matchMedia("(max-width: 768px)").matches,Y=Qn(C.color);document.body.style.overflow="hidden",d(!1);const Z=ee=>{ee.target===I.current&&!P.current&&ee.animationName&&(U&&!i&&Y>.9&&(document.body.style.backgroundColor=C.color),d(!0),I.current&&$.current&&I.current.removeEventListener("animationend",$.current),$.current=null)};I.current&&($.current=Z,I.current.addEventListener("animationend",Z));const ie=ee=>{const K=ee.target;K&&(K.closest(`.${B.thumbsWrapper}`)||K.closest(`.${B.thumbsContainer}`))||f.type!=="slide"&&ee.preventDefault()};return document.addEventListener("touchmove",ie,{passive:!1}),()=>{document.body.style.overflow=S,document.removeEventListener("touchmove",ie),I.current&&$.current&&(I.current.removeEventListener("animationend",$.current),$.current=null),d(!1)}},[e,i,C.color,f.type]),z.useEffect(()=>{if(!e)return;const S=U=>{var Z,ie;if(P.current){U.stopPropagation();return}if(F.current){F.current=!1;return}const Y=U.target;if(!(Y&&(Y.closest(`.${B.thumbsContainer}`)||Y.closest(`.${B.thumbItem}`)))){if(f.type==="slide"&&H.type==="drag"&&((ie=(Z=g.current)==null?void 0:Z.splide)!=null&&ie.root)){const ee=g.current.splide.root;if(Y&&(ee.contains(Y)||ee===Y))return}if(U.touches.length===0&&U.changedTouches.length>0){const ee=n[l],K=(ee==null?void 0:ee.image.objectFit)==="cover",q=U.changedTouches[0];let pe;if(K&&M.current){const te=Zn(M.current);pe=q.clientX>=te.left&&q.clientX<=te.right&&q.clientY>=te.top&&q.clientY<=te.bottom}else{const te=M.current?Jn(M.current):null;if(!te)return;pe=q.clientX>=te.x&&q.clientX<=te.x+te.width&&q.clientY>=te.y&&q.clientY<=te.y+te.height}if(!pe){U.stopPropagation(),P.current=!0;const te=se=>{se.stopPropagation(),se.preventDefault(),document.removeEventListener("click",te,!0)};document.addEventListener("click",te,!0),J()}}}};return document.addEventListener("touchend",S,{passive:!0}),()=>{document.removeEventListener("touchend",S)}},[e,J,l,n]);const je=(f.type==="scale"||f.type==="fade")&&f.direction==="vert"&&H.type==="drag";z.useEffect(()=>{var se,Ve;if(!e||!je||!((Ve=(se=g.current)==null?void 0:se.splide)!=null&&Ve.root))return;const S=g.current.splide.root,U=30,Y=(ne,de)=>{if(k.current){const Ie=Math.abs(ne-k.current.x),Tt=Math.abs(de-k.current.y);(Ie>0||Tt>0)&&(F.current=!0)}},Z=ne=>{k.current&&(ne.preventDefault(),Y(ne.clientX,ne.clientY))},ie=ne=>{k.current&&ne.touches.length>0&&(ne.preventDefault(),Y(ne.touches[0].clientX,ne.touches[0].clientY))},ee=(ne,de)=>{if(!k.current||!g.current){k.current=null;return}const Ie=Math.abs(ne-k.current.x),Tt=Math.abs(de-k.current.y);Tt>U&&Tt>Ie&&g.current.go(de<k.current.y?"+1":"-1"),k.current=null},K=ne=>{k.current&&ee(ne.clientX,ne.clientY),document.removeEventListener("pointerup",K),document.removeEventListener("pointercancel",K),document.removeEventListener("pointermove",Z)},q=ne=>{if(k.current){if(ne.changedTouches.length>0){const de=ne.changedTouches[0];ee(de.clientX,de.clientY)}document.removeEventListener("touchend",q),document.removeEventListener("touchcancel",q),document.removeEventListener("touchmove",ie)}},pe=ne=>{k.current={x:ne.clientX,y:ne.clientY},F.current=!1,document.addEventListener("pointermove",Z,{passive:!1}),document.addEventListener("pointerup",K),document.addEventListener("pointercancel",K)},te=ne=>{ne.touches.length>0&&(k.current={x:ne.touches[0].clientX,y:ne.touches[0].clientY},F.current=!1,document.addEventListener("touchmove",ie,{passive:!1}),document.addEventListener("touchend",q),document.addEventListener("touchcancel",q))};return S.addEventListener("pointerdown",pe),S.addEventListener("touchstart",te),()=>{S.removeEventListener("pointerdown",pe),S.removeEventListener("touchstart",te),document.removeEventListener("pointermove",Z),document.removeEventListener("pointerup",K),document.removeEventListener("pointercancel",K),document.removeEventListener("touchmove",ie),document.removeEventListener("touchend",q),document.removeEventListener("touchcancel",q),k.current=null,F.current=!1}},[e,je,c]);const Xe={backgroundColor:C.color,backdropFilter:`blur(${C.blur}px)`,animationDuration:`${parseInt(W.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return document.getElementById(a)?Ur.createPortal(_.jsxs(_.Fragment,{children:[_.jsx("div",{ref:i?null:I,className:ce(B.background,v?re:oe,{[B.editor]:i},{[B.hidden]:!e}),style:{...Xe,...u&&!i&&!v?{position:"absolute"}:{}}}),_.jsxs("div",{ref:i?I:null,className:ce(B.contentStyle,v?ye:X,{[B.editor]:i},{[B.hidden]:!e}),style:{animationDuration:`${parseInt(W.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[_.jsx(zr,{onMove:S=>p(S.index),ref:g,className:B.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:H.type==="drag"&&!je,perPage:1,width:"100%",height:"100%",type:f.type==="fade"||f.type==="scale"?"fade":"loop",padding:0,rewind:H.repeat!=="close",start:0},style:{"--splide-speed":f.duration},children:n.map((S,U)=>{const Y=$t(O.position,O.offset,i),Z=`${j.scalingValue(O.padding.top,i)} ${j.scalingValue(O.padding.right,i)} ${j.scalingValue(O.padding.bottom,i)} ${j.scalingValue(O.padding.left,i)}`,ie=f.type==="scale"?(()=>{const{transform:ee,...K}=Y;return{...K,position:"absolute",padding:Z,boxSizing:"border-box","--position-transform":ee||"none"}})():{...Y,position:"absolute",padding:Z,boxSizing:"border-box"};return _.jsx(Mr,{children:_.jsx("div",{className:B.imgWrapper,onClick:le,children:_.jsx("img",{ref:U===l?M:null,className:ce(B.imageStyle,{[B.contain]:S.image.objectFit==="contain",[B.cover]:S.image.objectFit==="cover",[B.scaleSlide]:f.type==="scale"}),src:S.image.url,alt:S.image.name??"",style:{...ie,pointerEvents:S.image.objectFit==="contain"?"none":"auto"}})})},U)})},c),T.isActive&&_.jsxs(_.Fragment,{children:[_.jsx("div",{className:ce(B.arrow,{[B.arrowVertical]:f.direction==="vert"}),style:{color:T.color,"--arrow-hover-color":T.hover},children:_.jsxs("button",{className:B.arrowInner,style:{transform:`translate(${j.scalingValue(T.offset.x,i)}, ${j.scalingValue(T.offset.y*(f.direction==="horiz"?1:-1),i)}) scale(${T.scale}) rotate(${f.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var S;return(S=g.current)==null?void 0:S.go("-1")},"aria-label":"Previous",children:[T.arrowsImgUrl&&_.jsx(pt,{url:T.arrowsImgUrl,fill:T.color,hoverFill:T.hover,className:ce(B.arrowImg,B.mirror)}),!T.arrowsImgUrl&&_.jsx(er,{color:T.color,className:ce(B.arrowIcon,B.arrowImg,B.mirror)})]})}),_.jsx("div",{className:ce(B.arrow,B.nextArrow,{[B.arrowVertical]:f.direction==="vert"}),style:{color:T.color,"--arrow-hover-color":T.hover},children:_.jsxs("button",{className:B.arrowInner,style:{transform:`translate(${j.scalingValue(T.offset.x*(f.direction==="horiz"?-1:1),i)}, ${j.scalingValue(T.offset.y,i)}) scale(${T.scale}) rotate(${f.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var S;return(S=g.current)==null?void 0:S.go("+1")},"aria-label":"Next",children:[T.arrowsImgUrl&&_.jsx(pt,{url:T.arrowsImgUrl,fill:T.color,hoverFill:T.hover,className:B.arrowImg}),!T.arrowsImgUrl&&_.jsx(er,{color:T.color,className:ce(B.arrowIcon,B.arrowImg)})]})})]}),C.closeIconUrl&&(()=>{const S=$t(C.closeIconAlign,C.closeIconOffset,i),U=`scale(${C.closeIconScale})`,Y=S.transform?`${S.transform} ${U}`:U;return _.jsx("button",{className:B.closeButton,style:{...S,transform:Y},onClick:J,"aria-label":"Close lightbox",children:_.jsx(pt,{url:C.closeIconUrl,fill:C.closeIconColor??"#000000",hoverFill:C.closeIconHover??"#cccccc"})})})(),m&&m.isActive&&r.imageCaption&&((D=n[l])==null?void 0:D.imageCaption)&&(()=>{const{widthSettings:S,fontSettings:U,letterSpacing:Y,textAlign:Z,wordSpacing:ie,fontSizeLineHeight:ee,textAppearance:K,color:q}=r.imageCaption;return _.jsx("div",{className:B.caption,style:{...$t(m.alignment,m.offset,i),fontFamily:U.fontFamily,fontWeight:U.fontWeight,fontStyle:U.fontStyle,width:S.sizing==="auto"?"max-content":j.scalingValue(S.width,i),letterSpacing:j.scalingValue(Y,i),wordSpacing:j.scalingValue(ie,i),textAlign:Z,fontSize:j.scalingValue(ee.fontSize,i),lineHeight:j.scalingValue(ee.lineHeight,i),textTransform:K.textTransform??"none",textDecoration:K.textDecoration??"none",fontVariant:K.fontVariant??"normal",color:q},onClick:pe=>pe.stopPropagation(),children:_.jsx("div",{"data-styles":"imageCaption",className:B.captionTextInner,style:{"--link-color":m.linkColor,"--link-hover-color":m.linkHoverColor},children:_.jsx(Wr,{content:n[l].imageCaption})})})})(),x.isActive&&(()=>{const[S,U]=x.position.split("-"),Y=f.direction==="horiz"?`${S}-left`:x.position,Z=$t(Y,x.offset,i),ie=()=>{if(f.direction==="horiz"){if(U==="left")return"flex-start";if(U==="center")return"center";if(U==="right")return"flex-end"}else{if(S==="top")return"flex-start";if(S==="middle")return"center";if(S==="bottom")return"flex-end"}return"flex-start"};return _.jsx("div",{ref:R,className:B.thumbsWrapper,onClick:ee=>fe(ee),style:{position:i?"absolute":"fixed",...Z,...f.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:_.jsx("div",{className:ce(B.thumbsContainer,{[B.thumbsContainerVertical]:f.direction==="vert",[B.thumbsAlignStart]:x.align==="start",[B.thumbsAlignCenter]:x.align==="center",[B.thumbsAlignEnd]:x.align==="end"}),style:{gap:j.scalingValue(x.grid.gap,i),justifyContent:N?"flex-start":ie()},children:n.map((ee,K)=>{const q=K===l,pe=A[K],se=x.grid.size*(q?x.activeState.scale:1),Ve=()=>{if(x.fit!=="fit")return{};if(!pe)return f.direction==="horiz"?{height:j.scalingValue(se,i)}:{width:j.scalingValue(se,i)};const ne=pe.width/pe.height;if(f.direction==="horiz"){const de=se,Ie=de*ne;return{width:j.scalingValue(Ie,i),height:j.scalingValue(de,i)}}else{const de=se,Ie=de/ne;return{width:j.scalingValue(de,i),height:j.scalingValue(Ie,i)}}};return _.jsx("button",{className:B.thumbItem,style:{...f.direction==="horiz"&&x.fit!=="fit"?{height:j.scalingValue(se,i)}:{},...f.direction==="vert"&&x.fit!=="fit"?{width:j.scalingValue(se,i)}:{},...x.fit==="cover"?{width:j.scalingValue(se,i),height:j.scalingValue(se,i)}:{},...Ve(),transition:q?"all 0.25s ease-out":"none",opacity:q?x.activeState.opacity/100:x.opacity/100,"--thumb-hover":x.activeState.opacity/100},onClick:ne=>{var de;ne.stopPropagation(),p(K),(de=g.current)==null||de.go(K)},onMouseEnter:()=>{var ne;x.triggers==="hov"&&((ne=g.current)==null||ne.go(K))},children:_.jsx("img",{src:ee.image.url,alt:ee.image.name??"",onLoad:ne=>{const de=ne.currentTarget;de.naturalWidth&&de.naturalHeight&&E(Ie=>({...Ie,[K]:{width:de.naturalWidth,height:de.naturalHeight}}))},style:{objectFit:x.fit==="cover"?"cover":"contain",...x.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...x.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${ee.image.name}-${K}`)})})})})()]})]}),document.getElementById(a)):null};function er({color:e,className:t}){return _.jsx("svg",{viewBox:"0 0 10 18",className:t,children:_.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:_.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const qa={element:Ga,id:"lightbox",name:"Lightbox",preview:{type:"video",url:"https://cdn.cntrl.site/component-assets/lightbox.mp4"},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 Je(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Xa(e){return`
|
|
7
7
|
.${e}-wrapper {
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
10
10
|
width: 100%;
|
|
11
|
-
min-height: ${
|
|
11
|
+
min-height: ${Je(48)};
|
|
12
12
|
}
|
|
13
13
|
.${e}-form {
|
|
14
14
|
display: flex;
|
|
15
|
-
width: 100%;
|
|
16
|
-
}
|
|
17
|
-
.${e}-form.${e}-horizontal {
|
|
18
|
-
flex-direction: row;
|
|
19
|
-
align-items: center;
|
|
20
|
-
}
|
|
21
|
-
.${e}-form.${e}-vertical {
|
|
22
15
|
flex-direction: column;
|
|
16
|
+
width: 100%;
|
|
23
17
|
}
|
|
24
18
|
.${e}-fields {
|
|
25
19
|
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
26
21
|
flex: 1;
|
|
27
22
|
min-width: 0;
|
|
28
23
|
}
|
|
29
|
-
.${e}-fields.${e}-horizontal {
|
|
30
|
-
flex-direction: row;
|
|
31
|
-
}
|
|
32
|
-
.${e}-fields.${e}-vertical {
|
|
33
|
-
flex-direction: column;
|
|
34
|
-
}
|
|
35
24
|
.${e}-field-group {
|
|
36
25
|
display: flex;
|
|
37
26
|
flex-direction: column;
|
|
@@ -39,23 +28,51 @@
|
|
|
39
28
|
min-width: 0;
|
|
40
29
|
}
|
|
41
30
|
.${e}-field-group.${e}-labeled {
|
|
42
|
-
gap: ${
|
|
31
|
+
gap: ${Je(4)};
|
|
43
32
|
}
|
|
44
33
|
.${e}-field-label {
|
|
45
34
|
white-space: nowrap;
|
|
35
|
+
color: var(--${e}-label-text-color);
|
|
46
36
|
}
|
|
47
37
|
.${e}-input {
|
|
48
38
|
width: 100%;
|
|
39
|
+
box-sizing: border-box;
|
|
49
40
|
line-height: 1.4;
|
|
50
|
-
background: transparent;
|
|
51
41
|
outline: none;
|
|
42
|
+
background-color: var(--${e}-input-color);
|
|
43
|
+
color: var(--${e}-input-text-color);
|
|
44
|
+
border-color: var(--${e}-input-border-color);
|
|
52
45
|
}
|
|
53
46
|
.${e}-input::placeholder {
|
|
54
|
-
color: var(
|
|
47
|
+
color: var(--${e}-placeholder-color);
|
|
55
48
|
opacity: 1;
|
|
56
49
|
}
|
|
57
|
-
.${e}-input:
|
|
58
|
-
|
|
50
|
+
.${e}-input:hover {
|
|
51
|
+
background-color: var(--${e}-hover-input-color, var(--${e}-input-color));
|
|
52
|
+
color: var(--${e}-hover-input-text-color, var(--${e}-input-text-color));
|
|
53
|
+
border-color: var(--${e}-hover-input-border-color, var(--${e}-input-border-color));
|
|
54
|
+
}
|
|
55
|
+
.${e}-wrapper.${e}-state-hover .${e}-input {
|
|
56
|
+
background-color: var(--${e}-hover-input-color, var(--${e}-input-color));
|
|
57
|
+
color: var(--${e}-hover-input-text-color, var(--${e}-input-text-color));
|
|
58
|
+
border-color: var(--${e}-hover-input-border-color, var(--${e}-input-border-color));
|
|
59
|
+
}
|
|
60
|
+
.${e}-input:focus,
|
|
61
|
+
.${e}-wrapper.${e}-state-focus .${e}-input {
|
|
62
|
+
background-color: var(--${e}-focus-input-color, var(--${e}-input-color));
|
|
63
|
+
color: var(--${e}-focus-input-text-color, var(--${e}-input-text-color));
|
|
64
|
+
border-color: var(--${e}-focus-input-border-color, var(--${e}-input-border-color));
|
|
65
|
+
}
|
|
66
|
+
.${e}-wrapper.${e}-state-filled .${e}-input {
|
|
67
|
+
background-color: var(--${e}-filled-input-color, var(--${e}-input-color));
|
|
68
|
+
color: var(--${e}-filled-input-text-color, var(--${e}-input-text-color));
|
|
69
|
+
border-color: var(--${e}-filled-input-border-color, var(--${e}-input-border-color));
|
|
70
|
+
}
|
|
71
|
+
.${e}-wrapper.${e}-state-success .${e}-input,
|
|
72
|
+
.${e}-wrapper.${e}-state-success .${e}-button {
|
|
73
|
+
pointer-events: none;
|
|
74
|
+
}
|
|
75
|
+
.${e}-wrapper.${e}-state-error .${e}-input {
|
|
59
76
|
}
|
|
60
77
|
.${e}-input[data-field-type="textarea"] {
|
|
61
78
|
resize: vertical;
|
|
@@ -68,16 +85,29 @@
|
|
|
68
85
|
.${e}-button {
|
|
69
86
|
cursor: pointer;
|
|
70
87
|
white-space: nowrap;
|
|
88
|
+
background-color: var(--${e}-button-color);
|
|
89
|
+
color: var(--${e}-button-text-color);
|
|
90
|
+
border-color: var(--${e}-button-border-color);
|
|
91
|
+
}
|
|
92
|
+
.${e}-button:hover {
|
|
93
|
+
background-color: var(--${e}-hover-button-color, var(--${e}-button-color));
|
|
94
|
+
color: var(--${e}-hover-button-text-color, var(--${e}-button-text-color));
|
|
95
|
+
border-color: var(--${e}-hover-button-border-color, var(--${e}-button-border-color));
|
|
96
|
+
}
|
|
97
|
+
.${e}-wrapper.${e}-state-hover .${e}-button {
|
|
98
|
+
background-color: var(--${e}-hover-button-color, var(--${e}-button-color));
|
|
99
|
+
color: var(--${e}-hover-button-text-color, var(--${e}-button-text-color));
|
|
100
|
+
border-color: var(--${e}-hover-button-border-color, var(--${e}-button-border-color));
|
|
71
101
|
}
|
|
72
102
|
.${e}-success {
|
|
73
|
-
margin-top: ${
|
|
74
|
-
font-size: ${
|
|
75
|
-
color:
|
|
103
|
+
margin-top: ${Je(8)};
|
|
104
|
+
font-size: ${Je(14)};
|
|
105
|
+
color: var(--${e}-success-success-color, var(--${e}-success-color));
|
|
76
106
|
}
|
|
77
107
|
.${e}-error {
|
|
78
|
-
margin-top: ${
|
|
79
|
-
font-size: ${
|
|
80
|
-
color:
|
|
108
|
+
margin-top: ${Je(8)};
|
|
109
|
+
font-size: ${Je(14)};
|
|
110
|
+
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
81
111
|
}
|
|
82
112
|
.${e}-overlay-anchor {
|
|
83
113
|
position: relative;
|
|
@@ -90,7 +120,7 @@
|
|
|
90
120
|
.${e}-fields-gap-spacer {
|
|
91
121
|
flex: 0 0 auto;
|
|
92
122
|
}
|
|
93
|
-
`}function
|
|
123
|
+
`}function Ka({settings:e,isEditor:t,metadata:n,activeEvent:r}){const{prefix:o}=j.useScopedStyles(),{type:a="A",fieldsToShow:i=2,fields:s=[],buttonLabel:l="Sign up",input:p,button:c,gap:w=.008,fieldsGap:v=.008,label:b,buttonCorners:u,buttonStroke:d,inputCorners:A,inputStroke:E,buttonPadding:g,inputPadding:y,inputColor:M,inputTextColor:P,inputBorderColor:I,placeholderColor:h,buttonColor:$,buttonTextColor:k,buttonBorderColor:F,labelTextColor:R,successColor:N,errorColor:V,fontFamily:W,successMessage:H,errorMessage:f,stateOverrides:x}=e,T=a==="B",C=s.slice(0,Math.min(i,s.length)),m=p?tn({...p,fontSettings:{...p.fontSettings,fontFamily:W}},t):void 0,O={...m,borderStyle:"solid",borderRadius:j.scalingValue(A??0,t),borderWidth:j.scalingValue(E??0,t),paddingTop:j.scalingValue((y==null?void 0:y.top)??0,t),paddingRight:j.scalingValue((y==null?void 0:y.right)??0,t),paddingBottom:j.scalingValue((y==null?void 0:y.bottom)??0,t),paddingLeft:j.scalingValue((y==null?void 0:y.left)??0,t)},X=c?tn({...c,fontSettings:{...c.fontSettings,fontFamily:W}},t):void 0,oe=b?tn({...b,fontSettings:{...b.fontSettings,fontFamily:W}},t):void 0,re=Za(o,{inputColor:M,inputTextColor:P,inputBorderColor:I,placeholderColor:h,buttonColor:$,buttonTextColor:k,buttonBorderColor:F,labelTextColor:R,successColor:N,errorColor:V},x),[ye,L]=z.useState(()=>Object.fromEntries(C.map(q=>[q.name,""]))),[J,ge]=z.useState("idle"),[le,fe]=z.useState(null),je=r==="success"?"success":r==="error"?"error":J,Xe=r==="error"?f:le,D=r==="filled"?Object.fromEntries(C.map(q=>[q.name,"Filled"])):ye,S=r&&r!=="default"?`${o}-state-${r}`:"",U=n==null?void 0:n.apiBase,Y=n==null?void 0:n.projectId,Z=n==null?void 0:n.pluginConfigId,ie=!!(U&&Y&&Z),ee=(q,pe)=>{L(te=>({...te,[q]:pe}))},K=async q=>{q.preventDefault();const pe=Object.fromEntries(C.map(te=>{var se;return[te.name,((se=ye[te.name])==null?void 0:se.trim())??""]}).filter(([,te])=>te));if(!(!ie||Object.keys(pe).length===0)){ge("submitting"),fe(null);try{const te=`${U}/projects/${Y}/forms/${Z}/submit`,se=await fetch(te,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...pe,pageUrl:typeof window<"u"?window.location.href:""})});if(!se.ok){const Ve=await se.text();throw new Error(Ve||`Request failed: ${se.status}`)}ge("success"),L(Object.fromEntries(C.map(Ve=>[Ve.name,""])))}catch(te){ge("error"),fe(te instanceof Error?te.message:"Something went wrong")}}};return _.jsxs("div",{className:`${o}-wrapper ${S}`.trim(),style:re,children:[_.jsx("style",{children:Xa(o)}),_.jsxs("form",{onSubmit:K,className:`${o}-form`,children:[_.jsx("div",{className:`${o}-fields`,children:C.map((q,pe)=>_.jsxs(z.Fragment,{children:[_.jsxs("div",{className:`${o}-field-group${T?` ${o}-labeled`:""}`,children:[T&&_.jsx("span",{className:`${o}-field-label`,style:oe?{...oe,lineHeight:oe.fontSize}:void 0,children:q.label||q.name}),q.type==="textarea"?_.jsx("textarea",{name:q.name,autoComplete:"off",value:D[q.name]??"",onChange:te=>ee(q.name,te.target.value),placeholder:q.placeholder,className:`${o}-input`,style:O,rows:1,"data-field-type":"textarea"}):_.jsx("input",{type:q.type==="phone"?"tel":q.type==="email"?"email":"text",name:q.name,autoComplete:"off",value:D[q.name]??"",onChange:te=>ee(q.name,te.target.value),placeholder:q.placeholder,required:q.type==="email",className:`${o}-input`,style:O})]}),pe<C.length-1&&_.jsx("div",{"data-axis":"y",className:`${o}-overlay-anchor ${o}-fields-gap-spacer`,"data-controls":"settings.fieldsGap",style:{height:j.scalingValue(v,t),width:"100%"}})]},pe))}),_.jsx("div",{"data-axis":"y",className:`${o}-overlay-anchor ${o}-gap-spacer`,"data-controls":"settings.gap",style:{height:j.scalingValue(w,t),width:"100%"}}),_.jsx("div",{className:`${o}-overlay-anchor`,children:_.jsx("button",{type:"submit",className:`${o}-button`,style:{borderStyle:"solid",borderRadius:j.scalingValue(u??0,t),borderWidth:j.scalingValue(d??0,t),paddingTop:j.scalingValue((g==null?void 0:g.top)??0,t),paddingRight:j.scalingValue((g==null?void 0:g.right)??0,t),paddingBottom:j.scalingValue((g==null?void 0:g.bottom)??0,t),paddingLeft:j.scalingValue((g==null?void 0:g.left)??0,t),...X},children:_.jsx("span",{className:`${o}-overlay-anchor`,children:J==="submitting"?"...":l})})})]}),je==="success"&&_.jsx("p",{className:`${o}-success`,style:{...m,lineHeight:m==null?void 0:m.fontSize},children:H}),je==="error"&&_.jsx("p",{className:`${o}-error`,style:{...m,lineHeight:m==null?void 0:m.fontSize},role:"alert",children:Xe??f})]})}const tr={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"},Ja=["hover","focus","filled","success","error"];function Za(e,t,n){const r={};for(const[o,a]of Object.entries(tr))r[`--${e}-${a}`]=t[o];if(n)for(const o of Ja){const a=n[o];if(a)for(const[i,s]of Object.entries(tr)){const l=a[i];l!==void 0&&(r[`--${e}-${o}-${s}`]=l)}}return r}function tn(e,t){var n,r,o;return{fontFamily:e.fontSettings.fontFamily,fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:j.scalingValue(e.letterSpacing,t),wordSpacing:j.scalingValue(e.wordSpacing,t),fontSize:j.scalingValue(e.fontSize,t),lineHeight:e.lineHeight!==void 0?j.scalingValue(e.lineHeight,t):void 0,textTransform:(n=e.textAppearance)==null?void 0:n.textTransform,textDecoration:(r=e.textAppearance)==null?void 0:r.textDecoration,fontVariant:(o=e.textAppearance)==null?void 0:o.fontVariant}}const Qa=`import React, { useState } from 'react';
|
|
94
124
|
import { CommonComponentProps } from '../props';
|
|
95
125
|
import { scalingValue, useScopedStyles } from '../utils/index';
|
|
96
126
|
|
|
@@ -108,26 +138,15 @@ function getCSS(P: string): string {
|
|
|
108
138
|
}
|
|
109
139
|
.\${P}-form {
|
|
110
140
|
display: flex;
|
|
111
|
-
width: 100%;
|
|
112
|
-
}
|
|
113
|
-
.\${P}-form.\${P}-horizontal {
|
|
114
|
-
flex-direction: row;
|
|
115
|
-
align-items: center;
|
|
116
|
-
}
|
|
117
|
-
.\${P}-form.\${P}-vertical {
|
|
118
141
|
flex-direction: column;
|
|
142
|
+
width: 100%;
|
|
119
143
|
}
|
|
120
144
|
.\${P}-fields {
|
|
121
145
|
display: flex;
|
|
146
|
+
flex-direction: column;
|
|
122
147
|
flex: 1;
|
|
123
148
|
min-width: 0;
|
|
124
149
|
}
|
|
125
|
-
.\${P}-fields.\${P}-horizontal {
|
|
126
|
-
flex-direction: row;
|
|
127
|
-
}
|
|
128
|
-
.\${P}-fields.\${P}-vertical {
|
|
129
|
-
flex-direction: column;
|
|
130
|
-
}
|
|
131
150
|
.\${P}-field-group {
|
|
132
151
|
display: flex;
|
|
133
152
|
flex-direction: column;
|
|
@@ -139,19 +158,47 @@ function getCSS(P: string): string {
|
|
|
139
158
|
}
|
|
140
159
|
.\${P}-field-label {
|
|
141
160
|
white-space: nowrap;
|
|
161
|
+
color: var(--\${P}-label-text-color);
|
|
142
162
|
}
|
|
143
163
|
.\${P}-input {
|
|
144
164
|
width: 100%;
|
|
165
|
+
box-sizing: border-box;
|
|
145
166
|
line-height: 1.4;
|
|
146
|
-
background: transparent;
|
|
147
167
|
outline: none;
|
|
168
|
+
background-color: var(--\${P}-input-color);
|
|
169
|
+
color: var(--\${P}-input-text-color);
|
|
170
|
+
border-color: var(--\${P}-input-border-color);
|
|
148
171
|
}
|
|
149
172
|
.\${P}-input::placeholder {
|
|
150
|
-
color: var(
|
|
173
|
+
color: var(--\${P}-placeholder-color);
|
|
151
174
|
opacity: 1;
|
|
152
175
|
}
|
|
153
|
-
.\${P}-input:
|
|
154
|
-
|
|
176
|
+
.\${P}-input:hover {
|
|
177
|
+
background-color: var(--\${P}-hover-input-color, var(--\${P}-input-color));
|
|
178
|
+
color: var(--\${P}-hover-input-text-color, var(--\${P}-input-text-color));
|
|
179
|
+
border-color: var(--\${P}-hover-input-border-color, var(--\${P}-input-border-color));
|
|
180
|
+
}
|
|
181
|
+
.\${P}-wrapper.\${P}-state-hover .\${P}-input {
|
|
182
|
+
background-color: var(--\${P}-hover-input-color, var(--\${P}-input-color));
|
|
183
|
+
color: var(--\${P}-hover-input-text-color, var(--\${P}-input-text-color));
|
|
184
|
+
border-color: var(--\${P}-hover-input-border-color, var(--\${P}-input-border-color));
|
|
185
|
+
}
|
|
186
|
+
.\${P}-input:focus,
|
|
187
|
+
.\${P}-wrapper.\${P}-state-focus .\${P}-input {
|
|
188
|
+
background-color: var(--\${P}-focus-input-color, var(--\${P}-input-color));
|
|
189
|
+
color: var(--\${P}-focus-input-text-color, var(--\${P}-input-text-color));
|
|
190
|
+
border-color: var(--\${P}-focus-input-border-color, var(--\${P}-input-border-color));
|
|
191
|
+
}
|
|
192
|
+
.\${P}-wrapper.\${P}-state-filled .\${P}-input {
|
|
193
|
+
background-color: var(--\${P}-filled-input-color, var(--\${P}-input-color));
|
|
194
|
+
color: var(--\${P}-filled-input-text-color, var(--\${P}-input-text-color));
|
|
195
|
+
border-color: var(--\${P}-filled-input-border-color, var(--\${P}-input-border-color));
|
|
196
|
+
}
|
|
197
|
+
.\${P}-wrapper.\${P}-state-success .\${P}-input,
|
|
198
|
+
.\${P}-wrapper.\${P}-state-success .\${P}-button {
|
|
199
|
+
pointer-events: none;
|
|
200
|
+
}
|
|
201
|
+
.\${P}-wrapper.\${P}-state-error .\${P}-input {
|
|
155
202
|
}
|
|
156
203
|
.\${P}-input[data-field-type="textarea"] {
|
|
157
204
|
resize: vertical;
|
|
@@ -164,16 +211,29 @@ function getCSS(P: string): string {
|
|
|
164
211
|
.\${P}-button {
|
|
165
212
|
cursor: pointer;
|
|
166
213
|
white-space: nowrap;
|
|
214
|
+
background-color: var(--\${P}-button-color);
|
|
215
|
+
color: var(--\${P}-button-text-color);
|
|
216
|
+
border-color: var(--\${P}-button-border-color);
|
|
217
|
+
}
|
|
218
|
+
.\${P}-button:hover {
|
|
219
|
+
background-color: var(--\${P}-hover-button-color, var(--\${P}-button-color));
|
|
220
|
+
color: var(--\${P}-hover-button-text-color, var(--\${P}-button-text-color));
|
|
221
|
+
border-color: var(--\${P}-hover-button-border-color, var(--\${P}-button-border-color));
|
|
222
|
+
}
|
|
223
|
+
.\${P}-wrapper.\${P}-state-hover .\${P}-button {
|
|
224
|
+
background-color: var(--\${P}-hover-button-color, var(--\${P}-button-color));
|
|
225
|
+
color: var(--\${P}-hover-button-text-color, var(--\${P}-button-text-color));
|
|
226
|
+
border-color: var(--\${P}-hover-button-border-color, var(--\${P}-button-border-color));
|
|
167
227
|
}
|
|
168
228
|
.\${P}-success {
|
|
169
229
|
margin-top: \${sv(8)};
|
|
170
230
|
font-size: \${sv(14)};
|
|
171
|
-
color:
|
|
231
|
+
color: var(--\${P}-success-success-color, var(--\${P}-success-color));
|
|
172
232
|
}
|
|
173
233
|
.\${P}-error {
|
|
174
234
|
margin-top: \${sv(8)};
|
|
175
235
|
font-size: \${sv(14)};
|
|
176
|
-
color:
|
|
236
|
+
color: var(--\${P}-error-error-color, var(--\${P}-error-color));
|
|
177
237
|
}
|
|
178
238
|
.\${P}-overlay-anchor {
|
|
179
239
|
position: relative;
|
|
@@ -193,10 +253,11 @@ type FormProps = {
|
|
|
193
253
|
settings: FormSettings;
|
|
194
254
|
content?: unknown;
|
|
195
255
|
isEditor?: boolean;
|
|
256
|
+
activeEvent: string | undefined;
|
|
196
257
|
onUpdateSettings?: (settings: FormSettings) => void;
|
|
197
258
|
} & CommonComponentProps;
|
|
198
259
|
|
|
199
|
-
export function Form({ settings, isEditor, metadata }: FormProps) {
|
|
260
|
+
export function Form({ settings, isEditor, metadata, activeEvent }: FormProps) {
|
|
200
261
|
const { prefix: P } = useScopedStyles();
|
|
201
262
|
const {
|
|
202
263
|
type = 'A',
|
|
@@ -221,13 +282,26 @@ export function Form({ settings, isEditor, metadata }: FormProps) {
|
|
|
221
282
|
buttonColor,
|
|
222
283
|
buttonTextColor,
|
|
223
284
|
buttonBorderColor,
|
|
224
|
-
labelTextColor
|
|
285
|
+
labelTextColor,
|
|
286
|
+
successColor,
|
|
287
|
+
errorColor,
|
|
288
|
+
fontFamily,
|
|
289
|
+
successMessage,
|
|
290
|
+
errorMessage: errorMessageText,
|
|
291
|
+
stateOverrides,
|
|
225
292
|
} = settings;
|
|
226
293
|
|
|
227
|
-
const
|
|
228
|
-
const showLabels = type === 'C';
|
|
294
|
+
const showLabels = type === 'B';
|
|
229
295
|
const visibleFields = fields.slice(0, Math.min(fieldsToShow, fields.length));
|
|
230
|
-
const inputCss = inputTextStyle
|
|
296
|
+
const inputCss = inputTextStyle
|
|
297
|
+
? textStylesToCss(
|
|
298
|
+
{
|
|
299
|
+
...inputTextStyle,
|
|
300
|
+
fontSettings: { ...inputTextStyle.fontSettings, fontFamily },
|
|
301
|
+
},
|
|
302
|
+
isEditor,
|
|
303
|
+
)
|
|
304
|
+
: undefined;
|
|
231
305
|
const inputFieldCss = {
|
|
232
306
|
...inputCss,
|
|
233
307
|
borderStyle: 'solid',
|
|
@@ -237,13 +311,31 @@ export function Form({ settings, isEditor, metadata }: FormProps) {
|
|
|
237
311
|
paddingRight: scalingValue(inputPadding?.right ?? 0, isEditor),
|
|
238
312
|
paddingBottom: scalingValue(inputPadding?.bottom ?? 0, isEditor),
|
|
239
313
|
paddingLeft: scalingValue(inputPadding?.left ?? 0, isEditor),
|
|
240
|
-
backgroundColor: inputColor,
|
|
241
|
-
color: inputTextColor,
|
|
242
|
-
borderColor: inputBorderColor,
|
|
243
|
-
'--placeholder-color': placeholderColor,
|
|
244
314
|
} as React.CSSProperties;
|
|
245
|
-
const buttonTextCss = buttonTextStyle
|
|
246
|
-
|
|
315
|
+
const buttonTextCss = buttonTextStyle
|
|
316
|
+
? textStylesToCss(
|
|
317
|
+
{
|
|
318
|
+
...buttonTextStyle,
|
|
319
|
+
fontSettings: { ...buttonTextStyle.fontSettings, fontFamily },
|
|
320
|
+
},
|
|
321
|
+
isEditor,
|
|
322
|
+
)
|
|
323
|
+
: undefined;
|
|
324
|
+
const labelTextCss = labelTextStyle
|
|
325
|
+
? textStylesToCss(
|
|
326
|
+
{
|
|
327
|
+
...labelTextStyle,
|
|
328
|
+
fontSettings: { ...labelTextStyle.fontSettings, fontFamily },
|
|
329
|
+
},
|
|
330
|
+
isEditor,
|
|
331
|
+
)
|
|
332
|
+
: undefined;
|
|
333
|
+
|
|
334
|
+
const colorVars = buildColorVars(P, {
|
|
335
|
+
inputColor, inputTextColor, inputBorderColor, placeholderColor,
|
|
336
|
+
buttonColor, buttonTextColor, buttonBorderColor,
|
|
337
|
+
labelTextColor, successColor, errorColor,
|
|
338
|
+
}, stateOverrides);
|
|
247
339
|
|
|
248
340
|
const [fieldValues, setFieldValues] = useState<Record<string, string>>(() =>
|
|
249
341
|
Object.fromEntries(visibleFields.map((f) => [f.name, '']))
|
|
@@ -251,6 +343,15 @@ export function Form({ settings, isEditor, metadata }: FormProps) {
|
|
|
251
343
|
const [status, setStatus] = useState<'idle' | 'submitting' | 'success' | 'error'>('idle');
|
|
252
344
|
const [errorMessage, setErrorMessage] = useState<string | null>(null);
|
|
253
345
|
|
|
346
|
+
const displayStatus = activeEvent === 'success' ? 'success'
|
|
347
|
+
: activeEvent === 'error' ? 'error'
|
|
348
|
+
: status;
|
|
349
|
+
const displayError = activeEvent === 'error' ? errorMessageText : errorMessage;
|
|
350
|
+
const displayValues = activeEvent === 'filled'
|
|
351
|
+
? Object.fromEntries(visibleFields.map((f) => [f.name, 'Filled']))
|
|
352
|
+
: fieldValues;
|
|
353
|
+
const stateClass = activeEvent && activeEvent !== 'default' ? \`\${P}-state-\${activeEvent}\` : '';
|
|
354
|
+
|
|
254
355
|
const apiBase = metadata?.apiBase as string | undefined;
|
|
255
356
|
const projectId = metadata?.projectId as string | undefined;
|
|
256
357
|
const configId = metadata?.pluginConfigId as string | undefined;
|
|
@@ -294,18 +395,18 @@ export function Form({ settings, isEditor, metadata }: FormProps) {
|
|
|
294
395
|
};
|
|
295
396
|
|
|
296
397
|
return (
|
|
297
|
-
<div className={\`\${P}-wrapper
|
|
398
|
+
<div className={\`\${P}-wrapper \${stateClass}\`.trim()} style={colorVars}>
|
|
298
399
|
<style>{getCSS(P)}</style>
|
|
299
400
|
<form
|
|
300
401
|
onSubmit={handleSubmit}
|
|
301
|
-
className={\`\${P}-form
|
|
402
|
+
className={\`\${P}-form\`}
|
|
302
403
|
>
|
|
303
|
-
<div className={\`\${P}-fields
|
|
404
|
+
<div className={\`\${P}-fields\`}>
|
|
304
405
|
{visibleFields.map((field, index) => (
|
|
305
406
|
<React.Fragment key={index}>
|
|
306
407
|
<div className={\`\${P}-field-group\${showLabels ? \` \${P}-labeled\` : ''}\`}>
|
|
307
408
|
{showLabels && (
|
|
308
|
-
<span className={\`\${P}-field-label\`} style={{ ...labelTextCss,
|
|
409
|
+
<span className={\`\${P}-field-label\`} style={labelTextCss ? { ...labelTextCss, lineHeight: labelTextCss.fontSize } : undefined}>
|
|
309
410
|
{field.label || field.name}
|
|
310
411
|
</span>
|
|
311
412
|
)}
|
|
@@ -313,12 +414,12 @@ export function Form({ settings, isEditor, metadata }: FormProps) {
|
|
|
313
414
|
<textarea
|
|
314
415
|
name={field.name}
|
|
315
416
|
autoComplete="off"
|
|
316
|
-
value={
|
|
417
|
+
value={displayValues[field.name] ?? ''}
|
|
317
418
|
onChange={(e) => handleFieldChange(field.name, e.target.value)}
|
|
318
419
|
placeholder={field.placeholder}
|
|
319
420
|
className={\`\${P}-input\`}
|
|
320
421
|
style={inputFieldCss}
|
|
321
|
-
rows={
|
|
422
|
+
rows={1}
|
|
322
423
|
data-field-type="textarea"
|
|
323
424
|
/>
|
|
324
425
|
) : (
|
|
@@ -326,7 +427,7 @@ export function Form({ settings, isEditor, metadata }: FormProps) {
|
|
|
326
427
|
type={field.type === 'phone' ? 'tel' : field.type === 'email' ? 'email' : 'text'}
|
|
327
428
|
name={field.name}
|
|
328
429
|
autoComplete="off"
|
|
329
|
-
value={
|
|
430
|
+
value={displayValues[field.name] ?? ''}
|
|
330
431
|
onChange={(e) => handleFieldChange(field.name, e.target.value)}
|
|
331
432
|
placeholder={field.placeholder}
|
|
332
433
|
required={field.type === 'email'}
|
|
@@ -337,24 +438,20 @@ export function Form({ settings, isEditor, metadata }: FormProps) {
|
|
|
337
438
|
</div>
|
|
338
439
|
{index < visibleFields.length - 1 && (
|
|
339
440
|
<div
|
|
340
|
-
data-axis=
|
|
441
|
+
data-axis="y"
|
|
341
442
|
className={\`\${P}-overlay-anchor \${P}-fields-gap-spacer\`}
|
|
342
443
|
data-controls="settings.fieldsGap"
|
|
343
|
-
style={
|
|
344
|
-
? ({ width: scalingValue(fieldsGap, isEditor), height: 'auto' })
|
|
345
|
-
: ({ height: scalingValue(fieldsGap, isEditor), width: '100%' })}
|
|
444
|
+
style={{ height: scalingValue(fieldsGap, isEditor), width: '100%' }}
|
|
346
445
|
/>
|
|
347
446
|
)}
|
|
348
447
|
</React.Fragment>
|
|
349
448
|
))}
|
|
350
449
|
</div>
|
|
351
450
|
<div
|
|
352
|
-
data-axis=
|
|
451
|
+
data-axis="y"
|
|
353
452
|
className={\`\${P}-overlay-anchor \${P}-gap-spacer\`}
|
|
354
453
|
data-controls="settings.gap"
|
|
355
|
-
style={
|
|
356
|
-
? ({ width: scalingValue(gap, isEditor) })
|
|
357
|
-
: ({ height: scalingValue(gap, isEditor), width: '100%' })}
|
|
454
|
+
style={{ height: scalingValue(gap, isEditor), width: '100%' }}
|
|
358
455
|
/>
|
|
359
456
|
<div className={\`\${P}-overlay-anchor\`}>
|
|
360
457
|
<button
|
|
@@ -368,20 +465,31 @@ export function Form({ settings, isEditor, metadata }: FormProps) {
|
|
|
368
465
|
paddingRight: scalingValue(buttonPadding?.right ?? 0, isEditor),
|
|
369
466
|
paddingBottom: scalingValue(buttonPadding?.bottom ?? 0, isEditor),
|
|
370
467
|
paddingLeft: scalingValue(buttonPadding?.left ?? 0, isEditor),
|
|
371
|
-
|
|
372
|
-
color: buttonTextColor,
|
|
373
|
-
borderColor: buttonBorderColor,
|
|
468
|
+
...buttonTextCss,
|
|
374
469
|
}}
|
|
375
470
|
>
|
|
376
|
-
<span className={\`\${P}-overlay-anchor\`}
|
|
471
|
+
<span className={\`\${P}-overlay-anchor\`}>
|
|
377
472
|
{status === 'submitting' ? '...' : buttonLabel}
|
|
378
473
|
</span>
|
|
379
474
|
</button>
|
|
380
475
|
</div>
|
|
381
476
|
</form>
|
|
382
|
-
{
|
|
383
|
-
|
|
384
|
-
|
|
477
|
+
{displayStatus === 'success' && (
|
|
478
|
+
<p
|
|
479
|
+
className={\`\${P}-success\`}
|
|
480
|
+
style={{ ...inputCss, lineHeight: inputCss?.fontSize }}
|
|
481
|
+
>
|
|
482
|
+
{successMessage}
|
|
483
|
+
</p>
|
|
484
|
+
)}
|
|
485
|
+
{displayStatus === 'error' && (
|
|
486
|
+
<p
|
|
487
|
+
className={\`\${P}-error\`}
|
|
488
|
+
style={{ ...inputCss, lineHeight: inputCss?.fontSize }}
|
|
489
|
+
role="alert"
|
|
490
|
+
>
|
|
491
|
+
{displayError ?? errorMessageText}
|
|
492
|
+
</p>
|
|
385
493
|
)}
|
|
386
494
|
</div>
|
|
387
495
|
);
|
|
@@ -398,7 +506,7 @@ export type FormFieldItem = {
|
|
|
398
506
|
|
|
399
507
|
type TextStyles = {
|
|
400
508
|
fontSettings: {
|
|
401
|
-
fontFamily
|
|
509
|
+
fontFamily?: string;
|
|
402
510
|
fontWeight: number;
|
|
403
511
|
fontStyle: string;
|
|
404
512
|
};
|
|
@@ -421,8 +529,23 @@ type Padding = {
|
|
|
421
529
|
left?: number;
|
|
422
530
|
};
|
|
423
531
|
|
|
532
|
+
type ColorKeys =
|
|
533
|
+
| 'inputColor'
|
|
534
|
+
| 'inputTextColor'
|
|
535
|
+
| 'inputBorderColor'
|
|
536
|
+
| 'placeholderColor'
|
|
537
|
+
| 'buttonColor'
|
|
538
|
+
| 'buttonTextColor'
|
|
539
|
+
| 'buttonBorderColor'
|
|
540
|
+
| 'labelTextColor'
|
|
541
|
+
| 'successColor'
|
|
542
|
+
| 'errorColor';
|
|
543
|
+
|
|
544
|
+
type StateColorOverrides = Partial<Record<ColorKeys, string>>;
|
|
545
|
+
|
|
424
546
|
type FormSettings = {
|
|
425
|
-
type: 'A' | 'B'
|
|
547
|
+
type: 'A' | 'B';
|
|
548
|
+
fontFamily: string;
|
|
426
549
|
fieldsToShow: number;
|
|
427
550
|
fields: FormFieldItem[];
|
|
428
551
|
buttonLabel?: string;
|
|
@@ -445,8 +568,52 @@ type FormSettings = {
|
|
|
445
568
|
buttonTextColor: string;
|
|
446
569
|
buttonBorderColor: string;
|
|
447
570
|
labelTextColor: string;
|
|
571
|
+
successColor: string;
|
|
572
|
+
errorColor: string;
|
|
573
|
+
successMessage: string;
|
|
574
|
+
errorMessage: string;
|
|
575
|
+
stateOverrides?: Record<string, StateColorOverrides>;
|
|
576
|
+
};
|
|
577
|
+
|
|
578
|
+
const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
579
|
+
inputColor: 'input-color',
|
|
580
|
+
inputTextColor: 'input-text-color',
|
|
581
|
+
inputBorderColor: 'input-border-color',
|
|
582
|
+
placeholderColor: 'placeholder-color',
|
|
583
|
+
buttonColor: 'button-color',
|
|
584
|
+
buttonTextColor: 'button-text-color',
|
|
585
|
+
buttonBorderColor: 'button-border-color',
|
|
586
|
+
labelTextColor: 'label-text-color',
|
|
587
|
+
successColor: 'success-color',
|
|
588
|
+
errorColor: 'error-color',
|
|
448
589
|
};
|
|
449
590
|
|
|
591
|
+
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
592
|
+
|
|
593
|
+
function buildColorVars(
|
|
594
|
+
P: string,
|
|
595
|
+
defaults: Record<ColorKeys, string>,
|
|
596
|
+
stateOverrides?: Record<string, StateColorOverrides>,
|
|
597
|
+
): React.CSSProperties {
|
|
598
|
+
const vars: Record<string, string> = {};
|
|
599
|
+
for (const [key, varSuffix] of Object.entries(COLOR_VAR_MAP)) {
|
|
600
|
+
vars[\`--\${P}-\${varSuffix}\`] = defaults[key as ColorKeys];
|
|
601
|
+
}
|
|
602
|
+
if (stateOverrides) {
|
|
603
|
+
for (const state of STATE_KEYS) {
|
|
604
|
+
const overrides = stateOverrides[state];
|
|
605
|
+
if (!overrides) continue;
|
|
606
|
+
for (const [key, varSuffix] of Object.entries(COLOR_VAR_MAP)) {
|
|
607
|
+
const val = overrides[key as ColorKeys];
|
|
608
|
+
if (val !== undefined) {
|
|
609
|
+
vars[\`--\${P}-\${state}-\${varSuffix}\`] = val;
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
return vars as unknown as React.CSSProperties;
|
|
615
|
+
}
|
|
616
|
+
|
|
450
617
|
function textStylesToCss(textStyles: TextStyles, isEditor?: boolean): React.CSSProperties {
|
|
451
618
|
return {
|
|
452
619
|
fontFamily: textStyles.fontSettings.fontFamily,
|
|
@@ -461,4 +628,4 @@ function textStylesToCss(textStyles: TextStyles, isEditor?: boolean): React.CSSP
|
|
|
461
628
|
fontVariant: textStyles.textAppearance?.fontVariant
|
|
462
629
|
};
|
|
463
630
|
}
|
|
464
|
-
`,Ja=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email"},{name:"name",type:"text",placeholder:"Enter your name",label:"Name"},{name:"company",type:"text",placeholder:"Enter company",label:"Company"},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone"},{name:"message",type:"textarea",placeholder:"Enter your message",label:"Message"},{name:"message2",type:"textarea",placeholder:"Enter your message 2",label:"Message 2"},{name:"message3",type:"textarea",placeholder:"Enter your message 3",label:"Message 3"}],nn={fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAppearance:{type:"object",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}},rn=e=>({fontSettings:{fontFamily:"Arial",fontWeight:e,fontStyle:"normal"},lineHeight:0,letterSpacing:0,wordSpacing:0,fontSize:.01,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),Za={type:"object",version:1,settings:{sizing:"auto",properties:{fieldsToShow:{type:"number",scope:"layout",title:"Fields",display:{type:"number"},min:1,max:8},fields:{type:"array",scope:"common",items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"}}}},type:{type:"string",scope:"layout",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:"Color",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"layout",title:"Text Color",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"layout",title:"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:"Color",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"layout",title:"Text Color",display:{type:"palette-color-picker"}},buttonBorderColor:{type:"string",scope:"layout",title:"Border Color",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"layout",title:"Text Color",display:{type:"palette-color-picker"}},labelBorderColor:{type:"string",scope:"layout",title:"Border Color",display:{type:"palette-color-picker"}},input:{type:"object",scope:"layout",properties:nn,layout:["fontSettings",{type:"row",items:["letterSpacing","wordSpacing","fontSize","lineHeight"]},"textAppearance"]},button:{type:"object",scope:"layout",properties:nn,layout:["fontSettings",{type:"row",items:["letterSpacing","wordSpacing","fontSize","lineHeight"]},"textAppearance"]},label:{type:"object",scope:"layout",properties:nn,layout:["fontSettings",{type:"row",items:["letterSpacing","wordSpacing","fontSize","lineHeight"]},"textAppearance"]}},defaults:{fieldsToShow:2,fields:Ja,type:"A",gap:.008,fieldsGap:.008,buttonStroke:.001,buttonCorners:0,inputStroke:.001,inputCorners:0,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputColor:"#000000",inputTextColor:"#999999",inputBorderColor:"#cccccc",buttonColor:"#666666",buttonTextColor:"#ffffff",buttonBorderColor:"#cccccc",labelTextColor:"#999999",input:rn(400),button:rn(700),label:rn(400)}},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__template__","fieldsToShow"]},"type",{type:"group",title:"BUTTON",items:[{type:"row",items:[{type:"switcher",title:"",options:{Button:[{type:"group",title:"",items:["gap","buttonStroke","buttonCorners"]},{type:"group",title:"Padding",items:["buttonPadding"]}],Input:[{type:"group",title:"",items:["fieldsGap","inputStroke","inputCorners"]},{type:"group",title:"Padding",items:["inputPadding"]}]}}]}]},{type:"row",items:["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"switcher",title:"",options:{Input:["input"],Button:["button"],Label:["label"]}}]}],allowedPlugins:"newsletter"},Qa={element:qa,id:"form",name:"Form",version:1,defaultSize:{width:400,height:42},schema:Za,sourceCode:Ka},el="OnelinerForm-module__wrapper___BCMAA",tl="OnelinerForm-module__form___ED-dE",nl="OnelinerForm-module__input___Dylt7",rl="OnelinerForm-module__submitBtn___aHZXa",il="OnelinerForm-module__success___KhwKm",ol="OnelinerForm-module__error___c8WbI",al="OnelinerForm-module__overlayAnchor___zxYKj",Pe={wrapper:el,form:tl,input:nl,submitBtn:rl,success:il,error:ol,overlayAnchor:al};function ll({settings:e,isEditor:t,metadata:n}){const{field:r={name:"email",type:"email",placeholder:"Your email"},buttonLabel:o="Submit",input:a,button:i,corners:s=40,stroke:l=1,strokeColor:p="#cccccc"}=e,[u,x]=D.useState(""),[m,h]=D.useState("idle"),[c,d]=D.useState(null),w=n==null?void 0:n.apiBase,v=n==null?void 0:n.projectId,g=!!(w&&v),C=a?tr(a,t):void 0,W=i?tr(i,t):void 0,F={borderRadius:B.scalingValue(s/1440,t),borderWidth:B.scalingValue(l/1440,t),borderStyle:"solid",borderColor:p},I={borderLeftWidth:B.scalingValue(l/1440,t),borderLeftStyle:"solid",borderLeftColor:p},y=async A=>{A.preventDefault();const k=u.trim();if(!(!g||!k)){h("submitting"),d(null);try{const $=await fetch(`${w}/projects/${v}/forms/submit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r.name]:k,pageUrl:typeof window<"u"?window.location.href:""})});if(!$.ok){const E=await $.text();throw new Error(E||`Request failed: ${$.status}`)}h("success"),x("")}catch($){h("error"),d($ instanceof Error?$.message:"Something went wrong")}}};return b.jsxs("div",{className:Pe.wrapper,children:[b.jsxs("form",{onSubmit:y,className:Pe.form,style:F,children:[b.jsx("div",{className:Pe.overlayAnchor,style:{flex:1,minWidth:0},children:b.jsx("input",{type:r.type==="email"?"email":r.type==="phone"?"tel":"text",name:r.name,autoComplete:"off",value:u,onChange:A=>x(A.target.value),placeholder:r.placeholder,required:r.type==="email",className:Pe.input,style:C})}),b.jsx("div",{className:Pe.overlayAnchor,children:b.jsx("button",{type:"submit",className:Pe.submitBtn,style:{...W,...I},children:m==="submitting"?"...":o})})]}),m==="success"&&b.jsx("p",{className:Pe.success,children:"Thanks for subscribing!"}),m==="error"&&c&&b.jsx("p",{className:Pe.error,role:"alert",children:c})]})}function tr(e,t){return{fontFamily:e.fontSettings.fontFamily,fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:B.scalingValue(e.letterSpacing,t),wordSpacing:B.scalingValue(e.wordSpacing,t),fontSize:B.scalingValue(e.fontSize,t),color:e.color}}const nr={fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},color:{type:"string",display:{type:"style-panel-color-picker"}}},rr=(e,t)=>({fontSettings:{fontFamily:"Arial",fontWeight:e,fontStyle:"normal"},letterSpacing:0,wordSpacing:0,fontSize:.01,color:t}),sl={type:"object",version:1,settings:{properties:{field:{type:"object",scope:"common",title:"Field",properties:{name:{type:"string"},type:{type:"string",enum:["text","phone","email"]},placeholder:{type:"string"}}},buttonLabel:{type:"string",scope:"common",title:"Button Label"},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:10},strokeColor:{type:"string",scope:"layout",title:"Border",display:{type:"style-panel-color-picker"}},input:{type:"object",scope:"layout",properties:nr},button:{type:"object",scope:"layout",properties:nr}},defaults:{field:{name:"email",type:"email",placeholder:"Your email"},buttonLabel:"Submit",corners:40,stroke:1,strokeColor:"#cccccc",input:rr(400,"#999999"),button:rr(400,"#666666")}},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__template__","corners"]},"stroke","strokeColor"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"switcher",title:"Element",options:{Input:["input"],Button:["button"]}}]}]},cl={element:ll,id:"oneliner-form",name:"Oneliner",version:1,defaultSize:{width:"50%",height:60},schema:sl},ul=[Zo,oa,Ya,Qa,cl];exports.components=ul;exports.isSchemaV1=Ur;
|
|
631
|
+
`,el=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Email is required"},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Name is required"},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Company is required"},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Phone is required"},{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"}],nn={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAppearance:{type:"object",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}},tl=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],rn=e=>({fontSettings:{fontWeight:e,fontStyle:"normal"},lineHeight:.01,letterSpacing:0,wordSpacing:0,fontSize:.01,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),nl={type:"object",version:1,settings:{sizing:"auto",properties:{fieldsToShow:{type:"number",scope:"layout",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"}}}},successMessage:{type:"string",scope:"layout",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"layout",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["A","B"]},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"}},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"}},input:{type:"object",scope:"layout",properties:nn,layout:["fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAppearance"]},button:{type:"object",scope:"layout",properties:nn,layout:["fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAppearance"]},label:{type:"object",scope:"layout",properties:nn,layout:["fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAppearance"]}},defaults:{fieldsToShow:2,fields:el,type:"A",gap:.008,fieldsGap:.008,buttonStroke:.001,buttonCorners:0,inputStroke:.001,inputCorners:0,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputColor:"#000000",inputTextColor:"#999999",inputBorderColor:"#cccccc",buttonColor:"#666666",buttonTextColor:"#ffffff",buttonBorderColor:"#cccccc",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{},fontFamily:"Arial",input:rn(400),button:rn(700),label:rn(400),successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."}},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__template__","fieldsToShow"]},"type",{type:"group",title:"BUTTON",items:[{type:"row",items:[{type:"accordion",title:"",options:{Input:[{type:"group",title:"",items:["fieldsGap","inputStroke","inputCorners"]},{type:"group",title:"Padding",items:["inputPadding"]}],Button:[{type:"group",title:"",items:["gap","buttonStroke","buttonCorners"]},{type:"group",title:"Padding",items:["buttonPadding"]}]}}]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["fontFamily",{type:"accordion",title:"",options:{Input:["input"],Button:["button"]}}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","successMessage","errorMessage"]}],paletteBookmark:{items:[...tl],panelIds:["general","typeStyle"],stateItems:{default:["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor"],hover:["inputColor","inputBorderColor","buttonColor","buttonTextColor","buttonBorderColor"],focus:["inputColor","inputTextColor","inputBorderColor"],filled:["inputColor","inputTextColor","inputBorderColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},rl={element:Ka,id:"form",name:"Form",version:1,defaultSize:{width:400,height:42},schema:nl,sourceCode:Qa},ol="OnelinerForm-module__wrapper___BCMAA",il="OnelinerForm-module__form___ED-dE",al="OnelinerForm-module__input___Dylt7",ll="OnelinerForm-module__submitBtn___aHZXa",sl="OnelinerForm-module__success___KhwKm",cl="OnelinerForm-module__error___c8WbI",ul="OnelinerForm-module__overlayAnchor___zxYKj",Pe={wrapper:ol,form:il,input:al,submitBtn:ll,success:sl,error:cl,overlayAnchor:ul};function pl({settings:e,isEditor:t,metadata:n}){const{fields:r=[{name:"email",type:"email",placeholder:"Your email"}],buttonLabel:o="Submit",input:a,button:i,height:s,corners:l,stroke:p,strokeColor:c,inputColor:w,placeholderColor:v,buttonColor:b,successColor:u,errorColor:d,fieldsToShow:A,inputPadding:E,buttonPadding:g}=e,[y,M]=z.useState({}),[P,I]=z.useState("idle"),[h,$]=z.useState(null),k=n==null?void 0:n.apiBase,F=n==null?void 0:n.projectId,R=!!(k&&F),N=a?nr(a,t):void 0,V=i?nr(i,t):void 0,W={borderRadius:j.scalingValue(l,t),borderWidth:j.scalingValue(p,t),borderStyle:"solid",borderColor:c},H={borderLeftWidth:j.scalingValue(p,t),borderLeftStyle:"solid",borderLeftColor:c},f=async x=>{x.preventDefault();const T=Object.values(y).join("").trim();if(!(!R||!T)){I("submitting"),$(null);try{const C=await fetch(`${k}/projects/${F}/forms/submit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...r.map(m=>({[m.name]:T})),pageUrl:typeof window<"u"?window.location.href:""})});if(!C.ok){const m=await C.text();throw new Error(m||`Request failed: ${C.status}`)}I("success"),M({})}catch(C){I("error"),$(C instanceof Error?C.message:"Something went wrong")}}};return _.jsxs("div",{className:Pe.wrapper,children:[_.jsxs("form",{onSubmit:f,className:Pe.form,style:{...W,height:j.scalingValue(s,t)},children:[_.jsx("div",{className:Pe.overlayAnchor,style:{flex:1,minWidth:0,backgroundColor:w},children:r.slice(0,A).map(x=>_.jsx("input",{type:x.type==="email"?"email":x.type==="phone"?"tel":"text",name:x.name,autoComplete:"off",value:y[x.name]||"",onChange:T=>M(C=>({...C,[x.name]:T.target.value})),placeholder:x.placeholder,required:x.type==="email",className:Pe.input,style:{...N,paddingRight:j.scalingValue(E.right,t),paddingLeft:j.scalingValue(E.left,t),"--placeholder-color":v}},x.name))}),_.jsx("div",{className:Pe.overlayAnchor,children:_.jsx("button",{type:"submit",className:Pe.submitBtn,style:{...V,...H,backgroundColor:b,paddingRight:j.scalingValue(g.right,t),paddingLeft:j.scalingValue(g.left,t)},children:P==="submitting"?"...":o})})]}),P==="success"&&_.jsx("p",{className:Pe.success,style:{color:u},children:"Thanks for subscribing!"}),P==="error"&&h&&_.jsx("p",{className:Pe.error,style:{color:d},role:"alert",children:h})]})}function nr(e,t){return{fontFamily:e.fontSettings.fontFamily,fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:j.scalingValue(e.letterSpacing,t),wordSpacing:j.scalingValue(e.wordSpacing,t),fontSize:j.scalingValue(e.fontSize,t),color:e.color}}const dl=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Email is required"},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Name is required"},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Company is required"},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Phone is required"}],rr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},color:{type:"string",title:"Text Color",display:{type:"palette-color-picker"}}},gl=["strokeColor","inputColor","placeholderColor","buttonColor"],or=e=>({fontSettings:{fontWeight:e,fontStyle:"normal"},letterSpacing:0,wordSpacing:0,fontSize:.01,lineHeight:.01,color:"#111111"}),fl={type:"object",version:1,settings:{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"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},fontFamily:{type:"string",scope:"layout",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"Input Padding",properties:{right:{type:"number",display:{type:"range-control"},min:0,max:100},left:{type:"number",display:{type:"range-control"},min:0,max:100}}},buttonPadding:{type:"object",scope:"layout",title:"Button Padding",properties:{right:{type:"number",display:{type:"range-control"},min:0,max:100},left:{type:"number",display:{type:"range-control"},min:0,max:100}}},height:{type:"number",scope:"layout",title:"Height",display:{type:"range-control"},min:0,max:100},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"}},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"}},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"}},input:{type:"object",scope:"layout",title:"Input",properties:rr,layout:["fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]}]},button:{type:"object",scope:"layout",title:"Button",properties:rr,layout:["fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]}]}},defaults:{fields:dl,fieldsToShow:1,buttonLabel:"Submit",fontFamily:"Arial",inputPadding:{right:.01,left:.01},buttonPadding:{right:.01,left:.01},height:.028,corners:.05,stroke:.001,strokeColor:"#cccccc",inputColor:"#ffffff",placeholderColor:"#cccccc",buttonColor:"#cccccc",errorColor:"#ef4444",successColor:"#22c55e",input:or(400),button:or(400)}},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__template__","fieldsToShow"]},{type:"group",title:"BUTTON",items:[{type:"row",items:[{type:"group",title:"",items:["height","corners","stroke",{type:"accordion",title:"",options:{"Input Padding":["inputPadding"],"Button Padding":["buttonPadding"]}}]}]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["fontFamily",{type:"accordion",title:"",options:{Input:["input"],Button:["button"]}}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","successMessage","errorMessage"]}],paletteBookmark:{items:[...gl],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","inputColor","placeholderColor","buttonColor"],hover:["strokeColor","inputColor","buttonColor"],focus:["strokeColor","inputColor","buttonColor"],filled:["strokeColor","inputColor","buttonColor"],success:["strokeColor","inputColor","buttonColor"],error:["strokeColor","inputColor","buttonColor"]}}},ml={element:pl,id:"oneliner-form",name:"Oneliner",version:1,defaultSize:{width:"50%",height:60},schema:fl},yl=[Qi,aa,qa,rl,ml];exports.components=yl;exports.isSchemaV1=Gr;
|