@cntrl-site/components 1.0.92 → 1.0.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +41 -40
- package/dist/index.mjs +839 -838
- 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"),Tt=require("classnames"),N=require("./panelAvailability-D8c7cdbu.js"),Gn=require("react-dom");function qp(e){return e.type==="object"&&e.version===1}const Up="ControlSlider-module__wrapper___sHEkd",Kp="ControlSlider-module__hoverArrow___A-dOH",Yp="ControlSlider-module__sliderItem___QQSkR",Zp="ControlSlider-module__sliderImage___9hRl-",Jp="ControlSlider-module__arrow___05ghY",Qp="ControlSlider-module__arrowVertical___tBfVN",em="ControlSlider-module__nextArrow___-30Yc",tm="ControlSlider-module__arrowInner___aEra3",nm="ControlSlider-module__arrowIcon___S4ztF",im="ControlSlider-module__arrowImg___2dwJW",om="ControlSlider-module__mirror___brd6U",rm="ControlSlider-module__pagination___bicLF",am="ControlSlider-module__paginationInner___bT-P-",sm="ControlSlider-module__paginationVertical___zYqKw",lm="ControlSlider-module__paginationItem___nTRbk",cm="ControlSlider-module__dot___p1Qun",dm="ControlSlider-module__activeDot___LHFaj",um="ControlSlider-module__paginationInsideBottom___R3FWn",pm="ControlSlider-module__paginationInsideTop___V-qb-",mm="ControlSlider-module__paginationOutsideBottom___14w8D",gm="ControlSlider-module__paginationOutsideTop___SCLqB",hm="ControlSlider-module__paginationInsideLeft___yOBRZ",fm="ControlSlider-module__paginationInsideRight___Rtt3o",ym="ControlSlider-module__paginationOutsideLeft___lahaw",vm="ControlSlider-module__paginationOutsideRight___EtuQa",xm="ControlSlider-module__imgWrapper___UjEgB",bm="ControlSlider-module__captionBlock___dJ6-j",Sm="ControlSlider-module__captionTextWrapper___HFlpf",wm="ControlSlider-module__captionText___uGBVc",$m="ControlSlider-module__active___WZK4G",Cm="ControlSlider-module__withPointerEvents___t-18M",Tm="ControlSlider-module__topLeftAlignment___zjnGM",Lm="ControlSlider-module__topCenterAlignment___gD1xW",Pm="ControlSlider-module__topRightAlignment___NMapS",Im="ControlSlider-module__middleLeftAlignment___OnUrY",Rm="ControlSlider-module__middleCenterAlignment___Tdkl0",km="ControlSlider-module__middleRightAlignment___wEbfX",Em="ControlSlider-module__bottomLeftAlignment___cTP2-",Mm="ControlSlider-module__bottomCenterAlignment___c54fB",Am="ControlSlider-module__bottomRightAlignment___kEwrz",Fm="ControlSlider-module__clickOverlay___DZA28",Nm="ControlSlider-module__contain___pLyq7",_m="ControlSlider-module__cover___KdDat",Ct={wrapper:Up,hoverArrow:Kp,sliderItem:Yp,sliderImage:Zp,arrow:Jp,arrowVertical:Qp,nextArrow:em,arrowInner:tm,arrowIcon:nm,arrowImg:im,mirror:om,pagination:rm,paginationInner:am,paginationVertical:sm,paginationItem:lm,dot:cm,activeDot:dm,paginationInsideBottom:um,paginationInsideTop:pm,paginationOutsideBottom:mm,paginationOutsideTop:gm,paginationInsideLeft:hm,paginationInsideRight:fm,paginationOutsideLeft:ym,paginationOutsideRight:vm,imgWrapper:xm,captionBlock:bm,captionTextWrapper:Sm,captionText:wm,active:$m,withPointerEvents:Cm,topLeftAlignment:Tm,topCenterAlignment:Lm,topRightAlignment:Pm,middleLeftAlignment:Im,middleCenterAlignment:Rm,middleRightAlignment:km,bottomLeftAlignment:Em,bottomCenterAlignment:Mm,bottomRightAlignment:Am,clickOverlay:Fm,contain:Nm,cover:_m};function Hm(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 Wm(e,t,n){return t&&Hm(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var ql="(prefers-reduced-motion: reduce)",mo=1,Om=2,$o=3,Ho=4,Sr=5,ia=6,ua=7,Dm={CREATED:mo,MOUNTED:Om,IDLE:$o,MOVING:Ho,SCROLLING:Sr,DRAGGING:ia,DESTROYED:ua};function si(e){e.length=0}function Ii(e,t,n){return Array.prototype.slice.call(e,t,n)}function Jt(e){return e.bind.apply(e,[null].concat(Ii(arguments,1)))}var Yd=setTimeout,Es=function(){};function Ul(e){return requestAnimationFrame(e)}function Ca(e,t){return typeof t===e}function lr(e){return!sl(e)&&Ca("object",e)}var al=Array.isArray,Zd=Jt(Ca,"function"),$i=Jt(Ca,"string"),wr=Jt(Ca,"undefined");function sl(e){return e===null}function Jd(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function $r(e){return al(e)?e:[e]}function Rn(e,t){$r(e).forEach(t)}function ll(e,t){return e.indexOf(t)>-1}function oa(e,t){return e.push.apply(e,$r(t)),e}function ni(e,t,n){e&&Rn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Bn(e,t){ni(e,$i(t)?t.split(" "):t,!0)}function Cr(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 cr(e,t){return Jd(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Qd(e,t){var n=e?Ii(e.children):[];return t?n.filter(function(i){return cr(i,t)}):n}function Tr(e,t){return t?Qd(e,t)[0]:e.firstElementChild}var dr=Object.keys;function qi(e,t,n){return e&&(n?dr(e).reverse():dr(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function ur(e){return Ii(arguments,1).forEach(function(t){qi(t,function(n,i){e[i]=t[i]})}),e}function xi(e){return Ii(arguments,1).forEach(function(t){qi(t,function(n,i){al(n)?e[i]=n.slice():lr(n)?e[i]=xi({},lr(e[i])?e[i]:{},n):e[i]=n})}),e}function Kl(e,t){Rn(t||dr(e),function(n){delete e[n]})}function jn(e,t){Rn(e,function(n){Rn(t,function(i){n&&n.removeAttribute(i)})})}function Wt(e,t,n){lr(t)?qi(t,function(i,o){Wt(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&&($i(t)?Bn(i,t):Wt(i,t)),n&&Cr(n,i),i}function Mn(e,t,n){if(wr(n))return getComputedStyle(e)[t];sl(n)||(e.style[t]=""+n)}function pr(e,t){Mn(e,"display",t)}function eu(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function An(e,t){return e.getAttribute(t)}function Yl(e,t){return e&&e.classList.contains(t)}function Tn(e){return e.getBoundingClientRect()}function Ki(e){Rn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function tu(e){return Tr(new DOMParser().parseFromString(e,"text/html").body)}function ei(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function nu(e,t){return e&&e.querySelector(t)}function dl(e,t){return t?Ii(e.querySelectorAll(t)):[]}function ii(e,t){ni(e,t,!1)}function Ms(e){return e.timeStamp}function Ni(e){return $i(e)?e:e?e+"px":""}var Lr="splide",ul="data-"+Lr;function or(e,t){if(!e)throw new Error("["+Lr+"] "+(t||""))}var Ci=Math.min,pa=Math.max,ma=Math.floor,mr=Math.ceil,vn=Math.abs;function iu(e,t,n){return vn(e-t)<n}function ra(e,t,n,i){var o=Ci(t,n),r=pa(t,n);return i?o<e&&e<r:o<=e&&e<=r}function lo(e,t,n){var i=Ci(t,n),o=pa(t,n);return Ci(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 Zl={};function zm(e){return""+e+pl(Zl[e]=(Zl[e]||0)+1)}function ou(){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]()}),si(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var Ri="mounted",Ns="ready",li="move",Wo="moved",ml="click",ru="active",au="inactive",su="visible",lu="hidden",an="refresh",gn="updated",Co="resize",Ta="resized",cu="drag",du="dragging",uu="dragged",La="scroll",Ji="scrolled",Bm="overflow",gl="destroy",pu="arrows:mounted",mu="arrows:updated",gu="pagination:mounted",hu="pagination:updated",hl="navigation:mounted",fl="autoplay:play",fu="autoplay:playing",yl="autoplay:pause",vl="lazyload:loaded",yu="sk",vu="sh",ga="ei";function tn(e){var t=e?e.event.bus:document.createDocumentFragment(),n=ou();function i(r,l){n.bind(t,$r(r).join(" "),function(c){l.apply(l,al(c.detail)?c.detail:[])})}function o(r){n.dispatch(t,r,Ii(arguments,1))}return e&&e.event.on(gl,n.destroy),ur(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?Ci((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return v();c=Ul(p)}}function y(A){A||g(),r=o()-(A?l*e:0),d=!1,c=Ul(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 b(A){e=A}function S(){return d}return{start:y,rewind:m,pause:v,cancel:g,set:b,isPaused:S}}function jm(e){var t=e;function n(o){t=o}function i(o){return ll($r(o),t)}return{set:n,is:i}}function Vm(e,t){var n=Pa(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Gm(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=ou(),c=[];function d(){var g=n.mediaQuery==="min";dr(o).sort(function(b,S){return g?+b-+S:+S-+b}).forEach(function(b){p(o[b],"("+(g?"min":"max")+"-width:"+b+"px)")}),p(r,ql),y()}function u(g){g&&l.destroy()}function p(g,b){var S=matchMedia(b);l.bind(S,"change",y),c.push([g,S])}function y(){var g=i.is(ua),b=n.direction,S=c.reduce(function(A,f){return xi(A,f[1].matches?f[0]:{})},{});Kl(n),m(S),n.destroy?e.destroy(n.destroy==="completely"):g?(u(!0),e.mount()):b!==n.direction&&e.refresh()}function v(g){matchMedia(ql).matches&&(g?xi(n,r):Kl(n,dr(r)))}function m(g,b,S){xi(n,g),b&&xi(Object.getPrototypeOf(n),g),(S||!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",xu=Ia+"Up",bu=Ia+"Down",Jl="rtl",Ea="ttb",Va={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[xu,ka],ArrowRight:[bu,Ra]};function Xm(e,t,n){function i(r,l,c){c=c||n.direction;var d=c===Jl&&!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===Jl?1:-1)}return{resolve:i,orient:o}}var oi="role",xo="tabindex",qm="disabled",Fn="aria-",Pr=Fn+"controls",Su=Fn+"current",Ql=Fn+"selected",Pn=Fn+"label",xl=Fn+"labelledby",wu=Fn+"hidden",bl=Fn+"orientation",gr=Fn+"roledescription",ec=Fn+"live",tc=Fn+"busy",nc=Fn+"atomic",Sl=[oi,xo,qm,Pr,Su,Pn,xl,wu,bl,gr],Xn=Lr+"__",ki="is-",Ga=Lr,ic=Xn+"track",Um=Xn+"list",Ma=Xn+"slide",$u=Ma+"--clone",Km=Ma+"__container",wl=Xn+"arrows",Aa=Xn+"arrow",Cu=Aa+"--prev",Tu=Aa+"--next",Fa=Xn+"pagination",Lu=Fa+"__page",Ym=Xn+"progress",Zm=Ym+"__bar",Jm=Xn+"toggle",Qm=Xn+"spinner",eg=Xn+"sr",tg=ki+"initialized",Yi=ki+"active",Pu=ki+"prev",Iu=ki+"next",_s=ki+"visible",Hs=ki+"loading",Ru=ki+"focus-in",ku=ki+"overflow",ng=[Yi,_s,Pu,Iu,Hs,Ru,ku],ig={slide:Ma,clone:$u,arrows:wl,arrow:Aa,prev:Cu,next:Tu,pagination:Fa,page:Lu,spinner:Qm};function og(e,t){if(Zd(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!cr(n,t);)n=n.parentElement;return n}var rg=5,oc=200,Eu="touchstart mousedown",Xa="touchmove mousemove",qa="touchend touchcancel mouseup click";function ag(e,t,n){var i=tn(e),o=i.on,r=i.bind,l=e.root,c=n.i18n,d={},u=[],p=[],y=[],v,m,g;function b(){w(),G(),f()}function S(){o(an,A),o(an,b),o(gn,f),r(document,Eu+" keydown",function(P){g=P.type==="keydown"},{capture:!0}),r(l,"focusin",function(){ni(l,Ru,!!g)})}function A(P){var M=Sl.concat("style");si(u),ii(l,p),ii(v,y),jn([v,m],M),jn(l,P?M:["style",gr])}function f(){ii(l,p),ii(v,y),p=E(Ga),y=E(ic),Bn(l,p),Bn(v,y),Wt(l,Pn,n.label),Wt(l,xl,n.labelledby)}function w(){v=q("."+ic),m=Tr(v,"."+Um),or(v&&m,"A track/list element is missing."),oa(u,Qd(m,"."+Ma+":not(."+$u+")")),qi({arrows:wl,pagination:Fa,prev:Cu,next:Tu,bar:Zm,toggle:Jm},function(P,M){d[M]=q("."+P)}),ur(d,{root:l,track:v,list:m,slides:u})}function G(){var P=l.id||zm(Lr),M=n.role;l.id=P,v.id=v.id||P+"-track",m.id=m.id||P+"-list",!An(l,oi)&&l.tagName!=="SECTION"&&M&&Wt(l,oi,M),Wt(l,gr,c.carousel),Wt(m,oi,"presentation")}function q(P){var M=nu(l,P);return M&&og(M,"."+Ga)===l?M:void 0}function E(P){return[P+"--"+n.type,P+"--"+n.direction,n.drag&&P+"--draggable",n.isNavigation&&P+"--nav",P===Ga&&Yi]}return ur(d,{setup:b,mount:S,destroy:A})}var To="slide",Oo="loop",Ir="fade";function sg(e,t,n,i){var o=tn(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,b=p.slideFocus,S=d.Direction.resolve,A=An(i,"style"),f=An(i,Pn),w=n>-1,G=Tr(i,"."+Km),q;function E(){w||(i.id=u.id+"-slide"+pl(t+1),Wt(i,oi,g?"tabpanel":"group"),Wt(i,gr,m.slide),Wt(i,Pn,f||Fs(m.slideLabel,[t+1,e.length]))),P()}function P(){c(i,"click",Jt(l,ml,Y)),c(i,"keydown",Jt(l,yu,Y)),r([Wo,vu,Ji],T),r(hl,X),v&&r(li,$)}function M(){q=!0,o.destroy(),ii(i,ng),jn(i,Sl),Wt(i,"style",A),Wt(i,Pn,f||"")}function X(){var R=e.splides.map(function(H){var D=H.splide.Components.Slides.getAt(t);return D?D.slide.id:""}).join(" ");Wt(i,Pn,Fs(m.slideX,(w?n:t)+1)),Wt(i,Pr,R),Wt(i,oi,b?"button":""),b&&jn(i,gr)}function $(){q||T()}function T(){if(!q){var R=e.index;O(),F(),ni(i,Pu,t===R-1),ni(i,Iu,t===R+1)}}function O(){var R=C();R!==Yl(i,Yi)&&(ni(i,Yi,R),Wt(i,Su,y&&R||""),l(R?ru:au,Y))}function F(){var R=j(),H=!R&&(!C()||w);if(e.state.is([Ho,Sr])||Wt(i,wu,H||""),Wt(dl(i,p.focusableNodes||""),xo,H?-1:""),b&&Wt(i,xo,H?-1:0),R!==Yl(i,_s)&&(ni(i,_s,R),l(R?su:lu,Y)),!R&&document.activeElement===i){var D=d.Slides.getAt(e.index);D&&eu(D.slide)}}function L(R,H,D){Mn(D&&G||i,R,H)}function C(){var R=e.index;return R===t||p.cloneStatus&&R===n}function j(){if(e.is(Ir))return C();var R=Tn(d.Elements.track),H=Tn(i),D=S("left",!0),Q=S("right",!0);return ma(R[D])<=mr(H[D])&&ma(H[Q])<=mr(R[Q])}function x(R,H){var D=vn(R-t);return!w&&(p.rewind||e.is(Oo))&&(D=Ci(D,e.length-D)),D<=H}var Y={index:t,slideIndex:n,slide:i,container:G,isClone:w,mount:E,destroy:M,update:T,style:L,isWithin:x};return Y}function lg(e,t,n){var i=tn(e),o=i.on,r=i.emit,l=i.bind,c=t.Elements,d=c.slides,u=c.list,p=[];function y(){v(),o(an,m),o(an,v)}function v(){d.forEach(function(T,O){b(T,O,-1)})}function m(){q(function(T){T.destroy()}),si(p)}function g(){q(function(T){T.update()})}function b(T,O,F){var L=sg(e,O,F,T);L.mount(),p.push(L),p.sort(function(C,j){return C.index-j.index})}function S(T){return T?E(function(O){return!O.isClone}):p}function A(T){var O=t.Controller,F=O.toIndex(T),L=O.hasFocus()?1:n.perPage;return E(function(C){return ra(C.index,F,F+L-1)})}function f(T){return E(T)[0]}function w(T,O){Rn(T,function(F){if($i(F)&&(F=tu(F)),Jd(F)){var L=d[O];L?cl(F,L):Cr(u,F),Bn(F,n.classes.slide),M(F,Jt(r,Co))}}),r(an)}function G(T){Ki(E(T).map(function(O){return O.slide})),r(an)}function q(T,O){S(O).forEach(T)}function E(T){return p.filter(Zd(T)?T:function(O){return $i(T)?cr(O.slide,T):ll($r(T),O.index)})}function P(T,O,F){q(function(L){L.style(T,O,F)})}function M(T,O){var F=dl(T,"img"),L=F.length;L?F.forEach(function(C){l(C,"load error",function(){--L||O()})}):O()}function X(T){return T?d.length:p.length}function $(){return p.length>n.perPage}return{mount:y,destroy:m,update:g,register:b,get:S,getIn:A,getAt:f,add:w,remove:G,forEach:q,filter:E,style:P,getLength:X,isEnough:$}}function cg(e,t,n){var i=tn(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,b,S,A;function f(){w(),r(window,"resize load",Vm(Jt(l,Co))),o([gn,an],w),o(Co,G)}function w(){b=n.direction===Ea,Mn(p,"maxWidth",Ni(n.width)),Mn(y,d("paddingLeft"),q(!1)),Mn(y,d("paddingRight"),q(!0)),G(!0)}function G(Y){var R=Tn(p);(Y||S.width!==R.width||S.height!==R.height)&&(Mn(y,"height",E()),g(d("marginRight"),Ni(n.gap)),g("width",M()),g("height",X(),!0),S=R,l(Ta),A!==(A=x())&&(ni(p,ku,A),l(Bm,A)))}function q(Y){var R=n.padding,H=d(Y?"right":"left");return R&&Ni(R[H]||(lr(R)?0:R))||"0px"}function E(){var Y="";return b&&(Y=P(),or(Y,"height or heightRatio is missing."),Y="calc("+Y+" - "+q(!1)+" - "+q(!0)+")"),Y}function P(){return Ni(n.height||Tn(v).width*n.heightRatio)}function M(){return n.autoWidth?null:Ni(n.fixedWidth)||(b?"":$())}function X(){return Ni(n.fixedHeight)||(b?n.autoHeight?null:$():P())}function $(){var Y=Ni(n.gap);return"calc((100%"+(Y&&" + "+Y)+")/"+(n.perPage||1)+(Y&&" - "+Y)+")"}function T(){return Tn(v)[d("width")]}function O(Y,R){var H=m(Y||0);return H?Tn(H.slide)[d("width")]+(R?0:C()):0}function F(Y,R){var H=m(Y);if(H){var D=Tn(H.slide)[d("right")],Q=Tn(v)[d("left")];return vn(D-Q)+(R?0:C())}return 0}function L(Y){return F(e.length-1)-F(0)+O(0,Y)}function C(){var Y=m(0);return Y&&parseFloat(Mn(Y.slide,d("marginRight")))||0}function j(Y){return parseFloat(Mn(y,d("padding"+(Y?"Right":"Left"))))||0}function x(){return e.is(Ir)||L(!0)>T()}return{mount:f,resize:G,listSize:T,slideSize:O,sliderSize:L,totalSize:F,getPadding:j,isOverflow:x}}var dg=2;function ug(e,t,n){var i=tn(e),o=i.on,r=t.Elements,l=t.Slides,c=t.Direction.resolve,d=[],u;function p(){o(an,y),o([gn,Co],m),(u=S())&&(g(u),t.Layout.resize(!0))}function y(){v(),p()}function v(){Ki(d),si(d),i.destroy()}function m(){var A=S();u!==A&&(u<A||!A)&&i.emit(an)}function g(A){var f=l.get().slice(),w=f.length;if(w){for(;f.length<A;)oa(f,f);oa(f.slice(-A),f.slice(0,A)).forEach(function(G,q){var E=q<A,P=b(G.slide,q);E?cl(P,f[0].slide):Cr(r.list,P),oa(d,P),l.register(P,q-A+(E?0:w),G.index)})}}function b(A,f){var w=A.cloneNode(!0);return Bn(w,n.classes.clone),w.id=e.root.id+"-clone"+pl(f+1),w}function S(){var A=n.clones;if(!e.is(Oo))A=0;else if(wr(A)){var f=n[c("fixedWidth")]&&t.Layout.slideSize(0),w=f&&mr(Tn(r.track)[c("width")]/f);A=w||n[c("autoWidth")]&&e.length||n.perPage*dg}return A}return{mount:p,destroy:v}}function pg(e,t,n){var i=tn(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,b=m.orient,S=t.Elements,A=S.list,f=S.track,w;function G(){w=t.Transition,o([Ri,Ta,gn,an],q)}function q(){t.Controller.isBusy()||(t.Scroll.cancel(),P(e.index),t.Slides.update())}function E(H,D,Q,ae){H!==D&&Y(H>Q)&&(T(),M($(L(),H>Q),!0)),l(Ho),r(li,D,Q,H),w.start(D,function(){l($o),r(Wo,D,Q,H),ae&&ae()})}function P(H){M(F(H,!0))}function M(H,D){if(!e.is(Ir)){var Q=D?H:X(H);Mn(A,"transform","translate"+g("X")+"("+Q+"px)"),H!==Q&&r(vu)}}function X(H){if(e.is(Oo)){var D=O(H),Q=D>t.Controller.getEnd(),ae=D<0;(ae||Q)&&(H=$(H,Q))}return H}function $(H,D){var Q=H-x(D),ae=v();return H-=b(ae*(mr(vn(Q)/ae)||1))*(D?1:-1),H}function T(){M(L(),!0),w.cancel()}function O(H){for(var D=t.Slides.get(),Q=0,ae=1/0,z=0;z<D.length;z++){var re=D[z].index,_=vn(F(re,!0)-H);if(_<=ae)ae=_,Q=re;else break}return Q}function F(H,D){var Q=b(p(H-1)-j(H));return D?C(Q):Q}function L(){var H=g("left");return Tn(A)[H]-Tn(f)[H]+b(u(!1))}function C(H){return n.trimSpace&&e.is(To)&&(H=lo(H,0,b(v(!0)-y()))),H}function j(H){var D=n.focus;return D==="center"?(y()-d(H,!0))/2:+D*d(H)||0}function x(H){return F(H?t.Controller.getEnd():0,!!n.trimSpace)}function Y(H){var D=b($(L(),H));return H?D>=0:D<=A[g("scrollWidth")]-Tn(f)[g("width")]}function R(H,D){D=wr(D)?L():D;var Q=H!==!0&&b(D)<b(x(!1)),ae=H!==!1&&b(D)>b(x(!0));return Q||ae}return{mount:G,move:E,jump:P,translate:M,shift:$,cancel:T,toIndex:O,toPosition:F,getPosition:L,getLimit:x,exceededLimit:R,reposition:q}}function mg(e,t,n){var i=tn(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),b=e.is(To),S=Jt(L,!1),A=Jt(L,!0),f=n.start||0,w,G=f,q,E,P;function M(){X(),o([gn,an,ga],X),o(Ta,$)}function X(){q=v(!0),E=n.perMove,P=n.perPage,w=Y();var _=lo(f,0,m?w:q-1);_!==f&&(f=_,l.reposition())}function $(){w!==Y()&&r(ga)}function T(_,le,te){if(!re()){var fe=F(_),Pe=x(fe);Pe>-1&&(le||Pe!==f)&&(Q(Pe),l.move(fe,Pe,G,te))}}function O(_,le,te,fe){t.Scroll.scroll(_,le,te,function(){var Pe=x(l.toIndex(c()));Q(m?Ci(Pe,w):Pe),fe&&fe()})}function F(_){var le=f;if($i(_)){var te=_.match(/([+\-<>])(\d+)?/)||[],fe=te[1],Pe=te[2];fe==="+"||fe==="-"?le=C(f+ +(""+fe+(+Pe||1)),f):fe===">"?le=Pe?R(+Pe):S(!0):fe==="<"&&(le=A(!0))}else le=g?_:lo(_,0,w);return le}function L(_,le){var te=E||(z()?1:P),fe=C(f+te*(_?-1:1),f,!(E||z()));return fe===-1&&b&&!iu(c(),d(!_),1)?_?0:w:le?fe:x(fe)}function C(_,le,te){if(y()||z()){var fe=j(_);fe!==_&&(le=_,_=fe,te=!1),_<0||_>w?!E&&(ra(0,_,le,!0)||ra(w,le,_,!0))?_=R(H(_)):g?_=te?_<0?-(q%P||P):q:_:n.rewind?_=_<0?w:0:_=-1:te&&_!==le&&(_=R(H(le)+(_<le?-1:1)))}else _=-1;return _}function j(_){if(b&&n.trimSpace==="move"&&_!==f)for(var le=c();le===u(_,!0)&&ra(_,0,e.length-1,!n.rewind);)_<f?--_:++_;return _}function x(_){return g?(_+q)%q||0:_}function Y(){for(var _=q-(z()||g&&E?1:P);m&&_-- >0;)if(u(q-1,!0)!==u(_,!0)){_++;break}return lo(_,0,q-1)}function R(_){return lo(z()?_:P*_,0,w)}function H(_){return z()?Ci(_,w):ma((_>=w?q-1:_)/P)}function D(_){var le=l.toIndex(_);return b?lo(le,0,w):le}function Q(_){_!==f&&(G=f,f=_)}function ae(_){return _?G:f}function z(){return!wr(n.focus)||n.isNavigation}function re(){return e.state.is([Ho,Sr])&&!!n.waitForTransition}return{mount:M,go:T,scroll:O,getNext:S,getPrev:A,getAdjacent:L,getEnd:Y,setIndex:Q,getIndex:ae,toIndex:R,toPage:H,toDest:D,hasFocus:z,isBusy:re}}var gg="http://www.w3.org/2000/svg",hg="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 fg(e,t,n){var i=tn(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,b=u.next,S,A,f={};function w(){q(),o(gn,G)}function G(){E(),w()}function q(){var O=n.arrows;O&&!(g&&b)&&X(),g&&b&&(ur(f,{prev:g,next:b}),pr(m,O?"":"none"),Bn(m,A=wl+"--"+n.direction),O&&(P(),T(),Wt([g,b],Pr,v.id),l(pu,g,b)))}function E(){i.destroy(),ii(m,A),S?(Ki(y?[g,b]:m),g=b=null):jn([g,b],Sl)}function P(){o([Ri,Wo,an,Ji,ga],T),r(b,"click",Jt(M,">")),r(g,"click",Jt(M,"<"))}function M(O){p.go(O,!0)}function X(){m=y||vo("div",c.arrows),g=$(!0),b=$(!1),S=!0,Cr(m,[g,b]),!y&&cl(m,v)}function $(O){var F='<button class="'+c.arrow+" "+(O?c.prev:c.next)+'" type="button"><svg xmlns="'+gg+'" viewBox="0 0 '+Ar+" "+Ar+'" width="'+Ar+'" height="'+Ar+'" focusable="false"><path d="'+(n.arrowPath||hg)+'" />';return tu(F)}function T(){if(g&&b){var O=e.index,F=p.getPrev(),L=p.getNext(),C=F>-1&&O<F?d.last:d.prev,j=L>-1&&O>L?d.first:d.next;g.disabled=F<0,b.disabled=L<0,Wt(g,Pn,C),Wt(b,Pn,j),l(mu,g,b,F,L)}}return{arrows:f,mount:w,destroy:E,update:T}}var yg=ul+"-interval";function vg(e,t,n){var i=tn(e),o=i.on,r=i.bind,l=i.emit,c=Pa(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,b,S=m==="pause";function A(){m&&(f(),v&&Wt(v,Pr,u.track.id),S||w(),E())}function f(){n.pauseOnHover&&r(y,"mouseenter mouseleave",function(X){g=X.type==="mouseenter",q()}),n.pauseOnFocus&&r(y,"focusin focusout",function(X){b=X.type==="focusin",q()}),v&&r(v,"click",function(){S?w():G(!0)}),o([li,La,an],c.rewind),o(li,M)}function w(){d()&&t.Slides.isEnough()&&(c.start(!n.resetProgress),b=g=S=!1,E(),l(fl))}function G(X){X===void 0&&(X=!0),S=!!X,E(),d()||(c.pause(),l(yl))}function q(){S||(g||b?G(!1):w())}function E(){v&&(ni(v,Yi,!S),Wt(v,Pn,n.i18n[S?"play":"pause"]))}function P(X){var $=u.bar;$&&Mn($,"width",X*100+"%"),l(fu,X)}function M(X){var $=t.Slides.getAt(X);c.set($&&+An($.slide,yg)||n.interval)}return{mount:A,destroy:c.cancel,play:w,pause:G,isPaused:d}}function xg(e,t,n){var i=tn(e),o=i.on;function r(){n.cover&&(o(vl,Jt(c,!0)),o([Ri,gn,an],Jt(l,!0)))}function l(d){t.Slides.forEach(function(u){var p=Tr(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),pr(u,d?"none":"")}return{mount:r,destroy:Jt(l,!1)}}var bg=10,Sg=600,wg=.6,$g=1.5,Cg=800;function Tg(e,t,n){var i=tn(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,b=1;function S(){o(li,G),o([gn,an],q)}function A(P,M,X,$,T){var O=d();if(G(),X&&(!v||!p())){var F=t.Layout.sliderSize(),L=As(P)*F*ma(vn(P)/F)||0;P=c.toPosition(t.Controller.toDest(P%F))+L}var C=iu(O,P,1);b=1,M=C?0:M||pa(vn(P-O)/$g,Cg),g=$,m=Pa(M,f,Jt(w,O,P,T),1),l(Sr),r(La),m.start()}function f(){l($o),g&&g(),r(Ji)}function w(P,M,X,$){var T=d(),O=P+(M-P)*E($),F=(O-T)*b;y(T+F),v&&!X&&p()&&(b*=wg,vn(F)<bg&&A(u(p(!0)),Sg,!1,g,!0))}function G(){m&&m.cancel()}function q(){m&&!m.isPaused()&&(G(),f())}function E(P){var M=n.easingFunc;return M?M(P):1-Math.pow(1-P,4)}return{mount:S,destroy:G,scroll:A,cancel:q}}var co={passive:!1,capture:!0};function Lg(e,t,n){var i=tn(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,b=g.resolve,S=g.orient,A=u.getPosition,f=u.exceededLimit,w,G,q,E,P,M=!1,X,$,T;function O(){l(v,Xa,Es,co),l(v,qa,Es,co),l(v,Eu,L,co),l(v,"click",x,{capture:!0}),l(v,"dragstart",ei),o([Ri,gn],F)}function F(){var K=n.drag;ue(!K),E=K==="free"}function L(K){if(X=!1,!$){var se=Pe(K);fe(K.target)&&(se||!K.button)&&(y.isBusy()?ei(K,!0):(T=se?v:window,P=d.is([Ho,Sr]),q=null,l(T,Xa,C,co),l(T,qa,j,co),u.cancel(),p.cancel(),Y(K)))}}function C(K){if(d.is(ia)||(d.set(ia),r(cu)),K.cancelable)if(P){u.translate(w+te(z(K)));var se=re(K)>oc,de=M!==(M=f());(se||de)&&Y(K),X=!0,r(du),ei(K)}else D(K)&&(P=H(K),ei(K))}function j(K){d.is(ia)&&(d.set($o),r(uu)),P&&(R(K),ei(K)),c(T,Xa,C),c(T,qa,j),P=!1}function x(K){!$&&X&&ei(K,!0)}function Y(K){q=G,G=K,w=A()}function R(K){var se=Q(K),de=ae(se),ve=n.rewind&&n.rewindByDrag;m(!1),E?y.scroll(de,0,n.snap):e.is(Ir)?y.go(S(As(se))<0?ve?"<":"-":ve?">":"+"):e.is(To)&&M&&ve?y.go(f(!0)?">":"<"):y.go(y.toDest(de),!0),m(!0)}function H(K){var se=n.dragMinThreshold,de=lr(se),ve=de&&se.mouse||0,$e=(de?se.touch:+se)||10;return vn(z(K))>(Pe(K)?$e:ve)}function D(K){return vn(z(K))>vn(z(K,!0))}function Q(K){if(e.is(Oo)||!M){var se=re(K);if(se&&se<oc)return z(K)/se}return 0}function ae(K){return A()+As(K)*Ci(vn(K)*(n.flickPower||600),E?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function z(K,se){return le(K,se)-le(_(K),se)}function re(K){return Ms(K)-Ms(_(K))}function _(K){return G===K&&q||G}function le(K,se){return(Pe(K)?K.changedTouches[0]:K)["page"+b(se?"Y":"X")]}function te(K){return K/(M&&e.is(To)?rg:1)}function fe(K){var se=n.noDrag;return!cr(K,"."+Lu+", ."+Aa)&&(!se||!cr(K,se))}function Pe(K){return typeof TouchEvent<"u"&&K instanceof TouchEvent}function xe(){return P}function ue(K){$=K}return{mount:O,disable:ue,isDragging:xe}}var Pg={Spacebar:" ",Right:ka,Left:Ra,Up:xu,Down:bu};function $l(e){return e=$i(e)?e:e.key,Pg[e]||e}var rc="keydown";function Ig(e,t,n){var i=tn(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(li,b)}function v(){var A=n.keyboard;A&&(u=A==="global"?window:c,r(u,rc,S))}function m(){l(u,rc)}function g(A){p=A}function b(){var A=p;p=!0,Yd(function(){p=A})}function S(A){if(!p){var f=$l(A);f===d(Ra)?e.go("<"):f===d(ka)&&e.go(">")}}return{mount:y,destroy:m,disable:g}}var rr=ul+"-lazy",aa=rr+"-srcset",Rg="["+rr+"], ["+aa+"]";function kg(e,t,n){var i=tn(e),o=i.on,r=i.off,l=i.bind,c=i.emit,d=n.lazyLoad==="sequential",u=[Wo,Ji],p=[];function y(){n.lazyLoad&&(v(),o(an,v))}function v(){si(p),m(),d?A():(r(u),o(u,g),g())}function m(){t.Slides.forEach(function(f){dl(f.slide,Rg).forEach(function(w){var G=An(w,rr),q=An(w,aa);if(G!==w.src||q!==w.srcset){var E=n.classes.spinner,P=w.parentElement,M=Tr(P,"."+E)||vo("span",E,P);p.push([w,f,M]),w.src||pr(w,"none")}})})}function g(){p=p.filter(function(f){var w=n.perPage*((n.preloadPages||1)+1)-1;return f[1].isWithin(e.index,w)?b(f):!0}),p.length||r(u)}function b(f){var w=f[0];Bn(f[1].slide,Hs),l(w,"load error",Jt(S,f)),Wt(w,"src",An(w,rr)),Wt(w,"srcset",An(w,aa)),jn(w,rr),jn(w,aa)}function S(f,w){var G=f[0],q=f[1];ii(q.slide,Hs),w.type!=="error"&&(Ki(f[2]),pr(G,""),c(vl,G,q),c(Co)),d&&A()}function A(){p.length&&b(p.shift())}return{mount:y,destroy:Jt(si,p),check:g}}function Eg(e,t,n){var i=tn(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,b=[],S,A;function f(){w(),o([gn,an,ga],f);var $=n.pagination;g&&pr(g,$?"":"none"),$&&(o([li,La,Ji],X),G(),X(),r(gu,{list:S,items:b},M(e.index)))}function w(){S&&(Ki(g?Ii(S.children):S),ii(S,A),si(b),S=null),i.destroy()}function G(){var $=e.length,T=n.classes,O=n.i18n,F=n.perPage,L=p()?u.getEnd()+1:mr($/F);S=g||vo("ul",T.pagination,d.track.parentElement),Bn(S,A=Fa+"--"+P()),Wt(S,oi,"tablist"),Wt(S,Pn,O.select),Wt(S,bl,P()===Ea?"vertical":"");for(var C=0;C<L;C++){var j=vo("li",null,S),x=vo("button",{class:T.page,type:"button"},j),Y=c.getIn(C).map(function(H){return H.slide.id}),R=!p()&&F>1?O.pageX:O.slideX;l(x,"click",Jt(q,C)),n.paginationKeyboard&&l(x,"keydown",Jt(E,C)),Wt(j,oi,"presentation"),Wt(x,oi,"tab"),Wt(x,Pr,Y.join(" ")),Wt(x,Pn,Fs(R,C+1)),Wt(x,xo,-1),b.push({li:j,button:x,page:C})}}function q($){v(">"+$,!0)}function E($,T){var O=b.length,F=$l(T),L=P(),C=-1;F===m(ka,!1,L)?C=++$%O:F===m(Ra,!1,L)?C=(--$+O)%O:F==="Home"?C=0:F==="End"&&(C=O-1);var j=b[C];j&&(eu(j.button),v(">"+C),ei(T,!0))}function P(){return n.paginationDirection||n.direction}function M($){return b[u.toPage($)]}function X(){var $=M(y(!0)),T=M(y());if($){var O=$.button;ii(O,Yi),jn(O,Ql),Wt(O,xo,-1)}if(T){var F=T.button;Bn(F,Yi),Wt(F,Ql,!0),Wt(F,xo,"")}r(hu,{list:S,items:b},$,T)}return{items:b,mount:f,destroy:w,getAt:M,update:X}}var Mg=[" ","Enter"];function Ag(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()}),si(r)}function d(){c(),l()}function u(g,b){var S=tn(g);S.on(li,function(A,f,w){b.go(b.is(Oo)?w:A)}),r.push(S)}function p(){var g=tn(e),b=g.on;b(ml,v),b(yu,m),b([Ri,gn],y),r.push(g),g.emit(hl,e.splides)}function y(){Wt(t.Elements.list,bl,n.direction===Ea?"vertical":"")}function v(g){e.go(g.index)}function m(g,b){ll(Mg,$l(b))&&(v(g),ei(b))}return{setup:Jt(t.Media.set,{slideFocus:wr(o)?i:o},!0),mount:l,destroy:c,remount:d}}function Fg(e,t,n){var i=tn(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)&&ei(u)}}function d(u){return!n.releaseWheel||e.state.is(Ho)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var Ng=90;function _g(e,t,n){var i=tn(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,c=vo("span",eg),d=Pa(Ng,Jt(p,!1));function u(){l&&(v(!t.Autoplay.isPaused()),Wt(r,nc,!0),c.textContent="…",o(fl,Jt(v,!0)),o(yl,Jt(v,!1)),o([Wo,Ji],Jt(p,!0)))}function p(m){Wt(r,tc,m),m?(Cr(r,c),d.start()):(Ki(c),d.cancel())}function y(){jn(r,[ec,nc,tc]),Ki(c)}function v(m){l&&Wt(r,ec,m?"off":"polite")}return{mount:u,disable:v,destroy:y}}var Hg=Object.freeze({__proto__:null,Media:Gm,Direction:Xm,Elements:ag,Slides:lg,Layout:cg,Clones:ug,Move:pg,Controller:mg,Arrows:fg,Autoplay:vg,Cover:xg,Scroll:Tg,Drag:Lg,Keyboard:Ig,LazyLoad:kg,Pagination:Eg,Sync:Ag,Wheel:Fg,Live:_g}),Wg={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"},Og={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:ig,i18n:Wg,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Dg(e,t,n){var i=t.Slides;function o(){tn(e).on([Ri,an],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),Yd(d)}return{mount:o,start:l,cancel:Es}}function zg(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(){tn(e).bind(l,"transitionend",function(m){m.target===l&&d&&(y(),d())})}function p(m,g){var b=i.toPosition(m,!0),S=i.getPosition(),A=v(m);vn(b-S)>=1&&A>=1?n.useScroll?r.scroll(b,A,!1,g):(c("transform "+A+"ms "+n.easing),i.translate(b,!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 b=o.getIndex(!0),S=o.getEnd();if(b===0&&m>=S||b>=S&&m===0)return g}return n.speed}return{mount:u,start:p,cancel:y}}var Bg=(function(){function e(n,i){this.event=tn(),this.Components={},this.state=jm(mo),this.splides=[],this._o={},this._E={};var o=$i(n)?nu(document,n):n;or(o,o+" is invalid."),this.root=o,i=xi({label:An(o,Pn)||"",labelledby:An(o,xl)||""},Og,e.defaults,i||{});try{xi(i,JSON.parse(An(o,ul)))}catch{or(!1,"Invalid JSON")}this._o=Object.create(xi({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,c=this.Components;or(l.is([mo,ua]),"Already mounted!"),l.set(mo),this._C=c,this._T=o||this._T||(this.is(Ir)?Dg:zg),this._E=i||this._E;var d=ur({},Hg,this._E,{Transition:this._T});return qi(d,function(u,p){var y=u(r,c,r._o);c[p]=y,y.setup&&y.setup()}),qi(c,function(u){u.mount&&u.mount()}),this.emit(Ri),Bn(this.root,tg),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(Ii(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(an),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,r=this.state;return r.is(mo)?tn(this).on(Ns,this.destroy.bind(this,i)):(qi(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(gl),o.destroy(),i&&si(this.splides),r.set(ua)),this},Wm(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=Bg;Cl.defaults={};Cl.STATES=Dm;var ac=[[Ri,"onMounted"],[Ns,"onReady"],[li,"onMove"],[Wo,"onMoved"],[ml,"onClick"],[ru,"onActive"],[au,"onInactive"],[su,"onVisible"],[lu,"onHidden"],[an,"onRefresh"],[gn,"onUpdated"],[Co,"onResize"],[Ta,"onResized"],[cu,"onDrag"],[du,"onDragging"],[uu,"onDragged"],[La,"onScroll"],[Ji,"onScrolled"],[gl,"onDestroy"],[pu,"onArrowsMounted"],[mu,"onArrowsUpdated"],[gu,"onPaginationMounted"],[hu,"onPaginationUpdated"],[hl,"onNavigationMounted"],[fl,"onAutoplayPlay"],[fu,"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 jg(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function Vg(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 Vg(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 Gg=({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();jg(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){ac.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",...ac.map(r=>r[1])])},n?s.createElement(Gg,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"),Tt=require("classnames"),_=require("./panelAvailability-D8c7cdbu.js"),Gn=require("react-dom");function qp(e){return e.type==="object"&&e.version===1}const Up="ControlSlider-module__wrapper___sHEkd",Kp="ControlSlider-module__hoverArrow___A-dOH",Yp="ControlSlider-module__sliderItem___QQSkR",Zp="ControlSlider-module__sliderImage___9hRl-",Jp="ControlSlider-module__arrow___05ghY",Qp="ControlSlider-module__arrowVertical___tBfVN",em="ControlSlider-module__nextArrow___-30Yc",tm="ControlSlider-module__arrowInner___aEra3",nm="ControlSlider-module__arrowIcon___S4ztF",im="ControlSlider-module__arrowImg___2dwJW",om="ControlSlider-module__mirror___brd6U",rm="ControlSlider-module__pagination___bicLF",am="ControlSlider-module__paginationInner___bT-P-",sm="ControlSlider-module__paginationVertical___zYqKw",lm="ControlSlider-module__paginationItem___nTRbk",cm="ControlSlider-module__dot___p1Qun",dm="ControlSlider-module__activeDot___LHFaj",um="ControlSlider-module__paginationInsideBottom___R3FWn",pm="ControlSlider-module__paginationInsideTop___V-qb-",mm="ControlSlider-module__paginationOutsideBottom___14w8D",gm="ControlSlider-module__paginationOutsideTop___SCLqB",hm="ControlSlider-module__paginationInsideLeft___yOBRZ",fm="ControlSlider-module__paginationInsideRight___Rtt3o",ym="ControlSlider-module__paginationOutsideLeft___lahaw",vm="ControlSlider-module__paginationOutsideRight___EtuQa",xm="ControlSlider-module__imgWrapper___UjEgB",bm="ControlSlider-module__captionBlock___dJ6-j",Sm="ControlSlider-module__captionTextWrapper___HFlpf",wm="ControlSlider-module__captionText___uGBVc",$m="ControlSlider-module__active___WZK4G",Cm="ControlSlider-module__withPointerEvents___t-18M",Tm="ControlSlider-module__topLeftAlignment___zjnGM",Lm="ControlSlider-module__topCenterAlignment___gD1xW",Pm="ControlSlider-module__topRightAlignment___NMapS",Im="ControlSlider-module__middleLeftAlignment___OnUrY",Rm="ControlSlider-module__middleCenterAlignment___Tdkl0",km="ControlSlider-module__middleRightAlignment___wEbfX",Em="ControlSlider-module__bottomLeftAlignment___cTP2-",Mm="ControlSlider-module__bottomCenterAlignment___c54fB",Am="ControlSlider-module__bottomRightAlignment___kEwrz",Fm="ControlSlider-module__clickOverlay___DZA28",Nm="ControlSlider-module__contain___pLyq7",_m="ControlSlider-module__cover___KdDat",Ct={wrapper:Up,hoverArrow:Kp,sliderItem:Yp,sliderImage:Zp,arrow:Jp,arrowVertical:Qp,nextArrow:em,arrowInner:tm,arrowIcon:nm,arrowImg:im,mirror:om,pagination:rm,paginationInner:am,paginationVertical:sm,paginationItem:lm,dot:cm,activeDot:dm,paginationInsideBottom:um,paginationInsideTop:pm,paginationOutsideBottom:mm,paginationOutsideTop:gm,paginationInsideLeft:hm,paginationInsideRight:fm,paginationOutsideLeft:ym,paginationOutsideRight:vm,imgWrapper:xm,captionBlock:bm,captionTextWrapper:Sm,captionText:wm,active:$m,withPointerEvents:Cm,topLeftAlignment:Tm,topCenterAlignment:Lm,topRightAlignment:Pm,middleLeftAlignment:Im,middleCenterAlignment:Rm,middleRightAlignment:km,bottomLeftAlignment:Em,bottomCenterAlignment:Mm,bottomRightAlignment:Am,clickOverlay:Fm,contain:Nm,cover:_m};function Hm(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 Wm(e,t,n){return t&&Hm(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var ql="(prefers-reduced-motion: reduce)",mo=1,Om=2,$o=3,Ho=4,Sr=5,ia=6,ua=7,Dm={CREATED:mo,MOUNTED:Om,IDLE:$o,MOVING:Ho,SCROLLING:Sr,DRAGGING:ia,DESTROYED:ua};function si(e){e.length=0}function Ii(e,t,n){return Array.prototype.slice.call(e,t,n)}function Jt(e){return e.bind.apply(e,[null].concat(Ii(arguments,1)))}var Yd=setTimeout,Es=function(){};function Ul(e){return requestAnimationFrame(e)}function Ca(e,t){return typeof t===e}function lr(e){return!sl(e)&&Ca("object",e)}var al=Array.isArray,Zd=Jt(Ca,"function"),$i=Jt(Ca,"string"),wr=Jt(Ca,"undefined");function sl(e){return e===null}function Jd(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function $r(e){return al(e)?e:[e]}function Rn(e,t){$r(e).forEach(t)}function ll(e,t){return e.indexOf(t)>-1}function oa(e,t){return e.push.apply(e,$r(t)),e}function ni(e,t,n){e&&Rn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Bn(e,t){ni(e,$i(t)?t.split(" "):t,!0)}function Cr(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 cr(e,t){return Jd(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Qd(e,t){var n=e?Ii(e.children):[];return t?n.filter(function(i){return cr(i,t)}):n}function Tr(e,t){return t?Qd(e,t)[0]:e.firstElementChild}var dr=Object.keys;function qi(e,t,n){return e&&(n?dr(e).reverse():dr(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function ur(e){return Ii(arguments,1).forEach(function(t){qi(t,function(n,i){e[i]=t[i]})}),e}function xi(e){return Ii(arguments,1).forEach(function(t){qi(t,function(n,i){al(n)?e[i]=n.slice():lr(n)?e[i]=xi({},lr(e[i])?e[i]:{},n):e[i]=n})}),e}function Kl(e,t){Rn(t||dr(e),function(n){delete e[n]})}function jn(e,t){Rn(e,function(n){Rn(t,function(i){n&&n.removeAttribute(i)})})}function Wt(e,t,n){lr(t)?qi(t,function(i,o){Wt(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&&($i(t)?Bn(i,t):Wt(i,t)),n&&Cr(n,i),i}function Mn(e,t,n){if(wr(n))return getComputedStyle(e)[t];sl(n)||(e.style[t]=""+n)}function pr(e,t){Mn(e,"display",t)}function eu(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function An(e,t){return e.getAttribute(t)}function Yl(e,t){return e&&e.classList.contains(t)}function Tn(e){return e.getBoundingClientRect()}function Ki(e){Rn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function tu(e){return Tr(new DOMParser().parseFromString(e,"text/html").body)}function ei(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function nu(e,t){return e&&e.querySelector(t)}function dl(e,t){return t?Ii(e.querySelectorAll(t)):[]}function ii(e,t){ni(e,t,!1)}function Ms(e){return e.timeStamp}function Ni(e){return $i(e)?e:e?e+"px":""}var Lr="splide",ul="data-"+Lr;function or(e,t){if(!e)throw new Error("["+Lr+"] "+(t||""))}var Ci=Math.min,pa=Math.max,ma=Math.floor,mr=Math.ceil,vn=Math.abs;function iu(e,t,n){return vn(e-t)<n}function ra(e,t,n,i){var o=Ci(t,n),r=pa(t,n);return i?o<e&&e<r:o<=e&&e<=r}function lo(e,t,n){var i=Ci(t,n),o=pa(t,n);return Ci(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 Zl={};function zm(e){return""+e+pl(Zl[e]=(Zl[e]||0)+1)}function ou(){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]()}),si(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var Ri="mounted",Ns="ready",li="move",Wo="moved",ml="click",ru="active",au="inactive",su="visible",lu="hidden",an="refresh",gn="updated",Co="resize",Ta="resized",cu="drag",du="dragging",uu="dragged",La="scroll",Ji="scrolled",Bm="overflow",gl="destroy",pu="arrows:mounted",mu="arrows:updated",gu="pagination:mounted",hu="pagination:updated",hl="navigation:mounted",fl="autoplay:play",fu="autoplay:playing",yl="autoplay:pause",vl="lazyload:loaded",yu="sk",vu="sh",ga="ei";function tn(e){var t=e?e.event.bus:document.createDocumentFragment(),n=ou();function i(r,l){n.bind(t,$r(r).join(" "),function(c){l.apply(l,al(c.detail)?c.detail:[])})}function o(r){n.dispatch(t,r,Ii(arguments,1))}return e&&e.event.on(gl,n.destroy),ur(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?Ci((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return v();c=Ul(p)}}function y(A){A||g(),r=o()-(A?l*e:0),d=!1,c=Ul(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 b(A){e=A}function S(){return d}return{start:y,rewind:m,pause:v,cancel:g,set:b,isPaused:S}}function jm(e){var t=e;function n(o){t=o}function i(o){return ll($r(o),t)}return{set:n,is:i}}function Vm(e,t){var n=Pa(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Gm(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=ou(),c=[];function d(){var g=n.mediaQuery==="min";dr(o).sort(function(b,S){return g?+b-+S:+S-+b}).forEach(function(b){p(o[b],"("+(g?"min":"max")+"-width:"+b+"px)")}),p(r,ql),y()}function u(g){g&&l.destroy()}function p(g,b){var S=matchMedia(b);l.bind(S,"change",y),c.push([g,S])}function y(){var g=i.is(ua),b=n.direction,S=c.reduce(function(A,f){return xi(A,f[1].matches?f[0]:{})},{});Kl(n),m(S),n.destroy?e.destroy(n.destroy==="completely"):g?(u(!0),e.mount()):b!==n.direction&&e.refresh()}function v(g){matchMedia(ql).matches&&(g?xi(n,r):Kl(n,dr(r)))}function m(g,b,S){xi(n,g),b&&xi(Object.getPrototypeOf(n),g),(S||!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",xu=Ia+"Up",bu=Ia+"Down",Jl="rtl",Ea="ttb",Va={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[xu,ka],ArrowRight:[bu,Ra]};function Xm(e,t,n){function i(r,l,c){c=c||n.direction;var d=c===Jl&&!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===Jl?1:-1)}return{resolve:i,orient:o}}var oi="role",xo="tabindex",qm="disabled",Fn="aria-",Pr=Fn+"controls",Su=Fn+"current",Ql=Fn+"selected",Pn=Fn+"label",xl=Fn+"labelledby",wu=Fn+"hidden",bl=Fn+"orientation",gr=Fn+"roledescription",ec=Fn+"live",tc=Fn+"busy",nc=Fn+"atomic",Sl=[oi,xo,qm,Pr,Su,Pn,xl,wu,bl,gr],Xn=Lr+"__",ki="is-",Ga=Lr,ic=Xn+"track",Um=Xn+"list",Ma=Xn+"slide",$u=Ma+"--clone",Km=Ma+"__container",wl=Xn+"arrows",Aa=Xn+"arrow",Cu=Aa+"--prev",Tu=Aa+"--next",Fa=Xn+"pagination",Lu=Fa+"__page",Ym=Xn+"progress",Zm=Ym+"__bar",Jm=Xn+"toggle",Qm=Xn+"spinner",eg=Xn+"sr",tg=ki+"initialized",Yi=ki+"active",Pu=ki+"prev",Iu=ki+"next",_s=ki+"visible",Hs=ki+"loading",Ru=ki+"focus-in",ku=ki+"overflow",ng=[Yi,_s,Pu,Iu,Hs,Ru,ku],ig={slide:Ma,clone:$u,arrows:wl,arrow:Aa,prev:Cu,next:Tu,pagination:Fa,page:Lu,spinner:Qm};function og(e,t){if(Zd(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!cr(n,t);)n=n.parentElement;return n}var rg=5,oc=200,Eu="touchstart mousedown",Xa="touchmove mousemove",qa="touchend touchcancel mouseup click";function ag(e,t,n){var i=tn(e),o=i.on,r=i.bind,l=e.root,c=n.i18n,d={},u=[],p=[],y=[],v,m,g;function b(){w(),G(),f()}function S(){o(an,A),o(an,b),o(gn,f),r(document,Eu+" keydown",function(P){g=P.type==="keydown"},{capture:!0}),r(l,"focusin",function(){ni(l,Ru,!!g)})}function A(P){var M=Sl.concat("style");si(u),ii(l,p),ii(v,y),jn([v,m],M),jn(l,P?M:["style",gr])}function f(){ii(l,p),ii(v,y),p=E(Ga),y=E(ic),Bn(l,p),Bn(v,y),Wt(l,Pn,n.label),Wt(l,xl,n.labelledby)}function w(){v=q("."+ic),m=Tr(v,"."+Um),or(v&&m,"A track/list element is missing."),oa(u,Qd(m,"."+Ma+":not(."+$u+")")),qi({arrows:wl,pagination:Fa,prev:Cu,next:Tu,bar:Zm,toggle:Jm},function(P,M){d[M]=q("."+P)}),ur(d,{root:l,track:v,list:m,slides:u})}function G(){var P=l.id||zm(Lr),M=n.role;l.id=P,v.id=v.id||P+"-track",m.id=m.id||P+"-list",!An(l,oi)&&l.tagName!=="SECTION"&&M&&Wt(l,oi,M),Wt(l,gr,c.carousel),Wt(m,oi,"presentation")}function q(P){var M=nu(l,P);return M&&og(M,"."+Ga)===l?M:void 0}function E(P){return[P+"--"+n.type,P+"--"+n.direction,n.drag&&P+"--draggable",n.isNavigation&&P+"--nav",P===Ga&&Yi]}return ur(d,{setup:b,mount:S,destroy:A})}var To="slide",Oo="loop",Ir="fade";function sg(e,t,n,i){var o=tn(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,b=p.slideFocus,S=d.Direction.resolve,A=An(i,"style"),f=An(i,Pn),w=n>-1,G=Tr(i,"."+Km),q;function E(){w||(i.id=u.id+"-slide"+pl(t+1),Wt(i,oi,g?"tabpanel":"group"),Wt(i,gr,m.slide),Wt(i,Pn,f||Fs(m.slideLabel,[t+1,e.length]))),P()}function P(){c(i,"click",Jt(l,ml,Y)),c(i,"keydown",Jt(l,yu,Y)),r([Wo,vu,Ji],T),r(hl,X),v&&r(li,$)}function M(){q=!0,o.destroy(),ii(i,ng),jn(i,Sl),Wt(i,"style",A),Wt(i,Pn,f||"")}function X(){var R=e.splides.map(function(H){var D=H.splide.Components.Slides.getAt(t);return D?D.slide.id:""}).join(" ");Wt(i,Pn,Fs(m.slideX,(w?n:t)+1)),Wt(i,Pr,R),Wt(i,oi,b?"button":""),b&&jn(i,gr)}function $(){q||T()}function T(){if(!q){var R=e.index;O(),N(),ni(i,Pu,t===R-1),ni(i,Iu,t===R+1)}}function O(){var R=C();R!==Yl(i,Yi)&&(ni(i,Yi,R),Wt(i,Su,y&&R||""),l(R?ru:au,Y))}function N(){var R=j(),H=!R&&(!C()||w);if(e.state.is([Ho,Sr])||Wt(i,wu,H||""),Wt(dl(i,p.focusableNodes||""),xo,H?-1:""),b&&Wt(i,xo,H?-1:0),R!==Yl(i,_s)&&(ni(i,_s,R),l(R?su:lu,Y)),!R&&document.activeElement===i){var D=d.Slides.getAt(e.index);D&&eu(D.slide)}}function L(R,H,D){Mn(D&&G||i,R,H)}function C(){var R=e.index;return R===t||p.cloneStatus&&R===n}function j(){if(e.is(Ir))return C();var R=Tn(d.Elements.track),H=Tn(i),D=S("left",!0),Q=S("right",!0);return ma(R[D])<=mr(H[D])&&ma(H[Q])<=mr(R[Q])}function x(R,H){var D=vn(R-t);return!w&&(p.rewind||e.is(Oo))&&(D=Ci(D,e.length-D)),D<=H}var Y={index:t,slideIndex:n,slide:i,container:G,isClone:w,mount:E,destroy:M,update:T,style:L,isWithin:x};return Y}function lg(e,t,n){var i=tn(e),o=i.on,r=i.emit,l=i.bind,c=t.Elements,d=c.slides,u=c.list,p=[];function y(){v(),o(an,m),o(an,v)}function v(){d.forEach(function(T,O){b(T,O,-1)})}function m(){q(function(T){T.destroy()}),si(p)}function g(){q(function(T){T.update()})}function b(T,O,N){var L=sg(e,O,N,T);L.mount(),p.push(L),p.sort(function(C,j){return C.index-j.index})}function S(T){return T?E(function(O){return!O.isClone}):p}function A(T){var O=t.Controller,N=O.toIndex(T),L=O.hasFocus()?1:n.perPage;return E(function(C){return ra(C.index,N,N+L-1)})}function f(T){return E(T)[0]}function w(T,O){Rn(T,function(N){if($i(N)&&(N=tu(N)),Jd(N)){var L=d[O];L?cl(N,L):Cr(u,N),Bn(N,n.classes.slide),M(N,Jt(r,Co))}}),r(an)}function G(T){Ki(E(T).map(function(O){return O.slide})),r(an)}function q(T,O){S(O).forEach(T)}function E(T){return p.filter(Zd(T)?T:function(O){return $i(T)?cr(O.slide,T):ll($r(T),O.index)})}function P(T,O,N){q(function(L){L.style(T,O,N)})}function M(T,O){var N=dl(T,"img"),L=N.length;L?N.forEach(function(C){l(C,"load error",function(){--L||O()})}):O()}function X(T){return T?d.length:p.length}function $(){return p.length>n.perPage}return{mount:y,destroy:m,update:g,register:b,get:S,getIn:A,getAt:f,add:w,remove:G,forEach:q,filter:E,style:P,getLength:X,isEnough:$}}function cg(e,t,n){var i=tn(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,b,S,A;function f(){w(),r(window,"resize load",Vm(Jt(l,Co))),o([gn,an],w),o(Co,G)}function w(){b=n.direction===Ea,Mn(p,"maxWidth",Ni(n.width)),Mn(y,d("paddingLeft"),q(!1)),Mn(y,d("paddingRight"),q(!0)),G(!0)}function G(Y){var R=Tn(p);(Y||S.width!==R.width||S.height!==R.height)&&(Mn(y,"height",E()),g(d("marginRight"),Ni(n.gap)),g("width",M()),g("height",X(),!0),S=R,l(Ta),A!==(A=x())&&(ni(p,ku,A),l(Bm,A)))}function q(Y){var R=n.padding,H=d(Y?"right":"left");return R&&Ni(R[H]||(lr(R)?0:R))||"0px"}function E(){var Y="";return b&&(Y=P(),or(Y,"height or heightRatio is missing."),Y="calc("+Y+" - "+q(!1)+" - "+q(!0)+")"),Y}function P(){return Ni(n.height||Tn(v).width*n.heightRatio)}function M(){return n.autoWidth?null:Ni(n.fixedWidth)||(b?"":$())}function X(){return Ni(n.fixedHeight)||(b?n.autoHeight?null:$():P())}function $(){var Y=Ni(n.gap);return"calc((100%"+(Y&&" + "+Y)+")/"+(n.perPage||1)+(Y&&" - "+Y)+")"}function T(){return Tn(v)[d("width")]}function O(Y,R){var H=m(Y||0);return H?Tn(H.slide)[d("width")]+(R?0:C()):0}function N(Y,R){var H=m(Y);if(H){var D=Tn(H.slide)[d("right")],Q=Tn(v)[d("left")];return vn(D-Q)+(R?0:C())}return 0}function L(Y){return N(e.length-1)-N(0)+O(0,Y)}function C(){var Y=m(0);return Y&&parseFloat(Mn(Y.slide,d("marginRight")))||0}function j(Y){return parseFloat(Mn(y,d("padding"+(Y?"Right":"Left"))))||0}function x(){return e.is(Ir)||L(!0)>T()}return{mount:f,resize:G,listSize:T,slideSize:O,sliderSize:L,totalSize:N,getPadding:j,isOverflow:x}}var dg=2;function ug(e,t,n){var i=tn(e),o=i.on,r=t.Elements,l=t.Slides,c=t.Direction.resolve,d=[],u;function p(){o(an,y),o([gn,Co],m),(u=S())&&(g(u),t.Layout.resize(!0))}function y(){v(),p()}function v(){Ki(d),si(d),i.destroy()}function m(){var A=S();u!==A&&(u<A||!A)&&i.emit(an)}function g(A){var f=l.get().slice(),w=f.length;if(w){for(;f.length<A;)oa(f,f);oa(f.slice(-A),f.slice(0,A)).forEach(function(G,q){var E=q<A,P=b(G.slide,q);E?cl(P,f[0].slide):Cr(r.list,P),oa(d,P),l.register(P,q-A+(E?0:w),G.index)})}}function b(A,f){var w=A.cloneNode(!0);return Bn(w,n.classes.clone),w.id=e.root.id+"-clone"+pl(f+1),w}function S(){var A=n.clones;if(!e.is(Oo))A=0;else if(wr(A)){var f=n[c("fixedWidth")]&&t.Layout.slideSize(0),w=f&&mr(Tn(r.track)[c("width")]/f);A=w||n[c("autoWidth")]&&e.length||n.perPage*dg}return A}return{mount:p,destroy:v}}function pg(e,t,n){var i=tn(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,b=m.orient,S=t.Elements,A=S.list,f=S.track,w;function G(){w=t.Transition,o([Ri,Ta,gn,an],q)}function q(){t.Controller.isBusy()||(t.Scroll.cancel(),P(e.index),t.Slides.update())}function E(H,D,Q,ae){H!==D&&Y(H>Q)&&(T(),M($(L(),H>Q),!0)),l(Ho),r(li,D,Q,H),w.start(D,function(){l($o),r(Wo,D,Q,H),ae&&ae()})}function P(H){M(N(H,!0))}function M(H,D){if(!e.is(Ir)){var Q=D?H:X(H);Mn(A,"transform","translate"+g("X")+"("+Q+"px)"),H!==Q&&r(vu)}}function X(H){if(e.is(Oo)){var D=O(H),Q=D>t.Controller.getEnd(),ae=D<0;(ae||Q)&&(H=$(H,Q))}return H}function $(H,D){var Q=H-x(D),ae=v();return H-=b(ae*(mr(vn(Q)/ae)||1))*(D?1:-1),H}function T(){M(L(),!0),w.cancel()}function O(H){for(var D=t.Slides.get(),Q=0,ae=1/0,z=0;z<D.length;z++){var re=D[z].index,F=vn(N(re,!0)-H);if(F<=ae)ae=F,Q=re;else break}return Q}function N(H,D){var Q=b(p(H-1)-j(H));return D?C(Q):Q}function L(){var H=g("left");return Tn(A)[H]-Tn(f)[H]+b(u(!1))}function C(H){return n.trimSpace&&e.is(To)&&(H=lo(H,0,b(v(!0)-y()))),H}function j(H){var D=n.focus;return D==="center"?(y()-d(H,!0))/2:+D*d(H)||0}function x(H){return N(H?t.Controller.getEnd():0,!!n.trimSpace)}function Y(H){var D=b($(L(),H));return H?D>=0:D<=A[g("scrollWidth")]-Tn(f)[g("width")]}function R(H,D){D=wr(D)?L():D;var Q=H!==!0&&b(D)<b(x(!1)),ae=H!==!1&&b(D)>b(x(!0));return Q||ae}return{mount:G,move:E,jump:P,translate:M,shift:$,cancel:T,toIndex:O,toPosition:N,getPosition:L,getLimit:x,exceededLimit:R,reposition:q}}function mg(e,t,n){var i=tn(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),b=e.is(To),S=Jt(L,!1),A=Jt(L,!0),f=n.start||0,w,G=f,q,E,P;function M(){X(),o([gn,an,ga],X),o(Ta,$)}function X(){q=v(!0),E=n.perMove,P=n.perPage,w=Y();var F=lo(f,0,m?w:q-1);F!==f&&(f=F,l.reposition())}function $(){w!==Y()&&r(ga)}function T(F,le,te){if(!re()){var fe=N(F),Pe=x(fe);Pe>-1&&(le||Pe!==f)&&(Q(Pe),l.move(fe,Pe,G,te))}}function O(F,le,te,fe){t.Scroll.scroll(F,le,te,function(){var Pe=x(l.toIndex(c()));Q(m?Ci(Pe,w):Pe),fe&&fe()})}function N(F){var le=f;if($i(F)){var te=F.match(/([+\-<>])(\d+)?/)||[],fe=te[1],Pe=te[2];fe==="+"||fe==="-"?le=C(f+ +(""+fe+(+Pe||1)),f):fe===">"?le=Pe?R(+Pe):S(!0):fe==="<"&&(le=A(!0))}else le=g?F:lo(F,0,w);return le}function L(F,le){var te=E||(z()?1:P),fe=C(f+te*(F?-1:1),f,!(E||z()));return fe===-1&&b&&!iu(c(),d(!F),1)?F?0:w:le?fe:x(fe)}function C(F,le,te){if(y()||z()){var fe=j(F);fe!==F&&(le=F,F=fe,te=!1),F<0||F>w?!E&&(ra(0,F,le,!0)||ra(w,le,F,!0))?F=R(H(F)):g?F=te?F<0?-(q%P||P):q:F:n.rewind?F=F<0?w:0:F=-1:te&&F!==le&&(F=R(H(le)+(F<le?-1:1)))}else F=-1;return F}function j(F){if(b&&n.trimSpace==="move"&&F!==f)for(var le=c();le===u(F,!0)&&ra(F,0,e.length-1,!n.rewind);)F<f?--F:++F;return F}function x(F){return g?(F+q)%q||0:F}function Y(){for(var F=q-(z()||g&&E?1:P);m&&F-- >0;)if(u(q-1,!0)!==u(F,!0)){F++;break}return lo(F,0,q-1)}function R(F){return lo(z()?F:P*F,0,w)}function H(F){return z()?Ci(F,w):ma((F>=w?q-1:F)/P)}function D(F){var le=l.toIndex(F);return b?lo(le,0,w):le}function Q(F){F!==f&&(G=f,f=F)}function ae(F){return F?G:f}function z(){return!wr(n.focus)||n.isNavigation}function re(){return e.state.is([Ho,Sr])&&!!n.waitForTransition}return{mount:M,go:T,scroll:O,getNext:S,getPrev:A,getAdjacent:L,getEnd:Y,setIndex:Q,getIndex:ae,toIndex:R,toPage:H,toDest:D,hasFocus:z,isBusy:re}}var gg="http://www.w3.org/2000/svg",hg="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 fg(e,t,n){var i=tn(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,b=u.next,S,A,f={};function w(){q(),o(gn,G)}function G(){E(),w()}function q(){var O=n.arrows;O&&!(g&&b)&&X(),g&&b&&(ur(f,{prev:g,next:b}),pr(m,O?"":"none"),Bn(m,A=wl+"--"+n.direction),O&&(P(),T(),Wt([g,b],Pr,v.id),l(pu,g,b)))}function E(){i.destroy(),ii(m,A),S?(Ki(y?[g,b]:m),g=b=null):jn([g,b],Sl)}function P(){o([Ri,Wo,an,Ji,ga],T),r(b,"click",Jt(M,">")),r(g,"click",Jt(M,"<"))}function M(O){p.go(O,!0)}function X(){m=y||vo("div",c.arrows),g=$(!0),b=$(!1),S=!0,Cr(m,[g,b]),!y&&cl(m,v)}function $(O){var N='<button class="'+c.arrow+" "+(O?c.prev:c.next)+'" type="button"><svg xmlns="'+gg+'" viewBox="0 0 '+Ar+" "+Ar+'" width="'+Ar+'" height="'+Ar+'" focusable="false"><path d="'+(n.arrowPath||hg)+'" />';return tu(N)}function T(){if(g&&b){var O=e.index,N=p.getPrev(),L=p.getNext(),C=N>-1&&O<N?d.last:d.prev,j=L>-1&&O>L?d.first:d.next;g.disabled=N<0,b.disabled=L<0,Wt(g,Pn,C),Wt(b,Pn,j),l(mu,g,b,N,L)}}return{arrows:f,mount:w,destroy:E,update:T}}var yg=ul+"-interval";function vg(e,t,n){var i=tn(e),o=i.on,r=i.bind,l=i.emit,c=Pa(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,b,S=m==="pause";function A(){m&&(f(),v&&Wt(v,Pr,u.track.id),S||w(),E())}function f(){n.pauseOnHover&&r(y,"mouseenter mouseleave",function(X){g=X.type==="mouseenter",q()}),n.pauseOnFocus&&r(y,"focusin focusout",function(X){b=X.type==="focusin",q()}),v&&r(v,"click",function(){S?w():G(!0)}),o([li,La,an],c.rewind),o(li,M)}function w(){d()&&t.Slides.isEnough()&&(c.start(!n.resetProgress),b=g=S=!1,E(),l(fl))}function G(X){X===void 0&&(X=!0),S=!!X,E(),d()||(c.pause(),l(yl))}function q(){S||(g||b?G(!1):w())}function E(){v&&(ni(v,Yi,!S),Wt(v,Pn,n.i18n[S?"play":"pause"]))}function P(X){var $=u.bar;$&&Mn($,"width",X*100+"%"),l(fu,X)}function M(X){var $=t.Slides.getAt(X);c.set($&&+An($.slide,yg)||n.interval)}return{mount:A,destroy:c.cancel,play:w,pause:G,isPaused:d}}function xg(e,t,n){var i=tn(e),o=i.on;function r(){n.cover&&(o(vl,Jt(c,!0)),o([Ri,gn,an],Jt(l,!0)))}function l(d){t.Slides.forEach(function(u){var p=Tr(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),pr(u,d?"none":"")}return{mount:r,destroy:Jt(l,!1)}}var bg=10,Sg=600,wg=.6,$g=1.5,Cg=800;function Tg(e,t,n){var i=tn(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,b=1;function S(){o(li,G),o([gn,an],q)}function A(P,M,X,$,T){var O=d();if(G(),X&&(!v||!p())){var N=t.Layout.sliderSize(),L=As(P)*N*ma(vn(P)/N)||0;P=c.toPosition(t.Controller.toDest(P%N))+L}var C=iu(O,P,1);b=1,M=C?0:M||pa(vn(P-O)/$g,Cg),g=$,m=Pa(M,f,Jt(w,O,P,T),1),l(Sr),r(La),m.start()}function f(){l($o),g&&g(),r(Ji)}function w(P,M,X,$){var T=d(),O=P+(M-P)*E($),N=(O-T)*b;y(T+N),v&&!X&&p()&&(b*=wg,vn(N)<bg&&A(u(p(!0)),Sg,!1,g,!0))}function G(){m&&m.cancel()}function q(){m&&!m.isPaused()&&(G(),f())}function E(P){var M=n.easingFunc;return M?M(P):1-Math.pow(1-P,4)}return{mount:S,destroy:G,scroll:A,cancel:q}}var co={passive:!1,capture:!0};function Lg(e,t,n){var i=tn(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,b=g.resolve,S=g.orient,A=u.getPosition,f=u.exceededLimit,w,G,q,E,P,M=!1,X,$,T;function O(){l(v,Xa,Es,co),l(v,qa,Es,co),l(v,Eu,L,co),l(v,"click",x,{capture:!0}),l(v,"dragstart",ei),o([Ri,gn],N)}function N(){var K=n.drag;de(!K),E=K==="free"}function L(K){if(X=!1,!$){var se=Pe(K);fe(K.target)&&(se||!K.button)&&(y.isBusy()?ei(K,!0):(T=se?v:window,P=d.is([Ho,Sr]),q=null,l(T,Xa,C,co),l(T,qa,j,co),u.cancel(),p.cancel(),Y(K)))}}function C(K){if(d.is(ia)||(d.set(ia),r(cu)),K.cancelable)if(P){u.translate(w+te(z(K)));var se=re(K)>oc,ue=M!==(M=f());(se||ue)&&Y(K),X=!0,r(du),ei(K)}else D(K)&&(P=H(K),ei(K))}function j(K){d.is(ia)&&(d.set($o),r(uu)),P&&(R(K),ei(K)),c(T,Xa,C),c(T,qa,j),P=!1}function x(K){!$&&X&&ei(K,!0)}function Y(K){q=G,G=K,w=A()}function R(K){var se=Q(K),ue=ae(se),ve=n.rewind&&n.rewindByDrag;m(!1),E?y.scroll(ue,0,n.snap):e.is(Ir)?y.go(S(As(se))<0?ve?"<":"-":ve?">":"+"):e.is(To)&&M&&ve?y.go(f(!0)?">":"<"):y.go(y.toDest(ue),!0),m(!0)}function H(K){var se=n.dragMinThreshold,ue=lr(se),ve=ue&&se.mouse||0,$e=(ue?se.touch:+se)||10;return vn(z(K))>(Pe(K)?$e:ve)}function D(K){return vn(z(K))>vn(z(K,!0))}function Q(K){if(e.is(Oo)||!M){var se=re(K);if(se&&se<oc)return z(K)/se}return 0}function ae(K){return A()+As(K)*Ci(vn(K)*(n.flickPower||600),E?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function z(K,se){return le(K,se)-le(F(K),se)}function re(K){return Ms(K)-Ms(F(K))}function F(K){return G===K&&q||G}function le(K,se){return(Pe(K)?K.changedTouches[0]:K)["page"+b(se?"Y":"X")]}function te(K){return K/(M&&e.is(To)?rg:1)}function fe(K){var se=n.noDrag;return!cr(K,"."+Lu+", ."+Aa)&&(!se||!cr(K,se))}function Pe(K){return typeof TouchEvent<"u"&&K instanceof TouchEvent}function xe(){return P}function de(K){$=K}return{mount:O,disable:de,isDragging:xe}}var Pg={Spacebar:" ",Right:ka,Left:Ra,Up:xu,Down:bu};function $l(e){return e=$i(e)?e:e.key,Pg[e]||e}var rc="keydown";function Ig(e,t,n){var i=tn(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(li,b)}function v(){var A=n.keyboard;A&&(u=A==="global"?window:c,r(u,rc,S))}function m(){l(u,rc)}function g(A){p=A}function b(){var A=p;p=!0,Yd(function(){p=A})}function S(A){if(!p){var f=$l(A);f===d(Ra)?e.go("<"):f===d(ka)&&e.go(">")}}return{mount:y,destroy:m,disable:g}}var rr=ul+"-lazy",aa=rr+"-srcset",Rg="["+rr+"], ["+aa+"]";function kg(e,t,n){var i=tn(e),o=i.on,r=i.off,l=i.bind,c=i.emit,d=n.lazyLoad==="sequential",u=[Wo,Ji],p=[];function y(){n.lazyLoad&&(v(),o(an,v))}function v(){si(p),m(),d?A():(r(u),o(u,g),g())}function m(){t.Slides.forEach(function(f){dl(f.slide,Rg).forEach(function(w){var G=An(w,rr),q=An(w,aa);if(G!==w.src||q!==w.srcset){var E=n.classes.spinner,P=w.parentElement,M=Tr(P,"."+E)||vo("span",E,P);p.push([w,f,M]),w.src||pr(w,"none")}})})}function g(){p=p.filter(function(f){var w=n.perPage*((n.preloadPages||1)+1)-1;return f[1].isWithin(e.index,w)?b(f):!0}),p.length||r(u)}function b(f){var w=f[0];Bn(f[1].slide,Hs),l(w,"load error",Jt(S,f)),Wt(w,"src",An(w,rr)),Wt(w,"srcset",An(w,aa)),jn(w,rr),jn(w,aa)}function S(f,w){var G=f[0],q=f[1];ii(q.slide,Hs),w.type!=="error"&&(Ki(f[2]),pr(G,""),c(vl,G,q),c(Co)),d&&A()}function A(){p.length&&b(p.shift())}return{mount:y,destroy:Jt(si,p),check:g}}function Eg(e,t,n){var i=tn(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,b=[],S,A;function f(){w(),o([gn,an,ga],f);var $=n.pagination;g&&pr(g,$?"":"none"),$&&(o([li,La,Ji],X),G(),X(),r(gu,{list:S,items:b},M(e.index)))}function w(){S&&(Ki(g?Ii(S.children):S),ii(S,A),si(b),S=null),i.destroy()}function G(){var $=e.length,T=n.classes,O=n.i18n,N=n.perPage,L=p()?u.getEnd()+1:mr($/N);S=g||vo("ul",T.pagination,d.track.parentElement),Bn(S,A=Fa+"--"+P()),Wt(S,oi,"tablist"),Wt(S,Pn,O.select),Wt(S,bl,P()===Ea?"vertical":"");for(var C=0;C<L;C++){var j=vo("li",null,S),x=vo("button",{class:T.page,type:"button"},j),Y=c.getIn(C).map(function(H){return H.slide.id}),R=!p()&&N>1?O.pageX:O.slideX;l(x,"click",Jt(q,C)),n.paginationKeyboard&&l(x,"keydown",Jt(E,C)),Wt(j,oi,"presentation"),Wt(x,oi,"tab"),Wt(x,Pr,Y.join(" ")),Wt(x,Pn,Fs(R,C+1)),Wt(x,xo,-1),b.push({li:j,button:x,page:C})}}function q($){v(">"+$,!0)}function E($,T){var O=b.length,N=$l(T),L=P(),C=-1;N===m(ka,!1,L)?C=++$%O:N===m(Ra,!1,L)?C=(--$+O)%O:N==="Home"?C=0:N==="End"&&(C=O-1);var j=b[C];j&&(eu(j.button),v(">"+C),ei(T,!0))}function P(){return n.paginationDirection||n.direction}function M($){return b[u.toPage($)]}function X(){var $=M(y(!0)),T=M(y());if($){var O=$.button;ii(O,Yi),jn(O,Ql),Wt(O,xo,-1)}if(T){var N=T.button;Bn(N,Yi),Wt(N,Ql,!0),Wt(N,xo,"")}r(hu,{list:S,items:b},$,T)}return{items:b,mount:f,destroy:w,getAt:M,update:X}}var Mg=[" ","Enter"];function Ag(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()}),si(r)}function d(){c(),l()}function u(g,b){var S=tn(g);S.on(li,function(A,f,w){b.go(b.is(Oo)?w:A)}),r.push(S)}function p(){var g=tn(e),b=g.on;b(ml,v),b(yu,m),b([Ri,gn],y),r.push(g),g.emit(hl,e.splides)}function y(){Wt(t.Elements.list,bl,n.direction===Ea?"vertical":"")}function v(g){e.go(g.index)}function m(g,b){ll(Mg,$l(b))&&(v(g),ei(b))}return{setup:Jt(t.Media.set,{slideFocus:wr(o)?i:o},!0),mount:l,destroy:c,remount:d}}function Fg(e,t,n){var i=tn(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)&&ei(u)}}function d(u){return!n.releaseWheel||e.state.is(Ho)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var Ng=90;function _g(e,t,n){var i=tn(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,c=vo("span",eg),d=Pa(Ng,Jt(p,!1));function u(){l&&(v(!t.Autoplay.isPaused()),Wt(r,nc,!0),c.textContent="…",o(fl,Jt(v,!0)),o(yl,Jt(v,!1)),o([Wo,Ji],Jt(p,!0)))}function p(m){Wt(r,tc,m),m?(Cr(r,c),d.start()):(Ki(c),d.cancel())}function y(){jn(r,[ec,nc,tc]),Ki(c)}function v(m){l&&Wt(r,ec,m?"off":"polite")}return{mount:u,disable:v,destroy:y}}var Hg=Object.freeze({__proto__:null,Media:Gm,Direction:Xm,Elements:ag,Slides:lg,Layout:cg,Clones:ug,Move:pg,Controller:mg,Arrows:fg,Autoplay:vg,Cover:xg,Scroll:Tg,Drag:Lg,Keyboard:Ig,LazyLoad:kg,Pagination:Eg,Sync:Ag,Wheel:Fg,Live:_g}),Wg={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"},Og={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:ig,i18n:Wg,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Dg(e,t,n){var i=t.Slides;function o(){tn(e).on([Ri,an],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),Yd(d)}return{mount:o,start:l,cancel:Es}}function zg(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(){tn(e).bind(l,"transitionend",function(m){m.target===l&&d&&(y(),d())})}function p(m,g){var b=i.toPosition(m,!0),S=i.getPosition(),A=v(m);vn(b-S)>=1&&A>=1?n.useScroll?r.scroll(b,A,!1,g):(c("transform "+A+"ms "+n.easing),i.translate(b,!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 b=o.getIndex(!0),S=o.getEnd();if(b===0&&m>=S||b>=S&&m===0)return g}return n.speed}return{mount:u,start:p,cancel:y}}var Bg=(function(){function e(n,i){this.event=tn(),this.Components={},this.state=jm(mo),this.splides=[],this._o={},this._E={};var o=$i(n)?nu(document,n):n;or(o,o+" is invalid."),this.root=o,i=xi({label:An(o,Pn)||"",labelledby:An(o,xl)||""},Og,e.defaults,i||{});try{xi(i,JSON.parse(An(o,ul)))}catch{or(!1,"Invalid JSON")}this._o=Object.create(xi({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,c=this.Components;or(l.is([mo,ua]),"Already mounted!"),l.set(mo),this._C=c,this._T=o||this._T||(this.is(Ir)?Dg:zg),this._E=i||this._E;var d=ur({},Hg,this._E,{Transition:this._T});return qi(d,function(u,p){var y=u(r,c,r._o);c[p]=y,y.setup&&y.setup()}),qi(c,function(u){u.mount&&u.mount()}),this.emit(Ri),Bn(this.root,tg),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(Ii(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(an),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,r=this.state;return r.is(mo)?tn(this).on(Ns,this.destroy.bind(this,i)):(qi(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(gl),o.destroy(),i&&si(this.splides),r.set(ua)),this},Wm(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=Bg;Cl.defaults={};Cl.STATES=Dm;var ac=[[Ri,"onMounted"],[Ns,"onReady"],[li,"onMove"],[Wo,"onMoved"],[ml,"onClick"],[ru,"onActive"],[au,"onInactive"],[su,"onVisible"],[lu,"onHidden"],[an,"onRefresh"],[gn,"onUpdated"],[Co,"onResize"],[Ta,"onResized"],[cu,"onDrag"],[du,"onDragging"],[uu,"onDragged"],[La,"onScroll"],[Ji,"onScrolled"],[gl,"onDestroy"],[pu,"onArrowsMounted"],[mu,"onArrowsUpdated"],[gu,"onPaginationMounted"],[hu,"onPaginationUpdated"],[hl,"onNavigationMounted"],[fl,"onAutoplayPlay"],[fu,"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 jg(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function Vg(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 Vg(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 Gg=({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();jg(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){ac.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",...ac.map(r=>r[1])])},n?s.createElement(Gg,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 Xg="RichTextRenderer-module__link___BWeZ2",qg={link:Xg},Ug=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=>Ug(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:N.scalingValue(e.letterSpacing,t),wordSpacing:N.scalingValue(e.wordSpacing,t),fontSize:N.scalingValue(n,t),lineHeight:i!==void 0?N.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 Mu(e){return e!=null&&e.length?e.some(t=>t.type==="link"?Mu(t.children):!!t.text):!1}const Zi=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:qg.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:Kg(i),children:i.text},o));return a.jsx(a.Fragment,{children:e.map((n,i)=>{const o=n.children;return a.jsx("div",{children:Mu(o)?t(o):" "},i)})})};function Kg(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 Yg="SvgImage-module__svg___q3xE-",Zg="SvgImage-module__img___VsTm-",sc={svg:Yg,img:Zg},Jg=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},Qg=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)}},[]),!Jg(e)||!r?a.jsx("img",{src:e,alt:"",className:Tt(sc.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:Tt(sc.svg,i),style:{"--svg":Qg(e),"--fill":t,"--hover-fill":n,...o??{}}})},eh={"top-left":Ct.topLeftAlignment,"top-center":Ct.topCenterAlignment,"top-right":Ct.topRightAlignment,"middle-left":Ct.middleLeftAlignment,"middle-center":Ct.middleCenterAlignment,"middle-right":Ct.middleRightAlignment,"bottom-left":Ct.bottomLeftAlignment,"bottom-center":Ct.bottomCenterAlignment,"bottom-right":Ct.bottomRightAlignment};function th({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,b]=s.useState(void 0),[S,A]=s.useState(null),[f,w]=s.useState(0),[G,q]=s.useState(0),{direction:E,transition:P,controls:M,pagination:X,imageCaption:$,triggers:T}=e,O=s.useRef(P.type),{x:F,y:L}=e.controls.offset,C=j=>{o&&o.go(j)};return s.useEffect(()=>{if(!S)return;const j=new ResizeObserver(x=>{if(!o)return;const[Y]=x;b({width:Math.round(Y.contentRect.width),height:Math.round(Y.contentRect.height)})});return j.observe(S),()=>j.unobserve(S)},[S]),s.useEffect(()=>{!o||O.current===P.type||(q(j=>j+1),O.current=P.type)},[P.type]),a.jsx("div",{className:Tt(Ct.wrapper,{[Ct.editor]:i}),ref:A,children:a.jsxs("div",{className:Ct.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:Tt(Ct.captionBlock),children:a.jsx("div",{className:Ct.captionTextWrapper,children:t.map((j,x)=>a.jsx("div",{className:Tt(Ct.captionText,eh[$.alignment],{[Ct.withPointerEvents]:x===f&&i,[Ct.active]:x===f}),style:{fontFamily:Do(c.fontFamily),fontWeight:c.fontWeight,fontStyle:c.fontStyle,width:l.sizing==="auto"?"max-content":N.scalingValue(l.width,i),letterSpacing:N.scalingValue(d,i),wordSpacing:N.scalingValue(p,i),textAlign:u,fontSize:N.scalingValue(y.fontSize,i),lineHeight:N.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:Ct.captionTextInner,style:{"--link-hover-color":$.linkHoverColor,"--link-color":$.linkColor,position:"relative",top:N.scalingValue($.offset.y,i),left:N.scalingValue($.offset.x,i)},children:a.jsx(Zi,{content:j.imageCaption})})},x))})}),a.jsx(Ll,{onMove:j=>{w(j.index)},ref:r,options:{arrows:!1,speed:P.duration?parseInt(P.duration):500,autoplay:T.autoPlay!==null,...T.autoPlay!==null&&{interval:parseInt(T.autoPlay)*1e3},direction:E==="horiz"||P.type==="fade in"?"ltr":"ttb",pagination:!1,drag:T.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((j,x)=>a.jsx(Pl,{children:a.jsx("div",{className:Ct.sliderItem,children:a.jsx("div",{className:Ct.imgWrapper,children:a.jsx("img",{className:Tt(Ct.sliderImage,{[Ct.contain]:j.image.objectFit==="contain",[Ct.cover]:j.image.objectFit==="cover"}),src:j.image.url,alt:j.image.name??""})})})},x))},G),M.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Tt(Ct.arrow,{[Ct.arrowVertical]:E==="vert",[Ct.hoverArrow]:M.show==="on hover"}),style:{color:M.color,"--arrow-hover-color":M.hover},children:a.jsxs("button",{onClick:()=>{C("-1")},className:Ct.arrowInner,style:{transform:`translate(${N.scalingValue(F,i)}, ${N.scalingValue(L*(E==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:[M.arrowsImgUrl&&a.jsx(mn,{url:M.arrowsImgUrl,fill:M.color,hoverFill:M.hover,className:Tt(Ct.arrowImg,Ct.mirror)}),!M.arrowsImgUrl&&a.jsx(lc,{color:M.color,className:Tt(Ct.arrowIcon,Ct.arrowImg,Ct.mirror)})]})}),a.jsx("div",{className:Tt(Ct.arrow,Ct.nextArrow,{[Ct.arrowVertical]:E==="vert",[Ct.hoverArrow]:M.show==="on hover"}),style:{color:M.color,"--arrow-hover-color":M.hover},children:a.jsxs("button",{className:Ct.arrowInner,onClick:()=>C("+1"),style:{transform:`translate(${N.scalingValue(F*(E==="horiz"?-1:1),i)}, ${N.scalingValue(L,i)}) scale(${e.controls.scale/100}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:[M.arrowsImgUrl&&a.jsx(mn,{url:M.arrowsImgUrl,fill:M.color,hoverFill:M.hover,className:Ct.arrowImg}),!M.arrowsImgUrl&&a.jsx(lc,{color:M.color,className:Tt(Ct.arrowIcon,Ct.arrowImg)})]})})]}),T.triggersList.click&&a.jsx("div",{className:Ct.clickOverlay,onClick:()=>{o&&o.go("+1")}}),X.isActive&&a.jsx("div",{className:Tt(Ct.pagination,{[Ct.paginationInsideBottom]:X.position==="inside-1"&&E==="horiz",[Ct.paginationInsideTop]:X.position==="inside-2"&&E==="horiz",[Ct.paginationOutsideBottom]:X.position==="outside-1"&&E==="horiz",[Ct.paginationOutsideTop]:X.position==="outside-2"&&E==="horiz",[Ct.paginationInsideLeft]:X.position==="inside-1"&&E==="vert",[Ct.paginationInsideRight]:X.position==="inside-2"&&E==="vert",[Ct.paginationOutsideLeft]:X.position==="outside-1"&&E==="vert",[Ct.paginationOutsideRight]:X.position==="outside-2"&&E==="vert",[Ct.paginationVertical]:E==="vert"}),children:a.jsx("div",{className:Ct.paginationInner,style:{backgroundColor:X.colors[2],transform:`scale(${X.scale/100}) translate(${N.scalingValue(X.offset.x,i)}, ${N.scalingValue(X.offset.y,i)}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:t.map((j,x)=>a.jsx("button",{onClick:()=>{o&&o.go(x)},className:Tt(Ct.paginationItem),children:a.jsx("div",{className:Tt(Ct.dot,{[Ct.activeDot]:x===f}),style:{backgroundColor:x===f?X.colors[0]:X.colors[1],"--pagination-hover-color":X.hover}})},x))})})]})})}function lc({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 nh={element:th,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"]}},ih="ImageRevealSlider-module__imageRevealSlider___UE5Ob",oh="ImageRevealSlider-module__image___Qjt-e",rh="ImageRevealSlider-module__link___N-iLG",ah="ImageRevealSlider-module__cursor___2U03d",no={imageRevealSlider:ih,image:oh,link:rh,cursor:ah};function cc(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 sh(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 lh({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,b]=s.useState("none"),S=s.useRef({x:0,y:0}),[A,f]=s.useState(!1),{sizeType:w,imageWidth:G,randomRangeImageWidth:q}=e.imageSize,{revealPosition:E,visible:P}=e.position,{cursorType:M,target:X,defaultCursorScale:$,defaultCursor:T,hoverCursorScale:O,hoverCursor:F}=e.cursor;s.useEffect(()=>{if(!i)return;const j=(R,H)=>{const D=i.getBoundingClientRect(),Q=R-D.left,ae=H-D.top;if(y({x:Q,y:ae}),M==="system"){b("none"),m(1);return}const z=Q,re=ae,_=document.elementFromPoint(D.left+z,D.top+re);if(_&&_.closest("a")){b("none"),m(1);return}const le=cc(z,re,r)||X==="area"?{img:F??"none",scale:O}:{img:T??"none",scale:$};b(le.img),m(le.scale)},x=R=>{R.stopPropagation(),S.current={x:R.clientX,y:R.clientY},j(R.clientX,R.clientY)},Y=()=>{A&&j(S.current.x,S.current.y)};return i.addEventListener("mousemove",x),window.addEventListener("scroll",Y,!0),()=>{i.removeEventListener("mousemove",x),window.removeEventListener("scroll",Y,!0)}},[i,A,p,M,X,F,T,O,$,r]),s.useEffect(()=>{A||(b("none"),m(0))},[A]);const L=async(j,x,Y,R={})=>{const{width:H,height:D,finalWidth:Q}=await sh(j.image.url,w,G,q);let ae=0,z=0;E==="same"?(ae=x/2,z=Y/2):(ae=R.x??Math.random()*x,z=R.y??Math.random()*Y);const re=Math.min(Math.max(ae,H/2),x-H/2),_=Math.min(Math.max(z,D/2),Y-D/2);return{id:u.current++,url:j.image.url,link:j.link,name:j.image.name,x:re,y:_,width:Q}};s.useEffect(()=>{if(!i||t.length===0)return;const j=i.getBoundingClientRect(),x=j.width,Y=j.height,R=[];(async()=>{const D=t[0],Q=await L(D,x,Y);R.push(Q),l(R),d(1)})()},[w,G,q,E,i]),s.useEffect(()=>{P==="last One"&&l(j=>j.length>0?[j[j.length-1]]:[])},[P]);const C=async j=>{if(!i)return;const x=i.getBoundingClientRect(),Y=j.clientX-x.left,R=j.clientY-x.top;if(X==="image"&&!cc(Y,R,r))return;let H=0,D=0;E==="on Click"?(H=Y,D=R):E==="same"?(H=x.width/2,D=x.height/2):(H=Math.random()*x.width,D=Math.random()*x.height);const Q=t[c],ae=await L(Q,x.width,x.height,{x:H,y:D});l(z=>P==="all"?[...z,ae]:[ae]),d(z=>z>=t.length-1?0:z+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(j=>a.jsx("div",{className:no.wrapper,style:{top:`${j.y}px`,left:`${j.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:j.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:X==="area"&&j.link?a.jsx("a",{href:j.link,target:"_blank",className:no.link,children:a.jsx("img",{src:j.url,alt:j.name,className:no.image},j.id)}):a.jsx("img",{src:j.url,alt:j.name,className:no.image},j.id)},j.id)),A&&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 ch={element:lh,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:""}]}}}},dh="LightBox-module__hidden___9s-9x",uh="LightBox-module__heroImage___sTxNF",ph="LightBox-module__background___rm9ml",mh="LightBox-module__editor___4ACaY",gh="LightBox-module__contentStyle___Bgnsq",hh="LightBox-module__imageStyle___tLIlB",fh="LightBox-module__imgWrapper___LuFUp",yh="LightBox-module__contain___8-yaS",vh="LightBox-module__cover___hNvOG",xh="LightBox-module__caption___b6L2I",bh="LightBox-module__captionTextInner___rCGNH",Sh="LightBox-module__lightboxSplide___XFuWC",wh="LightBox-module__arrow___iz38X",$h="LightBox-module__arrowVertical___Zfz81",Ch="LightBox-module__nextArrow___zkAQN",Th="LightBox-module__arrowInner___p48sW",Lh="LightBox-module__arrowIcon___3VaFf",Ph="LightBox-module__arrowImg___pNV88",Ih="LightBox-module__mirror___pjeXc",Rh="LightBox-module__thumbsWrapper___GB-nU",kh="LightBox-module__thumbsContainerVertical___wttk5",Eh="LightBox-module__thumbsContainer___osSma",Mh="LightBox-module__thumbsAlignStart___MO6tY",Ah="LightBox-module__thumbsAlignCenter___Q4sUx",Fh="LightBox-module__thumbsAlignEnd___p4y9R",Nh="LightBox-module__thumbItem___HvnF3",_h="LightBox-module__closeButton___g2khP",Hh="LightBox-module__fadeIn___0m5GW",Wh="LightBox-module__slideInLeft___gPYwC",Oh="LightBox-module__slideInRight___S-pPp",Dh="LightBox-module__slideInTop___DFdAj",zh="LightBox-module__slideInBottom___m27kZ",Bh="LightBox-module__fadeOut___55qBR",jh="LightBox-module__slideOutLeft___NvU7P",Vh="LightBox-module__slideOutRight___SK7eC",Gh="LightBox-module__slideOutTop___Vgg0z",Xh="LightBox-module__slideOutBottom___nJ0Ef",qh="LightBox-module__scaleSlide___vZriG",at={hidden:dh,heroImage:uh,background:ph,editor:mh,contentStyle:gh,imageStyle:hh,imgWrapper:fh,contain:yh,cover:vh,caption:xh,captionTextInner:bh,lightboxSplide:Sh,arrow:wh,arrowVertical:$h,nextArrow:Ch,arrowInner:Th,arrowIcon:Lh,arrowImg:Ph,mirror:Ih,thumbsWrapper:Rh,thumbsContainerVertical:kh,thumbsContainer:Eh,thumbsAlignStart:Mh,thumbsAlignCenter:Ah,thumbsAlignEnd:Fh,thumbItem:Nh,closeButton:_h,fadeIn:Hh,slideInLeft:Wh,slideInRight:Oh,slideInTop:Dh,slideInBottom:zh,fadeOut:Bh,slideOutLeft:jh,slideOutRight:Vh,slideOutTop:Gh,slideOutBottom:Xh,scaleSlide:qh},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% + ${N.scalingValue(t.x,n)}), calc(-50% + ${N.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${N.scalingValue(t.x,n)}, calc(-50% + ${N.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${N.scalingValue(t.x,n)}), ${N.scalingValue(t.y,n)})`:i.transform=`translate(${N.scalingValue(t.x,n)}, ${N.scalingValue(t.y,n)})`,i};function Au(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 Uh(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 Fu(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 Kh(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 Nu(e,t,n,i,o){const{x:r,y:l}=Uh(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function Yh(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"?Kh:Fu,{renderedW:u,renderedH:p}=d(n,i,o,r),{offsetX:y,offsetY:v}=Nu(n,i,u,p,c),m=(y+u/2)/n*100,g=(v+p/2)/i*100;return`${m}% ${g}%`}function Zh(e){return Yh(e)}function fa(e){const t=e.getBoundingClientRect(),n=Au(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}=Fu(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:y}=Nu(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 dc(e){const t=e.getBoundingClientRect(),n=Au(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Jh(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 Qh=({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(ef,{isOpen:c,onClose:()=>d(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},ef=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:c})=>{var Te;const{widthSettings:d,fontSettings:u,letterSpacing:p,textAlign:y,wordSpacing:v,fontSizeLineHeight:m,textAppearance:g,color:b}=i.imageCaption??{},[S,A]=s.useState(0),[f,w]=s.useState(0),[G,q]=s.useState(!1),[E,P]=s.useState(!1),[M,X]=s.useState({}),$=s.useRef(null),T=s.useRef(null),O=s.useRef(null),F=s.useRef(!1),L=s.useRef(null),C=s.useRef(null),j=s.useRef(null),x=s.useRef(null),Y=s.useRef(!1),R=s.useRef(null),[H,D]=s.useState(!1),{appear:Q,triggers:ae,slider:z,thumbnail:re,controls:_,area:le,caption:te,layout:fe}=o.lightboxBlock,{appearClass:Pe,backdropAppearClass:xe,backdropDisappearClass:ue,disappearClass:K}=Jh(Q.type,Q.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)},U=()=>{w(Z=>Z+1)};return window.addEventListener("ArticleEditor.Layout:change",h),window.addEventListener("ArticleEditor.ComponentContent:change",U),()=>{window.removeEventListener("ArticleEditor.Layout:change",h),window.removeEventListener("ArticleEditor.ComponentContent:change",U)}},[]),s.useEffect(()=>{if(!e||!re.isActive){D(!1);return}const h=R.current;if(!h)return;const U=()=>{z.direction==="horiz"?D(h.scrollWidth>h.clientWidth):D(h.scrollHeight>h.clientHeight)};U();const Z=new ResizeObserver(U);return Z.observe(h),()=>Z.disconnect()},[e,re.isActive,n.length,M,z.direction]);const de=s.useCallback(()=>{const h=window.matchMedia("(max-width: 768px)").matches,U=N.getColorAlpha(le.color);h&&!l&&U>.9&&(document.body.style.backgroundColor=""),q(!0),F.current=!0;const Z=ne=>{ne.target===L.current&&ne.animationName&&(L.current&&C.current&&L.current.removeEventListener("animationend",C.current),C.current=null,F.current&&(F.current=!1,t()),q(!1))};L.current&&(C.current=Z,L.current.addEventListener("animationend",Z))},[t,le.color,l]),ve=(h,U,Z)=>{var ne,me;if(h){if(ae.type==="click"&&ae.switch==="image")ae.repeat==="close"&&S===n.length-1?de():(ne=$.current)==null||ne.go("+1");else if(ae.type==="click"&&ae.switch==="50/50"){const B=h.getBoundingClientRect(),I=U-B.left,ee=Z-B.top,ie=B.width,pe=B.height;let V;z.direction==="horiz"?V=I<ie/2?"-1":"+1":V=ee<pe/2?"-1":"+1",(me=$.current)==null||me.go(V)}}},$e=h=>{if(Y.current){Y.current=!1;return}const U=n[S],Z=(U==null?void 0:U.image.objectFit)==="cover";let ne,me;if("changedTouches"in h&&h.changedTouches.length>0)ne=h.changedTouches[0].clientX,me=h.changedTouches[0].clientY;else if("clientX"in h)ne=h.clientX,me=h.clientY;else return;let B;if(Z&&O.current){const I=dc(O.current);B=ne>=I.left&&ne<=I.right&&me>=I.top&&me<=I.bottom}else{const I=O.current?fa(O.current):null;if(!I){h.target===h.currentTarget&&de();return}B=ne>=I.x&&ne<=I.x+I.width&&me>=I.y&&me<=I.y+I.height}B?ve(O.current,ne,me):de()},ke=h=>{const U=h.target;(U.classList.contains(at.thumbsWrapper)||U.classList.contains(at.thumbsContainer))&&$e(h)};s.useEffect(()=>{if(!e)return;const h=U=>{var Z,ne;if(U.key==="Escape"){de();return}if(U.key==="ArrowRight"){A(me=>(me+1)%Math.max(n.length,1)),(Z=$.current)==null||Z.go("+1");return}U.key==="ArrowLeft"&&(A(me=>(me-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,de,n.length]),s.useEffect(()=>{if(e){if(A(0),w(U=>U+1),F.current=!1,q(!1),P(!1),X({}),!se)return;const h=new CustomEvent("page-overlay",{detail:{itemId:se}});window.dispatchEvent(h)}return()=>{L.current&&C.current&&(L.current.removeEventListener("animationend",C.current),C.current=null),P(!1)}},[e,se]),s.useEffect(()=>{T.current!==null&&T.current!==z.type&&w(h=>h+1),T.current=z.type},[z.type]),s.useEffect(()=>{if(!e)return;const h=document.body.style.overflow,U=window.matchMedia("(max-width: 768px)").matches,Z=N.getColorAlpha(le.color);document.body.style.overflow="hidden",P(!1);const ne=B=>{B.target===L.current&&!F.current&&B.animationName&&(U&&!l&&Z>.9&&(document.body.style.backgroundColor=le.color),P(!0),L.current&&j.current&&L.current.removeEventListener("animationend",j.current),j.current=null)};L.current&&(j.current=ne,L.current.addEventListener("animationend",ne));const me=B=>{const I=B.target;I&&(I.closest(`.${at.thumbsWrapper}`)||I.closest(`.${at.thumbsContainer}`))||z.type!=="slide"&&B.preventDefault()};return document.addEventListener("touchmove",me,{passive:!1}),()=>{document.body.style.overflow=h,document.removeEventListener("touchmove",me),L.current&&j.current&&(L.current.removeEventListener("animationend",j.current),j.current=null),P(!1)}},[e,l,le.color,z.type]),s.useEffect(()=>{if(!e)return;const h=U=>{var ne,me;if(F.current){U.stopPropagation();return}if(Y.current){Y.current=!1;return}const Z=U.target;if(!(Z&&(Z.closest(`.${at.thumbsContainer}`)||Z.closest(`.${at.thumbItem}`)||Z.closest(`.${at.arrow}`)||Z.closest(`.${at.closeButton}`)||Z.closest(`.${at.caption}`)))){if(z.type==="slide"&&ae.type==="drag"&&((me=(ne=$.current)==null?void 0:ne.splide)!=null&&me.root)){const B=$.current.splide.root;if(Z&&(B.contains(Z)||B===Z))return}if(U.touches.length===0&&U.changedTouches.length>0){const B=n[S],I=(B==null?void 0:B.image.objectFit)==="cover",ee=U.changedTouches[0];let ie;if(I&&O.current){const pe=dc(O.current);ie=ee.clientX>=pe.left&&ee.clientX<=pe.right&&ee.clientY>=pe.top&&ee.clientY<=pe.bottom}else{const pe=O.current?fa(O.current):null;if(!pe)return;ie=ee.clientX>=pe.x&&ee.clientX<=pe.x+pe.width&&ee.clientY>=pe.y&&ee.clientY<=pe.y+pe.height}if(!ie){U.stopPropagation(),F.current=!0;const pe=V=>{V.stopPropagation(),V.preventDefault(),document.removeEventListener("click",pe,!0)};document.addEventListener("click",pe,!0),de()}}}};return document.addEventListener("touchend",h,{passive:!0}),()=>{document.removeEventListener("touchend",h)}},[e,de,S,n]);const he=(z.type==="scale"||z.type==="fade")&&z.direction==="vert"&&ae.type==="drag";s.useEffect(()=>{var V,Ie;if(!e||!he||!((Ie=(V=$.current)==null?void 0:V.splide)!=null&&Ie.root))return;const h=$.current.splide.root,U=30,Z=(be,J)=>{if(x.current){const He=Math.abs(be-x.current.x),We=Math.abs(J-x.current.y);(He>0||We>0)&&(Y.current=!0)}},ne=be=>{x.current&&(be.preventDefault(),Z(be.clientX,be.clientY))},me=be=>{x.current&&be.touches.length>0&&(be.preventDefault(),Z(be.touches[0].clientX,be.touches[0].clientY))},B=(be,J)=>{if(!x.current||!$.current){x.current=null;return}const He=Math.abs(be-x.current.x),We=Math.abs(J-x.current.y);We>U&&We>He&&$.current.go(J<x.current.y?"+1":"-1"),x.current=null},I=be=>{x.current&&B(be.clientX,be.clientY),document.removeEventListener("pointerup",I),document.removeEventListener("pointercancel",I),document.removeEventListener("pointermove",ne)},ee=be=>{if(x.current){if(be.changedTouches.length>0){const J=be.changedTouches[0];B(J.clientX,J.clientY)}document.removeEventListener("touchend",ee),document.removeEventListener("touchcancel",ee),document.removeEventListener("touchmove",me)}},ie=be=>{x.current={x:be.clientX,y:be.clientY},Y.current=!1,document.addEventListener("pointermove",ne,{passive:!1}),document.addEventListener("pointerup",I),document.addEventListener("pointercancel",I)},pe=be=>{be.touches.length>0&&(x.current={x:be.touches[0].clientX,y:be.touches[0].clientY},Y.current=!1,document.addEventListener("touchmove",me,{passive:!1}),document.addEventListener("touchend",ee),document.addEventListener("touchcancel",ee))};return h.addEventListener("pointerdown",ie),h.addEventListener("touchstart",pe),()=>{h.removeEventListener("pointerdown",ie),h.removeEventListener("touchstart",pe),document.removeEventListener("pointermove",ne),document.removeEventListener("pointerup",I),document.removeEventListener("pointercancel",I),document.removeEventListener("touchmove",me),document.removeEventListener("touchend",ee),document.removeEventListener("touchcancel",ee),x.current=null,Y.current=!1}},[e,he,f]);const Se={backgroundColor:le.color,backdropFilter:`blur(${le.blur}px)`,animationDuration:`${parseInt(Q.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:L,className:Tt(at.background,G?ue:xe,{[at.editor]:l},{[at.hidden]:!e}),style:{...Se,...E&&!l&&!G?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?L:null,className:Tt(at.contentStyle,G?K:Pe,{[at.editor]:l},{[at.hidden]:!e}),style:{animationDuration:`${parseInt(Q.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(Ll,{onMove:h=>A(h.index),ref:$,className:at.lightboxSplide,options:{arrows:!1,speed:z.duration?parseInt(z.duration):500,direction:z.direction==="horiz"||z.type==="fade"||z.type==="scale"?"ltr":"ttb",pagination:!1,drag:ae.type==="drag"&&!he,perPage:1,width:"100%",height:"100%",type:z.type==="fade"||z.type==="scale"?"fade":"loop",padding:0,rewind:ae.repeat!=="close",start:0},style:{"--splide-speed":z.duration},children:n.map((h,U)=>{const Z=Fr(fe.position,fe.offset,l),ne=`${N.scalingValue(fe.padding.top,l)} ${N.scalingValue(fe.padding.right,l)} ${N.scalingValue(fe.padding.bottom,l)} ${N.scalingValue(fe.padding.left,l)}`,me=z.type==="scale"?(()=>{const{transform:B,...I}=Z;return{...I,position:"absolute",padding:ne,boxSizing:"border-box","--position-transform":B||"none"}})():{...Z,position:"absolute",padding:ne,boxSizing:"border-box"};return a.jsx(Pl,{children:a.jsx("div",{className:at.imgWrapper,onClick:$e,children:a.jsx("img",{ref:U===S?O:null,className:Tt(at.imageStyle,{[at.contain]:h.image.objectFit==="contain",[at.cover]:h.image.objectFit==="cover",[at.scaleSlide]:z.type==="scale"}),src:h.image.url,alt:h.image.name??"",style:{...me,pointerEvents:h.image.objectFit==="contain"?"none":"auto"}})})},U)})},f),_.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Tt(at.arrow,{[at.arrowVertical]:z.direction==="vert"}),style:{color:_.color,"--arrow-hover-color":_.hover},children:a.jsxs("button",{className:at.arrowInner,style:{transform:`translate(${N.scalingValue(_.offset.x,l)}, ${N.scalingValue(_.offset.y*(z.direction==="horiz"?1:-1),l)}) scale(${_.scale}) rotate(${z.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var h;return(h=$.current)==null?void 0:h.go("-1")},"aria-label":"Previous",children:[_.arrowsImgUrl&&a.jsx(mn,{url:_.arrowsImgUrl,fill:_.color,hoverFill:_.hover,className:Tt(at.arrowImg,at.mirror)}),!_.arrowsImgUrl&&a.jsx(uc,{color:_.color,className:Tt(at.arrowIcon,at.arrowImg,at.mirror)})]})}),a.jsx("div",{className:Tt(at.arrow,at.nextArrow,{[at.arrowVertical]:z.direction==="vert"}),style:{color:_.color,"--arrow-hover-color":_.hover},children:a.jsxs("button",{className:at.arrowInner,style:{transform:`translate(${N.scalingValue(_.offset.x*(z.direction==="horiz"?-1:1),l)}, ${N.scalingValue(_.offset.y,l)}) scale(${_.scale}) rotate(${z.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var h;return(h=$.current)==null?void 0:h.go("+1")},"aria-label":"Next",children:[_.arrowsImgUrl&&a.jsx(mn,{url:_.arrowsImgUrl,fill:_.color,hoverFill:_.hover,className:at.arrowImg}),!_.arrowsImgUrl&&a.jsx(uc,{color:_.color,className:Tt(at.arrowIcon,at.arrowImg)})]})})]}),le.closeIconUrl&&(()=>{const h=Fr(le.closeIconAlign,le.closeIconOffset,l),U=`scale(${le.closeIconScale})`,Z=h.transform?`${h.transform} ${U}`:U;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"})})})(),te&&te.isActive&&i.imageCaption&&((Te=n[S])==null?void 0:Te.imageCaption)&&a.jsx("div",{className:at.caption,style:{...Fr(te.alignment,te.offset,l),fontFamily:Do(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:d.sizing==="auto"?"max-content":N.scalingValue(d.width,l),letterSpacing:N.scalingValue(p,l),wordSpacing:N.scalingValue(v,l),textAlign:y,fontSize:N.scalingValue(m.fontSize,l),lineHeight:N.scalingValue(m.lineHeight,l),textTransform:g.textTransform??"none",textDecoration:g.textDecoration??"none",fontVariant:g.fontVariant??"normal",color:b},onClick:h=>h.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:at.captionTextInner,style:{"--link-color":te.linkColor,"--link-hover-color":te.linkHoverColor},children:a.jsx(Zi,{content:n[S].imageCaption})})}),re.isActive&&(()=>{const[h,U]=re.position.split("-"),Z=z.direction==="horiz"?`${h}-left`:re.position,ne=Fr(Z,re.offset,l),me=()=>{if(z.direction==="horiz"){if(U==="left")return"flex-start";if(U==="center")return"center";if(U==="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:B=>ke(B),style:{position:l?"absolute":"fixed",...ne,...z.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:Tt(at.thumbsContainer,{[at.thumbsContainerVertical]:z.direction==="vert",[at.thumbsAlignStart]:re.align==="start",[at.thumbsAlignCenter]:re.align==="center",[at.thumbsAlignEnd]:re.align==="end"}),style:{gap:N.scalingValue(re.grid.gap,l),justifyContent:H?"flex-start":me()},children:n.map((B,I)=>{const ee=I===S,ie=M[I],V=re.grid.size*(ee?re.activeState.scale:1),Ie=()=>{if(re.fit!=="fit")return{};if(!ie)return z.direction==="horiz"?{height:N.scalingValue(V,l)}:{width:N.scalingValue(V,l)};const be=ie.width/ie.height;if(z.direction==="horiz"){const J=V,He=J*be;return{width:N.scalingValue(He,l),height:N.scalingValue(J,l)}}else{const J=V,He=J/be;return{width:N.scalingValue(J,l),height:N.scalingValue(He,l)}}};return a.jsx("button",{className:at.thumbItem,style:{...z.direction==="horiz"&&re.fit!=="fit"?{height:N.scalingValue(V,l)}:{},...z.direction==="vert"&&re.fit!=="fit"?{width:N.scalingValue(V,l)}:{},...re.fit==="cover"?{width:N.scalingValue(V,l),height:N.scalingValue(V,l)}:{},...Ie(),transition:ee?"all 0.25s ease-out":"none",opacity:ee?re.activeState.opacity/100:re.opacity/100,"--thumb-hover":re.activeState.opacity/100},onClick:be=>{var J;be.stopPropagation(),A(I),(J=$.current)==null||J.go(I)},onMouseEnter:()=>{var be;re.triggers==="hov"&&((be=$.current)==null||be.go(I))},children:a.jsx("img",{src:B.image.url,alt:B.image.name??"",onLoad:be=>{const J=be.currentTarget;J.naturalWidth&&J.naturalHeight&&X(He=>({...He,[I]:{width:J.naturalWidth,height:J.naturalHeight}}))},style:{objectFit:re.fit==="cover"?"cover":"contain",...re.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...re.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${B.image.name}-${I}`)})})})})()]})]}),document.getElementById(r))};function uc({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 tf={element:Qh,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 nf(e){return`
|
|
6
|
+
*/const Xg="RichTextRenderer-module__link___BWeZ2",qg={link:Xg},Ug=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=>Ug(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:_.scalingValue(e.letterSpacing,t),wordSpacing:_.scalingValue(e.wordSpacing,t),fontSize:_.scalingValue(n,t),lineHeight:i!==void 0?_.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 Mu(e){return e!=null&&e.length?e.some(t=>t.type==="link"?Mu(t.children):!!t.text):!1}const Zi=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:qg.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:Kg(i),children:i.text},o));return a.jsx(a.Fragment,{children:e.map((n,i)=>{const o=n.children;return a.jsx("div",{children:Mu(o)?t(o):" "},i)})})};function Kg(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 Yg="SvgImage-module__svg___q3xE-",Zg="SvgImage-module__img___VsTm-",sc={svg:Yg,img:Zg},Jg=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},Qg=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)}},[]),!Jg(e)||!r?a.jsx("img",{src:e,alt:"",className:Tt(sc.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:Tt(sc.svg,i),style:{"--svg":Qg(e),"--fill":t,"--hover-fill":n,...o??{}}})},eh={"top-left":Ct.topLeftAlignment,"top-center":Ct.topCenterAlignment,"top-right":Ct.topRightAlignment,"middle-left":Ct.middleLeftAlignment,"middle-center":Ct.middleCenterAlignment,"middle-right":Ct.middleRightAlignment,"bottom-left":Ct.bottomLeftAlignment,"bottom-center":Ct.bottomCenterAlignment,"bottom-right":Ct.bottomRightAlignment};function th({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,b]=s.useState(void 0),[S,A]=s.useState(null),[f,w]=s.useState(0),[G,q]=s.useState(0),{direction:E,transition:P,controls:M,pagination:X,imageCaption:$,triggers:T}=e,O=s.useRef(P.type),{x:N,y:L}=e.controls.offset,C=j=>{o&&o.go(j)};return s.useEffect(()=>{if(!S)return;const j=new ResizeObserver(x=>{if(!o)return;const[Y]=x;b({width:Math.round(Y.contentRect.width),height:Math.round(Y.contentRect.height)})});return j.observe(S),()=>j.unobserve(S)},[S]),s.useEffect(()=>{!o||O.current===P.type||(q(j=>j+1),O.current=P.type)},[P.type]),a.jsx("div",{className:Tt(Ct.wrapper,{[Ct.editor]:i}),ref:A,children:a.jsxs("div",{className:Ct.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:Tt(Ct.captionBlock),children:a.jsx("div",{className:Ct.captionTextWrapper,children:t.map((j,x)=>a.jsx("div",{className:Tt(Ct.captionText,eh[$.alignment],{[Ct.withPointerEvents]:x===f&&i,[Ct.active]:x===f}),style:{fontFamily:Do(c.fontFamily),fontWeight:c.fontWeight,fontStyle:c.fontStyle,width:l.sizing==="auto"?"max-content":_.scalingValue(l.width,i),letterSpacing:_.scalingValue(d,i),wordSpacing:_.scalingValue(p,i),textAlign:u,fontSize:_.scalingValue(y.fontSize,i),lineHeight:_.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:Ct.captionTextInner,style:{"--link-hover-color":$.linkHoverColor,"--link-color":$.linkColor,position:"relative",top:_.scalingValue($.offset.y,i),left:_.scalingValue($.offset.x,i)},children:a.jsx(Zi,{content:j.imageCaption})})},x))})}),a.jsx(Ll,{onMove:j=>{w(j.index)},ref:r,options:{arrows:!1,speed:P.duration?parseInt(P.duration):500,autoplay:T.autoPlay!==null,...T.autoPlay!==null&&{interval:parseInt(T.autoPlay)*1e3},direction:E==="horiz"||P.type==="fade in"?"ltr":"ttb",pagination:!1,drag:T.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((j,x)=>a.jsx(Pl,{children:a.jsx("div",{className:Ct.sliderItem,children:a.jsx("div",{className:Ct.imgWrapper,children:a.jsx("img",{className:Tt(Ct.sliderImage,{[Ct.contain]:j.image.objectFit==="contain",[Ct.cover]:j.image.objectFit==="cover"}),src:j.image.url,alt:j.image.name??""})})})},x))},G),M.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Tt(Ct.arrow,{[Ct.arrowVertical]:E==="vert",[Ct.hoverArrow]:M.show==="on hover"}),style:{color:M.color,"--arrow-hover-color":M.hover},children:a.jsxs("button",{onClick:()=>{C("-1")},className:Ct.arrowInner,style:{transform:`translate(${_.scalingValue(N,i)}, ${_.scalingValue(L*(E==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:[M.arrowsImgUrl&&a.jsx(mn,{url:M.arrowsImgUrl,fill:M.color,hoverFill:M.hover,className:Tt(Ct.arrowImg,Ct.mirror)}),!M.arrowsImgUrl&&a.jsx(lc,{color:M.color,className:Tt(Ct.arrowIcon,Ct.arrowImg,Ct.mirror)})]})}),a.jsx("div",{className:Tt(Ct.arrow,Ct.nextArrow,{[Ct.arrowVertical]:E==="vert",[Ct.hoverArrow]:M.show==="on hover"}),style:{color:M.color,"--arrow-hover-color":M.hover},children:a.jsxs("button",{className:Ct.arrowInner,onClick:()=>C("+1"),style:{transform:`translate(${_.scalingValue(N*(E==="horiz"?-1:1),i)}, ${_.scalingValue(L,i)}) scale(${e.controls.scale/100}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:[M.arrowsImgUrl&&a.jsx(mn,{url:M.arrowsImgUrl,fill:M.color,hoverFill:M.hover,className:Ct.arrowImg}),!M.arrowsImgUrl&&a.jsx(lc,{color:M.color,className:Tt(Ct.arrowIcon,Ct.arrowImg)})]})})]}),T.triggersList.click&&a.jsx("div",{className:Ct.clickOverlay,onClick:()=>{o&&o.go("+1")}}),X.isActive&&a.jsx("div",{className:Tt(Ct.pagination,{[Ct.paginationInsideBottom]:X.position==="inside-1"&&E==="horiz",[Ct.paginationInsideTop]:X.position==="inside-2"&&E==="horiz",[Ct.paginationOutsideBottom]:X.position==="outside-1"&&E==="horiz",[Ct.paginationOutsideTop]:X.position==="outside-2"&&E==="horiz",[Ct.paginationInsideLeft]:X.position==="inside-1"&&E==="vert",[Ct.paginationInsideRight]:X.position==="inside-2"&&E==="vert",[Ct.paginationOutsideLeft]:X.position==="outside-1"&&E==="vert",[Ct.paginationOutsideRight]:X.position==="outside-2"&&E==="vert",[Ct.paginationVertical]:E==="vert"}),children:a.jsx("div",{className:Ct.paginationInner,style:{backgroundColor:X.colors[2],transform:`scale(${X.scale/100}) translate(${_.scalingValue(X.offset.x,i)}, ${_.scalingValue(X.offset.y,i)}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:t.map((j,x)=>a.jsx("button",{onClick:()=>{o&&o.go(x)},className:Tt(Ct.paginationItem),children:a.jsx("div",{className:Tt(Ct.dot,{[Ct.activeDot]:x===f}),style:{backgroundColor:x===f?X.colors[0]:X.colors[1],"--pagination-hover-color":X.hover}})},x))})})]})})}function lc({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 nh={element:th,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"]}},ih="ImageRevealSlider-module__imageRevealSlider___UE5Ob",oh="ImageRevealSlider-module__image___Qjt-e",rh="ImageRevealSlider-module__link___N-iLG",ah="ImageRevealSlider-module__cursor___2U03d",no={imageRevealSlider:ih,image:oh,link:rh,cursor:ah};function cc(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 sh(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 lh({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,b]=s.useState("none"),S=s.useRef({x:0,y:0}),[A,f]=s.useState(!1),{sizeType:w,imageWidth:G,randomRangeImageWidth:q}=e.imageSize,{revealPosition:E,visible:P}=e.position,{cursorType:M,target:X,defaultCursorScale:$,defaultCursor:T,hoverCursorScale:O,hoverCursor:N}=e.cursor;s.useEffect(()=>{if(!i)return;const j=(R,H)=>{const D=i.getBoundingClientRect(),Q=R-D.left,ae=H-D.top;if(y({x:Q,y:ae}),M==="system"){b("none"),m(1);return}const z=Q,re=ae,F=document.elementFromPoint(D.left+z,D.top+re);if(F&&F.closest("a")){b("none"),m(1);return}const le=cc(z,re,r)||X==="area"?{img:N??"none",scale:O}:{img:T??"none",scale:$};b(le.img),m(le.scale)},x=R=>{R.stopPropagation(),S.current={x:R.clientX,y:R.clientY},j(R.clientX,R.clientY)},Y=()=>{A&&j(S.current.x,S.current.y)};return i.addEventListener("mousemove",x),window.addEventListener("scroll",Y,!0),()=>{i.removeEventListener("mousemove",x),window.removeEventListener("scroll",Y,!0)}},[i,A,p,M,X,N,T,O,$,r]),s.useEffect(()=>{A||(b("none"),m(0))},[A]);const L=async(j,x,Y,R={})=>{const{width:H,height:D,finalWidth:Q}=await sh(j.image.url,w,G,q);let ae=0,z=0;E==="same"?(ae=x/2,z=Y/2):(ae=R.x??Math.random()*x,z=R.y??Math.random()*Y);const re=Math.min(Math.max(ae,H/2),x-H/2),F=Math.min(Math.max(z,D/2),Y-D/2);return{id:u.current++,url:j.image.url,link:j.link,name:j.image.name,x:re,y:F,width:Q}};s.useEffect(()=>{if(!i||t.length===0)return;const j=i.getBoundingClientRect(),x=j.width,Y=j.height,R=[];(async()=>{const D=t[0],Q=await L(D,x,Y);R.push(Q),l(R),d(1)})()},[w,G,q,E,i]),s.useEffect(()=>{P==="last One"&&l(j=>j.length>0?[j[j.length-1]]:[])},[P]);const C=async j=>{if(!i)return;const x=i.getBoundingClientRect(),Y=j.clientX-x.left,R=j.clientY-x.top;if(X==="image"&&!cc(Y,R,r))return;let H=0,D=0;E==="on Click"?(H=Y,D=R):E==="same"?(H=x.width/2,D=x.height/2):(H=Math.random()*x.width,D=Math.random()*x.height);const Q=t[c],ae=await L(Q,x.width,x.height,{x:H,y:D});l(z=>P==="all"?[...z,ae]:[ae]),d(z=>z>=t.length-1?0:z+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(j=>a.jsx("div",{className:no.wrapper,style:{top:`${j.y}px`,left:`${j.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:j.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:X==="area"&&j.link?a.jsx("a",{href:j.link,target:"_blank",className:no.link,children:a.jsx("img",{src:j.url,alt:j.name,className:no.image},j.id)}):a.jsx("img",{src:j.url,alt:j.name,className:no.image},j.id)},j.id)),A&&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 ch={element:lh,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:""}]}}}},dh="LightBox-module__hidden___9s-9x",uh="LightBox-module__heroImage___sTxNF",ph="LightBox-module__background___rm9ml",mh="LightBox-module__editor___4ACaY",gh="LightBox-module__contentStyle___Bgnsq",hh="LightBox-module__imageStyle___tLIlB",fh="LightBox-module__imgWrapper___LuFUp",yh="LightBox-module__contain___8-yaS",vh="LightBox-module__cover___hNvOG",xh="LightBox-module__caption___b6L2I",bh="LightBox-module__captionTextInner___rCGNH",Sh="LightBox-module__lightboxSplide___XFuWC",wh="LightBox-module__arrow___iz38X",$h="LightBox-module__arrowVertical___Zfz81",Ch="LightBox-module__nextArrow___zkAQN",Th="LightBox-module__arrowInner___p48sW",Lh="LightBox-module__arrowIcon___3VaFf",Ph="LightBox-module__arrowImg___pNV88",Ih="LightBox-module__mirror___pjeXc",Rh="LightBox-module__thumbsWrapper___GB-nU",kh="LightBox-module__thumbsContainerVertical___wttk5",Eh="LightBox-module__thumbsContainer___osSma",Mh="LightBox-module__thumbsAlignStart___MO6tY",Ah="LightBox-module__thumbsAlignCenter___Q4sUx",Fh="LightBox-module__thumbsAlignEnd___p4y9R",Nh="LightBox-module__thumbItem___HvnF3",_h="LightBox-module__closeButton___g2khP",Hh="LightBox-module__fadeIn___0m5GW",Wh="LightBox-module__slideInLeft___gPYwC",Oh="LightBox-module__slideInRight___S-pPp",Dh="LightBox-module__slideInTop___DFdAj",zh="LightBox-module__slideInBottom___m27kZ",Bh="LightBox-module__fadeOut___55qBR",jh="LightBox-module__slideOutLeft___NvU7P",Vh="LightBox-module__slideOutRight___SK7eC",Gh="LightBox-module__slideOutTop___Vgg0z",Xh="LightBox-module__slideOutBottom___nJ0Ef",qh="LightBox-module__scaleSlide___vZriG",at={hidden:dh,heroImage:uh,background:ph,editor:mh,contentStyle:gh,imageStyle:hh,imgWrapper:fh,contain:yh,cover:vh,caption:xh,captionTextInner:bh,lightboxSplide:Sh,arrow:wh,arrowVertical:$h,nextArrow:Ch,arrowInner:Th,arrowIcon:Lh,arrowImg:Ph,mirror:Ih,thumbsWrapper:Rh,thumbsContainerVertical:kh,thumbsContainer:Eh,thumbsAlignStart:Mh,thumbsAlignCenter:Ah,thumbsAlignEnd:Fh,thumbItem:Nh,closeButton:_h,fadeIn:Hh,slideInLeft:Wh,slideInRight:Oh,slideInTop:Dh,slideInBottom:zh,fadeOut:Bh,slideOutLeft:jh,slideOutRight:Vh,slideOutTop:Gh,slideOutBottom:Xh,scaleSlide:qh},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% + ${_.scalingValue(t.x,n)}), calc(-50% + ${_.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${_.scalingValue(t.x,n)}, calc(-50% + ${_.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${_.scalingValue(t.x,n)}), ${_.scalingValue(t.y,n)})`:i.transform=`translate(${_.scalingValue(t.x,n)}, ${_.scalingValue(t.y,n)})`,i};function Au(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 Uh(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 Fu(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 Kh(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 Nu(e,t,n,i,o){const{x:r,y:l}=Uh(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function Yh(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"?Kh:Fu,{renderedW:u,renderedH:p}=d(n,i,o,r),{offsetX:y,offsetY:v}=Nu(n,i,u,p,c),m=(y+u/2)/n*100,g=(v+p/2)/i*100;return`${m}% ${g}%`}function Zh(e){return Yh(e)}function fa(e){const t=e.getBoundingClientRect(),n=Au(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}=Fu(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:y}=Nu(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 dc(e){const t=e.getBoundingClientRect(),n=Au(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Jh(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 Qh=({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(ef,{isOpen:c,onClose:()=>d(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},ef=({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:b}=i.imageCaption??{},[S,A]=s.useState(0),[f,w]=s.useState(0),[G,q]=s.useState(!1),[E,P]=s.useState(!1),[M,X]=s.useState({}),$=s.useRef(null),T=s.useRef(null),O=s.useRef(null),N=s.useRef(!1),L=s.useRef(null),C=s.useRef(null),j=s.useRef(null),x=s.useRef(null),Y=s.useRef(!1),R=s.useRef(null),[H,D]=s.useState(!1),{appear:Q,triggers:ae,slider:z,thumbnail:re,controls:F,area:le,caption:te,layout:fe}=o.lightboxBlock,{appearClass:Pe,backdropAppearClass:xe,backdropDisappearClass:de,disappearClass:K}=Jh(Q.type,Q.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)},U=()=>{w(Z=>Z+1)};return window.addEventListener("ArticleEditor.Layout:change",h),window.addEventListener("ArticleEditor.ComponentContent:change",U),()=>{window.removeEventListener("ArticleEditor.Layout:change",h),window.removeEventListener("ArticleEditor.ComponentContent:change",U)}},[]),s.useEffect(()=>{if(!e||!re.isActive){D(!1);return}const h=R.current;if(!h)return;const U=()=>{z.direction==="horiz"?D(h.scrollWidth>h.clientWidth):D(h.scrollHeight>h.clientHeight)};U();const Z=new ResizeObserver(U);return Z.observe(h),()=>Z.disconnect()},[e,re.isActive,n.length,M,z.direction]);const ue=s.useCallback(()=>{const h=window.matchMedia("(max-width: 768px)").matches,U=_.getColorAlpha(le.color);h&&!l&&U>.9&&(document.body.style.backgroundColor=""),q(!0),N.current=!0;const Z=ne=>{ne.target===L.current&&ne.animationName&&(L.current&&C.current&&L.current.removeEventListener("animationend",C.current),C.current=null,N.current&&(N.current=!1,t()),q(!1))};L.current&&(C.current=Z,L.current.addEventListener("animationend",Z))},[t,le.color,l]),ve=(h,U,Z)=>{var ne,me;if(h){if(ae.type==="click"&&ae.switch==="image")ae.repeat==="close"&&S===n.length-1?ue():(ne=$.current)==null||ne.go("+1");else if(ae.type==="click"&&ae.switch==="50/50"){const B=h.getBoundingClientRect(),I=U-B.left,ee=Z-B.top,ie=B.width,pe=B.height;let V;z.direction==="horiz"?V=I<ie/2?"-1":"+1":V=ee<pe/2?"-1":"+1",(me=$.current)==null||me.go(V)}}},$e=h=>{if(Y.current){Y.current=!1;return}const U=n[S],Z=(U==null?void 0:U.image.objectFit)==="cover";let ne,me;if("changedTouches"in h&&h.changedTouches.length>0)ne=h.changedTouches[0].clientX,me=h.changedTouches[0].clientY;else if("clientX"in h)ne=h.clientX,me=h.clientY;else return;let B;if(Z&&O.current){const I=dc(O.current);B=ne>=I.left&&ne<=I.right&&me>=I.top&&me<=I.bottom}else{const I=O.current?fa(O.current):null;if(!I){h.target===h.currentTarget&&ue();return}B=ne>=I.x&&ne<=I.x+I.width&&me>=I.y&&me<=I.y+I.height}B?ve(O.current,ne,me):ue()},ke=h=>{const U=h.target;(U.classList.contains(at.thumbsWrapper)||U.classList.contains(at.thumbsContainer))&&$e(h)};s.useEffect(()=>{if(!e)return;const h=U=>{var Z,ne;if(U.key==="Escape"){ue();return}if(U.key==="ArrowRight"){A(me=>(me+1)%Math.max(n.length,1)),(Z=$.current)==null||Z.go("+1");return}U.key==="ArrowLeft"&&(A(me=>(me-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,ue,n.length]),s.useEffect(()=>{if(e){if(A(0),w(U=>U+1),N.current=!1,q(!1),P(!1),X({}),!se)return;const h=new CustomEvent("page-overlay",{detail:{itemId:se}});window.dispatchEvent(h)}return()=>{L.current&&C.current&&(L.current.removeEventListener("animationend",C.current),C.current=null),P(!1)}},[e,se]),s.useEffect(()=>{T.current!==null&&T.current!==z.type&&w(h=>h+1),T.current=z.type},[z.type]),s.useEffect(()=>{if(!e)return;const h=document.body.style.overflow,U=window.matchMedia("(max-width: 768px)").matches,Z=_.getColorAlpha(le.color);document.body.style.overflow="hidden",P(!1);const ne=B=>{B.target===L.current&&!N.current&&B.animationName&&(U&&!l&&Z>.9&&(document.body.style.backgroundColor=le.color),P(!0),L.current&&j.current&&L.current.removeEventListener("animationend",j.current),j.current=null)};L.current&&(j.current=ne,L.current.addEventListener("animationend",ne));const me=B=>{const I=B.target;I&&(I.closest(`.${at.thumbsWrapper}`)||I.closest(`.${at.thumbsContainer}`))||z.type!=="slide"&&B.preventDefault()};return document.addEventListener("touchmove",me,{passive:!1}),()=>{document.body.style.overflow=h,document.removeEventListener("touchmove",me),L.current&&j.current&&(L.current.removeEventListener("animationend",j.current),j.current=null),P(!1)}},[e,l,le.color,z.type]),s.useEffect(()=>{if(!e)return;const h=U=>{var ne,me;if(N.current){U.stopPropagation();return}if(Y.current){Y.current=!1;return}const Z=U.target;if(!(Z&&(Z.closest(`.${at.thumbsContainer}`)||Z.closest(`.${at.thumbItem}`)||Z.closest(`.${at.arrow}`)||Z.closest(`.${at.closeButton}`)||Z.closest(`.${at.caption}`)))){if(z.type==="slide"&&ae.type==="drag"&&((me=(ne=$.current)==null?void 0:ne.splide)!=null&&me.root)){const B=$.current.splide.root;if(Z&&(B.contains(Z)||B===Z))return}if(U.touches.length===0&&U.changedTouches.length>0){const B=n[S],I=(B==null?void 0:B.image.objectFit)==="cover",ee=U.changedTouches[0];let ie;if(I&&O.current){const pe=dc(O.current);ie=ee.clientX>=pe.left&&ee.clientX<=pe.right&&ee.clientY>=pe.top&&ee.clientY<=pe.bottom}else{const pe=O.current?fa(O.current):null;if(!pe)return;ie=ee.clientX>=pe.x&&ee.clientX<=pe.x+pe.width&&ee.clientY>=pe.y&&ee.clientY<=pe.y+pe.height}if(!ie){U.stopPropagation(),N.current=!0;const pe=V=>{V.stopPropagation(),V.preventDefault(),document.removeEventListener("click",pe,!0)};document.addEventListener("click",pe,!0),ue()}}}};return document.addEventListener("touchend",h,{passive:!0}),()=>{document.removeEventListener("touchend",h)}},[e,ue,S,n]);const he=(z.type==="scale"||z.type==="fade")&&z.direction==="vert"&&ae.type==="drag";s.useEffect(()=>{var V,Ie;if(!e||!he||!((Ie=(V=$.current)==null?void 0:V.splide)!=null&&Ie.root))return;const h=$.current.splide.root,U=30,Z=(be,J)=>{if(x.current){const He=Math.abs(be-x.current.x),We=Math.abs(J-x.current.y);(He>0||We>0)&&(Y.current=!0)}},ne=be=>{x.current&&(be.preventDefault(),Z(be.clientX,be.clientY))},me=be=>{x.current&&be.touches.length>0&&(be.preventDefault(),Z(be.touches[0].clientX,be.touches[0].clientY))},B=(be,J)=>{if(!x.current||!$.current){x.current=null;return}const He=Math.abs(be-x.current.x),We=Math.abs(J-x.current.y);We>U&&We>He&&$.current.go(J<x.current.y?"+1":"-1"),x.current=null},I=be=>{x.current&&B(be.clientX,be.clientY),document.removeEventListener("pointerup",I),document.removeEventListener("pointercancel",I),document.removeEventListener("pointermove",ne)},ee=be=>{if(x.current){if(be.changedTouches.length>0){const J=be.changedTouches[0];B(J.clientX,J.clientY)}document.removeEventListener("touchend",ee),document.removeEventListener("touchcancel",ee),document.removeEventListener("touchmove",me)}},ie=be=>{x.current={x:be.clientX,y:be.clientY},Y.current=!1,document.addEventListener("pointermove",ne,{passive:!1}),document.addEventListener("pointerup",I),document.addEventListener("pointercancel",I)},pe=be=>{be.touches.length>0&&(x.current={x:be.touches[0].clientX,y:be.touches[0].clientY},Y.current=!1,document.addEventListener("touchmove",me,{passive:!1}),document.addEventListener("touchend",ee),document.addEventListener("touchcancel",ee))};return h.addEventListener("pointerdown",ie),h.addEventListener("touchstart",pe),()=>{h.removeEventListener("pointerdown",ie),h.removeEventListener("touchstart",pe),document.removeEventListener("pointermove",ne),document.removeEventListener("pointerup",I),document.removeEventListener("pointercancel",I),document.removeEventListener("touchmove",me),document.removeEventListener("touchend",ee),document.removeEventListener("touchcancel",ee),x.current=null,Y.current=!1}},[e,he,f]);const Se={backgroundColor:le.color,backdropFilter:`blur(${le.blur}px)`,animationDuration:`${parseInt(Q.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:L,className:Tt(at.background,G?de:xe,{[at.editor]:l},{[at.hidden]:!e}),style:{...Se,...E&&!l&&!G?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?L:null,className:Tt(at.contentStyle,G?K:Pe,{[at.editor]:l},{[at.hidden]:!e}),style:{animationDuration:`${parseInt(Q.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(Ll,{onMove:h=>A(h.index),ref:$,className:at.lightboxSplide,options:{arrows:!1,speed:z.duration?parseInt(z.duration):500,direction:z.direction==="horiz"||z.type==="fade"||z.type==="scale"?"ltr":"ttb",pagination:!1,drag:ae.type==="drag"&&!he,perPage:1,width:"100%",height:"100%",type:z.type==="fade"||z.type==="scale"?"fade":"loop",padding:0,rewind:ae.repeat!=="close",start:0},style:{"--splide-speed":z.duration},children:n.map((h,U)=>{const Z=Fr(fe.position,fe.offset,l),ne=`${_.scalingValue(fe.padding.top,l)} ${_.scalingValue(fe.padding.right,l)} ${_.scalingValue(fe.padding.bottom,l)} ${_.scalingValue(fe.padding.left,l)}`,me=z.type==="scale"?(()=>{const{transform:B,...I}=Z;return{...I,position:"absolute",padding:ne,boxSizing:"border-box","--position-transform":B||"none"}})():{...Z,position:"absolute",padding:ne,boxSizing:"border-box"};return a.jsx(Pl,{children:a.jsx("div",{className:at.imgWrapper,onClick:$e,children:a.jsx("img",{ref:U===S?O:null,className:Tt(at.imageStyle,{[at.contain]:h.image.objectFit==="contain",[at.cover]:h.image.objectFit==="cover",[at.scaleSlide]:z.type==="scale"}),src:h.image.url,alt:h.image.name??"",style:{...me,pointerEvents:h.image.objectFit==="contain"?"none":"auto"}})})},U)})},f),F.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Tt(at.arrow,{[at.arrowVertical]:z.direction==="vert"}),style:{color:F.color,"--arrow-hover-color":F.hover},children:a.jsxs("button",{className:at.arrowInner,style:{transform:`translate(${_.scalingValue(F.offset.x,l)}, ${_.scalingValue(F.offset.y*(z.direction==="horiz"?1:-1),l)}) scale(${F.scale}) rotate(${z.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var h;return(h=$.current)==null?void 0:h.go("-1")},"aria-label":"Previous",children:[F.arrowsImgUrl&&a.jsx(mn,{url:F.arrowsImgUrl,fill:F.color,hoverFill:F.hover,className:Tt(at.arrowImg,at.mirror)}),!F.arrowsImgUrl&&a.jsx(uc,{color:F.color,className:Tt(at.arrowIcon,at.arrowImg,at.mirror)})]})}),a.jsx("div",{className:Tt(at.arrow,at.nextArrow,{[at.arrowVertical]:z.direction==="vert"}),style:{color:F.color,"--arrow-hover-color":F.hover},children:a.jsxs("button",{className:at.arrowInner,style:{transform:`translate(${_.scalingValue(F.offset.x*(z.direction==="horiz"?-1:1),l)}, ${_.scalingValue(F.offset.y,l)}) scale(${F.scale}) rotate(${z.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var h;return(h=$.current)==null?void 0:h.go("+1")},"aria-label":"Next",children:[F.arrowsImgUrl&&a.jsx(mn,{url:F.arrowsImgUrl,fill:F.color,hoverFill:F.hover,className:at.arrowImg}),!F.arrowsImgUrl&&a.jsx(uc,{color:F.color,className:Tt(at.arrowIcon,at.arrowImg)})]})})]}),le.closeIconUrl&&(()=>{const h=Fr(le.closeIconAlign,le.closeIconOffset,l),U=`scale(${le.closeIconScale})`,Z=h.transform?`${h.transform} ${U}`:U;return a.jsx("button",{className:at.closeButton,style:{...h,transform:Z},onClick:ue,"aria-label":"Close lightbox",children:a.jsx(mn,{url:le.closeIconUrl,fill:le.closeIconColor??"#000000",hoverFill:le.closeIconHover??"#cccccc"})})})(),te&&te.isActive&&i.imageCaption&&((Ce=n[S])==null?void 0:Ce.imageCaption)&&a.jsx("div",{className:at.caption,style:{...Fr(te.alignment,te.offset,l),fontFamily:Do(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:d.sizing==="auto"?"max-content":_.scalingValue(d.width,l),letterSpacing:_.scalingValue(p,l),wordSpacing:_.scalingValue(v,l),textAlign:y,fontSize:_.scalingValue(m.fontSize,l),lineHeight:_.scalingValue(m.lineHeight,l),textTransform:g.textTransform??"none",textDecoration:g.textDecoration??"none",fontVariant:g.fontVariant??"normal",color:b},onClick:h=>h.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:at.captionTextInner,style:{"--link-color":te.linkColor,"--link-hover-color":te.linkHoverColor},children:a.jsx(Zi,{content:n[S].imageCaption})})}),re.isActive&&(()=>{const[h,U]=re.position.split("-"),Z=z.direction==="horiz"?`${h}-left`:re.position,ne=Fr(Z,re.offset,l),me=()=>{if(z.direction==="horiz"){if(U==="left")return"flex-start";if(U==="center")return"center";if(U==="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:B=>ke(B),style:{position:l?"absolute":"fixed",...ne,...z.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:Tt(at.thumbsContainer,{[at.thumbsContainerVertical]:z.direction==="vert",[at.thumbsAlignStart]:re.align==="start",[at.thumbsAlignCenter]:re.align==="center",[at.thumbsAlignEnd]:re.align==="end"}),style:{gap:_.scalingValue(re.grid.gap,l),justifyContent:H?"flex-start":me()},children:n.map((B,I)=>{const ee=I===S,ie=M[I],V=re.grid.size*(ee?re.activeState.scale:1),Ie=()=>{if(re.fit!=="fit")return{};if(!ie)return z.direction==="horiz"?{height:_.scalingValue(V,l)}:{width:_.scalingValue(V,l)};const be=ie.width/ie.height;if(z.direction==="horiz"){const J=V,He=J*be;return{width:_.scalingValue(He,l),height:_.scalingValue(J,l)}}else{const J=V,He=J/be;return{width:_.scalingValue(J,l),height:_.scalingValue(He,l)}}};return a.jsx("button",{className:at.thumbItem,style:{...z.direction==="horiz"&&re.fit!=="fit"?{height:_.scalingValue(V,l)}:{},...z.direction==="vert"&&re.fit!=="fit"?{width:_.scalingValue(V,l)}:{},...re.fit==="cover"?{width:_.scalingValue(V,l),height:_.scalingValue(V,l)}:{},...Ie(),transition:ee?"all 0.25s ease-out":"none",opacity:ee?re.activeState.opacity/100:re.opacity/100,"--thumb-hover":re.activeState.opacity/100},onClick:be=>{var J;be.stopPropagation(),A(I),(J=$.current)==null||J.go(I)},onMouseEnter:()=>{var be;re.triggers==="hov"&&((be=$.current)==null||be.go(I))},children:a.jsx("img",{src:B.image.url,alt:B.image.name??"",onLoad:be=>{const J=be.currentTarget;J.naturalWidth&&J.naturalHeight&&X(He=>({...He,[I]:{width:J.naturalWidth,height:J.naturalHeight}}))},style:{objectFit:re.fit==="cover"?"cover":"contain",...re.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...re.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${B.image.name}-${I}`)})})})})()]})]}),document.getElementById(r))};function uc({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 tf={element:Qh,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 nf(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 of({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:r}){const l=!!n,c=i&&t||!t,{prefix:d}=
|
|
158
|
+
`}function of({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:r}){const l=!!n,c=i&&t||!t,{prefix:d}=_.useScopedStyles(),{type:u="A",fieldsToShow:p=2,textareaRows:y=1,fields:v=[],buttonLabel:m,gap:g,fieldsGap:b,buttonCorners:S,buttonStroke:A,buttonPadding:f,isButtonFullWidth:w,inputCorners:G,inputStroke:q,inputPadding:E,inputColor:P,inputTextColor:M,inputBorderColor:X,placeholderColor:$,buttonColor:T,buttonTextColor:O,buttonBorderColor:N,labelTextColor:L,successColor:C,errorColor:j,fontFamily:x,inputFontSettings:Y,inputFontSize:R,inputLineHeight:H,inputLetterSpacing:D,inputWordSpacing:Q,inputTextAppearance:ae,buttonFontSettings:z,buttonFontSize:re,buttonLineHeight:F,buttonLetterSpacing:le,buttonWordSpacing:te,buttonTextAppearance:fe,labelFontSettings:Pe,labelFontSize:xe,labelLineHeight:de,labelLetterSpacing:K,labelWordSpacing:se,labelTextAppearance:ue,statusFontSettings:ve,statusFontSize:$e,statusLineHeight:ke,statusLetterSpacing:he,statusWordSpacing:Se,statusTextAppearance:Ce,successMessage:h,errorMessage:U,stateOverrides:Z}=e,ne=u==="B",me=v.slice(0,Math.min(p,v.length)),B={fontSettings:{fontFamily:x,fontWeight:(Y==null?void 0:Y.fontWeight)??400,fontStyle:(Y==null?void 0:Y.fontStyle)??"normal"},fontSize:R??.01,lineHeight:H,letterSpacing:D??0,wordSpacing:Q??0,textAppearance:ae,color:M},I=dn(Qt(B,t)),ee=_.scalingValue(q??0,t),ie=Xe=>_.scalingValue((H??R??.01)*Xe+((E==null?void 0:E.top)??0)+((E==null?void 0:E.bottom)??0)+(u==="C"?q??0:(q??0)*2),t),pe=ie(1),V=ie(Math.max(1,y)),Ie={...I,borderStyle:"solid",borderRadius:u==="C"?0:_.scalingValue(G??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:ee,borderLeftWidth:0}:{borderWidth:ee},paddingTop:_.scalingValue((E==null?void 0:E.top)??0,t),paddingRight:_.scalingValue((E==null?void 0:E.right)??0,t),paddingBottom:_.scalingValue((E==null?void 0:E.bottom)??0,t),paddingLeft:_.scalingValue((E==null?void 0:E.left)??0,t),height:pe,minHeight:pe},be={fontSettings:{fontFamily:x,fontWeight:(z==null?void 0:z.fontWeight)??400,fontStyle:(z==null?void 0:z.fontStyle)??"normal"},fontSize:re??.01,lineHeight:F,letterSpacing:le??0,wordSpacing:te??0,textAppearance:fe,color:O},J=dn(Qt(be,t)),He=_.scalingValue(A??0,t),We={fontSettings:{fontFamily:x,fontWeight:(Pe==null?void 0:Pe.fontWeight)??400,fontStyle:(Pe==null?void 0:Pe.fontStyle)??"normal"},fontSize:xe??.01,lineHeight:de,letterSpacing:K??0,wordSpacing:se??0,textAppearance:ue,color:L},it=Qt(We,t),qe={fontSettings:{fontFamily:x,fontWeight:(ve==null?void 0:ve.fontWeight)??400,fontStyle:(ve==null?void 0:ve.fontStyle)??"normal"},fontSize:$e??.01,lineHeight:ke,letterSpacing:he??0,wordSpacing:Se??0,textAppearance:Ce,color:C},tt=dn(Qt(qe,t)),et=_.buildColorVars(d,{inputColor:P,inputTextColor:M,inputBorderColor:X,placeholderColor:$!=null&&$.trim()?$:"#cccccc",buttonColor:T,buttonTextColor:O,buttonBorderColor:N,labelTextColor:L,successColor:C,errorColor:j},rf,af,Z),[je,ye]=s.useState(()=>Object.fromEntries(me.map(Xe=>[Xe.name,""]))),[_e,Be]=s.useState("idle"),[Ze,we]=s.useState(null),Fe=r==="success"?"success":r==="error"?"error":_e,Ke=r==="error"?U:Ze,Je=r==="filled",st=s.useMemo(()=>{if(!Je)return je;let Xe=null;for(const dt of me)(je[dt.name]??"").trim().length>0||(Xe=Xe??{...je},Xe[dt.name]="Filled");return Xe??je},[je,Je,me]),ot=Fe==="error"?_.getFormFieldValidationError(me,st):null,Ae=`${r&&r!=="default"?`${d}-state-${r}`:""}`.trim(),gt=o==null?void 0:o.submitUrl,ze=(Xe,dt)=>{ye(ge=>({...ge,[Xe]:dt}))},De=async Xe=>{if(Xe.preventDefault(),!c)return;const dt=Object.fromEntries(me.map(Re=>{var nt;return[Re.name,((nt=je[Re.name])==null?void 0:nt.trim())??""]}).filter(([,Re])=>Re));if(!gt){Be("error"),we("No integrations were found for this form.");return}if(Object.keys(dt).length===0)return;const ge=_.getFormFieldValidationError(me,je);if(ge){Be("error"),we(ge);return}Be("submitting"),we(null);try{const Re=await fetch(gt,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(dt)});if(!Re.ok){const nt=await Re.text();throw new Error(nt||`Request failed: ${Re.status}`)}Be("success"),ye(Object.fromEntries(me.map(nt=>[nt.name,""])))}catch(Re){Be("error"),we(Re instanceof Error?Re.message:"Something went wrong")}};return a.jsxs("div",{className:`${d}-wrapper ${d}-type-${u} ${Ae}`.trim(),style:et,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:nf(d)}}),a.jsxs("form",{onSubmit:De,className:`${d}-form`,children:[a.jsx("div",{className:`${d}-fields`,children:me.map((Xe,dt)=>a.jsxs(s.Fragment,{children:[dt>0&&a.jsx("div",{"data-controls":l?"fieldsGap":void 0,className:l?`${d}-control`:void 0,style:{height:_.scalingValue(b??0,t)}}),a.jsxs("div",{className:`${d}-field-group${ne?` ${d}-labeled`:""}`,children:[ne&&a.jsx("span",{className:`${d}-field-label`,style:it?{...it,lineHeight:it.fontSize}:void 0,children:Xe.label||Xe.name}),Xe.type==="textarea"?a.jsx("textarea",{name:Xe.name,autoComplete:"off",value:st[Xe.name]??"",onChange:ge=>ze(Xe.name,ge.target.value),placeholder:Xe.placeholder,className:`${d}-input`,style:{...Ie,height:V,minHeight:V},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:ge=>ze(Xe.name,ge.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})]})]},dt))}),a.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${d}-control`:void 0,style:{height:_.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:_.scalingValue(S??0,t),borderWidth:He,paddingTop:_.scalingValue((f==null?void 0:f.top)??0,t),paddingRight:_.scalingValue((f==null?void 0:f.right)??0,t),paddingBottom:_.scalingValue((f==null?void 0:f.bottom)??0,t),paddingLeft:_.scalingValue((f==null?void 0:f.left)??0,t),pointerEvents:c?"auto":void 0,...J,...w?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:a.jsx("span",{className:`${d}-overlay-anchor`,style:w?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:_e==="submitting"?"...":m})})})]}),Fe==="success"&&a.jsx("p",{className:`${d}-success`,style:{...tt},children:h}),Fe==="error"&&a.jsx("p",{className:`${d}-error`,style:{...tt},role:"alert",children:ot??Ke??U})]})}const rf={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"},af=["hover","focus","filled","success","error"],sf=`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 mf=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:r}=
|
|
989
|
+
`}const mf=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:r}=_.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:b,inputWordSpacing:S,inputTextAppearance:A,buttonFontSettings:f,buttonFontSize:w,buttonLineHeight:G,buttonLetterSpacing:q,buttonWordSpacing:E,buttonTextAppearance:P,statusFontSettings:M,statusFontSize:X,statusLineHeight:$,statusLetterSpacing:T,statusWordSpacing:O,statusTextAppearance:N,iconMaxWidth:L,minHeight:C,corners:j,stroke:x,stateOverrides:Y,inputPadding:R,buttonPadding:H,successMessage:D="Thanks for subscribing!",errorMessage:Q="Please, fill all required fields."}=e,ae=c.slice(0,Math.min(p,c.length)),[z,re]=s.useState(()=>Object.fromEntries(ae.map(be=>[be.name,""]))),[F,le]=s.useState("idle"),[te,fe]=s.useState(null),Pe=o==="success"?"success":o==="error"?"error":F,xe=o==="error"?Q:te,de=o==="filled",K=s.useMemo(()=>{if(!de)return z;let be=null;for(const J of ae)(z[J.name]??"").trim().length>0||(be=be??{...z},be[J.name]="Filled");return be??z},[de,z,ae]),se=Pe==="error"?_.getFormFieldValidationError(ae,K):null,ue=o&&o!=="default"?`${r}-state-${o}`:"",ve=ae.some(be=>(K[be.name]??"").trim().length>0),$e=ue!==`${r}-state-filled`&&ve?`${r}-state-filled`:"",ke=`${ue} ${$e}`.trim(),he=i==null?void 0:i.submitUrl,Se=u??"",Ce=(d==null?void 0:d.icon)??"",h=(d==null?void 0:d.mode)==="On",U=Se||"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:b??0,wordSpacing:S??0,textAppearance:A,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:w??.01,lineHeight:G,letterSpacing:q??0,wordSpacing:E??0,textAppearance:P,color:e.buttonTextColor??"#ffffff"},me={fontSettings:{fontFamily:y,fontWeight:(M==null?void 0:M.fontWeight)??400,fontStyle:(M==null?void 0:M.fontStyle)??"normal"},fontSize:X??.01,lineHeight:$,letterSpacing:T??0,wordSpacing:O??0,textAppearance:N,color:e.successColor??"#22c55e"},B=dn(Qt(Z,t)),I=dn(Qt(ne,t)),ee=dn(Qt(me,t)),ie=_.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"},gf,hf,Y),pe={borderRadius:_.scalingValue(j,t),borderWidth:_.scalingValue(x,t),borderStyle:"solid"},V={borderLeftWidth:_.scalingValue(x,t)},Ie=async be=>{if(be.preventDefault(),!l)return;const J=Object.fromEntries(ae.map(We=>{var it;return[We.name,((it=z[We.name])==null?void 0:it.trim())??""]}).filter(([,We])=>We));if(!he){le("error"),fe("No integrations were found for this form.");return}if(Object.keys(J).length===0)return;const He=_.getFormFieldValidationError(ae,z);if(He){le("error"),fe(He);return}le("submitting"),fe(null);try{const We=await fetch(he,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)});if(!We.ok){const it=await We.text();throw new Error(it||`Request failed: ${We.status}`)}le("success"),re(Object.fromEntries(ae.map(it=>[it.name,""])))}catch(We){le("error"),fe(We instanceof Error?We.message:"Something went wrong")}};return a.jsxs("div",{className:`${r}-wrapper ${ke}`.trim(),style:ie,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:pf(r)}}),a.jsxs("form",{onSubmit:Ie,className:`${r}-form`,style:{...pe,height:_.scalingValue(C,t),minHeight:_.scalingValue(C,t)},children:[a.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:ae.map(be=>a.jsx("input",{type:be.type==="email"?"email":be.type==="phone"?"tel":"text",name:be.name,autoComplete:"off",value:K[be.name]??"",onChange:J=>re(He=>({...He,[be.name]:J.target.value})),placeholder:be.placeholder,required:be.isRequired??be.type==="email",className:`${r}-input`,style:{...B,paddingRight:_.scalingValue(R.right,t),paddingLeft:_.scalingValue(R.left,t),paddingTop:_.scalingValue(R.top,t),paddingBottom:_.scalingValue(R.bottom,t)}},be.name))}),a.jsx("div",{className:`${r}-overlayAnchor`,children:a.jsx("button",{type:l?"submit":"button",className:`${r}-submitBtn`,"aria-label":U,style:{...I,...V,paddingRight:_.scalingValue(H.right,t),paddingLeft:_.scalingValue(H.left,t),paddingTop:_.scalingValue(H.top,t),paddingBottom:_.scalingValue(H.bottom,t),pointerEvents:l?"auto":void 0},children:F==="submitting"?"...":h?Ce&&a.jsx(mn,{url:Ce,className:`${r}-submitBtnIcon`,style:{maxWidth:_.scalingValue(L??0,t)},fill:`var(--${r}-button-text-color)`,hoverFill:`var(--${r}-button-text-color)`}):Se})})]}),Pe==="success"&&a.jsx("p",{className:`${r}-success`,style:{...ee},children:D}),Pe==="error"&&a.jsx("p",{className:`${r}-error`,style:{...ee},role:"alert",children:se??xe??Q})]})},gf={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"},hf=["hover","focus","filled","success","error"],ff=`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';
|
|
@@ -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 $f=30,Cf=20,Ya=3,Tf=12,Lf=32,Pf=3,If=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")},Rf=(e,t)=>Array.from({length:t},()=>e).flat(),kf=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},_u=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),pc=(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=_u(c);return d<=0?0:d+r*Math.max(0,t-1)},Ef=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=_u(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},Mf=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},Af=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>Mf(i,e))},Ff=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??"")},Nf=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,_f=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:r,imageHoverClass:l,isFirstSet:c,scaled:d,onFirstSetImageDone:u})=>{var O,
|
|
1700
|
+
`}const $f=30,Cf=20,Ya=3,Tf=12,Lf=32,Pf=3,If=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")},Rf=(e,t)=>Array.from({length:t},()=>e).flat(),kf=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},_u=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),pc=(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=_u(c);return d<=0?0:d+r*Math.max(0,t-1)},Ef=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=_u(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},Mf=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},Af=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>Mf(i,e))},Ff=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??"")},Nf=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,_f=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:r,imageHoverClass:l,isFirstSet:c,scaled:d,onFirstSetImageDone:u})=>{var O,N,L,C;const p=s.useRef(null),y=!!((O=e.image)!=null&&O.url&&Ff(e.image));s.useLayoutEffect(()=>{c&&Nf(p.current)&&(u==null||u())},[c,(N=e.image)==null?void 0:N.url,u]);const v=n.display==="cover",m=n.ratioValue??"1:1",g=n.reversed??!1,[b,S]=m.split(":").map(Number),w=(g?S:b)/(g?b:S),G=i/w,q=G>o?o:G,E=G>o?o*w:i,P=d(E),M=d(q),X={borderRadius:d(r)},$=v?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...X}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:d(i),maxHeight:d(o),objectFit:"contain",...X},T=((L=e.image)==null?void 0:L.url)&&(y?a.jsx("video",{ref:j=>{p.current=j},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:j=>{p.current=j},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:M,overflow:"hidden",...X}:{width:"max-content",maxWidth:d(i),height:d(o)}},children:T&&e.link?a.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:Tt(`${t}-marquee-link`,!v&&`${t}-marquee-link-contain`),children:T}):T})})},Hf=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=_.useScopedStyles(),[l,c]=s.useState(0),d=l>0?Math.round(l):0,u=s.useMemo(()=>wf(r,d),[r,d]),{speed:p,direction:y,pauseOnHover:v,gap:m,imageMaxWidth:g,imageMaxHeight:b,hoverEffect:S,cornerRadius:A=0}=e,f=s.useMemo(()=>kf(e.imageFit),[e.imageFit]),w=(t==null?void 0:t.length)??0,G=!!o,q=!n||!!i,E=q&&S!=="off"&&S!=="randomize"?`${r}-image-hover-${S}`:void 0,P=n?!!i:!0,X=((t==null?void 0:t.length)??0)>0&&(P||!!n),$=Math.max(0,p)*$f,T=$e=>_.scalingValue($e,n??!1),O=s.useRef(null),N=s.useRef(null),L=s.useRef(null),[C,j]=s.useState(0),x=P&&v==="on",[Y,R]=s.useState(!1),[H,D]=s.useState({}),Q=s.useRef(H);Q.current=H;const ae=s.useRef(null),z=s.useRef(0),re=s.useRef(null),F=s.useMemo(()=>(t??[]).map($e=>{var ke;return((ke=$e.image)==null?void 0:ke.url)??""}).join("\0"),[t]),[le,te]=s.useState(Ya),fe=s.useMemo(()=>{const $e=t??[];return $e.length===0||!(P||!!n)?$e:Rf($e,le)},[t,P,le,n]),Pe=s.useMemo(()=>(t??[]).filter($e=>{var ke;return!!((ke=$e.image)!=null&&ke.url)}).length,[t]),xe=X?Pf:1;s.useLayoutEffect(()=>{z.current=0,D({}),ae.current=null,te(Ya),c(0)},[F]),s.useEffect(()=>{if(!q||S!=="randomize")return;const $e=O.current;if(!$e)return;const ke=h=>{D(U=>{const Z=Array.from(h).filter(me=>me in U&&!Af($e,me));if(Z.length===0)return U;const ne={...U};return Z.forEach(me=>{delete ne[me]}),ne})},he=new IntersectionObserver(h=>{const U=new Set;for(const Z of h){const ne=Z.target.dataset.marqueeItemIndex,me=ne!==void 0?Number(ne):NaN;Number.isNaN(me)||U.add(me)}U.size>0&&ke(U)},{root:$e,threshold:0});Object.keys(H).forEach(h=>{const U=Number(h);$e.querySelectorAll(`[data-marquee-item-index="${U}"]`).forEach(Z=>he.observe(Z))});const Se={current:0},Ce=()=>{const h=Object.keys(Q.current);h.length!==0&&(ke(h.map(Number)),Se.current=requestAnimationFrame(Ce))};return Object.keys(Q.current).length>0&&(Se.current=requestAnimationFrame(Ce)),()=>{cancelAnimationFrame(Se.current),he.disconnect()}},[S,H,q]),s.useLayoutEffect(()=>{if(!X)return;const $e=O.current,ke=L.current;if(!$e||!ke)return;const he={current:0},Se=()=>{const U=$e.getBoundingClientRect().width||$e.offsetWidth,Z=Ef(ke),ne=ae.current,me=typeof ne=="number"&&Math.abs(ne-Z)<=.25;ae.current=Z;let B=le,I=0;if((P||n)&&w>0&&U>0){const pe=pc(ke,w);if(pe>=Lf){I=pe;const V=Math.min(Tf,Math.max(Ya,Math.ceil(U/pe)+1));B=V,V!==le&&te(V)}}const ie=B!==le&&I>0?I*B:Z>0?Z:I>0?I*B:(()=>{const pe=pc(ke,w);return pe>0?pe*B:0})();ie>0?c(pe=>pe<=0?ie:!me||Math.round(pe)===Math.round(ie)?pe:ie):!me&&l<=0&&(cancelAnimationFrame(he.current),he.current=requestAnimationFrame(Se))},Ce=()=>{cancelAnimationFrame(he.current),he.current=requestAnimationFrame(Se)};re.current=Ce,Ce();const h=new ResizeObserver(Ce);return h.observe($e),h.observe(ke),()=>{re.current=null,cancelAnimationFrame(he.current),h.disconnect()}},[P,X,l,F,le,w,n]),s.useLayoutEffect(()=>{if(!X||d<=0)return;const $e=N.current;$e&&If($e)},[X,d,y,$]),s.useLayoutEffect(()=>{if(!X||l<=0){j(0);return}const $e=N.current,ke=L.current;if(!$e||!ke)return;const he=()=>{const Ce=$e.offsetHeight||$e.getBoundingClientRect().height,h=Array.from(ke.children).reduce((Z,ne)=>Math.max(Z,ne.offsetHeight||ne.getBoundingClientRect().height),0),U=Ce>0?Ce:h;j(U>0?U:0)};he();const Se=new ResizeObserver(he);return Se.observe($e),Se.observe(ke),()=>Se.disconnect()},[X,xe,fe,n,m,g,b,l,f,H]),s.useLayoutEffect(()=>{if(!n||!G||!X||typeof window>"u")return;const $e=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame($e)},[n,G,X,y,l,C,m,fe]);const de=()=>{x&&R(!0)},K=()=>{x&&R(!1)},se=s.useCallback(()=>{var $e;z.current=Math.min(Pe,z.current+1),($e=re.current)==null||$e.call(re)},[Pe]),ue=s.useCallback(($e,ke)=>{D(he=>{const Se=he[$e]??ke,Ce=(t??[]).filter(U=>U!==Se);if(Ce.length===0)return he;const h=Ce[Math.floor(Math.random()*Ce.length)];return{...he,[$e]:h}})},[t]),ve=($e,ke,he,Se)=>{const Ce=q&&S==="randomize"&&f.display==="cover"?H[he]??$e:$e,h=`max(${T(m)}, ${Cf}px)`,U=`calc(-0.5 * (${h} + ${T(m)}))`;return a.jsxs("div",{className:`${r}-marquee-card`,"data-marquee-item-index":he,onMouseEnter:q&&S==="randomize"&&f.display==="cover"?()=>ue(he,$e):void 0,children:[a.jsx(_f,{item:Ce,prefix:r,imageFit:f,imageMaxWidth:g,imageMaxHeight:b,cornerRadius:A,imageHoverClass:E,isEditor:n,isFirstSet:Se,scaled:T,onFirstSetImageDone:se}),G&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${r}-gap-control`,style:{position:"absolute",top:0,right:U,width:h,height:"100%"}})]},`${ke}-${he}`)};if(X){const $e=P?x&&Y?"paused":"running":"paused",ke=d>0&&$>0?d/$*1e3:0,he=`${Math.max(0,ke)/1e3}s`;return a.jsxs("div",{ref:O,className:Tt(`${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:N,className:`${r}-marquee-track`,"data-direction":y,onMouseEnter:de,onMouseLeave:K,style:{WebkitAnimationDuration:he,animationDuration:he,WebkitAnimationPlayState:$e,animationPlayState:$e},children:Array.from({length:xe},(Se,Ce)=>a.jsx("div",{ref:Ce===0?L:void 0,className:Tt(`${r}-marquee-row`,`${r}-marquee-set`),style:{gap:T(m),paddingRight:T(m)},"aria-hidden":Ce>0,children:fe.map((h,U)=>ve(h,Ce,U,Ce===0&&U<w))},`set-${Ce}`))})]})}return a.jsxs("div",{ref:O,className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{className:Tt(`${r}-marquee-row`,`${r}-marquee-static`),style:{gap:T(m),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map(($e,ke)=>ve($e,0,ke))},"marquee-static")]})},Wf=`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';
|
|
@@ -2609,7 +2609,7 @@ ${o}
|
|
|
2609
2609
|
left: -9999px;
|
|
2610
2610
|
top: 0;
|
|
2611
2611
|
}
|
|
2612
|
-
`}const Bf=30,Za=3,jf=12,Vf=96,mc=3,Ds=.72,Gf=100,Xf=10,qf=e=>e/Gf,Uf=e=>Math.max(0,e)/Xf,Kf=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")},Yf=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),io={ctx:void 0},Zf=()=>io.ctx!==void 0?io.ctx:typeof document>"u"?(io.ctx=null,io.ctx):(io.ctx=document.createElement("canvas").getContext("2d"),io.ctx),Jf=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},gc=e=>{e.style.transform=""},Qf=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},ey=(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)},Hu=96,Wu=(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}},ty=(e,t)=>{const n=Wu(e,t,Hu);return!n||n.wavelength<=0?1:n.periodArc/n.wavelength},ny=(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 b=m+g>>1;return l[b]<=r?d(b,g):d(m,b)},[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)},iy=(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,b)=>{const S=u+b/v*y,A=u+(b+1)/v*y,f=A-S,w=c(S),G=c(A),q=S+f/3,E=w+d(S)*f/3,P=A-f/3,M=G-d(A)*f/3;return`C${q.toFixed(2)} ${E.toFixed(2)} ${P.toFixed(2)} ${M.toFixed(2)} ${A.toFixed(2)} ${G.toFixed(2)}`});return[`M${u.toFixed(2)} ${c(u).toFixed(2)}`,...m].join(" ")},oy=({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,b)=>a.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:a.jsx("span",{className:`${t}-glyph-inner`,children:g===" "?" ":g})},b))}):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})},ry=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=N.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:b,textFontSettings:S,textFontSize:A,textLineHeight:f,textLetterSpacing:w,textWordSpacing:G,textTextAppearance:q,textColor:E,backgroundColor:P,ribbonWidth:M}=e,X=M??f,$=v==="curve",T=qf(m),O=Uf(g),F=s.useMemo(()=>zf(o,c,$),[o,c,$]),L=s.useMemo(()=>Qt({fontSettings:{fontFamily:b,fontWeight:S.fontWeight,fontStyle:S.fontStyle},letterSpacing:w,wordSpacing:G,fontSize:A,lineHeight:f,textAppearance:q,color:E},n),[b,S,w,G,A,f,q,E,n]),C=Oe=>N.scalingValue(Oe,n??!1),j=((t==null?void 0:t.length)??0)>0,x=n?!!i:!0,Y=j&&(x||!!n),R=Math.max(0,d)*Bf,H=x&&p==="on",[D,Q]=s.useState(!1),ae=x?H&&D?"paused":"running":"paused",z=ae==="running"&&R>0&&c>0,re=c>0&&R>0?c/R*1e3:0,_=s.useRef(null),le=s.useRef(null),te=s.useRef(null),fe=s.useRef(null),Pe=s.useRef(null),xe=s.useRef(null),ue=s.useRef(z),K=s.useRef(null),se=s.useRef(null),de=s.useRef(T),ve=s.useRef(O);ue.current=z,de.current=T,ve.current=O;const[$e,ke]=s.useState(0),[he,Se]=s.useState(0),[Te,h]=s.useState(0),[U,Z]=s.useState(0),[ne,me]=s.useState(0),B=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]),[I,ee]=s.useState(Za),ie=s.useMemo(()=>{const Oe=t??[];return Oe.length===0||!(x||n)?Oe:Yf(Oe,I)},[t,x,I,n]),pe=Y?mc:1;s.useLayoutEffect(()=>{ee(Za),l(0)},[B]),s.useLayoutEffect(()=>{var De;const Oe=xe.current;if(!Oe)return;const Ae=()=>{const Xe=getComputedStyle(Oe),dt=parseFloat(Xe.fontSize)||0;if(dt<=0)return;const ge=Zf();if(!ge){ke(dt*Ds),Se(0);return}ge.font=`${Xe.fontStyle} ${Xe.fontWeight} ${dt}px ${Xe.fontFamily}`;const Re=ge.measureText("H"),nt=Re.actualBoundingBoxAscent>0?Re.actualBoundingBoxAscent:dt*Ds,ut=Math.max(0,Re.actualBoundingBoxDescent||0),Ge=Re.fontBoundingBoxAscent||0,bt=Re.fontBoundingBoxDescent||0;ke(Mt=>Math.abs(Mt-nt)>.5?nt:Mt);const It=Ge>0||bt>0?(bt-ut-(Ge-nt))/2:0;Se(Mt=>Math.abs(Mt-It)>.25?It:Mt)};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()},[L.fontFamily,L.fontWeight,L.fontStyle,L.fontSize,L.lineHeight]),s.useLayoutEffect(()=>{if(!Y)return;const Oe=_.current,Ae=fe.current;if(!Oe||!Ae)return;const gt={id:0},ze=()=>{const ge=Oe.offsetWidth||Oe.getBoundingClientRect().width,Re=Ae.offsetWidth||Ae.getBoundingClientRect().width;if(j&&ge>0&&Re>0){const nt=Re/I;if(nt>0){let ut=ge,Ge=jf;if($){const It=ge*de.current,Mt=ve.current,wt=Mt>0?2*Math.PI*Mt/ge:0,Vt=ty(It,wt);ut=Math.max(ge,Vt*ge/(mc-1)),Ge=Vf}const bt=Math.min(Ge,Math.max(Za,Math.ceil(ut/nt)+1));if(bt!==I){ee(bt);return}}}Re>0&&l(Re)},De=()=>{cancelAnimationFrame(gt.id),gt.id=requestAnimationFrame(ze)};De();const Xe=new ResizeObserver(De);Xe.observe(Oe),Xe.observe(Ae);const dt=()=>{document.hidden||De()};return document.addEventListener("visibilitychange",dt),window.addEventListener("pageshow",dt),window.addEventListener("focus",dt),()=>{cancelAnimationFrame(gt.id),Xe.disconnect(),document.removeEventListener("visibilitychange",dt),window.removeEventListener("pageshow",dt),window.removeEventListener("focus",dt)}},[Y,B,I,j,$e,$,T,O]),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()}},[X,n]),s.useLayoutEffect(()=>{if(!$){h(0),Z(0);return}const Oe=_.current,Ae=fe.current;if(!Oe||!Ae)return;const gt={id:0},ze=()=>{const Xe=Oe.offsetWidth,dt=Ae.offsetHeight;Xe>0&&Z(ge=>Math.abs(ge-Xe)>.5?Xe:ge),dt>0&&h(ge=>Math.abs(ge-dt)>.5?dt: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()}},[$,B,$e,f,A,Y]),s.useLayoutEffect(()=>{if(!Y||c<=0)return;const Oe=te.current;Oe&&Kf(Oe)},[Y,c,u,R]),s.useLayoutEffect(()=>{if(!$||!j)return;const 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 ut of nt.glyphs)gc(ut.inner)},ze=()=>{const nt=le.current??Oe;Ae.itemsCache=Array.from(Oe.querySelectorAll("[data-marquee-text-item]"),ut=>{const Ge=[];return ut.querySelectorAll("[data-marquee-wave-node]").forEach(bt=>{const It=bt.firstElementChild;It&&Ge.push({inner:It,layoutLocalX:ey(bt,nt)})}),{item:ut,glyphs:Ge}}),Ae.cacheDirty=!1},De=()=>{Ae.cacheDirty&&ze();const ut=(le.current??Oe).offsetWidth||1,Ge=ut*de.current,bt=ve.current,It=2*Math.PI*bt/ut,Mt=`${ut}|${Ge}|${It}`;if(Mt!==Ae.lutKey&&(Ae.lutKey=Mt,Ae.lut=Wu(Ge,It,Hu)),Math.abs(Ge)<=0||It<=0){gt();return}const wt=te.current,Vt=wt?Qf(getComputedStyle(wt).transform):0,jt=Oe.getBoundingClientRect(),qt=jt.left,Ut=jt.right,Rt=Ae.lut&&Ae.lut.wavelength>0?Math.max(0,(Ae.lut.periodArc/Ae.lut.wavelength-1)*ut):0;for(const{item:Bt,glyphs:rn}of Ae.itemsCache){const vt=Bt.getBoundingClientRect();if(vt.right<qt||vt.left>Ut+Rt){for(const yt of rn)gc(yt.inner);continue}for(const yt of rn){const Ee=yt.layoutLocalX+Vt,Qe=Ae.lut?ny(Ae.lut,Ee):Ee,rt=It*Qe,lt=Ge*Math.sin(rt),Lt=Ge*It*Math.cos(rt),St=Math.atan(Lt)*(180/Math.PI);Jf(yt.inner,Qe-Ee,lt,St)}}},Xe=()=>{Ae.cancelled||(Ae.raf=0,De(),ue.current&&!document.hidden&&(Ae.raf=requestAnimationFrame(Xe)))},dt=()=>{Ae.cancelled||Ae.raf||(Ae.raf=requestAnimationFrame(Xe))},ge=()=>{Ae.cacheDirty=!0,De(),dt()};K.current=dt,se.current=ge,De(),dt();const Re=()=>{if(document.hidden){cancelAnimationFrame(Ae.raf),Ae.raf=0;return}cancelAnimationFrame(Ae.raf),Ae.raf=0,ge()};return document.addEventListener("visibilitychange",Re),window.addEventListener("pageshow",Re),window.addEventListener("focus",Re),()=>{Ae.cancelled=!0,K.current=null,se.current=null,cancelAnimationFrame(Ae.raf),document.removeEventListener("visibilitychange",Re),window.removeEventListener("pageshow",Re),window.removeEventListener("focus",Re),gt()}},[$,j]),s.useLayoutEffect(()=>{var Oe;!$||!j||(Oe=se.current)==null||Oe.call(se)},[$,j,r,B,I,$e,T,O,U]),s.useLayoutEffect(()=>{var Oe;(Oe=K.current)==null||Oe.call(K)},[z,u]);const V=()=>{H&&Q(!0)},Ie=()=>{H&&Q(!1)},be=$?Math.abs(T)*100:0,J=C(X),He={minHeight:J,...$?{paddingTop:`${be}%`,paddingBottom:`${be}%`}:{}},We={height:J,...$?{visibility:"hidden"}:{backgroundColor:P}},it={gap:C(y),minHeight:J},qe=U*T,tt=Math.abs(qe),et=ne>0?ne:Te,je=Math.max(Te,et),ye=tt+je/2,_e=Math.max(et,1),Be=$&&U>0&&je>0?iy(U,qe,O,ye,_e):"",Ze=tt*2+je,we=Be?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${U} ${Ze}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:Be,fill:"none",stroke:P,strokeWidth:et,strokeLinecap:"butt",strokeLinejoin:"round"})}):null,Fe=a.jsx("div",{ref:Pe,className:`${o}-ribbon`,style:We,"aria-hidden":!0}),Ke=(Oe,Ae,gt)=>a.jsx(oy,{item:Oe,prefix:o,textCss:L,capHeightPx:$e,opticalOffsetY:he,imageGapPx:C(y),isCurve:$},`${Ae}-${gt}`),Je=a.jsx("span",{ref:xe,"aria-hidden":!0,className:`${o}-cap-ref`,style:L,children:"H"}),st=`${Math.max(0,re)/1e3}s`,ot=Y?a.jsx("div",{ref:te,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:V,onMouseLeave:Ie,style:{WebkitAnimationDuration:st,animationDuration:st,WebkitAnimationPlayState:ae,animationPlayState:ae},children:Array.from({length:pe},(Oe,Ae)=>a.jsx("div",{ref:Ae===0?fe:void 0,className:`${o}-marquee-set`,style:{...it,paddingRight:C(y)},"aria-hidden":Ae>0,children:ie.map((gt,ze)=>Ke(gt,Ae,ze))},`set-${Ae}`))}):a.jsx("div",{ref:fe,className:Tt(`${o}-marquee-set`,`${o}-marquee-static`),style:it,children:t==null?void 0:t.map((Oe,Ae)=>Ke(Oe,0,Ae))});return a.jsxs("div",{ref:_,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:F}}),Je,a.jsxs("div",{ref:le,className:`${o}-marquee-wrapper`,style:He,children:[Fe,we,ot]})]})},ay=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
2612
|
+
`}const Bf=30,Za=3,jf=12,Vf=96,mc=3,Ds=.72,Gf=100,Xf=10,qf=e=>e/Gf,Uf=e=>Math.max(0,e)/Xf,Kf=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")},Yf=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),io={ctx:void 0},Zf=()=>io.ctx!==void 0?io.ctx:typeof document>"u"?(io.ctx=null,io.ctx):(io.ctx=document.createElement("canvas").getContext("2d"),io.ctx),Jf=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},gc=e=>{e.style.transform=""},Qf=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},ey=(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)},Hu=96,Wu=(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}},ty=(e,t)=>{const n=Wu(e,t,Hu);return!n||n.wavelength<=0?1:n.periodArc/n.wavelength},ny=(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 b=m+g>>1;return l[b]<=r?d(b,g):d(m,b)},[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)},iy=(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,b)=>{const S=u+b/v*y,A=u+(b+1)/v*y,f=A-S,w=c(S),G=c(A),q=S+f/3,E=w+d(S)*f/3,P=A-f/3,M=G-d(A)*f/3;return`C${q.toFixed(2)} ${E.toFixed(2)} ${P.toFixed(2)} ${M.toFixed(2)} ${A.toFixed(2)} ${G.toFixed(2)}`});return[`M${u.toFixed(2)} ${c(u).toFixed(2)}`,...m].join(" ")},oy=({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,b)=>a.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:a.jsx("span",{className:`${t}-glyph-inner`,children:g===" "?" ":g})},b))}):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})},ry=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=_.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:b,textFontSettings:S,textFontSize:A,textLineHeight:f,textLetterSpacing:w,textWordSpacing:G,textTextAppearance:q,textColor:E,backgroundColor:P,ribbonWidth:M}=e,X=M??f,$=v==="curve",T=qf(m),O=Uf(g),N=s.useMemo(()=>zf(o,c,$),[o,c,$]),L=s.useMemo(()=>Qt({fontSettings:{fontFamily:b,fontWeight:S.fontWeight,fontStyle:S.fontStyle},letterSpacing:w,wordSpacing:G,fontSize:A,lineHeight:f,textAppearance:q,color:E},n),[b,S,w,G,A,f,q,E,n]),C=Oe=>_.scalingValue(Oe,n??!1),j=((t==null?void 0:t.length)??0)>0,x=n?!!i:!0,Y=j&&(x||!!n),R=Math.max(0,d)*Bf,H=x&&p==="on",[D,Q]=s.useState(!1),ae=x?H&&D?"paused":"running":"paused",z=ae==="running"&&R>0&&c>0,re=c>0&&R>0?c/R*1e3:0,F=s.useRef(null),le=s.useRef(null),te=s.useRef(null),fe=s.useRef(null),Pe=s.useRef(null),xe=s.useRef(null),de=s.useRef(z),K=s.useRef(null),se=s.useRef(null),ue=s.useRef(T),ve=s.useRef(O);de.current=z,ue.current=T,ve.current=O;const[$e,ke]=s.useState(0),[he,Se]=s.useState(0),[Ce,h]=s.useState(0),[U,Z]=s.useState(0),[ne,me]=s.useState(0),B=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]),[I,ee]=s.useState(Za),ie=s.useMemo(()=>{const Oe=t??[];return Oe.length===0||!(x||n)?Oe:Yf(Oe,I)},[t,x,I,n]),pe=Y?mc:1;s.useLayoutEffect(()=>{ee(Za),l(0)},[B]),s.useLayoutEffect(()=>{var De;const Oe=xe.current;if(!Oe)return;const Ae=()=>{const Xe=getComputedStyle(Oe),dt=parseFloat(Xe.fontSize)||0;if(dt<=0)return;const ge=Zf();if(!ge){ke(dt*Ds),Se(0);return}ge.font=`${Xe.fontStyle} ${Xe.fontWeight} ${dt}px ${Xe.fontFamily}`;const Re=ge.measureText("H"),nt=Re.actualBoundingBoxAscent>0?Re.actualBoundingBoxAscent:dt*Ds,ut=Math.max(0,Re.actualBoundingBoxDescent||0),Ge=Re.fontBoundingBoxAscent||0,bt=Re.fontBoundingBoxDescent||0;ke(Mt=>Math.abs(Mt-nt)>.5?nt:Mt);const It=Ge>0||bt>0?(bt-ut-(Ge-nt))/2:0;Se(Mt=>Math.abs(Mt-It)>.25?It:Mt)};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()},[L.fontFamily,L.fontWeight,L.fontStyle,L.fontSize,L.lineHeight]),s.useLayoutEffect(()=>{if(!Y)return;const Oe=F.current,Ae=fe.current;if(!Oe||!Ae)return;const gt={id:0},ze=()=>{const ge=Oe.offsetWidth||Oe.getBoundingClientRect().width,Re=Ae.offsetWidth||Ae.getBoundingClientRect().width;if(j&&ge>0&&Re>0){const nt=Re/I;if(nt>0){let ut=ge,Ge=jf;if($){const It=ge*ue.current,Mt=ve.current,wt=Mt>0?2*Math.PI*Mt/ge:0,Vt=ty(It,wt);ut=Math.max(ge,Vt*ge/(mc-1)),Ge=Vf}const bt=Math.min(Ge,Math.max(Za,Math.ceil(ut/nt)+1));if(bt!==I){ee(bt);return}}}Re>0&&l(Re)},De=()=>{cancelAnimationFrame(gt.id),gt.id=requestAnimationFrame(ze)};De();const Xe=new ResizeObserver(De);Xe.observe(Oe),Xe.observe(Ae);const dt=()=>{document.hidden||De()};return document.addEventListener("visibilitychange",dt),window.addEventListener("pageshow",dt),window.addEventListener("focus",dt),()=>{cancelAnimationFrame(gt.id),Xe.disconnect(),document.removeEventListener("visibilitychange",dt),window.removeEventListener("pageshow",dt),window.removeEventListener("focus",dt)}},[Y,B,I,j,$e,$,T,O]),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()}},[X,n]),s.useLayoutEffect(()=>{if(!$){h(0),Z(0);return}const Oe=F.current,Ae=fe.current;if(!Oe||!Ae)return;const gt={id:0},ze=()=>{const Xe=Oe.offsetWidth,dt=Ae.offsetHeight;Xe>0&&Z(ge=>Math.abs(ge-Xe)>.5?Xe:ge),dt>0&&h(ge=>Math.abs(ge-dt)>.5?dt: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()}},[$,B,$e,f,A,Y]),s.useLayoutEffect(()=>{if(!Y||c<=0)return;const Oe=te.current;Oe&&Kf(Oe)},[Y,c,u,R]),s.useLayoutEffect(()=>{if(!$||!j)return;const Oe=F.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 ut of nt.glyphs)gc(ut.inner)},ze=()=>{const nt=le.current??Oe;Ae.itemsCache=Array.from(Oe.querySelectorAll("[data-marquee-text-item]"),ut=>{const Ge=[];return ut.querySelectorAll("[data-marquee-wave-node]").forEach(bt=>{const It=bt.firstElementChild;It&&Ge.push({inner:It,layoutLocalX:ey(bt,nt)})}),{item:ut,glyphs:Ge}}),Ae.cacheDirty=!1},De=()=>{Ae.cacheDirty&&ze();const ut=(le.current??Oe).offsetWidth||1,Ge=ut*ue.current,bt=ve.current,It=2*Math.PI*bt/ut,Mt=`${ut}|${Ge}|${It}`;if(Mt!==Ae.lutKey&&(Ae.lutKey=Mt,Ae.lut=Wu(Ge,It,Hu)),Math.abs(Ge)<=0||It<=0){gt();return}const wt=te.current,Vt=wt?Qf(getComputedStyle(wt).transform):0,jt=Oe.getBoundingClientRect(),qt=jt.left,Ut=jt.right,Rt=Ae.lut&&Ae.lut.wavelength>0?Math.max(0,(Ae.lut.periodArc/Ae.lut.wavelength-1)*ut):0;for(const{item:Bt,glyphs:rn}of Ae.itemsCache){const vt=Bt.getBoundingClientRect();if(vt.right<qt||vt.left>Ut+Rt){for(const yt of rn)gc(yt.inner);continue}for(const yt of rn){const Ee=yt.layoutLocalX+Vt,Qe=Ae.lut?ny(Ae.lut,Ee):Ee,rt=It*Qe,lt=Ge*Math.sin(rt),Lt=Ge*It*Math.cos(rt),St=Math.atan(Lt)*(180/Math.PI);Jf(yt.inner,Qe-Ee,lt,St)}}},Xe=()=>{Ae.cancelled||(Ae.raf=0,De(),de.current&&!document.hidden&&(Ae.raf=requestAnimationFrame(Xe)))},dt=()=>{Ae.cancelled||Ae.raf||(Ae.raf=requestAnimationFrame(Xe))},ge=()=>{Ae.cacheDirty=!0,De(),dt()};K.current=dt,se.current=ge,De(),dt();const Re=()=>{if(document.hidden){cancelAnimationFrame(Ae.raf),Ae.raf=0;return}cancelAnimationFrame(Ae.raf),Ae.raf=0,ge()};return document.addEventListener("visibilitychange",Re),window.addEventListener("pageshow",Re),window.addEventListener("focus",Re),()=>{Ae.cancelled=!0,K.current=null,se.current=null,cancelAnimationFrame(Ae.raf),document.removeEventListener("visibilitychange",Re),window.removeEventListener("pageshow",Re),window.removeEventListener("focus",Re),gt()}},[$,j]),s.useLayoutEffect(()=>{var Oe;!$||!j||(Oe=se.current)==null||Oe.call(se)},[$,j,r,B,I,$e,T,O,U]),s.useLayoutEffect(()=>{var Oe;(Oe=K.current)==null||Oe.call(K)},[z,u]);const V=()=>{H&&Q(!0)},Ie=()=>{H&&Q(!1)},be=$?Math.abs(T)*100:0,J=C(X),He={minHeight:J,...$?{paddingTop:`${be}%`,paddingBottom:`${be}%`}:{}},We={height:J,...$?{visibility:"hidden"}:{backgroundColor:P}},it={gap:C(y),minHeight:J},qe=U*T,tt=Math.abs(qe),et=ne>0?ne:Ce,je=Math.max(Ce,et),ye=tt+je/2,_e=Math.max(et,1),Be=$&&U>0&&je>0?iy(U,qe,O,ye,_e):"",Ze=tt*2+je,we=Be?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${U} ${Ze}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:Be,fill:"none",stroke:P,strokeWidth:et,strokeLinecap:"butt",strokeLinejoin:"round"})}):null,Fe=a.jsx("div",{ref:Pe,className:`${o}-ribbon`,style:We,"aria-hidden":!0}),Ke=(Oe,Ae,gt)=>a.jsx(oy,{item:Oe,prefix:o,textCss:L,capHeightPx:$e,opticalOffsetY:he,imageGapPx:C(y),isCurve:$},`${Ae}-${gt}`),Je=a.jsx("span",{ref:xe,"aria-hidden":!0,className:`${o}-cap-ref`,style:L,children:"H"}),st=`${Math.max(0,re)/1e3}s`,ot=Y?a.jsx("div",{ref:te,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:V,onMouseLeave:Ie,style:{WebkitAnimationDuration:st,animationDuration:st,WebkitAnimationPlayState:ae,animationPlayState:ae},children:Array.from({length:pe},(Oe,Ae)=>a.jsx("div",{ref:Ae===0?fe:void 0,className:`${o}-marquee-set`,style:{...it,paddingRight:C(y)},"aria-hidden":Ae>0,children:ie.map((gt,ze)=>Ke(gt,Ae,ze))},`set-${Ae}`))}):a.jsx("div",{ref:fe,className:Tt(`${o}-marquee-set`,`${o}-marquee-static`),style:it,children:t==null?void 0:t.map((Oe,Ae)=>Ke(Oe,0,Ae))});return a.jsxs("div",{ref:F,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:N}}),Je,a.jsxs("div",{ref:le,className:`${o}-marquee-wrapper`,style:He,children:[Fe,we,ot]})]})},ay=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
2613
2613
|
import cn from 'classnames';
|
|
2614
2614
|
import { CommonComponentProps } from '../props';
|
|
2615
2615
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -3628,7 +3628,7 @@ type MarqueeTextProps = {
|
|
|
3628
3628
|
pointer-events: auto;
|
|
3629
3629
|
z-index: 10;
|
|
3630
3630
|
}
|
|
3631
|
-
`}const uy=30,hc=2,py=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")},my=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=
|
|
3631
|
+
`}const uy=30,hc=2,py=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")},my=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=_.useScopedStyles(),{align:l,speed:c,direction:d,pauseOnHover:u,gap:p,cardWidth:y,corners:v,stroke:m,strokeColor:g,bgColor:b,padding:S,logoMarginTop:A,logoWidth:f,logoHeight:w,captionMarginTop:G}=e,q=!!o,E=((t==null?void 0:t.length)??0)>0,P=c>0&&(!n||i),M=E&&(P||n),X=Math.max(0,c)*uy,$=I=>_.scalingValue(I,n??!1),T=s.useRef(null),O=s.useRef(null),N=s.useRef(null),[L,C]=s.useState(0),[j,x]=s.useState(0),Y=j>0?j:0,R=s.useMemo(()=>dy(r,Y),[r,Y]),[H,D]=s.useState(0),Q=P&&u==="on",[ae,z]=s.useState(!1),re=s.useRef(null),[F,le]=s.useState(0),[te,fe]=s.useState(0),Pe=s.useRef(null),xe=I=>{var ie,pe,V,Ie,be;return{fontSettings:{fontFamily:(e==null?void 0:e[`${I}FontFamily`])??"Arial",fontWeight:((ie=e==null?void 0:e[`${I}FontSettings`])==null?void 0:ie.fontWeight)??400,fontStyle:((pe=e==null?void 0:e[`${I}FontSettings`])==null?void 0:pe.fontStyle)??"normal"},textAppearance:{textTransform:((V=e==null?void 0:e[`${I}TextAppearance`])==null?void 0:V.textTransform)??"none",textDecoration:((Ie=e==null?void 0:e[`${I}TextAppearance`])==null?void 0:Ie.textDecoration)??"none",fontVariant:((be=e==null?void 0:e[`${I}TextAppearance`])==null?void 0:be.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${I}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${I}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${I}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${I}LineHeight`])??.01,color:(e==null?void 0:e[`${I}Color`])??"#000000"}},de=xe("text"),K=xe("caption"),se=s.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(I=>{var ee,ie;return(((ee=I.text)==null?void 0:ee.length)??0)>0||(((ie=I.caption)==null?void 0:ie.length)??0)>0}),[t]),ue=s.useMemo(()=>!M||(t==null?void 0:t.length)===0?1:j<=0||L<=0?hc:Math.max(hc,Math.ceil(L/j)+1),[M,t==null?void 0:t.length,j,L]);s.useLayoutEffect(()=>{if(!M)return;const I=T.current,ee=N.current;if(!I||!ee)return;let ie=0;const pe=()=>{const be=I.getBoundingClientRect().width,J=ee.getBoundingClientRect().width,He=Pe.current,We=typeof He=="number"&&Math.abs(He-J)<=.25;if(Pe.current=J,C(be),typeof J=="number"&&J>0&&j<=0){x(J);return}We&&J!==j?x(J):!We&&j<=0&&(cancelAnimationFrame(ie),ie=requestAnimationFrame(pe))},V=()=>{cancelAnimationFrame(ie),ie=requestAnimationFrame(pe)};V();const Ie=new ResizeObserver(V);return Ie.observe(I),Ie.observe(ee),()=>{cancelAnimationFrame(ie),Ie.disconnect()}},[P,M,j]);const ve=Y>0&&X>0?Y/X*1e3:0,$e=`${Math.max(0,ve)/1e3}s`;s.useLayoutEffect(()=>{if(!M||Y<=0)return;const I=O.current;I&&py(I)},[M,Y,d]),s.useLayoutEffect(()=>{if(!M){D(0);return}const I=N.current,ee=O.current;if(!I||!ee)return;const ie=()=>{let V=0;for(let Ie=0;Ie<I.children.length;Ie++){const J=I.children[Ie].firstElementChild;J&&(V=Math.max(V,J.offsetHeight))}V<=0&&(V=ee.offsetHeight),D(V>0?V:0)};ie();const pe=new ResizeObserver(ie);return pe.observe(I),pe.observe(ee),()=>{pe.disconnect()}},[M,ue,t,n,p,y,S,m,v,f,w,F,te]);const ke=()=>{Q&&z(!0)},he=()=>{Q&&z(!1)},Se=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((I,ee,ie,pe)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:Se,width:"100%"},children:[a.jsx("div",{"data-controls":q?pe==null?void 0:pe.controlsName:void 0,"data-controls-axis":q?"y":void 0,className:q?`${r}-control`:void 0,style:{height:$((pe==null?void 0:pe.marginTop)??0)}}),a.jsx("div",{...pe!=null&&pe.dataMeasureKind?{"data-testimonial-measure":pe.dataMeasureKind}:{},style:{...Qt(I,n),textAlign:Ce,pointerEvents:"auto",...typeof(pe==null?void 0:pe.minHeightPx)=="number"&&pe.minHeightPx>0?{minHeight:pe.minHeightPx}:{}},children:a.jsx(Zi,{content:ee})})]},ie),[Se,Ce,n,q,r,$]),U=s.useCallback((I,ee,ie)=>{var pe,V,Ie;return a.jsxs("div",{style:{padding:`${$(S.top)} ${$(S.right)} ${$(S.bottom)} ${$(S.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:b}}),a.jsxs("div",{className:`${r}-elements-overlay`,style:{alignItems:Se,textAlign:Ce},children:[I.text&&h(de,I.text,"text",ie!=null&&ie.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(ie==null?void 0:ie.textMinHeightPx)=="number"&&ie.textMinHeightPx>0?{minHeightPx:ie.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:Se,width:"100%"},children:[a.jsx("div",{"data-controls":q&&!(ie!=null&&ie.dataMeasureAttrs)?"logoMarginTop":void 0,className:q&&!(ie!=null&&ie.dataMeasureAttrs)?`${r}-control`:void 0,style:{height:$(A)}}),a.jsx("div",{style:{width:$(f),height:$(w)},children:((pe=I.logo)==null?void 0:pe.url)&&a.jsx("img",{src:I.logo.url,alt:((V=I.logo)==null?void 0:V.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((Ie=I.logo)==null?void 0:Ie.objectFit)||"contain"}})})]}),I.caption&&h(K,I.caption,"caption",{...ie!=null&&ie.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:G,...ie!=null&&ie.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(ie==null?void 0:ie.captionMinHeightPx)=="number"&&ie.captionMinHeightPx>0?{minHeightPx:ie.captionMinHeightPx}:{}})]})]},ee)},[b,G,K,y,v,w,A,f,Se,Ce,S.bottom,S.left,S.right,S.top,h,m,g,de,n,q,r]),Z=s.useCallback(I=>{le(I.maxTextPx),fe(I.maxCaptionPx)},[]);s.useLayoutEffect(()=>{if(!se){Z({maxTextPx:0,maxCaptionPx:0});return}const I=re.current;if(!I)return;const ee=()=>{_.readTestimonialTextMeasure(I,Z)};ee();const ie=new ResizeObserver(ee);return ie.observe(I),()=>{ie.disconnect()}},[se,Z,t,U]);const ne=se?{textMinHeightPx:F,captionMinHeightPx:te}:void 0,me=se?a.jsx("div",{ref:re,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((I,ee)=>U(I,`measure-${ee}`,{dataMeasureAttrs:!0}))}):null,B=(I,ee)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[U(I,`card-${ee}`,ne),q&&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(M){const I=P?Q&&ae?"paused":"running":"paused";return a.jsxs("div",{ref:T,className:Tt(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...H>0?{height:H}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:R}}),me,a.jsx("div",{ref:O,className:`${r}-marquee-track`,"data-direction":d,onMouseEnter:ke,onMouseLeave:he,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:$e,WebkitAnimationDuration:$e,animationPlayState:I,WebkitAnimationPlayState:I},children:Array.from({length:ue},(ee,ie)=>a.jsx("div",{ref:ie===0?N:void 0,className:`${r}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:$(p),paddingRight:$(p)},"aria-hidden":ie>0,children:t==null?void 0:t.map((pe,V)=>B(pe,`${ie}-${V}`))},`set-${ie}`))})]})}return a.jsxs("div",{className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:R}}),me,a.jsx("div",{style:{gap:$(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((I,ee)=>B(I,ee))})]})},gy=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3632
3632
|
import cn from 'classnames';
|
|
3633
3633
|
import { CommonComponentProps } from '../props';
|
|
3634
3634
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -4383,7 +4383,7 @@ type TestimonialsSettings = {
|
|
|
4383
4383
|
width: 100%;
|
|
4384
4384
|
height: 100%;
|
|
4385
4385
|
}
|
|
4386
|
-
`}const vy=3e3,xy=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=
|
|
4386
|
+
`}const vy=3e3,xy=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=_.useScopedStyles(),l=t||[],{speed:c,align:d,width:u,imageMarginTop:p,textMarginTop:y,captionMarginTop:v,imageWidth:m,imageHeight:g,controlsWidth:b,controlsColor:S,controlsHoverColor:A}=e,f=c>0&&(!n||!!i),[w,G]=s.useState(0),[q,E]=s.useState(null),[P,M]=s.useState(!1),X=s.useRef(null),$=s.useMemo(()=>{switch(d){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[d]),T=s.useMemo(()=>{switch(d){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[d]);s.useEffect(()=>{G(0),E(null),M(!1)},[l.length]);const O=l[w],N=q===null?null:l[q],L=xe=>{var K,se,ue,ve,$e;return{fontSettings:{fontFamily:(e==null?void 0:e[`${xe}FontFamily`])??"Arial",fontWeight:((K=e==null?void 0:e[`${xe}FontSettings`])==null?void 0:K.fontWeight)??400,fontStyle:((se=e==null?void 0:e[`${xe}FontSettings`])==null?void 0:se.fontStyle)??"normal"},textAppearance:{textTransform:((ue=e==null?void 0:e[`${xe}TextAppearance`])==null?void 0:ue.textTransform)??"none",textDecoration:((ve=e==null?void 0:e[`${xe}TextAppearance`])==null?void 0:ve.textDecoration)??"none",fontVariant:(($e=e==null?void 0:e[`${xe}TextAppearance`])==null?void 0:$e.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${xe}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${xe}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${xe}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${xe}WordSpacing`])??0,color:(e==null?void 0:e[`${xe}Color`])??"#000000"}},C=L("text"),j=L("caption"),x=l.length>1&&l.some(xe=>{var de,K;return(((de=xe.text)==null?void 0:de.length)??0)>0||(((K=xe.caption)==null?void 0:K.length)??0)>0}),Y=s.useRef(null),[R,H]=s.useState(0),[D,Q]=s.useState(0),ae=e.controls??{mode:"Off",icon:null},z=l.length>1,re=s.useCallback((xe,de)=>!z||de===xe?xe:(X.current&&window.clearTimeout(X.current),E(xe),M(!0),X.current=window.setTimeout(()=>{E(null),M(!1),X.current=null},300),de),[z]),F=s.useCallback(()=>{z&&G(xe=>re(xe,(xe-1+l.length)%l.length))},[z,re,l.length]),le=s.useCallback(()=>{z&&G(xe=>re(xe,(xe+1)%l.length))},[z,re,l.length]);s.useEffect(()=>{if(!f||!z)return;const xe=Math.max(300,vy/c),de=window.setInterval(()=>{G(K=>re(K,(K+1)%l.length))},xe);return()=>{window.clearInterval(de)}},[f,z,re,l.length,c]),s.useEffect(()=>()=>{X.current&&window.clearTimeout(X.current)},[]);const te=(xe,de)=>{var $e,ke,he,Se;const K=de==null?void 0:de.textMinHeightPx,se=de==null?void 0:de.captionMinHeightPx,ue=de==null?void 0:de.dataMeasureAttrs,ve=o&&!(de!=null&&de.dataMeasureAttrs)&&!(de!=null&&de.hideControls);return a.jsxs(a.Fragment,{children:[xe.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":ve?"textMarginTop":void 0,className:ve?`${r}-control`:void 0,style:{height:_.scalingValue(y??0,n??!1)}}),a.jsx("div",{...ue&&{"data-testimonial-measure":"text"},style:{...Qt(C,n),...K&&K>0?{minHeight:K}:{},textAlign:T,pointerEvents:"auto"},children:a.jsx(Zi,{content:xe.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":ve?"imageMarginTop":void 0,className:ve?`${r}-control`:void 0,style:{height:_.scalingValue(p??0,n??!1)}}),a.jsx("div",{style:{width:_.scalingValue(m??0,n??!1),height:_.scalingValue(g??0,n??!1)},children:(($e=xe.image)==null?void 0:$e.url)&&a.jsx("img",{src:(ke=xe.image)==null?void 0:ke.url,alt:((he=xe.image)==null?void 0:he.name)??"",className:`${r}-icon`,style:{objectFit:((Se=xe.image)==null?void 0:Se.objectFit)||"contain"}})})]}),xe.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":ve?"captionMarginTop":void 0,className:ve?`${r}-control`:void 0,style:{height:_.scalingValue(v??0,n??!1)}}),a.jsx("div",{...ue?{"data-testimonial-measure":"caption"}:{},style:{...Qt(j,n),...se&&se>0?{minHeight:se}:{},textAlign:T,pointerEvents:"auto"},children:a.jsx(Zi,{content:xe.caption})})]})]})},fe=s.useCallback(xe=>{H(xe.maxTextPx),Q(xe.maxCaptionPx)},[]);if(s.useLayoutEffect(()=>{if(!x){fe({maxTextPx:0,maxCaptionPx:0});return}const xe=Y.current;if(!xe)return;const de=()=>{_.readTestimonialTextMeasure(xe,fe)};de();const K=new ResizeObserver(de);return K.observe(xe),()=>{K.disconnect()}},[x,fe,t]),!O)return a.jsx(a.Fragment,{});const Pe=x?{textMinHeightPx:R,captionMinHeightPx:D}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${r}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:yy(r)}}),a.jsxs("div",{className:`${r}-wrapper`,style:{width:_.scalingValue(u??0,n??!1),alignItems:$},children:[x&&a.jsx("div",{ref:Y,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((xe,de)=>a.jsx("div",{style:{width:"100%"},children:te(xe,{dataMeasureAttrs:!0})},de))}),a.jsxs("div",{className:`${r}-fade-stack`,children:[N&&P&&a.jsx("div",{className:Tt(`${r}-fade-item-prev`,`${r}-fade-out`),children:te(N,{...Pe,hideControls:!0})}),a.jsx("div",{className:Tt(`${r}-fade-item-current`,P?`${r}-fade-in`:void 0),children:te(O,Pe)})]})]}),ae.mode==="On"&&a.jsxs("div",{className:`${r}-controls`,children:[a.jsx("div",{className:`${r}-arrow`,style:{width:_.scalingValue(b??.02,n??!1),height:_.scalingValue(b??.02,n??!1),"--arrow-hover-color":A},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:F,disabled:!z,"aria-label":"Previous testimonial",children:ae.icon&&a.jsx(mn,{url:ae.icon,fill:S,hoverFill:A,className:Tt(`${r}-arrow-img`,`${r}-mirror`)})})}),a.jsx("div",{className:Tt(`${r}-arrow`,`${r}-next-arrow`),style:{width:_.scalingValue(b??.02,n??!1),height:_.scalingValue(b??.02,n??!1),"--arrow-hover-color":A},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:le,disabled:!z,"aria-label":"Next testimonial",children:ae.icon&&a.jsx(mn,{url:ae.icon,fill:S,hoverFill:A,className:`${r}-arrow-img`})})})]})]})})},by=`import cn from 'classnames';
|
|
4387
4387
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
4388
4388
|
import { CommonComponentProps } from '../props';
|
|
4389
4389
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -4879,7 +4879,7 @@ type TestimonialsSettings = {
|
|
|
4879
4879
|
icon?: string | null;
|
|
4880
4880
|
};
|
|
4881
4881
|
};
|
|
4882
|
-
`,Sy="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>'),yc={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},wy={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:{...yc.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:{...yc.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:Sy},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"}]}]}]}},$y={element:xy,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:wy,sourceCode:by,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function Cy(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function vc(e){return((e==null?void 0:e.trim().length)??0)>0}function Ja(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Qa(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:
|
|
4882
|
+
`,Sy="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>'),yc={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},wy={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:{...yc.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:{...yc.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:Sy},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"}]}]}]}},$y={element:xy,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:wy,sourceCode:by,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function Cy(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function vc(e){return((e==null?void 0:e.trim().length)??0)>0}function Ja(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Qa(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:_.scalingValue((o-t)/2,i)}}function Ty(e){return`
|
|
4883
4883
|
.${e}-wrapper {
|
|
4884
4884
|
display: grid;
|
|
4885
4885
|
align-items: start;
|
|
@@ -5226,7 +5226,7 @@ type TestimonialsSettings = {
|
|
|
5226
5226
|
z-index: 2;
|
|
5227
5227
|
width: 100%;
|
|
5228
5228
|
}
|
|
5229
|
-
`}function Ly(){return Math.random()<.5?"ltr":"ttb"}function Py(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function Iy(e){const t=Ly();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Py(e)})})}const En=500,Ry=750,di="cubic-bezier(0.22, 1, 0.36, 1)",ky=72,Ey=50;function My(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 Ay(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Fy(e){const[t]=e.media;return t!=null&&t.url?t:null}function Ou(e){return!Array.isArray(e)||e.length===0?[]:My(e)?e.flatMap(t=>{const n=Ay(t);if(!n)return[];const i=Fy(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 Ui(e){return e.type==="video"}function Ny(e){const t=new Set,n=[];for(const i of e){const o=Ou(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 _y({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=>Ui(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 Hy(e){e.pause(),e.removeAttribute("src"),e.load()}function xc({media:e,className:t,style:n,onMediaClick:i}){return Ui(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 bc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Wy(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 Oy({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const c=n.current;if(c)return()=>{Hy(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 Dy({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),b=s.useRef(0),S=s.useRef(0),A=s.useRef("none"),f=s.useRef(!1),w=s.useRef(!1),G=s.useRef(null),q=s.useRef(0),E=s.useRef(null),P=s.useRef(!1),M=s.useRef(null),X=s.useRef(null),$=s.useRef(null),T=s.useRef(()=>{}),[O,F]=s.useState(null),[L,C]=s.useState(null),[j,x]=s.useState("opening"),[Y,R]=s.useState(0),[H,D]=s.useState(0),[Q,ae]=s.useState(null),[z,re]=s.useState(!1),[_,le]=s.useState(!1),[te,fe]=s.useState(!1),[Pe,xe]=s.useState(null),ue=s.useRef(n),K=s.useRef(void 0),se=t[n],de=se?Ui(se):!1,ve=H!==0||z,$e=Q!==null,ke=s.useCallback(we=>{const Fe=we.currentTarget,Ke=Fe instanceof HTMLVideoElement?{width:Fe.videoWidth,height:Fe.videoHeight}:{width:Fe.naturalWidth,height:Fe.naturalHeight};!Ke.width||!Ke.height||xe(Ke)},[]);s.useEffect(()=>{G.current=L},[L]),s.useEffect(()=>{const we=y.current;if(!we)return;const Fe=()=>C(bc(we));Fe();const Ke=new ResizeObserver(Fe);return Ke.observe(we),()=>Ke.disconnect()},[]);const he=s.useCallback(()=>{M.current!==null&&(window.clearTimeout(M.current),M.current=null)},[]),Se=s.useCallback(()=>{const we=X.current;X.current=null,he(),E.current=null,P.current=!1,ae(null),re(!1),D(0),q.current=0,le(!1),f.current=!1,S.current=0,A.current="none",we===1?c():we===-1&&l()},[he,c,l]),Te=s.useCallback(()=>{he(),X.current=null,E.current=null,P.current=!1,ae(null),re(!1),D(0),q.current=0},[he]),h=s.useCallback(()=>{he(),M.current=window.setTimeout(()=>{X.current!==null&&Se()},En+32)},[he,Se]),U=s.useCallback((we,Fe)=>{var Je;const Ke=((Je=G.current)==null?void 0:Je.width)??0;if(he(),E.current=we,ae(we),P.current=!0,re(!0),Fe){X.current=we;const st=-we*Ke;q.current=st,D(st),h();return}q.current=0,D(0),M.current=window.setTimeout(()=>{M.current=null,Te()},En+32)},[he,Te,h]),Z=s.useCallback(we=>{if(!(t.length<=1)){if(P.current){if(X.current===we){$.current=we,Se();return}Te()}he(),E.current=we,ae(we),P.current=!1,re(!1),q.current=0,D(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{U(we,!0)})})}},[t.length,U,Se,Te,he]);T.current=Z;const ne=s.useCallback(we=>{we.propertyName!=="transform"||!P.current||X.current!==null&&Se()},[Se]),me=s.useCallback(()=>{const we=v.current;if(!we)return;const Fe=bc(we);!Fe.width||!Fe.height||F(Fe)},[]);s.useEffect(()=>{me();const we=v.current;if(!we)return;const Fe=new ResizeObserver(()=>me());return Fe.observe(we),()=>Fe.disconnect()},[me]),s.useEffect(()=>{j==="opening"&&O&&x("open")},[j,O]),s.useEffect(()=>{if(j!=="closing")return;const we=setTimeout(()=>r(),En);return()=>clearTimeout(we)},[j,r]),s.useEffect(()=>()=>{he()},[he]),s.useLayoutEffect(()=>{ue.current===n&&K.current===(se==null?void 0:se.url)||(he(),X.current=null,ae(null),R(0),D(0),re(!1),fe(!1),le(!1),xe(null),b.current=0,S.current=0,A.current="none",f.current=!1,P.current=!1,q.current=0,E.current=null,g.current=null,w.current=!1,ue.current=n,K.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(()=>{T.current(we)}))},[n,se==null?void 0:se.url]),s.useEffect(()=>{if(j!=="open")return;let we=null;const Fe=()=>{we&&(document.removeEventListener("click",we,!0),we=null)},Ke=()=>{Fe(),we=Ae=>{Ae.stopPropagation(),Ae.preventDefault(),Fe()},document.addEventListener("click",we,!0)},Je=Ae=>{const gt=Ae<0?1:-1;if(Math.abs(Ae)>Ey&&t.length>1){U(gt,!0);return}U(gt,!1)},st=Ae=>{if(Ae.touches.length!==1||P.current)return;const gt=Ae.touches[0];w.current=!0,g.current={x:gt.clientX,y:gt.clientY},A.current="none",S.current=0,f.current=!1},ot=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(A.current==="none"){if(Math.abs(ze)<10&&Math.abs(De)<10)return;if(Math.abs(ze)>Math.abs(De)){if(t.length<=1)return;A.current="horizontal"}else if(De>0)A.current="vertical";else return}if(A.current==="horizontal"){f.current=!0,le(!0),S.current=ze;const Xe=ze<0?1:-1;E.current!==Xe&&(E.current=Xe,ae(Xe)),q.current=ze,D(ze),Ae.preventDefault();return}A.current==="vertical"&&(f.current=!0,le(!0),b.current=De,R(De),Ae.preventDefault())},Oe=()=>{if(!g.current)return;const Ae=A.current,gt=f.current;if(gt&&Ae==="horizontal")Je(S.current),Ke();else if(gt&&Ae==="vertical")if(b.current>ky){const De=window.innerHeight;b.current=De,fe(!0),R(De),x("closing")}else b.current=0,R(0),Ke();else Ae==="horizontal"&&Math.abs(S.current)>0&&(Je(S.current),Ke());g.current=null,A.current="none",S.current=0,f.current=!1,le(!1)};return document.addEventListener("touchstart",st,{passive:!0}),document.addEventListener("touchmove",ot,{passive:!1}),document.addEventListener("touchend",Oe),document.addEventListener("touchcancel",Oe),()=>{document.removeEventListener("touchstart",st),document.removeEventListener("touchmove",ot),document.removeEventListener("touchend",Oe),document.removeEventListener("touchcancel",Oe),Fe()}},[j,t.length,U]),s.useEffect(()=>{const we=Fe=>{Fe.key==="Escape"&&(Fe.preventDefault(),Fe.stopPropagation(),j!=="closing"&&x("closing"))};return window.addEventListener("keydown",we,!0),()=>window.removeEventListener("keydown",we,!0)},[j]);const B=()=>{j!=="closing"&&x("closing")},I=j==="open",ee=j==="closing",ie=Y>0?Math.max(0,1-Y/500):1,pe=Y>0?Math.max(.35,1-Y/500):1,V=O?p?O:Wy(O,Pe):null,Ie=we=>{if(we.stopPropagation(),w.current){w.current=!1;return}if(t.length<=1)return;const Fe=V??we.currentTarget.getBoundingClientRect(),Ke=we.clientY-Fe.top,Je=Math.min(52,Fe.height*.2);if(!(Ke>Fe.height-Je)){if(we.clientX-Fe.left<Fe.width/2){Z(-1);return}Z(1)}},be=we=>{if(t.length<=1)return;const Fe=V??we.currentTarget.getBoundingClientRect(),Ke=we.clientX-Fe.left,Je=we.clientY-Fe.top,st=Math.min(52,Fe.height*.2);if(Je>Fe.height-st){we.currentTarget.style.cursor="default";return}we.currentTarget.style.cursor=Ke<Fe.width/2?"w-resize":"e-resize"},J={position:"fixed",top:L==null?void 0:L.top,left:L==null?void 0:L.left,width:L==null?void 0:L.width,height:L==null?void 0:L.height,zIndex:9998},He=p?"cover":"contain",We=H!==0||Y>0?`translate(${H}px, ${Y}px)`:void 0,it=_&&!z?"none":z?`transform ${En}ms ${di}`:te?`transform ${En}ms ${di}, opacity ${En}ms ${di}`:j==="opening"||ee?`opacity ${En}ms ${di}`:"none",qe={...J,transform:We,opacity:Y>0?pe:j==="opening"||ee?0:1,transition:it,pointerEvents:"none"},tt={position:"absolute",top:((V==null?void 0:V.top)??0)-((L==null?void 0:L.top)??0),left:((V==null?void 0:V.left)??0)-((L==null?void 0:L.left)??0),width:V==null?void 0:V.width,height:V==null?void 0:V.height,objectFit:He,pointerEvents:de&&I&&!ve?"auto":"none",touchAction:de&&I?"none":void 0},et=(L==null?void 0:L.width)??0,je=$e?(n+Q+t.length)%t.length:null,ye=je!==null?t[je]:null,_e={...J,transform:$e?`translateX(${Q*et+H}px)`:void 0,opacity:1,transition:z?`transform ${En}ms ${di}`:"none",pointerEvents:"none"},Be={position:"absolute",top:((O==null?void 0:O.top)??0)-((L==null?void 0:L.top)??0),left:((O==null?void 0:O.left)??0)-((L==null?void 0:L.left)??0),width:O==null?void 0:O.width,height:O==null?void 0:O.height,objectFit:He,pointerEvents:"none"},Ze=V?{position:"fixed",top:V.top,height:V.height,width:V.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:y,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:j==="open"?"none":void 0},onClick:B,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:I?ie:0,transition:_?"none":`opacity ${En}ms ${di}`,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:I?1:0,transition:`opacity ${En}ms ${di}`,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:I?1:0,transition:`opacity ${En}ms ${di}`},children:t.length>1&&a.jsxs("p",{className:d,style:u,children:[n+1," / ",t.length]})})]})}),O&&L&&ye&&a.jsx("div",{style:_e,onTransitionEnd:ne,children:Ui(ye)?a.jsx("video",{src:ye.url,muted:!0,playsInline:!0,preload:"auto",style:Be},`neighbor-${je}-${ye.url}`):a.jsx("img",{src:ye.url,alt:ye.name,style:Be},`neighbor-${je}-${ye.url}`)}),O&&L&&se&&a.jsx("div",{style:qe,onTransitionEnd:ne,children:de?a.jsx(Oy,{src:se.url,phase:j,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}`)}),I&&Ze&&t.length>1&&!de&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ze,left:V.left,cursor:"w-resize",pointerEvents:_?"none":"auto"},onClick:we=>{if(w.current){w.current=!1;return}we.stopPropagation(),Z(-1)}}),a.jsx("div",{style:{...Ze,left:V.left+V.width/2,cursor:"e-resize",pointerEvents:_?"none":"auto"},onClick:we=>{if(w.current){w.current=!1;return}we.stopPropagation(),Z(1)}})]})]})}function zy(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function By({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:c,portalId:d}){const{prefix:u}=N.useScopedStyles(),{type:p="a",gridLayout:y,textBoxWidth:v=100,verticalGap:m,entriesCount:g,lightbox:b,imageDisplay:S,imageCorners:A,lightboxImageDisplay:f,slider:w,sliderTiming:G,direction:q,transition:E,titleMarginTop:P,subtitleMarginTop:M,titleColor:X,subtitleColor:$,lightboxCounterColor:T,titleFontFamily:O,titleFontSettings:F,titleFontSize:L,titleLineHeight:C,titleLetterSpacing:j,titleWordSpacing:x,titleTextAppearance:Y,subtitleFontFamily:R,subtitleFontSettings:H,subtitleFontSize:D,subtitleLineHeight:Q,subtitleLetterSpacing:ae,subtitleWordSpacing:z,subtitleTextAppearance:re,lightboxCounterFontFamily:_,lightboxCounterFontSettings:le,lightboxCounterFontSize:te,lightboxCounterLineHeight:fe,lightboxCounterLetterSpacing:Pe,lightboxCounterWordSpacing:xe,lightboxCounterTextAppearance:ue,showText:K="always",alignEntries:se="off",align:de="top"}=e,ve={fontSettings:{fontFamily:O,fontWeight:(F==null?void 0:F.fontWeight)??400,fontStyle:(F==null?void 0:F.fontStyle)??"normal"},fontSize:L??.01,lineHeight:C,letterSpacing:j??0,wordSpacing:x??0,textAppearance:Y,color:X},ke={...dn(Qt(ve,n))},he={fontSettings:{fontFamily:R,fontWeight:(H==null?void 0:H.fontWeight)??400,fontStyle:(H==null?void 0:H.fontStyle)??"normal"},fontSize:D??.01,lineHeight:Q,letterSpacing:ae??0,wordSpacing:z??0,textAppearance:re,color:$},Te={...dn(Qt(he,n))},h={fontSettings:{fontFamily:_,fontWeight:(le==null?void 0:le.fontWeight)??400,fontStyle:(le==null?void 0:le.fontStyle)??"normal"},fontSize:te??.01,lineHeight:fe,letterSpacing:Pe??0,wordSpacing:xe??0,textAppearance:ue,color:T},Z={...dn(Qt(h,n)),...Qa(te,fe,u,n)},ne=Ja(L,C,`${u}-item-title`,`${u}-text-tight-leading`),me=Ja(D,Q,`${u}-item-subtitle`,`${u}-text-tight-leading`),B=Qa(L,C,u,n),I=Qa(D,Q,u,n),ee=Ja(te,fe,`${u}-lightbox-counter`,`${u}-text-tight-leading`),ie=N.buildColorVars(u,{titleColor:X,subtitleColor:$,lightboxCounterColor:T},jy,Vy),Ie=`${l&&l!=="default"?`${u}-state-${l}`:""}${K==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),be=g===0?1/0:g,J=(t??[]).slice(0,be),He=s.useMemo(()=>b==="on"?Ny(J):[],[J,b]),We=y.entryWidth??.2,it=(S==null?void 0:S.display)==="cover",qe=(S==null?void 0:S.ratioValue)??"1:1",tt=(S==null?void 0:S.reversed)??!1,[et,je]=qe.split(":").map(Number),Be=`${tt?je:et} / ${tt?et:je}`,Ze=y.columnsCount,we=N.scalingValue(We??0,n),Fe=we,Ke=!it&&w!=="off",Je=J.length%Ze||Ze,st=Je<Ze&&J.length>0,ot=J.length-Je,Oe=st?Math.floor((Ze-Je)/2)+1:1,Ae=A?N.scalingValue(A,n):void 0,gt={width:Fe,...it?{aspectRatio:Be,height:"auto",overflow:"hidden"}:{height:"auto"},...Ae?{borderRadius:Ae,overflow:"hidden"}:{}},ze=`${u}-item-image-wrapper${Ke?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),De=p==="d"||p==="e"||p==="f",Xe=se==="on",dt=`calc(${N.scalingValue(We??0,n)} * (${v} / 100))`,ge=N.scalingValue(We*v/100,n),Re=it?{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,ut]=s.useState(0),Ge=s.useRef(null),bt=E==="fade"||q==="horizontal"?"ltr":q==="vertical"?"ttb":"ltr";s.useEffect(()=>{const vt=Ge.current;if(!vt)return;const yt=new ResizeObserver(Ee=>{ut(Math.round(Ee[0].contentRect.width))});return yt.observe(vt),()=>yt.disconnect()},[]);const It=(()=>{const vt={...ie},yt=Ge.current?getComputedStyle(Ge.current).getPropertyValue("--cntrl-article-width").trim():"";return yt&&(vt["--cntrl-article-width"]=yt),vt})(),[Mt,wt]=s.useState(!1),[Vt,jt]=s.useState([]),[qt,Ut]=s.useState(0),Rt=b==="on"&&(!n||i),Bt=(vt,yt)=>{n&&!i||b!=="off"&&(jt(vt),Ut(yt),wt(!0))};s.useEffect(()=>{if(!Mt||b!=="on"||typeof document>"u")return;const vt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=vt}},[Mt,b]),s.useEffect(()=>{!n||i||wt(!1)},[n,i]);const rn=s.useMemo(()=>Ty(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:rn}}),b==="on"&&a.jsx(_y,{mediaList:He}),a.jsx("div",{style:ie,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:N.scalingValue(m??0,n),columnGap:N.scalingValue(y.horizontalGap??0,n),width:N.scalingValue(y.wrapperWidth??0,n),...Xe?{[`--${u}-align-entries-row-gap`]:N.scalingValue(m??0,n)}:{}},children:J.map((vt,yt)=>{var Ft;const Ee=vc(vt.title),Qe=vc(vt.subtitle),rt=(((Ft=vt.link)==null?void 0:Ft.length)??0)>0&&b==="off"?vt.link:void 0,lt=Math.floor(yt/Ze)===Math.ceil(J.length/Ze)-1,Lt=st&&yt>=ot?`${Oe+(yt-ot)}`:void 0,St=De?a.jsxs("div",{className:`${u}-item-text-block`,children:[Ee&&a.jsx("p",{className:ne,style:{width:dt,...ke,...B},children:vt.title}),Ee&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:N.scalingValue(P??0,n),width:ge}}),Qe&&a.jsx("p",{className:me,style:{width:dt,...Te,...I},children:vt.subtitle}),Qe&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:N.scalingValue(M??0,n),width:ge}})]}):null,ht=Xe?a.jsxs("div",{className:`${u}-item-title-row`,children:[!De&&a.jsx("div",{"data-controls":o&&Ee?"titleMarginTop":void 0,className:o&&Ee?`${u}-control`:void 0,style:{height:Ee?N.scalingValue(P??0,n):0,width:ge}}),Ee&&a.jsx("p",{className:ne,style:{width:dt,...ke,...B},children:vt.title}),De&&Ee&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:N.scalingValue(P??0,n),width:ge}})]}):null,Pt=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?N.scalingValue(M??0,n):0,width:ge}}),Qe&&a.jsx("p",{className:me,style:{width:dt,...Te,...I},children:vt.subtitle}),De&&Qe&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:N.scalingValue(M??0,n),width:ge}})]}):null,Ot=rt?a.jsxs("a",{href:rt,target:"_blank",className:`${u}-item-text-link`,children:[ht,Pt]}):a.jsxs(a.Fragment,{children:[ht,Pt]}),At=Ou(vt.gallery),Gt=At.filter(pt=>pt.lightboxMedia).map(pt=>pt.lightboxMedia),Et=a.jsx("div",{className:ze,style:gt,children:At.length===0?null:w==="off"?(()=>{const{displayMedia:pt,lightboxMedia:W}=At[0],Le=W?Gt.findIndex(Ve=>Ve.url===W.url):-1;return a.jsx(xc,{media:pt,className:`${u}-item-${Ui(pt)?"video":"image"}`.trim(),style:Re,onMediaClick:Rt&&Le>=0?()=>Bt(Gt,Le):void 0})})():a.jsxs(a.Fragment,{children:[Ke&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:At.map(({displayMedia:pt})=>Ui(pt)?a.jsx("video",{src:pt.url,muted:!0,playsInline:!0},`sizer-${pt.url}`):a.jsx("img",{src:pt.url,alt:""},`sizer-${pt.url}`))}),a.jsx(Ll,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:G*1e3,width:"100%",height:"100%",speed:Ry,type:E==="fade"?"fade":"loop",rewind:E==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:bt},onMoved:pt=>{q!=="random"||E==="fade"||Iy(pt)},children:At.map(({displayMedia:pt,lightboxMedia:W},Le)=>{const Ve=W?Gt.findIndex(Ne=>Ne.url===W.url):-1;return a.jsx(Pl,{children:a.jsx(xc,{media:pt,className:`${u}-item-${Ui(pt)?"video":"image"}`.trim(),style:Re,onMediaClick:Rt&&Ve>=0?()=>Bt(Gt,Ve):void 0})},Le)})},`${E}-${We}-${q}-${G}-${nt}-${c}`)]})}),zt=De?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&Ee?"titleMarginTop":void 0,className:o&&Ee?`${u}-control`:void 0,style:{height:Ee?N.scalingValue(P??0,n):0,width:ge}}),a.jsx("p",{className:ne,style:{width:dt,...ke,...B},children:vt.title}),a.jsx("div",{"data-controls":o&&Qe?"subtitleMarginTop":void 0,className:o&&Qe?`${u}-control`:void 0,style:{height:Qe?N.scalingValue(M??0,n):0,width:ge}}),a.jsx("p",{className:me,style:{width:dt,...Te,...I},children:vt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:Lt&&!Xe?{gridColumn:Lt}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${Xe&<?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(v??0)>100?`calc(${we} * (${v} / 100))`:we,...Lt&&Xe?{gridColumn:Lt}:{}},children:Xe?a.jsx(a.Fragment,{children:De?a.jsxs(a.Fragment,{children:[Ot,a.jsx("a",{href:rt,target:"_blank",className:`${u}-item-image-link`,children:Et})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:rt,target:"_blank",className:`${u}-item-image-link`,children:Et}),Ot]})}):rt?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:rt,target:"_blank",className:`${u}-item-image-link`,children:[St,Et]}),!De&&a.jsx("a",{href:rt,target:"_blank",className:`${u}-item-text-link`,children:zt})]}):a.jsxs(a.Fragment,{children:[St,Et,zt]})})},yt)})})}),(!n||i)&&Mt&&typeof document<"u"&&b==="on"&&(()=>{const vt=(d?document.getElementById(d):null)??document.body;return Gn.createPortal(a.jsx("div",{style:It,"data-selection":"none",children:a.jsx(Dy,{prefix:u,items:Vt,index:qt,imageDisplay:zy(f),isEditor:n,onClose:()=>wt(!1),onPrev:()=>Ut(yt=>(yt-1+Vt.length)%Vt.length),onNext:()=>Ut(yt=>(yt+1)%Vt.length),counterClassName:ee,counterStyle:Z})}),vt)})()]})}const jy={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Vy=["hover","focus","filled","success","error"],Gy=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
5229
|
+
`}function Ly(){return Math.random()<.5?"ltr":"ttb"}function Py(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function Iy(e){const t=Ly();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Py(e)})})}const En=500,Ry=750,di="cubic-bezier(0.22, 1, 0.36, 1)",ky=72,Ey=50;function My(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 Ay(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Fy(e){const[t]=e.media;return t!=null&&t.url?t:null}function Ou(e){return!Array.isArray(e)||e.length===0?[]:My(e)?e.flatMap(t=>{const n=Ay(t);if(!n)return[];const i=Fy(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 Ui(e){return e.type==="video"}function Ny(e){const t=new Set,n=[];for(const i of e){const o=Ou(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 _y({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=>Ui(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 Hy(e){e.pause(),e.removeAttribute("src"),e.load()}function xc({media:e,className:t,style:n,onMediaClick:i}){return Ui(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 bc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Wy(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 Oy({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const c=n.current;if(c)return()=>{Hy(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 Dy({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),b=s.useRef(0),S=s.useRef(0),A=s.useRef("none"),f=s.useRef(!1),w=s.useRef(!1),G=s.useRef(null),q=s.useRef(0),E=s.useRef(null),P=s.useRef(!1),M=s.useRef(null),X=s.useRef(null),$=s.useRef(null),T=s.useRef(()=>{}),[O,N]=s.useState(null),[L,C]=s.useState(null),[j,x]=s.useState("opening"),[Y,R]=s.useState(0),[H,D]=s.useState(0),[Q,ae]=s.useState(null),[z,re]=s.useState(!1),[F,le]=s.useState(!1),[te,fe]=s.useState(!1),[Pe,xe]=s.useState(null),de=s.useRef(n),K=s.useRef(void 0),se=t[n],ue=se?Ui(se):!1,ve=H!==0||z,$e=Q!==null,ke=s.useCallback(we=>{const Fe=we.currentTarget,Ke=Fe instanceof HTMLVideoElement?{width:Fe.videoWidth,height:Fe.videoHeight}:{width:Fe.naturalWidth,height:Fe.naturalHeight};!Ke.width||!Ke.height||xe(Ke)},[]);s.useEffect(()=>{G.current=L},[L]),s.useEffect(()=>{const we=y.current;if(!we)return;const Fe=()=>C(bc(we));Fe();const Ke=new ResizeObserver(Fe);return Ke.observe(we),()=>Ke.disconnect()},[]);const he=s.useCallback(()=>{M.current!==null&&(window.clearTimeout(M.current),M.current=null)},[]),Se=s.useCallback(()=>{const we=X.current;X.current=null,he(),E.current=null,P.current=!1,ae(null),re(!1),D(0),q.current=0,le(!1),f.current=!1,S.current=0,A.current="none",we===1?c():we===-1&&l()},[he,c,l]),Ce=s.useCallback(()=>{he(),X.current=null,E.current=null,P.current=!1,ae(null),re(!1),D(0),q.current=0},[he]),h=s.useCallback(()=>{he(),M.current=window.setTimeout(()=>{X.current!==null&&Se()},En+32)},[he,Se]),U=s.useCallback((we,Fe)=>{var Je;const Ke=((Je=G.current)==null?void 0:Je.width)??0;if(he(),E.current=we,ae(we),P.current=!0,re(!0),Fe){X.current=we;const st=-we*Ke;q.current=st,D(st),h();return}q.current=0,D(0),M.current=window.setTimeout(()=>{M.current=null,Ce()},En+32)},[he,Ce,h]),Z=s.useCallback(we=>{if(!(t.length<=1)){if(P.current){if(X.current===we){$.current=we,Se();return}Ce()}he(),E.current=we,ae(we),P.current=!1,re(!1),q.current=0,D(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{U(we,!0)})})}},[t.length,U,Se,Ce,he]);T.current=Z;const ne=s.useCallback(we=>{we.propertyName!=="transform"||!P.current||X.current!==null&&Se()},[Se]),me=s.useCallback(()=>{const we=v.current;if(!we)return;const Fe=bc(we);!Fe.width||!Fe.height||N(Fe)},[]);s.useEffect(()=>{me();const we=v.current;if(!we)return;const Fe=new ResizeObserver(()=>me());return Fe.observe(we),()=>Fe.disconnect()},[me]),s.useEffect(()=>{j==="opening"&&O&&x("open")},[j,O]),s.useEffect(()=>{if(j!=="closing")return;const we=setTimeout(()=>r(),En);return()=>clearTimeout(we)},[j,r]),s.useEffect(()=>()=>{he()},[he]),s.useLayoutEffect(()=>{de.current===n&&K.current===(se==null?void 0:se.url)||(he(),X.current=null,ae(null),R(0),D(0),re(!1),fe(!1),le(!1),xe(null),b.current=0,S.current=0,A.current="none",f.current=!1,P.current=!1,q.current=0,E.current=null,g.current=null,w.current=!1,de.current=n,K.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(()=>{T.current(we)}))},[n,se==null?void 0:se.url]),s.useEffect(()=>{if(j!=="open")return;let we=null;const Fe=()=>{we&&(document.removeEventListener("click",we,!0),we=null)},Ke=()=>{Fe(),we=Ae=>{Ae.stopPropagation(),Ae.preventDefault(),Fe()},document.addEventListener("click",we,!0)},Je=Ae=>{const gt=Ae<0?1:-1;if(Math.abs(Ae)>Ey&&t.length>1){U(gt,!0);return}U(gt,!1)},st=Ae=>{if(Ae.touches.length!==1||P.current)return;const gt=Ae.touches[0];w.current=!0,g.current={x:gt.clientX,y:gt.clientY},A.current="none",S.current=0,f.current=!1},ot=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(A.current==="none"){if(Math.abs(ze)<10&&Math.abs(De)<10)return;if(Math.abs(ze)>Math.abs(De)){if(t.length<=1)return;A.current="horizontal"}else if(De>0)A.current="vertical";else return}if(A.current==="horizontal"){f.current=!0,le(!0),S.current=ze;const Xe=ze<0?1:-1;E.current!==Xe&&(E.current=Xe,ae(Xe)),q.current=ze,D(ze),Ae.preventDefault();return}A.current==="vertical"&&(f.current=!0,le(!0),b.current=De,R(De),Ae.preventDefault())},Oe=()=>{if(!g.current)return;const Ae=A.current,gt=f.current;if(gt&&Ae==="horizontal")Je(S.current),Ke();else if(gt&&Ae==="vertical")if(b.current>ky){const De=window.innerHeight;b.current=De,fe(!0),R(De),x("closing")}else b.current=0,R(0),Ke();else Ae==="horizontal"&&Math.abs(S.current)>0&&(Je(S.current),Ke());g.current=null,A.current="none",S.current=0,f.current=!1,le(!1)};return document.addEventListener("touchstart",st,{passive:!0}),document.addEventListener("touchmove",ot,{passive:!1}),document.addEventListener("touchend",Oe),document.addEventListener("touchcancel",Oe),()=>{document.removeEventListener("touchstart",st),document.removeEventListener("touchmove",ot),document.removeEventListener("touchend",Oe),document.removeEventListener("touchcancel",Oe),Fe()}},[j,t.length,U]),s.useEffect(()=>{const we=Fe=>{Fe.key==="Escape"&&(Fe.preventDefault(),Fe.stopPropagation(),j!=="closing"&&x("closing"))};return window.addEventListener("keydown",we,!0),()=>window.removeEventListener("keydown",we,!0)},[j]);const B=()=>{j!=="closing"&&x("closing")},I=j==="open",ee=j==="closing",ie=Y>0?Math.max(0,1-Y/500):1,pe=Y>0?Math.max(.35,1-Y/500):1,V=O?p?O:Wy(O,Pe):null,Ie=we=>{if(we.stopPropagation(),w.current){w.current=!1;return}if(t.length<=1)return;const Fe=V??we.currentTarget.getBoundingClientRect(),Ke=we.clientY-Fe.top,Je=Math.min(52,Fe.height*.2);if(!(Ke>Fe.height-Je)){if(we.clientX-Fe.left<Fe.width/2){Z(-1);return}Z(1)}},be=we=>{if(t.length<=1)return;const Fe=V??we.currentTarget.getBoundingClientRect(),Ke=we.clientX-Fe.left,Je=we.clientY-Fe.top,st=Math.min(52,Fe.height*.2);if(Je>Fe.height-st){we.currentTarget.style.cursor="default";return}we.currentTarget.style.cursor=Ke<Fe.width/2?"w-resize":"e-resize"},J={position:"fixed",top:L==null?void 0:L.top,left:L==null?void 0:L.left,width:L==null?void 0:L.width,height:L==null?void 0:L.height,zIndex:9998},He=p?"cover":"contain",We=H!==0||Y>0?`translate(${H}px, ${Y}px)`:void 0,it=F&&!z?"none":z?`transform ${En}ms ${di}`:te?`transform ${En}ms ${di}, opacity ${En}ms ${di}`:j==="opening"||ee?`opacity ${En}ms ${di}`:"none",qe={...J,transform:We,opacity:Y>0?pe:j==="opening"||ee?0:1,transition:it,pointerEvents:"none"},tt={position:"absolute",top:((V==null?void 0:V.top)??0)-((L==null?void 0:L.top)??0),left:((V==null?void 0:V.left)??0)-((L==null?void 0:L.left)??0),width:V==null?void 0:V.width,height:V==null?void 0:V.height,objectFit:He,pointerEvents:ue&&I&&!ve?"auto":"none",touchAction:ue&&I?"none":void 0},et=(L==null?void 0:L.width)??0,je=$e?(n+Q+t.length)%t.length:null,ye=je!==null?t[je]:null,_e={...J,transform:$e?`translateX(${Q*et+H}px)`:void 0,opacity:1,transition:z?`transform ${En}ms ${di}`:"none",pointerEvents:"none"},Be={position:"absolute",top:((O==null?void 0:O.top)??0)-((L==null?void 0:L.top)??0),left:((O==null?void 0:O.left)??0)-((L==null?void 0:L.left)??0),width:O==null?void 0:O.width,height:O==null?void 0:O.height,objectFit:He,pointerEvents:"none"},Ze=V?{position:"fixed",top:V.top,height:V.height,width:V.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:y,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:j==="open"?"none":void 0},onClick:B,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:I?ie:0,transition:F?"none":`opacity ${En}ms ${di}`,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:I?1:0,transition:`opacity ${En}ms ${di}`,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:I?1:0,transition:`opacity ${En}ms ${di}`},children:t.length>1&&a.jsxs("p",{className:d,style:u,children:[n+1," / ",t.length]})})]})}),O&&L&&ye&&a.jsx("div",{style:_e,onTransitionEnd:ne,children:Ui(ye)?a.jsx("video",{src:ye.url,muted:!0,playsInline:!0,preload:"auto",style:Be},`neighbor-${je}-${ye.url}`):a.jsx("img",{src:ye.url,alt:ye.name,style:Be},`neighbor-${je}-${ye.url}`)}),O&&L&&se&&a.jsx("div",{style:qe,onTransitionEnd:ne,children:ue?a.jsx(Oy,{src:se.url,phase:j,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}`)}),I&&Ze&&t.length>1&&!ue&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ze,left:V.left,cursor:"w-resize",pointerEvents:F?"none":"auto"},onClick:we=>{if(w.current){w.current=!1;return}we.stopPropagation(),Z(-1)}}),a.jsx("div",{style:{...Ze,left:V.left+V.width/2,cursor:"e-resize",pointerEvents:F?"none":"auto"},onClick:we=>{if(w.current){w.current=!1;return}we.stopPropagation(),Z(1)}})]})]})}function zy(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function By({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:c,portalId:d}){const{prefix:u}=_.useScopedStyles(),{type:p="a",gridLayout:y,textBoxWidth:v=100,verticalGap:m,entriesCount:g,lightbox:b,imageDisplay:S,imageCorners:A,lightboxImageDisplay:f,slider:w,sliderTiming:G,direction:q,transition:E,titleMarginTop:P,subtitleMarginTop:M,titleColor:X,subtitleColor:$,lightboxCounterColor:T,titleFontFamily:O,titleFontSettings:N,titleFontSize:L,titleLineHeight:C,titleLetterSpacing:j,titleWordSpacing:x,titleTextAppearance:Y,subtitleFontFamily:R,subtitleFontSettings:H,subtitleFontSize:D,subtitleLineHeight:Q,subtitleLetterSpacing:ae,subtitleWordSpacing:z,subtitleTextAppearance:re,lightboxCounterFontFamily:F,lightboxCounterFontSettings:le,lightboxCounterFontSize:te,lightboxCounterLineHeight:fe,lightboxCounterLetterSpacing:Pe,lightboxCounterWordSpacing:xe,lightboxCounterTextAppearance:de,showText:K="always",alignEntries:se="off",align:ue="top"}=e,ve={fontSettings:{fontFamily:O,fontWeight:(N==null?void 0:N.fontWeight)??400,fontStyle:(N==null?void 0:N.fontStyle)??"normal"},fontSize:L??.01,lineHeight:C,letterSpacing:j??0,wordSpacing:x??0,textAppearance:Y,color:X},ke={...dn(Qt(ve,n))},he={fontSettings:{fontFamily:R,fontWeight:(H==null?void 0:H.fontWeight)??400,fontStyle:(H==null?void 0:H.fontStyle)??"normal"},fontSize:D??.01,lineHeight:Q,letterSpacing:ae??0,wordSpacing:z??0,textAppearance:re,color:$},Ce={...dn(Qt(he,n))},h={fontSettings:{fontFamily:F,fontWeight:(le==null?void 0:le.fontWeight)??400,fontStyle:(le==null?void 0:le.fontStyle)??"normal"},fontSize:te??.01,lineHeight:fe,letterSpacing:Pe??0,wordSpacing:xe??0,textAppearance:de,color:T},Z={...dn(Qt(h,n)),...Qa(te,fe,u,n)},ne=Ja(L,C,`${u}-item-title`,`${u}-text-tight-leading`),me=Ja(D,Q,`${u}-item-subtitle`,`${u}-text-tight-leading`),B=Qa(L,C,u,n),I=Qa(D,Q,u,n),ee=Ja(te,fe,`${u}-lightbox-counter`,`${u}-text-tight-leading`),ie=_.buildColorVars(u,{titleColor:X,subtitleColor:$,lightboxCounterColor:T},jy,Vy),Ie=`${l&&l!=="default"?`${u}-state-${l}`:""}${K==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),be=g===0?1/0:g,J=(t??[]).slice(0,be),He=s.useMemo(()=>b==="on"?Ny(J):[],[J,b]),We=y.entryWidth??.2,it=(S==null?void 0:S.display)==="cover",qe=(S==null?void 0:S.ratioValue)??"1:1",tt=(S==null?void 0:S.reversed)??!1,[et,je]=qe.split(":").map(Number),Be=`${tt?je:et} / ${tt?et:je}`,Ze=y.columnsCount,we=_.scalingValue(We??0,n),Fe=we,Ke=!it&&w!=="off",Je=J.length%Ze||Ze,st=Je<Ze&&J.length>0,ot=J.length-Je,Oe=st?Math.floor((Ze-Je)/2)+1:1,Ae=A?_.scalingValue(A,n):void 0,gt={width:Fe,...it?{aspectRatio:Be,height:"auto",overflow:"hidden"}:{height:"auto"},...Ae?{borderRadius:Ae,overflow:"hidden"}:{}},ze=`${u}-item-image-wrapper${Ke?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),De=p==="d"||p==="e"||p==="f",Xe=se==="on",dt=`calc(${_.scalingValue(We??0,n)} * (${v} / 100))`,ge=_.scalingValue(We*v/100,n),Re=it?{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,ut]=s.useState(0),Ge=s.useRef(null),bt=E==="fade"||q==="horizontal"?"ltr":q==="vertical"?"ttb":"ltr";s.useEffect(()=>{const vt=Ge.current;if(!vt)return;const yt=new ResizeObserver(Ee=>{ut(Math.round(Ee[0].contentRect.width))});return yt.observe(vt),()=>yt.disconnect()},[]);const It=(()=>{const vt={...ie},yt=Ge.current?getComputedStyle(Ge.current).getPropertyValue("--cntrl-article-width").trim():"";return yt&&(vt["--cntrl-article-width"]=yt),vt})(),[Mt,wt]=s.useState(!1),[Vt,jt]=s.useState([]),[qt,Ut]=s.useState(0),Rt=b==="on"&&(!n||i),Bt=(vt,yt)=>{n&&!i||b!=="off"&&(jt(vt),Ut(yt),wt(!0))};s.useEffect(()=>{if(!Mt||b!=="on"||typeof document>"u")return;const vt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=vt}},[Mt,b]),s.useEffect(()=>{!n||i||wt(!1)},[n,i]);const rn=s.useMemo(()=>Ty(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:rn}}),b==="on"&&a.jsx(_y,{mediaList:He}),a.jsx("div",{style:ie,children:a.jsx("div",{ref:Ge,className:`${u}-wrapper ${u}-type-${p}${Xe?` ${u}-align-entries`:""} ${u}-image-align-${ue} ${Ie}`.trim(),style:{gridTemplateColumns:`repeat(${Ze}, ${we})`,rowGap:Xe?0:_.scalingValue(m??0,n),columnGap:_.scalingValue(y.horizontalGap??0,n),width:_.scalingValue(y.wrapperWidth??0,n),...Xe?{[`--${u}-align-entries-row-gap`]:_.scalingValue(m??0,n)}:{}},children:J.map((vt,yt)=>{var Ft;const Ee=vc(vt.title),Qe=vc(vt.subtitle),rt=(((Ft=vt.link)==null?void 0:Ft.length)??0)>0&&b==="off"?vt.link:void 0,lt=Math.floor(yt/Ze)===Math.ceil(J.length/Ze)-1,Lt=st&&yt>=ot?`${Oe+(yt-ot)}`:void 0,St=De?a.jsxs("div",{className:`${u}-item-text-block`,children:[Ee&&a.jsx("p",{className:ne,style:{width:dt,...ke,...B},children:vt.title}),Ee&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:_.scalingValue(P??0,n),width:ge}}),Qe&&a.jsx("p",{className:me,style:{width:dt,...Ce,...I},children:vt.subtitle}),Qe&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:_.scalingValue(M??0,n),width:ge}})]}):null,ht=Xe?a.jsxs("div",{className:`${u}-item-title-row`,children:[!De&&a.jsx("div",{"data-controls":o&&Ee?"titleMarginTop":void 0,className:o&&Ee?`${u}-control`:void 0,style:{height:Ee?_.scalingValue(P??0,n):0,width:ge}}),Ee&&a.jsx("p",{className:ne,style:{width:dt,...ke,...B},children:vt.title}),De&&Ee&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:_.scalingValue(P??0,n),width:ge}})]}):null,Pt=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?_.scalingValue(M??0,n):0,width:ge}}),Qe&&a.jsx("p",{className:me,style:{width:dt,...Ce,...I},children:vt.subtitle}),De&&Qe&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:_.scalingValue(M??0,n),width:ge}})]}):null,Ot=rt?a.jsxs("a",{href:rt,target:"_blank",className:`${u}-item-text-link`,children:[ht,Pt]}):a.jsxs(a.Fragment,{children:[ht,Pt]}),At=Ou(vt.gallery),Gt=At.filter(pt=>pt.lightboxMedia).map(pt=>pt.lightboxMedia),Et=a.jsx("div",{className:ze,style:gt,children:At.length===0?null:w==="off"?(()=>{const{displayMedia:pt,lightboxMedia:W}=At[0],Le=W?Gt.findIndex(Ve=>Ve.url===W.url):-1;return a.jsx(xc,{media:pt,className:`${u}-item-${Ui(pt)?"video":"image"}`.trim(),style:Re,onMediaClick:Rt&&Le>=0?()=>Bt(Gt,Le):void 0})})():a.jsxs(a.Fragment,{children:[Ke&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:At.map(({displayMedia:pt})=>Ui(pt)?a.jsx("video",{src:pt.url,muted:!0,playsInline:!0},`sizer-${pt.url}`):a.jsx("img",{src:pt.url,alt:""},`sizer-${pt.url}`))}),a.jsx(Ll,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:G*1e3,width:"100%",height:"100%",speed:Ry,type:E==="fade"?"fade":"loop",rewind:E==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:bt},onMoved:pt=>{q!=="random"||E==="fade"||Iy(pt)},children:At.map(({displayMedia:pt,lightboxMedia:W},Le)=>{const Ve=W?Gt.findIndex(Ne=>Ne.url===W.url):-1;return a.jsx(Pl,{children:a.jsx(xc,{media:pt,className:`${u}-item-${Ui(pt)?"video":"image"}`.trim(),style:Re,onMediaClick:Rt&&Ve>=0?()=>Bt(Gt,Ve):void 0})},Le)})},`${E}-${We}-${q}-${G}-${nt}-${c}`)]})}),zt=De?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&Ee?"titleMarginTop":void 0,className:o&&Ee?`${u}-control`:void 0,style:{height:Ee?_.scalingValue(P??0,n):0,width:ge}}),a.jsx("p",{className:ne,style:{width:dt,...ke,...B},children:vt.title}),a.jsx("div",{"data-controls":o&&Qe?"subtitleMarginTop":void 0,className:o&&Qe?`${u}-control`:void 0,style:{height:Qe?_.scalingValue(M??0,n):0,width:ge}}),a.jsx("p",{className:me,style:{width:dt,...Ce,...I},children:vt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:Lt&&!Xe?{gridColumn:Lt}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${Xe&<?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(v??0)>100?`calc(${we} * (${v} / 100))`:we,...Lt&&Xe?{gridColumn:Lt}:{}},children:Xe?a.jsx(a.Fragment,{children:De?a.jsxs(a.Fragment,{children:[Ot,a.jsx("a",{href:rt,target:"_blank",className:`${u}-item-image-link`,children:Et})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:rt,target:"_blank",className:`${u}-item-image-link`,children:Et}),Ot]})}):rt?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:rt,target:"_blank",className:`${u}-item-image-link`,children:[St,Et]}),!De&&a.jsx("a",{href:rt,target:"_blank",className:`${u}-item-text-link`,children:zt})]}):a.jsxs(a.Fragment,{children:[St,Et,zt]})})},yt)})})}),(!n||i)&&Mt&&typeof document<"u"&&b==="on"&&(()=>{const vt=(d?document.getElementById(d):null)??document.body;return Gn.createPortal(a.jsx("div",{style:It,"data-selection":"none",children:a.jsx(Dy,{prefix:u,items:Vt,index:qt,imageDisplay:zy(f),isEditor:n,onClose:()=>wt(!1),onPrev:()=>Ut(yt=>(yt-1+Vt.length)%Vt.length),onNext:()=>Ut(yt=>(yt+1)%Vt.length),counterClassName:ee,counterStyle:Z})}),vt)})()]})}const jy={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Vy=["hover","focus","filled","success","error"],Gy=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
5230
5230
|
import '@splidejs/react-splide/css/core';
|
|
5231
5231
|
import { CommonComponentProps } from '../props';
|
|
5232
5232
|
import {
|
|
@@ -7279,7 +7279,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
7279
7279
|
};
|
|
7280
7280
|
|
|
7281
7281
|
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"}}}},Xy=["titleColor","subtitleColor","lightboxCounterColor"],qy={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:[...Xy],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Uy={element:By,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:qy,sourceCode:Gy},Ky=50,Sc=10,Il="cntrl-lightbox-journal",Na=Il,zs=`${Il}-`,_a=e=>`${Il}-${e}`,Rl=e=>e===Na||e.startsWith(zs),wc=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},$c=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=wc(t.get(_a(e)));if(i)return i}const n=wc(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},Cc=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},Du=(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)},Yy=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)}},zu=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))},Zy=(e,t)=>{if(zu(t)){if(e){window.history.back();return}Yy(t)}},Jy=20,Qy=2,ts=e=>`max(${e}, ${Jy}px)`,Lo=e=>((e==null?void 0:e.image)??[]).slice(0,Qy),Bu=e=>e.reduce((t,n)=>t+Lo(n).length,0),ev=(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}},tv=(e,t)=>{const n=Bu(e),{start:i,end:o}=ev(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)})),nv=(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 tv(i,o)},Tc=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",iv=(e,t,n)=>e==="B"?t.length>1:Bu(n)>1,Ln=.004,ti=.004,bo={title1Width:.13,title2Width:.13,title3Width:.14},bi=(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},hr=(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)},Si=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Po(e.length,n),effective:hr(e.length,n)}},ju=(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),Vu=(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),Ti=["title1","title2","title3","count"],xt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,kl={title1:"1",title2:"2",title3:"3",count:"Count"},El=e=>[xt(e,"fontFamily"),xt(e,"fontSettings"),{type:"row",items:[xt(e,"fontSize"),xt(e,"lineHeight"),xt(e,"letterSpacing"),xt(e,"wordSpacing")]},xt(e,"textAlign"),xt(e,"textAppearance")],ov=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Ti.map(e=>[kl[e],El(e)]))}),rv={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},av={title1:.02,title2:.02,title3:.02,count:.017},ji=(e,t)=>{const n=i=>{const o=xt(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[rv[t]]}},Vi=(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??av[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 Gu({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:b=0,iconMarginRight:S=0,closeIcon:A=null,closeIconMaxWidth:f=0,closeIconColor:w="#000000",closeIconHoverColor:G="#cccccc"}=n,q=N.scalingValue(b,i),E=N.scalingValue(Math.max(b,ti),i),P=N.scalingValue(S,i),M=N.scalingValue(m,i),X=g==="mobile",$=Vi("title1",ji(n,"title1"),i),T=Vi("title2",ji(n,"title2"),i),O=Vi("title3",ji(n,"title3"),i),F=s.useMemo(()=>({title1Width:c??bo.title1Width,title2Width:d??bo.title2Width,title3Width:u??bo.title3Width}),[c,d,u]),L=s.useMemo(()=>({title2MarginLeft:y,title3MarginLeft:v}),[y,v]),C=s.useMemo(()=>bi(e,t,$,T,O),[e,t,$,T,O]),j=s.useMemo(()=>C.map(V=>F[V.widthKey]),[C,F]),x=s.useMemo(()=>Po(C.length,j),[C.length,j]),Y=s.useMemo(()=>hr(C.length,j),[C.length,j]),R=s.useMemo(()=>C.filter(V=>V.prefix==="title1"),[C]),H=s.useMemo(()=>C.filter(V=>V.prefix==="title2"||V.prefix==="title3"),[C]),D=s.useMemo(()=>Si(R,F),[R,F]),Q=s.useMemo(()=>Si(H,F),[H,F]),ae=!!(t.title1||t.title2||t.title3),z=A!==null;if(!(ae||z))return null;const _=(p??0)>0||o,le=(V,Ie)=>{const be=C.findIndex(He=>He.prefix===V.prefix);if(!X||Ie==="single-row")return{effectiveWidth:Y[be]??0,resolvedWidth:x[be]??0,maxWidth:yn(be,x)};if(Ie==="two-row-top"){const He=R.findIndex(We=>We.prefix===V.prefix);return{effectiveWidth:D.effective[He]??0,resolvedWidth:D.resolved[He]??0,maxWidth:yn(He,D.resolved)}}const J=H.findIndex(He=>He.prefix===V.prefix);return{effectiveWidth:Q.effective[J]??0,resolvedWidth:Q.resolved[J]??0,maxWidth:yn(J,Q.resolved)}},te=(V,Ie,be)=>{if(!X||be==="single-row"){const qe=V.findIndex(ye=>ye.prefix===Ie.prefix),tt=V.map(ye=>F[ye.widthKey]),et=Po(V.length,tt);return{effectiveWidth:hr(V.length,tt)[qe]??0,resolvedWidth:et[qe]??0,maxWidth:yn(qe,et)}}if(be==="two-row-top"){const qe=V.filter(ye=>ye.prefix==="title1"),tt=qe.findIndex(ye=>ye.prefix===Ie.prefix),{resolved:et,effective:je}=Si(qe,F);return{effectiveWidth:je[tt]??0,resolvedWidth:et[tt]??0,maxWidth:yn(tt,et)}}const J=V.filter(qe=>qe.prefix==="title2"||qe.prefix==="title3"),He=J.findIndex(qe=>qe.prefix===Ie.prefix),{resolved:We,effective:it}=Si(J,F);return{effectiveWidth:it[He]??0,resolvedWidth:We[He]??0,maxWidth:yn(He,We)}},fe=V=>Vu(C,x,L,V)+(X?0:p??0),Pe=()=>X?0:p??0,xe=V=>H.slice(0,V).reduce((Ie,be,J)=>Ie+(be.marginLeftKey?L[be.marginLeftKey]??0:0)+(Q.resolved[J]??0),0),ue=V=>{const Ie=H[V];return xe(V)+(Ie.marginLeftKey?L[Ie.marginLeftKey]??0:0)+(Q.resolved[V]??0)},K=(V,Ie,be)=>{const J=V.marginLeftKey?L[V.marginLeftKey]??0:0,{effectiveWidth:He,resolvedWidth:We,maxWidth:it}=be??le(V,Ie),qe=Math.max(J,ti),tt=o&&Ie==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":V.prefix,style:{width:N.scalingValue(He,i),...J>0?{marginLeft:N.scalingValue(J,i)}:{}},children:[a.jsx("p",{className:V.className,style:V.style,children:V.text}),tt&&V.marginLeftKey?a.jsx("div",{"data-controls":V.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(We),style:{position:"absolute",top:0,left:N.scalingValue(-J,i),width:N.scalingValue(qe,i),height:"100%",pointerEvents:"auto"}}):null,tt?a.jsx("div",{"data-controls":V.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(it),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:N.scalingValue(-Ln/2,i),width:N.scalingValue(Ln,i),height:"100%",pointerEvents:"auto"}}):null]},V.className)},se=(V="two-row")=>{const Ie=C.findIndex(He=>He.prefix==="title1"),be=Ie>=0?x[Ie]:F.title1Width,J=V==="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:N.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=V=>{const Ie=bi(e,V,$,T,O);return a.jsx(a.Fragment,{children:Ie.map(be=>K(be,"single-row",te(Ie,be,"single-row")))})},$e=V=>{const Ie=bi(e,V,$,T,O),be=Ie.find(J=>J.prefix==="title1");return be?K(be,"two-row-top",te(Ie,be,"two-row-top")):null},ke=(V,Ie=!1)=>{const be=bi(e,V,$,T,O),J=be.filter(it=>it.prefix==="title2"||it.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(it=>K(it,"two-row-bottom",te(be,it,"two-row-bottom")))}),Ie&&o?a.jsxs(a.Fragment,{children:[me(),B()]}):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:M,width:"100%",flexShrink:0,pointerEvents:He?"auto":"none"}}):null]}):null},he=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:N.scalingValue(f??0,i),height:N.scalingValue(f??0,i),marginRight:P,"--close-icon-hover-color":G},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:V=>{V.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(mn,{url:A??"",fill:w,hoverFill:i&&!r?w:G,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"}})]}),Se=()=>z?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:he()}):null,Te=V=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:V})}),h=V=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[z||ae?de():null,_?se("two-row"):null,Te(V),Se()]}),U=(V,Ie=!1)=>a.jsxs(a.Fragment,{children:[h($e(V)),ke(V,Ie)]}),Z=()=>{const V=X?-1:C.findIndex(J=>J.prefix==="title1"),Ie=!X&&(o||(p??0)>0)?(()=>{const J=p??0,He=V>=0?x[V]:F.title1Width,We=Math.max(J,ti);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:N.scalingValue(We,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,be=C.flatMap((J,He)=>{if(!J.marginLeftKey)return[];const We=L[J.marginLeftKey]??0,it=ju(C,x,L,He)+Pe(),qe=Math.max(We,ti);return a.jsx("div",{"data-controls":J.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(x[He]),style:{position:"absolute",top:0,left:N.scalingValue(it,i),width:N.scalingValue(qe,i),height:"100%",pointerEvents:"auto"}},J.marginLeftKey)});return Ie?[Ie,...be]:be},ne=()=>C.map((V,Ie)=>{const be=yn(Ie,x),He=fe(Ie)-Ln/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":V.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:N.scalingValue(He,i),width:N.scalingValue(Ln,i),height:"100%",pointerEvents:"auto"}})},`${V.widthKey}-junction`)}),me=()=>H.flatMap((V,Ie)=>{if(!V.marginLeftKey)return[];const be=L[V.marginLeftKey]??0,J=xe(Ie),He=Math.max(be,ti),{resolvedWidth:We}=le(V,"two-row-bottom");return a.jsx("div",{"data-controls":V.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(We),style:{position:"absolute",top:0,left:N.scalingValue(J,i),width:N.scalingValue(He,i),height:"100%",pointerEvents:"auto"}},V.marginLeftKey)}),B=()=>H.map((V,Ie)=>{const{maxWidth:be}=le(V,"two-row-bottom"),He=ue(Ie)-Ln/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":V.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:N.scalingValue(He,i),width:N.scalingValue(Ln,i),height:"100%",pointerEvents:"auto"}})},`${V.widthKey}-junction`)}),I=()=>!o||X?null:a.jsxs(a.Fragment,{children:[Z(),ne()]}),ee=!!(t.title2||t.title3||(m??0)>0||o),ie=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[z||ae?de():null,_?se("single-row"):null,ae?Te(ve(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),Se(),I()]}),pe=()=>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:U(t,!0)}),I()]});return a.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:q,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:E,pointerEvents:"auto"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...X?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${X?` ${e}-lightbox-content-area-stacked`:""}`,children:a.jsx("div",{className:`${e}-text-bar-cell${X?` ${e}-text-bar-cell-stacked`:""}`,style:X?void 0:{flex:1,minWidth:0,width:"100%"},children:X?pe():ie()})})})]})}function sv(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function lv(e){return`
|
|
7282
|
+
`,es={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Xy=["titleColor","subtitleColor","lightboxCounterColor"],qy={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:[...Xy],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Uy={element:By,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:qy,sourceCode:Gy},Ky=50,Sc=10,Il="cntrl-lightbox-journal",Na=Il,zs=`${Il}-`,_a=e=>`${Il}-${e}`,Rl=e=>e===Na||e.startsWith(zs),wc=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},$c=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=wc(t.get(_a(e)));if(i)return i}const n=wc(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},Cc=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},Du=(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)},Yy=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)}},zu=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))},Zy=(e,t)=>{if(zu(t)){if(e){window.history.back();return}Yy(t)}},Jy=20,Qy=2,ts=e=>`max(${e}, ${Jy}px)`,Lo=e=>((e==null?void 0:e.image)??[]).slice(0,Qy),Bu=e=>e.reduce((t,n)=>t+Lo(n).length,0),ev=(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}},tv=(e,t)=>{const n=Bu(e),{start:i,end:o}=ev(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)})),nv=(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 tv(i,o)},Tc=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",iv=(e,t,n)=>e==="B"?t.length>1:Bu(n)>1,Ln=.004,ti=.004,bo={title1Width:.13,title2Width:.13,title3Width:.14},bi=(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},hr=(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)},Si=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Po(e.length,n),effective:hr(e.length,n)}},ju=(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),Vu=(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),Ti=["title1","title2","title3","count"],xt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,kl={title1:"1",title2:"2",title3:"3",count:"Count"},El=e=>[xt(e,"fontFamily"),xt(e,"fontSettings"),{type:"row",items:[xt(e,"fontSize"),xt(e,"lineHeight"),xt(e,"letterSpacing"),xt(e,"wordSpacing")]},xt(e,"textAlign"),xt(e,"textAppearance")],ov=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Ti.map(e=>[kl[e],El(e)]))}),rv={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},av={title1:.02,title2:.02,title3:.02,count:.017},ji=(e,t)=>{const n=i=>{const o=xt(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[rv[t]]}},Vi=(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??av[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 Gu({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:b=0,iconMarginRight:S=0,closeIcon:A=null,closeIconMaxWidth:f=0,closeIconColor:w="#000000",closeIconHoverColor:G="#cccccc"}=n,q=_.scalingValue(b,i),E=_.scalingValue(Math.max(b,ti),i),P=_.scalingValue(S,i),M=_.scalingValue(m,i),X=g==="mobile",$=Vi("title1",ji(n,"title1"),i),T=Vi("title2",ji(n,"title2"),i),O=Vi("title3",ji(n,"title3"),i),N=s.useMemo(()=>({title1Width:c??bo.title1Width,title2Width:d??bo.title2Width,title3Width:u??bo.title3Width}),[c,d,u]),L=s.useMemo(()=>({title2MarginLeft:y,title3MarginLeft:v}),[y,v]),C=s.useMemo(()=>bi(e,t,$,T,O),[e,t,$,T,O]),j=s.useMemo(()=>C.map(V=>N[V.widthKey]),[C,N]),x=s.useMemo(()=>Po(C.length,j),[C.length,j]),Y=s.useMemo(()=>hr(C.length,j),[C.length,j]),R=s.useMemo(()=>C.filter(V=>V.prefix==="title1"),[C]),H=s.useMemo(()=>C.filter(V=>V.prefix==="title2"||V.prefix==="title3"),[C]),D=s.useMemo(()=>Si(R,N),[R,N]),Q=s.useMemo(()=>Si(H,N),[H,N]),ae=!!(t.title1||t.title2||t.title3),z=A!==null;if(!(ae||z))return null;const F=(p??0)>0||o,le=(V,Ie)=>{const be=C.findIndex(He=>He.prefix===V.prefix);if(!X||Ie==="single-row")return{effectiveWidth:Y[be]??0,resolvedWidth:x[be]??0,maxWidth:yn(be,x)};if(Ie==="two-row-top"){const He=R.findIndex(We=>We.prefix===V.prefix);return{effectiveWidth:D.effective[He]??0,resolvedWidth:D.resolved[He]??0,maxWidth:yn(He,D.resolved)}}const J=H.findIndex(He=>He.prefix===V.prefix);return{effectiveWidth:Q.effective[J]??0,resolvedWidth:Q.resolved[J]??0,maxWidth:yn(J,Q.resolved)}},te=(V,Ie,be)=>{if(!X||be==="single-row"){const qe=V.findIndex(ye=>ye.prefix===Ie.prefix),tt=V.map(ye=>N[ye.widthKey]),et=Po(V.length,tt);return{effectiveWidth:hr(V.length,tt)[qe]??0,resolvedWidth:et[qe]??0,maxWidth:yn(qe,et)}}if(be==="two-row-top"){const qe=V.filter(ye=>ye.prefix==="title1"),tt=qe.findIndex(ye=>ye.prefix===Ie.prefix),{resolved:et,effective:je}=Si(qe,N);return{effectiveWidth:je[tt]??0,resolvedWidth:et[tt]??0,maxWidth:yn(tt,et)}}const J=V.filter(qe=>qe.prefix==="title2"||qe.prefix==="title3"),He=J.findIndex(qe=>qe.prefix===Ie.prefix),{resolved:We,effective:it}=Si(J,N);return{effectiveWidth:it[He]??0,resolvedWidth:We[He]??0,maxWidth:yn(He,We)}},fe=V=>Vu(C,x,L,V)+(X?0:p??0),Pe=()=>X?0:p??0,xe=V=>H.slice(0,V).reduce((Ie,be,J)=>Ie+(be.marginLeftKey?L[be.marginLeftKey]??0:0)+(Q.resolved[J]??0),0),de=V=>{const Ie=H[V];return xe(V)+(Ie.marginLeftKey?L[Ie.marginLeftKey]??0:0)+(Q.resolved[V]??0)},K=(V,Ie,be)=>{const J=V.marginLeftKey?L[V.marginLeftKey]??0:0,{effectiveWidth:He,resolvedWidth:We,maxWidth:it}=be??le(V,Ie),qe=Math.max(J,ti),tt=o&&Ie==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":V.prefix,style:{width:_.scalingValue(He,i),...J>0?{marginLeft:_.scalingValue(J,i)}:{}},children:[a.jsx("p",{className:V.className,style:V.style,children:V.text}),tt&&V.marginLeftKey?a.jsx("div",{"data-controls":V.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(We),style:{position:"absolute",top:0,left:_.scalingValue(-J,i),width:_.scalingValue(qe,i),height:"100%",pointerEvents:"auto"}}):null,tt?a.jsx("div",{"data-controls":V.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(it),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:_.scalingValue(-Ln/2,i),width:_.scalingValue(Ln,i),height:"100%",pointerEvents:"auto"}}):null]},V.className)},se=(V="two-row")=>{const Ie=C.findIndex(He=>He.prefix==="title1"),be=Ie>=0?x[Ie]:N.title1Width,J=V==="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:_.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...J?{pointerEvents:"auto"}:{}}})},ue=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:$,"aria-hidden":"true",children:" "}),ve=V=>{const Ie=bi(e,V,$,T,O);return a.jsx(a.Fragment,{children:Ie.map(be=>K(be,"single-row",te(Ie,be,"single-row")))})},$e=V=>{const Ie=bi(e,V,$,T,O),be=Ie.find(J=>J.prefix==="title1");return be?K(be,"two-row-top",te(Ie,be,"two-row-top")):null},ke=(V,Ie=!1)=>{const be=bi(e,V,$,T,O),J=be.filter(it=>it.prefix==="title2"||it.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(it=>K(it,"two-row-bottom",te(be,it,"two-row-bottom")))}),Ie&&o?a.jsxs(a.Fragment,{children:[me(),B()]}):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:M,width:"100%",flexShrink:0,pointerEvents:He?"auto":"none"}}):null]}):null},he=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:_.scalingValue(f??0,i),height:_.scalingValue(f??0,i),marginRight:P,"--close-icon-hover-color":G},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:V=>{V.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(mn,{url:A??"",fill:w,hoverFill:i&&!r?w:G,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"}})]}),Se=()=>z?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:he()}):null,Ce=V=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:V})}),h=V=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[z||ae?ue():null,F?se("two-row"):null,Ce(V),Se()]}),U=(V,Ie=!1)=>a.jsxs(a.Fragment,{children:[h($e(V)),ke(V,Ie)]}),Z=()=>{const V=X?-1:C.findIndex(J=>J.prefix==="title1"),Ie=!X&&(o||(p??0)>0)?(()=>{const J=p??0,He=V>=0?x[V]:N.title1Width,We=Math.max(J,ti);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:_.scalingValue(We,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,be=C.flatMap((J,He)=>{if(!J.marginLeftKey)return[];const We=L[J.marginLeftKey]??0,it=ju(C,x,L,He)+Pe(),qe=Math.max(We,ti);return a.jsx("div",{"data-controls":J.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(x[He]),style:{position:"absolute",top:0,left:_.scalingValue(it,i),width:_.scalingValue(qe,i),height:"100%",pointerEvents:"auto"}},J.marginLeftKey)});return Ie?[Ie,...be]:be},ne=()=>C.map((V,Ie)=>{const be=yn(Ie,x),He=fe(Ie)-Ln/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":V.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:_.scalingValue(He,i),width:_.scalingValue(Ln,i),height:"100%",pointerEvents:"auto"}})},`${V.widthKey}-junction`)}),me=()=>H.flatMap((V,Ie)=>{if(!V.marginLeftKey)return[];const be=L[V.marginLeftKey]??0,J=xe(Ie),He=Math.max(be,ti),{resolvedWidth:We}=le(V,"two-row-bottom");return a.jsx("div",{"data-controls":V.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(We),style:{position:"absolute",top:0,left:_.scalingValue(J,i),width:_.scalingValue(He,i),height:"100%",pointerEvents:"auto"}},V.marginLeftKey)}),B=()=>H.map((V,Ie)=>{const{maxWidth:be}=le(V,"two-row-bottom"),He=de(Ie)-Ln/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":V.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:_.scalingValue(He,i),width:_.scalingValue(Ln,i),height:"100%",pointerEvents:"auto"}})},`${V.widthKey}-junction`)}),I=()=>!o||X?null:a.jsxs(a.Fragment,{children:[Z(),ne()]}),ee=!!(t.title2||t.title3||(m??0)>0||o),ie=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[z||ae?ue():null,F?se("single-row"):null,ae?Ce(ve(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),Se(),I()]}),pe=()=>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:U(t,!0)}),I()]});return a.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:q,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:E,pointerEvents:"auto"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...X?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${X?` ${e}-lightbox-content-area-stacked`:""}`,children:a.jsx("div",{className:`${e}-text-bar-cell${X?` ${e}-text-bar-cell-stacked`:""}`,style:X?void 0:{flex:1,minWidth:0,width:"100%"},children:X?pe():ie()})})})]})}function sv(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function lv(e){return`
|
|
7283
7283
|
.${e}-wrapper {
|
|
7284
7284
|
display: grid;
|
|
7285
7285
|
align-items: start;
|
|
@@ -7599,7 +7599,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
7599
7599
|
pointer-events: auto;
|
|
7600
7600
|
flex-shrink: 0;
|
|
7601
7601
|
}
|
|
7602
|
-
`}const Lc={url:"",name:"",objectFit:"cover"},_n=500,Xo=650,Sn="cubic-bezier(0.22, 1, 0.36, 1)",cv=72,dv=50,uv=1e4,pv=650,mv=500;function gv(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 Xu(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 hv(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Xu(i,n):null}function fv(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 tr(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 Pc(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return tr(e,i,n)}const yv=.03;function qu(e){return e.width*yv}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 Ic(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function vv(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 xv(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Bs(e,t.width,t.height)}function bv(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 Sv(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 wv({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=qu(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 $v(e,t,n){const{left:i,width:o}=n,r=qu(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 Uu(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 Cv(e,t,n,i){const{start:o,end:r}=Uu(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function Tv(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 Ku(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(Ku(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??Lc,i??o??Lc]}]}function Lv(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Pv(e){const[t]=e.media;return t!=null&&t.url?t:null}function Al(e){if(!Array.isArray(e)||e.length===0)return[];if(Ku(e)){const t=[];for(const n of e){const i=Lv(n);if(!i)continue;const o=Pv(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 Iv({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 Rv({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 kv({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:b,onNext:S}){const A=s.useRef(null),f=s.useRef(null),w=s.useRef(null),G=s.useRef(new Map),[q,E]=s.useState(0),P=s.useRef(null),M=s.useRef(0),X=s.useRef(0),$=s.useRef("none"),T=s.useRef(!1),O=s.useRef(!1),F=s.useRef(!1),L=s.useRef(null),C=s.useRef(null),j=s.useRef(null),x=s.useRef(()=>{}),Y=s.useRef(null),R=s.useRef(null),H=s.useRef(null),D=s.useRef(!1),[Q,ae]=s.useState(null),[z,re]=s.useState(ns),[_,le]=s.useState(0),[te,fe]=s.useState("opening"),[Pe,xe]=s.useState(0),[ue,K]=s.useState(0),[se,de]=s.useState(!1),[ve,$e]=s.useState(null),[ke,he]=s.useState(null),[Se,Te]=s.useState(null),[h,U]=s.useState(!1),[Z,ne]=s.useState(null),[me,B]=s.useState(!1),I=s.useRef(!1),[ee,ie]=s.useState(!1),[pe,V]=s.useState(!1),Ie=s.useRef(n),be=s.useRef(void 0),J=t[n],He=J?zo(J):!1,We=ue!==0||se,it=!l&&(!r||!!c),qe=d&&!l,tt=u.length>1,et=s.useCallback((W,Le)=>t.length<=1?null:t[(W+Le+t.length)%t.length]??null,[t]),je=tt?tr(u,p,-1):et(n,-1),ye=tt?tr(u,p,1):et(n,1),_e=ve===-1&&We?tt&&ke!==null?tr(u,ke,-1):Se!==null?et(Se,-1):null:null,Be=ve===1&&We?tt&&ke!==null?tr(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!==(ye==null?void 0:ye.url)?Be:null,Fe=je&&qe?(()=>{const W=tt?Pc(u,p,-1):t.length>2?et((n-1+t.length)%t.length,-1):null;return W&&W.url!==je.url?W:null})():null,Ke=ye&&qe?(()=>{const W=tt?Pc(u,p,1):t.length>2?et((n+1)%t.length,1):null;return W&&W.url!==ye.url?W:null})():null,Je=Ze??Fe,st=we??Ke,ot=s.useCallback((W,Le,Ve)=>{if(!W||!Le||!Ve)return;const Ne=G.current,ft=Ne.get(W);(ft==null?void 0:ft.width)===Le&&(ft==null?void 0:ft.height)===Ve||(Ne.set(W,{width:Le,height:Ve}),E(Nt=>Nt+1))},[]),Oe=s.useCallback(W=>{if(!(W!=null&&W.url))return null;const Le=G.current.get(W.url);return xv(f.current,Le)},[q,_]),Ae=s.useCallback(()=>{if(!J)return;const W=Oe(J);if(W){ae(W);return}const Le=f.current;Le&&ae(Ic(Le))},[J,Oe]),gt=s.useCallback(W=>{if(tt){const Le=u.length;he((p+W+Le)%Le),Te(null);return}t.length>1&&(Te((n+W+t.length)%t.length),he(null))},[tt,u.length,p,t.length,n]),ze=s.useCallback(W=>{F.current=W,de(W)},[]),De=s.useCallback(()=>{L.current!==null&&(window.clearTimeout(L.current),L.current=null)},[]),Xe=s.useCallback(()=>{De(),L.current=window.setTimeout(()=>{De(),ze(!1)},Xo+32)},[De,ze]),dt=s.useCallback(()=>{const W=A.current;if(!W){re({left:0,top:0,width:typeof window<"u"?window.innerWidth:ns.width,height:typeof window<"u"?window.innerHeight:ns.height});return}const Le=W.getBoundingClientRect();re({left:Le.left,top:Le.top,width:Le.width,height:Le.height})},[]),ge=s.useCallback((W,Le)=>{if(We){if(ee&&!se)return`translate(${ue}px, 0px)`;if(se&&ve!==null){const Ve=Oe(W);if(!Ve)return;const{x:Ne,y:ft}=Cv(Ve,Le,ve,z);return`translate(${Ne}px, ${ft}px)`}if(se)return"translate(0px, 0px)"}},[We,ee,se,ue,ve,z,Oe]),Re=s.useCallback(()=>{const W=C.current;C.current=null,De(),ze(!1),$e(null),he(null),Te(null),K(0),ie(!1),T.current=!1,X.current=0,$.current="none",W===-1?b():W===1&&S()},[De,ze,b,S]),nt=s.useCallback(()=>{De(),L.current=window.setTimeout(()=>{C.current!==null&&Re()},Xo+32)},[De,Re]),ut=s.useCallback(()=>{De(),C.current=null,ze(!1),$e(null),he(null),Te(null),K(0),ie(!1),T.current=!1,X.current=0,$.current="none"},[De,ze]),Ge=s.useCallback(W=>{if(!(!qe||!Q)){if(F.current){if(C.current===W){j.current=W,Re();return}ut()}De(),gt(W),C.current=W,$e(W),ze(!0),nt()}},[qe,Q,Re,ut,De,gt,ze,nt]);x.current=Ge;const bt=s.useCallback(()=>{Y.current=null,D.current=!1,R.current!==null&&(window.clearInterval(R.current),R.current=null),H.current!==null&&(window.clearTimeout(H.current),H.current=null)},[]),It=s.useCallback(W=>{R.current!==null&&window.clearInterval(R.current);const Le=D.current?mv:pv;R.current=window.setInterval(()=>{x.current(W)},Le)},[]),Mt=s.useCallback(W=>{Y.current!==W&&(bt(),Y.current=W,D.current=!1,x.current(W),It(W),H.current=window.setTimeout(()=>{H.current=null,Y.current===W&&(D.current=!0,It(W))},uv))},[bt,It]),wt=s.useCallback(()=>{const W=f.current;if(!W)return;const Le=J==null?void 0:J.url,Ve=Le?G.current.get(Le):void 0;if(Ve!=null&&Ve.width&&(Ve!=null&&Ve.height)){ae(Bs(W,Ve.width,Ve.height));return}const Ne=w.current;if(Ne&&Le&&(Ne.src===Le||Ne.currentSrc===Le)){const{width:Nt,height:mt}=vv(Ne);if(Nt&&mt){ot(Le,Nt,mt),ae(Bs(W,Nt,mt));return}}const ft=Ic(W);!ft.width||!ft.height||ae(ft)},[J==null?void 0:J.url,ot]),Vt=s.useCallback(W=>{if(w.current=W,!!W){if(W instanceof HTMLVideoElement){W.readyState>=1&&W.videoWidth>0&&wt();return}W.complete&&W.naturalWidth>0&&wt()}},[wt]),jt=s.useCallback(()=>{dt(),wt(),le(W=>W+1)},[dt,wt]);s.useEffect(()=>{jt();const W=f.current,Le=A.current,Ve=new ResizeObserver(()=>jt());return W&&Ve.observe(W),Le&&Ve.observe(Le),window.addEventListener("resize",jt),()=>{Ve.disconnect(),window.removeEventListener("resize",jt)}},[jt,n,y]),s.useLayoutEffect(()=>{if(!J)return;const W=w.current;if(W){if(W instanceof HTMLImageElement&&W.complete&&W.naturalWidth>0){wt();return}W instanceof HTMLVideoElement&&W.readyState>=1&&W.videoWidth>0&&wt()}},[J==null?void 0:J.url,n,wt]),s.useEffect(()=>{Ae()},[Ae,q]),s.useEffect(()=>{const W=new Set,Le=[],Ve=Ne=>{!(Ne!=null&&Ne.url)||W.has(Ne.url)||(W.add(Ne.url),Le.push(Ne))};t.forEach(Ve),u.forEach(Ne=>Ne.items.forEach(Ve)),Le.forEach(Ne=>{G.current.has(Ne.url)||bv(Ne,ot)})},[t,u,ot]),s.useEffect(()=>{if(te!=="opening"||!Q)return;if(!v){fe("open");return}U(!1);const W=requestAnimationFrame(()=>{requestAnimationFrame(()=>{U(!0),fe("open")})});return()=>cancelAnimationFrame(W)},[te,Q,v]),s.useEffect(()=>{if(te!=="closing")return;const W=setTimeout(()=>g(),_n);return()=>clearTimeout(W)},[te,g]),s.useEffect(()=>()=>{De()},[De]),s.useLayoutEffect(()=>{Ie.current===n&&be.current===(J==null?void 0:J.url)||(De(),C.current=null,$e(null),he(null),Te(null),xe(0),K(0),ze(!1),V(!1),ie(!1),M.current=0,X.current=0,$.current="none",T.current=!1,P.current=null,O.current=!1,w.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 W=j.current;W!==null&&(j.current=null,requestAnimationFrame(()=>{x.current(W)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(te==="opening"){I.current=!1,B(!1);return}if(te!=="open"||I.current)return;if(!je&&!ye){I.current=!0;return}B(!1);const W=requestAnimationFrame(()=>{requestAnimationFrame(()=>{B(!0),I.current=!0})});return()=>cancelAnimationFrame(W)},[te,je==null?void 0:je.url,ye==null?void 0:ye.url]),s.useEffect(()=>{if(te!=="open")return;const W=()=>{const mt=$t=>{$t.stopPropagation(),$t.preventDefault(),document.removeEventListener("click",mt,!0)};document.addEventListener("click",mt,!0)},Le=mt=>{const $t=mt<0?1:-1;De(),gt($t),C.current=$t,$e($t),ze(!0),nt()},Ve=mt=>{if(Math.abs(mt)>dv&&qe){Le(mt);return}C.current=null,$e(null),he(null),Te(null),ze(!0),K(0),Xe()},Ne=mt=>{if(mt.touches.length!==1||F.current)return;const $t=mt.touches[0];O.current=!0,P.current={x:$t.clientX,y:$t.clientY},$.current="none",X.current=0,T.current=!1},ft=mt=>{if(!P.current||mt.touches.length!==1||F.current)return;const $t=mt.touches[0],Yt=$t.clientX-P.current.x,Dt=$t.clientY-P.current.y;if($.current==="none"){if(Math.abs(Yt)<10&&Math.abs(Dt)<10)return;if(Math.abs(Yt)>Math.abs(Dt)){if(!qe)return;$.current="horizontal"}else if(Dt>0){if(!it)return;$.current="vertical"}else return}if($.current==="horizontal"){T.current=!0,ie(!0),X.current=Yt,K(Yt),mt.preventDefault();return}$.current==="vertical"&&(T.current=!0,ie(!0),M.current=Dt,xe(Dt),mt.preventDefault())},Nt=()=>{if(!P.current)return;const mt=$.current,$t=T.current;if($t&&mt==="horizontal")Ve(X.current),W();else if($t&&mt==="vertical"){const Yt=M.current;if(it&&Yt>cv){const Dt=window.innerHeight;M.current=Dt,V(!0),xe(Dt),fe("closing")}else M.current=0,xe(0);W()}else mt==="horizontal"&&Math.abs(X.current)>0&&(Ve(X.current),W());P.current=null,$.current="none",X.current=0,T.current=!1,ie(!1)};return document.addEventListener("touchstart",Ne,{passive:!0}),document.addEventListener("touchmove",ft,{passive:!1}),document.addEventListener("touchend",Nt),document.addEventListener("touchcancel",Nt),()=>{document.removeEventListener("touchstart",Ne),document.removeEventListener("touchmove",ft),document.removeEventListener("touchend",Nt),document.removeEventListener("touchcancel",Nt)}},[te,qe,ze,Xe,De,it,nt,gt]);const qt=s.useCallback(()=>{const W=(m==null?void 0:m())??v??null;W&&Q&&(ne(W),U(!0)),fe("closing")},[m,v,Q]);s.useEffect(()=>{const W=Ne=>{if(Ne.key==="Escape"){if(r&&c||te==="closing")return;bt(),qt();return}if(Ne.key!=="ArrowLeft"&&Ne.key!=="ArrowRight"||te!=="open"||!qe)return;Ne.preventDefault();const ft=Ne.key==="ArrowLeft"?-1:1;Ne.repeat&&Y.current===ft||Mt(ft)},Le=Ne=>{if(Ne.key!=="ArrowLeft"&&Ne.key!=="ArrowRight")return;const ft=Ne.key==="ArrowLeft"?-1:1;Y.current===ft&&bt()},Ve=()=>{bt()};return window.addEventListener("keydown",W),window.addEventListener("keyup",Le),window.addEventListener("blur",Ve),()=>{window.removeEventListener("keydown",W),window.removeEventListener("keyup",Le),window.removeEventListener("blur",Ve),bt()}},[te,r,c,qt,qe,Mt,bt]),s.useEffect(()=>{te!=="open"&&bt()},[te,bt]);const Ut=()=>{te==="closing"||l||qt()},Rt=te==="open",Bt=te==="closing",rn=Pe>0?Math.max(0,1-Pe/500):1,vt=Pe>0?Math.max(.35,1-Pe/500):1,yt=s.useCallback(W=>{if(!(W.propertyName!=="transform"||!F.current)){if(C.current!==null){Re();return}De(),ze(!1)}},[De,ze,Re]),Ee=te==="closing"?Z??v:v,Qe=Ee&&Q&&(te==="opening"||Bt)?gv(Ee,Q):void 0,rt=We&&J?ge(J,"center"):Pe>0?`translateY(${Pe}px)`:Qe,lt=Q?Wr(Q,z):null,Lt=!!(Ee&&Q),St=Lt&&(te==="closing"||te==="open"&&h),ht={position:"absolute",top:lt==null?void 0:lt.top,left:lt==null?void 0:lt.left,width:lt==null?void 0:lt.width,height:lt==null?void 0:lt.height,objectFit:"contain",transformOrigin:"top left",transform:rt,opacity:Pe>0?vt:Lt?1:te==="opening"||Bt?0:1,transition:ee&&!se?"none":se?`transform ${Xo}ms ${Sn}`:pe?`transform ${_n}ms ${Sn}, opacity ${_n}ms ${Sn}`:St?`transform ${_n}ms ${Sn}`:te==="opening"||Bt?`opacity ${_n}ms ${Sn}`:"none",pointerEvents:He&&Rt&&!We?"auto":"none",touchAction:He&&Rt?"none":void 0,zIndex:1,overflow:He?"hidden":void 0},Pt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Rt&&!We?"auto":"none"},Ot=(W,Le,Ve="adjacent")=>{const Ne=Oe(W);if(!Ne)return{display:"none"};const ft=Ve==="far"?Le==="left"?"far-left":"far-right":Le==="left"?"left-adjacent":"right-adjacent",{start:Nt}=ve!==null?Uu(Ne,ft,ve,z):{start:Ve==="far"?ya(Ne,Le,z):Io(Ne,Le,z)},mt=Wr(Nt,z),$t=ge(W,ft),Yt=!We&&Ve==="adjacent"&&Rt&&!me?Tv(Ne,Le,z):null,Dt=Ve==="far"&&We&&ve===(Le==="left"?-1:1),sn=ee&&!se?!1:se,ln=Ve==="adjacent"&&Rt&&me&&!We;return{position:"absolute",top:mt.top,left:mt.left,width:mt.width,height:mt.height,objectFit:"contain",transform:$t??(Yt?`translate(${Yt.x}px, ${Yt.y}px)`:void 0),opacity:Ve==="far"?Rt&&Dt?1:0:Rt?1:0,transition:sn?Ve==="far"?`transform ${Xo}ms ${Sn}`:`transform ${Xo}ms ${Sn}, opacity ${_n}ms ${Sn}`:ln?`transform ${_n}ms ${Sn}`:te==="opening"||Bt?`opacity ${_n}ms ${Sn}`:"none",pointerEvents:"none",zIndex:1}},At=(W,Le)=>{const Ve=Oe(W);return Ve?$v(Io(Ve,Le,z),Le,z):null},Gt=W=>Le=>{if(!l){if(O.current){O.current=!1;return}Le.stopPropagation(),Ge(W)}},Et=je?At(je,"left"):null,zt=ye?At(ye,"right"):null,Ft=Et?Wr(Et,z):null,pt=zt?Wr(zt,z):null;return a.jsxs("div",{ref:A,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:te==="open"?"none":void 0},onClick:Ut,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Rt?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:Rt?1:0,transition:ee?"none":`opacity ${_n}ms ${Sn}`,pointerEvents:"none"},children:a.jsx(Gu,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,onClose:Ut})})]}),Rt&&Je&&a.jsx(Or,{media:Je,style:Ot(Je,"left","far"),onMeasure:ot,onTransitionEnd:yt},`far-prev-${Je.url}`),Rt&&je&&a.jsxs(a.Fragment,{children:[a.jsx(Or,{media:je,style:Ot(je,"left"),onMeasure:ot,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||ee?"default":"pointer",pointerEvents:l||ee?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Rt&&ye&&a.jsxs(a.Fragment,{children:[a.jsx(Or,{media:ye,style:Ot(ye,"right"),onMeasure:ot,onTransitionEnd:yt},`next-${ye.url}`),pt&&a.jsx("div",{style:{position:"absolute",top:pt.top,left:pt.left,width:pt.width,height:pt.height,cursor:l||ee?"default":"pointer",pointerEvents:l||ee?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Rt&&st&&a.jsx(Or,{media:st,style:Ot(st,"right","far"),onMeasure:ot,onTransitionEnd:yt},`far-next-${st.url}`),Q&&J&&(He?a.jsx(Rv,{src:J.url,phase:te,onMediaElement:Vt,wrapperStyle:ht,videoStyle:Pt,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 Ev({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:c}=N.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,[b,S]=m.split(":").map(Number),w=`${g?S:b} / ${g?b:S}`,G=d.entryWidth??.2,q=d.columnsCount,E=N.scalingValue(G,n),P=N.scalingValue(d.horizontalGap??0,n),M=E,X=E,$={width:M,...v?{aspectRatio:w,height:"auto",overflow:"hidden"}:{height:"auto"}},T=v?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},O=s.useRef(null),[F,L]=s.useState(!1),[C,j]=s.useState([]),[x,Y]=s.useState(0),[R,H]=s.useState(0),[D,Q]=s.useState(null),[ae,z]=s.useState({title1:"",title2:"",title3:""}),re=(()=>{const Se={},Te=O.current?getComputedStyle(O.current).getPropertyValue("--cntrl-article-width").trim():"";return Te&&(Se["--cntrl-article-width"]=Te),Se})(),_=!n||i||o,le=s.useMemo(()=>lv(c),[c]),te=t??[],fe=te.length%q||q,Pe=fe<q&&te.length>0,xe=te.length-fe,ue=Pe?Math.floor((q-fe)/2)+1:1,K=s.useMemo(()=>fv(te),[te]),se=s.useMemo(()=>Sv(te),[te]),de=(Se,Te,h)=>{if(n&&!o&&!i)return;const U=K.findIndex(ne=>ne.gridIndex===Se);if(U<0)return;const Z=K[U];H(U),j(Z.items),Y(Te),z(Z.entry),Q(h??null),L(!0)},ve=s.useCallback(()=>{L(!1),Q(null)},[]),$e=s.useCallback(()=>{const Se=K[R];return!Se||!O.current?D:hv(O.current,Se.gridIndex,v?"cover":"contain")??D},[K,R,D,v]),ke=s.useCallback(Se=>{if(K.length>1){const Te=K.length,h=(R+Se+Te)%Te,U=K[h],Z=Math.min(x,U.items.length-1);H(h),j(U.items),Y(Z),z(U.entry);return}Y(Te=>(Te+Se+C.length)%C.length)},[K,R,x,C.length]),he=K.length>1||C.length>1;return s.useEffect(()=>{if(!F||typeof document>"u")return;const Se=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Se}},[F]),s.useEffect(()=>{!n||o||i||L(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:le}}),a.jsx(wv,{mediaList:se}),a.jsx("div",{ref:O,className:`${c}-wrapper ${c}-align-entries ${c}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${q}, ${E})`,rowGap:0,columnGap:P,width:N.scalingValue(d.wrapperWidth??0,n),[`--${c}-align-entries-row-gap`]:N.scalingValue(u??0,n)},children:te.map((Se,Te)=>{const h=Ml(Se.gallery),U=Al(h),Z=U.filter(ie=>ie.lightboxMedia).map(ie=>ie.lightboxMedia),ne=Math.floor(Te/q)===Math.ceil(te.length/q)-1,me=Pe&&Te>=xe?`${ue+(Te-xe)}`:void 0,B=U[0],I=B!=null&&B.lightboxMedia?Z.findIndex(ie=>ie.url===B.lightboxMedia.url):-1,ee=a.jsx("div",{className:`${c}-item-image-wrapper`,style:$,children:U.length>0&&a.jsx(Iv,{media:B.displayMedia,gridIndex:Te,className:`${c}-item-${zo(B.displayMedia)?"video":"image"}`.trim(),style:T,onMediaClick:_&&I>=0?ie=>de(Te,I,Xu(ie.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:E,...me?{gridColumn:me}:{}},children:[a.jsx("div",{className:`${c}-item-title-row`,children:a.jsx("div",{style:{height:0,width:X}})}),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:X}})})]})},Te)})}),F&&typeof document<"u"&&(()=>{const Se=(l?document.getElementById(l):null)??document.body;return Gn.createPortal(a.jsx("div",{style:re,"data-selection":"none",children:a.jsx(kv,{prefix:c,items:C,index:x,entry:ae,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:he,lightboxEntries:K,entryIdx:R,layoutId:r,sourceRect:D,resolveCloseSourceRect:$e,onClose:ve,onPrev:()=>ke(-1),onNext:()=>ke(1)})}),Se)})()]})}const Mv=`import { CommonComponentProps } from '../props';
|
|
7602
|
+
`}const Lc={url:"",name:"",objectFit:"cover"},_n=500,Xo=650,Sn="cubic-bezier(0.22, 1, 0.36, 1)",cv=72,dv=50,uv=1e4,pv=650,mv=500;function gv(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 Xu(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 hv(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Xu(i,n):null}function fv(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 tr(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 Pc(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return tr(e,i,n)}const yv=.03;function qu(e){return e.width*yv}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 Ic(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function vv(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 xv(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Bs(e,t.width,t.height)}function bv(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 Sv(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 wv({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=qu(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 $v(e,t,n){const{left:i,width:o}=n,r=qu(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 Uu(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 Cv(e,t,n,i){const{start:o,end:r}=Uu(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function Tv(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 Ku(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(Ku(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??Lc,i??o??Lc]}]}function Lv(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Pv(e){const[t]=e.media;return t!=null&&t.url?t:null}function Al(e){if(!Array.isArray(e)||e.length===0)return[];if(Ku(e)){const t=[];for(const n of e){const i=Lv(n);if(!i)continue;const o=Pv(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 Iv({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 Rv({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 kv({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:b,onNext:S}){const A=s.useRef(null),f=s.useRef(null),w=s.useRef(null),G=s.useRef(new Map),[q,E]=s.useState(0),P=s.useRef(null),M=s.useRef(0),X=s.useRef(0),$=s.useRef("none"),T=s.useRef(!1),O=s.useRef(!1),N=s.useRef(!1),L=s.useRef(null),C=s.useRef(null),j=s.useRef(null),x=s.useRef(()=>{}),Y=s.useRef(null),R=s.useRef(null),H=s.useRef(null),D=s.useRef(!1),[Q,ae]=s.useState(null),[z,re]=s.useState(ns),[F,le]=s.useState(0),[te,fe]=s.useState("opening"),[Pe,xe]=s.useState(0),[de,K]=s.useState(0),[se,ue]=s.useState(!1),[ve,$e]=s.useState(null),[ke,he]=s.useState(null),[Se,Ce]=s.useState(null),[h,U]=s.useState(!1),[Z,ne]=s.useState(null),[me,B]=s.useState(!1),I=s.useRef(!1),[ee,ie]=s.useState(!1),[pe,V]=s.useState(!1),Ie=s.useRef(n),be=s.useRef(void 0),J=t[n],He=J?zo(J):!1,We=de!==0||se,it=!l&&(!r||!!c),qe=d&&!l,tt=u.length>1,et=s.useCallback((W,Le)=>t.length<=1?null:t[(W+Le+t.length)%t.length]??null,[t]),je=tt?tr(u,p,-1):et(n,-1),ye=tt?tr(u,p,1):et(n,1),_e=ve===-1&&We?tt&&ke!==null?tr(u,ke,-1):Se!==null?et(Se,-1):null:null,Be=ve===1&&We?tt&&ke!==null?tr(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!==(ye==null?void 0:ye.url)?Be:null,Fe=je&&qe?(()=>{const W=tt?Pc(u,p,-1):t.length>2?et((n-1+t.length)%t.length,-1):null;return W&&W.url!==je.url?W:null})():null,Ke=ye&&qe?(()=>{const W=tt?Pc(u,p,1):t.length>2?et((n+1)%t.length,1):null;return W&&W.url!==ye.url?W:null})():null,Je=Ze??Fe,st=we??Ke,ot=s.useCallback((W,Le,Ve)=>{if(!W||!Le||!Ve)return;const Ne=G.current,ft=Ne.get(W);(ft==null?void 0:ft.width)===Le&&(ft==null?void 0:ft.height)===Ve||(Ne.set(W,{width:Le,height:Ve}),E(Nt=>Nt+1))},[]),Oe=s.useCallback(W=>{if(!(W!=null&&W.url))return null;const Le=G.current.get(W.url);return xv(f.current,Le)},[q,F]),Ae=s.useCallback(()=>{if(!J)return;const W=Oe(J);if(W){ae(W);return}const Le=f.current;Le&&ae(Ic(Le))},[J,Oe]),gt=s.useCallback(W=>{if(tt){const Le=u.length;he((p+W+Le)%Le),Ce(null);return}t.length>1&&(Ce((n+W+t.length)%t.length),he(null))},[tt,u.length,p,t.length,n]),ze=s.useCallback(W=>{N.current=W,ue(W)},[]),De=s.useCallback(()=>{L.current!==null&&(window.clearTimeout(L.current),L.current=null)},[]),Xe=s.useCallback(()=>{De(),L.current=window.setTimeout(()=>{De(),ze(!1)},Xo+32)},[De,ze]),dt=s.useCallback(()=>{const W=A.current;if(!W){re({left:0,top:0,width:typeof window<"u"?window.innerWidth:ns.width,height:typeof window<"u"?window.innerHeight:ns.height});return}const Le=W.getBoundingClientRect();re({left:Le.left,top:Le.top,width:Le.width,height:Le.height})},[]),ge=s.useCallback((W,Le)=>{if(We){if(ee&&!se)return`translate(${de}px, 0px)`;if(se&&ve!==null){const Ve=Oe(W);if(!Ve)return;const{x:Ne,y:ft}=Cv(Ve,Le,ve,z);return`translate(${Ne}px, ${ft}px)`}if(se)return"translate(0px, 0px)"}},[We,ee,se,de,ve,z,Oe]),Re=s.useCallback(()=>{const W=C.current;C.current=null,De(),ze(!1),$e(null),he(null),Ce(null),K(0),ie(!1),T.current=!1,X.current=0,$.current="none",W===-1?b():W===1&&S()},[De,ze,b,S]),nt=s.useCallback(()=>{De(),L.current=window.setTimeout(()=>{C.current!==null&&Re()},Xo+32)},[De,Re]),ut=s.useCallback(()=>{De(),C.current=null,ze(!1),$e(null),he(null),Ce(null),K(0),ie(!1),T.current=!1,X.current=0,$.current="none"},[De,ze]),Ge=s.useCallback(W=>{if(!(!qe||!Q)){if(N.current){if(C.current===W){j.current=W,Re();return}ut()}De(),gt(W),C.current=W,$e(W),ze(!0),nt()}},[qe,Q,Re,ut,De,gt,ze,nt]);x.current=Ge;const bt=s.useCallback(()=>{Y.current=null,D.current=!1,R.current!==null&&(window.clearInterval(R.current),R.current=null),H.current!==null&&(window.clearTimeout(H.current),H.current=null)},[]),It=s.useCallback(W=>{R.current!==null&&window.clearInterval(R.current);const Le=D.current?mv:pv;R.current=window.setInterval(()=>{x.current(W)},Le)},[]),Mt=s.useCallback(W=>{Y.current!==W&&(bt(),Y.current=W,D.current=!1,x.current(W),It(W),H.current=window.setTimeout(()=>{H.current=null,Y.current===W&&(D.current=!0,It(W))},uv))},[bt,It]),wt=s.useCallback(()=>{const W=f.current;if(!W)return;const Le=J==null?void 0:J.url,Ve=Le?G.current.get(Le):void 0;if(Ve!=null&&Ve.width&&(Ve!=null&&Ve.height)){ae(Bs(W,Ve.width,Ve.height));return}const Ne=w.current;if(Ne&&Le&&(Ne.src===Le||Ne.currentSrc===Le)){const{width:Nt,height:mt}=vv(Ne);if(Nt&&mt){ot(Le,Nt,mt),ae(Bs(W,Nt,mt));return}}const ft=Ic(W);!ft.width||!ft.height||ae(ft)},[J==null?void 0:J.url,ot]),Vt=s.useCallback(W=>{if(w.current=W,!!W){if(W instanceof HTMLVideoElement){W.readyState>=1&&W.videoWidth>0&&wt();return}W.complete&&W.naturalWidth>0&&wt()}},[wt]),jt=s.useCallback(()=>{dt(),wt(),le(W=>W+1)},[dt,wt]);s.useEffect(()=>{jt();const W=f.current,Le=A.current,Ve=new ResizeObserver(()=>jt());return W&&Ve.observe(W),Le&&Ve.observe(Le),window.addEventListener("resize",jt),()=>{Ve.disconnect(),window.removeEventListener("resize",jt)}},[jt,n,y]),s.useLayoutEffect(()=>{if(!J)return;const W=w.current;if(W){if(W instanceof HTMLImageElement&&W.complete&&W.naturalWidth>0){wt();return}W instanceof HTMLVideoElement&&W.readyState>=1&&W.videoWidth>0&&wt()}},[J==null?void 0:J.url,n,wt]),s.useEffect(()=>{Ae()},[Ae,q]),s.useEffect(()=>{const W=new Set,Le=[],Ve=Ne=>{!(Ne!=null&&Ne.url)||W.has(Ne.url)||(W.add(Ne.url),Le.push(Ne))};t.forEach(Ve),u.forEach(Ne=>Ne.items.forEach(Ve)),Le.forEach(Ne=>{G.current.has(Ne.url)||bv(Ne,ot)})},[t,u,ot]),s.useEffect(()=>{if(te!=="opening"||!Q)return;if(!v){fe("open");return}U(!1);const W=requestAnimationFrame(()=>{requestAnimationFrame(()=>{U(!0),fe("open")})});return()=>cancelAnimationFrame(W)},[te,Q,v]),s.useEffect(()=>{if(te!=="closing")return;const W=setTimeout(()=>g(),_n);return()=>clearTimeout(W)},[te,g]),s.useEffect(()=>()=>{De()},[De]),s.useLayoutEffect(()=>{Ie.current===n&&be.current===(J==null?void 0:J.url)||(De(),C.current=null,$e(null),he(null),Ce(null),xe(0),K(0),ze(!1),V(!1),ie(!1),M.current=0,X.current=0,$.current="none",T.current=!1,P.current=null,O.current=!1,w.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 W=j.current;W!==null&&(j.current=null,requestAnimationFrame(()=>{x.current(W)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(te==="opening"){I.current=!1,B(!1);return}if(te!=="open"||I.current)return;if(!je&&!ye){I.current=!0;return}B(!1);const W=requestAnimationFrame(()=>{requestAnimationFrame(()=>{B(!0),I.current=!0})});return()=>cancelAnimationFrame(W)},[te,je==null?void 0:je.url,ye==null?void 0:ye.url]),s.useEffect(()=>{if(te!=="open")return;const W=()=>{const mt=$t=>{$t.stopPropagation(),$t.preventDefault(),document.removeEventListener("click",mt,!0)};document.addEventListener("click",mt,!0)},Le=mt=>{const $t=mt<0?1:-1;De(),gt($t),C.current=$t,$e($t),ze(!0),nt()},Ve=mt=>{if(Math.abs(mt)>dv&&qe){Le(mt);return}C.current=null,$e(null),he(null),Ce(null),ze(!0),K(0),Xe()},Ne=mt=>{if(mt.touches.length!==1||N.current)return;const $t=mt.touches[0];O.current=!0,P.current={x:$t.clientX,y:$t.clientY},$.current="none",X.current=0,T.current=!1},ft=mt=>{if(!P.current||mt.touches.length!==1||N.current)return;const $t=mt.touches[0],Yt=$t.clientX-P.current.x,Dt=$t.clientY-P.current.y;if($.current==="none"){if(Math.abs(Yt)<10&&Math.abs(Dt)<10)return;if(Math.abs(Yt)>Math.abs(Dt)){if(!qe)return;$.current="horizontal"}else if(Dt>0){if(!it)return;$.current="vertical"}else return}if($.current==="horizontal"){T.current=!0,ie(!0),X.current=Yt,K(Yt),mt.preventDefault();return}$.current==="vertical"&&(T.current=!0,ie(!0),M.current=Dt,xe(Dt),mt.preventDefault())},Nt=()=>{if(!P.current)return;const mt=$.current,$t=T.current;if($t&&mt==="horizontal")Ve(X.current),W();else if($t&&mt==="vertical"){const Yt=M.current;if(it&&Yt>cv){const Dt=window.innerHeight;M.current=Dt,V(!0),xe(Dt),fe("closing")}else M.current=0,xe(0);W()}else mt==="horizontal"&&Math.abs(X.current)>0&&(Ve(X.current),W());P.current=null,$.current="none",X.current=0,T.current=!1,ie(!1)};return document.addEventListener("touchstart",Ne,{passive:!0}),document.addEventListener("touchmove",ft,{passive:!1}),document.addEventListener("touchend",Nt),document.addEventListener("touchcancel",Nt),()=>{document.removeEventListener("touchstart",Ne),document.removeEventListener("touchmove",ft),document.removeEventListener("touchend",Nt),document.removeEventListener("touchcancel",Nt)}},[te,qe,ze,Xe,De,it,nt,gt]);const qt=s.useCallback(()=>{const W=(m==null?void 0:m())??v??null;W&&Q&&(ne(W),U(!0)),fe("closing")},[m,v,Q]);s.useEffect(()=>{const W=Ne=>{if(Ne.key==="Escape"){if(r&&c||te==="closing")return;bt(),qt();return}if(Ne.key!=="ArrowLeft"&&Ne.key!=="ArrowRight"||te!=="open"||!qe)return;Ne.preventDefault();const ft=Ne.key==="ArrowLeft"?-1:1;Ne.repeat&&Y.current===ft||Mt(ft)},Le=Ne=>{if(Ne.key!=="ArrowLeft"&&Ne.key!=="ArrowRight")return;const ft=Ne.key==="ArrowLeft"?-1:1;Y.current===ft&&bt()},Ve=()=>{bt()};return window.addEventListener("keydown",W),window.addEventListener("keyup",Le),window.addEventListener("blur",Ve),()=>{window.removeEventListener("keydown",W),window.removeEventListener("keyup",Le),window.removeEventListener("blur",Ve),bt()}},[te,r,c,qt,qe,Mt,bt]),s.useEffect(()=>{te!=="open"&&bt()},[te,bt]);const Ut=()=>{te==="closing"||l||qt()},Rt=te==="open",Bt=te==="closing",rn=Pe>0?Math.max(0,1-Pe/500):1,vt=Pe>0?Math.max(.35,1-Pe/500):1,yt=s.useCallback(W=>{if(!(W.propertyName!=="transform"||!N.current)){if(C.current!==null){Re();return}De(),ze(!1)}},[De,ze,Re]),Ee=te==="closing"?Z??v:v,Qe=Ee&&Q&&(te==="opening"||Bt)?gv(Ee,Q):void 0,rt=We&&J?ge(J,"center"):Pe>0?`translateY(${Pe}px)`:Qe,lt=Q?Wr(Q,z):null,Lt=!!(Ee&&Q),St=Lt&&(te==="closing"||te==="open"&&h),ht={position:"absolute",top:lt==null?void 0:lt.top,left:lt==null?void 0:lt.left,width:lt==null?void 0:lt.width,height:lt==null?void 0:lt.height,objectFit:"contain",transformOrigin:"top left",transform:rt,opacity:Pe>0?vt:Lt?1:te==="opening"||Bt?0:1,transition:ee&&!se?"none":se?`transform ${Xo}ms ${Sn}`:pe?`transform ${_n}ms ${Sn}, opacity ${_n}ms ${Sn}`:St?`transform ${_n}ms ${Sn}`:te==="opening"||Bt?`opacity ${_n}ms ${Sn}`:"none",pointerEvents:He&&Rt&&!We?"auto":"none",touchAction:He&&Rt?"none":void 0,zIndex:1,overflow:He?"hidden":void 0},Pt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Rt&&!We?"auto":"none"},Ot=(W,Le,Ve="adjacent")=>{const Ne=Oe(W);if(!Ne)return{display:"none"};const ft=Ve==="far"?Le==="left"?"far-left":"far-right":Le==="left"?"left-adjacent":"right-adjacent",{start:Nt}=ve!==null?Uu(Ne,ft,ve,z):{start:Ve==="far"?ya(Ne,Le,z):Io(Ne,Le,z)},mt=Wr(Nt,z),$t=ge(W,ft),Yt=!We&&Ve==="adjacent"&&Rt&&!me?Tv(Ne,Le,z):null,Dt=Ve==="far"&&We&&ve===(Le==="left"?-1:1),sn=ee&&!se?!1:se,ln=Ve==="adjacent"&&Rt&&me&&!We;return{position:"absolute",top:mt.top,left:mt.left,width:mt.width,height:mt.height,objectFit:"contain",transform:$t??(Yt?`translate(${Yt.x}px, ${Yt.y}px)`:void 0),opacity:Ve==="far"?Rt&&Dt?1:0:Rt?1:0,transition:sn?Ve==="far"?`transform ${Xo}ms ${Sn}`:`transform ${Xo}ms ${Sn}, opacity ${_n}ms ${Sn}`:ln?`transform ${_n}ms ${Sn}`:te==="opening"||Bt?`opacity ${_n}ms ${Sn}`:"none",pointerEvents:"none",zIndex:1}},At=(W,Le)=>{const Ve=Oe(W);return Ve?$v(Io(Ve,Le,z),Le,z):null},Gt=W=>Le=>{if(!l){if(O.current){O.current=!1;return}Le.stopPropagation(),Ge(W)}},Et=je?At(je,"left"):null,zt=ye?At(ye,"right"):null,Ft=Et?Wr(Et,z):null,pt=zt?Wr(zt,z):null;return a.jsxs("div",{ref:A,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:te==="open"?"none":void 0},onClick:Ut,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Rt?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:Rt?1:0,transition:ee?"none":`opacity ${_n}ms ${Sn}`,pointerEvents:"none"},children:a.jsx(Gu,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,onClose:Ut})})]}),Rt&&Je&&a.jsx(Or,{media:Je,style:Ot(Je,"left","far"),onMeasure:ot,onTransitionEnd:yt},`far-prev-${Je.url}`),Rt&&je&&a.jsxs(a.Fragment,{children:[a.jsx(Or,{media:je,style:Ot(je,"left"),onMeasure:ot,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||ee?"default":"pointer",pointerEvents:l||ee?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Rt&&ye&&a.jsxs(a.Fragment,{children:[a.jsx(Or,{media:ye,style:Ot(ye,"right"),onMeasure:ot,onTransitionEnd:yt},`next-${ye.url}`),pt&&a.jsx("div",{style:{position:"absolute",top:pt.top,left:pt.left,width:pt.width,height:pt.height,cursor:l||ee?"default":"pointer",pointerEvents:l||ee?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Rt&&st&&a.jsx(Or,{media:st,style:Ot(st,"right","far"),onMeasure:ot,onTransitionEnd:yt},`far-next-${st.url}`),Q&&J&&(He?a.jsx(Rv,{src:J.url,phase:te,onMediaElement:Vt,wrapperStyle:ht,videoStyle:Pt,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 Ev({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:c}=_.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,[b,S]=m.split(":").map(Number),w=`${g?S:b} / ${g?b:S}`,G=d.entryWidth??.2,q=d.columnsCount,E=_.scalingValue(G,n),P=_.scalingValue(d.horizontalGap??0,n),M=E,X=E,$={width:M,...v?{aspectRatio:w,height:"auto",overflow:"hidden"}:{height:"auto"}},T=v?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},O=s.useRef(null),[N,L]=s.useState(!1),[C,j]=s.useState([]),[x,Y]=s.useState(0),[R,H]=s.useState(0),[D,Q]=s.useState(null),[ae,z]=s.useState({title1:"",title2:"",title3:""}),re=(()=>{const Se={},Ce=O.current?getComputedStyle(O.current).getPropertyValue("--cntrl-article-width").trim():"";return Ce&&(Se["--cntrl-article-width"]=Ce),Se})(),F=!n||i||o,le=s.useMemo(()=>lv(c),[c]),te=t??[],fe=te.length%q||q,Pe=fe<q&&te.length>0,xe=te.length-fe,de=Pe?Math.floor((q-fe)/2)+1:1,K=s.useMemo(()=>fv(te),[te]),se=s.useMemo(()=>Sv(te),[te]),ue=(Se,Ce,h)=>{if(n&&!o&&!i)return;const U=K.findIndex(ne=>ne.gridIndex===Se);if(U<0)return;const Z=K[U];H(U),j(Z.items),Y(Ce),z(Z.entry),Q(h??null),L(!0)},ve=s.useCallback(()=>{L(!1),Q(null)},[]),$e=s.useCallback(()=>{const Se=K[R];return!Se||!O.current?D:hv(O.current,Se.gridIndex,v?"cover":"contain")??D},[K,R,D,v]),ke=s.useCallback(Se=>{if(K.length>1){const Ce=K.length,h=(R+Se+Ce)%Ce,U=K[h],Z=Math.min(x,U.items.length-1);H(h),j(U.items),Y(Z),z(U.entry);return}Y(Ce=>(Ce+Se+C.length)%C.length)},[K,R,x,C.length]),he=K.length>1||C.length>1;return s.useEffect(()=>{if(!N||typeof document>"u")return;const Se=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Se}},[N]),s.useEffect(()=>{!n||o||i||L(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:le}}),a.jsx(wv,{mediaList:se}),a.jsx("div",{ref:O,className:`${c}-wrapper ${c}-align-entries ${c}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${q}, ${E})`,rowGap:0,columnGap:P,width:_.scalingValue(d.wrapperWidth??0,n),[`--${c}-align-entries-row-gap`]:_.scalingValue(u??0,n)},children:te.map((Se,Ce)=>{const h=Ml(Se.gallery),U=Al(h),Z=U.filter(ie=>ie.lightboxMedia).map(ie=>ie.lightboxMedia),ne=Math.floor(Ce/q)===Math.ceil(te.length/q)-1,me=Pe&&Ce>=xe?`${de+(Ce-xe)}`:void 0,B=U[0],I=B!=null&&B.lightboxMedia?Z.findIndex(ie=>ie.url===B.lightboxMedia.url):-1,ee=a.jsx("div",{className:`${c}-item-image-wrapper`,style:$,children:U.length>0&&a.jsx(Iv,{media:B.displayMedia,gridIndex:Ce,className:`${c}-item-${zo(B.displayMedia)?"video":"image"}`.trim(),style:T,onMediaClick:F&&I>=0?ie=>ue(Ce,I,Xu(ie.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:E,...me?{gridColumn:me}:{}},children:[a.jsx("div",{className:`${c}-item-title-row`,children:a.jsx("div",{style:{height:0,width:X}})}),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:X}})})]})},Ce)})}),N&&typeof document<"u"&&(()=>{const Se=(l?document.getElementById(l):null)??document.body;return Gn.createPortal(a.jsx("div",{style:re,"data-selection":"none",children:a.jsx(kv,{prefix:c,items:C,index:x,entry:ae,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:he,lightboxEntries:K,entryIdx:R,layoutId:r,sourceRect:D,resolveCloseSourceRect:$e,onClose:ve,onPrev:()=>ke(-1),onNext:()=>ke(1)})}),Se)})()]})}const Mv=`import { CommonComponentProps } from '../props';
|
|
7603
7603
|
import { scalingValue, useScopedStyles } from '../utils/index';
|
|
7604
7604
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
7605
7605
|
import { createPortal } from 'react-dom';
|
|
@@ -9942,7 +9942,7 @@ export function Hive({
|
|
|
9942
9942
|
</>
|
|
9943
9943
|
);
|
|
9944
9944
|
}
|
|
9945
|
-
`,Av="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>'),_i={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 Fv(e){const t={};return t[xt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[xt(e,"fontSettings")]={..._i.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[xt(e,"fontSize")]={..._i.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[xt(e,"lineHeight")]={..._i.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[xt(e,"letterSpacing")]={..._i.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[xt(e,"wordSpacing")]={..._i.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[xt(e,"textAlign")]={..._i.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[xt(e,"textAppearance")]={..._i.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Ro=Ti.filter(e=>e!=="count"),Nv=Ro.reduce((e,t)=>({...e,...Fv(t)}),{}),_v=Ro.reduce((e,t)=>({...e,[xt(t,"fontFamily")]:"Arial",[xt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[xt(t,"letterSpacing")]:0,[xt(t,"wordSpacing")]:0,[xt(t,"textAlign")]:"left",[xt(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[xt(n,"fontSize")]=i),o!==void 0&&(t[xt(n,"lineHeight")]=o),t},{})}const Hv={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Ro.map(e=>[kl[e],El(e)]))},Wv={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},Ov=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...Wv,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),Dv={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:Ov},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"}},...Nv},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:Av,closeIconColor:"#000000",closeIconHoverColor:"#999999",..._v},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:[Hv]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},zv={element:Ev,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:`${xt(e,"fontFamily")}`}))]},fontRelations:{...Ro.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${xt(t,"fontFamily")}`}),{})},schema:Dv,sourceCode:Mv};function Bv(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 jv({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 Vv(e){return String(e??"").trim().length>0}function Rc(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 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,n,i,o,r,l){const c=N.scalingValue(r,l),d=N.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?c:d,borderBottomWidth:!p||i?c:d}}function Gv(e,t,n){const i=N.scalingValue(t,n),o=N.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Mc=10,Ac=10,qo={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function Xv(e,t,n){return Math.max(t,Math.min(n,e))}function rs(e,t,n){return e+(t-e)*n}function qv(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+Mc,y:n.clientY+Mc};switch(e){case"left":return{x:o.left+Ac+i/2,y:r};case"center":return{x:o.left+o.width/2,y:r};case"right":return{x:o.right-Ac-i/2,y:r};default:return{x:o.left+o.width/2,y:r}}}function Uv(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,qo.positionEase),m.y=rs(m.y,m.targetY,qo.positionEase),m.rotation=rs(m.rotation,m.targetRotation,qo.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,b=Math.abs(m.rotation-m.targetRotation)<.08;!g||!b?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 b=i.current;b.targetX=m,b.targetY=g,b.targetRotation=0,b.x=m,b.y=g,b.rotation=0,b.lastX=m,b.hasLastX=!0,r(),t&&d()},[r,t,d]),p=s.useCallback((m,g)=>{if(!e)return;const b=i.current;if(t&&b.hasLastX){const S=m-b.lastX;b.targetRotation=Xv(S*qo.rotationFactor,-20,qo.maxRotation)}else b.targetRotation=0;if(b.lastX=m,b.hasLastX=!0,b.targetX=m,b.targetY=g,t){d();return}b.x=m,b.y=g,b.rotation=b.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 Kv(e){return`
|
|
9945
|
+
`,Av="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>'),_i={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 Fv(e){const t={};return t[xt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[xt(e,"fontSettings")]={..._i.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[xt(e,"fontSize")]={..._i.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[xt(e,"lineHeight")]={..._i.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[xt(e,"letterSpacing")]={..._i.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[xt(e,"wordSpacing")]={..._i.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[xt(e,"textAlign")]={..._i.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[xt(e,"textAppearance")]={..._i.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Ro=Ti.filter(e=>e!=="count"),Nv=Ro.reduce((e,t)=>({...e,...Fv(t)}),{}),_v=Ro.reduce((e,t)=>({...e,[xt(t,"fontFamily")]:"Arial",[xt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[xt(t,"letterSpacing")]:0,[xt(t,"wordSpacing")]:0,[xt(t,"textAlign")]:"left",[xt(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[xt(n,"fontSize")]=i),o!==void 0&&(t[xt(n,"lineHeight")]=o),t},{})}const Hv={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Ro.map(e=>[kl[e],El(e)]))},Wv={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},Ov=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...Wv,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),Dv={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:Ov},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"}},...Nv},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:Av,closeIconColor:"#000000",closeIconHoverColor:"#999999",..._v},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:[Hv]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},zv={element:Ev,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:`${xt(e,"fontFamily")}`}))]},fontRelations:{...Ro.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${xt(t,"fontFamily")}`}),{})},schema:Dv,sourceCode:Mv};function Bv(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 jv({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 Vv(e){return String(e??"").trim().length>0}function Rc(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 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,n,i,o,r,l){const c=_.scalingValue(r,l),d=_.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?c:d,borderBottomWidth:!p||i?c:d}}function Gv(e,t,n){const i=_.scalingValue(t,n),o=_.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Mc=10,Ac=10,qo={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function Xv(e,t,n){return Math.max(t,Math.min(n,e))}function rs(e,t,n){return e+(t-e)*n}function qv(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+Mc,y:n.clientY+Mc};switch(e){case"left":return{x:o.left+Ac+i/2,y:r};case"center":return{x:o.left+o.width/2,y:r};case"right":return{x:o.right-Ac-i/2,y:r};default:return{x:o.left+o.width/2,y:r}}}function Uv(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,qo.positionEase),m.y=rs(m.y,m.targetY,qo.positionEase),m.rotation=rs(m.rotation,m.targetRotation,qo.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,b=Math.abs(m.rotation-m.targetRotation)<.08;!g||!b?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 b=i.current;b.targetX=m,b.targetY=g,b.targetRotation=0,b.x=m,b.y=g,b.rotation=0,b.lastX=m,b.hasLastX=!0,r(),t&&d()},[r,t,d]),p=s.useCallback((m,g)=>{if(!e)return;const b=i.current;if(t&&b.hasLastX){const S=m-b.lastX;b.targetRotation=Xv(S*qo.rotationFactor,-20,qo.maxRotation)}else b.targetRotation=0;if(b.lastX=m,b.hasLastX=!0,b.targetX=m,b.targetY=g,t){d();return}b.x=m,b.y=g,b.rotation=b.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 Kv(e){return`
|
|
9946
9946
|
.${e}-wrapper {
|
|
9947
9947
|
display: grid;
|
|
9948
9948
|
align-items: start;
|
|
@@ -10318,7 +10318,7 @@ a.${e}-list-item {
|
|
|
10318
10318
|
overflow-wrap: anywhere;
|
|
10319
10319
|
word-break: break-word;
|
|
10320
10320
|
}
|
|
10321
|
-
`}const Li=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Fl=["AColumn","BColumn","CColumn","DColumn","EColumn"],ri="cutLabel",fr=[...Fl,ri],Ha=["A","B","C","D","E"];function Yu(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 Yv(e){const t=Nl(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Zv(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 Zu(e,t,n){const i=Zv(e);return i?i===t?!1:Yv(n[Yu(i)]):!0}function yr(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 Jv(e,t,n){if(Ju(e,t,n))return yr(e);const i=yr(e);return i.kind==="baseline"?{kind:"top"}:i}function Qv(e){const t=yr(e);return t.kind==="baseline"?{kind:"top"}:t}function Ju(e,t,n){return Zu(e,n,t)?yr(e).kind==="baseline":!1}function e0(e){const t={};let n=!1;for(const i of Ha){const o=Yu(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}Zu(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function t0(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function n0(e){const t=yr(e).kind;return t==="baseline"?"center":t}function i0(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Fc(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function o0(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=o0(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 r0(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 a0(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const s0={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Xt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const l0={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function c0(e){return[Xt(e,"textFontFamily"),Xt(e,"textFontSettings"),{type:"row",items:[Xt(e,"textFontSize"),Xt(e,"textLineHeight"),Xt(e,"textLetterSpacing"),Xt(e,"textWordSpacing")]},Xt(e,"textTextAlign"),Xt(e,"textTextAppearance"),`${e}VerticalAlign`]}function d0(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(fr.map(e=>[l0[e],c0(e)]))}}function va(e,t){const n=i=>{const o=Xt(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===ri?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Nc(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 _c(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 Hc(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`]:N.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"],u0={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},p0=["hover","focus","filled","success","error"],Wc=.004,uo=.004,ss=uo,_l=50,vr=1440,xr=_l/vr;function Qu(e){const t=typeof e=="number"&&e>0?e:vr;return _l/t}function m0(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 vr}const ep={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function ar(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function g0(e,t=1){const n=t/e;return Object.fromEntries(In.map(i=>[i,n]))}function h0(){return Object.fromEntries([...ko.map(e=>[e,0]),...Eo.map(e=>[e,0])])}function f0(){return Object.fromEntries(Mo.map(e=>[e,0]))}function Dr(e){return Object.fromEntries(In.map(t=>[t,typeof e[t]=="number"?e[t]:ep[t]]))}function tp(e,t,n){const i=e-xr,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 y0(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=tp(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)+xr;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]-xr;if(p<=0)continue;const y=Math.min(d,p);c[u]-=y,d-=y}return[...c,i[e-1]]}function v0(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 Oc(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Li]}function x0(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function b0(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],b=Eo[l],S=Mo[l],A=n[u],f=n[p],w=n[y],G=n[v];typeof A=="number"&&(r[m]=A),typeof f=="number"&&(r[g]=f),typeof w=="number"&&(r[b]=w),typeof G=="number"&&(r[S]=G)}return r}function np(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 S0(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=ar(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...g0(n,o),...h0()};if(r)for(const c of Mo)typeof t[c]=="number"&&(l[c]=t[c]);else Object.assign(l,f0());return np(e,l)?l:e}function w0(e,t,n){const i=e0(e);i&&(e={...e,...i});const o=Qu(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,c=ar(e),d=ar(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:Li.length,y=w=>{if(u)return w;const G=Dr({...t,...w}),q=ar(w),E=la(p,q,G),P=y0(p,E,{...t,...w});return Object.keys(P).length===0?w:{...w,...P}};if(typeof r=="number"&&r!==l)return e;const v=Oc(e),m=Oc(t);if(!x0(v,m))return y({...e,...b0(v,m,t,p)});if(c<d&&typeof p=="number"&&!u){const w=Dr({...t,...e});return y({...e,...v0(p,c,w)})}if(u){const w=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,G=Math.max(0,(c-o)/2);return w>G?{...e,textPaddingLR:G}:e}const g=Dr({...t,...e}),b=la(p,d,Dr(t)),A=la(p,c,g).some((w,G)=>w<(b[G]??w)),f=In.some(w=>{const G=e[w],q=t[w];return typeof G=="number"&&typeof q=="number"&&G!==q});return A||f?y(e):e}function $0(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(xr,i-o-r-xr)}function C0(e,t){return Math.random()*(t-e)+e}function T0(e){return Object.fromEntries(In.map(t=>[t,typeof e[t]=="number"?e[t]:ep[t]]))}function ls(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function L0(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:s0[l],widthKey:In[c],width:n[In[c]],paddingLeftKey:d,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[d],paddingRight:o[u],paddingBottom:r[p]}})}function P0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,portalId:c,onUpdateSettings:d}){const{prefix:u}=N.useScopedStyles(),p=!!o,{columns:y,type:v,wrapperWidth:m,entriesCount:g,cellMinHeight:b,dividerWidth:S,showVisibility:A,cut:f,showCut:w,cutCellMinHeight:G,cutLabel:q,imageSize:E,imageOnHover:P,imagePosition:M="cursor",imageInterpolation:X="on",entryHoverEffect:$,entryHoverShowOption:T,rowPaddingTop:O,rowPaddingBottom:F,rowPaddingTopB:L,columnsOrder:C,textPaddingLR:j,textColor:x,backgroundColor:Y,dividerColor:R,textHoverColor:H,backgroundHoverColor:D,dividerHoverColor:Q}=e,[ae,z]=s.useState(void 0),[re,_]=s.useState(null),le=s.useRef(null),te=P==="on"&&(!n||i),fe=M==="cursor",Pe=fe&&X==="on",{anchorRef:xe,onShow:ue,onCursorMove:K,exit:se}=Uv(!!(te&&re!==null),Pe),de=(f??0)>0,ve=v==="b",$e=s.useRef(null),ke=s.useRef(null),[he,Se]=s.useState(null),[Te,h]=s.useState(vr),U=Qu(Te),Z=Math.max(0,((m??0)-U)/2),ne=Math.min(j??0,Z),me=Math.max(ne,uo),B=((m??0)+U)/2;s.useLayoutEffect(()=>{if(!n){h(vr);return}const Ee=()=>{h(m0($e.current))};Ee();const Qe=$e.current;if(!Qe)return;const rt=new ResizeObserver(Ee);rt.observe(Qe);let lt=Qe;for(;lt&&!lt.style.getPropertyValue("--cntrl-article-width");)lt=lt.parentElement;return lt&&rt.observe(lt),()=>rt.disconnect()},[n,l]),s.useEffect(()=>{z(void 0)},[f,w,t,g]),s.useEffect(()=>{n&&!i&&z(void 0)},[n,i]);const I=N.buildColorVars(u,{textColor:x,backgroundColor:Y,dividerColor:R,textHoverColor:H,backgroundHoverColor:D,dividerHoverColor:Q},u0,p0),ee=r&&r!=="default"?`${u}-state-${r}`:"",pe=`${!n||i?$==="default"?`${u}-entry-hover-default`:$==="blinds"?`${u}-entry-hover-blinds`:$==="reveal"?`${u}-entry-hover-reveal`:"":""} ${ee}`.trim(),V=$==="reveal"&&(!n||i),Ie=(A==null?void 0:A[0])??!1,be=(A==null?void 0:A[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 Ee=J.current;if(!(Ee!==e))return;if(typeof Ee.columns=="number"&&typeof e.columns=="number"&&Ee.columns!==e.columns){J.current=e;return}const rt=w0(e,Ee,{designWidth:Te});J.current=e,np(e,rt)&&d(rt)},[e,d,n,l,Te]);const We=s.useMemo(()=>T0(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),it=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(C)&&C.length>0?C:[...Li],[C]),je=s.useMemo(()=>L0(et,y,We,it,qe,tt),[et,y,We,it,qe,tt]),ye=ar(e),_e=s.useMemo(()=>In.slice(0,y).map(Ee=>We[Ee]),[y,We]),Be=s.useMemo(()=>Hl(y,ye,We),[y,ye,We]),Ze=s.useMemo(()=>la(y,ye,We),[y,ye,We]),we=s.useMemo(()=>je.map((Ee,Qe)=>tp(Ze[Qe]??0,Ee.paddingLeft,Ee.paddingRight)),[je,Ze]),Fe=s.useMemo(()=>{const Ee=g===0?1/0:g;return(t??[]).slice(0,Ee).map((rt,lt)=>({id:lt,cells:Object.fromEntries(Li.map(Lt=>[Lt,rt[Lt]??""])),image:rt.image,link:rt.link}))},[t,g]),Ke=de?ae??f:Fe.length,Je=s.useMemo(()=>de?Fe.slice(0,Ke):Fe,[Fe,de,Ke]),st=de&&Ke<Fe.length,ot=Je.length>1||st,Oe=[Ie?`${u}-divider-top`:"",be||ot?`${u}-divider-bottom`:""].filter(Boolean).join(" "),Ae=!n||i,gt=()=>{if(!Ae)return;const Ee=ae??f;if(!w){z(Fe.length);return}z(Math.min(Ee+w,Fe.length))},ze=Ee=>N.scalingValue(Ee,n??!1),De=ve?L??0:O??0,Xe=F??0,dt=b??0,ge=Math.max(Xe,ss),Re=Ec(0,Je.length,Ie,be,st,S??0,n??!1).borderTopWidth,nt=ve?"rowPaddingTopB":"rowPaddingTop",ut=je[0],Ge=je[je.length-1],bt=we[0],It=we[we.length-1],Mt=ut&&bt?Math.max(bt.paddingLeft,uo):0,wt=Ge&&It?Math.max(It.paddingRight,uo):0,Vt=ye,jt=(Ee,Qe)=>qv(M,$e.current,fe?Ee:null,Qe),qt=(Ee,Qe)=>{if(!te)return;const rt=Ee.image;if(!(rt!=null&&rt.url)){se(()=>_(null));return}const lt=(E==null?void 0:E.min)??80,Lt=(E==null?void 0:E.max)??320,St=(re==null?void 0:re.rowId)===Ee.id,ht=St?re.widthPx:C0(lt,Lt),{x:Pt,y:Ot}=jt(Qe,ht);if(St&&fe){K(Pt,Ot);return}_({rowId:Ee.id,url:rt.url,objectFit:"contain",isVideo:Bv(rt),widthPx:ht}),le.current={x:Pt,y:Ot}},Ut=Ee=>{if(!te||!re||!fe)return;const{x:Qe,y:rt}=jt(Ee,re.widthPx);K(Qe,rt)},Rt=()=>{re&&se(()=>_(null))},Bt=Ee=>{V&&Rc(Ee,u),!(!te||!re)&&se(()=>_(null))},rn=Ee=>{V&&kc(Ee,u)};s.useLayoutEffect(()=>{if(!re||!le.current)return;const{x:Ee,y:Qe}=le.current;le.current=null,ue(Ee,Qe)},[re==null?void 0:re.rowId,re==null?void 0:re.url,ue]),s.useLayoutEffect(()=>{if(!p||ve){Se(null);return}const Ee=ke.current,Qe=Ee==null?void 0:Ee.parentElement;if(!Ee||!Qe){Se(null);return}const rt=()=>{const Lt=Ee.querySelector("[data-list-row]");if(!Lt){Se(null);return}const St=Qe.getBoundingClientRect(),ht=Lt.getBoundingClientRect();Se(ht.top-St.top+ht.height/2)};rt();const lt=new ResizeObserver(rt);return lt.observe(Ee),lt.observe(Qe),()=>lt.disconnect()},[p,ve,Je,De,Xe,dt,t,e,je,Ze,Te,S,Ie,be,st]);const vt=s.useMemo(()=>!ve&&Fl.some(Ee=>{const Qe=Ee.charAt(0),rt=e[`${Ee}VerticalAlign`];return Ju(rt,e,Qe)}),[ve,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var Pt;const Ee=$e.current;if(!Ee)return;const Qe=()=>{Ee.querySelectorAll("[data-list-col]").forEach(Ot=>{Ot.style.transform="";const At=Ot.querySelector(`.${u}-list-col`);At&&(At.style.minHeight="",At.style.height="");const Gt=Ot.querySelector(`.${u}-list-col-title`);Gt&&(Gt.style.transform="")})};if(ve||!vt){Qe();return}const rt=()=>{const Ot=Array.from(Ee.querySelectorAll("[data-list-row]")),At=`${u}-list-col`,Gt=`${u}-baseline-probe`;Ot.forEach(Et=>{Et.querySelectorAll("[data-list-col]").forEach(zt=>{zt.style.transform="";const Ft=zt.querySelector(`.${At}`);Ft&&(Ft.style.minHeight="",Ft.style.height="");const pt=zt.querySelector(`.${u}-list-col-title`);pt&&(pt.style.transform="")})}),Ot.forEach(Et=>{const zt=Array.from(Et.querySelectorAll("[data-list-col]"));r0(Et,zt,At)}),Ee.offsetHeight,Ot.forEach(Et=>{const zt=Array.from(Et.querySelectorAll("[data-list-col]")),Ft=Et.getBoundingClientRect().top,pt=new Map,W=zt.map(Ne=>{const ft=Ne.querySelector(`.${u}-list-col-title`),Nt={el:Ne,titleEl:ft,letter:Ne.getAttribute("data-col-letter")??"",kind:Ne.getAttribute("data-valign")??"top",anchor:Ne.getAttribute("data-valign-anchor")};return pt.set(Nt.letter,Nt),Nt}),Le=new Map,Ve=(Ne,ft)=>{const Nt=Le.get(Ne.letter);if(Nt!==void 0)return Nt;const mt=Ne.anchor?pt.get(Ne.anchor):void 0;if(Ne.kind!=="baseline"||!mt||ft.has(Ne.letter)){const ln=as(Ne,Ft,At,Gt);return Le.set(Ne.letter,ln),ln}ft.add(Ne.letter);const $t=Ve(mt,ft);ft.delete(Ne.letter);const Yt=as(Ne,Ft,At,Gt),Dt=$t-Yt;a0(Ne.titleEl,Dt);const sn=as(Ne,Ft,At,Gt);return Le.set(Ne.letter,sn),sn};W.forEach(Ne=>Ve(Ne,new Set))})};let lt=null;const Lt=()=>{lt===null&&(lt=requestAnimationFrame(()=>{lt=null,rt()}))};rt();const St=new ResizeObserver(()=>Lt());St.observe(Ee);let ht=!1;return typeof document<"u"&&((Pt=document.fonts)!=null&&Pt.ready)&&document.fonts.ready.then(()=>{ht||Lt()}),()=>{ht=!0,lt!==null&&(cancelAnimationFrame(lt),lt=null),St.disconnect(),Qe()}},[vt,ve,e,t,Te,Je,Ze]);const yt=s.useMemo(()=>Kv(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:yt}}),a.jsx("div",{style:I,children:a.jsxs("div",{ref:$e,className:`${u}-wrapper ${pe}${Oe?` ${Oe}`:""}${ve?` ${u}-type-b`:""}`.trim(),style:{width:N.scalingValue(m??0,n)},onMouseMove:te?Ut:void 0,onMouseLeave:te?Rt:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[Je.map((Ee,Qe)=>{var St;const rt=(((St=Ee.link)==null?void 0:St.length)??0)>0,lt=rt&&(!n||i)?"a":"div",Lt=Ec(Qe,Je.length,Ie,be,st,S??0,n??!1);return a.jsxs(lt,{ref:Qe===0?ht=>{ke.current=ht}:void 0,className:`${u}-list-item${rt||T==="always"?` ${u}-list-item-has-link`:""}${st&&Qe===Je.length-1?` ${u}-list-item-before-cut`:""}`,...rt?{href:Ee.link,target:"_blank"}:{},style:Lt,onMouseEnter:ht=>{V&&(rt||T==="always")&&Rc(ht,u),te&&qt(Ee,ht)},onMouseLeave:ht=>{V&&(rt||T==="always")&&kc(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(dt)},children:[je.map((ht,Pt)=>{const Ot=Pt===je.length-1,At=we[Pt],Gt=ht.paddingBottom,Et=Vv(Ee.cells[ht.key]),zt=ve&&Et&&Gt>0,Ft=ve?{minHeight:ze(dt)}:{width:ze(Ze[Pt])},pt=ve?{paddingLeft:ze(ne),paddingRight:ze(ne)}:{paddingLeft:ze(At.paddingLeft),paddingRight:ze(At.paddingRight)},W=ht.textPrefix.charAt(0),Le=ve?Qv(e[`${ht.textPrefix}VerticalAlign`]):Jv(e[`${ht.textPrefix}VerticalAlign`],e,W),Ve=ve&&Et&&p&&Qe===0;return ve&&!Et?null:a.jsxs("div",{className:ve?`${u}-list-col-wrap`:void 0,...ve?{}:{"data-list-col":"","data-col-letter":W,"data-valign":Le.kind,...Le.kind==="baseline"?{"data-valign-anchor":Le.anchorLetter}:{}},children:[a.jsx("div",{className:`${u}-list-col${Ot?` ${u}-list-col-last`:""}`,style:{...pt,...Ft,...ve?{justifyContent:Fc(Le.kind)}:{}},"data-test":ht.width,children:a.jsx("span",{className:_c(e,ht.textPrefix,`${u}-list-col-title`,`${u}-text-tight-leading`),style:{...Nc(va(e,ht.textPrefix),n),...Hc(e,ht.textPrefix,u,n),...ve?{}:t0(Le.kind)},children:Ee.cells[ht.key]??null})}),zt&&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(B),"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(B),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${u}-control-anchor`,style:{top:0,left:ze(Math.max(me,ye-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)}})]},Ee.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:Re,left:0,width:"100%",height:ze(Math.max(De,ss))}})},"row-padding-handles"),p&&!ve&&ut&&Ge&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":ut.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ze[0]-((bt==null?void 0:bt.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(Mt),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]-((It==null?void 0:It.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((Ee,Qe)=>{const rt=je[Qe+1],lt=Be.slice(0,Qe+1).reduce((Ot,At)=>Ot+At,0),Lt=we[Qe],St=we[Qe+1],ht=Math.max(Lt.paddingRight,uo),Pt=Math.max(St.paddingLeft,uo);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Ee.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ze[Qe]-Lt.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(lt-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(lt),width:ze(Pt),height:"100%"}})]},`${Ee.paddingRightKey}-padding`)}),p&&!ve&&je.slice(0,-1).map((Ee,Qe)=>{const rt=$0(Qe,Be,_e,ye),Lt=Be.slice(0,Qe+1).reduce((St,ht)=>St+ht,0)-Wc/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Ee.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(Lt),width:ze(Wc),height:"calc(100%)",pointerEvents:"auto"}})},`${Ee.widthKey}-junction`)})]}),st&&(()=>{const Ee=va(e,ri),Qe=n0(e.cutLabelVerticalAlign),rt=Ee.textTextAlign==="justify"||ve;return a.jsx("button",{type:"button",className:`${u}-cut-item`,style:{minHeight:ze(G??0),cursor:Ae?"pointer":"default",...Gv(be,S??0,n??!1)},onClick:Ae?gt:void 0,onMouseEnter:V||te?Bt:void 0,onMouseLeave:V?rn:void 0,children:a.jsx("div",{className:`${u}-list-cols-row`,style:{...ve?{paddingLeft:ze(ne),paddingRight:ze(ne)}:{},justifyContent:i0(Ee.textTextAlign),alignItems:Fc(Qe)},children:a.jsx("span",{className:_c(e,ri,`${u}-cut-label`,`${u}-text-tight-leading`),style:{...Nc(Ee,n),...Hc(e,ri,u,n),...rt?{width:"100%"}:{}},children:q})})})})(),te&&re&&typeof document<"u"&&(()=>{const Ee=`${re.widthPx}px`,Qe={width:Ee,height:"auto",maxHeight:Ee,objectFit:"contain"},rt=(c?document.getElementById(c):null)??document.body;return Gn.createPortal(a.jsx("div",{ref:xe,className:`${u}-hover-media-anchor`,"data-selection":"none",children:a.jsx(jv,{media:re,className:re.isVideo?`${u}-hover-video`:`${u}-hover-image`,style:Qe},`${re.rowId}-${re.url}`)}),rt)})()]})})]})}const I0=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
10321
|
+
`}const Li=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Fl=["AColumn","BColumn","CColumn","DColumn","EColumn"],ri="cutLabel",fr=[...Fl,ri],Ha=["A","B","C","D","E"];function Yu(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 Yv(e){const t=Nl(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Zv(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 Zu(e,t,n){const i=Zv(e);return i?i===t?!1:Yv(n[Yu(i)]):!0}function yr(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 Jv(e,t,n){if(Ju(e,t,n))return yr(e);const i=yr(e);return i.kind==="baseline"?{kind:"top"}:i}function Qv(e){const t=yr(e);return t.kind==="baseline"?{kind:"top"}:t}function Ju(e,t,n){return Zu(e,n,t)?yr(e).kind==="baseline":!1}function e0(e){const t={};let n=!1;for(const i of Ha){const o=Yu(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}Zu(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function t0(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function n0(e){const t=yr(e).kind;return t==="baseline"?"center":t}function i0(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Fc(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function o0(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=o0(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 r0(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 a0(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const s0={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Xt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const l0={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function c0(e){return[Xt(e,"textFontFamily"),Xt(e,"textFontSettings"),{type:"row",items:[Xt(e,"textFontSize"),Xt(e,"textLineHeight"),Xt(e,"textLetterSpacing"),Xt(e,"textWordSpacing")]},Xt(e,"textTextAlign"),Xt(e,"textTextAppearance"),`${e}VerticalAlign`]}function d0(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(fr.map(e=>[l0[e],c0(e)]))}}function va(e,t){const n=i=>{const o=Xt(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===ri?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Nc(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 _c(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 Hc(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`]:_.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"],u0={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},p0=["hover","focus","filled","success","error"],Wc=.004,uo=.004,ss=uo,_l=50,vr=1440,xr=_l/vr;function Qu(e){const t=typeof e=="number"&&e>0?e:vr;return _l/t}function m0(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 vr}const ep={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function ar(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function g0(e,t=1){const n=t/e;return Object.fromEntries(In.map(i=>[i,n]))}function h0(){return Object.fromEntries([...ko.map(e=>[e,0]),...Eo.map(e=>[e,0])])}function f0(){return Object.fromEntries(Mo.map(e=>[e,0]))}function Dr(e){return Object.fromEntries(In.map(t=>[t,typeof e[t]=="number"?e[t]:ep[t]]))}function tp(e,t,n){const i=e-xr,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 y0(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=tp(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)+xr;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]-xr;if(p<=0)continue;const y=Math.min(d,p);c[u]-=y,d-=y}return[...c,i[e-1]]}function v0(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 Oc(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Li]}function x0(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function b0(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],b=Eo[l],S=Mo[l],A=n[u],f=n[p],w=n[y],G=n[v];typeof A=="number"&&(r[m]=A),typeof f=="number"&&(r[g]=f),typeof w=="number"&&(r[b]=w),typeof G=="number"&&(r[S]=G)}return r}function np(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 S0(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=ar(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...g0(n,o),...h0()};if(r)for(const c of Mo)typeof t[c]=="number"&&(l[c]=t[c]);else Object.assign(l,f0());return np(e,l)?l:e}function w0(e,t,n){const i=e0(e);i&&(e={...e,...i});const o=Qu(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,c=ar(e),d=ar(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:Li.length,y=w=>{if(u)return w;const G=Dr({...t,...w}),q=ar(w),E=la(p,q,G),P=y0(p,E,{...t,...w});return Object.keys(P).length===0?w:{...w,...P}};if(typeof r=="number"&&r!==l)return e;const v=Oc(e),m=Oc(t);if(!x0(v,m))return y({...e,...b0(v,m,t,p)});if(c<d&&typeof p=="number"&&!u){const w=Dr({...t,...e});return y({...e,...v0(p,c,w)})}if(u){const w=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,G=Math.max(0,(c-o)/2);return w>G?{...e,textPaddingLR:G}:e}const g=Dr({...t,...e}),b=la(p,d,Dr(t)),A=la(p,c,g).some((w,G)=>w<(b[G]??w)),f=In.some(w=>{const G=e[w],q=t[w];return typeof G=="number"&&typeof q=="number"&&G!==q});return A||f?y(e):e}function $0(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(xr,i-o-r-xr)}function C0(e,t){return Math.random()*(t-e)+e}function T0(e){return Object.fromEntries(In.map(t=>[t,typeof e[t]=="number"?e[t]:ep[t]]))}function ls(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function L0(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:s0[l],widthKey:In[c],width:n[In[c]],paddingLeftKey:d,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[d],paddingRight:o[u],paddingBottom:r[p]}})}function P0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,portalId:c,onUpdateSettings:d}){const{prefix:u}=_.useScopedStyles(),p=!!o,{columns:y,type:v,wrapperWidth:m,entriesCount:g,cellMinHeight:b,dividerWidth:S,showVisibility:A,cut:f,showCut:w,cutCellMinHeight:G,cutLabel:q,imageSize:E,imageOnHover:P,imagePosition:M="cursor",imageInterpolation:X="on",entryHoverEffect:$,entryHoverShowOption:T,rowPaddingTop:O,rowPaddingBottom:N,rowPaddingTopB:L,columnsOrder:C,textPaddingLR:j,textColor:x,backgroundColor:Y,dividerColor:R,textHoverColor:H,backgroundHoverColor:D,dividerHoverColor:Q}=e,[ae,z]=s.useState(void 0),[re,F]=s.useState(null),le=s.useRef(null),te=P==="on"&&(!n||i),fe=M==="cursor",Pe=fe&&X==="on",{anchorRef:xe,onShow:de,onCursorMove:K,exit:se}=Uv(!!(te&&re!==null),Pe),ue=(f??0)>0,ve=v==="b",$e=s.useRef(null),ke=s.useRef(null),[he,Se]=s.useState(null),[Ce,h]=s.useState(vr),U=Qu(Ce),Z=Math.max(0,((m??0)-U)/2),ne=Math.min(j??0,Z),me=Math.max(ne,uo),B=((m??0)+U)/2;s.useLayoutEffect(()=>{if(!n){h(vr);return}const Ee=()=>{h(m0($e.current))};Ee();const Qe=$e.current;if(!Qe)return;const rt=new ResizeObserver(Ee);rt.observe(Qe);let lt=Qe;for(;lt&&!lt.style.getPropertyValue("--cntrl-article-width");)lt=lt.parentElement;return lt&&rt.observe(lt),()=>rt.disconnect()},[n,l]),s.useEffect(()=>{z(void 0)},[f,w,t,g]),s.useEffect(()=>{n&&!i&&z(void 0)},[n,i]);const I=_.buildColorVars(u,{textColor:x,backgroundColor:Y,dividerColor:R,textHoverColor:H,backgroundHoverColor:D,dividerHoverColor:Q},u0,p0),ee=r&&r!=="default"?`${u}-state-${r}`:"",pe=`${!n||i?$==="default"?`${u}-entry-hover-default`:$==="blinds"?`${u}-entry-hover-blinds`:$==="reveal"?`${u}-entry-hover-reveal`:"":""} ${ee}`.trim(),V=$==="reveal"&&(!n||i),Ie=(A==null?void 0:A[0])??!1,be=(A==null?void 0:A[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 Ee=J.current;if(!(Ee!==e))return;if(typeof Ee.columns=="number"&&typeof e.columns=="number"&&Ee.columns!==e.columns){J.current=e;return}const rt=w0(e,Ee,{designWidth:Ce});J.current=e,np(e,rt)&&d(rt)},[e,d,n,l,Ce]);const We=s.useMemo(()=>T0(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),it=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(C)&&C.length>0?C:[...Li],[C]),je=s.useMemo(()=>L0(et,y,We,it,qe,tt),[et,y,We,it,qe,tt]),ye=ar(e),_e=s.useMemo(()=>In.slice(0,y).map(Ee=>We[Ee]),[y,We]),Be=s.useMemo(()=>Hl(y,ye,We),[y,ye,We]),Ze=s.useMemo(()=>la(y,ye,We),[y,ye,We]),we=s.useMemo(()=>je.map((Ee,Qe)=>tp(Ze[Qe]??0,Ee.paddingLeft,Ee.paddingRight)),[je,Ze]),Fe=s.useMemo(()=>{const Ee=g===0?1/0:g;return(t??[]).slice(0,Ee).map((rt,lt)=>({id:lt,cells:Object.fromEntries(Li.map(Lt=>[Lt,rt[Lt]??""])),image:rt.image,link:rt.link}))},[t,g]),Ke=ue?ae??f:Fe.length,Je=s.useMemo(()=>ue?Fe.slice(0,Ke):Fe,[Fe,ue,Ke]),st=ue&&Ke<Fe.length,ot=Je.length>1||st,Oe=[Ie?`${u}-divider-top`:"",be||ot?`${u}-divider-bottom`:""].filter(Boolean).join(" "),Ae=!n||i,gt=()=>{if(!Ae)return;const Ee=ae??f;if(!w){z(Fe.length);return}z(Math.min(Ee+w,Fe.length))},ze=Ee=>_.scalingValue(Ee,n??!1),De=ve?L??0:O??0,Xe=N??0,dt=b??0,ge=Math.max(Xe,ss),Re=Ec(0,Je.length,Ie,be,st,S??0,n??!1).borderTopWidth,nt=ve?"rowPaddingTopB":"rowPaddingTop",ut=je[0],Ge=je[je.length-1],bt=we[0],It=we[we.length-1],Mt=ut&&bt?Math.max(bt.paddingLeft,uo):0,wt=Ge&&It?Math.max(It.paddingRight,uo):0,Vt=ye,jt=(Ee,Qe)=>qv(M,$e.current,fe?Ee:null,Qe),qt=(Ee,Qe)=>{if(!te)return;const rt=Ee.image;if(!(rt!=null&&rt.url)){se(()=>F(null));return}const lt=(E==null?void 0:E.min)??80,Lt=(E==null?void 0:E.max)??320,St=(re==null?void 0:re.rowId)===Ee.id,ht=St?re.widthPx:C0(lt,Lt),{x:Pt,y:Ot}=jt(Qe,ht);if(St&&fe){K(Pt,Ot);return}F({rowId:Ee.id,url:rt.url,objectFit:"contain",isVideo:Bv(rt),widthPx:ht}),le.current={x:Pt,y:Ot}},Ut=Ee=>{if(!te||!re||!fe)return;const{x:Qe,y:rt}=jt(Ee,re.widthPx);K(Qe,rt)},Rt=()=>{re&&se(()=>F(null))},Bt=Ee=>{V&&Rc(Ee,u),!(!te||!re)&&se(()=>F(null))},rn=Ee=>{V&&kc(Ee,u)};s.useLayoutEffect(()=>{if(!re||!le.current)return;const{x:Ee,y:Qe}=le.current;le.current=null,de(Ee,Qe)},[re==null?void 0:re.rowId,re==null?void 0:re.url,de]),s.useLayoutEffect(()=>{if(!p||ve){Se(null);return}const Ee=ke.current,Qe=Ee==null?void 0:Ee.parentElement;if(!Ee||!Qe){Se(null);return}const rt=()=>{const Lt=Ee.querySelector("[data-list-row]");if(!Lt){Se(null);return}const St=Qe.getBoundingClientRect(),ht=Lt.getBoundingClientRect();Se(ht.top-St.top+ht.height/2)};rt();const lt=new ResizeObserver(rt);return lt.observe(Ee),lt.observe(Qe),()=>lt.disconnect()},[p,ve,Je,De,Xe,dt,t,e,je,Ze,Ce,S,Ie,be,st]);const vt=s.useMemo(()=>!ve&&Fl.some(Ee=>{const Qe=Ee.charAt(0),rt=e[`${Ee}VerticalAlign`];return Ju(rt,e,Qe)}),[ve,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var Pt;const Ee=$e.current;if(!Ee)return;const Qe=()=>{Ee.querySelectorAll("[data-list-col]").forEach(Ot=>{Ot.style.transform="";const At=Ot.querySelector(`.${u}-list-col`);At&&(At.style.minHeight="",At.style.height="");const Gt=Ot.querySelector(`.${u}-list-col-title`);Gt&&(Gt.style.transform="")})};if(ve||!vt){Qe();return}const rt=()=>{const Ot=Array.from(Ee.querySelectorAll("[data-list-row]")),At=`${u}-list-col`,Gt=`${u}-baseline-probe`;Ot.forEach(Et=>{Et.querySelectorAll("[data-list-col]").forEach(zt=>{zt.style.transform="";const Ft=zt.querySelector(`.${At}`);Ft&&(Ft.style.minHeight="",Ft.style.height="");const pt=zt.querySelector(`.${u}-list-col-title`);pt&&(pt.style.transform="")})}),Ot.forEach(Et=>{const zt=Array.from(Et.querySelectorAll("[data-list-col]"));r0(Et,zt,At)}),Ee.offsetHeight,Ot.forEach(Et=>{const zt=Array.from(Et.querySelectorAll("[data-list-col]")),Ft=Et.getBoundingClientRect().top,pt=new Map,W=zt.map(Ne=>{const ft=Ne.querySelector(`.${u}-list-col-title`),Nt={el:Ne,titleEl:ft,letter:Ne.getAttribute("data-col-letter")??"",kind:Ne.getAttribute("data-valign")??"top",anchor:Ne.getAttribute("data-valign-anchor")};return pt.set(Nt.letter,Nt),Nt}),Le=new Map,Ve=(Ne,ft)=>{const Nt=Le.get(Ne.letter);if(Nt!==void 0)return Nt;const mt=Ne.anchor?pt.get(Ne.anchor):void 0;if(Ne.kind!=="baseline"||!mt||ft.has(Ne.letter)){const ln=as(Ne,Ft,At,Gt);return Le.set(Ne.letter,ln),ln}ft.add(Ne.letter);const $t=Ve(mt,ft);ft.delete(Ne.letter);const Yt=as(Ne,Ft,At,Gt),Dt=$t-Yt;a0(Ne.titleEl,Dt);const sn=as(Ne,Ft,At,Gt);return Le.set(Ne.letter,sn),sn};W.forEach(Ne=>Ve(Ne,new Set))})};let lt=null;const Lt=()=>{lt===null&&(lt=requestAnimationFrame(()=>{lt=null,rt()}))};rt();const St=new ResizeObserver(()=>Lt());St.observe(Ee);let ht=!1;return typeof document<"u"&&((Pt=document.fonts)!=null&&Pt.ready)&&document.fonts.ready.then(()=>{ht||Lt()}),()=>{ht=!0,lt!==null&&(cancelAnimationFrame(lt),lt=null),St.disconnect(),Qe()}},[vt,ve,e,t,Ce,Je,Ze]);const yt=s.useMemo(()=>Kv(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:yt}}),a.jsx("div",{style:I,children:a.jsxs("div",{ref:$e,className:`${u}-wrapper ${pe}${Oe?` ${Oe}`:""}${ve?` ${u}-type-b`:""}`.trim(),style:{width:_.scalingValue(m??0,n)},onMouseMove:te?Ut:void 0,onMouseLeave:te?Rt:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[Je.map((Ee,Qe)=>{var St;const rt=(((St=Ee.link)==null?void 0:St.length)??0)>0,lt=rt&&(!n||i)?"a":"div",Lt=Ec(Qe,Je.length,Ie,be,st,S??0,n??!1);return a.jsxs(lt,{ref:Qe===0?ht=>{ke.current=ht}:void 0,className:`${u}-list-item${rt||T==="always"?` ${u}-list-item-has-link`:""}${st&&Qe===Je.length-1?` ${u}-list-item-before-cut`:""}`,...rt?{href:Ee.link,target:"_blank"}:{},style:Lt,onMouseEnter:ht=>{V&&(rt||T==="always")&&Rc(ht,u),te&&qt(Ee,ht)},onMouseLeave:ht=>{V&&(rt||T==="always")&&kc(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(dt)},children:[je.map((ht,Pt)=>{const Ot=Pt===je.length-1,At=we[Pt],Gt=ht.paddingBottom,Et=Vv(Ee.cells[ht.key]),zt=ve&&Et&&Gt>0,Ft=ve?{minHeight:ze(dt)}:{width:ze(Ze[Pt])},pt=ve?{paddingLeft:ze(ne),paddingRight:ze(ne)}:{paddingLeft:ze(At.paddingLeft),paddingRight:ze(At.paddingRight)},W=ht.textPrefix.charAt(0),Le=ve?Qv(e[`${ht.textPrefix}VerticalAlign`]):Jv(e[`${ht.textPrefix}VerticalAlign`],e,W),Ve=ve&&Et&&p&&Qe===0;return ve&&!Et?null:a.jsxs("div",{className:ve?`${u}-list-col-wrap`:void 0,...ve?{}:{"data-list-col":"","data-col-letter":W,"data-valign":Le.kind,...Le.kind==="baseline"?{"data-valign-anchor":Le.anchorLetter}:{}},children:[a.jsx("div",{className:`${u}-list-col${Ot?` ${u}-list-col-last`:""}`,style:{...pt,...Ft,...ve?{justifyContent:Fc(Le.kind)}:{}},"data-test":ht.width,children:a.jsx("span",{className:_c(e,ht.textPrefix,`${u}-list-col-title`,`${u}-text-tight-leading`),style:{...Nc(va(e,ht.textPrefix),n),...Hc(e,ht.textPrefix,u,n),...ve?{}:t0(Le.kind)},children:Ee.cells[ht.key]??null})}),zt&&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(B),"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(B),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${u}-control-anchor`,style:{top:0,left:ze(Math.max(me,ye-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)}})]},Ee.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:Re,left:0,width:"100%",height:ze(Math.max(De,ss))}})},"row-padding-handles"),p&&!ve&&ut&&Ge&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":ut.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ze[0]-((bt==null?void 0:bt.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(Mt),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]-((It==null?void 0:It.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((Ee,Qe)=>{const rt=je[Qe+1],lt=Be.slice(0,Qe+1).reduce((Ot,At)=>Ot+At,0),Lt=we[Qe],St=we[Qe+1],ht=Math.max(Lt.paddingRight,uo),Pt=Math.max(St.paddingLeft,uo);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Ee.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ze[Qe]-Lt.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(lt-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(lt),width:ze(Pt),height:"100%"}})]},`${Ee.paddingRightKey}-padding`)}),p&&!ve&&je.slice(0,-1).map((Ee,Qe)=>{const rt=$0(Qe,Be,_e,ye),Lt=Be.slice(0,Qe+1).reduce((St,ht)=>St+ht,0)-Wc/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Ee.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(Lt),width:ze(Wc),height:"calc(100%)",pointerEvents:"auto"}})},`${Ee.widthKey}-junction`)})]}),st&&(()=>{const Ee=va(e,ri),Qe=n0(e.cutLabelVerticalAlign),rt=Ee.textTextAlign==="justify"||ve;return a.jsx("button",{type:"button",className:`${u}-cut-item`,style:{minHeight:ze(G??0),cursor:Ae?"pointer":"default",...Gv(be,S??0,n??!1)},onClick:Ae?gt:void 0,onMouseEnter:V||te?Bt:void 0,onMouseLeave:V?rn:void 0,children:a.jsx("div",{className:`${u}-list-cols-row`,style:{...ve?{paddingLeft:ze(ne),paddingRight:ze(ne)}:{},justifyContent:i0(Ee.textTextAlign),alignItems:Fc(Qe)},children:a.jsx("span",{className:_c(e,ri,`${u}-cut-label`,`${u}-text-tight-leading`),style:{...Nc(Ee,n),...Hc(e,ri,u,n),...rt?{width:"100%"}:{}},children:q})})})})(),te&&re&&typeof document<"u"&&(()=>{const Ee=`${re.widthPx}px`,Qe={width:Ee,height:"auto",maxHeight:Ee,objectFit:"contain"},rt=(c?document.getElementById(c):null)??document.body;return Gn.createPortal(a.jsx("div",{ref:xe,className:`${u}-hover-media-anchor`,"data-selection":"none",children:a.jsx(jv,{media:re,className:re.isVideo?`${u}-hover-video`:`${u}-hover-image`,style:Qe},`${re.rowId}-${re.url}`)}),rt)})()]})})]})}const I0=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
10322
10322
|
import { createPortal } from 'react-dom';
|
|
10323
10323
|
import { CommonComponentProps } from '../props';
|
|
10324
10324
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -13408,7 +13408,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13408
13408
|
</>
|
|
13409
13409
|
);
|
|
13410
13410
|
}
|
|
13411
|
-
`,Bo=["A","B","C","D","E"],Dc=[...js,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],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"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function R0(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 k0(){return Object.fromEntries(Bo.map((e,t)=>{const n=Li[t],i=`${e} column`;return[n,R0(i)]}))}function E0(){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 zc(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Li]};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 M0(e){const t={};if(e===ri)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:[...Dc],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Dc]}}return t[Xt(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Xt(e,"textFontSettings")]={...Hi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Xt(e,"textFontSize")]={...Hi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Xt(e,"textLineHeight")]={...Hi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Xt(e,"textLetterSpacing")]={...Hi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Xt(e,"textWordSpacing")]={...Hi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Xt(e,"textTextAlign")]={...Hi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Xt(e,"textTextAppearance")]={...Hi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const A0=fr.reduce((e,t)=>({...e,...M0(t)}),{});function F0(e){return{verticalAlign:e===ri?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===ri?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function N0(e,t={}){var n;return{...F0(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Bc=new Set(["textFontFamily","textFontSettings"]);function _0(e,t,n){const i=r=>n===void 0?!0:n==="common"?Bc.has(r):!Bc.has(r),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=Nl(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Xt(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Xt(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Xt(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Xt(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Xt(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Xt(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Xt(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Xt(e,"textTextAppearance")]=t.textTextAppearance),o}function ca(e={},t){return fr.reduce((n,i)=>({...n,..._0(i,N0(i,e),t)}),{})}const H0=ca(),W0=d0();function ip(e){return[Xt(e,"textFontFamily"),Xt(e,"textFontSettings"),Xt(e,"textFontSize"),Xt(e,"textLineHeight"),Xt(e,"textLetterSpacing"),Xt(e,"textWordSpacing"),Xt(e,"textTextAlign"),Xt(e,"textTextAppearance"),`${e}VerticalAlign`]}function O0(){const e=[];return Fl.forEach((t,n)=>{const i=Li[n],o=ip(t);for(let r=1;r<Li.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 D0=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];ip(ri);const z0=[...Bo.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],Wi=[{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"}],B0=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:Wi[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:Wi[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:Wi[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:Wi[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:Wi[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:Wi[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:Wi[6],link:""}],j0=[...Bo.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],V0={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:{...k0(),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:B0},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"}},...E0(),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"}},...A0,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",...H0,...ca({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:zc({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:zc({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:[...O0(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...z0.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",...j0]},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__",W0]}],paletteBookmark:{items:[...D0],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},G0={element:P0,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>S0(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:[...fr.map(e=>({path:`${Xt(e,"textFontFamily")}`}))]},fontRelations:{...fr.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Xt(t,"textFontFamily")}`}),{})},schema:V0,sourceCode:I0},jc=300,ui=.004,X0={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"},q0=["hover","focus","filled","success","error"];function U0(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Vc(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Gc(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:N.scalingValue((o-t)/2,i)}}function K0(e){return`
|
|
13411
|
+
`,Bo=["A","B","C","D","E"],Dc=[...js,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],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"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function R0(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 k0(){return Object.fromEntries(Bo.map((e,t)=>{const n=Li[t],i=`${e} column`;return[n,R0(i)]}))}function E0(){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 zc(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Li]};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 M0(e){const t={};if(e===ri)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:[...Dc],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Dc]}}return t[Xt(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Xt(e,"textFontSettings")]={...Hi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Xt(e,"textFontSize")]={...Hi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Xt(e,"textLineHeight")]={...Hi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Xt(e,"textLetterSpacing")]={...Hi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Xt(e,"textWordSpacing")]={...Hi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Xt(e,"textTextAlign")]={...Hi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Xt(e,"textTextAppearance")]={...Hi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const A0=fr.reduce((e,t)=>({...e,...M0(t)}),{});function F0(e){return{verticalAlign:e===ri?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===ri?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function N0(e,t={}){var n;return{...F0(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Bc=new Set(["textFontFamily","textFontSettings"]);function _0(e,t,n){const i=r=>n===void 0?!0:n==="common"?Bc.has(r):!Bc.has(r),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=Nl(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Xt(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Xt(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Xt(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Xt(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Xt(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Xt(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Xt(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Xt(e,"textTextAppearance")]=t.textTextAppearance),o}function ca(e={},t){return fr.reduce((n,i)=>({...n,..._0(i,N0(i,e),t)}),{})}const H0=ca(),W0=d0();function ip(e){return[Xt(e,"textFontFamily"),Xt(e,"textFontSettings"),Xt(e,"textFontSize"),Xt(e,"textLineHeight"),Xt(e,"textLetterSpacing"),Xt(e,"textWordSpacing"),Xt(e,"textTextAlign"),Xt(e,"textTextAppearance"),`${e}VerticalAlign`]}function O0(){const e=[];return Fl.forEach((t,n)=>{const i=Li[n],o=ip(t);for(let r=1;r<Li.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 D0=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];ip(ri);const z0=[...Bo.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],Wi=[{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"}],B0=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:Wi[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:Wi[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:Wi[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:Wi[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:Wi[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:Wi[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:Wi[6],link:""}],j0=[...Bo.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],V0={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:{...k0(),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:B0},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"}},...E0(),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"}},...A0,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",...H0,...ca({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:zc({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:zc({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:[...O0(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...z0.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",...j0]},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__",W0]}],paletteBookmark:{items:[...D0],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},G0={element:P0,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>S0(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:[...fr.map(e=>({path:`${Xt(e,"textFontFamily")}`}))]},fontRelations:{...fr.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Xt(t,"textFontFamily")}`}),{})},schema:V0,sourceCode:I0},jc=300,ui=.004,X0={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"},q0=["hover","focus","filled","success","error"];function U0(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Vc(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Gc(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:_.scalingValue((o-t)/2,i)}}function K0(e){return`
|
|
13412
13412
|
.${e}-wrapper {
|
|
13413
13413
|
box-sizing: border-box;
|
|
13414
13414
|
display: flex;
|
|
@@ -13573,7 +13573,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13573
13573
|
pointer-events: none;
|
|
13574
13574
|
z-index: 2;
|
|
13575
13575
|
}
|
|
13576
|
-
`}function Xc(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 Y0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r}){const{prefix:l}=
|
|
13576
|
+
`}function Xc(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 Y0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r}){const{prefix:l}=_.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:b=.00833,iconPaddingRight:S=0,iconAnimation:A="rotate 45",questionColor:f="#000000",answerColor:w="#000000",dividerColor:G="#0000001F",iconColor:q="#000000",questionHoverColor:E="#666666",iconHoverColor:P="#666666",iconActiveColor:M="#000000",dividerHoverColor:X="#000000",questionFontFamily:$,questionFontSettings:T,questionFontSize:O,questionLineHeight:N,questionLetterSpacing:L,questionWordSpacing:C,questionTextAppearance:j,answerFontFamily:x,answerFontSettings:Y,answerFontSize:R,answerLineHeight:H,answerLetterSpacing:D,answerWordSpacing:Q,answerTextAppearance:ae,questionPaddingLeft:z=0,questionPaddingTop:re=0,questionPaddingBottom:F=0,answerPaddingLeft:le=0,answerPaddingRight:te=0,answerPaddingTop:fe=0,answerPaddingBottom:Pe=0}=e,xe=t??[],[de,K]=s.useState(()=>new Set),se=!n||i;s.useEffect(()=>{K(new Set)},[m]),s.useEffect(()=>{n&&!o&&!i&&K(new Set)},[n,o,i]);const ue=Ze=>_.scalingValue(Ze,n??!1),ve=Math.max(z,ui),$e=Math.max(re,ui),ke=Math.max(F,ui),he=Math.max(le,ui),Se=Math.max(te,ui),Ce=Math.max(fe,ui),h=Math.max(Pe,ui),U=Math.max(0,(d??1)-S-b),Z=Math.max(0,(d??1)-te),ne=Math.max(0,(d??1)-le),me=Math.max(S,ui),B=Math.max(0,(d??1)-z-b),I=s.useMemo(()=>de.size===0?0:Math.min(...de),[de]),ee=s.useCallback(Ze=>de.has(Ze),[de]),ie=se&&v==="default"?`${l}-entry-hover-default`:"",pe=g??"",V=pe!=="",Ie=A.replace(/^rotate /,""),be=`${l}-icon-anim-${Ie}`,J=dn(Qt(Xc($,T,O,N,L,C,j,f),n)),He=dn(Qt(Xc(x,Y,R,H,D,Q,ae,w),n)),We=Vc(O,N,`${l}-question`,`${l}-text-tight-leading`),it=Vc(R,H,`${l}-answer-text`,`${l}-text-tight-leading`),qe=Gc(O,N,l,n),tt=Gc(R,H,l,n),et=_.buildColorVars(l,{questionColor:f,answerColor:w,dividerColor:G,iconColor:q,questionHoverColor:E,iconHoverColor:P,iconActiveColor:M,dividerHoverColor:X},X0,q0),je=r&&r!=="default"?`${l}-state-${r}`:"",ye=s.useCallback(Ze=>{se&&K(we=>{if(we.has(Ze)){const Ke=new Set(we);return Ke.delete(Ze),Ke}if(m==="on")return new Set([Ze]);const Fe=new Set(we);return Fe.add(Ze),Fe})},[se,m]),_e=s.useMemo(()=>K0(l),[l]),Be={[`--${l}-divider-width`]:_.scalingValue(p,n??!1),[`--${l}-divider-style`]:y,[`--${l}-icon-max-width`]:_.scalingValue(b,n??!1),...u>0?{[`--${l}-question-min-height`]:_.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:Tt(`${l}-wrapper`,n&&!i&&`${l}-editor`,ie,je),style:{width:_.scalingValue(d,n??!1),maxWidth:"100%",...Be},children:xe.map((Ze,we)=>{var Oe;const Fe=ee(we),Ke=((Oe=Ze.question)==null?void 0:Oe.trim())??"",Je=Ze.answer,st=((Je==null?void 0:Je.length)??0)>0,ot=c&&we===I;return a.jsxs("div",{className:Tt(`${l}-item`,Fe&&`${l}-item-open`),"data-faq-item":"",children:[a.jsxs("div",{className:`${l}-question-controls`,children:[ot&&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:ue($e)}}),a.jsx("div",{"data-controls":"questionPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(U),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:ue(ve),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(B),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:ue(me),height:"100%"}})]}),a.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":Fe,style:{...J,...qe,paddingLeft:ue(z),paddingRight:ue(S)},onClick:()=>ye(we),children:[re>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:ue(re)},"aria-hidden":"true"}),a.jsxs("span",{className:`${l}-question-row`,children:[a.jsx("span",{className:We,children:Ke}),st&&(V?a.jsx("span",{className:`${l}-icon ${l}-icon-custom ${be}`,"aria-hidden":"true",children:a.jsx(mn,{url:pe,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 ${be}`,"aria-hidden":"true"}))]}),F>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:ue(F)},"aria-hidden":"true"})]}),ot&&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:ue(ke)}})]}),st&&Je&&a.jsx("div",{className:`${l}-panel`,"aria-hidden":!Fe,children:a.jsx("div",{className:`${l}-panel-inner`,children:a.jsxs("div",{className:`${l}-answer-controls`,children:[ot&&Fe&&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:ue(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:ue(he),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:ue(Se),height:"100%"}})]}),fe>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:ue(fe)}}),a.jsx("div",{className:`${l}-answer`,style:{...He,...tt,paddingLeft:ue(le),paddingRight:ue(te)},children:a.jsx("div",{className:it,children:a.jsx(Zi,{content:Je})})}),Pe>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:ue(Pe)}}),ot&&Fe&&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:ue(h)}})]})})})]},we)})})})]})}const Z0=`import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
13577
13577
|
import cn from 'classnames';
|
|
13578
13578
|
import { CommonComponentProps } from '../props';
|
|
13579
13579
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -14321,7 +14321,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
14321
14321
|
</>
|
|
14322
14322
|
);
|
|
14323
14323
|
}
|
|
14324
|
-
`;function pi(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const qc={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},J0=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Q0={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:pi("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:{...qc.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:{...qc.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:pi("Question Padding Left"),questionPaddingTop:pi("Question Padding Top"),questionPaddingBottom:pi("Question Padding Bottom"),answerPaddingLeft:pi("Answer Padding Left"),answerPaddingRight:pi("Answer Padding Right"),answerPaddingTop:pi("Answer Padding Top"),answerPaddingBottom:pi("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:[...J0],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},ex={element:Y0,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:Q0,sourceCode:Z0},ai=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}`},Uc=100,tx=.2,Kc=8,op=({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"?Uc:Math.max(Uc,window.innerHeight*tx),[]),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 T=typeof window<"u"?window.innerHeight:800,O=Math.max(.88,1-$/T*.12);return`translateY(${$}px) scale(${O})`},[]),g=s.useCallback(()=>{d.current=null},[]),b=s.useCallback(()=>{c(!0),r(0),window.setTimeout(()=>c(!1),n),g()},[n,g]),S=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]),A=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 T=d.current;if(!e||!T||$.pointerType!=="touch"||T.pointerId!==$.pointerId)return;const O=$.clientX-T.startX,F=$.clientY-T.startY;if(T.isLocked===null){if(Math.abs(O)<Kc&&Math.abs(F)<Kc)return;if(F>0&&F>Math.abs(O))T.isLocked=!0,$.currentTarget.setPointerCapture($.pointerId);else{T.isLocked=!1,g();return}}if(!T.isLocked)return;$.preventDefault();const L=Math.max(0,F);u.current=L,r(L)},[e,g]),w=s.useCallback($=>{const T=d.current;if(!e||!T||$.pointerType!=="touch"||T.pointerId!==$.pointerId)return;const O=T.isLocked===!0;if($.currentTarget.hasPointerCapture($.pointerId)&&$.currentTarget.releasePointerCapture($.pointerId),!O){g();return}$.clientY-T.startY>=p?S():b()},[p,S,e,g,b]),G=s.useCallback($=>{w($)},[w]),q=s.useCallback($=>{w($)},[w]),E=o>0,P=l?`transform ${n}ms ease`:"none",M=l?`opacity ${n}ms ease`:"none",X=o>0||l;return{isSwipeDragging:E,backdropStyle:{opacity:y(o),transition:M},mediaAreaStyle:{transform:m(o),transition:P,touchAction:E?"none":void 0,willChange:E?"transform":void 0},overlayContentStyle:X?{opacity:v(o),transition:M}:void 0,swipeHandlers:e?{onPointerDown:A,onPointerMove:f,onPointerUp:G,onPointerCancel:q}:{},dismissAreaStyle:e?{touchAction:E?"none":"pan-x"}:void 0}},nx="[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(nx)||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])},ix=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},ox=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},rx=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},ax=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,c=n-l,d=l-n,u=(g,b)=>{ox(t),e.scrollLeft=g,b&&(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-rx(t),!1))}},sr=300,sx=900,lx=1500,cx="cubic-bezier(0.16, 1, 0.3, 1)",dx=3e3,ux=2,px=16,mx=.05,gx=1,Br=.3,hx=50,fx=20,oo=.004,Ao=["title1","title2","title3"],yx={title1:"1",title2:"2",title3:"3"},vx={title1:"title1Color",title2:"title2Color",title3:"title3Color"},xx={title1:.02,title2:.02,title3:.02},jr=e=>`max(${e}, ${fx}px)`,bx=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]}},Sx=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=bx(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Zt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,wx=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")],$x=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Ao.map(e=>[yx[e],wx(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},rp=(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)},Yc=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Ol(e.length,n),effective:rp(e.length,n)}},Cx=(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[vx[t]]}},Tx=(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??xx[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Qt(i,n)},Lx=({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:b,thumbnailTrigger:S,thumbnailVisibility:A,thumbnailObjectFit:f,thumbnailActive:w,thumbnailActiveColor:G,title1Width:q,title2Width:E,title3Width:P,title1MarginLeft:M=0,title2MarginLeft:X=0,title3MarginLeft:$=0,titleRowMarginBottom:T=0,titleHeaderLayout:O="desktop",contentMarginTop:F,iconMarginLeft:L}=n,C=k=>N.scalingValue(k,i??!1),j=d??n.thumnailSize??.03,x=C(j),Y=C(u),R=C(p??.02),H=C(y??0),D=C(F??0),Q=jr(D),ae=C(L??0),[z,re]=s.useState(0),_=s.useRef(z);_.current=z;const le=t[z],{title1:te,title2:fe,title3:Pe}=Sx(le),xe=ds("title1",cs(n,"title1"),i),ue=ds("title2",cs(n,"title2"),i),K=ds("title3",cs(n,"title3"),i),se=O==="mobile",de=!o&&(!i||r),ve=de,$e=de,ke=de,he=ai(f),Se=he?{"--image-aspect-ratio":Wa(f)}:void 0,Te=!!(te||fe||Pe),h=s.useMemo(()=>Cx(e,te,fe,Pe,xe,ue,K),[e,z,te,fe,Pe,xe,ue,K]),U=s.useMemo(()=>({title1Width:q,title2Width:E,title3Width:P}),[q,E,P]),Z=s.useMemo(()=>h.map(k=>U[k.widthKey]),[h,U]),ne=s.useMemo(()=>Ol(h.length,Z),[h.length,Z]),me=s.useMemo(()=>rp(h.length,Z),[h.length,Z]),B=s.useMemo(()=>h.filter(k=>k.prefix==="title1"),[h]),I=s.useMemo(()=>h.filter(k=>k.prefix==="title2"||k.prefix==="title3"),[h]),ee=s.useMemo(()=>Yc(B,U),[B,U]),ie=s.useMemo(()=>Yc(I,U),[I,U]),pe=s.useCallback((k,oe)=>{const ce=h.indexOf(k);if(!se||oe==="single-row")return{effectiveWidth:me[ce]??0,resolvedWidth:ne[ce]??0,maxWidth:Vr(ce,ne)};if(oe==="two-row-top"){const Ue=B.indexOf(k);return{effectiveWidth:ee.effective[Ue]??0,resolvedWidth:ee.resolved[Ue]??0,maxWidth:Vr(Ue,ee.resolved)}}const Me=I.indexOf(k);return{effectiveWidth:ie.effective[Me]??0,resolvedWidth:ie.resolved[Me]??0,maxWidth:Vr(Me,ie.resolved)}},[I,ie,me,ne,h,B,ee,se]),V=s.useCallback(k=>N.scalingValue(k,i??!1),[i]),Ie=V(T??0),be=s.useMemo(()=>({title1MarginLeft:M,title2MarginLeft:X,title3MarginLeft:$}),[M,X,$]),J=s.useCallback(k=>h.slice(0,k+1).reduce((oe,ce,Me)=>oe+(ce!=null&&ce.marginLeftKey?be[ce.marginLeftKey]??0:0)+(ne[Me]??0),0)+(se?0:M??0),[h,be,ne,se,M]),He=s.useCallback(()=>se?0:M??0,[se,M]),We=s.useCallback(k=>I.slice(0,k).reduce((oe,ce,Me)=>oe+(ce.marginLeftKey?be[ce.marginLeftKey]??0:0)+(ie.resolved[Me]??0),0),[I,ie.resolved,be]),it=s.useCallback(k=>{const oe=I[k];return We(k)+(oe.marginLeftKey?be[oe.marginLeftKey]??0:0)+(ie.resolved[k]??0)},[I,ie.resolved,We,be]),qe=(k,oe)=>{const ce=k.marginLeftKey?be[k.marginLeftKey]??0:0,{effectiveWidth:Me,resolvedWidth:Ue,maxWidth:ct}=pe(k,oe),kt=o&&oe==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":k.prefix,style:{...oe==="single-row"?{gridArea:k.prefix}:{},width:V(Me),...ce>0?{marginLeft:V(ce)}:{}},children:[a.jsx("p",{className:k.className,style:k.style,children:k.text}),kt&&k.marginLeftKey&&a.jsx("div",{"data-controls":k.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ue),style:{position:"absolute",top:0,left:V(-ce),width:`max(${V(ce)}, 10px)`,height:"100%",pointerEvents:"auto"}}),kt&&a.jsx("div",{"data-controls":k.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ct),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:V(-oo/2),width:V(oo),height:"100%",pointerEvents:"auto"}})]},k.className)},tt=()=>{const k=se?-1:h.findIndex(Me=>Me.prefix==="title1"),oe=!se&&(o||(M??0)>0)?(()=>{const Me=M??0,Ue=k>=0?ne[k]:q??0;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:`max(${V(Me)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,ce=h.flatMap((Me,Ue)=>{if(!Me.marginLeftKey)return[];const ct=be[Me.marginLeftKey]??0,kt=Tx(h,ne,be,Ue)+He();return a.jsx("div",{"data-controls":Me.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ne[Ue]),style:{position:"absolute",top:0,left:V(kt),width:`max(${V(ct)}, 10px)`,height:"100%",pointerEvents:"auto"}},Me.marginLeftKey)});return oe?[oe,...ce]:ce},et=()=>h.map((k,oe)=>{const ce=Vr(oe,ne),Ue=J(oe)-oo/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":k.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:V(Ue),width:V(oo),height:"100%",pointerEvents:"auto"}})},`${k.widthKey}-junction`)}),je=()=>I.flatMap((k,oe)=>{if(!k.marginLeftKey)return[];const ce=be[k.marginLeftKey]??0,Me=We(oe),{resolvedWidth:Ue}=pe(k,"two-row-bottom");return a.jsx("div",{"data-controls":k.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ue),style:{position:"absolute",top:0,left:V(Me),width:`max(${V(ce)}, 10px)`,height:"100%",pointerEvents:"auto"}},k.marginLeftKey)}),ye=()=>I.map((k,oe)=>{const{maxWidth:ce}=pe(k,"two-row-bottom"),Ue=it(oe)-oo/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":k.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:V(Ue),width:V(oo),height:"100%",pointerEvents:"auto"}})},`${k.widthKey}-junction`)}),_e=s.useRef(null),Be=s.useRef(null),Ze=s.useRef(null),we=s.useRef(null),Fe=s.useRef([]),Ke=s.useRef([]),Je=s.useRef(0),st=s.useRef(null),ot=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),dt=s.useRef(!1),ge=t.length>1&&(!o||!!r),Re=ge?3:1,nt=s.useMemo(()=>Array.from({length:Re},()=>t).flat(),[t,Re]),[ut,Ge]=s.useState(!1),[bt,It]=s.useState(!1),[Mt,wt]=s.useState(!0),Vt=s.useRef(null),jt=s.useRef(null),qt=s.useRef(!1),Ut=s.useRef(!1),Rt=s.useRef(null),Bt=s.useRef(null),rn=ve&&!Mt,vt=s.useCallback(()=>{ve&&(wt(!0),Bt.current&&clearTimeout(Bt.current),Bt.current=setTimeout(()=>{ot.current.isActive||wt(!1)},dx))},[ve]),yt=s.useCallback(()=>{o||Ut.current||(Ut.current=!0,It(!1),Rt.current=setTimeout(()=>{l()},sr))},[o,l]),Ee=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":rn?"true":"false",style:{width:N.scalingValue(m??0,i),height:N.scalingValue(m??0,i),marginRight:ae,"--close-icon-hover-color":b},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:b,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=(k="two-row")=>a.jsx("div",{...k==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:V(M??0),flexShrink:0,...k==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...k==="two-row"&&o?{pointerEvents:"auto"}:{}}}),rt=()=>{const k=h.find(Me=>Me.prefix==="title1"),oe=h.filter(Me=>Me.prefix==="title2"||Me.prefix==="title3"),ce=oe.length>0||o||(T??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(M??0)>0||o?Qe():null,k&&qe(k,"two-row-top"),v&&Ee()]}),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(Me=>qe(Me,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[je(),ye()]})]}):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]})},lt=()=>a.jsxs(a.Fragment,{children:[(M??0)>0||o?Qe("single-row"):null,h.map(k=>qe(k,"single-row")),o?a.jsxs(a.Fragment,{children:[tt(),et()]}):null,v?Ee():null]}),Lt=s.useCallback(k=>!!(k.closest("[data-controls]")||k.closest(`.${e}-thumbnails`)||k.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:St,backdropStyle:ht,mediaAreaStyle:Pt,overlayContentStyle:Ot,swipeHandlers:At,dismissAreaStyle:Gt}=op({enabled:de??!1,onClose:yt,animMs:sr,isBlockedTarget:Lt}),Et=()=>{if(!ge||t.length===0)return Je.current=0,0;const k=Ke.current[0],oe=Ke.current[t.length];if(!k||!oe)return Je.current;const ce=oe.offsetLeft-k.offsetLeft;return ce>0&&(Je.current=ce),Je.current},zt=(k=!1)=>{if(!ge)return;const oe=Be.current,ce=Et();!oe||ce<=0||ce<oe.clientWidth*.25||(oe.scrollLeft<=0?(oe.scrollLeft+=ce,k&&(ot.current.scrollLeft+=ce),dt.current&&(De.current+=ce)):oe.scrollLeft>=ce*2&&(oe.scrollLeft-=ce,k&&(ot.current.scrollLeft-=ce),dt.current&&(De.current-=ce)))},Ft=(k,oe=(ce=>(ce=Be.current)==null?void 0:ce.scrollLeft)()??0)=>{if(!ge)return k;let Me=t.length+k,Ue=1/0;for(let ct=0;ct<Re;ct++){const kt=ct*t.length+k,_t=Ke.current[kt];if(!_t)continue;const nn=Math.abs(_t.offsetLeft-oe);nn<Ue&&(Ue=nn,Me=kt)}return Me},pt=k=>{const oe=Be.current;return!k||!oe?!1:k.offsetWidth>oe.clientWidth+1},W=k=>{const oe=Be.current;if(!k||!oe||!pt(k))return!1;const ce=k.offsetLeft,Me=ce+k.offsetWidth;return oe.scrollLeft>=ce-1&&oe.scrollLeft+oe.clientWidth<=Me+1},Le=(k=(oe=>(oe=Be.current)==null?void 0:oe.scrollLeft)()??0)=>{for(let Me=0;Me<Ke.current.length;Me+=1){const Ue=Ke.current[Me];if(Ue&&W(Ue))return Me}let ce={flatIndex:0,distance:1/0};return Ke.current.forEach((Me,Ue)=>{if(!Me)return;const ct=Math.abs(Me.offsetLeft-k);ct<ce.distance&&(ce={flatIndex:Ue,distance:ct})}),ce.flatIndex},Ve=k=>{Be.current&&Ke.current.forEach(oe=>{oe&&(oe.style.scrollSnapAlign=pt(oe)&&k==="backward"?"end":"start")})},Ne=(k,oe,ce)=>{const Me=k-oe,Ue=Le(oe),ct=Ke.current[Ue];if(W(ct))return Le(k)%t.length;const kt=Ke.current[Ue+1],_t=ct?kt?kt.offsetLeft-ct.offsetLeft:ct.offsetWidth:0,nn=_t>0?Me>_t*Br?1:Me<-_t*Br?-1:0:0;return nn===0?ce:ge?(ce+nn+t.length)%t.length:Math.max(0,Math.min(t.length-1,ce+nn))},ft=s.useCallback((k=!1)=>{if(A!=="on"||o)return;const oe=we.current,ce=_.current,Me=Fe.current[ce];if(!oe||!Me||oe.scrollWidth<=oe.clientWidth)return;const Ue=oe.scrollLeft,ct=Ue+oe.clientWidth,kt=Me.offsetLeft,_t=kt+Me.offsetWidth;if(kt>=Ue&&_t<=ct)return;const nn=oe.scrollWidth-oe.clientWidth;let on=Ue;if(!k&&Vt.current===null){const Mi=Fe.current[ce-1],Yn=Fe.current[ce+1],Ai=Mi?Me.offsetLeft-Mi.offsetLeft:Yn?Yn.offsetLeft-Me.offsetLeft:Me.offsetWidth;_t>ct?on+=Ai:kt<Ue&&(on-=Ai)}else _t>ct?on=_t-oe.clientWidth:on=kt;oe.scrollLeft=Math.max(0,Math.min(nn,on))},[o,A]),Nt=s.useCallback((k=!1)=>{k&&(qt.current=!0),jt.current===null&&(jt.current=requestAnimationFrame(()=>{jt.current=null;const oe=qt.current;qt.current=!1,ft(oe)}))},[ft]),mt=s.useCallback(k=>{if(k===_.current)return;const oe=_.current;_.current=k;const ce=Math.abs(k-oe)>1,Me=ge&&t.length>1&&(oe===t.length-1&&k===0||oe===0&&k===t.length-1);re(k),Nt(ce||Me)},[t.length,ge,Nt]),$t=()=>{if(!Be.current||t.length===0||Vt.current!==null||ot.current.isActive&&ot.current.hasMoved)return;const k=Be.current.scrollLeft,oe=Le(k)%t.length;oe!==_.current&&mt(oe)},Yt=()=>{Vt.current=null},Dt=k=>{const oe=Be.current;oe&&(oe.style.scrollSnapType=k?"":"none")},sn=()=>{var k;(k=Ae.current)==null||k.call(Ae),Ae.current=null},ln=()=>{Xe.current!==null&&(cancelAnimationFrame(Xe.current),Xe.current=null),dt.current=!1},qn=()=>{const k=Be.current;if(!k){Xe.current=null,dt.current=!1;return}const oe=De.current-k.scrollLeft;if(Math.abs(oe)<.5){k.scrollLeft=De.current,zt(),$t(),Xe.current=null,dt.current=!1;return}k.scrollLeft+=oe*mx,zt(),$t(),vt(),Xe.current=requestAnimationFrame(qn)},Un=()=>{const k=Ze.current;k&&(k.style.transition="",k.style.transform="",k.style.willChange="")},hn=(k,oe,ce,Me)=>{Un(),k.scrollLeft=oe,gt.current=k.scrollLeft,zt(),ce!==void 0?(_.current=ce,re(ce)):$t(),Dt(!0),Me==null||Me()},Qi=(k,{behavior:oe="smooth",activeIndex:ce,onComplete:Me}={})=>{const Ue=Be.current,ct=Ze.current;if(!Ue||!ct)return;if(ln(),sn(),Dt(!1),oe==="auto"){hn(Ue,k,ce,Me);return}const kt=Math.abs(k-Ue.scrollLeft),_t=ix(kt,sx,lx,Ue.clientWidth*.55);Ae.current=ax(Ue,ct,k,{duration:_t,easing:cx,onComplete:()=>{Ae.current=null,hn(Ue,k,ce,Me)}})},Vo=(k="smooth")=>{const oe=Be.current;if(!oe||t.length===0)return;const ce=Le()%t.length,Me=Ft(ce,oe.scrollLeft),Ue=Ke.current[Me];Ue&&Qi(Ue.offsetLeft,{behavior:k,activeIndex:ce})},Go=(k,oe="smooth",ce,Me)=>{const Ue=Be.current;if(!Ue||t.length===0)return;const ct=(Me??Ue.scrollLeft)-k,kt=Le(k),_t=Ke.current[kt];if(W(_t)){Dt(!0),$t();return}const nn=Ke.current[kt+1],on=_t?nn?nn.offsetLeft-_t.offsetLeft:_t.offsetWidth:0;if((on>0?ct>on*Br?1:ct<-on*Br?-1:0:0)!==0){const Da=ce??kt%t.length,kr=Ne(Me??Ue.scrollLeft,k,Da);xn(kr,oe);return}const Yn=Me??Ue.scrollLeft,Ai=Le(Yn),to=Ke.current[Ai];if(to&&Math.abs(to.offsetLeft-Yn)<1){Dt(!0),$t();return}Vo("auto")},xn=(k,oe="smooth")=>{const ce=Be.current;if(!ce||t.length===0)return;const Me=Ft(k,ce.scrollLeft),Ue=Ke.current[Me];Ue&&(oe==="smooth"?Vt.current=k:Vt.current=null,_.current=k,re(k),Nt(!0),Qi(Ue.offsetLeft,{behavior:oe,activeIndex:k,onComplete:oe==="smooth"?Yt:void 0}))},ci=()=>{Oe.current&&(window.removeEventListener("pointerup",Oe.current),window.removeEventListener("pointercancel",Oe.current),Oe.current=null)},Kn=(k,oe,ce,Me,Ue)=>{const ct=ce-k,kt=Me-oe,_t=Math.abs(ct),nn=Math.abs(kt);if(_t<hx||_t<=nn)return!1;const on=ct<0?1:-1,Mi=ge?(Ue+on+t.length)%t.length:Math.max(0,Math.min(t.length-1,Ue+on));return Mi===Ue?!1:(xn(Mi),!0)},bn=k=>{if(!ot.current.isActive)return;ci();const oe=Be.current;if(!oe)return;const{scrollLeft:ce,startActiveIndex:Me,hasMoved:Ue}=ot.current,ct=oe.scrollLeft;zt(!0),ot.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},Ge(!1),k!==void 0&&oe.hasPointerCapture(k)&&oe.releasePointerCapture(k),Ue?Go(ce,"smooth",Me,ct):(Dt(!0),$t()),vt()},Ei=(k,oe)=>{const ce=st.current;st.current=null,ce&&(Kn(ce.startX,ce.startY,k,oe,ce.startActiveIndex),vt())},eo=k=>{if(!$e)return;if(k.pointerType==="touch"){if(ln(),Dt(!0),Lt(k.target))return;st.current={startX:k.clientX,startY:k.clientY,startActiveIndex:_.current};return}if(k.pointerType!=="mouse"||k.button!==0||Lt(k.target))return;const oe=Be.current;if(!oe)return;ln(),sn(),Un(),Vt.current=null,ot.current={isActive:!0,startX:k.clientX,scrollLeft:oe.scrollLeft,startActiveIndex:_.current,hasMoved:!1},Dt(!1),vt(),oe.setPointerCapture(k.pointerId),ci();const ce=Me=>{Me.pointerType==="mouse"&&bn(Me.pointerId)};Oe.current=ce,window.addEventListener("pointerup",ce),window.addEventListener("pointercancel",ce)},Rr=k=>{if(!$e||k.pointerType!=="mouse")return;const oe=Be.current;if(!oe||!ot.current.isActive)return;if(k.buttons===0){bn(k.pointerId);return}const ce=k.clientX-ot.current.startX;Math.abs(ce)>gx&&(ot.current.hasMoved=!0,Ge(!0)),ot.current.hasMoved&&(k.preventDefault(),oe.scrollLeft=ot.current.scrollLeft-ce,zt(!0),$t(),vt())},Ce=k=>{if($e){if(k.pointerType==="touch"){k.type==="pointerup"?Ei(k.clientX,k.clientY):st.current=null;return}k.pointerType==="mouse"&&bn(k.pointerId)}},Ye=k=>{!$e||k.pointerType!=="mouse"||bn(k.pointerId)};return Wl(),s.useEffect(()=>{const k=requestAnimationFrame(()=>It(!0));return()=>{cancelAnimationFrame(k),sn(),ci(),jt.current!==null&&(cancelAnimationFrame(jt.current),jt.current=null),Rt.current&&clearTimeout(Rt.current),Bt.current&&clearTimeout(Bt.current)}},[]),s.useEffect(()=>{if(!ve){wt(!0);return}vt();const k=()=>vt();return document.addEventListener("pointermove",k,{passive:!0}),document.addEventListener("pointerdown",k,{passive:!0}),()=>{document.removeEventListener("pointermove",k),document.removeEventListener("pointerdown",k),Bt.current&&clearTimeout(Bt.current)}},[ve,vt]),s.useEffect(()=>{const k=oe=>{oe.key==="Escape"&&yt()};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[yt]),s.useLayoutEffect(()=>{Et()},[H,t.length,ge]),s.useLayoutEffect(()=>{o||xn(_.current,"auto")},[H,o]),s.useLayoutEffect(()=>{xn(0,"auto")},[t.length,ge]),s.useEffect(()=>{const k=Be.current;if(!k||o||!de)return;const oe=ce=>{if(ce.preventDefault(),Math.abs(ce.deltaY)<=Math.abs(ce.deltaX))return;const Me=ce.deltaMode===1?px:ce.deltaMode===2?k.clientHeight:1,Ue=ce.deltaY*Me*ux;if(Ue!==0){if(sn(),dt.current||(dt.current=!0,De.current=k.scrollLeft,Vt.current=null,Dt(!1)),De.current+=Ue,!ge){const ct=k.scrollWidth-k.clientWidth;De.current=Math.max(0,Math.min(ct,De.current))}vt(),Xe.current===null&&(Xe.current=requestAnimationFrame(qn))}};return k.addEventListener("wheel",oe,{passive:!1}),()=>{k.removeEventListener("wheel",oe),ln()}},[o,de,ge]),s.useEffect(()=>{const k=Be.current;if(!k)return;const oe=()=>{zt(ot.current.isActive);const Me=k.scrollLeft,Ue=Me-gt.current;gt.current=Me;const ct=Je.current>0?Je.current*.5:1/0;if(Ue!==0&&Math.abs(Ue)<ct){const kt=Ue>0?"forward":"backward";kt!==ze.current&&(ze.current=kt,Ve(kt))}ot.current.isActive&&ot.current.hasMoved||$t()};k.addEventListener("scroll",oe,{passive:!0});const ce=new ResizeObserver(()=>{Et(),zt(ot.current.isActive),Ve(ze.current),$t()});return ce.observe(k),()=>{sn(),k.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:bt?1:0,transition:`opacity ${sr}ms ease`,pointerEvents:bt?"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,...At,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Pt,onClick:k=>k.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":ut?"true":"false",onPointerDown:eo,onPointerMove:Rr,onPointerUp:Ce,onPointerCancel:Ce,onLostPointerCapture:Ye,children:a.jsx("div",{ref:Ze,className:`${e}-lightbox-strip-track`,style:{gap:H},children:nt.map((k,oe)=>{const ce=k.image.objectFit??"contain",Me=oe%t.length,Ue=Math.floor(oe/t.length),ct=jr(H),kt=`calc(-0.5 * (${ct} + ${H}))`;return a.jsxs("div",{ref:_t=>Ke.current[oe]=_t,className:`${e}-strip-item`,style:{height:O==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:k.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:ce}}),o&&Me<t.length-1&&Ue===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:kt,width:ct,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ue}-${k.image.url}-${Me}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":rn?"true":"false",style:Ot,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:D,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:Q,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:(Te||v)&&a.jsx("div",{className:`${e}-header ${se?`${e}-header-two-row`:`${e}-header-single-row`}`,children:se?rt():Te||v?lt():null})})})]}),t.length>1&&A==="on"&&(()=>{const k=jr(R),oe=`calc(-0.5 * (${R} + ${k}))`;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":w,style:{gap:Y,"--thumbnail-active-color":G},children:[t.map((ce,Me)=>{const Ue=jr(Y),ct=`calc(-0.5 * (${Ue} + ${Y}))`;return a.jsxs("div",{ref:kt=>{Fe.current[Me]=kt},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":z===Me?"true":"false",onClick:()=>de&&S==="click"&&xn(Me),onMouseEnter:()=>ke&&S==="hover"&&xn(Me),"aria-label":ce.image.name?`View ${ce.image.name}`:`View image ${Me+1}`,"aria-current":z===Me?"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:x,maxHeight:x,width:f.display==="cover"?"auto":"100%",height:"auto",objectFit:f.display==="cover"?"cover":"contain"}})}),o&&Me<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:ct,width:Ue,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${ce.image.url}-${Me}`)}),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:k,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function Px(e){return`
|
|
14324
|
+
`;function pi(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const qc={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},J0=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Q0={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:pi("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:{...qc.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:{...qc.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:pi("Question Padding Left"),questionPaddingTop:pi("Question Padding Top"),questionPaddingBottom:pi("Question Padding Bottom"),answerPaddingLeft:pi("Answer Padding Left"),answerPaddingRight:pi("Answer Padding Right"),answerPaddingTop:pi("Answer Padding Top"),answerPaddingBottom:pi("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:[...J0],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},ex={element:Y0,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:Q0,sourceCode:Z0},ai=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}`},Uc=100,tx=.2,Kc=8,op=({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"?Uc:Math.max(Uc,window.innerHeight*tx),[]),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 T=typeof window<"u"?window.innerHeight:800,O=Math.max(.88,1-$/T*.12);return`translateY(${$}px) scale(${O})`},[]),g=s.useCallback(()=>{d.current=null},[]),b=s.useCallback(()=>{c(!0),r(0),window.setTimeout(()=>c(!1),n),g()},[n,g]),S=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]),A=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 T=d.current;if(!e||!T||$.pointerType!=="touch"||T.pointerId!==$.pointerId)return;const O=$.clientX-T.startX,N=$.clientY-T.startY;if(T.isLocked===null){if(Math.abs(O)<Kc&&Math.abs(N)<Kc)return;if(N>0&&N>Math.abs(O))T.isLocked=!0,$.currentTarget.setPointerCapture($.pointerId);else{T.isLocked=!1,g();return}}if(!T.isLocked)return;$.preventDefault();const L=Math.max(0,N);u.current=L,r(L)},[e,g]),w=s.useCallback($=>{const T=d.current;if(!e||!T||$.pointerType!=="touch"||T.pointerId!==$.pointerId)return;const O=T.isLocked===!0;if($.currentTarget.hasPointerCapture($.pointerId)&&$.currentTarget.releasePointerCapture($.pointerId),!O){g();return}$.clientY-T.startY>=p?S():b()},[p,S,e,g,b]),G=s.useCallback($=>{w($)},[w]),q=s.useCallback($=>{w($)},[w]),E=o>0,P=l?`transform ${n}ms ease`:"none",M=l?`opacity ${n}ms ease`:"none",X=o>0||l;return{isSwipeDragging:E,backdropStyle:{opacity:y(o),transition:M},mediaAreaStyle:{transform:m(o),transition:P,touchAction:E?"none":void 0,willChange:E?"transform":void 0},overlayContentStyle:X?{opacity:v(o),transition:M}:void 0,swipeHandlers:e?{onPointerDown:A,onPointerMove:f,onPointerUp:G,onPointerCancel:q}:{},dismissAreaStyle:e?{touchAction:E?"none":"pan-x"}:void 0}},nx="[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(nx)||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])},ix=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},ox=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},rx=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},ax=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,c=n-l,d=l-n,u=(g,b)=>{ox(t),e.scrollLeft=g,b&&(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-rx(t),!1))}},sr=300,sx=900,lx=1500,cx="cubic-bezier(0.16, 1, 0.3, 1)",dx=3e3,ux=2,px=16,mx=.05,gx=1,Br=.3,hx=50,fx=20,oo=.004,Ao=["title1","title2","title3"],yx={title1:"1",title2:"2",title3:"3"},vx={title1:"title1Color",title2:"title2Color",title3:"title3Color"},xx={title1:.02,title2:.02,title3:.02},jr=e=>`max(${e}, ${fx}px)`,bx=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]}},Sx=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=bx(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Zt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,wx=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")],$x=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Ao.map(e=>[yx[e],wx(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},rp=(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)},Yc=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Ol(e.length,n),effective:rp(e.length,n)}},Cx=(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[vx[t]]}},Tx=(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??xx[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Qt(i,n)},Lx=({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:b,thumbnailTrigger:S,thumbnailVisibility:A,thumbnailObjectFit:f,thumbnailActive:w,thumbnailActiveColor:G,title1Width:q,title2Width:E,title3Width:P,title1MarginLeft:M=0,title2MarginLeft:X=0,title3MarginLeft:$=0,titleRowMarginBottom:T=0,titleHeaderLayout:O="desktop",contentMarginTop:N,iconMarginLeft:L}=n,C=k=>_.scalingValue(k,i??!1),j=d??n.thumnailSize??.03,x=C(j),Y=C(u),R=C(p??.02),H=C(y??0),D=C(N??0),Q=jr(D),ae=C(L??0),[z,re]=s.useState(0),F=s.useRef(z);F.current=z;const le=t[z],{title1:te,title2:fe,title3:Pe}=Sx(le),xe=ds("title1",cs(n,"title1"),i),de=ds("title2",cs(n,"title2"),i),K=ds("title3",cs(n,"title3"),i),se=O==="mobile",ue=!o&&(!i||r),ve=ue,$e=ue,ke=ue,he=ai(f),Se=he?{"--image-aspect-ratio":Wa(f)}:void 0,Ce=!!(te||fe||Pe),h=s.useMemo(()=>Cx(e,te,fe,Pe,xe,de,K),[e,z,te,fe,Pe,xe,de,K]),U=s.useMemo(()=>({title1Width:q,title2Width:E,title3Width:P}),[q,E,P]),Z=s.useMemo(()=>h.map(k=>U[k.widthKey]),[h,U]),ne=s.useMemo(()=>Ol(h.length,Z),[h.length,Z]),me=s.useMemo(()=>rp(h.length,Z),[h.length,Z]),B=s.useMemo(()=>h.filter(k=>k.prefix==="title1"),[h]),I=s.useMemo(()=>h.filter(k=>k.prefix==="title2"||k.prefix==="title3"),[h]),ee=s.useMemo(()=>Yc(B,U),[B,U]),ie=s.useMemo(()=>Yc(I,U),[I,U]),pe=s.useCallback((k,oe)=>{const ce=h.indexOf(k);if(!se||oe==="single-row")return{effectiveWidth:me[ce]??0,resolvedWidth:ne[ce]??0,maxWidth:Vr(ce,ne)};if(oe==="two-row-top"){const Ue=B.indexOf(k);return{effectiveWidth:ee.effective[Ue]??0,resolvedWidth:ee.resolved[Ue]??0,maxWidth:Vr(Ue,ee.resolved)}}const Me=I.indexOf(k);return{effectiveWidth:ie.effective[Me]??0,resolvedWidth:ie.resolved[Me]??0,maxWidth:Vr(Me,ie.resolved)}},[I,ie,me,ne,h,B,ee,se]),V=s.useCallback(k=>_.scalingValue(k,i??!1),[i]),Ie=V(T??0),be=s.useMemo(()=>({title1MarginLeft:M,title2MarginLeft:X,title3MarginLeft:$}),[M,X,$]),J=s.useCallback(k=>h.slice(0,k+1).reduce((oe,ce,Me)=>oe+(ce!=null&&ce.marginLeftKey?be[ce.marginLeftKey]??0:0)+(ne[Me]??0),0)+(se?0:M??0),[h,be,ne,se,M]),He=s.useCallback(()=>se?0:M??0,[se,M]),We=s.useCallback(k=>I.slice(0,k).reduce((oe,ce,Me)=>oe+(ce.marginLeftKey?be[ce.marginLeftKey]??0:0)+(ie.resolved[Me]??0),0),[I,ie.resolved,be]),it=s.useCallback(k=>{const oe=I[k];return We(k)+(oe.marginLeftKey?be[oe.marginLeftKey]??0:0)+(ie.resolved[k]??0)},[I,ie.resolved,We,be]),qe=(k,oe)=>{const ce=k.marginLeftKey?be[k.marginLeftKey]??0:0,{effectiveWidth:Me,resolvedWidth:Ue,maxWidth:ct}=pe(k,oe),kt=o&&oe==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":k.prefix,style:{...oe==="single-row"?{gridArea:k.prefix}:{},width:V(Me),...ce>0?{marginLeft:V(ce)}:{}},children:[a.jsx("p",{className:k.className,style:k.style,children:k.text}),kt&&k.marginLeftKey&&a.jsx("div",{"data-controls":k.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ue),style:{position:"absolute",top:0,left:V(-ce),width:`max(${V(ce)}, 10px)`,height:"100%",pointerEvents:"auto"}}),kt&&a.jsx("div",{"data-controls":k.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ct),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:V(-oo/2),width:V(oo),height:"100%",pointerEvents:"auto"}})]},k.className)},tt=()=>{const k=se?-1:h.findIndex(Me=>Me.prefix==="title1"),oe=!se&&(o||(M??0)>0)?(()=>{const Me=M??0,Ue=k>=0?ne[k]:q??0;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:`max(${V(Me)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,ce=h.flatMap((Me,Ue)=>{if(!Me.marginLeftKey)return[];const ct=be[Me.marginLeftKey]??0,kt=Tx(h,ne,be,Ue)+He();return a.jsx("div",{"data-controls":Me.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ne[Ue]),style:{position:"absolute",top:0,left:V(kt),width:`max(${V(ct)}, 10px)`,height:"100%",pointerEvents:"auto"}},Me.marginLeftKey)});return oe?[oe,...ce]:ce},et=()=>h.map((k,oe)=>{const ce=Vr(oe,ne),Ue=J(oe)-oo/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":k.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:V(Ue),width:V(oo),height:"100%",pointerEvents:"auto"}})},`${k.widthKey}-junction`)}),je=()=>I.flatMap((k,oe)=>{if(!k.marginLeftKey)return[];const ce=be[k.marginLeftKey]??0,Me=We(oe),{resolvedWidth:Ue}=pe(k,"two-row-bottom");return a.jsx("div",{"data-controls":k.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ue),style:{position:"absolute",top:0,left:V(Me),width:`max(${V(ce)}, 10px)`,height:"100%",pointerEvents:"auto"}},k.marginLeftKey)}),ye=()=>I.map((k,oe)=>{const{maxWidth:ce}=pe(k,"two-row-bottom"),Ue=it(oe)-oo/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":k.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:V(Ue),width:V(oo),height:"100%",pointerEvents:"auto"}})},`${k.widthKey}-junction`)}),_e=s.useRef(null),Be=s.useRef(null),Ze=s.useRef(null),we=s.useRef(null),Fe=s.useRef([]),Ke=s.useRef([]),Je=s.useRef(0),st=s.useRef(null),ot=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),dt=s.useRef(!1),ge=t.length>1&&(!o||!!r),Re=ge?3:1,nt=s.useMemo(()=>Array.from({length:Re},()=>t).flat(),[t,Re]),[ut,Ge]=s.useState(!1),[bt,It]=s.useState(!1),[Mt,wt]=s.useState(!0),Vt=s.useRef(null),jt=s.useRef(null),qt=s.useRef(!1),Ut=s.useRef(!1),Rt=s.useRef(null),Bt=s.useRef(null),rn=ve&&!Mt,vt=s.useCallback(()=>{ve&&(wt(!0),Bt.current&&clearTimeout(Bt.current),Bt.current=setTimeout(()=>{ot.current.isActive||wt(!1)},dx))},[ve]),yt=s.useCallback(()=>{o||Ut.current||(Ut.current=!0,It(!1),Rt.current=setTimeout(()=>{l()},sr))},[o,l]),Ee=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":rn?"true":"false",style:{width:_.scalingValue(m??0,i),height:_.scalingValue(m??0,i),marginRight:ae,"--close-icon-hover-color":b},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:b,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=(k="two-row")=>a.jsx("div",{...k==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:V(M??0),flexShrink:0,...k==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...k==="two-row"&&o?{pointerEvents:"auto"}:{}}}),rt=()=>{const k=h.find(Me=>Me.prefix==="title1"),oe=h.filter(Me=>Me.prefix==="title2"||Me.prefix==="title3"),ce=oe.length>0||o||(T??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(M??0)>0||o?Qe():null,k&&qe(k,"two-row-top"),v&&Ee()]}),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(Me=>qe(Me,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[je(),ye()]})]}):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]})},lt=()=>a.jsxs(a.Fragment,{children:[(M??0)>0||o?Qe("single-row"):null,h.map(k=>qe(k,"single-row")),o?a.jsxs(a.Fragment,{children:[tt(),et()]}):null,v?Ee():null]}),Lt=s.useCallback(k=>!!(k.closest("[data-controls]")||k.closest(`.${e}-thumbnails`)||k.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:St,backdropStyle:ht,mediaAreaStyle:Pt,overlayContentStyle:Ot,swipeHandlers:At,dismissAreaStyle:Gt}=op({enabled:ue??!1,onClose:yt,animMs:sr,isBlockedTarget:Lt}),Et=()=>{if(!ge||t.length===0)return Je.current=0,0;const k=Ke.current[0],oe=Ke.current[t.length];if(!k||!oe)return Je.current;const ce=oe.offsetLeft-k.offsetLeft;return ce>0&&(Je.current=ce),Je.current},zt=(k=!1)=>{if(!ge)return;const oe=Be.current,ce=Et();!oe||ce<=0||ce<oe.clientWidth*.25||(oe.scrollLeft<=0?(oe.scrollLeft+=ce,k&&(ot.current.scrollLeft+=ce),dt.current&&(De.current+=ce)):oe.scrollLeft>=ce*2&&(oe.scrollLeft-=ce,k&&(ot.current.scrollLeft-=ce),dt.current&&(De.current-=ce)))},Ft=(k,oe=(ce=>(ce=Be.current)==null?void 0:ce.scrollLeft)()??0)=>{if(!ge)return k;let Me=t.length+k,Ue=1/0;for(let ct=0;ct<Re;ct++){const kt=ct*t.length+k,_t=Ke.current[kt];if(!_t)continue;const nn=Math.abs(_t.offsetLeft-oe);nn<Ue&&(Ue=nn,Me=kt)}return Me},pt=k=>{const oe=Be.current;return!k||!oe?!1:k.offsetWidth>oe.clientWidth+1},W=k=>{const oe=Be.current;if(!k||!oe||!pt(k))return!1;const ce=k.offsetLeft,Me=ce+k.offsetWidth;return oe.scrollLeft>=ce-1&&oe.scrollLeft+oe.clientWidth<=Me+1},Le=(k=(oe=>(oe=Be.current)==null?void 0:oe.scrollLeft)()??0)=>{for(let Me=0;Me<Ke.current.length;Me+=1){const Ue=Ke.current[Me];if(Ue&&W(Ue))return Me}let ce={flatIndex:0,distance:1/0};return Ke.current.forEach((Me,Ue)=>{if(!Me)return;const ct=Math.abs(Me.offsetLeft-k);ct<ce.distance&&(ce={flatIndex:Ue,distance:ct})}),ce.flatIndex},Ve=k=>{Be.current&&Ke.current.forEach(oe=>{oe&&(oe.style.scrollSnapAlign=pt(oe)&&k==="backward"?"end":"start")})},Ne=(k,oe,ce)=>{const Me=k-oe,Ue=Le(oe),ct=Ke.current[Ue];if(W(ct))return Le(k)%t.length;const kt=Ke.current[Ue+1],_t=ct?kt?kt.offsetLeft-ct.offsetLeft:ct.offsetWidth:0,nn=_t>0?Me>_t*Br?1:Me<-_t*Br?-1:0:0;return nn===0?ce:ge?(ce+nn+t.length)%t.length:Math.max(0,Math.min(t.length-1,ce+nn))},ft=s.useCallback((k=!1)=>{if(A!=="on"||o)return;const oe=we.current,ce=F.current,Me=Fe.current[ce];if(!oe||!Me||oe.scrollWidth<=oe.clientWidth)return;const Ue=oe.scrollLeft,ct=Ue+oe.clientWidth,kt=Me.offsetLeft,_t=kt+Me.offsetWidth;if(kt>=Ue&&_t<=ct)return;const nn=oe.scrollWidth-oe.clientWidth;let on=Ue;if(!k&&Vt.current===null){const Mi=Fe.current[ce-1],Yn=Fe.current[ce+1],Ai=Mi?Me.offsetLeft-Mi.offsetLeft:Yn?Yn.offsetLeft-Me.offsetLeft:Me.offsetWidth;_t>ct?on+=Ai:kt<Ue&&(on-=Ai)}else _t>ct?on=_t-oe.clientWidth:on=kt;oe.scrollLeft=Math.max(0,Math.min(nn,on))},[o,A]),Nt=s.useCallback((k=!1)=>{k&&(qt.current=!0),jt.current===null&&(jt.current=requestAnimationFrame(()=>{jt.current=null;const oe=qt.current;qt.current=!1,ft(oe)}))},[ft]),mt=s.useCallback(k=>{if(k===F.current)return;const oe=F.current;F.current=k;const ce=Math.abs(k-oe)>1,Me=ge&&t.length>1&&(oe===t.length-1&&k===0||oe===0&&k===t.length-1);re(k),Nt(ce||Me)},[t.length,ge,Nt]),$t=()=>{if(!Be.current||t.length===0||Vt.current!==null||ot.current.isActive&&ot.current.hasMoved)return;const k=Be.current.scrollLeft,oe=Le(k)%t.length;oe!==F.current&&mt(oe)},Yt=()=>{Vt.current=null},Dt=k=>{const oe=Be.current;oe&&(oe.style.scrollSnapType=k?"":"none")},sn=()=>{var k;(k=Ae.current)==null||k.call(Ae),Ae.current=null},ln=()=>{Xe.current!==null&&(cancelAnimationFrame(Xe.current),Xe.current=null),dt.current=!1},qn=()=>{const k=Be.current;if(!k){Xe.current=null,dt.current=!1;return}const oe=De.current-k.scrollLeft;if(Math.abs(oe)<.5){k.scrollLeft=De.current,zt(),$t(),Xe.current=null,dt.current=!1;return}k.scrollLeft+=oe*mx,zt(),$t(),vt(),Xe.current=requestAnimationFrame(qn)},Un=()=>{const k=Ze.current;k&&(k.style.transition="",k.style.transform="",k.style.willChange="")},hn=(k,oe,ce,Me)=>{Un(),k.scrollLeft=oe,gt.current=k.scrollLeft,zt(),ce!==void 0?(F.current=ce,re(ce)):$t(),Dt(!0),Me==null||Me()},Qi=(k,{behavior:oe="smooth",activeIndex:ce,onComplete:Me}={})=>{const Ue=Be.current,ct=Ze.current;if(!Ue||!ct)return;if(ln(),sn(),Dt(!1),oe==="auto"){hn(Ue,k,ce,Me);return}const kt=Math.abs(k-Ue.scrollLeft),_t=ix(kt,sx,lx,Ue.clientWidth*.55);Ae.current=ax(Ue,ct,k,{duration:_t,easing:cx,onComplete:()=>{Ae.current=null,hn(Ue,k,ce,Me)}})},Vo=(k="smooth")=>{const oe=Be.current;if(!oe||t.length===0)return;const ce=Le()%t.length,Me=Ft(ce,oe.scrollLeft),Ue=Ke.current[Me];Ue&&Qi(Ue.offsetLeft,{behavior:k,activeIndex:ce})},Go=(k,oe="smooth",ce,Me)=>{const Ue=Be.current;if(!Ue||t.length===0)return;const ct=(Me??Ue.scrollLeft)-k,kt=Le(k),_t=Ke.current[kt];if(W(_t)){Dt(!0),$t();return}const nn=Ke.current[kt+1],on=_t?nn?nn.offsetLeft-_t.offsetLeft:_t.offsetWidth:0;if((on>0?ct>on*Br?1:ct<-on*Br?-1:0:0)!==0){const Da=ce??kt%t.length,kr=Ne(Me??Ue.scrollLeft,k,Da);xn(kr,oe);return}const Yn=Me??Ue.scrollLeft,Ai=Le(Yn),to=Ke.current[Ai];if(to&&Math.abs(to.offsetLeft-Yn)<1){Dt(!0),$t();return}Vo("auto")},xn=(k,oe="smooth")=>{const ce=Be.current;if(!ce||t.length===0)return;const Me=Ft(k,ce.scrollLeft),Ue=Ke.current[Me];Ue&&(oe==="smooth"?Vt.current=k:Vt.current=null,F.current=k,re(k),Nt(!0),Qi(Ue.offsetLeft,{behavior:oe,activeIndex:k,onComplete:oe==="smooth"?Yt:void 0}))},ci=()=>{Oe.current&&(window.removeEventListener("pointerup",Oe.current),window.removeEventListener("pointercancel",Oe.current),Oe.current=null)},Kn=(k,oe,ce,Me,Ue)=>{const ct=ce-k,kt=Me-oe,_t=Math.abs(ct),nn=Math.abs(kt);if(_t<hx||_t<=nn)return!1;const on=ct<0?1:-1,Mi=ge?(Ue+on+t.length)%t.length:Math.max(0,Math.min(t.length-1,Ue+on));return Mi===Ue?!1:(xn(Mi),!0)},bn=k=>{if(!ot.current.isActive)return;ci();const oe=Be.current;if(!oe)return;const{scrollLeft:ce,startActiveIndex:Me,hasMoved:Ue}=ot.current,ct=oe.scrollLeft;zt(!0),ot.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},Ge(!1),k!==void 0&&oe.hasPointerCapture(k)&&oe.releasePointerCapture(k),Ue?Go(ce,"smooth",Me,ct):(Dt(!0),$t()),vt()},Ei=(k,oe)=>{const ce=st.current;st.current=null,ce&&(Kn(ce.startX,ce.startY,k,oe,ce.startActiveIndex),vt())},eo=k=>{if(!$e)return;if(k.pointerType==="touch"){if(ln(),Dt(!0),Lt(k.target))return;st.current={startX:k.clientX,startY:k.clientY,startActiveIndex:F.current};return}if(k.pointerType!=="mouse"||k.button!==0||Lt(k.target))return;const oe=Be.current;if(!oe)return;ln(),sn(),Un(),Vt.current=null,ot.current={isActive:!0,startX:k.clientX,scrollLeft:oe.scrollLeft,startActiveIndex:F.current,hasMoved:!1},Dt(!1),vt(),oe.setPointerCapture(k.pointerId),ci();const ce=Me=>{Me.pointerType==="mouse"&&bn(Me.pointerId)};Oe.current=ce,window.addEventListener("pointerup",ce),window.addEventListener("pointercancel",ce)},Rr=k=>{if(!$e||k.pointerType!=="mouse")return;const oe=Be.current;if(!oe||!ot.current.isActive)return;if(k.buttons===0){bn(k.pointerId);return}const ce=k.clientX-ot.current.startX;Math.abs(ce)>gx&&(ot.current.hasMoved=!0,Ge(!0)),ot.current.hasMoved&&(k.preventDefault(),oe.scrollLeft=ot.current.scrollLeft-ce,zt(!0),$t(),vt())},Te=k=>{if($e){if(k.pointerType==="touch"){k.type==="pointerup"?Ei(k.clientX,k.clientY):st.current=null;return}k.pointerType==="mouse"&&bn(k.pointerId)}},Ye=k=>{!$e||k.pointerType!=="mouse"||bn(k.pointerId)};return Wl(),s.useEffect(()=>{const k=requestAnimationFrame(()=>It(!0));return()=>{cancelAnimationFrame(k),sn(),ci(),jt.current!==null&&(cancelAnimationFrame(jt.current),jt.current=null),Rt.current&&clearTimeout(Rt.current),Bt.current&&clearTimeout(Bt.current)}},[]),s.useEffect(()=>{if(!ve){wt(!0);return}vt();const k=()=>vt();return document.addEventListener("pointermove",k,{passive:!0}),document.addEventListener("pointerdown",k,{passive:!0}),()=>{document.removeEventListener("pointermove",k),document.removeEventListener("pointerdown",k),Bt.current&&clearTimeout(Bt.current)}},[ve,vt]),s.useEffect(()=>{const k=oe=>{oe.key==="Escape"&&yt()};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[yt]),s.useLayoutEffect(()=>{Et()},[H,t.length,ge]),s.useLayoutEffect(()=>{o||xn(F.current,"auto")},[H,o]),s.useLayoutEffect(()=>{xn(0,"auto")},[t.length,ge]),s.useEffect(()=>{const k=Be.current;if(!k||o||!ue)return;const oe=ce=>{if(ce.preventDefault(),Math.abs(ce.deltaY)<=Math.abs(ce.deltaX))return;const Me=ce.deltaMode===1?px:ce.deltaMode===2?k.clientHeight:1,Ue=ce.deltaY*Me*ux;if(Ue!==0){if(sn(),dt.current||(dt.current=!0,De.current=k.scrollLeft,Vt.current=null,Dt(!1)),De.current+=Ue,!ge){const ct=k.scrollWidth-k.clientWidth;De.current=Math.max(0,Math.min(ct,De.current))}vt(),Xe.current===null&&(Xe.current=requestAnimationFrame(qn))}};return k.addEventListener("wheel",oe,{passive:!1}),()=>{k.removeEventListener("wheel",oe),ln()}},[o,ue,ge]),s.useEffect(()=>{const k=Be.current;if(!k)return;const oe=()=>{zt(ot.current.isActive);const Me=k.scrollLeft,Ue=Me-gt.current;gt.current=Me;const ct=Je.current>0?Je.current*.5:1/0;if(Ue!==0&&Math.abs(Ue)<ct){const kt=Ue>0?"forward":"backward";kt!==ze.current&&(ze.current=kt,Ve(kt))}ot.current.isActive&&ot.current.hasMoved||$t()};k.addEventListener("scroll",oe,{passive:!0});const ce=new ResizeObserver(()=>{Et(),zt(ot.current.isActive),Ve(ze.current),$t()});return ce.observe(k),()=>{sn(),k.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:bt?1:0,transition:`opacity ${sr}ms ease`,pointerEvents:bt?"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,...At,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Pt,onClick:k=>k.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":ut?"true":"false",onPointerDown:eo,onPointerMove:Rr,onPointerUp:Te,onPointerCancel:Te,onLostPointerCapture:Ye,children:a.jsx("div",{ref:Ze,className:`${e}-lightbox-strip-track`,style:{gap:H},children:nt.map((k,oe)=>{const ce=k.image.objectFit??"contain",Me=oe%t.length,Ue=Math.floor(oe/t.length),ct=jr(H),kt=`calc(-0.5 * (${ct} + ${H}))`;return a.jsxs("div",{ref:_t=>Ke.current[oe]=_t,className:`${e}-strip-item`,style:{height:O==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:k.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:ce}}),o&&Me<t.length-1&&Ue===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:kt,width:ct,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ue}-${k.image.url}-${Me}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":rn?"true":"false",style:Ot,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:D,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:Q,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?lt():null})})})]}),t.length>1&&A==="on"&&(()=>{const k=jr(R),oe=`calc(-0.5 * (${R} + ${k}))`;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":w,style:{gap:Y,"--thumbnail-active-color":G},children:[t.map((ce,Me)=>{const Ue=jr(Y),ct=`calc(-0.5 * (${Ue} + ${Y}))`;return a.jsxs("div",{ref:kt=>{Fe.current[Me]=kt},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":z===Me?"true":"false",onClick:()=>ue&&S==="click"&&xn(Me),onMouseEnter:()=>ke&&S==="hover"&&xn(Me),"aria-label":ce.image.name?`View ${ce.image.name}`:`View image ${Me+1}`,"aria-current":z===Me?"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:x,maxHeight:x,width:f.display==="cover"?"auto":"100%",height:"auto",objectFit:f.display==="cover"?"cover":"contain"}})}),o&&Me<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:ct,width:Ue,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${ce.image.url}-${Me}`)}),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:k,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function Px(e){return`
|
|
14325
14325
|
.${e}-wrapper {
|
|
14326
14326
|
position: relative;
|
|
14327
14327
|
width: 100%;
|
|
@@ -14706,7 +14706,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
14706
14706
|
pointer-events: auto;
|
|
14707
14707
|
z-index: 10;
|
|
14708
14708
|
}
|
|
14709
|
-
`}const Ix=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r})=>{const{prefix:l}=
|
|
14709
|
+
`}const Ix=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r})=>{const{prefix:l}=_.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:Px(l)}}),c&&a.jsx("div",{className:`${l}-cover ${ai(d)?`${l}-ratio-wrapper-cover`:`${l}-ratio-wrapper-fit`}`,onClick:()=>g(),style:{...ai(d)?{"--image-aspect-ratio":Wa(d)}:{}},"aria-label":"Open image gallery",children:a.jsx("img",{className:`${l}-cover-image ${ai(d)?`${l}-cover-image-cover`:`${l}-cover-image-fit`}`,src:c,alt:"cover"})})]}),m&&typeof document<"u"&&(()=>{const b=(r?document.getElementById(r):null)??document.body;return Gn.createPortal(a.jsx(Lx,{prefix:l,images:v,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:()=>y(!1)}),b)})()]})},Rx=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
|
|
14710
14710
|
import { createPortal } from 'react-dom';
|
|
14711
14711
|
import { CommonComponentProps } from '../props';
|
|
14712
14712
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -15252,7 +15252,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
15252
15252
|
</>
|
|
15253
15253
|
);
|
|
15254
15254
|
};
|
|
15255
|
-
`,kx="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>'),Oi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",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 Ex(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")]={...Oi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Zt(e,"fontSize")]={...Oi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Zt(e,"lineHeight")]={...Oi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Zt(e,"letterSpacing")]={...Oi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Zt(e,"wordSpacing")]={...Oi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Zt(e,"textAlign")]={...Oi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Zt(e,"textAppearance")]={...Oi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Mx=Ao.reduce((e,t)=>({...e,...Ex(t)}),{}),Ax=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 Fx=$x(),Nx={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"}},...Mx,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:kx,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...Ax},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:[Fx]}],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"}]}},_x={element:Ix,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:Nx,sourceCode:Rx,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")}`}),{})}},Hx=({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:b,maxHeight:S,textTransition:A,title1Width:f,title2Width:w,title3Width:G,title1MarginLeft:q=0,title2MarginLeft:E=0,title3MarginLeft:P=0,titleRowMarginBottom:M=0,titleHeaderLayout:X="single-row",countCloseGap:$=0,closeIcon:T,closeIconMaxWidth:O,closeIconColor:F,closeIconHoverColor:L,contentMarginTop:C=0,iconMarginRight:j=0}=n,x=s.useCallback(Ce=>N.scalingValue(Ce,i??!1),[i]),Y=x(g??0),R=`${b}%`,H=`${S}%`,D=x($),Q=x(C),ae=x(j),z=Vi("title1",ji(n,"title1"),i),re=Vi("title2",ji(n,"title2"),i),_=Vi("title3",ji(n,"title3"),i),le=Vi("count",ji(n,"count"),i),te=X==="mobile",fe=!i||!!r,Pe=!o&&(!i||!!r),xe=s.useMemo(()=>sa(t,y),[t,y]),[ue,K]=s.useState(l),se=xe[ue],de=se==null?void 0:se.entry,[ve,$e]=s.useState(!1),[ke,he]=s.useState(null),[Se,Te]=s.useState(!1),[h,U]=s.useState(null),[Z,ne]=s.useState(!1),[me,B]=s.useState(0),[I,ee]=s.useState(),[ie,pe]=s.useState(),[V,Ie]=s.useState(null),be=s.useRef(null),J=s.useRef(0),He=s.useRef(0),We=s.useRef(0),it=s.useRef(!1),qe=s.useRef(null),tt=s.useRef(null),et=s.useRef(null),je=s.useRef(null),ye=s.useRef(null),_e=s.useRef(null),Be=s.useRef(null),Ze=s.useCallback(()=>{const Ce=tt.current;if(!Ce)return;const Ye=Ce.closest(`.${e}-lightbox-content-area`);if(!Ye)return Ce.getBoundingClientRect().width;const k=Array.from(Ye.children).reduce((oe,ce)=>!(ce instanceof HTMLElement)||ce.contains(Ce)?oe:oe+ce.getBoundingClientRect().width,0);return Ye.getBoundingClientRect().width-k},[e]),we=s.useCallback(()=>{be.current&&(clearTimeout(be.current),be.current=null)},[]),Fe=s.useCallback(Ce=>{Ce===J.current&&(U(null),ne(!1))},[]),Ke=s.useCallback(()=>{o||it.current||(it.current=!0,u==null||u(),$e(!1),qe.current=setTimeout(()=>{p()},300))},[o,u,p]),Je=s.useCallback(Ce=>!!(Ce.closest("[data-controls]")||Ce.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:st,backdropStyle:ot,mediaAreaStyle:Oe,overlayContentStyle:Ae,swipeHandlers:gt,dismissAreaStyle:ze}=op({enabled:Pe,onClose:Ke,animMs:300,isBlockedTarget:Je}),De=s.useCallback(Ce=>{c&&Du(Ce+1,d,!0)},[c,d]),Xe=s.useCallback(Ce=>{if(Ce)return Ce.getBoundingClientRect().height},[]),dt=s.useCallback(Ce=>{if(xe.length===0)return;const Ye=(Ce%xe.length+xe.length)%xe.length;if(Ye===ue)return;const k=xe[ue],oe=xe[Ye];J.current+=1;const ce=J.current,Me=A==="fade"&&Tc(k==null?void 0:k.entry)!==Tc(oe==null?void 0:oe.entry),Ue=Xe(et.current),ct=Me?(()=>{const _t=Ze();Gn.flushSync(()=>{Ie(oe.entry)}),et.current&&_t&&(et.current.style.width=`${_t}px`);const nn=Xe(et.current);return et.current&&(et.current.style.width=""),{measuredIncomingTitlesHeight:nn,incomingTitlesMeasureWidth:_t}})():void 0,kt=Math.max(Ue??0,(ct==null?void 0:ct.measuredIncomingTitlesHeight)??0)||void 0;B(ce),U(ue),ne(!0),K(Ye),De(Ye),We.current=Ye,Me?(we(),kt&&ee(kt),ct!=null&&ct.incomingTitlesMeasureWidth&&pe(ct.incomingTitlesMeasureWidth),he((k==null?void 0:k.entryIndex)??null),Te(!0),He.current=oe.entryIndex,be.current=setTimeout(()=>{he(null),Te(!1),ee(void 0),pe(void 0),Ie(null),be.current=null},400)):(we(),he(null),Te(!1),ee(void 0),pe(void 0),Ie(null),He.current=oe.entryIndex)},[ue,we,Ze,Xe,xe,De,A]),ge=s.useCallback(()=>{Be.current=null},[]),Re=s.useCallback(Ce=>{!fe||xe.length<=1||Ce.pointerType==="mouse"&&Ce.button!==0||Ce.target.closest("[data-controls]")||(Be.current={startX:Ce.clientX,startY:Ce.clientY,pointerId:Ce.pointerId})},[fe,xe.length]),nt=s.useCallback(Ce=>{var _t;if(!fe||xe.length<=1||Ce.pointerType==="mouse"&&Ce.button!==0)return;if(st){ge();return}const Ye=Be.current;if(!Ye||Ye.pointerId!==Ce.pointerId||(ge(),Ce.target.closest("[data-controls]")))return;const oe=Ce.clientX-Ye.startX,ce=Ce.clientY-Ye.startY,Me=Math.abs(oe),Ue=Math.abs(ce);if(Me>=Ky&&Me>Ue){dt(oe>0?ue-1:ue+1);return}if(Me>Sc||Ue>Sc)return;const ct=(_t=je.current)==null?void 0:_t.getBoundingClientRect(),kt=ct?ct.left+ct.width/2:window.innerWidth/2;dt(Ce.clientX<kt?ue-1:ue+1)},[ue,fe,dt,st,ge,xe.length]),ut=s.useCallback(Ce=>{const Ye=Be.current;(Ye==null?void 0:Ye.pointerId)===Ce.pointerId&&ge()},[ge]);Wl(),s.useEffect(()=>{_e.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const Ce=requestAnimationFrame(()=>{$e(!0),requestAnimationFrame(()=>{ye.current?ye.current.focus():je.current&&je.current.focus()})});return()=>{cancelAnimationFrame(Ce),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 Ce;A!=="fade"&&(He.current=((Ce=xe[ue])==null?void 0:Ce.entryIndex)??0,we(),he(null),Te(!1),ee(void 0),pe(void 0))},[ue,we,xe,A]),s.useEffect(()=>{const Ce=Ye=>{if(Ye.key==="Escape"){Ke();return}if(Ye.key==="ArrowLeft"&&xe.length>1){dt(ue-1);return}if(Ye.key==="ArrowRight"&&xe.length>1){dt(ue+1);return}if(Ye.key==="Tab"&&je.current){const k=je.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),oe=Array.from(k).filter(ct=>!ct.closest('[aria-hidden="true"]'));if(oe.length===0)return;const ce=oe[0],Me=oe[oe.length-1],Ue=document.activeElement;Ye.shiftKey?(Ue===ce||!je.current.contains(Ue))&&(Ye.preventDefault(),Me.focus()):(Ue===Me||!je.current.contains(Ue))&&(Ye.preventDefault(),ce.focus())}};return window.addEventListener("keydown",Ce),()=>window.removeEventListener("keydown",Ce)},[dt,Ke,ue,xe.length]),s.useLayoutEffect(()=>{we(),J.current=0,B(0),U(null),ne(!1),he(null),Te(!1),ee(void 0),pe(void 0),Ie(null),K(Ce=>{const Ye=Math.max(0,xe.length-1);return Math.min(Ce,Ye)})},[we,t.length,y,xe.length]),s.useLayoutEffect(()=>{var k;const Ce=Math.max(0,xe.length-1),Ye=Math.min(Math.max(0,l),Ce);We.current=Ye,He.current=((k=xe[Ye])==null?void 0:k.entryIndex)??0,K(Ye)},[l]);const Ge=ke!==null?t[ke]:null,bt=h!==null?xe[h]:null,It=(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),Mt=iv(y,xe,t),wt=T!==null,Vt=It||Mt||wt,jt=Mt&&wt?{gap:D}:void 0,qt=`${e}-titles-stack${te?` ${e}-titles-stack-stacked`:""}`,Ut=`${e}-titles-layer-out${te?` ${e}-titles-layer-out-stacked`:""}`,Rt=`${e}-titles-layer-out`,Bt=(q??0)>0||o,rn=x(M),vt=s.useMemo(()=>({title1Width:f??bo.title1Width,title2Width:w??bo.title2Width,title3Width:G??bo.title3Width}),[f,w,G]),yt=s.useMemo(()=>({title2MarginLeft:E,title3MarginLeft:P}),[E,P]),Ee=s.useMemo(()=>de?bi(e,de,z,re,_):[],[e,de,z,re,_]),Qe=s.useMemo(()=>Ee.map(Ce=>vt[Ce.widthKey]),[Ee,vt]),rt=s.useMemo(()=>Po(Ee.length,Qe),[Ee.length,Qe]),lt=s.useMemo(()=>hr(Ee.length,Qe),[Ee.length,Qe]),Lt=s.useMemo(()=>Ee.filter(Ce=>Ce.prefix==="title1"),[Ee]),St=s.useMemo(()=>Ee.filter(Ce=>Ce.prefix==="title2"||Ce.prefix==="title3"),[Ee]),ht=s.useMemo(()=>Si(Lt,vt),[Lt,vt]),Pt=s.useMemo(()=>Si(St,vt),[St,vt]),Ot=s.useCallback((Ce,Ye)=>{const k=Ee.findIndex(ce=>ce.prefix===Ce.prefix);if(!te||Ye==="single-row")return{effectiveWidth:lt[k]??0,resolvedWidth:rt[k]??0,maxWidth:yn(k,rt)};if(Ye==="two-row-top"){const ce=Lt.findIndex(Me=>Me.prefix===Ce.prefix);return{effectiveWidth:ht.effective[ce]??0,resolvedWidth:ht.resolved[ce]??0,maxWidth:yn(ce,ht.resolved)}}const oe=St.findIndex(ce=>ce.prefix===Ce.prefix);return{effectiveWidth:Pt.effective[oe]??0,resolvedWidth:Pt.resolved[oe]??0,maxWidth:yn(oe,Pt.resolved)}},[Ee,St,Pt,lt,rt,Lt,ht,te]),At=s.useCallback(Ce=>Vu(Ee,rt,yt,Ce)+(te?0:q??0),[Ee,rt,yt,te,q]),Gt=s.useCallback(()=>te?0:q??0,[te,q]),Et=s.useCallback(Ce=>St.slice(0,Ce).reduce((Ye,k,oe)=>Ye+(k.marginLeftKey?yt[k.marginLeftKey]??0:0)+(Pt.resolved[oe]??0),0),[St,Pt.resolved,yt]),zt=s.useCallback(Ce=>{const Ye=St[Ce];return Et(Ce)+(Ye.marginLeftKey?yt[Ye.marginLeftKey]??0:0)+(Pt.resolved[Ce]??0)},[St,Pt.resolved,Et,yt]),Ft=s.useCallback((Ce,Ye,k)=>{if(!te||k==="single-row"){const ct=Ce.findIndex(on=>on.prefix===Ye.prefix),kt=Ce.map(on=>vt[on.widthKey]),_t=Po(Ce.length,kt);return{effectiveWidth:hr(Ce.length,kt)[ct]??0,resolvedWidth:_t[ct]??0,maxWidth:yn(ct,_t)}}if(k==="two-row-top"){const ct=Ce.filter(on=>on.prefix==="title1"),kt=ct.findIndex(on=>on.prefix===Ye.prefix),{resolved:_t,effective:nn}=Si(ct,vt);return{effectiveWidth:nn[kt]??0,resolvedWidth:_t[kt]??0,maxWidth:yn(kt,_t)}}const oe=Ce.filter(ct=>ct.prefix==="title2"||ct.prefix==="title3"),ce=oe.findIndex(ct=>ct.prefix===Ye.prefix),{resolved:Me,effective:Ue}=Si(oe,vt);return{effectiveWidth:Ue[ce]??0,resolvedWidth:Me[ce]??0,maxWidth:yn(ce,Me)}},[vt,te]),pt=(Ce,Ye,k)=>{const oe=Ce.marginLeftKey?yt[Ce.marginLeftKey]??0:0,{effectiveWidth:ce,resolvedWidth:Me,maxWidth:Ue}=k??Ot(Ce,Ye),ct=Math.max(oe,ti),kt=o&&Ye==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":Ce.prefix,style:{width:x(ce),...oe>0?{marginLeft:x(oe)}:{}},children:[a.jsx("p",{className:Ce.className,style:Ce.style,children:Ce.text}),kt&&Ce.marginLeftKey?a.jsx("div",{"data-controls":Ce.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Me),style:{position:"absolute",top:0,left:x(-oe),width:x(ct),height:"100%",pointerEvents:"auto"}}):null,kt?a.jsx("div",{"data-controls":Ce.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,right:x(-Ln/2),width:x(Ln),height:"100%",pointerEvents:"auto"}}):null]},Ce.className)},W=(Ce="two-row")=>{const Ye=Ee.findIndex(ce=>ce.prefix==="title1"),k=Ye>=0?rt[Ye]:vt.title1Width,oe=Ce==="two-row"&&o;return a.jsx("div",{...oe?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(k)}:{},style:{width:x(q??0),flexShrink:0,alignSelf:"stretch",...oe?{pointerEvents:"auto"}:{}}})},Le=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:z,"aria-hidden":"true",children:" "}),Ve=()=>a.jsx("span",{className:`${e}-entry-counter`,style:le,"aria-live":"polite","aria-atomic":"true",children:nv(xe,ue,y,t)}),Ne=()=>Mt?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(D)} + ${D}))`,width:ts(D),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Ve():null,ft=()=>!Mt&&!wt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:jt,children:[Ne(),wt?$t():null]}),Nt=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Mt||It?Le():null,Bt?W("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:[Mt||It?Le():null,Bt?W("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:Se&&I?{minHeight:I}:void 0,children:[a.jsx("div",{ref:et,className:qt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Un(V||de)}),a.jsxs("div",{ref:tt,className:qt,style:{position:Se?"absolute":"relative",inset:Se?0:void 0,width:"100%",...Se&&ie?{width:ie,maxWidth:"100%"}:void 0},children:[Ge&&Se?a.jsx("div",{className:`${Ut} ${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()]}),$t=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:N.scalingValue(O??0,i),height:N.scalingValue(O??0,i),marginRight:ae,"--close-icon-hover-color":L},children:[a.jsx("button",{ref:ye,type:"button",className:`${e}-close-icon-inner`,onClick:Ke,"aria-label":"Close",children:a.jsx(mn,{url:T??"",fill:F,hoverFill:i&&!r?F:L,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"}})]}),Yt=(Ce,Ye)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[Mt||It?Le():null,Bt?W("two-row"):null,Ye!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Ye},children:Ce}):a.jsxs(a.Fragment,{children:[Ce,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),ft()]}),Dt=Ce=>{if(!Ce)return null;const Ye=bi(e,Ce,z,re,_);return a.jsx(a.Fragment,{children:Ye.map(k=>pt(k,"single-row",Ft(Ye,k,"single-row")))})},sn=Ce=>{if(!Ce)return null;const Ye=bi(e,Ce,z,re,_),k=Ye.find(oe=>oe.prefix==="title1");return k?pt(k,"two-row-top",Ft(Ye,k,"two-row-top")):null},ln=(Ce,Ye=!1)=>{const k=Ce?bi(e,Ce,z,re,_):[],oe=k.filter(Ue=>Ue.prefix==="title2"||Ue.prefix==="title3"),ce=o&&Ye;return oe.length>0||ce||(M??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(Ue=>pt(Ue,"two-row-bottom",Ft(k,Ue,"two-row-bottom"))),Ye&&o?a.jsxs(a.Fragment,{children:[Vo(),Go()]}):null]}):null,(M??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=(Ce,Ye=!1)=>a.jsxs(a.Fragment,{children:[Yt(sn(Ce)),ln(Ce,Ye)]}),Un=Ce=>te?a.jsx("div",{className:`${e}-titles-row-two-row`,children:qn(Ce)}):Ce?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Dt(Ce)}):null,hn=()=>{const Ce=te?-1:Ee.findIndex(oe=>oe.prefix==="title1"),Ye=!te&&(o||(q??0)>0)?(()=>{const oe=q??0,ce=Ce>=0?rt[Ce]:vt.title1Width,Me=Math.max(oe,ti);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:x(Me),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,k=Ee.flatMap((oe,ce)=>{if(!oe.marginLeftKey)return[];const Me=yt[oe.marginLeftKey]??0,Ue=ju(Ee,rt,yt,ce)+Gt(),ct=Math.max(Me,ti);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:x(Ue),width:x(ct),height:"100%",pointerEvents:"auto"}},oe.marginLeftKey)});return Ye?[Ye,...k]:k},Qi=()=>Ee.map((Ce,Ye)=>{const k=yn(Ye,rt),ce=At(Ye)-Ln/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Ce.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(k),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:x(ce),width:x(Ln),height:"100%",pointerEvents:"auto"}})},`${Ce.widthKey}-junction`)}),Vo=()=>St.flatMap((Ce,Ye)=>{if(!Ce.marginLeftKey)return[];const k=yt[Ce.marginLeftKey]??0,oe=Et(Ye),ce=Math.max(k,ti),{resolvedWidth:Me}=Ot(Ce,"two-row-bottom");return a.jsx("div",{"data-controls":Ce.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Me),style:{position:"absolute",top:0,left:x(oe),width:x(ce),height:"100%",pointerEvents:"auto"}},Ce.marginLeftKey)}),Go=()=>St.map((Ce,Ye)=>{const{maxWidth:k}=Ot(Ce,"two-row-bottom"),ce=zt(Ye)-Ln/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Ce.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(k),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:x(ce),width:x(Ln),height:"100%",pointerEvents:"auto"}})},`${Ce.widthKey}-junction`)}),xn=()=>!o||te?null:a.jsxs(a.Fragment,{children:[hn(),Qi()]}),ci=Ce=>{const Ye=!Ce.objectFit&&ai(v);return{className:`${e}-slide-image-cell${Ye?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:R,maxHeight:H,...Ye?{"--image-aspect-ratio":Wa(v)}:{}}}},Kn=Ce=>Ce.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":Ce.objectFit}}:ai(v)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},bn=Ce=>{if(Ce.length===0)return null;const Ye=Ce.length>1,k=ts(Y),oe=`calc(-0.5 * (${k} + ${Y}))`;if(Ce.length===1){const ce=Ce[0];return a.jsx("div",{...ci(ce),children:a.jsx("img",{...Kn(ce),src:ce.url,alt:ce.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:Ye?{gap:Y}:void 0,children:Ce.map((ce,Me)=>a.jsxs("div",{...ci(ce),children:[a.jsx("img",{...Kn(ce),src:ce.url,alt:ce.name??"",draggable:!1}),o&&Ye&&Me<Ce.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:oe,width:k,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${ce.url}-${Me}`))})},Ei=!!(de!=null&&de.title2||de!=null&&de.title3||Ge!=null&&Ge.title2||Ge!=null&&Ge.title3||(M??0)>0||o),eo=()=>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:qt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:qn(V||de)}),a.jsxs("div",{ref:tt,className:`${e}-titles-row-two-row`,style:{...Se&&I?{minHeight:I}:void 0,...Se&&ie?{width:ie,maxWidth:"100%"}:void 0},children:[Yt(a.jsxs("div",{className:qt,style:{position:Se?"absolute":"relative",inset:Se?0:void 0,width:"100%"},children:[Ge&&Se?a.jsx("div",{className:`${Rt} ${e}-titles-fade-out`,children:sn(Ge)}):null,a.jsx("div",{className:`${e}-titles-layer-in${Se?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:sn(de)})]}),Se&&I?I:void 0),Ei?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[Ge&&Se?a.jsx("div",{className:`${Ut} ${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`:""}${te?` ${e}-titles-layer-in-stacked`:""}`,children:ln(de,!0)})]}):null]})]}),Rr=()=>{const Ce=Ei;return a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...Ce?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:Ce?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||Ke()},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,...ot}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:ze,...gt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Oe,onClick:Ce=>Ce.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":fe&&xe.length>1?"true":"false",onPointerDown:fe?Re:void 0,onPointerUp:fe?nt:void 0,onPointerCancel:fe?ut:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[bt&&Z?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:Ce=>{Ce.target===Ce.currentTarget&&Fe(me)},children:a.jsx("div",{className:`${e}-slide-area`,children:bn(bt.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}-${ue}`)]})})}),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:Q,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...te?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${te?` ${e}-lightbox-content-area-stacked`:""}`,children:Vt&&a.jsx("div",{className:`${e}-text-bar-cell${te?` ${e}-text-bar-cell-stacked`:""}`,style:te?void 0:{flex:1,minWidth:0,width:"100%"},children:te?A==="fade"?eo():Rr():A==="fade"?mt():Nt()})})})]})]})]})};function Wx(e){return`
|
|
15255
|
+
`,kx="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>'),Oi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",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 Ex(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")]={...Oi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Zt(e,"fontSize")]={...Oi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Zt(e,"lineHeight")]={...Oi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Zt(e,"letterSpacing")]={...Oi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Zt(e,"wordSpacing")]={...Oi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Zt(e,"textAlign")]={...Oi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Zt(e,"textAppearance")]={...Oi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Mx=Ao.reduce((e,t)=>({...e,...Ex(t)}),{}),Ax=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 Fx=$x(),Nx={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"}},...Mx,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:kx,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...Ax},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:[Fx]}],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"}]}},_x={element:Ix,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:Nx,sourceCode:Rx,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")}`}),{})}},Hx=({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:b,maxHeight:S,textTransition:A,title1Width:f,title2Width:w,title3Width:G,title1MarginLeft:q=0,title2MarginLeft:E=0,title3MarginLeft:P=0,titleRowMarginBottom:M=0,titleHeaderLayout:X="single-row",countCloseGap:$=0,closeIcon:T,closeIconMaxWidth:O,closeIconColor:N,closeIconHoverColor:L,contentMarginTop:C=0,iconMarginRight:j=0}=n,x=s.useCallback(Te=>_.scalingValue(Te,i??!1),[i]),Y=x(g??0),R=`${b}%`,H=`${S}%`,D=x($),Q=x(C),ae=x(j),z=Vi("title1",ji(n,"title1"),i),re=Vi("title2",ji(n,"title2"),i),F=Vi("title3",ji(n,"title3"),i),le=Vi("count",ji(n,"count"),i),te=X==="mobile",fe=!i||!!r,Pe=!o&&(!i||!!r),xe=s.useMemo(()=>sa(t,y),[t,y]),[de,K]=s.useState(l),se=xe[de],ue=se==null?void 0:se.entry,[ve,$e]=s.useState(!1),[ke,he]=s.useState(null),[Se,Ce]=s.useState(!1),[h,U]=s.useState(null),[Z,ne]=s.useState(!1),[me,B]=s.useState(0),[I,ee]=s.useState(),[ie,pe]=s.useState(),[V,Ie]=s.useState(null),be=s.useRef(null),J=s.useRef(0),He=s.useRef(0),We=s.useRef(0),it=s.useRef(!1),qe=s.useRef(null),tt=s.useRef(null),et=s.useRef(null),je=s.useRef(null),ye=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 k=Array.from(Ye.children).reduce((oe,ce)=>!(ce instanceof HTMLElement)||ce.contains(Te)?oe:oe+ce.getBoundingClientRect().width,0);return Ye.getBoundingClientRect().width-k},[e]),we=s.useCallback(()=>{be.current&&(clearTimeout(be.current),be.current=null)},[]),Fe=s.useCallback(Te=>{Te===J.current&&(U(null),ne(!1))},[]),Ke=s.useCallback(()=>{o||it.current||(it.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:ot,mediaAreaStyle:Oe,overlayContentStyle:Ae,swipeHandlers:gt,dismissAreaStyle:ze}=op({enabled:Pe,onClose:Ke,animMs:300,isBlockedTarget:Je}),De=s.useCallback(Te=>{c&&Du(Te+1,d,!0)},[c,d]),Xe=s.useCallback(Te=>{if(Te)return Te.getBoundingClientRect().height},[]),dt=s.useCallback(Te=>{if(xe.length===0)return;const Ye=(Te%xe.length+xe.length)%xe.length;if(Ye===de)return;const k=xe[de],oe=xe[Ye];J.current+=1;const ce=J.current,Me=A==="fade"&&Tc(k==null?void 0:k.entry)!==Tc(oe==null?void 0:oe.entry),Ue=Xe(et.current),ct=Me?(()=>{const _t=Ze();Gn.flushSync(()=>{Ie(oe.entry)}),et.current&&_t&&(et.current.style.width=`${_t}px`);const nn=Xe(et.current);return et.current&&(et.current.style.width=""),{measuredIncomingTitlesHeight:nn,incomingTitlesMeasureWidth:_t}})():void 0,kt=Math.max(Ue??0,(ct==null?void 0:ct.measuredIncomingTitlesHeight)??0)||void 0;B(ce),U(de),ne(!0),K(Ye),De(Ye),We.current=Ye,Me?(we(),kt&&ee(kt),ct!=null&&ct.incomingTitlesMeasureWidth&&pe(ct.incomingTitlesMeasureWidth),he((k==null?void 0:k.entryIndex)??null),Ce(!0),He.current=oe.entryIndex,be.current=setTimeout(()=>{he(null),Ce(!1),ee(void 0),pe(void 0),Ie(null),be.current=null},400)):(we(),he(null),Ce(!1),ee(void 0),pe(void 0),Ie(null),He.current=oe.entryIndex)},[de,we,Ze,Xe,xe,De,A]),ge=s.useCallback(()=>{Be.current=null},[]),Re=s.useCallback(Te=>{!fe||xe.length<=1||Te.pointerType==="mouse"&&Te.button!==0||Te.target.closest("[data-controls]")||(Be.current={startX:Te.clientX,startY:Te.clientY,pointerId:Te.pointerId})},[fe,xe.length]),nt=s.useCallback(Te=>{var _t;if(!fe||xe.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,Me=Math.abs(oe),Ue=Math.abs(ce);if(Me>=Ky&&Me>Ue){dt(oe>0?de-1:de+1);return}if(Me>Sc||Ue>Sc)return;const ct=(_t=je.current)==null?void 0:_t.getBoundingClientRect(),kt=ct?ct.left+ct.width/2:window.innerWidth/2;dt(Te.clientX<kt?de-1:de+1)},[de,fe,dt,st,ge,xe.length]),ut=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(()=>{ye.current?ye.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;A!=="fade"&&(He.current=((Te=xe[de])==null?void 0:Te.entryIndex)??0,we(),he(null),Ce(!1),ee(void 0),pe(void 0))},[de,we,xe,A]),s.useEffect(()=>{const Te=Ye=>{if(Ye.key==="Escape"){Ke();return}if(Ye.key==="ArrowLeft"&&xe.length>1){dt(de-1);return}if(Ye.key==="ArrowRight"&&xe.length>1){dt(de+1);return}if(Ye.key==="Tab"&&je.current){const k=je.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),oe=Array.from(k).filter(ct=>!ct.closest('[aria-hidden="true"]'));if(oe.length===0)return;const ce=oe[0],Me=oe[oe.length-1],Ue=document.activeElement;Ye.shiftKey?(Ue===ce||!je.current.contains(Ue))&&(Ye.preventDefault(),Me.focus()):(Ue===Me||!je.current.contains(Ue))&&(Ye.preventDefault(),ce.focus())}};return window.addEventListener("keydown",Te),()=>window.removeEventListener("keydown",Te)},[dt,Ke,de,xe.length]),s.useLayoutEffect(()=>{we(),J.current=0,B(0),U(null),ne(!1),he(null),Ce(!1),ee(void 0),pe(void 0),Ie(null),K(Te=>{const Ye=Math.max(0,xe.length-1);return Math.min(Te,Ye)})},[we,t.length,y,xe.length]),s.useLayoutEffect(()=>{var k;const Te=Math.max(0,xe.length-1),Ye=Math.min(Math.max(0,l),Te);We.current=Ye,He.current=((k=xe[Ye])==null?void 0:k.entryIndex)??0,K(Ye)},[l]);const Ge=ke!==null?t[ke]:null,bt=h!==null?xe[h]:null,It=(ue==null?void 0:ue.title1)||(ue==null?void 0:ue.title2)||(ue==null?void 0:ue.title3)||(Ge==null?void 0:Ge.title1)||(Ge==null?void 0:Ge.title2)||(Ge==null?void 0:Ge.title3),Mt=iv(y,xe,t),wt=T!==null,Vt=It||Mt||wt,jt=Mt&&wt?{gap:D}:void 0,qt=`${e}-titles-stack${te?` ${e}-titles-stack-stacked`:""}`,Ut=`${e}-titles-layer-out${te?` ${e}-titles-layer-out-stacked`:""}`,Rt=`${e}-titles-layer-out`,Bt=(q??0)>0||o,rn=x(M),vt=s.useMemo(()=>({title1Width:f??bo.title1Width,title2Width:w??bo.title2Width,title3Width:G??bo.title3Width}),[f,w,G]),yt=s.useMemo(()=>({title2MarginLeft:E,title3MarginLeft:P}),[E,P]),Ee=s.useMemo(()=>ue?bi(e,ue,z,re,F):[],[e,ue,z,re,F]),Qe=s.useMemo(()=>Ee.map(Te=>vt[Te.widthKey]),[Ee,vt]),rt=s.useMemo(()=>Po(Ee.length,Qe),[Ee.length,Qe]),lt=s.useMemo(()=>hr(Ee.length,Qe),[Ee.length,Qe]),Lt=s.useMemo(()=>Ee.filter(Te=>Te.prefix==="title1"),[Ee]),St=s.useMemo(()=>Ee.filter(Te=>Te.prefix==="title2"||Te.prefix==="title3"),[Ee]),ht=s.useMemo(()=>Si(Lt,vt),[Lt,vt]),Pt=s.useMemo(()=>Si(St,vt),[St,vt]),Ot=s.useCallback((Te,Ye)=>{const k=Ee.findIndex(ce=>ce.prefix===Te.prefix);if(!te||Ye==="single-row")return{effectiveWidth:lt[k]??0,resolvedWidth:rt[k]??0,maxWidth:yn(k,rt)};if(Ye==="two-row-top"){const ce=Lt.findIndex(Me=>Me.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:Pt.effective[oe]??0,resolvedWidth:Pt.resolved[oe]??0,maxWidth:yn(oe,Pt.resolved)}},[Ee,St,Pt,lt,rt,Lt,ht,te]),At=s.useCallback(Te=>Vu(Ee,rt,yt,Te)+(te?0:q??0),[Ee,rt,yt,te,q]),Gt=s.useCallback(()=>te?0:q??0,[te,q]),Et=s.useCallback(Te=>St.slice(0,Te).reduce((Ye,k,oe)=>Ye+(k.marginLeftKey?yt[k.marginLeftKey]??0:0)+(Pt.resolved[oe]??0),0),[St,Pt.resolved,yt]),zt=s.useCallback(Te=>{const Ye=St[Te];return Et(Te)+(Ye.marginLeftKey?yt[Ye.marginLeftKey]??0:0)+(Pt.resolved[Te]??0)},[St,Pt.resolved,Et,yt]),Ft=s.useCallback((Te,Ye,k)=>{if(!te||k==="single-row"){const ct=Te.findIndex(on=>on.prefix===Ye.prefix),kt=Te.map(on=>vt[on.widthKey]),_t=Po(Te.length,kt);return{effectiveWidth:hr(Te.length,kt)[ct]??0,resolvedWidth:_t[ct]??0,maxWidth:yn(ct,_t)}}if(k==="two-row-top"){const ct=Te.filter(on=>on.prefix==="title1"),kt=ct.findIndex(on=>on.prefix===Ye.prefix),{resolved:_t,effective:nn}=Si(ct,vt);return{effectiveWidth:nn[kt]??0,resolvedWidth:_t[kt]??0,maxWidth:yn(kt,_t)}}const oe=Te.filter(ct=>ct.prefix==="title2"||ct.prefix==="title3"),ce=oe.findIndex(ct=>ct.prefix===Ye.prefix),{resolved:Me,effective:Ue}=Si(oe,vt);return{effectiveWidth:Ue[ce]??0,resolvedWidth:Me[ce]??0,maxWidth:yn(ce,Me)}},[vt,te]),pt=(Te,Ye,k)=>{const oe=Te.marginLeftKey?yt[Te.marginLeftKey]??0:0,{effectiveWidth:ce,resolvedWidth:Me,maxWidth:Ue}=k??Ot(Te,Ye),ct=Math.max(oe,ti),kt=o&&Ye==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":Te.prefix,style:{width:x(ce),...oe>0?{marginLeft:x(oe)}:{}},children:[a.jsx("p",{className:Te.className,style:Te.style,children:Te.text}),kt&&Te.marginLeftKey?a.jsx("div",{"data-controls":Te.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Me),style:{position:"absolute",top:0,left:x(-oe),width:x(ct),height:"100%",pointerEvents:"auto"}}):null,kt?a.jsx("div",{"data-controls":Te.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,right:x(-Ln/2),width:x(Ln),height:"100%",pointerEvents:"auto"}}):null]},Te.className)},W=(Te="two-row")=>{const Ye=Ee.findIndex(ce=>ce.prefix==="title1"),k=Ye>=0?rt[Ye]:vt.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(k)}:{},style:{width:x(q??0),flexShrink:0,alignSelf:"stretch",...oe?{pointerEvents:"auto"}:{}}})},Le=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:z,"aria-hidden":"true",children:" "}),Ve=()=>a.jsx("span",{className:`${e}-entry-counter`,style:le,"aria-live":"polite","aria-atomic":"true",children:nv(xe,de,y,t)}),Ne=()=>Mt?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(D)} + ${D}))`,width:ts(D),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Ve():null,ft=()=>!Mt&&!wt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:jt,children:[Ne(),wt?$t():null]}),Nt=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Mt||It?Le():null,Bt?W("single-row"):null,Dt(ue),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:[Mt||It?Le():null,Bt?W("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:Se&&I?{minHeight:I}:void 0,children:[a.jsx("div",{ref:et,className:qt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Un(V||ue)}),a.jsxs("div",{ref:tt,className:qt,style:{position:Se?"absolute":"relative",inset:Se?0:void 0,width:"100%",...Se&&ie?{width:ie,maxWidth:"100%"}:void 0},children:[Ge&&Se?a.jsx("div",{className:`${Ut} ${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(ue)})]})]}),ft(),xn()]}),$t=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:_.scalingValue(O??0,i),height:_.scalingValue(O??0,i),marginRight:ae,"--close-icon-hover-color":L},children:[a.jsx("button",{ref:ye,type:"button",className:`${e}-close-icon-inner`,onClick:Ke,"aria-label":"Close",children:a.jsx(mn,{url:T??"",fill:N,hoverFill:i&&!r?N:L,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"}})]}),Yt=(Te,Ye)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[Mt||It?Le():null,Bt?W("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=bi(e,Te,z,re,F);return a.jsx(a.Fragment,{children:Ye.map(k=>pt(k,"single-row",Ft(Ye,k,"single-row")))})},sn=Te=>{if(!Te)return null;const Ye=bi(e,Te,z,re,F),k=Ye.find(oe=>oe.prefix==="title1");return k?pt(k,"two-row-top",Ft(Ye,k,"two-row-top")):null},ln=(Te,Ye=!1)=>{const k=Te?bi(e,Te,z,re,F):[],oe=k.filter(Ue=>Ue.prefix==="title2"||Ue.prefix==="title3"),ce=o&&Ye;return oe.length>0||ce||(M??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(Ue=>pt(Ue,"two-row-bottom",Ft(k,Ue,"two-row-bottom"))),Ye&&o?a.jsxs(a.Fragment,{children:[Vo(),Go()]}):null]}):null,(M??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:[Yt(sn(Te)),ln(Te,Ye)]}),Un=Te=>te?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,hn=()=>{const Te=te?-1:Ee.findIndex(oe=>oe.prefix==="title1"),Ye=!te&&(o||(q??0)>0)?(()=>{const oe=q??0,ce=Te>=0?rt[Te]:vt.title1Width,Me=Math.max(oe,ti);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:x(Me),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,k=Ee.flatMap((oe,ce)=>{if(!oe.marginLeftKey)return[];const Me=yt[oe.marginLeftKey]??0,Ue=ju(Ee,rt,yt,ce)+Gt(),ct=Math.max(Me,ti);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:x(Ue),width:x(ct),height:"100%",pointerEvents:"auto"}},oe.marginLeftKey)});return Ye?[Ye,...k]:k},Qi=()=>Ee.map((Te,Ye)=>{const k=yn(Ye,rt),ce=At(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(k),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:x(ce),width:x(Ln),height:"100%",pointerEvents:"auto"}})},`${Te.widthKey}-junction`)}),Vo=()=>St.flatMap((Te,Ye)=>{if(!Te.marginLeftKey)return[];const k=yt[Te.marginLeftKey]??0,oe=Et(Ye),ce=Math.max(k,ti),{resolvedWidth:Me}=Ot(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(Me),style:{position:"absolute",top:0,left:x(oe),width:x(ce),height:"100%",pointerEvents:"auto"}},Te.marginLeftKey)}),Go=()=>St.map((Te,Ye)=>{const{maxWidth:k}=Ot(Te,"two-row-bottom"),ce=zt(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(k),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:x(ce),width:x(Ln),height:"100%",pointerEvents:"auto"}})},`${Te.widthKey}-junction`)}),xn=()=>!o||te?null:a.jsxs(a.Fragment,{children:[hn(),Qi()]}),ci=Te=>{const Ye=!Te.objectFit&&ai(v);return{className:`${e}-slide-image-cell${Ye?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:R,maxHeight:H,...Ye?{"--image-aspect-ratio":Wa(v)}:{}}}},Kn=Te=>Te.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":Te.objectFit}}:ai(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,k=ts(Y),oe=`calc(-0.5 * (${k} + ${Y}))`;if(Te.length===1){const ce=Te[0];return a.jsx("div",{...ci(ce),children:a.jsx("img",{...Kn(ce),src:ce.url,alt:ce.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:Ye?{gap:Y}:void 0,children:Te.map((ce,Me)=>a.jsxs("div",{...ci(ce),children:[a.jsx("img",{...Kn(ce),src:ce.url,alt:ce.name??"",draggable:!1}),o&&Ye&&Me<Te.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:oe,width:k,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${ce.url}-${Me}`))})},Ei=!!(ue!=null&&ue.title2||ue!=null&&ue.title3||Ge!=null&&Ge.title2||Ge!=null&&Ge.title3||(M??0)>0||o),eo=()=>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:qt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:qn(V||ue)}),a.jsxs("div",{ref:tt,className:`${e}-titles-row-two-row`,style:{...Se&&I?{minHeight:I}:void 0,...Se&&ie?{width:ie,maxWidth:"100%"}:void 0},children:[Yt(a.jsxs("div",{className:qt,style:{position:Se?"absolute":"relative",inset:Se?0:void 0,width:"100%"},children:[Ge&&Se?a.jsx("div",{className:`${Rt} ${e}-titles-fade-out`,children:sn(Ge)}):null,a.jsx("div",{className:`${e}-titles-layer-in${Se?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:sn(ue)})]}),Se&&I?I:void 0),Ei?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[Ge&&Se?a.jsx("div",{className:`${Ut} ${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`:""}${te?` ${e}-titles-layer-in-stacked`:""}`,children:ln(ue,!0)})]}):null]})]}),Rr=()=>{const Te=Ei;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(ue,!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||Ke()},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,...ot}}),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":fe&&xe.length>1?"true":"false",onPointerDown:fe?Re:void 0,onPointerUp:fe?nt:void 0,onPointerCancel:fe?ut:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[bt&&Z?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:Te=>{Te.target===Te.currentTarget&&Fe(me)},children:a.jsx("div",{className:`${e}-slide-area`,children:bn(bt.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}-${de}`)]})})}),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:Q,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...te?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${te?` ${e}-lightbox-content-area-stacked`:""}`,children:Vt&&a.jsx("div",{className:`${e}-text-bar-cell${te?` ${e}-text-bar-cell-stacked`:""}`,style:te?void 0:{flex:1,minWidth:0,width:"100%"},children:te?A==="fade"?eo():Rr():A==="fade"?mt():Nt()})})})]})]})]})};function Wx(e){return`
|
|
15256
15256
|
.${e}-wrapper {
|
|
15257
15257
|
position: relative;
|
|
15258
15258
|
width: 100%;
|
|
@@ -15774,7 +15774,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
15774
15774
|
pointer-events: auto;
|
|
15775
15775
|
z-index: 10;
|
|
15776
15776
|
}
|
|
15777
|
-
`}const Ox=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r,metadata:l})=>{const{prefix:c}=
|
|
15777
|
+
`}const Ox=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r,metadata:l})=>{const{prefix:c}=_.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),[b,S]=s.useState(0),A=s.useRef(!1),f=s.useRef(!1),w=s.useRef(!1),G=s.useMemo(()=>(t??[]).filter($=>Lo($).length>0),[t]),q=m&&G.length>0,E=!n,P=s.useCallback(()=>{E&&(w.current=!0,Zy(f.current,d),f.current=!1)},[E,d]),M=($=0)=>{if(G.length===0||n&&!i&&!o)return;const T=sa(G,y),O=Math.max(0,Math.min($,T.length-1));if(S(O),E){const N=zu();Du(O+1,d,N),f.current=!N}g(!0)},X=s.useCallback(()=>{g(!1),w.current=!1},[]);return s.useEffect(()=>{!n||i||o||g(!1)},[n,i,o]),s.useEffect(()=>{if(!E||typeof window>"u")return;const $=window.history.scrollRestoration;return window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration=$}},[E]),s.useEffect(()=>{if(!E||A.current)return;A.current=!0;const $=$c(d);if(!$)return;const T=Cc($,sa(G,y).length);T<0||(S(T),g(!0))},[G,d,E,y]),s.useEffect(()=>{if(!E)return;const $=()=>{if(w.current){w.current=!1,g(!1);return}const T=$c(d);if(!T){g(!1);return}const O=Cc(T,sa(G,y).length);if(O<0){g(!1);return}f.current=!1,S(O),g(!0)};return window.addEventListener("popstate",$),()=>window.removeEventListener("popstate",$)},[G,d,E,y]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:v,className:`${c}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Wx(c)}}),u?a.jsx("button",{type:"button",className:`${c}-cover ${ai(p)?`${c}-ratio-wrapper-cover`:`${c}-ratio-wrapper-fit`}`,onClick:()=>M(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...ai(p)?{"--image-aspect-ratio":Wa(p)}:{}},"aria-label":"Open journal gallery",children:a.jsx("img",{className:`${c}-cover-image ${ai(p)?`${c}-cover-image-cover`:`${c}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),q&&typeof document<"u"&&(()=>{const $=(r?document.getElementById(r):null)??document.body;return Gn.createPortal(a.jsx(Hx,{prefix:c,entries:G,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:b,enableUrlSync:E,journalItemId:d,onBeforeClose:P,onClose:X}),$)})()]})},Dx=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
|
|
15778
15778
|
import { createPortal } from 'react-dom';
|
|
15779
15779
|
import { CommonComponentProps } from '../props';
|
|
15780
15780
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -16574,7 +16574,7 @@ export type LightboxJournalSettings = {
|
|
|
16574
16574
|
width: 32px;
|
|
16575
16575
|
height: 32px;
|
|
16576
16576
|
}
|
|
16577
|
-
`}function Zx(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 Jx(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await Zx(i)]));return new Map(n)}function Qx({settings:e,content:t=[],isEditor:n}){const{prefix:i}=
|
|
16577
|
+
`}function Zx(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 Jx(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await Zx(i)]));return new Map(n)}function Qx({settings:e,content:t=[],isEditor:n}){const{prefix:i}=_.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"),b=s.useRef({x:0,y:0}),[S,A]=s.useState(!1),[f,w]=s.useState(!1),G=s.useRef(new Map),{imageSize:q=Ux,cursor:E="system",target:P="area",position:M="random",visible:X="all",defaultCursor:$=null,hoverCursor:T=null}=e,O=t.filter(R=>{var H;return!!((H=R==null?void 0:R.image)!=null&&H.url)}),N=s.useMemo(()=>Yx(i),[i]),L=s.useCallback((R,H,D=l)=>{if(!o)return;const Q=o.getBoundingClientRect(),ae=R-Q.left,z=H-Q.top;v({x:ae,y:z}),g(Kx(ae,z,D,o,E,P,T,$))},[o,l,E,P,T,$]);s.useEffect(()=>{const R=[...O.map(D=>D.image.url),$,T].filter(D=>!!D);if(R.length===0){G.current=new Map,w(!0);return}let H=!1;return w(!1),Jx(R).then(D=>{H||(G.current=D,w(!0))}),()=>{H=!0}},[t,$,T]),s.useEffect(()=>{if(!o)return;const R=D=>{D.stopPropagation(),b.current={x:D.clientX,y:D.clientY},L(D.clientX,D.clientY)},H=()=>{S&&L(b.current.x,b.current.y)};return o.addEventListener("mousemove",R),window.addEventListener("scroll",H,!0),()=>{o.removeEventListener("mousemove",R),window.removeEventListener("scroll",H,!0)}},[o,S,L]),s.useEffect(()=>{!o||!S||L(b.current.x,b.current.y)},[l,o,S,L]),s.useEffect(()=>{S||g("none")},[S]);const C=(R,H,D,Q={})=>{var te,fe;if(!((te=R==null?void 0:R.image)!=null&&te.url))return null;const ae=((fe=G.current.get(R.image.url))==null?void 0:fe.aspectRatio)??1,z=Jc(R.image.url,q,G.current),{heightPx:re}=xa(z,ae);let F=0,le=0;return M==="same"?{x:F,y:le}=Zc(H,D,z,ae):(F=Q.x??Math.random()*H,le=Q.y??Math.random()*D,{x:F,y:le}=Vs(F,le,H,D,z,re)),{id:p.current++,url:R.image.url,link:R.link,name:R.image.name,x:F,y:le,xRatio:F/H,yRatio:le/D,aspectRatio:ae,widthPx:z}},j=()=>{if(!o)return;const R=o.getBoundingClientRect(),H=R.width,D=R.height;H===0||D===0||c(Q=>Q.length===0?Q:Q.map(ae=>{const z=q.sizeType==="random"?ae.widthPx:Jc(ae.url,q,G.current),{heightPx:re}=xa(z,ae.aspectRatio);if(M==="same"){const{x:te,y:fe}=Zc(H,D,z,ae.aspectRatio);return{...ae,x:te,y:fe,widthPx:z}}const{x:F,y:le}=Vs(ae.xRatio*H,ae.yRatio*D,H,D,z,re);return{...ae,x:F,y:le,widthPx:z}}))};s.useEffect(()=>{if(!o||O.length===0||!f)return;const R=o.getBoundingClientRect(),H=R.width,D=R.height,Q=C(O[0],H,D);Q&&(c([Q]),u(O.length>1?1:0))},[q,M,o,t,f]),s.useEffect(()=>{if(!o)return;j();const R=new ResizeObserver(j);return R.observe(o),window.addEventListener("resize",j),()=>{R.disconnect(),window.removeEventListener("resize",j)}},[o,M,q,l.length]),s.useEffect(()=>{X==="last One"&&c(R=>R.length>0?[R[R.length-1]]:[])},[X]);const x=R=>{if(!o||O.length===0||!f)return;const H=o.getBoundingClientRect(),D=R.clientX-H.left,Q=R.clientY-H.top;if(P==="image"&&!ap(D,Q,l))return;let ae=0,z=0;M==="on Click"?(ae=D,z=Q):M==="same"?(ae=H.width/2,z=H.height/2):(ae=Math.random()*H.width,z=Math.random()*H.height);const re=O[d%O.length],F=C(re,H.width,H.height,{x:ae,y:z});if(!F)return;const le=X==="all"?[...l,F]:[F];c(le),u(te=>(te+1)%O.length),L(R.clientX,R.clientY,le)},Y=E==="custom"&&m!=="none";return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:N}}),a.jsxs("div",{ref:r,onClick:x,onMouseEnter:()=>A(!0),onMouseLeave:()=>A(!1),className:`${i}-root`,style:{cursor:Y?"none":"default"},children:[l.map(R=>a.jsx("div",{className:`${i}-wrapper`,style:{top:`${R.y}px`,left:`${R.x}px`,width:`${R.widthPx}px`,cursor:Y?"none":"default"},children:P==="area"&&R.link?a.jsx("a",{href:R.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:a.jsx("img",{src:R.url,alt:R.name,className:`${i}-image`})}):a.jsx("img",{src:R.url,alt:R.name,className:`${i}-image`})},R.id)),S&&Y&&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 eb=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
16578
16578
|
import { CommonComponentProps } from '../props';
|
|
16579
16579
|
import { useScopedStyles } from '../utils/index';
|
|
16580
16580
|
|
|
@@ -17214,7 +17214,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
17214
17214
|
display: block;
|
|
17215
17215
|
pointer-events: none;
|
|
17216
17216
|
}
|
|
17217
|
-
`}function ab(e){return e==="blur"?ob:e==="greyscale"?ib:0}function Uo(e,t=1,n=1){const i=ab(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 Qc(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function sb(e,t){return t<=1?0:(e-1+t)%t}function lb(e,t=1){return!e||e.height===0?t:e.width/e.height}function cb(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 ed(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 sp(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function td(e,t,n){return{...sp(e),[`--${n}-stage-scale`]:t}}function db(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 ub({settings:e,content:t,isEditor:n,isPreviewMode:i}){var
|
|
17217
|
+
`}function ab(e){return e==="blur"?ob:e==="greyscale"?ib:0}function Uo(e,t=1,n=1){const i=ab(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 Qc(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function sb(e,t){return t<=1?0:(e-1+t)%t}function lb(e,t=1){return!e||e.height===0?t:e.width/e.height}function cb(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 ed(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 sp(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function td(e,t,n){return{...sp(e),[`--${n}-stage-scale`]:t}}function db(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 ub({settings:e,content:t,isEditor:n,isPreviewMode:i}){var Ce,h,U,Z,ne,me,B;const{prefix:o}=_.useScopedStyles(),r=s.useMemo(()=>rb(o),[o]),{imageSize:l,maxWidth:c,maxHeight:d,transition:u=1e3,bgImage:p="greyscale"}=e,y=t??[],v=Qc(y.length),[m,g]=s.useState(v.activeIndex),[b,S]=s.useState(v.backgroundIndex),[A,f]=s.useState(!1),[w,G]=s.useState(!1),[q,E]=s.useState(null),[P,M]=s.useState(null),[X,$]=s.useState(0),[T,O]=s.useState(1),[N,L]=s.useState("none"),[C,j]=s.useState("next"),[x,Y]=s.useState({}),[R,H]=s.useState({width:0,height:0}),D=s.useRef(null),Q=s.useRef(null),ae=!n||!!i,z=l??60,re=Math.max(10,Math.min(100,c??z)),F=Math.max(10,Math.min(100,d??z)),le=Math.max(100,u),te=Uo(p),fe=s.useCallback(I=>{const ee=lb(I?x[I]:void 0);return cb(R.width,R.height,ee,re,F)},[R.height,R.width,x,F,re]);s.useEffect(()=>{const I=Q.current;if(!I)return;const ee=new ResizeObserver(([ie])=>{const{width:pe,height:V}=ie.contentRect;H({width:pe,height:V})});return ee.observe(I),()=>ee.disconnect()},[]),s.useEffect(()=>{const I=(t??[]).map(ee=>{var ie;return(ie=ee.image)==null?void 0:ie.url}).filter(ee=>!!ee);db(I,(ee,ie)=>{Y(pe=>{var V,Ie;return((V=pe[ee])==null?void 0:V.width)===ie.width&&((Ie=pe[ee])==null?void 0:Ie.height)===ie.height?pe:{...pe,[ee]:ie}})})},[t]),s.useEffect(()=>{const{backgroundIndex:I,activeIndex:ee}=Qc(y.length);g(ee),S(I),f(!1),G(!1),E(null),M(null),$(0),O(1),L("none"),j("next")},[y.length,t]),s.useEffect(()=>()=>{D.current&&clearTimeout(D.current)},[]);const Pe=s.useCallback(I=>{var be,J,He,We;if(!ae||A||y.length<=1)return;const ee=I==="next"?(m+1)%y.length:(m-1+y.length)%y.length,ie=fe((J=(be=y[m])==null?void 0:be.image)==null?void 0:J.url),pe=fe((We=(He=y[ee])==null?void 0:He.image)==null?void 0:We.url),V=ed(R.width,R.height,ie),Ie=ed(R.width,R.height,pe);D.current&&clearTimeout(D.current),j(I),G(!0),f(!0),I==="next"?(E(m),M(ee),$(0),O(1),L(Uo(p,0,1))):(S(sb(ee,y.length)),E(ee),M(m),$(1),O(Ie),L(Uo(p,1,Ie))),requestAnimationFrame(()=>{G(!1),requestAnimationFrame(()=>{I==="next"?($(1),O(V),L(Uo(p,1,V))):($(0),O(1),L(Uo(p,0,1)))})}),D.current=setTimeout(()=>{I==="next"&&S(m),g(ee),E(null),M(null),f(!1)},le)},[m,p,R.height,R.width,fe,A,ae,y,le]),xe=y[m],de=b!==null?y[b]:null,K=q!==null?y[q]:null,se=P!==null?y[P]:null,ue=y.length<=1?0:(m-1+y.length)%y.length,ve=y.length<=1?0:(m+1)%y.length,$e=fe((Ce=xe==null?void 0:xe.image)==null?void 0:Ce.url),ke=fe((h=K==null?void 0:K.image)==null?void 0:h.url),he=fe((U=se==null?void 0:se.image)==null?void 0:U.url),Se={[`--${o}-transition-ms`]:`${le}ms`};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:r}}),a.jsxs("div",{ref:Q,className:Tt(`${o}-wrapper`,w&&`${o}-snap`,n&&!i&&`${o}-editor`),style:Se,"aria-label":"Zoom gallery",children:[((Z=de==null?void 0:de.image)==null?void 0:Z.url)&&a.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:de.image.url,alt:"",style:{filter:te}})}),A&&((ne=K==null?void 0:K.image)==null?void 0:ne.url)&&a.jsx("div",{className:Tt(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${C}`),style:td(ke,T,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:K.image.url,alt:"",style:{filter:N}})}),A&&((me=se==null?void 0:se.image)==null?void 0:me.url)&&a.jsx("div",{className:Tt(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${C}`),style:td(he,X,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-image`,src:se.image.url,alt:""})}),!A&&((B=xe==null?void 0:xe.image)==null?void 0:B.url)&&a.jsx("div",{className:Tt(`${o}-stage`,`${o}-foreground`),style:sp($e),children:a.jsx("img",{className:`${o}-image`,src:xe.image.url,alt:xe.image.name??""})}),ae&&y.length>1&&!A&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:Tt(`${o}-nav`,`${o}-nav-prev`),onClick:()=>Pe("prev"),"aria-label":`Show previous image (${ue+1} of ${y.length})`}),a.jsx("button",{type:"button",className:Tt(`${o}-nav`,`${o}-nav-next`),onClick:()=>Pe("next"),"aria-label":`Show next image (${ve+1} of ${y.length})`})]})]})]})}const pb=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
17218
17218
|
import cn from 'classnames';
|
|
17219
17219
|
import { CommonComponentProps } from '../props';
|
|
17220
17220
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -17975,7 +17975,7 @@ a:active .${e}-button .${e}-icon-image,
|
|
|
17975
17975
|
height: calc(1em * var(--${e}-icon-scale, 1));
|
|
17976
17976
|
width: calc(1em * var(--${e}-icon-scale, 1));
|
|
17977
17977
|
}
|
|
17978
|
-
`}function gs(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 nd(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=
|
|
17978
|
+
`}function gs(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 nd(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=_.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 bb({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:r}=_.useScopedStyles(),l=s.useMemo(()=>xb(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:b=0,dimensions:S=!1,padding:A={top:0,right:0,bottom:0,left:0},cornerRadius:f=0,boxShadow:w={top:0,left:0,right:0,bottom:0},boxShadowColor:G="rgba(0, 0, 0, 0)",innerBoxShadow:q={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:E="rgba(0, 0, 0, 0)",stroke:P=0,blur:M=0,backgroundColor:X="#000000",textColor:$="#ffffff",borderColor:T="#ffffff",iconColor:O="#ffffff",hoverEffect:N="none",fontFamily:L,fontSettings:C,fontSize:j,lineHeight:x,letterSpacing:Y=0,wordSpacing:R=0,textAppearance:H,stateOverrides:D,minWidth:Q=0,minHeight:ae=0,width:z=0,height:re=0}=e,F=_.buildColorVars(r,{backgroundColor:X,textColor:$,borderColor:T,iconColor:O,boxShadowColor:G,innerBoxShadowColor:E},hb,fb,D),le=i&&i!=="default"?`${r}-state-${i}`:"",te=t&&!n?`${r}-editing`:"",fe=N!=="none"&&(!t||n||i==="hover")?`${r}-hover-effect-${N}`:"",Pe=N==="reveal"||N==="swipe",xe=N==="content-roll",de=N==="reveal"&&(!t||n),K=S===!0,ue=c==="a"?y??p:p,ve=c==="c",$e=c!=="b",ke={fontSettings:{fontFamily:L,fontWeight:(C==null?void 0:C.fontWeight)??400,fontStyle:(C==null?void 0:C.fontStyle)??"normal"},fontSize:j??.01,lineHeight:x,letterSpacing:Y,wordSpacing:R,textAppearance:H,color:$},Se={...$e?dn(Qt(ke,t)):{},[`--${r}-box-shadow-x`]:_.scalingValue(w.left,t),[`--${r}-box-shadow-y`]:_.scalingValue(w.top,t),[`--${r}-box-shadow-blur`]:_.scalingValue(w.right,t),[`--${r}-box-shadow-spread`]:_.scalingValue(w.bottom,t),[`--${r}-inner-box-shadow-x`]:_.scalingValue(q.left,t),[`--${r}-inner-box-shadow-y`]:_.scalingValue(q.top,t),[`--${r}-inner-box-shadow-blur`]:_.scalingValue(q.right,t),[`--${r}-inner-box-shadow-spread`]:_.scalingValue(q.bottom,t),[`--${r}-backdrop-blur`]:M>0?`blur(${_.scalingValue(M,t)})`:void 0,paddingTop:_.scalingValue(A.top,t),paddingRight:_.scalingValue(A.right,t),paddingBottom:_.scalingValue(A.bottom,t),paddingLeft:_.scalingValue(A.left,t),borderRadius:_.scalingValue(f,t),borderWidth:_.scalingValue(P,t),...ve?{}:{justifyContent:ms[ue],textAlign:ue},...ve&&!xe?{gap:_.scalingValue(m,t)}:{},...K?{width:_.scalingValue(z,t),height:_.scalingValue(re,t)}:{minWidth:_.scalingValue(Q,t),minHeight:_.scalingValue(ae,t),...ve?{width:"100%"}:{}}};let Ce;const h={display:"inline-flex",alignItems:"center",justifyContent:ve?ms[ue]:ms[c==="a"?ue:"center"],gap:ve?_.scalingValue(m,t):void 0,width:"100%",height:"100%",...c==="a"?{textAlign:ue}:{}};if(c==="b"){const ne=()=>nd(r,u,g>0?"fixed":"fill",100,g,t);Ce=xe?gs(r,ne,`${r}-icon-roll`,void 0,h):ne()}else if(c==="c"){const ne=()=>{const me=a.jsx("span",{className:`${r}-text`,style:{textAlign:ue},children:d}),B=nd(r,u,b>0?"fixed":"fill",100,b,t);return v==="icon-text"?a.jsxs(a.Fragment,{children:[B,me]}):a.jsxs(a.Fragment,{children:[me,B]})};Ce=xe?gs(r,ne,`${r}-icon-text-roll`,void 0,h):ne()}else Ce=xe?gs(r,()=>d,`${r}-label-roll`,void 0,h):Pe?a.jsx("span",{className:`${r}-button-inner`,children:d}):d;const U=de?ne=>yb(ne,r):void 0,Z=de?ne=>vb(ne,r):void 0;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),a.jsx("div",{className:`${r}-root`,style:F,children:a.jsx("div",{className:`${r}-wrapper ${le} ${te}`.trim(),children:a.jsx("div",{className:`${r}-button ${fe}`.trim(),style:Se,onMouseEnter:U,onMouseLeave:Z,role:"button",tabIndex:o||t&&!n?void 0:0,children:Ce})})})]})}const Sb=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
|
|
17979
17979
|
import { SvgImage } from '../helpers/SvgImage/SvgImage';
|
|
17980
17980
|
import { CommonComponentProps } from '../props';
|
|
17981
17981
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
|
|
@@ -18805,7 +18805,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18805
18805
|
pointer-events: auto;
|
|
18806
18806
|
flex-shrink: 0;
|
|
18807
18807
|
}
|
|
18808
|
-
`}const Hn=500,Ko=650,wn="cubic-bezier(0.22, 1, 0.36, 1)",Pb=72,Ib=50,Rb=1e4,kb=650,Eb=500;function Mb(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 lp(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 Ab(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?lp(i,n):null}function Fb(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 nr(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 id(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return nr(e,i,n)}const Nb=.03;function cp(e){return e.width*Nb}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 od(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function _b(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 Hb(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Gs(e,t.width,t.height)}function Wb(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 Ob(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 Db({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=cp(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 zb(e,t,n){const{left:i,width:o}=n,r=cp(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 dp(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 Bb(e,t,n,i){const{start:o,end:r}=dp(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function jb(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 Vb({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 Gb({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:b,onNext:S}){const A=s.useRef(null),f=s.useRef(null),w=s.useRef(null),G=s.useRef(new Map),[q,E]=s.useState(0),P=s.useRef(null),M=s.useRef(0),X=s.useRef(0),$=s.useRef("none"),T=s.useRef(!1),O=s.useRef(!1),F=s.useRef(!1),L=s.useRef(null),C=s.useRef(null),j=s.useRef(null),x=s.useRef(()=>{}),Y=s.useRef(null),R=s.useRef(null),H=s.useRef(null),D=s.useRef(!1),[Q,ae]=s.useState(null),[z,re]=s.useState(hs),[_,le]=s.useState(0),[te,fe]=s.useState("opening"),[Pe,xe]=s.useState(0),[ue,K]=s.useState(0),[se,de]=s.useState(!1),[ve,$e]=s.useState(null),[ke,he]=s.useState(null),[Se,Te]=s.useState(null),[h,U]=s.useState(!1),[Z,ne]=s.useState(null),[me,B]=s.useState(!1),I=s.useRef(!1),[ee,ie]=s.useState(!1),[pe,V]=s.useState(!1),Ie=s.useRef(n),be=s.useRef(void 0),J=t[n],He=J?Oa(J):!1,We=ue!==0||se,it=!l&&(!r||!!c),qe=d&&!l,tt=u.length>1,et=s.useCallback((W,Le)=>t.length<=1?null:t[(W+Le+t.length)%t.length]??null,[t]),je=tt?nr(u,p,-1):et(n,-1),ye=tt?nr(u,p,1):et(n,1),_e=ve===-1&&We?tt&&ke!==null?nr(u,ke,-1):Se!==null?et(Se,-1):null:null,Be=ve===1&&We?tt&&ke!==null?nr(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!==(ye==null?void 0:ye.url)?Be:null,Fe=je&&qe?(()=>{const W=tt?id(u,p,-1):t.length>2?et((n-1+t.length)%t.length,-1):null;return W&&W.url!==je.url?W:null})():null,Ke=ye&&qe?(()=>{const W=tt?id(u,p,1):t.length>2?et((n+1)%t.length,1):null;return W&&W.url!==ye.url?W:null})():null,Je=Ze??Fe,st=we??Ke,ot=s.useCallback((W,Le,Ve)=>{if(!W||!Le||!Ve)return;const Ne=G.current,ft=Ne.get(W);(ft==null?void 0:ft.width)===Le&&(ft==null?void 0:ft.height)===Ve||(Ne.set(W,{width:Le,height:Ve}),E(Nt=>Nt+1))},[]),Oe=s.useCallback(W=>{if(!(W!=null&&W.url))return null;const Le=G.current.get(W.url);return Hb(f.current,Le)},[q,_]),Ae=s.useCallback(()=>{if(!J)return;const W=Oe(J);if(W){ae(W);return}const Le=f.current;Le&&ae(od(Le))},[J,Oe]),gt=s.useCallback(W=>{if(tt){const Le=u.length;he((p+W+Le)%Le),Te(null);return}t.length>1&&(Te((n+W+t.length)%t.length),he(null))},[tt,u.length,p,t.length,n]),ze=s.useCallback(W=>{F.current=W,de(W)},[]),De=s.useCallback(()=>{L.current!==null&&(window.clearTimeout(L.current),L.current=null)},[]),Xe=s.useCallback(()=>{De(),L.current=window.setTimeout(()=>{De(),ze(!1)},Ko+32)},[De,ze]),dt=s.useCallback(()=>{const W=A.current;if(!W){re({left:0,top:0,width:typeof window<"u"?window.innerWidth:hs.width,height:typeof window<"u"?window.innerHeight:hs.height});return}const Le=W.getBoundingClientRect();re({left:Le.left,top:Le.top,width:Le.width,height:Le.height})},[]),ge=s.useCallback((W,Le)=>{if(We){if(ee&&!se)return`translate(${ue}px, 0px)`;if(se&&ve!==null){const Ve=Oe(W);if(!Ve)return;const{x:Ne,y:ft}=Bb(Ve,Le,ve,z);return`translate(${Ne}px, ${ft}px)`}if(se)return"translate(0px, 0px)"}},[We,ee,se,ue,ve,z,Oe]),Re=s.useCallback(()=>{const W=C.current;C.current=null,De(),ze(!1),$e(null),he(null),Te(null),K(0),ie(!1),T.current=!1,X.current=0,$.current="none",W===-1?b():W===1&&S()},[De,ze,b,S]),nt=s.useCallback(()=>{De(),L.current=window.setTimeout(()=>{C.current!==null&&Re()},Ko+32)},[De,Re]),ut=s.useCallback(()=>{De(),C.current=null,ze(!1),$e(null),he(null),Te(null),K(0),ie(!1),T.current=!1,X.current=0,$.current="none"},[De,ze]),Ge=s.useCallback(W=>{if(!(!qe||!Q)){if(F.current){if(C.current===W){j.current=W,Re();return}ut()}De(),gt(W),C.current=W,$e(W),ze(!0),nt()}},[qe,Q,Re,ut,De,gt,ze,nt]);x.current=Ge;const bt=s.useCallback(()=>{Y.current=null,D.current=!1,R.current!==null&&(window.clearInterval(R.current),R.current=null),H.current!==null&&(window.clearTimeout(H.current),H.current=null)},[]),It=s.useCallback(W=>{R.current!==null&&window.clearInterval(R.current);const Le=D.current?Eb:kb;R.current=window.setInterval(()=>{x.current(W)},Le)},[]),Mt=s.useCallback(W=>{Y.current!==W&&(bt(),Y.current=W,D.current=!1,x.current(W),It(W),H.current=window.setTimeout(()=>{H.current=null,Y.current===W&&(D.current=!0,It(W))},Rb))},[bt,It]),wt=s.useCallback(()=>{const W=f.current;if(!W)return;const Le=J==null?void 0:J.url,Ve=Le?G.current.get(Le):void 0;if(Ve!=null&&Ve.width&&(Ve!=null&&Ve.height)){ae(Gs(W,Ve.width,Ve.height));return}const Ne=w.current;if(Ne&&Le&&(Ne.src===Le||Ne.currentSrc===Le)){const{width:Nt,height:mt}=_b(Ne);if(Nt&&mt){ot(Le,Nt,mt),ae(Gs(W,Nt,mt));return}}const ft=od(W);!ft.width||!ft.height||ae(ft)},[J==null?void 0:J.url,ot]),Vt=s.useCallback(W=>{if(w.current=W,!!W){if(W instanceof HTMLVideoElement){W.readyState>=1&&W.videoWidth>0&&wt();return}W.complete&&W.naturalWidth>0&&wt()}},[wt]),jt=s.useCallback(()=>{dt(),wt(),le(W=>W+1)},[dt,wt]);s.useEffect(()=>{jt();const W=f.current,Le=A.current,Ve=new ResizeObserver(()=>jt());return W&&Ve.observe(W),Le&&Ve.observe(Le),window.addEventListener("resize",jt),()=>{Ve.disconnect(),window.removeEventListener("resize",jt)}},[jt,n,y]),s.useLayoutEffect(()=>{if(!J)return;const W=w.current;if(W){if(W instanceof HTMLImageElement&&W.complete&&W.naturalWidth>0){wt();return}W instanceof HTMLVideoElement&&W.readyState>=1&&W.videoWidth>0&&wt()}},[J==null?void 0:J.url,n,wt]),s.useEffect(()=>{Ae()},[Ae,q]),s.useEffect(()=>{const W=new Set,Le=[],Ve=Ne=>{!(Ne!=null&&Ne.url)||W.has(Ne.url)||(W.add(Ne.url),Le.push(Ne))};t.forEach(Ve),u.forEach(Ne=>Ne.items.forEach(Ve)),Le.forEach(Ne=>{G.current.has(Ne.url)||Wb(Ne,ot)})},[t,u,ot]),s.useEffect(()=>{if(te!=="opening"||!Q)return;if(!v){fe("open");return}U(!1);const W=requestAnimationFrame(()=>{requestAnimationFrame(()=>{U(!0),fe("open")})});return()=>cancelAnimationFrame(W)},[te,Q,v]),s.useEffect(()=>{if(te!=="closing")return;const W=setTimeout(()=>g(),Hn);return()=>clearTimeout(W)},[te,g]),s.useEffect(()=>()=>{De()},[De]),s.useLayoutEffect(()=>{Ie.current===n&&be.current===(J==null?void 0:J.url)||(De(),C.current=null,$e(null),he(null),Te(null),xe(0),K(0),ze(!1),V(!1),ie(!1),M.current=0,X.current=0,$.current="none",T.current=!1,P.current=null,O.current=!1,w.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 W=j.current;W!==null&&(j.current=null,requestAnimationFrame(()=>{x.current(W)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(te==="opening"){I.current=!1,B(!1);return}if(te!=="open"||I.current)return;if(!je&&!ye){I.current=!0;return}B(!1);const W=requestAnimationFrame(()=>{requestAnimationFrame(()=>{B(!0),I.current=!0})});return()=>cancelAnimationFrame(W)},[te,je==null?void 0:je.url,ye==null?void 0:ye.url]),s.useEffect(()=>{if(te!=="open")return;const W=()=>{const mt=$t=>{$t.stopPropagation(),$t.preventDefault(),document.removeEventListener("click",mt,!0)};document.addEventListener("click",mt,!0)},Le=mt=>{const $t=mt<0?1:-1;De(),gt($t),C.current=$t,$e($t),ze(!0),nt()},Ve=mt=>{if(Math.abs(mt)>Ib&&qe){Le(mt);return}C.current=null,$e(null),he(null),Te(null),ze(!0),K(0),Xe()},Ne=mt=>{if(mt.touches.length!==1||F.current)return;const $t=mt.touches[0];O.current=!0,P.current={x:$t.clientX,y:$t.clientY},$.current="none",X.current=0,T.current=!1},ft=mt=>{if(!P.current||mt.touches.length!==1||F.current)return;const $t=mt.touches[0],Yt=$t.clientX-P.current.x,Dt=$t.clientY-P.current.y;if($.current==="none"){if(Math.abs(Yt)<10&&Math.abs(Dt)<10)return;if(Math.abs(Yt)>Math.abs(Dt)){if(!qe)return;$.current="horizontal"}else if(Dt>0){if(!it)return;$.current="vertical"}else return}if($.current==="horizontal"){T.current=!0,ie(!0),X.current=Yt,K(Yt),mt.preventDefault();return}$.current==="vertical"&&(T.current=!0,ie(!0),M.current=Dt,xe(Dt),mt.preventDefault())},Nt=()=>{if(!P.current)return;const mt=$.current,$t=T.current;if($t&&mt==="horizontal")Ve(X.current),W();else if($t&&mt==="vertical"){const Yt=M.current;if(it&&Yt>Pb){const Dt=window.innerHeight;M.current=Dt,V(!0),xe(Dt),fe("closing")}else M.current=0,xe(0);W()}else mt==="horizontal"&&Math.abs(X.current)>0&&(Ve(X.current),W());P.current=null,$.current="none",X.current=0,T.current=!1,ie(!1)};return document.addEventListener("touchstart",Ne,{passive:!0}),document.addEventListener("touchmove",ft,{passive:!1}),document.addEventListener("touchend",Nt),document.addEventListener("touchcancel",Nt),()=>{document.removeEventListener("touchstart",Ne),document.removeEventListener("touchmove",ft),document.removeEventListener("touchend",Nt),document.removeEventListener("touchcancel",Nt)}},[te,qe,ze,Xe,De,it,nt,gt]);const qt=s.useCallback(()=>{const W=(m==null?void 0:m())??v??null;W&&Q&&(ne(W),U(!0)),fe("closing")},[m,v,Q]);s.useEffect(()=>{const W=Ne=>{if(Ne.key==="Escape"){if(r&&c||te==="closing")return;bt(),qt();return}if(Ne.key!=="ArrowLeft"&&Ne.key!=="ArrowRight"||te!=="open"||!qe)return;Ne.preventDefault();const ft=Ne.key==="ArrowLeft"?-1:1;Ne.repeat&&Y.current===ft||Mt(ft)},Le=Ne=>{if(Ne.key!=="ArrowLeft"&&Ne.key!=="ArrowRight")return;const ft=Ne.key==="ArrowLeft"?-1:1;Y.current===ft&&bt()},Ve=()=>{bt()};return window.addEventListener("keydown",W),window.addEventListener("keyup",Le),window.addEventListener("blur",Ve),()=>{window.removeEventListener("keydown",W),window.removeEventListener("keyup",Le),window.removeEventListener("blur",Ve),bt()}},[te,r,c,qt,qe,Mt,bt]),s.useEffect(()=>{te!=="open"&&bt()},[te,bt]);const Ut=()=>{te==="closing"||l||qt()},Rt=te==="open",Bt=te==="closing",rn=Pe>0?Math.max(0,1-Pe/500):1,vt=Pe>0?Math.max(.35,1-Pe/500):1,yt=s.useCallback(W=>{if(!(W.propertyName!=="transform"||!F.current)){if(C.current!==null){Re();return}De(),ze(!1)}},[De,ze,Re]),Ee=te==="closing"?Z??v:v,Qe=Ee&&Q&&(te==="opening"||Bt)?Mb(Ee,Q):void 0,rt=We&&J?ge(J,"center"):Pe>0?`translateY(${Pe}px)`:Qe,lt=Q?Gr(Q,z):null,Lt=!!(Ee&&Q),St=Lt&&(te==="closing"||te==="open"&&h),ht={position:"absolute",top:lt==null?void 0:lt.top,left:lt==null?void 0:lt.left,width:lt==null?void 0:lt.width,height:lt==null?void 0:lt.height,objectFit:"contain",transformOrigin:"top left",transform:rt,opacity:Pe>0?vt:Lt?1:te==="opening"||Bt?0:1,transition:ee&&!se?"none":se?`transform ${Ko}ms ${wn}`:pe?`transform ${Hn}ms ${wn}, opacity ${Hn}ms ${wn}`:St?`transform ${Hn}ms ${wn}`:te==="opening"||Bt?`opacity ${Hn}ms ${wn}`:"none",pointerEvents:He&&Rt&&!We?"auto":"none",touchAction:He&&Rt?"none":void 0,zIndex:1,overflow:He?"hidden":void 0},Pt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Rt&&!We?"auto":"none"},Ot=(W,Le,Ve="adjacent")=>{const Ne=Oe(W);if(!Ne)return{display:"none"};const ft=Ve==="far"?Le==="left"?"far-left":"far-right":Le==="left"?"left-adjacent":"right-adjacent",{start:Nt}=ve!==null?dp(Ne,ft,ve,z):{start:Ve==="far"?ba(Ne,Le,z):Fo(Ne,Le,z)},mt=Gr(Nt,z),$t=ge(W,ft),Yt=!We&&Ve==="adjacent"&&Rt&&!me?jb(Ne,Le,z):null,Dt=Ve==="far"&&We&&ve===(Le==="left"?-1:1),sn=ee&&!se?!1:se,ln=Ve==="adjacent"&&Rt&&me&&!We;return{position:"absolute",top:mt.top,left:mt.left,width:mt.width,height:mt.height,objectFit:"contain",transform:$t??(Yt?`translate(${Yt.x}px, ${Yt.y}px)`:void 0),opacity:Ve==="far"?Rt&&Dt?1:0:Rt?1:0,transition:sn?Ve==="far"?`transform ${Ko}ms ${wn}`:`transform ${Ko}ms ${wn}, opacity ${Hn}ms ${wn}`:ln?`transform ${Hn}ms ${wn}`:te==="opening"||Bt?`opacity ${Hn}ms ${wn}`:"none",pointerEvents:"none",zIndex:1}},At=(W,Le)=>{const Ve=Oe(W);return Ve?zb(Fo(Ve,Le,z),Le,z):null},Gt=W=>Le=>{if(!l){if(O.current){O.current=!1;return}Le.stopPropagation(),Ge(W)}},Et=je?At(je,"left"):null,zt=ye?At(ye,"right"):null,Ft=Et?Gr(Et,z):null,pt=zt?Gr(zt,z):null;return a.jsxs("div",{ref:A,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:te==="open"?"none":void 0},onClick:Ut,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Rt?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:Rt?1:0,transition:ee?"none":`opacity ${Hn}ms ${wn}`,pointerEvents:"none"},children:a.jsx(Gu,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,onClose:Ut})})]}),Rt&&Je&&a.jsx(Xr,{media:Je,style:Ot(Je,"left","far"),onMeasure:ot,onTransitionEnd:yt},`far-prev-${Je.url}`),Rt&&je&&a.jsxs(a.Fragment,{children:[a.jsx(Xr,{media:je,style:Ot(je,"left"),onMeasure:ot,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||ee?"default":"pointer",pointerEvents:l||ee?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Rt&&ye&&a.jsxs(a.Fragment,{children:[a.jsx(Xr,{media:ye,style:Ot(ye,"right"),onMeasure:ot,onTransitionEnd:yt},`next-${ye.url}`),pt&&a.jsx("div",{style:{position:"absolute",top:pt.top,left:pt.left,width:pt.width,height:pt.height,cursor:l||ee?"default":"pointer",pointerEvents:l||ee?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Rt&&st&&a.jsx(Xr,{media:st,style:Ot(st,"right","far"),onMeasure:ot,onTransitionEnd:yt},`far-next-${st.url}`),Q&&J&&(He?a.jsx(Vb,{src:J.url,phase:te,onMediaElement:Vt,wrapperStyle:ht,videoStyle:Pt,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 Xb=20,qb=.18;function Ub(e){return`
|
|
18808
|
+
`}const Hn=500,Ko=650,wn="cubic-bezier(0.22, 1, 0.36, 1)",Pb=72,Ib=50,Rb=1e4,kb=650,Eb=500;function Mb(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 lp(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 Ab(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?lp(i,n):null}function Fb(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 nr(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 id(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return nr(e,i,n)}const Nb=.03;function cp(e){return e.width*Nb}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 od(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function _b(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 Hb(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Gs(e,t.width,t.height)}function Wb(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 Ob(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 Db({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=cp(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 zb(e,t,n){const{left:i,width:o}=n,r=cp(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 dp(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 Bb(e,t,n,i){const{start:o,end:r}=dp(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function jb(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 Vb({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 Gb({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:b,onNext:S}){const A=s.useRef(null),f=s.useRef(null),w=s.useRef(null),G=s.useRef(new Map),[q,E]=s.useState(0),P=s.useRef(null),M=s.useRef(0),X=s.useRef(0),$=s.useRef("none"),T=s.useRef(!1),O=s.useRef(!1),N=s.useRef(!1),L=s.useRef(null),C=s.useRef(null),j=s.useRef(null),x=s.useRef(()=>{}),Y=s.useRef(null),R=s.useRef(null),H=s.useRef(null),D=s.useRef(!1),[Q,ae]=s.useState(null),[z,re]=s.useState(hs),[F,le]=s.useState(0),[te,fe]=s.useState("opening"),[Pe,xe]=s.useState(0),[de,K]=s.useState(0),[se,ue]=s.useState(!1),[ve,$e]=s.useState(null),[ke,he]=s.useState(null),[Se,Ce]=s.useState(null),[h,U]=s.useState(!1),[Z,ne]=s.useState(null),[me,B]=s.useState(!1),I=s.useRef(!1),[ee,ie]=s.useState(!1),[pe,V]=s.useState(!1),Ie=s.useRef(n),be=s.useRef(void 0),J=t[n],He=J?Oa(J):!1,We=de!==0||se,it=!l&&(!r||!!c),qe=d&&!l,tt=u.length>1,et=s.useCallback((W,Le)=>t.length<=1?null:t[(W+Le+t.length)%t.length]??null,[t]),je=tt?nr(u,p,-1):et(n,-1),ye=tt?nr(u,p,1):et(n,1),_e=ve===-1&&We?tt&&ke!==null?nr(u,ke,-1):Se!==null?et(Se,-1):null:null,Be=ve===1&&We?tt&&ke!==null?nr(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!==(ye==null?void 0:ye.url)?Be:null,Fe=je&&qe?(()=>{const W=tt?id(u,p,-1):t.length>2?et((n-1+t.length)%t.length,-1):null;return W&&W.url!==je.url?W:null})():null,Ke=ye&&qe?(()=>{const W=tt?id(u,p,1):t.length>2?et((n+1)%t.length,1):null;return W&&W.url!==ye.url?W:null})():null,Je=Ze??Fe,st=we??Ke,ot=s.useCallback((W,Le,Ve)=>{if(!W||!Le||!Ve)return;const Ne=G.current,ft=Ne.get(W);(ft==null?void 0:ft.width)===Le&&(ft==null?void 0:ft.height)===Ve||(Ne.set(W,{width:Le,height:Ve}),E(Nt=>Nt+1))},[]),Oe=s.useCallback(W=>{if(!(W!=null&&W.url))return null;const Le=G.current.get(W.url);return Hb(f.current,Le)},[q,F]),Ae=s.useCallback(()=>{if(!J)return;const W=Oe(J);if(W){ae(W);return}const Le=f.current;Le&&ae(od(Le))},[J,Oe]),gt=s.useCallback(W=>{if(tt){const Le=u.length;he((p+W+Le)%Le),Ce(null);return}t.length>1&&(Ce((n+W+t.length)%t.length),he(null))},[tt,u.length,p,t.length,n]),ze=s.useCallback(W=>{N.current=W,ue(W)},[]),De=s.useCallback(()=>{L.current!==null&&(window.clearTimeout(L.current),L.current=null)},[]),Xe=s.useCallback(()=>{De(),L.current=window.setTimeout(()=>{De(),ze(!1)},Ko+32)},[De,ze]),dt=s.useCallback(()=>{const W=A.current;if(!W){re({left:0,top:0,width:typeof window<"u"?window.innerWidth:hs.width,height:typeof window<"u"?window.innerHeight:hs.height});return}const Le=W.getBoundingClientRect();re({left:Le.left,top:Le.top,width:Le.width,height:Le.height})},[]),ge=s.useCallback((W,Le)=>{if(We){if(ee&&!se)return`translate(${de}px, 0px)`;if(se&&ve!==null){const Ve=Oe(W);if(!Ve)return;const{x:Ne,y:ft}=Bb(Ve,Le,ve,z);return`translate(${Ne}px, ${ft}px)`}if(se)return"translate(0px, 0px)"}},[We,ee,se,de,ve,z,Oe]),Re=s.useCallback(()=>{const W=C.current;C.current=null,De(),ze(!1),$e(null),he(null),Ce(null),K(0),ie(!1),T.current=!1,X.current=0,$.current="none",W===-1?b():W===1&&S()},[De,ze,b,S]),nt=s.useCallback(()=>{De(),L.current=window.setTimeout(()=>{C.current!==null&&Re()},Ko+32)},[De,Re]),ut=s.useCallback(()=>{De(),C.current=null,ze(!1),$e(null),he(null),Ce(null),K(0),ie(!1),T.current=!1,X.current=0,$.current="none"},[De,ze]),Ge=s.useCallback(W=>{if(!(!qe||!Q)){if(N.current){if(C.current===W){j.current=W,Re();return}ut()}De(),gt(W),C.current=W,$e(W),ze(!0),nt()}},[qe,Q,Re,ut,De,gt,ze,nt]);x.current=Ge;const bt=s.useCallback(()=>{Y.current=null,D.current=!1,R.current!==null&&(window.clearInterval(R.current),R.current=null),H.current!==null&&(window.clearTimeout(H.current),H.current=null)},[]),It=s.useCallback(W=>{R.current!==null&&window.clearInterval(R.current);const Le=D.current?Eb:kb;R.current=window.setInterval(()=>{x.current(W)},Le)},[]),Mt=s.useCallback(W=>{Y.current!==W&&(bt(),Y.current=W,D.current=!1,x.current(W),It(W),H.current=window.setTimeout(()=>{H.current=null,Y.current===W&&(D.current=!0,It(W))},Rb))},[bt,It]),wt=s.useCallback(()=>{const W=f.current;if(!W)return;const Le=J==null?void 0:J.url,Ve=Le?G.current.get(Le):void 0;if(Ve!=null&&Ve.width&&(Ve!=null&&Ve.height)){ae(Gs(W,Ve.width,Ve.height));return}const Ne=w.current;if(Ne&&Le&&(Ne.src===Le||Ne.currentSrc===Le)){const{width:Nt,height:mt}=_b(Ne);if(Nt&&mt){ot(Le,Nt,mt),ae(Gs(W,Nt,mt));return}}const ft=od(W);!ft.width||!ft.height||ae(ft)},[J==null?void 0:J.url,ot]),Vt=s.useCallback(W=>{if(w.current=W,!!W){if(W instanceof HTMLVideoElement){W.readyState>=1&&W.videoWidth>0&&wt();return}W.complete&&W.naturalWidth>0&&wt()}},[wt]),jt=s.useCallback(()=>{dt(),wt(),le(W=>W+1)},[dt,wt]);s.useEffect(()=>{jt();const W=f.current,Le=A.current,Ve=new ResizeObserver(()=>jt());return W&&Ve.observe(W),Le&&Ve.observe(Le),window.addEventListener("resize",jt),()=>{Ve.disconnect(),window.removeEventListener("resize",jt)}},[jt,n,y]),s.useLayoutEffect(()=>{if(!J)return;const W=w.current;if(W){if(W instanceof HTMLImageElement&&W.complete&&W.naturalWidth>0){wt();return}W instanceof HTMLVideoElement&&W.readyState>=1&&W.videoWidth>0&&wt()}},[J==null?void 0:J.url,n,wt]),s.useEffect(()=>{Ae()},[Ae,q]),s.useEffect(()=>{const W=new Set,Le=[],Ve=Ne=>{!(Ne!=null&&Ne.url)||W.has(Ne.url)||(W.add(Ne.url),Le.push(Ne))};t.forEach(Ve),u.forEach(Ne=>Ne.items.forEach(Ve)),Le.forEach(Ne=>{G.current.has(Ne.url)||Wb(Ne,ot)})},[t,u,ot]),s.useEffect(()=>{if(te!=="opening"||!Q)return;if(!v){fe("open");return}U(!1);const W=requestAnimationFrame(()=>{requestAnimationFrame(()=>{U(!0),fe("open")})});return()=>cancelAnimationFrame(W)},[te,Q,v]),s.useEffect(()=>{if(te!=="closing")return;const W=setTimeout(()=>g(),Hn);return()=>clearTimeout(W)},[te,g]),s.useEffect(()=>()=>{De()},[De]),s.useLayoutEffect(()=>{Ie.current===n&&be.current===(J==null?void 0:J.url)||(De(),C.current=null,$e(null),he(null),Ce(null),xe(0),K(0),ze(!1),V(!1),ie(!1),M.current=0,X.current=0,$.current="none",T.current=!1,P.current=null,O.current=!1,w.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 W=j.current;W!==null&&(j.current=null,requestAnimationFrame(()=>{x.current(W)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(te==="opening"){I.current=!1,B(!1);return}if(te!=="open"||I.current)return;if(!je&&!ye){I.current=!0;return}B(!1);const W=requestAnimationFrame(()=>{requestAnimationFrame(()=>{B(!0),I.current=!0})});return()=>cancelAnimationFrame(W)},[te,je==null?void 0:je.url,ye==null?void 0:ye.url]),s.useEffect(()=>{if(te!=="open")return;const W=()=>{const mt=$t=>{$t.stopPropagation(),$t.preventDefault(),document.removeEventListener("click",mt,!0)};document.addEventListener("click",mt,!0)},Le=mt=>{const $t=mt<0?1:-1;De(),gt($t),C.current=$t,$e($t),ze(!0),nt()},Ve=mt=>{if(Math.abs(mt)>Ib&&qe){Le(mt);return}C.current=null,$e(null),he(null),Ce(null),ze(!0),K(0),Xe()},Ne=mt=>{if(mt.touches.length!==1||N.current)return;const $t=mt.touches[0];O.current=!0,P.current={x:$t.clientX,y:$t.clientY},$.current="none",X.current=0,T.current=!1},ft=mt=>{if(!P.current||mt.touches.length!==1||N.current)return;const $t=mt.touches[0],Yt=$t.clientX-P.current.x,Dt=$t.clientY-P.current.y;if($.current==="none"){if(Math.abs(Yt)<10&&Math.abs(Dt)<10)return;if(Math.abs(Yt)>Math.abs(Dt)){if(!qe)return;$.current="horizontal"}else if(Dt>0){if(!it)return;$.current="vertical"}else return}if($.current==="horizontal"){T.current=!0,ie(!0),X.current=Yt,K(Yt),mt.preventDefault();return}$.current==="vertical"&&(T.current=!0,ie(!0),M.current=Dt,xe(Dt),mt.preventDefault())},Nt=()=>{if(!P.current)return;const mt=$.current,$t=T.current;if($t&&mt==="horizontal")Ve(X.current),W();else if($t&&mt==="vertical"){const Yt=M.current;if(it&&Yt>Pb){const Dt=window.innerHeight;M.current=Dt,V(!0),xe(Dt),fe("closing")}else M.current=0,xe(0);W()}else mt==="horizontal"&&Math.abs(X.current)>0&&(Ve(X.current),W());P.current=null,$.current="none",X.current=0,T.current=!1,ie(!1)};return document.addEventListener("touchstart",Ne,{passive:!0}),document.addEventListener("touchmove",ft,{passive:!1}),document.addEventListener("touchend",Nt),document.addEventListener("touchcancel",Nt),()=>{document.removeEventListener("touchstart",Ne),document.removeEventListener("touchmove",ft),document.removeEventListener("touchend",Nt),document.removeEventListener("touchcancel",Nt)}},[te,qe,ze,Xe,De,it,nt,gt]);const qt=s.useCallback(()=>{const W=(m==null?void 0:m())??v??null;W&&Q&&(ne(W),U(!0)),fe("closing")},[m,v,Q]);s.useEffect(()=>{const W=Ne=>{if(Ne.key==="Escape"){if(r&&c||te==="closing")return;bt(),qt();return}if(Ne.key!=="ArrowLeft"&&Ne.key!=="ArrowRight"||te!=="open"||!qe)return;Ne.preventDefault();const ft=Ne.key==="ArrowLeft"?-1:1;Ne.repeat&&Y.current===ft||Mt(ft)},Le=Ne=>{if(Ne.key!=="ArrowLeft"&&Ne.key!=="ArrowRight")return;const ft=Ne.key==="ArrowLeft"?-1:1;Y.current===ft&&bt()},Ve=()=>{bt()};return window.addEventListener("keydown",W),window.addEventListener("keyup",Le),window.addEventListener("blur",Ve),()=>{window.removeEventListener("keydown",W),window.removeEventListener("keyup",Le),window.removeEventListener("blur",Ve),bt()}},[te,r,c,qt,qe,Mt,bt]),s.useEffect(()=>{te!=="open"&&bt()},[te,bt]);const Ut=()=>{te==="closing"||l||qt()},Rt=te==="open",Bt=te==="closing",rn=Pe>0?Math.max(0,1-Pe/500):1,vt=Pe>0?Math.max(.35,1-Pe/500):1,yt=s.useCallback(W=>{if(!(W.propertyName!=="transform"||!N.current)){if(C.current!==null){Re();return}De(),ze(!1)}},[De,ze,Re]),Ee=te==="closing"?Z??v:v,Qe=Ee&&Q&&(te==="opening"||Bt)?Mb(Ee,Q):void 0,rt=We&&J?ge(J,"center"):Pe>0?`translateY(${Pe}px)`:Qe,lt=Q?Gr(Q,z):null,Lt=!!(Ee&&Q),St=Lt&&(te==="closing"||te==="open"&&h),ht={position:"absolute",top:lt==null?void 0:lt.top,left:lt==null?void 0:lt.left,width:lt==null?void 0:lt.width,height:lt==null?void 0:lt.height,objectFit:"contain",transformOrigin:"top left",transform:rt,opacity:Pe>0?vt:Lt?1:te==="opening"||Bt?0:1,transition:ee&&!se?"none":se?`transform ${Ko}ms ${wn}`:pe?`transform ${Hn}ms ${wn}, opacity ${Hn}ms ${wn}`:St?`transform ${Hn}ms ${wn}`:te==="opening"||Bt?`opacity ${Hn}ms ${wn}`:"none",pointerEvents:He&&Rt&&!We?"auto":"none",touchAction:He&&Rt?"none":void 0,zIndex:1,overflow:He?"hidden":void 0},Pt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Rt&&!We?"auto":"none"},Ot=(W,Le,Ve="adjacent")=>{const Ne=Oe(W);if(!Ne)return{display:"none"};const ft=Ve==="far"?Le==="left"?"far-left":"far-right":Le==="left"?"left-adjacent":"right-adjacent",{start:Nt}=ve!==null?dp(Ne,ft,ve,z):{start:Ve==="far"?ba(Ne,Le,z):Fo(Ne,Le,z)},mt=Gr(Nt,z),$t=ge(W,ft),Yt=!We&&Ve==="adjacent"&&Rt&&!me?jb(Ne,Le,z):null,Dt=Ve==="far"&&We&&ve===(Le==="left"?-1:1),sn=ee&&!se?!1:se,ln=Ve==="adjacent"&&Rt&&me&&!We;return{position:"absolute",top:mt.top,left:mt.left,width:mt.width,height:mt.height,objectFit:"contain",transform:$t??(Yt?`translate(${Yt.x}px, ${Yt.y}px)`:void 0),opacity:Ve==="far"?Rt&&Dt?1:0:Rt?1:0,transition:sn?Ve==="far"?`transform ${Ko}ms ${wn}`:`transform ${Ko}ms ${wn}, opacity ${Hn}ms ${wn}`:ln?`transform ${Hn}ms ${wn}`:te==="opening"||Bt?`opacity ${Hn}ms ${wn}`:"none",pointerEvents:"none",zIndex:1}},At=(W,Le)=>{const Ve=Oe(W);return Ve?zb(Fo(Ve,Le,z),Le,z):null},Gt=W=>Le=>{if(!l){if(O.current){O.current=!1;return}Le.stopPropagation(),Ge(W)}},Et=je?At(je,"left"):null,zt=ye?At(ye,"right"):null,Ft=Et?Gr(Et,z):null,pt=zt?Gr(zt,z):null;return a.jsxs("div",{ref:A,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:te==="open"?"none":void 0},onClick:Ut,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Rt?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:Rt?1:0,transition:ee?"none":`opacity ${Hn}ms ${wn}`,pointerEvents:"none"},children:a.jsx(Gu,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:c,onClose:Ut})})]}),Rt&&Je&&a.jsx(Xr,{media:Je,style:Ot(Je,"left","far"),onMeasure:ot,onTransitionEnd:yt},`far-prev-${Je.url}`),Rt&&je&&a.jsxs(a.Fragment,{children:[a.jsx(Xr,{media:je,style:Ot(je,"left"),onMeasure:ot,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||ee?"default":"pointer",pointerEvents:l||ee?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Rt&&ye&&a.jsxs(a.Fragment,{children:[a.jsx(Xr,{media:ye,style:Ot(ye,"right"),onMeasure:ot,onTransitionEnd:yt},`next-${ye.url}`),pt&&a.jsx("div",{style:{position:"absolute",top:pt.top,left:pt.left,width:pt.width,height:pt.height,cursor:l||ee?"default":"pointer",pointerEvents:l||ee?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Rt&&st&&a.jsx(Xr,{media:st,style:Ot(st,"right","far"),onMeasure:ot,onTransitionEnd:yt},`far-next-${st.url}`),Q&&J&&(He?a.jsx(Vb,{src:J.url,phase:te,onMediaElement:Vt,wrapperStyle:ht,videoStyle:Pt,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 Xb=20,qb=.18;function Ub(e){return`
|
|
18809
18809
|
.${e}-wrapper {
|
|
18810
18810
|
box-sizing: border-box;
|
|
18811
18811
|
max-width: 100%;
|
|
@@ -18893,7 +18893,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18893
18893
|
pointer-events: auto;
|
|
18894
18894
|
}
|
|
18895
18895
|
${Lb(e)}
|
|
18896
|
-
`}function Kb(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 Yb(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 Zb(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:
|
|
18896
|
+
`}function Kb(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 Yb(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 Zb(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:_.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:_.scalingValue(i*qb,n??!1),[`--${t}-image-aspect`]:Kb(e)}}function Jb(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 Qb(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 eS(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?lp(c,o):void 0)}}function tS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:c}=_.useScopedStyles(),d=s.useMemo(()=>Ub(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=_.scalingValue(v,n??!1),g=`max(${m}, ${Xb}px)`,{objectFitMode:b,imageStyle:S}=Qb(e),A=Jb(e,n),f=s.useRef(null),[w,G]=s.useState(!1),[q,E]=s.useState([]),[P,M]=s.useState(0),[X,$]=s.useState(0),[T,O]=s.useState(null),[N,L]=s.useState({title1:"",title2:"",title3:""}),C=(!n||i)&&!w,j=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},x=j.sizeType??"none",Y=C&&x!=="none"?`${c}-item-image-hover-${x}`:void 0,R=(j.value??120)/100,H=s.useCallback(de=>{!de||x!=="scale"||(de.style.transformOrigin=Zh(de))},[x]),D=s.useCallback(de=>{if(de){if(b==="contain"){const K=Yb(de);if(K){const se=de.closest(`.${c}-item-image`);se instanceof HTMLElement&&se.style.setProperty(`--${c}-item-media-aspect`,String(K))}}H(de)}},[c,H,b]),Q={width:_.scalingValue(y,n??!1),...A,...Zb(e,c,n),[`--${c}-image-hover-scale`]:String(R)},ae=(()=>{const de={},K=f.current?getComputedStyle(f.current).getPropertyValue("--cntrl-article-width").trim():"";return K&&(de["--cntrl-article-width"]=K),de})(),z=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),re=s.useMemo(()=>Fb(u),[u]),F=s.useMemo(()=>Ob(u),[u]),le=(de,K)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const se=re.findIndex(ve=>ve.gridIndex===de);if(se<0)return;const ue=re[se];$(se),E(ue.items),M(0),L(ue.entry),O(K??null),G(!0)},te=s.useCallback(()=>{G(!1),O(null)},[]),fe=s.useCallback(()=>{const de=re[X];return!de||!f.current?T:Ab(f.current,de.gridIndex,b)??T},[re,X,T,b]),Pe=s.useCallback(de=>{if(re.length>1){const K=re.length,se=(X+de+K)%K,ue=re[se];$(se),E(ue.items),M(0),L(ue.entry);return}M(K=>(K+de+q.length)%q.length)},[re,X,q.length]),xe=re.length>1||q.length>1;return s.useEffect(()=>{if(!w||typeof document>"u")return;const de=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=de}},[w]),s.useEffect(()=>{!n||o||i||G(!1)},[n,o,i]),s.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&G(!1)},[e==null?void 0:e.lightbox]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx(Db,{mediaList:F}),a.jsx("div",{ref:f,className:`${c}-wrapper ${c}-type-${p}`,style:Q,children:u.map((de,K)=>{var ve,$e;const se=!!((ve=de.image)!=null&&ve.url),ue=eS(!!z,se,K,c,b,le);return a.jsxs("div",{className:`${c}-item`,children:[de.title?a.jsx("span",{className:`${c}-item-title`,onClick:ue,style:ue?{cursor:"pointer"}:void 0,children:de.title}):null,($e=de.image)!=null&&$e.url?a.jsx("span",{className:[`${c}-item-image`,b==="contain"?`${c}-item-image-fit`:void 0,Y].filter(Boolean).join(" "),children:de.image.type==="video"?a.jsx("video",{ref:D,src:de.image.url,"data-waterfall-index":K,style:S,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:ue,onLoadedData:ke=>D(ke.currentTarget)}):a.jsx("img",{ref:D,src:de.image.url,alt:de.image.name??"","data-waterfall-index":K,style:S,onClick:ue,onLoad:ke=>D(ke.currentTarget)})}):null,K<u.length-1&&a.jsx("div",{className:`${c}-item-gap-host`,style:{width:m},children:o&&!w&&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%"}})})]},K)})}),w&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const de=(l?document.getElementById(l):null)??document.body;return Gn.createPortal(a.jsx("div",{style:ae,"data-selection":"none",children:a.jsx(Gb,{prefix:c,items:q,index:P,entry:N,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:xe,lightboxEntries:re,entryIdx:X,layoutId:r,sourceRect:T,resolveCloseSourceRect:fe,onClose:te,onPrev:()=>Pe(-1),onNext:()=>Pe(1)})}),de)})()]})}const nS=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
18897
18897
|
import type React from 'react';
|
|
18898
18898
|
import { createPortal } from 'react-dom';
|
|
18899
18899
|
import { CommonComponentProps } from '../props';
|
|
@@ -19407,7 +19407,7 @@ export function Waterfall({
|
|
|
19407
19407
|
</>
|
|
19408
19408
|
);
|
|
19409
19409
|
}
|
|
19410
|
-
`,iS="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 oS(e){const t={};return t[xt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[xt(e,"fontSettings")]={...fi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[xt(e,"fontSize")]={...fi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[xt(e,"lineHeight")]={...fi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[xt(e,"letterSpacing")]={...fi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[xt(e,"wordSpacing")]={...fi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[xt(e,"textAlign")]={...fi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[xt(e,"textAppearance")]={...fi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const No=Ti.filter(e=>e!=="count"),rS=No.reduce((e,t)=>({...e,...oS(t)}),{}),aS=No.reduce((e,t)=>({...e,[xt(t,"fontFamily")]:"Arial",[xt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[xt(t,"letterSpacing")]:0,[xt(t,"wordSpacing")]:0,[xt(t,"textAlign")]:"left",[xt(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[xt(n,"fontSize")]=i),o!==void 0&&(t[xt(n,"lineHeight")]=o),t},{})}const sS={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(No.map(e=>[kl[e],El(e)]))},qr={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},lS=[{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"}}],cS={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:lS},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:{...fi.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"]}}},...rS},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:iS,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...aS},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:[sS]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},dS={element:tS,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:`${xt(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...No.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${xt(t,"fontFamily")}`}),{})},schema:cS,sourceCode:nS},So=500,up="cubic-bezier(0.25, 1, 0.5, 1)",uS=300,pS=5,mS=.15,gS=.4,hS=100,ro=100,rd={color:"#000000",hover:"#cccccc"},Yo={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},fS={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"},ad={sizeType:"drag",value:3},yS="left";function vS(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:yS,color:(e==null?void 0:e.titleColor)??"#000000"};return Qt(n,t)}function ao(e,t,n){return`${e}: ${N.scalingValue(t/1440,n)};`}function ir(e,t){return t<=0?0:(e%t+t)%t}function xS(e,t,n,i){if(!i)return{position:ir(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 bS(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function SS(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 wS(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 $S(e,t){return`
|
|
19410
|
+
`,iS="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 oS(e){const t={};return t[xt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[xt(e,"fontSettings")]={...fi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[xt(e,"fontSize")]={...fi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[xt(e,"lineHeight")]={...fi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[xt(e,"letterSpacing")]={...fi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[xt(e,"wordSpacing")]={...fi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[xt(e,"textAlign")]={...fi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[xt(e,"textAppearance")]={...fi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const No=Ti.filter(e=>e!=="count"),rS=No.reduce((e,t)=>({...e,...oS(t)}),{}),aS=No.reduce((e,t)=>({...e,[xt(t,"fontFamily")]:"Arial",[xt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[xt(t,"letterSpacing")]:0,[xt(t,"wordSpacing")]:0,[xt(t,"textAlign")]:"left",[xt(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[xt(n,"fontSize")]=i),o!==void 0&&(t[xt(n,"lineHeight")]=o),t},{})}const sS={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(No.map(e=>[kl[e],El(e)]))},qr={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},lS=[{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"}}],cS={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:lS},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:{...fi.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"]}}},...rS},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:iS,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...aS},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:[sS]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},dS={element:tS,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:`${xt(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...No.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${xt(t,"fontFamily")}`}),{})},schema:cS,sourceCode:nS},So=500,up="cubic-bezier(0.25, 1, 0.5, 1)",uS=300,pS=5,mS=.15,gS=.4,hS=100,ro=100,rd={color:"#000000",hover:"#cccccc"},Yo={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},fS={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"},ad={sizeType:"drag",value:3},yS="left";function vS(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:yS,color:(e==null?void 0:e.titleColor)??"#000000"};return Qt(n,t)}function ao(e,t,n){return`${e}: ${_.scalingValue(t/1440,n)};`}function ir(e,t){return t<=0?0:(e%t+t)%t}function xS(e,t,n,i){if(!i)return{position:ir(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 bS(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function SS(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 wS(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 $S(e,t){return`
|
|
19411
19411
|
.${e}-wrapper {
|
|
19412
19412
|
position: relative;
|
|
19413
19413
|
width: 100%;
|
|
@@ -19677,7 +19677,7 @@ export function Waterfall({
|
|
|
19677
19677
|
from { clip-path: inset(100% 0 0 0); }
|
|
19678
19678
|
to { clip-path: inset(0 0 0 0); }
|
|
19679
19679
|
}
|
|
19680
|
-
`}function CS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=N.useScopedStyles(),l=vS(e,n),c=t??[],d=c.length,u=(e==null?void 0:e.trigger)??ad,p=u.sizeType??"drag",y=u.value??ad.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",b=(e==null?void 0:e.navSize)??"m",S=fS[b],A=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,f=ye=>N.scalingValue(ye*A,n),w=(e==null?void 0:e.show)??"always",G=(e==null?void 0:e.controls)??null,q=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,E=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,P=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,M=(e==null?void 0:e.controlsColor)??rd.color,X=(e==null?void 0:e.controlsHoverColor)??rd.hover,$=(e==null?void 0:e.navColor)??Yo.colors.inactive,T=(e==null?void 0:e.navPaginationColor)??Yo.colors.pagination,O=(e==null?void 0:e.navBackgroundColor)??Yo.colors.background,F=(e==null?void 0:e.linkColor)??ys.linkColor,L=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,C=v==="horizontal",j=p==="click",x=p==="drag",Y=p==="auto"&&(!n||!!i),R=!n,H=m==="slide",D=g==="classic",Q=w!=="never"&&q>0,ae=w==="on hover",z=N.scalingValue(q,n),re={width:z,height:z,maxWidth:z},_=H&&d>1,[le,te]=s.useState(0),[fe,Pe]=s.useState(_?1:0),[xe,ue]=s.useState(!1),[K,se]=s.useState(!1),[de,ve]=s.useState(!1),[$e,ke]=s.useState(0),[he,Se]=s.useState(!1),[Te,h]=s.useState(!1),U=s.useRef(!1),Z=s.useRef(fe);Z.current=fe;const ne=s.useRef(null),me=s.useRef(0),B=s.useRef(null),I=s.useRef(null),ee=s.useRef(null),ie=s.useRef(null),pe=s.useCallback(ye=>{U.current=ye,ue(ye)},[]),V=s.useCallback(ye=>{if(d<2||ye===0)return;const _e=ye>0?1:-1,Be=Math.abs(ye);if(Se(!0),pe(!0),!H){te(st=>ir(st+ye,d));return}let Ze=Z.current;const we=_&&(Ze===0||Ze===d+1),Fe=we?le+1:null;we&&(Ze=le+1);let Ke=Be;for(;Ke>0;){const st=xS(Ze,_e,d,_);if(Ze=st.position,Ke-=1,st.hitBoundary){me.current=Ke*_e;break}}const Je=Be-Ke;if(Je>0&&te(st=>ir(st+Je*_e,d)),Z.current=Ze,Fe!==null){if(Z.current=Fe,Ze===Fe){se(!0),Pe(Ze);return}ne.current=Ze,se(!0),Pe(Fe);return}se(!1),Pe(Ze)},[le,d,_,H,pe]),Ie=s.useCallback(ye=>{V(ye)},[V]),be=s.useCallback(ye=>{if(d<2)return;const _e=ir(ye,d);if(!(_e===le&&!U.current)&&(Se(!0),pe(!0),te(_e),H)){const Be=_e+(_?1:0);ne.current=null,me.current=0,Z.current=Be,se(!1),Pe(Be)}},[le,d,_,H,pe]);s.useEffect(()=>{if(!xe)return;const ye=window.setTimeout(()=>{if(_&&(fe===0||fe===d+1)){ne.current=null,se(!0),Pe(le+1);return}pe(!1)},So);return()=>window.clearTimeout(ye)},[le,d,_,xe,pe,fe]),s.useEffect(()=>{if(!K)return;let ye=0;const _e=requestAnimationFrame(()=>{ye=requestAnimationFrame(()=>{const Be=ne.current;ne.current=null;const Ze=me.current;if(me.current=0,se(!1),Be!==null){Z.current=Be,Pe(Be);return}if(Ze!==0){V(Ze);return}pe(!1)})});return()=>{cancelAnimationFrame(_e),cancelAnimationFrame(ye)}},[V,pe,K]);const J=`${_}:${d}`,He=s.useRef(J);s.useEffect(()=>{if(He.current===J)return;He.current=J;const ye=d>0?Math.min(le,d-1):0;ee.current=null,ie.current=null,ve(!1),ke(0),te(ye),se(!0),Pe(ye+(_?1:0))},[le,d,_,J]),s.useEffect(()=>{if(!he)return;const ye=window.setTimeout(()=>Se(!1),uS);return()=>window.clearTimeout(ye)},[he,le]),s.useEffect(()=>{if(!Y||d<2)return;const ye=Math.max(y,.1)*1e3,_e=window.setInterval(()=>{R&&Te||Ie(1)},ye);return()=>window.clearInterval(_e)},[y,d,Ie,Y,Te,R]);const We=s.useCallback(ye=>{const _e=ee.current;if(!_e||_e.pointerId!==ye.pointerId)return;ee.current=null,ie.current=null;const Be=B.current;if(Be!=null&&Be.hasPointerCapture(ye.pointerId)&&Be.releasePointerCapture(ye.pointerId),!_e.isActive){H&&ke(0);return}const we=!(ye.timeStamp-_e.lastTime>hS)&&Math.abs(_e.velocity)>gS,Fe=_e.size>0&&Math.abs(_e.offset-_e.baseOffset)>_e.size*mS;if(ve(!1),!we&&!Fe){ke(0);return}const Ke=Fe?_e.offset-_e.baseOffset:_e.velocity;let Je=1;Fe&&_e.size>0&&(Je=Math.max(1,Math.round(Math.abs(Ke)/_e.size))),ke(0),V(Ke<0?Je:-Je)},[V,H]);s.useEffect(()=>{const ye=_e=>{ie.current===null||_e.pointerId!==ie.current||We(_e)};return window.addEventListener("pointerup",ye),window.addEventListener("pointercancel",ye),()=>{window.removeEventListener("pointerup",ye),window.removeEventListener("pointercancel",ye)}},[We]);const it=ye=>{const _e=B.current;if(!x||d<2||!_e||ye.pointerType==="mouse"&&ye.button!==0)return;ne.current=null,me.current=0,U.current&&pe(!1);let Be=0;const Ze=I.current;if(H&&Ze){const we=C?Ze.offsetWidth:Ze.offsetHeight;if(we>0){const Fe=bS(Ze,C);let Ke=Z.current;_&&(Ke===0||Ke===d+1)?(Ke=le+1,Z.current=Ke,se(!0),Pe(Ke),Be=0):Be=Fe+Ke*we,ke(Be)}}_e.setPointerCapture(ye.pointerId),ie.current=ye.pointerId,ee.current={pointerId:ye.pointerId,startClientX:ye.clientX,startClientY:ye.clientY,axes:SS(_e,`${r}-axis-probe`),size:C?_e.offsetWidth:_e.offsetHeight,isActive:!1,baseOffset:Be,offset:Be,lastTime:ye.timeStamp,velocity:0}},qe=ye=>{const _e=ee.current;if(!_e||_e.pointerId!==ye.pointerId)return;if(ye.pointerType==="mouse"&&ye.buttons===0){We(ye);return}const Be=ye.clientX-_e.startClientX,Ze=ye.clientY-_e.startClientY,we=_e.axes?wS(_e.axes,Be,Ze):{x:Be,y:Ze},Fe=C?we.x:we.y,Ke=C?we.y:we.x,Je=_e.baseOffset+Fe;if(!_e.isActive){if(Math.max(Math.abs(Fe),Math.abs(Ke))<pS)return;if(Math.abs(Ke)>Math.abs(Fe)){const ot=B.current;ot!=null&&ot.hasPointerCapture(_e.pointerId)&&ot.releasePointerCapture(_e.pointerId),ee.current=null,ie.current=null,H&&ke(0);return}_e.isActive=!0,ve(!0)}const st=ye.timeStamp-_e.lastTime;st>0&&(_e.velocity=(Je-_e.offset)/st,_e.lastTime=ye.timeStamp),_e.offset=Je,H&&ke(Je)},tt=ye=>{We(ye)},et=C?`translate3d(calc(${-fe*100}% + ${$e}px), 0, 0)`:`translate3d(0, calc(${-fe*100}% + ${$e}px), 0)`,je=_?[c[d-1],...c,c[0]]:c;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:$S(r,n)}}),a.jsxs("div",{className:Tt(`${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:B,className:Tt(`${r}-track`,{[`${r}-track-draggable`]:x,[`${r}-track-draggable-vertical`]:x&&!C}),onPointerDown:it,onPointerMove:qe,onPointerUp:tt,onPointerCancel:tt,onLostPointerCapture:ye=>{ie.current===ye.pointerId&&We(ye)},children:a.jsx("div",{ref:I,className:Tt(`${r}-list`,{[`${r}-list-slide`]:H,[`${r}-list-slide-vertical`]:H&&!C,[`${r}-list-fade`]:!H}),style:H?{transform:et,transition:de||K?"none":`transform ${So}ms ${up}`}:void 0,children:je.map((ye,_e)=>{const Be=_?ir(_e-1,d):_e,we=_&&(_e===0||_e===d+1)?`clone-${_e===0?"start":"end"}`:`slide-${Be}`;return a.jsx("div",{className:Tt(`${r}-slide`,{[`${r}-is-active`]:!H&&Be===le}),children:a.jsx("div",{className:`${r}-slider-item`,children:a.jsx("div",{className:`${r}-img-wrapper`,children:a.jsx("img",{className:Tt(`${r}-slider-image`,{[`${r}-contain`]:ye.image.objectFit==="contain",[`${r}-cover`]:ye.image.objectFit==="cover"}),src:ye.image.url,alt:ye.image.name??"",draggable:!1})})})},we)})})}),Q&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Tt(`${r}-arrow`,{[`${r}-arrow-prev`]:C,[`${r}-arrow-prev-vertical`]:!C,[`${r}-hover-arrow`]:ae}),style:{color:M,"--arrow-hover-color":X,...re},children:a.jsxs("button",{onClick:ye=>{ye.stopPropagation(),Ie(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${N.scalingValue(E,n)}, ${N.scalingValue(P*(C?1:-1),n)}) rotate(${C?"0deg":"90deg"})`},children:[G&&a.jsx(mn,{url:G,fill:M,hoverFill:X,className:Tt(`${r}-arrow-img`,`${r}-mirror`),style:re}),!G&&a.jsx(sd,{color:M,className:Tt(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:Tt(`${r}-arrow`,{[`${r}-arrow-next`]:C,[`${r}-arrow-next-vertical`]:!C,[`${r}-hover-arrow`]:ae}),style:{color:M,"--arrow-hover-color":X,...re},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:ye=>{ye.stopPropagation(),Ie(1)},style:{transform:`translate(${N.scalingValue(E*(C?-1:1),n)}, ${N.scalingValue(P,n)}) rotate(${C?"0deg":"90deg"})`},children:[G&&a.jsx(mn,{url:G,fill:M,hoverFill:X,className:`${r}-arrow-img`,style:re}),!G&&a.jsx(sd,{color:M,className:Tt(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),j&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>Ie(1)}),D&&a.jsx("div",{className:Tt(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:C,[`${r}-pagination-inside-left`]:!C}),style:C?{bottom:f(S.inset)}:{left:f(S.inset)},children:a.jsx("div",{className:Tt(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!C,[`${r}-animate-dots`]:he}),style:{backgroundColor:O,gap:f(S.gapInactive-S.activeDot+S.dot),...C?{height:f(S.activeDot+S.paddingY*2),paddingTop:f(S.paddingY),paddingBottom:f(S.paddingY),paddingLeft:f(S.paddingActive),paddingRight:f(S.paddingActive)}:{width:f(S.activeDot+S.paddingY*2),paddingLeft:f(S.paddingY),paddingRight:f(S.paddingY),paddingTop:f(S.paddingActive),paddingBottom:f(S.paddingActive)},borderRadius:f(S.borderRadius),transform:`translate(${N.scalingValue(Yo.offset.x,n)}, ${N.scalingValue(Yo.offset.y,n)})`},children:c.map((ye,_e)=>{const Be=_e===le,Ze=Be?S.activeDot:S.dot;return a.jsx("button",{onClick:()=>be(_e),className:`${r}-pagination-item`,style:{width:f(S.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:Be?T:$,width:f(Ze)}})},_e)})},`${b}-${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:N.scalingValue(L,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:c.map((ye,_e)=>a.jsx("div",{className:Tt(`${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":F,"--link-hover-color":F,position:"relative",top:N.scalingValue(ys.offset.y,n),left:N.scalingValue(ys.offset.x,n)},children:a.jsx(Zi,{content:ye.imageCaption})})},_e))})]})]})]})}function sd({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 TS=`import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
19680
|
+
`}function CS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=_.useScopedStyles(),l=vS(e,n),c=t??[],d=c.length,u=(e==null?void 0:e.trigger)??ad,p=u.sizeType??"drag",y=u.value??ad.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",b=(e==null?void 0:e.navSize)??"m",S=fS[b],A=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,f=ye=>_.scalingValue(ye*A,n),w=(e==null?void 0:e.show)??"always",G=(e==null?void 0:e.controls)??null,q=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,E=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,P=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,M=(e==null?void 0:e.controlsColor)??rd.color,X=(e==null?void 0:e.controlsHoverColor)??rd.hover,$=(e==null?void 0:e.navColor)??Yo.colors.inactive,T=(e==null?void 0:e.navPaginationColor)??Yo.colors.pagination,O=(e==null?void 0:e.navBackgroundColor)??Yo.colors.background,N=(e==null?void 0:e.linkColor)??ys.linkColor,L=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,C=v==="horizontal",j=p==="click",x=p==="drag",Y=p==="auto"&&(!n||!!i),R=!n,H=m==="slide",D=g==="classic",Q=w!=="never"&&q>0,ae=w==="on hover",z=_.scalingValue(q,n),re={width:z,height:z,maxWidth:z},F=H&&d>1,[le,te]=s.useState(0),[fe,Pe]=s.useState(F?1:0),[xe,de]=s.useState(!1),[K,se]=s.useState(!1),[ue,ve]=s.useState(!1),[$e,ke]=s.useState(0),[he,Se]=s.useState(!1),[Ce,h]=s.useState(!1),U=s.useRef(!1),Z=s.useRef(fe);Z.current=fe;const ne=s.useRef(null),me=s.useRef(0),B=s.useRef(null),I=s.useRef(null),ee=s.useRef(null),ie=s.useRef(null),pe=s.useCallback(ye=>{U.current=ye,de(ye)},[]),V=s.useCallback(ye=>{if(d<2||ye===0)return;const _e=ye>0?1:-1,Be=Math.abs(ye);if(Se(!0),pe(!0),!H){te(st=>ir(st+ye,d));return}let Ze=Z.current;const we=F&&(Ze===0||Ze===d+1),Fe=we?le+1:null;we&&(Ze=le+1);let Ke=Be;for(;Ke>0;){const st=xS(Ze,_e,d,F);if(Ze=st.position,Ke-=1,st.hitBoundary){me.current=Ke*_e;break}}const Je=Be-Ke;if(Je>0&&te(st=>ir(st+Je*_e,d)),Z.current=Ze,Fe!==null){if(Z.current=Fe,Ze===Fe){se(!0),Pe(Ze);return}ne.current=Ze,se(!0),Pe(Fe);return}se(!1),Pe(Ze)},[le,d,F,H,pe]),Ie=s.useCallback(ye=>{V(ye)},[V]),be=s.useCallback(ye=>{if(d<2)return;const _e=ir(ye,d);if(!(_e===le&&!U.current)&&(Se(!0),pe(!0),te(_e),H)){const Be=_e+(F?1:0);ne.current=null,me.current=0,Z.current=Be,se(!1),Pe(Be)}},[le,d,F,H,pe]);s.useEffect(()=>{if(!xe)return;const ye=window.setTimeout(()=>{if(F&&(fe===0||fe===d+1)){ne.current=null,se(!0),Pe(le+1);return}pe(!1)},So);return()=>window.clearTimeout(ye)},[le,d,F,xe,pe,fe]),s.useEffect(()=>{if(!K)return;let ye=0;const _e=requestAnimationFrame(()=>{ye=requestAnimationFrame(()=>{const Be=ne.current;ne.current=null;const Ze=me.current;if(me.current=0,se(!1),Be!==null){Z.current=Be,Pe(Be);return}if(Ze!==0){V(Ze);return}pe(!1)})});return()=>{cancelAnimationFrame(_e),cancelAnimationFrame(ye)}},[V,pe,K]);const J=`${F}:${d}`,He=s.useRef(J);s.useEffect(()=>{if(He.current===J)return;He.current=J;const ye=d>0?Math.min(le,d-1):0;ee.current=null,ie.current=null,ve(!1),ke(0),te(ye),se(!0),Pe(ye+(F?1:0))},[le,d,F,J]),s.useEffect(()=>{if(!he)return;const ye=window.setTimeout(()=>Se(!1),uS);return()=>window.clearTimeout(ye)},[he,le]),s.useEffect(()=>{if(!Y||d<2)return;const ye=Math.max(y,.1)*1e3,_e=window.setInterval(()=>{R&&Ce||Ie(1)},ye);return()=>window.clearInterval(_e)},[y,d,Ie,Y,Ce,R]);const We=s.useCallback(ye=>{const _e=ee.current;if(!_e||_e.pointerId!==ye.pointerId)return;ee.current=null,ie.current=null;const Be=B.current;if(Be!=null&&Be.hasPointerCapture(ye.pointerId)&&Be.releasePointerCapture(ye.pointerId),!_e.isActive){H&&ke(0);return}const we=!(ye.timeStamp-_e.lastTime>hS)&&Math.abs(_e.velocity)>gS,Fe=_e.size>0&&Math.abs(_e.offset-_e.baseOffset)>_e.size*mS;if(ve(!1),!we&&!Fe){ke(0);return}const Ke=Fe?_e.offset-_e.baseOffset:_e.velocity;let Je=1;Fe&&_e.size>0&&(Je=Math.max(1,Math.round(Math.abs(Ke)/_e.size))),ke(0),V(Ke<0?Je:-Je)},[V,H]);s.useEffect(()=>{const ye=_e=>{ie.current===null||_e.pointerId!==ie.current||We(_e)};return window.addEventListener("pointerup",ye),window.addEventListener("pointercancel",ye),()=>{window.removeEventListener("pointerup",ye),window.removeEventListener("pointercancel",ye)}},[We]);const it=ye=>{const _e=B.current;if(!x||d<2||!_e||ye.pointerType==="mouse"&&ye.button!==0)return;ne.current=null,me.current=0,U.current&&pe(!1);let Be=0;const Ze=I.current;if(H&&Ze){const we=C?Ze.offsetWidth:Ze.offsetHeight;if(we>0){const Fe=bS(Ze,C);let Ke=Z.current;F&&(Ke===0||Ke===d+1)?(Ke=le+1,Z.current=Ke,se(!0),Pe(Ke),Be=0):Be=Fe+Ke*we,ke(Be)}}_e.setPointerCapture(ye.pointerId),ie.current=ye.pointerId,ee.current={pointerId:ye.pointerId,startClientX:ye.clientX,startClientY:ye.clientY,axes:SS(_e,`${r}-axis-probe`),size:C?_e.offsetWidth:_e.offsetHeight,isActive:!1,baseOffset:Be,offset:Be,lastTime:ye.timeStamp,velocity:0}},qe=ye=>{const _e=ee.current;if(!_e||_e.pointerId!==ye.pointerId)return;if(ye.pointerType==="mouse"&&ye.buttons===0){We(ye);return}const Be=ye.clientX-_e.startClientX,Ze=ye.clientY-_e.startClientY,we=_e.axes?wS(_e.axes,Be,Ze):{x:Be,y:Ze},Fe=C?we.x:we.y,Ke=C?we.y:we.x,Je=_e.baseOffset+Fe;if(!_e.isActive){if(Math.max(Math.abs(Fe),Math.abs(Ke))<pS)return;if(Math.abs(Ke)>Math.abs(Fe)){const ot=B.current;ot!=null&&ot.hasPointerCapture(_e.pointerId)&&ot.releasePointerCapture(_e.pointerId),ee.current=null,ie.current=null,H&&ke(0);return}_e.isActive=!0,ve(!0)}const st=ye.timeStamp-_e.lastTime;st>0&&(_e.velocity=(Je-_e.offset)/st,_e.lastTime=ye.timeStamp),_e.offset=Je,H&&ke(Je)},tt=ye=>{We(ye)},et=C?`translate3d(calc(${-fe*100}% + ${$e}px), 0, 0)`:`translate3d(0, calc(${-fe*100}% + ${$e}px), 0)`,je=F?[c[d-1],...c,c[0]]:c;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:$S(r,n)}}),a.jsxs("div",{className:Tt(`${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:B,className:Tt(`${r}-track`,{[`${r}-track-draggable`]:x,[`${r}-track-draggable-vertical`]:x&&!C}),onPointerDown:it,onPointerMove:qe,onPointerUp:tt,onPointerCancel:tt,onLostPointerCapture:ye=>{ie.current===ye.pointerId&&We(ye)},children:a.jsx("div",{ref:I,className:Tt(`${r}-list`,{[`${r}-list-slide`]:H,[`${r}-list-slide-vertical`]:H&&!C,[`${r}-list-fade`]:!H}),style:H?{transform:et,transition:ue||K?"none":`transform ${So}ms ${up}`}:void 0,children:je.map((ye,_e)=>{const Be=F?ir(_e-1,d):_e,we=F&&(_e===0||_e===d+1)?`clone-${_e===0?"start":"end"}`:`slide-${Be}`;return a.jsx("div",{className:Tt(`${r}-slide`,{[`${r}-is-active`]:!H&&Be===le}),children:a.jsx("div",{className:`${r}-slider-item`,children:a.jsx("div",{className:`${r}-img-wrapper`,children:a.jsx("img",{className:Tt(`${r}-slider-image`,{[`${r}-contain`]:ye.image.objectFit==="contain",[`${r}-cover`]:ye.image.objectFit==="cover"}),src:ye.image.url,alt:ye.image.name??"",draggable:!1})})})},we)})})}),Q&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Tt(`${r}-arrow`,{[`${r}-arrow-prev`]:C,[`${r}-arrow-prev-vertical`]:!C,[`${r}-hover-arrow`]:ae}),style:{color:M,"--arrow-hover-color":X,...re},children:a.jsxs("button",{onClick:ye=>{ye.stopPropagation(),Ie(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${_.scalingValue(E,n)}, ${_.scalingValue(P*(C?1:-1),n)}) rotate(${C?"0deg":"90deg"})`},children:[G&&a.jsx(mn,{url:G,fill:M,hoverFill:X,className:Tt(`${r}-arrow-img`,`${r}-mirror`),style:re}),!G&&a.jsx(sd,{color:M,className:Tt(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:Tt(`${r}-arrow`,{[`${r}-arrow-next`]:C,[`${r}-arrow-next-vertical`]:!C,[`${r}-hover-arrow`]:ae}),style:{color:M,"--arrow-hover-color":X,...re},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:ye=>{ye.stopPropagation(),Ie(1)},style:{transform:`translate(${_.scalingValue(E*(C?-1:1),n)}, ${_.scalingValue(P,n)}) rotate(${C?"0deg":"90deg"})`},children:[G&&a.jsx(mn,{url:G,fill:M,hoverFill:X,className:`${r}-arrow-img`,style:re}),!G&&a.jsx(sd,{color:M,className:Tt(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),j&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>Ie(1)}),D&&a.jsx("div",{className:Tt(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:C,[`${r}-pagination-inside-left`]:!C}),style:C?{bottom:f(S.inset)}:{left:f(S.inset)},children:a.jsx("div",{className:Tt(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!C,[`${r}-animate-dots`]:he}),style:{backgroundColor:O,gap:f(S.gapInactive-S.activeDot+S.dot),...C?{height:f(S.activeDot+S.paddingY*2),paddingTop:f(S.paddingY),paddingBottom:f(S.paddingY),paddingLeft:f(S.paddingActive),paddingRight:f(S.paddingActive)}:{width:f(S.activeDot+S.paddingY*2),paddingLeft:f(S.paddingY),paddingRight:f(S.paddingY),paddingTop:f(S.paddingActive),paddingBottom:f(S.paddingActive)},borderRadius:f(S.borderRadius),transform:`translate(${_.scalingValue(Yo.offset.x,n)}, ${_.scalingValue(Yo.offset.y,n)})`},children:c.map((ye,_e)=>{const Be=_e===le,Ze=Be?S.activeDot:S.dot;return a.jsx("button",{onClick:()=>be(_e),className:`${r}-pagination-item`,style:{width:f(S.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:Be?T:$,width:f(Ze)}})},_e)})},`${b}-${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:_.scalingValue(L,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:c.map((ye,_e)=>a.jsx("div",{className:Tt(`${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":N,"--link-hover-color":N,position:"relative",top:_.scalingValue(ys.offset.y,n),left:_.scalingValue(ys.offset.x,n)},children:a.jsx(Zi,{content:ye.imageCaption})})},_e))})]})]})]})}function sd({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 TS=`import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
19681
19681
|
import cn from 'classnames';
|
|
19682
19682
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
19683
19683
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -20858,7 +20858,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
20858
20858
|
</svg>
|
|
20859
20859
|
);
|
|
20860
20860
|
}
|
|
20861
|
-
`,LS={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"}]}]}]}},PS={element:CS,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:LS,sourceCode:TS,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls"}]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily"}},po=300/1440,IS=8/1440,Qn=.004;function RS(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function vs(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function xs(e,t,n,i,o="title-leading-gap"){const r=e??.01;return t===void 0||t>=r?{}:{[`--${n}-${o}`]:
|
|
20861
|
+
`,LS={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"}]}]}]}},PS={element:CS,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:LS,sourceCode:TS,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls"}]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily"}},po=300/1440,IS=8/1440,Qn=.004;function RS(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function vs(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function xs(e,t,n,i,o="title-leading-gap"){const r=e??.01;return t===void 0||t>=r?{}:{[`--${n}-${o}`]:_.scalingValue((r-t)/2,i)}}function kS(e){return`
|
|
20862
20862
|
.${e}-wrapper {
|
|
20863
20863
|
box-sizing: border-box;
|
|
20864
20864
|
display: flex;
|
|
@@ -21098,7 +21098,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
21098
21098
|
width: var(--cntrl-article-width, 100vw) !important;
|
|
21099
21099
|
height: var(--cntrl-viewport-height, 100vh) !important;
|
|
21100
21100
|
}
|
|
21101
|
-
`}const pp={"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 ES(e){return e in pp}function MS(e){if(e&&ES(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 pp[e]}const AS="rgba(28,31,34,0.9)",Zn=500,zi="cubic-bezier(0.22, 1, 0.36, 1)",FS=72,NS=50,_S={titleColor:"title-color",descriptionColor:"description-color",lightboxCounterColor:"lightbox-counter-color"},HS=[];function WS(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 OS(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function DS(e){const[t]=e.media;return t!=null&&t.url?t:null}function zS(e){if(!Array.isArray(e)||e.length===0)return[];if(WS(e)){const t=[];for(const n of e){const i=OS(n);if(!i)continue;const o=DS(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 BS(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 jS(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const VS=1140/1440;function GS(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 XS(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 qS(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function US({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()=>{BS(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 KS({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),b=s.useRef(0),S=s.useRef(0),A=s.useRef("none"),f=s.useRef(!1),w=s.useRef(!1),G=s.useRef(!1),q=s.useRef(null),[E,P]=s.useState(null),[M,X]=s.useState("opening"),[$,T]=s.useState(0),[O,F]=s.useState(0),[L,C]=s.useState(!1),[j,x]=s.useState(!1),[Y,R]=s.useState(!1),H=s.useRef(n),D=t[n],Q=D?Xs(D):!1,ae=O!==0||L,z=s.useCallback(he=>{G.current=he,C(he)},[]),re=s.useCallback(()=>{q.current!==null&&(window.clearTimeout(q.current),q.current=null)},[]),_=s.useCallback(()=>{re(),q.current=window.setTimeout(()=>{re(),z(!1)},Zn+32)},[re,z]),le=s.useCallback(()=>{const he=v.current,Se=m.current;if(!he)return;const Te=he.getBoundingClientRect(),h=Te.width,U=Te.height;if(!h||!U)return;if(i==="cover"){P({width:h,height:U,left:Te.left,top:Te.top});return}if(!Se){P(Ur(he));return}const{width:Z,height:ne}=jS(Se);if(!Z||!ne){P(Ur(he));return}const me=Z/ne,B=h/U;if(me>B){const I=h/me;P({width:h,height:I,left:Te.left,top:Te.top+(U-I)/2})}else{const I=U*me;P({width:I,height:U,left:Te.left+(h-I)/2,top:Te.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(()=>{M==="opening"&&E&&X("open")},[M,E]),s.useEffect(()=>{if(M!=="closing")return;const he=setTimeout(()=>r(),Zn);return()=>clearTimeout(he)},[M,r]),s.useEffect(()=>()=>{re()},[re]),s.useLayoutEffect(()=>{if(H.current===n)return;re(),T(0),F(0),z(!1),R(!1),x(!1),b.current=0,S.current=0,A.current="none",f.current=!1,g.current=null,w.current=!1;const he=v.current;he&&P(Ur(he)),H.current=n},[n,z,re]),s.useEffect(()=>{if(M!=="open")return;let he=null;const Se=()=>{he&&(document.removeEventListener("click",he,!0),he=null)},Te=()=>{Se(),he=B=>{B.stopPropagation(),B.preventDefault(),Se()},document.addEventListener("click",he,!0)},h=B=>{re(),G.current=!1,C(!1),F(0),x(!1),f.current=!1,S.current=0,A.current="none";const I=v.current;I&&P(Ur(I)),B<0?c():l()},U=B=>{if(Math.abs(B)>NS&&t.length>1){h(B);return}z(!0),F(0),_()},Z=B=>{if(B.touches.length!==1||G.current)return;const I=B.touches[0];w.current=!0,g.current={x:I.clientX,y:I.clientY},A.current="none",S.current=0,f.current=!1},ne=B=>{if(!g.current||B.touches.length!==1||G.current)return;const I=B.touches[0],ee=I.clientX-g.current.x,ie=I.clientY-g.current.y;if(A.current==="none"){if(Math.abs(ee)<10&&Math.abs(ie)<10)return;if(Math.abs(ee)>Math.abs(ie)){if(t.length<=1)return;A.current="horizontal"}else if(ie>0)A.current="vertical";else return}if(A.current==="horizontal"){f.current=!0,x(!0),S.current=ee,F(ee),B.preventDefault();return}A.current==="vertical"&&(f.current=!0,x(!0),b.current=ie,T(ie),B.preventDefault())},me=()=>{if(!g.current)return;const B=A.current,I=f.current;if(I&&B==="horizontal")U(S.current),Te();else if(I&&B==="vertical")if(b.current>FS){const ie=window.innerHeight;b.current=ie,R(!0),T(ie),X("closing")}else b.current=0,T(0),Te();else B==="horizontal"&&Math.abs(S.current)>0&&(U(S.current),Te());g.current=null,A.current="none",S.current=0,f.current=!1,x(!1)};return document.addEventListener("touchstart",Z,{passive:!0}),document.addEventListener("touchmove",ne,{passive:!1}),document.addEventListener("touchend",me),document.addEventListener("touchcancel",me),()=>{document.removeEventListener("touchstart",Z),document.removeEventListener("touchmove",ne),document.removeEventListener("touchend",me),document.removeEventListener("touchcancel",me),Se()}},[M,t.length,c,l,z,_,re]),s.useEffect(()=>{const he=Se=>{Se.key==="Escape"&&(Se.preventDefault(),Se.stopPropagation(),M!=="closing"&&X("closing"))};return window.addEventListener("keydown",he,!0),()=>window.removeEventListener("keydown",he,!0)},[M]);const te=()=>{M!=="closing"&&X("closing")},fe=M==="open",Pe=M==="closing",xe=$>0?Math.max(0,1-$/500):1,ue=$>0?Math.max(.35,1-$/500):1,K=he=>{if(he.stopPropagation(),w.current){w.current=!1;return}if(t.length<=1)return;const Se=he.currentTarget.getBoundingClientRect(),Te=he.clientY-Se.top,h=Math.min(52,Se.height*.2);if(!(Te>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(),Te=he.clientX-Se.left,h=he.clientY-Se.top,U=Math.min(52,Se.height*.2);if(h>Se.height-U){he.currentTarget.style.cursor="default";return}he.currentTarget.style.cursor=Te<Se.width/2?"w-resize":"e-resize"},de=s.useCallback(he=>{he.propertyName!=="transform"||!G.current||(re(),z(!1))},[re,z]),ve=ae?`translateX(${O}px)`:$>0?`translateY(${$}px)`:void 0,$e={position:"fixed",top:E==null?void 0:E.top,left:E==null?void 0:E.left,width:E==null?void 0:E.width,height:E==null?void 0:E.height,objectFit:i==="cover"?"cover":"contain",transform:ve,opacity:$>0?ue:M==="opening"||Pe?0:1,transition:j&&!L?"none":L?`transform ${Zn}ms ${zi}`:Y?`transform ${Zn}ms ${zi}, opacity ${Zn}ms ${zi}`:M==="opening"||Pe?`opacity ${Zn}ms ${zi}`:"none",pointerEvents:Q&&fe&&!ae?"auto":"none",touchAction:Q&&fe?"none":void 0,zIndex:9998},ke=E?{position:"fixed",top:E.top,height:E.height,width:E.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:M==="open"?"none":void 0},onClick:te,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:fe?xe:0,transition:j?"none":`opacity ${Zn}ms ${zi}`,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:fe?1:0,transition:`opacity ${Zn}ms ${zi}`,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:fe?1:0,transition:`opacity ${Zn}ms ${zi}`},children:t.length>1&&a.jsxs("p",{className:d,style:u,children:[n+1," / ",t.length]})})]})}),E&&D&&(Q?a.jsx(US,{src:D.url,phase:M,mediaRef:m,mediaStyle:$e,onLoadedMetadata:le,onClick:K,onMouseMove:se,onTransitionEnd:de},`${n}-${D.url}`):a.jsx("img",{ref:m,src:D.url,alt:D.name,onLoad:le,onTransitionEnd:de,style:$e},`${n}-${D.url}`)),fe&&ke&&t.length>1&&!Q&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...ke,left:E.left,cursor:"w-resize",pointerEvents:ae?"none":"auto"},onClick:he=>{if(w.current){w.current=!1;return}he.stopPropagation(),l()}}),a.jsx("div",{style:{...ke,left:E.left+E.width/2,cursor:"e-resize",pointerEvents:ae?"none":"auto"},onClick:he=>{if(w.current){w.current=!1;return}he.stopPropagation(),c()}})]})]})}function ld({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=XS(r),g=M=>N.scalingValue(M,l??!1),b=n??po,S=o?{width:"100%",maxWidth:"100%"}:{width:g(b),maxWidth:"100%"},A=i?{borderRadius:g(i)}:{},f={...S,...v?{aspectRatio:m,height:"auto",overflow:"hidden"}:{},...A},w={...v?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":g(b)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...v?{}:A},q={className:y,style:w,onClick:p?M=>{M.stopPropagation(),p()}:void 0},E=Math.max(c,Qn),P=Xs(t)?a.jsx("video",{...q,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...q,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(E)}})]})}function YS({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 ZS(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 cd({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:b,bottomPaddingControl:S}){const A=s.useRef(null),[f,w]=s.useState(0),G=t??"",q=n??"",E=q.length>0,{horizontal:P,vertical:M}=Dl(i),X=M==="center"||M==="bottom",$=M==="bottom";s.useLayoutEffect(()=>{if(!X)return;const L=A.current;if(!L||typeof ResizeObserver>"u")return;const C=()=>w(L.offsetHeight);C();const j=new ResizeObserver(C);return j.observe(L),()=>j.disconnect()},[G,q,X]);const T=a.jsx("span",{className:`${e}-title-text`,style:d,children:G}),O=E?a.jsx("span",{className:u,style:p,children:q}):null,F=E?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:L=>{A.current=L,o(L)},className:[r,`${e}-title-h-${P}`,`${e}-title-v-${M}`].join(" "),style:{...X?{[`--${e}-title-height`]:`${f}px`}:{},...l},children:a.jsxs("div",{className:`${e}-title-text-stack`,style:c,children:[b,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:[O,F,T]}):a.jsxs(a.Fragment,{children:[T,F,O]})})}),S]})})}const dd=45;function ud(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 JS(e){const t=ud(e,"--cntrl-viewport-height",window.innerHeight),n=ud(e,"--cntrl-article-top",0);return{top:n,height:t,centerY:n+t/2}}function QS(e,t,n){const{vertical:i}=Dl(t),{top:o,height:r,centerY:l}=JS(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 ew(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=QS(u,n,d);return Math.exp(-(p*p)/(2*dd*dd))});let o=0,r=-1;return i.forEach((l,c)=>{l>r&&(r=l,o=c)}),{opacities:i,dominantIndex:o}}function tw(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(ew(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 pd(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 nw({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var lt,Lt;const{prefix:l}=N.useScopedStyles(),c=s.useMemo(()=>kS(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)??VS,m=GS(e==null?void 0:e.imageDisplay),g=(e==null?void 0:e.cornerRadius)??IS,b=MS(e==null?void 0:e.position),{horizontal:S,vertical:A}=Dl(b),f=(e==null?void 0:e.titleTopPadding)??0,w=(e==null?void 0:e.titleBottomPadding)??0,G=(e==null?void 0:e.titleLeftPadding)??0,q=(e==null?void 0:e.titleRightPadding)??0,E=(e==null?void 0:e.titleDescriptionPadding)??0,P=ZS(e==null?void 0:e.transition),M=(e==null?void 0:e.lightbox)??"on",X=p==="b",$=P==="fade"||P==="retype",{setTitleRef:T,dominantIndex:O}=tw(d.length,$,b),F=((lt=d[O])==null?void 0:lt.title)??"",L=((Lt=d[O])==null?void 0:Lt.description)??"",C=pd(F,P==="retype"),j=pd(L,P==="retype"),x=P==="fade"||P==="retype",Y=P==="retype"?C:F,R=P==="retype"?j:L,H=X?void 0:{width:N.scalingValue(y,n??!1)},D=M==="on"&&(!n||i||o),Q=o??!1,ae=(e==null?void 0:e.galleryPaddingRight)??0,z=(e==null?void 0:e.galleryPaddingLeft)??0,re=(e==null?void 0:e.galleryPaddingBetween)??0,_=St=>N.scalingValue(St,n??!1),te={width:_(v)},fe=p==="a"?ae:z,Pe=X?{width:"100%"}:{width:`calc(100% - ${_(y)} - ${_(fe)})`,...p==="c"?{marginLeft:"auto"}:{}},xe=Math.max(ae,Qn),ue=Math.max(z,Qn),K=Math.max(re,Qn),se=Math.max(f,Qn),de=Math.max(w,Qn),ve=Math.max(G,Qn),$e=Math.max(q,Qn),ke=Math.max(E,Qn),he=Math.max(0,(u??1)-(y??po)),Se=p==="a"?Math.max(0,(u??1)-(y??po)-ae):p==="c"?Math.max(0,(u??1)-(y??po)-z):p==="b"?u??1:1,Te=Q&&A==="top",h=Q&&A==="bottom",U=Q&&S==="left",Z=Q&&S==="right",ne=d.length>1,me=X?void 0:_((p==="c"?z:ae)+(y??po)),B=p==="c"&&me?{left:me}:void 0,I=p==="a"&&me?{right:me}:void 0,ee=X?{left:0,width:"100%"}:p==="a"?{right:_(ae),width:_(y)}:{left:_(z),width:_(y)},{titleColor:ie,titleFontFamily:pe,titleFontSettings:V,titleFontSize:Ie,titleLineHeight:be,titleLetterSpacing:J,titleWordSpacing:He,titleAlign:We,titleTextAppearance:it,descriptionColor:qe,descriptionFontFamily:tt,descriptionFontSettings:et,descriptionFontSize:je,descriptionLineHeight:ye,descriptionLetterSpacing:_e,descriptionWordSpacing:Be,descriptionAlign:Ze,descriptionTextAppearance:we,lightboxCounterColor:Fe,lightboxCounterFontFamily:Ke,lightboxCounterFontSettings:Je,lightboxCounterFontSize:st,lightboxCounterLineHeight:ot,lightboxCounterLetterSpacing:Oe,lightboxCounterWordSpacing:Ae,lightboxCounterTextAppearance:gt}=e??{},ze={fontSettings:{fontFamily:pe,fontWeight:(V==null?void 0:V.fontWeight)??400,fontStyle:(V==null?void 0:V.fontStyle)??"normal"},fontSize:Ie??.01,lineHeight:be,letterSpacing:J??0,wordSpacing:He??0,textAlign:We??"left",textAppearance:it,color:ie??"#000000"},Xe=dn(Qt(ze,n)),dt=te,ge={...xs(Ie,be,l,n),...xs(je,ye,l,n,"description-leading-gap")},Re=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:ye,letterSpacing:_e??0,wordSpacing:Be??0,textAlign:Ze??"left",textAppearance:we,color:qe??"#000000"},ut=dn(Qt(nt,n)),Ge=vs(je,ye,`${l}-description-text`,`${l}-description-tight-leading`),bt=_(Q?ke:E),It={fontSettings:{fontFamily:Ke,fontWeight:(Je==null?void 0:Je.fontWeight)??400,fontStyle:(Je==null?void 0:Je.fontStyle)??"normal"},fontSize:st??.01,lineHeight:ot,letterSpacing:Oe??0,wordSpacing:Ae??0,textAppearance:gt,color:Fe??"#DEDDDD"},wt={...dn(Qt(It,n)),...xs(st,ot,l,n)},Vt=vs(st,ot,`${l}-lightbox-counter`,`${l}-text-tight-leading`),jt=N.buildColorVars(l,{titleColor:ie??"#000000",descriptionColor:qe??"#000000",lightboxCounterColor:Fe??"#DEDDDD"},_S,HS),qt=s.useRef(null),[Ut,Rt]=s.useState(!1),[Bt,rn]=s.useState([]),[vt,yt]=s.useState(0),Ee=s.useCallback((St,ht)=>{D&&(rn(St),yt(ht),Rt(!0))},[D]),Qe=s.useCallback(()=>{Rt(!1)},[]),rt=s.useMemo(()=>{const St={...jt},ht=qt.current?getComputedStyle(qt.current).getPropertyValue("--cntrl-article-width").trim():"";return ht&&(St["--cntrl-article-width"]=ht),St},[jt,Ut]);return s.useEffect(()=>{if(!Ut||M!=="on"||typeof document>"u")return;const St=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=St}},[Ut,M]),s.useEffect(()=>{!n||o||i||Rt(!1)},[n,o,i]),s.useEffect(()=>{M==="off"&&Rt(!1)},[M]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx("div",{style:jt,children:a.jsxs("div",{ref:qt,className:`${l}-wrapper`,style:{width:N.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:A==="top"?_(f):void 0,[`--${l}-title-bottom-padding`]:A==="bottom"?_(w):void 0,[`--${l}-title-left-padding`]:S==="left"?_(G):void 0,[`--${l}-title-right-padding`]:S==="right"?_(q):void 0},children:[x&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(bs,{P:l,title:Y,description:R,position:b,titleRef:()=>{},titleClassName:`${Re} ${l}-single-title`,titleContainerStyle:{...ge,...Pe},titleTextBoxStyle:dt,titleStyle:Xe,descriptionClassName:Ge,descriptionStyle:ut,descriptionPadding:bt,showTextBoxOutline:Q,showDescriptionPaddingControl:Q,topPaddingControl:Te?Kr({P:l,controlKey:"titleTopPadding",scaled:_,height:se,paired:!1,side:"top"}):void 0,bottomPaddingControl:h?Kr({P:l,controlKey:"titleBottomPadding",scaled:_,height:de,paired:!1,side:"bottom"}):void 0})}),d.map((St,ht)=>{const Pt=zS(St.gallery),Ot=ht<d.length-1,At=Pt.filter(Et=>Et.lightboxMedia).map(Et=>Et.lightboxMedia),Gt={P:l,position:b,titleRef:T(ht),titleClassName:Re,titleContainerStyle:ge,titleTextBoxStyle:x?{maxWidth:"100%"}:dt,titleStyle:Xe,descriptionClassName:Ge,descriptionStyle:ut,descriptionPadding:bt,showTextBoxOutline:Q&&!x,showDescriptionPaddingControl:Q&&!x,descriptionPaddingPaired:ne,topPaddingControl:Te&&!x?Kr({P:l,controlKey:"titleTopPadding",scaled:_,height:se,paired:ne,side:"top"}):void 0,bottomPaddingControl:h&&!x?Kr({P:l,controlKey:"titleBottomPadding",scaled:_,height:de,paired:ne,side:"bottom"}):void 0};return a.jsxs("div",{"data-item-index":ht,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Ot?_(re):void 0},children:[U&&cd({P:l,controlKey:"titleLeftPadding",scaled:_,width:ve,maxFraction:Se,side:"left",paired:ne,anchorStyle:B}),Z&&cd({P:l,controlKey:"titleRightPadding",scaled:_,width:$e,maxFraction:Se,side:"right",paired:ne,anchorStyle:I}),Q&&Ot&&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:_(K),...ee}}),X?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:Pt.map(({displayMedia:Et,lightboxMedia:zt},Ft)=>{const pt=zt?At.findIndex(W=>W.url===zt.url):-1;return a.jsx(ld,{P:l,media:Et,imgWidth:y||void 0,cornerRadius:g||void 0,imageDisplay:m,isEditor:n,galleryPaddingBetween:re,showPaddingAfter:Ft<Pt.length-1,showControls:Q,onMediaClick:D&&pt>=0?()=>Ee(At,pt):void 0},`${Et.url}-${Ft}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(bs,{...Gt,title:x?"":St.title,description:x?"":St.description})})]}):a.jsxs(a.Fragment,{children:[a.jsx(bs,{...Gt,title:x?"":St.title,description:x?"":St.description}),Pt.length>0&&a.jsx(YS,{P:l,layoutType:p,galleryWidthStyle:H,galleryPaddingRight:ae,galleryPaddingLeft:z,galleryPaddingRightWidth:xe,galleryPaddingLeftWidth:ue,galleryPaddingMaxFraction:he,showControls:Q,scaled:_,children:Pt.map(({displayMedia:Et,lightboxMedia:zt},Ft)=>{const pt=zt?At.findIndex(W=>W.url===zt.url):-1;return a.jsx(ld,{P:l,media:Et,cornerRadius:g||void 0,fillGalleryWidth:!0,imageDisplay:m,isEditor:n,galleryPaddingBetween:re,showPaddingAfter:Ft<Pt.length-1,showControls:Q,onMediaClick:D&&pt>=0?()=>Ee(At,pt):void 0},`${Et.url}-${Ft}`)})})]})]},ht)})]})}),Ut&&M==="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(KS,{prefix:l,items:Bt,index:vt,imageDisplay:qS(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??AS})}),St)})()]})}const iw=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
21101
|
+
`}const pp={"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 ES(e){return e in pp}function MS(e){if(e&&ES(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 pp[e]}const AS="rgba(28,31,34,0.9)",Zn=500,zi="cubic-bezier(0.22, 1, 0.36, 1)",FS=72,NS=50,_S={titleColor:"title-color",descriptionColor:"description-color",lightboxCounterColor:"lightbox-counter-color"},HS=[];function WS(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 OS(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function DS(e){const[t]=e.media;return t!=null&&t.url?t:null}function zS(e){if(!Array.isArray(e)||e.length===0)return[];if(WS(e)){const t=[];for(const n of e){const i=OS(n);if(!i)continue;const o=DS(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 BS(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 jS(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const VS=1140/1440;function GS(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 XS(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 qS(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function US({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()=>{BS(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 KS({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),b=s.useRef(0),S=s.useRef(0),A=s.useRef("none"),f=s.useRef(!1),w=s.useRef(!1),G=s.useRef(!1),q=s.useRef(null),[E,P]=s.useState(null),[M,X]=s.useState("opening"),[$,T]=s.useState(0),[O,N]=s.useState(0),[L,C]=s.useState(!1),[j,x]=s.useState(!1),[Y,R]=s.useState(!1),H=s.useRef(n),D=t[n],Q=D?Xs(D):!1,ae=O!==0||L,z=s.useCallback(he=>{G.current=he,C(he)},[]),re=s.useCallback(()=>{q.current!==null&&(window.clearTimeout(q.current),q.current=null)},[]),F=s.useCallback(()=>{re(),q.current=window.setTimeout(()=>{re(),z(!1)},Zn+32)},[re,z]),le=s.useCallback(()=>{const he=v.current,Se=m.current;if(!he)return;const Ce=he.getBoundingClientRect(),h=Ce.width,U=Ce.height;if(!h||!U)return;if(i==="cover"){P({width:h,height:U,left:Ce.left,top:Ce.top});return}if(!Se){P(Ur(he));return}const{width:Z,height:ne}=jS(Se);if(!Z||!ne){P(Ur(he));return}const me=Z/ne,B=h/U;if(me>B){const I=h/me;P({width:h,height:I,left:Ce.left,top:Ce.top+(U-I)/2})}else{const I=U*me;P({width:I,height:U,left:Ce.left+(h-I)/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(()=>{M==="opening"&&E&&X("open")},[M,E]),s.useEffect(()=>{if(M!=="closing")return;const he=setTimeout(()=>r(),Zn);return()=>clearTimeout(he)},[M,r]),s.useEffect(()=>()=>{re()},[re]),s.useLayoutEffect(()=>{if(H.current===n)return;re(),T(0),N(0),z(!1),R(!1),x(!1),b.current=0,S.current=0,A.current="none",f.current=!1,g.current=null,w.current=!1;const he=v.current;he&&P(Ur(he)),H.current=n},[n,z,re]),s.useEffect(()=>{if(M!=="open")return;let he=null;const Se=()=>{he&&(document.removeEventListener("click",he,!0),he=null)},Ce=()=>{Se(),he=B=>{B.stopPropagation(),B.preventDefault(),Se()},document.addEventListener("click",he,!0)},h=B=>{re(),G.current=!1,C(!1),N(0),x(!1),f.current=!1,S.current=0,A.current="none";const I=v.current;I&&P(Ur(I)),B<0?c():l()},U=B=>{if(Math.abs(B)>NS&&t.length>1){h(B);return}z(!0),N(0),F()},Z=B=>{if(B.touches.length!==1||G.current)return;const I=B.touches[0];w.current=!0,g.current={x:I.clientX,y:I.clientY},A.current="none",S.current=0,f.current=!1},ne=B=>{if(!g.current||B.touches.length!==1||G.current)return;const I=B.touches[0],ee=I.clientX-g.current.x,ie=I.clientY-g.current.y;if(A.current==="none"){if(Math.abs(ee)<10&&Math.abs(ie)<10)return;if(Math.abs(ee)>Math.abs(ie)){if(t.length<=1)return;A.current="horizontal"}else if(ie>0)A.current="vertical";else return}if(A.current==="horizontal"){f.current=!0,x(!0),S.current=ee,N(ee),B.preventDefault();return}A.current==="vertical"&&(f.current=!0,x(!0),b.current=ie,T(ie),B.preventDefault())},me=()=>{if(!g.current)return;const B=A.current,I=f.current;if(I&&B==="horizontal")U(S.current),Ce();else if(I&&B==="vertical")if(b.current>FS){const ie=window.innerHeight;b.current=ie,R(!0),T(ie),X("closing")}else b.current=0,T(0),Ce();else B==="horizontal"&&Math.abs(S.current)>0&&(U(S.current),Ce());g.current=null,A.current="none",S.current=0,f.current=!1,x(!1)};return document.addEventListener("touchstart",Z,{passive:!0}),document.addEventListener("touchmove",ne,{passive:!1}),document.addEventListener("touchend",me),document.addEventListener("touchcancel",me),()=>{document.removeEventListener("touchstart",Z),document.removeEventListener("touchmove",ne),document.removeEventListener("touchend",me),document.removeEventListener("touchcancel",me),Se()}},[M,t.length,c,l,z,F,re]),s.useEffect(()=>{const he=Se=>{Se.key==="Escape"&&(Se.preventDefault(),Se.stopPropagation(),M!=="closing"&&X("closing"))};return window.addEventListener("keydown",he,!0),()=>window.removeEventListener("keydown",he,!0)},[M]);const te=()=>{M!=="closing"&&X("closing")},fe=M==="open",Pe=M==="closing",xe=$>0?Math.max(0,1-$/500):1,de=$>0?Math.max(.35,1-$/500):1,K=he=>{if(he.stopPropagation(),w.current){w.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,U=Math.min(52,Se.height*.2);if(h>Se.height-U){he.currentTarget.style.cursor="default";return}he.currentTarget.style.cursor=Ce<Se.width/2?"w-resize":"e-resize"},ue=s.useCallback(he=>{he.propertyName!=="transform"||!G.current||(re(),z(!1))},[re,z]),ve=ae?`translateX(${O}px)`:$>0?`translateY(${$}px)`:void 0,$e={position:"fixed",top:E==null?void 0:E.top,left:E==null?void 0:E.left,width:E==null?void 0:E.width,height:E==null?void 0:E.height,objectFit:i==="cover"?"cover":"contain",transform:ve,opacity:$>0?de:M==="opening"||Pe?0:1,transition:j&&!L?"none":L?`transform ${Zn}ms ${zi}`:Y?`transform ${Zn}ms ${zi}, opacity ${Zn}ms ${zi}`:M==="opening"||Pe?`opacity ${Zn}ms ${zi}`:"none",pointerEvents:Q&&fe&&!ae?"auto":"none",touchAction:Q&&fe?"none":void 0,zIndex:9998},ke=E?{position:"fixed",top:E.top,height:E.height,width:E.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:M==="open"?"none":void 0},onClick:te,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:fe?xe:0,transition:j?"none":`opacity ${Zn}ms ${zi}`,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:fe?1:0,transition:`opacity ${Zn}ms ${zi}`,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:fe?1:0,transition:`opacity ${Zn}ms ${zi}`},children:t.length>1&&a.jsxs("p",{className:d,style:u,children:[n+1," / ",t.length]})})]})}),E&&D&&(Q?a.jsx(US,{src:D.url,phase:M,mediaRef:m,mediaStyle:$e,onLoadedMetadata:le,onClick:K,onMouseMove:se,onTransitionEnd:ue},`${n}-${D.url}`):a.jsx("img",{ref:m,src:D.url,alt:D.name,onLoad:le,onTransitionEnd:ue,style:$e},`${n}-${D.url}`)),fe&&ke&&t.length>1&&!Q&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...ke,left:E.left,cursor:"w-resize",pointerEvents:ae?"none":"auto"},onClick:he=>{if(w.current){w.current=!1;return}he.stopPropagation(),l()}}),a.jsx("div",{style:{...ke,left:E.left+E.width/2,cursor:"e-resize",pointerEvents:ae?"none":"auto"},onClick:he=>{if(w.current){w.current=!1;return}he.stopPropagation(),c()}})]})]})}function ld({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=XS(r),g=M=>_.scalingValue(M,l??!1),b=n??po,S=o?{width:"100%",maxWidth:"100%"}:{width:g(b),maxWidth:"100%"},A=i?{borderRadius:g(i)}:{},f={...S,...v?{aspectRatio:m,height:"auto",overflow:"hidden"}:{},...A},w={...v?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":g(b)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...v?{}:A},q={className:y,style:w,onClick:p?M=>{M.stopPropagation(),p()}:void 0},E=Math.max(c,Qn),P=Xs(t)?a.jsx("video",{...q,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...q,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(E)}})]})}function YS({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 ZS(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 cd({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:b,bottomPaddingControl:S}){const A=s.useRef(null),[f,w]=s.useState(0),G=t??"",q=n??"",E=q.length>0,{horizontal:P,vertical:M}=Dl(i),X=M==="center"||M==="bottom",$=M==="bottom";s.useLayoutEffect(()=>{if(!X)return;const L=A.current;if(!L||typeof ResizeObserver>"u")return;const C=()=>w(L.offsetHeight);C();const j=new ResizeObserver(C);return j.observe(L),()=>j.disconnect()},[G,q,X]);const T=a.jsx("span",{className:`${e}-title-text`,style:d,children:G}),O=E?a.jsx("span",{className:u,style:p,children:q}):null,N=E?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:L=>{A.current=L,o(L)},className:[r,`${e}-title-h-${P}`,`${e}-title-v-${M}`].join(" "),style:{...X?{[`--${e}-title-height`]:`${f}px`}:{},...l},children:a.jsxs("div",{className:`${e}-title-text-stack`,style:c,children:[b,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:[O,N,T]}):a.jsxs(a.Fragment,{children:[T,N,O]})})}),S]})})}const dd=45;function ud(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 JS(e){const t=ud(e,"--cntrl-viewport-height",window.innerHeight),n=ud(e,"--cntrl-article-top",0);return{top:n,height:t,centerY:n+t/2}}function QS(e,t,n){const{vertical:i}=Dl(t),{top:o,height:r,centerY:l}=JS(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 ew(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=QS(u,n,d);return Math.exp(-(p*p)/(2*dd*dd))});let o=0,r=-1;return i.forEach((l,c)=>{l>r&&(r=l,o=c)}),{opacities:i,dominantIndex:o}}function tw(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(ew(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 pd(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 nw({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var lt,Lt;const{prefix:l}=_.useScopedStyles(),c=s.useMemo(()=>kS(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)??VS,m=GS(e==null?void 0:e.imageDisplay),g=(e==null?void 0:e.cornerRadius)??IS,b=MS(e==null?void 0:e.position),{horizontal:S,vertical:A}=Dl(b),f=(e==null?void 0:e.titleTopPadding)??0,w=(e==null?void 0:e.titleBottomPadding)??0,G=(e==null?void 0:e.titleLeftPadding)??0,q=(e==null?void 0:e.titleRightPadding)??0,E=(e==null?void 0:e.titleDescriptionPadding)??0,P=ZS(e==null?void 0:e.transition),M=(e==null?void 0:e.lightbox)??"on",X=p==="b",$=P==="fade"||P==="retype",{setTitleRef:T,dominantIndex:O}=tw(d.length,$,b),N=((lt=d[O])==null?void 0:lt.title)??"",L=((Lt=d[O])==null?void 0:Lt.description)??"",C=pd(N,P==="retype"),j=pd(L,P==="retype"),x=P==="fade"||P==="retype",Y=P==="retype"?C:N,R=P==="retype"?j:L,H=X?void 0:{width:_.scalingValue(y,n??!1)},D=M==="on"&&(!n||i||o),Q=o??!1,ae=(e==null?void 0:e.galleryPaddingRight)??0,z=(e==null?void 0:e.galleryPaddingLeft)??0,re=(e==null?void 0:e.galleryPaddingBetween)??0,F=St=>_.scalingValue(St,n??!1),te={width:F(v)},fe=p==="a"?ae:z,Pe=X?{width:"100%"}:{width:`calc(100% - ${F(y)} - ${F(fe)})`,...p==="c"?{marginLeft:"auto"}:{}},xe=Math.max(ae,Qn),de=Math.max(z,Qn),K=Math.max(re,Qn),se=Math.max(f,Qn),ue=Math.max(w,Qn),ve=Math.max(G,Qn),$e=Math.max(q,Qn),ke=Math.max(E,Qn),he=Math.max(0,(u??1)-(y??po)),Se=p==="a"?Math.max(0,(u??1)-(y??po)-ae):p==="c"?Math.max(0,(u??1)-(y??po)-z):p==="b"?u??1:1,Ce=Q&&A==="top",h=Q&&A==="bottom",U=Q&&S==="left",Z=Q&&S==="right",ne=d.length>1,me=X?void 0:F((p==="c"?z:ae)+(y??po)),B=p==="c"&&me?{left:me}:void 0,I=p==="a"&&me?{right:me}:void 0,ee=X?{left:0,width:"100%"}:p==="a"?{right:F(ae),width:F(y)}:{left:F(z),width:F(y)},{titleColor:ie,titleFontFamily:pe,titleFontSettings:V,titleFontSize:Ie,titleLineHeight:be,titleLetterSpacing:J,titleWordSpacing:He,titleAlign:We,titleTextAppearance:it,descriptionColor:qe,descriptionFontFamily:tt,descriptionFontSettings:et,descriptionFontSize:je,descriptionLineHeight:ye,descriptionLetterSpacing:_e,descriptionWordSpacing:Be,descriptionAlign:Ze,descriptionTextAppearance:we,lightboxCounterColor:Fe,lightboxCounterFontFamily:Ke,lightboxCounterFontSettings:Je,lightboxCounterFontSize:st,lightboxCounterLineHeight:ot,lightboxCounterLetterSpacing:Oe,lightboxCounterWordSpacing:Ae,lightboxCounterTextAppearance:gt}=e??{},ze={fontSettings:{fontFamily:pe,fontWeight:(V==null?void 0:V.fontWeight)??400,fontStyle:(V==null?void 0:V.fontStyle)??"normal"},fontSize:Ie??.01,lineHeight:be,letterSpacing:J??0,wordSpacing:He??0,textAlign:We??"left",textAppearance:it,color:ie??"#000000"},Xe=dn(Qt(ze,n)),dt=te,ge={...xs(Ie,be,l,n),...xs(je,ye,l,n,"description-leading-gap")},Re=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:ye,letterSpacing:_e??0,wordSpacing:Be??0,textAlign:Ze??"left",textAppearance:we,color:qe??"#000000"},ut=dn(Qt(nt,n)),Ge=vs(je,ye,`${l}-description-text`,`${l}-description-tight-leading`),bt=F(Q?ke:E),It={fontSettings:{fontFamily:Ke,fontWeight:(Je==null?void 0:Je.fontWeight)??400,fontStyle:(Je==null?void 0:Je.fontStyle)??"normal"},fontSize:st??.01,lineHeight:ot,letterSpacing:Oe??0,wordSpacing:Ae??0,textAppearance:gt,color:Fe??"#DEDDDD"},wt={...dn(Qt(It,n)),...xs(st,ot,l,n)},Vt=vs(st,ot,`${l}-lightbox-counter`,`${l}-text-tight-leading`),jt=_.buildColorVars(l,{titleColor:ie??"#000000",descriptionColor:qe??"#000000",lightboxCounterColor:Fe??"#DEDDDD"},_S,HS),qt=s.useRef(null),[Ut,Rt]=s.useState(!1),[Bt,rn]=s.useState([]),[vt,yt]=s.useState(0),Ee=s.useCallback((St,ht)=>{D&&(rn(St),yt(ht),Rt(!0))},[D]),Qe=s.useCallback(()=>{Rt(!1)},[]),rt=s.useMemo(()=>{const St={...jt},ht=qt.current?getComputedStyle(qt.current).getPropertyValue("--cntrl-article-width").trim():"";return ht&&(St["--cntrl-article-width"]=ht),St},[jt,Ut]);return s.useEffect(()=>{if(!Ut||M!=="on"||typeof document>"u")return;const St=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=St}},[Ut,M]),s.useEffect(()=>{!n||o||i||Rt(!1)},[n,o,i]),s.useEffect(()=>{M==="off"&&Rt(!1)},[M]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx("div",{style:jt,children:a.jsxs("div",{ref:qt,className:`${l}-wrapper`,style:{width:_.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:A==="top"?F(f):void 0,[`--${l}-title-bottom-padding`]:A==="bottom"?F(w):void 0,[`--${l}-title-left-padding`]:S==="left"?F(G):void 0,[`--${l}-title-right-padding`]:S==="right"?F(q):void 0},children:[x&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(bs,{P:l,title:Y,description:R,position:b,titleRef:()=>{},titleClassName:`${Re} ${l}-single-title`,titleContainerStyle:{...ge,...Pe},titleTextBoxStyle:dt,titleStyle:Xe,descriptionClassName:Ge,descriptionStyle:ut,descriptionPadding:bt,showTextBoxOutline:Q,showDescriptionPaddingControl:Q,topPaddingControl:Ce?Kr({P:l,controlKey:"titleTopPadding",scaled:F,height:se,paired:!1,side:"top"}):void 0,bottomPaddingControl:h?Kr({P:l,controlKey:"titleBottomPadding",scaled:F,height:ue,paired:!1,side:"bottom"}):void 0})}),d.map((St,ht)=>{const Pt=zS(St.gallery),Ot=ht<d.length-1,At=Pt.filter(Et=>Et.lightboxMedia).map(Et=>Et.lightboxMedia),Gt={P:l,position:b,titleRef:T(ht),titleClassName:Re,titleContainerStyle:ge,titleTextBoxStyle:x?{maxWidth:"100%"}:dt,titleStyle:Xe,descriptionClassName:Ge,descriptionStyle:ut,descriptionPadding:bt,showTextBoxOutline:Q&&!x,showDescriptionPaddingControl:Q&&!x,descriptionPaddingPaired:ne,topPaddingControl:Ce&&!x?Kr({P:l,controlKey:"titleTopPadding",scaled:F,height:se,paired:ne,side:"top"}):void 0,bottomPaddingControl:h&&!x?Kr({P:l,controlKey:"titleBottomPadding",scaled:F,height:ue,paired:ne,side:"bottom"}):void 0};return a.jsxs("div",{"data-item-index":ht,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Ot?F(re):void 0},children:[U&&cd({P:l,controlKey:"titleLeftPadding",scaled:F,width:ve,maxFraction:Se,side:"left",paired:ne,anchorStyle:B}),Z&&cd({P:l,controlKey:"titleRightPadding",scaled:F,width:$e,maxFraction:Se,side:"right",paired:ne,anchorStyle:I}),Q&&Ot&&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:F(K),...ee}}),X?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:Pt.map(({displayMedia:Et,lightboxMedia:zt},Ft)=>{const pt=zt?At.findIndex(W=>W.url===zt.url):-1;return a.jsx(ld,{P:l,media:Et,imgWidth:y||void 0,cornerRadius:g||void 0,imageDisplay:m,isEditor:n,galleryPaddingBetween:re,showPaddingAfter:Ft<Pt.length-1,showControls:Q,onMediaClick:D&&pt>=0?()=>Ee(At,pt):void 0},`${Et.url}-${Ft}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(bs,{...Gt,title:x?"":St.title,description:x?"":St.description})})]}):a.jsxs(a.Fragment,{children:[a.jsx(bs,{...Gt,title:x?"":St.title,description:x?"":St.description}),Pt.length>0&&a.jsx(YS,{P:l,layoutType:p,galleryWidthStyle:H,galleryPaddingRight:ae,galleryPaddingLeft:z,galleryPaddingRightWidth:xe,galleryPaddingLeftWidth:de,galleryPaddingMaxFraction:he,showControls:Q,scaled:F,children:Pt.map(({displayMedia:Et,lightboxMedia:zt},Ft)=>{const pt=zt?At.findIndex(W=>W.url===zt.url):-1;return a.jsx(ld,{P:l,media:Et,cornerRadius:g||void 0,fillGalleryWidth:!0,imageDisplay:m,isEditor:n,galleryPaddingBetween:re,showPaddingAfter:Ft<Pt.length-1,showControls:Q,onMediaClick:D&&pt>=0?()=>Ee(At,pt):void 0},`${Et.url}-${Ft}`)})})]})]},ht)})]})}),Ut&&M==="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(KS,{prefix:l,items:Bt,index:vt,imageDisplay:qS(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??AS})}),St)})()]})}const iw=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
21102
21102
|
import { createPortal } from 'react-dom';
|
|
21103
21103
|
import type React from 'react';
|
|
21104
21104
|
import { CommonComponentProps } from '../props';
|
|
@@ -23438,7 +23438,7 @@ export function Mercury({
|
|
|
23438
23438
|
object-fit: cover;
|
|
23439
23439
|
object-position: center;
|
|
23440
23440
|
}
|
|
23441
|
-
`}function hp(e){return Number(e.toFixed(4))}function md(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 Ss(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 $w(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 Cw(e){const[t,n]=e.ratioValue.split(":").map(Number),i=e.reversed?n:t;return(e.reversed?t:n)/i}function Tw(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 fp(e,t){return(1-e)/(1-e*Math.cos(t))}function Lw(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)*fp(e,i)))}return t||1}function Pw(e,t){return e?1:1+gp*(.35+t)}function Iw(e,t,n,i){const o=t*Pw(n,i);return Math.max(0,(e-o)/2)}function Rw(e,t,n){const i=fp(e,n);return{offset:Math.sin(n)*i/t,scale:i}}function kw(e,t,n){return e/2+t*n}function Ew(e,t,n){return`translate(calc(${e(t)} - var(--helix-base-w) / 2), -50%) scale(${hp(n)})`}function Mw(e){return Math.round(e*1e3)}function yp(e,t,n){const i=Math.cos(e),o=Math.cos(Sw*Math.PI/2);if(i>=o)return n;const r=(i+1)/(o+1);return hp(t+(n-t)*r)}function Aw(e){return yp(e,yw,vw)}function Fw(e){return yp(e,xw,bw)}function Nw(e,t){if(!t)return"none";const n=Fw(e);return n<=0?"none":`blur(${n}px)`}function gd(e,t){const n=t*Math.PI*2,{offset:i,scale:o}=Rw(e.depthFactor,e.spreadFactor,n),r=kw(e.width,e.orbitRadius,i);return{transform:Ew(e.scaled,r,o),zIndex:Mw(o),opacity:Aw(n),filter:Nw(n,e.blurEnabled)}}function vp(e,t){return(e%t+t)%t}function _w(e,t){return zl(e,t)/t}function zl(e,t){return vp(e,t)}function Hw(e,t){return Math.floor(e/t)}function Ww(e,t,n,i){return Hw(e,t)*n+zl(e,t)*i}function hd(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function da(e){const t=e%1;return t<0?t+1:t}function Ow(e,t,n){const i=t/mp,o=n==="left"?-e*i:e*i;return da(o)}function Dw({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=
|
|
23441
|
+
`}function hp(e){return Number(e.toFixed(4))}function md(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 Ss(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 $w(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 Cw(e){const[t,n]=e.ratioValue.split(":").map(Number),i=e.reversed?n:t;return(e.reversed?t:n)/i}function Tw(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 fp(e,t){return(1-e)/(1-e*Math.cos(t))}function Lw(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)*fp(e,i)))}return t||1}function Pw(e,t){return e?1:1+gp*(.35+t)}function Iw(e,t,n,i){const o=t*Pw(n,i);return Math.max(0,(e-o)/2)}function Rw(e,t,n){const i=fp(e,n);return{offset:Math.sin(n)*i/t,scale:i}}function kw(e,t,n){return e/2+t*n}function Ew(e,t,n){return`translate(calc(${e(t)} - var(--helix-base-w) / 2), -50%) scale(${hp(n)})`}function Mw(e){return Math.round(e*1e3)}function yp(e,t,n){const i=Math.cos(e),o=Math.cos(Sw*Math.PI/2);if(i>=o)return n;const r=(i+1)/(o+1);return hp(t+(n-t)*r)}function Aw(e){return yp(e,yw,vw)}function Fw(e){return yp(e,xw,bw)}function Nw(e,t){if(!t)return"none";const n=Fw(e);return n<=0?"none":`blur(${n}px)`}function gd(e,t){const n=t*Math.PI*2,{offset:i,scale:o}=Rw(e.depthFactor,e.spreadFactor,n),r=kw(e.width,e.orbitRadius,i);return{transform:Ew(e.scaled,r,o),zIndex:Mw(o),opacity:Aw(n),filter:Nw(n,e.blurEnabled)}}function vp(e,t){return(e%t+t)%t}function _w(e,t){return zl(e,t)/t}function zl(e,t){return vp(e,t)}function Hw(e,t){return Math.floor(e/t)}function Ww(e,t,n,i){return Hw(e,t)*n+zl(e,t)*i}function hd(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function da(e){const t=e%1;return t<0?t+1:t}function Ow(e,t,n){const i=t/mp,o=n==="left"?-e*i:e*i;return da(o)}function Dw({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=_.useScopedStyles(),r=s.useRef(null),l=Ss((e==null?void 0:e.width)??(e==null?void 0:e.spread)??(e==null?void 0:e.wrapperWidth),cw),c=Ss(e==null?void 0:e.imageWidth,dw),d=Ss(e==null?void 0:e.turnHeight,uw),u=md(e==null?void 0:e.itemsPerTurn,pw,3,40),p=md(e==null?void 0:e.turns,mw,1,30),y=Math.min(fw,Math.max(0,gw)),v=Math.min(1,Math.max(0,hw)),m=Math.max(0,(e==null?void 0:e.speed)??mp),g=(e==null?void 0:e.direction)==="left"?"left":"right",b=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",S=(e==null?void 0:e.cornerRadius)??0,A=(e==null?void 0:e.blur)!=="off",f=s.useMemo(()=>$w(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),w=f.display==="cover",G=F=>_.scalingValue(F,n??!1),q=s.useMemo(()=>Lw(y),[y]),E=s.useMemo(()=>Iw(l,c,w,v),[l,c,w,v]),P=s.useMemo(()=>ww(o),[o]),M=s.useMemo(()=>({scaled:F=>_.scalingValue(F,n??!1),width:l,orbitRadius:E,depthFactor:y,spreadFactor:q,blurEnabled:A}),[n,l,E,y,q,A]),X=s.useRef([]),$=s.useRef(0),T=s.useMemo(()=>(t??[]).filter(F=>{var le;return!!((le=F.image)!=null&&le.url)}),[t]),O=d/u,N=c*Cw(f),L=Math.min(sw,p*u),C=lw*u,j=L+C*2,Y=Math.max(0,p-1)*d+(u-1)*O,R=m>0,H=b==="scroll"&&R,D=b==="autoplay"&&R&&(n?!!i:!0),Q=D?360/(m*aw):0,ae=T.length===0?0:j,z=s.useMemo(()=>Array.from({length:ae},(F,le)=>_w(le-C,u)),[ae,C,u]);s.useEffect(()=>{if(!D&&!H)return;const F=r.current;if(!F)return;const le=ue=>{$.current=ue,z.forEach((ve,$e)=>{const ke=X.current[$e];if(!ke)return;const he=gd(M,da(ve+ue));ke.style.transform=he.transform,ke.style.zIndex=String(he.zIndex),ke.style.opacity=String(he.opacity),ke.style.filter=he.filter})};if(H){const ue=F.ownerDocument.defaultView??window,ve=()=>{const ke=F.getBoundingClientRect(),he=ue.innerHeight||F.ownerDocument.documentElement.clientHeight,Se=he+ke.height;if(Se<=0)return;const Ce=Math.min(1,Math.max(0,(he-ke.top)/Se));le(Ow(Ce,m,g))};ve(),ue.addEventListener("scroll",ve,{passive:!0,capture:!0}),ue.addEventListener("resize",ve);const $e=new ResizeObserver(ve);return $e.observe(F),()=>{ue.removeEventListener("scroll",ve,{capture:!0}),ue.removeEventListener("resize",ve),$e.disconnect()}}const te=g==="left"?-1:1;let fe=null,Pe=null;const xe=ue=>{if(Pe!==null){const ve=(ue-Pe)/1e3/Q*te;$.current=da($.current+ve)}Pe=ue,le($.current),fe=requestAnimationFrame(xe)},de=()=>{fe===null&&(Pe=null,fe=requestAnimationFrame(xe))},K=()=>{fe!==null&&cancelAnimationFrame(fe),fe=null},se=new IntersectionObserver(([ue])=>{ue!=null&&ue.isIntersecting?de():K()});return se.observe(F),()=>{K(),se.disconnect()}},[D,H,z,M,Q,m,g]);const re=D||H?$.current:0;return T.length===0?a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:P}}),a.jsx("div",{className:`${o}-wrapper`,style:{width:G(l)}})]}):a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:P}}),a.jsx("div",{ref:r,className:`${o}-wrapper`,style:{width:G(l),height:G(Y)},children:Array.from({length:j},(F,le)=>{const te=le-C,Pe=T[vp(te,T.length)].image,xe=zl(te,u),de=z[le],K=Ww(te,u,d,O),se=v===0?0:(hd(xe+7.3)-.5)*v*O,ue=w?1:1+(hd(xe+3.1)-.5)*2*gp*(.35+v),ve=c*ue,$e={"--helix-base-w":G(ve),...w?{"--helix-base-h":G(N)}:{}},ke={top:G(K+se),...$e,...gd(M,da(de+re))},he=S>0?{borderRadius:G(S)}:{},Se=w?{...he,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}:he,Ce=Tw(Pe)?a.jsx("video",{className:`${o}-media`,style:Se,src:Pe.url,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:`${o}-media`,style:Se,src:Pe.url,alt:Pe.name??"",loading:"lazy",decoding:"async"});return a.jsx("div",{ref:h=>{X.current[le]=h},className:w?`${o}-item ${o}-item-cover`:`${o}-item`,style:ke,children:w?a.jsx("div",{className:`${o}-cover`,style:he,children:Ce}):Ce},`${p}-${u}-${te}`)})})]})}const zw=`import { useEffect, useMemo, useRef, type CSSProperties } from 'react';
|
|
23442
23442
|
import { CommonComponentProps } from '../props';
|
|
23443
23443
|
import { scalingValue } from '../utils/scalingValue';
|
|
23444
23444
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -23842,9 +23842,10 @@ export function Helix({
|
|
|
23842
23842
|
};
|
|
23843
23843
|
|
|
23844
23844
|
if (useScrollMotion) {
|
|
23845
|
+
const view = element.ownerDocument.defaultView ?? window;
|
|
23845
23846
|
const update = () => {
|
|
23846
23847
|
const rect = element.getBoundingClientRect();
|
|
23847
|
-
const viewportHeight =
|
|
23848
|
+
const viewportHeight = view.innerHeight || element.ownerDocument.documentElement.clientHeight;
|
|
23848
23849
|
const range = viewportHeight + rect.height;
|
|
23849
23850
|
if (range <= 0) return;
|
|
23850
23851
|
const scrollProgress = Math.min(1, Math.max(0, (viewportHeight - rect.top) / range));
|
|
@@ -23852,13 +23853,13 @@ export function Helix({
|
|
|
23852
23853
|
};
|
|
23853
23854
|
|
|
23854
23855
|
update();
|
|
23855
|
-
|
|
23856
|
-
|
|
23856
|
+
view.addEventListener('scroll', update, { passive: true, capture: true });
|
|
23857
|
+
view.addEventListener('resize', update);
|
|
23857
23858
|
const resizeObserver = new ResizeObserver(update);
|
|
23858
23859
|
resizeObserver.observe(element);
|
|
23859
23860
|
return () => {
|
|
23860
|
-
|
|
23861
|
-
|
|
23861
|
+
view.removeEventListener('scroll', update, { capture: true });
|
|
23862
|
+
view.removeEventListener('resize', update);
|
|
23862
23863
|
resizeObserver.disconnect();
|
|
23863
23864
|
};
|
|
23864
23865
|
}
|
|
@@ -23997,7 +23998,7 @@ export function Helix({
|
|
|
23997
23998
|
</>
|
|
23998
23999
|
);
|
|
23999
24000
|
}
|
|
24000
|
-
`,Bw=["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"],jw={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:Bw.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"]}]}]},Vw={element:Dw,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:jw,sourceCode:zw,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},$n=300,en=300,Gw=8/1440,go=.004,Xw=50,qw=1440,Gi=Xw/qw;function Uw(e){if(e==="default"||e==="compact"||e==="open")return e;if(e==="onScroll")return"compact"}function Kw(e){return e==="center"||e==="right"?e:"left"}function Yw(e){return e==="left"||e==="right"?e:"center"}function Zw(e,t,n){const i=N.scalingValue(t,n);return e==="center"?`translateX(calc(-50% + ${i}))`:`translateX(${i})`}function Jw(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 xp(e,t){const n=(Jw(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 Qw(e,t,n){switch(xp(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 e$(e,t){switch(xp(e.showIn,t)){case"default and compact":return!1;default:return!0}}function t$(e,t){if(!e)return"";const n=t==null?void 0:t.find(i=>i.id===e);return n?n.slug===""?"/":`/${n.slug}`:e.startsWith("/")||e.startsWith("#")||/^[a-z][a-z\d+\-.]*:/i.test(e)?e:t?`/${e}`:e}function fd(e){const t=(e??"").toLowerCase();return t==="blank"||t==="_blank"||t.includes("new")}function bp(e){const t=e.link;if(t&&typeof t=="object"){const i=fd(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=fd(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=bp(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=t$(i.value,t),r=(i.anchor??"").replace(/^#/,""),l=r?o?`${o}#${r}`:`#${r}`:o;return{label:n,href:l,target:i.target}}const vi=24,yi=vi*.125,Sp=vi*.125,ws=(vi-(3*yi+2*Sp))/2,yd=yi+Sp;function n$({className:e,lineClassName:t}){return a.jsxs("svg",{className:e,viewBox:`0 0 ${vi} ${vi}`,"aria-hidden":"true",children:[a.jsx("rect",{className:`${t} ${t}-top`,x:"0",y:ws,width:vi,height:yi,rx:yi/2}),a.jsx("rect",{className:`${t} ${t}-mid`,x:"0",y:ws+yd,width:vi,height:yi,rx:yi/2}),a.jsx("rect",{className:`${t} ${t}-bot`,x:"0",y:ws+2*yd,width:vi,height:yi,rx:yi/2})]})}function i$(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function o$(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:N.scalingValue((o-t)/2,i)}}const wp=.004;let Jo;function r$(){return Jo!==void 0?Jo:typeof document>"u"?(Jo=null,null):(Jo=document.createElement("canvas").getContext("2d"),Jo)}function a$(e){const t=getComputedStyle(e),n=parseFloat(t.fontSize)||0;if(n<=0)return 0;const i=r$();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 vd(e,t){const[n,i]=s.useState(0);return s.useLayoutEffect(()=>{const o=e.current;if(!o)return;const r=()=>{const d=a$(o);i(u=>Math.abs(u-d)<wp?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 xd(e){if(!(Math.abs(e)<wp))return`translateY(${e}em)`}function bd(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 Sd(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 wd(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 $d(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)),...o$(t.fontSize,t.lineHeight,e,n)},className:i$(t.fontSize,t.lineHeight,`${e}-link-text`,`${e}-text-tight-leading`)}}function Cd(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 Td(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 $p(e){const n=Math.max(Gi,e.fontSize??Gi),{start:i,end:o}=Td(e.textPaddingTop,e.textPaddingBottom,1,n),{start:r,end:l}=Td(e.textPaddingLeft,e.textPaddingRight,1,Gi);return{effectivePaddingLeft:r,effectivePaddingRight:l,effectivePaddingTop:i,effectivePaddingBottom:o,panelSize:1}}function s$(e){if(e==="center"||e==="center-center")return{horizontalAlign:"center",verticalAlign:"center"};const[t,n]=e.split("-");return{horizontalAlign:t,verticalAlign:n}}function l$(e){return e.position?s$(e.position):{horizontalAlign:e.horizontalAlign??"left",verticalAlign:e.verticalAlign??"top"}}function c$(e,t){return e.textPaddingLeft!==t.textPaddingLeft||e.textPaddingRight!==t.textPaddingRight||e.textPaddingTop!==t.textPaddingTop||e.textPaddingBottom!==t.textPaddingBottom}const d$=[["onScrollIconColor","compactIconColor"],["onScrollCloseButtonColor","compactCloseButtonColor"],["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 Cp(e){var o,r;const t=e,n={};for(const[l,c]of d$)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 Ld(e){var o,r,l,c,d,u,p,y,v,m,g,b,S,A,f,w,G,q;e=Cp(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 E=((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;E!==void 0&&(n.openLinkColor=E)}if(e.compactIconColor===void 0){const E=((u=(d=e.stateOverrides)==null?void 0:d.compact)==null?void 0:u.iconColor)??e.iconColor;E!==void 0&&(n.compactIconColor=E)}if(e.compactCloseButtonColor===void 0){const E=((y=(p=e.stateOverrides)==null?void 0:p.compact)==null?void 0:y.closeButtonColor)??e.closeButtonColor;E!==void 0&&(n.compactCloseButtonColor=E)}if(e.compactLinkColor===void 0){const E=((m=(v=e.stateOverrides)==null?void 0:v.compact)==null?void 0:m.linkColor)??e.linkColor;E!==void 0&&(n.compactLinkColor=E)}if(e.compactLogoColor===void 0){const E=((b=(g=e.stateOverrides)==null?void 0:g.compact)==null?void 0:b.logoColor)??e.logoColor;E!==void 0&&(n.compactLogoColor=E)}if(e.openLogoColor===void 0){const E=((A=(S=e.stateOverrides)==null?void 0:S.open)==null?void 0:A.logoColor)??e.logoColor;E!==void 0&&(n.openLogoColor=E)}if(e.compactBackgroundColor===void 0){const E=((w=(f=e.stateOverrides)==null?void 0:f.compact)==null?void 0:w.backgroundColor)??((q=(G=t.stateOverrides)==null?void 0:G.compact)==null?void 0:q.panelColor)??t.compactPanelColor??t.onScrollPanelColor??e.backgroundColor??n.backgroundColor;E!==void 0&&(n.compactBackgroundColor=E)}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=(E,P)=>{if(e[E]!==void 0)return;const M=e[P];M!==void 0&&(n[E]=M)};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 u$(e,t){const n=$p({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 p$(e,t){return{paddingLeft:N.scalingValue(e.effectivePaddingLeft,t),paddingRight:N.scalingValue(e.effectivePaddingRight,t),paddingTop:N.scalingValue(e.effectivePaddingTop,t),paddingBottom:N.scalingValue(e.effectivePaddingBottom,t)}}function m$(e,t,n,i){const o=Math.max(Gi,n??Gi),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-Gi),v=Math.max(0,t.panelSize-t.effectivePaddingLeft-Gi);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 g$={iconColor:"icon-color",closeButtonColor:"close-button-color",linkColor:"link-color",openLinkColor:"menu-link-color",compactIconColor:"compact-icon-color",compactCloseButtonColor:"compact-close-button-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"},h$=["hover","open"],f$={top:"flex-start",center:"center",bottom:"flex-end"},y$={left:"flex-start",center:"center",right:"flex-end"};function v$(e){return`
|
|
24001
|
+
`,Bw=["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"],jw={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:Bw.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"]}]}]},Vw={element:Dw,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:jw,sourceCode:zw,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},$n=300,en=300,Gw=8/1440,go=.004,Xw=50,qw=1440,Gi=Xw/qw;function Uw(e){if(e==="default"||e==="compact"||e==="open")return e;if(e==="onScroll")return"compact"}function Kw(e){return e==="center"||e==="right"?e:"left"}function Yw(e){return e==="left"||e==="right"?e:"center"}function Zw(e,t,n){const i=_.scalingValue(t,n);return e==="center"?`translateX(calc(-50% + ${i}))`:`translateX(${i})`}function Jw(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 xp(e,t){const n=(Jw(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 Qw(e,t,n){switch(xp(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 e$(e,t){switch(xp(e.showIn,t)){case"default and compact":return!1;default:return!0}}function t$(e,t){if(!e)return"";const n=t==null?void 0:t.find(i=>i.id===e);return n?n.slug===""?"/":`/${n.slug}`:e.startsWith("/")||e.startsWith("#")||/^[a-z][a-z\d+\-.]*:/i.test(e)?e:t?`/${e}`:e}function fd(e){const t=(e??"").toLowerCase();return t==="blank"||t==="_blank"||t.includes("new")}function bp(e){const t=e.link;if(t&&typeof t=="object"){const i=fd(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=fd(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=bp(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=t$(i.value,t),r=(i.anchor??"").replace(/^#/,""),l=r?o?`${o}#${r}`:`#${r}`:o;return{label:n,href:l,target:i.target}}const vi=24,yi=vi*.125,Sp=vi*.125,ws=(vi-(3*yi+2*Sp))/2,yd=yi+Sp;function n$({className:e,lineClassName:t}){return a.jsxs("svg",{className:e,viewBox:`0 0 ${vi} ${vi}`,"aria-hidden":"true",children:[a.jsx("rect",{className:`${t} ${t}-top`,x:"0",y:ws,width:vi,height:yi,rx:yi/2}),a.jsx("rect",{className:`${t} ${t}-mid`,x:"0",y:ws+yd,width:vi,height:yi,rx:yi/2}),a.jsx("rect",{className:`${t} ${t}-bot`,x:"0",y:ws+2*yd,width:vi,height:yi,rx:yi/2})]})}function i$(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function o$(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:_.scalingValue((o-t)/2,i)}}const wp=.004;let Jo;function r$(){return Jo!==void 0?Jo:typeof document>"u"?(Jo=null,null):(Jo=document.createElement("canvas").getContext("2d"),Jo)}function a$(e){const t=getComputedStyle(e),n=parseFloat(t.fontSize)||0;if(n<=0)return 0;const i=r$();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 vd(e,t){const[n,i]=s.useState(0);return s.useLayoutEffect(()=>{const o=e.current;if(!o)return;const r=()=>{const d=a$(o);i(u=>Math.abs(u-d)<wp?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 xd(e){if(!(Math.abs(e)<wp))return`translateY(${e}em)`}function bd(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 Sd(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 wd(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 $d(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)),...o$(t.fontSize,t.lineHeight,e,n)},className:i$(t.fontSize,t.lineHeight,`${e}-link-text`,`${e}-text-tight-leading`)}}function Cd(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 Td(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 $p(e){const n=Math.max(Gi,e.fontSize??Gi),{start:i,end:o}=Td(e.textPaddingTop,e.textPaddingBottom,1,n),{start:r,end:l}=Td(e.textPaddingLeft,e.textPaddingRight,1,Gi);return{effectivePaddingLeft:r,effectivePaddingRight:l,effectivePaddingTop:i,effectivePaddingBottom:o,panelSize:1}}function s$(e){if(e==="center"||e==="center-center")return{horizontalAlign:"center",verticalAlign:"center"};const[t,n]=e.split("-");return{horizontalAlign:t,verticalAlign:n}}function l$(e){return e.position?s$(e.position):{horizontalAlign:e.horizontalAlign??"left",verticalAlign:e.verticalAlign??"top"}}function c$(e,t){return e.textPaddingLeft!==t.textPaddingLeft||e.textPaddingRight!==t.textPaddingRight||e.textPaddingTop!==t.textPaddingTop||e.textPaddingBottom!==t.textPaddingBottom}const d$=[["onScrollIconColor","compactIconColor"],["onScrollCloseButtonColor","compactCloseButtonColor"],["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 Cp(e){var o,r;const t=e,n={};for(const[l,c]of d$)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 Ld(e){var o,r,l,c,d,u,p,y,v,m,g,b,S,A,f,w,G,q;e=Cp(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 E=((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;E!==void 0&&(n.openLinkColor=E)}if(e.compactIconColor===void 0){const E=((u=(d=e.stateOverrides)==null?void 0:d.compact)==null?void 0:u.iconColor)??e.iconColor;E!==void 0&&(n.compactIconColor=E)}if(e.compactCloseButtonColor===void 0){const E=((y=(p=e.stateOverrides)==null?void 0:p.compact)==null?void 0:y.closeButtonColor)??e.closeButtonColor;E!==void 0&&(n.compactCloseButtonColor=E)}if(e.compactLinkColor===void 0){const E=((m=(v=e.stateOverrides)==null?void 0:v.compact)==null?void 0:m.linkColor)??e.linkColor;E!==void 0&&(n.compactLinkColor=E)}if(e.compactLogoColor===void 0){const E=((b=(g=e.stateOverrides)==null?void 0:g.compact)==null?void 0:b.logoColor)??e.logoColor;E!==void 0&&(n.compactLogoColor=E)}if(e.openLogoColor===void 0){const E=((A=(S=e.stateOverrides)==null?void 0:S.open)==null?void 0:A.logoColor)??e.logoColor;E!==void 0&&(n.openLogoColor=E)}if(e.compactBackgroundColor===void 0){const E=((w=(f=e.stateOverrides)==null?void 0:f.compact)==null?void 0:w.backgroundColor)??((q=(G=t.stateOverrides)==null?void 0:G.compact)==null?void 0:q.panelColor)??t.compactPanelColor??t.onScrollPanelColor??e.backgroundColor??n.backgroundColor;E!==void 0&&(n.compactBackgroundColor=E)}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=(E,P)=>{if(e[E]!==void 0)return;const M=e[P];M!==void 0&&(n[E]=M)};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 u$(e,t){const n=$p({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 p$(e,t){return{paddingLeft:_.scalingValue(e.effectivePaddingLeft,t),paddingRight:_.scalingValue(e.effectivePaddingRight,t),paddingTop:_.scalingValue(e.effectivePaddingTop,t),paddingBottom:_.scalingValue(e.effectivePaddingBottom,t)}}function m$(e,t,n,i){const o=Math.max(Gi,n??Gi),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-Gi),v=Math.max(0,t.panelSize-t.effectivePaddingLeft-Gi);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 g$={iconColor:"icon-color",closeButtonColor:"close-button-color",linkColor:"link-color",openLinkColor:"menu-link-color",compactIconColor:"compact-icon-color",compactCloseButtonColor:"compact-close-button-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"},h$=["hover","open"],f$={top:"flex-start",center:"center",bottom:"flex-end"},y$={left:"flex-start",center:"center",right:"flex-end"};function v$(e){return`
|
|
24001
24002
|
.${e}-root {
|
|
24002
24003
|
position: relative;
|
|
24003
24004
|
display: block;
|
|
@@ -24680,7 +24681,7 @@ export function Helix({
|
|
|
24680
24681
|
word-spacing ${en}ms ease,
|
|
24681
24682
|
padding ${en}ms ease;
|
|
24682
24683
|
}
|
|
24683
|
-
`}function x$(e){return`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`}function b$(e){const t=e.trim().toLowerCase();return t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")?!0:t.includes(".svg")}function S$(e){const t=b$(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 w$(e){const t=e.indexOf("#");if(t===-1)return"";try{return decodeURIComponent(e.slice(t+1))}catch{return e.slice(t+1)}}function $$(e){if(!e||e.startsWith("#"))return!0;try{return new URL(e,window.location.href).pathname===window.location.pathname}catch{return!1}}function Pd(e){if(!e)return!1;const t=document.getElementById(e),n=document.querySelector(`[data-section-id="${CSS.escape(e)}"]`),i=t??n;return i instanceof HTMLElement?(i.scrollIntoView({behavior:"smooth",block:"start"}),!0):!1}function C$(e,t,n={}){const{isEditor:i,isPreviewMode:o,item:r,pages:l,onLinkNavigate:c}=n,d=e.currentTarget.getAttribute("href")??"",u=w$(d),p=e.currentTarget.target==="_blank";if(r&&c){e.preventDefault(),e.stopPropagation();const y=qs(r,l),v=bp(r);c({mode:v.type==="url"?"url":"page",href:y.href||d,page:v.type==="page"?v.value:void 0,url:v.type==="url"?v.value:void 0,anchor:v.type==="anchor"?v.value.replace(/^#/,""):(v.anchor??"").replace(/^#/,""),target:y.target}),t();return}if(i){e.preventDefault(),Pd(u),t();return}!p&&u&&$$(d)&&Pd(u)&&e.preventDefault(),t()}const T$=["--cntrl-article-width","--cntrl-article-top","--cntrl-article-left","--cntrl-viewport-height"];function L$(e){let t=e;for(;t;){if(getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim())return t;t=t.parentElement}return e}function P$(e){const t={},n=L$(e);if(!n)return t;const i=getComputedStyle(n);for(const o of T$){const r=i.getPropertyValue(o).trim();r&&(t[o]=r)}return t}function Id(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 I$({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}=N.useScopedStyles(),g=s.useRef(null),b=s.useRef(null),S=s.useRef(null),A=s.useRef(null),f=s.useRef(null),w=s.useRef(0),G=s.useRef(null),q=s.useRef(d),E=s.useMemo(()=>v$(m),[m]),[P,M]=s.useState(!1),[X,$]=s.useState(!1),[T,O]=s.useState(!1),F=Uw(r),L=s.useMemo(()=>new Set(c),[c]),C=Ht=>!!(Ht&&L.has(Ht)),x=!!(t&&!i&&F==="open"&&!C("open"))||!(t&&!i)&&P,Y=x&&!(t&&!i);Wl(Y);const R=!C("compact")&&!C("onScroll"),H=!t||!!i&&!n,D=o&&o!=="default"?o:void 0,Q=R&&F==="compact"?"compact":"default",[ae,z]=s.useState(Q),[re,_]=s.useState(!1),le=!n;Q!==ae&&(z(Q),le&&_(!0));const te=Cp(e),{logo:fe,logoMaxHeight:Pe=120/1440,logoPosition:xe="left",panelHeight:ue=60/1440,backgroundColor:K="#b3b3b3",logoColor:se="#000000",position:de,horizontalAlign:ve,verticalAlign:$e,iconColor:ke="#000000",showIcon:he="on",iconSize:Se=16/1440,linkColor:Te="#000000",openLinkColor:h="#000000",compactIconColor:U="#000000",compactCloseButtonColor:Z="#000000",compactLinkColor:ne="#000000",compactLogoColor:me="#000000",compactBackgroundColor:B="#ffffff",compactLogoMaxHeight:I=120/1440,compactLogoPosition:ee,compactPanelHeight:ie=60/1440,compactShowIcon:pe="on",compactIconSize:V=16/1440,compactNavTextWidth:Ie,compactNavTextPosition:be,compactNavTextOffset:J,compactNavGap:He,compactNavPaddingLeft:We=10/1440,compactNavPaddingRight:it=10/1440,compactFontFamily:qe,compactFontSettings:tt,compactFontSize:et,compactLineHeight:je,compactLetterSpacing:ye=0,compactWordSpacing:_e=0,compactTextAlign:Be="left",compactTextAppearance:Ze,openLogoColor:we="#000000",menuBackgroundColor:Fe="#ffffff",overlayColor:Ke="rgba(0, 0, 0, 0.45)",closeButtonColor:Je="#000000",effect:st="fade",openPanelSize:ot=100,textWidth:Oe=280/1440,navTextWidth:Ae,navTextPosition:gt="center",navTextOffset:ze=0,gap:De=0,navGap:Xe,navPaddingLeft:dt=10/1440,navPaddingRight:ge=10/1440,textPaddingLeft:Re=10/1440,textPaddingRight:nt=10/1440,textPaddingTop:ut=10/1440,textPaddingBottom:Ge=10/1440,fontFamily:bt,fontSettings:It,fontSize:Mt,lineHeight:wt,letterSpacing:Vt=0,wordSpacing:jt=0,textAlign:qt="left",textAppearance:Ut,openFontFamily:Rt,openFontSettings:Bt,openFontSize:rn,openLineHeight:vt,openLetterSpacing:yt,openWordSpacing:Ee,openTextAlign:Qe,openTextAppearance:rt,stateOverrides:lt,link:Lt}=te,{horizontalAlign:St,verticalAlign:ht}=l$({position:de,horizontalAlign:ve,verticalAlign:$e}),Pt=Q==="compact",Ot=Pt?I:Pe,At=Kw(Pt?ee:xe),Gt=Pt?ie:ue,Et=Pt?V:Se,zt=Pt?Ie:Ae,Ft=Yw(Pt?be:gt),pt=(Pt?J:ze)??0,W=Pt?He:Xe,Le=Pt?We:dt,Ve=Pt?it:ge,Ne=zt??Oe,ft=x||(Pt?pe:he)!=="off",Nt=N.buildColorVars(m,{iconColor:ke,closeButtonColor:Je,linkColor:Te,openLinkColor:h,compactIconColor:U,compactCloseButtonColor:Z,compactLinkColor:ne,compactLogoColor:me,compactBackgroundColor:B,openLogoColor:we,menuBackgroundColor:Fe,overlayColor:Ke,backgroundColor:K,logoColor:se},g$,h$,lt),mt=wd(Pt?{fontFamily:qe,fontSettings:tt,fontSize:et,lineHeight:je,letterSpacing:ye,wordSpacing:_e,textAlign:Be,textAppearance:Ze}:{fontFamily:bt,fontSettings:It,fontSize:Mt,lineHeight:wt,letterSpacing:Vt,wordSpacing:jt,textAlign:qt,textAppearance:Ut}),$t=wd({fontFamily:Rt,fontSettings:Bt,fontSize:rn,lineHeight:vt,letterSpacing:yt,wordSpacing:Ee,textAlign:Qe,textAppearance:rt},mt),Yt=$d(m,mt,t),Dt=$d(m,$t,t),sn=vd(S,bd(mt)),ln=vd(A,bd($t)),qn={...Dt.css,whiteSpace:"pre-wrap",transform:xd(ln)},Un=Dt.className,hn=Ht=>N.scalingValue(Ht,t),Qi=W??De,Vo=Math.max(Le,go),Go=Math.max(Ve,go),xn=Math.max(0,1-Et),ci=Math.max(0,1-Et),Kn=n??!1,bn=Kn&&!x,Ei=s.useMemo(()=>$p({textPaddingLeft:Re,textPaddingRight:nt,textPaddingTop:ut,textPaddingBottom:Ge,fontSize:$t.fontSize}),[Re,nt,ut,Ge,$t.fontSize]),eo=Ht=>{const Kt=a.jsx("span",{className:Un,style:qn,children:Cd(Ht)});return Id(m,Kt,Oe,Kn,hn)},Ce=st==="left"||st==="right"?{width:`${ot}%`}:{height:`${ot}%`},Ye={...p$(Ei,t),...Ce,alignItems:y$[St],justifyContent:f$[ht]},k=s.useRef(e),oe=s.useRef(d);s.useEffect(()=>{if(!y||!t){k.current=e,oe.current=d;return}if(oe.current!==d){k.current=e,oe.current=d;const Fi=Ld(e);Fi!==e&&y(Fi);return}const Ht=Ld(e),Kt=k.current,un=Kt!==e,fn=un?u$(Ht,Kt):Ht;k.current=e;const kn=Ht!==e,Nn=un&&c$(Ht,fn);!kn&&!Nn||y(fn)},[e,y,t,d]);const ce=N.scalingValue(Et,t),Me={width:ce,height:ce,minWidth:ce,minHeight:ce,maxWidth:ce,maxHeight:ce},Ue={...Yt.css,textDecoration:"none",transform:xd(sn)},ct=Yt.className,kt=(fe==null?void 0:fe.mode)!=="Off",_t=(fe==null?void 0:fe.icon)??"",nn=S$(_t),on=hn(Math.min(Ot,Gt)),Yn=!!(kt&&_t&&At==="right")?"left":"right",Ai=Array.isArray(Lt)?Lt:[],to=[Q!=="default"?`${m}-state-${Q}`:"",F==="open"?`${m}-state-open`:"",D&&D!==Q&&D!==F?`${m}-state-${D}`:""].filter(Boolean).join(" "),Da=t&&!i?`${m}-editor`:"",kr=H?`${m}-interactive`:"",Np=le&&(Q!==ae||re)?`${m}-nav-state-anim`:"",_p=x?`${m}-open`:"",Hp=s.useMemo(()=>P$(g.current),[X,x,d]),za=()=>{M(!1)},Ba=!t||i,Gl=(Ht,Kt)=>{C$(Ht,za,{isEditor:t,isPreviewMode:i,item:Kt,pages:u,onLinkNavigate:p})},Wp=()=>{t&&!i||M(Ht=>!Ht)},Op=Ht=>{Ht.pointerType==="touch"&&Ht.currentTarget.blur()},Er=()=>{G.current!==null&&(window.clearTimeout(G.current),G.current=null)};s.useEffect(()=>{if(!re)return;const Ht=window.setTimeout(()=>{_(!1)},en);return()=>window.clearTimeout(Ht)},[re,Q]),s.useEffect(()=>{if(x){Er(),$(!0);return}return w.current+=1,O(!1),Er(),G.current=window.setTimeout(()=>{G.current=null,$(!1)},$n),Er},[x]),s.useLayoutEffect(()=>{q.current!==d&&(q.current=d,w.current+=1,Er(),M(!1),O(!1),$(!1))},[d]),s.useLayoutEffect(()=>{var un;if(!X||!x)return;const Ht=w.current+1;w.current=Ht,O(!1),(un=b.current)==null||un.offsetHeight;const Kt=requestAnimationFrame(()=>{w.current===Ht&&O(!0)});return()=>{cancelAnimationFrame(Kt)}},[X,x]),s.useLayoutEffect(()=>{if(!Y||!X)return;const Ht=f.current;if(!Ht)return;const Kt=getComputedStyle(Ht).backgroundColor;if(!Kt)return;const un=document.documentElement,{body:fn}=document,kn=un.style.backgroundColor,Nn=fn.style.backgroundColor;return un.style.backgroundColor=Kt,fn.style.backgroundColor=Kt,()=>{un.style.backgroundColor=kn,fn.style.backgroundColor=Nn}},[Y,X,to,Fe,lt]),s.useEffect(()=>{v==null||v(x)},[x,v]),s.useEffect(()=>{if(!x)return;const Ht=Kt=>{Kt.key==="Escape"&&(t&&i||za())};return window.addEventListener("keydown",Ht),()=>window.removeEventListener("keydown",Ht)},[x,t,i]),s.useEffect(()=>{t&&!i&&F!=="open"&&M(!1)},[t,i,F]),s.useEffect(()=>{i&&M(!1)},[i]);const Xl=Kn&&x,Dp=Ht=>Ai.filter(Kt=>e$(Kt,d)).map((Kt,un)=>{const{label:fn,href:kn,target:Nn}=qs(Kt,u),Fi=kn?a.jsx("a",{href:kn,target:Nn,rel:Nn==="_blank"?"noopener noreferrer":void 0,className:`${Ht} ${m}-has-href`,onClick:ja=>Gl(ja,Kt),children:eo(fn)}):a.jsx("span",{className:Ht,children:eo(fn)});return a.jsxs(s.Fragment,{children:[un>0&&a.jsx("div",{"data-controls":Xl?"gap":void 0,"data-controls-axis":"y",className:Xl?`${m}-gap-control`:void 0,style:{height:hn(De)}}),Fi]},un)}),zp=X?a.jsxs("div",{ref:b,"data-selection":"none",className:[`${m}-lightbox`,`${m}-full-lightbox ${m}-effect-${st}`,T?`${m}-lightbox-active`:"",`${m}-lightbox-editor`,n?`${m}-lightbox-edit-mode`:"",kr,to].filter(Boolean).join(" "),style:{...Nt,...Hp},"aria-hidden":!T,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:Ye,"aria-label":"Menu","data-lightbox-scrollable":"",children:[Kn&&m$(m,Ei,$t.fontSize,hn),Dp(`${m}-link`)]}),Y?a.jsx("div",{ref:f,className:`${m}-safari-tint`,"aria-hidden":"true"}):null]}):null,Bp=()=>a.jsx("button",{type:"button",className:`${m}-toggle`,onClick:Wp,onPointerUp:Op,"aria-expanded":x,"aria-label":x?"Close menu":"Open menu",children:a.jsx(n$,{className:`${m}-icon`,lineClassName:`${m}-icon-line`})}),Mr=Ht=>{const Kt=Ht==="left",un=Kt?Le:Ve,fn=Kt?Vo:Go,kn=Kt?xn:ci,Nn=Pt?Kt?"compactNavPaddingLeft":"compactNavPaddingRight":Kt?"navPaddingLeft":"navPaddingRight";return a.jsx("div",{className:Kt?`${m}-nav-padding-left`:`${m}-nav-padding-right`,style:{width:hn(un),flexShrink:0},children:bn?a.jsx("div",{"data-controls":Nn,"data-controls-axis":"x","data-controls-variant":"column-padding",...Kt?{}:{"data-controls-reverse":""},"data-controls-min":"0","data-controls-max-fraction":String(kn),className:`${m}-control-anchor`,style:{top:0,[Kt?"left":"right"]:0,width:hn(fn),height:"100%"}}):null})},jp=(Ht,Kt)=>{const{label:un,href:fn,target:kn}=qs(Ht,u),Nn=a.jsx("span",{className:ct,style:Ue,children:Cd(un)}),Fi=Id(m,Nn,Ne,bn,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:Xp=>Gl(Xp,Ht),children:Fi}):a.jsx("span",{className:`${m}-nav-link`,children:Fi});return a.jsxs(s.Fragment,{children:[Kt>0&&a.jsx("div",{"data-controls":bn?Pt?"compactNavGap":"navGap":void 0,"data-controls-axis":"x",className:bn?`${m}-gap-control ${m}-nav-gap-control`:`${m}-nav-gap-control}`,style:{width:hn(Qi),flexShrink:0}}),ja]},Kt)},Vp={...Nt,height:N.scalingValue(Gt,t),minHeight:N.scalingValue(Gt,t),[`--${m}-panel-height`]:N.scalingValue(Gt,t)},Gp=l&&Q==="default"&&F!=="open"&&!i?hn(ue+Gw):"0px";return a.jsxs("div",{ref:g,className:`${m}-root ${to} ${Da} ${kr} ${Np}`.trim(),style:{width:"100%",height:"100%",lineHeight:0,fontSize:0,marginTop:Gp,...Nt},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:E}}),a.jsx("span",{ref:S,"aria-hidden":!0,style:Sd(Yt.css),children:"H"}),a.jsx("span",{ref:A,"aria-hidden":!0,style:Sd(Dt.css),children:"H"}),a.jsx("div",{className:`${m}-nav-slide`,children:a.jsxs("div",{className:`${m}-nav-bar`,style:Vp,children:[kt&&_t?a.jsxs("div",{className:`${m}-nav-logo ${m}-nav-logo-${At}`,children:[At==="left"?Mr("left"):null,a.jsxs("div",{className:`${m}-nav-logo-inner${nn?` ${m}-nav-logo-tinted`:""}`,style:{height:on,...nn?{[`--${m}-logo-image`]:x$(_t)}:{}},children:[a.jsx("img",{src:_t,alt:"",className:`${m}-nav-logo-img`}),nn?a.jsx("span",{className:`${m}-nav-logo-tint`,"aria-hidden":"true"}):null]}),At==="right"?Mr("right"):null]}):null,a.jsx("nav",{className:`${m}-nav-links ${m}-nav-links-${Ft}`,style:{transform:Zw(Ft,pt,t)},"aria-label":"Navigation",children:a.jsx("div",{className:`${m}-nav-links-inner`,children:Ai.filter(Ht=>Qw(Ht,Q,d)).map((Ht,Kt)=>jp(Ht,Kt))})})]})}),zp,a.jsxs("div",{className:`${m}-nav-toggle-wrap ${m}-nav-toggle-wrap-${Yn}`,children:[Yn==="left"?Mr("left"):null,ft?a.jsx("div",{className:`${m}-root ${_p}`.trim(),style:Me,children:Bp()}):null,Yn==="right"?Mr("right"):null]})]})}const R$=`import { Fragment, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type MouseEvent, type PointerEvent, type ReactNode } from 'react';
|
|
24684
|
+
`}function x$(e){return`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`}function b$(e){const t=e.trim().toLowerCase();return t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")?!0:t.includes(".svg")}function S$(e){const t=b$(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 w$(e){const t=e.indexOf("#");if(t===-1)return"";try{return decodeURIComponent(e.slice(t+1))}catch{return e.slice(t+1)}}function $$(e){if(!e||e.startsWith("#"))return!0;try{return new URL(e,window.location.href).pathname===window.location.pathname}catch{return!1}}function Pd(e){if(!e)return!1;const t=document.getElementById(e),n=document.querySelector(`[data-section-id="${CSS.escape(e)}"]`),i=t??n;return i instanceof HTMLElement?(i.scrollIntoView({behavior:"smooth",block:"start"}),!0):!1}function C$(e,t,n={}){const{isEditor:i,isPreviewMode:o,item:r,pages:l,onLinkNavigate:c}=n,d=e.currentTarget.getAttribute("href")??"",u=w$(d),p=e.currentTarget.target==="_blank";if(r&&c){e.preventDefault(),e.stopPropagation();const y=qs(r,l),v=bp(r);c({mode:v.type==="url"?"url":"page",href:y.href||d,page:v.type==="page"?v.value:void 0,url:v.type==="url"?v.value:void 0,anchor:v.type==="anchor"?v.value.replace(/^#/,""):(v.anchor??"").replace(/^#/,""),target:y.target}),t();return}if(i){e.preventDefault(),Pd(u),t();return}!p&&u&&$$(d)&&Pd(u)&&e.preventDefault(),t()}const T$=["--cntrl-article-width","--cntrl-article-top","--cntrl-article-left","--cntrl-viewport-height"];function L$(e){let t=e;for(;t;){if(getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim())return t;t=t.parentElement}return e}function P$(e){const t={},n=L$(e);if(!n)return t;const i=getComputedStyle(n);for(const o of T$){const r=i.getPropertyValue(o).trim();r&&(t[o]=r)}return t}function Id(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 I$({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}=_.useScopedStyles(),g=s.useRef(null),b=s.useRef(null),S=s.useRef(null),A=s.useRef(null),f=s.useRef(null),w=s.useRef(0),G=s.useRef(null),q=s.useRef(d),E=s.useMemo(()=>v$(m),[m]),[P,M]=s.useState(!1),[X,$]=s.useState(!1),[T,O]=s.useState(!1),N=Uw(r),L=s.useMemo(()=>new Set(c),[c]),C=Ht=>!!(Ht&&L.has(Ht)),x=!!(t&&!i&&N==="open"&&!C("open"))||!(t&&!i)&&P,Y=x&&!(t&&!i);Wl(Y);const R=!C("compact")&&!C("onScroll"),H=!t||!!i&&!n,D=o&&o!=="default"?o:void 0,Q=R&&N==="compact"?"compact":"default",[ae,z]=s.useState(Q),[re,F]=s.useState(!1),le=!n;Q!==ae&&(z(Q),le&&F(!0));const te=Cp(e),{logo:fe,logoMaxHeight:Pe=120/1440,logoPosition:xe="left",panelHeight:de=60/1440,backgroundColor:K="#b3b3b3",logoColor:se="#000000",position:ue,horizontalAlign:ve,verticalAlign:$e,iconColor:ke="#000000",showIcon:he="on",iconSize:Se=16/1440,linkColor:Ce="#000000",openLinkColor:h="#000000",compactIconColor:U="#000000",compactCloseButtonColor:Z="#000000",compactLinkColor:ne="#000000",compactLogoColor:me="#000000",compactBackgroundColor:B="#ffffff",compactLogoMaxHeight:I=120/1440,compactLogoPosition:ee,compactPanelHeight:ie=60/1440,compactShowIcon:pe="on",compactIconSize:V=16/1440,compactNavTextWidth:Ie,compactNavTextPosition:be,compactNavTextOffset:J,compactNavGap:He,compactNavPaddingLeft:We=10/1440,compactNavPaddingRight:it=10/1440,compactFontFamily:qe,compactFontSettings:tt,compactFontSize:et,compactLineHeight:je,compactLetterSpacing:ye=0,compactWordSpacing:_e=0,compactTextAlign:Be="left",compactTextAppearance:Ze,openLogoColor:we="#000000",menuBackgroundColor:Fe="#ffffff",overlayColor:Ke="rgba(0, 0, 0, 0.45)",closeButtonColor:Je="#000000",effect:st="fade",openPanelSize:ot=100,textWidth:Oe=280/1440,navTextWidth:Ae,navTextPosition:gt="center",navTextOffset:ze=0,gap:De=0,navGap:Xe,navPaddingLeft:dt=10/1440,navPaddingRight:ge=10/1440,textPaddingLeft:Re=10/1440,textPaddingRight:nt=10/1440,textPaddingTop:ut=10/1440,textPaddingBottom:Ge=10/1440,fontFamily:bt,fontSettings:It,fontSize:Mt,lineHeight:wt,letterSpacing:Vt=0,wordSpacing:jt=0,textAlign:qt="left",textAppearance:Ut,openFontFamily:Rt,openFontSettings:Bt,openFontSize:rn,openLineHeight:vt,openLetterSpacing:yt,openWordSpacing:Ee,openTextAlign:Qe,openTextAppearance:rt,stateOverrides:lt,link:Lt}=te,{horizontalAlign:St,verticalAlign:ht}=l$({position:ue,horizontalAlign:ve,verticalAlign:$e}),Pt=Q==="compact",Ot=Pt?I:Pe,At=Kw(Pt?ee:xe),Gt=Pt?ie:de,Et=Pt?V:Se,zt=Pt?Ie:Ae,Ft=Yw(Pt?be:gt),pt=(Pt?J:ze)??0,W=Pt?He:Xe,Le=Pt?We:dt,Ve=Pt?it:ge,Ne=zt??Oe,ft=x||(Pt?pe:he)!=="off",Nt=_.buildColorVars(m,{iconColor:ke,closeButtonColor:Je,linkColor:Ce,openLinkColor:h,compactIconColor:U,compactCloseButtonColor:Z,compactLinkColor:ne,compactLogoColor:me,compactBackgroundColor:B,openLogoColor:we,menuBackgroundColor:Fe,overlayColor:Ke,backgroundColor:K,logoColor:se},g$,h$,lt),mt=wd(Pt?{fontFamily:qe,fontSettings:tt,fontSize:et,lineHeight:je,letterSpacing:ye,wordSpacing:_e,textAlign:Be,textAppearance:Ze}:{fontFamily:bt,fontSettings:It,fontSize:Mt,lineHeight:wt,letterSpacing:Vt,wordSpacing:jt,textAlign:qt,textAppearance:Ut}),$t=wd({fontFamily:Rt,fontSettings:Bt,fontSize:rn,lineHeight:vt,letterSpacing:yt,wordSpacing:Ee,textAlign:Qe,textAppearance:rt},mt),Yt=$d(m,mt,t),Dt=$d(m,$t,t),sn=vd(S,bd(mt)),ln=vd(A,bd($t)),qn={...Dt.css,whiteSpace:"pre-wrap",transform:xd(ln)},Un=Dt.className,hn=Ht=>_.scalingValue(Ht,t),Qi=W??De,Vo=Math.max(Le,go),Go=Math.max(Ve,go),xn=Math.max(0,1-Et),ci=Math.max(0,1-Et),Kn=n??!1,bn=Kn&&!x,Ei=s.useMemo(()=>$p({textPaddingLeft:Re,textPaddingRight:nt,textPaddingTop:ut,textPaddingBottom:Ge,fontSize:$t.fontSize}),[Re,nt,ut,Ge,$t.fontSize]),eo=Ht=>{const Kt=a.jsx("span",{className:Un,style:qn,children:Cd(Ht)});return Id(m,Kt,Oe,Kn,hn)},Te=st==="left"||st==="right"?{width:`${ot}%`}:{height:`${ot}%`},Ye={...p$(Ei,t),...Te,alignItems:y$[St],justifyContent:f$[ht]},k=s.useRef(e),oe=s.useRef(d);s.useEffect(()=>{if(!y||!t){k.current=e,oe.current=d;return}if(oe.current!==d){k.current=e,oe.current=d;const Fi=Ld(e);Fi!==e&&y(Fi);return}const Ht=Ld(e),Kt=k.current,un=Kt!==e,fn=un?u$(Ht,Kt):Ht;k.current=e;const kn=Ht!==e,Nn=un&&c$(Ht,fn);!kn&&!Nn||y(fn)},[e,y,t,d]);const ce=_.scalingValue(Et,t),Me={width:ce,height:ce,minWidth:ce,minHeight:ce,maxWidth:ce,maxHeight:ce},Ue={...Yt.css,textDecoration:"none",transform:xd(sn)},ct=Yt.className,kt=(fe==null?void 0:fe.mode)!=="Off",_t=(fe==null?void 0:fe.icon)??"",nn=S$(_t),on=hn(Math.min(Ot,Gt)),Yn=!!(kt&&_t&&At==="right")?"left":"right",Ai=Array.isArray(Lt)?Lt:[],to=[Q!=="default"?`${m}-state-${Q}`:"",N==="open"?`${m}-state-open`:"",D&&D!==Q&&D!==N?`${m}-state-${D}`:""].filter(Boolean).join(" "),Da=t&&!i?`${m}-editor`:"",kr=H?`${m}-interactive`:"",Np=le&&(Q!==ae||re)?`${m}-nav-state-anim`:"",_p=x?`${m}-open`:"",Hp=s.useMemo(()=>P$(g.current),[X,x,d]),za=()=>{M(!1)},Ba=!t||i,Gl=(Ht,Kt)=>{C$(Ht,za,{isEditor:t,isPreviewMode:i,item:Kt,pages:u,onLinkNavigate:p})},Wp=()=>{t&&!i||M(Ht=>!Ht)},Op=Ht=>{Ht.pointerType==="touch"&&Ht.currentTarget.blur()},Er=()=>{G.current!==null&&(window.clearTimeout(G.current),G.current=null)};s.useEffect(()=>{if(!re)return;const Ht=window.setTimeout(()=>{F(!1)},en);return()=>window.clearTimeout(Ht)},[re,Q]),s.useEffect(()=>{if(x){Er(),$(!0);return}return w.current+=1,O(!1),Er(),G.current=window.setTimeout(()=>{G.current=null,$(!1)},$n),Er},[x]),s.useLayoutEffect(()=>{q.current!==d&&(q.current=d,w.current+=1,Er(),M(!1),O(!1),$(!1))},[d]),s.useLayoutEffect(()=>{var un;if(!X||!x)return;const Ht=w.current+1;w.current=Ht,O(!1),(un=b.current)==null||un.offsetHeight;const Kt=requestAnimationFrame(()=>{w.current===Ht&&O(!0)});return()=>{cancelAnimationFrame(Kt)}},[X,x]),s.useLayoutEffect(()=>{if(!Y||!X)return;const Ht=f.current;if(!Ht)return;const Kt=getComputedStyle(Ht).backgroundColor;if(!Kt)return;const un=document.documentElement,{body:fn}=document,kn=un.style.backgroundColor,Nn=fn.style.backgroundColor;return un.style.backgroundColor=Kt,fn.style.backgroundColor=Kt,()=>{un.style.backgroundColor=kn,fn.style.backgroundColor=Nn}},[Y,X,to,Fe,lt]),s.useEffect(()=>{v==null||v(x)},[x,v]),s.useEffect(()=>{if(!x)return;const Ht=Kt=>{Kt.key==="Escape"&&(t&&i||za())};return window.addEventListener("keydown",Ht),()=>window.removeEventListener("keydown",Ht)},[x,t,i]),s.useEffect(()=>{t&&!i&&N!=="open"&&M(!1)},[t,i,N]),s.useEffect(()=>{i&&M(!1)},[i]);const Xl=Kn&&x,Dp=Ht=>Ai.filter(Kt=>e$(Kt,d)).map((Kt,un)=>{const{label:fn,href:kn,target:Nn}=qs(Kt,u),Fi=kn?a.jsx("a",{href:kn,target:Nn,rel:Nn==="_blank"?"noopener noreferrer":void 0,className:`${Ht} ${m}-has-href`,onClick:ja=>Gl(ja,Kt),children:eo(fn)}):a.jsx("span",{className:Ht,children:eo(fn)});return a.jsxs(s.Fragment,{children:[un>0&&a.jsx("div",{"data-controls":Xl?"gap":void 0,"data-controls-axis":"y",className:Xl?`${m}-gap-control`:void 0,style:{height:hn(De)}}),Fi]},un)}),zp=X?a.jsxs("div",{ref:b,"data-selection":"none",className:[`${m}-lightbox`,`${m}-full-lightbox ${m}-effect-${st}`,T?`${m}-lightbox-active`:"",`${m}-lightbox-editor`,n?`${m}-lightbox-edit-mode`:"",kr,to].filter(Boolean).join(" "),style:{...Nt,...Hp},"aria-hidden":!T,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:Ye,"aria-label":"Menu","data-lightbox-scrollable":"",children:[Kn&&m$(m,Ei,$t.fontSize,hn),Dp(`${m}-link`)]}),Y?a.jsx("div",{ref:f,className:`${m}-safari-tint`,"aria-hidden":"true"}):null]}):null,Bp=()=>a.jsx("button",{type:"button",className:`${m}-toggle`,onClick:Wp,onPointerUp:Op,"aria-expanded":x,"aria-label":x?"Close menu":"Open menu",children:a.jsx(n$,{className:`${m}-icon`,lineClassName:`${m}-icon-line`})}),Mr=Ht=>{const Kt=Ht==="left",un=Kt?Le:Ve,fn=Kt?Vo:Go,kn=Kt?xn:ci,Nn=Pt?Kt?"compactNavPaddingLeft":"compactNavPaddingRight":Kt?"navPaddingLeft":"navPaddingRight";return a.jsx("div",{className:Kt?`${m}-nav-padding-left`:`${m}-nav-padding-right`,style:{width:hn(un),flexShrink:0},children:bn?a.jsx("div",{"data-controls":Nn,"data-controls-axis":"x","data-controls-variant":"column-padding",...Kt?{}:{"data-controls-reverse":""},"data-controls-min":"0","data-controls-max-fraction":String(kn),className:`${m}-control-anchor`,style:{top:0,[Kt?"left":"right"]:0,width:hn(fn),height:"100%"}}):null})},jp=(Ht,Kt)=>{const{label:un,href:fn,target:kn}=qs(Ht,u),Nn=a.jsx("span",{className:ct,style:Ue,children:Cd(un)}),Fi=Id(m,Nn,Ne,bn,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:Xp=>Gl(Xp,Ht),children:Fi}):a.jsx("span",{className:`${m}-nav-link`,children:Fi});return a.jsxs(s.Fragment,{children:[Kt>0&&a.jsx("div",{"data-controls":bn?Pt?"compactNavGap":"navGap":void 0,"data-controls-axis":"x",className:bn?`${m}-gap-control ${m}-nav-gap-control`:`${m}-nav-gap-control}`,style:{width:hn(Qi),flexShrink:0}}),ja]},Kt)},Vp={...Nt,height:_.scalingValue(Gt,t),minHeight:_.scalingValue(Gt,t),[`--${m}-panel-height`]:_.scalingValue(Gt,t)},Gp=l&&Q==="default"&&N!=="open"&&!i?hn(de+Gw):"0px";return a.jsxs("div",{ref:g,className:`${m}-root ${to} ${Da} ${kr} ${Np}`.trim(),style:{width:"100%",height:"100%",lineHeight:0,fontSize:0,marginTop:Gp,...Nt},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:E}}),a.jsx("span",{ref:S,"aria-hidden":!0,style:Sd(Yt.css),children:"H"}),a.jsx("span",{ref:A,"aria-hidden":!0,style:Sd(Dt.css),children:"H"}),a.jsx("div",{className:`${m}-nav-slide`,children:a.jsxs("div",{className:`${m}-nav-bar`,style:Vp,children:[kt&&_t?a.jsxs("div",{className:`${m}-nav-logo ${m}-nav-logo-${At}`,children:[At==="left"?Mr("left"):null,a.jsxs("div",{className:`${m}-nav-logo-inner${nn?` ${m}-nav-logo-tinted`:""}`,style:{height:on,...nn?{[`--${m}-logo-image`]:x$(_t)}:{}},children:[a.jsx("img",{src:_t,alt:"",className:`${m}-nav-logo-img`}),nn?a.jsx("span",{className:`${m}-nav-logo-tint`,"aria-hidden":"true"}):null]}),At==="right"?Mr("right"):null]}):null,a.jsx("nav",{className:`${m}-nav-links ${m}-nav-links-${Ft}`,style:{transform:Zw(Ft,pt,t)},"aria-label":"Navigation",children:a.jsx("div",{className:`${m}-nav-links-inner`,children:Ai.filter(Ht=>Qw(Ht,Q,d)).map((Ht,Kt)=>jp(Ht,Kt))})})]})}),zp,a.jsxs("div",{className:`${m}-nav-toggle-wrap ${m}-nav-toggle-wrap-${Yn}`,children:[Yn==="left"?Mr("left"):null,ft?a.jsx("div",{className:`${m}-root ${_p}`.trim(),style:Me,children:Bp()}):null,Yn==="right"?Mr("right"):null]})]})}const R$=`import { Fragment, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type MouseEvent, type PointerEvent, type ReactNode } from 'react';
|
|
24684
24685
|
import { CommonComponentProps } from '../props';
|
|
24685
24686
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
|
|
24686
24687
|
import { useLightboxScrollLock } from '../utils/useLightboxScrollLock';
|
|
@@ -27242,7 +27243,7 @@ export function Burger({
|
|
|
27242
27243
|
</div>
|
|
27243
27244
|
);
|
|
27244
27245
|
}
|
|
27245
|
-
`;function Qo(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Bi={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 hi(e,t){return e?`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`:t}function Bl(e){return{[hi(e,"fontFamily")]:{type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},[hi(e,"fontSettings")]:{...Bi.fontSettings,scope:"common",title:""},[hi(e,"fontSize")]:{...Bi.fontSize,scope:"layout",title:""},[hi(e,"lineHeight")]:{...Bi.lineHeight,scope:"layout",title:""},[hi(e,"letterSpacing")]:{...Bi.letterSpacing,scope:"layout",title:""},[hi(e,"wordSpacing")]:{...Bi.wordSpacing,scope:"layout",title:""},[hi(e,"textAlign")]:{...Bi.textAlign,scope:"layout",title:""},[hi(e,"textAppearance")]:{...Bi.textAppearance,scope:"layout",title:""}}}const k$=Bl(""),E$=Bl("open"),M$=Bl("compact"),A$=["__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"],F$=["__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"],N$=["__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"],Jn={textTransform:"none",textDecoration:"none",fontVariant:"normal"},$s={fontWeight:400,fontStyle:"normal"},Yr={d:"Always",t:"Open Only",m:"Open Only"},_$=["left-top","center-top","right-top","left-center","center","right-center","left-bottom","center-bottom","right-bottom"],H$=["iconColor","logoColor","closeButtonColor","linkColor","backgroundColor"],W$={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"}},compactCloseButtonColor:{type:"string",scope:"common",title:"Close Default",titleByState:{compact:"Close Default","compact-hover":"Close 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:{default:"Close Default",hover:"Close Hover",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:[..._$]}},stateOverrides:{type:"object",scope:"common"},gap:Qo("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:Qo("Text padding left"),textPaddingRight:Qo("Text padding right"),textPaddingTop:Qo("Text padding top"),textPaddingBottom:Qo("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}},...k$,...E$,...M$},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",compactCloseButtonColor:"#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",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:Jn,openFontSize:34/375,openLineHeight:20/375,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Jn,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:Jn},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:Jn,openFontSize:75/768,openLineHeight:20/768,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Jn,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:Jn},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:Jn,textAlign:"center",openFontSize:90/1440,openLineHeight:16/1440,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Jn,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:Jn,compactTextAlign:"center"}},layout:["__componentName__","link","logo","logoMaxHeight","logoPosition","panelHeight","backgroundColor","logoColor","iconColor","showIcon","iconSize","linkColor","openLinkColor","compactShowIcon","compactIconColor","compactCloseButtonColor","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:A$},{id:"compact",icon:"compact",title:"Compact",tooltip:"Compact State",layout:F$,availableWhen:{navigationPosition:["switch"]}},{id:"open",icon:"open",title:"Open",tooltip:"Open State",layout:N$},{id:"links",icon:"content",title:"Links",tooltip:"Link Settings",layout:["__componentName__","link"]}],paletteBookmark:{items:[...H$],panelIds:["default","compact","open"],stateItems:{default:["iconColor","logoColor","closeButtonColor","linkColor","backgroundColor"],hover:["iconColor","logoColor","closeButtonColor","linkColor"],compact:["compactIconColor","compactLogoColor","compactCloseButtonColor","compactLinkColor","compactBackgroundColor"],"compact-hover":["compactIconColor","compactLogoColor","compactCloseButtonColor","compactLinkColor"],open:["closeButtonColor","openLogoColor","openLinkColor","menuBackgroundColor","overlayColor"],"open-hover":["closeButtonColor","openLogoColor","openLinkColor"]}},states:["default","hover"],statePanels:["default","compact","open"]},O$={element:I$,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:W$,sourceCode:R$,assetsPaths:{content:[],parameters:[{path:"logo.icon",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"},{path:"openFontFamily"},{path:"compactFontFamily"}]},fontRelations:{fontSettings:"fontFamily",openFontSettings:"openFontFamily",compactFontSettings:"compactFontFamily"}},Rd=120,kd=3,D$=.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 Ed(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 z$(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 B$(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 j$(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 V$(i)}function V$(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 G$(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 X$(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 q$(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 U$(e,t,n,i){let o=null;for(let r=0;r<kd;r+=1){const l=Sa(t+(n-t)*r/Math.max(1,kd-1)),c=j$(e,l),d=i==="avoid"?X$(c):c;if(o=o===null?d:G$(o,d),o.length===0)return[]}return o??[]}function Md(e,t="stretch",n=jl){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=Pi(i),c=br(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 b=0;b<Rd;b+=1){const S=v.getPointAtLength(b/Rd*m);g.push({x:S.x,y:S.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,K$=12,Y$=16,Ts=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,Z$=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g,Ad=Math.PI/4,J$=8,Q$=Math.PI/18,eC=8,ho=24,fo=[];function tC(){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 nC(e){const t=wi(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 iC(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 Fd(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=Pi(c);d.length&&(l=n==="viewbox"?Ls(d,i):nC(d))}if(!l.length){const d=o!=="custom"?Vl[o]:void 0;d?l=Ls(Pi(d),jl):l=tC()}}return o==="circle"?iC(l,r):l}function Nd(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(br(Pi(t)),jl):[B$([[0,0],[1,0],[1,1],[0,1]])]}function oC(e){const t=e.match(Z$);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 rC(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(rC)}))}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 _d(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 aC(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,b=-y*v+p*m,S=g*g/(c*c)+b*b/(d*d);if(S>1){const Y=Math.sqrt(S);c*=Y,d*=Y}const A=o===r?-1:1,f=c*c*b*b+d*d*g*g,w=Math.max(0,c*c*d*d-f),G=f===0?0:A*Math.sqrt(w/f),q=G*c*b/d,E=-G*d*g/c,P=p*q-y*E+(e.x+l.x)/2,M=y*q+p*E+(e.y+l.y)/2,X=Math.atan2((b-E)/d,(g-q)/c);let T=Math.atan2((-b-E)/d,(-g-q)/c)-X;!r&&T>0&&(T-=Math.PI*2),r&&T<0&&(T+=Math.PI*2);const O=Math.max(1,Math.ceil(Math.abs(T)/(Math.PI/2))),F=T/O,L=4/3*Math.tan(F/4),C=(Y,R)=>({x:P+p*c*Y-y*d*R,y:M+y*c*Y+p*d*R}),j=[];let x=X;for(let Y=0;Y<O;Y+=1){const R=x+F,H=Math.cos(x),D=Math.sin(x),Q=Math.cos(R),ae=Math.sin(R);j.push({c1:C(H-L*D,D+L*H),c2:C(Q+L*ae,ae-L*Q),p:Y===O-1?pn(l):C(Q,ae)}),x=R}return j}function Pi(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(),b=m!==g,S=oC(v[2]),A=f=>b?{x:r.x+S[f],y:r.y+S[f+1]}:{x:S[f],y:S[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<S.length;f+=2){const w=A(f);f===0&&(u(),l=pn(w)),p(w)}c=null,d=null}else if(g==="L"){for(let f=0;f+1<S.length;f+=2)p(A(f));c=null,d=null}else if(g==="H"){for(const f of S)p({x:b?r.x+f:f,y:r.y});c=null,d=null}else if(g==="V"){for(const f of S)p({x:r.x,y:b?r.y+f:f});c=null,d=null}else if(g==="C"){for(let f=0;f+5<S.length;f+=6){const w=A(f),G=A(f+2),q=A(f+4);y(w),p(q,G),c=G}d=null}else if(g==="S"){for(let f=0;f+3<S.length;f+=4){const w=c?Zs(c,r):pn(r),G=A(f),q=A(f+2);y(w),p(q,G),c=G}d=null}else if(g==="Q")for(let f=0;f+3<S.length;f+=4){const w=A(f),G=A(f+2);y(Cn(r,w,2/3)),p(G,Cn(G,w,2/3)),d=w,c=null}else if(g==="T")for(let f=0;f+1<S.length;f+=2){const w=d?Zs(d,r):pn(r),G=A(f);y(Cn(r,w,2/3)),p(G,Cn(G,w,2/3)),d=w,c=null}else if(g==="A")for(let f=0;f+6<S.length;f+=7){const w=b?{x:r.x+S[f+5],y:r.y+S[f+6]}:{x:S[f+5],y:S[f+6]};for(const G of aC(r,S[f],S[f+1],S[f+2],S[f+3]!==0,S[f+4]!==0,w))y(G.c1),p(G.p,G.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 Tp(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 Hd(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(Hd(r,l)),r=l;if(n.closed){const l=Hd(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function Lp(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 br(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of Lp(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 wi(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of br(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 sC(e){const t=wi(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 Pp(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 Ip(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=K$)return{closed:!0,nodes:t.map(r=>({p:pn(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/Y$)),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),...Pp(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function Rp(e,t,n=1){if(!e.length)return!1;const i=wi(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 lC(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 cC(e,t){if(!e.length)return e;const n=wi(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 kp(e){const t={x:0,y:0,width:wa,height:wa},n=e!=="custom"?Vl[e]:void 0,i=n?cn(Pi(n),r=>({x:r.x/100*t.width+t.x,y:r.y/100*t.height+t.y})):cn(Ip(Ys("rectangle")),r=>({x:r.x*t.width+t.x,y:r.y*t.height+t.y})),o=cC(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 dC(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 Wd(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 uC(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=Ep(i,r,c)}),i}function pC(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 mC(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 gC(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),b=Cn(v,m,i),S=Cn(m,g,i),A=Cn(b,S,i),f=(n+1)%o.nodes.length;return d[n].out=v,d[f].in=g,d.splice(u,0,{p:A,in:b,out:S}),{contours:c,nodeIndex:u}}function Ep(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 Od(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(Tp(c)||y||v)return c.in=null,c.out=null,l[u].out=null,l[p].in=null,r;const m=Pp(l[u].p,c.p,l[p].p);return c.in=m.in,c.out=m.out,r}function hC(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 Dd(e,t){let n=null;return e.forEach((i,o)=>{for(const r of Lp(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=hC(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 fC(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 zd(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 Bd(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 yC(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 vC(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 xC(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 jd(e,t,n,i,o){if(e.axis===null)return xC(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 bC(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(jd(t,"x",l,i,o)),n&&e.y===n.value&&r.push(jd(n,"y",l,i,o)),r}function SC(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 wC(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/Ad)*Ad;let g=o?m:null,b=!1;if(!o){const E=[];n&&E.push({angle:Math.atan2(n.y,n.x),smooth:!0}),E.push({angle:m,smooth:!1});for(const P of E){const M=vC(P.angle-v);if(!(Math.abs(M)>Q$)&&!(Math.abs(Math.sin(M))*y>J$)){g=P.angle,b=P.smooth;break}}}const S=i!==null&&i>0&&Math.abs(y-i)<=eC;if(g===null&&!S)return{point:e,guides:fo};const A=g??v,f=S?i:y,w={x:Math.cos(A),y:Math.sin(A)},G=f+(g===null?0:ho),q=S?f:b?ho:0;return{point:l({x:c.x+w.x*f,y:c.y+w.y*f}),guides:[{kind:"angle",a:{x:c.x-w.x*q,y:c.y-w.y*q},b:{x:c.x+w.x*G,y:c.y+w.y*G}}]}}const tl=.1,nl=8,$C=4,Vd=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}}},Mp=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*Vd,y:n.y+o*Vd}},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),Xi=(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)<$C?.5:Sa(r)},CC=(e,t,n,i,o,r)=>{const l=Xi(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=Xi(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}},Gd=1.08,Jr=14,Qr=8;function TC({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,"")}`,b=s.useRef(null),S=s.useRef(null),A=s.useRef({focalX:d,focalY:u,scale:p});A.current={focalX:d,focalY:u,scale:p};const f=l==="image";s.useEffect(()=>{var F;f&&((F=m.current)==null||F.focus({preventScroll:!0}))},[f]);const w=s.useCallback((F,L)=>{var j;const C=(j=m.current)==null?void 0:j.getBoundingClientRect();return!C||C.width<=0||C.height<=0?{x:0,y:0}:{x:(F-C.left)/C.width*t.width,y:(L-C.top)/C.height*t.height}},[t.width,t.height]),G=F=>{var C,j;if(!i)return;F.stopPropagation(),F.preventDefault(),(C=m.current)==null||C.focus({preventScroll:!0});const L=Xi(n,i,p);b.current={pointerId:F.pointerId,origin:w(F.clientX,F.clientY),startX:Dn(n.width,L.width,d),startY:Dn(n.height,L.height,u),width:L.width,height:L.height,moved:!1},(j=m.current)==null||j.setPointerCapture(F.pointerId)},q=(F,L)=>{var Q,ae;if(!i)return;F.stopPropagation(),F.preventDefault(),(Q=m.current)==null||Q.focus({preventScroll:!0});const C=Xi(n,i,p),j=Dn(n.width,C.width,d),x=Dn(n.height,C.height,u),Y={minX:j,minY:x,maxX:j+C.width,maxY:x+C.height},R=$a(Y,Mp(L)),H=$a(Y,L),D=Math.hypot(H.x-R.x,H.y-R.y);!isFinite(D)||D<=0||(S.current={pointerId:F.pointerId,anchor:R,startDistance:D,startScale:p,startX:j,startY:x,moved:!1},(ae=m.current)==null||ae.setPointerCapture(F.pointerId))},E=F=>{if(!i)return;const L=S.current;if(L&&F.pointerId===L.pointerId){F.stopPropagation(),F.preventDefault();const j=w(F.clientX,F.clientY),x={x:j.x-n.x,y:j.y-n.y},Y=Math.hypot(x.x-L.anchor.x,x.y-L.anchor.y),R=Math.min(nl,Math.max(tl,L.startScale*(Y/L.startDistance)));if(!L.moved&&Math.abs(R-L.startScale)<1e-4)return;L.moved=!0;const H=R/L.startScale,D=L.anchor.x+(L.startX-L.anchor.x)*H,Q=L.anchor.y+(L.startY-L.anchor.y)*H,ae=Xi(n,i,R);y({focalX:yo(n.width,ae.width,D),focalY:yo(n.height,ae.height,Q),scale:R});return}const C=b.current;if(C&&F.pointerId===C.pointerId){F.stopPropagation(),F.preventDefault();const j=w(F.clientX,F.clientY),x=j.x-C.origin.x,Y=j.y-C.origin.y;if(!C.moved&&x===0&&Y===0)return;C.moved=!0,y({focalX:yo(n.width,C.width,C.startX+x),focalY:yo(n.height,C.height,C.startY+Y),scale:p})}},P=F=>{var j,x;const L=b.current;if(L&&F.pointerId===L.pointerId){b.current=null,F.stopPropagation(),(j=m.current)!=null&&j.hasPointerCapture(L.pointerId)&&m.current.releasePointerCapture(L.pointerId),L.moved&&v(A.current);return}const C=S.current;C&&F.pointerId===C.pointerId&&(S.current=null,F.stopPropagation(),(x=m.current)!=null&&x.hasPointerCapture(C.pointerId)&&m.current.releasePointerCapture(C.pointerId),C.moved&&v(A.current))},M=F=>{if(F.key==="Escape"){F.stopPropagation(),c("none");return}if(F.key==="="||F.key==="+"||F.key==="-"||F.key==="_"){F.preventDefault(),F.stopPropagation();const L=F.key==="="||F.key==="+",C=Math.min(nl,Math.max(tl,p*(L?Gd:1/Gd))),j={focalX:d,focalY:u,scale:C};y(j),v(j)}},X=["nw","ne","se","sw"],$={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},T=s.useMemo(()=>{const F=i??{width:n.width,height:n.height},L=Xi(n,F,p);return!(L.width>0)||!(L.height>0)?null:{x:n.x+Dn(n.width,L.width,d),y:n.y+Dn(n.height,L.height,u),width:L.width,height:L.height}},[i,n.x,n.y,n.width,n.height,d,u,p]),O=T?{minX:T.x,minY:T.y,maxX:T.x+T.width,maxY:T.y+T.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:M,onPointerMove:E,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&&T&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:g,maskUnits:"userSpaceOnUse",x:T.x,y:T.y,width:T.width,height:T.height,children:[a.jsx("rect",{x:T.x,y:T.y,width:T.width,height:T.height,fill:"#FFFFFF"}),a.jsx("path",{d:r,fillRule:"evenodd",fill:"#000000"})]})}),a.jsx("image",{className:`${e}-editor-ghost`,href:o??void 0,x:T.x,y:T.y,width:T.width,height:T.height,preserveAspectRatio:"none",mask:`url(#${g})`}),a.jsx("rect",{className:`${e}-editor-image-bounds`,x:T.x,y:T.y,width:T.width,height:T.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:G}),X.map(F=>{const L=il(O,F),C=F==="ne"||F==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:L.x-Qr/2,y:L.y-Qr/2,width:Qr,height:Qr}),a.jsx("rect",{className:`${e}-editor-scale-grab${C?` ${e}-editor-scale-grab-nesw`:""}`,x:L.x-Jr/2,y:L.y-Jr/2,width:Jr,height:Jr,onPointerDown:j=>q(j,F)})]},F)})]})]})}const rl=10,LC=rl*2,Wn=7,PC=4,so=9,IC=3.5,Xd=1.08,RC=.05,ea=14,kC=1,ta=14,na=8;function EC({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 b=s.useRef(null),S=s.useRef(null),A=s.useRef(null),f=s.useRef(null),[w,G]=s.useState([]),[q,E]=s.useState(fo),[P,M]=s.useState(null),X=s.useCallback(h=>{E(U=>yC(U,h)?U:h)},[]),$=c==="shape";s.useEffect(()=>{var h;$&&((h=v.current)==null||h.focus({preventScroll:!0}))},[$]),s.useEffect(()=>{$||G(h=>h.length?[]:h)},[$]);const T=w.length>0;s.useEffect(()=>{u==null||u(T)},[T,u]),s.useEffect(()=>()=>u==null?void 0:u(!1),[u]);const O=n.width>0?t.width/n.width:1,F=n.height>0?t.height/n.height:1,L=Math.min(O,F),C=r&&l?L:O,j=r&&l?L:F,x=r&&l?(t.width-n.width*L)/2:0,Y=r&&l?(t.height-n.height*L)/2:0,R=s.useCallback(h=>r?{x:x+(h.x-n.x)*C,y:Y+(h.y-n.y)*j}:{x:h.x-n.x,y:h.y-n.y},[r,n,C,j,x,Y]),H=s.useCallback(h=>r?{x:n.x+(C>0?(h.x-x)/C:0),y:n.y+(j>0?(h.y-Y)/j:0)}:{x:n.x+h.x,y:n.y+h.y},[r,n,C,j,x,Y]),D=s.useMemo(()=>H({x:t.width/2,y:t.height/2}),[H,t.width,t.height]),Q=s.useCallback((h,U)=>{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 me=(h-Z.left)/Z.width*t.width,B=(U-Z.top)/Z.height*t.height;return{x:n.x+(C>0?(me-x)/C:0),y:n.y+(j>0?(B-Y)/j:0)}}return{x:n.x+(h-Z.left),y:n.y+(U-Z.top)}},[r,n,t.width,t.height,C,j,x,Y]),ae=s.useCallback((h,U)=>{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:(U-Z.top)/Z.height*t.height}},[t.width,t.height]),z=s.useCallback((h,U)=>{const Z=l&&!(U!=null&&U.preserveShape)?lC(h,n,t,x,Y,C,j):h;y(Z,U)},[y,l,n,t,x,Y,C,j]),re=s.useCallback(()=>{M(null)},[]),_=s.useCallback((h,U,Z)=>{if(!Z||b.current||S.current||A.current||f.current){re();return}const ne=ae(h,U),me=cn(g.current,R);for(const V of me)for(const Ie of V.nodes)if(Math.hypot(Ie.p.x-ne.x,Ie.p.y-ne.y)<=so){re();return}const B=Dd(me,ne);if(!B||B.distance>rl){re();return}const I=me[B.contour],ee=I==null?void 0:I.nodes[B.segment],ie=I==null?void 0:I.nodes[(B.segment+1)%((I==null?void 0:I.nodes.length)??1)],pe=!!(ee&&ie&&!jo(ee,ie));M(V=>V&&V.curved===pe&&Math.hypot(V.point.x-B.point.x,V.point.y-B.point.y)<.25?V:{point:B.point,curved:pe})},[ae,R,re]),le=h=>{var We;const U=h.metaKey||h.ctrlKey,Z=A.current;if(Z&&h.pointerId===Z.pointerId){if(h.stopPropagation(),h.preventDefault(),Z.startDistance<=0)return;const it=Q(h.clientX,h.clientY),qe=Math.hypot(it.x-Z.origin.x,it.y-Z.origin.y),tt=Math.max(RC,qe/Z.startDistance);if(!Z.moved&&Math.abs(tt-1)<1e-4)return;Z.moved=!0,p(_d(Z.startContours,Z.origin,tt));return}const ne=S.current;if(ne&&h.pointerId===ne.pointerId){h.stopPropagation(),h.preventDefault();const it=Q(h.clientX,h.clientY),{bbox:qe}=ne,tt=qe.maxX-qe.minX,et=qe.maxY-qe.minY,je=it.x-ne.origin.x,ye=it.y-ne.origin.y;let _e=je,Be=ye;if(isFinite(tt)&&isFinite(et))if(r){let we=n.x,Fe=n.x+n.width,Ke=n.y,Je=n.y+n.height;l&&(C>0&&(we=n.x+(0-x)/C,Fe=n.x+(t.width-x)/C),j>0&&(Ke=n.y+(0-Y)/j,Je=n.y+(t.height-Y)/j));const st=Math.min(we,Fe-tt),ot=Math.max(we,Fe-tt),Oe=Math.min(Ke,Je-et),Ae=Math.max(Ke,Je-et),gt=Math.min(ot,Math.max(st,qe.minX+je)),ze=Math.min(Ae,Math.max(Oe,qe.minY+ye));_e=gt-qe.minX,Be=ze-qe.minY}else{const we=qe.minX-n.x,Fe=qe.minY-n.y,Ke=Math.min(0,t.width-tt),Je=Math.max(0,t.width-tt),st=Math.min(0,t.height-et),ot=Math.max(0,t.height-et),Oe=Math.min(Je,Math.max(Ke,we+je)),Ae=Math.min(ot,Math.max(st,Fe+ye));_e=Oe-we,Be=Ae-Fe}const Ze=[];if(!U&&isFinite(tt)&&isFinite(et)){const we=R({x:qe.minX+tt/2+_e,y:qe.minY+et/2+Be}),Fe={x:t.width/2,y:t.height/2};Math.abs(we.x-Fe.x)<=ea&&(_e=D.x-qe.minX-tt/2,Ze.push(el(Fe.x,"x",t))),Math.abs(we.y-Fe.y)<=ea&&(Be=D.y-qe.minY-et/2,Ze.push(el(Fe.y,"y",t)))}if(!ne.moved&&_e===0&&Be===0)return;ne.moved=!0,X(Ze.length?Ze:fo),p(cn(ne.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 it=Q(h.clientX,h.clientY);let qe=it.x-me.origin.x,tt=it.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(Wd(me.startContours,me.selection,qe,tt));return}const B=b.current;if(!B||h.pointerId!==B.pointerId){_(h.clientX,h.clientY,w.length>0||$);return}re(),h.stopPropagation(),h.preventDefault();const I=Q(h.clientX,h.clientY);if(B.kind==="anchor"){const it={x:B.anchor.x+(I.x-B.origin.x),y:B.anchor.y+(I.y-B.origin.y)},qe=U?[]:fC(g.current,{contour:B.contour,node:B.node}),tt=U||!B.center?[]:[B.center],et=Bd(zd(qe,tt.map(_e=>_e.x),"x"),it,"x",R,ea),je=Bd(zd(qe,tt.map(_e=>_e.y),"y"),it,"y",R,ea),ye=U?it:{x:(et==null?void 0:et.value)??Zr(it.x,o),y:(je==null?void 0:je.value)??Zr(it.y,o)};if(h.shiftKey&&(Math.abs(ye.x-B.anchor.x)>Math.abs(ye.y-B.anchor.y)?ye.y=B.anchor.y:ye.x=B.anchor.x),!B.moved&&ye.x===B.anchor.x&&ye.y===B.anchor.y)return;B.moved=!0,X(bC(ye,et,je,t,R)),p(dC(g.current,B.contour,B.node,ye));return}const ee=(We=g.current[B.contour])==null?void 0:We.nodes[B.node],ie=B.mirror&&!h.altKey,pe=ie||U?null:B.kind==="in"?ee==null?void 0:ee.out:ee==null?void 0:ee.in,V=ee?R(ee.p):null,Ie=pe?R(pe):null,be=ee&&(!U||h.shiftKey)?wC(I,ee.p,ie||U?null:SC(g.current[B.contour],B.node,B.kind,R),V&&Ie?Math.hypot(Ie.x-V.x,Ie.y-V.y):null,h.shiftKey,R,H):{point:I,guides:fo},J=be.guides.length?be.point:U?I:{x:Zr(I.x,o),y:Zr(I.y,o)},He=B.kind==="in"?ee==null?void 0:ee.in:ee==null?void 0:ee.out;!B.moved&&He&&J.x===He.x&&J.y===He.y||(B.moved=!0,X(be.guides),p(pC(g.current,B.contour,B.node,B.kind,J,ie)))},te=h=>{X(fo);const U=A.current;if(U&&h.pointerId===U.pointerId){A.current=null,h.stopPropagation();const pe=v.current;pe!=null&&pe.hasPointerCapture(U.pointerId)&&pe.releasePointerCapture(U.pointerId),U.moved&&z(g.current,{preserveShape:!0});return}const Z=S.current;if(Z&&h.pointerId===Z.pointerId){S.current=null,h.stopPropagation();const pe=v.current;pe!=null&&pe.hasPointerCapture(Z.pointerId)&&pe.releasePointerCapture(Z.pointerId),Z.moved?z(g.current,{preserveShape:!0}):G([]);return}const ne=f.current;if(ne&&h.pointerId===ne.pointerId){f.current=null,h.stopPropagation();const pe=v.current;pe!=null&&pe.hasPointerCapture(ne.pointerId)&&pe.releasePointerCapture(ne.pointerId),ne.moved&&z(g.current);return}const me=b.current;if(!me||h.pointerId!==me.pointerId)return;b.current=null,h.stopPropagation();const B=v.current;B!=null&&B.hasPointerCapture(me.pointerId)&&B.releasePointerCapture(me.pointerId);const I=Math.hypot(h.clientX-me.clientOrigin.x,h.clientY-me.clientOrigin.y);if(me.moved||I>PC){me.moved&&z(g.current);return}if(!me.toggleOnRelease||h.type!=="pointerup")return;const ie=Od(g.current,me.contour,me.node);ie!==g.current&&(p(ie),z(ie))},fe=h=>{h.stopPropagation()},Pe=h=>{var U,Z;h.stopPropagation(),h.preventDefault(),re(),(U=v.current)==null||U.focus({preventScroll:!0}),S.current={pointerId:h.pointerId,origin:Q(h.clientX,h.clientY),startContours:zn(i),bbox:wi(i),moved:!1},(Z=v.current)==null||Z.setPointerCapture(h.pointerId)},xe=(h,U)=>{var I,ee;h.stopPropagation(),h.preventDefault(),re(),(I=v.current)==null||I.focus({preventScroll:!0}),G([]),d("shape");const Z=wi(i),ne=$a(Z,Mp(U)),me=il(Z,U),B=Math.hypot(me.x-ne.x,me.y-ne.y);!isFinite(B)||B<=0||(A.current={pointerId:h.pointerId,corner:U,origin:ne,startDistance:B,startContours:zn(i),moved:!1},(ee=v.current)==null||ee.setPointerCapture(h.pointerId))},ue=(h,U,Z,ne)=>{var I,ee,ie,pe;h.stopPropagation(),h.preventDefault(),re(),(I=v.current)==null||I.focus({preventScroll:!0});const me=(ee=i[Z])==null?void 0:ee.nodes[ne];if(!me)return;if(h.altKey){const V=U==="anchor"?Ep(i,Z,ne):mC(i,Z,ne,U);if(V===i)return;G(U==="anchor"?[]:[{contour:Z,node:ne}]),p(V),z(V);return}const B=h.metaKey||h.ctrlKey;if(U==="anchor"&&h.shiftKey&&!B){G(V=>V.some(Ie=>Ie.contour===Z&&Ie.node===ne)?V.filter(Ie=>!(Ie.contour===Z&&Ie.node===ne)):[...V,{contour:Z,node:ne}]);return}if(U==="anchor"&&!B&&w.length>1&&w.some(V=>V.contour===Z&&V.node===ne)){f.current={pointerId:h.pointerId,origin:Q(h.clientX,h.clientY),startContours:zn(i),selection:w,moved:!1},(ie=v.current)==null||ie.setPointerCapture(h.pointerId);return}G([{contour:Z,node:ne}]),b.current={kind:U,contour:Z,node:ne,pointerId:h.pointerId,origin:Q(h.clientX,h.clientY),clientOrigin:{x:h.clientX,y:h.clientY},anchor:me.p,center:sC(i),mirror:U!=="anchor"&&!!(me.in&&me.out),toggleOnRelease:B,moved:!1},(pe=v.current)==null||pe.setPointerCapture(h.pointerId)},K=h=>{h.stopPropagation(),h.preventDefault(),re();const U=cn(i,R),Z=Dd(U,ae(h.clientX,h.clientY));if(!Z||Z.distance>rl)return;const{contours:ne,nodeIndex:me}=gC(i,Z.contour,Z.segment,Z.t);me<0||(G([{contour:Z.contour,node:me}]),p(ne),z(ne))},se=h=>{if(h.key==="="||h.key==="+"||h.key==="-"||h.key==="_"){h.preventDefault(),h.stopPropagation();const B=wi(i);if(!isFinite(B.minX)||!isFinite(B.maxX))return;const I={x:(B.minX+B.maxX)/2,y:(B.minY+B.maxY)/2},ie=h.key==="="||h.key==="+"?Xd:1/Xd,pe=_d(i,I,ie);p(pe),z(pe,{preserveShape:!0});return}if(h.key==="Escape"){h.stopPropagation(),G([]),d("none");return}if(!w.length)return;if(h.key==="Backspace"||h.key==="Delete"){h.preventDefault(),h.stopPropagation();const B=uC(i,w);if(B===i)return;G([]),p(B),z(B);return}const U=o>0?o:kC,Z=h.shiftKey?U*10:U,ne={ArrowLeft:[-Z,0],ArrowRight:[Z,0],ArrowUp:[0,-Z],ArrowDown:[0,Z]}[h.key];if(!ne)return;h.preventDefault(),h.stopPropagation();const me=Wd(i,w,ne[0],ne[1]);p(me),z(me)},de=s.useMemo(()=>_o(cn(i,R)),[i,R]),ve=s.useMemo(()=>wi(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=$&&w.length===0&&isFinite(ve.minX)&&isFinite(ve.maxX)&&ve.maxX>ve.minX&&ve.maxY>ve.minY,Se=w.length>0||$,Te=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:re,onPointerUp:te,onPointerCancel:te,onLostPointerCapture:te,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:()=>{G([]),d("none")},onClick:K}),Te&&a.jsx("path",{className:`${e}-editor-outline`,d:de}),Te&&q.map((h,U)=>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}-${U}`)),a.jsx("path",{ref:m,className:`${e}-editor-body`,d:de,fillRule:"evenodd",onPointerDown:Pe,onClick:K}),Te&&a.jsx("path",{className:`${e}-editor-hit`,d:de,style:{strokeWidth:LC},onClick:K}),Te&&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}),Te&&i.map((h,U)=>h.nodes.map((Z,ne)=>{const me=w.some(I=>I.contour===U&&I.node===ne),B=R(Z.p);return a.jsxs("g",{children:[me&&w.length===1&&["in","out"].map(I=>{const ee=Z[I];if(!ee)return null;const ie=R(ee);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:B.x,y1:B.y,x2:ie.x,y2:ie.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:ie.x,cy:ie.y,r:IC}),a.jsx("circle",{className:`${e}-editor-grab`,cx:ie.x,cy:ie.y,r:so,onPointerDown:pe=>ue(pe,I,U,ne),onClick:fe})]},I)}),a.jsx("rect",{className:`${e}-editor-anchor${me?` ${e}-editor-anchor-selected`:""}`,x:B.x-Wn/2,y:B.y-Wn/2,width:Wn,height:Wn,rx:Tp(Z)?Wn/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:B.x-so,y:B.y-so,width:so*2,height:so*2,onPointerDown:I=>ue(I,"anchor",U,ne),onClick:fe,onDoubleClick:I=>{I.stopPropagation(),I.preventDefault();const ee=Od(i,U,ne);p(ee),z(ee)}})]},`${U}-${ne}`)})),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 U=R(il(ve,h)),Z=h==="ne"||h==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:U.x-na/2,y:U.y-na/2,width:na,height:na}),a.jsx("rect",{className:`${e}-editor-scale-grab${Z?` ${e}-editor-scale-grab-nesw`:""}`,x:U.x-ta/2,y:U.y-ta/2,width:ta,height:ta,onPointerDown:ne=>xe(ne,h),onClick:fe})]},h)})]})]})}const MC=4e3,AC=/^(?:https?:|mailto:|tel:)/i;function Ap(e){return!!e&&typeof e=="object"&&e.type==="link"}function FC(e){if(!e)return;const t=e.replace(/\s+/g,"");if(!(/^[a-z][a-z0-9+.-]*:/i.test(t)&&!AC.test(t)))return t}function NC(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,c)=>{for(const d of r){if(Ap(d)){o(d.children??[],FC(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 qd(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 _C(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(Ap(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function HC(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,b=m.y*i;g<c&&(c=g),g>d&&(d=g),b<u&&(u=b),b>p&&(p=b)}const y=(c+d)/2,v=(u+p)/2;return l.map(m=>{const g=m.x*n,b=m.y*i,S=g-y,A=b-v,f=Math.sqrt(S*S+A*A);if(f<1e-6)return m;const G=Math.max(0,f+r*t)/f;return{x:(y+S*G)/n,y:(v+A*G)/i}})})}const Ps=2,Is=2;function WC(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 Ud(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,b=e.lineHeight*l,S=e.spaceWidth*l,A=Math.max(0,e.shapeMargin??0),f=[],w=t.map((C,j)=>({token:C,originalIndex:j,width:n[j],kind:"whole"}));if(!w.length||c<=0||b<=0)return{segments:f,placed:0,height:0,capLeft:0,capTop:0,renderTokens:t};const G=Math.max(1,S*.5),q=b*D$,E=HC(i,A,c,d,o);let P=0,M=0,X=0,$=w[0].token.para,T=0,O=0,F=null;for(;P<w.length&&X<MC;){const C=M+b>d;if(C&&!u)break;const j=w[P].token.para;if(j>$+1){M+=b*(j-$-1),$=j-1,X+=1;continue}let x=C?[{x0:0,x1:c}]:U$(E,(M+q)/d,(M+b-q)/d,o).map(R=>({x0:R.x0*c,x1:R.x1*c}));p>0&&y>0&&!C&&x.length&&(F===null&&(F=X,T=x[0].x0,O=M),X-F<y&&(x=q$(x,{x0:T,x1:T+p})));const Y=x.reduce((R,H)=>Math.max(R,H.x1-H.x0),0);for(const R of x){const H=R.x1-R.x0;if(H<G)continue;if(P>=w.length||w[P].token.para!==j)break;const D=P;let Q=0;for(;P<w.length&&w[P].token.para===j;){const ae=w[P],z=P===D,re=ae.width*l,_=z?re:S+re;if(Q+_<=H){Q+=_,P+=1;continue}if(z&&H>=Y-.5&&re>c-.5){Q+=_,P+=1;continue}if(v){const te=H-Q-(z?0:S),fe=WC(ae,m,te,l,g);if(fe){const Pe={token:{...ae.token,text:fe.fragmentText},originalIndex:ae.originalIndex,width:fe.fragmentWidth,kind:"fragment"},xe={token:{...ae.token,text:fe.remainderText},originalIndex:ae.originalIndex,width:fe.remainderWidth,kind:"remainder"};w.splice(P,1,Pe,xe),Q+=(z?0:S)+fe.fragmentWidth*l,P+=1}}break}if(P>D){const ae=P>=w.length||w[P].token.para!==j;f.push({top:M,left:R.x0,width:H,from:D,to:P,justify:r==="justify"&&!ae})}if(P>=w.length||w[P].token.para!==j)break}$=j,M+=b,X+=1}let L=0;if(P>0){const C=w[P-1];L=C.kind==="fragment"?C.originalIndex:C.originalIndex+1}return{segments:f,placed:L,height:f.length?M:0,capLeft:T,capTop:O,renderTokens:w.map(C=>C.token)}}const OC=.12,DC=2,zC=10,Rs=.25,BC=e=>{const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}},jC=(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,VC=(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=BC(e);(!r||!jC(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})))},er=typeof window>"u"?s.useEffect:s.useLayoutEffect;function GC(){return typeof document>"u"?null:document.body}function XC({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:b,dropCapSize:S,showGuides:A,typography:f,imageUrl:w,imageFocalX:G,imageFocalY:q,imageScale:E,imageCustomPath:P,pathDragActive:M,pathCarryImage:X,onCarryImageConsumed:$,pathEditor:T,imageEditor:O}){var Xe,dt;const F=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[L,C]=s.useState(null),j=s.useRef(null),[x,Y]=s.useState({width:0,height:0}),[R,H]=s.useState(0),[D,Q]=s.useState(null),[ae,z]=s.useState(0),[re,_]=s.useState("none");s.useEffect(()=>{!T&&!O&&_("none")},[T,O]);const[le,te]=s.useState(null);s.useEffect(()=>{if(!w||typeof Image>"u"){te(null);return}let ge=!1;const Re=new Image;return Re.onload=()=>{ge||te({width:Re.naturalWidth,height:Re.naturalHeight})},Re.src=w,()=>{ge=!0}},[w]);const fe=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),Pe=s.useMemo(()=>NC(fe),[fe]),xe=s.useMemo(()=>_C(fe),[fe]),ue=b>0&&S>1?((dt=(Xe=Pe[0])==null?void 0:Xe.text)==null?void 0:dt.charAt(0))??"":"",K=(T==null?void 0:T.contours)??null,se=s.useMemo(()=>{let ge=[];if(K){const Re=br(K);Re.length&&(ge=wo(Re,r))}if(!ge.length){const Re=i.trim(),nt=Re?Md(Re,o,r):null;nt&&nt.length?ge=nt:ge=Ys(n==="custom"?"rectangle":n)}return n==="circle"?ks(ge,x):ge},[K,n,i,o,r,x.width,x.height]),de=T==null?void 0:T.onConvert,ve=(T==null?void 0:T.needsConversion)??!1,$e=s.useMemo(()=>{if(n==="circle")return!1;const ge=K??(i.trim()?Pi(i):null);return!!(ge&&Rp(ge,r))},[K,i,r,n]),[ke,he]=s.useState(null);er(()=>{if(!$e){ke&&he(null);return}!ke&&x.width>0&&x.height>0&&he({width:x.width,height:x.height})},[$e,x.width,x.height,ke]);const Se=s.useMemo(()=>{if(!$e||x.width<=0||x.height<=0)return se;const ge=ke??x,Re=r.width/ge.width,nt=r.height/ge.height;return se.map(ut=>ut.map(Ge=>({x:Ge.x*Re,y:Ge.y*nt})))},[se,$e,ke,r.width,r.height,x.width,x.height]),Te=s.useMemo(()=>{if(K){const ut=br(K);if(ut.length){const Ge=wo(ut,r);return n==="circle"?ks(Ge,x):Ge}}const ge=P.trim(),Re=ge?Md(ge,o,r):null,nt=Re&&Re.length?Re:Ys(n==="custom"?"rectangle":n);return n==="circle"?ks(nt,x):nt},[K,n,P,o,r,x.width,x.height]),h=s.useMemo(()=>{if(!$e||x.width<=0||x.height<=0)return Te;const ge=ke??x,Re=r.width/ge.width,nt=r.height/ge.height;return Te.map(ut=>ut.map(Ge=>({x:Ge.x*Re,y:Ge.y*nt})))},[Te,$e,ke,r.width,r.height,x.width,x.height]),U=s.useRef(null),Z=s.useRef(!1);s.useEffect(()=>{if(!(!de||x.width<=0||x.height<=0)){if($e){if(U.current===i)return;const ge=K??(i.trim()?Pi(i):null);if(!(ge!=null&&ge.length))return;const Re=cn(ge,nt=>({x:r.x+(nt.x-r.x)/x.width*r.width,y:r.y+(nt.y-r.y)/x.height*r.height}));U.current=_o(Re),de(Re);return}!ve||!se.length||Z.current||(Z.current=!0,de(cn(Ip(se),ge=>({x:ge.x*wa,y:ge.y*wa}))))}},[ve,$e,de,se,K,i,r,x.width,x.height]);const ne=s.useCallback(()=>{const ge=L;if(!ge)return;const Re=ge.getBoundingClientRect(),nt=parseFloat(window.getComputedStyle(ge).paddingTop)||0;H(Ge=>Math.abs(Ge-nt)<.5?Ge:nt);const ut={width:Re.width,height:Re.height};Y(Ge=>Math.abs(Ge.width-ut.width)<.5&&Math.abs(Ge.height-ut.height)<.5?Ge:ut)},[L]);er(()=>{const ge=L;if(!ge||typeof ResizeObserver>"u")return;ne();const Re=new ResizeObserver(ne);return Re.observe(ge),()=>Re.disconnect()},[L,ne]),er(()=>{ne()},[v,ne]),s.useEffect(()=>{const ge=typeof document<"u"?document.fonts:void 0;ge!=null&&ge.ready&&ge.ready.then(()=>{z(Re=>Re+1)})},[]),er(()=>{const ge=j.current;if(!ge)return;if(!Pe.length){Q(null);return}const Re=[],nt=document.createDocumentFragment();for(const pt of Pe){const W=document.createElement("span");Object.assign(W.style,qd(pt.leaf)),W.textContent=pt.text,nt.appendChild(W),Re.push(W)}const ut=document.createElement("span");ut.textContent=" ",nt.appendChild(ut);const Ge=document.createElement("span");Ge.textContent="-",nt.appendChild(Ge);const bt=ue||"H",It=document.createElement("span");It.textContent=bt,It.style.lineHeight="1",nt.appendChild(It),ge.replaceChildren(nt);const Mt=window.getComputedStyle(ge),wt=parseFloat(Mt.fontSize)||16,Vt=parseFloat(Mt.lineHeight),jt=Number.isNaN(Vt)?wt*1.2:Vt,qt=Math.max(jt,wt),Ut=document.createElement("span");Ut.textContent=bt,Ut.style.lineHeight=`${qt}px`;const Rt=document.createElement("span");Rt.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",Ut.appendChild(Rt),ge.appendChild(Ut);const Bt=Ut.getBoundingClientRect().top,rn=Rt.getBoundingClientRect().top,vt=Math.max(1,rn-Bt);Ut.remove();let yt=vt*.8;const Qe=document.createElement("canvas").getContext("2d"),rt=pt=>`${Mt.fontStyle} ${Mt.fontWeight} ${pt}px ${Mt.fontFamily}`;if(Qe){Qe.font=rt(wt);const pt=Qe.measureText(bt).actualBoundingBoxAscent;pt>0&&(yt=pt)}const lt=S>1?(S-1)*qt+yt:yt;let Lt=wt*(lt/yt);if(Qe){Qe.font=rt(Lt);const pt=Qe.measureText(bt).actualBoundingBoxAscent;pt>0&&(Lt=Lt*(lt/pt))}It.style.fontSize=`${Lt}px`,It.style.lineHeight=`${Lt}px`;const St=document.createElement("span");St.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",It.appendChild(St);const ht=Math.max(1,St.getBoundingClientRect().top-It.getBoundingClientRect().top);St.remove();const Ot=(S-1)*qt+vt-ht,At=Re.map(pt=>pt.getBoundingClientRect().width),Gt=ut.getBoundingClientRect().width,Et=Ge.getBoundingClientRect().width,zt=ue?It.getBoundingClientRect().width:0,Ft=m?Re.map(pt=>{const W=pt.firstChild;if(!(W instanceof Text)||W.data.length<4)return;const Le=document.createRange(),Ve=pt.getBoundingClientRect().left,Ne=[];for(let ft=1;ft<=W.data.length;ft+=1)Le.setStart(W,0),Le.setEnd(W,ft),Ne.push(Le.getBoundingClientRect().right-Ve);return Ne}):[];ge.replaceChildren(),Q({widths:At,spaceWidth:Gt,dashWidth:Et,charWidths:Ft,lineHeight:qt,capWidth:zt,dropCapFontSize:Lt,dropCapTopAdjust:Ot})},[Pe,f,ue,b,S,ae,x.width,m]);const me=D&&ue?D.capWidth+D.lineHeight*OC:0,B=Math.max(b,Math.ceil(S)),I=s.useMemo(()=>{if(!D||!Pe.length||x.width<=0||x.height<=0||!u)return 1;const ge=ut=>Ud({tokens:Pe,widths:D.widths,spaceWidth:D.spaceWidth,lineHeight:D.lineHeight,width:x.width,height:x.height,rings:Se,mode:l,align:c,scale:ut,allowOverflow:!1,capInset:me*ut,capLines:ue?B:0,hyphenate:m,charWidths:D.charWidths,hyphenWidth:D.dashWidth,shapeMargin:R});if(ge(1).placed>=Pe.length)return 1;if(ge(Rs).placed<Pe.length)return Rs;let Re=Rs,nt=1;for(let ut=0;ut<zC;ut+=1){const Ge=(Re+nt)/2;ge(Ge).placed>=Pe.length?Re=Ge:nt=Ge}return Re},[D,Pe,x.width,x.height,Se,l,c,u,me,ue,B,m,R]);s.useEffect(()=>{y(I)},[I,y]);const ee=u?Math.min(p,I):1,ie=s.useMemo(()=>!D||!Pe.length||x.width<=0||x.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0,renderTokens:Pe}:Ud({tokens:Pe,widths:D.widths,spaceWidth:D.spaceWidth,lineHeight:D.lineHeight,width:x.width,height:x.height,rings:Se,mode:l,align:c,scale:ee,allowOverflow:d,capInset:me*ee,capLines:ue?B:0,hyphenate:m,charWidths:D.charWidths,hyphenWidth:D.dashWidth,shapeMargin:R}),[D,Pe,x.width,x.height,Se,l,c,ee,d,me,ue,B,m,R]),pe=g&&Pe.length>0&&ie.placed<Pe.length,V=D?D.dropCapFontSize*ee:0,Ie=D?D.dropCapTopAdjust*ee:0,be=c==="justify"?"left":c,J=D?D.lineHeight*ee:0,He=ie.segments.length?ie.segments[ie.segments.length-1]:null,We=He?{top:He.top+J,left:He.left+He.width/2}:{top:x.height,left:x.width/2},it=!!(T&&K&&x.width>0&&x.height>0),qe=!!O,tt=(it||qe)&&x.width>0&&x.height>0,et=VC(L,tt),je=tt&&et?GC():null,ye=s.useRef(!1),_e=s.useCallback(ge=>{ye.current=ge},[]);s.useEffect(()=>{if(!it&&!qe)return;const ge=Re=>{const nt=L;if(!nt)return;const ut=nt.getBoundingClientRect();Re.clientX>=ut.left&&Re.clientX<=ut.right&&Re.clientY>=ut.top&&Re.clientY<=ut.bottom&&(Re.preventDefault(),Re.stopPropagation(),_(bt=>bt==="shape"&&ye.current?bt:bt==="shape"&&qe?"image":it?"shape":"image"))};return document.addEventListener("dblclick",ge,!0),()=>document.removeEventListener("dblclick",ge,!0)},[it,qe,L]);const Be=s.useMemo(()=>w&&x.width>0&&x.height>0?z$(h,x):null,[w,h,x.width,x.height]),Ze=s.useRef(null),we=(()=>{const ge=Ze.current;return X||!O||!le||!Be||!ge||P===ge.customPath||ge.shape!==n&&n!=="custom"?null:CC(ge.bounds,Be,le,ge.focalX,ge.focalY,ge.scale)})();er(()=>{if(M||!O||!le||!Be)return;const ge=Ze.current,Re=!!(ge&&P!==ge.customPath);Re&&we&&O.onCommit(we),Re&&X&&($==null||$()),Ze.current={rings:h,bounds:Be,focalX:(we==null?void 0:we.focalX)??G,focalY:(we==null?void 0:we.focalY)??q,scale:(we==null?void 0:we.scale)??E,customPath:P,shape:n}},[M,X,P,n,h,Be,O,le,G,q,E,we,$]);const Fe=Ze.current,Ke=!!(M&&!X&&Fe&&!we),Je=Ke&&Fe?Fe.focalX:(we==null?void 0:we.focalX)??G,st=Ke&&Fe?Fe.focalY:(we==null?void 0:we.focalY)??q,ot=Ke&&Fe?Fe.scale:(we==null?void 0:we.scale)??E,Oe=Ke&&Fe?Fe.bounds:Be,Ae=s.useMemo(()=>{if(!(x.width>0)||!(x.height>0))return"";let ge=Fd(i,K,o,r,n,x);if($e){const Re=ke??x,nt=r.width/Re.width,ut=r.height/Re.height;ge=cn(ge,Ge=>({x:Ge.x*nt,y:Ge.y*ut}))}return Nd(ge,x)||Ed(Se,x)},[i,K,o,r,n,x.width,x.height,$e,ke,Se]),gt=s.useMemo(()=>{if(!w||!(x.width>0)||!(x.height>0))return"";let ge=Fd(P,K,o,r,n,x);if($e){const Re=ke??x,nt=r.width/Re.width,ut=r.height/Re.height;ge=cn(ge,Ge=>({x:Ge.x*nt,y:Ge.y*ut}))}return Nd(ge,x)||Ed(h,x)},[w,P,K,o,r,n,x.width,x.height,$e,ke,h]),ze=`${F}-clip`,De=s.useMemo(()=>{if(!Oe)return null;const ge=le??{width:Oe.width,height:Oe.height},Re=Xi(Oe,ge,ot);return{x:Dn(Oe.width,Re.width,Je),y:Dn(Oe.height,Re.height,st),width:Re.width,height:Re.height}},[Oe,le,Je,st,ot]);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:x.width,height:x.height},viewBox:`0 0 ${x.width} ${x.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("path",{className:`${e}-shape-fill-path`,d:Ae,fillRule:"evenodd"}),w&>&&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:w,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:x.width,height:x.height},children:[a.jsx("div",{className:`${e}-measure`,ref:j,style:f,"aria-hidden":!0}),ie.segments.map((ge,Re)=>{const nt=ie.renderTokens.slice(ge.from,ge.to),ut=Re===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,bt)=>{const Mt=ue&&ut&&ge.from===0&&bt===0?Ge.text.slice(1):Ge.text,wt=qd(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:Mt}):a.jsx("span",{style:wt,children:Mt});return a.jsxs("span",{children:[!ge.justify&&bt>0?" ":null,Vt]},bt)})},`${ge.from}-${ge.to}-${Re}`)}),A&&!K&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:Se.map((ge,Re)=>a.jsx("polygon",{points:ge.map(nt=>`${nt.x},${nt.y}`).join(" ")},Re))})]}),ue&&D&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...f,top:`${ie.capTop+Ie}px`,left:`${ie.capLeft}px`,fontSize:`${V}px`,lineHeight:`${V}px`},children:ue}),je&&et&&(K&&T||O)&&Gn.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:et.top,left:et.left,width:et.width,height:et.height,zIndex:DC,pointerEvents:"none"},children:[K&&T&&a.jsx(EC,{P:e,box:{width:et.width,height:et.height},viewBox:r,contours:K,snap:T.snap,stretchToBox:!$e,uniformStretch:n==="circle",stage:re,onStageChange:_,onSelectionChange:_e,onChange:T.onChange,onCommit:T.onCommit}),O&&Oe&&a.jsx(TC,{P:e,box:{width:et.width,height:et.height},bounds:Oe,natural:le,imageUrl:w,maskPath:gt,stage:re,onStageChange:_,focalX:Je,focalY:st,scale:ot,onChange:O.onChange,onCommit:O.onCommit})]}),je),a.jsx("div",{className:`${e}-a11y`,children:xe.map((ge,Re)=>a.jsx("p",{children:ge},Re))}),pe&&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 Fp=["diamond","parallelogram","vase","circle","shield","bobbin","custom"],qC={x:0,y:0,width:100,height:100},UC=e=>{const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?qC:{x:t[0],y:t[1],width:t[2],height:t[3]}},KC=e=>`
|
|
27246
|
+
`;function Qo(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Bi={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 hi(e,t){return e?`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`:t}function Bl(e){return{[hi(e,"fontFamily")]:{type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},[hi(e,"fontSettings")]:{...Bi.fontSettings,scope:"common",title:""},[hi(e,"fontSize")]:{...Bi.fontSize,scope:"layout",title:""},[hi(e,"lineHeight")]:{...Bi.lineHeight,scope:"layout",title:""},[hi(e,"letterSpacing")]:{...Bi.letterSpacing,scope:"layout",title:""},[hi(e,"wordSpacing")]:{...Bi.wordSpacing,scope:"layout",title:""},[hi(e,"textAlign")]:{...Bi.textAlign,scope:"layout",title:""},[hi(e,"textAppearance")]:{...Bi.textAppearance,scope:"layout",title:""}}}const k$=Bl(""),E$=Bl("open"),M$=Bl("compact"),A$=["__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"],F$=["__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"],N$=["__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"],Jn={textTransform:"none",textDecoration:"none",fontVariant:"normal"},$s={fontWeight:400,fontStyle:"normal"},Yr={d:"Always",t:"Open Only",m:"Open Only"},_$=["left-top","center-top","right-top","left-center","center","right-center","left-bottom","center-bottom","right-bottom"],H$=["iconColor","logoColor","closeButtonColor","linkColor","backgroundColor"],W$={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"}},compactCloseButtonColor:{type:"string",scope:"common",title:"Close Default",titleByState:{compact:"Close Default","compact-hover":"Close 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:{default:"Close Default",hover:"Close Hover",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:[..._$]}},stateOverrides:{type:"object",scope:"common"},gap:Qo("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:Qo("Text padding left"),textPaddingRight:Qo("Text padding right"),textPaddingTop:Qo("Text padding top"),textPaddingBottom:Qo("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}},...k$,...E$,...M$},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",compactCloseButtonColor:"#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",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:Jn,openFontSize:34/375,openLineHeight:20/375,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Jn,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:Jn},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:Jn,openFontSize:75/768,openLineHeight:20/768,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Jn,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:Jn},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:Jn,textAlign:"center",openFontSize:90/1440,openLineHeight:16/1440,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Jn,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:Jn,compactTextAlign:"center"}},layout:["__componentName__","link","logo","logoMaxHeight","logoPosition","panelHeight","backgroundColor","logoColor","iconColor","showIcon","iconSize","linkColor","openLinkColor","compactShowIcon","compactIconColor","compactCloseButtonColor","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:A$},{id:"compact",icon:"compact",title:"Compact",tooltip:"Compact State",layout:F$,availableWhen:{navigationPosition:["switch"]}},{id:"open",icon:"open",title:"Open",tooltip:"Open State",layout:N$},{id:"links",icon:"content",title:"Links",tooltip:"Link Settings",layout:["__componentName__","link"]}],paletteBookmark:{items:[...H$],panelIds:["default","compact","open"],stateItems:{default:["iconColor","logoColor","closeButtonColor","linkColor","backgroundColor"],hover:["iconColor","logoColor","closeButtonColor","linkColor"],compact:["compactIconColor","compactLogoColor","compactCloseButtonColor","compactLinkColor","compactBackgroundColor"],"compact-hover":["compactIconColor","compactLogoColor","compactCloseButtonColor","compactLinkColor"],open:["closeButtonColor","openLogoColor","openLinkColor","menuBackgroundColor","overlayColor"],"open-hover":["closeButtonColor","openLogoColor","openLinkColor"]}},states:["default","hover"],statePanels:["default","compact","open"]},O$={element:I$,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:W$,sourceCode:R$,assetsPaths:{content:[],parameters:[{path:"logo.icon",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"},{path:"openFontFamily"},{path:"compactFontFamily"}]},fontRelations:{fontSettings:"fontFamily",openFontSettings:"openFontFamily",compactFontSettings:"compactFontFamily"}},Rd=120,kd=3,D$=.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 Ed(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 z$(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 B$(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 j$(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 V$(i)}function V$(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 G$(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 X$(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 q$(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 U$(e,t,n,i){let o=null;for(let r=0;r<kd;r+=1){const l=Sa(t+(n-t)*r/Math.max(1,kd-1)),c=j$(e,l),d=i==="avoid"?X$(c):c;if(o=o===null?d:G$(o,d),o.length===0)return[]}return o??[]}function Md(e,t="stretch",n=jl){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=Pi(i),c=br(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 b=0;b<Rd;b+=1){const S=v.getPointAtLength(b/Rd*m);g.push({x:S.x,y:S.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,K$=12,Y$=16,Ts=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,Z$=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g,Ad=Math.PI/4,J$=8,Q$=Math.PI/18,eC=8,ho=24,fo=[];function tC(){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 nC(e){const t=wi(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 iC(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 Fd(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=Pi(c);d.length&&(l=n==="viewbox"?Ls(d,i):nC(d))}if(!l.length){const d=o!=="custom"?Vl[o]:void 0;d?l=Ls(Pi(d),jl):l=tC()}}return o==="circle"?iC(l,r):l}function Nd(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(br(Pi(t)),jl):[B$([[0,0],[1,0],[1,1],[0,1]])]}function oC(e){const t=e.match(Z$);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 rC(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(rC)}))}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 _d(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 aC(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,b=-y*v+p*m,S=g*g/(c*c)+b*b/(d*d);if(S>1){const Y=Math.sqrt(S);c*=Y,d*=Y}const A=o===r?-1:1,f=c*c*b*b+d*d*g*g,w=Math.max(0,c*c*d*d-f),G=f===0?0:A*Math.sqrt(w/f),q=G*c*b/d,E=-G*d*g/c,P=p*q-y*E+(e.x+l.x)/2,M=y*q+p*E+(e.y+l.y)/2,X=Math.atan2((b-E)/d,(g-q)/c);let T=Math.atan2((-b-E)/d,(-g-q)/c)-X;!r&&T>0&&(T-=Math.PI*2),r&&T<0&&(T+=Math.PI*2);const O=Math.max(1,Math.ceil(Math.abs(T)/(Math.PI/2))),N=T/O,L=4/3*Math.tan(N/4),C=(Y,R)=>({x:P+p*c*Y-y*d*R,y:M+y*c*Y+p*d*R}),j=[];let x=X;for(let Y=0;Y<O;Y+=1){const R=x+N,H=Math.cos(x),D=Math.sin(x),Q=Math.cos(R),ae=Math.sin(R);j.push({c1:C(H-L*D,D+L*H),c2:C(Q+L*ae,ae-L*Q),p:Y===O-1?pn(l):C(Q,ae)}),x=R}return j}function Pi(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(),b=m!==g,S=oC(v[2]),A=f=>b?{x:r.x+S[f],y:r.y+S[f+1]}:{x:S[f],y:S[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<S.length;f+=2){const w=A(f);f===0&&(u(),l=pn(w)),p(w)}c=null,d=null}else if(g==="L"){for(let f=0;f+1<S.length;f+=2)p(A(f));c=null,d=null}else if(g==="H"){for(const f of S)p({x:b?r.x+f:f,y:r.y});c=null,d=null}else if(g==="V"){for(const f of S)p({x:r.x,y:b?r.y+f:f});c=null,d=null}else if(g==="C"){for(let f=0;f+5<S.length;f+=6){const w=A(f),G=A(f+2),q=A(f+4);y(w),p(q,G),c=G}d=null}else if(g==="S"){for(let f=0;f+3<S.length;f+=4){const w=c?Zs(c,r):pn(r),G=A(f),q=A(f+2);y(w),p(q,G),c=G}d=null}else if(g==="Q")for(let f=0;f+3<S.length;f+=4){const w=A(f),G=A(f+2);y(Cn(r,w,2/3)),p(G,Cn(G,w,2/3)),d=w,c=null}else if(g==="T")for(let f=0;f+1<S.length;f+=2){const w=d?Zs(d,r):pn(r),G=A(f);y(Cn(r,w,2/3)),p(G,Cn(G,w,2/3)),d=w,c=null}else if(g==="A")for(let f=0;f+6<S.length;f+=7){const w=b?{x:r.x+S[f+5],y:r.y+S[f+6]}:{x:S[f+5],y:S[f+6]};for(const G of aC(r,S[f],S[f+1],S[f+2],S[f+3]!==0,S[f+4]!==0,w))y(G.c1),p(G.p,G.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 Tp(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 Hd(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(Hd(r,l)),r=l;if(n.closed){const l=Hd(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function Lp(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 br(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of Lp(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 wi(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of br(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 sC(e){const t=wi(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 Pp(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 Ip(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=K$)return{closed:!0,nodes:t.map(r=>({p:pn(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/Y$)),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),...Pp(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function Rp(e,t,n=1){if(!e.length)return!1;const i=wi(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 lC(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 cC(e,t){if(!e.length)return e;const n=wi(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 kp(e){const t={x:0,y:0,width:wa,height:wa},n=e!=="custom"?Vl[e]:void 0,i=n?cn(Pi(n),r=>({x:r.x/100*t.width+t.x,y:r.y/100*t.height+t.y})):cn(Ip(Ys("rectangle")),r=>({x:r.x*t.width+t.x,y:r.y*t.height+t.y})),o=cC(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 dC(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 Wd(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 uC(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=Ep(i,r,c)}),i}function pC(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 mC(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 gC(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),b=Cn(v,m,i),S=Cn(m,g,i),A=Cn(b,S,i),f=(n+1)%o.nodes.length;return d[n].out=v,d[f].in=g,d.splice(u,0,{p:A,in:b,out:S}),{contours:c,nodeIndex:u}}function Ep(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 Od(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(Tp(c)||y||v)return c.in=null,c.out=null,l[u].out=null,l[p].in=null,r;const m=Pp(l[u].p,c.p,l[p].p);return c.in=m.in,c.out=m.out,r}function hC(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 Dd(e,t){let n=null;return e.forEach((i,o)=>{for(const r of Lp(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=hC(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 fC(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 zd(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 Bd(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 yC(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 vC(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 xC(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 jd(e,t,n,i,o){if(e.axis===null)return xC(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 bC(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(jd(t,"x",l,i,o)),n&&e.y===n.value&&r.push(jd(n,"y",l,i,o)),r}function SC(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 wC(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/Ad)*Ad;let g=o?m:null,b=!1;if(!o){const E=[];n&&E.push({angle:Math.atan2(n.y,n.x),smooth:!0}),E.push({angle:m,smooth:!1});for(const P of E){const M=vC(P.angle-v);if(!(Math.abs(M)>Q$)&&!(Math.abs(Math.sin(M))*y>J$)){g=P.angle,b=P.smooth;break}}}const S=i!==null&&i>0&&Math.abs(y-i)<=eC;if(g===null&&!S)return{point:e,guides:fo};const A=g??v,f=S?i:y,w={x:Math.cos(A),y:Math.sin(A)},G=f+(g===null?0:ho),q=S?f:b?ho:0;return{point:l({x:c.x+w.x*f,y:c.y+w.y*f}),guides:[{kind:"angle",a:{x:c.x-w.x*q,y:c.y-w.y*q},b:{x:c.x+w.x*G,y:c.y+w.y*G}}]}}const tl=.1,nl=8,$C=4,Vd=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}}},Mp=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*Vd,y:n.y+o*Vd}},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),Xi=(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)<$C?.5:Sa(r)},CC=(e,t,n,i,o,r)=>{const l=Xi(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=Xi(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}},Gd=1.08,Jr=14,Qr=8;function TC({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,"")}`,b=s.useRef(null),S=s.useRef(null),A=s.useRef({focalX:d,focalY:u,scale:p});A.current={focalX:d,focalY:u,scale:p};const f=l==="image";s.useEffect(()=>{var N;f&&((N=m.current)==null||N.focus({preventScroll:!0}))},[f]);const w=s.useCallback((N,L)=>{var j;const C=(j=m.current)==null?void 0:j.getBoundingClientRect();return!C||C.width<=0||C.height<=0?{x:0,y:0}:{x:(N-C.left)/C.width*t.width,y:(L-C.top)/C.height*t.height}},[t.width,t.height]),G=N=>{var C,j;if(!i)return;N.stopPropagation(),N.preventDefault(),(C=m.current)==null||C.focus({preventScroll:!0});const L=Xi(n,i,p);b.current={pointerId:N.pointerId,origin:w(N.clientX,N.clientY),startX:Dn(n.width,L.width,d),startY:Dn(n.height,L.height,u),width:L.width,height:L.height,moved:!1},(j=m.current)==null||j.setPointerCapture(N.pointerId)},q=(N,L)=>{var Q,ae;if(!i)return;N.stopPropagation(),N.preventDefault(),(Q=m.current)==null||Q.focus({preventScroll:!0});const C=Xi(n,i,p),j=Dn(n.width,C.width,d),x=Dn(n.height,C.height,u),Y={minX:j,minY:x,maxX:j+C.width,maxY:x+C.height},R=$a(Y,Mp(L)),H=$a(Y,L),D=Math.hypot(H.x-R.x,H.y-R.y);!isFinite(D)||D<=0||(S.current={pointerId:N.pointerId,anchor:R,startDistance:D,startScale:p,startX:j,startY:x,moved:!1},(ae=m.current)==null||ae.setPointerCapture(N.pointerId))},E=N=>{if(!i)return;const L=S.current;if(L&&N.pointerId===L.pointerId){N.stopPropagation(),N.preventDefault();const j=w(N.clientX,N.clientY),x={x:j.x-n.x,y:j.y-n.y},Y=Math.hypot(x.x-L.anchor.x,x.y-L.anchor.y),R=Math.min(nl,Math.max(tl,L.startScale*(Y/L.startDistance)));if(!L.moved&&Math.abs(R-L.startScale)<1e-4)return;L.moved=!0;const H=R/L.startScale,D=L.anchor.x+(L.startX-L.anchor.x)*H,Q=L.anchor.y+(L.startY-L.anchor.y)*H,ae=Xi(n,i,R);y({focalX:yo(n.width,ae.width,D),focalY:yo(n.height,ae.height,Q),scale:R});return}const C=b.current;if(C&&N.pointerId===C.pointerId){N.stopPropagation(),N.preventDefault();const j=w(N.clientX,N.clientY),x=j.x-C.origin.x,Y=j.y-C.origin.y;if(!C.moved&&x===0&&Y===0)return;C.moved=!0,y({focalX:yo(n.width,C.width,C.startX+x),focalY:yo(n.height,C.height,C.startY+Y),scale:p})}},P=N=>{var j,x;const L=b.current;if(L&&N.pointerId===L.pointerId){b.current=null,N.stopPropagation(),(j=m.current)!=null&&j.hasPointerCapture(L.pointerId)&&m.current.releasePointerCapture(L.pointerId),L.moved&&v(A.current);return}const C=S.current;C&&N.pointerId===C.pointerId&&(S.current=null,N.stopPropagation(),(x=m.current)!=null&&x.hasPointerCapture(C.pointerId)&&m.current.releasePointerCapture(C.pointerId),C.moved&&v(A.current))},M=N=>{if(N.key==="Escape"){N.stopPropagation(),c("none");return}if(N.key==="="||N.key==="+"||N.key==="-"||N.key==="_"){N.preventDefault(),N.stopPropagation();const L=N.key==="="||N.key==="+",C=Math.min(nl,Math.max(tl,p*(L?Gd:1/Gd))),j={focalX:d,focalY:u,scale:C};y(j),v(j)}},X=["nw","ne","se","sw"],$={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},T=s.useMemo(()=>{const N=i??{width:n.width,height:n.height},L=Xi(n,N,p);return!(L.width>0)||!(L.height>0)?null:{x:n.x+Dn(n.width,L.width,d),y:n.y+Dn(n.height,L.height,u),width:L.width,height:L.height}},[i,n.x,n.y,n.width,n.height,d,u,p]),O=T?{minX:T.x,minY:T.y,maxX:T.x+T.width,maxY:T.y+T.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:M,onPointerMove:E,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&&T&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:g,maskUnits:"userSpaceOnUse",x:T.x,y:T.y,width:T.width,height:T.height,children:[a.jsx("rect",{x:T.x,y:T.y,width:T.width,height:T.height,fill:"#FFFFFF"}),a.jsx("path",{d:r,fillRule:"evenodd",fill:"#000000"})]})}),a.jsx("image",{className:`${e}-editor-ghost`,href:o??void 0,x:T.x,y:T.y,width:T.width,height:T.height,preserveAspectRatio:"none",mask:`url(#${g})`}),a.jsx("rect",{className:`${e}-editor-image-bounds`,x:T.x,y:T.y,width:T.width,height:T.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:G}),X.map(N=>{const L=il(O,N),C=N==="ne"||N==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:L.x-Qr/2,y:L.y-Qr/2,width:Qr,height:Qr}),a.jsx("rect",{className:`${e}-editor-scale-grab${C?` ${e}-editor-scale-grab-nesw`:""}`,x:L.x-Jr/2,y:L.y-Jr/2,width:Jr,height:Jr,onPointerDown:j=>q(j,N)})]},N)})]})]})}const rl=10,LC=rl*2,Wn=7,PC=4,so=9,IC=3.5,Xd=1.08,RC=.05,ea=14,kC=1,ta=14,na=8;function EC({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 b=s.useRef(null),S=s.useRef(null),A=s.useRef(null),f=s.useRef(null),[w,G]=s.useState([]),[q,E]=s.useState(fo),[P,M]=s.useState(null),X=s.useCallback(h=>{E(U=>yC(U,h)?U:h)},[]),$=c==="shape";s.useEffect(()=>{var h;$&&((h=v.current)==null||h.focus({preventScroll:!0}))},[$]),s.useEffect(()=>{$||G(h=>h.length?[]:h)},[$]);const T=w.length>0;s.useEffect(()=>{u==null||u(T)},[T,u]),s.useEffect(()=>()=>u==null?void 0:u(!1),[u]);const O=n.width>0?t.width/n.width:1,N=n.height>0?t.height/n.height:1,L=Math.min(O,N),C=r&&l?L:O,j=r&&l?L:N,x=r&&l?(t.width-n.width*L)/2:0,Y=r&&l?(t.height-n.height*L)/2:0,R=s.useCallback(h=>r?{x:x+(h.x-n.x)*C,y:Y+(h.y-n.y)*j}:{x:h.x-n.x,y:h.y-n.y},[r,n,C,j,x,Y]),H=s.useCallback(h=>r?{x:n.x+(C>0?(h.x-x)/C:0),y:n.y+(j>0?(h.y-Y)/j:0)}:{x:n.x+h.x,y:n.y+h.y},[r,n,C,j,x,Y]),D=s.useMemo(()=>H({x:t.width/2,y:t.height/2}),[H,t.width,t.height]),Q=s.useCallback((h,U)=>{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 me=(h-Z.left)/Z.width*t.width,B=(U-Z.top)/Z.height*t.height;return{x:n.x+(C>0?(me-x)/C:0),y:n.y+(j>0?(B-Y)/j:0)}}return{x:n.x+(h-Z.left),y:n.y+(U-Z.top)}},[r,n,t.width,t.height,C,j,x,Y]),ae=s.useCallback((h,U)=>{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:(U-Z.top)/Z.height*t.height}},[t.width,t.height]),z=s.useCallback((h,U)=>{const Z=l&&!(U!=null&&U.preserveShape)?lC(h,n,t,x,Y,C,j):h;y(Z,U)},[y,l,n,t,x,Y,C,j]),re=s.useCallback(()=>{M(null)},[]),F=s.useCallback((h,U,Z)=>{if(!Z||b.current||S.current||A.current||f.current){re();return}const ne=ae(h,U),me=cn(g.current,R);for(const V of me)for(const Ie of V.nodes)if(Math.hypot(Ie.p.x-ne.x,Ie.p.y-ne.y)<=so){re();return}const B=Dd(me,ne);if(!B||B.distance>rl){re();return}const I=me[B.contour],ee=I==null?void 0:I.nodes[B.segment],ie=I==null?void 0:I.nodes[(B.segment+1)%((I==null?void 0:I.nodes.length)??1)],pe=!!(ee&&ie&&!jo(ee,ie));M(V=>V&&V.curved===pe&&Math.hypot(V.point.x-B.point.x,V.point.y-B.point.y)<.25?V:{point:B.point,curved:pe})},[ae,R,re]),le=h=>{var We;const U=h.metaKey||h.ctrlKey,Z=A.current;if(Z&&h.pointerId===Z.pointerId){if(h.stopPropagation(),h.preventDefault(),Z.startDistance<=0)return;const it=Q(h.clientX,h.clientY),qe=Math.hypot(it.x-Z.origin.x,it.y-Z.origin.y),tt=Math.max(RC,qe/Z.startDistance);if(!Z.moved&&Math.abs(tt-1)<1e-4)return;Z.moved=!0,p(_d(Z.startContours,Z.origin,tt));return}const ne=S.current;if(ne&&h.pointerId===ne.pointerId){h.stopPropagation(),h.preventDefault();const it=Q(h.clientX,h.clientY),{bbox:qe}=ne,tt=qe.maxX-qe.minX,et=qe.maxY-qe.minY,je=it.x-ne.origin.x,ye=it.y-ne.origin.y;let _e=je,Be=ye;if(isFinite(tt)&&isFinite(et))if(r){let we=n.x,Fe=n.x+n.width,Ke=n.y,Je=n.y+n.height;l&&(C>0&&(we=n.x+(0-x)/C,Fe=n.x+(t.width-x)/C),j>0&&(Ke=n.y+(0-Y)/j,Je=n.y+(t.height-Y)/j));const st=Math.min(we,Fe-tt),ot=Math.max(we,Fe-tt),Oe=Math.min(Ke,Je-et),Ae=Math.max(Ke,Je-et),gt=Math.min(ot,Math.max(st,qe.minX+je)),ze=Math.min(Ae,Math.max(Oe,qe.minY+ye));_e=gt-qe.minX,Be=ze-qe.minY}else{const we=qe.minX-n.x,Fe=qe.minY-n.y,Ke=Math.min(0,t.width-tt),Je=Math.max(0,t.width-tt),st=Math.min(0,t.height-et),ot=Math.max(0,t.height-et),Oe=Math.min(Je,Math.max(Ke,we+je)),Ae=Math.min(ot,Math.max(st,Fe+ye));_e=Oe-we,Be=Ae-Fe}const Ze=[];if(!U&&isFinite(tt)&&isFinite(et)){const we=R({x:qe.minX+tt/2+_e,y:qe.minY+et/2+Be}),Fe={x:t.width/2,y:t.height/2};Math.abs(we.x-Fe.x)<=ea&&(_e=D.x-qe.minX-tt/2,Ze.push(el(Fe.x,"x",t))),Math.abs(we.y-Fe.y)<=ea&&(Be=D.y-qe.minY-et/2,Ze.push(el(Fe.y,"y",t)))}if(!ne.moved&&_e===0&&Be===0)return;ne.moved=!0,X(Ze.length?Ze:fo),p(cn(ne.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 it=Q(h.clientX,h.clientY);let qe=it.x-me.origin.x,tt=it.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(Wd(me.startContours,me.selection,qe,tt));return}const B=b.current;if(!B||h.pointerId!==B.pointerId){F(h.clientX,h.clientY,w.length>0||$);return}re(),h.stopPropagation(),h.preventDefault();const I=Q(h.clientX,h.clientY);if(B.kind==="anchor"){const it={x:B.anchor.x+(I.x-B.origin.x),y:B.anchor.y+(I.y-B.origin.y)},qe=U?[]:fC(g.current,{contour:B.contour,node:B.node}),tt=U||!B.center?[]:[B.center],et=Bd(zd(qe,tt.map(_e=>_e.x),"x"),it,"x",R,ea),je=Bd(zd(qe,tt.map(_e=>_e.y),"y"),it,"y",R,ea),ye=U?it:{x:(et==null?void 0:et.value)??Zr(it.x,o),y:(je==null?void 0:je.value)??Zr(it.y,o)};if(h.shiftKey&&(Math.abs(ye.x-B.anchor.x)>Math.abs(ye.y-B.anchor.y)?ye.y=B.anchor.y:ye.x=B.anchor.x),!B.moved&&ye.x===B.anchor.x&&ye.y===B.anchor.y)return;B.moved=!0,X(bC(ye,et,je,t,R)),p(dC(g.current,B.contour,B.node,ye));return}const ee=(We=g.current[B.contour])==null?void 0:We.nodes[B.node],ie=B.mirror&&!h.altKey,pe=ie||U?null:B.kind==="in"?ee==null?void 0:ee.out:ee==null?void 0:ee.in,V=ee?R(ee.p):null,Ie=pe?R(pe):null,be=ee&&(!U||h.shiftKey)?wC(I,ee.p,ie||U?null:SC(g.current[B.contour],B.node,B.kind,R),V&&Ie?Math.hypot(Ie.x-V.x,Ie.y-V.y):null,h.shiftKey,R,H):{point:I,guides:fo},J=be.guides.length?be.point:U?I:{x:Zr(I.x,o),y:Zr(I.y,o)},He=B.kind==="in"?ee==null?void 0:ee.in:ee==null?void 0:ee.out;!B.moved&&He&&J.x===He.x&&J.y===He.y||(B.moved=!0,X(be.guides),p(pC(g.current,B.contour,B.node,B.kind,J,ie)))},te=h=>{X(fo);const U=A.current;if(U&&h.pointerId===U.pointerId){A.current=null,h.stopPropagation();const pe=v.current;pe!=null&&pe.hasPointerCapture(U.pointerId)&&pe.releasePointerCapture(U.pointerId),U.moved&&z(g.current,{preserveShape:!0});return}const Z=S.current;if(Z&&h.pointerId===Z.pointerId){S.current=null,h.stopPropagation();const pe=v.current;pe!=null&&pe.hasPointerCapture(Z.pointerId)&&pe.releasePointerCapture(Z.pointerId),Z.moved?z(g.current,{preserveShape:!0}):G([]);return}const ne=f.current;if(ne&&h.pointerId===ne.pointerId){f.current=null,h.stopPropagation();const pe=v.current;pe!=null&&pe.hasPointerCapture(ne.pointerId)&&pe.releasePointerCapture(ne.pointerId),ne.moved&&z(g.current);return}const me=b.current;if(!me||h.pointerId!==me.pointerId)return;b.current=null,h.stopPropagation();const B=v.current;B!=null&&B.hasPointerCapture(me.pointerId)&&B.releasePointerCapture(me.pointerId);const I=Math.hypot(h.clientX-me.clientOrigin.x,h.clientY-me.clientOrigin.y);if(me.moved||I>PC){me.moved&&z(g.current);return}if(!me.toggleOnRelease||h.type!=="pointerup")return;const ie=Od(g.current,me.contour,me.node);ie!==g.current&&(p(ie),z(ie))},fe=h=>{h.stopPropagation()},Pe=h=>{var U,Z;h.stopPropagation(),h.preventDefault(),re(),(U=v.current)==null||U.focus({preventScroll:!0}),S.current={pointerId:h.pointerId,origin:Q(h.clientX,h.clientY),startContours:zn(i),bbox:wi(i),moved:!1},(Z=v.current)==null||Z.setPointerCapture(h.pointerId)},xe=(h,U)=>{var I,ee;h.stopPropagation(),h.preventDefault(),re(),(I=v.current)==null||I.focus({preventScroll:!0}),G([]),d("shape");const Z=wi(i),ne=$a(Z,Mp(U)),me=il(Z,U),B=Math.hypot(me.x-ne.x,me.y-ne.y);!isFinite(B)||B<=0||(A.current={pointerId:h.pointerId,corner:U,origin:ne,startDistance:B,startContours:zn(i),moved:!1},(ee=v.current)==null||ee.setPointerCapture(h.pointerId))},de=(h,U,Z,ne)=>{var I,ee,ie,pe;h.stopPropagation(),h.preventDefault(),re(),(I=v.current)==null||I.focus({preventScroll:!0});const me=(ee=i[Z])==null?void 0:ee.nodes[ne];if(!me)return;if(h.altKey){const V=U==="anchor"?Ep(i,Z,ne):mC(i,Z,ne,U);if(V===i)return;G(U==="anchor"?[]:[{contour:Z,node:ne}]),p(V),z(V);return}const B=h.metaKey||h.ctrlKey;if(U==="anchor"&&h.shiftKey&&!B){G(V=>V.some(Ie=>Ie.contour===Z&&Ie.node===ne)?V.filter(Ie=>!(Ie.contour===Z&&Ie.node===ne)):[...V,{contour:Z,node:ne}]);return}if(U==="anchor"&&!B&&w.length>1&&w.some(V=>V.contour===Z&&V.node===ne)){f.current={pointerId:h.pointerId,origin:Q(h.clientX,h.clientY),startContours:zn(i),selection:w,moved:!1},(ie=v.current)==null||ie.setPointerCapture(h.pointerId);return}G([{contour:Z,node:ne}]),b.current={kind:U,contour:Z,node:ne,pointerId:h.pointerId,origin:Q(h.clientX,h.clientY),clientOrigin:{x:h.clientX,y:h.clientY},anchor:me.p,center:sC(i),mirror:U!=="anchor"&&!!(me.in&&me.out),toggleOnRelease:B,moved:!1},(pe=v.current)==null||pe.setPointerCapture(h.pointerId)},K=h=>{h.stopPropagation(),h.preventDefault(),re();const U=cn(i,R),Z=Dd(U,ae(h.clientX,h.clientY));if(!Z||Z.distance>rl)return;const{contours:ne,nodeIndex:me}=gC(i,Z.contour,Z.segment,Z.t);me<0||(G([{contour:Z.contour,node:me}]),p(ne),z(ne))},se=h=>{if(h.key==="="||h.key==="+"||h.key==="-"||h.key==="_"){h.preventDefault(),h.stopPropagation();const B=wi(i);if(!isFinite(B.minX)||!isFinite(B.maxX))return;const I={x:(B.minX+B.maxX)/2,y:(B.minY+B.maxY)/2},ie=h.key==="="||h.key==="+"?Xd:1/Xd,pe=_d(i,I,ie);p(pe),z(pe,{preserveShape:!0});return}if(h.key==="Escape"){h.stopPropagation(),G([]),d("none");return}if(!w.length)return;if(h.key==="Backspace"||h.key==="Delete"){h.preventDefault(),h.stopPropagation();const B=uC(i,w);if(B===i)return;G([]),p(B),z(B);return}const U=o>0?o:kC,Z=h.shiftKey?U*10:U,ne={ArrowLeft:[-Z,0],ArrowRight:[Z,0],ArrowUp:[0,-Z],ArrowDown:[0,Z]}[h.key];if(!ne)return;h.preventDefault(),h.stopPropagation();const me=Wd(i,w,ne[0],ne[1]);p(me),z(me)},ue=s.useMemo(()=>_o(cn(i,R)),[i,R]),ve=s.useMemo(()=>wi(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=$&&w.length===0&&isFinite(ve.minX)&&isFinite(ve.maxX)&&ve.maxX>ve.minX&&ve.maxY>ve.minY,Se=w.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:re,onPointerUp:te,onPointerCancel:te,onLostPointerCapture:te,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:()=>{G([]),d("none")},onClick:K}),Ce&&a.jsx("path",{className:`${e}-editor-outline`,d:ue}),Ce&&q.map((h,U)=>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}-${U}`)),a.jsx("path",{ref:m,className:`${e}-editor-body`,d:ue,fillRule:"evenodd",onPointerDown:Pe,onClick:K}),Ce&&a.jsx("path",{className:`${e}-editor-hit`,d:ue,style:{strokeWidth:LC},onClick:K}),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,U)=>h.nodes.map((Z,ne)=>{const me=w.some(I=>I.contour===U&&I.node===ne),B=R(Z.p);return a.jsxs("g",{children:[me&&w.length===1&&["in","out"].map(I=>{const ee=Z[I];if(!ee)return null;const ie=R(ee);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:B.x,y1:B.y,x2:ie.x,y2:ie.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:ie.x,cy:ie.y,r:IC}),a.jsx("circle",{className:`${e}-editor-grab`,cx:ie.x,cy:ie.y,r:so,onPointerDown:pe=>de(pe,I,U,ne),onClick:fe})]},I)}),a.jsx("rect",{className:`${e}-editor-anchor${me?` ${e}-editor-anchor-selected`:""}`,x:B.x-Wn/2,y:B.y-Wn/2,width:Wn,height:Wn,rx:Tp(Z)?Wn/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:B.x-so,y:B.y-so,width:so*2,height:so*2,onPointerDown:I=>de(I,"anchor",U,ne),onClick:fe,onDoubleClick:I=>{I.stopPropagation(),I.preventDefault();const ee=Od(i,U,ne);p(ee),z(ee)}})]},`${U}-${ne}`)})),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 U=R(il(ve,h)),Z=h==="ne"||h==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:U.x-na/2,y:U.y-na/2,width:na,height:na}),a.jsx("rect",{className:`${e}-editor-scale-grab${Z?` ${e}-editor-scale-grab-nesw`:""}`,x:U.x-ta/2,y:U.y-ta/2,width:ta,height:ta,onPointerDown:ne=>xe(ne,h),onClick:fe})]},h)})]})]})}const MC=4e3,AC=/^(?:https?:|mailto:|tel:)/i;function Ap(e){return!!e&&typeof e=="object"&&e.type==="link"}function FC(e){if(!e)return;const t=e.replace(/\s+/g,"");if(!(/^[a-z][a-z0-9+.-]*:/i.test(t)&&!AC.test(t)))return t}function NC(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,c)=>{for(const d of r){if(Ap(d)){o(d.children??[],FC(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 qd(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 _C(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(Ap(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function HC(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,b=m.y*i;g<c&&(c=g),g>d&&(d=g),b<u&&(u=b),b>p&&(p=b)}const y=(c+d)/2,v=(u+p)/2;return l.map(m=>{const g=m.x*n,b=m.y*i,S=g-y,A=b-v,f=Math.sqrt(S*S+A*A);if(f<1e-6)return m;const G=Math.max(0,f+r*t)/f;return{x:(y+S*G)/n,y:(v+A*G)/i}})})}const Ps=2,Is=2;function WC(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 Ud(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,b=e.lineHeight*l,S=e.spaceWidth*l,A=Math.max(0,e.shapeMargin??0),f=[],w=t.map((C,j)=>({token:C,originalIndex:j,width:n[j],kind:"whole"}));if(!w.length||c<=0||b<=0)return{segments:f,placed:0,height:0,capLeft:0,capTop:0,renderTokens:t};const G=Math.max(1,S*.5),q=b*D$,E=HC(i,A,c,d,o);let P=0,M=0,X=0,$=w[0].token.para,T=0,O=0,N=null;for(;P<w.length&&X<MC;){const C=M+b>d;if(C&&!u)break;const j=w[P].token.para;if(j>$+1){M+=b*(j-$-1),$=j-1,X+=1;continue}let x=C?[{x0:0,x1:c}]:U$(E,(M+q)/d,(M+b-q)/d,o).map(R=>({x0:R.x0*c,x1:R.x1*c}));p>0&&y>0&&!C&&x.length&&(N===null&&(N=X,T=x[0].x0,O=M),X-N<y&&(x=q$(x,{x0:T,x1:T+p})));const Y=x.reduce((R,H)=>Math.max(R,H.x1-H.x0),0);for(const R of x){const H=R.x1-R.x0;if(H<G)continue;if(P>=w.length||w[P].token.para!==j)break;const D=P;let Q=0;for(;P<w.length&&w[P].token.para===j;){const ae=w[P],z=P===D,re=ae.width*l,F=z?re:S+re;if(Q+F<=H){Q+=F,P+=1;continue}if(z&&H>=Y-.5&&re>c-.5){Q+=F,P+=1;continue}if(v){const te=H-Q-(z?0:S),fe=WC(ae,m,te,l,g);if(fe){const Pe={token:{...ae.token,text:fe.fragmentText},originalIndex:ae.originalIndex,width:fe.fragmentWidth,kind:"fragment"},xe={token:{...ae.token,text:fe.remainderText},originalIndex:ae.originalIndex,width:fe.remainderWidth,kind:"remainder"};w.splice(P,1,Pe,xe),Q+=(z?0:S)+fe.fragmentWidth*l,P+=1}}break}if(P>D){const ae=P>=w.length||w[P].token.para!==j;f.push({top:M,left:R.x0,width:H,from:D,to:P,justify:r==="justify"&&!ae})}if(P>=w.length||w[P].token.para!==j)break}$=j,M+=b,X+=1}let L=0;if(P>0){const C=w[P-1];L=C.kind==="fragment"?C.originalIndex:C.originalIndex+1}return{segments:f,placed:L,height:f.length?M:0,capLeft:T,capTop:O,renderTokens:w.map(C=>C.token)}}const OC=.12,DC=2,zC=10,Rs=.25,BC=e=>{const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}},jC=(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,VC=(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=BC(e);(!r||!jC(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})))},er=typeof window>"u"?s.useEffect:s.useLayoutEffect;function GC(){return typeof document>"u"?null:document.body}function XC({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:b,dropCapSize:S,showGuides:A,typography:f,imageUrl:w,imageFocalX:G,imageFocalY:q,imageScale:E,imageCustomPath:P,pathDragActive:M,pathCarryImage:X,onCarryImageConsumed:$,pathEditor:T,imageEditor:O}){var Xe,dt;const N=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[L,C]=s.useState(null),j=s.useRef(null),[x,Y]=s.useState({width:0,height:0}),[R,H]=s.useState(0),[D,Q]=s.useState(null),[ae,z]=s.useState(0),[re,F]=s.useState("none");s.useEffect(()=>{!T&&!O&&F("none")},[T,O]);const[le,te]=s.useState(null);s.useEffect(()=>{if(!w||typeof Image>"u"){te(null);return}let ge=!1;const Re=new Image;return Re.onload=()=>{ge||te({width:Re.naturalWidth,height:Re.naturalHeight})},Re.src=w,()=>{ge=!0}},[w]);const fe=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),Pe=s.useMemo(()=>NC(fe),[fe]),xe=s.useMemo(()=>_C(fe),[fe]),de=b>0&&S>1?((dt=(Xe=Pe[0])==null?void 0:Xe.text)==null?void 0:dt.charAt(0))??"":"",K=(T==null?void 0:T.contours)??null,se=s.useMemo(()=>{let ge=[];if(K){const Re=br(K);Re.length&&(ge=wo(Re,r))}if(!ge.length){const Re=i.trim(),nt=Re?Md(Re,o,r):null;nt&&nt.length?ge=nt:ge=Ys(n==="custom"?"rectangle":n)}return n==="circle"?ks(ge,x):ge},[K,n,i,o,r,x.width,x.height]),ue=T==null?void 0:T.onConvert,ve=(T==null?void 0:T.needsConversion)??!1,$e=s.useMemo(()=>{if(n==="circle")return!1;const ge=K??(i.trim()?Pi(i):null);return!!(ge&&Rp(ge,r))},[K,i,r,n]),[ke,he]=s.useState(null);er(()=>{if(!$e){ke&&he(null);return}!ke&&x.width>0&&x.height>0&&he({width:x.width,height:x.height})},[$e,x.width,x.height,ke]);const Se=s.useMemo(()=>{if(!$e||x.width<=0||x.height<=0)return se;const ge=ke??x,Re=r.width/ge.width,nt=r.height/ge.height;return se.map(ut=>ut.map(Ge=>({x:Ge.x*Re,y:Ge.y*nt})))},[se,$e,ke,r.width,r.height,x.width,x.height]),Ce=s.useMemo(()=>{if(K){const ut=br(K);if(ut.length){const Ge=wo(ut,r);return n==="circle"?ks(Ge,x):Ge}}const ge=P.trim(),Re=ge?Md(ge,o,r):null,nt=Re&&Re.length?Re:Ys(n==="custom"?"rectangle":n);return n==="circle"?ks(nt,x):nt},[K,n,P,o,r,x.width,x.height]),h=s.useMemo(()=>{if(!$e||x.width<=0||x.height<=0)return Ce;const ge=ke??x,Re=r.width/ge.width,nt=r.height/ge.height;return Ce.map(ut=>ut.map(Ge=>({x:Ge.x*Re,y:Ge.y*nt})))},[Ce,$e,ke,r.width,r.height,x.width,x.height]),U=s.useRef(null),Z=s.useRef(!1);s.useEffect(()=>{if(!(!ue||x.width<=0||x.height<=0)){if($e){if(U.current===i)return;const ge=K??(i.trim()?Pi(i):null);if(!(ge!=null&&ge.length))return;const Re=cn(ge,nt=>({x:r.x+(nt.x-r.x)/x.width*r.width,y:r.y+(nt.y-r.y)/x.height*r.height}));U.current=_o(Re),ue(Re);return}!ve||!se.length||Z.current||(Z.current=!0,ue(cn(Ip(se),ge=>({x:ge.x*wa,y:ge.y*wa}))))}},[ve,$e,ue,se,K,i,r,x.width,x.height]);const ne=s.useCallback(()=>{const ge=L;if(!ge)return;const Re=ge.getBoundingClientRect(),nt=parseFloat(window.getComputedStyle(ge).paddingTop)||0;H(Ge=>Math.abs(Ge-nt)<.5?Ge:nt);const ut={width:Re.width,height:Re.height};Y(Ge=>Math.abs(Ge.width-ut.width)<.5&&Math.abs(Ge.height-ut.height)<.5?Ge:ut)},[L]);er(()=>{const ge=L;if(!ge||typeof ResizeObserver>"u")return;ne();const Re=new ResizeObserver(ne);return Re.observe(ge),()=>Re.disconnect()},[L,ne]),er(()=>{ne()},[v,ne]),s.useEffect(()=>{const ge=typeof document<"u"?document.fonts:void 0;ge!=null&&ge.ready&&ge.ready.then(()=>{z(Re=>Re+1)})},[]),er(()=>{const ge=j.current;if(!ge)return;if(!Pe.length){Q(null);return}const Re=[],nt=document.createDocumentFragment();for(const pt of Pe){const W=document.createElement("span");Object.assign(W.style,qd(pt.leaf)),W.textContent=pt.text,nt.appendChild(W),Re.push(W)}const ut=document.createElement("span");ut.textContent=" ",nt.appendChild(ut);const Ge=document.createElement("span");Ge.textContent="-",nt.appendChild(Ge);const bt=de||"H",It=document.createElement("span");It.textContent=bt,It.style.lineHeight="1",nt.appendChild(It),ge.replaceChildren(nt);const Mt=window.getComputedStyle(ge),wt=parseFloat(Mt.fontSize)||16,Vt=parseFloat(Mt.lineHeight),jt=Number.isNaN(Vt)?wt*1.2:Vt,qt=Math.max(jt,wt),Ut=document.createElement("span");Ut.textContent=bt,Ut.style.lineHeight=`${qt}px`;const Rt=document.createElement("span");Rt.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",Ut.appendChild(Rt),ge.appendChild(Ut);const Bt=Ut.getBoundingClientRect().top,rn=Rt.getBoundingClientRect().top,vt=Math.max(1,rn-Bt);Ut.remove();let yt=vt*.8;const Qe=document.createElement("canvas").getContext("2d"),rt=pt=>`${Mt.fontStyle} ${Mt.fontWeight} ${pt}px ${Mt.fontFamily}`;if(Qe){Qe.font=rt(wt);const pt=Qe.measureText(bt).actualBoundingBoxAscent;pt>0&&(yt=pt)}const lt=S>1?(S-1)*qt+yt:yt;let Lt=wt*(lt/yt);if(Qe){Qe.font=rt(Lt);const pt=Qe.measureText(bt).actualBoundingBoxAscent;pt>0&&(Lt=Lt*(lt/pt))}It.style.fontSize=`${Lt}px`,It.style.lineHeight=`${Lt}px`;const St=document.createElement("span");St.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",It.appendChild(St);const ht=Math.max(1,St.getBoundingClientRect().top-It.getBoundingClientRect().top);St.remove();const Ot=(S-1)*qt+vt-ht,At=Re.map(pt=>pt.getBoundingClientRect().width),Gt=ut.getBoundingClientRect().width,Et=Ge.getBoundingClientRect().width,zt=de?It.getBoundingClientRect().width:0,Ft=m?Re.map(pt=>{const W=pt.firstChild;if(!(W instanceof Text)||W.data.length<4)return;const Le=document.createRange(),Ve=pt.getBoundingClientRect().left,Ne=[];for(let ft=1;ft<=W.data.length;ft+=1)Le.setStart(W,0),Le.setEnd(W,ft),Ne.push(Le.getBoundingClientRect().right-Ve);return Ne}):[];ge.replaceChildren(),Q({widths:At,spaceWidth:Gt,dashWidth:Et,charWidths:Ft,lineHeight:qt,capWidth:zt,dropCapFontSize:Lt,dropCapTopAdjust:Ot})},[Pe,f,de,b,S,ae,x.width,m]);const me=D&&de?D.capWidth+D.lineHeight*OC:0,B=Math.max(b,Math.ceil(S)),I=s.useMemo(()=>{if(!D||!Pe.length||x.width<=0||x.height<=0||!u)return 1;const ge=ut=>Ud({tokens:Pe,widths:D.widths,spaceWidth:D.spaceWidth,lineHeight:D.lineHeight,width:x.width,height:x.height,rings:Se,mode:l,align:c,scale:ut,allowOverflow:!1,capInset:me*ut,capLines:de?B:0,hyphenate:m,charWidths:D.charWidths,hyphenWidth:D.dashWidth,shapeMargin:R});if(ge(1).placed>=Pe.length)return 1;if(ge(Rs).placed<Pe.length)return Rs;let Re=Rs,nt=1;for(let ut=0;ut<zC;ut+=1){const Ge=(Re+nt)/2;ge(Ge).placed>=Pe.length?Re=Ge:nt=Ge}return Re},[D,Pe,x.width,x.height,Se,l,c,u,me,de,B,m,R]);s.useEffect(()=>{y(I)},[I,y]);const ee=u?Math.min(p,I):1,ie=s.useMemo(()=>!D||!Pe.length||x.width<=0||x.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0,renderTokens:Pe}:Ud({tokens:Pe,widths:D.widths,spaceWidth:D.spaceWidth,lineHeight:D.lineHeight,width:x.width,height:x.height,rings:Se,mode:l,align:c,scale:ee,allowOverflow:d,capInset:me*ee,capLines:de?B:0,hyphenate:m,charWidths:D.charWidths,hyphenWidth:D.dashWidth,shapeMargin:R}),[D,Pe,x.width,x.height,Se,l,c,ee,d,me,de,B,m,R]),pe=g&&Pe.length>0&&ie.placed<Pe.length,V=D?D.dropCapFontSize*ee:0,Ie=D?D.dropCapTopAdjust*ee:0,be=c==="justify"?"left":c,J=D?D.lineHeight*ee:0,He=ie.segments.length?ie.segments[ie.segments.length-1]:null,We=He?{top:He.top+J,left:He.left+He.width/2}:{top:x.height,left:x.width/2},it=!!(T&&K&&x.width>0&&x.height>0),qe=!!O,tt=(it||qe)&&x.width>0&&x.height>0,et=VC(L,tt),je=tt&&et?GC():null,ye=s.useRef(!1),_e=s.useCallback(ge=>{ye.current=ge},[]);s.useEffect(()=>{if(!it&&!qe)return;const ge=Re=>{const nt=L;if(!nt)return;const ut=nt.getBoundingClientRect();Re.clientX>=ut.left&&Re.clientX<=ut.right&&Re.clientY>=ut.top&&Re.clientY<=ut.bottom&&(Re.preventDefault(),Re.stopPropagation(),F(bt=>bt==="shape"&&ye.current?bt:bt==="shape"&&qe?"image":it?"shape":"image"))};return document.addEventListener("dblclick",ge,!0),()=>document.removeEventListener("dblclick",ge,!0)},[it,qe,L]);const Be=s.useMemo(()=>w&&x.width>0&&x.height>0?z$(h,x):null,[w,h,x.width,x.height]),Ze=s.useRef(null),we=(()=>{const ge=Ze.current;return X||!O||!le||!Be||!ge||P===ge.customPath||ge.shape!==n&&n!=="custom"?null:CC(ge.bounds,Be,le,ge.focalX,ge.focalY,ge.scale)})();er(()=>{if(M||!O||!le||!Be)return;const ge=Ze.current,Re=!!(ge&&P!==ge.customPath);Re&&we&&O.onCommit(we),Re&&X&&($==null||$()),Ze.current={rings:h,bounds:Be,focalX:(we==null?void 0:we.focalX)??G,focalY:(we==null?void 0:we.focalY)??q,scale:(we==null?void 0:we.scale)??E,customPath:P,shape:n}},[M,X,P,n,h,Be,O,le,G,q,E,we,$]);const Fe=Ze.current,Ke=!!(M&&!X&&Fe&&!we),Je=Ke&&Fe?Fe.focalX:(we==null?void 0:we.focalX)??G,st=Ke&&Fe?Fe.focalY:(we==null?void 0:we.focalY)??q,ot=Ke&&Fe?Fe.scale:(we==null?void 0:we.scale)??E,Oe=Ke&&Fe?Fe.bounds:Be,Ae=s.useMemo(()=>{if(!(x.width>0)||!(x.height>0))return"";let ge=Fd(i,K,o,r,n,x);if($e){const Re=ke??x,nt=r.width/Re.width,ut=r.height/Re.height;ge=cn(ge,Ge=>({x:Ge.x*nt,y:Ge.y*ut}))}return Nd(ge,x)||Ed(Se,x)},[i,K,o,r,n,x.width,x.height,$e,ke,Se]),gt=s.useMemo(()=>{if(!w||!(x.width>0)||!(x.height>0))return"";let ge=Fd(P,K,o,r,n,x);if($e){const Re=ke??x,nt=r.width/Re.width,ut=r.height/Re.height;ge=cn(ge,Ge=>({x:Ge.x*nt,y:Ge.y*ut}))}return Nd(ge,x)||Ed(h,x)},[w,P,K,o,r,n,x.width,x.height,$e,ke,h]),ze=`${N}-clip`,De=s.useMemo(()=>{if(!Oe)return null;const ge=le??{width:Oe.width,height:Oe.height},Re=Xi(Oe,ge,ot);return{x:Dn(Oe.width,Re.width,Je),y:Dn(Oe.height,Re.height,st),width:Re.width,height:Re.height}},[Oe,le,Je,st,ot]);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:x.width,height:x.height},viewBox:`0 0 ${x.width} ${x.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("path",{className:`${e}-shape-fill-path`,d:Ae,fillRule:"evenodd"}),w&>&&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:w,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:x.width,height:x.height},children:[a.jsx("div",{className:`${e}-measure`,ref:j,style:f,"aria-hidden":!0}),ie.segments.map((ge,Re)=>{const nt=ie.renderTokens.slice(ge.from,ge.to),ut=Re===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,bt)=>{const Mt=de&&ut&&ge.from===0&&bt===0?Ge.text.slice(1):Ge.text,wt=qd(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:Mt}):a.jsx("span",{style:wt,children:Mt});return a.jsxs("span",{children:[!ge.justify&&bt>0?" ":null,Vt]},bt)})},`${ge.from}-${ge.to}-${Re}`)}),A&&!K&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:Se.map((ge,Re)=>a.jsx("polygon",{points:ge.map(nt=>`${nt.x},${nt.y}`).join(" ")},Re))})]}),de&&D&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...f,top:`${ie.capTop+Ie}px`,left:`${ie.capLeft}px`,fontSize:`${V}px`,lineHeight:`${V}px`},children:de}),je&&et&&(K&&T||O)&&Gn.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:et.top,left:et.left,width:et.width,height:et.height,zIndex:DC,pointerEvents:"none"},children:[K&&T&&a.jsx(EC,{P:e,box:{width:et.width,height:et.height},viewBox:r,contours:K,snap:T.snap,stretchToBox:!$e,uniformStretch:n==="circle",stage:re,onStageChange:F,onSelectionChange:_e,onChange:T.onChange,onCommit:T.onCommit}),O&&Oe&&a.jsx(TC,{P:e,box:{width:et.width,height:et.height},bounds:Oe,natural:le,imageUrl:w,maskPath:gt,stage:re,onStageChange:F,focalX:Je,focalY:st,scale:ot,onChange:O.onChange,onCommit:O.onCommit})]}),je),a.jsx("div",{className:`${e}-a11y`,children:xe.map((ge,Re)=>a.jsx("p",{children:ge},Re))}),pe&&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 Fp=["diamond","parallelogram","vase","circle","shield","bobbin","custom"],qC={x:0,y:0,width:100,height:100},UC=e=>{const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?qC:{x:t[0],y:t[1],width:t[2],height:t[3]}},KC=e=>`
|
|
27246
27247
|
.${e}-wrapper {
|
|
27247
27248
|
box-sizing: border-box;
|
|
27248
27249
|
display: flex;
|
|
@@ -27471,7 +27472,7 @@ export function Burger({
|
|
|
27471
27472
|
clip-path: inset(50%);
|
|
27472
27473
|
white-space: nowrap;
|
|
27473
27474
|
}
|
|
27474
|
-
`,YC=1;function ZC({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:c}=
|
|
27475
|
+
`,YC=1;function ZC({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:c}=_.useScopedStyles(),d=s.useMemo(()=>KC(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",b=s.useMemo(()=>UC(e==null?void 0:e.pathViewBox),[e==null?void 0:e.pathViewBox]),S=(e==null?void 0:e.shapeMode)==="B"?"avoid":"contain",A=(e==null?void 0:e.textAlign)??"left",f=((e==null?void 0:e.overflowMode)??"clip")==="visible",w=((e==null?void 0:e.fitText)??"off")==="on",G=((e==null?void 0:e.hyphenate)??"off")==="on",q=_.scalingValue((e==null?void 0:e.padding)??0,u),E=(e==null?void 0:e.dropCapSize)??YC,P=Math.max(1,Math.round((e==null?void 0:e.dropCapLines)??E)),M=u&&p&&!i,X=u&&!i,[$,T]=s.useState(!1);s.useEffect(()=>{if(!u||!p){T(!1);return}const B=()=>T(!0),I=()=>T(!1),ee=["ArticleEditor.Item:drag-start","ArticleEditor.Selection:resize-start","ArticleEditor.Selection:move-start"],ie=["ArticleEditor.Item:drag-end","ArticleEditor.Selection:resize-end","ArticleEditor.Selection:move-end"];for(const pe of ee)window.addEventListener(pe,B);for(const pe of ie)window.addEventListener(pe,I);return()=>{for(const pe of ee)window.removeEventListener(pe,B);for(const pe of ie)window.removeEventListener(pe,I)}},[u,p]);const O=u&&p&&!i&&typeof l=="function",N=!$,L=Math.max(0,(e==null?void 0:e.pathSnap)??0),C=s.useRef(e??{}),j=s.useRef(""),x=[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(x!==j.current)j.current=x,C.current=e??{};else if(e){const{customPath:B,shape:I,pathFit:ee,pathViewBox:ie,imageScale:pe,imageFocalX:V,imageFocalY:Ie,image:be,...J}=e,He=C.current;for(const We of Object.keys(J))if(He[We]!==J[We]){C.current={...He,...J};break}}const[Y,R]=s.useState(null),[H,D]=s.useState(!1),[Q,ae]=s.useState(!1),z=s.useCallback(()=>ae(!1),[]),re=C.current.shape??v,F=s.useMemo(()=>!Y||Y.serialized===m?m:Y.serialized,[Y,m]);s.useEffect(()=>{O||(D(!1),ae(!1))},[O]),s.useEffect(()=>{!Y||H||Y.serialized===m&&R(null)},[Y,m,H]);const le=s.useMemo(()=>{if(!O)return null;if(Y&&(Y.base===m||Y.serialized===m))return Y.contours;const B=Pi(m);return B.length?B:null},[O,Y,m]),te=!!(g==="viewbox"&&((e==null?void 0:e.pathViewBox)??"")===Us&&le&&(v==="circle"||!Rp(le,b))),fe=s.useCallback((B,I,ee)=>{const ie=_o(B);if(R(pe=>({base:pe&&(pe.base===m||pe.serialized===m)?pe.base:m,serialized:ie,contours:B})),I){const pe=C.current,V=ee!=null&&ee.preserveShape?pe.shape:"custom",Ie={...pe,shape:V,customPath:ie};C.current=Ie,l==null||l(Ie)}},[m,l]),Pe=s.useMemo(()=>O?{contours:te?le:null,snap:L,needsConversion:!te,onConvert:B=>{const I=_o(B);R({base:I,serialized:I,contours:B});const ee={...C.current,pathFit:"viewbox",pathViewBox:Us,customPath:I};C.current=ee,l==null||l(ee)},onChange:(B,I)=>{D(!0),ae(!!(I!=null&&I.carryImage)),fe(B,!1)},onCommit:(B,I)=>{fe(B,!0,I),D(!1)}}:null,[O,te,le,L,l,fe]),xe=S==="avoid"&&!!(e!=null&&e.image),de=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]),[K,se]=s.useState(null),ue=K??de,ve=s.useCallback(B=>se(B),[]),$e=s.useCallback(B=>{se(B);const I={...C.current,imageFocalX:B.focalX,imageFocalY:B.focalY,imageScale:B.scale};C.current=I,l==null||l(I)},[l]);s.useEffect(()=>{K&&Math.abs(K.focalX-de.focalX)<1e-9&&Math.abs(K.focalY-de.focalY)<1e-9&&Math.abs(K.scale-de.scale)<1e-9&&se(null)},[K,de]);const ke=s.useMemo(()=>!O||!xe?null:{onChange:ve,onCommit:$e},[O,xe,ve,$e]),[he,Se]=s.useState(void 0),Ce=s.useRef(void 0),h=s.useCallback(B=>{const I=Ce.current;I!==void 0&&Math.abs(I-B)<.005||(Ce.current=B,Se(B))},[]),U=s.useMemo(()=>w&&typeof he=="number"?he:1,[he,w]),Z=B=>`calc(${B} * var(--${c}-fit, 1))`,ne=s.useMemo(()=>{var ee,ie,pe,V,Ie;const B=(e==null?void 0:e.textFontSize)??.012,I=Math.max((e==null?void 0:e.textLineHeight)??B,B);return{fontFamily:Do(e==null?void 0:e.textFontFamily),fontWeight:(ee=e==null?void 0:e.textFontSettings)==null?void 0:ee.fontWeight,fontStyle:(ie=e==null?void 0:e.textFontSettings)==null?void 0:ie.fontStyle,fontSize:Z(_.scalingValue(B,u)),lineHeight:Z(_.scalingValue(I,u)),letterSpacing:Z(_.scalingValue((e==null?void 0:e.textLetterSpacing)??0,u)),wordSpacing:Z(_.scalingValue((e==null?void 0:e.textWordSpacing)??0,u)),textTransform:(pe=e==null?void 0:e.textTextAppearance)==null?void 0:pe.textTransform,textDecoration:(V=e==null?void 0:e.textTextAppearance)==null?void 0:V.textDecoration,fontVariant:(Ie=e==null?void 0:e.textTextAppearance)==null?void 0:Ie.fontVariant}},[e,u,c]),me={[`--${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:{...me},children:a.jsx(XC,{P:c,item:y,shape:re,customPath:m,pathFit:g,viewBox:b,mode:S,align:A,allowOverflow:f,fitEnabled:w,scale:U,onFitScale:h,padding:q,hyphenate:G,showOverflowIndicator:X,dropCapLines:P,dropCapSize:E,showGuides:(M||O)&&N,typography:ne,imageUrl:S==="avoid"?e==null?void 0:e.image:null,imageFocalX:ue.focalX,imageFocalY:ue.focalY,imageScale:ue.scale,imageCustomPath:F,pathDragActive:H,pathCarryImage:Q,onCarryImageConsumed:z,pathEditor:N?Pe:null,imageEditor:N?ke:null})})]})}const JC=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
27475
27476
|
import type React from 'react';
|
|
27476
27477
|
import { CommonComponentProps } from '../props';
|
|
27477
27478
|
import { scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -28298,4 +28299,4 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
28298
28299
|
</>
|
|
28299
28300
|
);
|
|
28300
28301
|
}
|
|
28301
|
-
`,Kd=[...Fp],QC={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},eT={type:"object",version:1,settings:{sizing:"manual",properties:{shape:{type:"string",scope:"layout",display:{type:"shape-select",isFilled:!0,enum:Kd},enum:Kd},customPath:{type:"string",scope:"layout",title:"Path",tooltip:"SVG path (M…) or a point list (0,0 100,0 50,100). Used when Shape is set to custom.",display:{type:"full-width-input",placeholder:"M0,0 C…"}},pathSnap:{type:"number",scope:"common",title:"Snap",tooltip:"Grid the points snap to while dragging, in path units (the path box is 100 x 100). 0 is off.",min:0,max:25,step:.5,display:{type:"numeric-input"}},pathFit:{type:"string",scope:"common",title:"Path fit",tooltip:"Stretch — the drawing fills the box. Viewbox — the drawing keeps its position in path coordinates (0–100).",display:{type:"toggle-cycle",enum:["stretch","viewbox"]}},shapeMode:{type:"string",scope:"common",title:"",tooltip:"A — text fills the path. B — text flows around the path.",display:{type:"radio-group"},enum:["A","B"]},fitText:{type:"string",scope:"common",title:"Fit text",tooltip:"Scales the type down until all text fits the path.",display:{type:"toggle-cycle",enum:["off","on"]}},hyphenate:{type:"string",scope:"common",title:"Hyphenate",tooltip:"Breaks long words with a hyphen when they don’t fit on a line.",display:{type:"toggle-cycle",enum:["off","on"]}},padding:{type:"number",scope:"layout",title:"Padding",tooltip:"Insets the shape and its text on all sides.",min:0,display:{type:"numeric-input"}},dropCapLines:{type:"number",scope:"common",title:"Drop cap lines",min:1,max:8,step:1,display:{type:"numeric-input"}},dropCapSize:{type:"number",scope:"common",title:"Drop cap size",tooltip:"Height of the drop cap, in lines of body text.",min:1,max:8,step:1,display:{type:"common-numeric-input"}},image:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},backgroundColor:{type:"string",scope:"common",title:"BG Shape",display:{type:"settings-color-picker"}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...QC.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},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"}},textAlign:{type:"string",scope:"layout",title:"",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textTextAppearance:{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"]}}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"style-panel-color-picker"}},linkColor:{type:"string",scope:"common",title:"Link Default",display:{type:"style-panel-color-picker"}}},defaults:{...kp("circle"),pathSnap:0,shapeMode:"A",fitText:"off",hyphenate:"off",dropCapLines:1,dropCapSize:1,image:"https://cdn.cntrl.site/component-assets/shapedType_img.jpg",backgroundColor:"rgba(0, 0, 0, 0)",textFontFamily:"Basteleur",textFontSettings:{fontWeight:400,fontStyle:"normal"},textAlign:"center",textTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",linkColor:"#000000"},layoutDefaults:{m:{textFontSize:.037,textLineHeight:.048,textLetterSpacing:0,textWordSpacing:0,padding:0},t:{textFontSize:.018,textLineHeight:.024,textLetterSpacing:0,textWordSpacing:0,padding:0},d:{textFontSize:.032,textLineHeight:.0155,textLetterSpacing:-.001,textWordSpacing:0,padding:0}},layout:["__componentName__","shape","customPath","pathSnap","pathFit","shapeMode","fitText","hyphenate","padding","dropCapLines","dropCapSize","image"],displayRules:[{if:{name:"shapeMode",value:"B",isNotEqual:!0},then:{name:"properties.image.display.visible",value:!1}},{if:{name:"shapeMode",value:"B",isNotEqual:!0},then:{name:"properties.padding.display.visible",value:!1}},{if:{name:"shapeMode",value:"A"},then:{name:"properties.shape.display.isFilled",value:!0}},{if:{name:"shapeMode",value:"B"},then:{name:"properties.shape.display.isFilled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["shapeMode"]},{type:"row",title:"Shape",items:["shape"]},{type:"row",items:["dropCapSize","hyphenate"]},{type:"row",items:["padding","image"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"",items:["textFontFamily","textFontSettings",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textAlign","textTextAppearance"]}]}],paletteBookmark:{items:["textColor","linkColor","backgroundColor"],panelIds:["general","typeStyle"]},content:{type:"array",max:1,settings:{addItemWithoutImage:!0,addItemFromFileExplorer:!1},display:{type:"array"},items:{type:"object",properties:{text:{label:"Text",placeholder:"Add Text...",display:{type:"rich-text"}}}},default:[{text:[{type:"paragraph",children:[{text:"Le loro superficie, excelso Duca, fra loro similmente possiamo dire al medesimo modo esser proportionali commo de lor massa corporea s'è dicto, cioè irrationali per la malitia de la figura pentagona che in lo duodecedron se interpone. Ma de l'altre possano a le volte essere rationali, commo quelle del tetracedron, cubo, octocedron, per essere triangole e quadrate e note in proportione con lo diametro de la loro sphera in la quale si formano, commo s'è veduto di sopra."}]}]}]}},tT={element:ZC,id:"pretext",name:"Shaped Type",category:"typography",version:1,normalizeLayoutSettingsUpdate:(e,t)=>{const n=e.shape;return typeof n!="string"||n==="custom"||Fp.indexOf(n)===-1||(t==null?void 0:t.shape)===n?e:{...e,...kp(n)}},defaultSize:{d:{width:1420,height:640},t:{width:710,height:320},m:{width:355,height:160}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/pretext.png"},schema:eT,sourceCode:JC,assetsPaths:{content:[],parameters:[{path:"image",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily"}},nT=[nh,ch,nb,tf,uf,Sf,Df,cy,fy,$y,Uy,zv,G0,ex,_x,qx,gb,dS,Tb,PS,rw,Vw,O$,tT];exports.getAvailableStatePanels=
|
|
28302
|
+
`,Kd=[...Fp],QC={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},eT={type:"object",version:1,settings:{sizing:"manual",properties:{shape:{type:"string",scope:"layout",display:{type:"shape-select",isFilled:!0,enum:Kd},enum:Kd},customPath:{type:"string",scope:"layout",title:"Path",tooltip:"SVG path (M…) or a point list (0,0 100,0 50,100). Used when Shape is set to custom.",display:{type:"full-width-input",placeholder:"M0,0 C…"}},pathSnap:{type:"number",scope:"common",title:"Snap",tooltip:"Grid the points snap to while dragging, in path units (the path box is 100 x 100). 0 is off.",min:0,max:25,step:.5,display:{type:"numeric-input"}},pathFit:{type:"string",scope:"common",title:"Path fit",tooltip:"Stretch — the drawing fills the box. Viewbox — the drawing keeps its position in path coordinates (0–100).",display:{type:"toggle-cycle",enum:["stretch","viewbox"]}},shapeMode:{type:"string",scope:"common",title:"",tooltip:"A — text fills the path. B — text flows around the path.",display:{type:"radio-group"},enum:["A","B"]},fitText:{type:"string",scope:"common",title:"Fit text",tooltip:"Scales the type down until all text fits the path.",display:{type:"toggle-cycle",enum:["off","on"]}},hyphenate:{type:"string",scope:"common",title:"Hyphenate",tooltip:"Breaks long words with a hyphen when they don’t fit on a line.",display:{type:"toggle-cycle",enum:["off","on"]}},padding:{type:"number",scope:"layout",title:"Padding",tooltip:"Insets the shape and its text on all sides.",min:0,display:{type:"numeric-input"}},dropCapLines:{type:"number",scope:"common",title:"Drop cap lines",min:1,max:8,step:1,display:{type:"numeric-input"}},dropCapSize:{type:"number",scope:"common",title:"Drop cap size",tooltip:"Height of the drop cap, in lines of body text.",min:1,max:8,step:1,display:{type:"common-numeric-input"}},image:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},backgroundColor:{type:"string",scope:"common",title:"BG Shape",display:{type:"settings-color-picker"}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...QC.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},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"}},textAlign:{type:"string",scope:"layout",title:"",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textTextAppearance:{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"]}}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"style-panel-color-picker"}},linkColor:{type:"string",scope:"common",title:"Link Default",display:{type:"style-panel-color-picker"}}},defaults:{...kp("circle"),pathSnap:0,shapeMode:"A",fitText:"off",hyphenate:"off",dropCapLines:1,dropCapSize:1,image:"https://cdn.cntrl.site/component-assets/shapedType_img.jpg",backgroundColor:"rgba(0, 0, 0, 0)",textFontFamily:"Basteleur",textFontSettings:{fontWeight:400,fontStyle:"normal"},textAlign:"center",textTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",linkColor:"#000000"},layoutDefaults:{m:{textFontSize:.037,textLineHeight:.048,textLetterSpacing:0,textWordSpacing:0,padding:0},t:{textFontSize:.018,textLineHeight:.024,textLetterSpacing:0,textWordSpacing:0,padding:0},d:{textFontSize:.032,textLineHeight:.0155,textLetterSpacing:-.001,textWordSpacing:0,padding:0}},layout:["__componentName__","shape","customPath","pathSnap","pathFit","shapeMode","fitText","hyphenate","padding","dropCapLines","dropCapSize","image"],displayRules:[{if:{name:"shapeMode",value:"B",isNotEqual:!0},then:{name:"properties.image.display.visible",value:!1}},{if:{name:"shapeMode",value:"B",isNotEqual:!0},then:{name:"properties.padding.display.visible",value:!1}},{if:{name:"shapeMode",value:"A"},then:{name:"properties.shape.display.isFilled",value:!0}},{if:{name:"shapeMode",value:"B"},then:{name:"properties.shape.display.isFilled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["shapeMode"]},{type:"row",title:"Shape",items:["shape"]},{type:"row",items:["dropCapSize","hyphenate"]},{type:"row",items:["padding","image"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"",items:["textFontFamily","textFontSettings",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textAlign","textTextAppearance"]}]}],paletteBookmark:{items:["textColor","linkColor","backgroundColor"],panelIds:["general","typeStyle"]},content:{type:"array",max:1,settings:{addItemWithoutImage:!0,addItemFromFileExplorer:!1},display:{type:"array"},items:{type:"object",properties:{text:{label:"Text",placeholder:"Add Text...",display:{type:"rich-text"}}}},default:[{text:[{type:"paragraph",children:[{text:"Le loro superficie, excelso Duca, fra loro similmente possiamo dire al medesimo modo esser proportionali commo de lor massa corporea s'è dicto, cioè irrationali per la malitia de la figura pentagona che in lo duodecedron se interpone. Ma de l'altre possano a le volte essere rationali, commo quelle del tetracedron, cubo, octocedron, per essere triangole e quadrate e note in proportione con lo diametro de la loro sphera in la quale si formano, commo s'è veduto di sopra."}]}]}]}},tT={element:ZC,id:"pretext",name:"Shaped Type",category:"typography",version:1,normalizeLayoutSettingsUpdate:(e,t)=>{const n=e.shape;return typeof n!="string"||n==="custom"||Fp.indexOf(n)===-1||(t==null?void 0:t.shape)===n?e:{...e,...kp(n)}},defaultSize:{d:{width:1420,height:640},t:{width:710,height:320},m:{width:355,height:160}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/pretext.png"},schema:eT,sourceCode:JC,assetsPaths:{content:[],parameters:[{path:"image",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily"}},nT=[nh,ch,nb,tf,uf,Sf,Df,cy,fy,$y,Uy,zv,G0,ex,_x,qx,gb,dS,Tb,PS,rw,Vw,O$,tT];exports.getAvailableStatePanels=_.getAvailableStatePanels;exports.getUnavailableStates=_.getUnavailableStates;exports.isPanelAvailable=_.isPanelAvailable;exports.components=nT;exports.isSchemaV1=qp;
|