@cntrl-site/components 1.0.16-alpha.0 → 1.0.16-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/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),c=require("react"),De=require("classnames"),L=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),ei=require("react-dom");function ns(e){return e.type==="object"&&e.version===1}const is="ControlSlider-module__wrapper___sHEkd",os="ControlSlider-module__hoverArrow___A-dOH",rs="ControlSlider-module__sliderItem___QQSkR",as="ControlSlider-module__sliderImage___9hRl-",ss="ControlSlider-module__arrow___05ghY",ls="ControlSlider-module__arrowVertical___tBfVN",cs="ControlSlider-module__nextArrow___-30Yc",ds="ControlSlider-module__arrowInner___aEra3",us="ControlSlider-module__arrowIcon___S4ztF",ps="ControlSlider-module__arrowImg___2dwJW",ms="ControlSlider-module__mirror___brd6U",gs="ControlSlider-module__pagination___bicLF",hs="ControlSlider-module__paginationInner___bT-P-",fs="ControlSlider-module__paginationVertical___zYqKw",ys="ControlSlider-module__paginationItem___nTRbk",vs="ControlSlider-module__dot___p1Qun",bs="ControlSlider-module__activeDot___LHFaj",xs="ControlSlider-module__paginationInsideBottom___R3FWn",Ss="ControlSlider-module__paginationInsideTop___V-qb-",Cs="ControlSlider-module__paginationOutsideBottom___14w8D",$s="ControlSlider-module__paginationOutsideTop___SCLqB",ws="ControlSlider-module__paginationInsideLeft___yOBRZ",Ts="ControlSlider-module__paginationInsideRight___Rtt3o",Ls="ControlSlider-module__paginationOutsideLeft___lahaw",Es="ControlSlider-module__paginationOutsideRight___EtuQa",Is="ControlSlider-module__imgWrapper___UjEgB",Rs="ControlSlider-module__captionBlock___dJ6-j",Ps="ControlSlider-module__captionTextWrapper___HFlpf",_s="ControlSlider-module__captionText___uGBVc",As="ControlSlider-module__active___WZK4G",Ms="ControlSlider-module__withPointerEvents___t-18M",ks="ControlSlider-module__topLeftAlignment___zjnGM",Fs="ControlSlider-module__topCenterAlignment___gD1xW",Ws="ControlSlider-module__topRightAlignment___NMapS",Ns="ControlSlider-module__middleLeftAlignment___OnUrY",Hs="ControlSlider-module__middleCenterAlignment___Tdkl0",Os="ControlSlider-module__middleRightAlignment___wEbfX",Bs="ControlSlider-module__bottomLeftAlignment___cTP2-",js="ControlSlider-module__bottomCenterAlignment___c54fB",zs="ControlSlider-module__bottomRightAlignment___kEwrz",Ds="ControlSlider-module__clickOverlay___DZA28",Vs="ControlSlider-module__contain___pLyq7",Gs="ControlSlider-module__cover___KdDat",ye={wrapper:is,hoverArrow:os,sliderItem:rs,sliderImage:as,arrow:ss,arrowVertical:ls,nextArrow:cs,arrowInner:ds,arrowIcon:us,arrowImg:ps,mirror:ms,pagination:gs,paginationInner:hs,paginationVertical:fs,paginationItem:ys,dot:vs,activeDot:bs,paginationInsideBottom:xs,paginationInsideTop:Ss,paginationOutsideBottom:Cs,paginationOutsideTop:$s,paginationInsideLeft:ws,paginationInsideRight:Ts,paginationOutsideLeft:Ls,paginationOutsideRight:Es,imgWrapper:Is,captionBlock:Rs,captionTextWrapper:Ps,captionText:_s,active:As,withPointerEvents:Ms,topLeftAlignment:ks,topCenterAlignment:Fs,topRightAlignment:Ws,middleLeftAlignment:Ns,middleCenterAlignment:Hs,middleRightAlignment:Os,bottomLeftAlignment:Bs,bottomCenterAlignment:js,bottomRightAlignment:zs,clickOverlay:Ds,contain:Vs,cover:Gs};function Us(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Ks(e,t,n){return t&&Us(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var ar="(prefers-reduced-motion: reduce)",Tn=1,qs=2,In=3,Fn=4,ti=5,Ci=6,_i=7,Xs={CREATED:Tn,MOUNTED:qs,IDLE:In,MOVING:Fn,SCROLLING:ti,DRAGGING:Ci,DESTROYED:_i};function qt(e){e.length=0}function on(e,t,n){return Array.prototype.slice.call(e,t,n)}function Ye(e){return e.bind.apply(e,[null].concat(on(arguments,1)))}var oa=setTimeout,fo=function(){};function sr(e){return requestAnimationFrame(e)}function Ni(e,t){return typeof t===e}function Dn(e){return!Ro(e)&&Ni("object",e)}var Io=Array.isArray,ra=Ye(Ni,"function"),en=Ye(Ni,"string"),ni=Ye(Ni,"undefined");function Ro(e){return e===null}function aa(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function ii(e){return Io(e)?e:[e]}function Pt(e,t){ii(e).forEach(t)}function Po(e,t){return e.indexOf(t)>-1}function $i(e,t){return e.push.apply(e,ii(t)),e}function Dt(e,t,n){e&&Pt(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Nt(e,t){Dt(e,en(t)?t.split(" "):t,!0)}function oi(e,t){Pt(t,e.appendChild.bind(e))}function _o(e,t){Pt(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function Vn(e,t){return aa(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function sa(e,t){var n=e?on(e.children):[];return t?n.filter(function(i){return Vn(i,t)}):n}function ri(e,t){return t?sa(e,t)[0]:e.firstElementChild}var Gn=Object.keys;function mn(e,t,n){return e&&(n?Gn(e).reverse():Gn(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function Un(e){return on(arguments,1).forEach(function(t){mn(t,function(n,i){e[i]=t[i]})}),e}function Qt(e){return on(arguments,1).forEach(function(t){mn(t,function(n,i){Io(n)?e[i]=n.slice():Dn(n)?e[i]=Qt({},Dn(e[i])?e[i]:{},n):e[i]=n})}),e}function lr(e,t){Pt(t||Gn(e),function(n){delete e[n]})}function Ht(e,t){Pt(e,function(n){Pt(t,function(i){n&&n.removeAttribute(i)})})}function Me(e,t,n){Dn(t)?mn(t,function(i,o){Me(e,o,i)}):Pt(e,function(i){Ro(n)||n===""?Ht(i,t):i.setAttribute(t,String(n))})}function Ln(e,t,n){var i=document.createElement(e);return t&&(en(t)?Nt(i,t):Me(i,t)),n&&oi(n,i),i}function _t(e,t,n){if(ni(n))return getComputedStyle(e)[t];Ro(n)||(e.style[t]=""+n)}function Kn(e,t){_t(e,"display",t)}function la(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function At(e,t){return e.getAttribute(t)}function cr(e,t){return e&&e.classList.contains(t)}function Et(e){return e.getBoundingClientRect()}function gn(e){Pt(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function ca(e){return ri(new DOMParser().parseFromString(e,"text/html").body)}function zt(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function da(e,t){return e&&e.querySelector(t)}function Ao(e,t){return t?on(e.querySelectorAll(t)):[]}function Vt(e,t){Dt(e,t,!1)}function yo(e){return e.timeStamp}function ln(e){return en(e)?e:e?e+"px":""}var ai="splide",Mo="data-"+ai;function On(e,t){if(!e)throw new Error("["+ai+"] "+(t||""))}var tn=Math.min,Ai=Math.max,Mi=Math.floor,qn=Math.ceil,vt=Math.abs;function ua(e,t,n){return vt(e-t)<n}function wi(e,t,n,i){var o=tn(t,n),s=Ai(t,n);return i?o<e&&e<s:o<=e&&e<=s}function Cn(e,t,n){var i=tn(t,n),o=Ai(t,n);return tn(Ai(i,e),o)}function vo(e){return+(e>0)-+(e<0)}function bo(e,t){return Pt(t,function(n){e=e.replace("%s",""+n)}),e}function ko(e){return e<10?"0"+e:""+e}var dr={};function Ys(e){return""+e+ko(dr[e]=(dr[e]||0)+1)}function pa(){var e=[];function t(l,d,a,u){o(l,d,function(p,T,x){var y="addEventListener"in p,g=y?p.removeEventListener.bind(p,T,a,u):p.removeListener.bind(p,a);y?p.addEventListener(T,a,u):p.addListener(a),e.push([p,T,x,a,g])})}function n(l,d,a){o(l,d,function(u,p,T){e=e.filter(function(x){return x[0]===u&&x[1]===p&&x[2]===T&&(!a||x[3]===a)?(x[4](),!1):!0})})}function i(l,d,a){var u,p=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:p,detail:a}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,p,!1,a)),l.dispatchEvent(u),u}function o(l,d,a){Pt(l,function(u){u&&Pt(d,function(p){p.split(" ").forEach(function(T){var x=T.split(".");a(u,x[0],x[1])})})})}function s(){e.forEach(function(l){l[4]()}),qt(e)}return{bind:t,unbind:n,dispatch:i,destroy:s}}var rn="mounted",xo="ready",Xt="move",Wn="moved",Fo="click",ma="active",ga="inactive",ha="visible",fa="hidden",nt="refresh",pt="updated",Rn="resize",Hi="resized",ya="drag",va="dragging",ba="dragged",Oi="scroll",fn="scrolled",Js="overflow",Wo="destroy",xa="arrows:mounted",Sa="arrows:updated",Ca="pagination:mounted",$a="pagination:updated",No="navigation:mounted",Ho="autoplay:play",wa="autoplay:playing",Oo="autoplay:pause",Bo="lazyload:loaded",Ta="sk",La="sh",ki="ei";function Qe(e){var t=e?e.event.bus:document.createDocumentFragment(),n=pa();function i(s,l){n.bind(t,ii(s).join(" "),function(d){l.apply(l,Io(d.detail)?d.detail:[])})}function o(s){n.dispatch(t,s,on(arguments,1))}return e&&e.event.on(Wo,n.destroy),Un(n,{bus:t,on:i,off:Ye(n.unbind,t),emit:o})}function Bi(e,t,n,i){var o=Date.now,s,l=0,d,a=!0,u=0;function p(){if(!a){if(l=e?tn((o()-s)/e,1):1,n&&n(l),l>=1&&(t(),s=o(),i&&++u>=i))return x();d=sr(p)}}function T(S){S||g(),s=o()-(S?l*e:0),a=!1,d=sr(p)}function x(){a=!0}function y(){s=o(),l=0,n&&n(l)}function g(){d&&cancelAnimationFrame(d),l=0,d=0,a=!0}function h(S){e=S}function w(){return a}return{start:T,rewind:y,pause:x,cancel:g,set:h,isPaused:w}}function Zs(e){var t=e;function n(o){t=o}function i(o){return Po(ii(o),t)}return{set:n,is:i}}function Qs(e,t){var n=Bi(0,e,null,1);return function(){n.isPaused()&&n.start()}}function el(e,t,n){var i=e.state,o=n.breakpoints||{},s=n.reducedMotion||{},l=pa(),d=[];function a(){var g=n.mediaQuery==="min";Gn(o).sort(function(h,w){return g?+h-+w:+w-+h}).forEach(function(h){p(o[h],"("+(g?"min":"max")+"-width:"+h+"px)")}),p(s,ar),T()}function u(g){g&&l.destroy()}function p(g,h){var w=matchMedia(h);l.bind(w,"change",T),d.push([g,w])}function T(){var g=i.is(_i),h=n.direction,w=d.reduce(function(S,b){return Qt(S,b[1].matches?b[0]:{})},{});lr(n),y(w),n.destroy?e.destroy(n.destroy==="completely"):g?(u(!0),e.mount()):h!==n.direction&&e.refresh()}function x(g){matchMedia(ar).matches&&(g?Qt(n,s):lr(n,Gn(s)))}function y(g,h,w){Qt(n,g),h&&Qt(Object.getPrototypeOf(n),g),(w||!i.is(Tn))&&e.emit(pt,n)}return{setup:a,destroy:u,reduce:x,set:y}}var ji="Arrow",zi=ji+"Left",Di=ji+"Right",Ea=ji+"Up",Ia=ji+"Down",ur="rtl",Vi="ttb",Qi={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Ea,Di],ArrowRight:[Ia,zi]};function tl(e,t,n){function i(s,l,d){d=d||n.direction;var a=d===ur&&!l?1:d===Vi?0:-1;return Qi[s]&&Qi[s][a]||s.replace(/width|left|right/i,function(u,p){var T=Qi[u.toLowerCase()][a]||u;return p>0?T.charAt(0).toUpperCase()+T.slice(1):T})}function o(s){return s*(n.direction===ur?1:-1)}return{resolve:i,orient:o}}var Gt="role",En="tabindex",nl="disabled",Mt="aria-",si=Mt+"controls",Ra=Mt+"current",pr=Mt+"selected",It=Mt+"label",jo=Mt+"labelledby",Pa=Mt+"hidden",zo=Mt+"orientation",Xn=Mt+"roledescription",mr=Mt+"live",gr=Mt+"busy",hr=Mt+"atomic",Do=[Gt,En,nl,si,Ra,It,jo,Pa,zo,Xn],Ot=ai+"__",an="is-",eo=ai,fr=Ot+"track",il=Ot+"list",Gi=Ot+"slide",_a=Gi+"--clone",ol=Gi+"__container",Vo=Ot+"arrows",Ui=Ot+"arrow",Aa=Ui+"--prev",Ma=Ui+"--next",Ki=Ot+"pagination",ka=Ki+"__page",rl=Ot+"progress",al=rl+"__bar",sl=Ot+"toggle",ll=Ot+"spinner",cl=Ot+"sr",dl=an+"initialized",hn=an+"active",Fa=an+"prev",Wa=an+"next",So=an+"visible",Co=an+"loading",Na=an+"focus-in",Ha=an+"overflow",ul=[hn,So,Fa,Wa,Co,Na,Ha],pl={slide:Gi,clone:_a,arrows:Vo,arrow:Ui,prev:Aa,next:Ma,pagination:Ki,page:ka,spinner:ll};function ml(e,t){if(ra(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!Vn(n,t);)n=n.parentElement;return n}var gl=5,yr=200,Oa="touchstart mousedown",to="touchmove mousemove",no="touchend touchcancel mouseup click";function hl(e,t,n){var i=Qe(e),o=i.on,s=i.bind,l=e.root,d=n.i18n,a={},u=[],p=[],T=[],x,y,g;function h(){$(),H(),b()}function w(){o(nt,S),o(nt,h),o(pt,b),s(document,Oa+" keydown",function(m){g=m.type==="keydown"},{capture:!0}),s(l,"focusin",function(){Dt(l,Na,!!g)})}function S(m){var C=Do.concat("style");qt(u),Vt(l,p),Vt(x,T),Ht([x,y],C),Ht(l,m?C:["style",Xn])}function b(){Vt(l,p),Vt(x,T),p=B(eo),T=B(fr),Nt(l,p),Nt(x,T),Me(l,It,n.label),Me(l,jo,n.labelledby)}function $(){x=R("."+fr),y=ri(x,"."+il),On(x&&y,"A track/list element is missing."),$i(u,sa(y,"."+Gi+":not(."+_a+")")),mn({arrows:Vo,pagination:Ki,prev:Aa,next:Ma,bar:al,toggle:sl},function(m,C){a[C]=R("."+m)}),Un(a,{root:l,track:x,list:y,slides:u})}function H(){var m=l.id||Ys(ai),C=n.role;l.id=m,x.id=x.id||m+"-track",y.id=y.id||m+"-list",!At(l,Gt)&&l.tagName!=="SECTION"&&C&&Me(l,Gt,C),Me(l,Xn,d.carousel),Me(y,Gt,"presentation")}function R(m){var C=da(l,m);return C&&ml(C,"."+eo)===l?C:void 0}function B(m){return[m+"--"+n.type,m+"--"+n.direction,n.drag&&m+"--draggable",n.isNavigation&&m+"--nav",m===eo&&hn]}return Un(a,{setup:h,mount:w,destroy:S})}var Pn="slide",Nn="loop",li="fade";function fl(e,t,n,i){var o=Qe(e),s=o.on,l=o.emit,d=o.bind,a=e.Components,u=e.root,p=e.options,T=p.isNavigation,x=p.updateOnMove,y=p.i18n,g=p.pagination,h=p.slideFocus,w=a.Direction.resolve,S=At(i,"style"),b=At(i,It),$=n>-1,H=ri(i,"."+ol),R;function B(){$||(i.id=u.id+"-slide"+ko(t+1),Me(i,Gt,g?"tabpanel":"group"),Me(i,Xn,y.slide),Me(i,It,b||bo(y.slideLabel,[t+1,e.length]))),m()}function m(){d(i,"click",Ye(l,Fo,I)),d(i,"keydown",Ye(l,Ta,I)),s([Wn,La,fn],E),s(No,N),x&&s(Xt,v)}function C(){R=!0,o.destroy(),Vt(i,ul),Ht(i,Do),Me(i,"style",S),Me(i,It,b||"")}function N(){var F=e.splides.map(function(_){var j=_.splide.Components.Slides.getAt(t);return j?j.slide.id:""}).join(" ");Me(i,It,bo(y.slideX,($?n:t)+1)),Me(i,si,F),Me(i,Gt,h?"button":""),h&&Ht(i,Xn)}function v(){R||E()}function E(){if(!R){var F=e.index;k(),O(),Dt(i,Fa,t===F-1),Dt(i,Wa,t===F+1)}}function k(){var F=Z();F!==cr(i,hn)&&(Dt(i,hn,F),Me(i,Ra,T&&F||""),l(F?ma:ga,I))}function O(){var F=W(),_=!F&&(!Z()||$);if(e.state.is([Fn,ti])||Me(i,Pa,_||""),Me(Ao(i,p.focusableNodes||""),En,_?-1:""),h&&Me(i,En,_?-1:0),F!==cr(i,So)&&(Dt(i,So,F),l(F?ha:fa,I)),!F&&document.activeElement===i){var j=a.Slides.getAt(e.index);j&&la(j.slide)}}function U(F,_,j){_t(j&&H||i,F,_)}function Z(){var F=e.index;return F===t||p.cloneStatus&&F===n}function W(){if(e.is(li))return Z();var F=Et(a.Elements.track),_=Et(i),j=w("left",!0),K=w("right",!0);return Mi(F[j])<=qn(_[j])&&Mi(_[K])<=qn(F[K])}function P(F,_){var j=vt(F-t);return!$&&(p.rewind||e.is(Nn))&&(j=tn(j,e.length-j)),j<=_}var I={index:t,slideIndex:n,slide:i,container:H,isClone:$,mount:B,destroy:C,update:E,style:U,isWithin:P};return I}function yl(e,t,n){var i=Qe(e),o=i.on,s=i.emit,l=i.bind,d=t.Elements,a=d.slides,u=d.list,p=[];function T(){x(),o(nt,y),o(nt,x)}function x(){a.forEach(function(E,k){h(E,k,-1)})}function y(){R(function(E){E.destroy()}),qt(p)}function g(){R(function(E){E.update()})}function h(E,k,O){var U=fl(e,k,O,E);U.mount(),p.push(U),p.sort(function(Z,W){return Z.index-W.index})}function w(E){return E?B(function(k){return!k.isClone}):p}function S(E){var k=t.Controller,O=k.toIndex(E),U=k.hasFocus()?1:n.perPage;return B(function(Z){return wi(Z.index,O,O+U-1)})}function b(E){return B(E)[0]}function $(E,k){Pt(E,function(O){if(en(O)&&(O=ca(O)),aa(O)){var U=a[k];U?_o(O,U):oi(u,O),Nt(O,n.classes.slide),C(O,Ye(s,Rn))}}),s(nt)}function H(E){gn(B(E).map(function(k){return k.slide})),s(nt)}function R(E,k){w(k).forEach(E)}function B(E){return p.filter(ra(E)?E:function(k){return en(E)?Vn(k.slide,E):Po(ii(E),k.index)})}function m(E,k,O){R(function(U){U.style(E,k,O)})}function C(E,k){var O=Ao(E,"img"),U=O.length;U?O.forEach(function(Z){l(Z,"load error",function(){--U||k()})}):k()}function N(E){return E?a.length:p.length}function v(){return p.length>n.perPage}return{mount:T,destroy:y,update:g,register:h,get:w,getIn:S,getAt:b,add:$,remove:H,forEach:R,filter:B,style:m,getLength:N,isEnough:v}}function vl(e,t,n){var i=Qe(e),o=i.on,s=i.bind,l=i.emit,d=t.Slides,a=t.Direction.resolve,u=t.Elements,p=u.root,T=u.track,x=u.list,y=d.getAt,g=d.style,h,w,S;function b(){$(),s(window,"resize load",Qs(Ye(l,Rn))),o([pt,nt],$),o(Rn,H)}function $(){h=n.direction===Vi,_t(p,"maxWidth",ln(n.width)),_t(T,a("paddingLeft"),R(!1)),_t(T,a("paddingRight"),R(!0)),H(!0)}function H(I){var F=Et(p);(I||w.width!==F.width||w.height!==F.height)&&(_t(T,"height",B()),g(a("marginRight"),ln(n.gap)),g("width",C()),g("height",N(),!0),w=F,l(Hi),S!==(S=P())&&(Dt(p,Ha,S),l(Js,S)))}function R(I){var F=n.padding,_=a(I?"right":"left");return F&&ln(F[_]||(Dn(F)?0:F))||"0px"}function B(){var I="";return h&&(I=m(),On(I,"height or heightRatio is missing."),I="calc("+I+" - "+R(!1)+" - "+R(!0)+")"),I}function m(){return ln(n.height||Et(x).width*n.heightRatio)}function C(){return n.autoWidth?null:ln(n.fixedWidth)||(h?"":v())}function N(){return ln(n.fixedHeight)||(h?n.autoHeight?null:v():m())}function v(){var I=ln(n.gap);return"calc((100%"+(I&&" + "+I)+")/"+(n.perPage||1)+(I&&" - "+I)+")"}function E(){return Et(x)[a("width")]}function k(I,F){var _=y(I||0);return _?Et(_.slide)[a("width")]+(F?0:Z()):0}function O(I,F){var _=y(I);if(_){var j=Et(_.slide)[a("right")],K=Et(x)[a("left")];return vt(j-K)+(F?0:Z())}return 0}function U(I){return O(e.length-1)-O(0)+k(0,I)}function Z(){var I=y(0);return I&&parseFloat(_t(I.slide,a("marginRight")))||0}function W(I){return parseFloat(_t(T,a("padding"+(I?"Right":"Left"))))||0}function P(){return e.is(li)||U(!0)>E()}return{mount:b,resize:H,listSize:E,slideSize:k,sliderSize:U,totalSize:O,getPadding:W,isOverflow:P}}var bl=2;function xl(e,t,n){var i=Qe(e),o=i.on,s=t.Elements,l=t.Slides,d=t.Direction.resolve,a=[],u;function p(){o(nt,T),o([pt,Rn],y),(u=w())&&(g(u),t.Layout.resize(!0))}function T(){x(),p()}function x(){gn(a),qt(a),i.destroy()}function y(){var S=w();u!==S&&(u<S||!S)&&i.emit(nt)}function g(S){var b=l.get().slice(),$=b.length;if($){for(;b.length<S;)$i(b,b);$i(b.slice(-S),b.slice(0,S)).forEach(function(H,R){var B=R<S,m=h(H.slide,R);B?_o(m,b[0].slide):oi(s.list,m),$i(a,m),l.register(m,R-S+(B?0:$),H.index)})}}function h(S,b){var $=S.cloneNode(!0);return Nt($,n.classes.clone),$.id=e.root.id+"-clone"+ko(b+1),$}function w(){var S=n.clones;if(!e.is(Nn))S=0;else if(ni(S)){var b=n[d("fixedWidth")]&&t.Layout.slideSize(0),$=b&&qn(Et(s.track)[d("width")]/b);S=$||n[d("autoWidth")]&&e.length||n.perPage*bl}return S}return{mount:p,destroy:x}}function Sl(e,t,n){var i=Qe(e),o=i.on,s=i.emit,l=e.state.set,d=t.Layout,a=d.slideSize,u=d.getPadding,p=d.totalSize,T=d.listSize,x=d.sliderSize,y=t.Direction,g=y.resolve,h=y.orient,w=t.Elements,S=w.list,b=w.track,$;function H(){$=t.Transition,o([rn,Hi,pt,nt],R)}function R(){t.Controller.isBusy()||(t.Scroll.cancel(),m(e.index),t.Slides.update())}function B(_,j,K,te){_!==j&&I(_>K)&&(E(),C(v(U(),_>K),!0)),l(Fn),s(Xt,j,K,_),$.start(j,function(){l(In),s(Wn,j,K,_),te&&te()})}function m(_){C(O(_,!0))}function C(_,j){if(!e.is(li)){var K=j?_:N(_);_t(S,"transform","translate"+g("X")+"("+K+"px)"),_!==K&&s(La)}}function N(_){if(e.is(Nn)){var j=k(_),K=j>t.Controller.getEnd(),te=j<0;(te||K)&&(_=v(_,K))}return _}function v(_,j){var K=_-P(j),te=x();return _-=h(te*(qn(vt(K)/te)||1))*(j?1:-1),_}function E(){C(U(),!0),$.cancel()}function k(_){for(var j=t.Slides.get(),K=0,te=1/0,M=0;M<j.length;M++){var ne=j[M].index,f=vt(O(ne,!0)-_);if(f<=te)te=f,K=ne;else break}return K}function O(_,j){var K=h(p(_-1)-W(_));return j?Z(K):K}function U(){var _=g("left");return Et(S)[_]-Et(b)[_]+h(u(!1))}function Z(_){return n.trimSpace&&e.is(Pn)&&(_=Cn(_,0,h(x(!0)-T()))),_}function W(_){var j=n.focus;return j==="center"?(T()-a(_,!0))/2:+j*a(_)||0}function P(_){return O(_?t.Controller.getEnd():0,!!n.trimSpace)}function I(_){var j=h(v(U(),_));return _?j>=0:j<=S[g("scrollWidth")]-Et(b)[g("width")]}function F(_,j){j=ni(j)?U():j;var K=_!==!0&&h(j)<h(P(!1)),te=_!==!1&&h(j)>h(P(!0));return K||te}return{mount:H,move:B,jump:m,translate:C,shift:v,cancel:E,toIndex:k,toPosition:O,getPosition:U,getLimit:P,exceededLimit:F,reposition:R}}function Cl(e,t,n){var i=Qe(e),o=i.on,s=i.emit,l=t.Move,d=l.getPosition,a=l.getLimit,u=l.toPosition,p=t.Slides,T=p.isEnough,x=p.getLength,y=n.omitEnd,g=e.is(Nn),h=e.is(Pn),w=Ye(U,!1),S=Ye(U,!0),b=n.start||0,$,H=b,R,B,m;function C(){N(),o([pt,nt,ki],N),o(Hi,v)}function N(){R=x(!0),B=n.perMove,m=n.perPage,$=I();var f=Cn(b,0,y?$:R-1);f!==b&&(b=f,l.reposition())}function v(){$!==I()&&s(ki)}function E(f,ee,ge){if(!ne()){var ie=O(f),fe=P(ie);fe>-1&&(ee||fe!==b)&&(K(fe),l.move(ie,fe,H,ge))}}function k(f,ee,ge,ie){t.Scroll.scroll(f,ee,ge,function(){var fe=P(l.toIndex(d()));K(y?tn(fe,$):fe),ie&&ie()})}function O(f){var ee=b;if(en(f)){var ge=f.match(/([+\-<>])(\d+)?/)||[],ie=ge[1],fe=ge[2];ie==="+"||ie==="-"?ee=Z(b+ +(""+ie+(+fe||1)),b):ie===">"?ee=fe?F(+fe):w(!0):ie==="<"&&(ee=S(!0))}else ee=g?f:Cn(f,0,$);return ee}function U(f,ee){var ge=B||(M()?1:m),ie=Z(b+ge*(f?-1:1),b,!(B||M()));return ie===-1&&h&&!ua(d(),a(!f),1)?f?0:$:ee?ie:P(ie)}function Z(f,ee,ge){if(T()||M()){var ie=W(f);ie!==f&&(ee=f,f=ie,ge=!1),f<0||f>$?!B&&(wi(0,f,ee,!0)||wi($,ee,f,!0))?f=F(_(f)):g?f=ge?f<0?-(R%m||m):R:f:n.rewind?f=f<0?$:0:f=-1:ge&&f!==ee&&(f=F(_(ee)+(f<ee?-1:1)))}else f=-1;return f}function W(f){if(h&&n.trimSpace==="move"&&f!==b)for(var ee=d();ee===u(f,!0)&&wi(f,0,e.length-1,!n.rewind);)f<b?--f:++f;return f}function P(f){return g?(f+R)%R||0:f}function I(){for(var f=R-(M()||g&&B?1:m);y&&f-- >0;)if(u(R-1,!0)!==u(f,!0)){f++;break}return Cn(f,0,R-1)}function F(f){return Cn(M()?f:m*f,0,$)}function _(f){return M()?tn(f,$):Mi((f>=$?R-1:f)/m)}function j(f){var ee=l.toIndex(f);return h?Cn(ee,0,$):ee}function K(f){f!==b&&(H=b,b=f)}function te(f){return f?H:b}function M(){return!ni(n.focus)||n.isNavigation}function ne(){return e.state.is([Fn,ti])&&!!n.waitForTransition}return{mount:C,go:E,scroll:k,getNext:w,getPrev:S,getAdjacent:U,getEnd:I,setIndex:K,getIndex:te,toIndex:F,toPage:_,toDest:j,hasFocus:M,isBusy:ne}}var $l="http://www.w3.org/2000/svg",wl="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",pi=40;function Tl(e,t,n){var i=Qe(e),o=i.on,s=i.bind,l=i.emit,d=n.classes,a=n.i18n,u=t.Elements,p=t.Controller,T=u.arrows,x=u.track,y=T,g=u.prev,h=u.next,w,S,b={};function $(){R(),o(pt,H)}function H(){B(),$()}function R(){var k=n.arrows;k&&!(g&&h)&&N(),g&&h&&(Un(b,{prev:g,next:h}),Kn(y,k?"":"none"),Nt(y,S=Vo+"--"+n.direction),k&&(m(),E(),Me([g,h],si,x.id),l(xa,g,h)))}function B(){i.destroy(),Vt(y,S),w?(gn(T?[g,h]:y),g=h=null):Ht([g,h],Do)}function m(){o([rn,Wn,nt,fn,ki],E),s(h,"click",Ye(C,">")),s(g,"click",Ye(C,"<"))}function C(k){p.go(k,!0)}function N(){y=T||Ln("div",d.arrows),g=v(!0),h=v(!1),w=!0,oi(y,[g,h]),!T&&_o(y,x)}function v(k){var O='<button class="'+d.arrow+" "+(k?d.prev:d.next)+'" type="button"><svg xmlns="'+$l+'" viewBox="0 0 '+pi+" "+pi+'" width="'+pi+'" height="'+pi+'" focusable="false"><path d="'+(n.arrowPath||wl)+'" />';return ca(O)}function E(){if(g&&h){var k=e.index,O=p.getPrev(),U=p.getNext(),Z=O>-1&&k<O?a.last:a.prev,W=U>-1&&k>U?a.first:a.next;g.disabled=O<0,h.disabled=U<0,Me(g,It,Z),Me(h,It,W),l(Sa,g,h,O,U)}}return{arrows:b,mount:$,destroy:B,update:E}}var Ll=Mo+"-interval";function El(e,t,n){var i=Qe(e),o=i.on,s=i.bind,l=i.emit,d=Bi(n.interval,e.go.bind(e,">"),m),a=d.isPaused,u=t.Elements,p=t.Elements,T=p.root,x=p.toggle,y=n.autoplay,g,h,w=y==="pause";function S(){y&&(b(),x&&Me(x,si,u.track.id),w||$(),B())}function b(){n.pauseOnHover&&s(T,"mouseenter mouseleave",function(N){g=N.type==="mouseenter",R()}),n.pauseOnFocus&&s(T,"focusin focusout",function(N){h=N.type==="focusin",R()}),x&&s(x,"click",function(){w?$():H(!0)}),o([Xt,Oi,nt],d.rewind),o(Xt,C)}function $(){a()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),h=g=w=!1,B(),l(Ho))}function H(N){N===void 0&&(N=!0),w=!!N,B(),a()||(d.pause(),l(Oo))}function R(){w||(g||h?H(!1):$())}function B(){x&&(Dt(x,hn,!w),Me(x,It,n.i18n[w?"play":"pause"]))}function m(N){var v=u.bar;v&&_t(v,"width",N*100+"%"),l(wa,N)}function C(N){var v=t.Slides.getAt(N);d.set(v&&+At(v.slide,Ll)||n.interval)}return{mount:S,destroy:d.cancel,play:$,pause:H,isPaused:a}}function Il(e,t,n){var i=Qe(e),o=i.on;function s(){n.cover&&(o(Bo,Ye(d,!0)),o([rn,pt,nt],Ye(l,!0)))}function l(a){t.Slides.forEach(function(u){var p=ri(u.container||u.slide,"img");p&&p.src&&d(a,p,u)})}function d(a,u,p){p.style("background",a?'center/cover no-repeat url("'+u.src+'")':"",!0),Kn(u,a?"none":"")}return{mount:s,destroy:Ye(l,!1)}}var Rl=10,Pl=600,_l=.6,Al=1.5,Ml=800;function kl(e,t,n){var i=Qe(e),o=i.on,s=i.emit,l=e.state.set,d=t.Move,a=d.getPosition,u=d.getLimit,p=d.exceededLimit,T=d.translate,x=e.is(Pn),y,g,h=1;function w(){o(Xt,H),o([pt,nt],R)}function S(m,C,N,v,E){var k=a();if(H(),N&&(!x||!p())){var O=t.Layout.sliderSize(),U=vo(m)*O*Mi(vt(m)/O)||0;m=d.toPosition(t.Controller.toDest(m%O))+U}var Z=ua(k,m,1);h=1,C=Z?0:C||Ai(vt(m-k)/Al,Ml),g=v,y=Bi(C,b,Ye($,k,m,E),1),l(ti),s(Oi),y.start()}function b(){l(In),g&&g(),s(fn)}function $(m,C,N,v){var E=a(),k=m+(C-m)*B(v),O=(k-E)*h;T(E+O),x&&!N&&p()&&(h*=_l,vt(O)<Rl&&S(u(p(!0)),Pl,!1,g,!0))}function H(){y&&y.cancel()}function R(){y&&!y.isPaused()&&(H(),b())}function B(m){var C=n.easingFunc;return C?C(m):1-Math.pow(1-m,4)}return{mount:w,destroy:H,scroll:S,cancel:R}}var $n={passive:!1,capture:!0};function Fl(e,t,n){var i=Qe(e),o=i.on,s=i.emit,l=i.bind,d=i.unbind,a=e.state,u=t.Move,p=t.Scroll,T=t.Controller,x=t.Elements.track,y=t.Media.reduce,g=t.Direction,h=g.resolve,w=g.orient,S=u.getPosition,b=u.exceededLimit,$,H,R,B,m,C=!1,N,v,E;function k(){l(x,to,fo,$n),l(x,no,fo,$n),l(x,Oa,U,$n),l(x,"click",P,{capture:!0}),l(x,"dragstart",zt),o([rn,pt],O)}function O(){var G=n.drag;me(!G),B=G==="free"}function U(G){if(N=!1,!v){var J=fe(G);ie(G.target)&&(J||!G.button)&&(T.isBusy()?zt(G,!0):(E=J?x:window,m=a.is([Fn,ti]),R=null,l(E,to,Z,$n),l(E,no,W,$n),u.cancel(),p.cancel(),I(G)))}}function Z(G){if(a.is(Ci)||(a.set(Ci),s(ya)),G.cancelable)if(m){u.translate($+ge(M(G)));var J=ne(G)>yr,ce=C!==(C=b());(J||ce)&&I(G),N=!0,s(va),zt(G)}else j(G)&&(m=_(G),zt(G))}function W(G){a.is(Ci)&&(a.set(In),s(ba)),m&&(F(G),zt(G)),d(E,to,Z),d(E,no,W),m=!1}function P(G){!v&&N&&zt(G,!0)}function I(G){R=H,H=G,$=S()}function F(G){var J=K(G),ce=te(J),pe=n.rewind&&n.rewindByDrag;y(!1),B?T.scroll(ce,0,n.snap):e.is(li)?T.go(w(vo(J))<0?pe?"<":"-":pe?">":"+"):e.is(Pn)&&C&&pe?T.go(b(!0)?">":"<"):T.go(T.toDest(ce),!0),y(!0)}function _(G){var J=n.dragMinThreshold,ce=Dn(J),pe=ce&&J.mouse||0,Ce=(ce?J.touch:+J)||10;return vt(M(G))>(fe(G)?Ce:pe)}function j(G){return vt(M(G))>vt(M(G,!0))}function K(G){if(e.is(Nn)||!C){var J=ne(G);if(J&&J<yr)return M(G)/J}return 0}function te(G){return S()+vo(G)*tn(vt(G)*(n.flickPower||600),B?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function M(G,J){return ee(G,J)-ee(f(G),J)}function ne(G){return yo(G)-yo(f(G))}function f(G){return H===G&&R||H}function ee(G,J){return(fe(G)?G.changedTouches[0]:G)["page"+h(J?"Y":"X")]}function ge(G){return G/(C&&e.is(Pn)?gl:1)}function ie(G){var J=n.noDrag;return!Vn(G,"."+ka+", ."+Ui)&&(!J||!Vn(G,J))}function fe(G){return typeof TouchEvent<"u"&&G instanceof TouchEvent}function Q(){return m}function me(G){v=G}return{mount:k,disable:me,isDragging:Q}}var Wl={Spacebar:" ",Right:Di,Left:zi,Up:Ea,Down:Ia};function Go(e){return e=en(e)?e:e.key,Wl[e]||e}var vr="keydown";function Nl(e,t,n){var i=Qe(e),o=i.on,s=i.bind,l=i.unbind,d=e.root,a=t.Direction.resolve,u,p;function T(){x(),o(pt,y),o(pt,x),o(Xt,h)}function x(){var S=n.keyboard;S&&(u=S==="global"?window:d,s(u,vr,w))}function y(){l(u,vr)}function g(S){p=S}function h(){var S=p;p=!0,oa(function(){p=S})}function w(S){if(!p){var b=Go(S);b===a(zi)?e.go("<"):b===a(Di)&&e.go(">")}}return{mount:T,destroy:y,disable:g}}var Bn=Mo+"-lazy",Ti=Bn+"-srcset",Hl="["+Bn+"], ["+Ti+"]";function Ol(e,t,n){var i=Qe(e),o=i.on,s=i.off,l=i.bind,d=i.emit,a=n.lazyLoad==="sequential",u=[Wn,fn],p=[];function T(){n.lazyLoad&&(x(),o(nt,x))}function x(){qt(p),y(),a?S():(s(u),o(u,g),g())}function y(){t.Slides.forEach(function(b){Ao(b.slide,Hl).forEach(function($){var H=At($,Bn),R=At($,Ti);if(H!==$.src||R!==$.srcset){var B=n.classes.spinner,m=$.parentElement,C=ri(m,"."+B)||Ln("span",B,m);p.push([$,b,C]),$.src||Kn($,"none")}})})}function g(){p=p.filter(function(b){var $=n.perPage*((n.preloadPages||1)+1)-1;return b[1].isWithin(e.index,$)?h(b):!0}),p.length||s(u)}function h(b){var $=b[0];Nt(b[1].slide,Co),l($,"load error",Ye(w,b)),Me($,"src",At($,Bn)),Me($,"srcset",At($,Ti)),Ht($,Bn),Ht($,Ti)}function w(b,$){var H=b[0],R=b[1];Vt(R.slide,Co),$.type!=="error"&&(gn(b[2]),Kn(H,""),d(Bo,H,R),d(Rn)),a&&S()}function S(){p.length&&h(p.shift())}return{mount:T,destroy:Ye(qt,p),check:g}}function Bl(e,t,n){var i=Qe(e),o=i.on,s=i.emit,l=i.bind,d=t.Slides,a=t.Elements,u=t.Controller,p=u.hasFocus,T=u.getIndex,x=u.go,y=t.Direction.resolve,g=a.pagination,h=[],w,S;function b(){$(),o([pt,nt,ki],b);var v=n.pagination;g&&Kn(g,v?"":"none"),v&&(o([Xt,Oi,fn],N),H(),N(),s(Ca,{list:w,items:h},C(e.index)))}function $(){w&&(gn(g?on(w.children):w),Vt(w,S),qt(h),w=null),i.destroy()}function H(){var v=e.length,E=n.classes,k=n.i18n,O=n.perPage,U=p()?u.getEnd()+1:qn(v/O);w=g||Ln("ul",E.pagination,a.track.parentElement),Nt(w,S=Ki+"--"+m()),Me(w,Gt,"tablist"),Me(w,It,k.select),Me(w,zo,m()===Vi?"vertical":"");for(var Z=0;Z<U;Z++){var W=Ln("li",null,w),P=Ln("button",{class:E.page,type:"button"},W),I=d.getIn(Z).map(function(_){return _.slide.id}),F=!p()&&O>1?k.pageX:k.slideX;l(P,"click",Ye(R,Z)),n.paginationKeyboard&&l(P,"keydown",Ye(B,Z)),Me(W,Gt,"presentation"),Me(P,Gt,"tab"),Me(P,si,I.join(" ")),Me(P,It,bo(F,Z+1)),Me(P,En,-1),h.push({li:W,button:P,page:Z})}}function R(v){x(">"+v,!0)}function B(v,E){var k=h.length,O=Go(E),U=m(),Z=-1;O===y(Di,!1,U)?Z=++v%k:O===y(zi,!1,U)?Z=(--v+k)%k:O==="Home"?Z=0:O==="End"&&(Z=k-1);var W=h[Z];W&&(la(W.button),x(">"+Z),zt(E,!0))}function m(){return n.paginationDirection||n.direction}function C(v){return h[u.toPage(v)]}function N(){var v=C(T(!0)),E=C(T());if(v){var k=v.button;Vt(k,hn),Ht(k,pr),Me(k,En,-1)}if(E){var O=E.button;Nt(O,hn),Me(O,pr,!0),Me(O,En,"")}s($a,{list:w,items:h},v,E)}return{items:h,mount:b,destroy:$,getAt:C,update:N}}var jl=[" ","Enter"];function zl(e,t,n){var i=n.isNavigation,o=n.slideFocus,s=[];function l(){e.splides.forEach(function(g){g.isParent||(u(e,g.splide),u(g.splide,e))}),i&&p()}function d(){s.forEach(function(g){g.destroy()}),qt(s)}function a(){d(),l()}function u(g,h){var w=Qe(g);w.on(Xt,function(S,b,$){h.go(h.is(Nn)?$:S)}),s.push(w)}function p(){var g=Qe(e),h=g.on;h(Fo,x),h(Ta,y),h([rn,pt],T),s.push(g),g.emit(No,e.splides)}function T(){Me(t.Elements.list,zo,n.direction===Vi?"vertical":"")}function x(g){e.go(g.index)}function y(g,h){Po(jl,Go(h))&&(x(g),zt(h))}return{setup:Ye(t.Media.set,{slideFocus:ni(o)?i:o},!0),mount:l,destroy:d,remount:a}}function Dl(e,t,n){var i=Qe(e),o=i.bind,s=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,$n)}function d(u){if(u.cancelable){var p=u.deltaY,T=p<0,x=yo(u),y=n.wheelMinThreshold||0,g=n.wheelSleep||0;vt(p)>y&&x-s>g&&(e.go(T?"<":">"),s=x),a(T)&&zt(u)}}function a(u){return!n.releaseWheel||e.state.is(Fn)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var Vl=90;function Gl(e,t,n){var i=Qe(e),o=i.on,s=t.Elements.track,l=n.live&&!n.isNavigation,d=Ln("span",cl),a=Bi(Vl,Ye(p,!1));function u(){l&&(x(!t.Autoplay.isPaused()),Me(s,hr,!0),d.textContent="…",o(Ho,Ye(x,!0)),o(Oo,Ye(x,!1)),o([Wn,fn],Ye(p,!0)))}function p(y){Me(s,gr,y),y?(oi(s,d),a.start()):(gn(d),a.cancel())}function T(){Ht(s,[mr,hr,gr]),gn(d)}function x(y){l&&Me(s,mr,y?"off":"polite")}return{mount:u,disable:x,destroy:T}}var Ul=Object.freeze({__proto__:null,Media:el,Direction:tl,Elements:hl,Slides:yl,Layout:vl,Clones:xl,Move:Sl,Controller:Cl,Arrows:Tl,Autoplay:El,Cover:Il,Scroll:kl,Drag:Fl,Keyboard:Nl,LazyLoad:Ol,Pagination:Bl,Sync:zl,Wheel:Dl,Live:Gl}),Kl={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"},ql={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:pl,i18n:Kl,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Xl(e,t,n){var i=t.Slides;function o(){Qe(e).on([rn,nt],s)}function s(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function l(d,a){i.style("transition","opacity "+n.speed+"ms "+n.easing),oa(a)}return{mount:o,start:l,cancel:fo}}function Yl(e,t,n){var i=t.Move,o=t.Controller,s=t.Scroll,l=t.Elements.list,d=Ye(_t,l,"transition"),a;function u(){Qe(e).bind(l,"transitionend",function(y){y.target===l&&a&&(T(),a())})}function p(y,g){var h=i.toPosition(y,!0),w=i.getPosition(),S=x(y);vt(h-w)>=1&&S>=1?n.useScroll?s.scroll(h,S,!1,g):(d("transform "+S+"ms "+n.easing),i.translate(h,!0),a=g):(i.jump(y),g())}function T(){d(""),s.cancel()}function x(y){var g=n.rewindSpeed;if(e.is(Pn)&&g){var h=o.getIndex(!0),w=o.getEnd();if(h===0&&y>=w||h>=w&&y===0)return g}return n.speed}return{mount:u,start:p,cancel:T}}var Jl=(function(){function e(n,i){this.event=Qe(),this.Components={},this.state=Zs(Tn),this.splides=[],this._o={},this._E={};var o=en(n)?da(document,n):n;On(o,o+" is invalid."),this.root=o,i=Qt({label:At(o,It)||"",labelledby:At(o,jo)||""},ql,e.defaults,i||{});try{Qt(i,JSON.parse(At(o,Mo)))}catch{On(!1,"Invalid JSON")}this._o=Object.create(Qt({},i))}var t=e.prototype;return t.mount=function(i,o){var s=this,l=this.state,d=this.Components;On(l.is([Tn,_i]),"Already mounted!"),l.set(Tn),this._C=d,this._T=o||this._T||(this.is(li)?Xl:Yl),this._E=i||this._E;var a=Un({},Ul,this._E,{Transition:this._T});return mn(a,function(u,p){var T=u(s,d,s._o);d[p]=T,T.setup&&T.setup()}),mn(d,function(u){u.mount&&u.mount()}),this.emit(rn),Nt(this.root,dl),l.set(In),this.emit(xo),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(In)&&(this._C.Sync.remount(),i.Components.Sync.remount()),this},t.go=function(i){return this._C.Controller.go(i),this},t.on=function(i,o){return this.event.on(i,o),this},t.off=function(i){return this.event.off(i),this},t.emit=function(i){var o;return(o=this.event).emit.apply(o,[i].concat(on(arguments,1))),this},t.add=function(i,o){return this._C.Slides.add(i,o),this},t.remove=function(i){return this._C.Slides.remove(i),this},t.is=function(i){return this._o.type===i},t.refresh=function(){return this.emit(nt),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,s=this.state;return s.is(Tn)?Qe(this).on(xo,this.destroy.bind(this,i)):(mn(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(Wo),o.destroy(),i&&qt(this.splides),s.set(_i)),this},Ks(e,[{key:"options",get:function(){return this._o},set:function(i){this._C.Media.set(i,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),Uo=Jl;Uo.defaults={};Uo.STATES=Xs;var br=[[rn,"onMounted"],[xo,"onReady"],[Xt,"onMove"],[Wn,"onMoved"],[Fo,"onClick"],[ma,"onActive"],[ga,"onInactive"],[ha,"onVisible"],[fa,"onHidden"],[nt,"onRefresh"],[pt,"onUpdated"],[Rn,"onResize"],[Hi,"onResized"],[ya,"onDrag"],[va,"onDragging"],[ba,"onDragged"],[Oi,"onScroll"],[fn,"onScrolled"],[Wo,"onDestroy"],[xa,"onArrowsMounted"],[Sa,"onArrowsUpdated"],[Ca,"onPaginationMounted"],[$a,"onPaginationUpdated"],[No,"onNavigationMounted"],[Ho,"onAutoplayPlay"],[wa,"onAutoplayPlaying"],[Oo,"onAutoplayPause"],[Bo,"onLazyLoadLoaded"]];function Ko(...e){return e.filter(Boolean).join(" ")}function Fi(e){return e!==null&&typeof e=="object"}function $o(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!$o(n,t[i]));if(Fi(e)&&Fi(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!$o(e[o],t[o]))}return e===t}function Zl(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function Ql(e,t){if(e){const n=Object.keys(e);for(let i=0;i<n.length;i++){const o=n[i];if(o!=="__proto__"&&t(e[o],o)===!1)break}}return e}function wo(e,t){const n=e;return Ql(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Fi(i)?n[o]=wo(Fi(n[o])?n[o]:{},i):n[o]=i}),n}var ec=({children:e,className:t,...n})=>c.createElement("div",{className:Ko("splide__track",t),...n},c.createElement("ul",{className:"splide__list"},e)),qo=class extends c.Component{constructor(){super(...arguments),this.splideRef=c.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new Uo(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=wo({},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&&!$o(this.options,e)&&(this.splide.options=e,this.options=wo({},e));const t=this.getSlides();Zl(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){br.forEach(([t,n])=>{const i=this.props[n];typeof i=="function"&&e.on(t,(...o)=>{i(e,...o)})})}omit(e,t){return t.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}),e}render(){const{className:e,tag:t="div",hasTrack:n=!0,children:i,...o}=this.props;return c.createElement(t,{className:Ko("splide",e),ref:this.splideRef,...this.omit(o,["options",...br.map(s=>s[1])])},n?c.createElement(ec,null,i):i)}},Xo=({children:e,className:t,...n})=>c.createElement("li",{className:Ko("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),c=require("react"),Ve=require("classnames"),E=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),ei=require("react-dom");function nl(e){return e.type==="object"&&e.version===1}const il="ControlSlider-module__wrapper___sHEkd",ol="ControlSlider-module__hoverArrow___A-dOH",rl="ControlSlider-module__sliderItem___QQSkR",al="ControlSlider-module__sliderImage___9hRl-",ll="ControlSlider-module__arrow___05ghY",sl="ControlSlider-module__arrowVertical___tBfVN",cl="ControlSlider-module__nextArrow___-30Yc",dl="ControlSlider-module__arrowInner___aEra3",ul="ControlSlider-module__arrowIcon___S4ztF",pl="ControlSlider-module__arrowImg___2dwJW",ml="ControlSlider-module__mirror___brd6U",gl="ControlSlider-module__pagination___bicLF",hl="ControlSlider-module__paginationInner___bT-P-",fl="ControlSlider-module__paginationVertical___zYqKw",yl="ControlSlider-module__paginationItem___nTRbk",vl="ControlSlider-module__dot___p1Qun",bl="ControlSlider-module__activeDot___LHFaj",xl="ControlSlider-module__paginationInsideBottom___R3FWn",Sl="ControlSlider-module__paginationInsideTop___V-qb-",Cl="ControlSlider-module__paginationOutsideBottom___14w8D",$l="ControlSlider-module__paginationOutsideTop___SCLqB",wl="ControlSlider-module__paginationInsideLeft___yOBRZ",Tl="ControlSlider-module__paginationInsideRight___Rtt3o",Ll="ControlSlider-module__paginationOutsideLeft___lahaw",El="ControlSlider-module__paginationOutsideRight___EtuQa",Il="ControlSlider-module__imgWrapper___UjEgB",Rl="ControlSlider-module__captionBlock___dJ6-j",Pl="ControlSlider-module__captionTextWrapper___HFlpf",_l="ControlSlider-module__captionText___uGBVc",Al="ControlSlider-module__active___WZK4G",Ml="ControlSlider-module__withPointerEvents___t-18M",kl="ControlSlider-module__topLeftAlignment___zjnGM",Fl="ControlSlider-module__topCenterAlignment___gD1xW",Wl="ControlSlider-module__topRightAlignment___NMapS",Nl="ControlSlider-module__middleLeftAlignment___OnUrY",Hl="ControlSlider-module__middleCenterAlignment___Tdkl0",Bl="ControlSlider-module__middleRightAlignment___wEbfX",Ol="ControlSlider-module__bottomLeftAlignment___cTP2-",jl="ControlSlider-module__bottomCenterAlignment___c54fB",Dl="ControlSlider-module__bottomRightAlignment___kEwrz",zl="ControlSlider-module__clickOverlay___DZA28",Vl="ControlSlider-module__contain___pLyq7",Gl="ControlSlider-module__cover___KdDat",ve={wrapper:il,hoverArrow:ol,sliderItem:rl,sliderImage:al,arrow:ll,arrowVertical:sl,nextArrow:cl,arrowInner:dl,arrowIcon:ul,arrowImg:pl,mirror:ml,pagination:gl,paginationInner:hl,paginationVertical:fl,paginationItem:yl,dot:vl,activeDot:bl,paginationInsideBottom:xl,paginationInsideTop:Sl,paginationOutsideBottom:Cl,paginationOutsideTop:$l,paginationInsideLeft:wl,paginationInsideRight:Tl,paginationOutsideLeft:Ll,paginationOutsideRight:El,imgWrapper:Il,captionBlock:Rl,captionTextWrapper:Pl,captionText:_l,active:Al,withPointerEvents:Ml,topLeftAlignment:kl,topCenterAlignment:Fl,topRightAlignment:Wl,middleLeftAlignment:Nl,middleCenterAlignment:Hl,middleRightAlignment:Bl,bottomLeftAlignment:Ol,bottomCenterAlignment:jl,bottomRightAlignment:Dl,clickOverlay:zl,contain:Vl,cover:Gl};function Ul(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Kl(e,t,n){return t&&Ul(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var ar="(prefers-reduced-motion: reduce)",Tn=1,ql=2,In=3,Fn=4,ti=5,Ci=6,_i=7,Xl={CREATED:Tn,MOUNTED:ql,IDLE:In,MOVING:Fn,SCROLLING:ti,DRAGGING:Ci,DESTROYED:_i};function Yt(e){e.length=0}function rn(e,t,n){return Array.prototype.slice.call(e,t,n)}function Ye(e){return e.bind.apply(e,[null].concat(rn(arguments,1)))}var oa=setTimeout,fo=function(){};function lr(e){return requestAnimationFrame(e)}function Ni(e,t){return typeof t===e}function zn(e){return!Ro(e)&&Ni("object",e)}var Io=Array.isArray,ra=Ye(Ni,"function"),tn=Ye(Ni,"string"),ni=Ye(Ni,"undefined");function Ro(e){return e===null}function aa(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function ii(e){return Io(e)?e:[e]}function Pt(e,t){ii(e).forEach(t)}function Po(e,t){return e.indexOf(t)>-1}function $i(e,t){return e.push.apply(e,ii(t)),e}function Gt(e,t,n){e&&Pt(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Ht(e,t){Gt(e,tn(t)?t.split(" "):t,!0)}function oi(e,t){Pt(t,e.appendChild.bind(e))}function _o(e,t){Pt(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function Vn(e,t){return aa(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function la(e,t){var n=e?rn(e.children):[];return t?n.filter(function(i){return Vn(i,t)}):n}function ri(e,t){return t?la(e,t)[0]:e.firstElementChild}var Gn=Object.keys;function mn(e,t,n){return e&&(n?Gn(e).reverse():Gn(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function Un(e){return rn(arguments,1).forEach(function(t){mn(t,function(n,i){e[i]=t[i]})}),e}function en(e){return rn(arguments,1).forEach(function(t){mn(t,function(n,i){Io(n)?e[i]=n.slice():zn(n)?e[i]=en({},zn(e[i])?e[i]:{},n):e[i]=n})}),e}function sr(e,t){Pt(t||Gn(e),function(n){delete e[n]})}function Bt(e,t){Pt(e,function(n){Pt(t,function(i){n&&n.removeAttribute(i)})})}function Me(e,t,n){zn(t)?mn(t,function(i,o){Me(e,o,i)}):Pt(e,function(i){Ro(n)||n===""?Bt(i,t):i.setAttribute(t,String(n))})}function Ln(e,t,n){var i=document.createElement(e);return t&&(tn(t)?Ht(i,t):Me(i,t)),n&&oi(n,i),i}function _t(e,t,n){if(ni(n))return getComputedStyle(e)[t];Ro(n)||(e.style[t]=""+n)}function Kn(e,t){_t(e,"display",t)}function sa(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function At(e,t){return e.getAttribute(t)}function cr(e,t){return e&&e.classList.contains(t)}function Et(e){return e.getBoundingClientRect()}function gn(e){Pt(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function ca(e){return ri(new DOMParser().parseFromString(e,"text/html").body)}function Vt(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function da(e,t){return e&&e.querySelector(t)}function Ao(e,t){return t?rn(e.querySelectorAll(t)):[]}function Ut(e,t){Gt(e,t,!1)}function yo(e){return e.timeStamp}function sn(e){return tn(e)?e:e?e+"px":""}var ai="splide",Mo="data-"+ai;function Bn(e,t){if(!e)throw new Error("["+ai+"] "+(t||""))}var nn=Math.min,Ai=Math.max,Mi=Math.floor,qn=Math.ceil,Ct=Math.abs;function ua(e,t,n){return Ct(e-t)<n}function wi(e,t,n,i){var o=nn(t,n),l=Ai(t,n);return i?o<e&&e<l:o<=e&&e<=l}function Cn(e,t,n){var i=nn(t,n),o=Ai(t,n);return nn(Ai(i,e),o)}function vo(e){return+(e>0)-+(e<0)}function bo(e,t){return Pt(t,function(n){e=e.replace("%s",""+n)}),e}function ko(e){return e<10?"0"+e:""+e}var dr={};function Yl(e){return""+e+ko(dr[e]=(dr[e]||0)+1)}function pa(){var e=[];function t(s,d,a,p){o(s,d,function(u,L,C){var y="addEventListener"in u,g=y?u.removeEventListener.bind(u,L,a,p):u.removeListener.bind(u,a);y?u.addEventListener(L,a,p):u.addListener(a),e.push([u,L,C,a,g])})}function n(s,d,a){o(s,d,function(p,u,L){e=e.filter(function(C){return C[0]===p&&C[1]===u&&C[2]===L&&(!a||C[3]===a)?(C[4](),!1):!0})})}function i(s,d,a){var p,u=!0;return typeof CustomEvent=="function"?p=new CustomEvent(d,{bubbles:u,detail:a}):(p=document.createEvent("CustomEvent"),p.initCustomEvent(d,u,!1,a)),s.dispatchEvent(p),p}function o(s,d,a){Pt(s,function(p){p&&Pt(d,function(u){u.split(" ").forEach(function(L){var C=L.split(".");a(p,C[0],C[1])})})})}function l(){e.forEach(function(s){s[4]()}),Yt(e)}return{bind:t,unbind:n,dispatch:i,destroy:l}}var an="mounted",xo="ready",Jt="move",Wn="moved",Fo="click",ma="active",ga="inactive",ha="visible",fa="hidden",ot="refresh",yt="updated",Rn="resize",Hi="resized",ya="drag",va="dragging",ba="dragged",Bi="scroll",fn="scrolled",Jl="overflow",Wo="destroy",xa="arrows:mounted",Sa="arrows:updated",Ca="pagination:mounted",$a="pagination:updated",No="navigation:mounted",Ho="autoplay:play",wa="autoplay:playing",Bo="autoplay:pause",Oo="lazyload:loaded",Ta="sk",La="sh",ki="ei";function et(e){var t=e?e.event.bus:document.createDocumentFragment(),n=pa();function i(l,s){n.bind(t,ii(l).join(" "),function(d){s.apply(s,Io(d.detail)?d.detail:[])})}function o(l){n.dispatch(t,l,rn(arguments,1))}return e&&e.event.on(Wo,n.destroy),Un(n,{bus:t,on:i,off:Ye(n.unbind,t),emit:o})}function Oi(e,t,n,i){var o=Date.now,l,s=0,d,a=!0,p=0;function u(){if(!a){if(s=e?nn((o()-l)/e,1):1,n&&n(s),s>=1&&(t(),l=o(),i&&++p>=i))return C();d=lr(u)}}function L($){$||g(),l=o()-($?s*e:0),a=!1,d=lr(u)}function C(){a=!0}function y(){l=o(),s=0,n&&n(s)}function g(){d&&cancelAnimationFrame(d),s=0,d=0,a=!0}function h($){e=$}function T(){return a}return{start:L,rewind:y,pause:C,cancel:g,set:h,isPaused:T}}function Zl(e){var t=e;function n(o){t=o}function i(o){return Po(ii(o),t)}return{set:n,is:i}}function Ql(e,t){var n=Oi(0,e,null,1);return function(){n.isPaused()&&n.start()}}function es(e,t,n){var i=e.state,o=n.breakpoints||{},l=n.reducedMotion||{},s=pa(),d=[];function a(){var g=n.mediaQuery==="min";Gn(o).sort(function(h,T){return g?+h-+T:+T-+h}).forEach(function(h){u(o[h],"("+(g?"min":"max")+"-width:"+h+"px)")}),u(l,ar),L()}function p(g){g&&s.destroy()}function u(g,h){var T=matchMedia(h);s.bind(T,"change",L),d.push([g,T])}function L(){var g=i.is(_i),h=n.direction,T=d.reduce(function($,x){return en($,x[1].matches?x[0]:{})},{});sr(n),y(T),n.destroy?e.destroy(n.destroy==="completely"):g?(p(!0),e.mount()):h!==n.direction&&e.refresh()}function C(g){matchMedia(ar).matches&&(g?en(n,l):sr(n,Gn(l)))}function y(g,h,T){en(n,g),h&&en(Object.getPrototypeOf(n),g),(T||!i.is(Tn))&&e.emit(yt,n)}return{setup:a,destroy:p,reduce:C,set:y}}var ji="Arrow",Di=ji+"Left",zi=ji+"Right",Ea=ji+"Up",Ia=ji+"Down",ur="rtl",Vi="ttb",Qi={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Ea,zi],ArrowRight:[Ia,Di]};function ts(e,t,n){function i(l,s,d){d=d||n.direction;var a=d===ur&&!s?1:d===Vi?0:-1;return Qi[l]&&Qi[l][a]||l.replace(/width|left|right/i,function(p,u){var L=Qi[p.toLowerCase()][a]||p;return u>0?L.charAt(0).toUpperCase()+L.slice(1):L})}function o(l){return l*(n.direction===ur?1:-1)}return{resolve:i,orient:o}}var Kt="role",En="tabindex",ns="disabled",Mt="aria-",li=Mt+"controls",Ra=Mt+"current",pr=Mt+"selected",It=Mt+"label",jo=Mt+"labelledby",Pa=Mt+"hidden",Do=Mt+"orientation",Xn=Mt+"roledescription",mr=Mt+"live",gr=Mt+"busy",hr=Mt+"atomic",zo=[Kt,En,ns,li,Ra,It,jo,Pa,Do,Xn],Ot=ai+"__",ln="is-",eo=ai,fr=Ot+"track",is=Ot+"list",Gi=Ot+"slide",_a=Gi+"--clone",os=Gi+"__container",Vo=Ot+"arrows",Ui=Ot+"arrow",Aa=Ui+"--prev",Ma=Ui+"--next",Ki=Ot+"pagination",ka=Ki+"__page",rs=Ot+"progress",as=rs+"__bar",ls=Ot+"toggle",ss=Ot+"spinner",cs=Ot+"sr",ds=ln+"initialized",hn=ln+"active",Fa=ln+"prev",Wa=ln+"next",So=ln+"visible",Co=ln+"loading",Na=ln+"focus-in",Ha=ln+"overflow",us=[hn,So,Fa,Wa,Co,Na,Ha],ps={slide:Gi,clone:_a,arrows:Vo,arrow:Ui,prev:Aa,next:Ma,pagination:Ki,page:ka,spinner:ss};function ms(e,t){if(ra(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!Vn(n,t);)n=n.parentElement;return n}var gs=5,yr=200,Ba="touchstart mousedown",to="touchmove mousemove",no="touchend touchcancel mouseup click";function hs(e,t,n){var i=et(e),o=i.on,l=i.bind,s=e.root,d=n.i18n,a={},p=[],u=[],L=[],C,y,g;function h(){S(),H(),x()}function T(){o(ot,$),o(ot,h),o(yt,x),l(document,Ba+" keydown",function(w){g=w.type==="keydown"},{capture:!0}),l(s,"focusin",function(){Gt(s,Na,!!g)})}function $(w){var I=zo.concat("style");Yt(p),Ut(s,u),Ut(C,L),Bt([C,y],I),Bt(s,w?I:["style",Xn])}function x(){Ut(s,u),Ut(C,L),u=B(eo),L=B(fr),Ht(s,u),Ht(C,L),Me(s,It,n.label),Me(s,jo,n.labelledby)}function S(){C=R("."+fr),y=ri(C,"."+is),Bn(C&&y,"A track/list element is missing."),$i(p,la(y,"."+Gi+":not(."+_a+")")),mn({arrows:Vo,pagination:Ki,prev:Aa,next:Ma,bar:as,toggle:ls},function(w,I){a[I]=R("."+w)}),Un(a,{root:s,track:C,list:y,slides:p})}function H(){var w=s.id||Yl(ai),I=n.role;s.id=w,C.id=C.id||w+"-track",y.id=y.id||w+"-list",!At(s,Kt)&&s.tagName!=="SECTION"&&I&&Me(s,Kt,I),Me(s,Xn,d.carousel),Me(y,Kt,"presentation")}function R(w){var I=da(s,w);return I&&ms(I,"."+eo)===s?I:void 0}function B(w){return[w+"--"+n.type,w+"--"+n.direction,n.drag&&w+"--draggable",n.isNavigation&&w+"--nav",w===eo&&hn]}return Un(a,{setup:h,mount:T,destroy:$})}var Pn="slide",Nn="loop",si="fade";function fs(e,t,n,i){var o=et(e),l=o.on,s=o.emit,d=o.bind,a=e.Components,p=e.root,u=e.options,L=u.isNavigation,C=u.updateOnMove,y=u.i18n,g=u.pagination,h=u.slideFocus,T=a.Direction.resolve,$=At(i,"style"),x=At(i,It),S=n>-1,H=ri(i,"."+os),R;function B(){S||(i.id=p.id+"-slide"+ko(t+1),Me(i,Kt,g?"tabpanel":"group"),Me(i,Xn,y.slide),Me(i,It,x||bo(y.slideLabel,[t+1,e.length]))),w()}function w(){d(i,"click",Ye(s,Fo,v)),d(i,"keydown",Ye(s,Ta,v)),l([Wn,La,fn],b),l(No,O),C&&l(Jt,m)}function I(){R=!0,o.destroy(),Ut(i,us),Bt(i,zo),Me(i,"style",$),Me(i,It,x||"")}function O(){var _=e.splides.map(function(A){var j=A.splide.Components.Slides.getAt(t);return j?j.slide.id:""}).join(" ");Me(i,It,bo(y.slideX,(S?n:t)+1)),Me(i,li,_),Me(i,Kt,h?"button":""),h&&Bt(i,Xn)}function m(){R||b()}function b(){if(!R){var _=e.index;P(),F(),Gt(i,Fa,t===_-1),Gt(i,Wa,t===_+1)}}function P(){var _=J();_!==cr(i,hn)&&(Gt(i,hn,_),Me(i,Ra,L&&_||""),s(_?ma:ga,v))}function F(){var _=W(),A=!_&&(!J()||S);if(e.state.is([Fn,ti])||Me(i,Pa,A||""),Me(Ao(i,u.focusableNodes||""),En,A?-1:""),h&&Me(i,En,A?-1:0),_!==cr(i,So)&&(Gt(i,So,_),s(_?ha:fa,v)),!_&&document.activeElement===i){var j=a.Slides.getAt(e.index);j&&sa(j.slide)}}function U(_,A,j){_t(j&&H||i,_,A)}function J(){var _=e.index;return _===t||u.cloneStatus&&_===n}function W(){if(e.is(si))return J();var _=Et(a.Elements.track),A=Et(i),j=T("left",!0),z=T("right",!0);return Mi(_[j])<=qn(A[j])&&Mi(A[z])<=qn(_[z])}function N(_,A){var j=Ct(_-t);return!S&&(u.rewind||e.is(Nn))&&(j=nn(j,e.length-j)),j<=A}var v={index:t,slideIndex:n,slide:i,container:H,isClone:S,mount:B,destroy:I,update:b,style:U,isWithin:N};return v}function ys(e,t,n){var i=et(e),o=i.on,l=i.emit,s=i.bind,d=t.Elements,a=d.slides,p=d.list,u=[];function L(){C(),o(ot,y),o(ot,C)}function C(){a.forEach(function(b,P){h(b,P,-1)})}function y(){R(function(b){b.destroy()}),Yt(u)}function g(){R(function(b){b.update()})}function h(b,P,F){var U=fs(e,P,F,b);U.mount(),u.push(U),u.sort(function(J,W){return J.index-W.index})}function T(b){return b?B(function(P){return!P.isClone}):u}function $(b){var P=t.Controller,F=P.toIndex(b),U=P.hasFocus()?1:n.perPage;return B(function(J){return wi(J.index,F,F+U-1)})}function x(b){return B(b)[0]}function S(b,P){Pt(b,function(F){if(tn(F)&&(F=ca(F)),aa(F)){var U=a[P];U?_o(F,U):oi(p,F),Ht(F,n.classes.slide),I(F,Ye(l,Rn))}}),l(ot)}function H(b){gn(B(b).map(function(P){return P.slide})),l(ot)}function R(b,P){T(P).forEach(b)}function B(b){return u.filter(ra(b)?b:function(P){return tn(b)?Vn(P.slide,b):Po(ii(b),P.index)})}function w(b,P,F){R(function(U){U.style(b,P,F)})}function I(b,P){var F=Ao(b,"img"),U=F.length;U?F.forEach(function(J){s(J,"load error",function(){--U||P()})}):P()}function O(b){return b?a.length:u.length}function m(){return u.length>n.perPage}return{mount:L,destroy:y,update:g,register:h,get:T,getIn:$,getAt:x,add:S,remove:H,forEach:R,filter:B,style:w,getLength:O,isEnough:m}}function vs(e,t,n){var i=et(e),o=i.on,l=i.bind,s=i.emit,d=t.Slides,a=t.Direction.resolve,p=t.Elements,u=p.root,L=p.track,C=p.list,y=d.getAt,g=d.style,h,T,$;function x(){S(),l(window,"resize load",Ql(Ye(s,Rn))),o([yt,ot],S),o(Rn,H)}function S(){h=n.direction===Vi,_t(u,"maxWidth",sn(n.width)),_t(L,a("paddingLeft"),R(!1)),_t(L,a("paddingRight"),R(!0)),H(!0)}function H(v){var _=Et(u);(v||T.width!==_.width||T.height!==_.height)&&(_t(L,"height",B()),g(a("marginRight"),sn(n.gap)),g("width",I()),g("height",O(),!0),T=_,s(Hi),$!==($=N())&&(Gt(u,Ha,$),s(Jl,$)))}function R(v){var _=n.padding,A=a(v?"right":"left");return _&&sn(_[A]||(zn(_)?0:_))||"0px"}function B(){var v="";return h&&(v=w(),Bn(v,"height or heightRatio is missing."),v="calc("+v+" - "+R(!1)+" - "+R(!0)+")"),v}function w(){return sn(n.height||Et(C).width*n.heightRatio)}function I(){return n.autoWidth?null:sn(n.fixedWidth)||(h?"":m())}function O(){return sn(n.fixedHeight)||(h?n.autoHeight?null:m():w())}function m(){var v=sn(n.gap);return"calc((100%"+(v&&" + "+v)+")/"+(n.perPage||1)+(v&&" - "+v)+")"}function b(){return Et(C)[a("width")]}function P(v,_){var A=y(v||0);return A?Et(A.slide)[a("width")]+(_?0:J()):0}function F(v,_){var A=y(v);if(A){var j=Et(A.slide)[a("right")],z=Et(C)[a("left")];return Ct(j-z)+(_?0:J())}return 0}function U(v){return F(e.length-1)-F(0)+P(0,v)}function J(){var v=y(0);return v&&parseFloat(_t(v.slide,a("marginRight")))||0}function W(v){return parseFloat(_t(L,a("padding"+(v?"Right":"Left"))))||0}function N(){return e.is(si)||U(!0)>b()}return{mount:x,resize:H,listSize:b,slideSize:P,sliderSize:U,totalSize:F,getPadding:W,isOverflow:N}}var bs=2;function xs(e,t,n){var i=et(e),o=i.on,l=t.Elements,s=t.Slides,d=t.Direction.resolve,a=[],p;function u(){o(ot,L),o([yt,Rn],y),(p=T())&&(g(p),t.Layout.resize(!0))}function L(){C(),u()}function C(){gn(a),Yt(a),i.destroy()}function y(){var $=T();p!==$&&(p<$||!$)&&i.emit(ot)}function g($){var x=s.get().slice(),S=x.length;if(S){for(;x.length<$;)$i(x,x);$i(x.slice(-$),x.slice(0,$)).forEach(function(H,R){var B=R<$,w=h(H.slide,R);B?_o(w,x[0].slide):oi(l.list,w),$i(a,w),s.register(w,R-$+(B?0:S),H.index)})}}function h($,x){var S=$.cloneNode(!0);return Ht(S,n.classes.clone),S.id=e.root.id+"-clone"+ko(x+1),S}function T(){var $=n.clones;if(!e.is(Nn))$=0;else if(ni($)){var x=n[d("fixedWidth")]&&t.Layout.slideSize(0),S=x&&qn(Et(l.track)[d("width")]/x);$=S||n[d("autoWidth")]&&e.length||n.perPage*bs}return $}return{mount:u,destroy:C}}function Ss(e,t,n){var i=et(e),o=i.on,l=i.emit,s=e.state.set,d=t.Layout,a=d.slideSize,p=d.getPadding,u=d.totalSize,L=d.listSize,C=d.sliderSize,y=t.Direction,g=y.resolve,h=y.orient,T=t.Elements,$=T.list,x=T.track,S;function H(){S=t.Transition,o([an,Hi,yt,ot],R)}function R(){t.Controller.isBusy()||(t.Scroll.cancel(),w(e.index),t.Slides.update())}function B(A,j,z,Q){A!==j&&v(A>z)&&(b(),I(m(U(),A>z),!0)),s(Fn),l(Jt,j,z,A),S.start(j,function(){s(In),l(Wn,j,z,A),Q&&Q()})}function w(A){I(F(A,!0))}function I(A,j){if(!e.is(si)){var z=j?A:O(A);_t($,"transform","translate"+g("X")+"("+z+"px)"),A!==z&&l(La)}}function O(A){if(e.is(Nn)){var j=P(A),z=j>t.Controller.getEnd(),Q=j<0;(Q||z)&&(A=m(A,z))}return A}function m(A,j){var z=A-N(j),Q=C();return A-=h(Q*(qn(Ct(z)/Q)||1))*(j?1:-1),A}function b(){I(U(),!0),S.cancel()}function P(A){for(var j=t.Slides.get(),z=0,Q=1/0,M=0;M<j.length;M++){var ne=j[M].index,f=Ct(F(ne,!0)-A);if(f<=Q)Q=f,z=ne;else break}return z}function F(A,j){var z=h(u(A-1)-W(A));return j?J(z):z}function U(){var A=g("left");return Et($)[A]-Et(x)[A]+h(p(!1))}function J(A){return n.trimSpace&&e.is(Pn)&&(A=Cn(A,0,h(C(!0)-L()))),A}function W(A){var j=n.focus;return j==="center"?(L()-a(A,!0))/2:+j*a(A)||0}function N(A){return F(A?t.Controller.getEnd():0,!!n.trimSpace)}function v(A){var j=h(m(U(),A));return A?j>=0:j<=$[g("scrollWidth")]-Et(x)[g("width")]}function _(A,j){j=ni(j)?U():j;var z=A!==!0&&h(j)<h(N(!1)),Q=A!==!1&&h(j)>h(N(!0));return z||Q}return{mount:H,move:B,jump:w,translate:I,shift:m,cancel:b,toIndex:P,toPosition:F,getPosition:U,getLimit:N,exceededLimit:_,reposition:R}}function Cs(e,t,n){var i=et(e),o=i.on,l=i.emit,s=t.Move,d=s.getPosition,a=s.getLimit,p=s.toPosition,u=t.Slides,L=u.isEnough,C=u.getLength,y=n.omitEnd,g=e.is(Nn),h=e.is(Pn),T=Ye(U,!1),$=Ye(U,!0),x=n.start||0,S,H=x,R,B,w;function I(){O(),o([yt,ot,ki],O),o(Hi,m)}function O(){R=C(!0),B=n.perMove,w=n.perPage,S=v();var f=Cn(x,0,y?S:R-1);f!==x&&(x=f,s.reposition())}function m(){S!==v()&&l(ki)}function b(f,ie,ye){if(!ne()){var te=F(f),he=N(te);he>-1&&(ie||he!==x)&&(z(he),s.move(te,he,H,ye))}}function P(f,ie,ye,te){t.Scroll.scroll(f,ie,ye,function(){var he=N(s.toIndex(d()));z(y?nn(he,S):he),te&&te()})}function F(f){var ie=x;if(tn(f)){var ye=f.match(/([+\-<>])(\d+)?/)||[],te=ye[1],he=ye[2];te==="+"||te==="-"?ie=J(x+ +(""+te+(+he||1)),x):te===">"?ie=he?_(+he):T(!0):te==="<"&&(ie=$(!0))}else ie=g?f:Cn(f,0,S);return ie}function U(f,ie){var ye=B||(M()?1:w),te=J(x+ye*(f?-1:1),x,!(B||M()));return te===-1&&h&&!ua(d(),a(!f),1)?f?0:S:ie?te:N(te)}function J(f,ie,ye){if(L()||M()){var te=W(f);te!==f&&(ie=f,f=te,ye=!1),f<0||f>S?!B&&(wi(0,f,ie,!0)||wi(S,ie,f,!0))?f=_(A(f)):g?f=ye?f<0?-(R%w||w):R:f:n.rewind?f=f<0?S:0:f=-1:ye&&f!==ie&&(f=_(A(ie)+(f<ie?-1:1)))}else f=-1;return f}function W(f){if(h&&n.trimSpace==="move"&&f!==x)for(var ie=d();ie===p(f,!0)&&wi(f,0,e.length-1,!n.rewind);)f<x?--f:++f;return f}function N(f){return g?(f+R)%R||0:f}function v(){for(var f=R-(M()||g&&B?1:w);y&&f-- >0;)if(p(R-1,!0)!==p(f,!0)){f++;break}return Cn(f,0,R-1)}function _(f){return Cn(M()?f:w*f,0,S)}function A(f){return M()?nn(f,S):Mi((f>=S?R-1:f)/w)}function j(f){var ie=s.toIndex(f);return h?Cn(ie,0,S):ie}function z(f){f!==x&&(H=x,x=f)}function Q(f){return f?H:x}function M(){return!ni(n.focus)||n.isNavigation}function ne(){return e.state.is([Fn,ti])&&!!n.waitForTransition}return{mount:I,go:b,scroll:P,getNext:T,getPrev:$,getAdjacent:U,getEnd:v,setIndex:z,getIndex:Q,toIndex:_,toPage:A,toDest:j,hasFocus:M,isBusy:ne}}var $s="http://www.w3.org/2000/svg",ws="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",pi=40;function Ts(e,t,n){var i=et(e),o=i.on,l=i.bind,s=i.emit,d=n.classes,a=n.i18n,p=t.Elements,u=t.Controller,L=p.arrows,C=p.track,y=L,g=p.prev,h=p.next,T,$,x={};function S(){R(),o(yt,H)}function H(){B(),S()}function R(){var P=n.arrows;P&&!(g&&h)&&O(),g&&h&&(Un(x,{prev:g,next:h}),Kn(y,P?"":"none"),Ht(y,$=Vo+"--"+n.direction),P&&(w(),b(),Me([g,h],li,C.id),s(xa,g,h)))}function B(){i.destroy(),Ut(y,$),T?(gn(L?[g,h]:y),g=h=null):Bt([g,h],zo)}function w(){o([an,Wn,ot,fn,ki],b),l(h,"click",Ye(I,">")),l(g,"click",Ye(I,"<"))}function I(P){u.go(P,!0)}function O(){y=L||Ln("div",d.arrows),g=m(!0),h=m(!1),T=!0,oi(y,[g,h]),!L&&_o(y,C)}function m(P){var F='<button class="'+d.arrow+" "+(P?d.prev:d.next)+'" type="button"><svg xmlns="'+$s+'" viewBox="0 0 '+pi+" "+pi+'" width="'+pi+'" height="'+pi+'" focusable="false"><path d="'+(n.arrowPath||ws)+'" />';return ca(F)}function b(){if(g&&h){var P=e.index,F=u.getPrev(),U=u.getNext(),J=F>-1&&P<F?a.last:a.prev,W=U>-1&&P>U?a.first:a.next;g.disabled=F<0,h.disabled=U<0,Me(g,It,J),Me(h,It,W),s(Sa,g,h,F,U)}}return{arrows:x,mount:S,destroy:B,update:b}}var Ls=Mo+"-interval";function Es(e,t,n){var i=et(e),o=i.on,l=i.bind,s=i.emit,d=Oi(n.interval,e.go.bind(e,">"),w),a=d.isPaused,p=t.Elements,u=t.Elements,L=u.root,C=u.toggle,y=n.autoplay,g,h,T=y==="pause";function $(){y&&(x(),C&&Me(C,li,p.track.id),T||S(),B())}function x(){n.pauseOnHover&&l(L,"mouseenter mouseleave",function(O){g=O.type==="mouseenter",R()}),n.pauseOnFocus&&l(L,"focusin focusout",function(O){h=O.type==="focusin",R()}),C&&l(C,"click",function(){T?S():H(!0)}),o([Jt,Bi,ot],d.rewind),o(Jt,I)}function S(){a()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),h=g=T=!1,B(),s(Ho))}function H(O){O===void 0&&(O=!0),T=!!O,B(),a()||(d.pause(),s(Bo))}function R(){T||(g||h?H(!1):S())}function B(){C&&(Gt(C,hn,!T),Me(C,It,n.i18n[T?"play":"pause"]))}function w(O){var m=p.bar;m&&_t(m,"width",O*100+"%"),s(wa,O)}function I(O){var m=t.Slides.getAt(O);d.set(m&&+At(m.slide,Ls)||n.interval)}return{mount:$,destroy:d.cancel,play:S,pause:H,isPaused:a}}function Is(e,t,n){var i=et(e),o=i.on;function l(){n.cover&&(o(Oo,Ye(d,!0)),o([an,yt,ot],Ye(s,!0)))}function s(a){t.Slides.forEach(function(p){var u=ri(p.container||p.slide,"img");u&&u.src&&d(a,u,p)})}function d(a,p,u){u.style("background",a?'center/cover no-repeat url("'+p.src+'")':"",!0),Kn(p,a?"none":"")}return{mount:l,destroy:Ye(s,!1)}}var Rs=10,Ps=600,_s=.6,As=1.5,Ms=800;function ks(e,t,n){var i=et(e),o=i.on,l=i.emit,s=e.state.set,d=t.Move,a=d.getPosition,p=d.getLimit,u=d.exceededLimit,L=d.translate,C=e.is(Pn),y,g,h=1;function T(){o(Jt,H),o([yt,ot],R)}function $(w,I,O,m,b){var P=a();if(H(),O&&(!C||!u())){var F=t.Layout.sliderSize(),U=vo(w)*F*Mi(Ct(w)/F)||0;w=d.toPosition(t.Controller.toDest(w%F))+U}var J=ua(P,w,1);h=1,I=J?0:I||Ai(Ct(w-P)/As,Ms),g=m,y=Oi(I,x,Ye(S,P,w,b),1),s(ti),l(Bi),y.start()}function x(){s(In),g&&g(),l(fn)}function S(w,I,O,m){var b=a(),P=w+(I-w)*B(m),F=(P-b)*h;L(b+F),C&&!O&&u()&&(h*=_s,Ct(F)<Rs&&$(p(u(!0)),Ps,!1,g,!0))}function H(){y&&y.cancel()}function R(){y&&!y.isPaused()&&(H(),x())}function B(w){var I=n.easingFunc;return I?I(w):1-Math.pow(1-w,4)}return{mount:T,destroy:H,scroll:$,cancel:R}}var $n={passive:!1,capture:!0};function Fs(e,t,n){var i=et(e),o=i.on,l=i.emit,s=i.bind,d=i.unbind,a=e.state,p=t.Move,u=t.Scroll,L=t.Controller,C=t.Elements.track,y=t.Media.reduce,g=t.Direction,h=g.resolve,T=g.orient,$=p.getPosition,x=p.exceededLimit,S,H,R,B,w,I=!1,O,m,b;function P(){s(C,to,fo,$n),s(C,no,fo,$n),s(C,Ba,U,$n),s(C,"click",N,{capture:!0}),s(C,"dragstart",Vt),o([an,yt],F)}function F(){var V=n.drag;ue(!V),B=V==="free"}function U(V){if(O=!1,!m){var Y=he(V);te(V.target)&&(Y||!V.button)&&(L.isBusy()?Vt(V,!0):(b=Y?C:window,w=a.is([Fn,ti]),R=null,s(b,to,J,$n),s(b,no,W,$n),p.cancel(),u.cancel(),v(V)))}}function J(V){if(a.is(Ci)||(a.set(Ci),l(ya)),V.cancelable)if(w){p.translate(S+ye(M(V)));var Y=ne(V)>yr,le=I!==(I=x());(Y||le)&&v(V),O=!0,l(va),Vt(V)}else j(V)&&(w=A(V),Vt(V))}function W(V){a.is(Ci)&&(a.set(In),l(ba)),w&&(_(V),Vt(V)),d(b,to,J),d(b,no,W),w=!1}function N(V){!m&&O&&Vt(V,!0)}function v(V){R=H,H=V,S=$()}function _(V){var Y=z(V),le=Q(Y),de=n.rewind&&n.rewindByDrag;y(!1),B?L.scroll(le,0,n.snap):e.is(si)?L.go(T(vo(Y))<0?de?"<":"-":de?">":"+"):e.is(Pn)&&I&&de?L.go(x(!0)?">":"<"):L.go(L.toDest(le),!0),y(!0)}function A(V){var Y=n.dragMinThreshold,le=zn(Y),de=le&&Y.mouse||0,Ce=(le?Y.touch:+Y)||10;return Ct(M(V))>(he(V)?Ce:de)}function j(V){return Ct(M(V))>Ct(M(V,!0))}function z(V){if(e.is(Nn)||!I){var Y=ne(V);if(Y&&Y<yr)return M(V)/Y}return 0}function Q(V){return $()+vo(V)*nn(Ct(V)*(n.flickPower||600),B?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function M(V,Y){return ie(V,Y)-ie(f(V),Y)}function ne(V){return yo(V)-yo(f(V))}function f(V){return H===V&&R||H}function ie(V,Y){return(he(V)?V.changedTouches[0]:V)["page"+h(Y?"Y":"X")]}function ye(V){return V/(I&&e.is(Pn)?gs:1)}function te(V){var Y=n.noDrag;return!Vn(V,"."+ka+", ."+Ui)&&(!Y||!Vn(V,Y))}function he(V){return typeof TouchEvent<"u"&&V instanceof TouchEvent}function oe(){return w}function ue(V){m=V}return{mount:P,disable:ue,isDragging:oe}}var Ws={Spacebar:" ",Right:zi,Left:Di,Up:Ea,Down:Ia};function Go(e){return e=tn(e)?e:e.key,Ws[e]||e}var vr="keydown";function Ns(e,t,n){var i=et(e),o=i.on,l=i.bind,s=i.unbind,d=e.root,a=t.Direction.resolve,p,u;function L(){C(),o(yt,y),o(yt,C),o(Jt,h)}function C(){var $=n.keyboard;$&&(p=$==="global"?window:d,l(p,vr,T))}function y(){s(p,vr)}function g($){u=$}function h(){var $=u;u=!0,oa(function(){u=$})}function T($){if(!u){var x=Go($);x===a(Di)?e.go("<"):x===a(zi)&&e.go(">")}}return{mount:L,destroy:y,disable:g}}var On=Mo+"-lazy",Ti=On+"-srcset",Hs="["+On+"], ["+Ti+"]";function Bs(e,t,n){var i=et(e),o=i.on,l=i.off,s=i.bind,d=i.emit,a=n.lazyLoad==="sequential",p=[Wn,fn],u=[];function L(){n.lazyLoad&&(C(),o(ot,C))}function C(){Yt(u),y(),a?$():(l(p),o(p,g),g())}function y(){t.Slides.forEach(function(x){Ao(x.slide,Hs).forEach(function(S){var H=At(S,On),R=At(S,Ti);if(H!==S.src||R!==S.srcset){var B=n.classes.spinner,w=S.parentElement,I=ri(w,"."+B)||Ln("span",B,w);u.push([S,x,I]),S.src||Kn(S,"none")}})})}function g(){u=u.filter(function(x){var S=n.perPage*((n.preloadPages||1)+1)-1;return x[1].isWithin(e.index,S)?h(x):!0}),u.length||l(p)}function h(x){var S=x[0];Ht(x[1].slide,Co),s(S,"load error",Ye(T,x)),Me(S,"src",At(S,On)),Me(S,"srcset",At(S,Ti)),Bt(S,On),Bt(S,Ti)}function T(x,S){var H=x[0],R=x[1];Ut(R.slide,Co),S.type!=="error"&&(gn(x[2]),Kn(H,""),d(Oo,H,R),d(Rn)),a&&$()}function $(){u.length&&h(u.shift())}return{mount:L,destroy:Ye(Yt,u),check:g}}function Os(e,t,n){var i=et(e),o=i.on,l=i.emit,s=i.bind,d=t.Slides,a=t.Elements,p=t.Controller,u=p.hasFocus,L=p.getIndex,C=p.go,y=t.Direction.resolve,g=a.pagination,h=[],T,$;function x(){S(),o([yt,ot,ki],x);var m=n.pagination;g&&Kn(g,m?"":"none"),m&&(o([Jt,Bi,fn],O),H(),O(),l(Ca,{list:T,items:h},I(e.index)))}function S(){T&&(gn(g?rn(T.children):T),Ut(T,$),Yt(h),T=null),i.destroy()}function H(){var m=e.length,b=n.classes,P=n.i18n,F=n.perPage,U=u()?p.getEnd()+1:qn(m/F);T=g||Ln("ul",b.pagination,a.track.parentElement),Ht(T,$=Ki+"--"+w()),Me(T,Kt,"tablist"),Me(T,It,P.select),Me(T,Do,w()===Vi?"vertical":"");for(var J=0;J<U;J++){var W=Ln("li",null,T),N=Ln("button",{class:b.page,type:"button"},W),v=d.getIn(J).map(function(A){return A.slide.id}),_=!u()&&F>1?P.pageX:P.slideX;s(N,"click",Ye(R,J)),n.paginationKeyboard&&s(N,"keydown",Ye(B,J)),Me(W,Kt,"presentation"),Me(N,Kt,"tab"),Me(N,li,v.join(" ")),Me(N,It,bo(_,J+1)),Me(N,En,-1),h.push({li:W,button:N,page:J})}}function R(m){C(">"+m,!0)}function B(m,b){var P=h.length,F=Go(b),U=w(),J=-1;F===y(zi,!1,U)?J=++m%P:F===y(Di,!1,U)?J=(--m+P)%P:F==="Home"?J=0:F==="End"&&(J=P-1);var W=h[J];W&&(sa(W.button),C(">"+J),Vt(b,!0))}function w(){return n.paginationDirection||n.direction}function I(m){return h[p.toPage(m)]}function O(){var m=I(L(!0)),b=I(L());if(m){var P=m.button;Ut(P,hn),Bt(P,pr),Me(P,En,-1)}if(b){var F=b.button;Ht(F,hn),Me(F,pr,!0),Me(F,En,"")}l($a,{list:T,items:h},m,b)}return{items:h,mount:x,destroy:S,getAt:I,update:O}}var js=[" ","Enter"];function Ds(e,t,n){var i=n.isNavigation,o=n.slideFocus,l=[];function s(){e.splides.forEach(function(g){g.isParent||(p(e,g.splide),p(g.splide,e))}),i&&u()}function d(){l.forEach(function(g){g.destroy()}),Yt(l)}function a(){d(),s()}function p(g,h){var T=et(g);T.on(Jt,function($,x,S){h.go(h.is(Nn)?S:$)}),l.push(T)}function u(){var g=et(e),h=g.on;h(Fo,C),h(Ta,y),h([an,yt],L),l.push(g),g.emit(No,e.splides)}function L(){Me(t.Elements.list,Do,n.direction===Vi?"vertical":"")}function C(g){e.go(g.index)}function y(g,h){Po(js,Go(h))&&(C(g),Vt(h))}return{setup:Ye(t.Media.set,{slideFocus:ni(o)?i:o},!0),mount:s,destroy:d,remount:a}}function zs(e,t,n){var i=et(e),o=i.bind,l=0;function s(){n.wheel&&o(t.Elements.track,"wheel",d,$n)}function d(p){if(p.cancelable){var u=p.deltaY,L=u<0,C=yo(p),y=n.wheelMinThreshold||0,g=n.wheelSleep||0;Ct(u)>y&&C-l>g&&(e.go(L?"<":">"),l=C),a(L)&&Vt(p)}}function a(p){return!n.releaseWheel||e.state.is(Fn)||t.Controller.getAdjacent(p)!==-1}return{mount:s}}var Vs=90;function Gs(e,t,n){var i=et(e),o=i.on,l=t.Elements.track,s=n.live&&!n.isNavigation,d=Ln("span",cs),a=Oi(Vs,Ye(u,!1));function p(){s&&(C(!t.Autoplay.isPaused()),Me(l,hr,!0),d.textContent="…",o(Ho,Ye(C,!0)),o(Bo,Ye(C,!1)),o([Wn,fn],Ye(u,!0)))}function u(y){Me(l,gr,y),y?(oi(l,d),a.start()):(gn(d),a.cancel())}function L(){Bt(l,[mr,hr,gr]),gn(d)}function C(y){s&&Me(l,mr,y?"off":"polite")}return{mount:p,disable:C,destroy:L}}var Us=Object.freeze({__proto__:null,Media:es,Direction:ts,Elements:hs,Slides:ys,Layout:vs,Clones:xs,Move:Ss,Controller:Cs,Arrows:Ts,Autoplay:Es,Cover:Is,Scroll:ks,Drag:Fs,Keyboard:Ns,LazyLoad:Bs,Pagination:Os,Sync:Ds,Wheel:zs,Live:Gs}),Ks={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"},qs={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:ps,i18n:Ks,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Xs(e,t,n){var i=t.Slides;function o(){et(e).on([an,ot],l)}function l(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function s(d,a){i.style("transition","opacity "+n.speed+"ms "+n.easing),oa(a)}return{mount:o,start:s,cancel:fo}}function Ys(e,t,n){var i=t.Move,o=t.Controller,l=t.Scroll,s=t.Elements.list,d=Ye(_t,s,"transition"),a;function p(){et(e).bind(s,"transitionend",function(y){y.target===s&&a&&(L(),a())})}function u(y,g){var h=i.toPosition(y,!0),T=i.getPosition(),$=C(y);Ct(h-T)>=1&&$>=1?n.useScroll?l.scroll(h,$,!1,g):(d("transform "+$+"ms "+n.easing),i.translate(h,!0),a=g):(i.jump(y),g())}function L(){d(""),l.cancel()}function C(y){var g=n.rewindSpeed;if(e.is(Pn)&&g){var h=o.getIndex(!0),T=o.getEnd();if(h===0&&y>=T||h>=T&&y===0)return g}return n.speed}return{mount:p,start:u,cancel:L}}var Js=(function(){function e(n,i){this.event=et(),this.Components={},this.state=Zl(Tn),this.splides=[],this._o={},this._E={};var o=tn(n)?da(document,n):n;Bn(o,o+" is invalid."),this.root=o,i=en({label:At(o,It)||"",labelledby:At(o,jo)||""},qs,e.defaults,i||{});try{en(i,JSON.parse(At(o,Mo)))}catch{Bn(!1,"Invalid JSON")}this._o=Object.create(en({},i))}var t=e.prototype;return t.mount=function(i,o){var l=this,s=this.state,d=this.Components;Bn(s.is([Tn,_i]),"Already mounted!"),s.set(Tn),this._C=d,this._T=o||this._T||(this.is(si)?Xs:Ys),this._E=i||this._E;var a=Un({},Us,this._E,{Transition:this._T});return mn(a,function(p,u){var L=p(l,d,l._o);d[u]=L,L.setup&&L.setup()}),mn(d,function(p){p.mount&&p.mount()}),this.emit(an),Ht(this.root,ds),s.set(In),this.emit(xo),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(In)&&(this._C.Sync.remount(),i.Components.Sync.remount()),this},t.go=function(i){return this._C.Controller.go(i),this},t.on=function(i,o){return this.event.on(i,o),this},t.off=function(i){return this.event.off(i),this},t.emit=function(i){var o;return(o=this.event).emit.apply(o,[i].concat(rn(arguments,1))),this},t.add=function(i,o){return this._C.Slides.add(i,o),this},t.remove=function(i){return this._C.Slides.remove(i),this},t.is=function(i){return this._o.type===i},t.refresh=function(){return this.emit(ot),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,l=this.state;return l.is(Tn)?et(this).on(xo,this.destroy.bind(this,i)):(mn(this._C,function(s){s.destroy&&s.destroy(i)},!0),o.emit(Wo),o.destroy(),i&&Yt(this.splides),l.set(_i)),this},Kl(e,[{key:"options",get:function(){return this._o},set:function(i){this._C.Media.set(i,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),Uo=Js;Uo.defaults={};Uo.STATES=Xl;var br=[[an,"onMounted"],[xo,"onReady"],[Jt,"onMove"],[Wn,"onMoved"],[Fo,"onClick"],[ma,"onActive"],[ga,"onInactive"],[ha,"onVisible"],[fa,"onHidden"],[ot,"onRefresh"],[yt,"onUpdated"],[Rn,"onResize"],[Hi,"onResized"],[ya,"onDrag"],[va,"onDragging"],[ba,"onDragged"],[Bi,"onScroll"],[fn,"onScrolled"],[Wo,"onDestroy"],[xa,"onArrowsMounted"],[Sa,"onArrowsUpdated"],[Ca,"onPaginationMounted"],[$a,"onPaginationUpdated"],[No,"onNavigationMounted"],[Ho,"onAutoplayPlay"],[wa,"onAutoplayPlaying"],[Bo,"onAutoplayPause"],[Oo,"onLazyLoadLoaded"]];function Ko(...e){return e.filter(Boolean).join(" ")}function Fi(e){return e!==null&&typeof e=="object"}function $o(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!$o(n,t[i]));if(Fi(e)&&Fi(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!$o(e[o],t[o]))}return e===t}function Zs(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function Qs(e,t){if(e){const n=Object.keys(e);for(let i=0;i<n.length;i++){const o=n[i];if(o!=="__proto__"&&t(e[o],o)===!1)break}}return e}function wo(e,t){const n=e;return Qs(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Fi(i)?n[o]=wo(Fi(n[o])?n[o]:{},i):n[o]=i}),n}var ec=({children:e,className:t,...n})=>c.createElement("div",{className:Ko("splide__track",t),...n},c.createElement("ul",{className:"splide__list"},e)),qo=class extends c.Component{constructor(){super(...arguments),this.splideRef=c.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new Uo(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=wo({},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&&!$o(this.options,e)&&(this.splide.options=e,this.options=wo({},e));const t=this.getSlides();Zs(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){br.forEach(([t,n])=>{const i=this.props[n];typeof i=="function"&&e.on(t,(...o)=>{i(e,...o)})})}omit(e,t){return t.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}),e}render(){const{className:e,tag:t="div",hasTrack:n=!0,children:i,...o}=this.props;return c.createElement(t,{className:Ko("splide",e),ref:this.splideRef,...this.omit(o,["options",...br.map(l=>l[1])])},n?c.createElement(ec,null,i):i)}},Xo=({children:e,className:t,...n})=>c.createElement("li",{className:Ko("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 tc="RichTextRenderer-module__link___BWeZ2",nc={link:tc},ic=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(i=>/^\d/.test(i))},qi=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>ic(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function Ft(e){const{color:t,...n}=e;return n}function dt(e,t){var o,s,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:qi(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:L.scalingValue(e.letterSpacing,t),wordSpacing:L.scalingValue(e.wordSpacing,t),fontSize:L.scalingValue(n,t),lineHeight:i!==void 0?L.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(s=e.textAppearance)==null?void 0:s.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}const Yn=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:nc.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:oc(i),children:i.text},o));return r.jsx(r.Fragment,{children:e.map((n,i)=>{const o=n.children;return r.jsx("div",{children:t(o)},i)})})};function oc(e){return{...e.fontFamily&&{fontFamily:qi(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 rc="SvgImage-module__svg___q3xE-",ac="SvgImage-module__img___VsTm-",xr={svg:rc,img:ac},sc=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},lc=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,Wt=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[s,l]=c.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return c.useEffect(()=>{if(typeof window<"u"&&window.CSS){const d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');l(d)}},[]),!sc(e)||!s?r.jsx("img",{src:e,alt:"",className:De(xr.img,i),style:o}):r.jsx("span",{"data-supports-mask":s,className:De(xr.svg,i),style:{"--svg":lc(e),"--fill":t,"--hover-fill":n,...o??{}}})},cc={"top-left":ye.topLeftAlignment,"top-center":ye.topCenterAlignment,"top-right":ye.topRightAlignment,"middle-left":ye.middleLeftAlignment,"middle-center":ye.middleCenterAlignment,"middle-right":ye.middleRightAlignment,"bottom-left":ye.bottomLeftAlignment,"bottom-center":ye.bottomCenterAlignment,"bottom-right":ye.bottomRightAlignment};function dc({settings:e,content:t,styles:n,isEditor:i}){const[o,s]=c.useState(null),{widthSettings:l,fontSettings:d,letterSpacing:a,textAlign:u,wordSpacing:p,fontSizeLineHeight:T,textAppearance:x,color:y}=n.imageCaption??{},[g,h]=c.useState(void 0),[w,S]=c.useState(null),[b,$]=c.useState(0),[H,R]=c.useState(0),{direction:B,transition:m,controls:C,pagination:N,imageCaption:v,triggers:E}=e,k=c.useRef(m.type),{x:O,y:U}=e.controls.offset,Z=W=>{o&&o.go(W)};return c.useEffect(()=>{if(!w)return;const W=new ResizeObserver(P=>{if(!o)return;const[I]=P;h({width:Math.round(I.contentRect.width),height:Math.round(I.contentRect.height)})});return W.observe(w),()=>W.unobserve(w)},[w]),c.useEffect(()=>{!o||k.current===m.type||(R(W=>W+1),k.current=m.type)},[m.type]),r.jsx("div",{className:De(ye.wrapper,{[ye.editor]:i}),ref:S,children:r.jsxs("div",{className:ye.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:m.backgroundColor&&m.type==="fade in"?m.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:De(ye.captionBlock),children:r.jsx("div",{className:ye.captionTextWrapper,children:t.map((W,P)=>r.jsx("div",{className:De(ye.captionText,cc[v.alignment],{[ye.withPointerEvents]:P===b&&i,[ye.active]:P===b}),style:{fontFamily:qi(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":L.scalingValue(l.width,i),letterSpacing:L.scalingValue(a,i),wordSpacing:L.scalingValue(p,i),textAlign:u,fontSize:L.scalingValue(T.fontSize,i),lineHeight:L.scalingValue(T.lineHeight,i),textTransform:x.textTransform??"none",textDecoration:x.textDecoration??"none",fontVariant:x.fontVariant??"normal",color:y,transitionDuration:m.duration?`${Math.round(parseInt(m.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:ye.captionTextInner,style:{"--link-hover-color":v.linkHoverColor,"--link-color":v.linkColor,position:"relative",top:L.scalingValue(v.offset.y,i),left:L.scalingValue(v.offset.x,i)},children:r.jsx(Yn,{content:W.imageCaption})})},P))})}),r.jsx(qo,{onMove:W=>{$(W.index)},ref:s,options:{arrows:!1,speed:m.duration?parseInt(m.duration):500,autoplay:E.autoPlay!==null,...E.autoPlay!==null&&{interval:parseInt(E.autoPlay)*1e3},direction:B==="horiz"||m.type==="fade in"?"ltr":"ttb",pagination:!1,drag:E.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:m.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((W,P)=>r.jsx(Xo,{children:r.jsx("div",{className:ye.sliderItem,children:r.jsx("div",{className:ye.imgWrapper,children:r.jsx("img",{className:De(ye.sliderImage,{[ye.contain]:W.image.objectFit==="contain",[ye.cover]:W.image.objectFit==="cover"}),src:W.image.url,alt:W.image.name??""})})})},P))},H),C.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:De(ye.arrow,{[ye.arrowVertical]:B==="vert",[ye.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:r.jsxs("button",{onClick:()=>{Z("-1")},className:ye.arrowInner,style:{transform:`translate(${L.scalingValue(O,i)}, ${L.scalingValue(U*(B==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&r.jsx(Wt,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:De(ye.arrowImg,ye.mirror)}),!C.arrowsImgUrl&&r.jsx(Sr,{color:C.color,className:De(ye.arrowIcon,ye.arrowImg,ye.mirror)})]})}),r.jsx("div",{className:De(ye.arrow,ye.nextArrow,{[ye.arrowVertical]:B==="vert",[ye.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:r.jsxs("button",{className:ye.arrowInner,onClick:()=>Z("+1"),style:{transform:`translate(${L.scalingValue(O*(B==="horiz"?-1:1),i)}, ${L.scalingValue(U,i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&r.jsx(Wt,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:ye.arrowImg}),!C.arrowsImgUrl&&r.jsx(Sr,{color:C.color,className:De(ye.arrowIcon,ye.arrowImg)})]})})]}),E.triggersList.click&&r.jsx("div",{className:ye.clickOverlay,onClick:()=>{o&&o.go("+1")}}),N.isActive&&r.jsx("div",{className:De(ye.pagination,{[ye.paginationInsideBottom]:N.position==="inside-1"&&B==="horiz",[ye.paginationInsideTop]:N.position==="inside-2"&&B==="horiz",[ye.paginationOutsideBottom]:N.position==="outside-1"&&B==="horiz",[ye.paginationOutsideTop]:N.position==="outside-2"&&B==="horiz",[ye.paginationInsideLeft]:N.position==="inside-1"&&B==="vert",[ye.paginationInsideRight]:N.position==="inside-2"&&B==="vert",[ye.paginationOutsideLeft]:N.position==="outside-1"&&B==="vert",[ye.paginationOutsideRight]:N.position==="outside-2"&&B==="vert",[ye.paginationVertical]:B==="vert"}),children:r.jsx("div",{className:ye.paginationInner,style:{backgroundColor:N.colors[2],transform:`scale(${N.scale/100}) translate(${L.scalingValue(N.offset.x,i)}, ${L.scalingValue(N.offset.y,i)}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:t.map((W,P)=>r.jsx("button",{onClick:()=>{o&&o.go(P)},className:De(ye.paginationItem),children:r.jsx("div",{className:De(ye.dot,{[ye.activeDot]:P===b}),style:{backgroundColor:P===b?N.colors[0]:N.colors[1],"--pagination-hover-color":N.hover}})},P))})})]})})}function Sr({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const uc={element:dc,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Slider.mp4"},defaultSize:{d:{width:400,height:400},t:{width:400,height:400},m:{width:300,height:300}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.arrowsImgUrl"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{triggers:{title:"triggers",icon:"target",tooltip:"Triggers",type:"object",properties:{triggersList:{type:"object",display:{type:"toggle-ratio-group"},properties:{click:{type:"boolean"},drag:{type:"boolean"}}},autoPlay:{type:["string","null"],label:"Auto",display:{type:"step-selector"},enum:[null,"1s","2s","3s","4s","5s"]}}},direction:{icon:"horizontal-resize",tooltip:"Direction",type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},transition:{title:"transit",icon:"transition",tooltip:"Transition",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade in"]},backgroundColor:{type:["string","null"],title:"BG Color",display:{visible:!1,type:"settings-color-picker",format:"single"}},duration:{type:"string",label:"icon:hourglass",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},controls:{title:"controls",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:50,max:600,display:{type:"range-control"}},color:{title:"color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}},show:{title:"Show",type:"string",display:{type:"ratio-group"},enum:["always","on hover"]}}},pagination:{title:"nav",icon:"pagination",tooltip:"Navigation",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"socket",direction:"horizontal"},type:"string",enum:["outside-1","outside-2","inside-1","inside-2"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:10,max:400,display:{type:"range-control"}},colors:{display:{type:"settings-color-picker",format:"multiple"},title:"color",type:"array",items:{type:"string"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},imageCaption:{title:"Caption",icon:"text-icon",tooltip:"Caption",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}},default:{triggers:{triggersList:{click:!1,drag:!0},autoPlay:null},controls:{isActive:!0,arrowsImgUrl:null,offset:{x:0,y:0},scale:100,color:"#000000",hover:"#cccccc",show:"always"},transition:{type:"slide",duration:"500ms",backgroundColor:null},pagination:{isActive:!0,scale:50,position:"inside-1",offset:{x:0,y:0},colors:["#cccccc","#cccccc","#000000"],hover:"#cccccc"},direction:"horiz",imageCaption:{offset:{x:0,y:0},isActive:!0,alignment:"middle-center",linkColor:"#cccccc",linkHoverColor:"#cccccc"}},displayRules:[{if:{name:"direction",value:"vert"},then:{name:"properties.pagination.properties.position.display.direction",value:"vertical"}},{if:{name:"transition.type",value:"fade in"},then:{name:"properties.transition.properties.backgroundColor.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{placeholder:"Add Caption...",label:"Description",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}},pc="ImageRevealSlider-module__imageRevealSlider___UE5Ob",mc="ImageRevealSlider-module__image___Qjt-e",gc="ImageRevealSlider-module__link___N-iLG",hc="ImageRevealSlider-module__cursor___2U03d",Sn={imageRevealSlider:pc,image:mc,link:gc,cursor:hc};function Cr(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const s=i.width?Number.parseFloat(i.width):o.naturalWidth,l=o.naturalHeight/o.naturalWidth*s,d=s/2,a=l/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-a&&t<=i.y+a)return!0}return!1}function io(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function fc(e,t,n,i){let o,s;if(t==="custom"){o=n;const l=await io(e);s=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await io(e);s=l.height/l.width*o}else{const l=await io(e);o=l.width,s=l.height}return{width:o,height:s,finalWidth:`${o}px`}}function yc({settings:e,content:t,isEditor:n}){const[i,o]=c.useState(null),[s,l]=c.useState([]),[d,a]=c.useState(0),u=c.useRef(0),[p,T]=c.useState({x:0,y:0}),[x,y]=c.useState(1),[g,h]=c.useState("none"),w=c.useRef({x:0,y:0}),[S,b]=c.useState(!1),{sizeType:$,imageWidth:H,randomRangeImageWidth:R}=e.imageSize,{revealPosition:B,visible:m}=e.position,{cursorType:C,target:N,defaultCursorScale:v,defaultCursor:E,hoverCursorScale:k,hoverCursor:O}=e.cursor;c.useEffect(()=>{if(!i)return;const W=(F,_)=>{const j=i.getBoundingClientRect(),K=F-j.left,te=_-j.top;if(T({x:K,y:te}),C==="system"){h("none"),y(1);return}const M=K,ne=te,f=document.elementFromPoint(j.left+M,j.top+ne);if(f&&f.closest("a")){h("none"),y(1);return}const ee=Cr(M,ne,s)||N==="area"?{img:O??"none",scale:k}:{img:E??"none",scale:v};h(ee.img),y(ee.scale)},P=F=>{F.stopPropagation(),w.current={x:F.clientX,y:F.clientY},W(F.clientX,F.clientY)},I=()=>{S&&W(w.current.x,w.current.y)};return i.addEventListener("mousemove",P),window.addEventListener("scroll",I,!0),()=>{i.removeEventListener("mousemove",P),window.removeEventListener("scroll",I,!0)}},[i,S,p,C,N,O,E,k,v,s]),c.useEffect(()=>{S||(h("none"),y(0))},[S]);const U=async(W,P,I,F={})=>{const{width:_,height:j,finalWidth:K}=await fc(W.image.url,$,H,R);let te=0,M=0;B==="same"?(te=P/2,M=I/2):(te=F.x??Math.random()*P,M=F.y??Math.random()*I);const ne=Math.min(Math.max(te,_/2),P-_/2),f=Math.min(Math.max(M,j/2),I-j/2);return{id:u.current++,url:W.image.url,link:W.link,name:W.image.name,x:ne,y:f,width:K}};c.useEffect(()=>{if(!i||t.length===0)return;const W=i.getBoundingClientRect(),P=W.width,I=W.height,F=[];(async()=>{const j=t[0],K=await U(j,P,I);F.push(K),l(F),a(1)})()},[$,H,R,B,i]),c.useEffect(()=>{m==="last One"&&l(W=>W.length>0?[W[W.length-1]]:[])},[m]);const Z=async W=>{if(!i)return;const P=i.getBoundingClientRect(),I=W.clientX-P.left,F=W.clientY-P.top;if(N==="image"&&!Cr(I,F,s))return;let _=0,j=0;B==="on Click"?(_=I,j=F):B==="same"?(_=P.width/2,j=P.height/2):(_=Math.random()*P.width,j=Math.random()*P.height);const K=t[d],te=await U(K,P.width,P.height,{x:_,y:j});l(M=>m==="all"?[...M,te]:[te]),a(M=>M>=t.length-1?0:M+1)};return r.jsxs("div",{ref:o,onClick:Z,onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),className:Sn.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[s.map(W=>r.jsx("div",{className:Sn.wrapper,style:{top:`${W.y}px`,left:`${W.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:W.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:N==="area"&&W.link?r.jsx("a",{href:W.link,target:"_blank",className:Sn.link,children:r.jsx("img",{src:W.url,alt:W.name,className:Sn.image},W.id)}):r.jsx("img",{src:W.url,alt:W.name,className:Sn.image},W.id)},W.id)),S&&r.jsx("div",{className:Sn.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${x})`,backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const vc={element:yc,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Click_Gallery.mp4"},defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.cursor.defaultCursor"},{path:"settings.cursor.hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{imageSize:{title:"IMG SIZE",icon:"size",tooltip:"IMG SIZE",type:"object",properties:{sizeType:{type:"string",display:{type:"ratio-group"},enum:["as Is","custom","random"]},imageWidth:{type:"number",label:"W",display:{type:"numeric-input",visible:!1}},randomRangeImageWidth:{type:"object",display:{type:"random-range-controls",visible:!1},properties:{min:{type:"number"},max:{type:"number"}}}}},cursor:{title:"cursor",icon:"cursor",tooltip:"cursor",type:"object",properties:{cursorType:{type:"string",display:{type:"ratio-group"},enum:["system","custom"]},target:{type:"string",title:"Target",display:{type:"ratio-group"},enum:["area","image"]},defaultCursor:{type:["string","null"],title:"Default",display:{type:"settings-image-input",visible:!1}},defaultCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}},hoverCursor:{type:["string","null"],title:"Hover",display:{type:"settings-image-input",visible:!1}},hoverCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}}}},position:{title:"position",icon:"transition",tooltip:"Position",type:"object",properties:{revealPosition:{type:"string",display:{type:"ratio-group"},enum:["random","same","on Click"]},visible:{type:"string",title:"Visible",display:{type:"ratio-group"},enum:["all","last One"]}}}},default:{imageSize:{sizeType:"custom",imageWidth:500,randomRangeImageWidth:{min:100,max:1e3}},cursor:{cursorType:"system",target:"area",defaultCursor:null,defaultCursorScale:2,hoverCursor:null,hoverCursorScale:2},position:{revealPosition:"random",visible:"all"}},displayRules:[{if:{name:"imageSize.sizeType",value:"custom"},then:{name:"properties.imageSize.properties.imageWidth.display.visible",value:!0}},{if:{name:"imageSize.sizeType",value:"random"},then:{name:"properties.imageSize.properties.randomRangeImageWidth.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"}],then:{name:"properties.cursor.properties.defaultCursor.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"},{name:"cursor.defaultCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.defaultCursorScale.display.visible",value:!0}},{if:{name:"cursor.cursorType",value:"custom"},then:{name:"properties.cursor.properties.hoverCursor.display.visible",value:!0}},{if:[{name:"cursor.cursorType",value:"custom"},{name:"cursor.hoverCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.hoverCursorScale.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQP84JKRDT7WNWDQZR4Y9.png",name:"Slider-4.png"},link:""}]}}}},bc="LightBox-module__hidden___9s-9x",xc="LightBox-module__heroImage___sTxNF",Sc="LightBox-module__background___rm9ml",Cc="LightBox-module__editor___4ACaY",$c="LightBox-module__contentStyle___Bgnsq",wc="LightBox-module__imageStyle___tLIlB",Tc="LightBox-module__imgWrapper___LuFUp",Lc="LightBox-module__contain___8-yaS",Ec="LightBox-module__cover___hNvOG",Ic="LightBox-module__caption___b6L2I",Rc="LightBox-module__captionTextInner___rCGNH",Pc="LightBox-module__lightboxSplide___XFuWC",_c="LightBox-module__arrow___iz38X",Ac="LightBox-module__arrowVertical___Zfz81",Mc="LightBox-module__nextArrow___zkAQN",kc="LightBox-module__arrowInner___p48sW",Fc="LightBox-module__arrowIcon___3VaFf",Wc="LightBox-module__arrowImg___pNV88",Nc="LightBox-module__mirror___pjeXc",Hc="LightBox-module__thumbsWrapper___GB-nU",Oc="LightBox-module__thumbsContainerVertical___wttk5",Bc="LightBox-module__thumbsContainer___osSma",jc="LightBox-module__thumbsAlignStart___MO6tY",zc="LightBox-module__thumbsAlignCenter___Q4sUx",Dc="LightBox-module__thumbsAlignEnd___p4y9R",Vc="LightBox-module__thumbItem___HvnF3",Gc="LightBox-module__closeButton___g2khP",Uc="LightBox-module__fadeIn___0m5GW",Kc="LightBox-module__slideInLeft___gPYwC",qc="LightBox-module__slideInRight___S-pPp",Xc="LightBox-module__slideInTop___DFdAj",Yc="LightBox-module__slideInBottom___m27kZ",Jc="LightBox-module__fadeOut___55qBR",Zc="LightBox-module__slideOutLeft___NvU7P",Qc="LightBox-module__slideOutRight___SK7eC",ed="LightBox-module__slideOutTop___Vgg0z",td="LightBox-module__slideOutBottom___nJ0Ef",nd="LightBox-module__scaleSlide___vZriG",de={hidden:bc,heroImage:xc,background:Sc,editor:Cc,contentStyle:$c,imageStyle:wc,imgWrapper:Tc,contain:Lc,cover:Ec,caption:Ic,captionTextInner:Rc,lightboxSplide:Pc,arrow:_c,arrowVertical:Ac,nextArrow:Mc,arrowInner:kc,arrowIcon:Fc,arrowImg:Wc,mirror:Nc,thumbsWrapper:Hc,thumbsContainerVertical:Oc,thumbsContainer:Bc,thumbsAlignStart:jc,thumbsAlignCenter:zc,thumbsAlignEnd:Dc,thumbItem:Vc,closeButton:Gc,fadeIn:Uc,slideInLeft:Kc,slideInRight:qc,slideInTop:Xc,slideInBottom:Yc,fadeOut:Jc,slideOutLeft:Zc,slideOutRight:Qc,slideOutTop:ed,slideOutBottom:td,scaleSlide:nd},mi=(e,t,n)=>{const i={},[o,s]=e.split("-");return o==="top"?(i.top="0",i.bottom="auto"):o==="middle"?(i.top="50%",i.bottom="auto"):o==="bottom"&&(i.top="auto",i.bottom="0"),s==="left"?(i.left="0",i.right="auto"):s==="center"?(i.left="50%",i.right="auto"):s==="right"&&(i.left="auto",i.right="0"),o==="middle"&&s==="center"?i.transform=`translate(calc(-50% + ${L.scalingValue(t.x,n)}), calc(-50% + ${L.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${L.scalingValue(t.x,n)}, calc(-50% + ${L.scalingValue(t.y,n)}))`:s==="center"?i.transform=`translate(calc(-50% + ${L.scalingValue(t.x,n)}), ${L.scalingValue(t.y,n)})`:i.transform=`translate(${L.scalingValue(t.x,n)}, ${L.scalingValue(t.y,n)})`,i};function Ba(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 $r(e){const t=e.getBoundingClientRect(),n=Ba(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),s=e.naturalWidth,l=e.naturalHeight,d=i/o,a=s/l;let u,p;a>d?(u=i,p=i/a):(p=o,u=o*a);const T=t.left+n.left,x=t.top+n.top,y=(i-u)/2+T,g=(o-p)/2+x;return{x:y,y:g,width:u,height:p}}function wr(e){const t=e.getBoundingClientRect(),n=Ba(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Tr(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const i=t[1].split(",").map(o=>parseFloat(o.trim()));return i.length===4?i[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const i=n[1].substring(6,8);return parseInt(i,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function id(e,t){const n=(()=>{if(e==="fade in")return de.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return de.slideInLeft;case"right":return de.slideInRight;case"top":return de.slideInTop;case"bottom":return de.slideInBottom;default:return de.slideInRight}return de.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return de.fadeIn;if(e==="slide in")switch(t){case"left":return de.slideInLeft;case"right":return de.slideInRight;case"top":return de.slideInTop;case"bottom":return de.slideInBottom;default:return de.slideInRight}return de.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return de.fadeOut;if(e==="slide in")switch(t){case"left":return de.slideOutLeft;case"right":return de.slideOutRight;case"top":return de.slideOutTop;case"bottom":return de.slideOutBottom;default:return de.slideOutRight}return de.fadeOut})(),s=(()=>{if(e==="fade in")return de.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return de.slideOutLeft;case"right":return de.slideOutRight;case"top":return de.slideOutTop;case"bottom":return de.slideOutBottom;default:return de.slideOutRight}return de.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:s}}const od=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:s,isPreviewMode:l})=>{const[d,a]=c.useState(!1),{url:u}=e.thumbnailBlock.cover;return c.useEffect(()=>{o==="close"&&a(!1),o==="open"&&a(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:u,alt:"Cover",className:de.heroImage,onClick:()=>a(!0)}),r.jsx(rd,{isOpen:d,onClose:()=>a(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:s})]})},rd=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:s,isEditor:l,metadata:d})=>{var Le;const{widthSettings:a,fontSettings:u,letterSpacing:p,textAlign:T,wordSpacing:x,fontSizeLineHeight:y,textAppearance:g,color:h}=i.imageCaption??{},[w,S]=c.useState(0),[b,$]=c.useState(0),[H,R]=c.useState(!1),[B,m]=c.useState(!1),[C,N]=c.useState({}),v=c.useRef(null),E=c.useRef(null),k=c.useRef(null),O=c.useRef(!1),U=c.useRef(null),Z=c.useRef(null),W=c.useRef(null),P=c.useRef(null),I=c.useRef(!1),F=c.useRef(null),[_,j]=c.useState(!1),{appear:K,triggers:te,slider:M,thumbnail:ne,controls:f,area:ee,caption:ge,layout:ie}=o.lightboxBlock,{appearClass:fe,backdropAppearClass:Q,backdropDisappearClass:me,disappearClass:G}=id(K.type,K.direction),J=(d==null?void 0:d.itemId)??null;c.useEffect(()=>{const z=()=>{setTimeout(()=>{var A,X;(X=(A=v.current)==null?void 0:A.splide)==null||X.refresh()},16)},ue=()=>{$(A=>A+1)};return window.addEventListener("ArticleEditor.Layout:change",z),window.addEventListener("ArticleEditor.ComponentContent:change",ue),()=>{window.removeEventListener("ArticleEditor.Layout:change",z),window.removeEventListener("ArticleEditor.ComponentContent:change",ue)}},[]),c.useEffect(()=>{if(!e||!ne.isActive){j(!1);return}const z=F.current;if(!z)return;const ue=()=>{M.direction==="horiz"?j(z.scrollWidth>z.clientWidth):j(z.scrollHeight>z.clientHeight)};ue();const A=new ResizeObserver(ue);return A.observe(z),()=>A.disconnect()},[e,ne.isActive,n.length,C,M.direction]);const ce=c.useCallback(()=>{const z=window.matchMedia("(max-width: 768px)").matches,ue=Tr(ee.color);z&&!l&&ue>.9&&(document.body.style.backgroundColor=""),R(!0),O.current=!0;const A=X=>{X.target===U.current&&X.animationName&&(U.current&&Z.current&&U.current.removeEventListener("animationend",Z.current),Z.current=null,O.current&&(O.current=!1,t()),R(!1))};U.current&&(Z.current=A,U.current.addEventListener("animationend",A))},[t,ee.color,l]),pe=(z,ue,A)=>{var X,q;if(z){if(te.type==="click"&&te.switch==="image")te.repeat==="close"&&w===n.length-1?ce():(X=v.current)==null||X.go("+1");else if(te.type==="click"&&te.switch==="50/50"){const Y=z.getBoundingClientRect(),ae=ue-Y.left,he=A-Y.top,He=Y.width,we=Y.height;let Te;M.direction==="horiz"?Te=ae<He/2?"-1":"+1":Te=he<we/2?"-1":"+1",(q=v.current)==null||q.go(Te)}}},Ce=z=>{if(I.current){I.current=!1;return}const ue=n[w],A=(ue==null?void 0:ue.image.objectFit)==="cover";let X,q;if("changedTouches"in z&&z.changedTouches.length>0)X=z.changedTouches[0].clientX,q=z.changedTouches[0].clientY;else if("clientX"in z)X=z.clientX,q=z.clientY;else return;let Y;if(A&&k.current){const ae=wr(k.current);Y=X>=ae.left&&X<=ae.right&&q>=ae.top&&q<=ae.bottom}else{const ae=k.current?$r(k.current):null;if(!ae){z.target===z.currentTarget&&ce();return}Y=X>=ae.x&&X<=ae.x+ae.width&&q>=ae.y&&q<=ae.y+ae.height}Y?pe(k.current,X,q):ce()},Pe=z=>{const ue=z.target;(ue.classList.contains(de.thumbsWrapper)||ue.classList.contains(de.thumbsContainer))&&Ce(z)};c.useEffect(()=>{if(!e)return;const z=ue=>{var A,X;if(ue.key==="Escape"){ce();return}if(ue.key==="ArrowRight"){S(q=>(q+1)%Math.max(n.length,1)),(A=v.current)==null||A.go("+1");return}ue.key==="ArrowLeft"&&(S(q=>(q-1+Math.max(n.length,1))%Math.max(n.length,1)),(X=v.current)==null||X.go("-1"))};return window.addEventListener("keydown",z),()=>{window.removeEventListener("keydown",z)}},[e,ce,n.length]),c.useEffect(()=>{if(e){if(S(0),$(ue=>ue+1),O.current=!1,R(!1),m(!1),N({}),!J)return;const z=new CustomEvent("page-overlay",{detail:{itemId:J}});window.dispatchEvent(z)}return()=>{U.current&&Z.current&&(U.current.removeEventListener("animationend",Z.current),Z.current=null),m(!1)}},[e,J]),c.useEffect(()=>{E.current!==null&&E.current!==M.type&&$(z=>z+1),E.current=M.type},[M.type]),c.useEffect(()=>{if(!e)return;const z=document.body.style.overflow,ue=window.matchMedia("(max-width: 768px)").matches,A=Tr(ee.color);document.body.style.overflow="hidden",m(!1);const X=Y=>{Y.target===U.current&&!O.current&&Y.animationName&&(ue&&!l&&A>.9&&(document.body.style.backgroundColor=ee.color),m(!0),U.current&&W.current&&U.current.removeEventListener("animationend",W.current),W.current=null)};U.current&&(W.current=X,U.current.addEventListener("animationend",X));const q=Y=>{const ae=Y.target;ae&&(ae.closest(`.${de.thumbsWrapper}`)||ae.closest(`.${de.thumbsContainer}`))||M.type!=="slide"&&Y.preventDefault()};return document.addEventListener("touchmove",q,{passive:!1}),()=>{document.body.style.overflow=z,document.removeEventListener("touchmove",q),U.current&&W.current&&(U.current.removeEventListener("animationend",W.current),W.current=null),m(!1)}},[e,l,ee.color,M.type]),c.useEffect(()=>{if(!e)return;const z=ue=>{var X,q;if(O.current){ue.stopPropagation();return}if(I.current){I.current=!1;return}const A=ue.target;if(!(A&&(A.closest(`.${de.thumbsContainer}`)||A.closest(`.${de.thumbItem}`)||A.closest(`.${de.arrow}`)||A.closest(`.${de.closeButton}`)||A.closest(`.${de.caption}`)))){if(M.type==="slide"&&te.type==="drag"&&((q=(X=v.current)==null?void 0:X.splide)!=null&&q.root)){const Y=v.current.splide.root;if(A&&(Y.contains(A)||Y===A))return}if(ue.touches.length===0&&ue.changedTouches.length>0){const Y=n[w],ae=(Y==null?void 0:Y.image.objectFit)==="cover",he=ue.changedTouches[0];let He;if(ae&&k.current){const we=wr(k.current);He=he.clientX>=we.left&&he.clientX<=we.right&&he.clientY>=we.top&&he.clientY<=we.bottom}else{const we=k.current?$r(k.current):null;if(!we)return;He=he.clientX>=we.x&&he.clientX<=we.x+we.width&&he.clientY>=we.y&&he.clientY<=we.y+we.height}if(!He){ue.stopPropagation(),O.current=!0;const we=Te=>{Te.stopPropagation(),Te.preventDefault(),document.removeEventListener("click",we,!0)};document.addEventListener("click",we,!0),ce()}}}};return document.addEventListener("touchend",z,{passive:!0}),()=>{document.removeEventListener("touchend",z)}},[e,ce,w,n]);const Ie=(M.type==="scale"||M.type==="fade")&&M.direction==="vert"&&te.type==="drag";c.useEffect(()=>{var Te,We;if(!e||!Ie||!((We=(Te=v.current)==null?void 0:Te.splide)!=null&&We.root))return;const z=v.current.splide.root,ue=30,A=(re,be)=>{if(P.current){const Fe=Math.abs(re-P.current.x),Oe=Math.abs(be-P.current.y);(Fe>0||Oe>0)&&(I.current=!0)}},X=re=>{P.current&&(re.preventDefault(),A(re.clientX,re.clientY))},q=re=>{P.current&&re.touches.length>0&&(re.preventDefault(),A(re.touches[0].clientX,re.touches[0].clientY))},Y=(re,be)=>{if(!P.current||!v.current){P.current=null;return}const Fe=Math.abs(re-P.current.x),Oe=Math.abs(be-P.current.y);Oe>ue&&Oe>Fe&&v.current.go(be<P.current.y?"+1":"-1"),P.current=null},ae=re=>{P.current&&Y(re.clientX,re.clientY),document.removeEventListener("pointerup",ae),document.removeEventListener("pointercancel",ae),document.removeEventListener("pointermove",X)},he=re=>{if(P.current){if(re.changedTouches.length>0){const be=re.changedTouches[0];Y(be.clientX,be.clientY)}document.removeEventListener("touchend",he),document.removeEventListener("touchcancel",he),document.removeEventListener("touchmove",q)}},He=re=>{P.current={x:re.clientX,y:re.clientY},I.current=!1,document.addEventListener("pointermove",X,{passive:!1}),document.addEventListener("pointerup",ae),document.addEventListener("pointercancel",ae)},we=re=>{re.touches.length>0&&(P.current={x:re.touches[0].clientX,y:re.touches[0].clientY},I.current=!1,document.addEventListener("touchmove",q,{passive:!1}),document.addEventListener("touchend",he),document.addEventListener("touchcancel",he))};return z.addEventListener("pointerdown",He),z.addEventListener("touchstart",we),()=>{z.removeEventListener("pointerdown",He),z.removeEventListener("touchstart",we),document.removeEventListener("pointermove",X),document.removeEventListener("pointerup",ae),document.removeEventListener("pointercancel",ae),document.removeEventListener("touchmove",q),document.removeEventListener("touchend",he),document.removeEventListener("touchcancel",he),P.current=null,I.current=!1}},[e,Ie,b]);const Ae={backgroundColor:ee.color,backdropFilter:`blur(${ee.blur}px)`,animationDuration:`${parseInt(K.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(s)?null:ei.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:l?null:U,className:De(de.background,H?me:Q,{[de.editor]:l},{[de.hidden]:!e}),style:{...Ae,...B&&!l&&!H?{position:"absolute"}:{}}}),r.jsxs("div",{ref:l?U:null,className:De(de.contentStyle,H?G:fe,{[de.editor]:l},{[de.hidden]:!e}),style:{animationDuration:`${parseInt(K.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(qo,{onMove:z=>S(z.index),ref:v,className:de.lightboxSplide,options:{arrows:!1,speed:M.duration?parseInt(M.duration):500,direction:M.direction==="horiz"||M.type==="fade"||M.type==="scale"?"ltr":"ttb",pagination:!1,drag:te.type==="drag"&&!Ie,perPage:1,width:"100%",height:"100%",type:M.type==="fade"||M.type==="scale"?"fade":"loop",padding:0,rewind:te.repeat!=="close",start:0},style:{"--splide-speed":M.duration},children:n.map((z,ue)=>{const A=mi(ie.position,ie.offset,l),X=`${L.scalingValue(ie.padding.top,l)} ${L.scalingValue(ie.padding.right,l)} ${L.scalingValue(ie.padding.bottom,l)} ${L.scalingValue(ie.padding.left,l)}`,q=M.type==="scale"?(()=>{const{transform:Y,...ae}=A;return{...ae,position:"absolute",padding:X,boxSizing:"border-box","--position-transform":Y||"none"}})():{...A,position:"absolute",padding:X,boxSizing:"border-box"};return r.jsx(Xo,{children:r.jsx("div",{className:de.imgWrapper,onClick:Ce,children:r.jsx("img",{ref:ue===w?k:null,className:De(de.imageStyle,{[de.contain]:z.image.objectFit==="contain",[de.cover]:z.image.objectFit==="cover",[de.scaleSlide]:M.type==="scale"}),src:z.image.url,alt:z.image.name??"",style:{...q,pointerEvents:z.image.objectFit==="contain"?"none":"auto"}})})},ue)})},b),f.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:De(de.arrow,{[de.arrowVertical]:M.direction==="vert"}),style:{color:f.color,"--arrow-hover-color":f.hover},children:r.jsxs("button",{className:de.arrowInner,style:{transform:`translate(${L.scalingValue(f.offset.x,l)}, ${L.scalingValue(f.offset.y*(M.direction==="horiz"?1:-1),l)}) scale(${f.scale}) rotate(${M.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var z;return(z=v.current)==null?void 0:z.go("-1")},"aria-label":"Previous",children:[f.arrowsImgUrl&&r.jsx(Wt,{url:f.arrowsImgUrl,fill:f.color,hoverFill:f.hover,className:De(de.arrowImg,de.mirror)}),!f.arrowsImgUrl&&r.jsx(Lr,{color:f.color,className:De(de.arrowIcon,de.arrowImg,de.mirror)})]})}),r.jsx("div",{className:De(de.arrow,de.nextArrow,{[de.arrowVertical]:M.direction==="vert"}),style:{color:f.color,"--arrow-hover-color":f.hover},children:r.jsxs("button",{className:de.arrowInner,style:{transform:`translate(${L.scalingValue(f.offset.x*(M.direction==="horiz"?-1:1),l)}, ${L.scalingValue(f.offset.y,l)}) scale(${f.scale}) rotate(${M.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var z;return(z=v.current)==null?void 0:z.go("+1")},"aria-label":"Next",children:[f.arrowsImgUrl&&r.jsx(Wt,{url:f.arrowsImgUrl,fill:f.color,hoverFill:f.hover,className:de.arrowImg}),!f.arrowsImgUrl&&r.jsx(Lr,{color:f.color,className:De(de.arrowIcon,de.arrowImg)})]})})]}),ee.closeIconUrl&&(()=>{const z=mi(ee.closeIconAlign,ee.closeIconOffset,l),ue=`scale(${ee.closeIconScale})`,A=z.transform?`${z.transform} ${ue}`:ue;return r.jsx("button",{className:de.closeButton,style:{...z,transform:A},onClick:ce,"aria-label":"Close lightbox",children:r.jsx(Wt,{url:ee.closeIconUrl,fill:ee.closeIconColor??"#000000",hoverFill:ee.closeIconHover??"#cccccc"})})})(),ge&&ge.isActive&&i.imageCaption&&((Le=n[w])==null?void 0:Le.imageCaption)&&r.jsx("div",{className:de.caption,style:{...mi(ge.alignment,ge.offset,l),fontFamily:qi(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:a.sizing==="auto"?"max-content":L.scalingValue(a.width,l),letterSpacing:L.scalingValue(p,l),wordSpacing:L.scalingValue(x,l),textAlign:T,fontSize:L.scalingValue(y.fontSize,l),lineHeight:L.scalingValue(y.lineHeight,l),textTransform:g.textTransform??"none",textDecoration:g.textDecoration??"none",fontVariant:g.fontVariant??"normal",color:h},onClick:z=>z.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:de.captionTextInner,style:{"--link-color":ge.linkColor,"--link-hover-color":ge.linkHoverColor},children:r.jsx(Yn,{content:n[w].imageCaption})})}),ne.isActive&&(()=>{const[z,ue]=ne.position.split("-"),A=M.direction==="horiz"?`${z}-left`:ne.position,X=mi(A,ne.offset,l),q=()=>{if(M.direction==="horiz"){if(ue==="left")return"flex-start";if(ue==="center")return"center";if(ue==="right")return"flex-end"}else{if(z==="top")return"flex-start";if(z==="middle")return"center";if(z==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:F,className:de.thumbsWrapper,onClick:Y=>Pe(Y),style:{position:l?"absolute":"fixed",...X,...M.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:De(de.thumbsContainer,{[de.thumbsContainerVertical]:M.direction==="vert",[de.thumbsAlignStart]:ne.align==="start",[de.thumbsAlignCenter]:ne.align==="center",[de.thumbsAlignEnd]:ne.align==="end"}),style:{gap:L.scalingValue(ne.grid.gap,l),justifyContent:_?"flex-start":q()},children:n.map((Y,ae)=>{const he=ae===w,He=C[ae],Te=ne.grid.size*(he?ne.activeState.scale:1),We=()=>{if(ne.fit!=="fit")return{};if(!He)return M.direction==="horiz"?{height:L.scalingValue(Te,l)}:{width:L.scalingValue(Te,l)};const re=He.width/He.height;if(M.direction==="horiz"){const be=Te,Fe=be*re;return{width:L.scalingValue(Fe,l),height:L.scalingValue(be,l)}}else{const be=Te,Fe=be/re;return{width:L.scalingValue(be,l),height:L.scalingValue(Fe,l)}}};return r.jsx("button",{className:de.thumbItem,style:{...M.direction==="horiz"&&ne.fit!=="fit"?{height:L.scalingValue(Te,l)}:{},...M.direction==="vert"&&ne.fit!=="fit"?{width:L.scalingValue(Te,l)}:{},...ne.fit==="cover"?{width:L.scalingValue(Te,l),height:L.scalingValue(Te,l)}:{},...We(),transition:he?"all 0.25s ease-out":"none",opacity:he?ne.activeState.opacity/100:ne.opacity/100,"--thumb-hover":ne.activeState.opacity/100},onClick:re=>{var be;re.stopPropagation(),S(ae),(be=v.current)==null||be.go(ae)},onMouseEnter:()=>{var re;ne.triggers==="hov"&&((re=v.current)==null||re.go(ae))},children:r.jsx("img",{src:Y.image.url,alt:Y.image.name??"",onLoad:re=>{const be=re.currentTarget;be.naturalWidth&&be.naturalHeight&&N(Fe=>({...Fe,[ae]:{width:be.naturalWidth,height:be.naturalHeight}}))},style:{objectFit:ne.fit==="cover"?"cover":"contain",...ne.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...ne.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Y.image.name}-${ae}`)})})})})()]})]}),document.getElementById(s))};function Lr({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const ad={element:od,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Lightbox.png"},defaultSize:{d:{width:440,height:550},t:{width:235,height:293},m:{width:265,height:331}},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.thumbnailBlock.cover.url",placeholderEnabled:!0},{path:"settings.controls.arrowsImgUrl"},{path:"settings.area.closeIconUrl"}]},schema:{type:"object",properties:{settings:{type:"object",properties:{thumbnailBlock:{display:{type:"settings-block",triggerEvent:"close"},type:"object",properties:{cover:{title:"COVER",icon:"cover",tooltip:"Cover Image",type:"object",properties:{url:{type:"string",display:{type:"cover-image-input"}}}}}},lightboxBlock:{display:{type:"settings-block",triggerEvent:"open"},type:"object",properties:{appear:{title:"APPEAR",icon:"transition",tooltip:"Appearance",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide in","fade in","mix"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]},direction:{type:"string",title:"From",display:{type:"direction-control"},enum:["top","left","right","bottom"]}}},triggers:{title:"TRIGGERS",icon:"target",tooltip:"Triggers",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["click","drag"]},switch:{type:"string",display:{type:"ratio-group"},enum:["image","50/50"]},repeat:{type:"string",title:"Repeat",display:{visible:!1,type:"ratio-group"},enum:["close","loop"]}}},slider:{title:"SLIDER",icon:"horizontal-resize",tooltip:"Slider",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade","scale"]},direction:{type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},thumbnail:{title:"THUMB",icon:"thumbnail",tooltip:"Thumbnail",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},fit:{type:"string",display:{type:"ratio-group"},enum:["cover","fit"]},align:{type:"string",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},triggers:{type:"string",title:"Triggers",display:{type:"ratio-group",direction:"horizontal"},enum:["clk","hov"]},grid:{type:"object",title:"Grid",display:{type:"group"},properties:{size:{type:"number",label:"Box",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},gap:{type:"number",label:"Gap",scalingEnabled:!0,min:0,display:{type:"numeric-input"}}}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}},activeState:{type:"object",title:"ACTIVE",display:{type:"group"},properties:{scale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control"}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}}}}}},layout:{title:"LAYOUT",icon:"layout",tooltip:"Layout",type:"object",properties:{position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},padding:{type:"object",title:"Padding",display:{type:"padding-controls"},properties:{top:{min:0,step:1,type:"number"},left:{min:0,step:1,type:"number"},right:{min:0,step:1,type:"number"},bottom:{min:0,step:1,type:"number"}}}}},controls:{title:"CONTROLS",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},color:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},area:{title:"AREA",icon:"area",tooltip:"Area",type:"object",properties:{color:{type:"string",display:{type:"settings-color-picker",format:"single"}},blur:{type:"number",label:"icon:blur",display:{type:"numeric-input"}},closeIconUrl:{type:["string","null"],title:"Close Icon",display:{type:"settings-image-input"}},closeIconAlign:{display:{type:"align-grid",direction:"horizontal"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},closeIconScale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},closeIconOffset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},closeIconColor:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},closeIconHover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},caption:{title:"DESC",icon:"text-icon",tooltip:"Description",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}}}},default:{d:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"slide in",duration:"1000ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.01,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:0,bottom:.06,left:0}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},linkColor:"#cccccc",linkHoverColor:"#cccccc"}}},m:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"horiz",duration:"1000ms"},thumbnail:{isActive:!0,position:"bottom-center",fit:"fit",align:"start",triggers:"hov",grid:{size:.1,gap:.05},offset:{x:.01,y:-.05},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.05,bottom:.06,left:.05}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}},t:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.03,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.1,bottom:.06,left:.1}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}}},displayRules:[{if:{name:"lightboxBlock.appear.type",value:"slide in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.slider.direction",value:"vert"},then:{name:"properties.lightboxBlock.properties.thumbnail.properties.align.display.direction",value:"vertical"}},{if:{name:"lightboxBlock.appear.type",value:"mix"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.appear.type",value:"fade in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!1}},{if:[{name:"lightboxBlock.triggers.type",value:"click"},{name:"lightboxBlock.triggers.switch",value:"image"}],then:{name:"properties.lightboxBlock.properties.triggers.properties.repeat.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{label:"Description",placeholder:"Add Caption...",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/2.jpg",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/3.jpg",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/4.jpg",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}};function gi(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function sd(e){return`
|
|
6
|
+
*/const tc="RichTextRenderer-module__link___BWeZ2",nc={link:tc},ic=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(i=>/^\d/.test(i))},qi=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>ic(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function Wt(e){const{color:t,...n}=e;return n}function mt(e,t){var o,l,s;const{fontSize:n,lineHeight:i}=e;return{fontFamily:qi(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:E.scalingValue(e.letterSpacing,t),wordSpacing:E.scalingValue(e.wordSpacing,t),fontSize:E.scalingValue(n,t),lineHeight:i!==void 0?E.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(l=e.textAppearance)==null?void 0:l.textDecoration,fontVariant:(s=e.textAppearance)==null?void 0:s.fontVariant,textAlign:e.textAlign,color:e.color}}const Yn=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:nc.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:oc(i),children:i.text},o));return r.jsx(r.Fragment,{children:e.map((n,i)=>{const o=n.children;return r.jsx("div",{children:t(o)},i)})})};function oc(e){return{...e.fontFamily&&{fontFamily:qi(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 rc="SvgImage-module__svg___q3xE-",ac="SvgImage-module__img___VsTm-",xr={svg:rc,img:ac},lc=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},sc=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,Nt=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[l,s]=c.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return c.useEffect(()=>{if(typeof window<"u"&&window.CSS){const d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');s(d)}},[]),!lc(e)||!l?r.jsx("img",{src:e,alt:"",className:Ve(xr.img,i),style:o}):r.jsx("span",{"data-supports-mask":l,className:Ve(xr.svg,i),style:{"--svg":sc(e),"--fill":t,"--hover-fill":n,...o??{}}})},cc={"top-left":ve.topLeftAlignment,"top-center":ve.topCenterAlignment,"top-right":ve.topRightAlignment,"middle-left":ve.middleLeftAlignment,"middle-center":ve.middleCenterAlignment,"middle-right":ve.middleRightAlignment,"bottom-left":ve.bottomLeftAlignment,"bottom-center":ve.bottomCenterAlignment,"bottom-right":ve.bottomRightAlignment};function dc({settings:e,content:t,styles:n,isEditor:i}){const[o,l]=c.useState(null),{widthSettings:s,fontSettings:d,letterSpacing:a,textAlign:p,wordSpacing:u,fontSizeLineHeight:L,textAppearance:C,color:y}=n.imageCaption??{},[g,h]=c.useState(void 0),[T,$]=c.useState(null),[x,S]=c.useState(0),[H,R]=c.useState(0),{direction:B,transition:w,controls:I,pagination:O,imageCaption:m,triggers:b}=e,P=c.useRef(w.type),{x:F,y:U}=e.controls.offset,J=W=>{o&&o.go(W)};return c.useEffect(()=>{if(!T)return;const W=new ResizeObserver(N=>{if(!o)return;const[v]=N;h({width:Math.round(v.contentRect.width),height:Math.round(v.contentRect.height)})});return W.observe(T),()=>W.unobserve(T)},[T]),c.useEffect(()=>{!o||P.current===w.type||(R(W=>W+1),P.current=w.type)},[w.type]),r.jsx("div",{className:Ve(ve.wrapper,{[ve.editor]:i}),ref:$,children:r.jsxs("div",{className:ve.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:w.backgroundColor&&w.type==="fade in"?w.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:Ve(ve.captionBlock),children:r.jsx("div",{className:ve.captionTextWrapper,children:t.map((W,N)=>r.jsx("div",{className:Ve(ve.captionText,cc[m.alignment],{[ve.withPointerEvents]:N===x&&i,[ve.active]:N===x}),style:{fontFamily:qi(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:s.sizing==="auto"?"max-content":E.scalingValue(s.width,i),letterSpacing:E.scalingValue(a,i),wordSpacing:E.scalingValue(u,i),textAlign:p,fontSize:E.scalingValue(L.fontSize,i),lineHeight:E.scalingValue(L.lineHeight,i),textTransform:C.textTransform??"none",textDecoration:C.textDecoration??"none",fontVariant:C.fontVariant??"normal",color:y,transitionDuration:w.duration?`${Math.round(parseInt(w.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:ve.captionTextInner,style:{"--link-hover-color":m.linkHoverColor,"--link-color":m.linkColor,position:"relative",top:E.scalingValue(m.offset.y,i),left:E.scalingValue(m.offset.x,i)},children:r.jsx(Yn,{content:W.imageCaption})})},N))})}),r.jsx(qo,{onMove:W=>{S(W.index)},ref:l,options:{arrows:!1,speed:w.duration?parseInt(w.duration):500,autoplay:b.autoPlay!==null,...b.autoPlay!==null&&{interval:parseInt(b.autoPlay)*1e3},direction:B==="horiz"||w.type==="fade in"?"ltr":"ttb",pagination:!1,drag:b.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:w.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((W,N)=>r.jsx(Xo,{children:r.jsx("div",{className:ve.sliderItem,children:r.jsx("div",{className:ve.imgWrapper,children:r.jsx("img",{className:Ve(ve.sliderImage,{[ve.contain]:W.image.objectFit==="contain",[ve.cover]:W.image.objectFit==="cover"}),src:W.image.url,alt:W.image.name??""})})})},N))},H),I.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:Ve(ve.arrow,{[ve.arrowVertical]:B==="vert",[ve.hoverArrow]:I.show==="on hover"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:r.jsxs("button",{onClick:()=>{J("-1")},className:ve.arrowInner,style:{transform:`translate(${E.scalingValue(F,i)}, ${E.scalingValue(U*(B==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[I.arrowsImgUrl&&r.jsx(Nt,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:Ve(ve.arrowImg,ve.mirror)}),!I.arrowsImgUrl&&r.jsx(Sr,{color:I.color,className:Ve(ve.arrowIcon,ve.arrowImg,ve.mirror)})]})}),r.jsx("div",{className:Ve(ve.arrow,ve.nextArrow,{[ve.arrowVertical]:B==="vert",[ve.hoverArrow]:I.show==="on hover"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:r.jsxs("button",{className:ve.arrowInner,onClick:()=>J("+1"),style:{transform:`translate(${E.scalingValue(F*(B==="horiz"?-1:1),i)}, ${E.scalingValue(U,i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[I.arrowsImgUrl&&r.jsx(Nt,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:ve.arrowImg}),!I.arrowsImgUrl&&r.jsx(Sr,{color:I.color,className:Ve(ve.arrowIcon,ve.arrowImg)})]})})]}),b.triggersList.click&&r.jsx("div",{className:ve.clickOverlay,onClick:()=>{o&&o.go("+1")}}),O.isActive&&r.jsx("div",{className:Ve(ve.pagination,{[ve.paginationInsideBottom]:O.position==="inside-1"&&B==="horiz",[ve.paginationInsideTop]:O.position==="inside-2"&&B==="horiz",[ve.paginationOutsideBottom]:O.position==="outside-1"&&B==="horiz",[ve.paginationOutsideTop]:O.position==="outside-2"&&B==="horiz",[ve.paginationInsideLeft]:O.position==="inside-1"&&B==="vert",[ve.paginationInsideRight]:O.position==="inside-2"&&B==="vert",[ve.paginationOutsideLeft]:O.position==="outside-1"&&B==="vert",[ve.paginationOutsideRight]:O.position==="outside-2"&&B==="vert",[ve.paginationVertical]:B==="vert"}),children:r.jsx("div",{className:ve.paginationInner,style:{backgroundColor:O.colors[2],transform:`scale(${O.scale/100}) translate(${E.scalingValue(O.offset.x,i)}, ${E.scalingValue(O.offset.y,i)}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:t.map((W,N)=>r.jsx("button",{onClick:()=>{o&&o.go(N)},className:Ve(ve.paginationItem),children:r.jsx("div",{className:Ve(ve.dot,{[ve.activeDot]:N===x}),style:{backgroundColor:N===x?O.colors[0]:O.colors[1],"--pagination-hover-color":O.hover}})},N))})})]})})}function Sr({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const uc={element:dc,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Slider.mp4"},defaultSize:{d:{width:400,height:400},t:{width:400,height:400},m:{width:300,height:300}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.arrowsImgUrl"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{triggers:{title:"triggers",icon:"target",tooltip:"Triggers",type:"object",properties:{triggersList:{type:"object",display:{type:"toggle-ratio-group"},properties:{click:{type:"boolean"},drag:{type:"boolean"}}},autoPlay:{type:["string","null"],label:"Auto",display:{type:"step-selector"},enum:[null,"1s","2s","3s","4s","5s"]}}},direction:{icon:"horizontal-resize",tooltip:"Direction",type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},transition:{title:"transit",icon:"transition",tooltip:"Transition",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade in"]},backgroundColor:{type:["string","null"],title:"BG Color",display:{visible:!1,type:"settings-color-picker",format:"single"}},duration:{type:"string",label:"icon:hourglass",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},controls:{title:"controls",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:50,max:600,display:{type:"range-control"}},color:{title:"color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}},show:{title:"Show",type:"string",display:{type:"ratio-group"},enum:["always","on hover"]}}},pagination:{title:"nav",icon:"pagination",tooltip:"Navigation",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"socket",direction:"horizontal"},type:"string",enum:["outside-1","outside-2","inside-1","inside-2"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:10,max:400,display:{type:"range-control"}},colors:{display:{type:"settings-color-picker",format:"multiple"},title:"color",type:"array",items:{type:"string"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},imageCaption:{title:"Caption",icon:"text-icon",tooltip:"Caption",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}},default:{triggers:{triggersList:{click:!1,drag:!0},autoPlay:null},controls:{isActive:!0,arrowsImgUrl:null,offset:{x:0,y:0},scale:100,color:"#000000",hover:"#cccccc",show:"always"},transition:{type:"slide",duration:"500ms",backgroundColor:null},pagination:{isActive:!0,scale:50,position:"inside-1",offset:{x:0,y:0},colors:["#cccccc","#cccccc","#000000"],hover:"#cccccc"},direction:"horiz",imageCaption:{offset:{x:0,y:0},isActive:!0,alignment:"middle-center",linkColor:"#cccccc",linkHoverColor:"#cccccc"}},displayRules:[{if:{name:"direction",value:"vert"},then:{name:"properties.pagination.properties.position.display.direction",value:"vertical"}},{if:{name:"transition.type",value:"fade in"},then:{name:"properties.transition.properties.backgroundColor.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{placeholder:"Add Caption...",label:"Description",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}},pc="ImageRevealSlider-module__imageRevealSlider___UE5Ob",mc="ImageRevealSlider-module__image___Qjt-e",gc="ImageRevealSlider-module__link___N-iLG",hc="ImageRevealSlider-module__cursor___2U03d",Sn={imageRevealSlider:pc,image:mc,link:gc,cursor:hc};function Cr(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const l=i.width?Number.parseFloat(i.width):o.naturalWidth,s=o.naturalHeight/o.naturalWidth*l,d=l/2,a=s/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-a&&t<=i.y+a)return!0}return!1}function io(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function fc(e,t,n,i){let o,l;if(t==="custom"){o=n;const s=await io(e);l=s.height/s.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const s=await io(e);l=s.height/s.width*o}else{const s=await io(e);o=s.width,l=s.height}return{width:o,height:l,finalWidth:`${o}px`}}function yc({settings:e,content:t,isEditor:n}){const[i,o]=c.useState(null),[l,s]=c.useState([]),[d,a]=c.useState(0),p=c.useRef(0),[u,L]=c.useState({x:0,y:0}),[C,y]=c.useState(1),[g,h]=c.useState("none"),T=c.useRef({x:0,y:0}),[$,x]=c.useState(!1),{sizeType:S,imageWidth:H,randomRangeImageWidth:R}=e.imageSize,{revealPosition:B,visible:w}=e.position,{cursorType:I,target:O,defaultCursorScale:m,defaultCursor:b,hoverCursorScale:P,hoverCursor:F}=e.cursor;c.useEffect(()=>{if(!i)return;const W=(_,A)=>{const j=i.getBoundingClientRect(),z=_-j.left,Q=A-j.top;if(L({x:z,y:Q}),I==="system"){h("none"),y(1);return}const M=z,ne=Q,f=document.elementFromPoint(j.left+M,j.top+ne);if(f&&f.closest("a")){h("none"),y(1);return}const ie=Cr(M,ne,l)||O==="area"?{img:F??"none",scale:P}:{img:b??"none",scale:m};h(ie.img),y(ie.scale)},N=_=>{_.stopPropagation(),T.current={x:_.clientX,y:_.clientY},W(_.clientX,_.clientY)},v=()=>{$&&W(T.current.x,T.current.y)};return i.addEventListener("mousemove",N),window.addEventListener("scroll",v,!0),()=>{i.removeEventListener("mousemove",N),window.removeEventListener("scroll",v,!0)}},[i,$,u,I,O,F,b,P,m,l]),c.useEffect(()=>{$||(h("none"),y(0))},[$]);const U=async(W,N,v,_={})=>{const{width:A,height:j,finalWidth:z}=await fc(W.image.url,S,H,R);let Q=0,M=0;B==="same"?(Q=N/2,M=v/2):(Q=_.x??Math.random()*N,M=_.y??Math.random()*v);const ne=Math.min(Math.max(Q,A/2),N-A/2),f=Math.min(Math.max(M,j/2),v-j/2);return{id:p.current++,url:W.image.url,link:W.link,name:W.image.name,x:ne,y:f,width:z}};c.useEffect(()=>{if(!i||t.length===0)return;const W=i.getBoundingClientRect(),N=W.width,v=W.height,_=[];(async()=>{const j=t[0],z=await U(j,N,v);_.push(z),s(_),a(1)})()},[S,H,R,B,i]),c.useEffect(()=>{w==="last One"&&s(W=>W.length>0?[W[W.length-1]]:[])},[w]);const J=async W=>{if(!i)return;const N=i.getBoundingClientRect(),v=W.clientX-N.left,_=W.clientY-N.top;if(O==="image"&&!Cr(v,_,l))return;let A=0,j=0;B==="on Click"?(A=v,j=_):B==="same"?(A=N.width/2,j=N.height/2):(A=Math.random()*N.width,j=Math.random()*N.height);const z=t[d],Q=await U(z,N.width,N.height,{x:A,y:j});s(M=>w==="all"?[...M,Q]:[Q]),a(M=>M>=t.length-1?0:M+1)};return r.jsxs("div",{ref:o,onClick:J,onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),className:Sn.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[l.map(W=>r.jsx("div",{className:Sn.wrapper,style:{top:`${W.y}px`,left:`${W.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:W.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:O==="area"&&W.link?r.jsx("a",{href:W.link,target:"_blank",className:Sn.link,children:r.jsx("img",{src:W.url,alt:W.name,className:Sn.image},W.id)}):r.jsx("img",{src:W.url,alt:W.name,className:Sn.image},W.id)},W.id)),$&&r.jsx("div",{className:Sn.cursor,style:{left:`${u.x}px`,top:`${u.y}px`,transform:`translate(-50%, -50%) scale(${C})`,backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const vc={element:yc,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Click_Gallery.mp4"},defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.cursor.defaultCursor"},{path:"settings.cursor.hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{imageSize:{title:"IMG SIZE",icon:"size",tooltip:"IMG SIZE",type:"object",properties:{sizeType:{type:"string",display:{type:"ratio-group"},enum:["as Is","custom","random"]},imageWidth:{type:"number",label:"W",display:{type:"numeric-input",visible:!1}},randomRangeImageWidth:{type:"object",display:{type:"random-range-controls",visible:!1},properties:{min:{type:"number"},max:{type:"number"}}}}},cursor:{title:"cursor",icon:"cursor",tooltip:"cursor",type:"object",properties:{cursorType:{type:"string",display:{type:"ratio-group"},enum:["system","custom"]},target:{type:"string",title:"Target",display:{type:"ratio-group"},enum:["area","image"]},defaultCursor:{type:["string","null"],title:"Default",display:{type:"settings-image-input",visible:!1}},defaultCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}},hoverCursor:{type:["string","null"],title:"Hover",display:{type:"settings-image-input",visible:!1}},hoverCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}}}},position:{title:"position",icon:"transition",tooltip:"Position",type:"object",properties:{revealPosition:{type:"string",display:{type:"ratio-group"},enum:["random","same","on Click"]},visible:{type:"string",title:"Visible",display:{type:"ratio-group"},enum:["all","last One"]}}}},default:{imageSize:{sizeType:"custom",imageWidth:500,randomRangeImageWidth:{min:100,max:1e3}},cursor:{cursorType:"system",target:"area",defaultCursor:null,defaultCursorScale:2,hoverCursor:null,hoverCursorScale:2},position:{revealPosition:"random",visible:"all"}},displayRules:[{if:{name:"imageSize.sizeType",value:"custom"},then:{name:"properties.imageSize.properties.imageWidth.display.visible",value:!0}},{if:{name:"imageSize.sizeType",value:"random"},then:{name:"properties.imageSize.properties.randomRangeImageWidth.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"}],then:{name:"properties.cursor.properties.defaultCursor.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"},{name:"cursor.defaultCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.defaultCursorScale.display.visible",value:!0}},{if:{name:"cursor.cursorType",value:"custom"},then:{name:"properties.cursor.properties.hoverCursor.display.visible",value:!0}},{if:[{name:"cursor.cursorType",value:"custom"},{name:"cursor.hoverCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.hoverCursorScale.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQP84JKRDT7WNWDQZR4Y9.png",name:"Slider-4.png"},link:""}]}}}},bc="LightBox-module__hidden___9s-9x",xc="LightBox-module__heroImage___sTxNF",Sc="LightBox-module__background___rm9ml",Cc="LightBox-module__editor___4ACaY",$c="LightBox-module__contentStyle___Bgnsq",wc="LightBox-module__imageStyle___tLIlB",Tc="LightBox-module__imgWrapper___LuFUp",Lc="LightBox-module__contain___8-yaS",Ec="LightBox-module__cover___hNvOG",Ic="LightBox-module__caption___b6L2I",Rc="LightBox-module__captionTextInner___rCGNH",Pc="LightBox-module__lightboxSplide___XFuWC",_c="LightBox-module__arrow___iz38X",Ac="LightBox-module__arrowVertical___Zfz81",Mc="LightBox-module__nextArrow___zkAQN",kc="LightBox-module__arrowInner___p48sW",Fc="LightBox-module__arrowIcon___3VaFf",Wc="LightBox-module__arrowImg___pNV88",Nc="LightBox-module__mirror___pjeXc",Hc="LightBox-module__thumbsWrapper___GB-nU",Bc="LightBox-module__thumbsContainerVertical___wttk5",Oc="LightBox-module__thumbsContainer___osSma",jc="LightBox-module__thumbsAlignStart___MO6tY",Dc="LightBox-module__thumbsAlignCenter___Q4sUx",zc="LightBox-module__thumbsAlignEnd___p4y9R",Vc="LightBox-module__thumbItem___HvnF3",Gc="LightBox-module__closeButton___g2khP",Uc="LightBox-module__fadeIn___0m5GW",Kc="LightBox-module__slideInLeft___gPYwC",qc="LightBox-module__slideInRight___S-pPp",Xc="LightBox-module__slideInTop___DFdAj",Yc="LightBox-module__slideInBottom___m27kZ",Jc="LightBox-module__fadeOut___55qBR",Zc="LightBox-module__slideOutLeft___NvU7P",Qc="LightBox-module__slideOutRight___SK7eC",ed="LightBox-module__slideOutTop___Vgg0z",td="LightBox-module__slideOutBottom___nJ0Ef",nd="LightBox-module__scaleSlide___vZriG",ce={hidden:bc,heroImage:xc,background:Sc,editor:Cc,contentStyle:$c,imageStyle:wc,imgWrapper:Tc,contain:Lc,cover:Ec,caption:Ic,captionTextInner:Rc,lightboxSplide:Pc,arrow:_c,arrowVertical:Ac,nextArrow:Mc,arrowInner:kc,arrowIcon:Fc,arrowImg:Wc,mirror:Nc,thumbsWrapper:Hc,thumbsContainerVertical:Bc,thumbsContainer:Oc,thumbsAlignStart:jc,thumbsAlignCenter:Dc,thumbsAlignEnd:zc,thumbItem:Vc,closeButton:Gc,fadeIn:Uc,slideInLeft:Kc,slideInRight:qc,slideInTop:Xc,slideInBottom:Yc,fadeOut:Jc,slideOutLeft:Zc,slideOutRight:Qc,slideOutTop:ed,slideOutBottom:td,scaleSlide:nd},mi=(e,t,n)=>{const i={},[o,l]=e.split("-");return o==="top"?(i.top="0",i.bottom="auto"):o==="middle"?(i.top="50%",i.bottom="auto"):o==="bottom"&&(i.top="auto",i.bottom="0"),l==="left"?(i.left="0",i.right="auto"):l==="center"?(i.left="50%",i.right="auto"):l==="right"&&(i.left="auto",i.right="0"),o==="middle"&&l==="center"?i.transform=`translate(calc(-50% + ${E.scalingValue(t.x,n)}), calc(-50% + ${E.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${E.scalingValue(t.x,n)}, calc(-50% + ${E.scalingValue(t.y,n)}))`:l==="center"?i.transform=`translate(calc(-50% + ${E.scalingValue(t.x,n)}), ${E.scalingValue(t.y,n)})`:i.transform=`translate(${E.scalingValue(t.x,n)}, ${E.scalingValue(t.y,n)})`,i};function Oa(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 $r(e){const t=e.getBoundingClientRect(),n=Oa(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),l=e.naturalWidth,s=e.naturalHeight,d=i/o,a=l/s;let p,u;a>d?(p=i,u=i/a):(u=o,p=o*a);const L=t.left+n.left,C=t.top+n.top,y=(i-p)/2+L,g=(o-u)/2+C;return{x:y,y:g,width:p,height:u}}function wr(e){const t=e.getBoundingClientRect(),n=Oa(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Tr(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const i=t[1].split(",").map(o=>parseFloat(o.trim()));return i.length===4?i[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const i=n[1].substring(6,8);return parseInt(i,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function id(e,t){const n=(()=>{if(e==="fade in")return ce.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return ce.slideInLeft;case"right":return ce.slideInRight;case"top":return ce.slideInTop;case"bottom":return ce.slideInBottom;default:return ce.slideInRight}return ce.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return ce.fadeIn;if(e==="slide in")switch(t){case"left":return ce.slideInLeft;case"right":return ce.slideInRight;case"top":return ce.slideInTop;case"bottom":return ce.slideInBottom;default:return ce.slideInRight}return ce.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return ce.fadeOut;if(e==="slide in")switch(t){case"left":return ce.slideOutLeft;case"right":return ce.slideOutRight;case"top":return ce.slideOutTop;case"bottom":return ce.slideOutBottom;default:return ce.slideOutRight}return ce.fadeOut})(),l=(()=>{if(e==="fade in")return ce.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return ce.slideOutLeft;case"right":return ce.slideOutRight;case"top":return ce.slideOutTop;case"bottom":return ce.slideOutBottom;default:return ce.slideOutRight}return ce.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:l}}const od=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:l,isPreviewMode:s})=>{const[d,a]=c.useState(!1),{url:p}=e.thumbnailBlock.cover;return c.useEffect(()=>{o==="close"&&a(!1),o==="open"&&a(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:p,alt:"Cover",className:ce.heroImage,onClick:()=>a(!0)}),r.jsx(rd,{isOpen:d,onClose:()=>a(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:l})]})},rd=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:l,isEditor:s,metadata:d})=>{var Ie;const{widthSettings:a,fontSettings:p,letterSpacing:u,textAlign:L,wordSpacing:C,fontSizeLineHeight:y,textAppearance:g,color:h}=i.imageCaption??{},[T,$]=c.useState(0),[x,S]=c.useState(0),[H,R]=c.useState(!1),[B,w]=c.useState(!1),[I,O]=c.useState({}),m=c.useRef(null),b=c.useRef(null),P=c.useRef(null),F=c.useRef(!1),U=c.useRef(null),J=c.useRef(null),W=c.useRef(null),N=c.useRef(null),v=c.useRef(!1),_=c.useRef(null),[A,j]=c.useState(!1),{appear:z,triggers:Q,slider:M,thumbnail:ne,controls:f,area:ie,caption:ye,layout:te}=o.lightboxBlock,{appearClass:he,backdropAppearClass:oe,backdropDisappearClass:ue,disappearClass:V}=id(z.type,z.direction),Y=(d==null?void 0:d.itemId)??null;c.useEffect(()=>{const D=()=>{setTimeout(()=>{var k,K;(K=(k=m.current)==null?void 0:k.splide)==null||K.refresh()},16)},se=()=>{S(k=>k+1)};return window.addEventListener("ArticleEditor.Layout:change",D),window.addEventListener("ArticleEditor.ComponentContent:change",se),()=>{window.removeEventListener("ArticleEditor.Layout:change",D),window.removeEventListener("ArticleEditor.ComponentContent:change",se)}},[]),c.useEffect(()=>{if(!e||!ne.isActive){j(!1);return}const D=_.current;if(!D)return;const se=()=>{M.direction==="horiz"?j(D.scrollWidth>D.clientWidth):j(D.scrollHeight>D.clientHeight)};se();const k=new ResizeObserver(se);return k.observe(D),()=>k.disconnect()},[e,ne.isActive,n.length,I,M.direction]);const le=c.useCallback(()=>{const D=window.matchMedia("(max-width: 768px)").matches,se=Tr(ie.color);D&&!s&&se>.9&&(document.body.style.backgroundColor=""),R(!0),F.current=!0;const k=K=>{K.target===U.current&&K.animationName&&(U.current&&J.current&&U.current.removeEventListener("animationend",J.current),J.current=null,F.current&&(F.current=!1,t()),R(!1))};U.current&&(J.current=k,U.current.addEventListener("animationend",k))},[t,ie.color,s]),de=(D,se,k)=>{var K,q;if(D){if(Q.type==="click"&&Q.switch==="image")Q.repeat==="close"&&T===n.length-1?le():(K=m.current)==null||K.go("+1");else if(Q.type==="click"&&Q.switch==="50/50"){const Z=D.getBoundingClientRect(),ae=se-Z.left,ge=k-Z.top,Fe=Z.width,$e=Z.height;let we;M.direction==="horiz"?we=ae<Fe/2?"-1":"+1":we=ge<$e/2?"-1":"+1",(q=m.current)==null||q.go(we)}}},Ce=D=>{if(v.current){v.current=!1;return}const se=n[T],k=(se==null?void 0:se.image.objectFit)==="cover";let K,q;if("changedTouches"in D&&D.changedTouches.length>0)K=D.changedTouches[0].clientX,q=D.changedTouches[0].clientY;else if("clientX"in D)K=D.clientX,q=D.clientY;else return;let Z;if(k&&P.current){const ae=wr(P.current);Z=K>=ae.left&&K<=ae.right&&q>=ae.top&&q<=ae.bottom}else{const ae=P.current?$r(P.current):null;if(!ae){D.target===D.currentTarget&&le();return}Z=K>=ae.x&&K<=ae.x+ae.width&&q>=ae.y&&q<=ae.y+ae.height}Z?de(P.current,K,q):le()},Pe=D=>{const se=D.target;(se.classList.contains(ce.thumbsWrapper)||se.classList.contains(ce.thumbsContainer))&&Ce(D)};c.useEffect(()=>{if(!e)return;const D=se=>{var k,K;if(se.key==="Escape"){le();return}if(se.key==="ArrowRight"){$(q=>(q+1)%Math.max(n.length,1)),(k=m.current)==null||k.go("+1");return}se.key==="ArrowLeft"&&($(q=>(q-1+Math.max(n.length,1))%Math.max(n.length,1)),(K=m.current)==null||K.go("-1"))};return window.addEventListener("keydown",D),()=>{window.removeEventListener("keydown",D)}},[e,le,n.length]),c.useEffect(()=>{if(e){if($(0),S(se=>se+1),F.current=!1,R(!1),w(!1),O({}),!Y)return;const D=new CustomEvent("page-overlay",{detail:{itemId:Y}});window.dispatchEvent(D)}return()=>{U.current&&J.current&&(U.current.removeEventListener("animationend",J.current),J.current=null),w(!1)}},[e,Y]),c.useEffect(()=>{b.current!==null&&b.current!==M.type&&S(D=>D+1),b.current=M.type},[M.type]),c.useEffect(()=>{if(!e)return;const D=document.body.style.overflow,se=window.matchMedia("(max-width: 768px)").matches,k=Tr(ie.color);document.body.style.overflow="hidden",w(!1);const K=Z=>{Z.target===U.current&&!F.current&&Z.animationName&&(se&&!s&&k>.9&&(document.body.style.backgroundColor=ie.color),w(!0),U.current&&W.current&&U.current.removeEventListener("animationend",W.current),W.current=null)};U.current&&(W.current=K,U.current.addEventListener("animationend",K));const q=Z=>{const ae=Z.target;ae&&(ae.closest(`.${ce.thumbsWrapper}`)||ae.closest(`.${ce.thumbsContainer}`))||M.type!=="slide"&&Z.preventDefault()};return document.addEventListener("touchmove",q,{passive:!1}),()=>{document.body.style.overflow=D,document.removeEventListener("touchmove",q),U.current&&W.current&&(U.current.removeEventListener("animationend",W.current),W.current=null),w(!1)}},[e,s,ie.color,M.type]),c.useEffect(()=>{if(!e)return;const D=se=>{var K,q;if(F.current){se.stopPropagation();return}if(v.current){v.current=!1;return}const k=se.target;if(!(k&&(k.closest(`.${ce.thumbsContainer}`)||k.closest(`.${ce.thumbItem}`)||k.closest(`.${ce.arrow}`)||k.closest(`.${ce.closeButton}`)||k.closest(`.${ce.caption}`)))){if(M.type==="slide"&&Q.type==="drag"&&((q=(K=m.current)==null?void 0:K.splide)!=null&&q.root)){const Z=m.current.splide.root;if(k&&(Z.contains(k)||Z===k))return}if(se.touches.length===0&&se.changedTouches.length>0){const Z=n[T],ae=(Z==null?void 0:Z.image.objectFit)==="cover",ge=se.changedTouches[0];let Fe;if(ae&&P.current){const $e=wr(P.current);Fe=ge.clientX>=$e.left&&ge.clientX<=$e.right&&ge.clientY>=$e.top&&ge.clientY<=$e.bottom}else{const $e=P.current?$r(P.current):null;if(!$e)return;Fe=ge.clientX>=$e.x&&ge.clientX<=$e.x+$e.width&&ge.clientY>=$e.y&&ge.clientY<=$e.y+$e.height}if(!Fe){se.stopPropagation(),F.current=!0;const $e=we=>{we.stopPropagation(),we.preventDefault(),document.removeEventListener("click",$e,!0)};document.addEventListener("click",$e,!0),le()}}}};return document.addEventListener("touchend",D,{passive:!0}),()=>{document.removeEventListener("touchend",D)}},[e,le,T,n]);const Ee=(M.type==="scale"||M.type==="fade")&&M.direction==="vert"&&Q.type==="drag";c.useEffect(()=>{var we,We;if(!e||!Ee||!((We=(we=m.current)==null?void 0:we.splide)!=null&&We.root))return;const D=m.current.splide.root,se=30,k=(pe,xe)=>{if(N.current){const Te=Math.abs(pe-N.current.x),Ne=Math.abs(xe-N.current.y);(Te>0||Ne>0)&&(v.current=!0)}},K=pe=>{N.current&&(pe.preventDefault(),k(pe.clientX,pe.clientY))},q=pe=>{N.current&&pe.touches.length>0&&(pe.preventDefault(),k(pe.touches[0].clientX,pe.touches[0].clientY))},Z=(pe,xe)=>{if(!N.current||!m.current){N.current=null;return}const Te=Math.abs(pe-N.current.x),Ne=Math.abs(xe-N.current.y);Ne>se&&Ne>Te&&m.current.go(xe<N.current.y?"+1":"-1"),N.current=null},ae=pe=>{N.current&&Z(pe.clientX,pe.clientY),document.removeEventListener("pointerup",ae),document.removeEventListener("pointercancel",ae),document.removeEventListener("pointermove",K)},ge=pe=>{if(N.current){if(pe.changedTouches.length>0){const xe=pe.changedTouches[0];Z(xe.clientX,xe.clientY)}document.removeEventListener("touchend",ge),document.removeEventListener("touchcancel",ge),document.removeEventListener("touchmove",q)}},Fe=pe=>{N.current={x:pe.clientX,y:pe.clientY},v.current=!1,document.addEventListener("pointermove",K,{passive:!1}),document.addEventListener("pointerup",ae),document.addEventListener("pointercancel",ae)},$e=pe=>{pe.touches.length>0&&(N.current={x:pe.touches[0].clientX,y:pe.touches[0].clientY},v.current=!1,document.addEventListener("touchmove",q,{passive:!1}),document.addEventListener("touchend",ge),document.addEventListener("touchcancel",ge))};return D.addEventListener("pointerdown",Fe),D.addEventListener("touchstart",$e),()=>{D.removeEventListener("pointerdown",Fe),D.removeEventListener("touchstart",$e),document.removeEventListener("pointermove",K),document.removeEventListener("pointerup",ae),document.removeEventListener("pointercancel",ae),document.removeEventListener("touchmove",q),document.removeEventListener("touchend",ge),document.removeEventListener("touchcancel",ge),N.current=null,v.current=!1}},[e,Ee,x]);const ke={backgroundColor:ie.color,backdropFilter:`blur(${ie.blur}px)`,animationDuration:`${parseInt(z.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(l)?null:ei.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:s?null:U,className:Ve(ce.background,H?ue:oe,{[ce.editor]:s},{[ce.hidden]:!e}),style:{...ke,...B&&!s&&!H?{position:"absolute"}:{}}}),r.jsxs("div",{ref:s?U:null,className:Ve(ce.contentStyle,H?V:he,{[ce.editor]:s},{[ce.hidden]:!e}),style:{animationDuration:`${parseInt(z.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(qo,{onMove:D=>$(D.index),ref:m,className:ce.lightboxSplide,options:{arrows:!1,speed:M.duration?parseInt(M.duration):500,direction:M.direction==="horiz"||M.type==="fade"||M.type==="scale"?"ltr":"ttb",pagination:!1,drag:Q.type==="drag"&&!Ee,perPage:1,width:"100%",height:"100%",type:M.type==="fade"||M.type==="scale"?"fade":"loop",padding:0,rewind:Q.repeat!=="close",start:0},style:{"--splide-speed":M.duration},children:n.map((D,se)=>{const k=mi(te.position,te.offset,s),K=`${E.scalingValue(te.padding.top,s)} ${E.scalingValue(te.padding.right,s)} ${E.scalingValue(te.padding.bottom,s)} ${E.scalingValue(te.padding.left,s)}`,q=M.type==="scale"?(()=>{const{transform:Z,...ae}=k;return{...ae,position:"absolute",padding:K,boxSizing:"border-box","--position-transform":Z||"none"}})():{...k,position:"absolute",padding:K,boxSizing:"border-box"};return r.jsx(Xo,{children:r.jsx("div",{className:ce.imgWrapper,onClick:Ce,children:r.jsx("img",{ref:se===T?P:null,className:Ve(ce.imageStyle,{[ce.contain]:D.image.objectFit==="contain",[ce.cover]:D.image.objectFit==="cover",[ce.scaleSlide]:M.type==="scale"}),src:D.image.url,alt:D.image.name??"",style:{...q,pointerEvents:D.image.objectFit==="contain"?"none":"auto"}})})},se)})},x),f.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:Ve(ce.arrow,{[ce.arrowVertical]:M.direction==="vert"}),style:{color:f.color,"--arrow-hover-color":f.hover},children:r.jsxs("button",{className:ce.arrowInner,style:{transform:`translate(${E.scalingValue(f.offset.x,s)}, ${E.scalingValue(f.offset.y*(M.direction==="horiz"?1:-1),s)}) scale(${f.scale}) rotate(${M.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var D;return(D=m.current)==null?void 0:D.go("-1")},"aria-label":"Previous",children:[f.arrowsImgUrl&&r.jsx(Nt,{url:f.arrowsImgUrl,fill:f.color,hoverFill:f.hover,className:Ve(ce.arrowImg,ce.mirror)}),!f.arrowsImgUrl&&r.jsx(Lr,{color:f.color,className:Ve(ce.arrowIcon,ce.arrowImg,ce.mirror)})]})}),r.jsx("div",{className:Ve(ce.arrow,ce.nextArrow,{[ce.arrowVertical]:M.direction==="vert"}),style:{color:f.color,"--arrow-hover-color":f.hover},children:r.jsxs("button",{className:ce.arrowInner,style:{transform:`translate(${E.scalingValue(f.offset.x*(M.direction==="horiz"?-1:1),s)}, ${E.scalingValue(f.offset.y,s)}) scale(${f.scale}) rotate(${M.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var D;return(D=m.current)==null?void 0:D.go("+1")},"aria-label":"Next",children:[f.arrowsImgUrl&&r.jsx(Nt,{url:f.arrowsImgUrl,fill:f.color,hoverFill:f.hover,className:ce.arrowImg}),!f.arrowsImgUrl&&r.jsx(Lr,{color:f.color,className:Ve(ce.arrowIcon,ce.arrowImg)})]})})]}),ie.closeIconUrl&&(()=>{const D=mi(ie.closeIconAlign,ie.closeIconOffset,s),se=`scale(${ie.closeIconScale})`,k=D.transform?`${D.transform} ${se}`:se;return r.jsx("button",{className:ce.closeButton,style:{...D,transform:k},onClick:le,"aria-label":"Close lightbox",children:r.jsx(Nt,{url:ie.closeIconUrl,fill:ie.closeIconColor??"#000000",hoverFill:ie.closeIconHover??"#cccccc"})})})(),ye&&ye.isActive&&i.imageCaption&&((Ie=n[T])==null?void 0:Ie.imageCaption)&&r.jsx("div",{className:ce.caption,style:{...mi(ye.alignment,ye.offset,s),fontFamily:qi(p.fontFamily),fontWeight:p.fontWeight,fontStyle:p.fontStyle,width:a.sizing==="auto"?"max-content":E.scalingValue(a.width,s),letterSpacing:E.scalingValue(u,s),wordSpacing:E.scalingValue(C,s),textAlign:L,fontSize:E.scalingValue(y.fontSize,s),lineHeight:E.scalingValue(y.lineHeight,s),textTransform:g.textTransform??"none",textDecoration:g.textDecoration??"none",fontVariant:g.fontVariant??"normal",color:h},onClick:D=>D.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:ce.captionTextInner,style:{"--link-color":ye.linkColor,"--link-hover-color":ye.linkHoverColor},children:r.jsx(Yn,{content:n[T].imageCaption})})}),ne.isActive&&(()=>{const[D,se]=ne.position.split("-"),k=M.direction==="horiz"?`${D}-left`:ne.position,K=mi(k,ne.offset,s),q=()=>{if(M.direction==="horiz"){if(se==="left")return"flex-start";if(se==="center")return"center";if(se==="right")return"flex-end"}else{if(D==="top")return"flex-start";if(D==="middle")return"center";if(D==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:_,className:ce.thumbsWrapper,onClick:Z=>Pe(Z),style:{position:s?"absolute":"fixed",...K,...M.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:Ve(ce.thumbsContainer,{[ce.thumbsContainerVertical]:M.direction==="vert",[ce.thumbsAlignStart]:ne.align==="start",[ce.thumbsAlignCenter]:ne.align==="center",[ce.thumbsAlignEnd]:ne.align==="end"}),style:{gap:E.scalingValue(ne.grid.gap,s),justifyContent:A?"flex-start":q()},children:n.map((Z,ae)=>{const ge=ae===T,Fe=I[ae],we=ne.grid.size*(ge?ne.activeState.scale:1),We=()=>{if(ne.fit!=="fit")return{};if(!Fe)return M.direction==="horiz"?{height:E.scalingValue(we,s)}:{width:E.scalingValue(we,s)};const pe=Fe.width/Fe.height;if(M.direction==="horiz"){const xe=we,Te=xe*pe;return{width:E.scalingValue(Te,s),height:E.scalingValue(xe,s)}}else{const xe=we,Te=xe/pe;return{width:E.scalingValue(xe,s),height:E.scalingValue(Te,s)}}};return r.jsx("button",{className:ce.thumbItem,style:{...M.direction==="horiz"&&ne.fit!=="fit"?{height:E.scalingValue(we,s)}:{},...M.direction==="vert"&&ne.fit!=="fit"?{width:E.scalingValue(we,s)}:{},...ne.fit==="cover"?{width:E.scalingValue(we,s),height:E.scalingValue(we,s)}:{},...We(),transition:ge?"all 0.25s ease-out":"none",opacity:ge?ne.activeState.opacity/100:ne.opacity/100,"--thumb-hover":ne.activeState.opacity/100},onClick:pe=>{var xe;pe.stopPropagation(),$(ae),(xe=m.current)==null||xe.go(ae)},onMouseEnter:()=>{var pe;ne.triggers==="hov"&&((pe=m.current)==null||pe.go(ae))},children:r.jsx("img",{src:Z.image.url,alt:Z.image.name??"",onLoad:pe=>{const xe=pe.currentTarget;xe.naturalWidth&&xe.naturalHeight&&O(Te=>({...Te,[ae]:{width:xe.naturalWidth,height:xe.naturalHeight}}))},style:{objectFit:ne.fit==="cover"?"cover":"contain",...ne.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...ne.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Z.image.name}-${ae}`)})})})})()]})]}),document.getElementById(l))};function Lr({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const ad={element:od,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Lightbox.png"},defaultSize:{d:{width:440,height:550},t:{width:235,height:293},m:{width:265,height:331}},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.thumbnailBlock.cover.url",placeholderEnabled:!0},{path:"settings.controls.arrowsImgUrl"},{path:"settings.area.closeIconUrl"}]},schema:{type:"object",properties:{settings:{type:"object",properties:{thumbnailBlock:{display:{type:"settings-block",triggerEvent:"close"},type:"object",properties:{cover:{title:"COVER",icon:"cover",tooltip:"Cover Image",type:"object",properties:{url:{type:"string",display:{type:"cover-image-input"}}}}}},lightboxBlock:{display:{type:"settings-block",triggerEvent:"open"},type:"object",properties:{appear:{title:"APPEAR",icon:"transition",tooltip:"Appearance",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide in","fade in","mix"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]},direction:{type:"string",title:"From",display:{type:"direction-control"},enum:["top","left","right","bottom"]}}},triggers:{title:"TRIGGERS",icon:"target",tooltip:"Triggers",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["click","drag"]},switch:{type:"string",display:{type:"ratio-group"},enum:["image","50/50"]},repeat:{type:"string",title:"Repeat",display:{visible:!1,type:"ratio-group"},enum:["close","loop"]}}},slider:{title:"SLIDER",icon:"horizontal-resize",tooltip:"Slider",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade","scale"]},direction:{type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},thumbnail:{title:"THUMB",icon:"thumbnail",tooltip:"Thumbnail",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},fit:{type:"string",display:{type:"ratio-group"},enum:["cover","fit"]},align:{type:"string",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},triggers:{type:"string",title:"Triggers",display:{type:"ratio-group",direction:"horizontal"},enum:["clk","hov"]},grid:{type:"object",title:"Grid",display:{type:"group"},properties:{size:{type:"number",label:"Box",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},gap:{type:"number",label:"Gap",scalingEnabled:!0,min:0,display:{type:"numeric-input"}}}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}},activeState:{type:"object",title:"ACTIVE",display:{type:"group"},properties:{scale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control"}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}}}}}},layout:{title:"LAYOUT",icon:"layout",tooltip:"Layout",type:"object",properties:{position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},padding:{type:"object",title:"Padding",display:{type:"padding-controls"},properties:{top:{min:0,step:1,type:"number"},left:{min:0,step:1,type:"number"},right:{min:0,step:1,type:"number"},bottom:{min:0,step:1,type:"number"}}}}},controls:{title:"CONTROLS",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},color:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},area:{title:"AREA",icon:"area",tooltip:"Area",type:"object",properties:{color:{type:"string",display:{type:"settings-color-picker",format:"single"}},blur:{type:"number",label:"icon:blur",display:{type:"numeric-input"}},closeIconUrl:{type:["string","null"],title:"Close Icon",display:{type:"settings-image-input"}},closeIconAlign:{display:{type:"align-grid",direction:"horizontal"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},closeIconScale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},closeIconOffset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},closeIconColor:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},closeIconHover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},caption:{title:"DESC",icon:"text-icon",tooltip:"Description",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}}}},default:{d:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"slide in",duration:"1000ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.01,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:0,bottom:.06,left:0}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},linkColor:"#cccccc",linkHoverColor:"#cccccc"}}},m:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"horiz",duration:"1000ms"},thumbnail:{isActive:!0,position:"bottom-center",fit:"fit",align:"start",triggers:"hov",grid:{size:.1,gap:.05},offset:{x:.01,y:-.05},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.05,bottom:.06,left:.05}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}},t:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.03,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.1,bottom:.06,left:.1}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}}},displayRules:[{if:{name:"lightboxBlock.appear.type",value:"slide in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.slider.direction",value:"vert"},then:{name:"properties.lightboxBlock.properties.thumbnail.properties.align.display.direction",value:"vertical"}},{if:{name:"lightboxBlock.appear.type",value:"mix"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.appear.type",value:"fade in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!1}},{if:[{name:"lightboxBlock.triggers.type",value:"click"},{name:"lightboxBlock.triggers.switch",value:"image"}],then:{name:"properties.lightboxBlock.properties.triggers.properties.repeat.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{label:"Description",placeholder:"Add Caption...",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/2.jpg",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/3.jpg",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/4.jpg",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}};function gi(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function ld(e){return`
|
|
7
7
|
.${e}-wrapper {
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
pointer-events: auto;
|
|
156
156
|
z-index: 10;
|
|
157
157
|
}
|
|
158
|
-
`}function
|
|
158
|
+
`}function sd({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:l}){const s=!!n,d=i&&t||!t,{prefix:a}=E.useScopedStyles(),{type:p="A",fieldsToShow:u=2,fields:L=[],buttonLabel:C,gap:y,fieldsGap:g,buttonCorners:h,buttonStroke:T,buttonPadding:$,isButtonFullWidth:x,inputCorners:S,inputStroke:H,inputPadding:R,inputColor:B,inputTextColor:w,inputBorderColor:I,placeholderColor:O,buttonColor:m,buttonTextColor:b,buttonBorderColor:P,labelTextColor:F,successColor:U,errorColor:J,fontFamily:W,inputFontSettings:N,inputFontSize:v,inputLineHeight:_,inputLetterSpacing:A,inputWordSpacing:j,inputTextAppearance:z,buttonFontSettings:Q,buttonFontSize:M,buttonLineHeight:ne,buttonLetterSpacing:f,buttonWordSpacing:ie,buttonTextAppearance:ye,labelFontSettings:te,labelFontSize:he,labelLineHeight:oe,labelLetterSpacing:ue,labelWordSpacing:V,labelTextAppearance:Y,statusFontSettings:le,statusFontSize:de,statusLineHeight:Ce,statusLetterSpacing:Pe,statusWordSpacing:Ee,statusTextAppearance:ke,successMessage:Ie,errorMessage:D,stateOverrides:se}=e,k=p==="B",K=L.slice(0,Math.min(u,L.length)),q={fontSettings:{fontFamily:W,fontWeight:(N==null?void 0:N.fontWeight)??400,fontStyle:(N==null?void 0:N.fontStyle)??"normal"},fontSize:v??.01,lineHeight:_,letterSpacing:A??0,wordSpacing:j??0,textAppearance:z,color:w},Z=Wt(mt(q,t)),ae=E.scalingValue(H??0,t),ge=E.scalingValue((_??v??.01)+((R==null?void 0:R.top)??0)+((R==null?void 0:R.bottom)??0)+(p==="C"?H??0:(H??0)*2),t),Fe={...Z,borderStyle:"solid",borderRadius:p==="C"?0:E.scalingValue(S??0,t),...p==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:ae,borderLeftWidth:0}:{borderWidth:ae},paddingTop:E.scalingValue((R==null?void 0:R.top)??0,t),paddingRight:E.scalingValue((R==null?void 0:R.right)??0,t),paddingBottom:E.scalingValue((R==null?void 0:R.bottom)??0,t),paddingLeft:E.scalingValue((R==null?void 0:R.left)??0,t),height:ge,minHeight:ge},$e={fontSettings:{fontFamily:W,fontWeight:(Q==null?void 0:Q.fontWeight)??400,fontStyle:(Q==null?void 0:Q.fontStyle)??"normal"},fontSize:M??.01,lineHeight:ne,letterSpacing:f??0,wordSpacing:ie??0,textAppearance:ye,color:b},we=Wt(mt($e,t)),We=E.scalingValue(T??0,t),pe={fontSettings:{fontFamily:W,fontWeight:(te==null?void 0:te.fontWeight)??400,fontStyle:(te==null?void 0:te.fontStyle)??"normal"},fontSize:he??.01,lineHeight:oe,letterSpacing:ue??0,wordSpacing:V??0,textAppearance:Y,color:F},xe=mt(pe,t),Te={fontSettings:{fontFamily:W,fontWeight:(le==null?void 0:le.fontWeight)??400,fontStyle:(le==null?void 0:le.fontStyle)??"normal"},fontSize:de??.01,lineHeight:Ce,letterSpacing:Pe??0,wordSpacing:Ee??0,textAppearance:ke,color:U},Ne=Wt(mt(Te,t)),Ue=E.buildColorVars(a,{inputColor:B,inputTextColor:w,inputBorderColor:I,placeholderColor:O!=null&&O.trim()?O:"#cccccc",buttonColor:m,buttonTextColor:b,buttonBorderColor:P,labelTextColor:F,successColor:U,errorColor:J},cd,dd,se),[at,lt]=c.useState(()=>Object.fromEntries(K.map(Se=>[Se.name,""]))),[gt,vt]=c.useState("idle"),[ut,bt]=c.useState(null),Ze=l==="success"?"success":l==="error"?"error":gt,_e=l==="error"?D:ut,nt=l==="filled",Qe=c.useMemo(()=>{if(!nt)return at;let Se=null;for(const Je of K)(at[Je.name]??"").trim().length>0||(Se=Se??{...at},Se[Je.name]="Filled");return Se??at},[at,nt,K]),G=Ze==="error"?E.getFormFieldValidationError(K,Qe):null,me=`${l&&l!=="default"?`${a}-state-${l}`:""}`.trim(),Re=o==null?void 0:o.submitUrl,Oe=(Se,Je)=>{lt(ee=>({...ee,[Se]:Je}))},rt=async Se=>{if(Se.preventDefault(),!d)return;const Je=Object.fromEntries(K.map(fe=>{var Ae;return[fe.name,((Ae=at[fe.name])==null?void 0:Ae.trim())??""]}).filter(([,fe])=>fe));if(!Re){vt("error"),bt("No integrations were found for this form.");return}if(Object.keys(Je).length===0)return;const ee=E.getFormFieldValidationError(K,at);if(ee){vt("error"),bt(ee);return}vt("submitting"),bt(null);try{const fe=await fetch(Re,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Je)});if(!fe.ok){const Ae=await fe.text();throw new Error(Ae||`Request failed: ${fe.status}`)}vt("success"),lt(Object.fromEntries(K.map(Ae=>[Ae.name,""])))}catch(fe){vt("error"),bt(fe instanceof Error?fe.message:"Something went wrong")}};return r.jsxs("div",{className:`${a}-wrapper ${a}-type-${p} ${me}`.trim(),style:Ue,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ld(a)}}),r.jsxs("form",{onSubmit:rt,className:`${a}-form`,children:[r.jsx("div",{className:`${a}-fields`,children:K.map((Se,Je)=>r.jsxs(c.Fragment,{children:[Je>0&&r.jsx("div",{"data-controls":s?"fieldsGap":void 0,className:s?`${a}-control`:void 0,style:{height:E.scalingValue(g??0,t)}}),r.jsxs("div",{className:`${a}-field-group${k?` ${a}-labeled`:""}`,children:[k&&r.jsx("span",{className:`${a}-field-label`,style:xe?{...xe,lineHeight:xe.fontSize}:void 0,children:Se.label||Se.name}),Se.type==="textarea"?r.jsx("textarea",{name:Se.name,autoComplete:"off",value:Qe[Se.name]??"",onChange:ee=>Oe(Se.name,ee.target.value),placeholder:Se.placeholder,className:`${a}-input`,style:Fe,rows:1,"data-filled":nt||(Qe[Se.name]??"").trim().length>0,"data-field-type":"textarea"}):r.jsx("input",{type:Se.type==="phone"?"tel":Se.type==="email"?"email":"text",name:Se.name,autoComplete:"off",value:Qe[Se.name]??"",onChange:ee=>Oe(Se.name,ee.target.value),placeholder:Se.placeholder,required:Se.isRequired??Se.type==="email",className:`${a}-input`,style:Fe,"data-filled":nt||(Qe[Se.name]??"").trim().length>0})]})]},Je))}),r.jsx("div",{"data-controls":s?"gap":void 0,className:s?`${a}-control`:void 0,style:{height:E.scalingValue(y??0,t)}}),r.jsx("div",{className:`${a}-overlay-anchor`,children:r.jsx("button",{type:d?"submit":"button",className:`${a}-button`,style:{borderStyle:"solid",borderRadius:E.scalingValue(h??0,t),borderWidth:We,paddingTop:E.scalingValue(($==null?void 0:$.top)??0,t),paddingRight:E.scalingValue(($==null?void 0:$.right)??0,t),paddingBottom:E.scalingValue(($==null?void 0:$.bottom)??0,t),paddingLeft:E.scalingValue(($==null?void 0:$.left)??0,t),pointerEvents:d?"auto":void 0,...we,...x?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:r.jsx("span",{className:`${a}-overlay-anchor`,style:x?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:gt==="submitting"?"...":C})})})]}),Ze==="success"&&r.jsx("p",{className:`${a}-success`,style:{...Ne},children:Ie}),Ze==="error"&&r.jsx("p",{className:`${a}-error`,style:{...Ne},role:"alert",children:G??_e??D})]})}const cd={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"},dd=["hover","focus","filled","success","error"],ud=`import React, { useMemo, useState } from 'react';
|
|
159
159
|
import { CommonComponentProps } from '../props';
|
|
160
160
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
161
161
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -789,7 +789,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
789
789
|
};
|
|
790
790
|
|
|
791
791
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
792
|
-
`,pd=[{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."},{name:"message",type:"textarea",placeholder:"Enter your message",label:"Message",isRequired:!1,error:"Message is required"},{name:"message2",type:"textarea",placeholder:"Enter your message 2",label:"Message 2",isRequired:!1,error:"Message 2 is required"},{name:"message3",type:"textarea",placeholder:"Enter your message 3",label:"Message 3",isRequired:!1,error:"Message 3 is required"}],hi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},md=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],gd={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:7},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B","C"]},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",enabled:!0},min:0,max:100},buttonPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},inputPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},buttonStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"common",title:"Stroke Input",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},isButtonFullWidth:{type:"boolean",scope:"common",title:"Full Width",display:{type:"toggle",enum:["On","Off"]}},buttonBorderColor:{type:"string",scope:"common",title:"Stroke Button",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker",visible:!1}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...hi.fontSettings,scope:"common",title:"Input",display:{type:"font-settings-weight"}},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...hi.fontSettings,scope:"common",title:"Button",display:{type:"font-settings-weight"}},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},labelFontSettings:{...hi.fontSettings,scope:"common",title:"Label",display:{type:"font-settings-weight",visible:!1}},labelFontSize:{type:"number",scope:"layout",title:"Label Font Size",display:{type:"font-size",visible:!1}},labelLineHeight:{type:"number",scope:"layout",title:"Label Line Height",display:{type:"line-height-input",visible:!1}},labelLetterSpacing:{type:"number",scope:"layout",title:"Label Letter Spacing",display:{type:"letter-spacing-input",visible:!1}},labelWordSpacing:{type:"number",scope:"layout",title:"Label Word Spacing",display:{type:"word-spacing-input",visible:!1}},labelTextAppearance:{type:"object",scope:"layout",title:"Label Text Appearance",display:{type:"text-appearance",visible:!1}},statusFontSettings:{...hi.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fieldsToShow:2,fields:pd,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#E2E2E2",placeholderColor:"#808080",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",buttonBorderColor:"#0A00F8",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{hover:{buttonColor:"#194EFF"}},fontFamily:"Arial",inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},labelFontSettings:{fontWeight:400,fontStyle:"normal"},labelLetterSpacing:0,labelWordSpacing:0,labelTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},isButtonFullWidth:!1,buttonLabel:"Sign up",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."},layoutDefaults:{m:{gap:.032,fieldsGap:.032,buttonStroke:0,buttonCorners:.192,inputStroke:.003,inputCorners:.192,buttonPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{gap:.0083,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.05,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.01,buttonLineHeight:.01,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"type",value:"B"},then:{name:"properties.labelTextColor.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSettings.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSize.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLineHeight.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLetterSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelWordSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelTextAppearance.display.visible",value:!0}},{if:{name:"type",value:"C"},then:{name:"properties.buttonCorners.display.enabled",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.enabled",value:!1}},{if:{name:"buttonStroke",value:0},then:{name:"properties.buttonBorderColor.display.visible",value:!1}},{if:{name:"inputStroke",value:0},then:{name:"properties.inputBorderColor.display.visible",value:!1}},{if:{name:"fieldsToShow",value:1},then:{name:"properties.fieldsGap.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:["inputCorners","inputPadding"]},{type:"row",title:"",items:["fieldsToShow","inputStroke"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["buttonCorners","buttonPadding"]},{type:"row",title:"",items:["buttonStroke","isButtonFullWidth"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...md],panelIds:["general","typeStyle"],stateItems:{default:["placeholderColor","inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor","labelTextColor"],hover:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],focus:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],filled:["inputTextColor","inputColor","inputBorderColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},hd={element:ld,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Stacked.png"},defaultSize:{d:{width:300,height:42},t:{width:346,height:42},m:{width:300,height:42}},schema:gd,sourceCode:ud};function fi(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function fd(e){return`
|
|
792
|
+
`,pd=[{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."},{name:"message",type:"textarea",placeholder:"Enter your message",label:"Message",isRequired:!1,error:"Message is required"},{name:"message2",type:"textarea",placeholder:"Enter your message 2",label:"Message 2",isRequired:!1,error:"Message 2 is required"},{name:"message3",type:"textarea",placeholder:"Enter your message 3",label:"Message 3",isRequired:!1,error:"Message 3 is required"}],hi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},md=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],gd={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:7},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B","C"]},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",enabled:!0},min:0,max:100},buttonPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},inputPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},buttonStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"common",title:"Stroke Input",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},isButtonFullWidth:{type:"boolean",scope:"common",title:"Full Width",display:{type:"toggle",enum:["On","Off"]}},buttonBorderColor:{type:"string",scope:"common",title:"Stroke Button",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker",visible:!1}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...hi.fontSettings,scope:"common",title:"Input",display:{type:"font-settings-weight"}},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...hi.fontSettings,scope:"common",title:"Button",display:{type:"font-settings-weight"}},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},labelFontSettings:{...hi.fontSettings,scope:"common",title:"Label",display:{type:"font-settings-weight",visible:!1}},labelFontSize:{type:"number",scope:"layout",title:"Label Font Size",display:{type:"font-size",visible:!1}},labelLineHeight:{type:"number",scope:"layout",title:"Label Line Height",display:{type:"line-height-input",visible:!1}},labelLetterSpacing:{type:"number",scope:"layout",title:"Label Letter Spacing",display:{type:"letter-spacing-input",visible:!1}},labelWordSpacing:{type:"number",scope:"layout",title:"Label Word Spacing",display:{type:"word-spacing-input",visible:!1}},labelTextAppearance:{type:"object",scope:"layout",title:"Label Text Appearance",display:{type:"text-appearance",visible:!1}},statusFontSettings:{...hi.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fieldsToShow:2,fields:pd,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#E2E2E2",placeholderColor:"#808080",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",buttonBorderColor:"#0A00F8",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{hover:{buttonColor:"#194EFF"}},fontFamily:"Arial",inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},labelFontSettings:{fontWeight:400,fontStyle:"normal"},labelLetterSpacing:0,labelWordSpacing:0,labelTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},isButtonFullWidth:!1,buttonLabel:"Sign up",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."},layoutDefaults:{m:{gap:.032,fieldsGap:.032,buttonStroke:0,buttonCorners:.192,inputStroke:.003,inputCorners:.192,buttonPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{gap:.0083,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.05,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.01,buttonLineHeight:.01,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"type",value:"B"},then:{name:"properties.labelTextColor.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSettings.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSize.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLineHeight.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLetterSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelWordSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelTextAppearance.display.visible",value:!0}},{if:{name:"type",value:"C"},then:{name:"properties.buttonCorners.display.enabled",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.enabled",value:!1}},{if:{name:"buttonStroke",value:0},then:{name:"properties.buttonBorderColor.display.visible",value:!1}},{if:{name:"inputStroke",value:0},then:{name:"properties.inputBorderColor.display.visible",value:!1}},{if:{name:"fieldsToShow",value:1},then:{name:"properties.fieldsGap.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:["inputCorners","inputPadding"]},{type:"row",title:"",items:["fieldsToShow","inputStroke"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["buttonCorners","buttonPadding"]},{type:"row",title:"",items:["buttonStroke","isButtonFullWidth"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...md],panelIds:["general","typeStyle"],stateItems:{default:["placeholderColor","inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor","labelTextColor"],hover:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],focus:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],filled:["inputTextColor","inputColor","inputBorderColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},hd={element:sd,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Stacked.png"},defaultSize:{d:{width:300,height:42},t:{width:346,height:42},m:{width:300,height:42}},schema:gd,sourceCode:ud};function fi(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function fd(e){return`
|
|
793
793
|
.${e}-wrapper {
|
|
794
794
|
display: flex;
|
|
795
795
|
flex-direction: column;
|
|
@@ -980,7 +980,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
980
980
|
font-size: ${fi(14)};
|
|
981
981
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
982
982
|
}
|
|
983
|
-
`}const yd=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:
|
|
983
|
+
`}const yd=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:l}=E.useScopedStyles(),s=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:a,buttonLabel:p,fieldsToShow:u=1,fontFamily:L,inputFontSettings:C,inputFontSize:y,inputLineHeight:g,inputLetterSpacing:h,inputWordSpacing:T,inputTextAppearance:$,buttonFontSettings:x,buttonFontSize:S,buttonLineHeight:H,buttonLetterSpacing:R,buttonWordSpacing:B,buttonTextAppearance:w,statusFontSettings:I,statusFontSize:O,statusLineHeight:m,statusLetterSpacing:b,statusWordSpacing:P,statusTextAppearance:F,iconMaxWidth:U,minHeight:J,corners:W,stroke:N,stateOverrides:v,inputPadding:_,buttonPadding:A,successMessage:j="Thanks for subscribing!",errorMessage:z="Please, fill all required fields."}=e,Q=d.slice(0,Math.min(u,d.length)),[M,ne]=c.useState(()=>Object.fromEntries(Q.map(pe=>[pe.name,""]))),[f,ie]=c.useState("idle"),[ye,te]=c.useState(null),he=o==="success"?"success":o==="error"?"error":f,oe=o==="error"?z:ye,ue=o==="filled",V=c.useMemo(()=>{if(!ue)return M;let pe=null;for(const xe of Q)(M[xe.name]??"").trim().length>0||(pe=pe??{...M},pe[xe.name]="Filled");return pe??M},[ue,M,Q]),Y=he==="error"?E.getFormFieldValidationError(Q,V):null,le=o&&o!=="default"?`${l}-state-${o}`:"",de=Q.some(pe=>(V[pe.name]??"").trim().length>0),Ce=le!==`${l}-state-filled`&&de?`${l}-state-filled`:"",Pe=`${le} ${Ce}`.trim(),Ee=i==null?void 0:i.submitUrl,ke=p??"",Ie=(a==null?void 0:a.icon)??"",D=(a==null?void 0:a.mode)==="On",se=ke||"Submit",k={fontSettings:{fontFamily:L,fontWeight:(C==null?void 0:C.fontWeight)??400,fontStyle:(C==null?void 0:C.fontStyle)??"normal"},fontSize:y??.01,lineHeight:g,letterSpacing:h??0,wordSpacing:T??0,textAppearance:$,color:e.inputTextColor??"#111111"},K={fontSettings:{fontFamily:L,fontWeight:(x==null?void 0:x.fontWeight)??400,fontStyle:(x==null?void 0:x.fontStyle)??"normal"},fontSize:S??.01,lineHeight:H,letterSpacing:R??0,wordSpacing:B??0,textAppearance:w,color:e.buttonTextColor??"#ffffff"},q={fontSettings:{fontFamily:L,fontWeight:(I==null?void 0:I.fontWeight)??400,fontStyle:(I==null?void 0:I.fontStyle)??"normal"},fontSize:O??.01,lineHeight:m,letterSpacing:b??0,wordSpacing:P??0,textAppearance:F,color:e.successColor??"#22c55e"},Z=Wt(mt(k,t)),ae=Wt(mt(K,t)),ge=Wt(mt(q,t)),Fe=E.buildColorVars(l,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(k==null?void 0:k.color)??"#111111",buttonTextColor:e.buttonTextColor??(K==null?void 0:K.color)??"#ffffff"},vd,bd,v),$e={borderRadius:E.scalingValue(W,t),borderWidth:E.scalingValue(N,t),borderStyle:"solid"},we={borderLeftWidth:E.scalingValue(N,t)},We=async pe=>{if(pe.preventDefault(),!s)return;const xe=Object.fromEntries(Q.map(Ne=>{var Ue;return[Ne.name,((Ue=M[Ne.name])==null?void 0:Ue.trim())??""]}).filter(([,Ne])=>Ne));if(!Ee){ie("error"),te("No integrations were found for this form.");return}if(Object.keys(xe).length===0)return;const Te=E.getFormFieldValidationError(Q,M);if(Te){ie("error"),te(Te);return}ie("submitting"),te(null);try{const Ne=await fetch(Ee,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(xe)});if(!Ne.ok){const Ue=await Ne.text();throw new Error(Ue||`Request failed: ${Ne.status}`)}ie("success"),ne(Object.fromEntries(Q.map(Ue=>[Ue.name,""])))}catch(Ne){ie("error"),te(Ne instanceof Error?Ne.message:"Something went wrong")}};return r.jsxs("div",{className:`${l}-wrapper ${Pe}`.trim(),style:Fe,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:fd(l)}}),r.jsxs("form",{onSubmit:We,className:`${l}-form`,style:{...$e,height:E.scalingValue(J,t),minHeight:E.scalingValue(J,t)},children:[r.jsx("div",{className:`${l}-inputWrap ${l}-overlayAnchor`,style:{flex:1,minWidth:0},children:Q.map(pe=>r.jsx("input",{type:pe.type==="email"?"email":pe.type==="phone"?"tel":"text",name:pe.name,autoComplete:"off",value:V[pe.name]??"",onChange:xe=>ne(Te=>({...Te,[pe.name]:xe.target.value})),placeholder:pe.placeholder,required:pe.isRequired??pe.type==="email",className:`${l}-input`,style:{...Z,paddingRight:E.scalingValue(_.right,t),paddingLeft:E.scalingValue(_.left,t),paddingTop:E.scalingValue(_.top,t),paddingBottom:E.scalingValue(_.bottom,t)}},pe.name))}),r.jsx("div",{className:`${l}-overlayAnchor`,children:r.jsx("button",{type:s?"submit":"button",className:`${l}-submitBtn`,"aria-label":se,style:{...ae,...we,paddingRight:E.scalingValue(A.right,t),paddingLeft:E.scalingValue(A.left,t),paddingTop:E.scalingValue(A.top,t),paddingBottom:E.scalingValue(A.bottom,t),pointerEvents:s?"auto":void 0},children:f==="submitting"?"...":D?Ie&&r.jsx(Nt,{url:Ie,className:`${l}-submitBtnIcon`,style:{maxWidth:E.scalingValue(U??0,t)},fill:`var(--${l}-button-text-color)`,hoverFill:`var(--${l}-button-text-color)`}):ke})})]}),he==="success"&&r.jsx("p",{className:`${l}-success`,style:{...ge},children:j}),he==="error"&&r.jsx("p",{className:`${l}-error`,style:{...ge},role:"alert",children:Y??oe??z})]})},vd={strokeColor:"stroke-color",inputColor:"input-color",placeholderColor:"placeholder-color",buttonColor:"button-color",inputTextColor:"input-text-color",buttonTextColor:"button-text-color",successColor:"success-color",errorColor:"error-color"},bd=["hover","focus","filled","success","error"],xd=`import React, { useMemo, useState } from 'react';
|
|
984
984
|
import { CommonComponentProps } from '../props';
|
|
985
985
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
986
986
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -1689,7 +1689,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1689
1689
|
.${e}-image-hover-grayscale:hover img {
|
|
1690
1690
|
filter: grayscale(100%);
|
|
1691
1691
|
}
|
|
1692
|
-
`}const Ed=30,Id=20,ro=2,Rd=2,Pd=(e,t)=>Array.from({length:t},()=>e).flat(),_d=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},Ad=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>_d(i,e))},Md=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,imageHoverClass:
|
|
1692
|
+
`}const Ed=30,Id=20,ro=2,Rd=2,Pd=(e,t)=>Array.from({length:t},()=>e).flat(),_d=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},Ad=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>_d(i,e))},Md=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,imageHoverClass:l,isFirstSet:s,scaled:d,onFirstSetImageDone:a})=>{var w,I,O;const p=c.useRef(null);c.useLayoutEffect(()=>{if(!s)return;const m=p.current;m!=null&&m.complete&&(a==null||a())},[s,(w=e.image)==null?void 0:w.url,a]);const u=n.display==="Cover",L=n.ratioValue??"1:1",C=n.reversed??!1,[y,g]=L.split(":").map(Number),$=(C?g:y)/(C?y:g);let x=i,S=x/$;S>o&&(S=o,x=S*$);const H=d(x),R=d(S),B=((I=e.image)==null?void 0:I.url)&&r.jsx("img",{ref:p,src:e.image.url,alt:((O=e.image)==null?void 0:O.name)??"",style:u?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover"}:{pointerEvents:"auto",display:"block",height:"100%",width:"auto",maxWidth:d(i),objectFit:"contain"},onLoad:s?a:void 0,onError:s?a:void 0});return r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...u?{width:H}:{width:"fit-content",maxWidth:d(i),minWidth:0}},children:r.jsx("div",{className:l,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...u?{width:H,height:R,overflow:"hidden"}:{width:"fit-content",maxWidth:d(i),height:d(o)}},children:B&&e.link?r.jsx("a",{href:e.link,target:"_blank",rel:"noopener noreferrer",className:Ve(`${t}-marquee-link`,!u&&`${t}-marquee-link-contain`),children:B}):B})})},kd=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=E.useScopedStyles(),s=c.useMemo(()=>Ld(l),[l]),{speed:d,direction:a,pauseOnHover:p,gap:u,imageMaxWidth:L,imageMaxHeight:C,imageFit:y,hoverEffect:g}=e,h=!!o,T=!n||!!i,$=T&&g!=="off"&&g!=="randomize"?`${l}-image-hover-${g}`:void 0,x=n?!!i:!0,H=((t==null?void 0:t.length)??0)>0&&(x||!!n),R=Math.max(0,d)*Ed,B=Y=>E.scalingValue(Y,n??!1),w=c.useRef(null),I=c.useRef(null),O=c.useRef(null),[m,b]=c.useState(0),[P,F]=c.useState(0),U=x&&p==="on",[J,W]=c.useState(!1),[N,v]=c.useState({}),_=c.useRef(N);_.current=N;const A=c.useRef(null),j=c.useRef(0),z=c.useRef(null),Q=c.useMemo(()=>(t??[]).map(Y=>{var le;return((le=Y.image)==null?void 0:le.url)??""}).join("\0"),[t]),[M,ne]=c.useState(ro),f=c.useMemo(()=>{const Y=t??[];return!x||Y.length===0?Y:Pd(Y,M)},[t,x,M]),ie=c.useMemo(()=>f.filter(Y=>{var le;return!!((le=Y.image)!=null&&le.url)}).length,[f]),ye=H?Rd:1;c.useLayoutEffect(()=>{j.current=0,v({}),A.current=null,ne(ro),b(0)},[Q]),c.useEffect(()=>{if(!T||g!=="randomize")return;const Y=w.current;if(!Y)return;const le=Ee=>{v(ke=>{let Ie=null;for(const D of Ee)D in ke&&(Ad(Y,D)||(Ie||(Ie={...ke}),delete Ie[D]));return Ie??ke})},de=new IntersectionObserver(Ee=>{const ke=new Set;for(const Ie of Ee){const D=Ie.target.dataset.marqueeItemIndex,se=D!==void 0?Number(D):NaN;Number.isNaN(se)||ke.add(se)}ke.size>0&&le(ke)},{root:Y,threshold:0});Object.keys(N).forEach(Ee=>{const ke=Number(Ee);Y.querySelectorAll(`[data-marquee-item-index="${ke}"]`).forEach(Ie=>de.observe(Ie))});let Ce=0;const Pe=()=>{const Ee=Object.keys(_.current);Ee.length!==0&&(le(Ee.map(Number)),Ce=requestAnimationFrame(Pe))};return Object.keys(_.current).length>0&&(Ce=requestAnimationFrame(Pe)),()=>{cancelAnimationFrame(Ce),de.disconnect()}},[g,N,T]),c.useLayoutEffect(()=>{if(!H)return;const Y=w.current,le=O.current;if(!Y||!le)return;let de=0;const Ce=()=>{const ke=Y.getBoundingClientRect().width,Ie=le.getBoundingClientRect().width,D=A.current,se=typeof D=="number"&&Math.abs(D-Ie)<=.25;if(A.current=Ie,x&&Ie>0&&M>0){const k=Ie/M;if(k>0&&ke>0){const K=Math.max(ro,Math.ceil(ke/k)+1);if(K!==M){ne(K);return}}}if(Ie>0&&m<=0){b(Ie);return}se&&Ie!==m?b(Ie):!se&&m<=0&&(cancelAnimationFrame(de),de=requestAnimationFrame(Ce))},Pe=()=>{cancelAnimationFrame(de),de=requestAnimationFrame(Ce)};z.current=Pe,Pe();const Ee=new ResizeObserver(Pe);return Ee.observe(Y),Ee.observe(le),()=>{z.current=null,cancelAnimationFrame(de),Ee.disconnect()}},[x,H,m,Q,M]),c.useLayoutEffect(()=>{const Y=I.current;if(!H||!Y)return;const le=m>0?m:0,de=le>0&&R>0?le/R*1e3:0,Ce=`${Math.max(0,de)/1e3}s`;Y.style.setProperty("--marquee-distance",`${le}px`),Y.style.setProperty("--marquee-duration",Ce)},[x,H,R,m]),c.useLayoutEffect(()=>{if(!H){F(0);return}if(m<=0){F(0);return}const Y=I.current;if(!Y)return;const le=()=>{const Ce=Y.getBoundingClientRect().height;F(Ce>0?Ce:0)};le();const de=new ResizeObserver(le);return de.observe(Y),()=>de.disconnect()},[H,ye,f,n,u,L,C,m,y,N]);const te=()=>{U&&W(!0)},he=()=>{U&&W(!1)},oe=c.useCallback(()=>{var Y;j.current=Math.min(ie,j.current+1),(Y=z.current)==null||Y.call(z)},[ie]),ue=c.useCallback((Y,le)=>{v(de=>{const Ce=de[Y]??le,Pe=(t??[]).filter(ke=>ke!==Ce);if(Pe.length===0)return de;const Ee=Pe[Math.floor(Math.random()*Pe.length)];return{...de,[Y]:Ee}})},[t]),V=(Y,le,de,Ce)=>{const Pe=T&&g==="randomize"&&y.display==="Cover"?N[de]??Y:Y,Ee=`max(${B(u)}, ${Id}px)`,ke=`calc(-0.5 * (${Ee} + ${B(u)}))`;return r.jsxs("div",{className:`${l}-marquee-card`,"data-marquee-item-index":de,onMouseEnter:T&&g==="randomize"&&y.display==="Cover"?()=>ue(de,Y):void 0,children:[r.jsx(Md,{item:Pe,prefix:l,imageFit:y,imageMaxWidth:L,imageMaxHeight:C,imageHoverClass:$,isEditor:n,isFirstSet:Ce,scaled:B,onFirstSetImageDone:oe}),h&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${l}-gap-control`,style:{position:"absolute",top:0,right:ke,width:Ee,height:"100%"}})]},`${le}-${de}`)};if(H){const Y=x?U&&J?"paused":"running":"paused";return r.jsxs("div",{ref:w,className:Ve(`${l}-wrapper`,`${l}-marquee-wrapper`),"aria-label":"Marquee",style:m>0&&P>0?{height:P}:void 0,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:s}}),r.jsx("div",{ref:I,className:`${l}-marquee-track`,"data-direction":a,onMouseEnter:te,onMouseLeave:he,style:{"--marquee-play-state":Y},children:Array.from({length:ye},(le,de)=>r.jsx("div",{ref:de===0?O:void 0,className:Ve(`${l}-marquee-row`,`${l}-marquee-set`),style:{gap:B(u),paddingRight:B(u)},"aria-hidden":de>0,children:f.map((Ce,Pe)=>V(Ce,de,Pe,de===0))},`set-${de}`))},"marquee-track")]})}return r.jsxs("div",{ref:w,className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:s}}),r.jsx("div",{className:Ve(`${l}-marquee-row`,`${l}-marquee-static`),style:{gap:B(u),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((Y,le)=>V(Y,0,le))},"marquee-static")]})},Fd=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
1693
1693
|
import cn from 'classnames';
|
|
1694
1694
|
import { CommonComponentProps } from '../props';
|
|
1695
1695
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -2407,7 +2407,7 @@ type MarqueeProps = {
|
|
|
2407
2407
|
pointer-events: auto;
|
|
2408
2408
|
z-index: 10;
|
|
2409
2409
|
}
|
|
2410
|
-
`}const Hd=30,Ir=2,
|
|
2410
|
+
`}const Hd=30,Ir=2,Bd=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=E.useScopedStyles(),{align:s,speed:d,direction:a,pauseOnHover:p,gap:u,cardWidth:L,corners:C,stroke:y,strokeColor:g,bgColor:h,padding:T,logoMarginTop:$,logoWidth:x,logoHeight:S,captionMarginTop:H}=e,R=!!o,B=((t==null?void 0:t.length)??0)>0,w=d>0&&(!n||!!i),I=B&&(w||!!n),O=Math.max(0,d)*Hd,m=k=>E.scalingValue(k,n??!1),b=c.useRef(null),P=c.useRef(null),F=c.useRef(null),[U,J]=c.useState(0),[W,N]=c.useState(0),[v,_]=c.useState(0),A=w&&p==="on",[j,z]=c.useState(!1),Q=c.useRef(null),[M,ne]=c.useState(0),[f,ie]=c.useState(0),ye=c.useRef(null),te=k=>{var q,Z,ae,ge,Fe;return{fontSettings:{fontFamily:(e==null?void 0:e[`${k}FontFamily`])??"Arial",fontWeight:((q=e==null?void 0:e[`${k}FontSettings`])==null?void 0:q.fontWeight)??400,fontStyle:((Z=e==null?void 0:e[`${k}FontSettings`])==null?void 0:Z.fontStyle)??"normal"},textAppearance:{textTransform:((ae=e==null?void 0:e[`${k}TextAppearance`])==null?void 0:ae.textTransform)??"none",textDecoration:((ge=e==null?void 0:e[`${k}TextAppearance`])==null?void 0:ge.textDecoration)??"none",fontVariant:((Fe=e==null?void 0:e[`${k}TextAppearance`])==null?void 0:Fe.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${k}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${k}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${k}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${k}LineHeight`])??.01,color:(e==null?void 0:e[`${k}Color`])??"#000000"}},he=te("text"),oe=te("caption"),ue=c.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(k=>{var K,q;return(((K=k.text)==null?void 0:K.length)??0)>0||(((q=k.caption)==null?void 0:q.length)??0)>0}),[t]),V=c.useMemo(()=>!I||(t==null?void 0:t.length)===0?1:W<=0||U<=0?Ir:Math.max(Ir,Math.ceil(U/W)+1),[I,t==null?void 0:t.length,W,U]);c.useLayoutEffect(()=>{if(!I)return;const k=b.current,K=F.current;if(!k||!K)return;let q=0;const Z=()=>{const Fe=k.getBoundingClientRect().width,$e=K.getBoundingClientRect().width,we=ye.current,We=typeof we=="number"&&Math.abs(we-$e)<=.25;if(ye.current=$e,J(Fe),typeof $e=="number"&&$e>0&&W<=0){N($e);return}We&&$e!==W?N($e):!We&&W<=0&&(cancelAnimationFrame(q),q=requestAnimationFrame(Z))},ae=()=>{cancelAnimationFrame(q),q=requestAnimationFrame(Z)};ae();const ge=new ResizeObserver(ae);return ge.observe(k),ge.observe(K),()=>{cancelAnimationFrame(q),ge.disconnect()}},[w,I,W]),c.useLayoutEffect(()=>{const k=P.current;if(!I||!k)return;const K=W>0?W:0,q=K>0&&O>0?K/O*1e3:0,Z=`${Math.max(0,q)/1e3}s`;k.style.setProperty("--marquee-distance",`${K}px`),k.style.setProperty("--marquee-duration",Z)},[w,I,O,W]),c.useLayoutEffect(()=>{if(!I){_(0);return}const k=F.current,K=P.current;if(!k||!K)return;const q=()=>{let ae=0;for(let ge=0;ge<k.children.length;ge++){const $e=k.children[ge].firstElementChild;$e&&(ae=Math.max(ae,$e.offsetHeight))}ae<=0&&(ae=K.offsetHeight),_(ae>0?ae:0)};q();const Z=new ResizeObserver(q);return Z.observe(k),Z.observe(K),()=>{Z.disconnect()}},[I,V,t,n,u,L,T,y,C,x,S,M,f]);const Y=()=>{A&&z(!0)},le=()=>{A&&z(!1)},de=c.useMemo(()=>{switch(s){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[s]),Ce=c.useMemo(()=>{switch(s){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[s]),Pe=c.useCallback((k,K,q,Z)=>r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:de,width:"100%"},children:[r.jsx("div",{"data-controls":R?Z==null?void 0:Z.controlsName:void 0,"data-controls-axis":R?"y":void 0,className:R?`${l}-control`:void 0,style:{height:m((Z==null?void 0:Z.marginTop)??0)}}),r.jsx("div",{...Z!=null&&Z.dataMeasureKind?{"data-testimonial-measure":Z.dataMeasureKind}:{},style:{...mt(k,n),textAlign:Ce,pointerEvents:"auto",...typeof(Z==null?void 0:Z.minHeightPx)=="number"&&Z.minHeightPx>0?{minHeight:Z.minHeightPx}:{}},children:r.jsx(Yn,{content:K})})]},q),[de,Ce,n,R,l,m]),Ee=c.useCallback((k,K,q)=>{var Z,ae,ge;return r.jsxs("div",{style:{padding:`${m(T.top)} ${m(T.right)} ${m(T.bottom)} ${m(T.left)}`,width:m(L+y*2),height:"100%",borderRadius:m(C),border:`${m(y)} solid ${g}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[r.jsx("div",{className:`${l}-cover`,style:{background:h}}),r.jsxs("div",{className:`${l}-elements-overlay`,style:{alignItems:de,textAlign:Ce},children:[k.text&&Pe(he,k.text,"text",q!=null&&q.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(q==null?void 0:q.textMinHeightPx)=="number"&&q.textMinHeightPx>0?{minHeightPx:q.textMinHeightPx}:void 0),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:de,width:"100%"},children:[r.jsx("div",{"data-controls":R&&!(q!=null&&q.dataMeasureAttrs)?"logoMarginTop":void 0,className:R&&!(q!=null&&q.dataMeasureAttrs)?`${l}-control`:void 0,style:{height:m($)}}),r.jsx("div",{style:{width:m(x),height:m(S)},children:((Z=k.logo)==null?void 0:Z.url)&&r.jsx("img",{src:k.logo.url,alt:((ae=k.logo)==null?void 0:ae.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((ge=k.logo)==null?void 0:ge.objectFit)||"contain"}})})]}),k.caption&&Pe(oe,k.caption,"caption",{...q!=null&&q.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:H,...q!=null&&q.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(q==null?void 0:q.captionMinHeightPx)=="number"&&q.captionMinHeightPx>0?{minHeightPx:q.captionMinHeightPx}:{}})]})]},K)},[h,H,oe,L,C,S,$,x,de,Ce,T.bottom,T.left,T.right,T.top,Pe,y,g,he,n,R,l]),ke=c.useCallback(k=>{ne(k.maxTextPx),ie(k.maxCaptionPx)},[]);c.useLayoutEffect(()=>{if(!ue){ke({maxTextPx:0,maxCaptionPx:0});return}const k=Q.current;if(!k)return;const K=()=>{E.readTestimonialTextMeasure(k,ke)};K();const q=new ResizeObserver(K);return q.observe(k),()=>{q.disconnect()}},[ue,ke,t,Ee]);const Ie=ue?{textMinHeightPx:M,captionMinHeightPx:f}:void 0,D=ue?r.jsx("div",{ref:Q,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((k,K)=>Ee(k,`measure-${K}`,{dataMeasureAttrs:!0}))}):null,se=(k,K)=>r.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[Ee(k,`card-${K}`,Ie),R&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${m(u)})`,width:m(u),height:"100%",pointerEvents:"auto",zIndex:2}})]},K);if(I){const k=w?A&&j?"paused":"running":"paused";return r.jsxs("div",{ref:b,className:Ve(`${l}-wrapper`,`${l}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...v>0?{height:v}:{}},children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Er(l)}}),D,r.jsx("div",{ref:P,className:`${l}-marquee-track`,"data-direction":a,onMouseEnter:Y,onMouseLeave:le,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px","--marquee-play-state":k},children:Array.from({length:V},(K,q)=>r.jsx("div",{ref:q===0?F:void 0,className:`${l}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:m(u),paddingRight:m(u)},"aria-hidden":q>0,children:t==null?void 0:t.map((Z,ae)=>se(Z,`${q}-${ae}`))},`set-${q}`))})]})}return r.jsxs("div",{className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Er(l)}}),D,r.jsx("div",{style:{gap:m(u),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((k,K)=>se(k,K))})]})},Od=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
2411
2411
|
import cn from 'classnames';
|
|
2412
2412
|
import { CommonComponentProps } from '../props';
|
|
2413
2413
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -3022,7 +3022,7 @@ type TestimonialsSettings = {
|
|
|
3022
3022
|
logoHeight: number;
|
|
3023
3023
|
captionMarginTop: number;
|
|
3024
3024
|
};
|
|
3025
|
-
`,Rr={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},jd={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle",enum:["on","off"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,max:200,display:{type:"range-control"}},align:{type:"string",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},cardWidth:{type:"number",scope:"layout",title:"width",min:0,max:400,display:{type:"numeric-input"}},corners:{type:"number",scope:"layout",title:"Corners",min:0,max:100,display:{type:"numeric-input"}},stroke:{type:"number",scope:"layout",title:"Stroke",min:0,max:10,display:{type:"numeric-input"}},strokeColor:{type:"string",scope:"common",title:"Stroke Card",display:{type:"palette-color-picker",visible:!0}},bgColor:{title:"BG card",type:"string",scope:"common",display:{type:"palette-color-picker"}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},logoMarginTop:{type:"number",scope:"layout",title:"Logo margin top",min:0,max:200,display:{type:"range-control"}},logoWidth:{type:"number",scope:"layout",title:"width",min:0,max:200,display:{type:"numeric-input"}},logoHeight:{type:"number",scope:"layout",title:"height",min:0,max:200,display:{type:"numeric-input"}},textColor:{type:"string",scope:"common",title:"Fill Text",display:{type:"palette-color-picker"}},captionColor:{type:"string",scope:"common",title:"Fill Caption",display:{type:"palette-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Rr.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Rr.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}}},defaults:{direction:"left",pauseOnHover:"off",strokeColor:"#000000",bgColor:"rgba(255, 255, 255, 0.81)",textColor:"#000000",captionColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},align:"center",captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{speed:.55,gap:.04,cardWidth:.8,corners:.02,stroke:.001,padding:{top:.053,right:.026,bottom:.053,left:.026},logoMarginTop:.18,logoWidth:.21,logoHeight:.21,captionMarginTop:.056,textFontSize:.058,textLineHeight:.088,captionFontSize:.053,captionLineHeight:.069},d:{speed:1.64,gap:.02,cardWidth:.15,corners:.005,stroke:.001,padding:{top:.01,right:.01,bottom:.01,left:.01},logoMarginTop:.048,logoWidth:.055,logoHeight:.027,captionMarginTop:.005,textFontSize:.012,textLineHeight:.013,captionFontSize:.01,captionLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}}],layout:["__componentName__","speed","direction","pauseOnHover","gap","cardWidth","corners","stroke","strokeColor","bgColor","padding","logoMarginTop","logoWidth","logoHeight","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["align","direction"]},{type:"row",items:["speed","pauseOnHover"]},{type:"row",title:"Card",items:[{type:"group",title:"",items:["cardWidth","corners"]},{type:"group",title:"",items:["stroke","padding"]}]},{type:"row",title:"Image Container",items:["logoWidth","logoHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["bgColor","strokeColor","textColor","captionColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{logo:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia,"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},
|
|
3025
|
+
`,Rr={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},jd={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle",enum:["on","off"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,max:200,display:{type:"range-control"}},align:{type:"string",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},cardWidth:{type:"number",scope:"layout",title:"width",min:0,max:400,display:{type:"numeric-input"}},corners:{type:"number",scope:"layout",title:"Corners",min:0,max:100,display:{type:"numeric-input"}},stroke:{type:"number",scope:"layout",title:"Stroke",min:0,max:10,display:{type:"numeric-input"}},strokeColor:{type:"string",scope:"common",title:"Stroke Card",display:{type:"palette-color-picker",visible:!0}},bgColor:{title:"BG card",type:"string",scope:"common",display:{type:"palette-color-picker"}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},logoMarginTop:{type:"number",scope:"layout",title:"Logo margin top",min:0,max:200,display:{type:"range-control"}},logoWidth:{type:"number",scope:"layout",title:"width",min:0,max:200,display:{type:"numeric-input"}},logoHeight:{type:"number",scope:"layout",title:"height",min:0,max:200,display:{type:"numeric-input"}},textColor:{type:"string",scope:"common",title:"Fill Text",display:{type:"palette-color-picker"}},captionColor:{type:"string",scope:"common",title:"Fill Caption",display:{type:"palette-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Rr.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Rr.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}}},defaults:{direction:"left",pauseOnHover:"off",strokeColor:"#000000",bgColor:"rgba(255, 255, 255, 0.81)",textColor:"#000000",captionColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},align:"center",captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{speed:.55,gap:.04,cardWidth:.8,corners:.02,stroke:.001,padding:{top:.053,right:.026,bottom:.053,left:.026},logoMarginTop:.18,logoWidth:.21,logoHeight:.21,captionMarginTop:.056,textFontSize:.058,textLineHeight:.088,captionFontSize:.053,captionLineHeight:.069},d:{speed:1.64,gap:.02,cardWidth:.15,corners:.005,stroke:.001,padding:{top:.01,right:.01,bottom:.01,left:.01},logoMarginTop:.048,logoWidth:.055,logoHeight:.027,captionMarginTop:.005,textFontSize:.012,textLineHeight:.013,captionFontSize:.01,captionLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}}],layout:["__componentName__","speed","direction","pauseOnHover","gap","cardWidth","corners","stroke","strokeColor","bgColor","padding","logoMarginTop","logoWidth","logoHeight","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["align","direction"]},{type:"row",items:["speed","pauseOnHover"]},{type:"row",title:"Card",items:[{type:"group",title:"",items:["cardWidth","corners"]},{type:"group",title:"",items:["stroke","padding"]}]},{type:"row",title:"Image Container",items:["logoWidth","logoHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["bgColor","strokeColor","textColor","captionColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{logo:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia,"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},Dd={element:Bd,id:"testimonials",name:"Eliana",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Testimonials_Grid.mp4"},defaultSize:{d:{width:"100%",height:320}},schema:jd,sourceCode:Od,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function zd(e){return`
|
|
3026
3026
|
.${e}-container {
|
|
3027
3027
|
position: relative;
|
|
3028
3028
|
overflow-x: clip;
|
|
@@ -3146,7 +3146,7 @@ type TestimonialsSettings = {
|
|
|
3146
3146
|
width: 100%;
|
|
3147
3147
|
height: 100%;
|
|
3148
3148
|
}
|
|
3149
|
-
`}const Vd=3e3,Gd=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:
|
|
3149
|
+
`}const Vd=3e3,Gd=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=E.useScopedStyles(),s=t||[],{speed:d,align:a,width:p,imageMarginTop:u,textMarginTop:L,captionMarginTop:C,imageWidth:y,imageHeight:g,controlsWidth:h,controlsColor:T,controlsHoverColor:$}=e,x=d>0&&(!n||!!i),[S,H]=c.useState(0),[R,B]=c.useState(null),[w,I]=c.useState(!1),O=c.useRef(null),m=c.useMemo(()=>{switch(a){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[a]),b=c.useMemo(()=>{switch(a){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[a]);c.useEffect(()=>{H(0),B(null),I(!1)},[s.length]);const P=s[S],F=R===null?null:s[R],U=oe=>{var V,Y,le,de,Ce;return{fontSettings:{fontFamily:(e==null?void 0:e[`${oe}FontFamily`])??"Arial",fontWeight:((V=e==null?void 0:e[`${oe}FontSettings`])==null?void 0:V.fontWeight)??400,fontStyle:((Y=e==null?void 0:e[`${oe}FontSettings`])==null?void 0:Y.fontStyle)??"normal"},textAppearance:{textTransform:((le=e==null?void 0:e[`${oe}TextAppearance`])==null?void 0:le.textTransform)??"none",textDecoration:((de=e==null?void 0:e[`${oe}TextAppearance`])==null?void 0:de.textDecoration)??"none",fontVariant:((Ce=e==null?void 0:e[`${oe}TextAppearance`])==null?void 0:Ce.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${oe}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${oe}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${oe}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${oe}WordSpacing`])??0,color:(e==null?void 0:e[`${oe}Color`])??"#000000"}},J=U("text"),W=U("caption"),N=s.length>1&&s.some(oe=>{var ue,V;return(((ue=oe.text)==null?void 0:ue.length)??0)>0||(((V=oe.caption)==null?void 0:V.length)??0)>0}),v=c.useRef(null),[_,A]=c.useState(0),[j,z]=c.useState(0),Q=e.controls??{mode:"Off",icon:null},M=s.length>1,ne=c.useCallback((oe,ue)=>!M||ue===oe?oe:(O.current&&window.clearTimeout(O.current),B(oe),I(!0),O.current=window.setTimeout(()=>{B(null),I(!1),O.current=null},300),ue),[M]),f=c.useCallback(()=>{M&&H(oe=>ne(oe,(oe-1+s.length)%s.length))},[M,ne,s.length]),ie=c.useCallback(()=>{M&&H(oe=>ne(oe,(oe+1)%s.length))},[M,ne,s.length]);c.useEffect(()=>{if(!x||!M)return;const oe=Math.max(300,Vd/d),ue=window.setInterval(()=>{H(V=>ne(V,(V+1)%s.length))},oe);return()=>{window.clearInterval(ue)}},[x,M,ne,s.length,d]),c.useEffect(()=>()=>{O.current&&window.clearTimeout(O.current)},[]);const ye=(oe,ue)=>{var Ce,Pe,Ee,ke;const V=ue==null?void 0:ue.textMinHeightPx,Y=ue==null?void 0:ue.captionMinHeightPx,le=ue==null?void 0:ue.dataMeasureAttrs,de=o&&!(ue!=null&&ue.dataMeasureAttrs)&&!(ue!=null&&ue.hideControls);return r.jsxs(r.Fragment,{children:[oe.text&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:m,width:"100%"},children:[r.jsx("div",{"data-controls":de?"textMarginTop":void 0,className:de?`${l}-control`:void 0,style:{height:E.scalingValue(L??0,n??!1)}}),r.jsx("div",{...le&&{"data-testimonial-measure":"text"},style:{...mt(J,n),...V&&V>0?{minHeight:V}:{},textAlign:b,pointerEvents:"auto"},children:r.jsx(Yn,{content:oe.text})})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:m,width:"100%"},children:[r.jsx("div",{"data-controls":de?"imageMarginTop":void 0,className:de?`${l}-control`:void 0,style:{height:E.scalingValue(u??0,n??!1)}}),r.jsx("div",{style:{width:E.scalingValue(y??0,n??!1),height:E.scalingValue(g??0,n??!1)},children:((Ce=oe.image)==null?void 0:Ce.url)&&r.jsx("img",{src:(Pe=oe.image)==null?void 0:Pe.url,alt:((Ee=oe.image)==null?void 0:Ee.name)??"",className:`${l}-icon`,style:{objectFit:((ke=oe.image)==null?void 0:ke.objectFit)||"contain"}})})]}),oe.caption&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:m,width:"100%"},children:[r.jsx("div",{"data-controls":de?"captionMarginTop":void 0,className:de?`${l}-control`:void 0,style:{height:E.scalingValue(C??0,n??!1)}}),r.jsx("div",{...le?{"data-testimonial-measure":"caption"}:{},style:{...mt(W,n),...Y&&Y>0?{minHeight:Y}:{},textAlign:b,pointerEvents:"auto"},children:r.jsx(Yn,{content:oe.caption})})]})]})},te=c.useCallback(oe=>{A(oe.maxTextPx),z(oe.maxCaptionPx)},[]);if(c.useLayoutEffect(()=>{if(!N){te({maxTextPx:0,maxCaptionPx:0});return}const oe=v.current;if(!oe)return;const ue=()=>{E.readTestimonialTextMeasure(oe,te)};ue();const V=new ResizeObserver(ue);return V.observe(oe),()=>{V.disconnect()}},[N,te,t]),!P)return r.jsx(r.Fragment,{});const he=N?{textMinHeightPx:_,captionMinHeightPx:j}:void 0;return r.jsx(r.Fragment,{children:r.jsxs("div",{className:`${l}-container`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:zd(l)}}),r.jsxs("div",{className:`${l}-wrapper`,style:{width:E.scalingValue(p??0,n??!1),alignItems:m},children:[N&&r.jsx("div",{ref:v,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:s.map((oe,ue)=>r.jsx("div",{style:{width:"100%"},children:ye(oe,{dataMeasureAttrs:!0})},ue))}),r.jsxs("div",{className:`${l}-fade-stack`,children:[F&&w&&r.jsx("div",{className:Ve(`${l}-fade-item-prev`,`${l}-fade-out`),children:ye(F,{...he,hideControls:!0})}),r.jsx("div",{className:Ve(`${l}-fade-item-current`,w?`${l}-fade-in`:void 0),children:ye(P,he)})]})]}),Q.mode==="On"&&r.jsxs("div",{className:`${l}-controls`,children:[r.jsx("div",{className:`${l}-arrow`,style:{width:E.scalingValue(h??.02,n??!1),height:E.scalingValue(h??.02,n??!1),"--arrow-hover-color":$},children:r.jsx("button",{type:"button",className:`${l}-arrow-inner`,onClick:f,disabled:!M,"aria-label":"Previous testimonial",children:Q.icon&&r.jsx(Nt,{url:Q.icon,fill:T,hoverFill:$,className:Ve(`${l}-arrow-img`,`${l}-mirror`)})})}),r.jsx("div",{className:Ve(`${l}-arrow`,`${l}-next-arrow`),style:{width:E.scalingValue(h??.02,n??!1),height:E.scalingValue(h??.02,n??!1),"--arrow-hover-color":$},children:r.jsx("button",{type:"button",className:`${l}-arrow-inner`,onClick:ie,disabled:!M,"aria-label":"Next testimonial",children:Q.icon&&r.jsx(Nt,{url:Q.icon,fill:T,hoverFill:$,className:`${l}-arrow-img`})})})]})]})})},Ud=`import cn from 'classnames';
|
|
3150
3150
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3151
3151
|
import { CommonComponentProps } from '../props';
|
|
3152
3152
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -3642,7 +3642,7 @@ type TestimonialsSettings = {
|
|
|
3642
3642
|
icon?: string | null;
|
|
3643
3643
|
};
|
|
3644
3644
|
};
|
|
3645
|
-
`,Kd="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 18" width="10" height="18"><path fill="#000000" fill-rule="evenodd" d="M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z" transform="translate(5, 9) rotate(-90) translate(-5, -9)"/></svg>'),Pr={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},qd={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},align:{type:"string",scope:"common",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},width:{type:"number",scope:"layout",title:"width",min:0,max:1e3,display:{type:"numeric-input"}},imageWidth:{type:"number",scope:"layout",title:"width",min:0,max:300,display:{type:"numeric-input"}},imageHeight:{type:"number",scope:"layout",title:"height",min:0,max:300,display:{type:"numeric-input"}},imageMarginTop:{type:"number",scope:"layout",title:"Image margin top",min:0,max:200,display:{type:"range-control"}},textMarginTop:{type:"number",scope:"layout",title:"Text margin top",min:0,max:200,display:{type:"range-control"}},controls:{type:"object",scope:"common",title:"Controls",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},controlsWidth:{type:"number",scope:"layout",title:"Controls width",min:0,max:100,display:{type:"numeric-input"}},controlsColor:{type:"string",scope:"common",title:"Fill Controls",display:{type:"settings-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Hover Controls",display:{type:"settings-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Pr.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},captionColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Fill Caption"},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Pr.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Fill Text"}},defaults:{controls:{mode:"On",icon:Kd},controlsColor:"#000000",controlsHoverColor:"#EABC01",align:"center",textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},captionColor:"#000000"},layoutDefaults:{m:{speed:1,width:.69,imageMarginTop:.08,captionMarginTop:.04,textMarginTop:0,textFontSize:.069,captionFontSize:.053,textLineHeight:.093,captionLineHeight:.069,imageWidth:.21,imageHeight:.21,controlsWidth:.06},d:{speed:1,width:.35,imageMarginTop:.02,textMarginTop:0,captionMarginTop:.01,textFontSize:.016,captionFontSize:.009,textLineHeight:.018,captionLineHeight:.009,imageWidth:.027,imageHeight:.027,controlsWidth:.014}},layout:["__componentName__","speed","width","imageMarginTop","textMarginTop","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["width","align"]},{type:"row",items:["controls"]},{type:"row",items:["controlsWidth","speed"]},{type:"row",title:"Image Container",items:["imageWidth","imageHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["textColor","captionColor","controlsColor","controlsHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia,"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},Xd={element:Gd,id:"testimonial-single",name:"Clara",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Testimonials_Single.png"},defaultSize:{d:{width:700,height:300},t:{width:373,height:300},m:{width:334,height:300}},schema:qd,sourceCode:Ud,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function Yd(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function _r(e){return((e==null?void 0:e.trim().length)??0)>0}function ao(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function
|
|
3645
|
+
`,Kd="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 18" width="10" height="18"><path fill="#000000" fill-rule="evenodd" d="M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z" transform="translate(5, 9) rotate(-90) translate(-5, -9)"/></svg>'),Pr={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},qd={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},align:{type:"string",scope:"common",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},width:{type:"number",scope:"layout",title:"width",min:0,max:1e3,display:{type:"numeric-input"}},imageWidth:{type:"number",scope:"layout",title:"width",min:0,max:300,display:{type:"numeric-input"}},imageHeight:{type:"number",scope:"layout",title:"height",min:0,max:300,display:{type:"numeric-input"}},imageMarginTop:{type:"number",scope:"layout",title:"Image margin top",min:0,max:200,display:{type:"range-control"}},textMarginTop:{type:"number",scope:"layout",title:"Text margin top",min:0,max:200,display:{type:"range-control"}},controls:{type:"object",scope:"common",title:"Controls",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},controlsWidth:{type:"number",scope:"layout",title:"Controls width",min:0,max:100,display:{type:"numeric-input"}},controlsColor:{type:"string",scope:"common",title:"Fill Controls",display:{type:"settings-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Hover Controls",display:{type:"settings-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Pr.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},captionColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Fill Caption"},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Pr.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Fill Text"}},defaults:{controls:{mode:"On",icon:Kd},controlsColor:"#000000",controlsHoverColor:"#EABC01",align:"center",textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},captionColor:"#000000"},layoutDefaults:{m:{speed:1,width:.69,imageMarginTop:.08,captionMarginTop:.04,textMarginTop:0,textFontSize:.069,captionFontSize:.053,textLineHeight:.093,captionLineHeight:.069,imageWidth:.21,imageHeight:.21,controlsWidth:.06},d:{speed:1,width:.35,imageMarginTop:.02,textMarginTop:0,captionMarginTop:.01,textFontSize:.016,captionFontSize:.009,textLineHeight:.018,captionLineHeight:.009,imageWidth:.027,imageHeight:.027,controlsWidth:.014}},layout:["__componentName__","speed","width","imageMarginTop","textMarginTop","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["width","align"]},{type:"row",items:["controls"]},{type:"row",items:["controlsWidth","speed"]},{type:"row",title:"Image Container",items:["imageWidth","imageHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["textColor","captionColor","controlsColor","controlsHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia,"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},Xd={element:Gd,id:"testimonial-single",name:"Clara",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Testimonials_Single.png"},defaultSize:{d:{width:700,height:300},t:{width:373,height:300},m:{width:334,height:300}},schema:qd,sourceCode:Ud,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function Yd(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function _r(e){return((e==null?void 0:e.trim().length)??0)>0}function ao(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function lo(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:E.scalingValue((o-t)/2,i)}}function Jd(e){return`
|
|
3646
3646
|
.${e}-wrapper {
|
|
3647
3647
|
display: grid;
|
|
3648
3648
|
align-items: start;
|
|
@@ -3845,7 +3845,7 @@ type TestimonialsSettings = {
|
|
|
3845
3845
|
pointer-events: auto;
|
|
3846
3846
|
z-index: 10;
|
|
3847
3847
|
}
|
|
3848
|
-
`}const Bt=500,Zd=750,Jt="cubic-bezier(0.22, 1, 0.36, 1)";function Zt(e){return e.type==="video"?!0:e.type==="image"?!1:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url)}function Ar({media:e,className:t,style:n,onImageClick:i}){return Zt(e)?r.jsx("video",{src:e.url,className:t,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0}):r.jsx("img",{src:e.url,alt:e.name,className:t,style:n,onClick:i})}function Qd({images:e,index:t,imageDisplay:n,originRect:i,reverseClose:o,onClose:s,onPrev:l,onNext:d,counterClassName:a,counterStyle:u}){const p=n==="cover",T=c.useRef(null),x=c.useRef(null),[y,g]=c.useState(null),[h,w]=c.useState(i?"opening":"open"),[S,b]=c.useState(!0),$=c.useRef(t),H=c.useCallback(()=>{const v=T.current,E=x.current;if(!v||!E)return;const k=v.getBoundingClientRect(),O=k.width,U=k.height,Z=E.naturalWidth,W=E.naturalHeight;if(!O||!U||!Z||!W)return;if(n==="cover"){g({width:O,height:U,left:k.left,top:k.top});return}const P=Z/W,I=O/U;if(P>I){const F=O/P;g({width:O,height:F,left:k.left,top:k.top+(U-F)/2})}else{const F=U*P;g({width:F,height:U,left:k.left+(O-F)/2,top:k.top})}},[n]);c.useEffect(()=>{H();const v=T.current;if(!v)return;const E=new ResizeObserver(()=>H());return E.observe(v),()=>E.disconnect()},[H,t]),c.useEffect(()=>{h==="opening"&&y&&w("open")},[h,y]),c.useEffect(()=>{if(h!=="closing")return;const v=setTimeout(()=>s(),Bt);return()=>clearTimeout(v)},[h,s]),c.useEffect(()=>{$.current!==t&&b(!1),$.current=t},[t]),c.useEffect(()=>{const v=E=>{E.key==="Escape"&&(E.preventDefault(),E.stopPropagation(),h!=="closing"&&w("closing"))};return window.addEventListener("keydown",v,!0),()=>window.removeEventListener("keydown",v,!0)},[h]);const R=()=>{h!=="closing"&&w("closing")},B=h==="open",m=h==="closing",C=m&&o&&!!i,N=h==="opening"?i??y:C?i:y;return r.jsxs("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:9997},onClick:R,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:B?1:0,transition:`opacity ${Bt}ms ${Jt}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:p?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:T,style:{position:"absolute",inset:0}}),r.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:B?1:0,transition:`opacity ${Bt}ms ${Jt}`,pointerEvents:"none",zIndex:9999},children:e.length>1&&r.jsxs("p",{className:a,style:u,children:[t+1," / ",e.length]})})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:T,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:B?1:0,transition:`opacity ${Bt}ms ${Jt}`},children:e.length>1&&r.jsxs("p",{className:a,style:u,children:[t+1," / ",e.length]})})]})}),N&&r.jsx("img",{ref:x,src:e[t],onLoad:H,style:{position:"fixed",top:N.top,left:N.left,width:N.width,height:N.height,objectFit:n==="cover"?"cover":"contain",opacity:m&&!C?0:1,transition:m&&!C?`opacity ${Bt}ms ${Jt}`:C||S?`top ${Bt}ms ${Jt}, left ${Bt}ms ${Jt}, width ${Bt}ms ${Jt}, height ${Bt}ms ${Jt}`:"none",pointerEvents:"none",zIndex:9998}}),B&&y&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{position:"fixed",top:y.top,left:y.left,width:y.width/2,height:y.height,cursor:"w-resize",zIndex:9999},onClick:v=>{v.stopPropagation(),l()}}),r.jsx("div",{style:{position:"fixed",top:y.top,left:y.left+y.width/2,width:y.width/2,height:y.height,cursor:"e-resize",zIndex:9999},onClick:v=>{v.stopPropagation(),d()}})]})]})}function eu(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function tu({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:s,activeEvent:l,layoutId:d}){const{prefix:a}=L.useScopedStyles(),{type:u="a",gridLayout:p,textBoxWidth:T=100,verticalGap:x,entriesCount:y,lightbox:g,imageDisplay:h,lightboxImageDisplay:w,slider:S,sliderTiming:b,direction:$,transition:H,titleMarginTop:R,subtitleMarginTop:B,titleColor:m,subtitleColor:C,lightboxCounterColor:N,titleFontFamily:v,titleFontSettings:E,titleFontSize:k,titleLineHeight:O,titleLetterSpacing:U,titleWordSpacing:Z,titleTextAppearance:W,subtitleFontFamily:P,subtitleFontSettings:I,subtitleFontSize:F,subtitleLineHeight:_,subtitleLetterSpacing:j,subtitleWordSpacing:K,subtitleTextAppearance:te,lightboxCounterFontFamily:M,lightboxCounterFontSettings:ne,lightboxCounterFontSize:f,lightboxCounterLineHeight:ee,lightboxCounterLetterSpacing:ge,lightboxCounterWordSpacing:ie,lightboxCounterTextAppearance:fe,showText:Q="always",alignEntries:me="off"}=e,G={fontSettings:{fontFamily:v,fontWeight:(E==null?void 0:E.fontWeight)??400,fontStyle:(E==null?void 0:E.fontStyle)??"normal"},fontSize:k??.01,lineHeight:O,letterSpacing:U??0,wordSpacing:Z??0,textAppearance:W,color:m},ce={...Ft(dt(G,n))},pe={fontSettings:{fontFamily:P,fontWeight:(I==null?void 0:I.fontWeight)??400,fontStyle:(I==null?void 0:I.fontStyle)??"normal"},fontSize:F??.01,lineHeight:_,letterSpacing:j??0,wordSpacing:K??0,textAppearance:te,color:C},Pe={...Ft(dt(pe,n))},Ie={fontSettings:{fontFamily:M,fontWeight:(ne==null?void 0:ne.fontWeight)??400,fontStyle:(ne==null?void 0:ne.fontStyle)??"normal"},fontSize:f??.01,lineHeight:ee,letterSpacing:ge??0,wordSpacing:ie??0,textAppearance:fe,color:N},Le={...Ft(dt(Ie,n)),...so(f,ee,a,n)},z=ao(k,O,`${a}-item-title`,`${a}-text-tight-leading`),ue=ao(F,_,`${a}-item-subtitle`,`${a}-text-tight-leading`),A=so(k,O,a,n),X=so(F,_,a,n),q=ao(f,ee,`${a}-lightbox-counter`,`${a}-text-tight-leading`),Y=L.buildColorVars(a,{titleColor:m,subtitleColor:C,lightboxCounterColor:N},nu,iu),He=`${l&&l!=="default"?`${a}-state-${l}`:""}${Q==="on hover"&&(!n||i)?` ${a}-show-text-hover`:""}`.trim(),we=y===0?1/0:y,Te=(t??[]).slice(0,we),We=p.entryWidth??.2,re=(h==null?void 0:h.display)==="cover",be=(h==null?void 0:h.ratioValue)??"1:1",Fe=(h==null?void 0:h.reversed)??!1,[Oe,Ge]=be.split(":").map(Number),ct=`${Fe?Ge:Oe} / ${Fe?Oe:Ge}`,ot=L.scalingValue(We??0,n),gt=!re&&S!=="off",Je={width:ot,...re?{aspectRatio:ct,height:"auto",overflow:"hidden"}:{height:"auto"}},Tt=`${a}-item-image-wrapper${gt?` ${a}-item-image-wrapper-fit-slider`:""}`.trim(),_e=u==="c",D=_e&&me==="on",V=`calc(${L.scalingValue(We??0,n)} * (${T} / 100))`,se=L.scalingValue(We*T/100,n),ke=re?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},[Ve,Ze]=c.useState("ltr"),[rt,ht]=c.useState(0),$e=c.useRef(null);c.useEffect(()=>{const Be=$e.current;if(!Be)return;const xt=new ResizeObserver(St=>{ht(Math.round(St[0].contentRect.width))});return xt.observe(Be),()=>xt.disconnect()},[]);const le=(()=>{const Be={...Y},xt=$e.current?getComputedStyle($e.current).getPropertyValue("--cntrl-article-width").trim():"";return xt&&(Be["--cntrl-article-width"]=xt),Be})(),[ve,Se]=c.useState(!1),[Re,Ue]=c.useState([]),[Lt,bt]=c.useState(0),[Yt,kt]=c.useState(null),sn=(Be,xt,St)=>{if(n&&!i||g==="off")return;const oe=Be.currentTarget.getBoundingClientRect();kt({top:oe.top,left:oe.left,width:oe.width,height:oe.height}),Ue(xt),bt(St),Se(!0)};c.useEffect(()=>{if(!ve||g!=="on"||typeof document>"u")return;const Be=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Be}},[ve,g]),c.useEffect(()=>{!n||i||(Se(!1),kt(null))},[n,i]);const yn=c.useMemo(()=>Jd(a),[a]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:yn}}),r.jsx("div",{style:Y,children:r.jsx("div",{ref:$e,className:`${a}-wrapper ${a}-type-${u}${D?` ${a}-align-entries`:""} ${He}`.trim(),style:{gridTemplateColumns:`repeat(${p.columnsCount}, minmax(0, 1fr))`,rowGap:D?0:L.scalingValue(x??0,n),columnGap:L.scalingValue(p.horizontalGap??0,n),width:L.scalingValue(p.wrapperWidth??0,n),...D?{[`--${a}-align-entries-row-gap`]:L.scalingValue(x??0,n)}:{}},children:Te.map((Be,xt)=>{var st,wt;const St=_r(Be.title),oe=_r(Be.subtitle),xe=(((st=Be.link)==null?void 0:st.length)??0)>0&&g==="off"?Be.link:void 0,Ee=Math.floor(xt/p.columnsCount)===Math.ceil(Te.length/p.columnsCount)-1,Ne=_e?r.jsxs("div",{className:`${a}-item-text-block`,children:[St&&r.jsx("p",{className:z,style:{width:V,...ce,...A},children:Be.title}),St&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:L.scalingValue(R??0,n),width:se}}),oe&&r.jsx("p",{className:ue,style:{width:V,...Pe,...X},children:Be.subtitle}),oe&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:L.scalingValue(B??0,n),width:se}})]}):null,tt=_e?r.jsxs("div",{className:`${a}-item-title-row`,children:[St&&r.jsx("p",{className:z,style:{width:V,...ce,...A},children:Be.title}),St&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:L.scalingValue(R??0,n),width:se}})]}):null,at=_e?r.jsxs("div",{className:`${a}-item-subtitle-row`,children:[oe&&r.jsx("p",{className:ue,style:{width:V,...Pe,...X},children:Be.subtitle}),oe&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:L.scalingValue(B??0,n),width:se}})]}):null,je=xe?r.jsxs("a",{href:xe,target:"_blank",className:`${a}-item-text-link`,children:[tt,at]}):r.jsxs(r.Fragment,{children:[tt,at]}),Ct=r.jsx("div",{className:Tt,style:Je,children:(((wt=Be.image)==null?void 0:wt.length)??0)===0?null:S==="off"?(()=>{const Ke=Be.image[0],yt=Be.image.filter(ut=>!Zt(ut)).map(ut=>ut.url);return r.jsx(Ar,{media:Ke,className:`${a}-item-${Zt(Ke)?"video":"image"}`.trim(),style:ke,onImageClick:Zt(Ke)?void 0:ut=>sn(ut,yt,0)})})():r.jsxs(r.Fragment,{children:[gt&&r.jsx("div",{className:`${a}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Be.image.map(Ke=>Zt(Ke)?r.jsx("video",{src:Ke.url,muted:!0,playsInline:!0},`sizer-${Ke.url}`):r.jsx("img",{src:Ke.url,alt:""},`sizer-${Ke.url}`))}),r.jsx(qo,{className:`${a}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:b*1e3,width:"100%",height:"100%",speed:Zd,type:H==="fade"?"fade":"loop",rewind:H==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:H==="fade"?"ltr":$!=="random"?$==="horizontal"?"ltr":"ttb":Ve},onMoved:Ke=>{if($!=="random"||H==="fade")return;const ft=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";Ze(ft),setTimeout(()=>{Ke.refresh()},0)},children:Be.image.map((Ke,ft)=>{const yt=Be.image.filter(lt=>!Zt(lt)),ut=yt.map(lt=>lt.url),vn=yt.findIndex(lt=>lt.url===Ke.url);return r.jsx(Xo,{children:r.jsx(Ar,{media:Ke,className:`${a}-item-${Zt(Ke)?"video":"image"}`.trim(),style:ke,onImageClick:Zt(Ke)?void 0:lt=>sn(lt,ut,vn)})},ft)})},`${H}-${We}-${$}-${b}-${rt}-${d}`)]})}),$t=_e?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&St?"titleMarginTop":void 0,className:o&&St?`${a}-control`:void 0,style:{height:St?L.scalingValue(R??0,n):0,width:se}}),r.jsx("p",{className:z,style:{width:V,...ce,...A},children:Be.title}),r.jsx("div",{"data-controls":o&&oe?"subtitleMarginTop":void 0,className:o&&oe?`${a}-control`:void 0,style:{height:oe?L.scalingValue(B??0,n):0,width:se}}),r.jsx("p",{className:ue,style:{width:V,...Pe,...X},children:Be.subtitle})]});return r.jsx("div",{className:`${a}-item`.trim(),children:r.jsx("div",{className:`${o?`${a}-item-inner`:`${a}-item-inner-hidden`}${D&&Ee?` ${a}-item-inner-last-row`:""}`.trim(),style:{width:(T??0)>100?`calc(${L.scalingValue(We??0,n)} * (${T} / 100))`:L.scalingValue(We??0,n)},children:D?r.jsxs(r.Fragment,{children:[je,r.jsx("a",{href:xe,target:"_blank",className:`${a}-item-image-link`,children:Ct})]}):r.jsxs("a",{href:xe,target:"_blank",className:`${a}-item-image-link`,children:[Ne,Ct,$t]})})},xt)})})}),(!n||i)&&ve&&typeof document<"u"&&g==="on"&&ei.createPortal(r.jsx("div",{style:le,"data-selection":"none",children:r.jsx(Qd,{images:Re,index:Lt,imageDisplay:eu(w),originRect:Yt,reverseClose:S==="off",onClose:()=>Se(!1),onPrev:()=>bt(Be=>(Be-1+Re.length)%Re.length),onNext:()=>bt(Be=>(Be+1)%Re.length),counterClassName:q,counterStyle:Le})}),document.body)]})}const nu={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},iu=["hover","focus","filled","success","error"],ou=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
3848
|
+
`}const Dt=500,Zd=750,Zt="cubic-bezier(0.22, 1, 0.36, 1)";function Qt(e){return e.type==="video"?!0:e.type==="image"?!1:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url)}function Ar({media:e,className:t,style:n,onImageClick:i}){return Qt(e)?r.jsx("video",{src:e.url,className:t,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0}):r.jsx("img",{src:e.url,alt:e.name,className:t,style:n,onClick:i})}function Qd({images:e,index:t,imageDisplay:n,originRect:i,reverseClose:o,onClose:l,onPrev:s,onNext:d,counterClassName:a,counterStyle:p}){const u=n==="cover",L=c.useRef(null),C=c.useRef(null),[y,g]=c.useState(null),[h,T]=c.useState(i?"opening":"open"),[$,x]=c.useState(!0),S=c.useRef(t),H=c.useCallback(()=>{const m=L.current,b=C.current;if(!m||!b)return;const P=m.getBoundingClientRect(),F=P.width,U=P.height,J=b.naturalWidth,W=b.naturalHeight;if(!F||!U||!J||!W)return;if(n==="cover"){g({width:F,height:U,left:P.left,top:P.top});return}const N=J/W,v=F/U;if(N>v){const _=F/N;g({width:F,height:_,left:P.left,top:P.top+(U-_)/2})}else{const _=U*N;g({width:_,height:U,left:P.left+(F-_)/2,top:P.top})}},[n]);c.useEffect(()=>{H();const m=L.current;if(!m)return;const b=new ResizeObserver(()=>H());return b.observe(m),()=>b.disconnect()},[H,t]),c.useEffect(()=>{h==="opening"&&y&&T("open")},[h,y]),c.useEffect(()=>{if(h!=="closing")return;const m=setTimeout(()=>l(),Dt);return()=>clearTimeout(m)},[h,l]),c.useEffect(()=>{S.current!==t&&x(!1),S.current=t},[t]),c.useEffect(()=>{const m=b=>{b.key==="Escape"&&(b.preventDefault(),b.stopPropagation(),h!=="closing"&&T("closing"))};return window.addEventListener("keydown",m,!0),()=>window.removeEventListener("keydown",m,!0)},[h]);const R=()=>{h!=="closing"&&T("closing")},B=h==="open",w=h==="closing",I=w&&o&&!!i,O=h==="opening"?i??y:I?i:y;return r.jsxs("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:9997},onClick:R,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:B?1:0,transition:`opacity ${Dt}ms ${Zt}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:u?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:L,style:{position:"absolute",inset:0}}),r.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:B?1:0,transition:`opacity ${Dt}ms ${Zt}`,pointerEvents:"none",zIndex:9999},children:e.length>1&&r.jsxs("p",{className:a,style:p,children:[t+1," / ",e.length]})})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:L,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:B?1:0,transition:`opacity ${Dt}ms ${Zt}`},children:e.length>1&&r.jsxs("p",{className:a,style:p,children:[t+1," / ",e.length]})})]})}),O&&r.jsx("img",{ref:C,src:e[t],onLoad:H,style:{position:"fixed",top:O.top,left:O.left,width:O.width,height:O.height,objectFit:n==="cover"?"cover":"contain",opacity:w&&!I?0:1,transition:w&&!I?`opacity ${Dt}ms ${Zt}`:I||$?`top ${Dt}ms ${Zt}, left ${Dt}ms ${Zt}, width ${Dt}ms ${Zt}, height ${Dt}ms ${Zt}`:"none",pointerEvents:"none",zIndex:9998}}),B&&y&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{position:"fixed",top:y.top,left:y.left,width:y.width/2,height:y.height,cursor:"w-resize",zIndex:9999},onClick:m=>{m.stopPropagation(),s()}}),r.jsx("div",{style:{position:"fixed",top:y.top,left:y.left+y.width/2,width:y.width/2,height:y.height,cursor:"e-resize",zIndex:9999},onClick:m=>{m.stopPropagation(),d()}})]})]})}function eu(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function tu({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:l,activeEvent:s,layoutId:d}){const{prefix:a}=E.useScopedStyles(),{type:p="a",gridLayout:u,textBoxWidth:L=100,verticalGap:C,entriesCount:y,lightbox:g,imageDisplay:h,lightboxImageDisplay:T,slider:$,sliderTiming:x,direction:S,transition:H,titleMarginTop:R,subtitleMarginTop:B,titleColor:w,subtitleColor:I,lightboxCounterColor:O,titleFontFamily:m,titleFontSettings:b,titleFontSize:P,titleLineHeight:F,titleLetterSpacing:U,titleWordSpacing:J,titleTextAppearance:W,subtitleFontFamily:N,subtitleFontSettings:v,subtitleFontSize:_,subtitleLineHeight:A,subtitleLetterSpacing:j,subtitleWordSpacing:z,subtitleTextAppearance:Q,lightboxCounterFontFamily:M,lightboxCounterFontSettings:ne,lightboxCounterFontSize:f,lightboxCounterLineHeight:ie,lightboxCounterLetterSpacing:ye,lightboxCounterWordSpacing:te,lightboxCounterTextAppearance:he,showText:oe="always",alignEntries:ue="off"}=e,V={fontSettings:{fontFamily:m,fontWeight:(b==null?void 0:b.fontWeight)??400,fontStyle:(b==null?void 0:b.fontStyle)??"normal"},fontSize:P??.01,lineHeight:F,letterSpacing:U??0,wordSpacing:J??0,textAppearance:W,color:w},le={...Wt(mt(V,n))},de={fontSettings:{fontFamily:N,fontWeight:(v==null?void 0:v.fontWeight)??400,fontStyle:(v==null?void 0:v.fontStyle)??"normal"},fontSize:_??.01,lineHeight:A,letterSpacing:j??0,wordSpacing:z??0,textAppearance:Q,color:I},Pe={...Wt(mt(de,n))},Ee={fontSettings:{fontFamily:M,fontWeight:(ne==null?void 0:ne.fontWeight)??400,fontStyle:(ne==null?void 0:ne.fontStyle)??"normal"},fontSize:f??.01,lineHeight:ie,letterSpacing:ye??0,wordSpacing:te??0,textAppearance:he,color:O},Ie={...Wt(mt(Ee,n)),...lo(f,ie,a,n)},D=ao(P,F,`${a}-item-title`,`${a}-text-tight-leading`),se=ao(_,A,`${a}-item-subtitle`,`${a}-text-tight-leading`),k=lo(P,F,a,n),K=lo(_,A,a,n),q=ao(f,ie,`${a}-lightbox-counter`,`${a}-text-tight-leading`),Z=E.buildColorVars(a,{titleColor:w,subtitleColor:I,lightboxCounterColor:O},nu,iu),Fe=`${s&&s!=="default"?`${a}-state-${s}`:""}${oe==="on hover"&&(!n||i)?` ${a}-show-text-hover`:""}`.trim(),$e=y===0?1/0:y,we=(t??[]).slice(0,$e),We=u.entryWidth??.2,pe=(h==null?void 0:h.display)==="cover",xe=(h==null?void 0:h.ratioValue)??"1:1",Te=(h==null?void 0:h.reversed)??!1,[Ne,Ue]=xe.split(":").map(Number),gt=`${Te?Ue:Ne} / ${Te?Ne:Ue}`,vt=E.scalingValue(We??0,n),ut=!pe&&$!=="off",bt={width:vt,...pe?{aspectRatio:gt,height:"auto",overflow:"hidden"}:{height:"auto"}},Ze=`${a}-item-image-wrapper${ut?` ${a}-item-image-wrapper-fit-slider`:""}`.trim(),_e=p==="c",nt=_e&&ue==="on",Qe=`calc(${E.scalingValue(We??0,n)} * (${L} / 100))`,G=E.scalingValue(We*L/100,n),X=pe?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},[me,Re]=c.useState("ltr"),[Oe,rt]=c.useState(0),Se=c.useRef(null);c.useEffect(()=>{const Be=Se.current;if(!Be)return;const pt=new ResizeObserver($t=>{rt(Math.round($t[0].contentRect.width))});return pt.observe(Be),()=>pt.disconnect()},[]);const Je=(()=>{const Be={...Z},pt=Se.current?getComputedStyle(Se.current).getPropertyValue("--cntrl-article-width").trim():"";return pt&&(Be["--cntrl-article-width"]=pt),Be})(),[ee,fe]=c.useState(!1),[Ae,je]=c.useState([]),[Ke,ht]=c.useState(0),[kt,jt]=c.useState(null),Ft=(Be,pt,$t)=>{if(n&&!i||g==="off")return;const re=Be.currentTarget.getBoundingClientRect();jt({top:re.top,left:re.left,width:re.width,height:re.height}),je(pt),ht($t),fe(!0)};c.useEffect(()=>{if(!ee||g!=="on"||typeof document>"u")return;const Be=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Be}},[ee,g]),c.useEffect(()=>{!n||i||(fe(!1),jt(null))},[n,i]);const yn=c.useMemo(()=>Jd(a),[a]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:yn}}),r.jsx("div",{style:Z,children:r.jsx("div",{ref:Se,className:`${a}-wrapper ${a}-type-${p}${nt?` ${a}-align-entries`:""} ${Fe}`.trim(),style:{gridTemplateColumns:`repeat(${u.columnsCount}, minmax(0, 1fr))`,rowGap:nt?0:E.scalingValue(C??0,n),columnGap:E.scalingValue(u.horizontalGap??0,n),width:E.scalingValue(u.wrapperWidth??0,n),...nt?{[`--${a}-align-entries-row-gap`]:E.scalingValue(C??0,n)}:{}},children:we.map((Be,pt)=>{var ct,Lt;const $t=_r(Be.title),re=_r(Be.subtitle),be=(((ct=Be.link)==null?void 0:ct.length)??0)>0&&g==="off"?Be.link:void 0,Le=Math.floor(pt/u.columnsCount)===Math.ceil(we.length/u.columnsCount)-1,He=_e?r.jsxs("div",{className:`${a}-item-text-block`,children:[$t&&r.jsx("p",{className:D,style:{width:Qe,...le,...k},children:Be.title}),$t&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:E.scalingValue(R??0,n),width:G}}),re&&r.jsx("p",{className:se,style:{width:Qe,...Pe,...K},children:Be.subtitle}),re&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:E.scalingValue(B??0,n),width:G}})]}):null,it=_e?r.jsxs("div",{className:`${a}-item-title-row`,children:[$t&&r.jsx("p",{className:D,style:{width:Qe,...le,...k},children:Be.title}),$t&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:E.scalingValue(R??0,n),width:G}})]}):null,st=_e?r.jsxs("div",{className:`${a}-item-subtitle-row`,children:[re&&r.jsx("p",{className:se,style:{width:Qe,...Pe,...K},children:Be.subtitle}),re&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:E.scalingValue(B??0,n),width:G}})]}):null,De=be?r.jsxs("a",{href:be,target:"_blank",className:`${a}-item-text-link`,children:[it,st]}):r.jsxs(r.Fragment,{children:[it,st]}),wt=r.jsx("div",{className:Ze,style:bt,children:(((Lt=Be.image)==null?void 0:Lt.length)??0)===0?null:$==="off"?(()=>{const Ge=Be.image[0],St=Be.image.filter(ft=>!Qt(ft)).map(ft=>ft.url);return r.jsx(Ar,{media:Ge,className:`${a}-item-${Qt(Ge)?"video":"image"}`.trim(),style:X,onImageClick:Qt(Ge)?void 0:ft=>Ft(ft,St,0)})})():r.jsxs(r.Fragment,{children:[ut&&r.jsx("div",{className:`${a}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Be.image.map(Ge=>Qt(Ge)?r.jsx("video",{src:Ge.url,muted:!0,playsInline:!0},`sizer-${Ge.url}`):r.jsx("img",{src:Ge.url,alt:""},`sizer-${Ge.url}`))}),r.jsx(qo,{className:`${a}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:x*1e3,width:"100%",height:"100%",speed:Zd,type:H==="fade"?"fade":"loop",rewind:H==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:H==="fade"?"ltr":S!=="random"?S==="horizontal"?"ltr":"ttb":me},onMoved:Ge=>{if(S!=="random"||H==="fade")return;const xt=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";Re(xt),setTimeout(()=>{Ge.refresh()},0)},children:Be.image.map((Ge,xt)=>{const St=Be.image.filter(dt=>!Qt(dt)),ft=St.map(dt=>dt.url),vn=St.findIndex(dt=>dt.url===Ge.url);return r.jsx(Xo,{children:r.jsx(Ar,{media:Ge,className:`${a}-item-${Qt(Ge)?"video":"image"}`.trim(),style:X,onImageClick:Qt(Ge)?void 0:dt=>Ft(dt,ft,vn)})},xt)})},`${H}-${We}-${S}-${x}-${Oe}-${d}`)]})}),Tt=_e?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&$t?"titleMarginTop":void 0,className:o&&$t?`${a}-control`:void 0,style:{height:$t?E.scalingValue(R??0,n):0,width:G}}),r.jsx("p",{className:D,style:{width:Qe,...le,...k},children:Be.title}),r.jsx("div",{"data-controls":o&&re?"subtitleMarginTop":void 0,className:o&&re?`${a}-control`:void 0,style:{height:re?E.scalingValue(B??0,n):0,width:G}}),r.jsx("p",{className:se,style:{width:Qe,...Pe,...K},children:Be.subtitle})]});return r.jsx("div",{className:`${a}-item`.trim(),children:r.jsx("div",{className:`${o?`${a}-item-inner`:`${a}-item-inner-hidden`}${nt&&Le?` ${a}-item-inner-last-row`:""}`.trim(),style:{width:(L??0)>100?`calc(${E.scalingValue(We??0,n)} * (${L} / 100))`:E.scalingValue(We??0,n)},children:nt?r.jsxs(r.Fragment,{children:[De,r.jsx("a",{href:be,target:"_blank",className:`${a}-item-image-link`,children:wt})]}):r.jsxs("a",{href:be,target:"_blank",className:`${a}-item-image-link`,children:[He,wt,Tt]})})},pt)})})}),(!n||i)&&ee&&typeof document<"u"&&g==="on"&&ei.createPortal(r.jsx("div",{style:Je,"data-selection":"none",children:r.jsx(Qd,{images:Ae,index:Ke,imageDisplay:eu(T),originRect:kt,reverseClose:$==="off",onClose:()=>fe(!1),onPrev:()=>ht(Be=>(Be-1+Ae.length)%Ae.length),onNext:()=>ht(Be=>(Be+1)%Ae.length),counterClassName:q,counterStyle:Ie})}),document.body)]})}const nu={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},iu=["hover","focus","filled","success","error"],ou=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
3849
3849
|
import '@splidejs/react-splide/css/core';
|
|
3850
3850
|
import { CommonComponentProps } from '../props';
|
|
3851
3851
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -5014,7 +5014,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
5014
5014
|
};
|
|
5015
5015
|
|
|
5016
5016
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
5017
|
-
`,lo={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},ru=["titleColor","subtitleColor","lightboxCounterColor"],au={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},subtitle:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{type:"media-list-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:[{title:"Flying Over the Old Town",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(1).webp",objectFit:"cover"}],link:""},{title:"Doors of Matera",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(2).webp",objectFit:"cover"}],link:""},{title:"Cattedrale di Santa Maria",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(3).webp",objectFit:"cover"}],link:""},{title:"City Through the Cracks",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(4).webp",objectFit:"cover"}],link:""},{title:"Private Stone Gardens",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(5).webp",objectFit:"cover"},{url:"https://cdn.cntrl.site/component-assets/grid(6).webp",objectFit:"cover"},{url:"https://cdn.cntrl.site/component-assets/grid(7).webp",objectFit:"cover"}],link:""},{title:"Leaving the Old Town",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(8).webp",objectFit:"cover"}],link:""},{title:"Under the Sun",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(9).webp",objectFit:"cover"}],link:""},{title:"Citygates View",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(10).webp",objectFit:"cover"}],link:""},{title:"Around the City",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(11).webp",objectFit:"cover"}],link:""}]},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:4},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gap",min:0}}}},textBoxWidth:{type:"number",scope:"layout",title:"Text Width (%)",display:{type:"percentage-input"},min:0},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},showText:{type:"boolean",scope:"common",title:"Show text",display:{type:"toggle-cycle",enum:["always","on hover"]}},alignEntries:{type:"boolean",scope:"layout",title:"Align entries",display:{type:"toggle-cycle",enum:["on","off"]}},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageDisplay:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},slider:{type:"boolean",scope:"common",title:"Slider",display:{type:"toggle-cycle",enum:["on","off"]}},sliderTiming:{type:"number",scope:"common",title:"Timing (Sec)",display:{type:"common-numeric-input"},min:1,max:10},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical","random"],enabled:!0}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","slide"]}},titleMarginTop:{type:"number",scope:"layout",title:"Title margin top",min:0,max:100,display:{type:"range-control"}},subtitleMarginTop:{type:"number",scope:"layout",title:"Subtitle margin top",min:0,max:100,display:{type:"range-control"}},titleColor:{type:"string",scope:"common",title:"Title Entry",display:{type:"palette-color-picker"}},subtitleColor:{type:"string",scope:"common",title:"Subtitle Entry",display:{type:"palette-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...lo.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},subtitleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},subtitleFontSettings:{...lo.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},subtitleFontSize:{type:"number",scope:"layout",title:"Subtitle Font Size",display:{type:"font-size"}},subtitleLineHeight:{type:"number",scope:"layout",title:"Subtitle Line Height",display:{type:"line-height-input"}},subtitleLetterSpacing:{type:"number",scope:"layout",title:"Subtitle Letter Spacing",display:{type:"letter-spacing-input"}},subtitleWordSpacing:{type:"number",scope:"layout",title:"Subtitle Word Spacing",display:{type:"word-spacing-input"}},subtitleTextAppearance:{type:"object",scope:"layout",title:"Subtitle Text Appearance",display:{type:"text-appearance"}},lightboxCounterFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},lightboxCounterFontSettings:{...lo.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},lightboxCounterFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},lightboxCounterLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},lightboxCounterLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},lightboxCounterWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},lightboxCounterTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}}},defaults:{lightbox:"on",imageDisplay:{display:"cover",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",slider:"on",sliderTiming:3,direction:"horizontal",transition:"fade",showText:"always",alignEntries:"on",titleColor:"#000000",subtitleColor:"#000000",lightboxCounterColor:"#DEDDDD",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},subtitleFontFamily:"Goudy Bookletter 1911",subtitleFontSettings:{fontWeight:400,fontStyle:"normal"},subtitleLetterSpacing:0,subtitleWordSpacing:0,subtitleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{type:"a",gridLayout:{entryWidth:.8,horizontalGap:.0533,wrapperWidth:1,columnsCount:1,lockedParam:null},textBoxWidth:100,verticalGap:.266,entriesCount:0,titleMarginTop:.02,subtitleMarginTop:.02,titleStroke:.003,titleCorners:.192,subtitlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titleFontSize:.1066,titleLineHeight:.0853,subtitleFontSize:.056,subtitleLineHeight:.0506,lightboxCounterFontSize:.0373,lightboxCounterLineHeight:.0373},d:{type:"a",gridLayout:{entryWidth:.0833,horizontalGap:0,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:200,verticalGap:.09722,entriesCount:0,titleMarginTop:.008,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.027,titleLineHeight:.0222,titleLetterSpacing:-.00118,subtitleFontSize:.01,subtitleLineHeight:.01,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01}},displayRules:[{if:{name:"transition",value:"fade"},then:{name:"properties.direction.display.enabled",value:!1}},{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignEntries.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.alignEntries.display.visible",value:!1}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","showText","alignEntries","entriesCount","lightbox","imageDisplay","lightboxImageDisplay","slider","sliderTiming","direction","transition","transition","titleMarginTop","subtitleMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"Grid",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["textBoxWidth","entriesCount"]},{type:"row",title:"",items:["verticalGap","showText"]},{type:"row",title:"",items:["alignEntries"]}]},{id:"imageSettings",icon:"cover",title:"Image settings",tooltip:"Image settings",layout:["__componentName__",{type:"row",title:"Image",items:["imageDisplay"]},{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",title:"Slider",items:[{type:"group",title:"",items:["slider","sliderTiming"]},{type:"group",title:"",items:["direction","transition"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Subtitle",items:["subtitleFontFamily","subtitleFontSettings",{type:"row",items:["subtitleFontSize","subtitleLineHeight","subtitleLetterSpacing","subtitleWordSpacing"]},"subtitleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:[...ru],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},su={element:tu,id:"grid",name:"Neptune",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Neptune_Grid.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},schema:au,sourceCode:ou};function lu(e){if(e.type==="video")return!0;if(e.type==="image")return!1;const t=e.name??"";return/\.(mp4|webm|ogg|mov)(\?|$)/i.test(t)?!0:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url)}function cu({media:e,className:t,style:n}){const i=c.useRef(null);return c.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const s=o.play();s&&s.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?r.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):r.jsx("img",{className:t,src:e.url,alt:"",style:n})}function Li(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function du(e){return String(e??"").trim().length>0}function Mr(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY-i.top>i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function kr(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY<i.top+i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function Fr(e,t,n,i,o,s,l){const d=L.scalingValue(s,l),a=L.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:a,borderBottomWidth:!p||i?d:a}}function uu(e,t,n){const i=L.scalingValue(t,n),o=L.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Wr=10;function pu(e){return`
|
|
5017
|
+
`,so={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},ru=["titleColor","subtitleColor","lightboxCounterColor"],au={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},subtitle:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{type:"media-list-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:[{title:"Flying Over the Old Town",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(1).webp",objectFit:"cover"}],link:""},{title:"Doors of Matera",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(2).webp",objectFit:"cover"}],link:""},{title:"Cattedrale di Santa Maria",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(3).webp",objectFit:"cover"}],link:""},{title:"City Through the Cracks",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(4).webp",objectFit:"cover"}],link:""},{title:"Private Stone Gardens",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(5).webp",objectFit:"cover"},{url:"https://cdn.cntrl.site/component-assets/grid(6).webp",objectFit:"cover"},{url:"https://cdn.cntrl.site/component-assets/grid(7).webp",objectFit:"cover"}],link:""},{title:"Leaving the Old Town",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(8).webp",objectFit:"cover"}],link:""},{title:"Under the Sun",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(9).webp",objectFit:"cover"}],link:""},{title:"Citygates View",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(10).webp",objectFit:"cover"}],link:""},{title:"Around the City",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(11).webp",objectFit:"cover"}],link:""}]},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:4},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gap",min:0}}}},textBoxWidth:{type:"number",scope:"layout",title:"Text Width (%)",display:{type:"percentage-input"},min:0},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},showText:{type:"boolean",scope:"common",title:"Show text",display:{type:"toggle-cycle",enum:["always","on hover"]}},alignEntries:{type:"boolean",scope:"layout",title:"Align entries",display:{type:"toggle-cycle",enum:["on","off"]}},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageDisplay:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},slider:{type:"boolean",scope:"common",title:"Slider",display:{type:"toggle-cycle",enum:["on","off"]}},sliderTiming:{type:"number",scope:"common",title:"Timing (Sec)",display:{type:"common-numeric-input"},min:1,max:10},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical","random"],enabled:!0}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","slide"]}},titleMarginTop:{type:"number",scope:"layout",title:"Title margin top",min:0,max:100,display:{type:"range-control"}},subtitleMarginTop:{type:"number",scope:"layout",title:"Subtitle margin top",min:0,max:100,display:{type:"range-control"}},titleColor:{type:"string",scope:"common",title:"Title Entry",display:{type:"palette-color-picker"}},subtitleColor:{type:"string",scope:"common",title:"Subtitle Entry",display:{type:"palette-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...so.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},subtitleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},subtitleFontSettings:{...so.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},subtitleFontSize:{type:"number",scope:"layout",title:"Subtitle Font Size",display:{type:"font-size"}},subtitleLineHeight:{type:"number",scope:"layout",title:"Subtitle Line Height",display:{type:"line-height-input"}},subtitleLetterSpacing:{type:"number",scope:"layout",title:"Subtitle Letter Spacing",display:{type:"letter-spacing-input"}},subtitleWordSpacing:{type:"number",scope:"layout",title:"Subtitle Word Spacing",display:{type:"word-spacing-input"}},subtitleTextAppearance:{type:"object",scope:"layout",title:"Subtitle Text Appearance",display:{type:"text-appearance"}},lightboxCounterFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},lightboxCounterFontSettings:{...so.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},lightboxCounterFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},lightboxCounterLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},lightboxCounterLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},lightboxCounterWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},lightboxCounterTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}}},defaults:{lightbox:"on",imageDisplay:{display:"cover",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",slider:"on",sliderTiming:3,direction:"horizontal",transition:"fade",showText:"always",alignEntries:"on",titleColor:"#000000",subtitleColor:"#000000",lightboxCounterColor:"#DEDDDD",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},subtitleFontFamily:"Goudy Bookletter 1911",subtitleFontSettings:{fontWeight:400,fontStyle:"normal"},subtitleLetterSpacing:0,subtitleWordSpacing:0,subtitleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{type:"a",gridLayout:{entryWidth:.8,horizontalGap:.0533,wrapperWidth:1,columnsCount:1,lockedParam:null},textBoxWidth:100,verticalGap:.266,entriesCount:0,titleMarginTop:.02,subtitleMarginTop:.02,titleStroke:.003,titleCorners:.192,subtitlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titleFontSize:.1066,titleLineHeight:.0853,subtitleFontSize:.056,subtitleLineHeight:.0506,lightboxCounterFontSize:.0373,lightboxCounterLineHeight:.0373},d:{type:"a",gridLayout:{entryWidth:.0833,horizontalGap:0,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:200,verticalGap:.09722,entriesCount:0,titleMarginTop:.008,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.027,titleLineHeight:.0222,titleLetterSpacing:-.00118,subtitleFontSize:.01,subtitleLineHeight:.01,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01}},displayRules:[{if:{name:"transition",value:"fade"},then:{name:"properties.direction.display.enabled",value:!1}},{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignEntries.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.alignEntries.display.visible",value:!1}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","showText","alignEntries","entriesCount","lightbox","imageDisplay","lightboxImageDisplay","slider","sliderTiming","direction","transition","transition","titleMarginTop","subtitleMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"Grid",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["textBoxWidth","entriesCount"]},{type:"row",title:"",items:["verticalGap","showText"]},{type:"row",title:"",items:["alignEntries"]}]},{id:"imageSettings",icon:"cover",title:"Image settings",tooltip:"Image settings",layout:["__componentName__",{type:"row",title:"Image",items:["imageDisplay"]},{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",title:"Slider",items:[{type:"group",title:"",items:["slider","sliderTiming"]},{type:"group",title:"",items:["direction","transition"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Subtitle",items:["subtitleFontFamily","subtitleFontSettings",{type:"row",items:["subtitleFontSize","subtitleLineHeight","subtitleLetterSpacing","subtitleWordSpacing"]},"subtitleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:[...ru],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},lu={element:tu,id:"grid",name:"Neptune",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Neptune_Grid.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},schema:au,sourceCode:ou};function su(e){if(e.type==="video")return!0;if(e.type==="image")return!1;const t=e.name??"";return/\.(mp4|webm|ogg|mov)(\?|$)/i.test(t)?!0:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url)}function cu({media:e,className:t,style:n}){const i=c.useRef(null);return c.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const l=o.play();l&&l.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?r.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):r.jsx("img",{className:t,src:e.url,alt:"",style:n})}function Li(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function du(e){return String(e??"").trim().length>0}function Mr(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY-i.top>i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function kr(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY<i.top+i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function Fr(e,t,n,i,o,l,s){const d=E.scalingValue(l,s),a=E.scalingValue(0,s),p=e===0,u=e===t-1&&!o;return{borderTopWidth:p&&n?d:a,borderBottomWidth:!u||i?d:a}}function uu(e,t,n){const i=E.scalingValue(t,n),o=E.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Wr=10;function pu(e){return`
|
|
5018
5018
|
.${e}-wrapper {
|
|
5019
5019
|
display: grid;
|
|
5020
5020
|
align-items: start;
|
|
@@ -5445,7 +5445,7 @@ a.${e}-list-item {
|
|
|
5445
5445
|
overflow-wrap: anywhere;
|
|
5446
5446
|
word-break: break-word;
|
|
5447
5447
|
}
|
|
5448
|
-
`}const nn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Yo=["AColumn","BColumn","CColumn","DColumn","EColumn"],Ut="cutLabel",Jo=[...Yo,Ut],Xi=["A","B","C","D","E"];function ja(e){return`${e}ColumnVerticalAlign`}const To=["Top","Center","Bottom"];function Zo(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Xi.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function mu(e){const t=Zo(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function gu(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Xi.includes(n)?n:null}function za(e,t,n){const i=gu(e);return i?i===t?!1:mu(n[ja(i)]):!0}function Jn(e){const t=Zo(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Xi.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function hu(e,t,n){if(Da(e,t,n))return Jn(e);const i=Jn(e);return i.kind==="baseline"?{kind:"top"}:i}function fu(e){const t=Jn(e);return t.kind==="baseline"?{kind:"top"}:t}function Da(e,t,n){return za(e,n,t)?Jn(e).kind==="baseline":!1}function yu(e){const t={};let n=!1;for(const i of Xi){const o=ja(i),s=e[o];if(e.type==="b"){const l=String(s??"Top").trim();l!=="Top"&&l!=="Center"&&l!=="Bottom"&&(t[o]="Top",n=!0);continue}za(s,i,e)||(t[o]="Top",n=!0)}return n?t:null}function vu(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function bu(e){const t=Jn(e).kind;return t==="baseline"?"center":t}function xu(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Nr(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Su(e,t){const n=document.createElement("i");n.className=t,n.setAttribute("aria-hidden","true"),e.prepend(n);const{top:i}=e.getBoundingClientRect(),{bottom:o}=n.getBoundingClientRect(),s=o-i;return n.remove(),s}function co(e,t,n,i){const o=e.titleEl;if(!o)return 0;const s=o.closest(`.${n}`);if(!s)return 0;const l=Su(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const d=s.getBoundingClientRect(),a=o.getBoundingClientRect().height;let u=0;return e.kind==="center"?u=(d.height-a)/2:e.kind==="bottom"&&(u=d.height-a),d.top-t+u+l}function Cu(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const s=o.querySelector(`.${n}`);s&&(s.style.minHeight=`${i}px`,s.style.height=`${i}px`)}),i)}function $u(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const wu={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function ze(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Tu={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function Lu(e){return[ze(e,"textFontFamily"),ze(e,"textFontSettings"),{type:"row",items:[ze(e,"textFontSize"),ze(e,"textLineHeight"),ze(e,"textLetterSpacing"),ze(e,"textWordSpacing")]},ze(e,"textTextAlign"),ze(e,"textTextAppearance"),`${e}VerticalAlign`]}function Eu(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Jo.map(e=>[Tu[e],Lu(e)]))}}function Wi(e,t){const n=i=>{const o=ze(t,i);return e[o]};return{textFontFamily:n("textFontFamily")??"Arial",textFontSettings:n("textFontSettings")??{fontWeight:400,fontStyle:"normal"},textFontSize:n("textFontSize"),textLineHeight:n("textLineHeight"),textLetterSpacing:n("textLetterSpacing")??0,textWordSpacing:n("textWordSpacing")??0,textTextAlign:n("textTextAlign")??(t===Ut?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Hr(e,t){var i,o;const n={fontSettings:{fontFamily:e.textFontFamily,fontWeight:((i=e.textFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e.textFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:e.textFontSize??.01,lineHeight:e.textLineHeight,letterSpacing:e.textLetterSpacing,wordSpacing:e.textWordSpacing,textAlign:e.textTextAlign,textAppearance:e.textTextAppearance,color:e.textColor??"#767676"};return Ft(dt(n,t))}function Or(e,t,n,i){const o=Wi(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<s?`${n} ${i}`:n}function Br(e,t,n,i){const o=Wi(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=s?{}:{[`--${n}-title-leading-gap`]:L.scalingValue((s-l)/2,i)}}const Rt=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],_n=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],An=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Mn=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Iu={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Ru=["hover","focus","filled","success","error"],jr=.004,wn=.004,uo=wn,zr=12,Qo=50,Zn=1440,Qn=Qo/Zn;function Va(e){const t=typeof e=="number"&&e>0?e:Zn;return Qo/t}function Pu(e,t){const n={position:"absolute",width:zr,height:zr,pointerEvents:"auto"};return t==="left-y"?{...n,left:20,top:"50%",transform:"translateY(-50%)"}:t==="center-x"?{...n,left:"50%",top:`var(--${e}-first-entry-handle-top, 50%)`,transform:"translate(-50%, -50%)"}:{...n,left:"50%",top:"50%",transform:"translate(-50%, -50%)"}}function jt({P:e,className:t,areaStyle:n,hitPlacement:i,...o}){return r.jsx("div",{className:t,style:{...n,pointerEvents:"none"},...o,children:r.jsx("div",{style:Pu(e,i)})})}function _u(e){let t=e??null;for(;t;){const n=t.style.getPropertyValue("--cntrl-article-width").trim();if(n){const o=parseFloat(n);if(Number.isFinite(o)&&o>0)return o}const i=getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim();if(i){const o=parseFloat(i);if(Number.isFinite(o)&&o>0)return o}t=t.parentElement}return Zn}const Ga={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function jn(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Au(e,t=1){const n=t/e;return Object.fromEntries(Rt.map(i=>[i,n]))}function Mu(){return Object.fromEntries([..._n.map(e=>[e,0]),...An.map(e=>[e,0])])}function ku(){return Object.fromEntries(Mn.map(e=>[e,0]))}function yi(e){return Object.fromEntries(Rt.map(t=>[t,typeof e[t]=="number"?e[t]:Ga[t]]))}function Ua(e,t,n){const i=e-Qn,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const s=i/o;return{paddingLeft:t*s,paddingRight:n*s}}function Ei(e,t,n){const i=er(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((s,l)=>s+l,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function Fu(e,t,n){const i={};for(let o=0;o<e;o+=1){const s=_n[o],l=An[o],d=typeof n[s]=="number"?n[s]:0,a=typeof n[l]=="number"?n[l]:0,u=Ua(t[o]??0,d,a);u.paddingLeft!==d&&(i[s]=u.paddingLeft),u.paddingRight!==a&&(i[l]=u.paddingRight)}return i}function er(e,t,n){if(e<=0)return[];const i=Rt.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),l=o.reduce((u,p)=>u+p,0)+Qn;if(t>=l)return i;const d=[...o];let a=l-t;for(let u=d.length-1;u>=0&&a>0;u-=1){const p=d[u]-Qn;if(p<=0)continue;const T=Math.min(a,p);d[u]-=T,a-=T}return[...d,i[e-1]]}function Wu(e,t,n){if(e<=1)return{};const i=er(e,t,n),o={};for(let s=0;s<e-1;s+=1){const l=Rt[s];i[s]!==n[l]&&(o[l]=i[s])}return o}function Dr(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...nn]}function Nu(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Hu(e,t,n,i){const o=Math.min(i,e.length,Rt.length),s={};for(let l=0;l<o;l+=1){const d=e[l],a=t.indexOf(d);if(a===-1)continue;const u=Rt[a],p=_n[a],T=An[a],x=Mn[a],y=Rt[l],g=_n[l],h=An[l],w=Mn[l],S=n[u],b=n[p],$=n[T],H=n[x];typeof S=="number"&&(s[y]=S),typeof b=="number"&&(s[g]=b),typeof $=="number"&&(s[h]=$),typeof H=="number"&&(s[w]=H)}return s}function Ka(e,t){const n=new Set([...Object.keys(e),...Object.keys(t)]);for(const i of n)if(e[i]!==t[i])return!0;return!1}function Ou(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=jn(e),s=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...Au(n,o),...Mu()};if(s)for(const d of Mn)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,ku());return Ka(e,l)?l:e}function Bu(e,t,n){const i=yu(e);i&&(e={...e,...i});const o=Va(n==null?void 0:n.designWidth),s=e.columns,l=t.columns,d=jn(e),a=jn(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof s=="number"?s:typeof l=="number"?l:nn.length,T=$=>{if(u)return $;const H=yi({...t,...$}),R=jn($),B=Ei(p,R,H),m=Fu(p,B,{...t,...$});return Object.keys(m).length===0?$:{...$,...m}};if(typeof s=="number"&&s!==l)return e;const x=Dr(e),y=Dr(t);if(!Nu(x,y))return T({...e,...Hu(x,y,t,p)});if(d<a&&typeof p=="number"&&!u){const $=yi({...t,...e});return T({...e,...Wu(p,d,$)})}if(u){const $=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,H=Math.max(0,(d-o)/2);return $>H?{...e,textPaddingLR:H}:e}const g=yi({...t,...e}),h=Ei(p,a,yi(t)),S=Ei(p,d,g).some(($,H)=>$<(h[H]??$)),b=Rt.some($=>{const H=e[$],R=t[$];return typeof H=="number"&&typeof R=="number"&&H!==R});return S||b?T(e):e}function ju(e,t,n,i){const o=t.slice(0,e).reduce((l,d)=>l+d,0),s=n.slice(e+1,t.length-1).reduce((l,d)=>l+d,0);return Math.max(Qn,i-o-s-Qn)}function zu(e,t){return Math.random()*(t-e)+e}function Du(e){return Object.fromEntries(Rt.map(t=>[t,typeof e[t]=="number"?e[t]:Ga[t]]))}function po(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function Vu(e,t,n,i,o,s){return e.slice(0,t).map((l,d)=>{const a=_n[d],u=An[d],p=Mn[d];return{key:l,textPrefix:wu[l],widthKey:Rt[d],width:n[Rt[d]],paddingLeftKey:a,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[a],paddingRight:o[u],paddingBottom:s[p]}})}function Gu({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s,layoutId:l,onUpdateSettings:d}){const{prefix:a}=L.useScopedStyles(),u=!!o,{columns:p,type:T,wrapperWidth:x,entriesCount:y,cellMinHeight:g,dividerWidth:h,showVisibility:w,cut:S,showCut:b,cutCellMinHeight:$,cutLabel:H,imageSize:R,imageOnHover:B,entryHoverEffect:m,entryHoverShowOption:C,rowPaddingTop:N,rowPaddingBottom:v,rowPaddingTopB:E,columnsOrder:k,textPaddingLR:O,textColor:U,backgroundColor:Z,dividerColor:W,textHoverColor:P,backgroundHoverColor:I,dividerHoverColor:F}=e,[_,j]=c.useState(void 0),[K,te]=c.useState(null),M=B==="on"&&(!n||i),ne=(S??0)>0,f=T==="b",ee=c.useRef(null),ge=c.useRef(null),[ie,fe]=c.useState(null),[Q,me]=c.useState(Zn),G=Va(Q),J=Math.max(0,((x??0)-G)/2),ce=Math.min(O??0,J),pe=Math.max(ce,wn),Ce=((x??0)+G)/2;c.useLayoutEffect(()=>{if(!n){me(Zn);return}const oe=()=>{me(_u(ee.current))};oe();const xe=ee.current;if(!xe)return;const Ee=new ResizeObserver(oe);Ee.observe(xe);let Ne=xe;for(;Ne&&!Ne.style.getPropertyValue("--cntrl-article-width");)Ne=Ne.parentElement;return Ne&&Ee.observe(Ne),()=>Ee.disconnect()},[n,l]),c.useEffect(()=>{j(void 0)},[S,b,t,y]),c.useEffect(()=>{n&&!i&&j(void 0)},[n,i]);const Pe=L.buildColorVars(a,{textColor:U,backgroundColor:Z,dividerColor:W,textHoverColor:P,backgroundHoverColor:I,dividerHoverColor:F},Iu,Ru),Ie=s&&s!=="default"?`${a}-state-${s}`:"",Le=`${!n||i?m==="default"?`${a}-entry-hover-default`:m==="blinds"?`${a}-entry-hover-blinds`:m==="reveal"?`${a}-entry-hover-reveal`:"":""} ${Ie}`.trim(),z=m==="reveal"&&(!n||i),ue=(w==null?void 0:w[0])??!1,A=(w==null?void 0:w[1])??!1,X=c.useRef(e),q=c.useRef(l);c.useEffect(()=>{if(!d||!n){X.current=e,q.current=l;return}if(q.current!==l){X.current=e,q.current=l;return}const oe=X.current;if(!(oe!==e))return;if(typeof oe.columns=="number"&&typeof e.columns=="number"&&oe.columns!==e.columns){X.current=e;return}const Ee=Bu(e,oe,{designWidth:Q});X.current=e,Ka(e,Ee)&&d(Ee)},[e,d,n,l,Q]);const Y=c.useMemo(()=>Du(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),ae=c.useMemo(()=>po(e,_n),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),he=c.useMemo(()=>po(e,An),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),He=c.useMemo(()=>po(e,Mn),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),we=c.useMemo(()=>Array.isArray(k)&&k.length>0?k:[...nn],[k]),Te=c.useMemo(()=>Vu(we,p,Y,ae,he,He),[we,p,Y,ae,he,He]),We=jn(e),re=c.useMemo(()=>Rt.slice(0,p).map(oe=>Y[oe]),[p,Y]),be=c.useMemo(()=>er(p,We,Y),[p,We,Y]),Fe=c.useMemo(()=>Ei(p,We,Y),[p,We,Y]),Oe=c.useMemo(()=>Te.map((oe,xe)=>Ua(Fe[xe]??0,oe.paddingLeft,oe.paddingRight)),[Te,Fe]),Ge=c.useMemo(()=>{const oe=y===0?1/0:y;return(t??[]).slice(0,oe).map((Ee,Ne)=>({id:Ne,cells:Object.fromEntries(nn.map(tt=>[tt,Ee[tt]??""])),image:Ee.image,link:Ee.link}))},[t,y]),it=ne?_??S:Ge.length,mt=c.useMemo(()=>ne?Ge.slice(0,it):Ge,[Ge,ne,it]),ct=ne&&it<Ge.length,ot=mt.length>1||ct,gt=[ue?`${a}-divider-top`:"",A||ot?`${a}-divider-bottom`:""].filter(Boolean).join(" "),Je=!n||i,Tt=()=>{if(!Je)return;const oe=_??S;if(!b){j(Ge.length);return}j(Math.min(oe+b,Ge.length))},_e=oe=>L.scalingValue(oe,n??!1),D=f?E??0:N??0,V=v??0,se=g??0,ke=D+se/2,Ve=Math.max(V,uo),Ze=Fr(0,mt.length,ue,A,ct,h??0,n??!1).borderTopWidth,rt=ie!=null?`${ie}px`:`calc(${Ze} + ${_e(ke)})`,ht=f?"rowPaddingTopB":"rowPaddingTop",$e=Te[0],le=Te[Te.length-1],ve=Oe[0],Se=Oe[Oe.length-1],Re=$e&&ve?Math.max(ve.paddingLeft,wn):0,Ue=le&&Se?Math.max(Se.paddingRight,wn):0,Lt=We,bt=oe=>{const xe=ee.current;if(!xe)return{x:0,y:0};const Ee=xe.getBoundingClientRect();return{x:oe.clientX-Ee.left+Wr,y:oe.clientY-Ee.top+Wr}},Yt=(oe,xe)=>{if(!M)return;const Ee=oe.image;if(!(Ee!=null&&Ee.url)){te(null);return}const{x:Ne,y:tt}=bt(xe),at=(R==null?void 0:R.min)??80,je=(R==null?void 0:R.max)??320,Ct=(K==null?void 0:K.rowId)===oe.id?K.widthPx:zu(at,je);te({rowId:oe.id,url:Ee.url,objectFit:"contain",isVideo:lu(Ee),widthPx:Ct,x:Ne,y:tt})},kt=oe=>{if(!M||!K)return;const{x:xe,y:Ee}=bt(oe);te(Ne=>!Ne||Ne.x===xe&&Ne.y===Ee?Ne:{...Ne,x:xe,y:Ee})},sn=()=>{te(null)},yn=oe=>{z&&Mr(oe,a),M&&te(null)},Be=oe=>{z&&kr(oe,a)};c.useLayoutEffect(()=>{if(!u||f){fe(null);return}const oe=ge.current,xe=oe==null?void 0:oe.parentElement;if(!oe||!xe){fe(null);return}const Ee=()=>{const tt=oe.querySelector("[data-list-row]");if(!tt){fe(null);return}const at=xe.getBoundingClientRect(),je=tt.getBoundingClientRect();fe(je.top-at.top+je.height/2)};Ee();const Ne=new ResizeObserver(Ee);return Ne.observe(oe),Ne.observe(xe),()=>Ne.disconnect()},[u,f,mt,D,V,se,t,e,Te,Fe,Q,h,ue,A,ct]);const xt=c.useMemo(()=>!f&&Yo.some(oe=>{const xe=oe.charAt(0),Ee=e[`${oe}VerticalAlign`];return Da(Ee,e,xe)}),[f,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);c.useLayoutEffect(()=>{var Ct;const oe=ee.current;if(!oe)return;const xe=()=>{oe.querySelectorAll("[data-list-col]").forEach($t=>{$t.style.transform="";const st=$t.querySelector(`.${a}-list-col`);st&&(st.style.minHeight="",st.style.height="");const wt=$t.querySelector(`.${a}-list-col-title`);wt&&(wt.style.transform="")})};if(f||!xt){xe();return}const Ee=()=>{const $t=Array.from(oe.querySelectorAll("[data-list-row]")),st=`${a}-list-col`,wt=`${a}-baseline-probe`;$t.forEach(Ke=>{Ke.querySelectorAll("[data-list-col]").forEach(ft=>{ft.style.transform="";const yt=ft.querySelector(`.${st}`);yt&&(yt.style.minHeight="",yt.style.height="");const ut=ft.querySelector(`.${a}-list-col-title`);ut&&(ut.style.transform="")})}),$t.forEach(Ke=>{const ft=Array.from(Ke.querySelectorAll("[data-list-col]"));Cu(Ke,ft,st)}),oe.offsetHeight,$t.forEach(Ke=>{const ft=Array.from(Ke.querySelectorAll("[data-list-col]")),yt=Ke.getBoundingClientRect().top,ut=new Map,vn=ft.map(et=>{const bn=et.querySelector(`.${a}-list-col-title`),xn={el:et,titleEl:bn,letter:et.getAttribute("data-col-letter")??"",kind:et.getAttribute("data-valign")??"top",anchor:et.getAttribute("data-valign-anchor")};return ut.set(xn.letter,xn),xn}),lt=new Map,ui=(et,bn)=>{const xn=lt.get(et.letter);if(xn!==void 0)return xn;const ir=et.anchor?ut.get(et.anchor):void 0;if(et.kind!=="baseline"||!ir||bn.has(et.letter)){const rr=co(et,yt,st,wt);return lt.set(et.letter,rr),rr}bn.add(et.letter);const Qa=ui(ir,bn);bn.delete(et.letter);const es=co(et,yt,st,wt),ts=Qa-es;$u(et.titleEl,ts);const or=co(et,yt,st,wt);return lt.set(et.letter,or),or};vn.forEach(et=>ui(et,new Set))})};let Ne=null;const tt=()=>{Ne===null&&(Ne=requestAnimationFrame(()=>{Ne=null,Ee()}))};Ee();const at=new ResizeObserver(()=>tt());at.observe(oe);let je=!1;return typeof document<"u"&&((Ct=document.fonts)!=null&&Ct.ready)&&document.fonts.ready.then(()=>{je||tt()}),()=>{je=!0,Ne!==null&&(cancelAnimationFrame(Ne),Ne=null),at.disconnect(),xe()}},[xt,f,e,t,Q,mt,Fe]);const St=c.useMemo(()=>pu(a),[a]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:St}}),r.jsx("div",{style:Pe,children:r.jsxs("div",{ref:ee,className:`${a}-wrapper ${Le}${gt?` ${gt}`:""}${f?` ${a}-type-b`:""}`.trim(),style:{width:L.scalingValue(x??0,n),...!f&&u?{[`--${a}-first-entry-handle-top`]:rt}:{}},onMouseMove:M?kt:void 0,onMouseLeave:M?sn:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[mt.map((oe,xe)=>{var at;const Ee=(((at=oe.link)==null?void 0:at.length)??0)>0,Ne=Ee&&(!n||i)?"a":"div",tt=Fr(xe,mt.length,ue,A,ct,h??0,n??!1);return r.jsxs(Ne,{ref:xe===0?je=>{ge.current=je}:void 0,className:`${a}-list-item${Ee||C==="always"?` ${a}-list-item-has-link`:""}`,...Ee?{href:oe.link,target:"_blank"}:{},style:tt,onMouseEnter:je=>{z&&(Ee||C==="always")&&Mr(je,a),M&&Yt(oe,je)},onMouseLeave:je=>{z&&(Ee||C==="always")&&kr(je,a)},children:[D>0&&r.jsx("div",{className:`${a}-row-padding-handle`,style:{height:_e(D)}}),r.jsxs("div",{className:`${a}-list-cols-row${f?"":` ${a}-list-cols-row-h`}${u&&xe===0&&f?` ${a}-list-cols-row-controls`:""}`,...f?{}:{"data-list-row":""},style:f?void 0:{minHeight:_e(se)},children:[Te.map((je,Ct)=>{const $t=Ct===Te.length-1,st=Oe[Ct],wt=je.paddingBottom,Ke=du(oe.cells[je.key]),ft=f&&Ke&&wt>0,yt=f?{minHeight:_e(se)}:{width:_e(Fe[Ct])},ut=f?{paddingLeft:_e(ce),paddingRight:_e(ce)}:{paddingLeft:_e(st.paddingLeft),paddingRight:_e(st.paddingRight)},vn=je.textPrefix.charAt(0),lt=f?fu(e[`${je.textPrefix}VerticalAlign`]):hu(e[`${je.textPrefix}VerticalAlign`],e,vn),ui=f&&Ke&&u&&xe===0;return r.jsxs("div",{className:f?`${a}-list-col-wrap`:void 0,...f?{}:{"data-list-col":"","data-col-letter":vn,"data-valign":lt.kind,...lt.kind==="baseline"?{"data-valign-anchor":lt.anchorLetter}:{}},children:[r.jsx("div",{className:`${a}-list-col${$t?` ${a}-list-col-last`:""}`,style:{...ut,...yt,...f?{justifyContent:Nr(lt.kind)}:{}},"data-test":je.width,children:r.jsx("span",{className:Or(e,je.textPrefix,`${a}-list-col-title`,`${a}-text-tight-leading`),style:{...Hr(Wi(e,je.textPrefix),n),...Br(e,je.textPrefix,a,n),...f?{}:vu(lt.kind)},children:oe.cells[je.key]??null})}),ft&&r.jsx("div",{className:`${a}-row-padding-handle`,style:{height:_e(wt)}}),ui&&r.jsx(jt,{P:a,"data-controls":je.paddingBottomKey,"data-controls-static-handle":"","data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:"center",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:_e(Math.max(wt,uo))}})]},je.key)}),u&&xe===0&&f&&r.jsxs(r.Fragment,{children:[r.jsx(jt,{P:a,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ce),className:`${a}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:_e(pe),height:"100%"}}),r.jsx(jt,{P:a,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ce),className:`${a}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:_e(Math.max(pe,We-pe)),width:_e(pe),height:"100%"}})]})]}),!f&&V>0&&r.jsx("div",{className:`${a}-row-padding-handle`,style:{height:_e(V)}}),u&&xe===0&&!f&&r.jsx(jt,{P:a,"data-controls":"rowPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:_e(Ve)}})]},oe.id)}),u&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx(jt,{P:a,"data-controls":ht,"data-controls-static-handle":"",...f?{}:{"data-controls-handle-left":"20"},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:f?"center":"left-y",areaStyle:{position:"absolute",top:Ze,left:0,width:"100%",height:_e(Math.max(D,uo))}})},"row-padding-handles"),u&&!f&&$e&&le&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(jt,{P:a,"data-controls":$e.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Fe[0]-((ve==null?void 0:ve.paddingRight)??0)),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:_e(Re),height:"100%"}}),r.jsx(jt,{P:a,"data-controls":le.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Fe[Te.length-1]-((Se==null?void 0:Se.paddingLeft)??0)),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:_e(Lt-Ue),width:_e(Ue),height:"100%"}})]},"column-edge-padding-handles"),u&&!f&&Te.slice(0,-1).map((oe,xe)=>{const Ee=Te[xe+1],Ne=be.slice(0,xe+1).reduce(($t,st)=>$t+st,0),tt=Oe[xe],at=Oe[xe+1],je=Math.max(tt.paddingRight,wn),Ct=Math.max(at.paddingLeft,wn);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(jt,{P:a,"data-controls":oe.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Fe[xe]-tt.paddingLeft),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:_e(Ne-je),width:_e(je),height:"100%"}}),r.jsx(jt,{P:a,"data-controls":Ee.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Fe[xe+1]-at.paddingRight),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:_e(Ne),width:_e(Ct),height:"100%"}})]},`${oe.paddingRightKey}-padding`)}),u&&!f&&Te.slice(0,-1).map((oe,xe)=>{const Ee=ju(xe,be,re,We),tt=be.slice(0,xe+1).reduce((at,je)=>at+je,0)-jr/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":oe.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(Qo),"data-controls-max-fraction":String(Ee),"data-controls-variant":"column-width",className:`${a}-col-resize-handle`,style:{position:"absolute",top:"0px",left:_e(tt),width:_e(jr),height:"calc(100%)",pointerEvents:"auto"}})},`${oe.widthKey}-junction`)})]}),ct&&(()=>{const oe=Wi(e,Ut),xe=bu(e.cutLabelVerticalAlign),Ee=oe.textTextAlign==="justify"||f;return r.jsx("button",{type:"button",className:`${a}-cut-item`,style:{minHeight:_e($??0),cursor:Je?"pointer":"default",...uu(A,h??0,n??!1)},onClick:Je?Tt:void 0,onMouseEnter:z||M?yn:void 0,onMouseLeave:z?Be:void 0,children:r.jsx("div",{className:`${a}-list-cols-row`,style:{...f?{paddingLeft:_e(ce),paddingRight:_e(ce)}:{},justifyContent:xu(oe.textTextAlign),alignItems:Nr(xe)},children:r.jsx("span",{className:Or(e,Ut,`${a}-cut-label`,`${a}-text-tight-leading`),style:{...Hr(oe,n),...Br(e,Ut,a,n),...Ee?{width:"100%"}:{}},children:H})})})})(),M&&K&&(()=>{const oe=Li(K.widthPx),xe={width:oe,height:"auto",maxHeight:oe,objectFit:"contain",left:K.x,top:K.y,position:"absolute"};return r.jsx(cu,{media:K,className:K.isVideo?`${a}-hover-video`:`${a}-hover-image`,style:xe},`${K.rowId}-${K.url}`)})()]})})]})}const Uu=`import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type ComponentPropsWithoutRef } from 'react';
|
|
5448
|
+
`}const on=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Yo=["AColumn","BColumn","CColumn","DColumn","EColumn"],qt="cutLabel",Jo=[...Yo,qt],Xi=["A","B","C","D","E"];function ja(e){return`${e}ColumnVerticalAlign`}const To=["Top","Center","Bottom"];function Zo(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Xi.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function mu(e){const t=Zo(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function gu(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Xi.includes(n)?n:null}function Da(e,t,n){const i=gu(e);return i?i===t?!1:mu(n[ja(i)]):!0}function Jn(e){const t=Zo(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Xi.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function hu(e,t,n){if(za(e,t,n))return Jn(e);const i=Jn(e);return i.kind==="baseline"?{kind:"top"}:i}function fu(e){const t=Jn(e);return t.kind==="baseline"?{kind:"top"}:t}function za(e,t,n){return Da(e,n,t)?Jn(e).kind==="baseline":!1}function yu(e){const t={};let n=!1;for(const i of Xi){const o=ja(i),l=e[o];if(e.type==="b"){const s=String(l??"Top").trim();s!=="Top"&&s!=="Center"&&s!=="Bottom"&&(t[o]="Top",n=!0);continue}Da(l,i,e)||(t[o]="Top",n=!0)}return n?t:null}function vu(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function bu(e){const t=Jn(e).kind;return t==="baseline"?"center":t}function xu(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Nr(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Su(e,t){const n=document.createElement("i");n.className=t,n.setAttribute("aria-hidden","true"),e.prepend(n);const{top:i}=e.getBoundingClientRect(),{bottom:o}=n.getBoundingClientRect(),l=o-i;return n.remove(),l}function co(e,t,n,i){const o=e.titleEl;if(!o)return 0;const l=o.closest(`.${n}`);if(!l)return 0;const s=Su(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+s;const d=l.getBoundingClientRect(),a=o.getBoundingClientRect().height;let p=0;return e.kind==="center"?p=(d.height-a)/2:e.kind==="bottom"&&(p=d.height-a),d.top-t+p+s}function Cu(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const l=o.querySelector(`.${n}`);l&&(l.style.minHeight=`${i}px`,l.style.height=`${i}px`)}),i)}function $u(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const wu={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function ze(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Tu={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function Lu(e){return[ze(e,"textFontFamily"),ze(e,"textFontSettings"),{type:"row",items:[ze(e,"textFontSize"),ze(e,"textLineHeight"),ze(e,"textLetterSpacing"),ze(e,"textWordSpacing")]},ze(e,"textTextAlign"),ze(e,"textTextAppearance"),`${e}VerticalAlign`]}function Eu(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Jo.map(e=>[Tu[e],Lu(e)]))}}function Wi(e,t){const n=i=>{const o=ze(t,i);return e[o]};return{textFontFamily:n("textFontFamily")??"Arial",textFontSettings:n("textFontSettings")??{fontWeight:400,fontStyle:"normal"},textFontSize:n("textFontSize"),textLineHeight:n("textLineHeight"),textLetterSpacing:n("textLetterSpacing")??0,textWordSpacing:n("textWordSpacing")??0,textTextAlign:n("textTextAlign")??(t===qt?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Hr(e,t){var i,o;const n={fontSettings:{fontFamily:e.textFontFamily,fontWeight:((i=e.textFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e.textFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:e.textFontSize??.01,lineHeight:e.textLineHeight,letterSpacing:e.textLetterSpacing,wordSpacing:e.textWordSpacing,textAlign:e.textTextAlign,textAppearance:e.textTextAppearance,color:e.textColor??"#767676"};return Wt(mt(n,t))}function Br(e,t,n,i){const o=Wi(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s!==void 0&&s<l?`${n} ${i}`:n}function Or(e,t,n,i){const o=Wi(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s===void 0||s>=l?{}:{[`--${n}-title-leading-gap`]:E.scalingValue((l-s)/2,i)}}const Rt=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],_n=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],An=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Mn=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Iu={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Ru=["hover","focus","filled","success","error"],jr=.004,wn=.004,uo=wn,Dr=12,Qo=50,Zn=1440,Qn=Qo/Zn;function Va(e){const t=typeof e=="number"&&e>0?e:Zn;return Qo/t}function Pu(e,t){const n={position:"absolute",width:Dr,height:Dr,pointerEvents:"auto"};return t==="left-y"?{...n,left:20,top:"50%",transform:"translateY(-50%)"}:t==="center-x"?{...n,left:"50%",top:`var(--${e}-first-entry-handle-top, 50%)`,transform:"translate(-50%, -50%)"}:{...n,left:"50%",top:"50%",transform:"translate(-50%, -50%)"}}function zt({P:e,className:t,areaStyle:n,hitPlacement:i,...o}){return r.jsx("div",{className:t,style:{...n,pointerEvents:"none"},...o,children:r.jsx("div",{style:Pu(e,i)})})}function _u(e){let t=e??null;for(;t;){const n=t.style.getPropertyValue("--cntrl-article-width").trim();if(n){const o=parseFloat(n);if(Number.isFinite(o)&&o>0)return o}const i=getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim();if(i){const o=parseFloat(i);if(Number.isFinite(o)&&o>0)return o}t=t.parentElement}return Zn}const Ga={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function jn(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Au(e,t=1){const n=t/e;return Object.fromEntries(Rt.map(i=>[i,n]))}function Mu(){return Object.fromEntries([..._n.map(e=>[e,0]),...An.map(e=>[e,0])])}function ku(){return Object.fromEntries(Mn.map(e=>[e,0]))}function yi(e){return Object.fromEntries(Rt.map(t=>[t,typeof e[t]=="number"?e[t]:Ga[t]]))}function Ua(e,t,n){const i=e-Qn,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const l=i/o;return{paddingLeft:t*l,paddingRight:n*l}}function Ei(e,t,n){const i=er(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((l,s)=>l+s,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function Fu(e,t,n){const i={};for(let o=0;o<e;o+=1){const l=_n[o],s=An[o],d=typeof n[l]=="number"?n[l]:0,a=typeof n[s]=="number"?n[s]:0,p=Ua(t[o]??0,d,a);p.paddingLeft!==d&&(i[l]=p.paddingLeft),p.paddingRight!==a&&(i[s]=p.paddingRight)}return i}function er(e,t,n){if(e<=0)return[];const i=Rt.slice(0,e).map(p=>n[p]);if(e===1)return i;const o=i.slice(0,e-1),s=o.reduce((p,u)=>p+u,0)+Qn;if(t>=s)return i;const d=[...o];let a=s-t;for(let p=d.length-1;p>=0&&a>0;p-=1){const u=d[p]-Qn;if(u<=0)continue;const L=Math.min(a,u);d[p]-=L,a-=L}return[...d,i[e-1]]}function Wu(e,t,n){if(e<=1)return{};const i=er(e,t,n),o={};for(let l=0;l<e-1;l+=1){const s=Rt[l];i[l]!==n[s]&&(o[s]=i[l])}return o}function zr(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...on]}function Nu(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Hu(e,t,n,i){const o=Math.min(i,e.length,Rt.length),l={};for(let s=0;s<o;s+=1){const d=e[s],a=t.indexOf(d);if(a===-1)continue;const p=Rt[a],u=_n[a],L=An[a],C=Mn[a],y=Rt[s],g=_n[s],h=An[s],T=Mn[s],$=n[p],x=n[u],S=n[L],H=n[C];typeof $=="number"&&(l[y]=$),typeof x=="number"&&(l[g]=x),typeof S=="number"&&(l[h]=S),typeof H=="number"&&(l[T]=H)}return l}function Ka(e,t){const n=new Set([...Object.keys(e),...Object.keys(t)]);for(const i of n)if(e[i]!==t[i])return!0;return!1}function Bu(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=jn(e),l=e.type==="b"||e.type===void 0&&t.type==="b",s={...e,...Au(n,o),...Mu()};if(l)for(const d of Mn)typeof t[d]=="number"&&(s[d]=t[d]);else Object.assign(s,ku());return Ka(e,s)?s:e}function Ou(e,t,n){const i=yu(e);i&&(e={...e,...i});const o=Va(n==null?void 0:n.designWidth),l=e.columns,s=t.columns,d=jn(e),a=jn(t),p=e.type==="b"||e.type===void 0&&t.type==="b",u=typeof l=="number"?l:typeof s=="number"?s:on.length,L=S=>{if(p)return S;const H=yi({...t,...S}),R=jn(S),B=Ei(u,R,H),w=Fu(u,B,{...t,...S});return Object.keys(w).length===0?S:{...S,...w}};if(typeof l=="number"&&l!==s)return e;const C=zr(e),y=zr(t);if(!Nu(C,y))return L({...e,...Hu(C,y,t,u)});if(d<a&&typeof u=="number"&&!p){const S=yi({...t,...e});return L({...e,...Wu(u,d,S)})}if(p){const S=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,H=Math.max(0,(d-o)/2);return S>H?{...e,textPaddingLR:H}:e}const g=yi({...t,...e}),h=Ei(u,a,yi(t)),$=Ei(u,d,g).some((S,H)=>S<(h[H]??S)),x=Rt.some(S=>{const H=e[S],R=t[S];return typeof H=="number"&&typeof R=="number"&&H!==R});return $||x?L(e):e}function ju(e,t,n,i){const o=t.slice(0,e).reduce((s,d)=>s+d,0),l=n.slice(e+1,t.length-1).reduce((s,d)=>s+d,0);return Math.max(Qn,i-o-l-Qn)}function Du(e,t){return Math.random()*(t-e)+e}function zu(e){return Object.fromEntries(Rt.map(t=>[t,typeof e[t]=="number"?e[t]:Ga[t]]))}function po(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function Vu(e,t,n,i,o,l){return e.slice(0,t).map((s,d)=>{const a=_n[d],p=An[d],u=Mn[d];return{key:s,textPrefix:wu[s],widthKey:Rt[d],width:n[Rt[d]],paddingLeftKey:a,paddingRightKey:p,paddingBottomKey:u,paddingLeft:i[a],paddingRight:o[p],paddingBottom:l[u]}})}function Gu({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:l,layoutId:s,onUpdateSettings:d}){const{prefix:a}=E.useScopedStyles(),p=!!o,{columns:u,type:L,wrapperWidth:C,entriesCount:y,cellMinHeight:g,dividerWidth:h,showVisibility:T,cut:$,showCut:x,cutCellMinHeight:S,cutLabel:H,imageSize:R,imageOnHover:B,entryHoverEffect:w,entryHoverShowOption:I,rowPaddingTop:O,rowPaddingBottom:m,rowPaddingTopB:b,columnsOrder:P,textPaddingLR:F,textColor:U,backgroundColor:J,dividerColor:W,textHoverColor:N,backgroundHoverColor:v,dividerHoverColor:_}=e,[A,j]=c.useState(void 0),[z,Q]=c.useState(null),M=B==="on"&&(!n||i),ne=($??0)>0,f=L==="b",ie=c.useRef(null),ye=c.useRef(null),[te,he]=c.useState(null),[oe,ue]=c.useState(Zn),V=Va(oe),Y=Math.max(0,((C??0)-V)/2),le=Math.min(F??0,Y),de=Math.max(le,wn),Ce=((C??0)+V)/2;c.useLayoutEffect(()=>{if(!n){ue(Zn);return}const re=()=>{ue(_u(ie.current))};re();const be=ie.current;if(!be)return;const Le=new ResizeObserver(re);Le.observe(be);let He=be;for(;He&&!He.style.getPropertyValue("--cntrl-article-width");)He=He.parentElement;return He&&Le.observe(He),()=>Le.disconnect()},[n,s]),c.useEffect(()=>{j(void 0)},[$,x,t,y]),c.useEffect(()=>{n&&!i&&j(void 0)},[n,i]);const Pe=E.buildColorVars(a,{textColor:U,backgroundColor:J,dividerColor:W,textHoverColor:N,backgroundHoverColor:v,dividerHoverColor:_},Iu,Ru),Ee=l&&l!=="default"?`${a}-state-${l}`:"",Ie=`${!n||i?w==="default"?`${a}-entry-hover-default`:w==="blinds"?`${a}-entry-hover-blinds`:w==="reveal"?`${a}-entry-hover-reveal`:"":""} ${Ee}`.trim(),D=w==="reveal"&&(!n||i),se=(T==null?void 0:T[0])??!1,k=(T==null?void 0:T[1])??!1,K=c.useRef(e),q=c.useRef(s);c.useEffect(()=>{if(!d||!n){K.current=e,q.current=s;return}if(q.current!==s){K.current=e,q.current=s;return}const re=K.current;if(!(re!==e))return;if(typeof re.columns=="number"&&typeof e.columns=="number"&&re.columns!==e.columns){K.current=e;return}const Le=Ou(e,re,{designWidth:oe});K.current=e,Ka(e,Le)&&d(Le)},[e,d,n,s,oe]);const Z=c.useMemo(()=>zu(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),ae=c.useMemo(()=>po(e,_n),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),ge=c.useMemo(()=>po(e,An),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Fe=c.useMemo(()=>po(e,Mn),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),$e=c.useMemo(()=>Array.isArray(P)&&P.length>0?P:[...on],[P]),we=c.useMemo(()=>Vu($e,u,Z,ae,ge,Fe),[$e,u,Z,ae,ge,Fe]),We=jn(e),pe=c.useMemo(()=>Rt.slice(0,u).map(re=>Z[re]),[u,Z]),xe=c.useMemo(()=>er(u,We,Z),[u,We,Z]),Te=c.useMemo(()=>Ei(u,We,Z),[u,We,Z]),Ne=c.useMemo(()=>we.map((re,be)=>Ua(Te[be]??0,re.paddingLeft,re.paddingRight)),[we,Te]),Ue=c.useMemo(()=>{const re=y===0?1/0:y;return(t??[]).slice(0,re).map((Le,He)=>({id:He,cells:Object.fromEntries(on.map(it=>[it,Le[it]??""])),image:Le.image,link:Le.link}))},[t,y]),at=ne?A??$:Ue.length,lt=c.useMemo(()=>ne?Ue.slice(0,at):Ue,[Ue,ne,at]),gt=ne&&at<Ue.length,vt=lt.length>1||gt,ut=[se?`${a}-divider-top`:"",k||vt?`${a}-divider-bottom`:""].filter(Boolean).join(" "),bt=!n||i,Ze=()=>{if(!bt)return;const re=A??$;if(!x){j(Ue.length);return}j(Math.min(re+x,Ue.length))},_e=re=>E.scalingValue(re,n??!1),nt=f?b??0:O??0,Qe=m??0,G=g??0,X=nt+G/2,me=Math.max(Qe,uo),Re=Fr(0,lt.length,se,k,gt,h??0,n??!1).borderTopWidth,Oe=te!=null?`${te}px`:`calc(${Re} + ${_e(X)})`,rt=f?"rowPaddingTopB":"rowPaddingTop",Se=we[0],Je=we[we.length-1],ee=Ne[0],fe=Ne[Ne.length-1],Ae=Se&&ee?Math.max(ee.paddingLeft,wn):0,je=Je&&fe?Math.max(fe.paddingRight,wn):0,Ke=We,ht=re=>{const be=ie.current;if(!be)return{x:0,y:0};const Le=be.getBoundingClientRect();return{x:re.clientX-Le.left+Wr,y:re.clientY-Le.top+Wr}},kt=(re,be)=>{if(!M)return;const Le=re.image;if(!(Le!=null&&Le.url)){Q(null);return}const{x:He,y:it}=ht(be),st=(R==null?void 0:R.min)??80,De=(R==null?void 0:R.max)??320,wt=(z==null?void 0:z.rowId)===re.id?z.widthPx:Du(st,De);Q({rowId:re.id,url:Le.url,objectFit:"contain",isVideo:su(Le),widthPx:wt,x:He,y:it})},jt=re=>{if(!M||!z)return;const{x:be,y:Le}=ht(re);Q(He=>!He||He.x===be&&He.y===Le?He:{...He,x:be,y:Le})},Ft=()=>{Q(null)},yn=re=>{D&&Mr(re,a),M&&Q(null)},Be=re=>{D&&kr(re,a)};c.useLayoutEffect(()=>{if(!p||f){he(null);return}const re=ye.current,be=re==null?void 0:re.parentElement;if(!re||!be){he(null);return}const Le=()=>{const it=re.querySelector("[data-list-row]");if(!it){he(null);return}const st=be.getBoundingClientRect(),De=it.getBoundingClientRect();he(De.top-st.top+De.height/2)};Le();const He=new ResizeObserver(Le);return He.observe(re),He.observe(be),()=>He.disconnect()},[p,f,lt,nt,Qe,G,t,e,we,Te,oe,h,se,k,gt]);const pt=c.useMemo(()=>!f&&Yo.some(re=>{const be=re.charAt(0),Le=e[`${re}VerticalAlign`];return za(Le,e,be)}),[f,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);c.useLayoutEffect(()=>{var wt;const re=ie.current;if(!re)return;const be=()=>{re.querySelectorAll("[data-list-col]").forEach(Tt=>{Tt.style.transform="";const ct=Tt.querySelector(`.${a}-list-col`);ct&&(ct.style.minHeight="",ct.style.height="");const Lt=Tt.querySelector(`.${a}-list-col-title`);Lt&&(Lt.style.transform="")})};if(f||!pt){be();return}const Le=()=>{const Tt=Array.from(re.querySelectorAll("[data-list-row]")),ct=`${a}-list-col`,Lt=`${a}-baseline-probe`;Tt.forEach(Ge=>{Ge.querySelectorAll("[data-list-col]").forEach(xt=>{xt.style.transform="";const St=xt.querySelector(`.${ct}`);St&&(St.style.minHeight="",St.style.height="");const ft=xt.querySelector(`.${a}-list-col-title`);ft&&(ft.style.transform="")})}),Tt.forEach(Ge=>{const xt=Array.from(Ge.querySelectorAll("[data-list-col]"));Cu(Ge,xt,ct)}),re.offsetHeight,Tt.forEach(Ge=>{const xt=Array.from(Ge.querySelectorAll("[data-list-col]")),St=Ge.getBoundingClientRect().top,ft=new Map,vn=xt.map(tt=>{const bn=tt.querySelector(`.${a}-list-col-title`),xn={el:tt,titleEl:bn,letter:tt.getAttribute("data-col-letter")??"",kind:tt.getAttribute("data-valign")??"top",anchor:tt.getAttribute("data-valign-anchor")};return ft.set(xn.letter,xn),xn}),dt=new Map,ui=(tt,bn)=>{const xn=dt.get(tt.letter);if(xn!==void 0)return xn;const ir=tt.anchor?ft.get(tt.anchor):void 0;if(tt.kind!=="baseline"||!ir||bn.has(tt.letter)){const rr=co(tt,St,ct,Lt);return dt.set(tt.letter,rr),rr}bn.add(tt.letter);const Qa=ui(ir,bn);bn.delete(tt.letter);const el=co(tt,St,ct,Lt),tl=Qa-el;$u(tt.titleEl,tl);const or=co(tt,St,ct,Lt);return dt.set(tt.letter,or),or};vn.forEach(tt=>ui(tt,new Set))})};let He=null;const it=()=>{He===null&&(He=requestAnimationFrame(()=>{He=null,Le()}))};Le();const st=new ResizeObserver(()=>it());st.observe(re);let De=!1;return typeof document<"u"&&((wt=document.fonts)!=null&&wt.ready)&&document.fonts.ready.then(()=>{De||it()}),()=>{De=!0,He!==null&&(cancelAnimationFrame(He),He=null),st.disconnect(),be()}},[pt,f,e,t,oe,lt,Te]);const $t=c.useMemo(()=>pu(a),[a]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:$t}}),r.jsx("div",{style:Pe,children:r.jsxs("div",{ref:ie,className:`${a}-wrapper ${Ie}${ut?` ${ut}`:""}${f?` ${a}-type-b`:""}`.trim(),style:{width:E.scalingValue(C??0,n),...!f&&p?{[`--${a}-first-entry-handle-top`]:Oe}:{}},onMouseMove:M?jt:void 0,onMouseLeave:M?Ft:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[lt.map((re,be)=>{var st;const Le=(((st=re.link)==null?void 0:st.length)??0)>0,He=Le&&(!n||i)?"a":"div",it=Fr(be,lt.length,se,k,gt,h??0,n??!1);return r.jsxs(He,{ref:be===0?De=>{ye.current=De}:void 0,className:`${a}-list-item${Le||I==="always"?` ${a}-list-item-has-link`:""}`,...Le?{href:re.link,target:"_blank"}:{},style:it,onMouseEnter:De=>{D&&(Le||I==="always")&&Mr(De,a),M&&kt(re,De)},onMouseLeave:De=>{D&&(Le||I==="always")&&kr(De,a)},children:[nt>0&&r.jsx("div",{className:`${a}-row-padding-handle`,style:{height:_e(nt)}}),r.jsxs("div",{className:`${a}-list-cols-row${f?"":` ${a}-list-cols-row-h`}${p&&be===0&&f?` ${a}-list-cols-row-controls`:""}`,...f?{}:{"data-list-row":""},style:f?void 0:{minHeight:_e(G)},children:[we.map((De,wt)=>{const Tt=wt===we.length-1,ct=Ne[wt],Lt=De.paddingBottom,Ge=du(re.cells[De.key]),xt=f&&Ge&&Lt>0,St=f?{minHeight:_e(G)}:{width:_e(Te[wt])},ft=f?{paddingLeft:_e(le),paddingRight:_e(le)}:{paddingLeft:_e(ct.paddingLeft),paddingRight:_e(ct.paddingRight)},vn=De.textPrefix.charAt(0),dt=f?fu(e[`${De.textPrefix}VerticalAlign`]):hu(e[`${De.textPrefix}VerticalAlign`],e,vn),ui=f&&Ge&&p&&be===0;return r.jsxs("div",{className:f?`${a}-list-col-wrap`:void 0,...f?{}:{"data-list-col":"","data-col-letter":vn,"data-valign":dt.kind,...dt.kind==="baseline"?{"data-valign-anchor":dt.anchorLetter}:{}},children:[r.jsx("div",{className:`${a}-list-col${Tt?` ${a}-list-col-last`:""}`,style:{...ft,...St,...f?{justifyContent:Nr(dt.kind)}:{}},"data-test":De.width,children:r.jsx("span",{className:Br(e,De.textPrefix,`${a}-list-col-title`,`${a}-text-tight-leading`),style:{...Hr(Wi(e,De.textPrefix),n),...Or(e,De.textPrefix,a,n),...f?{}:vu(dt.kind)},children:re.cells[De.key]??null})}),xt&&r.jsx("div",{className:`${a}-row-padding-handle`,style:{height:_e(Lt)}}),ui&&r.jsx(zt,{P:a,"data-controls":De.paddingBottomKey,"data-controls-static-handle":"","data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:"center",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:_e(Math.max(Lt,uo))}})]},De.key)}),p&&be===0&&f&&r.jsxs(r.Fragment,{children:[r.jsx(zt,{P:a,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ce),className:`${a}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:_e(de),height:"100%"}}),r.jsx(zt,{P:a,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ce),className:`${a}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:_e(Math.max(de,We-de)),width:_e(de),height:"100%"}})]})]}),!f&&Qe>0&&r.jsx("div",{className:`${a}-row-padding-handle`,style:{height:_e(Qe)}}),p&&be===0&&!f&&r.jsx(zt,{P:a,"data-controls":"rowPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:_e(me)}})]},re.id)}),p&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx(zt,{P:a,"data-controls":rt,"data-controls-static-handle":"",...f?{}:{"data-controls-handle-left":"20"},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:f?"center":"left-y",areaStyle:{position:"absolute",top:Re,left:0,width:"100%",height:_e(Math.max(nt,uo))}})},"row-padding-handles"),p&&!f&&Se&&Je&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(zt,{P:a,"data-controls":Se.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Te[0]-((ee==null?void 0:ee.paddingRight)??0)),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:_e(Ae),height:"100%"}}),r.jsx(zt,{P:a,"data-controls":Je.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Te[we.length-1]-((fe==null?void 0:fe.paddingLeft)??0)),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:_e(Ke-je),width:_e(je),height:"100%"}})]},"column-edge-padding-handles"),p&&!f&&we.slice(0,-1).map((re,be)=>{const Le=we[be+1],He=xe.slice(0,be+1).reduce((Tt,ct)=>Tt+ct,0),it=Ne[be],st=Ne[be+1],De=Math.max(it.paddingRight,wn),wt=Math.max(st.paddingLeft,wn);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(zt,{P:a,"data-controls":re.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Te[be]-it.paddingLeft),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:_e(He-De),width:_e(De),height:"100%"}}),r.jsx(zt,{P:a,"data-controls":Le.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Te[be+1]-st.paddingRight),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:_e(He),width:_e(wt),height:"100%"}})]},`${re.paddingRightKey}-padding`)}),p&&!f&&we.slice(0,-1).map((re,be)=>{const Le=ju(be,xe,pe,We),it=xe.slice(0,be+1).reduce((st,De)=>st+De,0)-jr/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":re.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(Qo),"data-controls-max-fraction":String(Le),"data-controls-variant":"column-width",className:`${a}-col-resize-handle`,style:{position:"absolute",top:"0px",left:_e(it),width:_e(jr),height:"calc(100%)",pointerEvents:"auto"}})},`${re.widthKey}-junction`)})]}),gt&&(()=>{const re=Wi(e,qt),be=bu(e.cutLabelVerticalAlign),Le=re.textTextAlign==="justify"||f;return r.jsx("button",{type:"button",className:`${a}-cut-item`,style:{minHeight:_e(S??0),cursor:bt?"pointer":"default",...uu(k,h??0,n??!1)},onClick:bt?Ze:void 0,onMouseEnter:D||M?yn:void 0,onMouseLeave:D?Be:void 0,children:r.jsx("div",{className:`${a}-list-cols-row`,style:{...f?{paddingLeft:_e(le),paddingRight:_e(le)}:{},justifyContent:xu(re.textTextAlign),alignItems:Nr(be)},children:r.jsx("span",{className:Br(e,qt,`${a}-cut-label`,`${a}-text-tight-leading`),style:{...Hr(re,n),...Or(e,qt,a,n),...Le?{width:"100%"}:{}},children:H})})})})(),M&&z&&(()=>{const re=Li(z.widthPx),be={width:re,height:"auto",maxHeight:re,objectFit:"contain",left:z.x,top:z.y,position:"absolute"};return r.jsx(cu,{media:z,className:z.isVideo?`${a}-hover-video`:`${a}-hover-image`,style:be},`${z.rowId}-${z.url}`)})()]})})]})}const Uu=`import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type ComponentPropsWithoutRef } from 'react';
|
|
5449
5449
|
import { CommonComponentProps } from '../props';
|
|
5450
5450
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
5451
5451
|
import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
|
|
@@ -8456,7 +8456,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
8456
8456
|
</>
|
|
8457
8457
|
);
|
|
8458
8458
|
}
|
|
8459
|
-
`,Hn=["A","B","C","D","E"],Vr=[...To,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],cn={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Ku(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function vi(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function qu(){return Object.fromEntries(Hn.map((e,t)=>{const n=nn[t],i=`${e} column`;return[n,Ku(i)]}))}function Xu(){const e={};for(const t of Hn)e[`${t}ColumnWidth`]=vi(`${t} column width`),e[`${t}ColumnPaddingLeft`]=vi(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=vi(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=vi(`${t} column padding bottom`);return e}function Gr(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...nn]};for(const s of Hn)i[`${s}ColumnWidth`]=s==="A"?.0798:.32,i[`${s}ColumnPaddingLeft`]=0,i[`${s}ColumnPaddingRight`]=0,i[`${s}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function Yu(e){const t={};if(e===Ut)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...To]},enum:[...To]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Vr],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Vr]}}return t[ze(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[ze(e,"textFontSettings")]={...cn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[ze(e,"textFontSize")]={...cn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[ze(e,"textLineHeight")]={...cn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[ze(e,"textLetterSpacing")]={...cn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[ze(e,"textWordSpacing")]={...cn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[ze(e,"textTextAlign")]={...cn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[ze(e,"textTextAppearance")]={...cn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const Ju=Jo.reduce((e,t)=>({...e,...Yu(t)}),{});function Zu(e){return{verticalAlign:e===Ut?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===Ut?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function Qu(e,t={}){var n;return{...Zu(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Ur=new Set(["textFontFamily","textFontSettings"]);function ep(e,t,n){const i=s=>n===void 0?!0:n==="common"?Ur.has(s):!Ur.has(s),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=Zo(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[ze(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[ze(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[ze(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[ze(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[ze(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[ze(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[ze(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[ze(e,"textTextAppearance")]=t.textTextAppearance),o}function Ii(e={},t){return Jo.reduce((n,i)=>({...n,...ep(i,Qu(i,e),t)}),{})}const tp=Ii(),np=Eu();function qa(e){return[ze(e,"textFontFamily"),ze(e,"textFontSettings"),ze(e,"textFontSize"),ze(e,"textLineHeight"),ze(e,"textLetterSpacing"),ze(e,"textWordSpacing"),ze(e,"textTextAlign"),ze(e,"textTextAppearance"),`${e}VerticalAlign`]}function ip(){const e=[];return Yo.forEach((t,n)=>{const i=nn[n],o=qa(t);for(let s=1;s<nn.length;s+=1){const l=[{name:"columns",value:s},...Array.from({length:s},(d,a)=>({name:`columnsOrder.${a}`,value:i,isNotEqual:!0}))];o.forEach(d=>{e.push({if:l,then:{name:`properties.${d}.display.visible`,value:!1}})})}}),e}const op=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];qa(Ut);const rp=[...Hn.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],dn=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(1).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(2).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(3).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(4).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(5).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(8).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(9).webp"}],ap=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:dn[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:dn[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:dn[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:dn[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:dn[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:dn[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:dn[6],link:""}],sp=[...Hn.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],lp={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0},display:{type:"array",ref:{columnsOrder:"settings.properties.columnsOrder",columnsCount:"settings.properties.columns"}},items:{type:"object",properties:{...qu(),image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:ap},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b"]},columns:{type:"number",scope:"layout",title:"Columns",display:{type:"count-number"},min:1,max:5},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},textPaddingLR:{type:"number",scope:"layout",title:"Text Padding LR",min:0,max:9999,display:{type:"range-control"}},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},cellMinHeight:{type:"number",scope:"layout",title:"Cell min height",display:{type:"numeric-input"},min:0,max:9999},imageOnHover:{type:"boolean",scope:"common",title:"Image On Hover",display:{type:"toggle-cycle",enum:["on","off"]}},imageSize:{type:"object",scope:"layout",title:"Image size",display:{type:"min-max-input"},min:1,max:1440,properties:{min:{type:"number"},max:{type:"number"}}},dividerWidth:{type:"number",scope:"layout",title:"Divider width",display:{type:"numeric-input"},min:0,max:9999},showVisibility:{type:"array",scope:"common",title:"Show",display:{type:"double-toggle",enum:["top","bottom"]},items:{type:"boolean"},default:[!0,!1]},cut:{type:"number",scope:"layout",title:"Display",display:{type:"toggle-numeric-input",enum:["off","on"]},min:1},entryHoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["none","default","blinds","reveal"]}},entryHoverShowOption:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","link only"]}},cutCellMinHeight:{type:"number",scope:"layout",title:"Cell min height",display:{type:"numeric-input"},min:0,max:9999},cutLabel:{type:"string",scope:"common",title:"Cut Label",display:{type:"label-input"}},showCut:{type:"number",scope:"layout",title:"Show",display:{type:"toggle-numeric-input",enum:["all","custom"]},min:1},rowPaddingTop:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},rowPaddingBottom:{type:"number",scope:"layout",title:"Row Padding Bottom",min:0,max:100,display:{type:"range-control"}},rowPaddingTopB:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},...Xu(),columnsOrder:{type:"array",scope:"layout",title:"Columns Order",display:{type:"reorder-input"},items:{type:"string"}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},textHoverColor:{type:"string",scope:"common",title:"Text Hover",display:{type:"palette-color-picker"}},...Ju,backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},backgroundHoverColor:{type:"string",scope:"common",title:"BG Hover",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}}},defaults:{imageOnHover:"on",entryHoverEffect:"default",entryHoverShowOption:"always",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#000000",textHoverColor:"#FFFFFF",...tp,...Ii({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:Gr({columns:3,type:"b",textPaddingLR:.0373,entriesCount:0,cellMinHeight:.02,imageSize:{min:80,max:320},dividerWidth:.004,cut:0,showCut:0,cutCellMinHeight:.02,rowPaddingTop:.01,rowPaddingBottom:.01,typeBDefaults:{rowPaddingTopB:.0461,AColumnPaddingBottom:.041,BColumnPaddingBottom:.041,CColumnPaddingBottom:.0615,DColumnPaddingBottom:0,EColumnPaddingBottom:0},textStroke:.003,textCorners:.192,textPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},...Ii({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:Gr({columns:4,type:"a",textPaddingLR:.01,entriesCount:0,cellMinHeight:.0555,imageSize:{min:200,max:200},dividerWidth:.002083,cut:0,showCut:0,cutCellMinHeight:.0555,rowPaddingTop:0,rowPaddingBottom:0,rowPaddingTopB:.01,textStroke:.001,textCorners:.05,textPadding:{top:.01,right:.01,bottom:.01,left:.01},...Ii({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...ip(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...rp.map(e=>({if:{name:"type",value:"b"},then:{name:`properties.${e}.display.visible`,value:!1}})),{if:{name:"type",value:"a"},then:{name:"properties.rowPaddingTopB.display.visible",value:!1}},...Hn.map(e=>({if:{name:"type",value:"a"},then:{name:`properties.${e}ColumnPaddingBottom.display.visible`,value:!1}}))],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","entryHoverShowOption","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...sp]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"row",title:"",items:["columns","wrapperWidth"]},{type:"row",title:"",items:["entriesCount","cellMinHeight"]},{type:"row",title:"",items:["imageOnHover","imageSize"]},{type:"row",title:"Entry Hover",items:["entryHoverEffect","entryHoverShowOption"]},{type:"row",title:"Divider Settings",items:["dividerWidth","showVisibility"]}]},{id:"columnsOrder",icon:"layers",title:"Columns Order",tooltip:"Columns order",layout:["__componentName__","columnsOrder"]},{id:"cutSettings",icon:"cut",title:"Cut settings",tooltip:"Cut settings",layout:["__componentName__",{type:"row",title:"",items:["cut"]},{type:"row",title:"Cut Settings",items:["cutLabel","cutCellMinHeight"]},{type:"row",title:"",items:["showCut"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",np]}],paletteBookmark:{items:[...op],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},cp={element:Gu,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>Ou(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme_List.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},schema:lp,sourceCode:Uu},Kt=e=>e.display==="Cover",Yi=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Kr=100,dp=.2,qr=8,Xa=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,s]=c.useState(0),[l,d]=c.useState(!1),a=c.useRef(null),u=c.useRef(0);u.current=o;const p=c.useMemo(()=>typeof window>"u"?Kr:Math.max(Kr,window.innerHeight*dp),[]),T=c.useCallback(m=>Math.max(0,1-m/(p*1.5)),[p]),x=c.useCallback(m=>{const C=typeof window<"u"?window.innerHeight:800,N=Math.max(.88,1-m/C*.12);return`translateY(${m}px) scale(${N})`},[]),y=c.useCallback(()=>{a.current=null},[]),g=c.useCallback(()=>{d(!0),s(0),window.setTimeout(()=>d(!1),n),y()},[n,y]),h=c.useCallback(()=>{const m=typeof window<"u"?window.innerHeight:800;d(!0),s(m),window.setTimeout(()=>{t(),y(),s(0),d(!1)},Math.min(n,200))},[n,t,y]),w=c.useCallback(m=>{!e||l||m.pointerType==="touch"&&(i!=null&&i(m.target)||(a.current={startX:m.clientX,startY:m.clientY,isLocked:null,pointerId:m.pointerId}))},[e,l,i]),S=c.useCallback(m=>{const C=a.current;if(!e||!C||m.pointerType!=="touch"||C.pointerId!==m.pointerId)return;const N=m.clientX-C.startX,v=m.clientY-C.startY;if(C.isLocked===null){if(Math.abs(N)<qr&&Math.abs(v)<qr)return;if(v>0&&v>Math.abs(N))C.isLocked=!0,m.currentTarget.setPointerCapture(m.pointerId);else{C.isLocked=!1,y();return}}if(!C.isLocked)return;m.preventDefault();const E=Math.max(0,v);u.current=E,s(E)},[e,y]),b=c.useCallback(m=>{const C=a.current;if(!e||!C||m.pointerType!=="touch"||C.pointerId!==m.pointerId)return;const N=C.isLocked===!0;if(m.currentTarget.hasPointerCapture(m.pointerId)&&m.currentTarget.releasePointerCapture(m.pointerId),!N){y();return}m.clientY-C.startY>=p?h():g()},[p,h,e,y,g]),$=c.useCallback(m=>{b(m)},[b]),H=c.useCallback(m=>{b(m)},[b]),R=o>0,B=l?`transform ${n}ms ease`:"none";return{isSwipeDragging:R,backdropStyle:{opacity:T(o),transition:l?`opacity ${n}ms ease`:"none"},dismissAreaStyle:{transform:x(o),transition:B,touchAction:R?"none":void 0,willChange:R?"transform":void 0},swipeHandlers:e?{onPointerDown:w,onPointerMove:S,onPointerUp:$,onPointerCancel:H}:{}}},zn=300,up=3e3,Ri=42;function pp(e){return`
|
|
8459
|
+
`,Hn=["A","B","C","D","E"],Vr=[...To,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],cn={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Ku(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function vi(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function qu(){return Object.fromEntries(Hn.map((e,t)=>{const n=on[t],i=`${e} column`;return[n,Ku(i)]}))}function Xu(){const e={};for(const t of Hn)e[`${t}ColumnWidth`]=vi(`${t} column width`),e[`${t}ColumnPaddingLeft`]=vi(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=vi(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=vi(`${t} column padding bottom`);return e}function Gr(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...on]};for(const l of Hn)i[`${l}ColumnWidth`]=l==="A"?.0798:.32,i[`${l}ColumnPaddingLeft`]=0,i[`${l}ColumnPaddingRight`]=0,i[`${l}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function Yu(e){const t={};if(e===qt)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...To]},enum:[...To]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Vr],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Vr]}}return t[ze(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[ze(e,"textFontSettings")]={...cn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[ze(e,"textFontSize")]={...cn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[ze(e,"textLineHeight")]={...cn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[ze(e,"textLetterSpacing")]={...cn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[ze(e,"textWordSpacing")]={...cn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[ze(e,"textTextAlign")]={...cn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[ze(e,"textTextAppearance")]={...cn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const Ju=Jo.reduce((e,t)=>({...e,...Yu(t)}),{});function Zu(e){return{verticalAlign:e===qt?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===qt?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function Qu(e,t={}){var n;return{...Zu(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Ur=new Set(["textFontFamily","textFontSettings"]);function ep(e,t,n){const i=l=>n===void 0?!0:n==="common"?Ur.has(l):!Ur.has(l),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=Zo(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[ze(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[ze(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[ze(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[ze(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[ze(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[ze(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[ze(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[ze(e,"textTextAppearance")]=t.textTextAppearance),o}function Ii(e={},t){return Jo.reduce((n,i)=>({...n,...ep(i,Qu(i,e),t)}),{})}const tp=Ii(),np=Eu();function qa(e){return[ze(e,"textFontFamily"),ze(e,"textFontSettings"),ze(e,"textFontSize"),ze(e,"textLineHeight"),ze(e,"textLetterSpacing"),ze(e,"textWordSpacing"),ze(e,"textTextAlign"),ze(e,"textTextAppearance"),`${e}VerticalAlign`]}function ip(){const e=[];return Yo.forEach((t,n)=>{const i=on[n],o=qa(t);for(let l=1;l<on.length;l+=1){const s=[{name:"columns",value:l},...Array.from({length:l},(d,a)=>({name:`columnsOrder.${a}`,value:i,isNotEqual:!0}))];o.forEach(d=>{e.push({if:s,then:{name:`properties.${d}.display.visible`,value:!1}})})}}),e}const op=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];qa(qt);const rp=[...Hn.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],dn=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(1).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(2).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(3).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(4).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(5).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(8).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(9).webp"}],ap=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:dn[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:dn[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:dn[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:dn[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:dn[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:dn[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:dn[6],link:""}],lp=[...Hn.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],sp={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0},display:{type:"array",ref:{columnsOrder:"settings.properties.columnsOrder",columnsCount:"settings.properties.columns"}},items:{type:"object",properties:{...qu(),image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:ap},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b"]},columns:{type:"number",scope:"layout",title:"Columns",display:{type:"count-number"},min:1,max:5},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},textPaddingLR:{type:"number",scope:"layout",title:"Text Padding LR",min:0,max:9999,display:{type:"range-control"}},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},cellMinHeight:{type:"number",scope:"layout",title:"Cell min height",display:{type:"numeric-input"},min:0,max:9999},imageOnHover:{type:"boolean",scope:"common",title:"Image On Hover",display:{type:"toggle-cycle",enum:["on","off"]}},imageSize:{type:"object",scope:"layout",title:"Image size",display:{type:"min-max-input"},min:1,max:1440,properties:{min:{type:"number"},max:{type:"number"}}},dividerWidth:{type:"number",scope:"layout",title:"Divider width",display:{type:"numeric-input"},min:0,max:9999},showVisibility:{type:"array",scope:"common",title:"Show",display:{type:"double-toggle",enum:["top","bottom"]},items:{type:"boolean"},default:[!0,!1]},cut:{type:"number",scope:"layout",title:"Display",display:{type:"toggle-numeric-input",enum:["off","on"]},min:1},entryHoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["none","default","blinds","reveal"]}},entryHoverShowOption:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","link only"]}},cutCellMinHeight:{type:"number",scope:"layout",title:"Cell min height",display:{type:"numeric-input"},min:0,max:9999},cutLabel:{type:"string",scope:"common",title:"Cut Label",display:{type:"label-input"}},showCut:{type:"number",scope:"layout",title:"Show",display:{type:"toggle-numeric-input",enum:["all","custom"]},min:1},rowPaddingTop:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},rowPaddingBottom:{type:"number",scope:"layout",title:"Row Padding Bottom",min:0,max:100,display:{type:"range-control"}},rowPaddingTopB:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},...Xu(),columnsOrder:{type:"array",scope:"layout",title:"Columns Order",display:{type:"reorder-input"},items:{type:"string"}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},textHoverColor:{type:"string",scope:"common",title:"Text Hover",display:{type:"palette-color-picker"}},...Ju,backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},backgroundHoverColor:{type:"string",scope:"common",title:"BG Hover",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}}},defaults:{imageOnHover:"on",entryHoverEffect:"default",entryHoverShowOption:"always",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#000000",textHoverColor:"#FFFFFF",...tp,...Ii({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:Gr({columns:3,type:"b",textPaddingLR:.0373,entriesCount:0,cellMinHeight:.02,imageSize:{min:80,max:320},dividerWidth:.004,cut:0,showCut:0,cutCellMinHeight:.02,rowPaddingTop:.01,rowPaddingBottom:.01,typeBDefaults:{rowPaddingTopB:.0461,AColumnPaddingBottom:.041,BColumnPaddingBottom:.041,CColumnPaddingBottom:.0615,DColumnPaddingBottom:0,EColumnPaddingBottom:0},textStroke:.003,textCorners:.192,textPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},...Ii({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:Gr({columns:4,type:"a",textPaddingLR:.01,entriesCount:0,cellMinHeight:.0555,imageSize:{min:200,max:200},dividerWidth:.002083,cut:0,showCut:0,cutCellMinHeight:.0555,rowPaddingTop:0,rowPaddingBottom:0,rowPaddingTopB:.01,textStroke:.001,textCorners:.05,textPadding:{top:.01,right:.01,bottom:.01,left:.01},...Ii({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...ip(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...rp.map(e=>({if:{name:"type",value:"b"},then:{name:`properties.${e}.display.visible`,value:!1}})),{if:{name:"type",value:"a"},then:{name:"properties.rowPaddingTopB.display.visible",value:!1}},...Hn.map(e=>({if:{name:"type",value:"a"},then:{name:`properties.${e}ColumnPaddingBottom.display.visible`,value:!1}}))],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","entryHoverShowOption","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...lp]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"row",title:"",items:["columns","wrapperWidth"]},{type:"row",title:"",items:["entriesCount","cellMinHeight"]},{type:"row",title:"",items:["imageOnHover","imageSize"]},{type:"row",title:"Entry Hover",items:["entryHoverEffect","entryHoverShowOption"]},{type:"row",title:"Divider Settings",items:["dividerWidth","showVisibility"]}]},{id:"columnsOrder",icon:"layers",title:"Columns Order",tooltip:"Columns order",layout:["__componentName__","columnsOrder"]},{id:"cutSettings",icon:"cut",title:"Cut settings",tooltip:"Cut settings",layout:["__componentName__",{type:"row",title:"",items:["cut"]},{type:"row",title:"Cut Settings",items:["cutLabel","cutCellMinHeight"]},{type:"row",title:"",items:["showCut"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",np]}],paletteBookmark:{items:[...op],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},cp={element:Gu,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>Bu(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme_List.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},schema:sp,sourceCode:Uu},Xt=e=>e.display==="Cover",Yi=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Kr=100,dp=.2,qr=8,Xa=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,l]=c.useState(0),[s,d]=c.useState(!1),a=c.useRef(null),p=c.useRef(0);p.current=o;const u=c.useMemo(()=>typeof window>"u"?Kr:Math.max(Kr,window.innerHeight*dp),[]),L=c.useCallback(m=>Math.max(0,1-m/(u*1.5)),[u]),C=c.useCallback(m=>Math.max(0,1-m/(u*.45)),[u]),y=c.useCallback(m=>{const b=typeof window<"u"?window.innerHeight:800,P=Math.max(.88,1-m/b*.12);return`translateY(${m}px) scale(${P})`},[]),g=c.useCallback(()=>{a.current=null},[]),h=c.useCallback(()=>{d(!0),l(0),window.setTimeout(()=>d(!1),n),g()},[n,g]),T=c.useCallback(()=>{const m=typeof window<"u"?window.innerHeight:800;d(!0),l(m),window.setTimeout(()=>{t(),g(),l(0),d(!1)},Math.min(n,200))},[n,t,g]),$=c.useCallback(m=>{!e||s||m.pointerType==="touch"&&(i!=null&&i(m.target)||(a.current={startX:m.clientX,startY:m.clientY,isLocked:null,pointerId:m.pointerId}))},[e,s,i]),x=c.useCallback(m=>{const b=a.current;if(!e||!b||m.pointerType!=="touch"||b.pointerId!==m.pointerId)return;const P=m.clientX-b.startX,F=m.clientY-b.startY;if(b.isLocked===null){if(Math.abs(P)<qr&&Math.abs(F)<qr)return;if(F>0&&F>Math.abs(P))b.isLocked=!0,m.currentTarget.setPointerCapture(m.pointerId);else{b.isLocked=!1,g();return}}if(!b.isLocked)return;m.preventDefault();const U=Math.max(0,F);p.current=U,l(U)},[e,g]),S=c.useCallback(m=>{const b=a.current;if(!e||!b||m.pointerType!=="touch"||b.pointerId!==m.pointerId)return;const P=b.isLocked===!0;if(m.currentTarget.hasPointerCapture(m.pointerId)&&m.currentTarget.releasePointerCapture(m.pointerId),!P){g();return}m.clientY-b.startY>=u?T():h()},[u,T,e,g,h]),H=c.useCallback(m=>{S(m)},[S]),R=c.useCallback(m=>{S(m)},[S]),B=o>0,w=s?`transform ${n}ms ease`:"none",I=s?`opacity ${n}ms ease`:"none",O=o>0||s;return{isSwipeDragging:B,backdropStyle:{opacity:L(o),transition:I},mediaAreaStyle:{transform:y(o),transition:w,touchAction:B?"none":void 0,willChange:B?"transform":void 0},chromeStyle:O?{opacity:C(o),transition:I}:void 0,swipeHandlers:e?{onPointerDown:$,onPointerMove:x,onPointerUp:H,onPointerCancel:R}:{}}},Dn=300,up=3e3,Ri=42;function pp(e){return`
|
|
8460
8460
|
.${e}-wrapper {
|
|
8461
8461
|
position: relative;
|
|
8462
8462
|
width: 100%;
|
|
@@ -8603,7 +8603,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
8603
8603
|
scrollbar-width: none;
|
|
8604
8604
|
pointer-events: auto;
|
|
8605
8605
|
opacity: 1;
|
|
8606
|
-
transition: opacity ${
|
|
8606
|
+
transition: opacity ${Dn}ms ease;
|
|
8607
8607
|
}
|
|
8608
8608
|
|
|
8609
8609
|
.${e}-thumbnails[data-chrome-hidden="true"] {
|
|
@@ -8677,7 +8677,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
8677
8677
|
background-color: transparent;
|
|
8678
8678
|
padding: 0;
|
|
8679
8679
|
opacity: 1;
|
|
8680
|
-
transition: opacity ${
|
|
8680
|
+
transition: opacity ${Dn}ms ease;
|
|
8681
8681
|
}
|
|
8682
8682
|
|
|
8683
8683
|
.${e}-close-icon[data-chrome-hidden="true"] {
|
|
@@ -8764,10 +8764,28 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
8764
8764
|
left: 0;
|
|
8765
8765
|
width: 100%;
|
|
8766
8766
|
height: 100%;
|
|
8767
|
+
min-width: 20px;
|
|
8768
|
+
min-height: 20px;
|
|
8767
8769
|
pointer-events: auto;
|
|
8768
8770
|
z-index: 10;
|
|
8769
8771
|
}
|
|
8770
|
-
`}function mp(e){if(!Array.isArray(e)||e.length===0)return{};const t=e.find(o=>(o==null?void 0:o.type)==="paragraph")??e[0],n=t==null?void 0:t.children;if(!Array.isArray(n))return{};const i=n.map(o=>typeof(o==null?void 0:o.text)=="string"?o.text.trim():"").filter(Boolean);return{title1:i[0],title2:i[1],title3:i[2]}}function gp(e){for(const t of e)if(t.title1||t.title2||t.title3)return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""};for(const t of e){const n=mp(t.text);if(n.title1||n.title2||n.title3)return{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}return{title1:"",title2:"",title3:""}}const ci=["title1","title2","title3"];function qe(e,t){return`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`}const hp={title1:"1",title2:"2",title3:"3"};function fp(e){return[qe(e,"fontFamily"),qe(e,"fontSettings"),{type:"row",items:[qe(e,"fontSize"),qe(e,"lineHeight"),qe(e,"letterSpacing"),qe(e,"wordSpacing")]},qe(e,"textAlign"),qe(e,"textAppearance")]}function yp(){return{type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(ci.map(e=>[hp[e],fp(e)]))}}const vp={title1:"title1Color",title2:"title2Color",title3:"title3Color"},bp={title1:.02,title2:.02,title3:.02};function mo(e,t){const n=i=>{const o=qe(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[vp[t]]}}function go(e,t,n){var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??bp[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return dt(i,n)}const xp=1,Xr=.15,Sp=3,Cp=20,bi=e=>`max(${e}, ${Cp}px)`,$p=({prefix:e,images:t,type:n,backgroundColor:i,contentBackgroundColor:o,thumbnailGap:s,thumbnailMarginBottom:l,imageGap:d,isEditor:a,isEditMode:u,isPreviewMode:p,closeIcon:T,closeIconMaxWidth:x,closeIconColor:y,closeIconHoverColor:g,thumbnailTrigger:h,thumbnailVisibility:w,thumbnailObjectFit:S,thumbnailActive:b,thumbnailActiveColor:$,textMaxWidth:H,title1Gap:R,title2Gap:B,title1:m,title2:C,title3:N,title1Style:v,title2Style:E,title3Style:k,contentMarginTop:O,contentMarginLeft:U,contentMarginRight:Z,onClose:W})=>{const P=!!u,I=!u,F=!u&&(!a||!!p),_=F,j=F,K=Kt(S),te=K?{"--image-aspect-ratio":Yi(S)}:void 0,M=(D,V,se=!1)=>{const ke=bi(V),Ve=`calc(-0.5 * (${ke} + ${V}))`;return r.jsx("div",{"data-controls":D,"data-controls-axis":"x",...se?{"data-controls-reverse":"true"}:void 0,style:{position:"absolute",top:0,right:Ve,width:ke,height:"100%",pointerEvents:"auto",zIndex:3}})},ne=!!(m||C||N),f=(D=!1)=>{const V=[];return m&&V.push({className:`${e}-title1`,style:v,text:m,gapKey:"title1Gap",gap:R}),C&&V.push({className:`${e}-title2`,style:E,text:C,gapKey:"title2Gap",gap:B}),N&&V.push({className:`${e}-title3`,style:k,text:N}),V.map((se,ke)=>r.jsxs("div",{className:`${e}-title-cell`,style:ke<V.length-1&&se.gap?{marginRight:se.gap}:void 0,children:[r.jsx("p",{className:se.className,style:{...se.style,maxWidth:H},children:se.text}),D&&P&&se.gapKey&&se.gap&&ke<V.length-1?M(se.gapKey,se.gap):null]},se.className))},ee=c.useRef(null),ge=c.useRef(null),ie=c.useRef([]),fe=c.useRef(0),Q=c.useRef({isActive:!1,startX:0,scrollLeft:0,hasMoved:!1}),me=t.length>1,G=me?Sp:1,J=c.useMemo(()=>Array.from({length:G},()=>t).flat(),[t,G]),[ce,pe]=c.useState(!1),[Ce,Pe]=c.useState(!1),[Ie,Ae]=c.useState(!0),[Le,z]=c.useState(0),ue=c.useRef(Le);ue.current=Le;const A=c.useRef(null),X=c.useRef(!1),q=c.useRef(null),Y=c.useRef(null),ae=c.useCallback(()=>{I&&(Ae(!0),Y.current&&clearTimeout(Y.current),Y.current=setTimeout(()=>{Q.current.isActive||Ae(!1)},up))},[I]),he=c.useCallback(()=>{u||X.current||(X.current=!0,Pe(!1),q.current=setTimeout(()=>{W()},zn))},[u,W]),He=c.useCallback(D=>!!(D.closest("[data-controls]")||D.closest(`.${e}-thumbnails`)||D.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:we,backdropStyle:Te,dismissAreaStyle:We,swipeHandlers:re}=Xa({enabled:F,onClose:he,animMs:zn,isBlockedTarget:He}),be=()=>{if(!me||t.length===0)return fe.current=0,0;const D=ie.current[0],V=ie.current[t.length];if(!D||!V)return fe.current;const se=V.offsetLeft-D.offsetLeft;return se>0&&(fe.current=se),fe.current},Fe=(D=!1)=>{if(!me)return;const V=ge.current,se=be();!V||se<=0||(V.scrollLeft<=0?(V.scrollLeft+=se,D&&(Q.current.scrollLeft+=se)):V.scrollLeft>=se*2&&(V.scrollLeft-=se,D&&(Q.current.scrollLeft-=se)))},Oe=(D=(V=>(V=ge.current)==null?void 0:V.scrollLeft)()??0)=>{let se=0,ke=1/0;return ie.current.forEach((Ve,Ze)=>{if(!Ve)return;const rt=Math.abs(Ve.offsetLeft-D);rt<ke&&(ke=rt,se=Ze)}),se},Ge=()=>{!ge.current||t.length===0||A.current===null&&z(Oe()%t.length)},it=()=>{A.current=null,Ge()},mt=(D="smooth")=>{const V=ge.current;if(!V||t.length===0)return;const se=Oe(),ke=ie.current[se];ke&&(V.scrollTo({left:ke.offsetLeft,behavior:D}),z(se%t.length))},ct=D=>{const V=ge.current;V&&(V.style.scrollSnapType=D?"":"none")},ot=(D,V="smooth")=>{const se=ge.current;if(!se||t.length===0)return;const ke=se.scrollLeft-D,Ve=Oe(se.scrollLeft),Ze=ie.current[Ve],rt=ie.current[Ve+1],ht=Ze?rt?rt.offsetLeft-Ze.offsetLeft:Ze.offsetWidth:0;let $e=Ve;ht>0&&(ke>ht*Xr?$e+=1:ke<-ht*Xr&&($e-=1)),me||($e=Math.max(0,Math.min(J.length-1,$e)));const le=ie.current[$e];if(!le){mt(V);return}se.scrollTo({left:le.offsetLeft,behavior:V}),z($e%t.length)},gt=(D,V="smooth")=>{const se=ge.current,ke=me?t.length+D:D,Ve=ie.current[ke];!se||!Ve||(V==="smooth"?A.current=D:A.current=null,z(D),se.scrollTo({left:Ve.offsetLeft,behavior:V}))},Je=D=>{if(!_||D.pointerType!=="mouse"||D.button!==0||He(D.target))return;const V=ge.current,se=ee.current;!V||!se||(Q.current={isActive:!0,startX:D.clientX,scrollLeft:V.scrollLeft,hasMoved:!1},ct(!1),ae(),se.setPointerCapture(D.pointerId))},Tt=D=>{if(!_||D.pointerType!=="mouse")return;const V=ge.current;if(!V||!Q.current.isActive)return;const se=D.clientX-Q.current.startX;Math.abs(se)>xp&&(Q.current.hasMoved=!0,pe(!0)),Q.current.hasMoved&&(D.preventDefault(),V.scrollLeft=Q.current.scrollLeft-se,Fe(!0),Ge(),ae())},_e=D=>{if(!_||D.pointerType!=="mouse")return;const V=ge.current,se=ee.current;if(!V||!se)return;const ke=Q.current.hasMoved,Ve=Q.current.scrollLeft;Q.current.isActive=!1,pe(!1),se.hasPointerCapture(D.pointerId)&&se.releasePointerCapture(D.pointerId),Fe(),ct(!0),ke?ot(Ve):Ge(),ae()};return c.useEffect(()=>{const D=requestAnimationFrame(()=>Pe(!0)),V=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{cancelAnimationFrame(D),document.body.style.overflow=V,q.current&&clearTimeout(q.current),Y.current&&clearTimeout(Y.current)}},[]),c.useEffect(()=>{if(!I){Ae(!0);return}ae();const D=ee.current;if(!D)return;const V=()=>ae();return D.addEventListener("pointermove",V),D.addEventListener("pointerdown",V),()=>{D.removeEventListener("pointermove",V),D.removeEventListener("pointerdown",V),Y.current&&clearTimeout(Y.current)}},[I,ae]),c.useEffect(()=>{const D=V=>{V.key==="Escape"&&he()};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[he]),c.useLayoutEffect(()=>{be(),gt(ue.current,"auto")},[d]),c.useLayoutEffect(()=>{be(),gt(0,"auto")},[t.length,me]),c.useEffect(()=>{if(!u)return;const D=ge.current;if(!D)return;const V=se=>{se.preventDefault()};return D.addEventListener("wheel",V,{passive:!1}),D.addEventListener("touchmove",V,{passive:!1}),()=>{D.removeEventListener("wheel",V),D.removeEventListener("touchmove",V)}},[u]),c.useEffect(()=>{const D=ge.current;if(!D)return;let V=null;const se=()=>{Fe(),Ge(),A.current!==null&&(V&&clearTimeout(V),V=setTimeout(()=>{A.current!==null&&it()},150))},ke=()=>{A.current!==null&&(V&&(clearTimeout(V),V=null),it())};D.addEventListener("scroll",se,{passive:!0}),D.addEventListener("scrollend",ke);const Ve=new ResizeObserver(()=>{be(),Fe(),Ge()});return Ve.observe(D),()=>{V&&clearTimeout(V),D.removeEventListener("scroll",se),D.removeEventListener("scrollend",ke),Ve.disconnect()}},[t.length,me]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${a?` ${e}-lightbox-editor`:""}${u?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{we||he()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:Ce?1:0,transition:`opacity ${zn}ms ease`,pointerEvents:Ce?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:i,...Te}}),r.jsxs("div",{ref:ee,className:`${e}-lightbox-content`,"data-mouse-draggable":_&&t.length>0?"true":"false","data-mouse-dragging":ce?"true":"false",style:We,onClick:D=>D.stopPropagation(),onPointerDown:D=>{var V;(V=re.onPointerDown)==null||V.call(re,D),_&&Je(D)},onPointerMove:D=>{var V;(V=re.onPointerMove)==null||V.call(re,D),_&&Tt(D)},onPointerUp:D=>{var V;(V=re.onPointerUp)==null||V.call(re,D),_&&_e(D)},onPointerCancel:D=>{var V;(V=re.onPointerCancel)==null||V.call(re,D),_&&_e(D)},children:[r.jsxs("div",{className:`${e}-lightbox-content-inner`,style:{width:"100%",height:n==="A"?"100%":"auto",top:0,bottom:n==="A"?0:"auto",...n==="B"?{backgroundColor:o,position:"relative"}:{}},children:[r.jsx("div",{"data-controls":P?"contentMarginTop":void 0,className:P?`${e}-control`:void 0,style:{height:O,width:"100%",pointerEvents:P?"auto":"none"}}),r.jsxs("div",{className:n==="B"?`${e}-lightbox-chrome-bar`:void 0,style:{display:"flex",flexDirection:"row",width:"100%"},children:[r.jsx("div",{"data-controls":P?"contentMarginLeft":void 0,"data-controls-axis":P?"x":void 0,className:P?`${e}-control`:void 0,style:{width:U,flexShrink:0}}),r.jsxs("div",{className:`${e}-lightbox-content-area`,children:[ne&&r.jsx("div",{className:`${e}-titles-row`,children:f(!0)}),T&&r.jsx("div",{className:`${e}-close-icon`,"data-chrome-hidden":I&&!Ie?"true":"false",style:{width:L.scalingValue(x??0,a),height:L.scalingValue(x??0,a),"--close-icon-hover-color":g},children:r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:he,"aria-label":"Close",children:r.jsx(Wt,{url:T,fill:y,hoverFill:g,className:`${e}-close-icon-img`})})})]}),r.jsx("div",{"data-controls":P?"contentMarginRight":void 0,"data-controls-axis":P?"x":void 0,"data-controls-reverse":P?"":void 0,className:P?`${e}-control`:void 0,style:{width:Z,flexShrink:0,pointerEvents:P?"auto":"none"}})]})]}),r.jsx("div",{ref:ge,className:`${e}-lightbox-strip`,style:{gap:d},"data-mouse-dragging":ce?"true":"false",children:J.map((D,V)=>{const se=D.image.objectFit??"contain",ke=V%t.length,Ve=Math.floor(V/t.length),Ze=bi(d),rt=`calc(-0.5 * (${Ze} + ${d}))`;return r.jsxs("div",{ref:ht=>ie.current[V]=ht,className:`${e}-strip-item`,style:{height:"100%"},children:[r.jsx("img",{src:D.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:se}}),P&&ke<t.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:rt,width:Ze,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ve}-${D.image.url}-${ke}`)})}),t.length>1&&w==="on"&&(()=>{const D=bi(l),V=`calc(-0.5 * (${l} + ${D}))`;return r.jsxs("div",{className:`${e}-thumbnails`,"data-thumbnail-active":b,"data-chrome-hidden":I&&!Ie?"true":"false",style:{gap:s,bottom:l,"--thumbnail-active-color":$},children:[t.map((se,ke)=>{const Ve=bi(s),Ze=`calc(-0.5 * (${Ve} + ${s}))`;return r.jsxs("div",{style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":Le===ke?"true":"false",onClick:()=>F&&h==="click"&>(ke),onMouseEnter:()=>j&&h==="hover"&>(ke),"aria-label":se.image.name?`View ${se.image.name}`:`View image ${ke+1}`,"aria-current":Le===ke?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${K?` ${e}-thumb-image-cover`:""}`,src:se.image.url,alt:"",draggable:!1,style:{...te,...S.display==="Cover"?{width:Ri}:{width:"100%"}}})}),P&&ke<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Ze,width:Ve,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${se.image.url}-${ke}`)}),P&&r.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":P?"":void 0,style:{position:"absolute",left:0,right:0,bottom:V,height:D,pointerEvents:"auto",zIndex:3}})]})})()]})]})},wp=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:s})=>{const{prefix:l}=L.useScopedStyles(),{cover:d,coverFit:a,type:u,backgroundColor:p,contentBackgroundColor:T,thumbnailVisibility:x,thumbnailObjectFit:y,thumbnailTrigger:g,thumbnailActive:h,thumbnailActiveColor:w,thumbnailGap:S,thumbnailMarginBottom:b,imageGap:$,textMaxWidth:H,title1Gap:R,title2Gap:B,closeIcon:m,closeIconMaxWidth:C,closeIconColor:N,closeIconHoverColor:v,contentMarginTop:E,contentMarginLeft:k,contentMarginRight:O}=e,U=c.useRef(null),[Z,W]=c.useState(!1),P=t??[],{title1:I,title2:F,title3:_}=gp(P),j=ee=>L.scalingValue(ee,n??!1),K=go("title1",mo(e,"title1"),n),te=go("title2",mo(e,"title2"),n),M=go("title3",mo(e,"title3"),n),ne=()=>{i||P.length===0||n&&!o||W(!0)},f=()=>{W(!1)};return r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:U,className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:pp(l)}}),d?r.jsx("button",{type:"button",className:`${l}-cover ${Kt(a)?`${l}-ratio-wrapper-cover`:`${l}-ratio-wrapper-fit`}`,onClick:ne,style:{display:"block",padding:0,border:"none",background:"transparent",...Kt(a)?{"--image-aspect-ratio":Yi(a)}:{}},"aria-label":"Open image gallery",children:r.jsx("img",{className:`${l}-cover-image ${Kt(a)?`${l}-cover-image-cover`:`${l}-cover-image-fit`}`,src:d,alt:"cover"})}):null]}),Z&&typeof document<"u"&&(()=>{const ee=(s?document.getElementById(s):null)??document.body;return ei.createPortal(r.jsx($p,{prefix:l,type:u,images:P,backgroundColor:p,contentBackgroundColor:T,thumbnailGap:j(S),thumbnailMarginBottom:j(b??.02),imageGap:j($??0),thumbnailVisibility:x,thumbnailObjectFit:y,thumbnailTrigger:g,thumbnailActive:h,thumbnailActiveColor:w,textMaxWidth:j(H),title1Gap:j(R??0),title2Gap:j(B??0),title1:I,title2:F,title3:_,title1Style:K,title2Style:te,title3Style:M,contentMarginTop:j(E??0),contentMarginLeft:j(k??0),contentMarginRight:j(O??0),closeIcon:m,closeIconMaxWidth:C,closeIconColor:N,closeIconHoverColor:v,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:f}),ee)})()]})},Tp=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
8772
|
+
|
|
8773
|
+
.${e}-control[data-controls="contentMarginTop"]::after,
|
|
8774
|
+
.${e}-control[data-controls="contentMarginBottom"]::after {
|
|
8775
|
+
content: '';
|
|
8776
|
+
position: absolute;
|
|
8777
|
+
top: 50%;
|
|
8778
|
+
left: 5%;
|
|
8779
|
+
transform: translateY(-50%);
|
|
8780
|
+
width: 12px;
|
|
8781
|
+
height: 4px;
|
|
8782
|
+
background: #FF5C02;
|
|
8783
|
+
border: 1px solid #FFFFFF;
|
|
8784
|
+
border-radius: 5px;
|
|
8785
|
+
box-sizing: border-box;
|
|
8786
|
+
pointer-events: none;
|
|
8787
|
+
}
|
|
8788
|
+
`}function mp(e){if(!Array.isArray(e)||e.length===0)return{};const t=e.find(o=>(o==null?void 0:o.type)==="paragraph")??e[0],n=t==null?void 0:t.children;if(!Array.isArray(n))return{};const i=n.map(o=>typeof(o==null?void 0:o.text)=="string"?o.text.trim():"").filter(Boolean);return{title1:i[0],title2:i[1],title3:i[2]}}function gp(e){for(const t of e)if(t.title1||t.title2||t.title3)return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""};for(const t of e){const n=mp(t.text);if(n.title1||n.title2||n.title3)return{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}return{title1:"",title2:"",title3:""}}const ci=["title1","title2","title3"];function qe(e,t){return`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`}const hp={title1:"1",title2:"2",title3:"3"};function fp(e){return[qe(e,"fontFamily"),qe(e,"fontSettings"),{type:"row",items:[qe(e,"fontSize"),qe(e,"lineHeight"),qe(e,"letterSpacing"),qe(e,"wordSpacing")]},qe(e,"textAlign"),qe(e,"textAppearance")]}function yp(){return{type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(ci.map(e=>[hp[e],fp(e)]))}}const vp={title1:"title1Color",title2:"title2Color",title3:"title3Color"},bp={title1:.02,title2:.02,title3:.02};function mo(e,t){const n=i=>{const o=qe(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[vp[t]]}}function go(e,t,n){var o,l;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((l=t.fontSettings)==null?void 0:l.fontStyle)??"normal"},fontSize:t.fontSize??bp[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return mt(i,n)}const xp=1,Xr=.15,Sp=3,Cp=20,bi=e=>`max(${e}, ${Cp}px)`,$p=({prefix:e,images:t,type:n,backgroundColor:i,contentBackgroundColor:o,thumbnailGap:l,thumbnailMarginBottom:s,imageGap:d,isEditor:a,isEditMode:p,isPreviewMode:u,closeIcon:L,closeIconMaxWidth:C,closeIconColor:y,closeIconHoverColor:g,thumbnailTrigger:h,thumbnailVisibility:T,thumbnailObjectFit:$,thumbnailActive:x,thumbnailActiveColor:S,textMaxWidth:H,title1Gap:R,title2Gap:B,title1:w,title2:I,title3:O,title1Style:m,title2Style:b,title3Style:P,contentMarginTop:F,contentMarginBottom:U,contentMarginLeft:J,contentMarginRight:W,onClose:N})=>{const v=!!p,_=!p,A=!p&&(!a||!!u),j=A,z=A,Q=Xt($),M=Q?{"--image-aspect-ratio":Yi($)}:void 0,ne=(G,X,me=!1)=>{const Re=bi(X),Oe=`calc(-0.5 * (${Re} + ${X}))`;return r.jsx("div",{"data-controls":G,"data-controls-axis":"x",...me?{"data-controls-reverse":"true"}:void 0,style:{position:"absolute",top:0,right:Oe,width:Re,height:"100%",pointerEvents:"auto",zIndex:3}})},f=!!(w||I||O),ie=(G=!1)=>{const X=[];return w&&X.push({className:`${e}-title1`,style:m,text:w,gapKey:"title1Gap",gap:R}),I&&X.push({className:`${e}-title2`,style:b,text:I,gapKey:"title2Gap",gap:B}),O&&X.push({className:`${e}-title3`,style:P,text:O}),X.map((me,Re)=>r.jsxs("div",{className:`${e}-title-cell`,style:Re<X.length-1&&me.gap?{marginRight:me.gap}:void 0,children:[r.jsx("p",{className:me.className,style:{...me.style,maxWidth:H},children:me.text}),G&&v&&me.gapKey&&me.gap&&Re<X.length-1?ne(me.gapKey,me.gap):null]},me.className))},ye=c.useRef(null),te=c.useRef(null),he=c.useRef([]),oe=c.useRef(0),ue=c.useRef({isActive:!1,startX:0,scrollLeft:0,hasMoved:!1}),V=t.length>1,Y=V?Sp:1,le=c.useMemo(()=>Array.from({length:Y},()=>t).flat(),[t,Y]),[de,Ce]=c.useState(!1),[Pe,Ee]=c.useState(!1),[ke,Ie]=c.useState(!0),[D,se]=c.useState(0),k=c.useRef(D);k.current=D;const K=c.useRef(null),q=c.useRef(!1),Z=c.useRef(null),ae=c.useRef(null),ge=c.useCallback(()=>{_&&(Ie(!0),ae.current&&clearTimeout(ae.current),ae.current=setTimeout(()=>{ue.current.isActive||Ie(!1)},up))},[_]),Fe=c.useCallback(()=>{p||q.current||(q.current=!0,Ee(!1),Z.current=setTimeout(()=>{N()},Dn))},[p,N]),$e=c.useCallback(G=>!!(G.closest("[data-controls]")||G.closest(`.${e}-thumbnails`)||G.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:we,backdropStyle:We,mediaAreaStyle:pe,chromeStyle:xe,swipeHandlers:Te}=Xa({enabled:A,onClose:Fe,animMs:Dn,isBlockedTarget:$e}),Ne=()=>{if(!V||t.length===0)return oe.current=0,0;const G=he.current[0],X=he.current[t.length];if(!G||!X)return oe.current;const me=X.offsetLeft-G.offsetLeft;return me>0&&(oe.current=me),oe.current},Ue=(G=!1)=>{if(!V)return;const X=te.current,me=Ne();!X||me<=0||(X.scrollLeft<=0?(X.scrollLeft+=me,G&&(ue.current.scrollLeft+=me)):X.scrollLeft>=me*2&&(X.scrollLeft-=me,G&&(ue.current.scrollLeft-=me)))},at=(G=(X=>(X=te.current)==null?void 0:X.scrollLeft)()??0)=>{let me=0,Re=1/0;return he.current.forEach((Oe,rt)=>{if(!Oe)return;const Se=Math.abs(Oe.offsetLeft-G);Se<Re&&(Re=Se,me=rt)}),me},lt=()=>{!te.current||t.length===0||K.current===null&&se(at()%t.length)},gt=()=>{K.current=null,lt()},vt=(G="smooth")=>{const X=te.current;if(!X||t.length===0)return;const me=at(),Re=he.current[me];Re&&(X.scrollTo({left:Re.offsetLeft,behavior:G}),se(me%t.length))},ut=G=>{const X=te.current;X&&(X.style.scrollSnapType=G?"":"none")},bt=(G,X="smooth")=>{const me=te.current;if(!me||t.length===0)return;const Re=me.scrollLeft-G,Oe=at(me.scrollLeft),rt=he.current[Oe],Se=he.current[Oe+1],Je=rt?Se?Se.offsetLeft-rt.offsetLeft:rt.offsetWidth:0;let ee=Oe;Je>0&&(Re>Je*Xr?ee+=1:Re<-Je*Xr&&(ee-=1)),V||(ee=Math.max(0,Math.min(le.length-1,ee)));const fe=he.current[ee];if(!fe){vt(X);return}me.scrollTo({left:fe.offsetLeft,behavior:X}),se(ee%t.length)},Ze=(G,X="smooth")=>{const me=te.current,Re=V?t.length+G:G,Oe=he.current[Re];!me||!Oe||(X==="smooth"?K.current=G:K.current=null,se(G),me.scrollTo({left:Oe.offsetLeft,behavior:X}))},_e=G=>{if(!j||G.pointerType!=="mouse"||G.button!==0||$e(G.target))return;const X=te.current,me=ye.current;!X||!me||(ue.current={isActive:!0,startX:G.clientX,scrollLeft:X.scrollLeft,hasMoved:!1},ut(!1),ge(),me.setPointerCapture(G.pointerId))},nt=G=>{if(!j||G.pointerType!=="mouse")return;const X=te.current;if(!X||!ue.current.isActive)return;const me=G.clientX-ue.current.startX;Math.abs(me)>xp&&(ue.current.hasMoved=!0,Ce(!0)),ue.current.hasMoved&&(G.preventDefault(),X.scrollLeft=ue.current.scrollLeft-me,Ue(!0),lt(),ge())},Qe=G=>{if(!j||G.pointerType!=="mouse")return;const X=te.current,me=ye.current;if(!X||!me)return;const Re=ue.current.hasMoved,Oe=ue.current.scrollLeft;ue.current.isActive=!1,Ce(!1),me.hasPointerCapture(G.pointerId)&&me.releasePointerCapture(G.pointerId),Ue(),ut(!0),Re?bt(Oe):lt(),ge()};return c.useEffect(()=>{const G=requestAnimationFrame(()=>Ee(!0)),X=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{cancelAnimationFrame(G),document.body.style.overflow=X,Z.current&&clearTimeout(Z.current),ae.current&&clearTimeout(ae.current)}},[]),c.useEffect(()=>{if(!_){Ie(!0);return}ge();const G=ye.current;if(!G)return;const X=()=>ge();return G.addEventListener("pointermove",X),G.addEventListener("pointerdown",X),()=>{G.removeEventListener("pointermove",X),G.removeEventListener("pointerdown",X),ae.current&&clearTimeout(ae.current)}},[_,ge]),c.useEffect(()=>{const G=X=>{X.key==="Escape"&&Fe()};return window.addEventListener("keydown",G),()=>window.removeEventListener("keydown",G)},[Fe]),c.useLayoutEffect(()=>{Ne(),Ze(k.current,"auto")},[d]),c.useLayoutEffect(()=>{Ne(),Ze(0,"auto")},[t.length,V]),c.useEffect(()=>{if(!p)return;const G=te.current;if(!G)return;const X=me=>{me.preventDefault()};return G.addEventListener("wheel",X,{passive:!1}),G.addEventListener("touchmove",X,{passive:!1}),()=>{G.removeEventListener("wheel",X),G.removeEventListener("touchmove",X)}},[p]),c.useEffect(()=>{const G=te.current;if(!G)return;let X=null;const me=()=>{Ue(),lt(),K.current!==null&&(X&&clearTimeout(X),X=setTimeout(()=>{K.current!==null&>()},150))},Re=()=>{K.current!==null&&(X&&(clearTimeout(X),X=null),gt())};G.addEventListener("scroll",me,{passive:!0}),G.addEventListener("scrollend",Re);const Oe=new ResizeObserver(()=>{Ne(),Ue(),lt()});return Oe.observe(G),()=>{X&&clearTimeout(X),G.removeEventListener("scroll",me),G.removeEventListener("scrollend",Re),Oe.disconnect()}},[t.length,V]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${a?` ${e}-lightbox-editor`:""}${p?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{we||Fe()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:Pe?1:0,transition:`opacity ${Dn}ms ease`,pointerEvents:Pe?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:i,...We}}),r.jsxs("div",{ref:ye,className:`${e}-lightbox-content`,"data-mouse-draggable":j&&t.length>0?"true":"false","data-mouse-dragging":de?"true":"false",onClick:G=>G.stopPropagation(),onPointerDown:G=>{var X;(X=Te.onPointerDown)==null||X.call(Te,G),j&&_e(G)},onPointerMove:G=>{var X;(X=Te.onPointerMove)==null||X.call(Te,G),j&&nt(G)},onPointerUp:G=>{var X;(X=Te.onPointerUp)==null||X.call(Te,G),j&&Qe(G)},onPointerCancel:G=>{var X;(X=Te.onPointerCancel)==null||X.call(Te,G),j&&Qe(G)},children:[r.jsxs("div",{className:`${e}-lightbox-content-inner`,style:{width:"100%",height:n==="A"?"100%":"auto",top:0,bottom:n==="A"?0:"auto",...n==="B"?{backgroundColor:o,position:"relative"}:{},...xe},children:[r.jsx("div",{"data-controls":v?"contentMarginTop":void 0,"data-controls-static-handle":v?"":void 0,className:v?`${e}-control`:void 0,style:{height:F,width:"100%",pointerEvents:v?"auto":"none"}}),r.jsxs("div",{className:n==="B"?`${e}-lightbox-chrome-bar`:void 0,style:{display:"flex",flexDirection:"row",width:"100%"},children:[r.jsx("div",{"data-controls":v?"contentMarginLeft":void 0,"data-controls-axis":v?"x":void 0,className:v?`${e}-control`:void 0,style:{width:J,flexShrink:0}}),r.jsxs("div",{className:`${e}-lightbox-content-area`,children:[f&&r.jsx("div",{className:`${e}-titles-row`,children:ie(!0)}),L&&r.jsx("div",{className:`${e}-close-icon`,"data-chrome-hidden":_&&!ke?"true":"false",style:{width:E.scalingValue(C??0,a),height:E.scalingValue(C??0,a),"--close-icon-hover-color":g},children:r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Fe,"aria-label":"Close",children:r.jsx(Nt,{url:L,fill:y,hoverFill:g,className:`${e}-close-icon-img`})})})]}),r.jsx("div",{"data-controls":v?"contentMarginRight":void 0,"data-controls-axis":v?"x":void 0,"data-controls-reverse":v?"":void 0,className:v?`${e}-control`:void 0,style:{width:W,flexShrink:0,pointerEvents:v?"auto":"none"}})]}),n==="B"&&r.jsx("div",{"data-controls":v?"contentMarginBottom":void 0,"data-controls-static-handle":v?"":void 0,className:v?`${e}-control`:void 0,style:{height:U,width:"100%",pointerEvents:v?"auto":"none"}})]}),r.jsx("div",{ref:te,className:`${e}-lightbox-strip`,style:{gap:d,...pe},"data-mouse-dragging":de?"true":"false",children:le.map((G,X)=>{const me=G.image.objectFit??"contain",Re=X%t.length,Oe=Math.floor(X/t.length),rt=bi(d),Se=`calc(-0.5 * (${rt} + ${d}))`;return r.jsxs("div",{ref:Je=>he.current[X]=Je,className:`${e}-strip-item`,style:{height:"100%"},children:[r.jsx("img",{src:G.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:me}}),v&&Re<t.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Se,width:rt,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Oe}-${G.image.url}-${Re}`)})}),t.length>1&&T==="on"&&(()=>{const G=bi(s),X=`calc(-0.5 * (${s} + ${G}))`;return r.jsxs("div",{className:`${e}-thumbnails`,"data-thumbnail-active":x,"data-chrome-hidden":_&&!ke?"true":"false",style:{gap:l,bottom:s,"--thumbnail-active-color":S,...xe},children:[t.map((me,Re)=>{const Oe=bi(l),rt=`calc(-0.5 * (${Oe} + ${l}))`;return r.jsxs("div",{style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":D===Re?"true":"false",onClick:()=>A&&h==="click"&&Ze(Re),onMouseEnter:()=>z&&h==="hover"&&Ze(Re),"aria-label":me.image.name?`View ${me.image.name}`:`View image ${Re+1}`,"aria-current":D===Re?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${Q?` ${e}-thumb-image-cover`:""}`,src:me.image.url,alt:"",draggable:!1,style:{...M,...$.display==="Cover"?{width:Ri}:{width:"100%"}}})}),v&&Re<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:rt,width:Oe,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${me.image.url}-${Re}`)}),v&&r.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":v?"":void 0,style:{position:"absolute",left:0,right:0,bottom:X,height:G,pointerEvents:"auto",zIndex:3}})]})})()]})]})},wp=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:l})=>{const{prefix:s}=E.useScopedStyles(),{cover:d,coverFit:a,type:p,backgroundColor:u,contentBackgroundColor:L,thumbnailVisibility:C,thumbnailObjectFit:y,thumbnailTrigger:g,thumbnailActive:h,thumbnailActiveColor:T,thumbnailGap:$,thumbnailMarginBottom:x,imageGap:S,textMaxWidth:H,title1Gap:R,title2Gap:B,closeIcon:w,closeIconMaxWidth:I,closeIconColor:O,closeIconHoverColor:m,contentMarginTop:b,contentMarginBottom:P,contentMarginLeft:F,contentMarginRight:U}=e,J=c.useRef(null),[W,N]=c.useState(!1),v=t??[],{title1:_,title2:A,title3:j}=gp(v),z=ye=>E.scalingValue(ye,n??!1),Q=go("title1",mo(e,"title1"),n),M=go("title2",mo(e,"title2"),n),ne=go("title3",mo(e,"title3"),n),f=()=>{i||v.length===0||n&&!o||N(!0)},ie=()=>{N(!1)};return r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:J,className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:pp(s)}}),d?r.jsx("button",{type:"button",className:`${s}-cover ${Xt(a)?`${s}-ratio-wrapper-cover`:`${s}-ratio-wrapper-fit`}`,onClick:f,style:{display:"block",padding:0,border:"none",background:"transparent",...Xt(a)?{"--image-aspect-ratio":Yi(a)}:{}},"aria-label":"Open image gallery",children:r.jsx("img",{className:`${s}-cover-image ${Xt(a)?`${s}-cover-image-cover`:`${s}-cover-image-fit`}`,src:d,alt:"cover"})}):null]}),W&&typeof document<"u"&&(()=>{const ye=(l?document.getElementById(l):null)??document.body;return ei.createPortal(r.jsx($p,{prefix:s,type:p,images:v,backgroundColor:u,contentBackgroundColor:L,thumbnailGap:z($),thumbnailMarginBottom:z(x??.02),imageGap:z(S??0),thumbnailVisibility:C,thumbnailObjectFit:y,thumbnailTrigger:g,thumbnailActive:h,thumbnailActiveColor:T,textMaxWidth:z(H),title1Gap:z(R??0),title2Gap:z(B??0),title1:_,title2:A,title3:j,title1Style:Q,title2Style:M,title3Style:ne,contentMarginTop:z(b??0),contentMarginBottom:z(P??0),contentMarginLeft:z(F??0),contentMarginRight:z(U??0),closeIcon:w,closeIconMaxWidth:I,closeIconColor:O,closeIconHoverColor:m,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:ie}),ye)})()]})},Tp=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
8771
8789
|
import { createPortal } from 'react-dom';
|
|
8772
8790
|
import { CommonComponentProps } from '../props';
|
|
8773
8791
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -9091,9 +9109,27 @@ function getCSS(P: string): string {
|
|
|
9091
9109
|
left: 0;
|
|
9092
9110
|
width: 100%;
|
|
9093
9111
|
height: 100%;
|
|
9112
|
+
min-width: 20px;
|
|
9113
|
+
min-height: 20px;
|
|
9094
9114
|
pointer-events: auto;
|
|
9095
9115
|
z-index: 10;
|
|
9096
9116
|
}
|
|
9117
|
+
|
|
9118
|
+
.\${P}-control[data-controls="contentMarginTop"]::after,
|
|
9119
|
+
.\${P}-control[data-controls="contentMarginBottom"]::after {
|
|
9120
|
+
content: '';
|
|
9121
|
+
position: absolute;
|
|
9122
|
+
top: 50%;
|
|
9123
|
+
left: 5%;
|
|
9124
|
+
transform: translateY(-50%);
|
|
9125
|
+
width: 12px;
|
|
9126
|
+
height: 4px;
|
|
9127
|
+
background: #FF5C02;
|
|
9128
|
+
border: 1px solid #FFFFFF;
|
|
9129
|
+
border-radius: 5px;
|
|
9130
|
+
box-sizing: border-box;
|
|
9131
|
+
pointer-events: none;
|
|
9132
|
+
}
|
|
9097
9133
|
\`;
|
|
9098
9134
|
}
|
|
9099
9135
|
|
|
@@ -9217,6 +9253,7 @@ export type LightboxStripSettings = {
|
|
|
9217
9253
|
title3TextAlign?: 'left' | 'center' | 'right' | 'justify';
|
|
9218
9254
|
title3TextAppearance?: TextStyles['textAppearance'];
|
|
9219
9255
|
contentMarginTop: number;
|
|
9256
|
+
contentMarginBottom: number;
|
|
9220
9257
|
contentMarginLeft: number;
|
|
9221
9258
|
contentMarginRight: number;
|
|
9222
9259
|
closeIcon: string | null;
|
|
@@ -9402,6 +9439,7 @@ type LightboxOverlayProps = {
|
|
|
9402
9439
|
title2Style: React.CSSProperties;
|
|
9403
9440
|
title3Style: React.CSSProperties;
|
|
9404
9441
|
contentMarginTop: string;
|
|
9442
|
+
contentMarginBottom: string;
|
|
9405
9443
|
contentMarginLeft: string;
|
|
9406
9444
|
contentMarginRight: string;
|
|
9407
9445
|
isEditor?: boolean;
|
|
@@ -9448,6 +9486,7 @@ const LightboxOverlay = ({
|
|
|
9448
9486
|
title2Style,
|
|
9449
9487
|
title3Style,
|
|
9450
9488
|
contentMarginTop,
|
|
9489
|
+
contentMarginBottom,
|
|
9451
9490
|
contentMarginLeft,
|
|
9452
9491
|
contentMarginRight,
|
|
9453
9492
|
onClose,
|
|
@@ -9575,7 +9614,8 @@ const LightboxOverlay = ({
|
|
|
9575
9614
|
const {
|
|
9576
9615
|
isSwipeDragging,
|
|
9577
9616
|
backdropStyle: swipeBackdropStyle,
|
|
9578
|
-
|
|
9617
|
+
mediaAreaStyle,
|
|
9618
|
+
chromeStyle: swipeChromeStyle,
|
|
9579
9619
|
swipeHandlers,
|
|
9580
9620
|
} = useLightboxSwipeDismiss({
|
|
9581
9621
|
enabled: allowImageScroll,
|
|
@@ -9912,7 +9952,6 @@ const LightboxOverlay = ({
|
|
|
9912
9952
|
className={\`\${P}-lightbox-content\`}
|
|
9913
9953
|
data-mouse-draggable={allowMouseDrag && images.length > 0 ? 'true' : 'false'}
|
|
9914
9954
|
data-mouse-dragging={isMouseDragging ? 'true' : 'false'}
|
|
9915
|
-
style={dismissAreaStyle}
|
|
9916
9955
|
onClick={(event) => event.stopPropagation()}
|
|
9917
9956
|
onPointerDown={(event) => {
|
|
9918
9957
|
swipeHandlers.onPointerDown?.(event);
|
|
@@ -9940,10 +9979,12 @@ const LightboxOverlay = ({
|
|
|
9940
9979
|
top: 0,
|
|
9941
9980
|
bottom: type === 'A' ? 0 : 'auto',
|
|
9942
9981
|
...(type === 'B' ? { backgroundColor: contentBackgroundColor, position: 'relative' } : {}),
|
|
9982
|
+
...swipeChromeStyle,
|
|
9943
9983
|
}}
|
|
9944
9984
|
>
|
|
9945
9985
|
<div
|
|
9946
9986
|
data-controls={showControls ? 'contentMarginTop' : undefined}
|
|
9987
|
+
data-controls-static-handle={showControls ? '' : undefined}
|
|
9947
9988
|
className={showControls ? \`\${P}-control\` : undefined}
|
|
9948
9989
|
style={{ height: contentMarginTop, width: '100%', pointerEvents: showControls ? 'auto' : 'none' }}
|
|
9949
9990
|
/>
|
|
@@ -9996,13 +10037,21 @@ const LightboxOverlay = ({
|
|
|
9996
10037
|
style={{ width: contentMarginRight, flexShrink: 0, pointerEvents: showControls ? 'auto' : 'none' }}
|
|
9997
10038
|
/>
|
|
9998
10039
|
</div>
|
|
10040
|
+
{type === 'B' && (
|
|
10041
|
+
<div
|
|
10042
|
+
data-controls={showControls ? 'contentMarginBottom' : undefined}
|
|
10043
|
+
data-controls-static-handle={showControls ? '' : undefined}
|
|
10044
|
+
className={showControls ? \`\${P}-control\` : undefined}
|
|
10045
|
+
style={{ height: contentMarginBottom, width: '100%', pointerEvents: showControls ? 'auto' : 'none' }}
|
|
10046
|
+
/>
|
|
10047
|
+
)}
|
|
9999
10048
|
</div>
|
|
10000
10049
|
|
|
10001
10050
|
|
|
10002
10051
|
<div
|
|
10003
10052
|
ref={stripRef}
|
|
10004
10053
|
className={\`\${P}-lightbox-strip\`}
|
|
10005
|
-
style={{ gap: imageGap }}
|
|
10054
|
+
style={{ gap: imageGap, ...mediaAreaStyle }}
|
|
10006
10055
|
data-mouse-dragging={isMouseDragging ? 'true' : 'false'}
|
|
10007
10056
|
>
|
|
10008
10057
|
{flatItems.map((item, flatIndex) => {
|
|
@@ -10059,6 +10108,7 @@ const LightboxOverlay = ({
|
|
|
10059
10108
|
gap: thumbnailGap,
|
|
10060
10109
|
bottom: thumbnailMarginBottom,
|
|
10061
10110
|
'--thumbnail-active-color': thumbnailActiveColor,
|
|
10111
|
+
...swipeChromeStyle,
|
|
10062
10112
|
} as React.CSSProperties}
|
|
10063
10113
|
>
|
|
10064
10114
|
{images.map((item, index) => {
|
|
@@ -10161,8 +10211,9 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
10161
10211
|
closeIconMaxWidth,
|
|
10162
10212
|
closeIconColor,
|
|
10163
10213
|
closeIconHoverColor,
|
|
10164
|
-
contentMarginTop,
|
|
10165
|
-
|
|
10214
|
+
contentMarginTop,
|
|
10215
|
+
contentMarginBottom,
|
|
10216
|
+
contentMarginLeft,
|
|
10166
10217
|
contentMarginRight
|
|
10167
10218
|
} = settings;
|
|
10168
10219
|
const wrapperRef = useRef<HTMLDivElement>(null);
|
|
@@ -10240,6 +10291,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
10240
10291
|
title2Style={title2Style}
|
|
10241
10292
|
title3Style={title3Style}
|
|
10242
10293
|
contentMarginTop={scaled(contentMarginTop ?? 0)}
|
|
10294
|
+
contentMarginBottom={scaled(contentMarginBottom ?? 0)}
|
|
10243
10295
|
contentMarginLeft={scaled(contentMarginLeft ?? 0)}
|
|
10244
10296
|
contentMarginRight={scaled(contentMarginRight ?? 0)}
|
|
10245
10297
|
closeIcon={closeIcon}
|
|
@@ -10257,7 +10309,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
10257
10309
|
</>
|
|
10258
10310
|
);
|
|
10259
10311
|
};
|
|
10260
|
-
`,Lp="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="#000000" d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" /></svg>'),un={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Ep(e){const t={};return t[qe(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[qe(e,"fontSettings")]={...un.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[qe(e,"fontSize")]={...un.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[qe(e,"lineHeight")]={...un.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[qe(e,"letterSpacing")]={...un.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[qe(e,"wordSpacing")]={...un.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[qe(e,"textAlign")]={...un.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[qe(e,"textAppearance")]={...un.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Ip=ci.reduce((e,t)=>({...e,...Ep(t)}),{}),Rp=ci.reduce((e,t)=>({...e,[qe(t,"fontFamily")]:"Arial",[qe(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[qe(t,"letterSpacing")]:0,[qe(t,"wordSpacing")]:0,[qe(t,"textAlign")]:"left",[qe(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Yr(e){return ci.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[qe(n,"fontSize")]=i),o!==void 0&&(t[qe(n,"lineHeight")]=o),t},{})}const Pp=yp(),_p={type:"object",version:1,settings:{sizing:"auto manual",properties:{cover:{type:"string",scope:"common",title:"",display:{type:"settings-image-input"}},coverFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["Fit","Cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B"]},thumbnailGap:{type:"number",scope:"layout",title:"Thumbnail Gap",min:0,max:200,display:{type:"range-control"}},thumbnailMarginBottom:{type:"number",scope:"layout",title:"Thumbnail Margin Bottom",min:0,max:200,display:{type:"range-control"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,max:200,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"layout",title:"BG",display:{type:"settings-color-picker"}},contentBackgroundColor:{type:"string",scope:"layout",title:"Content BG",display:{type:"settings-color-picker",visible:!0}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"Fill Icon",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Hover Icon",display:{type:"settings-color-picker"}},thumbnailVisibility:{type:"boolean",scope:"common",title:"Visibility",display:{type:"toggle-cycle",enum:["on","off"]}},thumbnailObjectFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["Fit","Cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailTrigger:{type:"string",scope:"common",title:"Trigger",display:{type:"toggle-cycle",enum:["click","hover"]}},thumbnailActive:{type:"boolean",scope:"common",title:"Active",display:{type:"toggle-cycle",enum:["outline","color","scale-up"]}},thumbnailActiveColor:{type:"string",scope:"common",title:"Active Color",display:{type:"palette-color-picker",visible:!1}},textMaxWidth:{type:"string",scope:"common",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},title1Gap:{type:"number",scope:"layout",title:"Title 1 Gap",min:0,max:200,display:{type:"range-control"}},title2Gap:{type:"number",scope:"layout",title:"Title 2 Gap",min:0,max:200,display:{type:"range-control"}},title1Color:{type:"string",scope:"common",title:"Title 1",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Title 2",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Title 3",display:{type:"palette-color-picker"}},...Ip,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,max:200,display:{type:"range-control"}},contentMarginLeft:{type:"number",scope:"layout",title:"Content margin left",min:0,max:200,display:{type:"range-control"}},contentMarginRight:{type:"number",scope:"layout",title:"Content margin right",min:0,max:200,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/LightboxJournal_1.jpg",coverFit:{display:"Cover",ratioValue:"16:9",reversed:!1},type:"A",closeIcon:Lp,closeIconColor:"#ffffff",closeIconHoverColor:"#cccccc",thumbnailVisibility:"on",thumbnailSize:"S",thumbnailObjectFit:{display:"Fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",thumbnailActiveColor:"#ffffff",title1Color:"#ffffff",title2Color:"#ffffff",title3Color:"#ffffff",...Rp},layoutDefaults:{m:{thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,textMaxWidth:.4,closeIconMaxWidth:.02,backgroundColor:"rgba(28, 31, 34, 0.9)",contentBackgroundColor:"rgb(10, 10, 10)",contentMarginTop:0,contentMarginLeft:.02,contentMarginRight:.2,title1Gap:.1,title2Gap:.1,...Yr({title1FontSize:.01,title1LineHeight:.02,title2FontSize:.01,title2LineHeight:.02,title3FontSize:.01,title3LineHeight:.02})},d:{thumbnailGap:.02,thumbnailMarginBottom:.02,imageGap:.005,textMaxWidth:.4,closeIconMaxWidth:.02,backgroundColor:"rgba(28, 31, 34, 0.9)",contentBackgroundColor:"rgb(10, 10, 10)",contentMarginTop:.02,contentMarginLeft:.02,contentMarginRight:.02,title1Gap:.1,title2Gap:.1,...Yr({title1FontSize:.015,title1LineHeight:.02,title2FontSize:.015,title2LineHeight:.02,title3FontSize:.015,title3LineHeight:.02})}},displayRules:[{if:{name:"type",value:"A"},then:{name:"properties.contentBackgroundColor.display.visible",value:!1}},{if:{name:"thumbnailActive",value:"color"},then:{name:"properties.thumbnailActiveColor.display.visible",value:!0}}],layout:["__componentName__","thumbnailGap","thumbnailMarginBottom","imageGap","title1Gap","title2Gap","contentMarginTop","contentMarginLeft","contentMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["type"]},{type:"row",title:"Thumbnails",items:["thumbnailVisibility","thumbnailObjectFit"]},{type:"row",items:["thumbnailTrigger","thumbnailActive"]},{type:"row",title:"Text",items:["textMaxWidth"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[Pp]}],paletteBookmark:{items:["backgroundColor","contentBackgroundColor","title1Color","title2Color","title3Color","closeIconColor","closeIconHoverColor","thumbnailActiveColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!0,stripFieldsOnAdd:["title1","title2","title3","text"]},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input",supportsMainImage:!0}},title1:{type:"string",label:"Title 1",placeholder:"Add Title 1...",display:{type:"text-input"}},title2:{type:"string",label:"Title 2",placeholder:"Add Title 2...",display:{type:"text-input"}},title3:{type:"string",label:"Title 3",placeholder:"Add Title 3...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_1.jpg",name:"",objectFit:"contain"},title1:"Ethan Parker",title2:"Midnight Atlas",title3:"Portland, OR"},{image:{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_2.jpg",name:"",objectFit:"contain"}},{image:{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_3.jpg",name:"",objectFit:"contain"}},{image:{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_4.jpg",name:"",objectFit:"contain"}},{image:{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_5.jpg",name:"",objectFit:"contain"}}]}},Ap={element:wp,id:"lightbox-strip",name:"Lightbox Strip",category:"galleries",version:1,defaultSize:{d:{width:350,height:350},m:{width:300,height:350}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Strip.mp4"},schema:_p,sourceCode:Tp,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:ci.map(e=>({path:`styles.${qe(e,"fontSettings")}`}))}},ho=300,Lo=400,Jr=300,tr="cntrl-lightbox-journal",Ji=tr,Eo=`${tr}-`,Zi=e=>`${tr}-${e}`,nr=e=>e===Ji||e.startsWith(Eo),Zr=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Qr=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Zr(t.get(Zi(e)));if(i)return i}const n=Zr(t.get(Ji));if(n)return n;for(const[i]of t){if(!i.startsWith(Eo))continue;const o=i.slice(Eo.length);if(!/^\d+$/.test(o))continue;const s=Number.parseInt(o,10);if(Number.isFinite(s)&&s>=1)return s}return null},ea=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},Ya=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{nr(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(Zi(t),String(e)):i.searchParams.set(Ji,String(e));const o=n?"replaceState":"pushState",s=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",s)},Mp=e=>{if(typeof window>"u")return;const t=new URL(window.location.href);let n=!1;if([...t.searchParams.keys()].forEach(i=>{(e?i===Zi(e)||i===Ji:nr(i))&&(t.searchParams.delete(i),n=!0)}),n){const i=`${t.pathname}${t.search}${t.hash}`;window.history.replaceState(window.history.state,"",i)}},Ja=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Zi(e)):[...t.keys()].some(n=>nr(n))},kp=(e,t)=>{if(Ja(t)){if(e){window.history.back();return}Mp(t)}};function Fp(e){return`
|
|
10312
|
+
`,Lp="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="#000000" d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" /></svg>'),un={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Ep(e){const t={};return t[qe(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[qe(e,"fontSettings")]={...un.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[qe(e,"fontSize")]={...un.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[qe(e,"lineHeight")]={...un.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[qe(e,"letterSpacing")]={...un.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[qe(e,"wordSpacing")]={...un.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[qe(e,"textAlign")]={...un.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[qe(e,"textAppearance")]={...un.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Ip=ci.reduce((e,t)=>({...e,...Ep(t)}),{}),Rp=ci.reduce((e,t)=>({...e,[qe(t,"fontFamily")]:"Arial",[qe(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[qe(t,"letterSpacing")]:0,[qe(t,"wordSpacing")]:0,[qe(t,"textAlign")]:"left",[qe(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Yr(e){return ci.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[qe(n,"fontSize")]=i),o!==void 0&&(t[qe(n,"lineHeight")]=o),t},{})}const Pp=yp(),_p={type:"object",version:1,settings:{sizing:"auto manual",properties:{cover:{type:"string",scope:"common",title:"",display:{type:"settings-image-input"}},coverFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["Fit","Cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B"]},thumbnailGap:{type:"number",scope:"layout",title:"Thumbnail Gap",min:0,max:200,display:{type:"range-control"}},thumbnailMarginBottom:{type:"number",scope:"layout",title:"Thumbnail Margin Bottom",min:0,max:200,display:{type:"range-control"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,max:200,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"layout",title:"BG Default",display:{type:"settings-color-picker"}},contentBackgroundColor:{type:"string",scope:"layout",title:"Header BG Default",display:{type:"settings-color-picker",visible:!0}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},thumbnailVisibility:{type:"boolean",scope:"common",title:"Visibility",display:{type:"toggle-cycle",enum:["on","off"]}},thumbnailObjectFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["Fit","Cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailTrigger:{type:"string",scope:"common",title:"Trigger",display:{type:"toggle-cycle",enum:["click","hover"]}},thumbnailActive:{type:"boolean",scope:"common",title:"Active",display:{type:"toggle-cycle",enum:["outline","color","scale-up"]}},thumbnailActiveColor:{type:"string",scope:"common",title:"Outline Active",display:{type:"palette-color-picker",visible:!1}},textMaxWidth:{type:"string",scope:"common",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},title1Gap:{type:"number",scope:"layout",title:"Title 1 Gap",min:0,max:200,display:{type:"range-control"}},title2Gap:{type:"number",scope:"layout",title:"Title 2 Gap",min:0,max:200,display:{type:"range-control"}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},...Ip,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,max:200,display:{type:"range-control"}},contentMarginBottom:{type:"number",scope:"layout",title:"Content margin bottom",min:0,max:200,display:{type:"range-control"}},contentMarginLeft:{type:"number",scope:"layout",title:"Content margin left",min:0,max:200,display:{type:"range-control"}},contentMarginRight:{type:"number",scope:"layout",title:"Content margin right",min:0,max:200,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/LightboxJournal_1.jpg",coverFit:{display:"Cover",ratioValue:"16:9",reversed:!1},type:"A",closeIcon:Lp,closeIconColor:"#ffffff",closeIconHoverColor:"#cccccc",thumbnailVisibility:"on",thumbnailSize:"S",thumbnailObjectFit:{display:"Fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",thumbnailActiveColor:"#ffffff",title1Color:"#ffffff",title2Color:"#ffffff",title3Color:"#ffffff",...Rp},layoutDefaults:{m:{thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,textMaxWidth:.4,closeIconMaxWidth:.02,backgroundColor:"rgba(28, 31, 34, 0.9)",contentBackgroundColor:"rgb(10, 10, 10)",contentMarginTop:0,contentMarginBottom:0,contentMarginLeft:.02,contentMarginRight:.2,title1Gap:.1,title2Gap:.1,...Yr({title1FontSize:.01,title1LineHeight:.02,title2FontSize:.01,title2LineHeight:.02,title3FontSize:.01,title3LineHeight:.02})},d:{thumbnailGap:.02,thumbnailMarginBottom:.02,imageGap:.005,textMaxWidth:.4,closeIconMaxWidth:.02,backgroundColor:"rgba(28, 31, 34, 0.9)",contentBackgroundColor:"rgb(10, 10, 10)",contentMarginTop:.02,contentMarginBottom:.02,contentMarginLeft:.02,contentMarginRight:.02,title1Gap:.1,title2Gap:.1,...Yr({title1FontSize:.015,title1LineHeight:.02,title2FontSize:.015,title2LineHeight:.02,title3FontSize:.015,title3LineHeight:.02})}},displayRules:[{if:{name:"type",value:"A"},then:{name:"properties.contentBackgroundColor.display.visible",value:!1}},{if:{name:"type",value:"A"},then:{name:"properties.contentMarginBottom.display.visible",value:!1}},{if:{name:"thumbnailActive",value:"color"},then:{name:"properties.thumbnailActiveColor.display.visible",value:!0}}],layout:["__componentName__","thumbnailGap","thumbnailMarginBottom","imageGap","title1Gap","title2Gap","contentMarginTop","contentMarginBottom","contentMarginLeft","contentMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["type"]},{type:"row",title:"Thumbnails",items:["thumbnailVisibility","thumbnailObjectFit"]},{type:"row",items:["thumbnailTrigger","thumbnailActive"]},{type:"row",title:"Text",items:["textMaxWidth"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[Pp]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","contentBackgroundColor","backgroundColor","closeIconColor","closeIconHoverColor","thumbnailActiveColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!0,stripFieldsOnAdd:["title1","title2","title3","text"]},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input",supportsMainImage:!0}},title1:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_1.jpg",name:"",objectFit:"contain"},title1:"Ethan Parker",title2:"Midnight Atlas",title3:"Portland, OR"},{image:{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_2.jpg",name:"",objectFit:"contain"}},{image:{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_3.jpg",name:"",objectFit:"contain"}},{image:{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_4.jpg",name:"",objectFit:"contain"}},{image:{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_5.jpg",name:"",objectFit:"contain"}}]}},Ap={element:wp,id:"lightbox-strip",name:"Lightbox Strip",category:"galleries",version:1,defaultSize:{d:{width:350,height:350},m:{width:300,height:350}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Strip.mp4"},schema:_p,sourceCode:Tp,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:ci.map(e=>({path:`styles.${qe(e,"fontSettings")}`}))}},ho=300,Lo=400,Jr=300,tr="cntrl-lightbox-journal",Ji=tr,Eo=`${tr}-`,Zi=e=>`${tr}-${e}`,nr=e=>e===Ji||e.startsWith(Eo),Zr=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Qr=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Zr(t.get(Zi(e)));if(i)return i}const n=Zr(t.get(Ji));if(n)return n;for(const[i]of t){if(!i.startsWith(Eo))continue;const o=i.slice(Eo.length);if(!/^\d+$/.test(o))continue;const l=Number.parseInt(o,10);if(Number.isFinite(l)&&l>=1)return l}return null},ea=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},Ya=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(s=>{nr(s)&&i.searchParams.delete(s)}),t?i.searchParams.set(Zi(t),String(e)):i.searchParams.set(Ji,String(e));const o=n?"replaceState":"pushState",l=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",l)},Mp=e=>{if(typeof window>"u")return;const t=new URL(window.location.href);let n=!1;if([...t.searchParams.keys()].forEach(i=>{(e?i===Zi(e)||i===Ji:nr(i))&&(t.searchParams.delete(i),n=!0)}),n){const i=`${t.pathname}${t.search}${t.hash}`;window.history.replaceState(window.history.state,"",i)}},Ja=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Zi(e)):[...t.keys()].some(n=>nr(n))},kp=(e,t)=>{if(Ja(t)){if(e){window.history.back();return}Mp(t)}};function Fp(e){return`
|
|
10261
10313
|
.${e}-wrapper {
|
|
10262
10314
|
position: relative;
|
|
10263
10315
|
width: 100%;
|
|
@@ -10646,10 +10698,12 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
10646
10698
|
left: 0;
|
|
10647
10699
|
width: 100%;
|
|
10648
10700
|
height: 100%;
|
|
10701
|
+
min-width: 20px;
|
|
10702
|
+
min-height: 20px;
|
|
10649
10703
|
pointer-events: auto;
|
|
10650
10704
|
z-index: 10;
|
|
10651
10705
|
}
|
|
10652
|
-
`}const Wp=20,Np=2,ta=e=>`max(${e}, ${Wp}px)`,kn=e=>((e==null?void 0:e.image)??[]).slice(0,Np),Za=e=>e.reduce((t,n)=>t+kn(n).length,0),Hp=(e,t)=>{let n=1;for(let o=0;o<t;o++)n+=kn(e[o]).length;const i=kn(e[t]).length;return{start:n,end:n+i-1}},Op=(e,t)=>{const n=Za(e),{start:i,end:o}=Hp(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Pi=(e,t)=>t==="B"?e.flatMap((n,i)=>kn(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:kn(n)})),Bp=(e,t,n,i)=>{var s;if(n==="B")return`${t+1} / ${e.length}`;const o=((s=e[t])==null?void 0:s.entryIndex)??0;return Op(i,o)},na=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",jp=(e,t,n)=>e==="B"?t.length>1:Za(n)>1,zp=({prefix:e,entries:t,journalType:n,coverFit:i,backgroundColor:o,imageGap:s,slideMaxWidth:l,slideMaxHeight:d,isEditor:a,isEditMode:u,isPreviewMode:p,closeIcon:T,closeIconMaxWidth:x,closeIconColor:y,closeIconHoverColor:g,textMaxWidth:h,titlesGap:w,countCloseGap:S,textTransition:b,title1Style:$,title2Style:H,title3Style:R,countStyle:B,contentMarginTop:m,contentMarginLeft:C,contentMarginRight:N,initialSlideIndex:v=0,enableUrlSync:E=!1,journalItemId:k=null,onBeforeClose:O,onClose:U})=>{const Z=!!u,W=!a||!!p,P=!u&&(!a||!!p),I=c.useMemo(()=>Pi(t,n),[t,n]),[F,_]=c.useState(v),j=I[F],K=j==null?void 0:j.entry,[te,M]=c.useState(!1),[ne,f]=c.useState(null),[ee,ge]=c.useState(!1),[ie,fe]=c.useState(null),[Q,me]=c.useState(!1),[G,J]=c.useState(0),[ce,pe]=c.useState(),[Ce,Pe]=c.useState(),[Ie,Ae]=c.useState(null),Le=c.useRef(null),z=c.useRef(0),ue=c.useRef(0),A=c.useRef(0),X=c.useRef(!1),q=c.useRef(null),Y=c.useRef(null),ae=c.useRef(null),he=c.useRef(null),He=c.useRef(null),we=c.useRef(null),Te=c.useCallback(()=>{const le=Y.current;if(!le)return;const ve=le.closest(`.${e}-lightbox-content-area`);if(!ve)return le.getBoundingClientRect().width;let Se=0;return Array.from(ve.children).forEach(Re=>{Re instanceof HTMLElement&&(Re.contains(le)||(Se+=Re.getBoundingClientRect().width))}),ve.getBoundingClientRect().width-Se},[e]),We=c.useCallback(()=>{Le.current&&(clearTimeout(Le.current),Le.current=null)},[]),re=c.useCallback(le=>{le===z.current&&(fe(null),me(!1))},[]),be=c.useCallback(()=>{u||X.current||(X.current=!0,O==null||O(),M(!1),q.current=setTimeout(()=>{U()},ho))},[u,O,U]),Fe=c.useCallback(le=>!!(le.closest("[data-controls]")||le.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:Oe,backdropStyle:Ge,dismissAreaStyle:it,swipeHandlers:mt}=Xa({enabled:P,onClose:be,animMs:ho,isBlockedTarget:Fe}),ct=c.useCallback(le=>{E&&Ya(le+1,k,!0)},[E,k]),ot=c.useCallback(le=>{var yn,Be;if(I.length===0)return;const ve=(le%I.length+I.length)%I.length;if(ve===F)return;const Se=I[F],Re=I[ve];z.current+=1;const Ue=z.current,Lt=b==="fade"&&na(Se==null?void 0:Se.entry)!==na(Re==null?void 0:Re.entry),bt=(yn=Y.current)==null?void 0:yn.getBoundingClientRect().height;let Yt,kt;Lt&&(kt=Te(),ei.flushSync(()=>{Ae(Re.entry)}),ae.current&&kt&&(ae.current.style.width=`${kt}px`),Yt=(Be=ae.current)==null?void 0:Be.getBoundingClientRect().height,ae.current&&(ae.current.style.width=""));const sn=Math.max(bt??0,Yt??0)||void 0;J(Ue),fe(F),me(!0),_(ve),ct(ve),A.current=ve,Lt?(We(),sn&&pe(sn),kt&&Pe(kt),f((Se==null?void 0:Se.entryIndex)??null),ge(!0),ue.current=Re.entryIndex,Le.current=setTimeout(()=>{f(null),ge(!1),pe(void 0),Pe(void 0),Ae(null),Le.current=null},Lo)):(We(),f(null),ge(!1),pe(void 0),Pe(void 0),Ae(null),ue.current=Re.entryIndex)},[F,We,Te,I,ct,b]),gt=le=>{var Ue;if(!W||le.pointerType!=="mouse"||I.length<=1||le.button!==0||le.target.closest("[data-controls]"))return;const Se=(Ue=he.current)==null?void 0:Ue.getBoundingClientRect(),Re=Se?Se.left+Se.width/2:window.innerWidth/2;le.clientX<Re?ot(F-1):ot(F+1)};c.useEffect(()=>{we.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const le=requestAnimationFrame(()=>{M(!0),requestAnimationFrame(()=>{He.current?He.current.focus():he.current&&he.current.focus()})}),ve=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{cancelAnimationFrame(le),document.body.style.overflow=ve,q.current&&clearTimeout(q.current),Le.current&&clearTimeout(Le.current);const Se=we.current;Se&&document.contains(Se)&&Se.focus()}},[]),c.useEffect(()=>{var le;b!=="fade"&&(ue.current=((le=I[F])==null?void 0:le.entryIndex)??0,We(),f(null),ge(!1),pe(void 0),Pe(void 0))},[F,We,I,b]),c.useEffect(()=>{const le=ve=>{if(ve.key==="Escape"){be();return}if(ve.key==="ArrowLeft"&&I.length>1){ot(F-1);return}if(ve.key==="ArrowRight"&&I.length>1){ot(F+1);return}if(ve.key==="Tab"&&he.current){const Se=he.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),Re=Array.from(Se).filter(Yt=>!Yt.closest('[aria-hidden="true"]'));if(Re.length===0)return;const Ue=Re[0],Lt=Re[Re.length-1],bt=document.activeElement;ve.shiftKey?(bt===Ue||!he.current.contains(bt))&&(ve.preventDefault(),Lt.focus()):(bt===Lt||!he.current.contains(bt))&&(ve.preventDefault(),Ue.focus())}};return window.addEventListener("keydown",le),()=>window.removeEventListener("keydown",le)},[ot,be,F,I.length]),c.useLayoutEffect(()=>{We(),z.current=0,J(0),fe(null),me(!1),f(null),ge(!1),pe(void 0),Pe(void 0),Ae(null),_(le=>{const ve=Math.max(0,I.length-1);return Math.min(le,ve)})},[We,t.length,n,I.length]),c.useLayoutEffect(()=>{var le;A.current=v,ue.current=((le=I[v])==null?void 0:le.entryIndex)??0,_(v)},[v,I.length]);const Je=ne!==null?t[ne]:null,Tt=ie!==null?I[ie]:null,_e=!!(K!=null&&K.title1||K!=null&&K.title2||K!=null&&K.title3||Je!=null&&Je.title1||Je!=null&&Je.title2||Je!=null&&Je.title3),D=jp(n,I,t),V=!!T,se={gap:w},ke=D&&V?{gap:S}:void 0,Ve=(le,ve,Se=!1)=>{const Re=ta(ve),Ue=`calc(-0.5 * (${Re} + ${ve}))`;return r.jsx("div",{"data-controls":le,"data-controls-axis":"x",...Se?{"data-controls-reverse":"true"}:void 0,style:{position:"absolute",top:0,right:Ue,width:Re,height:"100%",pointerEvents:"auto",zIndex:3}})},Ze=(le,ve=!1)=>{if(!le)return null;const Se=[le.title1?{className:`${e}-title1`,style:$,text:le.title1}:null,le.title2?{className:`${e}-title2`,style:H,text:le.title2}:null,le.title3?{className:`${e}-title3`,style:R,text:le.title3}:null].filter(Re=>Re!==null);return Se.map((Re,Ue)=>r.jsxs("div",{className:`${e}-title-cell`,children:[r.jsx("p",{className:Re.className,style:{...Re.style,maxWidth:h},children:Re.text}),ve&&Z&&Ue<Se.length-1?Ve("titlesGap",w):null]},Re.className))},rt=le=>{const ve=!le.objectFit&&Kt(i);return{className:`${e}-slide-image-cell${ve?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:l,maxHeight:d,...ve?{"--image-aspect-ratio":Yi(i)}:{}}}},ht=le=>le.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":le.objectFit}}:Kt(i)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},$e=le=>{if(le.length===0)return null;const ve=le.length>1,Se=ta(s),Re=`calc(-0.5 * (${Se} + ${s}))`;if(le.length===1){const Ue=le[0];return r.jsx("div",{...rt(Ue),children:r.jsx("img",{...ht(Ue),src:Ue.url,alt:Ue.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:ve?{gap:s}:void 0,children:le.map((Ue,Lt)=>r.jsxs("div",{...rt(Ue),children:[r.jsx("img",{...ht(Ue),src:Ue.url,alt:Ue.name??"",draggable:!1}),Z&&ve&&Lt<le.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Re,width:Se,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ue.url}-${Lt}`))})};return r.jsxs("div",{ref:he,"data-selection":"none",className:`${e}-lightbox${a?` ${e}-lightbox-editor`:""}${u?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{Oe||be()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:V?void 0:-1,style:{opacity:te?1:0,transition:`opacity ${ho}ms ease`,pointerEvents:te?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:o,...Ge}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:{position:"relative",width:"100%",height:"100%",...it},...mt,children:[r.jsx("div",{className:`${e}-lightbox-content`,onClick:le=>le.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":W&&I.length>1?"true":"false",onPointerUp:W?gt:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[Tt&&Q?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:le=>{le.target===le.currentTarget&&re(G)},children:r.jsx("div",{className:`${e}-slide-area`,children:$e(Tt.images)})},`slide-out-${G}`):null,r.jsx("div",{className:`${e}-slide-layer-in${Q?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:j?$e(j.images):null})},`slide-in-${G}-${F}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-chrome`,style:{width:"100%",height:"100%"},children:[r.jsx("div",{"data-controls":Z?"contentMarginTop":void 0,className:Z?`${e}-control`:void 0,style:{height:m,width:"100%"}}),r.jsxs("div",{style:{display:"flex",flexDirection:"row",width:"100%"},children:[r.jsx("div",{"data-controls":Z?"contentMarginLeft":void 0,"data-controls-axis":Z?"x":void 0,className:Z?`${e}-control`:void 0,style:{width:C,flexShrink:0}}),r.jsxs("div",{className:`${e}-lightbox-content-area`,children:[_e&&r.jsx("div",{className:`${e}-text-bar-cell`,children:r.jsx("div",{className:`${e}-titles-row`,style:se,children:b==="fade"?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:ae,className:`${e}-titles-stack`,style:{...se,position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Ze(Ie||K,!1)}),r.jsxs("div",{ref:Y,className:`${e}-titles-stack`,style:{...se,...ee&&ce?{minHeight:ce}:void 0,...ee&&Ce?{width:Ce,maxWidth:"100%"}:void 0,...ee?{overflow:"hidden"}:void 0},children:[Je&&ee?r.jsx("div",{className:`${e}-titles-layer-out ${e}-titles-fade-out`,style:se,children:Ze(Je)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ee?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,style:se,children:Ze(K,!0)})]})]}):Ze(K,!0)})}),r.jsxs("div",{className:`${e}-lightbox-persistent-controls`,style:ke,children:[D&&r.jsxs("div",{className:`${e}-text-bar-cell`,children:[r.jsx("span",{className:`${e}-entry-counter`,style:B,"aria-live":"polite","aria-atomic":"true",children:Bp(I,F,n,t)}),Z&&V?Ve("countCloseGap",S,!0):null]}),V&&r.jsx("div",{className:`${e}-close-icon`,style:{width:L.scalingValue(x??0,a),height:L.scalingValue(x??0,a),"--close-icon-hover-color":g},children:r.jsx("button",{ref:He,type:"button",className:`${e}-close-icon-inner`,onClick:be,"aria-label":"Close",children:r.jsx(Wt,{url:T??"",fill:y,hoverFill:g,className:`${e}-close-icon-img`})})})]})]}),r.jsx("div",{"data-controls":Z?"contentMarginRight":void 0,"data-controls-axis":Z?"x":void 0,"data-controls-reverse":Z?"":void 0,className:Z?`${e}-control`:void 0,style:{width:N,flexShrink:0}})]})]})]})]})},di=["title1","title2","title3","count"];function Xe(e,t){return`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`}const Dp={title1:"1",title2:"2",title3:"3",count:"Count"};function Vp(e){return[Xe(e,"fontFamily"),Xe(e,"fontSettings"),{type:"row",items:[Xe(e,"fontSize"),Xe(e,"lineHeight"),Xe(e,"letterSpacing"),Xe(e,"wordSpacing")]},Xe(e,"textAlign"),Xe(e,"textAppearance")]}function Gp(){return{type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(di.map(e=>[Dp[e],Vp(e)]))}}const Up={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Kp={title1:.02,title2:.02,title3:.02,count:.017};function xi(e,t){const n=i=>{const o=Xe(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[Up[t]]}}function Si(e,t,n){var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??Kp[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return dt(i,n)}const qp=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:s,metadata:l})=>{const{prefix:d}=L.useScopedStyles(),a=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:T,backgroundColor:x,imageGap:y,maxWidth:g,maxHeight:h,textMaxWidth:w,textTransition:S,titlesGap:b,countCloseGap:$,closeIcon:H,closeIconMaxWidth:R,closeIconColor:B,closeIconHoverColor:m,contentMarginTop:C,contentMarginLeft:N,contentMarginRight:v}=e,E=ie=>L.scalingValue(ie,n??!1),k=Si("title1",xi(e,"title1"),n),O=Si("title2",xi(e,"title2"),n),U=Si("title3",xi(e,"title3"),n),Z=Si("count",xi(e,"count"),n),W=c.useRef(null),[P,I]=c.useState(!1),[F,_]=c.useState(0),j=c.useRef(!1),K=c.useRef(!1),te=c.useRef(!1),M=c.useMemo(()=>(t??[]).filter(ie=>kn(ie).length>0),[t]),ne=!n||!!o,f=c.useCallback(()=>{ne&&(te.current=!0,kp(K.current,a),K.current=!1)},[ne,a]),ee=(ie=0)=>{if(i||M.length===0||n&&!o)return;const fe=Pi(M,T),Q=Math.max(0,Math.min(ie,fe.length-1));if(_(Q),ne){const me=Ja();Ya(Q+1,a,me),K.current=!me}I(!0)},ge=c.useCallback(()=>{I(!1),te.current=!1},[]);return c.useEffect(()=>{if(!ne||j.current)return;j.current=!0;const ie=Qr(a);if(!ie)return;const fe=ea(ie,Pi(M,T).length);fe<0||(_(fe),I(!0))},[M,a,ne,T]),c.useEffect(()=>{if(!ne)return;const ie=()=>{if(te.current){te.current=!1,I(!1);return}const fe=Qr(a);if(!fe){I(!1);return}const Q=ea(fe,Pi(M,T).length);if(Q<0){I(!1);return}K.current=!1,_(Q),I(!0)};return window.addEventListener("popstate",ie),()=>window.removeEventListener("popstate",ie)},[M,a,ne,T]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:W,className:`${d}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Fp(d)}}),u?r.jsx("button",{type:"button",className:`${d}-cover ${Kt(p)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>ee(),style:{display:"block",padding:0,border:"none",background:"transparent",...Kt(p)?{"--image-aspect-ratio":Yi(p)}:{}},"aria-label":"Open journal gallery",children:r.jsx("img",{className:`${d}-cover-image ${Kt(p)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),P&&typeof document<"u"&&(()=>{const ie=(s?document.getElementById(s):null)??document.body;return ei.createPortal(r.jsx(zp,{prefix:d,entries:M,journalType:T,coverFit:p,backgroundColor:x,imageGap:E(y??0),slideMaxWidth:`${g}%`,slideMaxHeight:`${h}%`,textMaxWidth:E(w??.4),titlesGap:E(b??0),countCloseGap:E($??0),textTransition:S,title1Style:k,title2Style:O,title3Style:U,countStyle:Z,contentMarginTop:E(C??0),contentMarginLeft:E(N??0),contentMarginRight:E(v??0),closeIcon:H,closeIconMaxWidth:R,closeIconColor:B,closeIconHoverColor:m,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:F,enableUrlSync:ne,journalItemId:a,onBeforeClose:f,onClose:ge}),ie)})()]})},Xp=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
10706
|
+
`}const Wp=20,Np=2,ta=e=>`max(${e}, ${Wp}px)`,kn=e=>((e==null?void 0:e.image)??[]).slice(0,Np),Za=e=>e.reduce((t,n)=>t+kn(n).length,0),Hp=(e,t)=>{let n=1;for(let o=0;o<t;o++)n+=kn(e[o]).length;const i=kn(e[t]).length;return{start:n,end:n+i-1}},Bp=(e,t)=>{const n=Za(e),{start:i,end:o}=Hp(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Pi=(e,t)=>t==="B"?e.flatMap((n,i)=>kn(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:kn(n)})),Op=(e,t,n,i)=>{var l;if(n==="B")return`${t+1} / ${e.length}`;const o=((l=e[t])==null?void 0:l.entryIndex)??0;return Bp(i,o)},na=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",jp=(e,t,n)=>e==="B"?t.length>1:Za(n)>1,Dp=({prefix:e,entries:t,journalType:n,coverFit:i,backgroundColor:o,imageGap:l,slideMaxWidth:s,slideMaxHeight:d,isEditor:a,isEditMode:p,isPreviewMode:u,closeIcon:L,closeIconMaxWidth:C,closeIconColor:y,closeIconHoverColor:g,textMaxWidth:h,titlesGap:T,countCloseGap:$,textTransition:x,title1Style:S,title2Style:H,title3Style:R,countStyle:B,contentMarginTop:w,contentMarginLeft:I,contentMarginRight:O,initialSlideIndex:m=0,enableUrlSync:b=!1,journalItemId:P=null,onBeforeClose:F,onClose:U})=>{const J=!!p,W=!a||!!u,N=!p&&(!a||!!u),v=c.useMemo(()=>Pi(t,n),[t,n]),[_,A]=c.useState(m),j=v[_],z=j==null?void 0:j.entry,[Q,M]=c.useState(!1),[ne,f]=c.useState(null),[ie,ye]=c.useState(!1),[te,he]=c.useState(null),[oe,ue]=c.useState(!1),[V,Y]=c.useState(0),[le,de]=c.useState(),[Ce,Pe]=c.useState(),[Ee,ke]=c.useState(null),Ie=c.useRef(null),D=c.useRef(0),se=c.useRef(0),k=c.useRef(0),K=c.useRef(!1),q=c.useRef(null),Z=c.useRef(null),ae=c.useRef(null),ge=c.useRef(null),Fe=c.useRef(null),$e=c.useRef(null),we=c.useCallback(()=>{const ee=Z.current;if(!ee)return;const fe=ee.closest(`.${e}-lightbox-content-area`);if(!fe)return ee.getBoundingClientRect().width;let Ae=0;return Array.from(fe.children).forEach(je=>{je instanceof HTMLElement&&(je.contains(ee)||(Ae+=je.getBoundingClientRect().width))}),fe.getBoundingClientRect().width-Ae},[e]),We=c.useCallback(()=>{Ie.current&&(clearTimeout(Ie.current),Ie.current=null)},[]),pe=c.useCallback(ee=>{ee===D.current&&(he(null),ue(!1))},[]),xe=c.useCallback(()=>{p||K.current||(K.current=!0,F==null||F(),M(!1),q.current=setTimeout(()=>{U()},ho))},[p,F,U]),Te=c.useCallback(ee=>!!(ee.closest("[data-controls]")||ee.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:Ne,backdropStyle:Ue,mediaAreaStyle:at,chromeStyle:lt,swipeHandlers:gt}=Xa({enabled:N,onClose:xe,animMs:ho,isBlockedTarget:Te}),vt=c.useCallback(ee=>{b&&Ya(ee+1,P,!0)},[b,P]),ut=c.useCallback(ee=>{var Be,pt;if(v.length===0)return;const fe=(ee%v.length+v.length)%v.length;if(fe===_)return;const Ae=v[_],je=v[fe];D.current+=1;const Ke=D.current,ht=x==="fade"&&na(Ae==null?void 0:Ae.entry)!==na(je==null?void 0:je.entry),kt=(Be=Z.current)==null?void 0:Be.getBoundingClientRect().height;let jt,Ft;ht&&(Ft=we(),ei.flushSync(()=>{ke(je.entry)}),ae.current&&Ft&&(ae.current.style.width=`${Ft}px`),jt=(pt=ae.current)==null?void 0:pt.getBoundingClientRect().height,ae.current&&(ae.current.style.width=""));const yn=Math.max(kt??0,jt??0)||void 0;Y(Ke),he(_),ue(!0),A(fe),vt(fe),k.current=fe,ht?(We(),yn&&de(yn),Ft&&Pe(Ft),f((Ae==null?void 0:Ae.entryIndex)??null),ye(!0),se.current=je.entryIndex,Ie.current=setTimeout(()=>{f(null),ye(!1),de(void 0),Pe(void 0),ke(null),Ie.current=null},Lo)):(We(),f(null),ye(!1),de(void 0),Pe(void 0),ke(null),se.current=je.entryIndex)},[_,We,we,v,vt,x]),bt=ee=>{var Ke;if(!W||ee.pointerType!=="mouse"||v.length<=1||ee.button!==0||ee.target.closest("[data-controls]"))return;const Ae=(Ke=ge.current)==null?void 0:Ke.getBoundingClientRect(),je=Ae?Ae.left+Ae.width/2:window.innerWidth/2;ee.clientX<je?ut(_-1):ut(_+1)};c.useEffect(()=>{$e.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const ee=requestAnimationFrame(()=>{M(!0),requestAnimationFrame(()=>{Fe.current?Fe.current.focus():ge.current&&ge.current.focus()})}),fe=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{cancelAnimationFrame(ee),document.body.style.overflow=fe,q.current&&clearTimeout(q.current),Ie.current&&clearTimeout(Ie.current);const Ae=$e.current;Ae&&document.contains(Ae)&&Ae.focus()}},[]),c.useEffect(()=>{var ee;x!=="fade"&&(se.current=((ee=v[_])==null?void 0:ee.entryIndex)??0,We(),f(null),ye(!1),de(void 0),Pe(void 0))},[_,We,v,x]),c.useEffect(()=>{const ee=fe=>{if(fe.key==="Escape"){xe();return}if(fe.key==="ArrowLeft"&&v.length>1){ut(_-1);return}if(fe.key==="ArrowRight"&&v.length>1){ut(_+1);return}if(fe.key==="Tab"&&ge.current){const Ae=ge.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),je=Array.from(Ae).filter(jt=>!jt.closest('[aria-hidden="true"]'));if(je.length===0)return;const Ke=je[0],ht=je[je.length-1],kt=document.activeElement;fe.shiftKey?(kt===Ke||!ge.current.contains(kt))&&(fe.preventDefault(),ht.focus()):(kt===ht||!ge.current.contains(kt))&&(fe.preventDefault(),Ke.focus())}};return window.addEventListener("keydown",ee),()=>window.removeEventListener("keydown",ee)},[ut,xe,_,v.length]),c.useLayoutEffect(()=>{We(),D.current=0,Y(0),he(null),ue(!1),f(null),ye(!1),de(void 0),Pe(void 0),ke(null),A(ee=>{const fe=Math.max(0,v.length-1);return Math.min(ee,fe)})},[We,t.length,n,v.length]),c.useLayoutEffect(()=>{var ee;k.current=m,se.current=((ee=v[m])==null?void 0:ee.entryIndex)??0,A(m)},[m,v.length]);const Ze=ne!==null?t[ne]:null,_e=te!==null?v[te]:null,nt=!!(z!=null&&z.title1||z!=null&&z.title2||z!=null&&z.title3||Ze!=null&&Ze.title1||Ze!=null&&Ze.title2||Ze!=null&&Ze.title3),Qe=jp(n,v,t),G=!!L,X={gap:T},me=Qe&&G?{gap:$}:void 0,Re=(ee,fe,Ae=!1)=>{const je=ta(fe),Ke=`calc(-0.5 * (${je} + ${fe}))`;return r.jsx("div",{"data-controls":ee,"data-controls-axis":"x",...Ae?{"data-controls-reverse":"true"}:void 0,style:{position:"absolute",top:0,right:Ke,width:je,height:"100%",pointerEvents:"auto",zIndex:3}})},Oe=(ee,fe=!1)=>{if(!ee)return null;const Ae=[ee.title1?{className:`${e}-title1`,style:S,text:ee.title1}:null,ee.title2?{className:`${e}-title2`,style:H,text:ee.title2}:null,ee.title3?{className:`${e}-title3`,style:R,text:ee.title3}:null].filter(je=>je!==null);return Ae.map((je,Ke)=>r.jsxs("div",{className:`${e}-title-cell`,children:[r.jsx("p",{className:je.className,style:{...je.style,maxWidth:h},children:je.text}),fe&&J&&Ke<Ae.length-1?Re("titlesGap",T):null]},je.className))},rt=ee=>{const fe=!ee.objectFit&&Xt(i);return{className:`${e}-slide-image-cell${fe?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:s,maxHeight:d,...fe?{"--image-aspect-ratio":Yi(i)}:{}}}},Se=ee=>ee.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":ee.objectFit}}:Xt(i)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},Je=ee=>{if(ee.length===0)return null;const fe=ee.length>1,Ae=ta(l),je=`calc(-0.5 * (${Ae} + ${l}))`;if(ee.length===1){const Ke=ee[0];return r.jsx("div",{...rt(Ke),children:r.jsx("img",{...Se(Ke),src:Ke.url,alt:Ke.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:fe?{gap:l}:void 0,children:ee.map((Ke,ht)=>r.jsxs("div",{...rt(Ke),children:[r.jsx("img",{...Se(Ke),src:Ke.url,alt:Ke.name??"",draggable:!1}),J&&fe&&ht<ee.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:je,width:Ae,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ke.url}-${ht}`))})};return r.jsxs("div",{ref:ge,"data-selection":"none",className:`${e}-lightbox${a?` ${e}-lightbox-editor`:""}${p?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{Ne||xe()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:G?void 0:-1,style:{opacity:Q?1:0,transition:`opacity ${ho}ms ease`,pointerEvents:Q?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:o,...Ue}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:{position:"relative",width:"100%",height:"100%"},...gt,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:at,onClick:ee=>ee.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":W&&v.length>1?"true":"false",onPointerUp:W?bt:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[_e&&oe?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:ee=>{ee.target===ee.currentTarget&&pe(V)},children:r.jsx("div",{className:`${e}-slide-area`,children:Je(_e.images)})},`slide-out-${V}`):null,r.jsx("div",{className:`${e}-slide-layer-in${oe?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:j?Je(j.images):null})},`slide-in-${V}-${_}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-chrome`,style:{width:"100%",height:"100%",...lt},children:[r.jsx("div",{"data-controls":J?"contentMarginTop":void 0,className:J?`${e}-control`:void 0,style:{height:w,width:"100%"}}),r.jsxs("div",{style:{display:"flex",flexDirection:"row",width:"100%"},children:[r.jsx("div",{"data-controls":J?"contentMarginLeft":void 0,"data-controls-axis":J?"x":void 0,className:J?`${e}-control`:void 0,style:{width:I,flexShrink:0}}),r.jsxs("div",{className:`${e}-lightbox-content-area`,children:[nt&&r.jsx("div",{className:`${e}-text-bar-cell`,children:r.jsx("div",{className:`${e}-titles-row`,style:X,children:x==="fade"?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:ae,className:`${e}-titles-stack`,style:{...X,position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Oe(Ee||z,!1)}),r.jsxs("div",{ref:Z,className:`${e}-titles-stack`,style:{...X,...ie&&le?{minHeight:le}:void 0,...ie&&Ce?{width:Ce,maxWidth:"100%"}:void 0,...ie?{overflow:"hidden"}:void 0},children:[Ze&&ie?r.jsx("div",{className:`${e}-titles-layer-out ${e}-titles-fade-out`,style:X,children:Oe(Ze)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ie?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,style:X,children:Oe(z,!0)})]})]}):Oe(z,!0)})}),r.jsxs("div",{className:`${e}-lightbox-persistent-controls`,style:me,children:[Qe&&r.jsxs("div",{className:`${e}-text-bar-cell`,children:[r.jsx("span",{className:`${e}-entry-counter`,style:B,"aria-live":"polite","aria-atomic":"true",children:Op(v,_,n,t)}),J&&G?Re("countCloseGap",$,!0):null]}),G&&r.jsx("div",{className:`${e}-close-icon`,style:{width:E.scalingValue(C??0,a),height:E.scalingValue(C??0,a),"--close-icon-hover-color":g},children:r.jsx("button",{ref:Fe,type:"button",className:`${e}-close-icon-inner`,onClick:xe,"aria-label":"Close",children:r.jsx(Nt,{url:L??"",fill:y,hoverFill:g,className:`${e}-close-icon-img`})})})]})]}),r.jsx("div",{"data-controls":J?"contentMarginRight":void 0,"data-controls-axis":J?"x":void 0,"data-controls-reverse":J?"":void 0,className:J?`${e}-control`:void 0,style:{width:O,flexShrink:0}})]})]})]})]})},di=["title1","title2","title3","count"];function Xe(e,t){return`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`}const zp={title1:"1",title2:"2",title3:"3",count:"Count"};function Vp(e){return[Xe(e,"fontFamily"),Xe(e,"fontSettings"),{type:"row",items:[Xe(e,"fontSize"),Xe(e,"lineHeight"),Xe(e,"letterSpacing"),Xe(e,"wordSpacing")]},Xe(e,"textAlign"),Xe(e,"textAppearance")]}function Gp(){return{type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(di.map(e=>[zp[e],Vp(e)]))}}const Up={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Kp={title1:.02,title2:.02,title3:.02,count:.017};function xi(e,t){const n=i=>{const o=Xe(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[Up[t]]}}function Si(e,t,n){var o,l;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((l=t.fontSettings)==null?void 0:l.fontStyle)??"normal"},fontSize:t.fontSize??Kp[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return mt(i,n)}const qp=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:l,metadata:s})=>{const{prefix:d}=E.useScopedStyles(),a=(s==null?void 0:s.itemId)??null,{cover:p,coverFit:u,type:L,backgroundColor:C,imageGap:y,maxWidth:g,maxHeight:h,textMaxWidth:T,textTransition:$,titlesGap:x,countCloseGap:S,closeIcon:H,closeIconMaxWidth:R,closeIconColor:B,closeIconHoverColor:w,contentMarginTop:I,contentMarginLeft:O,contentMarginRight:m}=e,b=te=>E.scalingValue(te,n??!1),P=Si("title1",xi(e,"title1"),n),F=Si("title2",xi(e,"title2"),n),U=Si("title3",xi(e,"title3"),n),J=Si("count",xi(e,"count"),n),W=c.useRef(null),[N,v]=c.useState(!1),[_,A]=c.useState(0),j=c.useRef(!1),z=c.useRef(!1),Q=c.useRef(!1),M=c.useMemo(()=>(t??[]).filter(te=>kn(te).length>0),[t]),ne=!n||!!o,f=c.useCallback(()=>{ne&&(Q.current=!0,kp(z.current,a),z.current=!1)},[ne,a]),ie=(te=0)=>{if(i||M.length===0||n&&!o)return;const he=Pi(M,L),oe=Math.max(0,Math.min(te,he.length-1));if(A(oe),ne){const ue=Ja();Ya(oe+1,a,ue),z.current=!ue}v(!0)},ye=c.useCallback(()=>{v(!1),Q.current=!1},[]);return c.useEffect(()=>{if(!ne||j.current)return;j.current=!0;const te=Qr(a);if(!te)return;const he=ea(te,Pi(M,L).length);he<0||(A(he),v(!0))},[M,a,ne,L]),c.useEffect(()=>{if(!ne)return;const te=()=>{if(Q.current){Q.current=!1,v(!1);return}const he=Qr(a);if(!he){v(!1);return}const oe=ea(he,Pi(M,L).length);if(oe<0){v(!1);return}z.current=!1,A(oe),v(!0)};return window.addEventListener("popstate",te),()=>window.removeEventListener("popstate",te)},[M,a,ne,L]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:W,className:`${d}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Fp(d)}}),p?r.jsx("button",{type:"button",className:`${d}-cover ${Xt(u)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>ie(),style:{display:"block",padding:0,border:"none",background:"transparent",...Xt(u)?{"--image-aspect-ratio":Yi(u)}:{}},"aria-label":"Open journal gallery",children:r.jsx("img",{className:`${d}-cover-image ${Xt(u)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:p,alt:"cover"})}):null]}),N&&typeof document<"u"&&(()=>{const te=(l?document.getElementById(l):null)??document.body;return ei.createPortal(r.jsx(Dp,{prefix:d,entries:M,journalType:L,coverFit:u,backgroundColor:C,imageGap:b(y??0),slideMaxWidth:`${g}%`,slideMaxHeight:`${h}%`,textMaxWidth:b(T??.4),titlesGap:b(x??0),countCloseGap:b(S??0),textTransition:$,title1Style:P,title2Style:F,title3Style:U,countStyle:J,contentMarginTop:b(I??0),contentMarginLeft:b(O??0),contentMarginRight:b(m??0),closeIcon:H,closeIconMaxWidth:R,closeIconColor:B,closeIconHoverColor:w,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:_,enableUrlSync:ne,journalItemId:a,onBeforeClose:f,onClose:ye}),te)})()]})},Xp=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
10653
10707
|
import { createPortal, flushSync } from 'react-dom';
|
|
10654
10708
|
import { CommonComponentProps } from '../props';
|
|
10655
10709
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -11154,6 +11208,8 @@ function getCSS(P: string): string {
|
|
|
11154
11208
|
left: 0;
|
|
11155
11209
|
width: 100%;
|
|
11156
11210
|
height: 100%;
|
|
11211
|
+
min-width: 20px;
|
|
11212
|
+
min-height: 20px;
|
|
11157
11213
|
pointer-events: auto;
|
|
11158
11214
|
z-index: 10;
|
|
11159
11215
|
}
|
|
@@ -11386,7 +11442,8 @@ const LightboxOverlay = ({
|
|
|
11386
11442
|
const {
|
|
11387
11443
|
isSwipeDragging,
|
|
11388
11444
|
backdropStyle: swipeBackdropStyle,
|
|
11389
|
-
|
|
11445
|
+
mediaAreaStyle,
|
|
11446
|
+
chromeStyle: swipeChromeStyle,
|
|
11390
11447
|
swipeHandlers,
|
|
11391
11448
|
} = useLightboxSwipeDismiss({
|
|
11392
11449
|
enabled: allowSwipeDismiss,
|
|
@@ -11748,12 +11805,12 @@ const LightboxOverlay = ({
|
|
|
11748
11805
|
position: 'relative',
|
|
11749
11806
|
width: '100%',
|
|
11750
11807
|
height: '100%',
|
|
11751
|
-
...dismissAreaStyle,
|
|
11752
11808
|
}}
|
|
11753
11809
|
{...swipeHandlers}
|
|
11754
11810
|
>
|
|
11755
11811
|
<div
|
|
11756
11812
|
className={\`\${P}-lightbox-content\`}
|
|
11813
|
+
style={mediaAreaStyle}
|
|
11757
11814
|
onClick={(event) => event.stopPropagation()}
|
|
11758
11815
|
>
|
|
11759
11816
|
<div
|
|
@@ -11783,10 +11840,7 @@ const LightboxOverlay = ({
|
|
|
11783
11840
|
key={\`slide-in-\${slideTransitionKey}-\${activeSlideIndex}\`}
|
|
11784
11841
|
className={\`\${P}-slide-layer-in\${isSlideFading ? \` \${P}-slide-fade-in\` : ''}\`}
|
|
11785
11842
|
>
|
|
11786
|
-
<div
|
|
11787
|
-
className={\`\${P}-slide-area\`}
|
|
11788
|
-
// style={{ maxWidth: slideMaxWidth, maxHeight: slideMaxHeight }}
|
|
11789
|
-
>
|
|
11843
|
+
<div className={\`\${P}-slide-area\`} >
|
|
11790
11844
|
{activeSlide ? renderSlideImages(activeSlide.images) : null}
|
|
11791
11845
|
</div>
|
|
11792
11846
|
</div>
|
|
@@ -11794,7 +11848,7 @@ const LightboxOverlay = ({
|
|
|
11794
11848
|
</div>
|
|
11795
11849
|
</div>
|
|
11796
11850
|
|
|
11797
|
-
<div className={\`\${P}-lightbox-chrome\`} style={{ width: '100%', height: '100%' }}>
|
|
11851
|
+
<div className={\`\${P}-lightbox-chrome\`} style={{ width: '100%', height: '100%', ...swipeChromeStyle }}>
|
|
11798
11852
|
<div
|
|
11799
11853
|
data-controls={showControls ? 'contentMarginTop' : undefined}
|
|
11800
11854
|
className={showControls ? \`\${P}-control\` : undefined}
|
|
@@ -12309,4 +12363,4 @@ export type LightboxJournalSettings = {
|
|
|
12309
12363
|
closeIconColor: string;
|
|
12310
12364
|
closeIconHoverColor: string;
|
|
12311
12365
|
};
|
|
12312
|
-
`,Yp="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="#000000" d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" /></svg>'),pn={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Jp(e){const t={};return t[Xe(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Xe(e,"fontSettings")]={...pn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Xe(e,"fontSize")]={...pn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Xe(e,"lineHeight")]={...pn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Xe(e,"letterSpacing")]={...pn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Xe(e,"wordSpacing")]={...pn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Xe(e,"textAlign")]={...pn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Xe(e,"textAppearance")]={...pn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Zp=di.reduce((e,t)=>({...e,...Jp(t)}),{}),Qp=di.reduce((e,t)=>({...e,[Xe(t,"fontFamily")]:"Arial",[Xe(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Xe(t,"letterSpacing")]:0,[Xe(t,"wordSpacing")]:0,[Xe(t,"textAlign")]:"left",[Xe(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ia(e){return di.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Xe(n,"fontSize")]=i),o!==void 0&&(t[Xe(n,"lineHeight")]=o),t},{})}const em=Gp(),tm={type:"object",version:1,settings:{sizing:"auto manual",properties:{cover:{type:"string",scope:"common",title:"",display:{type:"settings-image-input"}},coverFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["Fit","Cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["A","B"]},maxHeight:{type:"number",scope:"layout",title:"Max Height",min:0,max:100,display:{type:"percentage-input"}},maxWidth:{type:"number",scope:"layout",title:"Max Width",min:0,max:100,display:{type:"percentage-input"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,max:200,display:{type:"range-control",visible:!1}},backgroundColor:{type:"string",scope:"common",title:"BG",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"
|
|
12366
|
+
`,Yp="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="#000000" d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" /></svg>'),pn={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Jp(e){const t={};return t[Xe(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Xe(e,"fontSettings")]={...pn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Xe(e,"fontSize")]={...pn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Xe(e,"lineHeight")]={...pn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Xe(e,"letterSpacing")]={...pn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Xe(e,"wordSpacing")]={...pn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Xe(e,"textAlign")]={...pn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Xe(e,"textAppearance")]={...pn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Zp=di.reduce((e,t)=>({...e,...Jp(t)}),{}),Qp=di.reduce((e,t)=>({...e,[Xe(t,"fontFamily")]:"Arial",[Xe(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Xe(t,"letterSpacing")]:0,[Xe(t,"wordSpacing")]:0,[Xe(t,"textAlign")]:"left",[Xe(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ia(e){return di.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Xe(n,"fontSize")]=i),o!==void 0&&(t[Xe(n,"lineHeight")]=o),t},{})}const em=Gp(),tm={type:"object",version:1,settings:{sizing:"auto manual",properties:{cover:{type:"string",scope:"common",title:"",display:{type:"settings-image-input"}},coverFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["Fit","Cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["A","B"]},maxHeight:{type:"number",scope:"layout",title:"Max Height (%)",min:0,max:100,display:{type:"percentage-input"}},maxWidth:{type:"number",scope:"layout",title:"Max Width (%)",min:0,max:100,display:{type:"percentage-input"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,max:200,display:{type:"range-control",visible:!1}},backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},textMaxWidth:{type:"string",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},textTransition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["none","fade"]}},titlesGap:{type:"number",scope:"layout",title:"Titles Gap",min:0,max:200,display:{type:"range-control"}},countCloseGap:{type:"number",scope:"layout",title:"Count / Close Gap",min:0,max:200,display:{type:"range-control"}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},countColor:{type:"string",scope:"common",title:"Count Default",display:{type:"palette-color-picker"}},...Zp,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,max:200,display:{type:"range-control"}},contentMarginLeft:{type:"number",scope:"layout",title:"Content margin left",min:0,max:200,display:{type:"range-control"}},contentMarginRight:{type:"number",scope:"layout",title:"Content margin right",min:0,max:200,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/LightboxJournal_1.jpg",coverFit:{display:"Cover",ratioValue:"16:9",reversed:!1},closeIcon:Yp,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#ffffff",...Qp},layoutDefaults:{m:{type:"B",imageGap:.05,maxHeight:80,maxWidth:80,textMaxWidth:.4,closeIconMaxWidth:.05,contentMarginTop:.02,contentMarginLeft:.01,contentMarginRight:.01,titlesGap:.01,countCloseGap:.005,...ia({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04,countFontSize:.04,countLineHeight:.04})},d:{type:"A",maxHeight:80,maxWidth:80,imageGap:.05,textMaxWidth:.4,closeIconMaxWidth:.015,contentMarginTop:.01,contentMarginLeft:.01,contentMarginRight:.01,titlesGap:.1,countCloseGap:.02,...ia({title1FontSize:.01,title1LineHeight:.01,title2FontSize:.01,title2LineHeight:.01,title3FontSize:.01,title3LineHeight:.01,countFontSize:.01,countLineHeight:.01})}},layout:["__componentName__","maxWidth","maxHeight","imageGap","titlesGap","countCloseGap","contentMarginTop","contentMarginLeft","contentMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["type"]},{type:"row",title:"Image",items:["maxWidth","maxHeight"]},{type:"row",title:"Text",items:["textMaxWidth","textTransition"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover Image",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[em]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","countColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemWithoutImage:!0},items:{type:"object",properties:{title1:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},image:{type:"object",label:"Image",max:2,display:{type:"media-list-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]}}},default:[{title1:"Journal Entry 1",title2:"summer vacation",title3:"July 1978",image:[{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_1.jpg",name:"",objectFit:"contain"},{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_2.jpg",name:"",objectFit:"contain"}]},{title1:"Journal Entry 2",title2:"spring break",title3:"March 1979",image:[{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_3.jpg",name:"",objectFit:"contain"},{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_4.jpg",name:"",objectFit:"contain"}]},{title1:"Journal Entry 3",title2:"winter vacation",title3:"January 1980",image:[{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_5.jpg",name:"",objectFit:"contain"}]}]}},nm={element:qp,id:"lightbox-journal",name:"Lightbox Journal",category:"galleries",version:1,defaultSize:{d:{width:350,height:350},m:{width:300,height:350}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Journal.png"},schema:tm,sourceCode:Xp,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:di.map(e=>({path:`styles.${Xe(e,"fontSettings")}`}))}},im=[uc,vc,ad,Ap,nm,hd,Td,Nd,Dd,Xd,lu,cp];exports.components=im;exports.isSchemaV1=nl;
|