@cntrl-site/components 1.0.94 → 1.0.96
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/MarqueeText/MarqueeText.d.ts +0 -1
- package/dist/index.js +80 -52
- package/dist/index.mjs +5059 -5025
- 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 a=require("react/jsx-runtime"),s=require("react"),Ct=require("classnames"),F=require("./panelAvailability-D8c7cdbu.js"),Gn=require("react-dom");function Yp(e){return e.type==="object"&&e.version===1}const Zp="ControlSlider-module__wrapper___sHEkd",Jp="ControlSlider-module__hoverArrow___A-dOH",Qp="ControlSlider-module__sliderItem___QQSkR",em="ControlSlider-module__sliderImage___9hRl-",tm="ControlSlider-module__arrow___05ghY",nm="ControlSlider-module__arrowVertical___tBfVN",im="ControlSlider-module__nextArrow___-30Yc",om="ControlSlider-module__arrowInner___aEra3",rm="ControlSlider-module__arrowIcon___S4ztF",am="ControlSlider-module__arrowImg___2dwJW",sm="ControlSlider-module__mirror___brd6U",lm="ControlSlider-module__pagination___bicLF",cm="ControlSlider-module__paginationInner___bT-P-",dm="ControlSlider-module__paginationVertical___zYqKw",um="ControlSlider-module__paginationItem___nTRbk",pm="ControlSlider-module__dot___p1Qun",mm="ControlSlider-module__activeDot___LHFaj",gm="ControlSlider-module__paginationInsideBottom___R3FWn",hm="ControlSlider-module__paginationInsideTop___V-qb-",fm="ControlSlider-module__paginationOutsideBottom___14w8D",ym="ControlSlider-module__paginationOutsideTop___SCLqB",vm="ControlSlider-module__paginationInsideLeft___yOBRZ",xm="ControlSlider-module__paginationInsideRight___Rtt3o",bm="ControlSlider-module__paginationOutsideLeft___lahaw",Sm="ControlSlider-module__paginationOutsideRight___EtuQa",wm="ControlSlider-module__imgWrapper___UjEgB",$m="ControlSlider-module__captionBlock___dJ6-j",Cm="ControlSlider-module__captionTextWrapper___HFlpf",Tm="ControlSlider-module__captionText___uGBVc",Lm="ControlSlider-module__active___WZK4G",Pm="ControlSlider-module__withPointerEvents___t-18M",Im="ControlSlider-module__topLeftAlignment___zjnGM",Rm="ControlSlider-module__topCenterAlignment___gD1xW",km="ControlSlider-module__topRightAlignment___NMapS",Em="ControlSlider-module__middleLeftAlignment___OnUrY",Mm="ControlSlider-module__middleCenterAlignment___Tdkl0",Am="ControlSlider-module__middleRightAlignment___wEbfX",Fm="ControlSlider-module__bottomLeftAlignment___cTP2-",Nm="ControlSlider-module__bottomCenterAlignment___c54fB",_m="ControlSlider-module__bottomRightAlignment___kEwrz",Hm="ControlSlider-module__clickOverlay___DZA28",Wm="ControlSlider-module__contain___pLyq7",Om="ControlSlider-module__cover___KdDat",$t={wrapper:Zp,hoverArrow:Jp,sliderItem:Qp,sliderImage:em,arrow:tm,arrowVertical:nm,nextArrow:im,arrowInner:om,arrowIcon:rm,arrowImg:am,mirror:sm,pagination:lm,paginationInner:cm,paginationVertical:dm,paginationItem:um,dot:pm,activeDot:mm,paginationInsideBottom:gm,paginationInsideTop:hm,paginationOutsideBottom:fm,paginationOutsideTop:ym,paginationInsideLeft:vm,paginationInsideRight:xm,paginationOutsideLeft:bm,paginationOutsideRight:Sm,imgWrapper:wm,captionBlock:$m,captionTextWrapper:Cm,captionText:Tm,active:Lm,withPointerEvents:Pm,topLeftAlignment:Im,topCenterAlignment:Rm,topRightAlignment:km,middleLeftAlignment:Em,middleCenterAlignment:Mm,middleRightAlignment:Am,bottomLeftAlignment:Fm,bottomCenterAlignment:Nm,bottomRightAlignment:_m,clickOverlay:Hm,contain:Wm,cover:Om};function Dm(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 zm(e,t,n){return t&&Dm(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Ul="(prefers-reduced-motion: reduce)",mo=1,Bm=2,$o=3,Ho=4,$r=5,ia=6,ua=7,jm={CREATED:mo,MOUNTED:Bm,IDLE:$o,MOVING:Ho,SCROLLING:$r,DRAGGING:ia,DESTROYED:ua};function ai(e){e.length=0}function Ri(e,t,n){return Array.prototype.slice.call(e,t,n)}function Jt(e){return e.bind.apply(e,[null].concat(Ri(arguments,1)))}var Zd=setTimeout,Es=function(){};function Kl(e){return requestAnimationFrame(e)}function Ca(e,t){return typeof t===e}function dr(e){return!sl(e)&&Ca("object",e)}var al=Array.isArray,Jd=Jt(Ca,"function"),Ci=Jt(Ca,"string"),Cr=Jt(Ca,"undefined");function sl(e){return e===null}function Qd(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Tr(e){return al(e)?e:[e]}function Rn(e,t){Tr(e).forEach(t)}function ll(e,t){return e.indexOf(t)>-1}function oa(e,t){return e.push.apply(e,Tr(t)),e}function ti(e,t,n){e&&Rn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Bn(e,t){ti(e,Ci(t)?t.split(" "):t,!0)}function Lr(e,t){Rn(t,e.appendChild.bind(e))}function cl(e,t){Rn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function ur(e,t){return Qd(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function eu(e,t){var n=e?Ri(e.children):[];return t?n.filter(function(i){return ur(i,t)}):n}function Pr(e,t){return t?eu(e,t)[0]:e.firstElementChild}var pr=Object.keys;function Gi(e,t,n){return e&&(n?pr(e).reverse():pr(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function mr(e){return Ri(arguments,1).forEach(function(t){Gi(t,function(n,i){e[i]=t[i]})}),e}function bi(e){return Ri(arguments,1).forEach(function(t){Gi(t,function(n,i){al(n)?e[i]=n.slice():dr(n)?e[i]=bi({},dr(e[i])?e[i]:{},n):e[i]=n})}),e}function Yl(e,t){Rn(t||pr(e),function(n){delete e[n]})}function jn(e,t){Rn(e,function(n){Rn(t,function(i){n&&n.removeAttribute(i)})})}function Nt(e,t,n){dr(t)?Gi(t,function(i,o){Nt(e,o,i)}):Rn(e,function(i){sl(n)||n===""?jn(i,t):i.setAttribute(t,String(n))})}function vo(e,t,n){var i=document.createElement(e);return t&&(Ci(t)?Bn(i,t):Nt(i,t)),n&&Lr(n,i),i}function Mn(e,t,n){if(Cr(n))return getComputedStyle(e)[t];sl(n)||(e.style[t]=""+n)}function gr(e,t){Mn(e,"display",t)}function tu(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function An(e,t){return e.getAttribute(t)}function Zl(e,t){return e&&e.classList.contains(t)}function Tn(e){return e.getBoundingClientRect()}function qi(e){Rn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function nu(e){return Pr(new DOMParser().parseFromString(e,"text/html").body)}function Qn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function iu(e,t){return e&&e.querySelector(t)}function dl(e,t){return t?Ri(e.querySelectorAll(t)):[]}function ni(e,t){ti(e,t,!1)}function Ms(e){return e.timeStamp}function Ai(e){return Ci(e)?e:e?e+"px":""}var Ir="splide",ul="data-"+Ir;function ar(e,t){if(!e)throw new Error("["+Ir+"] "+(t||""))}var Ti=Math.min,pa=Math.max,ma=Math.floor,hr=Math.ceil,vn=Math.abs;function ou(e,t,n){return vn(e-t)<n}function ra(e,t,n,i){var o=Ti(t,n),r=pa(t,n);return i?o<e&&e<r:o<=e&&e<=r}function lo(e,t,n){var i=Ti(t,n),o=pa(t,n);return Ti(pa(i,e),o)}function As(e){return+(e>0)-+(e<0)}function Fs(e,t){return Rn(t,function(n){e=e.replace("%s",""+n)}),e}function pl(e){return e<10?"0"+e:""+e}var Jl={};function Vm(e){return""+e+pl(Jl[e]=(Jl[e]||0)+1)}function ru(){var e=[];function t(l,c,d,u){o(l,c,function(p,y,v){var m="addEventListener"in p,g=m?p.removeEventListener.bind(p,y,d,u):p.removeListener.bind(p,d);m?p.addEventListener(y,d,u):p.addListener(d),e.push([p,y,v,d,g])})}function n(l,c,d){o(l,c,function(u,p,y){e=e.filter(function(v){return v[0]===u&&v[1]===p&&v[2]===y&&(!d||v[3]===d)?(v[4](),!1):!0})})}function i(l,c,d){var u,p=!0;return typeof CustomEvent=="function"?u=new CustomEvent(c,{bubbles:p,detail:d}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(c,p,!1,d)),l.dispatchEvent(u),u}function o(l,c,d){Rn(l,function(u){u&&Rn(c,function(p){p.split(" ").forEach(function(y){var v=y.split(".");d(u,v[0],v[1])})})})}function r(){e.forEach(function(l){l[4]()}),ai(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var ki="mounted",Ns="ready",si="move",Wo="moved",ml="click",au="active",su="inactive",lu="visible",cu="hidden",sn="refresh",gn="updated",Co="resize",Ta="resized",du="drag",uu="dragging",pu="dragged",La="scroll",Yi="scrolled",Gm="overflow",gl="destroy",mu="arrows:mounted",gu="arrows:updated",hu="pagination:mounted",fu="pagination:updated",hl="navigation:mounted",fl="autoplay:play",yu="autoplay:playing",yl="autoplay:pause",vl="lazyload:loaded",vu="sk",xu="sh",ga="ei";function on(e){var t=e?e.event.bus:document.createDocumentFragment(),n=ru();function i(r,l){n.bind(t,Tr(r).join(" "),function(c){l.apply(l,al(c.detail)?c.detail:[])})}function o(r){n.dispatch(t,r,Ri(arguments,1))}return e&&e.event.on(gl,n.destroy),mr(n,{bus:t,on:i,off:Jt(n.unbind,t),emit:o})}function Pa(e,t,n,i){var o=Date.now,r,l=0,c,d=!0,u=0;function p(){if(!d){if(l=e?Ti((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return v();c=Kl(p)}}function y(k){k||g(),r=o()-(k?l*e:0),d=!1,c=Kl(p)}function v(){d=!0}function m(){r=o(),l=0,n&&n(l)}function g(){c&&cancelAnimationFrame(c),l=0,c=0,d=!0}function x(k){e=k}function b(){return d}return{start:y,rewind:m,pause:v,cancel:g,set:x,isPaused:b}}function Xm(e){var t=e;function n(o){t=o}function i(o){return ll(Tr(o),t)}return{set:n,is:i}}function qm(e,t){var n=Pa(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Um(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=ru(),c=[];function d(){var g=n.mediaQuery==="min";pr(o).sort(function(x,b){return g?+x-+b:+b-+x}).forEach(function(x){p(o[x],"("+(g?"min":"max")+"-width:"+x+"px)")}),p(r,Ul),y()}function u(g){g&&l.destroy()}function p(g,x){var b=matchMedia(x);l.bind(b,"change",y),c.push([g,b])}function y(){var g=i.is(ua),x=n.direction,b=c.reduce(function(k,f){return bi(k,f[1].matches?f[0]:{})},{});Yl(n),m(b),n.destroy?e.destroy(n.destroy==="completely"):g?(u(!0),e.mount()):x!==n.direction&&e.refresh()}function v(g){matchMedia(Ul).matches&&(g?bi(n,r):Yl(n,pr(r)))}function m(g,x,b){bi(n,g),x&&bi(Object.getPrototypeOf(n),g),(b||!i.is(mo))&&e.emit(gn,n)}return{setup:d,destroy:u,reduce:v,set:m}}var Ia="Arrow",Ra=Ia+"Left",ka=Ia+"Right",bu=Ia+"Up",Su=Ia+"Down",Ql="rtl",Ea="ttb",Va={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[bu,ka],ArrowRight:[Su,Ra]};function Km(e,t,n){function i(r,l,c){c=c||n.direction;var d=c===Ql&&!l?1:c===Ea?0:-1;return Va[r]&&Va[r][d]||r.replace(/width|left|right/i,function(u,p){var y=Va[u.toLowerCase()][d]||u;return p>0?y.charAt(0).toUpperCase()+y.slice(1):y})}function o(r){return r*(n.direction===Ql?1:-1)}return{resolve:i,orient:o}}var ii="role",xo="tabindex",Ym="disabled",Fn="aria-",Rr=Fn+"controls",wu=Fn+"current",ec=Fn+"selected",Pn=Fn+"label",xl=Fn+"labelledby",$u=Fn+"hidden",bl=Fn+"orientation",fr=Fn+"roledescription",tc=Fn+"live",nc=Fn+"busy",ic=Fn+"atomic",Sl=[ii,xo,Ym,Rr,wu,Pn,xl,$u,bl,fr],Xn=Ir+"__",Ei="is-",Ga=Ir,oc=Xn+"track",Zm=Xn+"list",Ma=Xn+"slide",Cu=Ma+"--clone",Jm=Ma+"__container",wl=Xn+"arrows",Aa=Xn+"arrow",Tu=Aa+"--prev",Lu=Aa+"--next",Fa=Xn+"pagination",Pu=Fa+"__page",Qm=Xn+"progress",eg=Qm+"__bar",tg=Xn+"toggle",ng=Xn+"spinner",ig=Xn+"sr",og=Ei+"initialized",Ui=Ei+"active",Iu=Ei+"prev",Ru=Ei+"next",_s=Ei+"visible",Hs=Ei+"loading",ku=Ei+"focus-in",Eu=Ei+"overflow",rg=[Ui,_s,Iu,Ru,Hs,ku,Eu],ag={slide:Ma,clone:Cu,arrows:wl,arrow:Aa,prev:Tu,next:Lu,pagination:Fa,page:Pu,spinner:ng};function sg(e,t){if(Jd(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!ur(n,t);)n=n.parentElement;return n}var lg=5,rc=200,Mu="touchstart mousedown",Xa="touchmove mousemove",qa="touchend touchcancel mouseup click";function cg(e,t,n){var i=on(e),o=i.on,r=i.bind,l=e.root,c=n.i18n,d={},u=[],p=[],y=[],v,m,g;function x(){S(),O(),f()}function b(){o(sn,k),o(sn,x),o(gn,f),r(document,Mu+" keydown",function(I){g=I.type==="keydown"},{capture:!0}),r(l,"focusin",function(){ti(l,ku,!!g)})}function k(I){var N=Sl.concat("style");ai(u),ni(l,p),ni(v,y),jn([v,m],N),jn(l,I?N:["style",fr])}function f(){ni(l,p),ni(v,y),p=z(Ga),y=z(oc),Bn(l,p),Bn(v,y),Nt(l,Pn,n.label),Nt(l,xl,n.labelledby)}function S(){v=U("."+oc),m=Pr(v,"."+Zm),ar(v&&m,"A track/list element is missing."),oa(u,eu(m,"."+Ma+":not(."+Cu+")")),Gi({arrows:wl,pagination:Fa,prev:Tu,next:Lu,bar:eg,toggle:tg},function(I,N){d[N]=U("."+I)}),mr(d,{root:l,track:v,list:m,slides:u})}function O(){var I=l.id||Vm(Ir),N=n.role;l.id=I,v.id=v.id||I+"-track",m.id=m.id||I+"-list",!An(l,ii)&&l.tagName!=="SECTION"&&N&&Nt(l,ii,N),Nt(l,fr,c.carousel),Nt(m,ii,"presentation")}function U(I){var N=iu(l,I);return N&&sg(N,"."+Ga)===l?N:void 0}function z(I){return[I+"--"+n.type,I+"--"+n.direction,n.drag&&I+"--draggable",n.isNavigation&&I+"--nav",I===Ga&&Ui]}return mr(d,{setup:x,mount:b,destroy:k})}var To="slide",Oo="loop",kr="fade";function dg(e,t,n,i){var o=on(e),r=o.on,l=o.emit,c=o.bind,d=e.Components,u=e.root,p=e.options,y=p.isNavigation,v=p.updateOnMove,m=p.i18n,g=p.pagination,x=p.slideFocus,b=d.Direction.resolve,k=An(i,"style"),f=An(i,Pn),S=n>-1,O=Pr(i,"."+Jm),U;function z(){S||(i.id=u.id+"-slide"+pl(t+1),Nt(i,ii,g?"tabpanel":"group"),Nt(i,fr,m.slide),Nt(i,Pn,f||Fs(m.slideLabel,[t+1,e.length]))),I()}function I(){c(i,"click",Jt(l,ml,X)),c(i,"keydown",Jt(l,vu,X)),r([Wo,xu,Yi],L),r(hl,q),v&&r(si,$)}function N(){U=!0,o.destroy(),ni(i,rg),jn(i,Sl),Nt(i,"style",k),Nt(i,Pn,f||"")}function q(){var R=e.splides.map(function(E){var V=E.splide.Components.Slides.getAt(t);return V?V.slide.id:""}).join(" ");Nt(i,Pn,Fs(m.slideX,(S?n:t)+1)),Nt(i,Rr,R),Nt(i,ii,x?"button":""),x&&jn(i,fr)}function $(){U||L()}function L(){if(!U){var R=e.index;D(),_(),ti(i,Iu,t===R-1),ti(i,Ru,t===R+1)}}function D(){var R=T();R!==Zl(i,Ui)&&(ti(i,Ui,R),Nt(i,wu,y&&R||""),l(R?au:su,X))}function _(){var R=B(),E=!R&&(!T()||S);if(e.state.is([Ho,$r])||Nt(i,$u,E||""),Nt(dl(i,p.focusableNodes||""),xo,E?-1:""),x&&Nt(i,xo,E?-1:0),R!==Zl(i,_s)&&(ti(i,_s,R),l(R?lu:cu,X)),!R&&document.activeElement===i){var V=d.Slides.getAt(e.index);V&&tu(V.slide)}}function C(R,E,V){Mn(V&&O||i,R,E)}function T(){var R=e.index;return R===t||p.cloneStatus&&R===n}function B(){if(e.is(kr))return T();var R=Tn(d.Elements.track),E=Tn(i),V=b("left",!0),ie=b("right",!0);return ma(R[V])<=hr(E[V])&&ma(E[ie])<=hr(R[ie])}function w(R,E){var V=vn(R-t);return!S&&(p.rewind||e.is(Oo))&&(V=Ti(V,e.length-V)),V<=E}var X={index:t,slideIndex:n,slide:i,container:O,isClone:S,mount:z,destroy:N,update:L,style:C,isWithin:w};return X}function ug(e,t,n){var i=on(e),o=i.on,r=i.emit,l=i.bind,c=t.Elements,d=c.slides,u=c.list,p=[];function y(){v(),o(sn,m),o(sn,v)}function v(){d.forEach(function(L,D){x(L,D,-1)})}function m(){U(function(L){L.destroy()}),ai(p)}function g(){U(function(L){L.update()})}function x(L,D,_){var C=dg(e,D,_,L);C.mount(),p.push(C),p.sort(function(T,B){return T.index-B.index})}function b(L){return L?z(function(D){return!D.isClone}):p}function k(L){var D=t.Controller,_=D.toIndex(L),C=D.hasFocus()?1:n.perPage;return z(function(T){return ra(T.index,_,_+C-1)})}function f(L){return z(L)[0]}function S(L,D){Rn(L,function(_){if(Ci(_)&&(_=nu(_)),Qd(_)){var C=d[D];C?cl(_,C):Lr(u,_),Bn(_,n.classes.slide),N(_,Jt(r,Co))}}),r(sn)}function O(L){qi(z(L).map(function(D){return D.slide})),r(sn)}function U(L,D){b(D).forEach(L)}function z(L){return p.filter(Jd(L)?L:function(D){return Ci(L)?ur(D.slide,L):ll(Tr(L),D.index)})}function I(L,D,_){U(function(C){C.style(L,D,_)})}function N(L,D){var _=dl(L,"img"),C=_.length;C?_.forEach(function(T){l(T,"load error",function(){--C||D()})}):D()}function q(L){return L?d.length:p.length}function $(){return p.length>n.perPage}return{mount:y,destroy:m,update:g,register:x,get:b,getIn:k,getAt:f,add:S,remove:O,forEach:U,filter:z,style:I,getLength:q,isEnough:$}}function pg(e,t,n){var i=on(e),o=i.on,r=i.bind,l=i.emit,c=t.Slides,d=t.Direction.resolve,u=t.Elements,p=u.root,y=u.track,v=u.list,m=c.getAt,g=c.style,x,b,k;function f(){S(),r(window,"resize load",qm(Jt(l,Co))),o([gn,sn],S),o(Co,O)}function S(){x=n.direction===Ea,Mn(p,"maxWidth",Ai(n.width)),Mn(y,d("paddingLeft"),U(!1)),Mn(y,d("paddingRight"),U(!0)),O(!0)}function O(X){var R=Tn(p);(X||b.width!==R.width||b.height!==R.height)&&(Mn(y,"height",z()),g(d("marginRight"),Ai(n.gap)),g("width",N()),g("height",q(),!0),b=R,l(Ta),k!==(k=w())&&(ti(p,Eu,k),l(Gm,k)))}function U(X){var R=n.padding,E=d(X?"right":"left");return R&&Ai(R[E]||(dr(R)?0:R))||"0px"}function z(){var X="";return x&&(X=I(),ar(X,"height or heightRatio is missing."),X="calc("+X+" - "+U(!1)+" - "+U(!0)+")"),X}function I(){return Ai(n.height||Tn(v).width*n.heightRatio)}function N(){return n.autoWidth?null:Ai(n.fixedWidth)||(x?"":$())}function q(){return Ai(n.fixedHeight)||(x?n.autoHeight?null:$():I())}function $(){var X=Ai(n.gap);return"calc((100%"+(X&&" + "+X)+")/"+(n.perPage||1)+(X&&" - "+X)+")"}function L(){return Tn(v)[d("width")]}function D(X,R){var E=m(X||0);return E?Tn(E.slide)[d("width")]+(R?0:T()):0}function _(X,R){var E=m(X);if(E){var V=Tn(E.slide)[d("right")],ie=Tn(v)[d("left")];return vn(V-ie)+(R?0:T())}return 0}function C(X){return _(e.length-1)-_(0)+D(0,X)}function T(){var X=m(0);return X&&parseFloat(Mn(X.slide,d("marginRight")))||0}function B(X){return parseFloat(Mn(y,d("padding"+(X?"Right":"Left"))))||0}function w(){return e.is(kr)||C(!0)>L()}return{mount:f,resize:O,listSize:L,slideSize:D,sliderSize:C,totalSize:_,getPadding:B,isOverflow:w}}var mg=2;function gg(e,t,n){var i=on(e),o=i.on,r=t.Elements,l=t.Slides,c=t.Direction.resolve,d=[],u;function p(){o(sn,y),o([gn,Co],m),(u=b())&&(g(u),t.Layout.resize(!0))}function y(){v(),p()}function v(){qi(d),ai(d),i.destroy()}function m(){var k=b();u!==k&&(u<k||!k)&&i.emit(sn)}function g(k){var f=l.get().slice(),S=f.length;if(S){for(;f.length<k;)oa(f,f);oa(f.slice(-k),f.slice(0,k)).forEach(function(O,U){var z=U<k,I=x(O.slide,U);z?cl(I,f[0].slide):Lr(r.list,I),oa(d,I),l.register(I,U-k+(z?0:S),O.index)})}}function x(k,f){var S=k.cloneNode(!0);return Bn(S,n.classes.clone),S.id=e.root.id+"-clone"+pl(f+1),S}function b(){var k=n.clones;if(!e.is(Oo))k=0;else if(Cr(k)){var f=n[c("fixedWidth")]&&t.Layout.slideSize(0),S=f&&hr(Tn(r.track)[c("width")]/f);k=S||n[c("autoWidth")]&&e.length||n.perPage*mg}return k}return{mount:p,destroy:v}}function hg(e,t,n){var i=on(e),o=i.on,r=i.emit,l=e.state.set,c=t.Layout,d=c.slideSize,u=c.getPadding,p=c.totalSize,y=c.listSize,v=c.sliderSize,m=t.Direction,g=m.resolve,x=m.orient,b=t.Elements,k=b.list,f=b.track,S;function O(){S=t.Transition,o([ki,Ta,gn,sn],U)}function U(){t.Controller.isBusy()||(t.Scroll.cancel(),I(e.index),t.Slides.update())}function z(E,V,ie,re){E!==V&&X(E>ie)&&(L(),N($(C(),E>ie),!0)),l(Ho),r(si,V,ie,E),S.start(V,function(){l($o),r(Wo,V,ie,E),re&&re()})}function I(E){N(_(E,!0))}function N(E,V){if(!e.is(kr)){var ie=V?E:q(E);Mn(k,"transform","translate"+g("X")+"("+ie+"px)"),E!==ie&&r(xu)}}function q(E){if(e.is(Oo)){var V=D(E),ie=V>t.Controller.getEnd(),re=V<0;(re||ie)&&(E=$(E,ie))}return E}function $(E,V){var ie=E-w(V),re=v();return E-=x(re*(hr(vn(ie)/re)||1))*(V?1:-1),E}function L(){N(C(),!0),S.cancel()}function D(E){for(var V=t.Slides.get(),ie=0,re=1/0,W=0;W<V.length;W++){var ae=V[W].index,A=vn(_(ae,!0)-E);if(A<=re)re=A,ie=ae;else break}return ie}function _(E,V){var ie=x(p(E-1)-B(E));return V?T(ie):ie}function C(){var E=g("left");return Tn(k)[E]-Tn(f)[E]+x(u(!1))}function T(E){return n.trimSpace&&e.is(To)&&(E=lo(E,0,x(v(!0)-y()))),E}function B(E){var V=n.focus;return V==="center"?(y()-d(E,!0))/2:+V*d(E)||0}function w(E){return _(E?t.Controller.getEnd():0,!!n.trimSpace)}function X(E){var V=x($(C(),E));return E?V>=0:V<=k[g("scrollWidth")]-Tn(f)[g("width")]}function R(E,V){V=Cr(V)?C():V;var ie=E!==!0&&x(V)<x(w(!1)),re=E!==!1&&x(V)>x(w(!0));return ie||re}return{mount:O,move:z,jump:I,translate:N,shift:$,cancel:L,toIndex:D,toPosition:_,getPosition:C,getLimit:w,exceededLimit:R,reposition:U}}function fg(e,t,n){var i=on(e),o=i.on,r=i.emit,l=t.Move,c=l.getPosition,d=l.getLimit,u=l.toPosition,p=t.Slides,y=p.isEnough,v=p.getLength,m=n.omitEnd,g=e.is(Oo),x=e.is(To),b=Jt(C,!1),k=Jt(C,!0),f=n.start||0,S,O=f,U,z,I;function N(){q(),o([gn,sn,ga],q),o(Ta,$)}function q(){U=v(!0),z=n.perMove,I=n.perPage,S=X();var A=lo(f,0,m?S:U-1);A!==f&&(f=A,l.reposition())}function $(){S!==X()&&r(ga)}function L(A,le,ee){if(!ae()){var xe=_(A),Pe=w(xe);Pe>-1&&(le||Pe!==f)&&(ie(Pe),l.move(xe,Pe,O,ee))}}function D(A,le,ee,xe){t.Scroll.scroll(A,le,ee,function(){var Pe=w(l.toIndex(c()));ie(m?Ti(Pe,S):Pe),xe&&xe()})}function _(A){var le=f;if(Ci(A)){var ee=A.match(/([+\-<>])(\d+)?/)||[],xe=ee[1],Pe=ee[2];xe==="+"||xe==="-"?le=T(f+ +(""+xe+(+Pe||1)),f):xe===">"?le=Pe?R(+Pe):b(!0):xe==="<"&&(le=k(!0))}else le=g?A:lo(A,0,S);return le}function C(A,le){var ee=z||(W()?1:I),xe=T(f+ee*(A?-1:1),f,!(z||W()));return xe===-1&&x&&!ou(c(),d(!A),1)?A?0:S:le?xe:w(xe)}function T(A,le,ee){if(y()||W()){var xe=B(A);xe!==A&&(le=A,A=xe,ee=!1),A<0||A>S?!z&&(ra(0,A,le,!0)||ra(S,le,A,!0))?A=R(E(A)):g?A=ee?A<0?-(U%I||I):U:A:n.rewind?A=A<0?S:0:A=-1:ee&&A!==le&&(A=R(E(le)+(A<le?-1:1)))}else A=-1;return A}function B(A){if(x&&n.trimSpace==="move"&&A!==f)for(var le=c();le===u(A,!0)&&ra(A,0,e.length-1,!n.rewind);)A<f?--A:++A;return A}function w(A){return g?(A+U)%U||0:A}function X(){for(var A=U-(W()||g&&z?1:I);m&&A-- >0;)if(u(U-1,!0)!==u(A,!0)){A++;break}return lo(A,0,U-1)}function R(A){return lo(W()?A:I*A,0,S)}function E(A){return W()?Ti(A,S):ma((A>=S?U-1:A)/I)}function V(A){var le=l.toIndex(A);return x?lo(le,0,S):le}function ie(A){A!==f&&(O=f,f=A)}function re(A){return A?O:f}function W(){return!Cr(n.focus)||n.isNavigation}function ae(){return e.state.is([Ho,$r])&&!!n.waitForTransition}return{mount:N,go:L,scroll:D,getNext:b,getPrev:k,getAdjacent:C,getEnd:X,setIndex:ie,getIndex:re,toIndex:R,toPage:E,toDest:V,hasFocus:W,isBusy:ae}}var yg="http://www.w3.org/2000/svg",vg="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",Ar=40;function xg(e,t,n){var i=on(e),o=i.on,r=i.bind,l=i.emit,c=n.classes,d=n.i18n,u=t.Elements,p=t.Controller,y=u.arrows,v=u.track,m=y,g=u.prev,x=u.next,b,k,f={};function S(){U(),o(gn,O)}function O(){z(),S()}function U(){var D=n.arrows;D&&!(g&&x)&&q(),g&&x&&(mr(f,{prev:g,next:x}),gr(m,D?"":"none"),Bn(m,k=wl+"--"+n.direction),D&&(I(),L(),Nt([g,x],Rr,v.id),l(mu,g,x)))}function z(){i.destroy(),ni(m,k),b?(qi(y?[g,x]:m),g=x=null):jn([g,x],Sl)}function I(){o([ki,Wo,sn,Yi,ga],L),r(x,"click",Jt(N,">")),r(g,"click",Jt(N,"<"))}function N(D){p.go(D,!0)}function q(){m=y||vo("div",c.arrows),g=$(!0),x=$(!1),b=!0,Lr(m,[g,x]),!y&&cl(m,v)}function $(D){var _='<button class="'+c.arrow+" "+(D?c.prev:c.next)+'" type="button"><svg xmlns="'+yg+'" viewBox="0 0 '+Ar+" "+Ar+'" width="'+Ar+'" height="'+Ar+'" focusable="false"><path d="'+(n.arrowPath||vg)+'" />';return nu(_)}function L(){if(g&&x){var D=e.index,_=p.getPrev(),C=p.getNext(),T=_>-1&&D<_?d.last:d.prev,B=C>-1&&D>C?d.first:d.next;g.disabled=_<0,x.disabled=C<0,Nt(g,Pn,T),Nt(x,Pn,B),l(gu,g,x,_,C)}}return{arrows:f,mount:S,destroy:z,update:L}}var bg=ul+"-interval";function Sg(e,t,n){var i=on(e),o=i.on,r=i.bind,l=i.emit,c=Pa(n.interval,e.go.bind(e,">"),I),d=c.isPaused,u=t.Elements,p=t.Elements,y=p.root,v=p.toggle,m=n.autoplay,g,x,b=m==="pause";function k(){m&&(f(),v&&Nt(v,Rr,u.track.id),b||S(),z())}function f(){n.pauseOnHover&&r(y,"mouseenter mouseleave",function(q){g=q.type==="mouseenter",U()}),n.pauseOnFocus&&r(y,"focusin focusout",function(q){x=q.type==="focusin",U()}),v&&r(v,"click",function(){b?S():O(!0)}),o([si,La,sn],c.rewind),o(si,N)}function S(){d()&&t.Slides.isEnough()&&(c.start(!n.resetProgress),x=g=b=!1,z(),l(fl))}function O(q){q===void 0&&(q=!0),b=!!q,z(),d()||(c.pause(),l(yl))}function U(){b||(g||x?O(!1):S())}function z(){v&&(ti(v,Ui,!b),Nt(v,Pn,n.i18n[b?"play":"pause"]))}function I(q){var $=u.bar;$&&Mn($,"width",q*100+"%"),l(yu,q)}function N(q){var $=t.Slides.getAt(q);c.set($&&+An($.slide,bg)||n.interval)}return{mount:k,destroy:c.cancel,play:S,pause:O,isPaused:d}}function wg(e,t,n){var i=on(e),o=i.on;function r(){n.cover&&(o(vl,Jt(c,!0)),o([ki,gn,sn],Jt(l,!0)))}function l(d){t.Slides.forEach(function(u){var p=Pr(u.container||u.slide,"img");p&&p.src&&c(d,p,u)})}function c(d,u,p){p.style("background",d?'center/cover no-repeat url("'+u.src+'")':"",!0),gr(u,d?"none":"")}return{mount:r,destroy:Jt(l,!1)}}var $g=10,Cg=600,Tg=.6,Lg=1.5,Pg=800;function Ig(e,t,n){var i=on(e),o=i.on,r=i.emit,l=e.state.set,c=t.Move,d=c.getPosition,u=c.getLimit,p=c.exceededLimit,y=c.translate,v=e.is(To),m,g,x=1;function b(){o(si,O),o([gn,sn],U)}function k(I,N,q,$,L){var D=d();if(O(),q&&(!v||!p())){var _=t.Layout.sliderSize(),C=As(I)*_*ma(vn(I)/_)||0;I=c.toPosition(t.Controller.toDest(I%_))+C}var T=ou(D,I,1);x=1,N=T?0:N||pa(vn(I-D)/Lg,Pg),g=$,m=Pa(N,f,Jt(S,D,I,L),1),l($r),r(La),m.start()}function f(){l($o),g&&g(),r(Yi)}function S(I,N,q,$){var L=d(),D=I+(N-I)*z($),_=(D-L)*x;y(L+_),v&&!q&&p()&&(x*=Tg,vn(_)<$g&&k(u(p(!0)),Cg,!1,g,!0))}function O(){m&&m.cancel()}function U(){m&&!m.isPaused()&&(O(),f())}function z(I){var N=n.easingFunc;return N?N(I):1-Math.pow(1-I,4)}return{mount:b,destroy:O,scroll:k,cancel:U}}var co={passive:!1,capture:!0};function Rg(e,t,n){var i=on(e),o=i.on,r=i.emit,l=i.bind,c=i.unbind,d=e.state,u=t.Move,p=t.Scroll,y=t.Controller,v=t.Elements.track,m=t.Media.reduce,g=t.Direction,x=g.resolve,b=g.orient,k=u.getPosition,f=u.exceededLimit,S,O,U,z,I,N=!1,q,$,L;function D(){l(v,Xa,Es,co),l(v,qa,Es,co),l(v,Mu,C,co),l(v,"click",w,{capture:!0}),l(v,"dragstart",Qn),o([ki,gn],_)}function _(){var Y=n.drag;pe(!Y),z=Y==="free"}function C(Y){if(q=!1,!$){var se=Pe(Y);xe(Y.target)&&(se||!Y.button)&&(y.isBusy()?Qn(Y,!0):(L=se?v:window,I=d.is([Ho,$r]),U=null,l(L,Xa,T,co),l(L,qa,B,co),u.cancel(),p.cancel(),X(Y)))}}function T(Y){if(d.is(ia)||(d.set(ia),r(du)),Y.cancelable)if(I){u.translate(S+ee(W(Y)));var se=ae(Y)>rc,de=N!==(N=f());(se||de)&&X(Y),q=!0,r(uu),Qn(Y)}else V(Y)&&(I=E(Y),Qn(Y))}function B(Y){d.is(ia)&&(d.set($o),r(pu)),I&&(R(Y),Qn(Y)),c(L,Xa,T),c(L,qa,B),I=!1}function w(Y){!$&&q&&Qn(Y,!0)}function X(Y){U=O,O=Y,S=k()}function R(Y){var se=ie(Y),de=re(se),ve=n.rewind&&n.rewindByDrag;m(!1),z?y.scroll(de,0,n.snap):e.is(kr)?y.go(b(As(se))<0?ve?"<":"-":ve?">":"+"):e.is(To)&&N&&ve?y.go(f(!0)?">":"<"):y.go(y.toDest(de),!0),m(!0)}function E(Y){var se=n.dragMinThreshold,de=dr(se),ve=de&&se.mouse||0,$e=(de?se.touch:+se)||10;return vn(W(Y))>(Pe(Y)?$e:ve)}function V(Y){return vn(W(Y))>vn(W(Y,!0))}function ie(Y){if(e.is(Oo)||!N){var se=ae(Y);if(se&&se<rc)return W(Y)/se}return 0}function re(Y){return k()+As(Y)*Ti(vn(Y)*(n.flickPower||600),z?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function W(Y,se){return le(Y,se)-le(A(Y),se)}function ae(Y){return Ms(Y)-Ms(A(Y))}function A(Y){return O===Y&&U||O}function le(Y,se){return(Pe(Y)?Y.changedTouches[0]:Y)["page"+x(se?"Y":"X")]}function ee(Y){return Y/(N&&e.is(To)?lg:1)}function xe(Y){var se=n.noDrag;return!ur(Y,"."+Pu+", ."+Aa)&&(!se||!ur(Y,se))}function Pe(Y){return typeof TouchEvent<"u"&&Y instanceof TouchEvent}function ye(){return I}function pe(Y){$=Y}return{mount:D,disable:pe,isDragging:ye}}var kg={Spacebar:" ",Right:ka,Left:Ra,Up:bu,Down:Su};function $l(e){return e=Ci(e)?e:e.key,kg[e]||e}var ac="keydown";function Eg(e,t,n){var i=on(e),o=i.on,r=i.bind,l=i.unbind,c=e.root,d=t.Direction.resolve,u,p;function y(){v(),o(gn,m),o(gn,v),o(si,x)}function v(){var k=n.keyboard;k&&(u=k==="global"?window:c,r(u,ac,b))}function m(){l(u,ac)}function g(k){p=k}function x(){var k=p;p=!0,Zd(function(){p=k})}function b(k){if(!p){var f=$l(k);f===d(Ra)?e.go("<"):f===d(ka)&&e.go(">")}}return{mount:y,destroy:m,disable:g}}var sr=ul+"-lazy",aa=sr+"-srcset",Mg="["+sr+"], ["+aa+"]";function Ag(e,t,n){var i=on(e),o=i.on,r=i.off,l=i.bind,c=i.emit,d=n.lazyLoad==="sequential",u=[Wo,Yi],p=[];function y(){n.lazyLoad&&(v(),o(sn,v))}function v(){ai(p),m(),d?k():(r(u),o(u,g),g())}function m(){t.Slides.forEach(function(f){dl(f.slide,Mg).forEach(function(S){var O=An(S,sr),U=An(S,aa);if(O!==S.src||U!==S.srcset){var z=n.classes.spinner,I=S.parentElement,N=Pr(I,"."+z)||vo("span",z,I);p.push([S,f,N]),S.src||gr(S,"none")}})})}function g(){p=p.filter(function(f){var S=n.perPage*((n.preloadPages||1)+1)-1;return f[1].isWithin(e.index,S)?x(f):!0}),p.length||r(u)}function x(f){var S=f[0];Bn(f[1].slide,Hs),l(S,"load error",Jt(b,f)),Nt(S,"src",An(S,sr)),Nt(S,"srcset",An(S,aa)),jn(S,sr),jn(S,aa)}function b(f,S){var O=f[0],U=f[1];ni(U.slide,Hs),S.type!=="error"&&(qi(f[2]),gr(O,""),c(vl,O,U),c(Co)),d&&k()}function k(){p.length&&x(p.shift())}return{mount:y,destroy:Jt(ai,p),check:g}}function Fg(e,t,n){var i=on(e),o=i.on,r=i.emit,l=i.bind,c=t.Slides,d=t.Elements,u=t.Controller,p=u.hasFocus,y=u.getIndex,v=u.go,m=t.Direction.resolve,g=d.pagination,x=[],b,k;function f(){S(),o([gn,sn,ga],f);var $=n.pagination;g&&gr(g,$?"":"none"),$&&(o([si,La,Yi],q),O(),q(),r(hu,{list:b,items:x},N(e.index)))}function S(){b&&(qi(g?Ri(b.children):b),ni(b,k),ai(x),b=null),i.destroy()}function O(){var $=e.length,L=n.classes,D=n.i18n,_=n.perPage,C=p()?u.getEnd()+1:hr($/_);b=g||vo("ul",L.pagination,d.track.parentElement),Bn(b,k=Fa+"--"+I()),Nt(b,ii,"tablist"),Nt(b,Pn,D.select),Nt(b,bl,I()===Ea?"vertical":"");for(var T=0;T<C;T++){var B=vo("li",null,b),w=vo("button",{class:L.page,type:"button"},B),X=c.getIn(T).map(function(E){return E.slide.id}),R=!p()&&_>1?D.pageX:D.slideX;l(w,"click",Jt(U,T)),n.paginationKeyboard&&l(w,"keydown",Jt(z,T)),Nt(B,ii,"presentation"),Nt(w,ii,"tab"),Nt(w,Rr,X.join(" ")),Nt(w,Pn,Fs(R,T+1)),Nt(w,xo,-1),x.push({li:B,button:w,page:T})}}function U($){v(">"+$,!0)}function z($,L){var D=x.length,_=$l(L),C=I(),T=-1;_===m(ka,!1,C)?T=++$%D:_===m(Ra,!1,C)?T=(--$+D)%D:_==="Home"?T=0:_==="End"&&(T=D-1);var B=x[T];B&&(tu(B.button),v(">"+T),Qn(L,!0))}function I(){return n.paginationDirection||n.direction}function N($){return x[u.toPage($)]}function q(){var $=N(y(!0)),L=N(y());if($){var D=$.button;ni(D,Ui),jn(D,ec),Nt(D,xo,-1)}if(L){var _=L.button;Bn(_,Ui),Nt(_,ec,!0),Nt(_,xo,"")}r(fu,{list:b,items:x},$,L)}return{items:x,mount:f,destroy:S,getAt:N,update:q}}var Ng=[" ","Enter"];function _g(e,t,n){var i=n.isNavigation,o=n.slideFocus,r=[];function l(){e.splides.forEach(function(g){g.isParent||(u(e,g.splide),u(g.splide,e))}),i&&p()}function c(){r.forEach(function(g){g.destroy()}),ai(r)}function d(){c(),l()}function u(g,x){var b=on(g);b.on(si,function(k,f,S){x.go(x.is(Oo)?S:k)}),r.push(b)}function p(){var g=on(e),x=g.on;x(ml,v),x(vu,m),x([ki,gn],y),r.push(g),g.emit(hl,e.splides)}function y(){Nt(t.Elements.list,bl,n.direction===Ea?"vertical":"")}function v(g){e.go(g.index)}function m(g,x){ll(Ng,$l(x))&&(v(g),Qn(x))}return{setup:Jt(t.Media.set,{slideFocus:Cr(o)?i:o},!0),mount:l,destroy:c,remount:d}}function Hg(e,t,n){var i=on(e),o=i.bind,r=0;function l(){n.wheel&&o(t.Elements.track,"wheel",c,co)}function c(u){if(u.cancelable){var p=u.deltaY,y=p<0,v=Ms(u),m=n.wheelMinThreshold||0,g=n.wheelSleep||0;vn(p)>m&&v-r>g&&(e.go(y?"<":">"),r=v),d(y)&&Qn(u)}}function d(u){return!n.releaseWheel||e.state.is(Ho)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var Wg=90;function Og(e,t,n){var i=on(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,c=vo("span",ig),d=Pa(Wg,Jt(p,!1));function u(){l&&(v(!t.Autoplay.isPaused()),Nt(r,ic,!0),c.textContent="…",o(fl,Jt(v,!0)),o(yl,Jt(v,!1)),o([Wo,Yi],Jt(p,!0)))}function p(m){Nt(r,nc,m),m?(Lr(r,c),d.start()):(qi(c),d.cancel())}function y(){jn(r,[tc,ic,nc]),qi(c)}function v(m){l&&Nt(r,tc,m?"off":"polite")}return{mount:u,disable:v,destroy:y}}var Dg=Object.freeze({__proto__:null,Media:Um,Direction:Km,Elements:cg,Slides:ug,Layout:pg,Clones:gg,Move:hg,Controller:fg,Arrows:xg,Autoplay:Sg,Cover:wg,Scroll:Ig,Drag:Rg,Keyboard:Eg,LazyLoad:Ag,Pagination:Fg,Sync:_g,Wheel:Hg,Live:Og}),zg={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"},Bg={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:ag,i18n:zg,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function jg(e,t,n){var i=t.Slides;function o(){on(e).on([ki,sn],r)}function r(){i.forEach(function(c){c.style("transform","translateX(-"+100*c.index+"%)")})}function l(c,d){i.style("transition","opacity "+n.speed+"ms "+n.easing),Zd(d)}return{mount:o,start:l,cancel:Es}}function Vg(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,c=Jt(Mn,l,"transition"),d;function u(){on(e).bind(l,"transitionend",function(m){m.target===l&&d&&(y(),d())})}function p(m,g){var x=i.toPosition(m,!0),b=i.getPosition(),k=v(m);vn(x-b)>=1&&k>=1?n.useScroll?r.scroll(x,k,!1,g):(c("transform "+k+"ms "+n.easing),i.translate(x,!0),d=g):(i.jump(m),g())}function y(){c(""),r.cancel()}function v(m){var g=n.rewindSpeed;if(e.is(To)&&g){var x=o.getIndex(!0),b=o.getEnd();if(x===0&&m>=b||x>=b&&m===0)return g}return n.speed}return{mount:u,start:p,cancel:y}}var Gg=(function(){function e(n,i){this.event=on(),this.Components={},this.state=Xm(mo),this.splides=[],this._o={},this._E={};var o=Ci(n)?iu(document,n):n;ar(o,o+" is invalid."),this.root=o,i=bi({label:An(o,Pn)||"",labelledby:An(o,xl)||""},Bg,e.defaults,i||{});try{bi(i,JSON.parse(An(o,ul)))}catch{ar(!1,"Invalid JSON")}this._o=Object.create(bi({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,c=this.Components;ar(l.is([mo,ua]),"Already mounted!"),l.set(mo),this._C=c,this._T=o||this._T||(this.is(kr)?jg:Vg),this._E=i||this._E;var d=mr({},Dg,this._E,{Transition:this._T});return Gi(d,function(u,p){var y=u(r,c,r._o);c[p]=y,y.setup&&y.setup()}),Gi(c,function(u){u.mount&&u.mount()}),this.emit(ki),Bn(this.root,og),l.set($o),this.emit(Ns),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is($o)&&(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(Ri(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(sn),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,r=this.state;return r.is(mo)?on(this).on(Ns,this.destroy.bind(this,i)):(Gi(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(gl),o.destroy(),i&&ai(this.splides),r.set(ua)),this},zm(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})(),Cl=Gg;Cl.defaults={};Cl.STATES=jm;var sc=[[ki,"onMounted"],[Ns,"onReady"],[si,"onMove"],[Wo,"onMoved"],[ml,"onClick"],[au,"onActive"],[su,"onInactive"],[lu,"onVisible"],[cu,"onHidden"],[sn,"onRefresh"],[gn,"onUpdated"],[Co,"onResize"],[Ta,"onResized"],[du,"onDrag"],[uu,"onDragging"],[pu,"onDragged"],[La,"onScroll"],[Yi,"onScrolled"],[gl,"onDestroy"],[mu,"onArrowsMounted"],[gu,"onArrowsUpdated"],[hu,"onPaginationMounted"],[fu,"onPaginationUpdated"],[hl,"onNavigationMounted"],[fl,"onAutoplayPlay"],[yu,"onAutoplayPlaying"],[yl,"onAutoplayPause"],[vl,"onLazyLoadLoaded"]];function Tl(...e){return e.filter(Boolean).join(" ")}function ha(e){return e!==null&&typeof e=="object"}function Ws(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!Ws(n,t[i]));if(ha(e)&&ha(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Ws(e[o],t[o]))}return e===t}function Xg(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function qg(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 Os(e,t){const n=e;return qg(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():ha(i)?n[o]=Os(ha(n[o])?n[o]:{},i):n[o]=i}),n}var Ug=({children:e,className:t,...n})=>s.createElement("div",{className:Tl("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),Ll=class extends s.Component{constructor(){super(...arguments),this.splideRef=s.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new Cl(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Os({},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&&!Ws(this.options,e)&&(this.splide.options=e,this.options=Os({},e));const t=this.getSlides();Xg(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){sc.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 s.createElement(t,{className:Tl("splide",e),ref:this.splideRef,...this.omit(o,["options",...sc.map(r=>r[1])])},n?s.createElement(Ug,null,i):i)}},Pl=({children:e,className:t,...n})=>s.createElement("li",{className:Tl("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),Ct=require("classnames"),F=require("./panelAvailability-D8c7cdbu.js"),Gn=require("react-dom");function Yp(e){return e.type==="object"&&e.version===1}const Zp="ControlSlider-module__wrapper___sHEkd",Jp="ControlSlider-module__hoverArrow___A-dOH",Qp="ControlSlider-module__sliderItem___QQSkR",em="ControlSlider-module__sliderImage___9hRl-",tm="ControlSlider-module__arrow___05ghY",nm="ControlSlider-module__arrowVertical___tBfVN",im="ControlSlider-module__nextArrow___-30Yc",om="ControlSlider-module__arrowInner___aEra3",rm="ControlSlider-module__arrowIcon___S4ztF",am="ControlSlider-module__arrowImg___2dwJW",sm="ControlSlider-module__mirror___brd6U",lm="ControlSlider-module__pagination___bicLF",cm="ControlSlider-module__paginationInner___bT-P-",dm="ControlSlider-module__paginationVertical___zYqKw",um="ControlSlider-module__paginationItem___nTRbk",pm="ControlSlider-module__dot___p1Qun",mm="ControlSlider-module__activeDot___LHFaj",gm="ControlSlider-module__paginationInsideBottom___R3FWn",hm="ControlSlider-module__paginationInsideTop___V-qb-",fm="ControlSlider-module__paginationOutsideBottom___14w8D",ym="ControlSlider-module__paginationOutsideTop___SCLqB",vm="ControlSlider-module__paginationInsideLeft___yOBRZ",xm="ControlSlider-module__paginationInsideRight___Rtt3o",bm="ControlSlider-module__paginationOutsideLeft___lahaw",Sm="ControlSlider-module__paginationOutsideRight___EtuQa",wm="ControlSlider-module__imgWrapper___UjEgB",$m="ControlSlider-module__captionBlock___dJ6-j",Cm="ControlSlider-module__captionTextWrapper___HFlpf",Tm="ControlSlider-module__captionText___uGBVc",Lm="ControlSlider-module__active___WZK4G",Pm="ControlSlider-module__withPointerEvents___t-18M",Im="ControlSlider-module__topLeftAlignment___zjnGM",Rm="ControlSlider-module__topCenterAlignment___gD1xW",km="ControlSlider-module__topRightAlignment___NMapS",Em="ControlSlider-module__middleLeftAlignment___OnUrY",Mm="ControlSlider-module__middleCenterAlignment___Tdkl0",Am="ControlSlider-module__middleRightAlignment___wEbfX",Fm="ControlSlider-module__bottomLeftAlignment___cTP2-",Nm="ControlSlider-module__bottomCenterAlignment___c54fB",_m="ControlSlider-module__bottomRightAlignment___kEwrz",Hm="ControlSlider-module__clickOverlay___DZA28",Wm="ControlSlider-module__contain___pLyq7",Om="ControlSlider-module__cover___KdDat",$t={wrapper:Zp,hoverArrow:Jp,sliderItem:Qp,sliderImage:em,arrow:tm,arrowVertical:nm,nextArrow:im,arrowInner:om,arrowIcon:rm,arrowImg:am,mirror:sm,pagination:lm,paginationInner:cm,paginationVertical:dm,paginationItem:um,dot:pm,activeDot:mm,paginationInsideBottom:gm,paginationInsideTop:hm,paginationOutsideBottom:fm,paginationOutsideTop:ym,paginationInsideLeft:vm,paginationInsideRight:xm,paginationOutsideLeft:bm,paginationOutsideRight:Sm,imgWrapper:wm,captionBlock:$m,captionTextWrapper:Cm,captionText:Tm,active:Lm,withPointerEvents:Pm,topLeftAlignment:Im,topCenterAlignment:Rm,topRightAlignment:km,middleLeftAlignment:Em,middleCenterAlignment:Mm,middleRightAlignment:Am,bottomLeftAlignment:Fm,bottomCenterAlignment:Nm,bottomRightAlignment:_m,clickOverlay:Hm,contain:Wm,cover:Om};function Dm(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 zm(e,t,n){return t&&Dm(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Ul="(prefers-reduced-motion: reduce)",mo=1,Bm=2,$o=3,Ho=4,$r=5,ia=6,pa=7,jm={CREATED:mo,MOUNTED:Bm,IDLE:$o,MOVING:Ho,SCROLLING:$r,DRAGGING:ia,DESTROYED:pa};function ai(e){e.length=0}function Ri(e,t,n){return Array.prototype.slice.call(e,t,n)}function Jt(e){return e.bind.apply(e,[null].concat(Ri(arguments,1)))}var Zd=setTimeout,Ms=function(){};function Kl(e){return requestAnimationFrame(e)}function Ta(e,t){return typeof t===e}function dr(e){return!sl(e)&&Ta("object",e)}var al=Array.isArray,Jd=Jt(Ta,"function"),Ci=Jt(Ta,"string"),Cr=Jt(Ta,"undefined");function sl(e){return e===null}function Qd(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Tr(e){return al(e)?e:[e]}function Rn(e,t){Tr(e).forEach(t)}function ll(e,t){return e.indexOf(t)>-1}function oa(e,t){return e.push.apply(e,Tr(t)),e}function ti(e,t,n){e&&Rn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Bn(e,t){ti(e,Ci(t)?t.split(" "):t,!0)}function Lr(e,t){Rn(t,e.appendChild.bind(e))}function cl(e,t){Rn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function ur(e,t){return Qd(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function eu(e,t){var n=e?Ri(e.children):[];return t?n.filter(function(i){return ur(i,t)}):n}function Pr(e,t){return t?eu(e,t)[0]:e.firstElementChild}var pr=Object.keys;function Gi(e,t,n){return e&&(n?pr(e).reverse():pr(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function mr(e){return Ri(arguments,1).forEach(function(t){Gi(t,function(n,i){e[i]=t[i]})}),e}function bi(e){return Ri(arguments,1).forEach(function(t){Gi(t,function(n,i){al(n)?e[i]=n.slice():dr(n)?e[i]=bi({},dr(e[i])?e[i]:{},n):e[i]=n})}),e}function Yl(e,t){Rn(t||pr(e),function(n){delete e[n]})}function jn(e,t){Rn(e,function(n){Rn(t,function(i){n&&n.removeAttribute(i)})})}function Nt(e,t,n){dr(t)?Gi(t,function(i,o){Nt(e,o,i)}):Rn(e,function(i){sl(n)||n===""?jn(i,t):i.setAttribute(t,String(n))})}function vo(e,t,n){var i=document.createElement(e);return t&&(Ci(t)?Bn(i,t):Nt(i,t)),n&&Lr(n,i),i}function Mn(e,t,n){if(Cr(n))return getComputedStyle(e)[t];sl(n)||(e.style[t]=""+n)}function gr(e,t){Mn(e,"display",t)}function tu(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function An(e,t){return e.getAttribute(t)}function Zl(e,t){return e&&e.classList.contains(t)}function Tn(e){return e.getBoundingClientRect()}function qi(e){Rn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function nu(e){return Pr(new DOMParser().parseFromString(e,"text/html").body)}function Qn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function iu(e,t){return e&&e.querySelector(t)}function dl(e,t){return t?Ri(e.querySelectorAll(t)):[]}function ni(e,t){ti(e,t,!1)}function As(e){return e.timeStamp}function Ai(e){return Ci(e)?e:e?e+"px":""}var Ir="splide",ul="data-"+Ir;function ar(e,t){if(!e)throw new Error("["+Ir+"] "+(t||""))}var Ti=Math.min,ma=Math.max,ga=Math.floor,hr=Math.ceil,vn=Math.abs;function ou(e,t,n){return vn(e-t)<n}function ra(e,t,n,i){var o=Ti(t,n),r=ma(t,n);return i?o<e&&e<r:o<=e&&e<=r}function lo(e,t,n){var i=Ti(t,n),o=ma(t,n);return Ti(ma(i,e),o)}function Fs(e){return+(e>0)-+(e<0)}function Ns(e,t){return Rn(t,function(n){e=e.replace("%s",""+n)}),e}function pl(e){return e<10?"0"+e:""+e}var Jl={};function Vm(e){return""+e+pl(Jl[e]=(Jl[e]||0)+1)}function ru(){var e=[];function t(l,c,d,u){o(l,c,function(p,y,v){var m="addEventListener"in p,g=m?p.removeEventListener.bind(p,y,d,u):p.removeListener.bind(p,d);m?p.addEventListener(y,d,u):p.addListener(d),e.push([p,y,v,d,g])})}function n(l,c,d){o(l,c,function(u,p,y){e=e.filter(function(v){return v[0]===u&&v[1]===p&&v[2]===y&&(!d||v[3]===d)?(v[4](),!1):!0})})}function i(l,c,d){var u,p=!0;return typeof CustomEvent=="function"?u=new CustomEvent(c,{bubbles:p,detail:d}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(c,p,!1,d)),l.dispatchEvent(u),u}function o(l,c,d){Rn(l,function(u){u&&Rn(c,function(p){p.split(" ").forEach(function(y){var v=y.split(".");d(u,v[0],v[1])})})})}function r(){e.forEach(function(l){l[4]()}),ai(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var ki="mounted",_s="ready",si="move",Wo="moved",ml="click",au="active",su="inactive",lu="visible",cu="hidden",sn="refresh",gn="updated",Co="resize",La="resized",du="drag",uu="dragging",pu="dragged",Pa="scroll",Yi="scrolled",Gm="overflow",gl="destroy",mu="arrows:mounted",gu="arrows:updated",hu="pagination:mounted",fu="pagination:updated",hl="navigation:mounted",fl="autoplay:play",yu="autoplay:playing",yl="autoplay:pause",vl="lazyload:loaded",vu="sk",xu="sh",ha="ei";function on(e){var t=e?e.event.bus:document.createDocumentFragment(),n=ru();function i(r,l){n.bind(t,Tr(r).join(" "),function(c){l.apply(l,al(c.detail)?c.detail:[])})}function o(r){n.dispatch(t,r,Ri(arguments,1))}return e&&e.event.on(gl,n.destroy),mr(n,{bus:t,on:i,off:Jt(n.unbind,t),emit:o})}function Ia(e,t,n,i){var o=Date.now,r,l=0,c,d=!0,u=0;function p(){if(!d){if(l=e?Ti((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return v();c=Kl(p)}}function y(k){k||g(),r=o()-(k?l*e:0),d=!1,c=Kl(p)}function v(){d=!0}function m(){r=o(),l=0,n&&n(l)}function g(){c&&cancelAnimationFrame(c),l=0,c=0,d=!0}function x(k){e=k}function b(){return d}return{start:y,rewind:m,pause:v,cancel:g,set:x,isPaused:b}}function Xm(e){var t=e;function n(o){t=o}function i(o){return ll(Tr(o),t)}return{set:n,is:i}}function qm(e,t){var n=Ia(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Um(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=ru(),c=[];function d(){var g=n.mediaQuery==="min";pr(o).sort(function(x,b){return g?+x-+b:+b-+x}).forEach(function(x){p(o[x],"("+(g?"min":"max")+"-width:"+x+"px)")}),p(r,Ul),y()}function u(g){g&&l.destroy()}function p(g,x){var b=matchMedia(x);l.bind(b,"change",y),c.push([g,b])}function y(){var g=i.is(pa),x=n.direction,b=c.reduce(function(k,f){return bi(k,f[1].matches?f[0]:{})},{});Yl(n),m(b),n.destroy?e.destroy(n.destroy==="completely"):g?(u(!0),e.mount()):x!==n.direction&&e.refresh()}function v(g){matchMedia(Ul).matches&&(g?bi(n,r):Yl(n,pr(r)))}function m(g,x,b){bi(n,g),x&&bi(Object.getPrototypeOf(n),g),(b||!i.is(mo))&&e.emit(gn,n)}return{setup:d,destroy:u,reduce:v,set:m}}var Ra="Arrow",ka=Ra+"Left",Ea=Ra+"Right",bu=Ra+"Up",Su=Ra+"Down",Ql="rtl",Ma="ttb",Ga={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[bu,Ea],ArrowRight:[Su,ka]};function Km(e,t,n){function i(r,l,c){c=c||n.direction;var d=c===Ql&&!l?1:c===Ma?0:-1;return Ga[r]&&Ga[r][d]||r.replace(/width|left|right/i,function(u,p){var y=Ga[u.toLowerCase()][d]||u;return p>0?y.charAt(0).toUpperCase()+y.slice(1):y})}function o(r){return r*(n.direction===Ql?1:-1)}return{resolve:i,orient:o}}var ii="role",xo="tabindex",Ym="disabled",Fn="aria-",Rr=Fn+"controls",wu=Fn+"current",ec=Fn+"selected",Pn=Fn+"label",xl=Fn+"labelledby",$u=Fn+"hidden",bl=Fn+"orientation",fr=Fn+"roledescription",tc=Fn+"live",nc=Fn+"busy",ic=Fn+"atomic",Sl=[ii,xo,Ym,Rr,wu,Pn,xl,$u,bl,fr],Xn=Ir+"__",Ei="is-",Xa=Ir,oc=Xn+"track",Zm=Xn+"list",Aa=Xn+"slide",Cu=Aa+"--clone",Jm=Aa+"__container",wl=Xn+"arrows",Fa=Xn+"arrow",Tu=Fa+"--prev",Lu=Fa+"--next",Na=Xn+"pagination",Pu=Na+"__page",Qm=Xn+"progress",eg=Qm+"__bar",tg=Xn+"toggle",ng=Xn+"spinner",ig=Xn+"sr",og=Ei+"initialized",Ui=Ei+"active",Iu=Ei+"prev",Ru=Ei+"next",Hs=Ei+"visible",Ws=Ei+"loading",ku=Ei+"focus-in",Eu=Ei+"overflow",rg=[Ui,Hs,Iu,Ru,Ws,ku,Eu],ag={slide:Aa,clone:Cu,arrows:wl,arrow:Fa,prev:Tu,next:Lu,pagination:Na,page:Pu,spinner:ng};function sg(e,t){if(Jd(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!ur(n,t);)n=n.parentElement;return n}var lg=5,rc=200,Mu="touchstart mousedown",qa="touchmove mousemove",Ua="touchend touchcancel mouseup click";function cg(e,t,n){var i=on(e),o=i.on,r=i.bind,l=e.root,c=n.i18n,d={},u=[],p=[],y=[],v,m,g;function x(){S(),W(),f()}function b(){o(sn,k),o(sn,x),o(gn,f),r(document,Mu+" keydown",function(P){g=P.type==="keydown"},{capture:!0}),r(l,"focusin",function(){ti(l,ku,!!g)})}function k(P){var _=Sl.concat("style");ai(u),ni(l,p),ni(v,y),jn([v,m],_),jn(l,P?_:["style",fr])}function f(){ni(l,p),ni(v,y),p=B(Xa),y=B(oc),Bn(l,p),Bn(v,y),Nt(l,Pn,n.label),Nt(l,xl,n.labelledby)}function S(){v=U("."+oc),m=Pr(v,"."+Zm),ar(v&&m,"A track/list element is missing."),oa(u,eu(m,"."+Aa+":not(."+Cu+")")),Gi({arrows:wl,pagination:Na,prev:Tu,next:Lu,bar:eg,toggle:tg},function(P,_){d[_]=U("."+P)}),mr(d,{root:l,track:v,list:m,slides:u})}function W(){var P=l.id||Vm(Ir),_=n.role;l.id=P,v.id=v.id||P+"-track",m.id=m.id||P+"-list",!An(l,ii)&&l.tagName!=="SECTION"&&_&&Nt(l,ii,_),Nt(l,fr,c.carousel),Nt(m,ii,"presentation")}function U(P){var _=iu(l,P);return _&&sg(_,"."+Xa)===l?_:void 0}function B(P){return[P+"--"+n.type,P+"--"+n.direction,n.drag&&P+"--draggable",n.isNavigation&&P+"--nav",P===Xa&&Ui]}return mr(d,{setup:x,mount:b,destroy:k})}var To="slide",Oo="loop",kr="fade";function dg(e,t,n,i){var o=on(e),r=o.on,l=o.emit,c=o.bind,d=e.Components,u=e.root,p=e.options,y=p.isNavigation,v=p.updateOnMove,m=p.i18n,g=p.pagination,x=p.slideFocus,b=d.Direction.resolve,k=An(i,"style"),f=An(i,Pn),S=n>-1,W=Pr(i,"."+Jm),U;function B(){S||(i.id=u.id+"-slide"+pl(t+1),Nt(i,ii,g?"tabpanel":"group"),Nt(i,fr,m.slide),Nt(i,Pn,f||Ns(m.slideLabel,[t+1,e.length]))),P()}function P(){c(i,"click",Jt(l,ml,q)),c(i,"keydown",Jt(l,vu,q)),r([Wo,xu,Yi],L),r(hl,G),v&&r(si,$)}function _(){U=!0,o.destroy(),ni(i,rg),jn(i,Sl),Nt(i,"style",k),Nt(i,Pn,f||"")}function G(){var I=e.splides.map(function(A){var j=A.splide.Components.Slides.getAt(t);return j?j.slide.id:""}).join(" ");Nt(i,Pn,Ns(m.slideX,(S?n:t)+1)),Nt(i,Rr,I),Nt(i,ii,x?"button":""),x&&jn(i,fr)}function $(){U||L()}function L(){if(!U){var I=e.index;D(),E(),ti(i,Iu,t===I-1),ti(i,Ru,t===I+1)}}function D(){var I=C();I!==Zl(i,Ui)&&(ti(i,Ui,I),Nt(i,wu,y&&I||""),l(I?au:su,q))}function E(){var I=V(),A=!I&&(!C()||S);if(e.state.is([Ho,$r])||Nt(i,$u,A||""),Nt(dl(i,p.focusableNodes||""),xo,A?-1:""),x&&Nt(i,xo,A?-1:0),I!==Zl(i,Hs)&&(ti(i,Hs,I),l(I?lu:cu,q)),!I&&document.activeElement===i){var j=d.Slides.getAt(e.index);j&&tu(j.slide)}}function T(I,A,j){Mn(j&&W||i,I,A)}function C(){var I=e.index;return I===t||p.cloneStatus&&I===n}function V(){if(e.is(kr))return C();var I=Tn(d.Elements.track),A=Tn(i),j=b("left",!0),ie=b("right",!0);return ga(I[j])<=hr(A[j])&&ga(A[ie])<=hr(I[ie])}function w(I,A){var j=vn(I-t);return!S&&(p.rewind||e.is(Oo))&&(j=Ti(j,e.length-j)),j<=A}var q={index:t,slideIndex:n,slide:i,container:W,isClone:S,mount:B,destroy:_,update:L,style:T,isWithin:w};return q}function ug(e,t,n){var i=on(e),o=i.on,r=i.emit,l=i.bind,c=t.Elements,d=c.slides,u=c.list,p=[];function y(){v(),o(sn,m),o(sn,v)}function v(){d.forEach(function(L,D){x(L,D,-1)})}function m(){U(function(L){L.destroy()}),ai(p)}function g(){U(function(L){L.update()})}function x(L,D,E){var T=dg(e,D,E,L);T.mount(),p.push(T),p.sort(function(C,V){return C.index-V.index})}function b(L){return L?B(function(D){return!D.isClone}):p}function k(L){var D=t.Controller,E=D.toIndex(L),T=D.hasFocus()?1:n.perPage;return B(function(C){return ra(C.index,E,E+T-1)})}function f(L){return B(L)[0]}function S(L,D){Rn(L,function(E){if(Ci(E)&&(E=nu(E)),Qd(E)){var T=d[D];T?cl(E,T):Lr(u,E),Bn(E,n.classes.slide),_(E,Jt(r,Co))}}),r(sn)}function W(L){qi(B(L).map(function(D){return D.slide})),r(sn)}function U(L,D){b(D).forEach(L)}function B(L){return p.filter(Jd(L)?L:function(D){return Ci(L)?ur(D.slide,L):ll(Tr(L),D.index)})}function P(L,D,E){U(function(T){T.style(L,D,E)})}function _(L,D){var E=dl(L,"img"),T=E.length;T?E.forEach(function(C){l(C,"load error",function(){--T||D()})}):D()}function G(L){return L?d.length:p.length}function $(){return p.length>n.perPage}return{mount:y,destroy:m,update:g,register:x,get:b,getIn:k,getAt:f,add:S,remove:W,forEach:U,filter:B,style:P,getLength:G,isEnough:$}}function pg(e,t,n){var i=on(e),o=i.on,r=i.bind,l=i.emit,c=t.Slides,d=t.Direction.resolve,u=t.Elements,p=u.root,y=u.track,v=u.list,m=c.getAt,g=c.style,x,b,k;function f(){S(),r(window,"resize load",qm(Jt(l,Co))),o([gn,sn],S),o(Co,W)}function S(){x=n.direction===Ma,Mn(p,"maxWidth",Ai(n.width)),Mn(y,d("paddingLeft"),U(!1)),Mn(y,d("paddingRight"),U(!0)),W(!0)}function W(q){var I=Tn(p);(q||b.width!==I.width||b.height!==I.height)&&(Mn(y,"height",B()),g(d("marginRight"),Ai(n.gap)),g("width",_()),g("height",G(),!0),b=I,l(La),k!==(k=w())&&(ti(p,Eu,k),l(Gm,k)))}function U(q){var I=n.padding,A=d(q?"right":"left");return I&&Ai(I[A]||(dr(I)?0:I))||"0px"}function B(){var q="";return x&&(q=P(),ar(q,"height or heightRatio is missing."),q="calc("+q+" - "+U(!1)+" - "+U(!0)+")"),q}function P(){return Ai(n.height||Tn(v).width*n.heightRatio)}function _(){return n.autoWidth?null:Ai(n.fixedWidth)||(x?"":$())}function G(){return Ai(n.fixedHeight)||(x?n.autoHeight?null:$():P())}function $(){var q=Ai(n.gap);return"calc((100%"+(q&&" + "+q)+")/"+(n.perPage||1)+(q&&" - "+q)+")"}function L(){return Tn(v)[d("width")]}function D(q,I){var A=m(q||0);return A?Tn(A.slide)[d("width")]+(I?0:C()):0}function E(q,I){var A=m(q);if(A){var j=Tn(A.slide)[d("right")],ie=Tn(v)[d("left")];return vn(j-ie)+(I?0:C())}return 0}function T(q){return E(e.length-1)-E(0)+D(0,q)}function C(){var q=m(0);return q&&parseFloat(Mn(q.slide,d("marginRight")))||0}function V(q){return parseFloat(Mn(y,d("padding"+(q?"Right":"Left"))))||0}function w(){return e.is(kr)||T(!0)>L()}return{mount:f,resize:W,listSize:L,slideSize:D,sliderSize:T,totalSize:E,getPadding:V,isOverflow:w}}var mg=2;function gg(e,t,n){var i=on(e),o=i.on,r=t.Elements,l=t.Slides,c=t.Direction.resolve,d=[],u;function p(){o(sn,y),o([gn,Co],m),(u=b())&&(g(u),t.Layout.resize(!0))}function y(){v(),p()}function v(){qi(d),ai(d),i.destroy()}function m(){var k=b();u!==k&&(u<k||!k)&&i.emit(sn)}function g(k){var f=l.get().slice(),S=f.length;if(S){for(;f.length<k;)oa(f,f);oa(f.slice(-k),f.slice(0,k)).forEach(function(W,U){var B=U<k,P=x(W.slide,U);B?cl(P,f[0].slide):Lr(r.list,P),oa(d,P),l.register(P,U-k+(B?0:S),W.index)})}}function x(k,f){var S=k.cloneNode(!0);return Bn(S,n.classes.clone),S.id=e.root.id+"-clone"+pl(f+1),S}function b(){var k=n.clones;if(!e.is(Oo))k=0;else if(Cr(k)){var f=n[c("fixedWidth")]&&t.Layout.slideSize(0),S=f&&hr(Tn(r.track)[c("width")]/f);k=S||n[c("autoWidth")]&&e.length||n.perPage*mg}return k}return{mount:p,destroy:v}}function hg(e,t,n){var i=on(e),o=i.on,r=i.emit,l=e.state.set,c=t.Layout,d=c.slideSize,u=c.getPadding,p=c.totalSize,y=c.listSize,v=c.sliderSize,m=t.Direction,g=m.resolve,x=m.orient,b=t.Elements,k=b.list,f=b.track,S;function W(){S=t.Transition,o([ki,La,gn,sn],U)}function U(){t.Controller.isBusy()||(t.Scroll.cancel(),P(e.index),t.Slides.update())}function B(A,j,ie,ae){A!==j&&q(A>ie)&&(L(),_($(T(),A>ie),!0)),l(Ho),r(si,j,ie,A),S.start(j,function(){l($o),r(Wo,j,ie,A),ae&&ae()})}function P(A){_(E(A,!0))}function _(A,j){if(!e.is(kr)){var ie=j?A:G(A);Mn(k,"transform","translate"+g("X")+"("+ie+"px)"),A!==ie&&r(xu)}}function G(A){if(e.is(Oo)){var j=D(A),ie=j>t.Controller.getEnd(),ae=j<0;(ae||ie)&&(A=$(A,ie))}return A}function $(A,j){var ie=A-w(j),ae=v();return A-=x(ae*(hr(vn(ie)/ae)||1))*(j?1:-1),A}function L(){_(T(),!0),S.cancel()}function D(A){for(var j=t.Slides.get(),ie=0,ae=1/0,O=0;O<j.length;O++){var oe=j[O].index,N=vn(E(oe,!0)-A);if(N<=ae)ae=N,ie=oe;else break}return ie}function E(A,j){var ie=x(p(A-1)-V(A));return j?C(ie):ie}function T(){var A=g("left");return Tn(k)[A]-Tn(f)[A]+x(u(!1))}function C(A){return n.trimSpace&&e.is(To)&&(A=lo(A,0,x(v(!0)-y()))),A}function V(A){var j=n.focus;return j==="center"?(y()-d(A,!0))/2:+j*d(A)||0}function w(A){return E(A?t.Controller.getEnd():0,!!n.trimSpace)}function q(A){var j=x($(T(),A));return A?j>=0:j<=k[g("scrollWidth")]-Tn(f)[g("width")]}function I(A,j){j=Cr(j)?T():j;var ie=A!==!0&&x(j)<x(w(!1)),ae=A!==!1&&x(j)>x(w(!0));return ie||ae}return{mount:W,move:B,jump:P,translate:_,shift:$,cancel:L,toIndex:D,toPosition:E,getPosition:T,getLimit:w,exceededLimit:I,reposition:U}}function fg(e,t,n){var i=on(e),o=i.on,r=i.emit,l=t.Move,c=l.getPosition,d=l.getLimit,u=l.toPosition,p=t.Slides,y=p.isEnough,v=p.getLength,m=n.omitEnd,g=e.is(Oo),x=e.is(To),b=Jt(T,!1),k=Jt(T,!0),f=n.start||0,S,W=f,U,B,P;function _(){G(),o([gn,sn,ha],G),o(La,$)}function G(){U=v(!0),B=n.perMove,P=n.perPage,S=q();var N=lo(f,0,m?S:U-1);N!==f&&(f=N,l.reposition())}function $(){S!==q()&&r(ha)}function L(N,le,Q){if(!oe()){var be=E(N),Pe=w(be);Pe>-1&&(le||Pe!==f)&&(ie(Pe),l.move(be,Pe,W,Q))}}function D(N,le,Q,be){t.Scroll.scroll(N,le,Q,function(){var Pe=w(l.toIndex(c()));ie(m?Ti(Pe,S):Pe),be&&be()})}function E(N){var le=f;if(Ci(N)){var Q=N.match(/([+\-<>])(\d+)?/)||[],be=Q[1],Pe=Q[2];be==="+"||be==="-"?le=C(f+ +(""+be+(+Pe||1)),f):be===">"?le=Pe?I(+Pe):b(!0):be==="<"&&(le=k(!0))}else le=g?N:lo(N,0,S);return le}function T(N,le){var Q=B||(O()?1:P),be=C(f+Q*(N?-1:1),f,!(B||O()));return be===-1&&x&&!ou(c(),d(!N),1)?N?0:S:le?be:w(be)}function C(N,le,Q){if(y()||O()){var be=V(N);be!==N&&(le=N,N=be,Q=!1),N<0||N>S?!B&&(ra(0,N,le,!0)||ra(S,le,N,!0))?N=I(A(N)):g?N=Q?N<0?-(U%P||P):U:N:n.rewind?N=N<0?S:0:N=-1:Q&&N!==le&&(N=I(A(le)+(N<le?-1:1)))}else N=-1;return N}function V(N){if(x&&n.trimSpace==="move"&&N!==f)for(var le=c();le===u(N,!0)&&ra(N,0,e.length-1,!n.rewind);)N<f?--N:++N;return N}function w(N){return g?(N+U)%U||0:N}function q(){for(var N=U-(O()||g&&B?1:P);m&&N-- >0;)if(u(U-1,!0)!==u(N,!0)){N++;break}return lo(N,0,U-1)}function I(N){return lo(O()?N:P*N,0,S)}function A(N){return O()?Ti(N,S):ga((N>=S?U-1:N)/P)}function j(N){var le=l.toIndex(N);return x?lo(le,0,S):le}function ie(N){N!==f&&(W=f,f=N)}function ae(N){return N?W:f}function O(){return!Cr(n.focus)||n.isNavigation}function oe(){return e.state.is([Ho,$r])&&!!n.waitForTransition}return{mount:_,go:L,scroll:D,getNext:b,getPrev:k,getAdjacent:T,getEnd:q,setIndex:ie,getIndex:ae,toIndex:I,toPage:A,toDest:j,hasFocus:O,isBusy:oe}}var yg="http://www.w3.org/2000/svg",vg="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",Ar=40;function xg(e,t,n){var i=on(e),o=i.on,r=i.bind,l=i.emit,c=n.classes,d=n.i18n,u=t.Elements,p=t.Controller,y=u.arrows,v=u.track,m=y,g=u.prev,x=u.next,b,k,f={};function S(){U(),o(gn,W)}function W(){B(),S()}function U(){var D=n.arrows;D&&!(g&&x)&&G(),g&&x&&(mr(f,{prev:g,next:x}),gr(m,D?"":"none"),Bn(m,k=wl+"--"+n.direction),D&&(P(),L(),Nt([g,x],Rr,v.id),l(mu,g,x)))}function B(){i.destroy(),ni(m,k),b?(qi(y?[g,x]:m),g=x=null):jn([g,x],Sl)}function P(){o([ki,Wo,sn,Yi,ha],L),r(x,"click",Jt(_,">")),r(g,"click",Jt(_,"<"))}function _(D){p.go(D,!0)}function G(){m=y||vo("div",c.arrows),g=$(!0),x=$(!1),b=!0,Lr(m,[g,x]),!y&&cl(m,v)}function $(D){var E='<button class="'+c.arrow+" "+(D?c.prev:c.next)+'" type="button"><svg xmlns="'+yg+'" viewBox="0 0 '+Ar+" "+Ar+'" width="'+Ar+'" height="'+Ar+'" focusable="false"><path d="'+(n.arrowPath||vg)+'" />';return nu(E)}function L(){if(g&&x){var D=e.index,E=p.getPrev(),T=p.getNext(),C=E>-1&&D<E?d.last:d.prev,V=T>-1&&D>T?d.first:d.next;g.disabled=E<0,x.disabled=T<0,Nt(g,Pn,C),Nt(x,Pn,V),l(gu,g,x,E,T)}}return{arrows:f,mount:S,destroy:B,update:L}}var bg=ul+"-interval";function Sg(e,t,n){var i=on(e),o=i.on,r=i.bind,l=i.emit,c=Ia(n.interval,e.go.bind(e,">"),P),d=c.isPaused,u=t.Elements,p=t.Elements,y=p.root,v=p.toggle,m=n.autoplay,g,x,b=m==="pause";function k(){m&&(f(),v&&Nt(v,Rr,u.track.id),b||S(),B())}function f(){n.pauseOnHover&&r(y,"mouseenter mouseleave",function(G){g=G.type==="mouseenter",U()}),n.pauseOnFocus&&r(y,"focusin focusout",function(G){x=G.type==="focusin",U()}),v&&r(v,"click",function(){b?S():W(!0)}),o([si,Pa,sn],c.rewind),o(si,_)}function S(){d()&&t.Slides.isEnough()&&(c.start(!n.resetProgress),x=g=b=!1,B(),l(fl))}function W(G){G===void 0&&(G=!0),b=!!G,B(),d()||(c.pause(),l(yl))}function U(){b||(g||x?W(!1):S())}function B(){v&&(ti(v,Ui,!b),Nt(v,Pn,n.i18n[b?"play":"pause"]))}function P(G){var $=u.bar;$&&Mn($,"width",G*100+"%"),l(yu,G)}function _(G){var $=t.Slides.getAt(G);c.set($&&+An($.slide,bg)||n.interval)}return{mount:k,destroy:c.cancel,play:S,pause:W,isPaused:d}}function wg(e,t,n){var i=on(e),o=i.on;function r(){n.cover&&(o(vl,Jt(c,!0)),o([ki,gn,sn],Jt(l,!0)))}function l(d){t.Slides.forEach(function(u){var p=Pr(u.container||u.slide,"img");p&&p.src&&c(d,p,u)})}function c(d,u,p){p.style("background",d?'center/cover no-repeat url("'+u.src+'")':"",!0),gr(u,d?"none":"")}return{mount:r,destroy:Jt(l,!1)}}var $g=10,Cg=600,Tg=.6,Lg=1.5,Pg=800;function Ig(e,t,n){var i=on(e),o=i.on,r=i.emit,l=e.state.set,c=t.Move,d=c.getPosition,u=c.getLimit,p=c.exceededLimit,y=c.translate,v=e.is(To),m,g,x=1;function b(){o(si,W),o([gn,sn],U)}function k(P,_,G,$,L){var D=d();if(W(),G&&(!v||!p())){var E=t.Layout.sliderSize(),T=Fs(P)*E*ga(vn(P)/E)||0;P=c.toPosition(t.Controller.toDest(P%E))+T}var C=ou(D,P,1);x=1,_=C?0:_||ma(vn(P-D)/Lg,Pg),g=$,m=Ia(_,f,Jt(S,D,P,L),1),l($r),r(Pa),m.start()}function f(){l($o),g&&g(),r(Yi)}function S(P,_,G,$){var L=d(),D=P+(_-P)*B($),E=(D-L)*x;y(L+E),v&&!G&&p()&&(x*=Tg,vn(E)<$g&&k(u(p(!0)),Cg,!1,g,!0))}function W(){m&&m.cancel()}function U(){m&&!m.isPaused()&&(W(),f())}function B(P){var _=n.easingFunc;return _?_(P):1-Math.pow(1-P,4)}return{mount:b,destroy:W,scroll:k,cancel:U}}var co={passive:!1,capture:!0};function Rg(e,t,n){var i=on(e),o=i.on,r=i.emit,l=i.bind,c=i.unbind,d=e.state,u=t.Move,p=t.Scroll,y=t.Controller,v=t.Elements.track,m=t.Media.reduce,g=t.Direction,x=g.resolve,b=g.orient,k=u.getPosition,f=u.exceededLimit,S,W,U,B,P,_=!1,G,$,L;function D(){l(v,qa,Ms,co),l(v,Ua,Ms,co),l(v,Mu,T,co),l(v,"click",w,{capture:!0}),l(v,"dragstart",Qn),o([ki,gn],E)}function E(){var Y=n.drag;ce(!Y),B=Y==="free"}function T(Y){if(G=!1,!$){var se=Pe(Y);be(Y.target)&&(se||!Y.button)&&(y.isBusy()?Qn(Y,!0):(L=se?v:window,P=d.is([Ho,$r]),U=null,l(L,qa,C,co),l(L,Ua,V,co),u.cancel(),p.cancel(),q(Y)))}}function C(Y){if(d.is(ia)||(d.set(ia),r(du)),Y.cancelable)if(P){u.translate(S+Q(O(Y)));var se=oe(Y)>rc,pe=_!==(_=f());(se||pe)&&q(Y),G=!0,r(uu),Qn(Y)}else j(Y)&&(P=A(Y),Qn(Y))}function V(Y){d.is(ia)&&(d.set($o),r(pu)),P&&(I(Y),Qn(Y)),c(L,qa,C),c(L,Ua,V),P=!1}function w(Y){!$&&G&&Qn(Y,!0)}function q(Y){U=W,W=Y,S=k()}function I(Y){var se=ie(Y),pe=ae(se),fe=n.rewind&&n.rewindByDrag;m(!1),B?y.scroll(pe,0,n.snap):e.is(kr)?y.go(b(Fs(se))<0?fe?"<":"-":fe?">":"+"):e.is(To)&&_&&fe?y.go(f(!0)?">":"<"):y.go(y.toDest(pe),!0),m(!0)}function A(Y){var se=n.dragMinThreshold,pe=dr(se),fe=pe&&se.mouse||0,we=(pe?se.touch:+se)||10;return vn(O(Y))>(Pe(Y)?we:fe)}function j(Y){return vn(O(Y))>vn(O(Y,!0))}function ie(Y){if(e.is(Oo)||!_){var se=oe(Y);if(se&&se<rc)return O(Y)/se}return 0}function ae(Y){return k()+Fs(Y)*Ti(vn(Y)*(n.flickPower||600),B?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function O(Y,se){return le(Y,se)-le(N(Y),se)}function oe(Y){return As(Y)-As(N(Y))}function N(Y){return W===Y&&U||W}function le(Y,se){return(Pe(Y)?Y.changedTouches[0]:Y)["page"+x(se?"Y":"X")]}function Q(Y){return Y/(_&&e.is(To)?lg:1)}function be(Y){var se=n.noDrag;return!ur(Y,"."+Pu+", ."+Fa)&&(!se||!ur(Y,se))}function Pe(Y){return typeof TouchEvent<"u"&&Y instanceof TouchEvent}function ye(){return P}function ce(Y){$=Y}return{mount:D,disable:ce,isDragging:ye}}var kg={Spacebar:" ",Right:Ea,Left:ka,Up:bu,Down:Su};function $l(e){return e=Ci(e)?e:e.key,kg[e]||e}var ac="keydown";function Eg(e,t,n){var i=on(e),o=i.on,r=i.bind,l=i.unbind,c=e.root,d=t.Direction.resolve,u,p;function y(){v(),o(gn,m),o(gn,v),o(si,x)}function v(){var k=n.keyboard;k&&(u=k==="global"?window:c,r(u,ac,b))}function m(){l(u,ac)}function g(k){p=k}function x(){var k=p;p=!0,Zd(function(){p=k})}function b(k){if(!p){var f=$l(k);f===d(ka)?e.go("<"):f===d(Ea)&&e.go(">")}}return{mount:y,destroy:m,disable:g}}var sr=ul+"-lazy",aa=sr+"-srcset",Mg="["+sr+"], ["+aa+"]";function Ag(e,t,n){var i=on(e),o=i.on,r=i.off,l=i.bind,c=i.emit,d=n.lazyLoad==="sequential",u=[Wo,Yi],p=[];function y(){n.lazyLoad&&(v(),o(sn,v))}function v(){ai(p),m(),d?k():(r(u),o(u,g),g())}function m(){t.Slides.forEach(function(f){dl(f.slide,Mg).forEach(function(S){var W=An(S,sr),U=An(S,aa);if(W!==S.src||U!==S.srcset){var B=n.classes.spinner,P=S.parentElement,_=Pr(P,"."+B)||vo("span",B,P);p.push([S,f,_]),S.src||gr(S,"none")}})})}function g(){p=p.filter(function(f){var S=n.perPage*((n.preloadPages||1)+1)-1;return f[1].isWithin(e.index,S)?x(f):!0}),p.length||r(u)}function x(f){var S=f[0];Bn(f[1].slide,Ws),l(S,"load error",Jt(b,f)),Nt(S,"src",An(S,sr)),Nt(S,"srcset",An(S,aa)),jn(S,sr),jn(S,aa)}function b(f,S){var W=f[0],U=f[1];ni(U.slide,Ws),S.type!=="error"&&(qi(f[2]),gr(W,""),c(vl,W,U),c(Co)),d&&k()}function k(){p.length&&x(p.shift())}return{mount:y,destroy:Jt(ai,p),check:g}}function Fg(e,t,n){var i=on(e),o=i.on,r=i.emit,l=i.bind,c=t.Slides,d=t.Elements,u=t.Controller,p=u.hasFocus,y=u.getIndex,v=u.go,m=t.Direction.resolve,g=d.pagination,x=[],b,k;function f(){S(),o([gn,sn,ha],f);var $=n.pagination;g&&gr(g,$?"":"none"),$&&(o([si,Pa,Yi],G),W(),G(),r(hu,{list:b,items:x},_(e.index)))}function S(){b&&(qi(g?Ri(b.children):b),ni(b,k),ai(x),b=null),i.destroy()}function W(){var $=e.length,L=n.classes,D=n.i18n,E=n.perPage,T=p()?u.getEnd()+1:hr($/E);b=g||vo("ul",L.pagination,d.track.parentElement),Bn(b,k=Na+"--"+P()),Nt(b,ii,"tablist"),Nt(b,Pn,D.select),Nt(b,bl,P()===Ma?"vertical":"");for(var C=0;C<T;C++){var V=vo("li",null,b),w=vo("button",{class:L.page,type:"button"},V),q=c.getIn(C).map(function(A){return A.slide.id}),I=!p()&&E>1?D.pageX:D.slideX;l(w,"click",Jt(U,C)),n.paginationKeyboard&&l(w,"keydown",Jt(B,C)),Nt(V,ii,"presentation"),Nt(w,ii,"tab"),Nt(w,Rr,q.join(" ")),Nt(w,Pn,Ns(I,C+1)),Nt(w,xo,-1),x.push({li:V,button:w,page:C})}}function U($){v(">"+$,!0)}function B($,L){var D=x.length,E=$l(L),T=P(),C=-1;E===m(Ea,!1,T)?C=++$%D:E===m(ka,!1,T)?C=(--$+D)%D:E==="Home"?C=0:E==="End"&&(C=D-1);var V=x[C];V&&(tu(V.button),v(">"+C),Qn(L,!0))}function P(){return n.paginationDirection||n.direction}function _($){return x[u.toPage($)]}function G(){var $=_(y(!0)),L=_(y());if($){var D=$.button;ni(D,Ui),jn(D,ec),Nt(D,xo,-1)}if(L){var E=L.button;Bn(E,Ui),Nt(E,ec,!0),Nt(E,xo,"")}r(fu,{list:b,items:x},$,L)}return{items:x,mount:f,destroy:S,getAt:_,update:G}}var Ng=[" ","Enter"];function _g(e,t,n){var i=n.isNavigation,o=n.slideFocus,r=[];function l(){e.splides.forEach(function(g){g.isParent||(u(e,g.splide),u(g.splide,e))}),i&&p()}function c(){r.forEach(function(g){g.destroy()}),ai(r)}function d(){c(),l()}function u(g,x){var b=on(g);b.on(si,function(k,f,S){x.go(x.is(Oo)?S:k)}),r.push(b)}function p(){var g=on(e),x=g.on;x(ml,v),x(vu,m),x([ki,gn],y),r.push(g),g.emit(hl,e.splides)}function y(){Nt(t.Elements.list,bl,n.direction===Ma?"vertical":"")}function v(g){e.go(g.index)}function m(g,x){ll(Ng,$l(x))&&(v(g),Qn(x))}return{setup:Jt(t.Media.set,{slideFocus:Cr(o)?i:o},!0),mount:l,destroy:c,remount:d}}function Hg(e,t,n){var i=on(e),o=i.bind,r=0;function l(){n.wheel&&o(t.Elements.track,"wheel",c,co)}function c(u){if(u.cancelable){var p=u.deltaY,y=p<0,v=As(u),m=n.wheelMinThreshold||0,g=n.wheelSleep||0;vn(p)>m&&v-r>g&&(e.go(y?"<":">"),r=v),d(y)&&Qn(u)}}function d(u){return!n.releaseWheel||e.state.is(Ho)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var Wg=90;function Og(e,t,n){var i=on(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,c=vo("span",ig),d=Ia(Wg,Jt(p,!1));function u(){l&&(v(!t.Autoplay.isPaused()),Nt(r,ic,!0),c.textContent="…",o(fl,Jt(v,!0)),o(yl,Jt(v,!1)),o([Wo,Yi],Jt(p,!0)))}function p(m){Nt(r,nc,m),m?(Lr(r,c),d.start()):(qi(c),d.cancel())}function y(){jn(r,[tc,ic,nc]),qi(c)}function v(m){l&&Nt(r,tc,m?"off":"polite")}return{mount:u,disable:v,destroy:y}}var Dg=Object.freeze({__proto__:null,Media:Um,Direction:Km,Elements:cg,Slides:ug,Layout:pg,Clones:gg,Move:hg,Controller:fg,Arrows:xg,Autoplay:Sg,Cover:wg,Scroll:Ig,Drag:Rg,Keyboard:Eg,LazyLoad:Ag,Pagination:Fg,Sync:_g,Wheel:Hg,Live:Og}),zg={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"},Bg={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:ag,i18n:zg,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function jg(e,t,n){var i=t.Slides;function o(){on(e).on([ki,sn],r)}function r(){i.forEach(function(c){c.style("transform","translateX(-"+100*c.index+"%)")})}function l(c,d){i.style("transition","opacity "+n.speed+"ms "+n.easing),Zd(d)}return{mount:o,start:l,cancel:Ms}}function Vg(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,c=Jt(Mn,l,"transition"),d;function u(){on(e).bind(l,"transitionend",function(m){m.target===l&&d&&(y(),d())})}function p(m,g){var x=i.toPosition(m,!0),b=i.getPosition(),k=v(m);vn(x-b)>=1&&k>=1?n.useScroll?r.scroll(x,k,!1,g):(c("transform "+k+"ms "+n.easing),i.translate(x,!0),d=g):(i.jump(m),g())}function y(){c(""),r.cancel()}function v(m){var g=n.rewindSpeed;if(e.is(To)&&g){var x=o.getIndex(!0),b=o.getEnd();if(x===0&&m>=b||x>=b&&m===0)return g}return n.speed}return{mount:u,start:p,cancel:y}}var Gg=(function(){function e(n,i){this.event=on(),this.Components={},this.state=Xm(mo),this.splides=[],this._o={},this._E={};var o=Ci(n)?iu(document,n):n;ar(o,o+" is invalid."),this.root=o,i=bi({label:An(o,Pn)||"",labelledby:An(o,xl)||""},Bg,e.defaults,i||{});try{bi(i,JSON.parse(An(o,ul)))}catch{ar(!1,"Invalid JSON")}this._o=Object.create(bi({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,c=this.Components;ar(l.is([mo,pa]),"Already mounted!"),l.set(mo),this._C=c,this._T=o||this._T||(this.is(kr)?jg:Vg),this._E=i||this._E;var d=mr({},Dg,this._E,{Transition:this._T});return Gi(d,function(u,p){var y=u(r,c,r._o);c[p]=y,y.setup&&y.setup()}),Gi(c,function(u){u.mount&&u.mount()}),this.emit(ki),Bn(this.root,og),l.set($o),this.emit(_s),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is($o)&&(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(Ri(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(sn),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,r=this.state;return r.is(mo)?on(this).on(_s,this.destroy.bind(this,i)):(Gi(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(gl),o.destroy(),i&&ai(this.splides),r.set(pa)),this},zm(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})(),Cl=Gg;Cl.defaults={};Cl.STATES=jm;var sc=[[ki,"onMounted"],[_s,"onReady"],[si,"onMove"],[Wo,"onMoved"],[ml,"onClick"],[au,"onActive"],[su,"onInactive"],[lu,"onVisible"],[cu,"onHidden"],[sn,"onRefresh"],[gn,"onUpdated"],[Co,"onResize"],[La,"onResized"],[du,"onDrag"],[uu,"onDragging"],[pu,"onDragged"],[Pa,"onScroll"],[Yi,"onScrolled"],[gl,"onDestroy"],[mu,"onArrowsMounted"],[gu,"onArrowsUpdated"],[hu,"onPaginationMounted"],[fu,"onPaginationUpdated"],[hl,"onNavigationMounted"],[fl,"onAutoplayPlay"],[yu,"onAutoplayPlaying"],[yl,"onAutoplayPause"],[vl,"onLazyLoadLoaded"]];function Tl(...e){return e.filter(Boolean).join(" ")}function fa(e){return e!==null&&typeof e=="object"}function Os(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!Os(n,t[i]));if(fa(e)&&fa(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Os(e[o],t[o]))}return e===t}function Xg(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function qg(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 Ds(e,t){const n=e;return qg(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():fa(i)?n[o]=Ds(fa(n[o])?n[o]:{},i):n[o]=i}),n}var Ug=({children:e,className:t,...n})=>s.createElement("div",{className:Tl("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),Ll=class extends s.Component{constructor(){super(...arguments),this.splideRef=s.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new Cl(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Ds({},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&&!Os(this.options,e)&&(this.splide.options=e,this.options=Ds({},e));const t=this.getSlides();Xg(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){sc.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 s.createElement(t,{className:Tl("splide",e),ref:this.splideRef,...this.omit(o,["options",...sc.map(r=>r[1])])},n?s.createElement(Ug,null,i):i)}},Pl=({children:e,className:t,...n})=>s.createElement("li",{className:Tl("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 Kg="RichTextRenderer-module__link___BWeZ2",Yg={link:Kg},Zg=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))},Do=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Zg(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function dn(e){const{color:t,...n}=e;return n}function Qt(e,t){var o,r,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:Do(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:F.scalingValue(e.letterSpacing,t),wordSpacing:F.scalingValue(e.wordSpacing,t),fontSize:F.scalingValue(n,t),lineHeight:i!==void 0?F.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(r=e.textAppearance)==null?void 0:r.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}function Au(e){return e!=null&&e.length?e.some(t=>t.type==="link"?Au(t.children):!!t.text):!1}const Ki=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:Yg.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:Jg(i),children:i.text},o));return a.jsx(a.Fragment,{children:e.map((n,i)=>{const o=n.children;return a.jsx("div",{children:Au(o)?t(o):" "},i)})})};function Jg(e){return{...e.fontFamily&&{fontFamily:Do(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 Qg="SvgImage-module__svg___q3xE-",eh="SvgImage-module__img___VsTm-",lc={svg:Qg,img:eh},th=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},nh=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,mn=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[r,l]=s.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return s.useEffect(()=>{if(typeof window<"u"&&window.CSS){const c=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');l(c)}},[]),!th(e)||!r?a.jsx("img",{src:e,alt:"",className:Ct(lc.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:Ct(lc.svg,i),style:{"--svg":nh(e),"--fill":t,"--hover-fill":n,...o??{}}})},ih={"top-left":$t.topLeftAlignment,"top-center":$t.topCenterAlignment,"top-right":$t.topRightAlignment,"middle-left":$t.middleLeftAlignment,"middle-center":$t.middleCenterAlignment,"middle-right":$t.middleRightAlignment,"bottom-left":$t.bottomLeftAlignment,"bottom-center":$t.bottomCenterAlignment,"bottom-right":$t.bottomRightAlignment};function oh({settings:e,content:t,styles:n,isEditor:i}){const[o,r]=s.useState(null),{widthSettings:l,fontSettings:c,letterSpacing:d,textAlign:u,wordSpacing:p,fontSizeLineHeight:y,textAppearance:v,color:m}=n.imageCaption??{},[g,x]=s.useState(void 0),[b,k]=s.useState(null),[f,S]=s.useState(0),[O,U]=s.useState(0),{direction:z,transition:I,controls:N,pagination:q,imageCaption:$,triggers:L}=e,D=s.useRef(I.type),{x:_,y:C}=e.controls.offset,T=B=>{o&&o.go(B)};return s.useEffect(()=>{if(!b)return;const B=new ResizeObserver(w=>{if(!o)return;const[X]=w;x({width:Math.round(X.contentRect.width),height:Math.round(X.contentRect.height)})});return B.observe(b),()=>B.unobserve(b)},[b]),s.useEffect(()=>{!o||D.current===I.type||(U(B=>B+1),D.current=I.type)},[I.type]),a.jsx("div",{className:Ct($t.wrapper,{[$t.editor]:i}),ref:k,children:a.jsxs("div",{className:$t.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:I.backgroundColor&&I.type==="fade in"?I.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:Ct($t.captionBlock),children:a.jsx("div",{className:$t.captionTextWrapper,children:t.map((B,w)=>a.jsx("div",{className:Ct($t.captionText,ih[$.alignment],{[$t.withPointerEvents]:w===f&&i,[$t.active]:w===f}),style:{fontFamily:Do(c.fontFamily),fontWeight:c.fontWeight,fontStyle:c.fontStyle,width:l.sizing==="auto"?"max-content":F.scalingValue(l.width,i),letterSpacing:F.scalingValue(d,i),wordSpacing:F.scalingValue(p,i),textAlign:u,fontSize:F.scalingValue(y.fontSize,i),lineHeight:F.scalingValue(y.lineHeight,i),textTransform:v.textTransform??"none",textDecoration:v.textDecoration??"none",fontVariant:v.fontVariant??"normal",color:m,transitionDuration:I.duration?`${Math.round(parseInt(I.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:$t.captionTextInner,style:{"--link-hover-color":$.linkHoverColor,"--link-color":$.linkColor,position:"relative",top:F.scalingValue($.offset.y,i),left:F.scalingValue($.offset.x,i)},children:a.jsx(Ki,{content:B.imageCaption})})},w))})}),a.jsx(Ll,{onMove:B=>{S(B.index)},ref:r,options:{arrows:!1,speed:I.duration?parseInt(I.duration):500,autoplay:L.autoPlay!==null,...L.autoPlay!==null&&{interval:parseInt(L.autoPlay)*1e3},direction:z==="horiz"||I.type==="fade in"?"ltr":"ttb",pagination:!1,drag:L.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:I.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((B,w)=>a.jsx(Pl,{children:a.jsx("div",{className:$t.sliderItem,children:a.jsx("div",{className:$t.imgWrapper,children:a.jsx("img",{className:Ct($t.sliderImage,{[$t.contain]:B.image.objectFit==="contain",[$t.cover]:B.image.objectFit==="cover"}),src:B.image.url,alt:B.image.name??""})})})},w))},O),N.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ct($t.arrow,{[$t.arrowVertical]:z==="vert",[$t.hoverArrow]:N.show==="on hover"}),style:{color:N.color,"--arrow-hover-color":N.hover},children:a.jsxs("button",{onClick:()=>{T("-1")},className:$t.arrowInner,style:{transform:`translate(${F.scalingValue(_,i)}, ${F.scalingValue(C*(z==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${z==="horiz"?"0deg":"90deg"})`},children:[N.arrowsImgUrl&&a.jsx(mn,{url:N.arrowsImgUrl,fill:N.color,hoverFill:N.hover,className:Ct($t.arrowImg,$t.mirror)}),!N.arrowsImgUrl&&a.jsx(cc,{color:N.color,className:Ct($t.arrowIcon,$t.arrowImg,$t.mirror)})]})}),a.jsx("div",{className:Ct($t.arrow,$t.nextArrow,{[$t.arrowVertical]:z==="vert",[$t.hoverArrow]:N.show==="on hover"}),style:{color:N.color,"--arrow-hover-color":N.hover},children:a.jsxs("button",{className:$t.arrowInner,onClick:()=>T("+1"),style:{transform:`translate(${F.scalingValue(_*(z==="horiz"?-1:1),i)}, ${F.scalingValue(C,i)}) scale(${e.controls.scale/100}) rotate(${z==="horiz"?"0deg":"90deg"})`},children:[N.arrowsImgUrl&&a.jsx(mn,{url:N.arrowsImgUrl,fill:N.color,hoverFill:N.hover,className:$t.arrowImg}),!N.arrowsImgUrl&&a.jsx(cc,{color:N.color,className:Ct($t.arrowIcon,$t.arrowImg)})]})})]}),L.triggersList.click&&a.jsx("div",{className:$t.clickOverlay,onClick:()=>{o&&o.go("+1")}}),q.isActive&&a.jsx("div",{className:Ct($t.pagination,{[$t.paginationInsideBottom]:q.position==="inside-1"&&z==="horiz",[$t.paginationInsideTop]:q.position==="inside-2"&&z==="horiz",[$t.paginationOutsideBottom]:q.position==="outside-1"&&z==="horiz",[$t.paginationOutsideTop]:q.position==="outside-2"&&z==="horiz",[$t.paginationInsideLeft]:q.position==="inside-1"&&z==="vert",[$t.paginationInsideRight]:q.position==="inside-2"&&z==="vert",[$t.paginationOutsideLeft]:q.position==="outside-1"&&z==="vert",[$t.paginationOutsideRight]:q.position==="outside-2"&&z==="vert",[$t.paginationVertical]:z==="vert"}),children:a.jsx("div",{className:$t.paginationInner,style:{backgroundColor:q.colors[2],transform:`scale(${q.scale/100}) translate(${F.scalingValue(q.offset.x,i)}, ${F.scalingValue(q.offset.y,i)}) rotate(${z==="horiz"?"0deg":"90deg"})`},children:t.map((B,w)=>a.jsx("button",{onClick:()=>{o&&o.go(w)},className:Ct($t.paginationItem),children:a.jsx("div",{className:Ct($t.dot,{[$t.activeDot]:w===f}),style:{backgroundColor:w===f?q.colors[0]:q.colors[1],"--pagination-hover-color":q.hover}})},w))})})]})})}function cc({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const rh={element:oh,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"]}},ah="ImageRevealSlider-module__imageRevealSlider___UE5Ob",sh="ImageRevealSlider-module__image___Qjt-e",lh="ImageRevealSlider-module__link___N-iLG",ch="ImageRevealSlider-module__cursor___2U03d",no={imageRevealSlider:ah,image:sh,link:lh,cursor:ch};function dc(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const r=i.width?Number.parseFloat(i.width):o.naturalWidth,l=o.naturalHeight/o.naturalWidth*r,c=r/2,d=l/2;if(e>=i.x-c&&e<=i.x+c&&t>=i.y-d&&t<=i.y+d)return!0}return!1}function Ua(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function dh(e,t,n,i){let o,r;if(t==="custom"){o=n;const l=await Ua(e);r=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await Ua(e);r=l.height/l.width*o}else{const l=await Ua(e);o=l.width,r=l.height}return{width:o,height:r,finalWidth:`${o}px`}}function uh({settings:e,content:t,isEditor:n}){const[i,o]=s.useState(null),[r,l]=s.useState([]),[c,d]=s.useState(0),u=s.useRef(0),[p,y]=s.useState({x:0,y:0}),[v,m]=s.useState(1),[g,x]=s.useState("none"),b=s.useRef({x:0,y:0}),[k,f]=s.useState(!1),{sizeType:S,imageWidth:O,randomRangeImageWidth:U}=e.imageSize,{revealPosition:z,visible:I}=e.position,{cursorType:N,target:q,defaultCursorScale:$,defaultCursor:L,hoverCursorScale:D,hoverCursor:_}=e.cursor;s.useEffect(()=>{if(!i)return;const B=(R,E)=>{const V=i.getBoundingClientRect(),ie=R-V.left,re=E-V.top;if(y({x:ie,y:re}),N==="system"){x("none"),m(1);return}const W=ie,ae=re,A=document.elementFromPoint(V.left+W,V.top+ae);if(A&&A.closest("a")){x("none"),m(1);return}const le=dc(W,ae,r)||q==="area"?{img:_??"none",scale:D}:{img:L??"none",scale:$};x(le.img),m(le.scale)},w=R=>{R.stopPropagation(),b.current={x:R.clientX,y:R.clientY},B(R.clientX,R.clientY)},X=()=>{k&&B(b.current.x,b.current.y)};return i.addEventListener("mousemove",w),window.addEventListener("scroll",X,!0),()=>{i.removeEventListener("mousemove",w),window.removeEventListener("scroll",X,!0)}},[i,k,p,N,q,_,L,D,$,r]),s.useEffect(()=>{k||(x("none"),m(0))},[k]);const C=async(B,w,X,R={})=>{const{width:E,height:V,finalWidth:ie}=await dh(B.image.url,S,O,U);let re=0,W=0;z==="same"?(re=w/2,W=X/2):(re=R.x??Math.random()*w,W=R.y??Math.random()*X);const ae=Math.min(Math.max(re,E/2),w-E/2),A=Math.min(Math.max(W,V/2),X-V/2);return{id:u.current++,url:B.image.url,link:B.link,name:B.image.name,x:ae,y:A,width:ie}};s.useEffect(()=>{if(!i||t.length===0)return;const B=i.getBoundingClientRect(),w=B.width,X=B.height,R=[];(async()=>{const V=t[0],ie=await C(V,w,X);R.push(ie),l(R),d(1)})()},[S,O,U,z,i]),s.useEffect(()=>{I==="last One"&&l(B=>B.length>0?[B[B.length-1]]:[])},[I]);const T=async B=>{if(!i)return;const w=i.getBoundingClientRect(),X=B.clientX-w.left,R=B.clientY-w.top;if(q==="image"&&!dc(X,R,r))return;let E=0,V=0;z==="on Click"?(E=X,V=R):z==="same"?(E=w.width/2,V=w.height/2):(E=Math.random()*w.width,V=Math.random()*w.height);const ie=t[c],re=await C(ie,w.width,w.height,{x:E,y:V});l(W=>I==="all"?[...W,re]:[re]),d(W=>W>=t.length-1?0:W+1)};return a.jsxs("div",{ref:o,onClick:T,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),className:no.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[r.map(B=>a.jsx("div",{className:no.wrapper,style:{top:`${B.y}px`,left:`${B.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:B.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:q==="area"&&B.link?a.jsx("a",{href:B.link,target:"_blank",className:no.link,children:a.jsx("img",{src:B.url,alt:B.name,className:no.image},B.id)}):a.jsx("img",{src:B.url,alt:B.name,className:no.image},B.id)},B.id)),k&&a.jsx("div",{className:no.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${v})`,backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const ph={element:uh,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:""}]}}}},mh="LightBox-module__hidden___9s-9x",gh="LightBox-module__heroImage___sTxNF",hh="LightBox-module__background___rm9ml",fh="LightBox-module__editor___4ACaY",yh="LightBox-module__contentStyle___Bgnsq",vh="LightBox-module__imageStyle___tLIlB",xh="LightBox-module__imgWrapper___LuFUp",bh="LightBox-module__contain___8-yaS",Sh="LightBox-module__cover___hNvOG",wh="LightBox-module__caption___b6L2I",$h="LightBox-module__captionTextInner___rCGNH",Ch="LightBox-module__lightboxSplide___XFuWC",Th="LightBox-module__arrow___iz38X",Lh="LightBox-module__arrowVertical___Zfz81",Ph="LightBox-module__nextArrow___zkAQN",Ih="LightBox-module__arrowInner___p48sW",Rh="LightBox-module__arrowIcon___3VaFf",kh="LightBox-module__arrowImg___pNV88",Eh="LightBox-module__mirror___pjeXc",Mh="LightBox-module__thumbsWrapper___GB-nU",Ah="LightBox-module__thumbsContainerVertical___wttk5",Fh="LightBox-module__thumbsContainer___osSma",Nh="LightBox-module__thumbsAlignStart___MO6tY",_h="LightBox-module__thumbsAlignCenter___Q4sUx",Hh="LightBox-module__thumbsAlignEnd___p4y9R",Wh="LightBox-module__thumbItem___HvnF3",Oh="LightBox-module__closeButton___g2khP",Dh="LightBox-module__fadeIn___0m5GW",zh="LightBox-module__slideInLeft___gPYwC",Bh="LightBox-module__slideInRight___S-pPp",jh="LightBox-module__slideInTop___DFdAj",Vh="LightBox-module__slideInBottom___m27kZ",Gh="LightBox-module__fadeOut___55qBR",Xh="LightBox-module__slideOutLeft___NvU7P",qh="LightBox-module__slideOutRight___SK7eC",Uh="LightBox-module__slideOutTop___Vgg0z",Kh="LightBox-module__slideOutBottom___nJ0Ef",Yh="LightBox-module__scaleSlide___vZriG",at={hidden:mh,heroImage:gh,background:hh,editor:fh,contentStyle:yh,imageStyle:vh,imgWrapper:xh,contain:bh,cover:Sh,caption:wh,captionTextInner:$h,lightboxSplide:Ch,arrow:Th,arrowVertical:Lh,nextArrow:Ph,arrowInner:Ih,arrowIcon:Rh,arrowImg:kh,mirror:Eh,thumbsWrapper:Mh,thumbsContainerVertical:Ah,thumbsContainer:Fh,thumbsAlignStart:Nh,thumbsAlignCenter:_h,thumbsAlignEnd:Hh,thumbItem:Wh,closeButton:Oh,fadeIn:Dh,slideInLeft:zh,slideInRight:Bh,slideInTop:jh,slideInBottom:Vh,fadeOut:Gh,slideOutLeft:Xh,slideOutRight:qh,slideOutTop:Uh,slideOutBottom:Kh,scaleSlide:Yh},Fr=(e,t,n)=>{const i={},[o,r]=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"),r==="left"?(i.left="0",i.right="auto"):r==="center"?(i.left="50%",i.right="auto"):r==="right"&&(i.left="auto",i.right="0"),o==="middle"&&r==="center"?i.transform=`translate(calc(-50% + ${F.scalingValue(t.x,n)}), calc(-50% + ${F.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${F.scalingValue(t.x,n)}, calc(-50% + ${F.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${F.scalingValue(t.x,n)}), ${F.scalingValue(t.y,n)})`:i.transform=`translate(${F.scalingValue(t.x,n)}, ${F.scalingValue(t.y,n)})`,i};function Fu(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 Zh(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 Nu(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,r=n/i;if(r>o){const c=e;return{renderedW:c,renderedH:c/r}}const l=t;return{renderedW:l*r,renderedH:l}}function Jh(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,r=n/i;if(r>o){const c=t;return{renderedW:c*r,renderedH:c}}const l=e;return{renderedW:l,renderedH:l/r}}function _u(e,t,n,i,o){const{x:r,y:l}=Zh(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function Qh(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,r=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight,{objectFit:l,objectPosition:c}=window.getComputedStyle(e),d=l==="cover"?Jh:Nu,{renderedW:u,renderedH:p}=d(n,i,o,r),{offsetX:y,offsetY:v}=_u(n,i,u,p,c),m=(y+u/2)/n*100,g=(v+p/2)/i*100;return`${m}% ${g}%`}function ef(e){return Qh(e)}function fa(e){const t=e.getBoundingClientRect(),n=Fu(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),r=e.naturalWidth,l=e.naturalHeight,{renderedW:c,renderedH:d}=Nu(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:y}=_u(i,o,c,d,u),v=t.left+n.left,m=t.top+n.top;return{x:p+v,y:y+m,width:c,height:d}}function uc(e){const t=e.getBoundingClientRect(),n=Fu(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function tf(e,t){const n=(()=>{if(e==="fade in")return at.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return at.slideInLeft;case"right":return at.slideInRight;case"top":return at.slideInTop;case"bottom":return at.slideInBottom;default:return at.slideInRight}return at.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return at.fadeIn;if(e==="slide in")switch(t){case"left":return at.slideInLeft;case"right":return at.slideInRight;case"top":return at.slideInTop;case"bottom":return at.slideInBottom;default:return at.slideInRight}return at.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return at.fadeOut;if(e==="slide in")switch(t){case"left":return at.slideOutLeft;case"right":return at.slideOutRight;case"top":return at.slideOutTop;case"bottom":return at.slideOutBottom;default:return at.slideOutRight}return at.fadeOut})(),r=(()=>{if(e==="fade in")return at.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return at.slideOutLeft;case"right":return at.slideOutRight;case"top":return at.slideOutTop;case"bottom":return at.slideOutBottom;default:return at.slideOutRight}return at.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:r}}const nf=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:r,isPreviewMode:l})=>{const[c,d]=s.useState(!1),{url:u}=e.thumbnailBlock.cover;return s.useEffect(()=>{o==="close"&&d(!1),o==="open"&&d(!0)},[o]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:u,alt:"Cover",className:at.heroImage,onClick:()=>d(!0)}),a.jsx(of,{isOpen:c,onClose:()=>d(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},of=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:c})=>{var Ce;const{widthSettings:d,fontSettings:u,letterSpacing:p,textAlign:y,wordSpacing:v,fontSizeLineHeight:m,textAppearance:g,color:x}=i.imageCaption??{},[b,k]=s.useState(0),[f,S]=s.useState(0),[O,U]=s.useState(!1),[z,I]=s.useState(!1),[N,q]=s.useState({}),$=s.useRef(null),L=s.useRef(null),D=s.useRef(null),_=s.useRef(!1),C=s.useRef(null),T=s.useRef(null),B=s.useRef(null),w=s.useRef(null),X=s.useRef(!1),R=s.useRef(null),[E,V]=s.useState(!1),{appear:ie,triggers:re,slider:W,thumbnail:ae,controls:A,area:le,caption:ee,layout:xe}=o.lightboxBlock,{appearClass:Pe,backdropAppearClass:ye,backdropDisappearClass:pe,disappearClass:Y}=tf(ie.type,ie.direction),se=(c==null?void 0:c.itemId)??null;s.useEffect(()=>{const h=()=>{setTimeout(()=>{var Z,te;(te=(Z=$.current)==null?void 0:Z.splide)==null||te.refresh()},16)},K=()=>{S(Z=>Z+1)};return window.addEventListener("ArticleEditor.Layout:change",h),window.addEventListener("ArticleEditor.ComponentContent:change",K),()=>{window.removeEventListener("ArticleEditor.Layout:change",h),window.removeEventListener("ArticleEditor.ComponentContent:change",K)}},[]),s.useEffect(()=>{if(!e||!ae.isActive){V(!1);return}const h=R.current;if(!h)return;const K=()=>{W.direction==="horiz"?V(h.scrollWidth>h.clientWidth):V(h.scrollHeight>h.clientHeight)};K();const Z=new ResizeObserver(K);return Z.observe(h),()=>Z.disconnect()},[e,ae.isActive,n.length,N,W.direction]);const de=s.useCallback(()=>{const h=window.matchMedia("(max-width: 768px)").matches,K=F.getColorAlpha(le.color);h&&!l&&K>.9&&(document.body.style.backgroundColor=""),U(!0),_.current=!0;const Z=te=>{te.target===C.current&&te.animationName&&(C.current&&T.current&&C.current.removeEventListener("animationend",T.current),T.current=null,_.current&&(_.current=!1,t()),U(!1))};C.current&&(T.current=Z,C.current.addEventListener("animationend",Z))},[t,le.color,l]),ve=(h,K,Z)=>{var te,me;if(h){if(re.type==="click"&&re.switch==="image")re.repeat==="close"&&b===n.length-1?de():(te=$.current)==null||te.go("+1");else if(re.type==="click"&&re.switch==="50/50"){const j=h.getBoundingClientRect(),P=K-j.left,Q=Z-j.top,ne=j.width,ue=j.height;let G;W.direction==="horiz"?G=P<ne/2?"-1":"+1":G=Q<ue/2?"-1":"+1",(me=$.current)==null||me.go(G)}}},$e=h=>{if(X.current){X.current=!1;return}const K=n[b],Z=(K==null?void 0:K.image.objectFit)==="cover";let te,me;if("changedTouches"in h&&h.changedTouches.length>0)te=h.changedTouches[0].clientX,me=h.changedTouches[0].clientY;else if("clientX"in h)te=h.clientX,me=h.clientY;else return;let j;if(Z&&D.current){const P=uc(D.current);j=te>=P.left&&te<=P.right&&me>=P.top&&me<=P.bottom}else{const P=D.current?fa(D.current):null;if(!P){h.target===h.currentTarget&&de();return}j=te>=P.x&&te<=P.x+P.width&&me>=P.y&&me<=P.y+P.height}j?ve(D.current,te,me):de()},ke=h=>{const K=h.target;(K.classList.contains(at.thumbsWrapper)||K.classList.contains(at.thumbsContainer))&&$e(h)};s.useEffect(()=>{if(!e)return;const h=K=>{var Z,te;if(K.key==="Escape"){de();return}if(K.key==="ArrowRight"){k(me=>(me+1)%Math.max(n.length,1)),(Z=$.current)==null||Z.go("+1");return}K.key==="ArrowLeft"&&(k(me=>(me-1+Math.max(n.length,1))%Math.max(n.length,1)),(te=$.current)==null||te.go("-1"))};return window.addEventListener("keydown",h),()=>{window.removeEventListener("keydown",h)}},[e,de,n.length]),s.useEffect(()=>{if(e){if(k(0),S(K=>K+1),_.current=!1,U(!1),I(!1),q({}),!se)return;const h=new CustomEvent("page-overlay",{detail:{itemId:se}});window.dispatchEvent(h)}return()=>{C.current&&T.current&&(C.current.removeEventListener("animationend",T.current),T.current=null),I(!1)}},[e,se]),s.useEffect(()=>{L.current!==null&&L.current!==W.type&&S(h=>h+1),L.current=W.type},[W.type]),s.useEffect(()=>{if(!e)return;const h=document.body.style.overflow,K=window.matchMedia("(max-width: 768px)").matches,Z=F.getColorAlpha(le.color);document.body.style.overflow="hidden",I(!1);const te=j=>{j.target===C.current&&!_.current&&j.animationName&&(K&&!l&&Z>.9&&(document.body.style.backgroundColor=le.color),I(!0),C.current&&B.current&&C.current.removeEventListener("animationend",B.current),B.current=null)};C.current&&(B.current=te,C.current.addEventListener("animationend",te));const me=j=>{const P=j.target;P&&(P.closest(`.${at.thumbsWrapper}`)||P.closest(`.${at.thumbsContainer}`))||W.type!=="slide"&&j.preventDefault()};return document.addEventListener("touchmove",me,{passive:!1}),()=>{document.body.style.overflow=h,document.removeEventListener("touchmove",me),C.current&&B.current&&(C.current.removeEventListener("animationend",B.current),B.current=null),I(!1)}},[e,l,le.color,W.type]),s.useEffect(()=>{if(!e)return;const h=K=>{var te,me;if(_.current){K.stopPropagation();return}if(X.current){X.current=!1;return}const Z=K.target;if(!(Z&&(Z.closest(`.${at.thumbsContainer}`)||Z.closest(`.${at.thumbItem}`)||Z.closest(`.${at.arrow}`)||Z.closest(`.${at.closeButton}`)||Z.closest(`.${at.caption}`)))){if(W.type==="slide"&&re.type==="drag"&&((me=(te=$.current)==null?void 0:te.splide)!=null&&me.root)){const j=$.current.splide.root;if(Z&&(j.contains(Z)||j===Z))return}if(K.touches.length===0&&K.changedTouches.length>0){const j=n[b],P=(j==null?void 0:j.image.objectFit)==="cover",Q=K.changedTouches[0];let ne;if(P&&D.current){const ue=uc(D.current);ne=Q.clientX>=ue.left&&Q.clientX<=ue.right&&Q.clientY>=ue.top&&Q.clientY<=ue.bottom}else{const ue=D.current?fa(D.current):null;if(!ue)return;ne=Q.clientX>=ue.x&&Q.clientX<=ue.x+ue.width&&Q.clientY>=ue.y&&Q.clientY<=ue.y+ue.height}if(!ne){K.stopPropagation(),_.current=!0;const ue=G=>{G.stopPropagation(),G.preventDefault(),document.removeEventListener("click",ue,!0)};document.addEventListener("click",ue,!0),de()}}}};return document.addEventListener("touchend",h,{passive:!0}),()=>{document.removeEventListener("touchend",h)}},[e,de,b,n]);const he=(W.type==="scale"||W.type==="fade")&&W.direction==="vert"&&re.type==="drag";s.useEffect(()=>{var G,Ie;if(!e||!he||!((Ie=(G=$.current)==null?void 0:G.splide)!=null&&Ie.root))return;const h=$.current.splide.root,K=30,Z=(be,J)=>{if(w.current){const He=Math.abs(be-w.current.x),We=Math.abs(J-w.current.y);(He>0||We>0)&&(X.current=!0)}},te=be=>{w.current&&(be.preventDefault(),Z(be.clientX,be.clientY))},me=be=>{w.current&&be.touches.length>0&&(be.preventDefault(),Z(be.touches[0].clientX,be.touches[0].clientY))},j=(be,J)=>{if(!w.current||!$.current){w.current=null;return}const He=Math.abs(be-w.current.x),We=Math.abs(J-w.current.y);We>K&&We>He&&$.current.go(J<w.current.y?"+1":"-1"),w.current=null},P=be=>{w.current&&j(be.clientX,be.clientY),document.removeEventListener("pointerup",P),document.removeEventListener("pointercancel",P),document.removeEventListener("pointermove",te)},Q=be=>{if(w.current){if(be.changedTouches.length>0){const J=be.changedTouches[0];j(J.clientX,J.clientY)}document.removeEventListener("touchend",Q),document.removeEventListener("touchcancel",Q),document.removeEventListener("touchmove",me)}},ne=be=>{w.current={x:be.clientX,y:be.clientY},X.current=!1,document.addEventListener("pointermove",te,{passive:!1}),document.addEventListener("pointerup",P),document.addEventListener("pointercancel",P)},ue=be=>{be.touches.length>0&&(w.current={x:be.touches[0].clientX,y:be.touches[0].clientY},X.current=!1,document.addEventListener("touchmove",me,{passive:!1}),document.addEventListener("touchend",Q),document.addEventListener("touchcancel",Q))};return h.addEventListener("pointerdown",ne),h.addEventListener("touchstart",ue),()=>{h.removeEventListener("pointerdown",ne),h.removeEventListener("touchstart",ue),document.removeEventListener("pointermove",te),document.removeEventListener("pointerup",P),document.removeEventListener("pointercancel",P),document.removeEventListener("touchmove",me),document.removeEventListener("touchend",Q),document.removeEventListener("touchcancel",Q),w.current=null,X.current=!1}},[e,he,f]);const Se={backgroundColor:le.color,backdropFilter:`blur(${le.blur}px)`,animationDuration:`${parseInt(ie.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(r)?null:Gn.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:l?null:C,className:Ct(at.background,O?pe:ye,{[at.editor]:l},{[at.hidden]:!e}),style:{...Se,...z&&!l&&!O?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?C:null,className:Ct(at.contentStyle,O?Y:Pe,{[at.editor]:l},{[at.hidden]:!e}),style:{animationDuration:`${parseInt(ie.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(Ll,{onMove:h=>k(h.index),ref:$,className:at.lightboxSplide,options:{arrows:!1,speed:W.duration?parseInt(W.duration):500,direction:W.direction==="horiz"||W.type==="fade"||W.type==="scale"?"ltr":"ttb",pagination:!1,drag:re.type==="drag"&&!he,perPage:1,width:"100%",height:"100%",type:W.type==="fade"||W.type==="scale"?"fade":"loop",padding:0,rewind:re.repeat!=="close",start:0},style:{"--splide-speed":W.duration},children:n.map((h,K)=>{const Z=Fr(xe.position,xe.offset,l),te=`${F.scalingValue(xe.padding.top,l)} ${F.scalingValue(xe.padding.right,l)} ${F.scalingValue(xe.padding.bottom,l)} ${F.scalingValue(xe.padding.left,l)}`,me=W.type==="scale"?(()=>{const{transform:j,...P}=Z;return{...P,position:"absolute",padding:te,boxSizing:"border-box","--position-transform":j||"none"}})():{...Z,position:"absolute",padding:te,boxSizing:"border-box"};return a.jsx(Pl,{children:a.jsx("div",{className:at.imgWrapper,onClick:$e,children:a.jsx("img",{ref:K===b?D:null,className:Ct(at.imageStyle,{[at.contain]:h.image.objectFit==="contain",[at.cover]:h.image.objectFit==="cover",[at.scaleSlide]:W.type==="scale"}),src:h.image.url,alt:h.image.name??"",style:{...me,pointerEvents:h.image.objectFit==="contain"?"none":"auto"}})})},K)})},f),A.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ct(at.arrow,{[at.arrowVertical]:W.direction==="vert"}),style:{color:A.color,"--arrow-hover-color":A.hover},children:a.jsxs("button",{className:at.arrowInner,style:{transform:`translate(${F.scalingValue(A.offset.x,l)}, ${F.scalingValue(A.offset.y*(W.direction==="horiz"?1:-1),l)}) scale(${A.scale}) rotate(${W.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var h;return(h=$.current)==null?void 0:h.go("-1")},"aria-label":"Previous",children:[A.arrowsImgUrl&&a.jsx(mn,{url:A.arrowsImgUrl,fill:A.color,hoverFill:A.hover,className:Ct(at.arrowImg,at.mirror)}),!A.arrowsImgUrl&&a.jsx(pc,{color:A.color,className:Ct(at.arrowIcon,at.arrowImg,at.mirror)})]})}),a.jsx("div",{className:Ct(at.arrow,at.nextArrow,{[at.arrowVertical]:W.direction==="vert"}),style:{color:A.color,"--arrow-hover-color":A.hover},children:a.jsxs("button",{className:at.arrowInner,style:{transform:`translate(${F.scalingValue(A.offset.x*(W.direction==="horiz"?-1:1),l)}, ${F.scalingValue(A.offset.y,l)}) scale(${A.scale}) rotate(${W.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var h;return(h=$.current)==null?void 0:h.go("+1")},"aria-label":"Next",children:[A.arrowsImgUrl&&a.jsx(mn,{url:A.arrowsImgUrl,fill:A.color,hoverFill:A.hover,className:at.arrowImg}),!A.arrowsImgUrl&&a.jsx(pc,{color:A.color,className:Ct(at.arrowIcon,at.arrowImg)})]})})]}),le.closeIconUrl&&(()=>{const h=Fr(le.closeIconAlign,le.closeIconOffset,l),K=`scale(${le.closeIconScale})`,Z=h.transform?`${h.transform} ${K}`:K;return a.jsx("button",{className:at.closeButton,style:{...h,transform:Z},onClick:de,"aria-label":"Close lightbox",children:a.jsx(mn,{url:le.closeIconUrl,fill:le.closeIconColor??"#000000",hoverFill:le.closeIconHover??"#cccccc"})})})(),ee&&ee.isActive&&i.imageCaption&&((Ce=n[b])==null?void 0:Ce.imageCaption)&&a.jsx("div",{className:at.caption,style:{...Fr(ee.alignment,ee.offset,l),fontFamily:Do(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:d.sizing==="auto"?"max-content":F.scalingValue(d.width,l),letterSpacing:F.scalingValue(p,l),wordSpacing:F.scalingValue(v,l),textAlign:y,fontSize:F.scalingValue(m.fontSize,l),lineHeight:F.scalingValue(m.lineHeight,l),textTransform:g.textTransform??"none",textDecoration:g.textDecoration??"none",fontVariant:g.fontVariant??"normal",color:x},onClick:h=>h.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:at.captionTextInner,style:{"--link-color":ee.linkColor,"--link-hover-color":ee.linkHoverColor},children:a.jsx(Ki,{content:n[b].imageCaption})})}),ae.isActive&&(()=>{const[h,K]=ae.position.split("-"),Z=W.direction==="horiz"?`${h}-left`:ae.position,te=Fr(Z,ae.offset,l),me=()=>{if(W.direction==="horiz"){if(K==="left")return"flex-start";if(K==="center")return"center";if(K==="right")return"flex-end"}else{if(h==="top")return"flex-start";if(h==="middle")return"center";if(h==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:R,className:at.thumbsWrapper,onClick:j=>ke(j),style:{position:l?"absolute":"fixed",...te,...W.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:Ct(at.thumbsContainer,{[at.thumbsContainerVertical]:W.direction==="vert",[at.thumbsAlignStart]:ae.align==="start",[at.thumbsAlignCenter]:ae.align==="center",[at.thumbsAlignEnd]:ae.align==="end"}),style:{gap:F.scalingValue(ae.grid.gap,l),justifyContent:E?"flex-start":me()},children:n.map((j,P)=>{const Q=P===b,ne=N[P],G=ae.grid.size*(Q?ae.activeState.scale:1),Ie=()=>{if(ae.fit!=="fit")return{};if(!ne)return W.direction==="horiz"?{height:F.scalingValue(G,l)}:{width:F.scalingValue(G,l)};const be=ne.width/ne.height;if(W.direction==="horiz"){const J=G,He=J*be;return{width:F.scalingValue(He,l),height:F.scalingValue(J,l)}}else{const J=G,He=J/be;return{width:F.scalingValue(J,l),height:F.scalingValue(He,l)}}};return a.jsx("button",{className:at.thumbItem,style:{...W.direction==="horiz"&&ae.fit!=="fit"?{height:F.scalingValue(G,l)}:{},...W.direction==="vert"&&ae.fit!=="fit"?{width:F.scalingValue(G,l)}:{},...ae.fit==="cover"?{width:F.scalingValue(G,l),height:F.scalingValue(G,l)}:{},...Ie(),transition:Q?"all 0.25s ease-out":"none",opacity:Q?ae.activeState.opacity/100:ae.opacity/100,"--thumb-hover":ae.activeState.opacity/100},onClick:be=>{var J;be.stopPropagation(),k(P),(J=$.current)==null||J.go(P)},onMouseEnter:()=>{var be;ae.triggers==="hov"&&((be=$.current)==null||be.go(P))},children:a.jsx("img",{src:j.image.url,alt:j.image.name??"",onLoad:be=>{const J=be.currentTarget;J.naturalWidth&&J.naturalHeight&&q(He=>({...He,[P]:{width:J.naturalWidth,height:J.naturalHeight}}))},style:{objectFit:ae.fit==="cover"?"cover":"contain",...ae.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...ae.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${j.image.name}-${P}`)})})})})()]})]}),document.getElementById(r))};function pc({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const rf={element:nf,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 Nr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function af(e){return`
|
|
6
|
+
*/const Kg="RichTextRenderer-module__link___BWeZ2",Yg={link:Kg},Zg=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))},Do=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Zg(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function dn(e){const{color:t,...n}=e;return n}function Qt(e,t){var o,r,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:Do(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:F.scalingValue(e.letterSpacing,t),wordSpacing:F.scalingValue(e.wordSpacing,t),fontSize:F.scalingValue(n,t),lineHeight:i!==void 0?F.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(r=e.textAppearance)==null?void 0:r.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}function Au(e){return e!=null&&e.length?e.some(t=>t.type==="link"?Au(t.children):!!t.text):!1}const Ki=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:Yg.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:Jg(i),children:i.text},o));return a.jsx(a.Fragment,{children:e.map((n,i)=>{const o=n.children;return a.jsx("div",{children:Au(o)?t(o):" "},i)})})};function Jg(e){return{...e.fontFamily&&{fontFamily:Do(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 Qg="SvgImage-module__svg___q3xE-",eh="SvgImage-module__img___VsTm-",lc={svg:Qg,img:eh},th=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},nh=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,mn=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[r,l]=s.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return s.useEffect(()=>{if(typeof window<"u"&&window.CSS){const c=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');l(c)}},[]),!th(e)||!r?a.jsx("img",{src:e,alt:"",className:Ct(lc.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:Ct(lc.svg,i),style:{"--svg":nh(e),"--fill":t,"--hover-fill":n,...o??{}}})},ih={"top-left":$t.topLeftAlignment,"top-center":$t.topCenterAlignment,"top-right":$t.topRightAlignment,"middle-left":$t.middleLeftAlignment,"middle-center":$t.middleCenterAlignment,"middle-right":$t.middleRightAlignment,"bottom-left":$t.bottomLeftAlignment,"bottom-center":$t.bottomCenterAlignment,"bottom-right":$t.bottomRightAlignment};function oh({settings:e,content:t,styles:n,isEditor:i}){const[o,r]=s.useState(null),{widthSettings:l,fontSettings:c,letterSpacing:d,textAlign:u,wordSpacing:p,fontSizeLineHeight:y,textAppearance:v,color:m}=n.imageCaption??{},[g,x]=s.useState(void 0),[b,k]=s.useState(null),[f,S]=s.useState(0),[W,U]=s.useState(0),{direction:B,transition:P,controls:_,pagination:G,imageCaption:$,triggers:L}=e,D=s.useRef(P.type),{x:E,y:T}=e.controls.offset,C=V=>{o&&o.go(V)};return s.useEffect(()=>{if(!b)return;const V=new ResizeObserver(w=>{if(!o)return;const[q]=w;x({width:Math.round(q.contentRect.width),height:Math.round(q.contentRect.height)})});return V.observe(b),()=>V.unobserve(b)},[b]),s.useEffect(()=>{!o||D.current===P.type||(U(V=>V+1),D.current=P.type)},[P.type]),a.jsx("div",{className:Ct($t.wrapper,{[$t.editor]:i}),ref:k,children:a.jsxs("div",{className:$t.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:P.backgroundColor&&P.type==="fade in"?P.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:Ct($t.captionBlock),children:a.jsx("div",{className:$t.captionTextWrapper,children:t.map((V,w)=>a.jsx("div",{className:Ct($t.captionText,ih[$.alignment],{[$t.withPointerEvents]:w===f&&i,[$t.active]:w===f}),style:{fontFamily:Do(c.fontFamily),fontWeight:c.fontWeight,fontStyle:c.fontStyle,width:l.sizing==="auto"?"max-content":F.scalingValue(l.width,i),letterSpacing:F.scalingValue(d,i),wordSpacing:F.scalingValue(p,i),textAlign:u,fontSize:F.scalingValue(y.fontSize,i),lineHeight:F.scalingValue(y.lineHeight,i),textTransform:v.textTransform??"none",textDecoration:v.textDecoration??"none",fontVariant:v.fontVariant??"normal",color:m,transitionDuration:P.duration?`${Math.round(parseInt(P.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:$t.captionTextInner,style:{"--link-hover-color":$.linkHoverColor,"--link-color":$.linkColor,position:"relative",top:F.scalingValue($.offset.y,i),left:F.scalingValue($.offset.x,i)},children:a.jsx(Ki,{content:V.imageCaption})})},w))})}),a.jsx(Ll,{onMove:V=>{S(V.index)},ref:r,options:{arrows:!1,speed:P.duration?parseInt(P.duration):500,autoplay:L.autoPlay!==null,...L.autoPlay!==null&&{interval:parseInt(L.autoPlay)*1e3},direction:B==="horiz"||P.type==="fade in"?"ltr":"ttb",pagination:!1,drag:L.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:P.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((V,w)=>a.jsx(Pl,{children:a.jsx("div",{className:$t.sliderItem,children:a.jsx("div",{className:$t.imgWrapper,children:a.jsx("img",{className:Ct($t.sliderImage,{[$t.contain]:V.image.objectFit==="contain",[$t.cover]:V.image.objectFit==="cover"}),src:V.image.url,alt:V.image.name??""})})})},w))},W),_.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ct($t.arrow,{[$t.arrowVertical]:B==="vert",[$t.hoverArrow]:_.show==="on hover"}),style:{color:_.color,"--arrow-hover-color":_.hover},children:a.jsxs("button",{onClick:()=>{C("-1")},className:$t.arrowInner,style:{transform:`translate(${F.scalingValue(E,i)}, ${F.scalingValue(T*(B==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[_.arrowsImgUrl&&a.jsx(mn,{url:_.arrowsImgUrl,fill:_.color,hoverFill:_.hover,className:Ct($t.arrowImg,$t.mirror)}),!_.arrowsImgUrl&&a.jsx(cc,{color:_.color,className:Ct($t.arrowIcon,$t.arrowImg,$t.mirror)})]})}),a.jsx("div",{className:Ct($t.arrow,$t.nextArrow,{[$t.arrowVertical]:B==="vert",[$t.hoverArrow]:_.show==="on hover"}),style:{color:_.color,"--arrow-hover-color":_.hover},children:a.jsxs("button",{className:$t.arrowInner,onClick:()=>C("+1"),style:{transform:`translate(${F.scalingValue(E*(B==="horiz"?-1:1),i)}, ${F.scalingValue(T,i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[_.arrowsImgUrl&&a.jsx(mn,{url:_.arrowsImgUrl,fill:_.color,hoverFill:_.hover,className:$t.arrowImg}),!_.arrowsImgUrl&&a.jsx(cc,{color:_.color,className:Ct($t.arrowIcon,$t.arrowImg)})]})})]}),L.triggersList.click&&a.jsx("div",{className:$t.clickOverlay,onClick:()=>{o&&o.go("+1")}}),G.isActive&&a.jsx("div",{className:Ct($t.pagination,{[$t.paginationInsideBottom]:G.position==="inside-1"&&B==="horiz",[$t.paginationInsideTop]:G.position==="inside-2"&&B==="horiz",[$t.paginationOutsideBottom]:G.position==="outside-1"&&B==="horiz",[$t.paginationOutsideTop]:G.position==="outside-2"&&B==="horiz",[$t.paginationInsideLeft]:G.position==="inside-1"&&B==="vert",[$t.paginationInsideRight]:G.position==="inside-2"&&B==="vert",[$t.paginationOutsideLeft]:G.position==="outside-1"&&B==="vert",[$t.paginationOutsideRight]:G.position==="outside-2"&&B==="vert",[$t.paginationVertical]:B==="vert"}),children:a.jsx("div",{className:$t.paginationInner,style:{backgroundColor:G.colors[2],transform:`scale(${G.scale/100}) translate(${F.scalingValue(G.offset.x,i)}, ${F.scalingValue(G.offset.y,i)}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:t.map((V,w)=>a.jsx("button",{onClick:()=>{o&&o.go(w)},className:Ct($t.paginationItem),children:a.jsx("div",{className:Ct($t.dot,{[$t.activeDot]:w===f}),style:{backgroundColor:w===f?G.colors[0]:G.colors[1],"--pagination-hover-color":G.hover}})},w))})})]})})}function cc({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const rh={element:oh,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"]}},ah="ImageRevealSlider-module__imageRevealSlider___UE5Ob",sh="ImageRevealSlider-module__image___Qjt-e",lh="ImageRevealSlider-module__link___N-iLG",ch="ImageRevealSlider-module__cursor___2U03d",no={imageRevealSlider:ah,image:sh,link:lh,cursor:ch};function dc(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const r=i.width?Number.parseFloat(i.width):o.naturalWidth,l=o.naturalHeight/o.naturalWidth*r,c=r/2,d=l/2;if(e>=i.x-c&&e<=i.x+c&&t>=i.y-d&&t<=i.y+d)return!0}return!1}function Ka(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function dh(e,t,n,i){let o,r;if(t==="custom"){o=n;const l=await Ka(e);r=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await Ka(e);r=l.height/l.width*o}else{const l=await Ka(e);o=l.width,r=l.height}return{width:o,height:r,finalWidth:`${o}px`}}function uh({settings:e,content:t,isEditor:n}){const[i,o]=s.useState(null),[r,l]=s.useState([]),[c,d]=s.useState(0),u=s.useRef(0),[p,y]=s.useState({x:0,y:0}),[v,m]=s.useState(1),[g,x]=s.useState("none"),b=s.useRef({x:0,y:0}),[k,f]=s.useState(!1),{sizeType:S,imageWidth:W,randomRangeImageWidth:U}=e.imageSize,{revealPosition:B,visible:P}=e.position,{cursorType:_,target:G,defaultCursorScale:$,defaultCursor:L,hoverCursorScale:D,hoverCursor:E}=e.cursor;s.useEffect(()=>{if(!i)return;const V=(I,A)=>{const j=i.getBoundingClientRect(),ie=I-j.left,ae=A-j.top;if(y({x:ie,y:ae}),_==="system"){x("none"),m(1);return}const O=ie,oe=ae,N=document.elementFromPoint(j.left+O,j.top+oe);if(N&&N.closest("a")){x("none"),m(1);return}const le=dc(O,oe,r)||G==="area"?{img:E??"none",scale:D}:{img:L??"none",scale:$};x(le.img),m(le.scale)},w=I=>{I.stopPropagation(),b.current={x:I.clientX,y:I.clientY},V(I.clientX,I.clientY)},q=()=>{k&&V(b.current.x,b.current.y)};return i.addEventListener("mousemove",w),window.addEventListener("scroll",q,!0),()=>{i.removeEventListener("mousemove",w),window.removeEventListener("scroll",q,!0)}},[i,k,p,_,G,E,L,D,$,r]),s.useEffect(()=>{k||(x("none"),m(0))},[k]);const T=async(V,w,q,I={})=>{const{width:A,height:j,finalWidth:ie}=await dh(V.image.url,S,W,U);let ae=0,O=0;B==="same"?(ae=w/2,O=q/2):(ae=I.x??Math.random()*w,O=I.y??Math.random()*q);const oe=Math.min(Math.max(ae,A/2),w-A/2),N=Math.min(Math.max(O,j/2),q-j/2);return{id:u.current++,url:V.image.url,link:V.link,name:V.image.name,x:oe,y:N,width:ie}};s.useEffect(()=>{if(!i||t.length===0)return;const V=i.getBoundingClientRect(),w=V.width,q=V.height,I=[];(async()=>{const j=t[0],ie=await T(j,w,q);I.push(ie),l(I),d(1)})()},[S,W,U,B,i]),s.useEffect(()=>{P==="last One"&&l(V=>V.length>0?[V[V.length-1]]:[])},[P]);const C=async V=>{if(!i)return;const w=i.getBoundingClientRect(),q=V.clientX-w.left,I=V.clientY-w.top;if(G==="image"&&!dc(q,I,r))return;let A=0,j=0;B==="on Click"?(A=q,j=I):B==="same"?(A=w.width/2,j=w.height/2):(A=Math.random()*w.width,j=Math.random()*w.height);const ie=t[c],ae=await T(ie,w.width,w.height,{x:A,y:j});l(O=>P==="all"?[...O,ae]:[ae]),d(O=>O>=t.length-1?0:O+1)};return a.jsxs("div",{ref:o,onClick:C,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),className:no.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[r.map(V=>a.jsx("div",{className:no.wrapper,style:{top:`${V.y}px`,left:`${V.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:V.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:G==="area"&&V.link?a.jsx("a",{href:V.link,target:"_blank",className:no.link,children:a.jsx("img",{src:V.url,alt:V.name,className:no.image},V.id)}):a.jsx("img",{src:V.url,alt:V.name,className:no.image},V.id)},V.id)),k&&a.jsx("div",{className:no.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${v})`,backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const ph={element:uh,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:""}]}}}},mh="LightBox-module__hidden___9s-9x",gh="LightBox-module__heroImage___sTxNF",hh="LightBox-module__background___rm9ml",fh="LightBox-module__editor___4ACaY",yh="LightBox-module__contentStyle___Bgnsq",vh="LightBox-module__imageStyle___tLIlB",xh="LightBox-module__imgWrapper___LuFUp",bh="LightBox-module__contain___8-yaS",Sh="LightBox-module__cover___hNvOG",wh="LightBox-module__caption___b6L2I",$h="LightBox-module__captionTextInner___rCGNH",Ch="LightBox-module__lightboxSplide___XFuWC",Th="LightBox-module__arrow___iz38X",Lh="LightBox-module__arrowVertical___Zfz81",Ph="LightBox-module__nextArrow___zkAQN",Ih="LightBox-module__arrowInner___p48sW",Rh="LightBox-module__arrowIcon___3VaFf",kh="LightBox-module__arrowImg___pNV88",Eh="LightBox-module__mirror___pjeXc",Mh="LightBox-module__thumbsWrapper___GB-nU",Ah="LightBox-module__thumbsContainerVertical___wttk5",Fh="LightBox-module__thumbsContainer___osSma",Nh="LightBox-module__thumbsAlignStart___MO6tY",_h="LightBox-module__thumbsAlignCenter___Q4sUx",Hh="LightBox-module__thumbsAlignEnd___p4y9R",Wh="LightBox-module__thumbItem___HvnF3",Oh="LightBox-module__closeButton___g2khP",Dh="LightBox-module__fadeIn___0m5GW",zh="LightBox-module__slideInLeft___gPYwC",Bh="LightBox-module__slideInRight___S-pPp",jh="LightBox-module__slideInTop___DFdAj",Vh="LightBox-module__slideInBottom___m27kZ",Gh="LightBox-module__fadeOut___55qBR",Xh="LightBox-module__slideOutLeft___NvU7P",qh="LightBox-module__slideOutRight___SK7eC",Uh="LightBox-module__slideOutTop___Vgg0z",Kh="LightBox-module__slideOutBottom___nJ0Ef",Yh="LightBox-module__scaleSlide___vZriG",at={hidden:mh,heroImage:gh,background:hh,editor:fh,contentStyle:yh,imageStyle:vh,imgWrapper:xh,contain:bh,cover:Sh,caption:wh,captionTextInner:$h,lightboxSplide:Ch,arrow:Th,arrowVertical:Lh,nextArrow:Ph,arrowInner:Ih,arrowIcon:Rh,arrowImg:kh,mirror:Eh,thumbsWrapper:Mh,thumbsContainerVertical:Ah,thumbsContainer:Fh,thumbsAlignStart:Nh,thumbsAlignCenter:_h,thumbsAlignEnd:Hh,thumbItem:Wh,closeButton:Oh,fadeIn:Dh,slideInLeft:zh,slideInRight:Bh,slideInTop:jh,slideInBottom:Vh,fadeOut:Gh,slideOutLeft:Xh,slideOutRight:qh,slideOutTop:Uh,slideOutBottom:Kh,scaleSlide:Yh},Fr=(e,t,n)=>{const i={},[o,r]=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"),r==="left"?(i.left="0",i.right="auto"):r==="center"?(i.left="50%",i.right="auto"):r==="right"&&(i.left="auto",i.right="0"),o==="middle"&&r==="center"?i.transform=`translate(calc(-50% + ${F.scalingValue(t.x,n)}), calc(-50% + ${F.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${F.scalingValue(t.x,n)}, calc(-50% + ${F.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${F.scalingValue(t.x,n)}), ${F.scalingValue(t.y,n)})`:i.transform=`translate(${F.scalingValue(t.x,n)}, ${F.scalingValue(t.y,n)})`,i};function Fu(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 Zh(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 Nu(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,r=n/i;if(r>o){const c=e;return{renderedW:c,renderedH:c/r}}const l=t;return{renderedW:l*r,renderedH:l}}function Jh(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,r=n/i;if(r>o){const c=t;return{renderedW:c*r,renderedH:c}}const l=e;return{renderedW:l,renderedH:l/r}}function _u(e,t,n,i,o){const{x:r,y:l}=Zh(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function Qh(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,r=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight,{objectFit:l,objectPosition:c}=window.getComputedStyle(e),d=l==="cover"?Jh:Nu,{renderedW:u,renderedH:p}=d(n,i,o,r),{offsetX:y,offsetY:v}=_u(n,i,u,p,c),m=(y+u/2)/n*100,g=(v+p/2)/i*100;return`${m}% ${g}%`}function ef(e){return Qh(e)}function ya(e){const t=e.getBoundingClientRect(),n=Fu(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),r=e.naturalWidth,l=e.naturalHeight,{renderedW:c,renderedH:d}=Nu(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:y}=_u(i,o,c,d,u),v=t.left+n.left,m=t.top+n.top;return{x:p+v,y:y+m,width:c,height:d}}function uc(e){const t=e.getBoundingClientRect(),n=Fu(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function tf(e,t){const n=(()=>{if(e==="fade in")return at.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return at.slideInLeft;case"right":return at.slideInRight;case"top":return at.slideInTop;case"bottom":return at.slideInBottom;default:return at.slideInRight}return at.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return at.fadeIn;if(e==="slide in")switch(t){case"left":return at.slideInLeft;case"right":return at.slideInRight;case"top":return at.slideInTop;case"bottom":return at.slideInBottom;default:return at.slideInRight}return at.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return at.fadeOut;if(e==="slide in")switch(t){case"left":return at.slideOutLeft;case"right":return at.slideOutRight;case"top":return at.slideOutTop;case"bottom":return at.slideOutBottom;default:return at.slideOutRight}return at.fadeOut})(),r=(()=>{if(e==="fade in")return at.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return at.slideOutLeft;case"right":return at.slideOutRight;case"top":return at.slideOutTop;case"bottom":return at.slideOutBottom;default:return at.slideOutRight}return at.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:r}}const nf=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:r,isPreviewMode:l})=>{const[c,d]=s.useState(!1),{url:u}=e.thumbnailBlock.cover;return s.useEffect(()=>{o==="close"&&d(!1),o==="open"&&d(!0)},[o]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:u,alt:"Cover",className:at.heroImage,onClick:()=>d(!0)}),a.jsx(of,{isOpen:c,onClose:()=>d(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},of=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:c})=>{var Ce;const{widthSettings:d,fontSettings:u,letterSpacing:p,textAlign:y,wordSpacing:v,fontSizeLineHeight:m,textAppearance:g,color:x}=i.imageCaption??{},[b,k]=s.useState(0),[f,S]=s.useState(0),[W,U]=s.useState(!1),[B,P]=s.useState(!1),[_,G]=s.useState({}),$=s.useRef(null),L=s.useRef(null),D=s.useRef(null),E=s.useRef(!1),T=s.useRef(null),C=s.useRef(null),V=s.useRef(null),w=s.useRef(null),q=s.useRef(!1),I=s.useRef(null),[A,j]=s.useState(!1),{appear:ie,triggers:ae,slider:O,thumbnail:oe,controls:N,area:le,caption:Q,layout:be}=o.lightboxBlock,{appearClass:Pe,backdropAppearClass:ye,backdropDisappearClass:ce,disappearClass:Y}=tf(ie.type,ie.direction),se=(c==null?void 0:c.itemId)??null;s.useEffect(()=>{const h=()=>{setTimeout(()=>{var Z,ne;(ne=(Z=$.current)==null?void 0:Z.splide)==null||ne.refresh()},16)},K=()=>{S(Z=>Z+1)};return window.addEventListener("ArticleEditor.Layout:change",h),window.addEventListener("ArticleEditor.ComponentContent:change",K),()=>{window.removeEventListener("ArticleEditor.Layout:change",h),window.removeEventListener("ArticleEditor.ComponentContent:change",K)}},[]),s.useEffect(()=>{if(!e||!oe.isActive){j(!1);return}const h=I.current;if(!h)return;const K=()=>{O.direction==="horiz"?j(h.scrollWidth>h.clientWidth):j(h.scrollHeight>h.clientHeight)};K();const Z=new ResizeObserver(K);return Z.observe(h),()=>Z.disconnect()},[e,oe.isActive,n.length,_,O.direction]);const pe=s.useCallback(()=>{const h=window.matchMedia("(max-width: 768px)").matches,K=F.getColorAlpha(le.color);h&&!l&&K>.9&&(document.body.style.backgroundColor=""),U(!0),E.current=!0;const Z=ne=>{ne.target===T.current&&ne.animationName&&(T.current&&C.current&&T.current.removeEventListener("animationend",C.current),C.current=null,E.current&&(E.current=!1,t()),U(!1))};T.current&&(C.current=Z,T.current.addEventListener("animationend",Z))},[t,le.color,l]),fe=(h,K,Z)=>{var ne,de;if(h){if(ae.type==="click"&&ae.switch==="image")ae.repeat==="close"&&b===n.length-1?pe():(ne=$.current)==null||ne.go("+1");else if(ae.type==="click"&&ae.switch==="50/50"){const z=h.getBoundingClientRect(),R=K-z.left,ee=Z-z.top,te=z.width,me=z.height;let X;O.direction==="horiz"?X=R<te/2?"-1":"+1":X=ee<me/2?"-1":"+1",(de=$.current)==null||de.go(X)}}},we=h=>{if(q.current){q.current=!1;return}const K=n[b],Z=(K==null?void 0:K.image.objectFit)==="cover";let ne,de;if("changedTouches"in h&&h.changedTouches.length>0)ne=h.changedTouches[0].clientX,de=h.changedTouches[0].clientY;else if("clientX"in h)ne=h.clientX,de=h.clientY;else return;let z;if(Z&&D.current){const R=uc(D.current);z=ne>=R.left&&ne<=R.right&&de>=R.top&&de<=R.bottom}else{const R=D.current?ya(D.current):null;if(!R){h.target===h.currentTarget&&pe();return}z=ne>=R.x&&ne<=R.x+R.width&&de>=R.y&&de<=R.y+R.height}z?fe(D.current,ne,de):pe()},Re=h=>{const K=h.target;(K.classList.contains(at.thumbsWrapper)||K.classList.contains(at.thumbsContainer))&&we(h)};s.useEffect(()=>{if(!e)return;const h=K=>{var Z,ne;if(K.key==="Escape"){pe();return}if(K.key==="ArrowRight"){k(de=>(de+1)%Math.max(n.length,1)),(Z=$.current)==null||Z.go("+1");return}K.key==="ArrowLeft"&&(k(de=>(de-1+Math.max(n.length,1))%Math.max(n.length,1)),(ne=$.current)==null||ne.go("-1"))};return window.addEventListener("keydown",h),()=>{window.removeEventListener("keydown",h)}},[e,pe,n.length]),s.useEffect(()=>{if(e){if(k(0),S(K=>K+1),E.current=!1,U(!1),P(!1),G({}),!se)return;const h=new CustomEvent("page-overlay",{detail:{itemId:se}});window.dispatchEvent(h)}return()=>{T.current&&C.current&&(T.current.removeEventListener("animationend",C.current),C.current=null),P(!1)}},[e,se]),s.useEffect(()=>{L.current!==null&&L.current!==O.type&&S(h=>h+1),L.current=O.type},[O.type]),s.useEffect(()=>{if(!e)return;const h=document.body.style.overflow,K=window.matchMedia("(max-width: 768px)").matches,Z=F.getColorAlpha(le.color);document.body.style.overflow="hidden",P(!1);const ne=z=>{z.target===T.current&&!E.current&&z.animationName&&(K&&!l&&Z>.9&&(document.body.style.backgroundColor=le.color),P(!0),T.current&&V.current&&T.current.removeEventListener("animationend",V.current),V.current=null)};T.current&&(V.current=ne,T.current.addEventListener("animationend",ne));const de=z=>{const R=z.target;R&&(R.closest(`.${at.thumbsWrapper}`)||R.closest(`.${at.thumbsContainer}`))||O.type!=="slide"&&z.preventDefault()};return document.addEventListener("touchmove",de,{passive:!1}),()=>{document.body.style.overflow=h,document.removeEventListener("touchmove",de),T.current&&V.current&&(T.current.removeEventListener("animationend",V.current),V.current=null),P(!1)}},[e,l,le.color,O.type]),s.useEffect(()=>{if(!e)return;const h=K=>{var ne,de;if(E.current){K.stopPropagation();return}if(q.current){q.current=!1;return}const Z=K.target;if(!(Z&&(Z.closest(`.${at.thumbsContainer}`)||Z.closest(`.${at.thumbItem}`)||Z.closest(`.${at.arrow}`)||Z.closest(`.${at.closeButton}`)||Z.closest(`.${at.caption}`)))){if(O.type==="slide"&&ae.type==="drag"&&((de=(ne=$.current)==null?void 0:ne.splide)!=null&&de.root)){const z=$.current.splide.root;if(Z&&(z.contains(Z)||z===Z))return}if(K.touches.length===0&&K.changedTouches.length>0){const z=n[b],R=(z==null?void 0:z.image.objectFit)==="cover",ee=K.changedTouches[0];let te;if(R&&D.current){const me=uc(D.current);te=ee.clientX>=me.left&&ee.clientX<=me.right&&ee.clientY>=me.top&&ee.clientY<=me.bottom}else{const me=D.current?ya(D.current):null;if(!me)return;te=ee.clientX>=me.x&&ee.clientX<=me.x+me.width&&ee.clientY>=me.y&&ee.clientY<=me.y+me.height}if(!te){K.stopPropagation(),E.current=!0;const me=X=>{X.stopPropagation(),X.preventDefault(),document.removeEventListener("click",me,!0)};document.addEventListener("click",me,!0),pe()}}}};return document.addEventListener("touchend",h,{passive:!0}),()=>{document.removeEventListener("touchend",h)}},[e,pe,b,n]);const ge=(O.type==="scale"||O.type==="fade")&&O.direction==="vert"&&ae.type==="drag";s.useEffect(()=>{var X,Ie;if(!e||!ge||!((Ie=(X=$.current)==null?void 0:X.splide)!=null&&Ie.root))return;const h=$.current.splide.root,K=30,Z=(Se,J)=>{if(w.current){const He=Math.abs(Se-w.current.x),We=Math.abs(J-w.current.y);(He>0||We>0)&&(q.current=!0)}},ne=Se=>{w.current&&(Se.preventDefault(),Z(Se.clientX,Se.clientY))},de=Se=>{w.current&&Se.touches.length>0&&(Se.preventDefault(),Z(Se.touches[0].clientX,Se.touches[0].clientY))},z=(Se,J)=>{if(!w.current||!$.current){w.current=null;return}const He=Math.abs(Se-w.current.x),We=Math.abs(J-w.current.y);We>K&&We>He&&$.current.go(J<w.current.y?"+1":"-1"),w.current=null},R=Se=>{w.current&&z(Se.clientX,Se.clientY),document.removeEventListener("pointerup",R),document.removeEventListener("pointercancel",R),document.removeEventListener("pointermove",ne)},ee=Se=>{if(w.current){if(Se.changedTouches.length>0){const J=Se.changedTouches[0];z(J.clientX,J.clientY)}document.removeEventListener("touchend",ee),document.removeEventListener("touchcancel",ee),document.removeEventListener("touchmove",de)}},te=Se=>{w.current={x:Se.clientX,y:Se.clientY},q.current=!1,document.addEventListener("pointermove",ne,{passive:!1}),document.addEventListener("pointerup",R),document.addEventListener("pointercancel",R)},me=Se=>{Se.touches.length>0&&(w.current={x:Se.touches[0].clientX,y:Se.touches[0].clientY},q.current=!1,document.addEventListener("touchmove",de,{passive:!1}),document.addEventListener("touchend",ee),document.addEventListener("touchcancel",ee))};return h.addEventListener("pointerdown",te),h.addEventListener("touchstart",me),()=>{h.removeEventListener("pointerdown",te),h.removeEventListener("touchstart",me),document.removeEventListener("pointermove",ne),document.removeEventListener("pointerup",R),document.removeEventListener("pointercancel",R),document.removeEventListener("touchmove",de),document.removeEventListener("touchend",ee),document.removeEventListener("touchcancel",ee),w.current=null,q.current=!1}},[e,ge,f]);const xe={backgroundColor:le.color,backdropFilter:`blur(${le.blur}px)`,animationDuration:`${parseInt(ie.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(r)?null:Gn.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:l?null:T,className:Ct(at.background,W?ce:ye,{[at.editor]:l},{[at.hidden]:!e}),style:{...xe,...B&&!l&&!W?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?T:null,className:Ct(at.contentStyle,W?Y:Pe,{[at.editor]:l},{[at.hidden]:!e}),style:{animationDuration:`${parseInt(ie.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(Ll,{onMove:h=>k(h.index),ref:$,className:at.lightboxSplide,options:{arrows:!1,speed:O.duration?parseInt(O.duration):500,direction:O.direction==="horiz"||O.type==="fade"||O.type==="scale"?"ltr":"ttb",pagination:!1,drag:ae.type==="drag"&&!ge,perPage:1,width:"100%",height:"100%",type:O.type==="fade"||O.type==="scale"?"fade":"loop",padding:0,rewind:ae.repeat!=="close",start:0},style:{"--splide-speed":O.duration},children:n.map((h,K)=>{const Z=Fr(be.position,be.offset,l),ne=`${F.scalingValue(be.padding.top,l)} ${F.scalingValue(be.padding.right,l)} ${F.scalingValue(be.padding.bottom,l)} ${F.scalingValue(be.padding.left,l)}`,de=O.type==="scale"?(()=>{const{transform:z,...R}=Z;return{...R,position:"absolute",padding:ne,boxSizing:"border-box","--position-transform":z||"none"}})():{...Z,position:"absolute",padding:ne,boxSizing:"border-box"};return a.jsx(Pl,{children:a.jsx("div",{className:at.imgWrapper,onClick:we,children:a.jsx("img",{ref:K===b?D:null,className:Ct(at.imageStyle,{[at.contain]:h.image.objectFit==="contain",[at.cover]:h.image.objectFit==="cover",[at.scaleSlide]:O.type==="scale"}),src:h.image.url,alt:h.image.name??"",style:{...de,pointerEvents:h.image.objectFit==="contain"?"none":"auto"}})})},K)})},f),N.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ct(at.arrow,{[at.arrowVertical]:O.direction==="vert"}),style:{color:N.color,"--arrow-hover-color":N.hover},children:a.jsxs("button",{className:at.arrowInner,style:{transform:`translate(${F.scalingValue(N.offset.x,l)}, ${F.scalingValue(N.offset.y*(O.direction==="horiz"?1:-1),l)}) scale(${N.scale}) rotate(${O.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var h;return(h=$.current)==null?void 0:h.go("-1")},"aria-label":"Previous",children:[N.arrowsImgUrl&&a.jsx(mn,{url:N.arrowsImgUrl,fill:N.color,hoverFill:N.hover,className:Ct(at.arrowImg,at.mirror)}),!N.arrowsImgUrl&&a.jsx(pc,{color:N.color,className:Ct(at.arrowIcon,at.arrowImg,at.mirror)})]})}),a.jsx("div",{className:Ct(at.arrow,at.nextArrow,{[at.arrowVertical]:O.direction==="vert"}),style:{color:N.color,"--arrow-hover-color":N.hover},children:a.jsxs("button",{className:at.arrowInner,style:{transform:`translate(${F.scalingValue(N.offset.x*(O.direction==="horiz"?-1:1),l)}, ${F.scalingValue(N.offset.y,l)}) scale(${N.scale}) rotate(${O.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var h;return(h=$.current)==null?void 0:h.go("+1")},"aria-label":"Next",children:[N.arrowsImgUrl&&a.jsx(mn,{url:N.arrowsImgUrl,fill:N.color,hoverFill:N.hover,className:at.arrowImg}),!N.arrowsImgUrl&&a.jsx(pc,{color:N.color,className:Ct(at.arrowIcon,at.arrowImg)})]})})]}),le.closeIconUrl&&(()=>{const h=Fr(le.closeIconAlign,le.closeIconOffset,l),K=`scale(${le.closeIconScale})`,Z=h.transform?`${h.transform} ${K}`:K;return a.jsx("button",{className:at.closeButton,style:{...h,transform:Z},onClick:pe,"aria-label":"Close lightbox",children:a.jsx(mn,{url:le.closeIconUrl,fill:le.closeIconColor??"#000000",hoverFill:le.closeIconHover??"#cccccc"})})})(),Q&&Q.isActive&&i.imageCaption&&((Ce=n[b])==null?void 0:Ce.imageCaption)&&a.jsx("div",{className:at.caption,style:{...Fr(Q.alignment,Q.offset,l),fontFamily:Do(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:d.sizing==="auto"?"max-content":F.scalingValue(d.width,l),letterSpacing:F.scalingValue(p,l),wordSpacing:F.scalingValue(v,l),textAlign:y,fontSize:F.scalingValue(m.fontSize,l),lineHeight:F.scalingValue(m.lineHeight,l),textTransform:g.textTransform??"none",textDecoration:g.textDecoration??"none",fontVariant:g.fontVariant??"normal",color:x},onClick:h=>h.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:at.captionTextInner,style:{"--link-color":Q.linkColor,"--link-hover-color":Q.linkHoverColor},children:a.jsx(Ki,{content:n[b].imageCaption})})}),oe.isActive&&(()=>{const[h,K]=oe.position.split("-"),Z=O.direction==="horiz"?`${h}-left`:oe.position,ne=Fr(Z,oe.offset,l),de=()=>{if(O.direction==="horiz"){if(K==="left")return"flex-start";if(K==="center")return"center";if(K==="right")return"flex-end"}else{if(h==="top")return"flex-start";if(h==="middle")return"center";if(h==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:I,className:at.thumbsWrapper,onClick:z=>Re(z),style:{position:l?"absolute":"fixed",...ne,...O.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:Ct(at.thumbsContainer,{[at.thumbsContainerVertical]:O.direction==="vert",[at.thumbsAlignStart]:oe.align==="start",[at.thumbsAlignCenter]:oe.align==="center",[at.thumbsAlignEnd]:oe.align==="end"}),style:{gap:F.scalingValue(oe.grid.gap,l),justifyContent:A?"flex-start":de()},children:n.map((z,R)=>{const ee=R===b,te=_[R],X=oe.grid.size*(ee?oe.activeState.scale:1),Ie=()=>{if(oe.fit!=="fit")return{};if(!te)return O.direction==="horiz"?{height:F.scalingValue(X,l)}:{width:F.scalingValue(X,l)};const Se=te.width/te.height;if(O.direction==="horiz"){const J=X,He=J*Se;return{width:F.scalingValue(He,l),height:F.scalingValue(J,l)}}else{const J=X,He=J/Se;return{width:F.scalingValue(J,l),height:F.scalingValue(He,l)}}};return a.jsx("button",{className:at.thumbItem,style:{...O.direction==="horiz"&&oe.fit!=="fit"?{height:F.scalingValue(X,l)}:{},...O.direction==="vert"&&oe.fit!=="fit"?{width:F.scalingValue(X,l)}:{},...oe.fit==="cover"?{width:F.scalingValue(X,l),height:F.scalingValue(X,l)}:{},...Ie(),transition:ee?"all 0.25s ease-out":"none",opacity:ee?oe.activeState.opacity/100:oe.opacity/100,"--thumb-hover":oe.activeState.opacity/100},onClick:Se=>{var J;Se.stopPropagation(),k(R),(J=$.current)==null||J.go(R)},onMouseEnter:()=>{var Se;oe.triggers==="hov"&&((Se=$.current)==null||Se.go(R))},children:a.jsx("img",{src:z.image.url,alt:z.image.name??"",onLoad:Se=>{const J=Se.currentTarget;J.naturalWidth&&J.naturalHeight&&G(He=>({...He,[R]:{width:J.naturalWidth,height:J.naturalHeight}}))},style:{objectFit:oe.fit==="cover"?"cover":"contain",...oe.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...oe.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${z.image.name}-${R}`)})})})})()]})]}),document.getElementById(r))};function pc({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const rf={element:nf,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 Nr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function af(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 sf({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:r}){const l=!!n,c=i&&t||!t,{prefix:d}=F.useScopedStyles(),{type:u="A",fieldsToShow:p=2,textareaRows:y=1,fields:v=[],buttonLabel:m,gap:g,fieldsGap:x,buttonCorners:b,buttonStroke:k,buttonPadding:f,isButtonFullWidth:S,inputCorners:
|
|
158
|
+
`}function sf({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:r}){const l=!!n,c=i&&t||!t,{prefix:d}=F.useScopedStyles(),{type:u="A",fieldsToShow:p=2,textareaRows:y=1,fields:v=[],buttonLabel:m,gap:g,fieldsGap:x,buttonCorners:b,buttonStroke:k,buttonPadding:f,isButtonFullWidth:S,inputCorners:W,inputStroke:U,inputPadding:B,inputColor:P,inputTextColor:_,inputBorderColor:G,placeholderColor:$,buttonColor:L,buttonTextColor:D,buttonBorderColor:E,labelTextColor:T,successColor:C,errorColor:V,fontFamily:w,inputFontSettings:q,inputFontSize:I,inputLineHeight:A,inputLetterSpacing:j,inputWordSpacing:ie,inputTextAppearance:ae,buttonFontSettings:O,buttonFontSize:oe,buttonLineHeight:N,buttonLetterSpacing:le,buttonWordSpacing:Q,buttonTextAppearance:be,labelFontSettings:Pe,labelFontSize:ye,labelLineHeight:ce,labelLetterSpacing:Y,labelWordSpacing:se,labelTextAppearance:pe,statusFontSettings:fe,statusFontSize:we,statusLineHeight:Re,statusLetterSpacing:ge,statusWordSpacing:xe,statusTextAppearance:Ce,successMessage:h,errorMessage:K,stateOverrides:Z}=e,ne=u==="B",de=v.slice(0,Math.min(p,v.length)),z={fontSettings:{fontFamily:w,fontWeight:(q==null?void 0:q.fontWeight)??400,fontStyle:(q==null?void 0:q.fontStyle)??"normal"},fontSize:I??.01,lineHeight:A,letterSpacing:j??0,wordSpacing:ie??0,textAppearance:ae,color:_},R=dn(Qt(z,t)),ee=F.scalingValue(U??0,t),te=Xe=>F.scalingValue((A??I??.01)*Xe+((B==null?void 0:B.top)??0)+((B==null?void 0:B.bottom)??0)+(u==="C"?U??0:(U??0)*2),t),me=te(1),X=te(Math.max(1,y)),Ie={...R,borderStyle:"solid",borderRadius:u==="C"?0:F.scalingValue(W??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:ee,borderLeftWidth:0}:{borderWidth:ee},paddingTop:F.scalingValue((B==null?void 0:B.top)??0,t),paddingRight:F.scalingValue((B==null?void 0:B.right)??0,t),paddingBottom:F.scalingValue((B==null?void 0:B.bottom)??0,t),paddingLeft:F.scalingValue((B==null?void 0:B.left)??0,t),height:me,minHeight:me},Se={fontSettings:{fontFamily:w,fontWeight:(O==null?void 0:O.fontWeight)??400,fontStyle:(O==null?void 0:O.fontStyle)??"normal"},fontSize:oe??.01,lineHeight:N,letterSpacing:le??0,wordSpacing:Q??0,textAppearance:be,color:D},J=dn(Qt(Se,t)),He=F.scalingValue(k??0,t),We={fontSettings:{fontFamily:w,fontWeight:(Pe==null?void 0:Pe.fontWeight)??400,fontStyle:(Pe==null?void 0:Pe.fontStyle)??"normal"},fontSize:ye??.01,lineHeight:ce,letterSpacing:Y??0,wordSpacing:se??0,textAppearance:pe,color:T},ot=Qt(We,t),qe={fontSettings:{fontFamily:w,fontWeight:(fe==null?void 0:fe.fontWeight)??400,fontStyle:(fe==null?void 0:fe.fontStyle)??"normal"},fontSize:we??.01,lineHeight:Re,letterSpacing:ge??0,wordSpacing:xe??0,textAppearance:Ce,color:C},tt=dn(Qt(qe,t)),et=F.buildColorVars(d,{inputColor:P,inputTextColor:_,inputBorderColor:G,placeholderColor:$!=null&&$.trim()?$:"#cccccc",buttonColor:L,buttonTextColor:D,buttonBorderColor:E,labelTextColor:T,successColor:C,errorColor:V},lf,cf,Z),[Ge,ve]=s.useState(()=>Object.fromEntries(de.map(Xe=>[Xe.name,""]))),[_e,Be]=s.useState("idle"),[Ze,$e]=s.useState(null),Ne=r==="success"?"success":r==="error"?"error":_e,Ue=r==="error"?K:Ze,Je=r==="filled",st=s.useMemo(()=>{if(!Je)return Ge;let Xe=null;for(const ct of de)(Ge[ct.name]??"").trim().length>0||(Xe=Xe??{...Ge},Xe[ct.name]="Filled");return Xe??Ge},[Ge,Je,de]),it=Ne==="error"?F.getFormFieldValidationError(de,st):null,Ae=`${r&&r!=="default"?`${d}-state-${r}`:""}`.trim(),gt=o==null?void 0:o.submitUrl,ze=(Xe,ct)=>{ve(he=>({...he,[Xe]:ct}))},De=async Xe=>{if(Xe.preventDefault(),!c)return;const ct=Object.fromEntries(de.map(Ee=>{var nt;return[Ee.name,((nt=Ge[Ee.name])==null?void 0:nt.trim())??""]}).filter(([,Ee])=>Ee));if(!gt){Be("error"),$e("No integrations were found for this form.");return}if(Object.keys(ct).length===0)return;const he=F.getFormFieldValidationError(de,Ge);if(he){Be("error"),$e(he);return}Be("submitting"),$e(null);try{const Ee=await fetch(gt,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ct)});if(!Ee.ok){const nt=await Ee.text();throw new Error(nt||`Request failed: ${Ee.status}`)}Be("success"),ve(Object.fromEntries(de.map(nt=>[nt.name,""])))}catch(Ee){Be("error"),$e(Ee instanceof Error?Ee.message:"Something went wrong")}};return a.jsxs("div",{className:`${d}-wrapper ${d}-type-${u} ${Ae}`.trim(),style:et,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:af(d)}}),a.jsxs("form",{onSubmit:De,className:`${d}-form`,children:[a.jsx("div",{className:`${d}-fields`,children:de.map((Xe,ct)=>a.jsxs(s.Fragment,{children:[ct>0&&a.jsx("div",{"data-controls":l?"fieldsGap":void 0,className:l?`${d}-control`:void 0,style:{height:F.scalingValue(x??0,t)}}),a.jsxs("div",{className:`${d}-field-group${ne?` ${d}-labeled`:""}`,children:[ne&&a.jsx("span",{className:`${d}-field-label`,style:ot?{...ot,lineHeight:ot.fontSize}:void 0,children:Xe.label||Xe.name}),Xe.type==="textarea"?a.jsx("textarea",{name:Xe.name,autoComplete:"off",value:st[Xe.name]??"",onChange:he=>ze(Xe.name,he.target.value),placeholder:Xe.placeholder,className:`${d}-input`,style:{...Ie,height:X,minHeight:X},rows:y,"data-filled":Je||(st[Xe.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:Xe.type==="phone"?"tel":Xe.type==="email"?"email":"text",name:Xe.name,autoComplete:"off",value:st[Xe.name]??"",onChange:he=>ze(Xe.name,he.target.value),placeholder:Xe.placeholder,required:Xe.isRequired??Xe.type==="email",className:`${d}-input`,style:Ie,"data-filled":Je||(st[Xe.name]??"").trim().length>0})]})]},ct))}),a.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${d}-control`:void 0,style:{height:F.scalingValue(g??0,t)}}),a.jsx("div",{className:`${d}-overlay-anchor`,children:a.jsx("button",{type:c?"submit":"button",className:`${d}-button`,style:{borderStyle:"solid",borderRadius:F.scalingValue(b??0,t),borderWidth:He,paddingTop:F.scalingValue((f==null?void 0:f.top)??0,t),paddingRight:F.scalingValue((f==null?void 0:f.right)??0,t),paddingBottom:F.scalingValue((f==null?void 0:f.bottom)??0,t),paddingLeft:F.scalingValue((f==null?void 0:f.left)??0,t),pointerEvents:c?"auto":void 0,...J,...S?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:a.jsx("span",{className:`${d}-overlay-anchor`,style:S?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:_e==="submitting"?"...":m})})})]}),Ne==="success"&&a.jsx("p",{className:`${d}-success`,style:{...tt},children:h}),Ne==="error"&&a.jsx("p",{className:`${d}-error`,style:{...tt},role:"alert",children:it??Ue??K})]})}const lf={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"},cf=["hover","focus","filled","success","error"],df=`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';
|
|
@@ -986,7 +986,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
986
986
|
font-size: ${Hr(14)};
|
|
987
987
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
988
988
|
}
|
|
989
|
-
`}const ff=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:r}=F.useScopedStyles(),l=n&&t||!t,{fields:c=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:d,buttonLabel:u,fieldsToShow:p=1,fontFamily:y,inputFontSettings:v,inputFontSize:m,inputLineHeight:g,inputLetterSpacing:x,inputWordSpacing:b,inputTextAppearance:k,buttonFontSettings:f,buttonFontSize:S,buttonLineHeight:
|
|
989
|
+
`}const ff=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:r}=F.useScopedStyles(),l=n&&t||!t,{fields:c=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:d,buttonLabel:u,fieldsToShow:p=1,fontFamily:y,inputFontSettings:v,inputFontSize:m,inputLineHeight:g,inputLetterSpacing:x,inputWordSpacing:b,inputTextAppearance:k,buttonFontSettings:f,buttonFontSize:S,buttonLineHeight:W,buttonLetterSpacing:U,buttonWordSpacing:B,buttonTextAppearance:P,statusFontSettings:_,statusFontSize:G,statusLineHeight:$,statusLetterSpacing:L,statusWordSpacing:D,statusTextAppearance:E,iconMaxWidth:T,minHeight:C,corners:V,stroke:w,stateOverrides:q,inputPadding:I,buttonPadding:A,successMessage:j="Thanks for subscribing!",errorMessage:ie="Please, fill all required fields."}=e,ae=c.slice(0,Math.min(p,c.length)),[O,oe]=s.useState(()=>Object.fromEntries(ae.map(Se=>[Se.name,""]))),[N,le]=s.useState("idle"),[Q,be]=s.useState(null),Pe=o==="success"?"success":o==="error"?"error":N,ye=o==="error"?ie:Q,ce=o==="filled",Y=s.useMemo(()=>{if(!ce)return O;let Se=null;for(const J of ae)(O[J.name]??"").trim().length>0||(Se=Se??{...O},Se[J.name]="Filled");return Se??O},[ce,O,ae]),se=Pe==="error"?F.getFormFieldValidationError(ae,Y):null,pe=o&&o!=="default"?`${r}-state-${o}`:"",fe=ae.some(Se=>(Y[Se.name]??"").trim().length>0),we=pe!==`${r}-state-filled`&&fe?`${r}-state-filled`:"",Re=`${pe} ${we}`.trim(),ge=i==null?void 0:i.submitUrl,xe=u??"",Ce=(d==null?void 0:d.icon)??"",h=(d==null?void 0:d.mode)==="On",K=xe||"Submit",Z={fontSettings:{fontFamily:y,fontWeight:(v==null?void 0:v.fontWeight)??400,fontStyle:(v==null?void 0:v.fontStyle)??"normal"},fontSize:m??.01,lineHeight:g,letterSpacing:x??0,wordSpacing:b??0,textAppearance:k,color:e.inputTextColor??"#111111"},ne={fontSettings:{fontFamily:y,fontWeight:(f==null?void 0:f.fontWeight)??400,fontStyle:(f==null?void 0:f.fontStyle)??"normal"},fontSize:S??.01,lineHeight:W,letterSpacing:U??0,wordSpacing:B??0,textAppearance:P,color:e.buttonTextColor??"#ffffff"},de={fontSettings:{fontFamily:y,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:G??.01,lineHeight:$,letterSpacing:L??0,wordSpacing:D??0,textAppearance:E,color:e.successColor??"#22c55e"},z=dn(Qt(Z,t)),R=dn(Qt(ne,t)),ee=dn(Qt(de,t)),te=F.buildColorVars(r,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(Z==null?void 0:Z.color)??"#111111",buttonTextColor:e.buttonTextColor??(ne==null?void 0:ne.color)??"#ffffff"},yf,vf,q),me={borderRadius:F.scalingValue(V,t),borderWidth:F.scalingValue(w,t),borderStyle:"solid"},X={borderLeftWidth:F.scalingValue(w,t)},Ie=async Se=>{if(Se.preventDefault(),!l)return;const J=Object.fromEntries(ae.map(We=>{var ot;return[We.name,((ot=O[We.name])==null?void 0:ot.trim())??""]}).filter(([,We])=>We));if(!ge){le("error"),be("No integrations were found for this form.");return}if(Object.keys(J).length===0)return;const He=F.getFormFieldValidationError(ae,O);if(He){le("error"),be(He);return}le("submitting"),be(null);try{const We=await fetch(ge,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)});if(!We.ok){const ot=await We.text();throw new Error(ot||`Request failed: ${We.status}`)}le("success"),oe(Object.fromEntries(ae.map(ot=>[ot.name,""])))}catch(We){le("error"),be(We instanceof Error?We.message:"Something went wrong")}};return a.jsxs("div",{className:`${r}-wrapper ${Re}`.trim(),style:te,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:hf(r)}}),a.jsxs("form",{onSubmit:Ie,className:`${r}-form`,style:{...me,height:F.scalingValue(C,t),minHeight:F.scalingValue(C,t)},children:[a.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:ae.map(Se=>a.jsx("input",{type:Se.type==="email"?"email":Se.type==="phone"?"tel":"text",name:Se.name,autoComplete:"off",value:Y[Se.name]??"",onChange:J=>oe(He=>({...He,[Se.name]:J.target.value})),placeholder:Se.placeholder,required:Se.isRequired??Se.type==="email",className:`${r}-input`,style:{...z,paddingRight:F.scalingValue(I.right,t),paddingLeft:F.scalingValue(I.left,t),paddingTop:F.scalingValue(I.top,t),paddingBottom:F.scalingValue(I.bottom,t)}},Se.name))}),a.jsx("div",{className:`${r}-overlayAnchor`,children:a.jsx("button",{type:l?"submit":"button",className:`${r}-submitBtn`,"aria-label":K,style:{...R,...X,paddingRight:F.scalingValue(A.right,t),paddingLeft:F.scalingValue(A.left,t),paddingTop:F.scalingValue(A.top,t),paddingBottom:F.scalingValue(A.bottom,t),pointerEvents:l?"auto":void 0},children:N==="submitting"?"...":h?Ce&&a.jsx(mn,{url:Ce,className:`${r}-submitBtnIcon`,style:{maxWidth:F.scalingValue(T??0,t)},fill:`var(--${r}-button-text-color)`,hoverFill:`var(--${r}-button-text-color)`}):xe})})]}),Pe==="success"&&a.jsx("p",{className:`${r}-success`,style:{...ee},children:j}),Pe==="error"&&a.jsx("p",{className:`${r}-error`,style:{...ee},role:"alert",children:se??ye??ie})]})},yf={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"},vf=["hover","focus","filled","success","error"],xf=`import React, { useMemo, useState } from 'react';
|
|
990
990
|
import { CommonComponentProps } from '../props';
|
|
991
991
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
992
992
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -1565,7 +1565,7 @@ const COLOR_VAR_MAP: Record<OnelinerColorKeys, string> = {
|
|
|
1565
1565
|
};
|
|
1566
1566
|
|
|
1567
1567
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
1568
|
-
`,bf="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>'),Sf=[{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."}],Ka={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},wf=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],$f={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:{...Ka.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:{...Ka.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:{...Ka.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:Sf,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:bf},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:[...wf],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"]},Cf={element:ff,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:$f,sourceCode:xf};function Tf(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
1568
|
+
`,bf="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>'),Sf=[{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."}],Ya={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},wf=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],$f={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:{...Ya.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:{...Ya.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:{...Ya.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:Sf,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:bf},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:[...wf],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"]},Cf={element:ff,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:$f,sourceCode:xf};function Tf(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
1569
1569
|
.${e}-marquee-wrapper {
|
|
1570
1570
|
overflow: hidden;
|
|
1571
1571
|
width: 100%;
|
|
@@ -1697,7 +1697,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1697
1697
|
.${e}-image-hover-grayscale:hover video {
|
|
1698
1698
|
filter: grayscale(100%);
|
|
1699
1699
|
}
|
|
1700
|
-
`}const Lf=30,Pf=20,
|
|
1700
|
+
`}const Lf=30,Pf=20,Za=3,If=12,Rf=32,kf=3,Ef=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")},Mf=(e,t)=>Array.from({length:t},()=>e).flat(),Af=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},Hu=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),mc=(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),r=Number.parseFloat(o.columnGap||o.gap||"0")||0,l=i.getBoundingClientRect().right-n.getBoundingClientRect().left;if(l>0)return l;const c=Array.from({length:t},(u,p)=>e.children[p]),d=Hu(c);return d<=0?0:d+r*Math.max(0,t-1)},Ff=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=Hu(Array.from(e.children));if(i<=0)return 0;const o=getComputedStyle(e),r=Number.parseFloat(o.columnGap||o.gap||"0")||0,l=Number.parseFloat(o.paddingRight)||0;return i+r*Math.max(0,e.children.length-1)+l},Nf=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},_f=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>Nf(i,e))},Hf=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??"")},Wf=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,Of=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:r,imageHoverClass:l,isFirstSet:c,scaled:d,onFirstSetImageDone:u})=>{var D,E,T,C;const p=s.useRef(null),y=!!((D=e.image)!=null&&D.url&&Hf(e.image));s.useLayoutEffect(()=>{c&&Wf(p.current)&&(u==null||u())},[c,(E=e.image)==null?void 0:E.url,u]);const v=n.display==="cover",m=n.ratioValue??"1:1",g=n.reversed??!1,[x,b]=m.split(":").map(Number),S=(g?b:x)/(g?x:b),W=i/S,U=W>o?o:W,B=W>o?o*S:i,P=d(B),_=d(U),G={borderRadius:d(r)},$=v?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...G}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:d(i),maxHeight:d(o),objectFit:"contain",...G},L=((T=e.image)==null?void 0:T.url)&&(y?a.jsx("video",{ref:V=>{p.current=V},src:e.image.url,style:$,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:c?u:void 0,onError:c?u:void 0}):a.jsx("img",{ref:V=>{p.current=V},src:e.image.url,alt:((C=e.image)==null?void 0:C.name)??"",style:$,onLoad:c?u:void 0,onError:c?u:void 0}));return a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...v?{width:P}:{width:"max-content",maxWidth:d(i),minWidth:0}},children:a.jsx("div",{className:l,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...v?{width:P,height:_,overflow:"hidden",...G}:{width:"max-content",maxWidth:d(i),height:d(o)}},children:L&&e.link?a.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:Ct(`${t}-marquee-link`,!v&&`${t}-marquee-link-contain`),children:L}):L})})},Df=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=F.useScopedStyles(),[l,c]=s.useState(0),d=l>0?Math.round(l):0,u=s.useMemo(()=>Tf(r,d),[r,d]),{speed:p,direction:y,pauseOnHover:v,gap:m,imageMaxWidth:g,imageMaxHeight:x,hoverEffect:b,cornerRadius:k=0}=e,f=s.useMemo(()=>Af(e.imageFit),[e.imageFit]),S=(t==null?void 0:t.length)??0,W=!!o,U=!n||!!i,B=U&&b!=="off"&&b!=="randomize"?`${r}-image-hover-${b}`:void 0,P=n?!!i:!0,G=((t==null?void 0:t.length)??0)>0&&(P||!!n),$=Math.max(0,p)*Lf,L=we=>F.scalingValue(we,n??!1),D=s.useRef(null),E=s.useRef(null),T=s.useRef(null),[C,V]=s.useState(0),w=P&&v==="on",[q,I]=s.useState(!1),[A,j]=s.useState({}),ie=s.useRef(A);ie.current=A;const ae=s.useRef(null),O=s.useRef(0),oe=s.useRef(null),N=s.useMemo(()=>(t??[]).map(we=>{var Re;return((Re=we.image)==null?void 0:Re.url)??""}).join("\0"),[t]),[le,Q]=s.useState(Za),be=s.useMemo(()=>{const we=t??[];return we.length===0||!(P||!!n)?we:Mf(we,le)},[t,P,le,n]),Pe=s.useMemo(()=>(t??[]).filter(we=>{var Re;return!!((Re=we.image)!=null&&Re.url)}).length,[t]),ye=G?kf:1;s.useLayoutEffect(()=>{O.current=0,j({}),ae.current=null,Q(Za),c(0)},[N]),s.useEffect(()=>{if(!U||b!=="randomize")return;const we=D.current;if(!we)return;const Re=h=>{j(K=>{const Z=Array.from(h).filter(de=>de in K&&!_f(we,de));if(Z.length===0)return K;const ne={...K};return Z.forEach(de=>{delete ne[de]}),ne})},ge=new IntersectionObserver(h=>{const K=new Set;for(const Z of h){const ne=Z.target.dataset.marqueeItemIndex,de=ne!==void 0?Number(ne):NaN;Number.isNaN(de)||K.add(de)}K.size>0&&Re(K)},{root:we,threshold:0});Object.keys(A).forEach(h=>{const K=Number(h);we.querySelectorAll(`[data-marquee-item-index="${K}"]`).forEach(Z=>ge.observe(Z))});const xe={current:0},Ce=()=>{const h=Object.keys(ie.current);h.length!==0&&(Re(h.map(Number)),xe.current=requestAnimationFrame(Ce))};return Object.keys(ie.current).length>0&&(xe.current=requestAnimationFrame(Ce)),()=>{cancelAnimationFrame(xe.current),ge.disconnect()}},[b,A,U]),s.useEffect(()=>{const we=D.current;if(!we||typeof IntersectionObserver>"u")return;const Re=we.querySelectorAll("video");if(Re.length===0)return;const ge=new IntersectionObserver(xe=>{for(const Ce of xe){const h=Ce.target;Ce.isIntersecting?h.paused&&h.play().catch(()=>{}):h.paused||h.pause()}},{threshold:0});return Re.forEach(xe=>ge.observe(xe)),()=>ge.disconnect()},[G,be,ye,A]),s.useLayoutEffect(()=>{if(!G)return;const we=D.current,Re=T.current;if(!we||!Re)return;const ge={current:0},xe=()=>{const K=we.getBoundingClientRect().width||we.offsetWidth,Z=Ff(Re),ne=ae.current,de=typeof ne=="number"&&Math.abs(ne-Z)<=.25;ae.current=Z;let z=le,R=0;if((P||n)&&S>0&&K>0){const me=mc(Re,S);if(me>=Rf){R=me;const X=Math.min(If,Math.max(Za,Math.ceil(K/me)+1));z=X,X!==le&&Q(X)}}const te=z!==le&&R>0?R*z:Z>0?Z:R>0?R*z:(()=>{const me=mc(Re,S);return me>0?me*z:0})();te>0?c(me=>me<=0?te:!de||Math.round(me)===Math.round(te)?me:te):!de&&l<=0&&(cancelAnimationFrame(ge.current),ge.current=requestAnimationFrame(xe))},Ce=()=>{cancelAnimationFrame(ge.current),ge.current=requestAnimationFrame(xe)};oe.current=Ce,Ce();const h=new ResizeObserver(Ce);return h.observe(we),h.observe(Re),()=>{oe.current=null,cancelAnimationFrame(ge.current),h.disconnect()}},[P,G,l,N,le,S,n]),s.useLayoutEffect(()=>{if(!G||d<=0)return;const we=E.current;we&&Ef(we)},[G,d,y,$]),s.useLayoutEffect(()=>{if(!G||l<=0){V(0);return}const we=E.current,Re=T.current;if(!we||!Re)return;const ge=()=>{const Ce=we.offsetHeight||we.getBoundingClientRect().height,h=Array.from(Re.children).reduce((Z,ne)=>Math.max(Z,ne.offsetHeight||ne.getBoundingClientRect().height),0),K=Ce>0?Ce:h;V(K>0?K:0)};ge();const xe=new ResizeObserver(ge);return xe.observe(we),xe.observe(Re),()=>xe.disconnect()},[G,ye,be,n,m,g,x,l,f,A]),s.useLayoutEffect(()=>{if(!n||!W||!G||typeof window>"u")return;const we=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(we)},[n,W,G,y,l,C,m,be]);const ce=()=>{w&&I(!0)},Y=()=>{w&&I(!1)},se=s.useCallback(()=>{var we;O.current=Math.min(Pe,O.current+1),(we=oe.current)==null||we.call(oe)},[Pe]),pe=s.useCallback((we,Re)=>{j(ge=>{const xe=ge[we]??Re,Ce=(t??[]).filter(K=>K!==xe);if(Ce.length===0)return ge;const h=Ce[Math.floor(Math.random()*Ce.length)];return{...ge,[we]:h}})},[t]),fe=(we,Re,ge,xe)=>{const Ce=U&&b==="randomize"&&f.display==="cover"?A[ge]??we:we,h=`max(${L(m)}, ${Pf}px)`,K=`calc(-0.5 * (${h} + ${L(m)}))`;return a.jsxs("div",{className:`${r}-marquee-card`,"data-marquee-item-index":ge,onMouseEnter:U&&b==="randomize"&&f.display==="cover"?()=>pe(ge,we):void 0,children:[a.jsx(Of,{item:Ce,prefix:r,imageFit:f,imageMaxWidth:g,imageMaxHeight:x,cornerRadius:k,imageHoverClass:B,isEditor:n,isFirstSet:xe,scaled:L,onFirstSetImageDone:se}),W&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${r}-gap-control`,style:{position:"absolute",top:0,right:K,width:h,height:"100%"}})]},`${Re}-${ge}`)};if(G){const we=P?w&&q?"paused":"running":"paused",Re=d>0&&$>0?d/$*1e3:0,ge=`${Math.max(0,Re)/1e3}s`;return a.jsxs("div",{ref:D,className:Ct(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Marquee",style:C>0?{height:C}:void 0,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{ref:E,className:`${r}-marquee-track`,"data-direction":y,onMouseEnter:ce,onMouseLeave:Y,style:{WebkitAnimationDuration:ge,animationDuration:ge,WebkitAnimationPlayState:we,animationPlayState:we},children:Array.from({length:ye},(xe,Ce)=>a.jsx("div",{ref:Ce===0?T:void 0,className:Ct(`${r}-marquee-row`,`${r}-marquee-set`),style:{gap:L(m),paddingRight:L(m)},"aria-hidden":Ce>0,children:be.map((h,K)=>fe(h,Ce,K,Ce===0&&K<S))},`set-${Ce}`))})]})}return a.jsxs("div",{ref:D,className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{className:Ct(`${r}-marquee-row`,`${r}-marquee-static`),style:{gap:L(m),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((we,Re)=>fe(we,0,Re))},"marquee-static")]})},zf=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
1701
1701
|
import cn from 'classnames';
|
|
1702
1702
|
import { CommonComponentProps } from '../props';
|
|
1703
1703
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -2194,6 +2194,27 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
2194
2194
|
};
|
|
2195
2195
|
}, [hoverEffect, swappedSlots, showHoverEffects]);
|
|
2196
2196
|
|
|
2197
|
+
// Only decode videos that are actually visible: the track renders many copies of each item,
|
|
2198
|
+
// and playing all of them at once saturates the decoder and drops frames.
|
|
2199
|
+
useEffect(() => {
|
|
2200
|
+
const wrapper = wrapperRef.current;
|
|
2201
|
+
if (!wrapper || typeof IntersectionObserver === 'undefined') return;
|
|
2202
|
+
const videos = wrapper.querySelectorAll('video');
|
|
2203
|
+
if (videos.length === 0) return;
|
|
2204
|
+
const observer = new IntersectionObserver((entries) => {
|
|
2205
|
+
for (const entry of entries) {
|
|
2206
|
+
const video = entry.target as HTMLVideoElement;
|
|
2207
|
+
if (entry.isIntersecting) {
|
|
2208
|
+
if (video.paused) video.play().catch(() => {});
|
|
2209
|
+
} else if (!video.paused) {
|
|
2210
|
+
video.pause();
|
|
2211
|
+
}
|
|
2212
|
+
}
|
|
2213
|
+
}, { threshold: 0 });
|
|
2214
|
+
videos.forEach((video) => observer.observe(video));
|
|
2215
|
+
return () => observer.disconnect();
|
|
2216
|
+
}, [useMarqueeTrack, setContent, copies, swappedSlots]);
|
|
2217
|
+
|
|
2197
2218
|
useLayoutEffect(() => {
|
|
2198
2219
|
if (!useMarqueeTrack) return;
|
|
2199
2220
|
const wrapper = wrapperRef.current;
|
|
@@ -2509,6 +2530,8 @@ type MarqueeProps = {
|
|
|
2509
2530
|
.${e}-marquee-wrapper {
|
|
2510
2531
|
position: relative;
|
|
2511
2532
|
overflow: hidden;
|
|
2533
|
+
overflow-x: clip;
|
|
2534
|
+
overflow-y: visible;
|
|
2512
2535
|
width: 100%;
|
|
2513
2536
|
height: auto;
|
|
2514
2537
|
}
|
|
@@ -2609,7 +2632,7 @@ ${o}
|
|
|
2609
2632
|
left: -9999px;
|
|
2610
2633
|
top: 0;
|
|
2611
2634
|
}
|
|
2612
|
-
`}const Gf=30,Za=3,Xf=12,qf=96,gc=3,Ds=.72,Uf=100,Kf=10,Yf=e=>e/Uf,Zf=e=>Math.max(0,e)/Kf,Jf=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")},Qf=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),io={ctx:void 0},ey=()=>io.ctx!==void 0?io.ctx:typeof document>"u"?(io.ctx=null,io.ctx):(io.ctx=document.createElement("canvas").getContext("2d"),io.ctx),ty=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},hc=e=>{e.style.transform=""},ny=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},iy=(e,t)=>{const n=(i,o)=>{if(!i||i===t)return o;const r=o+i.offsetLeft,l=i.offsetParent;return!l||l===i?r:n(l,r)};return n(e,e.offsetWidth/2)},Wu=96,Ou=(e,t,n)=>{if(t<=0||Math.abs(e)<=0||n<2)return null;const i=2*Math.PI/t,o=new Float64Array(n+1),r=new Float64Array(n+1),l=e*t,c=u=>Math.sqrt(1+(l*Math.cos(t*u))**2),d=i/n;return Array.from({length:n},(u,p)=>{const y=p*d,v=y+d;o[p+1]=v,r[p+1]=r[p]+(c(y)+c(v))*.5*d}),{wavelength:i,periodArc:r[n],x:o,s:r}},oy=(e,t)=>{const n=Ou(e,t,Wu);return!n||n.wavelength<=0?1:n.periodArc/n.wavelength},ry=(e,t)=>{if(e.periodArc<=0)return t;const n=t<0?-1:1,i=Math.abs(t),o=Math.floor(i/e.periodArc),r=i-o*e.periodArc,{s:l,x:c}=e,d=(m,g)=>{if(g-m<=1)return[m,g];const x=m+g>>1;return l[x]<=r?d(x,g):d(m,x)},[u,p]=d(0,l.length-1),y=l[p]-l[u],v=y>0?(r-l[u])/y:0;return n*(o*e.wavelength+c[u]+(c[p]-c[u])*v)},ay=(e,t,n,i,o=0)=>{const r=Math.max(0,n),l=e>0?2*Math.PI*r/e:0,c=g=>i+t*Math.sin(l*g),d=g=>t*l*Math.cos(l*g),u=-o,y=e+o-u,v=Math.max(4,Math.ceil(r*4*(y/Math.max(e,1)))),m=Array.from({length:v},(g,x)=>{const b=u+x/v*y,k=u+(x+1)/v*y,f=k-b,S=c(b),O=c(k),U=b+f/3,z=S+d(b)*f/3,I=k-f/3,N=O-d(k)*f/3;return`C${U.toFixed(2)} ${z.toFixed(2)} ${I.toFixed(2)} ${N.toFixed(2)} ${k.toFixed(2)} ${O.toFixed(2)}`});return[`M${u.toFixed(2)} ${c(u).toFixed(2)}`,...m].join(" ")},sy=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:r,isCurve:l})=>{var m;const c=o!==0?{...n,transform:`translateY(${o}px)`}:n,d=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${Ds}em`},u=((m=e.image)==null?void 0:m.url)&&a.jsx("img",{src:e.image.url,alt:e.image.name??"",className:`${t}-item-image`,style:d}),p=u&&(l?a.jsx("span",{className:`${t}-item-image-wrap`,"data-marquee-wave-node":!0,children:u}):u),y=l?a.jsx("span",{className:`${t}-text`,style:c,children:Array.from(e.text).map((g,x)=>a.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:a.jsx("span",{className:`${t}-glyph-inner`,children:g===" "?" ":g})},x))}):a.jsx("span",{className:`${t}-text`,style:c,children:e.text}),v=a.jsxs(a.Fragment,{children:[p,y]});return a.jsx("div",{className:`${t}-item`,"data-marquee-text-item":!0,style:{gap:r},children:e.link?a.jsx("a",{href:e.link,className:`${t}-item-link`,style:{gap:r},children:v}):v})},ly=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=F.useScopedStyles(),[r,l]=s.useState(0),c=r>0?Math.round(r):0,{speed:d,direction:u,pauseOnHover:p,gap:y,layoutType:v,curveAmplitude:m,curveFrequency:g,textFontFamily:x,textFontSettings:b,textFontSize:k,textLineHeight:f,textLetterSpacing:S,textWordSpacing:O,textTextAppearance:U,textColor:z,backgroundColor:I,ribbonWidth:N}=e,q=N??f,$=v==="curve",L=Yf(m),D=Zf(g),_=s.useMemo(()=>Vf(o,c,$),[o,c,$]),C=s.useMemo(()=>Qt({fontSettings:{fontFamily:x,fontWeight:b.fontWeight,fontStyle:b.fontStyle},letterSpacing:S,wordSpacing:O,fontSize:k,lineHeight:f,textAppearance:U,color:z},n),[x,b,S,O,k,f,U,z,n]),T=Oe=>F.scalingValue(Oe,n??!1),B=((t==null?void 0:t.length)??0)>0,w=n?!!i:!0,X=B&&(w||!!n),R=Math.max(0,d)*Gf,E=w&&p==="on",[V,ie]=s.useState(!1),re=w?E&&V?"paused":"running":"paused",W=re==="running"&&R>0&&c>0,ae=c>0&&R>0?c/R*1e3:0,A=s.useRef(null),le=s.useRef(null),ee=s.useRef(null),xe=s.useRef(null),Pe=s.useRef(null),ye=s.useRef(null),pe=s.useRef(W),Y=s.useRef(null),se=s.useRef(null),de=s.useRef(L),ve=s.useRef(D);pe.current=W,de.current=L,ve.current=D;const[$e,ke]=s.useState(0),[he,Se]=s.useState(0),[Ce,h]=s.useState(0),[K,Z]=s.useState(0),[te,me]=s.useState(0),j=s.useMemo(()=>(t??[]).map(Oe=>{var Ae;return`${Oe.text}\0${((Ae=Oe.image)==null?void 0:Ae.url)??""}\0${Oe.link??""}`}).join("\0"),[t]),[P,Q]=s.useState(Za),ne=s.useMemo(()=>{const Oe=t??[];return Oe.length===0||!(w||n)?Oe:Qf(Oe,P)},[t,w,P,n]),ue=X?gc:1;s.useLayoutEffect(()=>{Q(Za),l(0)},[j]),s.useLayoutEffect(()=>{var De;const Oe=ye.current;if(!Oe)return;const Ae=()=>{const Xe=getComputedStyle(Oe),ct=parseFloat(Xe.fontSize)||0;if(ct<=0)return;const ge=ey();if(!ge){ke(ct*Ds),Se(0);return}ge.font=`${Xe.fontStyle} ${Xe.fontWeight} ${ct}px ${Xe.fontFamily}`;const Ee=ge.measureText("H"),nt=Ee.actualBoundingBoxAscent>0?Ee.actualBoundingBoxAscent:ct*Ds,pt=Math.max(0,Ee.actualBoundingBoxDescent||0),Ge=Ee.fontBoundingBoxAscent||0,vt=Ee.fontBoundingBoxDescent||0;ke(At=>Math.abs(At-nt)>.5?nt:At);const Rt=Ge>0||vt>0?(vt-pt-(Ge-nt))/2:0;Se(At=>Math.abs(At-Rt)>.25?Rt:At)};Ae();const gt=typeof document<"u"?document.fonts:void 0;(De=gt==null?void 0:gt.ready)==null||De.then(Ae).catch(()=>{});const ze=new ResizeObserver(Ae);return ze.observe(Oe),()=>ze.disconnect()},[C.fontFamily,C.fontWeight,C.fontStyle,C.fontSize,C.lineHeight]),s.useLayoutEffect(()=>{if(!X)return;const Oe=A.current,Ae=xe.current;if(!Oe||!Ae)return;const gt={id:0},ze=()=>{const ge=Oe.offsetWidth||Oe.getBoundingClientRect().width,Ee=Ae.offsetWidth||Ae.getBoundingClientRect().width;if(B&&ge>0&&Ee>0){const nt=Ee/P;if(nt>0){let pt=ge,Ge=Xf;if($){const Rt=ge*de.current,At=ve.current,wt=At>0?2*Math.PI*At/ge:0,Vt=oy(Rt,wt);pt=Math.max(ge,Vt*ge/(gc-1)),Ge=qf}const vt=Math.min(Ge,Math.max(Za,Math.ceil(pt/nt)+1));if(vt!==P){Q(vt);return}}}Ee>0&&l(Ee)},De=()=>{cancelAnimationFrame(gt.id),gt.id=requestAnimationFrame(ze)};De();const Xe=new ResizeObserver(De);Xe.observe(Oe),Xe.observe(Ae);const ct=()=>{document.hidden||De()};return document.addEventListener("visibilitychange",ct),window.addEventListener("pageshow",ct),window.addEventListener("focus",ct),()=>{cancelAnimationFrame(gt.id),Xe.disconnect(),document.removeEventListener("visibilitychange",ct),window.removeEventListener("pageshow",ct),window.removeEventListener("focus",ct)}},[X,j,P,B,$e,$,L,D]),s.useLayoutEffect(()=>{const Oe=Pe.current;if(!Oe)return;const Ae={id:0},gt=()=>{const De=Oe.offsetHeight;De>0&&me(Xe=>Math.abs(Xe-De)>.5?De:Xe)};Ae.id=requestAnimationFrame(gt);const ze=new ResizeObserver(()=>{cancelAnimationFrame(Ae.id),Ae.id=requestAnimationFrame(gt)});return ze.observe(Oe),()=>{cancelAnimationFrame(Ae.id),ze.disconnect()}},[q,n]),s.useLayoutEffect(()=>{if(!$){h(0),Z(0);return}const Oe=A.current,Ae=xe.current;if(!Oe||!Ae)return;const gt={id:0},ze=()=>{const Xe=Oe.offsetWidth,ct=Ae.offsetHeight;Xe>0&&Z(ge=>Math.abs(ge-Xe)>.5?Xe:ge),ct>0&&h(ge=>Math.abs(ge-ct)>.5?ct:ge)};gt.id=requestAnimationFrame(ze);const De=new ResizeObserver(()=>{cancelAnimationFrame(gt.id),gt.id=requestAnimationFrame(ze)});return De.observe(Oe),De.observe(Ae),()=>{cancelAnimationFrame(gt.id),De.disconnect()}},[$,j,$e,f,k,X]),s.useLayoutEffect(()=>{if(!X||c<=0)return;const Oe=ee.current;Oe&&Jf(Oe)},[X,c,u,R]),s.useLayoutEffect(()=>{if(!$||!B)return;const Oe=A.current;if(!Oe)return;const Ae={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},gt=()=>{for(const nt of Ae.itemsCache)for(const pt of nt.glyphs)hc(pt.inner)},ze=()=>{const nt=le.current??Oe;Ae.itemsCache=Array.from(Oe.querySelectorAll("[data-marquee-text-item]"),pt=>{const Ge=[];return pt.querySelectorAll("[data-marquee-wave-node]").forEach(vt=>{const Rt=vt.firstElementChild;Rt&&Ge.push({inner:Rt,layoutLocalX:iy(vt,nt)})}),{item:pt,glyphs:Ge}}),Ae.cacheDirty=!1},De=()=>{Ae.cacheDirty&&ze();const pt=(le.current??Oe).offsetWidth||1,Ge=pt*de.current,vt=ve.current,Rt=2*Math.PI*vt/pt,At=`${pt}|${Ge}|${Rt}`;if(At!==Ae.lutKey&&(Ae.lutKey=At,Ae.lut=Ou(Ge,Rt,Wu)),Math.abs(Ge)<=0||Rt<=0){gt();return}const wt=ee.current,Vt=wt?ny(getComputedStyle(wt).transform):0,jt=Oe.getBoundingClientRect(),Kt=jt.left,Yt=jt.right,kt=Ae.lut&&Ae.lut.wavelength>0?Math.max(0,(Ae.lut.periodArc/Ae.lut.wavelength-1)*pt):0;for(const{item:Bt,glyphs:rn}of Ae.itemsCache){const xt=Bt.getBoundingClientRect();if(xt.right<Kt||xt.left>Yt+kt){for(const yt of rn)hc(yt.inner);continue}for(const yt of rn){const Me=yt.layoutLocalX+Vt,Qe=Ae.lut?ry(Ae.lut,Me):Me,rt=Rt*Qe,dt=Ge*Math.sin(rt),Pt=Ge*Rt*Math.cos(rt),St=Math.atan(Pt)*(180/Math.PI);ty(yt.inner,Qe-Me,dt,St)}}},Xe=()=>{Ae.cancelled||(Ae.raf=0,De(),pe.current&&!document.hidden&&(Ae.raf=requestAnimationFrame(Xe)))},ct=()=>{Ae.cancelled||Ae.raf||(Ae.raf=requestAnimationFrame(Xe))},ge=()=>{Ae.cacheDirty=!0,De(),ct()};Y.current=ct,se.current=ge,De(),ct();const Ee=()=>{if(document.hidden){cancelAnimationFrame(Ae.raf),Ae.raf=0;return}cancelAnimationFrame(Ae.raf),Ae.raf=0,ge()};return document.addEventListener("visibilitychange",Ee),window.addEventListener("pageshow",Ee),window.addEventListener("focus",Ee),()=>{Ae.cancelled=!0,Y.current=null,se.current=null,cancelAnimationFrame(Ae.raf),document.removeEventListener("visibilitychange",Ee),window.removeEventListener("pageshow",Ee),window.removeEventListener("focus",Ee),gt()}},[$,B]),s.useLayoutEffect(()=>{var Oe;!$||!B||(Oe=se.current)==null||Oe.call(se)},[$,B,r,j,P,$e,L,D,K]),s.useLayoutEffect(()=>{var Oe;(Oe=Y.current)==null||Oe.call(Y)},[W,u]);const G=()=>{E&&ie(!0)},Ie=()=>{E&&ie(!1)},be=$?Math.abs(L)*100:0,J=T(q),He={minHeight:J,...$?{paddingTop:`${be}%`,paddingBottom:`${be}%`}:{}},We={height:J,...$?{visibility:"hidden"}:{backgroundColor:I}},ot={gap:T(y),minHeight:J},qe=K*L,tt=Math.abs(qe),et=te>0?te:Ce,je=Math.max(Ce,et),fe=tt+je/2,_e=Math.max(et,1),Be=$&&K>0&&je>0?ay(K,qe,D,fe,_e):"",Ze=tt*2+je,we=Be?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${K} ${Ze}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:Be,fill:"none",stroke:I,strokeWidth:et,strokeLinecap:"butt",strokeLinejoin:"round"})}):null,Ne=a.jsx("div",{ref:Pe,className:`${o}-ribbon`,style:We,"aria-hidden":!0}),Ue=(Oe,Ae,gt)=>a.jsx(sy,{item:Oe,prefix:o,textCss:C,capHeightPx:$e,opticalOffsetY:he,imageGapPx:T(y),isCurve:$},`${Ae}-${gt}`),Je=a.jsx("span",{ref:ye,"aria-hidden":!0,className:`${o}-cap-ref`,style:C,children:"H"}),st=`${Math.max(0,ae)/1e3}s`,it=X?a.jsx("div",{ref:ee,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:G,onMouseLeave:Ie,style:{WebkitAnimationDuration:st,animationDuration:st,WebkitAnimationPlayState:re,animationPlayState:re},children:Array.from({length:ue},(Oe,Ae)=>a.jsx("div",{ref:Ae===0?xe:void 0,className:`${o}-marquee-set`,style:{...ot,paddingRight:T(y)},"aria-hidden":Ae>0,children:ne.map((gt,ze)=>Ue(gt,Ae,ze))},`set-${Ae}`))}):a.jsx("div",{ref:xe,className:Ct(`${o}-marquee-set`,`${o}-marquee-static`),style:ot,children:t==null?void 0:t.map((Oe,Ae)=>Ue(Oe,0,Ae))});return a.jsxs("div",{ref:A,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:_}}),Je,a.jsxs("div",{ref:le,className:`${o}-marquee-wrapper`,style:He,children:[Ne,we,it]})]})},cy=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
2635
|
+
`}const Gf=30,Ja=3,Xf=12,qf=96,gc=3,sa=.72,Uf=100,Kf=10,Yf=e=>e/Uf,Zf=e=>Math.max(0,e)/Kf,Jf=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")},Qf=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),io={ctx:void 0},ey=()=>io.ctx!==void 0?io.ctx:typeof document>"u"?(io.ctx=null,io.ctx):(io.ctx=document.createElement("canvas").getContext("2d"),io.ctx),ty=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},hc=e=>{e.style.transform=""},ny=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},iy=(e,t)=>{const n=(i,o)=>{if(!i||i===t)return o;const r=o+i.offsetLeft,l=i.offsetParent;return!l||l===i?r:n(l,r)};return n(e,e.offsetWidth/2)},Wu=96,Ou=(e,t,n)=>{if(t<=0||Math.abs(e)<=0||n<2)return null;const i=2*Math.PI/t,o=new Float64Array(n+1),r=new Float64Array(n+1),l=e*t,c=u=>Math.sqrt(1+(l*Math.cos(t*u))**2),d=i/n;return Array.from({length:n},(u,p)=>{const y=p*d,v=y+d;o[p+1]=v,r[p+1]=r[p]+(c(y)+c(v))*.5*d}),{wavelength:i,periodArc:r[n],x:o,s:r}},oy=(e,t)=>{const n=Ou(e,t,Wu);return!n||n.wavelength<=0?1:n.periodArc/n.wavelength},ry=(e,t)=>{if(e.periodArc<=0)return t;const n=t<0?-1:1,i=Math.abs(t),o=Math.floor(i/e.periodArc),r=i-o*e.periodArc,{s:l,x:c}=e,d=(m,g)=>{if(g-m<=1)return[m,g];const x=m+g>>1;return l[x]<=r?d(x,g):d(m,x)},[u,p]=d(0,l.length-1),y=l[p]-l[u],v=y>0?(r-l[u])/y:0;return n*(o*e.wavelength+c[u]+(c[p]-c[u])*v)},ay=(e,t,n,i,o=0)=>{const r=Math.max(0,n),l=e>0?2*Math.PI*r/e:0,c=g=>i+t*Math.sin(l*g),d=g=>t*l*Math.cos(l*g),u=-o,y=e+o-u,v=Math.max(4,Math.ceil(r*4*(y/Math.max(e,1)))),m=Array.from({length:v},(g,x)=>{const b=u+x/v*y,k=u+(x+1)/v*y,f=k-b,S=c(b),W=c(k),U=b+f/3,B=S+d(b)*f/3,P=k-f/3,_=W-d(k)*f/3;return`C${U.toFixed(2)} ${B.toFixed(2)} ${P.toFixed(2)} ${_.toFixed(2)} ${k.toFixed(2)} ${W.toFixed(2)}`});return[`M${u.toFixed(2)} ${c(u).toFixed(2)}`,...m].join(" ")},sy=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:r,isCurve:l})=>{var m;const c=o!==0?{...n,transform:`translateY(${o}px)`}:n,d=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${sa}em`},u=((m=e.image)==null?void 0:m.url)&&a.jsx("img",{src:e.image.url,alt:e.image.name??"",className:`${t}-item-image`,style:d}),p=u&&(l?a.jsx("span",{className:`${t}-item-image-wrap`,"data-marquee-wave-node":!0,children:u}):u),y=l?a.jsx("span",{className:`${t}-text`,style:c,children:Array.from(e.text).map((g,x)=>a.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:a.jsx("span",{className:`${t}-glyph-inner`,children:g===" "?" ":g})},x))}):a.jsx("span",{className:`${t}-text`,style:c,children:e.text}),v=a.jsxs(a.Fragment,{children:[p,y]});return a.jsx("div",{className:`${t}-item`,"data-marquee-text-item":!0,style:{gap:r},children:e.link?a.jsx("a",{href:e.link,className:`${t}-item-link`,style:{gap:r},children:v}):v})},ly=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=F.useScopedStyles(),[r,l]=s.useState(0),c=r>0?Math.round(r):0,{speed:d,direction:u,pauseOnHover:p,gap:y,layoutType:v,curveAmplitude:m,curveFrequency:g,textFontFamily:x,textFontSettings:b,textFontSize:k,textLetterSpacing:f,textWordSpacing:S,textTextAppearance:W,textColor:U,backgroundColor:B,ribbonWidth:P}=e,_=P??k,G=v==="curve",$=Yf(m),L=Zf(g),D=s.useMemo(()=>Vf(o,c,G),[o,c,G]),E=s.useMemo(()=>Qt({fontSettings:{fontFamily:x,fontWeight:b.fontWeight,fontStyle:b.fontStyle},letterSpacing:f,wordSpacing:S,fontSize:k,lineHeight:k,textAppearance:W,color:U},n),[x,b,f,S,k,W,U,n]),T=Oe=>F.scalingValue(Oe,n??!1),C=((t==null?void 0:t.length)??0)>0,V=n?!!i:!0,w=C&&(V||!!n),q=Math.max(0,d)*Gf,I=V&&p==="on",[A,j]=s.useState(!1),ie=V?I&&A?"paused":"running":"paused",ae=ie==="running"&&q>0&&c>0,O=c>0&&q>0?c/q*1e3:0,oe=s.useRef(null),N=s.useRef(null),le=s.useRef(null),Q=s.useRef(null),be=s.useRef(null),Pe=s.useRef(null),ye=s.useRef(ae),ce=s.useRef(null),Y=s.useRef(null),se=s.useRef($),pe=s.useRef(L);ye.current=ae,se.current=$,pe.current=L;const[fe,we]=s.useState(0),[Re,ge]=s.useState(0),[xe,Ce]=s.useState(0),[h,K]=s.useState(0),[Z,ne]=s.useState(0),de=s.useMemo(()=>(t??[]).map(Oe=>{var Ae;return`${Oe.text}\0${((Ae=Oe.image)==null?void 0:Ae.url)??""}\0${Oe.link??""}`}).join("\0"),[t]),[z,R]=s.useState(Ja),ee=s.useMemo(()=>{const Oe=t??[];return Oe.length===0||!(V||n)?Oe:Qf(Oe,z)},[t,V,z,n]),te=w?gc:1;s.useLayoutEffect(()=>{R(Ja),l(0)},[de]),s.useLayoutEffect(()=>{var De;const Oe=Pe.current;if(!Oe)return;const Ae=()=>{const Xe=getComputedStyle(Oe),ct=parseFloat(Xe.fontSize)||0;if(ct<=0)return;const he=ey();if(!he){we(ct*sa),ge(0);return}he.font=`${Xe.fontStyle} ${Xe.fontWeight} ${ct}px ${Xe.fontFamily}`;const Ee=he.measureText("H"),nt=Ee.actualBoundingBoxAscent>0?Ee.actualBoundingBoxAscent:ct*sa,pt=Math.max(0,Ee.actualBoundingBoxDescent||0),Ve=Ee.fontBoundingBoxAscent||0,vt=Ee.fontBoundingBoxDescent||0;we(At=>Math.abs(At-nt)>.5?nt:At);const Rt=Ve>0||vt>0?(vt-pt-(Ve-nt))/2:0;ge(At=>Math.abs(At-Rt)>.25?Rt:At)};Ae();const gt=typeof document<"u"?document.fonts:void 0;(De=gt==null?void 0:gt.ready)==null||De.then(Ae).catch(()=>{});const ze=new ResizeObserver(Ae);return ze.observe(Oe),()=>ze.disconnect()},[E.fontFamily,E.fontWeight,E.fontStyle,E.fontSize,E.lineHeight]),s.useLayoutEffect(()=>{if(!w)return;const Oe=oe.current,Ae=Q.current;if(!Oe||!Ae)return;const gt={id:0},ze=()=>{const he=Oe.offsetWidth||Oe.getBoundingClientRect().width,Ee=Ae.offsetWidth||Ae.getBoundingClientRect().width;if(C&&he>0&&Ee>0){const nt=Ee/z;if(nt>0){let pt=he,Ve=Xf;if(G){const Rt=he*se.current,At=pe.current,wt=At>0?2*Math.PI*At/he:0,Vt=oy(Rt,wt);pt=Math.max(he,Vt*he/(gc-1)),Ve=qf}const vt=Math.min(Ve,Math.max(Ja,Math.ceil(pt/nt)+1));if(vt!==z){R(vt);return}}}Ee>0&&l(Ee)},De=()=>{cancelAnimationFrame(gt.id),gt.id=requestAnimationFrame(ze)};De();const Xe=new ResizeObserver(De);Xe.observe(Oe),Xe.observe(Ae);const ct=()=>{document.hidden||De()};return document.addEventListener("visibilitychange",ct),window.addEventListener("pageshow",ct),window.addEventListener("focus",ct),()=>{cancelAnimationFrame(gt.id),Xe.disconnect(),document.removeEventListener("visibilitychange",ct),window.removeEventListener("pageshow",ct),window.removeEventListener("focus",ct)}},[w,de,z,C,fe,G,$,L]),s.useLayoutEffect(()=>{const Oe=be.current;if(!Oe)return;const Ae={id:0},gt=()=>{const De=Oe.offsetHeight;De>0&&ne(Xe=>Math.abs(Xe-De)>.5?De:Xe)};Ae.id=requestAnimationFrame(gt);const ze=new ResizeObserver(()=>{cancelAnimationFrame(Ae.id),Ae.id=requestAnimationFrame(gt)});return ze.observe(Oe),()=>{cancelAnimationFrame(Ae.id),ze.disconnect()}},[_,n]),s.useLayoutEffect(()=>{if(!G){Ce(0),K(0);return}const Oe=oe.current,Ae=Q.current;if(!Oe||!Ae)return;const gt={id:0},ze=()=>{const Xe=Oe.offsetWidth,ct=Ae.offsetHeight;Xe>0&&K(he=>Math.abs(he-Xe)>.5?Xe:he),ct>0&&Ce(he=>Math.abs(he-ct)>.5?ct:he)};gt.id=requestAnimationFrame(ze);const De=new ResizeObserver(()=>{cancelAnimationFrame(gt.id),gt.id=requestAnimationFrame(ze)});return De.observe(Oe),De.observe(Ae),()=>{cancelAnimationFrame(gt.id),De.disconnect()}},[G,de,fe,k,w]),s.useLayoutEffect(()=>{if(!w||c<=0)return;const Oe=le.current;Oe&&Jf(Oe)},[w,c,u,q]),s.useLayoutEffect(()=>{if(!G||!C)return;const Oe=oe.current;if(!Oe)return;const Ae={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},gt=()=>{for(const nt of Ae.itemsCache)for(const pt of nt.glyphs)hc(pt.inner)},ze=()=>{const nt=N.current??Oe;Ae.itemsCache=Array.from(Oe.querySelectorAll("[data-marquee-text-item]"),pt=>{const Ve=[];return pt.querySelectorAll("[data-marquee-wave-node]").forEach(vt=>{const Rt=vt.firstElementChild;Rt&&Ve.push({inner:Rt,layoutLocalX:iy(vt,nt)})}),{item:pt,glyphs:Ve}}),Ae.cacheDirty=!1},De=()=>{Ae.cacheDirty&&ze();const pt=(N.current??Oe).offsetWidth||1,Ve=pt*se.current,vt=pe.current,Rt=2*Math.PI*vt/pt,At=`${pt}|${Ve}|${Rt}`;if(At!==Ae.lutKey&&(Ae.lutKey=At,Ae.lut=Ou(Ve,Rt,Wu)),Math.abs(Ve)<=0||Rt<=0){gt();return}const wt=le.current,Vt=wt?ny(getComputedStyle(wt).transform):0,jt=Oe.getBoundingClientRect(),Kt=jt.left,Yt=jt.right,kt=Ae.lut&&Ae.lut.wavelength>0?Math.max(0,(Ae.lut.periodArc/Ae.lut.wavelength-1)*pt):0;for(const{item:Bt,glyphs:rn}of Ae.itemsCache){const xt=Bt.getBoundingClientRect();if(xt.right<Kt||xt.left>Yt+kt){for(const yt of rn)hc(yt.inner);continue}for(const yt of rn){const Me=yt.layoutLocalX+Vt,Qe=Ae.lut?ry(Ae.lut,Me):Me,rt=Rt*Qe,dt=Ve*Math.sin(rt),Pt=Ve*Rt*Math.cos(rt),St=Math.atan(Pt)*(180/Math.PI);ty(yt.inner,Qe-Me,dt,St)}}},Xe=()=>{Ae.cancelled||(Ae.raf=0,De(),ye.current&&!document.hidden&&(Ae.raf=requestAnimationFrame(Xe)))},ct=()=>{Ae.cancelled||Ae.raf||(Ae.raf=requestAnimationFrame(Xe))},he=()=>{Ae.cacheDirty=!0,De(),ct()};ce.current=ct,Y.current=he,De(),ct();const Ee=()=>{if(document.hidden){cancelAnimationFrame(Ae.raf),Ae.raf=0;return}cancelAnimationFrame(Ae.raf),Ae.raf=0,he()};return document.addEventListener("visibilitychange",Ee),window.addEventListener("pageshow",Ee),window.addEventListener("focus",Ee),()=>{Ae.cancelled=!0,ce.current=null,Y.current=null,cancelAnimationFrame(Ae.raf),document.removeEventListener("visibilitychange",Ee),window.removeEventListener("pageshow",Ee),window.removeEventListener("focus",Ee),gt()}},[G,C]),s.useLayoutEffect(()=>{var Oe;!G||!C||(Oe=Y.current)==null||Oe.call(Y)},[G,C,r,de,z,fe,$,L,h]),s.useLayoutEffect(()=>{var Oe;(Oe=ce.current)==null||Oe.call(ce)},[ae,u]);const me=Oe=>{I&&Oe.pointerType==="mouse"&&j(!0)},X=()=>{I&&j(!1)},Ie=G?Math.abs($)*100:0,Se=T(_),J={minHeight:Se,...G?{paddingTop:`${Ie}%`,paddingBottom:`${Ie}%`}:{}},He={height:Se,...G?{visibility:"hidden"}:{backgroundColor:B}},We={gap:T(y),minHeight:Se},ot=h*$,qe=Math.abs(ot),tt=Z>0?Z:xe,et=Math.max(xe,tt),Ge=qe+et/2,ve=Math.max(tt,1),_e=G&&h>0&&et>0?ay(h,ot,L,Ge,ve):"",Be=qe*2+et,Ze=_e?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${h} ${Be}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:_e,fill:"none",stroke:B,strokeWidth:tt,strokeLinecap:"butt",strokeLinejoin:"round"})}):null,$e=a.jsx("div",{ref:be,className:`${o}-ribbon`,style:He,"aria-hidden":!0}),Ne={...E,lineHeight:fe>0?`${fe}px`:`${sa}em`},Ue=(Oe,Ae,gt)=>a.jsx(sy,{item:Oe,prefix:o,textCss:Ne,capHeightPx:fe,opticalOffsetY:Re,imageGapPx:T(y),isCurve:G},`${Ae}-${gt}`),Je=a.jsx("span",{ref:Pe,"aria-hidden":!0,className:`${o}-cap-ref`,style:E,children:"H"}),st=`${Math.max(0,O)/1e3}s`,it=w?a.jsx("div",{ref:le,className:`${o}-marquee-track`,"data-direction":u,onPointerEnter:me,onPointerLeave:X,style:{WebkitAnimationDuration:st,animationDuration:st,WebkitAnimationPlayState:ie,animationPlayState:ie},children:Array.from({length:te},(Oe,Ae)=>a.jsx("div",{ref:Ae===0?Q:void 0,className:`${o}-marquee-set`,style:{...We,paddingRight:T(y)},"aria-hidden":Ae>0,children:ee.map((gt,ze)=>Ue(gt,Ae,ze))},`set-${Ae}`))}):a.jsx("div",{ref:Q,className:Ct(`${o}-marquee-set`,`${o}-marquee-static`),style:We,children:t==null?void 0:t.map((Oe,Ae)=>Ue(Oe,0,Ae))});return a.jsxs("div",{ref:oe,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:D}}),Je,a.jsxs("div",{ref:N,className:`${o}-marquee-wrapper`,style:J,children:[$e,Ze,it]})]})},cy=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type PointerEvent as ReactPointerEvent } from 'react';
|
|
2613
2636
|
import cn from 'classnames';
|
|
2614
2637
|
import { CommonComponentProps } from '../props';
|
|
2615
2638
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -2648,6 +2671,8 @@ function getCSS(P: string, setWidthPx: number, isCurve: boolean): string {
|
|
|
2648
2671
|
.\${P}-marquee-wrapper {
|
|
2649
2672
|
position: relative;
|
|
2650
2673
|
overflow: hidden;
|
|
2674
|
+
overflow-x: clip;
|
|
2675
|
+
overflow-y: visible;
|
|
2651
2676
|
width: 100%;
|
|
2652
2677
|
height: auto;
|
|
2653
2678
|
}
|
|
@@ -2972,7 +2997,6 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode }: Marq
|
|
|
2972
2997
|
textFontFamily,
|
|
2973
2998
|
textFontSettings,
|
|
2974
2999
|
textFontSize,
|
|
2975
|
-
textLineHeight,
|
|
2976
3000
|
textLetterSpacing,
|
|
2977
3001
|
textWordSpacing,
|
|
2978
3002
|
textTextAppearance,
|
|
@@ -2980,7 +3004,7 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode }: Marq
|
|
|
2980
3004
|
backgroundColor,
|
|
2981
3005
|
ribbonWidth: ribbonWidthSetting,
|
|
2982
3006
|
} = settings;
|
|
2983
|
-
const ribbonWidth = ribbonWidthSetting ??
|
|
3007
|
+
const ribbonWidth = ribbonWidthSetting ?? textFontSize;
|
|
2984
3008
|
const isCurveLayout = layoutType === 'curve';
|
|
2985
3009
|
const amplitudeRatio = normalizeCurveAmplitude(curveAmplitude);
|
|
2986
3010
|
const curvePeriods = normalizeCurveFrequency(curveFrequency);
|
|
@@ -2995,10 +3019,10 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode }: Marq
|
|
|
2995
3019
|
letterSpacing: textLetterSpacing,
|
|
2996
3020
|
wordSpacing: textWordSpacing,
|
|
2997
3021
|
fontSize: textFontSize,
|
|
2998
|
-
lineHeight:
|
|
3022
|
+
lineHeight: textFontSize,
|
|
2999
3023
|
textAppearance: textTextAppearance,
|
|
3000
3024
|
color: textColor,
|
|
3001
|
-
}, isEditor), [textFontFamily, textFontSettings, textLetterSpacing, textWordSpacing, textFontSize,
|
|
3025
|
+
}, isEditor), [textFontFamily, textFontSettings, textLetterSpacing, textWordSpacing, textFontSize, textTextAppearance, textColor, isEditor]);
|
|
3002
3026
|
|
|
3003
3027
|
const scaled = (v: number) => scalingValue(v, isEditor ?? false);
|
|
3004
3028
|
const hasContent = (content?.length ?? 0) > 0;
|
|
@@ -3199,7 +3223,7 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode }: Marq
|
|
|
3199
3223
|
cancelAnimationFrame(raf.id);
|
|
3200
3224
|
ro.disconnect();
|
|
3201
3225
|
};
|
|
3202
|
-
}, [isCurveLayout, contentKey, capHeightPx,
|
|
3226
|
+
}, [isCurveLayout, contentKey, capHeightPx, textFontSize, useMarqueeTrack]);
|
|
3203
3227
|
|
|
3204
3228
|
useLayoutEffect(() => {
|
|
3205
3229
|
if (!useMarqueeTrack || animationDistance <= 0) return;
|
|
@@ -3363,8 +3387,8 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode }: Marq
|
|
|
3363
3387
|
// previously culled glyphs into view; they need a frame to get their transform.
|
|
3364
3388
|
}, [waveShouldLoop, direction]);
|
|
3365
3389
|
|
|
3366
|
-
const onTrackEnter = () => {
|
|
3367
|
-
if (hoverPauseEnabled) setIsHovering(true);
|
|
3390
|
+
const onTrackEnter = (e: ReactPointerEvent) => {
|
|
3391
|
+
if (hoverPauseEnabled && e.pointerType === 'mouse') setIsHovering(true);
|
|
3368
3392
|
};
|
|
3369
3393
|
const onTrackLeave = () => {
|
|
3370
3394
|
if (hoverPauseEnabled) setIsHovering(false);
|
|
@@ -3428,12 +3452,17 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode }: Marq
|
|
|
3428
3452
|
<div ref={ribbonRef} className={\`\${P}-ribbon\`} style={ribbonStyle} aria-hidden />
|
|
3429
3453
|
);
|
|
3430
3454
|
|
|
3455
|
+
const itemTextCss: CSSProperties = {
|
|
3456
|
+
...textCss,
|
|
3457
|
+
lineHeight: capHeightPx > 0 ? \`\${capHeightPx}px\` : \`\${DEFAULT_CAP_HEIGHT_RATIO}em\`,
|
|
3458
|
+
};
|
|
3459
|
+
|
|
3431
3460
|
const renderItem = (item: MarqueeTextItem, copyIndex: number, slotIndex: number) => (
|
|
3432
3461
|
<MarqueeTextItemView
|
|
3433
3462
|
key={\`\${copyIndex}-\${slotIndex}\`}
|
|
3434
3463
|
item={item}
|
|
3435
3464
|
prefix={P}
|
|
3436
|
-
textCss={
|
|
3465
|
+
textCss={itemTextCss}
|
|
3437
3466
|
capHeightPx={capHeightPx}
|
|
3438
3467
|
opticalOffsetY={opticalOffsetY}
|
|
3439
3468
|
imageGapPx={scaled(gap)}
|
|
@@ -3452,8 +3481,8 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode }: Marq
|
|
|
3452
3481
|
ref={trackRef}
|
|
3453
3482
|
className={\`\${P}-marquee-track\`}
|
|
3454
3483
|
data-direction={direction}
|
|
3455
|
-
|
|
3456
|
-
|
|
3484
|
+
onPointerEnter={onTrackEnter}
|
|
3485
|
+
onPointerLeave={onTrackLeave}
|
|
3457
3486
|
style={{
|
|
3458
3487
|
WebkitAnimationDuration: durationS,
|
|
3459
3488
|
animationDuration: durationS,
|
|
@@ -3520,7 +3549,6 @@ export type MarqueeTextSettings = {
|
|
|
3520
3549
|
fontStyle: string;
|
|
3521
3550
|
};
|
|
3522
3551
|
textFontSize: number;
|
|
3523
|
-
textLineHeight: number;
|
|
3524
3552
|
textLetterSpacing: number;
|
|
3525
3553
|
textWordSpacing: number;
|
|
3526
3554
|
textTextAppearance: {
|
|
@@ -3539,7 +3567,7 @@ type MarqueeTextProps = {
|
|
|
3539
3567
|
isPreviewMode?: boolean;
|
|
3540
3568
|
isEditMode?: boolean;
|
|
3541
3569
|
} & CommonComponentProps;
|
|
3542
|
-
`,dy={fontSettings:{type:"object",scope:"common",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},uy={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"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,display:{type:"numeric-input"}},ribbonWidth:{type:"number",scope:"layout",title:"Ribbon Width",min:0,display:{type:"numeric-input"}},layoutType:{type:"string",scope:"common",title:"Path Type",display:{type:"toggle-cycle",enum:["straight","curve"]}},curveAmplitude:{type:"number",scope:"layout",title:"Amplitude",min:-30,max:30,step:1,display:{type:"common-numeric-input",visible:!1}},curveFrequency:{type:"number",scope:"layout",title:"Frequency",min:0,max:100,step:1,display:{type:"common-numeric-input",visible:!1}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...dy.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},
|
|
3570
|
+
`,dy={fontSettings:{type:"object",scope:"common",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},uy={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"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,display:{type:"numeric-input"}},ribbonWidth:{type:"number",scope:"layout",title:"Ribbon Width",min:0,display:{type:"numeric-input"}},layoutType:{type:"string",scope:"common",title:"Path Type",display:{type:"toggle-cycle",enum:["straight","curve"]}},curveAmplitude:{type:"number",scope:"layout",title:"Amplitude",min:-30,max:30,step:1,display:{type:"common-numeric-input",visible:!1}},curveFrequency:{type:"number",scope:"layout",title:"Frequency",min:0,max:100,step:1,display:{type:"common-numeric-input",visible:!1}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...dy.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},textLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Text Color"},backgroundColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Ribbon Color"}},defaults:{direction:"left",pauseOnHover:"off",layoutType:"curve",textFontFamily:"Antique Série",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#FFFFFF",backgroundColor:"#2E12F0"},layoutDefaults:{m:{speed:.55,gap:.04,ribbonWidth:.08,curveAmplitude:6,curveFrequency:15,textFontSize:.08},t:{speed:1.3,gap:.02,ribbonWidth:.11,curveAmplitude:5,curveFrequency:15,textFontSize:.07},d:{speed:2.5,gap:.02,ribbonWidth:.11,curveAmplitude:5,curveFrequency:18,textFontSize:.071}},displayRules:[{if:{name:"layoutType",value:"curve"},then:{name:"properties.curveAmplitude.display.visible",value:!0}},{if:{name:"layoutType",value:"curve"},then:{name:"properties.curveFrequency.display.visible",value:!0}}],layout:["__componentName__","speed","direction","pauseOnHover","gap","ribbonWidth","layoutType","curveAmplitude","curveFrequency"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["direction","speed"]},{type:"row",items:["ribbonWidth","gap"]},{type:"row",items:["pauseOnHover","layoutType"]},{type:"row",items:["curveAmplitude","curveFrequency"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","textFontFamily","textFontSettings",{type:"row",items:["textFontSize","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}],paletteBookmark:{items:["textColor","backgroundColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{text:{placeholder:"Add text...",label:"Text",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{type:"media-input"}},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}}},default:[{text:"NEW WORK",image:{url:"https://cdn.cntrl.site/component-assets/marquee_text_icon.svg",name:""},link:""}]}},py={element:ly,id:"marquee-text",name:"Marquee Text",category:"typography",version:1,defaultSize:{d:{width:"100%"},t:{width:"100%"},m:{width:"100%"}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Text_Marquee.mp4"},schema:uy,sourceCode:cy,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily"}};function my(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
3543
3571
|
.${e}-marquee-wrapper {
|
|
3544
3572
|
overflow: hidden;
|
|
3545
3573
|
width: 100%;
|
|
@@ -3628,7 +3656,7 @@ type MarqueeTextProps = {
|
|
|
3628
3656
|
pointer-events: auto;
|
|
3629
3657
|
z-index: 10;
|
|
3630
3658
|
}
|
|
3631
|
-
`}const gy=30,fc=2,hy=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")},fy=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=F.useScopedStyles(),{align:l,speed:c,direction:d,pauseOnHover:u,gap:p,cardWidth:y,corners:v,stroke:m,strokeColor:g,bgColor:x,padding:b,logoMarginTop:k,logoWidth:f,logoHeight:S,captionMarginTop:
|
|
3659
|
+
`}const gy=30,fc=2,hy=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")},fy=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=F.useScopedStyles(),{align:l,speed:c,direction:d,pauseOnHover:u,gap:p,cardWidth:y,corners:v,stroke:m,strokeColor:g,bgColor:x,padding:b,logoMarginTop:k,logoWidth:f,logoHeight:S,captionMarginTop:W}=e,U=!!o,B=((t==null?void 0:t.length)??0)>0,P=c>0&&(!n||i),_=B&&(P||n),G=Math.max(0,c)*gy,$=R=>F.scalingValue(R,n??!1),L=s.useRef(null),D=s.useRef(null),E=s.useRef(null),[T,C]=s.useState(0),[V,w]=s.useState(0),q=V>0?V:0,I=s.useMemo(()=>my(r,q),[r,q]),[A,j]=s.useState(0),ie=P&&u==="on",[ae,O]=s.useState(!1),oe=s.useRef(null),[N,le]=s.useState(0),[Q,be]=s.useState(0),Pe=s.useRef(null),ye=R=>{var te,me,X,Ie,Se;return{fontSettings:{fontFamily:(e==null?void 0:e[`${R}FontFamily`])??"Arial",fontWeight:((te=e==null?void 0:e[`${R}FontSettings`])==null?void 0:te.fontWeight)??400,fontStyle:((me=e==null?void 0:e[`${R}FontSettings`])==null?void 0:me.fontStyle)??"normal"},textAppearance:{textTransform:((X=e==null?void 0:e[`${R}TextAppearance`])==null?void 0:X.textTransform)??"none",textDecoration:((Ie=e==null?void 0:e[`${R}TextAppearance`])==null?void 0:Ie.textDecoration)??"none",fontVariant:((Se=e==null?void 0:e[`${R}TextAppearance`])==null?void 0:Se.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${R}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${R}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${R}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${R}LineHeight`])??.01,color:(e==null?void 0:e[`${R}Color`])??"#000000"}},ce=ye("text"),Y=ye("caption"),se=s.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(R=>{var ee,te;return(((ee=R.text)==null?void 0:ee.length)??0)>0||(((te=R.caption)==null?void 0:te.length)??0)>0}),[t]),pe=s.useMemo(()=>!_||(t==null?void 0:t.length)===0?1:V<=0||T<=0?fc:Math.max(fc,Math.ceil(T/V)+1),[_,t==null?void 0:t.length,V,T]);s.useLayoutEffect(()=>{if(!_)return;const R=L.current,ee=E.current;if(!R||!ee)return;let te=0;const me=()=>{const Se=R.getBoundingClientRect().width,J=ee.getBoundingClientRect().width,He=Pe.current,We=typeof He=="number"&&Math.abs(He-J)<=.25;if(Pe.current=J,C(Se),typeof J=="number"&&J>0&&V<=0){w(J);return}We&&J!==V?w(J):!We&&V<=0&&(cancelAnimationFrame(te),te=requestAnimationFrame(me))},X=()=>{cancelAnimationFrame(te),te=requestAnimationFrame(me)};X();const Ie=new ResizeObserver(X);return Ie.observe(R),Ie.observe(ee),()=>{cancelAnimationFrame(te),Ie.disconnect()}},[P,_,V]);const fe=q>0&&G>0?q/G*1e3:0,we=`${Math.max(0,fe)/1e3}s`;s.useLayoutEffect(()=>{if(!_||q<=0)return;const R=D.current;R&&hy(R)},[_,q,d]),s.useLayoutEffect(()=>{if(!_){j(0);return}const R=E.current,ee=D.current;if(!R||!ee)return;const te=()=>{let X=0;for(let Ie=0;Ie<R.children.length;Ie++){const J=R.children[Ie].firstElementChild;J&&(X=Math.max(X,J.offsetHeight))}X<=0&&(X=ee.offsetHeight),j(X>0?X:0)};te();const me=new ResizeObserver(te);return me.observe(R),me.observe(ee),()=>{me.disconnect()}},[_,pe,t,n,p,y,b,m,v,f,S,N,Q]);const Re=()=>{ie&&O(!0)},ge=()=>{ie&&O(!1)},xe=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),Ce=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]),h=s.useCallback((R,ee,te,me)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:xe,width:"100%"},children:[a.jsx("div",{"data-controls":U?me==null?void 0:me.controlsName:void 0,"data-controls-axis":U?"y":void 0,className:U?`${r}-control`:void 0,style:{height:$((me==null?void 0:me.marginTop)??0)}}),a.jsx("div",{...me!=null&&me.dataMeasureKind?{"data-testimonial-measure":me.dataMeasureKind}:{},style:{...Qt(R,n),textAlign:Ce,pointerEvents:"auto",...typeof(me==null?void 0:me.minHeightPx)=="number"&&me.minHeightPx>0?{minHeight:me.minHeightPx}:{}},children:a.jsx(Ki,{content:ee})})]},te),[xe,Ce,n,U,r,$]),K=s.useCallback((R,ee,te)=>{var me,X,Ie;return a.jsxs("div",{style:{padding:`${$(b.top)} ${$(b.right)} ${$(b.bottom)} ${$(b.left)}`,width:$(y+m*2),height:"100%",borderRadius:$(v),border:`${$(m)} solid ${g}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[a.jsx("div",{className:`${r}-cover`,style:{background:x}}),a.jsxs("div",{className:`${r}-elements-overlay`,style:{alignItems:xe,textAlign:Ce},children:[R.text&&h(ce,R.text,"text",te!=null&&te.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(te==null?void 0:te.textMinHeightPx)=="number"&&te.textMinHeightPx>0?{minHeightPx:te.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:xe,width:"100%"},children:[a.jsx("div",{"data-controls":U&&!(te!=null&&te.dataMeasureAttrs)?"logoMarginTop":void 0,className:U&&!(te!=null&&te.dataMeasureAttrs)?`${r}-control`:void 0,style:{height:$(k)}}),a.jsx("div",{style:{width:$(f),height:$(S)},children:((me=R.logo)==null?void 0:me.url)&&a.jsx("img",{src:R.logo.url,alt:((X=R.logo)==null?void 0:X.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((Ie=R.logo)==null?void 0:Ie.objectFit)||"contain"}})})]}),R.caption&&h(Y,R.caption,"caption",{...te!=null&&te.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:W,...te!=null&&te.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(te==null?void 0:te.captionMinHeightPx)=="number"&&te.captionMinHeightPx>0?{minHeightPx:te.captionMinHeightPx}:{}})]})]},ee)},[x,W,Y,y,v,S,k,f,xe,Ce,b.bottom,b.left,b.right,b.top,h,m,g,ce,n,U,r]),Z=s.useCallback(R=>{le(R.maxTextPx),be(R.maxCaptionPx)},[]);s.useLayoutEffect(()=>{if(!se){Z({maxTextPx:0,maxCaptionPx:0});return}const R=oe.current;if(!R)return;const ee=()=>{F.readTestimonialTextMeasure(R,Z)};ee();const te=new ResizeObserver(ee);return te.observe(R),()=>{te.disconnect()}},[se,Z,t,K]);const ne=se?{textMinHeightPx:N,captionMinHeightPx:Q}:void 0,de=se?a.jsx("div",{ref:oe,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((R,ee)=>K(R,`measure-${ee}`,{dataMeasureAttrs:!0}))}):null,z=(R,ee)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[K(R,`card-${ee}`,ne),U&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${$(p)})`,width:$(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},ee);if(_){const R=P?ie&&ae?"paused":"running":"paused";return a.jsxs("div",{ref:L,className:Ct(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...A>0?{height:A}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:I}}),de,a.jsx("div",{ref:D,className:`${r}-marquee-track`,"data-direction":d,onMouseEnter:Re,onMouseLeave:ge,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px",animationDuration:we,WebkitAnimationDuration:we,animationPlayState:R,WebkitAnimationPlayState:R},children:Array.from({length:pe},(ee,te)=>a.jsx("div",{ref:te===0?E:void 0,className:`${r}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:$(p),paddingRight:$(p)},"aria-hidden":te>0,children:t==null?void 0:t.map((me,X)=>z(me,`${te}-${X}`))},`set-${te}`))})]})}return a.jsxs("div",{className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:I}}),de,a.jsx("div",{style:{gap:$(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((R,ee)=>z(R,ee))})]})},yy=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3632
3660
|
import cn from 'classnames';
|
|
3633
3661
|
import { CommonComponentProps } from '../props';
|
|
3634
3662
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -4383,7 +4411,7 @@ type TestimonialsSettings = {
|
|
|
4383
4411
|
width: 100%;
|
|
4384
4412
|
height: 100%;
|
|
4385
4413
|
}
|
|
4386
|
-
`}const Sy=3e3,wy=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=F.useScopedStyles(),l=t||[],{speed:c,align:d,width:u,imageMarginTop:p,textMarginTop:y,captionMarginTop:v,imageWidth:m,imageHeight:g,controlsWidth:x,controlsColor:b,controlsHoverColor:k}=e,f=c>0&&(!n||!!i),[S,
|
|
4414
|
+
`}const Sy=3e3,wy=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=F.useScopedStyles(),l=t||[],{speed:c,align:d,width:u,imageMarginTop:p,textMarginTop:y,captionMarginTop:v,imageWidth:m,imageHeight:g,controlsWidth:x,controlsColor:b,controlsHoverColor:k}=e,f=c>0&&(!n||!!i),[S,W]=s.useState(0),[U,B]=s.useState(null),[P,_]=s.useState(!1),G=s.useRef(null),$=s.useMemo(()=>{switch(d){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[d]),L=s.useMemo(()=>{switch(d){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[d]);s.useEffect(()=>{W(0),B(null),_(!1)},[l.length]);const D=l[S],E=U===null?null:l[U],T=ye=>{var Y,se,pe,fe,we;return{fontSettings:{fontFamily:(e==null?void 0:e[`${ye}FontFamily`])??"Arial",fontWeight:((Y=e==null?void 0:e[`${ye}FontSettings`])==null?void 0:Y.fontWeight)??400,fontStyle:((se=e==null?void 0:e[`${ye}FontSettings`])==null?void 0:se.fontStyle)??"normal"},textAppearance:{textTransform:((pe=e==null?void 0:e[`${ye}TextAppearance`])==null?void 0:pe.textTransform)??"none",textDecoration:((fe=e==null?void 0:e[`${ye}TextAppearance`])==null?void 0:fe.textDecoration)??"none",fontVariant:((we=e==null?void 0:e[`${ye}TextAppearance`])==null?void 0:we.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${ye}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${ye}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${ye}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${ye}WordSpacing`])??0,color:(e==null?void 0:e[`${ye}Color`])??"#000000"}},C=T("text"),V=T("caption"),w=l.length>1&&l.some(ye=>{var ce,Y;return(((ce=ye.text)==null?void 0:ce.length)??0)>0||(((Y=ye.caption)==null?void 0:Y.length)??0)>0}),q=s.useRef(null),[I,A]=s.useState(0),[j,ie]=s.useState(0),ae=e.controls??{mode:"Off",icon:null},O=l.length>1,oe=s.useCallback((ye,ce)=>!O||ce===ye?ye:(G.current&&window.clearTimeout(G.current),B(ye),_(!0),G.current=window.setTimeout(()=>{B(null),_(!1),G.current=null},300),ce),[O]),N=s.useCallback(()=>{O&&W(ye=>oe(ye,(ye-1+l.length)%l.length))},[O,oe,l.length]),le=s.useCallback(()=>{O&&W(ye=>oe(ye,(ye+1)%l.length))},[O,oe,l.length]);s.useEffect(()=>{if(!f||!O)return;const ye=Math.max(300,Sy/c),ce=window.setInterval(()=>{W(Y=>oe(Y,(Y+1)%l.length))},ye);return()=>{window.clearInterval(ce)}},[f,O,oe,l.length,c]),s.useEffect(()=>()=>{G.current&&window.clearTimeout(G.current)},[]);const Q=(ye,ce)=>{var we,Re,ge,xe;const Y=ce==null?void 0:ce.textMinHeightPx,se=ce==null?void 0:ce.captionMinHeightPx,pe=ce==null?void 0:ce.dataMeasureAttrs,fe=o&&!(ce!=null&&ce.dataMeasureAttrs)&&!(ce!=null&&ce.hideControls);return a.jsxs(a.Fragment,{children:[ye.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":fe?"textMarginTop":void 0,className:fe?`${r}-control`:void 0,style:{height:F.scalingValue(y??0,n??!1)}}),a.jsx("div",{...pe&&{"data-testimonial-measure":"text"},style:{...Qt(C,n),...Y&&Y>0?{minHeight:Y}:{},textAlign:L,pointerEvents:"auto"},children:a.jsx(Ki,{content:ye.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":fe?"imageMarginTop":void 0,className:fe?`${r}-control`:void 0,style:{height:F.scalingValue(p??0,n??!1)}}),a.jsx("div",{style:{width:F.scalingValue(m??0,n??!1),height:F.scalingValue(g??0,n??!1)},children:((we=ye.image)==null?void 0:we.url)&&a.jsx("img",{src:(Re=ye.image)==null?void 0:Re.url,alt:((ge=ye.image)==null?void 0:ge.name)??"",className:`${r}-icon`,style:{objectFit:((xe=ye.image)==null?void 0:xe.objectFit)||"contain"}})})]}),ye.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":fe?"captionMarginTop":void 0,className:fe?`${r}-control`:void 0,style:{height:F.scalingValue(v??0,n??!1)}}),a.jsx("div",{...pe?{"data-testimonial-measure":"caption"}:{},style:{...Qt(V,n),...se&&se>0?{minHeight:se}:{},textAlign:L,pointerEvents:"auto"},children:a.jsx(Ki,{content:ye.caption})})]})]})},be=s.useCallback(ye=>{A(ye.maxTextPx),ie(ye.maxCaptionPx)},[]);if(s.useLayoutEffect(()=>{if(!w){be({maxTextPx:0,maxCaptionPx:0});return}const ye=q.current;if(!ye)return;const ce=()=>{F.readTestimonialTextMeasure(ye,be)};ce();const Y=new ResizeObserver(ce);return Y.observe(ye),()=>{Y.disconnect()}},[w,be,t]),!D)return a.jsx(a.Fragment,{});const Pe=w?{textMinHeightPx:I,captionMinHeightPx:j}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${r}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:by(r)}}),a.jsxs("div",{className:`${r}-wrapper`,style:{width:F.scalingValue(u??0,n??!1),alignItems:$},children:[w&&a.jsx("div",{ref:q,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((ye,ce)=>a.jsx("div",{style:{width:"100%"},children:Q(ye,{dataMeasureAttrs:!0})},ce))}),a.jsxs("div",{className:`${r}-fade-stack`,children:[E&&P&&a.jsx("div",{className:Ct(`${r}-fade-item-prev`,`${r}-fade-out`),children:Q(E,{...Pe,hideControls:!0})}),a.jsx("div",{className:Ct(`${r}-fade-item-current`,P?`${r}-fade-in`:void 0),children:Q(D,Pe)})]})]}),ae.mode==="On"&&a.jsxs("div",{className:`${r}-controls`,children:[a.jsx("div",{className:`${r}-arrow`,style:{width:F.scalingValue(x??.02,n??!1),height:F.scalingValue(x??.02,n??!1),"--arrow-hover-color":k},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:N,disabled:!O,"aria-label":"Previous testimonial",children:ae.icon&&a.jsx(mn,{url:ae.icon,fill:b,hoverFill:k,className:Ct(`${r}-arrow-img`,`${r}-mirror`)})})}),a.jsx("div",{className:Ct(`${r}-arrow`,`${r}-next-arrow`),style:{width:F.scalingValue(x??.02,n??!1),height:F.scalingValue(x??.02,n??!1),"--arrow-hover-color":k},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:le,disabled:!O,"aria-label":"Next testimonial",children:ae.icon&&a.jsx(mn,{url:ae.icon,fill:b,hoverFill:k,className:`${r}-arrow-img`})})})]})]})})},$y=`import cn from 'classnames';
|
|
4387
4415
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
4388
4416
|
import { CommonComponentProps } from '../props';
|
|
4389
4417
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -4879,7 +4907,7 @@ type TestimonialsSettings = {
|
|
|
4879
4907
|
icon?: string | null;
|
|
4880
4908
|
};
|
|
4881
4909
|
};
|
|
4882
|
-
`,Cy="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>'),vc={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Ty={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:{...vc.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:{...vc.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:Cy},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"}]}]}]}},Ly={element:wy,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:Ty,sourceCode:$y,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function Py(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function xc(e){return((e==null?void 0:e.trim().length)??0)>0}function
|
|
4910
|
+
`,Cy="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>'),vc={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Ty={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:{...vc.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:{...vc.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:Cy},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"}]}]}]}},Ly={element:wy,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:Ty,sourceCode:$y,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function Py(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function xc(e){return((e==null?void 0:e.trim().length)??0)>0}function Qa(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function es(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:F.scalingValue((o-t)/2,i)}}function Iy(e){return`
|
|
4883
4911
|
.${e}-wrapper {
|
|
4884
4912
|
display: grid;
|
|
4885
4913
|
align-items: start;
|
|
@@ -5226,7 +5254,7 @@ type TestimonialsSettings = {
|
|
|
5226
5254
|
z-index: 2;
|
|
5227
5255
|
width: 100%;
|
|
5228
5256
|
}
|
|
5229
|
-
`}function Ry(){return Math.random()<.5?"ltr":"ttb"}function ky(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function Ey(e){const t=Ry();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{ky(e)})})}const En=500,My=750,ui="cubic-bezier(0.22, 1, 0.36, 1)",Ay=72,Fy=50;function Ny(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 _y(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Hy(e){const[t]=e.media;return t!=null&&t.url?t:null}function Du(e){return!Array.isArray(e)||e.length===0?[]:Ny(e)?e.flatMap(t=>{const n=_y(t);if(!n)return[];const i=Hy(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 Xi(e){return e.type==="video"}function Wy(e){const t=new Set,n=[];for(const i of e){const o=Du(i.gallery);for(const r of o){const l=r.lightboxMedia;l!=null&&l.url&&!t.has(l.url)&&(t.add(l.url),n.push(l))}}return n}function Oy({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Xi(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function Dy(e){e.pause(),e.removeAttribute("src"),e.load()}function bc({media:e,className:t,style:n,onMediaClick:i}){return Xi(e)?a.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):a.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function Sc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function zy(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 r=e.width/n;return{width:e.width,height:r,left:e.left,top:e.top+(e.height-r)/2}}const o=e.height*n;return{width:o,height:e.height,left:e.left+(e.width-o)/2,top:e.top}}function By({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const c=n.current;if(c)return()=>{Dy(c)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,style:i})}function jy({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:c,counterClassName:d,counterStyle:u}){const p=i==="cover",y=s.useRef(null),v=s.useRef(null),m=s.useRef(null),g=s.useRef(null),x=s.useRef(0),b=s.useRef(0),k=s.useRef("none"),f=s.useRef(!1),S=s.useRef(!1),O=s.useRef(null),U=s.useRef(0),z=s.useRef(null),I=s.useRef(!1),N=s.useRef(null),q=s.useRef(null),$=s.useRef(null),L=s.useRef(()=>{}),[D,_]=s.useState(null),[C,T]=s.useState(null),[B,w]=s.useState("opening"),[X,R]=s.useState(0),[E,V]=s.useState(0),[ie,re]=s.useState(null),[W,ae]=s.useState(!1),[A,le]=s.useState(!1),[ee,xe]=s.useState(!1),[Pe,ye]=s.useState(null),pe=s.useRef(n),Y=s.useRef(void 0),se=t[n],de=se?Xi(se):!1,ve=E!==0||W,$e=ie!==null,ke=s.useCallback(we=>{const Ne=we.currentTarget,Ue=Ne instanceof HTMLVideoElement?{width:Ne.videoWidth,height:Ne.videoHeight}:{width:Ne.naturalWidth,height:Ne.naturalHeight};!Ue.width||!Ue.height||ye(Ue)},[]);s.useEffect(()=>{O.current=C},[C]),s.useEffect(()=>{const we=y.current;if(!we)return;const Ne=()=>T(Sc(we));Ne();const Ue=new ResizeObserver(Ne);return Ue.observe(we),()=>Ue.disconnect()},[]);const he=s.useCallback(()=>{N.current!==null&&(window.clearTimeout(N.current),N.current=null)},[]),Se=s.useCallback(()=>{const we=q.current;q.current=null,he(),z.current=null,I.current=!1,re(null),ae(!1),V(0),U.current=0,le(!1),f.current=!1,b.current=0,k.current="none",we===1?c():we===-1&&l()},[he,c,l]),Ce=s.useCallback(()=>{he(),q.current=null,z.current=null,I.current=!1,re(null),ae(!1),V(0),U.current=0},[he]),h=s.useCallback(()=>{he(),N.current=window.setTimeout(()=>{q.current!==null&&Se()},En+32)},[he,Se]),K=s.useCallback((we,Ne)=>{var Je;const Ue=((Je=O.current)==null?void 0:Je.width)??0;if(he(),z.current=we,re(we),I.current=!0,ae(!0),Ne){q.current=we;const st=-we*Ue;U.current=st,V(st),h();return}U.current=0,V(0),N.current=window.setTimeout(()=>{N.current=null,Ce()},En+32)},[he,Ce,h]),Z=s.useCallback(we=>{if(!(t.length<=1)){if(I.current){if(q.current===we){$.current=we,Se();return}Ce()}he(),z.current=we,re(we),I.current=!1,ae(!1),U.current=0,V(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{K(we,!0)})})}},[t.length,K,Se,Ce,he]);L.current=Z;const te=s.useCallback(we=>{we.propertyName!=="transform"||!I.current||q.current!==null&&Se()},[Se]),me=s.useCallback(()=>{const we=v.current;if(!we)return;const Ne=Sc(we);!Ne.width||!Ne.height||_(Ne)},[]);s.useEffect(()=>{me();const we=v.current;if(!we)return;const Ne=new ResizeObserver(()=>me());return Ne.observe(we),()=>Ne.disconnect()},[me]),s.useEffect(()=>{B==="opening"&&D&&w("open")},[B,D]),s.useEffect(()=>{if(B!=="closing")return;const we=setTimeout(()=>r(),En);return()=>clearTimeout(we)},[B,r]),s.useEffect(()=>()=>{he()},[he]),s.useLayoutEffect(()=>{pe.current===n&&Y.current===(se==null?void 0:se.url)||(he(),q.current=null,re(null),R(0),V(0),ae(!1),xe(!1),le(!1),ye(null),x.current=0,b.current=0,k.current="none",f.current=!1,I.current=!1,U.current=0,z.current=null,g.current=null,S.current=!1,pe.current=n,Y.current=se==null?void 0:se.url)},[n,se==null?void 0:se.url,he]),s.useLayoutEffect(()=>{const we=$.current;we!==null&&($.current=null,requestAnimationFrame(()=>{L.current(we)}))},[n,se==null?void 0:se.url]),s.useEffect(()=>{if(B!=="open")return;let we=null;const Ne=()=>{we&&(document.removeEventListener("click",we,!0),we=null)},Ue=()=>{Ne(),we=Ae=>{Ae.stopPropagation(),Ae.preventDefault(),Ne()},document.addEventListener("click",we,!0)},Je=Ae=>{const gt=Ae<0?1:-1;if(Math.abs(Ae)>Fy&&t.length>1){K(gt,!0);return}K(gt,!1)},st=Ae=>{if(Ae.touches.length!==1||I.current)return;const gt=Ae.touches[0];S.current=!0,g.current={x:gt.clientX,y:gt.clientY},k.current="none",b.current=0,f.current=!1},it=Ae=>{if(!g.current||Ae.touches.length!==1||I.current)return;const gt=Ae.touches[0],ze=gt.clientX-g.current.x,De=gt.clientY-g.current.y;if(k.current==="none"){if(Math.abs(ze)<10&&Math.abs(De)<10)return;if(Math.abs(ze)>Math.abs(De)){if(t.length<=1)return;k.current="horizontal"}else if(De>0)k.current="vertical";else return}if(k.current==="horizontal"){f.current=!0,le(!0),b.current=ze;const Xe=ze<0?1:-1;z.current!==Xe&&(z.current=Xe,re(Xe)),U.current=ze,V(ze),Ae.preventDefault();return}k.current==="vertical"&&(f.current=!0,le(!0),x.current=De,R(De),Ae.preventDefault())},Oe=()=>{if(!g.current)return;const Ae=k.current,gt=f.current;if(gt&&Ae==="horizontal")Je(b.current),Ue();else if(gt&&Ae==="vertical")if(x.current>Ay){const De=window.innerHeight;x.current=De,xe(!0),R(De),w("closing")}else x.current=0,R(0),Ue();else Ae==="horizontal"&&Math.abs(b.current)>0&&(Je(b.current),Ue());g.current=null,k.current="none",b.current=0,f.current=!1,le(!1)};return document.addEventListener("touchstart",st,{passive:!0}),document.addEventListener("touchmove",it,{passive:!1}),document.addEventListener("touchend",Oe),document.addEventListener("touchcancel",Oe),()=>{document.removeEventListener("touchstart",st),document.removeEventListener("touchmove",it),document.removeEventListener("touchend",Oe),document.removeEventListener("touchcancel",Oe),Ne()}},[B,t.length,K]),s.useEffect(()=>{const we=Ne=>{Ne.key==="Escape"&&(Ne.preventDefault(),Ne.stopPropagation(),B!=="closing"&&w("closing"))};return window.addEventListener("keydown",we,!0),()=>window.removeEventListener("keydown",we,!0)},[B]);const j=()=>{B!=="closing"&&w("closing")},P=B==="open",Q=B==="closing",ne=X>0?Math.max(0,1-X/500):1,ue=X>0?Math.max(.35,1-X/500):1,G=D?p?D:zy(D,Pe):null,Ie=we=>{if(we.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const Ne=G??we.currentTarget.getBoundingClientRect(),Ue=we.clientY-Ne.top,Je=Math.min(52,Ne.height*.2);if(!(Ue>Ne.height-Je)){if(we.clientX-Ne.left<Ne.width/2){Z(-1);return}Z(1)}},be=we=>{if(t.length<=1)return;const Ne=G??we.currentTarget.getBoundingClientRect(),Ue=we.clientX-Ne.left,Je=we.clientY-Ne.top,st=Math.min(52,Ne.height*.2);if(Je>Ne.height-st){we.currentTarget.style.cursor="default";return}we.currentTarget.style.cursor=Ue<Ne.width/2?"w-resize":"e-resize"},J={position:"fixed",top:C==null?void 0:C.top,left:C==null?void 0:C.left,width:C==null?void 0:C.width,height:C==null?void 0:C.height,zIndex:9998},He=p?"cover":"contain",We=E!==0||X>0?`translate(${E}px, ${X}px)`:void 0,ot=A&&!W?"none":W?`transform ${En}ms ${ui}`:ee?`transform ${En}ms ${ui}, opacity ${En}ms ${ui}`:B==="opening"||Q?`opacity ${En}ms ${ui}`:"none",qe={...J,transform:We,opacity:X>0?ue:B==="opening"||Q?0:1,transition:ot,pointerEvents:"none"},tt={position:"absolute",top:((G==null?void 0:G.top)??0)-((C==null?void 0:C.top)??0),left:((G==null?void 0:G.left)??0)-((C==null?void 0:C.left)??0),width:G==null?void 0:G.width,height:G==null?void 0:G.height,objectFit:He,pointerEvents:de&&P&&!ve?"auto":"none",touchAction:de&&P?"none":void 0},et=(C==null?void 0:C.width)??0,je=$e?(n+ie+t.length)%t.length:null,fe=je!==null?t[je]:null,_e={...J,transform:$e?`translateX(${ie*et+E}px)`:void 0,opacity:1,transition:W?`transform ${En}ms ${ui}`:"none",pointerEvents:"none"},Be={position:"absolute",top:((D==null?void 0:D.top)??0)-((C==null?void 0:C.top)??0),left:((D==null?void 0:D.left)??0)-((C==null?void 0:C.left)??0),width:D==null?void 0:D.width,height:D==null?void 0:D.height,objectFit:He,pointerEvents:"none"},Ze=G?{position:"fixed",top:G.top,height:G.height,width:G.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:y,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:B==="open"?"none":void 0},onClick:j,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:P?ne:0,transition:A?"none":`opacity ${En}ms ${ui}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:p?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:v,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:P?1:0,transition:`opacity ${En}ms ${ui}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:d,style:u,children:[n+1," / ",t.length]})})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:v,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:P?1:0,transition:`opacity ${En}ms ${ui}`},children:t.length>1&&a.jsxs("p",{className:d,style:u,children:[n+1," / ",t.length]})})]})}),D&&C&&fe&&a.jsx("div",{style:_e,onTransitionEnd:te,children:Xi(fe)?a.jsx("video",{src:fe.url,muted:!0,playsInline:!0,preload:"auto",style:Be},`neighbor-${je}-${fe.url}`):a.jsx("img",{src:fe.url,alt:fe.name,style:Be},`neighbor-${je}-${fe.url}`)}),D&&C&&se&&a.jsx("div",{style:qe,onTransitionEnd:te,children:de?a.jsx(By,{src:se.url,phase:B,mediaRef:m,mediaStyle:tt,onLoadedMetadata:ke,onClick:Ie,onMouseMove:be},`${n}-${se.url}`):a.jsx("img",{ref:m,src:se.url,alt:se.name,onLoad:ke,style:tt},`${n}-${se.url}`)}),P&&Ze&&t.length>1&&!de&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ze,left:G.left,cursor:"w-resize",pointerEvents:A?"none":"auto"},onClick:we=>{if(S.current){S.current=!1;return}we.stopPropagation(),Z(-1)}}),a.jsx("div",{style:{...Ze,left:G.left+G.width/2,cursor:"e-resize",pointerEvents:A?"none":"auto"},onClick:we=>{if(S.current){S.current=!1;return}we.stopPropagation(),Z(1)}})]})]})}function Vy(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Gy({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:c,portalId:d}){const{prefix:u}=F.useScopedStyles(),{type:p="a",gridLayout:y,textBoxWidth:v=100,verticalGap:m,entriesCount:g,lightbox:x,imageDisplay:b,imageCorners:k,lightboxImageDisplay:f,slider:S,sliderTiming:O,direction:U,transition:z,titleMarginTop:I,subtitleMarginTop:N,titleColor:q,subtitleColor:$,lightboxCounterColor:L,titleFontFamily:D,titleFontSettings:_,titleFontSize:C,titleLineHeight:T,titleLetterSpacing:B,titleWordSpacing:w,titleTextAppearance:X,subtitleFontFamily:R,subtitleFontSettings:E,subtitleFontSize:V,subtitleLineHeight:ie,subtitleLetterSpacing:re,subtitleWordSpacing:W,subtitleTextAppearance:ae,lightboxCounterFontFamily:A,lightboxCounterFontSettings:le,lightboxCounterFontSize:ee,lightboxCounterLineHeight:xe,lightboxCounterLetterSpacing:Pe,lightboxCounterWordSpacing:ye,lightboxCounterTextAppearance:pe,showText:Y="always",alignEntries:se="off",align:de="top"}=e,ve={fontSettings:{fontFamily:D,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:C??.01,lineHeight:T,letterSpacing:B??0,wordSpacing:w??0,textAppearance:X,color:q},ke={...dn(Qt(ve,n))},he={fontSettings:{fontFamily:R,fontWeight:(E==null?void 0:E.fontWeight)??400,fontStyle:(E==null?void 0:E.fontStyle)??"normal"},fontSize:V??.01,lineHeight:ie,letterSpacing:re??0,wordSpacing:W??0,textAppearance:ae,color:$},Ce={...dn(Qt(he,n))},h={fontSettings:{fontFamily:A,fontWeight:(le==null?void 0:le.fontWeight)??400,fontStyle:(le==null?void 0:le.fontStyle)??"normal"},fontSize:ee??.01,lineHeight:xe,letterSpacing:Pe??0,wordSpacing:ye??0,textAppearance:pe,color:L},Z={...dn(Qt(h,n)),...Qa(ee,xe,u,n)},te=Ja(C,T,`${u}-item-title`,`${u}-text-tight-leading`),me=Ja(V,ie,`${u}-item-subtitle`,`${u}-text-tight-leading`),j=Qa(C,T,u,n),P=Qa(V,ie,u,n),Q=Ja(ee,xe,`${u}-lightbox-counter`,`${u}-text-tight-leading`),ne=F.buildColorVars(u,{titleColor:q,subtitleColor:$,lightboxCounterColor:L},Xy,qy),Ie=`${l&&l!=="default"?`${u}-state-${l}`:""}${Y==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),be=g===0?1/0:g,J=(t??[]).slice(0,be),He=s.useMemo(()=>x==="on"?Wy(J):[],[J,x]),We=y.entryWidth??.2,ot=(b==null?void 0:b.display)==="cover",qe=(b==null?void 0:b.ratioValue)??"1:1",tt=(b==null?void 0:b.reversed)??!1,[et,je]=qe.split(":").map(Number),Be=`${tt?je:et} / ${tt?et:je}`,Ze=y.columnsCount,we=F.scalingValue(We??0,n),Ne=we,Ue=!ot&&S!=="off",Je=J.length%Ze||Ze,st=Je<Ze&&J.length>0,it=J.length-Je,Oe=st?Math.floor((Ze-Je)/2)+1:1,Ae=k?F.scalingValue(k,n):void 0,gt={width:Ne,...ot?{aspectRatio:Be,height:"auto",overflow:"hidden"}:{height:"auto"},...Ae?{borderRadius:Ae,overflow:"hidden"}:{}},ze=`${u}-item-image-wrapper${Ue?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),De=p==="d"||p==="e"||p==="f",Xe=se==="on",ct=`calc(${F.scalingValue(We??0,n)} * (${v} / 100))`,ge=F.scalingValue(We*v/100,n),Ee=ot?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...Ae?{borderRadius:Ae}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...Ae?{borderRadius:Ae}:{}},[nt,pt]=s.useState(0),Ge=s.useRef(null),vt=z==="fade"||U==="horizontal"?"ltr":U==="vertical"?"ttb":"ltr";s.useEffect(()=>{const xt=Ge.current;if(!xt)return;const yt=new ResizeObserver(Me=>{pt(Math.round(Me[0].contentRect.width))});return yt.observe(xt),()=>yt.disconnect()},[]);const Rt=(()=>{const xt={...ne},yt=Ge.current?getComputedStyle(Ge.current).getPropertyValue("--cntrl-article-width").trim():"";return yt&&(xt["--cntrl-article-width"]=yt),xt})(),[At,wt]=s.useState(!1),[Vt,jt]=s.useState([]),[Kt,Yt]=s.useState(0),kt=x==="on"&&(!n||i),Bt=(xt,yt)=>{n&&!i||x!=="off"&&(jt(xt),Yt(yt),wt(!0))};s.useEffect(()=>{if(!At||x!=="on"||typeof document>"u")return;const xt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=xt}},[At,x]),s.useEffect(()=>{!n||i||wt(!1)},[n,i]);const rn=s.useMemo(()=>Iy(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:rn}}),x==="on"&&a.jsx(Oy,{mediaList:He}),a.jsx("div",{style:ne,children:a.jsx("div",{ref:Ge,className:`${u}-wrapper ${u}-type-${p}${Xe?` ${u}-align-entries`:""} ${u}-image-align-${de} ${Ie}`.trim(),style:{gridTemplateColumns:`repeat(${Ze}, ${we})`,rowGap:Xe?0:F.scalingValue(m??0,n),columnGap:F.scalingValue(y.horizontalGap??0,n),width:F.scalingValue(y.wrapperWidth??0,n),...Xe?{[`--${u}-align-entries-row-gap`]:F.scalingValue(m??0,n)}:{}},children:J.map((xt,yt)=>{var Ft;const Me=xc(xt.title),Qe=xc(xt.subtitle),rt=(((Ft=xt.link)==null?void 0:Ft.length)??0)>0&&x==="off"?xt.link:void 0,dt=Math.floor(yt/Ze)===Math.ceil(J.length/Ze)-1,Pt=st&&yt>=it?`${Oe+(yt-it)}`:void 0,St=De?a.jsxs("div",{className:`${u}-item-text-block`,children:[Me&&a.jsx("p",{className:te,style:{width:ct,...ke,...j},children:xt.title}),Me&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(I??0,n),width:ge}}),Qe&&a.jsx("p",{className:me,style:{width:ct,...Ce,...P},children:xt.subtitle}),Qe&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(N??0,n),width:ge}})]}):null,ht=Xe?a.jsxs("div",{className:`${u}-item-title-row`,children:[!De&&a.jsx("div",{"data-controls":o&&Me?"titleMarginTop":void 0,className:o&&Me?`${u}-control`:void 0,style:{height:Me?F.scalingValue(I??0,n):0,width:ge}}),Me&&a.jsx("p",{className:te,style:{width:ct,...ke,...j},children:xt.title}),De&&Me&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(I??0,n),width:ge}})]}):null,Wt=Xe?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!De&&a.jsx("div",{"data-controls":o&&Qe?"subtitleMarginTop":void 0,className:o&&Qe?`${u}-control`:void 0,style:{height:Qe?F.scalingValue(N??0,n):0,width:ge}}),Qe&&a.jsx("p",{className:me,style:{width:ct,...Ce,...P},children:xt.subtitle}),De&&Qe&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(N??0,n),width:ge}})]}):null,Tt=rt?a.jsxs("a",{href:rt,target:"_blank",className:`${u}-item-text-link`,children:[ht,Wt]}):a.jsxs(a.Fragment,{children:[ht,Wt]}),Ot=Du(xt.gallery),Gt=Ot.filter(ut=>ut.lightboxMedia).map(ut=>ut.lightboxMedia),Mt=a.jsx("div",{className:ze,style:gt,children:Ot.length===0?null:S==="off"?(()=>{const{displayMedia:ut,lightboxMedia:H}=Ot[0],Le=H?Gt.findIndex(Ve=>Ve.url===H.url):-1;return a.jsx(bc,{media:ut,className:`${u}-item-${Xi(ut)?"video":"image"}`.trim(),style:Ee,onMediaClick:kt&&Le>=0?()=>Bt(Gt,Le):void 0})})():a.jsxs(a.Fragment,{children:[Ue&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Ot.map(({displayMedia:ut})=>Xi(ut)?a.jsx("video",{src:ut.url,muted:!0,playsInline:!0},`sizer-${ut.url}`):a.jsx("img",{src:ut.url,alt:""},`sizer-${ut.url}`))}),a.jsx(Ll,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:O*1e3,width:"100%",height:"100%",speed:My,type:z==="fade"?"fade":"loop",rewind:z==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:vt},onMoved:ut=>{U!=="random"||z==="fade"||Ey(ut)},children:Ot.map(({displayMedia:ut,lightboxMedia:H},Le)=>{const Ve=H?Gt.findIndex(Fe=>Fe.url===H.url):-1;return a.jsx(Pl,{children:a.jsx(bc,{media:ut,className:`${u}-item-${Xi(ut)?"video":"image"}`.trim(),style:Ee,onMediaClick:kt&&Ve>=0?()=>Bt(Gt,Ve):void 0})},Le)})},`${z}-${We}-${U}-${O}-${nt}-${c}`)]})}),_t=De?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&Me?"titleMarginTop":void 0,className:o&&Me?`${u}-control`:void 0,style:{height:Me?F.scalingValue(I??0,n):0,width:ge}}),a.jsx("p",{className:te,style:{width:ct,...ke,...j},children:xt.title}),a.jsx("div",{"data-controls":o&&Qe?"subtitleMarginTop":void 0,className:o&&Qe?`${u}-control`:void 0,style:{height:Qe?F.scalingValue(N??0,n):0,width:ge}}),a.jsx("p",{className:me,style:{width:ct,...Ce,...P},children:xt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:Pt&&!Xe?{gridColumn:Pt}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${Xe&&dt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(v??0)>100?`calc(${we} * (${v} / 100))`:we,...Pt&&Xe?{gridColumn:Pt}:{}},children:Xe?a.jsx(a.Fragment,{children:De?a.jsxs(a.Fragment,{children:[Tt,a.jsx("a",{href:rt,target:"_blank",className:`${u}-item-image-link`,children:Mt})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:rt,target:"_blank",className:`${u}-item-image-link`,children:Mt}),Tt]})}):rt?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:rt,target:"_blank",className:`${u}-item-image-link`,children:[St,Mt]}),!De&&a.jsx("a",{href:rt,target:"_blank",className:`${u}-item-text-link`,children:_t})]}):a.jsxs(a.Fragment,{children:[St,Mt,_t]})})},yt)})})}),(!n||i)&&At&&typeof document<"u"&&x==="on"&&(()=>{const xt=(d?document.getElementById(d):null)??document.body;return Gn.createPortal(a.jsx("div",{style:Rt,"data-selection":"none",children:a.jsx(jy,{prefix:u,items:Vt,index:Kt,imageDisplay:Vy(f),isEditor:n,onClose:()=>wt(!1),onPrev:()=>Yt(yt=>(yt-1+Vt.length)%Vt.length),onNext:()=>Yt(yt=>(yt+1)%Vt.length),counterClassName:Q,counterStyle:Z})}),xt)})()]})}const Xy={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},qy=["hover","focus","filled","success","error"],Uy=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
5257
|
+
`}function Ry(){return Math.random()<.5?"ltr":"ttb"}function ky(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function Ey(e){const t=Ry();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{ky(e)})})}const En=500,My=750,ui="cubic-bezier(0.22, 1, 0.36, 1)",Ay=72,Fy=50;function Ny(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 _y(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Hy(e){const[t]=e.media;return t!=null&&t.url?t:null}function Du(e){return!Array.isArray(e)||e.length===0?[]:Ny(e)?e.flatMap(t=>{const n=_y(t);if(!n)return[];const i=Hy(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 Xi(e){return e.type==="video"}function Wy(e){const t=new Set,n=[];for(const i of e){const o=Du(i.gallery);for(const r of o){const l=r.lightboxMedia;l!=null&&l.url&&!t.has(l.url)&&(t.add(l.url),n.push(l))}}return n}function Oy({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Xi(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function Dy(e){e.pause(),e.removeAttribute("src"),e.load()}function bc({media:e,className:t,style:n,onMediaClick:i}){return Xi(e)?a.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):a.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function Sc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function zy(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 r=e.width/n;return{width:e.width,height:r,left:e.left,top:e.top+(e.height-r)/2}}const o=e.height*n;return{width:o,height:e.height,left:e.left+(e.width-o)/2,top:e.top}}function By({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const c=n.current;if(c)return()=>{Dy(c)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,style:i})}function jy({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:c,counterClassName:d,counterStyle:u}){const p=i==="cover",y=s.useRef(null),v=s.useRef(null),m=s.useRef(null),g=s.useRef(null),x=s.useRef(0),b=s.useRef(0),k=s.useRef("none"),f=s.useRef(!1),S=s.useRef(!1),W=s.useRef(null),U=s.useRef(0),B=s.useRef(null),P=s.useRef(!1),_=s.useRef(null),G=s.useRef(null),$=s.useRef(null),L=s.useRef(()=>{}),[D,E]=s.useState(null),[T,C]=s.useState(null),[V,w]=s.useState("opening"),[q,I]=s.useState(0),[A,j]=s.useState(0),[ie,ae]=s.useState(null),[O,oe]=s.useState(!1),[N,le]=s.useState(!1),[Q,be]=s.useState(!1),[Pe,ye]=s.useState(null),ce=s.useRef(n),Y=s.useRef(void 0),se=t[n],pe=se?Xi(se):!1,fe=A!==0||O,we=ie!==null,Re=s.useCallback($e=>{const Ne=$e.currentTarget,Ue=Ne instanceof HTMLVideoElement?{width:Ne.videoWidth,height:Ne.videoHeight}:{width:Ne.naturalWidth,height:Ne.naturalHeight};!Ue.width||!Ue.height||ye(Ue)},[]);s.useEffect(()=>{W.current=T},[T]),s.useEffect(()=>{const $e=y.current;if(!$e)return;const Ne=()=>C(Sc($e));Ne();const Ue=new ResizeObserver(Ne);return Ue.observe($e),()=>Ue.disconnect()},[]);const ge=s.useCallback(()=>{_.current!==null&&(window.clearTimeout(_.current),_.current=null)},[]),xe=s.useCallback(()=>{const $e=G.current;G.current=null,ge(),B.current=null,P.current=!1,ae(null),oe(!1),j(0),U.current=0,le(!1),f.current=!1,b.current=0,k.current="none",$e===1?c():$e===-1&&l()},[ge,c,l]),Ce=s.useCallback(()=>{ge(),G.current=null,B.current=null,P.current=!1,ae(null),oe(!1),j(0),U.current=0},[ge]),h=s.useCallback(()=>{ge(),_.current=window.setTimeout(()=>{G.current!==null&&xe()},En+32)},[ge,xe]),K=s.useCallback(($e,Ne)=>{var Je;const Ue=((Je=W.current)==null?void 0:Je.width)??0;if(ge(),B.current=$e,ae($e),P.current=!0,oe(!0),Ne){G.current=$e;const st=-$e*Ue;U.current=st,j(st),h();return}U.current=0,j(0),_.current=window.setTimeout(()=>{_.current=null,Ce()},En+32)},[ge,Ce,h]),Z=s.useCallback($e=>{if(!(t.length<=1)){if(P.current){if(G.current===$e){$.current=$e,xe();return}Ce()}ge(),B.current=$e,ae($e),P.current=!1,oe(!1),U.current=0,j(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{K($e,!0)})})}},[t.length,K,xe,Ce,ge]);L.current=Z;const ne=s.useCallback($e=>{$e.propertyName!=="transform"||!P.current||G.current!==null&&xe()},[xe]),de=s.useCallback(()=>{const $e=v.current;if(!$e)return;const Ne=Sc($e);!Ne.width||!Ne.height||E(Ne)},[]);s.useEffect(()=>{de();const $e=v.current;if(!$e)return;const Ne=new ResizeObserver(()=>de());return Ne.observe($e),()=>Ne.disconnect()},[de]),s.useEffect(()=>{V==="opening"&&D&&w("open")},[V,D]),s.useEffect(()=>{if(V!=="closing")return;const $e=setTimeout(()=>r(),En);return()=>clearTimeout($e)},[V,r]),s.useEffect(()=>()=>{ge()},[ge]),s.useLayoutEffect(()=>{ce.current===n&&Y.current===(se==null?void 0:se.url)||(ge(),G.current=null,ae(null),I(0),j(0),oe(!1),be(!1),le(!1),ye(null),x.current=0,b.current=0,k.current="none",f.current=!1,P.current=!1,U.current=0,B.current=null,g.current=null,S.current=!1,ce.current=n,Y.current=se==null?void 0:se.url)},[n,se==null?void 0:se.url,ge]),s.useLayoutEffect(()=>{const $e=$.current;$e!==null&&($.current=null,requestAnimationFrame(()=>{L.current($e)}))},[n,se==null?void 0:se.url]),s.useEffect(()=>{if(V!=="open")return;let $e=null;const Ne=()=>{$e&&(document.removeEventListener("click",$e,!0),$e=null)},Ue=()=>{Ne(),$e=Ae=>{Ae.stopPropagation(),Ae.preventDefault(),Ne()},document.addEventListener("click",$e,!0)},Je=Ae=>{const gt=Ae<0?1:-1;if(Math.abs(Ae)>Fy&&t.length>1){K(gt,!0);return}K(gt,!1)},st=Ae=>{if(Ae.touches.length!==1||P.current)return;const gt=Ae.touches[0];S.current=!0,g.current={x:gt.clientX,y:gt.clientY},k.current="none",b.current=0,f.current=!1},it=Ae=>{if(!g.current||Ae.touches.length!==1||P.current)return;const gt=Ae.touches[0],ze=gt.clientX-g.current.x,De=gt.clientY-g.current.y;if(k.current==="none"){if(Math.abs(ze)<10&&Math.abs(De)<10)return;if(Math.abs(ze)>Math.abs(De)){if(t.length<=1)return;k.current="horizontal"}else if(De>0)k.current="vertical";else return}if(k.current==="horizontal"){f.current=!0,le(!0),b.current=ze;const Xe=ze<0?1:-1;B.current!==Xe&&(B.current=Xe,ae(Xe)),U.current=ze,j(ze),Ae.preventDefault();return}k.current==="vertical"&&(f.current=!0,le(!0),x.current=De,I(De),Ae.preventDefault())},Oe=()=>{if(!g.current)return;const Ae=k.current,gt=f.current;if(gt&&Ae==="horizontal")Je(b.current),Ue();else if(gt&&Ae==="vertical")if(x.current>Ay){const De=window.innerHeight;x.current=De,be(!0),I(De),w("closing")}else x.current=0,I(0),Ue();else Ae==="horizontal"&&Math.abs(b.current)>0&&(Je(b.current),Ue());g.current=null,k.current="none",b.current=0,f.current=!1,le(!1)};return document.addEventListener("touchstart",st,{passive:!0}),document.addEventListener("touchmove",it,{passive:!1}),document.addEventListener("touchend",Oe),document.addEventListener("touchcancel",Oe),()=>{document.removeEventListener("touchstart",st),document.removeEventListener("touchmove",it),document.removeEventListener("touchend",Oe),document.removeEventListener("touchcancel",Oe),Ne()}},[V,t.length,K]),s.useEffect(()=>{const $e=Ne=>{Ne.key==="Escape"&&(Ne.preventDefault(),Ne.stopPropagation(),V!=="closing"&&w("closing"))};return window.addEventListener("keydown",$e,!0),()=>window.removeEventListener("keydown",$e,!0)},[V]);const z=()=>{V!=="closing"&&w("closing")},R=V==="open",ee=V==="closing",te=q>0?Math.max(0,1-q/500):1,me=q>0?Math.max(.35,1-q/500):1,X=D?p?D:zy(D,Pe):null,Ie=$e=>{if($e.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const Ne=X??$e.currentTarget.getBoundingClientRect(),Ue=$e.clientY-Ne.top,Je=Math.min(52,Ne.height*.2);if(!(Ue>Ne.height-Je)){if($e.clientX-Ne.left<Ne.width/2){Z(-1);return}Z(1)}},Se=$e=>{if(t.length<=1)return;const Ne=X??$e.currentTarget.getBoundingClientRect(),Ue=$e.clientX-Ne.left,Je=$e.clientY-Ne.top,st=Math.min(52,Ne.height*.2);if(Je>Ne.height-st){$e.currentTarget.style.cursor="default";return}$e.currentTarget.style.cursor=Ue<Ne.width/2?"w-resize":"e-resize"},J={position:"fixed",top:T==null?void 0:T.top,left:T==null?void 0:T.left,width:T==null?void 0:T.width,height:T==null?void 0:T.height,zIndex:9998},He=p?"cover":"contain",We=A!==0||q>0?`translate(${A}px, ${q}px)`:void 0,ot=N&&!O?"none":O?`transform ${En}ms ${ui}`:Q?`transform ${En}ms ${ui}, opacity ${En}ms ${ui}`:V==="opening"||ee?`opacity ${En}ms ${ui}`:"none",qe={...J,transform:We,opacity:q>0?me:V==="opening"||ee?0:1,transition:ot,pointerEvents:"none"},tt={position:"absolute",top:((X==null?void 0:X.top)??0)-((T==null?void 0:T.top)??0),left:((X==null?void 0:X.left)??0)-((T==null?void 0:T.left)??0),width:X==null?void 0:X.width,height:X==null?void 0:X.height,objectFit:He,pointerEvents:pe&&R&&!fe?"auto":"none",touchAction:pe&&R?"none":void 0},et=(T==null?void 0:T.width)??0,Ge=we?(n+ie+t.length)%t.length:null,ve=Ge!==null?t[Ge]:null,_e={...J,transform:we?`translateX(${ie*et+A}px)`:void 0,opacity:1,transition:O?`transform ${En}ms ${ui}`:"none",pointerEvents:"none"},Be={position:"absolute",top:((D==null?void 0:D.top)??0)-((T==null?void 0:T.top)??0),left:((D==null?void 0:D.left)??0)-((T==null?void 0:T.left)??0),width:D==null?void 0:D.width,height:D==null?void 0:D.height,objectFit:He,pointerEvents:"none"},Ze=X?{position:"fixed",top:X.top,height:X.height,width:X.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:y,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:V==="open"?"none":void 0},onClick:z,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:R?te:0,transition:N?"none":`opacity ${En}ms ${ui}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:p?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:v,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:R?1:0,transition:`opacity ${En}ms ${ui}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:d,style:u,children:[n+1," / ",t.length]})})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:v,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:R?1:0,transition:`opacity ${En}ms ${ui}`},children:t.length>1&&a.jsxs("p",{className:d,style:u,children:[n+1," / ",t.length]})})]})}),D&&T&&ve&&a.jsx("div",{style:_e,onTransitionEnd:ne,children:Xi(ve)?a.jsx("video",{src:ve.url,muted:!0,playsInline:!0,preload:"auto",style:Be},`neighbor-${Ge}-${ve.url}`):a.jsx("img",{src:ve.url,alt:ve.name,style:Be},`neighbor-${Ge}-${ve.url}`)}),D&&T&&se&&a.jsx("div",{style:qe,onTransitionEnd:ne,children:pe?a.jsx(By,{src:se.url,phase:V,mediaRef:m,mediaStyle:tt,onLoadedMetadata:Re,onClick:Ie,onMouseMove:Se},`${n}-${se.url}`):a.jsx("img",{ref:m,src:se.url,alt:se.name,onLoad:Re,style:tt},`${n}-${se.url}`)}),R&&Ze&&t.length>1&&!pe&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ze,left:X.left,cursor:"w-resize",pointerEvents:N?"none":"auto"},onClick:$e=>{if(S.current){S.current=!1;return}$e.stopPropagation(),Z(-1)}}),a.jsx("div",{style:{...Ze,left:X.left+X.width/2,cursor:"e-resize",pointerEvents:N?"none":"auto"},onClick:$e=>{if(S.current){S.current=!1;return}$e.stopPropagation(),Z(1)}})]})]})}function Vy(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Gy({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:c,portalId:d}){const{prefix:u}=F.useScopedStyles(),{type:p="a",gridLayout:y,textBoxWidth:v=100,verticalGap:m,entriesCount:g,lightbox:x,imageDisplay:b,imageCorners:k,lightboxImageDisplay:f,slider:S,sliderTiming:W,direction:U,transition:B,titleMarginTop:P,subtitleMarginTop:_,titleColor:G,subtitleColor:$,lightboxCounterColor:L,titleFontFamily:D,titleFontSettings:E,titleFontSize:T,titleLineHeight:C,titleLetterSpacing:V,titleWordSpacing:w,titleTextAppearance:q,subtitleFontFamily:I,subtitleFontSettings:A,subtitleFontSize:j,subtitleLineHeight:ie,subtitleLetterSpacing:ae,subtitleWordSpacing:O,subtitleTextAppearance:oe,lightboxCounterFontFamily:N,lightboxCounterFontSettings:le,lightboxCounterFontSize:Q,lightboxCounterLineHeight:be,lightboxCounterLetterSpacing:Pe,lightboxCounterWordSpacing:ye,lightboxCounterTextAppearance:ce,showText:Y="always",alignEntries:se="off",align:pe="top"}=e,fe={fontSettings:{fontFamily:D,fontWeight:(E==null?void 0:E.fontWeight)??400,fontStyle:(E==null?void 0:E.fontStyle)??"normal"},fontSize:T??.01,lineHeight:C,letterSpacing:V??0,wordSpacing:w??0,textAppearance:q,color:G},Re={...dn(Qt(fe,n))},ge={fontSettings:{fontFamily:I,fontWeight:(A==null?void 0:A.fontWeight)??400,fontStyle:(A==null?void 0:A.fontStyle)??"normal"},fontSize:j??.01,lineHeight:ie,letterSpacing:ae??0,wordSpacing:O??0,textAppearance:oe,color:$},Ce={...dn(Qt(ge,n))},h={fontSettings:{fontFamily:N,fontWeight:(le==null?void 0:le.fontWeight)??400,fontStyle:(le==null?void 0:le.fontStyle)??"normal"},fontSize:Q??.01,lineHeight:be,letterSpacing:Pe??0,wordSpacing:ye??0,textAppearance:ce,color:L},Z={...dn(Qt(h,n)),...es(Q,be,u,n)},ne=Qa(T,C,`${u}-item-title`,`${u}-text-tight-leading`),de=Qa(j,ie,`${u}-item-subtitle`,`${u}-text-tight-leading`),z=es(T,C,u,n),R=es(j,ie,u,n),ee=Qa(Q,be,`${u}-lightbox-counter`,`${u}-text-tight-leading`),te=F.buildColorVars(u,{titleColor:G,subtitleColor:$,lightboxCounterColor:L},Xy,qy),Ie=`${l&&l!=="default"?`${u}-state-${l}`:""}${Y==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),Se=g===0?1/0:g,J=(t??[]).slice(0,Se),He=s.useMemo(()=>x==="on"?Wy(J):[],[J,x]),We=y.entryWidth??.2,ot=(b==null?void 0:b.display)==="cover",qe=(b==null?void 0:b.ratioValue)??"1:1",tt=(b==null?void 0:b.reversed)??!1,[et,Ge]=qe.split(":").map(Number),Be=`${tt?Ge:et} / ${tt?et:Ge}`,Ze=y.columnsCount,$e=F.scalingValue(We??0,n),Ne=$e,Ue=!ot&&S!=="off",Je=J.length%Ze||Ze,st=Je<Ze&&J.length>0,it=J.length-Je,Oe=st?Math.floor((Ze-Je)/2)+1:1,Ae=k?F.scalingValue(k,n):void 0,gt={width:Ne,...ot?{aspectRatio:Be,height:"auto",overflow:"hidden"}:{height:"auto"},...Ae?{borderRadius:Ae,overflow:"hidden"}:{}},ze=`${u}-item-image-wrapper${Ue?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),De=p==="d"||p==="e"||p==="f",Xe=se==="on",ct=`calc(${F.scalingValue(We??0,n)} * (${v} / 100))`,he=F.scalingValue(We*v/100,n),Ee=ot?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...Ae?{borderRadius:Ae}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...Ae?{borderRadius:Ae}:{}},[nt,pt]=s.useState(0),Ve=s.useRef(null),vt=B==="fade"||U==="horizontal"?"ltr":U==="vertical"?"ttb":"ltr";s.useEffect(()=>{const xt=Ve.current;if(!xt)return;const yt=new ResizeObserver(Me=>{pt(Math.round(Me[0].contentRect.width))});return yt.observe(xt),()=>yt.disconnect()},[]);const Rt=(()=>{const xt={...te},yt=Ve.current?getComputedStyle(Ve.current).getPropertyValue("--cntrl-article-width").trim():"";return yt&&(xt["--cntrl-article-width"]=yt),xt})(),[At,wt]=s.useState(!1),[Vt,jt]=s.useState([]),[Kt,Yt]=s.useState(0),kt=x==="on"&&(!n||i),Bt=(xt,yt)=>{n&&!i||x!=="off"&&(jt(xt),Yt(yt),wt(!0))};s.useEffect(()=>{if(!At||x!=="on"||typeof document>"u")return;const xt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=xt}},[At,x]),s.useEffect(()=>{!n||i||wt(!1)},[n,i]);const rn=s.useMemo(()=>Iy(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:rn}}),x==="on"&&a.jsx(Oy,{mediaList:He}),a.jsx("div",{style:te,children:a.jsx("div",{ref:Ve,className:`${u}-wrapper ${u}-type-${p}${Xe?` ${u}-align-entries`:""} ${u}-image-align-${pe} ${Ie}`.trim(),style:{gridTemplateColumns:`repeat(${Ze}, ${$e})`,rowGap:Xe?0:F.scalingValue(m??0,n),columnGap:F.scalingValue(y.horizontalGap??0,n),width:F.scalingValue(y.wrapperWidth??0,n),...Xe?{[`--${u}-align-entries-row-gap`]:F.scalingValue(m??0,n)}:{}},children:J.map((xt,yt)=>{var Ft;const Me=xc(xt.title),Qe=xc(xt.subtitle),rt=(((Ft=xt.link)==null?void 0:Ft.length)??0)>0&&x==="off"?xt.link:void 0,dt=Math.floor(yt/Ze)===Math.ceil(J.length/Ze)-1,Pt=st&&yt>=it?`${Oe+(yt-it)}`:void 0,St=De?a.jsxs("div",{className:`${u}-item-text-block`,children:[Me&&a.jsx("p",{className:ne,style:{width:ct,...Re,...z},children:xt.title}),Me&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(P??0,n),width:he}}),Qe&&a.jsx("p",{className:de,style:{width:ct,...Ce,...R},children:xt.subtitle}),Qe&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(_??0,n),width:he}})]}):null,ht=Xe?a.jsxs("div",{className:`${u}-item-title-row`,children:[!De&&a.jsx("div",{"data-controls":o&&Me?"titleMarginTop":void 0,className:o&&Me?`${u}-control`:void 0,style:{height:Me?F.scalingValue(P??0,n):0,width:he}}),Me&&a.jsx("p",{className:ne,style:{width:ct,...Re,...z},children:xt.title}),De&&Me&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(P??0,n),width:he}})]}):null,Wt=Xe?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!De&&a.jsx("div",{"data-controls":o&&Qe?"subtitleMarginTop":void 0,className:o&&Qe?`${u}-control`:void 0,style:{height:Qe?F.scalingValue(_??0,n):0,width:he}}),Qe&&a.jsx("p",{className:de,style:{width:ct,...Ce,...R},children:xt.subtitle}),De&&Qe&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(_??0,n),width:he}})]}):null,Tt=rt?a.jsxs("a",{href:rt,target:"_blank",className:`${u}-item-text-link`,children:[ht,Wt]}):a.jsxs(a.Fragment,{children:[ht,Wt]}),Ot=Du(xt.gallery),Gt=Ot.filter(ut=>ut.lightboxMedia).map(ut=>ut.lightboxMedia),Mt=a.jsx("div",{className:ze,style:gt,children:Ot.length===0?null:S==="off"?(()=>{const{displayMedia:ut,lightboxMedia:H}=Ot[0],Le=H?Gt.findIndex(je=>je.url===H.url):-1;return a.jsx(bc,{media:ut,className:`${u}-item-${Xi(ut)?"video":"image"}`.trim(),style:Ee,onMediaClick:kt&&Le>=0?()=>Bt(Gt,Le):void 0})})():a.jsxs(a.Fragment,{children:[Ue&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Ot.map(({displayMedia:ut})=>Xi(ut)?a.jsx("video",{src:ut.url,muted:!0,playsInline:!0},`sizer-${ut.url}`):a.jsx("img",{src:ut.url,alt:""},`sizer-${ut.url}`))}),a.jsx(Ll,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:W*1e3,width:"100%",height:"100%",speed:My,type:B==="fade"?"fade":"loop",rewind:B==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:vt},onMoved:ut=>{U!=="random"||B==="fade"||Ey(ut)},children:Ot.map(({displayMedia:ut,lightboxMedia:H},Le)=>{const je=H?Gt.findIndex(Fe=>Fe.url===H.url):-1;return a.jsx(Pl,{children:a.jsx(bc,{media:ut,className:`${u}-item-${Xi(ut)?"video":"image"}`.trim(),style:Ee,onMediaClick:kt&&je>=0?()=>Bt(Gt,je):void 0})},Le)})},`${B}-${We}-${U}-${W}-${nt}-${c}`)]})}),_t=De?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&Me?"titleMarginTop":void 0,className:o&&Me?`${u}-control`:void 0,style:{height:Me?F.scalingValue(P??0,n):0,width:he}}),a.jsx("p",{className:ne,style:{width:ct,...Re,...z},children:xt.title}),a.jsx("div",{"data-controls":o&&Qe?"subtitleMarginTop":void 0,className:o&&Qe?`${u}-control`:void 0,style:{height:Qe?F.scalingValue(_??0,n):0,width:he}}),a.jsx("p",{className:de,style:{width:ct,...Ce,...R},children:xt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:Pt&&!Xe?{gridColumn:Pt}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${Xe&&dt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(v??0)>100?`calc(${$e} * (${v} / 100))`:$e,...Pt&&Xe?{gridColumn:Pt}:{}},children:Xe?a.jsx(a.Fragment,{children:De?a.jsxs(a.Fragment,{children:[Tt,a.jsx("a",{href:rt,target:"_blank",className:`${u}-item-image-link`,children:Mt})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:rt,target:"_blank",className:`${u}-item-image-link`,children:Mt}),Tt]})}):rt?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:rt,target:"_blank",className:`${u}-item-image-link`,children:[St,Mt]}),!De&&a.jsx("a",{href:rt,target:"_blank",className:`${u}-item-text-link`,children:_t})]}):a.jsxs(a.Fragment,{children:[St,Mt,_t]})})},yt)})})}),(!n||i)&&At&&typeof document<"u"&&x==="on"&&(()=>{const xt=(d?document.getElementById(d):null)??document.body;return Gn.createPortal(a.jsx("div",{style:Rt,"data-selection":"none",children:a.jsx(jy,{prefix:u,items:Vt,index:Kt,imageDisplay:Vy(f),isEditor:n,onClose:()=>wt(!1),onPrev:()=>Yt(yt=>(yt-1+Vt.length)%Vt.length),onNext:()=>Yt(yt=>(yt+1)%Vt.length),counterClassName:ee,counterStyle:Z})}),xt)})()]})}const Xy={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},qy=["hover","focus","filled","success","error"],Uy=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
5230
5258
|
import '@splidejs/react-splide/css/core';
|
|
5231
5259
|
import { CommonComponentProps } from '../props';
|
|
5232
5260
|
import {
|
|
@@ -7279,7 +7307,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
7279
7307
|
};
|
|
7280
7308
|
|
|
7281
7309
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
7282
|
-
`,es={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Ky=["titleColor","subtitleColor","lightboxCounterColor"],Yy={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:{...es.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:{...es.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:{...es.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:[...Ky],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Zy={element:Gy,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:Yy,sourceCode:Uy},Jy=50,wc=10,Il="cntrl-lightbox-journal",Na=Il,zs=`${Il}-`,_a=e=>`${Il}-${e}`,Rl=e=>e===Na||e.startsWith(zs),$c=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Cc=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=$c(t.get(_a(e)));if(i)return i}const n=$c(t.get(Na));if(n)return n;for(const[i]of t){if(!i.startsWith(zs))continue;const o=i.slice(zs.length);if(!/^\d+$/.test(o))continue;const r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}return null},Tc=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},zu=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{Rl(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(_a(t),String(e)):i.searchParams.set(Na,String(e));const o=n?"replaceState":"pushState",r=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",r)},Qy=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===_a(e)||i===Na:Rl(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)}},Bu=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(_a(e)):[...t.keys()].some(n=>Rl(n))},ev=(e,t)=>{if(Bu(t)){if(e){window.history.back();return}Qy(t)}},tv=20,nv=2,ts=e=>`max(${e}, ${tv}px)`,Lo=e=>((e==null?void 0:e.image)??[]).slice(0,nv),ju=e=>e.reduce((t,n)=>t+Lo(n).length,0),iv=(e,t)=>{const n=e.slice(0,t).reduce((o,r)=>o+Lo(r).length,1),i=Lo(e[t]).length;return{start:n,end:n+i-1}},ov=(e,t)=>{const n=ju(e),{start:i,end:o}=iv(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},sa=(e,t)=>t==="B"?e.flatMap((n,i)=>Lo(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Lo(n)})),rv=(e,t,n,i)=>{var r;if(n==="B")return`${t+1} / ${e.length}`;const o=((r=e[t])==null?void 0:r.entryIndex)??0;return ov(i,o)},Lc=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",av=(e,t,n)=>e==="B"?t.length>1:ju(n)>1,Ln=.004,ei=.004,bo={title1Width:.13,title2Width:.13,title3Width:.14},Si=(e,t,n,i,o)=>{const r=[];return t.title1&&r.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&r.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&r.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),r},Po=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((r,l)=>r+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:r,widths:l},c)=>{if(r<=0||c<=0)return{overflow:r,widths:[c,...l]};const d=Math.min(r,c);return{overflow:r-d,widths:[c-d,...l]}},{overflow:i-1,widths:[]});return o},yr=(e,t)=>Po(e,t),yn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},wi=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Po(e.length,n),effective:yr(e.length,n)}},Vu=(e,t,n,i)=>e.slice(0,i).reduce((o,r,l)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[l]??0),0),Gu=(e,t,n,i)=>e.slice(0,i+1).reduce((o,r,l)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[l]??0),0),Li=["title1","title2","title3","count"],bt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,kl={title1:"1",title2:"2",title3:"3",count:"Count"},El=e=>[bt(e,"fontFamily"),bt(e,"fontSettings"),{type:"row",items:[bt(e,"fontSize"),bt(e,"lineHeight"),bt(e,"letterSpacing"),bt(e,"wordSpacing")]},bt(e,"textAlign"),bt(e,"textAppearance")],sv=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Li.map(e=>[kl[e],El(e)]))}),lv={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},cv={title1:.02,title2:.02,title3:.02,count:.017},zi=(e,t)=>{const n=i=>{const o=bt(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[lv[t]]}},Bi=(e,t,n)=>{var o,r;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((r=t.fontSettings)==null?void 0:r.fontStyle)??"normal"},fontSize:t.fontSize??cv[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Qt(i,n)};function Xu({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l}){const{title1Width:c,title2Width:d,title3Width:u,title1MarginLeft:p=0,title2MarginLeft:y=0,title3MarginLeft:v=0,titleRowMarginBottom:m=0,titleHeaderLayout:g="desktop",contentMarginTop:x=0,iconMarginRight:b=0,closeIcon:k=null,closeIconMaxWidth:f=0,closeIconColor:S="#000000",closeIconHoverColor:O="#cccccc"}=n,U=F.scalingValue(x,i),z=F.scalingValue(Math.max(x,ei),i),I=F.scalingValue(b,i),N=F.scalingValue(m,i),q=g==="mobile",$=Bi("title1",zi(n,"title1"),i),L=Bi("title2",zi(n,"title2"),i),D=Bi("title3",zi(n,"title3"),i),_=s.useMemo(()=>({title1Width:c??bo.title1Width,title2Width:d??bo.title2Width,title3Width:u??bo.title3Width}),[c,d,u]),C=s.useMemo(()=>({title2MarginLeft:y,title3MarginLeft:v}),[y,v]),T=s.useMemo(()=>Si(e,t,$,L,D),[e,t,$,L,D]),B=s.useMemo(()=>T.map(G=>_[G.widthKey]),[T,_]),w=s.useMemo(()=>Po(T.length,B),[T.length,B]),X=s.useMemo(()=>yr(T.length,B),[T.length,B]),R=s.useMemo(()=>T.filter(G=>G.prefix==="title1"),[T]),E=s.useMemo(()=>T.filter(G=>G.prefix==="title2"||G.prefix==="title3"),[T]),V=s.useMemo(()=>wi(R,_),[R,_]),ie=s.useMemo(()=>wi(E,_),[E,_]),re=!!(t.title1||t.title2||t.title3),W=k!==null;if(!(re||W))return null;const A=(p??0)>0||o,le=(G,Ie)=>{const be=T.findIndex(He=>He.prefix===G.prefix);if(!q||Ie==="single-row")return{effectiveWidth:X[be]??0,resolvedWidth:w[be]??0,maxWidth:yn(be,w)};if(Ie==="two-row-top"){const He=R.findIndex(We=>We.prefix===G.prefix);return{effectiveWidth:V.effective[He]??0,resolvedWidth:V.resolved[He]??0,maxWidth:yn(He,V.resolved)}}const J=E.findIndex(He=>He.prefix===G.prefix);return{effectiveWidth:ie.effective[J]??0,resolvedWidth:ie.resolved[J]??0,maxWidth:yn(J,ie.resolved)}},ee=(G,Ie,be)=>{if(!q||be==="single-row"){const qe=G.findIndex(fe=>fe.prefix===Ie.prefix),tt=G.map(fe=>_[fe.widthKey]),et=Po(G.length,tt);return{effectiveWidth:yr(G.length,tt)[qe]??0,resolvedWidth:et[qe]??0,maxWidth:yn(qe,et)}}if(be==="two-row-top"){const qe=G.filter(fe=>fe.prefix==="title1"),tt=qe.findIndex(fe=>fe.prefix===Ie.prefix),{resolved:et,effective:je}=wi(qe,_);return{effectiveWidth:je[tt]??0,resolvedWidth:et[tt]??0,maxWidth:yn(tt,et)}}const J=G.filter(qe=>qe.prefix==="title2"||qe.prefix==="title3"),He=J.findIndex(qe=>qe.prefix===Ie.prefix),{resolved:We,effective:ot}=wi(J,_);return{effectiveWidth:ot[He]??0,resolvedWidth:We[He]??0,maxWidth:yn(He,We)}},xe=G=>Gu(T,w,C,G)+(q?0:p??0),Pe=()=>q?0:p??0,ye=G=>E.slice(0,G).reduce((Ie,be,J)=>Ie+(be.marginLeftKey?C[be.marginLeftKey]??0:0)+(ie.resolved[J]??0),0),pe=G=>{const Ie=E[G];return ye(G)+(Ie.marginLeftKey?C[Ie.marginLeftKey]??0:0)+(ie.resolved[G]??0)},Y=(G,Ie,be)=>{const J=G.marginLeftKey?C[G.marginLeftKey]??0:0,{effectiveWidth:He,resolvedWidth:We,maxWidth:ot}=be??le(G,Ie),qe=Math.max(J,ei),tt=o&&Ie==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":G.prefix,style:{width:F.scalingValue(He,i),...J>0?{marginLeft:F.scalingValue(J,i)}:{}},children:[a.jsx("p",{className:G.className,style:G.style,children:G.text}),tt&&G.marginLeftKey?a.jsx("div",{"data-controls":G.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(We),style:{position:"absolute",top:0,left:F.scalingValue(-J,i),width:F.scalingValue(qe,i),height:"100%",pointerEvents:"auto"}}):null,tt?a.jsx("div",{"data-controls":G.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ot),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:F.scalingValue(-Ln/2,i),width:F.scalingValue(Ln,i),height:"100%",pointerEvents:"auto"}}):null]},G.className)},se=(G="two-row")=>{const Ie=T.findIndex(He=>He.prefix==="title1"),be=Ie>=0?w[Ie]:_.title1Width,J=G==="two-row"&&o;return a.jsx("div",{...J?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(be)}:{},style:{width:F.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...J?{pointerEvents:"auto"}:{}}})},de=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:$,"aria-hidden":"true",children:" "}),ve=G=>{const Ie=Si(e,G,$,L,D);return a.jsx(a.Fragment,{children:Ie.map(be=>Y(be,"single-row",ee(Ie,be,"single-row")))})},$e=G=>{const Ie=Si(e,G,$,L,D),be=Ie.find(J=>J.prefix==="title1");return be?Y(be,"two-row-top",ee(Ie,be,"two-row-top")):null},ke=(G,Ie=!1)=>{const be=Si(e,G,$,L,D),J=be.filter(ot=>ot.prefix==="title2"||ot.prefix==="title3"),He=o&&Ie;return J.length>0||He||(m??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[J.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[a.jsx("div",{className:`${e}-titles-stack`,children:J.map(ot=>Y(ot,"two-row-bottom",ee(be,ot,"two-row-bottom")))}),Ie&&o?a.jsxs(a.Fragment,{children:[me(),j()]}):null]}):null,(m??0)>0||He?a.jsx("div",{"data-controls":He?"titleRowMarginBottom":void 0,"data-controls-axis":He?"y":void 0,"data-controls-reverse":He?"":void 0,className:He?`${e}-control`:void 0,style:{height:N,width:"100%",flexShrink:0,pointerEvents:He?"auto":"none"}}):null]}):null},he=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:F.scalingValue(f??0,i),height:F.scalingValue(f??0,i),marginRight:I,"--close-icon-hover-color":O},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:G=>{G.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(mn,{url:k??"",fill:S,hoverFill:i&&!r?S:O,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:I,height:"100%",pointerEvents:"auto"}})]}),Se=()=>W?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:he()}):null,Ce=G=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:G})}),h=G=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[W||re?de():null,A?se("two-row"):null,Ce(G),Se()]}),K=(G,Ie=!1)=>a.jsxs(a.Fragment,{children:[h($e(G)),ke(G,Ie)]}),Z=()=>{const G=q?-1:T.findIndex(J=>J.prefix==="title1"),Ie=!q&&(o||(p??0)>0)?(()=>{const J=p??0,He=G>=0?w[G]:_.title1Width,We=Math.max(J,ei);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(He),style:{position:"absolute",top:0,left:0,width:F.scalingValue(We,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,be=T.flatMap((J,He)=>{if(!J.marginLeftKey)return[];const We=C[J.marginLeftKey]??0,ot=Vu(T,w,C,He)+Pe(),qe=Math.max(We,ei);return a.jsx("div",{"data-controls":J.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(w[He]),style:{position:"absolute",top:0,left:F.scalingValue(ot,i),width:F.scalingValue(qe,i),height:"100%",pointerEvents:"auto"}},J.marginLeftKey)});return Ie?[Ie,...be]:be},te=()=>T.map((G,Ie)=>{const be=yn(Ie,w),He=xe(Ie)-Ln/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":G.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,left:F.scalingValue(He,i),width:F.scalingValue(Ln,i),height:"100%",pointerEvents:"auto"}})},`${G.widthKey}-junction`)}),me=()=>E.flatMap((G,Ie)=>{if(!G.marginLeftKey)return[];const be=C[G.marginLeftKey]??0,J=ye(Ie),He=Math.max(be,ei),{resolvedWidth:We}=le(G,"two-row-bottom");return a.jsx("div",{"data-controls":G.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(We),style:{position:"absolute",top:0,left:F.scalingValue(J,i),width:F.scalingValue(He,i),height:"100%",pointerEvents:"auto"}},G.marginLeftKey)}),j=()=>E.map((G,Ie)=>{const{maxWidth:be}=le(G,"two-row-bottom"),He=pe(Ie)-Ln/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":G.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,left:F.scalingValue(He,i),width:F.scalingValue(Ln,i),height:"100%",pointerEvents:"auto"}})},`${G.widthKey}-junction`)}),P=()=>!o||q?null:a.jsxs(a.Fragment,{children:[Z(),te()]}),Q=!!(t.title2||t.title3||(m??0)>0||o),ne=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[W||re?de():null,A?se("single-row"):null,re?Ce(ve(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),Se(),P()]}),ue=()=>a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...Q?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:Q?void 0:{flex:"0 0 auto",height:"auto"},children:K(t,!0)}),P()]});return a.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:U,flexShrink:0},children:o&&a.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${e}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:z,pointerEvents:"auto"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...q?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${q?` ${e}-lightbox-content-area-stacked`:""}`,children:a.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?ue():ne()})})})]})}function dv(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function uv(e){return`
|
|
7310
|
+
`,ts={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Ky=["titleColor","subtitleColor","lightboxCounterColor"],Yy={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:{...ts.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:{...ts.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:{...ts.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:[...Ky],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Zy={element:Gy,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:Yy,sourceCode:Uy},Jy=50,wc=10,Il="cntrl-lightbox-journal",_a=Il,zs=`${Il}-`,Ha=e=>`${Il}-${e}`,Rl=e=>e===_a||e.startsWith(zs),$c=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Cc=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=$c(t.get(Ha(e)));if(i)return i}const n=$c(t.get(_a));if(n)return n;for(const[i]of t){if(!i.startsWith(zs))continue;const o=i.slice(zs.length);if(!/^\d+$/.test(o))continue;const r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}return null},Tc=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},zu=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{Rl(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(Ha(t),String(e)):i.searchParams.set(_a,String(e));const o=n?"replaceState":"pushState",r=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",r)},Qy=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Ha(e)||i===_a:Rl(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)}},Bu=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Ha(e)):[...t.keys()].some(n=>Rl(n))},ev=(e,t)=>{if(Bu(t)){if(e){window.history.back();return}Qy(t)}},tv=20,nv=2,ns=e=>`max(${e}, ${tv}px)`,Lo=e=>((e==null?void 0:e.image)??[]).slice(0,nv),ju=e=>e.reduce((t,n)=>t+Lo(n).length,0),iv=(e,t)=>{const n=e.slice(0,t).reduce((o,r)=>o+Lo(r).length,1),i=Lo(e[t]).length;return{start:n,end:n+i-1}},ov=(e,t)=>{const n=ju(e),{start:i,end:o}=iv(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},la=(e,t)=>t==="B"?e.flatMap((n,i)=>Lo(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Lo(n)})),rv=(e,t,n,i)=>{var r;if(n==="B")return`${t+1} / ${e.length}`;const o=((r=e[t])==null?void 0:r.entryIndex)??0;return ov(i,o)},Lc=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",av=(e,t,n)=>e==="B"?t.length>1:ju(n)>1,Ln=.004,ei=.004,bo={title1Width:.13,title2Width:.13,title3Width:.14},Si=(e,t,n,i,o)=>{const r=[];return t.title1&&r.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&r.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&r.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),r},Po=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((r,l)=>r+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:r,widths:l},c)=>{if(r<=0||c<=0)return{overflow:r,widths:[c,...l]};const d=Math.min(r,c);return{overflow:r-d,widths:[c-d,...l]}},{overflow:i-1,widths:[]});return o},yr=(e,t)=>Po(e,t),yn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},wi=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Po(e.length,n),effective:yr(e.length,n)}},Vu=(e,t,n,i)=>e.slice(0,i).reduce((o,r,l)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[l]??0),0),Gu=(e,t,n,i)=>e.slice(0,i+1).reduce((o,r,l)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[l]??0),0),Li=["title1","title2","title3","count"],bt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,kl={title1:"1",title2:"2",title3:"3",count:"Count"},El=e=>[bt(e,"fontFamily"),bt(e,"fontSettings"),{type:"row",items:[bt(e,"fontSize"),bt(e,"lineHeight"),bt(e,"letterSpacing"),bt(e,"wordSpacing")]},bt(e,"textAlign"),bt(e,"textAppearance")],sv=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Li.map(e=>[kl[e],El(e)]))}),lv={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},cv={title1:.02,title2:.02,title3:.02,count:.017},zi=(e,t)=>{const n=i=>{const o=bt(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[lv[t]]}},Bi=(e,t,n)=>{var o,r;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((r=t.fontSettings)==null?void 0:r.fontStyle)??"normal"},fontSize:t.fontSize??cv[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Qt(i,n)};function Xu({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l}){const{title1Width:c,title2Width:d,title3Width:u,title1MarginLeft:p=0,title2MarginLeft:y=0,title3MarginLeft:v=0,titleRowMarginBottom:m=0,titleHeaderLayout:g="desktop",contentMarginTop:x=0,iconMarginRight:b=0,closeIcon:k=null,closeIconMaxWidth:f=0,closeIconColor:S="#000000",closeIconHoverColor:W="#cccccc"}=n,U=F.scalingValue(x,i),B=F.scalingValue(Math.max(x,ei),i),P=F.scalingValue(b,i),_=F.scalingValue(m,i),G=g==="mobile",$=Bi("title1",zi(n,"title1"),i),L=Bi("title2",zi(n,"title2"),i),D=Bi("title3",zi(n,"title3"),i),E=s.useMemo(()=>({title1Width:c??bo.title1Width,title2Width:d??bo.title2Width,title3Width:u??bo.title3Width}),[c,d,u]),T=s.useMemo(()=>({title2MarginLeft:y,title3MarginLeft:v}),[y,v]),C=s.useMemo(()=>Si(e,t,$,L,D),[e,t,$,L,D]),V=s.useMemo(()=>C.map(X=>E[X.widthKey]),[C,E]),w=s.useMemo(()=>Po(C.length,V),[C.length,V]),q=s.useMemo(()=>yr(C.length,V),[C.length,V]),I=s.useMemo(()=>C.filter(X=>X.prefix==="title1"),[C]),A=s.useMemo(()=>C.filter(X=>X.prefix==="title2"||X.prefix==="title3"),[C]),j=s.useMemo(()=>wi(I,E),[I,E]),ie=s.useMemo(()=>wi(A,E),[A,E]),ae=!!(t.title1||t.title2||t.title3),O=k!==null;if(!(ae||O))return null;const N=(p??0)>0||o,le=(X,Ie)=>{const Se=C.findIndex(He=>He.prefix===X.prefix);if(!G||Ie==="single-row")return{effectiveWidth:q[Se]??0,resolvedWidth:w[Se]??0,maxWidth:yn(Se,w)};if(Ie==="two-row-top"){const He=I.findIndex(We=>We.prefix===X.prefix);return{effectiveWidth:j.effective[He]??0,resolvedWidth:j.resolved[He]??0,maxWidth:yn(He,j.resolved)}}const J=A.findIndex(He=>He.prefix===X.prefix);return{effectiveWidth:ie.effective[J]??0,resolvedWidth:ie.resolved[J]??0,maxWidth:yn(J,ie.resolved)}},Q=(X,Ie,Se)=>{if(!G||Se==="single-row"){const qe=X.findIndex(ve=>ve.prefix===Ie.prefix),tt=X.map(ve=>E[ve.widthKey]),et=Po(X.length,tt);return{effectiveWidth:yr(X.length,tt)[qe]??0,resolvedWidth:et[qe]??0,maxWidth:yn(qe,et)}}if(Se==="two-row-top"){const qe=X.filter(ve=>ve.prefix==="title1"),tt=qe.findIndex(ve=>ve.prefix===Ie.prefix),{resolved:et,effective:Ge}=wi(qe,E);return{effectiveWidth:Ge[tt]??0,resolvedWidth:et[tt]??0,maxWidth:yn(tt,et)}}const J=X.filter(qe=>qe.prefix==="title2"||qe.prefix==="title3"),He=J.findIndex(qe=>qe.prefix===Ie.prefix),{resolved:We,effective:ot}=wi(J,E);return{effectiveWidth:ot[He]??0,resolvedWidth:We[He]??0,maxWidth:yn(He,We)}},be=X=>Gu(C,w,T,X)+(G?0:p??0),Pe=()=>G?0:p??0,ye=X=>A.slice(0,X).reduce((Ie,Se,J)=>Ie+(Se.marginLeftKey?T[Se.marginLeftKey]??0:0)+(ie.resolved[J]??0),0),ce=X=>{const Ie=A[X];return ye(X)+(Ie.marginLeftKey?T[Ie.marginLeftKey]??0:0)+(ie.resolved[X]??0)},Y=(X,Ie,Se)=>{const J=X.marginLeftKey?T[X.marginLeftKey]??0:0,{effectiveWidth:He,resolvedWidth:We,maxWidth:ot}=Se??le(X,Ie),qe=Math.max(J,ei),tt=o&&Ie==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":X.prefix,style:{width:F.scalingValue(He,i),...J>0?{marginLeft:F.scalingValue(J,i)}:{}},children:[a.jsx("p",{className:X.className,style:X.style,children:X.text}),tt&&X.marginLeftKey?a.jsx("div",{"data-controls":X.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(We),style:{position:"absolute",top:0,left:F.scalingValue(-J,i),width:F.scalingValue(qe,i),height:"100%",pointerEvents:"auto"}}):null,tt?a.jsx("div",{"data-controls":X.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ot),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:F.scalingValue(-Ln/2,i),width:F.scalingValue(Ln,i),height:"100%",pointerEvents:"auto"}}):null]},X.className)},se=(X="two-row")=>{const Ie=C.findIndex(He=>He.prefix==="title1"),Se=Ie>=0?w[Ie]:E.title1Width,J=X==="two-row"&&o;return a.jsx("div",{...J?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Se)}:{},style:{width:F.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...J?{pointerEvents:"auto"}:{}}})},pe=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:$,"aria-hidden":"true",children:" "}),fe=X=>{const Ie=Si(e,X,$,L,D);return a.jsx(a.Fragment,{children:Ie.map(Se=>Y(Se,"single-row",Q(Ie,Se,"single-row")))})},we=X=>{const Ie=Si(e,X,$,L,D),Se=Ie.find(J=>J.prefix==="title1");return Se?Y(Se,"two-row-top",Q(Ie,Se,"two-row-top")):null},Re=(X,Ie=!1)=>{const Se=Si(e,X,$,L,D),J=Se.filter(ot=>ot.prefix==="title2"||ot.prefix==="title3"),He=o&&Ie;return J.length>0||He||(m??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[J.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[a.jsx("div",{className:`${e}-titles-stack`,children:J.map(ot=>Y(ot,"two-row-bottom",Q(Se,ot,"two-row-bottom")))}),Ie&&o?a.jsxs(a.Fragment,{children:[de(),z()]}):null]}):null,(m??0)>0||He?a.jsx("div",{"data-controls":He?"titleRowMarginBottom":void 0,"data-controls-axis":He?"y":void 0,"data-controls-reverse":He?"":void 0,className:He?`${e}-control`:void 0,style:{height:_,width:"100%",flexShrink:0,pointerEvents:He?"auto":"none"}}):null]}):null},ge=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:F.scalingValue(f??0,i),height:F.scalingValue(f??0,i),marginRight:P,"--close-icon-hover-color":W},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:X=>{X.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(mn,{url:k??"",fill:S,hoverFill:i&&!r?S:W,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:P,height:"100%",pointerEvents:"auto"}})]}),xe=()=>O?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:ge()}):null,Ce=X=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:X})}),h=X=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[O||ae?pe():null,N?se("two-row"):null,Ce(X),xe()]}),K=(X,Ie=!1)=>a.jsxs(a.Fragment,{children:[h(we(X)),Re(X,Ie)]}),Z=()=>{const X=G?-1:C.findIndex(J=>J.prefix==="title1"),Ie=!G&&(o||(p??0)>0)?(()=>{const J=p??0,He=X>=0?w[X]:E.title1Width,We=Math.max(J,ei);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(He),style:{position:"absolute",top:0,left:0,width:F.scalingValue(We,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Se=C.flatMap((J,He)=>{if(!J.marginLeftKey)return[];const We=T[J.marginLeftKey]??0,ot=Vu(C,w,T,He)+Pe(),qe=Math.max(We,ei);return a.jsx("div",{"data-controls":J.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(w[He]),style:{position:"absolute",top:0,left:F.scalingValue(ot,i),width:F.scalingValue(qe,i),height:"100%",pointerEvents:"auto"}},J.marginLeftKey)});return Ie?[Ie,...Se]:Se},ne=()=>C.map((X,Ie)=>{const Se=yn(Ie,w),He=be(Ie)-Ln/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":X.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Se),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:F.scalingValue(He,i),width:F.scalingValue(Ln,i),height:"100%",pointerEvents:"auto"}})},`${X.widthKey}-junction`)}),de=()=>A.flatMap((X,Ie)=>{if(!X.marginLeftKey)return[];const Se=T[X.marginLeftKey]??0,J=ye(Ie),He=Math.max(Se,ei),{resolvedWidth:We}=le(X,"two-row-bottom");return a.jsx("div",{"data-controls":X.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(We),style:{position:"absolute",top:0,left:F.scalingValue(J,i),width:F.scalingValue(He,i),height:"100%",pointerEvents:"auto"}},X.marginLeftKey)}),z=()=>A.map((X,Ie)=>{const{maxWidth:Se}=le(X,"two-row-bottom"),He=ce(Ie)-Ln/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":X.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Se),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:F.scalingValue(He,i),width:F.scalingValue(Ln,i),height:"100%",pointerEvents:"auto"}})},`${X.widthKey}-junction`)}),R=()=>!o||G?null:a.jsxs(a.Fragment,{children:[Z(),ne()]}),ee=!!(t.title2||t.title3||(m??0)>0||o),te=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[O||ae?pe():null,N?se("single-row"):null,ae?Ce(fe(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),xe(),R()]}),me=()=>a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...ee?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:ee?void 0:{flex:"0 0 auto",height:"auto"},children:K(t,!0)}),R()]});return a.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:U,flexShrink:0},children:o&&a.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${e}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:B,pointerEvents:"auto"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...G?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${G?` ${e}-lightbox-content-area-stacked`:""}`,children:a.jsx("div",{className:`${e}-text-bar-cell${G?` ${e}-text-bar-cell-stacked`:""}`,style:G?void 0:{flex:1,minWidth:0,width:"100%"},children:G?me():te()})})})]})}function dv(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function uv(e){return`
|
|
7283
7311
|
.${e}-wrapper {
|
|
7284
7312
|
display: grid;
|
|
7285
7313
|
align-items: start;
|
|
@@ -7599,7 +7627,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
7599
7627
|
pointer-events: auto;
|
|
7600
7628
|
flex-shrink: 0;
|
|
7601
7629
|
}
|
|
7602
|
-
`}const Pc={url:"",name:"",objectFit:"cover"},_n=500,Uo=650,Sn="cubic-bezier(0.22, 1, 0.36, 1)",pv=72,mv=50,gv=1e4,hv=650,fv=500;function yv(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,r=e.top-t.top;return`translate(${o}px, ${r}px) scale(${n}, ${i})`}function qu(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=fa(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 vv(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?qu(i,n):null}function xv(e){return e.reduce((t,n,i)=>{const o=Ml(n.gallery),l=Al(o).filter(c=>c.lightboxMedia).map(c=>c.lightboxMedia);return l.length===0||t.push({gridIndex:i,items:l,entry:{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}),t},[])}function ir(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 Ic(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return ir(e,i,n)}const bv=.03;function Uu(e){return e.width*bv}const ns={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Wr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Rc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Sv(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Bs(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,c=o/r;if(l>c){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const d=r*l;return{width:d,height:r,left:i.left+(o-d)/2,top:i.top}}function wv(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Bs(e,t.width,t.height)}function $v(e,t){if(zo(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 Cv(e){const t=new Set,n=[];for(const i of e){const o=Ml(i.gallery),r=Al(o);for(const l of r)for(const c of[l.displayMedia,l.lightboxMedia])c!=null&&c.url&&!t.has(c.url)&&(t.add(c.url),n.push(c))}return n}function Tv({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>zo(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function Io(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:c}=n,d=Uu(n);return t==="left"?{left:l+d-i,top:r,width:i,height:o}:{left:l+c-d,top:r,width:i,height:o}}function ya(e,t,n){const i=Io(e,t,n);return{...i,left:2*i.left-e.left}}function Lv(e,t,n){const{left:i,width:o}=n,r=Uu(n);return t==="left"?{left:i,top:e.top,width:r,height:e.height}:{left:i+o-r,top:e.top,width:r,height:e.height}}function Ku(e,t,n,i){const o=Io(e,"left",i),r=Io(e,"right",i),l=ya(e,"left",i),c=ya(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:r,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:c,end:r};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:r};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:r,end:c};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function Pv(e,t,n,i){const{start:o,end:r}=Ku(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function Iv(e,t,n){const i=Io(e,t,n),o=ya(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Yu(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 Ml(e){if(!e)return;if(Yu(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??Pc,i??o??Pc]}]}function Rv(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function kv(e){const[t]=e.media;return t!=null&&t.url?t:null}function Al(e){if(!Array.isArray(e)||e.length===0)return[];if(Yu(e)){const t=[];for(const n of e){const i=Rv(n);if(!i)continue;const o=kv(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 zo(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Ev({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return zo(e)?a.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}):a.jsx("img",{src:e.url,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function Mv({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const c=s.useRef(null);return s.useEffect(()=>{const d=c.current;return n==null||n(d??null),()=>{d==null||d.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:c,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:d=>d.stopPropagation(),style:o},e)})}function Or({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return zo(e)?a.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.url,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.url,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function Av({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,canNavigate:d,lightboxEntries:u,entryIdx:p,layoutId:y,sourceRect:v,resolveCloseSourceRect:m,onClose:g,onPrev:x,onNext:b}){const k=s.useRef(null),f=s.useRef(null),S=s.useRef(null),O=s.useRef(new Map),[U,z]=s.useState(0),I=s.useRef(null),N=s.useRef(0),q=s.useRef(0),$=s.useRef("none"),L=s.useRef(!1),D=s.useRef(!1),_=s.useRef(!1),C=s.useRef(null),T=s.useRef(null),B=s.useRef(null),w=s.useRef(()=>{}),X=s.useRef(null),R=s.useRef(null),E=s.useRef(null),V=s.useRef(!1),[ie,re]=s.useState(null),[W,ae]=s.useState(ns),[A,le]=s.useState(0),[ee,xe]=s.useState("opening"),[Pe,ye]=s.useState(0),[pe,Y]=s.useState(0),[se,de]=s.useState(!1),[ve,$e]=s.useState(null),[ke,he]=s.useState(null),[Se,Ce]=s.useState(null),[h,K]=s.useState(!1),[Z,te]=s.useState(null),[me,j]=s.useState(!1),P=s.useRef(!1),[Q,ne]=s.useState(!1),[ue,G]=s.useState(!1),Ie=s.useRef(n),be=s.useRef(void 0),J=t[n],He=J?zo(J):!1,We=pe!==0||se,ot=!l&&(!r||!!c),qe=d&&!l,tt=u.length>1,et=s.useCallback((H,Le)=>t.length<=1?null:t[(H+Le+t.length)%t.length]??null,[t]),je=tt?ir(u,p,-1):et(n,-1),fe=tt?ir(u,p,1):et(n,1),_e=ve===-1&&We?tt&&ke!==null?ir(u,ke,-1):Se!==null?et(Se,-1):null:null,Be=ve===1&&We?tt&&ke!==null?ir(u,ke,1):Se!==null?et(Se,1):null:null,Ze=_e&&_e.url!==(je==null?void 0:je.url)?_e:null,we=Be&&Be.url!==(fe==null?void 0:fe.url)?Be:null,Ne=je&&qe?(()=>{const H=tt?Ic(u,p,-1):t.length>2?et((n-1+t.length)%t.length,-1):null;return H&&H.url!==je.url?H:null})():null,Ue=fe&&qe?(()=>{const H=tt?Ic(u,p,1):t.length>2?et((n+1)%t.length,1):null;return H&&H.url!==fe.url?H:null})():null,Je=Ze??Ne,st=we??Ue,it=s.useCallback((H,Le,Ve)=>{if(!H||!Le||!Ve)return;const Fe=O.current,ft=Fe.get(H);(ft==null?void 0:ft.width)===Le&&(ft==null?void 0:ft.height)===Ve||(Fe.set(H,{width:Le,height:Ve}),z(Ht=>Ht+1))},[]),Oe=s.useCallback(H=>{if(!(H!=null&&H.url))return null;const Le=O.current.get(H.url);return wv(f.current,Le)},[U,A]),Ae=s.useCallback(()=>{if(!J)return;const H=Oe(J);if(H){re(H);return}const Le=f.current;Le&&re(Rc(Le))},[J,Oe]),gt=s.useCallback(H=>{if(tt){const Le=u.length;he((p+H+Le)%Le),Ce(null);return}t.length>1&&(Ce((n+H+t.length)%t.length),he(null))},[tt,u.length,p,t.length,n]),ze=s.useCallback(H=>{_.current=H,de(H)},[]),De=s.useCallback(()=>{C.current!==null&&(window.clearTimeout(C.current),C.current=null)},[]),Xe=s.useCallback(()=>{De(),C.current=window.setTimeout(()=>{De(),ze(!1)},Uo+32)},[De,ze]),ct=s.useCallback(()=>{const H=k.current;if(!H){ae({left:0,top:0,width:typeof window<"u"?window.innerWidth:ns.width,height:typeof window<"u"?window.innerHeight:ns.height});return}const Le=H.getBoundingClientRect();ae({left:Le.left,top:Le.top,width:Le.width,height:Le.height})},[]),ge=s.useCallback((H,Le)=>{if(We){if(Q&&!se)return`translate(${pe}px, 0px)`;if(se&&ve!==null){const Ve=Oe(H);if(!Ve)return;const{x:Fe,y:ft}=Pv(Ve,Le,ve,W);return`translate(${Fe}px, ${ft}px)`}if(se)return"translate(0px, 0px)"}},[We,Q,se,pe,ve,W,Oe]),Ee=s.useCallback(()=>{const H=T.current;T.current=null,De(),ze(!1),$e(null),he(null),Ce(null),Y(0),ne(!1),L.current=!1,q.current=0,$.current="none",H===-1?x():H===1&&b()},[De,ze,x,b]),nt=s.useCallback(()=>{De(),C.current=window.setTimeout(()=>{T.current!==null&&Ee()},Uo+32)},[De,Ee]),pt=s.useCallback(()=>{De(),T.current=null,ze(!1),$e(null),he(null),Ce(null),Y(0),ne(!1),L.current=!1,q.current=0,$.current="none"},[De,ze]),Ge=s.useCallback(H=>{if(!(!qe||!ie)){if(_.current){if(T.current===H){B.current=H,Ee();return}pt()}De(),gt(H),T.current=H,$e(H),ze(!0),nt()}},[qe,ie,Ee,pt,De,gt,ze,nt]);w.current=Ge;const vt=s.useCallback(()=>{X.current=null,V.current=!1,R.current!==null&&(window.clearInterval(R.current),R.current=null),E.current!==null&&(window.clearTimeout(E.current),E.current=null)},[]),Rt=s.useCallback(H=>{R.current!==null&&window.clearInterval(R.current);const Le=V.current?fv:hv;R.current=window.setInterval(()=>{w.current(H)},Le)},[]),At=s.useCallback(H=>{X.current!==H&&(vt(),X.current=H,V.current=!1,w.current(H),Rt(H),E.current=window.setTimeout(()=>{E.current=null,X.current===H&&(V.current=!0,Rt(H))},gv))},[vt,Rt]),wt=s.useCallback(()=>{const H=f.current;if(!H)return;const Le=J==null?void 0:J.url,Ve=Le?O.current.get(Le):void 0;if(Ve!=null&&Ve.width&&(Ve!=null&&Ve.height)){re(Bs(H,Ve.width,Ve.height));return}const Fe=S.current;if(Fe&&Le&&(Fe.src===Le||Fe.currentSrc===Le)){const{width:Ht,height:mt}=Sv(Fe);if(Ht&&mt){it(Le,Ht,mt),re(Bs(H,Ht,mt));return}}const ft=Rc(H);!ft.width||!ft.height||re(ft)},[J==null?void 0:J.url,it]),Vt=s.useCallback(H=>{if(S.current=H,!!H){if(H instanceof HTMLVideoElement){H.readyState>=1&&H.videoWidth>0&&wt();return}H.complete&&H.naturalWidth>0&&wt()}},[wt]),jt=s.useCallback(()=>{ct(),wt(),le(H=>H+1)},[ct,wt]);s.useEffect(()=>{jt();const H=f.current,Le=k.current,Ve=new ResizeObserver(()=>jt());return H&&Ve.observe(H),Le&&Ve.observe(Le),window.addEventListener("resize",jt),()=>{Ve.disconnect(),window.removeEventListener("resize",jt)}},[jt,n,y]),s.useLayoutEffect(()=>{if(!J)return;const H=S.current;if(H){if(H instanceof HTMLImageElement&&H.complete&&H.naturalWidth>0){wt();return}H instanceof HTMLVideoElement&&H.readyState>=1&&H.videoWidth>0&&wt()}},[J==null?void 0:J.url,n,wt]),s.useEffect(()=>{Ae()},[Ae,U]),s.useEffect(()=>{const H=new Set,Le=[],Ve=Fe=>{!(Fe!=null&&Fe.url)||H.has(Fe.url)||(H.add(Fe.url),Le.push(Fe))};t.forEach(Ve),u.forEach(Fe=>Fe.items.forEach(Ve)),Le.forEach(Fe=>{O.current.has(Fe.url)||$v(Fe,it)})},[t,u,it]),s.useEffect(()=>{if(ee!=="opening"||!ie)return;if(!v){xe("open");return}K(!1);const H=requestAnimationFrame(()=>{requestAnimationFrame(()=>{K(!0),xe("open")})});return()=>cancelAnimationFrame(H)},[ee,ie,v]),s.useEffect(()=>{if(ee!=="closing")return;const H=setTimeout(()=>g(),_n);return()=>clearTimeout(H)},[ee,g]),s.useEffect(()=>()=>{De()},[De]),s.useLayoutEffect(()=>{Ie.current===n&&be.current===(J==null?void 0:J.url)||(De(),T.current=null,$e(null),he(null),Ce(null),ye(0),Y(0),ze(!1),G(!1),ne(!1),N.current=0,q.current=0,$.current="none",L.current=!1,I.current=null,D.current=!1,S.current=null,Ae(),Ie.current=n,be.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,ze,De,Ae]),s.useLayoutEffect(()=>{const H=B.current;H!==null&&(B.current=null,requestAnimationFrame(()=>{w.current(H)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(ee==="opening"){P.current=!1,j(!1);return}if(ee!=="open"||P.current)return;if(!je&&!fe){P.current=!0;return}j(!1);const H=requestAnimationFrame(()=>{requestAnimationFrame(()=>{j(!0),P.current=!0})});return()=>cancelAnimationFrame(H)},[ee,je==null?void 0:je.url,fe==null?void 0:fe.url]),s.useEffect(()=>{if(ee!=="open")return;const H=()=>{const mt=Lt=>{Lt.stopPropagation(),Lt.preventDefault(),document.removeEventListener("click",mt,!0)};document.addEventListener("click",mt,!0)},Le=mt=>{const Lt=mt<0?1:-1;De(),gt(Lt),T.current=Lt,$e(Lt),ze(!0),nt()},Ve=mt=>{if(Math.abs(mt)>mv&&qe){Le(mt);return}T.current=null,$e(null),he(null),Ce(null),ze(!0),Y(0),Xe()},Fe=mt=>{if(mt.touches.length!==1||_.current)return;const Lt=mt.touches[0];D.current=!0,I.current={x:Lt.clientX,y:Lt.clientY},$.current="none",q.current=0,L.current=!1},ft=mt=>{if(!I.current||mt.touches.length!==1||_.current)return;const Lt=mt.touches[0],Ut=Lt.clientX-I.current.x,Dt=Lt.clientY-I.current.y;if($.current==="none"){if(Math.abs(Ut)<10&&Math.abs(Dt)<10)return;if(Math.abs(Ut)>Math.abs(Dt)){if(!qe)return;$.current="horizontal"}else if(Dt>0){if(!ot)return;$.current="vertical"}else return}if($.current==="horizontal"){L.current=!0,ne(!0),q.current=Ut,Y(Ut),mt.preventDefault();return}$.current==="vertical"&&(L.current=!0,ne(!0),N.current=Dt,ye(Dt),mt.preventDefault())},Ht=()=>{if(!I.current)return;const mt=$.current,Lt=L.current;if(Lt&&mt==="horizontal")Ve(q.current),H();else if(Lt&&mt==="vertical"){const Ut=N.current;if(ot&&Ut>pv){const Dt=window.innerHeight;N.current=Dt,G(!0),ye(Dt),xe("closing")}else N.current=0,ye(0);H()}else mt==="horizontal"&&Math.abs(q.current)>0&&(Ve(q.current),H());I.current=null,$.current="none",q.current=0,L.current=!1,ne(!1)};return document.addEventListener("touchstart",Fe,{passive:!0}),document.addEventListener("touchmove",ft,{passive:!1}),document.addEventListener("touchend",Ht),document.addEventListener("touchcancel",Ht),()=>{document.removeEventListener("touchstart",Fe),document.removeEventListener("touchmove",ft),document.removeEventListener("touchend",Ht),document.removeEventListener("touchcancel",Ht)}},[ee,qe,ze,Xe,De,ot,nt,gt]);const Kt=s.useCallback(()=>{const H=(m==null?void 0:m())??v??null;H&&ie&&(te(H),K(!0)),xe("closing")},[m,v,ie]);s.useEffect(()=>{const H=Fe=>{if(Fe.key==="Escape"){if(r&&c||ee==="closing")return;vt(),Kt();return}if(Fe.key!=="ArrowLeft"&&Fe.key!=="ArrowRight"||ee!=="open"||!qe)return;Fe.preventDefault();const ft=Fe.key==="ArrowLeft"?-1:1;Fe.repeat&&X.current===ft||At(ft)},Le=Fe=>{if(Fe.key!=="ArrowLeft"&&Fe.key!=="ArrowRight")return;const ft=Fe.key==="ArrowLeft"?-1:1;X.current===ft&&vt()},Ve=()=>{vt()};return window.addEventListener("keydown",H),window.addEventListener("keyup",Le),window.addEventListener("blur",Ve),()=>{window.removeEventListener("keydown",H),window.removeEventListener("keyup",Le),window.removeEventListener("blur",Ve),vt()}},[ee,r,c,Kt,qe,At,vt]),s.useEffect(()=>{ee!=="open"&&vt()},[ee,vt]);const Yt=()=>{ee==="closing"||l||Kt()},kt=ee==="open",Bt=ee==="closing",rn=Pe>0?Math.max(0,1-Pe/500):1,xt=Pe>0?Math.max(.35,1-Pe/500):1,yt=s.useCallback(H=>{if(!(H.propertyName!=="transform"||!_.current)){if(T.current!==null){Ee();return}De(),ze(!1)}},[De,ze,Ee]),Me=ee==="closing"?Z??v:v,Qe=Me&&ie&&(ee==="opening"||Bt)?yv(Me,ie):void 0,rt=We&&J?ge(J,"center"):Pe>0?`translateY(${Pe}px)`:Qe,dt=ie?Wr(ie,W):null,Pt=!!(Me&&ie),St=Pt&&(ee==="closing"||ee==="open"&&h),ht={position:"absolute",top:dt==null?void 0:dt.top,left:dt==null?void 0:dt.left,width:dt==null?void 0:dt.width,height:dt==null?void 0:dt.height,objectFit:"contain",transformOrigin:"top left",transform:rt,opacity:Pe>0?xt:Pt?1:ee==="opening"||Bt?0:1,transition:Q&&!se?"none":se?`transform ${Uo}ms ${Sn}`:ue?`transform ${_n}ms ${Sn}, opacity ${_n}ms ${Sn}`:St?`transform ${_n}ms ${Sn}`:ee==="opening"||Bt?`opacity ${_n}ms ${Sn}`:"none",pointerEvents:He&&kt&&!We?"auto":"none",touchAction:He&&kt?"none":void 0,zIndex:1,overflow:He?"hidden":void 0},Wt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:kt&&!We?"auto":"none"},Tt=(H,Le,Ve="adjacent")=>{const Fe=Oe(H);if(!Fe)return{display:"none"};const ft=Ve==="far"?Le==="left"?"far-left":"far-right":Le==="left"?"left-adjacent":"right-adjacent",{start:Ht}=ve!==null?Ku(Fe,ft,ve,W):{start:Ve==="far"?ya(Fe,Le,W):Io(Fe,Le,W)},mt=Wr(Ht,W),Lt=ge(H,ft),Ut=!We&&Ve==="adjacent"&&kt&&!me?Iv(Fe,Le,W):null,Dt=Ve==="far"&&We&&ve===(Le==="left"?-1:1),an=Q&&!se?!1:se,ln=Ve==="adjacent"&&kt&&me&&!We;return{position:"absolute",top:mt.top,left:mt.left,width:mt.width,height:mt.height,objectFit:"contain",transform:Lt??(Ut?`translate(${Ut.x}px, ${Ut.y}px)`:void 0),opacity:Ve==="far"?kt&&Dt?1:0:kt?1:0,transition:an?Ve==="far"?`transform ${Uo}ms ${Sn}`:`transform ${Uo}ms ${Sn}, opacity ${_n}ms ${Sn}`:ln?`transform ${_n}ms ${Sn}`:ee==="opening"||Bt?`opacity ${_n}ms ${Sn}`:"none",pointerEvents:"none",zIndex:1}},Ot=(H,Le)=>{const Ve=Oe(H);return Ve?Lv(Io(Ve,Le,W),Le,W):null},Gt=H=>Le=>{if(!l){if(D.current){D.current=!1;return}Le.stopPropagation(),Ge(H)}},Mt=je?Ot(je,"left"):null,_t=fe?Ot(fe,"right"):null,Ft=Mt?Wr(Mt,W):null,ut=_t?Wr(_t,W):null;return a.jsxs("div",{ref:k,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:ee==="open"?"none":void 0},onClick:Yt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:kt?rn:0,transition:Q?"none":`opacity ${_n}ms ${Sn}`,pointerEvents:"none"}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[a.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:f,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:kt?1:0,transition:Q?"none":`opacity ${_n}ms ${Sn}`,pointerEvents:"none"},children:a.jsx(Xu,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,onClose:Yt})})]}),kt&&Je&&a.jsx(Or,{media:Je,style:Tt(Je,"left","far"),onMeasure:it,onTransitionEnd:yt},`far-prev-${Je.url}`),kt&&je&&a.jsxs(a.Fragment,{children:[a.jsx(Or,{media:je,style:Tt(je,"left"),onMeasure:it,onTransitionEnd:yt},`prev-${je.url}`),Ft&&a.jsx("div",{style:{position:"absolute",top:Ft.top,left:Ft.left,width:Ft.width,height:Ft.height,cursor:l||Q?"default":"pointer",pointerEvents:l||Q?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),kt&&fe&&a.jsxs(a.Fragment,{children:[a.jsx(Or,{media:fe,style:Tt(fe,"right"),onMeasure:it,onTransitionEnd:yt},`next-${fe.url}`),ut&&a.jsx("div",{style:{position:"absolute",top:ut.top,left:ut.left,width:ut.width,height:ut.height,cursor:l||Q?"default":"pointer",pointerEvents:l||Q?"none":"auto",zIndex:3},onClick:Gt(1)})]}),kt&&st&&a.jsx(Or,{media:st,style:Tt(st,"right","far"),onMeasure:it,onTransitionEnd:yt},`far-next-${st.url}`),ie&&J&&(He?a.jsx(Mv,{src:J.url,phase:ee,onMediaElement:Vt,wrapperStyle:ht,videoStyle:Wt,onLoadedMetadata:wt,onTransitionEnd:yt},`${n}-${J.url}`):a.jsx("img",{ref:Vt,src:J.url,alt:J.name,onLoad:wt,onTransitionEnd:yt,style:ht},`${n}-${J.url}`))]})}function Fv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:c}=F.useScopedStyles(),{gridLayout:d,verticalGap:u,align:p="top",imageDisplay:y}=e,v=(y==null?void 0:y.display)==="cover",m=(y==null?void 0:y.ratioValue)??"1:1",g=(y==null?void 0:y.reversed)??!1,[x,b]=m.split(":").map(Number),S=`${g?b:x} / ${g?x:b}`,O=d.entryWidth??.2,U=d.columnsCount,z=F.scalingValue(O,n),I=F.scalingValue(d.horizontalGap??0,n),N=z,q=z,$={width:N,...v?{aspectRatio:S,height:"auto",overflow:"hidden"}:{height:"auto"}},L=v?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},D=s.useRef(null),[_,C]=s.useState(!1),[T,B]=s.useState([]),[w,X]=s.useState(0),[R,E]=s.useState(0),[V,ie]=s.useState(null),[re,W]=s.useState({title1:"",title2:"",title3:""}),ae=(()=>{const Se={},Ce=D.current?getComputedStyle(D.current).getPropertyValue("--cntrl-article-width").trim():"";return Ce&&(Se["--cntrl-article-width"]=Ce),Se})(),A=!n||i||o,le=s.useMemo(()=>uv(c),[c]),ee=t??[],xe=ee.length%U||U,Pe=xe<U&&ee.length>0,ye=ee.length-xe,pe=Pe?Math.floor((U-xe)/2)+1:1,Y=s.useMemo(()=>xv(ee),[ee]),se=s.useMemo(()=>Cv(ee),[ee]),de=(Se,Ce,h)=>{if(n&&!o&&!i)return;const K=Y.findIndex(te=>te.gridIndex===Se);if(K<0)return;const Z=Y[K];E(K),B(Z.items),X(Ce),W(Z.entry),ie(h??null),C(!0)},ve=s.useCallback(()=>{C(!1),ie(null)},[]),$e=s.useCallback(()=>{const Se=Y[R];return!Se||!D.current?V:vv(D.current,Se.gridIndex,v?"cover":"contain")??V},[Y,R,V,v]),ke=s.useCallback(Se=>{if(Y.length>1){const Ce=Y.length,h=(R+Se+Ce)%Ce,K=Y[h],Z=Math.min(w,K.items.length-1);E(h),B(K.items),X(Z),W(K.entry);return}X(Ce=>(Ce+Se+T.length)%T.length)},[Y,R,w,T.length]),he=Y.length>1||T.length>1;return s.useEffect(()=>{if(!_||typeof document>"u")return;const Se=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Se}},[_]),s.useEffect(()=>{!n||o||i||C(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:le}}),a.jsx(Tv,{mediaList:se}),a.jsx("div",{ref:D,className:`${c}-wrapper ${c}-align-entries ${c}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${U}, ${z})`,rowGap:0,columnGap:I,width:F.scalingValue(d.wrapperWidth??0,n),[`--${c}-align-entries-row-gap`]:F.scalingValue(u??0,n)},children:ee.map((Se,Ce)=>{const h=Ml(Se.gallery),K=Al(h),Z=K.filter(ne=>ne.lightboxMedia).map(ne=>ne.lightboxMedia),te=Math.floor(Ce/U)===Math.ceil(ee.length/U)-1,me=Pe&&Ce>=ye?`${pe+(Ce-ye)}`:void 0,j=K[0],P=j!=null&&j.lightboxMedia?Z.findIndex(ne=>ne.url===j.lightboxMedia.url):-1,Q=a.jsx("div",{className:`${c}-item-image-wrapper`,style:$,children:K.length>0&&a.jsx(Ev,{media:j.displayMedia,gridIndex:Ce,className:`${c}-item-${zo(j.displayMedia)?"video":"image"}`.trim(),style:L,onMediaClick:A&&P>=0?ne=>de(Ce,P,qu(ne.currentTarget,v?"cover":"contain")):void 0})});return a.jsx("div",{className:`${c}-item`,children:a.jsxs("div",{className:[o?`${c}-item-inner`:`${c}-item-inner-hidden`,te?`${c}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:z,...me?{gridColumn:me}:{}},children:[a.jsx("div",{className:`${c}-item-title-row`,children:a.jsx("div",{style:{height:0,width:q}})}),a.jsx("a",{className:`${c}-item-image-link`,children:Q}),a.jsx("div",{className:`${c}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:q}})})]})},Ce)})}),_&&typeof document<"u"&&(()=>{const Se=(l?document.getElementById(l):null)??document.body;return Gn.createPortal(a.jsx("div",{style:ae,"data-selection":"none",children:a.jsx(Av,{prefix:c,items:T,index:w,entry:re,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:he,lightboxEntries:Y,entryIdx:R,layoutId:r,sourceRect:V,resolveCloseSourceRect:$e,onClose:ve,onPrev:()=>ke(-1),onNext:()=>ke(1)})}),Se)})()]})}const Nv=`import { CommonComponentProps } from '../props';
|
|
7630
|
+
`}const Pc={url:"",name:"",objectFit:"cover"},_n=500,Uo=650,Sn="cubic-bezier(0.22, 1, 0.36, 1)",pv=72,mv=50,gv=1e4,hv=650,fv=500;function yv(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,r=e.top-t.top;return`translate(${o}px, ${r}px) scale(${n}, ${i})`}function qu(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=ya(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 vv(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?qu(i,n):null}function xv(e){return e.reduce((t,n,i)=>{const o=Ml(n.gallery),l=Al(o).filter(c=>c.lightboxMedia).map(c=>c.lightboxMedia);return l.length===0||t.push({gridIndex:i,items:l,entry:{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}),t},[])}function ir(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 Ic(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return ir(e,i,n)}const bv=.03;function Uu(e){return e.width*bv}const is={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Wr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Rc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Sv(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Bs(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,c=o/r;if(l>c){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const d=r*l;return{width:d,height:r,left:i.left+(o-d)/2,top:i.top}}function wv(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Bs(e,t.width,t.height)}function $v(e,t){if(zo(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 Cv(e){const t=new Set,n=[];for(const i of e){const o=Ml(i.gallery),r=Al(o);for(const l of r)for(const c of[l.displayMedia,l.lightboxMedia])c!=null&&c.url&&!t.has(c.url)&&(t.add(c.url),n.push(c))}return n}function Tv({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>zo(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function Io(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:c}=n,d=Uu(n);return t==="left"?{left:l+d-i,top:r,width:i,height:o}:{left:l+c-d,top:r,width:i,height:o}}function va(e,t,n){const i=Io(e,t,n);return{...i,left:2*i.left-e.left}}function Lv(e,t,n){const{left:i,width:o}=n,r=Uu(n);return t==="left"?{left:i,top:e.top,width:r,height:e.height}:{left:i+o-r,top:e.top,width:r,height:e.height}}function Ku(e,t,n,i){const o=Io(e,"left",i),r=Io(e,"right",i),l=va(e,"left",i),c=va(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:r,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:c,end:r};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:r};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:r,end:c};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function Pv(e,t,n,i){const{start:o,end:r}=Ku(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function Iv(e,t,n){const i=Io(e,t,n),o=va(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Yu(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 Ml(e){if(!e)return;if(Yu(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??Pc,i??o??Pc]}]}function Rv(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function kv(e){const[t]=e.media;return t!=null&&t.url?t:null}function Al(e){if(!Array.isArray(e)||e.length===0)return[];if(Yu(e)){const t=[];for(const n of e){const i=Rv(n);if(!i)continue;const o=kv(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 zo(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Ev({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return zo(e)?a.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}):a.jsx("img",{src:e.url,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function Mv({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const c=s.useRef(null);return s.useEffect(()=>{const d=c.current;return n==null||n(d??null),()=>{d==null||d.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:c,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:d=>d.stopPropagation(),style:o},e)})}function Or({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return zo(e)?a.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.url,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.url,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function Av({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,canNavigate:d,lightboxEntries:u,entryIdx:p,layoutId:y,sourceRect:v,resolveCloseSourceRect:m,onClose:g,onPrev:x,onNext:b}){const k=s.useRef(null),f=s.useRef(null),S=s.useRef(null),W=s.useRef(new Map),[U,B]=s.useState(0),P=s.useRef(null),_=s.useRef(0),G=s.useRef(0),$=s.useRef("none"),L=s.useRef(!1),D=s.useRef(!1),E=s.useRef(!1),T=s.useRef(null),C=s.useRef(null),V=s.useRef(null),w=s.useRef(()=>{}),q=s.useRef(null),I=s.useRef(null),A=s.useRef(null),j=s.useRef(!1),[ie,ae]=s.useState(null),[O,oe]=s.useState(is),[N,le]=s.useState(0),[Q,be]=s.useState("opening"),[Pe,ye]=s.useState(0),[ce,Y]=s.useState(0),[se,pe]=s.useState(!1),[fe,we]=s.useState(null),[Re,ge]=s.useState(null),[xe,Ce]=s.useState(null),[h,K]=s.useState(!1),[Z,ne]=s.useState(null),[de,z]=s.useState(!1),R=s.useRef(!1),[ee,te]=s.useState(!1),[me,X]=s.useState(!1),Ie=s.useRef(n),Se=s.useRef(void 0),J=t[n],He=J?zo(J):!1,We=ce!==0||se,ot=!l&&(!r||!!c),qe=d&&!l,tt=u.length>1,et=s.useCallback((H,Le)=>t.length<=1?null:t[(H+Le+t.length)%t.length]??null,[t]),Ge=tt?ir(u,p,-1):et(n,-1),ve=tt?ir(u,p,1):et(n,1),_e=fe===-1&&We?tt&&Re!==null?ir(u,Re,-1):xe!==null?et(xe,-1):null:null,Be=fe===1&&We?tt&&Re!==null?ir(u,Re,1):xe!==null?et(xe,1):null:null,Ze=_e&&_e.url!==(Ge==null?void 0:Ge.url)?_e:null,$e=Be&&Be.url!==(ve==null?void 0:ve.url)?Be:null,Ne=Ge&&qe?(()=>{const H=tt?Ic(u,p,-1):t.length>2?et((n-1+t.length)%t.length,-1):null;return H&&H.url!==Ge.url?H:null})():null,Ue=ve&&qe?(()=>{const H=tt?Ic(u,p,1):t.length>2?et((n+1)%t.length,1):null;return H&&H.url!==ve.url?H:null})():null,Je=Ze??Ne,st=$e??Ue,it=s.useCallback((H,Le,je)=>{if(!H||!Le||!je)return;const Fe=W.current,ft=Fe.get(H);(ft==null?void 0:ft.width)===Le&&(ft==null?void 0:ft.height)===je||(Fe.set(H,{width:Le,height:je}),B(Ht=>Ht+1))},[]),Oe=s.useCallback(H=>{if(!(H!=null&&H.url))return null;const Le=W.current.get(H.url);return wv(f.current,Le)},[U,N]),Ae=s.useCallback(()=>{if(!J)return;const H=Oe(J);if(H){ae(H);return}const Le=f.current;Le&&ae(Rc(Le))},[J,Oe]),gt=s.useCallback(H=>{if(tt){const Le=u.length;ge((p+H+Le)%Le),Ce(null);return}t.length>1&&(Ce((n+H+t.length)%t.length),ge(null))},[tt,u.length,p,t.length,n]),ze=s.useCallback(H=>{E.current=H,pe(H)},[]),De=s.useCallback(()=>{T.current!==null&&(window.clearTimeout(T.current),T.current=null)},[]),Xe=s.useCallback(()=>{De(),T.current=window.setTimeout(()=>{De(),ze(!1)},Uo+32)},[De,ze]),ct=s.useCallback(()=>{const H=k.current;if(!H){oe({left:0,top:0,width:typeof window<"u"?window.innerWidth:is.width,height:typeof window<"u"?window.innerHeight:is.height});return}const Le=H.getBoundingClientRect();oe({left:Le.left,top:Le.top,width:Le.width,height:Le.height})},[]),he=s.useCallback((H,Le)=>{if(We){if(ee&&!se)return`translate(${ce}px, 0px)`;if(se&&fe!==null){const je=Oe(H);if(!je)return;const{x:Fe,y:ft}=Pv(je,Le,fe,O);return`translate(${Fe}px, ${ft}px)`}if(se)return"translate(0px, 0px)"}},[We,ee,se,ce,fe,O,Oe]),Ee=s.useCallback(()=>{const H=C.current;C.current=null,De(),ze(!1),we(null),ge(null),Ce(null),Y(0),te(!1),L.current=!1,G.current=0,$.current="none",H===-1?x():H===1&&b()},[De,ze,x,b]),nt=s.useCallback(()=>{De(),T.current=window.setTimeout(()=>{C.current!==null&&Ee()},Uo+32)},[De,Ee]),pt=s.useCallback(()=>{De(),C.current=null,ze(!1),we(null),ge(null),Ce(null),Y(0),te(!1),L.current=!1,G.current=0,$.current="none"},[De,ze]),Ve=s.useCallback(H=>{if(!(!qe||!ie)){if(E.current){if(C.current===H){V.current=H,Ee();return}pt()}De(),gt(H),C.current=H,we(H),ze(!0),nt()}},[qe,ie,Ee,pt,De,gt,ze,nt]);w.current=Ve;const vt=s.useCallback(()=>{q.current=null,j.current=!1,I.current!==null&&(window.clearInterval(I.current),I.current=null),A.current!==null&&(window.clearTimeout(A.current),A.current=null)},[]),Rt=s.useCallback(H=>{I.current!==null&&window.clearInterval(I.current);const Le=j.current?fv:hv;I.current=window.setInterval(()=>{w.current(H)},Le)},[]),At=s.useCallback(H=>{q.current!==H&&(vt(),q.current=H,j.current=!1,w.current(H),Rt(H),A.current=window.setTimeout(()=>{A.current=null,q.current===H&&(j.current=!0,Rt(H))},gv))},[vt,Rt]),wt=s.useCallback(()=>{const H=f.current;if(!H)return;const Le=J==null?void 0:J.url,je=Le?W.current.get(Le):void 0;if(je!=null&&je.width&&(je!=null&&je.height)){ae(Bs(H,je.width,je.height));return}const Fe=S.current;if(Fe&&Le&&(Fe.src===Le||Fe.currentSrc===Le)){const{width:Ht,height:mt}=Sv(Fe);if(Ht&&mt){it(Le,Ht,mt),ae(Bs(H,Ht,mt));return}}const ft=Rc(H);!ft.width||!ft.height||ae(ft)},[J==null?void 0:J.url,it]),Vt=s.useCallback(H=>{if(S.current=H,!!H){if(H instanceof HTMLVideoElement){H.readyState>=1&&H.videoWidth>0&&wt();return}H.complete&&H.naturalWidth>0&&wt()}},[wt]),jt=s.useCallback(()=>{ct(),wt(),le(H=>H+1)},[ct,wt]);s.useEffect(()=>{jt();const H=f.current,Le=k.current,je=new ResizeObserver(()=>jt());return H&&je.observe(H),Le&&je.observe(Le),window.addEventListener("resize",jt),()=>{je.disconnect(),window.removeEventListener("resize",jt)}},[jt,n,y]),s.useLayoutEffect(()=>{if(!J)return;const H=S.current;if(H){if(H instanceof HTMLImageElement&&H.complete&&H.naturalWidth>0){wt();return}H instanceof HTMLVideoElement&&H.readyState>=1&&H.videoWidth>0&&wt()}},[J==null?void 0:J.url,n,wt]),s.useEffect(()=>{Ae()},[Ae,U]),s.useEffect(()=>{const H=new Set,Le=[],je=Fe=>{!(Fe!=null&&Fe.url)||H.has(Fe.url)||(H.add(Fe.url),Le.push(Fe))};t.forEach(je),u.forEach(Fe=>Fe.items.forEach(je)),Le.forEach(Fe=>{W.current.has(Fe.url)||$v(Fe,it)})},[t,u,it]),s.useEffect(()=>{if(Q!=="opening"||!ie)return;if(!v){be("open");return}K(!1);const H=requestAnimationFrame(()=>{requestAnimationFrame(()=>{K(!0),be("open")})});return()=>cancelAnimationFrame(H)},[Q,ie,v]),s.useEffect(()=>{if(Q!=="closing")return;const H=setTimeout(()=>g(),_n);return()=>clearTimeout(H)},[Q,g]),s.useEffect(()=>()=>{De()},[De]),s.useLayoutEffect(()=>{Ie.current===n&&Se.current===(J==null?void 0:J.url)||(De(),C.current=null,we(null),ge(null),Ce(null),ye(0),Y(0),ze(!1),X(!1),te(!1),_.current=0,G.current=0,$.current="none",L.current=!1,P.current=null,D.current=!1,S.current=null,Ae(),Ie.current=n,Se.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,ze,De,Ae]),s.useLayoutEffect(()=>{const H=V.current;H!==null&&(V.current=null,requestAnimationFrame(()=>{w.current(H)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(Q==="opening"){R.current=!1,z(!1);return}if(Q!=="open"||R.current)return;if(!Ge&&!ve){R.current=!0;return}z(!1);const H=requestAnimationFrame(()=>{requestAnimationFrame(()=>{z(!0),R.current=!0})});return()=>cancelAnimationFrame(H)},[Q,Ge==null?void 0:Ge.url,ve==null?void 0:ve.url]),s.useEffect(()=>{if(Q!=="open")return;const H=()=>{const mt=Lt=>{Lt.stopPropagation(),Lt.preventDefault(),document.removeEventListener("click",mt,!0)};document.addEventListener("click",mt,!0)},Le=mt=>{const Lt=mt<0?1:-1;De(),gt(Lt),C.current=Lt,we(Lt),ze(!0),nt()},je=mt=>{if(Math.abs(mt)>mv&&qe){Le(mt);return}C.current=null,we(null),ge(null),Ce(null),ze(!0),Y(0),Xe()},Fe=mt=>{if(mt.touches.length!==1||E.current)return;const Lt=mt.touches[0];D.current=!0,P.current={x:Lt.clientX,y:Lt.clientY},$.current="none",G.current=0,L.current=!1},ft=mt=>{if(!P.current||mt.touches.length!==1||E.current)return;const Lt=mt.touches[0],Ut=Lt.clientX-P.current.x,Dt=Lt.clientY-P.current.y;if($.current==="none"){if(Math.abs(Ut)<10&&Math.abs(Dt)<10)return;if(Math.abs(Ut)>Math.abs(Dt)){if(!qe)return;$.current="horizontal"}else if(Dt>0){if(!ot)return;$.current="vertical"}else return}if($.current==="horizontal"){L.current=!0,te(!0),G.current=Ut,Y(Ut),mt.preventDefault();return}$.current==="vertical"&&(L.current=!0,te(!0),_.current=Dt,ye(Dt),mt.preventDefault())},Ht=()=>{if(!P.current)return;const mt=$.current,Lt=L.current;if(Lt&&mt==="horizontal")je(G.current),H();else if(Lt&&mt==="vertical"){const Ut=_.current;if(ot&&Ut>pv){const Dt=window.innerHeight;_.current=Dt,X(!0),ye(Dt),be("closing")}else _.current=0,ye(0);H()}else mt==="horizontal"&&Math.abs(G.current)>0&&(je(G.current),H());P.current=null,$.current="none",G.current=0,L.current=!1,te(!1)};return document.addEventListener("touchstart",Fe,{passive:!0}),document.addEventListener("touchmove",ft,{passive:!1}),document.addEventListener("touchend",Ht),document.addEventListener("touchcancel",Ht),()=>{document.removeEventListener("touchstart",Fe),document.removeEventListener("touchmove",ft),document.removeEventListener("touchend",Ht),document.removeEventListener("touchcancel",Ht)}},[Q,qe,ze,Xe,De,ot,nt,gt]);const Kt=s.useCallback(()=>{const H=(m==null?void 0:m())??v??null;H&&ie&&(ne(H),K(!0)),be("closing")},[m,v,ie]);s.useEffect(()=>{const H=Fe=>{if(Fe.key==="Escape"){if(r&&c||Q==="closing")return;vt(),Kt();return}if(Fe.key!=="ArrowLeft"&&Fe.key!=="ArrowRight"||Q!=="open"||!qe)return;Fe.preventDefault();const ft=Fe.key==="ArrowLeft"?-1:1;Fe.repeat&&q.current===ft||At(ft)},Le=Fe=>{if(Fe.key!=="ArrowLeft"&&Fe.key!=="ArrowRight")return;const ft=Fe.key==="ArrowLeft"?-1:1;q.current===ft&&vt()},je=()=>{vt()};return window.addEventListener("keydown",H),window.addEventListener("keyup",Le),window.addEventListener("blur",je),()=>{window.removeEventListener("keydown",H),window.removeEventListener("keyup",Le),window.removeEventListener("blur",je),vt()}},[Q,r,c,Kt,qe,At,vt]),s.useEffect(()=>{Q!=="open"&&vt()},[Q,vt]);const Yt=()=>{Q==="closing"||l||Kt()},kt=Q==="open",Bt=Q==="closing",rn=Pe>0?Math.max(0,1-Pe/500):1,xt=Pe>0?Math.max(.35,1-Pe/500):1,yt=s.useCallback(H=>{if(!(H.propertyName!=="transform"||!E.current)){if(C.current!==null){Ee();return}De(),ze(!1)}},[De,ze,Ee]),Me=Q==="closing"?Z??v:v,Qe=Me&&ie&&(Q==="opening"||Bt)?yv(Me,ie):void 0,rt=We&&J?he(J,"center"):Pe>0?`translateY(${Pe}px)`:Qe,dt=ie?Wr(ie,O):null,Pt=!!(Me&&ie),St=Pt&&(Q==="closing"||Q==="open"&&h),ht={position:"absolute",top:dt==null?void 0:dt.top,left:dt==null?void 0:dt.left,width:dt==null?void 0:dt.width,height:dt==null?void 0:dt.height,objectFit:"contain",transformOrigin:"top left",transform:rt,opacity:Pe>0?xt:Pt?1:Q==="opening"||Bt?0:1,transition:ee&&!se?"none":se?`transform ${Uo}ms ${Sn}`:me?`transform ${_n}ms ${Sn}, opacity ${_n}ms ${Sn}`:St?`transform ${_n}ms ${Sn}`:Q==="opening"||Bt?`opacity ${_n}ms ${Sn}`:"none",pointerEvents:He&&kt&&!We?"auto":"none",touchAction:He&&kt?"none":void 0,zIndex:1,overflow:He?"hidden":void 0},Wt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:kt&&!We?"auto":"none"},Tt=(H,Le,je="adjacent")=>{const Fe=Oe(H);if(!Fe)return{display:"none"};const ft=je==="far"?Le==="left"?"far-left":"far-right":Le==="left"?"left-adjacent":"right-adjacent",{start:Ht}=fe!==null?Ku(Fe,ft,fe,O):{start:je==="far"?va(Fe,Le,O):Io(Fe,Le,O)},mt=Wr(Ht,O),Lt=he(H,ft),Ut=!We&&je==="adjacent"&&kt&&!de?Iv(Fe,Le,O):null,Dt=je==="far"&&We&&fe===(Le==="left"?-1:1),an=ee&&!se?!1:se,ln=je==="adjacent"&&kt&&de&&!We;return{position:"absolute",top:mt.top,left:mt.left,width:mt.width,height:mt.height,objectFit:"contain",transform:Lt??(Ut?`translate(${Ut.x}px, ${Ut.y}px)`:void 0),opacity:je==="far"?kt&&Dt?1:0:kt?1:0,transition:an?je==="far"?`transform ${Uo}ms ${Sn}`:`transform ${Uo}ms ${Sn}, opacity ${_n}ms ${Sn}`:ln?`transform ${_n}ms ${Sn}`:Q==="opening"||Bt?`opacity ${_n}ms ${Sn}`:"none",pointerEvents:"none",zIndex:1}},Ot=(H,Le)=>{const je=Oe(H);return je?Lv(Io(je,Le,O),Le,O):null},Gt=H=>Le=>{if(!l){if(D.current){D.current=!1;return}Le.stopPropagation(),Ve(H)}},Mt=Ge?Ot(Ge,"left"):null,_t=ve?Ot(ve,"right"):null,Ft=Mt?Wr(Mt,O):null,ut=_t?Wr(_t,O):null;return a.jsxs("div",{ref:k,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:Q==="open"?"none":void 0},onClick:Yt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:kt?rn:0,transition:ee?"none":`opacity ${_n}ms ${Sn}`,pointerEvents:"none"}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[a.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:f,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:kt?1:0,transition:ee?"none":`opacity ${_n}ms ${Sn}`,pointerEvents:"none"},children:a.jsx(Xu,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,onClose:Yt})})]}),kt&&Je&&a.jsx(Or,{media:Je,style:Tt(Je,"left","far"),onMeasure:it,onTransitionEnd:yt},`far-prev-${Je.url}`),kt&&Ge&&a.jsxs(a.Fragment,{children:[a.jsx(Or,{media:Ge,style:Tt(Ge,"left"),onMeasure:it,onTransitionEnd:yt},`prev-${Ge.url}`),Ft&&a.jsx("div",{style:{position:"absolute",top:Ft.top,left:Ft.left,width:Ft.width,height:Ft.height,cursor:l||ee?"default":"pointer",pointerEvents:l||ee?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),kt&&ve&&a.jsxs(a.Fragment,{children:[a.jsx(Or,{media:ve,style:Tt(ve,"right"),onMeasure:it,onTransitionEnd:yt},`next-${ve.url}`),ut&&a.jsx("div",{style:{position:"absolute",top:ut.top,left:ut.left,width:ut.width,height:ut.height,cursor:l||ee?"default":"pointer",pointerEvents:l||ee?"none":"auto",zIndex:3},onClick:Gt(1)})]}),kt&&st&&a.jsx(Or,{media:st,style:Tt(st,"right","far"),onMeasure:it,onTransitionEnd:yt},`far-next-${st.url}`),ie&&J&&(He?a.jsx(Mv,{src:J.url,phase:Q,onMediaElement:Vt,wrapperStyle:ht,videoStyle:Wt,onLoadedMetadata:wt,onTransitionEnd:yt},`${n}-${J.url}`):a.jsx("img",{ref:Vt,src:J.url,alt:J.name,onLoad:wt,onTransitionEnd:yt,style:ht},`${n}-${J.url}`))]})}function Fv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:c}=F.useScopedStyles(),{gridLayout:d,verticalGap:u,align:p="top",imageDisplay:y}=e,v=(y==null?void 0:y.display)==="cover",m=(y==null?void 0:y.ratioValue)??"1:1",g=(y==null?void 0:y.reversed)??!1,[x,b]=m.split(":").map(Number),S=`${g?b:x} / ${g?x:b}`,W=d.entryWidth??.2,U=d.columnsCount,B=F.scalingValue(W,n),P=F.scalingValue(d.horizontalGap??0,n),_=B,G=B,$={width:_,...v?{aspectRatio:S,height:"auto",overflow:"hidden"}:{height:"auto"}},L=v?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},D=s.useRef(null),[E,T]=s.useState(!1),[C,V]=s.useState([]),[w,q]=s.useState(0),[I,A]=s.useState(0),[j,ie]=s.useState(null),[ae,O]=s.useState({title1:"",title2:"",title3:""}),oe=(()=>{const xe={},Ce=D.current?getComputedStyle(D.current).getPropertyValue("--cntrl-article-width").trim():"";return Ce&&(xe["--cntrl-article-width"]=Ce),xe})(),N=!n||i||o,le=s.useMemo(()=>uv(c),[c]),Q=t??[],be=Q.length%U||U,Pe=be<U&&Q.length>0,ye=Q.length-be,ce=Pe?Math.floor((U-be)/2)+1:1,Y=s.useMemo(()=>xv(Q),[Q]),se=s.useMemo(()=>Cv(Q),[Q]),pe=(xe,Ce,h)=>{if(n&&!o&&!i)return;const K=Y.findIndex(ne=>ne.gridIndex===xe);if(K<0)return;const Z=Y[K];A(K),V(Z.items),q(Ce),O(Z.entry),ie(h??null),T(!0)},fe=s.useCallback(()=>{T(!1),ie(null)},[]),we=s.useCallback(()=>{const xe=Y[I];return!xe||!D.current?j:vv(D.current,xe.gridIndex,v?"cover":"contain")??j},[Y,I,j,v]),Re=s.useCallback(xe=>{if(Y.length>1){const Ce=Y.length,h=(I+xe+Ce)%Ce,K=Y[h],Z=Math.min(w,K.items.length-1);A(h),V(K.items),q(Z),O(K.entry);return}q(Ce=>(Ce+xe+C.length)%C.length)},[Y,I,w,C.length]),ge=Y.length>1||C.length>1;return s.useEffect(()=>{if(!E||typeof document>"u")return;const xe=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=xe}},[E]),s.useEffect(()=>{!n||o||i||T(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:le}}),a.jsx(Tv,{mediaList:se}),a.jsx("div",{ref:D,className:`${c}-wrapper ${c}-align-entries ${c}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${U}, ${B})`,rowGap:0,columnGap:P,width:F.scalingValue(d.wrapperWidth??0,n),[`--${c}-align-entries-row-gap`]:F.scalingValue(u??0,n)},children:Q.map((xe,Ce)=>{const h=Ml(xe.gallery),K=Al(h),Z=K.filter(te=>te.lightboxMedia).map(te=>te.lightboxMedia),ne=Math.floor(Ce/U)===Math.ceil(Q.length/U)-1,de=Pe&&Ce>=ye?`${ce+(Ce-ye)}`:void 0,z=K[0],R=z!=null&&z.lightboxMedia?Z.findIndex(te=>te.url===z.lightboxMedia.url):-1,ee=a.jsx("div",{className:`${c}-item-image-wrapper`,style:$,children:K.length>0&&a.jsx(Ev,{media:z.displayMedia,gridIndex:Ce,className:`${c}-item-${zo(z.displayMedia)?"video":"image"}`.trim(),style:L,onMediaClick:N&&R>=0?te=>pe(Ce,R,qu(te.currentTarget,v?"cover":"contain")):void 0})});return a.jsx("div",{className:`${c}-item`,children:a.jsxs("div",{className:[o?`${c}-item-inner`:`${c}-item-inner-hidden`,ne?`${c}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:B,...de?{gridColumn:de}:{}},children:[a.jsx("div",{className:`${c}-item-title-row`,children:a.jsx("div",{style:{height:0,width:G}})}),a.jsx("a",{className:`${c}-item-image-link`,children:ee}),a.jsx("div",{className:`${c}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:G}})})]})},Ce)})}),E&&typeof document<"u"&&(()=>{const xe=(l?document.getElementById(l):null)??document.body;return Gn.createPortal(a.jsx("div",{style:oe,"data-selection":"none",children:a.jsx(Av,{prefix:c,items:C,index:w,entry:ae,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ge,lightboxEntries:Y,entryIdx:I,layoutId:r,sourceRect:j,resolveCloseSourceRect:we,onClose:fe,onPrev:()=>Re(-1),onNext:()=>Re(1)})}),xe)})()]})}const Nv=`import { CommonComponentProps } from '../props';
|
|
7603
7631
|
import { scalingValue, useScopedStyles } from '../utils/index';
|
|
7604
7632
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
7605
7633
|
import { createPortal } from 'react-dom';
|
|
@@ -9942,11 +9970,11 @@ export function Hive({
|
|
|
9942
9970
|
</>
|
|
9943
9971
|
);
|
|
9944
9972
|
}
|
|
9945
|
-
`,_v="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>'),Fi={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 Hv(e){const t={};return t[bt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[bt(e,"fontSettings")]={...Fi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[bt(e,"fontSize")]={...Fi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[bt(e,"lineHeight")]={...Fi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[bt(e,"letterSpacing")]={...Fi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[bt(e,"wordSpacing")]={...Fi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[bt(e,"textAlign")]={...Fi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[bt(e,"textAppearance")]={...Fi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Ro=Li.filter(e=>e!=="count"),Wv=Ro.reduce((e,t)=>({...e,...Hv(t)}),{}),Ov=Ro.reduce((e,t)=>({...e,[bt(t,"fontFamily")]:"Arial",[bt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[bt(t,"letterSpacing")]:0,[bt(t,"wordSpacing")]:0,[bt(t,"textAlign")]:"left",[bt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function is(e){return Ro.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[bt(n,"fontSize")]=i),o!==void 0&&(t[bt(n,"lineHeight")]=o),t},{})}const Dv={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Ro.map(e=>[kl[e],El(e)]))},zv={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},Bv=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...zv,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),jv={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:Bv},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"}},...Wv},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:_v,closeIconColor:"#000000",closeIconHoverColor:"#999999",...Ov},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,...is({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,...is({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,...is({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:[Dv]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},Vv={element:Fv,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:[...Ro.map(e=>({path:`${bt(e,"fontFamily")}`}))]},fontRelations:{...Ro.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${bt(t,"fontFamily")}`}),{})},schema:jv,sourceCode:Nv};function Gv(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 Xv({media:e,className:t,style:n}){const i=s.useRef(null);return s.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const r=o.play();r&&r.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?a.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:t,src:e.url,alt:"",style:n})}function os(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function qv(e){return String(e??"").trim().length>0}function kc(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 Ec(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 Mc(e,t,n,i,o,r,l){const c=F.scalingValue(r,l),d=F.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?c:d,borderBottomWidth:!p||i?c:d}}function Uv(e,t,n){const i=F.scalingValue(t,n),o=F.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Ac=10,Fc=10,Ko={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function Kv(e,t,n){return Math.max(t,Math.min(n,e))}function rs(e,t,n){return e+(t-e)*n}function Yv(e,t,n,i){if(!t)return{x:0,y:0};const o=t.getBoundingClientRect(),r=o.top+o.height/2;if(e==="cursor"&&n)return{x:n.clientX+Ac,y:n.clientY+Ac};switch(e){case"left":return{x:o.left+Fc+i/2,y:r};case"center":return{x:o.left+o.width/2,y:r};case"right":return{x:o.right-Fc-i/2,y:r};default:return{x:o.left+o.width/2,y:r}}}function Zv(e,t){const n=s.useRef(null),i=s.useRef({x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1}),o=s.useRef(null),r=s.useCallback(()=>{const m=n.current,g=i.current;m&&(m.style.transform=`translate3d(${g.x}px, ${g.y}px, 0) translate(-50%, -50%) rotate(${g.rotation.toFixed(3)}deg)`)},[]),l=s.useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},[]),c=s.useCallback(()=>{const m=i.current;t?(m.x=rs(m.x,m.targetX,Ko.positionEase),m.y=rs(m.y,m.targetY,Ko.positionEase),m.rotation=rs(m.rotation,m.targetRotation,Ko.rotationEase)):(m.x=m.targetX,m.y=m.targetY,m.rotation=m.targetRotation),r();const g=Math.abs(m.x-m.targetX)<.4&&Math.abs(m.y-m.targetY)<.4,x=Math.abs(m.rotation-m.targetRotation)<.08;!g||!x?o.current=requestAnimationFrame(c):o.current=null},[r,t]),d=s.useCallback(()=>{o.current===null&&(o.current=requestAnimationFrame(c))},[c]),u=s.useCallback((m,g)=>{const x=i.current;x.targetX=m,x.targetY=g,x.targetRotation=0,x.x=m,x.y=g,x.rotation=0,x.lastX=m,x.hasLastX=!0,r(),t&&d()},[r,t,d]),p=s.useCallback((m,g)=>{if(!e)return;const x=i.current;if(t&&x.hasLastX){const b=m-x.lastX;x.targetRotation=Kv(b*Ko.rotationFactor,-20,Ko.maxRotation)}else x.targetRotation=0;if(x.lastX=m,x.hasLastX=!0,x.targetX=m,x.targetY=g,t){d();return}x.x=m,x.y=g,x.rotation=x.targetRotation,r()},[e,r,t,d]),y=s.useCallback(m=>{l(),i.current.hasLastX=!1,m==null||m()},[l]),v=s.useCallback(()=>{l(),i.current={x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1},n.current&&(n.current.style.transform="")},[l]);return s.useEffect(()=>(e||v(),l),[e,v,l]),{anchorRef:n,onShow:u,onCursorMove:p,exit:y,reset:v}}function Jv(e){return`
|
|
9973
|
+
`,_v="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>'),Fi={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 Hv(e){const t={};return t[bt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[bt(e,"fontSettings")]={...Fi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[bt(e,"fontSize")]={...Fi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[bt(e,"lineHeight")]={...Fi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[bt(e,"letterSpacing")]={...Fi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[bt(e,"wordSpacing")]={...Fi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[bt(e,"textAlign")]={...Fi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[bt(e,"textAppearance")]={...Fi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Ro=Li.filter(e=>e!=="count"),Wv=Ro.reduce((e,t)=>({...e,...Hv(t)}),{}),Ov=Ro.reduce((e,t)=>({...e,[bt(t,"fontFamily")]:"Arial",[bt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[bt(t,"letterSpacing")]:0,[bt(t,"wordSpacing")]:0,[bt(t,"textAlign")]:"left",[bt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function os(e){return Ro.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[bt(n,"fontSize")]=i),o!==void 0&&(t[bt(n,"lineHeight")]=o),t},{})}const Dv={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Ro.map(e=>[kl[e],El(e)]))},zv={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},Bv=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...zv,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),jv={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:Bv},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"}},...Wv},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:_v,closeIconColor:"#000000",closeIconHoverColor:"#999999",...Ov},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,...os({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,...os({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,...os({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:[Dv]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},Vv={element:Fv,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:[...Ro.map(e=>({path:`${bt(e,"fontFamily")}`}))]},fontRelations:{...Ro.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${bt(t,"fontFamily")}`}),{})},schema:jv,sourceCode:Nv};function Gv(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 Xv({media:e,className:t,style:n}){const i=s.useRef(null);return s.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const r=o.play();r&&r.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?a.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:t,src:e.url,alt:"",style:n})}function rs(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function qv(e){return String(e??"").trim().length>0}function kc(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 Ec(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 Mc(e,t,n,i,o,r,l){const c=F.scalingValue(r,l),d=F.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?c:d,borderBottomWidth:!p||i?c:d}}function Uv(e,t,n){const i=F.scalingValue(t,n),o=F.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Ac=10,Fc=10,Ko={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function Kv(e,t,n){return Math.max(t,Math.min(n,e))}function as(e,t,n){return e+(t-e)*n}function Yv(e,t,n,i){if(!t)return{x:0,y:0};const o=t.getBoundingClientRect(),r=o.top+o.height/2;if(e==="cursor"&&n)return{x:n.clientX+Ac,y:n.clientY+Ac};switch(e){case"left":return{x:o.left+Fc+i/2,y:r};case"center":return{x:o.left+o.width/2,y:r};case"right":return{x:o.right-Fc-i/2,y:r};default:return{x:o.left+o.width/2,y:r}}}function Zv(e,t){const n=s.useRef(null),i=s.useRef({x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1}),o=s.useRef(null),r=s.useCallback(()=>{const m=n.current,g=i.current;m&&(m.style.transform=`translate3d(${g.x}px, ${g.y}px, 0) translate(-50%, -50%) rotate(${g.rotation.toFixed(3)}deg)`)},[]),l=s.useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},[]),c=s.useCallback(()=>{const m=i.current;t?(m.x=as(m.x,m.targetX,Ko.positionEase),m.y=as(m.y,m.targetY,Ko.positionEase),m.rotation=as(m.rotation,m.targetRotation,Ko.rotationEase)):(m.x=m.targetX,m.y=m.targetY,m.rotation=m.targetRotation),r();const g=Math.abs(m.x-m.targetX)<.4&&Math.abs(m.y-m.targetY)<.4,x=Math.abs(m.rotation-m.targetRotation)<.08;!g||!x?o.current=requestAnimationFrame(c):o.current=null},[r,t]),d=s.useCallback(()=>{o.current===null&&(o.current=requestAnimationFrame(c))},[c]),u=s.useCallback((m,g)=>{const x=i.current;x.targetX=m,x.targetY=g,x.targetRotation=0,x.x=m,x.y=g,x.rotation=0,x.lastX=m,x.hasLastX=!0,r(),t&&d()},[r,t,d]),p=s.useCallback((m,g)=>{if(!e)return;const x=i.current;if(t&&x.hasLastX){const b=m-x.lastX;x.targetRotation=Kv(b*Ko.rotationFactor,-20,Ko.maxRotation)}else x.targetRotation=0;if(x.lastX=m,x.hasLastX=!0,x.targetX=m,x.targetY=g,t){d();return}x.x=m,x.y=g,x.rotation=x.targetRotation,r()},[e,r,t,d]),y=s.useCallback(m=>{l(),i.current.hasLastX=!1,m==null||m()},[l]),v=s.useCallback(()=>{l(),i.current={x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1},n.current&&(n.current.style.transform="")},[l]);return s.useEffect(()=>(e||v(),l),[e,v,l]),{anchorRef:n,onShow:u,onCursorMove:p,exit:y,reset:v}}function Jv(e){return`
|
|
9946
9974
|
.${e}-wrapper {
|
|
9947
9975
|
display: grid;
|
|
9948
9976
|
align-items: start;
|
|
9949
|
-
min-height: ${
|
|
9977
|
+
min-height: ${rs(48)};
|
|
9950
9978
|
position: relative;
|
|
9951
9979
|
overflow: visible;
|
|
9952
9980
|
box-sizing: border-box;
|
|
@@ -10075,7 +10103,7 @@ a.${e}-list-item {
|
|
|
10075
10103
|
flex-shrink: 0;
|
|
10076
10104
|
overflow: visible;
|
|
10077
10105
|
box-sizing: border-box;
|
|
10078
|
-
min-width: ${
|
|
10106
|
+
min-width: ${rs(50)};
|
|
10079
10107
|
position: relative;
|
|
10080
10108
|
display: flex;
|
|
10081
10109
|
align-items: flex-start;
|
|
@@ -10083,7 +10111,7 @@ a.${e}-list-item {
|
|
|
10083
10111
|
|
|
10084
10112
|
.${e}-list-col-last {
|
|
10085
10113
|
flex: 1 1 auto;
|
|
10086
|
-
min-width: ${
|
|
10114
|
+
min-width: ${rs(50)};
|
|
10087
10115
|
}
|
|
10088
10116
|
|
|
10089
10117
|
.${e}-list-col-title {
|
|
@@ -10318,7 +10346,7 @@ a.${e}-list-item {
|
|
|
10318
10346
|
overflow-wrap: anywhere;
|
|
10319
10347
|
word-break: break-word;
|
|
10320
10348
|
}
|
|
10321
|
-
`}const Pi=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Fl=["AColumn","BColumn","CColumn","DColumn","EColumn"],oi="cutLabel",vr=[...Fl,oi],Ha=["A","B","C","D","E"];function Zu(e){return`${e}ColumnVerticalAlign`}const js=["Top","Center","Bottom"];function Nl(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Ha.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Qv(e){const t=Nl(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function e0(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Ha.includes(n)?n:null}function Ju(e,t,n){const i=e0(e);return i?i===t?!1:Qv(n[Zu(i)]):!0}function xr(e){const t=Nl(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Ha.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function t0(e,t,n){if(Qu(e,t,n))return xr(e);const i=xr(e);return i.kind==="baseline"?{kind:"top"}:i}function n0(e){const t=xr(e);return t.kind==="baseline"?{kind:"top"}:t}function Qu(e,t,n){return Ju(e,n,t)?xr(e).kind==="baseline":!1}function i0(e){const t={};let n=!1;for(const i of Ha){const o=Zu(i),r=e[o];if(e.type==="b"){const l=String(r??"Top").trim();l!=="Top"&&l!=="Center"&&l!=="Bottom"&&(t[o]="Top",n=!0);continue}Ju(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function o0(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function r0(e){const t=xr(e).kind;return t==="baseline"?"center":t}function a0(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Nc(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function s0(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(),r=o-i;return n.remove(),r}function as(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=s0(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const c=r.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+l}function l0(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const r=o.querySelector(`.${n}`);r&&(r.style.minHeight=`${i}px`,r.style.height=`${i}px`)}),i)}function c0(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const d0={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function qt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const u0={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function p0(e){return[qt(e,"textFontFamily"),qt(e,"textFontSettings"),{type:"row",items:[qt(e,"textFontSize"),qt(e,"textLineHeight"),qt(e,"textLetterSpacing"),qt(e,"textWordSpacing")]},qt(e,"textTextAlign"),qt(e,"textTextAppearance"),`${e}VerticalAlign`]}function m0(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(vr.map(e=>[u0[e],p0(e)]))}}function va(e,t){const n=i=>{const o=qt(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===oi?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function _c(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(Qt(n,t))}function Hc(e,t,n,i){const o=va(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function Wc(e,t,n,i){const o=va(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:F.scalingValue((r-l)/2,i)}}const In=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],ko=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Eo=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Mo=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],g0={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},h0=["hover","focus","filled","success","error"],Oc=.004,uo=.004,ss=uo,_l=50,br=1440,Sr=_l/br;function ep(e){const t=typeof e=="number"&&e>0?e:br;return _l/t}function f0(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 br}const tp={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function lr(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function y0(e,t=1){const n=t/e;return Object.fromEntries(In.map(i=>[i,n]))}function v0(){return Object.fromEntries([...ko.map(e=>[e,0]),...Eo.map(e=>[e,0])])}function x0(){return Object.fromEntries(Mo.map(e=>[e,0]))}function Dr(e){return Object.fromEntries(In.map(t=>[t,typeof e[t]=="number"?e[t]:tp[t]]))}function np(e,t,n){const i=e-Sr,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const r=i/o;return{paddingLeft:t*r,paddingRight:n*r}}function la(e,t,n){const i=Hl(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((r,l)=>r+l,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function b0(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=ko[o],l=Eo[o],c=typeof n[r]=="number"?n[r]:0,d=typeof n[l]=="number"?n[l]:0,u=np(t[o]??0,c,d);u.paddingLeft!==c&&(i[r]=u.paddingLeft),u.paddingRight!==d&&(i[l]=u.paddingRight)}return i}function Hl(e,t,n){if(e<=0)return[];const i=In.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),l=o.reduce((u,p)=>u+p,0)+Sr;if(t>=l)return i;const c=[...o];let d=l-t;for(let u=c.length-1;u>=0&&d>0;u-=1){const p=c[u]-Sr;if(p<=0)continue;const y=Math.min(d,p);c[u]-=y,d-=y}return[...c,i[e-1]]}function S0(e,t,n){if(e<=1)return{};const i=Hl(e,t,n),o={};for(let r=0;r<e-1;r+=1){const l=In[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function Dc(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Pi]}function w0(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function $0(e,t,n,i){const o=Math.min(i,e.length,In.length),r={};for(let l=0;l<o;l+=1){const c=e[l],d=t.indexOf(c);if(d===-1)continue;const u=In[d],p=ko[d],y=Eo[d],v=Mo[d],m=In[l],g=ko[l],x=Eo[l],b=Mo[l],k=n[u],f=n[p],S=n[y],O=n[v];typeof k=="number"&&(r[m]=k),typeof f=="number"&&(r[g]=f),typeof S=="number"&&(r[x]=S),typeof O=="number"&&(r[b]=O)}return r}function ip(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 C0(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=lr(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...y0(n,o),...v0()};if(r)for(const c of Mo)typeof t[c]=="number"&&(l[c]=t[c]);else Object.assign(l,x0());return ip(e,l)?l:e}function T0(e,t,n){const i=i0(e);i&&(e={...e,...i});const o=ep(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,c=lr(e),d=lr(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:Pi.length,y=S=>{if(u)return S;const O=Dr({...t,...S}),U=lr(S),z=la(p,U,O),I=b0(p,z,{...t,...S});return Object.keys(I).length===0?S:{...S,...I}};if(typeof r=="number"&&r!==l)return e;const v=Dc(e),m=Dc(t);if(!w0(v,m))return y({...e,...$0(v,m,t,p)});if(c<d&&typeof p=="number"&&!u){const S=Dr({...t,...e});return y({...e,...S0(p,c,S)})}if(u){const S=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,O=Math.max(0,(c-o)/2);return S>O?{...e,textPaddingLR:O}:e}const g=Dr({...t,...e}),x=la(p,d,Dr(t)),k=la(p,c,g).some((S,O)=>S<(x[O]??S)),f=In.some(S=>{const O=e[S],U=t[S];return typeof O=="number"&&typeof U=="number"&&O!==U});return k||f?y(e):e}function L0(e,t,n,i){const o=t.slice(0,e).reduce((l,c)=>l+c,0),r=n.slice(e+1,t.length-1).reduce((l,c)=>l+c,0);return Math.max(Sr,i-o-r-Sr)}function P0(e,t){return Math.random()*(t-e)+e}function I0(e){return Object.fromEntries(In.map(t=>[t,typeof e[t]=="number"?e[t]:tp[t]]))}function ls(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function R0(e,t,n,i,o,r){return e.slice(0,t).map((l,c)=>{const d=ko[c],u=Eo[c],p=Mo[c];return{key:l,textPrefix:d0[l],widthKey:In[c],width:n[In[c]],paddingLeftKey:d,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[d],paddingRight:o[u],paddingBottom:r[p]}})}function k0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,portalId:c,onUpdateSettings:d}){const{prefix:u}=F.useScopedStyles(),p=!!o,{columns:y,type:v,wrapperWidth:m,entriesCount:g,cellMinHeight:x,dividerWidth:b,showVisibility:k,cut:f,showCut:S,cutCellMinHeight:O,cutLabel:U,imageSize:z,imageOnHover:I,imagePosition:N="cursor",imageInterpolation:q="on",entryHoverEffect:$,entryHoverShowOption:L,rowPaddingTop:D,rowPaddingBottom:_,rowPaddingTopB:C,columnsOrder:T,textPaddingLR:B,textColor:w,backgroundColor:X,dividerColor:R,textHoverColor:E,backgroundHoverColor:V,dividerHoverColor:ie}=e,[re,W]=s.useState(void 0),[ae,A]=s.useState(null),le=s.useRef(null),ee=I==="on"&&(!n||i),xe=N==="cursor",Pe=xe&&q==="on",{anchorRef:ye,onShow:pe,onCursorMove:Y,exit:se}=Zv(!!(ee&&ae!==null),Pe),de=(f??0)>0,ve=v==="b",$e=s.useRef(null),ke=s.useRef(null),[he,Se]=s.useState(null),[Ce,h]=s.useState(br),K=ep(Ce),Z=Math.max(0,((m??0)-K)/2),te=Math.min(B??0,Z),me=Math.max(te,uo),j=((m??0)+K)/2;s.useLayoutEffect(()=>{if(!n){h(br);return}const Me=()=>{h(f0($e.current))};Me();const Qe=$e.current;if(!Qe)return;const rt=new ResizeObserver(Me);rt.observe(Qe);let dt=Qe;for(;dt&&!dt.style.getPropertyValue("--cntrl-article-width");)dt=dt.parentElement;return dt&&rt.observe(dt),()=>rt.disconnect()},[n,l]),s.useEffect(()=>{W(void 0)},[f,S,t,g]),s.useEffect(()=>{n&&!i&&W(void 0)},[n,i]);const P=F.buildColorVars(u,{textColor:w,backgroundColor:X,dividerColor:R,textHoverColor:E,backgroundHoverColor:V,dividerHoverColor:ie},g0,h0),Q=r&&r!=="default"?`${u}-state-${r}`:"",ue=`${!n||i?$==="default"?`${u}-entry-hover-default`:$==="blinds"?`${u}-entry-hover-blinds`:$==="reveal"?`${u}-entry-hover-reveal`:"":""} ${Q}`.trim(),G=$==="reveal"&&(!n||i),Ie=(k==null?void 0:k[0])??!1,be=(k==null?void 0:k[1])??!1,J=s.useRef(e),He=s.useRef(l);s.useEffect(()=>{if(!d||!n){J.current=e,He.current=l;return}if(He.current!==l){J.current=e,He.current=l;return}const Me=J.current;if(!(Me!==e))return;if(typeof Me.columns=="number"&&typeof e.columns=="number"&&Me.columns!==e.columns){J.current=e;return}const rt=T0(e,Me,{designWidth:Ce});J.current=e,ip(e,rt)&&d(rt)},[e,d,n,l,Ce]);const We=s.useMemo(()=>I0(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),ot=s.useMemo(()=>ls(e,ko),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),qe=s.useMemo(()=>ls(e,Eo),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),tt=s.useMemo(()=>ls(e,Mo),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),et=s.useMemo(()=>Array.isArray(T)&&T.length>0?T:[...Pi],[T]),je=s.useMemo(()=>R0(et,y,We,ot,qe,tt),[et,y,We,ot,qe,tt]),fe=lr(e),_e=s.useMemo(()=>In.slice(0,y).map(Me=>We[Me]),[y,We]),Be=s.useMemo(()=>Hl(y,fe,We),[y,fe,We]),Ze=s.useMemo(()=>la(y,fe,We),[y,fe,We]),we=s.useMemo(()=>je.map((Me,Qe)=>np(Ze[Qe]??0,Me.paddingLeft,Me.paddingRight)),[je,Ze]),Ne=s.useMemo(()=>{const Me=g===0?1/0:g;return(t??[]).slice(0,Me).map((rt,dt)=>({id:dt,cells:Object.fromEntries(Pi.map(Pt=>[Pt,rt[Pt]??""])),image:rt.image,link:rt.link}))},[t,g]),Ue=de?re??f:Ne.length,Je=s.useMemo(()=>de?Ne.slice(0,Ue):Ne,[Ne,de,Ue]),st=de&&Ue<Ne.length,it=Je.length>1||st,Oe=[Ie?`${u}-divider-top`:"",be||it?`${u}-divider-bottom`:""].filter(Boolean).join(" "),Ae=!n||i,gt=()=>{if(!Ae)return;const Me=re??f;if(!S){W(Ne.length);return}W(Math.min(Me+S,Ne.length))},ze=Me=>F.scalingValue(Me,n??!1),De=ve?C??0:D??0,Xe=_??0,ct=x??0,ge=Math.max(Xe,ss),Ee=Mc(0,Je.length,Ie,be,st,b??0,n??!1).borderTopWidth,nt=ve?"rowPaddingTopB":"rowPaddingTop",pt=je[0],Ge=je[je.length-1],vt=we[0],Rt=we[we.length-1],At=pt&&vt?Math.max(vt.paddingLeft,uo):0,wt=Ge&&Rt?Math.max(Rt.paddingRight,uo):0,Vt=fe,jt=(Me,Qe)=>Yv(N,$e.current,xe?Me:null,Qe),Kt=(Me,Qe)=>{if(!ee)return;const rt=Me.image;if(!(rt!=null&&rt.url)){se(()=>A(null));return}const dt=(z==null?void 0:z.min)??80,Pt=(z==null?void 0:z.max)??320,St=(ae==null?void 0:ae.rowId)===Me.id,ht=St?ae.widthPx:P0(dt,Pt),{x:Wt,y:Tt}=jt(Qe,ht);if(St&&xe){Y(Wt,Tt);return}A({rowId:Me.id,url:rt.url,objectFit:"contain",isVideo:Gv(rt),widthPx:ht}),le.current={x:Wt,y:Tt}},Yt=Me=>{if(!ee||!ae||!xe)return;const{x:Qe,y:rt}=jt(Me,ae.widthPx);Y(Qe,rt)},kt=()=>{ae&&se(()=>A(null))},Bt=Me=>{G&&kc(Me,u),!(!ee||!ae)&&se(()=>A(null))},rn=Me=>{G&&Ec(Me,u)};s.useLayoutEffect(()=>{if(!ae||!le.current)return;const{x:Me,y:Qe}=le.current;le.current=null,pe(Me,Qe)},[ae==null?void 0:ae.rowId,ae==null?void 0:ae.url,pe]),s.useLayoutEffect(()=>{if(!p||ve){Se(null);return}const Me=ke.current,Qe=Me==null?void 0:Me.parentElement;if(!Me||!Qe){Se(null);return}const rt=()=>{const Pt=Me.querySelector("[data-list-row]");if(!Pt){Se(null);return}const St=Qe.getBoundingClientRect(),ht=Pt.getBoundingClientRect();Se(ht.top-St.top+ht.height/2)};rt();const dt=new ResizeObserver(rt);return dt.observe(Me),dt.observe(Qe),()=>dt.disconnect()},[p,ve,Je,De,Xe,ct,t,e,je,Ze,Ce,b,Ie,be,st]);const xt=s.useMemo(()=>!ve&&Fl.some(Me=>{const Qe=Me.charAt(0),rt=e[`${Me}VerticalAlign`];return Qu(rt,e,Qe)}),[ve,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var Wt;const Me=$e.current;if(!Me)return;const Qe=()=>{Me.querySelectorAll("[data-list-col]").forEach(Tt=>{Tt.style.transform="";const Ot=Tt.querySelector(`.${u}-list-col`);Ot&&(Ot.style.minHeight="",Ot.style.height="");const Gt=Tt.querySelector(`.${u}-list-col-title`);Gt&&(Gt.style.transform="")})};if(ve||!xt){Qe();return}const rt=()=>{const Tt=Array.from(Me.querySelectorAll("[data-list-row]")),Ot=`${u}-list-col`,Gt=`${u}-baseline-probe`;Tt.forEach(Mt=>{Mt.querySelectorAll("[data-list-col]").forEach(_t=>{_t.style.transform="";const Ft=_t.querySelector(`.${Ot}`);Ft&&(Ft.style.minHeight="",Ft.style.height="");const ut=_t.querySelector(`.${u}-list-col-title`);ut&&(ut.style.transform="")})}),Tt.forEach(Mt=>{const _t=Array.from(Mt.querySelectorAll("[data-list-col]"));l0(Mt,_t,Ot)}),Me.offsetHeight,Tt.forEach(Mt=>{const _t=Array.from(Mt.querySelectorAll("[data-list-col]")),Ft=Mt.getBoundingClientRect().top,ut=new Map,H=_t.map(Fe=>{const ft=Fe.querySelector(`.${u}-list-col-title`),Ht={el:Fe,titleEl:ft,letter:Fe.getAttribute("data-col-letter")??"",kind:Fe.getAttribute("data-valign")??"top",anchor:Fe.getAttribute("data-valign-anchor")};return ut.set(Ht.letter,Ht),Ht}),Le=new Map,Ve=(Fe,ft)=>{const Ht=Le.get(Fe.letter);if(Ht!==void 0)return Ht;const mt=Fe.anchor?ut.get(Fe.anchor):void 0;if(Fe.kind!=="baseline"||!mt||ft.has(Fe.letter)){const ln=as(Fe,Ft,Ot,Gt);return Le.set(Fe.letter,ln),ln}ft.add(Fe.letter);const Lt=Ve(mt,ft);ft.delete(Fe.letter);const Ut=as(Fe,Ft,Ot,Gt),Dt=Lt-Ut;c0(Fe.titleEl,Dt);const an=as(Fe,Ft,Ot,Gt);return Le.set(Fe.letter,an),an};H.forEach(Fe=>Ve(Fe,new Set))})};let dt=null;const Pt=()=>{dt===null&&(dt=requestAnimationFrame(()=>{dt=null,rt()}))};rt();const St=new ResizeObserver(()=>Pt());St.observe(Me);let ht=!1;return typeof document<"u"&&((Wt=document.fonts)!=null&&Wt.ready)&&document.fonts.ready.then(()=>{ht||Pt()}),()=>{ht=!0,dt!==null&&(cancelAnimationFrame(dt),dt=null),St.disconnect(),Qe()}},[xt,ve,e,t,Ce,Je,Ze]);const yt=s.useMemo(()=>Jv(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:yt}}),a.jsx("div",{style:P,children:a.jsxs("div",{ref:$e,className:`${u}-wrapper ${ue}${Oe?` ${Oe}`:""}${ve?` ${u}-type-b`:""}`.trim(),style:{width:F.scalingValue(m??0,n)},onMouseMove:ee?Yt:void 0,onMouseLeave:ee?kt:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[Je.map((Me,Qe)=>{var St;const rt=(((St=Me.link)==null?void 0:St.length)??0)>0,dt=rt&&(!n||i)?"a":"div",Pt=Mc(Qe,Je.length,Ie,be,st,b??0,n??!1);return a.jsxs(dt,{ref:Qe===0?ht=>{ke.current=ht}:void 0,className:`${u}-list-item${rt||L==="always"?` ${u}-list-item-has-link`:""}${st&&Qe===Je.length-1?` ${u}-list-item-before-cut`:""}`,...rt?{href:Me.link,target:"_blank"}:{},style:Pt,onMouseEnter:ht=>{G&&(rt||L==="always")&&kc(ht,u),ee&&Kt(Me,ht)},onMouseLeave:ht=>{G&&(rt||L==="always")&&Ec(ht,u)},children:[De>0&&a.jsx("div",{className:`${u}-row-padding-handle`,style:{height:ze(De)}}),a.jsxs("div",{className:`${u}-list-cols-row${ve?"":` ${u}-list-cols-row-h`}${p&&Qe===0&&ve?` ${u}-list-cols-row-controls`:""}`,...ve?{}:{"data-list-row":""},style:ve?void 0:{minHeight:ze(ct)},children:[je.map((ht,Wt)=>{const Tt=Wt===je.length-1,Ot=we[Wt],Gt=ht.paddingBottom,Mt=qv(Me.cells[ht.key]),_t=ve&&Mt&&Gt>0,Ft=ve?{minHeight:ze(ct)}:{width:ze(Ze[Wt])},ut=ve?{paddingLeft:ze(te),paddingRight:ze(te)}:{paddingLeft:ze(Ot.paddingLeft),paddingRight:ze(Ot.paddingRight)},H=ht.textPrefix.charAt(0),Le=ve?n0(e[`${ht.textPrefix}VerticalAlign`]):t0(e[`${ht.textPrefix}VerticalAlign`],e,H),Ve=ve&&Mt&&p&&Qe===0;return ve&&!Mt?null:a.jsxs("div",{className:ve?`${u}-list-col-wrap`:void 0,...ve?{}:{"data-list-col":"","data-col-letter":H,"data-valign":Le.kind,...Le.kind==="baseline"?{"data-valign-anchor":Le.anchorLetter}:{}},children:[a.jsx("div",{className:`${u}-list-col${Tt?` ${u}-list-col-last`:""}`,style:{...ut,...Ft,...ve?{justifyContent:Nc(Le.kind)}:{}},"data-test":ht.width,children:a.jsx("span",{className:Hc(e,ht.textPrefix,`${u}-list-col-title`,`${u}-text-tight-leading`),style:{..._c(va(e,ht.textPrefix),n),...Wc(e,ht.textPrefix,u,n),...ve?{}:o0(Le.kind)},children:Me.cells[ht.key]??null})}),_t&&a.jsx("div",{className:`${u}-row-padding-handle`,style:{height:ze(Gt)}}),Ve&&a.jsx("div",{"data-controls":ht.paddingBottomKey,"data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${u}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:ze(Math.max(Gt,ss))}})]},ht.key)}),p&&Qe===0&&ve&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(j),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${u}-control-anchor`,style:{top:0,left:0,width:ze(me),height:"100%"}}),a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(j),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${u}-control-anchor`,style:{top:0,left:ze(Math.max(me,fe-me)),width:ze(me),height:"100%"}})]})]}),!ve&&Xe>0&&a.jsx("div",{className:`${u}-row-padding-handle`,style:{height:ze(Xe)}}),p&&Qe===0&&!ve&&a.jsx("div",{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${u}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:ze(ge)}})]},Me.id)}),p&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":nt,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":ve?"center":"left-y",className:`${u}-control-anchor`,style:{top:Ee,left:0,width:"100%",height:ze(Math.max(De,ss))}})},"row-padding-handles"),p&&!ve&&pt&&Ge&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":pt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ze[0]-((vt==null?void 0:vt.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":he??void 0,className:`${u}-control-anchor`,style:{top:0,left:0,width:ze(At),height:"100%"}}),a.jsx("div",{"data-controls":Ge.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ze[je.length-1]-((Rt==null?void 0:Rt.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":he??void 0,className:`${u}-control-anchor`,style:{top:0,left:ze(Vt-wt),width:ze(wt),height:"100%"}})]},"column-edge-padding-handles"),p&&!ve&&je.slice(0,-1).map((Me,Qe)=>{const rt=je[Qe+1],dt=Be.slice(0,Qe+1).reduce((Tt,Ot)=>Tt+Ot,0),Pt=we[Qe],St=we[Qe+1],ht=Math.max(Pt.paddingRight,uo),Wt=Math.max(St.paddingLeft,uo);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Me.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ze[Qe]-Pt.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":he??void 0,className:`${u}-control-anchor`,style:{top:0,left:ze(dt-ht),width:ze(ht),height:"100%"}}),a.jsx("div",{"data-controls":rt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ze[Qe+1]-St.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":he??void 0,className:`${u}-control-anchor`,style:{top:0,left:ze(dt),width:ze(Wt),height:"100%"}})]},`${Me.paddingRightKey}-padding`)}),p&&!ve&&je.slice(0,-1).map((Me,Qe)=>{const rt=L0(Qe,Be,_e,fe),Pt=Be.slice(0,Qe+1).reduce((St,ht)=>St+ht,0)-Oc/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Me.widthKey,"data-controls-axis":"x","data-controls-min":String(_l),"data-controls-max-fraction":String(rt),"data-controls-variant":"column-width",className:`${u}-col-resize-handle`,style:{position:"absolute",top:"0px",left:ze(Pt),width:ze(Oc),height:"calc(100%)",pointerEvents:"auto"}})},`${Me.widthKey}-junction`)})]}),st&&(()=>{const Me=va(e,oi),Qe=r0(e.cutLabelVerticalAlign),rt=Me.textTextAlign==="justify"||ve;return a.jsx("button",{type:"button",className:`${u}-cut-item`,style:{minHeight:ze(O??0),cursor:Ae?"pointer":"default",...Uv(be,b??0,n??!1)},onClick:Ae?gt:void 0,onMouseEnter:G||ee?Bt:void 0,onMouseLeave:G?rn:void 0,children:a.jsx("div",{className:`${u}-list-cols-row`,style:{...ve?{paddingLeft:ze(te),paddingRight:ze(te)}:{},justifyContent:a0(Me.textTextAlign),alignItems:Nc(Qe)},children:a.jsx("span",{className:Hc(e,oi,`${u}-cut-label`,`${u}-text-tight-leading`),style:{..._c(Me,n),...Wc(e,oi,u,n),...rt?{width:"100%"}:{}},children:U})})})})(),ee&&ae&&typeof document<"u"&&(()=>{const Me=`${ae.widthPx}px`,Qe={width:Me,height:"auto",maxHeight:Me,objectFit:"contain"},rt=(c?document.getElementById(c):null)??document.body;return Gn.createPortal(a.jsx("div",{ref:ye,className:`${u}-hover-media-anchor`,"data-selection":"none",children:a.jsx(Xv,{media:ae,className:ae.isVideo?`${u}-hover-video`:`${u}-hover-image`,style:Qe},`${ae.rowId}-${ae.url}`)}),rt)})()]})})]})}const E0=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
10349
|
+
`}const Pi=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Fl=["AColumn","BColumn","CColumn","DColumn","EColumn"],oi="cutLabel",vr=[...Fl,oi],Wa=["A","B","C","D","E"];function Zu(e){return`${e}ColumnVerticalAlign`}const js=["Top","Center","Bottom"];function Nl(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Wa.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Qv(e){const t=Nl(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function e0(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Wa.includes(n)?n:null}function Ju(e,t,n){const i=e0(e);return i?i===t?!1:Qv(n[Zu(i)]):!0}function xr(e){const t=Nl(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Wa.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function t0(e,t,n){if(Qu(e,t,n))return xr(e);const i=xr(e);return i.kind==="baseline"?{kind:"top"}:i}function n0(e){const t=xr(e);return t.kind==="baseline"?{kind:"top"}:t}function Qu(e,t,n){return Ju(e,n,t)?xr(e).kind==="baseline":!1}function i0(e){const t={};let n=!1;for(const i of Wa){const o=Zu(i),r=e[o];if(e.type==="b"){const l=String(r??"Top").trim();l!=="Top"&&l!=="Center"&&l!=="Bottom"&&(t[o]="Top",n=!0);continue}Ju(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function o0(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function r0(e){const t=xr(e).kind;return t==="baseline"?"center":t}function a0(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Nc(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function s0(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(),r=o-i;return n.remove(),r}function ss(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=s0(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const c=r.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+l}function l0(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const r=o.querySelector(`.${n}`);r&&(r.style.minHeight=`${i}px`,r.style.height=`${i}px`)}),i)}function c0(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const d0={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function qt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const u0={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function p0(e){return[qt(e,"textFontFamily"),qt(e,"textFontSettings"),{type:"row",items:[qt(e,"textFontSize"),qt(e,"textLineHeight"),qt(e,"textLetterSpacing"),qt(e,"textWordSpacing")]},qt(e,"textTextAlign"),qt(e,"textTextAppearance"),`${e}VerticalAlign`]}function m0(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(vr.map(e=>[u0[e],p0(e)]))}}function xa(e,t){const n=i=>{const o=qt(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===oi?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function _c(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(Qt(n,t))}function Hc(e,t,n,i){const o=xa(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function Wc(e,t,n,i){const o=xa(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:F.scalingValue((r-l)/2,i)}}const In=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],ko=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Eo=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Mo=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],g0={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},h0=["hover","focus","filled","success","error"],Oc=.004,uo=.004,ls=uo,_l=50,br=1440,Sr=_l/br;function ep(e){const t=typeof e=="number"&&e>0?e:br;return _l/t}function f0(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 br}const tp={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function lr(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function y0(e,t=1){const n=t/e;return Object.fromEntries(In.map(i=>[i,n]))}function v0(){return Object.fromEntries([...ko.map(e=>[e,0]),...Eo.map(e=>[e,0])])}function x0(){return Object.fromEntries(Mo.map(e=>[e,0]))}function Dr(e){return Object.fromEntries(In.map(t=>[t,typeof e[t]=="number"?e[t]:tp[t]]))}function np(e,t,n){const i=e-Sr,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const r=i/o;return{paddingLeft:t*r,paddingRight:n*r}}function ca(e,t,n){const i=Hl(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((r,l)=>r+l,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function b0(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=ko[o],l=Eo[o],c=typeof n[r]=="number"?n[r]:0,d=typeof n[l]=="number"?n[l]:0,u=np(t[o]??0,c,d);u.paddingLeft!==c&&(i[r]=u.paddingLeft),u.paddingRight!==d&&(i[l]=u.paddingRight)}return i}function Hl(e,t,n){if(e<=0)return[];const i=In.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),l=o.reduce((u,p)=>u+p,0)+Sr;if(t>=l)return i;const c=[...o];let d=l-t;for(let u=c.length-1;u>=0&&d>0;u-=1){const p=c[u]-Sr;if(p<=0)continue;const y=Math.min(d,p);c[u]-=y,d-=y}return[...c,i[e-1]]}function S0(e,t,n){if(e<=1)return{};const i=Hl(e,t,n),o={};for(let r=0;r<e-1;r+=1){const l=In[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function Dc(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Pi]}function w0(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function $0(e,t,n,i){const o=Math.min(i,e.length,In.length),r={};for(let l=0;l<o;l+=1){const c=e[l],d=t.indexOf(c);if(d===-1)continue;const u=In[d],p=ko[d],y=Eo[d],v=Mo[d],m=In[l],g=ko[l],x=Eo[l],b=Mo[l],k=n[u],f=n[p],S=n[y],W=n[v];typeof k=="number"&&(r[m]=k),typeof f=="number"&&(r[g]=f),typeof S=="number"&&(r[x]=S),typeof W=="number"&&(r[b]=W)}return r}function ip(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 C0(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=lr(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...y0(n,o),...v0()};if(r)for(const c of Mo)typeof t[c]=="number"&&(l[c]=t[c]);else Object.assign(l,x0());return ip(e,l)?l:e}function T0(e,t,n){const i=i0(e);i&&(e={...e,...i});const o=ep(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,c=lr(e),d=lr(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:Pi.length,y=S=>{if(u)return S;const W=Dr({...t,...S}),U=lr(S),B=ca(p,U,W),P=b0(p,B,{...t,...S});return Object.keys(P).length===0?S:{...S,...P}};if(typeof r=="number"&&r!==l)return e;const v=Dc(e),m=Dc(t);if(!w0(v,m))return y({...e,...$0(v,m,t,p)});if(c<d&&typeof p=="number"&&!u){const S=Dr({...t,...e});return y({...e,...S0(p,c,S)})}if(u){const S=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,W=Math.max(0,(c-o)/2);return S>W?{...e,textPaddingLR:W}:e}const g=Dr({...t,...e}),x=ca(p,d,Dr(t)),k=ca(p,c,g).some((S,W)=>S<(x[W]??S)),f=In.some(S=>{const W=e[S],U=t[S];return typeof W=="number"&&typeof U=="number"&&W!==U});return k||f?y(e):e}function L0(e,t,n,i){const o=t.slice(0,e).reduce((l,c)=>l+c,0),r=n.slice(e+1,t.length-1).reduce((l,c)=>l+c,0);return Math.max(Sr,i-o-r-Sr)}function P0(e,t){return Math.random()*(t-e)+e}function I0(e){return Object.fromEntries(In.map(t=>[t,typeof e[t]=="number"?e[t]:tp[t]]))}function cs(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function R0(e,t,n,i,o,r){return e.slice(0,t).map((l,c)=>{const d=ko[c],u=Eo[c],p=Mo[c];return{key:l,textPrefix:d0[l],widthKey:In[c],width:n[In[c]],paddingLeftKey:d,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[d],paddingRight:o[u],paddingBottom:r[p]}})}function k0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,portalId:c,onUpdateSettings:d}){const{prefix:u}=F.useScopedStyles(),p=!!o,{columns:y,type:v,wrapperWidth:m,entriesCount:g,cellMinHeight:x,dividerWidth:b,showVisibility:k,cut:f,showCut:S,cutCellMinHeight:W,cutLabel:U,imageSize:B,imageOnHover:P,imagePosition:_="cursor",imageInterpolation:G="on",entryHoverEffect:$,entryHoverShowOption:L,rowPaddingTop:D,rowPaddingBottom:E,rowPaddingTopB:T,columnsOrder:C,textPaddingLR:V,textColor:w,backgroundColor:q,dividerColor:I,textHoverColor:A,backgroundHoverColor:j,dividerHoverColor:ie}=e,[ae,O]=s.useState(void 0),[oe,N]=s.useState(null),le=s.useRef(null),Q=P==="on"&&(!n||i),be=_==="cursor",Pe=be&&G==="on",{anchorRef:ye,onShow:ce,onCursorMove:Y,exit:se}=Zv(!!(Q&&oe!==null),Pe),pe=(f??0)>0,fe=v==="b",we=s.useRef(null),Re=s.useRef(null),[ge,xe]=s.useState(null),[Ce,h]=s.useState(br),K=ep(Ce),Z=Math.max(0,((m??0)-K)/2),ne=Math.min(V??0,Z),de=Math.max(ne,uo),z=((m??0)+K)/2;s.useLayoutEffect(()=>{if(!n){h(br);return}const Me=()=>{h(f0(we.current))};Me();const Qe=we.current;if(!Qe)return;const rt=new ResizeObserver(Me);rt.observe(Qe);let dt=Qe;for(;dt&&!dt.style.getPropertyValue("--cntrl-article-width");)dt=dt.parentElement;return dt&&rt.observe(dt),()=>rt.disconnect()},[n,l]),s.useEffect(()=>{O(void 0)},[f,S,t,g]),s.useEffect(()=>{n&&!i&&O(void 0)},[n,i]);const R=F.buildColorVars(u,{textColor:w,backgroundColor:q,dividerColor:I,textHoverColor:A,backgroundHoverColor:j,dividerHoverColor:ie},g0,h0),ee=r&&r!=="default"?`${u}-state-${r}`:"",me=`${!n||i?$==="default"?`${u}-entry-hover-default`:$==="blinds"?`${u}-entry-hover-blinds`:$==="reveal"?`${u}-entry-hover-reveal`:"":""} ${ee}`.trim(),X=$==="reveal"&&(!n||i),Ie=(k==null?void 0:k[0])??!1,Se=(k==null?void 0:k[1])??!1,J=s.useRef(e),He=s.useRef(l);s.useEffect(()=>{if(!d||!n){J.current=e,He.current=l;return}if(He.current!==l){J.current=e,He.current=l;return}const Me=J.current;if(!(Me!==e))return;if(typeof Me.columns=="number"&&typeof e.columns=="number"&&Me.columns!==e.columns){J.current=e;return}const rt=T0(e,Me,{designWidth:Ce});J.current=e,ip(e,rt)&&d(rt)},[e,d,n,l,Ce]);const We=s.useMemo(()=>I0(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),ot=s.useMemo(()=>cs(e,ko),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),qe=s.useMemo(()=>cs(e,Eo),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),tt=s.useMemo(()=>cs(e,Mo),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),et=s.useMemo(()=>Array.isArray(C)&&C.length>0?C:[...Pi],[C]),Ge=s.useMemo(()=>R0(et,y,We,ot,qe,tt),[et,y,We,ot,qe,tt]),ve=lr(e),_e=s.useMemo(()=>In.slice(0,y).map(Me=>We[Me]),[y,We]),Be=s.useMemo(()=>Hl(y,ve,We),[y,ve,We]),Ze=s.useMemo(()=>ca(y,ve,We),[y,ve,We]),$e=s.useMemo(()=>Ge.map((Me,Qe)=>np(Ze[Qe]??0,Me.paddingLeft,Me.paddingRight)),[Ge,Ze]),Ne=s.useMemo(()=>{const Me=g===0?1/0:g;return(t??[]).slice(0,Me).map((rt,dt)=>({id:dt,cells:Object.fromEntries(Pi.map(Pt=>[Pt,rt[Pt]??""])),image:rt.image,link:rt.link}))},[t,g]),Ue=pe?ae??f:Ne.length,Je=s.useMemo(()=>pe?Ne.slice(0,Ue):Ne,[Ne,pe,Ue]),st=pe&&Ue<Ne.length,it=Je.length>1||st,Oe=[Ie?`${u}-divider-top`:"",Se||it?`${u}-divider-bottom`:""].filter(Boolean).join(" "),Ae=!n||i,gt=()=>{if(!Ae)return;const Me=ae??f;if(!S){O(Ne.length);return}O(Math.min(Me+S,Ne.length))},ze=Me=>F.scalingValue(Me,n??!1),De=fe?T??0:D??0,Xe=E??0,ct=x??0,he=Math.max(Xe,ls),Ee=Mc(0,Je.length,Ie,Se,st,b??0,n??!1).borderTopWidth,nt=fe?"rowPaddingTopB":"rowPaddingTop",pt=Ge[0],Ve=Ge[Ge.length-1],vt=$e[0],Rt=$e[$e.length-1],At=pt&&vt?Math.max(vt.paddingLeft,uo):0,wt=Ve&&Rt?Math.max(Rt.paddingRight,uo):0,Vt=ve,jt=(Me,Qe)=>Yv(_,we.current,be?Me:null,Qe),Kt=(Me,Qe)=>{if(!Q)return;const rt=Me.image;if(!(rt!=null&&rt.url)){se(()=>N(null));return}const dt=(B==null?void 0:B.min)??80,Pt=(B==null?void 0:B.max)??320,St=(oe==null?void 0:oe.rowId)===Me.id,ht=St?oe.widthPx:P0(dt,Pt),{x:Wt,y:Tt}=jt(Qe,ht);if(St&&be){Y(Wt,Tt);return}N({rowId:Me.id,url:rt.url,objectFit:"contain",isVideo:Gv(rt),widthPx:ht}),le.current={x:Wt,y:Tt}},Yt=Me=>{if(!Q||!oe||!be)return;const{x:Qe,y:rt}=jt(Me,oe.widthPx);Y(Qe,rt)},kt=()=>{oe&&se(()=>N(null))},Bt=Me=>{X&&kc(Me,u),!(!Q||!oe)&&se(()=>N(null))},rn=Me=>{X&&Ec(Me,u)};s.useLayoutEffect(()=>{if(!oe||!le.current)return;const{x:Me,y:Qe}=le.current;le.current=null,ce(Me,Qe)},[oe==null?void 0:oe.rowId,oe==null?void 0:oe.url,ce]),s.useLayoutEffect(()=>{if(!p||fe){xe(null);return}const Me=Re.current,Qe=Me==null?void 0:Me.parentElement;if(!Me||!Qe){xe(null);return}const rt=()=>{const Pt=Me.querySelector("[data-list-row]");if(!Pt){xe(null);return}const St=Qe.getBoundingClientRect(),ht=Pt.getBoundingClientRect();xe(ht.top-St.top+ht.height/2)};rt();const dt=new ResizeObserver(rt);return dt.observe(Me),dt.observe(Qe),()=>dt.disconnect()},[p,fe,Je,De,Xe,ct,t,e,Ge,Ze,Ce,b,Ie,Se,st]);const xt=s.useMemo(()=>!fe&&Fl.some(Me=>{const Qe=Me.charAt(0),rt=e[`${Me}VerticalAlign`];return Qu(rt,e,Qe)}),[fe,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var Wt;const Me=we.current;if(!Me)return;const Qe=()=>{Me.querySelectorAll("[data-list-col]").forEach(Tt=>{Tt.style.transform="";const Ot=Tt.querySelector(`.${u}-list-col`);Ot&&(Ot.style.minHeight="",Ot.style.height="");const Gt=Tt.querySelector(`.${u}-list-col-title`);Gt&&(Gt.style.transform="")})};if(fe||!xt){Qe();return}const rt=()=>{const Tt=Array.from(Me.querySelectorAll("[data-list-row]")),Ot=`${u}-list-col`,Gt=`${u}-baseline-probe`;Tt.forEach(Mt=>{Mt.querySelectorAll("[data-list-col]").forEach(_t=>{_t.style.transform="";const Ft=_t.querySelector(`.${Ot}`);Ft&&(Ft.style.minHeight="",Ft.style.height="");const ut=_t.querySelector(`.${u}-list-col-title`);ut&&(ut.style.transform="")})}),Tt.forEach(Mt=>{const _t=Array.from(Mt.querySelectorAll("[data-list-col]"));l0(Mt,_t,Ot)}),Me.offsetHeight,Tt.forEach(Mt=>{const _t=Array.from(Mt.querySelectorAll("[data-list-col]")),Ft=Mt.getBoundingClientRect().top,ut=new Map,H=_t.map(Fe=>{const ft=Fe.querySelector(`.${u}-list-col-title`),Ht={el:Fe,titleEl:ft,letter:Fe.getAttribute("data-col-letter")??"",kind:Fe.getAttribute("data-valign")??"top",anchor:Fe.getAttribute("data-valign-anchor")};return ut.set(Ht.letter,Ht),Ht}),Le=new Map,je=(Fe,ft)=>{const Ht=Le.get(Fe.letter);if(Ht!==void 0)return Ht;const mt=Fe.anchor?ut.get(Fe.anchor):void 0;if(Fe.kind!=="baseline"||!mt||ft.has(Fe.letter)){const ln=ss(Fe,Ft,Ot,Gt);return Le.set(Fe.letter,ln),ln}ft.add(Fe.letter);const Lt=je(mt,ft);ft.delete(Fe.letter);const Ut=ss(Fe,Ft,Ot,Gt),Dt=Lt-Ut;c0(Fe.titleEl,Dt);const an=ss(Fe,Ft,Ot,Gt);return Le.set(Fe.letter,an),an};H.forEach(Fe=>je(Fe,new Set))})};let dt=null;const Pt=()=>{dt===null&&(dt=requestAnimationFrame(()=>{dt=null,rt()}))};rt();const St=new ResizeObserver(()=>Pt());St.observe(Me);let ht=!1;return typeof document<"u"&&((Wt=document.fonts)!=null&&Wt.ready)&&document.fonts.ready.then(()=>{ht||Pt()}),()=>{ht=!0,dt!==null&&(cancelAnimationFrame(dt),dt=null),St.disconnect(),Qe()}},[xt,fe,e,t,Ce,Je,Ze]);const yt=s.useMemo(()=>Jv(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:yt}}),a.jsx("div",{style:R,children:a.jsxs("div",{ref:we,className:`${u}-wrapper ${me}${Oe?` ${Oe}`:""}${fe?` ${u}-type-b`:""}`.trim(),style:{width:F.scalingValue(m??0,n)},onMouseMove:Q?Yt:void 0,onMouseLeave:Q?kt:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[Je.map((Me,Qe)=>{var St;const rt=(((St=Me.link)==null?void 0:St.length)??0)>0,dt=rt&&(!n||i)?"a":"div",Pt=Mc(Qe,Je.length,Ie,Se,st,b??0,n??!1);return a.jsxs(dt,{ref:Qe===0?ht=>{Re.current=ht}:void 0,className:`${u}-list-item${rt||L==="always"?` ${u}-list-item-has-link`:""}${st&&Qe===Je.length-1?` ${u}-list-item-before-cut`:""}`,...rt?{href:Me.link,target:"_blank"}:{},style:Pt,onMouseEnter:ht=>{X&&(rt||L==="always")&&kc(ht,u),Q&&Kt(Me,ht)},onMouseLeave:ht=>{X&&(rt||L==="always")&&Ec(ht,u)},children:[De>0&&a.jsx("div",{className:`${u}-row-padding-handle`,style:{height:ze(De)}}),a.jsxs("div",{className:`${u}-list-cols-row${fe?"":` ${u}-list-cols-row-h`}${p&&Qe===0&&fe?` ${u}-list-cols-row-controls`:""}`,...fe?{}:{"data-list-row":""},style:fe?void 0:{minHeight:ze(ct)},children:[Ge.map((ht,Wt)=>{const Tt=Wt===Ge.length-1,Ot=$e[Wt],Gt=ht.paddingBottom,Mt=qv(Me.cells[ht.key]),_t=fe&&Mt&&Gt>0,Ft=fe?{minHeight:ze(ct)}:{width:ze(Ze[Wt])},ut=fe?{paddingLeft:ze(ne),paddingRight:ze(ne)}:{paddingLeft:ze(Ot.paddingLeft),paddingRight:ze(Ot.paddingRight)},H=ht.textPrefix.charAt(0),Le=fe?n0(e[`${ht.textPrefix}VerticalAlign`]):t0(e[`${ht.textPrefix}VerticalAlign`],e,H),je=fe&&Mt&&p&&Qe===0;return fe&&!Mt?null:a.jsxs("div",{className:fe?`${u}-list-col-wrap`:void 0,...fe?{}:{"data-list-col":"","data-col-letter":H,"data-valign":Le.kind,...Le.kind==="baseline"?{"data-valign-anchor":Le.anchorLetter}:{}},children:[a.jsx("div",{className:`${u}-list-col${Tt?` ${u}-list-col-last`:""}`,style:{...ut,...Ft,...fe?{justifyContent:Nc(Le.kind)}:{}},"data-test":ht.width,children:a.jsx("span",{className:Hc(e,ht.textPrefix,`${u}-list-col-title`,`${u}-text-tight-leading`),style:{..._c(xa(e,ht.textPrefix),n),...Wc(e,ht.textPrefix,u,n),...fe?{}:o0(Le.kind)},children:Me.cells[ht.key]??null})}),_t&&a.jsx("div",{className:`${u}-row-padding-handle`,style:{height:ze(Gt)}}),je&&a.jsx("div",{"data-controls":ht.paddingBottomKey,"data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${u}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:ze(Math.max(Gt,ls))}})]},ht.key)}),p&&Qe===0&&fe&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(z),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${u}-control-anchor`,style:{top:0,left:0,width:ze(de),height:"100%"}}),a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(z),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${u}-control-anchor`,style:{top:0,left:ze(Math.max(de,ve-de)),width:ze(de),height:"100%"}})]})]}),!fe&&Xe>0&&a.jsx("div",{className:`${u}-row-padding-handle`,style:{height:ze(Xe)}}),p&&Qe===0&&!fe&&a.jsx("div",{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${u}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:ze(he)}})]},Me.id)}),p&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":nt,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":fe?"center":"left-y",className:`${u}-control-anchor`,style:{top:Ee,left:0,width:"100%",height:ze(Math.max(De,ls))}})},"row-padding-handles"),p&&!fe&&pt&&Ve&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":pt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ze[0]-((vt==null?void 0:vt.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ge??void 0,className:`${u}-control-anchor`,style:{top:0,left:0,width:ze(At),height:"100%"}}),a.jsx("div",{"data-controls":Ve.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ze[Ge.length-1]-((Rt==null?void 0:Rt.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ge??void 0,className:`${u}-control-anchor`,style:{top:0,left:ze(Vt-wt),width:ze(wt),height:"100%"}})]},"column-edge-padding-handles"),p&&!fe&&Ge.slice(0,-1).map((Me,Qe)=>{const rt=Ge[Qe+1],dt=Be.slice(0,Qe+1).reduce((Tt,Ot)=>Tt+Ot,0),Pt=$e[Qe],St=$e[Qe+1],ht=Math.max(Pt.paddingRight,uo),Wt=Math.max(St.paddingLeft,uo);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Me.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ze[Qe]-Pt.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ge??void 0,className:`${u}-control-anchor`,style:{top:0,left:ze(dt-ht),width:ze(ht),height:"100%"}}),a.jsx("div",{"data-controls":rt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ze[Qe+1]-St.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ge??void 0,className:`${u}-control-anchor`,style:{top:0,left:ze(dt),width:ze(Wt),height:"100%"}})]},`${Me.paddingRightKey}-padding`)}),p&&!fe&&Ge.slice(0,-1).map((Me,Qe)=>{const rt=L0(Qe,Be,_e,ve),Pt=Be.slice(0,Qe+1).reduce((St,ht)=>St+ht,0)-Oc/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Me.widthKey,"data-controls-axis":"x","data-controls-min":String(_l),"data-controls-max-fraction":String(rt),"data-controls-variant":"column-width",className:`${u}-col-resize-handle`,style:{position:"absolute",top:"0px",left:ze(Pt),width:ze(Oc),height:"calc(100%)",pointerEvents:"auto"}})},`${Me.widthKey}-junction`)})]}),st&&(()=>{const Me=xa(e,oi),Qe=r0(e.cutLabelVerticalAlign),rt=Me.textTextAlign==="justify"||fe;return a.jsx("button",{type:"button",className:`${u}-cut-item`,style:{minHeight:ze(W??0),cursor:Ae?"pointer":"default",...Uv(Se,b??0,n??!1)},onClick:Ae?gt:void 0,onMouseEnter:X||Q?Bt:void 0,onMouseLeave:X?rn:void 0,children:a.jsx("div",{className:`${u}-list-cols-row`,style:{...fe?{paddingLeft:ze(ne),paddingRight:ze(ne)}:{},justifyContent:a0(Me.textTextAlign),alignItems:Nc(Qe)},children:a.jsx("span",{className:Hc(e,oi,`${u}-cut-label`,`${u}-text-tight-leading`),style:{..._c(Me,n),...Wc(e,oi,u,n),...rt?{width:"100%"}:{}},children:U})})})})(),Q&&oe&&typeof document<"u"&&(()=>{const Me=`${oe.widthPx}px`,Qe={width:Me,height:"auto",maxHeight:Me,objectFit:"contain"},rt=(c?document.getElementById(c):null)??document.body;return Gn.createPortal(a.jsx("div",{ref:ye,className:`${u}-hover-media-anchor`,"data-selection":"none",children:a.jsx(Xv,{media:oe,className:oe.isVideo?`${u}-hover-video`:`${u}-hover-image`,style:Qe},`${oe.rowId}-${oe.url}`)}),rt)})()]})})]})}const E0=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
10322
10350
|
import { createPortal } from 'react-dom';
|
|
10323
10351
|
import { CommonComponentProps } from '../props';
|
|
10324
10352
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -13408,7 +13436,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13408
13436
|
</>
|
|
13409
13437
|
);
|
|
13410
13438
|
}
|
|
13411
|
-
`,Bo=["A","B","C","D","E"],zc=[...js,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],Ni={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 M0(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function zr(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function A0(){return Object.fromEntries(Bo.map((e,t)=>{const n=Pi[t],i=`${e} column`;return[n,M0(i)]}))}function F0(){const e={};for(const t of Bo)e[`${t}ColumnWidth`]=zr(`${t} column width`),e[`${t}ColumnPaddingLeft`]=zr(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=zr(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=zr(`${t} column padding bottom`);return e}function Bc(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Pi]};for(const r of Bo)i[`${r}ColumnWidth`]=r==="A"?.0798:.32,i[`${r}ColumnPaddingLeft`]=0,i[`${r}ColumnPaddingRight`]=0,i[`${r}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function N0(e){const t={};if(e===oi)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...js]},enum:[...js]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...zc],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...zc]}}return t[qt(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[qt(e,"textFontSettings")]={...Ni.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[qt(e,"textFontSize")]={...Ni.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[qt(e,"textLineHeight")]={...Ni.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[qt(e,"textLetterSpacing")]={...Ni.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[qt(e,"textWordSpacing")]={...Ni.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[qt(e,"textTextAlign")]={...Ni.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[qt(e,"textTextAppearance")]={...Ni.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const _0=vr.reduce((e,t)=>({...e,...N0(t)}),{});function H0(e){return{verticalAlign:e===oi?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===oi?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function W0(e,t={}){var n;return{...H0(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const jc=new Set(["textFontFamily","textFontSettings"]);function O0(e,t,n){const i=r=>n===void 0?!0:n==="common"?jc.has(r):!jc.has(r),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=Nl(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[qt(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[qt(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[qt(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[qt(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[qt(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[qt(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[qt(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[qt(e,"textTextAppearance")]=t.textTextAppearance),o}function ca(e={},t){return vr.reduce((n,i)=>({...n,...O0(i,W0(i,e),t)}),{})}const D0=ca(),z0=m0();function op(e){return[qt(e,"textFontFamily"),qt(e,"textFontSettings"),qt(e,"textFontSize"),qt(e,"textLineHeight"),qt(e,"textLetterSpacing"),qt(e,"textWordSpacing"),qt(e,"textTextAlign"),qt(e,"textTextAppearance"),`${e}VerticalAlign`]}function B0(){const e=[];return Fl.forEach((t,n)=>{const i=Pi[n],o=op(t);for(let r=1;r<Pi.length;r+=1){const l=[{name:"columns",value:r},...Array.from({length:r},(c,d)=>({name:`columnsOrder.${d}`,value:i,isNotEqual:!0}))];o.forEach(c=>{e.push({if:l,then:{name:`properties.${c}.display.visible`,value:!1}})})}}),e}const j0=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];op(oi);const V0=[...Bo.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],_i=[{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"}],G0=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:_i[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:_i[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:_i[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:_i[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:_i[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:_i[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:_i[6],link:""}],X0=[...Bo.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],q0={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:{...A0(),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:G0},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"]}},imagePosition:{type:"string",scope:"layout",title:"Image Position",display:{type:"toggle-cycle",enum:["left","center","right","cursor"]}},imageInterpolation:{type:"boolean",scope:"common",title:"Interpolation",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"}},...F0(),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"}},..._0,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",imagePosition:"cursor",imageInterpolation:"on",entryHoverEffect:"default",entryHoverShowOption:"always",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#000000",textHoverColor:"#FFFFFF",...D0,...ca({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:Bc({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},...ca({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:Bc({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},...ca({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...B0(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...V0.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}},...Bo.map(e=>({if:{name:"type",value:"a"},then:{name:`properties.${e}ColumnPaddingBottom.display.visible`,value:!1}})),{if:{name:"imagePosition",value:"cursor",isNotEqual:!0},then:{name:"properties.imageInterpolation.display.enabled",value:!1}}],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imagePosition","imageInterpolation","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","entryHoverShowOption","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...X0]},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:"",items:["imagePosition","imageInterpolation"]},{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__",z0]}],paletteBookmark:{items:[...j0],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},U0={element:k0,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>C0(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:[...vr.map(e=>({path:`${qt(e,"textFontFamily")}`}))]},fontRelations:{...vr.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${qt(t,"textFontFamily")}`}),{})},schema:q0,sourceCode:E0},Vc=300,pi=.004,K0={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"},Y0=["hover","focus","filled","success","error"];function Z0(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Gc(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Xc(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:F.scalingValue((o-t)/2,i)}}function J0(e){return`
|
|
13439
|
+
`,Bo=["A","B","C","D","E"],zc=[...js,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],Ni={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 M0(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function zr(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function A0(){return Object.fromEntries(Bo.map((e,t)=>{const n=Pi[t],i=`${e} column`;return[n,M0(i)]}))}function F0(){const e={};for(const t of Bo)e[`${t}ColumnWidth`]=zr(`${t} column width`),e[`${t}ColumnPaddingLeft`]=zr(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=zr(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=zr(`${t} column padding bottom`);return e}function Bc(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Pi]};for(const r of Bo)i[`${r}ColumnWidth`]=r==="A"?.0798:.32,i[`${r}ColumnPaddingLeft`]=0,i[`${r}ColumnPaddingRight`]=0,i[`${r}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function N0(e){const t={};if(e===oi)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...js]},enum:[...js]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...zc],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...zc]}}return t[qt(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[qt(e,"textFontSettings")]={...Ni.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[qt(e,"textFontSize")]={...Ni.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[qt(e,"textLineHeight")]={...Ni.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[qt(e,"textLetterSpacing")]={...Ni.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[qt(e,"textWordSpacing")]={...Ni.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[qt(e,"textTextAlign")]={...Ni.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[qt(e,"textTextAppearance")]={...Ni.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const _0=vr.reduce((e,t)=>({...e,...N0(t)}),{});function H0(e){return{verticalAlign:e===oi?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===oi?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function W0(e,t={}){var n;return{...H0(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const jc=new Set(["textFontFamily","textFontSettings"]);function O0(e,t,n){const i=r=>n===void 0?!0:n==="common"?jc.has(r):!jc.has(r),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=Nl(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[qt(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[qt(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[qt(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[qt(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[qt(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[qt(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[qt(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[qt(e,"textTextAppearance")]=t.textTextAppearance),o}function da(e={},t){return vr.reduce((n,i)=>({...n,...O0(i,W0(i,e),t)}),{})}const D0=da(),z0=m0();function op(e){return[qt(e,"textFontFamily"),qt(e,"textFontSettings"),qt(e,"textFontSize"),qt(e,"textLineHeight"),qt(e,"textLetterSpacing"),qt(e,"textWordSpacing"),qt(e,"textTextAlign"),qt(e,"textTextAppearance"),`${e}VerticalAlign`]}function B0(){const e=[];return Fl.forEach((t,n)=>{const i=Pi[n],o=op(t);for(let r=1;r<Pi.length;r+=1){const l=[{name:"columns",value:r},...Array.from({length:r},(c,d)=>({name:`columnsOrder.${d}`,value:i,isNotEqual:!0}))];o.forEach(c=>{e.push({if:l,then:{name:`properties.${c}.display.visible`,value:!1}})})}}),e}const j0=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];op(oi);const V0=[...Bo.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],_i=[{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"}],G0=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:_i[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:_i[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:_i[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:_i[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:_i[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:_i[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:_i[6],link:""}],X0=[...Bo.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],q0={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:{...A0(),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:G0},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"]}},imagePosition:{type:"string",scope:"layout",title:"Image Position",display:{type:"toggle-cycle",enum:["left","center","right","cursor"]}},imageInterpolation:{type:"boolean",scope:"common",title:"Interpolation",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"}},...F0(),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"}},..._0,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",imagePosition:"cursor",imageInterpolation:"on",entryHoverEffect:"default",entryHoverShowOption:"always",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#000000",textHoverColor:"#FFFFFF",...D0,...da({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:Bc({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},...da({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:Bc({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},...da({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...B0(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...V0.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}},...Bo.map(e=>({if:{name:"type",value:"a"},then:{name:`properties.${e}ColumnPaddingBottom.display.visible`,value:!1}})),{if:{name:"imagePosition",value:"cursor",isNotEqual:!0},then:{name:"properties.imageInterpolation.display.enabled",value:!1}}],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imagePosition","imageInterpolation","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","entryHoverShowOption","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...X0]},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:"",items:["imagePosition","imageInterpolation"]},{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__",z0]}],paletteBookmark:{items:[...j0],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},U0={element:k0,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>C0(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:[...vr.map(e=>({path:`${qt(e,"textFontFamily")}`}))]},fontRelations:{...vr.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${qt(t,"textFontFamily")}`}),{})},schema:q0,sourceCode:E0},Vc=300,pi=.004,K0={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"},Y0=["hover","focus","filled","success","error"];function Z0(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Gc(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Xc(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:F.scalingValue((o-t)/2,i)}}function J0(e){return`
|
|
13412
13440
|
.${e}-wrapper {
|
|
13413
13441
|
box-sizing: border-box;
|
|
13414
13442
|
display: flex;
|
|
@@ -13573,7 +13601,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13573
13601
|
pointer-events: none;
|
|
13574
13602
|
z-index: 2;
|
|
13575
13603
|
}
|
|
13576
|
-
`}function qc(e,t,n,i,o,r,l,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:r??0,textAppearance:l,color:c??"#000000"}}function Q0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r}){const{prefix:l}=F.useScopedStyles(),c=o??!1,{wrapperWidth:d=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:y="solid",entryHoverEffect:v="default",autoclose:m="off",icon:g,iconMaxWidth:x=.00833,iconPaddingRight:b=0,iconAnimation:k="rotate 45",questionColor:f="#000000",answerColor:S="#000000",dividerColor:
|
|
13604
|
+
`}function qc(e,t,n,i,o,r,l,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:r??0,textAppearance:l,color:c??"#000000"}}function Q0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r}){const{prefix:l}=F.useScopedStyles(),c=o??!1,{wrapperWidth:d=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:y="solid",entryHoverEffect:v="default",autoclose:m="off",icon:g,iconMaxWidth:x=.00833,iconPaddingRight:b=0,iconAnimation:k="rotate 45",questionColor:f="#000000",answerColor:S="#000000",dividerColor:W="#0000001F",iconColor:U="#000000",questionHoverColor:B="#666666",iconHoverColor:P="#666666",iconActiveColor:_="#000000",dividerHoverColor:G="#000000",questionFontFamily:$,questionFontSettings:L,questionFontSize:D,questionLineHeight:E,questionLetterSpacing:T,questionWordSpacing:C,questionTextAppearance:V,answerFontFamily:w,answerFontSettings:q,answerFontSize:I,answerLineHeight:A,answerLetterSpacing:j,answerWordSpacing:ie,answerTextAppearance:ae,questionPaddingLeft:O=0,questionPaddingTop:oe=0,questionPaddingBottom:N=0,answerPaddingLeft:le=0,answerPaddingRight:Q=0,answerPaddingTop:be=0,answerPaddingBottom:Pe=0}=e,ye=t??[],[ce,Y]=s.useState(()=>new Set),se=!n||i;s.useEffect(()=>{Y(new Set)},[m]),s.useEffect(()=>{n&&!o&&!i&&Y(new Set)},[n,o,i]);const pe=Ze=>F.scalingValue(Ze,n??!1),fe=Math.max(O,pi),we=Math.max(oe,pi),Re=Math.max(N,pi),ge=Math.max(le,pi),xe=Math.max(Q,pi),Ce=Math.max(be,pi),h=Math.max(Pe,pi),K=Math.max(0,(d??1)-b-x),Z=Math.max(0,(d??1)-Q),ne=Math.max(0,(d??1)-le),de=Math.max(b,pi),z=Math.max(0,(d??1)-O-x),R=s.useMemo(()=>ce.size===0?0:Math.min(...ce),[ce]),ee=s.useCallback(Ze=>ce.has(Ze),[ce]),te=se&&v==="default"?`${l}-entry-hover-default`:"",me=g??"",X=me!=="",Ie=k.replace(/^rotate /,""),Se=`${l}-icon-anim-${Ie}`,J=dn(Qt(qc($,L,D,E,T,C,V,f),n)),He=dn(Qt(qc(w,q,I,A,j,ie,ae,S),n)),We=Gc(D,E,`${l}-question`,`${l}-text-tight-leading`),ot=Gc(I,A,`${l}-answer-text`,`${l}-text-tight-leading`),qe=Xc(D,E,l,n),tt=Xc(I,A,l,n),et=F.buildColorVars(l,{questionColor:f,answerColor:S,dividerColor:W,iconColor:U,questionHoverColor:B,iconHoverColor:P,iconActiveColor:_,dividerHoverColor:G},K0,Y0),Ge=r&&r!=="default"?`${l}-state-${r}`:"",ve=s.useCallback(Ze=>{se&&Y($e=>{if($e.has(Ze)){const Ue=new Set($e);return Ue.delete(Ze),Ue}if(m==="on")return new Set([Ze]);const Ne=new Set($e);return Ne.add(Ze),Ne})},[se,m]),_e=s.useMemo(()=>J0(l),[l]),Be={[`--${l}-divider-width`]:F.scalingValue(p,n??!1),[`--${l}-divider-style`]:y,[`--${l}-icon-max-width`]:F.scalingValue(x,n??!1),...u>0?{[`--${l}-question-min-height`]:F.scalingValue(u,n??!1)}:{}};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:_e}}),a.jsx("div",{style:et,children:a.jsx("div",{className:Ct(`${l}-wrapper`,n&&!i&&`${l}-editor`,te,Ge),style:{width:F.scalingValue(d,n??!1),maxWidth:"100%",...Be},children:ye.map((Ze,$e)=>{var Oe;const Ne=ee($e),Ue=((Oe=Ze.question)==null?void 0:Oe.trim())??"",Je=Ze.answer,st=((Je==null?void 0:Je.length)??0)>0,it=c&&$e===R;return a.jsxs("div",{className:Ct(`${l}-item`,Ne&&`${l}-item-open`),"data-faq-item":"",children:[a.jsxs("div",{className:`${l}-question-controls`,children:[it&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"questionPaddingTop","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{top:0,left:0,width:"100%",height:pe(we)}}),a.jsx("div",{"data-controls":"questionPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(K),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:pe(fe),height:"100%"}}),a.jsx("div",{"data-controls":"iconPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(z),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:pe(de),height:"100%"}})]}),a.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":Ne,style:{...J,...qe,paddingLeft:pe(O),paddingRight:pe(b)},onClick:()=>ve($e),children:[oe>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:pe(oe)},"aria-hidden":"true"}),a.jsxs("span",{className:`${l}-question-row`,children:[a.jsx("span",{className:We,children:Ue}),st&&(X?a.jsx("span",{className:`${l}-icon ${l}-icon-custom ${Se}`,"aria-hidden":"true",children:a.jsx(mn,{url:me,fill:`var(--${l}-icon-color)`,hoverFill:`var(--${l}-icon-hover-color, var(--${l}-icon-color))`,className:`${l}-icon-image`})}):a.jsx("span",{className:`${l}-icon ${l}-icon-default ${Se}`,"aria-hidden":"true"}))]}),N>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:pe(N)},"aria-hidden":"true"})]}),it&&a.jsx("div",{"data-controls":"questionPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:pe(Re)}})]}),st&&Je&&a.jsx("div",{className:`${l}-panel`,"aria-hidden":!Ne,children:a.jsx("div",{className:`${l}-panel-inner`,children:a.jsxs("div",{className:`${l}-answer-controls`,children:[it&&Ne&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"answerPaddingTop","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{top:0,left:0,width:"100%",height:pe(Ce)}}),a.jsx("div",{"data-controls":"answerPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Z),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:pe(ge),height:"100%"}}),a.jsx("div",{"data-controls":"answerPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(ne),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:pe(xe),height:"100%"}})]}),be>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:pe(be)}}),a.jsx("div",{className:`${l}-answer`,style:{...He,...tt,paddingLeft:pe(le),paddingRight:pe(Q)},children:a.jsx("div",{className:ot,children:a.jsx(Ki,{content:Je})})}),Pe>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:pe(Pe)}}),it&&Ne&&a.jsx("div",{"data-controls":"answerPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:pe(h)}})]})})})]},$e)})})})]})}const ex=`import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
13577
13605
|
import cn from 'classnames';
|
|
13578
13606
|
import { CommonComponentProps } from '../props';
|
|
13579
13607
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -14321,7 +14349,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
14321
14349
|
</>
|
|
14322
14350
|
);
|
|
14323
14351
|
}
|
|
14324
|
-
`;function mi(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Uc={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},tx=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],nx={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:mi("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:{...Uc.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:{...Uc.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:mi("Question Padding Left"),questionPaddingTop:mi("Question Padding Top"),questionPaddingBottom:mi("Question Padding Bottom"),answerPaddingLeft:mi("Answer Padding Left"),answerPaddingRight:mi("Answer Padding Right"),answerPaddingTop:mi("Answer Padding Top"),answerPaddingBottom:mi("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01M0GB8Z9EQFMGYA20F2J0ACA8.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:[...tx],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},ix={element:Q0,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:nx,sourceCode:ex},ri=e=>e.display==="cover",Wa=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Kc=100,ox=.2,Yc=8,rp=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,r]=s.useState(0),[l,c]=s.useState(!1),d=s.useRef(null),u=s.useRef(0);u.current=o;const p=s.useMemo(()=>typeof window>"u"?Kc:Math.max(Kc,window.innerHeight*ox),[]),y=s.useCallback($=>Math.max(0,1-$/(p*1.5)),[p]),v=s.useCallback($=>Math.max(0,1-$/(p*.45)),[p]),m=s.useCallback($=>{const L=typeof window<"u"?window.innerHeight:800,D=Math.max(.88,1-$/L*.12);return`translateY(${$}px) scale(${D})`},[]),g=s.useCallback(()=>{d.current=null},[]),x=s.useCallback(()=>{c(!0),r(0),window.setTimeout(()=>c(!1),n),g()},[n,g]),b=s.useCallback(()=>{const $=typeof window<"u"?window.innerHeight:800;c(!0),r($),window.setTimeout(()=>{t(),g(),c(!1)},Math.min(n,200))},[n,t,g]),k=s.useCallback($=>{!e||l||$.pointerType==="touch"&&(i!=null&&i($.target)||(d.current={startX:$.clientX,startY:$.clientY,isLocked:null,pointerId:$.pointerId}))},[e,l,i]),f=s.useCallback($=>{const L=d.current;if(!e||!L||$.pointerType!=="touch"||L.pointerId!==$.pointerId)return;const D=$.clientX-L.startX,_=$.clientY-L.startY;if(L.isLocked===null){if(Math.abs(D)<Yc&&Math.abs(_)<Yc)return;if(_>0&&_>Math.abs(D))L.isLocked=!0,$.currentTarget.setPointerCapture($.pointerId);else{L.isLocked=!1,g();return}}if(!L.isLocked)return;$.preventDefault();const C=Math.max(0,_);u.current=C,r(C)},[e,g]),S=s.useCallback($=>{const L=d.current;if(!e||!L||$.pointerType!=="touch"||L.pointerId!==$.pointerId)return;const D=L.isLocked===!0;if($.currentTarget.hasPointerCapture($.pointerId)&&$.currentTarget.releasePointerCapture($.pointerId),!D){g();return}$.clientY-L.startY>=p?b():x()},[p,b,e,g,x]),O=s.useCallback($=>{S($)},[S]),U=s.useCallback($=>{S($)},[S]),z=o>0,I=l?`transform ${n}ms ease`:"none",N=l?`opacity ${n}ms ease`:"none",q=o>0||l;return{isSwipeDragging:z,backdropStyle:{opacity:y(o),transition:N},mediaAreaStyle:{transform:m(o),transition:I,touchAction:z?"none":void 0,willChange:z?"transform":void 0},overlayContentStyle:q?{opacity:v(o),transition:N}:void 0,swipeHandlers:e?{onPointerDown:k,onPointerMove:f,onPointerUp:O,onPointerCancel:U}:{},dismissAreaStyle:e?{touchAction:z?"none":"pan-x"}:void 0}},rx="[data-lightbox-scrollable]",Wl=(e=!0)=>{s.useEffect(()=>{if(!e)return;const t=window.scrollY,n=document.body.style.overflow,i=document.body.style.position,o=document.body.style.top,r=document.body.style.width,l=document.documentElement.style.overflow;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${t}px`,document.body.style.width="100%",document.documentElement.style.overflow="hidden";const c=d=>{const u=d.target;u instanceof Element&&u.closest(rx)||d.preventDefault()};return document.addEventListener("touchmove",c,{passive:!1}),()=>{document.removeEventListener("touchmove",c),document.body.style.overflow=n,document.body.style.position=i,document.body.style.top=o,document.body.style.width=r,document.documentElement.style.overflow=l,window.scrollTo({top:t,left:0,behavior:"instant"})}},[e])},ax=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},sx=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},lx=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},cx=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,c=n-l,d=l-n,u=(g,x)=>{sx(t),e.scrollLeft=g,x&&(r==null||r())};if(Math.abs(c)<.5)return u(n,!0),()=>{};let p=!1,y=0;const v=()=>{t.removeEventListener("transitionend",m),clearTimeout(y)},m=g=>{g.target!==t||g.propertyName!=="transform"||p||(p=!0,v(),u(n,!0))};return t.addEventListener("transitionend",m),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)`,y=window.setTimeout(()=>{p||(p=!0,v(),u(n,!0))},i+64),()=>{p||(p=!0,v(),u(l-lx(t),!1))}},cr=300,dx=900,ux=1500,px="cubic-bezier(0.16, 1, 0.3, 1)",mx=3e3,gx=2,hx=16,fx=.05,yx=1,Br=.3,vx=50,xx=20,oo=.004,Ao=["title1","title2","title3"],bx={title1:"1",title2:"2",title3:"3"},Sx={title1:"title1Color",title2:"title2Color",title3:"title3Color"},wx={title1:.02,title2:.02,title3:.02},jr=e=>`max(${e}, ${xx}px)`,$x=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]}},Cx=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=$x(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Zt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Tx=e=>[Zt(e,"fontFamily"),Zt(e,"fontSettings"),{type:"row",items:[Zt(e,"fontSize"),Zt(e,"lineHeight"),Zt(e,"letterSpacing"),Zt(e,"wordSpacing")]},Zt(e,"textAlign"),Zt(e,"textAppearance")],Lx=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Ao.map(e=>[bx[e],Tx(e)]))}),Ol=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((r,l)=>r+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:r,widths:l},c)=>{if(r<=0||c<=0)return{overflow:r,widths:[c,...l]};const d=Math.min(r,c);return{overflow:r-d,widths:[c-d,...l]}},{overflow:i-1,widths:[]});return o},ap=(e,t)=>Ol(e,t),Vr=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Zc=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Ol(e.length,n),effective:ap(e.length,n)}},Px=(e,t,n,i,o,r,l)=>{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:r,text:n}),i&&c.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:l,text:i}),c},cs=(e,t)=>{const n=i=>{const o=Zt(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[Sx[t]]}},Ix=(e,t,n,i)=>e.slice(0,i).reduce((o,r,l)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[l]??0),0),ds=(e,t,n)=>{var o,r;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((r=t.fontSettings)==null?void 0:r.fontStyle)??"normal"},fontSize:t.fontSize??wx[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Qt(i,n)},Rx=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:c,thumbnailSize:d,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:y,closeIcon:v,closeIconMaxWidth:m,closeIconColor:g,closeIconHoverColor:x,thumbnailTrigger:b,thumbnailVisibility:k,thumbnailObjectFit:f,thumbnailActive:S,thumbnailActiveColor:O,title1Width:U,title2Width:z,title3Width:I,title1MarginLeft:N=0,title2MarginLeft:q=0,title3MarginLeft:$=0,titleRowMarginBottom:L=0,titleHeaderLayout:D="desktop",contentMarginTop:_,iconMarginLeft:C}=n,T=M=>F.scalingValue(M,i??!1),B=d??n.thumnailSize??.03,w=T(B),X=T(u),R=T(p??.02),E=T(y??0),V=T(_??0),ie=jr(V),re=T(C??0),[W,ae]=s.useState(0),A=s.useRef(W);A.current=W;const le=t[W],{title1:ee,title2:xe,title3:Pe}=Cx(le),ye=ds("title1",cs(n,"title1"),i),pe=ds("title2",cs(n,"title2"),i),Y=ds("title3",cs(n,"title3"),i),se=D==="mobile",de=!o&&(!i||r),ve=de,$e=de,ke=de,he=ri(f),Se=he?{"--image-aspect-ratio":Wa(f)}:void 0,Ce=!!(ee||xe||Pe),h=s.useMemo(()=>Px(e,ee,xe,Pe,ye,pe,Y),[e,W,ee,xe,Pe,ye,pe,Y]),K=s.useMemo(()=>({title1Width:U,title2Width:z,title3Width:I}),[U,z,I]),Z=s.useMemo(()=>h.map(M=>K[M.widthKey]),[h,K]),te=s.useMemo(()=>Ol(h.length,Z),[h.length,Z]),me=s.useMemo(()=>ap(h.length,Z),[h.length,Z]),j=s.useMemo(()=>h.filter(M=>M.prefix==="title1"),[h]),P=s.useMemo(()=>h.filter(M=>M.prefix==="title2"||M.prefix==="title3"),[h]),Q=s.useMemo(()=>Zc(j,K),[j,K]),ne=s.useMemo(()=>Zc(P,K),[P,K]),ue=s.useCallback((M,oe)=>{const ce=h.indexOf(M);if(!se||oe==="single-row")return{effectiveWidth:me[ce]??0,resolvedWidth:te[ce]??0,maxWidth:Vr(ce,te)};if(oe==="two-row-top"){const Ke=j.indexOf(M);return{effectiveWidth:Q.effective[Ke]??0,resolvedWidth:Q.resolved[Ke]??0,maxWidth:Vr(Ke,Q.resolved)}}const Re=P.indexOf(M);return{effectiveWidth:ne.effective[Re]??0,resolvedWidth:ne.resolved[Re]??0,maxWidth:Vr(Re,ne.resolved)}},[P,ne,me,te,h,j,Q,se]),G=s.useCallback(M=>F.scalingValue(M,i??!1),[i]),Ie=G(L??0),be=s.useMemo(()=>({title1MarginLeft:N,title2MarginLeft:q,title3MarginLeft:$}),[N,q,$]),J=s.useCallback(M=>h.slice(0,M+1).reduce((oe,ce,Re)=>oe+(ce!=null&&ce.marginLeftKey?be[ce.marginLeftKey]??0:0)+(te[Re]??0),0)+(se?0:N??0),[h,be,te,se,N]),He=s.useCallback(()=>se?0:N??0,[se,N]),We=s.useCallback(M=>P.slice(0,M).reduce((oe,ce,Re)=>oe+(ce.marginLeftKey?be[ce.marginLeftKey]??0:0)+(ne.resolved[Re]??0),0),[P,ne.resolved,be]),ot=s.useCallback(M=>{const oe=P[M];return We(M)+(oe.marginLeftKey?be[oe.marginLeftKey]??0:0)+(ne.resolved[M]??0)},[P,ne.resolved,We,be]),qe=(M,oe)=>{const ce=M.marginLeftKey?be[M.marginLeftKey]??0:0,{effectiveWidth:Re,resolvedWidth:Ke,maxWidth:lt}=ue(M,oe),Et=o&&oe==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":M.prefix,style:{...oe==="single-row"?{gridArea:M.prefix}:{},width:G(Re),...ce>0?{marginLeft:G(ce)}:{}},children:[a.jsx("p",{className:M.className,style:M.style,children:M.text}),Et&&M.marginLeftKey&&a.jsx("div",{"data-controls":M.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ke),style:{position:"absolute",top:0,left:G(-ce),width:`max(${G(ce)}, 10px)`,height:"100%",pointerEvents:"auto"}}),Et&&a.jsx("div",{"data-controls":M.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(lt),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:G(-oo/2),width:G(oo),height:"100%",pointerEvents:"auto"}})]},M.className)},tt=()=>{const M=se?-1:h.findIndex(Re=>Re.prefix==="title1"),oe=!se&&(o||(N??0)>0)?(()=>{const Re=N??0,Ke=M>=0?te[M]:U??0;return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ke),style:{position:"absolute",top:0,left:0,width:`max(${G(Re)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,ce=h.flatMap((Re,Ke)=>{if(!Re.marginLeftKey)return[];const lt=be[Re.marginLeftKey]??0,Et=Ix(h,te,be,Ke)+He();return a.jsx("div",{"data-controls":Re.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(te[Ke]),style:{position:"absolute",top:0,left:G(Et),width:`max(${G(lt)}, 10px)`,height:"100%",pointerEvents:"auto"}},Re.marginLeftKey)});return oe?[oe,...ce]:ce},et=()=>h.map((M,oe)=>{const ce=Vr(oe,te),Ke=J(oe)-oo/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":M.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ce),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:G(Ke),width:G(oo),height:"100%",pointerEvents:"auto"}})},`${M.widthKey}-junction`)}),je=()=>P.flatMap((M,oe)=>{if(!M.marginLeftKey)return[];const ce=be[M.marginLeftKey]??0,Re=We(oe),{resolvedWidth:Ke}=ue(M,"two-row-bottom");return a.jsx("div",{"data-controls":M.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ke),style:{position:"absolute",top:0,left:G(Re),width:`max(${G(ce)}, 10px)`,height:"100%",pointerEvents:"auto"}},M.marginLeftKey)}),fe=()=>P.map((M,oe)=>{const{maxWidth:ce}=ue(M,"two-row-bottom"),Ke=ot(oe)-oo/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":M.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ce),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:G(Ke),width:G(oo),height:"100%",pointerEvents:"auto"}})},`${M.widthKey}-junction`)}),_e=s.useRef(null),Be=s.useRef(null),Ze=s.useRef(null),we=s.useRef(null),Ne=s.useRef([]),Ue=s.useRef([]),Je=s.useRef(0),st=s.useRef(null),it=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),Oe=s.useRef(null),Ae=s.useRef(null),gt=s.useRef(0),ze=s.useRef("forward"),De=s.useRef(0),Xe=s.useRef(null),ct=s.useRef(!1),ge=t.length>1&&(!o||!!r),Ee=ge?3:1,nt=s.useMemo(()=>Array.from({length:Ee},()=>t).flat(),[t,Ee]),[pt,Ge]=s.useState(!1),[vt,Rt]=s.useState(!1),[At,wt]=s.useState(!0),Vt=s.useRef(null),jt=s.useRef(null),Kt=s.useRef(!1),Yt=s.useRef(!1),kt=s.useRef(null),Bt=s.useRef(null),rn=ve&&!At,xt=s.useCallback(()=>{ve&&(wt(!0),Bt.current&&clearTimeout(Bt.current),Bt.current=setTimeout(()=>{it.current.isActive||wt(!1)},mx))},[ve]),yt=s.useCallback(()=>{o||Yt.current||(Yt.current=!0,Rt(!1),kt.current=setTimeout(()=>{l()},cr))},[o,l]),Me=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":rn?"true":"false",style:{width:F.scalingValue(m??0,i),height:F.scalingValue(m??0,i),marginRight:re,"--close-icon-hover-color":x},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:yt,"aria-label":"Close",children:a.jsx(mn,{url:v,fill:g,hoverFill:i&&!r?g:x,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:re,height:"100%",pointerEvents:"auto"}})]}),Qe=(M="two-row")=>a.jsx("div",{...M==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:G(N??0),flexShrink:0,...M==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...M==="two-row"&&o?{pointerEvents:"auto"}:{}}}),rt=()=>{const M=h.find(Re=>Re.prefix==="title1"),oe=h.filter(Re=>Re.prefix==="title2"||Re.prefix==="title3"),ce=oe.length>0||o||(L??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(N??0)>0||o?Qe():null,M&&qe(M,"two-row-top"),v&&Me()]}),ce?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[oe.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[oe.map(Re=>qe(Re,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[je(),fe()]})]}):null,a.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:Ie,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},dt=()=>a.jsxs(a.Fragment,{children:[(N??0)>0||o?Qe("single-row"):null,h.map(M=>qe(M,"single-row")),o?a.jsxs(a.Fragment,{children:[tt(),et()]}):null,v?Me():null]}),Pt=s.useCallback(M=>!!(M.closest("[data-controls]")||M.closest(`.${e}-thumbnails`)||M.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:St,backdropStyle:ht,mediaAreaStyle:Wt,overlayContentStyle:Tt,swipeHandlers:Ot,dismissAreaStyle:Gt}=rp({enabled:de??!1,onClose:yt,animMs:cr,isBlockedTarget:Pt}),Mt=()=>{if(!ge||t.length===0)return Je.current=0,0;const M=Ue.current[0],oe=Ue.current[t.length];if(!M||!oe)return Je.current;const ce=oe.offsetLeft-M.offsetLeft;return ce>0&&(Je.current=ce),Je.current},_t=(M=!1)=>{if(!ge)return;const oe=Be.current,ce=Mt();!oe||ce<=0||ce<oe.clientWidth*.25||(oe.scrollLeft<=0?(oe.scrollLeft+=ce,M&&(it.current.scrollLeft+=ce),ct.current&&(De.current+=ce)):oe.scrollLeft>=ce*2&&(oe.scrollLeft-=ce,M&&(it.current.scrollLeft-=ce),ct.current&&(De.current-=ce)))},Ft=(M,oe=(ce=>(ce=Be.current)==null?void 0:ce.scrollLeft)()??0)=>{if(!ge)return M;let Re=t.length+M,Ke=1/0;for(let lt=0;lt<Ee;lt++){const Et=lt*t.length+M,zt=Ue.current[Et];if(!zt)continue;const en=Math.abs(zt.offsetLeft-oe);en<Ke&&(Ke=en,Re=Et)}return Re},ut=M=>{const oe=Be.current;return!M||!oe?!1:M.offsetWidth>oe.clientWidth+1},H=M=>{const oe=Be.current;if(!M||!oe||!ut(M))return!1;const ce=M.offsetLeft,Re=ce+M.offsetWidth;return oe.scrollLeft>=ce-1&&oe.scrollLeft+oe.clientWidth<=Re+1},Le=(M=(oe=>(oe=Be.current)==null?void 0:oe.scrollLeft)()??0)=>{for(let Re=0;Re<Ue.current.length;Re+=1){const Ke=Ue.current[Re];if(Ke&&H(Ke))return Re}let ce={flatIndex:0,distance:1/0};return Ue.current.forEach((Re,Ke)=>{if(!Re)return;const lt=Math.abs(Re.offsetLeft-M);lt<ce.distance&&(ce={flatIndex:Ke,distance:lt})}),ce.flatIndex},Ve=M=>{Be.current&&Ue.current.forEach(oe=>{oe&&(oe.style.scrollSnapAlign=ut(oe)&&M==="backward"?"end":"start")})},Fe=(M,oe,ce)=>{const Re=M-oe,Ke=Le(oe),lt=Ue.current[Ke];if(H(lt))return Le(M)%t.length;const Et=Ue.current[Ke+1],zt=lt?Et?Et.offsetLeft-lt.offsetLeft:lt.offsetWidth:0,en=zt>0?Re>zt*Br?1:Re<-zt*Br?-1:0:0;return en===0?ce:ge?(ce+en+t.length)%t.length:Math.max(0,Math.min(t.length-1,ce+en))},ft=s.useCallback((M=!1)=>{if(k!=="on"||o)return;const oe=we.current,ce=A.current,Re=Ne.current[ce];if(!oe||!Re||oe.scrollWidth<=oe.clientWidth)return;const Ke=oe.scrollLeft,lt=Ke+oe.clientWidth,Et=Re.offsetLeft,zt=Et+Re.offsetWidth;if(Et>=Ke&&zt<=lt)return;const en=oe.scrollWidth-oe.clientWidth;let tn=Ke;if(!M&&Vt.current===null){const ci=Ne.current[ce-1],to=Ne.current[ce+1],di=ci?Re.offsetLeft-ci.offsetLeft:to?to.offsetLeft-Re.offsetLeft:Re.offsetWidth;zt>lt?tn+=di:Et<Ke&&(tn-=di)}else zt>lt?tn=zt-oe.clientWidth:tn=Et;oe.scrollLeft=Math.max(0,Math.min(en,tn))},[o,k]),Ht=s.useCallback((M=!1)=>{M&&(Kt.current=!0),jt.current===null&&(jt.current=requestAnimationFrame(()=>{jt.current=null;const oe=Kt.current;Kt.current=!1,ft(oe)}))},[ft]),mt=s.useCallback(M=>{if(M===A.current)return;const oe=A.current;A.current=M;const ce=Math.abs(M-oe)>1,Re=ge&&t.length>1&&(oe===t.length-1&&M===0||oe===0&&M===t.length-1);ae(M),Ht(ce||Re)},[t.length,ge,Ht]),Lt=()=>{if(!Be.current||t.length===0||Vt.current!==null||it.current.isActive&&it.current.hasMoved)return;const M=Be.current.scrollLeft,oe=Le(M)%t.length;oe!==A.current&&mt(oe)},Ut=()=>{Vt.current=null},Dt=M=>{const oe=Be.current;oe&&(oe.style.scrollSnapType=M?"":"none")},an=()=>{var M;(M=Ae.current)==null||M.call(Ae),Ae.current=null},ln=()=>{Xe.current!==null&&(cancelAnimationFrame(Xe.current),Xe.current=null),ct.current=!1},qn=()=>{const M=Be.current;if(!M){Xe.current=null,ct.current=!1;return}const oe=De.current-M.scrollLeft;if(Math.abs(oe)<.5){M.scrollLeft=De.current,_t(),Lt(),Xe.current=null,ct.current=!1;return}M.scrollLeft+=oe*fx,_t(),Lt(),xt(),Xe.current=requestAnimationFrame(qn)},Un=()=>{const M=Ze.current;M&&(M.style.transition="",M.style.transform="",M.style.willChange="")},Zi=(M,oe,ce,Re)=>{Un(),M.scrollLeft=oe,gt.current=M.scrollLeft,_t(),ce!==void 0?(A.current=ce,ae(ce)):Lt(),Dt(!0),Re==null||Re()},hn=(M,{behavior:oe="smooth",activeIndex:ce,onComplete:Re}={})=>{const Ke=Be.current,lt=Ze.current;if(!Ke||!lt)return;if(ln(),an(),Dt(!1),oe==="auto"){Zi(Ke,M,ce,Re);return}const Et=Math.abs(M-Ke.scrollLeft),zt=ax(Et,dx,ux,Ke.clientWidth*.55);Ae.current=cx(Ke,lt,M,{duration:zt,easing:px,onComplete:()=>{Ae.current=null,Zi(Ke,M,ce,Re)}})},Vo=(M="smooth")=>{const oe=Be.current;if(!oe||t.length===0)return;const ce=Le()%t.length,Re=Ft(ce,oe.scrollLeft),Ke=Ue.current[Re];Ke&&hn(Ke.offsetLeft,{behavior:M,activeIndex:ce})},Go=(M,oe="smooth",ce,Re)=>{const Ke=Be.current;if(!Ke||t.length===0)return;const lt=(Re??Ke.scrollLeft)-M,Et=Le(M),zt=Ue.current[Et];if(H(zt)){Dt(!0),Lt();return}const en=Ue.current[Et+1],tn=zt?en?en.offsetLeft-zt.offsetLeft:zt.offsetWidth:0;if((tn>0?lt>tn*Br?1:lt<-tn*Br?-1:0:0)!==0){const qo=ce??Et%t.length,Da=Fe(Re??Ke.scrollLeft,M,qo);xn(Da,oe);return}const to=Re??Ke.scrollLeft,di=Le(to),Xo=Ue.current[di];if(Xo&&Math.abs(Xo.offsetLeft-to)<1){Dt(!0),Lt();return}Vo("auto")},xn=(M,oe="smooth")=>{const ce=Be.current;if(!ce||t.length===0)return;const Re=Ft(M,ce.scrollLeft),Ke=Ue.current[Re];Ke&&(oe==="smooth"?Vt.current=M:Vt.current=null,A.current=M,ae(M),Ht(!0),hn(Ke.offsetLeft,{behavior:oe,activeIndex:M,onComplete:oe==="smooth"?Ut:void 0}))},li=()=>{Oe.current&&(window.removeEventListener("pointerup",Oe.current),window.removeEventListener("pointercancel",Oe.current),Oe.current=null)},Ji=(M,oe,ce,Re,Ke)=>{const lt=ce-M,Et=Re-oe,zt=Math.abs(lt),en=Math.abs(Et);if(zt<vx||zt<=en)return!1;const tn=lt<0?1:-1,ci=ge?(Ke+tn+t.length)%t.length:Math.max(0,Math.min(t.length-1,Ke+tn));return ci===Ke?!1:(xn(ci),!0)},bn=M=>{if(!it.current.isActive)return;li();const oe=Be.current;if(!oe)return;const{scrollLeft:ce,startActiveIndex:Re,hasMoved:Ke}=it.current,lt=oe.scrollLeft;_t(!0),it.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},Ge(!1),M!==void 0&&oe.hasPointerCapture(M)&&oe.releasePointerCapture(M),Ke?Go(ce,"smooth",Re,lt):(Dt(!0),Lt()),xt()},Kn=(M,oe)=>{const ce=st.current;st.current=null,ce&&(Ji(ce.startX,ce.startY,M,oe,ce.startActiveIndex),xt())},Qi=M=>{if(!$e)return;if(M.pointerType==="touch"){if(ln(),Dt(!0),Pt(M.target))return;st.current={startX:M.clientX,startY:M.clientY,startActiveIndex:A.current};return}if(M.pointerType!=="mouse"||M.button!==0||Pt(M.target))return;const oe=Be.current;if(!oe)return;ln(),an(),Un(),Vt.current=null,it.current={isActive:!0,startX:M.clientX,scrollLeft:oe.scrollLeft,startActiveIndex:A.current,hasMoved:!1},Dt(!1),xt(),oe.setPointerCapture(M.pointerId),li();const ce=Re=>{Re.pointerType==="mouse"&&bn(Re.pointerId)};Oe.current=ce,window.addEventListener("pointerup",ce),window.addEventListener("pointercancel",ce)},eo=M=>{if(!$e||M.pointerType!=="mouse")return;const oe=Be.current;if(!oe||!it.current.isActive)return;if(M.buttons===0){bn(M.pointerId);return}const ce=M.clientX-it.current.startX;Math.abs(ce)>yx&&(it.current.hasMoved=!0,Ge(!0)),it.current.hasMoved&&(M.preventDefault(),oe.scrollLeft=it.current.scrollLeft-ce,_t(!0),Lt(),xt())},Te=M=>{if($e){if(M.pointerType==="touch"){M.type==="pointerup"?Kn(M.clientX,M.clientY):st.current=null;return}M.pointerType==="mouse"&&bn(M.pointerId)}},Ye=M=>{!$e||M.pointerType!=="mouse"||bn(M.pointerId)};return Wl(),s.useEffect(()=>{const M=requestAnimationFrame(()=>Rt(!0));return()=>{cancelAnimationFrame(M),an(),li(),jt.current!==null&&(cancelAnimationFrame(jt.current),jt.current=null),kt.current&&clearTimeout(kt.current),Bt.current&&clearTimeout(Bt.current)}},[]),s.useEffect(()=>{if(!ve){wt(!0);return}xt();const M=()=>xt();return document.addEventListener("pointermove",M,{passive:!0}),document.addEventListener("pointerdown",M,{passive:!0}),()=>{document.removeEventListener("pointermove",M),document.removeEventListener("pointerdown",M),Bt.current&&clearTimeout(Bt.current)}},[ve,xt]),s.useEffect(()=>{const M=oe=>{oe.key==="Escape"&&yt()};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[yt]),s.useLayoutEffect(()=>{Mt()},[E,t.length,ge]),s.useLayoutEffect(()=>{o||xn(A.current,"auto")},[E,o]),s.useLayoutEffect(()=>{xn(0,"auto")},[t.length,ge]),s.useEffect(()=>{const M=Be.current;if(!M||o||!de)return;const oe=ce=>{if(ce.preventDefault(),Math.abs(ce.deltaY)<=Math.abs(ce.deltaX))return;const Re=ce.deltaMode===1?hx:ce.deltaMode===2?M.clientHeight:1,Ke=ce.deltaY*Re*gx;if(Ke!==0){if(an(),ct.current||(ct.current=!0,De.current=M.scrollLeft,Vt.current=null,Dt(!1)),De.current+=Ke,!ge){const lt=M.scrollWidth-M.clientWidth;De.current=Math.max(0,Math.min(lt,De.current))}xt(),Xe.current===null&&(Xe.current=requestAnimationFrame(qn))}};return M.addEventListener("wheel",oe,{passive:!1}),()=>{M.removeEventListener("wheel",oe),ln()}},[o,de,ge]),s.useEffect(()=>{const M=Be.current;if(!M)return;const oe=()=>{_t(it.current.isActive);const Re=M.scrollLeft,Ke=Re-gt.current;gt.current=Re;const lt=Je.current>0?Je.current*.5:1/0;if(Ke!==0&&Math.abs(Ke)<lt){const Et=Ke>0?"forward":"backward";Et!==ze.current&&(ze.current=Et,Ve(Et))}it.current.isActive&&it.current.hasMoved||Lt()};M.addEventListener("scroll",oe,{passive:!0});const ce=new ResizeObserver(()=>{Mt(),_t(it.current.isActive),Ve(ze.current),Lt()});return ce.observe(M),()=>{an(),M.removeEventListener("scroll",oe),ce.disconnect()}},[t.length,ge]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{St||yt()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:vt?1:0,transition:`opacity ${cr}ms ease`,pointerEvents:vt?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:c,...ht}}),a.jsxs("div",{ref:_e,className:`${e}-lightbox-dismiss-area`,style:Gt,...Ot,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Wt,onClick:M=>M.stopPropagation(),children:a.jsx("div",{ref:Be,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":$e&&t.length>0?"true":"false","data-mouse-dragging":pt?"true":"false",onPointerDown:Qi,onPointerMove:eo,onPointerUp:Te,onPointerCancel:Te,onLostPointerCapture:Ye,children:a.jsx("div",{ref:Ze,className:`${e}-lightbox-strip-track`,style:{gap:E},children:nt.map((M,oe)=>{const ce=M.image.objectFit??"contain",Re=oe%t.length,Ke=Math.floor(oe/t.length),lt=jr(E),Et=`calc(-0.5 * (${lt} + ${E}))`;return a.jsxs("div",{ref:zt=>Ue.current[oe]=zt,className:`${e}-strip-item`,style:{height:D==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:M.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:ce}}),o&&Re<t.length-1&&Ke===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Et,width:lt,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ke}-${M.image.url}-${Re}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":rn?"true":"false",style:Tt,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:V,flexShrink:0,pointerEvents:"none"},children:o&&a.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:ie,pointerEvents:"auto",zIndex:3}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:a.jsx("div",{className:`${e}-lightbox-content-area${se?` ${e}-lightbox-content-area-stacked`:""}`,children:(Ce||v)&&a.jsx("div",{className:`${e}-header ${se?`${e}-header-two-row`:`${e}-header-single-row`}`,children:se?rt():Ce||v?dt():null})})})]}),t.length>1&&k==="on"&&(()=>{const M=jr(R),oe=`calc(-0.5 * (${R} + ${M}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:R},children:a.jsx("div",{ref:we,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:ce=>ce.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":S,style:{gap:X,"--thumbnail-active-color":O},children:[t.map((ce,Re)=>{const Ke=jr(X),lt=`calc(-0.5 * (${Ke} + ${X}))`;return a.jsxs("div",{ref:Et=>{Ne.current[Re]=Et},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":W===Re?"true":"false",onClick:()=>de&&b==="click"&&xn(Re),onMouseEnter:()=>ke&&b==="hover"&&xn(Re),"aria-label":ce.image.name?`View ${ce.image.name}`:`View image ${Re+1}`,"aria-current":W===Re?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${he?` ${e}-thumb-image-cover`:""}`,src:ce.image.url,alt:"",draggable:!1,style:{...Se,maxWidth:w,maxHeight:w,width:f.display==="cover"?"auto":"100%",height:"auto",objectFit:f.display==="cover"?"cover":"contain"}})}),o&&Re<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:lt,width:Ke,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${ce.image.url}-${Re}`)}),o&&a.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:oe,height:M,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function kx(e){return`
|
|
14352
|
+
`;function mi(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Uc={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},tx=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],nx={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:mi("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:{...Uc.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:{...Uc.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:mi("Question Padding Left"),questionPaddingTop:mi("Question Padding Top"),questionPaddingBottom:mi("Question Padding Bottom"),answerPaddingLeft:mi("Answer Padding Left"),answerPaddingRight:mi("Answer Padding Right"),answerPaddingTop:mi("Answer Padding Top"),answerPaddingBottom:mi("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01M0GB8Z9EQFMGYA20F2J0ACA8.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:[...tx],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},ix={element:Q0,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:nx,sourceCode:ex},ri=e=>e.display==="cover",Oa=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Kc=100,ox=.2,Yc=8,rp=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,r]=s.useState(0),[l,c]=s.useState(!1),d=s.useRef(null),u=s.useRef(0);u.current=o;const p=s.useMemo(()=>typeof window>"u"?Kc:Math.max(Kc,window.innerHeight*ox),[]),y=s.useCallback($=>Math.max(0,1-$/(p*1.5)),[p]),v=s.useCallback($=>Math.max(0,1-$/(p*.45)),[p]),m=s.useCallback($=>{const L=typeof window<"u"?window.innerHeight:800,D=Math.max(.88,1-$/L*.12);return`translateY(${$}px) scale(${D})`},[]),g=s.useCallback(()=>{d.current=null},[]),x=s.useCallback(()=>{c(!0),r(0),window.setTimeout(()=>c(!1),n),g()},[n,g]),b=s.useCallback(()=>{const $=typeof window<"u"?window.innerHeight:800;c(!0),r($),window.setTimeout(()=>{t(),g(),c(!1)},Math.min(n,200))},[n,t,g]),k=s.useCallback($=>{!e||l||$.pointerType==="touch"&&(i!=null&&i($.target)||(d.current={startX:$.clientX,startY:$.clientY,isLocked:null,pointerId:$.pointerId}))},[e,l,i]),f=s.useCallback($=>{const L=d.current;if(!e||!L||$.pointerType!=="touch"||L.pointerId!==$.pointerId)return;const D=$.clientX-L.startX,E=$.clientY-L.startY;if(L.isLocked===null){if(Math.abs(D)<Yc&&Math.abs(E)<Yc)return;if(E>0&&E>Math.abs(D))L.isLocked=!0,$.currentTarget.setPointerCapture($.pointerId);else{L.isLocked=!1,g();return}}if(!L.isLocked)return;$.preventDefault();const T=Math.max(0,E);u.current=T,r(T)},[e,g]),S=s.useCallback($=>{const L=d.current;if(!e||!L||$.pointerType!=="touch"||L.pointerId!==$.pointerId)return;const D=L.isLocked===!0;if($.currentTarget.hasPointerCapture($.pointerId)&&$.currentTarget.releasePointerCapture($.pointerId),!D){g();return}$.clientY-L.startY>=p?b():x()},[p,b,e,g,x]),W=s.useCallback($=>{S($)},[S]),U=s.useCallback($=>{S($)},[S]),B=o>0,P=l?`transform ${n}ms ease`:"none",_=l?`opacity ${n}ms ease`:"none",G=o>0||l;return{isSwipeDragging:B,backdropStyle:{opacity:y(o),transition:_},mediaAreaStyle:{transform:m(o),transition:P,touchAction:B?"none":void 0,willChange:B?"transform":void 0},overlayContentStyle:G?{opacity:v(o),transition:_}:void 0,swipeHandlers:e?{onPointerDown:k,onPointerMove:f,onPointerUp:W,onPointerCancel:U}:{},dismissAreaStyle:e?{touchAction:B?"none":"pan-x"}:void 0}},rx="[data-lightbox-scrollable]",Wl=(e=!0)=>{s.useEffect(()=>{if(!e)return;const t=window.scrollY,n=document.body.style.overflow,i=document.body.style.position,o=document.body.style.top,r=document.body.style.width,l=document.documentElement.style.overflow;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${t}px`,document.body.style.width="100%",document.documentElement.style.overflow="hidden";const c=d=>{const u=d.target;u instanceof Element&&u.closest(rx)||d.preventDefault()};return document.addEventListener("touchmove",c,{passive:!1}),()=>{document.removeEventListener("touchmove",c),document.body.style.overflow=n,document.body.style.position=i,document.body.style.top=o,document.body.style.width=r,document.documentElement.style.overflow=l,window.scrollTo({top:t,left:0,behavior:"instant"})}},[e])},ax=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},sx=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},lx=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},cx=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,c=n-l,d=l-n,u=(g,x)=>{sx(t),e.scrollLeft=g,x&&(r==null||r())};if(Math.abs(c)<.5)return u(n,!0),()=>{};let p=!1,y=0;const v=()=>{t.removeEventListener("transitionend",m),clearTimeout(y)},m=g=>{g.target!==t||g.propertyName!=="transform"||p||(p=!0,v(),u(n,!0))};return t.addEventListener("transitionend",m),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)`,y=window.setTimeout(()=>{p||(p=!0,v(),u(n,!0))},i+64),()=>{p||(p=!0,v(),u(l-lx(t),!1))}},cr=300,dx=900,ux=1500,px="cubic-bezier(0.16, 1, 0.3, 1)",mx=3e3,gx=2,hx=16,fx=.05,yx=1,Br=.3,vx=50,xx=20,oo=.004,Ao=["title1","title2","title3"],bx={title1:"1",title2:"2",title3:"3"},Sx={title1:"title1Color",title2:"title2Color",title3:"title3Color"},wx={title1:.02,title2:.02,title3:.02},jr=e=>`max(${e}, ${xx}px)`,$x=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]}},Cx=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=$x(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Zt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Tx=e=>[Zt(e,"fontFamily"),Zt(e,"fontSettings"),{type:"row",items:[Zt(e,"fontSize"),Zt(e,"lineHeight"),Zt(e,"letterSpacing"),Zt(e,"wordSpacing")]},Zt(e,"textAlign"),Zt(e,"textAppearance")],Lx=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Ao.map(e=>[bx[e],Tx(e)]))}),Ol=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((r,l)=>r+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:r,widths:l},c)=>{if(r<=0||c<=0)return{overflow:r,widths:[c,...l]};const d=Math.min(r,c);return{overflow:r-d,widths:[c-d,...l]}},{overflow:i-1,widths:[]});return o},ap=(e,t)=>Ol(e,t),Vr=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Zc=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Ol(e.length,n),effective:ap(e.length,n)}},Px=(e,t,n,i,o,r,l)=>{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:r,text:n}),i&&c.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:l,text:i}),c},ds=(e,t)=>{const n=i=>{const o=Zt(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[Sx[t]]}},Ix=(e,t,n,i)=>e.slice(0,i).reduce((o,r,l)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[l]??0),0),us=(e,t,n)=>{var o,r;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((r=t.fontSettings)==null?void 0:r.fontStyle)??"normal"},fontSize:t.fontSize??wx[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Qt(i,n)},Rx=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:c,thumbnailSize:d,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:y,closeIcon:v,closeIconMaxWidth:m,closeIconColor:g,closeIconHoverColor:x,thumbnailTrigger:b,thumbnailVisibility:k,thumbnailObjectFit:f,thumbnailActive:S,thumbnailActiveColor:W,title1Width:U,title2Width:B,title3Width:P,title1MarginLeft:_=0,title2MarginLeft:G=0,title3MarginLeft:$=0,titleRowMarginBottom:L=0,titleHeaderLayout:D="desktop",contentMarginTop:E,iconMarginLeft:T}=n,C=M=>F.scalingValue(M,i??!1),V=d??n.thumnailSize??.03,w=C(V),q=C(u),I=C(p??.02),A=C(y??0),j=C(E??0),ie=jr(j),ae=C(T??0),[O,oe]=s.useState(0),N=s.useRef(O);N.current=O;const le=t[O],{title1:Q,title2:be,title3:Pe}=Cx(le),ye=us("title1",ds(n,"title1"),i),ce=us("title2",ds(n,"title2"),i),Y=us("title3",ds(n,"title3"),i),se=D==="mobile",pe=!o&&(!i||r),fe=pe,we=pe,Re=pe,ge=ri(f),xe=ge?{"--image-aspect-ratio":Oa(f)}:void 0,Ce=!!(Q||be||Pe),h=s.useMemo(()=>Px(e,Q,be,Pe,ye,ce,Y),[e,O,Q,be,Pe,ye,ce,Y]),K=s.useMemo(()=>({title1Width:U,title2Width:B,title3Width:P}),[U,B,P]),Z=s.useMemo(()=>h.map(M=>K[M.widthKey]),[h,K]),ne=s.useMemo(()=>Ol(h.length,Z),[h.length,Z]),de=s.useMemo(()=>ap(h.length,Z),[h.length,Z]),z=s.useMemo(()=>h.filter(M=>M.prefix==="title1"),[h]),R=s.useMemo(()=>h.filter(M=>M.prefix==="title2"||M.prefix==="title3"),[h]),ee=s.useMemo(()=>Zc(z,K),[z,K]),te=s.useMemo(()=>Zc(R,K),[R,K]),me=s.useCallback((M,re)=>{const ue=h.indexOf(M);if(!se||re==="single-row")return{effectiveWidth:de[ue]??0,resolvedWidth:ne[ue]??0,maxWidth:Vr(ue,ne)};if(re==="two-row-top"){const Ke=z.indexOf(M);return{effectiveWidth:ee.effective[Ke]??0,resolvedWidth:ee.resolved[Ke]??0,maxWidth:Vr(Ke,ee.resolved)}}const ke=R.indexOf(M);return{effectiveWidth:te.effective[ke]??0,resolvedWidth:te.resolved[ke]??0,maxWidth:Vr(ke,te.resolved)}},[R,te,de,ne,h,z,ee,se]),X=s.useCallback(M=>F.scalingValue(M,i??!1),[i]),Ie=X(L??0),Se=s.useMemo(()=>({title1MarginLeft:_,title2MarginLeft:G,title3MarginLeft:$}),[_,G,$]),J=s.useCallback(M=>h.slice(0,M+1).reduce((re,ue,ke)=>re+(ue!=null&&ue.marginLeftKey?Se[ue.marginLeftKey]??0:0)+(ne[ke]??0),0)+(se?0:_??0),[h,Se,ne,se,_]),He=s.useCallback(()=>se?0:_??0,[se,_]),We=s.useCallback(M=>R.slice(0,M).reduce((re,ue,ke)=>re+(ue.marginLeftKey?Se[ue.marginLeftKey]??0:0)+(te.resolved[ke]??0),0),[R,te.resolved,Se]),ot=s.useCallback(M=>{const re=R[M];return We(M)+(re.marginLeftKey?Se[re.marginLeftKey]??0:0)+(te.resolved[M]??0)},[R,te.resolved,We,Se]),qe=(M,re)=>{const ue=M.marginLeftKey?Se[M.marginLeftKey]??0:0,{effectiveWidth:ke,resolvedWidth:Ke,maxWidth:lt}=me(M,re),Et=o&&re==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":M.prefix,style:{...re==="single-row"?{gridArea:M.prefix}:{},width:X(ke),...ue>0?{marginLeft:X(ue)}:{}},children:[a.jsx("p",{className:M.className,style:M.style,children:M.text}),Et&&M.marginLeftKey&&a.jsx("div",{"data-controls":M.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ke),style:{position:"absolute",top:0,left:X(-ue),width:`max(${X(ue)}, 10px)`,height:"100%",pointerEvents:"auto"}}),Et&&a.jsx("div",{"data-controls":M.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(lt),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:X(-oo/2),width:X(oo),height:"100%",pointerEvents:"auto"}})]},M.className)},tt=()=>{const M=se?-1:h.findIndex(ke=>ke.prefix==="title1"),re=!se&&(o||(_??0)>0)?(()=>{const ke=_??0,Ke=M>=0?ne[M]:U??0;return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ke),style:{position:"absolute",top:0,left:0,width:`max(${X(ke)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,ue=h.flatMap((ke,Ke)=>{if(!ke.marginLeftKey)return[];const lt=Se[ke.marginLeftKey]??0,Et=Ix(h,ne,Se,Ke)+He();return a.jsx("div",{"data-controls":ke.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ne[Ke]),style:{position:"absolute",top:0,left:X(Et),width:`max(${X(lt)}, 10px)`,height:"100%",pointerEvents:"auto"}},ke.marginLeftKey)});return re?[re,...ue]:ue},et=()=>h.map((M,re)=>{const ue=Vr(re,ne),Ke=J(re)-oo/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":M.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ue),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:X(Ke),width:X(oo),height:"100%",pointerEvents:"auto"}})},`${M.widthKey}-junction`)}),Ge=()=>R.flatMap((M,re)=>{if(!M.marginLeftKey)return[];const ue=Se[M.marginLeftKey]??0,ke=We(re),{resolvedWidth:Ke}=me(M,"two-row-bottom");return a.jsx("div",{"data-controls":M.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ke),style:{position:"absolute",top:0,left:X(ke),width:`max(${X(ue)}, 10px)`,height:"100%",pointerEvents:"auto"}},M.marginLeftKey)}),ve=()=>R.map((M,re)=>{const{maxWidth:ue}=me(M,"two-row-bottom"),Ke=ot(re)-oo/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":M.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ue),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:X(Ke),width:X(oo),height:"100%",pointerEvents:"auto"}})},`${M.widthKey}-junction`)}),_e=s.useRef(null),Be=s.useRef(null),Ze=s.useRef(null),$e=s.useRef(null),Ne=s.useRef([]),Ue=s.useRef([]),Je=s.useRef(0),st=s.useRef(null),it=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),Oe=s.useRef(null),Ae=s.useRef(null),gt=s.useRef(0),ze=s.useRef("forward"),De=s.useRef(0),Xe=s.useRef(null),ct=s.useRef(!1),he=t.length>1&&(!o||!!r),Ee=he?3:1,nt=s.useMemo(()=>Array.from({length:Ee},()=>t).flat(),[t,Ee]),[pt,Ve]=s.useState(!1),[vt,Rt]=s.useState(!1),[At,wt]=s.useState(!0),Vt=s.useRef(null),jt=s.useRef(null),Kt=s.useRef(!1),Yt=s.useRef(!1),kt=s.useRef(null),Bt=s.useRef(null),rn=fe&&!At,xt=s.useCallback(()=>{fe&&(wt(!0),Bt.current&&clearTimeout(Bt.current),Bt.current=setTimeout(()=>{it.current.isActive||wt(!1)},mx))},[fe]),yt=s.useCallback(()=>{o||Yt.current||(Yt.current=!0,Rt(!1),kt.current=setTimeout(()=>{l()},cr))},[o,l]),Me=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":rn?"true":"false",style:{width:F.scalingValue(m??0,i),height:F.scalingValue(m??0,i),marginRight:ae,"--close-icon-hover-color":x},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:yt,"aria-label":"Close",children:a.jsx(mn,{url:v,fill:g,hoverFill:i&&!r?g:x,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ae,height:"100%",pointerEvents:"auto"}})]}),Qe=(M="two-row")=>a.jsx("div",{...M==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:X(_??0),flexShrink:0,...M==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...M==="two-row"&&o?{pointerEvents:"auto"}:{}}}),rt=()=>{const M=h.find(ke=>ke.prefix==="title1"),re=h.filter(ke=>ke.prefix==="title2"||ke.prefix==="title3"),ue=re.length>0||o||(L??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(_??0)>0||o?Qe():null,M&&qe(M,"two-row-top"),v&&Me()]}),ue?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[re.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[re.map(ke=>qe(ke,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[Ge(),ve()]})]}):null,a.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:Ie,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},dt=()=>a.jsxs(a.Fragment,{children:[(_??0)>0||o?Qe("single-row"):null,h.map(M=>qe(M,"single-row")),o?a.jsxs(a.Fragment,{children:[tt(),et()]}):null,v?Me():null]}),Pt=s.useCallback(M=>!!(M.closest("[data-controls]")||M.closest(`.${e}-thumbnails`)||M.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:St,backdropStyle:ht,mediaAreaStyle:Wt,overlayContentStyle:Tt,swipeHandlers:Ot,dismissAreaStyle:Gt}=rp({enabled:pe??!1,onClose:yt,animMs:cr,isBlockedTarget:Pt}),Mt=()=>{if(!he||t.length===0)return Je.current=0,0;const M=Ue.current[0],re=Ue.current[t.length];if(!M||!re)return Je.current;const ue=re.offsetLeft-M.offsetLeft;return ue>0&&(Je.current=ue),Je.current},_t=(M=!1)=>{if(!he)return;const re=Be.current,ue=Mt();!re||ue<=0||ue<re.clientWidth*.25||(re.scrollLeft<=0?(re.scrollLeft+=ue,M&&(it.current.scrollLeft+=ue),ct.current&&(De.current+=ue)):re.scrollLeft>=ue*2&&(re.scrollLeft-=ue,M&&(it.current.scrollLeft-=ue),ct.current&&(De.current-=ue)))},Ft=(M,re=(ue=>(ue=Be.current)==null?void 0:ue.scrollLeft)()??0)=>{if(!he)return M;let ke=t.length+M,Ke=1/0;for(let lt=0;lt<Ee;lt++){const Et=lt*t.length+M,zt=Ue.current[Et];if(!zt)continue;const en=Math.abs(zt.offsetLeft-re);en<Ke&&(Ke=en,ke=Et)}return ke},ut=M=>{const re=Be.current;return!M||!re?!1:M.offsetWidth>re.clientWidth+1},H=M=>{const re=Be.current;if(!M||!re||!ut(M))return!1;const ue=M.offsetLeft,ke=ue+M.offsetWidth;return re.scrollLeft>=ue-1&&re.scrollLeft+re.clientWidth<=ke+1},Le=(M=(re=>(re=Be.current)==null?void 0:re.scrollLeft)()??0)=>{for(let ke=0;ke<Ue.current.length;ke+=1){const Ke=Ue.current[ke];if(Ke&&H(Ke))return ke}let ue={flatIndex:0,distance:1/0};return Ue.current.forEach((ke,Ke)=>{if(!ke)return;const lt=Math.abs(ke.offsetLeft-M);lt<ue.distance&&(ue={flatIndex:Ke,distance:lt})}),ue.flatIndex},je=M=>{Be.current&&Ue.current.forEach(re=>{re&&(re.style.scrollSnapAlign=ut(re)&&M==="backward"?"end":"start")})},Fe=(M,re,ue)=>{const ke=M-re,Ke=Le(re),lt=Ue.current[Ke];if(H(lt))return Le(M)%t.length;const Et=Ue.current[Ke+1],zt=lt?Et?Et.offsetLeft-lt.offsetLeft:lt.offsetWidth:0,en=zt>0?ke>zt*Br?1:ke<-zt*Br?-1:0:0;return en===0?ue:he?(ue+en+t.length)%t.length:Math.max(0,Math.min(t.length-1,ue+en))},ft=s.useCallback((M=!1)=>{if(k!=="on"||o)return;const re=$e.current,ue=N.current,ke=Ne.current[ue];if(!re||!ke||re.scrollWidth<=re.clientWidth)return;const Ke=re.scrollLeft,lt=Ke+re.clientWidth,Et=ke.offsetLeft,zt=Et+ke.offsetWidth;if(Et>=Ke&&zt<=lt)return;const en=re.scrollWidth-re.clientWidth;let tn=Ke;if(!M&&Vt.current===null){const ci=Ne.current[ue-1],to=Ne.current[ue+1],di=ci?ke.offsetLeft-ci.offsetLeft:to?to.offsetLeft-ke.offsetLeft:ke.offsetWidth;zt>lt?tn+=di:Et<Ke&&(tn-=di)}else zt>lt?tn=zt-re.clientWidth:tn=Et;re.scrollLeft=Math.max(0,Math.min(en,tn))},[o,k]),Ht=s.useCallback((M=!1)=>{M&&(Kt.current=!0),jt.current===null&&(jt.current=requestAnimationFrame(()=>{jt.current=null;const re=Kt.current;Kt.current=!1,ft(re)}))},[ft]),mt=s.useCallback(M=>{if(M===N.current)return;const re=N.current;N.current=M;const ue=Math.abs(M-re)>1,ke=he&&t.length>1&&(re===t.length-1&&M===0||re===0&&M===t.length-1);oe(M),Ht(ue||ke)},[t.length,he,Ht]),Lt=()=>{if(!Be.current||t.length===0||Vt.current!==null||it.current.isActive&&it.current.hasMoved)return;const M=Be.current.scrollLeft,re=Le(M)%t.length;re!==N.current&&mt(re)},Ut=()=>{Vt.current=null},Dt=M=>{const re=Be.current;re&&(re.style.scrollSnapType=M?"":"none")},an=()=>{var M;(M=Ae.current)==null||M.call(Ae),Ae.current=null},ln=()=>{Xe.current!==null&&(cancelAnimationFrame(Xe.current),Xe.current=null),ct.current=!1},qn=()=>{const M=Be.current;if(!M){Xe.current=null,ct.current=!1;return}const re=De.current-M.scrollLeft;if(Math.abs(re)<.5){M.scrollLeft=De.current,_t(),Lt(),Xe.current=null,ct.current=!1;return}M.scrollLeft+=re*fx,_t(),Lt(),xt(),Xe.current=requestAnimationFrame(qn)},Un=()=>{const M=Ze.current;M&&(M.style.transition="",M.style.transform="",M.style.willChange="")},Zi=(M,re,ue,ke)=>{Un(),M.scrollLeft=re,gt.current=M.scrollLeft,_t(),ue!==void 0?(N.current=ue,oe(ue)):Lt(),Dt(!0),ke==null||ke()},hn=(M,{behavior:re="smooth",activeIndex:ue,onComplete:ke}={})=>{const Ke=Be.current,lt=Ze.current;if(!Ke||!lt)return;if(ln(),an(),Dt(!1),re==="auto"){Zi(Ke,M,ue,ke);return}const Et=Math.abs(M-Ke.scrollLeft),zt=ax(Et,dx,ux,Ke.clientWidth*.55);Ae.current=cx(Ke,lt,M,{duration:zt,easing:px,onComplete:()=>{Ae.current=null,Zi(Ke,M,ue,ke)}})},Vo=(M="smooth")=>{const re=Be.current;if(!re||t.length===0)return;const ue=Le()%t.length,ke=Ft(ue,re.scrollLeft),Ke=Ue.current[ke];Ke&&hn(Ke.offsetLeft,{behavior:M,activeIndex:ue})},Go=(M,re="smooth",ue,ke)=>{const Ke=Be.current;if(!Ke||t.length===0)return;const lt=(ke??Ke.scrollLeft)-M,Et=Le(M),zt=Ue.current[Et];if(H(zt)){Dt(!0),Lt();return}const en=Ue.current[Et+1],tn=zt?en?en.offsetLeft-zt.offsetLeft:zt.offsetWidth:0;if((tn>0?lt>tn*Br?1:lt<-tn*Br?-1:0:0)!==0){const qo=ue??Et%t.length,za=Fe(ke??Ke.scrollLeft,M,qo);xn(za,re);return}const to=ke??Ke.scrollLeft,di=Le(to),Xo=Ue.current[di];if(Xo&&Math.abs(Xo.offsetLeft-to)<1){Dt(!0),Lt();return}Vo("auto")},xn=(M,re="smooth")=>{const ue=Be.current;if(!ue||t.length===0)return;const ke=Ft(M,ue.scrollLeft),Ke=Ue.current[ke];Ke&&(re==="smooth"?Vt.current=M:Vt.current=null,N.current=M,oe(M),Ht(!0),hn(Ke.offsetLeft,{behavior:re,activeIndex:M,onComplete:re==="smooth"?Ut:void 0}))},li=()=>{Oe.current&&(window.removeEventListener("pointerup",Oe.current),window.removeEventListener("pointercancel",Oe.current),Oe.current=null)},Ji=(M,re,ue,ke,Ke)=>{const lt=ue-M,Et=ke-re,zt=Math.abs(lt),en=Math.abs(Et);if(zt<vx||zt<=en)return!1;const tn=lt<0?1:-1,ci=he?(Ke+tn+t.length)%t.length:Math.max(0,Math.min(t.length-1,Ke+tn));return ci===Ke?!1:(xn(ci),!0)},bn=M=>{if(!it.current.isActive)return;li();const re=Be.current;if(!re)return;const{scrollLeft:ue,startActiveIndex:ke,hasMoved:Ke}=it.current,lt=re.scrollLeft;_t(!0),it.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},Ve(!1),M!==void 0&&re.hasPointerCapture(M)&&re.releasePointerCapture(M),Ke?Go(ue,"smooth",ke,lt):(Dt(!0),Lt()),xt()},Kn=(M,re)=>{const ue=st.current;st.current=null,ue&&(Ji(ue.startX,ue.startY,M,re,ue.startActiveIndex),xt())},Qi=M=>{if(!we)return;if(M.pointerType==="touch"){if(ln(),Dt(!0),Pt(M.target))return;st.current={startX:M.clientX,startY:M.clientY,startActiveIndex:N.current};return}if(M.pointerType!=="mouse"||M.button!==0||Pt(M.target))return;const re=Be.current;if(!re)return;ln(),an(),Un(),Vt.current=null,it.current={isActive:!0,startX:M.clientX,scrollLeft:re.scrollLeft,startActiveIndex:N.current,hasMoved:!1},Dt(!1),xt(),re.setPointerCapture(M.pointerId),li();const ue=ke=>{ke.pointerType==="mouse"&&bn(ke.pointerId)};Oe.current=ue,window.addEventListener("pointerup",ue),window.addEventListener("pointercancel",ue)},eo=M=>{if(!we||M.pointerType!=="mouse")return;const re=Be.current;if(!re||!it.current.isActive)return;if(M.buttons===0){bn(M.pointerId);return}const ue=M.clientX-it.current.startX;Math.abs(ue)>yx&&(it.current.hasMoved=!0,Ve(!0)),it.current.hasMoved&&(M.preventDefault(),re.scrollLeft=it.current.scrollLeft-ue,_t(!0),Lt(),xt())},Te=M=>{if(we){if(M.pointerType==="touch"){M.type==="pointerup"?Kn(M.clientX,M.clientY):st.current=null;return}M.pointerType==="mouse"&&bn(M.pointerId)}},Ye=M=>{!we||M.pointerType!=="mouse"||bn(M.pointerId)};return Wl(),s.useEffect(()=>{const M=requestAnimationFrame(()=>Rt(!0));return()=>{cancelAnimationFrame(M),an(),li(),jt.current!==null&&(cancelAnimationFrame(jt.current),jt.current=null),kt.current&&clearTimeout(kt.current),Bt.current&&clearTimeout(Bt.current)}},[]),s.useEffect(()=>{if(!fe){wt(!0);return}xt();const M=()=>xt();return document.addEventListener("pointermove",M,{passive:!0}),document.addEventListener("pointerdown",M,{passive:!0}),()=>{document.removeEventListener("pointermove",M),document.removeEventListener("pointerdown",M),Bt.current&&clearTimeout(Bt.current)}},[fe,xt]),s.useEffect(()=>{const M=re=>{re.key==="Escape"&&yt()};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[yt]),s.useLayoutEffect(()=>{Mt()},[A,t.length,he]),s.useLayoutEffect(()=>{o||xn(N.current,"auto")},[A,o]),s.useLayoutEffect(()=>{xn(0,"auto")},[t.length,he]),s.useEffect(()=>{const M=Be.current;if(!M||o||!pe)return;const re=ue=>{if(ue.preventDefault(),Math.abs(ue.deltaY)<=Math.abs(ue.deltaX))return;const ke=ue.deltaMode===1?hx:ue.deltaMode===2?M.clientHeight:1,Ke=ue.deltaY*ke*gx;if(Ke!==0){if(an(),ct.current||(ct.current=!0,De.current=M.scrollLeft,Vt.current=null,Dt(!1)),De.current+=Ke,!he){const lt=M.scrollWidth-M.clientWidth;De.current=Math.max(0,Math.min(lt,De.current))}xt(),Xe.current===null&&(Xe.current=requestAnimationFrame(qn))}};return M.addEventListener("wheel",re,{passive:!1}),()=>{M.removeEventListener("wheel",re),ln()}},[o,pe,he]),s.useEffect(()=>{const M=Be.current;if(!M)return;const re=()=>{_t(it.current.isActive);const ke=M.scrollLeft,Ke=ke-gt.current;gt.current=ke;const lt=Je.current>0?Je.current*.5:1/0;if(Ke!==0&&Math.abs(Ke)<lt){const Et=Ke>0?"forward":"backward";Et!==ze.current&&(ze.current=Et,je(Et))}it.current.isActive&&it.current.hasMoved||Lt()};M.addEventListener("scroll",re,{passive:!0});const ue=new ResizeObserver(()=>{Mt(),_t(it.current.isActive),je(ze.current),Lt()});return ue.observe(M),()=>{an(),M.removeEventListener("scroll",re),ue.disconnect()}},[t.length,he]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{St||yt()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:vt?1:0,transition:`opacity ${cr}ms ease`,pointerEvents:vt?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:c,...ht}}),a.jsxs("div",{ref:_e,className:`${e}-lightbox-dismiss-area`,style:Gt,...Ot,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Wt,onClick:M=>M.stopPropagation(),children:a.jsx("div",{ref:Be,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":we&&t.length>0?"true":"false","data-mouse-dragging":pt?"true":"false",onPointerDown:Qi,onPointerMove:eo,onPointerUp:Te,onPointerCancel:Te,onLostPointerCapture:Ye,children:a.jsx("div",{ref:Ze,className:`${e}-lightbox-strip-track`,style:{gap:A},children:nt.map((M,re)=>{const ue=M.image.objectFit??"contain",ke=re%t.length,Ke=Math.floor(re/t.length),lt=jr(A),Et=`calc(-0.5 * (${lt} + ${A}))`;return a.jsxs("div",{ref:zt=>Ue.current[re]=zt,className:`${e}-strip-item`,style:{height:D==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:M.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:ue}}),o&&ke<t.length-1&&Ke===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Et,width:lt,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ke}-${M.image.url}-${ke}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":rn?"true":"false",style:Tt,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:j,flexShrink:0,pointerEvents:"none"},children:o&&a.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:ie,pointerEvents:"auto",zIndex:3}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:a.jsx("div",{className:`${e}-lightbox-content-area${se?` ${e}-lightbox-content-area-stacked`:""}`,children:(Ce||v)&&a.jsx("div",{className:`${e}-header ${se?`${e}-header-two-row`:`${e}-header-single-row`}`,children:se?rt():Ce||v?dt():null})})})]}),t.length>1&&k==="on"&&(()=>{const M=jr(I),re=`calc(-0.5 * (${I} + ${M}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:I},children:a.jsx("div",{ref:$e,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:ue=>ue.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":S,style:{gap:q,"--thumbnail-active-color":W},children:[t.map((ue,ke)=>{const Ke=jr(q),lt=`calc(-0.5 * (${Ke} + ${q}))`;return a.jsxs("div",{ref:Et=>{Ne.current[ke]=Et},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":O===ke?"true":"false",onClick:()=>pe&&b==="click"&&xn(ke),onMouseEnter:()=>Re&&b==="hover"&&xn(ke),"aria-label":ue.image.name?`View ${ue.image.name}`:`View image ${ke+1}`,"aria-current":O===ke?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${ge?` ${e}-thumb-image-cover`:""}`,src:ue.image.url,alt:"",draggable:!1,style:{...xe,maxWidth:w,maxHeight:w,width:f.display==="cover"?"auto":"100%",height:"auto",objectFit:f.display==="cover"?"cover":"contain"}})}),o&&ke<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:lt,width:Ke,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${ue.image.url}-${ke}`)}),o&&a.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:re,height:M,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function kx(e){return`
|
|
14325
14353
|
.${e}-wrapper {
|
|
14326
14354
|
position: relative;
|
|
14327
14355
|
width: 100%;
|
|
@@ -14706,7 +14734,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
14706
14734
|
pointer-events: auto;
|
|
14707
14735
|
z-index: 10;
|
|
14708
14736
|
}
|
|
14709
|
-
`}const Ex=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r})=>{const{prefix:l}=F.useScopedStyles(),{cover:c,coverFit:d}=e,u=s.useRef(null),[p,y]=s.useState(!1),v=t??[],m=p&&v.length>0,g=()=>{v.length!==0&&y(!0)};return s.useEffect(()=>{!n||i||o||y(!1)},[n,i,o]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:u,className:`${l}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:kx(l)}}),c&&a.jsx("div",{className:`${l}-cover ${ri(d)?`${l}-ratio-wrapper-cover`:`${l}-ratio-wrapper-fit`}`,onClick:()=>g(),style:{...ri(d)?{"--image-aspect-ratio":
|
|
14737
|
+
`}const Ex=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r})=>{const{prefix:l}=F.useScopedStyles(),{cover:c,coverFit:d}=e,u=s.useRef(null),[p,y]=s.useState(!1),v=t??[],m=p&&v.length>0,g=()=>{v.length!==0&&y(!0)};return s.useEffect(()=>{!n||i||o||y(!1)},[n,i,o]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:u,className:`${l}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:kx(l)}}),c&&a.jsx("div",{className:`${l}-cover ${ri(d)?`${l}-ratio-wrapper-cover`:`${l}-ratio-wrapper-fit`}`,onClick:()=>g(),style:{...ri(d)?{"--image-aspect-ratio":Oa(d)}:{}},"aria-label":"Open image gallery",children:a.jsx("img",{className:`${l}-cover-image ${ri(d)?`${l}-cover-image-cover`:`${l}-cover-image-fit`}`,src:c,alt:"cover"})})]}),m&&typeof document<"u"&&(()=>{const x=(r?document.getElementById(r):null)??document.body;return Gn.createPortal(a.jsx(Rx,{prefix:l,images:v,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:()=>y(!1)}),x)})()]})},Mx=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
|
|
14710
14738
|
import { createPortal } from 'react-dom';
|
|
14711
14739
|
import { CommonComponentProps } from '../props';
|
|
14712
14740
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -15252,7 +15280,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
15252
15280
|
</>
|
|
15253
15281
|
);
|
|
15254
15282
|
};
|
|
15255
|
-
`,Ax="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>'),Hi={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 Fx(e){const t={};return t[Zt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Zt(e,"fontSettings")]={...Hi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Zt(e,"fontSize")]={...Hi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Zt(e,"lineHeight")]={...Hi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Zt(e,"letterSpacing")]={...Hi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Zt(e,"wordSpacing")]={...Hi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Zt(e,"textAlign")]={...Hi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Zt(e,"textAppearance")]={...Hi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Nx=Ao.reduce((e,t)=>({...e,...Fx(t)}),{}),_x=Ao.reduce((e,t)=>({...e,[Zt(t,"fontFamily")]:"Goudy Bookletter 1911",[Zt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Zt(t,"letterSpacing")]:0,[Zt(t,"wordSpacing")]:0,[Zt(t,"textAlign")]:"left",[Zt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function us(e){return Ao.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Zt(n,"fontSize")]=i),o!==void 0&&(t[Zt(n,"lineHeight")]=o),t},{})}const Hx=Lx(),Wx={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"}},...Nx,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:Ax,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",..._x},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,...us({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,...us({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,...us({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:[Hx]}],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"}]}},Ox={element:Ex,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:Wx,sourceCode:Mx,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Ao.map(e=>({path:`${Zt(e,"fontFamily")}`}))]},fontRelations:{...Ao.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Zt(t,"fontFamily")}`}),{})}},Dx=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,initialSlideIndex:l=0,enableUrlSync:c=!1,journalItemId:d=null,onBeforeClose:u,onClose:p})=>{const{type:y,coverFit:v,backgroundColor:m,imageGap:g,maxWidth:x,maxHeight:b,textTransition:k,title1Width:f,title2Width:S,title3Width:O,title1MarginLeft:U=0,title2MarginLeft:z=0,title3MarginLeft:I=0,titleRowMarginBottom:N=0,titleHeaderLayout:q="single-row",countCloseGap:$=0,closeIcon:L,closeIconMaxWidth:D,closeIconColor:_,closeIconHoverColor:C,contentMarginTop:T=0,iconMarginRight:B=0}=n,w=s.useCallback(Te=>F.scalingValue(Te,i??!1),[i]),X=w(g??0),R=`${x}%`,E=`${b}%`,V=w($),ie=w(T),re=w(B),W=Bi("title1",zi(n,"title1"),i),ae=Bi("title2",zi(n,"title2"),i),A=Bi("title3",zi(n,"title3"),i),le=Bi("count",zi(n,"count"),i),ee=q==="mobile",xe=!i||!!r,Pe=!o&&(!i||!!r),ye=s.useMemo(()=>sa(t,y),[t,y]),[pe,Y]=s.useState(l),se=ye[pe],de=se==null?void 0:se.entry,[ve,$e]=s.useState(!1),[ke,he]=s.useState(null),[Se,Ce]=s.useState(!1),[h,K]=s.useState(null),[Z,te]=s.useState(!1),[me,j]=s.useState(0),[P,Q]=s.useState(),[ne,ue]=s.useState(),[G,Ie]=s.useState(null),be=s.useRef(null),J=s.useRef(0),He=s.useRef(0),We=s.useRef(0),ot=s.useRef(!1),qe=s.useRef(null),tt=s.useRef(null),et=s.useRef(null),je=s.useRef(null),fe=s.useRef(null),_e=s.useRef(null),Be=s.useRef(null),Ze=s.useCallback(()=>{const Te=tt.current;if(!Te)return;const Ye=Te.closest(`.${e}-lightbox-content-area`);if(!Ye)return Te.getBoundingClientRect().width;const M=Array.from(Ye.children).reduce((oe,ce)=>!(ce instanceof HTMLElement)||ce.contains(Te)?oe:oe+ce.getBoundingClientRect().width,0);return Ye.getBoundingClientRect().width-M},[e]),we=s.useCallback(()=>{be.current&&(clearTimeout(be.current),be.current=null)},[]),Ne=s.useCallback(Te=>{Te===J.current&&(K(null),te(!1))},[]),Ue=s.useCallback(()=>{o||ot.current||(ot.current=!0,u==null||u(),$e(!1),qe.current=setTimeout(()=>{p()},300))},[o,u,p]),Je=s.useCallback(Te=>!!(Te.closest("[data-controls]")||Te.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:st,backdropStyle:it,mediaAreaStyle:Oe,overlayContentStyle:Ae,swipeHandlers:gt,dismissAreaStyle:ze}=rp({enabled:Pe,onClose:Ue,animMs:300,isBlockedTarget:Je}),De=s.useCallback(Te=>{c&&zu(Te+1,d,!0)},[c,d]),Xe=s.useCallback(Te=>{if(Te)return Te.getBoundingClientRect().height},[]),ct=s.useCallback(Te=>{if(ye.length===0)return;const Ye=(Te%ye.length+ye.length)%ye.length;if(Ye===pe)return;const M=ye[pe],oe=ye[Ye];J.current+=1;const ce=J.current,Re=k==="fade"&&Lc(M==null?void 0:M.entry)!==Lc(oe==null?void 0:oe.entry),Ke=Xe(et.current),lt=Re?(()=>{const zt=Ze();Gn.flushSync(()=>{Ie(oe.entry)}),et.current&&zt&&(et.current.style.width=`${zt}px`);const en=Xe(et.current);return et.current&&(et.current.style.width=""),{measuredIncomingTitlesHeight:en,incomingTitlesMeasureWidth:zt}})():void 0,Et=Math.max(Ke??0,(lt==null?void 0:lt.measuredIncomingTitlesHeight)??0)||void 0;j(ce),K(pe),te(!0),Y(Ye),De(Ye),We.current=Ye,Re?(we(),Et&&Q(Et),lt!=null&<.incomingTitlesMeasureWidth&&ue(lt.incomingTitlesMeasureWidth),he((M==null?void 0:M.entryIndex)??null),Ce(!0),He.current=oe.entryIndex,be.current=setTimeout(()=>{he(null),Ce(!1),Q(void 0),ue(void 0),Ie(null),be.current=null},400)):(we(),he(null),Ce(!1),Q(void 0),ue(void 0),Ie(null),He.current=oe.entryIndex)},[pe,we,Ze,Xe,ye,De,k]),ge=s.useCallback(()=>{Be.current=null},[]),Ee=s.useCallback(Te=>{!xe||ye.length<=1||Te.pointerType==="mouse"&&Te.button!==0||Te.target.closest("[data-controls]")||(Be.current={startX:Te.clientX,startY:Te.clientY,pointerId:Te.pointerId})},[xe,ye.length]),nt=s.useCallback(Te=>{var zt;if(!xe||ye.length<=1||Te.pointerType==="mouse"&&Te.button!==0)return;if(st){ge();return}const Ye=Be.current;if(!Ye||Ye.pointerId!==Te.pointerId||(ge(),Te.target.closest("[data-controls]")))return;const oe=Te.clientX-Ye.startX,ce=Te.clientY-Ye.startY,Re=Math.abs(oe),Ke=Math.abs(ce);if(Re>=Jy&&Re>Ke){ct(oe>0?pe-1:pe+1);return}if(Re>wc||Ke>wc)return;const lt=(zt=je.current)==null?void 0:zt.getBoundingClientRect(),Et=lt?lt.left+lt.width/2:window.innerWidth/2;ct(Te.clientX<Et?pe-1:pe+1)},[pe,xe,ct,st,ge,ye.length]),pt=s.useCallback(Te=>{const Ye=Be.current;(Ye==null?void 0:Ye.pointerId)===Te.pointerId&&ge()},[ge]);Wl(),s.useEffect(()=>{_e.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const Te=requestAnimationFrame(()=>{$e(!0),requestAnimationFrame(()=>{fe.current?fe.current.focus():je.current&&je.current.focus()})});return()=>{cancelAnimationFrame(Te),qe.current&&clearTimeout(qe.current),be.current&&clearTimeout(be.current);const Ye=_e.current;Ye&&document.contains(Ye)&&Ye.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var Te;k!=="fade"&&(He.current=((Te=ye[pe])==null?void 0:Te.entryIndex)??0,we(),he(null),Ce(!1),Q(void 0),ue(void 0))},[pe,we,ye,k]),s.useEffect(()=>{const Te=Ye=>{if(Ye.key==="Escape"){Ue();return}if(Ye.key==="ArrowLeft"&&ye.length>1){ct(pe-1);return}if(Ye.key==="ArrowRight"&&ye.length>1){ct(pe+1);return}if(Ye.key==="Tab"&&je.current){const M=je.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),oe=Array.from(M).filter(lt=>!lt.closest('[aria-hidden="true"]'));if(oe.length===0)return;const ce=oe[0],Re=oe[oe.length-1],Ke=document.activeElement;Ye.shiftKey?(Ke===ce||!je.current.contains(Ke))&&(Ye.preventDefault(),Re.focus()):(Ke===Re||!je.current.contains(Ke))&&(Ye.preventDefault(),ce.focus())}};return window.addEventListener("keydown",Te),()=>window.removeEventListener("keydown",Te)},[ct,Ue,pe,ye.length]),s.useLayoutEffect(()=>{we(),J.current=0,j(0),K(null),te(!1),he(null),Ce(!1),Q(void 0),ue(void 0),Ie(null),Y(Te=>{const Ye=Math.max(0,ye.length-1);return Math.min(Te,Ye)})},[we,t.length,y,ye.length]),s.useLayoutEffect(()=>{var M;const Te=Math.max(0,ye.length-1),Ye=Math.min(Math.max(0,l),Te);We.current=Ye,He.current=((M=ye[Ye])==null?void 0:M.entryIndex)??0,Y(Ye)},[l]);const Ge=ke!==null?t[ke]:null,vt=h!==null?ye[h]:null,Rt=(de==null?void 0:de.title1)||(de==null?void 0:de.title2)||(de==null?void 0:de.title3)||(Ge==null?void 0:Ge.title1)||(Ge==null?void 0:Ge.title2)||(Ge==null?void 0:Ge.title3),At=av(y,ye,t),wt=L!==null,Vt=Rt||At||wt,jt=At&&wt?{gap:V}:void 0,Kt=`${e}-titles-stack${ee?` ${e}-titles-stack-stacked`:""}`,Yt=`${e}-titles-layer-out${ee?` ${e}-titles-layer-out-stacked`:""}`,kt=`${e}-titles-layer-out`,Bt=(U??0)>0||o,rn=w(N),xt=s.useMemo(()=>({title1Width:f??bo.title1Width,title2Width:S??bo.title2Width,title3Width:O??bo.title3Width}),[f,S,O]),yt=s.useMemo(()=>({title2MarginLeft:z,title3MarginLeft:I}),[z,I]),Me=s.useMemo(()=>de?Si(e,de,W,ae,A):[],[e,de,W,ae,A]),Qe=s.useMemo(()=>Me.map(Te=>xt[Te.widthKey]),[Me,xt]),rt=s.useMemo(()=>Po(Me.length,Qe),[Me.length,Qe]),dt=s.useMemo(()=>yr(Me.length,Qe),[Me.length,Qe]),Pt=s.useMemo(()=>Me.filter(Te=>Te.prefix==="title1"),[Me]),St=s.useMemo(()=>Me.filter(Te=>Te.prefix==="title2"||Te.prefix==="title3"),[Me]),ht=s.useMemo(()=>wi(Pt,xt),[Pt,xt]),Wt=s.useMemo(()=>wi(St,xt),[St,xt]),Tt=s.useCallback((Te,Ye)=>{const M=Me.findIndex(ce=>ce.prefix===Te.prefix);if(!ee||Ye==="single-row")return{effectiveWidth:dt[M]??0,resolvedWidth:rt[M]??0,maxWidth:yn(M,rt)};if(Ye==="two-row-top"){const ce=Pt.findIndex(Re=>Re.prefix===Te.prefix);return{effectiveWidth:ht.effective[ce]??0,resolvedWidth:ht.resolved[ce]??0,maxWidth:yn(ce,ht.resolved)}}const oe=St.findIndex(ce=>ce.prefix===Te.prefix);return{effectiveWidth:Wt.effective[oe]??0,resolvedWidth:Wt.resolved[oe]??0,maxWidth:yn(oe,Wt.resolved)}},[Me,St,Wt,dt,rt,Pt,ht,ee]),Ot=s.useCallback(Te=>Gu(Me,rt,yt,Te)+(ee?0:U??0),[Me,rt,yt,ee,U]),Gt=s.useCallback(()=>ee?0:U??0,[ee,U]),Mt=s.useCallback(Te=>St.slice(0,Te).reduce((Ye,M,oe)=>Ye+(M.marginLeftKey?yt[M.marginLeftKey]??0:0)+(Wt.resolved[oe]??0),0),[St,Wt.resolved,yt]),_t=s.useCallback(Te=>{const Ye=St[Te];return Mt(Te)+(Ye.marginLeftKey?yt[Ye.marginLeftKey]??0:0)+(Wt.resolved[Te]??0)},[St,Wt.resolved,Mt,yt]),Ft=s.useCallback((Te,Ye,M)=>{if(!ee||M==="single-row"){const lt=Te.findIndex(tn=>tn.prefix===Ye.prefix),Et=Te.map(tn=>xt[tn.widthKey]),zt=Po(Te.length,Et);return{effectiveWidth:yr(Te.length,Et)[lt]??0,resolvedWidth:zt[lt]??0,maxWidth:yn(lt,zt)}}if(M==="two-row-top"){const lt=Te.filter(tn=>tn.prefix==="title1"),Et=lt.findIndex(tn=>tn.prefix===Ye.prefix),{resolved:zt,effective:en}=wi(lt,xt);return{effectiveWidth:en[Et]??0,resolvedWidth:zt[Et]??0,maxWidth:yn(Et,zt)}}const oe=Te.filter(lt=>lt.prefix==="title2"||lt.prefix==="title3"),ce=oe.findIndex(lt=>lt.prefix===Ye.prefix),{resolved:Re,effective:Ke}=wi(oe,xt);return{effectiveWidth:Ke[ce]??0,resolvedWidth:Re[ce]??0,maxWidth:yn(ce,Re)}},[xt,ee]),ut=(Te,Ye,M)=>{const oe=Te.marginLeftKey?yt[Te.marginLeftKey]??0:0,{effectiveWidth:ce,resolvedWidth:Re,maxWidth:Ke}=M??Tt(Te,Ye),lt=Math.max(oe,ei),Et=o&&Ye==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":Te.prefix,style:{width:w(ce),...oe>0?{marginLeft:w(oe)}:{}},children:[a.jsx("p",{className:Te.className,style:Te.style,children:Te.text}),Et&&Te.marginLeftKey?a.jsx("div",{"data-controls":Te.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Re),style:{position:"absolute",top:0,left:w(-oe),width:w(lt),height:"100%",pointerEvents:"auto"}}):null,Et?a.jsx("div",{"data-controls":Te.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ke),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:w(-Ln/2),width:w(Ln),height:"100%",pointerEvents:"auto"}}):null]},Te.className)},H=(Te="two-row")=>{const Ye=Me.findIndex(ce=>ce.prefix==="title1"),M=Ye>=0?rt[Ye]:xt.title1Width,oe=Te==="two-row"&&o;return a.jsx("div",{...oe?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(M)}:{},style:{width:w(U??0),flexShrink:0,alignSelf:"stretch",...oe?{pointerEvents:"auto"}:{}}})},Le=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:W,"aria-hidden":"true",children:" "}),Ve=()=>a.jsx("span",{className:`${e}-entry-counter`,style:le,"aria-live":"polite","aria-atomic":"true",children:rv(ye,pe,y,t)}),Fe=()=>At?o&&wt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Ve(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${ts(V)} + ${V}))`,width:ts(V),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Ve():null,ft=()=>!At&&!wt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:jt,children:[Fe(),wt?Lt():null]}),Ht=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||Rt?Le():null,Bt?H("single-row"):null,Dt(de),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),ft(),xn()]}),mt=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||Rt?Le():null,Bt?H("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:Se&&P?{minHeight:P}:void 0,children:[a.jsx("div",{ref:et,className:Kt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Un(G||de)}),a.jsxs("div",{ref:tt,className:Kt,style:{position:Se?"absolute":"relative",inset:Se?0:void 0,width:"100%",...Se&&ne?{width:ne,maxWidth:"100%"}:void 0},children:[Ge&&Se?a.jsx("div",{className:`${Yt} ${e}-titles-fade-out`,children:Un(Ge)}):null,a.jsx("div",{className:`${e}-titles-layer-in${Se?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:Un(de)})]})]}),ft(),xn()]}),Lt=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:F.scalingValue(D??0,i),height:F.scalingValue(D??0,i),marginRight:re,"--close-icon-hover-color":C},children:[a.jsx("button",{ref:fe,type:"button",className:`${e}-close-icon-inner`,onClick:Ue,"aria-label":"Close",children:a.jsx(mn,{url:L??"",fill:_,hoverFill:i&&!r?_:C,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:re,height:"100%",pointerEvents:"auto"}})]}),Ut=(Te,Ye)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[At||Rt?Le():null,Bt?H("two-row"):null,Ye!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Ye},children:Te}):a.jsxs(a.Fragment,{children:[Te,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),ft()]}),Dt=Te=>{if(!Te)return null;const Ye=Si(e,Te,W,ae,A);return a.jsx(a.Fragment,{children:Ye.map(M=>ut(M,"single-row",Ft(Ye,M,"single-row")))})},an=Te=>{if(!Te)return null;const Ye=Si(e,Te,W,ae,A),M=Ye.find(oe=>oe.prefix==="title1");return M?ut(M,"two-row-top",Ft(Ye,M,"two-row-top")):null},ln=(Te,Ye=!1)=>{const M=Te?Si(e,Te,W,ae,A):[],oe=M.filter(Ke=>Ke.prefix==="title2"||Ke.prefix==="title3"),ce=o&&Ye;return oe.length>0||ce||(N??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[oe.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[oe.map(Ke=>ut(Ke,"two-row-bottom",Ft(M,Ke,"two-row-bottom"))),Ye&&o?a.jsxs(a.Fragment,{children:[Vo(),Go()]}):null]}):null,(N??0)>0||ce?a.jsx("div",{"data-controls":ce?"titleRowMarginBottom":void 0,"data-controls-axis":ce?"y":void 0,"data-controls-reverse":ce?"":void 0,className:ce?`${e}-control`:void 0,style:{height:rn,width:"100%",flexShrink:0,pointerEvents:ce?"auto":"none"}}):null]}):null},qn=(Te,Ye=!1)=>a.jsxs(a.Fragment,{children:[Ut(an(Te)),ln(Te,Ye)]}),Un=Te=>ee?a.jsx("div",{className:`${e}-titles-row-two-row`,children:qn(Te)}):Te?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Dt(Te)}):null,Zi=()=>{const Te=ee?-1:Me.findIndex(oe=>oe.prefix==="title1"),Ye=!ee&&(o||(U??0)>0)?(()=>{const oe=U??0,ce=Te>=0?rt[Te]:xt.title1Width,Re=Math.max(oe,ei);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ce),style:{position:"absolute",top:0,left:0,width:w(Re),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,M=Me.flatMap((oe,ce)=>{if(!oe.marginLeftKey)return[];const Re=yt[oe.marginLeftKey]??0,Ke=Vu(Me,rt,yt,ce)+Gt(),lt=Math.max(Re,ei);return a.jsx("div",{"data-controls":oe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(rt[ce]),style:{position:"absolute",top:0,left:w(Ke),width:w(lt),height:"100%",pointerEvents:"auto"}},oe.marginLeftKey)});return Ye?[Ye,...M]:M},hn=()=>Me.map((Te,Ye)=>{const M=yn(Ye,rt),ce=Ot(Ye)-Ln/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Te.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(M),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:w(ce),width:w(Ln),height:"100%",pointerEvents:"auto"}})},`${Te.widthKey}-junction`)}),Vo=()=>St.flatMap((Te,Ye)=>{if(!Te.marginLeftKey)return[];const M=yt[Te.marginLeftKey]??0,oe=Mt(Ye),ce=Math.max(M,ei),{resolvedWidth:Re}=Tt(Te,"two-row-bottom");return a.jsx("div",{"data-controls":Te.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Re),style:{position:"absolute",top:0,left:w(oe),width:w(ce),height:"100%",pointerEvents:"auto"}},Te.marginLeftKey)}),Go=()=>St.map((Te,Ye)=>{const{maxWidth:M}=Tt(Te,"two-row-bottom"),ce=_t(Ye)-Ln/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Te.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(M),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:w(ce),width:w(Ln),height:"100%",pointerEvents:"auto"}})},`${Te.widthKey}-junction`)}),xn=()=>!o||ee?null:a.jsxs(a.Fragment,{children:[Zi(),hn()]}),li=Te=>{const Ye=!Te.objectFit&&ri(v);return{className:`${e}-slide-image-cell${Ye?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:R,maxHeight:E,...Ye?{"--image-aspect-ratio":Wa(v)}:{}}}},Ji=Te=>Te.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":Te.objectFit}}:ri(v)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},bn=Te=>{if(Te.length===0)return null;const Ye=Te.length>1,M=ts(X),oe=`calc(-0.5 * (${M} + ${X}))`;if(Te.length===1){const ce=Te[0];return a.jsx("div",{...li(ce),children:a.jsx("img",{...Ji(ce),src:ce.url,alt:ce.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:Ye?{gap:X}:void 0,children:Te.map((ce,Re)=>a.jsxs("div",{...li(ce),children:[a.jsx("img",{...Ji(ce),src:ce.url,alt:ce.name??"",draggable:!1}),o&&Ye&&Re<Te.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:oe,width:M,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${ce.url}-${Re}`))})},Kn=!!(de!=null&&de.title2||de!=null&&de.title3||Ge!=null&&Ge.title2||Ge!=null&&Ge.title3||(N??0)>0||o),Qi=()=>a.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[a.jsx("div",{ref:et,className:Kt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:qn(G||de)}),a.jsxs("div",{ref:tt,className:`${e}-titles-row-two-row`,style:{...Se&&P?{minHeight:P}:void 0,...Se&&ne?{width:ne,maxWidth:"100%"}:void 0},children:[Ut(a.jsxs("div",{className:Kt,style:{position:Se?"absolute":"relative",inset:Se?0:void 0,width:"100%"},children:[Ge&&Se?a.jsx("div",{className:`${kt} ${e}-titles-fade-out`,children:an(Ge)}):null,a.jsx("div",{className:`${e}-titles-layer-in${Se?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:an(de)})]}),Se&&P?P:void 0),Kn?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[Ge&&Se?a.jsx("div",{className:`${Yt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:ln(Ge)}):null,a.jsx("div",{className:`${e}-titles-layer-in${Se?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${ee?` ${e}-titles-layer-in-stacked`:""}`,children:ln(de,!0)})]}):null]})]}),eo=()=>{const Te=Kn;return a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...Te?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:Te?void 0:{flex:"0 0 auto",height:"auto"},children:qn(de,!0)}),xn()]})};return a.jsxs("div",{ref:je,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{st||Ue()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:wt?void 0:-1,style:{opacity:ve?1:0,transition:"opacity 300ms ease",pointerEvents:ve?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:m,...it}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:ze,...gt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Oe,onClick:Te=>Te.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":xe&&ye.length>1?"true":"false",onPointerDown:xe?Ee:void 0,onPointerUp:xe?nt:void 0,onPointerCancel:xe?pt:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[vt&&Z?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:Te=>{Te.target===Te.currentTarget&&Ne(me)},children:a.jsx("div",{className:`${e}-slide-area`,children:bn(vt.images)})},`slide-out-${me}`):null,a.jsx("div",{className:`${e}-slide-layer-in${Z?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:se?bn(se.images):null})},`slide-in-${me}-${pe}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Ae,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:ie,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...ee?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${ee?` ${e}-lightbox-content-area-stacked`:""}`,children:Vt&&a.jsx("div",{className:`${e}-text-bar-cell${ee?` ${e}-text-bar-cell-stacked`:""}`,style:ee?void 0:{flex:1,minWidth:0,width:"100%"},children:ee?k==="fade"?Qi():eo():k==="fade"?mt():Ht()})})})]})]})]})};function zx(e){return`
|
|
15283
|
+
`,Ax="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>'),Hi={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 Fx(e){const t={};return t[Zt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Zt(e,"fontSettings")]={...Hi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Zt(e,"fontSize")]={...Hi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Zt(e,"lineHeight")]={...Hi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Zt(e,"letterSpacing")]={...Hi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Zt(e,"wordSpacing")]={...Hi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Zt(e,"textAlign")]={...Hi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Zt(e,"textAppearance")]={...Hi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Nx=Ao.reduce((e,t)=>({...e,...Fx(t)}),{}),_x=Ao.reduce((e,t)=>({...e,[Zt(t,"fontFamily")]:"Goudy Bookletter 1911",[Zt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Zt(t,"letterSpacing")]:0,[Zt(t,"wordSpacing")]:0,[Zt(t,"textAlign")]:"left",[Zt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ps(e){return Ao.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Zt(n,"fontSize")]=i),o!==void 0&&(t[Zt(n,"lineHeight")]=o),t},{})}const Hx=Lx(),Wx={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"}},...Nx,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:Ax,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",..._x},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,...ps({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,...ps({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,...ps({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:[Hx]}],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"}]}},Ox={element:Ex,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:Wx,sourceCode:Mx,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Ao.map(e=>({path:`${Zt(e,"fontFamily")}`}))]},fontRelations:{...Ao.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Zt(t,"fontFamily")}`}),{})}},Dx=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,initialSlideIndex:l=0,enableUrlSync:c=!1,journalItemId:d=null,onBeforeClose:u,onClose:p})=>{const{type:y,coverFit:v,backgroundColor:m,imageGap:g,maxWidth:x,maxHeight:b,textTransition:k,title1Width:f,title2Width:S,title3Width:W,title1MarginLeft:U=0,title2MarginLeft:B=0,title3MarginLeft:P=0,titleRowMarginBottom:_=0,titleHeaderLayout:G="single-row",countCloseGap:$=0,closeIcon:L,closeIconMaxWidth:D,closeIconColor:E,closeIconHoverColor:T,contentMarginTop:C=0,iconMarginRight:V=0}=n,w=s.useCallback(Te=>F.scalingValue(Te,i??!1),[i]),q=w(g??0),I=`${x}%`,A=`${b}%`,j=w($),ie=w(C),ae=w(V),O=Bi("title1",zi(n,"title1"),i),oe=Bi("title2",zi(n,"title2"),i),N=Bi("title3",zi(n,"title3"),i),le=Bi("count",zi(n,"count"),i),Q=G==="mobile",be=!i||!!r,Pe=!o&&(!i||!!r),ye=s.useMemo(()=>la(t,y),[t,y]),[ce,Y]=s.useState(l),se=ye[ce],pe=se==null?void 0:se.entry,[fe,we]=s.useState(!1),[Re,ge]=s.useState(null),[xe,Ce]=s.useState(!1),[h,K]=s.useState(null),[Z,ne]=s.useState(!1),[de,z]=s.useState(0),[R,ee]=s.useState(),[te,me]=s.useState(),[X,Ie]=s.useState(null),Se=s.useRef(null),J=s.useRef(0),He=s.useRef(0),We=s.useRef(0),ot=s.useRef(!1),qe=s.useRef(null),tt=s.useRef(null),et=s.useRef(null),Ge=s.useRef(null),ve=s.useRef(null),_e=s.useRef(null),Be=s.useRef(null),Ze=s.useCallback(()=>{const Te=tt.current;if(!Te)return;const Ye=Te.closest(`.${e}-lightbox-content-area`);if(!Ye)return Te.getBoundingClientRect().width;const M=Array.from(Ye.children).reduce((re,ue)=>!(ue instanceof HTMLElement)||ue.contains(Te)?re:re+ue.getBoundingClientRect().width,0);return Ye.getBoundingClientRect().width-M},[e]),$e=s.useCallback(()=>{Se.current&&(clearTimeout(Se.current),Se.current=null)},[]),Ne=s.useCallback(Te=>{Te===J.current&&(K(null),ne(!1))},[]),Ue=s.useCallback(()=>{o||ot.current||(ot.current=!0,u==null||u(),we(!1),qe.current=setTimeout(()=>{p()},300))},[o,u,p]),Je=s.useCallback(Te=>!!(Te.closest("[data-controls]")||Te.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:st,backdropStyle:it,mediaAreaStyle:Oe,overlayContentStyle:Ae,swipeHandlers:gt,dismissAreaStyle:ze}=rp({enabled:Pe,onClose:Ue,animMs:300,isBlockedTarget:Je}),De=s.useCallback(Te=>{c&&zu(Te+1,d,!0)},[c,d]),Xe=s.useCallback(Te=>{if(Te)return Te.getBoundingClientRect().height},[]),ct=s.useCallback(Te=>{if(ye.length===0)return;const Ye=(Te%ye.length+ye.length)%ye.length;if(Ye===ce)return;const M=ye[ce],re=ye[Ye];J.current+=1;const ue=J.current,ke=k==="fade"&&Lc(M==null?void 0:M.entry)!==Lc(re==null?void 0:re.entry),Ke=Xe(et.current),lt=ke?(()=>{const zt=Ze();Gn.flushSync(()=>{Ie(re.entry)}),et.current&&zt&&(et.current.style.width=`${zt}px`);const en=Xe(et.current);return et.current&&(et.current.style.width=""),{measuredIncomingTitlesHeight:en,incomingTitlesMeasureWidth:zt}})():void 0,Et=Math.max(Ke??0,(lt==null?void 0:lt.measuredIncomingTitlesHeight)??0)||void 0;z(ue),K(ce),ne(!0),Y(Ye),De(Ye),We.current=Ye,ke?($e(),Et&&ee(Et),lt!=null&<.incomingTitlesMeasureWidth&&me(lt.incomingTitlesMeasureWidth),ge((M==null?void 0:M.entryIndex)??null),Ce(!0),He.current=re.entryIndex,Se.current=setTimeout(()=>{ge(null),Ce(!1),ee(void 0),me(void 0),Ie(null),Se.current=null},400)):($e(),ge(null),Ce(!1),ee(void 0),me(void 0),Ie(null),He.current=re.entryIndex)},[ce,$e,Ze,Xe,ye,De,k]),he=s.useCallback(()=>{Be.current=null},[]),Ee=s.useCallback(Te=>{!be||ye.length<=1||Te.pointerType==="mouse"&&Te.button!==0||Te.target.closest("[data-controls]")||(Be.current={startX:Te.clientX,startY:Te.clientY,pointerId:Te.pointerId})},[be,ye.length]),nt=s.useCallback(Te=>{var zt;if(!be||ye.length<=1||Te.pointerType==="mouse"&&Te.button!==0)return;if(st){he();return}const Ye=Be.current;if(!Ye||Ye.pointerId!==Te.pointerId||(he(),Te.target.closest("[data-controls]")))return;const re=Te.clientX-Ye.startX,ue=Te.clientY-Ye.startY,ke=Math.abs(re),Ke=Math.abs(ue);if(ke>=Jy&&ke>Ke){ct(re>0?ce-1:ce+1);return}if(ke>wc||Ke>wc)return;const lt=(zt=Ge.current)==null?void 0:zt.getBoundingClientRect(),Et=lt?lt.left+lt.width/2:window.innerWidth/2;ct(Te.clientX<Et?ce-1:ce+1)},[ce,be,ct,st,he,ye.length]),pt=s.useCallback(Te=>{const Ye=Be.current;(Ye==null?void 0:Ye.pointerId)===Te.pointerId&&he()},[he]);Wl(),s.useEffect(()=>{_e.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const Te=requestAnimationFrame(()=>{we(!0),requestAnimationFrame(()=>{ve.current?ve.current.focus():Ge.current&&Ge.current.focus()})});return()=>{cancelAnimationFrame(Te),qe.current&&clearTimeout(qe.current),Se.current&&clearTimeout(Se.current);const Ye=_e.current;Ye&&document.contains(Ye)&&Ye.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var Te;k!=="fade"&&(He.current=((Te=ye[ce])==null?void 0:Te.entryIndex)??0,$e(),ge(null),Ce(!1),ee(void 0),me(void 0))},[ce,$e,ye,k]),s.useEffect(()=>{const Te=Ye=>{if(Ye.key==="Escape"){Ue();return}if(Ye.key==="ArrowLeft"&&ye.length>1){ct(ce-1);return}if(Ye.key==="ArrowRight"&&ye.length>1){ct(ce+1);return}if(Ye.key==="Tab"&&Ge.current){const M=Ge.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),re=Array.from(M).filter(lt=>!lt.closest('[aria-hidden="true"]'));if(re.length===0)return;const ue=re[0],ke=re[re.length-1],Ke=document.activeElement;Ye.shiftKey?(Ke===ue||!Ge.current.contains(Ke))&&(Ye.preventDefault(),ke.focus()):(Ke===ke||!Ge.current.contains(Ke))&&(Ye.preventDefault(),ue.focus())}};return window.addEventListener("keydown",Te),()=>window.removeEventListener("keydown",Te)},[ct,Ue,ce,ye.length]),s.useLayoutEffect(()=>{$e(),J.current=0,z(0),K(null),ne(!1),ge(null),Ce(!1),ee(void 0),me(void 0),Ie(null),Y(Te=>{const Ye=Math.max(0,ye.length-1);return Math.min(Te,Ye)})},[$e,t.length,y,ye.length]),s.useLayoutEffect(()=>{var M;const Te=Math.max(0,ye.length-1),Ye=Math.min(Math.max(0,l),Te);We.current=Ye,He.current=((M=ye[Ye])==null?void 0:M.entryIndex)??0,Y(Ye)},[l]);const Ve=Re!==null?t[Re]:null,vt=h!==null?ye[h]:null,Rt=(pe==null?void 0:pe.title1)||(pe==null?void 0:pe.title2)||(pe==null?void 0:pe.title3)||(Ve==null?void 0:Ve.title1)||(Ve==null?void 0:Ve.title2)||(Ve==null?void 0:Ve.title3),At=av(y,ye,t),wt=L!==null,Vt=Rt||At||wt,jt=At&&wt?{gap:j}:void 0,Kt=`${e}-titles-stack${Q?` ${e}-titles-stack-stacked`:""}`,Yt=`${e}-titles-layer-out${Q?` ${e}-titles-layer-out-stacked`:""}`,kt=`${e}-titles-layer-out`,Bt=(U??0)>0||o,rn=w(_),xt=s.useMemo(()=>({title1Width:f??bo.title1Width,title2Width:S??bo.title2Width,title3Width:W??bo.title3Width}),[f,S,W]),yt=s.useMemo(()=>({title2MarginLeft:B,title3MarginLeft:P}),[B,P]),Me=s.useMemo(()=>pe?Si(e,pe,O,oe,N):[],[e,pe,O,oe,N]),Qe=s.useMemo(()=>Me.map(Te=>xt[Te.widthKey]),[Me,xt]),rt=s.useMemo(()=>Po(Me.length,Qe),[Me.length,Qe]),dt=s.useMemo(()=>yr(Me.length,Qe),[Me.length,Qe]),Pt=s.useMemo(()=>Me.filter(Te=>Te.prefix==="title1"),[Me]),St=s.useMemo(()=>Me.filter(Te=>Te.prefix==="title2"||Te.prefix==="title3"),[Me]),ht=s.useMemo(()=>wi(Pt,xt),[Pt,xt]),Wt=s.useMemo(()=>wi(St,xt),[St,xt]),Tt=s.useCallback((Te,Ye)=>{const M=Me.findIndex(ue=>ue.prefix===Te.prefix);if(!Q||Ye==="single-row")return{effectiveWidth:dt[M]??0,resolvedWidth:rt[M]??0,maxWidth:yn(M,rt)};if(Ye==="two-row-top"){const ue=Pt.findIndex(ke=>ke.prefix===Te.prefix);return{effectiveWidth:ht.effective[ue]??0,resolvedWidth:ht.resolved[ue]??0,maxWidth:yn(ue,ht.resolved)}}const re=St.findIndex(ue=>ue.prefix===Te.prefix);return{effectiveWidth:Wt.effective[re]??0,resolvedWidth:Wt.resolved[re]??0,maxWidth:yn(re,Wt.resolved)}},[Me,St,Wt,dt,rt,Pt,ht,Q]),Ot=s.useCallback(Te=>Gu(Me,rt,yt,Te)+(Q?0:U??0),[Me,rt,yt,Q,U]),Gt=s.useCallback(()=>Q?0:U??0,[Q,U]),Mt=s.useCallback(Te=>St.slice(0,Te).reduce((Ye,M,re)=>Ye+(M.marginLeftKey?yt[M.marginLeftKey]??0:0)+(Wt.resolved[re]??0),0),[St,Wt.resolved,yt]),_t=s.useCallback(Te=>{const Ye=St[Te];return Mt(Te)+(Ye.marginLeftKey?yt[Ye.marginLeftKey]??0:0)+(Wt.resolved[Te]??0)},[St,Wt.resolved,Mt,yt]),Ft=s.useCallback((Te,Ye,M)=>{if(!Q||M==="single-row"){const lt=Te.findIndex(tn=>tn.prefix===Ye.prefix),Et=Te.map(tn=>xt[tn.widthKey]),zt=Po(Te.length,Et);return{effectiveWidth:yr(Te.length,Et)[lt]??0,resolvedWidth:zt[lt]??0,maxWidth:yn(lt,zt)}}if(M==="two-row-top"){const lt=Te.filter(tn=>tn.prefix==="title1"),Et=lt.findIndex(tn=>tn.prefix===Ye.prefix),{resolved:zt,effective:en}=wi(lt,xt);return{effectiveWidth:en[Et]??0,resolvedWidth:zt[Et]??0,maxWidth:yn(Et,zt)}}const re=Te.filter(lt=>lt.prefix==="title2"||lt.prefix==="title3"),ue=re.findIndex(lt=>lt.prefix===Ye.prefix),{resolved:ke,effective:Ke}=wi(re,xt);return{effectiveWidth:Ke[ue]??0,resolvedWidth:ke[ue]??0,maxWidth:yn(ue,ke)}},[xt,Q]),ut=(Te,Ye,M)=>{const re=Te.marginLeftKey?yt[Te.marginLeftKey]??0:0,{effectiveWidth:ue,resolvedWidth:ke,maxWidth:Ke}=M??Tt(Te,Ye),lt=Math.max(re,ei),Et=o&&Ye==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":Te.prefix,style:{width:w(ue),...re>0?{marginLeft:w(re)}:{}},children:[a.jsx("p",{className:Te.className,style:Te.style,children:Te.text}),Et&&Te.marginLeftKey?a.jsx("div",{"data-controls":Te.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ke),style:{position:"absolute",top:0,left:w(-re),width:w(lt),height:"100%",pointerEvents:"auto"}}):null,Et?a.jsx("div",{"data-controls":Te.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ke),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:w(-Ln/2),width:w(Ln),height:"100%",pointerEvents:"auto"}}):null]},Te.className)},H=(Te="two-row")=>{const Ye=Me.findIndex(ue=>ue.prefix==="title1"),M=Ye>=0?rt[Ye]:xt.title1Width,re=Te==="two-row"&&o;return a.jsx("div",{...re?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(M)}:{},style:{width:w(U??0),flexShrink:0,alignSelf:"stretch",...re?{pointerEvents:"auto"}:{}}})},Le=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:O,"aria-hidden":"true",children:" "}),je=()=>a.jsx("span",{className:`${e}-entry-counter`,style:le,"aria-live":"polite","aria-atomic":"true",children:rv(ye,ce,y,t)}),Fe=()=>At?o&&wt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[je(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${ns(j)} + ${j}))`,width:ns(j),height:"100%",pointerEvents:"auto",zIndex:3}})]}):je():null,ft=()=>!At&&!wt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:jt,children:[Fe(),wt?Lt():null]}),Ht=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||Rt?Le():null,Bt?H("single-row"):null,Dt(pe),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),ft(),xn()]}),mt=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||Rt?Le():null,Bt?H("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:xe&&R?{minHeight:R}:void 0,children:[a.jsx("div",{ref:et,className:Kt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Un(X||pe)}),a.jsxs("div",{ref:tt,className:Kt,style:{position:xe?"absolute":"relative",inset:xe?0:void 0,width:"100%",...xe&&te?{width:te,maxWidth:"100%"}:void 0},children:[Ve&&xe?a.jsx("div",{className:`${Yt} ${e}-titles-fade-out`,children:Un(Ve)}):null,a.jsx("div",{className:`${e}-titles-layer-in${xe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:Un(pe)})]})]}),ft(),xn()]}),Lt=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:F.scalingValue(D??0,i),height:F.scalingValue(D??0,i),marginRight:ae,"--close-icon-hover-color":T},children:[a.jsx("button",{ref:ve,type:"button",className:`${e}-close-icon-inner`,onClick:Ue,"aria-label":"Close",children:a.jsx(mn,{url:L??"",fill:E,hoverFill:i&&!r?E:T,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ae,height:"100%",pointerEvents:"auto"}})]}),Ut=(Te,Ye)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[At||Rt?Le():null,Bt?H("two-row"):null,Ye!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Ye},children:Te}):a.jsxs(a.Fragment,{children:[Te,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),ft()]}),Dt=Te=>{if(!Te)return null;const Ye=Si(e,Te,O,oe,N);return a.jsx(a.Fragment,{children:Ye.map(M=>ut(M,"single-row",Ft(Ye,M,"single-row")))})},an=Te=>{if(!Te)return null;const Ye=Si(e,Te,O,oe,N),M=Ye.find(re=>re.prefix==="title1");return M?ut(M,"two-row-top",Ft(Ye,M,"two-row-top")):null},ln=(Te,Ye=!1)=>{const M=Te?Si(e,Te,O,oe,N):[],re=M.filter(Ke=>Ke.prefix==="title2"||Ke.prefix==="title3"),ue=o&&Ye;return re.length>0||ue||(_??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[re.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[re.map(Ke=>ut(Ke,"two-row-bottom",Ft(M,Ke,"two-row-bottom"))),Ye&&o?a.jsxs(a.Fragment,{children:[Vo(),Go()]}):null]}):null,(_??0)>0||ue?a.jsx("div",{"data-controls":ue?"titleRowMarginBottom":void 0,"data-controls-axis":ue?"y":void 0,"data-controls-reverse":ue?"":void 0,className:ue?`${e}-control`:void 0,style:{height:rn,width:"100%",flexShrink:0,pointerEvents:ue?"auto":"none"}}):null]}):null},qn=(Te,Ye=!1)=>a.jsxs(a.Fragment,{children:[Ut(an(Te)),ln(Te,Ye)]}),Un=Te=>Q?a.jsx("div",{className:`${e}-titles-row-two-row`,children:qn(Te)}):Te?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Dt(Te)}):null,Zi=()=>{const Te=Q?-1:Me.findIndex(re=>re.prefix==="title1"),Ye=!Q&&(o||(U??0)>0)?(()=>{const re=U??0,ue=Te>=0?rt[Te]:xt.title1Width,ke=Math.max(re,ei);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ue),style:{position:"absolute",top:0,left:0,width:w(ke),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,M=Me.flatMap((re,ue)=>{if(!re.marginLeftKey)return[];const ke=yt[re.marginLeftKey]??0,Ke=Vu(Me,rt,yt,ue)+Gt(),lt=Math.max(ke,ei);return a.jsx("div",{"data-controls":re.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(rt[ue]),style:{position:"absolute",top:0,left:w(Ke),width:w(lt),height:"100%",pointerEvents:"auto"}},re.marginLeftKey)});return Ye?[Ye,...M]:M},hn=()=>Me.map((Te,Ye)=>{const M=yn(Ye,rt),ue=Ot(Ye)-Ln/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Te.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(M),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:w(ue),width:w(Ln),height:"100%",pointerEvents:"auto"}})},`${Te.widthKey}-junction`)}),Vo=()=>St.flatMap((Te,Ye)=>{if(!Te.marginLeftKey)return[];const M=yt[Te.marginLeftKey]??0,re=Mt(Ye),ue=Math.max(M,ei),{resolvedWidth:ke}=Tt(Te,"two-row-bottom");return a.jsx("div",{"data-controls":Te.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ke),style:{position:"absolute",top:0,left:w(re),width:w(ue),height:"100%",pointerEvents:"auto"}},Te.marginLeftKey)}),Go=()=>St.map((Te,Ye)=>{const{maxWidth:M}=Tt(Te,"two-row-bottom"),ue=_t(Ye)-Ln/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Te.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(M),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:w(ue),width:w(Ln),height:"100%",pointerEvents:"auto"}})},`${Te.widthKey}-junction`)}),xn=()=>!o||Q?null:a.jsxs(a.Fragment,{children:[Zi(),hn()]}),li=Te=>{const Ye=!Te.objectFit&&ri(v);return{className:`${e}-slide-image-cell${Ye?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:I,maxHeight:A,...Ye?{"--image-aspect-ratio":Oa(v)}:{}}}},Ji=Te=>Te.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":Te.objectFit}}:ri(v)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},bn=Te=>{if(Te.length===0)return null;const Ye=Te.length>1,M=ns(q),re=`calc(-0.5 * (${M} + ${q}))`;if(Te.length===1){const ue=Te[0];return a.jsx("div",{...li(ue),children:a.jsx("img",{...Ji(ue),src:ue.url,alt:ue.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:Ye?{gap:q}:void 0,children:Te.map((ue,ke)=>a.jsxs("div",{...li(ue),children:[a.jsx("img",{...Ji(ue),src:ue.url,alt:ue.name??"",draggable:!1}),o&&Ye&&ke<Te.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:re,width:M,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${ue.url}-${ke}`))})},Kn=!!(pe!=null&&pe.title2||pe!=null&&pe.title3||Ve!=null&&Ve.title2||Ve!=null&&Ve.title3||(_??0)>0||o),Qi=()=>a.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[a.jsx("div",{ref:et,className:Kt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:qn(X||pe)}),a.jsxs("div",{ref:tt,className:`${e}-titles-row-two-row`,style:{...xe&&R?{minHeight:R}:void 0,...xe&&te?{width:te,maxWidth:"100%"}:void 0},children:[Ut(a.jsxs("div",{className:Kt,style:{position:xe?"absolute":"relative",inset:xe?0:void 0,width:"100%"},children:[Ve&&xe?a.jsx("div",{className:`${kt} ${e}-titles-fade-out`,children:an(Ve)}):null,a.jsx("div",{className:`${e}-titles-layer-in${xe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:an(pe)})]}),xe&&R?R:void 0),Kn?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[Ve&&xe?a.jsx("div",{className:`${Yt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:ln(Ve)}):null,a.jsx("div",{className:`${e}-titles-layer-in${xe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${Q?` ${e}-titles-layer-in-stacked`:""}`,children:ln(pe,!0)})]}):null]})]}),eo=()=>{const Te=Kn;return a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...Te?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:Te?void 0:{flex:"0 0 auto",height:"auto"},children:qn(pe,!0)}),xn()]})};return a.jsxs("div",{ref:Ge,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{st||Ue()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:wt?void 0:-1,style:{opacity:fe?1:0,transition:"opacity 300ms ease",pointerEvents:fe?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:m,...it}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:ze,...gt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Oe,onClick:Te=>Te.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":be&&ye.length>1?"true":"false",onPointerDown:be?Ee:void 0,onPointerUp:be?nt:void 0,onPointerCancel:be?pt:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[vt&&Z?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:Te=>{Te.target===Te.currentTarget&&Ne(de)},children:a.jsx("div",{className:`${e}-slide-area`,children:bn(vt.images)})},`slide-out-${de}`):null,a.jsx("div",{className:`${e}-slide-layer-in${Z?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:se?bn(se.images):null})},`slide-in-${de}-${ce}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Ae,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:ie,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...Q?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${Q?` ${e}-lightbox-content-area-stacked`:""}`,children:Vt&&a.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?k==="fade"?Qi():eo():k==="fade"?mt():Ht()})})})]})]})]})};function zx(e){return`
|
|
15256
15284
|
.${e}-wrapper {
|
|
15257
15285
|
position: relative;
|
|
15258
15286
|
width: 100%;
|
|
@@ -15774,7 +15802,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
15774
15802
|
pointer-events: auto;
|
|
15775
15803
|
z-index: 10;
|
|
15776
15804
|
}
|
|
15777
|
-
`}const Bx=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r,metadata:l})=>{const{prefix:c}=F.useScopedStyles(),d=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:y}=e,v=s.useRef(null),[m,g]=s.useState(!1),[x,b]=s.useState(0),k=s.useRef(!1),f=s.useRef(!1),S=s.useRef(!1),
|
|
15805
|
+
`}const Bx=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r,metadata:l})=>{const{prefix:c}=F.useScopedStyles(),d=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:y}=e,v=s.useRef(null),[m,g]=s.useState(!1),[x,b]=s.useState(0),k=s.useRef(!1),f=s.useRef(!1),S=s.useRef(!1),W=s.useMemo(()=>(t??[]).filter($=>Lo($).length>0),[t]),U=m&&W.length>0,B=!n,P=s.useCallback(()=>{B&&(S.current=!0,ev(f.current,d),f.current=!1)},[B,d]),_=($=0)=>{if(W.length===0||n&&!i&&!o)return;const L=la(W,y),D=Math.max(0,Math.min($,L.length-1));if(b(D),B){const E=Bu();zu(D+1,d,E),f.current=!E}g(!0)},G=s.useCallback(()=>{g(!1),S.current=!1},[]);return s.useEffect(()=>{!n||i||o||g(!1)},[n,i,o]),s.useEffect(()=>{if(!B||typeof window>"u")return;const $=window.history.scrollRestoration;return window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration=$}},[B]),s.useEffect(()=>{if(!B||k.current)return;k.current=!0;const $=Cc(d);if(!$)return;const L=Tc($,la(W,y).length);L<0||(b(L),g(!0))},[W,d,B,y]),s.useEffect(()=>{if(!B)return;const $=()=>{if(S.current){S.current=!1,g(!1);return}const L=Cc(d);if(!L){g(!1);return}const D=Tc(L,la(W,y).length);if(D<0){g(!1);return}f.current=!1,b(D),g(!0)};return window.addEventListener("popstate",$),()=>window.removeEventListener("popstate",$)},[W,d,B,y]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:v,className:`${c}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:zx(c)}}),u?a.jsx("button",{type:"button",className:`${c}-cover ${ri(p)?`${c}-ratio-wrapper-cover`:`${c}-ratio-wrapper-fit`}`,onClick:()=>_(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...ri(p)?{"--image-aspect-ratio":Oa(p)}:{}},"aria-label":"Open journal gallery",children:a.jsx("img",{className:`${c}-cover-image ${ri(p)?`${c}-cover-image-cover`:`${c}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),U&&typeof document<"u"&&(()=>{const $=(r?document.getElementById(r):null)??document.body;return Gn.createPortal(a.jsx(Dx,{prefix:c,entries:W,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:x,enableUrlSync:B,journalItemId:d,onBeforeClose:P,onClose:G}),$)})()]})},jx=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
|
|
15778
15806
|
import { createPortal } from 'react-dom';
|
|
15779
15807
|
import { CommonComponentProps } from '../props';
|
|
15780
15808
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -16539,7 +16567,7 @@ export type LightboxJournalSettings = {
|
|
|
16539
16567
|
closeIconColor: string;
|
|
16540
16568
|
closeIconHoverColor: string;
|
|
16541
16569
|
};
|
|
16542
|
-
`,Vx="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>'),Wi={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 Gx(e){const t={};return t[bt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[bt(e,"fontSettings")]={...Wi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[bt(e,"fontSize")]={...Wi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[bt(e,"lineHeight")]={...Wi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[bt(e,"letterSpacing")]={...Wi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[bt(e,"wordSpacing")]={...Wi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[bt(e,"textAlign")]={...Wi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[bt(e,"textAppearance")]={...Wi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Xx=Li.reduce((e,t)=>({...e,...Gx(t)}),{}),qx=Li.reduce((e,t)=>({...e,[bt(t,"fontFamily")]:"Goudy Bookletter 1911",[bt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[bt(t,"letterSpacing")]:0,[bt(t,"wordSpacing")]:0,[bt(t,"textAlign")]:"left",[bt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ps(e){return Li.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[bt(n,"fontSize")]=i),o!==void 0&&(t[bt(n,"lineHeight")]=o),t},{})}const Ux=sv(),Kx={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"}},...Xx,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:Vx,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...qx,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,...ps({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,...ps({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,...ps({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:[Ux]}],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"}]}]}},Yx={element:Bx,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:Kx,sourceCode:jx,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Li.map(e=>({path:`${bt(e,"fontFamily")}`}))]},fontRelations:{...Li.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${bt(t,"fontFamily")}`}),{})}},Zx={sizeType:"custom",value:700,min:400,max:700};function xa(e,t){return{widthPx:e,heightPx:e*t}}function Vs(e,t,n,i,o,r){return{x:Math.min(Math.max(e,o/2),n-o/2),y:Math.min(Math.max(t,r/2),i-r/2)}}function Jc(e,t,n,i){const{heightPx:o}=xa(n,i);return Vs(e/2,t/2,e,t,n,o)}function sp(e,t,n){for(const i of n){const{heightPx:o}=xa(i.widthPx,i.aspectRatio),r=i.widthPx/2,l=o/2;if(e>=i.x-r&&e<=i.x+r&&t>=i.y-l&&t<=i.y+l)return!0}return!1}function Jx(e,t,n,i,o,r,l,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":sp(e,t,n)||r==="area"?l??"none":c??"none"}function Qc(e,t,n){var c;const{sizeType:i,value:o,min:r,max:l}=t;return i==="custom"?o:i==="as is"?((c=n.get(e))==null?void 0:c.naturalWidth)??o:Math.round(Math.random()*(l-r)+r)}function Qx(e){return`
|
|
16570
|
+
`,Vx="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>'),Wi={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 Gx(e){const t={};return t[bt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[bt(e,"fontSettings")]={...Wi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[bt(e,"fontSize")]={...Wi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[bt(e,"lineHeight")]={...Wi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[bt(e,"letterSpacing")]={...Wi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[bt(e,"wordSpacing")]={...Wi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[bt(e,"textAlign")]={...Wi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[bt(e,"textAppearance")]={...Wi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Xx=Li.reduce((e,t)=>({...e,...Gx(t)}),{}),qx=Li.reduce((e,t)=>({...e,[bt(t,"fontFamily")]:"Goudy Bookletter 1911",[bt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[bt(t,"letterSpacing")]:0,[bt(t,"wordSpacing")]:0,[bt(t,"textAlign")]:"left",[bt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ms(e){return Li.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[bt(n,"fontSize")]=i),o!==void 0&&(t[bt(n,"lineHeight")]=o),t},{})}const Ux=sv(),Kx={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"}},...Xx,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:Vx,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...qx,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,...ms({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,...ms({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,...ms({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:[Ux]}],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"}]}]}},Yx={element:Bx,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:Kx,sourceCode:jx,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Li.map(e=>({path:`${bt(e,"fontFamily")}`}))]},fontRelations:{...Li.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${bt(t,"fontFamily")}`}),{})}},Zx={sizeType:"custom",value:700,min:400,max:700};function ba(e,t){return{widthPx:e,heightPx:e*t}}function Vs(e,t,n,i,o,r){return{x:Math.min(Math.max(e,o/2),n-o/2),y:Math.min(Math.max(t,r/2),i-r/2)}}function Jc(e,t,n,i){const{heightPx:o}=ba(n,i);return Vs(e/2,t/2,e,t,n,o)}function sp(e,t,n){for(const i of n){const{heightPx:o}=ba(i.widthPx,i.aspectRatio),r=i.widthPx/2,l=o/2;if(e>=i.x-r&&e<=i.x+r&&t>=i.y-l&&t<=i.y+l)return!0}return!1}function Jx(e,t,n,i,o,r,l,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":sp(e,t,n)||r==="area"?l??"none":c??"none"}function Qc(e,t,n){var c;const{sizeType:i,value:o,min:r,max:l}=t;return i==="custom"?o:i==="as is"?((c=n.get(e))==null?void 0:c.naturalWidth)??o:Math.round(Math.random()*(l-r)+r)}function Qx(e){return`
|
|
16543
16571
|
.${e}-root {
|
|
16544
16572
|
position: absolute;
|
|
16545
16573
|
top: 0;
|
|
@@ -16574,7 +16602,7 @@ export type LightboxJournalSettings = {
|
|
|
16574
16602
|
width: 32px;
|
|
16575
16603
|
height: 32px;
|
|
16576
16604
|
}
|
|
16577
|
-
`}function eb(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 tb(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await eb(i)]));return new Map(n)}function nb({settings:e,content:t=[],isEditor:n}){const{prefix:i}=F.useScopedStyles(),[o,r]=s.useState(null),[l,c]=s.useState([]),[d,u]=s.useState(0),p=s.useRef(0),[y,v]=s.useState({x:0,y:0}),[m,g]=s.useState("none"),x=s.useRef({x:0,y:0}),[b,k]=s.useState(!1),[f,S]=s.useState(!1),
|
|
16605
|
+
`}function eb(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 tb(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await eb(i)]));return new Map(n)}function nb({settings:e,content:t=[],isEditor:n}){const{prefix:i}=F.useScopedStyles(),[o,r]=s.useState(null),[l,c]=s.useState([]),[d,u]=s.useState(0),p=s.useRef(0),[y,v]=s.useState({x:0,y:0}),[m,g]=s.useState("none"),x=s.useRef({x:0,y:0}),[b,k]=s.useState(!1),[f,S]=s.useState(!1),W=s.useRef(new Map),{imageSize:U=Zx,cursor:B="system",target:P="area",position:_="random",visible:G="all",defaultCursor:$=null,hoverCursor:L=null}=e,D=t.filter(I=>{var A;return!!((A=I==null?void 0:I.image)!=null&&A.url)}),E=s.useMemo(()=>Qx(i),[i]),T=s.useCallback((I,A,j=l)=>{if(!o)return;const ie=o.getBoundingClientRect(),ae=I-ie.left,O=A-ie.top;v({x:ae,y:O}),g(Jx(ae,O,j,o,B,P,L,$))},[o,l,B,P,L,$]);s.useEffect(()=>{const I=[...D.map(j=>j.image.url),$,L].filter(j=>!!j);if(I.length===0){W.current=new Map,S(!0);return}let A=!1;return S(!1),tb(I).then(j=>{A||(W.current=j,S(!0))}),()=>{A=!0}},[t,$,L]),s.useEffect(()=>{if(!o)return;const I=j=>{j.stopPropagation(),x.current={x:j.clientX,y:j.clientY},T(j.clientX,j.clientY)},A=()=>{b&&T(x.current.x,x.current.y)};return o.addEventListener("mousemove",I),window.addEventListener("scroll",A,!0),()=>{o.removeEventListener("mousemove",I),window.removeEventListener("scroll",A,!0)}},[o,b,T]),s.useEffect(()=>{!o||!b||T(x.current.x,x.current.y)},[l,o,b,T]),s.useEffect(()=>{b||g("none")},[b]);const C=(I,A,j,ie={})=>{var Q,be;if(!((Q=I==null?void 0:I.image)!=null&&Q.url))return null;const ae=((be=W.current.get(I.image.url))==null?void 0:be.aspectRatio)??1,O=Qc(I.image.url,U,W.current),{heightPx:oe}=ba(O,ae);let N=0,le=0;return _==="same"?{x:N,y:le}=Jc(A,j,O,ae):(N=ie.x??Math.random()*A,le=ie.y??Math.random()*j,{x:N,y:le}=Vs(N,le,A,j,O,oe)),{id:p.current++,url:I.image.url,link:I.link,name:I.image.name,x:N,y:le,xRatio:N/A,yRatio:le/j,aspectRatio:ae,widthPx:O}},V=()=>{if(!o)return;const I=o.getBoundingClientRect(),A=I.width,j=I.height;A===0||j===0||c(ie=>ie.length===0?ie:ie.map(ae=>{const O=U.sizeType==="random"?ae.widthPx:Qc(ae.url,U,W.current),{heightPx:oe}=ba(O,ae.aspectRatio);if(_==="same"){const{x:Q,y:be}=Jc(A,j,O,ae.aspectRatio);return{...ae,x:Q,y:be,widthPx:O}}const{x:N,y:le}=Vs(ae.xRatio*A,ae.yRatio*j,A,j,O,oe);return{...ae,x:N,y:le,widthPx:O}}))};s.useEffect(()=>{if(!o||D.length===0||!f)return;const I=o.getBoundingClientRect(),A=I.width,j=I.height,ie=C(D[0],A,j);ie&&(c([ie]),u(D.length>1?1:0))},[U,_,o,t,f]),s.useEffect(()=>{if(!o)return;V();const I=new ResizeObserver(V);return I.observe(o),window.addEventListener("resize",V),()=>{I.disconnect(),window.removeEventListener("resize",V)}},[o,_,U,l.length]),s.useEffect(()=>{G==="last One"&&c(I=>I.length>0?[I[I.length-1]]:[])},[G]);const w=I=>{if(!o||D.length===0||!f)return;const A=o.getBoundingClientRect(),j=I.clientX-A.left,ie=I.clientY-A.top;if(P==="image"&&!sp(j,ie,l))return;let ae=0,O=0;_==="on Click"?(ae=j,O=ie):_==="same"?(ae=A.width/2,O=A.height/2):(ae=Math.random()*A.width,O=Math.random()*A.height);const oe=D[d%D.length],N=C(oe,A.width,A.height,{x:ae,y:O});if(!N)return;const le=G==="all"?[...l,N]:[N];c(le),u(Q=>(Q+1)%D.length),T(I.clientX,I.clientY,le)},q=B==="custom"&&m!=="none";return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:E}}),a.jsxs("div",{ref:r,onClick:w,onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),className:`${i}-root`,style:{cursor:q?"none":"default"},children:[l.map(I=>a.jsx("div",{className:`${i}-wrapper`,style:{top:`${I.y}px`,left:`${I.x}px`,width:`${I.widthPx}px`,cursor:q?"none":"default"},children:P==="area"&&I.link?a.jsx("a",{href:I.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:a.jsx("img",{src:I.url,alt:I.name,className:`${i}-image`})}):a.jsx("img",{src:I.url,alt:I.name,className:`${i}-image`})},I.id)),b&&q&&a.jsx("div",{className:`${i}-cursor`,style:{left:`${y.x}px`,top:`${y.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${m}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const ib=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
16578
16606
|
import { CommonComponentProps } from '../props';
|
|
16579
16607
|
import { useScopedStyles } from '../utils/index';
|
|
16580
16608
|
|
|
@@ -17214,7 +17242,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
17214
17242
|
display: block;
|
|
17215
17243
|
pointer-events: none;
|
|
17216
17244
|
}
|
|
17217
|
-
`}function cb(e){return e==="blur"?sb:e==="greyscale"?ab:0}function Yo(e,t=1,n=1){const i=cb(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 ed(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function db(e,t){return t<=1?0:(e-1+t)%t}function ub(e,t=1){return!e||e.height===0?t:e.width/e.height}function pb(e,t,n,i,o){if(e<=0||t<=0)return{widthPercent:i,heightPercent:o};const r=e*i/100,l=t*o/100;let c=r,d=c/n;return d>l&&(d=l,c=d*n),{widthPercent:c/e*100,heightPercent:d/t*100}}function td(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 lp(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function nd(e,t,n){return{...lp(e),[`--${n}-stage-scale`]:t}}function mb(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 gb({settings:e,content:t,isEditor:n,isPreviewMode:i}){var Ce,h,K,Z,
|
|
17245
|
+
`}function cb(e){return e==="blur"?sb:e==="greyscale"?ab:0}function Yo(e,t=1,n=1){const i=cb(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 ed(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function db(e,t){return t<=1?0:(e-1+t)%t}function ub(e,t=1){return!e||e.height===0?t:e.width/e.height}function pb(e,t,n,i,o){if(e<=0||t<=0)return{widthPercent:i,heightPercent:o};const r=e*i/100,l=t*o/100;let c=r,d=c/n;return d>l&&(d=l,c=d*n),{widthPercent:c/e*100,heightPercent:d/t*100}}function td(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 lp(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function nd(e,t,n){return{...lp(e),[`--${n}-stage-scale`]:t}}function mb(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 gb({settings:e,content:t,isEditor:n,isPreviewMode:i}){var Ce,h,K,Z,ne,de,z;const{prefix:o}=F.useScopedStyles(),r=s.useMemo(()=>lb(o),[o]),{imageSize:l,maxWidth:c,maxHeight:d,transition:u=1e3,bgImage:p="greyscale"}=e,y=t??[],v=ed(y.length),[m,g]=s.useState(v.activeIndex),[x,b]=s.useState(v.backgroundIndex),[k,f]=s.useState(!1),[S,W]=s.useState(!1),[U,B]=s.useState(null),[P,_]=s.useState(null),[G,$]=s.useState(0),[L,D]=s.useState(1),[E,T]=s.useState("none"),[C,V]=s.useState("next"),[w,q]=s.useState({}),[I,A]=s.useState({width:0,height:0}),j=s.useRef(null),ie=s.useRef(null),ae=!n||!!i,O=l??60,oe=Math.max(10,Math.min(100,c??O)),N=Math.max(10,Math.min(100,d??O)),le=Math.max(100,u),Q=Yo(p),be=s.useCallback(R=>{const ee=ub(R?w[R]:void 0);return pb(I.width,I.height,ee,oe,N)},[I.height,I.width,w,N,oe]);s.useEffect(()=>{const R=ie.current;if(!R)return;const ee=new ResizeObserver(([te])=>{const{width:me,height:X}=te.contentRect;A({width:me,height:X})});return ee.observe(R),()=>ee.disconnect()},[]),s.useEffect(()=>{const R=(t??[]).map(ee=>{var te;return(te=ee.image)==null?void 0:te.url}).filter(ee=>!!ee);mb(R,(ee,te)=>{q(me=>{var X,Ie;return((X=me[ee])==null?void 0:X.width)===te.width&&((Ie=me[ee])==null?void 0:Ie.height)===te.height?me:{...me,[ee]:te}})})},[t]),s.useEffect(()=>{const{backgroundIndex:R,activeIndex:ee}=ed(y.length);g(ee),b(R),f(!1),W(!1),B(null),_(null),$(0),D(1),T("none"),V("next")},[y.length,t]),s.useEffect(()=>()=>{j.current&&clearTimeout(j.current)},[]);const Pe=s.useCallback(R=>{var Se,J,He,We;if(!ae||k||y.length<=1)return;const ee=R==="next"?(m+1)%y.length:(m-1+y.length)%y.length,te=be((J=(Se=y[m])==null?void 0:Se.image)==null?void 0:J.url),me=be((We=(He=y[ee])==null?void 0:He.image)==null?void 0:We.url),X=td(I.width,I.height,te),Ie=td(I.width,I.height,me);j.current&&clearTimeout(j.current),V(R),W(!0),f(!0),R==="next"?(B(m),_(ee),$(0),D(1),T(Yo(p,0,1))):(b(db(ee,y.length)),B(ee),_(m),$(1),D(Ie),T(Yo(p,1,Ie))),requestAnimationFrame(()=>{W(!1),requestAnimationFrame(()=>{R==="next"?($(1),D(X),T(Yo(p,1,X))):($(0),D(1),T(Yo(p,0,1)))})}),j.current=setTimeout(()=>{R==="next"&&b(m),g(ee),B(null),_(null),f(!1)},le)},[m,p,I.height,I.width,be,k,ae,y,le]),ye=y[m],ce=x!==null?y[x]:null,Y=U!==null?y[U]:null,se=P!==null?y[P]:null,pe=y.length<=1?0:(m-1+y.length)%y.length,fe=y.length<=1?0:(m+1)%y.length,we=be((Ce=ye==null?void 0:ye.image)==null?void 0:Ce.url),Re=be((h=Y==null?void 0:Y.image)==null?void 0:h.url),ge=be((K=se==null?void 0:se.image)==null?void 0:K.url),xe={[`--${o}-transition-ms`]:`${le}ms`};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:r}}),a.jsxs("div",{ref:ie,className:Ct(`${o}-wrapper`,S&&`${o}-snap`,n&&!i&&`${o}-editor`),style:xe,"aria-label":"Zoom gallery",children:[((Z=ce==null?void 0:ce.image)==null?void 0:Z.url)&&a.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:ce.image.url,alt:"",style:{filter:Q}})}),k&&((ne=Y==null?void 0:Y.image)==null?void 0:ne.url)&&a.jsx("div",{className:Ct(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${C}`),style:nd(Re,L,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:Y.image.url,alt:"",style:{filter:E}})}),k&&((de=se==null?void 0:se.image)==null?void 0:de.url)&&a.jsx("div",{className:Ct(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${C}`),style:nd(ge,G,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-image`,src:se.image.url,alt:""})}),!k&&((z=ye==null?void 0:ye.image)==null?void 0:z.url)&&a.jsx("div",{className:Ct(`${o}-stage`,`${o}-foreground`),style:lp(we),children:a.jsx("img",{className:`${o}-image`,src:ye.image.url,alt:ye.image.name??""})}),ae&&y.length>1&&!k&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:Ct(`${o}-nav`,`${o}-nav-prev`),onClick:()=>Pe("prev"),"aria-label":`Show previous image (${pe+1} of ${y.length})`}),a.jsx("button",{type:"button",className:Ct(`${o}-nav`,`${o}-nav-next`),onClick:()=>Pe("next"),"aria-label":`Show next image (${fe+1} of ${y.length})`})]})]})]})}const hb=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
17218
17246
|
import cn from 'classnames';
|
|
17219
17247
|
import { CommonComponentProps } from '../props';
|
|
17220
17248
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -17733,7 +17761,7 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
|
|
|
17733
17761
|
</>
|
|
17734
17762
|
);
|
|
17735
17763
|
}
|
|
17736
|
-
`,fb={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:""}}]}},yb={element:gb,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:fb,sourceCode:hb,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},vb={backgroundColor:"background-color",textColor:"text-color",borderColor:"border-color",iconColor:"icon-color",boxShadowColor:"box-shadow-color",innerBoxShadowColor:"inner-box-shadow-color"},xb=["hover","active"],
|
|
17764
|
+
`,fb={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:""}}]}},yb={element:gb,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:fb,sourceCode:hb,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},vb={backgroundColor:"background-color",textColor:"text-color",borderColor:"border-color",iconColor:"icon-color",boxShadowColor:"box-shadow-color",innerBoxShadowColor:"inner-box-shadow-color"},xb=["hover","active"],gs={left:"flex-start",center:"center",right:"flex-end"};function bb(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 Sb(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 wb(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))`,r=`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))`,l=`${o}, ${r}`,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}`,p=`0 4px 12px rgba(0, 0, 0, 0.15), ${n}`,y=`.${e}-button:focus-visible, a:focus-visible .${e}-button`,v=`.${e}-button:hover, ${y}`,m=g=>`.${e}-hover-effect-${g}:hover, .${e}-hover-effect-${g}:focus-visible, a:focus-visible .${e}-hover-effect-${g}`;return`
|
|
17737
17765
|
.${e}-root {
|
|
17738
17766
|
line-height: 0;
|
|
17739
17767
|
}
|
|
@@ -17975,7 +18003,7 @@ a:active .${e}-button .${e}-icon-image,
|
|
|
17975
18003
|
height: calc(1em * var(--${e}-icon-scale, 1));
|
|
17976
18004
|
width: calc(1em * var(--${e}-icon-scale, 1));
|
|
17977
18005
|
}
|
|
17978
|
-
`}function
|
|
18006
|
+
`}function hs(e,t,n="",i,o){const r=t();return a.jsxs("span",{className:`${e}-content-roll-wrap ${n}`.trim(),style:i,children:[a.jsx("span",{className:`${e}-content-roll-spacer`,"aria-hidden":"true",style:o,children:r}),a.jsxs("span",{className:`${e}-content-roll-viewport`,children:[a.jsx("span",{className:`${e}-content-roll-layer`,style:o,children:t()}),a.jsx("span",{className:`${e}-content-roll-layer ${e}-content-roll-layer-hover`,"aria-hidden":"true",style:o,children:t()})]})]})}function id(e,t,n="fill",i=100,o=0,r){if(!t)return null;const l=a.jsx(mn,{url:t,fill:`var(--${e}-icon-color)`,hoverFill:`var(--${e}-icon-color)`,className:`${e}-icon-image`});if(n==="inline")return a.jsx("span",{className:`${e}-icon ${e}-icon-inline`,style:{[`--${e}-icon-scale`]:i/100},"aria-hidden":"true",children:l});if(n==="fixed"&&o>0){const c=F.scalingValue(o,r);return a.jsx("span",{className:`${e}-icon`,style:{width:c,height:c},"aria-hidden":"true",children:l})}return a.jsx("span",{className:`${e}-icon ${e}-icon-fill`,"aria-hidden":"true",children:l})}function $b({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:r}=F.useScopedStyles(),l=s.useMemo(()=>wb(r),[r]),{type:c="a",label:d="Button",icon:u,alignment:p="center",alignA:y,order:v="text-icon",gap:m=0,iconSize:g=0,iconWidthC:x=0,dimensions:b=!1,padding:k={top:0,right:0,bottom:0,left:0},cornerRadius:f=0,boxShadow:S={top:0,left:0,right:0,bottom:0},boxShadowColor:W="rgba(0, 0, 0, 0)",innerBoxShadow:U={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:B="rgba(0, 0, 0, 0)",stroke:P=0,blur:_=0,backgroundColor:G="#000000",textColor:$="#ffffff",borderColor:L="#ffffff",iconColor:D="#ffffff",hoverEffect:E="none",fontFamily:T,fontSettings:C,fontSize:V,lineHeight:w,letterSpacing:q=0,wordSpacing:I=0,textAppearance:A,stateOverrides:j,minWidth:ie=0,minHeight:ae=0,width:O=0,height:oe=0}=e,N=F.buildColorVars(r,{backgroundColor:G,textColor:$,borderColor:L,iconColor:D,boxShadowColor:W,innerBoxShadowColor:B},vb,xb,j),le=i&&i!=="default"?`${r}-state-${i}`:"",Q=t&&!n?`${r}-editing`:"",be=E!=="none"&&(!t||n||i==="hover")?`${r}-hover-effect-${E}`:"",Pe=E==="reveal"||E==="swipe",ye=E==="content-roll",ce=E==="reveal"&&(!t||n),Y=b===!0,pe=c==="a"?y??p:p,fe=c==="c",we=c!=="b",Re={fontSettings:{fontFamily:T,fontWeight:(C==null?void 0:C.fontWeight)??400,fontStyle:(C==null?void 0:C.fontStyle)??"normal"},fontSize:V??.01,lineHeight:w,letterSpacing:q,wordSpacing:I,textAppearance:A,color:$},xe={...we?dn(Qt(Re,t)):{},[`--${r}-box-shadow-x`]:F.scalingValue(S.left,t),[`--${r}-box-shadow-y`]:F.scalingValue(S.top,t),[`--${r}-box-shadow-blur`]:F.scalingValue(S.right,t),[`--${r}-box-shadow-spread`]:F.scalingValue(S.bottom,t),[`--${r}-inner-box-shadow-x`]:F.scalingValue(U.left,t),[`--${r}-inner-box-shadow-y`]:F.scalingValue(U.top,t),[`--${r}-inner-box-shadow-blur`]:F.scalingValue(U.right,t),[`--${r}-inner-box-shadow-spread`]:F.scalingValue(U.bottom,t),[`--${r}-backdrop-blur`]:_>0?`blur(${F.scalingValue(_,t)})`:void 0,paddingTop:F.scalingValue(k.top,t),paddingRight:F.scalingValue(k.right,t),paddingBottom:F.scalingValue(k.bottom,t),paddingLeft:F.scalingValue(k.left,t),borderRadius:F.scalingValue(f,t),borderWidth:F.scalingValue(P,t),...fe?{}:{justifyContent:gs[pe],textAlign:pe},...fe&&!ye?{gap:F.scalingValue(m,t)}:{},...Y?{width:F.scalingValue(O,t),height:F.scalingValue(oe,t)}:{minWidth:F.scalingValue(ie,t),minHeight:F.scalingValue(ae,t),...fe?{width:"100%"}:{}}};let Ce;const h={display:"inline-flex",alignItems:"center",justifyContent:fe?gs[pe]:gs[c==="a"?pe:"center"],gap:fe?F.scalingValue(m,t):void 0,width:"100%",height:"100%",...c==="a"?{textAlign:pe}:{}};if(c==="b"){const ne=()=>id(r,u,g>0?"fixed":"fill",100,g,t);Ce=ye?hs(r,ne,`${r}-icon-roll`,void 0,h):ne()}else if(c==="c"){const ne=()=>{const de=a.jsx("span",{className:`${r}-text`,style:{textAlign:pe},children:d}),z=id(r,u,x>0?"fixed":"fill",100,x,t);return v==="icon-text"?a.jsxs(a.Fragment,{children:[z,de]}):a.jsxs(a.Fragment,{children:[de,z]})};Ce=ye?hs(r,ne,`${r}-icon-text-roll`,void 0,h):ne()}else Ce=ye?hs(r,()=>d,`${r}-label-roll`,void 0,h):Pe?a.jsx("span",{className:`${r}-button-inner`,children:d}):d;const K=ce?ne=>bb(ne,r):void 0,Z=ce?ne=>Sb(ne,r):void 0;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),a.jsx("div",{className:`${r}-root`,style:N,children:a.jsx("div",{className:`${r}-wrapper ${le} ${Q}`.trim(),children:a.jsx("div",{className:`${r}-button ${be}`.trim(),style:xe,onMouseEnter:K,onMouseLeave:Z,role:"button",tabIndex:o||t&&!n?void 0:0,children:Ce})})})]})}const Cb=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
|
|
17979
18007
|
import { SvgImage } from '../helpers/SvgImage/SvgImage';
|
|
17980
18008
|
import { CommonComponentProps } from '../props';
|
|
17981
18009
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
|
|
@@ -18805,7 +18833,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18805
18833
|
pointer-events: auto;
|
|
18806
18834
|
flex-shrink: 0;
|
|
18807
18835
|
}
|
|
18808
|
-
`}const Hn=500,Zo=650,wn="cubic-bezier(0.22, 1, 0.36, 1)",kb=72,Eb=50,Mb=1e4,Ab=650,Fb=500;function Nb(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,r=e.top-t.top;return`translate(${o}px, ${r}px) scale(${n}, ${i})`}function cp(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=fa(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 _b(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?cp(i,n):null}function Hb(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 or(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 od(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return or(e,i,n)}const Wb=.03;function dp(e){return e.width*Wb}const hs={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Gr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function rd(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Ob(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Gs(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,c=o/r;if(l>c){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const d=r*l;return{width:d,height:r,left:i.left+(o-d)/2,top:i.top}}function Db(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Gs(e,t.width,t.height)}function zb(e,t){if(Oa(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 Bb(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 jb({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Oa(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function Fo(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:c}=n,d=dp(n);return t==="left"?{left:l+d-i,top:r,width:i,height:o}:{left:l+c-d,top:r,width:i,height:o}}function ba(e,t,n){const i=Fo(e,t,n);return{...i,left:2*i.left-e.left}}function Vb(e,t,n){const{left:i,width:o}=n,r=dp(n);return t==="left"?{left:i,top:e.top,width:r,height:e.height}:{left:i+o-r,top:e.top,width:r,height:e.height}}function up(e,t,n,i){const o=Fo(e,"left",i),r=Fo(e,"right",i),l=ba(e,"left",i),c=ba(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:r,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:c,end:r};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:r};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:r,end:c};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function Gb(e,t,n,i){const{start:o,end:r}=up(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function Xb(e,t,n){const i=Fo(e,t,n),o=ba(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Oa(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function qb({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const c=s.useRef(null);return s.useEffect(()=>{const d=c.current;return n==null||n(d??null),()=>{d==null||d.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:c,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:d=>d.stopPropagation(),style:o},e)})}function Xr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Oa(e)?a.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.url,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.url,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function Ub({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,canNavigate:d,lightboxEntries:u,entryIdx:p,layoutId:y,sourceRect:v,resolveCloseSourceRect:m,onClose:g,onPrev:x,onNext:b}){const k=s.useRef(null),f=s.useRef(null),S=s.useRef(null),O=s.useRef(new Map),[U,z]=s.useState(0),I=s.useRef(null),N=s.useRef(0),q=s.useRef(0),$=s.useRef("none"),L=s.useRef(!1),D=s.useRef(!1),_=s.useRef(!1),C=s.useRef(null),T=s.useRef(null),B=s.useRef(null),w=s.useRef(()=>{}),X=s.useRef(null),R=s.useRef(null),E=s.useRef(null),V=s.useRef(!1),[ie,re]=s.useState(null),[W,ae]=s.useState(hs),[A,le]=s.useState(0),[ee,xe]=s.useState("opening"),[Pe,ye]=s.useState(0),[pe,Y]=s.useState(0),[se,de]=s.useState(!1),[ve,$e]=s.useState(null),[ke,he]=s.useState(null),[Se,Ce]=s.useState(null),[h,K]=s.useState(!1),[Z,te]=s.useState(null),[me,j]=s.useState(!1),P=s.useRef(!1),[Q,ne]=s.useState(!1),[ue,G]=s.useState(!1),Ie=s.useRef(n),be=s.useRef(void 0),J=t[n],He=J?Oa(J):!1,We=pe!==0||se,ot=!l&&(!r||!!c),qe=d&&!l,tt=u.length>1,et=s.useCallback((H,Le)=>t.length<=1?null:t[(H+Le+t.length)%t.length]??null,[t]),je=tt?or(u,p,-1):et(n,-1),fe=tt?or(u,p,1):et(n,1),_e=ve===-1&&We?tt&&ke!==null?or(u,ke,-1):Se!==null?et(Se,-1):null:null,Be=ve===1&&We?tt&&ke!==null?or(u,ke,1):Se!==null?et(Se,1):null:null,Ze=_e&&_e.url!==(je==null?void 0:je.url)?_e:null,we=Be&&Be.url!==(fe==null?void 0:fe.url)?Be:null,Ne=je&&qe?(()=>{const H=tt?od(u,p,-1):t.length>2?et((n-1+t.length)%t.length,-1):null;return H&&H.url!==je.url?H:null})():null,Ue=fe&&qe?(()=>{const H=tt?od(u,p,1):t.length>2?et((n+1)%t.length,1):null;return H&&H.url!==fe.url?H:null})():null,Je=Ze??Ne,st=we??Ue,it=s.useCallback((H,Le,Ve)=>{if(!H||!Le||!Ve)return;const Fe=O.current,ft=Fe.get(H);(ft==null?void 0:ft.width)===Le&&(ft==null?void 0:ft.height)===Ve||(Fe.set(H,{width:Le,height:Ve}),z(Ht=>Ht+1))},[]),Oe=s.useCallback(H=>{if(!(H!=null&&H.url))return null;const Le=O.current.get(H.url);return Db(f.current,Le)},[U,A]),Ae=s.useCallback(()=>{if(!J)return;const H=Oe(J);if(H){re(H);return}const Le=f.current;Le&&re(rd(Le))},[J,Oe]),gt=s.useCallback(H=>{if(tt){const Le=u.length;he((p+H+Le)%Le),Ce(null);return}t.length>1&&(Ce((n+H+t.length)%t.length),he(null))},[tt,u.length,p,t.length,n]),ze=s.useCallback(H=>{_.current=H,de(H)},[]),De=s.useCallback(()=>{C.current!==null&&(window.clearTimeout(C.current),C.current=null)},[]),Xe=s.useCallback(()=>{De(),C.current=window.setTimeout(()=>{De(),ze(!1)},Zo+32)},[De,ze]),ct=s.useCallback(()=>{const H=k.current;if(!H){ae({left:0,top:0,width:typeof window<"u"?window.innerWidth:hs.width,height:typeof window<"u"?window.innerHeight:hs.height});return}const Le=H.getBoundingClientRect();ae({left:Le.left,top:Le.top,width:Le.width,height:Le.height})},[]),ge=s.useCallback((H,Le)=>{if(We){if(Q&&!se)return`translate(${pe}px, 0px)`;if(se&&ve!==null){const Ve=Oe(H);if(!Ve)return;const{x:Fe,y:ft}=Gb(Ve,Le,ve,W);return`translate(${Fe}px, ${ft}px)`}if(se)return"translate(0px, 0px)"}},[We,Q,se,pe,ve,W,Oe]),Ee=s.useCallback(()=>{const H=T.current;T.current=null,De(),ze(!1),$e(null),he(null),Ce(null),Y(0),ne(!1),L.current=!1,q.current=0,$.current="none",H===-1?x():H===1&&b()},[De,ze,x,b]),nt=s.useCallback(()=>{De(),C.current=window.setTimeout(()=>{T.current!==null&&Ee()},Zo+32)},[De,Ee]),pt=s.useCallback(()=>{De(),T.current=null,ze(!1),$e(null),he(null),Ce(null),Y(0),ne(!1),L.current=!1,q.current=0,$.current="none"},[De,ze]),Ge=s.useCallback(H=>{if(!(!qe||!ie)){if(_.current){if(T.current===H){B.current=H,Ee();return}pt()}De(),gt(H),T.current=H,$e(H),ze(!0),nt()}},[qe,ie,Ee,pt,De,gt,ze,nt]);w.current=Ge;const vt=s.useCallback(()=>{X.current=null,V.current=!1,R.current!==null&&(window.clearInterval(R.current),R.current=null),E.current!==null&&(window.clearTimeout(E.current),E.current=null)},[]),Rt=s.useCallback(H=>{R.current!==null&&window.clearInterval(R.current);const Le=V.current?Fb:Ab;R.current=window.setInterval(()=>{w.current(H)},Le)},[]),At=s.useCallback(H=>{X.current!==H&&(vt(),X.current=H,V.current=!1,w.current(H),Rt(H),E.current=window.setTimeout(()=>{E.current=null,X.current===H&&(V.current=!0,Rt(H))},Mb))},[vt,Rt]),wt=s.useCallback(()=>{const H=f.current;if(!H)return;const Le=J==null?void 0:J.url,Ve=Le?O.current.get(Le):void 0;if(Ve!=null&&Ve.width&&(Ve!=null&&Ve.height)){re(Gs(H,Ve.width,Ve.height));return}const Fe=S.current;if(Fe&&Le&&(Fe.src===Le||Fe.currentSrc===Le)){const{width:Ht,height:mt}=Ob(Fe);if(Ht&&mt){it(Le,Ht,mt),re(Gs(H,Ht,mt));return}}const ft=rd(H);!ft.width||!ft.height||re(ft)},[J==null?void 0:J.url,it]),Vt=s.useCallback(H=>{if(S.current=H,!!H){if(H instanceof HTMLVideoElement){H.readyState>=1&&H.videoWidth>0&&wt();return}H.complete&&H.naturalWidth>0&&wt()}},[wt]),jt=s.useCallback(()=>{ct(),wt(),le(H=>H+1)},[ct,wt]);s.useEffect(()=>{jt();const H=f.current,Le=k.current,Ve=new ResizeObserver(()=>jt());return H&&Ve.observe(H),Le&&Ve.observe(Le),window.addEventListener("resize",jt),()=>{Ve.disconnect(),window.removeEventListener("resize",jt)}},[jt,n,y]),s.useLayoutEffect(()=>{if(!J)return;const H=S.current;if(H){if(H instanceof HTMLImageElement&&H.complete&&H.naturalWidth>0){wt();return}H instanceof HTMLVideoElement&&H.readyState>=1&&H.videoWidth>0&&wt()}},[J==null?void 0:J.url,n,wt]),s.useEffect(()=>{Ae()},[Ae,U]),s.useEffect(()=>{const H=new Set,Le=[],Ve=Fe=>{!(Fe!=null&&Fe.url)||H.has(Fe.url)||(H.add(Fe.url),Le.push(Fe))};t.forEach(Ve),u.forEach(Fe=>Fe.items.forEach(Ve)),Le.forEach(Fe=>{O.current.has(Fe.url)||zb(Fe,it)})},[t,u,it]),s.useEffect(()=>{if(ee!=="opening"||!ie)return;if(!v){xe("open");return}K(!1);const H=requestAnimationFrame(()=>{requestAnimationFrame(()=>{K(!0),xe("open")})});return()=>cancelAnimationFrame(H)},[ee,ie,v]),s.useEffect(()=>{if(ee!=="closing")return;const H=setTimeout(()=>g(),Hn);return()=>clearTimeout(H)},[ee,g]),s.useEffect(()=>()=>{De()},[De]),s.useLayoutEffect(()=>{Ie.current===n&&be.current===(J==null?void 0:J.url)||(De(),T.current=null,$e(null),he(null),Ce(null),ye(0),Y(0),ze(!1),G(!1),ne(!1),N.current=0,q.current=0,$.current="none",L.current=!1,I.current=null,D.current=!1,S.current=null,Ae(),Ie.current=n,be.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,ze,De,Ae]),s.useLayoutEffect(()=>{const H=B.current;H!==null&&(B.current=null,requestAnimationFrame(()=>{w.current(H)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(ee==="opening"){P.current=!1,j(!1);return}if(ee!=="open"||P.current)return;if(!je&&!fe){P.current=!0;return}j(!1);const H=requestAnimationFrame(()=>{requestAnimationFrame(()=>{j(!0),P.current=!0})});return()=>cancelAnimationFrame(H)},[ee,je==null?void 0:je.url,fe==null?void 0:fe.url]),s.useEffect(()=>{if(ee!=="open")return;const H=()=>{const mt=Lt=>{Lt.stopPropagation(),Lt.preventDefault(),document.removeEventListener("click",mt,!0)};document.addEventListener("click",mt,!0)},Le=mt=>{const Lt=mt<0?1:-1;De(),gt(Lt),T.current=Lt,$e(Lt),ze(!0),nt()},Ve=mt=>{if(Math.abs(mt)>Eb&&qe){Le(mt);return}T.current=null,$e(null),he(null),Ce(null),ze(!0),Y(0),Xe()},Fe=mt=>{if(mt.touches.length!==1||_.current)return;const Lt=mt.touches[0];D.current=!0,I.current={x:Lt.clientX,y:Lt.clientY},$.current="none",q.current=0,L.current=!1},ft=mt=>{if(!I.current||mt.touches.length!==1||_.current)return;const Lt=mt.touches[0],Ut=Lt.clientX-I.current.x,Dt=Lt.clientY-I.current.y;if($.current==="none"){if(Math.abs(Ut)<10&&Math.abs(Dt)<10)return;if(Math.abs(Ut)>Math.abs(Dt)){if(!qe)return;$.current="horizontal"}else if(Dt>0){if(!ot)return;$.current="vertical"}else return}if($.current==="horizontal"){L.current=!0,ne(!0),q.current=Ut,Y(Ut),mt.preventDefault();return}$.current==="vertical"&&(L.current=!0,ne(!0),N.current=Dt,ye(Dt),mt.preventDefault())},Ht=()=>{if(!I.current)return;const mt=$.current,Lt=L.current;if(Lt&&mt==="horizontal")Ve(q.current),H();else if(Lt&&mt==="vertical"){const Ut=N.current;if(ot&&Ut>kb){const Dt=window.innerHeight;N.current=Dt,G(!0),ye(Dt),xe("closing")}else N.current=0,ye(0);H()}else mt==="horizontal"&&Math.abs(q.current)>0&&(Ve(q.current),H());I.current=null,$.current="none",q.current=0,L.current=!1,ne(!1)};return document.addEventListener("touchstart",Fe,{passive:!0}),document.addEventListener("touchmove",ft,{passive:!1}),document.addEventListener("touchend",Ht),document.addEventListener("touchcancel",Ht),()=>{document.removeEventListener("touchstart",Fe),document.removeEventListener("touchmove",ft),document.removeEventListener("touchend",Ht),document.removeEventListener("touchcancel",Ht)}},[ee,qe,ze,Xe,De,ot,nt,gt]);const Kt=s.useCallback(()=>{const H=(m==null?void 0:m())??v??null;H&&ie&&(te(H),K(!0)),xe("closing")},[m,v,ie]);s.useEffect(()=>{const H=Fe=>{if(Fe.key==="Escape"){if(r&&c||ee==="closing")return;vt(),Kt();return}if(Fe.key!=="ArrowLeft"&&Fe.key!=="ArrowRight"||ee!=="open"||!qe)return;Fe.preventDefault();const ft=Fe.key==="ArrowLeft"?-1:1;Fe.repeat&&X.current===ft||At(ft)},Le=Fe=>{if(Fe.key!=="ArrowLeft"&&Fe.key!=="ArrowRight")return;const ft=Fe.key==="ArrowLeft"?-1:1;X.current===ft&&vt()},Ve=()=>{vt()};return window.addEventListener("keydown",H),window.addEventListener("keyup",Le),window.addEventListener("blur",Ve),()=>{window.removeEventListener("keydown",H),window.removeEventListener("keyup",Le),window.removeEventListener("blur",Ve),vt()}},[ee,r,c,Kt,qe,At,vt]),s.useEffect(()=>{ee!=="open"&&vt()},[ee,vt]);const Yt=()=>{ee==="closing"||l||Kt()},kt=ee==="open",Bt=ee==="closing",rn=Pe>0?Math.max(0,1-Pe/500):1,xt=Pe>0?Math.max(.35,1-Pe/500):1,yt=s.useCallback(H=>{if(!(H.propertyName!=="transform"||!_.current)){if(T.current!==null){Ee();return}De(),ze(!1)}},[De,ze,Ee]),Me=ee==="closing"?Z??v:v,Qe=Me&&ie&&(ee==="opening"||Bt)?Nb(Me,ie):void 0,rt=We&&J?ge(J,"center"):Pe>0?`translateY(${Pe}px)`:Qe,dt=ie?Gr(ie,W):null,Pt=!!(Me&&ie),St=Pt&&(ee==="closing"||ee==="open"&&h),ht={position:"absolute",top:dt==null?void 0:dt.top,left:dt==null?void 0:dt.left,width:dt==null?void 0:dt.width,height:dt==null?void 0:dt.height,objectFit:"contain",transformOrigin:"top left",transform:rt,opacity:Pe>0?xt:Pt?1:ee==="opening"||Bt?0:1,transition:Q&&!se?"none":se?`transform ${Zo}ms ${wn}`:ue?`transform ${Hn}ms ${wn}, opacity ${Hn}ms ${wn}`:St?`transform ${Hn}ms ${wn}`:ee==="opening"||Bt?`opacity ${Hn}ms ${wn}`:"none",pointerEvents:He&&kt&&!We?"auto":"none",touchAction:He&&kt?"none":void 0,zIndex:1,overflow:He?"hidden":void 0},Wt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:kt&&!We?"auto":"none"},Tt=(H,Le,Ve="adjacent")=>{const Fe=Oe(H);if(!Fe)return{display:"none"};const ft=Ve==="far"?Le==="left"?"far-left":"far-right":Le==="left"?"left-adjacent":"right-adjacent",{start:Ht}=ve!==null?up(Fe,ft,ve,W):{start:Ve==="far"?ba(Fe,Le,W):Fo(Fe,Le,W)},mt=Gr(Ht,W),Lt=ge(H,ft),Ut=!We&&Ve==="adjacent"&&kt&&!me?Xb(Fe,Le,W):null,Dt=Ve==="far"&&We&&ve===(Le==="left"?-1:1),an=Q&&!se?!1:se,ln=Ve==="adjacent"&&kt&&me&&!We;return{position:"absolute",top:mt.top,left:mt.left,width:mt.width,height:mt.height,objectFit:"contain",transform:Lt??(Ut?`translate(${Ut.x}px, ${Ut.y}px)`:void 0),opacity:Ve==="far"?kt&&Dt?1:0:kt?1:0,transition:an?Ve==="far"?`transform ${Zo}ms ${wn}`:`transform ${Zo}ms ${wn}, opacity ${Hn}ms ${wn}`:ln?`transform ${Hn}ms ${wn}`:ee==="opening"||Bt?`opacity ${Hn}ms ${wn}`:"none",pointerEvents:"none",zIndex:1}},Ot=(H,Le)=>{const Ve=Oe(H);return Ve?Vb(Fo(Ve,Le,W),Le,W):null},Gt=H=>Le=>{if(!l){if(D.current){D.current=!1;return}Le.stopPropagation(),Ge(H)}},Mt=je?Ot(je,"left"):null,_t=fe?Ot(fe,"right"):null,Ft=Mt?Gr(Mt,W):null,ut=_t?Gr(_t,W):null;return a.jsxs("div",{ref:k,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:ee==="open"?"none":void 0},onClick:Yt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:kt?rn:0,transition:Q?"none":`opacity ${Hn}ms ${wn}`,pointerEvents:"none"}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[a.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:f,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:kt?1:0,transition:Q?"none":`opacity ${Hn}ms ${wn}`,pointerEvents:"none"},children:a.jsx(Xu,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,onClose:Yt})})]}),kt&&Je&&a.jsx(Xr,{media:Je,style:Tt(Je,"left","far"),onMeasure:it,onTransitionEnd:yt},`far-prev-${Je.url}`),kt&&je&&a.jsxs(a.Fragment,{children:[a.jsx(Xr,{media:je,style:Tt(je,"left"),onMeasure:it,onTransitionEnd:yt},`prev-${je.url}`),Ft&&a.jsx("div",{style:{position:"absolute",top:Ft.top,left:Ft.left,width:Ft.width,height:Ft.height,cursor:l||Q?"default":"pointer",pointerEvents:l||Q?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),kt&&fe&&a.jsxs(a.Fragment,{children:[a.jsx(Xr,{media:fe,style:Tt(fe,"right"),onMeasure:it,onTransitionEnd:yt},`next-${fe.url}`),ut&&a.jsx("div",{style:{position:"absolute",top:ut.top,left:ut.left,width:ut.width,height:ut.height,cursor:l||Q?"default":"pointer",pointerEvents:l||Q?"none":"auto",zIndex:3},onClick:Gt(1)})]}),kt&&st&&a.jsx(Xr,{media:st,style:Tt(st,"right","far"),onMeasure:it,onTransitionEnd:yt},`far-next-${st.url}`),ie&&J&&(He?a.jsx(qb,{src:J.url,phase:ee,onMediaElement:Vt,wrapperStyle:ht,videoStyle:Wt,onLoadedMetadata:wt,onTransitionEnd:yt},`${n}-${J.url}`):a.jsx("img",{ref:Vt,src:J.url,alt:J.name,onLoad:wt,onTransitionEnd:yt,style:ht},`${n}-${J.url}`))]})}const Kb=20,Yb=.18;function Zb(e){return`
|
|
18836
|
+
`}const Hn=500,Zo=650,wn="cubic-bezier(0.22, 1, 0.36, 1)",kb=72,Eb=50,Mb=1e4,Ab=650,Fb=500;function Nb(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,r=e.top-t.top;return`translate(${o}px, ${r}px) scale(${n}, ${i})`}function cp(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=ya(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 _b(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?cp(i,n):null}function Hb(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 or(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 od(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return or(e,i,n)}const Wb=.03;function dp(e){return e.width*Wb}const fs={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Gr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function rd(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Ob(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Gs(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,c=o/r;if(l>c){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const d=r*l;return{width:d,height:r,left:i.left+(o-d)/2,top:i.top}}function Db(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Gs(e,t.width,t.height)}function zb(e,t){if(Da(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 Bb(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 jb({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Da(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function Fo(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:c}=n,d=dp(n);return t==="left"?{left:l+d-i,top:r,width:i,height:o}:{left:l+c-d,top:r,width:i,height:o}}function Sa(e,t,n){const i=Fo(e,t,n);return{...i,left:2*i.left-e.left}}function Vb(e,t,n){const{left:i,width:o}=n,r=dp(n);return t==="left"?{left:i,top:e.top,width:r,height:e.height}:{left:i+o-r,top:e.top,width:r,height:e.height}}function up(e,t,n,i){const o=Fo(e,"left",i),r=Fo(e,"right",i),l=Sa(e,"left",i),c=Sa(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:r,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:c,end:r};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:r};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:r,end:c};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function Gb(e,t,n,i){const{start:o,end:r}=up(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function Xb(e,t,n){const i=Fo(e,t,n),o=Sa(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Da(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function qb({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const c=s.useRef(null);return s.useEffect(()=>{const d=c.current;return n==null||n(d??null),()=>{d==null||d.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:c,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:d=>d.stopPropagation(),style:o},e)})}function Xr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Da(e)?a.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.url,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.url,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function Ub({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,canNavigate:d,lightboxEntries:u,entryIdx:p,layoutId:y,sourceRect:v,resolveCloseSourceRect:m,onClose:g,onPrev:x,onNext:b}){const k=s.useRef(null),f=s.useRef(null),S=s.useRef(null),W=s.useRef(new Map),[U,B]=s.useState(0),P=s.useRef(null),_=s.useRef(0),G=s.useRef(0),$=s.useRef("none"),L=s.useRef(!1),D=s.useRef(!1),E=s.useRef(!1),T=s.useRef(null),C=s.useRef(null),V=s.useRef(null),w=s.useRef(()=>{}),q=s.useRef(null),I=s.useRef(null),A=s.useRef(null),j=s.useRef(!1),[ie,ae]=s.useState(null),[O,oe]=s.useState(fs),[N,le]=s.useState(0),[Q,be]=s.useState("opening"),[Pe,ye]=s.useState(0),[ce,Y]=s.useState(0),[se,pe]=s.useState(!1),[fe,we]=s.useState(null),[Re,ge]=s.useState(null),[xe,Ce]=s.useState(null),[h,K]=s.useState(!1),[Z,ne]=s.useState(null),[de,z]=s.useState(!1),R=s.useRef(!1),[ee,te]=s.useState(!1),[me,X]=s.useState(!1),Ie=s.useRef(n),Se=s.useRef(void 0),J=t[n],He=J?Da(J):!1,We=ce!==0||se,ot=!l&&(!r||!!c),qe=d&&!l,tt=u.length>1,et=s.useCallback((H,Le)=>t.length<=1?null:t[(H+Le+t.length)%t.length]??null,[t]),Ge=tt?or(u,p,-1):et(n,-1),ve=tt?or(u,p,1):et(n,1),_e=fe===-1&&We?tt&&Re!==null?or(u,Re,-1):xe!==null?et(xe,-1):null:null,Be=fe===1&&We?tt&&Re!==null?or(u,Re,1):xe!==null?et(xe,1):null:null,Ze=_e&&_e.url!==(Ge==null?void 0:Ge.url)?_e:null,$e=Be&&Be.url!==(ve==null?void 0:ve.url)?Be:null,Ne=Ge&&qe?(()=>{const H=tt?od(u,p,-1):t.length>2?et((n-1+t.length)%t.length,-1):null;return H&&H.url!==Ge.url?H:null})():null,Ue=ve&&qe?(()=>{const H=tt?od(u,p,1):t.length>2?et((n+1)%t.length,1):null;return H&&H.url!==ve.url?H:null})():null,Je=Ze??Ne,st=$e??Ue,it=s.useCallback((H,Le,je)=>{if(!H||!Le||!je)return;const Fe=W.current,ft=Fe.get(H);(ft==null?void 0:ft.width)===Le&&(ft==null?void 0:ft.height)===je||(Fe.set(H,{width:Le,height:je}),B(Ht=>Ht+1))},[]),Oe=s.useCallback(H=>{if(!(H!=null&&H.url))return null;const Le=W.current.get(H.url);return Db(f.current,Le)},[U,N]),Ae=s.useCallback(()=>{if(!J)return;const H=Oe(J);if(H){ae(H);return}const Le=f.current;Le&&ae(rd(Le))},[J,Oe]),gt=s.useCallback(H=>{if(tt){const Le=u.length;ge((p+H+Le)%Le),Ce(null);return}t.length>1&&(Ce((n+H+t.length)%t.length),ge(null))},[tt,u.length,p,t.length,n]),ze=s.useCallback(H=>{E.current=H,pe(H)},[]),De=s.useCallback(()=>{T.current!==null&&(window.clearTimeout(T.current),T.current=null)},[]),Xe=s.useCallback(()=>{De(),T.current=window.setTimeout(()=>{De(),ze(!1)},Zo+32)},[De,ze]),ct=s.useCallback(()=>{const H=k.current;if(!H){oe({left:0,top:0,width:typeof window<"u"?window.innerWidth:fs.width,height:typeof window<"u"?window.innerHeight:fs.height});return}const Le=H.getBoundingClientRect();oe({left:Le.left,top:Le.top,width:Le.width,height:Le.height})},[]),he=s.useCallback((H,Le)=>{if(We){if(ee&&!se)return`translate(${ce}px, 0px)`;if(se&&fe!==null){const je=Oe(H);if(!je)return;const{x:Fe,y:ft}=Gb(je,Le,fe,O);return`translate(${Fe}px, ${ft}px)`}if(se)return"translate(0px, 0px)"}},[We,ee,se,ce,fe,O,Oe]),Ee=s.useCallback(()=>{const H=C.current;C.current=null,De(),ze(!1),we(null),ge(null),Ce(null),Y(0),te(!1),L.current=!1,G.current=0,$.current="none",H===-1?x():H===1&&b()},[De,ze,x,b]),nt=s.useCallback(()=>{De(),T.current=window.setTimeout(()=>{C.current!==null&&Ee()},Zo+32)},[De,Ee]),pt=s.useCallback(()=>{De(),C.current=null,ze(!1),we(null),ge(null),Ce(null),Y(0),te(!1),L.current=!1,G.current=0,$.current="none"},[De,ze]),Ve=s.useCallback(H=>{if(!(!qe||!ie)){if(E.current){if(C.current===H){V.current=H,Ee();return}pt()}De(),gt(H),C.current=H,we(H),ze(!0),nt()}},[qe,ie,Ee,pt,De,gt,ze,nt]);w.current=Ve;const vt=s.useCallback(()=>{q.current=null,j.current=!1,I.current!==null&&(window.clearInterval(I.current),I.current=null),A.current!==null&&(window.clearTimeout(A.current),A.current=null)},[]),Rt=s.useCallback(H=>{I.current!==null&&window.clearInterval(I.current);const Le=j.current?Fb:Ab;I.current=window.setInterval(()=>{w.current(H)},Le)},[]),At=s.useCallback(H=>{q.current!==H&&(vt(),q.current=H,j.current=!1,w.current(H),Rt(H),A.current=window.setTimeout(()=>{A.current=null,q.current===H&&(j.current=!0,Rt(H))},Mb))},[vt,Rt]),wt=s.useCallback(()=>{const H=f.current;if(!H)return;const Le=J==null?void 0:J.url,je=Le?W.current.get(Le):void 0;if(je!=null&&je.width&&(je!=null&&je.height)){ae(Gs(H,je.width,je.height));return}const Fe=S.current;if(Fe&&Le&&(Fe.src===Le||Fe.currentSrc===Le)){const{width:Ht,height:mt}=Ob(Fe);if(Ht&&mt){it(Le,Ht,mt),ae(Gs(H,Ht,mt));return}}const ft=rd(H);!ft.width||!ft.height||ae(ft)},[J==null?void 0:J.url,it]),Vt=s.useCallback(H=>{if(S.current=H,!!H){if(H instanceof HTMLVideoElement){H.readyState>=1&&H.videoWidth>0&&wt();return}H.complete&&H.naturalWidth>0&&wt()}},[wt]),jt=s.useCallback(()=>{ct(),wt(),le(H=>H+1)},[ct,wt]);s.useEffect(()=>{jt();const H=f.current,Le=k.current,je=new ResizeObserver(()=>jt());return H&&je.observe(H),Le&&je.observe(Le),window.addEventListener("resize",jt),()=>{je.disconnect(),window.removeEventListener("resize",jt)}},[jt,n,y]),s.useLayoutEffect(()=>{if(!J)return;const H=S.current;if(H){if(H instanceof HTMLImageElement&&H.complete&&H.naturalWidth>0){wt();return}H instanceof HTMLVideoElement&&H.readyState>=1&&H.videoWidth>0&&wt()}},[J==null?void 0:J.url,n,wt]),s.useEffect(()=>{Ae()},[Ae,U]),s.useEffect(()=>{const H=new Set,Le=[],je=Fe=>{!(Fe!=null&&Fe.url)||H.has(Fe.url)||(H.add(Fe.url),Le.push(Fe))};t.forEach(je),u.forEach(Fe=>Fe.items.forEach(je)),Le.forEach(Fe=>{W.current.has(Fe.url)||zb(Fe,it)})},[t,u,it]),s.useEffect(()=>{if(Q!=="opening"||!ie)return;if(!v){be("open");return}K(!1);const H=requestAnimationFrame(()=>{requestAnimationFrame(()=>{K(!0),be("open")})});return()=>cancelAnimationFrame(H)},[Q,ie,v]),s.useEffect(()=>{if(Q!=="closing")return;const H=setTimeout(()=>g(),Hn);return()=>clearTimeout(H)},[Q,g]),s.useEffect(()=>()=>{De()},[De]),s.useLayoutEffect(()=>{Ie.current===n&&Se.current===(J==null?void 0:J.url)||(De(),C.current=null,we(null),ge(null),Ce(null),ye(0),Y(0),ze(!1),X(!1),te(!1),_.current=0,G.current=0,$.current="none",L.current=!1,P.current=null,D.current=!1,S.current=null,Ae(),Ie.current=n,Se.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,ze,De,Ae]),s.useLayoutEffect(()=>{const H=V.current;H!==null&&(V.current=null,requestAnimationFrame(()=>{w.current(H)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(Q==="opening"){R.current=!1,z(!1);return}if(Q!=="open"||R.current)return;if(!Ge&&!ve){R.current=!0;return}z(!1);const H=requestAnimationFrame(()=>{requestAnimationFrame(()=>{z(!0),R.current=!0})});return()=>cancelAnimationFrame(H)},[Q,Ge==null?void 0:Ge.url,ve==null?void 0:ve.url]),s.useEffect(()=>{if(Q!=="open")return;const H=()=>{const mt=Lt=>{Lt.stopPropagation(),Lt.preventDefault(),document.removeEventListener("click",mt,!0)};document.addEventListener("click",mt,!0)},Le=mt=>{const Lt=mt<0?1:-1;De(),gt(Lt),C.current=Lt,we(Lt),ze(!0),nt()},je=mt=>{if(Math.abs(mt)>Eb&&qe){Le(mt);return}C.current=null,we(null),ge(null),Ce(null),ze(!0),Y(0),Xe()},Fe=mt=>{if(mt.touches.length!==1||E.current)return;const Lt=mt.touches[0];D.current=!0,P.current={x:Lt.clientX,y:Lt.clientY},$.current="none",G.current=0,L.current=!1},ft=mt=>{if(!P.current||mt.touches.length!==1||E.current)return;const Lt=mt.touches[0],Ut=Lt.clientX-P.current.x,Dt=Lt.clientY-P.current.y;if($.current==="none"){if(Math.abs(Ut)<10&&Math.abs(Dt)<10)return;if(Math.abs(Ut)>Math.abs(Dt)){if(!qe)return;$.current="horizontal"}else if(Dt>0){if(!ot)return;$.current="vertical"}else return}if($.current==="horizontal"){L.current=!0,te(!0),G.current=Ut,Y(Ut),mt.preventDefault();return}$.current==="vertical"&&(L.current=!0,te(!0),_.current=Dt,ye(Dt),mt.preventDefault())},Ht=()=>{if(!P.current)return;const mt=$.current,Lt=L.current;if(Lt&&mt==="horizontal")je(G.current),H();else if(Lt&&mt==="vertical"){const Ut=_.current;if(ot&&Ut>kb){const Dt=window.innerHeight;_.current=Dt,X(!0),ye(Dt),be("closing")}else _.current=0,ye(0);H()}else mt==="horizontal"&&Math.abs(G.current)>0&&(je(G.current),H());P.current=null,$.current="none",G.current=0,L.current=!1,te(!1)};return document.addEventListener("touchstart",Fe,{passive:!0}),document.addEventListener("touchmove",ft,{passive:!1}),document.addEventListener("touchend",Ht),document.addEventListener("touchcancel",Ht),()=>{document.removeEventListener("touchstart",Fe),document.removeEventListener("touchmove",ft),document.removeEventListener("touchend",Ht),document.removeEventListener("touchcancel",Ht)}},[Q,qe,ze,Xe,De,ot,nt,gt]);const Kt=s.useCallback(()=>{const H=(m==null?void 0:m())??v??null;H&&ie&&(ne(H),K(!0)),be("closing")},[m,v,ie]);s.useEffect(()=>{const H=Fe=>{if(Fe.key==="Escape"){if(r&&c||Q==="closing")return;vt(),Kt();return}if(Fe.key!=="ArrowLeft"&&Fe.key!=="ArrowRight"||Q!=="open"||!qe)return;Fe.preventDefault();const ft=Fe.key==="ArrowLeft"?-1:1;Fe.repeat&&q.current===ft||At(ft)},Le=Fe=>{if(Fe.key!=="ArrowLeft"&&Fe.key!=="ArrowRight")return;const ft=Fe.key==="ArrowLeft"?-1:1;q.current===ft&&vt()},je=()=>{vt()};return window.addEventListener("keydown",H),window.addEventListener("keyup",Le),window.addEventListener("blur",je),()=>{window.removeEventListener("keydown",H),window.removeEventListener("keyup",Le),window.removeEventListener("blur",je),vt()}},[Q,r,c,Kt,qe,At,vt]),s.useEffect(()=>{Q!=="open"&&vt()},[Q,vt]);const Yt=()=>{Q==="closing"||l||Kt()},kt=Q==="open",Bt=Q==="closing",rn=Pe>0?Math.max(0,1-Pe/500):1,xt=Pe>0?Math.max(.35,1-Pe/500):1,yt=s.useCallback(H=>{if(!(H.propertyName!=="transform"||!E.current)){if(C.current!==null){Ee();return}De(),ze(!1)}},[De,ze,Ee]),Me=Q==="closing"?Z??v:v,Qe=Me&&ie&&(Q==="opening"||Bt)?Nb(Me,ie):void 0,rt=We&&J?he(J,"center"):Pe>0?`translateY(${Pe}px)`:Qe,dt=ie?Gr(ie,O):null,Pt=!!(Me&&ie),St=Pt&&(Q==="closing"||Q==="open"&&h),ht={position:"absolute",top:dt==null?void 0:dt.top,left:dt==null?void 0:dt.left,width:dt==null?void 0:dt.width,height:dt==null?void 0:dt.height,objectFit:"contain",transformOrigin:"top left",transform:rt,opacity:Pe>0?xt:Pt?1:Q==="opening"||Bt?0:1,transition:ee&&!se?"none":se?`transform ${Zo}ms ${wn}`:me?`transform ${Hn}ms ${wn}, opacity ${Hn}ms ${wn}`:St?`transform ${Hn}ms ${wn}`:Q==="opening"||Bt?`opacity ${Hn}ms ${wn}`:"none",pointerEvents:He&&kt&&!We?"auto":"none",touchAction:He&&kt?"none":void 0,zIndex:1,overflow:He?"hidden":void 0},Wt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:kt&&!We?"auto":"none"},Tt=(H,Le,je="adjacent")=>{const Fe=Oe(H);if(!Fe)return{display:"none"};const ft=je==="far"?Le==="left"?"far-left":"far-right":Le==="left"?"left-adjacent":"right-adjacent",{start:Ht}=fe!==null?up(Fe,ft,fe,O):{start:je==="far"?Sa(Fe,Le,O):Fo(Fe,Le,O)},mt=Gr(Ht,O),Lt=he(H,ft),Ut=!We&&je==="adjacent"&&kt&&!de?Xb(Fe,Le,O):null,Dt=je==="far"&&We&&fe===(Le==="left"?-1:1),an=ee&&!se?!1:se,ln=je==="adjacent"&&kt&&de&&!We;return{position:"absolute",top:mt.top,left:mt.left,width:mt.width,height:mt.height,objectFit:"contain",transform:Lt??(Ut?`translate(${Ut.x}px, ${Ut.y}px)`:void 0),opacity:je==="far"?kt&&Dt?1:0:kt?1:0,transition:an?je==="far"?`transform ${Zo}ms ${wn}`:`transform ${Zo}ms ${wn}, opacity ${Hn}ms ${wn}`:ln?`transform ${Hn}ms ${wn}`:Q==="opening"||Bt?`opacity ${Hn}ms ${wn}`:"none",pointerEvents:"none",zIndex:1}},Ot=(H,Le)=>{const je=Oe(H);return je?Vb(Fo(je,Le,O),Le,O):null},Gt=H=>Le=>{if(!l){if(D.current){D.current=!1;return}Le.stopPropagation(),Ve(H)}},Mt=Ge?Ot(Ge,"left"):null,_t=ve?Ot(ve,"right"):null,Ft=Mt?Gr(Mt,O):null,ut=_t?Gr(_t,O):null;return a.jsxs("div",{ref:k,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:Q==="open"?"none":void 0},onClick:Yt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:kt?rn:0,transition:ee?"none":`opacity ${Hn}ms ${wn}`,pointerEvents:"none"}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[a.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:f,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:kt?1:0,transition:ee?"none":`opacity ${Hn}ms ${wn}`,pointerEvents:"none"},children:a.jsx(Xu,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,onClose:Yt})})]}),kt&&Je&&a.jsx(Xr,{media:Je,style:Tt(Je,"left","far"),onMeasure:it,onTransitionEnd:yt},`far-prev-${Je.url}`),kt&&Ge&&a.jsxs(a.Fragment,{children:[a.jsx(Xr,{media:Ge,style:Tt(Ge,"left"),onMeasure:it,onTransitionEnd:yt},`prev-${Ge.url}`),Ft&&a.jsx("div",{style:{position:"absolute",top:Ft.top,left:Ft.left,width:Ft.width,height:Ft.height,cursor:l||ee?"default":"pointer",pointerEvents:l||ee?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),kt&&ve&&a.jsxs(a.Fragment,{children:[a.jsx(Xr,{media:ve,style:Tt(ve,"right"),onMeasure:it,onTransitionEnd:yt},`next-${ve.url}`),ut&&a.jsx("div",{style:{position:"absolute",top:ut.top,left:ut.left,width:ut.width,height:ut.height,cursor:l||ee?"default":"pointer",pointerEvents:l||ee?"none":"auto",zIndex:3},onClick:Gt(1)})]}),kt&&st&&a.jsx(Xr,{media:st,style:Tt(st,"right","far"),onMeasure:it,onTransitionEnd:yt},`far-next-${st.url}`),ie&&J&&(He?a.jsx(qb,{src:J.url,phase:Q,onMediaElement:Vt,wrapperStyle:ht,videoStyle:Wt,onLoadedMetadata:wt,onTransitionEnd:yt},`${n}-${J.url}`):a.jsx("img",{ref:Vt,src:J.url,alt:J.name,onLoad:wt,onTransitionEnd:yt,style:ht},`${n}-${J.url}`))]})}const Kb=20,Yb=.18;function Zb(e){return`
|
|
18809
18837
|
.${e}-wrapper {
|
|
18810
18838
|
box-sizing: border-box;
|
|
18811
18839
|
max-width: 100%;
|
|
@@ -18893,7 +18921,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18893
18921
|
pointer-events: auto;
|
|
18894
18922
|
}
|
|
18895
18923
|
${Rb(e)}
|
|
18896
|
-
`}function Jb(e){const{imageDisplay:t}=e??{},n=(t==null?void 0:t.ratioValue)??"1:1",i=(t==null?void 0:t.reversed)??!1,[o,r]=n.split(":").map(Number),l=i?r:o,c=i?o:r;return c>0?l/c:1}function Qb(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 eS(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:F.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:F.scalingValue(i*Yb,n??!1),[`--${t}-image-aspect`]:Jb(e)}}function tS(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 Qt(n,t)}function nS(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 iS(e,t,n,i,o,r){if(!(!e||!t))return l=>{var d;const c=((d=l.currentTarget.closest(`.${i}-item`))==null?void 0:d.querySelector(`[data-waterfall-index="${n}"]`))??(l.currentTarget instanceof HTMLImageElement||l.currentTarget instanceof HTMLVideoElement?l.currentTarget:null);r(n,c?cp(c,o):void 0)}}function oS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:c}=F.useScopedStyles(),d=s.useMemo(()=>Zb(c),[c]),u=t??[],p=(e==null?void 0:e.type)??"a",y=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,v=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,m=F.scalingValue(v,n??!1),g=`max(${m}, ${Kb}px)`,{objectFitMode:x,imageStyle:b}=nS(e),k=tS(e,n),f=s.useRef(null),[S,
|
|
18924
|
+
`}function Jb(e){const{imageDisplay:t}=e??{},n=(t==null?void 0:t.ratioValue)??"1:1",i=(t==null?void 0:t.reversed)??!1,[o,r]=n.split(":").map(Number),l=i?r:o,c=i?o:r;return c>0?l/c:1}function Qb(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 eS(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:F.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:F.scalingValue(i*Yb,n??!1),[`--${t}-image-aspect`]:Jb(e)}}function tS(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 Qt(n,t)}function nS(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 iS(e,t,n,i,o,r){if(!(!e||!t))return l=>{var d;const c=((d=l.currentTarget.closest(`.${i}-item`))==null?void 0:d.querySelector(`[data-waterfall-index="${n}"]`))??(l.currentTarget instanceof HTMLImageElement||l.currentTarget instanceof HTMLVideoElement?l.currentTarget:null);r(n,c?cp(c,o):void 0)}}function oS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:c}=F.useScopedStyles(),d=s.useMemo(()=>Zb(c),[c]),u=t??[],p=(e==null?void 0:e.type)??"a",y=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,v=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,m=F.scalingValue(v,n??!1),g=`max(${m}, ${Kb}px)`,{objectFitMode:x,imageStyle:b}=nS(e),k=tS(e,n),f=s.useRef(null),[S,W]=s.useState(!1),[U,B]=s.useState([]),[P,_]=s.useState(0),[G,$]=s.useState(0),[L,D]=s.useState(null),[E,T]=s.useState({title1:"",title2:"",title3:""}),C=(!n||i)&&!S,V=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},w=V.sizeType??"none",q=C&&w!=="none"?`${c}-item-image-hover-${w}`:void 0,I=(V.value??120)/100,A=s.useCallback(ce=>{!ce||w!=="scale"||(ce.style.transformOrigin=ef(ce))},[w]),j=s.useCallback(ce=>{if(ce){if(x==="contain"){const Y=Qb(ce);if(Y){const se=ce.closest(`.${c}-item-image`);se instanceof HTMLElement&&se.style.setProperty(`--${c}-item-media-aspect`,String(Y))}}A(ce)}},[c,A,x]),ie={width:F.scalingValue(y,n??!1),...k,...eS(e,c,n),[`--${c}-image-hover-scale`]:String(I)},ae=(()=>{const ce={},Y=f.current?getComputedStyle(f.current).getPropertyValue("--cntrl-article-width").trim():"";return Y&&(ce["--cntrl-article-width"]=Y),ce})(),O=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),oe=s.useMemo(()=>Hb(u),[u]),N=s.useMemo(()=>Bb(u),[u]),le=(ce,Y)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const se=oe.findIndex(fe=>fe.gridIndex===ce);if(se<0)return;const pe=oe[se];$(se),B(pe.items),_(0),T(pe.entry),D(Y??null),W(!0)},Q=s.useCallback(()=>{W(!1),D(null)},[]),be=s.useCallback(()=>{const ce=oe[G];return!ce||!f.current?L:_b(f.current,ce.gridIndex,x)??L},[oe,G,L,x]),Pe=s.useCallback(ce=>{if(oe.length>1){const Y=oe.length,se=(G+ce+Y)%Y,pe=oe[se];$(se),B(pe.items),_(0),T(pe.entry);return}_(Y=>(Y+ce+U.length)%U.length)},[oe,G,U.length]),ye=oe.length>1||U.length>1;return s.useEffect(()=>{if(!S||typeof document>"u")return;const ce=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ce}},[S]),s.useEffect(()=>{!n||o||i||W(!1)},[n,o,i]),s.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&W(!1)},[e==null?void 0:e.lightbox]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx(jb,{mediaList:N}),a.jsx("div",{ref:f,className:`${c}-wrapper ${c}-type-${p}`,style:ie,children:u.map((ce,Y)=>{var fe,we;const se=!!((fe=ce.image)!=null&&fe.url),pe=iS(!!O,se,Y,c,x,le);return a.jsxs("div",{className:`${c}-item`,children:[ce.title?a.jsx("span",{className:`${c}-item-title`,onClick:pe,style:pe?{cursor:"pointer"}:void 0,children:ce.title}):null,(we=ce.image)!=null&&we.url?a.jsx("span",{className:[`${c}-item-image`,x==="contain"?`${c}-item-image-fit`:void 0,q].filter(Boolean).join(" "),children:ce.image.type==="video"?a.jsx("video",{ref:j,src:ce.image.url,"data-waterfall-index":Y,style:b,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:pe,onLoadedData:Re=>j(Re.currentTarget)}):a.jsx("img",{ref:j,src:ce.image.url,alt:ce.image.name??"","data-waterfall-index":Y,style:b,onClick:pe,onLoad:Re=>j(Re.currentTarget)})}):null,Y<u.length-1&&a.jsx("div",{className:`${c}-item-gap-host`,style:{width:m},children:o&&!S&&a.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:g,height:"100%"}})})]},Y)})}),S&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const ce=(l?document.getElementById(l):null)??document.body;return Gn.createPortal(a.jsx("div",{style:ae,"data-selection":"none",children:a.jsx(Ub,{prefix:c,items:U,index:P,entry:E,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ye,lightboxEntries:oe,entryIdx:G,layoutId:r,sourceRect:L,resolveCloseSourceRect:be,onClose:Q,onPrev:()=>Pe(-1),onNext:()=>Pe(1)})}),ce)})()]})}const rS=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
18897
18925
|
import type React from 'react';
|
|
18898
18926
|
import { createPortal } from 'react-dom';
|
|
18899
18927
|
import { CommonComponentProps } from '../props';
|
|
@@ -19407,7 +19435,7 @@ export function Waterfall({
|
|
|
19407
19435
|
</>
|
|
19408
19436
|
);
|
|
19409
19437
|
}
|
|
19410
|
-
`,aS="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>'),yi={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 sS(e){const t={};return t[bt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[bt(e,"fontSettings")]={...yi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[bt(e,"fontSize")]={...yi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[bt(e,"lineHeight")]={...yi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[bt(e,"letterSpacing")]={...yi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[bt(e,"wordSpacing")]={...yi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[bt(e,"textAlign")]={...yi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[bt(e,"textAppearance")]={...yi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const No=Li.filter(e=>e!=="count"),lS=No.reduce((e,t)=>({...e,...sS(t)}),{}),cS=No.reduce((e,t)=>({...e,[bt(t,"fontFamily")]:"Arial",[bt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[bt(t,"letterSpacing")]:0,[bt(t,"wordSpacing")]:0,[bt(t,"textAlign")]:"left",[bt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function fs(e){return No.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[bt(n,"fontSize")]=i),o!==void 0&&(t[bt(n,"lineHeight")]=o),t},{})}const dS={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(No.map(e=>[kl[e],El(e)]))},qr={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},uS=[{title:"Salton Sea from Above",...qr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...qr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...qr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...qr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],pS={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:uS},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:{...yi.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"]}}},...lS},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:aS,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...cS},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,...fs({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,...fs({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,...fs({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:[dS]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},mS={element:oS,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"},...No.map(e=>({path:`${bt(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...No.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${bt(t,"fontFamily")}`}),{})},schema:pS,sourceCode:rS},So=500,pp="cubic-bezier(0.25, 1, 0.5, 1)",gS=300,hS=5,fS=.15,yS=.4,vS=100,ro=100,ad={color:"#000000",hover:"#cccccc"},Jo={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},xS={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}},ys={offset:{x:0,y:0},linkColor:"#cccccc"},sd={sizeType:"drag",value:3},bS="left";function SS(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:bS,color:(e==null?void 0:e.titleColor)??"#000000"};return Qt(n,t)}function ao(e,t,n){return`${e}: ${F.scalingValue(t/1440,n)};`}function rr(e,t){return t<=0?0:(e%t+t)%t}function wS(e,t,n,i){if(!i)return{position:rr(e+t,n),hitBoundary:!1};const o=e+t;return o>=0&&o<=n+1?{position:o,hitBoundary:!1}:{position:t>0?n+1:0,hitBoundary:!0}}function $S(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function CS(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,y)=>{n.style.transform=`translate(${p}px, ${y}px)`;const v=n.getBoundingClientRect();return{x:v.left,y:v.top}},o=i(0,0),r=i(ro,0),l=i(0,ro);e.removeChild(n);const c={x:(r.x-o.x)/ro,y:(r.y-o.y)/ro},d={x:(l.x-o.x)/ro,y:(l.y-o.y)/ro},u=c.x*d.y-d.x*c.y;return{ex:c,ey:d,det:u}}function TS(e,t,n){const{ex:i,ey:o,det:r}=e;return{x:(t*o.y-n*o.x)/r,y:(i.x*n-i.y*t)/r}}function LS(e,t){return`
|
|
19438
|
+
`,aS="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>'),yi={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 sS(e){const t={};return t[bt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[bt(e,"fontSettings")]={...yi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[bt(e,"fontSize")]={...yi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[bt(e,"lineHeight")]={...yi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[bt(e,"letterSpacing")]={...yi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[bt(e,"wordSpacing")]={...yi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[bt(e,"textAlign")]={...yi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[bt(e,"textAppearance")]={...yi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const No=Li.filter(e=>e!=="count"),lS=No.reduce((e,t)=>({...e,...sS(t)}),{}),cS=No.reduce((e,t)=>({...e,[bt(t,"fontFamily")]:"Arial",[bt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[bt(t,"letterSpacing")]:0,[bt(t,"wordSpacing")]:0,[bt(t,"textAlign")]:"left",[bt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ys(e){return No.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[bt(n,"fontSize")]=i),o!==void 0&&(t[bt(n,"lineHeight")]=o),t},{})}const dS={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(No.map(e=>[kl[e],El(e)]))},qr={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},uS=[{title:"Salton Sea from Above",...qr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...qr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...qr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...qr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],pS={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:uS},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:{...yi.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"]}}},...lS},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:aS,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...cS},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,...ys({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,...ys({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,...ys({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:[dS]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},mS={element:oS,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"},...No.map(e=>({path:`${bt(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...No.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${bt(t,"fontFamily")}`}),{})},schema:pS,sourceCode:rS},So=500,pp="cubic-bezier(0.25, 1, 0.5, 1)",gS=300,hS=5,fS=.15,yS=.4,vS=100,ro=100,ad={color:"#000000",hover:"#cccccc"},Jo={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},xS={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}},vs={offset:{x:0,y:0},linkColor:"#cccccc"},sd={sizeType:"drag",value:3},bS="left";function SS(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:bS,color:(e==null?void 0:e.titleColor)??"#000000"};return Qt(n,t)}function ao(e,t,n){return`${e}: ${F.scalingValue(t/1440,n)};`}function rr(e,t){return t<=0?0:(e%t+t)%t}function wS(e,t,n,i){if(!i)return{position:rr(e+t,n),hitBoundary:!1};const o=e+t;return o>=0&&o<=n+1?{position:o,hitBoundary:!1}:{position:t>0?n+1:0,hitBoundary:!0}}function $S(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function CS(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,y)=>{n.style.transform=`translate(${p}px, ${y}px)`;const v=n.getBoundingClientRect();return{x:v.left,y:v.top}},o=i(0,0),r=i(ro,0),l=i(0,ro);e.removeChild(n);const c={x:(r.x-o.x)/ro,y:(r.y-o.y)/ro},d={x:(l.x-o.x)/ro,y:(l.y-o.y)/ro},u=c.x*d.y-d.x*c.y;return{ex:c,ey:d,det:u}}function TS(e,t,n){const{ex:i,ey:o,det:r}=e;return{x:(t*o.y-n*o.x)/r,y:(i.x*n-i.y*t)/r}}function LS(e,t){return`
|
|
19411
19439
|
.${e}-wrapper {
|
|
19412
19440
|
position: relative;
|
|
19413
19441
|
width: 100%;
|
|
@@ -19677,7 +19705,7 @@ export function Waterfall({
|
|
|
19677
19705
|
from { clip-path: inset(100% 0 0 0); }
|
|
19678
19706
|
to { clip-path: inset(0 0 0 0); }
|
|
19679
19707
|
}
|
|
19680
|
-
`}function PS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=F.useScopedStyles(),l=SS(e,n),c=t??[],d=c.length,u=(e==null?void 0:e.trigger)??sd,p=u.sizeType??"drag",y=u.value??sd.value,v=(e==null?void 0:e.direction)??"horizontal",m=(e==null?void 0:e.transition)??"slide",g=(e==null?void 0:e.nav)??"classic",x=(e==null?void 0:e.navSize)??"m",b=xS[x],k=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,f=fe=>F.scalingValue(fe*k,n),S=(e==null?void 0:e.show)??"always",O=(e==null?void 0:e.controls)??null,U=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,z=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,I=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,N=(e==null?void 0:e.controlsColor)??ad.color,q=(e==null?void 0:e.controlsHoverColor)??ad.hover,$=(e==null?void 0:e.navColor)??Jo.colors.inactive,L=(e==null?void 0:e.navPaginationColor)??Jo.colors.pagination,D=(e==null?void 0:e.navBackgroundColor)??Jo.colors.background,_=(e==null?void 0:e.linkColor)??ys.linkColor,C=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,T=v==="horizontal",B=p==="click",w=p==="drag",X=p==="auto"&&(!n||!!i),R=!n,E=m==="slide",V=g==="classic",ie=S!=="never"&&U>0,re=S==="on hover",W=F.scalingValue(U,n),ae={width:W,height:W,maxWidth:W},A=E&&d>1,[le,ee]=s.useState(0),[xe,Pe]=s.useState(A?1:0),[ye,pe]=s.useState(!1),[Y,se]=s.useState(!1),[de,ve]=s.useState(!1),[$e,ke]=s.useState(0),[he,Se]=s.useState(!1),[Ce,h]=s.useState(!1),K=s.useRef(!1),Z=s.useRef(xe);Z.current=xe;const te=s.useRef(null),me=s.useRef(0),j=s.useRef(null),P=s.useRef(null),Q=s.useRef(null),ne=s.useRef(null),ue=s.useCallback(fe=>{K.current=fe,pe(fe)},[]),G=s.useCallback(fe=>{if(d<2||fe===0)return;const _e=fe>0?1:-1,Be=Math.abs(fe);if(Se(!0),ue(!0),!E){ee(st=>rr(st+fe,d));return}let Ze=Z.current;const we=A&&(Ze===0||Ze===d+1),Ne=we?le+1:null;we&&(Ze=le+1);let Ue=Be;for(;Ue>0;){const st=wS(Ze,_e,d,A);if(Ze=st.position,Ue-=1,st.hitBoundary){me.current=Ue*_e;break}}const Je=Be-Ue;if(Je>0&&ee(st=>rr(st+Je*_e,d)),Z.current=Ze,Ne!==null){if(Z.current=Ne,Ze===Ne){se(!0),Pe(Ze);return}te.current=Ze,se(!0),Pe(Ne);return}se(!1),Pe(Ze)},[le,d,A,E,ue]),Ie=s.useCallback(fe=>{G(fe)},[G]),be=s.useCallback(fe=>{if(d<2)return;const _e=rr(fe,d);if(!(_e===le&&!K.current)&&(Se(!0),ue(!0),ee(_e),E)){const Be=_e+(A?1:0);te.current=null,me.current=0,Z.current=Be,se(!1),Pe(Be)}},[le,d,A,E,ue]);s.useEffect(()=>{if(!ye)return;const fe=window.setTimeout(()=>{if(A&&(xe===0||xe===d+1)){te.current=null,se(!0),Pe(le+1);return}ue(!1)},So);return()=>window.clearTimeout(fe)},[le,d,A,ye,ue,xe]),s.useEffect(()=>{if(!Y)return;let fe=0;const _e=requestAnimationFrame(()=>{fe=requestAnimationFrame(()=>{const Be=te.current;te.current=null;const Ze=me.current;if(me.current=0,se(!1),Be!==null){Z.current=Be,Pe(Be);return}if(Ze!==0){G(Ze);return}ue(!1)})});return()=>{cancelAnimationFrame(_e),cancelAnimationFrame(fe)}},[G,ue,Y]);const J=`${A}:${d}`,He=s.useRef(J);s.useEffect(()=>{if(He.current===J)return;He.current=J;const fe=d>0?Math.min(le,d-1):0;Q.current=null,ne.current=null,ve(!1),ke(0),ee(fe),se(!0),Pe(fe+(A?1:0))},[le,d,A,J]),s.useEffect(()=>{if(!he)return;const fe=window.setTimeout(()=>Se(!1),gS);return()=>window.clearTimeout(fe)},[he,le]),s.useEffect(()=>{if(!X||d<2)return;const fe=Math.max(y,.1)*1e3,_e=window.setInterval(()=>{R&&Ce||Ie(1)},fe);return()=>window.clearInterval(_e)},[y,d,Ie,X,Ce,R]);const We=s.useCallback(fe=>{const _e=Q.current;if(!_e||_e.pointerId!==fe.pointerId)return;Q.current=null,ne.current=null;const Be=j.current;if(Be!=null&&Be.hasPointerCapture(fe.pointerId)&&Be.releasePointerCapture(fe.pointerId),!_e.isActive){E&&ke(0);return}const we=!(fe.timeStamp-_e.lastTime>vS)&&Math.abs(_e.velocity)>yS,Ne=_e.size>0&&Math.abs(_e.offset-_e.baseOffset)>_e.size*fS;if(ve(!1),!we&&!Ne){ke(0);return}const Ue=Ne?_e.offset-_e.baseOffset:_e.velocity;let Je=1;Ne&&_e.size>0&&(Je=Math.max(1,Math.round(Math.abs(Ue)/_e.size))),ke(0),G(Ue<0?Je:-Je)},[G,E]);s.useEffect(()=>{const fe=_e=>{ne.current===null||_e.pointerId!==ne.current||We(_e)};return window.addEventListener("pointerup",fe),window.addEventListener("pointercancel",fe),()=>{window.removeEventListener("pointerup",fe),window.removeEventListener("pointercancel",fe)}},[We]);const ot=fe=>{const _e=j.current;if(!w||d<2||!_e||fe.pointerType==="mouse"&&fe.button!==0)return;te.current=null,me.current=0,K.current&&ue(!1);let Be=0;const Ze=P.current;if(E&&Ze){const we=T?Ze.offsetWidth:Ze.offsetHeight;if(we>0){const Ne=$S(Ze,T);let Ue=Z.current;A&&(Ue===0||Ue===d+1)?(Ue=le+1,Z.current=Ue,se(!0),Pe(Ue),Be=0):Be=Ne+Ue*we,ke(Be)}}_e.setPointerCapture(fe.pointerId),ne.current=fe.pointerId,Q.current={pointerId:fe.pointerId,startClientX:fe.clientX,startClientY:fe.clientY,axes:CS(_e,`${r}-axis-probe`),size:T?_e.offsetWidth:_e.offsetHeight,isActive:!1,baseOffset:Be,offset:Be,lastTime:fe.timeStamp,velocity:0}},qe=fe=>{const _e=Q.current;if(!_e||_e.pointerId!==fe.pointerId)return;if(fe.pointerType==="mouse"&&fe.buttons===0){We(fe);return}const Be=fe.clientX-_e.startClientX,Ze=fe.clientY-_e.startClientY,we=_e.axes?TS(_e.axes,Be,Ze):{x:Be,y:Ze},Ne=T?we.x:we.y,Ue=T?we.y:we.x,Je=_e.baseOffset+Ne;if(!_e.isActive){if(Math.max(Math.abs(Ne),Math.abs(Ue))<hS)return;if(Math.abs(Ue)>Math.abs(Ne)){const it=j.current;it!=null&&it.hasPointerCapture(_e.pointerId)&&it.releasePointerCapture(_e.pointerId),Q.current=null,ne.current=null,E&&ke(0);return}_e.isActive=!0,ve(!0)}const st=fe.timeStamp-_e.lastTime;st>0&&(_e.velocity=(Je-_e.offset)/st,_e.lastTime=fe.timeStamp),_e.offset=Je,E&&ke(Je)},tt=fe=>{We(fe)},et=T?`translate3d(calc(${-xe*100}% + ${$e}px), 0, 0)`:`translate3d(0, calc(${-xe*100}% + ${$e}px), 0)`,je=A?[c[d-1],...c,c[0]]:c;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:LS(r,n)}}),a.jsxs("div",{className:Ct(`${r}-wrapper`,{[`${r}-transition-reveal`]:m==="reveal",[`${r}-transition-reveal-vertical`]:m==="reveal"&&!T}),onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[a.jsxs("div",{className:`${r}-slider-inner`,style:{backgroundColor:"transparent"},children:[a.jsx("div",{ref:j,className:Ct(`${r}-track`,{[`${r}-track-draggable`]:w,[`${r}-track-draggable-vertical`]:w&&!T}),onPointerDown:ot,onPointerMove:qe,onPointerUp:tt,onPointerCancel:tt,onLostPointerCapture:fe=>{ne.current===fe.pointerId&&We(fe)},children:a.jsx("div",{ref:P,className:Ct(`${r}-list`,{[`${r}-list-slide`]:E,[`${r}-list-slide-vertical`]:E&&!T,[`${r}-list-fade`]:!E}),style:E?{transform:et,transition:de||Y?"none":`transform ${So}ms ${pp}`}:void 0,children:je.map((fe,_e)=>{const Be=A?rr(_e-1,d):_e,we=A&&(_e===0||_e===d+1)?`clone-${_e===0?"start":"end"}`:`slide-${Be}`;return a.jsx("div",{className:Ct(`${r}-slide`,{[`${r}-is-active`]:!E&&Be===le}),children:a.jsx("div",{className:`${r}-slider-item`,children:a.jsx("div",{className:`${r}-img-wrapper`,children:a.jsx("img",{className:Ct(`${r}-slider-image`,{[`${r}-contain`]:fe.image.objectFit==="contain",[`${r}-cover`]:fe.image.objectFit==="cover"}),src:fe.image.url,alt:fe.image.name??"",draggable:!1})})})},we)})})}),ie&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ct(`${r}-arrow`,{[`${r}-arrow-prev`]:T,[`${r}-arrow-prev-vertical`]:!T,[`${r}-hover-arrow`]:re}),style:{color:N,"--arrow-hover-color":q,...ae},children:a.jsxs("button",{onClick:fe=>{fe.stopPropagation(),Ie(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${F.scalingValue(z,n)}, ${F.scalingValue(I*(T?1:-1),n)}) rotate(${T?"0deg":"90deg"})`},children:[O&&a.jsx(mn,{url:O,fill:N,hoverFill:q,className:Ct(`${r}-arrow-img`,`${r}-mirror`),style:ae}),!O&&a.jsx(ld,{color:N,className:Ct(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:Ct(`${r}-arrow`,{[`${r}-arrow-next`]:T,[`${r}-arrow-next-vertical`]:!T,[`${r}-hover-arrow`]:re}),style:{color:N,"--arrow-hover-color":q,...ae},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:fe=>{fe.stopPropagation(),Ie(1)},style:{transform:`translate(${F.scalingValue(z*(T?-1:1),n)}, ${F.scalingValue(I,n)}) rotate(${T?"0deg":"90deg"})`},children:[O&&a.jsx(mn,{url:O,fill:N,hoverFill:q,className:`${r}-arrow-img`,style:ae}),!O&&a.jsx(ld,{color:N,className:Ct(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),B&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>Ie(1)}),V&&a.jsx("div",{className:Ct(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:T,[`${r}-pagination-inside-left`]:!T}),style:T?{bottom:f(b.inset)}:{left:f(b.inset)},children:a.jsx("div",{className:Ct(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!T,[`${r}-animate-dots`]:he}),style:{backgroundColor:D,gap:f(b.gapInactive-b.activeDot+b.dot),...T?{height:f(b.activeDot+b.paddingY*2),paddingTop:f(b.paddingY),paddingBottom:f(b.paddingY),paddingLeft:f(b.paddingActive),paddingRight:f(b.paddingActive)}:{width:f(b.activeDot+b.paddingY*2),paddingLeft:f(b.paddingY),paddingRight:f(b.paddingY),paddingTop:f(b.paddingActive),paddingBottom:f(b.paddingActive)},borderRadius:f(b.borderRadius),transform:`translate(${F.scalingValue(Jo.offset.x,n)}, ${F.scalingValue(Jo.offset.y,n)})`},children:c.map((fe,_e)=>{const Be=_e===le,Ze=Be?b.activeDot:b.dot;return a.jsx("button",{onClick:()=>be(_e),className:`${r}-pagination-item`,style:{width:f(b.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:Be?L:$,width:f(Ze)}})},_e)})},`${x}-${v}`)})]}),a.jsxs("div",{className:`${r}-caption-block`,children:[a.jsx("div",{"data-controls":o?"captionMarginTop":void 0,className:o?`${r}-control`:void 0,style:{height:F.scalingValue(C,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:c.map((fe,_e)=>a.jsx("div",{className:Ct(`${r}-caption-text`,{[`${r}-with-pointer-events`]:_e===le&&n,[`${r}-active`]:_e===le}),style:{...l,width:"max-content",transitionDuration:`${Math.round(So/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":_,"--link-hover-color":_,position:"relative",top:F.scalingValue(ys.offset.y,n),left:F.scalingValue(ys.offset.x,n)},children:a.jsx(Ki,{content:fe.imageCaption})})},_e))})]})]})]})}function ld({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const IS=`import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
19708
|
+
`}function PS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=F.useScopedStyles(),l=SS(e,n),c=t??[],d=c.length,u=(e==null?void 0:e.trigger)??sd,p=u.sizeType??"drag",y=u.value??sd.value,v=(e==null?void 0:e.direction)??"horizontal",m=(e==null?void 0:e.transition)??"slide",g=(e==null?void 0:e.nav)??"classic",x=(e==null?void 0:e.navSize)??"m",b=xS[x],k=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,f=ve=>F.scalingValue(ve*k,n),S=(e==null?void 0:e.show)??"always",W=(e==null?void 0:e.controls)??null,U=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,B=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,P=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,_=(e==null?void 0:e.controlsColor)??ad.color,G=(e==null?void 0:e.controlsHoverColor)??ad.hover,$=(e==null?void 0:e.navColor)??Jo.colors.inactive,L=(e==null?void 0:e.navPaginationColor)??Jo.colors.pagination,D=(e==null?void 0:e.navBackgroundColor)??Jo.colors.background,E=(e==null?void 0:e.linkColor)??vs.linkColor,T=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,C=v==="horizontal",V=p==="click",w=p==="drag",q=p==="auto"&&(!n||!!i),I=!n,A=m==="slide",j=g==="classic",ie=S!=="never"&&U>0,ae=S==="on hover",O=F.scalingValue(U,n),oe={width:O,height:O,maxWidth:O},N=A&&d>1,[le,Q]=s.useState(0),[be,Pe]=s.useState(N?1:0),[ye,ce]=s.useState(!1),[Y,se]=s.useState(!1),[pe,fe]=s.useState(!1),[we,Re]=s.useState(0),[ge,xe]=s.useState(!1),[Ce,h]=s.useState(!1),K=s.useRef(!1),Z=s.useRef(be);Z.current=be;const ne=s.useRef(null),de=s.useRef(0),z=s.useRef(null),R=s.useRef(null),ee=s.useRef(null),te=s.useRef(null),me=s.useCallback(ve=>{K.current=ve,ce(ve)},[]),X=s.useCallback(ve=>{if(d<2||ve===0)return;const _e=ve>0?1:-1,Be=Math.abs(ve);if(xe(!0),me(!0),!A){Q(st=>rr(st+ve,d));return}let Ze=Z.current;const $e=N&&(Ze===0||Ze===d+1),Ne=$e?le+1:null;$e&&(Ze=le+1);let Ue=Be;for(;Ue>0;){const st=wS(Ze,_e,d,N);if(Ze=st.position,Ue-=1,st.hitBoundary){de.current=Ue*_e;break}}const Je=Be-Ue;if(Je>0&&Q(st=>rr(st+Je*_e,d)),Z.current=Ze,Ne!==null){if(Z.current=Ne,Ze===Ne){se(!0),Pe(Ze);return}ne.current=Ze,se(!0),Pe(Ne);return}se(!1),Pe(Ze)},[le,d,N,A,me]),Ie=s.useCallback(ve=>{X(ve)},[X]),Se=s.useCallback(ve=>{if(d<2)return;const _e=rr(ve,d);if(!(_e===le&&!K.current)&&(xe(!0),me(!0),Q(_e),A)){const Be=_e+(N?1:0);ne.current=null,de.current=0,Z.current=Be,se(!1),Pe(Be)}},[le,d,N,A,me]);s.useEffect(()=>{if(!ye)return;const ve=window.setTimeout(()=>{if(N&&(be===0||be===d+1)){ne.current=null,se(!0),Pe(le+1);return}me(!1)},So);return()=>window.clearTimeout(ve)},[le,d,N,ye,me,be]),s.useEffect(()=>{if(!Y)return;let ve=0;const _e=requestAnimationFrame(()=>{ve=requestAnimationFrame(()=>{const Be=ne.current;ne.current=null;const Ze=de.current;if(de.current=0,se(!1),Be!==null){Z.current=Be,Pe(Be);return}if(Ze!==0){X(Ze);return}me(!1)})});return()=>{cancelAnimationFrame(_e),cancelAnimationFrame(ve)}},[X,me,Y]);const J=`${N}:${d}`,He=s.useRef(J);s.useEffect(()=>{if(He.current===J)return;He.current=J;const ve=d>0?Math.min(le,d-1):0;ee.current=null,te.current=null,fe(!1),Re(0),Q(ve),se(!0),Pe(ve+(N?1:0))},[le,d,N,J]),s.useEffect(()=>{if(!ge)return;const ve=window.setTimeout(()=>xe(!1),gS);return()=>window.clearTimeout(ve)},[ge,le]),s.useEffect(()=>{if(!q||d<2)return;const ve=Math.max(y,.1)*1e3,_e=window.setInterval(()=>{I&&Ce||Ie(1)},ve);return()=>window.clearInterval(_e)},[y,d,Ie,q,Ce,I]);const We=s.useCallback(ve=>{const _e=ee.current;if(!_e||_e.pointerId!==ve.pointerId)return;ee.current=null,te.current=null;const Be=z.current;if(Be!=null&&Be.hasPointerCapture(ve.pointerId)&&Be.releasePointerCapture(ve.pointerId),!_e.isActive){A&&Re(0);return}const $e=!(ve.timeStamp-_e.lastTime>vS)&&Math.abs(_e.velocity)>yS,Ne=_e.size>0&&Math.abs(_e.offset-_e.baseOffset)>_e.size*fS;if(fe(!1),!$e&&!Ne){Re(0);return}const Ue=Ne?_e.offset-_e.baseOffset:_e.velocity;let Je=1;Ne&&_e.size>0&&(Je=Math.max(1,Math.round(Math.abs(Ue)/_e.size))),Re(0),X(Ue<0?Je:-Je)},[X,A]);s.useEffect(()=>{const ve=_e=>{te.current===null||_e.pointerId!==te.current||We(_e)};return window.addEventListener("pointerup",ve),window.addEventListener("pointercancel",ve),()=>{window.removeEventListener("pointerup",ve),window.removeEventListener("pointercancel",ve)}},[We]);const ot=ve=>{const _e=z.current;if(!w||d<2||!_e||ve.pointerType==="mouse"&&ve.button!==0)return;ne.current=null,de.current=0,K.current&&me(!1);let Be=0;const Ze=R.current;if(A&&Ze){const $e=C?Ze.offsetWidth:Ze.offsetHeight;if($e>0){const Ne=$S(Ze,C);let Ue=Z.current;N&&(Ue===0||Ue===d+1)?(Ue=le+1,Z.current=Ue,se(!0),Pe(Ue),Be=0):Be=Ne+Ue*$e,Re(Be)}}_e.setPointerCapture(ve.pointerId),te.current=ve.pointerId,ee.current={pointerId:ve.pointerId,startClientX:ve.clientX,startClientY:ve.clientY,axes:CS(_e,`${r}-axis-probe`),size:C?_e.offsetWidth:_e.offsetHeight,isActive:!1,baseOffset:Be,offset:Be,lastTime:ve.timeStamp,velocity:0}},qe=ve=>{const _e=ee.current;if(!_e||_e.pointerId!==ve.pointerId)return;if(ve.pointerType==="mouse"&&ve.buttons===0){We(ve);return}const Be=ve.clientX-_e.startClientX,Ze=ve.clientY-_e.startClientY,$e=_e.axes?TS(_e.axes,Be,Ze):{x:Be,y:Ze},Ne=C?$e.x:$e.y,Ue=C?$e.y:$e.x,Je=_e.baseOffset+Ne;if(!_e.isActive){if(Math.max(Math.abs(Ne),Math.abs(Ue))<hS)return;if(Math.abs(Ue)>Math.abs(Ne)){const it=z.current;it!=null&&it.hasPointerCapture(_e.pointerId)&&it.releasePointerCapture(_e.pointerId),ee.current=null,te.current=null,A&&Re(0);return}_e.isActive=!0,fe(!0)}const st=ve.timeStamp-_e.lastTime;st>0&&(_e.velocity=(Je-_e.offset)/st,_e.lastTime=ve.timeStamp),_e.offset=Je,A&&Re(Je)},tt=ve=>{We(ve)},et=C?`translate3d(calc(${-be*100}% + ${we}px), 0, 0)`:`translate3d(0, calc(${-be*100}% + ${we}px), 0)`,Ge=N?[c[d-1],...c,c[0]]:c;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:LS(r,n)}}),a.jsxs("div",{className:Ct(`${r}-wrapper`,{[`${r}-transition-reveal`]:m==="reveal",[`${r}-transition-reveal-vertical`]:m==="reveal"&&!C}),onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[a.jsxs("div",{className:`${r}-slider-inner`,style:{backgroundColor:"transparent"},children:[a.jsx("div",{ref:z,className:Ct(`${r}-track`,{[`${r}-track-draggable`]:w,[`${r}-track-draggable-vertical`]:w&&!C}),onPointerDown:ot,onPointerMove:qe,onPointerUp:tt,onPointerCancel:tt,onLostPointerCapture:ve=>{te.current===ve.pointerId&&We(ve)},children:a.jsx("div",{ref:R,className:Ct(`${r}-list`,{[`${r}-list-slide`]:A,[`${r}-list-slide-vertical`]:A&&!C,[`${r}-list-fade`]:!A}),style:A?{transform:et,transition:pe||Y?"none":`transform ${So}ms ${pp}`}:void 0,children:Ge.map((ve,_e)=>{const Be=N?rr(_e-1,d):_e,$e=N&&(_e===0||_e===d+1)?`clone-${_e===0?"start":"end"}`:`slide-${Be}`;return a.jsx("div",{className:Ct(`${r}-slide`,{[`${r}-is-active`]:!A&&Be===le}),children:a.jsx("div",{className:`${r}-slider-item`,children:a.jsx("div",{className:`${r}-img-wrapper`,children:a.jsx("img",{className:Ct(`${r}-slider-image`,{[`${r}-contain`]:ve.image.objectFit==="contain",[`${r}-cover`]:ve.image.objectFit==="cover"}),src:ve.image.url,alt:ve.image.name??"",draggable:!1})})})},$e)})})}),ie&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ct(`${r}-arrow`,{[`${r}-arrow-prev`]:C,[`${r}-arrow-prev-vertical`]:!C,[`${r}-hover-arrow`]:ae}),style:{color:_,"--arrow-hover-color":G,...oe},children:a.jsxs("button",{onClick:ve=>{ve.stopPropagation(),Ie(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${F.scalingValue(B,n)}, ${F.scalingValue(P*(C?1:-1),n)}) rotate(${C?"0deg":"90deg"})`},children:[W&&a.jsx(mn,{url:W,fill:_,hoverFill:G,className:Ct(`${r}-arrow-img`,`${r}-mirror`),style:oe}),!W&&a.jsx(ld,{color:_,className:Ct(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:Ct(`${r}-arrow`,{[`${r}-arrow-next`]:C,[`${r}-arrow-next-vertical`]:!C,[`${r}-hover-arrow`]:ae}),style:{color:_,"--arrow-hover-color":G,...oe},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:ve=>{ve.stopPropagation(),Ie(1)},style:{transform:`translate(${F.scalingValue(B*(C?-1:1),n)}, ${F.scalingValue(P,n)}) rotate(${C?"0deg":"90deg"})`},children:[W&&a.jsx(mn,{url:W,fill:_,hoverFill:G,className:`${r}-arrow-img`,style:oe}),!W&&a.jsx(ld,{color:_,className:Ct(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),V&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>Ie(1)}),j&&a.jsx("div",{className:Ct(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:C,[`${r}-pagination-inside-left`]:!C}),style:C?{bottom:f(b.inset)}:{left:f(b.inset)},children:a.jsx("div",{className:Ct(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!C,[`${r}-animate-dots`]:ge}),style:{backgroundColor:D,gap:f(b.gapInactive-b.activeDot+b.dot),...C?{height:f(b.activeDot+b.paddingY*2),paddingTop:f(b.paddingY),paddingBottom:f(b.paddingY),paddingLeft:f(b.paddingActive),paddingRight:f(b.paddingActive)}:{width:f(b.activeDot+b.paddingY*2),paddingLeft:f(b.paddingY),paddingRight:f(b.paddingY),paddingTop:f(b.paddingActive),paddingBottom:f(b.paddingActive)},borderRadius:f(b.borderRadius),transform:`translate(${F.scalingValue(Jo.offset.x,n)}, ${F.scalingValue(Jo.offset.y,n)})`},children:c.map((ve,_e)=>{const Be=_e===le,Ze=Be?b.activeDot:b.dot;return a.jsx("button",{onClick:()=>Se(_e),className:`${r}-pagination-item`,style:{width:f(b.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:Be?L:$,width:f(Ze)}})},_e)})},`${x}-${v}`)})]}),a.jsxs("div",{className:`${r}-caption-block`,children:[a.jsx("div",{"data-controls":o?"captionMarginTop":void 0,className:o?`${r}-control`:void 0,style:{height:F.scalingValue(T,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:c.map((ve,_e)=>a.jsx("div",{className:Ct(`${r}-caption-text`,{[`${r}-with-pointer-events`]:_e===le&&n,[`${r}-active`]:_e===le}),style:{...l,width:"max-content",transitionDuration:`${Math.round(So/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":E,"--link-hover-color":E,position:"relative",top:F.scalingValue(vs.offset.y,n),left:F.scalingValue(vs.offset.x,n)},children:a.jsx(Ki,{content:ve.imageCaption})})},_e))})]})]})]})}function ld({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const IS=`import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
19681
19709
|
import cn from 'classnames';
|
|
19682
19710
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
19683
19711
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -20858,7 +20886,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
20858
20886
|
</svg>
|
|
20859
20887
|
);
|
|
20860
20888
|
}
|
|
20861
|
-
`,RS={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"]}}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:100,display:{type:"range-control"}}},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,captionMarginTop:10/1440,titleFontSize:16/1440,titleLineHeight:16/1440,navSize:"m",navUnit:1/1440},t:{controlsMaxWidth:30/768,paddingX:-10/768,paddingY:0,captionMarginTop:10/768,titleFontSize:16/768,titleLineHeight:16/768,navSize:"m",navUnit:1/768},m:{controlsMaxWidth:30/375,paddingX:-14/375,paddingY:0,captionMarginTop:10/375,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","captionMarginTop","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"}]}]}]}},kS={element:PS,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:RS,sourceCode:IS,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls"}]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily"}},po=300/1440,ES=8/1440,Jn=.004;function MS(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function
|
|
20889
|
+
`,RS={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"]}}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:100,display:{type:"range-control"}}},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,captionMarginTop:10/1440,titleFontSize:16/1440,titleLineHeight:16/1440,navSize:"m",navUnit:1/1440},t:{controlsMaxWidth:30/768,paddingX:-10/768,paddingY:0,captionMarginTop:10/768,titleFontSize:16/768,titleLineHeight:16/768,navSize:"m",navUnit:1/768},m:{controlsMaxWidth:30/375,paddingX:-14/375,paddingY:0,captionMarginTop:10/375,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","captionMarginTop","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"}]}]}]}},kS={element:PS,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:RS,sourceCode:IS,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls"}]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily"}},po=300/1440,ES=8/1440,Jn=.004;function MS(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function xs(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function bs(e,t,n,i,o="title-leading-gap"){const r=e??.01;return t===void 0||t>=r?{}:{[`--${n}-${o}`]:F.scalingValue((r-t)/2,i)}}function AS(e){return`
|
|
20862
20890
|
.${e}-wrapper {
|
|
20863
20891
|
box-sizing: border-box;
|
|
20864
20892
|
display: flex;
|
|
@@ -21098,7 +21126,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
21098
21126
|
width: var(--cntrl-article-width, 100vw) !important;
|
|
21099
21127
|
height: var(--cntrl-viewport-height, 100vh) !important;
|
|
21100
21128
|
}
|
|
21101
|
-
`}const mp={"left-top":{horizontal:"left",vertical:"top"},"top-center":{horizontal:"center",vertical:"top"},"top-right":{horizontal:"right",vertical:"top"},"left-center":{horizontal:"left",vertical:"center"},center:{horizontal:"center",vertical:"center"},"right-center":{horizontal:"right",vertical:"center"},"left-bottom":{horizontal:"left",vertical:"bottom"},"bottom-center":{horizontal:"center",vertical:"bottom"},"right-bottom":{horizontal:"right",vertical:"bottom"}};function FS(e){return e in mp}function NS(e){if(e&&FS(e))return e;switch(e){case"center-top":return"top-center";case"right-top":return"top-right";case"top-left":return"left-top";case"center-bottom":return"bottom-center";case"bottom-left":return"left-bottom";case"bottom-right":return"right-bottom";case"center-center":return"center";case"left":return"left-center";case"right":return"right-center";case"top":return"left-top";default:return"center"}}function Dl(e){return mp[e]}const _S="rgba(28,31,34,0.9)",Yn=500,Oi="cubic-bezier(0.22, 1, 0.36, 1)",HS=72,WS=50,OS={titleColor:"title-color",descriptionColor:"description-color",lightboxCounterColor:"lightbox-counter-color"},DS=[];function zS(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 BS(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function jS(e){const[t]=e.media;return t!=null&&t.url?t:null}function VS(e){if(!Array.isArray(e)||e.length===0)return[];if(zS(e)){const t=[];for(const n of e){const i=BS(n);if(!i)continue;const o=jS(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 Xs(e){return e.type==="video"}function GS(e){e.pause(),e.removeAttribute("src"),e.load()}function Ur(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function XS(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const qS=1140/1440;function US(e){return typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"2:3",reversed:(e==null?void 0:e.reversed)??!1}}function KS(e){const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`}function YS(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function ZS({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:c}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{GS(d)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:c,style:i})}function JS({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:c,counterClassName:d,counterStyle:u,backgroundColor:p}){const y=i==="cover",v=s.useRef(null),m=s.useRef(null),g=s.useRef(null),x=s.useRef(0),b=s.useRef(0),k=s.useRef("none"),f=s.useRef(!1),S=s.useRef(!1),O=s.useRef(!1),U=s.useRef(null),[z,I]=s.useState(null),[N,q]=s.useState("opening"),[$,L]=s.useState(0),[D,_]=s.useState(0),[C,T]=s.useState(!1),[B,w]=s.useState(!1),[X,R]=s.useState(!1),E=s.useRef(n),V=t[n],ie=V?Xs(V):!1,re=D!==0||C,W=s.useCallback(he=>{O.current=he,T(he)},[]),ae=s.useCallback(()=>{U.current!==null&&(window.clearTimeout(U.current),U.current=null)},[]),A=s.useCallback(()=>{ae(),U.current=window.setTimeout(()=>{ae(),W(!1)},Yn+32)},[ae,W]),le=s.useCallback(()=>{const he=v.current,Se=m.current;if(!he)return;const Ce=he.getBoundingClientRect(),h=Ce.width,K=Ce.height;if(!h||!K)return;if(i==="cover"){I({width:h,height:K,left:Ce.left,top:Ce.top});return}if(!Se){I(Ur(he));return}const{width:Z,height:te}=XS(Se);if(!Z||!te){I(Ur(he));return}const me=Z/te,j=h/K;if(me>j){const P=h/me;I({width:h,height:P,left:Ce.left,top:Ce.top+(K-P)/2})}else{const P=K*me;I({width:P,height:K,left:Ce.left+(h-P)/2,top:Ce.top})}},[i]);s.useEffect(()=>{le();const he=v.current;if(!he)return;const Se=new ResizeObserver(()=>le());return Se.observe(he),()=>Se.disconnect()},[le,n]),s.useEffect(()=>{N==="opening"&&z&&q("open")},[N,z]),s.useEffect(()=>{if(N!=="closing")return;const he=setTimeout(()=>r(),Yn);return()=>clearTimeout(he)},[N,r]),s.useEffect(()=>()=>{ae()},[ae]),s.useLayoutEffect(()=>{if(E.current===n)return;ae(),L(0),_(0),W(!1),R(!1),w(!1),x.current=0,b.current=0,k.current="none",f.current=!1,g.current=null,S.current=!1;const he=v.current;he&&I(Ur(he)),E.current=n},[n,W,ae]),s.useEffect(()=>{if(N!=="open")return;let he=null;const Se=()=>{he&&(document.removeEventListener("click",he,!0),he=null)},Ce=()=>{Se(),he=j=>{j.stopPropagation(),j.preventDefault(),Se()},document.addEventListener("click",he,!0)},h=j=>{ae(),O.current=!1,T(!1),_(0),w(!1),f.current=!1,b.current=0,k.current="none";const P=v.current;P&&I(Ur(P)),j<0?c():l()},K=j=>{if(Math.abs(j)>WS&&t.length>1){h(j);return}W(!0),_(0),A()},Z=j=>{if(j.touches.length!==1||O.current)return;const P=j.touches[0];S.current=!0,g.current={x:P.clientX,y:P.clientY},k.current="none",b.current=0,f.current=!1},te=j=>{if(!g.current||j.touches.length!==1||O.current)return;const P=j.touches[0],Q=P.clientX-g.current.x,ne=P.clientY-g.current.y;if(k.current==="none"){if(Math.abs(Q)<10&&Math.abs(ne)<10)return;if(Math.abs(Q)>Math.abs(ne)){if(t.length<=1)return;k.current="horizontal"}else if(ne>0)k.current="vertical";else return}if(k.current==="horizontal"){f.current=!0,w(!0),b.current=Q,_(Q),j.preventDefault();return}k.current==="vertical"&&(f.current=!0,w(!0),x.current=ne,L(ne),j.preventDefault())},me=()=>{if(!g.current)return;const j=k.current,P=f.current;if(P&&j==="horizontal")K(b.current),Ce();else if(P&&j==="vertical")if(x.current>HS){const ne=window.innerHeight;x.current=ne,R(!0),L(ne),q("closing")}else x.current=0,L(0),Ce();else j==="horizontal"&&Math.abs(b.current)>0&&(K(b.current),Ce());g.current=null,k.current="none",b.current=0,f.current=!1,w(!1)};return document.addEventListener("touchstart",Z,{passive:!0}),document.addEventListener("touchmove",te,{passive:!1}),document.addEventListener("touchend",me),document.addEventListener("touchcancel",me),()=>{document.removeEventListener("touchstart",Z),document.removeEventListener("touchmove",te),document.removeEventListener("touchend",me),document.removeEventListener("touchcancel",me),Se()}},[N,t.length,c,l,W,A,ae]),s.useEffect(()=>{const he=Se=>{Se.key==="Escape"&&(Se.preventDefault(),Se.stopPropagation(),N!=="closing"&&q("closing"))};return window.addEventListener("keydown",he,!0),()=>window.removeEventListener("keydown",he,!0)},[N]);const ee=()=>{N!=="closing"&&q("closing")},xe=N==="open",Pe=N==="closing",ye=$>0?Math.max(0,1-$/500):1,pe=$>0?Math.max(.35,1-$/500):1,Y=he=>{if(he.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const Se=he.currentTarget.getBoundingClientRect(),Ce=he.clientY-Se.top,h=Math.min(52,Se.height*.2);if(!(Ce>Se.height-h)){if(he.clientX-Se.left<Se.width/2){l();return}c()}},se=he=>{if(t.length<=1)return;const Se=he.currentTarget.getBoundingClientRect(),Ce=he.clientX-Se.left,h=he.clientY-Se.top,K=Math.min(52,Se.height*.2);if(h>Se.height-K){he.currentTarget.style.cursor="default";return}he.currentTarget.style.cursor=Ce<Se.width/2?"w-resize":"e-resize"},de=s.useCallback(he=>{he.propertyName!=="transform"||!O.current||(ae(),W(!1))},[ae,W]),ve=re?`translateX(${D}px)`:$>0?`translateY(${$}px)`:void 0,$e={position:"fixed",top:z==null?void 0:z.top,left:z==null?void 0:z.left,width:z==null?void 0:z.width,height:z==null?void 0:z.height,objectFit:i==="cover"?"cover":"contain",transform:ve,opacity:$>0?pe:N==="opening"||Pe?0:1,transition:B&&!C?"none":C?`transform ${Yn}ms ${Oi}`:X?`transform ${Yn}ms ${Oi}, opacity ${Yn}ms ${Oi}`:N==="opening"||Pe?`opacity ${Yn}ms ${Oi}`:"none",pointerEvents:ie&&xe&&!re?"auto":"none",touchAction:ie&&xe?"none":void 0,zIndex:9998},ke=z?{position:"fixed",top:z.top,height:z.height,width:z.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:N==="open"?"none":void 0},onClick:ee,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:xe?ye:0,transition:B?"none":`opacity ${Yn}ms ${Oi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:y?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:v,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:xe?1:0,transition:`opacity ${Yn}ms ${Oi}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:d,style:u,children:[n+1," / ",t.length]})})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:v,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:xe?1:0,transition:`opacity ${Yn}ms ${Oi}`},children:t.length>1&&a.jsxs("p",{className:d,style:u,children:[n+1," / ",t.length]})})]})}),z&&V&&(ie?a.jsx(ZS,{src:V.url,phase:N,mediaRef:m,mediaStyle:$e,onLoadedMetadata:le,onClick:Y,onMouseMove:se,onTransitionEnd:de},`${n}-${V.url}`):a.jsx("img",{ref:m,src:V.url,alt:V.name,onLoad:le,onTransitionEnd:de,style:$e},`${n}-${V.url}`)),xe&&ke&&t.length>1&&!ie&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...ke,left:z.left,cursor:"w-resize",pointerEvents:re?"none":"auto"},onClick:he=>{if(S.current){S.current=!1;return}he.stopPropagation(),l()}}),a.jsx("div",{style:{...ke,left:z.left+z.width/2,cursor:"e-resize",pointerEvents:re?"none":"auto"},onClick:he=>{if(S.current){S.current=!1;return}he.stopPropagation(),c()}})]})]})}function cd({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:r,isEditor:l,galleryPaddingBetween:c=0,showPaddingAfter:d=!1,showControls:u=!1,onMediaClick:p}){const y=`${e}-gallery-${Xs(t)?"video":"image"}`,v=r.display==="cover",m=KS(r),g=N=>F.scalingValue(N,l??!1),x=n??po,b=o?{width:"100%",maxWidth:"100%"}:{width:g(x),maxWidth:"100%"},k=i?{borderRadius:g(i)}:{},f={...b,...v?{aspectRatio:m,height:"auto",overflow:"hidden"}:{},...k},S={...v?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":g(x)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...v?{}:k},U={className:y,style:S,onClick:p?N=>{N.stopPropagation(),p()}:void 0},z=Math.max(c,Jn),I=Xs(t)?a.jsx("video",{...U,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...U,src:t.url,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[v?a.jsx("div",{style:f,children:I}):I,d&&c>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:g(c)},"aria-hidden":"true"}),u&&d&&a.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:g(z)}})]})}function QS({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:c,showControls:d,scaled:u,children:p}){const y=t==="a"?i:t==="c"?o:0,v=y>0||d;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&v&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(y)},"aria-hidden":"true"}),d&&t==="c"&&a.jsx("div",{"data-controls":"galleryPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(c),className:`${e}-control-anchor`,style:{top:0,left:0,width:u(l),height:"100%"}}),a.jsx("div",{className:`${e}-gallery`,style:n,children:p}),t==="a"&&v&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(y)},"aria-hidden":"true"}),d&&t==="a"&&a.jsx("div",{"data-controls":"galleryPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(c),className:`${e}-control-anchor`,style:{top:0,right:0,width:u(r),height:"100%"}})]})}function ew(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function Kr({P:e,controlKey:t,scaled:n,height:i,paired:o,side:r}){return a.jsx("div",{"data-controls":t,...o?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{...r==="top"?{top:0}:{bottom:0},left:0,width:"100%",height:n(i)}})}function dd({P:e,controlKey:t,scaled:n,width:i,maxFraction:o,side:r,paired:l,anchorStyle:c}){return a.jsx("div",{"data-controls":t,...l?{"data-controls-paired":""}:{},"data-controls-axis":"x","data-controls-variant":"column-padding",...r==="right"?{"data-controls-reverse":""}:{},"data-controls-min":"0","data-controls-max-fraction":String(o),className:`${e}-control-anchor`,style:{top:0,...r==="left"?{left:0}:{right:0},width:n(i),height:"100%",...c}})}function bs({P:e,title:t,description:n,position:i,titleRef:o,titleClassName:r,titleContainerStyle:l,titleTextBoxStyle:c,titleStyle:d,descriptionClassName:u,descriptionStyle:p,descriptionPadding:y,showTextBoxOutline:v=!1,showDescriptionPaddingControl:m=!1,descriptionPaddingPaired:g=!1,topPaddingControl:x,bottomPaddingControl:b}){const k=s.useRef(null),[f,S]=s.useState(0),O=t??"",U=n??"",z=U.length>0,{horizontal:I,vertical:N}=Dl(i),q=N==="center"||N==="bottom",$=N==="bottom";s.useLayoutEffect(()=>{if(!q)return;const C=k.current;if(!C||typeof ResizeObserver>"u")return;const T=()=>S(C.offsetHeight);T();const B=new ResizeObserver(T);return B.observe(C),()=>B.disconnect()},[O,U,q]);const L=a.jsx("span",{className:`${e}-title-text`,style:d,children:O}),D=z?a.jsx("span",{className:u,style:p,children:U}):null,_=z?a.jsx("div",{className:`${e}-title-texts-gap`,style:{height:y},children:m&&a.jsx("div",{"data-controls":"titleDescriptionPadding",...g?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{top:0,left:0,width:"100%",height:"100%"}})}):null;return a.jsx("div",{ref:C=>{k.current=C,o(C)},className:[r,`${e}-title-h-${I}`,`${e}-title-v-${N}`].join(" "),style:{...q?{[`--${e}-title-height`]:`${f}px`}:{},...l},children:a.jsxs("div",{className:`${e}-title-text-stack`,style:c,children:[x,a.jsx("div",{className:v?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:a.jsx("div",{className:`${e}-title-texts`,children:$?a.jsxs(a.Fragment,{children:[D,_,L]}):a.jsxs(a.Fragment,{children:[L,_,D]})})}),b]})})}const ud=45;function pd(e,t,n){let i=e;for(;i;){const o=getComputedStyle(i).getPropertyValue(t).trim();if(o){const r=parseFloat(o);if(!Number.isNaN(r))return r}i=i.parentElement}return n}function tw(e){const t=pd(e,"--cntrl-viewport-height",window.innerHeight),n=pd(e,"--cntrl-article-top",0);return{top:n,height:t,centerY:n+t/2}}function nw(e,t,n){const{vertical:i}=Dl(t),{top:o,height:r,centerY:l}=tw(n);if(i==="top"){const d=n&&parseFloat(getComputedStyle(n).top)||o;return Math.abs(e.top-d)}if(i==="bottom")return Math.abs(e.bottom-(o+r));const c=e.top+e.height/2;return Math.abs(c-l)}function iw(e,t,n){const i=Array.from({length:t},(l,c)=>{const d=e.current[c];if(!d)return 0;const u=d.getBoundingClientRect(),p=nw(u,n,d);return Math.exp(-(p*p)/(2*ud*ud))});let o=0,r=-1;return i.forEach((l,c)=>{l>r&&(r=l,o=c)}),{opacities:i,dominantIndex:o}}function ow(e,t,n){const i=s.useRef([]),[{opacities:o,dominantIndex:r},l]=s.useState(()=>({opacities:Array.from({length:e},(d,u)=>u===0?1:0),dominantIndex:0}));return s.useLayoutEffect(()=>{if(!t||e===0){l({opacities:Array.from({length:e},()=>1),dominantIndex:0});return}let d=0;const u=()=>{l(iw(i,e,n))},p=()=>{d||(d=window.requestAnimationFrame(()=>{d=0,u()}))};return u(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p,{passive:!0}),()=>{d&&window.cancelAnimationFrame(d),window.removeEventListener("scroll",p),window.removeEventListener("resize",p)}},[t,e,n]),{setTitleRef:d=>u=>{i.current[d]=u},opacities:o,dominantIndex:r}}function md(e,t){const[n,i]=s.useState(e),o=s.useRef(e);return s.useEffect(()=>{if(!t){o.current=e,i(e);return}const r=Array.from(o.current),l=Array.from(e),c=Math.max(r.length,l.length);if(c===0||o.current===e)return;let d=0;const u=window.setInterval(()=>{d+=1;const p=[...l.slice(0,d),...r.slice(d)].join("");o.current=p,i(p),d>=c&&window.clearInterval(u)},70);return()=>window.clearInterval(u)},[t,e]),n}function rw({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var dt,Pt;const{prefix:l}=F.useScopedStyles(),c=s.useMemo(()=>AS(l),[l]),d=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",y=(e==null?void 0:e.imgWidth)??po,v=(e==null?void 0:e.titleWidth)??qS,m=US(e==null?void 0:e.imageDisplay),g=(e==null?void 0:e.cornerRadius)??ES,x=NS(e==null?void 0:e.position),{horizontal:b,vertical:k}=Dl(x),f=(e==null?void 0:e.titleTopPadding)??0,S=(e==null?void 0:e.titleBottomPadding)??0,O=(e==null?void 0:e.titleLeftPadding)??0,U=(e==null?void 0:e.titleRightPadding)??0,z=(e==null?void 0:e.titleDescriptionPadding)??0,I=ew(e==null?void 0:e.transition),N=(e==null?void 0:e.lightbox)??"on",q=p==="b",$=I==="fade"||I==="retype",{setTitleRef:L,dominantIndex:D}=ow(d.length,$,x),_=((dt=d[D])==null?void 0:dt.title)??"",C=((Pt=d[D])==null?void 0:Pt.description)??"",T=md(_,I==="retype"),B=md(C,I==="retype"),w=I==="fade"||I==="retype",X=I==="retype"?T:_,R=I==="retype"?B:C,E=q?void 0:{width:F.scalingValue(y,n??!1)},V=N==="on"&&(!n||i||o),ie=o??!1,re=(e==null?void 0:e.galleryPaddingRight)??0,W=(e==null?void 0:e.galleryPaddingLeft)??0,ae=(e==null?void 0:e.galleryPaddingBetween)??0,A=St=>F.scalingValue(St,n??!1),ee={width:A(v)},xe=p==="a"?re:W,Pe=q?{width:"100%"}:{width:`calc(100% - ${A(y)} - ${A(xe)})`,...p==="c"?{marginLeft:"auto"}:{}},ye=Math.max(re,Jn),pe=Math.max(W,Jn),Y=Math.max(ae,Jn),se=Math.max(f,Jn),de=Math.max(S,Jn),ve=Math.max(O,Jn),$e=Math.max(U,Jn),ke=Math.max(z,Jn),he=Math.max(0,(u??1)-(y??po)),Se=p==="a"?Math.max(0,(u??1)-(y??po)-re):p==="c"?Math.max(0,(u??1)-(y??po)-W):p==="b"?u??1:1,Ce=ie&&k==="top",h=ie&&k==="bottom",K=ie&&b==="left",Z=ie&&b==="right",te=d.length>1,me=q?void 0:A((p==="c"?W:re)+(y??po)),j=p==="c"&&me?{left:me}:void 0,P=p==="a"&&me?{right:me}:void 0,Q=q?{left:0,width:"100%"}:p==="a"?{right:A(re),width:A(y)}:{left:A(W),width:A(y)},{titleColor:ne,titleFontFamily:ue,titleFontSettings:G,titleFontSize:Ie,titleLineHeight:be,titleLetterSpacing:J,titleWordSpacing:He,titleAlign:We,titleTextAppearance:ot,descriptionColor:qe,descriptionFontFamily:tt,descriptionFontSettings:et,descriptionFontSize:je,descriptionLineHeight:fe,descriptionLetterSpacing:_e,descriptionWordSpacing:Be,descriptionAlign:Ze,descriptionTextAppearance:we,lightboxCounterColor:Ne,lightboxCounterFontFamily:Ue,lightboxCounterFontSettings:Je,lightboxCounterFontSize:st,lightboxCounterLineHeight:it,lightboxCounterLetterSpacing:Oe,lightboxCounterWordSpacing:Ae,lightboxCounterTextAppearance:gt}=e??{},ze={fontSettings:{fontFamily:ue,fontWeight:(G==null?void 0:G.fontWeight)??400,fontStyle:(G==null?void 0:G.fontStyle)??"normal"},fontSize:Ie??.01,lineHeight:be,letterSpacing:J??0,wordSpacing:He??0,textAlign:We??"left",textAppearance:ot,color:ne??"#000000"},Xe=dn(Qt(ze,n)),ct=ee,ge={...xs(Ie,be,l,n),...xs(je,fe,l,n,"description-leading-gap")},Ee=vs(Ie,be,`${l}-title`,`${l}-text-tight-leading`),nt={fontSettings:{fontFamily:tt,fontWeight:(et==null?void 0:et.fontWeight)??400,fontStyle:(et==null?void 0:et.fontStyle)??"normal"},fontSize:je??.01,lineHeight:fe,letterSpacing:_e??0,wordSpacing:Be??0,textAlign:Ze??"left",textAppearance:we,color:qe??"#000000"},pt=dn(Qt(nt,n)),Ge=vs(je,fe,`${l}-description-text`,`${l}-description-tight-leading`),vt=A(ie?ke:z),Rt={fontSettings:{fontFamily:Ue,fontWeight:(Je==null?void 0:Je.fontWeight)??400,fontStyle:(Je==null?void 0:Je.fontStyle)??"normal"},fontSize:st??.01,lineHeight:it,letterSpacing:Oe??0,wordSpacing:Ae??0,textAppearance:gt,color:Ne??"#DEDDDD"},wt={...dn(Qt(Rt,n)),...xs(st,it,l,n)},Vt=vs(st,it,`${l}-lightbox-counter`,`${l}-text-tight-leading`),jt=F.buildColorVars(l,{titleColor:ne??"#000000",descriptionColor:qe??"#000000",lightboxCounterColor:Ne??"#DEDDDD"},OS,DS),Kt=s.useRef(null),[Yt,kt]=s.useState(!1),[Bt,rn]=s.useState([]),[xt,yt]=s.useState(0),Me=s.useCallback((St,ht)=>{V&&(rn(St),yt(ht),kt(!0))},[V]),Qe=s.useCallback(()=>{kt(!1)},[]),rt=s.useMemo(()=>{const St={...jt},ht=Kt.current?getComputedStyle(Kt.current).getPropertyValue("--cntrl-article-width").trim():"";return ht&&(St["--cntrl-article-width"]=ht),St},[jt,Yt]);return s.useEffect(()=>{if(!Yt||N!=="on"||typeof document>"u")return;const St=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=St}},[Yt,N]),s.useEffect(()=>{!n||o||i||kt(!1)},[n,o,i]),s.useEffect(()=>{N==="off"&&kt(!1)},[N]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx("div",{style:jt,children:a.jsxs("div",{ref:Kt,className:`${l}-wrapper`,style:{width:F.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:k==="top"?A(f):void 0,[`--${l}-title-bottom-padding`]:k==="bottom"?A(S):void 0,[`--${l}-title-left-padding`]:b==="left"?A(O):void 0,[`--${l}-title-right-padding`]:b==="right"?A(U):void 0},children:[w&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(bs,{P:l,title:X,description:R,position:x,titleRef:()=>{},titleClassName:`${Ee} ${l}-single-title`,titleContainerStyle:{...ge,...Pe},titleTextBoxStyle:ct,titleStyle:Xe,descriptionClassName:Ge,descriptionStyle:pt,descriptionPadding:vt,showTextBoxOutline:ie,showDescriptionPaddingControl:ie,topPaddingControl:Ce?Kr({P:l,controlKey:"titleTopPadding",scaled:A,height:se,paired:!1,side:"top"}):void 0,bottomPaddingControl:h?Kr({P:l,controlKey:"titleBottomPadding",scaled:A,height:de,paired:!1,side:"bottom"}):void 0})}),d.map((St,ht)=>{const Wt=VS(St.gallery),Tt=ht<d.length-1,Ot=Wt.filter(Mt=>Mt.lightboxMedia).map(Mt=>Mt.lightboxMedia),Gt={P:l,position:x,titleRef:L(ht),titleClassName:Ee,titleContainerStyle:ge,titleTextBoxStyle:w?{maxWidth:"100%"}:ct,titleStyle:Xe,descriptionClassName:Ge,descriptionStyle:pt,descriptionPadding:vt,showTextBoxOutline:ie&&!w,showDescriptionPaddingControl:ie&&!w,descriptionPaddingPaired:te,topPaddingControl:Ce&&!w?Kr({P:l,controlKey:"titleTopPadding",scaled:A,height:se,paired:te,side:"top"}):void 0,bottomPaddingControl:h&&!w?Kr({P:l,controlKey:"titleBottomPadding",scaled:A,height:de,paired:te,side:"bottom"}):void 0};return a.jsxs("div",{"data-item-index":ht,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Tt?A(ae):void 0},children:[K&&dd({P:l,controlKey:"titleLeftPadding",scaled:A,width:ve,maxFraction:Se,side:"left",paired:te,anchorStyle:j}),Z&&dd({P:l,controlKey:"titleRightPadding",scaled:A,width:$e,maxFraction:Se,side:"right",paired:te,anchorStyle:P}),ie&&Tt&&a.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${l}-control-anchor`,style:{bottom:0,height:A(Y),...Q}}),q?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:Wt.map(({displayMedia:Mt,lightboxMedia:_t},Ft)=>{const ut=_t?Ot.findIndex(H=>H.url===_t.url):-1;return a.jsx(cd,{P:l,media:Mt,imgWidth:y||void 0,cornerRadius:g||void 0,imageDisplay:m,isEditor:n,galleryPaddingBetween:ae,showPaddingAfter:Ft<Wt.length-1,showControls:ie,onMediaClick:V&&ut>=0?()=>Me(Ot,ut):void 0},`${Mt.url}-${Ft}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(bs,{...Gt,title:w?"":St.title,description:w?"":St.description})})]}):a.jsxs(a.Fragment,{children:[a.jsx(bs,{...Gt,title:w?"":St.title,description:w?"":St.description}),Wt.length>0&&a.jsx(QS,{P:l,layoutType:p,galleryWidthStyle:E,galleryPaddingRight:re,galleryPaddingLeft:W,galleryPaddingRightWidth:ye,galleryPaddingLeftWidth:pe,galleryPaddingMaxFraction:he,showControls:ie,scaled:A,children:Wt.map(({displayMedia:Mt,lightboxMedia:_t},Ft)=>{const ut=_t?Ot.findIndex(H=>H.url===_t.url):-1;return a.jsx(cd,{P:l,media:Mt,cornerRadius:g||void 0,fillGalleryWidth:!0,imageDisplay:m,isEditor:n,galleryPaddingBetween:ae,showPaddingAfter:Ft<Wt.length-1,showControls:ie,onMediaClick:V&&ut>=0?()=>Me(Ot,ut):void 0},`${Mt.url}-${Ft}`)})})]})]},ht)})]})}),Yt&&N==="on"&&typeof document<"u"&&e&&(()=>{const St=(r?document.getElementById(r):null)??document.body;return Gn.createPortal(a.jsx("div",{style:rt,"data-selection":"none",children:a.jsx(JS,{prefix:l,items:Bt,index:xt,imageDisplay:YS(e.lightboxImageDisplay),isEditor:n,onClose:Qe,onPrev:()=>yt(ht=>(ht-1+Bt.length)%Bt.length),onNext:()=>yt(ht=>(ht+1)%Bt.length),counterClassName:Vt,counterStyle:wt,backgroundColor:e.backgroundColor??_S})}),St)})()]})}const aw=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
21129
|
+
`}const mp={"left-top":{horizontal:"left",vertical:"top"},"top-center":{horizontal:"center",vertical:"top"},"top-right":{horizontal:"right",vertical:"top"},"left-center":{horizontal:"left",vertical:"center"},center:{horizontal:"center",vertical:"center"},"right-center":{horizontal:"right",vertical:"center"},"left-bottom":{horizontal:"left",vertical:"bottom"},"bottom-center":{horizontal:"center",vertical:"bottom"},"right-bottom":{horizontal:"right",vertical:"bottom"}};function FS(e){return e in mp}function NS(e){if(e&&FS(e))return e;switch(e){case"center-top":return"top-center";case"right-top":return"top-right";case"top-left":return"left-top";case"center-bottom":return"bottom-center";case"bottom-left":return"left-bottom";case"bottom-right":return"right-bottom";case"center-center":return"center";case"left":return"left-center";case"right":return"right-center";case"top":return"left-top";default:return"center"}}function Dl(e){return mp[e]}const _S="rgba(28,31,34,0.9)",Yn=500,Oi="cubic-bezier(0.22, 1, 0.36, 1)",HS=72,WS=50,OS={titleColor:"title-color",descriptionColor:"description-color",lightboxCounterColor:"lightbox-counter-color"},DS=[];function zS(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 BS(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function jS(e){const[t]=e.media;return t!=null&&t.url?t:null}function VS(e){if(!Array.isArray(e)||e.length===0)return[];if(zS(e)){const t=[];for(const n of e){const i=BS(n);if(!i)continue;const o=jS(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 Xs(e){return e.type==="video"}function GS(e){e.pause(),e.removeAttribute("src"),e.load()}function Ur(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function XS(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const qS=1140/1440;function US(e){return typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"2:3",reversed:(e==null?void 0:e.reversed)??!1}}function KS(e){const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`}function YS(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function ZS({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:c}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{GS(d)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:c,style:i})}function JS({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:c,counterClassName:d,counterStyle:u,backgroundColor:p}){const y=i==="cover",v=s.useRef(null),m=s.useRef(null),g=s.useRef(null),x=s.useRef(0),b=s.useRef(0),k=s.useRef("none"),f=s.useRef(!1),S=s.useRef(!1),W=s.useRef(!1),U=s.useRef(null),[B,P]=s.useState(null),[_,G]=s.useState("opening"),[$,L]=s.useState(0),[D,E]=s.useState(0),[T,C]=s.useState(!1),[V,w]=s.useState(!1),[q,I]=s.useState(!1),A=s.useRef(n),j=t[n],ie=j?Xs(j):!1,ae=D!==0||T,O=s.useCallback(ge=>{W.current=ge,C(ge)},[]),oe=s.useCallback(()=>{U.current!==null&&(window.clearTimeout(U.current),U.current=null)},[]),N=s.useCallback(()=>{oe(),U.current=window.setTimeout(()=>{oe(),O(!1)},Yn+32)},[oe,O]),le=s.useCallback(()=>{const ge=v.current,xe=m.current;if(!ge)return;const Ce=ge.getBoundingClientRect(),h=Ce.width,K=Ce.height;if(!h||!K)return;if(i==="cover"){P({width:h,height:K,left:Ce.left,top:Ce.top});return}if(!xe){P(Ur(ge));return}const{width:Z,height:ne}=XS(xe);if(!Z||!ne){P(Ur(ge));return}const de=Z/ne,z=h/K;if(de>z){const R=h/de;P({width:h,height:R,left:Ce.left,top:Ce.top+(K-R)/2})}else{const R=K*de;P({width:R,height:K,left:Ce.left+(h-R)/2,top:Ce.top})}},[i]);s.useEffect(()=>{le();const ge=v.current;if(!ge)return;const xe=new ResizeObserver(()=>le());return xe.observe(ge),()=>xe.disconnect()},[le,n]),s.useEffect(()=>{_==="opening"&&B&&G("open")},[_,B]),s.useEffect(()=>{if(_!=="closing")return;const ge=setTimeout(()=>r(),Yn);return()=>clearTimeout(ge)},[_,r]),s.useEffect(()=>()=>{oe()},[oe]),s.useLayoutEffect(()=>{if(A.current===n)return;oe(),L(0),E(0),O(!1),I(!1),w(!1),x.current=0,b.current=0,k.current="none",f.current=!1,g.current=null,S.current=!1;const ge=v.current;ge&&P(Ur(ge)),A.current=n},[n,O,oe]),s.useEffect(()=>{if(_!=="open")return;let ge=null;const xe=()=>{ge&&(document.removeEventListener("click",ge,!0),ge=null)},Ce=()=>{xe(),ge=z=>{z.stopPropagation(),z.preventDefault(),xe()},document.addEventListener("click",ge,!0)},h=z=>{oe(),W.current=!1,C(!1),E(0),w(!1),f.current=!1,b.current=0,k.current="none";const R=v.current;R&&P(Ur(R)),z<0?c():l()},K=z=>{if(Math.abs(z)>WS&&t.length>1){h(z);return}O(!0),E(0),N()},Z=z=>{if(z.touches.length!==1||W.current)return;const R=z.touches[0];S.current=!0,g.current={x:R.clientX,y:R.clientY},k.current="none",b.current=0,f.current=!1},ne=z=>{if(!g.current||z.touches.length!==1||W.current)return;const R=z.touches[0],ee=R.clientX-g.current.x,te=R.clientY-g.current.y;if(k.current==="none"){if(Math.abs(ee)<10&&Math.abs(te)<10)return;if(Math.abs(ee)>Math.abs(te)){if(t.length<=1)return;k.current="horizontal"}else if(te>0)k.current="vertical";else return}if(k.current==="horizontal"){f.current=!0,w(!0),b.current=ee,E(ee),z.preventDefault();return}k.current==="vertical"&&(f.current=!0,w(!0),x.current=te,L(te),z.preventDefault())},de=()=>{if(!g.current)return;const z=k.current,R=f.current;if(R&&z==="horizontal")K(b.current),Ce();else if(R&&z==="vertical")if(x.current>HS){const te=window.innerHeight;x.current=te,I(!0),L(te),G("closing")}else x.current=0,L(0),Ce();else z==="horizontal"&&Math.abs(b.current)>0&&(K(b.current),Ce());g.current=null,k.current="none",b.current=0,f.current=!1,w(!1)};return document.addEventListener("touchstart",Z,{passive:!0}),document.addEventListener("touchmove",ne,{passive:!1}),document.addEventListener("touchend",de),document.addEventListener("touchcancel",de),()=>{document.removeEventListener("touchstart",Z),document.removeEventListener("touchmove",ne),document.removeEventListener("touchend",de),document.removeEventListener("touchcancel",de),xe()}},[_,t.length,c,l,O,N,oe]),s.useEffect(()=>{const ge=xe=>{xe.key==="Escape"&&(xe.preventDefault(),xe.stopPropagation(),_!=="closing"&&G("closing"))};return window.addEventListener("keydown",ge,!0),()=>window.removeEventListener("keydown",ge,!0)},[_]);const Q=()=>{_!=="closing"&&G("closing")},be=_==="open",Pe=_==="closing",ye=$>0?Math.max(0,1-$/500):1,ce=$>0?Math.max(.35,1-$/500):1,Y=ge=>{if(ge.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const xe=ge.currentTarget.getBoundingClientRect(),Ce=ge.clientY-xe.top,h=Math.min(52,xe.height*.2);if(!(Ce>xe.height-h)){if(ge.clientX-xe.left<xe.width/2){l();return}c()}},se=ge=>{if(t.length<=1)return;const xe=ge.currentTarget.getBoundingClientRect(),Ce=ge.clientX-xe.left,h=ge.clientY-xe.top,K=Math.min(52,xe.height*.2);if(h>xe.height-K){ge.currentTarget.style.cursor="default";return}ge.currentTarget.style.cursor=Ce<xe.width/2?"w-resize":"e-resize"},pe=s.useCallback(ge=>{ge.propertyName!=="transform"||!W.current||(oe(),O(!1))},[oe,O]),fe=ae?`translateX(${D}px)`:$>0?`translateY(${$}px)`:void 0,we={position:"fixed",top:B==null?void 0:B.top,left:B==null?void 0:B.left,width:B==null?void 0:B.width,height:B==null?void 0:B.height,objectFit:i==="cover"?"cover":"contain",transform:fe,opacity:$>0?ce:_==="opening"||Pe?0:1,transition:V&&!T?"none":T?`transform ${Yn}ms ${Oi}`:q?`transform ${Yn}ms ${Oi}, opacity ${Yn}ms ${Oi}`:_==="opening"||Pe?`opacity ${Yn}ms ${Oi}`:"none",pointerEvents:ie&&be&&!ae?"auto":"none",touchAction:ie&&be?"none":void 0,zIndex:9998},Re=B?{position:"fixed",top:B.top,height:B.height,width:B.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:_==="open"?"none":void 0},onClick:Q,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:be?ye:0,transition:V?"none":`opacity ${Yn}ms ${Oi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:y?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:v,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:be?1:0,transition:`opacity ${Yn}ms ${Oi}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:d,style:u,children:[n+1," / ",t.length]})})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:v,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:be?1:0,transition:`opacity ${Yn}ms ${Oi}`},children:t.length>1&&a.jsxs("p",{className:d,style:u,children:[n+1," / ",t.length]})})]})}),B&&j&&(ie?a.jsx(ZS,{src:j.url,phase:_,mediaRef:m,mediaStyle:we,onLoadedMetadata:le,onClick:Y,onMouseMove:se,onTransitionEnd:pe},`${n}-${j.url}`):a.jsx("img",{ref:m,src:j.url,alt:j.name,onLoad:le,onTransitionEnd:pe,style:we},`${n}-${j.url}`)),be&&Re&&t.length>1&&!ie&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Re,left:B.left,cursor:"w-resize",pointerEvents:ae?"none":"auto"},onClick:ge=>{if(S.current){S.current=!1;return}ge.stopPropagation(),l()}}),a.jsx("div",{style:{...Re,left:B.left+B.width/2,cursor:"e-resize",pointerEvents:ae?"none":"auto"},onClick:ge=>{if(S.current){S.current=!1;return}ge.stopPropagation(),c()}})]})]})}function cd({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:r,isEditor:l,galleryPaddingBetween:c=0,showPaddingAfter:d=!1,showControls:u=!1,onMediaClick:p}){const y=`${e}-gallery-${Xs(t)?"video":"image"}`,v=r.display==="cover",m=KS(r),g=_=>F.scalingValue(_,l??!1),x=n??po,b=o?{width:"100%",maxWidth:"100%"}:{width:g(x),maxWidth:"100%"},k=i?{borderRadius:g(i)}:{},f={...b,...v?{aspectRatio:m,height:"auto",overflow:"hidden"}:{},...k},S={...v?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":g(x)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...v?{}:k},U={className:y,style:S,onClick:p?_=>{_.stopPropagation(),p()}:void 0},B=Math.max(c,Jn),P=Xs(t)?a.jsx("video",{...U,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...U,src:t.url,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[v?a.jsx("div",{style:f,children:P}):P,d&&c>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:g(c)},"aria-hidden":"true"}),u&&d&&a.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:g(B)}})]})}function QS({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:c,showControls:d,scaled:u,children:p}){const y=t==="a"?i:t==="c"?o:0,v=y>0||d;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&v&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(y)},"aria-hidden":"true"}),d&&t==="c"&&a.jsx("div",{"data-controls":"galleryPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(c),className:`${e}-control-anchor`,style:{top:0,left:0,width:u(l),height:"100%"}}),a.jsx("div",{className:`${e}-gallery`,style:n,children:p}),t==="a"&&v&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(y)},"aria-hidden":"true"}),d&&t==="a"&&a.jsx("div",{"data-controls":"galleryPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(c),className:`${e}-control-anchor`,style:{top:0,right:0,width:u(r),height:"100%"}})]})}function ew(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function Kr({P:e,controlKey:t,scaled:n,height:i,paired:o,side:r}){return a.jsx("div",{"data-controls":t,...o?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{...r==="top"?{top:0}:{bottom:0},left:0,width:"100%",height:n(i)}})}function dd({P:e,controlKey:t,scaled:n,width:i,maxFraction:o,side:r,paired:l,anchorStyle:c}){return a.jsx("div",{"data-controls":t,...l?{"data-controls-paired":""}:{},"data-controls-axis":"x","data-controls-variant":"column-padding",...r==="right"?{"data-controls-reverse":""}:{},"data-controls-min":"0","data-controls-max-fraction":String(o),className:`${e}-control-anchor`,style:{top:0,...r==="left"?{left:0}:{right:0},width:n(i),height:"100%",...c}})}function Ss({P:e,title:t,description:n,position:i,titleRef:o,titleClassName:r,titleContainerStyle:l,titleTextBoxStyle:c,titleStyle:d,descriptionClassName:u,descriptionStyle:p,descriptionPadding:y,showTextBoxOutline:v=!1,showDescriptionPaddingControl:m=!1,descriptionPaddingPaired:g=!1,topPaddingControl:x,bottomPaddingControl:b}){const k=s.useRef(null),[f,S]=s.useState(0),W=t??"",U=n??"",B=U.length>0,{horizontal:P,vertical:_}=Dl(i),G=_==="center"||_==="bottom",$=_==="bottom";s.useLayoutEffect(()=>{if(!G)return;const T=k.current;if(!T||typeof ResizeObserver>"u")return;const C=()=>S(T.offsetHeight);C();const V=new ResizeObserver(C);return V.observe(T),()=>V.disconnect()},[W,U,G]);const L=a.jsx("span",{className:`${e}-title-text`,style:d,children:W}),D=B?a.jsx("span",{className:u,style:p,children:U}):null,E=B?a.jsx("div",{className:`${e}-title-texts-gap`,style:{height:y},children:m&&a.jsx("div",{"data-controls":"titleDescriptionPadding",...g?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{top:0,left:0,width:"100%",height:"100%"}})}):null;return a.jsx("div",{ref:T=>{k.current=T,o(T)},className:[r,`${e}-title-h-${P}`,`${e}-title-v-${_}`].join(" "),style:{...G?{[`--${e}-title-height`]:`${f}px`}:{},...l},children:a.jsxs("div",{className:`${e}-title-text-stack`,style:c,children:[x,a.jsx("div",{className:v?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:a.jsx("div",{className:`${e}-title-texts`,children:$?a.jsxs(a.Fragment,{children:[D,E,L]}):a.jsxs(a.Fragment,{children:[L,E,D]})})}),b]})})}const ud=45;function pd(e,t,n){let i=e;for(;i;){const o=getComputedStyle(i).getPropertyValue(t).trim();if(o){const r=parseFloat(o);if(!Number.isNaN(r))return r}i=i.parentElement}return n}function tw(e){const t=pd(e,"--cntrl-viewport-height",window.innerHeight),n=pd(e,"--cntrl-article-top",0);return{top:n,height:t,centerY:n+t/2}}function nw(e,t,n){const{vertical:i}=Dl(t),{top:o,height:r,centerY:l}=tw(n);if(i==="top"){const d=n&&parseFloat(getComputedStyle(n).top)||o;return Math.abs(e.top-d)}if(i==="bottom")return Math.abs(e.bottom-(o+r));const c=e.top+e.height/2;return Math.abs(c-l)}function iw(e,t,n){const i=Array.from({length:t},(l,c)=>{const d=e.current[c];if(!d)return 0;const u=d.getBoundingClientRect(),p=nw(u,n,d);return Math.exp(-(p*p)/(2*ud*ud))});let o=0,r=-1;return i.forEach((l,c)=>{l>r&&(r=l,o=c)}),{opacities:i,dominantIndex:o}}function ow(e,t,n){const i=s.useRef([]),[{opacities:o,dominantIndex:r},l]=s.useState(()=>({opacities:Array.from({length:e},(d,u)=>u===0?1:0),dominantIndex:0}));return s.useLayoutEffect(()=>{if(!t||e===0){l({opacities:Array.from({length:e},()=>1),dominantIndex:0});return}let d=0;const u=()=>{l(iw(i,e,n))},p=()=>{d||(d=window.requestAnimationFrame(()=>{d=0,u()}))};return u(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p,{passive:!0}),()=>{d&&window.cancelAnimationFrame(d),window.removeEventListener("scroll",p),window.removeEventListener("resize",p)}},[t,e,n]),{setTitleRef:d=>u=>{i.current[d]=u},opacities:o,dominantIndex:r}}function md(e,t){const[n,i]=s.useState(e),o=s.useRef(e);return s.useEffect(()=>{if(!t){o.current=e,i(e);return}const r=Array.from(o.current),l=Array.from(e),c=Math.max(r.length,l.length);if(c===0||o.current===e)return;let d=0;const u=window.setInterval(()=>{d+=1;const p=[...l.slice(0,d),...r.slice(d)].join("");o.current=p,i(p),d>=c&&window.clearInterval(u)},70);return()=>window.clearInterval(u)},[t,e]),n}function rw({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var dt,Pt;const{prefix:l}=F.useScopedStyles(),c=s.useMemo(()=>AS(l),[l]),d=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",y=(e==null?void 0:e.imgWidth)??po,v=(e==null?void 0:e.titleWidth)??qS,m=US(e==null?void 0:e.imageDisplay),g=(e==null?void 0:e.cornerRadius)??ES,x=NS(e==null?void 0:e.position),{horizontal:b,vertical:k}=Dl(x),f=(e==null?void 0:e.titleTopPadding)??0,S=(e==null?void 0:e.titleBottomPadding)??0,W=(e==null?void 0:e.titleLeftPadding)??0,U=(e==null?void 0:e.titleRightPadding)??0,B=(e==null?void 0:e.titleDescriptionPadding)??0,P=ew(e==null?void 0:e.transition),_=(e==null?void 0:e.lightbox)??"on",G=p==="b",$=P==="fade"||P==="retype",{setTitleRef:L,dominantIndex:D}=ow(d.length,$,x),E=((dt=d[D])==null?void 0:dt.title)??"",T=((Pt=d[D])==null?void 0:Pt.description)??"",C=md(E,P==="retype"),V=md(T,P==="retype"),w=P==="fade"||P==="retype",q=P==="retype"?C:E,I=P==="retype"?V:T,A=G?void 0:{width:F.scalingValue(y,n??!1)},j=_==="on"&&(!n||i||o),ie=o??!1,ae=(e==null?void 0:e.galleryPaddingRight)??0,O=(e==null?void 0:e.galleryPaddingLeft)??0,oe=(e==null?void 0:e.galleryPaddingBetween)??0,N=St=>F.scalingValue(St,n??!1),Q={width:N(v)},be=p==="a"?ae:O,Pe=G?{width:"100%"}:{width:`calc(100% - ${N(y)} - ${N(be)})`,...p==="c"?{marginLeft:"auto"}:{}},ye=Math.max(ae,Jn),ce=Math.max(O,Jn),Y=Math.max(oe,Jn),se=Math.max(f,Jn),pe=Math.max(S,Jn),fe=Math.max(W,Jn),we=Math.max(U,Jn),Re=Math.max(B,Jn),ge=Math.max(0,(u??1)-(y??po)),xe=p==="a"?Math.max(0,(u??1)-(y??po)-ae):p==="c"?Math.max(0,(u??1)-(y??po)-O):p==="b"?u??1:1,Ce=ie&&k==="top",h=ie&&k==="bottom",K=ie&&b==="left",Z=ie&&b==="right",ne=d.length>1,de=G?void 0:N((p==="c"?O:ae)+(y??po)),z=p==="c"&&de?{left:de}:void 0,R=p==="a"&&de?{right:de}:void 0,ee=G?{left:0,width:"100%"}:p==="a"?{right:N(ae),width:N(y)}:{left:N(O),width:N(y)},{titleColor:te,titleFontFamily:me,titleFontSettings:X,titleFontSize:Ie,titleLineHeight:Se,titleLetterSpacing:J,titleWordSpacing:He,titleAlign:We,titleTextAppearance:ot,descriptionColor:qe,descriptionFontFamily:tt,descriptionFontSettings:et,descriptionFontSize:Ge,descriptionLineHeight:ve,descriptionLetterSpacing:_e,descriptionWordSpacing:Be,descriptionAlign:Ze,descriptionTextAppearance:$e,lightboxCounterColor:Ne,lightboxCounterFontFamily:Ue,lightboxCounterFontSettings:Je,lightboxCounterFontSize:st,lightboxCounterLineHeight:it,lightboxCounterLetterSpacing:Oe,lightboxCounterWordSpacing:Ae,lightboxCounterTextAppearance:gt}=e??{},ze={fontSettings:{fontFamily:me,fontWeight:(X==null?void 0:X.fontWeight)??400,fontStyle:(X==null?void 0:X.fontStyle)??"normal"},fontSize:Ie??.01,lineHeight:Se,letterSpacing:J??0,wordSpacing:He??0,textAlign:We??"left",textAppearance:ot,color:te??"#000000"},Xe=dn(Qt(ze,n)),ct=Q,he={...bs(Ie,Se,l,n),...bs(Ge,ve,l,n,"description-leading-gap")},Ee=xs(Ie,Se,`${l}-title`,`${l}-text-tight-leading`),nt={fontSettings:{fontFamily:tt,fontWeight:(et==null?void 0:et.fontWeight)??400,fontStyle:(et==null?void 0:et.fontStyle)??"normal"},fontSize:Ge??.01,lineHeight:ve,letterSpacing:_e??0,wordSpacing:Be??0,textAlign:Ze??"left",textAppearance:$e,color:qe??"#000000"},pt=dn(Qt(nt,n)),Ve=xs(Ge,ve,`${l}-description-text`,`${l}-description-tight-leading`),vt=N(ie?Re:B),Rt={fontSettings:{fontFamily:Ue,fontWeight:(Je==null?void 0:Je.fontWeight)??400,fontStyle:(Je==null?void 0:Je.fontStyle)??"normal"},fontSize:st??.01,lineHeight:it,letterSpacing:Oe??0,wordSpacing:Ae??0,textAppearance:gt,color:Ne??"#DEDDDD"},wt={...dn(Qt(Rt,n)),...bs(st,it,l,n)},Vt=xs(st,it,`${l}-lightbox-counter`,`${l}-text-tight-leading`),jt=F.buildColorVars(l,{titleColor:te??"#000000",descriptionColor:qe??"#000000",lightboxCounterColor:Ne??"#DEDDDD"},OS,DS),Kt=s.useRef(null),[Yt,kt]=s.useState(!1),[Bt,rn]=s.useState([]),[xt,yt]=s.useState(0),Me=s.useCallback((St,ht)=>{j&&(rn(St),yt(ht),kt(!0))},[j]),Qe=s.useCallback(()=>{kt(!1)},[]),rt=s.useMemo(()=>{const St={...jt},ht=Kt.current?getComputedStyle(Kt.current).getPropertyValue("--cntrl-article-width").trim():"";return ht&&(St["--cntrl-article-width"]=ht),St},[jt,Yt]);return s.useEffect(()=>{if(!Yt||_!=="on"||typeof document>"u")return;const St=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=St}},[Yt,_]),s.useEffect(()=>{!n||o||i||kt(!1)},[n,o,i]),s.useEffect(()=>{_==="off"&&kt(!1)},[_]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx("div",{style:jt,children:a.jsxs("div",{ref:Kt,className:`${l}-wrapper`,style:{width:F.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:k==="top"?N(f):void 0,[`--${l}-title-bottom-padding`]:k==="bottom"?N(S):void 0,[`--${l}-title-left-padding`]:b==="left"?N(W):void 0,[`--${l}-title-right-padding`]:b==="right"?N(U):void 0},children:[w&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(Ss,{P:l,title:q,description:I,position:x,titleRef:()=>{},titleClassName:`${Ee} ${l}-single-title`,titleContainerStyle:{...he,...Pe},titleTextBoxStyle:ct,titleStyle:Xe,descriptionClassName:Ve,descriptionStyle:pt,descriptionPadding:vt,showTextBoxOutline:ie,showDescriptionPaddingControl:ie,topPaddingControl:Ce?Kr({P:l,controlKey:"titleTopPadding",scaled:N,height:se,paired:!1,side:"top"}):void 0,bottomPaddingControl:h?Kr({P:l,controlKey:"titleBottomPadding",scaled:N,height:pe,paired:!1,side:"bottom"}):void 0})}),d.map((St,ht)=>{const Wt=VS(St.gallery),Tt=ht<d.length-1,Ot=Wt.filter(Mt=>Mt.lightboxMedia).map(Mt=>Mt.lightboxMedia),Gt={P:l,position:x,titleRef:L(ht),titleClassName:Ee,titleContainerStyle:he,titleTextBoxStyle:w?{maxWidth:"100%"}:ct,titleStyle:Xe,descriptionClassName:Ve,descriptionStyle:pt,descriptionPadding:vt,showTextBoxOutline:ie&&!w,showDescriptionPaddingControl:ie&&!w,descriptionPaddingPaired:ne,topPaddingControl:Ce&&!w?Kr({P:l,controlKey:"titleTopPadding",scaled:N,height:se,paired:ne,side:"top"}):void 0,bottomPaddingControl:h&&!w?Kr({P:l,controlKey:"titleBottomPadding",scaled:N,height:pe,paired:ne,side:"bottom"}):void 0};return a.jsxs("div",{"data-item-index":ht,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Tt?N(oe):void 0},children:[K&&dd({P:l,controlKey:"titleLeftPadding",scaled:N,width:fe,maxFraction:xe,side:"left",paired:ne,anchorStyle:z}),Z&&dd({P:l,controlKey:"titleRightPadding",scaled:N,width:we,maxFraction:xe,side:"right",paired:ne,anchorStyle:R}),ie&&Tt&&a.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${l}-control-anchor`,style:{bottom:0,height:N(Y),...ee}}),G?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:Wt.map(({displayMedia:Mt,lightboxMedia:_t},Ft)=>{const ut=_t?Ot.findIndex(H=>H.url===_t.url):-1;return a.jsx(cd,{P:l,media:Mt,imgWidth:y||void 0,cornerRadius:g||void 0,imageDisplay:m,isEditor:n,galleryPaddingBetween:oe,showPaddingAfter:Ft<Wt.length-1,showControls:ie,onMediaClick:j&&ut>=0?()=>Me(Ot,ut):void 0},`${Mt.url}-${Ft}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(Ss,{...Gt,title:w?"":St.title,description:w?"":St.description})})]}):a.jsxs(a.Fragment,{children:[a.jsx(Ss,{...Gt,title:w?"":St.title,description:w?"":St.description}),Wt.length>0&&a.jsx(QS,{P:l,layoutType:p,galleryWidthStyle:A,galleryPaddingRight:ae,galleryPaddingLeft:O,galleryPaddingRightWidth:ye,galleryPaddingLeftWidth:ce,galleryPaddingMaxFraction:ge,showControls:ie,scaled:N,children:Wt.map(({displayMedia:Mt,lightboxMedia:_t},Ft)=>{const ut=_t?Ot.findIndex(H=>H.url===_t.url):-1;return a.jsx(cd,{P:l,media:Mt,cornerRadius:g||void 0,fillGalleryWidth:!0,imageDisplay:m,isEditor:n,galleryPaddingBetween:oe,showPaddingAfter:Ft<Wt.length-1,showControls:ie,onMediaClick:j&&ut>=0?()=>Me(Ot,ut):void 0},`${Mt.url}-${Ft}`)})})]})]},ht)})]})}),Yt&&_==="on"&&typeof document<"u"&&e&&(()=>{const St=(r?document.getElementById(r):null)??document.body;return Gn.createPortal(a.jsx("div",{style:rt,"data-selection":"none",children:a.jsx(JS,{prefix:l,items:Bt,index:xt,imageDisplay:YS(e.lightboxImageDisplay),isEditor:n,onClose:Qe,onPrev:()=>yt(ht=>(ht-1+Bt.length)%Bt.length),onNext:()=>yt(ht=>(ht+1)%Bt.length),counterClassName:Vt,counterStyle:wt,backgroundColor:e.backgroundColor??_S})}),St)})()]})}const aw=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
21102
21130
|
import { createPortal } from 'react-dom';
|
|
21103
21131
|
import type React from 'react';
|
|
21104
21132
|
import { CommonComponentProps } from '../props';
|
|
@@ -23438,7 +23466,7 @@ export function Mercury({
|
|
|
23438
23466
|
object-fit: cover;
|
|
23439
23467
|
object-position: center;
|
|
23440
23468
|
}
|
|
23441
|
-
`}function fp(e){return Number(e.toFixed(4))}function gd(e,t,n,i){const r=(typeof e=="string"?Number(e):e)??t;return Number.isFinite(r)?Math.min(i,Math.max(n,Math.round(r))):t}function
|
|
23469
|
+
`}function fp(e){return Number(e.toFixed(4))}function gd(e,t,n,i){const r=(typeof e=="string"?Number(e):e)??t;return Number.isFinite(r)?Math.min(i,Math.max(n,Math.round(r))):t}function ws(e,t,n=0,i=9999){const r=(typeof e=="string"?Number(e):e)??t;return Number.isFinite(r)?Math.min(i,Math.max(n,r)):t}function Lw(e){return typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"2:3",reversed:(e==null?void 0:e.reversed)??!1}}function Pw(e){const[t,n]=e.ratioValue.split(":").map(Number),i=e.reversed?n:t;return(e.reversed?t:n)/i}function Iw(e){return e.type==="video"?!0:e.type==="image"?!1:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.name??"")||/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url??"")}function yp(e,t){return(1-e)/(1-e*Math.cos(t))}function Rw(e){let t=0;for(let n=0;n<360;n+=1){const i=n*Math.PI/180;t=Math.max(t,Math.abs(Math.sin(i)*yp(e,i)))}return t||1}function kw(e,t){return e?1:1+hp*(.35+t)}function Ew(e,t,n,i){const o=t*kw(n,i);return Math.max(0,(e-o)/2)}function Mw(e,t,n){const i=yp(e,n);return{offset:Math.sin(n)*i/t,scale:i}}function Aw(e,t,n){return e/2+t*n}function Fw(e,t,n){return`translate(calc(${e(t)} - var(--helix-base-w) / 2), -50%) scale(${fp(n)})`}function Nw(e){return Math.round(e*1e3)}function vp(e,t,n){const i=Math.cos(e),o=Math.cos(Cw*Math.PI/2);if(i>=o)return n;const r=(i+1)/(o+1);return fp(t+(n-t)*r)}function _w(e){return vp(e,bw,Sw)}function Hw(e){return vp(e,ww,$w)}function Ww(e,t){if(!t)return"none";const n=Hw(e);return n<=0?"none":`blur(${n}px)`}function hd(e,t){const n=t*Math.PI*2,{offset:i,scale:o}=Mw(e.depthFactor,e.spreadFactor,n),r=Aw(e.width,e.orbitRadius,i);return{transform:Fw(e.scaled,r,o),zIndex:Nw(o),opacity:_w(n),filter:Ww(n,e.blurEnabled)}}function xp(e,t){return(e%t+t)%t}function Ow(e,t){return zl(e,t)/t}function zl(e,t){return xp(e,t)}function Dw(e,t){return Math.floor(e/t)}function zw(e,t,n,i){return Dw(e,t)*n+zl(e,t)*i}function fd(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function ua(e){const t=e%1;return t<0?t+1:t}function Bw(e,t,n){const i=t/gp,o=n==="left"?-e*i:e*i;return ua(o)}function jw({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=F.useScopedStyles(),r=s.useRef(null),l=ws((e==null?void 0:e.width)??(e==null?void 0:e.spread)??(e==null?void 0:e.wrapperWidth),pw),c=ws(e==null?void 0:e.imageWidth,mw),d=ws(e==null?void 0:e.turnHeight,gw),u=gd(e==null?void 0:e.itemsPerTurn,hw,3,40),p=gd(e==null?void 0:e.turns,fw,1,30),y=Math.min(xw,Math.max(0,yw)),v=Math.min(1,Math.max(0,vw)),m=Math.max(0,(e==null?void 0:e.speed)??gp),g=(e==null?void 0:e.direction)==="left"?"left":"right",x=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",b=(e==null?void 0:e.cornerRadius)??0,k=(e==null?void 0:e.blur)!=="off",f=s.useMemo(()=>Lw(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),S=f.display==="cover",W=N=>F.scalingValue(N,n??!1),U=s.useMemo(()=>Rw(y),[y]),B=s.useMemo(()=>Ew(l,c,S,v),[l,c,S,v]),P=s.useMemo(()=>Tw(o),[o]),_=s.useMemo(()=>({scaled:N=>F.scalingValue(N,n??!1),width:l,orbitRadius:B,depthFactor:y,spreadFactor:U,blurEnabled:k}),[n,l,B,y,U,k]),G=s.useRef([]),$=s.useRef(0),L=s.useMemo(()=>(t??[]).filter(N=>{var le;return!!((le=N.image)!=null&&le.url)}),[t]),D=d/u,E=c*Pw(f),T=Math.min(dw,p*u),C=uw*u,V=T+C*2,q=Math.max(0,p-1)*d+(u-1)*D,I=m>0,A=x==="scroll"&&I,j=x==="autoplay"&&I&&(n?!!i:!0),ie=j?360/(m*cw):0,ae=L.length===0?0:V,O=s.useMemo(()=>Array.from({length:ae},(N,le)=>Ow(le-C,u)),[ae,C,u]);s.useEffect(()=>{if(!j&&!A)return;const N=r.current;if(!N)return;const le=pe=>{$.current=pe,O.forEach((fe,we)=>{const Re=G.current[we];if(!Re)return;const ge=hd(_,ua(fe+pe));Re.style.transform=ge.transform,Re.style.zIndex=String(ge.zIndex),Re.style.opacity=String(ge.opacity),Re.style.filter=ge.filter})};if(A){const pe=N.ownerDocument.defaultView??window,fe=()=>{const Re=N.getBoundingClientRect(),ge=pe.innerHeight||N.ownerDocument.documentElement.clientHeight,xe=ge+Re.height;if(xe<=0)return;const Ce=Math.min(1,Math.max(0,(ge-Re.top)/xe));le(Bw(Ce,m,g))};fe(),pe.addEventListener("scroll",fe,{passive:!0,capture:!0}),pe.addEventListener("resize",fe);const we=new ResizeObserver(fe);return we.observe(N),()=>{pe.removeEventListener("scroll",fe,{capture:!0}),pe.removeEventListener("resize",fe),we.disconnect()}}const Q=g==="left"?-1:1;let be=null,Pe=null;const ye=pe=>{if(Pe!==null){const fe=(pe-Pe)/1e3/ie*Q;$.current=ua($.current+fe)}Pe=pe,le($.current),be=requestAnimationFrame(ye)},ce=()=>{be===null&&(Pe=null,be=requestAnimationFrame(ye))},Y=()=>{be!==null&&cancelAnimationFrame(be),be=null},se=new IntersectionObserver(([pe])=>{pe!=null&&pe.isIntersecting?ce():Y()});return se.observe(N),()=>{Y(),se.disconnect()}},[j,A,O,_,ie,m,g]);const oe=j||A?$.current:0;return L.length===0?a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:P}}),a.jsx("div",{className:`${o}-wrapper`,style:{width:W(l)}})]}):a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:P}}),a.jsx("div",{ref:r,className:`${o}-wrapper`,style:{width:W(l),height:W(q)},children:Array.from({length:V},(N,le)=>{const Q=le-C,Pe=L[xp(Q,L.length)].image,ye=zl(Q,u),ce=O[le],Y=zw(Q,u,d,D),se=v===0?0:(fd(ye+7.3)-.5)*v*D,pe=S?1:1+(fd(ye+3.1)-.5)*2*hp*(.35+v),fe=c*pe,we={"--helix-base-w":W(fe),...S?{"--helix-base-h":W(E)}:{}},Re={top:W(Y+se),...we,...hd(_,ua(ce+oe))},ge=b>0?{borderRadius:W(b)}:{},xe=S?{...ge,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}:ge,Ce=Iw(Pe)?a.jsx("video",{className:`${o}-media`,style:xe,src:Pe.url,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:`${o}-media`,style:xe,src:Pe.url,alt:Pe.name??"",loading:"lazy",decoding:"async"});return a.jsx("div",{ref:h=>{G.current[le]=h},className:S?`${o}-item ${o}-item-cover`:`${o}-item`,style:Re,children:S?a.jsx("div",{className:`${o}-cover`,style:ge,children:Ce}):Ce},`${p}-${u}-${Q}`)})})]})}const Vw=`import { useEffect, useMemo, useRef, type CSSProperties } from 'react';
|
|
23442
23470
|
import { CommonComponentProps } from '../props';
|
|
23443
23471
|
import { scalingValue } from '../utils/scalingValue';
|
|
23444
23472
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -23998,7 +24026,7 @@ export function Helix({
|
|
|
23998
24026
|
</>
|
|
23999
24027
|
);
|
|
24000
24028
|
}
|
|
24001
|
-
`,Gw=["https://cdn.cntrl.site/component-assets/Helix-default-1.png","https://cdn.cntrl.site/component-assets/Helix-default-2.png","https://cdn.cntrl.site/component-assets/Helix-default-3.png","https://cdn.cntrl.site/component-assets/Helix-default-4.png","https://cdn.cntrl.site/component-assets/Helix-default-5.png"],Xw={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,deleteImageDeletesEntry:!0,allowsVideo:!0},display:{type:"array"},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"]}}}}},default:Gw.map(e=>({image:{url:e,name:""}}))},settings:{sizing:"auto auto",properties:{width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},imageWidth:{type:"number",scope:"layout",title:"Img width",display:{type:"numeric-input"},min:0,max:9999},turnHeight:{type:"number",scope:"layout",title:"Turn height",display:{type:"numeric-input"},min:0,max:9999},itemsPerTurn:{type:"number",scope:"common",title:"Per turn",display:{type:"common-numeric-input"},min:3,max:40},turns:{type:"number",scope:"common",title:"Turns",display:{type:"common-numeric-input"},min:1,max:30},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"]},playback:{type:"string",scope:"common",title:"Playback",display:{type:"toggle-cycle",enum:["autoplay","scroll"]}},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"}}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",display:{type:"numeric-input"},min:0,max:9999},blur:{type:"string",scope:"common",title:"Blur",display:{type:"toggle-cycle",enum:["on","off"]}}},defaults:{itemsPerTurn:14,turns:3,direction:"right",playback:"autoplay",blur:"off",imageDisplay:{display:"cover",ratioValue:"2:3",reversed:!1}},layoutDefaults:{d:{defaultPaddingTop:30/1440,width:800/1440,imageWidth:160/1440,turnHeight:380/1440,speed:2.2,cornerRadius:0},m:{defaultPaddingTop:10/375,width:320/375,imageWidth:75/375,turnHeight:310/375,speed:2.8,cornerRadius:0},t:{defaultPaddingTop:20/768,width:620/768,imageWidth:100/768,turnHeight:280/768,speed:2.8,cornerRadius:0}},layout:["__componentName__","width","imageWidth","turnHeight","itemsPerTurn","turns","playback","speed","direction","imageDisplay","cornerRadius","blur"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",items:["direction","speed"]},{type:"row",items:["width"]},{type:"row",items:["imageWidth","turnHeight"]},{type:"row",items:["cornerRadius","imageDisplay"]},{type:"row",items:["itemsPerTurn","turns"]},{type:"row",items:["playback","blur"]}]}]},qw={element:jw,id:"helix",name:"Helix",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Helix.mp4"},version:1,defaultSize:{d:{width:720,height:540}},schema:Xw,sourceCode:Vw,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},$n=300,nn=300,Uw=8/1440,go=.004,Kw=50,Yw=1440,ji=Kw/Yw;function Zw(e){if(e==="default"||e==="compact"||e==="open")return e;if(e==="onScroll")return"compact"}function Jw(e){return e==="center"||e==="right"?e:"left"}function Qw(e){return e==="left"||e==="right"?e:"center"}function e$(e,t,n){const i=F.scalingValue(t,n);return e==="center"?`translateX(calc(-50% + ${i}))`:`translateX(${i})`}function t$(e,t){if(e&&typeof e=="object"){if(t&&typeof e[t]=="string")return e[t];for(const n in e)if(typeof e[n]=="string")return e[n];return}return e}function bp(e,t){const n=(t$(e,t)??"always").trim().toLowerCase().replace(/[_-]+/g," ");return n==="open only"||n==="openonly"?"open only":n==="open and compact"||n==="openandcompact"?"open and compact":n==="default and open"||n==="defaultandopen"?"default and open":n==="default and compact"||n==="defaultandcompact"?"default and compact":"always"}function n$(e,t,n){switch(bp(e.showIn,n)){case"open only":return!1;case"open and compact":return t==="compact";case"default and compact":return!0;case"default and open":return t==="default";default:return!0}}function i$(e,t){switch(bp(e.showIn,t)){case"default and compact":return!1;default:return!0}}function o$(e){return(e==null?void 0:e.find(t=>t.slug===""))??(e==null?void 0:e[0])}function r$(e,t){const n=e?t==null?void 0:t.find(i=>i.id===e):o$(t);return!e&&!n?"":n?n.slug===""?"/":`/${n.slug}`:e.startsWith("/")||e.startsWith("#")||/^[a-z][a-z\d+\-.]*:/i.test(e)?e:t?`/${e}`:e}function yd(e){const t=(e??"").toLowerCase();return t==="blank"||t==="_blank"||t.includes("new")}function Sp(e){const t=e.link;if(t&&typeof t=="object"){const i=yd(t.target)?"_blank":void 0;if(t.type==="url")return{type:"url",value:t.value??t.url??"",target:i};if(t.type==="anchor")return{type:"anchor",value:t.value??"",target:i};if(t.type==="page")return{type:"page",value:t.value??"",target:i,anchor:t.anchor};if(typeof t.url=="string")return{type:"url",value:t.url,target:i}}const n=yd(e.openIn)?"_blank":void 0;return e.mode==="url"?{type:"url",value:e.url??"",target:n}:{type:"page",value:e.page??"",target:n,anchor:e.anchor}}function qs(e,t){const n=e.label||"Link",i=Sp(e);if(i.type==="url")return{label:n,href:i.value,target:i.target};if(i.type==="anchor"){const c=i.value.replace(/^#/,"");return{label:n,href:c?`#${c}`:"",target:i.target}}const o=r$(i.value,t),r=(i.anchor??"").replace(/^#/,""),l=r?o?`${o}#${r}`:`#${r}`:o;return{label:n,href:l,target:i.target}}const xi=24,vi=xi*.125,wp=xi*.125,ws=(xi-(3*vi+2*wp))/2,vd=vi+wp;function a$({className:e,lineClassName:t}){return a.jsxs("svg",{className:e,viewBox:`0 0 ${xi} ${xi}`,"aria-hidden":"true",children:[a.jsx("rect",{className:`${t} ${t}-top`,x:"0",y:ws,width:xi,height:vi,rx:vi/2}),a.jsx("rect",{className:`${t} ${t}-mid`,x:"0",y:ws+vd,width:xi,height:vi,rx:vi/2}),a.jsx("rect",{className:`${t} ${t}-bot`,x:"0",y:ws+2*vd,width:xi,height:vi,rx:vi/2})]})}function s$(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function l$(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:F.scalingValue((o-t)/2,i)}}const $p=.004;let er;function c$(){return er!==void 0?er:typeof document>"u"?(er=null,null):(er=document.createElement("canvas").getContext("2d"),er)}function d$(e){const t=getComputedStyle(e),n=parseFloat(t.fontSize)||0;if(n<=0)return 0;const i=c$();if(!i)return 0;i.font=`${t.fontStyle} ${t.fontWeight} ${n}px ${t.fontFamily}`;const o=i.measureText("H"),r=o.actualBoundingBoxAscent>0?o.actualBoundingBoxAscent:0,l=Math.max(0,o.actualBoundingBoxDescent||0),c=o.fontBoundingBoxAscent||0,d=o.fontBoundingBoxDescent||0;return r<=0||c<=0&&d<=0?0:(d-l-(c-r))/2/n}function xd(e,t){const[n,i]=s.useState(0);return s.useLayoutEffect(()=>{const o=e.current;if(!o)return;const r=()=>{const d=d$(o);i(u=>Math.abs(u-d)<$p?u:d)};r();const l=document.fonts;l.ready.then(r).catch(()=>{}),l.addEventListener("loadingdone",r);const c=new ResizeObserver(r);return c.observe(o),()=>{l.removeEventListener("loadingdone",r),c.disconnect()}},[e,t]),n}function bd(e){if(!(Math.abs(e)<$p))return`translateY(${e}em)`}function Sd(e){var t,n;return[e.fontFamily??"",((t=e.fontSettings)==null?void 0:t.fontWeight)??400,((n=e.fontSettings)==null?void 0:n.fontStyle)??"normal",e.fontSize??"",e.lineHeight??""].join("\0")}function wd(e){return{fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontSize:e.fontSize,lineHeight:e.lineHeight,position:"absolute",top:0,left:0,visibility:"hidden",pointerEvents:"none",whiteSpace:"nowrap"}}function $d(e,t={}){return{fontFamily:e.fontFamily??t.fontFamily,fontSettings:e.fontSettings??t.fontSettings,fontSize:e.fontSize??t.fontSize,lineHeight:e.lineHeight??t.lineHeight,letterSpacing:e.letterSpacing??t.letterSpacing??0,wordSpacing:e.wordSpacing??t.wordSpacing??0,textAlign:e.textAlign??t.textAlign??"left",textAppearance:e.textAppearance??t.textAppearance}}function Cd(e,t,n){var o,r;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((r=t.fontSettings)==null?void 0:r.fontStyle)??"normal"},fontSize:t.fontSize??.01,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing??0,wordSpacing:t.wordSpacing??0,textAlign:t.textAlign,textAppearance:t.textAppearance,color:""};return{css:{...dn(Qt(i,n)),...l$(t.fontSize,t.lineHeight,e,n)},className:s$(t.fontSize,t.lineHeight,`${e}-link-text`,`${e}-text-tight-leading`)}}function Td(e){const t=e.split(/\r?\n/);return t.length===1?e:t.map((n,i)=>a.jsxs(s.Fragment,{children:[n,i<t.length-1?a.jsx("br",{}):null]},i))}function Ld(e,t,n,i){const o=Math.max(0,n-i),r=e+t;if(r<=o||r<=0)return{start:e,end:t};const l=o/r;return{start:e*l,end:t*l}}function Cp(e){const n=Math.max(ji,e.fontSize??ji),{start:i,end:o}=Ld(e.textPaddingTop,e.textPaddingBottom,1,n),{start:r,end:l}=Ld(e.textPaddingLeft,e.textPaddingRight,1,ji);return{effectivePaddingLeft:r,effectivePaddingRight:l,effectivePaddingTop:i,effectivePaddingBottom:o,panelSize:1}}function u$(e){if(e==="center"||e==="center-center")return{horizontalAlign:"center",verticalAlign:"center"};const[t,n]=e.split("-");return{horizontalAlign:t,verticalAlign:n}}function p$(e){return e.position?u$(e.position):{horizontalAlign:e.horizontalAlign??"left",verticalAlign:e.verticalAlign??"top"}}function m$(e,t){return e.textPaddingLeft!==t.textPaddingLeft||e.textPaddingRight!==t.textPaddingRight||e.textPaddingTop!==t.textPaddingTop||e.textPaddingBottom!==t.textPaddingBottom}const g$=[["onScrollIconColor","compactIconColor"],["onScrollLinkColor","compactLinkColor"],["onScrollLogoColor","compactLogoColor"],["onScrollBackgroundColor","compactBackgroundColor"],["onScrollPanelColor","compactBackgroundColor"],["onScrollLogoMaxWidth","compactLogoMaxWidth"],["onScrollLogoMaxHeight","compactLogoMaxHeight"],["onScrollLogoPosition","compactLogoPosition"],["onScrollPanelHeight","compactPanelHeight"],["onScrollIconSize","compactIconSize"],["onScrollNavTextWidth","compactNavTextWidth"],["onScrollNavGap","compactNavGap"],["onScrollNavPaddingLeft","compactNavPaddingLeft"],["onScrollNavPaddingRight","compactNavPaddingRight"],["onScrollFontFamily","compactFontFamily"],["onScrollFontSettings","compactFontSettings"],["onScrollFontSize","compactFontSize"],["onScrollLineHeight","compactLineHeight"],["onScrollLetterSpacing","compactLetterSpacing"],["onScrollWordSpacing","compactWordSpacing"],["onScrollTextAlign","compactTextAlign"],["onScrollTextAppearance","compactTextAppearance"]];function Tp(e){var o,r;const t=e,n={};for(const[l,c]of g$)e[c]!==void 0||t[l]===void 0||(n[c]=t[l]);const i=t.stateOverrides;return i&&(i.onScroll!==void 0||i["onScroll-hover"]!==void 0)&&(n.stateOverrides={...e.stateOverrides},i.onScroll!==void 0&&((o=e.stateOverrides)==null?void 0:o.compact)===void 0&&(n.stateOverrides.compact=i.onScroll),i["onScroll-hover"]!==void 0&&((r=e.stateOverrides)==null?void 0:r["compact-hover"])===void 0&&(n.stateOverrides["compact-hover"]=i["onScroll-hover"])),Object.keys(n).length===0?e:{...e,...n}}function Pd(e){var o,r,l,c,d,u,p,y,v,m,g,x,b,k,f,S;e=Tp(e);const t=e,n={};if(e.backgroundColor===void 0&&t.panelColor!==void 0&&(n.backgroundColor=t.panelColor),e.openFontFamily===void 0&&e.fontFamily!==void 0&&(n.openFontFamily=e.fontFamily),e.openFontSettings===void 0&&e.fontSettings!==void 0&&(n.openFontSettings=e.fontSettings),e.openFontSize===void 0&&e.fontSize!==void 0&&(n.openFontSize=e.fontSize),e.openLineHeight===void 0&&e.lineHeight!==void 0&&(n.openLineHeight=e.lineHeight),e.openLetterSpacing===void 0&&e.letterSpacing!==void 0&&(n.openLetterSpacing=e.letterSpacing),e.openWordSpacing===void 0&&e.wordSpacing!==void 0&&(n.openWordSpacing=e.wordSpacing),e.openTextAlign===void 0&&e.textAlign!==void 0&&(n.openTextAlign=e.textAlign),e.openTextAppearance===void 0&&e.textAppearance!==void 0&&(n.openTextAppearance=e.textAppearance),e.openLinkColor===void 0){const O=((r=(o=e.stateOverrides)==null?void 0:o.open)==null?void 0:r.openLinkColor)??((c=(l=e.stateOverrides)==null?void 0:l.open)==null?void 0:c.linkColor)??e.linkColor;O!==void 0&&(n.openLinkColor=O)}if(e.compactIconColor===void 0){const O=((u=(d=e.stateOverrides)==null?void 0:d.compact)==null?void 0:u.iconColor)??e.iconColor;O!==void 0&&(n.compactIconColor=O)}if(e.compactLinkColor===void 0){const O=((y=(p=e.stateOverrides)==null?void 0:p.compact)==null?void 0:y.linkColor)??e.linkColor;O!==void 0&&(n.compactLinkColor=O)}if(e.compactLogoColor===void 0){const O=((m=(v=e.stateOverrides)==null?void 0:v.compact)==null?void 0:m.logoColor)??e.logoColor;O!==void 0&&(n.compactLogoColor=O)}if(e.openLogoColor===void 0){const O=((x=(g=e.stateOverrides)==null?void 0:g.open)==null?void 0:x.logoColor)??e.logoColor;O!==void 0&&(n.openLogoColor=O)}if(e.compactBackgroundColor===void 0){const O=((k=(b=e.stateOverrides)==null?void 0:b.compact)==null?void 0:k.backgroundColor)??((S=(f=t.stateOverrides)==null?void 0:f.compact)==null?void 0:S.panelColor)??t.compactPanelColor??t.onScrollPanelColor??e.backgroundColor??n.backgroundColor;O!==void 0&&(n.compactBackgroundColor=O)}e.logoMaxHeight===void 0&&e.logoMaxWidth!==void 0&&(n.logoMaxHeight=e.logoMaxWidth),e.compactLogoMaxHeight===void 0&&e.compactLogoMaxWidth!==void 0&&(n.compactLogoMaxHeight=e.compactLogoMaxWidth);const i=(O,U)=>{if(e[O]!==void 0)return;const z=e[U];z!==void 0&&(n[O]=z)};return i("compactLogoMaxHeight","logoMaxHeight"),i("compactLogoPosition","logoPosition"),i("compactPanelHeight","panelHeight"),i("compactShowIcon","showIcon"),i("compactIconSize","iconSize"),i("compactNavTextWidth","navTextWidth"),i("compactNavTextPosition","navTextPosition"),i("compactNavTextOffset","navTextOffset"),i("compactNavGap","navGap"),i("compactNavPaddingLeft","navPaddingLeft"),i("compactNavPaddingRight","navPaddingRight"),i("compactFontFamily","fontFamily"),i("compactFontSettings","fontSettings"),i("compactFontSize","fontSize"),i("compactLineHeight","lineHeight"),i("compactLetterSpacing","letterSpacing"),i("compactWordSpacing","wordSpacing"),i("compactTextAlign","textAlign"),i("compactTextAppearance","textAppearance"),Object.keys(n).length===0?e:{...e,...n}}function h$(e,t){const n=Cp({textPaddingLeft:e.textPaddingLeft??0,textPaddingRight:e.textPaddingRight??0,textPaddingTop:e.textPaddingTop??0,textPaddingBottom:e.textPaddingBottom??0,fontSize:e.openFontSize??e.fontSize??t.openFontSize??t.fontSize}),i={};return(e.textPaddingLeft??0)!==n.effectivePaddingLeft&&(i.textPaddingLeft=n.effectivePaddingLeft),(e.textPaddingRight??0)!==n.effectivePaddingRight&&(i.textPaddingRight=n.effectivePaddingRight),(e.textPaddingTop??0)!==n.effectivePaddingTop&&(i.textPaddingTop=n.effectivePaddingTop),(e.textPaddingBottom??0)!==n.effectivePaddingBottom&&(i.textPaddingBottom=n.effectivePaddingBottom),Object.keys(i).length===0?e:{...e,...i}}function f$(e,t){return{paddingLeft:F.scalingValue(e.effectivePaddingLeft,t),paddingRight:F.scalingValue(e.effectivePaddingRight,t),paddingTop:F.scalingValue(e.effectivePaddingTop,t),paddingBottom:F.scalingValue(e.effectivePaddingBottom,t)}}function y$(e,t,n,i){const o=Math.max(ji,n??ji),r=Math.max(t.effectivePaddingTop,go),l=Math.max(t.effectivePaddingBottom,go),c=Math.max(0,t.panelSize-t.effectivePaddingBottom-o),d=Math.max(0,t.panelSize-t.effectivePaddingTop-o),u=Math.max(t.effectivePaddingLeft,go),p=Math.max(t.effectivePaddingRight,go),y=Math.max(0,t.panelSize-t.effectivePaddingRight-ji),v=Math.max(0,t.panelSize-t.effectivePaddingLeft-ji);return a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"textPaddingTop","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-max-fraction":String(c),className:`${e}-control-anchor`,style:{top:0,left:0,width:"100%",height:i(r)}}),a.jsx("div",{"data-controls":"textPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(d),className:`${e}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:i(l)}}),a.jsx("div",{"data-controls":"textPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(y),className:`${e}-control-anchor`,style:{top:0,left:0,width:i(u),height:"100%"}}),a.jsx("div",{"data-controls":"textPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(v),className:`${e}-control-anchor`,style:{top:0,right:0,width:i(p),height:"100%"}})]})}const v$={iconColor:"icon-color",closeButtonColor:"close-button-color",linkColor:"link-color",openLinkColor:"menu-link-color",compactIconColor:"compact-icon-color",compactLinkColor:"compact-link-color",compactLogoColor:"compact-logo-color",compactBackgroundColor:"compact-background-color",openLogoColor:"open-logo-color",menuBackgroundColor:"menu-background-color",overlayColor:"overlay-color",backgroundColor:"background-color",logoColor:"logo-color"},x$=["hover","open"],b$={top:"flex-start",center:"center",bottom:"flex-end"},S$={left:"flex-start",center:"center",right:"flex-end"};function w$(e){return`
|
|
24029
|
+
`,Gw=["https://cdn.cntrl.site/component-assets/Helix-default-1.png","https://cdn.cntrl.site/component-assets/Helix-default-2.png","https://cdn.cntrl.site/component-assets/Helix-default-3.png","https://cdn.cntrl.site/component-assets/Helix-default-4.png","https://cdn.cntrl.site/component-assets/Helix-default-5.png"],Xw={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,deleteImageDeletesEntry:!0,allowsVideo:!0},display:{type:"array"},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"]}}}}},default:Gw.map(e=>({image:{url:e,name:""}}))},settings:{sizing:"auto auto",properties:{width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},imageWidth:{type:"number",scope:"layout",title:"Img width",display:{type:"numeric-input"},min:0,max:9999},turnHeight:{type:"number",scope:"layout",title:"Turn height",display:{type:"numeric-input"},min:0,max:9999},itemsPerTurn:{type:"number",scope:"common",title:"Per turn",display:{type:"common-numeric-input"},min:3,max:40},turns:{type:"number",scope:"common",title:"Turns",display:{type:"common-numeric-input"},min:1,max:30},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"]},playback:{type:"string",scope:"common",title:"Playback",display:{type:"toggle-cycle",enum:["autoplay","scroll"]}},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"}}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",display:{type:"numeric-input"},min:0,max:9999},blur:{type:"string",scope:"common",title:"Blur",display:{type:"toggle-cycle",enum:["on","off"]}}},defaults:{itemsPerTurn:14,turns:3,direction:"right",playback:"autoplay",blur:"off",imageDisplay:{display:"cover",ratioValue:"2:3",reversed:!1}},layoutDefaults:{d:{defaultPaddingTop:30/1440,width:800/1440,imageWidth:160/1440,turnHeight:380/1440,speed:2.2,cornerRadius:0},m:{defaultPaddingTop:10/375,width:320/375,imageWidth:75/375,turnHeight:310/375,speed:2.8,cornerRadius:0},t:{defaultPaddingTop:20/768,width:620/768,imageWidth:100/768,turnHeight:280/768,speed:2.8,cornerRadius:0}},layout:["__componentName__","width","imageWidth","turnHeight","itemsPerTurn","turns","playback","speed","direction","imageDisplay","cornerRadius","blur"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",items:["direction","speed"]},{type:"row",items:["width"]},{type:"row",items:["imageWidth","turnHeight"]},{type:"row",items:["cornerRadius","imageDisplay"]},{type:"row",items:["itemsPerTurn","turns"]},{type:"row",items:["playback","blur"]}]}]},qw={element:jw,id:"helix",name:"Helix",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Helix.mp4"},version:1,defaultSize:{d:{width:720,height:540}},schema:Xw,sourceCode:Vw,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},$n=300,nn=300,Uw=8/1440,go=.004,Kw=50,Yw=1440,ji=Kw/Yw;function Zw(e){if(e==="default"||e==="compact"||e==="open")return e;if(e==="onScroll")return"compact"}function Jw(e){return e==="center"||e==="right"?e:"left"}function Qw(e){return e==="left"||e==="right"?e:"center"}function e$(e,t,n){const i=F.scalingValue(t,n);return e==="center"?`translateX(calc(-50% + ${i}))`:`translateX(${i})`}function t$(e,t){if(e&&typeof e=="object"){if(t&&typeof e[t]=="string")return e[t];for(const n in e)if(typeof e[n]=="string")return e[n];return}return e}function bp(e,t){const n=(t$(e,t)??"always").trim().toLowerCase().replace(/[_-]+/g," ");return n==="open only"||n==="openonly"?"open only":n==="open and compact"||n==="openandcompact"?"open and compact":n==="default and open"||n==="defaultandopen"?"default and open":n==="default and compact"||n==="defaultandcompact"?"default and compact":"always"}function n$(e,t,n){switch(bp(e.showIn,n)){case"open only":return!1;case"open and compact":return t==="compact";case"default and compact":return!0;case"default and open":return t==="default";default:return!0}}function i$(e,t){switch(bp(e.showIn,t)){case"default and compact":return!1;default:return!0}}function o$(e){return(e==null?void 0:e.find(t=>t.slug===""))??(e==null?void 0:e[0])}function r$(e,t){const n=e?t==null?void 0:t.find(i=>i.id===e):o$(t);return!e&&!n?"":n?n.slug===""?"/":`/${n.slug}`:e.startsWith("/")||e.startsWith("#")||/^[a-z][a-z\d+\-.]*:/i.test(e)?e:t?`/${e}`:e}function yd(e){const t=(e??"").toLowerCase();return t==="blank"||t==="_blank"||t.includes("new")}function Sp(e){const t=e.link;if(t&&typeof t=="object"){const i=yd(t.target)?"_blank":void 0;if(t.type==="url")return{type:"url",value:t.value??t.url??"",target:i};if(t.type==="anchor")return{type:"anchor",value:t.value??"",target:i};if(t.type==="page")return{type:"page",value:t.value??"",target:i,anchor:t.anchor};if(typeof t.url=="string")return{type:"url",value:t.url,target:i}}const n=yd(e.openIn)?"_blank":void 0;return e.mode==="url"?{type:"url",value:e.url??"",target:n}:{type:"page",value:e.page??"",target:n,anchor:e.anchor}}function qs(e,t){const n=e.label||"Link",i=Sp(e);if(i.type==="url")return{label:n,href:i.value,target:i.target};if(i.type==="anchor"){const c=i.value.replace(/^#/,"");return{label:n,href:c?`#${c}`:"",target:i.target}}const o=r$(i.value,t),r=(i.anchor??"").replace(/^#/,""),l=r?o?`${o}#${r}`:`#${r}`:o;return{label:n,href:l,target:i.target}}const xi=24,vi=xi*.125,wp=xi*.125,$s=(xi-(3*vi+2*wp))/2,vd=vi+wp;function a$({className:e,lineClassName:t}){return a.jsxs("svg",{className:e,viewBox:`0 0 ${xi} ${xi}`,"aria-hidden":"true",children:[a.jsx("rect",{className:`${t} ${t}-top`,x:"0",y:$s,width:xi,height:vi,rx:vi/2}),a.jsx("rect",{className:`${t} ${t}-mid`,x:"0",y:$s+vd,width:xi,height:vi,rx:vi/2}),a.jsx("rect",{className:`${t} ${t}-bot`,x:"0",y:$s+2*vd,width:xi,height:vi,rx:vi/2})]})}function s$(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function l$(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:F.scalingValue((o-t)/2,i)}}const $p=.004;let er;function c$(){return er!==void 0?er:typeof document>"u"?(er=null,null):(er=document.createElement("canvas").getContext("2d"),er)}function d$(e){const t=getComputedStyle(e),n=parseFloat(t.fontSize)||0;if(n<=0)return 0;const i=c$();if(!i)return 0;i.font=`${t.fontStyle} ${t.fontWeight} ${n}px ${t.fontFamily}`;const o=i.measureText("H"),r=o.actualBoundingBoxAscent>0?o.actualBoundingBoxAscent:0,l=Math.max(0,o.actualBoundingBoxDescent||0),c=o.fontBoundingBoxAscent||0,d=o.fontBoundingBoxDescent||0;return r<=0||c<=0&&d<=0?0:(d-l-(c-r))/2/n}function xd(e,t){const[n,i]=s.useState(0);return s.useLayoutEffect(()=>{const o=e.current;if(!o)return;const r=()=>{const d=d$(o);i(u=>Math.abs(u-d)<$p?u:d)};r();const l=document.fonts;l.ready.then(r).catch(()=>{}),l.addEventListener("loadingdone",r);const c=new ResizeObserver(r);return c.observe(o),()=>{l.removeEventListener("loadingdone",r),c.disconnect()}},[e,t]),n}function bd(e){if(!(Math.abs(e)<$p))return`translateY(${e}em)`}function Sd(e){var t,n;return[e.fontFamily??"",((t=e.fontSettings)==null?void 0:t.fontWeight)??400,((n=e.fontSettings)==null?void 0:n.fontStyle)??"normal",e.fontSize??"",e.lineHeight??""].join("\0")}function wd(e){return{fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontSize:e.fontSize,lineHeight:e.lineHeight,position:"absolute",top:0,left:0,visibility:"hidden",pointerEvents:"none",whiteSpace:"nowrap"}}function $d(e,t={}){return{fontFamily:e.fontFamily??t.fontFamily,fontSettings:e.fontSettings??t.fontSettings,fontSize:e.fontSize??t.fontSize,lineHeight:e.lineHeight??t.lineHeight,letterSpacing:e.letterSpacing??t.letterSpacing??0,wordSpacing:e.wordSpacing??t.wordSpacing??0,textAlign:e.textAlign??t.textAlign??"left",textAppearance:e.textAppearance??t.textAppearance}}function Cd(e,t,n){var o,r;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((r=t.fontSettings)==null?void 0:r.fontStyle)??"normal"},fontSize:t.fontSize??.01,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing??0,wordSpacing:t.wordSpacing??0,textAlign:t.textAlign,textAppearance:t.textAppearance,color:""};return{css:{...dn(Qt(i,n)),...l$(t.fontSize,t.lineHeight,e,n)},className:s$(t.fontSize,t.lineHeight,`${e}-link-text`,`${e}-text-tight-leading`)}}function Td(e){const t=e.split(/\r?\n/);return t.length===1?e:t.map((n,i)=>a.jsxs(s.Fragment,{children:[n,i<t.length-1?a.jsx("br",{}):null]},i))}function Ld(e,t,n,i){const o=Math.max(0,n-i),r=e+t;if(r<=o||r<=0)return{start:e,end:t};const l=o/r;return{start:e*l,end:t*l}}function Cp(e){const n=Math.max(ji,e.fontSize??ji),{start:i,end:o}=Ld(e.textPaddingTop,e.textPaddingBottom,1,n),{start:r,end:l}=Ld(e.textPaddingLeft,e.textPaddingRight,1,ji);return{effectivePaddingLeft:r,effectivePaddingRight:l,effectivePaddingTop:i,effectivePaddingBottom:o,panelSize:1}}function u$(e){if(e==="center"||e==="center-center")return{horizontalAlign:"center",verticalAlign:"center"};const[t,n]=e.split("-");return{horizontalAlign:t,verticalAlign:n}}function p$(e){return e.position?u$(e.position):{horizontalAlign:e.horizontalAlign??"left",verticalAlign:e.verticalAlign??"top"}}function m$(e,t){return e.textPaddingLeft!==t.textPaddingLeft||e.textPaddingRight!==t.textPaddingRight||e.textPaddingTop!==t.textPaddingTop||e.textPaddingBottom!==t.textPaddingBottom}const g$=[["onScrollIconColor","compactIconColor"],["onScrollLinkColor","compactLinkColor"],["onScrollLogoColor","compactLogoColor"],["onScrollBackgroundColor","compactBackgroundColor"],["onScrollPanelColor","compactBackgroundColor"],["onScrollLogoMaxWidth","compactLogoMaxWidth"],["onScrollLogoMaxHeight","compactLogoMaxHeight"],["onScrollLogoPosition","compactLogoPosition"],["onScrollPanelHeight","compactPanelHeight"],["onScrollIconSize","compactIconSize"],["onScrollNavTextWidth","compactNavTextWidth"],["onScrollNavGap","compactNavGap"],["onScrollNavPaddingLeft","compactNavPaddingLeft"],["onScrollNavPaddingRight","compactNavPaddingRight"],["onScrollFontFamily","compactFontFamily"],["onScrollFontSettings","compactFontSettings"],["onScrollFontSize","compactFontSize"],["onScrollLineHeight","compactLineHeight"],["onScrollLetterSpacing","compactLetterSpacing"],["onScrollWordSpacing","compactWordSpacing"],["onScrollTextAlign","compactTextAlign"],["onScrollTextAppearance","compactTextAppearance"]];function Tp(e){var o,r;const t=e,n={};for(const[l,c]of g$)e[c]!==void 0||t[l]===void 0||(n[c]=t[l]);const i=t.stateOverrides;return i&&(i.onScroll!==void 0||i["onScroll-hover"]!==void 0)&&(n.stateOverrides={...e.stateOverrides},i.onScroll!==void 0&&((o=e.stateOverrides)==null?void 0:o.compact)===void 0&&(n.stateOverrides.compact=i.onScroll),i["onScroll-hover"]!==void 0&&((r=e.stateOverrides)==null?void 0:r["compact-hover"])===void 0&&(n.stateOverrides["compact-hover"]=i["onScroll-hover"])),Object.keys(n).length===0?e:{...e,...n}}function Pd(e){var o,r,l,c,d,u,p,y,v,m,g,x,b,k,f,S;e=Tp(e);const t=e,n={};if(e.backgroundColor===void 0&&t.panelColor!==void 0&&(n.backgroundColor=t.panelColor),e.openFontFamily===void 0&&e.fontFamily!==void 0&&(n.openFontFamily=e.fontFamily),e.openFontSettings===void 0&&e.fontSettings!==void 0&&(n.openFontSettings=e.fontSettings),e.openFontSize===void 0&&e.fontSize!==void 0&&(n.openFontSize=e.fontSize),e.openLineHeight===void 0&&e.lineHeight!==void 0&&(n.openLineHeight=e.lineHeight),e.openLetterSpacing===void 0&&e.letterSpacing!==void 0&&(n.openLetterSpacing=e.letterSpacing),e.openWordSpacing===void 0&&e.wordSpacing!==void 0&&(n.openWordSpacing=e.wordSpacing),e.openTextAlign===void 0&&e.textAlign!==void 0&&(n.openTextAlign=e.textAlign),e.openTextAppearance===void 0&&e.textAppearance!==void 0&&(n.openTextAppearance=e.textAppearance),e.openLinkColor===void 0){const W=((r=(o=e.stateOverrides)==null?void 0:o.open)==null?void 0:r.openLinkColor)??((c=(l=e.stateOverrides)==null?void 0:l.open)==null?void 0:c.linkColor)??e.linkColor;W!==void 0&&(n.openLinkColor=W)}if(e.compactIconColor===void 0){const W=((u=(d=e.stateOverrides)==null?void 0:d.compact)==null?void 0:u.iconColor)??e.iconColor;W!==void 0&&(n.compactIconColor=W)}if(e.compactLinkColor===void 0){const W=((y=(p=e.stateOverrides)==null?void 0:p.compact)==null?void 0:y.linkColor)??e.linkColor;W!==void 0&&(n.compactLinkColor=W)}if(e.compactLogoColor===void 0){const W=((m=(v=e.stateOverrides)==null?void 0:v.compact)==null?void 0:m.logoColor)??e.logoColor;W!==void 0&&(n.compactLogoColor=W)}if(e.openLogoColor===void 0){const W=((x=(g=e.stateOverrides)==null?void 0:g.open)==null?void 0:x.logoColor)??e.logoColor;W!==void 0&&(n.openLogoColor=W)}if(e.compactBackgroundColor===void 0){const W=((k=(b=e.stateOverrides)==null?void 0:b.compact)==null?void 0:k.backgroundColor)??((S=(f=t.stateOverrides)==null?void 0:f.compact)==null?void 0:S.panelColor)??t.compactPanelColor??t.onScrollPanelColor??e.backgroundColor??n.backgroundColor;W!==void 0&&(n.compactBackgroundColor=W)}e.logoMaxHeight===void 0&&e.logoMaxWidth!==void 0&&(n.logoMaxHeight=e.logoMaxWidth),e.compactLogoMaxHeight===void 0&&e.compactLogoMaxWidth!==void 0&&(n.compactLogoMaxHeight=e.compactLogoMaxWidth);const i=(W,U)=>{if(e[W]!==void 0)return;const B=e[U];B!==void 0&&(n[W]=B)};return i("compactLogoMaxHeight","logoMaxHeight"),i("compactLogoPosition","logoPosition"),i("compactPanelHeight","panelHeight"),i("compactShowIcon","showIcon"),i("compactIconSize","iconSize"),i("compactNavTextWidth","navTextWidth"),i("compactNavTextPosition","navTextPosition"),i("compactNavTextOffset","navTextOffset"),i("compactNavGap","navGap"),i("compactNavPaddingLeft","navPaddingLeft"),i("compactNavPaddingRight","navPaddingRight"),i("compactFontFamily","fontFamily"),i("compactFontSettings","fontSettings"),i("compactFontSize","fontSize"),i("compactLineHeight","lineHeight"),i("compactLetterSpacing","letterSpacing"),i("compactWordSpacing","wordSpacing"),i("compactTextAlign","textAlign"),i("compactTextAppearance","textAppearance"),Object.keys(n).length===0?e:{...e,...n}}function h$(e,t){const n=Cp({textPaddingLeft:e.textPaddingLeft??0,textPaddingRight:e.textPaddingRight??0,textPaddingTop:e.textPaddingTop??0,textPaddingBottom:e.textPaddingBottom??0,fontSize:e.openFontSize??e.fontSize??t.openFontSize??t.fontSize}),i={};return(e.textPaddingLeft??0)!==n.effectivePaddingLeft&&(i.textPaddingLeft=n.effectivePaddingLeft),(e.textPaddingRight??0)!==n.effectivePaddingRight&&(i.textPaddingRight=n.effectivePaddingRight),(e.textPaddingTop??0)!==n.effectivePaddingTop&&(i.textPaddingTop=n.effectivePaddingTop),(e.textPaddingBottom??0)!==n.effectivePaddingBottom&&(i.textPaddingBottom=n.effectivePaddingBottom),Object.keys(i).length===0?e:{...e,...i}}function f$(e,t){return{paddingLeft:F.scalingValue(e.effectivePaddingLeft,t),paddingRight:F.scalingValue(e.effectivePaddingRight,t),paddingTop:F.scalingValue(e.effectivePaddingTop,t),paddingBottom:F.scalingValue(e.effectivePaddingBottom,t)}}function y$(e,t,n,i){const o=Math.max(ji,n??ji),r=Math.max(t.effectivePaddingTop,go),l=Math.max(t.effectivePaddingBottom,go),c=Math.max(0,t.panelSize-t.effectivePaddingBottom-o),d=Math.max(0,t.panelSize-t.effectivePaddingTop-o),u=Math.max(t.effectivePaddingLeft,go),p=Math.max(t.effectivePaddingRight,go),y=Math.max(0,t.panelSize-t.effectivePaddingRight-ji),v=Math.max(0,t.panelSize-t.effectivePaddingLeft-ji);return a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"textPaddingTop","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-max-fraction":String(c),className:`${e}-control-anchor`,style:{top:0,left:0,width:"100%",height:i(r)}}),a.jsx("div",{"data-controls":"textPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(d),className:`${e}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:i(l)}}),a.jsx("div",{"data-controls":"textPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(y),className:`${e}-control-anchor`,style:{top:0,left:0,width:i(u),height:"100%"}}),a.jsx("div",{"data-controls":"textPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(v),className:`${e}-control-anchor`,style:{top:0,right:0,width:i(p),height:"100%"}})]})}const v$={iconColor:"icon-color",closeButtonColor:"close-button-color",linkColor:"link-color",openLinkColor:"menu-link-color",compactIconColor:"compact-icon-color",compactLinkColor:"compact-link-color",compactLogoColor:"compact-logo-color",compactBackgroundColor:"compact-background-color",openLogoColor:"open-logo-color",menuBackgroundColor:"menu-background-color",overlayColor:"overlay-color",backgroundColor:"background-color",logoColor:"logo-color"},x$=["hover","open"],b$={top:"flex-start",center:"center",bottom:"flex-end"},S$={left:"flex-start",center:"center",right:"flex-end"};function w$(e){return`
|
|
24002
24030
|
.${e}-root {
|
|
24003
24031
|
position: relative;
|
|
24004
24032
|
display: block;
|
|
@@ -24658,7 +24686,7 @@ export function Helix({
|
|
|
24658
24686
|
word-spacing ${nn}ms ease,
|
|
24659
24687
|
padding ${nn}ms ease;
|
|
24660
24688
|
}
|
|
24661
|
-
`}function $$(e){return`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`}function C$(e){const t=e.trim().toLowerCase();return t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")?!0:t.includes(".svg")}function T$(e){const t=C$(e),[n,i]=s.useState(!1);return s.useEffect(()=>{if(t||!e.startsWith("blob:")){i(!1);return}let o=!1;return fetch(e).then(r=>r.blob()).then(async r=>{if(o)return;if(r.type.includes("svg")){i(!0);return}if(r.type.startsWith("image/")&&!r.type.includes("svg")){i(!1);return}const l=await r.text();o||i(/<svg[\s>]/i.test(l.trim()))}).catch(()=>{o||i(!1)}),()=>{o=!0}},[t,e]),t||n}function L$(e){const t=e.indexOf("#");if(t===-1)return"";try{return decodeURIComponent(e.slice(t+1))}catch{return e.slice(t+1)}}function P$(e){if(!e||e.startsWith("#"))return!0;try{return new URL(e,window.location.href).pathname===window.location.pathname}catch{return!1}}function Lp(e){if(!e)return null;const t=document.getElementById(e),n=document.querySelector(`[data-section-id="${CSS.escape(e)}"]`),i=t??n;return i instanceof HTMLElement?i:null}function Id(e){const t=Lp(e);return t?(t.scrollIntoView({behavior:"smooth",block:"start"}),!0):!1}function I$(e,t,n={}){const{isEditor:i,isPreviewMode:o,item:r,pages:l,onLinkNavigate:c}=n,d=n.runAfterClose??(v=>v()),u=e.currentTarget.getAttribute("href")??"",p=L$(u),y=e.currentTarget.target==="_blank";if(r&&c){e.preventDefault(),e.stopPropagation();const v=qs(r,l),m=Sp(r),g={mode:m.type==="url"?"url":"page",href:v.href||u,page:m.type==="page"?m.value:void 0,url:m.type==="url"?m.value:void 0,anchor:m.type==="anchor"?m.value.replace(/^#/,""):(m.anchor??"").replace(/^#/,""),target:v.target};g.target==="_blank"?c(g):d(()=>c(g)),t();return}if(i){e.preventDefault(),d(()=>Id(p)),t();return}!y&&p&&P$(u)&&Lp(p)&&(e.preventDefault(),d(()=>Id(p))),t()}const R$=["--cntrl-article-width","--cntrl-article-top","--cntrl-article-left","--cntrl-viewport-height"];function k$(e){let t=e;for(;t;){if(getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim())return t;t=t.parentElement}return e}function E$(e){const t={},n=k$(e);if(!n)return t;const i=getComputedStyle(n);for(const o of R$){const r=i.getPropertyValue(o).trim();r&&(t[o]=r)}return t}function Rd(e,t,n,i,o){return a.jsx("span",{className:`${e}-link-text-box`,style:{width:o(n),maxWidth:"100%"},children:a.jsx("span",{className:i?`${e}-link-text-inner`:`${e}-link-text-inner-hidden`,style:{width:"100%"},children:t})})}function M$({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,activeEvent:o,currentState:r,isSwitchClone:l=!1,unavailableStates:c=[],layoutId:d,pages:u,onLinkNavigate:p,onUpdateSettings:y,onOpenChange:v}){const{prefix:m}=F.useScopedStyles(),g=s.useRef(null),x=s.useRef(null),b=s.useRef(null),k=s.useRef(null),f=s.useRef(null),S=s.useRef(0),O=s.useRef(null),U=s.useRef(null),z=s.useRef(d),I=s.useMemo(()=>w$(m),[m]),[N,q]=s.useState(!1),[$,L]=s.useState(!1),[D,_]=s.useState(!1),C=Zw(r),T=s.useMemo(()=>new Set(c),[c]),B=It=>!!(It&&T.has(It)),X=!!(t&&!i&&C==="open"&&!B("open"))||!(t&&!i)&&N,R=!!(t&&!i),E=X&&!R;Wl(E),s.useEffect(()=>{if(!X||!R)return;const It=document.documentElement,Xt=It.style.overflow;return It.style.overflow="hidden",()=>{It.style.overflow=Xt}},[X,R]);const V=!B("compact")&&!B("onScroll"),ie=!t||!!i&&!n,re=o&&o!=="default"?o:void 0,W=V&&C==="compact"?"compact":"default",[ae,A]=s.useState(W),[le,ee]=s.useState(!1),xe=!n;W!==ae&&(A(W),xe&&ee(!0));const Pe=Tp(e),{logo:ye,logoMaxHeight:pe=120/1440,logoPosition:Y="left",panelHeight:se=60/1440,backgroundColor:de="#b3b3b3",logoColor:ve="#000000",position:$e,horizontalAlign:ke,verticalAlign:he,iconColor:Se="#000000",showIcon:Ce="on",iconSize:h=16/1440,linkColor:K="#000000",openLinkColor:Z="#000000",compactIconColor:te="#000000",compactLinkColor:me="#000000",compactLogoColor:j="#000000",compactBackgroundColor:P="#ffffff",compactLogoMaxHeight:Q=120/1440,compactLogoPosition:ne,compactPanelHeight:ue=60/1440,compactShowIcon:G="on",compactIconSize:Ie=16/1440,compactNavTextWidth:be,compactNavTextPosition:J,compactNavTextOffset:He,compactNavGap:We,compactNavPaddingLeft:ot=10/1440,compactNavPaddingRight:qe=10/1440,compactFontFamily:tt,compactFontSettings:et,compactFontSize:je,compactLineHeight:fe,compactLetterSpacing:_e=0,compactWordSpacing:Be=0,compactTextAlign:Ze="left",compactTextAppearance:we,openLogoColor:Ne="#000000",menuBackgroundColor:Ue="#ffffff",overlayColor:Je="rgba(0, 0, 0, 0.45)",closeButtonColor:st="#000000",effect:it="fade",openPanelSize:Oe=100,textWidth:Ae=280/1440,navTextWidth:gt,navTextPosition:ze="center",navTextOffset:De=0,gap:Xe=0,navGap:ct,navPaddingLeft:ge=10/1440,navPaddingRight:Ee=10/1440,textPaddingLeft:nt=10/1440,textPaddingRight:pt=10/1440,textPaddingTop:Ge=10/1440,textPaddingBottom:vt=10/1440,fontFamily:Rt,fontSettings:At,fontSize:wt,lineHeight:Vt,letterSpacing:jt=0,wordSpacing:Kt=0,textAlign:Yt="left",textAppearance:kt,openFontFamily:Bt,openFontSettings:rn,openFontSize:xt,openLineHeight:yt,openLetterSpacing:Me,openWordSpacing:Qe,openTextAlign:rt,openTextAppearance:dt,stateOverrides:Pt,link:St}=Pe,{horizontalAlign:ht,verticalAlign:Wt}=p$({position:$e,horizontalAlign:ke,verticalAlign:he}),Tt=W==="compact",Ot=Tt?Q:pe,Gt=Jw(Tt?ne:Y),Mt=Tt?ue:se,_t=Tt?Ie:h,Ft=Tt?be:gt,ut=Qw(Tt?J:ze),H=(Tt?He:De)??0,Le=Tt?We:ct,Ve=Tt?ot:ge,Fe=Tt?qe:Ee,ft=Ft??Ae,Ht=X||(Tt?G:Ce)!=="off",mt=F.buildColorVars(m,{iconColor:Se,closeButtonColor:st,linkColor:K,openLinkColor:Z,compactIconColor:te,compactLinkColor:me,compactLogoColor:j,compactBackgroundColor:P,openLogoColor:Ne,menuBackgroundColor:Ue,overlayColor:Je,backgroundColor:de,logoColor:ve},v$,x$,Pt),Lt=$d(Tt?{fontFamily:tt,fontSettings:et,fontSize:je,lineHeight:fe,letterSpacing:_e,wordSpacing:Be,textAlign:Ze,textAppearance:we}:{fontFamily:Rt,fontSettings:At,fontSize:wt,lineHeight:Vt,letterSpacing:jt,wordSpacing:Kt,textAlign:Yt,textAppearance:kt}),Ut=$d({fontFamily:Bt,fontSettings:rn,fontSize:xt,lineHeight:yt,letterSpacing:Me,wordSpacing:Qe,textAlign:rt,textAppearance:dt},Lt),Dt=Cd(m,Lt,t),an=Cd(m,Ut,t),ln=xd(b,Sd(Lt)),qn=xd(k,Sd(Ut)),Un={...an.css,whiteSpace:"pre-wrap",transform:bd(qn)},Zi=an.className,hn=It=>F.scalingValue(It,t),Vo=Le??Xe,Go=Math.max(Ve,go),xn=Math.max(Fe,go),li=Math.max(0,1-_t),Ji=Math.max(0,1-_t),bn=n??!1,Kn=bn&&!X,Qi=s.useMemo(()=>Cp({textPaddingLeft:nt,textPaddingRight:pt,textPaddingTop:Ge,textPaddingBottom:vt,fontSize:Ut.fontSize}),[nt,pt,Ge,vt,Ut.fontSize]),eo=It=>{const Xt=a.jsx("span",{className:Zi,style:Un,children:Td(It)});return Rd(m,Xt,Ae,bn,hn)},Ye=it==="left"||it==="right"?{width:`${Oe}%`}:{height:`${Oe}%`},M={...f$(Qi,t),...Ye,alignItems:S$[ht],justifyContent:b$[Wt]},oe=s.useRef(e),ce=s.useRef(d);s.useEffect(()=>{if(!y||!t){oe.current=e,ce.current=d;return}if(ce.current!==d){oe.current=e,ce.current=d;const Mi=Pd(e);Mi!==e&&y(Mi);return}const It=Pd(e),Xt=oe.current,un=Xt!==e,fn=un?h$(It,Xt):It;oe.current=e;const kn=It!==e,Nn=un&&m$(It,fn);!kn&&!Nn||y(fn)},[e,y,t,d]);const Re=F.scalingValue(_t,t),Ke={width:Re,height:Re,minWidth:Re,minHeight:Re,maxWidth:Re,maxHeight:Re},lt={...Dt.css,textDecoration:"none",transform:bd(ln)},Et=Dt.className,zt=(ye==null?void 0:ye.mode)!=="Off",en=(ye==null?void 0:ye.icon)??"",tn=T$(en),ci=hn(Math.min(Ot,Mt)),di=!!(zt&&en&&Gt==="right")?"left":"right",Xo=Array.isArray(St)?St:[],qo=[W!=="default"?`${m}-state-${W}`:"",X||C==="open"?`${m}-state-open`:"",re&&re!==W&&re!==C?`${m}-state-${re}`:""].filter(Boolean).join(" "),Da=t&&!i?`${m}-editor`:"",Gl=ie?`${m}-interactive`:"",Hp=xe&&(W!==ae||le)?`${m}-nav-state-anim`:"",Wp=X?`${m}-open`:"",Op=s.useMemo(()=>E$(g.current),[$,X,d]),za=()=>{q(!1)},Ba=!t||i,Dp=It=>{if(E){U.current=It;return}It()};s.useEffect(()=>{if(X)return;const It=U.current;U.current=null,It==null||It()},[X]);const Xl=(It,Xt)=>{I$(It,za,{isEditor:t,isPreviewMode:i,item:Xt,pages:u,onLinkNavigate:p,runAfterClose:Dp})},zp=()=>{t&&!i||q(It=>!It)},Bp=It=>{It.pointerType==="touch"&&It.currentTarget.blur()},Er=()=>{O.current!==null&&(window.clearTimeout(O.current),O.current=null)};s.useEffect(()=>{if(!le)return;const It=window.setTimeout(()=>{ee(!1)},nn);return()=>window.clearTimeout(It)},[le,W]),s.useEffect(()=>{if(X){Er(),L(!0);return}return S.current+=1,_(!1),Er(),O.current=window.setTimeout(()=>{O.current=null,L(!1)},$n),Er},[X]),s.useLayoutEffect(()=>{z.current!==d&&(z.current=d,S.current+=1,Er(),q(!1),_(!1),L(!1))},[d]),s.useLayoutEffect(()=>{var un;if(!$||!X)return;const It=S.current+1;S.current=It,_(!1),(un=x.current)==null||un.offsetHeight;const Xt=requestAnimationFrame(()=>{S.current===It&&_(!0)});return()=>{cancelAnimationFrame(Xt)}},[$,X]),s.useLayoutEffect(()=>{if(!E||!$)return;const It=f.current;if(!It)return;const Xt=getComputedStyle(It).backgroundColor;if(!Xt)return;const un=document.documentElement,{body:fn}=document,kn=un.style.backgroundColor,Nn=fn.style.backgroundColor;return un.style.backgroundColor=Xt,fn.style.backgroundColor=Xt,()=>{un.style.backgroundColor=kn,fn.style.backgroundColor=Nn}},[E,$,qo,Ue,Pt]),s.useEffect(()=>{v==null||v(X)},[X,v]),s.useEffect(()=>{if(!X)return;const It=Xt=>{Xt.key==="Escape"&&(t&&i||za())};return window.addEventListener("keydown",It),()=>window.removeEventListener("keydown",It)},[X,t,i]),s.useEffect(()=>{t&&!i&&C!=="open"&&q(!1)},[t,i,C]),s.useEffect(()=>{i&&q(!1)},[i]);const ql=bn&&X,jp=It=>Xo.filter(Xt=>i$(Xt,d)).map((Xt,un)=>{const{label:fn,href:kn,target:Nn}=qs(Xt,u),Mi=kn?a.jsx("a",{href:kn,target:Nn,rel:Nn==="_blank"?"noopener noreferrer":void 0,className:`${It} ${m}-has-href`,onClick:ja=>Xl(ja,Xt),children:eo(fn)}):a.jsx("span",{className:It,children:eo(fn)});return a.jsxs(s.Fragment,{children:[un>0&&a.jsx("div",{"data-controls":ql?"gap":void 0,"data-controls-axis":"y",className:ql?`${m}-gap-control`:void 0,style:{height:hn(Xe)}}),Mi]},un)}),Vp=$?a.jsxs("div",{ref:x,"data-selection":"none",className:[`${m}-lightbox`,`${m}-full-lightbox ${m}-effect-${it}`,D?`${m}-lightbox-active`:"",`${m}-lightbox-editor`,n?`${m}-lightbox-edit-mode`:"",Gl,qo].filter(Boolean).join(" "),style:{...mt,...Op},"aria-hidden":!D,children:[a.jsx("div",{className:[`${m}-backdrop`,Ba?`${m}-backdrop-clickable`:""].filter(Boolean).join(" "),"aria-hidden":"true",onClick:Ba?za:void 0}),a.jsxs("nav",{className:[`${m}-panel`,Ba?`${m}-panel-blocking`:""].filter(Boolean).join(" "),style:M,"aria-label":"Menu","data-lightbox-scrollable":"",children:[bn&&y$(m,Qi,Ut.fontSize,hn),jp(`${m}-link`)]}),E?a.jsx("div",{ref:f,className:`${m}-safari-tint`,"aria-hidden":"true"}):null]}):null,Gp=()=>a.jsx("button",{type:"button",className:`${m}-toggle`,onClick:zp,onPointerUp:Bp,"aria-expanded":X,"aria-label":X?"Close menu":"Open menu",children:a.jsx(a$,{className:`${m}-icon`,lineClassName:`${m}-icon-line`})}),Mr=It=>{const Xt=It==="left",un=Xt?Ve:Fe,fn=Xt?Go:xn,kn=Xt?li:Ji,Nn=Tt?Xt?"compactNavPaddingLeft":"compactNavPaddingRight":Xt?"navPaddingLeft":"navPaddingRight";return a.jsx("div",{className:Xt?`${m}-nav-padding-left`:`${m}-nav-padding-right`,style:{width:hn(un),flexShrink:0},children:Kn?a.jsx("div",{"data-controls":Nn,"data-controls-axis":"x","data-controls-variant":"column-padding",...Xt?{}:{"data-controls-reverse":""},"data-controls-min":"0","data-controls-max-fraction":String(kn),className:`${m}-control-anchor`,style:{top:0,[Xt?"left":"right"]:0,width:hn(fn),height:"100%"}}):null})},Xp=(It,Xt)=>{const{label:un,href:fn,target:kn}=qs(It,u),Nn=a.jsx("span",{className:Et,style:lt,children:Td(un)}),Mi=Rd(m,Nn,ft,Kn,hn),ja=fn?a.jsx("a",{href:fn,target:kn,rel:kn==="_blank"?"noopener noreferrer":void 0,className:`${m}-nav-link ${m}-has-href`,onClick:Kp=>Xl(Kp,It),children:Mi}):a.jsx("span",{className:`${m}-nav-link`,children:Mi});return a.jsxs(s.Fragment,{children:[Xt>0&&a.jsx("div",{"data-controls":Kn?Tt?"compactNavGap":"navGap":void 0,"data-controls-axis":"x",className:Kn?`${m}-gap-control ${m}-nav-gap-control`:`${m}-nav-gap-control}`,style:{width:hn(Vo),flexShrink:0}}),ja]},Xt)},qp={...mt,height:F.scalingValue(Mt,t),minHeight:F.scalingValue(Mt,t),[`--${m}-panel-height`]:F.scalingValue(Mt,t)},Up=l&&W==="default"&&C!=="open"&&!i?hn(se+Uw):"0px";return a.jsxs("div",{ref:g,className:`${m}-root ${qo} ${Da} ${Gl} ${Hp}`.trim(),style:{width:"100%",height:"100%",lineHeight:0,fontSize:0,marginTop:Up,...mt},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:I}}),a.jsx("span",{ref:b,"aria-hidden":!0,style:wd(Dt.css),children:"H"}),a.jsx("span",{ref:k,"aria-hidden":!0,style:wd(an.css),children:"H"}),a.jsx("div",{className:`${m}-nav-slide`,children:a.jsxs("div",{className:`${m}-nav-bar`,style:qp,children:[zt&&en?a.jsxs("div",{className:`${m}-nav-logo ${m}-nav-logo-${Gt}`,children:[Gt==="left"?Mr("left"):null,a.jsxs("div",{className:`${m}-nav-logo-inner${tn?` ${m}-nav-logo-tinted`:""}`,style:{height:ci,...tn?{[`--${m}-logo-image`]:$$(en)}:{}},children:[a.jsx("img",{src:en,alt:"",className:`${m}-nav-logo-img`}),tn?a.jsx("span",{className:`${m}-nav-logo-tint`,"aria-hidden":"true"}):null]}),Gt==="right"?Mr("right"):null]}):null,a.jsx("nav",{className:`${m}-nav-links ${m}-nav-links-${ut}`,style:{transform:e$(ut,H,t)},"aria-label":"Navigation",children:a.jsx("div",{className:`${m}-nav-links-inner`,children:Xo.filter(It=>n$(It,W,d)).map((It,Xt)=>Xp(It,Xt))})})]})}),Vp,a.jsxs("div",{className:`${m}-nav-toggle-wrap ${m}-nav-toggle-wrap-${di}`,children:[di==="left"?Mr("left"):null,Ht?a.jsx("div",{className:`${m}-root ${Wp}`.trim(),style:Ke,children:Gp()}):null,di==="right"?Mr("right"):null]})]})}const A$=`import { Fragment, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type MouseEvent, type PointerEvent, type ReactNode } from 'react';
|
|
24689
|
+
`}function $$(e){return`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`}function C$(e){const t=e.trim().toLowerCase();return t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")?!0:t.includes(".svg")}function T$(e){const t=C$(e),[n,i]=s.useState(!1);return s.useEffect(()=>{if(t||!e.startsWith("blob:")){i(!1);return}let o=!1;return fetch(e).then(r=>r.blob()).then(async r=>{if(o)return;if(r.type.includes("svg")){i(!0);return}if(r.type.startsWith("image/")&&!r.type.includes("svg")){i(!1);return}const l=await r.text();o||i(/<svg[\s>]/i.test(l.trim()))}).catch(()=>{o||i(!1)}),()=>{o=!0}},[t,e]),t||n}function L$(e){const t=e.indexOf("#");if(t===-1)return"";try{return decodeURIComponent(e.slice(t+1))}catch{return e.slice(t+1)}}function P$(e){if(!e||e.startsWith("#"))return!0;try{return new URL(e,window.location.href).pathname===window.location.pathname}catch{return!1}}function Lp(e){if(!e)return null;const t=document.getElementById(e),n=document.querySelector(`[data-section-id="${CSS.escape(e)}"]`),i=t??n;return i instanceof HTMLElement?i:null}function Id(e){const t=Lp(e);return t?(t.scrollIntoView({behavior:"smooth",block:"start"}),!0):!1}function I$(e,t,n={}){const{isEditor:i,isPreviewMode:o,item:r,pages:l,onLinkNavigate:c}=n,d=n.runAfterClose??(v=>v()),u=e.currentTarget.getAttribute("href")??"",p=L$(u),y=e.currentTarget.target==="_blank";if(r&&c){e.preventDefault(),e.stopPropagation();const v=qs(r,l),m=Sp(r),g={mode:m.type==="url"?"url":"page",href:v.href||u,page:m.type==="page"?m.value:void 0,url:m.type==="url"?m.value:void 0,anchor:m.type==="anchor"?m.value.replace(/^#/,""):(m.anchor??"").replace(/^#/,""),target:v.target};g.target==="_blank"?c(g):d(()=>c(g)),t();return}if(i){e.preventDefault(),d(()=>Id(p)),t();return}!y&&p&&P$(u)&&Lp(p)&&(e.preventDefault(),d(()=>Id(p))),t()}const R$=["--cntrl-article-width","--cntrl-article-top","--cntrl-article-left","--cntrl-viewport-height"];function k$(e){let t=e;for(;t;){if(getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim())return t;t=t.parentElement}return e}function E$(e){const t={},n=k$(e);if(!n)return t;const i=getComputedStyle(n);for(const o of R$){const r=i.getPropertyValue(o).trim();r&&(t[o]=r)}return t}function Rd(e,t,n,i,o){return a.jsx("span",{className:`${e}-link-text-box`,style:{width:o(n),maxWidth:"100%"},children:a.jsx("span",{className:i?`${e}-link-text-inner`:`${e}-link-text-inner-hidden`,style:{width:"100%"},children:t})})}function M$({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,activeEvent:o,currentState:r,isSwitchClone:l=!1,unavailableStates:c=[],layoutId:d,pages:u,onLinkNavigate:p,onUpdateSettings:y,onOpenChange:v}){const{prefix:m}=F.useScopedStyles(),g=s.useRef(null),x=s.useRef(null),b=s.useRef(null),k=s.useRef(null),f=s.useRef(null),S=s.useRef(0),W=s.useRef(null),U=s.useRef(null),B=s.useRef(d),P=s.useMemo(()=>w$(m),[m]),[_,G]=s.useState(!1),[$,L]=s.useState(!1),[D,E]=s.useState(!1),T=Zw(r),C=s.useMemo(()=>new Set(c),[c]),V=It=>!!(It&&C.has(It)),q=!!(t&&!i&&T==="open"&&!V("open"))||!(t&&!i)&&_,I=!!(t&&!i),A=q&&!I;Wl(A),s.useEffect(()=>{if(!q||!I)return;const It=document.documentElement,Xt=It.style.overflow;return It.style.overflow="hidden",()=>{It.style.overflow=Xt}},[q,I]);const j=!V("compact")&&!V("onScroll"),ie=!t||!!i&&!n,ae=o&&o!=="default"?o:void 0,O=j&&T==="compact"?"compact":"default",[oe,N]=s.useState(O),[le,Q]=s.useState(!1),be=!n;O!==oe&&(N(O),be&&Q(!0));const Pe=Tp(e),{logo:ye,logoMaxHeight:ce=120/1440,logoPosition:Y="left",panelHeight:se=60/1440,backgroundColor:pe="#b3b3b3",logoColor:fe="#000000",position:we,horizontalAlign:Re,verticalAlign:ge,iconColor:xe="#000000",showIcon:Ce="on",iconSize:h=16/1440,linkColor:K="#000000",openLinkColor:Z="#000000",compactIconColor:ne="#000000",compactLinkColor:de="#000000",compactLogoColor:z="#000000",compactBackgroundColor:R="#ffffff",compactLogoMaxHeight:ee=120/1440,compactLogoPosition:te,compactPanelHeight:me=60/1440,compactShowIcon:X="on",compactIconSize:Ie=16/1440,compactNavTextWidth:Se,compactNavTextPosition:J,compactNavTextOffset:He,compactNavGap:We,compactNavPaddingLeft:ot=10/1440,compactNavPaddingRight:qe=10/1440,compactFontFamily:tt,compactFontSettings:et,compactFontSize:Ge,compactLineHeight:ve,compactLetterSpacing:_e=0,compactWordSpacing:Be=0,compactTextAlign:Ze="left",compactTextAppearance:$e,openLogoColor:Ne="#000000",menuBackgroundColor:Ue="#ffffff",overlayColor:Je="rgba(0, 0, 0, 0.45)",closeButtonColor:st="#000000",effect:it="fade",openPanelSize:Oe=100,textWidth:Ae=280/1440,navTextWidth:gt,navTextPosition:ze="center",navTextOffset:De=0,gap:Xe=0,navGap:ct,navPaddingLeft:he=10/1440,navPaddingRight:Ee=10/1440,textPaddingLeft:nt=10/1440,textPaddingRight:pt=10/1440,textPaddingTop:Ve=10/1440,textPaddingBottom:vt=10/1440,fontFamily:Rt,fontSettings:At,fontSize:wt,lineHeight:Vt,letterSpacing:jt=0,wordSpacing:Kt=0,textAlign:Yt="left",textAppearance:kt,openFontFamily:Bt,openFontSettings:rn,openFontSize:xt,openLineHeight:yt,openLetterSpacing:Me,openWordSpacing:Qe,openTextAlign:rt,openTextAppearance:dt,stateOverrides:Pt,link:St}=Pe,{horizontalAlign:ht,verticalAlign:Wt}=p$({position:we,horizontalAlign:Re,verticalAlign:ge}),Tt=O==="compact",Ot=Tt?ee:ce,Gt=Jw(Tt?te:Y),Mt=Tt?me:se,_t=Tt?Ie:h,Ft=Tt?Se:gt,ut=Qw(Tt?J:ze),H=(Tt?He:De)??0,Le=Tt?We:ct,je=Tt?ot:he,Fe=Tt?qe:Ee,ft=Ft??Ae,Ht=q||(Tt?X:Ce)!=="off",mt=F.buildColorVars(m,{iconColor:xe,closeButtonColor:st,linkColor:K,openLinkColor:Z,compactIconColor:ne,compactLinkColor:de,compactLogoColor:z,compactBackgroundColor:R,openLogoColor:Ne,menuBackgroundColor:Ue,overlayColor:Je,backgroundColor:pe,logoColor:fe},v$,x$,Pt),Lt=$d(Tt?{fontFamily:tt,fontSettings:et,fontSize:Ge,lineHeight:ve,letterSpacing:_e,wordSpacing:Be,textAlign:Ze,textAppearance:$e}:{fontFamily:Rt,fontSettings:At,fontSize:wt,lineHeight:Vt,letterSpacing:jt,wordSpacing:Kt,textAlign:Yt,textAppearance:kt}),Ut=$d({fontFamily:Bt,fontSettings:rn,fontSize:xt,lineHeight:yt,letterSpacing:Me,wordSpacing:Qe,textAlign:rt,textAppearance:dt},Lt),Dt=Cd(m,Lt,t),an=Cd(m,Ut,t),ln=xd(b,Sd(Lt)),qn=xd(k,Sd(Ut)),Un={...an.css,whiteSpace:"pre-wrap",transform:bd(qn)},Zi=an.className,hn=It=>F.scalingValue(It,t),Vo=Le??Xe,Go=Math.max(je,go),xn=Math.max(Fe,go),li=Math.max(0,1-_t),Ji=Math.max(0,1-_t),bn=n??!1,Kn=bn&&!q,Qi=s.useMemo(()=>Cp({textPaddingLeft:nt,textPaddingRight:pt,textPaddingTop:Ve,textPaddingBottom:vt,fontSize:Ut.fontSize}),[nt,pt,Ve,vt,Ut.fontSize]),eo=It=>{const Xt=a.jsx("span",{className:Zi,style:Un,children:Td(It)});return Rd(m,Xt,Ae,bn,hn)},Ye=it==="left"||it==="right"?{width:`${Oe}%`}:{height:`${Oe}%`},M={...f$(Qi,t),...Ye,alignItems:S$[ht],justifyContent:b$[Wt]},re=s.useRef(e),ue=s.useRef(d);s.useEffect(()=>{if(!y||!t){re.current=e,ue.current=d;return}if(ue.current!==d){re.current=e,ue.current=d;const Mi=Pd(e);Mi!==e&&y(Mi);return}const It=Pd(e),Xt=re.current,un=Xt!==e,fn=un?h$(It,Xt):It;re.current=e;const kn=It!==e,Nn=un&&m$(It,fn);!kn&&!Nn||y(fn)},[e,y,t,d]);const ke=F.scalingValue(_t,t),Ke={width:ke,height:ke,minWidth:ke,minHeight:ke,maxWidth:ke,maxHeight:ke},lt={...Dt.css,textDecoration:"none",transform:bd(ln)},Et=Dt.className,zt=(ye==null?void 0:ye.mode)!=="Off",en=(ye==null?void 0:ye.icon)??"",tn=T$(en),ci=hn(Math.min(Ot,Mt)),di=!!(zt&&en&&Gt==="right")?"left":"right",Xo=Array.isArray(St)?St:[],qo=[O!=="default"?`${m}-state-${O}`:"",q||T==="open"?`${m}-state-open`:"",ae&&ae!==O&&ae!==T?`${m}-state-${ae}`:""].filter(Boolean).join(" "),za=t&&!i?`${m}-editor`:"",Gl=ie?`${m}-interactive`:"",Hp=be&&(O!==oe||le)?`${m}-nav-state-anim`:"",Wp=q?`${m}-open`:"",Op=s.useMemo(()=>E$(g.current),[$,q,d]),Ba=()=>{G(!1)},ja=!t||i,Dp=It=>{if(A){U.current=It;return}It()};s.useEffect(()=>{if(q)return;const It=U.current;U.current=null,It==null||It()},[q]);const Xl=(It,Xt)=>{I$(It,Ba,{isEditor:t,isPreviewMode:i,item:Xt,pages:u,onLinkNavigate:p,runAfterClose:Dp})},zp=()=>{t&&!i||G(It=>!It)},Bp=It=>{It.pointerType==="touch"&&It.currentTarget.blur()},Er=()=>{W.current!==null&&(window.clearTimeout(W.current),W.current=null)};s.useEffect(()=>{if(!le)return;const It=window.setTimeout(()=>{Q(!1)},nn);return()=>window.clearTimeout(It)},[le,O]),s.useEffect(()=>{if(q){Er(),L(!0);return}return S.current+=1,E(!1),Er(),W.current=window.setTimeout(()=>{W.current=null,L(!1)},$n),Er},[q]),s.useLayoutEffect(()=>{B.current!==d&&(B.current=d,S.current+=1,Er(),G(!1),E(!1),L(!1))},[d]),s.useLayoutEffect(()=>{var un;if(!$||!q)return;const It=S.current+1;S.current=It,E(!1),(un=x.current)==null||un.offsetHeight;const Xt=requestAnimationFrame(()=>{S.current===It&&E(!0)});return()=>{cancelAnimationFrame(Xt)}},[$,q]),s.useLayoutEffect(()=>{if(!A||!$)return;const It=f.current;if(!It)return;const Xt=getComputedStyle(It).backgroundColor;if(!Xt)return;const un=document.documentElement,{body:fn}=document,kn=un.style.backgroundColor,Nn=fn.style.backgroundColor;return un.style.backgroundColor=Xt,fn.style.backgroundColor=Xt,()=>{un.style.backgroundColor=kn,fn.style.backgroundColor=Nn}},[A,$,qo,Ue,Pt]),s.useEffect(()=>{v==null||v(q)},[q,v]),s.useEffect(()=>{if(!q)return;const It=Xt=>{Xt.key==="Escape"&&(t&&i||Ba())};return window.addEventListener("keydown",It),()=>window.removeEventListener("keydown",It)},[q,t,i]),s.useEffect(()=>{t&&!i&&T!=="open"&&G(!1)},[t,i,T]),s.useEffect(()=>{i&&G(!1)},[i]);const ql=bn&&q,jp=It=>Xo.filter(Xt=>i$(Xt,d)).map((Xt,un)=>{const{label:fn,href:kn,target:Nn}=qs(Xt,u),Mi=kn?a.jsx("a",{href:kn,target:Nn,rel:Nn==="_blank"?"noopener noreferrer":void 0,className:`${It} ${m}-has-href`,onClick:Va=>Xl(Va,Xt),children:eo(fn)}):a.jsx("span",{className:It,children:eo(fn)});return a.jsxs(s.Fragment,{children:[un>0&&a.jsx("div",{"data-controls":ql?"gap":void 0,"data-controls-axis":"y",className:ql?`${m}-gap-control`:void 0,style:{height:hn(Xe)}}),Mi]},un)}),Vp=$?a.jsxs("div",{ref:x,"data-selection":"none",className:[`${m}-lightbox`,`${m}-full-lightbox ${m}-effect-${it}`,D?`${m}-lightbox-active`:"",`${m}-lightbox-editor`,n?`${m}-lightbox-edit-mode`:"",Gl,qo].filter(Boolean).join(" "),style:{...mt,...Op},"aria-hidden":!D,children:[a.jsx("div",{className:[`${m}-backdrop`,ja?`${m}-backdrop-clickable`:""].filter(Boolean).join(" "),"aria-hidden":"true",onClick:ja?Ba:void 0}),a.jsxs("nav",{className:[`${m}-panel`,ja?`${m}-panel-blocking`:""].filter(Boolean).join(" "),style:M,"aria-label":"Menu","data-lightbox-scrollable":"",children:[bn&&y$(m,Qi,Ut.fontSize,hn),jp(`${m}-link`)]}),A?a.jsx("div",{ref:f,className:`${m}-safari-tint`,"aria-hidden":"true"}):null]}):null,Gp=()=>a.jsx("button",{type:"button",className:`${m}-toggle`,onClick:zp,onPointerUp:Bp,"aria-expanded":q,"aria-label":q?"Close menu":"Open menu",children:a.jsx(a$,{className:`${m}-icon`,lineClassName:`${m}-icon-line`})}),Mr=It=>{const Xt=It==="left",un=Xt?je:Fe,fn=Xt?Go:xn,kn=Xt?li:Ji,Nn=Tt?Xt?"compactNavPaddingLeft":"compactNavPaddingRight":Xt?"navPaddingLeft":"navPaddingRight";return a.jsx("div",{className:Xt?`${m}-nav-padding-left`:`${m}-nav-padding-right`,style:{width:hn(un),flexShrink:0},children:Kn?a.jsx("div",{"data-controls":Nn,"data-controls-axis":"x","data-controls-variant":"column-padding",...Xt?{}:{"data-controls-reverse":""},"data-controls-min":"0","data-controls-max-fraction":String(kn),className:`${m}-control-anchor`,style:{top:0,[Xt?"left":"right"]:0,width:hn(fn),height:"100%"}}):null})},Xp=(It,Xt)=>{const{label:un,href:fn,target:kn}=qs(It,u),Nn=a.jsx("span",{className:Et,style:lt,children:Td(un)}),Mi=Rd(m,Nn,ft,Kn,hn),Va=fn?a.jsx("a",{href:fn,target:kn,rel:kn==="_blank"?"noopener noreferrer":void 0,className:`${m}-nav-link ${m}-has-href`,onClick:Kp=>Xl(Kp,It),children:Mi}):a.jsx("span",{className:`${m}-nav-link`,children:Mi});return a.jsxs(s.Fragment,{children:[Xt>0&&a.jsx("div",{"data-controls":Kn?Tt?"compactNavGap":"navGap":void 0,"data-controls-axis":"x",className:Kn?`${m}-gap-control ${m}-nav-gap-control`:`${m}-nav-gap-control}`,style:{width:hn(Vo),flexShrink:0}}),Va]},Xt)},qp={...mt,height:F.scalingValue(Mt,t),minHeight:F.scalingValue(Mt,t),[`--${m}-panel-height`]:F.scalingValue(Mt,t)},Up=l&&O==="default"&&T!=="open"&&!i?hn(se+Uw):"0px";return a.jsxs("div",{ref:g,className:`${m}-root ${qo} ${za} ${Gl} ${Hp}`.trim(),style:{width:"100%",height:"100%",lineHeight:0,fontSize:0,marginTop:Up,...mt},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:P}}),a.jsx("span",{ref:b,"aria-hidden":!0,style:wd(Dt.css),children:"H"}),a.jsx("span",{ref:k,"aria-hidden":!0,style:wd(an.css),children:"H"}),a.jsx("div",{className:`${m}-nav-slide`,children:a.jsxs("div",{className:`${m}-nav-bar`,style:qp,children:[zt&&en?a.jsxs("div",{className:`${m}-nav-logo ${m}-nav-logo-${Gt}`,children:[Gt==="left"?Mr("left"):null,a.jsxs("div",{className:`${m}-nav-logo-inner${tn?` ${m}-nav-logo-tinted`:""}`,style:{height:ci,...tn?{[`--${m}-logo-image`]:$$(en)}:{}},children:[a.jsx("img",{src:en,alt:"",className:`${m}-nav-logo-img`}),tn?a.jsx("span",{className:`${m}-nav-logo-tint`,"aria-hidden":"true"}):null]}),Gt==="right"?Mr("right"):null]}):null,a.jsx("nav",{className:`${m}-nav-links ${m}-nav-links-${ut}`,style:{transform:e$(ut,H,t)},"aria-label":"Navigation",children:a.jsx("div",{className:`${m}-nav-links-inner`,children:Xo.filter(It=>n$(It,O,d)).map((It,Xt)=>Xp(It,Xt))})})]})}),Vp,a.jsxs("div",{className:`${m}-nav-toggle-wrap ${m}-nav-toggle-wrap-${di}`,children:[di==="left"?Mr("left"):null,Ht?a.jsx("div",{className:`${m}-root ${Wp}`.trim(),style:Ke,children:Gp()}):null,di==="right"?Mr("right"):null]})]})}const A$=`import { Fragment, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type MouseEvent, type PointerEvent, type ReactNode } from 'react';
|
|
24662
24690
|
import { CommonComponentProps } from '../props';
|
|
24663
24691
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
|
|
24664
24692
|
import { useLightboxScrollLock } from '../utils/useLightboxScrollLock';
|
|
@@ -27233,7 +27261,7 @@ export function Burger({
|
|
|
27233
27261
|
</div>
|
|
27234
27262
|
);
|
|
27235
27263
|
}
|
|
27236
|
-
`;function tr(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Di={fontSettings:{type:"object",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0},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 fi(e,t){return e?`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`:t}function Bl(e){return{[fi(e,"fontFamily")]:{type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},[fi(e,"fontSettings")]:{...Di.fontSettings,scope:"common",title:""},[fi(e,"fontSize")]:{...Di.fontSize,scope:"layout",title:""},[fi(e,"lineHeight")]:{...Di.lineHeight,scope:"layout",title:""},[fi(e,"letterSpacing")]:{...Di.letterSpacing,scope:"layout",title:""},[fi(e,"wordSpacing")]:{...Di.wordSpacing,scope:"layout",title:""},[fi(e,"textAlign")]:{...Di.textAlign,scope:"layout",title:""},[fi(e,"textAppearance")]:{...Di.textAppearance,scope:"layout",title:""}}}const F$=Bl(""),N$=Bl("open"),_$=Bl("compact"),H$=["__componentName__",{type:"row",items:["panelHeight","navTextWidth"]},{type:"row",title:"",items:["navTextPosition","navTextOffset"]},{type:"row",title:"Logo",items:["logoMaxHeight","logoPosition"]},{type:"row",title:"Hamburger",items:["iconSize","showIcon"]},"fontFamily","fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAlign","textAppearance","navGap","navPaddingLeft","navPaddingRight"],W$=["__componentName__",{type:"row",items:["compactPanelHeight","compactNavTextWidth"]},{type:"row",title:"",items:["compactNavTextPosition","compactNavTextOffset"]},{type:"row",title:"Logo",items:["compactLogoMaxHeight","compactLogoPosition"]},{type:"row",title:"Hamburger",items:["compactIconSize","compactShowIcon"]},"compactFontFamily","compactFontSettings",{type:"row",items:["compactFontSize","compactLineHeight","compactLetterSpacing","compactWordSpacing"]},"compactTextAlign","compactTextAppearance","compactNavGap","compactNavPaddingLeft","compactNavPaddingRight"],O$=["__componentName__",{type:"row",title:"Text",items:["textWidth","position"]},{type:"row",title:"Menu",items:["openPanelSize","effect"]},"openFontFamily","openFontSettings",{type:"row",items:["openFontSize","openLineHeight","openLetterSpacing","openWordSpacing"]},"openTextAlign","openTextAppearance"],Zn={textTransform:"none",textDecoration:"none",fontVariant:"normal"},$s={fontWeight:400,fontStyle:"normal"},Yr={d:"Always",t:"Open Only",m:"Open Only"},D$=["left-top","center-top","right-top","left-center","center","right-center","left-bottom","center-bottom","right-bottom"],z$=["iconColor","logoColor","linkColor","backgroundColor"],B$={type:"object",version:1,settings:{sizing:"auto manual",properties:{link:{type:"array",scope:"common",display:{type:"page-url-link"},items:{type:"object",properties:{link:{type:"object",properties:{type:{type:"string",enum:["url","page","anchor"]},value:{type:"string",message:"Paste URL here..."},target:{type:"string",enum:["blank","self"]},anchor:{type:"string"}}},label:{type:"string"},showIn:{type:"string",scope:"layout",enum:["Always","Open Only","Open and Compact","Default and Open","Default and Compact"]}}}},logo:{type:"object",scope:"common",title:"Logo",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Logo",display:{type:"settings-image-input"}}}},logoMaxHeight:{type:"number",scope:"layout",title:"Max Height",display:{type:"numeric-input"},min:0,max:9999},logoPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},compactLogoPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},logoColor:{type:"string",scope:"common",title:"Logo Default",titleByState:{default:"Logo Default",hover:"Logo Hover"},display:{type:"palette-color-picker"}},panelHeight:{type:"number",scope:"layout",title:"Menu Height",display:{type:"numeric-input"},min:0,max:9999},backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{default:"Icon Default",hover:"Icon Hover"},display:{type:"palette-color-picker"}},showIcon:{type:"string",scope:"layout",title:"Show",display:{type:"toggle-cycle",enum:["on","off"]}},iconSize:{type:"number",scope:"layout",title:"Size",display:{type:"numeric-input"},min:0,max:9999},linkColor:{type:"string",scope:"common",title:"Text Default",titleByState:{default:"Text Default",hover:"Text Hover"},display:{type:"palette-color-picker"}},compactShowIcon:{type:"string",scope:"layout",title:"Show",display:{type:"toggle-cycle",enum:["on","off"]}},compactIconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{compact:"Icon Default","compact-hover":"Icon Hover"},display:{type:"palette-color-picker"}},compactLinkColor:{type:"string",scope:"common",title:"Text Default",titleByState:{compact:"Text Default","compact-hover":"Text Hover"},display:{type:"palette-color-picker"}},compactLogoColor:{type:"string",scope:"common",title:"Logo Default",titleByState:{compact:"Logo Default","compact-hover":"Logo Hover"},display:{type:"palette-color-picker"}},compactBackgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},openLinkColor:{type:"string",scope:"common",title:"Text Default",titleByState:{open:"Text Default","open-hover":"Text Hover"},display:{type:"palette-color-picker"}},openLogoColor:{type:"string",scope:"common",title:"Logo Default",titleByState:{open:"Logo Default","open-hover":"Logo Hover"},display:{type:"palette-color-picker"}},menuBackgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},overlayColor:{type:"string",scope:"common",title:"Overlay Default",display:{type:"palette-color-picker"}},closeButtonColor:{type:"string",scope:"common",title:"Close Default",titleByState:{open:"Close Default","open-hover":"Close Hover"},display:{type:"palette-color-picker"}},effect:{type:"string",scope:"layout",title:"Effect",display:{type:"toggle-cycle",enum:["fade","left","top","right","bottom"]}},openPanelSize:{type:"number",scope:"layout",title:"Height",display:{type:"percentage-input"},min:0,max:100},textWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},navTextWidth:{type:"number",scope:"layout",title:"Text width",display:{type:"numeric-input"},min:0,max:9999},navTextPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},navTextOffset:{type:"number",scope:"layout",title:"Offset",display:{type:"numeric-input"},min:-9999,max:9999},position:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:[...D$]}},stateOverrides:{type:"object",scope:"common"},gap:tr("Gap"),navGap:{type:"number",scope:"layout",title:"Nav gap",min:0,max:100,display:{type:"range-control",visible:!1}},navPaddingLeft:{type:"number",scope:"layout",title:"Nav padding left",min:0,max:100,display:{type:"range-control",visible:!1}},navPaddingRight:{type:"number",scope:"layout",title:"Nav padding right",min:0,max:100,display:{type:"range-control",visible:!1}},textPaddingLeft:tr("Text padding left"),textPaddingRight:tr("Text padding right"),textPaddingTop:tr("Text padding top"),textPaddingBottom:tr("Text padding bottom"),compactLogoMaxHeight:{type:"number",scope:"layout",title:"Max Height",display:{type:"numeric-input"},min:0,max:9999},compactPanelHeight:{type:"number",scope:"layout",title:"Menu Height",display:{type:"numeric-input"},min:0,max:9999},compactIconSize:{type:"number",scope:"layout",title:"Size",display:{type:"numeric-input"},min:0,max:9999},compactNavTextWidth:{type:"number",scope:"layout",title:"Text width",display:{type:"numeric-input"},min:0,max:9999},compactNavTextPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},compactNavTextOffset:{type:"number",scope:"layout",title:"Offset",display:{type:"numeric-input"},min:-9999,max:9999},compactNavGap:{type:"number",scope:"layout",title:"Nav gap",min:0,max:100,display:{type:"range-control",visible:!1}},compactNavPaddingLeft:{type:"number",scope:"layout",title:"Nav padding left",min:0,max:100,display:{type:"range-control",visible:!1}},compactNavPaddingRight:{type:"number",scope:"layout",title:"Nav padding right",min:0,max:100,display:{type:"range-control",visible:!1}},...F$,...N$,..._$},defaults:{link:[{link:{type:"page",value:"",target:"self"},label:"Home",showIn:Yr},{link:{type:"page",value:"",target:"self"},label:"Works",showIn:Yr},{link:{type:"page",value:"",target:"self"},label:"About",showIn:Yr},{link:{type:"page",value:"",target:"self"},label:"Contact",showIn:Yr}],logo:{mode:"On",icon:"https://cdn.cntrl.site/component-assets/hamburger-logo.svg"},backgroundColor:"#ffffff",logoColor:"#000000",iconColor:"#000000",linkColor:"#000000",openLinkColor:"#000000",compactIconColor:"#000000",compactLinkColor:"#000000",compactLogoColor:"#000000",compactBackgroundColor:"#ffffff",openLogoColor:"#000000",menuBackgroundColor:"#ffffff",overlayColor:"rgba(0, 0, 0, 0.45)",closeButtonColor:"#000000",effect:"fade",showIcon:"on",compactShowIcon:"on",logoPosition:"left",compactLogoPosition:"left",navTextPosition:"center",compactNavTextPosition:"center",navTextOffset:0,compactNavTextOffset:0,position:"left-top",fontFamily:"Goudy Bookletter 1911",fontSettings:$s,textAlign:"left",openFontFamily:"Goudy Bookletter 1911",openFontSettings:$s,openTextAlign:"left",compactFontFamily:"Goudy Bookletter 1911",compactFontSettings:$s,compactTextAlign:"left",stateOverrides:{hover:{linkColor:"#666666",iconColor:"#666666",logoColor:"#666666"},"open-hover":{closeButtonColor:"#666666"}}},displayRules:[{if:{name:"logo.mode",value:"Off"},then:{name:"properties.logoMaxHeight.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.logoPosition.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.compactLogoMaxHeight.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.compactLogoPosition.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.logoColor.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.compactLogoColor.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.openLogoColor.display.visible",value:!1}},{if:{name:"effect",value:"left"},then:{name:"properties.openPanelSize.title",value:"Width"}},{if:{name:"effect",value:"right"},then:{name:"properties.openPanelSize.title",value:"Width"}},{if:{name:"showIcon",value:"off"},then:{name:"properties.iconSize.display.visible",value:!1}},{if:{name:"showIcon",value:"off"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"compactShowIcon",value:"off"},then:{name:"properties.compactIconSize.display.visible",value:!1}},{if:{name:"compactShowIcon",value:"off"},then:{name:"properties.compactIconColor.display.visible",value:!1}}],layoutDefaults:{m:{position:"center",panelHeight:50/375,logoMaxHeight:30/375,logoPosition:"center",compactLogoPosition:"left",navTextPosition:"center",navTextOffset:0,compactNavTextPosition:"center",compactNavTextOffset:0,showIcon:"on",iconSize:30/375,textWidth:240/375,openPanelSize:100,navTextWidth:120/375,gap:24/375,navGap:24/375,navPaddingLeft:20/375,navPaddingRight:20/375,textPaddingLeft:10/375,textPaddingRight:10/375,textPaddingTop:10/375,textPaddingBottom:10/375,fontSize:16/375,lineHeight:20/375,letterSpacing:0,wordSpacing:0,textAppearance:Zn,openFontSize:34/375,openLineHeight:20/375,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Zn,openTextAlign:"center",compactPanelHeight:40/375,compactLogoMaxHeight:20/375,compactShowIcon:"on",compactIconSize:16/375,compactNavTextWidth:80/375,compactNavGap:24/375,compactNavPaddingLeft:20/375,compactNavPaddingRight:20/375,compactFontSize:16/375,compactLineHeight:20/375,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:Zn},t:{textAlign:"center",position:"center",panelHeight:60/768,logoMaxHeight:30/768,logoPosition:"left",compactLogoPosition:"left",navTextPosition:"center",navTextOffset:0,compactNavTextPosition:"center",compactNavTextOffset:0,showIcon:"on",iconSize:16/768,textWidth:300/768,openPanelSize:100,navTextWidth:90/768,gap:32/768,navGap:32/768,navPaddingLeft:20/768,navPaddingRight:20/768,textPaddingLeft:10/768,textPaddingRight:10/768,textPaddingTop:10/768,textPaddingBottom:10/768,fontSize:18/768,lineHeight:20/768,letterSpacing:0,wordSpacing:0,textAppearance:Zn,openFontSize:75/768,openLineHeight:20/768,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Zn,openTextAlign:"center",compactTextAlign:"center",compactPanelHeight:40/768,compactLogoMaxHeight:20/768,compactShowIcon:"on",compactIconSize:16/768,compactNavTextWidth:80/768,compactNavGap:32/768,compactNavPaddingLeft:20/768,compactNavPaddingRight:20/768,compactFontSize:16/768,compactLineHeight:20/768,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:Zn},d:{position:"center",panelHeight:50/1440,logoMaxHeight:30/1440,logoPosition:"left",compactLogoPosition:"left",navTextPosition:"center",navTextOffset:0,compactNavTextPosition:"center",compactNavTextOffset:0,showIcon:"on",iconSize:20/1440,textWidth:300/1440,openPanelSize:100,navTextWidth:60/1440,gap:12/1440,navGap:64/1440,navPaddingLeft:10/1440,navPaddingRight:10/1440,textPaddingLeft:10/1440,textPaddingRight:10/1440,textPaddingTop:10/1440,textPaddingBottom:10/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:Zn,textAlign:"center",openFontSize:90/1440,openLineHeight:16/1440,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Zn,openTextAlign:"center",compactPanelHeight:30/1440,compactLogoMaxHeight:20/1440,compactShowIcon:"on",compactIconSize:20/1440,compactNavTextWidth:60/1440,compactNavGap:20/1440,compactNavPaddingLeft:10/1440,compactNavPaddingRight:10/1440,compactFontSize:16/1440,compactLineHeight:16/1440,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:Zn,compactTextAlign:"center"}},layout:["__componentName__","link","logo","logoMaxHeight","logoPosition","panelHeight","backgroundColor","logoColor","iconColor","showIcon","iconSize","linkColor","openLinkColor","compactShowIcon","compactIconColor","compactLinkColor","compactLogoColor","compactBackgroundColor","compactLogoMaxHeight","compactLogoPosition","compactPanelHeight","compactIconSize","compactNavTextWidth","compactNavTextPosition","compactNavTextOffset","compactNavGap","compactNavPaddingLeft","compactNavPaddingRight","compactFontFamily","compactFontSettings","compactFontSize","compactLineHeight","compactLetterSpacing","compactWordSpacing","compactTextAlign","compactTextAppearance","openLogoColor","menuBackgroundColor","overlayColor","closeButtonColor","effect","textWidth","navTextWidth","navTextPosition","navTextOffset","position","gap","navGap","navPaddingLeft","navPaddingRight","textPaddingLeft","textPaddingRight","textPaddingTop","textPaddingBottom","fontFamily","fontSettings","fontSize","lineHeight","letterSpacing","wordSpacing","textAlign","textAppearance","openFontFamily","openFontSettings","openFontSize","openLineHeight","openLetterSpacing","openWordSpacing","openTextAlign","openTextAppearance"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","logo"]},{id:"default",icon:"default",title:"Default",tooltip:"Default State",layout:H$},{id:"compact",icon:"compact",title:"Compact",tooltip:"Compact State",layout:W$,availableWhen:{navigationPosition:["switch"]}},{id:"open",icon:"open",title:"Open",tooltip:"Open State",layout:O$},{id:"links",icon:"content",title:"Links",tooltip:"Link Settings",layout:["__componentName__","link"]}],paletteBookmark:{items:[...z$],panelIds:["default","compact","open"],stateItems:{default:["iconColor","logoColor","linkColor","backgroundColor"],hover:["iconColor","logoColor","linkColor"],compact:["compactIconColor","compactLogoColor","compactLinkColor","compactBackgroundColor"],"compact-hover":["compactIconColor","compactLogoColor","compactLinkColor"],open:["closeButtonColor","openLogoColor","openLinkColor","menuBackgroundColor","overlayColor"],"open-hover":["closeButtonColor","openLogoColor","openLinkColor"]}},states:["default","hover"],statePanels:["default","compact","open"]},j$={element:M$,id:"basic-burger",name:"Basic Burger",category:"navigation",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple Burger.png"},layoutMode:"navigation",defaultSize:{d:{width:"100%",height:60/1440},t:{width:"100%",height:60/768},m:{width:"100%",height:56/375}},defaultNavigationPosition:{d:"switch",t:"switch",m:"stickyTop"},schema:B$,sourceCode:A$,assetsPaths:{content:[],parameters:[{path:"logo.icon",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"},{path:"openFontFamily"},{path:"compactFontFamily"}]},fontRelations:{fontSettings:"fontFamily",openFontSettings:"openFontFamily",compactFontSettings:"compactFontFamily"}},kd=120,Ed=3,V$=.12,jl={x:0,y:0,width:100,height:100};function wo(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}function Sa(e){return e<0?0:e>1?1:e}function Md(e,t){return e.filter(n=>n.length>0).map(n=>`M ${n.map(i=>`${i.x*t.width} ${i.y*t.height}`).join(" L ")} Z`).join(" ")}function G$(e,t){let n=1/0,i=1/0,o=-1/0,r=-1/0;for(const d of e)for(const u of d){const p=u.x*t.width,y=u.y*t.height;p<n&&(n=p),p>o&&(o=p),y<i&&(i=y),y>r&&(r=y)}const l=o-n,c=r-i;return!isFinite(l)||!isFinite(c)||l<=0||c<=0?null:{x:n,y:i,width:l,height:c}}function X$(e){return e.map(([t,n])=>({x:t,y:n}))}function Cs(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const c of e)for(const d of c)d.x<t&&(t=d.x),d.x>i&&(i=d.x),d.y<n&&(n=d.y),d.y>o&&(o=d.y);const r=i-t,l=o-n;return!isFinite(r)||!isFinite(l)||r<=0||l<=0?e:e.map(c=>c.map(d=>({x:(d.x-t)/r,y:(d.y-n)/l})))}function q$(e,t){const n=[];for(const o of e)for(let r=0;r<o.length;r+=1){const l=o[r],c=o[(r+1)%o.length];(l.y<=t&&c.y>t||c.y<=t&&l.y>t)&&n.push(l.x+(t-l.y)/(c.y-l.y)*(c.x-l.x))}n.sort((o,r)=>o-r);const i=[];for(let o=0;o+1<n.length;o+=2){const r=Sa(n[o]),l=Sa(n[o+1]);l>r&&i.push({x0:r,x1:l})}return U$(i)}function U$(e){if(e.length<2)return e;const t=[...e].sort((i,o)=>i.x0-o.x0),n=[t[0]];for(let i=1;i<t.length;i+=1){const o=n[n.length-1],r=t[i];r.x0<=o.x1?o.x1=Math.max(o.x1,r.x1):n.push({...r})}return n}function K$(e,t){const n=[];let i=0,o=0;for(;i<e.length&&o<t.length;){const r=Math.max(e[i].x0,t[o].x0),l=Math.min(e[i].x1,t[o].x1);l>r&&n.push({x0:r,x1:l}),e[i].x1<t[o].x1?i+=1:o+=1}return n}function Y$(e){const t=[];let n=0;for(const i of e)i.x0>n&&t.push({x0:n,x1:i.x0}),n=Math.max(n,i.x1);return n<1&&t.push({x0:n,x1:1}),t}function Z$(e,t){const n=[];for(const i of e){if(t.x1<=i.x0||t.x0>=i.x1){n.push(i);continue}t.x0>i.x0&&n.push({x0:i.x0,x1:t.x0}),t.x1<i.x1&&n.push({x0:t.x1,x1:i.x1})}return n}function J$(e,t,n,i){let o=null;for(let r=0;r<Ed;r+=1){const l=Sa(t+(n-t)*r/Math.max(1,Ed-1)),c=q$(e,l),d=i==="avoid"?Y$(c):c;if(o=o===null?d:K$(o,d),o.length===0)return[]}return o??[]}function Ad(e,t="stretch",n=jl){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=Ii(i),c=wr(l);if(c.length)return t==="viewbox"?wo(c,n):Cs(c);if(typeof document>"u")return null;const d=i.split(/(?=[Mm])/).map(y=>y.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const y of d){const v=document.createElementNS("http://www.w3.org/2000/svg","path");v.setAttribute("d",y),u.appendChild(v);let m=0;try{m=v.getTotalLength()}catch{m=0}if(!m)continue;const g=[];for(let x=0;x<kd;x+=1){const b=v.getPointAtLength(x/kd*m);g.push({x:b.x,y:b.y})}p.push(g)}return p.length?t==="viewbox"?wo(p,n):Cs(p):null}const o=i.split(/[\s,]+/).map(Number).filter(l=>!Number.isNaN(l));if(o.length<6)return null;const r=[];for(let l=0;l+1<o.length;l+=2)r.push({x:o[l],y:o[l+1]});return t==="viewbox"?wo([r],n):Cs([r])}const Vl={bobbin:"M57.63,0 L57.63,37.24 L74.66,37.24 L74.66,56.07 L57.63,100 L33.84,100 L16.81,56.07 L16.81,37.24 L33.84,37.24 L33.84,0 Z",circle:"M50,0 C77.61,0 100,22.39 100,50 C100,77.61 77.61,100 50,100 C22.39,100 0,77.61 0,50 C0,22.39 22.39,0 50,0 Z",shield:"M0,0 L100,0 L100,50 L50,100 L0,50 Z",vase:"M25.37,0 L91.55,0 C91.55,0 74.8,25.14 83.07,50.03 C91.34,74.92 74.61,100 74.61,100 L8.43,100 C8.43,100 32.3,75.08 23.9,50 C15.5,24.92 25.37,0 25.37,0 Z",parallelogram:"M25.37,0 L91.55,0 L74.61,100 L8.43,100 Z",diamond:"M50,0 L80,50 L50,100 L20,50 Z"},Us="0 0 100 100",wa=100,Ks=16,Q$=12,eC=16,Ts=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,tC=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g,Fd=Math.PI/4,nC=8,iC=Math.PI/18,oC=8,ho=24,fo=[];function rC(){return[{closed:!0,nodes:[{p:{x:0,y:0},in:null,out:null},{p:{x:1,y:0},in:null,out:null},{p:{x:1,y:1},in:null,out:null},{p:{x:0,y:1},in:null,out:null}]}]}function Ls(e,t){return cn(e,n=>({x:(n.x-t.x)/t.width,y:(n.y-t.y)/t.height}))}function aC(e){const t=$i(e),n=t.maxX-t.minX,i=t.maxY-t.minY;return!isFinite(n)||!isFinite(i)||n<=0||i<=0?e:cn(e,o=>({x:(o.x-t.minX)/n,y:(o.y-t.minY)/i}))}function sC(e,t){if(!(t.width>0)||!(t.height>0))return e;const n=Math.min(t.width,t.height),i=(t.width-n)/2,o=(t.height-n)/2;return cn(e,r=>({x:(i+r.x*n)/t.width,y:(o+r.y*n)/t.height}))}function Nd(e,t,n,i,o,r){let l=[];if(t&&t.length)l=Ls(t,i);else{const c=e.trim();if(c&&/^[Mm]/.test(c)){const d=Ii(c);d.length&&(l=n==="viewbox"?Ls(d,i):aC(d))}if(!l.length){const d=o!=="custom"?Vl[o]:void 0;d?l=Ls(Ii(d),jl):l=rC()}}return o==="circle"?sC(l,r):l}function _d(e,t){return!(t.width>0)||!(t.height>0)||!e.length?"":_o(cn(e,n=>({x:n.x*t.width,y:n.y*t.height})))}function Ys(e){const t=e==="rectangle"||e==="custom"?void 0:Vl[e];return t?wo(wr(Ii(t)),jl):[X$([[0,0],[1,0],[1,1],[0,1]])]}function lC(e){const t=e.match(tC);return t?t.map(Number).filter(n=>!Number.isNaN(n)):[]}function Cn(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function Zs(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function pn(e){return{x:e.x,y:e.y}}function cC(e){return{p:pn(e.p),in:e.in?pn(e.in):null,out:e.out?pn(e.out):null}}function zn(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(cC)}))}function cn(e,t){return e.map(n=>({closed:n.closed,nodes:n.nodes.map(i=>({p:t(i.p),in:i.in?t(i.in):null,out:i.out?t(i.out):null}))}))}function Hd(e,t,n,i=n){return cn(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function dC(e,t,n,i,o,r,l){let c=Math.abs(t),d=Math.abs(n);if(!c||!d||e.x===l.x&&e.y===l.y)return[{c1:pn(e),c2:pn(l),p:pn(l)}];const u=i*Math.PI/180,p=Math.cos(u),y=Math.sin(u),v=(e.x-l.x)/2,m=(e.y-l.y)/2,g=p*v+y*m,x=-y*v+p*m,b=g*g/(c*c)+x*x/(d*d);if(b>1){const X=Math.sqrt(b);c*=X,d*=X}const k=o===r?-1:1,f=c*c*x*x+d*d*g*g,S=Math.max(0,c*c*d*d-f),O=f===0?0:k*Math.sqrt(S/f),U=O*c*x/d,z=-O*d*g/c,I=p*U-y*z+(e.x+l.x)/2,N=y*U+p*z+(e.y+l.y)/2,q=Math.atan2((x-z)/d,(g-U)/c);let L=Math.atan2((-x-z)/d,(-g-U)/c)-q;!r&&L>0&&(L-=Math.PI*2),r&&L<0&&(L+=Math.PI*2);const D=Math.max(1,Math.ceil(Math.abs(L)/(Math.PI/2))),_=L/D,C=4/3*Math.tan(_/4),T=(X,R)=>({x:I+p*c*X-y*d*R,y:N+y*c*X+p*d*R}),B=[];let w=q;for(let X=0;X<D;X+=1){const R=w+_,E=Math.cos(w),V=Math.sin(w),ie=Math.cos(R),re=Math.sin(R);B.push({c1:T(E-C*V,V+C*E),c2:T(ie+C*re,re-C*ie),p:X===D-1?pn(l):T(ie,re)}),w=R}return B}function Ii(e){const t=(e??"").trim();if(!t)return[];const n=[];let i=[],o=!1,r={x:0,y:0},l={x:0,y:0},c=null,d=null;const u=()=>{if(o&&i.length>2){const m=i[0],g=i[i.length-1];Math.abs(m.p.x-g.p.x)<1e-6&&Math.abs(m.p.y-g.p.y)<1e-6&&(m.in=g.in??m.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(m,g)=>{i.push({p:m,in:Vn(g??null,m),out:null}),r=m},y=m=>{if(!i.length)return;const g=i[i.length-1];g.out=Vn(m,g.p)};Ts.lastIndex=0;let v=Ts.exec(t);for(;v!==null;){const m=v[1],g=m.toUpperCase(),x=m!==g,b=lC(v[2]),k=f=>x?{x:r.x+b[f],y:r.y+b[f+1]}:{x:b[f],y:b[f+1]};if(g==="Z")o=!0,u(),r=pn(l),c=null,d=null;else if(g==="M"){for(let f=0;f+1<b.length;f+=2){const S=k(f);f===0&&(u(),l=pn(S)),p(S)}c=null,d=null}else if(g==="L"){for(let f=0;f+1<b.length;f+=2)p(k(f));c=null,d=null}else if(g==="H"){for(const f of b)p({x:x?r.x+f:f,y:r.y});c=null,d=null}else if(g==="V"){for(const f of b)p({x:r.x,y:x?r.y+f:f});c=null,d=null}else if(g==="C"){for(let f=0;f+5<b.length;f+=6){const S=k(f),O=k(f+2),U=k(f+4);y(S),p(U,O),c=O}d=null}else if(g==="S"){for(let f=0;f+3<b.length;f+=4){const S=c?Zs(c,r):pn(r),O=k(f),U=k(f+2);y(S),p(U,O),c=O}d=null}else if(g==="Q")for(let f=0;f+3<b.length;f+=4){const S=k(f),O=k(f+2);y(Cn(r,S,2/3)),p(O,Cn(O,S,2/3)),d=S,c=null}else if(g==="T")for(let f=0;f+1<b.length;f+=2){const S=d?Zs(d,r):pn(r),O=k(f);y(Cn(r,S,2/3)),p(O,Cn(O,S,2/3)),d=S,c=null}else if(g==="A")for(let f=0;f+6<b.length;f+=7){const S=x?{x:r.x+b[f+5],y:r.y+b[f+6]}:{x:b[f+5],y:b[f+6]};for(const O of dC(r,b[f],b[f+1],b[f+2],b[f+3]!==0,b[f+4]!==0,S))y(O.c1),p(O.p,O.c2);c=null,d=null}v=Ts.exec(t)}return u(),n}function On(e){return`${Number(e.toFixed(2))}`}function Vn(e,t){return!e||Math.abs(e.x-t.x)<1e-6&&Math.abs(e.y-t.y)<1e-6?null:e}function Pp(e){return!!(Vn(e.in,e.p)||Vn(e.out,e.p))}function jo(e,t){return!Vn(e.out,e.p)&&!Vn(t.in,t.p)}function Wd(e,t){if(jo(e,t))return`L${On(t.p.x)},${On(t.p.y)}`;const n=Vn(e.out,e.p)??e.p,i=Vn(t.in,t.p)??t.p;return`C${On(n.x)},${On(n.y)} ${On(i.x)},${On(i.y)} ${On(t.p.x)},${On(t.p.y)}`}function _o(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const[i,...o]=n.nodes;t.push(`M${On(i.p.x)},${On(i.p.y)}`);let r=i;for(const l of o)t.push(Wd(r,l)),r=l;if(n.closed){const l=Wd(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function Ip(e){const t=[];for(let n=0;n+1<e.nodes.length;n+=1)t.push({from:e.nodes[n],to:e.nodes[n+1],index:n});if(e.closed&&e.nodes.length>2){const n=e.nodes.length-1;t.push({from:e.nodes[n],to:e.nodes[0],index:n})}return t}function Js(e,t,n){if(jo(e,t))return Cn(e.p,t.p,n);const i=e.out??e.p,o=t.in??t.p,r=1-n,l=r*r*r,c=3*r*r*n,d=3*r*n*n,u=n*n*n;return{x:l*e.p.x+c*i.x+d*o.x+u*t.p.x,y:l*e.p.y+c*i.y+d*o.y+u*t.p.y}}function wr(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of Ip(n)){if(jo(o.from,o.to)){i.push(pn(o.from.p));continue}for(let r=0;r<Ks;r+=1)i.push(Js(o.from,o.to,r/Ks))}n.closed||i.push(pn(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function $i(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of wr(e))for(const l of r)l.x<t&&(t=l.x),l.x>i&&(i=l.x),l.y<n&&(n=l.y),l.y>o&&(o=l.y);return{minX:t,minY:n,maxX:i,maxY:o}}function uC(e){const t=$i(e);return!isFinite(t.minX)||!isFinite(t.maxX)||!isFinite(t.minY)||!isFinite(t.maxY)?null:{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}}function Rp(e,t,n){const i={x:(n.x-e.x)/6,y:(n.y-e.y)/6};return{in:{x:t.x-i.x,y:t.y-i.y},out:{x:t.x+i.x,y:t.y+i.y}}}function kp(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=Q$)return{closed:!0,nodes:t.map(r=>({p:pn(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/eC)),i=[];for(let r=0;r<t.length;r+=n)i.push(t[r]);const o=i.length;return{closed:!0,nodes:i.map((r,l)=>({p:pn(r),...Rp(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function Ep(e,t,n=1){if(!e.length)return!1;const i=$i(e);if(!isFinite(i.minX)||!isFinite(i.maxX))return!1;const o=i.maxX-i.minX,r=i.maxY-i.minY;if(o<=t.width*2.5&&r<=t.height*2.5)return!1;const l=Math.max(n,t.width*.5),c=Math.max(n,t.height*.5);return i.minX<t.x-l||i.minY<t.y-c||i.maxX>t.x+t.width+l||i.maxY>t.y+t.height+c}function pC(e,t,n,i,o,r,l){const c=t.width>0?n.width/t.width:1,d=t.height>0?n.height/t.height:1;return!(r>0)||!(l>0)||!(c>0)||!(d>0)?e:cn(e,u=>{const p=i+(u.x-t.x)*r,y=o+(u.y-t.y)*l;return{x:t.x+p/c,y:t.y+y/d}})}function mC(e,t){if(!e.length)return e;const n=$i(e),i=n.maxX-n.minX,o=n.maxY-n.minY;if(!(i>0)||!(o>0)||n.minX>=t.x-1e-6&&n.minY>=t.y-1e-6&&n.maxX<=t.x+t.width+1e-6&&n.maxY<=t.y+t.height+1e-6)return e;const l=Math.min(t.width/i,t.height/o),c=t.x+(t.width-i*l)/2,d=t.y+(t.height-o*l)/2;return cn(e,u=>({x:c+(u.x-n.minX)*l,y:d+(u.y-n.minY)*l}))}function Mp(e){const t={x:0,y:0,width:wa,height:wa},n=e!=="custom"?Vl[e]:void 0,i=n?cn(Ii(n),r=>({x:r.x/100*t.width+t.x,y:r.y/100*t.height+t.y})):cn(kp(Ys("rectangle")),r=>({x:r.x*t.width+t.x,y:r.y*t.height+t.y})),o=mC(i,t);return{shape:e,customPath:_o(o),pathFit:"viewbox",pathViewBox:Us}}function Zr(e,t){return t>0?Math.round(e/t)*t:e}function gC(e,t,n,i){var u;const o=(u=e[t])==null?void 0:u.nodes[n];if(!o)return e;const r=i.x-o.p.x,l=i.y-o.p.y,c=zn(e),d=c[t].nodes[n];return d.p={x:o.p.x+r,y:o.p.y+l},d.in&&(d.in={x:d.in.x+r,y:d.in.y+l}),d.out&&(d.out={x:d.out.x+r,y:d.out.y+l}),c}function Od(e,t,n,i){var r;if(!t.length)return e;const o=zn(e);for(const{contour:l,node:c}of t){const d=(r=o[l])==null?void 0:r.nodes[c];d&&(d.p={x:d.p.x+n,y:d.p.y+i},d.in&&(d.in={x:d.in.x+n,y:d.in.y+i}),d.out&&(d.out={x:d.out.x+n,y:d.out.y+i}))}return o}function hC(e,t){const n=new Map;for(const{contour:o,node:r}of t){const l=n.get(o)??[];l.push(r),n.set(o,l)}let i=e;return n.forEach((o,r)=>{const l=[...o].sort((c,d)=>d-c);for(const c of l)i=Ap(i,r,c)}),i}function fC(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const c=zn(e),d=c[t].nodes[n];if(d[i]=pn(o),r){const p=i==="in"?"out":"in";d[p]=Zs(o,d.p)}return c}function yC(e,t,n,i){var l;const o=(l=e[t])==null?void 0:l.nodes[n];if(!o||!o[i])return e;const r=zn(e);return r[t].nodes[n][i]=null,r}function vC(e,t,n,i){const o=e[t];if(!o)return{contours:e,nodeIndex:-1};const r=o.nodes[n],l=o.nodes[(n+1)%o.nodes.length];if(!r||!l)return{contours:e,nodeIndex:-1};const c=zn(e),d=c[t].nodes,u=n+1;if(jo(r,l))return d.splice(u,0,{p:Cn(r.p,l.p,i),in:null,out:null}),{contours:c,nodeIndex:u};const p=r.out??r.p,y=l.in??l.p,v=Cn(r.p,p,i),m=Cn(p,y,i),g=Cn(y,l.p,i),x=Cn(v,m,i),b=Cn(m,g,i),k=Cn(x,b,i),f=(n+1)%o.nodes.length;return d[n].out=v,d[f].in=g,d.splice(u,0,{p:k,in:x,out:b}),{contours:c,nodeIndex:u}}function Ap(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=zn(e);return o[t].nodes.splice(n,1),o}function Dd(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=zn(e),l=r[t].nodes,c=l[n],d=l.length,u=(n-1+d)%d,p=(n+1)%d,y=!!Vn(l[u].out,l[u].p),v=!!Vn(l[p].in,l[p].p);if(Pp(c)||y||v)return c.in=null,c.out=null,l[u].out=null,l[p].in=null,r;const m=Rp(l[u].p,c.p,l[p].p);return c.in=m.in,c.out=m.out,r}function xC(e,t,n){const i=n.x-t.x,o=n.y-t.y,r=i*i+o*o,l=r===0?0:Math.max(0,Math.min(1,((e.x-t.x)*i+(e.y-t.y)*o)/r)),c={x:t.x+i*l,y:t.y+o*l};return{t:l,distance:Math.hypot(e.x-c.x,e.y-c.y),point:c}}function zd(e,t){let n=null;return e.forEach((i,o)=>{for(const r of Ip(i)){const l=jo(r.from,r.to)?1:Ks;for(let c=0;c<l;c+=1){const d=c/l,u=(c+1)/l,p=xC(t,Js(r.from,r.to,d),Js(r.from,r.to,u));(!n||p.distance<n.distance)&&(n={contour:o,segment:r.index,t:d+(u-d)*p.t,distance:p.distance,point:p.point})}}}),n}function bC(e,t){const n=[];return e.forEach((i,o)=>{i.nodes.forEach((r,l)=>{o===t.contour&&l===t.node||n.push(r.p)})}),n}function Bd(e,t,n){const i=t.filter((r,l)=>isFinite(r)&&t.findIndex(c=>Math.abs(c-r)<1e-6)===l),o=i.map(r=>({value:r,axis:r,from:null}));for(const r of e)o.push({value:r[n],axis:null,from:r});for(const r of i)for(const l of e)o.push({value:r*2-l[n],axis:r,from:l});return o}function jd(e,t,n,i,o){const r=i(t)[n];let l=null,c=1/0;for(const d of e){const u=n==="x"?{x:d.value,y:t.y}:{x:t.x,y:d.value},p=Math.abs(i(u)[n]-r);p>o||l&&p>=c||(l=d,c=p)}return l}function SC(e,t){return e.length===t.length&&e.every((n,i)=>n.kind===t[i].kind&&n.a.x===t[i].a.x&&n.a.y===t[i].a.y&&n.b.x===t[i].b.x&&n.b.y===t[i].b.y)}function wC(e){const t=Math.PI*2;return((e+Math.PI)%t+t)%t-Math.PI}function Qs(e,t){const n=t.x-e.x,i=t.y-e.y,o=Math.hypot(n,i);return o<1e-6?null:{x:n/o,y:i/o}}function $C(e,t){const n=Qs(e,t);return n?{kind:"align",a:{x:e.x-n.x*ho,y:e.y-n.y*ho},b:{x:t.x+n.x*ho,y:t.y+n.y*ho}}:{kind:"align",a:e,b:t}}function el(e,t,n){return t==="x"?{kind:"center",a:{x:e,y:0},b:{x:e,y:n.height}}:{kind:"center",a:{x:0,y:e},b:{x:n.width,y:e}}}function Vd(e,t,n,i,o){if(e.axis===null)return $C(n,o(e.from??n));const r=t==="x"?{x:e.axis,y:0}:{x:0,y:e.axis};return el(o(r)[t],t,i)}function CC(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(Vd(t,"x",l,i,o)),n&&e.y===n.value&&r.push(Vd(n,"y",l,i,o)),r}function TC(e,t,n,i){const o=e==null?void 0:e.nodes[t];if(!e||!o)return null;const r=i(o.p),l=n==="in"?o.out:o.in;if(l)return Qs(i(l),r);const c=e.nodes.length,d=t+(n==="in"?1:-1);if(!e.closed&&(d<0||d>=c))return null;const u=e.nodes[(d+c)%c];if(!u)return null;const p=(n==="in"?u.in:u.out)??u.p;return Qs(i(p),r)}function LC(e,t,n,i,o,r,l){const c=r(t),d=r(e),u=d.x-c.x,p=d.y-c.y,y=Math.hypot(u,p);if(y<1e-6)return{point:e,guides:fo};const v=Math.atan2(p,u),m=Math.round(v/Fd)*Fd;let g=o?m:null,x=!1;if(!o){const z=[];n&&z.push({angle:Math.atan2(n.y,n.x),smooth:!0}),z.push({angle:m,smooth:!1});for(const I of z){const N=wC(I.angle-v);if(!(Math.abs(N)>iC)&&!(Math.abs(Math.sin(N))*y>nC)){g=I.angle,x=I.smooth;break}}}const b=i!==null&&i>0&&Math.abs(y-i)<=oC;if(g===null&&!b)return{point:e,guides:fo};const k=g??v,f=b?i:y,S={x:Math.cos(k),y:Math.sin(k)},O=f+(g===null?0:ho),U=b?f:x?ho:0;return{point:l({x:c.x+S.x*f,y:c.y+S.y*f}),guides:[{kind:"angle",a:{x:c.x-S.x*U,y:c.y-S.y*U},b:{x:c.x+S.x*O,y:c.y+S.y*O}}]}}const tl=.1,nl=8,PC=4,Gd=10,$a=(e,t)=>{switch(t){case"nw":return{x:e.minX,y:e.minY};case"ne":return{x:e.maxX,y:e.minY};case"se":return{x:e.maxX,y:e.maxY};case"sw":return{x:e.minX,y:e.maxY}}},Fp=e=>{switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}},il=(e,t)=>{const n=$a(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*Gd,y:n.y+o*Gd}},ol=(e,t)=>!(t.width>0)||!(t.height>0)||!(e.width>0)||!(e.height>0)?1:Math.max(e.width/t.width,e.height/t.height),Vi=(e,t,n)=>{const i=ol(e,t)*n;return{width:t.width*i,height:t.height*i}},Dn=(e,t,n)=>(e-t)*n,yo=(e,t,n,i)=>{const o=e-t;if(Math.abs(o)<1e-6)return .5;const r=n/o;return(i==null?void 0:i.clamp)===!1?r:Math.abs(o)<PC?.5:Sa(r)},IC=(e,t,n,i,o,r)=>{const l=Vi(e,n,r),c=e.x+Dn(e.width,l.width,i),d=e.y+Dn(e.height,l.height,o),u=ol(e,n),p=ol(t,n),y=Math.min(nl,Math.max(tl,p>0?r*(u/p):r)),v=Vi(t,n,y);return{focalX:yo(t.width,v.width,c-t.x,{clamp:!1}),focalY:yo(t.height,v.height,d-t.y,{clamp:!1}),scale:y}},Xd=1.08,Jr=14,Qr=8;function RC({P:e,box:t,bounds:n,natural:i,imageUrl:o,maskPath:r,stage:l,onStageChange:c,focalX:d,focalY:u,scale:p,onChange:y,onCommit:v}){const m=s.useRef(null),g=`pretext-image-ghost-${s.useId().replace(/:/g,"")}`,x=s.useRef(null),b=s.useRef(null),k=s.useRef({focalX:d,focalY:u,scale:p});k.current={focalX:d,focalY:u,scale:p};const f=l==="image";s.useEffect(()=>{var _;f&&((_=m.current)==null||_.focus({preventScroll:!0}))},[f]);const S=s.useCallback((_,C)=>{var B;const T=(B=m.current)==null?void 0:B.getBoundingClientRect();return!T||T.width<=0||T.height<=0?{x:0,y:0}:{x:(_-T.left)/T.width*t.width,y:(C-T.top)/T.height*t.height}},[t.width,t.height]),O=_=>{var T,B;if(!i)return;_.stopPropagation(),_.preventDefault(),(T=m.current)==null||T.focus({preventScroll:!0});const C=Vi(n,i,p);x.current={pointerId:_.pointerId,origin:S(_.clientX,_.clientY),startX:Dn(n.width,C.width,d),startY:Dn(n.height,C.height,u),width:C.width,height:C.height,moved:!1},(B=m.current)==null||B.setPointerCapture(_.pointerId)},U=(_,C)=>{var ie,re;if(!i)return;_.stopPropagation(),_.preventDefault(),(ie=m.current)==null||ie.focus({preventScroll:!0});const T=Vi(n,i,p),B=Dn(n.width,T.width,d),w=Dn(n.height,T.height,u),X={minX:B,minY:w,maxX:B+T.width,maxY:w+T.height},R=$a(X,Fp(C)),E=$a(X,C),V=Math.hypot(E.x-R.x,E.y-R.y);!isFinite(V)||V<=0||(b.current={pointerId:_.pointerId,anchor:R,startDistance:V,startScale:p,startX:B,startY:w,moved:!1},(re=m.current)==null||re.setPointerCapture(_.pointerId))},z=_=>{if(!i)return;const C=b.current;if(C&&_.pointerId===C.pointerId){_.stopPropagation(),_.preventDefault();const B=S(_.clientX,_.clientY),w={x:B.x-n.x,y:B.y-n.y},X=Math.hypot(w.x-C.anchor.x,w.y-C.anchor.y),R=Math.min(nl,Math.max(tl,C.startScale*(X/C.startDistance)));if(!C.moved&&Math.abs(R-C.startScale)<1e-4)return;C.moved=!0;const E=R/C.startScale,V=C.anchor.x+(C.startX-C.anchor.x)*E,ie=C.anchor.y+(C.startY-C.anchor.y)*E,re=Vi(n,i,R);y({focalX:yo(n.width,re.width,V),focalY:yo(n.height,re.height,ie),scale:R});return}const T=x.current;if(T&&_.pointerId===T.pointerId){_.stopPropagation(),_.preventDefault();const B=S(_.clientX,_.clientY),w=B.x-T.origin.x,X=B.y-T.origin.y;if(!T.moved&&w===0&&X===0)return;T.moved=!0,y({focalX:yo(n.width,T.width,T.startX+w),focalY:yo(n.height,T.height,T.startY+X),scale:p})}},I=_=>{var B,w;const C=x.current;if(C&&_.pointerId===C.pointerId){x.current=null,_.stopPropagation(),(B=m.current)!=null&&B.hasPointerCapture(C.pointerId)&&m.current.releasePointerCapture(C.pointerId),C.moved&&v(k.current);return}const T=b.current;T&&_.pointerId===T.pointerId&&(b.current=null,_.stopPropagation(),(w=m.current)!=null&&w.hasPointerCapture(T.pointerId)&&m.current.releasePointerCapture(T.pointerId),T.moved&&v(k.current))},N=_=>{if(_.key==="Escape"){_.stopPropagation(),c("none");return}if(_.key==="="||_.key==="+"||_.key==="-"||_.key==="_"){_.preventDefault(),_.stopPropagation();const C=_.key==="="||_.key==="+",T=Math.min(nl,Math.max(tl,p*(C?Xd:1/Xd))),B={focalX:d,focalY:u,scale:T};y(B),v(B)}},q=["nw","ne","se","sw"],$={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},L=s.useMemo(()=>{const _=i??{width:n.width,height:n.height},C=Vi(n,_,p);return!(C.width>0)||!(C.height>0)?null:{x:n.x+Dn(n.width,C.width,d),y:n.y+Dn(n.height,C.height,u),width:C.width,height:C.height}},[i,n.x,n.y,n.width,n.height,d,u,p]),D=L?{minX:L.x,minY:L.y,maxX:L.x+L.width,maxY:L.y+L.height}:$;return a.jsxs("svg",{ref:m,className:`${e}-editor${f?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:N,onPointerMove:z,onPointerUp:I,onPointerCancel:I,onLostPointerCapture:I,"data-pretext-image-editor":!0,children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>c("none")}),f&&o&&L&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:g,maskUnits:"userSpaceOnUse",x:L.x,y:L.y,width:L.width,height:L.height,children:[a.jsx("rect",{x:L.x,y:L.y,width:L.width,height:L.height,fill:"#FFFFFF"}),a.jsx("path",{d:r,fillRule:"evenodd",fill:"#000000"})]})}),a.jsx("image",{className:`${e}-editor-ghost`,href:o??void 0,x:L.x,y:L.y,width:L.width,height:L.height,preserveAspectRatio:"none",mask:`url(#${g})`}),a.jsx("rect",{className:`${e}-editor-image-bounds`,x:L.x,y:L.y,width:L.width,height:L.height})]}),f&&a.jsxs(a.Fragment,{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:n.x,y:n.y,width:n.width,height:n.height}),a.jsx("rect",{className:`${e}-editor-body`,x:n.x,y:n.y,width:n.width,height:n.height,onPointerDown:O}),q.map(_=>{const C=il(D,_),T=_==="ne"||_==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:C.x-Qr/2,y:C.y-Qr/2,width:Qr,height:Qr}),a.jsx("rect",{className:`${e}-editor-scale-grab${T?` ${e}-editor-scale-grab-nesw`:""}`,x:C.x-Jr/2,y:C.y-Jr/2,width:Jr,height:Jr,onPointerDown:B=>U(B,_)})]},_)})]})]})}const rl=10,kC=rl*2,Wn=7,EC=4,so=9,MC=3.5,qd=1.08,AC=.05,ea=14,FC=1,ta=14,na=8;function NC({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,uniformStretch:l=!1,stage:c,onStageChange:d,onSelectionChange:u,onChange:p,onCommit:y}){const v=s.useRef(null),m=s.useRef(null),g=s.useRef(i);g.current=i;const x=s.useRef(null),b=s.useRef(null),k=s.useRef(null),f=s.useRef(null),[S,O]=s.useState([]),[U,z]=s.useState(fo),[I,N]=s.useState(null),q=s.useCallback(h=>{z(K=>SC(K,h)?K:h)},[]),$=c==="shape";s.useEffect(()=>{var h;$&&((h=v.current)==null||h.focus({preventScroll:!0}))},[$]),s.useEffect(()=>{$||O(h=>h.length?[]:h)},[$]);const L=S.length>0;s.useEffect(()=>{u==null||u(L)},[L,u]),s.useEffect(()=>()=>u==null?void 0:u(!1),[u]);const D=n.width>0?t.width/n.width:1,_=n.height>0?t.height/n.height:1,C=Math.min(D,_),T=r&&l?C:D,B=r&&l?C:_,w=r&&l?(t.width-n.width*C)/2:0,X=r&&l?(t.height-n.height*C)/2:0,R=s.useCallback(h=>r?{x:w+(h.x-n.x)*T,y:X+(h.y-n.y)*B}:{x:h.x-n.x,y:h.y-n.y},[r,n,T,B,w,X]),E=s.useCallback(h=>r?{x:n.x+(T>0?(h.x-w)/T:0),y:n.y+(B>0?(h.y-X)/B:0)}:{x:n.x+h.x,y:n.y+h.y},[r,n,T,B,w,X]),V=s.useMemo(()=>E({x:t.width/2,y:t.height/2}),[E,t.width,t.height]),ie=s.useCallback((h,K)=>{var te;const Z=(te=v.current)==null?void 0:te.getBoundingClientRect();if(!Z||Z.width<=0||Z.height<=0)return{x:0,y:0};if(r){const me=(h-Z.left)/Z.width*t.width,j=(K-Z.top)/Z.height*t.height;return{x:n.x+(T>0?(me-w)/T:0),y:n.y+(B>0?(j-X)/B:0)}}return{x:n.x+(h-Z.left),y:n.y+(K-Z.top)}},[r,n,t.width,t.height,T,B,w,X]),re=s.useCallback((h,K)=>{var te;const Z=(te=v.current)==null?void 0:te.getBoundingClientRect();return!Z||Z.width<=0||Z.height<=0?{x:0,y:0}:{x:(h-Z.left)/Z.width*t.width,y:(K-Z.top)/Z.height*t.height}},[t.width,t.height]),W=s.useCallback((h,K)=>{const Z=l&&!(K!=null&&K.preserveShape)?pC(h,n,t,w,X,T,B):h;y(Z,K)},[y,l,n,t,w,X,T,B]),ae=s.useCallback(()=>{N(null)},[]),A=s.useCallback((h,K,Z)=>{if(!Z||x.current||b.current||k.current||f.current){ae();return}const te=re(h,K),me=cn(g.current,R);for(const G of me)for(const Ie of G.nodes)if(Math.hypot(Ie.p.x-te.x,Ie.p.y-te.y)<=so){ae();return}const j=zd(me,te);if(!j||j.distance>rl){ae();return}const P=me[j.contour],Q=P==null?void 0:P.nodes[j.segment],ne=P==null?void 0:P.nodes[(j.segment+1)%((P==null?void 0:P.nodes.length)??1)],ue=!!(Q&&ne&&!jo(Q,ne));N(G=>G&&G.curved===ue&&Math.hypot(G.point.x-j.point.x,G.point.y-j.point.y)<.25?G:{point:j.point,curved:ue})},[re,R,ae]),le=h=>{var We;const K=h.metaKey||h.ctrlKey,Z=k.current;if(Z&&h.pointerId===Z.pointerId){if(h.stopPropagation(),h.preventDefault(),Z.startDistance<=0)return;const ot=ie(h.clientX,h.clientY),qe=Math.hypot(ot.x-Z.origin.x,ot.y-Z.origin.y),tt=Math.max(AC,qe/Z.startDistance);if(!Z.moved&&Math.abs(tt-1)<1e-4)return;Z.moved=!0,p(Hd(Z.startContours,Z.origin,tt));return}const te=b.current;if(te&&h.pointerId===te.pointerId){h.stopPropagation(),h.preventDefault();const ot=ie(h.clientX,h.clientY),{bbox:qe}=te,tt=qe.maxX-qe.minX,et=qe.maxY-qe.minY,je=ot.x-te.origin.x,fe=ot.y-te.origin.y;let _e=je,Be=fe;if(isFinite(tt)&&isFinite(et))if(r){let we=n.x,Ne=n.x+n.width,Ue=n.y,Je=n.y+n.height;l&&(T>0&&(we=n.x+(0-w)/T,Ne=n.x+(t.width-w)/T),B>0&&(Ue=n.y+(0-X)/B,Je=n.y+(t.height-X)/B));const st=Math.min(we,Ne-tt),it=Math.max(we,Ne-tt),Oe=Math.min(Ue,Je-et),Ae=Math.max(Ue,Je-et),gt=Math.min(it,Math.max(st,qe.minX+je)),ze=Math.min(Ae,Math.max(Oe,qe.minY+fe));_e=gt-qe.minX,Be=ze-qe.minY}else{const we=qe.minX-n.x,Ne=qe.minY-n.y,Ue=Math.min(0,t.width-tt),Je=Math.max(0,t.width-tt),st=Math.min(0,t.height-et),it=Math.max(0,t.height-et),Oe=Math.min(Je,Math.max(Ue,we+je)),Ae=Math.min(it,Math.max(st,Ne+fe));_e=Oe-we,Be=Ae-Ne}const Ze=[];if(!K&&isFinite(tt)&&isFinite(et)){const we=R({x:qe.minX+tt/2+_e,y:qe.minY+et/2+Be}),Ne={x:t.width/2,y:t.height/2};Math.abs(we.x-Ne.x)<=ea&&(_e=V.x-qe.minX-tt/2,Ze.push(el(Ne.x,"x",t))),Math.abs(we.y-Ne.y)<=ea&&(Be=V.y-qe.minY-et/2,Ze.push(el(Ne.y,"y",t)))}if(!te.moved&&_e===0&&Be===0)return;te.moved=!0,q(Ze.length?Ze:fo),p(cn(te.startContours,we=>({x:we.x+_e,y:we.y+Be})),{carryImage:!0});return}const me=f.current;if(me&&h.pointerId===me.pointerId){h.stopPropagation(),h.preventDefault();const ot=ie(h.clientX,h.clientY);let qe=ot.x-me.origin.x,tt=ot.y-me.origin.y;if(h.shiftKey&&(Math.abs(qe)>Math.abs(tt)?tt=0:qe=0),!me.moved&&qe===0&&tt===0)return;me.moved=!0,p(Od(me.startContours,me.selection,qe,tt));return}const j=x.current;if(!j||h.pointerId!==j.pointerId){A(h.clientX,h.clientY,S.length>0||$);return}ae(),h.stopPropagation(),h.preventDefault();const P=ie(h.clientX,h.clientY);if(j.kind==="anchor"){const ot={x:j.anchor.x+(P.x-j.origin.x),y:j.anchor.y+(P.y-j.origin.y)},qe=K?[]:bC(g.current,{contour:j.contour,node:j.node}),tt=K||!j.center?[]:[j.center],et=jd(Bd(qe,tt.map(_e=>_e.x),"x"),ot,"x",R,ea),je=jd(Bd(qe,tt.map(_e=>_e.y),"y"),ot,"y",R,ea),fe=K?ot:{x:(et==null?void 0:et.value)??Zr(ot.x,o),y:(je==null?void 0:je.value)??Zr(ot.y,o)};if(h.shiftKey&&(Math.abs(fe.x-j.anchor.x)>Math.abs(fe.y-j.anchor.y)?fe.y=j.anchor.y:fe.x=j.anchor.x),!j.moved&&fe.x===j.anchor.x&&fe.y===j.anchor.y)return;j.moved=!0,q(CC(fe,et,je,t,R)),p(gC(g.current,j.contour,j.node,fe));return}const Q=(We=g.current[j.contour])==null?void 0:We.nodes[j.node],ne=j.mirror&&!h.altKey,ue=ne||K?null:j.kind==="in"?Q==null?void 0:Q.out:Q==null?void 0:Q.in,G=Q?R(Q.p):null,Ie=ue?R(ue):null,be=Q&&(!K||h.shiftKey)?LC(P,Q.p,ne||K?null:TC(g.current[j.contour],j.node,j.kind,R),G&&Ie?Math.hypot(Ie.x-G.x,Ie.y-G.y):null,h.shiftKey,R,E):{point:P,guides:fo},J=be.guides.length?be.point:K?P:{x:Zr(P.x,o),y:Zr(P.y,o)},He=j.kind==="in"?Q==null?void 0:Q.in:Q==null?void 0:Q.out;!j.moved&&He&&J.x===He.x&&J.y===He.y||(j.moved=!0,q(be.guides),p(fC(g.current,j.contour,j.node,j.kind,J,ne)))},ee=h=>{q(fo);const K=k.current;if(K&&h.pointerId===K.pointerId){k.current=null,h.stopPropagation();const ue=v.current;ue!=null&&ue.hasPointerCapture(K.pointerId)&&ue.releasePointerCapture(K.pointerId),K.moved&&W(g.current,{preserveShape:!0});return}const Z=b.current;if(Z&&h.pointerId===Z.pointerId){b.current=null,h.stopPropagation();const ue=v.current;ue!=null&&ue.hasPointerCapture(Z.pointerId)&&ue.releasePointerCapture(Z.pointerId),Z.moved?W(g.current,{preserveShape:!0}):O([]);return}const te=f.current;if(te&&h.pointerId===te.pointerId){f.current=null,h.stopPropagation();const ue=v.current;ue!=null&&ue.hasPointerCapture(te.pointerId)&&ue.releasePointerCapture(te.pointerId),te.moved&&W(g.current);return}const me=x.current;if(!me||h.pointerId!==me.pointerId)return;x.current=null,h.stopPropagation();const j=v.current;j!=null&&j.hasPointerCapture(me.pointerId)&&j.releasePointerCapture(me.pointerId);const P=Math.hypot(h.clientX-me.clientOrigin.x,h.clientY-me.clientOrigin.y);if(me.moved||P>EC){me.moved&&W(g.current);return}if(!me.toggleOnRelease||h.type!=="pointerup")return;const ne=Dd(g.current,me.contour,me.node);ne!==g.current&&(p(ne),W(ne))},xe=h=>{h.stopPropagation()},Pe=h=>{var K,Z;h.stopPropagation(),h.preventDefault(),ae(),(K=v.current)==null||K.focus({preventScroll:!0}),b.current={pointerId:h.pointerId,origin:ie(h.clientX,h.clientY),startContours:zn(i),bbox:$i(i),moved:!1},(Z=v.current)==null||Z.setPointerCapture(h.pointerId)},ye=(h,K)=>{var P,Q;h.stopPropagation(),h.preventDefault(),ae(),(P=v.current)==null||P.focus({preventScroll:!0}),O([]),d("shape");const Z=$i(i),te=$a(Z,Fp(K)),me=il(Z,K),j=Math.hypot(me.x-te.x,me.y-te.y);!isFinite(j)||j<=0||(k.current={pointerId:h.pointerId,corner:K,origin:te,startDistance:j,startContours:zn(i),moved:!1},(Q=v.current)==null||Q.setPointerCapture(h.pointerId))},pe=(h,K,Z,te)=>{var P,Q,ne,ue;h.stopPropagation(),h.preventDefault(),ae(),(P=v.current)==null||P.focus({preventScroll:!0});const me=(Q=i[Z])==null?void 0:Q.nodes[te];if(!me)return;if(h.altKey){const G=K==="anchor"?Ap(i,Z,te):yC(i,Z,te,K);if(G===i)return;O(K==="anchor"?[]:[{contour:Z,node:te}]),p(G),W(G);return}const j=h.metaKey||h.ctrlKey;if(K==="anchor"&&h.shiftKey&&!j){O(G=>G.some(Ie=>Ie.contour===Z&&Ie.node===te)?G.filter(Ie=>!(Ie.contour===Z&&Ie.node===te)):[...G,{contour:Z,node:te}]);return}if(K==="anchor"&&!j&&S.length>1&&S.some(G=>G.contour===Z&&G.node===te)){f.current={pointerId:h.pointerId,origin:ie(h.clientX,h.clientY),startContours:zn(i),selection:S,moved:!1},(ne=v.current)==null||ne.setPointerCapture(h.pointerId);return}O([{contour:Z,node:te}]),x.current={kind:K,contour:Z,node:te,pointerId:h.pointerId,origin:ie(h.clientX,h.clientY),clientOrigin:{x:h.clientX,y:h.clientY},anchor:me.p,center:uC(i),mirror:K!=="anchor"&&!!(me.in&&me.out),toggleOnRelease:j,moved:!1},(ue=v.current)==null||ue.setPointerCapture(h.pointerId)},Y=h=>{h.stopPropagation(),h.preventDefault(),ae();const K=cn(i,R),Z=zd(K,re(h.clientX,h.clientY));if(!Z||Z.distance>rl)return;const{contours:te,nodeIndex:me}=vC(i,Z.contour,Z.segment,Z.t);me<0||(O([{contour:Z.contour,node:me}]),p(te),W(te))},se=h=>{if(h.key==="="||h.key==="+"||h.key==="-"||h.key==="_"){h.preventDefault(),h.stopPropagation();const j=$i(i);if(!isFinite(j.minX)||!isFinite(j.maxX))return;const P={x:(j.minX+j.maxX)/2,y:(j.minY+j.maxY)/2},ne=h.key==="="||h.key==="+"?qd:1/qd,ue=Hd(i,P,ne);p(ue),W(ue,{preserveShape:!0});return}if(h.key==="Escape"){h.stopPropagation(),O([]),d("none");return}if(!S.length)return;if(h.key==="Backspace"||h.key==="Delete"){h.preventDefault(),h.stopPropagation();const j=hC(i,S);if(j===i)return;O([]),p(j),W(j);return}const K=o>0?o:FC,Z=h.shiftKey?K*10:K,te={ArrowLeft:[-Z,0],ArrowRight:[Z,0],ArrowUp:[0,-Z],ArrowDown:[0,Z]}[h.key];if(!te)return;h.preventDefault(),h.stopPropagation();const me=Od(i,S,te[0],te[1]);p(me),W(me)},de=s.useMemo(()=>_o(cn(i,R)),[i,R]),ve=s.useMemo(()=>$i(i),[i]),$e=R({x:ve.minX,y:ve.minY}),ke={width:R({x:ve.maxX,y:ve.minY}).x-$e.x,height:R({x:ve.minX,y:ve.maxY}).y-$e.y},he=$&&S.length===0&&isFinite(ve.minX)&&isFinite(ve.maxX)&&ve.maxX>ve.minX&&ve.maxY>ve.minY,Se=S.length>0||$,Ce=Se;return a.jsxs("svg",{ref:v,className:`${e}-editor${Se?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:se,onPointerDown:()=>{var h;return(h=v.current)==null?void 0:h.focus({preventScroll:!0})},onPointerMove:le,onPointerLeave:ae,onPointerUp:ee,onPointerCancel:ee,onLostPointerCapture:ee,onContextMenu:h=>{h.preventDefault()},"data-pretext-path-editor":!0,"data-selection":"none",children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>{O([]),d("none")},onClick:Y}),Ce&&a.jsx("path",{className:`${e}-editor-outline`,d:de}),Ce&&U.map((h,K)=>a.jsx("line",{className:`${e}-editor-snap ${e}-editor-snap-${h.kind}`,x1:h.a.x,y1:h.a.y,x2:h.b.x,y2:h.b.y},`${h.kind}-${K}`)),a.jsx("path",{ref:m,className:`${e}-editor-body`,d:de,fillRule:"evenodd",onPointerDown:Pe,onClick:Y}),Ce&&a.jsx("path",{className:`${e}-editor-hit`,d:de,style:{strokeWidth:kC},onClick:Y}),Ce&&I&&a.jsx("rect",{className:`${e}-editor-add-preview`,x:I.point.x-Wn/2,y:I.point.y-Wn/2,width:Wn,height:Wn,rx:I.curved?Wn/2:0}),Ce&&i.map((h,K)=>h.nodes.map((Z,te)=>{const me=S.some(P=>P.contour===K&&P.node===te),j=R(Z.p);return a.jsxs("g",{children:[me&&S.length===1&&["in","out"].map(P=>{const Q=Z[P];if(!Q)return null;const ne=R(Q);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:j.x,y1:j.y,x2:ne.x,y2:ne.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:ne.x,cy:ne.y,r:MC}),a.jsx("circle",{className:`${e}-editor-grab`,cx:ne.x,cy:ne.y,r:so,onPointerDown:ue=>pe(ue,P,K,te),onClick:xe})]},P)}),a.jsx("rect",{className:`${e}-editor-anchor${me?` ${e}-editor-anchor-selected`:""}`,x:j.x-Wn/2,y:j.y-Wn/2,width:Wn,height:Wn,rx:Pp(Z)?Wn/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:j.x-so,y:j.y-so,width:so*2,height:so*2,onPointerDown:P=>pe(P,"anchor",K,te),onClick:xe,onDoubleClick:P=>{P.stopPropagation(),P.preventDefault();const Q=Dd(i,K,te);p(Q),W(Q)}})]},`${K}-${te}`)})),he&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:$e.x,y:$e.y,width:ke.width,height:ke.height}),["nw","ne","se","sw"].map(h=>{const K=R(il(ve,h)),Z=h==="ne"||h==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:K.x-na/2,y:K.y-na/2,width:na,height:na}),a.jsx("rect",{className:`${e}-editor-scale-grab${Z?` ${e}-editor-scale-grab-nesw`:""}`,x:K.x-ta/2,y:K.y-ta/2,width:ta,height:ta,onPointerDown:te=>ye(te,h),onClick:xe})]},h)})]})]})}const _C=4e3,HC=/^(?:https?:|mailto:|tel:)/i;function Np(e){return!!e&&typeof e=="object"&&e.type==="link"}function WC(e){if(!e)return;const t=e.replace(/\s+/g,"");if(!(/^[a-z][a-z0-9+.-]*:/i.test(t)&&!HC.test(t)))return t}function OC(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,c)=>{for(const d of r){if(Np(d)){o(d.children??[],WC(d.value),d.target);continue}const u=d,p=(u==null?void 0:u.text)??"";if(p.trim())for(const y of p.split(/\s+/))y&&t.push({text:y,leaf:u,href:l,target:c,para:i})}};o((n==null?void 0:n.children)??[])}),t}function Ud(e){return{...e.fontFamily&&{fontFamily:Do(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"}}}function DC(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(Np(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function zC(e,t,n,i,o){if(t<=0||!e.length||n<=0||i<=0)return e;const r=o==="avoid"?1:-1;return e.map(l=>{if(!l.length)return l;let c=1/0,d=-1/0,u=1/0,p=-1/0;for(const m of l){const g=m.x*n,x=m.y*i;g<c&&(c=g),g>d&&(d=g),x<u&&(u=x),x>p&&(p=x)}const y=(c+d)/2,v=(u+p)/2;return l.map(m=>{const g=m.x*n,x=m.y*i,b=g-y,k=x-v,f=Math.sqrt(b*b+k*k);if(f<1e-6)return m;const O=Math.max(0,f+r*t)/f;return{x:(y+b*O)/n,y:(v+k*O)/i}})})}const Ps=2,Is=2;function BC(e,t,n,i,o){if(e.kind!=="whole")return null;const r=t[e.originalIndex],l=e.token.text;if(!r||l.length<Ps+Is)return null;const c=Math.min(r.length-Is,l.length-Is);let d=-1;for(let u=c;u>=Ps;u-=1)if(r[u-1]*i+o*i<=n){d=u;break}return d<Ps?null:{fragmentText:`${l.slice(0,d)}-`,remainderText:l.slice(d),fragmentWidth:r[d-1]+o,remainderWidth:Math.max(0,e.width-r[d-1])}}function Kd(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:c,height:d,allowOverflow:u,capInset:p,capLines:y}=e,v=!!e.hyphenate,m=e.charWidths??[],g=e.hyphenWidth??0,x=e.lineHeight*l,b=e.spaceWidth*l,k=Math.max(0,e.shapeMargin??0),f=[],S=t.map((T,B)=>({token:T,originalIndex:B,width:n[B],kind:"whole"}));if(!S.length||c<=0||x<=0)return{segments:f,placed:0,height:0,capLeft:0,capTop:0,renderTokens:t};const O=Math.max(1,b*.5),U=x*V$,z=zC(i,k,c,d,o);let I=0,N=0,q=0,$=S[0].token.para,L=0,D=0,_=null;for(;I<S.length&&q<_C;){const T=N+x>d;if(T&&!u)break;const B=S[I].token.para;if(B>$+1){N+=x*(B-$-1),$=B-1,q+=1;continue}let w=T?[{x0:0,x1:c}]:J$(z,(N+U)/d,(N+x-U)/d,o).map(R=>({x0:R.x0*c,x1:R.x1*c}));p>0&&y>0&&!T&&w.length&&(_===null&&(_=q,L=w[0].x0,D=N),q-_<y&&(w=Z$(w,{x0:L,x1:L+p})));const X=w.reduce((R,E)=>Math.max(R,E.x1-E.x0),0);for(const R of w){const E=R.x1-R.x0;if(E<O)continue;if(I>=S.length||S[I].token.para!==B)break;const V=I;let ie=0;for(;I<S.length&&S[I].token.para===B;){const re=S[I],W=I===V,ae=re.width*l,A=W?ae:b+ae;if(ie+A<=E){ie+=A,I+=1;continue}if(W&&E>=X-.5&&ae>c-.5){ie+=A,I+=1;continue}if(v){const ee=E-ie-(W?0:b),xe=BC(re,m,ee,l,g);if(xe){const Pe={token:{...re.token,text:xe.fragmentText},originalIndex:re.originalIndex,width:xe.fragmentWidth,kind:"fragment"},ye={token:{...re.token,text:xe.remainderText},originalIndex:re.originalIndex,width:xe.remainderWidth,kind:"remainder"};S.splice(I,1,Pe,ye),ie+=(W?0:b)+xe.fragmentWidth*l,I+=1}}break}if(I>V){const re=I>=S.length||S[I].token.para!==B;f.push({top:N,left:R.x0,width:E,from:V,to:I,justify:r==="justify"&&!re})}if(I>=S.length||S[I].token.para!==B)break}$=B,N+=x,q+=1}let C=0;if(I>0){const T=S[I-1];C=T.kind==="fragment"?T.originalIndex:T.originalIndex+1}return{segments:f,placed:C,height:f.length?N:0,capLeft:L,capTop:D,renderTokens:S.map(T=>T.token)}}const jC=.12,VC=2,GC=10,Rs=.25,XC=e=>{const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}},qC=(e,t)=>Math.abs(e.top-t.top)<.5&&Math.abs(e.left-t.left)<.5&&Math.abs(e.width-t.width)<.5&&Math.abs(e.height-t.height)<.5,UC=(e,t)=>{const[n,i]=s.useState(null);return s.useEffect(()=>{if(!e||!t){i(null);return}let o=0,r=null;const l=()=>{const c=XC(e);(!r||!qC(r,c))&&(r=c,i(c)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n},ks=(e,t)=>{if(!(t.width>0)||!(t.height>0))return e;const n=Math.min(t.width,t.height),i=(t.width-n)/2,o=(t.height-n)/2;return e.map(r=>r.map(l=>({x:(i+l.x*n)/t.width,y:(o+l.y*n)/t.height})))},nr=typeof window>"u"?s.useEffect:s.useLayoutEffect;function KC(){return typeof document>"u"?null:document.body}function YC({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:c,allowOverflow:d,fitEnabled:u,scale:p,onFitScale:y,padding:v,hyphenate:m,showOverflowIndicator:g,dropCapLines:x,dropCapSize:b,showGuides:k,typography:f,imageUrl:S,imageFocalX:O,imageFocalY:U,imageScale:z,imageCustomPath:I,pathDragActive:N,pathCarryImage:q,onCarryImageConsumed:$,pathEditor:L,imageEditor:D}){var Xe,ct;const _=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[C,T]=s.useState(null),B=s.useRef(null),[w,X]=s.useState({width:0,height:0}),[R,E]=s.useState(0),[V,ie]=s.useState(null),[re,W]=s.useState(0),[ae,A]=s.useState("none");s.useEffect(()=>{!L&&!D&&A("none")},[L,D]);const[le,ee]=s.useState(null);s.useEffect(()=>{if(!S||typeof Image>"u"){ee(null);return}let ge=!1;const Ee=new Image;return Ee.onload=()=>{ge||ee({width:Ee.naturalWidth,height:Ee.naturalHeight})},Ee.src=S,()=>{ge=!0}},[S]);const xe=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),Pe=s.useMemo(()=>OC(xe),[xe]),ye=s.useMemo(()=>DC(xe),[xe]),pe=x>0&&b>1?((ct=(Xe=Pe[0])==null?void 0:Xe.text)==null?void 0:ct.charAt(0))??"":"",Y=(L==null?void 0:L.contours)??null,se=s.useMemo(()=>{let ge=[];if(Y){const Ee=wr(Y);Ee.length&&(ge=wo(Ee,r))}if(!ge.length){const Ee=i.trim(),nt=Ee?Ad(Ee,o,r):null;nt&&nt.length?ge=nt:ge=Ys(n==="custom"?"rectangle":n)}return n==="circle"?ks(ge,w):ge},[Y,n,i,o,r,w.width,w.height]),de=L==null?void 0:L.onConvert,ve=(L==null?void 0:L.needsConversion)??!1,$e=s.useMemo(()=>{if(n==="circle")return!1;const ge=Y??(i.trim()?Ii(i):null);return!!(ge&&Ep(ge,r))},[Y,i,r,n]),[ke,he]=s.useState(null);nr(()=>{if(!$e){ke&&he(null);return}!ke&&w.width>0&&w.height>0&&he({width:w.width,height:w.height})},[$e,w.width,w.height,ke]);const Se=s.useMemo(()=>{if(!$e||w.width<=0||w.height<=0)return se;const ge=ke??w,Ee=r.width/ge.width,nt=r.height/ge.height;return se.map(pt=>pt.map(Ge=>({x:Ge.x*Ee,y:Ge.y*nt})))},[se,$e,ke,r.width,r.height,w.width,w.height]),Ce=s.useMemo(()=>{if(Y){const pt=wr(Y);if(pt.length){const Ge=wo(pt,r);return n==="circle"?ks(Ge,w):Ge}}const ge=I.trim(),Ee=ge?Ad(ge,o,r):null,nt=Ee&&Ee.length?Ee:Ys(n==="custom"?"rectangle":n);return n==="circle"?ks(nt,w):nt},[Y,n,I,o,r,w.width,w.height]),h=s.useMemo(()=>{if(!$e||w.width<=0||w.height<=0)return Ce;const ge=ke??w,Ee=r.width/ge.width,nt=r.height/ge.height;return Ce.map(pt=>pt.map(Ge=>({x:Ge.x*Ee,y:Ge.y*nt})))},[Ce,$e,ke,r.width,r.height,w.width,w.height]),K=s.useRef(null),Z=s.useRef(!1);s.useEffect(()=>{if(!(!de||w.width<=0||w.height<=0)){if($e){if(K.current===i)return;const ge=Y??(i.trim()?Ii(i):null);if(!(ge!=null&&ge.length))return;const Ee=cn(ge,nt=>({x:r.x+(nt.x-r.x)/w.width*r.width,y:r.y+(nt.y-r.y)/w.height*r.height}));K.current=_o(Ee),de(Ee);return}!ve||!se.length||Z.current||(Z.current=!0,de(cn(kp(se),ge=>({x:ge.x*wa,y:ge.y*wa}))))}},[ve,$e,de,se,Y,i,r,w.width,w.height]);const te=s.useCallback(()=>{const ge=C;if(!ge)return;const Ee=ge.getBoundingClientRect(),nt=parseFloat(window.getComputedStyle(ge).paddingTop)||0;E(Ge=>Math.abs(Ge-nt)<.5?Ge:nt);const pt={width:Ee.width,height:Ee.height};X(Ge=>Math.abs(Ge.width-pt.width)<.5&&Math.abs(Ge.height-pt.height)<.5?Ge:pt)},[C]);nr(()=>{const ge=C;if(!ge||typeof ResizeObserver>"u")return;te();const Ee=new ResizeObserver(te);return Ee.observe(ge),()=>Ee.disconnect()},[C,te]),nr(()=>{te()},[v,te]),s.useEffect(()=>{const ge=typeof document<"u"?document.fonts:void 0;ge!=null&&ge.ready&&ge.ready.then(()=>{W(Ee=>Ee+1)})},[]),nr(()=>{const ge=B.current;if(!ge)return;if(!Pe.length){ie(null);return}const Ee=[],nt=document.createDocumentFragment();for(const ut of Pe){const H=document.createElement("span");Object.assign(H.style,Ud(ut.leaf)),H.textContent=ut.text,nt.appendChild(H),Ee.push(H)}const pt=document.createElement("span");pt.textContent=" ",nt.appendChild(pt);const Ge=document.createElement("span");Ge.textContent="-",nt.appendChild(Ge);const vt=pe||"H",Rt=document.createElement("span");Rt.textContent=vt,Rt.style.lineHeight="1",nt.appendChild(Rt),ge.replaceChildren(nt);const At=window.getComputedStyle(ge),wt=parseFloat(At.fontSize)||16,Vt=parseFloat(At.lineHeight),jt=Number.isNaN(Vt)?wt*1.2:Vt,Kt=Math.max(jt,wt),Yt=document.createElement("span");Yt.textContent=vt,Yt.style.lineHeight=`${Kt}px`;const kt=document.createElement("span");kt.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",Yt.appendChild(kt),ge.appendChild(Yt);const Bt=Yt.getBoundingClientRect().top,rn=kt.getBoundingClientRect().top,xt=Math.max(1,rn-Bt);Yt.remove();let yt=xt*.8;const Qe=document.createElement("canvas").getContext("2d"),rt=ut=>`${At.fontStyle} ${At.fontWeight} ${ut}px ${At.fontFamily}`;if(Qe){Qe.font=rt(wt);const ut=Qe.measureText(vt).actualBoundingBoxAscent;ut>0&&(yt=ut)}const dt=b>1?(b-1)*Kt+yt:yt;let Pt=wt*(dt/yt);if(Qe){Qe.font=rt(Pt);const ut=Qe.measureText(vt).actualBoundingBoxAscent;ut>0&&(Pt=Pt*(dt/ut))}Rt.style.fontSize=`${Pt}px`,Rt.style.lineHeight=`${Pt}px`;const St=document.createElement("span");St.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",Rt.appendChild(St);const ht=Math.max(1,St.getBoundingClientRect().top-Rt.getBoundingClientRect().top);St.remove();const Tt=(b-1)*Kt+xt-ht,Ot=Ee.map(ut=>ut.getBoundingClientRect().width),Gt=pt.getBoundingClientRect().width,Mt=Ge.getBoundingClientRect().width,_t=pe?Rt.getBoundingClientRect().width:0,Ft=m?Ee.map(ut=>{const H=ut.firstChild;if(!(H instanceof Text)||H.data.length<4)return;const Le=document.createRange(),Ve=ut.getBoundingClientRect().left,Fe=[];for(let ft=1;ft<=H.data.length;ft+=1)Le.setStart(H,0),Le.setEnd(H,ft),Fe.push(Le.getBoundingClientRect().right-Ve);return Fe}):[];ge.replaceChildren(),ie({widths:Ot,spaceWidth:Gt,dashWidth:Mt,charWidths:Ft,lineHeight:Kt,capWidth:_t,dropCapFontSize:Pt,dropCapTopAdjust:Tt})},[Pe,f,pe,x,b,re,w.width,m]);const me=V&&pe?V.capWidth+V.lineHeight*jC:0,j=Math.max(x,Math.ceil(b)),P=s.useMemo(()=>{if(!V||!Pe.length||w.width<=0||w.height<=0||!u)return 1;const ge=pt=>Kd({tokens:Pe,widths:V.widths,spaceWidth:V.spaceWidth,lineHeight:V.lineHeight,width:w.width,height:w.height,rings:Se,mode:l,align:c,scale:pt,allowOverflow:!1,capInset:me*pt,capLines:pe?j:0,hyphenate:m,charWidths:V.charWidths,hyphenWidth:V.dashWidth,shapeMargin:R});if(ge(1).placed>=Pe.length)return 1;if(ge(Rs).placed<Pe.length)return Rs;let Ee=Rs,nt=1;for(let pt=0;pt<GC;pt+=1){const Ge=(Ee+nt)/2;ge(Ge).placed>=Pe.length?Ee=Ge:nt=Ge}return Ee},[V,Pe,w.width,w.height,Se,l,c,u,me,pe,j,m,R]);s.useEffect(()=>{y(P)},[P,y]);const Q=u?Math.min(p,P):1,ne=s.useMemo(()=>!V||!Pe.length||w.width<=0||w.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0,renderTokens:Pe}:Kd({tokens:Pe,widths:V.widths,spaceWidth:V.spaceWidth,lineHeight:V.lineHeight,width:w.width,height:w.height,rings:Se,mode:l,align:c,scale:Q,allowOverflow:d,capInset:me*Q,capLines:pe?j:0,hyphenate:m,charWidths:V.charWidths,hyphenWidth:V.dashWidth,shapeMargin:R}),[V,Pe,w.width,w.height,Se,l,c,Q,d,me,pe,j,m,R]),ue=g&&Pe.length>0&&ne.placed<Pe.length,G=V?V.dropCapFontSize*Q:0,Ie=V?V.dropCapTopAdjust*Q:0,be=c==="justify"?"left":c,J=V?V.lineHeight*Q:0,He=ne.segments.length?ne.segments[ne.segments.length-1]:null,We=He?{top:He.top+J,left:He.left+He.width/2}:{top:w.height,left:w.width/2},ot=!!(L&&Y&&w.width>0&&w.height>0),qe=!!D,tt=(ot||qe)&&w.width>0&&w.height>0,et=UC(C,tt),je=tt&&et?KC():null,fe=s.useRef(!1),_e=s.useCallback(ge=>{fe.current=ge},[]);s.useEffect(()=>{if(!ot&&!qe)return;const ge=Ee=>{const nt=C;if(!nt)return;const pt=nt.getBoundingClientRect();Ee.clientX>=pt.left&&Ee.clientX<=pt.right&&Ee.clientY>=pt.top&&Ee.clientY<=pt.bottom&&(Ee.preventDefault(),Ee.stopPropagation(),A(vt=>vt==="shape"&&fe.current?vt:vt==="shape"&&qe?"image":ot?"shape":"image"))};return document.addEventListener("dblclick",ge,!0),()=>document.removeEventListener("dblclick",ge,!0)},[ot,qe,C]);const Be=s.useMemo(()=>S&&w.width>0&&w.height>0?G$(h,w):null,[S,h,w.width,w.height]),Ze=s.useRef(null),we=(()=>{const ge=Ze.current;return q||!D||!le||!Be||!ge||I===ge.customPath||ge.shape!==n&&n!=="custom"?null:IC(ge.bounds,Be,le,ge.focalX,ge.focalY,ge.scale)})();nr(()=>{if(N||!D||!le||!Be)return;const ge=Ze.current,Ee=!!(ge&&I!==ge.customPath);Ee&&we&&D.onCommit(we),Ee&&q&&($==null||$()),Ze.current={rings:h,bounds:Be,focalX:(we==null?void 0:we.focalX)??O,focalY:(we==null?void 0:we.focalY)??U,scale:(we==null?void 0:we.scale)??z,customPath:I,shape:n}},[N,q,I,n,h,Be,D,le,O,U,z,we,$]);const Ne=Ze.current,Ue=!!(N&&!q&&Ne&&!we),Je=Ue&&Ne?Ne.focalX:(we==null?void 0:we.focalX)??O,st=Ue&&Ne?Ne.focalY:(we==null?void 0:we.focalY)??U,it=Ue&&Ne?Ne.scale:(we==null?void 0:we.scale)??z,Oe=Ue&&Ne?Ne.bounds:Be,Ae=s.useMemo(()=>{if(!(w.width>0)||!(w.height>0))return"";let ge=Nd(i,Y,o,r,n,w);if($e){const Ee=ke??w,nt=r.width/Ee.width,pt=r.height/Ee.height;ge=cn(ge,Ge=>({x:Ge.x*nt,y:Ge.y*pt}))}return _d(ge,w)||Md(Se,w)},[i,Y,o,r,n,w.width,w.height,$e,ke,Se]),gt=s.useMemo(()=>{if(!S||!(w.width>0)||!(w.height>0))return"";let ge=Nd(I,Y,o,r,n,w);if($e){const Ee=ke??w,nt=r.width/Ee.width,pt=r.height/Ee.height;ge=cn(ge,Ge=>({x:Ge.x*nt,y:Ge.y*pt}))}return _d(ge,w)||Md(h,w)},[S,I,Y,o,r,n,w.width,w.height,$e,ke,h]),ze=`${_}-clip`,De=s.useMemo(()=>{if(!Oe)return null;const ge=le??{width:Oe.width,height:Oe.height},Ee=Vi(Oe,ge,it);return{x:Dn(Oe.width,Ee.width,Je),y:Dn(Oe.height,Ee.height,st),width:Ee.width,height:Ee.height}},[Oe,le,Je,st,it]);return a.jsxs("div",{className:`${e}-column`,style:{padding:v},ref:T,children:[Ae?a.jsxs("svg",{className:`${e}-shape-fill`,style:{top:0,left:0,width:w.width,height:w.height},viewBox:`0 0 ${w.width} ${w.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("path",{className:`${e}-shape-fill-path`,d:Ae,fillRule:"evenodd"}),S&>&&Oe&&De?a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsx("clipPath",{id:ze,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:gt,fillRule:"evenodd"})})}),a.jsx("image",{href:S,x:Oe.x+De.x,y:Oe.y+De.y,width:De.width,height:De.height,preserveAspectRatio:"none",clipPath:`url(#${ze})`})]}):null]}):null,a.jsxs("div",{className:`${e}-flow${d?"":` ${e}-clip`}`,style:{...f,["--"+e+"-fit"]:Q,top:0,left:0,width:w.width,height:w.height},children:[a.jsx("div",{className:`${e}-measure`,ref:B,style:f,"aria-hidden":!0}),ne.segments.map((ge,Ee)=>{const nt=ne.renderTokens.slice(ge.from,ge.to),pt=Ee===0;return a.jsx("div",{className:`${e}-line${ge.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${ge.top}px`,left:`${ge.left}px`,width:`${ge.width}px`,textAlign:ge.justify?void 0:be},children:nt.map((Ge,vt)=>{const At=pe&&pt&&ge.from===0&&vt===0?Ge.text.slice(1):Ge.text,wt=Ud(Ge.leaf),Vt=Ge.href?a.jsx("a",{className:`${e}-link`,href:Ge.href,target:Ge.target,rel:Ge.target?"noopener noreferrer":void 0,style:wt,children:At}):a.jsx("span",{style:wt,children:At});return a.jsxs("span",{children:[!ge.justify&&vt>0?" ":null,Vt]},vt)})},`${ge.from}-${ge.to}-${Ee}`)}),k&&!Y&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:Se.map((ge,Ee)=>a.jsx("polygon",{points:ge.map(nt=>`${nt.x},${nt.y}`).join(" ")},Ee))})]}),pe&&V&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...f,top:`${ne.capTop+Ie}px`,left:`${ne.capLeft}px`,fontSize:`${G}px`,lineHeight:`${G}px`},children:pe}),je&&et&&(Y&&L||D)&&Gn.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:et.top,left:et.left,width:et.width,height:et.height,zIndex:VC,pointerEvents:"none"},children:[Y&&L&&a.jsx(NC,{P:e,box:{width:et.width,height:et.height},viewBox:r,contours:Y,snap:L.snap,stretchToBox:!$e,uniformStretch:n==="circle",stage:ae,onStageChange:A,onSelectionChange:_e,onChange:L.onChange,onCommit:L.onCommit}),D&&Oe&&a.jsx(RC,{P:e,box:{width:et.width,height:et.height},bounds:Oe,natural:le,imageUrl:S,maskPath:gt,stage:ae,onStageChange:A,focalX:Je,focalY:st,scale:it,onChange:D.onChange,onCommit:D.onCommit})]}),je),a.jsx("div",{className:`${e}-a11y`,children:ye.map((ge,Ee)=>a.jsx("p",{children:ge},Ee))}),ue&&a.jsxs("svg",{className:`${e}-overflow-icon`,width:"33",height:"24",viewBox:"0 0 33 24",style:{top:We.top,left:We.left},"aria-hidden":!0,children:[a.jsx("path",{d:"M12.8,4 L20.2,4 C24.68042,4 26.9206301,4 28.631924,4.87194781 C31.3123488,6.23769248 33,8.99168887 33,12 C33,15.0083111 31.3123488,17.7623075 28.631924,19.1280522 C26.9206301,20 24.68042,20 20.2,20 L12.8,20 C8.31957995,20 6.07936993,20 4.368076,19.1280522 C1.68765116,17.7623075 0,15.0083111 0,12 C0,8.99168887 1.68765116,6.23769248 4.368076,4.87194781 C6.07936993,4 8.31957995,4 12.8,4 Z",fill:"#FF4400"}),a.jsx("path",{transform:"translate(5, 0)",fill:"#FFFFFF",d:"M12,5.625 C12.3846269,5.625 12.7016304,5.91453014 12.7449542,6.28753416 L12.75,6.375 L12.75,11.25 L17.625,11.25 C18.0392136,11.25 18.375,11.5857864 18.375,12 C18.375,12.3846269 18.0854699,12.7016304 17.7124658,12.7449542 L17.625,12.75 L12.75,12.75 L12.75,17.625 C12.75,18.0392136 12.4142136,18.375 12,18.375 C11.6153731,18.375 11.2983696,18.0854699 11.2550458,17.7124658 L11.25,17.625 L11.25,12.75 L6.375,12.75 C5.96078644,12.75 5.625,12.4142136 5.625,12 C5.625,11.6153731 5.91453014,11.2983696 6.28753416,11.2550458 L6.375,11.25 L11.25,11.25 L11.25,6.375 C11.25,5.96078644 11.5857864,5.625 12,5.625 Z"})]})]})}const _p=["diamond","parallelogram","vase","circle","shield","bobbin","custom"],ZC={x:0,y:0,width:100,height:100},JC=e=>{const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?ZC:{x:t[0],y:t[1],width:t[2],height:t[3]}},QC=e=>`
|
|
27264
|
+
`;function tr(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Di={fontSettings:{type:"object",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0},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 fi(e,t){return e?`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`:t}function Bl(e){return{[fi(e,"fontFamily")]:{type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},[fi(e,"fontSettings")]:{...Di.fontSettings,scope:"common",title:""},[fi(e,"fontSize")]:{...Di.fontSize,scope:"layout",title:""},[fi(e,"lineHeight")]:{...Di.lineHeight,scope:"layout",title:""},[fi(e,"letterSpacing")]:{...Di.letterSpacing,scope:"layout",title:""},[fi(e,"wordSpacing")]:{...Di.wordSpacing,scope:"layout",title:""},[fi(e,"textAlign")]:{...Di.textAlign,scope:"layout",title:""},[fi(e,"textAppearance")]:{...Di.textAppearance,scope:"layout",title:""}}}const F$=Bl(""),N$=Bl("open"),_$=Bl("compact"),H$=["__componentName__",{type:"row",items:["panelHeight","navTextWidth"]},{type:"row",title:"",items:["navTextPosition","navTextOffset"]},{type:"row",title:"Logo",items:["logoMaxHeight","logoPosition"]},{type:"row",title:"Hamburger",items:["iconSize","showIcon"]},"fontFamily","fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAlign","textAppearance","navGap","navPaddingLeft","navPaddingRight"],W$=["__componentName__",{type:"row",items:["compactPanelHeight","compactNavTextWidth"]},{type:"row",title:"",items:["compactNavTextPosition","compactNavTextOffset"]},{type:"row",title:"Logo",items:["compactLogoMaxHeight","compactLogoPosition"]},{type:"row",title:"Hamburger",items:["compactIconSize","compactShowIcon"]},"compactFontFamily","compactFontSettings",{type:"row",items:["compactFontSize","compactLineHeight","compactLetterSpacing","compactWordSpacing"]},"compactTextAlign","compactTextAppearance","compactNavGap","compactNavPaddingLeft","compactNavPaddingRight"],O$=["__componentName__",{type:"row",title:"Text",items:["textWidth","position"]},{type:"row",title:"Menu",items:["openPanelSize","effect"]},"openFontFamily","openFontSettings",{type:"row",items:["openFontSize","openLineHeight","openLetterSpacing","openWordSpacing"]},"openTextAlign","openTextAppearance"],Zn={textTransform:"none",textDecoration:"none",fontVariant:"normal"},Cs={fontWeight:400,fontStyle:"normal"},Yr={d:"Always",t:"Open Only",m:"Open Only"},D$=["left-top","center-top","right-top","left-center","center","right-center","left-bottom","center-bottom","right-bottom"],z$=["iconColor","logoColor","linkColor","backgroundColor"],B$={type:"object",version:1,settings:{sizing:"auto manual",properties:{link:{type:"array",scope:"common",display:{type:"page-url-link"},items:{type:"object",properties:{link:{type:"object",properties:{type:{type:"string",enum:["url","page","anchor"]},value:{type:"string",message:"Paste URL here..."},target:{type:"string",enum:["blank","self"]},anchor:{type:"string"}}},label:{type:"string"},showIn:{type:"string",scope:"layout",enum:["Always","Open Only","Open and Compact","Default and Open","Default and Compact"]}}}},logo:{type:"object",scope:"common",title:"Logo",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Logo",display:{type:"settings-image-input"}}}},logoMaxHeight:{type:"number",scope:"layout",title:"Max Height",display:{type:"numeric-input"},min:0,max:9999},logoPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},compactLogoPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},logoColor:{type:"string",scope:"common",title:"Logo Default",titleByState:{default:"Logo Default",hover:"Logo Hover"},display:{type:"palette-color-picker"}},panelHeight:{type:"number",scope:"layout",title:"Menu Height",display:{type:"numeric-input"},min:0,max:9999},backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{default:"Icon Default",hover:"Icon Hover"},display:{type:"palette-color-picker"}},showIcon:{type:"string",scope:"layout",title:"Show",display:{type:"toggle-cycle",enum:["on","off"]}},iconSize:{type:"number",scope:"layout",title:"Size",display:{type:"numeric-input"},min:0,max:9999},linkColor:{type:"string",scope:"common",title:"Text Default",titleByState:{default:"Text Default",hover:"Text Hover"},display:{type:"palette-color-picker"}},compactShowIcon:{type:"string",scope:"layout",title:"Show",display:{type:"toggle-cycle",enum:["on","off"]}},compactIconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{compact:"Icon Default","compact-hover":"Icon Hover"},display:{type:"palette-color-picker"}},compactLinkColor:{type:"string",scope:"common",title:"Text Default",titleByState:{compact:"Text Default","compact-hover":"Text Hover"},display:{type:"palette-color-picker"}},compactLogoColor:{type:"string",scope:"common",title:"Logo Default",titleByState:{compact:"Logo Default","compact-hover":"Logo Hover"},display:{type:"palette-color-picker"}},compactBackgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},openLinkColor:{type:"string",scope:"common",title:"Text Default",titleByState:{open:"Text Default","open-hover":"Text Hover"},display:{type:"palette-color-picker"}},openLogoColor:{type:"string",scope:"common",title:"Logo Default",titleByState:{open:"Logo Default","open-hover":"Logo Hover"},display:{type:"palette-color-picker"}},menuBackgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},overlayColor:{type:"string",scope:"common",title:"Overlay Default",display:{type:"palette-color-picker"}},closeButtonColor:{type:"string",scope:"common",title:"Close Default",titleByState:{open:"Close Default","open-hover":"Close Hover"},display:{type:"palette-color-picker"}},effect:{type:"string",scope:"layout",title:"Effect",display:{type:"toggle-cycle",enum:["fade","left","top","right","bottom"]}},openPanelSize:{type:"number",scope:"layout",title:"Height",display:{type:"percentage-input"},min:0,max:100},textWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},navTextWidth:{type:"number",scope:"layout",title:"Text width",display:{type:"numeric-input"},min:0,max:9999},navTextPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},navTextOffset:{type:"number",scope:"layout",title:"Offset",display:{type:"numeric-input"},min:-9999,max:9999},position:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:[...D$]}},stateOverrides:{type:"object",scope:"common"},gap:tr("Gap"),navGap:{type:"number",scope:"layout",title:"Nav gap",min:0,max:100,display:{type:"range-control",visible:!1}},navPaddingLeft:{type:"number",scope:"layout",title:"Nav padding left",min:0,max:100,display:{type:"range-control",visible:!1}},navPaddingRight:{type:"number",scope:"layout",title:"Nav padding right",min:0,max:100,display:{type:"range-control",visible:!1}},textPaddingLeft:tr("Text padding left"),textPaddingRight:tr("Text padding right"),textPaddingTop:tr("Text padding top"),textPaddingBottom:tr("Text padding bottom"),compactLogoMaxHeight:{type:"number",scope:"layout",title:"Max Height",display:{type:"numeric-input"},min:0,max:9999},compactPanelHeight:{type:"number",scope:"layout",title:"Menu Height",display:{type:"numeric-input"},min:0,max:9999},compactIconSize:{type:"number",scope:"layout",title:"Size",display:{type:"numeric-input"},min:0,max:9999},compactNavTextWidth:{type:"number",scope:"layout",title:"Text width",display:{type:"numeric-input"},min:0,max:9999},compactNavTextPosition:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right"]}},compactNavTextOffset:{type:"number",scope:"layout",title:"Offset",display:{type:"numeric-input"},min:-9999,max:9999},compactNavGap:{type:"number",scope:"layout",title:"Nav gap",min:0,max:100,display:{type:"range-control",visible:!1}},compactNavPaddingLeft:{type:"number",scope:"layout",title:"Nav padding left",min:0,max:100,display:{type:"range-control",visible:!1}},compactNavPaddingRight:{type:"number",scope:"layout",title:"Nav padding right",min:0,max:100,display:{type:"range-control",visible:!1}},...F$,...N$,..._$},defaults:{link:[{link:{type:"page",value:"",target:"self"},label:"Home",showIn:Yr},{link:{type:"page",value:"",target:"self"},label:"Works",showIn:Yr},{link:{type:"page",value:"",target:"self"},label:"About",showIn:Yr},{link:{type:"page",value:"",target:"self"},label:"Contact",showIn:Yr}],logo:{mode:"On",icon:"https://cdn.cntrl.site/component-assets/hamburger-logo.svg"},backgroundColor:"#ffffff",logoColor:"#000000",iconColor:"#000000",linkColor:"#000000",openLinkColor:"#000000",compactIconColor:"#000000",compactLinkColor:"#000000",compactLogoColor:"#000000",compactBackgroundColor:"#ffffff",openLogoColor:"#000000",menuBackgroundColor:"#ffffff",overlayColor:"rgba(0, 0, 0, 0.45)",closeButtonColor:"#000000",effect:"fade",showIcon:"on",compactShowIcon:"on",logoPosition:"left",compactLogoPosition:"left",navTextPosition:"center",compactNavTextPosition:"center",navTextOffset:0,compactNavTextOffset:0,position:"left-top",fontFamily:"Goudy Bookletter 1911",fontSettings:Cs,textAlign:"left",openFontFamily:"Goudy Bookletter 1911",openFontSettings:Cs,openTextAlign:"left",compactFontFamily:"Goudy Bookletter 1911",compactFontSettings:Cs,compactTextAlign:"left",stateOverrides:{hover:{linkColor:"#666666",iconColor:"#666666",logoColor:"#666666"},"open-hover":{closeButtonColor:"#666666"}}},displayRules:[{if:{name:"logo.mode",value:"Off"},then:{name:"properties.logoMaxHeight.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.logoPosition.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.compactLogoMaxHeight.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.compactLogoPosition.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.logoColor.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.compactLogoColor.display.visible",value:!1}},{if:{name:"logo.mode",value:"Off"},then:{name:"properties.openLogoColor.display.visible",value:!1}},{if:{name:"effect",value:"left"},then:{name:"properties.openPanelSize.title",value:"Width"}},{if:{name:"effect",value:"right"},then:{name:"properties.openPanelSize.title",value:"Width"}},{if:{name:"showIcon",value:"off"},then:{name:"properties.iconSize.display.visible",value:!1}},{if:{name:"showIcon",value:"off"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"compactShowIcon",value:"off"},then:{name:"properties.compactIconSize.display.visible",value:!1}},{if:{name:"compactShowIcon",value:"off"},then:{name:"properties.compactIconColor.display.visible",value:!1}}],layoutDefaults:{m:{position:"center",panelHeight:50/375,logoMaxHeight:30/375,logoPosition:"center",compactLogoPosition:"left",navTextPosition:"center",navTextOffset:0,compactNavTextPosition:"center",compactNavTextOffset:0,showIcon:"on",iconSize:30/375,textWidth:240/375,openPanelSize:100,navTextWidth:120/375,gap:24/375,navGap:24/375,navPaddingLeft:20/375,navPaddingRight:20/375,textPaddingLeft:10/375,textPaddingRight:10/375,textPaddingTop:10/375,textPaddingBottom:10/375,fontSize:16/375,lineHeight:20/375,letterSpacing:0,wordSpacing:0,textAppearance:Zn,openFontSize:34/375,openLineHeight:20/375,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Zn,openTextAlign:"center",compactPanelHeight:40/375,compactLogoMaxHeight:20/375,compactShowIcon:"on",compactIconSize:16/375,compactNavTextWidth:80/375,compactNavGap:24/375,compactNavPaddingLeft:20/375,compactNavPaddingRight:20/375,compactFontSize:16/375,compactLineHeight:20/375,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:Zn},t:{textAlign:"center",position:"center",panelHeight:60/768,logoMaxHeight:30/768,logoPosition:"left",compactLogoPosition:"left",navTextPosition:"center",navTextOffset:0,compactNavTextPosition:"center",compactNavTextOffset:0,showIcon:"on",iconSize:16/768,textWidth:300/768,openPanelSize:100,navTextWidth:90/768,gap:32/768,navGap:32/768,navPaddingLeft:20/768,navPaddingRight:20/768,textPaddingLeft:10/768,textPaddingRight:10/768,textPaddingTop:10/768,textPaddingBottom:10/768,fontSize:18/768,lineHeight:20/768,letterSpacing:0,wordSpacing:0,textAppearance:Zn,openFontSize:75/768,openLineHeight:20/768,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Zn,openTextAlign:"center",compactTextAlign:"center",compactPanelHeight:40/768,compactLogoMaxHeight:20/768,compactShowIcon:"on",compactIconSize:16/768,compactNavTextWidth:80/768,compactNavGap:32/768,compactNavPaddingLeft:20/768,compactNavPaddingRight:20/768,compactFontSize:16/768,compactLineHeight:20/768,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:Zn},d:{position:"center",panelHeight:50/1440,logoMaxHeight:30/1440,logoPosition:"left",compactLogoPosition:"left",navTextPosition:"center",navTextOffset:0,compactNavTextPosition:"center",compactNavTextOffset:0,showIcon:"on",iconSize:20/1440,textWidth:300/1440,openPanelSize:100,navTextWidth:60/1440,gap:12/1440,navGap:64/1440,navPaddingLeft:10/1440,navPaddingRight:10/1440,textPaddingLeft:10/1440,textPaddingRight:10/1440,textPaddingTop:10/1440,textPaddingBottom:10/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:Zn,textAlign:"center",openFontSize:90/1440,openLineHeight:16/1440,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Zn,openTextAlign:"center",compactPanelHeight:30/1440,compactLogoMaxHeight:20/1440,compactShowIcon:"on",compactIconSize:20/1440,compactNavTextWidth:60/1440,compactNavGap:20/1440,compactNavPaddingLeft:10/1440,compactNavPaddingRight:10/1440,compactFontSize:16/1440,compactLineHeight:16/1440,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:Zn,compactTextAlign:"center"}},layout:["__componentName__","link","logo","logoMaxHeight","logoPosition","panelHeight","backgroundColor","logoColor","iconColor","showIcon","iconSize","linkColor","openLinkColor","compactShowIcon","compactIconColor","compactLinkColor","compactLogoColor","compactBackgroundColor","compactLogoMaxHeight","compactLogoPosition","compactPanelHeight","compactIconSize","compactNavTextWidth","compactNavTextPosition","compactNavTextOffset","compactNavGap","compactNavPaddingLeft","compactNavPaddingRight","compactFontFamily","compactFontSettings","compactFontSize","compactLineHeight","compactLetterSpacing","compactWordSpacing","compactTextAlign","compactTextAppearance","openLogoColor","menuBackgroundColor","overlayColor","closeButtonColor","effect","textWidth","navTextWidth","navTextPosition","navTextOffset","position","gap","navGap","navPaddingLeft","navPaddingRight","textPaddingLeft","textPaddingRight","textPaddingTop","textPaddingBottom","fontFamily","fontSettings","fontSize","lineHeight","letterSpacing","wordSpacing","textAlign","textAppearance","openFontFamily","openFontSettings","openFontSize","openLineHeight","openLetterSpacing","openWordSpacing","openTextAlign","openTextAppearance"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","logo"]},{id:"default",icon:"default",title:"Default",tooltip:"Default State",layout:H$},{id:"compact",icon:"compact",title:"Compact",tooltip:"Compact State",layout:W$,availableWhen:{navigationPosition:["switch"]}},{id:"open",icon:"open",title:"Open",tooltip:"Open State",layout:O$},{id:"links",icon:"content",title:"Links",tooltip:"Link Settings",layout:["__componentName__","link"]}],paletteBookmark:{items:[...z$],panelIds:["default","compact","open"],stateItems:{default:["iconColor","logoColor","linkColor","backgroundColor"],hover:["iconColor","logoColor","linkColor"],compact:["compactIconColor","compactLogoColor","compactLinkColor","compactBackgroundColor"],"compact-hover":["compactIconColor","compactLogoColor","compactLinkColor"],open:["closeButtonColor","openLogoColor","openLinkColor","menuBackgroundColor","overlayColor"],"open-hover":["closeButtonColor","openLogoColor","openLinkColor"]}},states:["default","hover"],statePanels:["default","compact","open"]},j$={element:M$,id:"basic-burger",name:"Basic Burger",category:"navigation",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple Burger.png"},layoutMode:"navigation",defaultSize:{d:{width:"100%",height:60/1440},t:{width:"100%",height:60/768},m:{width:"100%",height:56/375}},defaultNavigationPosition:{d:"switch",t:"switch",m:"stickyTop"},schema:B$,sourceCode:A$,assetsPaths:{content:[],parameters:[{path:"logo.icon",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"},{path:"openFontFamily"},{path:"compactFontFamily"}]},fontRelations:{fontSettings:"fontFamily",openFontSettings:"openFontFamily",compactFontSettings:"compactFontFamily"}},kd=120,Ed=3,V$=.12,jl={x:0,y:0,width:100,height:100};function wo(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}function wa(e){return e<0?0:e>1?1:e}function Md(e,t){return e.filter(n=>n.length>0).map(n=>`M ${n.map(i=>`${i.x*t.width} ${i.y*t.height}`).join(" L ")} Z`).join(" ")}function G$(e,t){let n=1/0,i=1/0,o=-1/0,r=-1/0;for(const d of e)for(const u of d){const p=u.x*t.width,y=u.y*t.height;p<n&&(n=p),p>o&&(o=p),y<i&&(i=y),y>r&&(r=y)}const l=o-n,c=r-i;return!isFinite(l)||!isFinite(c)||l<=0||c<=0?null:{x:n,y:i,width:l,height:c}}function X$(e){return e.map(([t,n])=>({x:t,y:n}))}function Ts(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const c of e)for(const d of c)d.x<t&&(t=d.x),d.x>i&&(i=d.x),d.y<n&&(n=d.y),d.y>o&&(o=d.y);const r=i-t,l=o-n;return!isFinite(r)||!isFinite(l)||r<=0||l<=0?e:e.map(c=>c.map(d=>({x:(d.x-t)/r,y:(d.y-n)/l})))}function q$(e,t){const n=[];for(const o of e)for(let r=0;r<o.length;r+=1){const l=o[r],c=o[(r+1)%o.length];(l.y<=t&&c.y>t||c.y<=t&&l.y>t)&&n.push(l.x+(t-l.y)/(c.y-l.y)*(c.x-l.x))}n.sort((o,r)=>o-r);const i=[];for(let o=0;o+1<n.length;o+=2){const r=wa(n[o]),l=wa(n[o+1]);l>r&&i.push({x0:r,x1:l})}return U$(i)}function U$(e){if(e.length<2)return e;const t=[...e].sort((i,o)=>i.x0-o.x0),n=[t[0]];for(let i=1;i<t.length;i+=1){const o=n[n.length-1],r=t[i];r.x0<=o.x1?o.x1=Math.max(o.x1,r.x1):n.push({...r})}return n}function K$(e,t){const n=[];let i=0,o=0;for(;i<e.length&&o<t.length;){const r=Math.max(e[i].x0,t[o].x0),l=Math.min(e[i].x1,t[o].x1);l>r&&n.push({x0:r,x1:l}),e[i].x1<t[o].x1?i+=1:o+=1}return n}function Y$(e){const t=[];let n=0;for(const i of e)i.x0>n&&t.push({x0:n,x1:i.x0}),n=Math.max(n,i.x1);return n<1&&t.push({x0:n,x1:1}),t}function Z$(e,t){const n=[];for(const i of e){if(t.x1<=i.x0||t.x0>=i.x1){n.push(i);continue}t.x0>i.x0&&n.push({x0:i.x0,x1:t.x0}),t.x1<i.x1&&n.push({x0:t.x1,x1:i.x1})}return n}function J$(e,t,n,i){let o=null;for(let r=0;r<Ed;r+=1){const l=wa(t+(n-t)*r/Math.max(1,Ed-1)),c=q$(e,l),d=i==="avoid"?Y$(c):c;if(o=o===null?d:K$(o,d),o.length===0)return[]}return o??[]}function Ad(e,t="stretch",n=jl){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=Ii(i),c=wr(l);if(c.length)return t==="viewbox"?wo(c,n):Ts(c);if(typeof document>"u")return null;const d=i.split(/(?=[Mm])/).map(y=>y.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const y of d){const v=document.createElementNS("http://www.w3.org/2000/svg","path");v.setAttribute("d",y),u.appendChild(v);let m=0;try{m=v.getTotalLength()}catch{m=0}if(!m)continue;const g=[];for(let x=0;x<kd;x+=1){const b=v.getPointAtLength(x/kd*m);g.push({x:b.x,y:b.y})}p.push(g)}return p.length?t==="viewbox"?wo(p,n):Ts(p):null}const o=i.split(/[\s,]+/).map(Number).filter(l=>!Number.isNaN(l));if(o.length<6)return null;const r=[];for(let l=0;l+1<o.length;l+=2)r.push({x:o[l],y:o[l+1]});return t==="viewbox"?wo([r],n):Ts([r])}const Vl={bobbin:"M57.63,0 L57.63,37.24 L74.66,37.24 L74.66,56.07 L57.63,100 L33.84,100 L16.81,56.07 L16.81,37.24 L33.84,37.24 L33.84,0 Z",circle:"M50,0 C77.61,0 100,22.39 100,50 C100,77.61 77.61,100 50,100 C22.39,100 0,77.61 0,50 C0,22.39 22.39,0 50,0 Z",shield:"M0,0 L100,0 L100,50 L50,100 L0,50 Z",vase:"M25.37,0 L91.55,0 C91.55,0 74.8,25.14 83.07,50.03 C91.34,74.92 74.61,100 74.61,100 L8.43,100 C8.43,100 32.3,75.08 23.9,50 C15.5,24.92 25.37,0 25.37,0 Z",parallelogram:"M25.37,0 L91.55,0 L74.61,100 L8.43,100 Z",diamond:"M50,0 L80,50 L50,100 L20,50 Z"},Us="0 0 100 100",$a=100,Ks=16,Q$=12,eC=16,Ls=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,tC=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g,Fd=Math.PI/4,nC=8,iC=Math.PI/18,oC=8,ho=24,fo=[];function rC(){return[{closed:!0,nodes:[{p:{x:0,y:0},in:null,out:null},{p:{x:1,y:0},in:null,out:null},{p:{x:1,y:1},in:null,out:null},{p:{x:0,y:1},in:null,out:null}]}]}function Ps(e,t){return cn(e,n=>({x:(n.x-t.x)/t.width,y:(n.y-t.y)/t.height}))}function aC(e){const t=$i(e),n=t.maxX-t.minX,i=t.maxY-t.minY;return!isFinite(n)||!isFinite(i)||n<=0||i<=0?e:cn(e,o=>({x:(o.x-t.minX)/n,y:(o.y-t.minY)/i}))}function sC(e,t){if(!(t.width>0)||!(t.height>0))return e;const n=Math.min(t.width,t.height),i=(t.width-n)/2,o=(t.height-n)/2;return cn(e,r=>({x:(i+r.x*n)/t.width,y:(o+r.y*n)/t.height}))}function Nd(e,t,n,i,o,r){let l=[];if(t&&t.length)l=Ps(t,i);else{const c=e.trim();if(c&&/^[Mm]/.test(c)){const d=Ii(c);d.length&&(l=n==="viewbox"?Ps(d,i):aC(d))}if(!l.length){const d=o!=="custom"?Vl[o]:void 0;d?l=Ps(Ii(d),jl):l=rC()}}return o==="circle"?sC(l,r):l}function _d(e,t){return!(t.width>0)||!(t.height>0)||!e.length?"":_o(cn(e,n=>({x:n.x*t.width,y:n.y*t.height})))}function Ys(e){const t=e==="rectangle"||e==="custom"?void 0:Vl[e];return t?wo(wr(Ii(t)),jl):[X$([[0,0],[1,0],[1,1],[0,1]])]}function lC(e){const t=e.match(tC);return t?t.map(Number).filter(n=>!Number.isNaN(n)):[]}function Cn(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function Zs(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function pn(e){return{x:e.x,y:e.y}}function cC(e){return{p:pn(e.p),in:e.in?pn(e.in):null,out:e.out?pn(e.out):null}}function zn(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(cC)}))}function cn(e,t){return e.map(n=>({closed:n.closed,nodes:n.nodes.map(i=>({p:t(i.p),in:i.in?t(i.in):null,out:i.out?t(i.out):null}))}))}function Hd(e,t,n,i=n){return cn(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function dC(e,t,n,i,o,r,l){let c=Math.abs(t),d=Math.abs(n);if(!c||!d||e.x===l.x&&e.y===l.y)return[{c1:pn(e),c2:pn(l),p:pn(l)}];const u=i*Math.PI/180,p=Math.cos(u),y=Math.sin(u),v=(e.x-l.x)/2,m=(e.y-l.y)/2,g=p*v+y*m,x=-y*v+p*m,b=g*g/(c*c)+x*x/(d*d);if(b>1){const q=Math.sqrt(b);c*=q,d*=q}const k=o===r?-1:1,f=c*c*x*x+d*d*g*g,S=Math.max(0,c*c*d*d-f),W=f===0?0:k*Math.sqrt(S/f),U=W*c*x/d,B=-W*d*g/c,P=p*U-y*B+(e.x+l.x)/2,_=y*U+p*B+(e.y+l.y)/2,G=Math.atan2((x-B)/d,(g-U)/c);let L=Math.atan2((-x-B)/d,(-g-U)/c)-G;!r&&L>0&&(L-=Math.PI*2),r&&L<0&&(L+=Math.PI*2);const D=Math.max(1,Math.ceil(Math.abs(L)/(Math.PI/2))),E=L/D,T=4/3*Math.tan(E/4),C=(q,I)=>({x:P+p*c*q-y*d*I,y:_+y*c*q+p*d*I}),V=[];let w=G;for(let q=0;q<D;q+=1){const I=w+E,A=Math.cos(w),j=Math.sin(w),ie=Math.cos(I),ae=Math.sin(I);V.push({c1:C(A-T*j,j+T*A),c2:C(ie+T*ae,ae-T*ie),p:q===D-1?pn(l):C(ie,ae)}),w=I}return V}function Ii(e){const t=(e??"").trim();if(!t)return[];const n=[];let i=[],o=!1,r={x:0,y:0},l={x:0,y:0},c=null,d=null;const u=()=>{if(o&&i.length>2){const m=i[0],g=i[i.length-1];Math.abs(m.p.x-g.p.x)<1e-6&&Math.abs(m.p.y-g.p.y)<1e-6&&(m.in=g.in??m.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(m,g)=>{i.push({p:m,in:Vn(g??null,m),out:null}),r=m},y=m=>{if(!i.length)return;const g=i[i.length-1];g.out=Vn(m,g.p)};Ls.lastIndex=0;let v=Ls.exec(t);for(;v!==null;){const m=v[1],g=m.toUpperCase(),x=m!==g,b=lC(v[2]),k=f=>x?{x:r.x+b[f],y:r.y+b[f+1]}:{x:b[f],y:b[f+1]};if(g==="Z")o=!0,u(),r=pn(l),c=null,d=null;else if(g==="M"){for(let f=0;f+1<b.length;f+=2){const S=k(f);f===0&&(u(),l=pn(S)),p(S)}c=null,d=null}else if(g==="L"){for(let f=0;f+1<b.length;f+=2)p(k(f));c=null,d=null}else if(g==="H"){for(const f of b)p({x:x?r.x+f:f,y:r.y});c=null,d=null}else if(g==="V"){for(const f of b)p({x:r.x,y:x?r.y+f:f});c=null,d=null}else if(g==="C"){for(let f=0;f+5<b.length;f+=6){const S=k(f),W=k(f+2),U=k(f+4);y(S),p(U,W),c=W}d=null}else if(g==="S"){for(let f=0;f+3<b.length;f+=4){const S=c?Zs(c,r):pn(r),W=k(f),U=k(f+2);y(S),p(U,W),c=W}d=null}else if(g==="Q")for(let f=0;f+3<b.length;f+=4){const S=k(f),W=k(f+2);y(Cn(r,S,2/3)),p(W,Cn(W,S,2/3)),d=S,c=null}else if(g==="T")for(let f=0;f+1<b.length;f+=2){const S=d?Zs(d,r):pn(r),W=k(f);y(Cn(r,S,2/3)),p(W,Cn(W,S,2/3)),d=S,c=null}else if(g==="A")for(let f=0;f+6<b.length;f+=7){const S=x?{x:r.x+b[f+5],y:r.y+b[f+6]}:{x:b[f+5],y:b[f+6]};for(const W of dC(r,b[f],b[f+1],b[f+2],b[f+3]!==0,b[f+4]!==0,S))y(W.c1),p(W.p,W.c2);c=null,d=null}v=Ls.exec(t)}return u(),n}function On(e){return`${Number(e.toFixed(2))}`}function Vn(e,t){return!e||Math.abs(e.x-t.x)<1e-6&&Math.abs(e.y-t.y)<1e-6?null:e}function Pp(e){return!!(Vn(e.in,e.p)||Vn(e.out,e.p))}function jo(e,t){return!Vn(e.out,e.p)&&!Vn(t.in,t.p)}function Wd(e,t){if(jo(e,t))return`L${On(t.p.x)},${On(t.p.y)}`;const n=Vn(e.out,e.p)??e.p,i=Vn(t.in,t.p)??t.p;return`C${On(n.x)},${On(n.y)} ${On(i.x)},${On(i.y)} ${On(t.p.x)},${On(t.p.y)}`}function _o(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const[i,...o]=n.nodes;t.push(`M${On(i.p.x)},${On(i.p.y)}`);let r=i;for(const l of o)t.push(Wd(r,l)),r=l;if(n.closed){const l=Wd(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function Ip(e){const t=[];for(let n=0;n+1<e.nodes.length;n+=1)t.push({from:e.nodes[n],to:e.nodes[n+1],index:n});if(e.closed&&e.nodes.length>2){const n=e.nodes.length-1;t.push({from:e.nodes[n],to:e.nodes[0],index:n})}return t}function Js(e,t,n){if(jo(e,t))return Cn(e.p,t.p,n);const i=e.out??e.p,o=t.in??t.p,r=1-n,l=r*r*r,c=3*r*r*n,d=3*r*n*n,u=n*n*n;return{x:l*e.p.x+c*i.x+d*o.x+u*t.p.x,y:l*e.p.y+c*i.y+d*o.y+u*t.p.y}}function wr(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of Ip(n)){if(jo(o.from,o.to)){i.push(pn(o.from.p));continue}for(let r=0;r<Ks;r+=1)i.push(Js(o.from,o.to,r/Ks))}n.closed||i.push(pn(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function $i(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of wr(e))for(const l of r)l.x<t&&(t=l.x),l.x>i&&(i=l.x),l.y<n&&(n=l.y),l.y>o&&(o=l.y);return{minX:t,minY:n,maxX:i,maxY:o}}function uC(e){const t=$i(e);return!isFinite(t.minX)||!isFinite(t.maxX)||!isFinite(t.minY)||!isFinite(t.maxY)?null:{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}}function Rp(e,t,n){const i={x:(n.x-e.x)/6,y:(n.y-e.y)/6};return{in:{x:t.x-i.x,y:t.y-i.y},out:{x:t.x+i.x,y:t.y+i.y}}}function kp(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=Q$)return{closed:!0,nodes:t.map(r=>({p:pn(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/eC)),i=[];for(let r=0;r<t.length;r+=n)i.push(t[r]);const o=i.length;return{closed:!0,nodes:i.map((r,l)=>({p:pn(r),...Rp(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function Ep(e,t,n=1){if(!e.length)return!1;const i=$i(e);if(!isFinite(i.minX)||!isFinite(i.maxX))return!1;const o=i.maxX-i.minX,r=i.maxY-i.minY;if(o<=t.width*2.5&&r<=t.height*2.5)return!1;const l=Math.max(n,t.width*.5),c=Math.max(n,t.height*.5);return i.minX<t.x-l||i.minY<t.y-c||i.maxX>t.x+t.width+l||i.maxY>t.y+t.height+c}function pC(e,t,n,i,o,r,l){const c=t.width>0?n.width/t.width:1,d=t.height>0?n.height/t.height:1;return!(r>0)||!(l>0)||!(c>0)||!(d>0)?e:cn(e,u=>{const p=i+(u.x-t.x)*r,y=o+(u.y-t.y)*l;return{x:t.x+p/c,y:t.y+y/d}})}function mC(e,t){if(!e.length)return e;const n=$i(e),i=n.maxX-n.minX,o=n.maxY-n.minY;if(!(i>0)||!(o>0)||n.minX>=t.x-1e-6&&n.minY>=t.y-1e-6&&n.maxX<=t.x+t.width+1e-6&&n.maxY<=t.y+t.height+1e-6)return e;const l=Math.min(t.width/i,t.height/o),c=t.x+(t.width-i*l)/2,d=t.y+(t.height-o*l)/2;return cn(e,u=>({x:c+(u.x-n.minX)*l,y:d+(u.y-n.minY)*l}))}function Mp(e){const t={x:0,y:0,width:$a,height:$a},n=e!=="custom"?Vl[e]:void 0,i=n?cn(Ii(n),r=>({x:r.x/100*t.width+t.x,y:r.y/100*t.height+t.y})):cn(kp(Ys("rectangle")),r=>({x:r.x*t.width+t.x,y:r.y*t.height+t.y})),o=mC(i,t);return{shape:e,customPath:_o(o),pathFit:"viewbox",pathViewBox:Us}}function Zr(e,t){return t>0?Math.round(e/t)*t:e}function gC(e,t,n,i){var u;const o=(u=e[t])==null?void 0:u.nodes[n];if(!o)return e;const r=i.x-o.p.x,l=i.y-o.p.y,c=zn(e),d=c[t].nodes[n];return d.p={x:o.p.x+r,y:o.p.y+l},d.in&&(d.in={x:d.in.x+r,y:d.in.y+l}),d.out&&(d.out={x:d.out.x+r,y:d.out.y+l}),c}function Od(e,t,n,i){var r;if(!t.length)return e;const o=zn(e);for(const{contour:l,node:c}of t){const d=(r=o[l])==null?void 0:r.nodes[c];d&&(d.p={x:d.p.x+n,y:d.p.y+i},d.in&&(d.in={x:d.in.x+n,y:d.in.y+i}),d.out&&(d.out={x:d.out.x+n,y:d.out.y+i}))}return o}function hC(e,t){const n=new Map;for(const{contour:o,node:r}of t){const l=n.get(o)??[];l.push(r),n.set(o,l)}let i=e;return n.forEach((o,r)=>{const l=[...o].sort((c,d)=>d-c);for(const c of l)i=Ap(i,r,c)}),i}function fC(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const c=zn(e),d=c[t].nodes[n];if(d[i]=pn(o),r){const p=i==="in"?"out":"in";d[p]=Zs(o,d.p)}return c}function yC(e,t,n,i){var l;const o=(l=e[t])==null?void 0:l.nodes[n];if(!o||!o[i])return e;const r=zn(e);return r[t].nodes[n][i]=null,r}function vC(e,t,n,i){const o=e[t];if(!o)return{contours:e,nodeIndex:-1};const r=o.nodes[n],l=o.nodes[(n+1)%o.nodes.length];if(!r||!l)return{contours:e,nodeIndex:-1};const c=zn(e),d=c[t].nodes,u=n+1;if(jo(r,l))return d.splice(u,0,{p:Cn(r.p,l.p,i),in:null,out:null}),{contours:c,nodeIndex:u};const p=r.out??r.p,y=l.in??l.p,v=Cn(r.p,p,i),m=Cn(p,y,i),g=Cn(y,l.p,i),x=Cn(v,m,i),b=Cn(m,g,i),k=Cn(x,b,i),f=(n+1)%o.nodes.length;return d[n].out=v,d[f].in=g,d.splice(u,0,{p:k,in:x,out:b}),{contours:c,nodeIndex:u}}function Ap(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=zn(e);return o[t].nodes.splice(n,1),o}function Dd(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=zn(e),l=r[t].nodes,c=l[n],d=l.length,u=(n-1+d)%d,p=(n+1)%d,y=!!Vn(l[u].out,l[u].p),v=!!Vn(l[p].in,l[p].p);if(Pp(c)||y||v)return c.in=null,c.out=null,l[u].out=null,l[p].in=null,r;const m=Rp(l[u].p,c.p,l[p].p);return c.in=m.in,c.out=m.out,r}function xC(e,t,n){const i=n.x-t.x,o=n.y-t.y,r=i*i+o*o,l=r===0?0:Math.max(0,Math.min(1,((e.x-t.x)*i+(e.y-t.y)*o)/r)),c={x:t.x+i*l,y:t.y+o*l};return{t:l,distance:Math.hypot(e.x-c.x,e.y-c.y),point:c}}function zd(e,t){let n=null;return e.forEach((i,o)=>{for(const r of Ip(i)){const l=jo(r.from,r.to)?1:Ks;for(let c=0;c<l;c+=1){const d=c/l,u=(c+1)/l,p=xC(t,Js(r.from,r.to,d),Js(r.from,r.to,u));(!n||p.distance<n.distance)&&(n={contour:o,segment:r.index,t:d+(u-d)*p.t,distance:p.distance,point:p.point})}}}),n}function bC(e,t){const n=[];return e.forEach((i,o)=>{i.nodes.forEach((r,l)=>{o===t.contour&&l===t.node||n.push(r.p)})}),n}function Bd(e,t,n){const i=t.filter((r,l)=>isFinite(r)&&t.findIndex(c=>Math.abs(c-r)<1e-6)===l),o=i.map(r=>({value:r,axis:r,from:null}));for(const r of e)o.push({value:r[n],axis:null,from:r});for(const r of i)for(const l of e)o.push({value:r*2-l[n],axis:r,from:l});return o}function jd(e,t,n,i,o){const r=i(t)[n];let l=null,c=1/0;for(const d of e){const u=n==="x"?{x:d.value,y:t.y}:{x:t.x,y:d.value},p=Math.abs(i(u)[n]-r);p>o||l&&p>=c||(l=d,c=p)}return l}function SC(e,t){return e.length===t.length&&e.every((n,i)=>n.kind===t[i].kind&&n.a.x===t[i].a.x&&n.a.y===t[i].a.y&&n.b.x===t[i].b.x&&n.b.y===t[i].b.y)}function wC(e){const t=Math.PI*2;return((e+Math.PI)%t+t)%t-Math.PI}function Qs(e,t){const n=t.x-e.x,i=t.y-e.y,o=Math.hypot(n,i);return o<1e-6?null:{x:n/o,y:i/o}}function $C(e,t){const n=Qs(e,t);return n?{kind:"align",a:{x:e.x-n.x*ho,y:e.y-n.y*ho},b:{x:t.x+n.x*ho,y:t.y+n.y*ho}}:{kind:"align",a:e,b:t}}function el(e,t,n){return t==="x"?{kind:"center",a:{x:e,y:0},b:{x:e,y:n.height}}:{kind:"center",a:{x:0,y:e},b:{x:n.width,y:e}}}function Vd(e,t,n,i,o){if(e.axis===null)return $C(n,o(e.from??n));const r=t==="x"?{x:e.axis,y:0}:{x:0,y:e.axis};return el(o(r)[t],t,i)}function CC(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(Vd(t,"x",l,i,o)),n&&e.y===n.value&&r.push(Vd(n,"y",l,i,o)),r}function TC(e,t,n,i){const o=e==null?void 0:e.nodes[t];if(!e||!o)return null;const r=i(o.p),l=n==="in"?o.out:o.in;if(l)return Qs(i(l),r);const c=e.nodes.length,d=t+(n==="in"?1:-1);if(!e.closed&&(d<0||d>=c))return null;const u=e.nodes[(d+c)%c];if(!u)return null;const p=(n==="in"?u.in:u.out)??u.p;return Qs(i(p),r)}function LC(e,t,n,i,o,r,l){const c=r(t),d=r(e),u=d.x-c.x,p=d.y-c.y,y=Math.hypot(u,p);if(y<1e-6)return{point:e,guides:fo};const v=Math.atan2(p,u),m=Math.round(v/Fd)*Fd;let g=o?m:null,x=!1;if(!o){const B=[];n&&B.push({angle:Math.atan2(n.y,n.x),smooth:!0}),B.push({angle:m,smooth:!1});for(const P of B){const _=wC(P.angle-v);if(!(Math.abs(_)>iC)&&!(Math.abs(Math.sin(_))*y>nC)){g=P.angle,x=P.smooth;break}}}const b=i!==null&&i>0&&Math.abs(y-i)<=oC;if(g===null&&!b)return{point:e,guides:fo};const k=g??v,f=b?i:y,S={x:Math.cos(k),y:Math.sin(k)},W=f+(g===null?0:ho),U=b?f:x?ho:0;return{point:l({x:c.x+S.x*f,y:c.y+S.y*f}),guides:[{kind:"angle",a:{x:c.x-S.x*U,y:c.y-S.y*U},b:{x:c.x+S.x*W,y:c.y+S.y*W}}]}}const tl=.1,nl=8,PC=4,Gd=10,Ca=(e,t)=>{switch(t){case"nw":return{x:e.minX,y:e.minY};case"ne":return{x:e.maxX,y:e.minY};case"se":return{x:e.maxX,y:e.maxY};case"sw":return{x:e.minX,y:e.maxY}}},Fp=e=>{switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}},il=(e,t)=>{const n=Ca(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*Gd,y:n.y+o*Gd}},ol=(e,t)=>!(t.width>0)||!(t.height>0)||!(e.width>0)||!(e.height>0)?1:Math.max(e.width/t.width,e.height/t.height),Vi=(e,t,n)=>{const i=ol(e,t)*n;return{width:t.width*i,height:t.height*i}},Dn=(e,t,n)=>(e-t)*n,yo=(e,t,n,i)=>{const o=e-t;if(Math.abs(o)<1e-6)return .5;const r=n/o;return(i==null?void 0:i.clamp)===!1?r:Math.abs(o)<PC?.5:wa(r)},IC=(e,t,n,i,o,r)=>{const l=Vi(e,n,r),c=e.x+Dn(e.width,l.width,i),d=e.y+Dn(e.height,l.height,o),u=ol(e,n),p=ol(t,n),y=Math.min(nl,Math.max(tl,p>0?r*(u/p):r)),v=Vi(t,n,y);return{focalX:yo(t.width,v.width,c-t.x,{clamp:!1}),focalY:yo(t.height,v.height,d-t.y,{clamp:!1}),scale:y}},Xd=1.08,Jr=14,Qr=8;function RC({P:e,box:t,bounds:n,natural:i,imageUrl:o,maskPath:r,stage:l,onStageChange:c,focalX:d,focalY:u,scale:p,onChange:y,onCommit:v}){const m=s.useRef(null),g=`pretext-image-ghost-${s.useId().replace(/:/g,"")}`,x=s.useRef(null),b=s.useRef(null),k=s.useRef({focalX:d,focalY:u,scale:p});k.current={focalX:d,focalY:u,scale:p};const f=l==="image";s.useEffect(()=>{var E;f&&((E=m.current)==null||E.focus({preventScroll:!0}))},[f]);const S=s.useCallback((E,T)=>{var V;const C=(V=m.current)==null?void 0:V.getBoundingClientRect();return!C||C.width<=0||C.height<=0?{x:0,y:0}:{x:(E-C.left)/C.width*t.width,y:(T-C.top)/C.height*t.height}},[t.width,t.height]),W=E=>{var C,V;if(!i)return;E.stopPropagation(),E.preventDefault(),(C=m.current)==null||C.focus({preventScroll:!0});const T=Vi(n,i,p);x.current={pointerId:E.pointerId,origin:S(E.clientX,E.clientY),startX:Dn(n.width,T.width,d),startY:Dn(n.height,T.height,u),width:T.width,height:T.height,moved:!1},(V=m.current)==null||V.setPointerCapture(E.pointerId)},U=(E,T)=>{var ie,ae;if(!i)return;E.stopPropagation(),E.preventDefault(),(ie=m.current)==null||ie.focus({preventScroll:!0});const C=Vi(n,i,p),V=Dn(n.width,C.width,d),w=Dn(n.height,C.height,u),q={minX:V,minY:w,maxX:V+C.width,maxY:w+C.height},I=Ca(q,Fp(T)),A=Ca(q,T),j=Math.hypot(A.x-I.x,A.y-I.y);!isFinite(j)||j<=0||(b.current={pointerId:E.pointerId,anchor:I,startDistance:j,startScale:p,startX:V,startY:w,moved:!1},(ae=m.current)==null||ae.setPointerCapture(E.pointerId))},B=E=>{if(!i)return;const T=b.current;if(T&&E.pointerId===T.pointerId){E.stopPropagation(),E.preventDefault();const V=S(E.clientX,E.clientY),w={x:V.x-n.x,y:V.y-n.y},q=Math.hypot(w.x-T.anchor.x,w.y-T.anchor.y),I=Math.min(nl,Math.max(tl,T.startScale*(q/T.startDistance)));if(!T.moved&&Math.abs(I-T.startScale)<1e-4)return;T.moved=!0;const A=I/T.startScale,j=T.anchor.x+(T.startX-T.anchor.x)*A,ie=T.anchor.y+(T.startY-T.anchor.y)*A,ae=Vi(n,i,I);y({focalX:yo(n.width,ae.width,j),focalY:yo(n.height,ae.height,ie),scale:I});return}const C=x.current;if(C&&E.pointerId===C.pointerId){E.stopPropagation(),E.preventDefault();const V=S(E.clientX,E.clientY),w=V.x-C.origin.x,q=V.y-C.origin.y;if(!C.moved&&w===0&&q===0)return;C.moved=!0,y({focalX:yo(n.width,C.width,C.startX+w),focalY:yo(n.height,C.height,C.startY+q),scale:p})}},P=E=>{var V,w;const T=x.current;if(T&&E.pointerId===T.pointerId){x.current=null,E.stopPropagation(),(V=m.current)!=null&&V.hasPointerCapture(T.pointerId)&&m.current.releasePointerCapture(T.pointerId),T.moved&&v(k.current);return}const C=b.current;C&&E.pointerId===C.pointerId&&(b.current=null,E.stopPropagation(),(w=m.current)!=null&&w.hasPointerCapture(C.pointerId)&&m.current.releasePointerCapture(C.pointerId),C.moved&&v(k.current))},_=E=>{if(E.key==="Escape"){E.stopPropagation(),c("none");return}if(E.key==="="||E.key==="+"||E.key==="-"||E.key==="_"){E.preventDefault(),E.stopPropagation();const T=E.key==="="||E.key==="+",C=Math.min(nl,Math.max(tl,p*(T?Xd:1/Xd))),V={focalX:d,focalY:u,scale:C};y(V),v(V)}},G=["nw","ne","se","sw"],$={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},L=s.useMemo(()=>{const E=i??{width:n.width,height:n.height},T=Vi(n,E,p);return!(T.width>0)||!(T.height>0)?null:{x:n.x+Dn(n.width,T.width,d),y:n.y+Dn(n.height,T.height,u),width:T.width,height:T.height}},[i,n.x,n.y,n.width,n.height,d,u,p]),D=L?{minX:L.x,minY:L.y,maxX:L.x+L.width,maxY:L.y+L.height}:$;return a.jsxs("svg",{ref:m,className:`${e}-editor${f?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:_,onPointerMove:B,onPointerUp:P,onPointerCancel:P,onLostPointerCapture:P,"data-pretext-image-editor":!0,children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>c("none")}),f&&o&&L&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:g,maskUnits:"userSpaceOnUse",x:L.x,y:L.y,width:L.width,height:L.height,children:[a.jsx("rect",{x:L.x,y:L.y,width:L.width,height:L.height,fill:"#FFFFFF"}),a.jsx("path",{d:r,fillRule:"evenodd",fill:"#000000"})]})}),a.jsx("image",{className:`${e}-editor-ghost`,href:o??void 0,x:L.x,y:L.y,width:L.width,height:L.height,preserveAspectRatio:"none",mask:`url(#${g})`}),a.jsx("rect",{className:`${e}-editor-image-bounds`,x:L.x,y:L.y,width:L.width,height:L.height})]}),f&&a.jsxs(a.Fragment,{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:n.x,y:n.y,width:n.width,height:n.height}),a.jsx("rect",{className:`${e}-editor-body`,x:n.x,y:n.y,width:n.width,height:n.height,onPointerDown:W}),G.map(E=>{const T=il(D,E),C=E==="ne"||E==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:T.x-Qr/2,y:T.y-Qr/2,width:Qr,height:Qr}),a.jsx("rect",{className:`${e}-editor-scale-grab${C?` ${e}-editor-scale-grab-nesw`:""}`,x:T.x-Jr/2,y:T.y-Jr/2,width:Jr,height:Jr,onPointerDown:V=>U(V,E)})]},E)})]})]})}const rl=10,kC=rl*2,Wn=7,EC=4,so=9,MC=3.5,qd=1.08,AC=.05,ea=14,FC=1,ta=14,na=8;function NC({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,uniformStretch:l=!1,stage:c,onStageChange:d,onSelectionChange:u,onChange:p,onCommit:y}){const v=s.useRef(null),m=s.useRef(null),g=s.useRef(i);g.current=i;const x=s.useRef(null),b=s.useRef(null),k=s.useRef(null),f=s.useRef(null),[S,W]=s.useState([]),[U,B]=s.useState(fo),[P,_]=s.useState(null),G=s.useCallback(h=>{B(K=>SC(K,h)?K:h)},[]),$=c==="shape";s.useEffect(()=>{var h;$&&((h=v.current)==null||h.focus({preventScroll:!0}))},[$]),s.useEffect(()=>{$||W(h=>h.length?[]:h)},[$]);const L=S.length>0;s.useEffect(()=>{u==null||u(L)},[L,u]),s.useEffect(()=>()=>u==null?void 0:u(!1),[u]);const D=n.width>0?t.width/n.width:1,E=n.height>0?t.height/n.height:1,T=Math.min(D,E),C=r&&l?T:D,V=r&&l?T:E,w=r&&l?(t.width-n.width*T)/2:0,q=r&&l?(t.height-n.height*T)/2:0,I=s.useCallback(h=>r?{x:w+(h.x-n.x)*C,y:q+(h.y-n.y)*V}:{x:h.x-n.x,y:h.y-n.y},[r,n,C,V,w,q]),A=s.useCallback(h=>r?{x:n.x+(C>0?(h.x-w)/C:0),y:n.y+(V>0?(h.y-q)/V:0)}:{x:n.x+h.x,y:n.y+h.y},[r,n,C,V,w,q]),j=s.useMemo(()=>A({x:t.width/2,y:t.height/2}),[A,t.width,t.height]),ie=s.useCallback((h,K)=>{var ne;const Z=(ne=v.current)==null?void 0:ne.getBoundingClientRect();if(!Z||Z.width<=0||Z.height<=0)return{x:0,y:0};if(r){const de=(h-Z.left)/Z.width*t.width,z=(K-Z.top)/Z.height*t.height;return{x:n.x+(C>0?(de-w)/C:0),y:n.y+(V>0?(z-q)/V:0)}}return{x:n.x+(h-Z.left),y:n.y+(K-Z.top)}},[r,n,t.width,t.height,C,V,w,q]),ae=s.useCallback((h,K)=>{var ne;const Z=(ne=v.current)==null?void 0:ne.getBoundingClientRect();return!Z||Z.width<=0||Z.height<=0?{x:0,y:0}:{x:(h-Z.left)/Z.width*t.width,y:(K-Z.top)/Z.height*t.height}},[t.width,t.height]),O=s.useCallback((h,K)=>{const Z=l&&!(K!=null&&K.preserveShape)?pC(h,n,t,w,q,C,V):h;y(Z,K)},[y,l,n,t,w,q,C,V]),oe=s.useCallback(()=>{_(null)},[]),N=s.useCallback((h,K,Z)=>{if(!Z||x.current||b.current||k.current||f.current){oe();return}const ne=ae(h,K),de=cn(g.current,I);for(const X of de)for(const Ie of X.nodes)if(Math.hypot(Ie.p.x-ne.x,Ie.p.y-ne.y)<=so){oe();return}const z=zd(de,ne);if(!z||z.distance>rl){oe();return}const R=de[z.contour],ee=R==null?void 0:R.nodes[z.segment],te=R==null?void 0:R.nodes[(z.segment+1)%((R==null?void 0:R.nodes.length)??1)],me=!!(ee&&te&&!jo(ee,te));_(X=>X&&X.curved===me&&Math.hypot(X.point.x-z.point.x,X.point.y-z.point.y)<.25?X:{point:z.point,curved:me})},[ae,I,oe]),le=h=>{var We;const K=h.metaKey||h.ctrlKey,Z=k.current;if(Z&&h.pointerId===Z.pointerId){if(h.stopPropagation(),h.preventDefault(),Z.startDistance<=0)return;const ot=ie(h.clientX,h.clientY),qe=Math.hypot(ot.x-Z.origin.x,ot.y-Z.origin.y),tt=Math.max(AC,qe/Z.startDistance);if(!Z.moved&&Math.abs(tt-1)<1e-4)return;Z.moved=!0,p(Hd(Z.startContours,Z.origin,tt));return}const ne=b.current;if(ne&&h.pointerId===ne.pointerId){h.stopPropagation(),h.preventDefault();const ot=ie(h.clientX,h.clientY),{bbox:qe}=ne,tt=qe.maxX-qe.minX,et=qe.maxY-qe.minY,Ge=ot.x-ne.origin.x,ve=ot.y-ne.origin.y;let _e=Ge,Be=ve;if(isFinite(tt)&&isFinite(et))if(r){let $e=n.x,Ne=n.x+n.width,Ue=n.y,Je=n.y+n.height;l&&(C>0&&($e=n.x+(0-w)/C,Ne=n.x+(t.width-w)/C),V>0&&(Ue=n.y+(0-q)/V,Je=n.y+(t.height-q)/V));const st=Math.min($e,Ne-tt),it=Math.max($e,Ne-tt),Oe=Math.min(Ue,Je-et),Ae=Math.max(Ue,Je-et),gt=Math.min(it,Math.max(st,qe.minX+Ge)),ze=Math.min(Ae,Math.max(Oe,qe.minY+ve));_e=gt-qe.minX,Be=ze-qe.minY}else{const $e=qe.minX-n.x,Ne=qe.minY-n.y,Ue=Math.min(0,t.width-tt),Je=Math.max(0,t.width-tt),st=Math.min(0,t.height-et),it=Math.max(0,t.height-et),Oe=Math.min(Je,Math.max(Ue,$e+Ge)),Ae=Math.min(it,Math.max(st,Ne+ve));_e=Oe-$e,Be=Ae-Ne}const Ze=[];if(!K&&isFinite(tt)&&isFinite(et)){const $e=I({x:qe.minX+tt/2+_e,y:qe.minY+et/2+Be}),Ne={x:t.width/2,y:t.height/2};Math.abs($e.x-Ne.x)<=ea&&(_e=j.x-qe.minX-tt/2,Ze.push(el(Ne.x,"x",t))),Math.abs($e.y-Ne.y)<=ea&&(Be=j.y-qe.minY-et/2,Ze.push(el(Ne.y,"y",t)))}if(!ne.moved&&_e===0&&Be===0)return;ne.moved=!0,G(Ze.length?Ze:fo),p(cn(ne.startContours,$e=>({x:$e.x+_e,y:$e.y+Be})),{carryImage:!0});return}const de=f.current;if(de&&h.pointerId===de.pointerId){h.stopPropagation(),h.preventDefault();const ot=ie(h.clientX,h.clientY);let qe=ot.x-de.origin.x,tt=ot.y-de.origin.y;if(h.shiftKey&&(Math.abs(qe)>Math.abs(tt)?tt=0:qe=0),!de.moved&&qe===0&&tt===0)return;de.moved=!0,p(Od(de.startContours,de.selection,qe,tt));return}const z=x.current;if(!z||h.pointerId!==z.pointerId){N(h.clientX,h.clientY,S.length>0||$);return}oe(),h.stopPropagation(),h.preventDefault();const R=ie(h.clientX,h.clientY);if(z.kind==="anchor"){const ot={x:z.anchor.x+(R.x-z.origin.x),y:z.anchor.y+(R.y-z.origin.y)},qe=K?[]:bC(g.current,{contour:z.contour,node:z.node}),tt=K||!z.center?[]:[z.center],et=jd(Bd(qe,tt.map(_e=>_e.x),"x"),ot,"x",I,ea),Ge=jd(Bd(qe,tt.map(_e=>_e.y),"y"),ot,"y",I,ea),ve=K?ot:{x:(et==null?void 0:et.value)??Zr(ot.x,o),y:(Ge==null?void 0:Ge.value)??Zr(ot.y,o)};if(h.shiftKey&&(Math.abs(ve.x-z.anchor.x)>Math.abs(ve.y-z.anchor.y)?ve.y=z.anchor.y:ve.x=z.anchor.x),!z.moved&&ve.x===z.anchor.x&&ve.y===z.anchor.y)return;z.moved=!0,G(CC(ve,et,Ge,t,I)),p(gC(g.current,z.contour,z.node,ve));return}const ee=(We=g.current[z.contour])==null?void 0:We.nodes[z.node],te=z.mirror&&!h.altKey,me=te||K?null:z.kind==="in"?ee==null?void 0:ee.out:ee==null?void 0:ee.in,X=ee?I(ee.p):null,Ie=me?I(me):null,Se=ee&&(!K||h.shiftKey)?LC(R,ee.p,te||K?null:TC(g.current[z.contour],z.node,z.kind,I),X&&Ie?Math.hypot(Ie.x-X.x,Ie.y-X.y):null,h.shiftKey,I,A):{point:R,guides:fo},J=Se.guides.length?Se.point:K?R:{x:Zr(R.x,o),y:Zr(R.y,o)},He=z.kind==="in"?ee==null?void 0:ee.in:ee==null?void 0:ee.out;!z.moved&&He&&J.x===He.x&&J.y===He.y||(z.moved=!0,G(Se.guides),p(fC(g.current,z.contour,z.node,z.kind,J,te)))},Q=h=>{G(fo);const K=k.current;if(K&&h.pointerId===K.pointerId){k.current=null,h.stopPropagation();const me=v.current;me!=null&&me.hasPointerCapture(K.pointerId)&&me.releasePointerCapture(K.pointerId),K.moved&&O(g.current,{preserveShape:!0});return}const Z=b.current;if(Z&&h.pointerId===Z.pointerId){b.current=null,h.stopPropagation();const me=v.current;me!=null&&me.hasPointerCapture(Z.pointerId)&&me.releasePointerCapture(Z.pointerId),Z.moved?O(g.current,{preserveShape:!0}):W([]);return}const ne=f.current;if(ne&&h.pointerId===ne.pointerId){f.current=null,h.stopPropagation();const me=v.current;me!=null&&me.hasPointerCapture(ne.pointerId)&&me.releasePointerCapture(ne.pointerId),ne.moved&&O(g.current);return}const de=x.current;if(!de||h.pointerId!==de.pointerId)return;x.current=null,h.stopPropagation();const z=v.current;z!=null&&z.hasPointerCapture(de.pointerId)&&z.releasePointerCapture(de.pointerId);const R=Math.hypot(h.clientX-de.clientOrigin.x,h.clientY-de.clientOrigin.y);if(de.moved||R>EC){de.moved&&O(g.current);return}if(!de.toggleOnRelease||h.type!=="pointerup")return;const te=Dd(g.current,de.contour,de.node);te!==g.current&&(p(te),O(te))},be=h=>{h.stopPropagation()},Pe=h=>{var K,Z;h.stopPropagation(),h.preventDefault(),oe(),(K=v.current)==null||K.focus({preventScroll:!0}),b.current={pointerId:h.pointerId,origin:ie(h.clientX,h.clientY),startContours:zn(i),bbox:$i(i),moved:!1},(Z=v.current)==null||Z.setPointerCapture(h.pointerId)},ye=(h,K)=>{var R,ee;h.stopPropagation(),h.preventDefault(),oe(),(R=v.current)==null||R.focus({preventScroll:!0}),W([]),d("shape");const Z=$i(i),ne=Ca(Z,Fp(K)),de=il(Z,K),z=Math.hypot(de.x-ne.x,de.y-ne.y);!isFinite(z)||z<=0||(k.current={pointerId:h.pointerId,corner:K,origin:ne,startDistance:z,startContours:zn(i),moved:!1},(ee=v.current)==null||ee.setPointerCapture(h.pointerId))},ce=(h,K,Z,ne)=>{var R,ee,te,me;h.stopPropagation(),h.preventDefault(),oe(),(R=v.current)==null||R.focus({preventScroll:!0});const de=(ee=i[Z])==null?void 0:ee.nodes[ne];if(!de)return;if(h.altKey){const X=K==="anchor"?Ap(i,Z,ne):yC(i,Z,ne,K);if(X===i)return;W(K==="anchor"?[]:[{contour:Z,node:ne}]),p(X),O(X);return}const z=h.metaKey||h.ctrlKey;if(K==="anchor"&&h.shiftKey&&!z){W(X=>X.some(Ie=>Ie.contour===Z&&Ie.node===ne)?X.filter(Ie=>!(Ie.contour===Z&&Ie.node===ne)):[...X,{contour:Z,node:ne}]);return}if(K==="anchor"&&!z&&S.length>1&&S.some(X=>X.contour===Z&&X.node===ne)){f.current={pointerId:h.pointerId,origin:ie(h.clientX,h.clientY),startContours:zn(i),selection:S,moved:!1},(te=v.current)==null||te.setPointerCapture(h.pointerId);return}W([{contour:Z,node:ne}]),x.current={kind:K,contour:Z,node:ne,pointerId:h.pointerId,origin:ie(h.clientX,h.clientY),clientOrigin:{x:h.clientX,y:h.clientY},anchor:de.p,center:uC(i),mirror:K!=="anchor"&&!!(de.in&&de.out),toggleOnRelease:z,moved:!1},(me=v.current)==null||me.setPointerCapture(h.pointerId)},Y=h=>{h.stopPropagation(),h.preventDefault(),oe();const K=cn(i,I),Z=zd(K,ae(h.clientX,h.clientY));if(!Z||Z.distance>rl)return;const{contours:ne,nodeIndex:de}=vC(i,Z.contour,Z.segment,Z.t);de<0||(W([{contour:Z.contour,node:de}]),p(ne),O(ne))},se=h=>{if(h.key==="="||h.key==="+"||h.key==="-"||h.key==="_"){h.preventDefault(),h.stopPropagation();const z=$i(i);if(!isFinite(z.minX)||!isFinite(z.maxX))return;const R={x:(z.minX+z.maxX)/2,y:(z.minY+z.maxY)/2},te=h.key==="="||h.key==="+"?qd:1/qd,me=Hd(i,R,te);p(me),O(me,{preserveShape:!0});return}if(h.key==="Escape"){h.stopPropagation(),W([]),d("none");return}if(!S.length)return;if(h.key==="Backspace"||h.key==="Delete"){h.preventDefault(),h.stopPropagation();const z=hC(i,S);if(z===i)return;W([]),p(z),O(z);return}const K=o>0?o:FC,Z=h.shiftKey?K*10:K,ne={ArrowLeft:[-Z,0],ArrowRight:[Z,0],ArrowUp:[0,-Z],ArrowDown:[0,Z]}[h.key];if(!ne)return;h.preventDefault(),h.stopPropagation();const de=Od(i,S,ne[0],ne[1]);p(de),O(de)},pe=s.useMemo(()=>_o(cn(i,I)),[i,I]),fe=s.useMemo(()=>$i(i),[i]),we=I({x:fe.minX,y:fe.minY}),Re={width:I({x:fe.maxX,y:fe.minY}).x-we.x,height:I({x:fe.minX,y:fe.maxY}).y-we.y},ge=$&&S.length===0&&isFinite(fe.minX)&&isFinite(fe.maxX)&&fe.maxX>fe.minX&&fe.maxY>fe.minY,xe=S.length>0||$,Ce=xe;return a.jsxs("svg",{ref:v,className:`${e}-editor${xe?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:se,onPointerDown:()=>{var h;return(h=v.current)==null?void 0:h.focus({preventScroll:!0})},onPointerMove:le,onPointerLeave:oe,onPointerUp:Q,onPointerCancel:Q,onLostPointerCapture:Q,onContextMenu:h=>{h.preventDefault()},"data-pretext-path-editor":!0,"data-selection":"none",children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>{W([]),d("none")},onClick:Y}),Ce&&a.jsx("path",{className:`${e}-editor-outline`,d:pe}),Ce&&U.map((h,K)=>a.jsx("line",{className:`${e}-editor-snap ${e}-editor-snap-${h.kind}`,x1:h.a.x,y1:h.a.y,x2:h.b.x,y2:h.b.y},`${h.kind}-${K}`)),a.jsx("path",{ref:m,className:`${e}-editor-body`,d:pe,fillRule:"evenodd",onPointerDown:Pe,onClick:Y}),Ce&&a.jsx("path",{className:`${e}-editor-hit`,d:pe,style:{strokeWidth:kC},onClick:Y}),Ce&&P&&a.jsx("rect",{className:`${e}-editor-add-preview`,x:P.point.x-Wn/2,y:P.point.y-Wn/2,width:Wn,height:Wn,rx:P.curved?Wn/2:0}),Ce&&i.map((h,K)=>h.nodes.map((Z,ne)=>{const de=S.some(R=>R.contour===K&&R.node===ne),z=I(Z.p);return a.jsxs("g",{children:[de&&S.length===1&&["in","out"].map(R=>{const ee=Z[R];if(!ee)return null;const te=I(ee);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:z.x,y1:z.y,x2:te.x,y2:te.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:te.x,cy:te.y,r:MC}),a.jsx("circle",{className:`${e}-editor-grab`,cx:te.x,cy:te.y,r:so,onPointerDown:me=>ce(me,R,K,ne),onClick:be})]},R)}),a.jsx("rect",{className:`${e}-editor-anchor${de?` ${e}-editor-anchor-selected`:""}`,x:z.x-Wn/2,y:z.y-Wn/2,width:Wn,height:Wn,rx:Pp(Z)?Wn/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:z.x-so,y:z.y-so,width:so*2,height:so*2,onPointerDown:R=>ce(R,"anchor",K,ne),onClick:be,onDoubleClick:R=>{R.stopPropagation(),R.preventDefault();const ee=Dd(i,K,ne);p(ee),O(ee)}})]},`${K}-${ne}`)})),ge&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:we.x,y:we.y,width:Re.width,height:Re.height}),["nw","ne","se","sw"].map(h=>{const K=I(il(fe,h)),Z=h==="ne"||h==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:K.x-na/2,y:K.y-na/2,width:na,height:na}),a.jsx("rect",{className:`${e}-editor-scale-grab${Z?` ${e}-editor-scale-grab-nesw`:""}`,x:K.x-ta/2,y:K.y-ta/2,width:ta,height:ta,onPointerDown:ne=>ye(ne,h),onClick:be})]},h)})]})]})}const _C=4e3,HC=/^(?:https?:|mailto:|tel:)/i;function Np(e){return!!e&&typeof e=="object"&&e.type==="link"}function WC(e){if(!e)return;const t=e.replace(/\s+/g,"");if(!(/^[a-z][a-z0-9+.-]*:/i.test(t)&&!HC.test(t)))return t}function OC(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,c)=>{for(const d of r){if(Np(d)){o(d.children??[],WC(d.value),d.target);continue}const u=d,p=(u==null?void 0:u.text)??"";if(p.trim())for(const y of p.split(/\s+/))y&&t.push({text:y,leaf:u,href:l,target:c,para:i})}};o((n==null?void 0:n.children)??[])}),t}function Ud(e){return{...e.fontFamily&&{fontFamily:Do(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"}}}function DC(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(Np(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function zC(e,t,n,i,o){if(t<=0||!e.length||n<=0||i<=0)return e;const r=o==="avoid"?1:-1;return e.map(l=>{if(!l.length)return l;let c=1/0,d=-1/0,u=1/0,p=-1/0;for(const m of l){const g=m.x*n,x=m.y*i;g<c&&(c=g),g>d&&(d=g),x<u&&(u=x),x>p&&(p=x)}const y=(c+d)/2,v=(u+p)/2;return l.map(m=>{const g=m.x*n,x=m.y*i,b=g-y,k=x-v,f=Math.sqrt(b*b+k*k);if(f<1e-6)return m;const W=Math.max(0,f+r*t)/f;return{x:(y+b*W)/n,y:(v+k*W)/i}})})}const Is=2,Rs=2;function BC(e,t,n,i,o){if(e.kind!=="whole")return null;const r=t[e.originalIndex],l=e.token.text;if(!r||l.length<Is+Rs)return null;const c=Math.min(r.length-Rs,l.length-Rs);let d=-1;for(let u=c;u>=Is;u-=1)if(r[u-1]*i+o*i<=n){d=u;break}return d<Is?null:{fragmentText:`${l.slice(0,d)}-`,remainderText:l.slice(d),fragmentWidth:r[d-1]+o,remainderWidth:Math.max(0,e.width-r[d-1])}}function Kd(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:c,height:d,allowOverflow:u,capInset:p,capLines:y}=e,v=!!e.hyphenate,m=e.charWidths??[],g=e.hyphenWidth??0,x=e.lineHeight*l,b=e.spaceWidth*l,k=Math.max(0,e.shapeMargin??0),f=[],S=t.map((C,V)=>({token:C,originalIndex:V,width:n[V],kind:"whole"}));if(!S.length||c<=0||x<=0)return{segments:f,placed:0,height:0,capLeft:0,capTop:0,renderTokens:t};const W=Math.max(1,b*.5),U=x*V$,B=zC(i,k,c,d,o);let P=0,_=0,G=0,$=S[0].token.para,L=0,D=0,E=null;for(;P<S.length&&G<_C;){const C=_+x>d;if(C&&!u)break;const V=S[P].token.para;if(V>$+1){_+=x*(V-$-1),$=V-1,G+=1;continue}let w=C?[{x0:0,x1:c}]:J$(B,(_+U)/d,(_+x-U)/d,o).map(I=>({x0:I.x0*c,x1:I.x1*c}));p>0&&y>0&&!C&&w.length&&(E===null&&(E=G,L=w[0].x0,D=_),G-E<y&&(w=Z$(w,{x0:L,x1:L+p})));const q=w.reduce((I,A)=>Math.max(I,A.x1-A.x0),0);for(const I of w){const A=I.x1-I.x0;if(A<W)continue;if(P>=S.length||S[P].token.para!==V)break;const j=P;let ie=0;for(;P<S.length&&S[P].token.para===V;){const ae=S[P],O=P===j,oe=ae.width*l,N=O?oe:b+oe;if(ie+N<=A){ie+=N,P+=1;continue}if(O&&A>=q-.5&&oe>c-.5){ie+=N,P+=1;continue}if(v){const Q=A-ie-(O?0:b),be=BC(ae,m,Q,l,g);if(be){const Pe={token:{...ae.token,text:be.fragmentText},originalIndex:ae.originalIndex,width:be.fragmentWidth,kind:"fragment"},ye={token:{...ae.token,text:be.remainderText},originalIndex:ae.originalIndex,width:be.remainderWidth,kind:"remainder"};S.splice(P,1,Pe,ye),ie+=(O?0:b)+be.fragmentWidth*l,P+=1}}break}if(P>j){const ae=P>=S.length||S[P].token.para!==V;f.push({top:_,left:I.x0,width:A,from:j,to:P,justify:r==="justify"&&!ae})}if(P>=S.length||S[P].token.para!==V)break}$=V,_+=x,G+=1}let T=0;if(P>0){const C=S[P-1];T=C.kind==="fragment"?C.originalIndex:C.originalIndex+1}return{segments:f,placed:T,height:f.length?_:0,capLeft:L,capTop:D,renderTokens:S.map(C=>C.token)}}const jC=.12,VC=2,GC=10,ks=.25,XC=e=>{const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}},qC=(e,t)=>Math.abs(e.top-t.top)<.5&&Math.abs(e.left-t.left)<.5&&Math.abs(e.width-t.width)<.5&&Math.abs(e.height-t.height)<.5,UC=(e,t)=>{const[n,i]=s.useState(null);return s.useEffect(()=>{if(!e||!t){i(null);return}let o=0,r=null;const l=()=>{const c=XC(e);(!r||!qC(r,c))&&(r=c,i(c)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n},Es=(e,t)=>{if(!(t.width>0)||!(t.height>0))return e;const n=Math.min(t.width,t.height),i=(t.width-n)/2,o=(t.height-n)/2;return e.map(r=>r.map(l=>({x:(i+l.x*n)/t.width,y:(o+l.y*n)/t.height})))},nr=typeof window>"u"?s.useEffect:s.useLayoutEffect;function KC(){return typeof document>"u"?null:document.body}function YC({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:c,allowOverflow:d,fitEnabled:u,scale:p,onFitScale:y,padding:v,hyphenate:m,showOverflowIndicator:g,dropCapLines:x,dropCapSize:b,showGuides:k,typography:f,imageUrl:S,imageFocalX:W,imageFocalY:U,imageScale:B,imageCustomPath:P,pathDragActive:_,pathCarryImage:G,onCarryImageConsumed:$,pathEditor:L,imageEditor:D}){var Xe,ct;const E=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[T,C]=s.useState(null),V=s.useRef(null),[w,q]=s.useState({width:0,height:0}),[I,A]=s.useState(0),[j,ie]=s.useState(null),[ae,O]=s.useState(0),[oe,N]=s.useState("none");s.useEffect(()=>{!L&&!D&&N("none")},[L,D]);const[le,Q]=s.useState(null);s.useEffect(()=>{if(!S||typeof Image>"u"){Q(null);return}let he=!1;const Ee=new Image;return Ee.onload=()=>{he||Q({width:Ee.naturalWidth,height:Ee.naturalHeight})},Ee.src=S,()=>{he=!0}},[S]);const be=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),Pe=s.useMemo(()=>OC(be),[be]),ye=s.useMemo(()=>DC(be),[be]),ce=x>0&&b>1?((ct=(Xe=Pe[0])==null?void 0:Xe.text)==null?void 0:ct.charAt(0))??"":"",Y=(L==null?void 0:L.contours)??null,se=s.useMemo(()=>{let he=[];if(Y){const Ee=wr(Y);Ee.length&&(he=wo(Ee,r))}if(!he.length){const Ee=i.trim(),nt=Ee?Ad(Ee,o,r):null;nt&&nt.length?he=nt:he=Ys(n==="custom"?"rectangle":n)}return n==="circle"?Es(he,w):he},[Y,n,i,o,r,w.width,w.height]),pe=L==null?void 0:L.onConvert,fe=(L==null?void 0:L.needsConversion)??!1,we=s.useMemo(()=>{if(n==="circle")return!1;const he=Y??(i.trim()?Ii(i):null);return!!(he&&Ep(he,r))},[Y,i,r,n]),[Re,ge]=s.useState(null);nr(()=>{if(!we){Re&&ge(null);return}!Re&&w.width>0&&w.height>0&&ge({width:w.width,height:w.height})},[we,w.width,w.height,Re]);const xe=s.useMemo(()=>{if(!we||w.width<=0||w.height<=0)return se;const he=Re??w,Ee=r.width/he.width,nt=r.height/he.height;return se.map(pt=>pt.map(Ve=>({x:Ve.x*Ee,y:Ve.y*nt})))},[se,we,Re,r.width,r.height,w.width,w.height]),Ce=s.useMemo(()=>{if(Y){const pt=wr(Y);if(pt.length){const Ve=wo(pt,r);return n==="circle"?Es(Ve,w):Ve}}const he=P.trim(),Ee=he?Ad(he,o,r):null,nt=Ee&&Ee.length?Ee:Ys(n==="custom"?"rectangle":n);return n==="circle"?Es(nt,w):nt},[Y,n,P,o,r,w.width,w.height]),h=s.useMemo(()=>{if(!we||w.width<=0||w.height<=0)return Ce;const he=Re??w,Ee=r.width/he.width,nt=r.height/he.height;return Ce.map(pt=>pt.map(Ve=>({x:Ve.x*Ee,y:Ve.y*nt})))},[Ce,we,Re,r.width,r.height,w.width,w.height]),K=s.useRef(null),Z=s.useRef(!1);s.useEffect(()=>{if(!(!pe||w.width<=0||w.height<=0)){if(we){if(K.current===i)return;const he=Y??(i.trim()?Ii(i):null);if(!(he!=null&&he.length))return;const Ee=cn(he,nt=>({x:r.x+(nt.x-r.x)/w.width*r.width,y:r.y+(nt.y-r.y)/w.height*r.height}));K.current=_o(Ee),pe(Ee);return}!fe||!se.length||Z.current||(Z.current=!0,pe(cn(kp(se),he=>({x:he.x*$a,y:he.y*$a}))))}},[fe,we,pe,se,Y,i,r,w.width,w.height]);const ne=s.useCallback(()=>{const he=T;if(!he)return;const Ee=he.getBoundingClientRect(),nt=parseFloat(window.getComputedStyle(he).paddingTop)||0;A(Ve=>Math.abs(Ve-nt)<.5?Ve:nt);const pt={width:Ee.width,height:Ee.height};q(Ve=>Math.abs(Ve.width-pt.width)<.5&&Math.abs(Ve.height-pt.height)<.5?Ve:pt)},[T]);nr(()=>{const he=T;if(!he||typeof ResizeObserver>"u")return;ne();const Ee=new ResizeObserver(ne);return Ee.observe(he),()=>Ee.disconnect()},[T,ne]),nr(()=>{ne()},[v,ne]),s.useEffect(()=>{const he=typeof document<"u"?document.fonts:void 0;he!=null&&he.ready&&he.ready.then(()=>{O(Ee=>Ee+1)})},[]),nr(()=>{const he=V.current;if(!he)return;if(!Pe.length){ie(null);return}const Ee=[],nt=document.createDocumentFragment();for(const ut of Pe){const H=document.createElement("span");Object.assign(H.style,Ud(ut.leaf)),H.textContent=ut.text,nt.appendChild(H),Ee.push(H)}const pt=document.createElement("span");pt.textContent=" ",nt.appendChild(pt);const Ve=document.createElement("span");Ve.textContent="-",nt.appendChild(Ve);const vt=ce||"H",Rt=document.createElement("span");Rt.textContent=vt,Rt.style.lineHeight="1",nt.appendChild(Rt),he.replaceChildren(nt);const At=window.getComputedStyle(he),wt=parseFloat(At.fontSize)||16,Vt=parseFloat(At.lineHeight),jt=Number.isNaN(Vt)?wt*1.2:Vt,Kt=Math.max(jt,wt),Yt=document.createElement("span");Yt.textContent=vt,Yt.style.lineHeight=`${Kt}px`;const kt=document.createElement("span");kt.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",Yt.appendChild(kt),he.appendChild(Yt);const Bt=Yt.getBoundingClientRect().top,rn=kt.getBoundingClientRect().top,xt=Math.max(1,rn-Bt);Yt.remove();let yt=xt*.8;const Qe=document.createElement("canvas").getContext("2d"),rt=ut=>`${At.fontStyle} ${At.fontWeight} ${ut}px ${At.fontFamily}`;if(Qe){Qe.font=rt(wt);const ut=Qe.measureText(vt).actualBoundingBoxAscent;ut>0&&(yt=ut)}const dt=b>1?(b-1)*Kt+yt:yt;let Pt=wt*(dt/yt);if(Qe){Qe.font=rt(Pt);const ut=Qe.measureText(vt).actualBoundingBoxAscent;ut>0&&(Pt=Pt*(dt/ut))}Rt.style.fontSize=`${Pt}px`,Rt.style.lineHeight=`${Pt}px`;const St=document.createElement("span");St.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",Rt.appendChild(St);const ht=Math.max(1,St.getBoundingClientRect().top-Rt.getBoundingClientRect().top);St.remove();const Tt=(b-1)*Kt+xt-ht,Ot=Ee.map(ut=>ut.getBoundingClientRect().width),Gt=pt.getBoundingClientRect().width,Mt=Ve.getBoundingClientRect().width,_t=ce?Rt.getBoundingClientRect().width:0,Ft=m?Ee.map(ut=>{const H=ut.firstChild;if(!(H instanceof Text)||H.data.length<4)return;const Le=document.createRange(),je=ut.getBoundingClientRect().left,Fe=[];for(let ft=1;ft<=H.data.length;ft+=1)Le.setStart(H,0),Le.setEnd(H,ft),Fe.push(Le.getBoundingClientRect().right-je);return Fe}):[];he.replaceChildren(),ie({widths:Ot,spaceWidth:Gt,dashWidth:Mt,charWidths:Ft,lineHeight:Kt,capWidth:_t,dropCapFontSize:Pt,dropCapTopAdjust:Tt})},[Pe,f,ce,x,b,ae,w.width,m]);const de=j&&ce?j.capWidth+j.lineHeight*jC:0,z=Math.max(x,Math.ceil(b)),R=s.useMemo(()=>{if(!j||!Pe.length||w.width<=0||w.height<=0||!u)return 1;const he=pt=>Kd({tokens:Pe,widths:j.widths,spaceWidth:j.spaceWidth,lineHeight:j.lineHeight,width:w.width,height:w.height,rings:xe,mode:l,align:c,scale:pt,allowOverflow:!1,capInset:de*pt,capLines:ce?z:0,hyphenate:m,charWidths:j.charWidths,hyphenWidth:j.dashWidth,shapeMargin:I});if(he(1).placed>=Pe.length)return 1;if(he(ks).placed<Pe.length)return ks;let Ee=ks,nt=1;for(let pt=0;pt<GC;pt+=1){const Ve=(Ee+nt)/2;he(Ve).placed>=Pe.length?Ee=Ve:nt=Ve}return Ee},[j,Pe,w.width,w.height,xe,l,c,u,de,ce,z,m,I]);s.useEffect(()=>{y(R)},[R,y]);const ee=u?Math.min(p,R):1,te=s.useMemo(()=>!j||!Pe.length||w.width<=0||w.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0,renderTokens:Pe}:Kd({tokens:Pe,widths:j.widths,spaceWidth:j.spaceWidth,lineHeight:j.lineHeight,width:w.width,height:w.height,rings:xe,mode:l,align:c,scale:ee,allowOverflow:d,capInset:de*ee,capLines:ce?z:0,hyphenate:m,charWidths:j.charWidths,hyphenWidth:j.dashWidth,shapeMargin:I}),[j,Pe,w.width,w.height,xe,l,c,ee,d,de,ce,z,m,I]),me=g&&Pe.length>0&&te.placed<Pe.length,X=j?j.dropCapFontSize*ee:0,Ie=j?j.dropCapTopAdjust*ee:0,Se=c==="justify"?"left":c,J=j?j.lineHeight*ee:0,He=te.segments.length?te.segments[te.segments.length-1]:null,We=He?{top:He.top+J,left:He.left+He.width/2}:{top:w.height,left:w.width/2},ot=!!(L&&Y&&w.width>0&&w.height>0),qe=!!D,tt=(ot||qe)&&w.width>0&&w.height>0,et=UC(T,tt),Ge=tt&&et?KC():null,ve=s.useRef(!1),_e=s.useCallback(he=>{ve.current=he},[]);s.useEffect(()=>{if(!ot&&!qe)return;const he=Ee=>{const nt=T;if(!nt)return;const pt=nt.getBoundingClientRect();Ee.clientX>=pt.left&&Ee.clientX<=pt.right&&Ee.clientY>=pt.top&&Ee.clientY<=pt.bottom&&(Ee.preventDefault(),Ee.stopPropagation(),N(vt=>vt==="shape"&&ve.current?vt:vt==="shape"&&qe?"image":ot?"shape":"image"))};return document.addEventListener("dblclick",he,!0),()=>document.removeEventListener("dblclick",he,!0)},[ot,qe,T]);const Be=s.useMemo(()=>S&&w.width>0&&w.height>0?G$(h,w):null,[S,h,w.width,w.height]),Ze=s.useRef(null),$e=(()=>{const he=Ze.current;return G||!D||!le||!Be||!he||P===he.customPath||he.shape!==n&&n!=="custom"?null:IC(he.bounds,Be,le,he.focalX,he.focalY,he.scale)})();nr(()=>{if(_||!D||!le||!Be)return;const he=Ze.current,Ee=!!(he&&P!==he.customPath);Ee&&$e&&D.onCommit($e),Ee&&G&&($==null||$()),Ze.current={rings:h,bounds:Be,focalX:($e==null?void 0:$e.focalX)??W,focalY:($e==null?void 0:$e.focalY)??U,scale:($e==null?void 0:$e.scale)??B,customPath:P,shape:n}},[_,G,P,n,h,Be,D,le,W,U,B,$e,$]);const Ne=Ze.current,Ue=!!(_&&!G&&Ne&&!$e),Je=Ue&&Ne?Ne.focalX:($e==null?void 0:$e.focalX)??W,st=Ue&&Ne?Ne.focalY:($e==null?void 0:$e.focalY)??U,it=Ue&&Ne?Ne.scale:($e==null?void 0:$e.scale)??B,Oe=Ue&&Ne?Ne.bounds:Be,Ae=s.useMemo(()=>{if(!(w.width>0)||!(w.height>0))return"";let he=Nd(i,Y,o,r,n,w);if(we){const Ee=Re??w,nt=r.width/Ee.width,pt=r.height/Ee.height;he=cn(he,Ve=>({x:Ve.x*nt,y:Ve.y*pt}))}return _d(he,w)||Md(xe,w)},[i,Y,o,r,n,w.width,w.height,we,Re,xe]),gt=s.useMemo(()=>{if(!S||!(w.width>0)||!(w.height>0))return"";let he=Nd(P,Y,o,r,n,w);if(we){const Ee=Re??w,nt=r.width/Ee.width,pt=r.height/Ee.height;he=cn(he,Ve=>({x:Ve.x*nt,y:Ve.y*pt}))}return _d(he,w)||Md(h,w)},[S,P,Y,o,r,n,w.width,w.height,we,Re,h]),ze=`${E}-clip`,De=s.useMemo(()=>{if(!Oe)return null;const he=le??{width:Oe.width,height:Oe.height},Ee=Vi(Oe,he,it);return{x:Dn(Oe.width,Ee.width,Je),y:Dn(Oe.height,Ee.height,st),width:Ee.width,height:Ee.height}},[Oe,le,Je,st,it]);return a.jsxs("div",{className:`${e}-column`,style:{padding:v},ref:C,children:[Ae?a.jsxs("svg",{className:`${e}-shape-fill`,style:{top:0,left:0,width:w.width,height:w.height},viewBox:`0 0 ${w.width} ${w.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("path",{className:`${e}-shape-fill-path`,d:Ae,fillRule:"evenodd"}),S&>&&Oe&&De?a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsx("clipPath",{id:ze,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:gt,fillRule:"evenodd"})})}),a.jsx("image",{href:S,x:Oe.x+De.x,y:Oe.y+De.y,width:De.width,height:De.height,preserveAspectRatio:"none",clipPath:`url(#${ze})`})]}):null]}):null,a.jsxs("div",{className:`${e}-flow${d?"":` ${e}-clip`}`,style:{...f,["--"+e+"-fit"]:ee,top:0,left:0,width:w.width,height:w.height},children:[a.jsx("div",{className:`${e}-measure`,ref:V,style:f,"aria-hidden":!0}),te.segments.map((he,Ee)=>{const nt=te.renderTokens.slice(he.from,he.to),pt=Ee===0;return a.jsx("div",{className:`${e}-line${he.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${he.top}px`,left:`${he.left}px`,width:`${he.width}px`,textAlign:he.justify?void 0:Se},children:nt.map((Ve,vt)=>{const At=ce&&pt&&he.from===0&&vt===0?Ve.text.slice(1):Ve.text,wt=Ud(Ve.leaf),Vt=Ve.href?a.jsx("a",{className:`${e}-link`,href:Ve.href,target:Ve.target,rel:Ve.target?"noopener noreferrer":void 0,style:wt,children:At}):a.jsx("span",{style:wt,children:At});return a.jsxs("span",{children:[!he.justify&&vt>0?" ":null,Vt]},vt)})},`${he.from}-${he.to}-${Ee}`)}),k&&!Y&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:xe.map((he,Ee)=>a.jsx("polygon",{points:he.map(nt=>`${nt.x},${nt.y}`).join(" ")},Ee))})]}),ce&&j&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...f,top:`${te.capTop+Ie}px`,left:`${te.capLeft}px`,fontSize:`${X}px`,lineHeight:`${X}px`},children:ce}),Ge&&et&&(Y&&L||D)&&Gn.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:et.top,left:et.left,width:et.width,height:et.height,zIndex:VC,pointerEvents:"none"},children:[Y&&L&&a.jsx(NC,{P:e,box:{width:et.width,height:et.height},viewBox:r,contours:Y,snap:L.snap,stretchToBox:!we,uniformStretch:n==="circle",stage:oe,onStageChange:N,onSelectionChange:_e,onChange:L.onChange,onCommit:L.onCommit}),D&&Oe&&a.jsx(RC,{P:e,box:{width:et.width,height:et.height},bounds:Oe,natural:le,imageUrl:S,maskPath:gt,stage:oe,onStageChange:N,focalX:Je,focalY:st,scale:it,onChange:D.onChange,onCommit:D.onCommit})]}),Ge),a.jsx("div",{className:`${e}-a11y`,children:ye.map((he,Ee)=>a.jsx("p",{children:he},Ee))}),me&&a.jsxs("svg",{className:`${e}-overflow-icon`,width:"33",height:"24",viewBox:"0 0 33 24",style:{top:We.top,left:We.left},"aria-hidden":!0,children:[a.jsx("path",{d:"M12.8,4 L20.2,4 C24.68042,4 26.9206301,4 28.631924,4.87194781 C31.3123488,6.23769248 33,8.99168887 33,12 C33,15.0083111 31.3123488,17.7623075 28.631924,19.1280522 C26.9206301,20 24.68042,20 20.2,20 L12.8,20 C8.31957995,20 6.07936993,20 4.368076,19.1280522 C1.68765116,17.7623075 0,15.0083111 0,12 C0,8.99168887 1.68765116,6.23769248 4.368076,4.87194781 C6.07936993,4 8.31957995,4 12.8,4 Z",fill:"#FF4400"}),a.jsx("path",{transform:"translate(5, 0)",fill:"#FFFFFF",d:"M12,5.625 C12.3846269,5.625 12.7016304,5.91453014 12.7449542,6.28753416 L12.75,6.375 L12.75,11.25 L17.625,11.25 C18.0392136,11.25 18.375,11.5857864 18.375,12 C18.375,12.3846269 18.0854699,12.7016304 17.7124658,12.7449542 L17.625,12.75 L12.75,12.75 L12.75,17.625 C12.75,18.0392136 12.4142136,18.375 12,18.375 C11.6153731,18.375 11.2983696,18.0854699 11.2550458,17.7124658 L11.25,17.625 L11.25,12.75 L6.375,12.75 C5.96078644,12.75 5.625,12.4142136 5.625,12 C5.625,11.6153731 5.91453014,11.2983696 6.28753416,11.2550458 L6.375,11.25 L11.25,11.25 L11.25,6.375 C11.25,5.96078644 11.5857864,5.625 12,5.625 Z"})]})]})}const _p=["diamond","parallelogram","vase","circle","shield","bobbin","custom"],ZC={x:0,y:0,width:100,height:100},JC=e=>{const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?ZC:{x:t[0],y:t[1],width:t[2],height:t[3]}},QC=e=>`
|
|
27237
27265
|
.${e}-wrapper {
|
|
27238
27266
|
box-sizing: border-box;
|
|
27239
27267
|
display: flex;
|
|
@@ -27462,7 +27490,7 @@ export function Burger({
|
|
|
27462
27490
|
clip-path: inset(50%);
|
|
27463
27491
|
white-space: nowrap;
|
|
27464
27492
|
}
|
|
27465
|
-
`,eT=1;function tT({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:c}=F.useScopedStyles(),d=s.useMemo(()=>QC(c),[c]),u=n??!1,p=!!r||!!o,y=s.useMemo(()=>Array.isArray(t)?t[0]??{}:{},[t]),v=(e==null?void 0:e.shape)??"custom",m=(e==null?void 0:e.customPath)??"",g=(e==null?void 0:e.pathFit)??"stretch",x=s.useMemo(()=>JC(e==null?void 0:e.pathViewBox),[e==null?void 0:e.pathViewBox]),b=(e==null?void 0:e.shapeMode)==="B"?"avoid":"contain",k=(e==null?void 0:e.textAlign)??"left",f=((e==null?void 0:e.overflowMode)??"clip")==="visible",S=((e==null?void 0:e.fitText)??"off")==="on",
|
|
27493
|
+
`,eT=1;function tT({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:c}=F.useScopedStyles(),d=s.useMemo(()=>QC(c),[c]),u=n??!1,p=!!r||!!o,y=s.useMemo(()=>Array.isArray(t)?t[0]??{}:{},[t]),v=(e==null?void 0:e.shape)??"custom",m=(e==null?void 0:e.customPath)??"",g=(e==null?void 0:e.pathFit)??"stretch",x=s.useMemo(()=>JC(e==null?void 0:e.pathViewBox),[e==null?void 0:e.pathViewBox]),b=(e==null?void 0:e.shapeMode)==="B"?"avoid":"contain",k=(e==null?void 0:e.textAlign)??"left",f=((e==null?void 0:e.overflowMode)??"clip")==="visible",S=((e==null?void 0:e.fitText)??"off")==="on",W=((e==null?void 0:e.hyphenate)??"off")==="on",U=F.scalingValue((e==null?void 0:e.padding)??0,u),B=(e==null?void 0:e.dropCapSize)??eT,P=Math.max(1,Math.round((e==null?void 0:e.dropCapLines)??B)),_=u&&p&&!i,G=u&&!i,[$,L]=s.useState(!1);s.useEffect(()=>{if(!u||!p){L(!1);return}const z=()=>L(!0),R=()=>L(!1),ee=["ArticleEditor.Item:drag-start","ArticleEditor.Selection:resize-start","ArticleEditor.Selection:move-start"],te=["ArticleEditor.Item:drag-end","ArticleEditor.Selection:resize-end","ArticleEditor.Selection:move-end"];for(const me of ee)window.addEventListener(me,z);for(const me of te)window.addEventListener(me,R);return()=>{for(const me of ee)window.removeEventListener(me,z);for(const me of te)window.removeEventListener(me,R)}},[u,p]);const D=u&&p&&!i&&typeof l=="function",E=!$,T=Math.max(0,(e==null?void 0:e.pathSnap)??0),C=s.useRef(e??{}),V=s.useRef(""),w=[e==null?void 0:e.customPath,e==null?void 0:e.shape,e==null?void 0:e.pathFit,e==null?void 0:e.pathViewBox,e==null?void 0:e.imageScale,e==null?void 0:e.imageFocalX,e==null?void 0:e.imageFocalY,e==null?void 0:e.image].join("\0");if(w!==V.current)V.current=w,C.current=e??{};else if(e){const{customPath:z,shape:R,pathFit:ee,pathViewBox:te,imageScale:me,imageFocalX:X,imageFocalY:Ie,image:Se,...J}=e,He=C.current;for(const We of Object.keys(J))if(He[We]!==J[We]){C.current={...He,...J};break}}const[q,I]=s.useState(null),[A,j]=s.useState(!1),[ie,ae]=s.useState(!1),O=s.useCallback(()=>ae(!1),[]),oe=C.current.shape??v,N=s.useMemo(()=>!q||q.serialized===m?m:q.serialized,[q,m]);s.useEffect(()=>{D||(j(!1),ae(!1))},[D]),s.useEffect(()=>{!q||A||q.serialized===m&&I(null)},[q,m,A]);const le=s.useMemo(()=>{if(!D)return null;if(q&&(q.base===m||q.serialized===m))return q.contours;const z=Ii(m);return z.length?z:null},[D,q,m]),Q=!!(g==="viewbox"&&((e==null?void 0:e.pathViewBox)??"")===Us&&le&&(v==="circle"||!Ep(le,x))),be=s.useCallback((z,R,ee)=>{const te=_o(z);if(I(me=>({base:me&&(me.base===m||me.serialized===m)?me.base:m,serialized:te,contours:z})),R){const me=C.current,X=ee!=null&&ee.preserveShape?me.shape:"custom",Ie={...me,shape:X,customPath:te};C.current=Ie,l==null||l(Ie)}},[m,l]),Pe=s.useMemo(()=>D?{contours:Q?le:null,snap:T,needsConversion:!Q,onConvert:z=>{const R=_o(z);I({base:R,serialized:R,contours:z});const ee={...C.current,pathFit:"viewbox",pathViewBox:Us,customPath:R};C.current=ee,l==null||l(ee)},onChange:(z,R)=>{j(!0),ae(!!(R!=null&&R.carryImage)),be(z,!1)},onCommit:(z,R)=>{be(z,!0,R),j(!1)}}:null,[D,Q,le,T,l,be]),ye=b==="avoid"&&!!(e!=null&&e.image),ce=s.useMemo(()=>({focalX:(e==null?void 0:e.imageFocalX)??.5,focalY:(e==null?void 0:e.imageFocalY)??.5,scale:(e==null?void 0:e.imageScale)??1}),[e==null?void 0:e.imageFocalX,e==null?void 0:e.imageFocalY,e==null?void 0:e.imageScale]),[Y,se]=s.useState(null),pe=Y??ce,fe=s.useCallback(z=>se(z),[]),we=s.useCallback(z=>{se(z);const R={...C.current,imageFocalX:z.focalX,imageFocalY:z.focalY,imageScale:z.scale};C.current=R,l==null||l(R)},[l]);s.useEffect(()=>{Y&&Math.abs(Y.focalX-ce.focalX)<1e-9&&Math.abs(Y.focalY-ce.focalY)<1e-9&&Math.abs(Y.scale-ce.scale)<1e-9&&se(null)},[Y,ce]);const Re=s.useMemo(()=>!D||!ye?null:{onChange:fe,onCommit:we},[D,ye,fe,we]),[ge,xe]=s.useState(void 0),Ce=s.useRef(void 0),h=s.useCallback(z=>{const R=Ce.current;R!==void 0&&Math.abs(R-z)<.005||(Ce.current=z,xe(z))},[]),K=s.useMemo(()=>S&&typeof ge=="number"?ge:1,[ge,S]),Z=z=>`calc(${z} * var(--${c}-fit, 1))`,ne=s.useMemo(()=>{var ee,te,me,X,Ie;const z=(e==null?void 0:e.textFontSize)??.012,R=Math.max((e==null?void 0:e.textLineHeight)??z,z);return{fontFamily:Do(e==null?void 0:e.textFontFamily),fontWeight:(ee=e==null?void 0:e.textFontSettings)==null?void 0:ee.fontWeight,fontStyle:(te=e==null?void 0:e.textFontSettings)==null?void 0:te.fontStyle,fontSize:Z(F.scalingValue(z,u)),lineHeight:Z(F.scalingValue(R,u)),letterSpacing:Z(F.scalingValue((e==null?void 0:e.textLetterSpacing)??0,u)),wordSpacing:Z(F.scalingValue((e==null?void 0:e.textWordSpacing)??0,u)),textTransform:(me=e==null?void 0:e.textTextAppearance)==null?void 0:me.textTransform,textDecoration:(X=e==null?void 0:e.textTextAppearance)==null?void 0:X.textDecoration,fontVariant:(Ie=e==null?void 0:e.textTextAppearance)==null?void 0:Ie.fontVariant}},[e,u,c]),de={[`--${c}-text-color`]:(e==null?void 0:e.textColor)??"#000000",[`--${c}-link-color`]:(e==null?void 0:e.linkColor)??(e==null?void 0:e.textColor)??"#000000",[`--${c}-background-color`]:(e==null?void 0:e.backgroundColor)??"transparent"};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx("div",{className:`${c}-wrapper`,style:{...de},children:a.jsx(YC,{P:c,item:y,shape:oe,customPath:m,pathFit:g,viewBox:x,mode:b,align:k,allowOverflow:f,fitEnabled:S,scale:K,onFitScale:h,padding:U,hyphenate:W,showOverflowIndicator:G,dropCapLines:P,dropCapSize:B,showGuides:(_||D)&&E,typography:ne,imageUrl:b==="avoid"?e==null?void 0:e.image:null,imageFocalX:pe.focalX,imageFocalY:pe.focalY,imageScale:pe.scale,imageCustomPath:N,pathDragActive:A,pathCarryImage:ie,onCarryImageConsumed:O,pathEditor:E?Pe:null,imageEditor:E?Re:null})})]})}const nT=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
27466
27494
|
import type React from 'react';
|
|
27467
27495
|
import { CommonComponentProps } from '../props';
|
|
27468
27496
|
import { scalingValue, useScopedStyles } from '../utils/index';
|