@cntrl-site/components 1.0.50 → 1.0.52-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Components/Grid/Grid.d.ts +1 -0
- package/dist/Components/SimpleButton/SimpleButton.d.ts +1 -7
- package/dist/Components/SimpleButton/SimpleButtonComponent.d.ts +5 -19
- package/dist/Components/Waterfall/Waterfall.d.ts +1 -0
- package/dist/Components/utils/getImageRect.d.ts +1 -0
- package/dist/index.js +379 -238
- package/dist/index.mjs +7074 -6776
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=require("react"),nt=require("classnames"),y=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),gi=require("react-dom");function $c(e){return e.type==="object"&&e.version===1}const Cc="ControlSlider-module__wrapper___sHEkd",Tc="ControlSlider-module__hoverArrow___A-dOH",Lc="ControlSlider-module__sliderItem___QQSkR",Ic="ControlSlider-module__sliderImage___9hRl-",Rc="ControlSlider-module__arrow___05ghY",Ec="ControlSlider-module__arrowVertical___tBfVN",kc="ControlSlider-module__nextArrow___-30Yc",Mc="ControlSlider-module__arrowInner___aEra3",Pc="ControlSlider-module__arrowIcon___S4ztF",Ac="ControlSlider-module__arrowImg___2dwJW",Fc="ControlSlider-module__mirror___brd6U",Wc="ControlSlider-module__pagination___bicLF",_c="ControlSlider-module__paginationInner___bT-P-",Nc="ControlSlider-module__paginationVertical___zYqKw",Hc="ControlSlider-module__paginationItem___nTRbk",jc="ControlSlider-module__dot___p1Qun",Oc="ControlSlider-module__activeDot___LHFaj",zc="ControlSlider-module__paginationInsideBottom___R3FWn",Bc="ControlSlider-module__paginationInsideTop___V-qb-",Dc="ControlSlider-module__paginationOutsideBottom___14w8D",Vc="ControlSlider-module__paginationOutsideTop___SCLqB",Gc="ControlSlider-module__paginationInsideLeft___yOBRZ",qc="ControlSlider-module__paginationInsideRight___Rtt3o",Kc="ControlSlider-module__paginationOutsideLeft___lahaw",Uc="ControlSlider-module__paginationOutsideRight___EtuQa",Xc="ControlSlider-module__imgWrapper___UjEgB",Yc="ControlSlider-module__captionBlock___dJ6-j",Zc="ControlSlider-module__captionTextWrapper___HFlpf",Jc="ControlSlider-module__captionText___uGBVc",Qc="ControlSlider-module__active___WZK4G",ed="ControlSlider-module__withPointerEvents___t-18M",td="ControlSlider-module__topLeftAlignment___zjnGM",nd="ControlSlider-module__topCenterAlignment___gD1xW",id="ControlSlider-module__topRightAlignment___NMapS",od="ControlSlider-module__middleLeftAlignment___OnUrY",rd="ControlSlider-module__middleCenterAlignment___Tdkl0",ad="ControlSlider-module__middleRightAlignment___wEbfX",ld="ControlSlider-module__bottomLeftAlignment___cTP2-",sd="ControlSlider-module__bottomCenterAlignment___c54fB",cd="ControlSlider-module__bottomRightAlignment___kEwrz",dd="ControlSlider-module__clickOverlay___DZA28",ud="ControlSlider-module__contain___pLyq7",pd="ControlSlider-module__cover___KdDat",Xe={wrapper:Cc,hoverArrow:Tc,sliderItem:Lc,sliderImage:Ic,arrow:Rc,arrowVertical:Ec,nextArrow:kc,arrowInner:Mc,arrowIcon:Pc,arrowImg:Ac,mirror:Fc,pagination:Wc,paginationInner:_c,paginationVertical:Nc,paginationItem:Hc,dot:jc,activeDot:Oc,paginationInsideBottom:zc,paginationInsideTop:Bc,paginationOutsideBottom:Dc,paginationOutsideTop:Vc,paginationInsideLeft:Gc,paginationInsideRight:qc,paginationOutsideLeft:Kc,paginationOutsideRight:Uc,imgWrapper:Xc,captionBlock:Yc,captionTextWrapper:Zc,captionText:Jc,active:Qc,withPointerEvents:ed,topLeftAlignment:td,topCenterAlignment:nd,topRightAlignment:id,middleLeftAlignment:od,middleCenterAlignment:rd,middleRightAlignment:ad,bottomLeftAlignment:ld,bottomCenterAlignment:sd,bottomRightAlignment:cd,clickOverlay:dd,contain:ud,cover:pd};function md(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 gd(e,t,n){return t&&md(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Ya="(prefers-reduced-motion: reduce)",Ci=1,hd=2,Ri=3,zi=4,yo=5,qo=6,Qo=7,fd={CREATED:Ci,MOUNTED:hd,IDLE:Ri,MOVING:zi,SCROLLING:yo,DRAGGING:qo,DESTROYED:Qo};function Wn(e){e.length=0}function Xn(e,t,n){return Array.prototype.slice.call(e,t,n)}function Ot(e){return e.bind.apply(e,[null].concat(Xn(arguments,1)))}var us=setTimeout,oa=function(){};function Za(e){return requestAnimationFrame(e)}function cr(e,t){return typeof t===e}function oo(e){return!xa(e)&&cr("object",e)}var va=Array.isArray,ps=Ot(cr,"function"),Gn=Ot(cr,"string"),vo=Ot(cr,"undefined");function xa(e){return e===null}function ms(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function xo(e){return va(e)?e:[e]}function vn(e,t){xo(e).forEach(t)}function ba(e,t){return e.indexOf(t)>-1}function Ko(e,t){return e.push.apply(e,xo(t)),e}function kn(e,t,n){e&&vn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Tn(e,t){kn(e,Gn(t)?t.split(" "):t,!0)}function bo(e,t){vn(t,e.appendChild.bind(e))}function wa(e,t){vn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function ro(e,t){return ms(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function gs(e,t){var n=e?Xn(e.children):[];return t?n.filter(function(i){return ro(i,t)}):n}function wo(e,t){return t?gs(e,t)[0]:e.firstElementChild}var ao=Object.keys;function di(e,t,n){return e&&(n?ao(e).reverse():ao(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function lo(e){return Xn(arguments,1).forEach(function(t){di(t,function(n,i){e[i]=t[i]})}),e}function zn(e){return Xn(arguments,1).forEach(function(t){di(t,function(n,i){va(n)?e[i]=n.slice():oo(n)?e[i]=zn({},oo(e[i])?e[i]:{},n):e[i]=n})}),e}function Ja(e,t){vn(t||ao(e),function(n){delete e[n]})}function Ln(e,t){vn(e,function(n){vn(t,function(i){n&&n.removeAttribute(i)})})}function ct(e,t,n){oo(t)?di(t,function(i,o){ct(e,o,i)}):vn(e,function(i){xa(n)||n===""?Ln(i,t):i.setAttribute(t,String(n))})}function Ti(e,t,n){var i=document.createElement(e);return t&&(Gn(t)?Tn(i,t):ct(i,t)),n&&bo(n,i),i}function xn(e,t,n){if(vo(n))return getComputedStyle(e)[t];xa(n)||(e.style[t]=""+n)}function so(e,t){xn(e,"display",t)}function hs(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function bn(e,t){return e.getAttribute(t)}function Qa(e,t){return e&&e.classList.contains(t)}function gn(e){return e.getBoundingClientRect()}function ui(e){vn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function fs(e){return wo(new DOMParser().parseFromString(e,"text/html").body)}function En(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function ys(e,t){return e&&e.querySelector(t)}function Sa(e,t){return t?Xn(e.querySelectorAll(t)):[]}function Mn(e,t){kn(e,t,!1)}function ra(e){return e.timeStamp}function ti(e){return Gn(e)?e:e?e+"px":""}var So="splide",$a="data-"+So;function Qi(e,t){if(!e)throw new Error("["+So+"] "+(t||""))}var qn=Math.min,er=Math.max,tr=Math.floor,co=Math.ceil,sn=Math.abs;function vs(e,t,n){return sn(e-t)<n}function Uo(e,t,n,i){var o=qn(t,n),l=er(t,n);return i?o<e&&e<l:o<=e&&e<=l}function wi(e,t,n){var i=qn(t,n),o=er(t,n);return qn(er(i,e),o)}function aa(e){return+(e>0)-+(e<0)}function la(e,t){return vn(t,function(n){e=e.replace("%s",""+n)}),e}function Ca(e){return e<10?"0"+e:""+e}var el={};function yd(e){return""+e+Ca(el[e]=(el[e]||0)+1)}function xs(){var e=[];function t(s,d,c,u){o(s,d,function(m,x,b){var T="addEventListener"in m,f=T?m.removeEventListener.bind(m,x,c,u):m.removeListener.bind(m,c);T?m.addEventListener(x,c,u):m.addListener(c),e.push([m,x,b,c,f])})}function n(s,d,c){o(s,d,function(u,m,x){e=e.filter(function(b){return b[0]===u&&b[1]===m&&b[2]===x&&(!c||b[3]===c)?(b[4](),!1):!0})})}function i(s,d,c){var u,m=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:m,detail:c}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,m,!1,c)),s.dispatchEvent(u),u}function o(s,d,c){vn(s,function(u){u&&vn(d,function(m){m.split(" ").forEach(function(x){var b=x.split(".");c(u,b[0],b[1])})})})}function l(){e.forEach(function(s){s[4]()}),Wn(e)}return{bind:t,unbind:n,dispatch:i,destroy:l}}var Yn="mounted",sa="ready",_n="move",Bi="moved",Ta="click",bs="active",ws="inactive",Ss="visible",$s="hidden",Zt="refresh",an="updated",Ei="resize",dr="resized",Cs="drag",Ts="dragging",Ls="dragged",ur="scroll",hi="scrolled",vd="overflow",La="destroy",Is="arrows:mounted",Rs="arrows:updated",Es="pagination:mounted",ks="pagination:updated",Ia="navigation:mounted",Ra="autoplay:play",Ms="autoplay:playing",Ea="autoplay:pause",ka="lazyload:loaded",Ps="sk",As="sh",nr="ei";function qt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=xs();function i(l,s){n.bind(t,xo(l).join(" "),function(d){s.apply(s,va(d.detail)?d.detail:[])})}function o(l){n.dispatch(t,l,Xn(arguments,1))}return e&&e.event.on(La,n.destroy),lo(n,{bus:t,on:i,off:Ot(n.unbind,t),emit:o})}function pr(e,t,n,i){var o=Date.now,l,s=0,d,c=!0,u=0;function m(){if(!c){if(s=e?qn((o()-l)/e,1):1,n&&n(s),s>=1&&(t(),l=o(),i&&++u>=i))return b();d=Za(m)}}function x(R){R||f(),l=o()-(R?s*e:0),c=!1,d=Za(m)}function b(){c=!0}function T(){l=o(),s=0,n&&n(s)}function f(){d&&cancelAnimationFrame(d),s=0,d=0,c=!0}function L(R){e=R}function $(){return c}return{start:x,rewind:T,pause:b,cancel:f,set:L,isPaused:$}}function xd(e){var t=e;function n(o){t=o}function i(o){return ba(xo(o),t)}return{set:n,is:i}}function bd(e,t){var n=pr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function wd(e,t,n){var i=e.state,o=n.breakpoints||{},l=n.reducedMotion||{},s=xs(),d=[];function c(){var f=n.mediaQuery==="min";ao(o).sort(function(L,$){return f?+L-+$:+$-+L}).forEach(function(L){m(o[L],"("+(f?"min":"max")+"-width:"+L+"px)")}),m(l,Ya),x()}function u(f){f&&s.destroy()}function m(f,L){var $=matchMedia(L);s.bind($,"change",x),d.push([f,$])}function x(){var f=i.is(Qo),L=n.direction,$=d.reduce(function(R,E){return zn(R,E[1].matches?E[0]:{})},{});Ja(n),T($),n.destroy?e.destroy(n.destroy==="completely"):f?(u(!0),e.mount()):L!==n.direction&&e.refresh()}function b(f){matchMedia(Ya).matches&&(f?zn(n,l):Ja(n,ao(l)))}function T(f,L,$){zn(n,f),L&&zn(Object.getPrototypeOf(n),f),($||!i.is(Ci))&&e.emit(an,n)}return{setup:c,destroy:u,reduce:b,set:T}}var mr="Arrow",gr=mr+"Left",hr=mr+"Right",Fs=mr+"Up",Ws=mr+"Down",tl="rtl",fr="ttb",Pr={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Fs,hr],ArrowRight:[Ws,gr]};function Sd(e,t,n){function i(l,s,d){d=d||n.direction;var c=d===tl&&!s?1:d===fr?0:-1;return Pr[l]&&Pr[l][c]||l.replace(/width|left|right/i,function(u,m){var x=Pr[u.toLowerCase()][c]||u;return m>0?x.charAt(0).toUpperCase()+x.slice(1):x})}function o(l){return l*(n.direction===tl?1:-1)}return{resolve:i,orient:o}}var Pn="role",Li="tabindex",$d="disabled",wn="aria-",$o=wn+"controls",_s=wn+"current",nl=wn+"selected",fn=wn+"label",Ma=wn+"labelledby",Ns=wn+"hidden",Pa=wn+"orientation",uo=wn+"roledescription",il=wn+"live",ol=wn+"busy",rl=wn+"atomic",Aa=[Pn,Li,$d,$o,_s,fn,Ma,Ns,Pa,uo],In=So+"__",Zn="is-",Ar=So,al=In+"track",Cd=In+"list",yr=In+"slide",Hs=yr+"--clone",Td=yr+"__container",Fa=In+"arrows",vr=In+"arrow",js=vr+"--prev",Os=vr+"--next",xr=In+"pagination",zs=xr+"__page",Ld=In+"progress",Id=Ld+"__bar",Rd=In+"toggle",Ed=In+"spinner",kd=In+"sr",Md=Zn+"initialized",pi=Zn+"active",Bs=Zn+"prev",Ds=Zn+"next",ca=Zn+"visible",da=Zn+"loading",Vs=Zn+"focus-in",Gs=Zn+"overflow",Pd=[pi,ca,Bs,Ds,da,Vs,Gs],Ad={slide:yr,clone:Hs,arrows:Fa,arrow:vr,prev:js,next:Os,pagination:xr,page:zs,spinner:Ed};function Fd(e,t){if(ps(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!ro(n,t);)n=n.parentElement;return n}var Wd=5,ll=200,qs="touchstart mousedown",Fr="touchmove mousemove",Wr="touchend touchcancel mouseup click";function _d(e,t,n){var i=qt(e),o=i.on,l=i.bind,s=e.root,d=n.i18n,c={},u=[],m=[],x=[],b,T,f;function L(){C(),U(),E()}function $(){o(Zt,R),o(Zt,L),o(an,E),l(document,qs+" keydown",function(I){f=I.type==="keydown"},{capture:!0}),l(s,"focusin",function(){kn(s,Vs,!!f)})}function R(I){var w=Aa.concat("style");Wn(u),Mn(s,m),Mn(b,x),Ln([b,T],w),Ln(s,I?w:["style",uo])}function E(){Mn(s,m),Mn(b,x),m=j(Ar),x=j(al),Tn(s,m),Tn(b,x),ct(s,fn,n.label),ct(s,Ma,n.labelledby)}function C(){b=k("."+al),T=wo(b,"."+Cd),Qi(b&&T,"A track/list element is missing."),Ko(u,gs(T,"."+yr+":not(."+Hs+")")),di({arrows:Fa,pagination:xr,prev:js,next:Os,bar:Id,toggle:Rd},function(I,w){c[w]=k("."+I)}),lo(c,{root:s,track:b,list:T,slides:u})}function U(){var I=s.id||yd(So),w=n.role;s.id=I,b.id=b.id||I+"-track",T.id=T.id||I+"-list",!bn(s,Pn)&&s.tagName!=="SECTION"&&w&&ct(s,Pn,w),ct(s,uo,d.carousel),ct(T,Pn,"presentation")}function k(I){var w=ys(s,I);return w&&Fd(w,"."+Ar)===s?w:void 0}function j(I){return[I+"--"+n.type,I+"--"+n.direction,n.drag&&I+"--draggable",n.isNavigation&&I+"--nav",I===Ar&&pi]}return lo(c,{setup:L,mount:$,destroy:R})}var ki="slide",Di="loop",Co="fade";function Nd(e,t,n,i){var o=qt(e),l=o.on,s=o.emit,d=o.bind,c=e.Components,u=e.root,m=e.options,x=m.isNavigation,b=m.updateOnMove,T=m.i18n,f=m.pagination,L=m.slideFocus,$=c.Direction.resolve,R=bn(i,"style"),E=bn(i,fn),C=n>-1,U=wo(i,"."+Td),k;function j(){C||(i.id=u.id+"-slide"+Ca(t+1),ct(i,Pn,f?"tabpanel":"group"),ct(i,uo,T.slide),ct(i,fn,E||la(T.slideLabel,[t+1,e.length]))),I()}function I(){d(i,"click",Ot(s,Ta,N)),d(i,"keydown",Ot(s,Ps,N)),l([Bi,As,hi],S),l(Ia,W),b&&l(_n,h)}function w(){k=!0,o.destroy(),Mn(i,Pd),Ln(i,Aa),ct(i,"style",R),ct(i,fn,E||"")}function W(){var F=e.splides.map(function(A){var q=A.splide.Components.Slides.getAt(t);return q?q.slide.id:""}).join(" ");ct(i,fn,la(T.slideX,(C?n:t)+1)),ct(i,$o,F),ct(i,Pn,L?"button":""),L&&Ln(i,uo)}function h(){k||S()}function S(){if(!k){var F=e.index;M(),z(),kn(i,Bs,t===F-1),kn(i,Ds,t===F+1)}}function M(){var F=le();F!==Qa(i,pi)&&(kn(i,pi,F),ct(i,_s,x&&F||""),s(F?bs:ws,N))}function z(){var F=Y(),A=!F&&(!le()||C);if(e.state.is([zi,yo])||ct(i,Ns,A||""),ct(Sa(i,m.focusableNodes||""),Li,A?-1:""),L&&ct(i,Li,A?-1:0),F!==Qa(i,ca)&&(kn(i,ca,F),s(F?Ss:$s,N)),!F&&document.activeElement===i){var q=c.Slides.getAt(e.index);q&&hs(q.slide)}}function K(F,A,q){xn(q&&U||i,F,A)}function le(){var F=e.index;return F===t||m.cloneStatus&&F===n}function Y(){if(e.is(Co))return le();var F=gn(c.Elements.track),A=gn(i),q=$("left",!0),G=$("right",!0);return tr(F[q])<=co(A[q])&&tr(A[G])<=co(F[G])}function D(F,A){var q=sn(F-t);return!C&&(m.rewind||e.is(Di))&&(q=qn(q,e.length-q)),q<=A}var N={index:t,slideIndex:n,slide:i,container:U,isClone:C,mount:j,destroy:w,update:S,style:K,isWithin:D};return N}function Hd(e,t,n){var i=qt(e),o=i.on,l=i.emit,s=i.bind,d=t.Elements,c=d.slides,u=d.list,m=[];function x(){b(),o(Zt,T),o(Zt,b)}function b(){c.forEach(function(S,M){L(S,M,-1)})}function T(){k(function(S){S.destroy()}),Wn(m)}function f(){k(function(S){S.update()})}function L(S,M,z){var K=Nd(e,M,z,S);K.mount(),m.push(K),m.sort(function(le,Y){return le.index-Y.index})}function $(S){return S?j(function(M){return!M.isClone}):m}function R(S){var M=t.Controller,z=M.toIndex(S),K=M.hasFocus()?1:n.perPage;return j(function(le){return Uo(le.index,z,z+K-1)})}function E(S){return j(S)[0]}function C(S,M){vn(S,function(z){if(Gn(z)&&(z=fs(z)),ms(z)){var K=c[M];K?wa(z,K):bo(u,z),Tn(z,n.classes.slide),w(z,Ot(l,Ei))}}),l(Zt)}function U(S){ui(j(S).map(function(M){return M.slide})),l(Zt)}function k(S,M){$(M).forEach(S)}function j(S){return m.filter(ps(S)?S:function(M){return Gn(S)?ro(M.slide,S):ba(xo(S),M.index)})}function I(S,M,z){k(function(K){K.style(S,M,z)})}function w(S,M){var z=Sa(S,"img"),K=z.length;K?z.forEach(function(le){s(le,"load error",function(){--K||M()})}):M()}function W(S){return S?c.length:m.length}function h(){return m.length>n.perPage}return{mount:x,destroy:T,update:f,register:L,get:$,getIn:R,getAt:E,add:C,remove:U,forEach:k,filter:j,style:I,getLength:W,isEnough:h}}function jd(e,t,n){var i=qt(e),o=i.on,l=i.bind,s=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,m=u.root,x=u.track,b=u.list,T=d.getAt,f=d.style,L,$,R;function E(){C(),l(window,"resize load",bd(Ot(s,Ei))),o([an,Zt],C),o(Ei,U)}function C(){L=n.direction===fr,xn(m,"maxWidth",ti(n.width)),xn(x,c("paddingLeft"),k(!1)),xn(x,c("paddingRight"),k(!0)),U(!0)}function U(N){var F=gn(m);(N||$.width!==F.width||$.height!==F.height)&&(xn(x,"height",j()),f(c("marginRight"),ti(n.gap)),f("width",w()),f("height",W(),!0),$=F,s(dr),R!==(R=D())&&(kn(m,Gs,R),s(vd,R)))}function k(N){var F=n.padding,A=c(N?"right":"left");return F&&ti(F[A]||(oo(F)?0:F))||"0px"}function j(){var N="";return L&&(N=I(),Qi(N,"height or heightRatio is missing."),N="calc("+N+" - "+k(!1)+" - "+k(!0)+")"),N}function I(){return ti(n.height||gn(b).width*n.heightRatio)}function w(){return n.autoWidth?null:ti(n.fixedWidth)||(L?"":h())}function W(){return ti(n.fixedHeight)||(L?n.autoHeight?null:h():I())}function h(){var N=ti(n.gap);return"calc((100%"+(N&&" + "+N)+")/"+(n.perPage||1)+(N&&" - "+N)+")"}function S(){return gn(b)[c("width")]}function M(N,F){var A=T(N||0);return A?gn(A.slide)[c("width")]+(F?0:le()):0}function z(N,F){var A=T(N);if(A){var q=gn(A.slide)[c("right")],G=gn(b)[c("left")];return sn(q-G)+(F?0:le())}return 0}function K(N){return z(e.length-1)-z(0)+M(0,N)}function le(){var N=T(0);return N&&parseFloat(xn(N.slide,c("marginRight")))||0}function Y(N){return parseFloat(xn(x,c("padding"+(N?"Right":"Left"))))||0}function D(){return e.is(Co)||K(!0)>S()}return{mount:E,resize:U,listSize:S,slideSize:M,sliderSize:K,totalSize:z,getPadding:Y,isOverflow:D}}var Od=2;function zd(e,t,n){var i=qt(e),o=i.on,l=t.Elements,s=t.Slides,d=t.Direction.resolve,c=[],u;function m(){o(Zt,x),o([an,Ei],T),(u=$())&&(f(u),t.Layout.resize(!0))}function x(){b(),m()}function b(){ui(c),Wn(c),i.destroy()}function T(){var R=$();u!==R&&(u<R||!R)&&i.emit(Zt)}function f(R){var E=s.get().slice(),C=E.length;if(C){for(;E.length<R;)Ko(E,E);Ko(E.slice(-R),E.slice(0,R)).forEach(function(U,k){var j=k<R,I=L(U.slide,k);j?wa(I,E[0].slide):bo(l.list,I),Ko(c,I),s.register(I,k-R+(j?0:C),U.index)})}}function L(R,E){var C=R.cloneNode(!0);return Tn(C,n.classes.clone),C.id=e.root.id+"-clone"+Ca(E+1),C}function $(){var R=n.clones;if(!e.is(Di))R=0;else if(vo(R)){var E=n[d("fixedWidth")]&&t.Layout.slideSize(0),C=E&&co(gn(l.track)[d("width")]/E);R=C||n[d("autoWidth")]&&e.length||n.perPage*Od}return R}return{mount:m,destroy:b}}function Bd(e,t,n){var i=qt(e),o=i.on,l=i.emit,s=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,m=d.totalSize,x=d.listSize,b=d.sliderSize,T=t.Direction,f=T.resolve,L=T.orient,$=t.Elements,R=$.list,E=$.track,C;function U(){C=t.Transition,o([Yn,dr,an,Zt],k)}function k(){t.Controller.isBusy()||(t.Scroll.cancel(),I(e.index),t.Slides.update())}function j(A,q,G,Z){A!==q&&N(A>G)&&(S(),w(h(K(),A>G),!0)),s(zi),l(_n,q,G,A),C.start(q,function(){s(Ri),l(Bi,q,G,A),Z&&Z()})}function I(A){w(z(A,!0))}function w(A,q){if(!e.is(Co)){var G=q?A:W(A);xn(R,"transform","translate"+f("X")+"("+G+"px)"),A!==G&&l(As)}}function W(A){if(e.is(Di)){var q=M(A),G=q>t.Controller.getEnd(),Z=q<0;(Z||G)&&(A=h(A,G))}return A}function h(A,q){var G=A-D(q),Z=b();return A-=L(Z*(co(sn(G)/Z)||1))*(q?1:-1),A}function S(){w(K(),!0),C.cancel()}function M(A){for(var q=t.Slides.get(),G=0,Z=1/0,_=0;_<q.length;_++){var me=q[_].index,v=sn(z(me,!0)-A);if(v<=Z)Z=v,G=me;else break}return G}function z(A,q){var G=L(m(A-1)-Y(A));return q?le(G):G}function K(){var A=f("left");return gn(R)[A]-gn(E)[A]+L(u(!1))}function le(A){return n.trimSpace&&e.is(ki)&&(A=wi(A,0,L(b(!0)-x()))),A}function Y(A){var q=n.focus;return q==="center"?(x()-c(A,!0))/2:+q*c(A)||0}function D(A){return z(A?t.Controller.getEnd():0,!!n.trimSpace)}function N(A){var q=L(h(K(),A));return A?q>=0:q<=R[f("scrollWidth")]-gn(E)[f("width")]}function F(A,q){q=vo(q)?K():q;var G=A!==!0&&L(q)<L(D(!1)),Z=A!==!1&&L(q)>L(D(!0));return G||Z}return{mount:U,move:j,jump:I,translate:w,shift:h,cancel:S,toIndex:M,toPosition:z,getPosition:K,getLimit:D,exceededLimit:F,reposition:k}}function Dd(e,t,n){var i=qt(e),o=i.on,l=i.emit,s=t.Move,d=s.getPosition,c=s.getLimit,u=s.toPosition,m=t.Slides,x=m.isEnough,b=m.getLength,T=n.omitEnd,f=e.is(Di),L=e.is(ki),$=Ot(K,!1),R=Ot(K,!0),E=n.start||0,C,U=E,k,j,I;function w(){W(),o([an,Zt,nr],W),o(dr,h)}function W(){k=b(!0),j=n.perMove,I=n.perPage,C=N();var v=wi(E,0,T?C:k-1);v!==E&&(E=v,s.reposition())}function h(){C!==N()&&l(nr)}function S(v,fe,J){if(!me()){var de=z(v),$e=D(de);$e>-1&&(fe||$e!==E)&&(G($e),s.move(de,$e,U,J))}}function M(v,fe,J,de){t.Scroll.scroll(v,fe,J,function(){var $e=D(s.toIndex(d()));G(T?qn($e,C):$e),de&&de()})}function z(v){var fe=E;if(Gn(v)){var J=v.match(/([+\-<>])(\d+)?/)||[],de=J[1],$e=J[2];de==="+"||de==="-"?fe=le(E+ +(""+de+(+$e||1)),E):de===">"?fe=$e?F(+$e):$(!0):de==="<"&&(fe=R(!0))}else fe=f?v:wi(v,0,C);return fe}function K(v,fe){var J=j||(_()?1:I),de=le(E+J*(v?-1:1),E,!(j||_()));return de===-1&&L&&!vs(d(),c(!v),1)?v?0:C:fe?de:D(de)}function le(v,fe,J){if(x()||_()){var de=Y(v);de!==v&&(fe=v,v=de,J=!1),v<0||v>C?!j&&(Uo(0,v,fe,!0)||Uo(C,fe,v,!0))?v=F(A(v)):f?v=J?v<0?-(k%I||I):k:v:n.rewind?v=v<0?C:0:v=-1:J&&v!==fe&&(v=F(A(fe)+(v<fe?-1:1)))}else v=-1;return v}function Y(v){if(L&&n.trimSpace==="move"&&v!==E)for(var fe=d();fe===u(v,!0)&&Uo(v,0,e.length-1,!n.rewind);)v<E?--v:++v;return v}function D(v){return f?(v+k)%k||0:v}function N(){for(var v=k-(_()||f&&j?1:I);T&&v-- >0;)if(u(k-1,!0)!==u(v,!0)){v++;break}return wi(v,0,k-1)}function F(v){return wi(_()?v:I*v,0,C)}function A(v){return _()?qn(v,C):tr((v>=C?k-1:v)/I)}function q(v){var fe=s.toIndex(v);return L?wi(fe,0,C):fe}function G(v){v!==E&&(U=E,E=v)}function Z(v){return v?U:E}function _(){return!vo(n.focus)||n.isNavigation}function me(){return e.state.is([zi,yo])&&!!n.waitForTransition}return{mount:w,go:S,scroll:M,getNext:$,getPrev:R,getAdjacent:K,getEnd:N,setIndex:G,getIndex:Z,toIndex:F,toPage:A,toDest:q,hasFocus:_,isBusy:me}}var Vd="http://www.w3.org/2000/svg",Gd="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",ko=40;function qd(e,t,n){var i=qt(e),o=i.on,l=i.bind,s=i.emit,d=n.classes,c=n.i18n,u=t.Elements,m=t.Controller,x=u.arrows,b=u.track,T=x,f=u.prev,L=u.next,$,R,E={};function C(){k(),o(an,U)}function U(){j(),C()}function k(){var M=n.arrows;M&&!(f&&L)&&W(),f&&L&&(lo(E,{prev:f,next:L}),so(T,M?"":"none"),Tn(T,R=Fa+"--"+n.direction),M&&(I(),S(),ct([f,L],$o,b.id),s(Is,f,L)))}function j(){i.destroy(),Mn(T,R),$?(ui(x?[f,L]:T),f=L=null):Ln([f,L],Aa)}function I(){o([Yn,Bi,Zt,hi,nr],S),l(L,"click",Ot(w,">")),l(f,"click",Ot(w,"<"))}function w(M){m.go(M,!0)}function W(){T=x||Ti("div",d.arrows),f=h(!0),L=h(!1),$=!0,bo(T,[f,L]),!x&&wa(T,b)}function h(M){var z='<button class="'+d.arrow+" "+(M?d.prev:d.next)+'" type="button"><svg xmlns="'+Vd+'" viewBox="0 0 '+ko+" "+ko+'" width="'+ko+'" height="'+ko+'" focusable="false"><path d="'+(n.arrowPath||Gd)+'" />';return fs(z)}function S(){if(f&&L){var M=e.index,z=m.getPrev(),K=m.getNext(),le=z>-1&&M<z?c.last:c.prev,Y=K>-1&&M>K?c.first:c.next;f.disabled=z<0,L.disabled=K<0,ct(f,fn,le),ct(L,fn,Y),s(Rs,f,L,z,K)}}return{arrows:E,mount:C,destroy:j,update:S}}var Kd=$a+"-interval";function Ud(e,t,n){var i=qt(e),o=i.on,l=i.bind,s=i.emit,d=pr(n.interval,e.go.bind(e,">"),I),c=d.isPaused,u=t.Elements,m=t.Elements,x=m.root,b=m.toggle,T=n.autoplay,f,L,$=T==="pause";function R(){T&&(E(),b&&ct(b,$o,u.track.id),$||C(),j())}function E(){n.pauseOnHover&&l(x,"mouseenter mouseleave",function(W){f=W.type==="mouseenter",k()}),n.pauseOnFocus&&l(x,"focusin focusout",function(W){L=W.type==="focusin",k()}),b&&l(b,"click",function(){$?C():U(!0)}),o([_n,ur,Zt],d.rewind),o(_n,w)}function C(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),L=f=$=!1,j(),s(Ra))}function U(W){W===void 0&&(W=!0),$=!!W,j(),c()||(d.pause(),s(Ea))}function k(){$||(f||L?U(!1):C())}function j(){b&&(kn(b,pi,!$),ct(b,fn,n.i18n[$?"play":"pause"]))}function I(W){var h=u.bar;h&&xn(h,"width",W*100+"%"),s(Ms,W)}function w(W){var h=t.Slides.getAt(W);d.set(h&&+bn(h.slide,Kd)||n.interval)}return{mount:R,destroy:d.cancel,play:C,pause:U,isPaused:c}}function Xd(e,t,n){var i=qt(e),o=i.on;function l(){n.cover&&(o(ka,Ot(d,!0)),o([Yn,an,Zt],Ot(s,!0)))}function s(c){t.Slides.forEach(function(u){var m=wo(u.container||u.slide,"img");m&&m.src&&d(c,m,u)})}function d(c,u,m){m.style("background",c?'center/cover no-repeat url("'+u.src+'")':"",!0),so(u,c?"none":"")}return{mount:l,destroy:Ot(s,!1)}}var Yd=10,Zd=600,Jd=.6,Qd=1.5,eu=800;function tu(e,t,n){var i=qt(e),o=i.on,l=i.emit,s=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,m=d.exceededLimit,x=d.translate,b=e.is(ki),T,f,L=1;function $(){o(_n,U),o([an,Zt],k)}function R(I,w,W,h,S){var M=c();if(U(),W&&(!b||!m())){var z=t.Layout.sliderSize(),K=aa(I)*z*tr(sn(I)/z)||0;I=d.toPosition(t.Controller.toDest(I%z))+K}var le=vs(M,I,1);L=1,w=le?0:w||er(sn(I-M)/Qd,eu),f=h,T=pr(w,E,Ot(C,M,I,S),1),s(yo),l(ur),T.start()}function E(){s(Ri),f&&f(),l(hi)}function C(I,w,W,h){var S=c(),M=I+(w-I)*j(h),z=(M-S)*L;x(S+z),b&&!W&&m()&&(L*=Jd,sn(z)<Yd&&R(u(m(!0)),Zd,!1,f,!0))}function U(){T&&T.cancel()}function k(){T&&!T.isPaused()&&(U(),E())}function j(I){var w=n.easingFunc;return w?w(I):1-Math.pow(1-I,4)}return{mount:$,destroy:U,scroll:R,cancel:k}}var Si={passive:!1,capture:!0};function nu(e,t,n){var i=qt(e),o=i.on,l=i.emit,s=i.bind,d=i.unbind,c=e.state,u=t.Move,m=t.Scroll,x=t.Controller,b=t.Elements.track,T=t.Media.reduce,f=t.Direction,L=f.resolve,$=f.orient,R=u.getPosition,E=u.exceededLimit,C,U,k,j,I,w=!1,W,h,S;function M(){s(b,Fr,oa,Si),s(b,Wr,oa,Si),s(b,qs,K,Si),s(b,"click",D,{capture:!0}),s(b,"dragstart",En),o([Yn,an],z)}function z(){var Q=n.drag;xe(!Q),j=Q==="free"}function K(Q){if(W=!1,!h){var ye=$e(Q);de(Q.target)&&(ye||!Q.button)&&(x.isBusy()?En(Q,!0):(S=ye?b:window,I=c.is([zi,yo]),k=null,s(S,Fr,le,Si),s(S,Wr,Y,Si),u.cancel(),m.cancel(),N(Q)))}}function le(Q){if(c.is(qo)||(c.set(qo),l(Cs)),Q.cancelable)if(I){u.translate(C+J(_(Q)));var ye=me(Q)>ll,ve=w!==(w=E());(ye||ve)&&N(Q),W=!0,l(Ts),En(Q)}else q(Q)&&(I=A(Q),En(Q))}function Y(Q){c.is(qo)&&(c.set(Ri),l(Ls)),I&&(F(Q),En(Q)),d(S,Fr,le),d(S,Wr,Y),I=!1}function D(Q){!h&&W&&En(Q,!0)}function N(Q){k=U,U=Q,C=R()}function F(Q){var ye=G(Q),ve=Z(ye),ke=n.rewind&&n.rewindByDrag;T(!1),j?x.scroll(ve,0,n.snap):e.is(Co)?x.go($(aa(ye))<0?ke?"<":"-":ke?">":"+"):e.is(ki)&&w&&ke?x.go(E(!0)?">":"<"):x.go(x.toDest(ve),!0),T(!0)}function A(Q){var ye=n.dragMinThreshold,ve=oo(ye),ke=ve&&ye.mouse||0,we=(ve?ye.touch:+ye)||10;return sn(_(Q))>($e(Q)?we:ke)}function q(Q){return sn(_(Q))>sn(_(Q,!0))}function G(Q){if(e.is(Di)||!w){var ye=me(Q);if(ye&&ye<ll)return _(Q)/ye}return 0}function Z(Q){return R()+aa(Q)*qn(sn(Q)*(n.flickPower||600),j?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function _(Q,ye){return fe(Q,ye)-fe(v(Q),ye)}function me(Q){return ra(Q)-ra(v(Q))}function v(Q){return U===Q&&k||U}function fe(Q,ye){return($e(Q)?Q.changedTouches[0]:Q)["page"+L(ye?"Y":"X")]}function J(Q){return Q/(w&&e.is(ki)?Wd:1)}function de(Q){var ye=n.noDrag;return!ro(Q,"."+zs+", ."+vr)&&(!ye||!ro(Q,ye))}function $e(Q){return typeof TouchEvent<"u"&&Q instanceof TouchEvent}function oe(){return I}function xe(Q){h=Q}return{mount:M,disable:xe,isDragging:oe}}var iu={Spacebar:" ",Right:hr,Left:gr,Up:Fs,Down:Ws};function Wa(e){return e=Gn(e)?e:e.key,iu[e]||e}var sl="keydown";function ou(e,t,n){var i=qt(e),o=i.on,l=i.bind,s=i.unbind,d=e.root,c=t.Direction.resolve,u,m;function x(){b(),o(an,T),o(an,b),o(_n,L)}function b(){var R=n.keyboard;R&&(u=R==="global"?window:d,l(u,sl,$))}function T(){s(u,sl)}function f(R){m=R}function L(){var R=m;m=!0,us(function(){m=R})}function $(R){if(!m){var E=Wa(R);E===c(gr)?e.go("<"):E===c(hr)&&e.go(">")}}return{mount:x,destroy:T,disable:f}}var eo=$a+"-lazy",Xo=eo+"-srcset",ru="["+eo+"], ["+Xo+"]";function au(e,t,n){var i=qt(e),o=i.on,l=i.off,s=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[Bi,hi],m=[];function x(){n.lazyLoad&&(b(),o(Zt,b))}function b(){Wn(m),T(),c?R():(l(u),o(u,f),f())}function T(){t.Slides.forEach(function(E){Sa(E.slide,ru).forEach(function(C){var U=bn(C,eo),k=bn(C,Xo);if(U!==C.src||k!==C.srcset){var j=n.classes.spinner,I=C.parentElement,w=wo(I,"."+j)||Ti("span",j,I);m.push([C,E,w]),C.src||so(C,"none")}})})}function f(){m=m.filter(function(E){var C=n.perPage*((n.preloadPages||1)+1)-1;return E[1].isWithin(e.index,C)?L(E):!0}),m.length||l(u)}function L(E){var C=E[0];Tn(E[1].slide,da),s(C,"load error",Ot($,E)),ct(C,"src",bn(C,eo)),ct(C,"srcset",bn(C,Xo)),Ln(C,eo),Ln(C,Xo)}function $(E,C){var U=E[0],k=E[1];Mn(k.slide,da),C.type!=="error"&&(ui(E[2]),so(U,""),d(ka,U,k),d(Ei)),c&&R()}function R(){m.length&&L(m.shift())}return{mount:x,destroy:Ot(Wn,m),check:f}}function lu(e,t,n){var i=qt(e),o=i.on,l=i.emit,s=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,m=u.hasFocus,x=u.getIndex,b=u.go,T=t.Direction.resolve,f=c.pagination,L=[],$,R;function E(){C(),o([an,Zt,nr],E);var h=n.pagination;f&&so(f,h?"":"none"),h&&(o([_n,ur,hi],W),U(),W(),l(Es,{list:$,items:L},w(e.index)))}function C(){$&&(ui(f?Xn($.children):$),Mn($,R),Wn(L),$=null),i.destroy()}function U(){var h=e.length,S=n.classes,M=n.i18n,z=n.perPage,K=m()?u.getEnd()+1:co(h/z);$=f||Ti("ul",S.pagination,c.track.parentElement),Tn($,R=xr+"--"+I()),ct($,Pn,"tablist"),ct($,fn,M.select),ct($,Pa,I()===fr?"vertical":"");for(var le=0;le<K;le++){var Y=Ti("li",null,$),D=Ti("button",{class:S.page,type:"button"},Y),N=d.getIn(le).map(function(A){return A.slide.id}),F=!m()&&z>1?M.pageX:M.slideX;s(D,"click",Ot(k,le)),n.paginationKeyboard&&s(D,"keydown",Ot(j,le)),ct(Y,Pn,"presentation"),ct(D,Pn,"tab"),ct(D,$o,N.join(" ")),ct(D,fn,la(F,le+1)),ct(D,Li,-1),L.push({li:Y,button:D,page:le})}}function k(h){b(">"+h,!0)}function j(h,S){var M=L.length,z=Wa(S),K=I(),le=-1;z===T(hr,!1,K)?le=++h%M:z===T(gr,!1,K)?le=(--h+M)%M:z==="Home"?le=0:z==="End"&&(le=M-1);var Y=L[le];Y&&(hs(Y.button),b(">"+le),En(S,!0))}function I(){return n.paginationDirection||n.direction}function w(h){return L[u.toPage(h)]}function W(){var h=w(x(!0)),S=w(x());if(h){var M=h.button;Mn(M,pi),Ln(M,nl),ct(M,Li,-1)}if(S){var z=S.button;Tn(z,pi),ct(z,nl,!0),ct(z,Li,"")}l(ks,{list:$,items:L},h,S)}return{items:L,mount:E,destroy:C,getAt:w,update:W}}var su=[" ","Enter"];function cu(e,t,n){var i=n.isNavigation,o=n.slideFocus,l=[];function s(){e.splides.forEach(function(f){f.isParent||(u(e,f.splide),u(f.splide,e))}),i&&m()}function d(){l.forEach(function(f){f.destroy()}),Wn(l)}function c(){d(),s()}function u(f,L){var $=qt(f);$.on(_n,function(R,E,C){L.go(L.is(Di)?C:R)}),l.push($)}function m(){var f=qt(e),L=f.on;L(Ta,b),L(Ps,T),L([Yn,an],x),l.push(f),f.emit(Ia,e.splides)}function x(){ct(t.Elements.list,Pa,n.direction===fr?"vertical":"")}function b(f){e.go(f.index)}function T(f,L){ba(su,Wa(L))&&(b(f),En(L))}return{setup:Ot(t.Media.set,{slideFocus:vo(o)?i:o},!0),mount:s,destroy:d,remount:c}}function du(e,t,n){var i=qt(e),o=i.bind,l=0;function s(){n.wheel&&o(t.Elements.track,"wheel",d,Si)}function d(u){if(u.cancelable){var m=u.deltaY,x=m<0,b=ra(u),T=n.wheelMinThreshold||0,f=n.wheelSleep||0;sn(m)>T&&b-l>f&&(e.go(x?"<":">"),l=b),c(x)&&En(u)}}function c(u){return!n.releaseWheel||e.state.is(zi)||t.Controller.getAdjacent(u)!==-1}return{mount:s}}var uu=90;function pu(e,t,n){var i=qt(e),o=i.on,l=t.Elements.track,s=n.live&&!n.isNavigation,d=Ti("span",kd),c=pr(uu,Ot(m,!1));function u(){s&&(b(!t.Autoplay.isPaused()),ct(l,rl,!0),d.textContent="…",o(Ra,Ot(b,!0)),o(Ea,Ot(b,!1)),o([Bi,hi],Ot(m,!0)))}function m(T){ct(l,ol,T),T?(bo(l,d),c.start()):(ui(d),c.cancel())}function x(){Ln(l,[il,rl,ol]),ui(d)}function b(T){s&&ct(l,il,T?"off":"polite")}return{mount:u,disable:b,destroy:x}}var mu=Object.freeze({__proto__:null,Media:wd,Direction:Sd,Elements:_d,Slides:Hd,Layout:jd,Clones:zd,Move:Bd,Controller:Dd,Arrows:qd,Autoplay:Ud,Cover:Xd,Scroll:tu,Drag:nu,Keyboard:ou,LazyLoad:au,Pagination:lu,Sync:cu,Wheel:du,Live:pu}),gu={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"},hu={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:Ad,i18n:gu,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function fu(e,t,n){var i=t.Slides;function o(){qt(e).on([Yn,Zt],l)}function l(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function s(d,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),us(c)}return{mount:o,start:s,cancel:oa}}function yu(e,t,n){var i=t.Move,o=t.Controller,l=t.Scroll,s=t.Elements.list,d=Ot(xn,s,"transition"),c;function u(){qt(e).bind(s,"transitionend",function(T){T.target===s&&c&&(x(),c())})}function m(T,f){var L=i.toPosition(T,!0),$=i.getPosition(),R=b(T);sn(L-$)>=1&&R>=1?n.useScroll?l.scroll(L,R,!1,f):(d("transform "+R+"ms "+n.easing),i.translate(L,!0),c=f):(i.jump(T),f())}function x(){d(""),l.cancel()}function b(T){var f=n.rewindSpeed;if(e.is(ki)&&f){var L=o.getIndex(!0),$=o.getEnd();if(L===0&&T>=$||L>=$&&T===0)return f}return n.speed}return{mount:u,start:m,cancel:x}}var vu=(function(){function e(n,i){this.event=qt(),this.Components={},this.state=xd(Ci),this.splides=[],this._o={},this._E={};var o=Gn(n)?ys(document,n):n;Qi(o,o+" is invalid."),this.root=o,i=zn({label:bn(o,fn)||"",labelledby:bn(o,Ma)||""},hu,e.defaults,i||{});try{zn(i,JSON.parse(bn(o,$a)))}catch{Qi(!1,"Invalid JSON")}this._o=Object.create(zn({},i))}var t=e.prototype;return t.mount=function(i,o){var l=this,s=this.state,d=this.Components;Qi(s.is([Ci,Qo]),"Already mounted!"),s.set(Ci),this._C=d,this._T=o||this._T||(this.is(Co)?fu:yu),this._E=i||this._E;var c=lo({},mu,this._E,{Transition:this._T});return di(c,function(u,m){var x=u(l,d,l._o);d[m]=x,x.setup&&x.setup()}),di(d,function(u){u.mount&&u.mount()}),this.emit(Yn),Tn(this.root,Md),s.set(Ri),this.emit(sa),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Ri)&&(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(Xn(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(Zt),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,l=this.state;return l.is(Ci)?qt(this).on(sa,this.destroy.bind(this,i)):(di(this._C,function(s){s.destroy&&s.destroy(i)},!0),o.emit(La),o.destroy(),i&&Wn(this.splides),l.set(Qo)),this},gd(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})(),_a=vu;_a.defaults={};_a.STATES=fd;var cl=[[Yn,"onMounted"],[sa,"onReady"],[_n,"onMove"],[Bi,"onMoved"],[Ta,"onClick"],[bs,"onActive"],[ws,"onInactive"],[Ss,"onVisible"],[$s,"onHidden"],[Zt,"onRefresh"],[an,"onUpdated"],[Ei,"onResize"],[dr,"onResized"],[Cs,"onDrag"],[Ts,"onDragging"],[Ls,"onDragged"],[ur,"onScroll"],[hi,"onScrolled"],[La,"onDestroy"],[Is,"onArrowsMounted"],[Rs,"onArrowsUpdated"],[Es,"onPaginationMounted"],[ks,"onPaginationUpdated"],[Ia,"onNavigationMounted"],[Ra,"onAutoplayPlay"],[Ms,"onAutoplayPlaying"],[Ea,"onAutoplayPause"],[ka,"onLazyLoadLoaded"]];function Na(...e){return e.filter(Boolean).join(" ")}function ir(e){return e!==null&&typeof e=="object"}function ua(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!ua(n,t[i]));if(ir(e)&&ir(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!ua(e[o],t[o]))}return e===t}function xu(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function bu(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 pa(e,t){const n=e;return bu(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():ir(i)?n[o]=pa(ir(n[o])?n[o]:{},i):n[o]=i}),n}var wu=({children:e,className:t,...n})=>a.createElement("div",{className:Na("splide__track",t),...n},a.createElement("ul",{className:"splide__list"},e)),br=class extends a.Component{constructor(){super(...arguments),this.splideRef=a.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new _a(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=pa({},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&&!ua(this.options,e)&&(this.splide.options=e,this.options=pa({},e));const t=this.getSlides();xu(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){cl.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 a.createElement(t,{className:Na("splide",e),ref:this.splideRef,...this.omit(o,["options",...cl.map(l=>l[1])])},n?a.createElement(wu,null,i):i)}},wr=({children:e,className:t,...n})=>a.createElement("li",{className:Na("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=require("react"),at=require("classnames"),v=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),gi=require("react-dom");function Tc(e){return e.type==="object"&&e.version===1}const Lc="ControlSlider-module__wrapper___sHEkd",Ic="ControlSlider-module__hoverArrow___A-dOH",Rc="ControlSlider-module__sliderItem___QQSkR",Ec="ControlSlider-module__sliderImage___9hRl-",Mc="ControlSlider-module__arrow___05ghY",kc="ControlSlider-module__arrowVertical___tBfVN",Pc="ControlSlider-module__nextArrow___-30Yc",Ac="ControlSlider-module__arrowInner___aEra3",Fc="ControlSlider-module__arrowIcon___S4ztF",Wc="ControlSlider-module__arrowImg___2dwJW",_c="ControlSlider-module__mirror___brd6U",Hc="ControlSlider-module__pagination___bicLF",Nc="ControlSlider-module__paginationInner___bT-P-",Oc="ControlSlider-module__paginationVertical___zYqKw",jc="ControlSlider-module__paginationItem___nTRbk",zc="ControlSlider-module__dot___p1Qun",Bc="ControlSlider-module__activeDot___LHFaj",Dc="ControlSlider-module__paginationInsideBottom___R3FWn",Vc="ControlSlider-module__paginationInsideTop___V-qb-",Gc="ControlSlider-module__paginationOutsideBottom___14w8D",qc="ControlSlider-module__paginationOutsideTop___SCLqB",Kc="ControlSlider-module__paginationInsideLeft___yOBRZ",Uc="ControlSlider-module__paginationInsideRight___Rtt3o",Xc="ControlSlider-module__paginationOutsideLeft___lahaw",Yc="ControlSlider-module__paginationOutsideRight___EtuQa",Zc="ControlSlider-module__imgWrapper___UjEgB",Jc="ControlSlider-module__captionBlock___dJ6-j",Qc="ControlSlider-module__captionTextWrapper___HFlpf",ed="ControlSlider-module__captionText___uGBVc",td="ControlSlider-module__active___WZK4G",nd="ControlSlider-module__withPointerEvents___t-18M",id="ControlSlider-module__topLeftAlignment___zjnGM",od="ControlSlider-module__topCenterAlignment___gD1xW",rd="ControlSlider-module__topRightAlignment___NMapS",ad="ControlSlider-module__middleLeftAlignment___OnUrY",ld="ControlSlider-module__middleCenterAlignment___Tdkl0",sd="ControlSlider-module__middleRightAlignment___wEbfX",cd="ControlSlider-module__bottomLeftAlignment___cTP2-",dd="ControlSlider-module__bottomCenterAlignment___c54fB",ud="ControlSlider-module__bottomRightAlignment___kEwrz",pd="ControlSlider-module__clickOverlay___DZA28",md="ControlSlider-module__contain___pLyq7",gd="ControlSlider-module__cover___KdDat",Qe={wrapper:Lc,hoverArrow:Ic,sliderItem:Rc,sliderImage:Ec,arrow:Mc,arrowVertical:kc,nextArrow:Pc,arrowInner:Ac,arrowIcon:Fc,arrowImg:Wc,mirror:_c,pagination:Hc,paginationInner:Nc,paginationVertical:Oc,paginationItem:jc,dot:zc,activeDot:Bc,paginationInsideBottom:Dc,paginationInsideTop:Vc,paginationOutsideBottom:Gc,paginationOutsideTop:qc,paginationInsideLeft:Kc,paginationInsideRight:Uc,paginationOutsideLeft:Xc,paginationOutsideRight:Yc,imgWrapper:Zc,captionBlock:Jc,captionTextWrapper:Qc,captionText:ed,active:td,withPointerEvents:nd,topLeftAlignment:id,topCenterAlignment:od,topRightAlignment:rd,middleLeftAlignment:ad,middleCenterAlignment:ld,middleRightAlignment:sd,bottomLeftAlignment:cd,bottomCenterAlignment:dd,bottomRightAlignment:ud,clickOverlay:pd,contain:md,cover:gd};function hd(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 fd(e,t,n){return t&&hd(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Xa="(prefers-reduced-motion: reduce)",Ci=1,yd=2,Ei=3,Bi=4,yo=5,Go=6,Jo=7,vd={CREATED:Ci,MOUNTED:yd,IDLE:Ei,MOVING:Bi,SCROLLING:yo,DRAGGING:Go,DESTROYED:Jo};function Wn(e){e.length=0}function Yn(e,t,n){return Array.prototype.slice.call(e,t,n)}function Ht(e){return e.bind.apply(e,[null].concat(Yn(arguments,1)))}var us=setTimeout,ia=function(){};function Ya(e){return requestAnimationFrame(e)}function sr(e,t){return typeof t===e}function oo(e){return!va(e)&&sr("object",e)}var ya=Array.isArray,ps=Ht(sr,"function"),qn=Ht(sr,"string"),vo=Ht(sr,"undefined");function va(e){return e===null}function ms(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function bo(e){return ya(e)?e:[e]}function vn(e,t){bo(e).forEach(t)}function ba(e,t){return e.indexOf(t)>-1}function qo(e,t){return e.push.apply(e,bo(t)),e}function Mn(e,t,n){e&&vn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Ln(e,t){Mn(e,qn(t)?t.split(" "):t,!0)}function xo(e,t){vn(t,e.appendChild.bind(e))}function xa(e,t){vn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function ro(e,t){return ms(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function gs(e,t){var n=e?Yn(e.children):[];return t?n.filter(function(i){return ro(i,t)}):n}function wo(e,t){return t?gs(e,t)[0]:e.firstElementChild}var ao=Object.keys;function di(e,t,n){return e&&(n?ao(e).reverse():ao(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function lo(e){return Yn(arguments,1).forEach(function(t){di(t,function(n,i){e[i]=t[i]})}),e}function Bn(e){return Yn(arguments,1).forEach(function(t){di(t,function(n,i){ya(n)?e[i]=n.slice():oo(n)?e[i]=Bn({},oo(e[i])?e[i]:{},n):e[i]=n})}),e}function Za(e,t){vn(t||ao(e),function(n){delete e[n]})}function In(e,t){vn(e,function(n){vn(t,function(i){n&&n.removeAttribute(i)})})}function gt(e,t,n){oo(t)?di(t,function(i,o){gt(e,o,i)}):vn(e,function(i){va(n)||n===""?In(i,t):i.setAttribute(t,String(n))})}function Ti(e,t,n){var i=document.createElement(e);return t&&(qn(t)?Ln(i,t):gt(i,t)),n&&xo(n,i),i}function bn(e,t,n){if(vo(n))return getComputedStyle(e)[t];va(n)||(e.style[t]=""+n)}function so(e,t){bn(e,"display",t)}function hs(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function xn(e,t){return e.getAttribute(t)}function Ja(e,t){return e&&e.classList.contains(t)}function gn(e){return e.getBoundingClientRect()}function ui(e){vn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function fs(e){return wo(new DOMParser().parseFromString(e,"text/html").body)}function En(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function ys(e,t){return e&&e.querySelector(t)}function wa(e,t){return t?Yn(e.querySelectorAll(t)):[]}function kn(e,t){Mn(e,t,!1)}function oa(e){return e.timeStamp}function ni(e){return qn(e)?e:e?e+"px":""}var So="splide",Sa="data-"+So;function eo(e,t){if(!e)throw new Error("["+So+"] "+(t||""))}var Kn=Math.min,Qo=Math.max,er=Math.floor,co=Math.ceil,ln=Math.abs;function vs(e,t,n){return ln(e-t)<n}function Ko(e,t,n,i){var o=Kn(t,n),l=Qo(t,n);return i?o<e&&e<l:o<=e&&e<=l}function wi(e,t,n){var i=Kn(t,n),o=Qo(t,n);return Kn(Qo(i,e),o)}function ra(e){return+(e>0)-+(e<0)}function aa(e,t){return vn(t,function(n){e=e.replace("%s",""+n)}),e}function $a(e){return e<10?"0"+e:""+e}var Qa={};function bd(e){return""+e+$a(Qa[e]=(Qa[e]||0)+1)}function bs(){var e=[];function t(s,c,d,u){o(s,c,function(m,x,w){var $="addEventListener"in m,f=$?m.removeEventListener.bind(m,x,d,u):m.removeListener.bind(m,d);$?m.addEventListener(x,d,u):m.addListener(d),e.push([m,x,w,d,f])})}function n(s,c,d){o(s,c,function(u,m,x){e=e.filter(function(w){return w[0]===u&&w[1]===m&&w[2]===x&&(!d||w[3]===d)?(w[4](),!1):!0})})}function i(s,c,d){var u,m=!0;return typeof CustomEvent=="function"?u=new CustomEvent(c,{bubbles:m,detail:d}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(c,m,!1,d)),s.dispatchEvent(u),u}function o(s,c,d){vn(s,function(u){u&&vn(c,function(m){m.split(" ").forEach(function(x){var w=x.split(".");d(u,w[0],w[1])})})})}function l(){e.forEach(function(s){s[4]()}),Wn(e)}return{bind:t,unbind:n,dispatch:i,destroy:l}}var Zn="mounted",la="ready",_n="move",Di="moved",Ca="click",xs="active",ws="inactive",Ss="visible",$s="hidden",Jt="refresh",rn="updated",Mi="resize",cr="resized",Cs="drag",Ts="dragging",Ls="dragged",dr="scroll",hi="scrolled",xd="overflow",Ta="destroy",Is="arrows:mounted",Rs="arrows:updated",Es="pagination:mounted",Ms="pagination:updated",La="navigation:mounted",Ia="autoplay:play",ks="autoplay:playing",Ra="autoplay:pause",Ea="lazyload:loaded",Ps="sk",As="sh",tr="ei";function Gt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=bs();function i(l,s){n.bind(t,bo(l).join(" "),function(c){s.apply(s,ya(c.detail)?c.detail:[])})}function o(l){n.dispatch(t,l,Yn(arguments,1))}return e&&e.event.on(Ta,n.destroy),lo(n,{bus:t,on:i,off:Ht(n.unbind,t),emit:o})}function ur(e,t,n,i){var o=Date.now,l,s=0,c,d=!0,u=0;function m(){if(!d){if(s=e?Kn((o()-l)/e,1):1,n&&n(s),s>=1&&(t(),l=o(),i&&++u>=i))return w();c=Ya(m)}}function x(M){M||f(),l=o()-(M?s*e:0),d=!1,c=Ya(m)}function w(){d=!0}function $(){l=o(),s=0,n&&n(s)}function f(){c&&cancelAnimationFrame(c),s=0,c=0,d=!0}function S(M){e=M}function L(){return d}return{start:x,rewind:$,pause:w,cancel:f,set:S,isPaused:L}}function wd(e){var t=e;function n(o){t=o}function i(o){return ba(bo(o),t)}return{set:n,is:i}}function Sd(e,t){var n=ur(0,e,null,1);return function(){n.isPaused()&&n.start()}}function $d(e,t,n){var i=e.state,o=n.breakpoints||{},l=n.reducedMotion||{},s=bs(),c=[];function d(){var f=n.mediaQuery==="min";ao(o).sort(function(S,L){return f?+S-+L:+L-+S}).forEach(function(S){m(o[S],"("+(f?"min":"max")+"-width:"+S+"px)")}),m(l,Xa),x()}function u(f){f&&s.destroy()}function m(f,S){var L=matchMedia(S);s.bind(L,"change",x),c.push([f,L])}function x(){var f=i.is(Jo),S=n.direction,L=c.reduce(function(M,A){return Bn(M,A[1].matches?A[0]:{})},{});Za(n),$(L),n.destroy?e.destroy(n.destroy==="completely"):f?(u(!0),e.mount()):S!==n.direction&&e.refresh()}function w(f){matchMedia(Xa).matches&&(f?Bn(n,l):Za(n,ao(l)))}function $(f,S,L){Bn(n,f),S&&Bn(Object.getPrototypeOf(n),f),(L||!i.is(Ci))&&e.emit(rn,n)}return{setup:d,destroy:u,reduce:w,set:$}}var pr="Arrow",mr=pr+"Left",gr=pr+"Right",Fs=pr+"Up",Ws=pr+"Down",el="rtl",hr="ttb",kr={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Fs,gr],ArrowRight:[Ws,mr]};function Cd(e,t,n){function i(l,s,c){c=c||n.direction;var d=c===el&&!s?1:c===hr?0:-1;return kr[l]&&kr[l][d]||l.replace(/width|left|right/i,function(u,m){var x=kr[u.toLowerCase()][d]||u;return m>0?x.charAt(0).toUpperCase()+x.slice(1):x})}function o(l){return l*(n.direction===el?1:-1)}return{resolve:i,orient:o}}var Pn="role",Li="tabindex",Td="disabled",wn="aria-",$o=wn+"controls",_s=wn+"current",tl=wn+"selected",fn=wn+"label",Ma=wn+"labelledby",Hs=wn+"hidden",ka=wn+"orientation",uo=wn+"roledescription",nl=wn+"live",il=wn+"busy",ol=wn+"atomic",Pa=[Pn,Li,Td,$o,_s,fn,Ma,Hs,ka,uo],Rn=So+"__",Jn="is-",Pr=So,rl=Rn+"track",Ld=Rn+"list",fr=Rn+"slide",Ns=fr+"--clone",Id=fr+"__container",Aa=Rn+"arrows",yr=Rn+"arrow",Os=yr+"--prev",js=yr+"--next",vr=Rn+"pagination",zs=vr+"__page",Rd=Rn+"progress",Ed=Rd+"__bar",Md=Rn+"toggle",kd=Rn+"spinner",Pd=Rn+"sr",Ad=Jn+"initialized",pi=Jn+"active",Bs=Jn+"prev",Ds=Jn+"next",sa=Jn+"visible",ca=Jn+"loading",Vs=Jn+"focus-in",Gs=Jn+"overflow",Fd=[pi,sa,Bs,Ds,ca,Vs,Gs],Wd={slide:fr,clone:Ns,arrows:Aa,arrow:yr,prev:Os,next:js,pagination:vr,page:zs,spinner:kd};function _d(e,t){if(ps(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!ro(n,t);)n=n.parentElement;return n}var Hd=5,al=200,qs="touchstart mousedown",Ar="touchmove mousemove",Fr="touchend touchcancel mouseup click";function Nd(e,t,n){var i=Gt(e),o=i.on,l=i.bind,s=e.root,c=n.i18n,d={},u=[],m=[],x=[],w,$,f;function S(){C(),J(),A()}function L(){o(Jt,M),o(Jt,S),o(rn,A),l(document,qs+" keydown",function(I){f=I.type==="keydown"},{capture:!0}),l(s,"focusin",function(){Mn(s,Vs,!!f)})}function M(I){var R=Pa.concat("style");Wn(u),kn(s,m),kn(w,x),In([w,$],R),In(s,I?R:["style",uo])}function A(){kn(s,m),kn(w,x),m=U(Pr),x=U(rl),Ln(s,m),Ln(w,x),gt(s,fn,n.label),gt(s,Ma,n.labelledby)}function C(){w=k("."+rl),$=wo(w,"."+Ld),eo(w&&$,"A track/list element is missing."),qo(u,gs($,"."+fr+":not(."+Ns+")")),di({arrows:Aa,pagination:vr,prev:Os,next:js,bar:Ed,toggle:Md},function(I,R){d[R]=k("."+I)}),lo(d,{root:s,track:w,list:$,slides:u})}function J(){var I=s.id||bd(So),R=n.role;s.id=I,w.id=w.id||I+"-track",$.id=$.id||I+"-list",!xn(s,Pn)&&s.tagName!=="SECTION"&&R&>(s,Pn,R),gt(s,uo,c.carousel),gt($,Pn,"presentation")}function k(I){var R=ys(s,I);return R&&_d(R,"."+Pr)===s?R:void 0}function U(I){return[I+"--"+n.type,I+"--"+n.direction,n.drag&&I+"--draggable",n.isNavigation&&I+"--nav",I===Pr&&pi]}return lo(d,{setup:S,mount:L,destroy:M})}var ki="slide",Vi="loop",Co="fade";function Od(e,t,n,i){var o=Gt(e),l=o.on,s=o.emit,c=o.bind,d=e.Components,u=e.root,m=e.options,x=m.isNavigation,w=m.updateOnMove,$=m.i18n,f=m.pagination,S=m.slideFocus,L=d.Direction.resolve,M=xn(i,"style"),A=xn(i,fn),C=n>-1,J=wo(i,"."+Id),k;function U(){C||(i.id=u.id+"-slide"+$a(t+1),gt(i,Pn,f?"tabpanel":"group"),gt(i,uo,$.slide),gt(i,fn,A||aa($.slideLabel,[t+1,e.length]))),I()}function I(){c(i,"click",Ht(s,Ca,H)),c(i,"keydown",Ht(s,Ps,H)),l([Di,As,hi],h),l(La,T),w&&l(_n,y)}function R(){k=!0,o.destroy(),kn(i,Fd),In(i,Pa),gt(i,"style",M),gt(i,fn,A||"")}function T(){var _=e.splides.map(function(E){var q=E.splide.Components.Slides.getAt(t);return q?q.slide.id:""}).join(" ");gt(i,fn,aa($.slideX,(C?n:t)+1)),gt(i,$o,_),gt(i,Pn,S?"button":""),S&&In(i,uo)}function y(){k||h()}function h(){if(!k){var _=e.index;F(),W(),Mn(i,Bs,t===_-1),Mn(i,Ds,t===_+1)}}function F(){var _=ne();_!==Ja(i,pi)&&(Mn(i,pi,_),gt(i,_s,x&&_||""),s(_?xs:ws,H))}function W(){var _=X(),E=!_&&(!ne()||C);if(e.state.is([Bi,yo])||gt(i,Hs,E||""),gt(wa(i,m.focusableNodes||""),Li,E?-1:""),S&>(i,Li,E?-1:0),_!==Ja(i,sa)&&(Mn(i,sa,_),s(_?Ss:$s,H)),!_&&document.activeElement===i){var q=d.Slides.getAt(e.index);q&&hs(q.slide)}}function V(_,E,q){bn(q&&J||i,_,E)}function ne(){var _=e.index;return _===t||m.cloneStatus&&_===n}function X(){if(e.is(Co))return ne();var _=gn(d.Elements.track),E=gn(i),q=L("left",!0),Y=L("right",!0);return er(_[q])<=co(E[q])&&er(E[Y])<=co(_[Y])}function z(_,E){var q=ln(_-t);return!C&&(m.rewind||e.is(Vi))&&(q=Kn(q,e.length-q)),q<=E}var H={index:t,slideIndex:n,slide:i,container:J,isClone:C,mount:U,destroy:R,update:h,style:V,isWithin:z};return H}function jd(e,t,n){var i=Gt(e),o=i.on,l=i.emit,s=i.bind,c=t.Elements,d=c.slides,u=c.list,m=[];function x(){w(),o(Jt,$),o(Jt,w)}function w(){d.forEach(function(h,F){S(h,F,-1)})}function $(){k(function(h){h.destroy()}),Wn(m)}function f(){k(function(h){h.update()})}function S(h,F,W){var V=Od(e,F,W,h);V.mount(),m.push(V),m.sort(function(ne,X){return ne.index-X.index})}function L(h){return h?U(function(F){return!F.isClone}):m}function M(h){var F=t.Controller,W=F.toIndex(h),V=F.hasFocus()?1:n.perPage;return U(function(ne){return Ko(ne.index,W,W+V-1)})}function A(h){return U(h)[0]}function C(h,F){vn(h,function(W){if(qn(W)&&(W=fs(W)),ms(W)){var V=d[F];V?xa(W,V):xo(u,W),Ln(W,n.classes.slide),R(W,Ht(l,Mi))}}),l(Jt)}function J(h){ui(U(h).map(function(F){return F.slide})),l(Jt)}function k(h,F){L(F).forEach(h)}function U(h){return m.filter(ps(h)?h:function(F){return qn(h)?ro(F.slide,h):ba(bo(h),F.index)})}function I(h,F,W){k(function(V){V.style(h,F,W)})}function R(h,F){var W=wa(h,"img"),V=W.length;V?W.forEach(function(ne){s(ne,"load error",function(){--V||F()})}):F()}function T(h){return h?d.length:m.length}function y(){return m.length>n.perPage}return{mount:x,destroy:$,update:f,register:S,get:L,getIn:M,getAt:A,add:C,remove:J,forEach:k,filter:U,style:I,getLength:T,isEnough:y}}function zd(e,t,n){var i=Gt(e),o=i.on,l=i.bind,s=i.emit,c=t.Slides,d=t.Direction.resolve,u=t.Elements,m=u.root,x=u.track,w=u.list,$=c.getAt,f=c.style,S,L,M;function A(){C(),l(window,"resize load",Sd(Ht(s,Mi))),o([rn,Jt],C),o(Mi,J)}function C(){S=n.direction===hr,bn(m,"maxWidth",ni(n.width)),bn(x,d("paddingLeft"),k(!1)),bn(x,d("paddingRight"),k(!0)),J(!0)}function J(H){var _=gn(m);(H||L.width!==_.width||L.height!==_.height)&&(bn(x,"height",U()),f(d("marginRight"),ni(n.gap)),f("width",R()),f("height",T(),!0),L=_,s(cr),M!==(M=z())&&(Mn(m,Gs,M),s(xd,M)))}function k(H){var _=n.padding,E=d(H?"right":"left");return _&&ni(_[E]||(oo(_)?0:_))||"0px"}function U(){var H="";return S&&(H=I(),eo(H,"height or heightRatio is missing."),H="calc("+H+" - "+k(!1)+" - "+k(!0)+")"),H}function I(){return ni(n.height||gn(w).width*n.heightRatio)}function R(){return n.autoWidth?null:ni(n.fixedWidth)||(S?"":y())}function T(){return ni(n.fixedHeight)||(S?n.autoHeight?null:y():I())}function y(){var H=ni(n.gap);return"calc((100%"+(H&&" + "+H)+")/"+(n.perPage||1)+(H&&" - "+H)+")"}function h(){return gn(w)[d("width")]}function F(H,_){var E=$(H||0);return E?gn(E.slide)[d("width")]+(_?0:ne()):0}function W(H,_){var E=$(H);if(E){var q=gn(E.slide)[d("right")],Y=gn(w)[d("left")];return ln(q-Y)+(_?0:ne())}return 0}function V(H){return W(e.length-1)-W(0)+F(0,H)}function ne(){var H=$(0);return H&&parseFloat(bn(H.slide,d("marginRight")))||0}function X(H){return parseFloat(bn(x,d("padding"+(H?"Right":"Left"))))||0}function z(){return e.is(Co)||V(!0)>h()}return{mount:A,resize:J,listSize:h,slideSize:F,sliderSize:V,totalSize:W,getPadding:X,isOverflow:z}}var Bd=2;function Dd(e,t,n){var i=Gt(e),o=i.on,l=t.Elements,s=t.Slides,c=t.Direction.resolve,d=[],u;function m(){o(Jt,x),o([rn,Mi],$),(u=L())&&(f(u),t.Layout.resize(!0))}function x(){w(),m()}function w(){ui(d),Wn(d),i.destroy()}function $(){var M=L();u!==M&&(u<M||!M)&&i.emit(Jt)}function f(M){var A=s.get().slice(),C=A.length;if(C){for(;A.length<M;)qo(A,A);qo(A.slice(-M),A.slice(0,M)).forEach(function(J,k){var U=k<M,I=S(J.slide,k);U?xa(I,A[0].slide):xo(l.list,I),qo(d,I),s.register(I,k-M+(U?0:C),J.index)})}}function S(M,A){var C=M.cloneNode(!0);return Ln(C,n.classes.clone),C.id=e.root.id+"-clone"+$a(A+1),C}function L(){var M=n.clones;if(!e.is(Vi))M=0;else if(vo(M)){var A=n[c("fixedWidth")]&&t.Layout.slideSize(0),C=A&&co(gn(l.track)[c("width")]/A);M=C||n[c("autoWidth")]&&e.length||n.perPage*Bd}return M}return{mount:m,destroy:w}}function Vd(e,t,n){var i=Gt(e),o=i.on,l=i.emit,s=e.state.set,c=t.Layout,d=c.slideSize,u=c.getPadding,m=c.totalSize,x=c.listSize,w=c.sliderSize,$=t.Direction,f=$.resolve,S=$.orient,L=t.Elements,M=L.list,A=L.track,C;function J(){C=t.Transition,o([Zn,cr,rn,Jt],k)}function k(){t.Controller.isBusy()||(t.Scroll.cancel(),I(e.index),t.Slides.update())}function U(E,q,Y,ee){E!==q&&H(E>Y)&&(h(),R(y(V(),E>Y),!0)),s(Bi),l(_n,q,Y,E),C.start(q,function(){s(Ei),l(Di,q,Y,E),ee&&ee()})}function I(E){R(W(E,!0))}function R(E,q){if(!e.is(Co)){var Y=q?E:T(E);bn(M,"transform","translate"+f("X")+"("+Y+"px)"),E!==Y&&l(As)}}function T(E){if(e.is(Vi)){var q=F(E),Y=q>t.Controller.getEnd(),ee=q<0;(ee||Y)&&(E=y(E,Y))}return E}function y(E,q){var Y=E-z(q),ee=w();return E-=S(ee*(co(ln(Y)/ee)||1))*(q?1:-1),E}function h(){R(V(),!0),C.cancel()}function F(E){for(var q=t.Slides.get(),Y=0,ee=1/0,N=0;N<q.length;N++){var pe=q[N].index,b=ln(W(pe,!0)-E);if(b<=ee)ee=b,Y=pe;else break}return Y}function W(E,q){var Y=S(m(E-1)-X(E));return q?ne(Y):Y}function V(){var E=f("left");return gn(M)[E]-gn(A)[E]+S(u(!1))}function ne(E){return n.trimSpace&&e.is(ki)&&(E=wi(E,0,S(w(!0)-x()))),E}function X(E){var q=n.focus;return q==="center"?(x()-d(E,!0))/2:+q*d(E)||0}function z(E){return W(E?t.Controller.getEnd():0,!!n.trimSpace)}function H(E){var q=S(y(V(),E));return E?q>=0:q<=M[f("scrollWidth")]-gn(A)[f("width")]}function _(E,q){q=vo(q)?V():q;var Y=E!==!0&&S(q)<S(z(!1)),ee=E!==!1&&S(q)>S(z(!0));return Y||ee}return{mount:J,move:U,jump:I,translate:R,shift:y,cancel:h,toIndex:F,toPosition:W,getPosition:V,getLimit:z,exceededLimit:_,reposition:k}}function Gd(e,t,n){var i=Gt(e),o=i.on,l=i.emit,s=t.Move,c=s.getPosition,d=s.getLimit,u=s.toPosition,m=t.Slides,x=m.isEnough,w=m.getLength,$=n.omitEnd,f=e.is(Vi),S=e.is(ki),L=Ht(V,!1),M=Ht(V,!0),A=n.start||0,C,J=A,k,U,I;function R(){T(),o([rn,Jt,tr],T),o(cr,y)}function T(){k=w(!0),U=n.perMove,I=n.perPage,C=H();var b=wi(A,0,$?C:k-1);b!==A&&(A=b,s.reposition())}function y(){C!==H()&&l(tr)}function h(b,ye,Q){if(!pe()){var xe=W(b),$e=z(xe);$e>-1&&(ye||$e!==A)&&(Y($e),s.move(xe,$e,J,Q))}}function F(b,ye,Q,xe){t.Scroll.scroll(b,ye,Q,function(){var $e=z(s.toIndex(c()));Y($?Kn($e,C):$e),xe&&xe()})}function W(b){var ye=A;if(qn(b)){var Q=b.match(/([+\-<>])(\d+)?/)||[],xe=Q[1],$e=Q[2];xe==="+"||xe==="-"?ye=ne(A+ +(""+xe+(+$e||1)),A):xe===">"?ye=$e?_(+$e):L(!0):xe==="<"&&(ye=M(!0))}else ye=f?b:wi(b,0,C);return ye}function V(b,ye){var Q=U||(N()?1:I),xe=ne(A+Q*(b?-1:1),A,!(U||N()));return xe===-1&&S&&!vs(c(),d(!b),1)?b?0:C:ye?xe:z(xe)}function ne(b,ye,Q){if(x()||N()){var xe=X(b);xe!==b&&(ye=b,b=xe,Q=!1),b<0||b>C?!U&&(Ko(0,b,ye,!0)||Ko(C,ye,b,!0))?b=_(E(b)):f?b=Q?b<0?-(k%I||I):k:b:n.rewind?b=b<0?C:0:b=-1:Q&&b!==ye&&(b=_(E(ye)+(b<ye?-1:1)))}else b=-1;return b}function X(b){if(S&&n.trimSpace==="move"&&b!==A)for(var ye=c();ye===u(b,!0)&&Ko(b,0,e.length-1,!n.rewind);)b<A?--b:++b;return b}function z(b){return f?(b+k)%k||0:b}function H(){for(var b=k-(N()||f&&U?1:I);$&&b-- >0;)if(u(k-1,!0)!==u(b,!0)){b++;break}return wi(b,0,k-1)}function _(b){return wi(N()?b:I*b,0,C)}function E(b){return N()?Kn(b,C):er((b>=C?k-1:b)/I)}function q(b){var ye=s.toIndex(b);return S?wi(ye,0,C):ye}function Y(b){b!==A&&(J=A,A=b)}function ee(b){return b?J:A}function N(){return!vo(n.focus)||n.isNavigation}function pe(){return e.state.is([Bi,yo])&&!!n.waitForTransition}return{mount:R,go:h,scroll:F,getNext:L,getPrev:M,getAdjacent:V,getEnd:H,setIndex:Y,getIndex:ee,toIndex:_,toPage:E,toDest:q,hasFocus:N,isBusy:pe}}var qd="http://www.w3.org/2000/svg",Kd="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",Mo=40;function Ud(e,t,n){var i=Gt(e),o=i.on,l=i.bind,s=i.emit,c=n.classes,d=n.i18n,u=t.Elements,m=t.Controller,x=u.arrows,w=u.track,$=x,f=u.prev,S=u.next,L,M,A={};function C(){k(),o(rn,J)}function J(){U(),C()}function k(){var F=n.arrows;F&&!(f&&S)&&T(),f&&S&&(lo(A,{prev:f,next:S}),so($,F?"":"none"),Ln($,M=Aa+"--"+n.direction),F&&(I(),h(),gt([f,S],$o,w.id),s(Is,f,S)))}function U(){i.destroy(),kn($,M),L?(ui(x?[f,S]:$),f=S=null):In([f,S],Pa)}function I(){o([Zn,Di,Jt,hi,tr],h),l(S,"click",Ht(R,">")),l(f,"click",Ht(R,"<"))}function R(F){m.go(F,!0)}function T(){$=x||Ti("div",c.arrows),f=y(!0),S=y(!1),L=!0,xo($,[f,S]),!x&&xa($,w)}function y(F){var W='<button class="'+c.arrow+" "+(F?c.prev:c.next)+'" type="button"><svg xmlns="'+qd+'" viewBox="0 0 '+Mo+" "+Mo+'" width="'+Mo+'" height="'+Mo+'" focusable="false"><path d="'+(n.arrowPath||Kd)+'" />';return fs(W)}function h(){if(f&&S){var F=e.index,W=m.getPrev(),V=m.getNext(),ne=W>-1&&F<W?d.last:d.prev,X=V>-1&&F>V?d.first:d.next;f.disabled=W<0,S.disabled=V<0,gt(f,fn,ne),gt(S,fn,X),s(Rs,f,S,W,V)}}return{arrows:A,mount:C,destroy:U,update:h}}var Xd=Sa+"-interval";function Yd(e,t,n){var i=Gt(e),o=i.on,l=i.bind,s=i.emit,c=ur(n.interval,e.go.bind(e,">"),I),d=c.isPaused,u=t.Elements,m=t.Elements,x=m.root,w=m.toggle,$=n.autoplay,f,S,L=$==="pause";function M(){$&&(A(),w&>(w,$o,u.track.id),L||C(),U())}function A(){n.pauseOnHover&&l(x,"mouseenter mouseleave",function(T){f=T.type==="mouseenter",k()}),n.pauseOnFocus&&l(x,"focusin focusout",function(T){S=T.type==="focusin",k()}),w&&l(w,"click",function(){L?C():J(!0)}),o([_n,dr,Jt],c.rewind),o(_n,R)}function C(){d()&&t.Slides.isEnough()&&(c.start(!n.resetProgress),S=f=L=!1,U(),s(Ia))}function J(T){T===void 0&&(T=!0),L=!!T,U(),d()||(c.pause(),s(Ra))}function k(){L||(f||S?J(!1):C())}function U(){w&&(Mn(w,pi,!L),gt(w,fn,n.i18n[L?"play":"pause"]))}function I(T){var y=u.bar;y&&bn(y,"width",T*100+"%"),s(ks,T)}function R(T){var y=t.Slides.getAt(T);c.set(y&&+xn(y.slide,Xd)||n.interval)}return{mount:M,destroy:c.cancel,play:C,pause:J,isPaused:d}}function Zd(e,t,n){var i=Gt(e),o=i.on;function l(){n.cover&&(o(Ea,Ht(c,!0)),o([Zn,rn,Jt],Ht(s,!0)))}function s(d){t.Slides.forEach(function(u){var m=wo(u.container||u.slide,"img");m&&m.src&&c(d,m,u)})}function c(d,u,m){m.style("background",d?'center/cover no-repeat url("'+u.src+'")':"",!0),so(u,d?"none":"")}return{mount:l,destroy:Ht(s,!1)}}var Jd=10,Qd=600,eu=.6,tu=1.5,nu=800;function iu(e,t,n){var i=Gt(e),o=i.on,l=i.emit,s=e.state.set,c=t.Move,d=c.getPosition,u=c.getLimit,m=c.exceededLimit,x=c.translate,w=e.is(ki),$,f,S=1;function L(){o(_n,J),o([rn,Jt],k)}function M(I,R,T,y,h){var F=d();if(J(),T&&(!w||!m())){var W=t.Layout.sliderSize(),V=ra(I)*W*er(ln(I)/W)||0;I=c.toPosition(t.Controller.toDest(I%W))+V}var ne=vs(F,I,1);S=1,R=ne?0:R||Qo(ln(I-F)/tu,nu),f=y,$=ur(R,A,Ht(C,F,I,h),1),s(yo),l(dr),$.start()}function A(){s(Ei),f&&f(),l(hi)}function C(I,R,T,y){var h=d(),F=I+(R-I)*U(y),W=(F-h)*S;x(h+W),w&&!T&&m()&&(S*=eu,ln(W)<Jd&&M(u(m(!0)),Qd,!1,f,!0))}function J(){$&&$.cancel()}function k(){$&&!$.isPaused()&&(J(),A())}function U(I){var R=n.easingFunc;return R?R(I):1-Math.pow(1-I,4)}return{mount:L,destroy:J,scroll:M,cancel:k}}var Si={passive:!1,capture:!0};function ou(e,t,n){var i=Gt(e),o=i.on,l=i.emit,s=i.bind,c=i.unbind,d=e.state,u=t.Move,m=t.Scroll,x=t.Controller,w=t.Elements.track,$=t.Media.reduce,f=t.Direction,S=f.resolve,L=f.orient,M=u.getPosition,A=u.exceededLimit,C,J,k,U,I,R=!1,T,y,h;function F(){s(w,Ar,ia,Si),s(w,Fr,ia,Si),s(w,qs,V,Si),s(w,"click",z,{capture:!0}),s(w,"dragstart",En),o([Zn,rn],W)}function W(){var B=n.drag;ie(!B),U=B==="free"}function V(B){if(T=!1,!y){var le=$e(B);xe(B.target)&&(le||!B.button)&&(x.isBusy()?En(B,!0):(h=le?w:window,I=d.is([Bi,yo]),k=null,s(h,Ar,ne,Si),s(h,Fr,X,Si),u.cancel(),m.cancel(),H(B)))}}function ne(B){if(d.is(Go)||(d.set(Go),l(Cs)),B.cancelable)if(I){u.translate(C+Q(N(B)));var le=pe(B)>al,re=R!==(R=A());(le||re)&&H(B),T=!0,l(Ts),En(B)}else q(B)&&(I=E(B),En(B))}function X(B){d.is(Go)&&(d.set(Ei),l(Ls)),I&&(_(B),En(B)),c(h,Ar,ne),c(h,Fr,X),I=!1}function z(B){!y&&T&&En(B,!0)}function H(B){k=J,J=B,C=M()}function _(B){var le=Y(B),re=ee(le),ke=n.rewind&&n.rewindByDrag;$(!1),U?x.scroll(re,0,n.snap):e.is(Co)?x.go(L(ra(le))<0?ke?"<":"-":ke?">":"+"):e.is(ki)&&R&&ke?x.go(A(!0)?">":"<"):x.go(x.toDest(re),!0),$(!0)}function E(B){var le=n.dragMinThreshold,re=oo(le),ke=re&&le.mouse||0,fe=(re?le.touch:+le)||10;return ln(N(B))>($e(B)?fe:ke)}function q(B){return ln(N(B))>ln(N(B,!0))}function Y(B){if(e.is(Vi)||!R){var le=pe(B);if(le&&le<al)return N(B)/le}return 0}function ee(B){return M()+ra(B)*Kn(ln(B)*(n.flickPower||600),U?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function N(B,le){return ye(B,le)-ye(b(B),le)}function pe(B){return oa(B)-oa(b(B))}function b(B){return J===B&&k||J}function ye(B,le){return($e(B)?B.changedTouches[0]:B)["page"+S(le?"Y":"X")]}function Q(B){return B/(R&&e.is(ki)?Hd:1)}function xe(B){var le=n.noDrag;return!ro(B,"."+zs+", ."+yr)&&(!le||!ro(B,le))}function $e(B){return typeof TouchEvent<"u"&&B instanceof TouchEvent}function oe(){return I}function ie(B){y=B}return{mount:F,disable:ie,isDragging:oe}}var ru={Spacebar:" ",Right:gr,Left:mr,Up:Fs,Down:Ws};function Fa(e){return e=qn(e)?e:e.key,ru[e]||e}var ll="keydown";function au(e,t,n){var i=Gt(e),o=i.on,l=i.bind,s=i.unbind,c=e.root,d=t.Direction.resolve,u,m;function x(){w(),o(rn,$),o(rn,w),o(_n,S)}function w(){var M=n.keyboard;M&&(u=M==="global"?window:c,l(u,ll,L))}function $(){s(u,ll)}function f(M){m=M}function S(){var M=m;m=!0,us(function(){m=M})}function L(M){if(!m){var A=Fa(M);A===d(mr)?e.go("<"):A===d(gr)&&e.go(">")}}return{mount:x,destroy:$,disable:f}}var to=Sa+"-lazy",Uo=to+"-srcset",lu="["+to+"], ["+Uo+"]";function su(e,t,n){var i=Gt(e),o=i.on,l=i.off,s=i.bind,c=i.emit,d=n.lazyLoad==="sequential",u=[Di,hi],m=[];function x(){n.lazyLoad&&(w(),o(Jt,w))}function w(){Wn(m),$(),d?M():(l(u),o(u,f),f())}function $(){t.Slides.forEach(function(A){wa(A.slide,lu).forEach(function(C){var J=xn(C,to),k=xn(C,Uo);if(J!==C.src||k!==C.srcset){var U=n.classes.spinner,I=C.parentElement,R=wo(I,"."+U)||Ti("span",U,I);m.push([C,A,R]),C.src||so(C,"none")}})})}function f(){m=m.filter(function(A){var C=n.perPage*((n.preloadPages||1)+1)-1;return A[1].isWithin(e.index,C)?S(A):!0}),m.length||l(u)}function S(A){var C=A[0];Ln(A[1].slide,ca),s(C,"load error",Ht(L,A)),gt(C,"src",xn(C,to)),gt(C,"srcset",xn(C,Uo)),In(C,to),In(C,Uo)}function L(A,C){var J=A[0],k=A[1];kn(k.slide,ca),C.type!=="error"&&(ui(A[2]),so(J,""),c(Ea,J,k),c(Mi)),d&&M()}function M(){m.length&&S(m.shift())}return{mount:x,destroy:Ht(Wn,m),check:f}}function cu(e,t,n){var i=Gt(e),o=i.on,l=i.emit,s=i.bind,c=t.Slides,d=t.Elements,u=t.Controller,m=u.hasFocus,x=u.getIndex,w=u.go,$=t.Direction.resolve,f=d.pagination,S=[],L,M;function A(){C(),o([rn,Jt,tr],A);var y=n.pagination;f&&so(f,y?"":"none"),y&&(o([_n,dr,hi],T),J(),T(),l(Es,{list:L,items:S},R(e.index)))}function C(){L&&(ui(f?Yn(L.children):L),kn(L,M),Wn(S),L=null),i.destroy()}function J(){var y=e.length,h=n.classes,F=n.i18n,W=n.perPage,V=m()?u.getEnd()+1:co(y/W);L=f||Ti("ul",h.pagination,d.track.parentElement),Ln(L,M=vr+"--"+I()),gt(L,Pn,"tablist"),gt(L,fn,F.select),gt(L,ka,I()===hr?"vertical":"");for(var ne=0;ne<V;ne++){var X=Ti("li",null,L),z=Ti("button",{class:h.page,type:"button"},X),H=c.getIn(ne).map(function(E){return E.slide.id}),_=!m()&&W>1?F.pageX:F.slideX;s(z,"click",Ht(k,ne)),n.paginationKeyboard&&s(z,"keydown",Ht(U,ne)),gt(X,Pn,"presentation"),gt(z,Pn,"tab"),gt(z,$o,H.join(" ")),gt(z,fn,aa(_,ne+1)),gt(z,Li,-1),S.push({li:X,button:z,page:ne})}}function k(y){w(">"+y,!0)}function U(y,h){var F=S.length,W=Fa(h),V=I(),ne=-1;W===$(gr,!1,V)?ne=++y%F:W===$(mr,!1,V)?ne=(--y+F)%F:W==="Home"?ne=0:W==="End"&&(ne=F-1);var X=S[ne];X&&(hs(X.button),w(">"+ne),En(h,!0))}function I(){return n.paginationDirection||n.direction}function R(y){return S[u.toPage(y)]}function T(){var y=R(x(!0)),h=R(x());if(y){var F=y.button;kn(F,pi),In(F,tl),gt(F,Li,-1)}if(h){var W=h.button;Ln(W,pi),gt(W,tl,!0),gt(W,Li,"")}l(Ms,{list:L,items:S},y,h)}return{items:S,mount:A,destroy:C,getAt:R,update:T}}var du=[" ","Enter"];function uu(e,t,n){var i=n.isNavigation,o=n.slideFocus,l=[];function s(){e.splides.forEach(function(f){f.isParent||(u(e,f.splide),u(f.splide,e))}),i&&m()}function c(){l.forEach(function(f){f.destroy()}),Wn(l)}function d(){c(),s()}function u(f,S){var L=Gt(f);L.on(_n,function(M,A,C){S.go(S.is(Vi)?C:M)}),l.push(L)}function m(){var f=Gt(e),S=f.on;S(Ca,w),S(Ps,$),S([Zn,rn],x),l.push(f),f.emit(La,e.splides)}function x(){gt(t.Elements.list,ka,n.direction===hr?"vertical":"")}function w(f){e.go(f.index)}function $(f,S){ba(du,Fa(S))&&(w(f),En(S))}return{setup:Ht(t.Media.set,{slideFocus:vo(o)?i:o},!0),mount:s,destroy:c,remount:d}}function pu(e,t,n){var i=Gt(e),o=i.bind,l=0;function s(){n.wheel&&o(t.Elements.track,"wheel",c,Si)}function c(u){if(u.cancelable){var m=u.deltaY,x=m<0,w=oa(u),$=n.wheelMinThreshold||0,f=n.wheelSleep||0;ln(m)>$&&w-l>f&&(e.go(x?"<":">"),l=w),d(x)&&En(u)}}function d(u){return!n.releaseWheel||e.state.is(Bi)||t.Controller.getAdjacent(u)!==-1}return{mount:s}}var mu=90;function gu(e,t,n){var i=Gt(e),o=i.on,l=t.Elements.track,s=n.live&&!n.isNavigation,c=Ti("span",Pd),d=ur(mu,Ht(m,!1));function u(){s&&(w(!t.Autoplay.isPaused()),gt(l,ol,!0),c.textContent="…",o(Ia,Ht(w,!0)),o(Ra,Ht(w,!1)),o([Di,hi],Ht(m,!0)))}function m($){gt(l,il,$),$?(xo(l,c),d.start()):(ui(c),d.cancel())}function x(){In(l,[nl,ol,il]),ui(c)}function w($){s&>(l,nl,$?"off":"polite")}return{mount:u,disable:w,destroy:x}}var hu=Object.freeze({__proto__:null,Media:$d,Direction:Cd,Elements:Nd,Slides:jd,Layout:zd,Clones:Dd,Move:Vd,Controller:Gd,Arrows:Ud,Autoplay:Yd,Cover:Zd,Scroll:iu,Drag:ou,Keyboard:au,LazyLoad:su,Pagination:cu,Sync:uu,Wheel:pu,Live:gu}),fu={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"},yu={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:Wd,i18n:fu,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function vu(e,t,n){var i=t.Slides;function o(){Gt(e).on([Zn,Jt],l)}function l(){i.forEach(function(c){c.style("transform","translateX(-"+100*c.index+"%)")})}function s(c,d){i.style("transition","opacity "+n.speed+"ms "+n.easing),us(d)}return{mount:o,start:s,cancel:ia}}function bu(e,t,n){var i=t.Move,o=t.Controller,l=t.Scroll,s=t.Elements.list,c=Ht(bn,s,"transition"),d;function u(){Gt(e).bind(s,"transitionend",function($){$.target===s&&d&&(x(),d())})}function m($,f){var S=i.toPosition($,!0),L=i.getPosition(),M=w($);ln(S-L)>=1&&M>=1?n.useScroll?l.scroll(S,M,!1,f):(c("transform "+M+"ms "+n.easing),i.translate(S,!0),d=f):(i.jump($),f())}function x(){c(""),l.cancel()}function w($){var f=n.rewindSpeed;if(e.is(ki)&&f){var S=o.getIndex(!0),L=o.getEnd();if(S===0&&$>=L||S>=L&&$===0)return f}return n.speed}return{mount:u,start:m,cancel:x}}var xu=(function(){function e(n,i){this.event=Gt(),this.Components={},this.state=wd(Ci),this.splides=[],this._o={},this._E={};var o=qn(n)?ys(document,n):n;eo(o,o+" is invalid."),this.root=o,i=Bn({label:xn(o,fn)||"",labelledby:xn(o,Ma)||""},yu,e.defaults,i||{});try{Bn(i,JSON.parse(xn(o,Sa)))}catch{eo(!1,"Invalid JSON")}this._o=Object.create(Bn({},i))}var t=e.prototype;return t.mount=function(i,o){var l=this,s=this.state,c=this.Components;eo(s.is([Ci,Jo]),"Already mounted!"),s.set(Ci),this._C=c,this._T=o||this._T||(this.is(Co)?vu:bu),this._E=i||this._E;var d=lo({},hu,this._E,{Transition:this._T});return di(d,function(u,m){var x=u(l,c,l._o);c[m]=x,x.setup&&x.setup()}),di(c,function(u){u.mount&&u.mount()}),this.emit(Zn),Ln(this.root,Ad),s.set(Ei),this.emit(la),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Ei)&&(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(Yn(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(Jt),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,l=this.state;return l.is(Ci)?Gt(this).on(la,this.destroy.bind(this,i)):(di(this._C,function(s){s.destroy&&s.destroy(i)},!0),o.emit(Ta),o.destroy(),i&&Wn(this.splides),l.set(Jo)),this},fd(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})(),Wa=xu;Wa.defaults={};Wa.STATES=vd;var sl=[[Zn,"onMounted"],[la,"onReady"],[_n,"onMove"],[Di,"onMoved"],[Ca,"onClick"],[xs,"onActive"],[ws,"onInactive"],[Ss,"onVisible"],[$s,"onHidden"],[Jt,"onRefresh"],[rn,"onUpdated"],[Mi,"onResize"],[cr,"onResized"],[Cs,"onDrag"],[Ts,"onDragging"],[Ls,"onDragged"],[dr,"onScroll"],[hi,"onScrolled"],[Ta,"onDestroy"],[Is,"onArrowsMounted"],[Rs,"onArrowsUpdated"],[Es,"onPaginationMounted"],[Ms,"onPaginationUpdated"],[La,"onNavigationMounted"],[Ia,"onAutoplayPlay"],[ks,"onAutoplayPlaying"],[Ra,"onAutoplayPause"],[Ea,"onLazyLoadLoaded"]];function _a(...e){return e.filter(Boolean).join(" ")}function nr(e){return e!==null&&typeof e=="object"}function da(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!da(n,t[i]));if(nr(e)&&nr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!da(e[o],t[o]))}return e===t}function wu(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function Su(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 ua(e,t){const n=e;return Su(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():nr(i)?n[o]=ua(nr(n[o])?n[o]:{},i):n[o]=i}),n}var $u=({children:e,className:t,...n})=>a.createElement("div",{className:_a("splide__track",t),...n},a.createElement("ul",{className:"splide__list"},e)),br=class extends a.Component{constructor(){super(...arguments),this.splideRef=a.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new Wa(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=ua({},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&&!da(this.options,e)&&(this.splide.options=e,this.options=ua({},e));const t=this.getSlides();wu(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){sl.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 a.createElement(t,{className:_a("splide",e),ref:this.splideRef,...this.omit(o,["options",...sl.map(l=>l[1])])},n?a.createElement($u,null,i):i)}},xr=({children:e,className:t,...n})=>a.createElement("li",{className:_a("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 Su="RichTextRenderer-module__link___BWeZ2",$u={link:Su},Cu=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))},Sr=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Cu(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function dn(e){const{color:t,...n}=e;return n}function Xt(e,t){var o,l,s;const{fontSize:n,lineHeight:i}=e;return{fontFamily:Sr(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:y.scalingValue(e.letterSpacing,t),wordSpacing:y.scalingValue(e.wordSpacing,t),fontSize:y.scalingValue(n,t),lineHeight:i!==void 0?y.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 mi=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:$u.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:Tu(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 Tu(e){return{...e.fontFamily&&{fontFamily:Sr(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 Lu="SvgImage-module__svg___q3xE-",Iu="SvgImage-module__img___VsTm-",dl={svg:Lu,img:Iu},Ru=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},Eu=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,rn=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[l,s]=a.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return a.useEffect(()=>{if(typeof window<"u"&&window.CSS){const d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');s(d)}},[]),!Ru(e)||!l?r.jsx("img",{src:e,alt:"",className:nt(dl.img,i),style:o}):r.jsx("span",{"data-supports-mask":l,className:nt(dl.svg,i),style:{"--svg":Eu(e),"--fill":t,"--hover-fill":n,...o??{}}})},ku={"top-left":Xe.topLeftAlignment,"top-center":Xe.topCenterAlignment,"top-right":Xe.topRightAlignment,"middle-left":Xe.middleLeftAlignment,"middle-center":Xe.middleCenterAlignment,"middle-right":Xe.middleRightAlignment,"bottom-left":Xe.bottomLeftAlignment,"bottom-center":Xe.bottomCenterAlignment,"bottom-right":Xe.bottomRightAlignment};function Mu({settings:e,content:t,styles:n,isEditor:i}){const[o,l]=a.useState(null),{widthSettings:s,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:m,fontSizeLineHeight:x,textAppearance:b,color:T}=n.imageCaption??{},[f,L]=a.useState(void 0),[$,R]=a.useState(null),[E,C]=a.useState(0),[U,k]=a.useState(0),{direction:j,transition:I,controls:w,pagination:W,imageCaption:h,triggers:S}=e,M=a.useRef(I.type),{x:z,y:K}=e.controls.offset,le=Y=>{o&&o.go(Y)};return a.useEffect(()=>{if(!$)return;const Y=new ResizeObserver(D=>{if(!o)return;const[N]=D;L({width:Math.round(N.contentRect.width),height:Math.round(N.contentRect.height)})});return Y.observe($),()=>Y.unobserve($)},[$]),a.useEffect(()=>{!o||M.current===I.type||(k(Y=>Y+1),M.current=I.type)},[I.type]),r.jsx("div",{className:nt(Xe.wrapper,{[Xe.editor]:i}),ref:R,children:r.jsxs("div",{className:Xe.sliderInner,style:{width:f?f.width:"100%",height:f?f.height:"100%",backgroundColor:I.backgroundColor&&I.type==="fade in"?I.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:nt(Xe.captionBlock),children:r.jsx("div",{className:Xe.captionTextWrapper,children:t.map((Y,D)=>r.jsx("div",{className:nt(Xe.captionText,ku[h.alignment],{[Xe.withPointerEvents]:D===E&&i,[Xe.active]:D===E}),style:{fontFamily:Sr(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:s.sizing==="auto"?"max-content":y.scalingValue(s.width,i),letterSpacing:y.scalingValue(c,i),wordSpacing:y.scalingValue(m,i),textAlign:u,fontSize:y.scalingValue(x.fontSize,i),lineHeight:y.scalingValue(x.lineHeight,i),textTransform:b.textTransform??"none",textDecoration:b.textDecoration??"none",fontVariant:b.fontVariant??"normal",color:T,transitionDuration:I.duration?`${Math.round(parseInt(I.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:Xe.captionTextInner,style:{"--link-hover-color":h.linkHoverColor,"--link-color":h.linkColor,position:"relative",top:y.scalingValue(h.offset.y,i),left:y.scalingValue(h.offset.x,i)},children:r.jsx(mi,{content:Y.imageCaption})})},D))})}),r.jsx(br,{onMove:Y=>{C(Y.index)},ref:l,options:{arrows:!1,speed:I.duration?parseInt(I.duration):500,autoplay:S.autoPlay!==null,...S.autoPlay!==null&&{interval:parseInt(S.autoPlay)*1e3},direction:j==="horiz"||I.type==="fade in"?"ltr":"ttb",pagination:!1,drag:S.triggersList.drag,perPage:1,width:f?f.width:"100%",height:f?f.height:"100%",type:I.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((Y,D)=>r.jsx(wr,{children:r.jsx("div",{className:Xe.sliderItem,children:r.jsx("div",{className:Xe.imgWrapper,children:r.jsx("img",{className:nt(Xe.sliderImage,{[Xe.contain]:Y.image.objectFit==="contain",[Xe.cover]:Y.image.objectFit==="cover"}),src:Y.image.url,alt:Y.image.name??""})})})},D))},U),w.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:nt(Xe.arrow,{[Xe.arrowVertical]:j==="vert",[Xe.hoverArrow]:w.show==="on hover"}),style:{color:w.color,"--arrow-hover-color":w.hover},children:r.jsxs("button",{onClick:()=>{le("-1")},className:Xe.arrowInner,style:{transform:`translate(${y.scalingValue(z,i)}, ${y.scalingValue(K*(j==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${j==="horiz"?"0deg":"90deg"})`},children:[w.arrowsImgUrl&&r.jsx(rn,{url:w.arrowsImgUrl,fill:w.color,hoverFill:w.hover,className:nt(Xe.arrowImg,Xe.mirror)}),!w.arrowsImgUrl&&r.jsx(ul,{color:w.color,className:nt(Xe.arrowIcon,Xe.arrowImg,Xe.mirror)})]})}),r.jsx("div",{className:nt(Xe.arrow,Xe.nextArrow,{[Xe.arrowVertical]:j==="vert",[Xe.hoverArrow]:w.show==="on hover"}),style:{color:w.color,"--arrow-hover-color":w.hover},children:r.jsxs("button",{className:Xe.arrowInner,onClick:()=>le("+1"),style:{transform:`translate(${y.scalingValue(z*(j==="horiz"?-1:1),i)}, ${y.scalingValue(K,i)}) scale(${e.controls.scale/100}) rotate(${j==="horiz"?"0deg":"90deg"})`},children:[w.arrowsImgUrl&&r.jsx(rn,{url:w.arrowsImgUrl,fill:w.color,hoverFill:w.hover,className:Xe.arrowImg}),!w.arrowsImgUrl&&r.jsx(ul,{color:w.color,className:nt(Xe.arrowIcon,Xe.arrowImg)})]})})]}),S.triggersList.click&&r.jsx("div",{className:Xe.clickOverlay,onClick:()=>{o&&o.go("+1")}}),W.isActive&&r.jsx("div",{className:nt(Xe.pagination,{[Xe.paginationInsideBottom]:W.position==="inside-1"&&j==="horiz",[Xe.paginationInsideTop]:W.position==="inside-2"&&j==="horiz",[Xe.paginationOutsideBottom]:W.position==="outside-1"&&j==="horiz",[Xe.paginationOutsideTop]:W.position==="outside-2"&&j==="horiz",[Xe.paginationInsideLeft]:W.position==="inside-1"&&j==="vert",[Xe.paginationInsideRight]:W.position==="inside-2"&&j==="vert",[Xe.paginationOutsideLeft]:W.position==="outside-1"&&j==="vert",[Xe.paginationOutsideRight]:W.position==="outside-2"&&j==="vert",[Xe.paginationVertical]:j==="vert"}),children:r.jsx("div",{className:Xe.paginationInner,style:{backgroundColor:W.colors[2],transform:`scale(${W.scale/100}) translate(${y.scalingValue(W.offset.x,i)}, ${y.scalingValue(W.offset.y,i)}) rotate(${j==="horiz"?"0deg":"90deg"})`},children:t.map((Y,D)=>r.jsx("button",{onClick:()=>{o&&o.go(D)},className:nt(Xe.paginationItem),children:r.jsx("div",{className:nt(Xe.dot,{[Xe.activeDot]:D===E}),style:{backgroundColor:D===E?W.colors[0]:W.colors[1],"--pagination-hover-color":W.hover}})},D))})})]})})}function ul({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 Pu={element:Mu,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"]}},Au="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Fu="ImageRevealSlider-module__image___Qjt-e",Wu="ImageRevealSlider-module__link___N-iLG",_u="ImageRevealSlider-module__cursor___2U03d",vi={imageRevealSlider:Au,image:Fu,link:Wu,cursor:_u};function pl(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,c=s/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-c&&t<=i.y+c)return!0}return!1}function _r(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Nu(e,t,n,i){let o,l;if(t==="custom"){o=n;const s=await _r(e);l=s.height/s.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const s=await _r(e);l=s.height/s.width*o}else{const s=await _r(e);o=s.width,l=s.height}return{width:o,height:l,finalWidth:`${o}px`}}function Hu({settings:e,content:t,isEditor:n}){const[i,o]=a.useState(null),[l,s]=a.useState([]),[d,c]=a.useState(0),u=a.useRef(0),[m,x]=a.useState({x:0,y:0}),[b,T]=a.useState(1),[f,L]=a.useState("none"),$=a.useRef({x:0,y:0}),[R,E]=a.useState(!1),{sizeType:C,imageWidth:U,randomRangeImageWidth:k}=e.imageSize,{revealPosition:j,visible:I}=e.position,{cursorType:w,target:W,defaultCursorScale:h,defaultCursor:S,hoverCursorScale:M,hoverCursor:z}=e.cursor;a.useEffect(()=>{if(!i)return;const Y=(F,A)=>{const q=i.getBoundingClientRect(),G=F-q.left,Z=A-q.top;if(x({x:G,y:Z}),w==="system"){L("none"),T(1);return}const _=G,me=Z,v=document.elementFromPoint(q.left+_,q.top+me);if(v&&v.closest("a")){L("none"),T(1);return}const fe=pl(_,me,l)||W==="area"?{img:z??"none",scale:M}:{img:S??"none",scale:h};L(fe.img),T(fe.scale)},D=F=>{F.stopPropagation(),$.current={x:F.clientX,y:F.clientY},Y(F.clientX,F.clientY)},N=()=>{R&&Y($.current.x,$.current.y)};return i.addEventListener("mousemove",D),window.addEventListener("scroll",N,!0),()=>{i.removeEventListener("mousemove",D),window.removeEventListener("scroll",N,!0)}},[i,R,m,w,W,z,S,M,h,l]),a.useEffect(()=>{R||(L("none"),T(0))},[R]);const K=async(Y,D,N,F={})=>{const{width:A,height:q,finalWidth:G}=await Nu(Y.image.url,C,U,k);let Z=0,_=0;j==="same"?(Z=D/2,_=N/2):(Z=F.x??Math.random()*D,_=F.y??Math.random()*N);const me=Math.min(Math.max(Z,A/2),D-A/2),v=Math.min(Math.max(_,q/2),N-q/2);return{id:u.current++,url:Y.image.url,link:Y.link,name:Y.image.name,x:me,y:v,width:G}};a.useEffect(()=>{if(!i||t.length===0)return;const Y=i.getBoundingClientRect(),D=Y.width,N=Y.height,F=[];(async()=>{const q=t[0],G=await K(q,D,N);F.push(G),s(F),c(1)})()},[C,U,k,j,i]),a.useEffect(()=>{I==="last One"&&s(Y=>Y.length>0?[Y[Y.length-1]]:[])},[I]);const le=async Y=>{if(!i)return;const D=i.getBoundingClientRect(),N=Y.clientX-D.left,F=Y.clientY-D.top;if(W==="image"&&!pl(N,F,l))return;let A=0,q=0;j==="on Click"?(A=N,q=F):j==="same"?(A=D.width/2,q=D.height/2):(A=Math.random()*D.width,q=Math.random()*D.height);const G=t[d],Z=await K(G,D.width,D.height,{x:A,y:q});s(_=>I==="all"?[..._,Z]:[Z]),c(_=>_>=t.length-1?0:_+1)};return r.jsxs("div",{ref:o,onClick:le,onMouseEnter:()=>E(!0),onMouseLeave:()=>E(!1),className:vi.imageRevealSlider,style:{cursor:f==="none"?"default":"none"},children:[l.map(Y=>r.jsx("div",{className:vi.wrapper,style:{top:`${Y.y}px`,left:`${Y.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:Y.width??"auto",height:"auto",cursor:f==="none"?"default":"none"},children:W==="area"&&Y.link?r.jsx("a",{href:Y.link,target:"_blank",className:vi.link,children:r.jsx("img",{src:Y.url,alt:Y.name,className:vi.image},Y.id)}):r.jsx("img",{src:Y.url,alt:Y.name,className:vi.image},Y.id)},Y.id)),R&&r.jsx("div",{className:vi.cursor,style:{left:`${m.x}px`,top:`${m.y}px`,transform:`translate(-50%, -50%) scale(${b})`,backgroundImage:`url('${f}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const ju={element:Hu,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:""}]}}}},Ou="LightBox-module__hidden___9s-9x",zu="LightBox-module__heroImage___sTxNF",Bu="LightBox-module__background___rm9ml",Du="LightBox-module__editor___4ACaY",Vu="LightBox-module__contentStyle___Bgnsq",Gu="LightBox-module__imageStyle___tLIlB",qu="LightBox-module__imgWrapper___LuFUp",Ku="LightBox-module__contain___8-yaS",Uu="LightBox-module__cover___hNvOG",Xu="LightBox-module__caption___b6L2I",Yu="LightBox-module__captionTextInner___rCGNH",Zu="LightBox-module__lightboxSplide___XFuWC",Ju="LightBox-module__arrow___iz38X",Qu="LightBox-module__arrowVertical___Zfz81",ep="LightBox-module__nextArrow___zkAQN",tp="LightBox-module__arrowInner___p48sW",np="LightBox-module__arrowIcon___3VaFf",ip="LightBox-module__arrowImg___pNV88",op="LightBox-module__mirror___pjeXc",rp="LightBox-module__thumbsWrapper___GB-nU",ap="LightBox-module__thumbsContainerVertical___wttk5",lp="LightBox-module__thumbsContainer___osSma",sp="LightBox-module__thumbsAlignStart___MO6tY",cp="LightBox-module__thumbsAlignCenter___Q4sUx",dp="LightBox-module__thumbsAlignEnd___p4y9R",up="LightBox-module__thumbItem___HvnF3",pp="LightBox-module__closeButton___g2khP",mp="LightBox-module__fadeIn___0m5GW",gp="LightBox-module__slideInLeft___gPYwC",hp="LightBox-module__slideInRight___S-pPp",fp="LightBox-module__slideInTop___DFdAj",yp="LightBox-module__slideInBottom___m27kZ",vp="LightBox-module__fadeOut___55qBR",xp="LightBox-module__slideOutLeft___NvU7P",bp="LightBox-module__slideOutRight___SK7eC",wp="LightBox-module__slideOutTop___Vgg0z",Sp="LightBox-module__slideOutBottom___nJ0Ef",$p="LightBox-module__scaleSlide___vZriG",Fe={hidden:Ou,heroImage:zu,background:Bu,editor:Du,contentStyle:Vu,imageStyle:Gu,imgWrapper:qu,contain:Ku,cover:Uu,caption:Xu,captionTextInner:Yu,lightboxSplide:Zu,arrow:Ju,arrowVertical:Qu,nextArrow:ep,arrowInner:tp,arrowIcon:np,arrowImg:ip,mirror:op,thumbsWrapper:rp,thumbsContainerVertical:ap,thumbsContainer:lp,thumbsAlignStart:sp,thumbsAlignCenter:cp,thumbsAlignEnd:dp,thumbItem:up,closeButton:pp,fadeIn:mp,slideInLeft:gp,slideInRight:hp,slideInTop:fp,slideInBottom:yp,fadeOut:vp,slideOutLeft:xp,slideOutRight:bp,slideOutTop:wp,slideOutBottom:Sp,scaleSlide:$p},Mo=(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% + ${y.scalingValue(t.x,n)}), calc(-50% + ${y.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${y.scalingValue(t.x,n)}, calc(-50% + ${y.scalingValue(t.y,n)}))`:l==="center"?i.transform=`translate(calc(-50% + ${y.scalingValue(t.x,n)}), ${y.scalingValue(t.y,n)})`:i.transform=`translate(${y.scalingValue(t.x,n)}, ${y.scalingValue(t.y,n)})`,i};function Ks(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 or(e){const t=e.getBoundingClientRect(),n=Ks(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,c=l/s;let u,m;c>d?(u=i,m=i/c):(m=o,u=o*c);const x=t.left+n.left,b=t.top+n.top,T=(i-u)/2+x,f=(o-m)/2+b;return{x:T,y:f,width:u,height:m}}function ml(e){const t=e.getBoundingClientRect(),n=Ks(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function gl(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 Cp(e,t){const n=(()=>{if(e==="fade in")return Fe.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Fe.slideInLeft;case"right":return Fe.slideInRight;case"top":return Fe.slideInTop;case"bottom":return Fe.slideInBottom;default:return Fe.slideInRight}return Fe.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Fe.fadeIn;if(e==="slide in")switch(t){case"left":return Fe.slideInLeft;case"right":return Fe.slideInRight;case"top":return Fe.slideInTop;case"bottom":return Fe.slideInBottom;default:return Fe.slideInRight}return Fe.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Fe.fadeOut;if(e==="slide in")switch(t){case"left":return Fe.slideOutLeft;case"right":return Fe.slideOutRight;case"top":return Fe.slideOutTop;case"bottom":return Fe.slideOutBottom;default:return Fe.slideOutRight}return Fe.fadeOut})(),l=(()=>{if(e==="fade in")return Fe.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Fe.slideOutLeft;case"right":return Fe.slideOutRight;case"top":return Fe.slideOutTop;case"bottom":return Fe.slideOutBottom;default:return Fe.slideOutRight}return Fe.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:l}}const Tp=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:l,isPreviewMode:s})=>{const[d,c]=a.useState(!1),{url:u}=e.thumbnailBlock.cover;return a.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:u,alt:"Cover",className:Fe.heroImage,onClick:()=>c(!0)}),r.jsx(Lp,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:l})]})},Lp=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:l,isEditor:s,metadata:d})=>{var Se;const{widthSettings:c,fontSettings:u,letterSpacing:m,textAlign:x,wordSpacing:b,fontSizeLineHeight:T,textAppearance:f,color:L}=i.imageCaption??{},[$,R]=a.useState(0),[E,C]=a.useState(0),[U,k]=a.useState(!1),[j,I]=a.useState(!1),[w,W]=a.useState({}),h=a.useRef(null),S=a.useRef(null),M=a.useRef(null),z=a.useRef(!1),K=a.useRef(null),le=a.useRef(null),Y=a.useRef(null),D=a.useRef(null),N=a.useRef(!1),F=a.useRef(null),[A,q]=a.useState(!1),{appear:G,triggers:Z,slider:_,thumbnail:me,controls:v,area:fe,caption:J,layout:de}=o.lightboxBlock,{appearClass:$e,backdropAppearClass:oe,backdropDisappearClass:xe,disappearClass:Q}=Cp(G.type,G.direction),ye=(d==null?void 0:d.itemId)??null;a.useEffect(()=>{const O=()=>{setTimeout(()=>{var H,re;(re=(H=h.current)==null?void 0:H.splide)==null||re.refresh()},16)},ce=()=>{C(H=>H+1)};return window.addEventListener("ArticleEditor.Layout:change",O),window.addEventListener("ArticleEditor.ComponentContent:change",ce),()=>{window.removeEventListener("ArticleEditor.Layout:change",O),window.removeEventListener("ArticleEditor.ComponentContent:change",ce)}},[]),a.useEffect(()=>{if(!e||!me.isActive){q(!1);return}const O=F.current;if(!O)return;const ce=()=>{_.direction==="horiz"?q(O.scrollWidth>O.clientWidth):q(O.scrollHeight>O.clientHeight)};ce();const H=new ResizeObserver(ce);return H.observe(O),()=>H.disconnect()},[e,me.isActive,n.length,w,_.direction]);const ve=a.useCallback(()=>{const O=window.matchMedia("(max-width: 768px)").matches,ce=gl(fe.color);O&&!s&&ce>.9&&(document.body.style.backgroundColor=""),k(!0),z.current=!0;const H=re=>{re.target===K.current&&re.animationName&&(K.current&&le.current&&K.current.removeEventListener("animationend",le.current),le.current=null,z.current&&(z.current=!1,t()),k(!1))};K.current&&(le.current=H,K.current.addEventListener("animationend",H))},[t,fe.color,s]),ke=(O,ce,H)=>{var re,ae;if(O){if(Z.type==="click"&&Z.switch==="image")Z.repeat==="close"&&$===n.length-1?ve():(re=h.current)==null||re.go("+1");else if(Z.type==="click"&&Z.switch==="50/50"){const ne=O.getBoundingClientRect(),ie=ce-ne.left,be=H-ne.top,Ce=ne.width,ee=ne.height;let pe;_.direction==="horiz"?pe=ie<Ce/2?"-1":"+1":pe=be<ee/2?"-1":"+1",(ae=h.current)==null||ae.go(pe)}}},we=O=>{if(N.current){N.current=!1;return}const ce=n[$],H=(ce==null?void 0:ce.image.objectFit)==="cover";let re,ae;if("changedTouches"in O&&O.changedTouches.length>0)re=O.changedTouches[0].clientX,ae=O.changedTouches[0].clientY;else if("clientX"in O)re=O.clientX,ae=O.clientY;else return;let ne;if(H&&M.current){const ie=ml(M.current);ne=re>=ie.left&&re<=ie.right&&ae>=ie.top&&ae<=ie.bottom}else{const ie=M.current?or(M.current):null;if(!ie){O.target===O.currentTarget&&ve();return}ne=re>=ie.x&&re<=ie.x+ie.width&&ae>=ie.y&&ae<=ie.y+ie.height}ne?ke(M.current,re,ae):ve()},Me=O=>{const ce=O.target;(ce.classList.contains(Fe.thumbsWrapper)||ce.classList.contains(Fe.thumbsContainer))&&we(O)};a.useEffect(()=>{if(!e)return;const O=ce=>{var H,re;if(ce.key==="Escape"){ve();return}if(ce.key==="ArrowRight"){R(ae=>(ae+1)%Math.max(n.length,1)),(H=h.current)==null||H.go("+1");return}ce.key==="ArrowLeft"&&(R(ae=>(ae-1+Math.max(n.length,1))%Math.max(n.length,1)),(re=h.current)==null||re.go("-1"))};return window.addEventListener("keydown",O),()=>{window.removeEventListener("keydown",O)}},[e,ve,n.length]),a.useEffect(()=>{if(e){if(R(0),C(ce=>ce+1),z.current=!1,k(!1),I(!1),W({}),!ye)return;const O=new CustomEvent("page-overlay",{detail:{itemId:ye}});window.dispatchEvent(O)}return()=>{K.current&&le.current&&(K.current.removeEventListener("animationend",le.current),le.current=null),I(!1)}},[e,ye]),a.useEffect(()=>{S.current!==null&&S.current!==_.type&&C(O=>O+1),S.current=_.type},[_.type]),a.useEffect(()=>{if(!e)return;const O=document.body.style.overflow,ce=window.matchMedia("(max-width: 768px)").matches,H=gl(fe.color);document.body.style.overflow="hidden",I(!1);const re=ne=>{ne.target===K.current&&!z.current&&ne.animationName&&(ce&&!s&&H>.9&&(document.body.style.backgroundColor=fe.color),I(!0),K.current&&Y.current&&K.current.removeEventListener("animationend",Y.current),Y.current=null)};K.current&&(Y.current=re,K.current.addEventListener("animationend",re));const ae=ne=>{const ie=ne.target;ie&&(ie.closest(`.${Fe.thumbsWrapper}`)||ie.closest(`.${Fe.thumbsContainer}`))||_.type!=="slide"&&ne.preventDefault()};return document.addEventListener("touchmove",ae,{passive:!1}),()=>{document.body.style.overflow=O,document.removeEventListener("touchmove",ae),K.current&&Y.current&&(K.current.removeEventListener("animationend",Y.current),Y.current=null),I(!1)}},[e,s,fe.color,_.type]),a.useEffect(()=>{if(!e)return;const O=ce=>{var re,ae;if(z.current){ce.stopPropagation();return}if(N.current){N.current=!1;return}const H=ce.target;if(!(H&&(H.closest(`.${Fe.thumbsContainer}`)||H.closest(`.${Fe.thumbItem}`)||H.closest(`.${Fe.arrow}`)||H.closest(`.${Fe.closeButton}`)||H.closest(`.${Fe.caption}`)))){if(_.type==="slide"&&Z.type==="drag"&&((ae=(re=h.current)==null?void 0:re.splide)!=null&&ae.root)){const ne=h.current.splide.root;if(H&&(ne.contains(H)||ne===H))return}if(ce.touches.length===0&&ce.changedTouches.length>0){const ne=n[$],ie=(ne==null?void 0:ne.image.objectFit)==="cover",be=ce.changedTouches[0];let Ce;if(ie&&M.current){const ee=ml(M.current);Ce=be.clientX>=ee.left&&be.clientX<=ee.right&&be.clientY>=ee.top&&be.clientY<=ee.bottom}else{const ee=M.current?or(M.current):null;if(!ee)return;Ce=be.clientX>=ee.x&&be.clientX<=ee.x+ee.width&&be.clientY>=ee.y&&be.clientY<=ee.y+ee.height}if(!Ce){ce.stopPropagation(),z.current=!0;const ee=pe=>{pe.stopPropagation(),pe.preventDefault(),document.removeEventListener("click",ee,!0)};document.addEventListener("click",ee,!0),ve()}}}};return document.addEventListener("touchend",O,{passive:!0}),()=>{document.removeEventListener("touchend",O)}},[e,ve,$,n]);const X=(_.type==="scale"||_.type==="fade")&&_.direction==="vert"&&Z.type==="drag";a.useEffect(()=>{var pe,Ae;if(!e||!X||!((Ae=(pe=h.current)==null?void 0:pe.splide)!=null&&Ae.root))return;const O=h.current.splide.root,ce=30,H=(se,V)=>{if(D.current){const je=Math.abs(se-D.current.x),We=Math.abs(V-D.current.y);(je>0||We>0)&&(N.current=!0)}},re=se=>{D.current&&(se.preventDefault(),H(se.clientX,se.clientY))},ae=se=>{D.current&&se.touches.length>0&&(se.preventDefault(),H(se.touches[0].clientX,se.touches[0].clientY))},ne=(se,V)=>{if(!D.current||!h.current){D.current=null;return}const je=Math.abs(se-D.current.x),We=Math.abs(V-D.current.y);We>ce&&We>je&&h.current.go(V<D.current.y?"+1":"-1"),D.current=null},ie=se=>{D.current&&ne(se.clientX,se.clientY),document.removeEventListener("pointerup",ie),document.removeEventListener("pointercancel",ie),document.removeEventListener("pointermove",re)},be=se=>{if(D.current){if(se.changedTouches.length>0){const V=se.changedTouches[0];ne(V.clientX,V.clientY)}document.removeEventListener("touchend",be),document.removeEventListener("touchcancel",be),document.removeEventListener("touchmove",ae)}},Ce=se=>{D.current={x:se.clientX,y:se.clientY},N.current=!1,document.addEventListener("pointermove",re,{passive:!1}),document.addEventListener("pointerup",ie),document.addEventListener("pointercancel",ie)},ee=se=>{se.touches.length>0&&(D.current={x:se.touches[0].clientX,y:se.touches[0].clientY},N.current=!1,document.addEventListener("touchmove",ae,{passive:!1}),document.addEventListener("touchend",be),document.addEventListener("touchcancel",be))};return O.addEventListener("pointerdown",Ce),O.addEventListener("touchstart",ee),()=>{O.removeEventListener("pointerdown",Ce),O.removeEventListener("touchstart",ee),document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",ie),document.removeEventListener("pointercancel",ie),document.removeEventListener("touchmove",ae),document.removeEventListener("touchend",be),document.removeEventListener("touchcancel",be),D.current=null,N.current=!1}},[e,X,E]);const ue={backgroundColor:fe.color,backdropFilter:`blur(${fe.blur}px)`,animationDuration:`${parseInt(G.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(l)?null:gi.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:s?null:K,className:nt(Fe.background,U?xe:oe,{[Fe.editor]:s},{[Fe.hidden]:!e}),style:{...ue,...j&&!s&&!U?{position:"absolute"}:{}}}),r.jsxs("div",{ref:s?K:null,className:nt(Fe.contentStyle,U?Q:$e,{[Fe.editor]:s},{[Fe.hidden]:!e}),style:{animationDuration:`${parseInt(G.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(br,{onMove:O=>R(O.index),ref:h,className:Fe.lightboxSplide,options:{arrows:!1,speed:_.duration?parseInt(_.duration):500,direction:_.direction==="horiz"||_.type==="fade"||_.type==="scale"?"ltr":"ttb",pagination:!1,drag:Z.type==="drag"&&!X,perPage:1,width:"100%",height:"100%",type:_.type==="fade"||_.type==="scale"?"fade":"loop",padding:0,rewind:Z.repeat!=="close",start:0},style:{"--splide-speed":_.duration},children:n.map((O,ce)=>{const H=Mo(de.position,de.offset,s),re=`${y.scalingValue(de.padding.top,s)} ${y.scalingValue(de.padding.right,s)} ${y.scalingValue(de.padding.bottom,s)} ${y.scalingValue(de.padding.left,s)}`,ae=_.type==="scale"?(()=>{const{transform:ne,...ie}=H;return{...ie,position:"absolute",padding:re,boxSizing:"border-box","--position-transform":ne||"none"}})():{...H,position:"absolute",padding:re,boxSizing:"border-box"};return r.jsx(wr,{children:r.jsx("div",{className:Fe.imgWrapper,onClick:we,children:r.jsx("img",{ref:ce===$?M:null,className:nt(Fe.imageStyle,{[Fe.contain]:O.image.objectFit==="contain",[Fe.cover]:O.image.objectFit==="cover",[Fe.scaleSlide]:_.type==="scale"}),src:O.image.url,alt:O.image.name??"",style:{...ae,pointerEvents:O.image.objectFit==="contain"?"none":"auto"}})})},ce)})},E),v.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:nt(Fe.arrow,{[Fe.arrowVertical]:_.direction==="vert"}),style:{color:v.color,"--arrow-hover-color":v.hover},children:r.jsxs("button",{className:Fe.arrowInner,style:{transform:`translate(${y.scalingValue(v.offset.x,s)}, ${y.scalingValue(v.offset.y*(_.direction==="horiz"?1:-1),s)}) scale(${v.scale}) rotate(${_.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var O;return(O=h.current)==null?void 0:O.go("-1")},"aria-label":"Previous",children:[v.arrowsImgUrl&&r.jsx(rn,{url:v.arrowsImgUrl,fill:v.color,hoverFill:v.hover,className:nt(Fe.arrowImg,Fe.mirror)}),!v.arrowsImgUrl&&r.jsx(hl,{color:v.color,className:nt(Fe.arrowIcon,Fe.arrowImg,Fe.mirror)})]})}),r.jsx("div",{className:nt(Fe.arrow,Fe.nextArrow,{[Fe.arrowVertical]:_.direction==="vert"}),style:{color:v.color,"--arrow-hover-color":v.hover},children:r.jsxs("button",{className:Fe.arrowInner,style:{transform:`translate(${y.scalingValue(v.offset.x*(_.direction==="horiz"?-1:1),s)}, ${y.scalingValue(v.offset.y,s)}) scale(${v.scale}) rotate(${_.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var O;return(O=h.current)==null?void 0:O.go("+1")},"aria-label":"Next",children:[v.arrowsImgUrl&&r.jsx(rn,{url:v.arrowsImgUrl,fill:v.color,hoverFill:v.hover,className:Fe.arrowImg}),!v.arrowsImgUrl&&r.jsx(hl,{color:v.color,className:nt(Fe.arrowIcon,Fe.arrowImg)})]})})]}),fe.closeIconUrl&&(()=>{const O=Mo(fe.closeIconAlign,fe.closeIconOffset,s),ce=`scale(${fe.closeIconScale})`,H=O.transform?`${O.transform} ${ce}`:ce;return r.jsx("button",{className:Fe.closeButton,style:{...O,transform:H},onClick:ve,"aria-label":"Close lightbox",children:r.jsx(rn,{url:fe.closeIconUrl,fill:fe.closeIconColor??"#000000",hoverFill:fe.closeIconHover??"#cccccc"})})})(),J&&J.isActive&&i.imageCaption&&((Se=n[$])==null?void 0:Se.imageCaption)&&r.jsx("div",{className:Fe.caption,style:{...Mo(J.alignment,J.offset,s),fontFamily:Sr(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":y.scalingValue(c.width,s),letterSpacing:y.scalingValue(m,s),wordSpacing:y.scalingValue(b,s),textAlign:x,fontSize:y.scalingValue(T.fontSize,s),lineHeight:y.scalingValue(T.lineHeight,s),textTransform:f.textTransform??"none",textDecoration:f.textDecoration??"none",fontVariant:f.fontVariant??"normal",color:L},onClick:O=>O.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:Fe.captionTextInner,style:{"--link-color":J.linkColor,"--link-hover-color":J.linkHoverColor},children:r.jsx(mi,{content:n[$].imageCaption})})}),me.isActive&&(()=>{const[O,ce]=me.position.split("-"),H=_.direction==="horiz"?`${O}-left`:me.position,re=Mo(H,me.offset,s),ae=()=>{if(_.direction==="horiz"){if(ce==="left")return"flex-start";if(ce==="center")return"center";if(ce==="right")return"flex-end"}else{if(O==="top")return"flex-start";if(O==="middle")return"center";if(O==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:F,className:Fe.thumbsWrapper,onClick:ne=>Me(ne),style:{position:s?"absolute":"fixed",...re,..._.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:nt(Fe.thumbsContainer,{[Fe.thumbsContainerVertical]:_.direction==="vert",[Fe.thumbsAlignStart]:me.align==="start",[Fe.thumbsAlignCenter]:me.align==="center",[Fe.thumbsAlignEnd]:me.align==="end"}),style:{gap:y.scalingValue(me.grid.gap,s),justifyContent:A?"flex-start":ae()},children:n.map((ne,ie)=>{const be=ie===$,Ce=w[ie],pe=me.grid.size*(be?me.activeState.scale:1),Ae=()=>{if(me.fit!=="fit")return{};if(!Ce)return _.direction==="horiz"?{height:y.scalingValue(pe,s)}:{width:y.scalingValue(pe,s)};const se=Ce.width/Ce.height;if(_.direction==="horiz"){const V=pe,je=V*se;return{width:y.scalingValue(je,s),height:y.scalingValue(V,s)}}else{const V=pe,je=V/se;return{width:y.scalingValue(V,s),height:y.scalingValue(je,s)}}};return r.jsx("button",{className:Fe.thumbItem,style:{..._.direction==="horiz"&&me.fit!=="fit"?{height:y.scalingValue(pe,s)}:{},..._.direction==="vert"&&me.fit!=="fit"?{width:y.scalingValue(pe,s)}:{},...me.fit==="cover"?{width:y.scalingValue(pe,s),height:y.scalingValue(pe,s)}:{},...Ae(),transition:be?"all 0.25s ease-out":"none",opacity:be?me.activeState.opacity/100:me.opacity/100,"--thumb-hover":me.activeState.opacity/100},onClick:se=>{var V;se.stopPropagation(),R(ie),(V=h.current)==null||V.go(ie)},onMouseEnter:()=>{var se;me.triggers==="hov"&&((se=h.current)==null||se.go(ie))},children:r.jsx("img",{src:ne.image.url,alt:ne.image.name??"",onLoad:se=>{const V=se.currentTarget;V.naturalWidth&&V.naturalHeight&&W(je=>({...je,[ie]:{width:V.naturalWidth,height:V.naturalHeight}}))},style:{objectFit:me.fit==="cover"?"cover":"contain",...me.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...me.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${ne.image.name}-${ie}`)})})})})()]})]}),document.getElementById(l))};function hl({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 Ip={element:Tp,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 Po(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Rp(e){return`
|
|
6
|
+
*/const Cu="RichTextRenderer-module__link___BWeZ2",Tu={link:Cu},Lu=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))},wr=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Lu(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function dn(e){const{color:t,...n}=e;return n}function Xt(e,t){var o,l,s;const{fontSize:n,lineHeight:i}=e;return{fontFamily:wr(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:v.scalingValue(e.letterSpacing,t),wordSpacing:v.scalingValue(e.wordSpacing,t),fontSize:v.scalingValue(n,t),lineHeight:i!==void 0?v.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 mi=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:Tu.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:Iu(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 Iu(e){return{...e.fontFamily&&{fontFamily:wr(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 Ru="SvgImage-module__svg___q3xE-",Eu="SvgImage-module__img___VsTm-",cl={svg:Ru,img:Eu},Mu=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},ku=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,on=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[l,s]=a.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return a.useEffect(()=>{if(typeof window<"u"&&window.CSS){const c=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');s(c)}},[]),!Mu(e)||!l?r.jsx("img",{src:e,alt:"",className:at(cl.img,i),style:o}):r.jsx("span",{"data-supports-mask":l,className:at(cl.svg,i),style:{"--svg":ku(e),"--fill":t,"--hover-fill":n,...o??{}}})},Pu={"top-left":Qe.topLeftAlignment,"top-center":Qe.topCenterAlignment,"top-right":Qe.topRightAlignment,"middle-left":Qe.middleLeftAlignment,"middle-center":Qe.middleCenterAlignment,"middle-right":Qe.middleRightAlignment,"bottom-left":Qe.bottomLeftAlignment,"bottom-center":Qe.bottomCenterAlignment,"bottom-right":Qe.bottomRightAlignment};function Au({settings:e,content:t,styles:n,isEditor:i}){const[o,l]=a.useState(null),{widthSettings:s,fontSettings:c,letterSpacing:d,textAlign:u,wordSpacing:m,fontSizeLineHeight:x,textAppearance:w,color:$}=n.imageCaption??{},[f,S]=a.useState(void 0),[L,M]=a.useState(null),[A,C]=a.useState(0),[J,k]=a.useState(0),{direction:U,transition:I,controls:R,pagination:T,imageCaption:y,triggers:h}=e,F=a.useRef(I.type),{x:W,y:V}=e.controls.offset,ne=X=>{o&&o.go(X)};return a.useEffect(()=>{if(!L)return;const X=new ResizeObserver(z=>{if(!o)return;const[H]=z;S({width:Math.round(H.contentRect.width),height:Math.round(H.contentRect.height)})});return X.observe(L),()=>X.unobserve(L)},[L]),a.useEffect(()=>{!o||F.current===I.type||(k(X=>X+1),F.current=I.type)},[I.type]),r.jsx("div",{className:at(Qe.wrapper,{[Qe.editor]:i}),ref:M,children:r.jsxs("div",{className:Qe.sliderInner,style:{width:f?f.width:"100%",height:f?f.height:"100%",backgroundColor:I.backgroundColor&&I.type==="fade in"?I.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:at(Qe.captionBlock),children:r.jsx("div",{className:Qe.captionTextWrapper,children:t.map((X,z)=>r.jsx("div",{className:at(Qe.captionText,Pu[y.alignment],{[Qe.withPointerEvents]:z===A&&i,[Qe.active]:z===A}),style:{fontFamily:wr(c.fontFamily),fontWeight:c.fontWeight,fontStyle:c.fontStyle,width:s.sizing==="auto"?"max-content":v.scalingValue(s.width,i),letterSpacing:v.scalingValue(d,i),wordSpacing:v.scalingValue(m,i),textAlign:u,fontSize:v.scalingValue(x.fontSize,i),lineHeight:v.scalingValue(x.lineHeight,i),textTransform:w.textTransform??"none",textDecoration:w.textDecoration??"none",fontVariant:w.fontVariant??"normal",color:$,transitionDuration:I.duration?`${Math.round(parseInt(I.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:Qe.captionTextInner,style:{"--link-hover-color":y.linkHoverColor,"--link-color":y.linkColor,position:"relative",top:v.scalingValue(y.offset.y,i),left:v.scalingValue(y.offset.x,i)},children:r.jsx(mi,{content:X.imageCaption})})},z))})}),r.jsx(br,{onMove:X=>{C(X.index)},ref:l,options:{arrows:!1,speed:I.duration?parseInt(I.duration):500,autoplay:h.autoPlay!==null,...h.autoPlay!==null&&{interval:parseInt(h.autoPlay)*1e3},direction:U==="horiz"||I.type==="fade in"?"ltr":"ttb",pagination:!1,drag:h.triggersList.drag,perPage:1,width:f?f.width:"100%",height:f?f.height:"100%",type:I.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((X,z)=>r.jsx(xr,{children:r.jsx("div",{className:Qe.sliderItem,children:r.jsx("div",{className:Qe.imgWrapper,children:r.jsx("img",{className:at(Qe.sliderImage,{[Qe.contain]:X.image.objectFit==="contain",[Qe.cover]:X.image.objectFit==="cover"}),src:X.image.url,alt:X.image.name??""})})})},z))},J),R.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:at(Qe.arrow,{[Qe.arrowVertical]:U==="vert",[Qe.hoverArrow]:R.show==="on hover"}),style:{color:R.color,"--arrow-hover-color":R.hover},children:r.jsxs("button",{onClick:()=>{ne("-1")},className:Qe.arrowInner,style:{transform:`translate(${v.scalingValue(W,i)}, ${v.scalingValue(V*(U==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:[R.arrowsImgUrl&&r.jsx(on,{url:R.arrowsImgUrl,fill:R.color,hoverFill:R.hover,className:at(Qe.arrowImg,Qe.mirror)}),!R.arrowsImgUrl&&r.jsx(dl,{color:R.color,className:at(Qe.arrowIcon,Qe.arrowImg,Qe.mirror)})]})}),r.jsx("div",{className:at(Qe.arrow,Qe.nextArrow,{[Qe.arrowVertical]:U==="vert",[Qe.hoverArrow]:R.show==="on hover"}),style:{color:R.color,"--arrow-hover-color":R.hover},children:r.jsxs("button",{className:Qe.arrowInner,onClick:()=>ne("+1"),style:{transform:`translate(${v.scalingValue(W*(U==="horiz"?-1:1),i)}, ${v.scalingValue(V,i)}) scale(${e.controls.scale/100}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:[R.arrowsImgUrl&&r.jsx(on,{url:R.arrowsImgUrl,fill:R.color,hoverFill:R.hover,className:Qe.arrowImg}),!R.arrowsImgUrl&&r.jsx(dl,{color:R.color,className:at(Qe.arrowIcon,Qe.arrowImg)})]})})]}),h.triggersList.click&&r.jsx("div",{className:Qe.clickOverlay,onClick:()=>{o&&o.go("+1")}}),T.isActive&&r.jsx("div",{className:at(Qe.pagination,{[Qe.paginationInsideBottom]:T.position==="inside-1"&&U==="horiz",[Qe.paginationInsideTop]:T.position==="inside-2"&&U==="horiz",[Qe.paginationOutsideBottom]:T.position==="outside-1"&&U==="horiz",[Qe.paginationOutsideTop]:T.position==="outside-2"&&U==="horiz",[Qe.paginationInsideLeft]:T.position==="inside-1"&&U==="vert",[Qe.paginationInsideRight]:T.position==="inside-2"&&U==="vert",[Qe.paginationOutsideLeft]:T.position==="outside-1"&&U==="vert",[Qe.paginationOutsideRight]:T.position==="outside-2"&&U==="vert",[Qe.paginationVertical]:U==="vert"}),children:r.jsx("div",{className:Qe.paginationInner,style:{backgroundColor:T.colors[2],transform:`scale(${T.scale/100}) translate(${v.scalingValue(T.offset.x,i)}, ${v.scalingValue(T.offset.y,i)}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:t.map((X,z)=>r.jsx("button",{onClick:()=>{o&&o.go(z)},className:at(Qe.paginationItem),children:r.jsx("div",{className:at(Qe.dot,{[Qe.activeDot]:z===A}),style:{backgroundColor:z===A?T.colors[0]:T.colors[1],"--pagination-hover-color":T.hover}})},z))})})]})})}function dl({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 Fu={element:Au,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"]}},Wu="ImageRevealSlider-module__imageRevealSlider___UE5Ob",_u="ImageRevealSlider-module__image___Qjt-e",Hu="ImageRevealSlider-module__link___N-iLG",Nu="ImageRevealSlider-module__cursor___2U03d",vi={imageRevealSlider:Wu,image:_u,link:Hu,cursor:Nu};function ul(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,c=l/2,d=s/2;if(e>=i.x-c&&e<=i.x+c&&t>=i.y-d&&t<=i.y+d)return!0}return!1}function Wr(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Ou(e,t,n,i){let o,l;if(t==="custom"){o=n;const s=await Wr(e);l=s.height/s.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const s=await Wr(e);l=s.height/s.width*o}else{const s=await Wr(e);o=s.width,l=s.height}return{width:o,height:l,finalWidth:`${o}px`}}function ju({settings:e,content:t,isEditor:n}){const[i,o]=a.useState(null),[l,s]=a.useState([]),[c,d]=a.useState(0),u=a.useRef(0),[m,x]=a.useState({x:0,y:0}),[w,$]=a.useState(1),[f,S]=a.useState("none"),L=a.useRef({x:0,y:0}),[M,A]=a.useState(!1),{sizeType:C,imageWidth:J,randomRangeImageWidth:k}=e.imageSize,{revealPosition:U,visible:I}=e.position,{cursorType:R,target:T,defaultCursorScale:y,defaultCursor:h,hoverCursorScale:F,hoverCursor:W}=e.cursor;a.useEffect(()=>{if(!i)return;const X=(_,E)=>{const q=i.getBoundingClientRect(),Y=_-q.left,ee=E-q.top;if(x({x:Y,y:ee}),R==="system"){S("none"),$(1);return}const N=Y,pe=ee,b=document.elementFromPoint(q.left+N,q.top+pe);if(b&&b.closest("a")){S("none"),$(1);return}const ye=ul(N,pe,l)||T==="area"?{img:W??"none",scale:F}:{img:h??"none",scale:y};S(ye.img),$(ye.scale)},z=_=>{_.stopPropagation(),L.current={x:_.clientX,y:_.clientY},X(_.clientX,_.clientY)},H=()=>{M&&X(L.current.x,L.current.y)};return i.addEventListener("mousemove",z),window.addEventListener("scroll",H,!0),()=>{i.removeEventListener("mousemove",z),window.removeEventListener("scroll",H,!0)}},[i,M,m,R,T,W,h,F,y,l]),a.useEffect(()=>{M||(S("none"),$(0))},[M]);const V=async(X,z,H,_={})=>{const{width:E,height:q,finalWidth:Y}=await Ou(X.image.url,C,J,k);let ee=0,N=0;U==="same"?(ee=z/2,N=H/2):(ee=_.x??Math.random()*z,N=_.y??Math.random()*H);const pe=Math.min(Math.max(ee,E/2),z-E/2),b=Math.min(Math.max(N,q/2),H-q/2);return{id:u.current++,url:X.image.url,link:X.link,name:X.image.name,x:pe,y:b,width:Y}};a.useEffect(()=>{if(!i||t.length===0)return;const X=i.getBoundingClientRect(),z=X.width,H=X.height,_=[];(async()=>{const q=t[0],Y=await V(q,z,H);_.push(Y),s(_),d(1)})()},[C,J,k,U,i]),a.useEffect(()=>{I==="last One"&&s(X=>X.length>0?[X[X.length-1]]:[])},[I]);const ne=async X=>{if(!i)return;const z=i.getBoundingClientRect(),H=X.clientX-z.left,_=X.clientY-z.top;if(T==="image"&&!ul(H,_,l))return;let E=0,q=0;U==="on Click"?(E=H,q=_):U==="same"?(E=z.width/2,q=z.height/2):(E=Math.random()*z.width,q=Math.random()*z.height);const Y=t[c],ee=await V(Y,z.width,z.height,{x:E,y:q});s(N=>I==="all"?[...N,ee]:[ee]),d(N=>N>=t.length-1?0:N+1)};return r.jsxs("div",{ref:o,onClick:ne,onMouseEnter:()=>A(!0),onMouseLeave:()=>A(!1),className:vi.imageRevealSlider,style:{cursor:f==="none"?"default":"none"},children:[l.map(X=>r.jsx("div",{className:vi.wrapper,style:{top:`${X.y}px`,left:`${X.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:X.width??"auto",height:"auto",cursor:f==="none"?"default":"none"},children:T==="area"&&X.link?r.jsx("a",{href:X.link,target:"_blank",className:vi.link,children:r.jsx("img",{src:X.url,alt:X.name,className:vi.image},X.id)}):r.jsx("img",{src:X.url,alt:X.name,className:vi.image},X.id)},X.id)),M&&r.jsx("div",{className:vi.cursor,style:{left:`${m.x}px`,top:`${m.y}px`,transform:`translate(-50%, -50%) scale(${w})`,backgroundImage:`url('${f}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const zu={element:ju,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:""}]}}}},Bu="LightBox-module__hidden___9s-9x",Du="LightBox-module__heroImage___sTxNF",Vu="LightBox-module__background___rm9ml",Gu="LightBox-module__editor___4ACaY",qu="LightBox-module__contentStyle___Bgnsq",Ku="LightBox-module__imageStyle___tLIlB",Uu="LightBox-module__imgWrapper___LuFUp",Xu="LightBox-module__contain___8-yaS",Yu="LightBox-module__cover___hNvOG",Zu="LightBox-module__caption___b6L2I",Ju="LightBox-module__captionTextInner___rCGNH",Qu="LightBox-module__lightboxSplide___XFuWC",ep="LightBox-module__arrow___iz38X",tp="LightBox-module__arrowVertical___Zfz81",np="LightBox-module__nextArrow___zkAQN",ip="LightBox-module__arrowInner___p48sW",op="LightBox-module__arrowIcon___3VaFf",rp="LightBox-module__arrowImg___pNV88",ap="LightBox-module__mirror___pjeXc",lp="LightBox-module__thumbsWrapper___GB-nU",sp="LightBox-module__thumbsContainerVertical___wttk5",cp="LightBox-module__thumbsContainer___osSma",dp="LightBox-module__thumbsAlignStart___MO6tY",up="LightBox-module__thumbsAlignCenter___Q4sUx",pp="LightBox-module__thumbsAlignEnd___p4y9R",mp="LightBox-module__thumbItem___HvnF3",gp="LightBox-module__closeButton___g2khP",hp="LightBox-module__fadeIn___0m5GW",fp="LightBox-module__slideInLeft___gPYwC",yp="LightBox-module__slideInRight___S-pPp",vp="LightBox-module__slideInTop___DFdAj",bp="LightBox-module__slideInBottom___m27kZ",xp="LightBox-module__fadeOut___55qBR",wp="LightBox-module__slideOutLeft___NvU7P",Sp="LightBox-module__slideOutRight___SK7eC",$p="LightBox-module__slideOutTop___Vgg0z",Cp="LightBox-module__slideOutBottom___nJ0Ef",Tp="LightBox-module__scaleSlide___vZriG",je={hidden:Bu,heroImage:Du,background:Vu,editor:Gu,contentStyle:qu,imageStyle:Ku,imgWrapper:Uu,contain:Xu,cover:Yu,caption:Zu,captionTextInner:Ju,lightboxSplide:Qu,arrow:ep,arrowVertical:tp,nextArrow:np,arrowInner:ip,arrowIcon:op,arrowImg:rp,mirror:ap,thumbsWrapper:lp,thumbsContainerVertical:sp,thumbsContainer:cp,thumbsAlignStart:dp,thumbsAlignCenter:up,thumbsAlignEnd:pp,thumbItem:mp,closeButton:gp,fadeIn:hp,slideInLeft:fp,slideInRight:yp,slideInTop:vp,slideInBottom:bp,fadeOut:xp,slideOutLeft:wp,slideOutRight:Sp,slideOutTop:$p,slideOutBottom:Cp,scaleSlide:Tp},ko=(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% + ${v.scalingValue(t.x,n)}), calc(-50% + ${v.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${v.scalingValue(t.x,n)}, calc(-50% + ${v.scalingValue(t.y,n)}))`:l==="center"?i.transform=`translate(calc(-50% + ${v.scalingValue(t.x,n)}), ${v.scalingValue(t.y,n)})`:i.transform=`translate(${v.scalingValue(t.x,n)}, ${v.scalingValue(t.y,n)})`,i};function Ks(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 Lp(e){const t=e.trim().split(/\s+/),n=i=>{if(i.endsWith("%"))return parseFloat(i)/100;switch(i){case"left":case"top":return 0;case"right":case"bottom":return 1;case"center":return .5;default:return .5}};if(t.length===1){const i=t[0];return i==="center"?{x:.5,y:.5}:i==="top"||i==="bottom"?{x:.5,y:n(i)}:i==="left"||i==="right"?{x:n(i),y:.5}:{x:n(i),y:.5}}return{x:n(t[0]),y:n(t[1])}}function Us(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,l=n/i;if(l>o){const c=e;return{renderedW:c,renderedH:c/l}}const s=t;return{renderedW:s*l,renderedH:s}}function Ip(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,l=n/i;if(l>o){const c=t;return{renderedW:c*l,renderedH:c}}const s=e;return{renderedW:s,renderedH:s/l}}function Xs(e,t,n,i,o){const{x:l,y:s}=Lp(o);return{offsetX:l*(e-n),offsetY:s*(t-i)}}function Rp(e){const t=e.getBoundingClientRect(),n=t.width,i=t.height;if(!n||!i)return"center center";const o=e instanceof HTMLVideoElement?e.videoWidth:e.naturalWidth,l=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight,{objectFit:s,objectPosition:c}=window.getComputedStyle(e),d=s==="cover"?Ip:Us,{renderedW:u,renderedH:m}=d(n,i,o,l),{offsetX:x,offsetY:w}=Xs(n,i,u,m,c),$=(x+u/2)/n*100,f=(w+m/2)/i*100;return`${$}% ${f}%`}function Ep(e){return Rp(e)}function ir(e){const t=e.getBoundingClientRect(),n=Ks(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,{renderedW:c,renderedH:d}=Us(i,o,l,s),u=window.getComputedStyle(e).objectPosition,{offsetX:m,offsetY:x}=Xs(i,o,c,d,u),w=t.left+n.left,$=t.top+n.top;return{x:m+w,y:x+$,width:c,height:d}}function pl(e){const t=e.getBoundingClientRect(),n=Ks(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function ml(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 Mp(e,t){const n=(()=>{if(e==="fade in")return je.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return je.slideInLeft;case"right":return je.slideInRight;case"top":return je.slideInTop;case"bottom":return je.slideInBottom;default:return je.slideInRight}return je.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return je.fadeIn;if(e==="slide in")switch(t){case"left":return je.slideInLeft;case"right":return je.slideInRight;case"top":return je.slideInTop;case"bottom":return je.slideInBottom;default:return je.slideInRight}return je.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return je.fadeOut;if(e==="slide in")switch(t){case"left":return je.slideOutLeft;case"right":return je.slideOutRight;case"top":return je.slideOutTop;case"bottom":return je.slideOutBottom;default:return je.slideOutRight}return je.fadeOut})(),l=(()=>{if(e==="fade in")return je.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return je.slideOutLeft;case"right":return je.slideOutRight;case"top":return je.slideOutTop;case"bottom":return je.slideOutBottom;default:return je.slideOutRight}return je.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:l}}const kp=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:l,isPreviewMode:s})=>{const[c,d]=a.useState(!1),{url:u}=e.thumbnailBlock.cover;return a.useEffect(()=>{o==="close"&&d(!1),o==="open"&&d(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:u,alt:"Cover",className:je.heroImage,onClick:()=>d(!0)}),r.jsx(Pp,{isOpen:c,onClose:()=>d(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:l})]})},Pp=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:l,isEditor:s,metadata:c})=>{var Se;const{widthSettings:d,fontSettings:u,letterSpacing:m,textAlign:x,wordSpacing:w,fontSizeLineHeight:$,textAppearance:f,color:S}=i.imageCaption??{},[L,M]=a.useState(0),[A,C]=a.useState(0),[J,k]=a.useState(!1),[U,I]=a.useState(!1),[R,T]=a.useState({}),y=a.useRef(null),h=a.useRef(null),F=a.useRef(null),W=a.useRef(!1),V=a.useRef(null),ne=a.useRef(null),X=a.useRef(null),z=a.useRef(null),H=a.useRef(!1),_=a.useRef(null),[E,q]=a.useState(!1),{appear:Y,triggers:ee,slider:N,thumbnail:pe,controls:b,area:ye,caption:Q,layout:xe}=o.lightboxBlock,{appearClass:$e,backdropAppearClass:oe,backdropDisappearClass:ie,disappearClass:B}=Mp(Y.type,Y.direction),le=(c==null?void 0:c.itemId)??null;a.useEffect(()=>{const G=()=>{setTimeout(()=>{var D,K;(K=(D=y.current)==null?void 0:D.splide)==null||K.refresh()},16)},me=()=>{C(D=>D+1)};return window.addEventListener("ArticleEditor.Layout:change",G),window.addEventListener("ArticleEditor.ComponentContent:change",me),()=>{window.removeEventListener("ArticleEditor.Layout:change",G),window.removeEventListener("ArticleEditor.ComponentContent:change",me)}},[]),a.useEffect(()=>{if(!e||!pe.isActive){q(!1);return}const G=_.current;if(!G)return;const me=()=>{N.direction==="horiz"?q(G.scrollWidth>G.clientWidth):q(G.scrollHeight>G.clientHeight)};me();const D=new ResizeObserver(me);return D.observe(G),()=>D.disconnect()},[e,pe.isActive,n.length,R,N.direction]);const re=a.useCallback(()=>{const G=window.matchMedia("(max-width: 768px)").matches,me=ml(ye.color);G&&!s&&me>.9&&(document.body.style.backgroundColor=""),k(!0),W.current=!0;const D=K=>{K.target===V.current&&K.animationName&&(V.current&&ne.current&&V.current.removeEventListener("animationend",ne.current),ne.current=null,W.current&&(W.current=!1,t()),k(!1))};V.current&&(ne.current=D,V.current.addEventListener("animationend",D))},[t,ye.color,s]),ke=(G,me,D)=>{var K,ae;if(G){if(ee.type==="click"&&ee.switch==="image")ee.repeat==="close"&&L===n.length-1?re():(K=y.current)==null||K.go("+1");else if(ee.type==="click"&&ee.switch==="50/50"){const ge=G.getBoundingClientRect(),ce=me-ge.left,be=D-ge.top,Ee=ge.width,Z=ge.height;let de;N.direction==="horiz"?de=ce<Ee/2?"-1":"+1":de=be<Z/2?"-1":"+1",(ae=y.current)==null||ae.go(de)}}},fe=G=>{if(H.current){H.current=!1;return}const me=n[L],D=(me==null?void 0:me.image.objectFit)==="cover";let K,ae;if("changedTouches"in G&&G.changedTouches.length>0)K=G.changedTouches[0].clientX,ae=G.changedTouches[0].clientY;else if("clientX"in G)K=G.clientX,ae=G.clientY;else return;let ge;if(D&&F.current){const ce=pl(F.current);ge=K>=ce.left&&K<=ce.right&&ae>=ce.top&&ae<=ce.bottom}else{const ce=F.current?ir(F.current):null;if(!ce){G.target===G.currentTarget&&re();return}ge=K>=ce.x&&K<=ce.x+ce.width&&ae>=ce.y&&ae<=ce.y+ce.height}ge?ke(F.current,K,ae):re()},Pe=G=>{const me=G.target;(me.classList.contains(je.thumbsWrapper)||me.classList.contains(je.thumbsContainer))&&fe(G)};a.useEffect(()=>{if(!e)return;const G=me=>{var D,K;if(me.key==="Escape"){re();return}if(me.key==="ArrowRight"){M(ae=>(ae+1)%Math.max(n.length,1)),(D=y.current)==null||D.go("+1");return}me.key==="ArrowLeft"&&(M(ae=>(ae-1+Math.max(n.length,1))%Math.max(n.length,1)),(K=y.current)==null||K.go("-1"))};return window.addEventListener("keydown",G),()=>{window.removeEventListener("keydown",G)}},[e,re,n.length]),a.useEffect(()=>{if(e){if(M(0),C(me=>me+1),W.current=!1,k(!1),I(!1),T({}),!le)return;const G=new CustomEvent("page-overlay",{detail:{itemId:le}});window.dispatchEvent(G)}return()=>{V.current&&ne.current&&(V.current.removeEventListener("animationend",ne.current),ne.current=null),I(!1)}},[e,le]),a.useEffect(()=>{h.current!==null&&h.current!==N.type&&C(G=>G+1),h.current=N.type},[N.type]),a.useEffect(()=>{if(!e)return;const G=document.body.style.overflow,me=window.matchMedia("(max-width: 768px)").matches,D=ml(ye.color);document.body.style.overflow="hidden",I(!1);const K=ge=>{ge.target===V.current&&!W.current&&ge.animationName&&(me&&!s&&D>.9&&(document.body.style.backgroundColor=ye.color),I(!0),V.current&&X.current&&V.current.removeEventListener("animationend",X.current),X.current=null)};V.current&&(X.current=K,V.current.addEventListener("animationend",K));const ae=ge=>{const ce=ge.target;ce&&(ce.closest(`.${je.thumbsWrapper}`)||ce.closest(`.${je.thumbsContainer}`))||N.type!=="slide"&&ge.preventDefault()};return document.addEventListener("touchmove",ae,{passive:!1}),()=>{document.body.style.overflow=G,document.removeEventListener("touchmove",ae),V.current&&X.current&&(V.current.removeEventListener("animationend",X.current),X.current=null),I(!1)}},[e,s,ye.color,N.type]),a.useEffect(()=>{if(!e)return;const G=me=>{var K,ae;if(W.current){me.stopPropagation();return}if(H.current){H.current=!1;return}const D=me.target;if(!(D&&(D.closest(`.${je.thumbsContainer}`)||D.closest(`.${je.thumbItem}`)||D.closest(`.${je.arrow}`)||D.closest(`.${je.closeButton}`)||D.closest(`.${je.caption}`)))){if(N.type==="slide"&&ee.type==="drag"&&((ae=(K=y.current)==null?void 0:K.splide)!=null&&ae.root)){const ge=y.current.splide.root;if(D&&(ge.contains(D)||ge===D))return}if(me.touches.length===0&&me.changedTouches.length>0){const ge=n[L],ce=(ge==null?void 0:ge.image.objectFit)==="cover",be=me.changedTouches[0];let Ee;if(ce&&F.current){const Z=pl(F.current);Ee=be.clientX>=Z.left&&be.clientX<=Z.right&&be.clientY>=Z.top&&be.clientY<=Z.bottom}else{const Z=F.current?ir(F.current):null;if(!Z)return;Ee=be.clientX>=Z.x&&be.clientX<=Z.x+Z.width&&be.clientY>=Z.y&&be.clientY<=Z.y+Z.height}if(!Ee){me.stopPropagation(),W.current=!0;const Z=de=>{de.stopPropagation(),de.preventDefault(),document.removeEventListener("click",Z,!0)};document.addEventListener("click",Z,!0),re()}}}};return document.addEventListener("touchend",G,{passive:!0}),()=>{document.removeEventListener("touchend",G)}},[e,re,L,n]);const ve=(N.type==="scale"||N.type==="fade")&&N.direction==="vert"&&ee.type==="drag";a.useEffect(()=>{var de,We;if(!e||!ve||!((We=(de=y.current)==null?void 0:de.splide)!=null&&We.root))return;const G=y.current.splide.root,me=30,D=(se,O)=>{if(z.current){const Oe=Math.abs(se-z.current.x),_e=Math.abs(O-z.current.y);(Oe>0||_e>0)&&(H.current=!0)}},K=se=>{z.current&&(se.preventDefault(),D(se.clientX,se.clientY))},ae=se=>{z.current&&se.touches.length>0&&(se.preventDefault(),D(se.touches[0].clientX,se.touches[0].clientY))},ge=(se,O)=>{if(!z.current||!y.current){z.current=null;return}const Oe=Math.abs(se-z.current.x),_e=Math.abs(O-z.current.y);_e>me&&_e>Oe&&y.current.go(O<z.current.y?"+1":"-1"),z.current=null},ce=se=>{z.current&&ge(se.clientX,se.clientY),document.removeEventListener("pointerup",ce),document.removeEventListener("pointercancel",ce),document.removeEventListener("pointermove",K)},be=se=>{if(z.current){if(se.changedTouches.length>0){const O=se.changedTouches[0];ge(O.clientX,O.clientY)}document.removeEventListener("touchend",be),document.removeEventListener("touchcancel",be),document.removeEventListener("touchmove",ae)}},Ee=se=>{z.current={x:se.clientX,y:se.clientY},H.current=!1,document.addEventListener("pointermove",K,{passive:!1}),document.addEventListener("pointerup",ce),document.addEventListener("pointercancel",ce)},Z=se=>{se.touches.length>0&&(z.current={x:se.touches[0].clientX,y:se.touches[0].clientY},H.current=!1,document.addEventListener("touchmove",ae,{passive:!1}),document.addEventListener("touchend",be),document.addEventListener("touchcancel",be))};return G.addEventListener("pointerdown",Ee),G.addEventListener("touchstart",Z),()=>{G.removeEventListener("pointerdown",Ee),G.removeEventListener("touchstart",Z),document.removeEventListener("pointermove",K),document.removeEventListener("pointerup",ce),document.removeEventListener("pointercancel",ce),document.removeEventListener("touchmove",ae),document.removeEventListener("touchend",be),document.removeEventListener("touchcancel",be),z.current=null,H.current=!1}},[e,ve,A]);const we={backgroundColor:ye.color,backdropFilter:`blur(${ye.blur}px)`,animationDuration:`${parseInt(Y.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(l)?null:gi.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:s?null:V,className:at(je.background,J?ie:oe,{[je.editor]:s},{[je.hidden]:!e}),style:{...we,...U&&!s&&!J?{position:"absolute"}:{}}}),r.jsxs("div",{ref:s?V:null,className:at(je.contentStyle,J?B:$e,{[je.editor]:s},{[je.hidden]:!e}),style:{animationDuration:`${parseInt(Y.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(br,{onMove:G=>M(G.index),ref:y,className:je.lightboxSplide,options:{arrows:!1,speed:N.duration?parseInt(N.duration):500,direction:N.direction==="horiz"||N.type==="fade"||N.type==="scale"?"ltr":"ttb",pagination:!1,drag:ee.type==="drag"&&!ve,perPage:1,width:"100%",height:"100%",type:N.type==="fade"||N.type==="scale"?"fade":"loop",padding:0,rewind:ee.repeat!=="close",start:0},style:{"--splide-speed":N.duration},children:n.map((G,me)=>{const D=ko(xe.position,xe.offset,s),K=`${v.scalingValue(xe.padding.top,s)} ${v.scalingValue(xe.padding.right,s)} ${v.scalingValue(xe.padding.bottom,s)} ${v.scalingValue(xe.padding.left,s)}`,ae=N.type==="scale"?(()=>{const{transform:ge,...ce}=D;return{...ce,position:"absolute",padding:K,boxSizing:"border-box","--position-transform":ge||"none"}})():{...D,position:"absolute",padding:K,boxSizing:"border-box"};return r.jsx(xr,{children:r.jsx("div",{className:je.imgWrapper,onClick:fe,children:r.jsx("img",{ref:me===L?F:null,className:at(je.imageStyle,{[je.contain]:G.image.objectFit==="contain",[je.cover]:G.image.objectFit==="cover",[je.scaleSlide]:N.type==="scale"}),src:G.image.url,alt:G.image.name??"",style:{...ae,pointerEvents:G.image.objectFit==="contain"?"none":"auto"}})})},me)})},A),b.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:at(je.arrow,{[je.arrowVertical]:N.direction==="vert"}),style:{color:b.color,"--arrow-hover-color":b.hover},children:r.jsxs("button",{className:je.arrowInner,style:{transform:`translate(${v.scalingValue(b.offset.x,s)}, ${v.scalingValue(b.offset.y*(N.direction==="horiz"?1:-1),s)}) scale(${b.scale}) rotate(${N.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var G;return(G=y.current)==null?void 0:G.go("-1")},"aria-label":"Previous",children:[b.arrowsImgUrl&&r.jsx(on,{url:b.arrowsImgUrl,fill:b.color,hoverFill:b.hover,className:at(je.arrowImg,je.mirror)}),!b.arrowsImgUrl&&r.jsx(gl,{color:b.color,className:at(je.arrowIcon,je.arrowImg,je.mirror)})]})}),r.jsx("div",{className:at(je.arrow,je.nextArrow,{[je.arrowVertical]:N.direction==="vert"}),style:{color:b.color,"--arrow-hover-color":b.hover},children:r.jsxs("button",{className:je.arrowInner,style:{transform:`translate(${v.scalingValue(b.offset.x*(N.direction==="horiz"?-1:1),s)}, ${v.scalingValue(b.offset.y,s)}) scale(${b.scale}) rotate(${N.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var G;return(G=y.current)==null?void 0:G.go("+1")},"aria-label":"Next",children:[b.arrowsImgUrl&&r.jsx(on,{url:b.arrowsImgUrl,fill:b.color,hoverFill:b.hover,className:je.arrowImg}),!b.arrowsImgUrl&&r.jsx(gl,{color:b.color,className:at(je.arrowIcon,je.arrowImg)})]})})]}),ye.closeIconUrl&&(()=>{const G=ko(ye.closeIconAlign,ye.closeIconOffset,s),me=`scale(${ye.closeIconScale})`,D=G.transform?`${G.transform} ${me}`:me;return r.jsx("button",{className:je.closeButton,style:{...G,transform:D},onClick:re,"aria-label":"Close lightbox",children:r.jsx(on,{url:ye.closeIconUrl,fill:ye.closeIconColor??"#000000",hoverFill:ye.closeIconHover??"#cccccc"})})})(),Q&&Q.isActive&&i.imageCaption&&((Se=n[L])==null?void 0:Se.imageCaption)&&r.jsx("div",{className:je.caption,style:{...ko(Q.alignment,Q.offset,s),fontFamily:wr(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:d.sizing==="auto"?"max-content":v.scalingValue(d.width,s),letterSpacing:v.scalingValue(m,s),wordSpacing:v.scalingValue(w,s),textAlign:x,fontSize:v.scalingValue($.fontSize,s),lineHeight:v.scalingValue($.lineHeight,s),textTransform:f.textTransform??"none",textDecoration:f.textDecoration??"none",fontVariant:f.fontVariant??"normal",color:S},onClick:G=>G.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:je.captionTextInner,style:{"--link-color":Q.linkColor,"--link-hover-color":Q.linkHoverColor},children:r.jsx(mi,{content:n[L].imageCaption})})}),pe.isActive&&(()=>{const[G,me]=pe.position.split("-"),D=N.direction==="horiz"?`${G}-left`:pe.position,K=ko(D,pe.offset,s),ae=()=>{if(N.direction==="horiz"){if(me==="left")return"flex-start";if(me==="center")return"center";if(me==="right")return"flex-end"}else{if(G==="top")return"flex-start";if(G==="middle")return"center";if(G==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:_,className:je.thumbsWrapper,onClick:ge=>Pe(ge),style:{position:s?"absolute":"fixed",...K,...N.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:at(je.thumbsContainer,{[je.thumbsContainerVertical]:N.direction==="vert",[je.thumbsAlignStart]:pe.align==="start",[je.thumbsAlignCenter]:pe.align==="center",[je.thumbsAlignEnd]:pe.align==="end"}),style:{gap:v.scalingValue(pe.grid.gap,s),justifyContent:E?"flex-start":ae()},children:n.map((ge,ce)=>{const be=ce===L,Ee=R[ce],de=pe.grid.size*(be?pe.activeState.scale:1),We=()=>{if(pe.fit!=="fit")return{};if(!Ee)return N.direction==="horiz"?{height:v.scalingValue(de,s)}:{width:v.scalingValue(de,s)};const se=Ee.width/Ee.height;if(N.direction==="horiz"){const O=de,Oe=O*se;return{width:v.scalingValue(Oe,s),height:v.scalingValue(O,s)}}else{const O=de,Oe=O/se;return{width:v.scalingValue(O,s),height:v.scalingValue(Oe,s)}}};return r.jsx("button",{className:je.thumbItem,style:{...N.direction==="horiz"&&pe.fit!=="fit"?{height:v.scalingValue(de,s)}:{},...N.direction==="vert"&&pe.fit!=="fit"?{width:v.scalingValue(de,s)}:{},...pe.fit==="cover"?{width:v.scalingValue(de,s),height:v.scalingValue(de,s)}:{},...We(),transition:be?"all 0.25s ease-out":"none",opacity:be?pe.activeState.opacity/100:pe.opacity/100,"--thumb-hover":pe.activeState.opacity/100},onClick:se=>{var O;se.stopPropagation(),M(ce),(O=y.current)==null||O.go(ce)},onMouseEnter:()=>{var se;pe.triggers==="hov"&&((se=y.current)==null||se.go(ce))},children:r.jsx("img",{src:ge.image.url,alt:ge.image.name??"",onLoad:se=>{const O=se.currentTarget;O.naturalWidth&&O.naturalHeight&&T(Oe=>({...Oe,[ce]:{width:O.naturalWidth,height:O.naturalHeight}}))},style:{objectFit:pe.fit==="cover"?"cover":"contain",...pe.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...pe.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${ge.image.name}-${ce}`)})})})})()]})]}),document.getElementById(l))};function gl({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 Ap={element:kp,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 Po(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Fp(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 Wp({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:l}){const s=!!n,c=i&&t||!t,{prefix:d}=v.useScopedStyles(),{type:u="A",fieldsToShow:m=2,fields:x=[],buttonLabel:w,gap:$,fieldsGap:f,buttonCorners:S,buttonStroke:L,buttonPadding:M,isButtonFullWidth:A,inputCorners:C,inputStroke:J,inputPadding:k,inputColor:U,inputTextColor:I,inputBorderColor:R,placeholderColor:T,buttonColor:y,buttonTextColor:h,buttonBorderColor:F,labelTextColor:W,successColor:V,errorColor:ne,fontFamily:X,inputFontSettings:z,inputFontSize:H,inputLineHeight:_,inputLetterSpacing:E,inputWordSpacing:q,inputTextAppearance:Y,buttonFontSettings:ee,buttonFontSize:N,buttonLineHeight:pe,buttonLetterSpacing:b,buttonWordSpacing:ye,buttonTextAppearance:Q,labelFontSettings:xe,labelFontSize:$e,labelLineHeight:oe,labelLetterSpacing:ie,labelWordSpacing:B,labelTextAppearance:le,statusFontSettings:re,statusFontSize:ke,statusLineHeight:fe,statusLetterSpacing:Pe,statusWordSpacing:ve,statusTextAppearance:we,successMessage:Se,errorMessage:G,stateOverrides:me}=e,D=u==="B",K=x.slice(0,Math.min(m,x.length)),ae={fontSettings:{fontFamily:X,fontWeight:(z==null?void 0:z.fontWeight)??400,fontStyle:(z==null?void 0:z.fontStyle)??"normal"},fontSize:H??.01,lineHeight:_,letterSpacing:E??0,wordSpacing:q??0,textAppearance:Y,color:I},ge=dn(Xt(ae,t)),ce=v.scalingValue(J??0,t),be=v.scalingValue((_??H??.01)+((k==null?void 0:k.top)??0)+((k==null?void 0:k.bottom)??0)+(u==="C"?J??0:(J??0)*2),t),Ee={...ge,borderStyle:"solid",borderRadius:u==="C"?0:v.scalingValue(C??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:ce,borderLeftWidth:0}:{borderWidth:ce},paddingTop:v.scalingValue((k==null?void 0:k.top)??0,t),paddingRight:v.scalingValue((k==null?void 0:k.right)??0,t),paddingBottom:v.scalingValue((k==null?void 0:k.bottom)??0,t),paddingLeft:v.scalingValue((k==null?void 0:k.left)??0,t),height:be,minHeight:be},Z={fontSettings:{fontFamily:X,fontWeight:(ee==null?void 0:ee.fontWeight)??400,fontStyle:(ee==null?void 0:ee.fontStyle)??"normal"},fontSize:N??.01,lineHeight:pe,letterSpacing:b??0,wordSpacing:ye??0,textAppearance:Q,color:h},de=dn(Xt(Z,t)),We=v.scalingValue(L??0,t),se={fontSettings:{fontFamily:X,fontWeight:(xe==null?void 0:xe.fontWeight)??400,fontStyle:(xe==null?void 0:xe.fontStyle)??"normal"},fontSize:$e??.01,lineHeight:oe,letterSpacing:ie??0,wordSpacing:B??0,textAppearance:le,color:W},O=Xt(se,t),Oe={fontSettings:{fontFamily:X,fontWeight:(re==null?void 0:re.fontWeight)??400,fontStyle:(re==null?void 0:re.fontStyle)??"normal"},fontSize:ke??.01,lineHeight:fe,letterSpacing:Pe??0,wordSpacing:ve??0,textAppearance:we,color:V},_e=dn(Xt(Oe,t)),nt=v.buildColorVars(d,{inputColor:U,inputTextColor:I,inputBorderColor:R,placeholderColor:T!=null&&T.trim()?T:"#cccccc",buttonColor:y,buttonTextColor:h,buttonBorderColor:F,labelTextColor:W,successColor:V,errorColor:ne},_p,Hp,me),[Ue,Ce]=a.useState(()=>Object.fromEntries(K.map(rt=>[rt.name,""]))),[Fe,He]=a.useState("idle"),[Ze,Tt]=a.useState(null),it=l==="success"?"success":l==="error"?"error":Fe,De=l==="error"?G:Ze,et=l==="filled",dt=a.useMemo(()=>{if(!et)return Ue;let rt=null;for(const qe of K)(Ue[qe.name]??"").trim().length>0||(rt=rt??{...Ue},rt[qe.name]="Filled");return rt??Ue},[Ue,et,K]),lt=it==="error"?v.getFormFieldValidationError(K,dt):null,Rt=`${l&&l!=="default"?`${d}-state-${l}`:""}`.trim(),ot=o==null?void 0:o.submitUrl,xt=(rt,qe)=>{Ce(Ne=>({...Ne,[rt]:qe}))},zt=async rt=>{if(rt.preventDefault(),!c)return;const qe=Object.fromEntries(K.map(pt=>{var yt;return[pt.name,((yt=Ue[pt.name])==null?void 0:yt.trim())??""]}).filter(([,pt])=>pt));if(!ot){He("error"),Tt("No integrations were found for this form.");return}if(Object.keys(qe).length===0)return;const Ne=v.getFormFieldValidationError(K,Ue);if(Ne){He("error"),Tt(Ne);return}He("submitting"),Tt(null);try{const pt=await fetch(ot,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(qe)});if(!pt.ok){const yt=await pt.text();throw new Error(yt||`Request failed: ${pt.status}`)}He("success"),Ce(Object.fromEntries(K.map(yt=>[yt.name,""])))}catch(pt){He("error"),Tt(pt instanceof Error?pt.message:"Something went wrong")}};return r.jsxs("div",{className:`${d}-wrapper ${d}-type-${u} ${Rt}`.trim(),style:nt,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Fp(d)}}),r.jsxs("form",{onSubmit:zt,className:`${d}-form`,children:[r.jsx("div",{className:`${d}-fields`,children:K.map((rt,qe)=>r.jsxs(a.Fragment,{children:[qe>0&&r.jsx("div",{"data-controls":s?"fieldsGap":void 0,className:s?`${d}-control`:void 0,style:{height:v.scalingValue(f??0,t)}}),r.jsxs("div",{className:`${d}-field-group${D?` ${d}-labeled`:""}`,children:[D&&r.jsx("span",{className:`${d}-field-label`,style:O?{...O,lineHeight:O.fontSize}:void 0,children:rt.label||rt.name}),rt.type==="textarea"?r.jsx("textarea",{name:rt.name,autoComplete:"off",value:dt[rt.name]??"",onChange:Ne=>xt(rt.name,Ne.target.value),placeholder:rt.placeholder,className:`${d}-input`,style:Ee,rows:1,"data-filled":et||(dt[rt.name]??"").trim().length>0,"data-field-type":"textarea"}):r.jsx("input",{type:rt.type==="phone"?"tel":rt.type==="email"?"email":"text",name:rt.name,autoComplete:"off",value:dt[rt.name]??"",onChange:Ne=>xt(rt.name,Ne.target.value),placeholder:rt.placeholder,required:rt.isRequired??rt.type==="email",className:`${d}-input`,style:Ee,"data-filled":et||(dt[rt.name]??"").trim().length>0})]})]},qe))}),r.jsx("div",{"data-controls":s?"gap":void 0,className:s?`${d}-control`:void 0,style:{height:v.scalingValue($??0,t)}}),r.jsx("div",{className:`${d}-overlay-anchor`,children:r.jsx("button",{type:c?"submit":"button",className:`${d}-button`,style:{borderStyle:"solid",borderRadius:v.scalingValue(S??0,t),borderWidth:We,paddingTop:v.scalingValue((M==null?void 0:M.top)??0,t),paddingRight:v.scalingValue((M==null?void 0:M.right)??0,t),paddingBottom:v.scalingValue((M==null?void 0:M.bottom)??0,t),paddingLeft:v.scalingValue((M==null?void 0:M.left)??0,t),pointerEvents:c?"auto":void 0,...de,...A?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:r.jsx("span",{className:`${d}-overlay-anchor`,style:A?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:Fe==="submitting"?"...":w})})})]}),it==="success"&&r.jsx("p",{className:`${d}-success`,style:{..._e},children:Se}),it==="error"&&r.jsx("p",{className:`${d}-error`,style:{..._e},role:"alert",children:lt??De??G})]})}const _p={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"},Hp=["hover","focus","filled","success","error"],Np=`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
|
-
`,Ap=[{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"}],Ao={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Fp=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],Wp={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:{...Ao.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:{...Ao.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:{...Ao.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:{...Ao.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:Ap,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#A7A7A7",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:!0,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:.0426,buttonLineHeight:.0426,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},t:{gap:.02604,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.039,buttonPadding:{top:.0195,right:.02604,bottom:.0195,left:.0195},inputPadding:{top:.0195,right:.0195,bottom:.0195,left:.0195},inputFontSize:.02083,inputLineHeight:.02604,buttonFontSize:.02083,buttonLineHeight:.02604,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01},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:[...Fp],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"]},_p={element:Ep,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Stacked.png"},defaultSize:{d:{width:300},t:{width:300},m:{width:340}},schema:Wp,sourceCode:Pp,fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",labelFontSettings:"fontFamily",statusFontSettings:"fontFamily"},assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]}};function Fo(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Np(e){return`
|
|
792
|
+
`,Op=[{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"}],Ao={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},jp=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],zp={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:{...Ao.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:{...Ao.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:{...Ao.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:{...Ao.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:Op,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#A7A7A7",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:!0,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:.0426,buttonLineHeight:.0426,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},t:{gap:.02604,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.039,buttonPadding:{top:.0195,right:.02604,bottom:.0195,left:.0195},inputPadding:{top:.0195,right:.0195,bottom:.0195,left:.0195},inputFontSize:.02083,inputLineHeight:.02604,buttonFontSize:.02083,buttonLineHeight:.02604,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01},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:[...jp],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"]},Bp={element:Wp,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Stacked.png"},defaultSize:{d:{width:300},t:{width:300},m:{width:340}},schema:zp,sourceCode:Np,fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",labelFontSettings:"fontFamily",statusFontSettings:"fontFamily"},assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]}};function Fo(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Dp(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: ${Fo(14)};
|
|
981
981
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
982
982
|
}
|
|
983
|
-
`}const
|
|
983
|
+
`}const Vp=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:l}=v.useScopedStyles(),s=n&&t||!t,{fields:c=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:d,buttonLabel:u,fieldsToShow:m=1,fontFamily:x,inputFontSettings:w,inputFontSize:$,inputLineHeight:f,inputLetterSpacing:S,inputWordSpacing:L,inputTextAppearance:M,buttonFontSettings:A,buttonFontSize:C,buttonLineHeight:J,buttonLetterSpacing:k,buttonWordSpacing:U,buttonTextAppearance:I,statusFontSettings:R,statusFontSize:T,statusLineHeight:y,statusLetterSpacing:h,statusWordSpacing:F,statusTextAppearance:W,iconMaxWidth:V,minHeight:ne,corners:X,stroke:z,stateOverrides:H,inputPadding:_,buttonPadding:E,successMessage:q="Thanks for subscribing!",errorMessage:Y="Please, fill all required fields."}=e,ee=c.slice(0,Math.min(m,c.length)),[N,pe]=a.useState(()=>Object.fromEntries(ee.map(se=>[se.name,""]))),[b,ye]=a.useState("idle"),[Q,xe]=a.useState(null),$e=o==="success"?"success":o==="error"?"error":b,oe=o==="error"?Y:Q,ie=o==="filled",B=a.useMemo(()=>{if(!ie)return N;let se=null;for(const O of ee)(N[O.name]??"").trim().length>0||(se=se??{...N},se[O.name]="Filled");return se??N},[ie,N,ee]),le=$e==="error"?v.getFormFieldValidationError(ee,B):null,re=o&&o!=="default"?`${l}-state-${o}`:"",ke=ee.some(se=>(B[se.name]??"").trim().length>0),fe=re!==`${l}-state-filled`&&ke?`${l}-state-filled`:"",Pe=`${re} ${fe}`.trim(),ve=i==null?void 0:i.submitUrl,we=u??"",Se=(d==null?void 0:d.icon)??"",G=(d==null?void 0:d.mode)==="On",me=we||"Submit",D={fontSettings:{fontFamily:x,fontWeight:(w==null?void 0:w.fontWeight)??400,fontStyle:(w==null?void 0:w.fontStyle)??"normal"},fontSize:$??.01,lineHeight:f,letterSpacing:S??0,wordSpacing:L??0,textAppearance:M,color:e.inputTextColor??"#111111"},K={fontSettings:{fontFamily:x,fontWeight:(A==null?void 0:A.fontWeight)??400,fontStyle:(A==null?void 0:A.fontStyle)??"normal"},fontSize:C??.01,lineHeight:J,letterSpacing:k??0,wordSpacing:U??0,textAppearance:I,color:e.buttonTextColor??"#ffffff"},ae={fontSettings:{fontFamily:x,fontWeight:(R==null?void 0:R.fontWeight)??400,fontStyle:(R==null?void 0:R.fontStyle)??"normal"},fontSize:T??.01,lineHeight:y,letterSpacing:h??0,wordSpacing:F??0,textAppearance:W,color:e.successColor??"#22c55e"},ge=dn(Xt(D,t)),ce=dn(Xt(K,t)),be=dn(Xt(ae,t)),Ee=v.buildColorVars(l,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(D==null?void 0:D.color)??"#111111",buttonTextColor:e.buttonTextColor??(K==null?void 0:K.color)??"#ffffff"},Gp,qp,H),Z={borderRadius:v.scalingValue(X,t),borderWidth:v.scalingValue(z,t),borderStyle:"solid"},de={borderLeftWidth:v.scalingValue(z,t)},We=async se=>{if(se.preventDefault(),!s)return;const O=Object.fromEntries(ee.map(_e=>{var nt;return[_e.name,((nt=N[_e.name])==null?void 0:nt.trim())??""]}).filter(([,_e])=>_e));if(!ve){ye("error"),xe("No integrations were found for this form.");return}if(Object.keys(O).length===0)return;const Oe=v.getFormFieldValidationError(ee,N);if(Oe){ye("error"),xe(Oe);return}ye("submitting"),xe(null);try{const _e=await fetch(ve,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)});if(!_e.ok){const nt=await _e.text();throw new Error(nt||`Request failed: ${_e.status}`)}ye("success"),pe(Object.fromEntries(ee.map(nt=>[nt.name,""])))}catch(_e){ye("error"),xe(_e instanceof Error?_e.message:"Something went wrong")}};return r.jsxs("div",{className:`${l}-wrapper ${Pe}`.trim(),style:Ee,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Dp(l)}}),r.jsxs("form",{onSubmit:We,className:`${l}-form`,style:{...Z,height:v.scalingValue(ne,t),minHeight:v.scalingValue(ne,t)},children:[r.jsx("div",{className:`${l}-inputWrap ${l}-overlayAnchor`,style:{flex:1,minWidth:0},children:ee.map(se=>r.jsx("input",{type:se.type==="email"?"email":se.type==="phone"?"tel":"text",name:se.name,autoComplete:"off",value:B[se.name]??"",onChange:O=>pe(Oe=>({...Oe,[se.name]:O.target.value})),placeholder:se.placeholder,required:se.isRequired??se.type==="email",className:`${l}-input`,style:{...ge,paddingRight:v.scalingValue(_.right,t),paddingLeft:v.scalingValue(_.left,t),paddingTop:v.scalingValue(_.top,t),paddingBottom:v.scalingValue(_.bottom,t)}},se.name))}),r.jsx("div",{className:`${l}-overlayAnchor`,children:r.jsx("button",{type:s?"submit":"button",className:`${l}-submitBtn`,"aria-label":me,style:{...ce,...de,paddingRight:v.scalingValue(E.right,t),paddingLeft:v.scalingValue(E.left,t),paddingTop:v.scalingValue(E.top,t),paddingBottom:v.scalingValue(E.bottom,t),pointerEvents:s?"auto":void 0},children:b==="submitting"?"...":G?Se&&r.jsx(on,{url:Se,className:`${l}-submitBtnIcon`,style:{maxWidth:v.scalingValue(V??0,t)},fill:`var(--${l}-button-text-color)`,hoverFill:`var(--${l}-button-text-color)`}):we})})]}),$e==="success"&&r.jsx("p",{className:`${l}-success`,style:{...be},children:q}),$e==="error"&&r.jsx("p",{className:`${l}-error`,style:{...be},role:"alert",children:le??oe??Y})]})},Gp={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"},qp=["hover","focus","filled","success","error"],Kp=`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';
|
|
@@ -1557,7 +1557,7 @@ const COLOR_VAR_MAP: Record<OnelinerColorKeys, string> = {
|
|
|
1557
1557
|
};
|
|
1558
1558
|
|
|
1559
1559
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
1560
|
-
`,Bp="data:image/svg+xml,"+encodeURIComponent('<svg width="23px" height="20px" viewBox="0 0 23 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Newsletter" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Tutorials-pop-up-Copy-12" transform="translate(-43, -687)" fill="#FFFFFF" fill-rule="nonzero"><path d="M66,697 C66,697.552285 65.5522847,698 65,698 L44,698 C43.4477153,698 43,697.552285 43,697 C43,696.447715 43.4477153,696 44,696 L65,696 C65.5522847,696 66,696.447715 66,697 Z M55.6689647,687.256706 L65.6689647,696.256706 C66.1103451,696.653948 66.1103451,697.346052 65.6689647,697.743294 L55.6689647,706.743294 C55.2584547,707.112753 54.6261649,707.079475 54.2567059,706.668965 C53.8872468,706.258455 53.9205252,705.626165 54.3310353,705.256706 L63.5051529,697 L54.3310353,688.743294 C53.9205252,688.373835 53.8872468,687.741545 54.2567059,687.331035 C54.6261649,686.920525 55.2584547,686.887247 55.6689647,687.256706 Z" id="Combined-Shape"></path></g></g></svg>'),Dp=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."}],Nr={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Vp=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],Gp={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:3},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},buttonIcon:{type:"object",scope:"common",title:"Button Icon",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},iconMaxWidth:{type:"number",scope:"common",title:"Icon Max Width",display:{type:"full-width-input"},min:0,max:1},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"Input Padding",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"Button Padding",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"numeric-input"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},strokeColor:{type:"string",scope:"common",title:"Stroke All",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"common"},inputFontSettings:{...Nr.fontSettings,scope:"common",title:"Input"},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...Nr.fontSettings,scope:"common",title:"Button"},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},statusFontSettings:{...Nr.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fields:Dp,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:Bp},fontFamily:"Arial",strokeColor:"#000000",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#000000",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{hover:{buttonColor:"#33A2F2"}},inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{minHeight:.1,iconMaxWidth:.1,stroke:.001,corners:.0053,buttonPadding:{top:.02,right:.04,bottom:.02,left:.04},inputPadding:{top:.01,right:.03,bottom:.01,left:.03},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},t:{minHeight:.0651,iconMaxWidth:.1,stroke:.001,corners:.0026,buttonPadding:{top:.02604,right:.02604,bottom:.02604,left:.02604},inputPadding:{top:.02604,right:.02604,bottom:.02604,left:.0182},inputFontSize:.0208,inputLineHeight:.02604,buttonFontSize:.0208,buttonLineHeight:.02604,statusFontSize:.0208,statusLineHeight:.02604},d:{minHeight:.028,iconMaxWidth:.028,stroke:.001,corners:.0027,buttonPadding:{right:.0175,left:.0175,top:.005,bottom:.004},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.009,buttonLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSettings.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSize.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLineHeight.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLetterSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonWordSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonTextAppearance.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"Off"},then:{name:"properties.iconMaxWidth.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["fieldsToShow","minHeight"]},{type:"row",items:["corners","stroke"]},{type:"row",title:"",items:["inputPadding","buttonPadding"]},{type:"row",title:"",items:["buttonIcon"]},"iconMaxWidth"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__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:["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:[...Vp],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","placeholderColor","inputColor","buttonTextColor","buttonColor"],hover:["strokeColor","inputColor","buttonTextColor","buttonColor"],focus:["strokeColor","inputTextColor","buttonTextColor","buttonColor"],filled:["strokeColor","inputColor","inputTextColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},qp={element:Hp,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Single_Line.png"},defaultSize:{d:{width:400},t:{width:500},m:{width:340}},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",statusFontSettings:"fontFamily"},schema:Gp,sourceCode:zp};function Kp(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
1560
|
+
`,Up="data:image/svg+xml,"+encodeURIComponent('<svg width="23px" height="20px" viewBox="0 0 23 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Newsletter" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Tutorials-pop-up-Copy-12" transform="translate(-43, -687)" fill="#FFFFFF" fill-rule="nonzero"><path d="M66,697 C66,697.552285 65.5522847,698 65,698 L44,698 C43.4477153,698 43,697.552285 43,697 C43,696.447715 43.4477153,696 44,696 L65,696 C65.5522847,696 66,696.447715 66,697 Z M55.6689647,687.256706 L65.6689647,696.256706 C66.1103451,696.653948 66.1103451,697.346052 65.6689647,697.743294 L55.6689647,706.743294 C55.2584547,707.112753 54.6261649,707.079475 54.2567059,706.668965 C53.8872468,706.258455 53.9205252,705.626165 54.3310353,705.256706 L63.5051529,697 L54.3310353,688.743294 C53.9205252,688.373835 53.8872468,687.741545 54.2567059,687.331035 C54.6261649,686.920525 55.2584547,686.887247 55.6689647,687.256706 Z" id="Combined-Shape"></path></g></g></svg>'),Xp=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."}],_r={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Yp=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],Zp={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:3},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},buttonIcon:{type:"object",scope:"common",title:"Button Icon",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},iconMaxWidth:{type:"number",scope:"common",title:"Icon Max Width",display:{type:"full-width-input"},min:0,max:1},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"Input Padding",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"Button Padding",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"numeric-input"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},strokeColor:{type:"string",scope:"common",title:"Stroke All",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"common"},inputFontSettings:{..._r.fontSettings,scope:"common",title:"Input"},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{..._r.fontSettings,scope:"common",title:"Button"},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},statusFontSettings:{..._r.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fields:Xp,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:Up},fontFamily:"Arial",strokeColor:"#000000",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#000000",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{hover:{buttonColor:"#33A2F2"}},inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{minHeight:.1,iconMaxWidth:.1,stroke:.001,corners:.0053,buttonPadding:{top:.02,right:.04,bottom:.02,left:.04},inputPadding:{top:.01,right:.03,bottom:.01,left:.03},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},t:{minHeight:.0651,iconMaxWidth:.1,stroke:.001,corners:.0026,buttonPadding:{top:.02604,right:.02604,bottom:.02604,left:.02604},inputPadding:{top:.02604,right:.02604,bottom:.02604,left:.0182},inputFontSize:.0208,inputLineHeight:.02604,buttonFontSize:.0208,buttonLineHeight:.02604,statusFontSize:.0208,statusLineHeight:.02604},d:{minHeight:.028,iconMaxWidth:.028,stroke:.001,corners:.0027,buttonPadding:{right:.0175,left:.0175,top:.005,bottom:.004},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.009,buttonLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSettings.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSize.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLineHeight.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLetterSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonWordSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonTextAppearance.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"Off"},then:{name:"properties.iconMaxWidth.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["fieldsToShow","minHeight"]},{type:"row",items:["corners","stroke"]},{type:"row",title:"",items:["inputPadding","buttonPadding"]},{type:"row",title:"",items:["buttonIcon"]},"iconMaxWidth"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__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:["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:[...Yp],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","placeholderColor","inputColor","buttonTextColor","buttonColor"],hover:["strokeColor","inputColor","buttonTextColor","buttonColor"],focus:["strokeColor","inputTextColor","buttonTextColor","buttonColor"],filled:["strokeColor","inputColor","inputTextColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},Jp={element:Vp,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Single_Line.png"},defaultSize:{d:{width:400},t:{width:500},m:{width:340}},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",statusFontSettings:"fontFamily"},schema:Zp,sourceCode:Kp};function Qp(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
1561
1561
|
.${e}-marquee-wrapper {
|
|
1562
1562
|
overflow: hidden;
|
|
1563
1563
|
width: 100%;
|
|
@@ -1689,7 +1689,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1689
1689
|
.${e}-image-hover-grayscale:hover video {
|
|
1690
1690
|
filter: grayscale(100%);
|
|
1691
1691
|
}
|
|
1692
|
-
`}const
|
|
1692
|
+
`}const em=30,tm=20,Hr=3,nm=12,im=32,om=3,rm=e=>{e.style.setProperty("animation-name","none"),e.style.setProperty("-webkit-animation-name","none"),e.offsetHeight,e.style.removeProperty("animation-name"),e.style.removeProperty("-webkit-animation-name")},am=(e,t)=>Array.from({length:t},()=>e).flat(),lm=e=>typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"16:9",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"16:9",reversed:(e==null?void 0:e.reversed)??!1},Ys=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),hl=(e,t)=>{if(t<=0||e.children.length<t)return 0;const n=e.children[0],i=e.children[t-1];if(!n||!i)return 0;const o=getComputedStyle(e),l=Number.parseFloat(o.columnGap||o.gap||"0")||0,s=i.getBoundingClientRect().right-n.getBoundingClientRect().left;if(s>0)return s;const c=Array.from({length:t},(u,m)=>e.children[m]),d=Ys(c);return d<=0?0:d+l*Math.max(0,t-1)},sm=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=Ys(Array.from(e.children));if(i<=0)return 0;const o=getComputedStyle(e),l=Number.parseFloat(o.columnGap||o.gap||"0")||0,s=Number.parseFloat(o.paddingRight)||0;return i+l*Math.max(0,e.children.length-1)+s},cm=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},dm=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>cm(i,e))},um=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??"")},pm=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,mm=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:l,imageHoverClass:s,isFirstSet:c,scaled:d,onFirstSetImageDone:u})=>{var F,W,V,ne;const m=a.useRef(null),x=!!((F=e.image)!=null&&F.url&&um(e.image));a.useLayoutEffect(()=>{c&&pm(m.current)&&(u==null||u())},[c,(W=e.image)==null?void 0:W.url,u]);const w=n.display==="cover",$=n.ratioValue??"1:1",f=n.reversed??!1,[S,L]=$.split(":").map(Number),C=(f?L:S)/(f?S:L),J=i/C,k=J>o?o:J,U=J>o?o*C:i,I=d(U),R=d(k),T={borderRadius:d(l)},y=w?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...T}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:d(i),maxHeight:d(o),objectFit:"contain",...T},h=((V=e.image)==null?void 0:V.url)&&(x?r.jsx("video",{ref:X=>{m.current=X},src:e.image.url,style:y,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:c?u:void 0,onError:c?u:void 0}):r.jsx("img",{ref:X=>{m.current=X},src:e.image.url,alt:((ne=e.image)==null?void 0:ne.name)??"",style:y,onLoad:c?u:void 0,onError:c?u:void 0}));return r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...w?{width:I}:{width:"max-content",maxWidth:d(i),minWidth:0}},children:r.jsx("div",{className:s,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...w?{width:I,height:R,overflow:"hidden",...T}:{width:"max-content",maxWidth:d(i),height:d(o)}},children:h&&e.link?r.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:at(`${t}-marquee-link`,!w&&`${t}-marquee-link-contain`),children:h}):h})})},gm=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=v.useScopedStyles(),[s,c]=a.useState(0),d=s>0?Math.round(s):0,u=a.useMemo(()=>Qp(l,d),[l,d]),{speed:m,direction:x,pauseOnHover:w,gap:$,imageMaxWidth:f,imageMaxHeight:S,hoverEffect:L,cornerRadius:M=0}=e,A=a.useMemo(()=>lm(e.imageFit),[e.imageFit]),C=(t==null?void 0:t.length)??0,J=!!o,k=!n||!!i,U=k&&L!=="off"&&L!=="randomize"?`${l}-image-hover-${L}`:void 0,I=n?!!i:!0,T=((t==null?void 0:t.length)??0)>0&&(I||!!n),y=Math.max(0,m)*em,h=fe=>v.scalingValue(fe,n??!1),F=a.useRef(null),W=a.useRef(null),V=a.useRef(null),[ne,X]=a.useState(0),z=I&&w==="on",[H,_]=a.useState(!1),[E,q]=a.useState({}),Y=a.useRef(E);Y.current=E;const ee=a.useRef(null),N=a.useRef(0),pe=a.useRef(null),b=a.useMemo(()=>(t??[]).map(fe=>{var Pe;return((Pe=fe.image)==null?void 0:Pe.url)??""}).join("\0"),[t]),[ye,Q]=a.useState(Hr),xe=a.useMemo(()=>{const fe=t??[];return fe.length===0||!(I||!!n)?fe:am(fe,ye)},[t,I,ye,n]),$e=a.useMemo(()=>(t??[]).filter(fe=>{var Pe;return!!((Pe=fe.image)!=null&&Pe.url)}).length,[t]),oe=T?om:1;a.useLayoutEffect(()=>{N.current=0,q({}),ee.current=null,Q(Hr),c(0)},[b]),a.useEffect(()=>{if(!k||L!=="randomize")return;const fe=F.current;if(!fe)return;const Pe=G=>{q(me=>{const D=Array.from(G).filter(ae=>ae in me&&!dm(fe,ae));if(D.length===0)return me;const K={...me};return D.forEach(ae=>{delete K[ae]}),K})},ve=new IntersectionObserver(G=>{const me=new Set;for(const D of G){const K=D.target.dataset.marqueeItemIndex,ae=K!==void 0?Number(K):NaN;Number.isNaN(ae)||me.add(ae)}me.size>0&&Pe(me)},{root:fe,threshold:0});Object.keys(E).forEach(G=>{const me=Number(G);fe.querySelectorAll(`[data-marquee-item-index="${me}"]`).forEach(D=>ve.observe(D))});const we={current:0},Se=()=>{const G=Object.keys(Y.current);G.length!==0&&(Pe(G.map(Number)),we.current=requestAnimationFrame(Se))};return Object.keys(Y.current).length>0&&(we.current=requestAnimationFrame(Se)),()=>{cancelAnimationFrame(we.current),ve.disconnect()}},[L,E,k]),a.useLayoutEffect(()=>{if(!T)return;const fe=F.current,Pe=V.current;if(!fe||!Pe)return;const ve={current:0},we=()=>{const me=fe.getBoundingClientRect().width||fe.offsetWidth,D=sm(Pe),K=ee.current,ae=typeof K=="number"&&Math.abs(K-D)<=.25;ee.current=D;let ge=ye,ce=0;if((I||n)&&C>0&&me>0){const Z=hl(Pe,C);if(Z>=im){ce=Z;const de=Math.min(nm,Math.max(Hr,Math.ceil(me/Z)+1));ge=de,de!==ye&&Q(de)}}const Ee=ge!==ye&&ce>0?ce*ge:D>0?D:ce>0?ce*ge:(()=>{const Z=hl(Pe,C);return Z>0?Z*ge:0})();Ee>0?c(Z=>Z<=0?Ee:!ae||Math.round(Z)===Math.round(Ee)?Z:Ee):!ae&&s<=0&&(cancelAnimationFrame(ve.current),ve.current=requestAnimationFrame(we))},Se=()=>{cancelAnimationFrame(ve.current),ve.current=requestAnimationFrame(we)};pe.current=Se,Se();const G=new ResizeObserver(Se);return G.observe(fe),G.observe(Pe),()=>{pe.current=null,cancelAnimationFrame(ve.current),G.disconnect()}},[I,T,s,b,ye,C,n]),a.useLayoutEffect(()=>{if(!T||d<=0)return;const fe=W.current;fe&&rm(fe)},[T,d,x,y]),a.useLayoutEffect(()=>{if(!T||s<=0){X(0);return}const fe=W.current,Pe=V.current;if(!fe||!Pe)return;const ve=()=>{const Se=fe.offsetHeight||fe.getBoundingClientRect().height,G=Array.from(Pe.children).reduce((D,K)=>Math.max(D,K.offsetHeight||K.getBoundingClientRect().height),0),me=Se>0?Se:G;X(me>0?me:0)};ve();const we=new ResizeObserver(ve);return we.observe(fe),we.observe(Pe),()=>we.disconnect()},[T,oe,xe,n,$,f,S,s,A,E]),a.useLayoutEffect(()=>{if(!n||!J||!T||typeof window>"u")return;const fe=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(fe)},[n,J,T,x,s,ne,$,xe]);const ie=()=>{z&&_(!0)},B=()=>{z&&_(!1)},le=a.useCallback(()=>{var fe;N.current=Math.min($e,N.current+1),(fe=pe.current)==null||fe.call(pe)},[$e]),re=a.useCallback((fe,Pe)=>{q(ve=>{const we=ve[fe]??Pe,Se=(t??[]).filter(me=>me!==we);if(Se.length===0)return ve;const G=Se[Math.floor(Math.random()*Se.length)];return{...ve,[fe]:G}})},[t]),ke=(fe,Pe,ve,we)=>{const Se=k&&L==="randomize"&&A.display==="cover"?E[ve]??fe:fe,G=`max(${h($)}, ${tm}px)`,me=`calc(-0.5 * (${G} + ${h($)}))`;return r.jsxs("div",{className:`${l}-marquee-card`,"data-marquee-item-index":ve,onMouseEnter:k&&L==="randomize"&&A.display==="cover"?()=>re(ve,fe):void 0,children:[r.jsx(mm,{item:Se,prefix:l,imageFit:A,imageMaxWidth:f,imageMaxHeight:S,cornerRadius:M,imageHoverClass:U,isEditor:n,isFirstSet:we,scaled:h,onFirstSetImageDone:le}),J&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${l}-gap-control`,style:{position:"absolute",top:0,right:me,width:G,height:"100%"}})]},`${Pe}-${ve}`)};if(T){const fe=I?z&&H?"paused":"running":"paused",Pe=d>0&&y>0?d/y*1e3:0,ve=`${Math.max(0,Pe)/1e3}s`;return r.jsxs("div",{ref:F,className:at(`${l}-wrapper`,`${l}-marquee-wrapper`),"aria-label":"Marquee",style:ne>0?{height:ne}:void 0,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),r.jsx("div",{ref:W,className:`${l}-marquee-track`,"data-direction":x,onMouseEnter:ie,onMouseLeave:B,style:{WebkitAnimationDuration:ve,animationDuration:ve,WebkitAnimationPlayState:fe,animationPlayState:fe},children:Array.from({length:oe},(we,Se)=>r.jsx("div",{ref:Se===0?V:void 0,className:at(`${l}-marquee-row`,`${l}-marquee-set`),style:{gap:h($),paddingRight:h($)},"aria-hidden":Se>0,children:xe.map((G,me)=>ke(G,Se,me,Se===0&&me<C))},`set-${Se}`))})]})}return r.jsxs("div",{ref:F,className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),r.jsx("div",{className:at(`${l}-marquee-row`,`${l}-marquee-static`),style:{gap:h($),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((fe,Pe)=>ke(fe,0,Pe))},"marquee-static")]})},hm=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
1693
1693
|
import cn from 'classnames';
|
|
1694
1694
|
import { CommonComponentProps } from '../props';
|
|
1695
1695
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -2472,7 +2472,7 @@ type MarqueeProps = {
|
|
|
2472
2472
|
isPreviewMode?: boolean;
|
|
2473
2473
|
isEditMode?: boolean;
|
|
2474
2474
|
} & CommonComponentProps;
|
|
2475
|
-
`,
|
|
2475
|
+
`,fm={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:7},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},hoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["off","brightness","grayscale"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,display:{type:"numeric-input"}},imageMaxWidth:{type:"number",scope:"layout",title:"Max width",min:10,display:{type:"numeric-input"}},imageMaxHeight:{type:"number",scope:"layout",title:"Max height",min:10,display:{type:"numeric-input"}},imageFit:{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"}}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",min:0,display:{type:"numeric-input"}}},defaults:{direction:"left",pauseOnHover:"off",hoverEffect:"off",imageFit:{display:"fit",ratioValue:"16:9",reversed:!1}},layoutDefaults:{m:{speed:.55,gap:.04,imageMaxWidth:.8,imageMaxHeight:.8,cornerRadius:0},t:{speed:1.64,gap:.02,imageMaxWidth:.5208,imageMaxHeight:.5208,cornerRadius:0},d:{speed:1.64,gap:.02,imageMaxWidth:.208,imageMaxHeight:.278,cornerRadius:0}},displayRules:[{if:{name:"imageFit.display",value:"cover"},then:{name:"properties.hoverEffect.display.enum",value:["off","brightness","grayscale","randomize"]}}],layout:["__componentName__","speed","direction","pauseOnHover","hoverEffect","gap","imageMaxWidth","imageMaxHeight","imageFit","cornerRadius"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["direction"]},{type:"row",items:["speed","imageFit"]},{type:"row",items:["imageMaxWidth","imageMaxHeight"]},{type:"row",items:["cornerRadius"]},{type:"row",title:"Hover Settings",items:[{type:"row",title:"",items:["hoverEffect","pauseOnHover"]}]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0,allowsVideo:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]}}},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:""},link:""}]}},ym={element:gm,id:"marquee",name:"Simple Marquee",category:"galleries",version:1,defaultSize:{d:{width:"100%"},t:{width:"100%"},m:{width:"100%"}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple_Marquee.mp4"},schema:fm,sourceCode:hm,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}};function fl(e){return`
|
|
2476
2476
|
.${e}-marquee-wrapper {
|
|
2477
2477
|
overflow: hidden;
|
|
2478
2478
|
width: 100%;
|
|
@@ -2559,7 +2559,7 @@ type MarqueeProps = {
|
|
|
2559
2559
|
pointer-events: auto;
|
|
2560
2560
|
z-index: 10;
|
|
2561
2561
|
}
|
|
2562
|
-
`}const
|
|
2562
|
+
`}const vm=30,yl=2,bm=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=v.useScopedStyles(),{align:s,speed:c,direction:d,pauseOnHover:u,gap:m,cardWidth:x,corners:w,stroke:$,strokeColor:f,bgColor:S,padding:L,logoMarginTop:M,logoWidth:A,logoHeight:C,captionMarginTop:J}=e,k=!!o,U=((t==null?void 0:t.length)??0)>0,I=c>0&&(!n||i),R=U&&(I||n),T=Math.max(0,c)*vm,y=D=>v.scalingValue(D,n??!1),h=a.useRef(null),F=a.useRef(null),W=a.useRef(null),[V,ne]=a.useState(0),[X,z]=a.useState(0),[H,_]=a.useState(0),E=I&&u==="on",[q,Y]=a.useState(!1),ee=a.useRef(null),[N,pe]=a.useState(0),[b,ye]=a.useState(0),Q=a.useRef(null),xe=D=>{var ae,ge,ce,be,Ee;return{fontSettings:{fontFamily:(e==null?void 0:e[`${D}FontFamily`])??"Arial",fontWeight:((ae=e==null?void 0:e[`${D}FontSettings`])==null?void 0:ae.fontWeight)??400,fontStyle:((ge=e==null?void 0:e[`${D}FontSettings`])==null?void 0:ge.fontStyle)??"normal"},textAppearance:{textTransform:((ce=e==null?void 0:e[`${D}TextAppearance`])==null?void 0:ce.textTransform)??"none",textDecoration:((be=e==null?void 0:e[`${D}TextAppearance`])==null?void 0:be.textDecoration)??"none",fontVariant:((Ee=e==null?void 0:e[`${D}TextAppearance`])==null?void 0:Ee.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${D}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${D}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${D}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${D}LineHeight`])??.01,color:(e==null?void 0:e[`${D}Color`])??"#000000"}},$e=xe("text"),oe=xe("caption"),ie=a.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(D=>{var K,ae;return(((K=D.text)==null?void 0:K.length)??0)>0||(((ae=D.caption)==null?void 0:ae.length)??0)>0}),[t]),B=a.useMemo(()=>!R||(t==null?void 0:t.length)===0?1:X<=0||V<=0?yl:Math.max(yl,Math.ceil(V/X)+1),[R,t==null?void 0:t.length,X,V]);a.useLayoutEffect(()=>{if(!R)return;const D=h.current,K=W.current;if(!D||!K)return;let ae=0;const ge=()=>{const Ee=D.getBoundingClientRect().width,Z=K.getBoundingClientRect().width,de=Q.current,We=typeof de=="number"&&Math.abs(de-Z)<=.25;if(Q.current=Z,ne(Ee),typeof Z=="number"&&Z>0&&X<=0){z(Z);return}We&&Z!==X?z(Z):!We&&X<=0&&(cancelAnimationFrame(ae),ae=requestAnimationFrame(ge))},ce=()=>{cancelAnimationFrame(ae),ae=requestAnimationFrame(ge)};ce();const be=new ResizeObserver(ce);return be.observe(D),be.observe(K),()=>{cancelAnimationFrame(ae),be.disconnect()}},[I,R,X]),a.useLayoutEffect(()=>{const D=F.current;if(!R||!D)return;const K=X>0?X:0,ae=K>0&&T>0?K/T*1e3:0,ge=`${Math.max(0,ae)/1e3}s`;D.style.setProperty("--marquee-distance",`${K}px`),D.style.setProperty("--marquee-duration",ge)},[I,R,T,X]),a.useLayoutEffect(()=>{if(!R){_(0);return}const D=W.current,K=F.current;if(!D||!K)return;const ae=()=>{let ce=0;for(let be=0;be<D.children.length;be++){const Z=D.children[be].firstElementChild;Z&&(ce=Math.max(ce,Z.offsetHeight))}ce<=0&&(ce=K.offsetHeight),_(ce>0?ce:0)};ae();const ge=new ResizeObserver(ae);return ge.observe(D),ge.observe(K),()=>{ge.disconnect()}},[R,B,t,n,m,x,L,$,w,A,C,N,b]);const le=()=>{E&&Y(!0)},re=()=>{E&&Y(!1)},ke=a.useMemo(()=>{switch(s){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[s]),fe=a.useMemo(()=>{switch(s){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[s]),Pe=a.useCallback((D,K,ae,ge)=>r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ke,width:"100%"},children:[r.jsx("div",{"data-controls":k?ge==null?void 0:ge.controlsName:void 0,"data-controls-axis":k?"y":void 0,className:k?`${l}-control`:void 0,style:{height:y((ge==null?void 0:ge.marginTop)??0)}}),r.jsx("div",{...ge!=null&&ge.dataMeasureKind?{"data-testimonial-measure":ge.dataMeasureKind}:{},style:{...Xt(D,n),textAlign:fe,pointerEvents:"auto",...typeof(ge==null?void 0:ge.minHeightPx)=="number"&&ge.minHeightPx>0?{minHeight:ge.minHeightPx}:{}},children:r.jsx(mi,{content:K})})]},ae),[ke,fe,n,k,l,y]),ve=a.useCallback((D,K,ae)=>{var ge,ce,be;return r.jsxs("div",{style:{padding:`${y(L.top)} ${y(L.right)} ${y(L.bottom)} ${y(L.left)}`,width:y(x+$*2),height:"100%",borderRadius:y(w),border:`${y($)} solid ${f}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[r.jsx("div",{className:`${l}-cover`,style:{background:S}}),r.jsxs("div",{className:`${l}-elements-overlay`,style:{alignItems:ke,textAlign:fe},children:[D.text&&Pe($e,D.text,"text",ae!=null&&ae.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(ae==null?void 0:ae.textMinHeightPx)=="number"&&ae.textMinHeightPx>0?{minHeightPx:ae.textMinHeightPx}:void 0),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ke,width:"100%"},children:[r.jsx("div",{"data-controls":k&&!(ae!=null&&ae.dataMeasureAttrs)?"logoMarginTop":void 0,className:k&&!(ae!=null&&ae.dataMeasureAttrs)?`${l}-control`:void 0,style:{height:y(M)}}),r.jsx("div",{style:{width:y(A),height:y(C)},children:((ge=D.logo)==null?void 0:ge.url)&&r.jsx("img",{src:D.logo.url,alt:((ce=D.logo)==null?void 0:ce.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((be=D.logo)==null?void 0:be.objectFit)||"contain"}})})]}),D.caption&&Pe(oe,D.caption,"caption",{...ae!=null&&ae.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:J,...ae!=null&&ae.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(ae==null?void 0:ae.captionMinHeightPx)=="number"&&ae.captionMinHeightPx>0?{minHeightPx:ae.captionMinHeightPx}:{}})]})]},K)},[S,J,oe,x,w,C,M,A,ke,fe,L.bottom,L.left,L.right,L.top,Pe,$,f,$e,n,k,l]),we=a.useCallback(D=>{pe(D.maxTextPx),ye(D.maxCaptionPx)},[]);a.useLayoutEffect(()=>{if(!ie){we({maxTextPx:0,maxCaptionPx:0});return}const D=ee.current;if(!D)return;const K=()=>{v.readTestimonialTextMeasure(D,we)};K();const ae=new ResizeObserver(K);return ae.observe(D),()=>{ae.disconnect()}},[ie,we,t,ve]);const Se=ie?{textMinHeightPx:N,captionMinHeightPx:b}:void 0,G=ie?r.jsx("div",{ref:ee,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((D,K)=>ve(D,`measure-${K}`,{dataMeasureAttrs:!0}))}):null,me=(D,K)=>r.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[ve(D,`card-${K}`,Se),k&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${y(m)})`,width:y(m),height:"100%",pointerEvents:"auto",zIndex:2}})]},K);if(R){const D=I?E&&q?"paused":"running":"paused";return r.jsxs("div",{ref:h,className:at(`${l}-wrapper`,`${l}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...H>0?{height:H}:{}},children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:fl(l)}}),G,r.jsx("div",{ref:F,className:`${l}-marquee-track`,"data-direction":d,onMouseEnter:le,onMouseLeave:re,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":D},children:Array.from({length:B},(K,ae)=>r.jsx("div",{ref:ae===0?W:void 0,className:`${l}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:y(m),paddingRight:y(m)},"aria-hidden":ae>0,children:t==null?void 0:t.map((ge,ce)=>me(ge,`${ae}-${ce}`))},`set-${ae}`))})]})}return r.jsxs("div",{className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:fl(l)}}),G,r.jsx("div",{style:{gap:y(m),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((D,K)=>me(D,K))})]})},xm=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
2563
2563
|
import cn from 'classnames';
|
|
2564
2564
|
import { CommonComponentProps } from '../props';
|
|
2565
2565
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -3174,7 +3174,7 @@ type TestimonialsSettings = {
|
|
|
3174
3174
|
logoHeight: number;
|
|
3175
3175
|
captionMarginTop: number;
|
|
3176
3176
|
};
|
|
3177
|
-
`,
|
|
3177
|
+
`,vl={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},wm={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-cycle",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:"Text Default",display:{type:"palette-color-picker"}},captionColor:{type:"string",scope:"common",title:"Caption Default",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:{...vl.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:{...vl.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:.069,textLineHeight:.093,captionFontSize:.053,captionLineHeight:.069},t:{speed:1.64,gap:.02,cardWidth:.44,corners:.005,stroke:.001,padding:{top:.01,right:.01,bottom:.065,left:.01},logoMarginTop:.1,logoWidth:.052,logoHeight:.052,captionMarginTop:.005,textFontSize:.035,textLineHeight:.04,captionFontSize:.023,captionLineHeight:.029},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"}]}]}]}},Sm={element:bm,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:wm,sourceCode:xm,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function $m(e){return`
|
|
3178
3178
|
.${e}-container {
|
|
3179
3179
|
position: relative;
|
|
3180
3180
|
overflow-x: clip;
|
|
@@ -3298,7 +3298,7 @@ type TestimonialsSettings = {
|
|
|
3298
3298
|
width: 100%;
|
|
3299
3299
|
height: 100%;
|
|
3300
3300
|
}
|
|
3301
|
-
`}const
|
|
3301
|
+
`}const Cm=3e3,Tm=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=v.useScopedStyles(),s=t||[],{speed:c,align:d,width:u,imageMarginTop:m,textMarginTop:x,captionMarginTop:w,imageWidth:$,imageHeight:f,controlsWidth:S,controlsColor:L,controlsHoverColor:M}=e,A=c>0&&(!n||!!i),[C,J]=a.useState(0),[k,U]=a.useState(null),[I,R]=a.useState(!1),T=a.useRef(null),y=a.useMemo(()=>{switch(d){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[d]),h=a.useMemo(()=>{switch(d){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[d]);a.useEffect(()=>{J(0),U(null),R(!1)},[s.length]);const F=s[C],W=k===null?null:s[k],V=oe=>{var B,le,re,ke,fe;return{fontSettings:{fontFamily:(e==null?void 0:e[`${oe}FontFamily`])??"Arial",fontWeight:((B=e==null?void 0:e[`${oe}FontSettings`])==null?void 0:B.fontWeight)??400,fontStyle:((le=e==null?void 0:e[`${oe}FontSettings`])==null?void 0:le.fontStyle)??"normal"},textAppearance:{textTransform:((re=e==null?void 0:e[`${oe}TextAppearance`])==null?void 0:re.textTransform)??"none",textDecoration:((ke=e==null?void 0:e[`${oe}TextAppearance`])==null?void 0:ke.textDecoration)??"none",fontVariant:((fe=e==null?void 0:e[`${oe}TextAppearance`])==null?void 0:fe.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"}},ne=V("text"),X=V("caption"),z=s.length>1&&s.some(oe=>{var ie,B;return(((ie=oe.text)==null?void 0:ie.length)??0)>0||(((B=oe.caption)==null?void 0:B.length)??0)>0}),H=a.useRef(null),[_,E]=a.useState(0),[q,Y]=a.useState(0),ee=e.controls??{mode:"Off",icon:null},N=s.length>1,pe=a.useCallback((oe,ie)=>!N||ie===oe?oe:(T.current&&window.clearTimeout(T.current),U(oe),R(!0),T.current=window.setTimeout(()=>{U(null),R(!1),T.current=null},300),ie),[N]),b=a.useCallback(()=>{N&&J(oe=>pe(oe,(oe-1+s.length)%s.length))},[N,pe,s.length]),ye=a.useCallback(()=>{N&&J(oe=>pe(oe,(oe+1)%s.length))},[N,pe,s.length]);a.useEffect(()=>{if(!A||!N)return;const oe=Math.max(300,Cm/c),ie=window.setInterval(()=>{J(B=>pe(B,(B+1)%s.length))},oe);return()=>{window.clearInterval(ie)}},[A,N,pe,s.length,c]),a.useEffect(()=>()=>{T.current&&window.clearTimeout(T.current)},[]);const Q=(oe,ie)=>{var fe,Pe,ve,we;const B=ie==null?void 0:ie.textMinHeightPx,le=ie==null?void 0:ie.captionMinHeightPx,re=ie==null?void 0:ie.dataMeasureAttrs,ke=o&&!(ie!=null&&ie.dataMeasureAttrs)&&!(ie!=null&&ie.hideControls);return r.jsxs(r.Fragment,{children:[oe.text&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:y,width:"100%"},children:[r.jsx("div",{"data-controls":ke?"textMarginTop":void 0,className:ke?`${l}-control`:void 0,style:{height:v.scalingValue(x??0,n??!1)}}),r.jsx("div",{...re&&{"data-testimonial-measure":"text"},style:{...Xt(ne,n),...B&&B>0?{minHeight:B}:{},textAlign:h,pointerEvents:"auto"},children:r.jsx(mi,{content:oe.text})})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:y,width:"100%"},children:[r.jsx("div",{"data-controls":ke?"imageMarginTop":void 0,className:ke?`${l}-control`:void 0,style:{height:v.scalingValue(m??0,n??!1)}}),r.jsx("div",{style:{width:v.scalingValue($??0,n??!1),height:v.scalingValue(f??0,n??!1)},children:((fe=oe.image)==null?void 0:fe.url)&&r.jsx("img",{src:(Pe=oe.image)==null?void 0:Pe.url,alt:((ve=oe.image)==null?void 0:ve.name)??"",className:`${l}-icon`,style:{objectFit:((we=oe.image)==null?void 0:we.objectFit)||"contain"}})})]}),oe.caption&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:y,width:"100%"},children:[r.jsx("div",{"data-controls":ke?"captionMarginTop":void 0,className:ke?`${l}-control`:void 0,style:{height:v.scalingValue(w??0,n??!1)}}),r.jsx("div",{...re?{"data-testimonial-measure":"caption"}:{},style:{...Xt(X,n),...le&&le>0?{minHeight:le}:{},textAlign:h,pointerEvents:"auto"},children:r.jsx(mi,{content:oe.caption})})]})]})},xe=a.useCallback(oe=>{E(oe.maxTextPx),Y(oe.maxCaptionPx)},[]);if(a.useLayoutEffect(()=>{if(!z){xe({maxTextPx:0,maxCaptionPx:0});return}const oe=H.current;if(!oe)return;const ie=()=>{v.readTestimonialTextMeasure(oe,xe)};ie();const B=new ResizeObserver(ie);return B.observe(oe),()=>{B.disconnect()}},[z,xe,t]),!F)return r.jsx(r.Fragment,{});const $e=z?{textMinHeightPx:_,captionMinHeightPx:q}:void 0;return r.jsx(r.Fragment,{children:r.jsxs("div",{className:`${l}-container`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:$m(l)}}),r.jsxs("div",{className:`${l}-wrapper`,style:{width:v.scalingValue(u??0,n??!1),alignItems:y},children:[z&&r.jsx("div",{ref:H,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:s.map((oe,ie)=>r.jsx("div",{style:{width:"100%"},children:Q(oe,{dataMeasureAttrs:!0})},ie))}),r.jsxs("div",{className:`${l}-fade-stack`,children:[W&&I&&r.jsx("div",{className:at(`${l}-fade-item-prev`,`${l}-fade-out`),children:Q(W,{...$e,hideControls:!0})}),r.jsx("div",{className:at(`${l}-fade-item-current`,I?`${l}-fade-in`:void 0),children:Q(F,$e)})]})]}),ee.mode==="On"&&r.jsxs("div",{className:`${l}-controls`,children:[r.jsx("div",{className:`${l}-arrow`,style:{width:v.scalingValue(S??.02,n??!1),height:v.scalingValue(S??.02,n??!1),"--arrow-hover-color":M},children:r.jsx("button",{type:"button",className:`${l}-arrow-inner`,onClick:b,disabled:!N,"aria-label":"Previous testimonial",children:ee.icon&&r.jsx(on,{url:ee.icon,fill:L,hoverFill:M,className:at(`${l}-arrow-img`,`${l}-mirror`)})})}),r.jsx("div",{className:at(`${l}-arrow`,`${l}-next-arrow`),style:{width:v.scalingValue(S??.02,n??!1),height:v.scalingValue(S??.02,n??!1),"--arrow-hover-color":M},children:r.jsx("button",{type:"button",className:`${l}-arrow-inner`,onClick:ye,disabled:!N,"aria-label":"Next testimonial",children:ee.icon&&r.jsx(on,{url:ee.icon,fill:L,hoverFill:M,className:`${l}-arrow-img`})})})]})]})})},Lm=`import cn from 'classnames';
|
|
3302
3302
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3303
3303
|
import { CommonComponentProps } from '../props';
|
|
3304
3304
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -3794,12 +3794,12 @@ type TestimonialsSettings = {
|
|
|
3794
3794
|
icon?: string | null;
|
|
3795
3795
|
};
|
|
3796
3796
|
};
|
|
3797
|
-
`,
|
|
3797
|
+
`,Im="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>'),bl={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Rm={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:"Controls Default",display:{type:"settings-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"settings-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...bl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},captionColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Caption Default"},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...bl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Text Default"}},defaults:{controls:{mode:"On",icon:Im},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},t:{speed:1,width:.65,imageMarginTop:.026,captionMarginTop:.01,textMarginTop:0,textFontSize:.035,captionFontSize:.023,textLineHeight:.04,captionLineHeight:.029,imageWidth:.05,imageHeight:.05,controlsWidth:.026},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"}]}]}]}},Em={element:Tm,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},t:{width:700},m:{width:334}},schema:Rm,sourceCode:Lm,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function Mm(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function xl(e){return((e==null?void 0:e.trim().length)??0)>0}function Nr(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Or(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:v.scalingValue((o-t)/2,i)}}function km(e){return`
|
|
3798
3798
|
.${e}-wrapper {
|
|
3799
3799
|
display: grid;
|
|
3800
3800
|
align-items: start;
|
|
3801
3801
|
justify-content: center;
|
|
3802
|
-
min-height: ${
|
|
3802
|
+
min-height: ${Mm(48)};
|
|
3803
3803
|
}
|
|
3804
3804
|
.${e}-item {
|
|
3805
3805
|
display: flex;
|
|
@@ -4137,7 +4137,7 @@ type TestimonialsSettings = {
|
|
|
4137
4137
|
z-index: 2;
|
|
4138
4138
|
width: 100%;
|
|
4139
4139
|
}
|
|
4140
|
-
`}const Rn=500,Lm=750,ni="cubic-bezier(0.22, 1, 0.36, 1)",Im=72,Rm=50;function Em(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function km(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Mm(e){const[t]=e.media;return t!=null&&t.url?t:null}function Pm(e){return!Array.isArray(e)||e.length===0?[]:Em(e)?e.flatMap(t=>{const n=km(t);if(!n)return[];const i=Mm(t);return[{displayMedia:n,lightboxMedia:i!=null&&i.url?i:null}]}):e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function to(e){return e.type==="video"}function Am(e){e.pause(),e.removeAttribute("src"),e.load()}function Sl({media:e,className:t,style:n,onMediaClick:i}){return to(e)?r.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):r.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function Wo(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Fm(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Wm({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:l,onMouseMove:s,onTransitionEnd:d}){return a.useEffect(()=>{const c=n.current;if(c)return()=>{Am(c)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:l,onMouseMove:s,onTransitionEnd:d,style:i})}function _m({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:l,onPrev:s,onNext:d,counterClassName:c,counterStyle:u}){const m=i==="cover",x=a.useRef(null),b=a.useRef(null),T=a.useRef(null),f=a.useRef(null),L=a.useRef(0),$=a.useRef(0),R=a.useRef("none"),E=a.useRef(!1),C=a.useRef(!1),U=a.useRef(!1),k=a.useRef(null),[j,I]=a.useState(null),[w,W]=a.useState("opening"),[h,S]=a.useState(0),[M,z]=a.useState(0),[K,le]=a.useState(!1),[Y,D]=a.useState(!1),[N,F]=a.useState(!1),A=a.useRef(n),q=t[n],G=q?to(q):!1,Z=M!==0||K,_=a.useCallback(X=>{U.current=X,le(X)},[]),me=a.useCallback(()=>{k.current!==null&&(window.clearTimeout(k.current),k.current=null)},[]),v=a.useCallback(()=>{me(),k.current=window.setTimeout(()=>{me(),_(!1)},Rn+32)},[me,_]),fe=a.useCallback(()=>{const X=b.current,ue=T.current;if(!X)return;const Se=X.getBoundingClientRect(),O=Se.width,ce=Se.height;if(!O||!ce)return;if(i==="cover"){I({width:O,height:ce,left:Se.left,top:Se.top});return}if(!ue){I(Wo(X));return}const{width:H,height:re}=Fm(ue);if(!H||!re){I(Wo(X));return}const ae=H/re,ne=O/ce;if(ae>ne){const ie=O/ae;I({width:O,height:ie,left:Se.left,top:Se.top+(ce-ie)/2})}else{const ie=ce*ae;I({width:ie,height:ce,left:Se.left+(O-ie)/2,top:Se.top})}},[i]);a.useEffect(()=>{fe();const X=b.current;if(!X)return;const ue=new ResizeObserver(()=>fe());return ue.observe(X),()=>ue.disconnect()},[fe,n]),a.useEffect(()=>{w==="opening"&&j&&W("open")},[w,j]),a.useEffect(()=>{if(w!=="closing")return;const X=setTimeout(()=>l(),Rn);return()=>clearTimeout(X)},[w,l]),a.useEffect(()=>()=>{me()},[me]),a.useLayoutEffect(()=>{if(A.current===n)return;me(),S(0),z(0),_(!1),F(!1),D(!1),L.current=0,$.current=0,R.current="none",E.current=!1,f.current=null,C.current=!1;const X=b.current;X&&I(Wo(X)),A.current=n},[n,_,me]),a.useEffect(()=>{if(w!=="open")return;let X=null;const ue=()=>{X&&(document.removeEventListener("click",X,!0),X=null)},Se=()=>{ue(),X=ne=>{ne.stopPropagation(),ne.preventDefault(),ue()},document.addEventListener("click",X,!0)},O=ne=>{me(),U.current=!1,le(!1),z(0),D(!1),E.current=!1,$.current=0,R.current="none";const ie=b.current;ie&&I(Wo(ie)),ne<0?d():s()},ce=ne=>{if(Math.abs(ne)>Rm&&t.length>1){O(ne);return}_(!0),z(0),v()},H=ne=>{if(ne.touches.length!==1||U.current)return;const ie=ne.touches[0];C.current=!0,f.current={x:ie.clientX,y:ie.clientY},R.current="none",$.current=0,E.current=!1},re=ne=>{if(!f.current||ne.touches.length!==1||U.current)return;const ie=ne.touches[0],be=ie.clientX-f.current.x,Ce=ie.clientY-f.current.y;if(R.current==="none"){if(Math.abs(be)<10&&Math.abs(Ce)<10)return;if(Math.abs(be)>Math.abs(Ce)){if(t.length<=1)return;R.current="horizontal"}else if(Ce>0)R.current="vertical";else return}if(R.current==="horizontal"){E.current=!0,D(!0),$.current=be,z(be),ne.preventDefault();return}R.current==="vertical"&&(E.current=!0,D(!0),L.current=Ce,S(Ce),ne.preventDefault())},ae=()=>{if(!f.current)return;const ne=R.current,ie=E.current;if(ie&&ne==="horizontal")ce($.current),Se();else if(ie&&ne==="vertical")if(L.current>Im){const Ce=window.innerHeight;L.current=Ce,F(!0),S(Ce),W("closing")}else L.current=0,S(0),Se();else ne==="horizontal"&&Math.abs($.current)>0&&(ce($.current),Se());f.current=null,R.current="none",$.current=0,E.current=!1,D(!1)};return document.addEventListener("touchstart",H,{passive:!0}),document.addEventListener("touchmove",re,{passive:!1}),document.addEventListener("touchend",ae),document.addEventListener("touchcancel",ae),()=>{document.removeEventListener("touchstart",H),document.removeEventListener("touchmove",re),document.removeEventListener("touchend",ae),document.removeEventListener("touchcancel",ae),ue()}},[w,t.length,d,s,_,v]),a.useEffect(()=>{const X=ue=>{ue.key==="Escape"&&(ue.preventDefault(),ue.stopPropagation(),w!=="closing"&&W("closing"))};return window.addEventListener("keydown",X,!0),()=>window.removeEventListener("keydown",X,!0)},[w]);const J=()=>{w!=="closing"&&W("closing")},de=w==="open",$e=w==="closing",oe=h>0?Math.max(0,1-h/500):1,xe=h>0?Math.max(.35,1-h/500):1,Q=X=>{if(X.stopPropagation(),C.current){C.current=!1;return}if(t.length<=1)return;const ue=X.currentTarget.getBoundingClientRect(),Se=X.clientY-ue.top,O=Math.min(52,ue.height*.2);if(!(Se>ue.height-O)){if(X.clientX-ue.left<ue.width/2){s();return}d()}},ye=X=>{if(t.length<=1)return;const ue=X.currentTarget.getBoundingClientRect(),Se=X.clientX-ue.left,O=X.clientY-ue.top,ce=Math.min(52,ue.height*.2);if(O>ue.height-ce){X.currentTarget.style.cursor="default";return}X.currentTarget.style.cursor=Se<ue.width/2?"w-resize":"e-resize"},ve=a.useCallback(X=>{X.propertyName!=="transform"||!U.current||(me(),_(!1))},[me,_]),ke=Z?`translateX(${M}px)`:h>0?`translateY(${h}px)`:void 0,we={position:"fixed",top:j==null?void 0:j.top,left:j==null?void 0:j.left,width:j==null?void 0:j.width,height:j==null?void 0:j.height,objectFit:i==="cover"?"cover":"contain",transform:ke,opacity:h>0?xe:w==="opening"||$e?0:1,transition:Y&&!K?"none":K?`transform ${Rn}ms ${ni}`:N?`transform ${Rn}ms ${ni}, opacity ${Rn}ms ${ni}`:w==="opening"||$e?`opacity ${Rn}ms ${ni}`:"none",pointerEvents:G&&de&&!Z?"auto":"none",touchAction:G&&de?"none":void 0,zIndex:9998},Me=j?{position:"fixed",top:j.top,height:j.height,width:j.width/2,zIndex:9999}:null;return r.jsxs("div",{ref:x,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:w==="open"?"none":void 0},onClick:J,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:de?oe:0,transition:Y?"none":`opacity ${Rn}ms ${ni}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:m?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:b,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:de?1:0,transition:`opacity ${Rn}ms ${ni}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.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:b,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:de?1:0,transition:`opacity ${Rn}ms ${ni}`},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),j&&q&&(G?r.jsx(Wm,{src:q.url,phase:w,mediaRef:T,mediaStyle:we,onLoadedMetadata:fe,onClick:Q,onMouseMove:ye,onTransitionEnd:ve},`${n}-${q.url}`):r.jsx("img",{ref:T,src:q.url,alt:q.name,onLoad:fe,onTransitionEnd:ve,style:we},`${n}-${q.url}`)),de&&Me&&t.length>1&&!G&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...Me,left:j.left,cursor:"w-resize",pointerEvents:Z?"none":"auto"},onClick:X=>{if(C.current){C.current=!1;return}X.stopPropagation(),s()}}),r.jsx("div",{style:{...Me,left:j.left+j.width/2,cursor:"e-resize",pointerEvents:Z?"none":"auto"},onClick:X=>{if(C.current){C.current=!1;return}X.stopPropagation(),d()}})]})]})}function Nm(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Hm({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:l,activeEvent:s,layoutId:d,portalId:c}){const{prefix:u}=y.useScopedStyles(),{type:m="a",gridLayout:x,textBoxWidth:b=100,verticalGap:T,entriesCount:f,lightbox:L,imageDisplay:$,lightboxImageDisplay:R,slider:E,sliderTiming:C,direction:U,transition:k,titleMarginTop:j,subtitleMarginTop:I,titleColor:w,subtitleColor:W,lightboxCounterColor:h,titleFontFamily:S,titleFontSettings:M,titleFontSize:z,titleLineHeight:K,titleLetterSpacing:le,titleWordSpacing:Y,titleTextAppearance:D,subtitleFontFamily:N,subtitleFontSettings:F,subtitleFontSize:A,subtitleLineHeight:q,subtitleLetterSpacing:G,subtitleWordSpacing:Z,subtitleTextAppearance:_,lightboxCounterFontFamily:me,lightboxCounterFontSettings:v,lightboxCounterFontSize:fe,lightboxCounterLineHeight:J,lightboxCounterLetterSpacing:de,lightboxCounterWordSpacing:$e,lightboxCounterTextAppearance:oe,showText:xe="always",alignEntries:Q="off",align:ye="top"}=e,ve={fontSettings:{fontFamily:S,fontWeight:(M==null?void 0:M.fontWeight)??400,fontStyle:(M==null?void 0:M.fontStyle)??"normal"},fontSize:z??.01,lineHeight:K,letterSpacing:le??0,wordSpacing:Y??0,textAppearance:D,color:w},we={...dn(Xt(ve,n))},Me={fontSettings:{fontFamily:N,fontWeight:(F==null?void 0:F.fontWeight)??400,fontStyle:(F==null?void 0:F.fontStyle)??"normal"},fontSize:A??.01,lineHeight:q,letterSpacing:G??0,wordSpacing:Z??0,textAppearance:_,color:W},ue={...dn(Xt(Me,n))},Se={fontSettings:{fontFamily:me,fontWeight:(v==null?void 0:v.fontWeight)??400,fontStyle:(v==null?void 0:v.fontStyle)??"normal"},fontSize:fe??.01,lineHeight:J,letterSpacing:de??0,wordSpacing:$e??0,textAppearance:oe,color:h},ce={...dn(Xt(Se,n)),...Or(fe,J,u,n)},H=jr(z,K,`${u}-item-title`,`${u}-text-tight-leading`),re=jr(A,q,`${u}-item-subtitle`,`${u}-text-tight-leading`),ae=Or(z,K,u,n),ne=Or(A,q,u,n),ie=jr(fe,J,`${u}-lightbox-counter`,`${u}-text-tight-leading`),be=y.buildColorVars(u,{titleColor:w,subtitleColor:W,lightboxCounterColor:h},jm,Om),pe=`${s&&s!=="default"?`${u}-state-${s}`:""}${xe==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),Ae=f===0?1/0:f,se=(t??[]).slice(0,Ae),V=x.entryWidth??.2,je=($==null?void 0:$.display)==="cover",We=($==null?void 0:$.ratioValue)??"1:1",et=($==null?void 0:$.reversed)??!1,[Ye,st]=We.split(":").map(Number),ot=`${et?st:Ye} / ${et?Ye:st}`,$t=x.columnsCount,rt=y.scalingValue(V??0,n),Ue=rt,ht=!je&&E!=="off",xt=se.length%$t||$t,dt=xt<$t&&se.length>0,kt=se.length-xt,_t=dt?Math.floor(($t-xt)/2)+1:1,Qe={width:Ue,...je?{aspectRatio:ot,height:"auto",overflow:"hidden"}:{height:"auto"}},Tt=`${u}-item-image-wrapper${ht?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),Lt=m==="d"||m==="e"||m==="f",Ge=Q==="on",qe=`calc(${y.scalingValue(V??0,n)} * (${b} / 100))`,Pe=y.scalingValue(V*b/100,n),gt=je?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},[It,Mt]=a.useState("ltr"),[Dt,en]=a.useState(0),on=a.useRef(null);a.useEffect(()=>{const ze=on.current;if(!ze)return;const ut=new ResizeObserver(_e=>{en(Math.round(_e[0].contentRect.width))});return ut.observe(ze),()=>ut.disconnect()},[]);const bt=(()=>{const ze={...be},ut=on.current?getComputedStyle(on.current).getPropertyValue("--cntrl-article-width").trim():"";return ut&&(ze["--cntrl-article-width"]=ut),ze})(),[Rt,Ut]=a.useState(!1),[Kt,ft]=a.useState([]),[Jt,Te]=a.useState(0),Oe=L==="on"&&(!n||i),Ke=(ze,ut)=>{n&&!i||L!=="off"&&(ft(ze),Te(ut),Ut(!0))};a.useEffect(()=>{if(!Rt||L!=="on"||typeof document>"u")return;const ze=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ze}},[Rt,L]),a.useEffect(()=>{!n||i||Ut(!1)},[n,i]);const Ne=a.useMemo(()=>Tm(u),[u]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ne}}),r.jsx("div",{style:be,children:r.jsx("div",{ref:on,className:`${u}-wrapper ${u}-type-${m}${Ge?` ${u}-align-entries`:""} ${u}-image-align-${ye} ${pe}`.trim(),style:{gridTemplateColumns:`repeat(${$t}, ${rt})`,rowGap:Ge?0:y.scalingValue(T??0,n),columnGap:y.scalingValue(x.horizontalGap??0,n),width:y.scalingValue(x.wrapperWidth??0,n),...Ge?{[`--${u}-align-entries-row-gap`]:y.scalingValue(T??0,n)}:{}},children:se.map((ze,ut)=>{var Gt;const _e=wl(ze.title),Je=wl(ze.subtitle),tt=(((Gt=ze.link)==null?void 0:Gt.length)??0)>0&&L==="off"?ze.link:void 0,Wt=Math.floor(ut/$t)===Math.ceil(se.length/$t)-1,Ct=dt&&ut>=kt?`${_t+(ut-kt)}`:void 0,lt=Lt?r.jsxs("div",{className:`${u}-item-text-block`,children:[_e&&r.jsx("p",{className:H,style:{width:qe,...we,...ae},children:ze.title}),_e&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:y.scalingValue(j??0,n),width:Pe}}),Je&&r.jsx("p",{className:re,style:{width:qe,...ue,...ne},children:ze.subtitle}),Je&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:y.scalingValue(I??0,n),width:Pe}})]}):null,Nt=Ge?r.jsxs("div",{className:`${u}-item-title-row`,children:[!Lt&&r.jsx("div",{"data-controls":o&&_e?"titleMarginTop":void 0,className:o&&_e?`${u}-control`:void 0,style:{height:_e?y.scalingValue(j??0,n):0,width:Pe}}),_e&&r.jsx("p",{className:H,style:{width:qe,...we,...ae},children:ze.title}),Lt&&_e&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:y.scalingValue(j??0,n),width:Pe}})]}):null,At=Ge?r.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!Lt&&r.jsx("div",{"data-controls":o&&Je?"subtitleMarginTop":void 0,className:o&&Je?`${u}-control`:void 0,style:{height:Je?y.scalingValue(I??0,n):0,width:Pe}}),Je&&r.jsx("p",{className:re,style:{width:qe,...ue,...ne},children:ze.subtitle}),Lt&&Je&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:y.scalingValue(I??0,n),width:Pe}})]}):null,Vt=tt?r.jsxs("a",{href:tt,target:"_blank",className:`${u}-item-text-link`,children:[Nt,At]}):r.jsxs(r.Fragment,{children:[Nt,At]}),zt=Pm(ze.gallery),Pt=zt.filter(pt=>pt.lightboxMedia).map(pt=>pt.lightboxMedia),Qt=r.jsx("div",{className:Tt,style:Qe,children:zt.length===0?null:E==="off"?(()=>{const{displayMedia:pt,lightboxMedia:Ft}=zt[0],Bt=Ft?Pt.findIndex(g=>g.url===Ft.url):-1;return r.jsx(Sl,{media:pt,className:`${u}-item-${to(pt)?"video":"image"}`.trim(),style:gt,onMediaClick:Oe&&Bt>=0?()=>Ke(Pt,Bt):void 0})})():r.jsxs(r.Fragment,{children:[ht&&Ge&&r.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:zt.map(({displayMedia:pt})=>to(pt)?r.jsx("video",{src:pt.url,muted:!0,playsInline:!0},`sizer-${pt.url}`):r.jsx("img",{src:pt.url,alt:""},`sizer-${pt.url}`))}),r.jsx(br,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:C*1e3,width:"100%",height:"100%",speed:Lm,type:k==="fade"?"fade":"loop",rewind:k==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:k==="fade"?"ltr":U!=="random"?U==="horizontal"?"ltr":"ttb":It},onMoved:pt=>{if(U!=="random"||k==="fade")return;const Ft=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";Mt(Ft),setTimeout(()=>{pt.refresh()},0)},children:zt.map(({displayMedia:pt,lightboxMedia:Ft},Bt)=>{const g=Ft?Pt.findIndex(ge=>ge.url===Ft.url):-1;return r.jsx(wr,{children:r.jsx(Sl,{media:pt,className:`${u}-item-${to(pt)?"video":"image"}`.trim(),style:gt,onMediaClick:Oe&&g>=0?()=>Ke(Pt,g):void 0})},Bt)})},`${k}-${V}-${U}-${C}-${Dt}-${d}`)]})}),wt=Lt?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&_e?"titleMarginTop":void 0,className:o&&_e?`${u}-control`:void 0,style:{height:_e?y.scalingValue(j??0,n):0,width:Pe}}),r.jsx("p",{className:H,style:{width:qe,...we,...ae},children:ze.title}),r.jsx("div",{"data-controls":o&&Je?"subtitleMarginTop":void 0,className:o&&Je?`${u}-control`:void 0,style:{height:Je?y.scalingValue(I??0,n):0,width:Pe}}),r.jsx("p",{className:re,style:{width:qe,...ue,...ne},children:ze.subtitle})]});return r.jsx("div",{className:`${u}-item`.trim(),style:Ct&&!Ge?{gridColumn:Ct}:void 0,children:r.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${Ge&&Wt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(b??0)>100?`calc(${rt} * (${b} / 100))`:rt,...Ct&&Ge?{gridColumn:Ct}:{}},children:Ge?r.jsx(r.Fragment,{children:Lt?r.jsxs(r.Fragment,{children:[Vt,r.jsx("a",{href:tt,target:"_blank",className:`${u}-item-image-link`,children:Qt})]}):r.jsxs(r.Fragment,{children:[r.jsx("a",{href:tt,target:"_blank",className:`${u}-item-image-link`,children:Qt}),Vt]})}):tt?r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:tt,target:"_blank",className:`${u}-item-image-link`,children:[lt,Qt]}),!Lt&&r.jsx("a",{href:tt,target:"_blank",className:`${u}-item-text-link`,children:wt})]}):r.jsxs(r.Fragment,{children:[lt,Qt,wt]})})},ut)})})}),(!n||i)&&Rt&&typeof document<"u"&&L==="on"&&(()=>{const ze=(c?document.getElementById(c):null)??document.body;return gi.createPortal(r.jsx("div",{style:bt,"data-selection":"none",children:r.jsx(_m,{prefix:u,items:Kt,index:Jt,imageDisplay:Nm(R),isEditor:n,onClose:()=>Ut(!1),onPrev:()=>Te(ut=>(ut-1+Kt.length)%Kt.length),onNext:()=>Te(ut=>(ut+1)%Kt.length),counterClassName:ie,counterStyle:ce})}),ze)})()]})}const jm={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Om=["hover","focus","filled","success","error"],zm=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
4140
|
+
`}const $n=500,Pm=750,Hn="cubic-bezier(0.22, 1, 0.36, 1)",Am=72,Fm=50;function Wm(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function _m(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Hm(e){const[t]=e.media;return t!=null&&t.url?t:null}function Nm(e){return!Array.isArray(e)||e.length===0?[]:Wm(e)?e.flatMap(t=>{const n=_m(t);if(!n)return[];const i=Hm(t);return[{displayMedia:n,lightboxMedia:i!=null&&i.url?i:null}]}):e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function Ii(e){return e.type==="video"}function Om(e){e.pause(),e.removeAttribute("src"),e.load()}function wl({media:e,className:t,style:n,onMediaClick:i}){return Ii(e)?r.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):r.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function Sl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function jm(e,t){if(!t||!t.width||!t.height||!e.width||!e.height)return e;const n=t.width/t.height,i=e.width/e.height;if(n>i){const l=e.width/n;return{width:e.width,height:l,left:e.left,top:e.top+(e.height-l)/2}}const o=e.height*n;return{width:o,height:e.height,left:e.left+(e.width-o)/2,top:e.top}}function zm({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:l,onMouseMove:s}){return a.useEffect(()=>{const c=n.current;if(c)return()=>{Om(c)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:l,onMouseMove:s,style:i})}function Bm({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:l,onPrev:s,onNext:c,counterClassName:d,counterStyle:u}){const m=i==="cover",x=a.useRef(null),w=a.useRef(null),$=a.useRef(null),f=a.useRef(null),S=a.useRef(0),L=a.useRef(0),M=a.useRef("none"),A=a.useRef(!1),C=a.useRef(!1),J=a.useRef(null),k=a.useRef(0),U=a.useRef(null),I=a.useRef(!1),R=a.useRef(null),[T,y]=a.useState(null),[h,F]=a.useState(null),[W,V]=a.useState("opening"),[ne,X]=a.useState(0),[z,H]=a.useState(0),[_,E]=a.useState(null),[q,Y]=a.useState(!1),[ee,N]=a.useState(!1),[pe,b]=a.useState(!1),[ye,Q]=a.useState(null),xe=a.useRef(n),$e=t[n],oe=$e?Ii($e):!1,ie=_!==null,B=a.useCallback(Ce=>{const Fe=Ce.currentTarget,He=Fe instanceof HTMLVideoElement?{width:Fe.videoWidth,height:Fe.videoHeight}:{width:Fe.naturalWidth,height:Fe.naturalHeight};!He.width||!He.height||Q(He)},[]);a.useEffect(()=>{J.current=h},[h]),a.useEffect(()=>{const Ce=x.current;if(!Ce)return;const Fe=()=>F(Sl(Ce));Fe();const He=new ResizeObserver(Fe);return He.observe(Ce),()=>He.disconnect()},[]);const le=a.useCallback(()=>{R.current!==null&&(window.clearTimeout(R.current),R.current=null)},[]),re=a.useCallback(()=>{le(),k.current=0,U.current=null,I.current=!1,H(0),E(null),Y(!1)},[le]),ke=a.useCallback(Ce=>{re(),Ce===1?c():s()},[c,s,re]),fe=a.useCallback((Ce,Fe)=>{var Tt;const He=((Tt=J.current)==null?void 0:Tt.width)??0;le(),U.current=Ce,E(Ce),I.current=!0,Y(!0);const Ze=Fe?-Ce*He:0;k.current=Ze,H(Ze),R.current=window.setTimeout(()=>{R.current=null,Fe?ke(Ce):re()},$n+32)},[le,ke,re]),Pe=a.useCallback(Ce=>{I.current||t.length<=1||(U.current=Ce,E(Ce),I.current=!1,Y(!1),k.current=0,H(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{fe(Ce,!0)})}))},[t.length,fe]),ve=a.useCallback(()=>{const Ce=w.current;if(!Ce)return;const Fe=Sl(Ce);!Fe.width||!Fe.height||y(Fe)},[]);a.useEffect(()=>{ve();const Ce=w.current;if(!Ce)return;const Fe=new ResizeObserver(()=>ve());return Fe.observe(Ce),()=>Fe.disconnect()},[ve]),a.useEffect(()=>{W==="opening"&&T&&V("open")},[W,T]),a.useEffect(()=>{if(W!=="closing")return;const Ce=setTimeout(()=>l(),$n);return()=>clearTimeout(Ce)},[W,l]),a.useEffect(()=>()=>{le()},[le]),a.useLayoutEffect(()=>{xe.current!==n&&(re(),X(0),b(!1),N(!1),Q(null),S.current=0,L.current=0,M.current="none",A.current=!1,f.current=null,C.current=!1,xe.current=n)},[n,re]),a.useEffect(()=>{if(W!=="open")return;let Ce=null;const Fe=()=>{Ce&&(document.removeEventListener("click",Ce,!0),Ce=null)},He=()=>{Fe(),Ce=et=>{et.stopPropagation(),et.preventDefault(),Fe()},document.addEventListener("click",Ce,!0)},Ze=et=>{const dt=et<0?1:-1;if(Math.abs(et)>Fm&&t.length>1){fe(dt,!0);return}fe(dt,!1)},Tt=et=>{if(et.touches.length!==1||I.current)return;const dt=et.touches[0];C.current=!0,f.current={x:dt.clientX,y:dt.clientY},M.current="none",L.current=0,A.current=!1},it=et=>{if(!f.current||et.touches.length!==1||I.current)return;const dt=et.touches[0],lt=dt.clientX-f.current.x,ht=dt.clientY-f.current.y;if(M.current==="none"){if(Math.abs(lt)<10&&Math.abs(ht)<10)return;if(Math.abs(lt)>Math.abs(ht)){if(t.length<=1)return;M.current="horizontal"}else if(ht>0)M.current="vertical";else return}if(M.current==="horizontal"){A.current=!0,N(!0),L.current=lt;const Rt=lt<0?1:-1;U.current!==Rt&&(U.current=Rt,E(Rt)),k.current=lt,H(lt),et.preventDefault();return}M.current==="vertical"&&(A.current=!0,N(!0),S.current=ht,X(ht),et.preventDefault())},De=()=>{if(!f.current)return;const et=M.current,dt=A.current;if(dt&&et==="horizontal")Ze(L.current),He();else if(dt&&et==="vertical")if(S.current>Am){const ht=window.innerHeight;S.current=ht,b(!0),X(ht),V("closing")}else S.current=0,X(0),He();else et==="horizontal"&&Math.abs(L.current)>0&&(Ze(L.current),He());f.current=null,M.current="none",L.current=0,A.current=!1,N(!1)};return document.addEventListener("touchstart",Tt,{passive:!0}),document.addEventListener("touchmove",it,{passive:!1}),document.addEventListener("touchend",De),document.addEventListener("touchcancel",De),()=>{document.removeEventListener("touchstart",Tt),document.removeEventListener("touchmove",it),document.removeEventListener("touchend",De),document.removeEventListener("touchcancel",De),Fe()}},[W,t.length,fe]),a.useEffect(()=>{const Ce=Fe=>{Fe.key==="Escape"&&(Fe.preventDefault(),Fe.stopPropagation(),W!=="closing"&&V("closing"))};return window.addEventListener("keydown",Ce,!0),()=>window.removeEventListener("keydown",Ce,!0)},[W]);const we=()=>{W!=="closing"&&V("closing")},Se=W==="open",G=W==="closing",me=ne>0?Math.max(0,1-ne/500):1,D=ne>0?Math.max(.35,1-ne/500):1,K=T?m?T:jm(T,ye):null,ae=Ce=>{if(Ce.stopPropagation(),C.current){C.current=!1;return}if(t.length<=1)return;const Fe=K??Ce.currentTarget.getBoundingClientRect(),He=Ce.clientY-Fe.top,Ze=Math.min(52,Fe.height*.2);if(!(He>Fe.height-Ze)){if(Ce.clientX-Fe.left<Fe.width/2){Pe(-1);return}Pe(1)}},ge=Ce=>{if(t.length<=1)return;const Fe=K??Ce.currentTarget.getBoundingClientRect(),He=Ce.clientX-Fe.left,Ze=Ce.clientY-Fe.top,Tt=Math.min(52,Fe.height*.2);if(Ze>Fe.height-Tt){Ce.currentTarget.style.cursor="default";return}Ce.currentTarget.style.cursor=He<Fe.width/2?"w-resize":"e-resize"},ce={position:"fixed",top:h==null?void 0:h.top,left:h==null?void 0:h.left,width:h==null?void 0:h.width,height:h==null?void 0:h.height,zIndex:9998},be=m?"cover":"contain",Ee=z!==0||ne>0?`translate(${z}px, ${ne}px)`:void 0,Z=ee&&!q?"none":q?`transform ${$n}ms ${Hn}`:pe?`transform ${$n}ms ${Hn}, opacity ${$n}ms ${Hn}`:W==="opening"||G?`opacity ${$n}ms ${Hn}`:"none",de={...ce,transform:Ee,opacity:ne>0?D:W==="opening"||G?0:1,transition:Z,pointerEvents:"none"},We={position:"absolute",top:((K==null?void 0:K.top)??0)-((h==null?void 0:h.top)??0),left:((K==null?void 0:K.left)??0)-((h==null?void 0:h.left)??0),width:K==null?void 0:K.width,height:K==null?void 0:K.height,objectFit:be,pointerEvents:oe&&Se&&!ie?"auto":"none",touchAction:oe&&Se?"none":void 0},se=(h==null?void 0:h.width)??0,O=ie?(n+_+t.length)%t.length:null,Oe=O!==null?t[O]:null,_e={...ce,transform:ie?`translateX(${_*se+z}px)`:void 0,opacity:1,transition:q?`transform ${$n}ms ${Hn}`:"none",pointerEvents:"none"},nt={position:"absolute",top:((T==null?void 0:T.top)??0)-((h==null?void 0:h.top)??0),left:((T==null?void 0:T.left)??0)-((h==null?void 0:h.left)??0),width:T==null?void 0:T.width,height:T==null?void 0:T.height,objectFit:be,pointerEvents:"none"},Ue=K?{position:"fixed",top:K.top,height:K.height,width:K.width/2,zIndex:9999}:null;return r.jsxs("div",{ref:x,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:W==="open"?"none":void 0},onClick:we,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:Se?me:0,transition:ee?"none":`opacity ${$n}ms ${Hn}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:m?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:w,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:Se?1:0,transition:`opacity ${$n}ms ${Hn}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&r.jsxs("p",{className:d,style:u,children:[n+1," / ",t.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:w,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:Se?1:0,transition:`opacity ${$n}ms ${Hn}`},children:t.length>1&&r.jsxs("p",{className:d,style:u,children:[n+1," / ",t.length]})})]})}),T&&h&&Oe&&r.jsx("div",{style:_e,children:Ii(Oe)?r.jsx("video",{src:Oe.url,muted:!0,playsInline:!0,preload:"auto",style:nt},`neighbor-${O}-${Oe.url}`):r.jsx("img",{src:Oe.url,alt:Oe.name,style:nt},`neighbor-${O}-${Oe.url}`)}),T&&h&&$e&&r.jsx("div",{style:de,children:oe?r.jsx(zm,{src:$e.url,phase:W,mediaRef:$,mediaStyle:We,onLoadedMetadata:B,onClick:ae,onMouseMove:ge},`${n}-${$e.url}`):r.jsx("img",{ref:$,src:$e.url,alt:$e.name,onLoad:B,style:We},`${n}-${$e.url}`)}),Se&&Ue&&t.length>1&&!oe&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...Ue,left:K.left,cursor:"w-resize",pointerEvents:ie?"none":"auto"},onClick:Ce=>{if(C.current){C.current=!1;return}Ce.stopPropagation(),Pe(-1)}}),r.jsx("div",{style:{...Ue,left:K.left+K.width/2,cursor:"e-resize",pointerEvents:ie?"none":"auto"},onClick:Ce=>{if(C.current){C.current=!1;return}Ce.stopPropagation(),Pe(1)}})]})]})}function Dm(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Vm({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:l,activeEvent:s,layoutId:c,portalId:d}){const{prefix:u}=v.useScopedStyles(),{type:m="a",gridLayout:x,textBoxWidth:w=100,verticalGap:$,entriesCount:f,lightbox:S,imageDisplay:L,imageCorners:M,lightboxImageDisplay:A,slider:C,sliderTiming:J,direction:k,transition:U,titleMarginTop:I,subtitleMarginTop:R,titleColor:T,subtitleColor:y,lightboxCounterColor:h,titleFontFamily:F,titleFontSettings:W,titleFontSize:V,titleLineHeight:ne,titleLetterSpacing:X,titleWordSpacing:z,titleTextAppearance:H,subtitleFontFamily:_,subtitleFontSettings:E,subtitleFontSize:q,subtitleLineHeight:Y,subtitleLetterSpacing:ee,subtitleWordSpacing:N,subtitleTextAppearance:pe,lightboxCounterFontFamily:b,lightboxCounterFontSettings:ye,lightboxCounterFontSize:Q,lightboxCounterLineHeight:xe,lightboxCounterLetterSpacing:$e,lightboxCounterWordSpacing:oe,lightboxCounterTextAppearance:ie,showText:B="always",alignEntries:le="off",align:re="top"}=e,ke={fontSettings:{fontFamily:F,fontWeight:(W==null?void 0:W.fontWeight)??400,fontStyle:(W==null?void 0:W.fontStyle)??"normal"},fontSize:V??.01,lineHeight:ne,letterSpacing:X??0,wordSpacing:z??0,textAppearance:H,color:T},Pe={...dn(Xt(ke,n))},ve={fontSettings:{fontFamily:_,fontWeight:(E==null?void 0:E.fontWeight)??400,fontStyle:(E==null?void 0:E.fontStyle)??"normal"},fontSize:q??.01,lineHeight:Y,letterSpacing:ee??0,wordSpacing:N??0,textAppearance:pe,color:y},Se={...dn(Xt(ve,n))},G={fontSettings:{fontFamily:b,fontWeight:(ye==null?void 0:ye.fontWeight)??400,fontStyle:(ye==null?void 0:ye.fontStyle)??"normal"},fontSize:Q??.01,lineHeight:xe,letterSpacing:$e??0,wordSpacing:oe??0,textAppearance:ie,color:h},D={...dn(Xt(G,n)),...Or(Q,xe,u,n)},K=Nr(V,ne,`${u}-item-title`,`${u}-text-tight-leading`),ae=Nr(q,Y,`${u}-item-subtitle`,`${u}-text-tight-leading`),ge=Or(V,ne,u,n),ce=Or(q,Y,u,n),be=Nr(Q,xe,`${u}-lightbox-counter`,`${u}-text-tight-leading`),Ee=v.buildColorVars(u,{titleColor:T,subtitleColor:y,lightboxCounterColor:h},Gm,qm),We=`${s&&s!=="default"?`${u}-state-${s}`:""}${B==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),se=f===0?1/0:f,O=(t??[]).slice(0,se),Oe=x.entryWidth??.2,_e=(L==null?void 0:L.display)==="cover",nt=(L==null?void 0:L.ratioValue)??"1:1",Ue=(L==null?void 0:L.reversed)??!1,[Ce,Fe]=nt.split(":").map(Number),Tt=`${Ue?Fe:Ce} / ${Ue?Ce:Fe}`,it=x.columnsCount,De=v.scalingValue(Oe??0,n),et=De,dt=!_e&&C!=="off",lt=O.length%it||it,ht=lt<it&&O.length>0,Rt=O.length-lt,ot=ht?Math.floor((it-lt)/2)+1:1,xt=M?v.scalingValue(M,n):void 0,zt={width:et,..._e?{aspectRatio:Tt,height:"auto",overflow:"hidden"}:{height:"auto"},...xt?{borderRadius:xt,overflow:"hidden"}:{}},rt=`${u}-item-image-wrapper${dt?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),qe=m==="d"||m==="e"||m==="f",Ne=le==="on",pt=`calc(${v.scalingValue(Oe??0,n)} * (${w} / 100))`,yt=v.scalingValue(Oe*w/100,n),Mt=_e?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...xt?{borderRadius:xt}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...xt?{borderRadius:xt}:{}},[Dt,en]=a.useState("ltr"),[sn,Lt]=a.useState(0),Et=a.useRef(null);a.useEffect(()=>{const Ae=Et.current;if(!Ae)return;const Ye=new ResizeObserver(Je=>{Lt(Math.round(Je[0].contentRect.width))});return Ye.observe(Ae),()=>Ye.disconnect()},[]);const Qt=(()=>{const Ae={...Ee},Ye=Et.current?getComputedStyle(Et.current).getPropertyValue("--cntrl-article-width").trim():"";return Ye&&(Ae["--cntrl-article-width"]=Ye),Ae})(),[Ut,ft]=a.useState(!1),[qt,Re]=a.useState([]),[Ve,Xe]=a.useState(0),ze=S==="on"&&(!n||i),mt=(Ae,Ye)=>{n&&!i||S!=="off"&&(Re(Ae),Xe(Ye),ft(!0))};a.useEffect(()=>{if(!Ut||S!=="on"||typeof document>"u")return;const Ae=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Ae}},[Ut,S]),a.useEffect(()=>{!n||i||ft(!1)},[n,i]);const Nt=a.useMemo(()=>km(u),[u]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Nt}}),r.jsx("div",{style:Ee,children:r.jsx("div",{ref:Et,className:`${u}-wrapper ${u}-type-${m}${Ne?` ${u}-align-entries`:""} ${u}-image-align-${re} ${We}`.trim(),style:{gridTemplateColumns:`repeat(${it}, ${De})`,rowGap:Ne?0:v.scalingValue($??0,n),columnGap:v.scalingValue(x.horizontalGap??0,n),width:v.scalingValue(x.wrapperWidth??0,n),...Ne?{[`--${u}-align-entries-row-gap`]:v.scalingValue($??0,n)}:{}},children:O.map((Ae,Ye)=>{var Bt;const Je=xl(Ae.title),bt=xl(Ae.subtitle),$t=(((Bt=Ae.link)==null?void 0:Bt.length)??0)>0&&S==="off"?Ae.link:void 0,ut=Math.floor(Ye/it)===Math.ceil(O.length/it)-1,Pt=ht&&Ye>=Rt?`${ot+(Ye-Rt)}`:void 0,At=qe?r.jsxs("div",{className:`${u}-item-text-block`,children:[Je&&r.jsx("p",{className:K,style:{width:pt,...Pe,...ge},children:Ae.title}),Je&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:v.scalingValue(I??0,n),width:yt}}),bt&&r.jsx("p",{className:ae,style:{width:pt,...Se,...ce},children:Ae.subtitle}),bt&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:v.scalingValue(R??0,n),width:yt}})]}):null,Vt=Ne?r.jsxs("div",{className:`${u}-item-title-row`,children:[!qe&&r.jsx("div",{"data-controls":o&&Je?"titleMarginTop":void 0,className:o&&Je?`${u}-control`:void 0,style:{height:Je?v.scalingValue(I??0,n):0,width:yt}}),Je&&r.jsx("p",{className:K,style:{width:pt,...Pe,...ge},children:Ae.title}),qe&&Je&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:v.scalingValue(I??0,n),width:yt}})]}):null,Kt=Ne?r.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!qe&&r.jsx("div",{"data-controls":o&&bt?"subtitleMarginTop":void 0,className:o&&bt?`${u}-control`:void 0,style:{height:bt?v.scalingValue(R??0,n):0,width:yt}}),bt&&r.jsx("p",{className:ae,style:{width:pt,...Se,...ce},children:Ae.subtitle}),qe&&bt&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:v.scalingValue(R??0,n),width:yt}})]}):null,Ft=$t?r.jsxs("a",{href:$t,target:"_blank",className:`${u}-item-text-link`,children:[Vt,Kt]}):r.jsxs(r.Fragment,{children:[Vt,Kt]}),Yt=Nm(Ae.gallery),wt=Yt.filter(vt=>vt.lightboxMedia).map(vt=>vt.lightboxMedia),Ot=r.jsx("div",{className:rt,style:zt,children:Yt.length===0?null:C==="off"?(()=>{const{displayMedia:vt,lightboxMedia:g}=Yt[0],ue=g?wt.findIndex(Te=>Te.url===g.url):-1;return r.jsx(wl,{media:vt,className:`${u}-item-${Ii(vt)?"video":"image"}`.trim(),style:Mt,onMediaClick:ze&&ue>=0?()=>mt(wt,ue):void 0})})():r.jsxs(r.Fragment,{children:[dt&&Ne&&r.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Yt.map(({displayMedia:vt})=>Ii(vt)?r.jsx("video",{src:vt.url,muted:!0,playsInline:!0},`sizer-${vt.url}`):r.jsx("img",{src:vt.url,alt:""},`sizer-${vt.url}`))}),r.jsx(br,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:J*1e3,width:"100%",height:"100%",speed:Pm,type:U==="fade"?"fade":"loop",rewind:U==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:U==="fade"?"ltr":k!=="random"?k==="horizontal"?"ltr":"ttb":Dt},onMoved:vt=>{if(k!=="random"||U==="fade")return;const g=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";en(g),setTimeout(()=>{vt.refresh()},0)},children:Yt.map(({displayMedia:vt,lightboxMedia:g},ue)=>{const Te=g?wt.findIndex(Le=>Le.url===g.url):-1;return r.jsx(xr,{children:r.jsx(wl,{media:vt,className:`${u}-item-${Ii(vt)?"video":"image"}`.trim(),style:Mt,onMediaClick:ze&&Te>=0?()=>mt(wt,Te):void 0})},ue)})},`${U}-${Oe}-${k}-${J}-${sn}-${c}`)]})}),jt=qe?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&Je?"titleMarginTop":void 0,className:o&&Je?`${u}-control`:void 0,style:{height:Je?v.scalingValue(I??0,n):0,width:yt}}),r.jsx("p",{className:K,style:{width:pt,...Pe,...ge},children:Ae.title}),r.jsx("div",{"data-controls":o&&bt?"subtitleMarginTop":void 0,className:o&&bt?`${u}-control`:void 0,style:{height:bt?v.scalingValue(R??0,n):0,width:yt}}),r.jsx("p",{className:ae,style:{width:pt,...Se,...ce},children:Ae.subtitle})]});return r.jsx("div",{className:`${u}-item`.trim(),style:Pt&&!Ne?{gridColumn:Pt}:void 0,children:r.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${Ne&&ut?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(w??0)>100?`calc(${De} * (${w} / 100))`:De,...Pt&&Ne?{gridColumn:Pt}:{}},children:Ne?r.jsx(r.Fragment,{children:qe?r.jsxs(r.Fragment,{children:[Ft,r.jsx("a",{href:$t,target:"_blank",className:`${u}-item-image-link`,children:Ot})]}):r.jsxs(r.Fragment,{children:[r.jsx("a",{href:$t,target:"_blank",className:`${u}-item-image-link`,children:Ot}),Ft]})}):$t?r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:$t,target:"_blank",className:`${u}-item-image-link`,children:[At,Ot]}),!qe&&r.jsx("a",{href:$t,target:"_blank",className:`${u}-item-text-link`,children:jt})]}):r.jsxs(r.Fragment,{children:[At,Ot,jt]})})},Ye)})})}),(!n||i)&&Ut&&typeof document<"u"&&S==="on"&&(()=>{const Ae=(d?document.getElementById(d):null)??document.body;return gi.createPortal(r.jsx("div",{style:Qt,"data-selection":"none",children:r.jsx(Bm,{prefix:u,items:qt,index:Ve,imageDisplay:Dm(A),isEditor:n,onClose:()=>ft(!1),onPrev:()=>Xe(Ye=>(Ye-1+qt.length)%qt.length),onNext:()=>Xe(Ye=>(Ye+1)%qt.length),counterClassName:be,counterStyle:D})}),Ae)})()]})}const Gm={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},qm=["hover","focus","filled","success","error"],Km=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
4141
4141
|
import '@splidejs/react-splide/css/core';
|
|
4142
4142
|
import { CommonComponentProps } from '../props';
|
|
4143
4143
|
import {
|
|
@@ -4688,11 +4688,16 @@ function getGhostRect(ghost: HTMLElement): AnimRect {
|
|
|
4688
4688
|
return { width: cb.width, height: cb.height, left: cb.left, top: cb.top };
|
|
4689
4689
|
}
|
|
4690
4690
|
|
|
4691
|
-
function
|
|
4692
|
-
if (
|
|
4693
|
-
|
|
4691
|
+
function getContainRect(box: AnimRect, natural: { width: number; height: number } | null): AnimRect {
|
|
4692
|
+
if (!natural || !natural.width || !natural.height || !box.width || !box.height) return box;
|
|
4693
|
+
const ir = natural.width / natural.height;
|
|
4694
|
+
const cr = box.width / box.height;
|
|
4695
|
+
if (ir > cr) {
|
|
4696
|
+
const dh = box.width / ir;
|
|
4697
|
+
return { width: box.width, height: dh, left: box.left, top: box.top + (box.height - dh) / 2 };
|
|
4694
4698
|
}
|
|
4695
|
-
|
|
4699
|
+
const dw = box.height * ir;
|
|
4700
|
+
return { width: dw, height: box.height, left: box.left + (box.width - dw) / 2, top: box.top };
|
|
4696
4701
|
}
|
|
4697
4702
|
|
|
4698
4703
|
function LightboxVideo({
|
|
@@ -4703,16 +4708,14 @@ function LightboxVideo({
|
|
|
4703
4708
|
onLoadedMetadata,
|
|
4704
4709
|
onClick,
|
|
4705
4710
|
onMouseMove,
|
|
4706
|
-
onTransitionEnd,
|
|
4707
4711
|
}: {
|
|
4708
4712
|
src: string;
|
|
4709
4713
|
phase: 'opening' | 'open' | 'closing';
|
|
4710
4714
|
mediaRef: React.RefObject<HTMLVideoElement>;
|
|
4711
4715
|
mediaStyle: React.CSSProperties;
|
|
4712
|
-
onLoadedMetadata: () => void;
|
|
4716
|
+
onLoadedMetadata: (e: React.SyntheticEvent<HTMLVideoElement>) => void;
|
|
4713
4717
|
onClick: (e: React.MouseEvent<HTMLVideoElement>) => void;
|
|
4714
4718
|
onMouseMove: (e: React.MouseEvent<HTMLVideoElement>) => void;
|
|
4715
|
-
onTransitionEnd: (e: React.TransitionEvent<HTMLVideoElement>) => void;
|
|
4716
4719
|
}) {
|
|
4717
4720
|
useEffect(() => {
|
|
4718
4721
|
const video = mediaRef.current;
|
|
@@ -4733,7 +4736,6 @@ function LightboxVideo({
|
|
|
4733
4736
|
onLoadedMetadata={onLoadedMetadata}
|
|
4734
4737
|
onClick={onClick}
|
|
4735
4738
|
onMouseMove={onMouseMove}
|
|
4736
|
-
onTransitionEnd={onTransitionEnd}
|
|
4737
4739
|
style={mediaStyle}
|
|
4738
4740
|
/>
|
|
4739
4741
|
);
|
|
@@ -4750,75 +4752,111 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
4750
4752
|
const swipeAxisRef = useRef<SwipeAxis>('none');
|
|
4751
4753
|
const isSwipingRef = useRef(false);
|
|
4752
4754
|
const touchInteractionRef = useRef(false);
|
|
4753
|
-
const
|
|
4754
|
-
const
|
|
4755
|
+
const viewportRectRef = useRef<AnimRect | null>(null);
|
|
4756
|
+
const slideOffsetRef = useRef(0);
|
|
4757
|
+
const slideDirRef = useRef<1 | -1 | null>(null);
|
|
4758
|
+
const slideAnimatingRef = useRef(false);
|
|
4759
|
+
const slideCommitTimerRef = useRef<number | null>(null);
|
|
4755
4760
|
const [finalRect, setFinalRect] = useState<AnimRect | null>(null);
|
|
4761
|
+
const [viewportRect, setViewportRect] = useState<AnimRect | null>(null);
|
|
4756
4762
|
const [phase, setPhase] = useState<'opening' | 'open' | 'closing'>('opening');
|
|
4757
4763
|
const [swipeOffset, setSwipeOffset] = useState(0);
|
|
4758
|
-
const [
|
|
4759
|
-
const [
|
|
4764
|
+
const [slideOffset, setSlideOffset] = useState(0);
|
|
4765
|
+
const [slideDir, setSlideDir] = useState<1 | -1 | null>(null);
|
|
4766
|
+
const [slideAnimating, setSlideAnimating] = useState(false);
|
|
4760
4767
|
const [isSwiping, setIsSwiping] = useState(false);
|
|
4761
4768
|
const [swipeDismiss, setSwipeDismiss] = useState(false);
|
|
4769
|
+
const [mediaNaturalSize, setMediaNaturalSize] = useState<{ width: number; height: number } | null>(null);
|
|
4762
4770
|
const prevIndexRef = useRef(index);
|
|
4763
4771
|
const currentItem = items[index];
|
|
4764
4772
|
const isCurrentVideo = currentItem ? isVideoMedia(currentItem) : false;
|
|
4765
|
-
const
|
|
4773
|
+
const isSliding = slideDir !== null;
|
|
4774
|
+
|
|
4775
|
+
const handleMediaLoad = useCallback((e: React.SyntheticEvent<HTMLImageElement | HTMLVideoElement>) => {
|
|
4776
|
+
const target = e.currentTarget;
|
|
4777
|
+
const size = target instanceof HTMLVideoElement
|
|
4778
|
+
? { width: target.videoWidth, height: target.videoHeight }
|
|
4779
|
+
: { width: target.naturalWidth, height: target.naturalHeight };
|
|
4780
|
+
if (!size.width || !size.height) return;
|
|
4781
|
+
setMediaNaturalSize(size);
|
|
4782
|
+
}, []);
|
|
4766
4783
|
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4784
|
+
useEffect(() => {
|
|
4785
|
+
viewportRectRef.current = viewportRect;
|
|
4786
|
+
}, [viewportRect]);
|
|
4787
|
+
|
|
4788
|
+
useEffect(() => {
|
|
4789
|
+
const el = containerRef.current;
|
|
4790
|
+
if (!el) return;
|
|
4791
|
+
const update = () => setViewportRect(getGhostRect(el));
|
|
4792
|
+
update();
|
|
4793
|
+
const ro = new ResizeObserver(update);
|
|
4794
|
+
ro.observe(el);
|
|
4795
|
+
return () => ro.disconnect();
|
|
4770
4796
|
}, []);
|
|
4771
4797
|
|
|
4772
|
-
const
|
|
4773
|
-
if (
|
|
4774
|
-
window.clearTimeout(
|
|
4775
|
-
|
|
4798
|
+
const clearSlideCommitTimer = useCallback(() => {
|
|
4799
|
+
if (slideCommitTimerRef.current !== null) {
|
|
4800
|
+
window.clearTimeout(slideCommitTimerRef.current);
|
|
4801
|
+
slideCommitTimerRef.current = null;
|
|
4776
4802
|
}
|
|
4777
4803
|
}, []);
|
|
4778
4804
|
|
|
4779
|
-
const
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4805
|
+
const resetSlideState = useCallback(() => {
|
|
4806
|
+
clearSlideCommitTimer();
|
|
4807
|
+
slideOffsetRef.current = 0;
|
|
4808
|
+
slideDirRef.current = null;
|
|
4809
|
+
slideAnimatingRef.current = false;
|
|
4810
|
+
setSlideOffset(0);
|
|
4811
|
+
setSlideDir(null);
|
|
4812
|
+
setSlideAnimating(false);
|
|
4813
|
+
}, [clearSlideCommitTimer]);
|
|
4814
|
+
|
|
4815
|
+
const commitSlide = useCallback((dir: 1 | -1) => {
|
|
4816
|
+
resetSlideState();
|
|
4817
|
+
if (dir === 1) onNext();
|
|
4818
|
+
else onPrev();
|
|
4819
|
+
}, [onNext, onPrev, resetSlideState]);
|
|
4820
|
+
|
|
4821
|
+
const finishSlide = useCallback((dir: 1 | -1, commit: boolean) => {
|
|
4822
|
+
const width = viewportRectRef.current?.width ?? 0;
|
|
4823
|
+
clearSlideCommitTimer();
|
|
4824
|
+
slideDirRef.current = dir;
|
|
4825
|
+
setSlideDir(dir);
|
|
4826
|
+
slideAnimatingRef.current = true;
|
|
4827
|
+
setSlideAnimating(true);
|
|
4828
|
+
const target = commit ? -dir * width : 0;
|
|
4829
|
+
slideOffsetRef.current = target;
|
|
4830
|
+
setSlideOffset(target);
|
|
4831
|
+
slideCommitTimerRef.current = window.setTimeout(() => {
|
|
4832
|
+
slideCommitTimerRef.current = null;
|
|
4833
|
+
if (commit) commitSlide(dir);
|
|
4834
|
+
else resetSlideState();
|
|
4784
4835
|
}, LIGHTBOX_ANIM_MS + 32);
|
|
4785
|
-
}, [
|
|
4836
|
+
}, [clearSlideCommitTimer, commitSlide, resetSlideState]);
|
|
4837
|
+
|
|
4838
|
+
const startProgrammaticSlide = useCallback((dir: 1 | -1) => {
|
|
4839
|
+
if (slideAnimatingRef.current || items.length <= 1) return;
|
|
4840
|
+
slideDirRef.current = dir;
|
|
4841
|
+
setSlideDir(dir);
|
|
4842
|
+
slideAnimatingRef.current = false;
|
|
4843
|
+
setSlideAnimating(false);
|
|
4844
|
+
slideOffsetRef.current = 0;
|
|
4845
|
+
setSlideOffset(0);
|
|
4846
|
+
requestAnimationFrame(() => {
|
|
4847
|
+
requestAnimationFrame(() => {
|
|
4848
|
+
finishSlide(dir, true);
|
|
4849
|
+
});
|
|
4850
|
+
});
|
|
4851
|
+
}, [items.length, finishSlide]);
|
|
4786
4852
|
|
|
4787
4853
|
const computeFinalRect = useCallback(() => {
|
|
4788
4854
|
const ghost = ghostRef.current;
|
|
4789
|
-
const media = mediaRef.current;
|
|
4790
4855
|
if (!ghost) return;
|
|
4791
|
-
const
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
if (imageDisplay === 'cover') {
|
|
4797
|
-
setFinalRect({ width: cw, height: ch, left: cb.left, top: cb.top });
|
|
4798
|
-
return;
|
|
4799
|
-
}
|
|
4800
|
-
|
|
4801
|
-
if (!media) {
|
|
4802
|
-
setFinalRect(getGhostRect(ghost));
|
|
4803
|
-
return;
|
|
4804
|
-
}
|
|
4805
|
-
|
|
4806
|
-
const { width: nw, height: nh } = getLightboxMediaDimensions(media);
|
|
4807
|
-
if (!nw || !nh) {
|
|
4808
|
-
setFinalRect(getGhostRect(ghost));
|
|
4809
|
-
return;
|
|
4810
|
-
}
|
|
4811
|
-
|
|
4812
|
-
const ir = nw / nh;
|
|
4813
|
-
const cr = cw / ch;
|
|
4814
|
-
if (ir > cr) {
|
|
4815
|
-
const dh = cw / ir;
|
|
4816
|
-
setFinalRect({ width: cw, height: dh, left: cb.left, top: cb.top + (ch - dh) / 2 });
|
|
4817
|
-
} else {
|
|
4818
|
-
const dw = ch * ir;
|
|
4819
|
-
setFinalRect({ width: dw, height: ch, left: cb.left + (cw - dw) / 2, top: cb.top });
|
|
4820
|
-
}
|
|
4821
|
-
}, [imageDisplay]);
|
|
4856
|
+
const rect = getGhostRect(ghost);
|
|
4857
|
+
if (!rect.width || !rect.height) return;
|
|
4858
|
+
setFinalRect(rect);
|
|
4859
|
+
}, []);
|
|
4822
4860
|
|
|
4823
4861
|
useEffect(() => {
|
|
4824
4862
|
computeFinalRect();
|
|
@@ -4827,7 +4865,7 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
4827
4865
|
const ro = new ResizeObserver(() => computeFinalRect());
|
|
4828
4866
|
ro.observe(c);
|
|
4829
4867
|
return () => ro.disconnect();
|
|
4830
|
-
}, [computeFinalRect
|
|
4868
|
+
}, [computeFinalRect]);
|
|
4831
4869
|
|
|
4832
4870
|
useEffect(() => {
|
|
4833
4871
|
if (phase === 'opening' && finalRect) setPhase('open');
|
|
@@ -4841,19 +4879,18 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
4841
4879
|
|
|
4842
4880
|
useEffect(() => {
|
|
4843
4881
|
return () => {
|
|
4844
|
-
|
|
4882
|
+
clearSlideCommitTimer();
|
|
4845
4883
|
};
|
|
4846
|
-
}, [
|
|
4884
|
+
}, [clearSlideCommitTimer]);
|
|
4847
4885
|
|
|
4848
4886
|
useLayoutEffect(() => {
|
|
4849
4887
|
if (prevIndexRef.current === index) return;
|
|
4850
4888
|
|
|
4851
|
-
|
|
4889
|
+
resetSlideState();
|
|
4852
4890
|
setSwipeOffset(0);
|
|
4853
|
-
setNavSwipeOffset(0);
|
|
4854
|
-
setNavSwipeAnimatingState(false);
|
|
4855
4891
|
setSwipeDismiss(false);
|
|
4856
4892
|
setIsSwiping(false);
|
|
4893
|
+
setMediaNaturalSize(null);
|
|
4857
4894
|
swipeOffsetRef.current = 0;
|
|
4858
4895
|
swipeDeltaXRef.current = 0;
|
|
4859
4896
|
swipeAxisRef.current = 'none';
|
|
@@ -4861,13 +4898,8 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
4861
4898
|
touchStartRef.current = null;
|
|
4862
4899
|
touchInteractionRef.current = false;
|
|
4863
4900
|
|
|
4864
|
-
const ghost = ghostRef.current;
|
|
4865
|
-
if (ghost) {
|
|
4866
|
-
setFinalRect(getGhostRect(ghost));
|
|
4867
|
-
}
|
|
4868
|
-
|
|
4869
4901
|
prevIndexRef.current = index;
|
|
4870
|
-
}, [index,
|
|
4902
|
+
}, [index, resetSlideState]);
|
|
4871
4903
|
|
|
4872
4904
|
useEffect(() => {
|
|
4873
4905
|
if (phase !== 'open') return;
|
|
@@ -4890,38 +4922,17 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
4890
4922
|
document.addEventListener('click', blockClick, true);
|
|
4891
4923
|
};
|
|
4892
4924
|
|
|
4893
|
-
const
|
|
4894
|
-
|
|
4895
|
-
navSwipeAnimatingRef.current = false;
|
|
4896
|
-
setNavSwipeAnimating(false);
|
|
4897
|
-
setNavSwipeOffset(0);
|
|
4898
|
-
setIsSwiping(false);
|
|
4899
|
-
isSwipingRef.current = false;
|
|
4900
|
-
swipeDeltaXRef.current = 0;
|
|
4901
|
-
swipeAxisRef.current = 'none';
|
|
4902
|
-
|
|
4903
|
-
const ghost = ghostRef.current;
|
|
4904
|
-
if (ghost) {
|
|
4905
|
-
setFinalRect(getGhostRect(ghost));
|
|
4906
|
-
}
|
|
4907
|
-
|
|
4908
|
-
if (deltaX < 0) onNext();
|
|
4909
|
-
else onPrev();
|
|
4910
|
-
};
|
|
4911
|
-
|
|
4912
|
-
const startNavSwipeRelease = (deltaX: number) => {
|
|
4925
|
+
const startSlideRelease = (deltaX: number) => {
|
|
4926
|
+
const dir: 1 | -1 = deltaX < 0 ? 1 : -1;
|
|
4913
4927
|
if (Math.abs(deltaX) > SWIPE_NAV_THRESHOLD && items.length > 1) {
|
|
4914
|
-
|
|
4928
|
+
finishSlide(dir, true);
|
|
4915
4929
|
return;
|
|
4916
4930
|
}
|
|
4917
|
-
|
|
4918
|
-
setNavSwipeAnimatingState(true);
|
|
4919
|
-
setNavSwipeOffset(0);
|
|
4920
|
-
scheduleNavSwipeSnapBackEnd();
|
|
4931
|
+
finishSlide(dir, false);
|
|
4921
4932
|
};
|
|
4922
4933
|
|
|
4923
4934
|
const handleTouchStart = (e: TouchEvent) => {
|
|
4924
|
-
if (e.touches.length !== 1 ||
|
|
4935
|
+
if (e.touches.length !== 1 || slideAnimatingRef.current) return;
|
|
4925
4936
|
const touch = e.touches[0];
|
|
4926
4937
|
|
|
4927
4938
|
touchInteractionRef.current = true;
|
|
@@ -4932,7 +4943,7 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
4932
4943
|
};
|
|
4933
4944
|
|
|
4934
4945
|
const handleTouchMove = (e: TouchEvent) => {
|
|
4935
|
-
if (!touchStartRef.current || e.touches.length !== 1 ||
|
|
4946
|
+
if (!touchStartRef.current || e.touches.length !== 1 || slideAnimatingRef.current) return;
|
|
4936
4947
|
const touch = e.touches[0];
|
|
4937
4948
|
const deltaX = touch.clientX - touchStartRef.current.x;
|
|
4938
4949
|
const deltaY = touch.clientY - touchStartRef.current.y;
|
|
@@ -4953,7 +4964,13 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
4953
4964
|
isSwipingRef.current = true;
|
|
4954
4965
|
setIsSwiping(true);
|
|
4955
4966
|
swipeDeltaXRef.current = deltaX;
|
|
4956
|
-
|
|
4967
|
+
const dir: 1 | -1 = deltaX < 0 ? 1 : -1;
|
|
4968
|
+
if (slideDirRef.current !== dir) {
|
|
4969
|
+
slideDirRef.current = dir;
|
|
4970
|
+
setSlideDir(dir);
|
|
4971
|
+
}
|
|
4972
|
+
slideOffsetRef.current = deltaX;
|
|
4973
|
+
setSlideOffset(deltaX);
|
|
4957
4974
|
e.preventDefault();
|
|
4958
4975
|
return;
|
|
4959
4976
|
}
|
|
@@ -4974,7 +4991,7 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
4974
4991
|
const wasSwiping = isSwipingRef.current;
|
|
4975
4992
|
|
|
4976
4993
|
if (wasSwiping && axis === 'horizontal') {
|
|
4977
|
-
|
|
4994
|
+
startSlideRelease(swipeDeltaXRef.current);
|
|
4978
4995
|
blockSwipeClick();
|
|
4979
4996
|
} else if (wasSwiping && axis === 'vertical') {
|
|
4980
4997
|
const offset = swipeOffsetRef.current;
|
|
@@ -4991,7 +5008,7 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
4991
5008
|
blockSwipeClick();
|
|
4992
5009
|
}
|
|
4993
5010
|
} else if (axis === 'horizontal' && Math.abs(swipeDeltaXRef.current) > 0) {
|
|
4994
|
-
|
|
5011
|
+
startSlideRelease(swipeDeltaXRef.current);
|
|
4995
5012
|
blockSwipeClick();
|
|
4996
5013
|
}
|
|
4997
5014
|
|
|
@@ -5014,7 +5031,7 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
5014
5031
|
document.removeEventListener('touchcancel', handleTouchEnd);
|
|
5015
5032
|
clearBlockSwipeClick();
|
|
5016
5033
|
};
|
|
5017
|
-
}, [phase, items.length,
|
|
5034
|
+
}, [phase, items.length, finishSlide]);
|
|
5018
5035
|
|
|
5019
5036
|
useEffect(() => {
|
|
5020
5037
|
const onKeyDown = (e: KeyboardEvent) => {
|
|
@@ -5038,6 +5055,10 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
5038
5055
|
const swipeBackdropOpacity = swipeOffset > 0 ? Math.max(0, 1 - swipeOffset / 500) : 1;
|
|
5039
5056
|
const swipeMediaOpacity = swipeOffset > 0 ? Math.max(0.35, 1 - swipeOffset / 500) : 1;
|
|
5040
5057
|
|
|
5058
|
+
const contentRect = finalRect
|
|
5059
|
+
? (isCover ? finalRect : getContainRect(finalRect, mediaNaturalSize))
|
|
5060
|
+
: null;
|
|
5061
|
+
|
|
5041
5062
|
const handleVideoClick = (e: React.MouseEvent<HTMLVideoElement>) => {
|
|
5042
5063
|
e.stopPropagation();
|
|
5043
5064
|
if (touchInteractionRef.current) {
|
|
@@ -5046,7 +5067,7 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
5046
5067
|
}
|
|
5047
5068
|
if (items.length <= 1) return;
|
|
5048
5069
|
|
|
5049
|
-
const rect = e.currentTarget.getBoundingClientRect();
|
|
5070
|
+
const rect = contentRect ?? e.currentTarget.getBoundingClientRect();
|
|
5050
5071
|
const y = e.clientY - rect.top;
|
|
5051
5072
|
const controlsZoneHeight = Math.min(52, rect.height * 0.2);
|
|
5052
5073
|
|
|
@@ -5055,17 +5076,17 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
5055
5076
|
}
|
|
5056
5077
|
|
|
5057
5078
|
if (e.clientX - rect.left < rect.width / 2) {
|
|
5058
|
-
|
|
5079
|
+
startProgrammaticSlide(-1);
|
|
5059
5080
|
return;
|
|
5060
5081
|
}
|
|
5061
5082
|
|
|
5062
|
-
|
|
5083
|
+
startProgrammaticSlide(1);
|
|
5063
5084
|
};
|
|
5064
5085
|
|
|
5065
5086
|
const handleVideoMouseMove = (e: React.MouseEvent<HTMLVideoElement>) => {
|
|
5066
5087
|
if (items.length <= 1) return;
|
|
5067
5088
|
|
|
5068
|
-
const rect = e.currentTarget.getBoundingClientRect();
|
|
5089
|
+
const rect = contentRect ?? e.currentTarget.getBoundingClientRect();
|
|
5069
5090
|
const x = e.clientX - rect.left;
|
|
5070
5091
|
const y = e.clientY - rect.top;
|
|
5071
5092
|
const controlsZoneHeight = Math.min(52, rect.height * 0.2);
|
|
@@ -5078,51 +5099,79 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
5078
5099
|
e.currentTarget.style.cursor = x < rect.width / 2 ? 'w-resize' : 'e-resize';
|
|
5079
5100
|
};
|
|
5080
5101
|
|
|
5081
|
-
const
|
|
5082
|
-
|
|
5102
|
+
const backingBaseStyle: React.CSSProperties = {
|
|
5103
|
+
position: 'fixed',
|
|
5104
|
+
top: viewportRect?.top,
|
|
5105
|
+
left: viewportRect?.left,
|
|
5106
|
+
width: viewportRect?.width,
|
|
5107
|
+
height: viewportRect?.height,
|
|
5108
|
+
zIndex: 9998,
|
|
5109
|
+
};
|
|
5083
5110
|
|
|
5084
|
-
|
|
5085
|
-
setNavSwipeAnimatingState(false);
|
|
5086
|
-
}, [clearNavSwipeCommitTimer, setNavSwipeAnimatingState]);
|
|
5111
|
+
const objectFitStyle: React.CSSProperties['objectFit'] = isCover ? 'cover' : 'contain';
|
|
5087
5112
|
|
|
5088
|
-
const
|
|
5089
|
-
? \`
|
|
5090
|
-
:
|
|
5091
|
-
? \`translateY(\${swipeOffset}px)\`
|
|
5092
|
-
: undefined;
|
|
5113
|
+
const currentTransform = (slideOffset !== 0 || swipeOffset > 0)
|
|
5114
|
+
? \`translate(\${slideOffset}px, \${swipeOffset}px)\`
|
|
5115
|
+
: undefined;
|
|
5093
5116
|
|
|
5094
|
-
const
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5117
|
+
const currentTransition = (isSwiping && !slideAnimating)
|
|
5118
|
+
? 'none'
|
|
5119
|
+
: slideAnimating
|
|
5120
|
+
? \`transform \${LIGHTBOX_ANIM_MS}ms \${LIGHTBOX_EASING}\`
|
|
5121
|
+
: swipeDismiss
|
|
5122
|
+
? \`transform \${LIGHTBOX_ANIM_MS}ms \${LIGHTBOX_EASING}, opacity \${LIGHTBOX_ANIM_MS}ms \${LIGHTBOX_EASING}\`
|
|
5123
|
+
: phase === 'opening' || isClosing
|
|
5124
|
+
? \`opacity \${LIGHTBOX_ANIM_MS}ms \${LIGHTBOX_EASING}\`
|
|
5125
|
+
: 'none';
|
|
5126
|
+
|
|
5127
|
+
const currentBackingStyle: React.CSSProperties = {
|
|
5128
|
+
...backingBaseStyle,
|
|
5129
|
+
transform: currentTransform,
|
|
5102
5130
|
opacity: swipeOffset > 0
|
|
5103
5131
|
? swipeMediaOpacity
|
|
5104
5132
|
: phase === 'opening' || isClosing
|
|
5105
5133
|
? 0
|
|
5106
5134
|
: 1,
|
|
5107
|
-
transition:
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5135
|
+
transition: currentTransition,
|
|
5136
|
+
pointerEvents: 'none',
|
|
5137
|
+
};
|
|
5138
|
+
|
|
5139
|
+
const currentMediaStyle: React.CSSProperties = {
|
|
5140
|
+
position: 'absolute',
|
|
5141
|
+
top: (contentRect?.top ?? 0) - (viewportRect?.top ?? 0),
|
|
5142
|
+
left: (contentRect?.left ?? 0) - (viewportRect?.left ?? 0),
|
|
5143
|
+
width: contentRect?.width,
|
|
5144
|
+
height: contentRect?.height,
|
|
5145
|
+
objectFit: objectFitStyle,
|
|
5146
|
+
pointerEvents: isCurrentVideo && isOpen && !isSliding ? 'auto' : 'none',
|
|
5117
5147
|
touchAction: isCurrentVideo && isOpen ? 'none' : undefined,
|
|
5118
|
-
zIndex: 9998,
|
|
5119
5148
|
};
|
|
5120
5149
|
|
|
5121
|
-
const
|
|
5150
|
+
const slideWidth = viewportRect?.width ?? 0;
|
|
5151
|
+
const neighborIndex = isSliding ? (index + (slideDir as 1 | -1) + items.length) % items.length : null;
|
|
5152
|
+
const neighborItem = neighborIndex !== null ? items[neighborIndex] : null;
|
|
5153
|
+
const neighborBackingStyle: React.CSSProperties = {
|
|
5154
|
+
...backingBaseStyle,
|
|
5155
|
+
transform: isSliding ? \`translateX(\${(slideDir as 1 | -1) * slideWidth + slideOffset}px)\` : undefined,
|
|
5156
|
+
opacity: 1,
|
|
5157
|
+
transition: slideAnimating ? \`transform \${LIGHTBOX_ANIM_MS}ms \${LIGHTBOX_EASING}\` : 'none',
|
|
5158
|
+
pointerEvents: 'none',
|
|
5159
|
+
};
|
|
5160
|
+
const neighborMediaStyle: React.CSSProperties = {
|
|
5161
|
+
position: 'absolute',
|
|
5162
|
+
top: (finalRect?.top ?? 0) - (viewportRect?.top ?? 0),
|
|
5163
|
+
left: (finalRect?.left ?? 0) - (viewportRect?.left ?? 0),
|
|
5164
|
+
width: finalRect?.width,
|
|
5165
|
+
height: finalRect?.height,
|
|
5166
|
+
objectFit: objectFitStyle,
|
|
5167
|
+
pointerEvents: 'none',
|
|
5168
|
+
};
|
|
5169
|
+
|
|
5170
|
+
const navOverlayBaseStyle = contentRect ? {
|
|
5122
5171
|
position: 'fixed' as const,
|
|
5123
|
-
top:
|
|
5124
|
-
height:
|
|
5125
|
-
width:
|
|
5172
|
+
top: contentRect.top,
|
|
5173
|
+
height: contentRect.height,
|
|
5174
|
+
width: contentRect.width / 2,
|
|
5126
5175
|
zIndex: 9999,
|
|
5127
5176
|
} : null;
|
|
5128
5177
|
|
|
@@ -5220,30 +5269,52 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
5220
5269
|
)}
|
|
5221
5270
|
</div>
|
|
5222
5271
|
|
|
5223
|
-
{finalRect &&
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5272
|
+
{finalRect && viewportRect && neighborItem && (
|
|
5273
|
+
<div style={neighborBackingStyle}>
|
|
5274
|
+
{isVideoMedia(neighborItem) ? (
|
|
5275
|
+
<video
|
|
5276
|
+
key={\`neighbor-\${neighborIndex}-\${neighborItem.url}\`}
|
|
5277
|
+
src={neighborItem.url}
|
|
5278
|
+
muted
|
|
5279
|
+
playsInline
|
|
5280
|
+
preload='auto'
|
|
5281
|
+
style={neighborMediaStyle}
|
|
5282
|
+
/>
|
|
5283
|
+
) : (
|
|
5284
|
+
<img
|
|
5285
|
+
key={\`neighbor-\${neighborIndex}-\${neighborItem.url}\`}
|
|
5286
|
+
src={neighborItem.url}
|
|
5287
|
+
alt={neighborItem.name}
|
|
5288
|
+
style={neighborMediaStyle}
|
|
5289
|
+
/>
|
|
5290
|
+
)}
|
|
5291
|
+
</div>
|
|
5292
|
+
)}
|
|
5293
|
+
|
|
5294
|
+
{finalRect && viewportRect && currentItem && (
|
|
5295
|
+
<div style={currentBackingStyle}>
|
|
5296
|
+
{isCurrentVideo ? (
|
|
5297
|
+
<LightboxVideo
|
|
5298
|
+
key={\`\${index}-\${currentItem.url}\`}
|
|
5299
|
+
src={currentItem.url}
|
|
5300
|
+
phase={phase}
|
|
5301
|
+
mediaRef={mediaRef as React.RefObject<HTMLVideoElement>}
|
|
5302
|
+
mediaStyle={currentMediaStyle}
|
|
5303
|
+
onLoadedMetadata={handleMediaLoad}
|
|
5304
|
+
onClick={handleVideoClick}
|
|
5305
|
+
onMouseMove={handleVideoMouseMove}
|
|
5306
|
+
/>
|
|
5307
|
+
) : (
|
|
5308
|
+
<img
|
|
5309
|
+
key={\`\${index}-\${currentItem.url}\`}
|
|
5310
|
+
ref={mediaRef as React.RefObject<HTMLImageElement>}
|
|
5311
|
+
src={currentItem.url}
|
|
5312
|
+
alt={currentItem.name}
|
|
5313
|
+
onLoad={handleMediaLoad}
|
|
5314
|
+
style={currentMediaStyle}
|
|
5315
|
+
/>
|
|
5316
|
+
)}
|
|
5317
|
+
</div>
|
|
5247
5318
|
)}
|
|
5248
5319
|
|
|
5249
5320
|
{isOpen && navOverlayBaseStyle && items.length > 1 && !isCurrentVideo && (
|
|
@@ -5251,9 +5322,9 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
5251
5322
|
<div
|
|
5252
5323
|
style={{
|
|
5253
5324
|
...navOverlayBaseStyle,
|
|
5254
|
-
left:
|
|
5325
|
+
left: contentRect!.left,
|
|
5255
5326
|
cursor: 'w-resize',
|
|
5256
|
-
pointerEvents:
|
|
5327
|
+
pointerEvents: isSliding ? 'none' : 'auto',
|
|
5257
5328
|
}}
|
|
5258
5329
|
onClick={(e) => {
|
|
5259
5330
|
if (touchInteractionRef.current) {
|
|
@@ -5261,15 +5332,15 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
5261
5332
|
return;
|
|
5262
5333
|
}
|
|
5263
5334
|
e.stopPropagation();
|
|
5264
|
-
|
|
5335
|
+
startProgrammaticSlide(-1);
|
|
5265
5336
|
}}
|
|
5266
5337
|
/>
|
|
5267
5338
|
<div
|
|
5268
5339
|
style={{
|
|
5269
5340
|
...navOverlayBaseStyle,
|
|
5270
|
-
left:
|
|
5341
|
+
left: contentRect!.left + contentRect!.width / 2,
|
|
5271
5342
|
cursor: 'e-resize',
|
|
5272
|
-
pointerEvents:
|
|
5343
|
+
pointerEvents: isSliding ? 'none' : 'auto',
|
|
5273
5344
|
}}
|
|
5274
5345
|
onClick={(e) => {
|
|
5275
5346
|
if (touchInteractionRef.current) {
|
|
@@ -5277,7 +5348,7 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
5277
5348
|
return;
|
|
5278
5349
|
}
|
|
5279
5350
|
e.stopPropagation();
|
|
5280
|
-
|
|
5351
|
+
startProgrammaticSlide(1);
|
|
5281
5352
|
}}
|
|
5282
5353
|
/>
|
|
5283
5354
|
</>
|
|
@@ -5305,6 +5376,7 @@ export function Grid({ settings, content, isEditor, isPreviewMode, isEditMode, m
|
|
|
5305
5376
|
entriesCount,
|
|
5306
5377
|
lightbox,
|
|
5307
5378
|
imageDisplay,
|
|
5379
|
+
imageCorners,
|
|
5308
5380
|
lightboxImageDisplay,
|
|
5309
5381
|
slider,
|
|
5310
5382
|
sliderTiming,
|
|
@@ -5453,11 +5525,14 @@ export function Grid({ settings, content, isEditor, isPreviewMode, isEditMode, m
|
|
|
5453
5525
|
? Math.floor((columnsCount - itemsInLastRow) / 2) + 1
|
|
5454
5526
|
: 1;
|
|
5455
5527
|
|
|
5528
|
+
const imageBorderRadius = imageCorners ? scalingValue(imageCorners, isEditor) : undefined;
|
|
5529
|
+
|
|
5456
5530
|
const imageWrapperStyle: React.CSSProperties = {
|
|
5457
5531
|
width: imageWrapperWidth,
|
|
5458
5532
|
...(isCover
|
|
5459
5533
|
? { aspectRatio, height: 'auto', overflow: 'hidden' }
|
|
5460
5534
|
: { height: 'auto' }),
|
|
5535
|
+
...(imageBorderRadius ? { borderRadius: imageBorderRadius, overflow: 'hidden' } : {}),
|
|
5461
5536
|
};
|
|
5462
5537
|
|
|
5463
5538
|
const imageWrapperClassName = \`\${P}-item-image-wrapper\${isFitSlider ? \` \${P}-item-image-wrapper-fit-slider\` : ''}\`.trim();
|
|
@@ -5473,6 +5548,7 @@ export function Grid({ settings, content, isEditor, isPreviewMode, isEditMode, m
|
|
|
5473
5548
|
width: '100%',
|
|
5474
5549
|
height: '100%',
|
|
5475
5550
|
maxWidth: '100%',
|
|
5551
|
+
...(imageBorderRadius ? { borderRadius: imageBorderRadius } : {}),
|
|
5476
5552
|
}
|
|
5477
5553
|
: {
|
|
5478
5554
|
objectFit: 'contain',
|
|
@@ -5480,6 +5556,7 @@ export function Grid({ settings, content, isEditor, isPreviewMode, isEditMode, m
|
|
|
5480
5556
|
width: 'auto',
|
|
5481
5557
|
height: 'auto',
|
|
5482
5558
|
maxWidth: '100%',
|
|
5559
|
+
...(imageBorderRadius ? { borderRadius: imageBorderRadius } : {}),
|
|
5483
5560
|
};
|
|
5484
5561
|
|
|
5485
5562
|
const [dir, setDir] = useState('ltr');
|
|
@@ -5903,6 +5980,7 @@ type GridSettings = {
|
|
|
5903
5980
|
ratioValue: '1:1' | '2:3' | '3:4' | '4:5' | '16:9';
|
|
5904
5981
|
reversed: boolean;
|
|
5905
5982
|
};
|
|
5983
|
+
imageCorners?: number;
|
|
5906
5984
|
lightboxImageDisplay?: 'fit' | 'cover' | { display?: 'fit' | 'cover' };
|
|
5907
5985
|
slider: 'on' | 'off';
|
|
5908
5986
|
sliderTiming: number;
|
|
@@ -5951,12 +6029,12 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
5951
6029
|
};
|
|
5952
6030
|
|
|
5953
6031
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
5954
|
-
`,zr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Bm=["titleColor","subtitleColor","lightboxCounterColor"],Dm={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!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"}},gallery:{type:"array",label:"Gallery",display:{type:"media-pair-list-input"},items:{type:"object",properties:{media:{type:"array",items:{type:"object",properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["gallery"]},default:[{title:"Earth-orbital mission",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Salton Sea from Above",subtitle:"Hasselblad 500 EL / Zeiss Sonnar 250 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module Pilot",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module 3 porch",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Command Module",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-10.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"CSM and Lunar Module LM",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"David R. Scott during EVA",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Fourth day of the mission",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-8.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Landing of the Spider1",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-9.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""}]},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c","d","e","f"]},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:"Gutter",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"]}},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},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:{...zr.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:{...zr.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:{...zr.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:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",slider:"on",sliderTiming:3,direction:"horizontal",transition:"fade",showText:"always",alignEntries:"off",align:"top",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:"b",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:.064,lightboxCounterFontSize:.0373,lightboxCounterLineHeight:.0373},t:{type:"b",gridLayout:{entryWidth:.1041,horizontalGap:.26041,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:250,verticalGap:.09722,entriesCount:0,titleMarginTop:.01953125,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:.03255,titleLineHeight:.03255,titleLetterSpacing:-.00118,subtitleFontSize:.01822,subtitleLineHeight:.02083,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},d:{type:"b",gridLayout:{entryWidth:.0833,horizontalGap:.25,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:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","showText","alignEntries","align","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","verticalGap"]},{type:"row",title:"",items:["entriesCount","showText"]},{type:"row",title:"",items:["alignEntries","align"]}]},{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","direction"]},{type:"group",title:"",items:["sliderTiming","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:[...Bm],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Vm={element:Hm,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:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"subtitleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",subtitleFontSettings:"subtitleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"},schema:Dm,sourceCode:zm},Gm=50,$l=10,Ha="cntrl-lightbox-journal",$r=Ha,ma=`${Ha}-`,Cr=e=>`${Ha}-${e}`,ja=e=>e===$r||e.startsWith(ma),Cl=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Tl=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Cl(t.get(Cr(e)));if(i)return i}const n=Cl(t.get($r));if(n)return n;for(const[i]of t){if(!i.startsWith(ma))continue;const o=i.slice(ma.length);if(!/^\d+$/.test(o))continue;const l=Number.parseInt(o,10);if(Number.isFinite(l)&&l>=1)return l}return null},Ll=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},Xs=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(s=>{ja(s)&&i.searchParams.delete(s)}),t?i.searchParams.set(Cr(t),String(e)):i.searchParams.set($r,String(e));const o=n?"replaceState":"pushState",l=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",l)},qm=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Cr(e)||i===$r:ja(i));if(n.forEach(i=>t.searchParams.delete(i)),n.length>0){const i=`${t.pathname}${t.search}${t.hash}`;window.history.replaceState(window.history.state,"",i)}},Ys=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Cr(e)):[...t.keys()].some(n=>ja(n))},Km=(e,t)=>{if(Ys(t)){if(e){window.history.back();return}qm(t)}},Um=20,Xm=2,Br=e=>`max(${e}, ${Um}px)`,Mi=e=>((e==null?void 0:e.image)??[]).slice(0,Xm),Zs=e=>e.reduce((t,n)=>t+Mi(n).length,0),Ym=(e,t)=>{const n=e.slice(0,t).reduce((o,l)=>o+Mi(l).length,1),i=Mi(e[t]).length;return{start:n,end:n+i-1}},Zm=(e,t)=>{const n=Zs(e),{start:i,end:o}=Ym(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Yo=(e,t)=>t==="B"?e.flatMap((n,i)=>Mi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Mi(n)})),Jm=(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 Zm(i,o)},Il=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Qm=(e,t,n)=>e==="B"?t.length>1:Zs(n)>1,hn=.004,Bn=.004,Ii={title1Width:.13,title2Width:.13,title3Width:.14},Dn=(e,t,n,i,o)=>{const l=[];return t.title1&&l.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&l.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&l.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),l},Pi=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((l,s)=>l+s,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:l,widths:s},d)=>{if(l<=0||d<=0)return{overflow:l,widths:[d,...s]};const c=Math.min(l,d);return{overflow:l-c,widths:[d-c,...s]}},{overflow:i-1,widths:[]});return o},po=(e,t)=>Pi(e,t),ln=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Vn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Pi(e.length,n),effective:po(e.length,n)}},Js=(e,t,n,i)=>e.slice(0,i).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0),Qs=(e,t,n,i)=>e.slice(0,i+1).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0),Kn=["title1","title2","title3","count"],Be=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Oa={title1:"1",title2:"2",title3:"3",count:"Count"},za=e=>[Be(e,"fontFamily"),Be(e,"fontSettings"),{type:"row",items:[Be(e,"fontSize"),Be(e,"lineHeight"),Be(e,"letterSpacing"),Be(e,"wordSpacing")]},Be(e,"textAlign"),Be(e,"textAppearance")],eg=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Kn.map(e=>[Oa[e],za(e)]))}),tg={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},ng={title1:.02,title2:.02,title3:.02,count:.017},si=(e,t)=>{const n=i=>{const o=Be(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[tg[t]]}},ci=(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??ng[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Xt(i,n)};function ec({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,onClose:s}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:m=0,title2MarginLeft:x=0,title3MarginLeft:b=0,titleRowMarginBottom:T=0,titleHeaderLayout:f="desktop",contentMarginTop:L=0,iconMarginRight:$=0,closeIcon:R=null,closeIconMaxWidth:E=0,closeIconColor:C="#000000",closeIconHoverColor:U="#cccccc"}=n,k=y.scalingValue(L,i),j=y.scalingValue($,i),I=y.scalingValue(T,i),w=f==="mobile",W=ci("title1",si(n,"title1"),i),h=ci("title2",si(n,"title2"),i),S=ci("title3",si(n,"title3"),i),M=a.useMemo(()=>({title1Width:d??Ii.title1Width,title2Width:c??Ii.title2Width,title3Width:u??Ii.title3Width}),[d,c,u]),z=a.useMemo(()=>({title2MarginLeft:x,title3MarginLeft:b}),[x,b]),K=a.useMemo(()=>Dn(e,t,W,h,S),[e,t,W,h,S]),le=a.useMemo(()=>K.map(ee=>M[ee.widthKey]),[K,M]),Y=a.useMemo(()=>Pi(K.length,le),[K.length,le]),D=a.useMemo(()=>po(K.length,le),[K.length,le]),N=a.useMemo(()=>K.filter(ee=>ee.prefix==="title1"),[K]),F=a.useMemo(()=>K.filter(ee=>ee.prefix==="title2"||ee.prefix==="title3"),[K]),A=a.useMemo(()=>Vn(N,M),[N,M]),q=a.useMemo(()=>Vn(F,M),[F,M]),G=!!(t.title1||t.title2||t.title3),Z=R!==null;if(!(G||Z))return null;const me=(m??0)>0||o,v=(ee,pe)=>{const Ae=K.findIndex(V=>V.prefix===ee.prefix);if(!w||pe==="single-row")return{effectiveWidth:D[Ae]??0,resolvedWidth:Y[Ae]??0,maxWidth:ln(Ae,Y)};if(pe==="two-row-top"){const V=N.findIndex(je=>je.prefix===ee.prefix);return{effectiveWidth:A.effective[V]??0,resolvedWidth:A.resolved[V]??0,maxWidth:ln(V,A.resolved)}}const se=F.findIndex(V=>V.prefix===ee.prefix);return{effectiveWidth:q.effective[se]??0,resolvedWidth:q.resolved[se]??0,maxWidth:ln(se,q.resolved)}},fe=(ee,pe,Ae)=>{if(!w||Ae==="single-row"){const et=ee.findIndex(De=>De.prefix===pe.prefix),Ye=ee.map(De=>M[De.widthKey]),st=Pi(ee.length,Ye);return{effectiveWidth:po(ee.length,Ye)[et]??0,resolvedWidth:st[et]??0,maxWidth:ln(et,st)}}if(Ae==="two-row-top"){const et=ee.filter(De=>De.prefix==="title1"),Ye=et.findIndex(De=>De.prefix===pe.prefix),{resolved:st,effective:mt}=Vn(et,M);return{effectiveWidth:mt[Ye]??0,resolvedWidth:st[Ye]??0,maxWidth:ln(Ye,st)}}const se=ee.filter(et=>et.prefix==="title2"||et.prefix==="title3"),V=se.findIndex(et=>et.prefix===pe.prefix),{resolved:je,effective:We}=Vn(se,M);return{effectiveWidth:We[V]??0,resolvedWidth:je[V]??0,maxWidth:ln(V,je)}},J=ee=>Qs(K,Y,z,ee)+(w?0:m??0),de=()=>w?0:m??0,$e=ee=>F.slice(0,ee).reduce((pe,Ae,se)=>pe+(Ae.marginLeftKey?z[Ae.marginLeftKey]??0:0)+(q.resolved[se]??0),0),oe=ee=>{const pe=F[ee];return $e(ee)+(pe.marginLeftKey?z[pe.marginLeftKey]??0:0)+(q.resolved[ee]??0)},xe=(ee,pe,Ae)=>{const se=ee.marginLeftKey?z[ee.marginLeftKey]??0:0,{effectiveWidth:V,resolvedWidth:je,maxWidth:We}=Ae??v(ee,pe),et=Math.max(se,Bn),Ye=o&&pe==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":ee.prefix,style:{width:y.scalingValue(V,i),...se>0?{marginLeft:y.scalingValue(se,i)}:{}},children:[r.jsx("p",{className:ee.className,style:ee.style,children:ee.text}),Ye&&ee.marginLeftKey?r.jsx("div",{"data-controls":ee.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:y.scalingValue(-se,i),width:y.scalingValue(et,i),height:"100%",pointerEvents:"auto"}}):null,Ye?r.jsx("div",{"data-controls":ee.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(We),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:y.scalingValue(-hn/2,i),width:y.scalingValue(hn,i),height:"100%",pointerEvents:"auto"}}):null]},ee.className)},Q=(ee="two-row")=>{const pe=K.findIndex(V=>V.prefix==="title1"),Ae=pe>=0?Y[pe]:M.title1Width,se=ee==="two-row"&&o;return r.jsx("div",{...se?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ae)}:{},style:{width:y.scalingValue(m??0,i),flexShrink:0,alignSelf:"stretch",...se?{pointerEvents:"auto"}:{}}})},ye=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:W,"aria-hidden":"true",children:" "}),ve=ee=>{const pe=Dn(e,ee,W,h,S);return r.jsx(r.Fragment,{children:pe.map(Ae=>xe(Ae,"single-row",fe(pe,Ae,"single-row")))})},ke=ee=>{const pe=Dn(e,ee,W,h,S),Ae=pe.find(se=>se.prefix==="title1");return Ae?xe(Ae,"two-row-top",fe(pe,Ae,"two-row-top")):null},we=(ee,pe=!1)=>{const Ae=Dn(e,ee,W,h,S),se=Ae.filter(We=>We.prefix==="title2"||We.prefix==="title3"),V=o&&pe;return se.length>0||V||(T??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[se.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[r.jsx("div",{className:`${e}-titles-stack`,children:se.map(We=>xe(We,"two-row-bottom",fe(Ae,We,"two-row-bottom")))}),pe&&o?r.jsxs(r.Fragment,{children:[re(),ae()]}):null]}):null,(T??0)>0||V?r.jsx("div",{"data-controls":V?"titleRowMarginBottom":void 0,"data-controls-axis":V?"y":void 0,"data-controls-reverse":V?"":void 0,className:V?`${e}-control`:void 0,style:{height:I,width:"100%",flexShrink:0,pointerEvents:V?"auto":"none"}}):null]}):null},Me=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:y.scalingValue(E??0,i),height:y.scalingValue(E??0,i),marginRight:j,"--close-icon-hover-color":U},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:ee=>{ee.stopPropagation(),s==null||s()},"aria-label":"Close",children:r.jsx(rn,{url:R??"",fill:C,hoverFill:i&&!l?C:U,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:j,height:"100%",pointerEvents:"auto"}})]}),X=()=>Z?r.jsx("div",{className:`${e}-titles-row-header-controls`,children:Me()}):null,ue=ee=>r.jsx("div",{className:`${e}-titles-row-titles`,children:r.jsx("div",{className:`${e}-titles-stack`,children:ee})}),Se=ee=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[Z||G?ye():null,me?Q("two-row"):null,ue(ee),X()]}),O=(ee,pe=!1)=>r.jsxs(r.Fragment,{children:[Se(ke(ee)),we(ee,pe)]}),ce=()=>{const ee=w?-1:K.findIndex(se=>se.prefix==="title1"),pe=!w&&(o||(m??0)>0)?(()=>{const se=m??0,V=ee>=0?Y[ee]:M.title1Width,je=Math.max(se,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(V),style:{position:"absolute",top:0,left:0,width:y.scalingValue(je,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Ae=K.flatMap((se,V)=>{if(!se.marginLeftKey)return[];const je=z[se.marginLeftKey]??0,We=Js(K,Y,z,V)+de(),et=Math.max(je,Bn);return r.jsx("div",{"data-controls":se.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Y[V]),style:{position:"absolute",top:0,left:y.scalingValue(We,i),width:y.scalingValue(et,i),height:"100%",pointerEvents:"auto"}},se.marginLeftKey)});return pe?[pe,...Ae]:Ae},H=()=>K.map((ee,pe)=>{const Ae=ln(pe,Y),V=J(pe)-hn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":ee.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ae),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:y.scalingValue(V,i),width:y.scalingValue(hn,i),height:"100%",pointerEvents:"auto"}})},`${ee.widthKey}-junction`)}),re=()=>F.flatMap((ee,pe)=>{if(!ee.marginLeftKey)return[];const Ae=z[ee.marginLeftKey]??0,se=$e(pe),V=Math.max(Ae,Bn),{resolvedWidth:je}=v(ee,"two-row-bottom");return r.jsx("div",{"data-controls":ee.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:y.scalingValue(se,i),width:y.scalingValue(V,i),height:"100%",pointerEvents:"auto"}},ee.marginLeftKey)}),ae=()=>F.map((ee,pe)=>{const{maxWidth:Ae}=v(ee,"two-row-bottom"),V=oe(pe)-hn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":ee.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ae),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:y.scalingValue(V,i),width:y.scalingValue(hn,i),height:"100%",pointerEvents:"auto"}})},`${ee.widthKey}-junction`)}),ne=()=>!o||w?null:r.jsxs(r.Fragment,{children:[ce(),H()]}),ie=!!(t.title2||t.title3||(T??0)>0||o),be=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Z||G?ye():null,me?Q("single-row"):null,G?ue(ve(t)):r.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),X(),ne()]}),Ce=()=>r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...ie?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:ie?void 0:{flex:"0 0 auto",height:"auto"},children:O(t,!0)}),ne()]});return r.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:k,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...w?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${w?` ${e}-lightbox-content-area-stacked`:""}`,children:r.jsx("div",{className:`${e}-text-bar-cell${w?` ${e}-text-bar-cell-stacked`:""}`,style:w?void 0:{flex:1,minWidth:0,width:"100%"},children:w?Ce():be()})})})]})}function ig(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function og(e){return`
|
|
6032
|
+
`,jr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Um=["titleColor","subtitleColor","lightboxCounterColor"],Xm={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!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"}},gallery:{type:"array",label:"Gallery",display:{type:"media-pair-list-input"},items:{type:"object",properties:{media:{type:"array",items:{type:"object",properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["gallery"]},default:[{title:"Earth-orbital mission",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Salton Sea from Above",subtitle:"Hasselblad 500 EL / Zeiss Sonnar 250 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module Pilot",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module 3 porch",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Command Module",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-10.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"CSM and Lunar Module LM",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"David R. Scott during EVA",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Fourth day of the mission",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-8.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Landing of the Spider1",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-9.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""}]},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c","d","e","f"]},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:"Gutter",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"]}},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},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"}}},imageCorners:{type:"number",scope:"layout",title:"Round corners",min:0,display:{type:"numeric-input"}},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:{...jr.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:{...jr.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:{...jr.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:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",slider:"on",sliderTiming:3,direction:"horizontal",transition:"fade",showText:"always",alignEntries:"off",align:"top",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:"b",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,imageCorners:0,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:.064,lightboxCounterFontSize:.0373,lightboxCounterLineHeight:.0373},t:{type:"b",gridLayout:{entryWidth:.1041,horizontalGap:.26041,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:250,verticalGap:.09722,entriesCount:0,titleMarginTop:.01953125,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,imageCorners:0,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.03255,titleLineHeight:.03255,titleLetterSpacing:-.00118,subtitleFontSize:.01822,subtitleLineHeight:.02083,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},d:{type:"b",gridLayout:{entryWidth:.0833,horizontalGap:.25,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:200,verticalGap:.09722,entriesCount:0,titleMarginTop:.008,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,imageCorners:0,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:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","showText","alignEntries","align","entriesCount","lightbox","imageDisplay","imageCorners","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","verticalGap"]},{type:"row",title:"",items:["entriesCount","showText"]},{type:"row",title:"",items:["alignEntries","align"]}]},{id:"imageSettings",icon:"cover",title:"Image settings",tooltip:"Image settings",layout:["__componentName__",{type:"row",title:"Image",items:["imageDisplay","imageCorners"]},{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",title:"Slider",items:[{type:"group",title:"",items:["slider","direction"]},{type:"group",title:"",items:["sliderTiming","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:[...Um],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Ym={element:Vm,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:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"subtitleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",subtitleFontSettings:"subtitleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"},schema:Xm,sourceCode:Km},Zm=50,$l=10,Ha="cntrl-lightbox-journal",Sr=Ha,pa=`${Ha}-`,$r=e=>`${Ha}-${e}`,Na=e=>e===Sr||e.startsWith(pa),Cl=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Tl=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Cl(t.get($r(e)));if(i)return i}const n=Cl(t.get(Sr));if(n)return n;for(const[i]of t){if(!i.startsWith(pa))continue;const o=i.slice(pa.length);if(!/^\d+$/.test(o))continue;const l=Number.parseInt(o,10);if(Number.isFinite(l)&&l>=1)return l}return null},Ll=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},Zs=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(s=>{Na(s)&&i.searchParams.delete(s)}),t?i.searchParams.set($r(t),String(e)):i.searchParams.set(Sr,String(e));const o=n?"replaceState":"pushState",l=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",l)},Jm=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===$r(e)||i===Sr:Na(i));if(n.forEach(i=>t.searchParams.delete(i)),n.length>0){const i=`${t.pathname}${t.search}${t.hash}`;window.history.replaceState(window.history.state,"",i)}},Js=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has($r(e)):[...t.keys()].some(n=>Na(n))},Qm=(e,t)=>{if(Js(t)){if(e){window.history.back();return}Jm(t)}},eg=20,tg=2,zr=e=>`max(${e}, ${eg}px)`,Pi=e=>((e==null?void 0:e.image)??[]).slice(0,tg),Qs=e=>e.reduce((t,n)=>t+Pi(n).length,0),ng=(e,t)=>{const n=e.slice(0,t).reduce((o,l)=>o+Pi(l).length,1),i=Pi(e[t]).length;return{start:n,end:n+i-1}},ig=(e,t)=>{const n=Qs(e),{start:i,end:o}=ng(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Xo=(e,t)=>t==="B"?e.flatMap((n,i)=>Pi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Pi(n)})),og=(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 ig(i,o)},Il=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",rg=(e,t,n)=>e==="B"?t.length>1:Qs(n)>1,hn=.004,Dn=.004,Ri={title1Width:.13,title2Width:.13,title3Width:.14},Vn=(e,t,n,i,o)=>{const l=[];return t.title1&&l.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&l.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&l.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),l},Ai=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((l,s)=>l+s,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:l,widths:s},c)=>{if(l<=0||c<=0)return{overflow:l,widths:[c,...s]};const d=Math.min(l,c);return{overflow:l-d,widths:[c-d,...s]}},{overflow:i-1,widths:[]});return o},po=(e,t)=>Ai(e,t),an=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Gn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Ai(e.length,n),effective:po(e.length,n)}},ec=(e,t,n,i)=>e.slice(0,i).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0),tc=(e,t,n,i)=>e.slice(0,i+1).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0),Un=["title1","title2","title3","count"],Ge=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Oa={title1:"1",title2:"2",title3:"3",count:"Count"},ja=e=>[Ge(e,"fontFamily"),Ge(e,"fontSettings"),{type:"row",items:[Ge(e,"fontSize"),Ge(e,"lineHeight"),Ge(e,"letterSpacing"),Ge(e,"wordSpacing")]},Ge(e,"textAlign"),Ge(e,"textAppearance")],ag=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Un.map(e=>[Oa[e],ja(e)]))}),lg={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},sg={title1:.02,title2:.02,title3:.02,count:.017},si=(e,t)=>{const n=i=>{const o=Ge(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[lg[t]]}},ci=(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??sg[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Xt(i,n)};function nc({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,onClose:s}){const{title1Width:c,title2Width:d,title3Width:u,title1MarginLeft:m=0,title2MarginLeft:x=0,title3MarginLeft:w=0,titleRowMarginBottom:$=0,titleHeaderLayout:f="desktop",contentMarginTop:S=0,iconMarginRight:L=0,closeIcon:M=null,closeIconMaxWidth:A=0,closeIconColor:C="#000000",closeIconHoverColor:J="#cccccc"}=n,k=v.scalingValue(S,i),U=v.scalingValue(L,i),I=v.scalingValue($,i),R=f==="mobile",T=ci("title1",si(n,"title1"),i),y=ci("title2",si(n,"title2"),i),h=ci("title3",si(n,"title3"),i),F=a.useMemo(()=>({title1Width:c??Ri.title1Width,title2Width:d??Ri.title2Width,title3Width:u??Ri.title3Width}),[c,d,u]),W=a.useMemo(()=>({title2MarginLeft:x,title3MarginLeft:w}),[x,w]),V=a.useMemo(()=>Vn(e,t,T,y,h),[e,t,T,y,h]),ne=a.useMemo(()=>V.map(Z=>F[Z.widthKey]),[V,F]),X=a.useMemo(()=>Ai(V.length,ne),[V.length,ne]),z=a.useMemo(()=>po(V.length,ne),[V.length,ne]),H=a.useMemo(()=>V.filter(Z=>Z.prefix==="title1"),[V]),_=a.useMemo(()=>V.filter(Z=>Z.prefix==="title2"||Z.prefix==="title3"),[V]),E=a.useMemo(()=>Gn(H,F),[H,F]),q=a.useMemo(()=>Gn(_,F),[_,F]),Y=!!(t.title1||t.title2||t.title3),ee=M!==null;if(!(Y||ee))return null;const pe=(m??0)>0||o,b=(Z,de)=>{const We=V.findIndex(O=>O.prefix===Z.prefix);if(!R||de==="single-row")return{effectiveWidth:z[We]??0,resolvedWidth:X[We]??0,maxWidth:an(We,X)};if(de==="two-row-top"){const O=H.findIndex(Oe=>Oe.prefix===Z.prefix);return{effectiveWidth:E.effective[O]??0,resolvedWidth:E.resolved[O]??0,maxWidth:an(O,E.resolved)}}const se=_.findIndex(O=>O.prefix===Z.prefix);return{effectiveWidth:q.effective[se]??0,resolvedWidth:q.resolved[se]??0,maxWidth:an(se,q.resolved)}},ye=(Z,de,We)=>{if(!R||We==="single-row"){const nt=Z.findIndex(He=>He.prefix===de.prefix),Ue=Z.map(He=>F[He.widthKey]),Ce=Ai(Z.length,Ue);return{effectiveWidth:po(Z.length,Ue)[nt]??0,resolvedWidth:Ce[nt]??0,maxWidth:an(nt,Ce)}}if(We==="two-row-top"){const nt=Z.filter(He=>He.prefix==="title1"),Ue=nt.findIndex(He=>He.prefix===de.prefix),{resolved:Ce,effective:Fe}=Gn(nt,F);return{effectiveWidth:Fe[Ue]??0,resolvedWidth:Ce[Ue]??0,maxWidth:an(Ue,Ce)}}const se=Z.filter(nt=>nt.prefix==="title2"||nt.prefix==="title3"),O=se.findIndex(nt=>nt.prefix===de.prefix),{resolved:Oe,effective:_e}=Gn(se,F);return{effectiveWidth:_e[O]??0,resolvedWidth:Oe[O]??0,maxWidth:an(O,Oe)}},Q=Z=>tc(V,X,W,Z)+(R?0:m??0),xe=()=>R?0:m??0,$e=Z=>_.slice(0,Z).reduce((de,We,se)=>de+(We.marginLeftKey?W[We.marginLeftKey]??0:0)+(q.resolved[se]??0),0),oe=Z=>{const de=_[Z];return $e(Z)+(de.marginLeftKey?W[de.marginLeftKey]??0:0)+(q.resolved[Z]??0)},ie=(Z,de,We)=>{const se=Z.marginLeftKey?W[Z.marginLeftKey]??0:0,{effectiveWidth:O,resolvedWidth:Oe,maxWidth:_e}=We??b(Z,de),nt=Math.max(se,Dn),Ue=o&&de==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":Z.prefix,style:{width:v.scalingValue(O,i),...se>0?{marginLeft:v.scalingValue(se,i)}:{}},children:[r.jsx("p",{className:Z.className,style:Z.style,children:Z.text}),Ue&&Z.marginLeftKey?r.jsx("div",{"data-controls":Z.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Oe),style:{position:"absolute",top:0,left:v.scalingValue(-se,i),width:v.scalingValue(nt,i),height:"100%",pointerEvents:"auto"}}):null,Ue?r.jsx("div",{"data-controls":Z.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(_e),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:v.scalingValue(-hn/2,i),width:v.scalingValue(hn,i),height:"100%",pointerEvents:"auto"}}):null]},Z.className)},B=(Z="two-row")=>{const de=V.findIndex(O=>O.prefix==="title1"),We=de>=0?X[de]:F.title1Width,se=Z==="two-row"&&o;return r.jsx("div",{...se?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(We)}:{},style:{width:v.scalingValue(m??0,i),flexShrink:0,alignSelf:"stretch",...se?{pointerEvents:"auto"}:{}}})},le=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:T,"aria-hidden":"true",children:" "}),re=Z=>{const de=Vn(e,Z,T,y,h);return r.jsx(r.Fragment,{children:de.map(We=>ie(We,"single-row",ye(de,We,"single-row")))})},ke=Z=>{const de=Vn(e,Z,T,y,h),We=de.find(se=>se.prefix==="title1");return We?ie(We,"two-row-top",ye(de,We,"two-row-top")):null},fe=(Z,de=!1)=>{const We=Vn(e,Z,T,y,h),se=We.filter(_e=>_e.prefix==="title2"||_e.prefix==="title3"),O=o&&de;return se.length>0||O||($??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[se.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[r.jsx("div",{className:`${e}-titles-stack`,children:se.map(_e=>ie(_e,"two-row-bottom",ye(We,_e,"two-row-bottom")))}),de&&o?r.jsxs(r.Fragment,{children:[K(),ae()]}):null]}):null,($??0)>0||O?r.jsx("div",{"data-controls":O?"titleRowMarginBottom":void 0,"data-controls-axis":O?"y":void 0,"data-controls-reverse":O?"":void 0,className:O?`${e}-control`:void 0,style:{height:I,width:"100%",flexShrink:0,pointerEvents:O?"auto":"none"}}):null]}):null},Pe=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:v.scalingValue(A??0,i),height:v.scalingValue(A??0,i),marginRight:U,"--close-icon-hover-color":J},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Z=>{Z.stopPropagation(),s==null||s()},"aria-label":"Close",children:r.jsx(on,{url:M??"",fill:C,hoverFill:i&&!l?C:J,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:U,height:"100%",pointerEvents:"auto"}})]}),ve=()=>ee?r.jsx("div",{className:`${e}-titles-row-header-controls`,children:Pe()}):null,we=Z=>r.jsx("div",{className:`${e}-titles-row-titles`,children:r.jsx("div",{className:`${e}-titles-stack`,children:Z})}),Se=Z=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[ee||Y?le():null,pe?B("two-row"):null,we(Z),ve()]}),G=(Z,de=!1)=>r.jsxs(r.Fragment,{children:[Se(ke(Z)),fe(Z,de)]}),me=()=>{const Z=R?-1:V.findIndex(se=>se.prefix==="title1"),de=!R&&(o||(m??0)>0)?(()=>{const se=m??0,O=Z>=0?X[Z]:F.title1Width,Oe=Math.max(se,Dn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(O),style:{position:"absolute",top:0,left:0,width:v.scalingValue(Oe,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,We=V.flatMap((se,O)=>{if(!se.marginLeftKey)return[];const Oe=W[se.marginLeftKey]??0,_e=ec(V,X,W,O)+xe(),nt=Math.max(Oe,Dn);return r.jsx("div",{"data-controls":se.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(X[O]),style:{position:"absolute",top:0,left:v.scalingValue(_e,i),width:v.scalingValue(nt,i),height:"100%",pointerEvents:"auto"}},se.marginLeftKey)});return de?[de,...We]:We},D=()=>V.map((Z,de)=>{const We=an(de,X),O=Q(de)-hn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":Z.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(We),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:v.scalingValue(O,i),width:v.scalingValue(hn,i),height:"100%",pointerEvents:"auto"}})},`${Z.widthKey}-junction`)}),K=()=>_.flatMap((Z,de)=>{if(!Z.marginLeftKey)return[];const We=W[Z.marginLeftKey]??0,se=$e(de),O=Math.max(We,Dn),{resolvedWidth:Oe}=b(Z,"two-row-bottom");return r.jsx("div",{"data-controls":Z.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Oe),style:{position:"absolute",top:0,left:v.scalingValue(se,i),width:v.scalingValue(O,i),height:"100%",pointerEvents:"auto"}},Z.marginLeftKey)}),ae=()=>_.map((Z,de)=>{const{maxWidth:We}=b(Z,"two-row-bottom"),O=oe(de)-hn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":Z.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(We),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:v.scalingValue(O,i),width:v.scalingValue(hn,i),height:"100%",pointerEvents:"auto"}})},`${Z.widthKey}-junction`)}),ge=()=>!o||R?null:r.jsxs(r.Fragment,{children:[me(),D()]}),ce=!!(t.title2||t.title3||($??0)>0||o),be=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[ee||Y?le():null,pe?B("single-row"):null,Y?we(re(t)):r.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),ve(),ge()]}),Ee=()=>r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...ce?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:ce?void 0:{flex:"0 0 auto",height:"auto"},children:G(t,!0)}),ge()]});return r.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:k,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...R?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${R?` ${e}-lightbox-content-area-stacked`:""}`,children:r.jsx("div",{className:`${e}-text-bar-cell${R?` ${e}-text-bar-cell-stacked`:""}`,style:R?void 0:{flex:1,minWidth:0,width:"100%"},children:R?Ee():be()})})})]})}function cg(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function dg(e){return`
|
|
5955
6033
|
.${e}-wrapper {
|
|
5956
6034
|
display: grid;
|
|
5957
6035
|
align-items: start;
|
|
5958
6036
|
justify-content: center;
|
|
5959
|
-
min-height: ${
|
|
6037
|
+
min-height: ${cg(48)};
|
|
5960
6038
|
}
|
|
5961
6039
|
.${e}-item {
|
|
5962
6040
|
display: flex;
|
|
@@ -6282,7 +6360,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
6282
6360
|
pointer-events: auto;
|
|
6283
6361
|
flex-shrink: 0;
|
|
6284
6362
|
}
|
|
6285
|
-
`}const Rl={url:"",name:"",objectFit:"cover"},$n=500,Ki=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",rg=72,ag=50,lg=1e4,sg=650,cg=500;function dg(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,l=e.top-t.top;return`translate(${o}px, ${l}px) scale(${n}, ${i})`}function tc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=or(e);return{left:i.x,top:i.y,width:i.width,height:i.height}}const n=e.getBoundingClientRect();return{left:n.left,top:n.top,width:n.width,height:n.height}}function ug(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?tc(i,n):null}function pg(e){return e.reduce((t,n,i)=>{const o=Ba(n.gallery),s=Da(o).filter(d=>d.lightboxMedia).map(d=>d.lightboxMedia);return s.length===0||t.push({gridIndex:i,items:s,entry:{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}),t},[])}function Zi(e,t,n){var o;if(e.length<=1)return null;const i=(t+n+e.length)%e.length;return((o=e[i])==null?void 0:o.items[0])??null}function El(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return Zi(e,i,n)}const mg=.03;function nc(e){return e.width*mg}const Dr={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function _o(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function kl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function gg(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ga(e,t,n){const i=e.getBoundingClientRect(),o=i.width,l=i.height,s=t/n,d=o/l;if(s>d){const u=o/s;return{width:o,height:u,left:i.left,top:i.top+(l-u)/2}}const c=l*s;return{width:c,height:l,left:i.left+(o-c)/2,top:i.top}}function hg(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ga(e,t.width,t.height)}function fg(e,t){if(Vi(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function yg(e){const t=new Set,n=[];for(const i of e){const o=Ba(i.gallery),l=Da(o);for(const s of l)for(const d of[s.displayMedia,s.lightboxMedia])d!=null&&d.url&&!t.has(d.url)&&(t.add(d.url),n.push(d))}return n}function vg({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Vi(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function Ai(e,t,n){const{width:i,height:o,top:l}=e,{left:s,width:d}=n,c=nc(n);return t==="left"?{left:s+c-i,top:l,width:i,height:o}:{left:s+d-c,top:l,width:i,height:o}}function rr(e,t,n){const i=Ai(e,t,n);return{...i,left:2*i.left-e.left}}function xg(e,t,n){const{left:i,width:o}=n,l=nc(n);return t==="left"?{left:i,top:e.top,width:l,height:e.height}:{left:i+o-l,top:e.top,width:l,height:e.height}}function ic(e,t,n,i){const o=Ai(e,"left",i),l=Ai(e,"right",i),s=rr(e,"left",i),d=rr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:l,end:e};case"left-adjacent":return{start:o,end:s};case"far-right":return{start:d,end:l};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:l};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:l,end:d};case"far-left":return{start:s,end:o};default:return{start:e,end:e}}}function bg(e,t,n,i){const{start:o,end:l}=ic(e,t,n,i);return{x:l.left-o.left,y:l.top-o.top}}function wg(e,t,n){const i=Ai(e,t,n),o=rr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function oc(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function Ba(e){if(!e)return;if(oc(e))return e;if(!Array.isArray(e))return;const[t,n]=e,i=t!=null&&t.url?t:void 0,o=n!=null&&n.url?n:void 0;if(!(!i&&!o))return[{media:[o??i??Rl,i??o??Rl]}]}function Sg(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function $g(e){const[t]=e.media;return t!=null&&t.url?t:null}function Da(e){if(!Array.isArray(e)||e.length===0)return[];if(oc(e)){const t=[];for(const n of e){const i=Sg(n);if(!i)continue;const o=$g(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.url?o:null})}return t}return e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function Vi(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Cg({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return Vi(e)?r.jsx("video",{src:e.url,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onClick:o}):r.jsx("img",{src:e.url,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function Tg({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:l,onTransitionEnd:s}){const d=a.useRef(null);return a.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:s,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:l,onClick:c=>c.stopPropagation(),style:o},e)})}function No({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Vi(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const l=o.currentTarget;l.videoWidth>0&&l.videoHeight>0&&(i==null||i(e.url,l.videoWidth,l.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const l=o.currentTarget;l.naturalWidth>0&&l.naturalHeight>0&&(i==null||i(e.url,l.naturalWidth,l.naturalHeight))},onTransitionEnd:n})}function Lg({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:m,layoutId:x,sourceRect:b,resolveCloseSourceRect:T,onClose:f,onPrev:L,onNext:$}){const R=a.useRef(null),E=a.useRef(null),C=a.useRef(null),U=a.useRef(new Map),[k,j]=a.useState(0),I=a.useRef(null),w=a.useRef(0),W=a.useRef(0),h=a.useRef("none"),S=a.useRef(!1),M=a.useRef(!1),z=a.useRef(!1),K=a.useRef(null),le=a.useRef(null),Y=a.useRef(null),D=a.useRef(()=>{}),N=a.useRef(null),F=a.useRef(null),A=a.useRef(null),q=a.useRef(!1),[G,Z]=a.useState(null),[_,me]=a.useState(Dr),[v,fe]=a.useState(0),[J,de]=a.useState("opening"),[$e,oe]=a.useState(0),[xe,Q]=a.useState(0),[ye,ve]=a.useState(!1),[ke,we]=a.useState(null),[Me,X]=a.useState(null),[ue,Se]=a.useState(null),[O,ce]=a.useState(!1),[H,re]=a.useState(null),[ae,ne]=a.useState(!1),ie=a.useRef(!1),[be,Ce]=a.useState(!1),[ee,pe]=a.useState(!1),Ae=a.useRef(n),se=a.useRef(void 0),V=t[n],je=V?Vi(V):!1,We=xe!==0||ye,et=!s&&(!l||!!d),Ye=c&&!s,st=u.length>1,mt=a.useCallback((g,ge)=>t.length<=1?null:t[(g+ge+t.length)%t.length]??null,[t]),De=st?Zi(u,m,-1):mt(n,-1),ot=st?Zi(u,m,1):mt(n,1),$t=ke===-1&&We?st&&Me!==null?Zi(u,Me,-1):ue!==null?mt(ue,-1):null:null,rt=ke===1&&We?st&&Me!==null?Zi(u,Me,1):ue!==null?mt(ue,1):null:null,Ue=$t&&$t.url!==(De==null?void 0:De.url)?$t:null,ht=rt&&rt.url!==(ot==null?void 0:ot.url)?rt:null,xt=De&&Ye?(()=>{const g=st?El(u,m,-1):t.length>2?mt((n-1+t.length)%t.length,-1):null;return g&&g.url!==De.url?g:null})():null,dt=ot&&Ye?(()=>{const g=st?El(u,m,1):t.length>2?mt((n+1)%t.length,1):null;return g&&g.url!==ot.url?g:null})():null,kt=Ue??xt,_t=ht??dt,Qe=a.useCallback((g,ge,Re)=>{if(!g||!ge||!Re)return;const Ie=U.current,Ze=Ie.get(g);(Ze==null?void 0:Ze.width)===ge&&(Ze==null?void 0:Ze.height)===Re||(Ie.set(g,{width:ge,height:Re}),j(Et=>Et+1))},[]),Tt=a.useCallback(g=>{if(!(g!=null&&g.url))return null;const ge=U.current.get(g.url);return hg(E.current,ge)},[k,v]),Lt=a.useCallback(()=>{if(!V)return;const g=Tt(V);if(g){Z(g);return}const ge=E.current;ge&&Z(kl(ge))},[V,Tt]),Ge=a.useCallback(g=>{if(st){const ge=u.length;X((m+g+ge)%ge),Se(null);return}t.length>1&&(Se((n+g+t.length)%t.length),X(null))},[st,u.length,m,t.length,n]),qe=a.useCallback(g=>{z.current=g,ve(g)},[]),Pe=a.useCallback(()=>{K.current!==null&&(window.clearTimeout(K.current),K.current=null)},[]),gt=a.useCallback(()=>{Pe(),K.current=window.setTimeout(()=>{Pe(),qe(!1)},Ki+32)},[Pe,qe]),It=a.useCallback(()=>{const g=R.current;if(!g){me({left:0,top:0,width:typeof window<"u"?window.innerWidth:Dr.width,height:typeof window<"u"?window.innerHeight:Dr.height});return}const ge=g.getBoundingClientRect();me({left:ge.left,top:ge.top,width:ge.width,height:ge.height})},[]),Mt=a.useCallback((g,ge)=>{if(We){if(be&&!ye)return`translate(${xe}px, 0px)`;if(ye&&ke!==null){const Re=Tt(g);if(!Re)return;const{x:Ie,y:Ze}=bg(Re,ge,ke,_);return`translate(${Ie}px, ${Ze}px)`}if(ye)return"translate(0px, 0px)"}},[We,be,ye,xe,ke,_,Tt]),Dt=a.useCallback(()=>{const g=le.current;le.current=null,Pe(),qe(!1),we(null),X(null),Se(null),Q(0),Ce(!1),S.current=!1,W.current=0,h.current="none",g===-1?L():g===1&&$()},[Pe,qe,L,$]),en=a.useCallback(()=>{Pe(),K.current=window.setTimeout(()=>{le.current!==null&&Dt()},Ki+32)},[Pe,Dt]),on=a.useCallback(()=>{Pe(),le.current=null,qe(!1),we(null),X(null),Se(null),Q(0),Ce(!1),S.current=!1,W.current=0,h.current="none"},[Pe,qe]),bt=a.useCallback(g=>{if(!(!Ye||!G)){if(z.current){if(le.current===g){Y.current=g,Dt();return}on()}Pe(),Ge(g),le.current=g,we(g),qe(!0),en()}},[Ye,G,Dt,on,Pe,Ge,qe,en]);D.current=bt;const Rt=a.useCallback(()=>{N.current=null,q.current=!1,F.current!==null&&(window.clearInterval(F.current),F.current=null),A.current!==null&&(window.clearTimeout(A.current),A.current=null)},[]),Ut=a.useCallback(g=>{F.current!==null&&window.clearInterval(F.current);const ge=q.current?cg:sg;F.current=window.setInterval(()=>{D.current(g)},ge)},[]),Kt=a.useCallback(g=>{N.current!==g&&(Rt(),N.current=g,q.current=!1,D.current(g),Ut(g),A.current=window.setTimeout(()=>{A.current=null,N.current===g&&(q.current=!0,Ut(g))},lg))},[Rt,Ut]),ft=a.useCallback(()=>{const g=E.current;if(!g)return;const ge=V==null?void 0:V.url,Re=ge?U.current.get(ge):void 0;if(Re!=null&&Re.width&&(Re!=null&&Re.height)){Z(ga(g,Re.width,Re.height));return}const Ie=C.current;if(Ie&&ge&&(Ie.src===ge||Ie.currentSrc===ge)){const{width:Et,height:Ve}=gg(Ie);if(Et&&Ve){Qe(ge,Et,Ve),Z(ga(g,Et,Ve));return}}const Ze=kl(g);!Ze.width||!Ze.height||Z(Ze)},[V==null?void 0:V.url,Qe]),Jt=a.useCallback(g=>{if(C.current=g,!!g){if(g instanceof HTMLVideoElement){g.readyState>=1&&g.videoWidth>0&&ft();return}g.complete&&g.naturalWidth>0&&ft()}},[ft]),Te=a.useCallback(()=>{It(),ft(),fe(g=>g+1)},[It,ft]);a.useEffect(()=>{Te();const g=E.current,ge=R.current,Re=new ResizeObserver(()=>Te());return g&&Re.observe(g),ge&&Re.observe(ge),window.addEventListener("resize",Te),()=>{Re.disconnect(),window.removeEventListener("resize",Te)}},[Te,n,x]),a.useLayoutEffect(()=>{if(!V)return;const g=C.current;if(g){if(g instanceof HTMLImageElement&&g.complete&&g.naturalWidth>0){ft();return}g instanceof HTMLVideoElement&&g.readyState>=1&&g.videoWidth>0&&ft()}},[V==null?void 0:V.url,n,ft]),a.useEffect(()=>{Lt()},[Lt,k]),a.useEffect(()=>{const g=new Set,ge=[],Re=Ie=>{!(Ie!=null&&Ie.url)||g.has(Ie.url)||(g.add(Ie.url),ge.push(Ie))};t.forEach(Re),u.forEach(Ie=>Ie.items.forEach(Re)),ge.forEach(Ie=>{U.current.has(Ie.url)||fg(Ie,Qe)})},[t,u,Qe]),a.useEffect(()=>{if(J!=="opening"||!G)return;if(!b){de("open");return}ce(!1);const g=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ce(!0),de("open")})});return()=>cancelAnimationFrame(g)},[J,G,b]),a.useEffect(()=>{if(J!=="closing")return;const g=setTimeout(()=>f(),$n);return()=>clearTimeout(g)},[J,f]),a.useEffect(()=>()=>{Pe()},[Pe]),a.useLayoutEffect(()=>{Ae.current===n&&se.current===(V==null?void 0:V.url)||(Pe(),le.current=null,we(null),X(null),Se(null),oe(0),Q(0),qe(!1),pe(!1),Ce(!1),w.current=0,W.current=0,h.current="none",S.current=!1,I.current=null,M.current=!1,C.current=null,Lt(),Ae.current=n,se.current=V==null?void 0:V.url)},[n,V==null?void 0:V.url,qe,Pe,Lt]),a.useLayoutEffect(()=>{const g=Y.current;g!==null&&(Y.current=null,requestAnimationFrame(()=>{D.current(g)}))},[n,m,V==null?void 0:V.url]),a.useLayoutEffect(()=>{if(J==="opening"){ie.current=!1,ne(!1);return}if(J!=="open"||ie.current)return;if(!De&&!ot){ie.current=!0;return}ne(!1);const g=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ne(!0),ie.current=!0})});return()=>cancelAnimationFrame(g)},[J,De==null?void 0:De.url,ot==null?void 0:ot.url]),a.useEffect(()=>{if(J!=="open")return;const g=()=>{const Ve=it=>{it.stopPropagation(),it.preventDefault(),document.removeEventListener("click",Ve,!0)};document.addEventListener("click",Ve,!0)},ge=Ve=>{const it=Ve<0?1:-1;Pe(),Ge(it),le.current=it,we(it),qe(!0),en()},Re=Ve=>{if(Math.abs(Ve)>ag&&Ye){ge(Ve);return}le.current=null,we(null),X(null),Se(null),qe(!0),Q(0),gt()},Ie=Ve=>{if(Ve.touches.length!==1||z.current)return;const it=Ve.touches[0];M.current=!0,I.current={x:it.clientX,y:it.clientY},h.current="none",W.current=0,S.current=!1},Ze=Ve=>{if(!I.current||Ve.touches.length!==1||z.current)return;const it=Ve.touches[0],jt=it.clientX-I.current.x,St=it.clientY-I.current.y;if(h.current==="none"){if(Math.abs(jt)<10&&Math.abs(St)<10)return;if(Math.abs(jt)>Math.abs(St)){if(!Ye)return;h.current="horizontal"}else if(St>0){if(!et)return;h.current="vertical"}else return}if(h.current==="horizontal"){S.current=!0,Ce(!0),W.current=jt,Q(jt),Ve.preventDefault();return}h.current==="vertical"&&(S.current=!0,Ce(!0),w.current=St,oe(St),Ve.preventDefault())},Et=()=>{if(!I.current)return;const Ve=h.current,it=S.current;if(it&&Ve==="horizontal")Re(W.current),g();else if(it&&Ve==="vertical"){const jt=w.current;if(et&&jt>rg){const St=window.innerHeight;w.current=St,pe(!0),oe(St),de("closing")}else w.current=0,oe(0);g()}else Ve==="horizontal"&&Math.abs(W.current)>0&&(Re(W.current),g());I.current=null,h.current="none",W.current=0,S.current=!1,Ce(!1)};return document.addEventListener("touchstart",Ie,{passive:!0}),document.addEventListener("touchmove",Ze,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Ie),document.removeEventListener("touchmove",Ze),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[J,Ye,qe,gt,Pe,et,en,Ge]);const Oe=a.useCallback(()=>{const g=(T==null?void 0:T())??b??null;g&&G&&(re(g),ce(!0)),de("closing")},[T,b,G]);a.useEffect(()=>{const g=Ie=>{if(Ie.key==="Escape"){if(l&&d||J==="closing")return;Rt(),Oe();return}if(Ie.key!=="ArrowLeft"&&Ie.key!=="ArrowRight"||J!=="open"||!Ye)return;Ie.preventDefault();const Ze=Ie.key==="ArrowLeft"?-1:1;Ie.repeat&&N.current===Ze||Kt(Ze)},ge=Ie=>{if(Ie.key!=="ArrowLeft"&&Ie.key!=="ArrowRight")return;const Ze=Ie.key==="ArrowLeft"?-1:1;N.current===Ze&&Rt()},Re=()=>{Rt()};return window.addEventListener("keydown",g),window.addEventListener("keyup",ge),window.addEventListener("blur",Re),()=>{window.removeEventListener("keydown",g),window.removeEventListener("keyup",ge),window.removeEventListener("blur",Re),Rt()}},[J,l,d,Oe,Ye,Kt,Rt]),a.useEffect(()=>{J!=="open"&&Rt()},[J,Rt]);const Ke=()=>{J==="closing"||s||Oe()},Ne=J==="open",ze=J==="closing",ut=$e>0?Math.max(0,1-$e/500):1,_e=$e>0?Math.max(.35,1-$e/500):1,Je=a.useCallback(g=>{if(!(g.propertyName!=="transform"||!z.current)){if(le.current!==null){Dt();return}Pe(),qe(!1)}},[Pe,qe,Dt]),tt=J==="closing"?H??b:b,Wt=tt&&G&&(J==="opening"||ze)?dg(tt,G):void 0,Ct=We&&V?Mt(V,"center"):$e>0?`translateY(${$e}px)`:Wt,lt=G?_o(G,_):null,Nt=!!(tt&&G),At=Nt&&(J==="closing"||J==="open"&&O),Vt={position:"absolute",top:lt==null?void 0:lt.top,left:lt==null?void 0:lt.left,width:lt==null?void 0:lt.width,height:lt==null?void 0:lt.height,objectFit:"contain",transformOrigin:"top left",transform:Ct,opacity:$e>0?_e:Nt?1:J==="opening"||ze?0:1,transition:be&&!ye?"none":ye?`transform ${Ki}ms ${pn}`:ee?`transform ${$n}ms ${pn}, opacity ${$n}ms ${pn}`:At?`transform ${$n}ms ${pn}`:J==="opening"||ze?`opacity ${$n}ms ${pn}`:"none",pointerEvents:je&&Ne&&!We?"auto":"none",touchAction:je&&Ne?"none":void 0,zIndex:1,overflow:je?"hidden":void 0},zt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ne&&!We?"auto":"none"},Pt=(g,ge,Re="adjacent")=>{const Ie=Tt(g);if(!Ie)return{display:"none"};const Ze=Re==="far"?ge==="left"?"far-left":"far-right":ge==="left"?"left-adjacent":"right-adjacent",{start:Et}=ke!==null?ic(Ie,Ze,ke,_):{start:Re==="far"?rr(Ie,ge,_):Ai(Ie,ge,_)},Ve=_o(Et,_),it=Mt(g,Ze),jt=!We&&Re==="adjacent"&&Ne&&!ae?wg(Ie,ge,_):null,St=Re==="far"&&We&&ke===(ge==="left"?-1:1),cn=be&&!ye?!1:ye,un=Re==="adjacent"&&Ne&&ae&&!We;return{position:"absolute",top:Ve.top,left:Ve.left,width:Ve.width,height:Ve.height,objectFit:"contain",transform:it??(jt?`translate(${jt.x}px, ${jt.y}px)`:void 0),opacity:Re==="far"?Ne&&St?1:0:Ne?1:0,transition:cn?Re==="far"?`transform ${Ki}ms ${pn}`:`transform ${Ki}ms ${pn}, opacity ${$n}ms ${pn}`:un?`transform ${$n}ms ${pn}`:J==="opening"||ze?`opacity ${$n}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},Qt=(g,ge)=>{const Re=Tt(g);return Re?xg(Ai(Re,ge,_),ge,_):null},wt=g=>ge=>{if(!s){if(M.current){M.current=!1;return}ge.stopPropagation(),bt(g)}},Gt=De?Qt(De,"left"):null,pt=ot?Qt(ot,"right"):null,Ft=Gt?_o(Gt,_):null,Bt=pt?_o(pt,_):null;return r.jsxs("div",{ref:R,className:[`${e}-lightbox`,l?`${e}-lightbox-editor`:"",s?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:J==="open"?"none":void 0},onClick:Ke,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ne?ut:0,transition:be?"none":`opacity ${$n}ms ${pn}`,pointerEvents:"none"}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[r.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},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:E,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:Ne?1:0,transition:be?"none":`opacity ${$n}ms ${pn}`,pointerEvents:"none"},children:r.jsx(ec,{prefix:e,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:d,onClose:Ke})})]}),Ne&&kt&&r.jsx(No,{media:kt,style:Pt(kt,"left","far"),onMeasure:Qe,onTransitionEnd:Je},`far-prev-${kt.url}`),Ne&&De&&r.jsxs(r.Fragment,{children:[r.jsx(No,{media:De,style:Pt(De,"left"),onMeasure:Qe,onTransitionEnd:Je},`prev-${De.url}`),Ft&&r.jsx("div",{style:{position:"absolute",top:Ft.top,left:Ft.left,width:Ft.width,height:Ft.height,cursor:s||be?"default":"pointer",pointerEvents:s||be?"none":"auto",zIndex:3},onClick:wt(-1)})]}),Ne&&ot&&r.jsxs(r.Fragment,{children:[r.jsx(No,{media:ot,style:Pt(ot,"right"),onMeasure:Qe,onTransitionEnd:Je},`next-${ot.url}`),Bt&&r.jsx("div",{style:{position:"absolute",top:Bt.top,left:Bt.left,width:Bt.width,height:Bt.height,cursor:s||be?"default":"pointer",pointerEvents:s||be?"none":"auto",zIndex:3},onClick:wt(1)})]}),Ne&&_t&&r.jsx(No,{media:_t,style:Pt(_t,"right","far"),onMeasure:Qe,onTransitionEnd:Je},`far-next-${_t.url}`),G&&V&&(je?r.jsx(Tg,{src:V.url,phase:J,onMediaElement:Jt,wrapperStyle:Vt,videoStyle:zt,onLoadedMetadata:ft,onTransitionEnd:Je},`${n}-${V.url}`):r.jsx("img",{ref:Jt,src:V.url,alt:V.name,onLoad:ft,onTransitionEnd:Je,style:Vt},`${n}-${V.url}`))]})}function Ig({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:l,portalId:s}){const{prefix:d}=y.useScopedStyles(),{gridLayout:c,verticalGap:u,align:m="top",imageDisplay:x}=e,b=(x==null?void 0:x.display)==="cover",T=(x==null?void 0:x.ratioValue)??"1:1",f=(x==null?void 0:x.reversed)??!1,[L,$]=T.split(":").map(Number),C=`${f?$:L} / ${f?L:$}`,U=c.entryWidth??.2,k=c.columnsCount,j=y.scalingValue(U,n),I=y.scalingValue(c.horizontalGap??0,n),w=j,W=j,h={width:w,...b?{aspectRatio:C,height:"auto",overflow:"hidden"}:{height:"auto"}},S=b?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},M=a.useRef(null),[z,K]=a.useState(!1),[le,Y]=a.useState([]),[D,N]=a.useState(0),[F,A]=a.useState(0),[q,G]=a.useState(null),[Z,_]=a.useState({title1:"",title2:"",title3:""}),me=(()=>{const ue={},Se=M.current?getComputedStyle(M.current).getPropertyValue("--cntrl-article-width").trim():"";return Se&&(ue["--cntrl-article-width"]=Se),ue})(),v=!n||i||o,fe=a.useMemo(()=>og(d),[d]),J=t??[],de=J.length%k||k,$e=de<k&&J.length>0,oe=J.length-de,xe=$e?Math.floor((k-de)/2)+1:1,Q=a.useMemo(()=>pg(J),[J]),ye=a.useMemo(()=>yg(J),[J]),ve=(ue,Se,O)=>{if(n&&!o&&!i)return;const ce=Q.findIndex(re=>re.gridIndex===ue);if(ce<0)return;const H=Q[ce];A(ce),Y(H.items),N(Se),_(H.entry),G(O??null),K(!0)},ke=a.useCallback(()=>{K(!1),G(null)},[]),we=a.useCallback(()=>{const ue=Q[F];return!ue||!M.current?q:ug(M.current,ue.gridIndex,b?"cover":"contain")??q},[Q,F,q,b]),Me=a.useCallback(ue=>{if(Q.length>1){const Se=Q.length,O=(F+ue+Se)%Se,ce=Q[O],H=Math.min(D,ce.items.length-1);A(O),Y(ce.items),N(H),_(ce.entry);return}N(Se=>(Se+ue+le.length)%le.length)},[Q,F,D,le.length]),X=Q.length>1||le.length>1;return a.useEffect(()=>{if(!z||typeof document>"u")return;const ue=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ue}},[z]),a.useEffect(()=>{!n||o||i||K(!1)},[n,o,i]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:fe}}),r.jsx(vg,{mediaList:ye}),r.jsx("div",{ref:M,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${m}`.trim(),style:{gridTemplateColumns:`repeat(${k}, ${j})`,rowGap:0,columnGap:I,width:y.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:y.scalingValue(u??0,n)},children:J.map((ue,Se)=>{const O=Ba(ue.gallery),ce=Da(O),H=ce.filter(Ce=>Ce.lightboxMedia).map(Ce=>Ce.lightboxMedia),re=Math.floor(Se/k)===Math.ceil(J.length/k)-1,ae=$e&&Se>=oe?`${xe+(Se-oe)}`:void 0,ne=ce[0],ie=ne!=null&&ne.lightboxMedia?H.findIndex(Ce=>Ce.url===ne.lightboxMedia.url):-1,be=r.jsx("div",{className:`${d}-item-image-wrapper`,style:h,children:ce.length>0&&r.jsx(Cg,{media:ne.displayMedia,gridIndex:Se,className:`${d}-item-${Vi(ne.displayMedia)?"video":"image"}`.trim(),style:S,onMediaClick:v&&ie>=0?Ce=>ve(Se,ie,tc(Ce.currentTarget,b?"cover":"contain")):void 0})});return r.jsx("div",{className:`${d}-item`,children:r.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,re?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:j,...ae?{gridColumn:ae}:{}},children:[r.jsx("div",{className:`${d}-item-title-row`,children:r.jsx("div",{style:{height:0,width:W}})}),r.jsx("a",{className:`${d}-item-image-link`,children:be}),r.jsx("div",{className:`${d}-item-subtitle-row`,children:r.jsx("div",{style:{height:0,width:W}})})]})},Se)})}),z&&typeof document<"u"&&(()=>{const ue=(s?document.getElementById(s):null)??document.body;return gi.createPortal(r.jsx("div",{style:me,"data-selection":"none",children:r.jsx(Lg,{prefix:d,items:le,index:D,entry:Z,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:X,lightboxEntries:Q,entryIdx:F,layoutId:l,sourceRect:q,resolveCloseSourceRect:we,onClose:ke,onPrev:()=>Me(-1),onNext:()=>Me(1)})}),ue)})()]})}const Rg=`import { CommonComponentProps } from '../props';
|
|
6363
|
+
`}const Rl={url:"",name:"",objectFit:"cover"},Cn=500,Ui=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",ug=72,pg=50,mg=1e4,gg=650,hg=500;function fg(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,l=e.top-t.top;return`translate(${o}px, ${l}px) scale(${n}, ${i})`}function ic(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=ir(e);return{left:i.x,top:i.y,width:i.width,height:i.height}}const n=e.getBoundingClientRect();return{left:n.left,top:n.top,width:n.width,height:n.height}}function yg(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?ic(i,n):null}function vg(e){return e.reduce((t,n,i)=>{const o=za(n.gallery),s=Ba(o).filter(c=>c.lightboxMedia).map(c=>c.lightboxMedia);return s.length===0||t.push({gridIndex:i,items:s,entry:{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}),t},[])}function Ji(e,t,n){var o;if(e.length<=1)return null;const i=(t+n+e.length)%e.length;return((o=e[i])==null?void 0:o.items[0])??null}function El(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return Ji(e,i,n)}const bg=.03;function oc(e){return e.width*bg}const Br={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Wo(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Ml(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function xg(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ma(e,t,n){const i=e.getBoundingClientRect(),o=i.width,l=i.height,s=t/n,c=o/l;if(s>c){const u=o/s;return{width:o,height:u,left:i.left,top:i.top+(l-u)/2}}const d=l*s;return{width:d,height:l,left:i.left+(o-d)/2,top:i.top}}function wg(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ma(e,t.width,t.height)}function Sg(e,t){if(Gi(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function $g(e){const t=new Set,n=[];for(const i of e){const o=za(i.gallery),l=Ba(o);for(const s of l)for(const c of[s.displayMedia,s.lightboxMedia])c!=null&&c.url&&!t.has(c.url)&&(t.add(c.url),n.push(c))}return n}function Cg({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Gi(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function Fi(e,t,n){const{width:i,height:o,top:l}=e,{left:s,width:c}=n,d=oc(n);return t==="left"?{left:s+d-i,top:l,width:i,height:o}:{left:s+c-d,top:l,width:i,height:o}}function or(e,t,n){const i=Fi(e,t,n);return{...i,left:2*i.left-e.left}}function Tg(e,t,n){const{left:i,width:o}=n,l=oc(n);return t==="left"?{left:i,top:e.top,width:l,height:e.height}:{left:i+o-l,top:e.top,width:l,height:e.height}}function rc(e,t,n,i){const o=Fi(e,"left",i),l=Fi(e,"right",i),s=or(e,"left",i),c=or(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:l,end:e};case"left-adjacent":return{start:o,end:s};case"far-right":return{start:c,end:l};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:l};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:l,end:c};case"far-left":return{start:s,end:o};default:return{start:e,end:e}}}function Lg(e,t,n,i){const{start:o,end:l}=rc(e,t,n,i);return{x:l.left-o.left,y:l.top-o.top}}function Ig(e,t,n){const i=Fi(e,t,n),o=or(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function ac(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function za(e){if(!e)return;if(ac(e))return e;if(!Array.isArray(e))return;const[t,n]=e,i=t!=null&&t.url?t:void 0,o=n!=null&&n.url?n:void 0;if(!(!i&&!o))return[{media:[o??i??Rl,i??o??Rl]}]}function Rg(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Eg(e){const[t]=e.media;return t!=null&&t.url?t:null}function Ba(e){if(!Array.isArray(e)||e.length===0)return[];if(ac(e)){const t=[];for(const n of e){const i=Rg(n);if(!i)continue;const o=Eg(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.url?o:null})}return t}return e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function Gi(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Mg({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return Gi(e)?r.jsx("video",{src:e.url,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onClick:o}):r.jsx("img",{src:e.url,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function kg({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:l,onTransitionEnd:s}){const c=a.useRef(null);return a.useEffect(()=>{const d=c.current;return n==null||n(d??null),()=>{d==null||d.pause(),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:s,children:r.jsx("video",{ref:c,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:l,onClick:d=>d.stopPropagation(),style:o},e)})}function _o({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Gi(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const l=o.currentTarget;l.videoWidth>0&&l.videoHeight>0&&(i==null||i(e.url,l.videoWidth,l.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const l=o.currentTarget;l.naturalWidth>0&&l.naturalHeight>0&&(i==null||i(e.url,l.naturalWidth,l.naturalHeight))},onTransitionEnd:n})}function Pg({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:c,canNavigate:d,lightboxEntries:u,entryIdx:m,layoutId:x,sourceRect:w,resolveCloseSourceRect:$,onClose:f,onPrev:S,onNext:L}){const M=a.useRef(null),A=a.useRef(null),C=a.useRef(null),J=a.useRef(new Map),[k,U]=a.useState(0),I=a.useRef(null),R=a.useRef(0),T=a.useRef(0),y=a.useRef("none"),h=a.useRef(!1),F=a.useRef(!1),W=a.useRef(!1),V=a.useRef(null),ne=a.useRef(null),X=a.useRef(null),z=a.useRef(()=>{}),H=a.useRef(null),_=a.useRef(null),E=a.useRef(null),q=a.useRef(!1),[Y,ee]=a.useState(null),[N,pe]=a.useState(Br),[b,ye]=a.useState(0),[Q,xe]=a.useState("opening"),[$e,oe]=a.useState(0),[ie,B]=a.useState(0),[le,re]=a.useState(!1),[ke,fe]=a.useState(null),[Pe,ve]=a.useState(null),[we,Se]=a.useState(null),[G,me]=a.useState(!1),[D,K]=a.useState(null),[ae,ge]=a.useState(!1),ce=a.useRef(!1),[be,Ee]=a.useState(!1),[Z,de]=a.useState(!1),We=a.useRef(n),se=a.useRef(void 0),O=t[n],Oe=O?Gi(O):!1,_e=ie!==0||le,nt=!s&&(!l||!!c),Ue=d&&!s,Ce=u.length>1,Fe=a.useCallback((g,ue)=>t.length<=1?null:t[(g+ue+t.length)%t.length]??null,[t]),He=Ce?Ji(u,m,-1):Fe(n,-1),Ze=Ce?Ji(u,m,1):Fe(n,1),Tt=ke===-1&&_e?Ce&&Pe!==null?Ji(u,Pe,-1):we!==null?Fe(we,-1):null:null,it=ke===1&&_e?Ce&&Pe!==null?Ji(u,Pe,1):we!==null?Fe(we,1):null:null,De=Tt&&Tt.url!==(He==null?void 0:He.url)?Tt:null,et=it&&it.url!==(Ze==null?void 0:Ze.url)?it:null,dt=He&&Ue?(()=>{const g=Ce?El(u,m,-1):t.length>2?Fe((n-1+t.length)%t.length,-1):null;return g&&g.url!==He.url?g:null})():null,lt=Ze&&Ue?(()=>{const g=Ce?El(u,m,1):t.length>2?Fe((n+1)%t.length,1):null;return g&&g.url!==Ze.url?g:null})():null,ht=De??dt,Rt=et??lt,ot=a.useCallback((g,ue,Te)=>{if(!g||!ue||!Te)return;const Le=J.current,tt=Le.get(g);(tt==null?void 0:tt.width)===ue&&(tt==null?void 0:tt.height)===Te||(Le.set(g,{width:ue,height:Te}),U(kt=>kt+1))},[]),xt=a.useCallback(g=>{if(!(g!=null&&g.url))return null;const ue=J.current.get(g.url);return wg(A.current,ue)},[k,b]),zt=a.useCallback(()=>{if(!O)return;const g=xt(O);if(g){ee(g);return}const ue=A.current;ue&&ee(Ml(ue))},[O,xt]),rt=a.useCallback(g=>{if(Ce){const ue=u.length;ve((m+g+ue)%ue),Se(null);return}t.length>1&&(Se((n+g+t.length)%t.length),ve(null))},[Ce,u.length,m,t.length,n]),qe=a.useCallback(g=>{W.current=g,re(g)},[]),Ne=a.useCallback(()=>{V.current!==null&&(window.clearTimeout(V.current),V.current=null)},[]),pt=a.useCallback(()=>{Ne(),V.current=window.setTimeout(()=>{Ne(),qe(!1)},Ui+32)},[Ne,qe]),yt=a.useCallback(()=>{const g=M.current;if(!g){pe({left:0,top:0,width:typeof window<"u"?window.innerWidth:Br.width,height:typeof window<"u"?window.innerHeight:Br.height});return}const ue=g.getBoundingClientRect();pe({left:ue.left,top:ue.top,width:ue.width,height:ue.height})},[]),Mt=a.useCallback((g,ue)=>{if(_e){if(be&&!le)return`translate(${ie}px, 0px)`;if(le&&ke!==null){const Te=xt(g);if(!Te)return;const{x:Le,y:tt}=Lg(Te,ue,ke,N);return`translate(${Le}px, ${tt}px)`}if(le)return"translate(0px, 0px)"}},[_e,be,le,ie,ke,N,xt]),Dt=a.useCallback(()=>{const g=ne.current;ne.current=null,Ne(),qe(!1),fe(null),ve(null),Se(null),B(0),Ee(!1),h.current=!1,T.current=0,y.current="none",g===-1?S():g===1&&L()},[Ne,qe,S,L]),en=a.useCallback(()=>{Ne(),V.current=window.setTimeout(()=>{ne.current!==null&&Dt()},Ui+32)},[Ne,Dt]),sn=a.useCallback(()=>{Ne(),ne.current=null,qe(!1),fe(null),ve(null),Se(null),B(0),Ee(!1),h.current=!1,T.current=0,y.current="none"},[Ne,qe]),Lt=a.useCallback(g=>{if(!(!Ue||!Y)){if(W.current){if(ne.current===g){X.current=g,Dt();return}sn()}Ne(),rt(g),ne.current=g,fe(g),qe(!0),en()}},[Ue,Y,Dt,sn,Ne,rt,qe,en]);z.current=Lt;const Et=a.useCallback(()=>{H.current=null,q.current=!1,_.current!==null&&(window.clearInterval(_.current),_.current=null),E.current!==null&&(window.clearTimeout(E.current),E.current=null)},[]),Qt=a.useCallback(g=>{_.current!==null&&window.clearInterval(_.current);const ue=q.current?hg:gg;_.current=window.setInterval(()=>{z.current(g)},ue)},[]),Ut=a.useCallback(g=>{H.current!==g&&(Et(),H.current=g,q.current=!1,z.current(g),Qt(g),E.current=window.setTimeout(()=>{E.current=null,H.current===g&&(q.current=!0,Qt(g))},mg))},[Et,Qt]),ft=a.useCallback(()=>{const g=A.current;if(!g)return;const ue=O==null?void 0:O.url,Te=ue?J.current.get(ue):void 0;if(Te!=null&&Te.width&&(Te!=null&&Te.height)){ee(ma(g,Te.width,Te.height));return}const Le=C.current;if(Le&&ue&&(Le.src===ue||Le.currentSrc===ue)){const{width:kt,height:Ke}=xg(Le);if(kt&&Ke){ot(ue,kt,Ke),ee(ma(g,kt,Ke));return}}const tt=Ml(g);!tt.width||!tt.height||ee(tt)},[O==null?void 0:O.url,ot]),qt=a.useCallback(g=>{if(C.current=g,!!g){if(g instanceof HTMLVideoElement){g.readyState>=1&&g.videoWidth>0&&ft();return}g.complete&&g.naturalWidth>0&&ft()}},[ft]),Re=a.useCallback(()=>{yt(),ft(),ye(g=>g+1)},[yt,ft]);a.useEffect(()=>{Re();const g=A.current,ue=M.current,Te=new ResizeObserver(()=>Re());return g&&Te.observe(g),ue&&Te.observe(ue),window.addEventListener("resize",Re),()=>{Te.disconnect(),window.removeEventListener("resize",Re)}},[Re,n,x]),a.useLayoutEffect(()=>{if(!O)return;const g=C.current;if(g){if(g instanceof HTMLImageElement&&g.complete&&g.naturalWidth>0){ft();return}g instanceof HTMLVideoElement&&g.readyState>=1&&g.videoWidth>0&&ft()}},[O==null?void 0:O.url,n,ft]),a.useEffect(()=>{zt()},[zt,k]),a.useEffect(()=>{const g=new Set,ue=[],Te=Le=>{!(Le!=null&&Le.url)||g.has(Le.url)||(g.add(Le.url),ue.push(Le))};t.forEach(Te),u.forEach(Le=>Le.items.forEach(Te)),ue.forEach(Le=>{J.current.has(Le.url)||Sg(Le,ot)})},[t,u,ot]),a.useEffect(()=>{if(Q!=="opening"||!Y)return;if(!w){xe("open");return}me(!1);const g=requestAnimationFrame(()=>{requestAnimationFrame(()=>{me(!0),xe("open")})});return()=>cancelAnimationFrame(g)},[Q,Y,w]),a.useEffect(()=>{if(Q!=="closing")return;const g=setTimeout(()=>f(),Cn);return()=>clearTimeout(g)},[Q,f]),a.useEffect(()=>()=>{Ne()},[Ne]),a.useLayoutEffect(()=>{We.current===n&&se.current===(O==null?void 0:O.url)||(Ne(),ne.current=null,fe(null),ve(null),Se(null),oe(0),B(0),qe(!1),de(!1),Ee(!1),R.current=0,T.current=0,y.current="none",h.current=!1,I.current=null,F.current=!1,C.current=null,zt(),We.current=n,se.current=O==null?void 0:O.url)},[n,O==null?void 0:O.url,qe,Ne,zt]),a.useLayoutEffect(()=>{const g=X.current;g!==null&&(X.current=null,requestAnimationFrame(()=>{z.current(g)}))},[n,m,O==null?void 0:O.url]),a.useLayoutEffect(()=>{if(Q==="opening"){ce.current=!1,ge(!1);return}if(Q!=="open"||ce.current)return;if(!He&&!Ze){ce.current=!0;return}ge(!1);const g=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ge(!0),ce.current=!0})});return()=>cancelAnimationFrame(g)},[Q,He==null?void 0:He.url,Ze==null?void 0:Ze.url]),a.useEffect(()=>{if(Q!=="open")return;const g=()=>{const Ke=st=>{st.stopPropagation(),st.preventDefault(),document.removeEventListener("click",Ke,!0)};document.addEventListener("click",Ke,!0)},ue=Ke=>{const st=Ke<0?1:-1;Ne(),rt(st),ne.current=st,fe(st),qe(!0),en()},Te=Ke=>{if(Math.abs(Ke)>pg&&Ue){ue(Ke);return}ne.current=null,fe(null),ve(null),Se(null),qe(!0),B(0),pt()},Le=Ke=>{if(Ke.touches.length!==1||W.current)return;const st=Ke.touches[0];F.current=!0,I.current={x:st.clientX,y:st.clientY},y.current="none",T.current=0,h.current=!1},tt=Ke=>{if(!I.current||Ke.touches.length!==1||W.current)return;const st=Ke.touches[0],_t=st.clientX-I.current.x,It=st.clientY-I.current.y;if(y.current==="none"){if(Math.abs(_t)<10&&Math.abs(It)<10)return;if(Math.abs(_t)>Math.abs(It)){if(!Ue)return;y.current="horizontal"}else if(It>0){if(!nt)return;y.current="vertical"}else return}if(y.current==="horizontal"){h.current=!0,Ee(!0),T.current=_t,B(_t),Ke.preventDefault();return}y.current==="vertical"&&(h.current=!0,Ee(!0),R.current=It,oe(It),Ke.preventDefault())},kt=()=>{if(!I.current)return;const Ke=y.current,st=h.current;if(st&&Ke==="horizontal")Te(T.current),g();else if(st&&Ke==="vertical"){const _t=R.current;if(nt&&_t>ug){const It=window.innerHeight;R.current=It,de(!0),oe(It),xe("closing")}else R.current=0,oe(0);g()}else Ke==="horizontal"&&Math.abs(T.current)>0&&(Te(T.current),g());I.current=null,y.current="none",T.current=0,h.current=!1,Ee(!1)};return document.addEventListener("touchstart",Le,{passive:!0}),document.addEventListener("touchmove",tt,{passive:!1}),document.addEventListener("touchend",kt),document.addEventListener("touchcancel",kt),()=>{document.removeEventListener("touchstart",Le),document.removeEventListener("touchmove",tt),document.removeEventListener("touchend",kt),document.removeEventListener("touchcancel",kt)}},[Q,Ue,qe,pt,Ne,nt,en,rt]);const Ve=a.useCallback(()=>{const g=($==null?void 0:$())??w??null;g&&Y&&(K(g),me(!0)),xe("closing")},[$,w,Y]);a.useEffect(()=>{const g=Le=>{if(Le.key==="Escape"){if(l&&c||Q==="closing")return;Et(),Ve();return}if(Le.key!=="ArrowLeft"&&Le.key!=="ArrowRight"||Q!=="open"||!Ue)return;Le.preventDefault();const tt=Le.key==="ArrowLeft"?-1:1;Le.repeat&&H.current===tt||Ut(tt)},ue=Le=>{if(Le.key!=="ArrowLeft"&&Le.key!=="ArrowRight")return;const tt=Le.key==="ArrowLeft"?-1:1;H.current===tt&&Et()},Te=()=>{Et()};return window.addEventListener("keydown",g),window.addEventListener("keyup",ue),window.addEventListener("blur",Te),()=>{window.removeEventListener("keydown",g),window.removeEventListener("keyup",ue),window.removeEventListener("blur",Te),Et()}},[Q,l,c,Ve,Ue,Ut,Et]),a.useEffect(()=>{Q!=="open"&&Et()},[Q,Et]);const Xe=()=>{Q==="closing"||s||Ve()},ze=Q==="open",mt=Q==="closing",Nt=$e>0?Math.max(0,1-$e/500):1,Ae=$e>0?Math.max(.35,1-$e/500):1,Ye=a.useCallback(g=>{if(!(g.propertyName!=="transform"||!W.current)){if(ne.current!==null){Dt();return}Ne(),qe(!1)}},[Ne,qe,Dt]),Je=Q==="closing"?D??w:w,bt=Je&&Y&&(Q==="opening"||mt)?fg(Je,Y):void 0,$t=_e&&O?Mt(O,"center"):$e>0?`translateY(${$e}px)`:bt,ut=Y?Wo(Y,N):null,Pt=!!(Je&&Y),At=Pt&&(Q==="closing"||Q==="open"&&G),Vt={position:"absolute",top:ut==null?void 0:ut.top,left:ut==null?void 0:ut.left,width:ut==null?void 0:ut.width,height:ut==null?void 0:ut.height,objectFit:"contain",transformOrigin:"top left",transform:$t,opacity:$e>0?Ae:Pt?1:Q==="opening"||mt?0:1,transition:be&&!le?"none":le?`transform ${Ui}ms ${pn}`:Z?`transform ${Cn}ms ${pn}, opacity ${Cn}ms ${pn}`:At?`transform ${Cn}ms ${pn}`:Q==="opening"||mt?`opacity ${Cn}ms ${pn}`:"none",pointerEvents:Oe&&ze&&!_e?"auto":"none",touchAction:Oe&&ze?"none":void 0,zIndex:1,overflow:Oe?"hidden":void 0},Kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:ze&&!_e?"auto":"none"},Ft=(g,ue,Te="adjacent")=>{const Le=xt(g);if(!Le)return{display:"none"};const tt=Te==="far"?ue==="left"?"far-left":"far-right":ue==="left"?"left-adjacent":"right-adjacent",{start:kt}=ke!==null?rc(Le,tt,ke,N):{start:Te==="far"?or(Le,ue,N):Fi(Le,ue,N)},Ke=Wo(kt,N),st=Mt(g,tt),_t=!_e&&Te==="adjacent"&&ze&&!ae?Ig(Le,ue,N):null,It=Te==="far"&&_e&&ke===(ue==="left"?-1:1),cn=be&&!le?!1:le,un=Te==="adjacent"&&ze&&ae&&!_e;return{position:"absolute",top:Ke.top,left:Ke.left,width:Ke.width,height:Ke.height,objectFit:"contain",transform:st??(_t?`translate(${_t.x}px, ${_t.y}px)`:void 0),opacity:Te==="far"?ze&&It?1:0:ze?1:0,transition:cn?Te==="far"?`transform ${Ui}ms ${pn}`:`transform ${Ui}ms ${pn}, opacity ${Cn}ms ${pn}`:un?`transform ${Cn}ms ${pn}`:Q==="opening"||mt?`opacity ${Cn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},Yt=(g,ue)=>{const Te=xt(g);return Te?Tg(Fi(Te,ue,N),ue,N):null},wt=g=>ue=>{if(!s){if(F.current){F.current=!1;return}ue.stopPropagation(),Lt(g)}},Ot=He?Yt(He,"left"):null,jt=Ze?Yt(Ze,"right"):null,Bt=Ot?Wo(Ot,N):null,vt=jt?Wo(jt,N):null;return r.jsxs("div",{ref:M,className:[`${e}-lightbox`,l?`${e}-lightbox-editor`:"",s?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:Q==="open"?"none":void 0},onClick:Xe,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:ze?Nt:0,transition:be?"none":`opacity ${Cn}ms ${pn}`,pointerEvents:"none"}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[r.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},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:A,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:ze?1:0,transition:be?"none":`opacity ${Cn}ms ${pn}`,pointerEvents:"none"},children:r.jsx(nc,{prefix:e,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:c,onClose:Xe})})]}),ze&&ht&&r.jsx(_o,{media:ht,style:Ft(ht,"left","far"),onMeasure:ot,onTransitionEnd:Ye},`far-prev-${ht.url}`),ze&&He&&r.jsxs(r.Fragment,{children:[r.jsx(_o,{media:He,style:Ft(He,"left"),onMeasure:ot,onTransitionEnd:Ye},`prev-${He.url}`),Bt&&r.jsx("div",{style:{position:"absolute",top:Bt.top,left:Bt.left,width:Bt.width,height:Bt.height,cursor:s||be?"default":"pointer",pointerEvents:s||be?"none":"auto",zIndex:3},onClick:wt(-1)})]}),ze&&Ze&&r.jsxs(r.Fragment,{children:[r.jsx(_o,{media:Ze,style:Ft(Ze,"right"),onMeasure:ot,onTransitionEnd:Ye},`next-${Ze.url}`),vt&&r.jsx("div",{style:{position:"absolute",top:vt.top,left:vt.left,width:vt.width,height:vt.height,cursor:s||be?"default":"pointer",pointerEvents:s||be?"none":"auto",zIndex:3},onClick:wt(1)})]}),ze&&Rt&&r.jsx(_o,{media:Rt,style:Ft(Rt,"right","far"),onMeasure:ot,onTransitionEnd:Ye},`far-next-${Rt.url}`),Y&&O&&(Oe?r.jsx(kg,{src:O.url,phase:Q,onMediaElement:qt,wrapperStyle:Vt,videoStyle:Kt,onLoadedMetadata:ft,onTransitionEnd:Ye},`${n}-${O.url}`):r.jsx("img",{ref:qt,src:O.url,alt:O.name,onLoad:ft,onTransitionEnd:Ye,style:Vt},`${n}-${O.url}`))]})}function Ag({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:l,portalId:s}){const{prefix:c}=v.useScopedStyles(),{gridLayout:d,verticalGap:u,align:m="top",imageDisplay:x}=e,w=(x==null?void 0:x.display)==="cover",$=(x==null?void 0:x.ratioValue)??"1:1",f=(x==null?void 0:x.reversed)??!1,[S,L]=$.split(":").map(Number),C=`${f?L:S} / ${f?S:L}`,J=d.entryWidth??.2,k=d.columnsCount,U=v.scalingValue(J,n),I=v.scalingValue(d.horizontalGap??0,n),R=U,T=U,y={width:R,...w?{aspectRatio:C,height:"auto",overflow:"hidden"}:{height:"auto"}},h=w?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},F=a.useRef(null),[W,V]=a.useState(!1),[ne,X]=a.useState([]),[z,H]=a.useState(0),[_,E]=a.useState(0),[q,Y]=a.useState(null),[ee,N]=a.useState({title1:"",title2:"",title3:""}),pe=(()=>{const we={},Se=F.current?getComputedStyle(F.current).getPropertyValue("--cntrl-article-width").trim():"";return Se&&(we["--cntrl-article-width"]=Se),we})(),b=!n||i||o,ye=a.useMemo(()=>dg(c),[c]),Q=t??[],xe=Q.length%k||k,$e=xe<k&&Q.length>0,oe=Q.length-xe,ie=$e?Math.floor((k-xe)/2)+1:1,B=a.useMemo(()=>vg(Q),[Q]),le=a.useMemo(()=>$g(Q),[Q]),re=(we,Se,G)=>{if(n&&!o&&!i)return;const me=B.findIndex(K=>K.gridIndex===we);if(me<0)return;const D=B[me];E(me),X(D.items),H(Se),N(D.entry),Y(G??null),V(!0)},ke=a.useCallback(()=>{V(!1),Y(null)},[]),fe=a.useCallback(()=>{const we=B[_];return!we||!F.current?q:yg(F.current,we.gridIndex,w?"cover":"contain")??q},[B,_,q,w]),Pe=a.useCallback(we=>{if(B.length>1){const Se=B.length,G=(_+we+Se)%Se,me=B[G],D=Math.min(z,me.items.length-1);E(G),X(me.items),H(D),N(me.entry);return}H(Se=>(Se+we+ne.length)%ne.length)},[B,_,z,ne.length]),ve=B.length>1||ne.length>1;return a.useEffect(()=>{if(!W||typeof document>"u")return;const we=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=we}},[W]),a.useEffect(()=>{!n||o||i||V(!1)},[n,o,i]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ye}}),r.jsx(Cg,{mediaList:le}),r.jsx("div",{ref:F,className:`${c}-wrapper ${c}-align-entries ${c}-image-align-${m}`.trim(),style:{gridTemplateColumns:`repeat(${k}, ${U})`,rowGap:0,columnGap:I,width:v.scalingValue(d.wrapperWidth??0,n),[`--${c}-align-entries-row-gap`]:v.scalingValue(u??0,n)},children:Q.map((we,Se)=>{const G=za(we.gallery),me=Ba(G),D=me.filter(Ee=>Ee.lightboxMedia).map(Ee=>Ee.lightboxMedia),K=Math.floor(Se/k)===Math.ceil(Q.length/k)-1,ae=$e&&Se>=oe?`${ie+(Se-oe)}`:void 0,ge=me[0],ce=ge!=null&&ge.lightboxMedia?D.findIndex(Ee=>Ee.url===ge.lightboxMedia.url):-1,be=r.jsx("div",{className:`${c}-item-image-wrapper`,style:y,children:me.length>0&&r.jsx(Mg,{media:ge.displayMedia,gridIndex:Se,className:`${c}-item-${Gi(ge.displayMedia)?"video":"image"}`.trim(),style:h,onMediaClick:b&&ce>=0?Ee=>re(Se,ce,ic(Ee.currentTarget,w?"cover":"contain")):void 0})});return r.jsx("div",{className:`${c}-item`,children:r.jsxs("div",{className:[o?`${c}-item-inner`:`${c}-item-inner-hidden`,K?`${c}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:U,...ae?{gridColumn:ae}:{}},children:[r.jsx("div",{className:`${c}-item-title-row`,children:r.jsx("div",{style:{height:0,width:T}})}),r.jsx("a",{className:`${c}-item-image-link`,children:be}),r.jsx("div",{className:`${c}-item-subtitle-row`,children:r.jsx("div",{style:{height:0,width:T}})})]})},Se)})}),W&&typeof document<"u"&&(()=>{const we=(s?document.getElementById(s):null)??document.body;return gi.createPortal(r.jsx("div",{style:pe,"data-selection":"none",children:r.jsx(Pg,{prefix:c,items:ne,index:z,entry:ee,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ve,lightboxEntries:B,entryIdx:_,layoutId:l,sourceRect:q,resolveCloseSourceRect:fe,onClose:ke,onPrev:()=>Pe(-1),onNext:()=>Pe(1)})}),we)})()]})}const Fg=`import { CommonComponentProps } from '../props';
|
|
6286
6364
|
import { scalingValue, useScopedStyles } from '../utils/index';
|
|
6287
6365
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
6288
6366
|
import { createPortal } from 'react-dom';
|
|
@@ -8636,11 +8714,11 @@ export function Hive({
|
|
|
8636
8714
|
</>
|
|
8637
8715
|
);
|
|
8638
8716
|
}
|
|
8639
|
-
`,Eg="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),ii={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 kg(e){const t={};return t[Be(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Be(e,"fontSettings")]={...ii.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Be(e,"fontSize")]={...ii.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Be(e,"lineHeight")]={...ii.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Be(e,"letterSpacing")]={...ii.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Be(e,"wordSpacing")]={...ii.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Be(e,"textAlign")]={...ii.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Be(e,"textAppearance")]={...ii.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Fi=Kn.filter(e=>e!=="count"),Mg=Fi.reduce((e,t)=>({...e,...kg(t)}),{}),Pg=Fi.reduce((e,t)=>({...e,[Be(t,"fontFamily")]:"Arial",[Be(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Be(t,"letterSpacing")]:0,[Be(t,"wordSpacing")]:0,[Be(t,"textAlign")]:"left",[Be(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Vr(e){return Fi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Be(n,"fontSize")]=i),o!==void 0&&(t[Be(n,"lineHeight")]=o),t},{})}const Ag={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Fi.map(e=>[Oa[e],za(e)]))},Fg={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},Wg=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...Fg,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),_g={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,allowsVideo:!0},display:{type:"array"},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"}},gallery:{type:"array",label:"Gallery",max:1,display:{type:"media-pair-list-input"},items:{type:"object",properties:{media:{type:"array",items:{type:"object",properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}}},required:["gallery"]},default:Wg},settings:{sizing:"auto auto",properties:{gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:9999,display:{type:"numeric-input"}},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gutter",min:0}}}},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},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"}}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,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"}},contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",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"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}},...Mg},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:Eg,closeIconColor:"#000000",closeIconHoverColor:"#999999",...Pg},layoutDefaults:{m:{gridLayout:{entryWidth:.37837,horizontalGap:.081,wrapperWidth:1,columnsCount:2,lockedParam:"wrapperWidth"},verticalGap:.081,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,...Vr({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{gridLayout:{entryWidth:.10416,horizontalGap:.013,wrapperWidth:1,columnsCount:8,lockedParam:"wrapperWidth"},verticalGap:.013,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.039,iconMarginRight:.026,...Vr({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})},d:{gridLayout:{entryWidth:.06944,horizontalGap:.006944,wrapperWidth:1,columnsCount:12,lockedParam:"wrapperWidth"},verticalGap:.00694,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,...Vr({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})}},displayRules:[{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","gridLayout","verticalGap","align","imageDisplay","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","contentMarginTop","closeIconMaxWidth","iconMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["verticalGap"]},{type:"row",title:"",items:["imageDisplay","align"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[Ag]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},Ng={element:Ig,id:"hive",name:"Catalogue",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/hive.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...Fi.map(e=>({path:`${Be(e,"fontFamily")}`}))]},fontRelations:{...Fi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Be(t,"fontFamily")}`}),{})},schema:_g,sourceCode:Rg},Ml=12;function Hg(e,t="50%"){const n={position:"absolute",width:Ml,height:Ml,pointerEvents:"none"};return e==="left-y"?{...n,left:20,top:"50%",transform:"translateY(-50%)"}:e==="center-x"?{...n,left:"50%",top:t,transform:"translate(-50%, -50%)"}:{...n,left:"50%",top:"50%",transform:"translate(-50%, -50%)"}}function nn({className:e,areaStyle:t,hitPlacement:n,centerXHitTop:i,...o}){return r.jsx("div",{className:e,style:{...t,pointerEvents:"none"},"data-controls-center-only-drag":"",...o,children:r.jsx("div",{style:Hg(n,i)})})}function jg(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 Og({media:e,className:t,style:n}){const i=a.useRef(null);return a.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 Gr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function zg(e){return String(e??"").trim().length>0}function Pl(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 Al(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 Fl(e,t,n,i,o,l,s){const d=y.scalingValue(l,s),c=y.scalingValue(0,s),u=e===0,m=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!m||i?d:c}}function Bg(e,t,n){const i=y.scalingValue(t,n),o=y.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Wl=10;function Dg(e){return`
|
|
8717
|
+
`,Wg="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),ii={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 _g(e){const t={};return t[Ge(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ge(e,"fontSettings")]={...ii.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ge(e,"fontSize")]={...ii.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ge(e,"lineHeight")]={...ii.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ge(e,"letterSpacing")]={...ii.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ge(e,"wordSpacing")]={...ii.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ge(e,"textAlign")]={...ii.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ge(e,"textAppearance")]={...ii.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Wi=Un.filter(e=>e!=="count"),Hg=Wi.reduce((e,t)=>({...e,..._g(t)}),{}),Ng=Wi.reduce((e,t)=>({...e,[Ge(t,"fontFamily")]:"Arial",[Ge(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ge(t,"letterSpacing")]:0,[Ge(t,"wordSpacing")]:0,[Ge(t,"textAlign")]:"left",[Ge(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Dr(e){return Wi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ge(n,"fontSize")]=i),o!==void 0&&(t[Ge(n,"lineHeight")]=o),t},{})}const Og={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Wi.map(e=>[Oa[e],ja(e)]))},jg={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},zg=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...jg,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),Bg={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,allowsVideo:!0},display:{type:"array"},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"}},gallery:{type:"array",label:"Gallery",max:1,display:{type:"media-pair-list-input"},items:{type:"object",properties:{media:{type:"array",items:{type:"object",properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}}},required:["gallery"]},default:zg},settings:{sizing:"auto auto",properties:{gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:9999,display:{type:"numeric-input"}},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gutter",min:0}}}},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},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"}}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,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"}},contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",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"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}},...Hg},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:Wg,closeIconColor:"#000000",closeIconHoverColor:"#999999",...Ng},layoutDefaults:{m:{gridLayout:{entryWidth:.37837,horizontalGap:.081,wrapperWidth:1,columnsCount:2,lockedParam:"wrapperWidth"},verticalGap:.081,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,...Dr({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{gridLayout:{entryWidth:.10416,horizontalGap:.013,wrapperWidth:1,columnsCount:8,lockedParam:"wrapperWidth"},verticalGap:.013,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.039,iconMarginRight:.026,...Dr({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})},d:{gridLayout:{entryWidth:.06944,horizontalGap:.006944,wrapperWidth:1,columnsCount:12,lockedParam:"wrapperWidth"},verticalGap:.00694,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,...Dr({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})}},displayRules:[{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","gridLayout","verticalGap","align","imageDisplay","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","contentMarginTop","closeIconMaxWidth","iconMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["verticalGap"]},{type:"row",title:"",items:["imageDisplay","align"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[Og]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},Dg={element:Ag,id:"hive",name:"Catalogue",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/hive.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...Wi.map(e=>({path:`${Ge(e,"fontFamily")}`}))]},fontRelations:{...Wi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ge(t,"fontFamily")}`}),{})},schema:Bg,sourceCode:Fg},kl=12;function Vg(e,t="50%"){const n={position:"absolute",width:kl,height:kl,pointerEvents:"none"};return e==="left-y"?{...n,left:20,top:"50%",transform:"translateY(-50%)"}:e==="center-x"?{...n,left:"50%",top:t,transform:"translate(-50%, -50%)"}:{...n,left:"50%",top:"50%",transform:"translate(-50%, -50%)"}}function nn({className:e,areaStyle:t,hitPlacement:n,centerXHitTop:i,...o}){return r.jsx("div",{className:e,style:{...t,pointerEvents:"none"},"data-controls-center-only-drag":"",...o,children:r.jsx("div",{style:Vg(n,i)})})}function Gg(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 qg({media:e,className:t,style:n}){const i=a.useRef(null);return a.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 Vr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Kg(e){return String(e??"").trim().length>0}function Pl(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 Al(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 Fl(e,t,n,i,o,l,s){const c=v.scalingValue(l,s),d=v.scalingValue(0,s),u=e===0,m=e===t-1&&!o;return{borderTopWidth:u&&n?c:d,borderBottomWidth:!m||i?c:d}}function Ug(e,t,n){const i=v.scalingValue(t,n),o=v.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Wl=10;function Xg(e){return`
|
|
8640
8718
|
.${e}-wrapper {
|
|
8641
8719
|
display: grid;
|
|
8642
8720
|
align-items: start;
|
|
8643
|
-
min-height: ${
|
|
8721
|
+
min-height: ${Vr(48)};
|
|
8644
8722
|
position: relative;
|
|
8645
8723
|
overflow: visible;
|
|
8646
8724
|
box-sizing: border-box;
|
|
@@ -8762,7 +8840,7 @@ a.${e}-list-item {
|
|
|
8762
8840
|
flex-shrink: 0;
|
|
8763
8841
|
overflow: visible;
|
|
8764
8842
|
box-sizing: border-box;
|
|
8765
|
-
min-width: ${
|
|
8843
|
+
min-width: ${Vr(50)};
|
|
8766
8844
|
position: relative;
|
|
8767
8845
|
display: flex;
|
|
8768
8846
|
align-items: flex-start;
|
|
@@ -8770,7 +8848,7 @@ a.${e}-list-item {
|
|
|
8770
8848
|
|
|
8771
8849
|
.${e}-list-col-last {
|
|
8772
8850
|
flex: 1 1 auto;
|
|
8773
|
-
min-width: ${
|
|
8851
|
+
min-width: ${Vr(50)};
|
|
8774
8852
|
}
|
|
8775
8853
|
|
|
8776
8854
|
.${e}-list-col-title {
|
|
@@ -9067,7 +9145,7 @@ a.${e}-list-item {
|
|
|
9067
9145
|
overflow-wrap: anywhere;
|
|
9068
9146
|
word-break: break-word;
|
|
9069
9147
|
}
|
|
9070
|
-
`}const Un=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Va=["AColumn","BColumn","CColumn","DColumn","EColumn"],An="cutLabel",mo=[...Va,An],Tr=["A","B","C","D","E"];function rc(e){return`${e}ColumnVerticalAlign`}const ha=["Top","Center","Bottom"];function Ga(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Tr.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Vg(e){const t=Ga(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Gg(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Tr.includes(n)?n:null}function ac(e,t,n){const i=Gg(e);return i?i===t?!1:Vg(n[rc(i)]):!0}function go(e){const t=Ga(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Tr.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function qg(e,t,n){if(lc(e,t,n))return go(e);const i=go(e);return i.kind==="baseline"?{kind:"top"}:i}function Kg(e){const t=go(e);return t.kind==="baseline"?{kind:"top"}:t}function lc(e,t,n){return ac(e,n,t)?go(e).kind==="baseline":!1}function Ug(e){const t={};let n=!1;for(const i of Tr){const o=rc(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}ac(l,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Xg(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Yg(e){const t=go(e).kind;return t==="baseline"?"center":t}function Zg(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function _l(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Jg(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 qr(e,t,n,i){const o=e.titleEl;if(!o)return 0;const l=o.closest(`.${n}`);if(!l)return 0;const s=Jg(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+s;const d=l.getBoundingClientRect(),c=o.getBoundingClientRect().height;let u=0;return e.kind==="center"?u=(d.height-c)/2:e.kind==="bottom"&&(u=d.height-c),d.top-t+u+s}function Qg(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 eh(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const th={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function vt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const nh={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function ih(e){return[vt(e,"textFontFamily"),vt(e,"textFontSettings"),{type:"row",items:[vt(e,"textFontSize"),vt(e,"textLineHeight"),vt(e,"textLetterSpacing"),vt(e,"textWordSpacing")]},vt(e,"textTextAlign"),vt(e,"textTextAppearance"),`${e}VerticalAlign`]}function oh(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(mo.map(e=>[nh[e],ih(e)]))}}function ar(e,t){const n=i=>{const o=vt(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===An?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Nl(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 dn(Xt(n,t))}function Hl(e,t,n,i){const o=ar(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s!==void 0&&s<l?`${n} ${i}`:n}function jl(e,t,n,i){const o=ar(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s===void 0||s>=l?{}:{[`--${n}-title-leading-gap`]:y.scalingValue((l-s)/2,i)}}const yn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Wi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],_i=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Ni=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],rh={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},ah=["hover","focus","filled","success","error"],Ol=.004,$i=.004,Kr=$i,qa=50,ho=1440,fo=qa/ho;function sc(e){const t=typeof e=="number"&&e>0?e:ho;return qa/t}function lh(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 ho}const cc={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function no(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function sh(e,t=1){const n=t/e;return Object.fromEntries(yn.map(i=>[i,n]))}function ch(){return Object.fromEntries([...Wi.map(e=>[e,0]),..._i.map(e=>[e,0])])}function dh(){return Object.fromEntries(Ni.map(e=>[e,0]))}function Ho(e){return Object.fromEntries(yn.map(t=>[t,typeof e[t]=="number"?e[t]:cc[t]]))}function dc(e,t,n){const i=e-fo,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 Zo(e,t,n){const i=Ka(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 uh(e,t,n){const i={};for(let o=0;o<e;o+=1){const l=Wi[o],s=_i[o],d=typeof n[l]=="number"?n[l]:0,c=typeof n[s]=="number"?n[s]:0,u=dc(t[o]??0,d,c);u.paddingLeft!==d&&(i[l]=u.paddingLeft),u.paddingRight!==c&&(i[s]=u.paddingRight)}return i}function Ka(e,t,n){if(e<=0)return[];const i=yn.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),s=o.reduce((u,m)=>u+m,0)+fo;if(t>=s)return i;const d=[...o];let c=s-t;for(let u=d.length-1;u>=0&&c>0;u-=1){const m=d[u]-fo;if(m<=0)continue;const x=Math.min(c,m);d[u]-=x,c-=x}return[...d,i[e-1]]}function ph(e,t,n){if(e<=1)return{};const i=Ka(e,t,n),o={};for(let l=0;l<e-1;l+=1){const s=yn[l];i[l]!==n[s]&&(o[s]=i[l])}return o}function zl(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Un]}function mh(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function gh(e,t,n,i){const o=Math.min(i,e.length,yn.length),l={};for(let s=0;s<o;s+=1){const d=e[s],c=t.indexOf(d);if(c===-1)continue;const u=yn[c],m=Wi[c],x=_i[c],b=Ni[c],T=yn[s],f=Wi[s],L=_i[s],$=Ni[s],R=n[u],E=n[m],C=n[x],U=n[b];typeof R=="number"&&(l[T]=R),typeof E=="number"&&(l[f]=E),typeof C=="number"&&(l[L]=C),typeof U=="number"&&(l[$]=U)}return l}function uc(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 hh(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=no(e),l=e.type==="b"||e.type===void 0&&t.type==="b",s={...e,...sh(n,o),...ch()};if(l)for(const d of Ni)typeof t[d]=="number"&&(s[d]=t[d]);else Object.assign(s,dh());return uc(e,s)?s:e}function fh(e,t,n){const i=Ug(e);i&&(e={...e,...i});const o=sc(n==null?void 0:n.designWidth),l=e.columns,s=t.columns,d=no(e),c=no(t),u=e.type==="b"||e.type===void 0&&t.type==="b",m=typeof l=="number"?l:typeof s=="number"?s:Un.length,x=C=>{if(u)return C;const U=Ho({...t,...C}),k=no(C),j=Zo(m,k,U),I=uh(m,j,{...t,...C});return Object.keys(I).length===0?C:{...C,...I}};if(typeof l=="number"&&l!==s)return e;const b=zl(e),T=zl(t);if(!mh(b,T))return x({...e,...gh(b,T,t,m)});if(d<c&&typeof m=="number"&&!u){const C=Ho({...t,...e});return x({...e,...ph(m,d,C)})}if(u){const C=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,U=Math.max(0,(d-o)/2);return C>U?{...e,textPaddingLR:U}:e}const f=Ho({...t,...e}),L=Zo(m,c,Ho(t)),R=Zo(m,d,f).some((C,U)=>C<(L[U]??C)),E=yn.some(C=>{const U=e[C],k=t[C];return typeof U=="number"&&typeof k=="number"&&U!==k});return R||E?x(e):e}function yh(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(fo,i-o-l-fo)}function vh(e,t){return Math.random()*(t-e)+e}function xh(e){return Object.fromEntries(yn.map(t=>[t,typeof e[t]=="number"?e[t]:cc[t]]))}function Ur(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function bh(e,t,n,i,o,l){return e.slice(0,t).map((s,d)=>{const c=Wi[d],u=_i[d],m=Ni[d];return{key:s,textPrefix:th[s],widthKey:yn[d],width:n[yn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:m,paddingLeft:i[c],paddingRight:o[u],paddingBottom:l[m]}})}function wh({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:l,layoutId:s,onUpdateSettings:d}){const{prefix:c}=y.useScopedStyles(),u=!!o,{columns:m,type:x,wrapperWidth:b,entriesCount:T,cellMinHeight:f,dividerWidth:L,showVisibility:$,cut:R,showCut:E,cutCellMinHeight:C,cutLabel:U,imageSize:k,imageOnHover:j,entryHoverEffect:I,entryHoverShowOption:w,rowPaddingTop:W,rowPaddingBottom:h,rowPaddingTopB:S,columnsOrder:M,textPaddingLR:z,textColor:K,backgroundColor:le,dividerColor:Y,textHoverColor:D,backgroundHoverColor:N,dividerHoverColor:F}=e,[A,q]=a.useState(void 0),[G,Z]=a.useState(null),_=j==="on"&&(!n||i),me=(R??0)>0,v=x==="b",fe=a.useRef(null),J=a.useRef(null),[de,$e]=a.useState(null),[oe,xe]=a.useState(ho),Q=sc(oe),ye=Math.max(0,((b??0)-Q)/2),ve=Math.min(z??0,ye),ke=Math.max(ve,$i),we=((b??0)+Q)/2;a.useLayoutEffect(()=>{if(!n){xe(ho);return}const Te=()=>{xe(lh(fe.current))};Te();const Oe=fe.current;if(!Oe)return;const Ke=new ResizeObserver(Te);Ke.observe(Oe);let Ne=Oe;for(;Ne&&!Ne.style.getPropertyValue("--cntrl-article-width");)Ne=Ne.parentElement;return Ne&&Ke.observe(Ne),()=>Ke.disconnect()},[n,s]),a.useEffect(()=>{q(void 0)},[R,E,t,T]),a.useEffect(()=>{n&&!i&&q(void 0)},[n,i]);const Me=y.buildColorVars(c,{textColor:K,backgroundColor:le,dividerColor:Y,textHoverColor:D,backgroundHoverColor:N,dividerHoverColor:F},rh,ah),X=l&&l!=="default"?`${c}-state-${l}`:"",Se=`${!n||i?I==="default"?`${c}-entry-hover-default`:I==="blinds"?`${c}-entry-hover-blinds`:I==="reveal"?`${c}-entry-hover-reveal`:"":""} ${X}`.trim(),O=I==="reveal"&&(!n||i),ce=($==null?void 0:$[0])??!1,H=($==null?void 0:$[1])??!1,re=a.useRef(e),ae=a.useRef(s);a.useEffect(()=>{if(!d||!n){re.current=e,ae.current=s;return}if(ae.current!==s){re.current=e,ae.current=s;return}const Te=re.current;if(!(Te!==e))return;if(typeof Te.columns=="number"&&typeof e.columns=="number"&&Te.columns!==e.columns){re.current=e;return}const Ke=fh(e,Te,{designWidth:oe});re.current=e,uc(e,Ke)&&d(Ke)},[e,d,n,s,oe]);const ne=a.useMemo(()=>xh(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),ie=a.useMemo(()=>Ur(e,Wi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),be=a.useMemo(()=>Ur(e,_i),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Ce=a.useMemo(()=>Ur(e,Ni),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),ee=a.useMemo(()=>Array.isArray(M)&&M.length>0?M:[...Un],[M]),pe=a.useMemo(()=>bh(ee,m,ne,ie,be,Ce),[ee,m,ne,ie,be,Ce]),Ae=no(e),se=a.useMemo(()=>yn.slice(0,m).map(Te=>ne[Te]),[m,ne]),V=a.useMemo(()=>Ka(m,Ae,ne),[m,Ae,ne]),je=a.useMemo(()=>Zo(m,Ae,ne),[m,Ae,ne]),We=a.useMemo(()=>pe.map((Te,Oe)=>dc(je[Oe]??0,Te.paddingLeft,Te.paddingRight)),[pe,je]),et=a.useMemo(()=>{const Te=T===0?1/0:T;return(t??[]).slice(0,Te).map((Ke,Ne)=>({id:Ne,cells:Object.fromEntries(Un.map(ze=>[ze,Ke[ze]??""])),image:Ke.image,link:Ke.link}))},[t,T]),Ye=me?A??R:et.length,st=a.useMemo(()=>me?et.slice(0,Ye):et,[et,me,Ye]),mt=me&&Ye<et.length,De=st.length>1||mt,ot=[ce?`${c}-divider-top`:"",H||De?`${c}-divider-bottom`:""].filter(Boolean).join(" "),$t=!n||i,rt=()=>{if(!$t)return;const Te=A??R;if(!E){q(et.length);return}q(Math.min(Te+E,et.length))},Ue=Te=>y.scalingValue(Te,n??!1),ht=v?S??0:W??0,xt=h??0,dt=f??0,kt=ht+dt/2,_t=Math.max(xt,Kr),Qe=Fl(0,st.length,ce,H,mt,L??0,n??!1).borderTopWidth,Tt=de!=null?`${de}px`:`calc(${Qe} + ${Ue(kt)})`,Lt=v?"rowPaddingTopB":"rowPaddingTop",Ge=pe[0],qe=pe[pe.length-1],Pe=We[0],gt=We[We.length-1],It=Ge&&Pe?Math.max(Pe.paddingLeft,$i):0,Mt=qe&>?Math.max(gt.paddingRight,$i):0,Dt=Ae,en=Te=>{const Oe=fe.current;if(!Oe)return{x:0,y:0};const Ke=Oe.getBoundingClientRect();return{x:Te.clientX-Ke.left+Wl,y:Te.clientY-Ke.top+Wl}},on=(Te,Oe)=>{if(!_)return;const Ke=Te.image;if(!(Ke!=null&&Ke.url)){Z(null);return}const{x:Ne,y:ze}=en(Oe),ut=(k==null?void 0:k.min)??80,_e=(k==null?void 0:k.max)??320,Je=(G==null?void 0:G.rowId)===Te.id?G.widthPx:vh(ut,_e);Z({rowId:Te.id,url:Ke.url,objectFit:"contain",isVideo:jg(Ke),widthPx:Je,x:Ne,y:ze})},bt=Te=>{if(!_||!G)return;const{x:Oe,y:Ke}=en(Te);Z(Ne=>!Ne||Ne.x===Oe&&Ne.y===Ke?Ne:{...Ne,x:Oe,y:Ke})},Rt=()=>{Z(null)},Ut=Te=>{O&&Pl(Te,c),_&&Z(null)},Kt=Te=>{O&&Al(Te,c)};a.useLayoutEffect(()=>{if(!u||v){$e(null);return}const Te=J.current,Oe=Te==null?void 0:Te.parentElement;if(!Te||!Oe){$e(null);return}const Ke=()=>{const ze=Te.querySelector("[data-list-row]");if(!ze){$e(null);return}const ut=Oe.getBoundingClientRect(),_e=ze.getBoundingClientRect();$e(_e.top-ut.top+_e.height/2)};Ke();const Ne=new ResizeObserver(Ke);return Ne.observe(Te),Ne.observe(Oe),()=>Ne.disconnect()},[u,v,st,ht,xt,dt,t,e,pe,je,oe,L,ce,H,mt]);const ft=a.useMemo(()=>!v&&Va.some(Te=>{const Oe=Te.charAt(0),Ke=e[`${Te}VerticalAlign`];return lc(Ke,e,Oe)}),[v,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);a.useLayoutEffect(()=>{var Je;const Te=fe.current;if(!Te)return;const Oe=()=>{Te.querySelectorAll("[data-list-col]").forEach(tt=>{tt.style.transform="";const Wt=tt.querySelector(`.${c}-list-col`);Wt&&(Wt.style.minHeight="",Wt.style.height="");const Ct=tt.querySelector(`.${c}-list-col-title`);Ct&&(Ct.style.transform="")})};if(v||!ft){Oe();return}const Ke=()=>{const tt=Array.from(Te.querySelectorAll("[data-list-row]")),Wt=`${c}-list-col`,Ct=`${c}-baseline-probe`;tt.forEach(lt=>{lt.querySelectorAll("[data-list-col]").forEach(Nt=>{Nt.style.transform="";const At=Nt.querySelector(`.${Wt}`);At&&(At.style.minHeight="",At.style.height="");const Vt=Nt.querySelector(`.${c}-list-col-title`);Vt&&(Vt.style.transform="")})}),tt.forEach(lt=>{const Nt=Array.from(lt.querySelectorAll("[data-list-col]"));Qg(lt,Nt,Wt)}),Te.offsetHeight,tt.forEach(lt=>{const Nt=Array.from(lt.querySelectorAll("[data-list-col]")),At=lt.getBoundingClientRect().top,Vt=new Map,zt=Nt.map(wt=>{const Gt=wt.querySelector(`.${c}-list-col-title`),pt={el:wt,titleEl:Gt,letter:wt.getAttribute("data-col-letter")??"",kind:wt.getAttribute("data-valign")??"top",anchor:wt.getAttribute("data-valign-anchor")};return Vt.set(pt.letter,pt),pt}),Pt=new Map,Qt=(wt,Gt)=>{const pt=Pt.get(wt.letter);if(pt!==void 0)return pt;const Ft=wt.anchor?Vt.get(wt.anchor):void 0;if(wt.kind!=="baseline"||!Ft||Gt.has(wt.letter)){const Ie=qr(wt,At,Wt,Ct);return Pt.set(wt.letter,Ie),Ie}Gt.add(wt.letter);const Bt=Qt(Ft,Gt);Gt.delete(wt.letter);const g=qr(wt,At,Wt,Ct),ge=Bt-g;eh(wt.titleEl,ge);const Re=qr(wt,At,Wt,Ct);return Pt.set(wt.letter,Re),Re};zt.forEach(wt=>Qt(wt,new Set))})};let Ne=null;const ze=()=>{Ne===null&&(Ne=requestAnimationFrame(()=>{Ne=null,Ke()}))};Ke();const ut=new ResizeObserver(()=>ze());ut.observe(Te);let _e=!1;return typeof document<"u"&&((Je=document.fonts)!=null&&Je.ready)&&document.fonts.ready.then(()=>{_e||ze()}),()=>{_e=!0,Ne!==null&&(cancelAnimationFrame(Ne),Ne=null),ut.disconnect(),Oe()}},[ft,v,e,t,oe,st,je]);const Jt=a.useMemo(()=>Dg(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Jt}}),r.jsx("div",{style:Me,children:r.jsxs("div",{ref:fe,className:`${c}-wrapper ${Se}${ot?` ${ot}`:""}${v?` ${c}-type-b`:""}`.trim(),style:{width:y.scalingValue(b??0,n),...!v&&u?{[`--${c}-first-entry-handle-top`]:Tt}:{}},onMouseMove:_?bt:void 0,onMouseLeave:_?Rt:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[st.map((Te,Oe)=>{var ut;const Ke=(((ut=Te.link)==null?void 0:ut.length)??0)>0,Ne=Ke&&(!n||i)?"a":"div",ze=Fl(Oe,st.length,ce,H,mt,L??0,n??!1);return r.jsxs(Ne,{ref:Oe===0?_e=>{J.current=_e}:void 0,className:`${c}-list-item${Ke||w==="always"?` ${c}-list-item-has-link`:""}`,...Ke?{href:Te.link,target:"_blank"}:{},style:ze,onMouseEnter:_e=>{O&&(Ke||w==="always")&&Pl(_e,c),_&&on(Te,_e)},onMouseLeave:_e=>{O&&(Ke||w==="always")&&Al(_e,c)},children:[ht>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ue(ht)}}),r.jsxs("div",{className:`${c}-list-cols-row${v?"":` ${c}-list-cols-row-h`}${u&&Oe===0&&v?` ${c}-list-cols-row-controls`:""}`,...v?{}:{"data-list-row":""},style:v?void 0:{minHeight:Ue(dt)},children:[pe.map((_e,Je)=>{const tt=Je===pe.length-1,Wt=We[Je],Ct=_e.paddingBottom,lt=zg(Te.cells[_e.key]),Nt=v&<&&Ct>0,At=v?{minHeight:Ue(dt)}:{width:Ue(je[Je])},Vt=v?{paddingLeft:Ue(ve),paddingRight:Ue(ve)}:{paddingLeft:Ue(Wt.paddingLeft),paddingRight:Ue(Wt.paddingRight)},zt=_e.textPrefix.charAt(0),Pt=v?Kg(e[`${_e.textPrefix}VerticalAlign`]):qg(e[`${_e.textPrefix}VerticalAlign`],e,zt),Qt=v&<&&u&&Oe===0;return v&&!lt?null:r.jsxs("div",{className:v?`${c}-list-col-wrap`:void 0,...v?{}:{"data-list-col":"","data-col-letter":zt,"data-valign":Pt.kind,...Pt.kind==="baseline"?{"data-valign-anchor":Pt.anchorLetter}:{}},children:[r.jsx("div",{className:`${c}-list-col${tt?` ${c}-list-col-last`:""}`,style:{...Vt,...At,...v?{justifyContent:_l(Pt.kind)}:{}},"data-test":_e.width,children:r.jsx("span",{className:Hl(e,_e.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Nl(ar(e,_e.textPrefix),n),...jl(e,_e.textPrefix,c,n),...v?{}:Xg(Pt.kind)},children:Te.cells[_e.key]??null})}),Nt&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ue(Ct)}}),Qt&&r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":_e.paddingBottomKey,"data-controls-static-handle":"","data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:"center",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:Ue(Math.max(Ct,Kr))}})]},_e.key)}),u&&Oe===0&&v&&r.jsxs(r.Fragment,{children:[r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"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(we),className:`${c}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:Ue(ke),height:"100%"}}),r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"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(we),className:`${c}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:Ue(Math.max(ke,Ae-ke)),width:Ue(ke),height:"100%"}})]})]}),!v&&xt>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ue(xt)}}),u&&Oe===0&&!v&&r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"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:`${c}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:Ue(_t)}})]},Te.id)}),u&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Lt,"data-controls-static-handle":"",...v?{}:{"data-controls-handle-left":"20"},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:v?"center":"left-y",areaStyle:{position:"absolute",top:Qe,left:0,width:"100%",height:Ue(Math.max(ht,Kr))}})},"row-padding-handles"),u&&!v&&Ge&&qe&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Ge.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(je[0]-((Pe==null?void 0:Pe.paddingRight)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:Ue(It),height:"100%"}}),r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":qe.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(je[pe.length-1]-((gt==null?void 0:gt.paddingLeft)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Ue(Dt-Mt),width:Ue(Mt),height:"100%"}})]},"column-edge-padding-handles"),u&&!v&&pe.slice(0,-1).map((Te,Oe)=>{const Ke=pe[Oe+1],Ne=V.slice(0,Oe+1).reduce((tt,Wt)=>tt+Wt,0),ze=We[Oe],ut=We[Oe+1],_e=Math.max(ze.paddingRight,$i),Je=Math.max(ut.paddingLeft,$i);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Te.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(je[Oe]-ze.paddingLeft),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Ue(Ne-_e),width:Ue(_e),height:"100%"}}),r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Ke.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(je[Oe+1]-ut.paddingRight),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Ue(Ne),width:Ue(Je),height:"100%"}})]},`${Te.paddingRightKey}-padding`)}),u&&!v&&pe.slice(0,-1).map((Te,Oe)=>{const Ke=yh(Oe,V,se,Ae),ze=V.slice(0,Oe+1).reduce((ut,_e)=>ut+_e,0)-Ol/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":Te.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(qa),"data-controls-max-fraction":String(Ke),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Ue(ze),width:Ue(Ol),height:"calc(100%)",pointerEvents:"auto"}})},`${Te.widthKey}-junction`)})]}),mt&&(()=>{const Te=ar(e,An),Oe=Yg(e.cutLabelVerticalAlign),Ke=Te.textTextAlign==="justify"||v;return r.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Ue(C??0),cursor:$t?"pointer":"default",...Bg(H,L??0,n??!1)},onClick:$t?rt:void 0,onMouseEnter:O||_?Ut:void 0,onMouseLeave:O?Kt:void 0,children:r.jsx("div",{className:`${c}-list-cols-row`,style:{...v?{paddingLeft:Ue(ve),paddingRight:Ue(ve)}:{},justifyContent:Zg(Te.textTextAlign),alignItems:_l(Oe)},children:r.jsx("span",{className:Hl(e,An,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Nl(Te,n),...jl(e,An,c,n),...Ke?{width:"100%"}:{}},children:U})})})})(),_&&G&&(()=>{const Te=`${G.widthPx}px`,Oe={width:Te,height:"auto",maxHeight:Te,objectFit:"contain",left:G.x,top:G.y,position:"absolute"};return r.jsx(Og,{media:G,className:G.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Oe},`${G.rowId}-${G.url}`)})()]})})]})}const Sh=`import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
9148
|
+
`}const Xn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Da=["AColumn","BColumn","CColumn","DColumn","EColumn"],An="cutLabel",mo=[...Da,An],Cr=["A","B","C","D","E"];function lc(e){return`${e}ColumnVerticalAlign`}const ga=["Top","Center","Bottom"];function Va(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Cr.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Yg(e){const t=Va(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Zg(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Cr.includes(n)?n:null}function sc(e,t,n){const i=Zg(e);return i?i===t?!1:Yg(n[lc(i)]):!0}function go(e){const t=Va(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Cr.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function Jg(e,t,n){if(cc(e,t,n))return go(e);const i=go(e);return i.kind==="baseline"?{kind:"top"}:i}function Qg(e){const t=go(e);return t.kind==="baseline"?{kind:"top"}:t}function cc(e,t,n){return sc(e,n,t)?go(e).kind==="baseline":!1}function eh(e){const t={};let n=!1;for(const i of Cr){const o=lc(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}sc(l,i,e)||(t[o]="Top",n=!0)}return n?t:null}function th(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function nh(e){const t=go(e).kind;return t==="baseline"?"center":t}function ih(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function _l(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function oh(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 Gr(e,t,n,i){const o=e.titleEl;if(!o)return 0;const l=o.closest(`.${n}`);if(!l)return 0;const s=oh(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+s;const c=l.getBoundingClientRect(),d=o.getBoundingClientRect().height;let u=0;return e.kind==="center"?u=(c.height-d)/2:e.kind==="bottom"&&(u=c.height-d),c.top-t+u+s}function rh(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 ah(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const lh={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Ct(e,t){return`${e}${t.replace(/^text/,"Text")}`}const sh={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function ch(e){return[Ct(e,"textFontFamily"),Ct(e,"textFontSettings"),{type:"row",items:[Ct(e,"textFontSize"),Ct(e,"textLineHeight"),Ct(e,"textLetterSpacing"),Ct(e,"textWordSpacing")]},Ct(e,"textTextAlign"),Ct(e,"textTextAppearance"),`${e}VerticalAlign`]}function dh(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(mo.map(e=>[sh[e],ch(e)]))}}function rr(e,t){const n=i=>{const o=Ct(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===An?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Hl(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 dn(Xt(n,t))}function Nl(e,t,n,i){const o=rr(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s!==void 0&&s<l?`${n} ${i}`:n}function Ol(e,t,n,i){const o=rr(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s===void 0||s>=l?{}:{[`--${n}-title-leading-gap`]:v.scalingValue((l-s)/2,i)}}const yn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],_i=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Hi=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Ni=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],uh={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},ph=["hover","focus","filled","success","error"],jl=.004,$i=.004,qr=$i,Ga=50,ho=1440,fo=Ga/ho;function dc(e){const t=typeof e=="number"&&e>0?e:ho;return Ga/t}function mh(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 ho}const uc={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function no(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function gh(e,t=1){const n=t/e;return Object.fromEntries(yn.map(i=>[i,n]))}function hh(){return Object.fromEntries([..._i.map(e=>[e,0]),...Hi.map(e=>[e,0])])}function fh(){return Object.fromEntries(Ni.map(e=>[e,0]))}function Ho(e){return Object.fromEntries(yn.map(t=>[t,typeof e[t]=="number"?e[t]:uc[t]]))}function pc(e,t,n){const i=e-fo,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 Yo(e,t,n){const i=qa(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 yh(e,t,n){const i={};for(let o=0;o<e;o+=1){const l=_i[o],s=Hi[o],c=typeof n[l]=="number"?n[l]:0,d=typeof n[s]=="number"?n[s]:0,u=pc(t[o]??0,c,d);u.paddingLeft!==c&&(i[l]=u.paddingLeft),u.paddingRight!==d&&(i[s]=u.paddingRight)}return i}function qa(e,t,n){if(e<=0)return[];const i=yn.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),s=o.reduce((u,m)=>u+m,0)+fo;if(t>=s)return i;const c=[...o];let d=s-t;for(let u=c.length-1;u>=0&&d>0;u-=1){const m=c[u]-fo;if(m<=0)continue;const x=Math.min(d,m);c[u]-=x,d-=x}return[...c,i[e-1]]}function vh(e,t,n){if(e<=1)return{};const i=qa(e,t,n),o={};for(let l=0;l<e-1;l+=1){const s=yn[l];i[l]!==n[s]&&(o[s]=i[l])}return o}function zl(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Xn]}function bh(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function xh(e,t,n,i){const o=Math.min(i,e.length,yn.length),l={};for(let s=0;s<o;s+=1){const c=e[s],d=t.indexOf(c);if(d===-1)continue;const u=yn[d],m=_i[d],x=Hi[d],w=Ni[d],$=yn[s],f=_i[s],S=Hi[s],L=Ni[s],M=n[u],A=n[m],C=n[x],J=n[w];typeof M=="number"&&(l[$]=M),typeof A=="number"&&(l[f]=A),typeof C=="number"&&(l[S]=C),typeof J=="number"&&(l[L]=J)}return l}function mc(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 wh(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=no(e),l=e.type==="b"||e.type===void 0&&t.type==="b",s={...e,...gh(n,o),...hh()};if(l)for(const c of Ni)typeof t[c]=="number"&&(s[c]=t[c]);else Object.assign(s,fh());return mc(e,s)?s:e}function Sh(e,t,n){const i=eh(e);i&&(e={...e,...i});const o=dc(n==null?void 0:n.designWidth),l=e.columns,s=t.columns,c=no(e),d=no(t),u=e.type==="b"||e.type===void 0&&t.type==="b",m=typeof l=="number"?l:typeof s=="number"?s:Xn.length,x=C=>{if(u)return C;const J=Ho({...t,...C}),k=no(C),U=Yo(m,k,J),I=yh(m,U,{...t,...C});return Object.keys(I).length===0?C:{...C,...I}};if(typeof l=="number"&&l!==s)return e;const w=zl(e),$=zl(t);if(!bh(w,$))return x({...e,...xh(w,$,t,m)});if(c<d&&typeof m=="number"&&!u){const C=Ho({...t,...e});return x({...e,...vh(m,c,C)})}if(u){const C=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,J=Math.max(0,(c-o)/2);return C>J?{...e,textPaddingLR:J}:e}const f=Ho({...t,...e}),S=Yo(m,d,Ho(t)),M=Yo(m,c,f).some((C,J)=>C<(S[J]??C)),A=yn.some(C=>{const J=e[C],k=t[C];return typeof J=="number"&&typeof k=="number"&&J!==k});return M||A?x(e):e}function $h(e,t,n,i){const o=t.slice(0,e).reduce((s,c)=>s+c,0),l=n.slice(e+1,t.length-1).reduce((s,c)=>s+c,0);return Math.max(fo,i-o-l-fo)}function Ch(e,t){return Math.random()*(t-e)+e}function Th(e){return Object.fromEntries(yn.map(t=>[t,typeof e[t]=="number"?e[t]:uc[t]]))}function Kr(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function Lh(e,t,n,i,o,l){return e.slice(0,t).map((s,c)=>{const d=_i[c],u=Hi[c],m=Ni[c];return{key:s,textPrefix:lh[s],widthKey:yn[c],width:n[yn[c]],paddingLeftKey:d,paddingRightKey:u,paddingBottomKey:m,paddingLeft:i[d],paddingRight:o[u],paddingBottom:l[m]}})}function Ih({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:l,layoutId:s,onUpdateSettings:c}){const{prefix:d}=v.useScopedStyles(),u=!!o,{columns:m,type:x,wrapperWidth:w,entriesCount:$,cellMinHeight:f,dividerWidth:S,showVisibility:L,cut:M,showCut:A,cutCellMinHeight:C,cutLabel:J,imageSize:k,imageOnHover:U,entryHoverEffect:I,entryHoverShowOption:R,rowPaddingTop:T,rowPaddingBottom:y,rowPaddingTopB:h,columnsOrder:F,textPaddingLR:W,textColor:V,backgroundColor:ne,dividerColor:X,textHoverColor:z,backgroundHoverColor:H,dividerHoverColor:_}=e,[E,q]=a.useState(void 0),[Y,ee]=a.useState(null),N=U==="on"&&(!n||i),pe=(M??0)>0,b=x==="b",ye=a.useRef(null),Q=a.useRef(null),[xe,$e]=a.useState(null),[oe,ie]=a.useState(ho),B=dc(oe),le=Math.max(0,((w??0)-B)/2),re=Math.min(W??0,le),ke=Math.max(re,$i),fe=((w??0)+B)/2;a.useLayoutEffect(()=>{if(!n){ie(ho);return}const Re=()=>{ie(mh(ye.current))};Re();const Ve=ye.current;if(!Ve)return;const Xe=new ResizeObserver(Re);Xe.observe(Ve);let ze=Ve;for(;ze&&!ze.style.getPropertyValue("--cntrl-article-width");)ze=ze.parentElement;return ze&&Xe.observe(ze),()=>Xe.disconnect()},[n,s]),a.useEffect(()=>{q(void 0)},[M,A,t,$]),a.useEffect(()=>{n&&!i&&q(void 0)},[n,i]);const Pe=v.buildColorVars(d,{textColor:V,backgroundColor:ne,dividerColor:X,textHoverColor:z,backgroundHoverColor:H,dividerHoverColor:_},uh,ph),ve=l&&l!=="default"?`${d}-state-${l}`:"",Se=`${!n||i?I==="default"?`${d}-entry-hover-default`:I==="blinds"?`${d}-entry-hover-blinds`:I==="reveal"?`${d}-entry-hover-reveal`:"":""} ${ve}`.trim(),G=I==="reveal"&&(!n||i),me=(L==null?void 0:L[0])??!1,D=(L==null?void 0:L[1])??!1,K=a.useRef(e),ae=a.useRef(s);a.useEffect(()=>{if(!c||!n){K.current=e,ae.current=s;return}if(ae.current!==s){K.current=e,ae.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 Xe=Sh(e,Re,{designWidth:oe});K.current=e,mc(e,Xe)&&c(Xe)},[e,c,n,s,oe]);const ge=a.useMemo(()=>Th(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),ce=a.useMemo(()=>Kr(e,_i),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),be=a.useMemo(()=>Kr(e,Hi),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Ee=a.useMemo(()=>Kr(e,Ni),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),Z=a.useMemo(()=>Array.isArray(F)&&F.length>0?F:[...Xn],[F]),de=a.useMemo(()=>Lh(Z,m,ge,ce,be,Ee),[Z,m,ge,ce,be,Ee]),We=no(e),se=a.useMemo(()=>yn.slice(0,m).map(Re=>ge[Re]),[m,ge]),O=a.useMemo(()=>qa(m,We,ge),[m,We,ge]),Oe=a.useMemo(()=>Yo(m,We,ge),[m,We,ge]),_e=a.useMemo(()=>de.map((Re,Ve)=>pc(Oe[Ve]??0,Re.paddingLeft,Re.paddingRight)),[de,Oe]),nt=a.useMemo(()=>{const Re=$===0?1/0:$;return(t??[]).slice(0,Re).map((Xe,ze)=>({id:ze,cells:Object.fromEntries(Xn.map(mt=>[mt,Xe[mt]??""])),image:Xe.image,link:Xe.link}))},[t,$]),Ue=pe?E??M:nt.length,Ce=a.useMemo(()=>pe?nt.slice(0,Ue):nt,[nt,pe,Ue]),Fe=pe&&Ue<nt.length,He=Ce.length>1||Fe,Ze=[me?`${d}-divider-top`:"",D||He?`${d}-divider-bottom`:""].filter(Boolean).join(" "),Tt=!n||i,it=()=>{if(!Tt)return;const Re=E??M;if(!A){q(nt.length);return}q(Math.min(Re+A,nt.length))},De=Re=>v.scalingValue(Re,n??!1),et=b?h??0:T??0,dt=y??0,lt=f??0,ht=et+lt/2,Rt=Math.max(dt,qr),ot=Fl(0,Ce.length,me,D,Fe,S??0,n??!1).borderTopWidth,xt=xe!=null?`${xe}px`:`calc(${ot} + ${De(ht)})`,zt=b?"rowPaddingTopB":"rowPaddingTop",rt=de[0],qe=de[de.length-1],Ne=_e[0],pt=_e[_e.length-1],yt=rt&&Ne?Math.max(Ne.paddingLeft,$i):0,Mt=qe&&pt?Math.max(pt.paddingRight,$i):0,Dt=We,en=Re=>{const Ve=ye.current;if(!Ve)return{x:0,y:0};const Xe=Ve.getBoundingClientRect();return{x:Re.clientX-Xe.left+Wl,y:Re.clientY-Xe.top+Wl}},sn=(Re,Ve)=>{if(!N)return;const Xe=Re.image;if(!(Xe!=null&&Xe.url)){ee(null);return}const{x:ze,y:mt}=en(Ve),Nt=(k==null?void 0:k.min)??80,Ae=(k==null?void 0:k.max)??320,Ye=(Y==null?void 0:Y.rowId)===Re.id?Y.widthPx:Ch(Nt,Ae);ee({rowId:Re.id,url:Xe.url,objectFit:"contain",isVideo:Gg(Xe),widthPx:Ye,x:ze,y:mt})},Lt=Re=>{if(!N||!Y)return;const{x:Ve,y:Xe}=en(Re);ee(ze=>!ze||ze.x===Ve&&ze.y===Xe?ze:{...ze,x:Ve,y:Xe})},Et=()=>{ee(null)},Qt=Re=>{G&&Pl(Re,d),N&&ee(null)},Ut=Re=>{G&&Al(Re,d)};a.useLayoutEffect(()=>{if(!u||b){$e(null);return}const Re=Q.current,Ve=Re==null?void 0:Re.parentElement;if(!Re||!Ve){$e(null);return}const Xe=()=>{const mt=Re.querySelector("[data-list-row]");if(!mt){$e(null);return}const Nt=Ve.getBoundingClientRect(),Ae=mt.getBoundingClientRect();$e(Ae.top-Nt.top+Ae.height/2)};Xe();const ze=new ResizeObserver(Xe);return ze.observe(Re),ze.observe(Ve),()=>ze.disconnect()},[u,b,Ce,et,dt,lt,t,e,de,Oe,oe,S,me,D,Fe]);const ft=a.useMemo(()=>!b&&Da.some(Re=>{const Ve=Re.charAt(0),Xe=e[`${Re}VerticalAlign`];return cc(Xe,e,Ve)}),[b,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);a.useLayoutEffect(()=>{var Ye;const Re=ye.current;if(!Re)return;const Ve=()=>{Re.querySelectorAll("[data-list-col]").forEach(Je=>{Je.style.transform="";const bt=Je.querySelector(`.${d}-list-col`);bt&&(bt.style.minHeight="",bt.style.height="");const $t=Je.querySelector(`.${d}-list-col-title`);$t&&($t.style.transform="")})};if(b||!ft){Ve();return}const Xe=()=>{const Je=Array.from(Re.querySelectorAll("[data-list-row]")),bt=`${d}-list-col`,$t=`${d}-baseline-probe`;Je.forEach(ut=>{ut.querySelectorAll("[data-list-col]").forEach(Pt=>{Pt.style.transform="";const At=Pt.querySelector(`.${bt}`);At&&(At.style.minHeight="",At.style.height="");const Vt=Pt.querySelector(`.${d}-list-col-title`);Vt&&(Vt.style.transform="")})}),Je.forEach(ut=>{const Pt=Array.from(ut.querySelectorAll("[data-list-col]"));rh(ut,Pt,bt)}),Re.offsetHeight,Je.forEach(ut=>{const Pt=Array.from(ut.querySelectorAll("[data-list-col]")),At=ut.getBoundingClientRect().top,Vt=new Map,Kt=Pt.map(wt=>{const Ot=wt.querySelector(`.${d}-list-col-title`),jt={el:wt,titleEl:Ot,letter:wt.getAttribute("data-col-letter")??"",kind:wt.getAttribute("data-valign")??"top",anchor:wt.getAttribute("data-valign-anchor")};return Vt.set(jt.letter,jt),jt}),Ft=new Map,Yt=(wt,Ot)=>{const jt=Ft.get(wt.letter);if(jt!==void 0)return jt;const Bt=wt.anchor?Vt.get(wt.anchor):void 0;if(wt.kind!=="baseline"||!Bt||Ot.has(wt.letter)){const Le=Gr(wt,At,bt,$t);return Ft.set(wt.letter,Le),Le}Ot.add(wt.letter);const vt=Yt(Bt,Ot);Ot.delete(wt.letter);const g=Gr(wt,At,bt,$t),ue=vt-g;ah(wt.titleEl,ue);const Te=Gr(wt,At,bt,$t);return Ft.set(wt.letter,Te),Te};Kt.forEach(wt=>Yt(wt,new Set))})};let ze=null;const mt=()=>{ze===null&&(ze=requestAnimationFrame(()=>{ze=null,Xe()}))};Xe();const Nt=new ResizeObserver(()=>mt());Nt.observe(Re);let Ae=!1;return typeof document<"u"&&((Ye=document.fonts)!=null&&Ye.ready)&&document.fonts.ready.then(()=>{Ae||mt()}),()=>{Ae=!0,ze!==null&&(cancelAnimationFrame(ze),ze=null),Nt.disconnect(),Ve()}},[ft,b,e,t,oe,Ce,Oe]);const qt=a.useMemo(()=>Xg(d),[d]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:qt}}),r.jsx("div",{style:Pe,children:r.jsxs("div",{ref:ye,className:`${d}-wrapper ${Se}${Ze?` ${Ze}`:""}${b?` ${d}-type-b`:""}`.trim(),style:{width:v.scalingValue(w??0,n),...!b&&u?{[`--${d}-first-entry-handle-top`]:xt}:{}},onMouseMove:N?Lt:void 0,onMouseLeave:N?Et:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[Ce.map((Re,Ve)=>{var Nt;const Xe=(((Nt=Re.link)==null?void 0:Nt.length)??0)>0,ze=Xe&&(!n||i)?"a":"div",mt=Fl(Ve,Ce.length,me,D,Fe,S??0,n??!1);return r.jsxs(ze,{ref:Ve===0?Ae=>{Q.current=Ae}:void 0,className:`${d}-list-item${Xe||R==="always"?` ${d}-list-item-has-link`:""}`,...Xe?{href:Re.link,target:"_blank"}:{},style:mt,onMouseEnter:Ae=>{G&&(Xe||R==="always")&&Pl(Ae,d),N&&sn(Re,Ae)},onMouseLeave:Ae=>{G&&(Xe||R==="always")&&Al(Ae,d)},children:[et>0&&r.jsx("div",{className:`${d}-row-padding-handle`,style:{height:De(et)}}),r.jsxs("div",{className:`${d}-list-cols-row${b?"":` ${d}-list-cols-row-h`}${u&&Ve===0&&b?` ${d}-list-cols-row-controls`:""}`,...b?{}:{"data-list-row":""},style:b?void 0:{minHeight:De(lt)},children:[de.map((Ae,Ye)=>{const Je=Ye===de.length-1,bt=_e[Ye],$t=Ae.paddingBottom,ut=Kg(Re.cells[Ae.key]),Pt=b&&ut&&$t>0,At=b?{minHeight:De(lt)}:{width:De(Oe[Ye])},Vt=b?{paddingLeft:De(re),paddingRight:De(re)}:{paddingLeft:De(bt.paddingLeft),paddingRight:De(bt.paddingRight)},Kt=Ae.textPrefix.charAt(0),Ft=b?Qg(e[`${Ae.textPrefix}VerticalAlign`]):Jg(e[`${Ae.textPrefix}VerticalAlign`],e,Kt),Yt=b&&ut&&u&&Ve===0;return b&&!ut?null:r.jsxs("div",{className:b?`${d}-list-col-wrap`:void 0,...b?{}:{"data-list-col":"","data-col-letter":Kt,"data-valign":Ft.kind,...Ft.kind==="baseline"?{"data-valign-anchor":Ft.anchorLetter}:{}},children:[r.jsx("div",{className:`${d}-list-col${Je?` ${d}-list-col-last`:""}`,style:{...Vt,...At,...b?{justifyContent:_l(Ft.kind)}:{}},"data-test":Ae.width,children:r.jsx("span",{className:Nl(e,Ae.textPrefix,`${d}-list-col-title`,`${d}-text-tight-leading`),style:{...Hl(rr(e,Ae.textPrefix),n),...Ol(e,Ae.textPrefix,d,n),...b?{}:th(Ft.kind)},children:Re.cells[Ae.key]??null})}),Pt&&r.jsx("div",{className:`${d}-row-padding-handle`,style:{height:De($t)}}),Yt&&r.jsx(nn,{centerXHitTop:`var(--${d}-first-entry-handle-top, 50%)`,"data-controls":Ae.paddingBottomKey,"data-controls-static-handle":"","data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0",className:`${d}-padding-control-handle`,hitPlacement:"center",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:De(Math.max($t,qr))}})]},Ae.key)}),u&&Ve===0&&b&&r.jsxs(r.Fragment,{children:[r.jsx(nn,{centerXHitTop:`var(--${d}-first-entry-handle-top, 50%)`,"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(fe),className:`${d}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:De(ke),height:"100%"}}),r.jsx(nn,{centerXHitTop:`var(--${d}-first-entry-handle-top, 50%)`,"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(fe),className:`${d}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:De(Math.max(ke,We-ke)),width:De(ke),height:"100%"}})]})]}),!b&&dt>0&&r.jsx("div",{className:`${d}-row-padding-handle`,style:{height:De(dt)}}),u&&Ve===0&&!b&&r.jsx(nn,{centerXHitTop:`var(--${d}-first-entry-handle-top, 50%)`,"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:`${d}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:De(Rt)}})]},Re.id)}),u&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx(nn,{centerXHitTop:`var(--${d}-first-entry-handle-top, 50%)`,"data-controls":zt,"data-controls-static-handle":"",...b?{}:{"data-controls-handle-left":"20"},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${d}-padding-control-handle`,hitPlacement:b?"center":"left-y",areaStyle:{position:"absolute",top:ot,left:0,width:"100%",height:De(Math.max(et,qr))}})},"row-padding-handles"),u&&!b&&rt&&qe&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(nn,{centerXHitTop:`var(--${d}-first-entry-handle-top, 50%)`,"data-controls":rt.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Oe[0]-((Ne==null?void 0:Ne.paddingRight)??0)),className:`${d}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:De(yt),height:"100%"}}),r.jsx(nn,{centerXHitTop:`var(--${d}-first-entry-handle-top, 50%)`,"data-controls":qe.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(Oe[de.length-1]-((pt==null?void 0:pt.paddingLeft)??0)),className:`${d}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:De(Dt-Mt),width:De(Mt),height:"100%"}})]},"column-edge-padding-handles"),u&&!b&&de.slice(0,-1).map((Re,Ve)=>{const Xe=de[Ve+1],ze=O.slice(0,Ve+1).reduce((Je,bt)=>Je+bt,0),mt=_e[Ve],Nt=_e[Ve+1],Ae=Math.max(mt.paddingRight,$i),Ye=Math.max(Nt.paddingLeft,$i);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(nn,{centerXHitTop:`var(--${d}-first-entry-handle-top, 50%)`,"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(Oe[Ve]-mt.paddingLeft),className:`${d}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:De(ze-Ae),width:De(Ae),height:"100%"}}),r.jsx(nn,{centerXHitTop:`var(--${d}-first-entry-handle-top, 50%)`,"data-controls":Xe.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Oe[Ve+1]-Nt.paddingRight),className:`${d}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:De(ze),width:De(Ye),height:"100%"}})]},`${Re.paddingRightKey}-padding`)}),u&&!b&&de.slice(0,-1).map((Re,Ve)=>{const Xe=$h(Ve,O,se,We),mt=O.slice(0,Ve+1).reduce((Nt,Ae)=>Nt+Ae,0)-jl/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(Ga),"data-controls-max-fraction":String(Xe),"data-controls-variant":"column-width",className:`${d}-col-resize-handle`,style:{position:"absolute",top:"0px",left:De(mt),width:De(jl),height:"calc(100%)",pointerEvents:"auto"}})},`${Re.widthKey}-junction`)})]}),Fe&&(()=>{const Re=rr(e,An),Ve=nh(e.cutLabelVerticalAlign),Xe=Re.textTextAlign==="justify"||b;return r.jsx("button",{type:"button",className:`${d}-cut-item`,style:{minHeight:De(C??0),cursor:Tt?"pointer":"default",...Ug(D,S??0,n??!1)},onClick:Tt?it:void 0,onMouseEnter:G||N?Qt:void 0,onMouseLeave:G?Ut:void 0,children:r.jsx("div",{className:`${d}-list-cols-row`,style:{...b?{paddingLeft:De(re),paddingRight:De(re)}:{},justifyContent:ih(Re.textTextAlign),alignItems:_l(Ve)},children:r.jsx("span",{className:Nl(e,An,`${d}-cut-label`,`${d}-text-tight-leading`),style:{...Hl(Re,n),...Ol(e,An,d,n),...Xe?{width:"100%"}:{}},children:J})})})})(),N&&Y&&(()=>{const Re=`${Y.widthPx}px`,Ve={width:Re,height:"auto",maxHeight:Re,objectFit:"contain",left:Y.x,top:Y.y,position:"absolute"};return r.jsx(qg,{media:Y,className:Y.isVideo?`${d}-hover-video`:`${d}-hover-image`,style:Ve},`${Y.rowId}-${Y.url}`)})()]})})]})}const Rh=`import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
9071
9149
|
import { CommonComponentProps } from '../props';
|
|
9072
9150
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
9073
9151
|
import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
|
|
@@ -12028,7 +12106,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
12028
12106
|
</>
|
|
12029
12107
|
);
|
|
12030
12108
|
}
|
|
12031
|
-
`,Gi=["A","B","C","D","E"],Bl=[...ha,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],oi={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 $h(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function jo(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function Ch(){return Object.fromEntries(Gi.map((e,t)=>{const n=Un[t],i=`${e} column`;return[n,$h(i)]}))}function Th(){const e={};for(const t of Gi)e[`${t}ColumnWidth`]=jo(`${t} column width`),e[`${t}ColumnPaddingLeft`]=jo(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=jo(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=jo(`${t} column padding bottom`);return e}function Dl(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Un]};for(const l of Gi)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 Lh(e){const t={};if(e===An)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...ha]},enum:[...ha]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Bl],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Bl]}}return t[vt(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[vt(e,"textFontSettings")]={...oi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[vt(e,"textFontSize")]={...oi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[vt(e,"textLineHeight")]={...oi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[vt(e,"textLetterSpacing")]={...oi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[vt(e,"textWordSpacing")]={...oi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[vt(e,"textTextAlign")]={...oi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[vt(e,"textTextAppearance")]={...oi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const Ih=mo.reduce((e,t)=>({...e,...Lh(t)}),{});function Rh(e){return{verticalAlign:e===An?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===An?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function Eh(e,t={}){var n;return{...Rh(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Vl=new Set(["textFontFamily","textFontSettings"]);function kh(e,t,n){const i=l=>n===void 0?!0:n==="common"?Vl.has(l):!Vl.has(l),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=Ga(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[vt(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[vt(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[vt(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[vt(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[vt(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[vt(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[vt(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[vt(e,"textTextAppearance")]=t.textTextAppearance),o}function Jo(e={},t){return mo.reduce((n,i)=>({...n,...kh(i,Eh(i,e),t)}),{})}const Mh=Jo(),Ph=oh();function pc(e){return[vt(e,"textFontFamily"),vt(e,"textFontSettings"),vt(e,"textFontSize"),vt(e,"textLineHeight"),vt(e,"textLetterSpacing"),vt(e,"textWordSpacing"),vt(e,"textTextAlign"),vt(e,"textTextAppearance"),`${e}VerticalAlign`]}function Ah(){const e=[];return Va.forEach((t,n)=>{const i=Un[n],o=pc(t);for(let l=1;l<Un.length;l+=1){const s=[{name:"columns",value:l},...Array.from({length:l},(d,c)=>({name:`columnsOrder.${c}`,value:i,isNotEqual:!0}))];o.forEach(d=>{e.push({if:s,then:{name:`properties.${d}.display.visible`,value:!1}})})}}),e}const Fh=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];pc(An);const Wh=[...Gi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],ri=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg"}],_h=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:ri[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:ri[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:ri[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:ri[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:ri[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:ri[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:ri[6],link:""}],Nh=[...Gi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],Hh={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array",ref:{columnsOrder:"settings.properties.columnsOrder",columnsCount:"settings.properties.columns"}},items:{type:"object",properties:{...Ch(),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:_h},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:"Amount",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},cellMinHeight:{type:"number",scope:"layout",title:"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"}},...Th(),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"}},...Ih,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",...Mh,...Jo({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:Dl({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},...Jo({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:Dl({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},...Jo({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...Ah(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...Wh.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}},...Gi.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",...Nh]},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:"Entries",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__",Ph]}],paletteBookmark:{items:[...Fh],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},jh={element:wh,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>hh(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme-list-default.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...mo.map(e=>({path:`${vt(e,"textFontFamily")}`}))]},fontRelations:{...mo.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${vt(t,"textFontFamily")}`}),{})},schema:Hh,sourceCode:Sh},Gl=300,Nn=.004,Oh={questionColor:"question-color",answerColor:"answer-color",dividerColor:"divider-color",iconColor:"icon-color",questionHoverColor:"question-hover-color",iconHoverColor:"icon-hover-color",iconActiveColor:"icon-active-color",dividerHoverColor:"divider-hover-color"},zh=["hover","focus","filled","success","error"];function Bh(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function ql(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Kl(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:y.scalingValue((o-t)/2,i)}}function Dh(e){return`
|
|
12109
|
+
`,qi=["A","B","C","D","E"],Bl=[...ga,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],oi={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 Eh(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function No(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function Mh(){return Object.fromEntries(qi.map((e,t)=>{const n=Xn[t],i=`${e} column`;return[n,Eh(i)]}))}function kh(){const e={};for(const t of qi)e[`${t}ColumnWidth`]=No(`${t} column width`),e[`${t}ColumnPaddingLeft`]=No(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=No(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=No(`${t} column padding bottom`);return e}function Dl(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Xn]};for(const l of qi)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 Ph(e){const t={};if(e===An)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...ga]},enum:[...ga]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Bl],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Bl]}}return t[Ct(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Ct(e,"textFontSettings")]={...oi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Ct(e,"textFontSize")]={...oi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ct(e,"textLineHeight")]={...oi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ct(e,"textLetterSpacing")]={...oi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ct(e,"textWordSpacing")]={...oi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ct(e,"textTextAlign")]={...oi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ct(e,"textTextAppearance")]={...oi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const Ah=mo.reduce((e,t)=>({...e,...Ph(t)}),{});function Fh(e){return{verticalAlign:e===An?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===An?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function Wh(e,t={}){var n;return{...Fh(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Vl=new Set(["textFontFamily","textFontSettings"]);function _h(e,t,n){const i=l=>n===void 0?!0:n==="common"?Vl.has(l):!Vl.has(l),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=Va(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Ct(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Ct(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Ct(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Ct(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Ct(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Ct(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Ct(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Ct(e,"textTextAppearance")]=t.textTextAppearance),o}function Zo(e={},t){return mo.reduce((n,i)=>({...n,..._h(i,Wh(i,e),t)}),{})}const Hh=Zo(),Nh=dh();function gc(e){return[Ct(e,"textFontFamily"),Ct(e,"textFontSettings"),Ct(e,"textFontSize"),Ct(e,"textLineHeight"),Ct(e,"textLetterSpacing"),Ct(e,"textWordSpacing"),Ct(e,"textTextAlign"),Ct(e,"textTextAppearance"),`${e}VerticalAlign`]}function Oh(){const e=[];return Da.forEach((t,n)=>{const i=Xn[n],o=gc(t);for(let l=1;l<Xn.length;l+=1){const s=[{name:"columns",value:l},...Array.from({length:l},(c,d)=>({name:`columnsOrder.${d}`,value:i,isNotEqual:!0}))];o.forEach(c=>{e.push({if:s,then:{name:`properties.${c}.display.visible`,value:!1}})})}}),e}const jh=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];gc(An);const zh=[...qi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],ri=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg"}],Bh=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:ri[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:ri[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:ri[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:ri[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:ri[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:ri[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:ri[6],link:""}],Dh=[...qi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],Vh={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array",ref:{columnsOrder:"settings.properties.columnsOrder",columnsCount:"settings.properties.columns"}},items:{type:"object",properties:{...Mh(),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:Bh},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:"Amount",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},cellMinHeight:{type:"number",scope:"layout",title:"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"}},...kh(),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"}},...Ah,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",...Hh,...Zo({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:Dl({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},...Zo({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:Dl({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},...Zo({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...Oh(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...zh.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}},...qi.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",...Dh]},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:"Entries",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__",Nh]}],paletteBookmark:{items:[...jh],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Gh={element:Ih,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>wh(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme-list-default.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...mo.map(e=>({path:`${Ct(e,"textFontFamily")}`}))]},fontRelations:{...mo.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Ct(t,"textFontFamily")}`}),{})},schema:Vh,sourceCode:Rh},Gl=300,Nn=.004,qh={questionColor:"question-color",answerColor:"answer-color",dividerColor:"divider-color",iconColor:"icon-color",questionHoverColor:"question-hover-color",iconHoverColor:"icon-hover-color",iconActiveColor:"icon-active-color",dividerHoverColor:"divider-hover-color"},Kh=["hover","focus","filled","success","error"];function Uh(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function ql(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Kl(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:v.scalingValue((o-t)/2,i)}}function Xh(e){return`
|
|
12032
12110
|
.${e}-wrapper {
|
|
12033
12111
|
box-sizing: border-box;
|
|
12034
12112
|
display: flex;
|
|
@@ -12090,7 +12168,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
12090
12168
|
display: flex;
|
|
12091
12169
|
align-items: center;
|
|
12092
12170
|
justify-content: space-between;
|
|
12093
|
-
gap: ${
|
|
12171
|
+
gap: ${Uh(20)};
|
|
12094
12172
|
width: 100%;
|
|
12095
12173
|
min-width: 0;
|
|
12096
12174
|
min-height: var(--${e}-question-min-height, unset);
|
|
@@ -12221,7 +12299,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
12221
12299
|
left: 20px;
|
|
12222
12300
|
transform: translateY(-50%);
|
|
12223
12301
|
}
|
|
12224
|
-
`}function Ul(e,t,n,i,o,l,s,
|
|
12302
|
+
`}function Ul(e,t,n,i,o,l,s,c){return{fontSettings:{fontFamily:e,fontWeight:(t==null?void 0:t.fontWeight)??400,fontStyle:(t==null?void 0:t.fontStyle)??"normal"},fontSize:n??.01,lineHeight:i,letterSpacing:o??0,wordSpacing:l??0,textAppearance:s,color:c??"#000000"}}function Yh({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:l}){const{prefix:s}=v.useScopedStyles(),c=o??!1,{wrapperWidth:d=1,cellMinHeight:u=0,dividerWidth:m=694e-6,dividerStyle:x="solid",entryHoverEffect:w="default",autoclose:$="off",icon:f,iconMaxWidth:S=.00833,iconPaddingRight:L=0,iconAnimation:M="rotate 45",questionColor:A="#000000",answerColor:C="#000000",dividerColor:J="#0000001F",iconColor:k="#000000",questionHoverColor:U="#666666",iconHoverColor:I="#666666",iconActiveColor:R="#000000",dividerHoverColor:T="#000000",questionFontFamily:y,questionFontSettings:h,questionFontSize:F,questionLineHeight:W,questionLetterSpacing:V,questionWordSpacing:ne,questionTextAppearance:X,answerFontFamily:z,answerFontSettings:H,answerFontSize:_,answerLineHeight:E,answerLetterSpacing:q,answerWordSpacing:Y,answerTextAppearance:ee,questionPaddingLeft:N=0,questionPaddingTop:pe=0,questionPaddingBottom:b=0,answerPaddingLeft:ye=0,answerPaddingRight:Q=0,answerPaddingTop:xe=0,answerPaddingBottom:$e=0}=e,oe=t??[],[ie,B]=a.useState(()=>new Set),le=!n||i;a.useEffect(()=>{B(new Set)},[$]),a.useEffect(()=>{n&&!o&&!i&&B(new Set)},[n,o,i]);const re=De=>v.scalingValue(De,n??!1),ke=Math.max(N,Nn),fe=Math.max(pe,Nn),Pe=Math.max(b,Nn),ve=Math.max(ye,Nn),we=Math.max(Q,Nn),Se=Math.max(xe,Nn),G=Math.max($e,Nn),me=Math.max(0,(d??1)-L-S),D=Math.max(0,(d??1)-Q),K=Math.max(0,(d??1)-ye),ae=Math.max(L,Nn),ge=Math.max(0,(d??1)-N-S),ce=a.useMemo(()=>ie.size===0?0:Math.min(...ie),[ie]),be=a.useCallback(De=>ie.has(De),[ie]),Ee=le&&w==="default"?`${s}-entry-hover-default`:"",Z=f??"",de=Z!=="",We=M.replace(/^rotate /,""),se=`${s}-icon-anim-${We}`,O=dn(Xt(Ul(y,h,F,W,V,ne,X,A),n)),Oe=dn(Xt(Ul(z,H,_,E,q,Y,ee,C),n)),_e=ql(F,W,`${s}-question`,`${s}-text-tight-leading`),nt=ql(_,E,`${s}-answer-text`,`${s}-text-tight-leading`),Ue=Kl(F,W,s,n),Ce=Kl(_,E,s,n),Fe=v.buildColorVars(s,{questionColor:A,answerColor:C,dividerColor:J,iconColor:k,questionHoverColor:U,iconHoverColor:I,iconActiveColor:R,dividerHoverColor:T},qh,Kh),He=l&&l!=="default"?`${s}-state-${l}`:"",Ze=a.useCallback(De=>{le&&B(et=>{if(et.has(De)){const lt=new Set(et);return lt.delete(De),lt}if($==="on")return new Set([De]);const dt=new Set(et);return dt.add(De),dt})},[le,$]),Tt=a.useMemo(()=>Xh(s),[s]),it={[`--${s}-divider-width`]:v.scalingValue(m,n??!1),[`--${s}-divider-style`]:x,[`--${s}-icon-max-width`]:v.scalingValue(S,n??!1),...u>0?{[`--${s}-question-min-height`]:v.scalingValue(u,n??!1)}:{}};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Tt}}),r.jsx("div",{style:Fe,children:r.jsx("div",{className:at(`${s}-wrapper`,n&&!i&&`${s}-editor`,Ee,He),style:{width:v.scalingValue(d,n??!1),maxWidth:"100%",...it},children:oe.map((De,et)=>{var xt;const dt=be(et),lt=((xt=De.question)==null?void 0:xt.trim())??"",ht=De.answer,Rt=((ht==null?void 0:ht.length)??0)>0,ot=c&&et===ce;return r.jsxs("div",{className:at(`${s}-item`,dt&&`${s}-item-open`),"data-faq-item":"",children:[r.jsxs("div",{className:`${s}-question-controls`,children:[ot&&r.jsxs(r.Fragment,{children:[r.jsx(nn,{"data-controls":"questionPaddingTop","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",top:0,left:0,width:"100%",height:re(fe),zIndex:2}}),r.jsx(nn,{"data-controls":"questionPaddingLeft","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(me),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:re(ke),height:"100%",zIndex:2}}),r.jsx(nn,{"data-controls":"iconPaddingRight","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(ge),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,right:0,width:re(ae),height:"100%",zIndex:2}})]}),r.jsxs("button",{type:"button",className:`${s}-question-button`,"aria-expanded":dt,style:{...O,...Ue,paddingLeft:re(N),paddingRight:re(L)},onClick:()=>Ze(et),children:[pe>0&&r.jsx("span",{className:`${s}-padding-handle`,style:{height:re(pe)},"aria-hidden":"true"}),r.jsxs("span",{className:`${s}-question-row`,children:[r.jsx("span",{className:_e,children:lt}),Rt&&(de?r.jsx("span",{className:`${s}-icon ${s}-icon-custom ${se}`,"aria-hidden":"true",children:r.jsx(on,{url:Z,fill:k,hoverFill:I,className:`${s}-icon-image`})}):r.jsx("span",{className:`${s}-icon ${s}-icon-default ${se}`,"aria-hidden":"true"}))]}),b>0&&r.jsx("span",{className:`${s}-padding-handle`,style:{height:re(b)},"aria-hidden":"true"})]}),ot&&r.jsx(nn,{"data-controls":"questionPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:re(Pe),zIndex:2}})]}),Rt&&ht&&r.jsx("div",{className:`${s}-panel`,"aria-hidden":!dt,children:r.jsx("div",{className:`${s}-panel-inner`,children:r.jsxs("div",{className:`${s}-answer-controls`,children:[ot&&dt&&r.jsxs(r.Fragment,{children:[r.jsx(nn,{"data-controls":"answerPaddingTop","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",top:0,left:0,width:"100%",height:re(Se),zIndex:2}}),r.jsx(nn,{"data-controls":"answerPaddingLeft","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(D),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:re(ve),height:"100%",zIndex:2}}),r.jsx(nn,{"data-controls":"answerPaddingRight","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(K),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,right:0,width:re(we),height:"100%",zIndex:2}})]}),xe>0&&r.jsx("div",{className:`${s}-padding-handle`,style:{height:re(xe)}}),r.jsx("div",{className:`${s}-answer`,style:{...Oe,...Ce,paddingLeft:re(ye),paddingRight:re(Q)},children:r.jsx("div",{className:nt,children:r.jsx(mi,{content:ht})})}),$e>0&&r.jsx("div",{className:`${s}-padding-handle`,style:{height:re($e)}}),ot&&dt&&r.jsx(nn,{"data-controls":"answerPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:re(G),zIndex:2}})]})})})]},et)})})})]})}const Zh=`import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
12225
12303
|
import cn from 'classnames';
|
|
12226
12304
|
import { CommonComponentProps } from '../props';
|
|
12227
12305
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -13018,7 +13096,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
13018
13096
|
</>
|
|
13019
13097
|
);
|
|
13020
13098
|
}
|
|
13021
|
-
`;function Hn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Xl={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},qh=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Kh={type:"object",version:1,content:{type:"array",display:{type:"array"},items:{type:"object",properties:{question:{type:"string",label:"Question",placeholder:"Add question...",display:{type:"text-input"}},answer:{label:"Answer",placeholder:"Add answer...",display:{type:"rich-text"}}}},default:[{question:"What are the three main parts of The Divine Comedy?",answer:[{type:"paragraph",children:[{text:"The poem is divided into Inferno, Purgatorio, and Paradiso. These three sections follow Dante’s journey through Hell, Purgatory, and Heaven."}]}]},{question:"Who guides Dante through Hell and most of Purgatory?",answer:[{type:"paragraph",children:[{text:"Dante is guided by Virgil, the ancient Roman poet. Virgil represents human reason and wisdom, but because he lived before Christianity, he cannot guide Dante all the way into Heaven."}]}]},{question:"What does the dark wood at the beginning of the poem symbolize?",answer:[{type:"paragraph",children:[{text:"The dark wood symbolizes Dante’s spiritual confusion and moral crisis. It shows that he has lost the “straight way” in life and needs guidance to return to truth and salvation."}]}]},{question:"What is “contrapasso” in Inferno?",answer:[{type:"paragraph",children:[{text:"“Contrapasso” is the principle that punishments in Hell reflect the sins committed during life. For example, people who caused division are themselves physically divided, showing how their punishment mirrors their wrongdoing."}]}]},{question:"Who guides Dante through Heaven?",answer:[{type:"paragraph",children:[{text:"Beatrice guides Dante through Paradiso. She represents divine love, grace, and spiritual understanding, helping Dante move beyond human reason toward a vision of God."}]}]},{question:"Why is The Divine Comedy important in literary history?",answer:[{type:"paragraph",children:[{text:"The Divine Comedy is important because it is one of the greatest works of world literature and helped shape the Italian language. Dante wrote it in the Tuscan dialect rather than Latin, making serious literature more accessible to ordinary readers."}]}]},{question:"What is the overall journey of The Divine Comedy about?",answer:[{type:"paragraph",children:[{text:"The poem is about Dante’s spiritual journey from sin and despair toward repentance, wisdom, and union with God. On a deeper level, it represents the soul’s path from confusion to divine truth."}]}]}]},settings:{sizing:"auto",properties:{wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},cellMinHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},dividerWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},dividerStyle:{type:"string",scope:"common",title:"Style",display:{type:"toggle-cycle",enum:["solid","dashed","dotted"]}},entryHoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["none","default"]}},autoclose:{type:"string",scope:"common",title:"Autoclose",display:{type:"toggle-cycle",enum:["on","off"]}},icon:{type:["string","null"],scope:"common",display:{type:"settings-image-input"}},iconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"numeric-input"},min:0,max:9999},iconPaddingRight:Hn("Icon Padding Right"),iconAnimation:{type:"string",scope:"common",title:"Icon Animation",display:{type:"toggle-cycle",enum:["rotate 180","rotate 90","rotate 45"]}},questionColor:{type:"string",scope:"common",title:"Question Default",display:{type:"palette-color-picker"}},answerColor:{type:"string",scope:"common",title:"Answer Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"palette-color-picker"}},questionHoverColor:{type:"string",scope:"common",title:"Question Hover",display:{type:"palette-color-picker"}},iconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"palette-color-picker"}},iconActiveColor:{type:"string",scope:"common",title:"Icon Active",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}},questionFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},questionFontSettings:{...Xl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},questionFontSize:{type:"number",scope:"layout",title:"Question Font Size",display:{type:"font-size"}},questionLineHeight:{type:"number",scope:"layout",title:"Question Line Height",display:{type:"line-height-input"}},questionLetterSpacing:{type:"number",scope:"layout",title:"Question Letter Spacing",display:{type:"letter-spacing-input"}},questionWordSpacing:{type:"number",scope:"layout",title:"Question Word Spacing",display:{type:"word-spacing-input"}},questionTextAppearance:{type:"object",scope:"layout",title:"Question Text Appearance",display:{type:"text-appearance"}},answerFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},answerFontSettings:{...Xl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},answerFontSize:{type:"number",scope:"layout",title:"Answer Font Size",display:{type:"font-size"}},answerLineHeight:{type:"number",scope:"layout",title:"Answer Line Height",display:{type:"line-height-input"}},answerLetterSpacing:{type:"number",scope:"layout",title:"Answer Letter Spacing",display:{type:"letter-spacing-input"}},answerWordSpacing:{type:"number",scope:"layout",title:"Answer Word Spacing",display:{type:"word-spacing-input"}},answerTextAppearance:{type:"object",scope:"layout",title:"Answer Text Appearance",display:{type:"text-appearance"}},questionPaddingLeft:Hn("Question Padding Left"),questionPaddingTop:Hn("Question Padding Top"),questionPaddingBottom:Hn("Question Padding Bottom"),answerPaddingLeft:Hn("Answer Padding Left"),answerPaddingRight:Hn("Answer Padding Right"),answerPaddingTop:Hn("Answer Padding Top"),answerPaddingBottom:Hn("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"https://cdn.cntrl.site/component-assets/PlusIcon.svg",iconAnimation:"rotate 45",questionColor:"#000000",answerColor:"#000000",dividerColor:"#000000",iconColor:"#000000",questionHoverColor:"#A60239",iconHoverColor:"#A60239",iconActiveColor:"#000000",dividerHoverColor:"#A60239",questionFontFamily:"Goudy Bookletter 1911",questionFontSettings:{fontWeight:400,fontStyle:"normal"},questionLetterSpacing:0,questionWordSpacing:0,questionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},answerFontFamily:"Goudy Bookletter 1911",answerFontSettings:{fontWeight:400,fontStyle:"normal"},answerLetterSpacing:0,answerWordSpacing:0,answerTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{wrapperWidth:1,cellMinHeight:0,dividerWidth:.008,iconMaxWidth:.0533,iconPaddingRight:.08,questionFontSize:.09066,questionLineHeight:.10133,questionLetterSpacing:-.00266,answerFontSize:.0533,answerLineHeight:.064,questionPaddingLeft:.0533,questionPaddingTop:.0533,questionPaddingBottom:.0533,answerPaddingLeft:.0533,answerPaddingRight:.16,answerPaddingTop:.0533,answerPaddingBottom:.0533},t:{wrapperWidth:.651041,cellMinHeight:0,dividerWidth:.00390625,iconMaxWidth:.02604166,iconPaddingRight:.0130208,questionFontSize:.0390625,questionLineHeight:.04427,questionLetterSpacing:-.00091145833,answerFontSize:.0234375,answerLineHeight:.026041,questionPaddingLeft:0,questionPaddingTop:.01302,questionPaddingBottom:.01302,answerPaddingLeft:.065104,answerPaddingRight:.09765625,answerPaddingTop:.026041,answerPaddingBottom:.026041},d:{wrapperWidth:.6388,cellMinHeight:0,dividerWidth:.002083,iconMaxWidth:.01388,iconPaddingRight:.01388,questionFontSize:.0333,questionLineHeight:.0333,questionLetterSpacing:-9e-4,answerFontSize:.01111,answerLineHeight:.01388,questionPaddingLeft:0,questionPaddingTop:.01111,questionPaddingBottom:.01111,answerPaddingLeft:.0625,answerPaddingRight:.1625,answerPaddingTop:0,answerPaddingBottom:.01111}},layout:["__componentName__","wrapperWidth","cellMinHeight","dividerWidth","dividerStyle","entryHoverEffect","autoclose","icon","iconMaxWidth","iconAnimation"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["wrapperWidth","cellMinHeight"]},{type:"row",title:"",items:["entryHoverEffect","autoclose"]},{type:"row",title:"Divider",items:["dividerWidth","dividerStyle"]},{type:"row",title:"Icon",items:["icon","iconMaxWidth"]},{type:"row",title:"",items:["iconAnimation"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Question",items:["questionFontFamily","questionFontSettings",{type:"row",items:["questionFontSize","questionLineHeight","questionLetterSpacing","questionWordSpacing"]},"questionTextAppearance"]},{type:"group",title:"Answer",items:["answerFontFamily","answerFontSettings",{type:"row",items:["answerFontSize","answerLineHeight","answerLetterSpacing","answerWordSpacing"]},"answerTextAppearance"]}]}],paletteBookmark:{items:[...qh],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Uh={element:Vh,id:"faq",name:"FAQ",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/FAQ_List.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"questionFontFamily"},{path:"answerFontFamily"}]},fontRelations:{questionFontSettings:"questionFontFamily",answerFontSettings:"answerFontFamily"},schema:Kh,sourceCode:Gh},Fn=e=>e.display==="cover",Lr=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Yl=100,Xh=.2,Zl=8,mc=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,l]=a.useState(0),[s,d]=a.useState(!1),c=a.useRef(null),u=a.useRef(0);u.current=o;const m=a.useMemo(()=>typeof window>"u"?Yl:Math.max(Yl,window.innerHeight*Xh),[]),x=a.useCallback(h=>Math.max(0,1-h/(m*1.5)),[m]),b=a.useCallback(h=>Math.max(0,1-h/(m*.45)),[m]),T=a.useCallback(h=>{const S=typeof window<"u"?window.innerHeight:800,M=Math.max(.88,1-h/S*.12);return`translateY(${h}px) scale(${M})`},[]),f=a.useCallback(()=>{c.current=null},[]),L=a.useCallback(()=>{d(!0),l(0),window.setTimeout(()=>d(!1),n),f()},[n,f]),$=a.useCallback(()=>{const h=typeof window<"u"?window.innerHeight:800;d(!0),l(h),window.setTimeout(()=>{t(),f(),d(!1)},Math.min(n,200))},[n,t,f]),R=a.useCallback(h=>{!e||s||h.pointerType==="touch"&&(i!=null&&i(h.target)||(c.current={startX:h.clientX,startY:h.clientY,isLocked:null,pointerId:h.pointerId}))},[e,s,i]),E=a.useCallback(h=>{const S=c.current;if(!e||!S||h.pointerType!=="touch"||S.pointerId!==h.pointerId)return;const M=h.clientX-S.startX,z=h.clientY-S.startY;if(S.isLocked===null){if(Math.abs(M)<Zl&&Math.abs(z)<Zl)return;if(z>0&&z>Math.abs(M))S.isLocked=!0,h.currentTarget.setPointerCapture(h.pointerId);else{S.isLocked=!1,f();return}}if(!S.isLocked)return;h.preventDefault();const K=Math.max(0,z);u.current=K,l(K)},[e,f]),C=a.useCallback(h=>{const S=c.current;if(!e||!S||h.pointerType!=="touch"||S.pointerId!==h.pointerId)return;const M=S.isLocked===!0;if(h.currentTarget.hasPointerCapture(h.pointerId)&&h.currentTarget.releasePointerCapture(h.pointerId),!M){f();return}h.clientY-S.startY>=m?$():L()},[m,$,e,f,L]),U=a.useCallback(h=>{C(h)},[C]),k=a.useCallback(h=>{C(h)},[C]),j=o>0,I=s?`transform ${n}ms ease`:"none",w=s?`opacity ${n}ms ease`:"none",W=o>0||s;return{isSwipeDragging:j,backdropStyle:{opacity:x(o),transition:w},mediaAreaStyle:{transform:T(o),transition:I,touchAction:j?"none":void 0,willChange:j?"transform":void 0},overlayContentStyle:W?{opacity:b(o),transition:w}:void 0,swipeHandlers:e?{onPointerDown:R,onPointerMove:E,onPointerUp:U,onPointerCancel:k}:{},dismissAreaStyle:e?{touchAction:j?"none":"pan-x"}:void 0}},Yh="[data-lightbox-scrollable]",gc=()=>{a.useEffect(()=>{const e=window.scrollY,t=document.body.style.overflow,n=document.body.style.position,i=document.body.style.top,o=document.body.style.width,l=document.documentElement.style.overflow;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${e}px`,document.body.style.width="100%",document.documentElement.style.overflow="hidden";const s=d=>{const c=d.target;c instanceof Element&&c.closest(Yh)||d.preventDefault()};return document.addEventListener("touchmove",s,{passive:!1}),()=>{document.removeEventListener("touchmove",s),document.body.style.overflow=t,document.body.style.position=n,document.body.style.top=i,document.body.style.width=o,document.documentElement.style.overflow=l,window.scrollTo(0,e)}},[])},Zh=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Jh=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Qh=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},ef=(e,t,n,{duration:i,easing:o,onComplete:l})=>{const s=e.scrollLeft,d=n-s,c=s-n,u=(f,L)=>{Jh(t),e.scrollLeft=f,L&&(l==null||l())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let m=!1,x=0;const b=()=>{t.removeEventListener("transitionend",T),clearTimeout(x)},T=f=>{f.target!==t||f.propertyName!=="transform"||m||(m=!0,b(),u(n,!0))};return t.addEventListener("transitionend",T),t.style.willChange="transform",t.style.transition="none",t.style.transform="translate3d(0, 0, 0)",t.offsetHeight,t.style.transition=`transform ${i}ms ${o}`,t.style.transform=`translate3d(${c}px, 0, 0)`,x=window.setTimeout(()=>{m||(m=!0,b(),u(n,!0))},i+64),()=>{m||(m=!0,b(),u(s-Qh(t),!1))}},io=300,tf=900,nf=1500,of="cubic-bezier(0.16, 1, 0.3, 1)",rf=3e3,af=2,lf=16,sf=.05,cf=1,Oo=.3,df=50,uf=20,xi=.004,Hi=["title1","title2","title3"],pf={title1:"1",title2:"2",title3:"3"},mf={title1:"title1Color",title2:"title2Color",title3:"title3Color"},gf={title1:.02,title2:.02,title3:.02},zo=e=>`max(${e}, ${uf}px)`,hf=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]}},ff=e=>{if(!e)return{title1:"",title2:"",title3:""};if(e.title1||e.title2||e.title3)return{title1:e.title1??"",title2:e.title2??"",title3:e.title3??""};const t=hf(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Ht=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,yf=e=>[Ht(e,"fontFamily"),Ht(e,"fontSettings"),{type:"row",items:[Ht(e,"fontSize"),Ht(e,"lineHeight"),Ht(e,"letterSpacing"),Ht(e,"wordSpacing")]},Ht(e,"textAlign"),Ht(e,"textAppearance")],vf=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Hi.map(e=>[pf[e],yf(e)]))}),Ua=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((l,s)=>l+s,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:l,widths:s},d)=>{if(l<=0||d<=0)return{overflow:l,widths:[d,...s]};const c=Math.min(l,d);return{overflow:l-c,widths:[d-c,...s]}},{overflow:i-1,widths:[]});return o},hc=(e,t)=>Ua(e,t),Bo=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Jl=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Ua(e.length,n),effective:hc(e.length,n)}},xf=(e,t,n,i,o,l,s)=>{const d=[];return t&&d.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:o,text:t}),n&&d.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:l,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:s,text:i}),d},Xr=(e,t)=>{const n=i=>{const o=Ht(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[mf[t]]}},bf=(e,t,n,i)=>e.slice(0,i).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0),Yr=(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??gf[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Xt(i,n)},wf=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,onClose:s})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:m,imageGap:x,closeIcon:b,closeIconMaxWidth:T,closeIconColor:f,closeIconHoverColor:L,thumbnailTrigger:$,thumbnailVisibility:R,thumbnailObjectFit:E,thumbnailActive:C,thumbnailActiveColor:U,title1Width:k,title2Width:j,title3Width:I,title1MarginLeft:w=0,title2MarginLeft:W=0,title3MarginLeft:h=0,titleRowMarginBottom:S=0,titleHeaderLayout:M="desktop",contentMarginTop:z,iconMarginLeft:K}=n,le=p=>y.scalingValue(p,i??!1),Y=c??n.thumnailSize??.03,D=le(Y),N=le(u),F=le(m??.02),A=le(x??0),q=le(z??0),G=zo(q),Z=le(K??0),[_,me]=a.useState(0),v=a.useRef(_);v.current=_;const fe=t[_],{title1:J,title2:de,title3:$e}=ff(fe),oe=Yr("title1",Xr(n,"title1"),i),xe=Yr("title2",Xr(n,"title2"),i),Q=Yr("title3",Xr(n,"title3"),i),ye=M==="mobile",ve=!o&&(!i||l),ke=ve,we=ve,Me=ve,X=Fn(E),ue=X?{"--image-aspect-ratio":Lr(E)}:void 0,Se=!!(J||de||$e),O=a.useMemo(()=>xf(e,J,de,$e,oe,xe,Q),[e,_,J,de,$e,oe,xe,Q]),ce=a.useMemo(()=>({title1Width:k,title2Width:j,title3Width:I}),[k,j,I]),H=a.useMemo(()=>O.map(p=>ce[p.widthKey]),[O,ce]),re=a.useMemo(()=>Ua(O.length,H),[O.length,H]),ae=a.useMemo(()=>hc(O.length,H),[O.length,H]),ne=a.useMemo(()=>O.filter(p=>p.prefix==="title1"),[O]),ie=a.useMemo(()=>O.filter(p=>p.prefix==="title2"||p.prefix==="title3"),[O]),be=a.useMemo(()=>Jl(ne,ce),[ne,ce]),Ce=a.useMemo(()=>Jl(ie,ce),[ie,ce]),ee=a.useCallback((p,P)=>{const B=O.indexOf(p);if(!ye||P==="single-row")return{effectiveWidth:ae[B]??0,resolvedWidth:re[B]??0,maxWidth:Bo(B,re)};if(P==="two-row-top"){const Le=ne.indexOf(p);return{effectiveWidth:be.effective[Le]??0,resolvedWidth:be.resolved[Le]??0,maxWidth:Bo(Le,be.resolved)}}const he=ie.indexOf(p);return{effectiveWidth:Ce.effective[he]??0,resolvedWidth:Ce.resolved[he]??0,maxWidth:Bo(he,Ce.resolved)}},[ie,Ce,ae,re,O,ne,be,ye]),pe=a.useCallback(p=>y.scalingValue(p,i??!1),[i]),Ae=pe(S??0),se=a.useMemo(()=>({title1MarginLeft:w,title2MarginLeft:W,title3MarginLeft:h}),[w,W,h]),V=a.useCallback(p=>O.slice(0,p+1).reduce((P,B,he)=>P+(B!=null&&B.marginLeftKey?se[B.marginLeftKey]??0:0)+(re[he]??0),0)+(ye?0:w??0),[O,se,re,ye,w]),je=a.useCallback(()=>ye?0:w??0,[ye,w]),We=a.useCallback(p=>ie.slice(0,p).reduce((P,B,he)=>P+(B.marginLeftKey?se[B.marginLeftKey]??0:0)+(Ce.resolved[he]??0),0),[ie,Ce.resolved,se]),et=a.useCallback(p=>{const P=ie[p];return We(p)+(P.marginLeftKey?se[P.marginLeftKey]??0:0)+(Ce.resolved[p]??0)},[ie,Ce.resolved,We,se]),Ye=(p,P)=>{const B=p.marginLeftKey?se[p.marginLeftKey]??0:0,{effectiveWidth:he,resolvedWidth:Le,maxWidth:He}=ee(p,P),at=o&&P==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":p.prefix,style:{...P==="single-row"?{gridArea:p.prefix}:{},width:pe(he),...B>0?{marginLeft:pe(B)}:{}},children:[r.jsx("p",{className:p.className,style:p.style,children:p.text}),at&&p.marginLeftKey&&r.jsx("div",{"data-controls":p.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Le),style:{position:"absolute",top:0,left:pe(-B),width:`max(${pe(B)}, 10px)`,height:"100%",pointerEvents:"auto"}}),at&&r.jsx("div",{"data-controls":p.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(He),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:pe(-xi/2),width:pe(xi),height:"100%",pointerEvents:"auto"}})]},p.className)},st=()=>{const p=ye?-1:O.findIndex(he=>he.prefix==="title1"),P=!ye&&(o||(w??0)>0)?(()=>{const he=w??0,Le=p>=0?re[p]:k??0;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Le),style:{position:"absolute",top:0,left:0,width:`max(${pe(he)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,B=O.flatMap((he,Le)=>{if(!he.marginLeftKey)return[];const He=se[he.marginLeftKey]??0,at=bf(O,re,se,Le)+je();return r.jsx("div",{"data-controls":he.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(re[Le]),style:{position:"absolute",top:0,left:pe(at),width:`max(${pe(He)}, 10px)`,height:"100%",pointerEvents:"auto"}},he.marginLeftKey)});return P?[P,...B]:B},mt=()=>O.map((p,P)=>{const B=Bo(P,re),Le=V(P)-xi/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":p.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(B),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:pe(Le),width:pe(xi),height:"100%",pointerEvents:"auto"}})},`${p.widthKey}-junction`)}),De=()=>ie.flatMap((p,P)=>{if(!p.marginLeftKey)return[];const B=se[p.marginLeftKey]??0,he=We(P),{resolvedWidth:Le}=ee(p,"two-row-bottom");return r.jsx("div",{"data-controls":p.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Le),style:{position:"absolute",top:0,left:pe(he),width:`max(${pe(B)}, 10px)`,height:"100%",pointerEvents:"auto"}},p.marginLeftKey)}),ot=()=>ie.map((p,P)=>{const{maxWidth:B}=ee(p,"two-row-bottom"),Le=et(P)-xi/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":p.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(B),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:pe(Le),width:pe(xi),height:"100%",pointerEvents:"auto"}})},`${p.widthKey}-junction`)}),$t=a.useRef(null),rt=a.useRef(null),Ue=a.useRef(null),ht=a.useRef(null),xt=a.useRef([]),dt=a.useRef([]),kt=a.useRef(0),_t=a.useRef(null),Qe=a.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),Tt=a.useRef(null),Lt=a.useRef(null),Ge=a.useRef(0),qe=a.useRef("forward"),Pe=a.useRef(0),gt=a.useRef(null),It=a.useRef(!1),Mt=t.length>1&&(!o||!!l),Dt=Mt?3:1,en=a.useMemo(()=>Array.from({length:Dt},()=>t).flat(),[t,Dt]),[on,bt]=a.useState(!1),[Rt,Ut]=a.useState(!1),[Kt,ft]=a.useState(!0),Jt=a.useRef(null),Te=a.useRef(null),Oe=a.useRef(!1),Ke=a.useRef(!1),Ne=a.useRef(null),ze=a.useRef(null),ut=ke&&!Kt,_e=a.useCallback(()=>{ke&&(ft(!0),ze.current&&clearTimeout(ze.current),ze.current=setTimeout(()=>{Qe.current.isActive||ft(!1)},rf))},[ke]),Je=a.useCallback(()=>{o||Ke.current||(Ke.current=!0,Ut(!1),Ne.current=setTimeout(()=>{s()},io))},[o,s]),tt=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":ut?"true":"false",style:{width:y.scalingValue(T??0,i),height:y.scalingValue(T??0,i),marginRight:Z,"--close-icon-hover-color":L},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Je,"aria-label":"Close",children:r.jsx(rn,{url:b,fill:f,hoverFill:i&&!l?f:L,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:Z,height:"100%",pointerEvents:"auto"}})]}),Wt=(p="two-row")=>r.jsx("div",{...p==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:pe(w??0),flexShrink:0,...p==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...p==="two-row"&&o?{pointerEvents:"auto"}:{}}}),Ct=()=>{const p=O.find(he=>he.prefix==="title1"),P=O.filter(he=>he.prefix==="title2"||he.prefix==="title3"),B=P.length>0||o||(S??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(w??0)>0||o?Wt():null,p&&Ye(p,"two-row-top"),b&&tt()]}),B?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[P.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[P.map(he=>Ye(he,"two-row-bottom")),o&&r.jsxs(r.Fragment,{children:[De(),ot()]})]}):null,r.jsx("div",{"data-controls":o?"titleRowMarginBottom":void 0,"data-controls-axis":o?"y":void 0,"data-controls-reverse":o?"":void 0,className:o?`${e}-control`:void 0,style:{height:Ae,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},lt=()=>r.jsxs(r.Fragment,{children:[(w??0)>0||o?Wt("single-row"):null,O.map(p=>Ye(p,"single-row")),o?r.jsxs(r.Fragment,{children:[st(),mt()]}):null,b?tt():null]}),Nt=a.useCallback(p=>!!(p.closest("[data-controls]")||p.closest(`.${e}-thumbnails`)||p.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:At,backdropStyle:Vt,mediaAreaStyle:zt,overlayContentStyle:Pt,swipeHandlers:Qt,dismissAreaStyle:wt}=mc({enabled:ve??!1,onClose:Je,animMs:io,isBlockedTarget:Nt}),Gt=()=>{if(!Mt||t.length===0)return kt.current=0,0;const p=dt.current[0],P=dt.current[t.length];if(!p||!P)return kt.current;const B=P.offsetLeft-p.offsetLeft;return B>0&&(kt.current=B),kt.current},pt=(p=!1)=>{if(!Mt)return;const P=rt.current,B=Gt();!P||B<=0||B<P.clientWidth*.25||(P.scrollLeft<=0?(P.scrollLeft+=B,p&&(Qe.current.scrollLeft+=B),It.current&&(Pe.current+=B)):P.scrollLeft>=B*2&&(P.scrollLeft-=B,p&&(Qe.current.scrollLeft-=B),It.current&&(Pe.current-=B)))},Ft=(p,P=(B=>(B=rt.current)==null?void 0:B.scrollLeft)()??0)=>{if(!Mt)return p;let he=t.length+p,Le=1/0;for(let He=0;He<Dt;He++){const at=He*t.length+p,yt=dt.current[at];if(!yt)continue;const tn=Math.abs(yt.offsetLeft-P);tn<Le&&(Le=tn,he=at)}return he},Bt=p=>{const P=rt.current;return!p||!P?!1:p.offsetWidth>P.clientWidth+1},g=p=>{const P=rt.current;if(!p||!P||!Bt(p))return!1;const B=p.offsetLeft,he=B+p.offsetWidth;return P.scrollLeft>=B-1&&P.scrollLeft+P.clientWidth<=he+1},ge=(p=(P=>(P=rt.current)==null?void 0:P.scrollLeft)()??0)=>{for(let he=0;he<dt.current.length;he+=1){const Le=dt.current[he];if(Le&&g(Le))return he}let B={flatIndex:0,distance:1/0};return dt.current.forEach((he,Le)=>{if(!he)return;const He=Math.abs(he.offsetLeft-p);He<B.distance&&(B={flatIndex:Le,distance:He})}),B.flatIndex},Re=p=>{rt.current&&dt.current.forEach(P=>{P&&(P.style.scrollSnapAlign=Bt(P)&&p==="backward"?"end":"start")})},Ie=(p,P,B)=>{const he=p-P,Le=ge(P),He=dt.current[Le];if(g(He))return ge(p)%t.length;const at=dt.current[Le+1],yt=He?at?at.offsetLeft-He.offsetLeft:He.offsetWidth:0,tn=yt>0?he>yt*Oo?1:he<-yt*Oo?-1:0:0;return tn===0?B:Mt?(B+tn+t.length)%t.length:Math.max(0,Math.min(t.length-1,B+tn))},Ze=a.useCallback((p=!1)=>{if(R!=="on"||o)return;const P=ht.current,B=v.current,he=xt.current[B];if(!P||!he||P.scrollWidth<=P.clientWidth)return;const Le=P.scrollLeft,He=Le+P.clientWidth,at=he.offsetLeft,yt=at+he.offsetWidth;if(at>=Le&&yt<=He)return;const tn=P.scrollWidth-P.clientWidth;let Yt=Le;if(!p&&Jt.current===null){const yi=xt.current[B-1],qi=xt.current[B+1],Eo=yi?he.offsetLeft-yi.offsetLeft:qi?qi.offsetLeft-he.offsetLeft:he.offsetWidth;yt>He?Yt+=Eo:at<Le&&(Yt-=Eo)}else yt>He?Yt=yt-P.clientWidth:Yt=at;P.scrollLeft=Math.max(0,Math.min(tn,Yt))},[o,R]),Et=a.useCallback((p=!1)=>{p&&(Oe.current=!0),Te.current===null&&(Te.current=requestAnimationFrame(()=>{Te.current=null;const P=Oe.current;Oe.current=!1,Ze(P)}))},[Ze]),Ve=a.useCallback(p=>{if(p===v.current)return;const P=v.current;v.current=p;const B=Math.abs(p-P)>1,he=Mt&&t.length>1&&(P===t.length-1&&p===0||P===0&&p===t.length-1);me(p),Et(B||he)},[t.length,Mt,Et]),it=()=>{if(!rt.current||t.length===0||Jt.current!==null||Qe.current.isActive&&Qe.current.hasMoved)return;const p=rt.current.scrollLeft,P=ge(p)%t.length;P!==v.current&&Ve(P)},jt=()=>{Jt.current=null},St=p=>{const P=rt.current;P&&(P.style.scrollSnapType=p?"":"none")},cn=()=>{var p;(p=Lt.current)==null||p.call(Lt),Lt.current=null},un=()=>{gt.current!==null&&(cancelAnimationFrame(gt.current),gt.current=null),It.current=!1},Jn=()=>{const p=rt.current;if(!p){gt.current=null,It.current=!1;return}const P=Pe.current-p.scrollLeft;if(Math.abs(P)<.5){p.scrollLeft=Pe.current,pt(),it(),gt.current=null,It.current=!1;return}p.scrollLeft+=P*sf,pt(),it(),_e(),gt.current=requestAnimationFrame(Jn)},Qn=()=>{const p=Ue.current;p&&(p.style.transition="",p.style.transform="",p.style.willChange="")},To=(p,P,B,he)=>{Qn(),p.scrollLeft=P,Ge.current=p.scrollLeft,pt(),B!==void 0?(v.current=B,me(B)):it(),St(!0),he==null||he()},Lo=(p,{behavior:P="smooth",activeIndex:B,onComplete:he}={})=>{const Le=rt.current,He=Ue.current;if(!Le||!He)return;if(un(),cn(),St(!1),P==="auto"){To(Le,p,B,he);return}const at=Math.abs(p-Le.scrollLeft),yt=Zh(at,tf,nf,Le.clientWidth*.55);Lt.current=ef(Le,He,p,{duration:yt,easing:of,onComplete:()=>{Lt.current=null,To(Le,p,B,he)}})},Rr=(p="smooth")=>{const P=rt.current;if(!P||t.length===0)return;const B=ge()%t.length,he=Ft(B,P.scrollLeft),Le=dt.current[he];Le&&Lo(Le.offsetLeft,{behavior:p,activeIndex:B})},Er=(p,P="smooth",B,he)=>{const Le=rt.current;if(!Le||t.length===0)return;const He=(he??Le.scrollLeft)-p,at=ge(p),yt=dt.current[at];if(g(yt)){St(!0),it();return}const tn=dt.current[at+1],Yt=yt?tn?tn.offsetLeft-yt.offsetLeft:yt.offsetWidth:0;if((Yt>0?He>Yt*Oo?1:He<-Yt*Oo?-1:0:0)!==0){const wc=B??at%t.length,Sc=Ie(he??Le.scrollLeft,p,wc);Sn(Sc,P);return}const qi=he??Le.scrollLeft,Eo=ge(qi),Xa=dt.current[Eo];if(Xa&&Math.abs(Xa.offsetLeft-qi)<1){St(!0),it();return}Rr("auto")},Sn=(p,P="smooth")=>{const B=rt.current;if(!B||t.length===0)return;const he=Ft(p,B.scrollLeft),Le=dt.current[he];Le&&(P==="smooth"?Jt.current=p:Jt.current=null,v.current=p,me(p),Et(!0),Lo(Le.offsetLeft,{behavior:P,activeIndex:p,onComplete:P==="smooth"?jt:void 0}))},fi=()=>{Tt.current&&(window.removeEventListener("pointerup",Tt.current),window.removeEventListener("pointercancel",Tt.current),Tt.current=null)},Io=(p,P,B,he,Le)=>{const He=B-p,at=he-P,yt=Math.abs(He),tn=Math.abs(at);if(yt<df||yt<=tn)return!1;const Yt=He<0?1:-1,yi=Mt?(Le+Yt+t.length)%t.length:Math.max(0,Math.min(t.length-1,Le+Yt));return yi===Le?!1:(Sn(yi),!0)},ei=p=>{if(!Qe.current.isActive)return;fi();const P=rt.current;if(!P)return;const{scrollLeft:B,startActiveIndex:he,hasMoved:Le}=Qe.current,He=P.scrollLeft;pt(!0),Qe.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},bt(!1),p!==void 0&&P.hasPointerCapture(p)&&P.releasePointerCapture(p),Le?Er(B,"smooth",he,He):(St(!0),it()),_e()},Ro=(p,P)=>{const B=_t.current;_t.current=null,B&&(Io(B.startX,B.startY,p,P,B.startActiveIndex),_e())},kr=p=>{if(!we)return;if(p.pointerType==="touch"){if(un(),St(!0),Nt(p.target))return;_t.current={startX:p.clientX,startY:p.clientY,startActiveIndex:v.current};return}if(p.pointerType!=="mouse"||p.button!==0||Nt(p.target))return;const P=rt.current;if(!P)return;un(),cn(),Qn(),Jt.current=null,Qe.current={isActive:!0,startX:p.clientX,scrollLeft:P.scrollLeft,startActiveIndex:v.current,hasMoved:!1},St(!1),_e(),P.setPointerCapture(p.pointerId),fi();const B=he=>{he.pointerType==="mouse"&&ei(he.pointerId)};Tt.current=B,window.addEventListener("pointerup",B),window.addEventListener("pointercancel",B)},Mr=p=>{if(!we||p.pointerType!=="mouse")return;const P=rt.current;if(!P||!Qe.current.isActive)return;if(p.buttons===0){ei(p.pointerId);return}const B=p.clientX-Qe.current.startX;Math.abs(B)>cf&&(Qe.current.hasMoved=!0,bt(!0)),Qe.current.hasMoved&&(p.preventDefault(),P.scrollLeft=Qe.current.scrollLeft-B,pt(!0),it(),_e())},te=p=>{if(we){if(p.pointerType==="touch"){p.type==="pointerup"?Ro(p.clientX,p.clientY):_t.current=null;return}p.pointerType==="mouse"&&ei(p.pointerId)}},Ee=p=>{!we||p.pointerType!=="mouse"||ei(p.pointerId)};return gc(),a.useEffect(()=>{const p=requestAnimationFrame(()=>Ut(!0));return()=>{cancelAnimationFrame(p),cn(),fi(),Te.current!==null&&(cancelAnimationFrame(Te.current),Te.current=null),Ne.current&&clearTimeout(Ne.current),ze.current&&clearTimeout(ze.current)}},[]),a.useEffect(()=>{if(!ke){ft(!0);return}_e();const p=$t.current;if(!p)return;const P=()=>_e();return p.addEventListener("pointermove",P),p.addEventListener("pointerdown",P),()=>{p.removeEventListener("pointermove",P),p.removeEventListener("pointerdown",P),ze.current&&clearTimeout(ze.current)}},[ke,_e]),a.useEffect(()=>{const p=P=>{P.key==="Escape"&&Je()};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[Je]),a.useLayoutEffect(()=>{Gt()},[A,t.length,Mt]),a.useLayoutEffect(()=>{o||Sn(v.current,"auto")},[A,o]),a.useLayoutEffect(()=>{Sn(0,"auto")},[t.length,Mt]),a.useEffect(()=>{const p=rt.current;if(!p||o||!ve)return;const P=B=>{if(B.preventDefault(),Math.abs(B.deltaY)<=Math.abs(B.deltaX))return;const he=B.deltaMode===1?lf:B.deltaMode===2?p.clientHeight:1,Le=B.deltaY*he*af;if(Le!==0){if(cn(),It.current||(It.current=!0,Pe.current=p.scrollLeft,Jt.current=null,St(!1)),Pe.current+=Le,!Mt){const He=p.scrollWidth-p.clientWidth;Pe.current=Math.max(0,Math.min(He,Pe.current))}_e(),gt.current===null&&(gt.current=requestAnimationFrame(Jn))}};return p.addEventListener("wheel",P,{passive:!1}),()=>{p.removeEventListener("wheel",P),un()}},[o,ve,Mt]),a.useEffect(()=>{const p=rt.current;if(!p)return;const P=()=>{pt(Qe.current.isActive);const he=p.scrollLeft,Le=he-Ge.current;Ge.current=he;const He=kt.current>0?kt.current*.5:1/0;if(Le!==0&&Math.abs(Le)<He){const at=Le>0?"forward":"backward";at!==qe.current&&(qe.current=at,Re(at))}Qe.current.isActive&&Qe.current.hasMoved||it()};p.addEventListener("scroll",P,{passive:!0});const B=new ResizeObserver(()=>{Gt(),pt(Qe.current.isActive),Re(qe.current),it()});return B.observe(p),()=>{cn(),p.removeEventListener("scroll",P),B.disconnect()}},[t.length,Mt]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{At||Je()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:Rt?1:0,transition:`opacity ${io}ms ease`,pointerEvents:Rt?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Vt}}),r.jsxs("div",{ref:$t,className:`${e}-lightbox-dismiss-area`,style:wt,...Qt,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:zt,onClick:p=>p.stopPropagation(),children:r.jsx("div",{ref:rt,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":we&&t.length>0?"true":"false","data-mouse-dragging":on?"true":"false",onPointerDown:kr,onPointerMove:Mr,onPointerUp:te,onPointerCancel:te,onLostPointerCapture:Ee,children:r.jsx("div",{ref:Ue,className:`${e}-lightbox-strip-track`,style:{gap:A},children:en.map((p,P)=>{const B=p.image.objectFit??"contain",he=P%t.length,Le=Math.floor(P/t.length),He=zo(A),at=`calc(-0.5 * (${He} + ${A}))`;return r.jsxs("div",{ref:yt=>dt.current[P]=yt,className:`${e}-strip-item`,style:{height:M==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[r.jsx("img",{src:p.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:B}}),o&&he<t.length-1&&Le===0&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:at,width:He,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Le}-${p.image.url}-${he}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":ut?"true":"false",style:Pt,children:[r.jsx("div",{style:{position:"relative",width:"100%",height:q,flexShrink:0,pointerEvents:"none"},children:o&&r.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-handle-left-fraction":"0.05",style:{position:"absolute",left:0,right:0,top:0,height:G,pointerEvents:"auto",zIndex:3}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:r.jsx("div",{className:`${e}-lightbox-content-area${ye?` ${e}-lightbox-content-area-stacked`:""}`,children:(Se||b)&&r.jsx("div",{className:`${e}-header ${ye?`${e}-header-two-row`:`${e}-header-single-row`}`,children:ye?Ct():Se||b?lt():null})})})]}),t.length>1&&R==="on"&&(()=>{const p=zo(F),P=`calc(-0.5 * (${F} + ${p}))`;return r.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:F},children:r.jsx("div",{ref:ht,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:B=>B.stopPropagation(),children:r.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":C,style:{gap:N,"--thumbnail-active-color":U},children:[t.map((B,he)=>{const Le=zo(N),He=`calc(-0.5 * (${Le} + ${N}))`;return r.jsxs("div",{ref:at=>{xt.current[he]=at},style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":_===he?"true":"false",onClick:()=>ve&&$==="click"&&Sn(he),onMouseEnter:()=>Me&&$==="hover"&&Sn(he),"aria-label":B.image.name?`View ${B.image.name}`:`View image ${he+1}`,"aria-current":_===he?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${X?` ${e}-thumb-image-cover`:""}`,src:B.image.url,alt:"",draggable:!1,style:{...ue,maxWidth:D,maxHeight:D,width:E.display==="cover"?"auto":"100%",height:"auto",objectFit:E.display==="cover"?"cover":"contain"}})}),o&&he<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:He,width:Le,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${B.image.url}-${he}`)}),o&&r.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:P,height:p,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function Sf(e){return`
|
|
13099
|
+
`;function On(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Xl={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Jh=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Qh={type:"object",version:1,content:{type:"array",display:{type:"array"},items:{type:"object",properties:{question:{type:"string",label:"Question",placeholder:"Add question...",display:{type:"text-input"}},answer:{label:"Answer",placeholder:"Add answer...",display:{type:"rich-text"}}}},default:[{question:"What are the three main parts of The Divine Comedy?",answer:[{type:"paragraph",children:[{text:"The poem is divided into Inferno, Purgatorio, and Paradiso. These three sections follow Dante’s journey through Hell, Purgatory, and Heaven."}]}]},{question:"Who guides Dante through Hell and most of Purgatory?",answer:[{type:"paragraph",children:[{text:"Dante is guided by Virgil, the ancient Roman poet. Virgil represents human reason and wisdom, but because he lived before Christianity, he cannot guide Dante all the way into Heaven."}]}]},{question:"What does the dark wood at the beginning of the poem symbolize?",answer:[{type:"paragraph",children:[{text:"The dark wood symbolizes Dante’s spiritual confusion and moral crisis. It shows that he has lost the “straight way” in life and needs guidance to return to truth and salvation."}]}]},{question:"What is “contrapasso” in Inferno?",answer:[{type:"paragraph",children:[{text:"“Contrapasso” is the principle that punishments in Hell reflect the sins committed during life. For example, people who caused division are themselves physically divided, showing how their punishment mirrors their wrongdoing."}]}]},{question:"Who guides Dante through Heaven?",answer:[{type:"paragraph",children:[{text:"Beatrice guides Dante through Paradiso. She represents divine love, grace, and spiritual understanding, helping Dante move beyond human reason toward a vision of God."}]}]},{question:"Why is The Divine Comedy important in literary history?",answer:[{type:"paragraph",children:[{text:"The Divine Comedy is important because it is one of the greatest works of world literature and helped shape the Italian language. Dante wrote it in the Tuscan dialect rather than Latin, making serious literature more accessible to ordinary readers."}]}]},{question:"What is the overall journey of The Divine Comedy about?",answer:[{type:"paragraph",children:[{text:"The poem is about Dante’s spiritual journey from sin and despair toward repentance, wisdom, and union with God. On a deeper level, it represents the soul’s path from confusion to divine truth."}]}]}]},settings:{sizing:"auto",properties:{wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},cellMinHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},dividerWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},dividerStyle:{type:"string",scope:"common",title:"Style",display:{type:"toggle-cycle",enum:["solid","dashed","dotted"]}},entryHoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["none","default"]}},autoclose:{type:"string",scope:"common",title:"Autoclose",display:{type:"toggle-cycle",enum:["on","off"]}},icon:{type:["string","null"],scope:"common",display:{type:"settings-image-input"}},iconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"numeric-input"},min:0,max:9999},iconPaddingRight:On("Icon Padding Right"),iconAnimation:{type:"string",scope:"common",title:"Icon Animation",display:{type:"toggle-cycle",enum:["rotate 180","rotate 90","rotate 45"]}},questionColor:{type:"string",scope:"common",title:"Question Default",display:{type:"palette-color-picker"}},answerColor:{type:"string",scope:"common",title:"Answer Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"palette-color-picker"}},questionHoverColor:{type:"string",scope:"common",title:"Question Hover",display:{type:"palette-color-picker"}},iconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"palette-color-picker"}},iconActiveColor:{type:"string",scope:"common",title:"Icon Active",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}},questionFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},questionFontSettings:{...Xl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},questionFontSize:{type:"number",scope:"layout",title:"Question Font Size",display:{type:"font-size"}},questionLineHeight:{type:"number",scope:"layout",title:"Question Line Height",display:{type:"line-height-input"}},questionLetterSpacing:{type:"number",scope:"layout",title:"Question Letter Spacing",display:{type:"letter-spacing-input"}},questionWordSpacing:{type:"number",scope:"layout",title:"Question Word Spacing",display:{type:"word-spacing-input"}},questionTextAppearance:{type:"object",scope:"layout",title:"Question Text Appearance",display:{type:"text-appearance"}},answerFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},answerFontSettings:{...Xl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},answerFontSize:{type:"number",scope:"layout",title:"Answer Font Size",display:{type:"font-size"}},answerLineHeight:{type:"number",scope:"layout",title:"Answer Line Height",display:{type:"line-height-input"}},answerLetterSpacing:{type:"number",scope:"layout",title:"Answer Letter Spacing",display:{type:"letter-spacing-input"}},answerWordSpacing:{type:"number",scope:"layout",title:"Answer Word Spacing",display:{type:"word-spacing-input"}},answerTextAppearance:{type:"object",scope:"layout",title:"Answer Text Appearance",display:{type:"text-appearance"}},questionPaddingLeft:On("Question Padding Left"),questionPaddingTop:On("Question Padding Top"),questionPaddingBottom:On("Question Padding Bottom"),answerPaddingLeft:On("Answer Padding Left"),answerPaddingRight:On("Answer Padding Right"),answerPaddingTop:On("Answer Padding Top"),answerPaddingBottom:On("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"https://cdn.cntrl.site/component-assets/PlusIcon.svg",iconAnimation:"rotate 45",questionColor:"#000000",answerColor:"#000000",dividerColor:"#000000",iconColor:"#000000",questionHoverColor:"#A60239",iconHoverColor:"#A60239",iconActiveColor:"#000000",dividerHoverColor:"#A60239",questionFontFamily:"Goudy Bookletter 1911",questionFontSettings:{fontWeight:400,fontStyle:"normal"},questionLetterSpacing:0,questionWordSpacing:0,questionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},answerFontFamily:"Goudy Bookletter 1911",answerFontSettings:{fontWeight:400,fontStyle:"normal"},answerLetterSpacing:0,answerWordSpacing:0,answerTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{wrapperWidth:1,cellMinHeight:0,dividerWidth:.008,iconMaxWidth:.0533,iconPaddingRight:.08,questionFontSize:.09066,questionLineHeight:.10133,questionLetterSpacing:-.00266,answerFontSize:.0533,answerLineHeight:.064,questionPaddingLeft:.0533,questionPaddingTop:.0533,questionPaddingBottom:.0533,answerPaddingLeft:.0533,answerPaddingRight:.16,answerPaddingTop:.0533,answerPaddingBottom:.0533},t:{wrapperWidth:.651041,cellMinHeight:0,dividerWidth:.00390625,iconMaxWidth:.02604166,iconPaddingRight:.0130208,questionFontSize:.0390625,questionLineHeight:.04427,questionLetterSpacing:-.00091145833,answerFontSize:.0234375,answerLineHeight:.026041,questionPaddingLeft:0,questionPaddingTop:.01302,questionPaddingBottom:.01302,answerPaddingLeft:.065104,answerPaddingRight:.09765625,answerPaddingTop:.026041,answerPaddingBottom:.026041},d:{wrapperWidth:.6388,cellMinHeight:0,dividerWidth:.002083,iconMaxWidth:.01388,iconPaddingRight:.01388,questionFontSize:.0333,questionLineHeight:.0333,questionLetterSpacing:-9e-4,answerFontSize:.01111,answerLineHeight:.01388,questionPaddingLeft:0,questionPaddingTop:.01111,questionPaddingBottom:.01111,answerPaddingLeft:.0625,answerPaddingRight:.1625,answerPaddingTop:0,answerPaddingBottom:.01111}},layout:["__componentName__","wrapperWidth","cellMinHeight","dividerWidth","dividerStyle","entryHoverEffect","autoclose","icon","iconMaxWidth","iconAnimation"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["wrapperWidth","cellMinHeight"]},{type:"row",title:"",items:["entryHoverEffect","autoclose"]},{type:"row",title:"Divider",items:["dividerWidth","dividerStyle"]},{type:"row",title:"Icon",items:["icon","iconMaxWidth"]},{type:"row",title:"",items:["iconAnimation"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Question",items:["questionFontFamily","questionFontSettings",{type:"row",items:["questionFontSize","questionLineHeight","questionLetterSpacing","questionWordSpacing"]},"questionTextAppearance"]},{type:"group",title:"Answer",items:["answerFontFamily","answerFontSettings",{type:"row",items:["answerFontSize","answerLineHeight","answerLetterSpacing","answerWordSpacing"]},"answerTextAppearance"]}]}],paletteBookmark:{items:[...Jh],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},ef={element:Yh,id:"faq",name:"FAQ",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/FAQ_List.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"questionFontFamily"},{path:"answerFontFamily"}]},fontRelations:{questionFontSettings:"questionFontFamily",answerFontSettings:"answerFontFamily"},schema:Qh,sourceCode:Zh},Fn=e=>e.display==="cover",Tr=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Yl=100,tf=.2,Zl=8,hc=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,l]=a.useState(0),[s,c]=a.useState(!1),d=a.useRef(null),u=a.useRef(0);u.current=o;const m=a.useMemo(()=>typeof window>"u"?Yl:Math.max(Yl,window.innerHeight*tf),[]),x=a.useCallback(y=>Math.max(0,1-y/(m*1.5)),[m]),w=a.useCallback(y=>Math.max(0,1-y/(m*.45)),[m]),$=a.useCallback(y=>{const h=typeof window<"u"?window.innerHeight:800,F=Math.max(.88,1-y/h*.12);return`translateY(${y}px) scale(${F})`},[]),f=a.useCallback(()=>{d.current=null},[]),S=a.useCallback(()=>{c(!0),l(0),window.setTimeout(()=>c(!1),n),f()},[n,f]),L=a.useCallback(()=>{const y=typeof window<"u"?window.innerHeight:800;c(!0),l(y),window.setTimeout(()=>{t(),f(),c(!1)},Math.min(n,200))},[n,t,f]),M=a.useCallback(y=>{!e||s||y.pointerType==="touch"&&(i!=null&&i(y.target)||(d.current={startX:y.clientX,startY:y.clientY,isLocked:null,pointerId:y.pointerId}))},[e,s,i]),A=a.useCallback(y=>{const h=d.current;if(!e||!h||y.pointerType!=="touch"||h.pointerId!==y.pointerId)return;const F=y.clientX-h.startX,W=y.clientY-h.startY;if(h.isLocked===null){if(Math.abs(F)<Zl&&Math.abs(W)<Zl)return;if(W>0&&W>Math.abs(F))h.isLocked=!0,y.currentTarget.setPointerCapture(y.pointerId);else{h.isLocked=!1,f();return}}if(!h.isLocked)return;y.preventDefault();const V=Math.max(0,W);u.current=V,l(V)},[e,f]),C=a.useCallback(y=>{const h=d.current;if(!e||!h||y.pointerType!=="touch"||h.pointerId!==y.pointerId)return;const F=h.isLocked===!0;if(y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),!F){f();return}y.clientY-h.startY>=m?L():S()},[m,L,e,f,S]),J=a.useCallback(y=>{C(y)},[C]),k=a.useCallback(y=>{C(y)},[C]),U=o>0,I=s?`transform ${n}ms ease`:"none",R=s?`opacity ${n}ms ease`:"none",T=o>0||s;return{isSwipeDragging:U,backdropStyle:{opacity:x(o),transition:R},mediaAreaStyle:{transform:$(o),transition:I,touchAction:U?"none":void 0,willChange:U?"transform":void 0},overlayContentStyle:T?{opacity:w(o),transition:R}:void 0,swipeHandlers:e?{onPointerDown:M,onPointerMove:A,onPointerUp:J,onPointerCancel:k}:{},dismissAreaStyle:e?{touchAction:U?"none":"pan-x"}:void 0}},nf="[data-lightbox-scrollable]",fc=()=>{a.useEffect(()=>{const e=window.scrollY,t=document.body.style.overflow,n=document.body.style.position,i=document.body.style.top,o=document.body.style.width,l=document.documentElement.style.overflow;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${e}px`,document.body.style.width="100%",document.documentElement.style.overflow="hidden";const s=c=>{const d=c.target;d instanceof Element&&d.closest(nf)||c.preventDefault()};return document.addEventListener("touchmove",s,{passive:!1}),()=>{document.removeEventListener("touchmove",s),document.body.style.overflow=t,document.body.style.position=n,document.body.style.top=i,document.body.style.width=o,document.documentElement.style.overflow=l,window.scrollTo(0,e)}},[])},of=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},rf=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},af=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},lf=(e,t,n,{duration:i,easing:o,onComplete:l})=>{const s=e.scrollLeft,c=n-s,d=s-n,u=(f,S)=>{rf(t),e.scrollLeft=f,S&&(l==null||l())};if(Math.abs(c)<.5)return u(n,!0),()=>{};let m=!1,x=0;const w=()=>{t.removeEventListener("transitionend",$),clearTimeout(x)},$=f=>{f.target!==t||f.propertyName!=="transform"||m||(m=!0,w(),u(n,!0))};return t.addEventListener("transitionend",$),t.style.willChange="transform",t.style.transition="none",t.style.transform="translate3d(0, 0, 0)",t.offsetHeight,t.style.transition=`transform ${i}ms ${o}`,t.style.transform=`translate3d(${d}px, 0, 0)`,x=window.setTimeout(()=>{m||(m=!0,w(),u(n,!0))},i+64),()=>{m||(m=!0,w(),u(s-af(t),!1))}},io=300,sf=900,cf=1500,df="cubic-bezier(0.16, 1, 0.3, 1)",uf=3e3,pf=2,mf=16,gf=.05,hf=1,Oo=.3,ff=50,yf=20,bi=.004,Oi=["title1","title2","title3"],vf={title1:"1",title2:"2",title3:"3"},bf={title1:"title1Color",title2:"title2Color",title3:"title3Color"},xf={title1:.02,title2:.02,title3:.02},jo=e=>`max(${e}, ${yf}px)`,wf=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]}},Sf=e=>{if(!e)return{title1:"",title2:"",title3:""};if(e.title1||e.title2||e.title3)return{title1:e.title1??"",title2:e.title2??"",title3:e.title3??""};const t=wf(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Wt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,$f=e=>[Wt(e,"fontFamily"),Wt(e,"fontSettings"),{type:"row",items:[Wt(e,"fontSize"),Wt(e,"lineHeight"),Wt(e,"letterSpacing"),Wt(e,"wordSpacing")]},Wt(e,"textAlign"),Wt(e,"textAppearance")],Cf=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Oi.map(e=>[vf[e],$f(e)]))}),Ka=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((l,s)=>l+s,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:l,widths:s},c)=>{if(l<=0||c<=0)return{overflow:l,widths:[c,...s]};const d=Math.min(l,c);return{overflow:l-d,widths:[c-d,...s]}},{overflow:i-1,widths:[]});return o},yc=(e,t)=>Ka(e,t),zo=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Jl=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Ka(e.length,n),effective:yc(e.length,n)}},Tf=(e,t,n,i,o,l,s)=>{const c=[];return t&&c.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:o,text:t}),n&&c.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:l,text:n}),i&&c.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:s,text:i}),c},Ur=(e,t)=>{const n=i=>{const o=Wt(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[bf[t]]}},Lf=(e,t,n,i)=>e.slice(0,i).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0),Xr=(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??xf[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Xt(i,n)},If=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,onClose:s})=>{const{backgroundColor:c,thumbnailSize:d,thumbnailGap:u,thumbnailMarginBottom:m,imageGap:x,closeIcon:w,closeIconMaxWidth:$,closeIconColor:f,closeIconHoverColor:S,thumbnailTrigger:L,thumbnailVisibility:M,thumbnailObjectFit:A,thumbnailActive:C,thumbnailActiveColor:J,title1Width:k,title2Width:U,title3Width:I,title1MarginLeft:R=0,title2MarginLeft:T=0,title3MarginLeft:y=0,titleRowMarginBottom:h=0,titleHeaderLayout:F="desktop",contentMarginTop:W,iconMarginLeft:V}=n,ne=p=>v.scalingValue(p,i??!1),X=d??n.thumnailSize??.03,z=ne(X),H=ne(u),_=ne(m??.02),E=ne(x??0),q=ne(W??0),Y=jo(q),ee=ne(V??0),[N,pe]=a.useState(0),b=a.useRef(N);b.current=N;const ye=t[N],{title1:Q,title2:xe,title3:$e}=Sf(ye),oe=Xr("title1",Ur(n,"title1"),i),ie=Xr("title2",Ur(n,"title2"),i),B=Xr("title3",Ur(n,"title3"),i),le=F==="mobile",re=!o&&(!i||l),ke=re,fe=re,Pe=re,ve=Fn(A),we=ve?{"--image-aspect-ratio":Tr(A)}:void 0,Se=!!(Q||xe||$e),G=a.useMemo(()=>Tf(e,Q,xe,$e,oe,ie,B),[e,N,Q,xe,$e,oe,ie,B]),me=a.useMemo(()=>({title1Width:k,title2Width:U,title3Width:I}),[k,U,I]),D=a.useMemo(()=>G.map(p=>me[p.widthKey]),[G,me]),K=a.useMemo(()=>Ka(G.length,D),[G.length,D]),ae=a.useMemo(()=>yc(G.length,D),[G.length,D]),ge=a.useMemo(()=>G.filter(p=>p.prefix==="title1"),[G]),ce=a.useMemo(()=>G.filter(p=>p.prefix==="title2"||p.prefix==="title3"),[G]),be=a.useMemo(()=>Jl(ge,me),[ge,me]),Ee=a.useMemo(()=>Jl(ce,me),[ce,me]),Z=a.useCallback((p,P)=>{const j=G.indexOf(p);if(!le||P==="single-row")return{effectiveWidth:ae[j]??0,resolvedWidth:K[j]??0,maxWidth:zo(j,K)};if(P==="two-row-top"){const Ie=ge.indexOf(p);return{effectiveWidth:be.effective[Ie]??0,resolvedWidth:be.resolved[Ie]??0,maxWidth:zo(Ie,be.resolved)}}const he=ce.indexOf(p);return{effectiveWidth:Ee.effective[he]??0,resolvedWidth:Ee.resolved[he]??0,maxWidth:zo(he,Ee.resolved)}},[ce,Ee,ae,K,G,ge,be,le]),de=a.useCallback(p=>v.scalingValue(p,i??!1),[i]),We=de(h??0),se=a.useMemo(()=>({title1MarginLeft:R,title2MarginLeft:T,title3MarginLeft:y}),[R,T,y]),O=a.useCallback(p=>G.slice(0,p+1).reduce((P,j,he)=>P+(j!=null&&j.marginLeftKey?se[j.marginLeftKey]??0:0)+(K[he]??0),0)+(le?0:R??0),[G,se,K,le,R]),Oe=a.useCallback(()=>le?0:R??0,[le,R]),_e=a.useCallback(p=>ce.slice(0,p).reduce((P,j,he)=>P+(j.marginLeftKey?se[j.marginLeftKey]??0:0)+(Ee.resolved[he]??0),0),[ce,Ee.resolved,se]),nt=a.useCallback(p=>{const P=ce[p];return _e(p)+(P.marginLeftKey?se[P.marginLeftKey]??0:0)+(Ee.resolved[p]??0)},[ce,Ee.resolved,_e,se]),Ue=(p,P)=>{const j=p.marginLeftKey?se[p.marginLeftKey]??0:0,{effectiveWidth:he,resolvedWidth:Ie,maxWidth:Be}=Z(p,P),ct=o&&P==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":p.prefix,style:{...P==="single-row"?{gridArea:p.prefix}:{},width:de(he),...j>0?{marginLeft:de(j)}:{}},children:[r.jsx("p",{className:p.className,style:p.style,children:p.text}),ct&&p.marginLeftKey&&r.jsx("div",{"data-controls":p.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ie),style:{position:"absolute",top:0,left:de(-j),width:`max(${de(j)}, 10px)`,height:"100%",pointerEvents:"auto"}}),ct&&r.jsx("div",{"data-controls":p.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Be),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:de(-bi/2),width:de(bi),height:"100%",pointerEvents:"auto"}})]},p.className)},Ce=()=>{const p=le?-1:G.findIndex(he=>he.prefix==="title1"),P=!le&&(o||(R??0)>0)?(()=>{const he=R??0,Ie=p>=0?K[p]:k??0;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ie),style:{position:"absolute",top:0,left:0,width:`max(${de(he)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,j=G.flatMap((he,Ie)=>{if(!he.marginLeftKey)return[];const Be=se[he.marginLeftKey]??0,ct=Lf(G,K,se,Ie)+Oe();return r.jsx("div",{"data-controls":he.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(K[Ie]),style:{position:"absolute",top:0,left:de(ct),width:`max(${de(Be)}, 10px)`,height:"100%",pointerEvents:"auto"}},he.marginLeftKey)});return P?[P,...j]:j},Fe=()=>G.map((p,P)=>{const j=zo(P,K),Ie=O(P)-bi/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":p.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(j),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:de(Ie),width:de(bi),height:"100%",pointerEvents:"auto"}})},`${p.widthKey}-junction`)}),He=()=>ce.flatMap((p,P)=>{if(!p.marginLeftKey)return[];const j=se[p.marginLeftKey]??0,he=_e(P),{resolvedWidth:Ie}=Z(p,"two-row-bottom");return r.jsx("div",{"data-controls":p.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ie),style:{position:"absolute",top:0,left:de(he),width:`max(${de(j)}, 10px)`,height:"100%",pointerEvents:"auto"}},p.marginLeftKey)}),Ze=()=>ce.map((p,P)=>{const{maxWidth:j}=Z(p,"two-row-bottom"),Ie=nt(P)-bi/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":p.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(j),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:de(Ie),width:de(bi),height:"100%",pointerEvents:"auto"}})},`${p.widthKey}-junction`)}),Tt=a.useRef(null),it=a.useRef(null),De=a.useRef(null),et=a.useRef(null),dt=a.useRef([]),lt=a.useRef([]),ht=a.useRef(0),Rt=a.useRef(null),ot=a.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),xt=a.useRef(null),zt=a.useRef(null),rt=a.useRef(0),qe=a.useRef("forward"),Ne=a.useRef(0),pt=a.useRef(null),yt=a.useRef(!1),Mt=t.length>1&&(!o||!!l),Dt=Mt?3:1,en=a.useMemo(()=>Array.from({length:Dt},()=>t).flat(),[t,Dt]),[sn,Lt]=a.useState(!1),[Et,Qt]=a.useState(!1),[Ut,ft]=a.useState(!0),qt=a.useRef(null),Re=a.useRef(null),Ve=a.useRef(!1),Xe=a.useRef(!1),ze=a.useRef(null),mt=a.useRef(null),Nt=ke&&!Ut,Ae=a.useCallback(()=>{ke&&(ft(!0),mt.current&&clearTimeout(mt.current),mt.current=setTimeout(()=>{ot.current.isActive||ft(!1)},uf))},[ke]),Ye=a.useCallback(()=>{o||Xe.current||(Xe.current=!0,Qt(!1),ze.current=setTimeout(()=>{s()},io))},[o,s]),Je=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":Nt?"true":"false",style:{width:v.scalingValue($??0,i),height:v.scalingValue($??0,i),marginRight:ee,"--close-icon-hover-color":S},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Ye,"aria-label":"Close",children:r.jsx(on,{url:w,fill:f,hoverFill:i&&!l?f:S,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ee,height:"100%",pointerEvents:"auto"}})]}),bt=(p="two-row")=>r.jsx("div",{...p==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:de(R??0),flexShrink:0,...p==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...p==="two-row"&&o?{pointerEvents:"auto"}:{}}}),$t=()=>{const p=G.find(he=>he.prefix==="title1"),P=G.filter(he=>he.prefix==="title2"||he.prefix==="title3"),j=P.length>0||o||(h??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(R??0)>0||o?bt():null,p&&Ue(p,"two-row-top"),w&&Je()]}),j?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[P.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[P.map(he=>Ue(he,"two-row-bottom")),o&&r.jsxs(r.Fragment,{children:[He(),Ze()]})]}):null,r.jsx("div",{"data-controls":o?"titleRowMarginBottom":void 0,"data-controls-axis":o?"y":void 0,"data-controls-reverse":o?"":void 0,className:o?`${e}-control`:void 0,style:{height:We,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},ut=()=>r.jsxs(r.Fragment,{children:[(R??0)>0||o?bt("single-row"):null,G.map(p=>Ue(p,"single-row")),o?r.jsxs(r.Fragment,{children:[Ce(),Fe()]}):null,w?Je():null]}),Pt=a.useCallback(p=>!!(p.closest("[data-controls]")||p.closest(`.${e}-thumbnails`)||p.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:At,backdropStyle:Vt,mediaAreaStyle:Kt,overlayContentStyle:Ft,swipeHandlers:Yt,dismissAreaStyle:wt}=hc({enabled:re??!1,onClose:Ye,animMs:io,isBlockedTarget:Pt}),Ot=()=>{if(!Mt||t.length===0)return ht.current=0,0;const p=lt.current[0],P=lt.current[t.length];if(!p||!P)return ht.current;const j=P.offsetLeft-p.offsetLeft;return j>0&&(ht.current=j),ht.current},jt=(p=!1)=>{if(!Mt)return;const P=it.current,j=Ot();!P||j<=0||j<P.clientWidth*.25||(P.scrollLeft<=0?(P.scrollLeft+=j,p&&(ot.current.scrollLeft+=j),yt.current&&(Ne.current+=j)):P.scrollLeft>=j*2&&(P.scrollLeft-=j,p&&(ot.current.scrollLeft-=j),yt.current&&(Ne.current-=j)))},Bt=(p,P=(j=>(j=it.current)==null?void 0:j.scrollLeft)()??0)=>{if(!Mt)return p;let he=t.length+p,Ie=1/0;for(let Be=0;Be<Dt;Be++){const ct=Be*t.length+p,St=lt.current[ct];if(!St)continue;const tn=Math.abs(St.offsetLeft-P);tn<Ie&&(Ie=tn,he=ct)}return he},vt=p=>{const P=it.current;return!p||!P?!1:p.offsetWidth>P.clientWidth+1},g=p=>{const P=it.current;if(!p||!P||!vt(p))return!1;const j=p.offsetLeft,he=j+p.offsetWidth;return P.scrollLeft>=j-1&&P.scrollLeft+P.clientWidth<=he+1},ue=(p=(P=>(P=it.current)==null?void 0:P.scrollLeft)()??0)=>{for(let he=0;he<lt.current.length;he+=1){const Ie=lt.current[he];if(Ie&&g(Ie))return he}let j={flatIndex:0,distance:1/0};return lt.current.forEach((he,Ie)=>{if(!he)return;const Be=Math.abs(he.offsetLeft-p);Be<j.distance&&(j={flatIndex:Ie,distance:Be})}),j.flatIndex},Te=p=>{it.current&<.current.forEach(P=>{P&&(P.style.scrollSnapAlign=vt(P)&&p==="backward"?"end":"start")})},Le=(p,P,j)=>{const he=p-P,Ie=ue(P),Be=lt.current[Ie];if(g(Be))return ue(p)%t.length;const ct=lt.current[Ie+1],St=Be?ct?ct.offsetLeft-Be.offsetLeft:Be.offsetWidth:0,tn=St>0?he>St*Oo?1:he<-St*Oo?-1:0:0;return tn===0?j:Mt?(j+tn+t.length)%t.length:Math.max(0,Math.min(t.length-1,j+tn))},tt=a.useCallback((p=!1)=>{if(M!=="on"||o)return;const P=et.current,j=b.current,he=dt.current[j];if(!P||!he||P.scrollWidth<=P.clientWidth)return;const Ie=P.scrollLeft,Be=Ie+P.clientWidth,ct=he.offsetLeft,St=ct+he.offsetWidth;if(ct>=Ie&&St<=Be)return;const tn=P.scrollWidth-P.clientWidth;let Zt=Ie;if(!p&&qt.current===null){const yi=dt.current[j-1],Ki=dt.current[j+1],Eo=yi?he.offsetLeft-yi.offsetLeft:Ki?Ki.offsetLeft-he.offsetLeft:he.offsetWidth;St>Be?Zt+=Eo:ct<Ie&&(Zt-=Eo)}else St>Be?Zt=St-P.clientWidth:Zt=ct;P.scrollLeft=Math.max(0,Math.min(tn,Zt))},[o,M]),kt=a.useCallback((p=!1)=>{p&&(Ve.current=!0),Re.current===null&&(Re.current=requestAnimationFrame(()=>{Re.current=null;const P=Ve.current;Ve.current=!1,tt(P)}))},[tt]),Ke=a.useCallback(p=>{if(p===b.current)return;const P=b.current;b.current=p;const j=Math.abs(p-P)>1,he=Mt&&t.length>1&&(P===t.length-1&&p===0||P===0&&p===t.length-1);pe(p),kt(j||he)},[t.length,Mt,kt]),st=()=>{if(!it.current||t.length===0||qt.current!==null||ot.current.isActive&&ot.current.hasMoved)return;const p=it.current.scrollLeft,P=ue(p)%t.length;P!==b.current&&Ke(P)},_t=()=>{qt.current=null},It=p=>{const P=it.current;P&&(P.style.scrollSnapType=p?"":"none")},cn=()=>{var p;(p=zt.current)==null||p.call(zt),zt.current=null},un=()=>{pt.current!==null&&(cancelAnimationFrame(pt.current),pt.current=null),yt.current=!1},Qn=()=>{const p=it.current;if(!p){pt.current=null,yt.current=!1;return}const P=Ne.current-p.scrollLeft;if(Math.abs(P)<.5){p.scrollLeft=Ne.current,jt(),st(),pt.current=null,yt.current=!1;return}p.scrollLeft+=P*gf,jt(),st(),Ae(),pt.current=requestAnimationFrame(Qn)},ei=()=>{const p=De.current;p&&(p.style.transition="",p.style.transform="",p.style.willChange="")},To=(p,P,j,he)=>{ei(),p.scrollLeft=P,rt.current=p.scrollLeft,jt(),j!==void 0?(b.current=j,pe(j)):st(),It(!0),he==null||he()},Lo=(p,{behavior:P="smooth",activeIndex:j,onComplete:he}={})=>{const Ie=it.current,Be=De.current;if(!Ie||!Be)return;if(un(),cn(),It(!1),P==="auto"){To(Ie,p,j,he);return}const ct=Math.abs(p-Ie.scrollLeft),St=of(ct,sf,cf,Ie.clientWidth*.55);zt.current=lf(Ie,Be,p,{duration:St,easing:df,onComplete:()=>{zt.current=null,To(Ie,p,j,he)}})},Ir=(p="smooth")=>{const P=it.current;if(!P||t.length===0)return;const j=ue()%t.length,he=Bt(j,P.scrollLeft),Ie=lt.current[he];Ie&&Lo(Ie.offsetLeft,{behavior:p,activeIndex:j})},Rr=(p,P="smooth",j,he)=>{const Ie=it.current;if(!Ie||t.length===0)return;const Be=(he??Ie.scrollLeft)-p,ct=ue(p),St=lt.current[ct];if(g(St)){It(!0),st();return}const tn=lt.current[ct+1],Zt=St?tn?tn.offsetLeft-St.offsetLeft:St.offsetWidth:0;if((Zt>0?Be>Zt*Oo?1:Be<-Zt*Oo?-1:0:0)!==0){const $c=j??ct%t.length,Cc=Le(he??Ie.scrollLeft,p,$c);Sn(Cc,P);return}const Ki=he??Ie.scrollLeft,Eo=ue(Ki),Ua=lt.current[Eo];if(Ua&&Math.abs(Ua.offsetLeft-Ki)<1){It(!0),st();return}Ir("auto")},Sn=(p,P="smooth")=>{const j=it.current;if(!j||t.length===0)return;const he=Bt(p,j.scrollLeft),Ie=lt.current[he];Ie&&(P==="smooth"?qt.current=p:qt.current=null,b.current=p,pe(p),kt(!0),Lo(Ie.offsetLeft,{behavior:P,activeIndex:p,onComplete:P==="smooth"?_t:void 0}))},fi=()=>{xt.current&&(window.removeEventListener("pointerup",xt.current),window.removeEventListener("pointercancel",xt.current),xt.current=null)},Io=(p,P,j,he,Ie)=>{const Be=j-p,ct=he-P,St=Math.abs(Be),tn=Math.abs(ct);if(St<ff||St<=tn)return!1;const Zt=Be<0?1:-1,yi=Mt?(Ie+Zt+t.length)%t.length:Math.max(0,Math.min(t.length-1,Ie+Zt));return yi===Ie?!1:(Sn(yi),!0)},ti=p=>{if(!ot.current.isActive)return;fi();const P=it.current;if(!P)return;const{scrollLeft:j,startActiveIndex:he,hasMoved:Ie}=ot.current,Be=P.scrollLeft;jt(!0),ot.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},Lt(!1),p!==void 0&&P.hasPointerCapture(p)&&P.releasePointerCapture(p),Ie?Rr(j,"smooth",he,Be):(It(!0),st()),Ae()},Ro=(p,P)=>{const j=Rt.current;Rt.current=null,j&&(Io(j.startX,j.startY,p,P,j.startActiveIndex),Ae())},Er=p=>{if(!fe)return;if(p.pointerType==="touch"){if(un(),It(!0),Pt(p.target))return;Rt.current={startX:p.clientX,startY:p.clientY,startActiveIndex:b.current};return}if(p.pointerType!=="mouse"||p.button!==0||Pt(p.target))return;const P=it.current;if(!P)return;un(),cn(),ei(),qt.current=null,ot.current={isActive:!0,startX:p.clientX,scrollLeft:P.scrollLeft,startActiveIndex:b.current,hasMoved:!1},It(!1),Ae(),P.setPointerCapture(p.pointerId),fi();const j=he=>{he.pointerType==="mouse"&&ti(he.pointerId)};xt.current=j,window.addEventListener("pointerup",j),window.addEventListener("pointercancel",j)},Mr=p=>{if(!fe||p.pointerType!=="mouse")return;const P=it.current;if(!P||!ot.current.isActive)return;if(p.buttons===0){ti(p.pointerId);return}const j=p.clientX-ot.current.startX;Math.abs(j)>hf&&(ot.current.hasMoved=!0,Lt(!0)),ot.current.hasMoved&&(p.preventDefault(),P.scrollLeft=ot.current.scrollLeft-j,jt(!0),st(),Ae())},te=p=>{if(fe){if(p.pointerType==="touch"){p.type==="pointerup"?Ro(p.clientX,p.clientY):Rt.current=null;return}p.pointerType==="mouse"&&ti(p.pointerId)}},Me=p=>{!fe||p.pointerType!=="mouse"||ti(p.pointerId)};return fc(),a.useEffect(()=>{const p=requestAnimationFrame(()=>Qt(!0));return()=>{cancelAnimationFrame(p),cn(),fi(),Re.current!==null&&(cancelAnimationFrame(Re.current),Re.current=null),ze.current&&clearTimeout(ze.current),mt.current&&clearTimeout(mt.current)}},[]),a.useEffect(()=>{if(!ke){ft(!0);return}Ae();const p=Tt.current;if(!p)return;const P=()=>Ae();return p.addEventListener("pointermove",P),p.addEventListener("pointerdown",P),()=>{p.removeEventListener("pointermove",P),p.removeEventListener("pointerdown",P),mt.current&&clearTimeout(mt.current)}},[ke,Ae]),a.useEffect(()=>{const p=P=>{P.key==="Escape"&&Ye()};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[Ye]),a.useLayoutEffect(()=>{Ot()},[E,t.length,Mt]),a.useLayoutEffect(()=>{o||Sn(b.current,"auto")},[E,o]),a.useLayoutEffect(()=>{Sn(0,"auto")},[t.length,Mt]),a.useEffect(()=>{const p=it.current;if(!p||o||!re)return;const P=j=>{if(j.preventDefault(),Math.abs(j.deltaY)<=Math.abs(j.deltaX))return;const he=j.deltaMode===1?mf:j.deltaMode===2?p.clientHeight:1,Ie=j.deltaY*he*pf;if(Ie!==0){if(cn(),yt.current||(yt.current=!0,Ne.current=p.scrollLeft,qt.current=null,It(!1)),Ne.current+=Ie,!Mt){const Be=p.scrollWidth-p.clientWidth;Ne.current=Math.max(0,Math.min(Be,Ne.current))}Ae(),pt.current===null&&(pt.current=requestAnimationFrame(Qn))}};return p.addEventListener("wheel",P,{passive:!1}),()=>{p.removeEventListener("wheel",P),un()}},[o,re,Mt]),a.useEffect(()=>{const p=it.current;if(!p)return;const P=()=>{jt(ot.current.isActive);const he=p.scrollLeft,Ie=he-rt.current;rt.current=he;const Be=ht.current>0?ht.current*.5:1/0;if(Ie!==0&&Math.abs(Ie)<Be){const ct=Ie>0?"forward":"backward";ct!==qe.current&&(qe.current=ct,Te(ct))}ot.current.isActive&&ot.current.hasMoved||st()};p.addEventListener("scroll",P,{passive:!0});const j=new ResizeObserver(()=>{Ot(),jt(ot.current.isActive),Te(qe.current),st()});return j.observe(p),()=>{cn(),p.removeEventListener("scroll",P),j.disconnect()}},[t.length,Mt]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{At||Ye()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:Et?1:0,transition:`opacity ${io}ms ease`,pointerEvents:Et?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:c,...Vt}}),r.jsxs("div",{ref:Tt,className:`${e}-lightbox-dismiss-area`,style:wt,...Yt,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:Kt,onClick:p=>p.stopPropagation(),children:r.jsx("div",{ref:it,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":fe&&t.length>0?"true":"false","data-mouse-dragging":sn?"true":"false",onPointerDown:Er,onPointerMove:Mr,onPointerUp:te,onPointerCancel:te,onLostPointerCapture:Me,children:r.jsx("div",{ref:De,className:`${e}-lightbox-strip-track`,style:{gap:E},children:en.map((p,P)=>{const j=p.image.objectFit??"contain",he=P%t.length,Ie=Math.floor(P/t.length),Be=jo(E),ct=`calc(-0.5 * (${Be} + ${E}))`;return r.jsxs("div",{ref:St=>lt.current[P]=St,className:`${e}-strip-item`,style:{height:F==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[r.jsx("img",{src:p.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:j}}),o&&he<t.length-1&&Ie===0&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:ct,width:Be,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ie}-${p.image.url}-${he}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":Nt?"true":"false",style:Ft,children:[r.jsx("div",{style:{position:"relative",width:"100%",height:q,flexShrink:0,pointerEvents:"none"},children:o&&r.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-handle-left-fraction":"0.05",style:{position:"absolute",left:0,right:0,top:0,height:Y,pointerEvents:"auto",zIndex:3}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:r.jsx("div",{className:`${e}-lightbox-content-area${le?` ${e}-lightbox-content-area-stacked`:""}`,children:(Se||w)&&r.jsx("div",{className:`${e}-header ${le?`${e}-header-two-row`:`${e}-header-single-row`}`,children:le?$t():Se||w?ut():null})})})]}),t.length>1&&M==="on"&&(()=>{const p=jo(_),P=`calc(-0.5 * (${_} + ${p}))`;return r.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:_},children:r.jsx("div",{ref:et,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:j=>j.stopPropagation(),children:r.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":C,style:{gap:H,"--thumbnail-active-color":J},children:[t.map((j,he)=>{const Ie=jo(H),Be=`calc(-0.5 * (${Ie} + ${H}))`;return r.jsxs("div",{ref:ct=>{dt.current[he]=ct},style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":N===he?"true":"false",onClick:()=>re&&L==="click"&&Sn(he),onMouseEnter:()=>Pe&&L==="hover"&&Sn(he),"aria-label":j.image.name?`View ${j.image.name}`:`View image ${he+1}`,"aria-current":N===he?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${ve?` ${e}-thumb-image-cover`:""}`,src:j.image.url,alt:"",draggable:!1,style:{...we,maxWidth:z,maxHeight:z,width:A.display==="cover"?"auto":"100%",height:"auto",objectFit:A.display==="cover"?"cover":"contain"}})}),o&&he<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Be,width:Ie,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${j.image.url}-${he}`)}),o&&r.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:P,height:p,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function Rf(e){return`
|
|
13022
13100
|
.${e}-wrapper {
|
|
13023
13101
|
position: relative;
|
|
13024
13102
|
width: 100%;
|
|
@@ -13415,7 +13493,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
13415
13493
|
pointer-events: auto;
|
|
13416
13494
|
z-index: 10;
|
|
13417
13495
|
}
|
|
13418
|
-
`}const
|
|
13496
|
+
`}const Ef=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:l})=>{const{prefix:s}=v.useScopedStyles(),{cover:c,coverFit:d}=e,u=a.useRef(null),[m,x]=a.useState(!1),w=t??[],$=m&&w.length>0,f=()=>{w.length!==0&&x(!0)};return a.useEffect(()=>{!n||i||o||x(!1)},[n,i,o]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:u,className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Rf(s)}}),c&&r.jsx("div",{className:`${s}-cover ${Fn(d)?`${s}-ratio-wrapper-cover`:`${s}-ratio-wrapper-fit`}`,onClick:()=>f(),style:{...Fn(d)?{"--image-aspect-ratio":Tr(d)}:{}},"aria-label":"Open image gallery",children:r.jsx("img",{className:`${s}-cover-image ${Fn(d)?`${s}-cover-image-cover`:`${s}-cover-image-fit`}`,src:c,alt:"cover"})})]}),$&&typeof document<"u"&&(()=>{const S=(l?document.getElementById(l):null)??document.body;return gi.createPortal(r.jsx(If,{prefix:s,images:w,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:()=>x(!1)}),S)})()]})},Mf=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
|
|
13419
13497
|
import { createPortal } from 'react-dom';
|
|
13420
13498
|
import { CommonComponentProps } from '../props';
|
|
13421
13499
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -13973,7 +14051,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
13973
14051
|
</>
|
|
13974
14052
|
);
|
|
13975
14053
|
};
|
|
13976
|
-
`,Tf="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),ai={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 Lf(e){const t={};return t[Ht(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ht(e,"fontSettings")]={...ai.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ht(e,"fontSize")]={...ai.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ht(e,"lineHeight")]={...ai.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ht(e,"letterSpacing")]={...ai.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ht(e,"wordSpacing")]={...ai.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ht(e,"textAlign")]={...ai.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ht(e,"textAppearance")]={...ai.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const If=Hi.reduce((e,t)=>({...e,...Lf(t)}),{}),Rf=Hi.reduce((e,t)=>({...e,[Ht(t,"fontFamily")]:"Goudy Bookletter 1911",[Ht(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ht(t,"letterSpacing")]:0,[Ht(t,"wordSpacing")]:0,[Ht(t,"textAlign")]:"left",[Ht(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Zr(e){return Hi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ht(n,"fontSize")]=i),o!==void 0&&(t[Ht(n,"lineHeight")]=o),t},{})}const Ef=vf(),kf={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"}}},thumbnailSize:{type:"number",scope:"layout",title:"Thumbnail Size",min:0,display:{type:"range-control"}},thumbnailGap:{type:"number",scope:"layout",title:"Thumbnail Gap",min:0,display:{type:"range-control"}},thumbnailMarginBottom:{type:"number",scope:"layout",title:"Thumbnail Margin Bottom",min:0,display:{type:"range-control"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"layout",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:"layout",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"layout",title:"Icon Hover",display:{type:"settings-color-picker"}},thumbnailVisibility:{type:"boolean",scope:"layout",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","none"]}},thumbnailActiveColor:{type:"string",scope:"layout",title:"Outline Active",display:{type:"palette-color-picker",visible:!1}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1Color:{type:"string",scope:"layout",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"layout",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"layout",title:"Caption Default",display:{type:"palette-color-picker"}},...If,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},iconMarginLeft:{type:"number",scope:"layout",title:"Icon margin left",min:0,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:Tf,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...Rf},layoutDefaults:{m:{thumbnailSize:.1,thumbnailVisibility:"off",titleHeaderLayout:"mobile",thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",title1Width:.25,title2Width:.6,title3Width:.25,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.04,titleRowMarginBottom:.08,closeIconMaxWidth:.04,contentMarginTop:.08,iconMarginLeft:.02,...Zr({title1FontSize:.042,title1LineHeight:.042,title2FontSize:.042,title2LineHeight:.042,title3FontSize:.042,title3LineHeight:.042})},t:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.039,contentMarginTop:.015,iconMarginLeft:.02,...Zr({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208})},d:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.02,contentMarginTop:.015,iconMarginLeft:.02,...Zr({title1FontSize:.011,title1LineHeight:.02,title2FontSize:.011,title2LineHeight:.02,title3FontSize:.011,title3LineHeight:.02})}},displayRules:[{if:{name:"thumbnailActive",value:"outline"},then:{name:"properties.thumbnailActiveColor.display.visible",value:!0}}],layout:["__componentName__","thumbnailGap","thumbnailMarginBottom","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","contentMarginTop","title1MarginLeft","iconMarginLeft"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",title:"Thumbnails",items:["thumbnailVisibility","thumbnailObjectFit"]},{type:"row",items:["thumbnailTrigger","thumbnailActive"]},{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:[Ef]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor","thumbnailActiveColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"}},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/Component-default-2.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"}]}},Mf={element:$f,id:"lightbox-strip",name:"Strip",category:"galleries",version:1,defaultSize:{d:{width:350},t:{width:300},m:{width:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Strip.mp4"},schema:kf,sourceCode:Cf,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Hi.map(e=>({path:`${Ht(e,"fontFamily")}`}))]},fontRelations:{...Hi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ht(t,"fontFamily")}`}),{})}},Pf=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,initialSlideIndex:s=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:m})=>{const{type:x,coverFit:b,backgroundColor:T,imageGap:f,maxWidth:L,maxHeight:$,textTransition:R,title1Width:E,title2Width:C,title3Width:U,title1MarginLeft:k=0,title2MarginLeft:j=0,title3MarginLeft:I=0,titleRowMarginBottom:w=0,titleHeaderLayout:W="single-row",countCloseGap:h=0,closeIcon:S,closeIconMaxWidth:M,closeIconColor:z,closeIconHoverColor:K,contentMarginTop:le=0,iconMarginRight:Y=0}=n,D=a.useCallback(te=>y.scalingValue(te,i??!1),[i]),N=D(f??0),F=`${L}%`,A=`${$}%`,q=D(h),G=D(le),Z=D(Y),_=ci("title1",si(n,"title1"),i),me=ci("title2",si(n,"title2"),i),v=ci("title3",si(n,"title3"),i),fe=ci("count",si(n,"count"),i),J=W==="mobile",de=!i||!!l,$e=!o&&(!i||!!l),oe=a.useMemo(()=>Yo(t,x),[t,x]),[xe,Q]=a.useState(s),ye=oe[xe],ve=ye==null?void 0:ye.entry,[ke,we]=a.useState(!1),[Me,X]=a.useState(null),[ue,Se]=a.useState(!1),[O,ce]=a.useState(null),[H,re]=a.useState(!1),[ae,ne]=a.useState(0),[ie,be]=a.useState(),[Ce,ee]=a.useState(),[pe,Ae]=a.useState(null),se=a.useRef(null),V=a.useRef(0),je=a.useRef(0),We=a.useRef(0),et=a.useRef(!1),Ye=a.useRef(null),st=a.useRef(null),mt=a.useRef(null),De=a.useRef(null),ot=a.useRef(null),$t=a.useRef(null),rt=a.useRef(null),Ue=a.useCallback(()=>{const te=st.current;if(!te)return;const Ee=te.closest(`.${e}-lightbox-content-area`);if(!Ee)return te.getBoundingClientRect().width;const p=Array.from(Ee.children).reduce((P,B)=>!(B instanceof HTMLElement)||B.contains(te)?P:P+B.getBoundingClientRect().width,0);return Ee.getBoundingClientRect().width-p},[e]),ht=a.useCallback(()=>{se.current&&(clearTimeout(se.current),se.current=null)},[]),xt=a.useCallback(te=>{te===V.current&&(ce(null),re(!1))},[]),dt=a.useCallback(()=>{o||et.current||(et.current=!0,u==null||u(),we(!1),Ye.current=setTimeout(()=>{m()},300))},[o,u,m]),kt=a.useCallback(te=>!!(te.closest("[data-controls]")||te.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:_t,backdropStyle:Qe,mediaAreaStyle:Tt,overlayContentStyle:Lt,swipeHandlers:Ge,dismissAreaStyle:qe}=mc({enabled:$e,onClose:dt,animMs:300,isBlockedTarget:kt}),Pe=a.useCallback(te=>{d&&Xs(te+1,c,!0)},[d,c]),gt=a.useCallback(te=>{if(te)return te.getBoundingClientRect().height},[]),It=a.useCallback(te=>{if(oe.length===0)return;const Ee=(te%oe.length+oe.length)%oe.length;if(Ee===xe)return;const p=oe[xe],P=oe[Ee];V.current+=1;const B=V.current,he=R==="fade"&&Il(p==null?void 0:p.entry)!==Il(P==null?void 0:P.entry),Le=gt(mt.current),He=he?(()=>{const yt=Ue();gi.flushSync(()=>{Ae(P.entry)}),mt.current&&yt&&(mt.current.style.width=`${yt}px`);const tn=gt(mt.current);return mt.current&&(mt.current.style.width=""),{measuredIncomingTitlesHeight:tn,incomingTitlesMeasureWidth:yt}})():void 0,at=Math.max(Le??0,(He==null?void 0:He.measuredIncomingTitlesHeight)??0)||void 0;ne(B),ce(xe),re(!0),Q(Ee),Pe(Ee),We.current=Ee,he?(ht(),at&&be(at),He!=null&&He.incomingTitlesMeasureWidth&&ee(He.incomingTitlesMeasureWidth),X((p==null?void 0:p.entryIndex)??null),Se(!0),je.current=P.entryIndex,se.current=setTimeout(()=>{X(null),Se(!1),be(void 0),ee(void 0),Ae(null),se.current=null},400)):(ht(),X(null),Se(!1),be(void 0),ee(void 0),Ae(null),je.current=P.entryIndex)},[xe,ht,Ue,gt,oe,Pe,R]),Mt=a.useCallback(()=>{rt.current=null},[]),Dt=a.useCallback(te=>{!de||oe.length<=1||te.pointerType==="mouse"&&te.button!==0||te.target.closest("[data-controls]")||(rt.current={startX:te.clientX,startY:te.clientY,pointerId:te.pointerId})},[de,oe.length]),en=a.useCallback(te=>{var yt;if(!de||oe.length<=1||te.pointerType==="mouse"&&te.button!==0)return;if(_t){Mt();return}const Ee=rt.current;if(!Ee||Ee.pointerId!==te.pointerId||(Mt(),te.target.closest("[data-controls]")))return;const P=te.clientX-Ee.startX,B=te.clientY-Ee.startY,he=Math.abs(P),Le=Math.abs(B);if(he>=Gm&&he>Le){It(P>0?xe-1:xe+1);return}if(he>$l||Le>$l)return;const He=(yt=De.current)==null?void 0:yt.getBoundingClientRect(),at=He?He.left+He.width/2:window.innerWidth/2;It(te.clientX<at?xe-1:xe+1)},[xe,de,It,_t,Mt,oe.length]),on=a.useCallback(te=>{const Ee=rt.current;(Ee==null?void 0:Ee.pointerId)===te.pointerId&&Mt()},[Mt]);gc(),a.useEffect(()=>{$t.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const te=requestAnimationFrame(()=>{we(!0),requestAnimationFrame(()=>{ot.current?ot.current.focus():De.current&&De.current.focus()})});return()=>{cancelAnimationFrame(te),Ye.current&&clearTimeout(Ye.current),se.current&&clearTimeout(se.current);const Ee=$t.current;Ee&&document.contains(Ee)&&Ee.focus({preventScroll:!0})}},[]),a.useEffect(()=>{var te;R!=="fade"&&(je.current=((te=oe[xe])==null?void 0:te.entryIndex)??0,ht(),X(null),Se(!1),be(void 0),ee(void 0))},[xe,ht,oe,R]),a.useEffect(()=>{const te=Ee=>{if(Ee.key==="Escape"){dt();return}if(Ee.key==="ArrowLeft"&&oe.length>1){It(xe-1);return}if(Ee.key==="ArrowRight"&&oe.length>1){It(xe+1);return}if(Ee.key==="Tab"&&De.current){const p=De.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),P=Array.from(p).filter(He=>!He.closest('[aria-hidden="true"]'));if(P.length===0)return;const B=P[0],he=P[P.length-1],Le=document.activeElement;Ee.shiftKey?(Le===B||!De.current.contains(Le))&&(Ee.preventDefault(),he.focus()):(Le===he||!De.current.contains(Le))&&(Ee.preventDefault(),B.focus())}};return window.addEventListener("keydown",te),()=>window.removeEventListener("keydown",te)},[It,dt,xe,oe.length]),a.useLayoutEffect(()=>{ht(),V.current=0,ne(0),ce(null),re(!1),X(null),Se(!1),be(void 0),ee(void 0),Ae(null),Q(te=>{const Ee=Math.max(0,oe.length-1);return Math.min(te,Ee)})},[ht,t.length,x,oe.length]),a.useLayoutEffect(()=>{var p;const te=Math.max(0,oe.length-1),Ee=Math.min(Math.max(0,s),te);We.current=Ee,je.current=((p=oe[Ee])==null?void 0:p.entryIndex)??0,Q(Ee)},[s]);const bt=Me!==null?t[Me]:null,Rt=O!==null?oe[O]:null,Ut=(ve==null?void 0:ve.title1)||(ve==null?void 0:ve.title2)||(ve==null?void 0:ve.title3)||(bt==null?void 0:bt.title1)||(bt==null?void 0:bt.title2)||(bt==null?void 0:bt.title3),Kt=Qm(x,oe,t),ft=S!==null,Jt=Ut||Kt||ft,Te=Kt&&ft?{gap:q}:void 0,Oe=`${e}-titles-stack${J?` ${e}-titles-stack-stacked`:""}`,Ke=`${e}-titles-layer-out${J?` ${e}-titles-layer-out-stacked`:""}`,Ne=`${e}-titles-layer-out`,ze=(k??0)>0||o,ut=D(w),_e=a.useMemo(()=>({title1Width:E??Ii.title1Width,title2Width:C??Ii.title2Width,title3Width:U??Ii.title3Width}),[E,C,U]),Je=a.useMemo(()=>({title2MarginLeft:j,title3MarginLeft:I}),[j,I]),tt=a.useMemo(()=>ve?Dn(e,ve,_,me,v):[],[e,ve,_,me,v]),Wt=a.useMemo(()=>tt.map(te=>_e[te.widthKey]),[tt,_e]),Ct=a.useMemo(()=>Pi(tt.length,Wt),[tt.length,Wt]),lt=a.useMemo(()=>po(tt.length,Wt),[tt.length,Wt]),Nt=a.useMemo(()=>tt.filter(te=>te.prefix==="title1"),[tt]),At=a.useMemo(()=>tt.filter(te=>te.prefix==="title2"||te.prefix==="title3"),[tt]),Vt=a.useMemo(()=>Vn(Nt,_e),[Nt,_e]),zt=a.useMemo(()=>Vn(At,_e),[At,_e]),Pt=a.useCallback((te,Ee)=>{const p=tt.findIndex(B=>B.prefix===te.prefix);if(!J||Ee==="single-row")return{effectiveWidth:lt[p]??0,resolvedWidth:Ct[p]??0,maxWidth:ln(p,Ct)};if(Ee==="two-row-top"){const B=Nt.findIndex(he=>he.prefix===te.prefix);return{effectiveWidth:Vt.effective[B]??0,resolvedWidth:Vt.resolved[B]??0,maxWidth:ln(B,Vt.resolved)}}const P=At.findIndex(B=>B.prefix===te.prefix);return{effectiveWidth:zt.effective[P]??0,resolvedWidth:zt.resolved[P]??0,maxWidth:ln(P,zt.resolved)}},[tt,At,zt,lt,Ct,Nt,Vt,J]),Qt=a.useCallback(te=>Qs(tt,Ct,Je,te)+(J?0:k??0),[tt,Ct,Je,J,k]),wt=a.useCallback(()=>J?0:k??0,[J,k]),Gt=a.useCallback(te=>At.slice(0,te).reduce((Ee,p,P)=>Ee+(p.marginLeftKey?Je[p.marginLeftKey]??0:0)+(zt.resolved[P]??0),0),[At,zt.resolved,Je]),pt=a.useCallback(te=>{const Ee=At[te];return Gt(te)+(Ee.marginLeftKey?Je[Ee.marginLeftKey]??0:0)+(zt.resolved[te]??0)},[At,zt.resolved,Gt,Je]),Ft=a.useCallback((te,Ee,p)=>{if(!J||p==="single-row"){const He=te.findIndex(Yt=>Yt.prefix===Ee.prefix),at=te.map(Yt=>_e[Yt.widthKey]),yt=Pi(te.length,at);return{effectiveWidth:po(te.length,at)[He]??0,resolvedWidth:yt[He]??0,maxWidth:ln(He,yt)}}if(p==="two-row-top"){const He=te.filter(Yt=>Yt.prefix==="title1"),at=He.findIndex(Yt=>Yt.prefix===Ee.prefix),{resolved:yt,effective:tn}=Vn(He,_e);return{effectiveWidth:tn[at]??0,resolvedWidth:yt[at]??0,maxWidth:ln(at,yt)}}const P=te.filter(He=>He.prefix==="title2"||He.prefix==="title3"),B=P.findIndex(He=>He.prefix===Ee.prefix),{resolved:he,effective:Le}=Vn(P,_e);return{effectiveWidth:Le[B]??0,resolvedWidth:he[B]??0,maxWidth:ln(B,he)}},[_e,J]),Bt=(te,Ee,p)=>{const P=te.marginLeftKey?Je[te.marginLeftKey]??0:0,{effectiveWidth:B,resolvedWidth:he,maxWidth:Le}=p??Pt(te,Ee),He=Math.max(P,Bn),at=o&&Ee==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":te.prefix,style:{width:D(B),...P>0?{marginLeft:D(P)}:{}},children:[r.jsx("p",{className:te.className,style:te.style,children:te.text}),at&&te.marginLeftKey?r.jsx("div",{"data-controls":te.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(he),style:{position:"absolute",top:0,left:D(-P),width:D(He),height:"100%",pointerEvents:"auto"}}):null,at?r.jsx("div",{"data-controls":te.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Le),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:D(-hn/2),width:D(hn),height:"100%",pointerEvents:"auto"}}):null]},te.className)},g=(te="two-row")=>{const Ee=tt.findIndex(B=>B.prefix==="title1"),p=Ee>=0?Ct[Ee]:_e.title1Width,P=te==="two-row"&&o;return r.jsx("div",{...P?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(p)}:{},style:{width:D(k??0),flexShrink:0,alignSelf:"stretch",...P?{pointerEvents:"auto"}:{}}})},ge=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:_,"aria-hidden":"true",children:" "}),Re=()=>r.jsx("span",{className:`${e}-entry-counter`,style:fe,"aria-live":"polite","aria-atomic":"true",children:Jm(oe,xe,x,t)}),Ie=()=>Kt?o&&ft?r.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Re(),r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Br(q)} + ${q}))`,width:Br(q),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Re():null,Ze=()=>!Kt&&!ft?null:r.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Te,children:[Ie(),ft?it():null]}),Et=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Kt||Ut?ge():null,ze?g("single-row"):null,St(ve),r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),Ze(),Sn()]}),Ve=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Kt||Ut?ge():null,ze?g("single-row"):null,r.jsxs("div",{className:`${e}-titles-row-titles`,style:ue&&ie?{minHeight:ie}:void 0,children:[r.jsx("div",{ref:mt,className:Oe,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Qn(pe||ve)}),r.jsxs("div",{ref:st,className:Oe,style:{position:ue?"absolute":"relative",inset:ue?0:void 0,width:"100%",...ue&&Ce?{width:Ce,maxWidth:"100%"}:void 0},children:[bt&&ue?r.jsx("div",{className:`${Ke} ${e}-titles-fade-out`,children:Qn(bt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ue?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:Qn(ve)})]})]}),Ze(),Sn()]}),it=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:y.scalingValue(M??0,i),height:y.scalingValue(M??0,i),marginRight:Z,"--close-icon-hover-color":K},children:[r.jsx("button",{ref:ot,type:"button",className:`${e}-close-icon-inner`,onClick:dt,"aria-label":"Close",children:r.jsx(rn,{url:S??"",fill:z,hoverFill:i&&!l?z:K,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:Z,height:"100%",pointerEvents:"auto"}})]}),jt=(te,Ee)=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[Kt||Ut?ge():null,ze?g("two-row"):null,Ee!==void 0?r.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Ee},children:te}):r.jsxs(r.Fragment,{children:[te,r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),Ze()]}),St=te=>{if(!te)return null;const Ee=Dn(e,te,_,me,v);return r.jsx(r.Fragment,{children:Ee.map(p=>Bt(p,"single-row",Ft(Ee,p,"single-row")))})},cn=te=>{if(!te)return null;const Ee=Dn(e,te,_,me,v),p=Ee.find(P=>P.prefix==="title1");return p?Bt(p,"two-row-top",Ft(Ee,p,"two-row-top")):null},un=(te,Ee=!1)=>{const p=te?Dn(e,te,_,me,v):[],P=p.filter(Le=>Le.prefix==="title2"||Le.prefix==="title3"),B=o&&Ee;return P.length>0||B||(w??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[P.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[P.map(Le=>Bt(Le,"two-row-bottom",Ft(p,Le,"two-row-bottom"))),Ee&&o?r.jsxs(r.Fragment,{children:[Rr(),Er()]}):null]}):null,(w??0)>0||B?r.jsx("div",{"data-controls":B?"titleRowMarginBottom":void 0,"data-controls-axis":B?"y":void 0,"data-controls-reverse":B?"":void 0,className:B?`${e}-control`:void 0,style:{height:ut,width:"100%",flexShrink:0,pointerEvents:B?"auto":"none"}}):null]}):null},Jn=(te,Ee=!1)=>r.jsxs(r.Fragment,{children:[jt(cn(te)),un(te,Ee)]}),Qn=te=>J?r.jsx("div",{className:`${e}-titles-row-two-row`,children:Jn(te)}):te?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:St(te)}):null,To=()=>{const te=J?-1:tt.findIndex(P=>P.prefix==="title1"),Ee=!J&&(o||(k??0)>0)?(()=>{const P=k??0,B=te>=0?Ct[te]:_e.title1Width,he=Math.max(P,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(B),style:{position:"absolute",top:0,left:0,width:D(he),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,p=tt.flatMap((P,B)=>{if(!P.marginLeftKey)return[];const he=Je[P.marginLeftKey]??0,Le=Js(tt,Ct,Je,B)+wt(),He=Math.max(he,Bn);return r.jsx("div",{"data-controls":P.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ct[B]),style:{position:"absolute",top:0,left:D(Le),width:D(He),height:"100%",pointerEvents:"auto"}},P.marginLeftKey)});return Ee?[Ee,...p]:p},Lo=()=>tt.map((te,Ee)=>{const p=ln(Ee,Ct),B=Qt(Ee)-hn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":te.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(p),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D(B),width:D(hn),height:"100%",pointerEvents:"auto"}})},`${te.widthKey}-junction`)}),Rr=()=>At.flatMap((te,Ee)=>{if(!te.marginLeftKey)return[];const p=Je[te.marginLeftKey]??0,P=Gt(Ee),B=Math.max(p,Bn),{resolvedWidth:he}=Pt(te,"two-row-bottom");return r.jsx("div",{"data-controls":te.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(he),style:{position:"absolute",top:0,left:D(P),width:D(B),height:"100%",pointerEvents:"auto"}},te.marginLeftKey)}),Er=()=>At.map((te,Ee)=>{const{maxWidth:p}=Pt(te,"two-row-bottom"),B=pt(Ee)-hn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":te.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(p),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D(B),width:D(hn),height:"100%",pointerEvents:"auto"}})},`${te.widthKey}-junction`)}),Sn=()=>!o||J?null:r.jsxs(r.Fragment,{children:[To(),Lo()]}),fi=te=>{const Ee=!te.objectFit&&Fn(b);return{className:`${e}-slide-image-cell${Ee?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:F,maxHeight:A,...Ee?{"--image-aspect-ratio":Lr(b)}:{}}}},Io=te=>te.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":te.objectFit}}:Fn(b)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ei=te=>{if(te.length===0)return null;const Ee=te.length>1,p=Br(N),P=`calc(-0.5 * (${p} + ${N}))`;if(te.length===1){const B=te[0];return r.jsx("div",{...fi(B),children:r.jsx("img",{...Io(B),src:B.url,alt:B.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:Ee?{gap:N}:void 0,children:te.map((B,he)=>r.jsxs("div",{...fi(B),children:[r.jsx("img",{...Io(B),src:B.url,alt:B.name??"",draggable:!1}),o&&Ee&&he<te.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:P,width:p,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${B.url}-${he}`))})},Ro=!!(ve!=null&&ve.title2||ve!=null&&ve.title3||bt!=null&&bt.title2||bt!=null&&bt.title3||(w??0)>0||o),kr=()=>r.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[r.jsx("div",{ref:mt,className:Oe,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Jn(pe||ve)}),r.jsxs("div",{ref:st,className:`${e}-titles-row-two-row`,style:{...ue&&ie?{minHeight:ie}:void 0,...ue&&Ce?{width:Ce,maxWidth:"100%"}:void 0},children:[jt(r.jsxs("div",{className:Oe,style:{position:ue?"absolute":"relative",inset:ue?0:void 0,width:"100%"},children:[bt&&ue?r.jsx("div",{className:`${Ne} ${e}-titles-fade-out`,children:cn(bt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ue?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:cn(ve)})]}),ue&&ie?ie:void 0),Ro?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[bt&&ue?r.jsx("div",{className:`${Ke} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:un(bt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ue?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${J?` ${e}-titles-layer-in-stacked`:""}`,children:un(ve,!0)})]}):null]})]}),Mr=()=>{const te=Ro;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...te?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:te?void 0:{flex:"0 0 auto",height:"auto"},children:Jn(ve,!0)}),Sn()]})};return r.jsxs("div",{ref:De,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{_t||dt()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:ft?void 0:-1,style:{opacity:ke?1:0,transition:"opacity 300ms ease",pointerEvents:ke?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:T,...Qe}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:qe,...Ge,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:Tt,onClick:te=>te.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":de&&oe.length>1?"true":"false",onPointerDown:de?Dt:void 0,onPointerUp:de?en:void 0,onPointerCancel:de?on:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[Rt&&H?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:te=>{te.target===te.currentTarget&&xt(ae)},children:r.jsx("div",{className:`${e}-slide-area`,children:ei(Rt.images)})},`slide-out-${ae}`):null,r.jsx("div",{className:`${e}-slide-layer-in${H?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:ye?ei(ye.images):null})},`slide-in-${ae}-${xe}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Lt,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:G,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...J?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${J?` ${e}-lightbox-content-area-stacked`:""}`,children:Jt&&r.jsx("div",{className:`${e}-text-bar-cell${J?` ${e}-text-bar-cell-stacked`:""}`,style:J?void 0:{flex:1,minWidth:0,width:"100%"},children:J?R==="fade"?kr():Mr():R==="fade"?Ve():Et()})})})]})]})]})};function Af(e){return`
|
|
14054
|
+
`,kf="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),ai={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 Pf(e){const t={};return t[Wt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Wt(e,"fontSettings")]={...ai.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Wt(e,"fontSize")]={...ai.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Wt(e,"lineHeight")]={...ai.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Wt(e,"letterSpacing")]={...ai.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Wt(e,"wordSpacing")]={...ai.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Wt(e,"textAlign")]={...ai.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Wt(e,"textAppearance")]={...ai.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Af=Oi.reduce((e,t)=>({...e,...Pf(t)}),{}),Ff=Oi.reduce((e,t)=>({...e,[Wt(t,"fontFamily")]:"Goudy Bookletter 1911",[Wt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Wt(t,"letterSpacing")]:0,[Wt(t,"wordSpacing")]:0,[Wt(t,"textAlign")]:"left",[Wt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Yr(e){return Oi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Wt(n,"fontSize")]=i),o!==void 0&&(t[Wt(n,"lineHeight")]=o),t},{})}const Wf=Cf(),_f={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"}}},thumbnailSize:{type:"number",scope:"layout",title:"Thumbnail Size",min:0,display:{type:"range-control"}},thumbnailGap:{type:"number",scope:"layout",title:"Thumbnail Gap",min:0,display:{type:"range-control"}},thumbnailMarginBottom:{type:"number",scope:"layout",title:"Thumbnail Margin Bottom",min:0,display:{type:"range-control"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"layout",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:"layout",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"layout",title:"Icon Hover",display:{type:"settings-color-picker"}},thumbnailVisibility:{type:"boolean",scope:"layout",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","none"]}},thumbnailActiveColor:{type:"string",scope:"layout",title:"Outline Active",display:{type:"palette-color-picker",visible:!1}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1Color:{type:"string",scope:"layout",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"layout",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"layout",title:"Caption Default",display:{type:"palette-color-picker"}},...Af,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},iconMarginLeft:{type:"number",scope:"layout",title:"Icon margin left",min:0,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:kf,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...Ff},layoutDefaults:{m:{thumbnailSize:.1,thumbnailVisibility:"off",titleHeaderLayout:"mobile",thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",title1Width:.25,title2Width:.6,title3Width:.25,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.04,titleRowMarginBottom:.08,closeIconMaxWidth:.04,contentMarginTop:.08,iconMarginLeft:.02,...Yr({title1FontSize:.042,title1LineHeight:.042,title2FontSize:.042,title2LineHeight:.042,title3FontSize:.042,title3LineHeight:.042})},t:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.039,contentMarginTop:.015,iconMarginLeft:.02,...Yr({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208})},d:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.02,contentMarginTop:.015,iconMarginLeft:.02,...Yr({title1FontSize:.011,title1LineHeight:.02,title2FontSize:.011,title2LineHeight:.02,title3FontSize:.011,title3LineHeight:.02})}},displayRules:[{if:{name:"thumbnailActive",value:"outline"},then:{name:"properties.thumbnailActiveColor.display.visible",value:!0}}],layout:["__componentName__","thumbnailGap","thumbnailMarginBottom","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","contentMarginTop","title1MarginLeft","iconMarginLeft"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",title:"Thumbnails",items:["thumbnailVisibility","thumbnailObjectFit"]},{type:"row",items:["thumbnailTrigger","thumbnailActive"]},{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:[Wf]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor","thumbnailActiveColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"}},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/Component-default-2.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"}]}},Hf={element:Ef,id:"lightbox-strip",name:"Strip",category:"galleries",version:1,defaultSize:{d:{width:350},t:{width:300},m:{width:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Strip.mp4"},schema:_f,sourceCode:Mf,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Oi.map(e=>({path:`${Wt(e,"fontFamily")}`}))]},fontRelations:{...Oi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Wt(t,"fontFamily")}`}),{})}},Nf=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,initialSlideIndex:s=0,enableUrlSync:c=!1,journalItemId:d=null,onBeforeClose:u,onClose:m})=>{const{type:x,coverFit:w,backgroundColor:$,imageGap:f,maxWidth:S,maxHeight:L,textTransition:M,title1Width:A,title2Width:C,title3Width:J,title1MarginLeft:k=0,title2MarginLeft:U=0,title3MarginLeft:I=0,titleRowMarginBottom:R=0,titleHeaderLayout:T="single-row",countCloseGap:y=0,closeIcon:h,closeIconMaxWidth:F,closeIconColor:W,closeIconHoverColor:V,contentMarginTop:ne=0,iconMarginRight:X=0}=n,z=a.useCallback(te=>v.scalingValue(te,i??!1),[i]),H=z(f??0),_=`${S}%`,E=`${L}%`,q=z(y),Y=z(ne),ee=z(X),N=ci("title1",si(n,"title1"),i),pe=ci("title2",si(n,"title2"),i),b=ci("title3",si(n,"title3"),i),ye=ci("count",si(n,"count"),i),Q=T==="mobile",xe=!i||!!l,$e=!o&&(!i||!!l),oe=a.useMemo(()=>Xo(t,x),[t,x]),[ie,B]=a.useState(s),le=oe[ie],re=le==null?void 0:le.entry,[ke,fe]=a.useState(!1),[Pe,ve]=a.useState(null),[we,Se]=a.useState(!1),[G,me]=a.useState(null),[D,K]=a.useState(!1),[ae,ge]=a.useState(0),[ce,be]=a.useState(),[Ee,Z]=a.useState(),[de,We]=a.useState(null),se=a.useRef(null),O=a.useRef(0),Oe=a.useRef(0),_e=a.useRef(0),nt=a.useRef(!1),Ue=a.useRef(null),Ce=a.useRef(null),Fe=a.useRef(null),He=a.useRef(null),Ze=a.useRef(null),Tt=a.useRef(null),it=a.useRef(null),De=a.useCallback(()=>{const te=Ce.current;if(!te)return;const Me=te.closest(`.${e}-lightbox-content-area`);if(!Me)return te.getBoundingClientRect().width;const p=Array.from(Me.children).reduce((P,j)=>!(j instanceof HTMLElement)||j.contains(te)?P:P+j.getBoundingClientRect().width,0);return Me.getBoundingClientRect().width-p},[e]),et=a.useCallback(()=>{se.current&&(clearTimeout(se.current),se.current=null)},[]),dt=a.useCallback(te=>{te===O.current&&(me(null),K(!1))},[]),lt=a.useCallback(()=>{o||nt.current||(nt.current=!0,u==null||u(),fe(!1),Ue.current=setTimeout(()=>{m()},300))},[o,u,m]),ht=a.useCallback(te=>!!(te.closest("[data-controls]")||te.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:Rt,backdropStyle:ot,mediaAreaStyle:xt,overlayContentStyle:zt,swipeHandlers:rt,dismissAreaStyle:qe}=hc({enabled:$e,onClose:lt,animMs:300,isBlockedTarget:ht}),Ne=a.useCallback(te=>{c&&Zs(te+1,d,!0)},[c,d]),pt=a.useCallback(te=>{if(te)return te.getBoundingClientRect().height},[]),yt=a.useCallback(te=>{if(oe.length===0)return;const Me=(te%oe.length+oe.length)%oe.length;if(Me===ie)return;const p=oe[ie],P=oe[Me];O.current+=1;const j=O.current,he=M==="fade"&&Il(p==null?void 0:p.entry)!==Il(P==null?void 0:P.entry),Ie=pt(Fe.current),Be=he?(()=>{const St=De();gi.flushSync(()=>{We(P.entry)}),Fe.current&&St&&(Fe.current.style.width=`${St}px`);const tn=pt(Fe.current);return Fe.current&&(Fe.current.style.width=""),{measuredIncomingTitlesHeight:tn,incomingTitlesMeasureWidth:St}})():void 0,ct=Math.max(Ie??0,(Be==null?void 0:Be.measuredIncomingTitlesHeight)??0)||void 0;ge(j),me(ie),K(!0),B(Me),Ne(Me),_e.current=Me,he?(et(),ct&&be(ct),Be!=null&&Be.incomingTitlesMeasureWidth&&Z(Be.incomingTitlesMeasureWidth),ve((p==null?void 0:p.entryIndex)??null),Se(!0),Oe.current=P.entryIndex,se.current=setTimeout(()=>{ve(null),Se(!1),be(void 0),Z(void 0),We(null),se.current=null},400)):(et(),ve(null),Se(!1),be(void 0),Z(void 0),We(null),Oe.current=P.entryIndex)},[ie,et,De,pt,oe,Ne,M]),Mt=a.useCallback(()=>{it.current=null},[]),Dt=a.useCallback(te=>{!xe||oe.length<=1||te.pointerType==="mouse"&&te.button!==0||te.target.closest("[data-controls]")||(it.current={startX:te.clientX,startY:te.clientY,pointerId:te.pointerId})},[xe,oe.length]),en=a.useCallback(te=>{var St;if(!xe||oe.length<=1||te.pointerType==="mouse"&&te.button!==0)return;if(Rt){Mt();return}const Me=it.current;if(!Me||Me.pointerId!==te.pointerId||(Mt(),te.target.closest("[data-controls]")))return;const P=te.clientX-Me.startX,j=te.clientY-Me.startY,he=Math.abs(P),Ie=Math.abs(j);if(he>=Zm&&he>Ie){yt(P>0?ie-1:ie+1);return}if(he>$l||Ie>$l)return;const Be=(St=He.current)==null?void 0:St.getBoundingClientRect(),ct=Be?Be.left+Be.width/2:window.innerWidth/2;yt(te.clientX<ct?ie-1:ie+1)},[ie,xe,yt,Rt,Mt,oe.length]),sn=a.useCallback(te=>{const Me=it.current;(Me==null?void 0:Me.pointerId)===te.pointerId&&Mt()},[Mt]);fc(),a.useEffect(()=>{Tt.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const te=requestAnimationFrame(()=>{fe(!0),requestAnimationFrame(()=>{Ze.current?Ze.current.focus():He.current&&He.current.focus()})});return()=>{cancelAnimationFrame(te),Ue.current&&clearTimeout(Ue.current),se.current&&clearTimeout(se.current);const Me=Tt.current;Me&&document.contains(Me)&&Me.focus({preventScroll:!0})}},[]),a.useEffect(()=>{var te;M!=="fade"&&(Oe.current=((te=oe[ie])==null?void 0:te.entryIndex)??0,et(),ve(null),Se(!1),be(void 0),Z(void 0))},[ie,et,oe,M]),a.useEffect(()=>{const te=Me=>{if(Me.key==="Escape"){lt();return}if(Me.key==="ArrowLeft"&&oe.length>1){yt(ie-1);return}if(Me.key==="ArrowRight"&&oe.length>1){yt(ie+1);return}if(Me.key==="Tab"&&He.current){const p=He.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),P=Array.from(p).filter(Be=>!Be.closest('[aria-hidden="true"]'));if(P.length===0)return;const j=P[0],he=P[P.length-1],Ie=document.activeElement;Me.shiftKey?(Ie===j||!He.current.contains(Ie))&&(Me.preventDefault(),he.focus()):(Ie===he||!He.current.contains(Ie))&&(Me.preventDefault(),j.focus())}};return window.addEventListener("keydown",te),()=>window.removeEventListener("keydown",te)},[yt,lt,ie,oe.length]),a.useLayoutEffect(()=>{et(),O.current=0,ge(0),me(null),K(!1),ve(null),Se(!1),be(void 0),Z(void 0),We(null),B(te=>{const Me=Math.max(0,oe.length-1);return Math.min(te,Me)})},[et,t.length,x,oe.length]),a.useLayoutEffect(()=>{var p;const te=Math.max(0,oe.length-1),Me=Math.min(Math.max(0,s),te);_e.current=Me,Oe.current=((p=oe[Me])==null?void 0:p.entryIndex)??0,B(Me)},[s]);const Lt=Pe!==null?t[Pe]:null,Et=G!==null?oe[G]:null,Qt=(re==null?void 0:re.title1)||(re==null?void 0:re.title2)||(re==null?void 0:re.title3)||(Lt==null?void 0:Lt.title1)||(Lt==null?void 0:Lt.title2)||(Lt==null?void 0:Lt.title3),Ut=rg(x,oe,t),ft=h!==null,qt=Qt||Ut||ft,Re=Ut&&ft?{gap:q}:void 0,Ve=`${e}-titles-stack${Q?` ${e}-titles-stack-stacked`:""}`,Xe=`${e}-titles-layer-out${Q?` ${e}-titles-layer-out-stacked`:""}`,ze=`${e}-titles-layer-out`,mt=(k??0)>0||o,Nt=z(R),Ae=a.useMemo(()=>({title1Width:A??Ri.title1Width,title2Width:C??Ri.title2Width,title3Width:J??Ri.title3Width}),[A,C,J]),Ye=a.useMemo(()=>({title2MarginLeft:U,title3MarginLeft:I}),[U,I]),Je=a.useMemo(()=>re?Vn(e,re,N,pe,b):[],[e,re,N,pe,b]),bt=a.useMemo(()=>Je.map(te=>Ae[te.widthKey]),[Je,Ae]),$t=a.useMemo(()=>Ai(Je.length,bt),[Je.length,bt]),ut=a.useMemo(()=>po(Je.length,bt),[Je.length,bt]),Pt=a.useMemo(()=>Je.filter(te=>te.prefix==="title1"),[Je]),At=a.useMemo(()=>Je.filter(te=>te.prefix==="title2"||te.prefix==="title3"),[Je]),Vt=a.useMemo(()=>Gn(Pt,Ae),[Pt,Ae]),Kt=a.useMemo(()=>Gn(At,Ae),[At,Ae]),Ft=a.useCallback((te,Me)=>{const p=Je.findIndex(j=>j.prefix===te.prefix);if(!Q||Me==="single-row")return{effectiveWidth:ut[p]??0,resolvedWidth:$t[p]??0,maxWidth:an(p,$t)};if(Me==="two-row-top"){const j=Pt.findIndex(he=>he.prefix===te.prefix);return{effectiveWidth:Vt.effective[j]??0,resolvedWidth:Vt.resolved[j]??0,maxWidth:an(j,Vt.resolved)}}const P=At.findIndex(j=>j.prefix===te.prefix);return{effectiveWidth:Kt.effective[P]??0,resolvedWidth:Kt.resolved[P]??0,maxWidth:an(P,Kt.resolved)}},[Je,At,Kt,ut,$t,Pt,Vt,Q]),Yt=a.useCallback(te=>tc(Je,$t,Ye,te)+(Q?0:k??0),[Je,$t,Ye,Q,k]),wt=a.useCallback(()=>Q?0:k??0,[Q,k]),Ot=a.useCallback(te=>At.slice(0,te).reduce((Me,p,P)=>Me+(p.marginLeftKey?Ye[p.marginLeftKey]??0:0)+(Kt.resolved[P]??0),0),[At,Kt.resolved,Ye]),jt=a.useCallback(te=>{const Me=At[te];return Ot(te)+(Me.marginLeftKey?Ye[Me.marginLeftKey]??0:0)+(Kt.resolved[te]??0)},[At,Kt.resolved,Ot,Ye]),Bt=a.useCallback((te,Me,p)=>{if(!Q||p==="single-row"){const Be=te.findIndex(Zt=>Zt.prefix===Me.prefix),ct=te.map(Zt=>Ae[Zt.widthKey]),St=Ai(te.length,ct);return{effectiveWidth:po(te.length,ct)[Be]??0,resolvedWidth:St[Be]??0,maxWidth:an(Be,St)}}if(p==="two-row-top"){const Be=te.filter(Zt=>Zt.prefix==="title1"),ct=Be.findIndex(Zt=>Zt.prefix===Me.prefix),{resolved:St,effective:tn}=Gn(Be,Ae);return{effectiveWidth:tn[ct]??0,resolvedWidth:St[ct]??0,maxWidth:an(ct,St)}}const P=te.filter(Be=>Be.prefix==="title2"||Be.prefix==="title3"),j=P.findIndex(Be=>Be.prefix===Me.prefix),{resolved:he,effective:Ie}=Gn(P,Ae);return{effectiveWidth:Ie[j]??0,resolvedWidth:he[j]??0,maxWidth:an(j,he)}},[Ae,Q]),vt=(te,Me,p)=>{const P=te.marginLeftKey?Ye[te.marginLeftKey]??0:0,{effectiveWidth:j,resolvedWidth:he,maxWidth:Ie}=p??Ft(te,Me),Be=Math.max(P,Dn),ct=o&&Me==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":te.prefix,style:{width:z(j),...P>0?{marginLeft:z(P)}:{}},children:[r.jsx("p",{className:te.className,style:te.style,children:te.text}),ct&&te.marginLeftKey?r.jsx("div",{"data-controls":te.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(he),style:{position:"absolute",top:0,left:z(-P),width:z(Be),height:"100%",pointerEvents:"auto"}}):null,ct?r.jsx("div",{"data-controls":te.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ie),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:z(-hn/2),width:z(hn),height:"100%",pointerEvents:"auto"}}):null]},te.className)},g=(te="two-row")=>{const Me=Je.findIndex(j=>j.prefix==="title1"),p=Me>=0?$t[Me]:Ae.title1Width,P=te==="two-row"&&o;return r.jsx("div",{...P?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(p)}:{},style:{width:z(k??0),flexShrink:0,alignSelf:"stretch",...P?{pointerEvents:"auto"}:{}}})},ue=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:N,"aria-hidden":"true",children:" "}),Te=()=>r.jsx("span",{className:`${e}-entry-counter`,style:ye,"aria-live":"polite","aria-atomic":"true",children:og(oe,ie,x,t)}),Le=()=>Ut?o&&ft?r.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Te(),r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${zr(q)} + ${q}))`,width:zr(q),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Te():null,tt=()=>!Ut&&!ft?null:r.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Re,children:[Le(),ft?st():null]}),kt=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ut||Qt?ue():null,mt?g("single-row"):null,It(re),r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),tt(),Sn()]}),Ke=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ut||Qt?ue():null,mt?g("single-row"):null,r.jsxs("div",{className:`${e}-titles-row-titles`,style:we&&ce?{minHeight:ce}:void 0,children:[r.jsx("div",{ref:Fe,className:Ve,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ei(de||re)}),r.jsxs("div",{ref:Ce,className:Ve,style:{position:we?"absolute":"relative",inset:we?0:void 0,width:"100%",...we&&Ee?{width:Ee,maxWidth:"100%"}:void 0},children:[Lt&&we?r.jsx("div",{className:`${Xe} ${e}-titles-fade-out`,children:ei(Lt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${we?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:ei(re)})]})]}),tt(),Sn()]}),st=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:v.scalingValue(F??0,i),height:v.scalingValue(F??0,i),marginRight:ee,"--close-icon-hover-color":V},children:[r.jsx("button",{ref:Ze,type:"button",className:`${e}-close-icon-inner`,onClick:lt,"aria-label":"Close",children:r.jsx(on,{url:h??"",fill:W,hoverFill:i&&!l?W:V,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ee,height:"100%",pointerEvents:"auto"}})]}),_t=(te,Me)=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[Ut||Qt?ue():null,mt?g("two-row"):null,Me!==void 0?r.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Me},children:te}):r.jsxs(r.Fragment,{children:[te,r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),tt()]}),It=te=>{if(!te)return null;const Me=Vn(e,te,N,pe,b);return r.jsx(r.Fragment,{children:Me.map(p=>vt(p,"single-row",Bt(Me,p,"single-row")))})},cn=te=>{if(!te)return null;const Me=Vn(e,te,N,pe,b),p=Me.find(P=>P.prefix==="title1");return p?vt(p,"two-row-top",Bt(Me,p,"two-row-top")):null},un=(te,Me=!1)=>{const p=te?Vn(e,te,N,pe,b):[],P=p.filter(Ie=>Ie.prefix==="title2"||Ie.prefix==="title3"),j=o&&Me;return P.length>0||j||(R??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[P.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[P.map(Ie=>vt(Ie,"two-row-bottom",Bt(p,Ie,"two-row-bottom"))),Me&&o?r.jsxs(r.Fragment,{children:[Ir(),Rr()]}):null]}):null,(R??0)>0||j?r.jsx("div",{"data-controls":j?"titleRowMarginBottom":void 0,"data-controls-axis":j?"y":void 0,"data-controls-reverse":j?"":void 0,className:j?`${e}-control`:void 0,style:{height:Nt,width:"100%",flexShrink:0,pointerEvents:j?"auto":"none"}}):null]}):null},Qn=(te,Me=!1)=>r.jsxs(r.Fragment,{children:[_t(cn(te)),un(te,Me)]}),ei=te=>Q?r.jsx("div",{className:`${e}-titles-row-two-row`,children:Qn(te)}):te?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:It(te)}):null,To=()=>{const te=Q?-1:Je.findIndex(P=>P.prefix==="title1"),Me=!Q&&(o||(k??0)>0)?(()=>{const P=k??0,j=te>=0?$t[te]:Ae.title1Width,he=Math.max(P,Dn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(j),style:{position:"absolute",top:0,left:0,width:z(he),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,p=Je.flatMap((P,j)=>{if(!P.marginLeftKey)return[];const he=Ye[P.marginLeftKey]??0,Ie=ec(Je,$t,Ye,j)+wt(),Be=Math.max(he,Dn);return r.jsx("div",{"data-controls":P.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String($t[j]),style:{position:"absolute",top:0,left:z(Ie),width:z(Be),height:"100%",pointerEvents:"auto"}},P.marginLeftKey)});return Me?[Me,...p]:p},Lo=()=>Je.map((te,Me)=>{const p=an(Me,$t),j=Yt(Me)-hn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":te.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(p),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:z(j),width:z(hn),height:"100%",pointerEvents:"auto"}})},`${te.widthKey}-junction`)}),Ir=()=>At.flatMap((te,Me)=>{if(!te.marginLeftKey)return[];const p=Ye[te.marginLeftKey]??0,P=Ot(Me),j=Math.max(p,Dn),{resolvedWidth:he}=Ft(te,"two-row-bottom");return r.jsx("div",{"data-controls":te.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(he),style:{position:"absolute",top:0,left:z(P),width:z(j),height:"100%",pointerEvents:"auto"}},te.marginLeftKey)}),Rr=()=>At.map((te,Me)=>{const{maxWidth:p}=Ft(te,"two-row-bottom"),j=jt(Me)-hn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":te.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(p),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:z(j),width:z(hn),height:"100%",pointerEvents:"auto"}})},`${te.widthKey}-junction`)}),Sn=()=>!o||Q?null:r.jsxs(r.Fragment,{children:[To(),Lo()]}),fi=te=>{const Me=!te.objectFit&&Fn(w);return{className:`${e}-slide-image-cell${Me?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:_,maxHeight:E,...Me?{"--image-aspect-ratio":Tr(w)}:{}}}},Io=te=>te.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":te.objectFit}}:Fn(w)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ti=te=>{if(te.length===0)return null;const Me=te.length>1,p=zr(H),P=`calc(-0.5 * (${p} + ${H}))`;if(te.length===1){const j=te[0];return r.jsx("div",{...fi(j),children:r.jsx("img",{...Io(j),src:j.url,alt:j.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:Me?{gap:H}:void 0,children:te.map((j,he)=>r.jsxs("div",{...fi(j),children:[r.jsx("img",{...Io(j),src:j.url,alt:j.name??"",draggable:!1}),o&&Me&&he<te.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:P,width:p,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${j.url}-${he}`))})},Ro=!!(re!=null&&re.title2||re!=null&&re.title3||Lt!=null&&Lt.title2||Lt!=null&&Lt.title3||(R??0)>0||o),Er=()=>r.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[r.jsx("div",{ref:Fe,className:Ve,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Qn(de||re)}),r.jsxs("div",{ref:Ce,className:`${e}-titles-row-two-row`,style:{...we&&ce?{minHeight:ce}:void 0,...we&&Ee?{width:Ee,maxWidth:"100%"}:void 0},children:[_t(r.jsxs("div",{className:Ve,style:{position:we?"absolute":"relative",inset:we?0:void 0,width:"100%"},children:[Lt&&we?r.jsx("div",{className:`${ze} ${e}-titles-fade-out`,children:cn(Lt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${we?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:cn(re)})]}),we&&ce?ce:void 0),Ro?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[Lt&&we?r.jsx("div",{className:`${Xe} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:un(Lt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${we?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${Q?` ${e}-titles-layer-in-stacked`:""}`,children:un(re,!0)})]}):null]})]}),Mr=()=>{const te=Ro;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...te?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:te?void 0:{flex:"0 0 auto",height:"auto"},children:Qn(re,!0)}),Sn()]})};return r.jsxs("div",{ref:He,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{Rt||lt()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:ft?void 0:-1,style:{opacity:ke?1:0,transition:"opacity 300ms ease",pointerEvents:ke?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:$,...ot}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:qe,...rt,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:xt,onClick:te=>te.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":xe&&oe.length>1?"true":"false",onPointerDown:xe?Dt:void 0,onPointerUp:xe?en:void 0,onPointerCancel:xe?sn:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[Et&&D?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:te=>{te.target===te.currentTarget&&dt(ae)},children:r.jsx("div",{className:`${e}-slide-area`,children:ti(Et.images)})},`slide-out-${ae}`):null,r.jsx("div",{className:`${e}-slide-layer-in${D?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:le?ti(le.images):null})},`slide-in-${ae}-${ie}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:zt,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:Y,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...Q?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${Q?` ${e}-lightbox-content-area-stacked`:""}`,children:qt&&r.jsx("div",{className:`${e}-text-bar-cell${Q?` ${e}-text-bar-cell-stacked`:""}`,style:Q?void 0:{flex:1,minWidth:0,width:"100%"},children:Q?M==="fade"?Er():Mr():M==="fade"?Ke():kt()})})})]})]})]})};function Of(e){return`
|
|
13977
14055
|
.${e}-wrapper {
|
|
13978
14056
|
position: relative;
|
|
13979
14057
|
width: 100%;
|
|
@@ -14507,7 +14585,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
14507
14585
|
pointer-events: auto;
|
|
14508
14586
|
z-index: 10;
|
|
14509
14587
|
}
|
|
14510
|
-
`}const
|
|
14588
|
+
`}const jf=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:l,metadata:s})=>{const{prefix:c}=v.useScopedStyles(),d=(s==null?void 0:s.itemId)??null,{cover:u,coverFit:m,type:x}=e,w=a.useRef(null),[$,f]=a.useState(!1),[S,L]=a.useState(0),M=a.useRef(!1),A=a.useRef(!1),C=a.useRef(!1),J=a.useMemo(()=>(t??[]).filter(y=>Pi(y).length>0),[t]),k=$&&J.length>0,U=!n,I=a.useCallback(()=>{U&&(C.current=!0,Qm(A.current,d),A.current=!1)},[U,d]),R=(y=0)=>{if(J.length===0||n&&!i&&!o)return;const h=Xo(J,x),F=Math.max(0,Math.min(y,h.length-1));if(L(F),U){const W=Js();Zs(F+1,d,W),A.current=!W}f(!0)},T=a.useCallback(()=>{f(!1),C.current=!1},[]);return a.useEffect(()=>{!n||i||o||f(!1)},[n,i,o]),a.useEffect(()=>{if(!U||M.current)return;M.current=!0;const y=Tl(d);if(!y)return;const h=Ll(y,Xo(J,x).length);h<0||(L(h),f(!0))},[J,d,U,x]),a.useEffect(()=>{if(!U)return;const y=()=>{if(C.current){C.current=!1,f(!1);return}const h=Tl(d);if(!h){f(!1);return}const F=Ll(h,Xo(J,x).length);if(F<0){f(!1);return}A.current=!1,L(F),f(!0)};return window.addEventListener("popstate",y),()=>window.removeEventListener("popstate",y)},[J,d,U,x]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:w,className:`${c}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Of(c)}}),u?r.jsx("button",{type:"button",className:`${c}-cover ${Fn(m)?`${c}-ratio-wrapper-cover`:`${c}-ratio-wrapper-fit`}`,onClick:()=>R(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...Fn(m)?{"--image-aspect-ratio":Tr(m)}:{}},"aria-label":"Open journal gallery",children:r.jsx("img",{className:`${c}-cover-image ${Fn(m)?`${c}-cover-image-cover`:`${c}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),k&&typeof document<"u"&&(()=>{const y=(l?document.getElementById(l):null)??document.body;return gi.createPortal(r.jsx(Nf,{prefix:c,entries:J,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:S,enableUrlSync:U,journalItemId:d,onBeforeClose:I,onClose:T}),y)})()]})},zf=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
|
|
14511
14589
|
import { createPortal } from 'react-dom';
|
|
14512
14590
|
import { CommonComponentProps } from '../props';
|
|
14513
14591
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -15275,7 +15353,7 @@ export type LightboxJournalSettings = {
|
|
|
15275
15353
|
closeIconColor: string;
|
|
15276
15354
|
closeIconHoverColor: string;
|
|
15277
15355
|
};
|
|
15278
|
-
`,_f="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),li={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 Nf(e){const t={};return t[Be(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Be(e,"fontSettings")]={...li.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Be(e,"fontSize")]={...li.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Be(e,"lineHeight")]={...li.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Be(e,"letterSpacing")]={...li.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Be(e,"wordSpacing")]={...li.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Be(e,"textAlign")]={...li.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Be(e,"textAppearance")]={...li.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Hf=Kn.reduce((e,t)=>({...e,...Nf(t)}),{}),jf=Kn.reduce((e,t)=>({...e,[Be(t,"fontFamily")]:"Goudy Bookletter 1911",[Be(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Be(t,"letterSpacing")]:0,[Be(t,"wordSpacing")]:0,[Be(t,"textAlign")]:"left",[Be(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Jr(e){return Kn.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Be(n,"fontSize")]=i),o!==void 0&&(t[Be(n,"lineHeight")]=o),t},{})}const Of=eg(),zf={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,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"}},textTransition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["none","fade"]}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},countCloseGap:{type:"number",scope:"layout",title:"Count / Close Gap",min:0,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"}},...Hf,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:_f,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...jf,countFontFamily:"Arial"},layoutDefaults:{m:{type:"B",imageGap:.01,maxHeight:80,maxWidth:80,closeIconMaxWidth:.08,contentMarginTop:.04,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.55,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,iconMarginRight:.01,countCloseGap:.04,...Jr({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04,countFontSize:.04,countLineHeight:.04})},t:{type:"A",imageGap:.05,maxHeight:80,maxWidth:40,closeIconMaxWidth:.03,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.16,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.03,...Jr({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208,countFontSize:.0208,countLineHeight:.0208})},d:{type:"A",maxHeight:80,maxWidth:40,imageGap:.05,closeIconMaxWidth:.0125,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.02,...Jr({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098,countFontSize:.008,countLineHeight:.0098})}},layout:["__componentName__","maxWidth","maxHeight","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","countCloseGap","contentMarginTop","iconMarginRight"]},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:["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:[Of]}],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:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"contain"},{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"contain"}]},{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"contain"}]},{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"contain"},{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"contain"}]},{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"contain"}]}]}},Bf={element:Ff,id:"lightbox-journal",name:"Journal",category:"galleries",version:1,defaultSize:{d:{width:350},t:{width:300},m:{width:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Journal.png"},schema:zf,sourceCode:Wf,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Kn.map(e=>({path:`${Be(e,"fontFamily")}`}))]},fontRelations:{...Kn.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Be(t,"fontFamily")}`}),{})}},Df={sizeType:"custom",value:700,min:400,max:700};function lr(e,t){return{widthPx:e,heightPx:e*t}}function fa(e,t,n,i,o,l){return{x:Math.min(Math.max(e,o/2),n-o/2),y:Math.min(Math.max(t,l/2),i-l/2)}}function Ql(e,t,n,i){const{heightPx:o}=lr(n,i);return fa(e/2,t/2,e,t,n,o)}function fc(e,t,n){for(const i of n){const{heightPx:o}=lr(i.widthPx,i.aspectRatio),l=i.widthPx/2,s=o/2;if(e>=i.x-l&&e<=i.x+l&&t>=i.y-s&&t<=i.y+s)return!0}return!1}function Vf(e,t,n,i,o,l,s,d){if(o==="system")return"none";const c=i.getBoundingClientRect(),u=document.elementFromPoint(c.left+e,c.top+t);return u&&u.closest("a")?"none":fc(e,t,n)||l==="area"?s??"none":d??"none"}function es(e,t,n){var d;const{sizeType:i,value:o,min:l,max:s}=t;return i==="custom"?o:i==="as is"?((d=n.get(e))==null?void 0:d.naturalWidth)??o:Math.round(Math.random()*(s-l)+l)}function Gf(e){return`
|
|
15356
|
+
`,Bf="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),li={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 Df(e){const t={};return t[Ge(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ge(e,"fontSettings")]={...li.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ge(e,"fontSize")]={...li.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ge(e,"lineHeight")]={...li.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ge(e,"letterSpacing")]={...li.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ge(e,"wordSpacing")]={...li.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ge(e,"textAlign")]={...li.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ge(e,"textAppearance")]={...li.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Vf=Un.reduce((e,t)=>({...e,...Df(t)}),{}),Gf=Un.reduce((e,t)=>({...e,[Ge(t,"fontFamily")]:"Goudy Bookletter 1911",[Ge(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ge(t,"letterSpacing")]:0,[Ge(t,"wordSpacing")]:0,[Ge(t,"textAlign")]:"left",[Ge(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Zr(e){return Un.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ge(n,"fontSize")]=i),o!==void 0&&(t[Ge(n,"lineHeight")]=o),t},{})}const qf=ag(),Kf={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,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"}},textTransition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["none","fade"]}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},countCloseGap:{type:"number",scope:"layout",title:"Count / Close Gap",min:0,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"}},...Vf,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:Bf,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...Gf,countFontFamily:"Arial"},layoutDefaults:{m:{type:"B",imageGap:.01,maxHeight:80,maxWidth:80,closeIconMaxWidth:.08,contentMarginTop:.04,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.55,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,iconMarginRight:.01,countCloseGap:.04,...Zr({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04,countFontSize:.04,countLineHeight:.04})},t:{type:"A",imageGap:.05,maxHeight:80,maxWidth:40,closeIconMaxWidth:.03,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.16,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.03,...Zr({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208,countFontSize:.0208,countLineHeight:.0208})},d:{type:"A",maxHeight:80,maxWidth:40,imageGap:.05,closeIconMaxWidth:.0125,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.02,...Zr({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098,countFontSize:.008,countLineHeight:.0098})}},layout:["__componentName__","maxWidth","maxHeight","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","countCloseGap","contentMarginTop","iconMarginRight"]},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:["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:[qf]}],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:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"contain"},{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"contain"}]},{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"contain"}]},{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"contain"},{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"contain"}]},{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"contain"}]}]}},Uf={element:jf,id:"lightbox-journal",name:"Journal",category:"galleries",version:1,defaultSize:{d:{width:350},t:{width:300},m:{width:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Journal.png"},schema:Kf,sourceCode:zf,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Un.map(e=>({path:`${Ge(e,"fontFamily")}`}))]},fontRelations:{...Un.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ge(t,"fontFamily")}`}),{})}},Xf={sizeType:"custom",value:700,min:400,max:700};function ar(e,t){return{widthPx:e,heightPx:e*t}}function ha(e,t,n,i,o,l){return{x:Math.min(Math.max(e,o/2),n-o/2),y:Math.min(Math.max(t,l/2),i-l/2)}}function Ql(e,t,n,i){const{heightPx:o}=ar(n,i);return ha(e/2,t/2,e,t,n,o)}function vc(e,t,n){for(const i of n){const{heightPx:o}=ar(i.widthPx,i.aspectRatio),l=i.widthPx/2,s=o/2;if(e>=i.x-l&&e<=i.x+l&&t>=i.y-s&&t<=i.y+s)return!0}return!1}function Yf(e,t,n,i,o,l,s,c){if(o==="system")return"none";const d=i.getBoundingClientRect(),u=document.elementFromPoint(d.left+e,d.top+t);return u&&u.closest("a")?"none":vc(e,t,n)||l==="area"?s??"none":c??"none"}function es(e,t,n){var c;const{sizeType:i,value:o,min:l,max:s}=t;return i==="custom"?o:i==="as is"?((c=n.get(e))==null?void 0:c.naturalWidth)??o:Math.round(Math.random()*(s-l)+l)}function Zf(e){return`
|
|
15279
15357
|
.${e}-root {
|
|
15280
15358
|
position: absolute;
|
|
15281
15359
|
top: 0;
|
|
@@ -15310,7 +15388,7 @@ export type LightboxJournalSettings = {
|
|
|
15310
15388
|
width: 32px;
|
|
15311
15389
|
height: 32px;
|
|
15312
15390
|
}
|
|
15313
|
-
`}function
|
|
15391
|
+
`}function Jf(e){return new Promise(t=>{const n=new Image;n.onload=()=>{t({aspectRatio:n.naturalHeight/n.naturalWidth,naturalWidth:n.naturalWidth})},n.onerror=()=>{t({aspectRatio:1,naturalWidth:700})},n.src=e})}async function Qf(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await Jf(i)]));return new Map(n)}function ey({settings:e,content:t=[],isEditor:n}){const{prefix:i}=v.useScopedStyles(),[o,l]=a.useState(null),[s,c]=a.useState([]),[d,u]=a.useState(0),m=a.useRef(0),[x,w]=a.useState({x:0,y:0}),[$,f]=a.useState("none"),S=a.useRef({x:0,y:0}),[L,M]=a.useState(!1),[A,C]=a.useState(!1),J=a.useRef(new Map),{imageSize:k=Xf,cursor:U="system",target:I="area",position:R="random",visible:T="all",defaultCursor:y=null,hoverCursor:h=null}=e,F=a.useMemo(()=>Zf(i),[i]),W=a.useCallback((H,_,E=s)=>{if(!o)return;const q=o.getBoundingClientRect(),Y=H-q.left,ee=_-q.top;w({x:Y,y:ee}),f(Yf(Y,ee,E,o,U,I,h,y))},[o,s,U,I,h,y]);a.useEffect(()=>{const H=[...t.map(E=>E.image.url),y,h].filter(E=>!!E);if(H.length===0){J.current=new Map,C(!0);return}let _=!1;return C(!1),Qf(H).then(E=>{_||(J.current=E,C(!0))}),()=>{_=!0}},[t,y,h]),a.useEffect(()=>{if(!o)return;const H=E=>{E.stopPropagation(),S.current={x:E.clientX,y:E.clientY},W(E.clientX,E.clientY)},_=()=>{L&&W(S.current.x,S.current.y)};return o.addEventListener("mousemove",H),window.addEventListener("scroll",_,!0),()=>{o.removeEventListener("mousemove",H),window.removeEventListener("scroll",_,!0)}},[o,L,W]),a.useEffect(()=>{!o||!L||W(S.current.x,S.current.y)},[s,o,L,W]),a.useEffect(()=>{L||f("none")},[L]);const V=(H,_,E,q={})=>{var ye;const Y=((ye=J.current.get(H.image.url))==null?void 0:ye.aspectRatio)??1,ee=es(H.image.url,k,J.current),{heightPx:N}=ar(ee,Y);let pe=0,b=0;return R==="same"?{x:pe,y:b}=Ql(_,E,ee,Y):(pe=q.x??Math.random()*_,b=q.y??Math.random()*E,{x:pe,y:b}=ha(pe,b,_,E,ee,N)),{id:m.current++,url:H.image.url,link:H.link,name:H.image.name,x:pe,y:b,xRatio:pe/_,yRatio:b/E,aspectRatio:Y,widthPx:ee}},ne=()=>{if(!o)return;const H=o.getBoundingClientRect(),_=H.width,E=H.height;_===0||E===0||c(q=>q.length===0?q:q.map(Y=>{const ee=k.sizeType==="random"?Y.widthPx:es(Y.url,k,J.current),{heightPx:N}=ar(ee,Y.aspectRatio);if(R==="same"){const{x:ye,y:Q}=Ql(_,E,ee,Y.aspectRatio);return{...Y,x:ye,y:Q,widthPx:ee}}const{x:pe,y:b}=ha(Y.xRatio*_,Y.yRatio*E,_,E,ee,N);return{...Y,x:pe,y:b,widthPx:ee}}))};a.useEffect(()=>{if(!o||t.length===0||!A)return;const H=o.getBoundingClientRect(),_=H.width,E=H.height,q=V(t[0],_,E);c([q]),u(1)},[k,R,o,t,A]),a.useEffect(()=>{if(!o)return;ne();const H=new ResizeObserver(ne);return H.observe(o),window.addEventListener("resize",ne),()=>{H.disconnect(),window.removeEventListener("resize",ne)}},[o,R,k,s.length]),a.useEffect(()=>{T==="last One"&&c(H=>H.length>0?[H[H.length-1]]:[])},[T]);const X=H=>{if(!o||t.length===0||!A)return;const _=o.getBoundingClientRect(),E=H.clientX-_.left,q=H.clientY-_.top;if(I==="image"&&!vc(E,q,s))return;let Y=0,ee=0;R==="on Click"?(Y=E,ee=q):R==="same"?(Y=_.width/2,ee=_.height/2):(Y=Math.random()*_.width,ee=Math.random()*_.height);const N=t[d],pe=V(N,_.width,_.height,{x:Y,y:ee}),b=T==="all"?[...s,pe]:[pe];c(b),u(ye=>ye>=t.length-1?0:ye+1),W(H.clientX,H.clientY,b)},z=U==="custom"&&$!=="none";return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:F}}),r.jsxs("div",{ref:l,onClick:X,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),className:`${i}-root`,style:{cursor:z?"none":"default"},children:[s.map(H=>r.jsx("div",{className:`${i}-wrapper`,style:{top:`${H.y}px`,left:`${H.x}px`,width:`${H.widthPx}px`,cursor:z?"none":"default"},children:I==="area"&&H.link?r.jsx("a",{href:H.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:r.jsx("img",{src:H.url,alt:H.name,className:`${i}-image`})}):r.jsx("img",{src:H.url,alt:H.name,className:`${i}-image`})},H.id)),L&&z&&r.jsx("div",{className:`${i}-cursor`,style:{left:`${x.x}px`,top:`${x.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${$}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const ty=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
15314
15392
|
import { CommonComponentProps } from '../props';
|
|
15315
15393
|
import { useScopedStyles } from '../utils/index';
|
|
15316
15394
|
|
|
@@ -15831,7 +15909,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
15831
15909
|
</>
|
|
15832
15910
|
);
|
|
15833
15911
|
}
|
|
15834
|
-
`,
|
|
15912
|
+
`,ny={type:"object",version:1,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"}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"Slider-1.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"Slider-2.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"Slider-3.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"Slider-4.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"Slider-5.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"Slider-6.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"Slider-7.png"},link:""}]},settings:{sizing:"manual",properties:{imageSize:{type:"object",scope:"layout",title:"Img Size",display:{type:"toggle-cycle-numeric-input",enum:["custom","as is","random"],inputs:{custom:"single","as is":"none",random:"range"},defaultValue:700,defaultMin:400,defaultMax:700},min:0,max:9999,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},cursor:{type:"string",scope:"common",title:"Cursor",display:{type:"toggle-cycle",enum:["system","custom"]}},target:{type:"string",scope:"common",title:"Target",display:{type:"toggle-cycle",enum:["area","image"]}},position:{type:"string",scope:"common",title:"Position",display:{type:"toggle-cycle",enum:["random","same","on Click"]}},visible:{type:"string",scope:"common",title:"Visible",display:{type:"toggle-cycle",enum:["all","last One"]}},defaultCursor:{type:["string","null"],scope:"common",title:"Default",display:{type:"settings-image-input",visible:!1}},hoverCursor:{type:["string","null"],scope:"common",title:"Hover",display:{type:"settings-image-input",visible:!1}}},defaults:{imageSize:{sizeType:"custom",value:700,min:400,max:700},cursor:"system",target:"area",position:"random",visible:"all",defaultCursor:null,hoverCursor:null},layoutDefaults:{m:{imageSize:{sizeType:"custom",value:500,min:400,max:700}},t:{imageSize:{sizeType:"custom",value:600,min:400,max:700}},d:{imageSize:{sizeType:"custom",value:700,min:400,max:700}}},displayRules:[{if:{name:"cursor",value:"custom"},then:{name:"properties.defaultCursor.display.visible",value:!0}},{if:{name:"cursor",value:"custom"},then:{name:"properties.hoverCursor.display.visible",value:!0}}],layout:["__componentName__","imageSize","cursor","target","position","visible","defaultCursor","hoverCursor"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["imageSize"]},{type:"row",title:"",items:["cursor","target"]},{type:"row",title:"",items:["position","visible"]},{type:"row",title:"Custom Cursor",items:["defaultCursor","hoverCursor"]}]}]},iy={element:ey,id:"click-gallerie",name:"Click",category:"galleries",version:1,defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Click_Gallery.mp4"},schema:ny,sourceCode:ty,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"defaultCursor"},{path:"hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]}},oy=100,ry=70,jn="cubic-bezier(0.86, 0, 0.07, 1)";function ay(e){return`
|
|
15835
15913
|
.${e}-wrapper {
|
|
15836
15914
|
position: relative;
|
|
15837
15915
|
width: 100%;
|
|
@@ -15941,7 +16019,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
15941
16019
|
display: block;
|
|
15942
16020
|
pointer-events: none;
|
|
15943
16021
|
}
|
|
15944
|
-
`}function
|
|
16022
|
+
`}function ly(e){return e==="blur"?ry:e==="greyscale"?oy:0}function Xi(e,t=1,n=1){const i=ly(e)*Math.max(0,Math.min(1,t));if(e==="greyscale")return`grayscale(${i}%)`;if(e==="blur"){const o=i/4;return o<=0?"none":`blur(${o/Math.max(n,1)}px)`}return"none"}function ts(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function sy(e,t){return t<=1?0:(e-1+t)%t}function cy(e,t=1){return!e||e.height===0?t:e.width/e.height}function dy(e,t,n,i,o){if(e<=0||t<=0)return{widthPercent:i,heightPercent:o};const l=e*i/100,s=t*o/100;let c=l,d=c/n;return d>s&&(d=s,c=d*n),{widthPercent:c/e*100,heightPercent:d/t*100}}function ns(e,t,n){if(e<=0||t<=0)return 1;const i=e*n.widthPercent/100,o=t*n.heightPercent/100;return i<=0||o<=0?1:Math.max(e/i,t/o)}function bc(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function is(e,t,n){return{...bc(e),[`--${n}-stage-scale`]:t}}function uy(e,t){[...new Set(e.filter(Boolean))].forEach(i=>{const o=new Image;o.onload=()=>{o.naturalWidth>0&&o.naturalHeight>0&&t(i,{width:o.naturalWidth,height:o.naturalHeight})},o.src=i})}function py({settings:e,content:t,isEditor:n,isPreviewMode:i}){var Se,G,me,D,K,ae,ge;const{prefix:o}=v.useScopedStyles(),l=a.useMemo(()=>ay(o),[o]),{imageSize:s,maxWidth:c,maxHeight:d,transition:u=1e3,bgImage:m="greyscale"}=e,x=t??[],w=ts(x.length),[$,f]=a.useState(w.activeIndex),[S,L]=a.useState(w.backgroundIndex),[M,A]=a.useState(!1),[C,J]=a.useState(!1),[k,U]=a.useState(null),[I,R]=a.useState(null),[T,y]=a.useState(0),[h,F]=a.useState(1),[W,V]=a.useState("none"),[ne,X]=a.useState("next"),[z,H]=a.useState({}),[_,E]=a.useState({width:0,height:0}),q=a.useRef(null),Y=a.useRef(null),ee=!n||!!i,N=s??60,pe=Math.max(10,Math.min(100,c??N)),b=Math.max(10,Math.min(100,d??N)),ye=Math.max(100,u),Q=Xi(m),xe=a.useCallback(ce=>{const be=cy(ce?z[ce]:void 0);return dy(_.width,_.height,be,pe,b)},[_.height,_.width,z,b,pe]);a.useEffect(()=>{const ce=Y.current;if(!ce)return;const be=new ResizeObserver(([Ee])=>{const{width:Z,height:de}=Ee.contentRect;E({width:Z,height:de})});return be.observe(ce),()=>be.disconnect()},[]),a.useEffect(()=>{const ce=(t??[]).map(be=>{var Ee;return(Ee=be.image)==null?void 0:Ee.url}).filter(be=>!!be);uy(ce,(be,Ee)=>{H(Z=>{var de,We;return((de=Z[be])==null?void 0:de.width)===Ee.width&&((We=Z[be])==null?void 0:We.height)===Ee.height?Z:{...Z,[be]:Ee}})})},[t]),a.useEffect(()=>{const{backgroundIndex:ce,activeIndex:be}=ts(x.length);f(be),L(ce),A(!1),J(!1),U(null),R(null),y(0),F(1),V("none"),X("next")},[x.length,t]),a.useEffect(()=>()=>{q.current&&clearTimeout(q.current)},[]);const $e=a.useCallback(ce=>{var se,O,Oe,_e;if(!ee||M||x.length<=1)return;const be=ce==="next"?($+1)%x.length:($-1+x.length)%x.length,Ee=xe((O=(se=x[$])==null?void 0:se.image)==null?void 0:O.url),Z=xe((_e=(Oe=x[be])==null?void 0:Oe.image)==null?void 0:_e.url),de=ns(_.width,_.height,Ee),We=ns(_.width,_.height,Z);q.current&&clearTimeout(q.current),X(ce),J(!0),A(!0),ce==="next"?(U($),R(be),y(0),F(1),V(Xi(m,0,1))):(L(sy(be,x.length)),U(be),R($),y(1),F(We),V(Xi(m,1,We))),requestAnimationFrame(()=>{J(!1),requestAnimationFrame(()=>{ce==="next"?(y(1),F(de),V(Xi(m,1,de))):(y(0),F(1),V(Xi(m,0,1)))})}),q.current=setTimeout(()=>{ce==="next"&&L($),f(be),U(null),R(null),A(!1)},ye)},[$,m,_.height,_.width,xe,M,ee,x,ye]),oe=x[$],ie=S!==null?x[S]:null,B=k!==null?x[k]:null,le=I!==null?x[I]:null,re=x.length<=1?0:($-1+x.length)%x.length,ke=x.length<=1?0:($+1)%x.length,fe=xe((Se=oe==null?void 0:oe.image)==null?void 0:Se.url),Pe=xe((G=B==null?void 0:B.image)==null?void 0:G.url),ve=xe((me=le==null?void 0:le.image)==null?void 0:me.url),we={[`--${o}-transition-ms`]:`${ye}ms`};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),r.jsxs("div",{ref:Y,className:at(`${o}-wrapper`,C&&`${o}-snap`,n&&!i&&`${o}-editor`),style:we,"aria-label":"Zoom gallery",children:[((D=ie==null?void 0:ie.image)==null?void 0:D.url)&&r.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:ie.image.url,alt:"",style:{filter:Q}})}),M&&((K=B==null?void 0:B.image)==null?void 0:K.url)&&r.jsx("div",{className:at(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${ne}`),style:is(Pe,h,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:B.image.url,alt:"",style:{filter:W}})}),M&&((ae=le==null?void 0:le.image)==null?void 0:ae.url)&&r.jsx("div",{className:at(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${ne}`),style:is(ve,T,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-image`,src:le.image.url,alt:""})}),!M&&((ge=oe==null?void 0:oe.image)==null?void 0:ge.url)&&r.jsx("div",{className:at(`${o}-stage`,`${o}-foreground`),style:bc(fe),children:r.jsx("img",{className:`${o}-image`,src:oe.image.url,alt:oe.image.name??""})}),ee&&x.length>1&&!M&&r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:at(`${o}-nav`,`${o}-nav-prev`),onClick:()=>$e("prev"),"aria-label":`Show previous image (${re+1} of ${x.length})`}),r.jsx("button",{type:"button",className:at(`${o}-nav`,`${o}-nav-next`),onClick:()=>$e("next"),"aria-label":`Show next image (${ke+1} of ${x.length})`})]})]})]})}const my=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
15945
16023
|
import cn from 'classnames';
|
|
15946
16024
|
import { CommonComponentProps } from '../props';
|
|
15947
16025
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -16460,7 +16538,7 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
|
|
|
16460
16538
|
</>
|
|
16461
16539
|
);
|
|
16462
16540
|
}
|
|
16463
|
-
`,
|
|
16541
|
+
`,gy={type:"object",version:1,settings:{sizing:"manual",properties:{maxWidth:{type:"number",scope:"common",title:"Max width (%)",display:{type:"percentage-input"},min:10,max:100},maxHeight:{type:"number",scope:"common",title:"Max height (%)",display:{type:"percentage-input"},min:10,max:100},transition:{type:"number",scope:"common",title:"Transition (ms)",display:{type:"common-numeric-input"},min:100,max:9999},bgImage:{type:"string",scope:"common",title:"BG image",display:{type:"toggle-cycle",enum:["greyscale","blur","as is"]}}},defaults:{maxWidth:60,maxHeight:60,transition:700,bgImage:"greyscale"},layout:["__componentName__","maxWidth","maxHeight","transition","bgImage"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["maxWidth","maxHeight"]},{type:"row",title:"",items:["transition","bgImage"]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0,deleteImageDeletesEntry:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input",isObjectFitEditable:!1}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:""}}]}},hy={element:py,id:"scale",name:"Scale",category:"galleries",version:1,defaultSize:{d:{width:920,height:540},m:{width:"100%",height:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Scale.mp4"},schema:gy,sourceCode:my,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},fy={backgroundColor:"background-color",textColor:"text-color",borderColor:"border-color",iconColor:"icon-color",boxShadowColor:"box-shadow-color",innerBoxShadowColor:"inner-box-shadow-color"},yy=["hover","active"],Jr={left:"flex-start",center:"center",right:"flex-end"};function vy(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 by(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 xy(e){const t=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-box-shadow-color, transparent)`,n=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-inner-box-shadow-color, transparent)`,i=`${t}, ${n}`,o=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-hover-box-shadow-color, var(--${e}-box-shadow-color, transparent))`,l=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-hover-inner-box-shadow-color, var(--${e}-inner-box-shadow-color, transparent))`,s=`${o}, ${l}`,c=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-active-box-shadow-color, var(--${e}-box-shadow-color, transparent))`,d=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-active-inner-box-shadow-color, var(--${e}-inner-box-shadow-color, transparent))`,u=`${c}, ${d}`,m=`0 4px 12px rgba(0, 0, 0, 0.15), ${n}`,x=`.${e}-button:focus-visible, a:focus-visible .${e}-button`,w=`.${e}-button:hover, ${x}`,$=f=>`.${e}-hover-effect-${f}:hover, .${e}-hover-effect-${f}:focus-visible, a:focus-visible .${e}-hover-effect-${f}`;return`
|
|
16464
16542
|
.${e}-root {
|
|
16465
16543
|
line-height: 0;
|
|
16466
16544
|
}
|
|
@@ -16490,11 +16568,11 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
|
|
|
16490
16568
|
.${e}-wrapper.${e}-editing .${e}-button {
|
|
16491
16569
|
transition: color 250ms, background-color 250ms, border-color 250ms, transform 250ms;
|
|
16492
16570
|
}
|
|
16493
|
-
${
|
|
16571
|
+
${$("scale-up")},
|
|
16494
16572
|
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-scale-up {
|
|
16495
16573
|
transform: scale(1.05);
|
|
16496
16574
|
}
|
|
16497
|
-
${
|
|
16575
|
+
${$("lift")},
|
|
16498
16576
|
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-lift {
|
|
16499
16577
|
transform: translateY(-2px);
|
|
16500
16578
|
box-shadow: ${m};
|
|
@@ -16556,9 +16634,9 @@ a:focus-visible .${e}-hover-effect-swipe::before,
|
|
|
16556
16634
|
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-swipe::before {
|
|
16557
16635
|
transform: translateX(0);
|
|
16558
16636
|
}
|
|
16559
|
-
${
|
|
16637
|
+
${$("reveal")},
|
|
16560
16638
|
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-reveal,
|
|
16561
|
-
${
|
|
16639
|
+
${$("swipe")},
|
|
16562
16640
|
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-swipe {
|
|
16563
16641
|
background-color: var(--${e}-background-color);
|
|
16564
16642
|
}
|
|
@@ -16621,7 +16699,7 @@ a:focus-visible .${e}-hover-effect-content-roll .${e}-content-roll-layer-hover,
|
|
|
16621
16699
|
transform: translateY(-50%);
|
|
16622
16700
|
opacity: 1;
|
|
16623
16701
|
}
|
|
16624
|
-
${
|
|
16702
|
+
${w} {
|
|
16625
16703
|
background-color: var(--${e}-hover-background-color, var(--${e}-background-color));
|
|
16626
16704
|
color: var(--${e}-hover-text-color, var(--${e}-text-color));
|
|
16627
16705
|
border-color: var(--${e}-hover-border-color, var(--${e}-border-color));
|
|
@@ -16700,7 +16778,7 @@ a:active .${e}-button .${e}-icon-image,
|
|
|
16700
16778
|
height: calc(1em * var(--${e}-icon-scale, 1));
|
|
16701
16779
|
width: calc(1em * var(--${e}-icon-scale, 1));
|
|
16702
16780
|
}
|
|
16703
|
-
`}function
|
|
16781
|
+
`}function Qr(e,t,n="",i,o){const l=t();return r.jsxs("span",{className:`${e}-content-roll-wrap ${n}`.trim(),style:i,children:[r.jsx("span",{className:`${e}-content-roll-spacer`,"aria-hidden":"true",style:o,children:l}),r.jsxs("span",{className:`${e}-content-roll-viewport`,children:[r.jsx("span",{className:`${e}-content-roll-layer`,style:o,children:t()}),r.jsx("span",{className:`${e}-content-roll-layer ${e}-content-roll-layer-hover`,"aria-hidden":"true",style:o,children:t()})]})]})}function os(e,t,n="fill",i=100,o=0,l){if(!t)return null;const s=r.jsx(on,{url:t,fill:`var(--${e}-icon-color)`,hoverFill:`var(--${e}-icon-color)`,className:`${e}-icon-image`});if(n==="inline")return r.jsx("span",{className:`${e}-icon ${e}-icon-inline`,style:{[`--${e}-icon-scale`]:i/100},"aria-hidden":"true",children:s});if(n==="fixed"&&o>0){const c=v.scalingValue(o,l);return r.jsx("span",{className:`${e}-icon`,style:{width:c,height:c},"aria-hidden":"true",children:s})}return r.jsx("span",{className:`${e}-icon ${e}-icon-fill`,"aria-hidden":"true",children:s})}function wy({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:l}=v.useScopedStyles(),s=a.useMemo(()=>xy(l),[l]),{type:c="a",label:d="Button",icon:u,alignment:m="center",alignA:x,order:w="text-icon",gap:$=0,iconSize:f=0,iconWidthC:S=0,dimensions:L=!1,padding:M={top:0,right:0,bottom:0,left:0},cornerRadius:A=0,boxShadow:C={top:0,left:0,right:0,bottom:0},boxShadowColor:J="rgba(0, 0, 0, 0)",innerBoxShadow:k={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:U="rgba(0, 0, 0, 0)",stroke:I=0,backgroundColor:R="#000000",textColor:T="#ffffff",borderColor:y="#ffffff",iconColor:h="#ffffff",hoverEffect:F="none",fontFamily:W,fontSettings:V,fontSize:ne,lineHeight:X,letterSpacing:z=0,wordSpacing:H=0,textAppearance:_,stateOverrides:E,minWidth:q=0,minHeight:Y=0,width:ee=0,height:N=0}=e,pe=v.buildColorVars(l,{backgroundColor:R,textColor:T,borderColor:y,iconColor:h,boxShadowColor:J,innerBoxShadowColor:U},fy,yy,E),b=i&&i!=="default"?`${l}-state-${i}`:"",ye=t&&!n?`${l}-editing`:"",Q=F!=="none"&&(!t||n||i==="hover")?`${l}-hover-effect-${F}`:"",xe=F==="reveal"||F==="swipe",$e=F==="content-roll",oe=F==="reveal"&&(!t||n),ie=L===!0,le=c==="a"?x??m:m,re=c==="c",ke=c!=="b",fe={fontSettings:{fontFamily:W,fontWeight:(V==null?void 0:V.fontWeight)??400,fontStyle:(V==null?void 0:V.fontStyle)??"normal"},fontSize:ne??.01,lineHeight:X,letterSpacing:z,wordSpacing:H,textAppearance:_,color:T},ve={...ke?dn(Xt(fe,t)):{},[`--${l}-box-shadow-x`]:v.scalingValue(C.left,t),[`--${l}-box-shadow-y`]:v.scalingValue(C.top,t),[`--${l}-box-shadow-blur`]:v.scalingValue(C.right,t),[`--${l}-box-shadow-spread`]:v.scalingValue(C.bottom,t),[`--${l}-inner-box-shadow-x`]:v.scalingValue(k.left,t),[`--${l}-inner-box-shadow-y`]:v.scalingValue(k.top,t),[`--${l}-inner-box-shadow-blur`]:v.scalingValue(k.right,t),[`--${l}-inner-box-shadow-spread`]:v.scalingValue(k.bottom,t),paddingTop:v.scalingValue(M.top,t),paddingRight:v.scalingValue(M.right,t),paddingBottom:v.scalingValue(M.bottom,t),paddingLeft:v.scalingValue(M.left,t),borderRadius:v.scalingValue(A,t),borderWidth:v.scalingValue(I,t),...re?{}:{justifyContent:Jr[le],textAlign:le},...re&&!$e?{gap:v.scalingValue($,t)}:{},...ie?{width:v.scalingValue(ee,t),height:v.scalingValue(N,t)}:{minWidth:v.scalingValue(q,t),minHeight:v.scalingValue(Y,t),...re?{width:"100%"}:{}}};let we;const Se={display:"inline-flex",alignItems:"center",justifyContent:re?Jr[le]:Jr[c==="a"?le:"center"],gap:re?v.scalingValue($,t):void 0,width:"100%",height:"100%",...c==="a"?{textAlign:le}:{}};if(c==="b"){const D=()=>os(l,u,f>0?"fixed":"fill",100,f,t);we=$e?Qr(l,D,`${l}-icon-roll`,void 0,Se):D()}else if(c==="c"){const D=()=>{const K=r.jsx("span",{className:`${l}-text`,style:{textAlign:le},children:d}),ae=os(l,u,S>0?"fixed":"fill",100,S,t);return w==="icon-text"?r.jsxs(r.Fragment,{children:[ae,K]}):r.jsxs(r.Fragment,{children:[K,ae]})};we=$e?Qr(l,D,`${l}-icon-text-roll`,void 0,Se):D()}else we=$e?Qr(l,()=>d,`${l}-label-roll`,void 0,Se):xe?r.jsx("span",{className:`${l}-button-inner`,children:d}):d;const G=oe?D=>vy(D,l):void 0,me=oe?D=>by(D,l):void 0;return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:s}}),r.jsx("div",{className:`${l}-root`,style:pe,children:r.jsx("div",{className:`${l}-wrapper ${b} ${ye}`.trim(),children:r.jsx("div",{className:`${l}-button ${Q}`.trim(),style:ve,onMouseEnter:G,onMouseLeave:me,role:"button",tabIndex:o||t&&!n?void 0:0,children:we})})})]})}const Sy=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
|
|
16704
16782
|
import { SvgImage } from '../helpers/SvgImage/SvgImage';
|
|
16705
16783
|
import { CommonComponentProps } from '../props';
|
|
16706
16784
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
|
|
@@ -16713,13 +16791,6 @@ type Padding = {
|
|
|
16713
16791
|
left: number;
|
|
16714
16792
|
};
|
|
16715
16793
|
|
|
16716
|
-
type CornerRadius = {
|
|
16717
|
-
top: number;
|
|
16718
|
-
right: number;
|
|
16719
|
-
bottom: number;
|
|
16720
|
-
left: number;
|
|
16721
|
-
};
|
|
16722
|
-
|
|
16723
16794
|
type BoxShadow = {
|
|
16724
16795
|
top: number;
|
|
16725
16796
|
left: number;
|
|
@@ -16742,7 +16813,7 @@ type SimpleButtonSettings = {
|
|
|
16742
16813
|
iconColor?: string;
|
|
16743
16814
|
dimensions?: boolean;
|
|
16744
16815
|
padding?: Padding;
|
|
16745
|
-
cornerRadius?:
|
|
16816
|
+
cornerRadius?: number;
|
|
16746
16817
|
boxShadow?: BoxShadow;
|
|
16747
16818
|
boxShadowColor?: string;
|
|
16748
16819
|
innerBoxShadow?: BoxShadow;
|
|
@@ -17158,7 +17229,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
17158
17229
|
iconWidthC = 0,
|
|
17159
17230
|
dimensions = false,
|
|
17160
17231
|
padding = { top: 0, right: 0, bottom: 0, left: 0 },
|
|
17161
|
-
cornerRadius =
|
|
17232
|
+
cornerRadius = 0,
|
|
17162
17233
|
boxShadow = { top: 0, left: 0, right: 0, bottom: 0 },
|
|
17163
17234
|
boxShadowColor = 'rgba(0, 0, 0, 0)',
|
|
17164
17235
|
innerBoxShadow = { top: 0, left: 0, right: 0, bottom: 0 },
|
|
@@ -17240,10 +17311,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
17240
17311
|
paddingRight: scalingValue(padding.right, isEditor),
|
|
17241
17312
|
paddingBottom: scalingValue(padding.bottom, isEditor),
|
|
17242
17313
|
paddingLeft: scalingValue(padding.left, isEditor),
|
|
17243
|
-
|
|
17244
|
-
borderTopRightRadius: scalingValue(cornerRadius.right, isEditor),
|
|
17245
|
-
borderBottomRightRadius: scalingValue(cornerRadius.bottom, isEditor),
|
|
17246
|
-
borderBottomLeftRadius: scalingValue(cornerRadius.left, isEditor),
|
|
17314
|
+
borderRadius: scalingValue(cornerRadius, isEditor),
|
|
17247
17315
|
borderWidth: scalingValue(stroke, isEditor),
|
|
17248
17316
|
...(!isIconTextType ? {
|
|
17249
17317
|
justifyContent: ALIGNMENT_MAP[effectiveAlignment],
|
|
@@ -17337,7 +17405,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
17337
17405
|
</>
|
|
17338
17406
|
);
|
|
17339
17407
|
}
|
|
17340
|
-
`,yy={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},vy=["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],xy={type:"object",version:1,settings:{sizing:"auto",hasLinkParameter:!0,properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},label:{type:"string",scope:"common",title:"Label",display:{type:"label-input"}},icon:{type:["string","null"],scope:"common",title:"Icon",display:{type:"settings-image-input",visible:!1}},alignment:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"]}},alignA:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"],visible:!1}},order:{type:"string",scope:"layout",title:"Order",display:{type:"toggle-cycle",enum:["text-icon","icon-text"],visible:!1}},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconSize:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconWidthC:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},dimensions:{type:"boolean",scope:"layout",title:"Dimensions",display:{type:"toggle",enum:["auto","fixed"]}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},cornerRadius:{type:"object",scope:"layout",title:"Corner radius",display:{type:"padding-controls"}},boxShadow:{type:"object",scope:"layout",title:"Shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},boxShadowColor:{type:"string",scope:"common",title:"Shadow Default",titleByState:{default:"Shadow Default",hover:"Shadow Hover",active:"Shadow Active"},display:{type:"palette-color-picker"}},innerBoxShadow:{type:"object",scope:"layout",title:"Inner shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},innerBoxShadowColor:{type:"string",scope:"common",title:"Inner Shadow Default",titleByState:{default:"Inner Shadow Default",hover:"Inner Shadow Hover",active:"Inner Shadow Active"},display:{type:"palette-color-picker"}},stroke:{type:"number",scope:"layout",title:"Stroke Width",display:{type:"numeric-input"},min:0,max:9999},backgroundColor:{type:"string",scope:"common",title:"Background Default",titleByState:{default:"Background Default",hover:"Background Hover",active:"Background Active"},display:{type:"palette-color-picker"}},textColor:{type:"string",scope:"common",title:"Text Default",titleByState:{default:"Text Default",hover:"Text Hover",active:"Text Active"},display:{type:"palette-color-picker"}},borderColor:{type:"string",scope:"common",title:"Border Default",titleByState:{default:"Border Default",hover:"Border Hover",active:"Border Active"},display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{default:"Icon Default",hover:"Icon Hover",active:"Icon Active"},display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},hoverEffect:{type:"string",scope:"layout",title:"Hover effect",display:{type:"toggle-cycle",enum:["none","scale-up","lift","reveal","swipe","content-roll"]}},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},fontSettings:{...yy.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},fontSize:{type:"number",scope:"layout",title:"Font size",display:{type:"font-size"}},lineHeight:{type:"number",scope:"layout",title:"Line height",display:{type:"line-height-input"}},letterSpacing:{type:"number",scope:"layout",title:"Letter spacing",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",scope:"layout",title:"Word spacing",display:{type:"word-spacing-input"}},textAppearance:{type:"object",scope:"layout",title:"Text appearance",display:{type:"text-appearance"}},minWidth:{type:"number",scope:"layout",title:"Min width",display:{type:"numeric-input"},min:0,max:9999},minHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input",visible:!1},min:0,max:9999},height:{type:"number",scope:"layout",title:"Height",display:{type:"numeric-input",visible:!1},min:0,max:9999}},defaults:{label:"Button",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01KY78A0YVT403B042HVWWTHBC.svg",boxShadowColor:"#000000",innerBoxShadowColor:"#000000",backgroundColor:"#2E12F0",textColor:"#ffffff",borderColor:"#ffffff",iconColor:"#ffffff",fontFamily:"Arial",fontSettings:{fontWeight:400,fontStyle:"normal"},stateOverrides:{hover:{backgroundColor:"#3642EF"},active:{backgroundColor:"#475FFF"}}},layoutDefaults:{m:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/375,right:20/375,bottom:10/375,left:20/375},minWidth:0/375,minHeight:0/375,width:100/375,height:100/375,cornerRadius:{top:20/375,right:20/375,bottom:20/375,left:20/375},boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/375,gap:10/375,iconWidthC:16/375,fontSize:16/375,lineHeight:16/375,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},t:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/768,right:20/768,bottom:10/768,left:20/768},minWidth:0/768,minHeight:0/768,width:100/768,height:100/768,cornerRadius:{top:20/768,right:20/768,bottom:20/768,left:20/768},boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/768,gap:10/768,iconWidthC:16/768,fontSize:16/768,lineHeight:16/768,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},d:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/1440,right:20/1440,bottom:10/1440,left:20/1440},minWidth:0/1440,minHeight:0/1440,width:100/1440,height:100/1440,cornerRadius:{top:20/1440,right:20/1440,bottom:20/1440,left:20/1440},boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/1440,gap:10/1440,iconWidthC:16/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}},layout:["__componentName__","type","label","icon","alignment","order","gap","iconSize","iconWidthC","hoverEffect",{type:"row",title:"",items:["dimensions","padding"]},"cornerRadius","boxShadow","boxShadowColor","innerBoxShadow","innerBoxShadowColor",{type:"row",title:"",items:["stroke","borderColor"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]}],displayRules:[{if:{name:"type",value:"a"},then:{name:"properties.icon.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignment.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignA.display.visible",value:!0}},{if:{name:"type",value:"a"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"b"},then:{name:"properties.label.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontFamily.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSettings.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSize.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.lineHeight.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.letterSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.wordSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.textAppearance.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.iconSize.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.order.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.iconWidthC.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.gap.display.visible",value:!0}},{if:{name:"stroke",value:0},then:{name:"properties.borderColor.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minWidth.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minHeight.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.width.display.visible",value:!0}},{if:{name:"dimensions",value:!0},then:{name:"properties.height.display.visible",value:!0}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["label","icon","iconSize","alignA"]},{type:"row",title:"",items:["alignment","order"]},{type:"row",title:"",items:["gap","iconWidthC"]},{type:"row",title:"",items:["dimensions","padding"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]},{type:"row",title:"",items:["hoverEffect","cornerRadius"]},{type:"row",title:"",items:["boxShadow"]},{type:"row",title:"",items:["innerBoxShadow"]},{type:"row",title:"",items:["stroke"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily","fontSettings",{type:"row",title:"",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAppearance"]}],paletteBookmark:{items:[...vy],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],hover:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],active:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"]}},states:["default","hover","active"]},by={element:hy,id:"simple-button",name:"Simple Button",category:"ui-elements",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/button-preview.png"},schema:xy,sourceCode:fy,assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{fontSettings:"fontFamily"}};function wy(e){return`
|
|
17408
|
+
`,$y={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Cy=["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],Ty={type:"object",version:1,settings:{sizing:"auto",hasLinkParameter:!0,properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},label:{type:"string",scope:"common",title:"Label",display:{type:"label-input"}},icon:{type:["string","null"],scope:"common",title:"Icon",display:{type:"settings-image-input",visible:!1}},alignment:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"]}},alignA:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"],visible:!1}},order:{type:"string",scope:"layout",title:"Order",display:{type:"toggle-cycle",enum:["text-icon","icon-text"],visible:!1}},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconSize:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconWidthC:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},dimensions:{type:"boolean",scope:"layout",title:"Dimensions",display:{type:"toggle",enum:["auto","fixed"]}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",min:0,display:{type:"numeric-input"}},boxShadow:{type:"object",scope:"layout",title:"Shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},boxShadowColor:{type:"string",scope:"common",title:"Shadow Default",titleByState:{default:"Shadow Default",hover:"Shadow Hover",active:"Shadow Active"},display:{type:"palette-color-picker"}},innerBoxShadow:{type:"object",scope:"layout",title:"Inner shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},innerBoxShadowColor:{type:"string",scope:"common",title:"Inner Shadow Default",titleByState:{default:"Inner Shadow Default",hover:"Inner Shadow Hover",active:"Inner Shadow Active"},display:{type:"palette-color-picker"}},stroke:{type:"number",scope:"layout",title:"Stroke Width",display:{type:"numeric-input"},min:0,max:9999},backgroundColor:{type:"string",scope:"common",title:"Background Default",titleByState:{default:"Background Default",hover:"Background Hover",active:"Background Active"},display:{type:"palette-color-picker"}},textColor:{type:"string",scope:"common",title:"Text Default",titleByState:{default:"Text Default",hover:"Text Hover",active:"Text Active"},display:{type:"palette-color-picker"}},borderColor:{type:"string",scope:"common",title:"Border Default",titleByState:{default:"Border Default",hover:"Border Hover",active:"Border Active"},display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{default:"Icon Default",hover:"Icon Hover",active:"Icon Active"},display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},hoverEffect:{type:"string",scope:"layout",title:"Hover effect",display:{type:"toggle-cycle",enum:["none","scale-up","lift","reveal","swipe","content-roll"]}},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},fontSettings:{...$y.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},fontSize:{type:"number",scope:"layout",title:"Font size",display:{type:"font-size"}},lineHeight:{type:"number",scope:"layout",title:"Line height",display:{type:"line-height-input"}},letterSpacing:{type:"number",scope:"layout",title:"Letter spacing",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",scope:"layout",title:"Word spacing",display:{type:"word-spacing-input"}},textAppearance:{type:"object",scope:"layout",title:"Text appearance",display:{type:"text-appearance"}},minWidth:{type:"number",scope:"layout",title:"Min width",display:{type:"numeric-input"},min:0,max:9999},minHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input",visible:!1},min:0,max:9999},height:{type:"number",scope:"layout",title:"Height",display:{type:"numeric-input",visible:!1},min:0,max:9999}},defaults:{label:"Button",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01KY78A0YVT403B042HVWWTHBC.svg",boxShadowColor:"#000000",innerBoxShadowColor:"#000000",backgroundColor:"#2E12F0",textColor:"#ffffff",borderColor:"#ffffff",iconColor:"#ffffff",fontFamily:"Arial",fontSettings:{fontWeight:400,fontStyle:"normal"},stateOverrides:{hover:{backgroundColor:"#3642EF"},active:{backgroundColor:"#475FFF"}}},layoutDefaults:{m:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/375,right:20/375,bottom:10/375,left:20/375},minWidth:0/375,minHeight:0/375,width:100/375,height:100/375,cornerRadius:20/375,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/375,gap:10/375,iconWidthC:16/375,fontSize:16/375,lineHeight:16/375,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},t:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/768,right:20/768,bottom:10/768,left:20/768},minWidth:0/768,minHeight:0/768,width:100/768,height:100/768,cornerRadius:20/768,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/768,gap:10/768,iconWidthC:16/768,fontSize:16/768,lineHeight:16/768,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},d:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/1440,right:20/1440,bottom:10/1440,left:20/1440},minWidth:0/1440,minHeight:0/1440,width:100/1440,height:100/1440,cornerRadius:20/1440,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/1440,gap:10/1440,iconWidthC:16/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}},layout:["__componentName__","type","label","icon","alignment","order","gap","iconSize","iconWidthC","hoverEffect",{type:"row",title:"",items:["dimensions","padding"]},"cornerRadius","boxShadow","boxShadowColor","innerBoxShadow","innerBoxShadowColor",{type:"row",title:"",items:["stroke","borderColor"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]}],displayRules:[{if:{name:"type",value:"a"},then:{name:"properties.icon.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignment.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignA.display.visible",value:!0}},{if:{name:"type",value:"a"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"b"},then:{name:"properties.label.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontFamily.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSettings.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSize.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.lineHeight.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.letterSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.wordSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.textAppearance.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.iconSize.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.order.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.iconWidthC.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.gap.display.visible",value:!0}},{if:{name:"stroke",value:0},then:{name:"properties.borderColor.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minWidth.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minHeight.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.width.display.visible",value:!0}},{if:{name:"dimensions",value:!0},then:{name:"properties.height.display.visible",value:!0}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["label","icon","iconSize","alignA"]},{type:"row",title:"",items:["alignment","order"]},{type:"row",title:"",items:["gap","iconWidthC"]},{type:"row",title:"",items:["dimensions","padding"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]},{type:"row",title:"",items:["hoverEffect","cornerRadius"]},{type:"row",title:"",items:["boxShadow"]},{type:"row",title:"",items:["innerBoxShadow"]},{type:"row",title:"",items:["stroke"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily","fontSettings",{type:"row",title:"",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAppearance"]}],paletteBookmark:{items:[...Cy],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],hover:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],active:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"]}},states:["default","hover","active"]},Ly={element:wy,id:"simple-button",name:"Simple Button",category:"ui-elements",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/button-preview.png"},schema:Ty,sourceCode:Sy,assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{fontSettings:"fontFamily"}};function Iy(e){return`
|
|
17341
17409
|
.${e}-titles-row {
|
|
17342
17410
|
position: relative;
|
|
17343
17411
|
flex: 0 1 auto;
|
|
@@ -17535,7 +17603,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
17535
17603
|
pointer-events: auto;
|
|
17536
17604
|
flex-shrink: 0;
|
|
17537
17605
|
}
|
|
17538
|
-
`}const Cn=500,Xi=650,mn="cubic-bezier(0.22, 1, 0.36, 1)",Sy=72,$y=50,Cy=1e4,Ty=650,Ly=500;function Iy(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,l=e.top-t.top;return`translate(${o}px, ${l}px) scale(${n}, ${i})`}function vc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=or(e);return{left:i.x,top:i.y,width:i.width,height:i.height}}const n=e.getBoundingClientRect();return{left:n.left,top:n.top,width:n.width,height:n.height}}function Ry(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?vc(i,n):null}function Ey(e){return e.reduce((t,n,i)=>{var o;return(o=n.image)!=null&&o.url&&t.push({gridIndex:i,items:[n.image],entry:{title1:n.title??"",title2:n.subtitle??"",title3:n.caption??""}}),t},[])}function Ji(e,t,n){var o;if(e.length<=1)return null;const i=(t+n+e.length)%e.length;return((o=e[i])==null?void 0:o.items[0])??null}function rs(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return Ji(e,i,n)}const ky=.03;function xc(e){return e.width*ky}const ta={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Do(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function as(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function My(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ya(e,t,n){const i=e.getBoundingClientRect(),o=i.width,l=i.height,s=t/n,d=o/l;if(s>d){const u=o/s;return{width:o,height:u,left:i.left,top:i.top+(l-u)/2}}const c=l*s;return{width:c,height:l,left:i.left+(o-c)/2,top:i.top}}function Py(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ya(e,t.width,t.height)}function Ay(e,t){if(Ir(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function Fy(e){const t=new Set,n=[];for(const i of e){const o=i.image;!(o!=null&&o.url)||t.has(o.url)||(t.add(o.url),n.push(o))}return n}function Wy({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Ir(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function ji(e,t,n){const{width:i,height:o,top:l}=e,{left:s,width:d}=n,c=xc(n);return t==="left"?{left:s+c-i,top:l,width:i,height:o}:{left:s+d-c,top:l,width:i,height:o}}function sr(e,t,n){const i=ji(e,t,n);return{...i,left:2*i.left-e.left}}function _y(e,t,n){const{left:i,width:o}=n,l=xc(n);return t==="left"?{left:i,top:e.top,width:l,height:e.height}:{left:i+o-l,top:e.top,width:l,height:e.height}}function bc(e,t,n,i){const o=ji(e,"left",i),l=ji(e,"right",i),s=sr(e,"left",i),d=sr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:l,end:e};case"left-adjacent":return{start:o,end:s};case"far-right":return{start:d,end:l};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:l};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:l,end:d};case"far-left":return{start:s,end:o};default:return{start:e,end:e}}}function Ny(e,t,n,i){const{start:o,end:l}=bc(e,t,n,i);return{x:l.left-o.left,y:l.top-o.top}}function Hy(e,t,n){const i=ji(e,t,n),o=sr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Ir(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function jy({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:l,onTransitionEnd:s}){const d=a.useRef(null);return a.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:s,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:l,onClick:c=>c.stopPropagation(),style:o},e)})}function Vo({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Ir(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const l=o.currentTarget;l.videoWidth>0&&l.videoHeight>0&&(i==null||i(e.url,l.videoWidth,l.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const l=o.currentTarget;l.naturalWidth>0&&l.naturalHeight>0&&(i==null||i(e.url,l.naturalWidth,l.naturalHeight))},onTransitionEnd:n})}function Oy({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:m,layoutId:x,sourceRect:b,resolveCloseSourceRect:T,onClose:f,onPrev:L,onNext:$}){const R=a.useRef(null),E=a.useRef(null),C=a.useRef(null),U=a.useRef(new Map),[k,j]=a.useState(0),I=a.useRef(null),w=a.useRef(0),W=a.useRef(0),h=a.useRef("none"),S=a.useRef(!1),M=a.useRef(!1),z=a.useRef(!1),K=a.useRef(null),le=a.useRef(null),Y=a.useRef(null),D=a.useRef(()=>{}),N=a.useRef(null),F=a.useRef(null),A=a.useRef(null),q=a.useRef(!1),[G,Z]=a.useState(null),[_,me]=a.useState(ta),[v,fe]=a.useState(0),[J,de]=a.useState("opening"),[$e,oe]=a.useState(0),[xe,Q]=a.useState(0),[ye,ve]=a.useState(!1),[ke,we]=a.useState(null),[Me,X]=a.useState(null),[ue,Se]=a.useState(null),[O,ce]=a.useState(!1),[H,re]=a.useState(null),[ae,ne]=a.useState(!1),ie=a.useRef(!1),[be,Ce]=a.useState(!1),[ee,pe]=a.useState(!1),Ae=a.useRef(n),se=a.useRef(void 0),V=t[n],je=V?Ir(V):!1,We=xe!==0||ye,et=!s&&(!l||!!d),Ye=c&&!s,st=u.length>1,mt=a.useCallback((g,ge)=>t.length<=1?null:t[(g+ge+t.length)%t.length]??null,[t]),De=st?Ji(u,m,-1):mt(n,-1),ot=st?Ji(u,m,1):mt(n,1),$t=ke===-1&&We?st&&Me!==null?Ji(u,Me,-1):ue!==null?mt(ue,-1):null:null,rt=ke===1&&We?st&&Me!==null?Ji(u,Me,1):ue!==null?mt(ue,1):null:null,Ue=$t&&$t.url!==(De==null?void 0:De.url)?$t:null,ht=rt&&rt.url!==(ot==null?void 0:ot.url)?rt:null,xt=De&&Ye?(()=>{const g=st?rs(u,m,-1):t.length>2?mt((n-1+t.length)%t.length,-1):null;return g&&g.url!==De.url?g:null})():null,dt=ot&&Ye?(()=>{const g=st?rs(u,m,1):t.length>2?mt((n+1)%t.length,1):null;return g&&g.url!==ot.url?g:null})():null,kt=Ue??xt,_t=ht??dt,Qe=a.useCallback((g,ge,Re)=>{if(!g||!ge||!Re)return;const Ie=U.current,Ze=Ie.get(g);(Ze==null?void 0:Ze.width)===ge&&(Ze==null?void 0:Ze.height)===Re||(Ie.set(g,{width:ge,height:Re}),j(Et=>Et+1))},[]),Tt=a.useCallback(g=>{if(!(g!=null&&g.url))return null;const ge=U.current.get(g.url);return Py(E.current,ge)},[k,v]),Lt=a.useCallback(()=>{if(!V)return;const g=Tt(V);if(g){Z(g);return}const ge=E.current;ge&&Z(as(ge))},[V,Tt]),Ge=a.useCallback(g=>{if(st){const ge=u.length;X((m+g+ge)%ge),Se(null);return}t.length>1&&(Se((n+g+t.length)%t.length),X(null))},[st,u.length,m,t.length,n]),qe=a.useCallback(g=>{z.current=g,ve(g)},[]),Pe=a.useCallback(()=>{K.current!==null&&(window.clearTimeout(K.current),K.current=null)},[]),gt=a.useCallback(()=>{Pe(),K.current=window.setTimeout(()=>{Pe(),qe(!1)},Xi+32)},[Pe,qe]),It=a.useCallback(()=>{const g=R.current;if(!g){me({left:0,top:0,width:typeof window<"u"?window.innerWidth:ta.width,height:typeof window<"u"?window.innerHeight:ta.height});return}const ge=g.getBoundingClientRect();me({left:ge.left,top:ge.top,width:ge.width,height:ge.height})},[]),Mt=a.useCallback((g,ge)=>{if(We){if(be&&!ye)return`translate(${xe}px, 0px)`;if(ye&&ke!==null){const Re=Tt(g);if(!Re)return;const{x:Ie,y:Ze}=Ny(Re,ge,ke,_);return`translate(${Ie}px, ${Ze}px)`}if(ye)return"translate(0px, 0px)"}},[We,be,ye,xe,ke,_,Tt]),Dt=a.useCallback(()=>{const g=le.current;le.current=null,Pe(),qe(!1),we(null),X(null),Se(null),Q(0),Ce(!1),S.current=!1,W.current=0,h.current="none",g===-1?L():g===1&&$()},[Pe,qe,L,$]),en=a.useCallback(()=>{Pe(),K.current=window.setTimeout(()=>{le.current!==null&&Dt()},Xi+32)},[Pe,Dt]),on=a.useCallback(()=>{Pe(),le.current=null,qe(!1),we(null),X(null),Se(null),Q(0),Ce(!1),S.current=!1,W.current=0,h.current="none"},[Pe,qe]),bt=a.useCallback(g=>{if(!(!Ye||!G)){if(z.current){if(le.current===g){Y.current=g,Dt();return}on()}Pe(),Ge(g),le.current=g,we(g),qe(!0),en()}},[Ye,G,Dt,on,Pe,Ge,qe,en]);D.current=bt;const Rt=a.useCallback(()=>{N.current=null,q.current=!1,F.current!==null&&(window.clearInterval(F.current),F.current=null),A.current!==null&&(window.clearTimeout(A.current),A.current=null)},[]),Ut=a.useCallback(g=>{F.current!==null&&window.clearInterval(F.current);const ge=q.current?Ly:Ty;F.current=window.setInterval(()=>{D.current(g)},ge)},[]),Kt=a.useCallback(g=>{N.current!==g&&(Rt(),N.current=g,q.current=!1,D.current(g),Ut(g),A.current=window.setTimeout(()=>{A.current=null,N.current===g&&(q.current=!0,Ut(g))},Cy))},[Rt,Ut]),ft=a.useCallback(()=>{const g=E.current;if(!g)return;const ge=V==null?void 0:V.url,Re=ge?U.current.get(ge):void 0;if(Re!=null&&Re.width&&(Re!=null&&Re.height)){Z(ya(g,Re.width,Re.height));return}const Ie=C.current;if(Ie&&ge&&(Ie.src===ge||Ie.currentSrc===ge)){const{width:Et,height:Ve}=My(Ie);if(Et&&Ve){Qe(ge,Et,Ve),Z(ya(g,Et,Ve));return}}const Ze=as(g);!Ze.width||!Ze.height||Z(Ze)},[V==null?void 0:V.url,Qe]),Jt=a.useCallback(g=>{if(C.current=g,!!g){if(g instanceof HTMLVideoElement){g.readyState>=1&&g.videoWidth>0&&ft();return}g.complete&&g.naturalWidth>0&&ft()}},[ft]),Te=a.useCallback(()=>{It(),ft(),fe(g=>g+1)},[It,ft]);a.useEffect(()=>{Te();const g=E.current,ge=R.current,Re=new ResizeObserver(()=>Te());return g&&Re.observe(g),ge&&Re.observe(ge),window.addEventListener("resize",Te),()=>{Re.disconnect(),window.removeEventListener("resize",Te)}},[Te,n,x]),a.useLayoutEffect(()=>{if(!V)return;const g=C.current;if(g){if(g instanceof HTMLImageElement&&g.complete&&g.naturalWidth>0){ft();return}g instanceof HTMLVideoElement&&g.readyState>=1&&g.videoWidth>0&&ft()}},[V==null?void 0:V.url,n,ft]),a.useEffect(()=>{Lt()},[Lt,k]),a.useEffect(()=>{const g=new Set,ge=[],Re=Ie=>{!(Ie!=null&&Ie.url)||g.has(Ie.url)||(g.add(Ie.url),ge.push(Ie))};t.forEach(Re),u.forEach(Ie=>Ie.items.forEach(Re)),ge.forEach(Ie=>{U.current.has(Ie.url)||Ay(Ie,Qe)})},[t,u,Qe]),a.useEffect(()=>{if(J!=="opening"||!G)return;if(!b){de("open");return}ce(!1);const g=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ce(!0),de("open")})});return()=>cancelAnimationFrame(g)},[J,G,b]),a.useEffect(()=>{if(J!=="closing")return;const g=setTimeout(()=>f(),Cn);return()=>clearTimeout(g)},[J,f]),a.useEffect(()=>()=>{Pe()},[Pe]),a.useLayoutEffect(()=>{Ae.current===n&&se.current===(V==null?void 0:V.url)||(Pe(),le.current=null,we(null),X(null),Se(null),oe(0),Q(0),qe(!1),pe(!1),Ce(!1),w.current=0,W.current=0,h.current="none",S.current=!1,I.current=null,M.current=!1,C.current=null,Lt(),Ae.current=n,se.current=V==null?void 0:V.url)},[n,V==null?void 0:V.url,qe,Pe,Lt]),a.useLayoutEffect(()=>{const g=Y.current;g!==null&&(Y.current=null,requestAnimationFrame(()=>{D.current(g)}))},[n,m,V==null?void 0:V.url]),a.useLayoutEffect(()=>{if(J==="opening"){ie.current=!1,ne(!1);return}if(J!=="open"||ie.current)return;if(!De&&!ot){ie.current=!0;return}ne(!1);const g=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ne(!0),ie.current=!0})});return()=>cancelAnimationFrame(g)},[J,De==null?void 0:De.url,ot==null?void 0:ot.url]),a.useEffect(()=>{if(J!=="open")return;const g=()=>{const Ve=it=>{it.stopPropagation(),it.preventDefault(),document.removeEventListener("click",Ve,!0)};document.addEventListener("click",Ve,!0)},ge=Ve=>{const it=Ve<0?1:-1;Pe(),Ge(it),le.current=it,we(it),qe(!0),en()},Re=Ve=>{if(Math.abs(Ve)>$y&&Ye){ge(Ve);return}le.current=null,we(null),X(null),Se(null),qe(!0),Q(0),gt()},Ie=Ve=>{if(Ve.touches.length!==1||z.current)return;const it=Ve.touches[0];M.current=!0,I.current={x:it.clientX,y:it.clientY},h.current="none",W.current=0,S.current=!1},Ze=Ve=>{if(!I.current||Ve.touches.length!==1||z.current)return;const it=Ve.touches[0],jt=it.clientX-I.current.x,St=it.clientY-I.current.y;if(h.current==="none"){if(Math.abs(jt)<10&&Math.abs(St)<10)return;if(Math.abs(jt)>Math.abs(St)){if(!Ye)return;h.current="horizontal"}else if(St>0){if(!et)return;h.current="vertical"}else return}if(h.current==="horizontal"){S.current=!0,Ce(!0),W.current=jt,Q(jt),Ve.preventDefault();return}h.current==="vertical"&&(S.current=!0,Ce(!0),w.current=St,oe(St),Ve.preventDefault())},Et=()=>{if(!I.current)return;const Ve=h.current,it=S.current;if(it&&Ve==="horizontal")Re(W.current),g();else if(it&&Ve==="vertical"){const jt=w.current;if(et&&jt>Sy){const St=window.innerHeight;w.current=St,pe(!0),oe(St),de("closing")}else w.current=0,oe(0);g()}else Ve==="horizontal"&&Math.abs(W.current)>0&&(Re(W.current),g());I.current=null,h.current="none",W.current=0,S.current=!1,Ce(!1)};return document.addEventListener("touchstart",Ie,{passive:!0}),document.addEventListener("touchmove",Ze,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Ie),document.removeEventListener("touchmove",Ze),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[J,Ye,qe,gt,Pe,et,en,Ge]);const Oe=a.useCallback(()=>{const g=(T==null?void 0:T())??b??null;g&&G&&(re(g),ce(!0)),de("closing")},[T,b,G]);a.useEffect(()=>{const g=Ie=>{if(Ie.key==="Escape"){if(l&&d||J==="closing")return;Rt(),Oe();return}if(Ie.key!=="ArrowLeft"&&Ie.key!=="ArrowRight"||J!=="open"||!Ye)return;Ie.preventDefault();const Ze=Ie.key==="ArrowLeft"?-1:1;Ie.repeat&&N.current===Ze||Kt(Ze)},ge=Ie=>{if(Ie.key!=="ArrowLeft"&&Ie.key!=="ArrowRight")return;const Ze=Ie.key==="ArrowLeft"?-1:1;N.current===Ze&&Rt()},Re=()=>{Rt()};return window.addEventListener("keydown",g),window.addEventListener("keyup",ge),window.addEventListener("blur",Re),()=>{window.removeEventListener("keydown",g),window.removeEventListener("keyup",ge),window.removeEventListener("blur",Re),Rt()}},[J,l,d,Oe,Ye,Kt,Rt]),a.useEffect(()=>{J!=="open"&&Rt()},[J,Rt]);const Ke=()=>{J==="closing"||s||Oe()},Ne=J==="open",ze=J==="closing",ut=$e>0?Math.max(0,1-$e/500):1,_e=$e>0?Math.max(.35,1-$e/500):1,Je=a.useCallback(g=>{if(!(g.propertyName!=="transform"||!z.current)){if(le.current!==null){Dt();return}Pe(),qe(!1)}},[Pe,qe,Dt]),tt=J==="closing"?H??b:b,Wt=tt&&G&&(J==="opening"||ze)?Iy(tt,G):void 0,Ct=We&&V?Mt(V,"center"):$e>0?`translateY(${$e}px)`:Wt,lt=G?Do(G,_):null,Nt=!!(tt&&G),At=Nt&&(J==="closing"||J==="open"&&O),Vt={position:"absolute",top:lt==null?void 0:lt.top,left:lt==null?void 0:lt.left,width:lt==null?void 0:lt.width,height:lt==null?void 0:lt.height,objectFit:"contain",transformOrigin:"top left",transform:Ct,opacity:$e>0?_e:Nt?1:J==="opening"||ze?0:1,transition:be&&!ye?"none":ye?`transform ${Xi}ms ${mn}`:ee?`transform ${Cn}ms ${mn}, opacity ${Cn}ms ${mn}`:At?`transform ${Cn}ms ${mn}`:J==="opening"||ze?`opacity ${Cn}ms ${mn}`:"none",pointerEvents:je&&Ne&&!We?"auto":"none",touchAction:je&&Ne?"none":void 0,zIndex:1,overflow:je?"hidden":void 0},zt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ne&&!We?"auto":"none"},Pt=(g,ge,Re="adjacent")=>{const Ie=Tt(g);if(!Ie)return{display:"none"};const Ze=Re==="far"?ge==="left"?"far-left":"far-right":ge==="left"?"left-adjacent":"right-adjacent",{start:Et}=ke!==null?bc(Ie,Ze,ke,_):{start:Re==="far"?sr(Ie,ge,_):ji(Ie,ge,_)},Ve=Do(Et,_),it=Mt(g,Ze),jt=!We&&Re==="adjacent"&&Ne&&!ae?Hy(Ie,ge,_):null,St=Re==="far"&&We&&ke===(ge==="left"?-1:1),cn=be&&!ye?!1:ye,un=Re==="adjacent"&&Ne&&ae&&!We;return{position:"absolute",top:Ve.top,left:Ve.left,width:Ve.width,height:Ve.height,objectFit:"contain",transform:it??(jt?`translate(${jt.x}px, ${jt.y}px)`:void 0),opacity:Re==="far"?Ne&&St?1:0:Ne?1:0,transition:cn?Re==="far"?`transform ${Xi}ms ${mn}`:`transform ${Xi}ms ${mn}, opacity ${Cn}ms ${mn}`:un?`transform ${Cn}ms ${mn}`:J==="opening"||ze?`opacity ${Cn}ms ${mn}`:"none",pointerEvents:"none",zIndex:1}},Qt=(g,ge)=>{const Re=Tt(g);return Re?_y(ji(Re,ge,_),ge,_):null},wt=g=>ge=>{if(!s){if(M.current){M.current=!1;return}ge.stopPropagation(),bt(g)}},Gt=De?Qt(De,"left"):null,pt=ot?Qt(ot,"right"):null,Ft=Gt?Do(Gt,_):null,Bt=pt?Do(pt,_):null;return r.jsxs("div",{ref:R,className:[`${e}-lightbox`,l?`${e}-lightbox-editor`:"",s?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:J==="open"?"none":void 0},onClick:Ke,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ne?ut:0,transition:be?"none":`opacity ${Cn}ms ${mn}`,pointerEvents:"none"}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[r.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},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:E,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:Ne?1:0,transition:be?"none":`opacity ${Cn}ms ${mn}`,pointerEvents:"none"},children:r.jsx(ec,{prefix:e,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:d,onClose:Ke})})]}),Ne&&kt&&r.jsx(Vo,{media:kt,style:Pt(kt,"left","far"),onMeasure:Qe,onTransitionEnd:Je},`far-prev-${kt.url}`),Ne&&De&&r.jsxs(r.Fragment,{children:[r.jsx(Vo,{media:De,style:Pt(De,"left"),onMeasure:Qe,onTransitionEnd:Je},`prev-${De.url}`),Ft&&r.jsx("div",{style:{position:"absolute",top:Ft.top,left:Ft.left,width:Ft.width,height:Ft.height,cursor:s||be?"default":"pointer",pointerEvents:s||be?"none":"auto",zIndex:3},onClick:wt(-1)})]}),Ne&&ot&&r.jsxs(r.Fragment,{children:[r.jsx(Vo,{media:ot,style:Pt(ot,"right"),onMeasure:Qe,onTransitionEnd:Je},`next-${ot.url}`),Bt&&r.jsx("div",{style:{position:"absolute",top:Bt.top,left:Bt.left,width:Bt.width,height:Bt.height,cursor:s||be?"default":"pointer",pointerEvents:s||be?"none":"auto",zIndex:3},onClick:wt(1)})]}),Ne&&_t&&r.jsx(Vo,{media:_t,style:Pt(_t,"right","far"),onMeasure:Qe,onTransitionEnd:Je},`far-next-${_t.url}`),G&&V&&(je?r.jsx(jy,{src:V.url,phase:J,onMediaElement:Jt,wrapperStyle:Vt,videoStyle:zt,onLoadedMetadata:ft,onTransitionEnd:Je},`${n}-${V.url}`):r.jsx("img",{ref:Jt,src:V.url,alt:V.name,onLoad:ft,onTransitionEnd:Je,style:Vt},`${n}-${V.url}`))]})}const zy=20,By=.18;function Dy(e){return`
|
|
17606
|
+
`}const Tn=500,Yi=650,mn="cubic-bezier(0.22, 1, 0.36, 1)",Ry=72,Ey=50,My=1e4,ky=650,Py=500;function Ay(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,l=e.top-t.top;return`translate(${o}px, ${l}px) scale(${n}, ${i})`}function xc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=ir(e);return{left:i.x,top:i.y,width:i.width,height:i.height}}const n=e.getBoundingClientRect();return{left:n.left,top:n.top,width:n.width,height:n.height}}function Fy(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?xc(i,n):null}function Wy(e){return e.reduce((t,n,i)=>{var o;return(o=n.image)!=null&&o.url&&t.push({gridIndex:i,items:[n.image],entry:{title1:n.title??"",title2:n.subtitle??"",title3:n.caption??""}}),t},[])}function Qi(e,t,n){var o;if(e.length<=1)return null;const i=(t+n+e.length)%e.length;return((o=e[i])==null?void 0:o.items[0])??null}function rs(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return Qi(e,i,n)}const _y=.03;function wc(e){return e.width*_y}const ea={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Bo(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function as(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Hy(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function fa(e,t,n){const i=e.getBoundingClientRect(),o=i.width,l=i.height,s=t/n,c=o/l;if(s>c){const u=o/s;return{width:o,height:u,left:i.left,top:i.top+(l-u)/2}}const d=l*s;return{width:d,height:l,left:i.left+(o-d)/2,top:i.top}}function Ny(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:fa(e,t.width,t.height)}function Oy(e,t){if(Lr(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function jy(e){const t=new Set,n=[];for(const i of e){const o=i.image;!(o!=null&&o.url)||t.has(o.url)||(t.add(o.url),n.push(o))}return n}function zy({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Lr(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function ji(e,t,n){const{width:i,height:o,top:l}=e,{left:s,width:c}=n,d=wc(n);return t==="left"?{left:s+d-i,top:l,width:i,height:o}:{left:s+c-d,top:l,width:i,height:o}}function lr(e,t,n){const i=ji(e,t,n);return{...i,left:2*i.left-e.left}}function By(e,t,n){const{left:i,width:o}=n,l=wc(n);return t==="left"?{left:i,top:e.top,width:l,height:e.height}:{left:i+o-l,top:e.top,width:l,height:e.height}}function Sc(e,t,n,i){const o=ji(e,"left",i),l=ji(e,"right",i),s=lr(e,"left",i),c=lr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:l,end:e};case"left-adjacent":return{start:o,end:s};case"far-right":return{start:c,end:l};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:l};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:l,end:c};case"far-left":return{start:s,end:o};default:return{start:e,end:e}}}function Dy(e,t,n,i){const{start:o,end:l}=Sc(e,t,n,i);return{x:l.left-o.left,y:l.top-o.top}}function Vy(e,t,n){const i=ji(e,t,n),o=lr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Lr(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Gy({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:l,onTransitionEnd:s}){const c=a.useRef(null);return a.useEffect(()=>{const d=c.current;return n==null||n(d??null),()=>{d==null||d.pause(),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:s,children:r.jsx("video",{ref:c,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:l,onClick:d=>d.stopPropagation(),style:o},e)})}function Do({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Lr(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const l=o.currentTarget;l.videoWidth>0&&l.videoHeight>0&&(i==null||i(e.url,l.videoWidth,l.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const l=o.currentTarget;l.naturalWidth>0&&l.naturalHeight>0&&(i==null||i(e.url,l.naturalWidth,l.naturalHeight))},onTransitionEnd:n})}function qy({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:c,canNavigate:d,lightboxEntries:u,entryIdx:m,layoutId:x,sourceRect:w,resolveCloseSourceRect:$,onClose:f,onPrev:S,onNext:L}){const M=a.useRef(null),A=a.useRef(null),C=a.useRef(null),J=a.useRef(new Map),[k,U]=a.useState(0),I=a.useRef(null),R=a.useRef(0),T=a.useRef(0),y=a.useRef("none"),h=a.useRef(!1),F=a.useRef(!1),W=a.useRef(!1),V=a.useRef(null),ne=a.useRef(null),X=a.useRef(null),z=a.useRef(()=>{}),H=a.useRef(null),_=a.useRef(null),E=a.useRef(null),q=a.useRef(!1),[Y,ee]=a.useState(null),[N,pe]=a.useState(ea),[b,ye]=a.useState(0),[Q,xe]=a.useState("opening"),[$e,oe]=a.useState(0),[ie,B]=a.useState(0),[le,re]=a.useState(!1),[ke,fe]=a.useState(null),[Pe,ve]=a.useState(null),[we,Se]=a.useState(null),[G,me]=a.useState(!1),[D,K]=a.useState(null),[ae,ge]=a.useState(!1),ce=a.useRef(!1),[be,Ee]=a.useState(!1),[Z,de]=a.useState(!1),We=a.useRef(n),se=a.useRef(void 0),O=t[n],Oe=O?Lr(O):!1,_e=ie!==0||le,nt=!s&&(!l||!!c),Ue=d&&!s,Ce=u.length>1,Fe=a.useCallback((g,ue)=>t.length<=1?null:t[(g+ue+t.length)%t.length]??null,[t]),He=Ce?Qi(u,m,-1):Fe(n,-1),Ze=Ce?Qi(u,m,1):Fe(n,1),Tt=ke===-1&&_e?Ce&&Pe!==null?Qi(u,Pe,-1):we!==null?Fe(we,-1):null:null,it=ke===1&&_e?Ce&&Pe!==null?Qi(u,Pe,1):we!==null?Fe(we,1):null:null,De=Tt&&Tt.url!==(He==null?void 0:He.url)?Tt:null,et=it&&it.url!==(Ze==null?void 0:Ze.url)?it:null,dt=He&&Ue?(()=>{const g=Ce?rs(u,m,-1):t.length>2?Fe((n-1+t.length)%t.length,-1):null;return g&&g.url!==He.url?g:null})():null,lt=Ze&&Ue?(()=>{const g=Ce?rs(u,m,1):t.length>2?Fe((n+1)%t.length,1):null;return g&&g.url!==Ze.url?g:null})():null,ht=De??dt,Rt=et??lt,ot=a.useCallback((g,ue,Te)=>{if(!g||!ue||!Te)return;const Le=J.current,tt=Le.get(g);(tt==null?void 0:tt.width)===ue&&(tt==null?void 0:tt.height)===Te||(Le.set(g,{width:ue,height:Te}),U(kt=>kt+1))},[]),xt=a.useCallback(g=>{if(!(g!=null&&g.url))return null;const ue=J.current.get(g.url);return Ny(A.current,ue)},[k,b]),zt=a.useCallback(()=>{if(!O)return;const g=xt(O);if(g){ee(g);return}const ue=A.current;ue&&ee(as(ue))},[O,xt]),rt=a.useCallback(g=>{if(Ce){const ue=u.length;ve((m+g+ue)%ue),Se(null);return}t.length>1&&(Se((n+g+t.length)%t.length),ve(null))},[Ce,u.length,m,t.length,n]),qe=a.useCallback(g=>{W.current=g,re(g)},[]),Ne=a.useCallback(()=>{V.current!==null&&(window.clearTimeout(V.current),V.current=null)},[]),pt=a.useCallback(()=>{Ne(),V.current=window.setTimeout(()=>{Ne(),qe(!1)},Yi+32)},[Ne,qe]),yt=a.useCallback(()=>{const g=M.current;if(!g){pe({left:0,top:0,width:typeof window<"u"?window.innerWidth:ea.width,height:typeof window<"u"?window.innerHeight:ea.height});return}const ue=g.getBoundingClientRect();pe({left:ue.left,top:ue.top,width:ue.width,height:ue.height})},[]),Mt=a.useCallback((g,ue)=>{if(_e){if(be&&!le)return`translate(${ie}px, 0px)`;if(le&&ke!==null){const Te=xt(g);if(!Te)return;const{x:Le,y:tt}=Dy(Te,ue,ke,N);return`translate(${Le}px, ${tt}px)`}if(le)return"translate(0px, 0px)"}},[_e,be,le,ie,ke,N,xt]),Dt=a.useCallback(()=>{const g=ne.current;ne.current=null,Ne(),qe(!1),fe(null),ve(null),Se(null),B(0),Ee(!1),h.current=!1,T.current=0,y.current="none",g===-1?S():g===1&&L()},[Ne,qe,S,L]),en=a.useCallback(()=>{Ne(),V.current=window.setTimeout(()=>{ne.current!==null&&Dt()},Yi+32)},[Ne,Dt]),sn=a.useCallback(()=>{Ne(),ne.current=null,qe(!1),fe(null),ve(null),Se(null),B(0),Ee(!1),h.current=!1,T.current=0,y.current="none"},[Ne,qe]),Lt=a.useCallback(g=>{if(!(!Ue||!Y)){if(W.current){if(ne.current===g){X.current=g,Dt();return}sn()}Ne(),rt(g),ne.current=g,fe(g),qe(!0),en()}},[Ue,Y,Dt,sn,Ne,rt,qe,en]);z.current=Lt;const Et=a.useCallback(()=>{H.current=null,q.current=!1,_.current!==null&&(window.clearInterval(_.current),_.current=null),E.current!==null&&(window.clearTimeout(E.current),E.current=null)},[]),Qt=a.useCallback(g=>{_.current!==null&&window.clearInterval(_.current);const ue=q.current?Py:ky;_.current=window.setInterval(()=>{z.current(g)},ue)},[]),Ut=a.useCallback(g=>{H.current!==g&&(Et(),H.current=g,q.current=!1,z.current(g),Qt(g),E.current=window.setTimeout(()=>{E.current=null,H.current===g&&(q.current=!0,Qt(g))},My))},[Et,Qt]),ft=a.useCallback(()=>{const g=A.current;if(!g)return;const ue=O==null?void 0:O.url,Te=ue?J.current.get(ue):void 0;if(Te!=null&&Te.width&&(Te!=null&&Te.height)){ee(fa(g,Te.width,Te.height));return}const Le=C.current;if(Le&&ue&&(Le.src===ue||Le.currentSrc===ue)){const{width:kt,height:Ke}=Hy(Le);if(kt&&Ke){ot(ue,kt,Ke),ee(fa(g,kt,Ke));return}}const tt=as(g);!tt.width||!tt.height||ee(tt)},[O==null?void 0:O.url,ot]),qt=a.useCallback(g=>{if(C.current=g,!!g){if(g instanceof HTMLVideoElement){g.readyState>=1&&g.videoWidth>0&&ft();return}g.complete&&g.naturalWidth>0&&ft()}},[ft]),Re=a.useCallback(()=>{yt(),ft(),ye(g=>g+1)},[yt,ft]);a.useEffect(()=>{Re();const g=A.current,ue=M.current,Te=new ResizeObserver(()=>Re());return g&&Te.observe(g),ue&&Te.observe(ue),window.addEventListener("resize",Re),()=>{Te.disconnect(),window.removeEventListener("resize",Re)}},[Re,n,x]),a.useLayoutEffect(()=>{if(!O)return;const g=C.current;if(g){if(g instanceof HTMLImageElement&&g.complete&&g.naturalWidth>0){ft();return}g instanceof HTMLVideoElement&&g.readyState>=1&&g.videoWidth>0&&ft()}},[O==null?void 0:O.url,n,ft]),a.useEffect(()=>{zt()},[zt,k]),a.useEffect(()=>{const g=new Set,ue=[],Te=Le=>{!(Le!=null&&Le.url)||g.has(Le.url)||(g.add(Le.url),ue.push(Le))};t.forEach(Te),u.forEach(Le=>Le.items.forEach(Te)),ue.forEach(Le=>{J.current.has(Le.url)||Oy(Le,ot)})},[t,u,ot]),a.useEffect(()=>{if(Q!=="opening"||!Y)return;if(!w){xe("open");return}me(!1);const g=requestAnimationFrame(()=>{requestAnimationFrame(()=>{me(!0),xe("open")})});return()=>cancelAnimationFrame(g)},[Q,Y,w]),a.useEffect(()=>{if(Q!=="closing")return;const g=setTimeout(()=>f(),Tn);return()=>clearTimeout(g)},[Q,f]),a.useEffect(()=>()=>{Ne()},[Ne]),a.useLayoutEffect(()=>{We.current===n&&se.current===(O==null?void 0:O.url)||(Ne(),ne.current=null,fe(null),ve(null),Se(null),oe(0),B(0),qe(!1),de(!1),Ee(!1),R.current=0,T.current=0,y.current="none",h.current=!1,I.current=null,F.current=!1,C.current=null,zt(),We.current=n,se.current=O==null?void 0:O.url)},[n,O==null?void 0:O.url,qe,Ne,zt]),a.useLayoutEffect(()=>{const g=X.current;g!==null&&(X.current=null,requestAnimationFrame(()=>{z.current(g)}))},[n,m,O==null?void 0:O.url]),a.useLayoutEffect(()=>{if(Q==="opening"){ce.current=!1,ge(!1);return}if(Q!=="open"||ce.current)return;if(!He&&!Ze){ce.current=!0;return}ge(!1);const g=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ge(!0),ce.current=!0})});return()=>cancelAnimationFrame(g)},[Q,He==null?void 0:He.url,Ze==null?void 0:Ze.url]),a.useEffect(()=>{if(Q!=="open")return;const g=()=>{const Ke=st=>{st.stopPropagation(),st.preventDefault(),document.removeEventListener("click",Ke,!0)};document.addEventListener("click",Ke,!0)},ue=Ke=>{const st=Ke<0?1:-1;Ne(),rt(st),ne.current=st,fe(st),qe(!0),en()},Te=Ke=>{if(Math.abs(Ke)>Ey&&Ue){ue(Ke);return}ne.current=null,fe(null),ve(null),Se(null),qe(!0),B(0),pt()},Le=Ke=>{if(Ke.touches.length!==1||W.current)return;const st=Ke.touches[0];F.current=!0,I.current={x:st.clientX,y:st.clientY},y.current="none",T.current=0,h.current=!1},tt=Ke=>{if(!I.current||Ke.touches.length!==1||W.current)return;const st=Ke.touches[0],_t=st.clientX-I.current.x,It=st.clientY-I.current.y;if(y.current==="none"){if(Math.abs(_t)<10&&Math.abs(It)<10)return;if(Math.abs(_t)>Math.abs(It)){if(!Ue)return;y.current="horizontal"}else if(It>0){if(!nt)return;y.current="vertical"}else return}if(y.current==="horizontal"){h.current=!0,Ee(!0),T.current=_t,B(_t),Ke.preventDefault();return}y.current==="vertical"&&(h.current=!0,Ee(!0),R.current=It,oe(It),Ke.preventDefault())},kt=()=>{if(!I.current)return;const Ke=y.current,st=h.current;if(st&&Ke==="horizontal")Te(T.current),g();else if(st&&Ke==="vertical"){const _t=R.current;if(nt&&_t>Ry){const It=window.innerHeight;R.current=It,de(!0),oe(It),xe("closing")}else R.current=0,oe(0);g()}else Ke==="horizontal"&&Math.abs(T.current)>0&&(Te(T.current),g());I.current=null,y.current="none",T.current=0,h.current=!1,Ee(!1)};return document.addEventListener("touchstart",Le,{passive:!0}),document.addEventListener("touchmove",tt,{passive:!1}),document.addEventListener("touchend",kt),document.addEventListener("touchcancel",kt),()=>{document.removeEventListener("touchstart",Le),document.removeEventListener("touchmove",tt),document.removeEventListener("touchend",kt),document.removeEventListener("touchcancel",kt)}},[Q,Ue,qe,pt,Ne,nt,en,rt]);const Ve=a.useCallback(()=>{const g=($==null?void 0:$())??w??null;g&&Y&&(K(g),me(!0)),xe("closing")},[$,w,Y]);a.useEffect(()=>{const g=Le=>{if(Le.key==="Escape"){if(l&&c||Q==="closing")return;Et(),Ve();return}if(Le.key!=="ArrowLeft"&&Le.key!=="ArrowRight"||Q!=="open"||!Ue)return;Le.preventDefault();const tt=Le.key==="ArrowLeft"?-1:1;Le.repeat&&H.current===tt||Ut(tt)},ue=Le=>{if(Le.key!=="ArrowLeft"&&Le.key!=="ArrowRight")return;const tt=Le.key==="ArrowLeft"?-1:1;H.current===tt&&Et()},Te=()=>{Et()};return window.addEventListener("keydown",g),window.addEventListener("keyup",ue),window.addEventListener("blur",Te),()=>{window.removeEventListener("keydown",g),window.removeEventListener("keyup",ue),window.removeEventListener("blur",Te),Et()}},[Q,l,c,Ve,Ue,Ut,Et]),a.useEffect(()=>{Q!=="open"&&Et()},[Q,Et]);const Xe=()=>{Q==="closing"||s||Ve()},ze=Q==="open",mt=Q==="closing",Nt=$e>0?Math.max(0,1-$e/500):1,Ae=$e>0?Math.max(.35,1-$e/500):1,Ye=a.useCallback(g=>{if(!(g.propertyName!=="transform"||!W.current)){if(ne.current!==null){Dt();return}Ne(),qe(!1)}},[Ne,qe,Dt]),Je=Q==="closing"?D??w:w,bt=Je&&Y&&(Q==="opening"||mt)?Ay(Je,Y):void 0,$t=_e&&O?Mt(O,"center"):$e>0?`translateY(${$e}px)`:bt,ut=Y?Bo(Y,N):null,Pt=!!(Je&&Y),At=Pt&&(Q==="closing"||Q==="open"&&G),Vt={position:"absolute",top:ut==null?void 0:ut.top,left:ut==null?void 0:ut.left,width:ut==null?void 0:ut.width,height:ut==null?void 0:ut.height,objectFit:"contain",transformOrigin:"top left",transform:$t,opacity:$e>0?Ae:Pt?1:Q==="opening"||mt?0:1,transition:be&&!le?"none":le?`transform ${Yi}ms ${mn}`:Z?`transform ${Tn}ms ${mn}, opacity ${Tn}ms ${mn}`:At?`transform ${Tn}ms ${mn}`:Q==="opening"||mt?`opacity ${Tn}ms ${mn}`:"none",pointerEvents:Oe&&ze&&!_e?"auto":"none",touchAction:Oe&&ze?"none":void 0,zIndex:1,overflow:Oe?"hidden":void 0},Kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:ze&&!_e?"auto":"none"},Ft=(g,ue,Te="adjacent")=>{const Le=xt(g);if(!Le)return{display:"none"};const tt=Te==="far"?ue==="left"?"far-left":"far-right":ue==="left"?"left-adjacent":"right-adjacent",{start:kt}=ke!==null?Sc(Le,tt,ke,N):{start:Te==="far"?lr(Le,ue,N):ji(Le,ue,N)},Ke=Bo(kt,N),st=Mt(g,tt),_t=!_e&&Te==="adjacent"&&ze&&!ae?Vy(Le,ue,N):null,It=Te==="far"&&_e&&ke===(ue==="left"?-1:1),cn=be&&!le?!1:le,un=Te==="adjacent"&&ze&&ae&&!_e;return{position:"absolute",top:Ke.top,left:Ke.left,width:Ke.width,height:Ke.height,objectFit:"contain",transform:st??(_t?`translate(${_t.x}px, ${_t.y}px)`:void 0),opacity:Te==="far"?ze&&It?1:0:ze?1:0,transition:cn?Te==="far"?`transform ${Yi}ms ${mn}`:`transform ${Yi}ms ${mn}, opacity ${Tn}ms ${mn}`:un?`transform ${Tn}ms ${mn}`:Q==="opening"||mt?`opacity ${Tn}ms ${mn}`:"none",pointerEvents:"none",zIndex:1}},Yt=(g,ue)=>{const Te=xt(g);return Te?By(ji(Te,ue,N),ue,N):null},wt=g=>ue=>{if(!s){if(F.current){F.current=!1;return}ue.stopPropagation(),Lt(g)}},Ot=He?Yt(He,"left"):null,jt=Ze?Yt(Ze,"right"):null,Bt=Ot?Bo(Ot,N):null,vt=jt?Bo(jt,N):null;return r.jsxs("div",{ref:M,className:[`${e}-lightbox`,l?`${e}-lightbox-editor`:"",s?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:Q==="open"?"none":void 0},onClick:Xe,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:ze?Nt:0,transition:be?"none":`opacity ${Tn}ms ${mn}`,pointerEvents:"none"}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[r.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},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:A,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:ze?1:0,transition:be?"none":`opacity ${Tn}ms ${mn}`,pointerEvents:"none"},children:r.jsx(nc,{prefix:e,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:c,onClose:Xe})})]}),ze&&ht&&r.jsx(Do,{media:ht,style:Ft(ht,"left","far"),onMeasure:ot,onTransitionEnd:Ye},`far-prev-${ht.url}`),ze&&He&&r.jsxs(r.Fragment,{children:[r.jsx(Do,{media:He,style:Ft(He,"left"),onMeasure:ot,onTransitionEnd:Ye},`prev-${He.url}`),Bt&&r.jsx("div",{style:{position:"absolute",top:Bt.top,left:Bt.left,width:Bt.width,height:Bt.height,cursor:s||be?"default":"pointer",pointerEvents:s||be?"none":"auto",zIndex:3},onClick:wt(-1)})]}),ze&&Ze&&r.jsxs(r.Fragment,{children:[r.jsx(Do,{media:Ze,style:Ft(Ze,"right"),onMeasure:ot,onTransitionEnd:Ye},`next-${Ze.url}`),vt&&r.jsx("div",{style:{position:"absolute",top:vt.top,left:vt.left,width:vt.width,height:vt.height,cursor:s||be?"default":"pointer",pointerEvents:s||be?"none":"auto",zIndex:3},onClick:wt(1)})]}),ze&&Rt&&r.jsx(Do,{media:Rt,style:Ft(Rt,"right","far"),onMeasure:ot,onTransitionEnd:Ye},`far-next-${Rt.url}`),Y&&O&&(Oe?r.jsx(Gy,{src:O.url,phase:Q,onMediaElement:qt,wrapperStyle:Vt,videoStyle:Kt,onLoadedMetadata:ft,onTransitionEnd:Ye},`${n}-${O.url}`):r.jsx("img",{ref:qt,src:O.url,alt:O.name,onLoad:ft,onTransitionEnd:Ye,style:Vt},`${n}-${O.url}`))]})}const Ky=20,Uy=.18;function Xy(e){return`
|
|
17539
17607
|
.${e}-wrapper {
|
|
17540
17608
|
box-sizing: border-box;
|
|
17541
17609
|
max-width: 100%;
|
|
@@ -17554,6 +17622,18 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
17554
17622
|
overflow-wrap: anywhere;
|
|
17555
17623
|
word-break: break-word;
|
|
17556
17624
|
}
|
|
17625
|
+
.${e}-type-a.${e}-wrapper,
|
|
17626
|
+
.${e}-type-a .${e}-item-title {
|
|
17627
|
+
text-align: left;
|
|
17628
|
+
}
|
|
17629
|
+
.${e}-type-b.${e}-wrapper,
|
|
17630
|
+
.${e}-type-b .${e}-item-title {
|
|
17631
|
+
text-align: center;
|
|
17632
|
+
}
|
|
17633
|
+
.${e}-type-c.${e}-wrapper,
|
|
17634
|
+
.${e}-type-c .${e}-item-title {
|
|
17635
|
+
text-align: right;
|
|
17636
|
+
}
|
|
17557
17637
|
.${e}-item-image {
|
|
17558
17638
|
display: inline-block;
|
|
17559
17639
|
vertical-align: baseline;
|
|
@@ -17563,6 +17643,9 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
17563
17643
|
width: calc(1cap * var(--${e}-image-aspect));
|
|
17564
17644
|
margin: 0 var(--${e}-image-inline-gap);
|
|
17565
17645
|
}
|
|
17646
|
+
.${e}-item-image-fit {
|
|
17647
|
+
width: calc(1cap * var(--${e}-item-media-aspect, var(--${e}-image-aspect)));
|
|
17648
|
+
}
|
|
17566
17649
|
.${e}-item-image img,
|
|
17567
17650
|
.${e}-item-image video {
|
|
17568
17651
|
position: absolute;
|
|
@@ -17576,7 +17659,6 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
17576
17659
|
}
|
|
17577
17660
|
.${e}-item-image-hover-scale img,
|
|
17578
17661
|
.${e}-item-image-hover-scale video {
|
|
17579
|
-
transform-origin: center center;
|
|
17580
17662
|
transition: transform 0.3s ease;
|
|
17581
17663
|
}
|
|
17582
17664
|
.${e}-item-image-hover-scale:hover {
|
|
@@ -17608,11 +17690,12 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
17608
17690
|
z-index: 2;
|
|
17609
17691
|
pointer-events: auto;
|
|
17610
17692
|
}
|
|
17611
|
-
${
|
|
17612
|
-
`}function
|
|
17693
|
+
${Iy(e)}
|
|
17694
|
+
`}function Yy(e){const{imageDisplay:t}=e??{},n=(t==null?void 0:t.ratioValue)??"1:1",i=(t==null?void 0:t.reversed)??!1,[o,l]=n.split(":").map(Number),s=i?l:o,c=i?o:l;return c>0?s/c:1}function Zy(e){const t=e instanceof HTMLVideoElement?e.videoWidth:e.naturalWidth,n=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight;return!t||!n?null:t/n}function Jy(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:v.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:v.scalingValue(i*Uy,n??!1),[`--${t}-image-aspect`]:Yy(e)}}function Qy(e,t){var i,o;const n={fontSettings:{fontFamily:(e==null?void 0:e.titleFontFamily)??"Arial",fontWeight:((i=e==null?void 0:e.titleFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e==null?void 0:e.titleFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:(e==null?void 0:e.titleFontSize)??.07,lineHeight:e==null?void 0:e.titleLineHeight,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,color:(e==null?void 0:e.titleColor)??"#000000"};return Xt(n,t)}function ev(e){var o;const t=((o=e==null?void 0:e.imageDisplay)==null?void 0:o.display)==="cover",n=((e==null?void 0:e.lightbox)??"on")==="on",i={objectFit:t?"cover":"contain",pointerEvents:"auto",...n?{cursor:"pointer"}:null};return{objectFitMode:t?"cover":"contain",imageStyle:i}}function tv(e,t,n,i,o,l){if(!(!e||!t))return s=>{var d;const c=((d=s.currentTarget.closest(`.${i}-item`))==null?void 0:d.querySelector(`[data-waterfall-index="${n}"]`))??(s.currentTarget instanceof HTMLImageElement||s.currentTarget instanceof HTMLVideoElement?s.currentTarget:null);l(n,c?xc(c,o):void 0)}}function nv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:l,portalId:s}){const{prefix:c}=v.useScopedStyles(),d=a.useMemo(()=>Xy(c),[c]),u=t??[],m=(e==null?void 0:e.type)??"a",x=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,w=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,$=v.scalingValue(w,n??!1),f=`max(${$}, ${Ky}px)`,{objectFitMode:S,imageStyle:L}=ev(e),M=Qy(e,n),A=a.useRef(null),[C,J]=a.useState(!1),[k,U]=a.useState([]),[I,R]=a.useState(0),[T,y]=a.useState(0),[h,F]=a.useState(null),[W,V]=a.useState({title1:"",title2:"",title3:""}),ne=(!n||i)&&!C,X=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},z=X.sizeType??"none",H=ne&&z!=="none"?`${c}-item-image-hover-${z}`:void 0,_=(X.value??120)/100,E=a.useCallback(ie=>{!ie||z!=="scale"||(ie.style.transformOrigin=Ep(ie))},[z]),q=a.useCallback(ie=>{if(ie){if(S==="contain"){const B=Zy(ie);if(B){const le=ie.closest(`.${c}-item-image`);le instanceof HTMLElement&&le.style.setProperty(`--${c}-item-media-aspect`,String(B))}}E(ie)}},[c,E,S]),Y={width:v.scalingValue(x,n??!1),...M,...Jy(e,c,n),[`--${c}-image-hover-scale`]:String(_)},ee=(()=>{const ie={},B=A.current?getComputedStyle(A.current).getPropertyValue("--cntrl-article-width").trim():"";return B&&(ie["--cntrl-article-width"]=B),ie})(),N=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),pe=a.useMemo(()=>Wy(u),[u]),b=a.useMemo(()=>jy(u),[u]),ye=(ie,B)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const le=pe.findIndex(ke=>ke.gridIndex===ie);if(le<0)return;const re=pe[le];y(le),U(re.items),R(0),V(re.entry),F(B??null),J(!0)},Q=a.useCallback(()=>{J(!1),F(null)},[]),xe=a.useCallback(()=>{const ie=pe[T];return!ie||!A.current?h:Fy(A.current,ie.gridIndex,S)??h},[pe,T,h,S]),$e=a.useCallback(ie=>{if(pe.length>1){const B=pe.length,le=(T+ie+B)%B,re=pe[le];y(le),U(re.items),R(0),V(re.entry);return}R(B=>(B+ie+k.length)%k.length)},[pe,T,k.length]),oe=pe.length>1||k.length>1;return a.useEffect(()=>{if(!C||typeof document>"u")return;const ie=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ie}},[C]),a.useEffect(()=>{!n||o||i||J(!1)},[n,o,i]),a.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&J(!1)},[e==null?void 0:e.lightbox]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),r.jsx(zy,{mediaList:b}),r.jsx("div",{ref:A,className:`${c}-wrapper ${c}-type-${m}`,style:Y,children:u.map((ie,B)=>{var ke,fe;const le=!!((ke=ie.image)!=null&&ke.url),re=tv(!!N,le,B,c,S,ye);return r.jsxs("div",{className:`${c}-item`,children:[ie.title?r.jsx("span",{className:`${c}-item-title`,onClick:re,style:re?{cursor:"pointer"}:void 0,children:ie.title}):null,(fe=ie.image)!=null&&fe.url?r.jsx("span",{className:[`${c}-item-image`,S==="contain"?`${c}-item-image-fit`:void 0,H].filter(Boolean).join(" "),children:ie.image.type==="video"?r.jsx("video",{ref:q,src:ie.image.url,"data-waterfall-index":B,style:L,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:re,onLoadedData:Pe=>q(Pe.currentTarget)}):r.jsx("img",{ref:q,src:ie.image.url,alt:ie.image.name??"","data-waterfall-index":B,style:L,onClick:re,onLoad:Pe=>q(Pe.currentTarget)})}):null,B<u.length-1&&r.jsx("div",{className:`${c}-item-gap-host`,style:{width:$},children:o&&!C&&r.jsx("div",{"data-controls":"horizontalGap","data-controls-axis":"x","data-controls-min":"0",className:`${c}-item-gap-control`,style:{left:"50%",transform:"translateX(-50%)",width:f,height:"100%"}})})]},B)})}),C&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const ie=(s?document.getElementById(s):null)??document.body;return gi.createPortal(r.jsx("div",{style:ee,"data-selection":"none",children:r.jsx(qy,{prefix:c,items:k,index:I,entry:W,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:oe,lightboxEntries:pe,entryIdx:T,layoutId:l,sourceRect:h,resolveCloseSourceRect:xe,onClose:Q,onPrev:()=>$e(-1),onNext:()=>$e(1)})}),ie)})()]})}const iv=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
17613
17695
|
import type React from 'react';
|
|
17614
17696
|
import { createPortal } from 'react-dom';
|
|
17615
17697
|
import { CommonComponentProps } from '../props';
|
|
17698
|
+
import { getContainedMediaTransformOrigin } from '../utils/getImageRect';
|
|
17616
17699
|
import { scalingValue, useScopedStyles } from '../utils/index';
|
|
17617
17700
|
import { textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
17618
17701
|
import {
|
|
@@ -17636,6 +17719,7 @@ export type WaterfallContentItem = {
|
|
|
17636
17719
|
};
|
|
17637
17720
|
|
|
17638
17721
|
export type WaterfallSettings = {
|
|
17722
|
+
type?: 'a' | 'b' | 'c';
|
|
17639
17723
|
wrapperWidth?: number;
|
|
17640
17724
|
imageDisplay?: {
|
|
17641
17725
|
display: 'fit' | 'cover';
|
|
@@ -17693,6 +17777,18 @@ function getCSS(P: string): string {
|
|
|
17693
17777
|
overflow-wrap: anywhere;
|
|
17694
17778
|
word-break: break-word;
|
|
17695
17779
|
}
|
|
17780
|
+
.\${P}-type-a.\${P}-wrapper,
|
|
17781
|
+
.\${P}-type-a .\${P}-item-title {
|
|
17782
|
+
text-align: left;
|
|
17783
|
+
}
|
|
17784
|
+
.\${P}-type-b.\${P}-wrapper,
|
|
17785
|
+
.\${P}-type-b .\${P}-item-title {
|
|
17786
|
+
text-align: center;
|
|
17787
|
+
}
|
|
17788
|
+
.\${P}-type-c.\${P}-wrapper,
|
|
17789
|
+
.\${P}-type-c .\${P}-item-title {
|
|
17790
|
+
text-align: right;
|
|
17791
|
+
}
|
|
17696
17792
|
.\${P}-item-image {
|
|
17697
17793
|
display: inline-block;
|
|
17698
17794
|
vertical-align: baseline;
|
|
@@ -17702,6 +17798,9 @@ function getCSS(P: string): string {
|
|
|
17702
17798
|
width: calc(1cap * var(--\${P}-image-aspect));
|
|
17703
17799
|
margin: 0 var(--\${P}-image-inline-gap);
|
|
17704
17800
|
}
|
|
17801
|
+
.\${P}-item-image-fit {
|
|
17802
|
+
width: calc(1cap * var(--\${P}-item-media-aspect, var(--\${P}-image-aspect)));
|
|
17803
|
+
}
|
|
17705
17804
|
.\${P}-item-image img,
|
|
17706
17805
|
.\${P}-item-image video {
|
|
17707
17806
|
position: absolute;
|
|
@@ -17715,7 +17814,6 @@ function getCSS(P: string): string {
|
|
|
17715
17814
|
}
|
|
17716
17815
|
.\${P}-item-image-hover-scale img,
|
|
17717
17816
|
.\${P}-item-image-hover-scale video {
|
|
17718
|
-
transform-origin: center center;
|
|
17719
17817
|
transition: transform 0.3s ease;
|
|
17720
17818
|
}
|
|
17721
17819
|
.\${P}-item-image-hover-scale:hover {
|
|
@@ -17761,6 +17859,13 @@ function getImageAspectRatio(settings: WaterfallSettings | undefined): number {
|
|
|
17761
17859
|
return effH > 0 ? effW / effH : 1;
|
|
17762
17860
|
}
|
|
17763
17861
|
|
|
17862
|
+
function getMediaAspectRatio(media: HTMLImageElement | HTMLVideoElement): number | null {
|
|
17863
|
+
const mediaW = media instanceof HTMLVideoElement ? media.videoWidth : media.naturalWidth;
|
|
17864
|
+
const mediaH = media instanceof HTMLVideoElement ? media.videoHeight : media.naturalHeight;
|
|
17865
|
+
if (!mediaW || !mediaH) return null;
|
|
17866
|
+
return mediaW / mediaH;
|
|
17867
|
+
}
|
|
17868
|
+
|
|
17764
17869
|
function getWaterfallTextMetricsVars(
|
|
17765
17870
|
settings: WaterfallSettings | undefined,
|
|
17766
17871
|
varPrefix: string,
|
|
@@ -17847,6 +17952,7 @@ export function Waterfall({
|
|
|
17847
17952
|
const { prefix: P } = useScopedStyles();
|
|
17848
17953
|
const scopedCss = useMemo(() => getCSS(P), [P]);
|
|
17849
17954
|
const items = content ?? [];
|
|
17955
|
+
const type = settings?.type ?? 'a';
|
|
17850
17956
|
const wrapperWidth = typeof settings?.wrapperWidth === 'number' ? settings.wrapperWidth : 1;
|
|
17851
17957
|
const horizontalGap = typeof settings?.horizontalGap === 'number' ? settings.horizontalGap : 0;
|
|
17852
17958
|
const horizontalGapScaled = scalingValue(horizontalGap, isEditor ?? false);
|
|
@@ -17870,6 +17976,31 @@ export function Waterfall({
|
|
|
17870
17976
|
: undefined;
|
|
17871
17977
|
const imageHoverScale = (imageHoverEffect.value ?? 120) / 100;
|
|
17872
17978
|
|
|
17979
|
+
const applyScaleTransformOrigin = useCallback((
|
|
17980
|
+
media: HTMLImageElement | HTMLVideoElement | null,
|
|
17981
|
+
) => {
|
|
17982
|
+
if (!media || imageHoverType !== 'scale') return;
|
|
17983
|
+
media.style.transformOrigin = getContainedMediaTransformOrigin(media);
|
|
17984
|
+
}, [imageHoverType]);
|
|
17985
|
+
|
|
17986
|
+
const syncFitMediaLayout = useCallback((
|
|
17987
|
+
media: HTMLImageElement | HTMLVideoElement | null,
|
|
17988
|
+
) => {
|
|
17989
|
+
if (!media) return;
|
|
17990
|
+
|
|
17991
|
+
if (objectFitMode === 'contain') {
|
|
17992
|
+
const aspect = getMediaAspectRatio(media);
|
|
17993
|
+
if (aspect) {
|
|
17994
|
+
const wrapper = media.closest(\`.\${P}-item-image\`);
|
|
17995
|
+
if (wrapper instanceof HTMLElement) {
|
|
17996
|
+
wrapper.style.setProperty(\`--\${P}-item-media-aspect\`, String(aspect));
|
|
17997
|
+
}
|
|
17998
|
+
}
|
|
17999
|
+
}
|
|
18000
|
+
|
|
18001
|
+
applyScaleTransformOrigin(media);
|
|
18002
|
+
}, [P, applyScaleTransformOrigin, objectFitMode]);
|
|
18003
|
+
|
|
17873
18004
|
const wrapperStyle = {
|
|
17874
18005
|
width: scalingValue(wrapperWidth, isEditor ?? false),
|
|
17875
18006
|
...inlineTitleStyle,
|
|
@@ -17959,7 +18090,7 @@ export function Waterfall({
|
|
|
17959
18090
|
<>
|
|
17960
18091
|
<style dangerouslySetInnerHTML={{ __html: scopedCss }} />
|
|
17961
18092
|
<PreloadedMediaPool mediaList={allMedia} />
|
|
17962
|
-
<div ref={containerRef} className={\`\${P}-wrapper\`} style={wrapperStyle}>
|
|
18093
|
+
<div ref={containerRef} className={\`\${P}-wrapper \${P}-type-\${type}\`} style={wrapperStyle}>
|
|
17963
18094
|
{items.map((item, index) => {
|
|
17964
18095
|
const hasLightbox = Boolean(item.image?.url);
|
|
17965
18096
|
const handleOpen = createWaterfallItemOpenHandler(
|
|
@@ -17986,9 +18117,16 @@ export function Waterfall({
|
|
|
17986
18117
|
</span>
|
|
17987
18118
|
) : null}
|
|
17988
18119
|
{item.image?.url ? (
|
|
17989
|
-
<span
|
|
18120
|
+
<span
|
|
18121
|
+
className={[
|
|
18122
|
+
\`\${P}-item-image\`,
|
|
18123
|
+
objectFitMode === 'contain' ? \`\${P}-item-image-fit\` : undefined,
|
|
18124
|
+
imageHoverClass,
|
|
18125
|
+
].filter(Boolean).join(' ')}
|
|
18126
|
+
>
|
|
17990
18127
|
{item.image.type === 'video' ? (
|
|
17991
18128
|
<video
|
|
18129
|
+
ref={syncFitMediaLayout}
|
|
17992
18130
|
src={item.image.url}
|
|
17993
18131
|
data-waterfall-index={index}
|
|
17994
18132
|
style={imageStyle}
|
|
@@ -17997,14 +18135,17 @@ export function Waterfall({
|
|
|
17997
18135
|
loop
|
|
17998
18136
|
autoPlay
|
|
17999
18137
|
onClick={handleOpen}
|
|
18138
|
+
onLoadedData={(e) => syncFitMediaLayout(e.currentTarget)}
|
|
18000
18139
|
/>
|
|
18001
18140
|
) : (
|
|
18002
18141
|
<img
|
|
18142
|
+
ref={syncFitMediaLayout}
|
|
18003
18143
|
src={item.image.url}
|
|
18004
18144
|
alt={item.image.name ?? ''}
|
|
18005
18145
|
data-waterfall-index={index}
|
|
18006
18146
|
style={imageStyle}
|
|
18007
18147
|
onClick={handleOpen}
|
|
18148
|
+
onLoad={(e) => syncFitMediaLayout(e.currentTarget)}
|
|
18008
18149
|
/>
|
|
18009
18150
|
)}
|
|
18010
18151
|
</span>
|
|
@@ -18064,7 +18205,7 @@ export function Waterfall({
|
|
|
18064
18205
|
</>
|
|
18065
18206
|
);
|
|
18066
18207
|
}
|
|
18067
|
-
`,Zy="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),On={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 Jy(e){const t={};return t[Be(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Be(e,"fontSettings")]={...On.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Be(e,"fontSize")]={...On.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Be(e,"lineHeight")]={...On.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Be(e,"letterSpacing")]={...On.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Be(e,"wordSpacing")]={...On.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Be(e,"textAlign")]={...On.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Be(e,"textAppearance")]={...On.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Oi=Kn.filter(e=>e!=="count"),Qy=Oi.reduce((e,t)=>({...e,...Jy(t)}),{}),ev=Oi.reduce((e,t)=>({...e,[Be(t,"fontFamily")]:"Arial",[Be(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Be(t,"letterSpacing")]:0,[Be(t,"wordSpacing")]:0,[Be(t,"textAlign")]:"left",[Be(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function na(e){return Oi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Be(n,"fontSize")]=i),o!==void 0&&(t[Be(n,"lineHeight")]=o),t},{})}const tv={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Oi.map(e=>[Oa[e],za(e)]))},Go={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},nv=[{title:"Salton Sea from Above",...Go,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...Go,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...Go,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...Go,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],iv={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!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"}},caption:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"cover",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"]}},required:["image"]},default:nv},settings:{sizing:"auto auto",properties:{wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},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"}}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageHoverEffect:{type:"object",scope:"common",title:"Hover",display:{type:"toggle-cycle-numeric-input",enum:["none","scale","saturate"],inputs:{none:"none",scale:"single",saturate:"none"},defaultValue:120,showDash:!1},min:0,max:9999,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},horizontalGap:{type:"number",scope:"layout",title:"Gutter",min:0,display:{type:"range-control"}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},titleColor:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title1Color:{type:"string",scope:"common",title:"Title Lightbox",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Lightbox",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Lightbox",display:{type:"palette-color-picker"}},contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",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"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...On.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",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"]}}},...Qy},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightbox:"on",imageHoverEffect:{sizeType:"none",value:120,min:100,max:200},titleColor:"#000000",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:Zy,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...ev},layoutDefaults:{d:{wrapperWidth:1,horizontalGap:.006944,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,titleFontSize:.0625,titleLineHeight:.05555,titleLetterSpacing:-34722e-8,...na({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})},m:{wrapperWidth:1,horizontalGap:.026666,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,titleFontSize:.16,titleLineHeight:.13333,...na({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{wrapperWidth:1,horizontalGap:.01302,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.03906,iconMarginRight:.026,titleFontSize:.07,titleLineHeight:.07,...na({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})}},layout:["__componentName__","wrapperWidth","imageDisplay","lightbox","imageHoverEffect","horizontalGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","contentMarginTop","closeIconMaxWidth","iconMarginRight","titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["wrapperWidth","lightbox"]},{type:"row",title:"Image",items:["imageDisplay","imageHoverEffect"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Lightbox",items:[tv]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},ov={element:Xy,id:"waterfall",name:"Waterfall",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/waterfall.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},...Oi.map(e=>({path:`${Be(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...Oi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Be(t,"fontFamily")}`}),{})},schema:iv,sourceCode:Yy},ls="500ms",ss={color:"#000000",hover:"#cccccc"},Yi={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},rv={s:{paddingY:5,paddingActive:5,borderRadius:9,dot:4,activeDot:8,gapInactive:9,inset:5},m:{paddingY:7,paddingActive:7,borderRadius:17,dot:8,activeDot:20,gapInactive:22,inset:7},l:{paddingY:10,paddingActive:10,borderRadius:29,dot:20,activeDot:38,gapInactive:26,inset:10}},ia={offset:{x:0,y:0},linkColor:"#cccccc"},cs={sizeType:"drag",value:3},av="left";function lv(e,t){var i,o;const n={fontSettings:{fontFamily:(e==null?void 0:e.titleFontFamily)??"Arial",fontWeight:((i=e==null?void 0:e.titleFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e==null?void 0:e.titleFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:(e==null?void 0:e.titleFontSize)??.02,lineHeight:(e==null?void 0:e.titleLineHeight)??.02,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,textAlign:av,color:(e==null?void 0:e.titleColor)??"#000000"};return Xt(n,t)}function bi(e,t,n){return`${e}: ${y.scalingValue(t/1440,n)};`}function sv(e,t){return`
|
|
18208
|
+
`,ov="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),zn={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 rv(e){const t={};return t[Ge(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ge(e,"fontSettings")]={...zn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ge(e,"fontSize")]={...zn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ge(e,"lineHeight")]={...zn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ge(e,"letterSpacing")]={...zn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ge(e,"wordSpacing")]={...zn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ge(e,"textAlign")]={...zn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ge(e,"textAppearance")]={...zn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const zi=Un.filter(e=>e!=="count"),av=zi.reduce((e,t)=>({...e,...rv(t)}),{}),lv=zi.reduce((e,t)=>({...e,[Ge(t,"fontFamily")]:"Arial",[Ge(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ge(t,"letterSpacing")]:0,[Ge(t,"wordSpacing")]:0,[Ge(t,"textAlign")]:"left",[Ge(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ta(e){return zi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ge(n,"fontSize")]=i),o!==void 0&&(t[Ge(n,"lineHeight")]=o),t},{})}const sv={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(zi.map(e=>[Oa[e],ja(e)]))},Vo={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},cv=[{title:"Salton Sea from Above",...Vo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...Vo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...Vo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...Vo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],dv={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!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"}},caption:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"cover",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"]}},required:["image"]},default:cv},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},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"}}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageHoverEffect:{type:"object",scope:"common",title:"Hover",display:{type:"toggle-cycle-numeric-input",enum:["none","scale","saturate"],inputs:{none:"none",scale:"single",saturate:"none"},defaultValue:120,showDash:!1},min:0,max:9999,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},horizontalGap:{type:"number",scope:"layout",title:"Gutter",min:0,display:{type:"range-control"}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},titleColor:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title1Color:{type:"string",scope:"common",title:"Title Lightbox",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Lightbox",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Lightbox",display:{type:"palette-color-picker"}},contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",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"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...zn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",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"]}}},...av},defaults:{type:"a",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightbox:"on",imageHoverEffect:{sizeType:"none",value:120,min:100,max:200},titleColor:"#000000",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:ov,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...lv},layoutDefaults:{d:{wrapperWidth:1,horizontalGap:.006944,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,titleFontSize:.0625,titleLineHeight:.05555,titleLetterSpacing:-34722e-8,...ta({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})},m:{wrapperWidth:1,horizontalGap:.026666,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,titleFontSize:.16,titleLineHeight:.13333,...ta({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{wrapperWidth:1,horizontalGap:.01302,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.03906,iconMarginRight:.026,titleFontSize:.07,titleLineHeight:.07,...ta({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})}},layout:["__componentName__","type","wrapperWidth","imageDisplay","lightbox","imageHoverEffect","horizontalGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","contentMarginTop","closeIconMaxWidth","iconMarginRight","titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["wrapperWidth","lightbox"]},{type:"row",title:"Image",items:["imageDisplay","imageHoverEffect"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Lightbox",items:[sv]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},uv={element:nv,id:"waterfall",name:"Waterfall",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/waterfall.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},...zi.map(e=>({path:`${Ge(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...zi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ge(t,"fontFamily")}`}),{})},schema:dv,sourceCode:iv},ls="500ms",ss={color:"#000000",hover:"#cccccc"},Zi={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},pv={s:{paddingY:5,paddingActive:5,borderRadius:9,dot:4,activeDot:8,gapInactive:9,inset:5},m:{paddingY:7,paddingActive:7,borderRadius:17,dot:8,activeDot:20,gapInactive:22,inset:7},l:{paddingY:10,paddingActive:10,borderRadius:29,dot:20,activeDot:38,gapInactive:26,inset:10}},na={offset:{x:0,y:0},linkColor:"#cccccc"},cs={sizeType:"drag",value:3},mv="left";function gv(e,t){var i,o;const n={fontSettings:{fontFamily:(e==null?void 0:e.titleFontFamily)??"Arial",fontWeight:((i=e==null?void 0:e.titleFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e==null?void 0:e.titleFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:(e==null?void 0:e.titleFontSize)??.02,lineHeight:(e==null?void 0:e.titleLineHeight)??.02,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,textAlign:mv,color:(e==null?void 0:e.titleColor)??"#000000"};return Xt(n,t)}function xi(e,t,n){return`${e}: ${v.scalingValue(t/1440,n)};`}function hv(e,t){return`
|
|
18068
18209
|
.${e}-wrapper {
|
|
18069
18210
|
position: relative;
|
|
18070
18211
|
width: 100%;
|
|
@@ -18100,29 +18241,29 @@ export function Waterfall({
|
|
|
18100
18241
|
top: 50%;
|
|
18101
18242
|
z-index: 1;
|
|
18102
18243
|
padding: 0;
|
|
18103
|
-
${
|
|
18104
|
-
${
|
|
18244
|
+
${xi("width",30,t)}
|
|
18245
|
+
${xi("height",30,t)}
|
|
18105
18246
|
transition: opacity 0.15s ease-in-out;
|
|
18106
18247
|
}
|
|
18107
18248
|
.${e}-arrow-prev {
|
|
18108
|
-
${
|
|
18249
|
+
${xi("left",-20,t)}
|
|
18109
18250
|
transform: translate3d(-50%, -50%, 0);
|
|
18110
18251
|
}
|
|
18111
18252
|
.${e}-arrow-next {
|
|
18112
18253
|
left: unset;
|
|
18113
|
-
${
|
|
18254
|
+
${xi("right",-20,t)}
|
|
18114
18255
|
transform: translate3d(50%, -50%, 0);
|
|
18115
18256
|
}
|
|
18116
18257
|
.${e}-arrow-prev-vertical {
|
|
18117
18258
|
left: 50%;
|
|
18118
|
-
${
|
|
18259
|
+
${xi("top",-20,t)}
|
|
18119
18260
|
transform: translate3d(-50%, -50%, 0);
|
|
18120
18261
|
}
|
|
18121
18262
|
.${e}-arrow-next-vertical {
|
|
18122
18263
|
left: 50%;
|
|
18123
18264
|
right: unset;
|
|
18124
18265
|
top: unset;
|
|
18125
|
-
${
|
|
18266
|
+
${xi("bottom",-20,t)}
|
|
18126
18267
|
transform: translate3d(-50%, 50%, 0);
|
|
18127
18268
|
}
|
|
18128
18269
|
.${e}-arrow-hidden {
|
|
@@ -18266,7 +18407,7 @@ export function Waterfall({
|
|
|
18266
18407
|
from { clip-path: inset(100% 0 0 0); }
|
|
18267
18408
|
to { clip-path: inset(0 0 0 0); }
|
|
18268
18409
|
}
|
|
18269
|
-
`}function
|
|
18410
|
+
`}function fv({settings:e,content:t,isEditor:n}){const{prefix:i}=v.useScopedStyles(),[o,l]=a.useState(null),s=gv(e,n),[c,d]=a.useState(void 0),[u,m]=a.useState(null),[x,w]=a.useState(0),[$,f]=a.useState(!1),[S,L]=a.useState(0),M=t??[],A=(e==null?void 0:e.trigger)??cs,C=A.sizeType??"drag",J=A.value??cs.value,k=(e==null?void 0:e.direction)??"horizontal",U=(e==null?void 0:e.transition)??"slide",I=(e==null?void 0:e.nav)??"classic",R=(e==null?void 0:e.navSize)??"m",T=pv[R],y=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,h=ve=>v.scalingValue(ve*y,n),F=(e==null?void 0:e.show)??"always",W=(e==null?void 0:e.controls)??null,V=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,ne=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,X=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,z=(e==null?void 0:e.controlsColor)??ss.color,H=(e==null?void 0:e.controlsHoverColor)??ss.hover,_=(e==null?void 0:e.navColor)??Zi.colors.inactive,E=(e==null?void 0:e.navPaginationColor)??Zi.colors.pagination,q=(e==null?void 0:e.navBackgroundColor)??Zi.colors.background,Y=(e==null?void 0:e.linkColor)??na.linkColor,ee=k==="horizontal",N=C==="click",pe=C==="drag",b=C==="auto",ye=U==="fade in"||U==="reveal",Q=I==="classic",xe=F!=="never",$e=F==="on hover",oe=a.useRef(U),ie=a.useRef(C),B=a.useRef(J),le=a.useRef(k),re=a.useRef(I),ke=v.scalingValue(V,n),fe={width:ke,height:ke,maxWidth:ke},Pe=ve=>{o&&o.go(ve)};return a.useEffect(()=>{if(!$)return;const ve=window.setTimeout(()=>f(!1),300);return()=>window.clearTimeout(ve)},[$,x]),a.useEffect(()=>{if(!u)return;const ve=new ResizeObserver(we=>{if(!o)return;const[Se]=we;d({width:Math.round(Se.contentRect.width),height:Math.round(Se.contentRect.height)})});return ve.observe(u),()=>ve.unobserve(u)},[u]),a.useEffect(()=>{oe.current!==U&&(L(ve=>ve+1),oe.current=U)},[U]),a.useEffect(()=>{ie.current!==C&&(L(ve=>ve+1),ie.current=C)},[C]),a.useEffect(()=>{B.current!==J&&(L(ve=>ve+1),B.current=J)},[J]),a.useEffect(()=>{le.current!==k&&(L(ve=>ve+1),le.current=k)},[k]),a.useEffect(()=>{re.current!==I&&(L(ve=>ve+1),re.current=I)},[I]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:hv(i,n)}}),r.jsxs("div",{className:at(`${i}-wrapper`,{[`${i}-transition-reveal`]:U==="reveal",[`${i}-transition-reveal-vertical`]:U==="reveal"&&!ee}),ref:m,children:[r.jsxs("div",{className:`${i}-slider-inner`,style:{width:c?c.width:"100%",height:c?c.height:"100%",backgroundColor:"transparent"},children:[r.jsx(br,{onMove:ve=>{f(!0),w(ve.index)},ref:l,options:{arrows:!1,speed:parseInt(ls),autoplay:b,...b&&{interval:J*1e3},direction:ee||ye?"ltr":"ttb",pagination:!1,drag:pe,perPage:1,width:c?c.width:"100%",height:c?c.height:"100%",type:ye?"fade":"loop",rewind:!0},children:M.map((ve,we)=>r.jsx(xr,{children:r.jsx("div",{className:`${i}-slider-item`,children:r.jsx("div",{className:`${i}-img-wrapper`,children:r.jsx("img",{className:at(`${i}-slider-image`,{[`${i}-contain`]:ve.image.objectFit==="contain",[`${i}-cover`]:ve.image.objectFit==="cover"}),src:ve.image.url,alt:ve.image.name??""})})})},we))},S),xe&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:at(`${i}-arrow`,{[`${i}-arrow-prev`]:ee,[`${i}-arrow-prev-vertical`]:!ee,[`${i}-hover-arrow`]:$e}),style:{color:z,"--arrow-hover-color":H,...fe},children:r.jsxs("button",{onClick:ve=>{ve.stopPropagation(),Pe("-1")},className:`${i}-arrow-inner`,style:{transform:`translate(${v.scalingValue(ne,n)}, ${v.scalingValue(X*(ee?1:-1),n)}) rotate(${ee?"0deg":"90deg"})`},children:[W&&r.jsx(on,{url:W,fill:z,hoverFill:H,className:at(`${i}-arrow-img`,`${i}-mirror`),style:fe}),!W&&r.jsx(ds,{color:z,className:at(`${i}-arrow-icon`,`${i}-arrow-img`,`${i}-mirror`)})]})}),r.jsx("div",{className:at(`${i}-arrow`,{[`${i}-arrow-next`]:ee,[`${i}-arrow-next-vertical`]:!ee,[`${i}-hover-arrow`]:$e}),style:{color:z,"--arrow-hover-color":H,...fe},children:r.jsxs("button",{className:`${i}-arrow-inner`,onClick:ve=>{ve.stopPropagation(),Pe("+1")},style:{transform:`translate(${v.scalingValue(ne*(ee?-1:1),n)}, ${v.scalingValue(X,n)}) rotate(${ee?"0deg":"90deg"})`},children:[W&&r.jsx(on,{url:W,fill:z,hoverFill:H,className:`${i}-arrow-img`,style:fe}),!W&&r.jsx(ds,{color:z,className:at(`${i}-arrow-icon`,`${i}-arrow-img`)})]})})]}),N&&r.jsx("div",{className:`${i}-click-overlay`,onClick:()=>{o&&o.go("+1")}}),Q&&r.jsx("div",{className:at(`${i}-pagination`,{[`${i}-pagination-inside-bottom`]:ee,[`${i}-pagination-inside-left`]:!ee}),style:ee?{bottom:h(T.inset)}:{left:h(T.inset)},children:r.jsx("div",{className:at(`${i}-pagination-inner`,{[`${i}-pagination-vertical`]:!ee,[`${i}-animate-dots`]:$}),style:{backgroundColor:q,gap:h(T.gapInactive-T.activeDot+T.dot),...ee?{height:h(T.activeDot+T.paddingY*2),paddingTop:h(T.paddingY),paddingBottom:h(T.paddingY),paddingLeft:h(T.paddingActive),paddingRight:h(T.paddingActive)}:{width:h(T.activeDot+T.paddingY*2),paddingLeft:h(T.paddingY),paddingRight:h(T.paddingY),paddingTop:h(T.paddingActive),paddingBottom:h(T.paddingActive)},borderRadius:h(T.borderRadius),transform:`translate(${v.scalingValue(Zi.offset.x,n)}, ${v.scalingValue(Zi.offset.y,n)})`},children:M.map((ve,we)=>{const Se=we===x,G=Se?T.activeDot:T.dot;return r.jsx("button",{onClick:()=>{o&&o.go(we)},className:`${i}-pagination-item`,style:{width:h(T.activeDot)},children:r.jsx("div",{className:`${i}-dot`,style:{backgroundColor:Se?E:_,width:h(G)}})},we)})},`${R}-${k}`)})]}),r.jsx("div",{className:`${i}-caption-block`,children:r.jsx("div",{className:`${i}-caption-text-wrapper`,children:M.map((ve,we)=>r.jsx("div",{className:at(`${i}-caption-text`,{[`${i}-with-pointer-events`]:we===x&&n,[`${i}-active`]:we===x}),style:{...s,width:"max-content",transitionDuration:`${Math.round(parseInt(ls)/2)}ms`},children:r.jsx("div",{className:`${i}-caption-text-inner`,style:{"--link-color":Y,"--link-hover-color":Y,position:"relative",top:v.scalingValue(na.offset.y,n),left:v.scalingValue(na.offset.x,n)},children:r.jsx(mi,{content:ve.imageCaption})})},we))})})]})]})}function ds({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 yv=`import React, { useState, useEffect, useRef } from 'react';
|
|
18270
18411
|
import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
18271
18412
|
import '@splidejs/react-splide/css/core';
|
|
18272
18413
|
import cn from 'classnames';
|
|
@@ -19010,4 +19151,4 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
19010
19151
|
</svg>
|
|
19011
19152
|
);
|
|
19012
19153
|
}
|
|
19013
|
-
`,
|
|
19154
|
+
`,vv={type:"object",version:1,settings:{sizing:"manual",properties:{trigger:{type:"object",scope:"common",title:"Trigger",display:{type:"toggle-cycle-numeric-input",enum:["click","drag","auto"],inputs:{click:"none",drag:"none",auto:"single"},defaultValue:3,showDash:!1},min:1,max:5,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical"]}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["slide","fade in","reveal"]}},nav:{type:"string",scope:"common",title:"Nav",display:{type:"toggle-cycle",enum:["classic","no"]}},navSize:{type:"string",scope:"layout",title:"Nav Size",display:{type:"toggle-cycle",enum:["s","m","l"]}},navUnit:{type:"number",scope:"layout",title:"",display:{type:"numeric-input",visible:!1},min:0,max:1},controls:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},controlsMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"numeric-input"},min:0,max:9999},show:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","on hover","never"]}},paddingX:{type:"number",scope:"layout",title:"Padding X",display:{type:"numeric-input"},min:-9999,max:9999},paddingY:{type:"number",scope:"layout",title:"Padding Y",display:{type:"numeric-input"},min:-9999,max:9999},controlsColor:{type:"string",scope:"common",title:"Controls Default",display:{type:"palette-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"palette-color-picker"}},navColor:{type:"string",scope:"common",title:"Dot Nav",display:{type:"palette-color-picker"}},navPaginationColor:{type:"string",scope:"common",title:"Active Nav",display:{type:"palette-color-picker"}},navBackgroundColor:{type:"string",scope:"common",title:"BG Nav",display:{type:"palette-color-picker"}},linkColor:{type:"string",scope:"common",title:"Link Default",display:{type:"palette-color-picker"}},titleColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{type:"object",scope:"common",title:"",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},titleFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",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"]}}}},defaults:{trigger:{sizeType:"drag",value:3,min:1,max:5},direction:"horizontal",transition:"slide",nav:"classic",controls:null,show:"always",controlsColor:"#000000",controlsHoverColor:"#3F3F3F",navColor:"#A4A4A4",navPaginationColor:"#FFFFFF",navBackgroundColor:"#000000",linkColor:"#2E12F0",titleColor:"#000000",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{controlsMaxWidth:30/1440,paddingX:0,paddingY:0,titleFontSize:16/1440,titleLineHeight:16/1440,navSize:"m",navUnit:1/1440},t:{controlsMaxWidth:30/768,paddingX:-10/768,paddingY:0,titleFontSize:16/768,titleLineHeight:16/768,navSize:"m",navUnit:1/768},m:{controlsMaxWidth:30/375,paddingX:-14/375,paddingY:0,titleFontSize:16/375,titleLineHeight:16/375,navSize:"m",navUnit:1/375}},displayRules:[{if:{name:"show",value:"never"},then:{name:"properties.controlsColor.display.visible",value:!1}},{if:{name:"show",value:"never"},then:{name:"properties.controlsHoverColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navPaginationColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navBackgroundColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navSize.display.visible",value:!1}}],layout:["__componentName__","trigger","direction","transition","nav","navSize","controls","controlsMaxWidth","show","paddingX","paddingY","titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["trigger","direction"]},{type:"row",title:"",items:["transition","nav"]},{type:"row",title:"",items:["navSize"]},{type:"group",title:"Controls",items:[{type:"row",title:"",items:["controls","controlsMaxWidth"]},{type:"row",title:"",items:["paddingX","paddingY"]},{type:"row",title:"",items:["show"]}]}]},{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"]}]}],paletteBookmark:{items:["controlsColor","controlsHoverColor","navPaginationColor","navColor","navBackgroundColor","titleColor","linkColor"],panelIds:["general","typeStyle"]},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/Component-default-1.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Earth-orbital mission"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Salton Sea from Above"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Lunar Module Pilot"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Lunar Module 3 porch"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Command Module"}]}]}]}},bv={element:fv,id:"slider-2-0",name:"Slider 2.0",category:"galleries",version:1,defaultSize:{d:{width:400,height:400},t:{width:400,height:400},m:{width:300,height:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Slider.mp4"},schema:vv,sourceCode:yv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls"}]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily"}},xv=[Fu,zu,iy,Ap,Bp,Jp,ym,Sm,Em,Ym,Dg,Gh,ef,Hf,Uf,hy,uv,Ly,bv];exports.components=xv;exports.isSchemaV1=Tc;
|